| @@ -1,4 +1,5 @@ | ||
| 1 | +(function() { | |
| 1 | 2 | var wp; |
| 2 | 3 | (wp ||= {}).patterns = (() => { |
| 3 | 4 | var __create = Object.create; |
| 4 | 5 | var __defProp = Object.defineProperty; |
| @@ -93,12 +94,12 @@ | ||
| 93 | 94 | module.exports = window.ReactJSXRuntime; |
| 94 | 95 | } |
| 95 | 96 | }); |
| 96 | 97 | |
| 97 | - // package-external:@wordpress/notices | |
| 98 | - var require_notices = __commonJS({ | |
| 99 | - "package-external:@wordpress/notices"(exports, module) { | |
| 100 | - module.exports = window.wp.notices; | |
| 98 | + // vendor-external:react | |
| 99 | + var require_react = __commonJS({ | |
| 100 | + "vendor-external:react"(exports, module) { | |
| 101 | + module.exports = window.React; | |
| 101 | 102 | } |
| 102 | 103 | }); |
| 103 | 104 | |
| 104 | 105 | // package-external:@wordpress/compose |
| @@ -107,8 +108,29 @@ | ||
| 107 | 108 | module.exports = window.wp.compose; |
| 108 | 109 | } |
| 109 | 110 | }); |
| 110 | 111 | |
| 112 | + // package-external:@wordpress/primitives | |
| 113 | + var require_primitives = __commonJS({ | |
| 114 | + "package-external:@wordpress/primitives"(exports, module) { | |
| 115 | + module.exports = window.wp.primitives; | |
| 116 | + } | |
| 117 | + }); | |
| 118 | + | |
| 119 | + // package-external:@wordpress/a11y | |
| 120 | + var require_a11y = __commonJS({ | |
| 121 | + "package-external:@wordpress/a11y"(exports, module) { | |
| 122 | + module.exports = window.wp.a11y; | |
| 123 | + } | |
| 124 | + }); | |
| 125 | + | |
| 126 | + // package-external:@wordpress/notices | |
| 127 | + var require_notices = __commonJS({ | |
| 128 | + "package-external:@wordpress/notices"(exports, module) { | |
| 129 | + module.exports = window.wp.notices; | |
| 130 | + } | |
| 131 | + }); | |
| 132 | + | |
| 111 | 133 | // package-external:@wordpress/html-entities |
| 112 | 134 | var require_html_entities = __commonJS({ |
| 113 | 135 | "package-external:@wordpress/html-entities"(exports, module) { |
| 114 | 136 | module.exports = window.wp.htmlEntities; |
| @@ -114,15 +136,8 @@ | ||
| 114 | 136 | module.exports = window.wp.htmlEntities; |
| 115 | 137 | } |
| 116 | 138 | }); |
| 117 | 139 | |
| 118 | - // package-external:@wordpress/primitives | |
| 119 | - var require_primitives = __commonJS({ | |
| 120 | - "package-external:@wordpress/primitives"(exports, module) { | |
| 121 | - module.exports = window.wp.primitives; | |
| 122 | - } | |
| 123 | - }); | |
| 124 | - | |
| 125 | 140 | // package-external:@wordpress/url |
| 126 | 141 | var require_url = __commonJS({ |
| 127 | 142 | "package-external:@wordpress/url"(exports, module) { |
| 128 | 143 | module.exports = window.wp.url; |
| @@ -128,15 +143,8 @@ | ||
| 128 | 143 | module.exports = window.wp.url; |
| 129 | 144 | } |
| 130 | 145 | }); |
| 131 | 146 | |
| 132 | - // package-external:@wordpress/a11y | |
| 133 | - var require_a11y = __commonJS({ | |
| 134 | - "package-external:@wordpress/a11y"(exports, module) { | |
| 135 | - module.exports = window.wp.a11y; | |
| 136 | - } | |
| 137 | - }); | |
| 138 | - | |
| 139 | 147 | // packages/patterns/build-module/index.mjs |
| 140 | 148 | var index_exports = {}; |
| 141 | 149 | __export(index_exports, { |
| 142 | 150 | privateApis: () => privateApis, |
| @@ -339,10 +347,738 @@ | ||
| 339 | 347 | } |
| 340 | 348 | |
| 341 | 349 | // packages/patterns/build-module/components/create-pattern-modal.mjs |
| 342 | 350 | var import_components3 = __toESM(require_components(), 1); |
| 351 | + | |
| 352 | + // node_modules/clsx/dist/clsx.mjs | |
| 353 | + function r(e) { | |
| 354 | + var t, f, n = ""; | |
| 355 | + if ("string" == typeof e || "number" == typeof e) n += e; | |
| 356 | + else if ("object" == typeof e) if (Array.isArray(e)) { | |
| 357 | + var o = e.length; | |
| 358 | + for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); | |
| 359 | + } else for (f in e) e[f] && (n && (n += " "), n += f); | |
| 360 | + return n; | |
| 361 | + } | |
| 362 | + function clsx() { | |
| 363 | + for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); | |
| 364 | + return n; | |
| 365 | + } | |
| 366 | + var clsx_default = clsx; | |
| 367 | + | |
| 368 | + // node_modules/@base-ui/utils/createLogOnce.mjs | |
| 369 | + var loggedMessages; | |
| 370 | + if (true) { | |
| 371 | + loggedMessages = /* @__PURE__ */ new Set(); | |
| 372 | + } | |
| 373 | + function createLogOnce(severity, prefix) { | |
| 374 | + return function logOnce(...messages) { | |
| 375 | + if (true) { | |
| 376 | + const message = messages.join(" "); | |
| 377 | + const output = prefix ? `${prefix}: ${message}` : message; | |
| 378 | + const key = `${severity}:${output}`; | |
| 379 | + if (!loggedMessages.has(key)) { | |
| 380 | + loggedMessages.add(key); | |
| 381 | + if (severity === "warn") { | |
| 382 | + console.warn(output); | |
| 383 | + } else { | |
| 384 | + console.error(output); | |
| 385 | + } | |
| 386 | + } | |
| 387 | + } | |
| 388 | + }; | |
| 389 | + } | |
| 390 | + | |
| 391 | + // node_modules/@base-ui/utils/useRefWithInit.mjs | |
| 392 | + var React = __toESM(require_react(), 1); | |
| 393 | + var UNINITIALIZED = {}; | |
| 394 | + function useRefWithInit(init, initArg) { | |
| 395 | + const ref = React.useRef(UNINITIALIZED); | |
| 396 | + if (ref.current === UNINITIALIZED) { | |
| 397 | + ref.current = init(initArg); | |
| 398 | + } | |
| 399 | + return ref; | |
| 400 | + } | |
| 401 | + | |
| 402 | + // node_modules/@base-ui/utils/warn.mjs | |
| 403 | + var warn = createLogOnce("warn", "Base UI"); | |
| 404 | + | |
| 405 | + // node_modules/@base-ui/utils/empty.mjs | |
| 406 | + var EMPTY_ARRAY = Object.freeze([]); | |
| 407 | + var EMPTY_OBJECT = Object.freeze({}); | |
| 408 | + | |
| 409 | + // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 410 | + var React4 = __toESM(require_react(), 1); | |
| 411 | + | |
| 412 | + // node_modules/@base-ui/utils/useMergedRefs.mjs | |
| 413 | + function useMergedRefs(a, b, c, d) { | |
| 414 | + const forkRef = useRefWithInit(createForkRef).current; | |
| 415 | + if (didChange(forkRef, a, b, c, d)) { | |
| 416 | + update(forkRef, [a, b, c, d]); | |
| 417 | + } | |
| 418 | + return forkRef.callback; | |
| 419 | + } | |
| 420 | + function useMergedRefsN(refs) { | |
| 421 | + const forkRef = useRefWithInit(createForkRef).current; | |
| 422 | + if (didChangeN(forkRef, refs)) { | |
| 423 | + update(forkRef, refs); | |
| 424 | + } | |
| 425 | + return forkRef.callback; | |
| 426 | + } | |
| 427 | + function createForkRef() { | |
| 428 | + return { | |
| 429 | + callback: null, | |
| 430 | + cleanup: null, | |
| 431 | + refs: [] | |
| 432 | + }; | |
| 433 | + } | |
| 434 | + function didChange(forkRef, a, b, c, d) { | |
| 435 | + return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; | |
| 436 | + } | |
| 437 | + function didChangeN(forkRef, newRefs) { | |
| 438 | + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); | |
| 439 | + } | |
| 440 | + function update(forkRef, refs) { | |
| 441 | + forkRef.refs = refs; | |
| 442 | + if (refs.every((ref) => ref == null)) { | |
| 443 | + forkRef.callback = null; | |
| 444 | + return; | |
| 445 | + } | |
| 446 | + forkRef.callback = (instance) => { | |
| 447 | + if (forkRef.cleanup) { | |
| 448 | + forkRef.cleanup(); | |
| 449 | + forkRef.cleanup = null; | |
| 450 | + } | |
| 451 | + if (instance != null) { | |
| 452 | + const cleanupCallbacks = Array(refs.length).fill(null); | |
| 453 | + for (let i = 0; i < refs.length; i += 1) { | |
| 454 | + const ref = refs[i]; | |
| 455 | + if (ref == null) { | |
| 456 | + continue; | |
| 457 | + } | |
| 458 | + switch (typeof ref) { | |
| 459 | + case "function": { | |
| 460 | + const refCleanup = ref(instance); | |
| 461 | + if (typeof refCleanup === "function") { | |
| 462 | + cleanupCallbacks[i] = refCleanup; | |
| 463 | + } | |
| 464 | + break; | |
| 465 | + } | |
| 466 | + case "object": { | |
| 467 | + ref.current = instance; | |
| 468 | + break; | |
| 469 | + } | |
| 470 | + default: | |
| 471 | + } | |
| 472 | + } | |
| 473 | + forkRef.cleanup = () => { | |
| 474 | + for (let i = 0; i < refs.length; i += 1) { | |
| 475 | + const ref = refs[i]; | |
| 476 | + if (ref == null) { | |
| 477 | + continue; | |
| 478 | + } | |
| 479 | + switch (typeof ref) { | |
| 480 | + case "function": { | |
| 481 | + const cleanupCallback = cleanupCallbacks[i]; | |
| 482 | + if (typeof cleanupCallback === "function") { | |
| 483 | + cleanupCallback(); | |
| 484 | + } else { | |
| 485 | + void ref(null); | |
| 486 | + } | |
| 487 | + break; | |
| 488 | + } | |
| 489 | + case "object": { | |
| 490 | + ref.current = null; | |
| 491 | + break; | |
| 492 | + } | |
| 493 | + default: | |
| 494 | + } | |
| 495 | + } | |
| 496 | + }; | |
| 497 | + } | |
| 498 | + }; | |
| 499 | + } | |
| 500 | + | |
| 501 | + // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 502 | + var React3 = __toESM(require_react(), 1); | |
| 503 | + | |
| 504 | + // node_modules/@base-ui/utils/reactVersion.mjs | |
| 505 | + var React2 = __toESM(require_react(), 1); | |
| 506 | + var majorVersion = parseInt(React2.version, 10); | |
| 507 | + function isReactVersionAtLeast(reactVersionToCheck) { | |
| 508 | + return majorVersion >= reactVersionToCheck; | |
| 509 | + } | |
| 510 | + | |
| 511 | + // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 512 | + function getReactElementRef(element) { | |
| 513 | + if (!/* @__PURE__ */ React3.isValidElement(element)) { | |
| 514 | + return null; | |
| 515 | + } | |
| 516 | + const reactElement = element; | |
| 517 | + const propsWithRef = reactElement.props; | |
| 518 | + return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; | |
| 519 | + } | |
| 520 | + | |
| 521 | + // node_modules/@base-ui/utils/mergeObjects.mjs | |
| 522 | + function mergeObjects(a, b) { | |
| 523 | + if (a && !b) { | |
| 524 | + return a; | |
| 525 | + } | |
| 526 | + if (!a && b) { | |
| 527 | + return b; | |
| 528 | + } | |
| 529 | + if (a || b) { | |
| 530 | + return { | |
| 531 | + ...a, | |
| 532 | + ...b | |
| 533 | + }; | |
| 534 | + } | |
| 535 | + return void 0; | |
| 536 | + } | |
| 537 | + | |
| 538 | + // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs | |
| 539 | + function getStateAttributesProps(state, customMapping) { | |
| 540 | + const props = {}; | |
| 541 | + for (const key in state) { | |
| 542 | + const value = state[key]; | |
| 543 | + if (customMapping?.hasOwnProperty(key)) { | |
| 544 | + const customProps = customMapping[key](value); | |
| 545 | + if (customProps != null) { | |
| 546 | + Object.assign(props, customProps); | |
| 547 | + } | |
| 548 | + continue; | |
| 549 | + } | |
| 550 | + if (value === true) { | |
| 551 | + props[`data-${key.toLowerCase()}`] = ""; | |
| 552 | + } else if (value) { | |
| 553 | + props[`data-${key.toLowerCase()}`] = value.toString(); | |
| 554 | + } | |
| 555 | + } | |
| 556 | + return props; | |
| 557 | + } | |
| 558 | + | |
| 559 | + // node_modules/@base-ui/react/utils/resolveClassName.mjs | |
| 560 | + function resolveClassName(className, state) { | |
| 561 | + return typeof className === "function" ? className(state) : className; | |
| 562 | + } | |
| 563 | + | |
| 564 | + // node_modules/@base-ui/react/utils/resolveStyle.mjs | |
| 565 | + function resolveStyle(style, state) { | |
| 566 | + return typeof style === "function" ? style(state) : style; | |
| 567 | + } | |
| 568 | + | |
| 569 | + // node_modules/@base-ui/react/merge-props/mergeProps.mjs | |
| 570 | + var EMPTY_PROPS = {}; | |
| 571 | + function mergeProps(a, b, c, d, e) { | |
| 572 | + if (!c && !d && !e && !a) { | |
| 573 | + return createInitialMergedProps(b); | |
| 574 | + } | |
| 575 | + let merged = createInitialMergedProps(a); | |
| 576 | + if (b) { | |
| 577 | + merged = mergeInto(merged, b); | |
| 578 | + } | |
| 579 | + if (c) { | |
| 580 | + merged = mergeInto(merged, c); | |
| 581 | + } | |
| 582 | + if (d) { | |
| 583 | + merged = mergeInto(merged, d); | |
| 584 | + } | |
| 585 | + if (e) { | |
| 586 | + merged = mergeInto(merged, e); | |
| 587 | + } | |
| 588 | + return merged; | |
| 589 | + } | |
| 590 | + function mergePropsN(props) { | |
| 591 | + if (props.length === 0) { | |
| 592 | + return EMPTY_PROPS; | |
| 593 | + } | |
| 594 | + if (props.length === 1) { | |
| 595 | + return createInitialMergedProps(props[0]); | |
| 596 | + } | |
| 597 | + let merged = createInitialMergedProps(props[0]); | |
| 598 | + for (let i = 1; i < props.length; i += 1) { | |
| 599 | + merged = mergeInto(merged, props[i]); | |
| 600 | + } | |
| 601 | + return merged; | |
| 602 | + } | |
| 603 | + function createInitialMergedProps(inputProps) { | |
| 604 | + if (isPropsGetter(inputProps)) { | |
| 605 | + return { | |
| 606 | + ...resolvePropsGetter(inputProps, EMPTY_PROPS) | |
| 607 | + }; | |
| 608 | + } | |
| 609 | + return copyInitialProps(inputProps); | |
| 610 | + } | |
| 611 | + function mergeInto(merged, inputProps) { | |
| 612 | + if (isPropsGetter(inputProps)) { | |
| 613 | + return resolvePropsGetter(inputProps, merged); | |
| 614 | + } | |
| 615 | + return mutablyMergeInto(merged, inputProps); | |
| 616 | + } | |
| 617 | + function copyInitialProps(inputProps) { | |
| 618 | + const copiedProps = { | |
| 619 | + ...inputProps | |
| 620 | + }; | |
| 621 | + for (const propName in copiedProps) { | |
| 622 | + const propValue = copiedProps[propName]; | |
| 623 | + if (isEventHandler(propName, propValue)) { | |
| 624 | + copiedProps[propName] = wrapEventHandler(propValue); | |
| 625 | + } | |
| 626 | + } | |
| 627 | + return copiedProps; | |
| 628 | + } | |
| 629 | + function mutablyMergeInto(mergedProps, externalProps) { | |
| 630 | + if (!externalProps) { | |
| 631 | + return mergedProps; | |
| 632 | + } | |
| 633 | + for (const propName in externalProps) { | |
| 634 | + const externalPropValue = externalProps[propName]; | |
| 635 | + switch (propName) { | |
| 636 | + case "style": { | |
| 637 | + mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); | |
| 638 | + break; | |
| 639 | + } | |
| 640 | + case "className": { | |
| 641 | + mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); | |
| 642 | + break; | |
| 643 | + } | |
| 644 | + default: { | |
| 645 | + if (isEventHandler(propName, externalPropValue)) { | |
| 646 | + mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); | |
| 647 | + } else { | |
| 648 | + mergedProps[propName] = externalPropValue; | |
| 649 | + } | |
| 650 | + } | |
| 651 | + } | |
| 652 | + } | |
| 653 | + return mergedProps; | |
| 654 | + } | |
| 655 | + function isEventHandler(key, value) { | |
| 656 | + const code0 = key.charCodeAt(0); | |
| 657 | + const code1 = key.charCodeAt(1); | |
| 658 | + const code2 = key.charCodeAt(2); | |
| 659 | + return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); | |
| 660 | + } | |
| 661 | + function isPropsGetter(inputProps) { | |
| 662 | + return typeof inputProps === "function"; | |
| 663 | + } | |
| 664 | + function resolvePropsGetter(inputProps, previousProps) { | |
| 665 | + if (isPropsGetter(inputProps)) { | |
| 666 | + return inputProps(previousProps); | |
| 667 | + } | |
| 668 | + return inputProps ?? EMPTY_PROPS; | |
| 669 | + } | |
| 670 | + function mergeEventHandlers(ourHandler, theirHandler) { | |
| 671 | + if (!theirHandler) { | |
| 672 | + return ourHandler; | |
| 673 | + } | |
| 674 | + if (!ourHandler) { | |
| 675 | + return wrapEventHandler(theirHandler); | |
| 676 | + } | |
| 677 | + return (...args) => { | |
| 678 | + const event = args[0]; | |
| 679 | + if (isSyntheticEvent(event)) { | |
| 680 | + const baseUIEvent = event; | |
| 681 | + makeEventPreventable(baseUIEvent); | |
| 682 | + const result2 = theirHandler(...args); | |
| 683 | + if (!baseUIEvent.baseUIHandlerPrevented) { | |
| 684 | + ourHandler?.(...args); | |
| 685 | + } | |
| 686 | + return result2; | |
| 687 | + } | |
| 688 | + const result = theirHandler(...args); | |
| 689 | + ourHandler?.(...args); | |
| 690 | + return result; | |
| 691 | + }; | |
| 692 | + } | |
| 693 | + function wrapEventHandler(handler) { | |
| 694 | + if (!handler) { | |
| 695 | + return handler; | |
| 696 | + } | |
| 697 | + return (...args) => { | |
| 698 | + const event = args[0]; | |
| 699 | + if (isSyntheticEvent(event)) { | |
| 700 | + makeEventPreventable(event); | |
| 701 | + } | |
| 702 | + return handler(...args); | |
| 703 | + }; | |
| 704 | + } | |
| 705 | + function makeEventPreventable(event) { | |
| 706 | + event.preventBaseUIHandler = () => { | |
| 707 | + event.baseUIHandlerPrevented = true; | |
| 708 | + }; | |
| 709 | + return event; | |
| 710 | + } | |
| 711 | + function mergeClassNames(ourClassName, theirClassName) { | |
| 712 | + if (theirClassName) { | |
| 713 | + if (ourClassName) { | |
| 714 | + return theirClassName + " " + ourClassName; | |
| 715 | + } | |
| 716 | + return theirClassName; | |
| 717 | + } | |
| 718 | + return ourClassName; | |
| 719 | + } | |
| 720 | + function isSyntheticEvent(event) { | |
| 721 | + return event != null && typeof event === "object" && "nativeEvent" in event; | |
| 722 | + } | |
| 723 | + | |
| 724 | + // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 725 | + var import_react = __toESM(require_react(), 1); | |
| 726 | + function useRenderElement(element, componentProps, params = {}) { | |
| 727 | + let renderProp = componentProps.render; | |
| 728 | + if (params.enabled !== false) { | |
| 729 | + renderProp = unwrapLazyRenderProp(renderProp); | |
| 730 | + } | |
| 731 | + const outProps = useRenderElementProps(componentProps, params, renderProp); | |
| 732 | + if (params.enabled === false) { | |
| 733 | + return null; | |
| 734 | + } | |
| 735 | + const state = params.state ?? EMPTY_OBJECT; | |
| 736 | + return evaluateRenderProp(element, renderProp, outProps, state); | |
| 737 | + } | |
| 738 | + function useRenderElementProps(componentProps, params, renderProp) { | |
| 739 | + const { | |
| 740 | + className: classNameProp, | |
| 741 | + style: styleProp | |
| 742 | + } = componentProps; | |
| 743 | + const { | |
| 744 | + state = EMPTY_OBJECT, | |
| 745 | + ref, | |
| 746 | + props, | |
| 747 | + stateAttributesMapping, | |
| 748 | + enabled = true | |
| 749 | + } = params; | |
| 750 | + const className = enabled ? resolveClassName(classNameProp, state) : void 0; | |
| 751 | + const style = enabled ? resolveStyle(styleProp, state) : void 0; | |
| 752 | + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; | |
| 753 | + const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; | |
| 754 | + const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; | |
| 755 | + if (typeof document !== "undefined") { | |
| 756 | + if (!enabled) { | |
| 757 | + void useMergedRefs(null, null); | |
| 758 | + } else if (Array.isArray(ref)) { | |
| 759 | + outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); | |
| 760 | + } else { | |
| 761 | + outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); | |
| 762 | + } | |
| 763 | + } | |
| 764 | + if (!enabled) { | |
| 765 | + return EMPTY_OBJECT; | |
| 766 | + } | |
| 767 | + if (className !== void 0) { | |
| 768 | + outProps.className = mergeClassNames(outProps.className, className); | |
| 769 | + } | |
| 770 | + if (style !== void 0) { | |
| 771 | + outProps.style = mergeObjects(outProps.style, style); | |
| 772 | + } | |
| 773 | + return outProps; | |
| 774 | + } | |
| 775 | + function resolveRenderFunctionProps(props) { | |
| 776 | + if (Array.isArray(props)) { | |
| 777 | + return mergePropsN(props); | |
| 778 | + } | |
| 779 | + return mergeProps(void 0, props); | |
| 780 | + } | |
| 781 | + var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); | |
| 782 | + var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; | |
| 783 | + var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; | |
| 784 | + function unwrapLazyRenderProp(render) { | |
| 785 | + if (render?.$$typeof !== REACT_LAZY_TYPE) { | |
| 786 | + return render; | |
| 787 | + } | |
| 788 | + const unwrapped = React4.Children.toArray(render)[0]; | |
| 789 | + return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; | |
| 790 | + } | |
| 791 | + function evaluateRenderProp(element, render, props, state) { | |
| 792 | + if (render) { | |
| 793 | + if (typeof render === "function") { | |
| 794 | + if (true) { | |
| 795 | + warnIfRenderPropLooksLikeComponent(render); | |
| 796 | + } | |
| 797 | + return render(props, state); | |
| 798 | + } | |
| 799 | + const mergedProps = mergeProps(props, render.props); | |
| 800 | + mergedProps.ref = props.ref; | |
| 801 | + if (true) { | |
| 802 | + if (!/* @__PURE__ */ React4.isValidElement(render)) { | |
| 803 | + 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")); | |
| 804 | + } | |
| 805 | + } | |
| 806 | + return /* @__PURE__ */ React4.cloneElement(render, mergedProps); | |
| 807 | + } | |
| 808 | + if (element) { | |
| 809 | + if (typeof element === "string") { | |
| 810 | + return renderTag(element, props); | |
| 811 | + } | |
| 812 | + } | |
| 813 | + throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); | |
| 814 | + } | |
| 815 | + function warnIfRenderPropLooksLikeComponent(renderFn) { | |
| 816 | + const functionName = renderFn.name; | |
| 817 | + if (functionName.length === 0) { | |
| 818 | + return; | |
| 819 | + } | |
| 820 | + if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { | |
| 821 | + return; | |
| 822 | + } | |
| 823 | + if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { | |
| 824 | + return; | |
| 825 | + } | |
| 826 | + 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"); | |
| 827 | + } | |
| 828 | + function renderTag(Tag, props) { | |
| 829 | + if (Tag === "button") { | |
| 830 | + return /* @__PURE__ */ (0, import_react.createElement)("button", { | |
| 831 | + type: "button", | |
| 832 | + ...props, | |
| 833 | + key: props.key | |
| 834 | + }); | |
| 835 | + } | |
| 836 | + if (Tag === "img") { | |
| 837 | + return /* @__PURE__ */ (0, import_react.createElement)("img", { | |
| 838 | + alt: "", | |
| 839 | + ...props, | |
| 840 | + key: props.key | |
| 841 | + }); | |
| 842 | + } | |
| 843 | + return /* @__PURE__ */ React4.createElement(Tag, props); | |
| 844 | + } | |
| 845 | + | |
| 846 | + // node_modules/@base-ui/react/use-render/useRender.mjs | |
| 847 | + function useRender(params) { | |
| 848 | + return useRenderElement(params.defaultTagName ?? "div", params, params); | |
| 849 | + } | |
| 850 | + | |
| 851 | + // packages/ui/build-module/text/text.mjs | |
| 852 | + var import_element2 = __toESM(require_element(), 1); | |
| 853 | + var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; | |
| 854 | + function getRuntime() { | |
| 855 | + const globalScope = globalThis; | |
| 856 | + if (globalScope.__wpStyleRuntime) { | |
| 857 | + return globalScope.__wpStyleRuntime; | |
| 858 | + } | |
| 859 | + globalScope.__wpStyleRuntime = { | |
| 860 | + documents: /* @__PURE__ */ new Map(), | |
| 861 | + styles: /* @__PURE__ */ new Map(), | |
| 862 | + injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 863 | + }; | |
| 864 | + if (typeof document !== "undefined") { | |
| 865 | + registerDocument(document); | |
| 866 | + } | |
| 867 | + return globalScope.__wpStyleRuntime; | |
| 868 | + } | |
| 869 | + function documentContainsStyleHash(targetDocument, hash) { | |
| 870 | + if (!targetDocument.head) { | |
| 871 | + return false; | |
| 872 | + } | |
| 873 | + for (const style of targetDocument.head.querySelectorAll( | |
| 874 | + `style[${STYLE_HASH_ATTRIBUTE}]` | |
| 875 | + )) { | |
| 876 | + if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { | |
| 877 | + return true; | |
| 878 | + } | |
| 879 | + } | |
| 880 | + return false; | |
| 881 | + } | |
| 882 | + function injectStyle(targetDocument, hash, css) { | |
| 883 | + if (!targetDocument.head) { | |
| 884 | + return; | |
| 885 | + } | |
| 886 | + const runtime = getRuntime(); | |
| 887 | + let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 888 | + if (!injectedStyles) { | |
| 889 | + injectedStyles = /* @__PURE__ */ new Set(); | |
| 890 | + runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 891 | + } | |
| 892 | + if (injectedStyles.has(hash)) { | |
| 893 | + return; | |
| 894 | + } | |
| 895 | + if (documentContainsStyleHash(targetDocument, hash)) { | |
| 896 | + injectedStyles.add(hash); | |
| 897 | + return; | |
| 898 | + } | |
| 899 | + const style = targetDocument.createElement("style"); | |
| 900 | + style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); | |
| 901 | + style.appendChild(targetDocument.createTextNode(css)); | |
| 902 | + targetDocument.head.appendChild(style); | |
| 903 | + injectedStyles.add(hash); | |
| 904 | + } | |
| 905 | + function registerDocument(targetDocument) { | |
| 906 | + const runtime = getRuntime(); | |
| 907 | + runtime.documents.set( | |
| 908 | + targetDocument, | |
| 909 | + (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 910 | + ); | |
| 911 | + for (const [hash, css] of runtime.styles) { | |
| 912 | + injectStyle(targetDocument, hash, css); | |
| 913 | + } | |
| 914 | + return () => { | |
| 915 | + const count = runtime.documents.get(targetDocument); | |
| 916 | + if (count === void 0) { | |
| 917 | + return; | |
| 918 | + } | |
| 919 | + if (count <= 1) { | |
| 920 | + runtime.documents.delete(targetDocument); | |
| 921 | + return; | |
| 922 | + } | |
| 923 | + runtime.documents.set(targetDocument, count - 1); | |
| 924 | + }; | |
| 925 | + } | |
| 926 | + function registerStyle(hash, css) { | |
| 927 | + const runtime = getRuntime(); | |
| 928 | + runtime.styles.set(hash, css); | |
| 929 | + for (const targetDocument of runtime.documents.keys()) { | |
| 930 | + injectStyle(targetDocument, hash, css); | |
| 931 | + } | |
| 932 | + } | |
| 933 | + if (typeof process === "undefined" || true) { | |
| 934 | + registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); | |
| 935 | + } | |
| 936 | + var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" }; | |
| 937 | + if (typeof process === "undefined" || true) { | |
| 938 | + registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); | |
| 939 | + } | |
| 940 | + var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; | |
| 941 | + var Text = (0, import_element2.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) { | |
| 942 | + const element = useRender({ | |
| 943 | + render, | |
| 944 | + defaultTagName: "span", | |
| 945 | + ref, | |
| 946 | + props: mergeProps(props, { | |
| 947 | + className: clsx_default( | |
| 948 | + style_default.text, | |
| 949 | + global_css_defense_default.heading, | |
| 950 | + global_css_defense_default.p, | |
| 951 | + style_default[variant], | |
| 952 | + className | |
| 953 | + ) | |
| 954 | + }) | |
| 955 | + }); | |
| 956 | + return element; | |
| 957 | + }); | |
| 958 | + | |
| 959 | + // packages/icons/build-module/library/symbol.mjs | |
| 960 | + var import_primitives = __toESM(require_primitives(), 1); | |
| 961 | + var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); | |
| 962 | + var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ | |
| 963 | + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M15.2071 6.20711L20.2929 11.2929C20.6834 11.6834 20.6834 12.3166 20.2929 12.7071L15.2071 17.7929C14.8166 18.1834 14.1834 18.1834 13.7929 17.7929L8.70711 12.7071C8.31658 12.3166 8.31658 11.6834 8.70711 11.2929L13.7929 6.20711C14.1834 5.81658 14.8166 5.81658 15.2071 6.20711Z", vectorEffect: "non-scaling-stroke" }), | |
| 964 | + /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M9.5 5.5L3.70711 11.2929C3.31658 11.6834 3.31658 12.3166 3.70711 12.7071L9.5 18.5", vectorEffect: "non-scaling-stroke" }) | |
| 965 | + ] }); | |
| 966 | + | |
| 967 | + // packages/ui/build-module/stack/stack.mjs | |
| 968 | + var import_element3 = __toESM(require_element(), 1); | |
| 969 | + var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; | |
| 970 | + function getRuntime2() { | |
| 971 | + const globalScope = globalThis; | |
| 972 | + if (globalScope.__wpStyleRuntime) { | |
| 973 | + return globalScope.__wpStyleRuntime; | |
| 974 | + } | |
| 975 | + globalScope.__wpStyleRuntime = { | |
| 976 | + documents: /* @__PURE__ */ new Map(), | |
| 977 | + styles: /* @__PURE__ */ new Map(), | |
| 978 | + injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 979 | + }; | |
| 980 | + if (typeof document !== "undefined") { | |
| 981 | + registerDocument2(document); | |
| 982 | + } | |
| 983 | + return globalScope.__wpStyleRuntime; | |
| 984 | + } | |
| 985 | + function documentContainsStyleHash2(targetDocument, hash) { | |
| 986 | + if (!targetDocument.head) { | |
| 987 | + return false; | |
| 988 | + } | |
| 989 | + for (const style of targetDocument.head.querySelectorAll( | |
| 990 | + `style[${STYLE_HASH_ATTRIBUTE2}]` | |
| 991 | + )) { | |
| 992 | + if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { | |
| 993 | + return true; | |
| 994 | + } | |
| 995 | + } | |
| 996 | + return false; | |
| 997 | + } | |
| 998 | + function injectStyle2(targetDocument, hash, css) { | |
| 999 | + if (!targetDocument.head) { | |
| 1000 | + return; | |
| 1001 | + } | |
| 1002 | + const runtime = getRuntime2(); | |
| 1003 | + let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 1004 | + if (!injectedStyles) { | |
| 1005 | + injectedStyles = /* @__PURE__ */ new Set(); | |
| 1006 | + runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 1007 | + } | |
| 1008 | + if (injectedStyles.has(hash)) { | |
| 1009 | + return; | |
| 1010 | + } | |
| 1011 | + if (documentContainsStyleHash2(targetDocument, hash)) { | |
| 1012 | + injectedStyles.add(hash); | |
| 1013 | + return; | |
| 1014 | + } | |
| 1015 | + const style = targetDocument.createElement("style"); | |
| 1016 | + style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); | |
| 1017 | + style.appendChild(targetDocument.createTextNode(css)); | |
| 1018 | + targetDocument.head.appendChild(style); | |
| 1019 | + injectedStyles.add(hash); | |
| 1020 | + } | |
| 1021 | + function registerDocument2(targetDocument) { | |
| 1022 | + const runtime = getRuntime2(); | |
| 1023 | + runtime.documents.set( | |
| 1024 | + targetDocument, | |
| 1025 | + (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 1026 | + ); | |
| 1027 | + for (const [hash, css] of runtime.styles) { | |
| 1028 | + injectStyle2(targetDocument, hash, css); | |
| 1029 | + } | |
| 1030 | + return () => { | |
| 1031 | + const count = runtime.documents.get(targetDocument); | |
| 1032 | + if (count === void 0) { | |
| 1033 | + return; | |
| 1034 | + } | |
| 1035 | + if (count <= 1) { | |
| 1036 | + runtime.documents.delete(targetDocument); | |
| 1037 | + return; | |
| 1038 | + } | |
| 1039 | + runtime.documents.set(targetDocument, count - 1); | |
| 1040 | + }; | |
| 1041 | + } | |
| 1042 | + function registerStyle2(hash, css) { | |
| 1043 | + const runtime = getRuntime2(); | |
| 1044 | + runtime.styles.set(hash, css); | |
| 1045 | + for (const targetDocument of runtime.documents.keys()) { | |
| 1046 | + injectStyle2(targetDocument, hash, css); | |
| 1047 | + } | |
| 1048 | + } | |
| 1049 | + if (typeof process === "undefined" || true) { | |
| 1050 | + registerStyle2("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); | |
| 1051 | + } | |
| 1052 | + var style_default2 = { "stack": "_19ce0419607e1896__stack" }; | |
| 1053 | + var gapTokens = { | |
| 1054 | + xs: "var(--wpds-dimension-gap-xs, 4px)", | |
| 1055 | + sm: "var(--wpds-dimension-gap-sm, 8px)", | |
| 1056 | + md: "var(--wpds-dimension-gap-md, 12px)", | |
| 1057 | + lg: "var(--wpds-dimension-gap-lg, 16px)", | |
| 1058 | + xl: "var(--wpds-dimension-gap-xl, 24px)", | |
| 1059 | + "2xl": "var(--wpds-dimension-gap-2xl, 32px)", | |
| 1060 | + "3xl": "var(--wpds-dimension-gap-3xl, 40px)" | |
| 1061 | + }; | |
| 1062 | + var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { | |
| 1063 | + const style = { | |
| 1064 | + gap: gap && gapTokens[gap], | |
| 1065 | + alignItems: align, | |
| 1066 | + justifyContent: justify, | |
| 1067 | + flexDirection: direction, | |
| 1068 | + flexWrap: wrap | |
| 1069 | + }; | |
| 1070 | + const element = useRender({ | |
| 1071 | + render, | |
| 1072 | + ref, | |
| 1073 | + props: mergeProps(props, { style, className: style_default2.stack }) | |
| 1074 | + }); | |
| 1075 | + return element; | |
| 1076 | + }); | |
| 1077 | + | |
| 1078 | + // packages/patterns/build-module/components/create-pattern-modal.mjs | |
| 343 | 1079 | var import_i18n3 = __toESM(require_i18n(), 1); |
| 344 | - var import_element4 = __toESM(require_element(), 1); | |
| 1080 | + var import_element6 = __toESM(require_element(), 1); | |
| 345 | 1081 | var import_data5 = __toESM(require_data(), 1); |
| 346 | 1082 | var import_notices = __toESM(require_notices(), 1); |
| 347 | 1083 | var import_core_data3 = __toESM(require_core_data(), 1); |
| 348 | 1084 | |
| @@ -347,13 +1083,13 @@ | ||
| 347 | 1083 | var import_core_data3 = __toESM(require_core_data(), 1); |
| 348 | 1084 | |
| 349 | 1085 | // packages/patterns/build-module/components/category-selector.mjs |
| 350 | 1086 | var import_i18n2 = __toESM(require_i18n(), 1); |
| 351 | - var import_element2 = __toESM(require_element(), 1); | |
| 1087 | + var import_element4 = __toESM(require_element(), 1); | |
| 352 | 1088 | var import_components2 = __toESM(require_components(), 1); |
| 353 | 1089 | var import_compose = __toESM(require_compose(), 1); |
| 354 | 1090 | var import_html_entities = __toESM(require_html_entities(), 1); |
| 355 | - var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); | |
| 1091 | + var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); | |
| 356 | 1092 | var unescapeString = (arg) => { |
| 357 | 1093 | return (0, import_html_entities.decodeEntities)(arg); |
| 358 | 1094 | }; |
| 359 | 1095 | var CATEGORY_SLUG = "wp_pattern_category"; |
| @@ -361,11 +1097,11 @@ | ||
| 361 | 1097 | categoryTerms, |
| 362 | 1098 | onChange, |
| 363 | 1099 | categoryMap |
| 364 | 1100 | }) { |
| 365 | - const [search, setSearch] = (0, import_element2.useState)(""); | |
| 1101 | + const [search, setSearch] = (0, import_element4.useState)(""); | |
| 366 | 1102 | const debouncedSearch = (0, import_compose.useDebounce)(setSearch, 500); |
| 367 | - const suggestions = (0, import_element2.useMemo)(() => { | |
| 1103 | + const suggestions = (0, import_element4.useMemo)(() => { | |
| 368 | 1104 | return Array.from(categoryMap.values()).map((category) => unescapeString(category.label)).filter((category) => { |
| 369 | 1105 | if (search !== "") { |
| 370 | 1106 | return category.toLowerCase().includes(search.toLowerCase()); |
| 371 | 1107 | } |
| @@ -382,9 +1118,9 @@ | ||
| 382 | 1118 | return terms; |
| 383 | 1119 | }, []); |
| 384 | 1120 | onChange(uniqueTerms); |
| 385 | 1121 | } |
| 386 | - return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)( | |
| 1122 | + return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 387 | 1123 | import_components2.FormTokenField, |
| 388 | 1124 | { |
| 389 | 1125 | className: "patterns-menu-items__convert-modal-categories", |
| 390 | 1126 | value: categoryTerms, |
| @@ -392,10 +1128,9 @@ | ||
| 392 | 1128 | onChange: handleChange, |
| 393 | 1129 | onInputChange: debouncedSearch, |
| 394 | 1130 | label: (0, import_i18n2.__)("Categories"), |
| 395 | 1131 | tokenizeOnBlur: true, |
| 396 | - __experimentalExpandOnFocus: true, | |
| 397 | - __next40pxDefaultSize: true | |
| 1132 | + __experimentalExpandOnFocus: true | |
| 398 | 1133 | } |
| 399 | 1134 | ); |
| 400 | 1135 | } |
| 401 | 1136 | |
| @@ -401,9 +1136,9 @@ | ||
| 401 | 1136 | |
| 402 | 1137 | // packages/patterns/build-module/private-hooks.mjs |
| 403 | 1138 | var import_data4 = __toESM(require_data(), 1); |
| 404 | 1139 | var import_core_data2 = __toESM(require_core_data(), 1); |
| 405 | - var import_element3 = __toESM(require_element(), 1); | |
| 1140 | + var import_element5 = __toESM(require_element(), 1); | |
| 406 | 1141 | function useAddPatternCategory() { |
| 407 | 1142 | const { saveEntityRecord, invalidateResolution } = (0, import_data4.useDispatch)(import_core_data2.store); |
| 408 | 1143 | const { corePatternCategories, userPatternCategories } = (0, import_data4.useSelect)( |
| 409 | 1144 | (select) => { |
| @@ -414,9 +1149,9 @@ | ||
| 414 | 1149 | }; |
| 415 | 1150 | }, |
| 416 | 1151 | [] |
| 417 | 1152 | ); |
| 418 | - const categoryMap = (0, import_element3.useMemo)(() => { | |
| 1153 | + const categoryMap = (0, import_element5.useMemo)(() => { | |
| 419 | 1154 | const uniqueCategories = /* @__PURE__ */ new Map(); |
| 420 | 1155 | userPatternCategories.forEach((category) => { |
| 421 | 1156 | uniqueCategories.set(category.label.toLowerCase(), { |
| 422 | 1157 | label: category.label, |
| @@ -461,9 +1196,9 @@ | ||
| 461 | 1196 | return { categoryMap, findOrCreateTerm }; |
| 462 | 1197 | } |
| 463 | 1198 | |
| 464 | 1199 | // packages/patterns/build-module/components/create-pattern-modal.mjs |
| 465 | - var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); | |
| 1200 | + var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); | |
| 466 | 1201 | function CreatePatternModal({ |
| 467 | 1202 | className = "patterns-menu-items__convert-modal", |
| 468 | 1203 | modalTitle, |
| 469 | 1204 | ...restProps |
| @@ -471,9 +1206,9 @@ | ||
| 471 | 1206 | const defaultModalTitle = (0, import_data5.useSelect)( |
| 472 | 1207 | (select) => select(import_core_data3.store).getPostType(PATTERN_TYPES.user)?.labels?.add_new_item, |
| 473 | 1208 | [] |
| 474 | 1209 | ); |
| 475 | - return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1210 | + return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 476 | 1211 | import_components3.Modal, |
| 477 | 1212 | { |
| 478 | 1213 | title: modalTitle || defaultModalTitle, |
| 479 | 1214 | onRequestClose: restProps.onClose, |
| @@ -479,9 +1214,9 @@ | ||
| 479 | 1214 | onRequestClose: restProps.onClose, |
| 480 | 1215 | overlayClassName: className, |
| 481 | 1216 | focusOnMount: "firstContentElement", |
| 482 | 1217 | size: "small", |
| 483 | - children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CreatePatternModalContents, { ...restProps }) | |
| 1218 | + children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CreatePatternModalContents, { ...restProps }) | |
| 484 | 1219 | } |
| 485 | 1220 | ); |
| 486 | 1221 | } |
| 487 | 1222 | function CreatePatternModalContents({ |
| @@ -493,12 +1228,12 @@ | ||
| 493 | 1228 | onSuccess, |
| 494 | 1229 | defaultSyncType = PATTERN_SYNC_TYPES.full, |
| 495 | 1230 | defaultTitle = "" |
| 496 | 1231 | }) { |
| 497 | - const [syncType, setSyncType] = (0, import_element4.useState)(defaultSyncType); | |
| 498 | - const [categoryTerms, setCategoryTerms] = (0, import_element4.useState)(defaultCategories); | |
| 499 | - const [title, setTitle] = (0, import_element4.useState)(defaultTitle); | |
| 500 | - const [isSaving, setIsSaving] = (0, import_element4.useState)(false); | |
| 1232 | + const [syncType, setSyncType] = (0, import_element6.useState)(defaultSyncType); | |
| 1233 | + const [categoryTerms, setCategoryTerms] = (0, import_element6.useState)(defaultCategories); | |
| 1234 | + const [title, setTitle] = (0, import_element6.useState)(defaultTitle); | |
| 1235 | + const [isSaving, setIsSaving] = (0, import_element6.useState)(false); | |
| 501 | 1236 | const { createPattern: createPattern2 } = unlock((0, import_data5.useDispatch)(store)); |
| 502 | 1237 | const { createErrorNotice } = (0, import_data5.useDispatch)(import_notices.store); |
| 503 | 1238 | const { categoryMap, findOrCreateTerm } = useAddPatternCategory(); |
| 504 | 1239 | async function onCreate(patternTitle, sync) { |
| @@ -533,9 +1268,9 @@ | ||
| 533 | 1268 | setCategoryTerms([]); |
| 534 | 1269 | setTitle(""); |
| 535 | 1270 | } |
| 536 | 1271 | } |
| 537 | - return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1272 | + return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 538 | 1273 | "form", |
| 539 | 1274 | { |
| 540 | 1275 | onSubmit: (event) => { |
| 541 | 1276 | event.preventDefault(); |
| @@ -540,10 +1275,10 @@ | ||
| 540 | 1275 | onSubmit: (event) => { |
| 541 | 1276 | event.preventDefault(); |
| 542 | 1277 | onCreate(title, syncType); |
| 543 | 1278 | }, |
| 544 | - children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_components3.__experimentalVStack, { spacing: "5", children: [ | |
| 545 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1279 | + children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 1280 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 546 | 1281 | import_components3.TextControl, |
| 547 | 1282 | { |
| 548 | 1283 | label: (0, import_i18n3.__)("Name"), |
| 549 | 1284 | value: title, |
| @@ -548,13 +1283,12 @@ | ||
| 548 | 1283 | label: (0, import_i18n3.__)("Name"), |
| 549 | 1284 | value: title, |
| 550 | 1285 | onChange: setTitle, |
| 551 | 1286 | placeholder: (0, import_i18n3.__)("My pattern"), |
| 552 | - className: "patterns-create-modal__name-input", | |
| 553 | - __next40pxDefaultSize: true | |
| 1287 | + className: "patterns-create-modal__name-input" | |
| 554 | 1288 | } |
| 555 | 1289 | ), |
| 556 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1290 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 557 | 1291 | CategorySelector, |
| 558 | 1292 | { |
| 559 | 1293 | categoryTerms, |
| 560 | 1294 | onChange: setCategoryTerms, |
| @@ -560,9 +1294,9 @@ | ||
| 560 | 1294 | onChange: setCategoryTerms, |
| 561 | 1295 | categoryMap |
| 562 | 1296 | } |
| 563 | 1297 | ), |
| 564 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1298 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 565 | 1299 | import_components3.ToggleControl, |
| 566 | 1300 | { |
| 567 | 1301 | label: (0, import_i18n3._x)("Synced", "pattern (singular)"), |
| 568 | 1302 | help: (0, import_i18n3.__)( |
| @@ -575,10 +1309,10 @@ | ||
| 575 | 1309 | ); |
| 576 | 1310 | } |
| 577 | 1311 | } |
| 578 | 1312 | ), |
| 579 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_components3.__experimentalHStack, { justify: "right", children: [ | |
| 580 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1313 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(Stack, { gap: "sm", justify: "end", children: [ | |
| 1314 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 581 | 1315 | import_components3.Button, |
| 582 | 1316 | { |
| 583 | 1317 | __next40pxDefaultSize: true, |
| 584 | 1318 | variant: "tertiary", |
| @@ -588,9 +1322,9 @@ | ||
| 588 | 1322 | }, |
| 589 | 1323 | children: (0, import_i18n3.__)("Cancel") |
| 590 | 1324 | } |
| 591 | 1325 | ), |
| 592 | - /* @__PURE__ */ (0, import_jsx_runtime3.jsx)( | |
| 1326 | + /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 593 | 1327 | import_components3.Button, |
| 594 | 1328 | { |
| 595 | 1329 | __next40pxDefaultSize: true, |
| 596 | 1330 | variant: "primary", |
| @@ -610,9 +1344,9 @@ | ||
| 610 | 1344 | var import_core_data4 = __toESM(require_core_data(), 1); |
| 611 | 1345 | var import_data6 = __toESM(require_data(), 1); |
| 612 | 1346 | var import_i18n4 = __toESM(require_i18n(), 1); |
| 613 | 1347 | var import_notices2 = __toESM(require_notices(), 1); |
| 614 | - var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); | |
| 1348 | + var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); | |
| 615 | 1349 | function getTermLabels(pattern, categories) { |
| 616 | 1350 | if (pattern.type !== PATTERN_TYPES.user) { |
| 617 | 1351 | return categories.core?.filter( |
| 618 | 1352 | (category) => pattern.categories?.includes(category.name) |
| @@ -667,9 +1401,9 @@ | ||
| 667 | 1401 | const duplicatedProps = useDuplicatePatternProps({ pattern, onSuccess }); |
| 668 | 1402 | if (!pattern) { |
| 669 | 1403 | return null; |
| 670 | 1404 | } |
| 671 | - return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)( | |
| 1405 | + return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | |
| 672 | 1406 | CreatePatternModal, |
| 673 | 1407 | { |
| 674 | 1408 | modalTitle: (0, import_i18n4.__)("Duplicate pattern"), |
| 675 | 1409 | confirmLabel: (0, import_i18n4.__)("Duplicate"), |
| @@ -683,13 +1417,13 @@ | ||
| 683 | 1417 | // packages/patterns/build-module/components/rename-pattern-modal.mjs |
| 684 | 1418 | var import_components4 = __toESM(require_components(), 1); |
| 685 | 1419 | var import_core_data5 = __toESM(require_core_data(), 1); |
| 686 | 1420 | var import_data7 = __toESM(require_data(), 1); |
| 687 | - var import_element5 = __toESM(require_element(), 1); | |
| 1421 | + var import_element7 = __toESM(require_element(), 1); | |
| 688 | 1422 | var import_html_entities2 = __toESM(require_html_entities(), 1); |
| 689 | 1423 | var import_i18n5 = __toESM(require_i18n(), 1); |
| 690 | 1424 | var import_notices3 = __toESM(require_notices(), 1); |
| 691 | - var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); | |
| 1425 | + var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); | |
| 692 | 1426 | function RenamePatternModal({ |
| 693 | 1427 | onClose, |
| 694 | 1428 | onError, |
| 695 | 1429 | onSuccess, |
| @@ -696,10 +1430,10 @@ | ||
| 696 | 1430 | pattern, |
| 697 | 1431 | ...props |
| 698 | 1432 | }) { |
| 699 | 1433 | const originalName = (0, import_html_entities2.decodeEntities)(pattern.title); |
| 700 | - const [name, setName] = (0, import_element5.useState)(originalName); | |
| 701 | - const [isSaving, setIsSaving] = (0, import_element5.useState)(false); | |
| 1434 | + const [name, setName] = (0, import_element7.useState)(originalName); | |
| 1435 | + const [isSaving, setIsSaving] = (0, import_element7.useState)(false); | |
| 702 | 1436 | const { |
| 703 | 1437 | editEntityRecord, |
| 704 | 1438 | __experimentalSaveSpecifiedEntityEdits: saveSpecifiedEntityEdits |
| 705 | 1439 | } = (0, import_data7.useDispatch)(import_core_data5.store); |
| @@ -743,9 +1477,9 @@ | ||
| 743 | 1477 | const onRequestClose = () => { |
| 744 | 1478 | onClose?.(); |
| 745 | 1479 | setName(""); |
| 746 | 1480 | }; |
| 747 | - return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | |
| 1481 | + return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( | |
| 748 | 1482 | import_components4.Modal, |
| 749 | 1483 | { |
| 750 | 1484 | title: (0, import_i18n5.__)("Rename"), |
| 751 | 1485 | ...props, |
| @@ -751,13 +1485,12 @@ | ||
| 751 | 1485 | ...props, |
| 752 | 1486 | onRequestClose: onClose, |
| 753 | 1487 | focusOnMount: "firstContentElement", |
| 754 | 1488 | size: "small", |
| 755 | - children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_components4.__experimentalVStack, { spacing: "5", children: [ | |
| 756 | - /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | |
| 1489 | + children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("form", { onSubmit: onRename, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 1490 | + /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( | |
| 757 | 1491 | import_components4.TextControl, |
| 758 | 1492 | { |
| 759 | - __next40pxDefaultSize: true, | |
| 760 | 1493 | label: (0, import_i18n5.__)("Name"), |
| 761 | 1494 | value: name, |
| 762 | 1495 | onChange: setName, |
| 763 | 1496 | required: true |
| @@ -762,10 +1495,10 @@ | ||
| 762 | 1495 | onChange: setName, |
| 763 | 1496 | required: true |
| 764 | 1497 | } |
| 765 | 1498 | ), |
| 766 | - /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_components4.__experimentalHStack, { justify: "right", children: [ | |
| 767 | - /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | |
| 1499 | + /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Stack, { gap: "sm", justify: "end", children: [ | |
| 1500 | + /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( | |
| 768 | 1501 | import_components4.Button, |
| 769 | 1502 | { |
| 770 | 1503 | __next40pxDefaultSize: true, |
| 771 | 1504 | variant: "tertiary", |
| @@ -772,9 +1505,9 @@ | ||
| 772 | 1505 | onClick: onRequestClose, |
| 773 | 1506 | children: (0, import_i18n5.__)("Cancel") |
| 774 | 1507 | } |
| 775 | 1508 | ), |
| 776 | - /* @__PURE__ */ (0, import_jsx_runtime5.jsx)( | |
| 1509 | + /* @__PURE__ */ (0, import_jsx_runtime6.jsx)( | |
| 777 | 1510 | import_components4.Button, |
| 778 | 1511 | { |
| 779 | 1512 | __next40pxDefaultSize: true, |
| 780 | 1513 | variant: "primary", |
| @@ -793,17 +1526,10 @@ | ||
| 793 | 1526 | |
| 794 | 1527 | // packages/patterns/build-module/components/pattern-convert-button.mjs |
| 795 | 1528 | var import_blocks2 = __toESM(require_blocks(), 1); |
| 796 | 1529 | var import_block_editor3 = __toESM(require_block_editor(), 1); |
| 797 | - var import_element6 = __toESM(require_element(), 1); | |
| 1530 | + var import_element8 = __toESM(require_element(), 1); | |
| 798 | 1531 | var import_components5 = __toESM(require_components(), 1); |
| 799 | - | |
| 800 | - // packages/icons/build-module/library/symbol.mjs | |
| 801 | - var import_primitives = __toESM(require_primitives(), 1); | |
| 802 | - var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); | |
| 803 | - var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives.Path, { d: "M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z" }) }); | |
| 804 | - | |
| 805 | - // packages/patterns/build-module/components/pattern-convert-button.mjs | |
| 806 | 1532 | var import_data8 = __toESM(require_data(), 1); |
| 807 | 1533 | var import_core_data6 = __toESM(require_core_data(), 1); |
| 808 | 1534 | var import_i18n6 = __toESM(require_i18n(), 1); |
| 809 | 1535 | var import_notices4 = __toESM(require_notices(), 1); |
| @@ -815,9 +1541,9 @@ | ||
| 815 | 1541 | }) { |
| 816 | 1542 | const { createSuccessNotice } = (0, import_data8.useDispatch)(import_notices4.store); |
| 817 | 1543 | const { replaceBlocks, updateBlockAttributes } = (0, import_data8.useDispatch)(import_block_editor3.store); |
| 818 | 1544 | const { setEditingPattern: setEditingPattern2 } = unlock((0, import_data8.useDispatch)(store)); |
| 819 | - const [isModalOpen, setIsModalOpen] = (0, import_element6.useState)(false); | |
| 1545 | + const [isModalOpen, setIsModalOpen] = (0, import_element8.useState)(false); | |
| 820 | 1546 | const { getBlockAttributes } = (0, import_data8.useSelect)(import_block_editor3.store); |
| 821 | 1547 | const canConvert = (0, import_data8.useSelect)( |
| 822 | 1548 | (select) => { |
| 823 | 1549 | const { canUser } = select(import_core_data6.store); |
| @@ -860,9 +1586,9 @@ | ||
| 860 | 1586 | }, |
| 861 | 1587 | [clientIds, rootClientId] |
| 862 | 1588 | ); |
| 863 | 1589 | const { getBlocksByClientId } = (0, import_data8.useSelect)(import_block_editor3.store); |
| 864 | - const getContent = (0, import_element6.useCallback)( | |
| 1590 | + const getContent = (0, import_element8.useCallback)( | |
| 865 | 1591 | () => (0, import_blocks2.serialize)(getBlocksByClientId(clientIds)), |
| 866 | 1592 | [getBlocksByClientId, clientIds] |
| 867 | 1593 | ); |
| 868 | 1594 | if (!canConvert) { |
| @@ -927,9 +1653,8 @@ | ||
| 927 | 1653 | setIsModalOpen(false); |
| 928 | 1654 | }, |
| 929 | 1655 | onClose: () => { |
| 930 | 1656 | setIsModalOpen(false); |
| 931 | - closeBlockSettingsMenu(); | |
| 932 | 1657 | } |
| 933 | 1658 | } |
| 934 | 1659 | ) |
| 935 | 1660 | ] }); |
| @@ -939,15 +1664,15 @@ | ||
| 939 | 1664 | var import_components6 = __toESM(require_components(), 1); |
| 940 | 1665 | var import_i18n7 = __toESM(require_i18n(), 1); |
| 941 | 1666 | var import_blocks3 = __toESM(require_blocks(), 1); |
| 942 | 1667 | var import_data9 = __toESM(require_data(), 1); |
| 943 | - var import_element7 = __toESM(require_element(), 1); | |
| 1668 | + var import_element9 = __toESM(require_element(), 1); | |
| 944 | 1669 | var import_block_editor4 = __toESM(require_block_editor(), 1); |
| 945 | 1670 | var import_url = __toESM(require_url(), 1); |
| 946 | 1671 | var import_core_data7 = __toESM(require_core_data(), 1); |
| 947 | 1672 | var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); |
| 948 | 1673 | function PatternsManageButton({ clientId, onClose }) { |
| 949 | - const [showConfirmDialog, setShowConfirmDialog] = (0, import_element7.useState)(false); | |
| 1674 | + const [showConfirmDialog, setShowConfirmDialog] = (0, import_element9.useState)(false); | |
| 950 | 1675 | const { |
| 951 | 1676 | attributes, |
| 952 | 1677 | canDetach, |
| 953 | 1678 | isVisible, |
| @@ -1012,9 +1737,9 @@ | ||
| 1012 | 1737 | setShowConfirmDialog(false); |
| 1013 | 1738 | }; |
| 1014 | 1739 | return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [ |
| 1015 | 1740 | canDetach && /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_jsx_runtime8.Fragment, { children: [ |
| 1016 | - /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components6.MenuItem, { onClick: () => setShowConfirmDialog(true), children: isSyncedPattern ? (0, import_i18n7.__)("Disconnect pattern") : (0, import_i18n7.__)("Detach pattern") }), | |
| 1741 | + /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_components6.MenuItem, { onClick: () => setShowConfirmDialog(true), children: (0, import_i18n7.__)("Detach") }), | |
| 1017 | 1742 | /* @__PURE__ */ (0, import_jsx_runtime8.jsx)( |
| 1018 | 1743 | import_components6.__experimentalConfirmDialog, |
| 1019 | 1744 | { |
| 1020 | 1745 | isOpen: showConfirmDialog, |
| @@ -1019,11 +1744,11 @@ | ||
| 1019 | 1744 | { |
| 1020 | 1745 | isOpen: showConfirmDialog, |
| 1021 | 1746 | onConfirm: handleDetach, |
| 1022 | 1747 | onCancel: () => setShowConfirmDialog(false), |
| 1023 | - confirmButtonText: isSyncedPattern ? (0, import_i18n7.__)("Disconnect") : (0, import_i18n7.__)("Detach"), | |
| 1748 | + confirmButtonText: (0, import_i18n7.__)("Detach"), | |
| 1024 | 1749 | size: "medium", |
| 1025 | - title: isSyncedPattern ? (0, import_i18n7.__)("Disconnect pattern?") : (0, import_i18n7.__)("Detach pattern?"), | |
| 1750 | + title: (0, import_i18n7.__)("Detach pattern?"), | |
| 1026 | 1751 | __experimentalHideHeader: false, |
| 1027 | 1752 | children: isSyncedPattern ? (0, import_i18n7.__)( |
| 1028 | 1753 | "The blocks will be separated from the original pattern and will be fully editable. Future changes to the pattern will not apply here." |
| 1029 | 1754 | ) : (0, import_i18n7.__)( |
| @@ -1062,9 +1787,9 @@ | ||
| 1062 | 1787 | // packages/patterns/build-module/components/rename-pattern-category-modal.mjs |
| 1063 | 1788 | var import_components7 = __toESM(require_components(), 1); |
| 1064 | 1789 | var import_core_data8 = __toESM(require_core_data(), 1); |
| 1065 | 1790 | var import_data10 = __toESM(require_data(), 1); |
| 1066 | - var import_element8 = __toESM(require_element(), 1); | |
| 1791 | + var import_element10 = __toESM(require_element(), 1); | |
| 1067 | 1792 | var import_html_entities3 = __toESM(require_html_entities(), 1); |
| 1068 | 1793 | var import_i18n8 = __toESM(require_i18n(), 1); |
| 1069 | 1794 | var import_notices5 = __toESM(require_notices(), 1); |
| 1070 | 1795 | var import_a11y = __toESM(require_a11y(), 1); |
| @@ -1076,13 +1801,13 @@ | ||
| 1076 | 1801 | onError, |
| 1077 | 1802 | onSuccess, |
| 1078 | 1803 | ...props |
| 1079 | 1804 | }) { |
| 1080 | - const id = (0, import_element8.useId)(); | |
| 1081 | - const textControlRef = (0, import_element8.useRef)(); | |
| 1082 | - const [name, setName] = (0, import_element8.useState)((0, import_html_entities3.decodeEntities)(category.name)); | |
| 1083 | - const [isSaving, setIsSaving] = (0, import_element8.useState)(false); | |
| 1084 | - const [validationMessage, setValidationMessage] = (0, import_element8.useState)(false); | |
| 1805 | + const id = (0, import_element10.useId)(); | |
| 1806 | + const textControlRef = (0, import_element10.useRef)(); | |
| 1807 | + const [name, setName] = (0, import_element10.useState)((0, import_html_entities3.decodeEntities)(category.name)); | |
| 1808 | + const [isSaving, setIsSaving] = (0, import_element10.useState)(false); | |
| 1809 | + const [validationMessage, setValidationMessage] = (0, import_element10.useState)(false); | |
| 1085 | 1810 | const validationMessageId = validationMessage ? `patterns-rename-pattern-category-modal__validation-message-${id}` : void 0; |
| 1086 | 1811 | const { saveEntityRecord, invalidateResolution } = (0, import_data10.useDispatch)(import_core_data8.store); |
| 1087 | 1812 | const { createErrorNotice, createSuccessNotice } = (0, import_data10.useDispatch)(import_notices5.store); |
| 1088 | 1813 | const onChange = (newName) => { |
| @@ -1152,15 +1877,14 @@ | ||
| 1152 | 1877 | { |
| 1153 | 1878 | title: (0, import_i18n8.__)("Rename"), |
| 1154 | 1879 | onRequestClose, |
| 1155 | 1880 | ...props, |
| 1156 | - children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("form", { onSubmit: onSave, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_components7.__experimentalVStack, { spacing: "5", children: [ | |
| 1157 | - /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_components7.__experimentalVStack, { spacing: "2", children: [ | |
| 1881 | + children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)("form", { onSubmit: onSave, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 1882 | + /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Stack, { direction: "column", gap: "sm", children: [ | |
| 1158 | 1883 | /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( |
| 1159 | 1884 | import_components7.TextControl, |
| 1160 | 1885 | { |
| 1161 | 1886 | ref: textControlRef, |
| 1162 | - __next40pxDefaultSize: true, | |
| 1163 | 1887 | label: (0, import_i18n8.__)("Name"), |
| 1164 | 1888 | value: name, |
| 1165 | 1889 | onChange, |
| 1166 | 1890 | "aria-describedby": validationMessageId, |
| @@ -1175,9 +1899,9 @@ | ||
| 1175 | 1899 | children: validationMessage |
| 1176 | 1900 | } |
| 1177 | 1901 | ) |
| 1178 | 1902 | ] }), |
| 1179 | - /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(import_components7.__experimentalHStack, { justify: "right", children: [ | |
| 1903 | + /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Stack, { gap: "sm", justify: "end", children: [ | |
| 1180 | 1904 | /* @__PURE__ */ (0, import_jsx_runtime10.jsx)( |
| 1181 | 1905 | import_components7.Button, |
| 1182 | 1906 | { |
| 1183 | 1907 | __next40pxDefaultSize: true, |
| @@ -1203,9 +1927,9 @@ | ||
| 1203 | 1927 | ); |
| 1204 | 1928 | } |
| 1205 | 1929 | |
| 1206 | 1930 | // packages/patterns/build-module/components/pattern-overrides-controls.mjs |
| 1207 | - var import_element10 = __toESM(require_element(), 1); | |
| 1931 | + var import_element12 = __toESM(require_element(), 1); | |
| 1208 | 1932 | var import_block_editor6 = __toESM(require_block_editor(), 1); |
| 1209 | 1933 | var import_components9 = __toESM(require_components(), 1); |
| 1210 | 1934 | var import_i18n10 = __toESM(require_i18n(), 1); |
| 1211 | 1935 | |
| @@ -1211,9 +1935,9 @@ | ||
| 1211 | 1935 | |
| 1212 | 1936 | // packages/patterns/build-module/components/allow-overrides-modal.mjs |
| 1213 | 1937 | var import_components8 = __toESM(require_components(), 1); |
| 1214 | 1938 | var import_i18n9 = __toESM(require_i18n(), 1); |
| 1215 | - var import_element9 = __toESM(require_element(), 1); | |
| 1939 | + var import_element11 = __toESM(require_element(), 1); | |
| 1216 | 1940 | var import_a11y2 = __toESM(require_a11y(), 1); |
| 1217 | 1941 | var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); |
| 1218 | 1942 | function AllowOverridesModal({ |
| 1219 | 1943 | placeholder, |
| @@ -1220,10 +1944,10 @@ | ||
| 1220 | 1944 | initialName = "", |
| 1221 | 1945 | onClose, |
| 1222 | 1946 | onSave |
| 1223 | 1947 | }) { |
| 1224 | - const [editedBlockName, setEditedBlockName] = (0, import_element9.useState)(initialName); | |
| 1225 | - const descriptionId = (0, import_element9.useId)(); | |
| 1948 | + const [editedBlockName, setEditedBlockName] = (0, import_element11.useState)(initialName); | |
| 1949 | + const descriptionId = (0, import_element11.useId)(); | |
| 1226 | 1950 | const isNameValid = !!editedBlockName.trim(); |
| 1227 | 1951 | const handleSubmit = () => { |
| 1228 | 1952 | if (editedBlockName !== initialName) { |
| 1229 | 1953 | const message = (0, import_i18n9.sprintf)( |
| @@ -1253,16 +1977,15 @@ | ||
| 1253 | 1977 | return; |
| 1254 | 1978 | } |
| 1255 | 1979 | handleSubmit(); |
| 1256 | 1980 | }, |
| 1257 | - children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_components8.__experimentalVStack, { spacing: "6", children: [ | |
| 1258 | - /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components8.__experimentalText, { id: descriptionId, children: (0, import_i18n9.__)( | |
| 1981 | + children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { direction: "column", gap: "xl", children: [ | |
| 1982 | + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { id: descriptionId, children: (0, import_i18n9.__)( | |
| 1259 | 1983 | "Overrides are changes you make to a block within a synced pattern instance. Use overrides to customize a synced pattern instance to suit its new context. Name this block to specify an override." |
| 1260 | 1984 | ) }), |
| 1261 | 1985 | /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( |
| 1262 | 1986 | import_components8.TextControl, |
| 1263 | 1987 | { |
| 1264 | - __next40pxDefaultSize: true, | |
| 1265 | 1988 | value: editedBlockName, |
| 1266 | 1989 | label: (0, import_i18n9.__)("Name"), |
| 1267 | 1990 | help: (0, import_i18n9.__)( |
| 1268 | 1991 | 'For example, if you are creating a recipe pattern, you use "Recipe Title", "Recipe Description", etc.' |
| @@ -1270,9 +1993,9 @@ | ||
| 1270 | 1993 | placeholder, |
| 1271 | 1994 | onChange: setEditedBlockName |
| 1272 | 1995 | } |
| 1273 | 1996 | ), |
| 1274 | - /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_components8.__experimentalHStack, { justify: "right", children: [ | |
| 1997 | + /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { gap: "sm", justify: "end", children: [ | |
| 1275 | 1998 | /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( |
| 1276 | 1999 | import_components8.Button, |
| 1277 | 2000 | { |
| 1278 | 2001 | __next40pxDefaultSize: true, |
| @@ -1298,9 +2021,9 @@ | ||
| 1298 | 2021 | } |
| 1299 | 2022 | ); |
| 1300 | 2023 | } |
| 1301 | 2024 | function DisallowOverridesModal({ onClose, onSave }) { |
| 1302 | - const descriptionId = (0, import_element9.useId)(); | |
| 2025 | + const descriptionId = (0, import_element11.useId)(); | |
| 1303 | 2026 | return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( |
| 1304 | 2027 | import_components8.Modal, |
| 1305 | 2028 | { |
| 1306 | 2029 | title: (0, import_i18n9.__)("Disable overrides"), |
| @@ -1314,13 +2037,13 @@ | ||
| 1314 | 2037 | event.preventDefault(); |
| 1315 | 2038 | onSave(); |
| 1316 | 2039 | onClose(); |
| 1317 | 2040 | }, |
| 1318 | - children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_components8.__experimentalVStack, { spacing: "6", children: [ | |
| 1319 | - /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_components8.__experimentalText, { id: descriptionId, children: (0, import_i18n9.__)( | |
| 2041 | + children: /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { direction: "column", gap: "xl", children: [ | |
| 2042 | + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(Text, { id: descriptionId, children: (0, import_i18n9.__)( | |
| 1320 | 2043 | "Are you sure you want to disable overrides? Disabling overrides will revert all applied overrides for this block throughout instances of this pattern." |
| 1321 | 2044 | ) }), |
| 1322 | - /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_components8.__experimentalHStack, { justify: "right", children: [ | |
| 2045 | + /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(Stack, { gap: "sm", justify: "end", children: [ | |
| 1323 | 2046 | /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( |
| 1324 | 2047 | import_components8.Button, |
| 1325 | 2048 | { |
| 1326 | 2049 | __next40pxDefaultSize: true, |
| @@ -1352,11 +2075,11 @@ | ||
| 1352 | 2075 | attributes, |
| 1353 | 2076 | setAttributes, |
| 1354 | 2077 | name: blockName |
| 1355 | 2078 | }) { |
| 1356 | - const controlId = (0, import_element10.useId)(); | |
| 1357 | - const [showAllowOverridesModal, setShowAllowOverridesModal] = (0, import_element10.useState)(false); | |
| 1358 | - const [showDisallowOverridesModal, setShowDisallowOverridesModal] = (0, import_element10.useState)(false); | |
| 2079 | + const controlId = (0, import_element12.useId)(); | |
| 2080 | + const [showAllowOverridesModal, setShowAllowOverridesModal] = (0, import_element12.useState)(false); | |
| 2081 | + const [showDisallowOverridesModal, setShowDisallowOverridesModal] = (0, import_element12.useState)(false); | |
| 1359 | 2082 | const hasName = !!attributes.metadata?.name; |
| 1360 | 2083 | const defaultBindings = attributes.metadata?.bindings?.__default; |
| 1361 | 2084 | const hasOverrides = hasName && defaultBindings?.source === PATTERN_OVERRIDES_BINDING_SOURCE; |
| 1362 | 2085 | const isConnectedToOtherSources = defaultBindings?.source && defaultBindings.source !== PATTERN_OVERRIDES_BINDING_SOURCE; |
| @@ -1513,6 +2236,8 @@ | ||
| 1513 | 2236 | EXCLUDED_PATTERN_SOURCES, |
| 1514 | 2237 | PATTERN_SYNC_TYPES |
| 1515 | 2238 | }); |
| 1516 | 2239 | return __toCommonJS(index_exports); |
| 2240 | +})(); | |
| 2241 | +(window.wp ||= {}).patterns = wp.patterns; | |
| 1517 | 2242 | })(); |
| 1518 | 2243 | //# sourceMappingURL=index.js.map |