PluginProbe
Gutenberg / trunk
Gutenberg vtrunk
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/scripts/preferences/index.js +29 -24 23.0.1 → trunk View file →
@@ -1,4 +1,5 @@
1 +(function() {
1 2 "use strict";
2 3 var wp;
3 4 (wp ||= {}).preferences = (() => {
4 5 var __create = Object.create;
@@ -117,13 +118,19 @@
117 118
118 119 // packages/icons/build-module/icon/index.mjs
119 120 var import_element = __toESM(require_element(), 1);
120 121 var icon_default = (0, import_element.forwardRef)(
121 - ({ icon, size = 24, ...props }, ref) => {
122 + ({ icon, size = 24, style, ...props }, ref) => {
123 + const intrinsicStyle = icon.props.style;
124 + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
122 125 return (0, import_element.cloneElement)(icon, {
123 126 width: size,
124 127 height: size,
125 128 ...props,
129 + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
130 + // stroke-based icons) is preserved unless the consumer overrides
131 + // the same property explicitly.
132 + ...mergedStyle ? { style: mergedStyle } : {},
126 133 ref
127 134 });
128 135 }
129 136 );
@@ -130,19 +137,19 @@
130 137
131 138 // packages/icons/build-module/library/check.mjs
132 139 var import_primitives = __toESM(require_primitives(), 1);
133 140 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
134 - var check_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });
141 + var check_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M7 12L10 15L17 8", vectorEffect: "non-scaling-stroke" }) });
135 142
136 143 // packages/icons/build-module/library/chevron-left.mjs
137 144 var import_primitives2 = __toESM(require_primitives(), 1);
138 145 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
139 - var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) });
146 + var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) });
140 147
141 148 // packages/icons/build-module/library/chevron-right.mjs
142 149 var import_primitives3 = __toESM(require_primitives(), 1);
143 150 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
144 - var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
151 + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
145 152
146 153 // packages/preferences/build-module/components/preference-toggle-menu-item/index.mjs
147 154 var import_a11y = __toESM(require_a11y(), 1);
148 155
@@ -505,28 +512,24 @@
505 512 ) });
506 513 } else {
507 514 modalContent = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.Navigator, { initialPath: "/", className: "preferences__provider", children: [
508 515 /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.Card, { isBorderless: true, size: "small", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalItemGroup, { children: tabs.map((tab) => {
509 - return (
510 - // @ts-expect-error: Navigator.Button is currently typed in a way that prevents Item from being passed in
511 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
512 - import_components4.Navigator.Button,
513 - {
514 - path: `/${tab.name}`,
515 - as: import_components4.__experimentalItem,
516 - isAction: true,
517 - children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.__experimentalHStack, { justify: "space-between", children: [
518 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalTruncate, { children: tab.title }) }),
519 - /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
520 - icon_default,
521 - {
522 - icon: (0, import_i18n3.isRTL)() ? chevron_left_default : chevron_right_default
523 - }
524 - ) })
525 - ] })
526 - },
527 - tab.name
528 - )
516 + return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
517 + import_components4.Navigator.Button,
518 + {
519 + path: `/${tab.name}`,
520 + as: import_components4.__experimentalItem,
521 + children: /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_components4.__experimentalHStack, { justify: "space-between", children: [
522 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.__experimentalTruncate, { children: tab.title }) }),
523 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_components4.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
524 + icon_default,
525 + {
526 + icon: (0, import_i18n3.isRTL)() ? chevron_left_default : chevron_right_default
527 + }
528 + ) })
529 + ] })
530 + },
531 + tab.name
529 532 );
530 533 }) }) }) }) }),
531 534 sections.length && sections.map((section) => {
532 535 return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -574,6 +577,8 @@
574 577 PreferencesModalSection: preferences_modal_section_default,
575 578 PreferencesModalTabs
576 579 });
577 580 return __toCommonJS(index_exports);
581 +})();
582 +(window.wp ||= {}).preferences = wp.preferences;
578 583 })();
579 584 //# sourceMappingURL=index.js.map