| @@ -149,22 +149,8 @@ | ||
| 149 | 149 | module.exports = window.wp.keyboardShortcuts; |
| 150 | 150 | } |
| 151 | 151 | }); |
| 152 | 152 | |
| 153 | - // vendor-external:react | |
| 154 | - var require_react = __commonJS({ | |
| 155 | - "vendor-external:react"(exports, module) { | |
| 156 | - module.exports = window.React; | |
| 157 | - } | |
| 158 | - }); | |
| 159 | - | |
| 160 | - // package-external:@wordpress/private-apis | |
| 161 | - var require_private_apis = __commonJS({ | |
| 162 | - "package-external:@wordpress/private-apis"(exports, module) { | |
| 163 | - module.exports = window.wp.privateApis; | |
| 164 | - } | |
| 165 | - }); | |
| 166 | - | |
| 167 | 153 | // node_modules/fast-deep-equal/es6/index.js |
| 168 | 154 | var require_es6 = __commonJS({ |
| 169 | 155 | "node_modules/fast-deep-equal/es6/index.js"(exports, module) { |
| 170 | 156 | "use strict"; |
| @@ -226,8 +212,15 @@ | ||
| 226 | 212 | module.exports = window.wp.isShallowEqual; |
| 227 | 213 | } |
| 228 | 214 | }); |
| 229 | 215 | |
| 216 | + // package-external:@wordpress/private-apis | |
| 217 | + var require_private_apis = __commonJS({ | |
| 218 | + "package-external:@wordpress/private-apis"(exports, module) { | |
| 219 | + module.exports = window.wp.privateApis; | |
| 220 | + } | |
| 221 | + }); | |
| 222 | + | |
| 230 | 223 | // package-external:@wordpress/dom |
| 231 | 224 | var require_dom = __commonJS({ |
| 232 | 225 | "package-external:@wordpress/dom"(exports, module) { |
| 233 | 226 | module.exports = window.wp.dom; |
| @@ -239,9 +232,9 @@ | ||
| 239 | 232 | __export(index_exports, { |
| 240 | 233 | initialize: () => initialize, |
| 241 | 234 | store: () => store |
| 242 | 235 | }); |
| 243 | - var import_element18 = __toESM(require_element(), 1); | |
| 236 | + var import_element17 = __toESM(require_element(), 1); | |
| 244 | 237 | var import_block_library2 = __toESM(require_block_library(), 1); |
| 245 | 238 | var import_widgets5 = __toESM(require_widgets(), 1); |
| 246 | 239 | var import_blocks2 = __toESM(require_blocks(), 1); |
| 247 | 240 | var import_data17 = __toESM(require_data(), 1); |
| @@ -247,9 +240,9 @@ | ||
| 247 | 240 | var import_data17 = __toESM(require_data(), 1); |
| 248 | 241 | var import_preferences4 = __toESM(require_preferences(), 1); |
| 249 | 242 | |
| 250 | 243 | // packages/customize-widgets/build-module/components/customize-widgets/index.mjs |
| 251 | - var import_element17 = __toESM(require_element(), 1); | |
| 244 | + var import_element16 = __toESM(require_element(), 1); | |
| 252 | 245 | var import_components8 = __toESM(require_components(), 1); |
| 253 | 246 | |
| 254 | 247 | // packages/customize-widgets/build-module/components/error-boundary/index.mjs |
| 255 | 248 | var import_element = __toESM(require_element(), 1); |
| @@ -295,9 +288,9 @@ | ||
| 295 | 288 | // packages/customize-widgets/build-module/components/sidebar-block-editor/index.mjs |
| 296 | 289 | var import_compose3 = __toESM(require_compose(), 1); |
| 297 | 290 | var import_core_data = __toESM(require_core_data(), 1); |
| 298 | 291 | var import_data12 = __toESM(require_data(), 1); |
| 299 | - var import_element14 = __toESM(require_element(), 1); | |
| 292 | + var import_element13 = __toESM(require_element(), 1); | |
| 300 | 293 | var import_block_editor8 = __toESM(require_block_editor(), 1); |
| 301 | 294 | var import_media_utils = __toESM(require_media_utils(), 1); |
| 302 | 295 | var import_preferences3 = __toESM(require_preferences(), 1); |
| 303 | 296 | var import_block_library = __toESM(require_block_library(), 1); |
| @@ -352,9 +345,9 @@ | ||
| 352 | 345 | |
| 353 | 346 | // packages/customize-widgets/build-module/components/header/index.mjs |
| 354 | 347 | var import_components6 = __toESM(require_components(), 1); |
| 355 | 348 | var import_block_editor4 = __toESM(require_block_editor(), 1); |
| 356 | - var import_element7 = __toESM(require_element(), 1); | |
| 349 | + var import_element6 = __toESM(require_element(), 1); | |
| 357 | 350 | var import_keycodes3 = __toESM(require_keycodes(), 1); |
| 358 | 351 | var import_i18n7 = __toESM(require_i18n(), 1); |
| 359 | 352 | |
| 360 | 353 | // packages/icons/build-module/library/close-small.mjs |
| @@ -359,34 +352,34 @@ | ||
| 359 | 352 | |
| 360 | 353 | // packages/icons/build-module/library/close-small.mjs |
| 361 | 354 | var import_primitives = __toESM(require_primitives(), 1); |
| 362 | 355 | var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); |
| 363 | - var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); | |
| 356 | + var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); | |
| 364 | 357 | |
| 365 | 358 | // packages/icons/build-module/library/external.mjs |
| 366 | 359 | var import_primitives2 = __toESM(require_primitives(), 1); |
| 367 | 360 | var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); |
| 368 | - var external_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); | |
| 361 | + var external_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives2.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); | |
| 369 | 362 | |
| 370 | 363 | // packages/icons/build-module/library/more-vertical.mjs |
| 371 | 364 | var import_primitives3 = __toESM(require_primitives(), 1); |
| 372 | 365 | var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); |
| 373 | - var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); | |
| 366 | + var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives3.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); | |
| 374 | 367 | |
| 375 | 368 | // packages/icons/build-module/library/plus.mjs |
| 376 | 369 | var import_primitives4 = __toESM(require_primitives(), 1); |
| 377 | 370 | var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); |
| 378 | - var plus_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); | |
| 371 | + var plus_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives4.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) }); | |
| 379 | 372 | |
| 380 | 373 | // packages/icons/build-module/library/redo.mjs |
| 381 | 374 | var import_primitives5 = __toESM(require_primitives(), 1); |
| 382 | 375 | var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); |
| 383 | - var redo_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) }); | |
| 376 | + var redo_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives5.Path, { d: "M15.6 6.5l-1.1 1 2.9 3.3H8c-.9 0-1.7.3-2.3.9-1.4 1.5-1.4 4.2-1.4 5.6v.2h1.5v-.3c0-1.1 0-3.5 1-4.5.3-.3.7-.5 1.3-.5h9.2L14.5 15l1.1 1.1 4.6-4.6-4.6-5z" }) }); | |
| 384 | 377 | |
| 385 | 378 | // packages/icons/build-module/library/undo.mjs |
| 386 | 379 | var import_primitives6 = __toESM(require_primitives(), 1); |
| 387 | 380 | var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); |
| 388 | - var undo_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) }); | |
| 381 | + var undo_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives6.Path, { d: "M18.3 11.7c-.6-.6-1.4-.9-2.3-.9H6.7l2.9-3.3-1.1-1-4.5 5L8.5 16l1-1-2.7-2.7H16c.5 0 .9.2 1.3.5 1 1 1 3.4 1 4.5v.3h1.5v-.2c0-1.5 0-4.3-1.5-5.7z" }) }); | |
| 389 | 382 | |
| 390 | 383 | // packages/customize-widgets/build-module/components/inserter/index.mjs |
| 391 | 384 | var import_i18n3 = __toESM(require_i18n(), 1); |
| 392 | 385 | var import_block_editor3 = __toESM(require_block_editor(), 1); |
| @@ -506,592 +499,20 @@ | ||
| 506 | 499 | var inserter_default = Inserter; |
| 507 | 500 | |
| 508 | 501 | // packages/customize-widgets/build-module/components/more-menu/index.mjs |
| 509 | 502 | var import_components5 = __toESM(require_components(), 1); |
| 510 | - var import_element6 = __toESM(require_element(), 1); | |
| 503 | + var import_element5 = __toESM(require_element(), 1); | |
| 511 | 504 | var import_i18n6 = __toESM(require_i18n(), 1); |
| 512 | 505 | var import_keycodes2 = __toESM(require_keycodes(), 1); |
| 513 | 506 | var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts(), 1); |
| 514 | 507 | var import_preferences = __toESM(require_preferences(), 1); |
| 515 | 508 | |
| 516 | - // node_modules/@base-ui/utils/useRefWithInit.mjs | |
| 517 | - var React = __toESM(require_react(), 1); | |
| 518 | - var UNINITIALIZED = {}; | |
| 519 | - function useRefWithInit(init, initArg) { | |
| 520 | - const ref = React.useRef(UNINITIALIZED); | |
| 521 | - if (ref.current === UNINITIALIZED) { | |
| 522 | - ref.current = init(initArg); | |
| 523 | - } | |
| 524 | - return ref; | |
| 525 | - } | |
| 526 | - | |
| 527 | - // node_modules/@base-ui/utils/warn.mjs | |
| 528 | - var set; | |
| 529 | - if (true) { | |
| 530 | - set = /* @__PURE__ */ new Set(); | |
| 531 | - } | |
| 532 | - function warn(...messages) { | |
| 533 | - if (true) { | |
| 534 | - const messageKey = messages.join(" "); | |
| 535 | - if (!set.has(messageKey)) { | |
| 536 | - set.add(messageKey); | |
| 537 | - console.warn(`Base UI: ${messageKey}`); | |
| 538 | - } | |
| 539 | - } | |
| 540 | - } | |
| 541 | - | |
| 542 | - // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 543 | - var React4 = __toESM(require_react(), 1); | |
| 544 | - | |
| 545 | - // node_modules/@base-ui/utils/useMergedRefs.mjs | |
| 546 | - function useMergedRefs(a, b, c, d) { | |
| 547 | - const forkRef = useRefWithInit(createForkRef).current; | |
| 548 | - if (didChange(forkRef, a, b, c, d)) { | |
| 549 | - update(forkRef, [a, b, c, d]); | |
| 550 | - } | |
| 551 | - return forkRef.callback; | |
| 552 | - } | |
| 553 | - function useMergedRefsN(refs) { | |
| 554 | - const forkRef = useRefWithInit(createForkRef).current; | |
| 555 | - if (didChangeN(forkRef, refs)) { | |
| 556 | - update(forkRef, refs); | |
| 557 | - } | |
| 558 | - return forkRef.callback; | |
| 559 | - } | |
| 560 | - function createForkRef() { | |
| 561 | - return { | |
| 562 | - callback: null, | |
| 563 | - cleanup: null, | |
| 564 | - refs: [] | |
| 565 | - }; | |
| 566 | - } | |
| 567 | - function didChange(forkRef, a, b, c, d) { | |
| 568 | - return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; | |
| 569 | - } | |
| 570 | - function didChangeN(forkRef, newRefs) { | |
| 571 | - return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); | |
| 572 | - } | |
| 573 | - function update(forkRef, refs) { | |
| 574 | - forkRef.refs = refs; | |
| 575 | - if (refs.every((ref) => ref == null)) { | |
| 576 | - forkRef.callback = null; | |
| 577 | - return; | |
| 578 | - } | |
| 579 | - forkRef.callback = (instance) => { | |
| 580 | - if (forkRef.cleanup) { | |
| 581 | - forkRef.cleanup(); | |
| 582 | - forkRef.cleanup = null; | |
| 583 | - } | |
| 584 | - if (instance != null) { | |
| 585 | - const cleanupCallbacks = Array(refs.length).fill(null); | |
| 586 | - for (let i = 0; i < refs.length; i += 1) { | |
| 587 | - const ref = refs[i]; | |
| 588 | - if (ref == null) { | |
| 589 | - continue; | |
| 590 | - } | |
| 591 | - switch (typeof ref) { | |
| 592 | - case "function": { | |
| 593 | - const refCleanup = ref(instance); | |
| 594 | - if (typeof refCleanup === "function") { | |
| 595 | - cleanupCallbacks[i] = refCleanup; | |
| 596 | - } | |
| 597 | - break; | |
| 598 | - } | |
| 599 | - case "object": { | |
| 600 | - ref.current = instance; | |
| 601 | - break; | |
| 602 | - } | |
| 603 | - default: | |
| 604 | - } | |
| 605 | - } | |
| 606 | - forkRef.cleanup = () => { | |
| 607 | - for (let i = 0; i < refs.length; i += 1) { | |
| 608 | - const ref = refs[i]; | |
| 609 | - if (ref == null) { | |
| 610 | - continue; | |
| 611 | - } | |
| 612 | - switch (typeof ref) { | |
| 613 | - case "function": { | |
| 614 | - const cleanupCallback = cleanupCallbacks[i]; | |
| 615 | - if (typeof cleanupCallback === "function") { | |
| 616 | - cleanupCallback(); | |
| 617 | - } else { | |
| 618 | - ref(null); | |
| 619 | - } | |
| 620 | - break; | |
| 621 | - } | |
| 622 | - case "object": { | |
| 623 | - ref.current = null; | |
| 624 | - break; | |
| 625 | - } | |
| 626 | - default: | |
| 627 | - } | |
| 628 | - } | |
| 629 | - }; | |
| 630 | - } | |
| 631 | - }; | |
| 632 | - } | |
| 633 | - | |
| 634 | - // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 635 | - var React3 = __toESM(require_react(), 1); | |
| 636 | - | |
| 637 | - // node_modules/@base-ui/utils/reactVersion.mjs | |
| 638 | - var React2 = __toESM(require_react(), 1); | |
| 639 | - var majorVersion = parseInt(React2.version, 10); | |
| 640 | - function isReactVersionAtLeast(reactVersionToCheck) { | |
| 641 | - return majorVersion >= reactVersionToCheck; | |
| 642 | - } | |
| 643 | - | |
| 644 | - // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 645 | - function getReactElementRef(element) { | |
| 646 | - if (!/* @__PURE__ */ React3.isValidElement(element)) { | |
| 647 | - return null; | |
| 648 | - } | |
| 649 | - const reactElement = element; | |
| 650 | - const propsWithRef = reactElement.props; | |
| 651 | - return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; | |
| 652 | - } | |
| 653 | - | |
| 654 | - // node_modules/@base-ui/utils/mergeObjects.mjs | |
| 655 | - function mergeObjects(a, b) { | |
| 656 | - if (a && !b) { | |
| 657 | - return a; | |
| 658 | - } | |
| 659 | - if (!a && b) { | |
| 660 | - return b; | |
| 661 | - } | |
| 662 | - if (a || b) { | |
| 663 | - return { | |
| 664 | - ...a, | |
| 665 | - ...b | |
| 666 | - }; | |
| 667 | - } | |
| 668 | - return void 0; | |
| 669 | - } | |
| 670 | - | |
| 671 | - // node_modules/@base-ui/utils/empty.mjs | |
| 672 | - var EMPTY_ARRAY = Object.freeze([]); | |
| 673 | - var EMPTY_OBJECT = Object.freeze({}); | |
| 674 | - | |
| 675 | - // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs | |
| 676 | - function getStateAttributesProps(state, customMapping) { | |
| 677 | - const props = {}; | |
| 678 | - for (const key in state) { | |
| 679 | - const value = state[key]; | |
| 680 | - if (customMapping?.hasOwnProperty(key)) { | |
| 681 | - const customProps = customMapping[key](value); | |
| 682 | - if (customProps != null) { | |
| 683 | - Object.assign(props, customProps); | |
| 684 | - } | |
| 685 | - continue; | |
| 686 | - } | |
| 687 | - if (value === true) { | |
| 688 | - props[`data-${key.toLowerCase()}`] = ""; | |
| 689 | - } else if (value) { | |
| 690 | - props[`data-${key.toLowerCase()}`] = value.toString(); | |
| 691 | - } | |
| 692 | - } | |
| 693 | - return props; | |
| 694 | - } | |
| 695 | - | |
| 696 | - // node_modules/@base-ui/react/utils/resolveClassName.mjs | |
| 697 | - function resolveClassName(className, state) { | |
| 698 | - return typeof className === "function" ? className(state) : className; | |
| 699 | - } | |
| 700 | - | |
| 701 | - // node_modules/@base-ui/react/utils/resolveStyle.mjs | |
| 702 | - function resolveStyle(style, state) { | |
| 703 | - return typeof style === "function" ? style(state) : style; | |
| 704 | - } | |
| 705 | - | |
| 706 | - // node_modules/@base-ui/react/merge-props/mergeProps.mjs | |
| 707 | - var EMPTY_PROPS = {}; | |
| 708 | - function mergeProps(a, b, c, d, e) { | |
| 709 | - if (!c && !d && !e && !a) { | |
| 710 | - return createInitialMergedProps(b); | |
| 711 | - } | |
| 712 | - let merged = createInitialMergedProps(a); | |
| 713 | - if (b) { | |
| 714 | - merged = mergeInto(merged, b); | |
| 715 | - } | |
| 716 | - if (c) { | |
| 717 | - merged = mergeInto(merged, c); | |
| 718 | - } | |
| 719 | - if (d) { | |
| 720 | - merged = mergeInto(merged, d); | |
| 721 | - } | |
| 722 | - if (e) { | |
| 723 | - merged = mergeInto(merged, e); | |
| 724 | - } | |
| 725 | - return merged; | |
| 726 | - } | |
| 727 | - function mergePropsN(props) { | |
| 728 | - if (props.length === 0) { | |
| 729 | - return EMPTY_PROPS; | |
| 730 | - } | |
| 731 | - if (props.length === 1) { | |
| 732 | - return createInitialMergedProps(props[0]); | |
| 733 | - } | |
| 734 | - let merged = createInitialMergedProps(props[0]); | |
| 735 | - for (let i = 1; i < props.length; i += 1) { | |
| 736 | - merged = mergeInto(merged, props[i]); | |
| 737 | - } | |
| 738 | - return merged; | |
| 739 | - } | |
| 740 | - function createInitialMergedProps(inputProps) { | |
| 741 | - if (isPropsGetter(inputProps)) { | |
| 742 | - return { | |
| 743 | - ...resolvePropsGetter(inputProps, EMPTY_PROPS) | |
| 744 | - }; | |
| 745 | - } | |
| 746 | - return copyInitialProps(inputProps); | |
| 747 | - } | |
| 748 | - function mergeInto(merged, inputProps) { | |
| 749 | - if (isPropsGetter(inputProps)) { | |
| 750 | - return resolvePropsGetter(inputProps, merged); | |
| 751 | - } | |
| 752 | - return mutablyMergeInto(merged, inputProps); | |
| 753 | - } | |
| 754 | - function copyInitialProps(inputProps) { | |
| 755 | - const copiedProps = { | |
| 756 | - ...inputProps | |
| 757 | - }; | |
| 758 | - for (const propName in copiedProps) { | |
| 759 | - const propValue = copiedProps[propName]; | |
| 760 | - if (isEventHandler(propName, propValue)) { | |
| 761 | - copiedProps[propName] = wrapEventHandler(propValue); | |
| 762 | - } | |
| 763 | - } | |
| 764 | - return copiedProps; | |
| 765 | - } | |
| 766 | - function mutablyMergeInto(mergedProps, externalProps) { | |
| 767 | - if (!externalProps) { | |
| 768 | - return mergedProps; | |
| 769 | - } | |
| 770 | - for (const propName in externalProps) { | |
| 771 | - const externalPropValue = externalProps[propName]; | |
| 772 | - switch (propName) { | |
| 773 | - case "style": { | |
| 774 | - mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); | |
| 775 | - break; | |
| 776 | - } | |
| 777 | - case "className": { | |
| 778 | - mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); | |
| 779 | - break; | |
| 780 | - } | |
| 781 | - default: { | |
| 782 | - if (isEventHandler(propName, externalPropValue)) { | |
| 783 | - mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); | |
| 784 | - } else { | |
| 785 | - mergedProps[propName] = externalPropValue; | |
| 786 | - } | |
| 787 | - } | |
| 788 | - } | |
| 789 | - } | |
| 790 | - return mergedProps; | |
| 791 | - } | |
| 792 | - function isEventHandler(key, value) { | |
| 793 | - const code0 = key.charCodeAt(0); | |
| 794 | - const code1 = key.charCodeAt(1); | |
| 795 | - const code2 = key.charCodeAt(2); | |
| 796 | - return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); | |
| 797 | - } | |
| 798 | - function isPropsGetter(inputProps) { | |
| 799 | - return typeof inputProps === "function"; | |
| 800 | - } | |
| 801 | - function resolvePropsGetter(inputProps, previousProps) { | |
| 802 | - if (isPropsGetter(inputProps)) { | |
| 803 | - return inputProps(previousProps); | |
| 804 | - } | |
| 805 | - return inputProps ?? EMPTY_PROPS; | |
| 806 | - } | |
| 807 | - function mergeEventHandlers(ourHandler, theirHandler) { | |
| 808 | - if (!theirHandler) { | |
| 809 | - return ourHandler; | |
| 810 | - } | |
| 811 | - if (!ourHandler) { | |
| 812 | - return wrapEventHandler(theirHandler); | |
| 813 | - } | |
| 814 | - return (...args) => { | |
| 815 | - const event = args[0]; | |
| 816 | - if (isSyntheticEvent(event)) { | |
| 817 | - const baseUIEvent = event; | |
| 818 | - makeEventPreventable(baseUIEvent); | |
| 819 | - const result2 = theirHandler(...args); | |
| 820 | - if (!baseUIEvent.baseUIHandlerPrevented) { | |
| 821 | - ourHandler?.(...args); | |
| 822 | - } | |
| 823 | - return result2; | |
| 824 | - } | |
| 825 | - const result = theirHandler(...args); | |
| 826 | - ourHandler?.(...args); | |
| 827 | - return result; | |
| 828 | - }; | |
| 829 | - } | |
| 830 | - function wrapEventHandler(handler) { | |
| 831 | - if (!handler) { | |
| 832 | - return handler; | |
| 833 | - } | |
| 834 | - return (...args) => { | |
| 835 | - const event = args[0]; | |
| 836 | - if (isSyntheticEvent(event)) { | |
| 837 | - makeEventPreventable(event); | |
| 838 | - } | |
| 839 | - return handler(...args); | |
| 840 | - }; | |
| 841 | - } | |
| 842 | - function makeEventPreventable(event) { | |
| 843 | - event.preventBaseUIHandler = () => { | |
| 844 | - event.baseUIHandlerPrevented = true; | |
| 845 | - }; | |
| 846 | - return event; | |
| 847 | - } | |
| 848 | - function mergeClassNames(ourClassName, theirClassName) { | |
| 849 | - if (theirClassName) { | |
| 850 | - if (ourClassName) { | |
| 851 | - return theirClassName + " " + ourClassName; | |
| 852 | - } | |
| 853 | - return theirClassName; | |
| 854 | - } | |
| 855 | - return ourClassName; | |
| 856 | - } | |
| 857 | - function isSyntheticEvent(event) { | |
| 858 | - return event != null && typeof event === "object" && "nativeEvent" in event; | |
| 859 | - } | |
| 860 | - | |
| 861 | - // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 862 | - var import_react = __toESM(require_react(), 1); | |
| 863 | - function useRenderElement(element, componentProps, params = {}) { | |
| 864 | - const renderProp = componentProps.render; | |
| 865 | - const outProps = useRenderElementProps(componentProps, params); | |
| 866 | - if (params.enabled === false) { | |
| 867 | - return null; | |
| 868 | - } | |
| 869 | - const state = params.state ?? EMPTY_OBJECT; | |
| 870 | - return evaluateRenderProp(element, renderProp, outProps, state); | |
| 871 | - } | |
| 872 | - function useRenderElementProps(componentProps, params = {}) { | |
| 873 | - const { | |
| 874 | - className: classNameProp, | |
| 875 | - style: styleProp, | |
| 876 | - render: renderProp | |
| 877 | - } = componentProps; | |
| 878 | - const { | |
| 879 | - state = EMPTY_OBJECT, | |
| 880 | - ref, | |
| 881 | - props, | |
| 882 | - stateAttributesMapping, | |
| 883 | - enabled = true | |
| 884 | - } = params; | |
| 885 | - const className = enabled ? resolveClassName(classNameProp, state) : void 0; | |
| 886 | - const style = enabled ? resolveStyle(styleProp, state) : void 0; | |
| 887 | - const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; | |
| 888 | - const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; | |
| 889 | - const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; | |
| 890 | - if (typeof document !== "undefined") { | |
| 891 | - if (!enabled) { | |
| 892 | - useMergedRefs(null, null); | |
| 893 | - } else if (Array.isArray(ref)) { | |
| 894 | - outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); | |
| 895 | - } else { | |
| 896 | - outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); | |
| 897 | - } | |
| 898 | - } | |
| 899 | - if (!enabled) { | |
| 900 | - return EMPTY_OBJECT; | |
| 901 | - } | |
| 902 | - if (className !== void 0) { | |
| 903 | - outProps.className = mergeClassNames(outProps.className, className); | |
| 904 | - } | |
| 905 | - if (style !== void 0) { | |
| 906 | - outProps.style = mergeObjects(outProps.style, style); | |
| 907 | - } | |
| 908 | - return outProps; | |
| 909 | - } | |
| 910 | - function resolveRenderFunctionProps(props) { | |
| 911 | - if (Array.isArray(props)) { | |
| 912 | - return mergePropsN(props); | |
| 913 | - } | |
| 914 | - return mergeProps(void 0, props); | |
| 915 | - } | |
| 916 | - var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); | |
| 917 | - var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; | |
| 918 | - var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; | |
| 919 | - function evaluateRenderProp(element, render, props, state) { | |
| 920 | - if (render) { | |
| 921 | - if (typeof render === "function") { | |
| 922 | - if (true) { | |
| 923 | - warnIfRenderPropLooksLikeComponent(render); | |
| 924 | - } | |
| 925 | - return render(props, state); | |
| 926 | - } | |
| 927 | - const mergedProps = mergeProps(props, render.props); | |
| 928 | - mergedProps.ref = props.ref; | |
| 929 | - let newElement = render; | |
| 930 | - if (newElement?.$$typeof === REACT_LAZY_TYPE) { | |
| 931 | - const children = React4.Children.toArray(render); | |
| 932 | - newElement = children[0]; | |
| 933 | - } | |
| 934 | - if (true) { | |
| 935 | - if (!/* @__PURE__ */ React4.isValidElement(newElement)) { | |
| 936 | - throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); | |
| 937 | - } | |
| 938 | - } | |
| 939 | - return /* @__PURE__ */ React4.cloneElement(newElement, mergedProps); | |
| 940 | - } | |
| 941 | - if (element) { | |
| 942 | - if (typeof element === "string") { | |
| 943 | - return renderTag(element, props); | |
| 944 | - } | |
| 945 | - } | |
| 946 | - throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); | |
| 947 | - } | |
| 948 | - function warnIfRenderPropLooksLikeComponent(renderFn) { | |
| 949 | - const functionName = renderFn.name; | |
| 950 | - if (functionName.length === 0) { | |
| 951 | - return; | |
| 952 | - } | |
| 953 | - if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { | |
| 954 | - return; | |
| 955 | - } | |
| 956 | - if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { | |
| 957 | - return; | |
| 958 | - } | |
| 959 | - warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop"); | |
| 960 | - } | |
| 961 | - function renderTag(Tag, props) { | |
| 962 | - if (Tag === "button") { | |
| 963 | - return /* @__PURE__ */ (0, import_react.createElement)("button", { | |
| 964 | - type: "button", | |
| 965 | - ...props, | |
| 966 | - key: props.key | |
| 967 | - }); | |
| 968 | - } | |
| 969 | - if (Tag === "img") { | |
| 970 | - return /* @__PURE__ */ (0, import_react.createElement)("img", { | |
| 971 | - alt: "", | |
| 972 | - ...props, | |
| 973 | - key: props.key | |
| 974 | - }); | |
| 975 | - } | |
| 976 | - return /* @__PURE__ */ React4.createElement(Tag, props); | |
| 977 | - } | |
| 978 | - | |
| 979 | - // node_modules/@base-ui/react/use-render/useRender.mjs | |
| 980 | - function useRender(params) { | |
| 981 | - return useRenderElement(params.defaultTagName ?? "div", params, params); | |
| 982 | - } | |
| 983 | - | |
| 984 | - // packages/ui/build-module/visually-hidden/visually-hidden.mjs | |
| 985 | - var import_element3 = __toESM(require_element(), 1); | |
| 986 | - var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; | |
| 987 | - function getRuntime() { | |
| 988 | - const globalScope = globalThis; | |
| 989 | - if (globalScope.__wpStyleRuntime) { | |
| 990 | - return globalScope.__wpStyleRuntime; | |
| 991 | - } | |
| 992 | - globalScope.__wpStyleRuntime = { | |
| 993 | - documents: /* @__PURE__ */ new Map(), | |
| 994 | - styles: /* @__PURE__ */ new Map(), | |
| 995 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 996 | - }; | |
| 997 | - if (typeof document !== "undefined") { | |
| 998 | - registerDocument(document); | |
| 999 | - } | |
| 1000 | - return globalScope.__wpStyleRuntime; | |
| 1001 | - } | |
| 1002 | - function documentContainsStyleHash(targetDocument, hash) { | |
| 1003 | - if (!targetDocument.head) { | |
| 1004 | - return false; | |
| 1005 | - } | |
| 1006 | - for (const style of targetDocument.head.querySelectorAll( | |
| 1007 | - `style[${STYLE_HASH_ATTRIBUTE}]` | |
| 1008 | - )) { | |
| 1009 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { | |
| 1010 | - return true; | |
| 1011 | - } | |
| 1012 | - } | |
| 1013 | - return false; | |
| 1014 | - } | |
| 1015 | - function injectStyle(targetDocument, hash, css) { | |
| 1016 | - if (!targetDocument.head) { | |
| 1017 | - return; | |
| 1018 | - } | |
| 1019 | - const runtime = getRuntime(); | |
| 1020 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 1021 | - if (!injectedStyles) { | |
| 1022 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 1023 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 1024 | - } | |
| 1025 | - if (injectedStyles.has(hash)) { | |
| 1026 | - return; | |
| 1027 | - } | |
| 1028 | - if (documentContainsStyleHash(targetDocument, hash)) { | |
| 1029 | - injectedStyles.add(hash); | |
| 1030 | - return; | |
| 1031 | - } | |
| 1032 | - const style = targetDocument.createElement("style"); | |
| 1033 | - style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); | |
| 1034 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 1035 | - targetDocument.head.appendChild(style); | |
| 1036 | - injectedStyles.add(hash); | |
| 1037 | - } | |
| 1038 | - function registerDocument(targetDocument) { | |
| 1039 | - const runtime = getRuntime(); | |
| 1040 | - runtime.documents.set( | |
| 1041 | - targetDocument, | |
| 1042 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 1043 | - ); | |
| 1044 | - for (const [hash, css] of runtime.styles) { | |
| 1045 | - injectStyle(targetDocument, hash, css); | |
| 1046 | - } | |
| 1047 | - return () => { | |
| 1048 | - const count = runtime.documents.get(targetDocument); | |
| 1049 | - if (count === void 0) { | |
| 1050 | - return; | |
| 1051 | - } | |
| 1052 | - if (count <= 1) { | |
| 1053 | - runtime.documents.delete(targetDocument); | |
| 1054 | - return; | |
| 1055 | - } | |
| 1056 | - runtime.documents.set(targetDocument, count - 1); | |
| 1057 | - }; | |
| 1058 | - } | |
| 1059 | - function registerStyle(hash, css) { | |
| 1060 | - const runtime = getRuntime(); | |
| 1061 | - runtime.styles.set(hash, css); | |
| 1062 | - for (const targetDocument of runtime.documents.keys()) { | |
| 1063 | - injectStyle(targetDocument, hash, css); | |
| 1064 | - } | |
| 1065 | - } | |
| 1066 | - if (typeof process === "undefined" || true) { | |
| 1067 | - registerStyle("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}"); | |
| 1068 | - } | |
| 1069 | - var style_default = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; | |
| 1070 | - var VisuallyHidden = (0, import_element3.forwardRef)( | |
| 1071 | - function VisuallyHidden2({ render, ...restProps }, ref) { | |
| 1072 | - const element = useRender({ | |
| 1073 | - render, | |
| 1074 | - ref, | |
| 1075 | - props: mergeProps( | |
| 1076 | - { className: style_default["visually-hidden"] }, | |
| 1077 | - restProps, | |
| 1078 | - { | |
| 1079 | - // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. | |
| 1080 | - "data-visually-hidden": "" | |
| 1081 | - } | |
| 1082 | - ) | |
| 1083 | - }); | |
| 1084 | - return element; | |
| 1085 | - } | |
| 1086 | - ); | |
| 1087 | - | |
| 1088 | 509 | // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs |
| 1089 | 510 | var import_components4 = __toESM(require_components(), 1); |
| 1090 | 511 | var import_i18n5 = __toESM(require_i18n(), 1); |
| 1091 | 512 | var import_keyboard_shortcuts2 = __toESM(require_keyboard_shortcuts(), 1); |
| 1092 | 513 | var import_data6 = __toESM(require_data(), 1); |
| 1093 | - var import_element5 = __toESM(require_element(), 1); | |
| 514 | + var import_element4 = __toESM(require_element(), 1); | |
| 1094 | 515 | |
| 1095 | 516 | // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/config.mjs |
| 1096 | 517 | var import_i18n4 = __toESM(require_i18n(), 1); |
| 1097 | 518 | var textFormattingShortcuts = [ |
| @@ -1152,9 +573,9 @@ | ||
| 1152 | 573 | } |
| 1153 | 574 | ]; |
| 1154 | 575 | |
| 1155 | 576 | // packages/customize-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs |
| 1156 | - var import_element4 = __toESM(require_element(), 1); | |
| 577 | + var import_element3 = __toESM(require_element(), 1); | |
| 1157 | 578 | var import_keycodes = __toESM(require_keycodes(), 1); |
| 1158 | 579 | var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); |
| 1159 | 580 | function KeyCombination({ keyCombination, forceAriaLabel }) { |
| 1160 | 581 | const shortcut = keyCombination.modifier ? import_keycodes.displayShortcutList[keyCombination.modifier]( |
| @@ -1170,9 +591,9 @@ | ||
| 1170 | 591 | "aria-label": forceAriaLabel || ariaLabel, |
| 1171 | 592 | children: (Array.isArray(shortcut) ? shortcut : [shortcut]).map( |
| 1172 | 593 | (character, index) => { |
| 1173 | 594 | if (character === "+") { |
| 1174 | - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_element4.Fragment, { children: character }, index); | |
| 595 | + return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_element3.Fragment, { children: character }, index); | |
| 1175 | 596 | } |
| 1176 | 597 | return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( |
| 1177 | 598 | "kbd", |
| 1178 | 599 | { |
| @@ -1306,9 +727,9 @@ | ||
| 1306 | 727 | isModalActive, |
| 1307 | 728 | toggleModal |
| 1308 | 729 | }) { |
| 1309 | 730 | const { registerShortcut } = (0, import_data6.useDispatch)(import_keyboard_shortcuts2.store); |
| 1310 | - (0, import_element5.useEffect)(() => { | |
| 731 | + (0, import_element4.useEffect)(() => { | |
| 1311 | 732 | registerShortcut({ |
| 1312 | 733 | name: "core/customize-widgets/keyboard-shortcuts", |
| 1313 | 734 | category: "main", |
| 1314 | 735 | description: (0, import_i18n5.__)("Display these keyboard shortcuts."), |
| @@ -1384,9 +805,9 @@ | ||
| 1384 | 805 | function MoreMenu() { |
| 1385 | 806 | const [ |
| 1386 | 807 | isKeyboardShortcutsModalActive, |
| 1387 | 808 | setIsKeyboardShortcutsModalVisible |
| 1388 | - ] = (0, import_element6.useState)(false); | |
| 809 | + ] = (0, import_element5.useState)(false); | |
| 1389 | 810 | const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); |
| 1390 | 811 | (0, import_keyboard_shortcuts3.useShortcut)( |
| 1391 | 812 | "core/customize-widgets/keyboard-shortcuts", |
| 1392 | 813 | toggleKeyboardShortcutsModal |
| @@ -1450,13 +871,13 @@ | ||
| 1450 | 871 | href: (0, import_i18n6.__)( |
| 1451 | 872 | "https://wordpress.org/documentation/article/block-based-widgets-editor/" |
| 1452 | 873 | ), |
| 1453 | 874 | target: "_blank", |
| 1454 | - rel: "noopener", | |
| 875 | + rel: "noopener noreferrer", | |
| 1455 | 876 | children: [ |
| 1456 | 877 | (0, import_i18n6.__)("Help"), |
| 1457 | - /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(VisuallyHidden, { | |
| 1458 | - render: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)("span", {}), | |
| 878 | + /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_components5.VisuallyHidden, { | |
| 879 | + as: "span", | |
| 1459 | 880 | /* translators: accessibility text */ |
| 1460 | 881 | children: (0, import_i18n6.__)("(opens in a new tab)") |
| 1461 | 882 | }) |
| 1462 | 883 | ] |
| @@ -1503,14 +924,14 @@ | ||
| 1503 | 924 | isInserterOpened: isInserterOpened2, |
| 1504 | 925 | setIsInserterOpened: setIsInserterOpened2, |
| 1505 | 926 | isFixedToolbarActive |
| 1506 | 927 | }) { |
| 1507 | - const [[hasUndo, hasRedo], setUndoRedo] = (0, import_element7.useState)([ | |
| 928 | + const [[hasUndo, hasRedo], setUndoRedo] = (0, import_element6.useState)([ | |
| 1508 | 929 | sidebar.hasUndo(), |
| 1509 | 930 | sidebar.hasRedo() |
| 1510 | 931 | ]); |
| 1511 | 932 | const shortcut = (0, import_keycodes3.isAppleOS)() ? import_keycodes3.displayShortcut.primaryShift("z") : import_keycodes3.displayShortcut.primary("y"); |
| 1512 | - (0, import_element7.useEffect)(() => { | |
| 933 | + (0, import_element6.useEffect)(() => { | |
| 1513 | 934 | return sidebar.subscribeHistory(() => { |
| 1514 | 935 | setUndoRedo([sidebar.hasUndo(), sidebar.hasRedo()]); |
| 1515 | 936 | }); |
| 1516 | 937 | }, [sidebar]); |
| @@ -1570,9 +991,9 @@ | ||
| 1570 | 991 | } |
| 1571 | 992 | ) |
| 1572 | 993 | } |
| 1573 | 994 | ), |
| 1574 | - (0, import_element7.createPortal)( | |
| 995 | + (0, import_element6.createPortal)( | |
| 1575 | 996 | /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(inserter_default, { setIsOpened: setIsInserterOpened2 }), |
| 1576 | 997 | inserter.contentContainer[0] |
| 1577 | 998 | ) |
| 1578 | 999 | ] }); |
| @@ -1579,9 +1000,9 @@ | ||
| 1579 | 1000 | } |
| 1580 | 1001 | var header_default = Header; |
| 1581 | 1002 | |
| 1582 | 1003 | // packages/customize-widgets/build-module/components/inserter/use-inserter.mjs |
| 1583 | - var import_element8 = __toESM(require_element(), 1); | |
| 1004 | + var import_element7 = __toESM(require_element(), 1); | |
| 1584 | 1005 | var import_data7 = __toESM(require_data(), 1); |
| 1585 | 1006 | function useInserter(inserter) { |
| 1586 | 1007 | const isInserterOpened2 = (0, import_data7.useSelect)( |
| 1587 | 1008 | (select) => select(store).isInserterOpened(), |
| @@ -1587,9 +1008,9 @@ | ||
| 1587 | 1008 | (select) => select(store).isInserterOpened(), |
| 1588 | 1009 | [] |
| 1589 | 1010 | ); |
| 1590 | 1011 | const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data7.useDispatch)(store); |
| 1591 | - (0, import_element8.useEffect)(() => { | |
| 1012 | + (0, import_element7.useEffect)(() => { | |
| 1592 | 1013 | if (isInserterOpened2) { |
| 1593 | 1014 | inserter.open(); |
| 1594 | 1015 | } else { |
| 1595 | 1016 | inserter.close(); |
| @@ -1596,9 +1017,9 @@ | ||
| 1596 | 1017 | } |
| 1597 | 1018 | }, [inserter, isInserterOpened2]); |
| 1598 | 1019 | return [ |
| 1599 | 1020 | isInserterOpened2, |
| 1600 | - (0, import_element8.useCallback)( | |
| 1021 | + (0, import_element7.useCallback)( | |
| 1601 | 1022 | (updater) => { |
| 1602 | 1023 | let isOpen = updater; |
| 1603 | 1024 | if (typeof updater === "function") { |
| 1604 | 1025 | isOpen = updater( |
| @@ -1616,9 +1037,9 @@ | ||
| 1616 | 1037 | var import_block_editor6 = __toESM(require_block_editor(), 1); |
| 1617 | 1038 | |
| 1618 | 1039 | // packages/customize-widgets/build-module/components/sidebar-block-editor/use-sidebar-block-editor.mjs |
| 1619 | 1040 | var import_es6 = __toESM(require_es6(), 1); |
| 1620 | - var import_element9 = __toESM(require_element(), 1); | |
| 1041 | + var import_element8 = __toESM(require_element(), 1); | |
| 1621 | 1042 | var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1); |
| 1622 | 1043 | var import_widgets2 = __toESM(require_widgets(), 1); |
| 1623 | 1044 | |
| 1624 | 1045 | // packages/customize-widgets/build-module/utils.mjs |
| @@ -1709,12 +1130,12 @@ | ||
| 1709 | 1130 | function widgetsToBlocks(widgets) { |
| 1710 | 1131 | return widgets.map((widget) => widgetToBlock(widget)); |
| 1711 | 1132 | } |
| 1712 | 1133 | function useSidebarBlockEditor(sidebar) { |
| 1713 | - const [blocks, setBlocks] = (0, import_element9.useState)( | |
| 1134 | + const [blocks, setBlocks] = (0, import_element8.useState)( | |
| 1714 | 1135 | () => widgetsToBlocks(sidebar.getWidgets()) |
| 1715 | 1136 | ); |
| 1716 | - (0, import_element9.useEffect)(() => { | |
| 1137 | + (0, import_element8.useEffect)(() => { | |
| 1717 | 1138 | return sidebar.subscribe((prevWidgets, nextWidgets) => { |
| 1718 | 1139 | setBlocks((prevBlocks) => { |
| 1719 | 1140 | const prevWidgetsMap = new Map( |
| 1720 | 1141 | prevWidgets.map((widget) => [widget.id, widget]) |
| @@ -1738,9 +1159,9 @@ | ||
| 1738 | 1159 | return nextBlocks; |
| 1739 | 1160 | }); |
| 1740 | 1161 | }); |
| 1741 | 1162 | }, [sidebar]); |
| 1742 | - const onChangeBlocks = (0, import_element9.useCallback)( | |
| 1163 | + const onChangeBlocks = (0, import_element8.useCallback)( | |
| 1743 | 1164 | (nextBlocks) => { |
| 1744 | 1165 | setBlocks((prevBlocks) => { |
| 1745 | 1166 | if ((0, import_is_shallow_equal.isShallowEqual)(prevBlocks, nextBlocks)) { |
| 1746 | 1167 | return prevBlocks; |
| @@ -1790,23 +1211,23 @@ | ||
| 1790 | 1211 | return [blocks, onChangeBlocks, onChangeBlocks]; |
| 1791 | 1212 | } |
| 1792 | 1213 | |
| 1793 | 1214 | // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs |
| 1794 | - var import_element11 = __toESM(require_element(), 1); | |
| 1215 | + var import_element10 = __toESM(require_element(), 1); | |
| 1795 | 1216 | var import_data8 = __toESM(require_data(), 1); |
| 1796 | 1217 | var import_block_editor5 = __toESM(require_block_editor(), 1); |
| 1797 | 1218 | var import_widgets3 = __toESM(require_widgets(), 1); |
| 1798 | 1219 | |
| 1799 | 1220 | // packages/customize-widgets/build-module/components/focus-control/index.mjs |
| 1800 | - var import_element10 = __toESM(require_element(), 1); | |
| 1221 | + var import_element9 = __toESM(require_element(), 1); | |
| 1801 | 1222 | var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); |
| 1802 | - var FocusControlContext = (0, import_element10.createContext)(); | |
| 1223 | + var FocusControlContext = (0, import_element9.createContext)(); | |
| 1803 | 1224 | FocusControlContext.displayName = "FocusControlContext"; |
| 1804 | 1225 | function FocusControl({ api, sidebarControls, children }) { |
| 1805 | - const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0, import_element10.useState)({ | |
| 1226 | + const [focusedWidgetIdRef, setFocusedWidgetIdRef] = (0, import_element9.useState)({ | |
| 1806 | 1227 | current: null |
| 1807 | 1228 | }); |
| 1808 | - const focusWidget = (0, import_element10.useCallback)( | |
| 1229 | + const focusWidget = (0, import_element9.useCallback)( | |
| 1809 | 1230 | (widgetId) => { |
| 1810 | 1231 | for (const sidebarControl of sidebarControls) { |
| 1811 | 1232 | const widgets = sidebarControl.setting.get(); |
| 1812 | 1233 | if (widgets.includes(widgetId)) { |
| @@ -1822,9 +1243,9 @@ | ||
| 1822 | 1243 | } |
| 1823 | 1244 | }, |
| 1824 | 1245 | [sidebarControls] |
| 1825 | 1246 | ); |
| 1826 | - (0, import_element10.useEffect)(() => { | |
| 1247 | + (0, import_element9.useEffect)(() => { | |
| 1827 | 1248 | function handleFocus(settingId) { |
| 1828 | 1249 | const widgetId = settingIdToWidgetId(settingId); |
| 1829 | 1250 | focusWidget(widgetId); |
| 1830 | 1251 | } |
| @@ -1846,25 +1267,25 @@ | ||
| 1846 | 1267 | ); |
| 1847 | 1268 | } |
| 1848 | 1269 | }; |
| 1849 | 1270 | }, [api, focusWidget]); |
| 1850 | - const context = (0, import_element10.useMemo)( | |
| 1271 | + const context = (0, import_element9.useMemo)( | |
| 1851 | 1272 | () => [focusedWidgetIdRef, focusWidget], |
| 1852 | 1273 | [focusedWidgetIdRef, focusWidget] |
| 1853 | 1274 | ); |
| 1854 | 1275 | return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(FocusControlContext.Provider, { value: context, children }); |
| 1855 | 1276 | } |
| 1856 | - var useFocusControl = () => (0, import_element10.useContext)(FocusControlContext); | |
| 1277 | + var useFocusControl = () => (0, import_element9.useContext)(FocusControlContext); | |
| 1857 | 1278 | |
| 1858 | 1279 | // packages/customize-widgets/build-module/components/focus-control/use-blocks-focus-control.mjs |
| 1859 | 1280 | function useBlocksFocusControl(blocks) { |
| 1860 | 1281 | const { selectBlock } = (0, import_data8.useDispatch)(import_block_editor5.store); |
| 1861 | 1282 | const [focusedWidgetIdRef] = useFocusControl(); |
| 1862 | - const blocksRef = (0, import_element11.useRef)(blocks); | |
| 1863 | - (0, import_element11.useEffect)(() => { | |
| 1283 | + const blocksRef = (0, import_element10.useRef)(blocks); | |
| 1284 | + (0, import_element10.useEffect)(() => { | |
| 1864 | 1285 | blocksRef.current = blocks; |
| 1865 | 1286 | }, [blocks]); |
| 1866 | - (0, import_element11.useEffect)(() => { | |
| 1287 | + (0, import_element10.useEffect)(() => { | |
| 1867 | 1288 | if (focusedWidgetIdRef.current) { |
| 1868 | 1289 | const focusedBlock = blocksRef.current.find( |
| 1869 | 1290 | (block) => (0, import_widgets3.getWidgetIdFromBlock)(block) === focusedWidgetIdRef.current |
| 1870 | 1291 | ); |
| @@ -1983,9 +1404,9 @@ | ||
| 1983 | 1404 | ] }); |
| 1984 | 1405 | } |
| 1985 | 1406 | |
| 1986 | 1407 | // packages/customize-widgets/build-module/components/keyboard-shortcuts/index.mjs |
| 1987 | - var import_element12 = __toESM(require_element(), 1); | |
| 1408 | + var import_element11 = __toESM(require_element(), 1); | |
| 1988 | 1409 | var import_keyboard_shortcuts4 = __toESM(require_keyboard_shortcuts(), 1); |
| 1989 | 1410 | var import_keycodes4 = __toESM(require_keycodes(), 1); |
| 1990 | 1411 | var import_data10 = __toESM(require_data(), 1); |
| 1991 | 1412 | var import_i18n9 = __toESM(require_i18n(), 1); |
| @@ -2007,9 +1428,9 @@ | ||
| 2007 | 1428 | function KeyboardShortcutsRegister() { |
| 2008 | 1429 | const { registerShortcut, unregisterShortcut } = (0, import_data10.useDispatch)( |
| 2009 | 1430 | import_keyboard_shortcuts4.store |
| 2010 | 1431 | ); |
| 2011 | - (0, import_element12.useEffect)(() => { | |
| 1432 | + (0, import_element11.useEffect)(() => { | |
| 2012 | 1433 | registerShortcut({ |
| 2013 | 1434 | name: "core/customize-widgets/undo", |
| 2014 | 1435 | category: "global", |
| 2015 | 1436 | description: (0, import_i18n9.__)("Undo your last changes."), |
| @@ -2057,18 +1478,18 @@ | ||
| 2057 | 1478 | KeyboardShortcuts.Register = KeyboardShortcutsRegister; |
| 2058 | 1479 | var keyboard_shortcuts_default = KeyboardShortcuts; |
| 2059 | 1480 | |
| 2060 | 1481 | // packages/customize-widgets/build-module/components/block-appender/index.mjs |
| 2061 | - var import_element13 = __toESM(require_element(), 1); | |
| 1482 | + var import_element12 = __toESM(require_element(), 1); | |
| 2062 | 1483 | var import_block_editor7 = __toESM(require_block_editor(), 1); |
| 2063 | 1484 | var import_data11 = __toESM(require_data(), 1); |
| 2064 | 1485 | var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); |
| 2065 | 1486 | function BlockAppender(props) { |
| 2066 | - const ref = (0, import_element13.useRef)(); | |
| 1487 | + const ref = (0, import_element12.useRef)(); | |
| 2067 | 1488 | const isBlocksListEmpty = (0, import_data11.useSelect)( |
| 2068 | 1489 | (select) => select(import_block_editor7.store).getBlockCount() === 0 |
| 2069 | 1490 | ); |
| 2070 | - (0, import_element13.useEffect)(() => { | |
| 1491 | + (0, import_element12.useEffect)(() => { | |
| 2071 | 1492 | if (isBlocksListEmpty && ref.current) { |
| 2072 | 1493 | const { ownerDocument } = ref.current; |
| 2073 | 1494 | if (!ownerDocument.activeElement || ownerDocument.activeElement === ownerDocument.body) { |
| 2074 | 1495 | ref.current.focus(); |
| @@ -2117,9 +1538,9 @@ | ||
| 2117 | 1538 | "welcomeGuide" |
| 2118 | 1539 | ) |
| 2119 | 1540 | }; |
| 2120 | 1541 | }, []); |
| 2121 | - const settings = (0, import_element14.useMemo)(() => { | |
| 1542 | + const settings = (0, import_element13.useMemo)(() => { | |
| 2122 | 1543 | let mediaUploadBlockEditor; |
| 2123 | 1544 | if (hasUploadPermissions) { |
| 2124 | 1545 | mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => { |
| 2125 | 1546 | (0, import_media_utils.uploadMedia)({ |
| @@ -2180,9 +1601,9 @@ | ||
| 2180 | 1601 | height: "100%", |
| 2181 | 1602 | children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.BlockList, { renderAppender: BlockAppender }) |
| 2182 | 1603 | } |
| 2183 | 1604 | ), |
| 2184 | - (0, import_element14.createPortal)( | |
| 1605 | + (0, import_element13.createPortal)( | |
| 2185 | 1606 | // This is a temporary hack to prevent button component inside <BlockInspector> |
| 2186 | 1607 | // from submitting form when type="button" is not specified. |
| 2187 | 1608 | /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("form", { onSubmit: (event) => event.preventDefault(), children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_block_editor8.BlockInspector, {}) }), |
| 2188 | 1609 | inspector.contentContainer[0] |
| @@ -2198,11 +1619,11 @@ | ||
| 2198 | 1619 | ] }); |
| 2199 | 1620 | } |
| 2200 | 1621 | |
| 2201 | 1622 | // packages/customize-widgets/build-module/components/sidebar-controls/index.mjs |
| 2202 | - var import_element15 = __toESM(require_element(), 1); | |
| 1623 | + var import_element14 = __toESM(require_element(), 1); | |
| 2203 | 1624 | var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); |
| 2204 | - var SidebarControlsContext = (0, import_element15.createContext)(); | |
| 1625 | + var SidebarControlsContext = (0, import_element14.createContext)(); | |
| 2205 | 1626 | SidebarControlsContext.displayName = "SidebarControlsContext"; |
| 2206 | 1627 | function SidebarControls({ |
| 2207 | 1628 | sidebarControls, |
| 2208 | 1629 | activeSidebarControl, |
| @@ -2207,9 +1628,9 @@ | ||
| 2207 | 1628 | sidebarControls, |
| 2208 | 1629 | activeSidebarControl, |
| 2209 | 1630 | children |
| 2210 | 1631 | }) { |
| 2211 | - const context = (0, import_element15.useMemo)( | |
| 1632 | + const context = (0, import_element14.useMemo)( | |
| 2212 | 1633 | () => ({ |
| 2213 | 1634 | sidebarControls, |
| 2214 | 1635 | activeSidebarControl |
| 2215 | 1636 | }), |
| @@ -2217,24 +1638,24 @@ | ||
| 2217 | 1638 | ); |
| 2218 | 1639 | return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(SidebarControlsContext.Provider, { value: context, children }); |
| 2219 | 1640 | } |
| 2220 | 1641 | function useSidebarControls() { |
| 2221 | - const { sidebarControls } = (0, import_element15.useContext)(SidebarControlsContext); | |
| 1642 | + const { sidebarControls } = (0, import_element14.useContext)(SidebarControlsContext); | |
| 2222 | 1643 | return sidebarControls; |
| 2223 | 1644 | } |
| 2224 | 1645 | function useActiveSidebarControl() { |
| 2225 | - const { activeSidebarControl } = (0, import_element15.useContext)(SidebarControlsContext); | |
| 1646 | + const { activeSidebarControl } = (0, import_element14.useContext)(SidebarControlsContext); | |
| 2226 | 1647 | return activeSidebarControl; |
| 2227 | 1648 | } |
| 2228 | 1649 | |
| 2229 | 1650 | // packages/customize-widgets/build-module/components/customize-widgets/use-clear-selected-block.mjs |
| 2230 | - var import_element16 = __toESM(require_element(), 1); | |
| 1651 | + var import_element15 = __toESM(require_element(), 1); | |
| 2231 | 1652 | var import_data13 = __toESM(require_data(), 1); |
| 2232 | 1653 | var import_block_editor9 = __toESM(require_block_editor(), 1); |
| 2233 | 1654 | function useClearSelectedBlock(sidebarControl, popoverRef) { |
| 2234 | 1655 | const { hasSelectedBlock, hasMultiSelection } = (0, import_data13.useSelect)(import_block_editor9.store); |
| 2235 | 1656 | const { clearSelectedBlock } = (0, import_data13.useDispatch)(import_block_editor9.store); |
| 2236 | - (0, import_element16.useEffect)(() => { | |
| 1657 | + (0, import_element15.useEffect)(() => { | |
| 2237 | 1658 | if (popoverRef.current && sidebarControl) { |
| 2238 | 1659 | let handleClearSelectedBlock = function(element) { |
| 2239 | 1660 | if ( |
| 2240 | 1661 | // 1. Make sure there are blocks being selected. |
| @@ -2279,15 +1700,15 @@ | ||
| 2279 | 1700 | api, |
| 2280 | 1701 | sidebarControls, |
| 2281 | 1702 | blockEditorSettings |
| 2282 | 1703 | }) { |
| 2283 | - const [activeSidebarControl, setActiveSidebarControl] = (0, import_element17.useState)(null); | |
| 1704 | + const [activeSidebarControl, setActiveSidebarControl] = (0, import_element16.useState)(null); | |
| 2284 | 1705 | const parentContainer = document.getElementById( |
| 2285 | 1706 | "customize-theme-controls" |
| 2286 | 1707 | ); |
| 2287 | - const popoverRef = (0, import_element17.useRef)(); | |
| 1708 | + const popoverRef = (0, import_element16.useRef)(); | |
| 2288 | 1709 | useClearSelectedBlock(activeSidebarControl, popoverRef); |
| 2289 | - (0, import_element17.useEffect)(() => { | |
| 1710 | + (0, import_element16.useEffect)(() => { | |
| 2290 | 1711 | const unsubscribers = sidebarControls.map( |
| 2291 | 1712 | (sidebarControl) => sidebarControl.subscribe((expanded) => { |
| 2292 | 1713 | if (expanded) { |
| 2293 | 1714 | setActiveSidebarControl(sidebarControl); |
| @@ -2297,9 +1718,9 @@ | ||
| 2297 | 1718 | return () => { |
| 2298 | 1719 | unsubscribers.forEach((unsubscriber) => unsubscriber()); |
| 2299 | 1720 | }; |
| 2300 | 1721 | }, [sidebarControls]); |
| 2301 | - const activeSidebar = activeSidebarControl && (0, import_element17.createPortal)( | |
| 1722 | + const activeSidebar = activeSidebarControl && (0, import_element16.createPortal)( | |
| 2302 | 1723 | /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| 2303 | 1724 | SidebarBlockEditor, |
| 2304 | 1725 | { |
| 2305 | 1726 | blockEditorSettings, |
| @@ -2310,9 +1731,9 @@ | ||
| 2310 | 1731 | activeSidebarControl.id |
| 2311 | 1732 | ) }), |
| 2312 | 1733 | activeSidebarControl.container[0] |
| 2313 | 1734 | ); |
| 2314 | - const popover = parentContainer && (0, import_element17.createPortal)( | |
| 1735 | + const popover = parentContainer && (0, import_element16.createPortal)( | |
| 2315 | 1736 | /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("div", { className: "customize-widgets-popover", ref: popoverRef, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.Popover.Slot, {}) }), |
| 2316 | 1737 | parentContainer |
| 2317 | 1738 | ); |
| 2318 | 1739 | return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components8.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( |
| @@ -3017,10 +2438,10 @@ | ||
| 3017 | 2438 | if (control instanceof SidebarControl) { |
| 3018 | 2439 | sidebarControls.push(control); |
| 3019 | 2440 | } |
| 3020 | 2441 | }); |
| 3021 | - (0, import_element18.createRoot)(container).render( | |
| 3022 | - /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_element18.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 2442 | + (0, import_element17.createRoot)(container).render( | |
| 2443 | + /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_element17.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 3023 | 2444 | CustomizeWidgets, |
| 3024 | 2445 | { |
| 3025 | 2446 | api: wp3.customize, |
| 3026 | 2447 | sidebarControls, |