Skip to content

Commit 8d591b8

Browse files
shakyShanegithub-actions[bot]
authored andcommitted
Release build 11.13.0 [ci release]
1 parent 66c1c35 commit 8d591b8

File tree

34 files changed

+554
-293
lines changed

34 files changed

+554
-293
lines changed

CHANGELOG.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
- Page context (#1928)
2-
- revert scriptlet feature (#1927)
3-
- build(deps): bump @formkit/auto-animate from 0.8.2 to 0.8.4 (#1924)
4-
- build(deps): bump actions/upload-pages-artifact from 3 to 4 (#1919)
1+
- ntp: support empty strings in persistent storage (#1932)
2+
- ntp: allow visibility menu items to be disabled (#1930)
3+
- Update dark search icon (#1915)
4+
- build(deps-dev): bump the eslint group across 1 directory with 2 updates (#1925)

build/apple/pages/new-tab/dist/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,6 +2950,9 @@ body:not([data-background-kind=default]) .TabSwitcher_tabSwitcher {
29502950
background-color: var(--track-bg-color-checked-active);
29512951
border-color: var(--track-border-color-checked-active);
29522952
}
2953+
.Switch_input[disabled] {
2954+
cursor: not-allowed;
2955+
}
29532956
.Switch_switch {
29542957
box-sizing: border-box;
29552958
inline-size: var(--switch-width);
@@ -3034,6 +3037,9 @@ body:not([data-background-kind=default]) .TabSwitcher_tabSwitcher {
30343037
white-space: nowrap;
30353038
height: calc(28 * var(--px-in-rem));
30363039
}
3040+
.VisibilityMenu_menuItemLabel:has(input[disabled]) .VisibilityMenu_title {
3041+
color: var(--ntp-text-tertiary);
3042+
}
30373043
.VisibilityMenu_menuItemLabelEmbedded {
30383044
white-space: normal;
30393045
gap: 6px;

build/apple/pages/new-tab/dist/index.js

Lines changed: 86 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,7 +1614,7 @@
16141614
)), /* @__PURE__ */ _("defs", null, /* @__PURE__ */ _("linearGradient", { id: "Search-Find-Color-16_svg__b", x1: "8", x2: "8", y1: "0", y2: "16", gradientUnits: "userSpaceOnUse" }, /* @__PURE__ */ _("stop", { "stop-color": "#557FF3" }), /* @__PURE__ */ _("stop", { offset: "1", "stop-color": "#2B55CA" })), /* @__PURE__ */ _("clipPath", { id: "Search-Find-Color-16_svg__a" }, /* @__PURE__ */ _("path", { fill: "#fff", d: "M0 0h16v16H0z" }))));
16151615
}
16161616
function SearchOnDarkColorIcon(props) {
1617-
return /* @__PURE__ */ _("svg", { width: "16", height: "16", fill: "none", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ _("g", { "clip-path": "url(#Search-Find-OnDark-Color-16_svg__a)" }, /* @__PURE__ */ _("path", { fill: "#444", d: "M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z" }), /* @__PURE__ */ _(
1617+
return /* @__PURE__ */ _("svg", { width: "16", height: "16", fill: "none", viewBox: "0 0 16 16", xmlns: "http://www.w3.org/2000/svg", ...props }, /* @__PURE__ */ _("g", { "clip-path": "url(#Search-Find-OnDark-Color-16_svg__a)" }, /* @__PURE__ */ _("path", { fill: "#000", d: "M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z", opacity: ".2" }), /* @__PURE__ */ _(
16181618
"path",
16191619
{
16201620
fill: "#fff",
@@ -1920,14 +1920,14 @@
19201920
function CustomizerMenuPositionedFixed({ children }) {
19211921
return /* @__PURE__ */ _("div", { class: Customizer_default.lowerRightFixed }, children);
19221922
}
1923-
function useCustomizer({ title, id, icon, toggle, visibility, index: index2 }) {
1923+
function useCustomizer({ title, id, icon, toggle, visibility, index: index2, enabled }) {
19241924
y2(() => {
19251925
const handler = (e4) => {
1926-
e4.detail.register({ title, id, icon, toggle, visibility, index: index2 });
1926+
e4.detail.register({ title, id, icon, toggle, visibility, index: index2, enabled });
19271927
};
19281928
window.addEventListener(OPEN_EVENT, handler);
19291929
return () => window.removeEventListener(OPEN_EVENT, handler);
1930-
}, [title, id, icon, toggle, visibility, index2]);
1930+
}, [title, id, icon, toggle, visibility, index2, enabled]);
19311931
y2(() => {
19321932
window.dispatchEvent(new Event(UPDATE_EVENT));
19331933
return () => {
@@ -6743,7 +6743,7 @@
67436743
);
67446744
const { id, visibility, toggle, index: index2 } = useVisibility();
67456745
const title = t4("favorites_menu_title");
6746-
useCustomizer({ title, id, icon: /* @__PURE__ */ _(Shield, null), toggle, visibility: visibility.value, index: index2 });
6746+
useCustomizer({ title, id, icon: /* @__PURE__ */ _(Shield, null), toggle, visibility: visibility.value, index: index2, enabled: true });
67476747
if (visibility.value === "hidden") {
67486748
return null;
67496749
}
@@ -8784,7 +8784,7 @@
87848784
* @param {T} args.value
87858785
*/
87868786
update({ id, value: value2 }) {
8787-
if (string(id) && string(value2)) {
8787+
if (string(id)) {
87888788
__privateGet(this, _values).set(id, value2);
87898789
}
87908790
}
@@ -8826,7 +8826,7 @@
88268826
byId(id) {
88278827
if (typeof id !== "string") return null;
88288828
const value2 = __privateGet(this, _values).get(id);
8829-
if (!value2 || !string(value2)) return null;
8829+
if (value2 === void 0) return null;
88308830
return value2;
88318831
}
88328832
print() {
@@ -8996,20 +8996,20 @@
89968996

89978997
// pages/new-tab/app/omnibar/components/OmnibarConsumer.js
89988998
function OmnibarConsumer() {
8999-
const { state } = x2(OmnibarContext);
8999+
const { state, setEnableAi } = x2(OmnibarContext);
90009000
const { current } = useTabState();
9001-
if (state.status === "ready") {
9002-
return /* @__PURE__ */ _(OmnibarReadyState, { config: state.config, key: current.value, tabId: current.value });
9003-
}
9004-
return null;
9001+
const { visibility } = useVisibility();
9002+
if (state.status !== "ready") return null;
9003+
const visible = visibility.value === "visible";
9004+
return /* @__PURE__ */ _(k, null, state.config.showAiSetting && /* @__PURE__ */ _(AiSetting, { enableAi: state.config?.enableAi === true, setEnableAi, omnibarVisible: visible }), visible && /* @__PURE__ */ _(OmnibarReadyState, { config: state.config, key: current.value, tabId: current.value }));
90059005
}
90069006
function OmnibarReadyState({ config, tabId }) {
90079007
const { enableAi = true, showAiSetting = true, mode: defaultMode } = config;
9008-
const { setEnableAi, setMode } = x2(OmnibarContext);
9008+
const { setMode } = x2(OmnibarContext);
90099009
const modeForCurrentTab = useModeWithLocalPersistence(tabId, defaultMode);
9010-
return /* @__PURE__ */ _(k, null, showAiSetting && /* @__PURE__ */ _(AiSetting, { enableAi, setEnableAi }), /* @__PURE__ */ _(Omnibar, { mode: modeForCurrentTab, setMode, enableAi: showAiSetting && enableAi, tabId }));
9010+
return /* @__PURE__ */ _(Omnibar, { mode: modeForCurrentTab, setMode, enableAi: showAiSetting && enableAi, tabId });
90119011
}
9012-
function AiSetting({ enableAi, setEnableAi }) {
9012+
function AiSetting({ enableAi, setEnableAi, omnibarVisible }) {
90139013
const { t: t4 } = useTypedTranslationWith(
90149014
/** @type {Strings} */
90159015
{}
@@ -9020,8 +9020,12 @@
90209020
id: `_${id}-toggleAi`,
90219021
icon: /* @__PURE__ */ _(ArrowIndentCenteredIcon, { style: { color: "var(--ntp-icons-tertiary)" } }),
90229022
toggle: () => setEnableAi(!enableAi),
9023-
visibility: enableAi ? "visible" : "hidden",
9024-
index: index2 + 0.1
9023+
/**
9024+
* Duck.ai is only ever shown as 'visible' (eg: switch is checked) if the omnibar is also visible.
9025+
*/
9026+
visibility: omnibarVisible && enableAi ? "visible" : "hidden",
9027+
index: index2 + 0.1,
9028+
enabled: omnibarVisible
90259029
});
90269030
return null;
90279031
}
@@ -9049,8 +9053,8 @@
90499053
);
90509054
const sectionTitle = t4("omnibar_menuTitle");
90519055
const { visibility, id, toggle, index: index2 } = useVisibility();
9052-
useCustomizer({ title: sectionTitle, id, icon: /* @__PURE__ */ _(SearchIcon, null), toggle, visibility: visibility.value, index: index2 });
9053-
return /* @__PURE__ */ _(PersistentTextInputProvider, null, /* @__PURE__ */ _(PersistentModeProvider, null, visibility.value === "visible" && /* @__PURE__ */ _(OmnibarProvider, null, /* @__PURE__ */ _(OmnibarConsumer, null))));
9056+
useCustomizer({ title: sectionTitle, id, icon: /* @__PURE__ */ _(SearchIcon, null), toggle, visibility: visibility.value, index: index2, enabled: true });
9057+
return /* @__PURE__ */ _(PersistentTextInputProvider, null, /* @__PURE__ */ _(PersistentModeProvider, null, /* @__PURE__ */ _(OmnibarProvider, null, /* @__PURE__ */ _(OmnibarConsumer, null))));
90549058
}
90559059
var init_OmnibarCustomized = __esm({
90569060
"pages/new-tab/app/omnibar/components/OmnibarCustomized.js"() {
@@ -27537,7 +27541,7 @@
2753727541
);
2753827542
const sectionTitle = t4("protections_menuTitle");
2753927543
const { visibility, id, toggle, index: index2 } = useVisibility();
27540-
useCustomizer({ title: sectionTitle, id, icon: /* @__PURE__ */ _(DuckFoot, null), toggle, visibility: visibility.value, index: index2 });
27544+
useCustomizer({ title: sectionTitle, id, icon: /* @__PURE__ */ _(DuckFoot, null), toggle, visibility: visibility.value, index: index2, enabled: true });
2754127545
if (visibility.value === "hidden") {
2754227546
return null;
2754327547
}
@@ -28274,7 +28278,8 @@
2827428278
icon: /* @__PURE__ */ _(DuckFoot, null),
2827528279
visibility: isOpen ? "visible" : "hidden",
2827628280
toggle: (_id) => setOpen((prev) => !prev),
28277-
index: index2
28281+
index: index2,
28282+
enabled: true
2827828283
});
2827928284
return /* @__PURE__ */ _("div", null, isOpen && /* @__PURE__ */ _(Debug, { telemetry: telemetry2, isOpen: true }));
2828028285
}
@@ -28784,7 +28789,7 @@
2878428789
};
2878528790

2878628791
// shared/components/Switch/Switch.js
28787-
function Switch({ checked = false, platformName, size, theme, ...props }) {
28792+
function Switch({ checked = false, platformName, size, theme, inputProps, ...props }) {
2878828793
const { onChecked, onUnchecked, ariaLabel, pending } = props;
2878928794
function change(e4) {
2879028795
if (e4.target.checked === true) {
@@ -28802,7 +28807,8 @@
2880228807
"aria-label": ariaLabel,
2880328808
class: Switch_default.input,
2880428809
checked,
28805-
onChange: change
28810+
onChange: change,
28811+
...inputProps
2880628812
}
2880728813
), /* @__PURE__ */ _("span", { class: Switch_default.switch, style: "transition-duration: 130ms;transition-delay: 0ms;" }));
2880828814
}
@@ -28816,6 +28822,7 @@
2881628822
list: "VisibilityMenu_list",
2881728823
embedded: "VisibilityMenu_embedded",
2881828824
menuItemLabel: "VisibilityMenu_menuItemLabel",
28825+
title: "VisibilityMenu_title",
2881928826
menuItemLabelEmbedded: "VisibilityMenu_menuItemLabelEmbedded",
2882028827
svg: "VisibilityMenu_svg"
2882128828
};
@@ -28825,7 +28832,7 @@
2882528832
const platformName = usePlatformName();
2882628833
const { browser } = x2(CustomizerThemesContext);
2882728834
return /* @__PURE__ */ _("ul", { className: (0, import_classnames16.default)(VisibilityMenu_default.list, VisibilityMenu_default.embedded) }, rows.map((row) => {
28828-
return /* @__PURE__ */ _("li", { key: row.id }, /* @__PURE__ */ _("div", { class: (0, import_classnames16.default)(VisibilityMenu_default.menuItemLabel, VisibilityMenu_default.menuItemLabelEmbedded) }, /* @__PURE__ */ _("span", { className: VisibilityMenu_default.svg }, row.icon), /* @__PURE__ */ _("span", null, row.title ?? row.id), /* @__PURE__ */ _(
28835+
return /* @__PURE__ */ _("li", { key: row.id }, /* @__PURE__ */ _("div", { class: (0, import_classnames16.default)(VisibilityMenu_default.menuItemLabel, VisibilityMenu_default.menuItemLabelEmbedded) }, /* @__PURE__ */ _("span", { class: VisibilityMenu_default.svg }, row.icon), /* @__PURE__ */ _("span", { class: VisibilityMenu_default.title }, row.title ?? row.id), /* @__PURE__ */ _(
2882928836
Switch,
2883028837
{
2883128838
theme: browser.value,
@@ -28835,7 +28842,10 @@
2883528842
onChecked: () => row.toggle?.(row.id),
2883628843
onUnchecked: () => row.toggle?.(row.id),
2883728844
ariaLabel: `Toggle ${row.title}`,
28838-
pending: false
28845+
pending: false,
28846+
inputProps: {
28847+
disabled: row.enabled === false
28848+
}
2883928849
}
2884028850
)));
2884128851
}));
@@ -29891,6 +29901,45 @@
2989129901
init_utils2();
2989229902
init_CustomizerMenu();
2989329903
init_signals_module();
29904+
init_Icons2();
29905+
var ROWS = [
29906+
{
29907+
id: "omnibar",
29908+
title: "Search",
29909+
icon: /* @__PURE__ */ _(SearchIcon, null),
29910+
toggle: noop("toggle search"),
29911+
visibility: "visible",
29912+
index: 1,
29913+
enabled: true
29914+
},
29915+
{
29916+
id: "omnibar-toggleAi",
29917+
title: "Duck.ai",
29918+
icon: /* @__PURE__ */ _(ArrowIndentCenteredIcon, { style: { color: "var(--ntp-icons-tertiary)" } }),
29919+
toggle: noop("toggle Duck.ai"),
29920+
visibility: "visible",
29921+
index: 1.1,
29922+
enabled: true
29923+
},
29924+
{
29925+
id: "favorites",
29926+
title: "Favorites",
29927+
icon: /* @__PURE__ */ _(Shield, null),
29928+
toggle: noop("toggle favorites"),
29929+
visibility: "hidden",
29930+
index: 0,
29931+
enabled: true
29932+
},
29933+
{
29934+
id: "privacyStats",
29935+
title: "Privacy Stats",
29936+
icon: /* @__PURE__ */ _(DuckFoot, null),
29937+
toggle: noop("toggle favorites"),
29938+
visibility: "visible",
29939+
index: 1,
29940+
enabled: true
29941+
}
29942+
];
2989429943
var customizerExamples = {
2989529944
"customizer.backgroundSection": {
2989629945
factory: () => {
@@ -29931,27 +29980,21 @@
2993129980
}
2993229981
},
2993329982
"customizer-menu": {
29983+
factory: () => /* @__PURE__ */ _(MaxContent, null, /* @__PURE__ */ _(CustomizerButton, { isOpen: true, kind: "menu" }), /* @__PURE__ */ _("br", null), /* @__PURE__ */ _("div", { style: "width: 206px; border: 1px dotted black" }, /* @__PURE__ */ _(EmbeddedVisibilityMenu, { rows: ROWS })))
29984+
},
29985+
"customizer-menu-disabled-item": {
2993429986
factory: () => /* @__PURE__ */ _(MaxContent, null, /* @__PURE__ */ _(CustomizerButton, { isOpen: true, kind: "menu" }), /* @__PURE__ */ _("br", null), /* @__PURE__ */ _("div", { style: "width: 206px; border: 1px dotted black" }, /* @__PURE__ */ _(
2993529987
EmbeddedVisibilityMenu,
2993629988
{
29937-
rows: [
29938-
{
29939-
id: "favorites",
29940-
title: "Favorites",
29941-
icon: "star",
29942-
toggle: noop("toggle favorites"),
29943-
visibility: "hidden",
29944-
index: 0
29945-
},
29946-
{
29947-
id: "privacyStats",
29948-
title: "Privacy Stats",
29949-
icon: "shield",
29950-
toggle: noop("toggle favorites"),
29951-
visibility: "visible",
29952-
index: 1
29953-
}
29954-
]
29989+
rows: ROWS.map((row) => {
29990+
if (row.id === "omnibar") {
29991+
return { ...row, visibility: "hidden" };
29992+
}
29993+
if (row.id === "omnibar-toggleAi") {
29994+
return { ...row, enabled: false, visibility: "hidden" };
29995+
}
29996+
return row;
29997+
})
2995529998
}
2995629999
)))
2995730000
}

build/apple/pages/onboarding/dist/index.css

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -818,6 +818,9 @@ h2 {
818818
background-color: var(--track-bg-color-checked-active);
819819
border-color: var(--track-border-color-checked-active);
820820
}
821+
.Switch_input[disabled] {
822+
cursor: not-allowed;
823+
}
821824
.Switch_switch {
822825
box-sizing: border-box;
823826
inline-size: var(--switch-width);

build/apple/pages/onboarding/dist/index.js

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/integration/pages/new-tab/dist/index.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,6 +2950,9 @@ body:not([data-background-kind=default]) .TabSwitcher_tabSwitcher {
29502950
background-color: var(--track-bg-color-checked-active);
29512951
border-color: var(--track-border-color-checked-active);
29522952
}
2953+
.Switch_input[disabled] {
2954+
cursor: not-allowed;
2955+
}
29532956
.Switch_switch {
29542957
box-sizing: border-box;
29552958
inline-size: var(--switch-width);
@@ -3034,6 +3037,9 @@ body:not([data-background-kind=default]) .TabSwitcher_tabSwitcher {
30343037
white-space: nowrap;
30353038
height: calc(28 * var(--px-in-rem));
30363039
}
3040+
.VisibilityMenu_menuItemLabel:has(input[disabled]) .VisibilityMenu_title {
3041+
color: var(--ntp-text-tertiary);
3042+
}
30373043
.VisibilityMenu_menuItemLabelEmbedded {
30383044
white-space: normal;
30393045
gap: 6px;

0 commit comments

Comments
 (0)