summaryrefslogtreecommitdiffstats
path: root/browser/components/aboutwelcome/content
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-15 03:35:49 +0000
commitd8bbc7858622b6d9c278469aab701ca0b609cddf (patch)
treeeff41dc61d9f714852212739e6b3738b82a2af87 /browser/components/aboutwelcome/content
parentReleasing progress-linux version 125.0.3-1~progress7.99u1. (diff)
downloadfirefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.tar.xz
firefox-d8bbc7858622b6d9c278469aab701ca0b609cddf.zip
Merging upstream version 126.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--browser/components/aboutwelcome/content-src/aboutwelcome.scss139
-rw-r--r--browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx16
-rw-r--r--browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx55
-rw-r--r--browser/components/aboutwelcome/content-src/components/Themes.jsx9
-rw-r--r--browser/components/aboutwelcome/content/aboutwelcome.bundle.js36
-rw-r--r--browser/components/aboutwelcome/content/aboutwelcome.css106
6 files changed, 321 insertions, 40 deletions
diff --git a/browser/components/aboutwelcome/content-src/aboutwelcome.scss b/browser/components/aboutwelcome/content-src/aboutwelcome.scss
index 9174fe2439..07bfcd2c96 100644
--- a/browser/components/aboutwelcome/content-src/aboutwelcome.scss
+++ b/browser/components/aboutwelcome/content-src/aboutwelcome.scss
@@ -1139,6 +1139,38 @@ html {
&[no-rdm] {
width: 800px;
+
+ &[reverse-split] {
+ flex-direction: row-reverse;
+
+ .section-main {
+ .main-content {
+ border-radius: inherit;
+ }
+
+ margin: auto;
+ margin-inline-end: 0;
+ border-radius: 8px 0 0 8px;
+
+ &:dir(rtl) {
+ border-radius: 0 8px 8px 0;
+ margin: auto;
+ margin-inline-end: 0;
+ }
+ }
+
+ .section-secondary {
+ margin: auto;
+ margin-inline-start: 0;
+ border-radius: 0 8px 8px 0;
+
+ &:dir(rtl) {
+ border-radius: 8px 0 0 8px;
+ margin: auto;
+ margin-inline-start: 0;
+ }
+ }
+ }
}
}
@@ -1372,6 +1404,107 @@ html {
outline: 2px solid var(--in-content-primary-button-background);
}
+ // newtab wallpaper specific styles
+ &.wallpaper {
+ justify-content: center;
+ gap: 10px;
+
+ &:hover, &:focus-within {
+ outline: none;
+ }
+
+ .theme {
+ flex: unset;
+ width: unset;
+ transition: var(--transition);
+
+ &:has(.input:focus) {
+ outline: 2px solid var(--in-content-primary-button-background);
+ outline-offset: 2px;
+ }
+
+ .icon {
+ width: 116px;
+ height: 86px;
+ border-radius: 8px;
+ box-shadow: 0 1px 2px 0 #3A394433;
+
+ &:hover {
+ filter: brightness(45%);
+ }
+
+ // dark theme wallpapers
+ &.dark-landscape {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-landscape.avif');
+ }
+
+ &.dark-beach {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-beach.avif');
+ }
+
+ &.dark-color {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-color.avif');
+ }
+
+ &.dark-mountain {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-mountain.avif');
+ }
+
+ &.dark-panda {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-panda.avif');
+ }
+
+ &.dark-sky {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/dark-sky.avif');
+ }
+
+ // light theme wallpapers
+ &.light-beach {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-beach.avif');
+ }
+
+ &.light-color {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-color.avif');
+ }
+
+ &.light-landscape {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-landscape.avif');
+ }
+
+ &.light-mountain {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-mountain.avif');
+ }
+
+ &.light-panda {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-panda.avif');
+ }
+
+ &.light-sky {
+ background-image: url('chrome://activity-stream/content/data/content/assets/wallpapers/light-sky.avif');
+ }
+ }
+ }
+
+ .dark {
+ display: none;
+ }
+
+ .text {
+ display: none;
+ }
+
+ @media (prefers-color-scheme: dark) {
+ .light {
+ display: none;
+ }
+
+ .dark {
+ display: block;
+ }
+ }
+
+ }
+
.theme {
align-items: center;
display: flex;
@@ -1405,13 +1538,17 @@ html {
transform: scaleX(-1);
}
- &:focus,
+ &:focus-visible,
&:active,
&.selected {
outline: 2px solid var(--in-content-primary-button-background);
outline-offset: 2px;
}
+ &.selected {
+ outline-color: var(--color-accent-primary-active);
+ }
+
&.light {
background-image: url('resource://builtin-themes/light/icon.svg');
}
diff --git a/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx b/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx
index 034055bf3d..3ccbd71f40 100644
--- a/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx
+++ b/browser/components/aboutwelcome/content-src/components/MultiStageAboutWelcome.jsx
@@ -463,9 +463,21 @@ export class WelcomeScreen extends React.PureComponent {
action.theme === "<event>"
? event.currentTarget.value
: this.props.initialTheme || action.theme;
-
this.props.setActiveTheme(themeToUse);
- window.AWSelectTheme(themeToUse);
+ if (props.content.tiles?.category?.type === "wallpaper") {
+ const theme = themeToUse.split("-")?.[1];
+ let actionWallpaper = { ...props.content.tiles.category.action };
+ actionWallpaper.data.actions.forEach(async wpAction => {
+ if (wpAction.data.pref.name?.includes("dark")) {
+ wpAction.data.pref.value = `dark-${theme}`;
+ } else {
+ wpAction.data.pref.value = `light-${theme}`;
+ }
+ await AboutWelcomeUtils.handleUserAction(actionWallpaper);
+ });
+ } else {
+ window.AWSelectTheme(themeToUse);
+ }
}
// If the action has persistActiveTheme: true, we set the initial theme to the currently active theme
diff --git a/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx b/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx
index 59771e4e48..b6e1ffa6b5 100644
--- a/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx
+++ b/browser/components/aboutwelcome/content-src/components/MultiStageProtonScreen.jsx
@@ -570,32 +570,39 @@ export class ProtonScreen extends React.PureComponent {
</div>
) : null}
- <div className="main-content-inner">
- <div className={`welcome-text ${content.title_style || ""}`}>
- {content.title ? this.renderTitle(content) : null}
+ <div
+ className="main-content-inner"
+ style={{
+ justifyContent: content.split_content_justify_content,
+ }}
+ >
+ {content.title || content.subtitle ? (
+ <div className={`welcome-text ${content.title_style || ""}`}>
+ {content.title ? this.renderTitle(content) : null}
- {content.subtitle ? (
- <Localized text={content.subtitle}>
- <h2
- data-l10n-args={JSON.stringify({
- "addon-name": this.props.addonName,
- ...this.props.appAndSystemLocaleInfo?.displayNames,
- })}
- aria-flowto={
- this.props.messageId?.includes("FEATURE_TOUR")
- ? "steps"
- : ""
- }
+ {content.subtitle ? (
+ <Localized text={content.subtitle}>
+ <h2
+ data-l10n-args={JSON.stringify({
+ "addon-name": this.props.addonName,
+ ...this.props.appAndSystemLocaleInfo?.displayNames,
+ })}
+ aria-flowto={
+ this.props.messageId?.includes("FEATURE_TOUR")
+ ? "steps"
+ : ""
+ }
+ />
+ </Localized>
+ ) : null}
+ {content.cta_paragraph ? (
+ <CTAParagraph
+ content={content.cta_paragraph}
+ handleAction={this.props.handleAction}
/>
- </Localized>
- ) : null}
- {content.cta_paragraph ? (
- <CTAParagraph
- content={content.cta_paragraph}
- handleAction={this.props.handleAction}
- />
- ) : null}
- </div>
+ ) : null}
+ </div>
+ ) : null}
{content.video_container ? (
<OnboardingVideo
content={content.video_container}
diff --git a/browser/components/aboutwelcome/content-src/components/Themes.jsx b/browser/components/aboutwelcome/content-src/components/Themes.jsx
index 0ee986f982..e430ecf3aa 100644
--- a/browser/components/aboutwelcome/content-src/components/Themes.jsx
+++ b/browser/components/aboutwelcome/content-src/components/Themes.jsx
@@ -6,28 +6,29 @@ import React from "react";
import { Localized } from "./MSLocalized";
export const Themes = props => {
+ const category = props.content.tiles?.category?.type;
return (
<div className="tiles-theme-container">
<div>
- <fieldset className="tiles-theme-section">
+ <fieldset className={`tiles-theme-section ${category}`}>
<Localized text={props.content.subtitle}>
<legend className="sr-only" />
</Localized>
{props.content.tiles.data.map(
- ({ theme, label, tooltip, description }) => (
+ ({ theme, label, tooltip, description, type }) => (
<Localized
key={theme + label}
text={typeof tooltip === "object" ? tooltip : {}}
>
{/* eslint-disable-next-line jsx-a11y/label-has-associated-control */}
- <label className="theme" title={theme + label}>
+ <label className={`theme ${type}`} title={theme + label}>
<Localized
text={typeof description === "object" ? description : {}}
>
<input
type="radio"
value={theme}
- name="theme"
+ name={category === "wallpaper" ? theme : "theme"}
checked={theme === props.activeTheme}
className="sr-only input"
onClick={props.handleAction}
diff --git a/browser/components/aboutwelcome/content/aboutwelcome.bundle.js b/browser/components/aboutwelcome/content/aboutwelcome.bundle.js
index 0d96257677..11a398e960 100644
--- a/browser/components/aboutwelcome/content/aboutwelcome.bundle.js
+++ b/browser/components/aboutwelcome/content/aboutwelcome.bundle.js
@@ -560,7 +560,22 @@ class WelcomeScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCo
if (action.theme) {
let themeToUse = action.theme === "<event>" ? event.currentTarget.value : this.props.initialTheme || action.theme;
this.props.setActiveTheme(themeToUse);
- window.AWSelectTheme(themeToUse);
+ if (props.content.tiles?.category?.type === "wallpaper") {
+ const theme = themeToUse.split("-")?.[1];
+ let actionWallpaper = {
+ ...props.content.tiles.category.action
+ };
+ actionWallpaper.data.actions.forEach(async wpAction => {
+ if (wpAction.data.pref.name?.includes("dark")) {
+ wpAction.data.pref.value = `dark-${theme}`;
+ } else {
+ wpAction.data.pref.value = `light-${theme}`;
+ }
+ await _lib_aboutwelcome_utils_mjs__WEBPACK_IMPORTED_MODULE_2__.AboutWelcomeUtils.handleUserAction(actionWallpaper);
+ });
+ } else {
+ window.AWSelectTheme(themeToUse);
+ }
}
// If the action has persistActiveTheme: true, we set the initial theme to the currently active theme
@@ -1214,8 +1229,11 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
alt: "",
role: "presentation"
})) : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
- className: "main-content-inner"
- }, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
+ className: "main-content-inner",
+ style: {
+ justifyContent: content.split_content_justify_content
+ }
+ }, content.title || content.subtitle ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: `welcome-text ${content.title_style || ""}`
}, content.title ? this.renderTitle(content) : null, content.subtitle ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, {
text: content.subtitle
@@ -1228,7 +1246,7 @@ class ProtonScreen extends (react__WEBPACK_IMPORTED_MODULE_0___default().PureCom
})) : null, content.cta_paragraph ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_CTAParagraph__WEBPACK_IMPORTED_MODULE_8__.CTAParagraph, {
content: content.cta_paragraph,
handleAction: this.props.handleAction
- }) : null), content.video_container ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OnboardingVideo__WEBPACK_IMPORTED_MODULE_10__.OnboardingVideo, {
+ }) : null) : null, content.video_container ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_OnboardingVideo__WEBPACK_IMPORTED_MODULE_10__.OnboardingVideo, {
content: content.video_container,
handleAction: this.props.handleAction
}) : null, this.renderContentTiles(), this.renderLanguageSwitcher(), content.above_button_content ? this.renderOrderedContent(content.above_button_content) : null, !hideStepsIndicator && aboveButtonStepsIndicator ? this.renderStepsIndicator() : null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ProtonScreenActionButtons, {
@@ -1448,10 +1466,11 @@ __webpack_require__.r(__webpack_exports__);
const Themes = props => {
+ const category = props.content.tiles?.category?.type;
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", {
className: "tiles-theme-container"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("div", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("fieldset", {
- className: "tiles-theme-section"
+ className: `tiles-theme-section ${category}`
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, {
text: props.content.subtitle
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("legend", {
@@ -1460,19 +1479,20 @@ const Themes = props => {
theme,
label,
tooltip,
- description
+ description,
+ type
}) => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, {
key: theme + label,
text: typeof tooltip === "object" ? tooltip : {}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("label", {
- className: "theme",
+ className: `theme ${type}`,
title: theme + label
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement(_MSLocalized__WEBPACK_IMPORTED_MODULE_1__.Localized, {
text: typeof description === "object" ? description : {}
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default().createElement("input", {
type: "radio",
value: theme,
- name: "theme",
+ name: category === "wallpaper" ? theme : "theme",
checked: theme === props.activeTheme,
className: "sr-only input",
onClick: props.handleAction
diff --git a/browser/components/aboutwelcome/content/aboutwelcome.css b/browser/components/aboutwelcome/content/aboutwelcome.css
index aa0445e0ef..4e86b29e5d 100644
--- a/browser/components/aboutwelcome/content/aboutwelcome.css
+++ b/browser/components/aboutwelcome/content/aboutwelcome.css
@@ -1896,6 +1896,32 @@ html {
.onboardingContainer .screen[pos=split][no-rdm] {
width: 800px;
}
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] {
+ flex-direction: row-reverse;
+ }
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] .section-main {
+ margin: auto;
+ margin-inline-end: 0;
+ border-radius: 8px 0 0 8px;
+ }
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] .section-main .main-content {
+ border-radius: inherit;
+ }
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] .section-main:dir(rtl) {
+ border-radius: 0 8px 8px 0;
+ margin: auto;
+ margin-inline-end: 0;
+ }
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] .section-secondary {
+ margin: auto;
+ margin-inline-start: 0;
+ border-radius: 0 8px 8px 0;
+ }
+ .onboardingContainer .screen[pos=split][no-rdm][reverse-split] .section-secondary:dir(rtl) {
+ border-radius: 8px 0 0 8px;
+ margin: auto;
+ margin-inline-start: 0;
+ }
}
@media only screen and (height <= 650px) and (800px <= width <= 990px) {
.onboardingContainer .screen[pos=split] .section-main .secondary-cta.top {
@@ -2091,6 +2117,81 @@ html {
border-radius: 8px;
outline: 2px solid var(--in-content-primary-button-background);
}
+.onboardingContainer .tiles-theme-section.wallpaper {
+ justify-content: center;
+ gap: 10px;
+}
+.onboardingContainer .tiles-theme-section.wallpaper:hover, .onboardingContainer .tiles-theme-section.wallpaper:focus-within {
+ outline: none;
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme {
+ flex: unset;
+ width: unset;
+ transition: var(--transition);
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme:has(.input:focus) {
+ outline: 2px solid var(--in-content-primary-button-background);
+ outline-offset: 2px;
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon {
+ width: 116px;
+ height: 86px;
+ border-radius: 8px;
+ box-shadow: 0 1px 2px 0 rgba(58, 57, 68, 0.2);
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon:hover {
+ filter: brightness(45%);
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-landscape {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-landscape.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-beach {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-beach.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-color {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-color.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-mountain {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-mountain.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-panda {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-panda.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.dark-sky {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/dark-sky.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-beach {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-beach.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-color {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-color.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-landscape {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-landscape.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-mountain {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-mountain.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-panda {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-panda.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .theme .icon.light-sky {
+ background-image: url("chrome://activity-stream/content/data/content/assets/wallpapers/light-sky.avif");
+}
+.onboardingContainer .tiles-theme-section.wallpaper .dark {
+ display: none;
+}
+.onboardingContainer .tiles-theme-section.wallpaper .text {
+ display: none;
+}
+@media (prefers-color-scheme: dark) {
+ .onboardingContainer .tiles-theme-section.wallpaper .light {
+ display: none;
+ }
+ .onboardingContainer .tiles-theme-section.wallpaper .dark {
+ display: block;
+ }
+}
.onboardingContainer .tiles-theme-section .theme {
align-items: center;
display: flex;
@@ -2121,10 +2222,13 @@ html {
.onboardingContainer .tiles-theme-section .theme .icon:dir(rtl) {
transform: scaleX(-1);
}
-.onboardingContainer .tiles-theme-section .theme .icon:focus, .onboardingContainer .tiles-theme-section .theme .icon:active, .onboardingContainer .tiles-theme-section .theme .icon.selected {
+.onboardingContainer .tiles-theme-section .theme .icon:focus-visible, .onboardingContainer .tiles-theme-section .theme .icon:active, .onboardingContainer .tiles-theme-section .theme .icon.selected {
outline: 2px solid var(--in-content-primary-button-background);
outline-offset: 2px;
}
+.onboardingContainer .tiles-theme-section .theme .icon.selected {
+ outline-color: var(--color-accent-primary-active);
+}
.onboardingContainer .tiles-theme-section .theme .icon.light {
background-image: url("resource://builtin-themes/light/icon.svg");
}