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/commands/index.js +19 -5 23.9.0 → trunk View file →
@@ -2581,13 +2581,19 @@
2581 2581
2582 2582 // packages/icons/build-module/icon/index.mjs
2583 2583 var import_element = __toESM(require_element(), 1);
2584 2584 var icon_default = (0, import_element.forwardRef)(
2585 - ({ icon, size = 24, ...props }, ref) => {
2585 + ({ icon, size = 24, style, ...props }, ref) => {
2586 + const intrinsicStyle = icon.props.style;
2587 + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
2586 2588 return (0, import_element.cloneElement)(icon, {
2587 2589 width: size,
2588 2590 height: size,
2589 2591 ...props,
2592 + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
2593 + // stroke-based icons) is preserved unless the consumer overrides
2594 + // the same property explicitly.
2595 + ...mergedStyle ? { style: mergedStyle } : {},
2590 2596 ref
2591 2597 });
2592 2598 }
2593 2599 );
@@ -2594,14 +2600,14 @@
2594 2600
2595 2601 // packages/icons/build-module/library/arrow-right.mjs
2596 2602 var import_primitives = __toESM(require_primitives(), 1);
2597 2603 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
2598 - var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });
2604 + var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime8.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_runtime8.jsx)(import_primitives.Path, { d: "M4 12L19 12M14 17L19 12L14 7", vectorEffect: "non-scaling-stroke" }) });
2599 2605
2600 2606 // packages/icons/build-module/library/search.mjs
2601 2607 var import_primitives2 = __toESM(require_primitives(), 1);
2602 2608 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
2603 - var search_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });
2609 + var search_default = /* @__PURE__ */ (0, import_jsx_runtime9.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_runtime9.jsx)(import_primitives2.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z", vectorEffect: "non-scaling-stroke" }) });
2604 2610
2605 2611 // packages/commands/build-module/store/index.mjs
2606 2612 var import_data3 = __toESM(require_data(), 1);
2607 2613
@@ -3315,15 +3321,23 @@
3315 3321 var import_element6 = __toESM(require_element(), 1);
3316 3322 var import_data8 = __toESM(require_data(), 1);
3317 3323 function useCommandLoader(loader) {
3318 3324 const { registerCommandLoader: registerCommandLoader2, unregisterCommandLoader: unregisterCommandLoader2 } = (0, import_data8.useDispatch)(store);
3325 + const currentHookRef = (0, import_element6.useRef)(loader.hook);
3319 3326 (0, import_element6.useEffect)(() => {
3327 + currentHookRef.current = loader.hook;
3328 + }, [loader.hook]);
3329 + const hook = (0, import_element6.useCallback)(
3330 + (...args) => currentHookRef.current(...args),
3331 + []
3332 + );
3333 + (0, import_element6.useEffect)(() => {
3320 3334 if (loader.disabled) {
3321 3335 return;
3322 3336 }
3323 3337 registerCommandLoader2({
3324 3338 name: loader.name,
3325 - hook: loader.hook,
3339 + hook,
3326 3340 context: loader.context,
3327 3341 category: loader.category
3328 3342 });
3329 3343 return () => {
@@ -3330,9 +3344,9 @@
3330 3344 unregisterCommandLoader2(loader.name);
3331 3345 };
3332 3346 }, [
3333 3347 loader.name,
3334 - loader.hook,
3348 + hook,
3335 3349 loader.context,
3336 3350 loader.category,
3337 3351 loader.disabled,
3338 3352 registerCommandLoader2,