| @@ -1,4 +1,5 @@ | ||
| 1 | +(function() { | |
| 1 | 2 | var wp; |
| 2 | 3 | (wp ||= {}).editPost = (() => { |
| 3 | 4 | var __create = Object.create; |
| 4 | 5 | var __defProp = Object.defineProperty; |
| @@ -137,9 +138,9 @@ | ||
| 137 | 138 | function is(x, y) { |
| 138 | 139 | return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; |
| 139 | 140 | } |
| 140 | 141 | function useSyncExternalStore$2(subscribe, getSnapshot) { |
| 141 | - didWarnOld18Alpha || void 0 === React47.startTransition || (didWarnOld18Alpha = true, console.error( | |
| 142 | + didWarnOld18Alpha || void 0 === React48.startTransition || (didWarnOld18Alpha = true, console.error( | |
| 142 | 143 | "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." |
| 143 | 144 | )); |
| 144 | 145 | var value = getSnapshot(); |
| 145 | 146 | if (!didWarnUncachedGetSnapshot) { |
| @@ -151,9 +152,9 @@ | ||
| 151 | 152 | cachedValue = useState16({ |
| 152 | 153 | inst: { value, getSnapshot } |
| 153 | 154 | }); |
| 154 | 155 | var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; |
| 155 | - useLayoutEffect3( | |
| 156 | + useLayoutEffect4( | |
| 156 | 157 | function() { |
| 157 | 158 | inst.value = value; |
| 158 | 159 | inst.getSnapshot = getSnapshot; |
| 159 | 160 | checkIfSnapshotChanged(inst) && forceUpdate({ inst }); |
| @@ -185,10 +186,10 @@ | ||
| 185 | 186 | function useSyncExternalStore$1(subscribe, getSnapshot) { |
| 186 | 187 | return getSnapshot(); |
| 187 | 188 | } |
| 188 | 189 | "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); |
| 189 | - var React47 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState16 = React47.useState, useEffect17 = React47.useEffect, useLayoutEffect3 = React47.useLayoutEffect, useDebugValue2 = React47.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; | |
| 190 | - exports.useSyncExternalStore = void 0 !== React47.useSyncExternalStore ? React47.useSyncExternalStore : shim; | |
| 190 | + var React48 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState16 = React48.useState, useEffect17 = React48.useEffect, useLayoutEffect4 = React48.useLayoutEffect, useDebugValue2 = React48.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; | |
| 191 | + exports.useSyncExternalStore = void 0 !== React48.useSyncExternalStore ? React48.useSyncExternalStore : shim; | |
| 191 | 192 | "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); |
| 192 | 193 | })(); |
| 193 | 194 | } |
| 194 | 195 | }); |
| @@ -213,9 +214,9 @@ | ||
| 213 | 214 | function is(x, y) { |
| 214 | 215 | return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; |
| 215 | 216 | } |
| 216 | 217 | "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); |
| 217 | - var React47 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore2 = shim.useSyncExternalStore, useRef22 = React47.useRef, useEffect17 = React47.useEffect, useMemo16 = React47.useMemo, useDebugValue2 = React47.useDebugValue; | |
| 218 | + var React48 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef22 = React48.useRef, useEffect17 = React48.useEffect, useMemo17 = React48.useMemo, useDebugValue2 = React48.useDebugValue; | |
| 218 | 219 | exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { |
| 219 | 220 | var instRef = useRef22(null); |
| 220 | 221 | if (null === instRef.current) { |
| 221 | 222 | var inst = { hasValue: false, value: null }; |
| @@ -220,9 +221,9 @@ | ||
| 220 | 221 | if (null === instRef.current) { |
| 221 | 222 | var inst = { hasValue: false, value: null }; |
| 222 | 223 | instRef.current = inst; |
| 223 | 224 | } else inst = instRef.current; |
| 224 | - instRef = useMemo16( | |
| 225 | + instRef = useMemo17( | |
| 225 | 226 | function() { |
| 226 | 227 | function memoizedSelector(nextSnapshot) { |
| 227 | 228 | if (!hasMemo) { |
| 228 | 229 | hasMemo = true; |
| @@ -255,9 +256,9 @@ | ||
| 255 | 256 | ]; |
| 256 | 257 | }, |
| 257 | 258 | [getSnapshot, getServerSnapshot, selector, isEqual] |
| 258 | 259 | ); |
| 259 | - var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); | |
| 260 | + var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]); | |
| 260 | 261 | useEffect17( |
| 261 | 262 | function() { |
| 262 | 263 | inst.hasValue = true; |
| 263 | 264 | inst.value = value; |
| @@ -283,15 +284,8 @@ | ||
| 283 | 284 | } |
| 284 | 285 | } |
| 285 | 286 | }); |
| 286 | 287 | |
| 287 | - // package-external:@wordpress/primitives | |
| 288 | - var require_primitives = __commonJS({ | |
| 289 | - "package-external:@wordpress/primitives"(exports, module) { | |
| 290 | - module.exports = window.wp.primitives; | |
| 291 | - } | |
| 292 | - }); | |
| 293 | - | |
| 294 | 288 | // package-external:@wordpress/compose |
| 295 | 289 | var require_compose = __commonJS({ |
| 296 | 290 | "package-external:@wordpress/compose"(exports, module) { |
| 297 | 291 | module.exports = window.wp.compose; |
| @@ -311,8 +305,15 @@ | ||
| 311 | 305 | module.exports = window.wp.privateApis; |
| 312 | 306 | } |
| 313 | 307 | }); |
| 314 | 308 | |
| 309 | + // package-external:@wordpress/primitives | |
| 310 | + var require_primitives = __commonJS({ | |
| 311 | + "package-external:@wordpress/primitives"(exports, module) { | |
| 312 | + module.exports = window.wp.primitives; | |
| 313 | + } | |
| 314 | + }); | |
| 315 | + | |
| 315 | 316 | // package-external:@wordpress/components |
| 316 | 317 | var require_components = __commonJS({ |
| 317 | 318 | "package-external:@wordpress/components"(exports, module) { |
| 318 | 319 | module.exports = window.wp.components; |
| @@ -407,16 +408,16 @@ | ||
| 407 | 408 | reinitializeEditor: () => reinitializeEditor, |
| 408 | 409 | store: () => store |
| 409 | 410 | }); |
| 410 | 411 | var import_blocks2 = __toESM(require_blocks(), 1); |
| 411 | - var import_block_library2 = __toESM(require_block_library(), 1); | |
| 412 | + var import_block_library = __toESM(require_block_library(), 1); | |
| 412 | 413 | var import_deprecated4 = __toESM(require_deprecated(), 1); |
| 413 | - var import_element29 = __toESM(require_element(), 1); | |
| 414 | - var import_data25 = __toESM(require_data(), 1); | |
| 414 | + var import_element30 = __toESM(require_element(), 1); | |
| 415 | + var import_data27 = __toESM(require_data(), 1); | |
| 415 | 416 | var import_preferences11 = __toESM(require_preferences(), 1); |
| 416 | 417 | var import_widgets = __toESM(require_widgets(), 1); |
| 417 | - var import_editor19 = __toESM(require_editor(), 1); | |
| 418 | - var import_core_data9 = __toESM(require_core_data(), 1); | |
| 418 | + var import_editor21 = __toESM(require_editor(), 1); | |
| 419 | + var import_core_data10 = __toESM(require_core_data(), 1); | |
| 419 | 420 | var import_api_fetch2 = __toESM(require_api_fetch(), 1); |
| 420 | 421 | |
| 421 | 422 | // node_modules/clsx/dist/clsx.mjs |
| 422 | 423 | function r(e) { |
| @@ -433,8 +434,31 @@ | ||
| 433 | 434 | return n; |
| 434 | 435 | } |
| 435 | 436 | var clsx_default = clsx; |
| 436 | 437 | |
| 438 | + // node_modules/@base-ui/utils/createLogOnce.mjs | |
| 439 | + var loggedMessages; | |
| 440 | + if (true) { | |
| 441 | + loggedMessages = /* @__PURE__ */ new Set(); | |
| 442 | + } | |
| 443 | + function createLogOnce(severity, prefix) { | |
| 444 | + return function logOnce(...messages) { | |
| 445 | + if (true) { | |
| 446 | + const message = messages.join(" "); | |
| 447 | + const output = prefix ? `${prefix}: ${message}` : message; | |
| 448 | + const key = `${severity}:${output}`; | |
| 449 | + if (!loggedMessages.has(key)) { | |
| 450 | + loggedMessages.add(key); | |
| 451 | + if (severity === "warn") { | |
| 452 | + console.warn(output); | |
| 453 | + } else { | |
| 454 | + console.error(output); | |
| 455 | + } | |
| 456 | + } | |
| 457 | + } | |
| 458 | + }; | |
| 459 | + } | |
| 460 | + | |
| 437 | 461 | // node_modules/@base-ui/utils/safeReact.mjs |
| 438 | 462 | var React = __toESM(require_react(), 1); |
| 439 | 463 | var SafeReact = { |
| 440 | 464 | ...React |
| @@ -483,8 +507,17 @@ | ||
| 483 | 507 | ); |
| 484 | 508 | } |
| 485 | 509 | } |
| 486 | 510 | |
| 511 | + // node_modules/@base-ui/utils/warn.mjs | |
| 512 | + var warn = createLogOnce("warn", "Base UI"); | |
| 513 | + | |
| 514 | + // node_modules/@base-ui/utils/empty.mjs | |
| 515 | + function NOOP() { | |
| 516 | + } | |
| 517 | + var EMPTY_ARRAY = Object.freeze([]); | |
| 518 | + var EMPTY_OBJECT = Object.freeze({}); | |
| 519 | + | |
| 487 | 520 | // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs |
| 488 | 521 | var React3 = __toESM(require_react(), 1); |
| 489 | 522 | var noop = () => { |
| 490 | 523 | }; |
| @@ -489,34 +522,10 @@ | ||
| 489 | 522 | var noop = () => { |
| 490 | 523 | }; |
| 491 | 524 | var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop; |
| 492 | 525 | |
| 493 | - // node_modules/@base-ui/utils/warn.mjs | |
| 494 | - var set; | |
| 495 | - if (true) { | |
| 496 | - set = /* @__PURE__ */ new Set(); | |
| 497 | - } | |
| 498 | - function warn(...messages) { | |
| 499 | - if (true) { | |
| 500 | - const messageKey = messages.join(" "); | |
| 501 | - if (!set.has(messageKey)) { | |
| 502 | - set.add(messageKey); | |
| 503 | - console.warn(`Base UI: ${messageKey}`); | |
| 504 | - } | |
| 505 | - } | |
| 506 | - } | |
| 507 | - | |
| 508 | - // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs | |
| 509 | - var React4 = __toESM(require_react(), 1); | |
| 510 | - var DirectionContext = /* @__PURE__ */ React4.createContext(void 0); | |
| 511 | - if (true) DirectionContext.displayName = "DirectionContext"; | |
| 512 | - function useDirection() { | |
| 513 | - const context = React4.useContext(DirectionContext); | |
| 514 | - return context?.direction ?? "ltr"; | |
| 515 | - } | |
| 516 | - | |
| 517 | 526 | // node_modules/@base-ui/react/internals/useRenderElement.mjs |
| 518 | - var React7 = __toESM(require_react(), 1); | |
| 527 | + var React6 = __toESM(require_react(), 1); | |
| 519 | 528 | |
| 520 | 529 | // node_modules/@base-ui/utils/useMergedRefs.mjs |
| 521 | 530 | function useMergedRefs(a, b, c, d) { |
| 522 | 531 | const forkRef = useRefWithInit(createForkRef).current; |
| @@ -589,9 +598,9 @@ | ||
| 589 | 598 | const cleanupCallback = cleanupCallbacks[i]; |
| 590 | 599 | if (typeof cleanupCallback === "function") { |
| 591 | 600 | cleanupCallback(); |
| 592 | 601 | } else { |
| 593 | - ref(null); | |
| 602 | + void ref(null); | |
| 594 | 603 | } |
| 595 | 604 | break; |
| 596 | 605 | } |
| 597 | 606 | case "object": { |
| @@ -606,13 +615,13 @@ | ||
| 606 | 615 | }; |
| 607 | 616 | } |
| 608 | 617 | |
| 609 | 618 | // node_modules/@base-ui/utils/getReactElementRef.mjs |
| 610 | - var React6 = __toESM(require_react(), 1); | |
| 619 | + var React5 = __toESM(require_react(), 1); | |
| 611 | 620 | |
| 612 | 621 | // node_modules/@base-ui/utils/reactVersion.mjs |
| 613 | - var React5 = __toESM(require_react(), 1); | |
| 614 | - var majorVersion = parseInt(React5.version, 10); | |
| 622 | + var React4 = __toESM(require_react(), 1); | |
| 623 | + var majorVersion = parseInt(React4.version, 10); | |
| 615 | 624 | function isReactVersionAtLeast(reactVersionToCheck) { |
| 616 | 625 | return majorVersion >= reactVersionToCheck; |
| 617 | 626 | } |
| 618 | 627 | |
| @@ -617,9 +626,9 @@ | ||
| 617 | 626 | } |
| 618 | 627 | |
| 619 | 628 | // node_modules/@base-ui/utils/getReactElementRef.mjs |
| 620 | 629 | function getReactElementRef(element) { |
| 621 | - if (!/* @__PURE__ */ React6.isValidElement(element)) { | |
| 630 | + if (!/* @__PURE__ */ React5.isValidElement(element)) { | |
| 622 | 631 | return null; |
| 623 | 632 | } |
| 624 | 633 | const reactElement = element; |
| 625 | 634 | const propsWithRef = reactElement.props; |
| @@ -642,14 +651,8 @@ | ||
| 642 | 651 | } |
| 643 | 652 | return void 0; |
| 644 | 653 | } |
| 645 | 654 | |
| 646 | - // node_modules/@base-ui/utils/empty.mjs | |
| 647 | - function NOOP() { | |
| 648 | - } | |
| 649 | - var EMPTY_ARRAY = Object.freeze([]); | |
| 650 | - var EMPTY_OBJECT = Object.freeze({}); | |
| 651 | - | |
| 652 | 655 | // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs |
| 653 | 656 | function getStateAttributesProps(state, customMapping) { |
| 654 | 657 | const props = {}; |
| 655 | 658 | for (const key in state) { |
| @@ -837,10 +840,13 @@ | ||
| 837 | 840 | |
| 838 | 841 | // node_modules/@base-ui/react/internals/useRenderElement.mjs |
| 839 | 842 | var import_react = __toESM(require_react(), 1); |
| 840 | 843 | function useRenderElement(element, componentProps, params = {}) { |
| 841 | - const renderProp = componentProps.render; | |
| 842 | - const outProps = useRenderElementProps(componentProps, params); | |
| 844 | + let renderProp = componentProps.render; | |
| 845 | + if (params.enabled !== false) { | |
| 846 | + renderProp = unwrapLazyRenderProp(renderProp); | |
| 847 | + } | |
| 848 | + const outProps = useRenderElementProps(componentProps, params, renderProp); | |
| 843 | 849 | if (params.enabled === false) { |
| 844 | 850 | return null; |
| 845 | 851 | } |
| 846 | 852 | const state = params.state ?? EMPTY_OBJECT; |
| @@ -845,29 +851,28 @@ | ||
| 845 | 851 | } |
| 846 | 852 | const state = params.state ?? EMPTY_OBJECT; |
| 847 | 853 | return evaluateRenderProp(element, renderProp, outProps, state); |
| 848 | 854 | } |
| 849 | - function useRenderElementProps(componentProps, params = {}) { | |
| 855 | + function useRenderElementProps(componentProps, params, renderProp) { | |
| 850 | 856 | const { |
| 851 | 857 | className: classNameProp, |
| 852 | - style: styleProp, | |
| 853 | - render: renderProp | |
| 858 | + style: styleProp | |
| 854 | 859 | } = componentProps; |
| 855 | 860 | const { |
| 856 | 861 | state = EMPTY_OBJECT, |
| 857 | 862 | ref, |
| 858 | 863 | props, |
| 859 | - stateAttributesMapping: stateAttributesMapping3, | |
| 864 | + stateAttributesMapping, | |
| 860 | 865 | enabled = true |
| 861 | 866 | } = params; |
| 862 | 867 | const className = enabled ? resolveClassName(classNameProp, state) : void 0; |
| 863 | 868 | const style = enabled ? resolveStyle(styleProp, state) : void 0; |
| 864 | - const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT; | |
| 869 | + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; | |
| 865 | 870 | const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; |
| 866 | 871 | const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; |
| 867 | 872 | if (typeof document !== "undefined") { |
| 868 | 873 | if (!enabled) { |
| 869 | - useMergedRefs(null, null); | |
| 874 | + void useMergedRefs(null, null); | |
| 870 | 875 | } else if (Array.isArray(ref)) { |
| 871 | 876 | outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); |
| 872 | 877 | } else { |
| 873 | 878 | outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); |
| @@ -892,8 +897,15 @@ | ||
| 892 | 897 | } |
| 893 | 898 | var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); |
| 894 | 899 | var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; |
| 895 | 900 | var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; |
| 901 | + function unwrapLazyRenderProp(render) { | |
| 902 | + if (render?.$$typeof !== REACT_LAZY_TYPE) { | |
| 903 | + return render; | |
| 904 | + } | |
| 905 | + const unwrapped = React6.Children.toArray(render)[0]; | |
| 906 | + return /* @__PURE__ */ React6.isValidElement(unwrapped) ? unwrapped : render; | |
| 907 | + } | |
| 896 | 908 | function evaluateRenderProp(element, render, props, state) { |
| 897 | 909 | if (render) { |
| 898 | 910 | if (typeof render === "function") { |
| 899 | 911 | if (true) { |
| @@ -902,19 +914,14 @@ | ||
| 902 | 914 | return render(props, state); |
| 903 | 915 | } |
| 904 | 916 | const mergedProps = mergeProps(props, render.props); |
| 905 | 917 | mergedProps.ref = props.ref; |
| 906 | - let newElement = render; | |
| 907 | - if (newElement?.$$typeof === REACT_LAZY_TYPE) { | |
| 908 | - const children = React7.Children.toArray(render); | |
| 909 | - newElement = children[0]; | |
| 910 | - } | |
| 911 | 918 | if (true) { |
| 912 | - if (!/* @__PURE__ */ React7.isValidElement(newElement)) { | |
| 919 | + if (!/* @__PURE__ */ React6.isValidElement(render)) { | |
| 913 | 920 | 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")); |
| 914 | 921 | } |
| 915 | 922 | } |
| 916 | - return /* @__PURE__ */ React7.cloneElement(newElement, mergedProps); | |
| 923 | + return /* @__PURE__ */ React6.cloneElement(render, mergedProps); | |
| 917 | 924 | } |
| 918 | 925 | if (element) { |
| 919 | 926 | if (typeof element === "string") { |
| 920 | 927 | return renderTag(element, props); |
| @@ -949,18 +956,18 @@ | ||
| 949 | 956 | ...props, |
| 950 | 957 | key: props.key |
| 951 | 958 | }); |
| 952 | 959 | } |
| 953 | - return /* @__PURE__ */ React7.createElement(Tag, props); | |
| 960 | + return /* @__PURE__ */ React6.createElement(Tag, props); | |
| 954 | 961 | } |
| 955 | 962 | |
| 956 | 963 | // node_modules/@base-ui/utils/useId.mjs |
| 957 | - var React8 = __toESM(require_react(), 1); | |
| 964 | + var React7 = __toESM(require_react(), 1); | |
| 958 | 965 | var globalId = 0; |
| 959 | 966 | function useGlobalId(idOverride, prefix = "mui") { |
| 960 | - const [defaultId, setDefaultId] = React8.useState(idOverride); | |
| 967 | + const [defaultId, setDefaultId] = React7.useState(idOverride); | |
| 961 | 968 | const id = idOverride || defaultId; |
| 962 | - React8.useEffect(() => { | |
| 969 | + React7.useEffect(() => { | |
| 963 | 970 | if (defaultId == null) { |
| 964 | 971 | globalId += 1; |
| 965 | 972 | setDefaultId(`${prefix}-${globalId}`); |
| 966 | 973 | } |
| @@ -1082,19 +1089,18 @@ | ||
| 1082 | 1089 | return details; |
| 1083 | 1090 | } |
| 1084 | 1091 | |
| 1085 | 1092 | // node_modules/@base-ui/react/internals/useTransitionStatus.mjs |
| 1086 | - var React10 = __toESM(require_react(), 1); | |
| 1093 | + var React9 = __toESM(require_react(), 1); | |
| 1087 | 1094 | |
| 1088 | 1095 | // node_modules/@base-ui/utils/useOnMount.mjs |
| 1089 | - var React9 = __toESM(require_react(), 1); | |
| 1090 | - var EMPTY = []; | |
| 1096 | + var React8 = __toESM(require_react(), 1); | |
| 1091 | 1097 | function useOnMount(fn) { |
| 1092 | - React9.useEffect(fn, EMPTY); | |
| 1098 | + React8.useEffect(fn, EMPTY_ARRAY); | |
| 1093 | 1099 | } |
| 1094 | 1100 | |
| 1095 | 1101 | // node_modules/@base-ui/utils/useAnimationFrame.mjs |
| 1096 | - var EMPTY2 = null; | |
| 1102 | + var EMPTY = null; | |
| 1097 | 1103 | var LAST_RAF = globalThis.requestAnimationFrame; |
| 1098 | 1104 | var Scheduler = class { |
| 1099 | 1105 | /* This implementation uses an array as a backing data-structure for frame callbacks. |
| 1100 | 1106 | * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it |
| @@ -1137,8 +1143,11 @@ | ||
| 1137 | 1143 | const index2 = id - this.startId; |
| 1138 | 1144 | if (index2 < 0 || index2 >= this.callbacks.length) { |
| 1139 | 1145 | return; |
| 1140 | 1146 | } |
| 1147 | + if (this.callbacks[index2] === null) { | |
| 1148 | + return; | |
| 1149 | + } | |
| 1141 | 1150 | this.callbacks[index2] = null; |
| 1142 | 1151 | this.callbacksCount -= 1; |
| 1143 | 1152 | } |
| 1144 | 1153 | }; |
| @@ -1152,9 +1161,9 @@ | ||
| 1152 | 1161 | } |
| 1153 | 1162 | static cancel(id) { |
| 1154 | 1163 | return scheduler.cancel(id); |
| 1155 | 1164 | } |
| 1156 | - currentId = EMPTY2; | |
| 1165 | + currentId = EMPTY; | |
| 1157 | 1166 | /** |
| 1158 | 1167 | * Executes `fn` after `delay`, clearing any previously scheduled call. |
| 1159 | 1168 | */ |
| 1160 | 1169 | request(fn) { |
| @@ -1159,16 +1168,16 @@ | ||
| 1159 | 1168 | */ |
| 1160 | 1169 | request(fn) { |
| 1161 | 1170 | this.cancel(); |
| 1162 | 1171 | this.currentId = scheduler.request(() => { |
| 1163 | - this.currentId = EMPTY2; | |
| 1172 | + this.currentId = EMPTY; | |
| 1164 | 1173 | fn(); |
| 1165 | 1174 | }); |
| 1166 | 1175 | } |
| 1167 | 1176 | cancel = () => { |
| 1168 | - if (this.currentId !== EMPTY2) { | |
| 1177 | + if (this.currentId !== EMPTY) { | |
| 1169 | 1178 | scheduler.cancel(this.currentId); |
| 1170 | - this.currentId = EMPTY2; | |
| 1179 | + this.currentId = EMPTY; | |
| 1171 | 1180 | } |
| 1172 | 1181 | }; |
| 1173 | 1182 | disposeEffect = () => { |
| 1174 | 1183 | return this.cancel; |
| @@ -1180,23 +1189,23 @@ | ||
| 1180 | 1189 | return timeout; |
| 1181 | 1190 | } |
| 1182 | 1191 | |
| 1183 | 1192 | // node_modules/@base-ui/react/internals/useTransitionStatus.mjs |
| 1184 | - function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { | |
| 1185 | - const [transitionStatus, setTransitionStatus] = React10.useState(open && enableIdleState ? "idle" : void 0); | |
| 1186 | - const [mounted, setMounted] = React10.useState(open); | |
| 1187 | - if (open && !mounted) { | |
| 1193 | + function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { | |
| 1194 | + const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0); | |
| 1195 | + const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen); | |
| 1196 | + if (open2 && !mounted) { | |
| 1188 | 1197 | setMounted(true); |
| 1189 | 1198 | setTransitionStatus("starting"); |
| 1190 | 1199 | } |
| 1191 | - if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { | |
| 1200 | + if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) { | |
| 1192 | 1201 | setTransitionStatus("ending"); |
| 1193 | 1202 | } |
| 1194 | - if (!open && !mounted && transitionStatus === "ending") { | |
| 1203 | + if (!open2 && !mounted && transitionStatus === "ending") { | |
| 1195 | 1204 | setTransitionStatus(void 0); |
| 1196 | 1205 | } |
| 1197 | 1206 | useIsoLayoutEffect(() => { |
| 1198 | - if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { | |
| 1207 | + if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) { | |
| 1199 | 1208 | const frame = AnimationFrame.request(() => { |
| 1200 | 1209 | setTransitionStatus("ending"); |
| 1201 | 1210 | }); |
| 1202 | 1211 | return () => { |
| @@ -1203,11 +1212,11 @@ | ||
| 1203 | 1212 | AnimationFrame.cancel(frame); |
| 1204 | 1213 | }; |
| 1205 | 1214 | } |
| 1206 | 1215 | return void 0; |
| 1207 | - }, [open, mounted, transitionStatus, deferEndingState]); | |
| 1216 | + }, [open2, mounted, transitionStatus, deferEndingState]); | |
| 1208 | 1217 | useIsoLayoutEffect(() => { |
| 1209 | - if (!open || enableIdleState) { | |
| 1218 | + if (!open2 || enableIdleState) { | |
| 1210 | 1219 | return void 0; |
| 1211 | 1220 | } |
| 1212 | 1221 | const frame = AnimationFrame.request(() => { |
| 1213 | 1222 | setTransitionStatus(void 0); |
| @@ -1214,14 +1223,14 @@ | ||
| 1214 | 1223 | }); |
| 1215 | 1224 | return () => { |
| 1216 | 1225 | AnimationFrame.cancel(frame); |
| 1217 | 1226 | }; |
| 1218 | - }, [enableIdleState, open]); | |
| 1227 | + }, [enableIdleState, open2]); | |
| 1219 | 1228 | useIsoLayoutEffect(() => { |
| 1220 | - if (!open || !enableIdleState) { | |
| 1229 | + if (!open2 || !enableIdleState) { | |
| 1221 | 1230 | return void 0; |
| 1222 | 1231 | } |
| 1223 | - if (open && mounted && transitionStatus !== "idle") { | |
| 1232 | + if (open2 && mounted && transitionStatus !== "idle") { | |
| 1224 | 1233 | setTransitionStatus("starting"); |
| 1225 | 1234 | } |
| 1226 | 1235 | const frame = AnimationFrame.request(() => { |
| 1227 | 1236 | setTransitionStatus("idle"); |
| @@ -1228,9 +1237,9 @@ | ||
| 1228 | 1237 | }); |
| 1229 | 1238 | return () => { |
| 1230 | 1239 | AnimationFrame.cancel(frame); |
| 1231 | 1240 | }; |
| 1232 | - }, [enableIdleState, open, mounted, transitionStatus]); | |
| 1241 | + }, [enableIdleState, open2, mounted, transitionStatus]); | |
| 1233 | 1242 | return { |
| 1234 | 1243 | mounted, |
| 1235 | 1244 | setMounted, |
| 1236 | 1245 | transitionStatus |
| @@ -1236,19 +1245,18 @@ | ||
| 1236 | 1245 | transitionStatus |
| 1237 | 1246 | }; |
| 1238 | 1247 | } |
| 1239 | 1248 | |
| 1249 | + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs | |
| 1250 | + var startingStyle = "data-starting-style"; | |
| 1251 | + var endingStyle = "data-ending-style"; | |
| 1252 | + | |
| 1240 | 1253 | // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs |
| 1241 | - var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { | |
| 1242 | - TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; | |
| 1243 | - TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; | |
| 1244 | - return TransitionStatusDataAttributes2; | |
| 1245 | - })({}); | |
| 1246 | 1254 | var STARTING_HOOK = { |
| 1247 | - [TransitionStatusDataAttributes.startingStyle]: "" | |
| 1255 | + [startingStyle]: "" | |
| 1248 | 1256 | }; |
| 1249 | 1257 | var ENDING_HOOK = { |
| 1250 | - [TransitionStatusDataAttributes.endingStyle]: "" | |
| 1258 | + [endingStyle]: "" | |
| 1251 | 1259 | }; |
| 1252 | 1260 | var transitionStatusMapping = { |
| 1253 | 1261 | transitionStatus(value) { |
| 1254 | 1262 | if (value === "starting") { |
| @@ -1387,9 +1395,9 @@ | ||
| 1387 | 1395 | } |
| 1388 | 1396 | function getNearestOverflowAncestor(node) { |
| 1389 | 1397 | const parentNode = getParentNode(node); |
| 1390 | 1398 | if (isLastTraversableNode(parentNode)) { |
| 1391 | - return node.ownerDocument ? node.ownerDocument.body : node.body; | |
| 1399 | + return (node.ownerDocument || node).body; | |
| 1392 | 1400 | } |
| 1393 | 1401 | if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { |
| 1394 | 1402 | return parentNode; |
| 1395 | 1403 | } |
| @@ -1416,8 +1424,13 @@ | ||
| 1416 | 1424 | function getFrameElement(win) { |
| 1417 | 1425 | return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; |
| 1418 | 1426 | } |
| 1419 | 1427 | |
| 1428 | + // node_modules/@base-ui/utils/owner.mjs | |
| 1429 | + function ownerDocument(node) { | |
| 1430 | + return node?.ownerDocument || document; | |
| 1431 | + } | |
| 1432 | + | |
| 1420 | 1433 | // node_modules/@base-ui/utils/addEventListener.mjs |
| 1421 | 1434 | function addEventListener(target, type, listener, options) { |
| 1422 | 1435 | target.addEventListener(type, listener, options); |
| 1423 | 1436 | return () => { |
| @@ -1442,15 +1455,10 @@ | ||
| 1442 | 1455 | }; |
| 1443 | 1456 | return latest; |
| 1444 | 1457 | } |
| 1445 | 1458 | |
| 1446 | - // node_modules/@base-ui/utils/owner.mjs | |
| 1447 | - function ownerDocument(node) { | |
| 1448 | - return node?.ownerDocument || document; | |
| 1449 | - } | |
| 1450 | - | |
| 1451 | 1459 | // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs |
| 1452 | - var React11 = __toESM(require_react(), 1); | |
| 1460 | + var React10 = __toESM(require_react(), 1); | |
| 1453 | 1461 | |
| 1454 | 1462 | // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs |
| 1455 | 1463 | var ReactDOM = __toESM(require_react_dom(), 1); |
| 1456 | 1464 | |
| @@ -1462,9 +1470,25 @@ | ||
| 1462 | 1470 | return "current" in maybeRef ? maybeRef.current : maybeRef; |
| 1463 | 1471 | } |
| 1464 | 1472 | |
| 1465 | 1473 | // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs |
| 1466 | - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { | |
| 1474 | + var pendingCallbacks = null; | |
| 1475 | + function flushBeforePaint(fn) { | |
| 1476 | + if (!pendingCallbacks) { | |
| 1477 | + const callbacks = []; | |
| 1478 | + pendingCallbacks = callbacks; | |
| 1479 | + queueMicrotask(() => { | |
| 1480 | + pendingCallbacks = null; | |
| 1481 | + ReactDOM.flushSync(() => { | |
| 1482 | + for (const callback of callbacks) { | |
| 1483 | + callback(); | |
| 1484 | + } | |
| 1485 | + }); | |
| 1486 | + }); | |
| 1487 | + } | |
| 1488 | + pendingCallbacks.push(fn); | |
| 1489 | + } | |
| 1490 | + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { | |
| 1467 | 1491 | const frame = useAnimationFrame(); |
| 1468 | 1492 | return useStableCallback((fnToExecute, signal = null) => { |
| 1469 | 1493 | frame.cancel(); |
| 1470 | 1494 | const element = resolveRef(elementOrRef); |
| @@ -1472,9 +1496,17 @@ | ||
| 1472 | 1496 | return; |
| 1473 | 1497 | } |
| 1474 | 1498 | const resolvedElement = element; |
| 1475 | 1499 | const done = () => { |
| 1476 | - ReactDOM.flushSync(fnToExecute); | |
| 1500 | + if (!batch) { | |
| 1501 | + ReactDOM.flushSync(fnToExecute); | |
| 1502 | + return; | |
| 1503 | + } | |
| 1504 | + flushBeforePaint(() => { | |
| 1505 | + if (!signal?.aborted) { | |
| 1506 | + fnToExecute(); | |
| 1507 | + } | |
| 1508 | + }); | |
| 1477 | 1509 | }; |
| 1478 | 1510 | if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { |
| 1479 | 1511 | fnToExecute(); |
| 1480 | 1512 | return; |
| @@ -1483,23 +1515,22 @@ | ||
| 1483 | 1515 | Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { |
| 1484 | 1516 | if (!signal?.aborted) { |
| 1485 | 1517 | done(); |
| 1486 | 1518 | } |
| 1487 | - }).catch(() => { | |
| 1488 | - if (treatAbortedAsFinished) { | |
| 1489 | - if (!signal?.aborted) { | |
| 1490 | - done(); | |
| 1491 | - } | |
| 1519 | + }, () => { | |
| 1520 | + if (signal?.aborted) { | |
| 1492 | 1521 | return; |
| 1493 | 1522 | } |
| 1494 | 1523 | const currentAnimations = resolvedElement.getAnimations(); |
| 1495 | - if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { | |
| 1524 | + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { | |
| 1496 | 1525 | exec(); |
| 1526 | + return; | |
| 1497 | 1527 | } |
| 1528 | + done(); | |
| 1498 | 1529 | }); |
| 1499 | 1530 | } |
| 1500 | 1531 | if (waitForStartingStyleRemoved) { |
| 1501 | - const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; | |
| 1532 | + const startingStyleAttribute = startingStyle; | |
| 1502 | 1533 | if (!resolvedElement.hasAttribute(startingStyleAttribute)) { |
| 1503 | 1534 | frame.request(exec); |
| 1504 | 1535 | return; |
| 1505 | 1536 | } |
| @@ -1525,15 +1556,16 @@ | ||
| 1525 | 1556 | // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs |
| 1526 | 1557 | function useOpenChangeComplete(parameters) { |
| 1527 | 1558 | const { |
| 1528 | 1559 | enabled = true, |
| 1529 | - open, | |
| 1560 | + open: open2, | |
| 1530 | 1561 | ref, |
| 1562 | + batch = false, | |
| 1531 | 1563 | onComplete: onCompleteParam |
| 1532 | 1564 | } = parameters; |
| 1533 | 1565 | const onComplete = useStableCallback(onCompleteParam); |
| 1534 | - const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); | |
| 1535 | - React11.useEffect(() => { | |
| 1566 | + const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); | |
| 1567 | + React10.useEffect(() => { | |
| 1536 | 1568 | if (!enabled) { |
| 1537 | 1569 | return void 0; |
| 1538 | 1570 | } |
| 1539 | 1571 | const abortController = new AbortController(); |
| @@ -1540,26 +1572,17 @@ | ||
| 1540 | 1572 | runOnceAnimationsFinish(onComplete, abortController.signal); |
| 1541 | 1573 | return () => { |
| 1542 | 1574 | abortController.abort(); |
| 1543 | 1575 | }; |
| 1544 | - }, [enabled, open, onComplete, runOnceAnimationsFinish]); | |
| 1576 | + }, [enabled, open2, onComplete, runOnceAnimationsFinish]); | |
| 1545 | 1577 | } |
| 1546 | 1578 | |
| 1547 | - // node_modules/@base-ui/utils/useOnFirstRender.mjs | |
| 1548 | - var React12 = __toESM(require_react(), 1); | |
| 1549 | - function useOnFirstRender(fn) { | |
| 1550 | - const ref = React12.useRef(true); | |
| 1551 | - if (ref.current) { | |
| 1552 | - ref.current = false; | |
| 1553 | - fn(); | |
| 1554 | - } | |
| 1555 | - } | |
| 1556 | - | |
| 1557 | 1579 | // node_modules/@base-ui/utils/platform/parts.mjs |
| 1558 | 1580 | var parts_exports = {}; |
| 1559 | 1581 | __export(parts_exports, { |
| 1560 | 1582 | engine: () => engine_exports, |
| 1561 | 1583 | env: () => env_exports, |
| 1584 | + mediaQuery: () => media_query_exports, | |
| 1562 | 1585 | os: () => os_exports, |
| 1563 | 1586 | screenReader: () => screen_reader_exports |
| 1564 | 1587 | }); |
| 1565 | 1588 | |
| @@ -1643,15 +1666,22 @@ | ||
| 1643 | 1666 | jsdom: () => jsdom |
| 1644 | 1667 | }); |
| 1645 | 1668 | var jsdom = /jsdom|happydom/.test(lowerUserAgent); |
| 1646 | 1669 | |
| 1670 | + // node_modules/@base-ui/utils/platform/media-query.mjs | |
| 1671 | + var media_query_exports = {}; | |
| 1672 | + __export(media_query_exports, { | |
| 1673 | + iOS: () => iOS | |
| 1674 | + }); | |
| 1675 | + var iOS = "@supports (-webkit-touch-callout: none)"; | |
| 1676 | + | |
| 1647 | 1677 | // node_modules/@base-ui/utils/useTimeout.mjs |
| 1648 | - var EMPTY3 = 0; | |
| 1678 | + var EMPTY2 = 0; | |
| 1649 | 1679 | var Timeout = class _Timeout { |
| 1650 | 1680 | static create() { |
| 1651 | 1681 | return new _Timeout(); |
| 1652 | 1682 | } |
| 1653 | - currentId = EMPTY3; | |
| 1683 | + currentId = EMPTY2; | |
| 1654 | 1684 | /** |
| 1655 | 1685 | * Executes `fn` after `delay`, clearing any previously scheduled call. |
| 1656 | 1686 | */ |
| 1657 | 1687 | start(delay, fn) { |
| @@ -1656,19 +1686,19 @@ | ||
| 1656 | 1686 | */ |
| 1657 | 1687 | start(delay, fn) { |
| 1658 | 1688 | this.clear(); |
| 1659 | 1689 | this.currentId = setTimeout(() => { |
| 1660 | - this.currentId = EMPTY3; | |
| 1690 | + this.currentId = EMPTY2; | |
| 1661 | 1691 | fn(); |
| 1662 | 1692 | }, delay); |
| 1663 | 1693 | } |
| 1664 | 1694 | isStarted() { |
| 1665 | - return this.currentId !== EMPTY3; | |
| 1695 | + return this.currentId !== EMPTY2; | |
| 1666 | 1696 | } |
| 1667 | 1697 | clear = () => { |
| 1668 | - if (this.currentId !== EMPTY3) { | |
| 1698 | + if (this.currentId !== EMPTY2) { | |
| 1669 | 1699 | clearTimeout(this.currentId); |
| 1670 | - this.currentId = EMPTY3; | |
| 1700 | + this.currentId = EMPTY2; | |
| 1671 | 1701 | } |
| 1672 | 1702 | }; |
| 1673 | 1703 | disposeEffect = () => { |
| 1674 | 1704 | return this.clear; |
| @@ -1680,14 +1710,23 @@ | ||
| 1680 | 1710 | return timeout; |
| 1681 | 1711 | } |
| 1682 | 1712 | |
| 1683 | 1713 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs |
| 1684 | - var React13 = __toESM(require_react(), 1); | |
| 1714 | + var React11 = __toESM(require_react(), 1); | |
| 1685 | 1715 | |
| 1686 | 1716 | // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs |
| 1687 | 1717 | function isReactEvent(event) { |
| 1688 | 1718 | return "nativeEvent" in event; |
| 1689 | 1719 | } |
| 1720 | + function isVirtualClick(event) { | |
| 1721 | + if (event.pointerType === "" && event.isTrusted) { | |
| 1722 | + return true; | |
| 1723 | + } | |
| 1724 | + if (parts_exports.os.android && event.pointerType) { | |
| 1725 | + return event.type === "click" && event.buttons === 1; | |
| 1726 | + } | |
| 1727 | + return event.detail === 0 && !event.pointerType; | |
| 1728 | + } | |
| 1690 | 1729 | function isMouseLikePointerType(pointerType, strict) { |
| 1691 | 1730 | const values = ["mouse", "pen"]; |
| 1692 | 1731 | if (!strict) { |
| 1693 | 1732 | values.push("", void 0); |
| @@ -1698,13 +1737,9 @@ | ||
| 1698 | 1737 | const type = event.type; |
| 1699 | 1738 | return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; |
| 1700 | 1739 | } |
| 1701 | 1740 | |
| 1702 | - // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs | |
| 1703 | - var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; | |
| 1704 | - var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; | |
| 1705 | - | |
| 1706 | - // node_modules/@base-ui/react/internals/shadowDom.mjs | |
| 1741 | + // node_modules/@base-ui/utils/shadowDom.mjs | |
| 1707 | 1742 | function activeElement(doc) { |
| 1708 | 1743 | let element = doc.activeElement; |
| 1709 | 1744 | while (element?.shadowRoot?.activeElement != null) { |
| 1710 | 1745 | element = element.shadowRoot.activeElement; |
| @@ -1731,13 +1766,79 @@ | ||
| 1731 | 1766 | return false; |
| 1732 | 1767 | } |
| 1733 | 1768 | function getTarget(event) { |
| 1734 | 1769 | if ("composedPath" in event) { |
| 1735 | - return event.composedPath()[0]; | |
| 1770 | + return event.composedPath()[0] ?? event.target; | |
| 1736 | 1771 | } |
| 1737 | 1772 | return event.target; |
| 1738 | 1773 | } |
| 1739 | 1774 | |
| 1775 | + // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs | |
| 1776 | + var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; | |
| 1777 | + var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; | |
| 1778 | + | |
| 1779 | + // node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs | |
| 1780 | + var open = "data-open"; | |
| 1781 | + var closed = "data-closed"; | |
| 1782 | + var anchorHidden = "data-anchor-hidden"; | |
| 1783 | + | |
| 1784 | + // node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs | |
| 1785 | + var CommonTriggerDataAttributes_exports = {}; | |
| 1786 | + __export(CommonTriggerDataAttributes_exports, { | |
| 1787 | + popupOpen: () => popupOpen, | |
| 1788 | + pressed: () => pressed | |
| 1789 | + }); | |
| 1790 | + var popupOpen = "data-popup-open"; | |
| 1791 | + var pressed = "data-pressed"; | |
| 1792 | + | |
| 1793 | + // node_modules/@base-ui/react/utils/popupStateMapping.mjs | |
| 1794 | + var TRIGGER_HOOK = { | |
| 1795 | + [popupOpen]: "" | |
| 1796 | + }; | |
| 1797 | + var PRESSABLE_TRIGGER_HOOK = { | |
| 1798 | + [popupOpen]: "", | |
| 1799 | + [pressed]: "" | |
| 1800 | + }; | |
| 1801 | + var POPUP_OPEN_HOOK = { | |
| 1802 | + [open]: "" | |
| 1803 | + }; | |
| 1804 | + var POPUP_CLOSED_HOOK = { | |
| 1805 | + [closed]: "" | |
| 1806 | + }; | |
| 1807 | + var ANCHOR_HIDDEN_HOOK = { | |
| 1808 | + [anchorHidden]: "" | |
| 1809 | + }; | |
| 1810 | + var triggerOpenStateMapping = { | |
| 1811 | + open(value) { | |
| 1812 | + if (value) { | |
| 1813 | + return TRIGGER_HOOK; | |
| 1814 | + } | |
| 1815 | + return null; | |
| 1816 | + } | |
| 1817 | + }; | |
| 1818 | + var popupStateMapping = { | |
| 1819 | + open(value) { | |
| 1820 | + if (value) { | |
| 1821 | + return POPUP_OPEN_HOOK; | |
| 1822 | + } | |
| 1823 | + return POPUP_CLOSED_HOOK; | |
| 1824 | + }, | |
| 1825 | + anchorHidden(value) { | |
| 1826 | + if (value) { | |
| 1827 | + return ANCHOR_HIDDEN_HOOK; | |
| 1828 | + } | |
| 1829 | + return null; | |
| 1830 | + } | |
| 1831 | + }; | |
| 1832 | + var popupTransitionStateMapping = { | |
| 1833 | + ...popupStateMapping, | |
| 1834 | + ...transitionStatusMapping | |
| 1835 | + }; | |
| 1836 | + | |
| 1837 | + // node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs | |
| 1838 | + var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; | |
| 1839 | + var triggerDisabled = "data-trigger-disabled"; | |
| 1840 | + | |
| 1740 | 1841 | // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs |
| 1741 | 1842 | function isTargetInsideEnabledTrigger(target, triggerElements) { |
| 1742 | 1843 | if (!isElement(target)) { |
| 1743 | 1844 | return false; |
| @@ -1743,13 +1844,13 @@ | ||
| 1743 | 1844 | return false; |
| 1744 | 1845 | } |
| 1745 | 1846 | const targetElement = target; |
| 1746 | 1847 | if (triggerElements.hasElement(targetElement)) { |
| 1747 | - return !targetElement.hasAttribute("data-trigger-disabled"); | |
| 1848 | + return !targetElement.hasAttribute(triggerDisabled); | |
| 1748 | 1849 | } |
| 1749 | 1850 | for (const [, trigger] of triggerElements.entries()) { |
| 1750 | 1851 | if (contains(trigger, targetElement)) { |
| 1751 | - return !trigger.hasAttribute("data-trigger-disabled"); | |
| 1852 | + return !trigger.hasAttribute(triggerDisabled); | |
| 1752 | 1853 | } |
| 1753 | 1854 | } |
| 1754 | 1855 | return false; |
| 1755 | 1856 | } |
| @@ -1814,9 +1915,9 @@ | ||
| 1814 | 1915 | } |
| 1815 | 1916 | |
| 1816 | 1917 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs |
| 1817 | 1918 | var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); |
| 1818 | - var FloatingDelayGroupContext = /* @__PURE__ */ React13.createContext({ | |
| 1919 | + var FloatingDelayGroupContext = /* @__PURE__ */ React11.createContext({ | |
| 1819 | 1920 | hasProvider: false, |
| 1820 | 1921 | timeoutMs: 0, |
| 1821 | 1922 | delayRef: { |
| 1822 | 1923 | current: 0 |
| @@ -1841,12 +1942,12 @@ | ||
| 1841 | 1942 | children, |
| 1842 | 1943 | delay, |
| 1843 | 1944 | timeoutMs = 0 |
| 1844 | 1945 | } = props; |
| 1845 | - const delayRef = React13.useRef(delay); | |
| 1846 | - const initialDelayRef = React13.useRef(delay); | |
| 1847 | - const currentIdRef = React13.useRef(null); | |
| 1848 | - const currentContextRef = React13.useRef(null); | |
| 1946 | + const delayRef = React11.useRef(delay); | |
| 1947 | + const initialDelayRef = React11.useRef(delay); | |
| 1948 | + const currentIdRef = React11.useRef(null); | |
| 1949 | + const currentContextRef = React11.useRef(null); | |
| 1849 | 1950 | const timeout = useTimeout(); |
| 1850 | 1951 | useIsoLayoutEffect(() => { |
| 1851 | 1952 | initialDelayRef.current = delay; |
| 1852 | 1953 | if (!currentIdRef.current) { |
| @@ -1858,9 +1959,9 @@ | ||
| 1858 | 1959 | close: getDelay(delay, "close") |
| 1859 | 1960 | }; |
| 1860 | 1961 | }, [delay, currentIdRef, delayRef, initialDelayRef]); |
| 1861 | 1962 | return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { |
| 1862 | - value: React13.useMemo(() => ({ | |
| 1963 | + value: React11.useMemo(() => ({ | |
| 1863 | 1964 | hasProvider: true, |
| 1864 | 1965 | delayRef, |
| 1865 | 1966 | initialDelayRef, |
| 1866 | 1967 | currentIdRef, |
| @@ -1874,13 +1975,13 @@ | ||
| 1874 | 1975 | function useDelayGroup(context, options = { |
| 1875 | 1976 | open: false |
| 1876 | 1977 | }) { |
| 1877 | 1978 | const { |
| 1878 | - open | |
| 1979 | + open: open2 | |
| 1879 | 1980 | } = options; |
| 1880 | 1981 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 1881 | 1982 | const floatingId = store2.useState("floatingId"); |
| 1882 | - const groupContext = React13.useContext(FloatingDelayGroupContext); | |
| 1983 | + const groupContext = React11.useContext(FloatingDelayGroupContext); | |
| 1883 | 1984 | const { |
| 1884 | 1985 | currentIdRef, |
| 1885 | 1986 | delayRef, |
| 1886 | 1987 | timeoutMs, |
| @@ -1888,24 +1989,15 @@ | ||
| 1888 | 1989 | currentContextRef, |
| 1889 | 1990 | hasProvider, |
| 1890 | 1991 | timeout |
| 1891 | 1992 | } = groupContext; |
| 1892 | - const [isInstantPhase, setIsInstantPhase] = React13.useState(false); | |
| 1893 | - const openRef = React13.useRef(open); | |
| 1894 | - const isUnmountedRef = React13.useRef(false); | |
| 1993 | + const [isInstantPhase, setIsInstantPhase] = React11.useState(false); | |
| 1994 | + const openRef = React11.useRef(open2); | |
| 1895 | 1995 | useIsoLayoutEffect(() => { |
| 1896 | - openRef.current = open; | |
| 1897 | - }, [open]); | |
| 1996 | + openRef.current = open2; | |
| 1997 | + }, [open2]); | |
| 1898 | 1998 | useIsoLayoutEffect(() => { |
| 1899 | - return () => { | |
| 1900 | - isUnmountedRef.current = true; | |
| 1901 | - }; | |
| 1902 | - }, []); | |
| 1903 | - useIsoLayoutEffect(() => { | |
| 1904 | 1999 | function unset() { |
| 1905 | - if (!isUnmountedRef.current) { | |
| 1906 | - setIsInstantPhase(false); | |
| 1907 | - } | |
| 1908 | 2000 | currentContextRef.current?.setIsInstantPhase(false); |
| 1909 | 2001 | currentIdRef.current = null; |
| 1910 | 2002 | currentContextRef.current = null; |
| 1911 | 2003 | delayRef.current = initialDelayRef.current; |
| @@ -1913,9 +2005,9 @@ | ||
| 1913 | 2005 | } |
| 1914 | 2006 | if (!currentIdRef.current) { |
| 1915 | 2007 | return void 0; |
| 1916 | 2008 | } |
| 1917 | - if (!open && currentIdRef.current === floatingId) { | |
| 2009 | + if (!open2 && currentIdRef.current === floatingId) { | |
| 1918 | 2010 | setIsInstantPhase(false); |
| 1919 | 2011 | if (timeoutMs) { |
| 1920 | 2012 | const closingId = floatingId; |
| 1921 | 2013 | timeout.start(timeoutMs, () => { |
| @@ -1932,11 +2024,11 @@ | ||
| 1932 | 2024 | } |
| 1933 | 2025 | unset(); |
| 1934 | 2026 | } |
| 1935 | 2027 | return void 0; |
| 1936 | - }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); | |
| 2028 | + }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); | |
| 1937 | 2029 | useIsoLayoutEffect(() => { |
| 1938 | - if (!open) { | |
| 2030 | + if (!open2) { | |
| 1939 | 2031 | return; |
| 1940 | 2032 | } |
| 1941 | 2033 | const prevContext = currentContextRef.current; |
| 1942 | 2034 | const prevId = currentIdRef.current; |
| @@ -1957,9 +2049,9 @@ | ||
| 1957 | 2049 | } else { |
| 1958 | 2050 | setIsInstantPhase(false); |
| 1959 | 2051 | prevContext?.setIsInstantPhase(false); |
| 1960 | 2052 | } |
| 1961 | - }, [open, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); | |
| 2053 | + }, [open2, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); | |
| 1962 | 2054 | useIsoLayoutEffect(() => { |
| 1963 | 2055 | return () => { |
| 1964 | 2056 | if (currentIdRef.current === floatingId) { |
| 1965 | 2057 | currentContextRef.current = null; |
| @@ -1971,13 +2063,14 @@ | ||
| 1971 | 2063 | timeout.clear(); |
| 1972 | 2064 | } |
| 1973 | 2065 | }; |
| 1974 | 2066 | }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); |
| 1975 | - return React13.useMemo(() => ({ | |
| 2067 | + return React11.useMemo(() => ({ | |
| 2068 | + activeIdRef: currentIdRef, | |
| 1976 | 2069 | hasProvider, |
| 1977 | 2070 | delayRef, |
| 1978 | 2071 | isInstantPhase |
| 1979 | - }), [hasProvider, delayRef, isInstantPhase]); | |
| 2072 | + }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); | |
| 1980 | 2073 | } |
| 1981 | 2074 | |
| 1982 | 2075 | // node_modules/@base-ui/utils/mergeCleanups.mjs |
| 1983 | 2076 | function mergeCleanups(...cleanups) { |
| @@ -1991,9 +2084,9 @@ | ||
| 1991 | 2084 | }; |
| 1992 | 2085 | } |
| 1993 | 2086 | |
| 1994 | 2087 | // node_modules/@base-ui/react/utils/FocusGuard.mjs |
| 1995 | - var React14 = __toESM(require_react(), 1); | |
| 2088 | + var React12 = __toESM(require_react(), 1); | |
| 1996 | 2089 | |
| 1997 | 2090 | // node_modules/@base-ui/utils/visuallyHidden.mjs |
| 1998 | 2091 | var visuallyHiddenBase = { |
| 1999 | 2092 | clipPath: "inset(50%)", |
| @@ -2017,10 +2110,10 @@ | ||
| 2017 | 2110 | }; |
| 2018 | 2111 | |
| 2019 | 2112 | // node_modules/@base-ui/react/utils/FocusGuard.mjs |
| 2020 | 2113 | var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); |
| 2021 | - var FocusGuard = /* @__PURE__ */ React14.forwardRef(function FocusGuard2(props, ref) { | |
| 2022 | - const [role, setRole] = React14.useState(); | |
| 2114 | + var FocusGuard = /* @__PURE__ */ React12.forwardRef(function FocusGuard2(props, ref) { | |
| 2115 | + const [role, setRole] = React12.useState(); | |
| 2023 | 2116 | useIsoLayoutEffect(() => { |
| 2024 | 2117 | if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { |
| 2025 | 2118 | setRole("button"); |
| 2026 | 2119 | } |
| @@ -2041,9 +2134,8 @@ | ||
| 2041 | 2134 | }); |
| 2042 | 2135 | if (true) FocusGuard.displayName = "FocusGuard"; |
| 2043 | 2136 | |
| 2044 | 2137 | // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs |
| 2045 | - var sides = ["top", "right", "bottom", "left"]; | |
| 2046 | 2138 | var min = Math.min; |
| 2047 | 2139 | var max = Math.max; |
| 2048 | 2140 | var round = Math.round; |
| 2049 | 2141 | var floor = Math.floor; |
| @@ -2134,14 +2226,14 @@ | ||
| 2134 | 2226 | const side = getSide(placement); |
| 2135 | 2227 | return oppositeSideMap[side] + placement.slice(side.length); |
| 2136 | 2228 | } |
| 2137 | 2229 | function expandPaddingObject(padding) { |
| 2230 | + var _padding$top, _padding$right, _padding$bottom, _padding$left; | |
| 2138 | 2231 | return { |
| 2139 | - top: 0, | |
| 2140 | - right: 0, | |
| 2141 | - bottom: 0, | |
| 2142 | - left: 0, | |
| 2143 | - ...padding | |
| 2232 | + top: (_padding$top = padding.top) != null ? _padding$top : 0, | |
| 2233 | + right: (_padding$right = padding.right) != null ? _padding$right : 0, | |
| 2234 | + bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, | |
| 2235 | + left: (_padding$left = padding.left) != null ? _padding$left : 0 | |
| 2144 | 2236 | }; |
| 2145 | 2237 | } |
| 2146 | 2238 | function getPaddingObject(padding) { |
| 2147 | 2239 | return typeof padding !== "number" ? expandPaddingObject(padding) : { |
| @@ -2363,9 +2455,9 @@ | ||
| 2363 | 2455 | return `data-base-ui-${name}`; |
| 2364 | 2456 | } |
| 2365 | 2457 | |
| 2366 | 2458 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs |
| 2367 | - var React15 = __toESM(require_react(), 1); | |
| 2459 | + var React13 = __toESM(require_react(), 1); | |
| 2368 | 2460 | var ReactDOM2 = __toESM(require_react_dom(), 1); |
| 2369 | 2461 | |
| 2370 | 2462 | // node_modules/@base-ui/react/internals/constants.mjs |
| 2371 | 2463 | var DISABLED_TRANSITIONS_STYLE = { |
| @@ -2388,11 +2480,11 @@ | ||
| 2388 | 2480 | }; |
| 2389 | 2481 | |
| 2390 | 2482 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs |
| 2391 | 2483 | var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); |
| 2392 | - var PortalContext = /* @__PURE__ */ React15.createContext(null); | |
| 2484 | + var PortalContext = /* @__PURE__ */ React13.createContext(null); | |
| 2393 | 2485 | if (true) PortalContext.displayName = "PortalContext"; |
| 2394 | - var usePortalContext = () => React15.useContext(PortalContext); | |
| 2486 | + var usePortalContext = () => React13.useContext(PortalContext); | |
| 2395 | 2487 | var attr = createAttribute("portal"); |
| 2396 | 2488 | function useFloatingPortalNode(props = {}) { |
| 2397 | 2489 | const { |
| 2398 | 2490 | ref, |
| @@ -2402,16 +2494,16 @@ | ||
| 2402 | 2494 | } = props; |
| 2403 | 2495 | const uniqueId = useId(); |
| 2404 | 2496 | const portalContext = usePortalContext(); |
| 2405 | 2497 | const parentPortalNode = portalContext?.portalNode; |
| 2406 | - const [containerElement, setContainerElement] = React15.useState(null); | |
| 2407 | - const [portalNode, setPortalNode] = React15.useState(null); | |
| 2498 | + const [containerElement, setContainerElement] = React13.useState(null); | |
| 2499 | + const [portalNode, setPortalNode] = React13.useState(null); | |
| 2408 | 2500 | const setPortalNodeRef = useStableCallback((node) => { |
| 2409 | 2501 | if (node !== null) { |
| 2410 | 2502 | setPortalNode(node); |
| 2411 | 2503 | } |
| 2412 | 2504 | }); |
| 2413 | - const containerRef = React15.useRef(null); | |
| 2505 | + const containerRef = React13.useRef(null); | |
| 2414 | 2506 | useIsoLayoutEffect(() => { |
| 2415 | 2507 | if (containerProp === null) { |
| 2416 | 2508 | if (containerRef.current) { |
| 2417 | 2509 | containerRef.current = null; |
| @@ -2419,11 +2511,8 @@ | ||
| 2419 | 2511 | setContainerElement(null); |
| 2420 | 2512 | } |
| 2421 | 2513 | return; |
| 2422 | 2514 | } |
| 2423 | - if (uniqueId == null) { | |
| 2424 | - return; | |
| 2425 | - } | |
| 2426 | 2515 | const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; |
| 2427 | 2516 | if (resolvedContainer == null) { |
| 2428 | 2517 | if (containerRef.current) { |
| 2429 | 2518 | containerRef.current = null; |
| @@ -2436,9 +2525,9 @@ | ||
| 2436 | 2525 | containerRef.current = resolvedContainer; |
| 2437 | 2526 | setPortalNode(null); |
| 2438 | 2527 | setContainerElement(resolvedContainer); |
| 2439 | 2528 | } |
| 2440 | - }, [containerProp, parentPortalNode, uniqueId]); | |
| 2529 | + }, [containerProp, parentPortalNode]); | |
| 2441 | 2530 | const portalElement = useRenderElement("div", componentProps, { |
| 2442 | 2531 | ref: [ref, setPortalNodeRef], |
| 2443 | 2532 | props: [{ |
| 2444 | 2533 | id: uniqueId, |
| @@ -2446,13 +2535,16 @@ | ||
| 2446 | 2535 | }, elementProps] |
| 2447 | 2536 | }); |
| 2448 | 2537 | const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; |
| 2449 | 2538 | return { |
| 2450 | - portalNode, | |
| 2451 | - portalSubtree | |
| 2539 | + node: portalNode, | |
| 2540 | + // `id` and `render` props can override or remove the generated ID. Use the exact | |
| 2541 | + // rendered value so `aria-owns` never points at an ID absent from the DOM. | |
| 2542 | + nodeId: /* @__PURE__ */ React13.isValidElement(portalElement) ? portalElement.props.id : void 0, | |
| 2543 | + subtree: portalSubtree | |
| 2452 | 2544 | }; |
| 2453 | 2545 | } |
| 2454 | - var FloatingPortal = /* @__PURE__ */ React15.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { | |
| 2546 | + var FloatingPortal = /* @__PURE__ */ React13.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { | |
| 2455 | 2547 | const { |
| 2456 | 2548 | render, |
| 2457 | 2549 | className, |
| 2458 | 2550 | style, |
| @@ -2457,14 +2549,15 @@ | ||
| 2457 | 2549 | className, |
| 2458 | 2550 | style, |
| 2459 | 2551 | children, |
| 2460 | 2552 | container, |
| 2461 | - renderGuards, | |
| 2553 | + portalOwnerRole, | |
| 2462 | 2554 | ...elementProps |
| 2463 | 2555 | } = componentProps; |
| 2464 | 2556 | const { |
| 2465 | - portalNode, | |
| 2466 | - portalSubtree | |
| 2557 | + node: portalNode, | |
| 2558 | + nodeId: portalNodeId, | |
| 2559 | + subtree: portalSubtree | |
| 2467 | 2560 | } = useFloatingPortalNode({ |
| 2468 | 2561 | container, |
| 2469 | 2562 | ref: forwardedRef, |
| 2470 | 2563 | componentProps, |
| @@ -2469,18 +2562,18 @@ | ||
| 2469 | 2562 | ref: forwardedRef, |
| 2470 | 2563 | componentProps, |
| 2471 | 2564 | elementProps |
| 2472 | 2565 | }); |
| 2473 | - const beforeOutsideRef = React15.useRef(null); | |
| 2474 | - const afterOutsideRef = React15.useRef(null); | |
| 2475 | - const beforeInsideRef = React15.useRef(null); | |
| 2476 | - const afterInsideRef = React15.useRef(null); | |
| 2477 | - const [focusManagerState, setFocusManagerState] = React15.useState(null); | |
| 2478 | - const focusInsideDisabledRef = React15.useRef(false); | |
| 2566 | + const beforeOutsideRef = React13.useRef(null); | |
| 2567 | + const afterOutsideRef = React13.useRef(null); | |
| 2568 | + const beforeInsideRef = React13.useRef(null); | |
| 2569 | + const afterInsideRef = React13.useRef(null); | |
| 2570 | + const [focusManagerState, setFocusManagerState] = React13.useState(null); | |
| 2571 | + const focusInsideDisabledRef = React13.useRef(false); | |
| 2479 | 2572 | const modal = focusManagerState?.modal; |
| 2480 | - const open = focusManagerState?.open; | |
| 2481 | - const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; | |
| 2482 | - React15.useEffect(() => { | |
| 2573 | + const open2 = focusManagerState?.open; | |
| 2574 | + const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; | |
| 2575 | + React13.useEffect(() => { | |
| 2483 | 2576 | if (!portalNode || modal) { |
| 2484 | 2577 | return void 0; |
| 2485 | 2578 | } |
| 2486 | 2579 | function onFocus(event) { |
| @@ -2498,15 +2591,15 @@ | ||
| 2498 | 2591 | } |
| 2499 | 2592 | return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); |
| 2500 | 2593 | }, [portalNode, modal]); |
| 2501 | 2594 | useIsoLayoutEffect(() => { |
| 2502 | - if (!portalNode || open !== true || !focusInsideDisabledRef.current) { | |
| 2595 | + if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) { | |
| 2503 | 2596 | return; |
| 2504 | 2597 | } |
| 2505 | 2598 | enableFocusInside(portalNode); |
| 2506 | 2599 | focusInsideDisabledRef.current = false; |
| 2507 | - }, [open, portalNode]); | |
| 2508 | - const portalContextValue = React15.useMemo(() => ({ | |
| 2600 | + }, [open2, portalNode]); | |
| 2601 | + const portalContextValue = React13.useMemo(() => ({ | |
| 2509 | 2602 | beforeOutsideRef, |
| 2510 | 2603 | afterOutsideRef, |
| 2511 | 2604 | beforeInsideRef, |
| 2512 | 2605 | afterInsideRef, |
| @@ -2512,9 +2605,9 @@ | ||
| 2512 | 2605 | afterInsideRef, |
| 2513 | 2606 | portalNode, |
| 2514 | 2607 | setFocusManagerState |
| 2515 | 2608 | }), [portalNode]); |
| 2516 | - return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React15.Fragment, { | |
| 2609 | + return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React13.Fragment, { | |
| 2517 | 2610 | children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { |
| 2518 | 2611 | value: portalContextValue, |
| 2519 | 2612 | children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { |
| 2520 | 2613 | "data-type": "outside", |
| @@ -2528,9 +2621,10 @@ | ||
| 2528 | 2621 | prevTabbable?.focus(); |
| 2529 | 2622 | } |
| 2530 | 2623 | } |
| 2531 | 2624 | }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { |
| 2532 | - "aria-owns": portalNode.id, | |
| 2625 | + role: portalOwnerRole, | |
| 2626 | + "aria-owns": portalNodeId, | |
| 2533 | 2627 | style: ownerVisuallyHidden |
| 2534 | 2628 | }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { |
| 2535 | 2629 | "data-type": "outside", |
| 2536 | 2630 | ref: afterOutsideRef, |
| @@ -2552,9 +2646,9 @@ | ||
| 2552 | 2646 | }); |
| 2553 | 2647 | if (true) FloatingPortal.displayName = "FloatingPortal"; |
| 2554 | 2648 | |
| 2555 | 2649 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs |
| 2556 | - var React16 = __toESM(require_react(), 1); | |
| 2650 | + var React14 = __toESM(require_react(), 1); | |
| 2557 | 2651 | |
| 2558 | 2652 | // node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs |
| 2559 | 2653 | function createEventEmitter() { |
| 2560 | 2654 | const map = /* @__PURE__ */ new Map(); |
| @@ -2575,20 +2669,20 @@ | ||
| 2575 | 2669 | } |
| 2576 | 2670 | |
| 2577 | 2671 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs |
| 2578 | 2672 | var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); |
| 2579 | - var FloatingNodeContext = /* @__PURE__ */ React16.createContext(null); | |
| 2673 | + var FloatingNodeContext = /* @__PURE__ */ React14.createContext(null); | |
| 2580 | 2674 | if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; |
| 2581 | - var FloatingTreeContext = /* @__PURE__ */ React16.createContext(null); | |
| 2675 | + var FloatingTreeContext = /* @__PURE__ */ React14.createContext(null); | |
| 2582 | 2676 | if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; |
| 2583 | - var useFloatingParentNodeId = () => React16.useContext(FloatingNodeContext)?.id || null; | |
| 2677 | + var useFloatingParentNodeId = () => React14.useContext(FloatingNodeContext)?.id || null; | |
| 2584 | 2678 | var useFloatingTree = (externalTree) => { |
| 2585 | - const contextTree = React16.useContext(FloatingTreeContext); | |
| 2679 | + const contextTree = React14.useContext(FloatingTreeContext); | |
| 2586 | 2680 | return externalTree ?? contextTree; |
| 2587 | 2681 | }; |
| 2588 | 2682 | |
| 2589 | 2683 | // node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs |
| 2590 | - var React17 = __toESM(require_react(), 1); | |
| 2684 | + var React15 = __toESM(require_react(), 1); | |
| 2591 | 2685 | function createVirtualElement(domElement, data) { |
| 2592 | 2686 | let offsetX = null; |
| 2593 | 2687 | let offsetY = null; |
| 2594 | 2688 | let isAutoUpdateEvent = false; |
| @@ -2649,16 +2743,16 @@ | ||
| 2649 | 2743 | enabled = true, |
| 2650 | 2744 | axis = "both" |
| 2651 | 2745 | } = props; |
| 2652 | 2746 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 2653 | - const open = store2.useState("open"); | |
| 2747 | + const open2 = store2.useState("open"); | |
| 2654 | 2748 | const floating = store2.useState("floatingElement"); |
| 2655 | 2749 | const domReference = store2.useState("domReferenceElement"); |
| 2656 | 2750 | const dataRef = store2.context.dataRef; |
| 2657 | - const initialRef = React17.useRef(false); | |
| 2658 | - const cleanupListenerRef = React17.useRef(null); | |
| 2659 | - const [pointerType, setPointerType] = React17.useState(); | |
| 2660 | - const [reactive, setReactive] = React17.useState([]); | |
| 2751 | + const initialRef = React15.useRef(false); | |
| 2752 | + const cleanupListenerRef = React15.useRef(null); | |
| 2753 | + const [pointerType, setPointerType] = React15.useState(); | |
| 2754 | + const [reactive, setReactive] = React15.useState([]); | |
| 2661 | 2755 | const resetReference = useStableCallback((reference2) => { |
| 2662 | 2756 | store2.set("positionReference", reference2); |
| 2663 | 2757 | }); |
| 2664 | 2758 | const setReference = useStableCallback((newX, newY, referenceElement) => { |
| @@ -2676,9 +2770,9 @@ | ||
| 2676 | 2770 | pointerType |
| 2677 | 2771 | })); |
| 2678 | 2772 | }); |
| 2679 | 2773 | const handleReferenceEnterOrMove = useStableCallback((event) => { |
| 2680 | - if (!open) { | |
| 2774 | + if (!open2) { | |
| 2681 | 2775 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 2682 | 2776 | } else if (!cleanupListenerRef.current) { |
| 2683 | 2777 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 2684 | 2778 | setReactive([]); |
| @@ -2683,10 +2777,10 @@ | ||
| 2683 | 2777 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 2684 | 2778 | setReactive([]); |
| 2685 | 2779 | } |
| 2686 | 2780 | }); |
| 2687 | - const openCheck = isMouseLikePointerType(pointerType) ? floating : open; | |
| 2688 | - React17.useEffect(() => { | |
| 2781 | + const openCheck = isMouseLikePointerType(pointerType) ? floating : open2; | |
| 2782 | + React15.useEffect(() => { | |
| 2689 | 2783 | if (!enabled) { |
| 2690 | 2784 | resetReference(domReference); |
| 2691 | 2785 | return void 0; |
| 2692 | 2786 | } |
| @@ -2712,22 +2806,22 @@ | ||
| 2712 | 2806 | resetReference(domReference); |
| 2713 | 2807 | } |
| 2714 | 2808 | return cleanupListener; |
| 2715 | 2809 | }, [openCheck, enabled, floating, dataRef, domReference, store2, setReference, resetReference, reactive]); |
| 2716 | - React17.useEffect(() => () => { | |
| 2810 | + React15.useEffect(() => () => { | |
| 2717 | 2811 | store2.set("positionReference", null); |
| 2718 | 2812 | }, [store2]); |
| 2719 | - React17.useEffect(() => { | |
| 2813 | + React15.useEffect(() => { | |
| 2720 | 2814 | if (enabled && !floating) { |
| 2721 | 2815 | initialRef.current = false; |
| 2722 | 2816 | } |
| 2723 | 2817 | }, [enabled, floating]); |
| 2724 | - React17.useEffect(() => { | |
| 2725 | - if (!enabled && open) { | |
| 2818 | + React15.useEffect(() => { | |
| 2819 | + if (!enabled && open2) { | |
| 2726 | 2820 | initialRef.current = true; |
| 2727 | 2821 | } |
| 2728 | - }, [enabled, open]); | |
| 2729 | - const reference = React17.useMemo(() => { | |
| 2822 | + }, [enabled, open2]); | |
| 2823 | + const reference = React15.useMemo(() => { | |
| 2730 | 2824 | function setPointerTypeRef(event) { |
| 2731 | 2825 | setPointerType(event.pointerType); |
| 2732 | 2826 | } |
| 2733 | 2827 | return { |
| @@ -2736,9 +2830,9 @@ | ||
| 2736 | 2830 | onMouseMove: handleReferenceEnterOrMove, |
| 2737 | 2831 | onMouseEnter: handleReferenceEnterOrMove |
| 2738 | 2832 | }; |
| 2739 | 2833 | }, [handleReferenceEnterOrMove]); |
| 2740 | - return React17.useMemo(() => enabled ? { | |
| 2834 | + return React15.useMemo(() => enabled ? { | |
| 2741 | 2835 | reference, |
| 2742 | 2836 | trigger: reference |
| 2743 | 2837 | } : {}, [enabled, reference]); |
| 2744 | 2838 | } |
| @@ -2743,9 +2837,9 @@ | ||
| 2743 | 2837 | } : {}, [enabled, reference]); |
| 2744 | 2838 | } |
| 2745 | 2839 | |
| 2746 | 2840 | // node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs |
| 2747 | - var React18 = __toESM(require_react(), 1); | |
| 2841 | + var React16 = __toESM(require_react(), 1); | |
| 2748 | 2842 | function alwaysFalse() { |
| 2749 | 2843 | return false; |
| 2750 | 2844 | } |
| 2751 | 2845 | function normalizeProp(normalizable) { |
| @@ -2764,12 +2858,13 @@ | ||
| 2764 | 2858 | bubbles, |
| 2765 | 2859 | externalTree |
| 2766 | 2860 | } = props; |
| 2767 | 2861 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 2768 | - const open = store2.useState("open"); | |
| 2862 | + const open2 = store2.useState("open"); | |
| 2769 | 2863 | const floatingElement = store2.useState("floatingElement"); |
| 2770 | 2864 | const { |
| 2771 | - dataRef | |
| 2865 | + dataRef, | |
| 2866 | + events | |
| 2772 | 2867 | } = store2.context; |
| 2773 | 2868 | const tree = useFloatingTree(externalTree); |
| 2774 | 2869 | const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); |
| 2775 | 2870 | const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; |
| @@ -2778,14 +2873,15 @@ | ||
| 2778 | 2873 | const { |
| 2779 | 2874 | escapeKey: escapeKeyBubbles, |
| 2780 | 2875 | outsidePress: outsidePressBubbles |
| 2781 | 2876 | } = normalizeProp(bubbles); |
| 2782 | - const pressStartedInsideRef = React18.useRef(false); | |
| 2783 | - const pressStartPreventedRef = React18.useRef(false); | |
| 2784 | - const suppressNextOutsideClickRef = React18.useRef(false); | |
| 2785 | - const isComposingRef = React18.useRef(false); | |
| 2786 | - const currentPointerTypeRef = React18.useRef(""); | |
| 2787 | - const touchStateRef = React18.useRef(null); | |
| 2877 | + const pressStartedInsideRef = React16.useRef(false); | |
| 2878 | + const pressStartPreventedRef = React16.useRef(false); | |
| 2879 | + const suppressNextOutsideClickRef = React16.useRef(false); | |
| 2880 | + const sawPressWhileOpenRef = React16.useRef(false); | |
| 2881 | + const isComposingRef = React16.useRef(false); | |
| 2882 | + const currentPointerTypeRef = React16.useRef(""); | |
| 2883 | + const touchStateRef = React16.useRef(null); | |
| 2788 | 2884 | const cancelDismissOnEndTimeout = useTimeout(); |
| 2789 | 2885 | const clearInsideReactTreeTimeout = useTimeout(); |
| 2790 | 2886 | const clearInsideReactTree = useStableCallback(() => { |
| 2791 | 2887 | clearInsideReactTreeTimeout.clear(); |
| @@ -2805,9 +2901,9 @@ | ||
| 2805 | 2901 | } |
| 2806 | 2902 | store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); |
| 2807 | 2903 | }); |
| 2808 | 2904 | const closeOnEscapeKeyDown = useStableCallback((event) => { |
| 2809 | - if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { | |
| 2905 | + if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") { | |
| 2810 | 2906 | return; |
| 2811 | 2907 | } |
| 2812 | 2908 | if (isComposingRef.current) { |
| 2813 | 2909 | return; |
| @@ -2829,9 +2925,9 @@ | ||
| 2829 | 2925 | dataRef.current.insideReactTree = true; |
| 2830 | 2926 | clearInsideReactTreeTimeout.start(0, clearInsideReactTree); |
| 2831 | 2927 | }); |
| 2832 | 2928 | const markPressStartedInsideReactTree = useStableCallback((event) => { |
| 2833 | - if (!open || !enabled || event.button !== 0) { | |
| 2929 | + if (!open2 || !enabled || event.button !== 0) { | |
| 2834 | 2930 | return; |
| 2835 | 2931 | } |
| 2836 | 2932 | const target = getTarget(event.nativeEvent); |
| 2837 | 2933 | if (!contains(store2.select("floatingElement"), target)) { |
| @@ -2842,9 +2938,9 @@ | ||
| 2842 | 2938 | pressStartPreventedRef.current = false; |
| 2843 | 2939 | } |
| 2844 | 2940 | }); |
| 2845 | 2941 | const markInsidePressStartPrevented = useStableCallback((event) => { |
| 2846 | - if (!open || !enabled) { | |
| 2942 | + if (!open2 || !enabled) { | |
| 2847 | 2943 | return; |
| 2848 | 2944 | } |
| 2849 | 2945 | if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { |
| 2850 | 2946 | return; |
| @@ -2852,16 +2948,31 @@ | ||
| 2852 | 2948 | if (pressStartedInsideRef.current) { |
| 2853 | 2949 | pressStartPreventedRef.current = true; |
| 2854 | 2950 | } |
| 2855 | 2951 | }); |
| 2856 | - React18.useEffect(() => { | |
| 2857 | - if (!open || !enabled) { | |
| 2858 | - return void 0; | |
| 2952 | + React16.useEffect(() => { | |
| 2953 | + function handleOpenChange(details) { | |
| 2954 | + if (!details.open) { | |
| 2955 | + sawPressWhileOpenRef.current = false; | |
| 2956 | + } | |
| 2859 | 2957 | } |
| 2958 | + events.on("openchange", handleOpenChange); | |
| 2959 | + return () => { | |
| 2960 | + events.off("openchange", handleOpenChange); | |
| 2961 | + }; | |
| 2962 | + }, [events]); | |
| 2963 | + React16.useEffect(() => { | |
| 2964 | + if (!open2 || !enabled) { | |
| 2965 | + if (!open2) { | |
| 2966 | + sawPressWhileOpenRef.current = false; | |
| 2967 | + } | |
| 2968 | + return clearInsideReactTree; | |
| 2969 | + } | |
| 2860 | 2970 | dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; |
| 2861 | 2971 | dataRef.current.__outsidePressBubbles = outsidePressBubbles; |
| 2862 | 2972 | const compositionTimeout = new Timeout(); |
| 2863 | 2973 | const preventedPressSuppressionTimeout = new Timeout(); |
| 2974 | + const doc = ownerDocument(floatingElement); | |
| 2864 | 2975 | function handleCompositionStart() { |
| 2865 | 2976 | compositionTimeout.clear(); |
| 2866 | 2977 | isComposingRef.current = true; |
| 2867 | 2978 | } |
| @@ -2946,10 +3057,10 @@ | ||
| 2946 | 3057 | const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); |
| 2947 | 3058 | const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); |
| 2948 | 3059 | const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; |
| 2949 | 3060 | const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; |
| 2950 | - const isRTL3 = style.direction === "rtl"; | |
| 2951 | - const pressedVerticalScrollbar = canScrollY && (isRTL3 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); | |
| 3061 | + const isRTL4 = style.direction === "rtl"; | |
| 3062 | + const pressedVerticalScrollbar = canScrollY && (isRTL4 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); | |
| 2952 | 3063 | const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; |
| 2953 | 3064 | if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { |
| 2954 | 3065 | return; |
| 2955 | 3066 | } |
| @@ -2956,12 +3067,17 @@ | ||
| 2956 | 3067 | } |
| 2957 | 3068 | if (isEventWithinFloatingTree(event)) { |
| 2958 | 3069 | return; |
| 2959 | 3070 | } |
| 2960 | - if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { | |
| 2961 | - preventedPressSuppressionTimeout.clear(); | |
| 2962 | - suppressNextOutsideClickRef.current = false; | |
| 2963 | - return; | |
| 3071 | + if (getOutsidePressEvent() === "intentional") { | |
| 3072 | + if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) { | |
| 3073 | + return; | |
| 3074 | + } | |
| 3075 | + if (suppressNextOutsideClickRef.current) { | |
| 3076 | + preventedPressSuppressionTimeout.clear(); | |
| 3077 | + suppressNextOutsideClickRef.current = false; | |
| 3078 | + return; | |
| 3079 | + } | |
| 2964 | 3080 | } |
| 2965 | 3081 | if (typeof outsidePress2 === "function" && !outsidePress2(event)) { |
| 2966 | 3082 | return; |
| 2967 | 3083 | } |
| @@ -3014,8 +3130,11 @@ | ||
| 3014 | 3130 | } |
| 3015 | 3131 | function closeOnPressOutsideCapture(event) { |
| 3016 | 3132 | cancelDismissOnEndTimeout.clear(); |
| 3017 | 3133 | if (event.type === "pointerdown") { |
| 3134 | + if (event.button === 0) { | |
| 3135 | + sawPressWhileOpenRef.current = true; | |
| 3136 | + } | |
| 3018 | 3137 | currentPointerTypeRef.current = event.pointerType; |
| 3019 | 3138 | } |
| 3020 | 3139 | if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { |
| 3021 | 3140 | return; |
| @@ -3028,8 +3147,11 @@ | ||
| 3028 | 3147 | } |
| 3029 | 3148 | }); |
| 3030 | 3149 | } |
| 3031 | 3150 | function handlePressEndCapture(event) { |
| 3151 | + if (event.type === "pointercancel") { | |
| 3152 | + sawPressWhileOpenRef.current = false; | |
| 3153 | + } | |
| 3032 | 3154 | if (!pressStartedInsideRef.current) { |
| 3033 | 3155 | return; |
| 3034 | 3156 | } |
| 3035 | 3157 | const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; |
| @@ -3092,10 +3214,18 @@ | ||
| 3092 | 3214 | } |
| 3093 | 3215 | function handleTouchEndCapture(event) { |
| 3094 | 3216 | addTargetEventListenerOnce(event, handleTouchEnd); |
| 3095 | 3217 | } |
| 3096 | - const doc = ownerDocument(floatingElement); | |
| 3097 | - const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, true), addEventListener(doc, "touchmove", handleTouchMoveCapture, true), addEventListener(doc, "touchend", handleTouchEndCapture, true))); | |
| 3218 | + const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, { | |
| 3219 | + capture: true, | |
| 3220 | + passive: true | |
| 3221 | + }), addEventListener(doc, "touchmove", handleTouchMoveCapture, { | |
| 3222 | + capture: true, | |
| 3223 | + passive: true | |
| 3224 | + }), addEventListener(doc, "touchend", handleTouchEndCapture, { | |
| 3225 | + capture: true, | |
| 3226 | + passive: true | |
| 3227 | + }))); | |
| 3098 | 3228 | return () => { |
| 3099 | 3229 | unsubscribe(); |
| 3100 | 3230 | compositionTimeout.clear(); |
| 3101 | 3231 | preventedPressSuppressionTimeout.clear(); |
| @@ -3100,17 +3230,17 @@ | ||
| 3100 | 3230 | compositionTimeout.clear(); |
| 3101 | 3231 | preventedPressSuppressionTimeout.clear(); |
| 3102 | 3232 | resetPressStartState(); |
| 3103 | 3233 | suppressNextOutsideClickRef.current = false; |
| 3234 | + clearInsideReactTree(); | |
| 3104 | 3235 | }; |
| 3105 | - }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); | |
| 3106 | - React18.useEffect(clearInsideReactTree, [outsidePress2, clearInsideReactTree]); | |
| 3107 | - const reference = React18.useMemo(() => ({ | |
| 3236 | + }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); | |
| 3237 | + const reference = React16.useMemo(() => ({ | |
| 3108 | 3238 | onKeyDown: closeOnEscapeKeyDown, |
| 3109 | 3239 | onPointerDown: closeOnReferencePress, |
| 3110 | 3240 | onClick: closeOnReferencePress |
| 3111 | 3241 | }), [closeOnEscapeKeyDown, closeOnReferencePress]); |
| 3112 | - const floating = React18.useMemo(() => ({ | |
| 3242 | + const floating = React16.useMemo(() => ({ | |
| 3113 | 3243 | onKeyDown: closeOnEscapeKeyDown, |
| 3114 | 3244 | // `onMouseDown` may be blocked if `event.preventDefault()` is called in |
| 3115 | 3245 | // `onPointerDown`, such as with <NumberField.ScrubArea>. |
| 3116 | 3246 | // See https://github.com/mui/base-ui/pull/3379 |
| @@ -3128,9 +3258,9 @@ | ||
| 3128 | 3258 | onMouseUpCapture: markInsideReactTree, |
| 3129 | 3259 | onTouchEndCapture: markInsideReactTree, |
| 3130 | 3260 | onTouchMoveCapture: markInsideReactTree |
| 3131 | 3261 | }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); |
| 3132 | - return React18.useMemo(() => enabled ? { | |
| 3262 | + return React16.useMemo(() => enabled ? { | |
| 3133 | 3263 | reference, |
| 3134 | 3264 | floating, |
| 3135 | 3265 | trigger: reference |
| 3136 | 3266 | } : {}, [enabled, reference, floating]); |
| @@ -3136,9 +3266,9 @@ | ||
| 3136 | 3266 | } : {}, [enabled, reference, floating]); |
| 3137 | 3267 | } |
| 3138 | 3268 | |
| 3139 | 3269 | // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs |
| 3140 | - var React25 = __toESM(require_react(), 1); | |
| 3270 | + var React24 = __toESM(require_react(), 1); | |
| 3141 | 3271 | |
| 3142 | 3272 | // node_modules/@floating-ui/core/dist/floating-ui.core.mjs |
| 3143 | 3273 | function computeCoordsFromPlacement(_ref, placement, rtl) { |
| 3144 | 3274 | let { |
| @@ -3184,15 +3314,11 @@ | ||
| 3184 | 3314 | x: reference.x, |
| 3185 | 3315 | y: reference.y |
| 3186 | 3316 | }; |
| 3187 | 3317 | } |
| 3188 | - switch (getAlignment(placement)) { | |
| 3189 | - case "start": | |
| 3190 | - coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); | |
| 3191 | - break; | |
| 3192 | - case "end": | |
| 3193 | - coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); | |
| 3194 | - break; | |
| 3318 | + const alignment = getAlignment(placement); | |
| 3319 | + if (alignment) { | |
| 3320 | + coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); | |
| 3195 | 3321 | } |
| 3196 | 3322 | return coords; |
| 3197 | 3323 | } |
| 3198 | 3324 | async function detectOverflow(state, options) { |
| @@ -3230,14 +3356,11 @@ | ||
| 3230 | 3356 | width: rects.floating.width, |
| 3231 | 3357 | height: rects.floating.height |
| 3232 | 3358 | } : rects.reference; |
| 3233 | 3359 | const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); |
| 3234 | - const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) ? await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { | |
| 3360 | + const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { | |
| 3235 | 3361 | x: 1, |
| 3236 | 3362 | y: 1 |
| 3237 | - } : { | |
| 3238 | - x: 1, | |
| 3239 | - y: 1 | |
| 3240 | 3363 | }; |
| 3241 | 3364 | const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ |
| 3242 | 3365 | elements, |
| 3243 | 3366 | rect, |
| @@ -3447,69 +3570,8 @@ | ||
| 3447 | 3570 | return {}; |
| 3448 | 3571 | } |
| 3449 | 3572 | }; |
| 3450 | 3573 | }; |
| 3451 | - function getSideOffsets(overflow, rect) { | |
| 3452 | - return { | |
| 3453 | - top: overflow.top - rect.height, | |
| 3454 | - right: overflow.right - rect.width, | |
| 3455 | - bottom: overflow.bottom - rect.height, | |
| 3456 | - left: overflow.left - rect.width | |
| 3457 | - }; | |
| 3458 | - } | |
| 3459 | - function isAnySideFullyClipped(overflow) { | |
| 3460 | - return sides.some((side) => overflow[side] >= 0); | |
| 3461 | - } | |
| 3462 | - var hide = function(options) { | |
| 3463 | - if (options === void 0) { | |
| 3464 | - options = {}; | |
| 3465 | - } | |
| 3466 | - return { | |
| 3467 | - name: "hide", | |
| 3468 | - options, | |
| 3469 | - async fn(state) { | |
| 3470 | - const { | |
| 3471 | - rects, | |
| 3472 | - platform: platform3 | |
| 3473 | - } = state; | |
| 3474 | - const { | |
| 3475 | - strategy = "referenceHidden", | |
| 3476 | - ...detectOverflowOptions | |
| 3477 | - } = evaluate(options, state); | |
| 3478 | - switch (strategy) { | |
| 3479 | - case "referenceHidden": { | |
| 3480 | - const overflow = await platform3.detectOverflow(state, { | |
| 3481 | - ...detectOverflowOptions, | |
| 3482 | - elementContext: "reference" | |
| 3483 | - }); | |
| 3484 | - const offsets = getSideOffsets(overflow, rects.reference); | |
| 3485 | - return { | |
| 3486 | - data: { | |
| 3487 | - referenceHiddenOffsets: offsets, | |
| 3488 | - referenceHidden: isAnySideFullyClipped(offsets) | |
| 3489 | - } | |
| 3490 | - }; | |
| 3491 | - } | |
| 3492 | - case "escaped": { | |
| 3493 | - const overflow = await platform3.detectOverflow(state, { | |
| 3494 | - ...detectOverflowOptions, | |
| 3495 | - altBoundary: true | |
| 3496 | - }); | |
| 3497 | - const offsets = getSideOffsets(overflow, rects.floating); | |
| 3498 | - return { | |
| 3499 | - data: { | |
| 3500 | - escapedOffsets: offsets, | |
| 3501 | - escaped: isAnySideFullyClipped(offsets) | |
| 3502 | - } | |
| 3503 | - }; | |
| 3504 | - } | |
| 3505 | - default: { | |
| 3506 | - return {}; | |
| 3507 | - } | |
| 3508 | - } | |
| 3509 | - } | |
| 3510 | - }; | |
| 3511 | - }; | |
| 3512 | 3574 | var originSides = /* @__PURE__ */ new Set(["left", "top"]); |
| 3513 | 3575 | async function convertValueToCoords(state, options) { |
| 3514 | 3576 | const { |
| 3515 | 3577 | placement, |
| @@ -3612,25 +3674,18 @@ | ||
| 3612 | 3674 | x, |
| 3613 | 3675 | y |
| 3614 | 3676 | }; |
| 3615 | 3677 | const overflow = await platform3.detectOverflow(state, detectOverflowOptions); |
| 3616 | - const crossAxis = getSideAxis(getSide(placement)); | |
| 3678 | + const crossAxis = getSideAxis(placement); | |
| 3617 | 3679 | const mainAxis = getOppositeAxis(crossAxis); |
| 3618 | 3680 | let mainAxisCoord = coords[mainAxis]; |
| 3619 | 3681 | let crossAxisCoord = coords[crossAxis]; |
| 3682 | + const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); | |
| 3620 | 3683 | if (checkMainAxis) { |
| 3621 | - const minSide = mainAxis === "y" ? "top" : "left"; | |
| 3622 | - const maxSide = mainAxis === "y" ? "bottom" : "right"; | |
| 3623 | - const min2 = mainAxisCoord + overflow[minSide]; | |
| 3624 | - const max2 = mainAxisCoord - overflow[maxSide]; | |
| 3625 | - mainAxisCoord = clamp(min2, mainAxisCoord, max2); | |
| 3684 | + mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); | |
| 3626 | 3685 | } |
| 3627 | 3686 | if (checkCrossAxis) { |
| 3628 | - const minSide = crossAxis === "y" ? "top" : "left"; | |
| 3629 | - const maxSide = crossAxis === "y" ? "bottom" : "right"; | |
| 3630 | - const min2 = crossAxisCoord + overflow[minSide]; | |
| 3631 | - const max2 = crossAxisCoord - overflow[maxSide]; | |
| 3632 | - crossAxisCoord = clamp(min2, crossAxisCoord, max2); | |
| 3687 | + crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); | |
| 3633 | 3688 | } |
| 3634 | 3689 | const limitedCoords = limiter.fn({ |
| 3635 | 3690 | ...state, |
| 3636 | 3691 | [mainAxis]: mainAxisCoord, |
| @@ -3656,8 +3711,9 @@ | ||
| 3656 | 3711 | } |
| 3657 | 3712 | return { |
| 3658 | 3713 | options, |
| 3659 | 3714 | fn(state) { |
| 3715 | + var _rawOffset$mainAxis, _rawOffset$crossAxis; | |
| 3660 | 3716 | const { |
| 3661 | 3717 | x, |
| 3662 | 3718 | y, |
| 3663 | 3719 | placement, |
| @@ -3681,11 +3737,10 @@ | ||
| 3681 | 3737 | const computedOffset = typeof rawOffset === "number" ? { |
| 3682 | 3738 | mainAxis: rawOffset, |
| 3683 | 3739 | crossAxis: 0 |
| 3684 | 3740 | } : { |
| 3685 | - mainAxis: 0, | |
| 3686 | - crossAxis: 0, | |
| 3687 | - ...rawOffset | |
| 3741 | + mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, | |
| 3742 | + crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 | |
| 3688 | 3743 | }; |
| 3689 | 3744 | if (checkMainAxis) { |
| 3690 | 3745 | const len = mainAxis === "y" ? "height" : "width"; |
| 3691 | 3746 | const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; |
| @@ -3722,9 +3777,8 @@ | ||
| 3722 | 3777 | return { |
| 3723 | 3778 | name: "size", |
| 3724 | 3779 | options, |
| 3725 | 3780 | async fn(state) { |
| 3726 | - var _state$middlewareData, _state$middlewareData2; | |
| 3727 | 3781 | const { |
| 3728 | 3782 | placement, |
| 3729 | 3783 | rects, |
| 3730 | 3784 | platform: platform3, |
| @@ -3755,32 +3809,29 @@ | ||
| 3755 | 3809 | const maximumClippingHeight = height - overflow.top - overflow.bottom; |
| 3756 | 3810 | const maximumClippingWidth = width - overflow.left - overflow.right; |
| 3757 | 3811 | const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); |
| 3758 | 3812 | const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); |
| 3759 | - const noShift = !state.middlewareData.shift; | |
| 3760 | - let availableHeight = overflowAvailableHeight; | |
| 3761 | - let availableWidth = overflowAvailableWidth; | |
| 3762 | - if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { | |
| 3763 | - availableWidth = maximumClippingWidth; | |
| 3813 | + const shiftData = state.middlewareData.shift; | |
| 3814 | + const noShift = !shiftData; | |
| 3815 | + let availableHeight2 = overflowAvailableHeight; | |
| 3816 | + let availableWidth2 = overflowAvailableWidth; | |
| 3817 | + if (shiftData != null && shiftData.enabled.x) { | |
| 3818 | + availableWidth2 = maximumClippingWidth; | |
| 3764 | 3819 | } |
| 3765 | - if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { | |
| 3766 | - availableHeight = maximumClippingHeight; | |
| 3820 | + if (shiftData != null && shiftData.enabled.y) { | |
| 3821 | + availableHeight2 = maximumClippingHeight; | |
| 3767 | 3822 | } |
| 3768 | 3823 | if (noShift && !alignment) { |
| 3769 | - const xMin = max(overflow.left, 0); | |
| 3770 | - const xMax = max(overflow.right, 0); | |
| 3771 | - const yMin = max(overflow.top, 0); | |
| 3772 | - const yMax = max(overflow.bottom, 0); | |
| 3773 | 3824 | if (isYAxis) { |
| 3774 | - availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); | |
| 3825 | + availableWidth2 = width - 2 * max(overflow.left, overflow.right); | |
| 3775 | 3826 | } else { |
| 3776 | - availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); | |
| 3827 | + availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); | |
| 3777 | 3828 | } |
| 3778 | 3829 | } |
| 3779 | 3830 | await apply({ |
| 3780 | 3831 | ...state, |
| 3781 | - availableWidth, | |
| 3782 | - availableHeight | |
| 3832 | + availableWidth: availableWidth2, | |
| 3833 | + availableHeight: availableHeight2 | |
| 3783 | 3834 | }); |
| 3784 | 3835 | const nextDimensions = await platform3.getDimensions(elements.floating); |
| 3785 | 3836 | if (width !== nextDimensions.width || height !== nextDimensions.height) { |
| 3786 | 3837 | return { |
| @@ -3854,12 +3905,9 @@ | ||
| 3854 | 3905 | function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { |
| 3855 | 3906 | if (isFixed === void 0) { |
| 3856 | 3907 | isFixed = false; |
| 3857 | 3908 | } |
| 3858 | - if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { | |
| 3859 | - return false; | |
| 3860 | - } | |
| 3861 | - return isFixed; | |
| 3909 | + return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); | |
| 3862 | 3910 | } |
| 3863 | 3911 | function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { |
| 3864 | 3912 | if (includeScale === void 0) { |
| 3865 | 3913 | includeScale = false; |
| @@ -3883,14 +3931,14 @@ | ||
| 3883 | 3931 | let x = (clientRect.left + visualOffsets.x) / scale.x; |
| 3884 | 3932 | let y = (clientRect.top + visualOffsets.y) / scale.y; |
| 3885 | 3933 | let width = clientRect.width / scale.x; |
| 3886 | 3934 | let height = clientRect.height / scale.y; |
| 3887 | - if (domElement) { | |
| 3935 | + if (domElement && offsetParent) { | |
| 3888 | 3936 | const win = getWindow(domElement); |
| 3889 | - const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | |
| 3937 | + const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; | |
| 3890 | 3938 | let currentWin = win; |
| 3891 | 3939 | let currentIFrame = getFrameElement(currentWin); |
| 3892 | - while (currentIFrame && offsetParent && offsetWin !== currentWin) { | |
| 3940 | + while (currentIFrame && offsetWin !== currentWin) { | |
| 3893 | 3941 | const iframeScale = getScale(currentIFrame); |
| 3894 | 3942 | const iframeRect = currentIFrame.getBoundingClientRect(); |
| 3895 | 3943 | const css = getComputedStyle2(currentIFrame); |
| 3896 | 3944 | const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; |
| @@ -3947,9 +3995,9 @@ | ||
| 3947 | 3995 | }; |
| 3948 | 3996 | let scale = createCoords(1); |
| 3949 | 3997 | const offsets = createCoords(0); |
| 3950 | 3998 | const isOffsetParentAnElement = isHTMLElement(offsetParent); |
| 3951 | - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | |
| 3999 | + if (isOffsetParentAnElement || !isFixed) { | |
| 3952 | 4000 | if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { |
| 3953 | 4001 | scroll = getNodeScroll(offsetParent); |
| 3954 | 4002 | } |
| 3955 | 4003 | if (isOffsetParentAnElement) { |
| @@ -3967,17 +4015,16 @@ | ||
| 3967 | 4015 | y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y |
| 3968 | 4016 | }; |
| 3969 | 4017 | } |
| 3970 | 4018 | function getClientRects(element) { |
| 3971 | - return Array.from(element.getClientRects()); | |
| 4019 | + return element.getClientRects ? Array.from(element.getClientRects()) : []; | |
| 3972 | 4020 | } |
| 3973 | - function getDocumentRect(element) { | |
| 3974 | - const html = getDocumentElement(element); | |
| 3975 | - const scroll = getNodeScroll(element); | |
| 3976 | - const body = element.ownerDocument.body; | |
| 4021 | + function getDocumentRect(html) { | |
| 4022 | + const scroll = getNodeScroll(html); | |
| 4023 | + const body = html.ownerDocument.body; | |
| 3977 | 4024 | const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); |
| 3978 | 4025 | const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); |
| 3979 | - let x = -scroll.scrollLeft + getWindowScrollBarX(element); | |
| 4026 | + let x = -scroll.scrollLeft + getWindowScrollBarX(html); | |
| 3980 | 4027 | const y = -scroll.scrollTop; |
| 3981 | 4028 | if (getComputedStyle2(body).direction === "rtl") { |
| 3982 | 4029 | x += max(html.clientWidth, body.clientWidth) - width; |
| 3983 | 4030 | } |
| @@ -3988,9 +4035,13 @@ | ||
| 3988 | 4035 | y |
| 3989 | 4036 | }; |
| 3990 | 4037 | } |
| 3991 | 4038 | var SCROLLBAR_MAX = 25; |
| 3992 | - function getViewportRect(element, strategy) { | |
| 4039 | + function getViewportRect(element, strategy, rootBoundary) { | |
| 4040 | + if (rootBoundary === void 0) { | |
| 4041 | + rootBoundary = "viewport"; | |
| 4042 | + } | |
| 4043 | + const isLayoutViewport = rootBoundary === "layoutViewport"; | |
| 3993 | 4044 | const win = getWindow(element); |
| 3994 | 4045 | const html = getDocumentElement(element); |
| 3995 | 4046 | const visualViewport = win.visualViewport; |
| 3996 | 4047 | let width = html.clientWidth; |
| @@ -3997,14 +4048,21 @@ | ||
| 3997 | 4048 | let height = html.clientHeight; |
| 3998 | 4049 | let x = 0; |
| 3999 | 4050 | let y = 0; |
| 4000 | 4051 | if (visualViewport) { |
| 4001 | - width = visualViewport.width; | |
| 4002 | - height = visualViewport.height; | |
| 4003 | - const visualViewportBased = isWebKit(); | |
| 4004 | - if (!visualViewportBased || visualViewportBased && strategy === "fixed") { | |
| 4005 | - x = visualViewport.offsetLeft; | |
| 4006 | - y = visualViewport.offsetTop; | |
| 4052 | + const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; | |
| 4053 | + if (isLayoutViewport) { | |
| 4054 | + if (!layoutRelativeClientCoords) { | |
| 4055 | + x = -visualViewport.offsetLeft; | |
| 4056 | + y = -visualViewport.offsetTop; | |
| 4057 | + } | |
| 4058 | + } else { | |
| 4059 | + width = visualViewport.width; | |
| 4060 | + height = visualViewport.height; | |
| 4061 | + if (layoutRelativeClientCoords) { | |
| 4062 | + x = visualViewport.offsetLeft; | |
| 4063 | + y = visualViewport.offsetTop; | |
| 4064 | + } | |
| 4007 | 4065 | } |
| 4008 | 4066 | } |
| 4009 | 4067 | const windowScrollbarX = getWindowScrollBarX(html); |
| 4010 | 4068 | if (windowScrollbarX <= 0) { |
| @@ -4011,14 +4069,13 @@ | ||
| 4011 | 4069 | const doc = html.ownerDocument; |
| 4012 | 4070 | const body = doc.body; |
| 4013 | 4071 | const bodyStyles = getComputedStyle(body); |
| 4014 | 4072 | const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; |
| 4015 | - const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | |
| 4016 | - if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { | |
| 4017 | - width -= clippingStableScrollbarWidth; | |
| 4073 | + const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); | |
| 4074 | + const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; | |
| 4075 | + if (gutter <= SCROLLBAR_MAX) { | |
| 4076 | + width -= gutter; | |
| 4018 | 4077 | } |
| 4019 | - } else if (windowScrollbarX <= SCROLLBAR_MAX) { | |
| 4020 | - width += windowScrollbarX; | |
| 4021 | 4078 | } |
| 4022 | 4079 | return { |
| 4023 | 4080 | width, |
| 4024 | 4081 | height, |
| @@ -4029,9 +4086,9 @@ | ||
| 4029 | 4086 | function getInnerBoundingClientRect(element, strategy) { |
| 4030 | 4087 | const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); |
| 4031 | 4088 | const top = clientRect.top + element.clientTop; |
| 4032 | 4089 | const left = clientRect.left + element.clientLeft; |
| 4033 | - const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); | |
| 4090 | + const scale = getScale(element); | |
| 4034 | 4091 | const width = element.clientWidth * scale.x; |
| 4035 | 4092 | const height = element.clientHeight * scale.y; |
| 4036 | 4093 | const x = left * scale.x; |
| 4037 | 4094 | const y = top * scale.y; |
| @@ -4043,10 +4100,10 @@ | ||
| 4043 | 4100 | }; |
| 4044 | 4101 | } |
| 4045 | 4102 | function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { |
| 4046 | 4103 | let rect; |
| 4047 | - if (clippingAncestor === "viewport") { | |
| 4048 | - rect = getViewportRect(element, strategy); | |
| 4104 | + if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { | |
| 4105 | + rect = getViewportRect(element, strategy, clippingAncestor); | |
| 4049 | 4106 | } else if (clippingAncestor === "document") { |
| 4050 | 4107 | rect = getDocumentRect(getDocumentElement(element)); |
| 4051 | 4108 | } else if (isElement(clippingAncestor)) { |
| 4052 | 4109 | rect = getInnerBoundingClientRect(clippingAncestor, strategy); |
| @@ -4060,15 +4117,8 @@ | ||
| 4060 | 4117 | }; |
| 4061 | 4118 | } |
| 4062 | 4119 | return rectToClientRect(rect); |
| 4063 | 4120 | } |
| 4064 | - function hasFixedPositionAncestor(element, stopNode) { | |
| 4065 | - const parentNode = getParentNode(element); | |
| 4066 | - if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { | |
| 4067 | - return false; | |
| 4068 | - } | |
| 4069 | - return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); | |
| 4070 | - } | |
| 4071 | 4121 | function getClippingElementAncestors(element, cache) { |
| 4072 | 4122 | const cachedResult = cache.get(element); |
| 4073 | 4123 | if (cachedResult) { |
| 4074 | 4124 | return cachedResult; |
| @@ -4073,22 +4123,20 @@ | ||
| 4073 | 4123 | if (cachedResult) { |
| 4074 | 4124 | return cachedResult; |
| 4075 | 4125 | } |
| 4076 | 4126 | let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); |
| 4077 | - let currentContainingBlockComputedStyle = null; | |
| 4127 | + let lastKeptComputedStyle = null; | |
| 4078 | 4128 | const elementIsFixed = getComputedStyle2(element).position === "fixed"; |
| 4079 | 4129 | let currentNode = elementIsFixed ? getParentNode(element) : element; |
| 4080 | 4130 | while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { |
| 4081 | 4131 | const computedStyle = getComputedStyle2(currentNode); |
| 4082 | 4132 | const currentNodeIsContaining = isContainingBlock(currentNode); |
| 4083 | - if (!currentNodeIsContaining && computedStyle.position === "fixed") { | |
| 4084 | - currentContainingBlockComputedStyle = null; | |
| 4085 | - } | |
| 4086 | - const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); | |
| 4133 | + const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; | |
| 4134 | + const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); | |
| 4087 | 4135 | if (shouldDropCurrentNode) { |
| 4088 | 4136 | result = result.filter((ancestor) => ancestor !== currentNode); |
| 4089 | 4137 | } else { |
| 4090 | - currentContainingBlockComputedStyle = computedStyle; | |
| 4138 | + lastKeptComputedStyle = computedStyle; | |
| 4091 | 4139 | } |
| 4092 | 4140 | currentNode = getParentNode(currentNode); |
| 4093 | 4141 | } |
| 4094 | 4142 | cache.set(element, result); |
| @@ -4141,12 +4189,9 @@ | ||
| 4141 | 4189 | scrollLeft: 0, |
| 4142 | 4190 | scrollTop: 0 |
| 4143 | 4191 | }; |
| 4144 | 4192 | const offsets = createCoords(0); |
| 4145 | - function setLeftRTLScrollbarOffset() { | |
| 4146 | - offsets.x = getWindowScrollBarX(documentElement); | |
| 4147 | - } | |
| 4148 | - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { | |
| 4193 | + if (isOffsetParentAnElement || !isFixed) { | |
| 4149 | 4194 | if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { |
| 4150 | 4195 | scroll = getNodeScroll(offsetParent); |
| 4151 | 4196 | } |
| 4152 | 4197 | if (isOffsetParentAnElement) { |
| @@ -4152,14 +4197,12 @@ | ||
| 4152 | 4197 | if (isOffsetParentAnElement) { |
| 4153 | 4198 | const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); |
| 4154 | 4199 | offsets.x = offsetRect.x + offsetParent.clientLeft; |
| 4155 | 4200 | offsets.y = offsetRect.y + offsetParent.clientTop; |
| 4156 | - } else if (documentElement) { | |
| 4157 | - setLeftRTLScrollbarOffset(); | |
| 4158 | 4201 | } |
| 4159 | 4202 | } |
| 4160 | - if (isFixed && !isOffsetParentAnElement && documentElement) { | |
| 4161 | - setLeftRTLScrollbarOffset(); | |
| 4203 | + if (!isOffsetParentAnElement && documentElement) { | |
| 4204 | + offsets.x = getWindowScrollBarX(documentElement); | |
| 4162 | 4205 | } |
| 4163 | 4206 | const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); |
| 4164 | 4207 | const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; |
| 4165 | 4208 | const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; |
| @@ -4241,9 +4284,9 @@ | ||
| 4241 | 4284 | }; |
| 4242 | 4285 | function rectsAreEqual(a, b) { |
| 4243 | 4286 | return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; |
| 4244 | 4287 | } |
| 4245 | - function observeMove(element, onMove) { | |
| 4288 | + function observeMove(element, onMove, ancestorResize) { | |
| 4246 | 4289 | let io = null; |
| 4247 | 4290 | let timeoutId; |
| 4248 | 4291 | const root = getDocumentElement(element); |
| 4249 | 4292 | function cleanup() { |
| @@ -4284,8 +4327,11 @@ | ||
| 4284 | 4327 | }; |
| 4285 | 4328 | let isFirstUpdate = true; |
| 4286 | 4329 | function handleObserve(entries) { |
| 4287 | 4330 | const ratio = entries[0].intersectionRatio; |
| 4331 | + if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | |
| 4332 | + return refresh(); | |
| 4333 | + } | |
| 4288 | 4334 | if (ratio !== threshold) { |
| 4289 | 4335 | if (!isFirstUpdate) { |
| 4290 | 4336 | return refresh(); |
| 4291 | 4337 | } |
| @@ -4296,11 +4342,8 @@ | ||
| 4296 | 4342 | } else { |
| 4297 | 4343 | refresh(false, ratio); |
| 4298 | 4344 | } |
| 4299 | 4345 | } |
| 4300 | - if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { | |
| 4301 | - refresh(); | |
| 4302 | - } | |
| 4303 | 4346 | isFirstUpdate = false; |
| 4304 | 4347 | } |
| 4305 | 4348 | try { |
| 4306 | 4349 | io = new IntersectionObserver(handleObserve, { |
| @@ -4312,10 +4355,16 @@ | ||
| 4312 | 4355 | io = new IntersectionObserver(handleObserve, options); |
| 4313 | 4356 | } |
| 4314 | 4357 | io.observe(element); |
| 4315 | 4358 | } |
| 4359 | + const win = getWindow(element); | |
| 4360 | + const handleResize = () => refresh(ancestorResize); | |
| 4361 | + win.addEventListener("resize", handleResize); | |
| 4316 | 4362 | refresh(true); |
| 4317 | - return cleanup; | |
| 4363 | + return () => { | |
| 4364 | + win.removeEventListener("resize", handleResize); | |
| 4365 | + cleanup(); | |
| 4366 | + }; | |
| 4318 | 4367 | } |
| 4319 | 4368 | function autoUpdate(reference, floating, update2, options) { |
| 4320 | 4369 | if (options === void 0) { |
| 4321 | 4370 | options = {}; |
| @@ -4329,14 +4378,12 @@ | ||
| 4329 | 4378 | } = options; |
| 4330 | 4379 | const referenceEl = unwrapElement(reference); |
| 4331 | 4380 | const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; |
| 4332 | 4381 | ancestors.forEach((ancestor) => { |
| 4333 | - ancestorScroll && ancestor.addEventListener("scroll", update2, { | |
| 4334 | - passive: true | |
| 4335 | - }); | |
| 4382 | + ancestorScroll && ancestor.addEventListener("scroll", update2); | |
| 4336 | 4383 | ancestorResize && ancestor.addEventListener("resize", update2); |
| 4337 | 4384 | }); |
| 4338 | - const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null; | |
| 4385 | + const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null; | |
| 4339 | 4386 | let reobserveFrame = -1; |
| 4340 | 4387 | let resizeObserver = null; |
| 4341 | 4388 | if (elementResize) { |
| 4342 | 4389 | resizeObserver = new ResizeObserver((_ref) => { |
| @@ -4389,17 +4436,14 @@ | ||
| 4389 | 4436 | var offset2 = offset; |
| 4390 | 4437 | var shift2 = shift; |
| 4391 | 4438 | var flip2 = flip; |
| 4392 | 4439 | var size2 = size; |
| 4393 | - var hide2 = hide; | |
| 4394 | 4440 | var limitShift2 = limitShift; |
| 4395 | 4441 | var computePosition2 = (reference, floating, options) => { |
| 4396 | 4442 | const cache = /* @__PURE__ */ new Map(); |
| 4397 | - const mergedOptions = { | |
| 4398 | - platform: platform2, | |
| 4399 | - ...options | |
| 4400 | - }; | |
| 4443 | + const mergedOptions = options != null ? options : {}; | |
| 4401 | 4444 | const platformWithCache = { |
| 4445 | + ...platform2, | |
| 4402 | 4446 | ...mergedOptions.platform, |
| 4403 | 4447 | _c: cache |
| 4404 | 4448 | }; |
| 4405 | 4449 | return computePosition(reference, floating, { |
| @@ -4408,9 +4452,9 @@ | ||
| 4408 | 4452 | }); |
| 4409 | 4453 | }; |
| 4410 | 4454 | |
| 4411 | 4455 | // node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs |
| 4412 | - var React19 = __toESM(require_react(), 1); | |
| 4456 | + var React17 = __toESM(require_react(), 1); | |
| 4413 | 4457 | var import_react2 = __toESM(require_react(), 1); |
| 4414 | 4458 | var ReactDOM3 = __toESM(require_react_dom(), 1); |
| 4415 | 4459 | var isClient = typeof document !== "undefined"; |
| 4416 | 4460 | var noop2 = function noop3() { |
| @@ -4474,9 +4518,9 @@ | ||
| 4474 | 4518 | const dpr = getDPR(element); |
| 4475 | 4519 | return Math.round(value * dpr) / dpr; |
| 4476 | 4520 | } |
| 4477 | 4521 | function useLatestRef(value) { |
| 4478 | - const ref = React19.useRef(value); | |
| 4522 | + const ref = React17.useRef(value); | |
| 4479 | 4523 | index(() => { |
| 4480 | 4524 | ref.current = value; |
| 4481 | 4525 | }); |
| 4482 | 4526 | return ref; |
| @@ -4495,11 +4539,11 @@ | ||
| 4495 | 4539 | floating: externalFloating |
| 4496 | 4540 | } = {}, |
| 4497 | 4541 | transform = true, |
| 4498 | 4542 | whileElementsMounted, |
| 4499 | - open | |
| 4543 | + open: open2 | |
| 4500 | 4544 | } = options; |
| 4501 | - const [data, setData] = React19.useState({ | |
| 4545 | + const [data, setData] = React17.useState({ | |
| 4502 | 4546 | x: 0, |
| 4503 | 4547 | y: 0, |
| 4504 | 4548 | strategy, |
| 4505 | 4549 | placement, |
| @@ -4505,21 +4549,21 @@ | ||
| 4505 | 4549 | placement, |
| 4506 | 4550 | middlewareData: {}, |
| 4507 | 4551 | isPositioned: false |
| 4508 | 4552 | }); |
| 4509 | - const [latestMiddleware, setLatestMiddleware] = React19.useState(middleware); | |
| 4553 | + const [latestMiddleware, setLatestMiddleware] = React17.useState(middleware); | |
| 4510 | 4554 | if (!deepEqual(latestMiddleware, middleware)) { |
| 4511 | 4555 | setLatestMiddleware(middleware); |
| 4512 | 4556 | } |
| 4513 | - const [_reference, _setReference] = React19.useState(null); | |
| 4514 | - const [_floating, _setFloating] = React19.useState(null); | |
| 4515 | - const setReference = React19.useCallback((node) => { | |
| 4557 | + const [_reference, _setReference] = React17.useState(null); | |
| 4558 | + const [_floating, _setFloating] = React17.useState(null); | |
| 4559 | + const setReference = React17.useCallback((node) => { | |
| 4516 | 4560 | if (node !== referenceRef.current) { |
| 4517 | 4561 | referenceRef.current = node; |
| 4518 | 4562 | _setReference(node); |
| 4519 | 4563 | } |
| 4520 | 4564 | }, []); |
| 4521 | - const setFloating = React19.useCallback((node) => { | |
| 4565 | + const setFloating = React17.useCallback((node) => { | |
| 4522 | 4566 | if (node !== floatingRef.current) { |
| 4523 | 4567 | floatingRef.current = node; |
| 4524 | 4568 | _setFloating(node); |
| 4525 | 4569 | } |
| @@ -4525,16 +4569,16 @@ | ||
| 4525 | 4569 | } |
| 4526 | 4570 | }, []); |
| 4527 | 4571 | const referenceEl = externalReference || _reference; |
| 4528 | 4572 | const floatingEl = externalFloating || _floating; |
| 4529 | - const referenceRef = React19.useRef(null); | |
| 4530 | - const floatingRef = React19.useRef(null); | |
| 4531 | - const dataRef = React19.useRef(data); | |
| 4573 | + const referenceRef = React17.useRef(null); | |
| 4574 | + const floatingRef = React17.useRef(null); | |
| 4575 | + const dataRef = React17.useRef(data); | |
| 4532 | 4576 | const hasWhileElementsMounted = whileElementsMounted != null; |
| 4533 | 4577 | const whileElementsMountedRef = useLatestRef(whileElementsMounted); |
| 4534 | 4578 | const platformRef = useLatestRef(platform3); |
| 4535 | - const openRef = useLatestRef(open); | |
| 4536 | - const update2 = React19.useCallback(() => { | |
| 4579 | + const openRef = useLatestRef(open2); | |
| 4580 | + const update2 = React17.useCallback(() => { | |
| 4537 | 4581 | if (!referenceRef.current || !floatingRef.current) { |
| 4538 | 4582 | return; |
| 4539 | 4583 | } |
| 4540 | 4584 | const config = { |
| @@ -4562,9 +4606,9 @@ | ||
| 4562 | 4606 | } |
| 4563 | 4607 | }); |
| 4564 | 4608 | }, [latestMiddleware, placement, strategy, platformRef, openRef]); |
| 4565 | 4609 | index(() => { |
| 4566 | - if (open === false && dataRef.current.isPositioned) { | |
| 4610 | + if (open2 === false && dataRef.current.isPositioned) { | |
| 4567 | 4611 | dataRef.current.isPositioned = false; |
| 4568 | 4612 | setData((data2) => ({ |
| 4569 | 4613 | ...data2, |
| 4570 | 4614 | isPositioned: false |
| @@ -4569,10 +4613,10 @@ | ||
| 4569 | 4613 | ...data2, |
| 4570 | 4614 | isPositioned: false |
| 4571 | 4615 | })); |
| 4572 | 4616 | } |
| 4573 | - }, [open]); | |
| 4574 | - const isMountedRef = React19.useRef(false); | |
| 4617 | + }, [open2]); | |
| 4618 | + const isMountedRef = React17.useRef(false); | |
| 4575 | 4619 | index(() => { |
| 4576 | 4620 | isMountedRef.current = true; |
| 4577 | 4621 | return () => { |
| 4578 | 4622 | isMountedRef.current = false; |
| @@ -4587,19 +4631,19 @@ | ||
| 4587 | 4631 | } |
| 4588 | 4632 | update2(); |
| 4589 | 4633 | } |
| 4590 | 4634 | }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); |
| 4591 | - const refs = React19.useMemo(() => ({ | |
| 4635 | + const refs = React17.useMemo(() => ({ | |
| 4592 | 4636 | reference: referenceRef, |
| 4593 | 4637 | floating: floatingRef, |
| 4594 | 4638 | setReference, |
| 4595 | 4639 | setFloating |
| 4596 | 4640 | }), [setReference, setFloating]); |
| 4597 | - const elements = React19.useMemo(() => ({ | |
| 4641 | + const elements = React17.useMemo(() => ({ | |
| 4598 | 4642 | reference: referenceEl, |
| 4599 | 4643 | floating: floatingEl |
| 4600 | 4644 | }), [referenceEl, floatingEl]); |
| 4601 | - const floatingStyles = React19.useMemo(() => { | |
| 4645 | + const floatingStyles = React17.useMemo(() => { | |
| 4602 | 4646 | const initialStyles = { |
| 4603 | 4647 | position: strategy, |
| 4604 | 4648 | left: 0, |
| 4605 | 4649 | top: 0 |
| @@ -4623,9 +4667,9 @@ | ||
| 4623 | 4667 | left: x, |
| 4624 | 4668 | top: y |
| 4625 | 4669 | }; |
| 4626 | 4670 | }, [strategy, transform, elements.floating, data.x, data.y]); |
| 4627 | - return React19.useMemo(() => ({ | |
| 4671 | + return React17.useMemo(() => ({ | |
| 4628 | 4672 | ...data, |
| 4629 | 4673 | update: update2, |
| 4630 | 4674 | refs, |
| 4631 | 4675 | elements, |
| @@ -4670,83 +4714,184 @@ | ||
| 4670 | 4714 | fn: result.fn, |
| 4671 | 4715 | options: [options, deps] |
| 4672 | 4716 | }; |
| 4673 | 4717 | }; |
| 4674 | - var hide3 = (options, deps) => { | |
| 4675 | - const result = hide2(options); | |
| 4676 | - return { | |
| 4677 | - name: result.name, | |
| 4678 | - fn: result.fn, | |
| 4679 | - options: [options, deps] | |
| 4680 | - }; | |
| 4718 | + | |
| 4719 | + // node_modules/@base-ui/react/utils/popups/popupHandle.mjs | |
| 4720 | + var BasePopupHandle = class { | |
| 4721 | + /** | |
| 4722 | + * Stores of every root currently using this handle, in attach order. A handle is meant to be used | |
| 4723 | + * by a single mounted root, but roots can transiently overlap (e.g. during an animated route | |
| 4724 | + * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of | |
| 4725 | + * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. | |
| 4726 | + */ | |
| 4727 | + attachedStores = []; | |
| 4728 | + /** | |
| 4729 | + * Store of the root that currently controls the handle: the most recently attached one still | |
| 4730 | + * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. | |
| 4731 | + */ | |
| 4732 | + attachedStoreValue = null; | |
| 4733 | + /** | |
| 4734 | + * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. | |
| 4735 | + */ | |
| 4736 | + storeListeners = /* @__PURE__ */ new Set(); | |
| 4737 | + /** | |
| 4738 | + * Creates a handle backed by the store used while no root is attached. | |
| 4739 | + * | |
| 4740 | + * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, | |
| 4741 | + * so they can render and register without a mounted root. Triggers register into whichever store | |
| 4742 | + * `store` currently resolves to, so while detached they live in this store's trigger map and | |
| 4743 | + * migrate themselves to the root's store (and back) as it attaches/detaches. | |
| 4744 | + * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces | |
| 4745 | + * `MenuHandle.open()` in warning text. | |
| 4746 | + * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is | |
| 4747 | + * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, | |
| 4748 | + * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. | |
| 4749 | + */ | |
| 4750 | + constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { | |
| 4751 | + this.fallbackStore = fallbackStore; | |
| 4752 | + this.componentName = componentName; | |
| 4753 | + this.throwOnMissingTrigger = throwOnMissingTrigger; | |
| 4754 | + } | |
| 4755 | + get attachedStore() { | |
| 4756 | + return this.attachedStoreValue; | |
| 4757 | + } | |
| 4758 | + /** | |
| 4759 | + * Store that detached triggers read from: the attached root's store, or an inert fallback store | |
| 4760 | + * used while no root is attached. | |
| 4761 | + * @internal | |
| 4762 | + */ | |
| 4763 | + get store() { | |
| 4764 | + return this.attachedStoreValue ?? this.fallbackStore; | |
| 4765 | + } | |
| 4766 | + /** | |
| 4767 | + * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on | |
| 4768 | + * the handle during render because a handle can be shared by concurrent server-rendered requests. | |
| 4769 | + * @internal | |
| 4770 | + */ | |
| 4771 | + get serverStore() { | |
| 4772 | + return this.fallbackStore; | |
| 4773 | + } | |
| 4774 | + /** | |
| 4775 | + * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind | |
| 4776 | + * when a root attaches or detaches. Returns a function that removes the listener. | |
| 4777 | + * @internal | |
| 4778 | + */ | |
| 4779 | + subscribeStore(listener) { | |
| 4780 | + this.storeListeners.add(listener); | |
| 4781 | + return () => { | |
| 4782 | + this.storeListeners.delete(listener); | |
| 4783 | + }; | |
| 4784 | + } | |
| 4785 | + /** | |
| 4786 | + * Points the handle at a root's store and notifies subscribers so detached triggers re-render and | |
| 4787 | + * re-register into it (their registration effect migrates them when the store pointer changes). | |
| 4788 | + * Returns a cleanup function that detaches the store again. | |
| 4789 | + * @internal | |
| 4790 | + */ | |
| 4791 | + attachStore(newStore) { | |
| 4792 | + this.attachedStores.push(newStore); | |
| 4793 | + this.setActiveStore(newStore); | |
| 4794 | + if (true) { | |
| 4795 | + if (this.attachedStores.length > 1) { | |
| 4796 | + const dev = this; | |
| 4797 | + (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { | |
| 4798 | + if (this.attachedStores.length > 1) { | |
| 4799 | + console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle."); | |
| 4800 | + } | |
| 4801 | + }); | |
| 4802 | + } | |
| 4803 | + } | |
| 4804 | + return () => { | |
| 4805 | + const index2 = this.attachedStores.lastIndexOf(newStore); | |
| 4806 | + if (index2 !== -1) { | |
| 4807 | + this.attachedStores.splice(index2, 1); | |
| 4808 | + } | |
| 4809 | + this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); | |
| 4810 | + }; | |
| 4811 | + } | |
| 4812 | + /** | |
| 4813 | + * Sets the store that currently controls the handle and notifies subscribers when it changes, so | |
| 4814 | + * detached triggers re-render and migrate their registration to the new store. | |
| 4815 | + */ | |
| 4816 | + setActiveStore(store2) { | |
| 4817 | + if (this.attachedStoreValue !== store2) { | |
| 4818 | + this.attachedStoreValue = store2; | |
| 4819 | + this.storeListeners.forEach((listener) => { | |
| 4820 | + listener(); | |
| 4821 | + }); | |
| 4822 | + } | |
| 4823 | + } | |
| 4824 | + /** | |
| 4825 | + * Opens the attached root's store and associates it with the trigger with the given id, or a | |
| 4826 | + * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public | |
| 4827 | + * `open()` method, which only narrows the parameter type. | |
| 4828 | + * | |
| 4829 | + * When a trigger id is given but no matching trigger is registered, anchored popups throw (see | |
| 4830 | + * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. | |
| 4831 | + * | |
| 4832 | + * This method should only be called in an event handler or an effect (not during rendering). | |
| 4833 | + * | |
| 4834 | + * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open | |
| 4835 | + * without associating any trigger. | |
| 4836 | + */ | |
| 4837 | + openByTrigger(triggerId) { | |
| 4838 | + const attachedStore = this.attachedStore; | |
| 4839 | + if (attachedStore === null) { | |
| 4840 | + if (true) { | |
| 4841 | + console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`); | |
| 4842 | + } | |
| 4843 | + return; | |
| 4844 | + } | |
| 4845 | + let triggerElement; | |
| 4846 | + if (triggerId) { | |
| 4847 | + for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { | |
| 4848 | + triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); | |
| 4849 | + } | |
| 4850 | + triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); | |
| 4851 | + } | |
| 4852 | + if (triggerId && !triggerElement) { | |
| 4853 | + if (this.throwOnMissingTrigger) { | |
| 4854 | + throw new Error(true ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName)); | |
| 4855 | + } | |
| 4856 | + if (true) { | |
| 4857 | + console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`); | |
| 4858 | + } | |
| 4859 | + } | |
| 4860 | + attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); | |
| 4861 | + } | |
| 4862 | + /** | |
| 4863 | + * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) | |
| 4864 | + * while no root is attached. Shared by every concrete handle's public `close()` method. | |
| 4865 | + * | |
| 4866 | + * This method should only be called in an event handler or an effect (not during rendering). | |
| 4867 | + */ | |
| 4868 | + closePopup() { | |
| 4869 | + const attachedStore = this.attachedStore; | |
| 4870 | + if (attachedStore === null) { | |
| 4871 | + if (true) { | |
| 4872 | + console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); | |
| 4873 | + } | |
| 4874 | + return; | |
| 4875 | + } | |
| 4876 | + attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); | |
| 4877 | + } | |
| 4681 | 4878 | }; |
| 4682 | 4879 | |
| 4683 | 4880 | // node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs |
| 4684 | - var React24 = __toESM(require_react(), 1); | |
| 4881 | + var React22 = __toESM(require_react(), 1); | |
| 4685 | 4882 | var ReactDOM4 = __toESM(require_react_dom(), 1); |
| 4686 | 4883 | |
| 4687 | 4884 | // node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs |
| 4688 | - var React23 = __toESM(require_react(), 1); | |
| 4885 | + var React21 = __toESM(require_react(), 1); | |
| 4689 | 4886 | |
| 4690 | - // node_modules/@base-ui/utils/store/createSelector.mjs | |
| 4691 | - var createSelector = (a, b, c, d, e, f, ...other) => { | |
| 4692 | - if (other.length > 0) { | |
| 4693 | - throw new Error(true ? "Unsupported number of selectors" : formatErrorMessage_default(1)); | |
| 4694 | - } | |
| 4695 | - let selector; | |
| 4696 | - if (a && b && c && d && e && f) { | |
| 4697 | - selector = (state, a1, a2, a3) => { | |
| 4698 | - const va = a(state, a1, a2, a3); | |
| 4699 | - const vb = b(state, a1, a2, a3); | |
| 4700 | - const vc = c(state, a1, a2, a3); | |
| 4701 | - const vd = d(state, a1, a2, a3); | |
| 4702 | - const ve = e(state, a1, a2, a3); | |
| 4703 | - return f(va, vb, vc, vd, ve, a1, a2, a3); | |
| 4704 | - }; | |
| 4705 | - } else if (a && b && c && d && e) { | |
| 4706 | - selector = (state, a1, a2, a3) => { | |
| 4707 | - const va = a(state, a1, a2, a3); | |
| 4708 | - const vb = b(state, a1, a2, a3); | |
| 4709 | - const vc = c(state, a1, a2, a3); | |
| 4710 | - const vd = d(state, a1, a2, a3); | |
| 4711 | - return e(va, vb, vc, vd, a1, a2, a3); | |
| 4712 | - }; | |
| 4713 | - } else if (a && b && c && d) { | |
| 4714 | - selector = (state, a1, a2, a3) => { | |
| 4715 | - const va = a(state, a1, a2, a3); | |
| 4716 | - const vb = b(state, a1, a2, a3); | |
| 4717 | - const vc = c(state, a1, a2, a3); | |
| 4718 | - return d(va, vb, vc, a1, a2, a3); | |
| 4719 | - }; | |
| 4720 | - } else if (a && b && c) { | |
| 4721 | - selector = (state, a1, a2, a3) => { | |
| 4722 | - const va = a(state, a1, a2, a3); | |
| 4723 | - const vb = b(state, a1, a2, a3); | |
| 4724 | - return c(va, vb, a1, a2, a3); | |
| 4725 | - }; | |
| 4726 | - } else if (a && b) { | |
| 4727 | - selector = (state, a1, a2, a3) => { | |
| 4728 | - const va = a(state, a1, a2, a3); | |
| 4729 | - return b(va, a1, a2, a3); | |
| 4730 | - }; | |
| 4731 | - } else if (a) { | |
| 4732 | - selector = a; | |
| 4733 | - } else { | |
| 4734 | - throw ( | |
| 4735 | - /* minify-error-disabled */ | |
| 4736 | - new Error("Missing arguments") | |
| 4737 | - ); | |
| 4738 | - } | |
| 4739 | - return selector; | |
| 4740 | - }; | |
| 4741 | - | |
| 4742 | 4887 | // node_modules/@base-ui/utils/store/useStore.mjs |
| 4743 | - var React21 = __toESM(require_react(), 1); | |
| 4888 | + var React19 = __toESM(require_react(), 1); | |
| 4744 | 4889 | var import_shim = __toESM(require_shim(), 1); |
| 4745 | 4890 | var import_with_selector = __toESM(require_with_selector(), 1); |
| 4746 | 4891 | |
| 4747 | 4892 | // node_modules/@base-ui/utils/fastHooks.mjs |
| 4748 | - var React20 = __toESM(require_react(), 1); | |
| 4893 | + var React18 = __toESM(require_react(), 1); | |
| 4749 | 4894 | var hooks = []; |
| 4750 | 4895 | var currentInstance = void 0; |
| 4751 | 4896 | function getInstance() { |
| 4752 | 4897 | return currentInstance; |
| @@ -4776,9 +4921,9 @@ | ||
| 4776 | 4921 | FastComponent.displayName = fn.displayName || fn.name; |
| 4777 | 4922 | return FastComponent; |
| 4778 | 4923 | } |
| 4779 | 4924 | function fastComponentRef(fn) { |
| 4780 | - return /* @__PURE__ */ React20.forwardRef(fastComponent(fn)); | |
| 4925 | + return /* @__PURE__ */ React18.forwardRef(fastComponent(fn)); | |
| 4781 | 4926 | } |
| 4782 | 4927 | function createInstance() { |
| 4783 | 4928 | return { |
| 4784 | 4929 | didInitialize: false |
| @@ -4791,9 +4936,9 @@ | ||
| 4791 | 4936 | function useStore(store2, selector, a1, a2, a3) { |
| 4792 | 4937 | return useStoreImplementation(store2, selector, a1, a2, a3); |
| 4793 | 4938 | } |
| 4794 | 4939 | function useStoreR19(store2, selector, a1, a2, a3) { |
| 4795 | - const getSelection = React21.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]); | |
| 4940 | + const getSelection = React19.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]); | |
| 4796 | 4941 | return (0, import_shim.useSyncExternalStore)(store2.subscribe, getSelection, getSelection); |
| 4797 | 4942 | } |
| 4798 | 4943 | register({ |
| 4799 | 4944 | before(instance) { |
| @@ -4883,8 +5028,16 @@ | ||
| 4883 | 5028 | |
| 4884 | 5029 | // node_modules/@base-ui/utils/store/Store.mjs |
| 4885 | 5030 | var Store = class { |
| 4886 | 5031 | /** |
| 5032 | + * Creates a store with the given initial state, constructing the class it is called on. | |
| 5033 | + * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that | |
| 5034 | + * class but degrades the inferred instance type to `Store`; use `new` there instead. | |
| 5035 | + */ | |
| 5036 | + static create(state) { | |
| 5037 | + return new this(state); | |
| 5038 | + } | |
| 5039 | + /** | |
| 4887 | 5040 | * The current state of the store. |
| 4888 | 5041 | * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. |
| 4889 | 5042 | * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState). |
| 4890 | 5043 | * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. |
| @@ -4935,8 +5088,10 @@ | ||
| 4935 | 5088 | } |
| 4936 | 5089 | } |
| 4937 | 5090 | /** |
| 4938 | 5091 | * Merges the provided changes into the current state and notifies listeners if there are changes. |
| 5092 | + * Each value must match its state key. Pass an exact known subset rather than a broad | |
| 5093 | + * `Partial<State>`, which may contain `undefined` for required state fields. | |
| 4939 | 5094 | * |
| 4940 | 5095 | * @param changes An object containing the changes to apply to the current state. |
| 4941 | 5096 | */ |
| 4942 | 5097 | update(changes) { |
| @@ -4978,9 +5133,9 @@ | ||
| 4978 | 5133 | } |
| 4979 | 5134 | }; |
| 4980 | 5135 | |
| 4981 | 5136 | // node_modules/@base-ui/utils/store/ReactStore.mjs |
| 4982 | - var React22 = __toESM(require_react(), 1); | |
| 5137 | + var React20 = __toESM(require_react(), 1); | |
| 4983 | 5138 | var ReactStore = class extends Store { |
| 4984 | 5139 | /** |
| 4985 | 5140 | * Creates a new ReactStore instance. |
| 4986 | 5141 | * |
| @@ -5002,9 +5157,9 @@ | ||
| 5002 | 5157 | * Note that the while the value in `state` is updated immediately, the value returned |
| 5003 | 5158 | * by `useState` is updated before the next render (similarly to React's `useState`). |
| 5004 | 5159 | */ |
| 5005 | 5160 | useSyncedValue(key, value) { |
| 5006 | - React22.useDebugValue(key); | |
| 5161 | + React20.useDebugValue(key); | |
| 5007 | 5162 | const store2 = this; |
| 5008 | 5163 | useIsoLayoutEffect(() => { |
| 5009 | 5164 | if (store2.state[key] !== value) { |
| 5010 | 5165 | store2.set(key, value); |
| @@ -5030,17 +5185,21 @@ | ||
| 5030 | 5185 | }, [store2, key, value]); |
| 5031 | 5186 | } |
| 5032 | 5187 | /** |
| 5033 | 5188 | * Synchronizes multiple external values into the store. |
| 5189 | + * Each value must match its state key. Pass an exact known subset rather than a broad | |
| 5190 | + * `Partial<State>`, which may contain `undefined` for required state fields. | |
| 5034 | 5191 | * |
| 5035 | 5192 | * Note that the while the values in `state` are updated immediately, the values returned |
| 5036 | 5193 | * by `useState` are updated before the next render (similarly to React's `useState`). |
| 5194 | + * | |
| 5195 | + * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted. | |
| 5037 | 5196 | */ |
| 5038 | 5197 | useSyncedValues(statePart) { |
| 5039 | 5198 | const store2 = this; |
| 5040 | 5199 | if (true) { |
| 5041 | - React22.useDebugValue(statePart, (p) => Object.keys(p)); | |
| 5042 | - const keys = React22.useRef(Object.keys(statePart)).current; | |
| 5200 | + React20.useDebugValue(statePart, (p) => Object.keys(p)); | |
| 5201 | + const keys = React20.useRef(Object.keys(statePart)).current; | |
| 5043 | 5202 | const nextKeys = Object.keys(statePart); |
| 5044 | 5203 | if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { |
| 5045 | 5204 | console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); |
| 5046 | 5205 | } |
| @@ -5054,9 +5213,9 @@ | ||
| 5054 | 5213 | * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` |
| 5055 | 5214 | * is non-undefined, the store's state at `key` is updated to match `controlled`. |
| 5056 | 5215 | */ |
| 5057 | 5216 | useControlledProp(key, controlled) { |
| 5058 | - React22.useDebugValue(key); | |
| 5217 | + React20.useDebugValue(key); | |
| 5059 | 5218 | const store2 = this; |
| 5060 | 5219 | const isControlled = controlled !== void 0; |
| 5061 | 5220 | useIsoLayoutEffect(() => { |
| 5062 | 5221 | if (isControlled && !Object.is(store2.state[key], controlled)) { |
| @@ -5092,9 +5251,9 @@ | ||
| 5092 | 5251 | * |
| 5093 | 5252 | * @param key Key of the selector to use. |
| 5094 | 5253 | */ |
| 5095 | 5254 | useState(key, a1, a2, a3) { |
| 5096 | - React22.useDebugValue(key); | |
| 5255 | + React20.useDebugValue(key); | |
| 5097 | 5256 | return useStore(this, this.selectors[key], a1, a2, a3); |
| 5098 | 5257 | } |
| 5099 | 5258 | /** |
| 5100 | 5259 | * Wraps a function with `useStableCallback` to ensure it has a stable reference |
| @@ -5103,9 +5262,9 @@ | ||
| 5103 | 5262 | * @param key Key of the event callback. Must be a function in the context. |
| 5104 | 5263 | * @param fn Function to assign. |
| 5105 | 5264 | */ |
| 5106 | 5265 | useContextCallback(key, fn) { |
| 5107 | - React22.useDebugValue(key); | |
| 5266 | + React20.useDebugValue(key); | |
| 5108 | 5267 | const stableFunction = useStableCallback(fn ?? NOOP); |
| 5109 | 5268 | this.context[key] = stableFunction; |
| 5110 | 5269 | } |
| 5111 | 5270 | /** |
| @@ -5114,9 +5273,9 @@ | ||
| 5114 | 5273 | * |
| 5115 | 5274 | * @param key Key of the state to set. |
| 5116 | 5275 | */ |
| 5117 | 5276 | useStateSetter(key) { |
| 5118 | - const ref = React22.useRef(void 0); | |
| 5277 | + const ref = React20.useRef(void 0); | |
| 5119 | 5278 | if (ref.current === void 0) { |
| 5120 | 5279 | ref.current = (value) => { |
| 5121 | 5280 | this.set(key, value); |
| 5122 | 5281 | }; |
| @@ -5150,14 +5309,14 @@ | ||
| 5150 | 5309 | }; |
| 5151 | 5310 | |
| 5152 | 5311 | // node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs |
| 5153 | 5312 | var selectors = { |
| 5154 | - open: createSelector((state) => state.open), | |
| 5155 | - transitionStatus: createSelector((state) => state.transitionStatus), | |
| 5156 | - domReferenceElement: createSelector((state) => state.domReferenceElement), | |
| 5157 | - referenceElement: createSelector((state) => state.positionReference ?? state.referenceElement), | |
| 5158 | - floatingElement: createSelector((state) => state.floatingElement), | |
| 5159 | - floatingId: createSelector((state) => state.floatingId) | |
| 5313 | + open: (state) => state.open, | |
| 5314 | + transitionStatus: (state) => state.transitionStatus, | |
| 5315 | + domReferenceElement: (state) => state.domReferenceElement, | |
| 5316 | + referenceElement: (state) => state.positionReference ?? state.referenceElement, | |
| 5317 | + floatingElement: (state) => state.floatingElement, | |
| 5318 | + floatingId: (state) => state.floatingId | |
| 5160 | 5319 | }; |
| 5161 | 5320 | var FloatingRootStore = class extends ReactStore { |
| 5162 | 5321 | constructor(options) { |
| 5163 | 5322 | const { |
| @@ -5231,17 +5390,17 @@ | ||
| 5231 | 5390 | floatingId, |
| 5232 | 5391 | nested, |
| 5233 | 5392 | onOpenChange |
| 5234 | 5393 | } = options; |
| 5235 | - const open = popupStore.useState("open"); | |
| 5394 | + const open2 = popupStore.useState("open"); | |
| 5236 | 5395 | const referenceElement = popupStore.useState("activeTriggerElement"); |
| 5237 | 5396 | const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); |
| 5238 | 5397 | const triggerElements = popupStore.context.triggerElements; |
| 5239 | 5398 | const handleOpenChange = onOpenChange; |
| 5240 | - const internalStoreRef = React23.useRef(null); | |
| 5399 | + const internalStoreRef = React21.useRef(null); | |
| 5241 | 5400 | if (floatingRootContextProp === void 0 && internalStoreRef.current === null) { |
| 5242 | 5401 | internalStoreRef.current = new FloatingRootStore({ |
| 5243 | - open, | |
| 5402 | + open: open2, | |
| 5244 | 5403 | transitionStatus: void 0, |
| 5245 | 5404 | referenceElement, |
| 5246 | 5405 | floatingElement, |
| 5247 | 5406 | triggerElements, |
| @@ -5254,9 +5413,9 @@ | ||
| 5254 | 5413 | const store2 = floatingRootContextProp ?? internalStoreRef.current; |
| 5255 | 5414 | popupStore.useSyncedValue("floatingId", floatingId); |
| 5256 | 5415 | useIsoLayoutEffect(() => { |
| 5257 | 5416 | const valuesToSync = { |
| 5258 | - open, | |
| 5417 | + open: open2, | |
| 5259 | 5418 | floatingId, |
| 5260 | 5419 | referenceElement, |
| 5261 | 5420 | floatingElement |
| 5262 | 5421 | }; |
| @@ -5266,9 +5425,9 @@ | ||
| 5266 | 5425 | if (store2.state.positionReference === store2.state.referenceElement) { |
| 5267 | 5426 | valuesToSync.positionReference = referenceElement; |
| 5268 | 5427 | } |
| 5269 | 5428 | store2.update(valuesToSync); |
| 5270 | - }, [open, floatingId, referenceElement, floatingElement, store2]); | |
| 5429 | + }, [open2, floatingId, referenceElement, floatingElement, store2]); | |
| 5271 | 5430 | store2.context.onOpenChange = handleOpenChange; |
| 5272 | 5431 | store2.context.nested = nested; |
| 5273 | 5432 | return store2; |
| 5274 | 5433 | } |
| @@ -5277,16 +5436,12 @@ | ||
| 5277 | 5436 | var FOCUSABLE_POPUP_PROPS = { |
| 5278 | 5437 | tabIndex: -1, |
| 5279 | 5438 | [FOCUSABLE_ATTRIBUTE]: "" |
| 5280 | 5439 | }; |
| 5281 | - function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) { | |
| 5440 | + function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { | |
| 5282 | 5441 | const floatingId = useId(); |
| 5283 | 5442 | const nested = useFloatingParentNodeId() != null; |
| 5284 | - const internalStoreRef = React24.useRef(null); | |
| 5285 | - if (externalStore === void 0 && internalStoreRef.current === null) { | |
| 5286 | - internalStoreRef.current = createStore(floatingId, nested); | |
| 5287 | - } | |
| 5288 | - const store2 = externalStore ?? internalStoreRef.current; | |
| 5443 | + const store2 = useRefWithInit(() => createStore(floatingId, nested)).current; | |
| 5289 | 5444 | useSyncedFloatingRootContext({ |
| 5290 | 5445 | popupStore: store2, |
| 5291 | 5446 | treatPopupAsFloatingElement, |
| 5292 | 5447 | floatingRootContext: store2.state.floatingRootContext, |
| @@ -5293,57 +5448,71 @@ | ||
| 5293 | 5448 | floatingId, |
| 5294 | 5449 | nested, |
| 5295 | 5450 | onOpenChange: store2.setOpen |
| 5296 | 5451 | }); |
| 5297 | - return { | |
| 5298 | - store: store2, | |
| 5299 | - internalStore: internalStoreRef.current | |
| 5300 | - }; | |
| 5452 | + return store2; | |
| 5301 | 5453 | } |
| 5454 | + function PopupHandleAttachment({ | |
| 5455 | + handle, | |
| 5456 | + store: store2 | |
| 5457 | + }) { | |
| 5458 | + useIsoLayoutEffect(() => { | |
| 5459 | + return handle.attachStore(store2); | |
| 5460 | + }, [handle, store2]); | |
| 5461 | + return null; | |
| 5462 | + } | |
| 5463 | + function syncTriggerCount(store2) { | |
| 5464 | + const triggerCount = store2.context.triggerElements.size; | |
| 5465 | + if (store2.select("open") && store2.state.triggerCount !== triggerCount) { | |
| 5466 | + store2.set("triggerCount", triggerCount); | |
| 5467 | + } | |
| 5468 | + } | |
| 5302 | 5469 | function useTriggerRegistration(id, store2) { |
| 5303 | - const registeredElementIdRef = React24.useRef(null); | |
| 5304 | - const registeredElementRef = React24.useRef(null); | |
| 5305 | - return React24.useCallback((element) => { | |
| 5306 | - if (id === void 0) { | |
| 5307 | - return; | |
| 5308 | - } | |
| 5309 | - let shouldSyncTriggerCount = false; | |
| 5310 | - if (registeredElementIdRef.current !== null) { | |
| 5311 | - const registeredId = registeredElementIdRef.current; | |
| 5312 | - const registeredElement = registeredElementRef.current; | |
| 5313 | - const currentElement = store2.context.triggerElements.getById(registeredId); | |
| 5314 | - if (registeredElement && currentElement === registeredElement) { | |
| 5315 | - store2.context.triggerElements.delete(registeredId); | |
| 5316 | - shouldSyncTriggerCount = true; | |
| 5470 | + const registrationRef = React22.useRef(null); | |
| 5471 | + return useStableCallback((element) => { | |
| 5472 | + const registration = registrationRef.current; | |
| 5473 | + if (registration !== null) { | |
| 5474 | + if (registration.element === element && registration.store === store2 && registration.id === id) { | |
| 5475 | + return; | |
| 5317 | 5476 | } |
| 5318 | - registeredElementIdRef.current = null; | |
| 5319 | - registeredElementRef.current = null; | |
| 5477 | + registrationRef.current = null; | |
| 5478 | + const registeredStore = registration.store; | |
| 5479 | + if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { | |
| 5480 | + registeredStore.context.triggerElements.delete(registration.id); | |
| 5481 | + syncTriggerCount(registeredStore); | |
| 5482 | + } | |
| 5320 | 5483 | } |
| 5321 | - if (element !== null) { | |
| 5322 | - registeredElementIdRef.current = id; | |
| 5323 | - registeredElementRef.current = element; | |
| 5484 | + if (element !== null && id !== void 0) { | |
| 5485 | + registrationRef.current = { | |
| 5486 | + store: store2, | |
| 5487 | + id, | |
| 5488 | + element | |
| 5489 | + }; | |
| 5324 | 5490 | store2.context.triggerElements.add(id, element); |
| 5325 | - shouldSyncTriggerCount = true; | |
| 5491 | + syncTriggerCount(store2); | |
| 5326 | 5492 | } |
| 5327 | - if (shouldSyncTriggerCount) { | |
| 5328 | - const triggerCount = store2.context.triggerElements.size; | |
| 5329 | - if (store2.select("open") && store2.state.triggerCount !== triggerCount) { | |
| 5330 | - store2.set("triggerCount", triggerCount); | |
| 5331 | - } | |
| 5332 | - } | |
| 5333 | - }, [store2, id]); | |
| 5493 | + }); | |
| 5334 | 5494 | } |
| 5335 | - function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) { | |
| 5336 | - if (open) { | |
| 5337 | - state.preventUnmountingOnClose = false; | |
| 5495 | + function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) { | |
| 5496 | + let preventUnmountingOnClose = state.preventUnmountingOnClose; | |
| 5497 | + if (open2) { | |
| 5498 | + preventUnmountingOnClose = false; | |
| 5338 | 5499 | } else if (preventUnmountOnClose) { |
| 5339 | - state.preventUnmountingOnClose = true; | |
| 5500 | + preventUnmountingOnClose = true; | |
| 5340 | 5501 | } |
| 5341 | 5502 | const triggerId = trigger?.id ?? null; |
| 5342 | - if (triggerId || open) { | |
| 5343 | - state.activeTriggerId = triggerId; | |
| 5344 | - state.activeTriggerElement = trigger ?? null; | |
| 5503 | + let activeTriggerId = state.activeTriggerId; | |
| 5504 | + let activeTriggerElement = state.activeTriggerElement; | |
| 5505 | + if (triggerId || open2) { | |
| 5506 | + activeTriggerId = triggerId; | |
| 5507 | + activeTriggerElement = trigger ?? null; | |
| 5345 | 5508 | } |
| 5509 | + return { | |
| 5510 | + open: open2, | |
| 5511 | + preventUnmountingOnClose, | |
| 5512 | + activeTriggerId, | |
| 5513 | + activeTriggerElement | |
| 5514 | + }; | |
| 5346 | 5515 | } |
| 5347 | 5516 | function attachPreventUnmountOnClose(eventDetails) { |
| 5348 | 5517 | let preventUnmountOnClose = false; |
| 5349 | 5518 | eventDetails.preventUnmountOnClose = () => { |
| @@ -5363,11 +5532,12 @@ | ||
| 5363 | 5532 | } |
| 5364 | 5533 | options.onBeforeDispatch?.(); |
| 5365 | 5534 | store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); |
| 5366 | 5535 | const changeState = () => { |
| 5536 | + const popupOpenState = createPopupOpenState(store2.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); | |
| 5367 | 5537 | const updatedState = { |
| 5368 | 5538 | ...options.extraState, |
| 5369 | - open: nextOpen | |
| 5539 | + ...popupOpenState | |
| 5370 | 5540 | }; |
| 5371 | 5541 | if (isFocusOpen) { |
| 5372 | 5542 | updatedState.instantType = "focus"; |
| 5373 | 5543 | } else if (isDismissClose) { |
| @@ -5374,9 +5544,8 @@ | ||
| 5374 | 5544 | updatedState.instantType = "dismiss"; |
| 5375 | 5545 | } else if (isHover) { |
| 5376 | 5546 | updatedState.instantType = void 0; |
| 5377 | 5547 | } |
| 5378 | - setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); | |
| 5379 | 5548 | store2.update(updatedState); |
| 5380 | 5549 | }; |
| 5381 | 5550 | if (isHover) { |
| 5382 | 5551 | ReactDOM4.flushSync(changeState); |
| @@ -5383,51 +5552,48 @@ | ||
| 5383 | 5552 | } else { |
| 5384 | 5553 | changeState(); |
| 5385 | 5554 | } |
| 5386 | 5555 | } |
| 5387 | - function useInitialOpenSync(store2, openProp, defaultOpen, defaultTriggerId) { | |
| 5388 | - useOnFirstRender(() => { | |
| 5389 | - if (openProp === void 0 && store2.state.open === false && defaultOpen) { | |
| 5390 | - store2.state = { | |
| 5391 | - ...store2.state, | |
| 5392 | - open: true, | |
| 5393 | - activeTriggerId: defaultTriggerId, | |
| 5394 | - preventUnmountingOnClose: false | |
| 5395 | - }; | |
| 5396 | - } | |
| 5397 | - }); | |
| 5398 | - } | |
| 5399 | 5556 | function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) { |
| 5400 | 5557 | const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId); |
| 5401 | 5558 | const baseRegisterTrigger = useTriggerRegistration(triggerId, store2); |
| 5402 | - const registerTrigger = useStableCallback((element) => { | |
| 5403 | - baseRegisterTrigger(element); | |
| 5404 | - if (!element) { | |
| 5405 | - return; | |
| 5406 | - } | |
| 5407 | - const open = store2.select("open"); | |
| 5559 | + const applyTriggerData = useStableCallback((element) => { | |
| 5560 | + const open2 = store2.select("open"); | |
| 5408 | 5561 | const activeTriggerId = store2.select("activeTriggerId"); |
| 5409 | 5562 | if (activeTriggerId === triggerId) { |
| 5410 | - store2.update({ | |
| 5563 | + const changes = { | |
| 5411 | 5564 | activeTriggerElement: element, |
| 5412 | - ...open ? stateUpdates : null | |
| 5413 | - }); | |
| 5565 | + ...open2 ? stateUpdates : null | |
| 5566 | + }; | |
| 5567 | + store2.update(changes); | |
| 5414 | 5568 | return; |
| 5415 | 5569 | } |
| 5416 | - if (activeTriggerId == null && open) { | |
| 5417 | - store2.update({ | |
| 5418 | - activeTriggerId: triggerId, | |
| 5570 | + if (activeTriggerId == null && open2) { | |
| 5571 | + const changes = { | |
| 5572 | + activeTriggerId: triggerId ?? null, | |
| 5419 | 5573 | activeTriggerElement: element, |
| 5420 | 5574 | ...stateUpdates |
| 5421 | - }); | |
| 5575 | + }; | |
| 5576 | + store2.update(changes); | |
| 5422 | 5577 | } |
| 5423 | 5578 | }); |
| 5579 | + const registerTrigger = useStableCallback((element) => { | |
| 5580 | + baseRegisterTrigger(element); | |
| 5581 | + if (element) { | |
| 5582 | + applyTriggerData(element); | |
| 5583 | + } | |
| 5584 | + }); | |
| 5424 | 5585 | useIsoLayoutEffect(() => { |
| 5586 | + registerTrigger(triggerElementRef.current); | |
| 5587 | + return () => registerTrigger(null); | |
| 5588 | + }, [registerTrigger, triggerElementRef, store2, triggerId]); | |
| 5589 | + useIsoLayoutEffect(() => { | |
| 5425 | 5590 | if (isMountedByThisTrigger) { |
| 5426 | - store2.update({ | |
| 5591 | + const changes = { | |
| 5427 | 5592 | activeTriggerElement: triggerElementRef.current, |
| 5428 | 5593 | ...stateUpdates |
| 5429 | - }); | |
| 5594 | + }; | |
| 5595 | + store2.update(changes); | |
| 5430 | 5596 | } |
| 5431 | 5597 | }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]); |
| 5432 | 5598 | return { |
| 5433 | 5599 | registerTrigger, |
| @@ -5437,12 +5603,16 @@ | ||
| 5437 | 5603 | function useImplicitActiveTrigger(store2, options = {}) { |
| 5438 | 5604 | const { |
| 5439 | 5605 | closeOnActiveTriggerUnmount = false |
| 5440 | 5606 | } = options; |
| 5441 | - const open = store2.useState("open"); | |
| 5607 | + const resolvedActiveTriggerIdRef = React22.useRef(null); | |
| 5608 | + const open2 = store2.useState("open"); | |
| 5442 | 5609 | const reactiveTriggerCount = store2.useState("triggerCount"); |
| 5610 | + const activeTriggerId = store2.useState("activeTriggerId"); | |
| 5611 | + const reactiveActiveTriggerElement = store2.useState("activeTriggerElement"); | |
| 5443 | 5612 | useIsoLayoutEffect(() => { |
| 5444 | - if (!open) { | |
| 5613 | + if (!open2) { | |
| 5614 | + resolvedActiveTriggerIdRef.current = null; | |
| 5445 | 5615 | if (store2.state.triggerCount !== 0) { |
| 5446 | 5616 | store2.set("triggerCount", 0); |
| 5447 | 5617 | } |
| 5448 | 5618 | return; |
| @@ -5451,24 +5621,44 @@ | ||
| 5451 | 5621 | const stateUpdates = {}; |
| 5452 | 5622 | if (store2.state.triggerCount !== triggerCount) { |
| 5453 | 5623 | stateUpdates.triggerCount = triggerCount; |
| 5454 | 5624 | } |
| 5455 | - const activeTriggerId = store2.select("activeTriggerId"); | |
| 5625 | + const currentActiveTriggerId = store2.select("activeTriggerId"); | |
| 5456 | 5626 | let lostActiveTriggerId = null; |
| 5457 | - if (activeTriggerId) { | |
| 5458 | - const activeTriggerElement = store2.context.triggerElements.getById(activeTriggerId); | |
| 5627 | + if (currentActiveTriggerId) { | |
| 5628 | + const activeTriggerElement = store2.context.triggerElements.getById(currentActiveTriggerId); | |
| 5459 | 5629 | if (!activeTriggerElement) { |
| 5460 | - lostActiveTriggerId = activeTriggerId; | |
| 5461 | - } else if (activeTriggerElement !== store2.state.activeTriggerElement) { | |
| 5462 | - stateUpdates.activeTriggerElement = activeTriggerElement; | |
| 5630 | + for (const [triggerId, triggerElement] of store2.context.triggerElements.entries()) { | |
| 5631 | + if (triggerElement === store2.state.activeTriggerElement) { | |
| 5632 | + stateUpdates.activeTriggerId = triggerId; | |
| 5633 | + stateUpdates.activeTriggerElement = triggerElement; | |
| 5634 | + resolvedActiveTriggerIdRef.current = triggerId; | |
| 5635 | + break; | |
| 5636 | + } | |
| 5637 | + } | |
| 5638 | + if (stateUpdates.activeTriggerId === void 0) { | |
| 5639 | + if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { | |
| 5640 | + lostActiveTriggerId = currentActiveTriggerId; | |
| 5641 | + } else { | |
| 5642 | + resolvedActiveTriggerIdRef.current = null; | |
| 5643 | + } | |
| 5644 | + } | |
| 5645 | + } else { | |
| 5646 | + resolvedActiveTriggerIdRef.current = currentActiveTriggerId; | |
| 5647 | + if (activeTriggerElement !== store2.state.activeTriggerElement) { | |
| 5648 | + stateUpdates.activeTriggerElement = activeTriggerElement; | |
| 5649 | + } | |
| 5463 | 5650 | } |
| 5651 | + } else { | |
| 5652 | + resolvedActiveTriggerIdRef.current = null; | |
| 5464 | 5653 | } |
| 5465 | - if (!lostActiveTriggerId && !activeTriggerId && triggerCount === 1) { | |
| 5654 | + if (!lostActiveTriggerId && !currentActiveTriggerId && triggerCount === 1) { | |
| 5466 | 5655 | const iteratorResult = store2.context.triggerElements.entries().next(); |
| 5467 | 5656 | if (!iteratorResult.done) { |
| 5468 | 5657 | const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; |
| 5469 | 5658 | stateUpdates.activeTriggerId = implicitTriggerId; |
| 5470 | 5659 | stateUpdates.activeTriggerElement = implicitTriggerElement; |
| 5660 | + resolvedActiveTriggerIdRef.current = implicitTriggerId; | |
| 5471 | 5661 | } |
| 5472 | 5662 | } |
| 5473 | 5663 | if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { |
| 5474 | 5664 | store2.update(stateUpdates); |
| @@ -5488,18 +5678,18 @@ | ||
| 5488 | 5678 | } |
| 5489 | 5679 | }); |
| 5490 | 5680 | } |
| 5491 | 5681 | } |
| 5492 | - }, [open, store2, reactiveTriggerCount, closeOnActiveTriggerUnmount]); | |
| 5682 | + }, [open2, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); | |
| 5493 | 5683 | } |
| 5494 | - function useOpenStateTransitions(open, store2, onUnmount) { | |
| 5684 | + function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) { | |
| 5495 | 5685 | const { |
| 5496 | 5686 | mounted, |
| 5497 | 5687 | setMounted, |
| 5498 | 5688 | transitionStatus |
| 5499 | - } = useTransitionStatus(open); | |
| 5689 | + } = useTransitionStatus(open2, false, false, animateInitialOpen); | |
| 5500 | 5690 | const preventUnmountingOnClose = store2.useState("preventUnmountingOnClose"); |
| 5501 | - const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose; | |
| 5691 | + const syncedPreventUnmountingOnClose = open2 ? false : preventUnmountingOnClose; | |
| 5502 | 5692 | store2.useSyncedValues({ |
| 5503 | 5693 | mounted, |
| 5504 | 5694 | transitionStatus, |
| 5505 | 5695 | preventUnmountingOnClose: syncedPreventUnmountingOnClose |
| @@ -5515,13 +5705,13 @@ | ||
| 5515 | 5705 | onUnmount?.(); |
| 5516 | 5706 | store2.context.onOpenChangeComplete?.(false); |
| 5517 | 5707 | }); |
| 5518 | 5708 | useOpenChangeComplete({ |
| 5519 | - enabled: mounted && !open && !syncedPreventUnmountingOnClose, | |
| 5520 | - open, | |
| 5709 | + enabled: mounted && !open2 && !syncedPreventUnmountingOnClose, | |
| 5710 | + open: open2, | |
| 5521 | 5711 | ref: store2.context.popupRef, |
| 5522 | 5712 | onComplete() { |
| 5523 | - if (!open) { | |
| 5713 | + if (!open2) { | |
| 5524 | 5714 | forceUnmount(); |
| 5525 | 5715 | } |
| 5526 | 5716 | } |
| 5527 | 5717 | }); |
| @@ -5541,11 +5731,20 @@ | ||
| 5541 | 5731 | }, [store2]); |
| 5542 | 5732 | } |
| 5543 | 5733 | |
| 5544 | 5734 | // node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs |
| 5735 | + var devElementIdsByMap; | |
| 5736 | + function getDevElementIds(map) { | |
| 5737 | + devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); | |
| 5738 | + let elementIds = devElementIdsByMap.get(map); | |
| 5739 | + if (!elementIds) { | |
| 5740 | + elementIds = /* @__PURE__ */ new WeakMap(); | |
| 5741 | + devElementIdsByMap.set(map, elementIds); | |
| 5742 | + } | |
| 5743 | + return elementIds; | |
| 5744 | + } | |
| 5545 | 5745 | var PopupTriggerMap = class { |
| 5546 | 5746 | constructor() { |
| 5547 | - this.elementsSet = /* @__PURE__ */ new Set(); | |
| 5548 | 5747 | this.idMap = /* @__PURE__ */ new Map(); |
| 5549 | 5748 | } |
| 5550 | 5749 | /** |
| 5551 | 5750 | * Adds a trigger element with the given ID. |
| @@ -5552,44 +5751,50 @@ | ||
| 5552 | 5751 | * |
| 5553 | 5752 | * Note: The provided element is assumed to not be registered under multiple IDs. |
| 5554 | 5753 | */ |
| 5555 | 5754 | add(id, element) { |
| 5556 | - const existingElement = this.idMap.get(id); | |
| 5557 | - if (existingElement === element) { | |
| 5558 | - return; | |
| 5559 | - } | |
| 5560 | - if (existingElement !== void 0) { | |
| 5561 | - this.elementsSet.delete(existingElement); | |
| 5562 | - } | |
| 5563 | - this.elementsSet.add(element); | |
| 5564 | - this.idMap.set(id, element); | |
| 5565 | 5755 | if (true) { |
| 5566 | - if (this.elementsSet.size !== this.idMap.size) { | |
| 5756 | + const elementIds = getDevElementIds(this); | |
| 5757 | + const existingId = elementIds.get(element); | |
| 5758 | + if (existingId !== void 0 && existingId !== id) { | |
| 5567 | 5759 | throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); |
| 5568 | 5760 | } |
| 5761 | + const previousElement = this.idMap.get(id); | |
| 5762 | + if (previousElement !== void 0 && previousElement !== element) { | |
| 5763 | + elementIds.delete(previousElement); | |
| 5764 | + } | |
| 5765 | + elementIds.set(element, id); | |
| 5569 | 5766 | } |
| 5767 | + this.idMap.set(id, element); | |
| 5570 | 5768 | } |
| 5571 | 5769 | /** |
| 5572 | 5770 | * Removes the trigger element with the given ID. |
| 5573 | 5771 | */ |
| 5574 | 5772 | delete(id) { |
| 5575 | - const element = this.idMap.get(id); | |
| 5576 | - if (element) { | |
| 5577 | - this.elementsSet.delete(element); | |
| 5578 | - this.idMap.delete(id); | |
| 5773 | + if (true) { | |
| 5774 | + const element = this.idMap.get(id); | |
| 5775 | + if (element !== void 0) { | |
| 5776 | + devElementIdsByMap?.get(this)?.delete(element); | |
| 5777 | + } | |
| 5579 | 5778 | } |
| 5779 | + this.idMap.delete(id); | |
| 5580 | 5780 | } |
| 5581 | 5781 | /** |
| 5582 | 5782 | * Whether the given element is registered as a trigger. |
| 5583 | 5783 | */ |
| 5584 | 5784 | hasElement(element) { |
| 5585 | - return this.elementsSet.has(element); | |
| 5785 | + for (const registered of this.idMap.values()) { | |
| 5786 | + if (registered === element) { | |
| 5787 | + return true; | |
| 5788 | + } | |
| 5789 | + } | |
| 5790 | + return false; | |
| 5586 | 5791 | } |
| 5587 | 5792 | /** |
| 5588 | 5793 | * Whether there is a registered trigger element matching the given predicate. |
| 5589 | 5794 | */ |
| 5590 | 5795 | hasMatchingElement(predicate) { |
| 5591 | - for (const element of this.elementsSet) { | |
| 5796 | + for (const element of this.idMap.values()) { | |
| 5592 | 5797 | if (predicate(element)) { |
| 5593 | 5798 | return true; |
| 5594 | 5799 | } |
| 5595 | 5800 | } |
| @@ -5610,9 +5815,9 @@ | ||
| 5610 | 5815 | /** |
| 5611 | 5816 | * Returns an iterable of all registered trigger elements. |
| 5612 | 5817 | */ |
| 5613 | 5818 | elements() { |
| 5614 | - return this.elementsSet.values(); | |
| 5819 | + return this.idMap.values(); | |
| 5615 | 5820 | } |
| 5616 | 5821 | /** |
| 5617 | 5822 | * Returns the number of registered trigger elements. |
| 5618 | 5823 | */ |
| @@ -5620,32 +5825,27 @@ | ||
| 5620 | 5825 | return this.idMap.size; |
| 5621 | 5826 | } |
| 5622 | 5827 | }; |
| 5623 | 5828 | |
| 5624 | - // node_modules/@base-ui/react/floating-ui-react/utils/getEmptyRootContext.mjs | |
| 5625 | - function getEmptyRootContext() { | |
| 5626 | - return new FloatingRootStore({ | |
| 5627 | - open: false, | |
| 5628 | - transitionStatus: void 0, | |
| 5629 | - floatingElement: null, | |
| 5630 | - referenceElement: null, | |
| 5631 | - triggerElements: new PopupTriggerMap(), | |
| 5632 | - floatingId: void 0, | |
| 5633 | - syncOnly: false, | |
| 5634 | - nested: false, | |
| 5635 | - onOpenChange: void 0 | |
| 5636 | - }); | |
| 5637 | - } | |
| 5638 | - | |
| 5639 | 5829 | // node_modules/@base-ui/react/utils/popups/store.mjs |
| 5640 | - function createInitialPopupStoreState() { | |
| 5830 | + function createInitialPopupStoreState(triggerElements, floatingId, nested = false) { | |
| 5641 | 5831 | return { |
| 5642 | 5832 | open: false, |
| 5643 | 5833 | openProp: void 0, |
| 5644 | 5834 | mounted: false, |
| 5645 | 5835 | transitionStatus: void 0, |
| 5646 | - floatingRootContext: getEmptyRootContext(), | |
| 5647 | - floatingId: void 0, | |
| 5836 | + floatingRootContext: new FloatingRootStore({ | |
| 5837 | + open: false, | |
| 5838 | + transitionStatus: void 0, | |
| 5839 | + floatingElement: null, | |
| 5840 | + referenceElement: null, | |
| 5841 | + triggerElements, | |
| 5842 | + floatingId, | |
| 5843 | + syncOnly: true, | |
| 5844 | + nested, | |
| 5845 | + onOpenChange: void 0 | |
| 5846 | + }), | |
| 5847 | + floatingId, | |
| 5648 | 5848 | triggerCount: 0, |
| 5649 | 5849 | preventUnmountingOnClose: false, |
| 5650 | 5850 | payload: void 0, |
| 5651 | 5851 | activeTriggerId: null, |
| @@ -5657,27 +5857,14 @@ | ||
| 5657 | 5857 | inactiveTriggerProps: EMPTY_OBJECT, |
| 5658 | 5858 | popupProps: EMPTY_OBJECT |
| 5659 | 5859 | }; |
| 5660 | 5860 | } |
| 5661 | - function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) { | |
| 5662 | - return new FloatingRootStore({ | |
| 5663 | - open: false, | |
| 5664 | - transitionStatus: void 0, | |
| 5665 | - floatingElement: null, | |
| 5666 | - referenceElement: null, | |
| 5667 | - triggerElements, | |
| 5668 | - floatingId, | |
| 5669 | - syncOnly: true, | |
| 5670 | - nested, | |
| 5671 | - onOpenChange: void 0 | |
| 5672 | - }); | |
| 5673 | - } | |
| 5674 | - var activeTriggerIdSelector = createSelector((state) => state.triggerIdProp ?? state.activeTriggerId); | |
| 5675 | - var openSelector = createSelector((state) => state.openProp ?? state.open); | |
| 5676 | - var popupIdSelector = createSelector((state) => { | |
| 5861 | + var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; | |
| 5862 | + var openSelector = (state) => state.openProp ?? state.open; | |
| 5863 | + var popupIdSelector = (state) => { | |
| 5677 | 5864 | const popupId = state.popupElement?.id ?? state.floatingId; |
| 5678 | 5865 | return popupId || void 0; |
| 5679 | - }); | |
| 5866 | + }; | |
| 5680 | 5867 | function triggerOwnsOpenPopup(state, triggerId) { |
| 5681 | 5868 | return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; |
| 5682 | 5869 | } |
| 5683 | 5870 | function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { |
| @@ -5687,103 +5874,75 @@ | ||
| 5687 | 5874 | return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1; |
| 5688 | 5875 | } |
| 5689 | 5876 | var popupStoreSelectors = { |
| 5690 | 5877 | open: openSelector, |
| 5691 | - mounted: createSelector((state) => state.mounted), | |
| 5692 | - transitionStatus: createSelector((state) => state.transitionStatus), | |
| 5693 | - floatingRootContext: createSelector((state) => state.floatingRootContext), | |
| 5694 | - triggerCount: createSelector((state) => state.triggerCount), | |
| 5695 | - preventUnmountingOnClose: createSelector((state) => state.preventUnmountingOnClose), | |
| 5696 | - payload: createSelector((state) => state.payload), | |
| 5878 | + mounted: (state) => state.mounted, | |
| 5879 | + transitionStatus: (state) => state.transitionStatus, | |
| 5880 | + floatingRootContext: (state) => state.floatingRootContext, | |
| 5881 | + triggerCount: (state) => state.triggerCount, | |
| 5882 | + preventUnmountingOnClose: (state) => state.preventUnmountingOnClose, | |
| 5883 | + payload: (state) => state.payload, | |
| 5697 | 5884 | activeTriggerId: activeTriggerIdSelector, |
| 5698 | - activeTriggerElement: createSelector((state) => state.mounted ? state.activeTriggerElement : null), | |
| 5885 | + activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null, | |
| 5699 | 5886 | popupId: popupIdSelector, |
| 5700 | 5887 | /** |
| 5701 | 5888 | * Whether the trigger with the given ID was used to open the popup. |
| 5702 | 5889 | */ |
| 5703 | - isTriggerActive: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId), | |
| 5890 | + isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId, | |
| 5704 | 5891 | /** |
| 5705 | 5892 | * Whether the popup is open and was activated by a trigger with the given ID. |
| 5706 | 5893 | */ |
| 5707 | - isOpenedByTrigger: createSelector((state, triggerId) => triggerOwnsOpenPopup(state, triggerId)), | |
| 5894 | + isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId), | |
| 5708 | 5895 | /** |
| 5709 | 5896 | * Whether the popup is mounted and was activated by a trigger with the given ID. |
| 5710 | 5897 | */ |
| 5711 | - isMountedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted), | |
| 5712 | - triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps), | |
| 5898 | + isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted, | |
| 5899 | + triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps, | |
| 5713 | 5900 | /** |
| 5714 | 5901 | * Popup id for the trigger that currently owns the open popup. |
| 5715 | 5902 | */ |
| 5716 | - triggerPopupId: createSelector((state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0), | |
| 5717 | - popupProps: createSelector((state) => state.popupProps), | |
| 5718 | - popupElement: createSelector((state) => state.popupElement), | |
| 5719 | - positionerElement: createSelector((state) => state.positionerElement) | |
| 5903 | + triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0, | |
| 5904 | + popupProps: (state) => state.popupProps, | |
| 5905 | + popupElement: (state) => state.popupElement, | |
| 5906 | + positionerElement: (state) => state.positionerElement | |
| 5720 | 5907 | }; |
| 5721 | 5908 | |
| 5722 | - // node_modules/@base-ui/react/floating-ui-react/hooks/useFloatingRootContext.mjs | |
| 5723 | - function useFloatingRootContext(options) { | |
| 5724 | - const { | |
| 5725 | - open = false, | |
| 5726 | - onOpenChange, | |
| 5727 | - elements = {} | |
| 5728 | - } = options; | |
| 5729 | - const floatingId = useId(); | |
| 5730 | - const nested = useFloatingParentNodeId() != null; | |
| 5731 | - if (true) { | |
| 5732 | - const optionDomReference = elements.reference; | |
| 5733 | - if (optionDomReference && !isElement(optionDomReference)) { | |
| 5734 | - console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead."); | |
| 5909 | + // node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs | |
| 5910 | + var React23 = __toESM(require_react(), 1); | |
| 5911 | + var import_shim2 = __toESM(require_shim(), 1); | |
| 5912 | + function usePopupHandleStore(handle) { | |
| 5913 | + const subscribe = React23.useCallback((listener) => { | |
| 5914 | + if (handle === void 0) { | |
| 5915 | + return NOOP; | |
| 5735 | 5916 | } |
| 5736 | - } | |
| 5737 | - const store2 = useRefWithInit(() => new FloatingRootStore({ | |
| 5738 | - open, | |
| 5739 | - transitionStatus: void 0, | |
| 5740 | - onOpenChange, | |
| 5741 | - referenceElement: elements.reference ?? null, | |
| 5742 | - floatingElement: elements.floating ?? null, | |
| 5743 | - triggerElements: new PopupTriggerMap(), | |
| 5744 | - floatingId, | |
| 5745 | - syncOnly: false, | |
| 5746 | - nested | |
| 5747 | - })).current; | |
| 5748 | - useIsoLayoutEffect(() => { | |
| 5749 | - const valuesToSync = { | |
| 5750 | - open, | |
| 5751 | - floatingId | |
| 5752 | - }; | |
| 5753 | - if (elements.reference !== void 0) { | |
| 5754 | - valuesToSync.referenceElement = elements.reference; | |
| 5755 | - valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null; | |
| 5756 | - } | |
| 5757 | - if (elements.floating !== void 0) { | |
| 5758 | - valuesToSync.floatingElement = elements.floating; | |
| 5759 | - } | |
| 5760 | - store2.update(valuesToSync); | |
| 5761 | - }, [open, floatingId, elements.reference, elements.floating, store2]); | |
| 5762 | - store2.context.onOpenChange = onOpenChange; | |
| 5763 | - store2.context.nested = nested; | |
| 5764 | - return store2; | |
| 5917 | + return handle.subscribeStore(listener); | |
| 5918 | + }, [handle]); | |
| 5919 | + const getSnapshot = React23.useCallback(() => { | |
| 5920 | + return handle === void 0 ? void 0 : handle.store; | |
| 5921 | + }, [handle]); | |
| 5922 | + return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore); | |
| 5765 | 5923 | } |
| 5766 | 5924 | |
| 5767 | 5925 | // node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs |
| 5768 | - function useFloating2(options = {}) { | |
| 5926 | + function useBaseUIFloating(options) { | |
| 5927 | + return useFloatingWithStore(options, options.rootContext); | |
| 5928 | + } | |
| 5929 | + function useFloatingWithStore(options, store2) { | |
| 5769 | 5930 | const { |
| 5770 | 5931 | nodeId, |
| 5771 | 5932 | externalTree |
| 5772 | 5933 | } = options; |
| 5773 | - const internalStore = useFloatingRootContext(options); | |
| 5774 | - const store2 = options.rootContext || internalStore; | |
| 5775 | 5934 | const referenceElement = store2.useState("referenceElement"); |
| 5776 | 5935 | const floatingElement = store2.useState("floatingElement"); |
| 5777 | 5936 | const domReferenceElement = store2.useState("domReferenceElement"); |
| 5778 | - const open = store2.useState("open"); | |
| 5937 | + const open2 = store2.useState("open"); | |
| 5779 | 5938 | const floatingId = store2.useState("floatingId"); |
| 5780 | - const [positionReference, setPositionReferenceRaw] = React25.useState(null); | |
| 5781 | - const [localDomReference, setLocalDomReference] = React25.useState(void 0); | |
| 5782 | - const [localFloatingElement, setLocalFloatingElement] = React25.useState(void 0); | |
| 5783 | - const domReferenceRef = React25.useRef(null); | |
| 5939 | + const [positionReference, setPositionReferenceRaw] = React24.useState(null); | |
| 5940 | + const [localDomReference, setLocalDomReference] = React24.useState(void 0); | |
| 5941 | + const [localFloatingElement, setLocalFloatingElement] = React24.useState(void 0); | |
| 5942 | + const domReferenceRef = React24.useRef(null); | |
| 5784 | 5943 | const tree = useFloatingTree(externalTree); |
| 5785 | - const storeElements = React25.useMemo(() => ({ | |
| 5944 | + const storeElements = React24.useMemo(() => ({ | |
| 5786 | 5945 | reference: referenceElement, |
| 5787 | 5946 | floating: floatingElement, |
| 5788 | 5947 | domReference: domReferenceElement |
| 5789 | 5948 | }), [referenceElement, floatingElement, domReferenceElement]); |
| @@ -5800,9 +5959,9 @@ | ||
| 5800 | 5959 | const syncedFloatingElement = localFloatingElement === void 0 ? store2.state.floatingElement : localFloatingElement; |
| 5801 | 5960 | store2.useSyncedValue("referenceElement", localDomReference ?? null); |
| 5802 | 5961 | store2.useSyncedValue("domReferenceElement", localDomReference === void 0 ? domReferenceElement : localDomReferenceElement); |
| 5803 | 5962 | store2.useSyncedValue("floatingElement", syncedFloatingElement); |
| 5804 | - const setPositionReference = React25.useCallback((node) => { | |
| 5963 | + const setPositionReference = React24.useCallback((node) => { | |
| 5805 | 5964 | const computedPositionReference = isElement(node) ? { |
| 5806 | 5965 | getBoundingClientRect: () => node.getBoundingClientRect(), |
| 5807 | 5966 | getClientRects: () => node.getClientRects(), |
| 5808 | 5967 | contextElement: node |
| @@ -5809,9 +5968,9 @@ | ||
| 5809 | 5968 | } : node; |
| 5810 | 5969 | setPositionReferenceRaw(computedPositionReference); |
| 5811 | 5970 | position.refs.setReference(computedPositionReference); |
| 5812 | 5971 | }, [position.refs]); |
| 5813 | - const setReference = React25.useCallback((node) => { | |
| 5972 | + const setReference = React24.useCallback((node) => { | |
| 5814 | 5973 | if (isElement(node) || node === null) { |
| 5815 | 5974 | domReferenceRef.current = node; |
| 5816 | 5975 | setLocalDomReference(node); |
| 5817 | 5976 | } |
| @@ -5821,13 +5980,13 @@ | ||
| 5821 | 5980 | node !== null && !isElement(node)) { |
| 5822 | 5981 | position.refs.setReference(node); |
| 5823 | 5982 | } |
| 5824 | 5983 | }, [position.refs, setLocalDomReference]); |
| 5825 | - const setFloating = React25.useCallback((node) => { | |
| 5984 | + const setFloating = React24.useCallback((node) => { | |
| 5826 | 5985 | setLocalFloatingElement(node); |
| 5827 | 5986 | position.refs.setFloating(node); |
| 5828 | 5987 | }, [position.refs]); |
| 5829 | - const refs = React25.useMemo(() => ({ | |
| 5988 | + const refs = React24.useMemo(() => ({ | |
| 5830 | 5989 | ...position.refs, |
| 5831 | 5990 | setReference, |
| 5832 | 5991 | setFloating, |
| 5833 | 5992 | setPositionReference, |
| @@ -5832,16 +5991,16 @@ | ||
| 5832 | 5991 | setFloating, |
| 5833 | 5992 | setPositionReference, |
| 5834 | 5993 | domReference: domReferenceRef |
| 5835 | 5994 | }), [position.refs, setReference, setFloating, setPositionReference]); |
| 5836 | - const elements = React25.useMemo(() => ({ | |
| 5995 | + const elements = React24.useMemo(() => ({ | |
| 5837 | 5996 | ...position.elements, |
| 5838 | 5997 | domReference: domReferenceElement |
| 5839 | 5998 | }), [position.elements, domReferenceElement]); |
| 5840 | - const context = React25.useMemo(() => ({ | |
| 5999 | + const context = React24.useMemo(() => ({ | |
| 5841 | 6000 | ...position, |
| 5842 | 6001 | dataRef: store2.context.dataRef, |
| 5843 | - open, | |
| 6002 | + open: open2, | |
| 5844 | 6003 | onOpenChange: store2.setOpen, |
| 5845 | 6004 | events: store2.context.events, |
| 5846 | 6005 | floatingId, |
| 5847 | 6006 | refs, |
| @@ -5847,9 +6006,9 @@ | ||
| 5847 | 6006 | refs, |
| 5848 | 6007 | elements, |
| 5849 | 6008 | nodeId, |
| 5850 | 6009 | rootStore: store2 |
| 5851 | - }), [position, refs, elements, nodeId, store2, open, floatingId]); | |
| 6010 | + }), [position, refs, elements, nodeId, store2, open2, floatingId]); | |
| 5852 | 6011 | useIsoLayoutEffect(() => { |
| 5853 | 6012 | if (domReferenceElement) { |
| 5854 | 6013 | domReferenceRef.current = domReferenceElement; |
| 5855 | 6014 | } |
| @@ -5860,9 +6019,9 @@ | ||
| 5860 | 6019 | if (node) { |
| 5861 | 6020 | node.context = context; |
| 5862 | 6021 | } |
| 5863 | 6022 | }); |
| 5864 | - return React25.useMemo(() => ({ | |
| 6023 | + return React24.useMemo(() => ({ | |
| 5865 | 6024 | ...position, |
| 5866 | 6025 | context, |
| 5867 | 6026 | refs, |
| 5868 | 6027 | elements, |
| @@ -5870,9 +6029,9 @@ | ||
| 5870 | 6029 | }), [position, refs, elements, context, store2]); |
| 5871 | 6030 | } |
| 5872 | 6031 | |
| 5873 | 6032 | // node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs |
| 5874 | - var React26 = __toESM(require_react(), 1); | |
| 6033 | + var React25 = __toESM(require_react(), 1); | |
| 5875 | 6034 | var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit; |
| 5876 | 6035 | function useFocus(context, props = {}) { |
| 5877 | 6036 | const { |
| 5878 | 6037 | enabled = true, |
| @@ -5882,13 +6041,13 @@ | ||
| 5882 | 6041 | const { |
| 5883 | 6042 | events, |
| 5884 | 6043 | dataRef |
| 5885 | 6044 | } = store2.context; |
| 5886 | - const blockFocusRef = React26.useRef(false); | |
| 5887 | - const blockedReferenceRef = React26.useRef(null); | |
| 5888 | - const keyboardModalityRef = React26.useRef(true); | |
| 6045 | + const blockFocusRef = React25.useRef(false); | |
| 6046 | + const blockedReferenceRef = React25.useRef(null); | |
| 6047 | + const keyboardModalityRef = React25.useRef(true); | |
| 5889 | 6048 | const timeout = useTimeout(); |
| 5890 | - React26.useEffect(() => { | |
| 6049 | + React25.useEffect(() => { | |
| 5891 | 6050 | const domReference = store2.select("domReferenceElement"); |
| 5892 | 6051 | if (!enabled) { |
| 5893 | 6052 | return void 0; |
| 5894 | 6053 | } |
| @@ -5896,8 +6055,9 @@ | ||
| 5896 | 6055 | function onBlur() { |
| 5897 | 6056 | const currentDomReference = store2.select("domReferenceElement"); |
| 5898 | 6057 | if (!store2.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { |
| 5899 | 6058 | blockFocusRef.current = true; |
| 6059 | + blockedReferenceRef.current = currentDomReference; | |
| 5900 | 6060 | } |
| 5901 | 6061 | } |
| 5902 | 6062 | function onKeyDown() { |
| 5903 | 6063 | keyboardModalityRef.current = true; |
| @@ -5906,9 +6066,9 @@ | ||
| 5906 | 6066 | keyboardModalityRef.current = false; |
| 5907 | 6067 | } |
| 5908 | 6068 | return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); |
| 5909 | 6069 | }, [store2, enabled]); |
| 5910 | - React26.useEffect(() => { | |
| 6070 | + React25.useEffect(() => { | |
| 5911 | 6071 | if (!enabled) { |
| 5912 | 6072 | return void 0; |
| 5913 | 6073 | } |
| 5914 | 6074 | function onOpenChangeLocal(details) { |
| @@ -5924,9 +6084,9 @@ | ||
| 5924 | 6084 | return () => { |
| 5925 | 6085 | events.off("openchange", onOpenChangeLocal); |
| 5926 | 6086 | }; |
| 5927 | 6087 | }, [events, enabled, store2]); |
| 5928 | - const reference = React26.useMemo(() => { | |
| 6088 | + const reference = React25.useMemo(() => { | |
| 5929 | 6089 | function resetBlockedFocus() { |
| 5930 | 6090 | blockFocusRef.current = false; |
| 5931 | 6091 | blockedReferenceRef.current = null; |
| 5932 | 6092 | } |
| @@ -5991,9 +6151,9 @@ | ||
| 5991 | 6151 | }); |
| 5992 | 6152 | } |
| 5993 | 6153 | }; |
| 5994 | 6154 | }, [dataRef, delay, store2, timeout]); |
| 5995 | - return React26.useMemo(() => enabled ? { | |
| 6155 | + return React25.useMemo(() => enabled ? { | |
| 5996 | 6156 | reference, |
| 5997 | 6157 | trigger: reference |
| 5998 | 6158 | } : {}, [enabled, reference]); |
| 5999 | 6159 | } |
| @@ -5998,9 +6158,9 @@ | ||
| 5998 | 6158 | } : {}, [enabled, reference]); |
| 5999 | 6159 | } |
| 6000 | 6160 | |
| 6001 | 6161 | // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs |
| 6002 | - var React27 = __toESM(require_react(), 1); | |
| 6162 | + var React26 = __toESM(require_react(), 1); | |
| 6003 | 6163 | |
| 6004 | 6164 | // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs |
| 6005 | 6165 | var HoverInteraction = class _HoverInteraction { |
| 6006 | 6166 | constructor() { |
| @@ -6082,9 +6242,9 @@ | ||
| 6082 | 6242 | closeDelay: closeDelayProp = 0, |
| 6083 | 6243 | nodeId: nodeIdProp |
| 6084 | 6244 | } = parameters; |
| 6085 | 6245 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 6086 | - const open = store2.useState("open"); | |
| 6246 | + const open2 = store2.useState("open"); | |
| 6087 | 6247 | const floatingElement = store2.useState("floatingElement"); |
| 6088 | 6248 | const domReferenceElement = store2.useState("domReferenceElement"); |
| 6089 | 6249 | const { |
| 6090 | 6250 | dataRef |
| @@ -6102,16 +6262,16 @@ | ||
| 6102 | 6262 | const clearPointerEvents = useStableCallback(() => { |
| 6103 | 6263 | clearSafePolygonPointerEventsMutation(instance); |
| 6104 | 6264 | }); |
| 6105 | 6265 | useIsoLayoutEffect(() => { |
| 6106 | - if (!open) { | |
| 6266 | + if (!open2) { | |
| 6107 | 6267 | instance.pointerType = void 0; |
| 6108 | 6268 | instance.restTimeoutPending = false; |
| 6109 | 6269 | instance.interactedInside = false; |
| 6110 | 6270 | clearPointerEvents(); |
| 6111 | 6271 | } |
| 6112 | - }, [open, instance, clearPointerEvents]); | |
| 6113 | - React27.useEffect(() => { | |
| 6272 | + }, [open2, instance, clearPointerEvents]); | |
| 6273 | + React26.useEffect(() => { | |
| 6114 | 6274 | return clearPointerEvents; |
| 6115 | 6275 | }, [clearPointerEvents]); |
| 6116 | 6276 | useIsoLayoutEffect(() => { |
| 6117 | 6277 | if (!enabled) { |
| @@ -6116,9 +6276,9 @@ | ||
| 6116 | 6276 | useIsoLayoutEffect(() => { |
| 6117 | 6277 | if (!enabled) { |
| 6118 | 6278 | return void 0; |
| 6119 | 6279 | } |
| 6120 | - if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { | |
| 6280 | + if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { | |
| 6121 | 6281 | const ref = domReferenceElement; |
| 6122 | 6282 | const floatingEl = floatingElement; |
| 6123 | 6283 | const doc = ownerDocument(floatingElement); |
| 6124 | 6284 | const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; |
| @@ -6137,10 +6297,10 @@ | ||
| 6137 | 6297 | clearPointerEvents(); |
| 6138 | 6298 | }; |
| 6139 | 6299 | } |
| 6140 | 6300 | return void 0; |
| 6141 | - }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); | |
| 6142 | - React27.useEffect(() => { | |
| 6301 | + }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); | |
| 6302 | + React26.useEffect(() => { | |
| 6143 | 6303 | if (!enabled) { |
| 6144 | 6304 | return void 0; |
| 6145 | 6305 | } |
| 6146 | 6306 | function hasParentChildren() { |
| @@ -6213,9 +6373,9 @@ | ||
| 6213 | 6373 | }, [enabled, floatingElement, store2, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); |
| 6214 | 6374 | } |
| 6215 | 6375 | |
| 6216 | 6376 | // node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs |
| 6217 | - var React28 = __toESM(require_react(), 1); | |
| 6377 | + var React27 = __toESM(require_react(), 1); | |
| 6218 | 6378 | var ReactDOM5 = __toESM(require_react_dom(), 1); |
| 6219 | 6379 | var EMPTY_REF = { |
| 6220 | 6380 | current: null |
| 6221 | 6381 | }; |
| @@ -6225,15 +6385,16 @@ | ||
| 6225 | 6385 | delay = 0, |
| 6226 | 6386 | handleClose = null, |
| 6227 | 6387 | mouseOnly = false, |
| 6228 | 6388 | restMs = 0, |
| 6229 | - move = true, | |
| 6389 | + move: move2 = true, | |
| 6230 | 6390 | triggerElementRef = EMPTY_REF, |
| 6231 | 6391 | externalTree, |
| 6232 | 6392 | isActiveTrigger = true, |
| 6233 | 6393 | getHandleCloseContext, |
| 6234 | 6394 | isClosing, |
| 6235 | - shouldOpen: shouldOpenProp | |
| 6395 | + shouldOpen: shouldOpenProp, | |
| 6396 | + guardStaleOpen = false | |
| 6236 | 6397 | } = props; |
| 6237 | 6398 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 6238 | 6399 | const { |
| 6239 | 6400 | dataRef, |
| @@ -6240,9 +6401,9 @@ | ||
| 6240 | 6401 | events |
| 6241 | 6402 | } = store2.context; |
| 6242 | 6403 | const tree = useFloatingTree(externalTree); |
| 6243 | 6404 | const instance = useHoverInteractionSharedState(store2); |
| 6244 | - const isHoverCloseActiveRef = React28.useRef(false); | |
| 6405 | + const isHoverCloseActiveRef = React27.useRef(false); | |
| 6245 | 6406 | const handleCloseRef = useValueAsRef(handleClose); |
| 6246 | 6407 | const delayRef = useValueAsRef(delay); |
| 6247 | 6408 | const restMsRef = useValueAsRef(restMs); |
| 6248 | 6409 | const enabledRef = useValueAsRef(enabled); |
| @@ -6276,12 +6437,12 @@ | ||
| 6276 | 6437 | const clearPointerEvents = useStableCallback(() => { |
| 6277 | 6438 | clearSafePolygonPointerEventsMutation(instance); |
| 6278 | 6439 | }); |
| 6279 | 6440 | if (isActiveTrigger) { |
| 6280 | - instance.handleCloseOptions = handleCloseRef.current?.__options; | |
| 6441 | + instance.handleCloseOptions = handleClose?.__options; | |
| 6281 | 6442 | } |
| 6282 | - React28.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); | |
| 6283 | - React28.useEffect(() => { | |
| 6443 | + React27.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); | |
| 6444 | + React27.useEffect(() => { | |
| 6284 | 6445 | if (!enabled) { |
| 6285 | 6446 | return void 0; |
| 6286 | 6447 | } |
| 6287 | 6448 | function onOpenChangeLocal(details) { |
| @@ -6300,9 +6461,9 @@ | ||
| 6300 | 6461 | return () => { |
| 6301 | 6462 | events.off("openchange", onOpenChangeLocal); |
| 6302 | 6463 | }; |
| 6303 | 6464 | }, [enabled, events, instance, cleanupMouseMoveHandler]); |
| 6304 | - React28.useEffect(() => { | |
| 6465 | + React27.useEffect(() => { | |
| 6305 | 6466 | if (!enabled) { |
| 6306 | 6467 | return void 0; |
| 6307 | 6468 | } |
| 6308 | 6469 | function closeWithDelay(event, runElseBranch = true) { |
| @@ -6414,16 +6575,25 @@ | ||
| 6414 | 6575 | if (shouldClose) { |
| 6415 | 6576 | closeWithDelay(event); |
| 6416 | 6577 | } |
| 6417 | 6578 | } |
| 6418 | - if (move) { | |
| 6579 | + function onMouseOut(event) { | |
| 6580 | + if (contains(trigger, event.relatedTarget)) { | |
| 6581 | + return; | |
| 6582 | + } | |
| 6583 | + instance.openChangeTimeout.clear(); | |
| 6584 | + instance.restTimeout.clear(); | |
| 6585 | + instance.restTimeoutPending = false; | |
| 6586 | + } | |
| 6587 | + const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0; | |
| 6588 | + if (move2) { | |
| 6419 | 6589 | return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { |
| 6420 | 6590 | once: true |
| 6421 | - }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); | |
| 6591 | + }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); | |
| 6422 | 6592 | } |
| 6423 | - return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); | |
| 6424 | - }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store2, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen]); | |
| 6425 | - return React28.useMemo(() => { | |
| 6593 | + return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); | |
| 6594 | + }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store2, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move2, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]); | |
| 6595 | + return React27.useMemo(() => { | |
| 6426 | 6596 | if (!enabled) { |
| 6427 | 6597 | return void 0; |
| 6428 | 6598 | } |
| 6429 | 6599 | function setPointerRef(event) { |
| @@ -6702,61 +6872,21 @@ | ||
| 6702 | 6872 | }; |
| 6703 | 6873 | return fn; |
| 6704 | 6874 | } |
| 6705 | 6875 | |
| 6706 | - // node_modules/@base-ui/react/utils/popupStateMapping.mjs | |
| 6707 | - var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { | |
| 6708 | - CommonPopupDataAttributes2["open"] = "data-open"; | |
| 6709 | - CommonPopupDataAttributes2["closed"] = "data-closed"; | |
| 6710 | - CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; | |
| 6711 | - CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; | |
| 6712 | - CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; | |
| 6713 | - CommonPopupDataAttributes2["side"] = "data-side"; | |
| 6714 | - CommonPopupDataAttributes2["align"] = "data-align"; | |
| 6715 | - return CommonPopupDataAttributes2; | |
| 6716 | - })({}); | |
| 6717 | - var CommonTriggerDataAttributes = /* @__PURE__ */ (function(CommonTriggerDataAttributes2) { | |
| 6718 | - CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open"; | |
| 6719 | - CommonTriggerDataAttributes2["pressed"] = "data-pressed"; | |
| 6720 | - return CommonTriggerDataAttributes2; | |
| 6721 | - })({}); | |
| 6722 | - var TRIGGER_HOOK = { | |
| 6723 | - [CommonTriggerDataAttributes.popupOpen]: "" | |
| 6724 | - }; | |
| 6725 | - var PRESSABLE_TRIGGER_HOOK = { | |
| 6726 | - [CommonTriggerDataAttributes.popupOpen]: "", | |
| 6727 | - [CommonTriggerDataAttributes.pressed]: "" | |
| 6728 | - }; | |
| 6729 | - var POPUP_OPEN_HOOK = { | |
| 6730 | - [CommonPopupDataAttributes.open]: "" | |
| 6731 | - }; | |
| 6732 | - var POPUP_CLOSED_HOOK = { | |
| 6733 | - [CommonPopupDataAttributes.closed]: "" | |
| 6734 | - }; | |
| 6735 | - var ANCHOR_HIDDEN_HOOK = { | |
| 6736 | - [CommonPopupDataAttributes.anchorHidden]: "" | |
| 6737 | - }; | |
| 6738 | - var triggerOpenStateMapping = { | |
| 6739 | - open(value) { | |
| 6740 | - if (value) { | |
| 6741 | - return TRIGGER_HOOK; | |
| 6742 | - } | |
| 6743 | - return null; | |
| 6876 | + // node_modules/@base-ui/react/utils/NullStore.mjs | |
| 6877 | + var NullStore = class extends ReactStore { | |
| 6878 | + // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding | |
| 6879 | + // `setState` alone would neutralize them today. They are overridden explicitly so the store stays | |
| 6880 | + // inert even if a future base-class change stops routing a mutator through `setState`. | |
| 6881 | + setState(_newState) { | |
| 6744 | 6882 | } |
| 6745 | - }; | |
| 6746 | - var popupStateMapping = { | |
| 6747 | - open(value) { | |
| 6748 | - if (value) { | |
| 6749 | - return POPUP_OPEN_HOOK; | |
| 6750 | - } | |
| 6751 | - return POPUP_CLOSED_HOOK; | |
| 6752 | - }, | |
| 6753 | - anchorHidden(value) { | |
| 6754 | - if (value) { | |
| 6755 | - return ANCHOR_HIDDEN_HOOK; | |
| 6756 | - } | |
| 6757 | - return null; | |
| 6883 | + update(_changes) { | |
| 6758 | 6884 | } |
| 6885 | + set(_key, _value) { | |
| 6886 | + } | |
| 6887 | + notifyAll() { | |
| 6888 | + } | |
| 6759 | 6889 | }; |
| 6760 | 6890 | |
| 6761 | 6891 | // node_modules/@base-ui/utils/inertValue.mjs |
| 6762 | 6892 | function inertValue(value) { |
| @@ -6765,9 +6895,18 @@ | ||
| 6765 | 6895 | } |
| 6766 | 6896 | return value ? "true" : void 0; |
| 6767 | 6897 | } |
| 6768 | 6898 | |
| 6769 | - // node_modules/@base-ui/react/utils/useAnchorPositioning.mjs | |
| 6899 | + // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs | |
| 6900 | + var React28 = __toESM(require_react(), 1); | |
| 6901 | + var DirectionContext = /* @__PURE__ */ React28.createContext(void 0); | |
| 6902 | + if (true) DirectionContext.displayName = "DirectionContext"; | |
| 6903 | + function useDirection() { | |
| 6904 | + const context = React28.useContext(DirectionContext); | |
| 6905 | + return context?.direction ?? "ltr"; | |
| 6906 | + } | |
| 6907 | + | |
| 6908 | + // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs | |
| 6770 | 6909 | var React29 = __toESM(require_react(), 1); |
| 6771 | 6910 | |
| 6772 | 6911 | // node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs |
| 6773 | 6912 | var baseArrow = (options) => ({ |
| @@ -6832,15 +6971,21 @@ | ||
| 6832 | 6971 | reset: shouldAddOffset |
| 6833 | 6972 | }; |
| 6834 | 6973 | } |
| 6835 | 6974 | }); |
| 6836 | - var arrow4 = (options, deps) => ({ | |
| 6837 | - ...baseArrow(options), | |
| 6838 | - options: [options, deps] | |
| 6839 | - }); | |
| 6975 | + var arrow4 = (options, deps) => { | |
| 6976 | + const { | |
| 6977 | + name, | |
| 6978 | + fn | |
| 6979 | + } = baseArrow(options); | |
| 6980 | + return { | |
| 6981 | + name, | |
| 6982 | + fn, | |
| 6983 | + options: [options, deps] | |
| 6984 | + }; | |
| 6985 | + }; | |
| 6840 | 6986 | |
| 6841 | 6987 | // node_modules/@base-ui/react/utils/hideMiddleware.mjs |
| 6842 | - var nativeHideFn = hide3().fn; | |
| 6843 | 6988 | var hide4 = { |
| 6844 | 6989 | name: "hide", |
| 6845 | 6990 | async fn(state) { |
| 6846 | 6991 | const { |
| @@ -6848,91 +6993,39 @@ | ||
| 6848 | 6993 | height, |
| 6849 | 6994 | x, |
| 6850 | 6995 | y |
| 6851 | 6996 | } = state.rects.reference; |
| 6852 | - const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0; | |
| 6853 | - const nativeHideResult = await nativeHideFn(state); | |
| 6997 | + const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0; | |
| 6998 | + const overflow = await state.platform.detectOverflow(state, { | |
| 6999 | + elementContext: "reference" | |
| 7000 | + }); | |
| 7001 | + const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; | |
| 6854 | 7002 | return { |
| 6855 | 7003 | data: { |
| 6856 | - referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden | |
| 7004 | + referenceHidden: referenceHidden || anchorHidden2 | |
| 6857 | 7005 | } |
| 6858 | 7006 | }; |
| 6859 | 7007 | } |
| 6860 | 7008 | }; |
| 6861 | 7009 | |
| 6862 | - // node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs | |
| 7010 | + // node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs | |
| 6863 | 7011 | var DEFAULT_SIDES = { |
| 6864 | 7012 | sideX: "left", |
| 6865 | 7013 | sideY: "top" |
| 6866 | 7014 | }; |
| 6867 | - var adaptiveOrigin = { | |
| 6868 | - name: "adaptiveOrigin", | |
| 6869 | - async fn(state) { | |
| 6870 | - const { | |
| 6871 | - x: rawX, | |
| 6872 | - y: rawY, | |
| 6873 | - rects: { | |
| 6874 | - floating: floatRect | |
| 6875 | - }, | |
| 6876 | - elements: { | |
| 6877 | - floating | |
| 6878 | - }, | |
| 6879 | - platform: platform3, | |
| 6880 | - strategy, | |
| 6881 | - placement | |
| 6882 | - } = state; | |
| 6883 | - const win = getWindow(floating); | |
| 6884 | - const styles = win.getComputedStyle(floating); | |
| 6885 | - const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; | |
| 6886 | - if (!hasTransition) { | |
| 6887 | - return { | |
| 6888 | - x: rawX, | |
| 6889 | - y: rawY, | |
| 6890 | - data: DEFAULT_SIDES | |
| 6891 | - }; | |
| 6892 | - } | |
| 6893 | - const offsetParent = await platform3.getOffsetParent?.(floating); | |
| 6894 | - let offsetDimensions = { | |
| 6895 | - width: 0, | |
| 6896 | - height: 0 | |
| 6897 | - }; | |
| 6898 | - if (strategy === "fixed" && win?.visualViewport) { | |
| 6899 | - offsetDimensions = { | |
| 6900 | - width: win.visualViewport.width, | |
| 6901 | - height: win.visualViewport.height | |
| 6902 | - }; | |
| 6903 | - } else if (offsetParent === win) { | |
| 6904 | - const doc = ownerDocument(floating); | |
| 6905 | - offsetDimensions = { | |
| 6906 | - width: doc.documentElement.clientWidth, | |
| 6907 | - height: doc.documentElement.clientHeight | |
| 6908 | - }; | |
| 6909 | - } else if (await platform3.isElement?.(offsetParent)) { | |
| 6910 | - offsetDimensions = await platform3.getDimensions(offsetParent); | |
| 6911 | - } | |
| 6912 | - const currentSide = getSide(placement); | |
| 6913 | - let x = rawX; | |
| 6914 | - let y = rawY; | |
| 6915 | - if (currentSide === "left") { | |
| 6916 | - x = offsetDimensions.width - (rawX + floatRect.width); | |
| 6917 | - } | |
| 6918 | - if (currentSide === "top") { | |
| 6919 | - y = offsetDimensions.height - (rawY + floatRect.height); | |
| 6920 | - } | |
| 6921 | - const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; | |
| 6922 | - const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; | |
| 6923 | - return { | |
| 6924 | - x, | |
| 6925 | - y, | |
| 6926 | - data: { | |
| 6927 | - sideX, | |
| 6928 | - sideY | |
| 6929 | - } | |
| 6930 | - }; | |
| 6931 | - } | |
| 6932 | - }; | |
| 6933 | 7015 | |
| 6934 | - // node_modules/@base-ui/react/utils/useAnchorPositioning.mjs | |
| 7016 | + // node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs | |
| 7017 | + var availableWidth = "--available-width"; | |
| 7018 | + var availableHeight = "--available-height"; | |
| 7019 | + var anchorWidth = "--anchor-width"; | |
| 7020 | + var anchorHeight = "--anchor-height"; | |
| 7021 | + var transformOrigin = "--transform-origin"; | |
| 7022 | + var positionerWidth = "--positioner-width"; | |
| 7023 | + var positionerHeight = "--positioner-height"; | |
| 7024 | + | |
| 7025 | + // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs | |
| 7026 | + var AVAILABLE_WIDTH_VAR = availableWidth; | |
| 7027 | + var AVAILABLE_HEIGHT_VAR = availableHeight; | |
| 6935 | 7028 | function getLogicalSide(sideParam, renderedSide, isRtl) { |
| 6936 | 7029 | const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; |
| 6937 | 7030 | const logicalRight = isRtl ? "inline-start" : "inline-end"; |
| 6938 | 7031 | const logicalLeft = isRtl ? "inline-end" : "inline-start"; |
| @@ -6962,8 +7055,11 @@ | ||
| 6962 | 7055 | }; |
| 6963 | 7056 | return data; |
| 6964 | 7057 | } |
| 6965 | 7058 | function useAnchorPositioning(params) { |
| 7059 | + return useAnchorPositioningWithHook(params, useBaseUIFloating); | |
| 7060 | + } | |
| 7061 | + function useAnchorPositioningWithHook(params, useFloatingHook) { | |
| 6966 | 7062 | const { |
| 6967 | 7063 | // Public parameters |
| 6968 | 7064 | anchor, |
| 6969 | 7065 | positionMethod = "absolute", |
| @@ -6981,9 +7077,9 @@ | ||
| 6981 | 7077 | keepMounted = false, |
| 6982 | 7078 | floatingRootContext, |
| 6983 | 7079 | mounted, |
| 6984 | 7080 | collisionAvoidance, |
| 6985 | - shiftCrossAxis = false, | |
| 7081 | + shift: shift4, | |
| 6986 | 7082 | nodeId, |
| 6987 | 7083 | adaptiveOrigin: adaptiveOrigin2, |
| 6988 | 7084 | lazyFlip = false, |
| 6989 | 7085 | externalTree |
| @@ -6994,8 +7090,10 @@ | ||
| 6994 | 7090 | } |
| 6995 | 7091 | const collisionAvoidanceSide = collisionAvoidance.side || "flip"; |
| 6996 | 7092 | const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; |
| 6997 | 7093 | const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; |
| 7094 | + const shiftCrossAxis = shift4?.crossAxis ?? false; | |
| 7095 | + const shiftRootBoundary = shift4?.rootBoundary; | |
| 6998 | 7096 | const anchorFn = typeof anchor === "function" ? anchor : void 0; |
| 6999 | 7097 | const anchorFnCallback = useStableCallback(anchorFn); |
| 7000 | 7098 | const anchorDep = anchorFn ? anchorFnCallback : anchor; |
| 7001 | 7099 | const anchorValueRef = useValueAsRef(anchor); |
| @@ -7011,28 +7109,28 @@ | ||
| 7011 | 7109 | "inline-start": isRtl ? "right" : "left" |
| 7012 | 7110 | }[sideParam]; |
| 7013 | 7111 | const placement = align === "center" ? side : `${side}-${align}`; |
| 7014 | 7112 | let collisionPadding = collisionPaddingParam; |
| 7015 | - const bias = 1; | |
| 7016 | - const biasTop = sideParam === "bottom" ? bias : 0; | |
| 7017 | - const biasBottom = sideParam === "top" ? bias : 0; | |
| 7018 | - const biasLeft = sideParam === "right" ? bias : 0; | |
| 7019 | - const biasRight = sideParam === "left" ? bias : 0; | |
| 7020 | 7113 | if (typeof collisionPadding === "number") { |
| 7021 | 7114 | collisionPadding = { |
| 7022 | - top: collisionPadding + biasTop, | |
| 7023 | - right: collisionPadding + biasRight, | |
| 7024 | - bottom: collisionPadding + biasBottom, | |
| 7025 | - left: collisionPadding + biasLeft | |
| 7115 | + top: collisionPadding, | |
| 7116 | + right: collisionPadding, | |
| 7117 | + bottom: collisionPadding, | |
| 7118 | + left: collisionPadding | |
| 7026 | 7119 | }; |
| 7027 | 7120 | } else if (collisionPadding) { |
| 7028 | 7121 | collisionPadding = { |
| 7029 | - top: (collisionPadding.top || 0) + biasTop, | |
| 7030 | - right: (collisionPadding.right || 0) + biasRight, | |
| 7031 | - bottom: (collisionPadding.bottom || 0) + biasBottom, | |
| 7032 | - left: (collisionPadding.left || 0) + biasLeft | |
| 7122 | + top: collisionPadding.top || 0, | |
| 7123 | + right: collisionPadding.right || 0, | |
| 7124 | + bottom: collisionPadding.bottom || 0, | |
| 7125 | + left: collisionPadding.left || 0 | |
| 7033 | 7126 | }; |
| 7034 | 7127 | } |
| 7128 | + const bias = 1; | |
| 7129 | + const biasTop = sideParam === "bottom" ? bias : 0; | |
| 7130 | + const biasBottom = sideParam === "top" ? bias : 0; | |
| 7131 | + const biasLeft = sideParam === "right" ? bias : 0; | |
| 7132 | + const biasRight = sideParam === "left" ? bias : 0; | |
| 7035 | 7133 | const commonCollisionProps = { |
| 7036 | 7134 | boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, |
| 7037 | 7135 | padding: collisionPadding |
| 7038 | 7136 | }; |
| @@ -7061,48 +7159,39 @@ | ||
| 7061 | 7159 | ...commonCollisionProps, |
| 7062 | 7160 | // Ensure the popup flips if it's been limited by its --available-height and it resizes. |
| 7063 | 7161 | // Since the size() padding is smaller than the flip() padding, flip() will take precedence. |
| 7064 | 7162 | padding: { |
| 7065 | - top: collisionPadding.top + bias, | |
| 7066 | - right: collisionPadding.right + bias, | |
| 7067 | - bottom: collisionPadding.bottom + bias, | |
| 7068 | - left: collisionPadding.left + bias | |
| 7163 | + top: collisionPadding.top + bias + biasTop, | |
| 7164 | + right: collisionPadding.right + bias + biasRight, | |
| 7165 | + bottom: collisionPadding.bottom + bias + biasBottom, | |
| 7166 | + left: collisionPadding.left + bias + biasLeft | |
| 7069 | 7167 | }, |
| 7070 | 7168 | mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", |
| 7071 | 7169 | crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, |
| 7072 | 7170 | fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide |
| 7073 | 7171 | }); |
| 7074 | - const shiftMiddleware = shiftDisabled ? null : shift3((data) => { | |
| 7075 | - const html = ownerDocument(data.elements.floating).documentElement; | |
| 7076 | - return { | |
| 7077 | - ...commonCollisionProps, | |
| 7078 | - // Use the Layout Viewport to avoid shifting around when pinch-zooming | |
| 7079 | - // for context menus. | |
| 7080 | - rootBoundary: shiftCrossAxis ? { | |
| 7081 | - x: 0, | |
| 7082 | - y: 0, | |
| 7083 | - width: html.clientWidth, | |
| 7084 | - height: html.clientHeight | |
| 7085 | - } : void 0, | |
| 7086 | - mainAxis: collisionAvoidanceAlign !== "none", | |
| 7087 | - crossAxis: crossAxisShiftEnabled, | |
| 7088 | - limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { | |
| 7089 | - if (!arrowRef.current) { | |
| 7090 | - return {}; | |
| 7091 | - } | |
| 7092 | - const { | |
| 7093 | - width, | |
| 7094 | - height | |
| 7095 | - } = arrowRef.current.getBoundingClientRect(); | |
| 7096 | - const sideAxis = getSideAxis(getSide(limitData.placement)); | |
| 7097 | - const arrowSize = sideAxis === "y" ? width : height; | |
| 7098 | - const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; | |
| 7099 | - return { | |
| 7100 | - offset: arrowSize / 2 + offsetAmount / 2 | |
| 7101 | - }; | |
| 7102 | - }) | |
| 7103 | - }; | |
| 7104 | - }, [commonCollisionProps, sticky, shiftCrossAxis, collisionPadding, collisionAvoidanceAlign]); | |
| 7172 | + const shiftMiddleware = shiftDisabled ? null : shift3({ | |
| 7173 | + ...commonCollisionProps, | |
| 7174 | + // Use the Layout Viewport to avoid shifting around when pinch-zooming. | |
| 7175 | + rootBoundary: shiftRootBoundary, | |
| 7176 | + mainAxis: collisionAvoidanceAlign !== "none", | |
| 7177 | + crossAxis: crossAxisShiftEnabled, | |
| 7178 | + limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { | |
| 7179 | + if (!arrowRef.current) { | |
| 7180 | + return {}; | |
| 7181 | + } | |
| 7182 | + const { | |
| 7183 | + width, | |
| 7184 | + height | |
| 7185 | + } = arrowRef.current.getBoundingClientRect(); | |
| 7186 | + const sideAxis = getSideAxis(getSide(limitData.placement)); | |
| 7187 | + const arrowSize = sideAxis === "y" ? width : height; | |
| 7188 | + const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; | |
| 7189 | + return { | |
| 7190 | + offset: arrowSize / 2 + offsetAmount / 2 | |
| 7191 | + }; | |
| 7192 | + }) | |
| 7193 | + }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]); | |
| 7105 | 7194 | if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") { |
| 7106 | 7195 | middleware.push(shiftMiddleware, flipMiddleware); |
| 7107 | 7196 | } else { |
| 7108 | 7197 | middleware.push(flipMiddleware, shiftMiddleware); |
| @@ -7112,10 +7201,10 @@ | ||
| 7112 | 7201 | apply({ |
| 7113 | 7202 | elements: { |
| 7114 | 7203 | floating |
| 7115 | 7204 | }, |
| 7116 | - availableWidth, | |
| 7117 | - availableHeight, | |
| 7205 | + availableWidth: availableWidth2, | |
| 7206 | + availableHeight: availableHeight2, | |
| 7118 | 7207 | rects |
| 7119 | 7208 | }) { |
| 7120 | 7209 | if (!mountedRef.current) { |
| 7121 | 7210 | return; |
| @@ -7120,10 +7209,10 @@ | ||
| 7120 | 7209 | if (!mountedRef.current) { |
| 7121 | 7210 | return; |
| 7122 | 7211 | } |
| 7123 | 7212 | const floatingStyle = floating.style; |
| 7124 | - floatingStyle.setProperty("--available-width", `${availableWidth}px`); | |
| 7125 | - floatingStyle.setProperty("--available-height", `${availableHeight}px`); | |
| 7213 | + floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`); | |
| 7214 | + floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`); | |
| 7126 | 7215 | const dpr = getWindow(floating).devicePixelRatio || 1; |
| 7127 | 7216 | const { |
| 7128 | 7217 | x: x2, |
| 7129 | 7218 | y: y2, |
| @@ -7129,50 +7218,51 @@ | ||
| 7129 | 7218 | y: y2, |
| 7130 | 7219 | width, |
| 7131 | 7220 | height |
| 7132 | 7221 | } = rects.reference; |
| 7133 | - const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; | |
| 7134 | - const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; | |
| 7135 | - floatingStyle.setProperty("--anchor-width", `${anchorWidth}px`); | |
| 7136 | - floatingStyle.setProperty("--anchor-height", `${anchorHeight}px`); | |
| 7222 | + const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; | |
| 7223 | + const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; | |
| 7224 | + floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`); | |
| 7225 | + floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`); | |
| 7137 | 7226 | } |
| 7138 | 7227 | }), arrow4((state) => ({ |
| 7139 | 7228 | // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, |
| 7140 | 7229 | // we'll create a fake element. |
| 7141 | 7230 | element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), |
| 7142 | - padding: arrowPadding, | |
| 7231 | + // No padding for the fake arrow: it would displace aligned popups on narrow anchors. | |
| 7232 | + padding: arrowRef.current ? arrowPadding : 0, | |
| 7143 | 7233 | offsetParent: "floating" |
| 7144 | 7234 | }), [arrowPadding]), { |
| 7145 | 7235 | name: "transformOrigin", |
| 7146 | 7236 | fn(state) { |
| 7147 | 7237 | const { |
| 7148 | - elements: elements2, | |
| 7238 | + elements: { | |
| 7239 | + floating | |
| 7240 | + }, | |
| 7149 | 7241 | middlewareData: middlewareData2, |
| 7150 | 7242 | placement: renderedPlacement2, |
| 7243 | + platform: platform3, | |
| 7151 | 7244 | rects, |
| 7152 | 7245 | y: y2 |
| 7153 | 7246 | } = state; |
| 7154 | - const currentRenderedSide = getSide(renderedPlacement2); | |
| 7155 | - const currentRenderedAxis = getSideAxis(currentRenderedSide); | |
| 7247 | + const renderedSide2 = getSide(renderedPlacement2); | |
| 7248 | + const renderedAlign2 = getAlignment(renderedPlacement2); | |
| 7249 | + const isVertical = getSideAxis(renderedSide2) === "y"; | |
| 7156 | 7250 | const arrowEl = arrowRef.current; |
| 7157 | - const arrowX = middlewareData2.arrow?.x || 0; | |
| 7158 | - const arrowY = middlewareData2.arrow?.y || 0; | |
| 7159 | - const arrowWidth = arrowEl?.clientWidth || 0; | |
| 7160 | - const arrowHeight = arrowEl?.clientHeight || 0; | |
| 7161 | - const transformX = arrowX + arrowWidth / 2; | |
| 7162 | - const transformY = arrowY + arrowHeight / 2; | |
| 7163 | - const shiftY = Math.abs(middlewareData2.shift?.y || 0); | |
| 7164 | - const halfAnchorHeight = rects.reference.height / 2; | |
| 7165 | 7251 | const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; |
| 7166 | - const isOverlappingAnchor = shiftY > sideOffsetValue; | |
| 7167 | - const adjacentTransformOrigin = { | |
| 7168 | - top: `${transformX}px calc(100% + ${sideOffsetValue}px)`, | |
| 7169 | - bottom: `${transformX}px ${-sideOffsetValue}px`, | |
| 7170 | - left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`, | |
| 7171 | - right: `${-sideOffsetValue}px ${transformY}px` | |
| 7172 | - }[currentRenderedSide]; | |
| 7173 | - const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y2}px`; | |
| 7174 | - elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); | |
| 7252 | + let crossOrigin; | |
| 7253 | + if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) { | |
| 7254 | + crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%"; | |
| 7255 | + } else { | |
| 7256 | + const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0; | |
| 7257 | + const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0; | |
| 7258 | + crossOrigin = `${arrowOffset + arrowSize / 2}px`; | |
| 7259 | + } | |
| 7260 | + let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`; | |
| 7261 | + if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) { | |
| 7262 | + sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y2}px`; | |
| 7263 | + } | |
| 7264 | + floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`); | |
| 7175 | 7265 | return {}; |
| 7176 | 7266 | } |
| 7177 | 7267 | }, hide4, adaptiveOrigin2); |
| 7178 | 7268 | useIsoLayoutEffect(() => { |
| @@ -7185,8 +7275,9 @@ | ||
| 7185 | 7275 | }); |
| 7186 | 7276 | } |
| 7187 | 7277 | }, [mounted, floatingRootContext]); |
| 7188 | 7278 | const autoUpdateOptions = React29.useMemo(() => ({ |
| 7279 | + ancestorScroll: !disableAnchorTracking, | |
| 7189 | 7280 | elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", |
| 7190 | 7281 | layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" |
| 7191 | 7282 | }), [disableAnchorTracking]); |
| 7192 | 7283 | const { |
| @@ -7199,9 +7290,9 @@ | ||
| 7199 | 7290 | placement: renderedPlacement, |
| 7200 | 7291 | context, |
| 7201 | 7292 | isPositioned, |
| 7202 | 7293 | floatingStyles: originalFloatingStyles |
| 7203 | - } = useFloating2({ | |
| 7294 | + } = useFloatingHook({ | |
| 7204 | 7295 | rootContext: floatingRootContext, |
| 7205 | 7296 | open: keepMounted ? mounted : void 0, |
| 7206 | 7297 | placement, |
| 7207 | 7298 | middleware, |
| @@ -7215,17 +7306,30 @@ | ||
| 7215 | 7306 | sideY |
| 7216 | 7307 | } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; |
| 7217 | 7308 | const resolvedPosition = isPositioned ? positionMethod : "fixed"; |
| 7218 | 7309 | const floatingStyles = React29.useMemo(() => { |
| 7219 | - const base = adaptiveOrigin2 ? { | |
| 7220 | - position: resolvedPosition, | |
| 7221 | - [sideX]: x, | |
| 7222 | - [sideY]: y | |
| 7223 | - } : { | |
| 7224 | - position: resolvedPosition, | |
| 7225 | - ...originalFloatingStyles | |
| 7226 | - }; | |
| 7310 | + let base; | |
| 7227 | 7311 | if (!isPositioned) { |
| 7312 | + base = { | |
| 7313 | + position: resolvedPosition, | |
| 7314 | + top: 0, | |
| 7315 | + left: 0 | |
| 7316 | + }; | |
| 7317 | + } else if (adaptiveOrigin2) { | |
| 7318 | + base = { | |
| 7319 | + position: resolvedPosition, | |
| 7320 | + [sideX]: x, | |
| 7321 | + [sideY]: y | |
| 7322 | + }; | |
| 7323 | + } else { | |
| 7324 | + base = { | |
| 7325 | + ...originalFloatingStyles, | |
| 7326 | + position: resolvedPosition | |
| 7327 | + }; | |
| 7328 | + } | |
| 7329 | + base[AVAILABLE_WIDTH_VAR] = "100vw"; | |
| 7330 | + base[AVAILABLE_HEIGHT_VAR] = "100vh"; | |
| 7331 | + if (!isPositioned) { | |
| 7228 | 7332 | base.opacity = 0; |
| 7229 | 7333 | } |
| 7230 | 7334 | return base; |
| 7231 | 7335 | }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); |
| @@ -7264,14 +7368,14 @@ | ||
| 7264 | 7368 | }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); |
| 7265 | 7369 | const renderedSide = getSide(renderedPlacement); |
| 7266 | 7370 | const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); |
| 7267 | 7371 | const renderedAlign = getAlignment(renderedPlacement) || "center"; |
| 7268 | - const anchorHidden = Boolean(middlewareData.hide?.referenceHidden); | |
| 7372 | + const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden); | |
| 7269 | 7373 | useIsoLayoutEffect(() => { |
| 7270 | - if (lazyFlip && mounted && isPositioned) { | |
| 7374 | + if (lazyFlip && mounted && isPositioned && renderedSide !== side) { | |
| 7271 | 7375 | setMountSide(renderedSide); |
| 7272 | 7376 | } |
| 7273 | - }, [lazyFlip, mounted, isPositioned, renderedSide]); | |
| 7377 | + }, [lazyFlip, mounted, isPositioned, renderedSide, side]); | |
| 7274 | 7378 | const arrowStyles = React29.useMemo(() => ({ |
| 7275 | 7379 | position: "absolute", |
| 7276 | 7380 | top: middlewareData.arrow?.y, |
| 7277 | 7381 | left: middlewareData.arrow?.x |
| @@ -7284,20 +7388,20 @@ | ||
| 7284 | 7388 | arrowUncentered, |
| 7285 | 7389 | side: logicalRenderedSide, |
| 7286 | 7390 | align: renderedAlign, |
| 7287 | 7391 | physicalSide: renderedSide, |
| 7288 | - anchorHidden, | |
| 7392 | + anchorHidden: anchorHidden2, | |
| 7289 | 7393 | refs, |
| 7290 | 7394 | context, |
| 7291 | 7395 | isPositioned, |
| 7292 | 7396 | update: update2 |
| 7293 | - }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); | |
| 7397 | + }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]); | |
| 7294 | 7398 | } |
| 7295 | 7399 | function isRef(param) { |
| 7296 | 7400 | return param != null && "current" in param; |
| 7297 | 7401 | } |
| 7298 | 7402 | |
| 7299 | - // node_modules/@base-ui/react/utils/getDisabledMountTransitionStyles.mjs | |
| 7403 | + // node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs | |
| 7300 | 7404 | function getDisabledMountTransitionStyles(transitionStatus) { |
| 7301 | 7405 | return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; |
| 7302 | 7406 | } |
| 7303 | 7407 | |
| @@ -7328,9 +7432,9 @@ | ||
| 7328 | 7432 | }); |
| 7329 | 7433 | } |
| 7330 | 7434 | |
| 7331 | 7435 | // node_modules/@base-ui/react/utils/usePopupViewport.mjs |
| 7332 | - var React32 = __toESM(require_react(), 1); | |
| 7436 | + var React33 = __toESM(require_react(), 1); | |
| 7333 | 7437 | var ReactDOM6 = __toESM(require_react_dom(), 1); |
| 7334 | 7438 | |
| 7335 | 7439 | // node_modules/@base-ui/utils/usePreviousValue.mjs |
| 7336 | 7440 | var React30 = __toESM(require_react(), 1); |
| @@ -7338,9 +7442,9 @@ | ||
| 7338 | 7442 | const [state, setState] = React30.useState({ |
| 7339 | 7443 | current: value, |
| 7340 | 7444 | previous: null |
| 7341 | 7445 | }); |
| 7342 | - if (value !== state.current) { | |
| 7446 | + if (!Object.is(value, state.current)) { | |
| 7343 | 7447 | setState({ |
| 7344 | 7448 | current: value, |
| 7345 | 7449 | previous: state.current |
| 7346 | 7450 | }); |
| @@ -7369,8 +7473,12 @@ | ||
| 7369 | 7473 | height |
| 7370 | 7474 | }; |
| 7371 | 7475 | } |
| 7372 | 7476 | |
| 7477 | + // node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs | |
| 7478 | + var popupWidth = "--popup-width"; | |
| 7479 | + var popupHeight = "--popup-height"; | |
| 7480 | + | |
| 7373 | 7481 | // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs |
| 7374 | 7482 | function usePopupAutoResize(parameters) { |
| 7375 | 7483 | const { |
| 7376 | 7484 | popupElement, |
| @@ -7381,9 +7489,9 @@ | ||
| 7381 | 7489 | onMeasureLayoutComplete: onMeasureLayoutCompleteParam, |
| 7382 | 7490 | side, |
| 7383 | 7491 | direction |
| 7384 | 7492 | } = parameters; |
| 7385 | - const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true, false); | |
| 7493 | + const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true); | |
| 7386 | 7494 | const animationFrame = useAnimationFrame(); |
| 7387 | 7495 | const committedDimensionsRef = React31.useRef(null); |
| 7388 | 7496 | const isInitialRenderRef = React31.useRef(true); |
| 7389 | 7497 | const restoreAnchoringStylesRef = React31.useRef(NOOP); |
| @@ -7388,24 +7496,9 @@ | ||
| 7388 | 7496 | const isInitialRenderRef = React31.useRef(true); |
| 7389 | 7497 | const restoreAnchoringStylesRef = React31.useRef(NOOP); |
| 7390 | 7498 | const onMeasureLayout = useStableCallback(onMeasureLayoutParam); |
| 7391 | 7499 | const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); |
| 7392 | - const anchoringStyles = React31.useMemo(() => { | |
| 7393 | - let isOriginSide = side === "top"; | |
| 7394 | - let isPhysicalLeft = side === "left"; | |
| 7395 | - if (direction === "rtl") { | |
| 7396 | - isOriginSide = isOriginSide || side === "inline-end"; | |
| 7397 | - isPhysicalLeft = isPhysicalLeft || side === "inline-end"; | |
| 7398 | - } else { | |
| 7399 | - isOriginSide = isOriginSide || side === "inline-start"; | |
| 7400 | - isPhysicalLeft = isPhysicalLeft || side === "inline-start"; | |
| 7401 | - } | |
| 7402 | - return isOriginSide ? { | |
| 7403 | - position: "absolute", | |
| 7404 | - [side === "top" ? "bottom" : "top"]: "0", | |
| 7405 | - [isPhysicalLeft ? "right" : "left"]: "0" | |
| 7406 | - } : EMPTY_OBJECT; | |
| 7407 | - }, [side, direction]); | |
| 7500 | + const anchoringStyles = React31.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]); | |
| 7408 | 7501 | useIsoLayoutEffect(() => { |
| 7409 | 7502 | if (!mounted) { |
| 7410 | 7503 | restoreAnchoringStylesRef.current = NOOP; |
| 7411 | 7504 | isInitialRenderRef.current = true; |
| @@ -7420,10 +7513,10 @@ | ||
| 7420 | 7513 | const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); |
| 7421 | 7514 | const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); |
| 7422 | 7515 | const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); |
| 7423 | 7516 | const restorePositionerAvailableSize = applyElementStyles(positionerElement, { |
| 7424 | - "--available-width": "max-content", | |
| 7425 | - "--available-height": "max-content" | |
| 7517 | + [availableWidth]: "max-content", | |
| 7518 | + [availableHeight]: "max-content" | |
| 7426 | 7519 | }); |
| 7427 | 7520 | function restoreMeasurementOverrides() { |
| 7428 | 7521 | restorePopupPosition(); |
| 7429 | 7522 | restorePopupTransform(); |
| @@ -7458,10 +7551,10 @@ | ||
| 7458 | 7551 | const abortController = new AbortController(); |
| 7459 | 7552 | animationFrame.request(() => { |
| 7460 | 7553 | setPopupCssSize(popupElement, newDimensions); |
| 7461 | 7554 | runOnceAnimationsFinish(() => { |
| 7462 | - popupElement.style.setProperty("--popup-width", "auto"); | |
| 7463 | - popupElement.style.setProperty("--popup-height", "auto"); | |
| 7555 | + popupElement.style.setProperty(popupWidth, "auto"); | |
| 7556 | + popupElement.style.setProperty(popupHeight, "auto"); | |
| 7464 | 7557 | }, abortController.signal); |
| 7465 | 7558 | }); |
| 7466 | 7559 | return () => { |
| 7467 | 7560 | abortController.abort(); |
| @@ -7470,8 +7563,20 @@ | ||
| 7470 | 7563 | restoreAnchoringStylesRef.current = NOOP; |
| 7471 | 7564 | }; |
| 7472 | 7565 | }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); |
| 7473 | 7566 | } |
| 7567 | + function getPopupAnchoringStyles(side, direction) { | |
| 7568 | + const isPhysicalTop = side === "top"; | |
| 7569 | + const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start"); | |
| 7570 | + if (!isPhysicalTop && !isPhysicalLeft) { | |
| 7571 | + return EMPTY_OBJECT; | |
| 7572 | + } | |
| 7573 | + return { | |
| 7574 | + position: "absolute", | |
| 7575 | + [isPhysicalTop ? "bottom" : "top"]: "0", | |
| 7576 | + [isPhysicalLeft ? "right" : "left"]: "0" | |
| 7577 | + }; | |
| 7578 | + } | |
| 7474 | 7579 | function overrideElementStyle(element, property, value) { |
| 7475 | 7580 | const originalValue = element.style.getPropertyValue(property); |
| 7476 | 7581 | element.style.setProperty(property, value); |
| 7477 | 7582 | return () => { |
| @@ -7489,50 +7594,143 @@ | ||
| 7489 | 7594 | } |
| 7490 | 7595 | function setPopupCssSize(popupElement, size4) { |
| 7491 | 7596 | const width = size4 === "auto" ? "auto" : `${size4.width}px`; |
| 7492 | 7597 | const height = size4 === "auto" ? "auto" : `${size4.height}px`; |
| 7493 | - popupElement.style.setProperty("--popup-width", width); | |
| 7494 | - popupElement.style.setProperty("--popup-height", height); | |
| 7598 | + popupElement.style.setProperty(popupWidth, width); | |
| 7599 | + popupElement.style.setProperty(popupHeight, height); | |
| 7495 | 7600 | } |
| 7496 | 7601 | function setPositionerCssSize(positionerElement, size4) { |
| 7497 | 7602 | const width = size4 === "max-content" ? "max-content" : `${size4.width}px`; |
| 7498 | 7603 | const height = size4 === "max-content" ? "max-content" : `${size4.height}px`; |
| 7499 | - positionerElement.style.setProperty("--positioner-width", width); | |
| 7500 | - positionerElement.style.setProperty("--positioner-height", height); | |
| 7604 | + positionerElement.style.setProperty(positionerWidth, width); | |
| 7605 | + positionerElement.style.setProperty(positionerHeight, height); | |
| 7501 | 7606 | } |
| 7502 | 7607 | |
| 7608 | + // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs | |
| 7609 | + var React32 = __toESM(require_react(), 1); | |
| 7610 | + var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); | |
| 7611 | + var DirectionProvider = function DirectionProvider2(props) { | |
| 7612 | + const { | |
| 7613 | + direction = "ltr" | |
| 7614 | + } = props; | |
| 7615 | + const contextValue = React32.useMemo(() => ({ | |
| 7616 | + direction | |
| 7617 | + }), [direction]); | |
| 7618 | + return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(DirectionContext.Provider, { | |
| 7619 | + value: contextValue, | |
| 7620 | + children: props.children | |
| 7621 | + }); | |
| 7622 | + }; | |
| 7623 | + if (true) DirectionProvider.displayName = "DirectionProvider"; | |
| 7624 | + | |
| 7625 | + // node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs | |
| 7626 | + var adaptiveOrigin = { | |
| 7627 | + name: "adaptiveOrigin", | |
| 7628 | + async fn(state) { | |
| 7629 | + const { | |
| 7630 | + x: rawX, | |
| 7631 | + y: rawY, | |
| 7632 | + rects: { | |
| 7633 | + floating: floatRect | |
| 7634 | + }, | |
| 7635 | + elements: { | |
| 7636 | + floating | |
| 7637 | + }, | |
| 7638 | + platform: platform3, | |
| 7639 | + strategy, | |
| 7640 | + placement | |
| 7641 | + } = state; | |
| 7642 | + const win = getWindow(floating); | |
| 7643 | + const styles = win.getComputedStyle(floating); | |
| 7644 | + const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; | |
| 7645 | + if (!hasTransition) { | |
| 7646 | + return { | |
| 7647 | + x: rawX, | |
| 7648 | + y: rawY, | |
| 7649 | + data: DEFAULT_SIDES | |
| 7650 | + }; | |
| 7651 | + } | |
| 7652 | + const offsetParent = await platform3.getOffsetParent?.(floating); | |
| 7653 | + let offsetDimensions = { | |
| 7654 | + width: 0, | |
| 7655 | + height: 0 | |
| 7656 | + }; | |
| 7657 | + if (strategy === "fixed" && win?.visualViewport) { | |
| 7658 | + offsetDimensions = { | |
| 7659 | + width: win.visualViewport.width, | |
| 7660 | + height: win.visualViewport.height | |
| 7661 | + }; | |
| 7662 | + } else if (offsetParent === win) { | |
| 7663 | + const doc = ownerDocument(floating); | |
| 7664 | + offsetDimensions = { | |
| 7665 | + width: doc.documentElement.clientWidth, | |
| 7666 | + height: doc.documentElement.clientHeight | |
| 7667 | + }; | |
| 7668 | + } else if (await platform3.isElement?.(offsetParent)) { | |
| 7669 | + offsetDimensions = await platform3.getDimensions(offsetParent); | |
| 7670 | + } | |
| 7671 | + const currentSide = getSide(placement); | |
| 7672 | + let x = rawX; | |
| 7673 | + let y = rawY; | |
| 7674 | + if (currentSide === "left") { | |
| 7675 | + x = offsetDimensions.width - (rawX + floatRect.width); | |
| 7676 | + } | |
| 7677 | + if (currentSide === "top") { | |
| 7678 | + y = offsetDimensions.height - (rawY + floatRect.height); | |
| 7679 | + } | |
| 7680 | + const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; | |
| 7681 | + const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; | |
| 7682 | + return { | |
| 7683 | + x, | |
| 7684 | + y, | |
| 7685 | + data: { | |
| 7686 | + sideX, | |
| 7687 | + sideY | |
| 7688 | + } | |
| 7689 | + }; | |
| 7690 | + } | |
| 7691 | + }; | |
| 7692 | + | |
| 7693 | + // node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs | |
| 7694 | + var activationDirection = "data-activation-direction"; | |
| 7695 | + | |
| 7503 | 7696 | // node_modules/@base-ui/react/utils/usePopupViewport.mjs |
| 7504 | - var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); | |
| 7697 | + var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); | |
| 7698 | + var popupViewportStateMapping = { | |
| 7699 | + activationDirection: (value) => value ? { | |
| 7700 | + [activationDirection]: value | |
| 7701 | + } : null | |
| 7702 | + }; | |
| 7505 | 7703 | function usePopupViewport(parameters) { |
| 7506 | 7704 | const { |
| 7507 | 7705 | store: store2, |
| 7508 | 7706 | side, |
| 7509 | - cssVars, | |
| 7510 | 7707 | children |
| 7511 | 7708 | } = parameters; |
| 7512 | 7709 | const direction = useDirection(); |
| 7513 | 7710 | const activeTrigger = store2.useState("activeTriggerElement"); |
| 7514 | 7711 | const activeTriggerId = store2.useState("activeTriggerId"); |
| 7515 | - const open = store2.useState("open"); | |
| 7712 | + const open2 = store2.useState("open"); | |
| 7516 | 7713 | const payload = store2.useState("payload"); |
| 7517 | 7714 | const mounted = store2.useState("mounted"); |
| 7518 | 7715 | const popupElement = store2.useState("popupElement"); |
| 7519 | 7716 | const positionerElement = store2.useState("positionerElement"); |
| 7520 | - const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null); | |
| 7717 | + const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null); | |
| 7521 | 7718 | const currentContentKey = usePopupContentKey(activeTriggerId, payload); |
| 7522 | - const capturedNodeRef = React32.useRef(null); | |
| 7523 | - const [previousContentNode, setPreviousContentNode] = React32.useState(null); | |
| 7524 | - const [newTriggerOffset, setNewTriggerOffset] = React32.useState(null); | |
| 7525 | - const currentContainerRef = React32.useRef(null); | |
| 7526 | - const previousContainerRef = React32.useRef(null); | |
| 7527 | - const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true, false); | |
| 7719 | + const capturedNodeRef = React33.useRef(null); | |
| 7720 | + const [previousContentNode, setPreviousContentNode] = React33.useState(null); | |
| 7721 | + const [newTriggerOffset, setNewTriggerOffset] = React33.useState(null); | |
| 7722 | + const currentContainerRef = React33.useRef(null); | |
| 7723 | + const previousContainerRef = React33.useRef(null); | |
| 7724 | + const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true); | |
| 7528 | 7725 | const cleanupFrame = useAnimationFrame(); |
| 7529 | - const [previousContentDimensions, setPreviousContentDimensions] = React32.useState(null); | |
| 7530 | - const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React32.useState(false); | |
| 7726 | + const cleanupControllerRef = React33.useRef(null); | |
| 7727 | + const [previousContentDimensions, setPreviousContentDimensions] = React33.useState(null); | |
| 7728 | + const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React33.useState(false); | |
| 7531 | 7729 | useIsoLayoutEffect(() => { |
| 7532 | - store2.set("hasViewport", true); | |
| 7730 | + store2.set("adaptiveOrigin", adaptiveOrigin); | |
| 7533 | 7731 | return () => { |
| 7534 | - store2.set("hasViewport", false); | |
| 7732 | + store2.set("adaptiveOrigin", void 0); | |
| 7535 | 7733 | }; |
| 7536 | 7734 | }, [store2]); |
| 7537 | 7735 | const handleMeasureLayout = useStableCallback(() => { |
| 7538 | 7736 | currentContainerRef.current?.style.setProperty("animation", "none"); |
| @@ -7546,14 +7744,24 @@ | ||
| 7546 | 7744 | if (previousDimensions) { |
| 7547 | 7745 | setPreviousContentDimensions(previousDimensions); |
| 7548 | 7746 | } |
| 7549 | 7747 | }); |
| 7550 | - const lastHandledTriggerRef = React32.useRef(null); | |
| 7748 | + const armViewportCleanup = useStableCallback(() => { | |
| 7749 | + cleanupControllerRef.current?.abort(); | |
| 7750 | + const controller = new AbortController(); | |
| 7751 | + cleanupControllerRef.current = controller; | |
| 7752 | + onAnimationsFinished(() => { | |
| 7753 | + setPreviousContentNode(null); | |
| 7754 | + setPreviousContentDimensions(null); | |
| 7755 | + capturedNodeRef.current = null; | |
| 7756 | + }, controller.signal); | |
| 7757 | + }); | |
| 7758 | + const lastHandledTriggerRef = React33.useRef(null); | |
| 7551 | 7759 | useIsoLayoutEffect(() => { |
| 7552 | - if (!open || !mounted) { | |
| 7760 | + if (!open2 || !mounted) { | |
| 7553 | 7761 | lastHandledTriggerRef.current = null; |
| 7554 | 7762 | } |
| 7555 | - }, [open, mounted]); | |
| 7763 | + }, [open2, mounted]); | |
| 7556 | 7764 | useIsoLayoutEffect(() => { |
| 7557 | 7765 | if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { |
| 7558 | 7766 | setPreviousContentNode(capturedNodeRef.current); |
| 7559 | 7767 | setShowStartingStyleAttribute(true); |
| @@ -7558,22 +7766,25 @@ | ||
| 7558 | 7766 | setPreviousContentNode(capturedNodeRef.current); |
| 7559 | 7767 | setShowStartingStyleAttribute(true); |
| 7560 | 7768 | const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); |
| 7561 | 7769 | setNewTriggerOffset(offset4); |
| 7562 | - cleanupFrame.request(() => { | |
| 7563 | - ReactDOM6.flushSync(() => { | |
| 7564 | - setShowStartingStyleAttribute(false); | |
| 7565 | - }); | |
| 7566 | - onAnimationsFinished(() => { | |
| 7567 | - setPreviousContentNode(null); | |
| 7568 | - setPreviousContentDimensions(null); | |
| 7569 | - capturedNodeRef.current = null; | |
| 7570 | - }); | |
| 7571 | - }); | |
| 7572 | 7770 | lastHandledTriggerRef.current = activeTrigger; |
| 7573 | 7771 | } |
| 7574 | - }, [activeTrigger, previousActiveTrigger, previousContentNode, onAnimationsFinished, cleanupFrame]); | |
| 7772 | + }, [activeTrigger, previousActiveTrigger]); | |
| 7575 | 7773 | useIsoLayoutEffect(() => { |
| 7774 | + if (previousContentNode == null) { | |
| 7775 | + return; | |
| 7776 | + } | |
| 7777 | + cleanupControllerRef.current?.abort(); | |
| 7778 | + setShowStartingStyleAttribute(true); | |
| 7779 | + cleanupFrame.request(() => { | |
| 7780 | + ReactDOM6.flushSync(() => { | |
| 7781 | + setShowStartingStyleAttribute(false); | |
| 7782 | + }); | |
| 7783 | + armViewportCleanup(); | |
| 7784 | + }); | |
| 7785 | + }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]); | |
| 7786 | + useIsoLayoutEffect(() => { | |
| 7576 | 7787 | const source = currentContainerRef.current; |
| 7577 | 7788 | if (!source) { |
| 7578 | 7789 | return; |
| 7579 | 7790 | } |
| @@ -7585,28 +7796,28 @@ | ||
| 7585 | 7796 | }); |
| 7586 | 7797 | const isTransitioning = previousContentNode != null; |
| 7587 | 7798 | let childrenToRender; |
| 7588 | 7799 | if (!isTransitioning) { |
| 7589 | - childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { | |
| 7800 | + childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { | |
| 7590 | 7801 | "data-current": true, |
| 7591 | 7802 | ref: currentContainerRef, |
| 7592 | 7803 | children |
| 7593 | 7804 | }, currentContentKey); |
| 7594 | 7805 | } else { |
| 7595 | - childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(React32.Fragment, { | |
| 7596 | - children: [/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { | |
| 7806 | + childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React33.Fragment, { | |
| 7807 | + children: [/* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { | |
| 7597 | 7808 | "data-previous": true, |
| 7598 | 7809 | inert: inertValue(true), |
| 7599 | 7810 | ref: previousContainerRef, |
| 7600 | 7811 | style: { |
| 7601 | 7812 | ...previousContentDimensions ? { |
| 7602 | - [cssVars.popupWidth]: `${previousContentDimensions.width}px`, | |
| 7603 | - [cssVars.popupHeight]: `${previousContentDimensions.height}px` | |
| 7813 | + [popupWidth]: `${previousContentDimensions.width}px`, | |
| 7814 | + [popupHeight]: `${previousContentDimensions.height}px` | |
| 7604 | 7815 | } : null, |
| 7605 | 7816 | position: "absolute" |
| 7606 | 7817 | }, |
| 7607 | 7818 | "data-ending-style": showStartingStyleAttribute ? void 0 : "" |
| 7608 | - }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { | |
| 7819 | + }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("div", { | |
| 7609 | 7820 | "data-current": true, |
| 7610 | 7821 | ref: currentContainerRef, |
| 7611 | 7822 | "data-starting-style": showStartingStyleAttribute ? "" : void 0, |
| 7612 | 7823 | children |
| @@ -7670,12 +7881,12 @@ | ||
| 7670 | 7881 | vertical: toCenter.y - fromCenter.y |
| 7671 | 7882 | }; |
| 7672 | 7883 | } |
| 7673 | 7884 | function usePopupContentKey(activeTriggerId, payload) { |
| 7674 | - const [contentKey, setContentKey] = React32.useState(0); | |
| 7675 | - const previousActiveTriggerIdRef = React32.useRef(activeTriggerId); | |
| 7676 | - const previousPayloadRef = React32.useRef(payload); | |
| 7677 | - const pendingPayloadUpdateRef = React32.useRef(false); | |
| 7885 | + const [contentKey, setContentKey] = React33.useState(0); | |
| 7886 | + const previousActiveTriggerIdRef = React33.useRef(activeTriggerId); | |
| 7887 | + const previousPayloadRef = React33.useRef(payload); | |
| 7888 | + const pendingPayloadUpdateRef = React33.useRef(false); | |
| 7678 | 7889 | useIsoLayoutEffect(() => { |
| 7679 | 7890 | const previousActiveTriggerId = previousActiveTriggerIdRef.current; |
| 7680 | 7891 | const previousPayload = previousPayloadRef.current; |
| 7681 | 7892 | const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; |
| @@ -7693,12 +7904,12 @@ | ||
| 7693 | 7904 | return `${activeTriggerId ?? "current"}-${contentKey}`; |
| 7694 | 7905 | } |
| 7695 | 7906 | |
| 7696 | 7907 | // node_modules/@base-ui/react/utils/FloatingPortalLite.mjs |
| 7697 | - var React33 = __toESM(require_react(), 1); | |
| 7908 | + var React34 = __toESM(require_react(), 1); | |
| 7698 | 7909 | var ReactDOM7 = __toESM(require_react_dom(), 1); |
| 7699 | - var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); | |
| 7700 | - var FloatingPortalLite = /* @__PURE__ */ React33.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { | |
| 7910 | + var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); | |
| 7911 | + var FloatingPortalLite = /* @__PURE__ */ React34.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { | |
| 7701 | 7912 | const { |
| 7702 | 7913 | children, |
| 7703 | 7914 | container, |
| 7704 | 7915 | className, |
| @@ -7706,10 +7917,10 @@ | ||
| 7706 | 7917 | style, |
| 7707 | 7918 | ...elementProps |
| 7708 | 7919 | } = componentProps; |
| 7709 | 7920 | const { |
| 7710 | - portalNode, | |
| 7711 | - portalSubtree | |
| 7921 | + node: portalNode, | |
| 7922 | + subtree: portalSubtree | |
| 7712 | 7923 | } = useFloatingPortalNode({ |
| 7713 | 7924 | container, |
| 7714 | 7925 | ref: forwardedRef, |
| 7715 | 7926 | componentProps, |
| @@ -7717,9 +7928,9 @@ | ||
| 7717 | 7928 | }); |
| 7718 | 7929 | if (!portalSubtree && !portalNode) { |
| 7719 | 7930 | return null; |
| 7720 | 7931 | } |
| 7721 | - return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React33.Fragment, { | |
| 7932 | + return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React34.Fragment, { | |
| 7722 | 7933 | children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] |
| 7723 | 7934 | }); |
| 7724 | 7935 | }); |
| 7725 | 7936 | if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; |
| @@ -7739,16 +7950,16 @@ | ||
| 7739 | 7950 | createHandle: () => createTooltipHandle |
| 7740 | 7951 | }); |
| 7741 | 7952 | |
| 7742 | 7953 | // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs |
| 7743 | - var React36 = __toESM(require_react(), 1); | |
| 7954 | + var React37 = __toESM(require_react(), 1); | |
| 7744 | 7955 | |
| 7745 | 7956 | // node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs |
| 7746 | - var React34 = __toESM(require_react(), 1); | |
| 7747 | - var TooltipRootContext = /* @__PURE__ */ React34.createContext(void 0); | |
| 7957 | + var React35 = __toESM(require_react(), 1); | |
| 7958 | + var TooltipRootContext = /* @__PURE__ */ React35.createContext(void 0); | |
| 7748 | 7959 | if (true) TooltipRootContext.displayName = "TooltipRootContext"; |
| 7749 | 7960 | function useTooltipRootContext(optional) { |
| 7750 | - const context = React34.useContext(TooltipRootContext); | |
| 7961 | + const context = React35.useContext(TooltipRootContext); | |
| 7751 | 7962 | if (context === void 0 && !optional) { |
| 7752 | 7963 | throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); |
| 7753 | 7964 | } |
| 7754 | 7965 | return context; |
| @@ -7754,35 +7965,25 @@ | ||
| 7754 | 7965 | return context; |
| 7755 | 7966 | } |
| 7756 | 7967 | |
| 7757 | 7968 | // node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs |
| 7758 | - var React35 = __toESM(require_react(), 1); | |
| 7969 | + var React36 = __toESM(require_react(), 1); | |
| 7759 | 7970 | var selectors2 = { |
| 7760 | 7971 | ...popupStoreSelectors, |
| 7761 | - disabled: createSelector((state) => state.disabled), | |
| 7762 | - instantType: createSelector((state) => state.instantType), | |
| 7763 | - isInstantPhase: createSelector((state) => state.isInstantPhase), | |
| 7764 | - trackCursorAxis: createSelector((state) => state.trackCursorAxis), | |
| 7765 | - disableHoverablePopup: createSelector((state) => state.disableHoverablePopup), | |
| 7766 | - lastOpenChangeReason: createSelector((state) => state.openChangeReason), | |
| 7767 | - closeOnClick: createSelector((state) => state.closeOnClick), | |
| 7768 | - closeDelay: createSelector((state) => state.closeDelay), | |
| 7769 | - hasViewport: createSelector((state) => state.hasViewport) | |
| 7972 | + disabled: (state) => state.disabled, | |
| 7973 | + instantType: (state) => state.instantType, | |
| 7974 | + isInstantPhase: (state) => state.isInstantPhase, | |
| 7975 | + trackCursorAxis: (state) => state.trackCursorAxis, | |
| 7976 | + disableHoverablePopup: (state) => state.disableHoverablePopup, | |
| 7977 | + lastOpenChangeReason: (state) => state.openChangeReason, | |
| 7978 | + closeOnClick: (state) => state.closeOnClick, | |
| 7979 | + closeDelay: (state) => state.closeDelay, | |
| 7980 | + adaptiveOrigin: (state) => state.adaptiveOrigin | |
| 7770 | 7981 | }; |
| 7771 | - var TooltipStore = class _TooltipStore extends ReactStore { | |
| 7772 | - constructor(initialState, floatingId, nested = false) { | |
| 7982 | + var TooltipStore = class extends ReactStore { | |
| 7983 | + constructor(initialState, floatingId, nested) { | |
| 7773 | 7984 | const triggerElements = new PopupTriggerMap(); |
| 7774 | - const state = { | |
| 7775 | - ...createInitialState(), | |
| 7776 | - ...initialState | |
| 7777 | - }; | |
| 7778 | - state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested); | |
| 7779 | - super(state, { | |
| 7780 | - popupRef: /* @__PURE__ */ React35.createRef(), | |
| 7781 | - onOpenChange: void 0, | |
| 7782 | - onOpenChangeComplete: void 0, | |
| 7783 | - triggerElements | |
| 7784 | - }, selectors2); | |
| 7985 | + super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2); | |
| 7785 | 7986 | } |
| 7786 | 7987 | setOpen = (nextOpen, eventDetails) => { |
| 7787 | 7988 | applyPopupOpenChange(this, nextOpen, eventDetails, { |
| 7788 | 7989 | extraState: { |
| @@ -7793,16 +7994,20 @@ | ||
| 7793 | 7994 | // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. |
| 7794 | 7995 | cancelPendingOpen(event) { |
| 7795 | 7996 | this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); |
| 7796 | 7997 | } |
| 7797 | - static useStore(externalStore, initialState) { | |
| 7798 | - const store2 = usePopupStore(externalStore, (floatingId, nested) => new _TooltipStore(initialState, floatingId, nested)).store; | |
| 7799 | - return store2; | |
| 7800 | - } | |
| 7801 | 7998 | }; |
| 7802 | - function createInitialState() { | |
| 7803 | - return { | |
| 7804 | - ...createInitialPopupStoreState(), | |
| 7999 | + function createNullTooltipStore() { | |
| 8000 | + const triggerElements = new PopupTriggerMap(); | |
| 8001 | + const store2 = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2); | |
| 8002 | + return Object.assign(store2, { | |
| 8003 | + setOpen: NOOP, | |
| 8004 | + cancelPendingOpen: NOOP | |
| 8005 | + }); | |
| 8006 | + } | |
| 8007 | + function createInitialState(initialState, triggerElements, floatingId, nested = false) { | |
| 8008 | + const state = { | |
| 8009 | + ...createInitialPopupStoreState(triggerElements, floatingId, nested), | |
| 7805 | 8010 | disabled: false, |
| 7806 | 8011 | instantType: void 0, |
| 7807 | 8012 | isInstantPhase: false, |
| 7808 | 8013 | trackCursorAxis: "none", |
| @@ -7809,14 +8014,24 @@ | ||
| 7809 | 8014 | disableHoverablePopup: false, |
| 7810 | 8015 | openChangeReason: null, |
| 7811 | 8016 | closeOnClick: true, |
| 7812 | 8017 | closeDelay: 0, |
| 7813 | - hasViewport: false | |
| 8018 | + adaptiveOrigin: void 0, | |
| 8019 | + ...initialState | |
| 7814 | 8020 | }; |
| 8021 | + return state; | |
| 7815 | 8022 | } |
| 8023 | + function createInitialContext(triggerElements) { | |
| 8024 | + return { | |
| 8025 | + popupRef: /* @__PURE__ */ React36.createRef(), | |
| 8026 | + onOpenChange: void 0, | |
| 8027 | + onOpenChangeComplete: void 0, | |
| 8028 | + triggerElements | |
| 8029 | + }; | |
| 8030 | + } | |
| 7816 | 8031 | |
| 7817 | 8032 | // node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs |
| 7818 | - var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); | |
| 8033 | + var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); | |
| 7819 | 8034 | var TooltipRoot = fastComponent(function TooltipRoot2(props) { |
| 7820 | 8035 | const { |
| 7821 | 8036 | disabled: disabled2 = false, |
| 7822 | 8037 | defaultOpen = false, |
| @@ -7830,29 +8045,28 @@ | ||
| 7830 | 8045 | triggerId: triggerIdProp, |
| 7831 | 8046 | defaultTriggerId: defaultTriggerIdProp = null, |
| 7832 | 8047 | children |
| 7833 | 8048 | } = props; |
| 7834 | - const store2 = TooltipStore.useStore(handle?.store, { | |
| 8049 | + const store2 = usePopupRootStore((floatingId, nested) => new TooltipStore({ | |
| 7835 | 8050 | open: defaultOpen, |
| 7836 | 8051 | openProp, |
| 7837 | 8052 | activeTriggerId: defaultTriggerIdProp, |
| 7838 | 8053 | triggerIdProp |
| 7839 | - }); | |
| 7840 | - useInitialOpenSync(store2, openProp, defaultOpen, defaultTriggerIdProp); | |
| 8054 | + }, floatingId, nested)); | |
| 7841 | 8055 | store2.useControlledProp("openProp", openProp); |
| 7842 | 8056 | store2.useControlledProp("triggerIdProp", triggerIdProp); |
| 7843 | 8057 | store2.useContextCallback("onOpenChange", onOpenChange); |
| 7844 | 8058 | store2.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); |
| 7845 | 8059 | const openState = store2.useState("open"); |
| 7846 | - const open = !disabled2 && openState; | |
| 8060 | + const open2 = !disabled2 && openState; | |
| 7847 | 8061 | const activeTriggerId = store2.useState("activeTriggerId"); |
| 7848 | 8062 | const mounted = store2.useState("mounted"); |
| 7849 | 8063 | const payload = store2.useState("payload"); |
| 7850 | 8064 | store2.useSyncedValues({ |
| 7851 | 8065 | trackCursorAxis, |
| 7852 | - disableHoverablePopup | |
| 8066 | + disableHoverablePopup, | |
| 8067 | + disabled: disabled2 | |
| 7853 | 8068 | }); |
| 7854 | - store2.useSyncedValue("disabled", disabled2); | |
| 7855 | 8069 | useImplicitActiveTrigger(store2, { |
| 7856 | 8070 | closeOnActiveTriggerUnmount: true |
| 7857 | 8071 | }); |
| 7858 | 8072 | const { |
| @@ -7857,13 +8071,13 @@ | ||
| 7857 | 8071 | }); |
| 7858 | 8072 | const { |
| 7859 | 8073 | forceUnmount, |
| 7860 | 8074 | transitionStatus |
| 7861 | - } = useOpenStateTransitions(open, store2); | |
| 8075 | + } = useOpenStateTransitions(open2, store2); | |
| 7862 | 8076 | const isInstantPhase = store2.useState("isInstantPhase"); |
| 7863 | 8077 | const instantType = store2.useState("instantType"); |
| 7864 | 8078 | const lastOpenChangeReason = store2.useState("lastOpenChangeReason"); |
| 7865 | - const previousInstantTypeRef = React36.useRef(null); | |
| 8079 | + const previousInstantTypeRef = React37.useRef(null); | |
| 7866 | 8080 | useIsoLayoutEffect(() => { |
| 7867 | 8081 | if (openState && disabled2) { |
| 7868 | 8082 | store2.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); |
| 7869 | 8083 | } |
| @@ -7879,25 +8093,25 @@ | ||
| 7879 | 8093 | previousInstantTypeRef.current = null; |
| 7880 | 8094 | } |
| 7881 | 8095 | }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store2]); |
| 7882 | 8096 | useIsoLayoutEffect(() => { |
| 7883 | - if (open) { | |
| 8097 | + if (open2) { | |
| 7884 | 8098 | if (activeTriggerId == null) { |
| 7885 | 8099 | store2.set("payload", void 0); |
| 7886 | 8100 | } |
| 7887 | 8101 | } |
| 7888 | - }, [store2, activeTriggerId, open]); | |
| 7889 | - const handleImperativeClose = React36.useCallback(() => { | |
| 7890 | - store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); | |
| 7891 | - }, [store2]); | |
| 7892 | - React36.useImperativeHandle(actionsRef, () => ({ | |
| 8102 | + }, [store2, activeTriggerId, open2]); | |
| 8103 | + React37.useImperativeHandle(actionsRef, () => ({ | |
| 7893 | 8104 | unmount: forceUnmount, |
| 7894 | - close: handleImperativeClose | |
| 7895 | - }), [forceUnmount, handleImperativeClose]); | |
| 7896 | - const shouldRenderInteractions = open || mounted || !disabled2 && trackCursorAxis !== "none"; | |
| 7897 | - return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TooltipRootContext.Provider, { | |
| 8105 | + close: () => store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) | |
| 8106 | + }), [forceUnmount, store2]); | |
| 8107 | + const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none"; | |
| 8108 | + return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TooltipRootContext.Provider, { | |
| 7898 | 8109 | value: store2, |
| 7899 | - children: [shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipInteractions, { | |
| 8110 | + children: [handle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopupHandleAttachment, { | |
| 8111 | + handle, | |
| 8112 | + store: store2 | |
| 8113 | + }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipInteractions, { | |
| 7900 | 8114 | store: store2, |
| 7901 | 8115 | disabled: disabled2, |
| 7902 | 8116 | trackCursorAxis |
| 7903 | 8117 | }), typeof children === "function" ? children({ |
| @@ -7919,37 +8133,28 @@ | ||
| 7919 | 8133 | const clientPoint = useClientPoint(floatingRootContext, { |
| 7920 | 8134 | enabled: !disabled2 && trackCursorAxis !== "none", |
| 7921 | 8135 | axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis |
| 7922 | 8136 | }); |
| 7923 | - const activeTriggerProps = React36.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); | |
| 7924 | - const inactiveTriggerProps = React36.useMemo(() => mergeProps(clientPoint.trigger, dismiss.trigger), [clientPoint.trigger, dismiss.trigger]); | |
| 7925 | - const popupProps = React36.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, clientPoint.floating, dismiss.floating), [clientPoint.floating, dismiss.floating]); | |
| 8137 | + const triggerProps = React37.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); | |
| 7926 | 8138 | usePopupInteractionProps(store2, { |
| 7927 | - activeTriggerProps, | |
| 7928 | - inactiveTriggerProps, | |
| 7929 | - popupProps | |
| 8139 | + activeTriggerProps: triggerProps, | |
| 8140 | + inactiveTriggerProps: triggerProps, | |
| 8141 | + popupProps: dismiss.floating ?? EMPTY_OBJECT | |
| 7930 | 8142 | }); |
| 7931 | 8143 | return null; |
| 7932 | 8144 | } |
| 7933 | 8145 | |
| 7934 | 8146 | // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs |
| 7935 | - var React38 = __toESM(require_react(), 1); | |
| 8147 | + var React39 = __toESM(require_react(), 1); | |
| 7936 | 8148 | |
| 7937 | 8149 | // node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs |
| 7938 | - var React37 = __toESM(require_react(), 1); | |
| 7939 | - var TooltipProviderContext = /* @__PURE__ */ React37.createContext(void 0); | |
| 8150 | + var React38 = __toESM(require_react(), 1); | |
| 8151 | + var TooltipProviderContext = /* @__PURE__ */ React38.createContext(void 0); | |
| 7940 | 8152 | if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; |
| 7941 | 8153 | function useTooltipProviderContext() { |
| 7942 | - return React37.useContext(TooltipProviderContext); | |
| 8154 | + return React38.useContext(TooltipProviderContext); | |
| 7943 | 8155 | } |
| 7944 | 8156 | |
| 7945 | - // node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs | |
| 7946 | - var TooltipTriggerDataAttributes = (function(TooltipTriggerDataAttributes2) { | |
| 7947 | - TooltipTriggerDataAttributes2[TooltipTriggerDataAttributes2["popupOpen"] = CommonTriggerDataAttributes.popupOpen] = "popupOpen"; | |
| 7948 | - TooltipTriggerDataAttributes2["triggerDisabled"] = "data-trigger-disabled"; | |
| 7949 | - return TooltipTriggerDataAttributes2; | |
| 7950 | - })({}); | |
| 7951 | - | |
| 7952 | 8157 | // node_modules/@base-ui/react/tooltip/utils/constants.mjs |
| 7953 | 8158 | var OPEN_DELAY = 600; |
| 7954 | 8159 | |
| 7955 | 8160 | // node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs |
| @@ -7972,16 +8177,12 @@ | ||
| 7972 | 8177 | } |
| 7973 | 8178 | function closestEnabledTooltipTrigger(element) { |
| 7974 | 8179 | let current = element; |
| 7975 | 8180 | while (current) { |
| 7976 | - if (current.hasAttribute(TOOLTIP_TRIGGER_IDENTIFIER)) { | |
| 7977 | - return current; | |
| 8181 | + const trigger = current.closest(`[${TOOLTIP_TRIGGER_IDENTIFIER}]`); | |
| 8182 | + if (trigger) { | |
| 8183 | + return trigger; | |
| 7978 | 8184 | } |
| 7979 | - const parentElement = current.parentElement; | |
| 7980 | - if (parentElement) { | |
| 7981 | - current = parentElement; | |
| 7982 | - continue; | |
| 7983 | - } | |
| 7984 | 8185 | const root = current.getRootNode(); |
| 7985 | 8186 | current = "host" in root && isElement(root.host) ? root.host : null; |
| 7986 | 8187 | } |
| 7987 | 8188 | return null; |
| @@ -8000,9 +8201,10 @@ | ||
| 8000 | 8201 | id: idProp, |
| 8001 | 8202 | ...elementProps |
| 8002 | 8203 | } = componentProps; |
| 8003 | 8204 | const rootContext = useTooltipRootContext(true); |
| 8004 | - const store2 = handle?.store ?? rootContext; | |
| 8205 | + const handleStore = usePopupHandleStore(handle); | |
| 8206 | + const store2 = handleStore ?? rootContext; | |
| 8005 | 8207 | if (!store2) { |
| 8006 | 8208 | throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82)); |
| 8007 | 8209 | } |
| 8008 | 8210 | const thisTriggerId = useBaseUiId(idProp); |
| @@ -8008,10 +8210,9 @@ | ||
| 8008 | 8210 | const thisTriggerId = useBaseUiId(idProp); |
| 8009 | 8211 | const isTriggerActive = store2.useState("isTriggerActive", thisTriggerId); |
| 8010 | 8212 | const isOpenedByThisTrigger = store2.useState("isOpenedByTrigger", thisTriggerId); |
| 8011 | 8213 | const floatingRootContext = store2.useState("floatingRootContext"); |
| 8012 | - const triggerElementRef = React38.useRef(null); | |
| 8013 | - const delayWithDefault = delay ?? OPEN_DELAY; | |
| 8214 | + const triggerElementRef = React39.useRef(null); | |
| 8014 | 8215 | const closeDelayWithDefault = closeDelay ?? 0; |
| 8015 | 8216 | const { |
| 8016 | 8217 | registerTrigger, |
| 8017 | 8218 | isMountedByThisTrigger |
| @@ -8019,10 +8220,11 @@ | ||
| 8019 | 8220 | payload, |
| 8020 | 8221 | closeOnClick, |
| 8021 | 8222 | closeDelay: closeDelayWithDefault |
| 8022 | 8223 | }); |
| 8023 | - const providerContext = useTooltipProviderContext(); | |
| 8224 | + const providerDelay = useTooltipProviderContext(); | |
| 8024 | 8225 | const { |
| 8226 | + activeIdRef, | |
| 8025 | 8227 | delayRef, |
| 8026 | 8228 | isInstantPhase, |
| 8027 | 8229 | hasProvider |
| 8028 | 8230 | } = useDelayGroup(floatingRootContext, { |
| @@ -8034,23 +8236,16 @@ | ||
| 8034 | 8236 | const disabled2 = disabledProp ?? rootDisabled; |
| 8035 | 8237 | const disabledRef = useValueAsRef(disabled2); |
| 8036 | 8238 | const trackCursorAxis = store2.useState("trackCursorAxis"); |
| 8037 | 8239 | const disableHoverablePopup = store2.useState("disableHoverablePopup"); |
| 8038 | - const isNestedTriggerHoveredRef = React38.useRef(false); | |
| 8240 | + const isNestedTriggerHoveredRef = React39.useRef(false); | |
| 8039 | 8241 | const nestedTriggerOpenTimeout = useTimeout(); |
| 8040 | - const pointerTypeRef = React38.useRef(void 0); | |
| 8242 | + const pointerTypeRef = React39.useRef(void 0); | |
| 8041 | 8243 | function getOpenDelay() { |
| 8042 | - const providerDelay = providerContext?.delay; | |
| 8043 | - const groupOpenValue = typeof delayRef.current === "object" ? delayRef.current.open : void 0; | |
| 8044 | - let computedOpenDelay = delayWithDefault; | |
| 8045 | - if (hasProvider) { | |
| 8046 | - if (groupOpenValue !== 0) { | |
| 8047 | - computedOpenDelay = delay ?? providerDelay ?? delayWithDefault; | |
| 8048 | - } else { | |
| 8049 | - computedOpenDelay = 0; | |
| 8050 | - } | |
| 8244 | + if (hasProvider && activeIdRef.current != null) { | |
| 8245 | + return 0; | |
| 8051 | 8246 | } |
| 8052 | - return computedOpenDelay; | |
| 8247 | + return delay ?? providerDelay ?? OPEN_DELAY; | |
| 8053 | 8248 | } |
| 8054 | 8249 | function isEnabledNestedTriggerTarget(target) { |
| 8055 | 8250 | const triggerEl = triggerElementRef.current; |
| 8056 | 8251 | if (!triggerEl || !target) { |
| @@ -8076,15 +8271,15 @@ | ||
| 8076 | 8271 | move: false, |
| 8077 | 8272 | handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, |
| 8078 | 8273 | restMs: getOpenDelay, |
| 8079 | 8274 | delay() { |
| 8080 | - const closeValue = typeof delayRef.current === "object" ? delayRef.current.close : void 0; | |
| 8081 | - let computedCloseDelay = closeDelayWithDefault; | |
| 8082 | 8275 | if (closeDelay == null && hasProvider) { |
| 8083 | - computedCloseDelay = closeValue; | |
| 8276 | + return { | |
| 8277 | + close: getDelay(delayRef.current, "close") | |
| 8278 | + }; | |
| 8084 | 8279 | } |
| 8085 | 8280 | return { |
| 8086 | - close: computedCloseDelay | |
| 8281 | + close: closeDelayWithDefault | |
| 8087 | 8282 | }; |
| 8088 | 8283 | }, |
| 8089 | 8284 | triggerElementRef, |
| 8090 | 8285 | isActiveTrigger: isTriggerActive, |
| @@ -8107,9 +8302,9 @@ | ||
| 8107 | 8302 | return; |
| 8108 | 8303 | } |
| 8109 | 8304 | if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store2.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. |
| 8110 | 8305 | isMouseLikePointerType(pointerTypeRef.current)) { |
| 8111 | - const open = () => { | |
| 8306 | + const open2 = () => { | |
| 8112 | 8307 | if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store2.select("open")) { |
| 8113 | 8308 | store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); |
| 8114 | 8309 | } |
| 8115 | 8310 | }; |
| @@ -8115,11 +8310,11 @@ | ||
| 8115 | 8310 | }; |
| 8116 | 8311 | const openDelay = getOpenDelay(); |
| 8117 | 8312 | if (openDelay === 0) { |
| 8118 | 8313 | nestedTriggerOpenTimeout.clear(); |
| 8119 | - open(); | |
| 8314 | + open2(); | |
| 8120 | 8315 | } else { |
| 8121 | - nestedTriggerOpenTimeout.start(openDelay, open); | |
| 8316 | + nestedTriggerOpenTimeout.start(openDelay, open2); | |
| 8122 | 8317 | } |
| 8123 | 8318 | } |
| 8124 | 8319 | }; |
| 8125 | 8320 | const rootTriggerProps = store2.useState("triggerProps", isMountedByThisTrigger); |
| @@ -8159,9 +8354,9 @@ | ||
| 8159 | 8354 | store2.cancelPendingOpen(event.nativeEvent); |
| 8160 | 8355 | } |
| 8161 | 8356 | }, |
| 8162 | 8357 | id: thisTriggerId, |
| 8163 | - [TooltipTriggerDataAttributes.triggerDisabled]: disabled2 ? "" : void 0, | |
| 8358 | + [triggerDisabled]: disabled2 ? "" : void 0, | |
| 8164 | 8359 | [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" |
| 8165 | 8360 | }, elementProps], |
| 8166 | 8361 | stateAttributesMapping: triggerOpenStateMapping |
| 8167 | 8362 | }); |
| @@ -8169,16 +8364,16 @@ | ||
| 8169 | 8364 | }); |
| 8170 | 8365 | if (true) TooltipTrigger.displayName = "TooltipTrigger"; |
| 8171 | 8366 | |
| 8172 | 8367 | // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs |
| 8173 | - var React40 = __toESM(require_react(), 1); | |
| 8368 | + var React41 = __toESM(require_react(), 1); | |
| 8174 | 8369 | |
| 8175 | 8370 | // node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs |
| 8176 | - var React39 = __toESM(require_react(), 1); | |
| 8177 | - var TooltipPortalContext = /* @__PURE__ */ React39.createContext(void 0); | |
| 8371 | + var React40 = __toESM(require_react(), 1); | |
| 8372 | + var TooltipPortalContext = /* @__PURE__ */ React40.createContext(void 0); | |
| 8178 | 8373 | if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; |
| 8179 | 8374 | function useTooltipPortalContext() { |
| 8180 | - const value = React39.useContext(TooltipPortalContext); | |
| 8375 | + const value = React40.useContext(TooltipPortalContext); | |
| 8181 | 8376 | if (value === void 0) { |
| 8182 | 8377 | throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); |
| 8183 | 8378 | } |
| 8184 | 8379 | return value; |
| @@ -8184,10 +8379,10 @@ | ||
| 8184 | 8379 | return value; |
| 8185 | 8380 | } |
| 8186 | 8381 | |
| 8187 | 8382 | // node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs |
| 8188 | - var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); | |
| 8189 | - var TooltipPortal = /* @__PURE__ */ React40.forwardRef(function TooltipPortal2(props, forwardedRef) { | |
| 8383 | + var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); | |
| 8384 | + var TooltipPortal = /* @__PURE__ */ React41.forwardRef(function TooltipPortal2(props, forwardedRef) { | |
| 8190 | 8385 | const { |
| 8191 | 8386 | keepMounted = false, |
| 8192 | 8387 | ...portalProps |
| 8193 | 8388 | } = props; |
| @@ -8196,11 +8391,11 @@ | ||
| 8196 | 8391 | const shouldRender = mounted || keepMounted; |
| 8197 | 8392 | if (!shouldRender) { |
| 8198 | 8393 | return null; |
| 8199 | 8394 | } |
| 8200 | - return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPortalContext.Provider, { | |
| 8395 | + return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPortalContext.Provider, { | |
| 8201 | 8396 | value: keepMounted, |
| 8202 | - children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FloatingPortalLite, { | |
| 8397 | + children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(FloatingPortalLite, { | |
| 8203 | 8398 | ref: forwardedRef, |
| 8204 | 8399 | ...portalProps |
| 8205 | 8400 | }) |
| 8206 | 8401 | }); |
| @@ -8207,16 +8402,16 @@ | ||
| 8207 | 8402 | }); |
| 8208 | 8403 | if (true) TooltipPortal.displayName = "TooltipPortal"; |
| 8209 | 8404 | |
| 8210 | 8405 | // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs |
| 8211 | - var React42 = __toESM(require_react(), 1); | |
| 8406 | + var React43 = __toESM(require_react(), 1); | |
| 8212 | 8407 | |
| 8213 | 8408 | // node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs |
| 8214 | - var React41 = __toESM(require_react(), 1); | |
| 8215 | - var TooltipPositionerContext = /* @__PURE__ */ React41.createContext(void 0); | |
| 8409 | + var React42 = __toESM(require_react(), 1); | |
| 8410 | + var TooltipPositionerContext = /* @__PURE__ */ React42.createContext(void 0); | |
| 8216 | 8411 | if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; |
| 8217 | 8412 | function useTooltipPositionerContext() { |
| 8218 | - const context = React41.useContext(TooltipPositionerContext); | |
| 8413 | + const context = React42.useContext(TooltipPositionerContext); | |
| 8219 | 8414 | if (context === void 0) { |
| 8220 | 8415 | throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); |
| 8221 | 8416 | } |
| 8222 | 8417 | return context; |
| @@ -8222,10 +8417,10 @@ | ||
| 8222 | 8417 | return context; |
| 8223 | 8418 | } |
| 8224 | 8419 | |
| 8225 | 8420 | // node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs |
| 8226 | - var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); | |
| 8227 | - var TooltipPositioner = /* @__PURE__ */ React42.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { | |
| 8421 | + var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); | |
| 8422 | + var TooltipPositioner = /* @__PURE__ */ React43.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { | |
| 8228 | 8423 | const { |
| 8229 | 8424 | render, |
| 8230 | 8425 | className, |
| 8231 | 8426 | anchor, |
| @@ -8244,9 +8439,9 @@ | ||
| 8244 | 8439 | ...elementProps |
| 8245 | 8440 | } = componentProps; |
| 8246 | 8441 | const store2 = useTooltipRootContext(); |
| 8247 | 8442 | const keepMounted = useTooltipPortalContext(); |
| 8248 | - const open = store2.useState("open"); | |
| 8443 | + const open2 = store2.useState("open"); | |
| 8249 | 8444 | const mounted = store2.useState("mounted"); |
| 8250 | 8445 | const trackCursorAxis = store2.useState("trackCursorAxis"); |
| 8251 | 8446 | const disableHoverablePopup = store2.useState("disableHoverablePopup"); |
| 8252 | 8447 | const floatingRootContext = store2.useState("floatingRootContext"); |
| @@ -8251,9 +8446,9 @@ | ||
| 8251 | 8446 | const disableHoverablePopup = store2.useState("disableHoverablePopup"); |
| 8252 | 8447 | const floatingRootContext = store2.useState("floatingRootContext"); |
| 8253 | 8448 | const instantType = store2.useState("instantType"); |
| 8254 | 8449 | const transitionStatus = store2.useState("transitionStatus"); |
| 8255 | - const hasViewport = store2.useState("hasViewport"); | |
| 8450 | + const adaptiveOrigin2 = store2.useState("adaptiveOrigin"); | |
| 8256 | 8451 | const positioning = useAnchorPositioning({ |
| 8257 | 8452 | anchor, |
| 8258 | 8453 | positionMethod, |
| 8259 | 8454 | floatingRootContext, |
| @@ -8268,17 +8463,17 @@ | ||
| 8268 | 8463 | arrowPadding, |
| 8269 | 8464 | disableAnchorTracking, |
| 8270 | 8465 | keepMounted, |
| 8271 | 8466 | collisionAvoidance, |
| 8272 | - adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0 | |
| 8467 | + adaptiveOrigin: adaptiveOrigin2 | |
| 8273 | 8468 | }); |
| 8274 | - const state = React42.useMemo(() => ({ | |
| 8275 | - open, | |
| 8469 | + const state = React43.useMemo(() => ({ | |
| 8470 | + open: open2, | |
| 8276 | 8471 | side: positioning.side, |
| 8277 | 8472 | align: positioning.align, |
| 8278 | 8473 | anchorHidden: positioning.anchorHidden, |
| 8279 | 8474 | instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType |
| 8280 | - }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); | |
| 8475 | + }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); | |
| 8281 | 8476 | const element = usePositioner(componentProps, state, { |
| 8282 | 8477 | styles: positioning.positionerStyles, |
| 8283 | 8478 | transitionStatus, |
| 8284 | 8479 | props: elementProps, |
| @@ -8283,11 +8478,11 @@ | ||
| 8283 | 8478 | transitionStatus, |
| 8284 | 8479 | props: elementProps, |
| 8285 | 8480 | refs: [forwardedRef, store2.useStateSetter("positionerElement")], |
| 8286 | 8481 | hidden: !mounted, |
| 8287 | - inert: !open || trackCursorAxis === "both" || disableHoverablePopup | |
| 8482 | + inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup | |
| 8288 | 8483 | }); |
| 8289 | - return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPositionerContext.Provider, { | |
| 8484 | + return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPositionerContext.Provider, { | |
| 8290 | 8485 | value: positioning, |
| 8291 | 8486 | children: element |
| 8292 | 8487 | }); |
| 8293 | 8488 | }); |
| @@ -8293,14 +8488,10 @@ | ||
| 8293 | 8488 | }); |
| 8294 | 8489 | if (true) TooltipPositioner.displayName = "TooltipPositioner"; |
| 8295 | 8490 | |
| 8296 | 8491 | // node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs |
| 8297 | - var React43 = __toESM(require_react(), 1); | |
| 8298 | - var stateAttributesMapping = { | |
| 8299 | - ...popupStateMapping, | |
| 8300 | - ...transitionStatusMapping | |
| 8301 | - }; | |
| 8302 | - var TooltipPopup = /* @__PURE__ */ React43.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { | |
| 8492 | + var React44 = __toESM(require_react(), 1); | |
| 8493 | + var TooltipPopup = /* @__PURE__ */ React44.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { | |
| 8303 | 8494 | const { |
| 8304 | 8495 | render, |
| 8305 | 8496 | className, |
| 8306 | 8497 | style, |
| @@ -8310,9 +8501,9 @@ | ||
| 8310 | 8501 | const { |
| 8311 | 8502 | side, |
| 8312 | 8503 | align |
| 8313 | 8504 | } = useTooltipPositionerContext(); |
| 8314 | - const open = store2.useState("open"); | |
| 8505 | + const open2 = store2.useState("open"); | |
| 8315 | 8506 | const instantType = store2.useState("instantType"); |
| 8316 | 8507 | const transitionStatus = store2.useState("transitionStatus"); |
| 8317 | 8508 | const popupProps = store2.useState("popupProps"); |
| 8318 | 8509 | const floatingContext = store2.useState("floatingRootContext"); |
| @@ -8318,12 +8509,12 @@ | ||
| 8318 | 8509 | const floatingContext = store2.useState("floatingRootContext"); |
| 8319 | 8510 | const disabled2 = store2.useState("disabled"); |
| 8320 | 8511 | const closeDelay = store2.useState("closeDelay"); |
| 8321 | 8512 | useOpenChangeComplete({ |
| 8322 | - open, | |
| 8513 | + open: open2, | |
| 8323 | 8514 | ref: store2.context.popupRef, |
| 8324 | 8515 | onComplete() { |
| 8325 | - if (open) { | |
| 8516 | + if (open2) { | |
| 8326 | 8517 | store2.context.onOpenChangeComplete?.(true); |
| 8327 | 8518 | } |
| 8328 | 8519 | } |
| 8329 | 8520 | }); |
| @@ -8332,9 +8523,9 @@ | ||
| 8332 | 8523 | closeDelay |
| 8333 | 8524 | }); |
| 8334 | 8525 | const setPopupElement = store2.useStateSetter("popupElement"); |
| 8335 | 8526 | const state = { |
| 8336 | - open, | |
| 8527 | + open: open2, | |
| 8337 | 8528 | side, |
| 8338 | 8529 | align, |
| 8339 | 8530 | instant: instantType, |
| 8340 | 8531 | transitionStatus |
| @@ -8341,10 +8532,10 @@ | ||
| 8341 | 8532 | }; |
| 8342 | 8533 | const element = useRenderElement("div", componentProps, { |
| 8343 | 8534 | state, |
| 8344 | 8535 | ref: [forwardedRef, store2.context.popupRef, setPopupElement], |
| 8345 | - props: [popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], | |
| 8346 | - stateAttributesMapping | |
| 8536 | + props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], | |
| 8537 | + stateAttributesMapping: popupTransitionStateMapping | |
| 8347 | 8538 | }); |
| 8348 | 8539 | return element; |
| 8349 | 8540 | }); |
| 8350 | 8541 | if (true) TooltipPopup.displayName = "TooltipPopup"; |
| @@ -8349,10 +8540,10 @@ | ||
| 8349 | 8540 | }); |
| 8350 | 8541 | if (true) TooltipPopup.displayName = "TooltipPopup"; |
| 8351 | 8542 | |
| 8352 | 8543 | // node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs |
| 8353 | - var React44 = __toESM(require_react(), 1); | |
| 8354 | - var TooltipArrow = /* @__PURE__ */ React44.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { | |
| 8544 | + var React45 = __toESM(require_react(), 1); | |
| 8545 | + var TooltipArrow = /* @__PURE__ */ React45.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { | |
| 8355 | 8546 | const { |
| 8356 | 8547 | render, |
| 8357 | 8548 | className, |
| 8358 | 8549 | style, |
| @@ -8365,12 +8556,12 @@ | ||
| 8365 | 8556 | align, |
| 8366 | 8557 | arrowUncentered, |
| 8367 | 8558 | arrowStyles |
| 8368 | 8559 | } = useTooltipPositionerContext(); |
| 8369 | - const open = store2.useState("open"); | |
| 8560 | + const open2 = store2.useState("open"); | |
| 8370 | 8561 | const instantType = store2.useState("instantType"); |
| 8371 | 8562 | const state = { |
| 8372 | - open, | |
| 8563 | + open: open2, | |
| 8373 | 8564 | side, |
| 8374 | 8565 | align, |
| 8375 | 8566 | uncentered: arrowUncentered, |
| 8376 | 8567 | instant: instantType |
| @@ -8388,10 +8579,10 @@ | ||
| 8388 | 8579 | }); |
| 8389 | 8580 | if (true) TooltipArrow.displayName = "TooltipArrow"; |
| 8390 | 8581 | |
| 8391 | 8582 | // node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs |
| 8392 | - var React45 = __toESM(require_react(), 1); | |
| 8393 | - var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); | |
| 8583 | + var React46 = __toESM(require_react(), 1); | |
| 8584 | + var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); | |
| 8394 | 8585 | var TooltipProvider = function TooltipProvider2(props) { |
| 8395 | 8586 | const { |
| 8396 | 8587 | delay, |
| 8397 | 8588 | closeDelay, |
| @@ -8396,19 +8587,15 @@ | ||
| 8396 | 8587 | delay, |
| 8397 | 8588 | closeDelay, |
| 8398 | 8589 | timeout = 400 |
| 8399 | 8590 | } = props; |
| 8400 | - const contextValue = React45.useMemo(() => ({ | |
| 8401 | - delay, | |
| 8402 | - closeDelay | |
| 8403 | - }), [delay, closeDelay]); | |
| 8404 | - const delayValue = React45.useMemo(() => ({ | |
| 8591 | + const delayValue = React46.useMemo(() => ({ | |
| 8405 | 8592 | open: delay, |
| 8406 | 8593 | close: closeDelay |
| 8407 | 8594 | }), [delay, closeDelay]); |
| 8408 | - return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProviderContext.Provider, { | |
| 8409 | - value: contextValue, | |
| 8410 | - children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingDelayGroup, { | |
| 8595 | + return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipProviderContext.Provider, { | |
| 8596 | + value: delay, | |
| 8597 | + children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(FloatingDelayGroup, { | |
| 8411 | 8598 | delay: delayValue, |
| 8412 | 8599 | timeoutMs: timeout, |
| 8413 | 8600 | children: props.children |
| 8414 | 8601 | }) |
| @@ -8416,24 +8603,10 @@ | ||
| 8416 | 8603 | }; |
| 8417 | 8604 | if (true) TooltipProvider.displayName = "TooltipProvider"; |
| 8418 | 8605 | |
| 8419 | 8606 | // node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs |
| 8420 | - var React46 = __toESM(require_react(), 1); | |
| 8421 | - | |
| 8422 | - // node_modules/@base-ui/react/tooltip/viewport/TooltipViewportCssVars.mjs | |
| 8423 | - var TooltipViewportCssVars = /* @__PURE__ */ (function(TooltipViewportCssVars2) { | |
| 8424 | - TooltipViewportCssVars2["popupWidth"] = "--popup-width"; | |
| 8425 | - TooltipViewportCssVars2["popupHeight"] = "--popup-height"; | |
| 8426 | - return TooltipViewportCssVars2; | |
| 8427 | - })({}); | |
| 8428 | - | |
| 8429 | - // node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs | |
| 8430 | - var stateAttributesMapping2 = { | |
| 8431 | - activationDirection: (value) => value ? { | |
| 8432 | - "data-activation-direction": value | |
| 8433 | - } : null | |
| 8434 | - }; | |
| 8435 | - var TooltipViewport = /* @__PURE__ */ React46.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { | |
| 8607 | + var React47 = __toESM(require_react(), 1); | |
| 8608 | + var TooltipViewport = /* @__PURE__ */ React47.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { | |
| 8436 | 8609 | const { |
| 8437 | 8610 | render, |
| 8438 | 8611 | className, |
| 8439 | 8612 | style, |
| @@ -8448,9 +8621,8 @@ | ||
| 8448 | 8621 | state: viewportState |
| 8449 | 8622 | } = usePopupViewport({ |
| 8450 | 8623 | store: store2, |
| 8451 | 8624 | side: positioner.side, |
| 8452 | - cssVars: TooltipViewportCssVars, | |
| 8453 | 8625 | children |
| 8454 | 8626 | }); |
| 8455 | 8627 | const state = { |
| 8456 | 8628 | activationDirection: viewportState.activationDirection, |
| @@ -8462,48 +8634,42 @@ | ||
| 8462 | 8634 | ref: forwardedRef, |
| 8463 | 8635 | props: [elementProps, { |
| 8464 | 8636 | children: childrenToRender |
| 8465 | 8637 | }], |
| 8466 | - stateAttributesMapping: stateAttributesMapping2 | |
| 8638 | + stateAttributesMapping: popupViewportStateMapping | |
| 8467 | 8639 | }); |
| 8468 | 8640 | }); |
| 8469 | 8641 | if (true) TooltipViewport.displayName = "TooltipViewport"; |
| 8470 | 8642 | |
| 8471 | 8643 | // node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs |
| 8472 | - var TooltipHandle = class { | |
| 8473 | - /** | |
| 8474 | - * Internal store holding the tooltip state. | |
| 8475 | - * @internal | |
| 8476 | - */ | |
| 8644 | + var TooltipHandle = class extends BasePopupHandle { | |
| 8477 | 8645 | constructor() { |
| 8478 | - this.store = new TooltipStore(); | |
| 8646 | + super(createNullTooltipStore(), "Tooltip"); | |
| 8479 | 8647 | } |
| 8480 | 8648 | /** |
| 8481 | - * Opens the tooltip and associates it with the trigger with the given ID. | |
| 8482 | - * The trigger must be a Tooltip.Trigger component with this handle passed as a prop. | |
| 8649 | + * Opens the tooltip and associates it with the trigger with the given id. | |
| 8483 | 8650 | * |
| 8484 | 8651 | * This method should only be called in an event handler or an effect (not during rendering). |
| 8485 | 8652 | * |
| 8486 | - * @param triggerId ID of the trigger to associate with the tooltip. | |
| 8653 | + * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching | |
| 8654 | + * `Tooltip.Trigger` with this handle passed as a prop. | |
| 8487 | 8655 | */ |
| 8488 | 8656 | open(triggerId) { |
| 8489 | - const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0; | |
| 8490 | - if (triggerId && !triggerElement) { | |
| 8491 | - throw new Error(true ? `Base UI: TooltipHandle.open: No trigger found with id "${triggerId}".` : formatErrorMessage_default(81, triggerId)); | |
| 8492 | - } | |
| 8493 | - this.store.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); | |
| 8657 | + this.openByTrigger(triggerId); | |
| 8494 | 8658 | } |
| 8495 | 8659 | /** |
| 8496 | 8660 | * Closes the tooltip. |
| 8661 | + * | |
| 8662 | + * This method should only be called in an event handler or an effect (not during rendering). | |
| 8497 | 8663 | */ |
| 8498 | 8664 | close() { |
| 8499 | - this.store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, void 0)); | |
| 8665 | + this.closePopup(); | |
| 8500 | 8666 | } |
| 8501 | 8667 | /** |
| 8502 | - * Indicates whether the tooltip is currently open. | |
| 8668 | + * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle. | |
| 8503 | 8669 | */ |
| 8504 | 8670 | get isOpen() { |
| 8505 | - return this.store.select("open"); | |
| 8671 | + return this.attachedStore?.select("open") ?? false; | |
| 8506 | 8672 | } |
| 8507 | 8673 | }; |
| 8508 | 8674 | function createTooltipHandle() { |
| 8509 | 8675 | return new TooltipHandle(); |
| @@ -8513,68 +8679,26 @@ | ||
| 8513 | 8679 | function useRender(params) { |
| 8514 | 8680 | return useRenderElement(params.defaultTagName ?? "div", params, params); |
| 8515 | 8681 | } |
| 8516 | 8682 | |
| 8517 | - // packages/icons/build-module/library/chevron-down.mjs | |
| 8518 | - var import_primitives = __toESM(require_primitives(), 1); | |
| 8519 | - var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); | |
| 8520 | - var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) }); | |
| 8683 | + // packages/ui/build-module/tooltip/index.mjs | |
| 8684 | + var tooltip_exports = {}; | |
| 8685 | + __export(tooltip_exports, { | |
| 8686 | + Popup: () => Popup, | |
| 8687 | + Portal: () => Portal, | |
| 8688 | + Positioner: () => Positioner, | |
| 8689 | + Provider: () => Provider, | |
| 8690 | + Root: () => Root, | |
| 8691 | + Trigger: () => Trigger | |
| 8692 | + }); | |
| 8521 | 8693 | |
| 8522 | - // packages/icons/build-module/library/chevron-left.mjs | |
| 8523 | - var import_primitives2 = __toESM(require_primitives(), 1); | |
| 8524 | - var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); | |
| 8525 | - var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives2.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); | |
| 8694 | + // packages/ui/build-module/tooltip/popup.mjs | |
| 8695 | + var import_element13 = __toESM(require_element(), 1); | |
| 8526 | 8696 | |
| 8527 | - // packages/icons/build-module/library/chevron-right.mjs | |
| 8528 | - var import_primitives3 = __toESM(require_primitives(), 1); | |
| 8529 | - var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); | |
| 8530 | - var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives3.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); | |
| 8531 | - | |
| 8532 | - // packages/icons/build-module/library/chevron-up.mjs | |
| 8533 | - var import_primitives4 = __toESM(require_primitives(), 1); | |
| 8534 | - var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); | |
| 8535 | - var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives4.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) }); | |
| 8536 | - | |
| 8537 | - // packages/icons/build-module/library/fullscreen.mjs | |
| 8538 | - var import_primitives5 = __toESM(require_primitives(), 1); | |
| 8539 | - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 8540 | - var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives5.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); | |
| 8541 | - | |
| 8542 | - // packages/ui/build-module/utils/render-slot-with-children.mjs | |
| 8697 | + // packages/ui/build-module/tooltip/portal.mjs | |
| 8543 | 8698 | var import_element10 = __toESM(require_element(), 1); |
| 8544 | - function renderSlotWithChildren(slot, defaultSlot, children) { | |
| 8545 | - return (0, import_element10.cloneElement)(slot ?? defaultSlot, { children }); | |
| 8546 | - } | |
| 8547 | 8699 | |
| 8548 | - // packages/ui/build-module/utils/theme-provider.mjs | |
| 8549 | - var theme = __toESM(require_theme(), 1); | |
| 8550 | - | |
| 8551 | - // packages/ui/build-module/lock-unlock.mjs | |
| 8552 | - var import_private_apis = __toESM(require_private_apis(), 1); | |
| 8553 | - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( | |
| 8554 | - "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", | |
| 8555 | - "@wordpress/ui" | |
| 8556 | - ); | |
| 8557 | - | |
| 8558 | - // packages/ui/build-module/utils/theme-provider.mjs | |
| 8559 | - function getThemeProvider() { | |
| 8560 | - const themePackage = theme; | |
| 8561 | - if (themePackage.ThemeProvider) { | |
| 8562 | - return themePackage.ThemeProvider; | |
| 8563 | - } | |
| 8564 | - if (!themePackage.privateApis) { | |
| 8565 | - throw new Error( | |
| 8566 | - "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." | |
| 8567 | - ); | |
| 8568 | - } | |
| 8569 | - return unlock( | |
| 8570 | - themePackage.privateApis | |
| 8571 | - ).ThemeProvider; | |
| 8572 | - } | |
| 8573 | - var ThemeProvider = getThemeProvider(); | |
| 8574 | - | |
| 8575 | - // packages/ui/build-module/stack/stack.mjs | |
| 8576 | - var import_element11 = __toESM(require_element(), 1); | |
| 8700 | + // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs | |
| 8577 | 8701 | var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; |
| 8578 | 8702 | function getRuntime() { |
| 8579 | 8703 | const globalScope = globalThis; |
| 8580 | 8704 | if (globalScope.__wpStyleRuntime) { |
| @@ -8654,54 +8778,84 @@ | ||
| 8654 | 8778 | injectStyle(targetDocument, hash, css); |
| 8655 | 8779 | } |
| 8656 | 8780 | } |
| 8657 | 8781 | if (typeof process === "undefined" || true) { |
| 8658 | - registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); | |
| 8782 | + registerStyle("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}"); | |
| 8659 | 8783 | } |
| 8660 | - var style_default = { "stack": "_19ce0419607e1896__stack" }; | |
| 8661 | - var gapTokens = { | |
| 8662 | - xs: "var(--wpds-dimension-gap-xs, 4px)", | |
| 8663 | - sm: "var(--wpds-dimension-gap-sm, 8px)", | |
| 8664 | - md: "var(--wpds-dimension-gap-md, 12px)", | |
| 8665 | - lg: "var(--wpds-dimension-gap-lg, 16px)", | |
| 8666 | - xl: "var(--wpds-dimension-gap-xl, 24px)", | |
| 8667 | - "2xl": "var(--wpds-dimension-gap-2xl, 32px)", | |
| 8668 | - "3xl": "var(--wpds-dimension-gap-3xl, 40px)" | |
| 8669 | - }; | |
| 8670 | - var Stack = (0, import_element11.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { | |
| 8671 | - const style = { | |
| 8672 | - gap: gap && gapTokens[gap], | |
| 8673 | - alignItems: align, | |
| 8674 | - justifyContent: justify, | |
| 8675 | - flexDirection: direction, | |
| 8676 | - flexWrap: wrap | |
| 8677 | - }; | |
| 8678 | - const element = useRender({ | |
| 8679 | - render, | |
| 8680 | - ref, | |
| 8681 | - props: mergeProps(props, { style, className: style_default.stack }) | |
| 8682 | - }); | |
| 8784 | + var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; | |
| 8785 | + var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; | |
| 8786 | + function resolveOwnerDocument() { | |
| 8787 | + return typeof document === "undefined" ? null : document; | |
| 8788 | + } | |
| 8789 | + function isInWordPressEnvironment() { | |
| 8790 | + let topWp; | |
| 8791 | + try { | |
| 8792 | + topWp = window.top?.wp; | |
| 8793 | + } catch { | |
| 8794 | + } | |
| 8795 | + const wp = topWp ?? window.wp; | |
| 8796 | + return typeof wp?.components === "object" && wp.components !== null; | |
| 8797 | + } | |
| 8798 | + var cachedSlot = null; | |
| 8799 | + function ensureSlotIsAccessible(element) { | |
| 8800 | + element.setAttribute("aria-hidden", "false"); | |
| 8683 | 8801 | return element; |
| 8684 | - }); | |
| 8802 | + } | |
| 8803 | + function createSlot(ownerDocument2) { | |
| 8804 | + const element = ownerDocument2.createElement("div"); | |
| 8805 | + element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); | |
| 8806 | + if (wp_compat_overlay_slot_default.slot) { | |
| 8807 | + element.classList.add(wp_compat_overlay_slot_default.slot); | |
| 8808 | + } | |
| 8809 | + ownerDocument2.body.appendChild(element); | |
| 8810 | + return element; | |
| 8811 | + } | |
| 8812 | + function getWpCompatOverlaySlot() { | |
| 8813 | + if (typeof window === "undefined") { | |
| 8814 | + return void 0; | |
| 8815 | + } | |
| 8816 | + if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { | |
| 8817 | + return void 0; | |
| 8818 | + } | |
| 8819 | + const ownerDocument2 = resolveOwnerDocument(); | |
| 8820 | + if (!ownerDocument2 || !ownerDocument2.body) { | |
| 8821 | + return void 0; | |
| 8822 | + } | |
| 8823 | + if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { | |
| 8824 | + return ensureSlotIsAccessible(cachedSlot); | |
| 8825 | + } | |
| 8826 | + const existing = ownerDocument2.querySelector( | |
| 8827 | + `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` | |
| 8828 | + ); | |
| 8829 | + if (existing instanceof HTMLDivElement) { | |
| 8830 | + cachedSlot = ensureSlotIsAccessible(existing); | |
| 8831 | + return cachedSlot; | |
| 8832 | + } | |
| 8833 | + if (cachedSlot?.isConnected) { | |
| 8834 | + cachedSlot.remove(); | |
| 8835 | + } | |
| 8836 | + cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); | |
| 8837 | + return cachedSlot; | |
| 8838 | + } | |
| 8685 | 8839 | |
| 8686 | - // packages/ui/build-module/tooltip/index.mjs | |
| 8687 | - var tooltip_exports = {}; | |
| 8688 | - __export(tooltip_exports, { | |
| 8689 | - Popup: () => Popup, | |
| 8690 | - Portal: () => Portal, | |
| 8691 | - Positioner: () => Positioner, | |
| 8692 | - Provider: () => Provider, | |
| 8693 | - Root: () => Root, | |
| 8694 | - Trigger: () => Trigger | |
| 8695 | - }); | |
| 8696 | - | |
| 8697 | - // packages/ui/build-module/tooltip/popup.mjs | |
| 8698 | - var import_element14 = __toESM(require_element(), 1); | |
| 8699 | - | |
| 8700 | 8840 | // packages/ui/build-module/tooltip/portal.mjs |
| 8701 | - var import_element12 = __toESM(require_element(), 1); | |
| 8841 | + var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); | |
| 8842 | + var Portal = (0, import_element10.forwardRef)( | |
| 8843 | + function TooltipPortal3({ container, ...restProps }, ref) { | |
| 8844 | + return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)( | |
| 8845 | + index_parts_exports.Portal, | |
| 8846 | + { | |
| 8847 | + container: container ?? getWpCompatOverlaySlot(), | |
| 8848 | + ...restProps, | |
| 8849 | + ref | |
| 8850 | + } | |
| 8851 | + ); | |
| 8852 | + } | |
| 8853 | + ); | |
| 8702 | 8854 | |
| 8703 | - // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs | |
| 8855 | + // packages/ui/build-module/tooltip/positioner.mjs | |
| 8856 | + var import_element11 = __toESM(require_element(), 1); | |
| 8857 | + var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); | |
| 8704 | 8858 | var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; |
| 8705 | 8859 | function getRuntime2() { |
| 8706 | 8860 | const globalScope = globalThis; |
| 8707 | 8861 | if (globalScope.__wpStyleRuntime) { |
| @@ -8781,84 +8935,70 @@ | ||
| 8781 | 8935 | injectStyle2(targetDocument, hash, css); |
| 8782 | 8936 | } |
| 8783 | 8937 | } |
| 8784 | 8938 | if (typeof process === "undefined" || true) { |
| 8785 | - registerStyle2("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}"); | |
| 8939 | + registerStyle2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); | |
| 8786 | 8940 | } |
| 8787 | - var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; | |
| 8788 | - var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; | |
| 8789 | - function resolveOwnerDocument() { | |
| 8790 | - return typeof document === "undefined" ? null : document; | |
| 8941 | + var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; | |
| 8942 | + if (typeof process === "undefined" || true) { | |
| 8943 | + registerStyle2("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); | |
| 8791 | 8944 | } |
| 8792 | - function isInWordPressEnvironment() { | |
| 8793 | - let topWp; | |
| 8794 | - try { | |
| 8795 | - topWp = window.top?.wp; | |
| 8796 | - } catch { | |
| 8945 | + var style_default = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; | |
| 8946 | + var Positioner = (0, import_element11.forwardRef)( | |
| 8947 | + function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { | |
| 8948 | + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( | |
| 8949 | + index_parts_exports.Positioner, | |
| 8950 | + { | |
| 8951 | + ref, | |
| 8952 | + align, | |
| 8953 | + side, | |
| 8954 | + sideOffset, | |
| 8955 | + ...props, | |
| 8956 | + className: clsx_default( | |
| 8957 | + resets_default["box-sizing"], | |
| 8958 | + style_default.positioner, | |
| 8959 | + className | |
| 8960 | + ) | |
| 8961 | + } | |
| 8962 | + ); | |
| 8797 | 8963 | } |
| 8798 | - const wp = topWp ?? window.wp; | |
| 8799 | - return typeof wp?.components === "object" && wp.components !== null; | |
| 8964 | + ); | |
| 8965 | + | |
| 8966 | + // packages/ui/build-module/utils/render-slot-with-children.mjs | |
| 8967 | + var import_element12 = __toESM(require_element(), 1); | |
| 8968 | + function renderSlotWithChildren(slot, defaultSlot, children) { | |
| 8969 | + return (0, import_element12.cloneElement)(slot ?? defaultSlot, { children }); | |
| 8800 | 8970 | } |
| 8801 | - var cachedSlot = null; | |
| 8802 | - function ensureSlotIsAccessible(element) { | |
| 8803 | - element.setAttribute("aria-hidden", "false"); | |
| 8804 | - return element; | |
| 8805 | - } | |
| 8806 | - function createSlot(ownerDocument2) { | |
| 8807 | - const element = ownerDocument2.createElement("div"); | |
| 8808 | - element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); | |
| 8809 | - if (wp_compat_overlay_slot_default.slot) { | |
| 8810 | - element.classList.add(wp_compat_overlay_slot_default.slot); | |
| 8971 | + | |
| 8972 | + // packages/ui/build-module/utils/theme-provider.mjs | |
| 8973 | + var theme = __toESM(require_theme(), 1); | |
| 8974 | + | |
| 8975 | + // packages/ui/build-module/lock-unlock.mjs | |
| 8976 | + var import_private_apis = __toESM(require_private_apis(), 1); | |
| 8977 | + var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( | |
| 8978 | + "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", | |
| 8979 | + "@wordpress/ui" | |
| 8980 | + ); | |
| 8981 | + | |
| 8982 | + // packages/ui/build-module/utils/theme-provider.mjs | |
| 8983 | + function getThemeProvider() { | |
| 8984 | + const themePackage = theme; | |
| 8985 | + if (themePackage.ThemeProvider) { | |
| 8986 | + return themePackage.ThemeProvider; | |
| 8811 | 8987 | } |
| 8812 | - ownerDocument2.body.appendChild(element); | |
| 8813 | - return element; | |
| 8814 | - } | |
| 8815 | - function getWpCompatOverlaySlot() { | |
| 8816 | - if (typeof window === "undefined") { | |
| 8817 | - return void 0; | |
| 8988 | + if (!themePackage.privateApis) { | |
| 8989 | + throw new Error( | |
| 8990 | + "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." | |
| 8991 | + ); | |
| 8818 | 8992 | } |
| 8819 | - if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { | |
| 8820 | - return void 0; | |
| 8821 | - } | |
| 8822 | - const ownerDocument2 = resolveOwnerDocument(); | |
| 8823 | - if (!ownerDocument2 || !ownerDocument2.body) { | |
| 8824 | - return void 0; | |
| 8825 | - } | |
| 8826 | - if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { | |
| 8827 | - return ensureSlotIsAccessible(cachedSlot); | |
| 8828 | - } | |
| 8829 | - const existing = ownerDocument2.querySelector( | |
| 8830 | - `[${WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` | |
| 8831 | - ); | |
| 8832 | - if (existing instanceof HTMLDivElement) { | |
| 8833 | - cachedSlot = ensureSlotIsAccessible(existing); | |
| 8834 | - return cachedSlot; | |
| 8835 | - } | |
| 8836 | - if (cachedSlot?.isConnected) { | |
| 8837 | - cachedSlot.remove(); | |
| 8838 | - } | |
| 8839 | - cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); | |
| 8840 | - return cachedSlot; | |
| 8993 | + return unlock( | |
| 8994 | + themePackage.privateApis | |
| 8995 | + ).ThemeProvider; | |
| 8841 | 8996 | } |
| 8997 | + var ThemeProvider = getThemeProvider(); | |
| 8842 | 8998 | |
| 8843 | - // packages/ui/build-module/tooltip/portal.mjs | |
| 8844 | - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 8845 | - var Portal = (0, import_element12.forwardRef)( | |
| 8846 | - function TooltipPortal3({ container, ...restProps }, ref) { | |
| 8847 | - return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 8848 | - index_parts_exports.Portal, | |
| 8849 | - { | |
| 8850 | - container: container ?? getWpCompatOverlaySlot(), | |
| 8851 | - ...restProps, | |
| 8852 | - ref | |
| 8853 | - } | |
| 8854 | - ); | |
| 8855 | - } | |
| 8856 | - ); | |
| 8857 | - | |
| 8858 | - // packages/ui/build-module/tooltip/positioner.mjs | |
| 8859 | - var import_element13 = __toESM(require_element(), 1); | |
| 8860 | - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 8999 | + // packages/ui/build-module/tooltip/popup.mjs | |
| 9000 | + var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); | |
| 8861 | 9001 | var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; |
| 8862 | 9002 | function getRuntime3() { |
| 8863 | 9003 | const globalScope = globalThis; |
| 8864 | 9004 | if (globalScope.__wpStyleRuntime) { |
| @@ -8938,37 +9078,85 @@ | ||
| 8938 | 9078 | injectStyle3(targetDocument, hash, css); |
| 8939 | 9079 | } |
| 8940 | 9080 | } |
| 8941 | 9081 | if (typeof process === "undefined" || true) { |
| 8942 | - registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); | |
| 8943 | - } | |
| 8944 | - var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; | |
| 8945 | - if (typeof process === "undefined" || true) { | |
| 8946 | 9082 | registerStyle3("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); |
| 8947 | 9083 | } |
| 8948 | 9084 | var style_default2 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; |
| 8949 | - var Positioner = (0, import_element13.forwardRef)( | |
| 8950 | - function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { | |
| 8951 | - return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( | |
| 8952 | - index_parts_exports.Positioner, | |
| 8953 | - { | |
| 8954 | - ref, | |
| 8955 | - align, | |
| 8956 | - side, | |
| 8957 | - sideOffset, | |
| 8958 | - ...props, | |
| 8959 | - className: clsx_default( | |
| 8960 | - resets_default["box-sizing"], | |
| 8961 | - style_default2.positioner, | |
| 8962 | - className | |
| 8963 | - ) | |
| 8964 | - } | |
| 8965 | - ); | |
| 9085 | + var POPUP_COLOR = { background: "#1e1e1e" }; | |
| 9086 | + var Popup = (0, import_element13.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { | |
| 9087 | + const popupContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( | |
| 9088 | + index_parts_exports.Popup, | |
| 9089 | + { | |
| 9090 | + ref, | |
| 9091 | + className: clsx_default(style_default2.popup, className), | |
| 9092 | + ...props, | |
| 9093 | + children | |
| 9094 | + } | |
| 9095 | + ) }); | |
| 9096 | + const positionedPopup = renderSlotWithChildren( | |
| 9097 | + positioner, | |
| 9098 | + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Positioner, {}), | |
| 9099 | + popupContent | |
| 9100 | + ); | |
| 9101 | + return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Portal, {}), positionedPopup); | |
| 9102 | + }); | |
| 9103 | + | |
| 9104 | + // packages/ui/build-module/tooltip/trigger.mjs | |
| 9105 | + var import_element14 = __toESM(require_element(), 1); | |
| 9106 | + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 9107 | + var Trigger = (0, import_element14.forwardRef)( | |
| 9108 | + function TooltipTrigger3(props, ref) { | |
| 9109 | + return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(index_parts_exports.Trigger, { ref, ...props }); | |
| 8966 | 9110 | } |
| 8967 | 9111 | ); |
| 8968 | 9112 | |
| 8969 | - // packages/ui/build-module/tooltip/popup.mjs | |
| 9113 | + // packages/ui/build-module/utils/direction-provider.mjs | |
| 9114 | + var import_i18n = __toESM(require_i18n(), 1); | |
| 9115 | + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 9116 | + function DirectionProvider3({ children }) { | |
| 9117 | + return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DirectionProvider, { direction: (0, import_i18n.isRTL)() ? "rtl" : "ltr", children }); | |
| 9118 | + } | |
| 9119 | + | |
| 9120 | + // packages/ui/build-module/tooltip/root.mjs | |
| 9121 | + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 9122 | + function Root(props) { | |
| 9123 | + return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(index_parts_exports.Root, { ...props }) }); | |
| 9124 | + } | |
| 9125 | + | |
| 9126 | + // packages/ui/build-module/tooltip/provider.mjs | |
| 8970 | 9127 | var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); |
| 9128 | + function Provider({ ...props }) { | |
| 9129 | + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Provider, { ...props }); | |
| 9130 | + } | |
| 9131 | + | |
| 9132 | + // packages/icons/build-module/library/chevron-down.mjs | |
| 9133 | + var import_primitives = __toESM(require_primitives(), 1); | |
| 9134 | + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 9135 | + var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) }); | |
| 9136 | + | |
| 9137 | + // packages/icons/build-module/library/chevron-left.mjs | |
| 9138 | + var import_primitives2 = __toESM(require_primitives(), 1); | |
| 9139 | + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 9140 | + var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives2.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) }); | |
| 9141 | + | |
| 9142 | + // packages/icons/build-module/library/chevron-right.mjs | |
| 9143 | + var import_primitives3 = __toESM(require_primitives(), 1); | |
| 9144 | + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 9145 | + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) }); | |
| 9146 | + | |
| 9147 | + // packages/icons/build-module/library/chevron-up.mjs | |
| 9148 | + var import_primitives4 = __toESM(require_primitives(), 1); | |
| 9149 | + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); | |
| 9150 | + var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives4.Path, { d: "M7 13L12 9L17 13", vectorEffect: "non-scaling-stroke" }) }); | |
| 9151 | + | |
| 9152 | + // packages/icons/build-module/library/fullscreen.mjs | |
| 9153 | + var import_primitives5 = __toESM(require_primitives(), 1); | |
| 9154 | + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); | |
| 9155 | + var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives5.Path, { d: "M4.75 10V4.75H10M4.75 4.75L10 10M14 19.25H19.25V14M19.25 19.25L14 14", vectorEffect: "non-scaling-stroke" }) }); | |
| 9156 | + | |
| 9157 | + // packages/ui/build-module/visually-hidden/visually-hidden.mjs | |
| 9158 | + var import_element15 = __toESM(require_element(), 1); | |
| 8971 | 9159 | var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; |
| 8972 | 9160 | function getRuntime4() { |
| 8973 | 9161 | const globalScope = globalThis; |
| 8974 | 9162 | if (globalScope.__wpStyleRuntime) { |
| @@ -9048,52 +9236,30 @@ | ||
| 9048 | 9236 | injectStyle4(targetDocument, hash, css); |
| 9049 | 9237 | } |
| 9050 | 9238 | } |
| 9051 | 9239 | if (typeof process === "undefined" || true) { |
| 9052 | - registerStyle4("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); | |
| 9240 | + registerStyle4("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}"); | |
| 9053 | 9241 | } |
| 9054 | - var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; | |
| 9055 | - var POPUP_COLOR = { background: "#1e1e1e" }; | |
| 9056 | - var Popup = (0, import_element14.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { | |
| 9057 | - const popupContent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( | |
| 9058 | - index_parts_exports.Popup, | |
| 9059 | - { | |
| 9242 | + var style_default3 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; | |
| 9243 | + var VisuallyHidden = (0, import_element15.forwardRef)( | |
| 9244 | + function VisuallyHidden2({ render, ...restProps }, ref) { | |
| 9245 | + const element = useRender({ | |
| 9246 | + render, | |
| 9060 | 9247 | ref, |
| 9061 | - className: clsx_default(style_default3.popup, className), | |
| 9062 | - ...props, | |
| 9063 | - children | |
| 9064 | - } | |
| 9065 | - ) }); | |
| 9066 | - const positionedPopup = renderSlotWithChildren( | |
| 9067 | - positioner, | |
| 9068 | - /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Positioner, {}), | |
| 9069 | - popupContent | |
| 9070 | - ); | |
| 9071 | - return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Portal, {}), positionedPopup); | |
| 9072 | - }); | |
| 9073 | - | |
| 9074 | - // packages/ui/build-module/tooltip/trigger.mjs | |
| 9075 | - var import_element15 = __toESM(require_element(), 1); | |
| 9076 | - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 9077 | - var Trigger = (0, import_element15.forwardRef)( | |
| 9078 | - function TooltipTrigger3(props, ref) { | |
| 9079 | - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(index_parts_exports.Trigger, { ref, ...props }); | |
| 9248 | + props: mergeProps( | |
| 9249 | + { className: style_default3["visually-hidden"] }, | |
| 9250 | + restProps, | |
| 9251 | + { | |
| 9252 | + // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. | |
| 9253 | + "data-visually-hidden": "" | |
| 9254 | + } | |
| 9255 | + ) | |
| 9256 | + }); | |
| 9257 | + return element; | |
| 9080 | 9258 | } |
| 9081 | 9259 | ); |
| 9082 | 9260 | |
| 9083 | - // packages/ui/build-module/tooltip/root.mjs | |
| 9084 | - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 9085 | - function Root(props) { | |
| 9086 | - return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(index_parts_exports.Root, { ...props }); | |
| 9087 | - } | |
| 9088 | - | |
| 9089 | - // packages/ui/build-module/tooltip/provider.mjs | |
| 9090 | - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 9091 | - function Provider({ ...props }) { | |
| 9092 | - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(index_parts_exports.Provider, { ...props }); | |
| 9093 | - } | |
| 9094 | - | |
| 9095 | - // packages/ui/build-module/visually-hidden/visually-hidden.mjs | |
| 9261 | + // packages/ui/build-module/stack/stack.mjs | |
| 9096 | 9262 | var import_element16 = __toESM(require_element(), 1); |
| 9097 | 9263 | var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; |
| 9098 | 9264 | function getRuntime5() { |
| 9099 | 9265 | const globalScope = globalThis; |
| @@ -9174,35 +9340,42 @@ | ||
| 9174 | 9340 | injectStyle5(targetDocument, hash, css); |
| 9175 | 9341 | } |
| 9176 | 9342 | } |
| 9177 | 9343 | if (typeof process === "undefined" || true) { |
| 9178 | - registerStyle5("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}}}"); | |
| 9344 | + registerStyle5("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); | |
| 9179 | 9345 | } |
| 9180 | - var style_default4 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; | |
| 9181 | - var VisuallyHidden = (0, import_element16.forwardRef)( | |
| 9182 | - function VisuallyHidden2({ render, ...restProps }, ref) { | |
| 9183 | - const element = useRender({ | |
| 9184 | - render, | |
| 9185 | - ref, | |
| 9186 | - props: mergeProps( | |
| 9187 | - { className: style_default4["visually-hidden"] }, | |
| 9188 | - restProps, | |
| 9189 | - { | |
| 9190 | - // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. | |
| 9191 | - "data-visually-hidden": "" | |
| 9192 | - } | |
| 9193 | - ) | |
| 9194 | - }); | |
| 9195 | - return element; | |
| 9196 | - } | |
| 9197 | - ); | |
| 9346 | + var style_default4 = { "stack": "_19ce0419607e1896__stack" }; | |
| 9347 | + var gapTokens = { | |
| 9348 | + xs: "var(--wpds-dimension-gap-xs, 4px)", | |
| 9349 | + sm: "var(--wpds-dimension-gap-sm, 8px)", | |
| 9350 | + md: "var(--wpds-dimension-gap-md, 12px)", | |
| 9351 | + lg: "var(--wpds-dimension-gap-lg, 16px)", | |
| 9352 | + xl: "var(--wpds-dimension-gap-xl, 24px)", | |
| 9353 | + "2xl": "var(--wpds-dimension-gap-2xl, 32px)", | |
| 9354 | + "3xl": "var(--wpds-dimension-gap-3xl, 40px)" | |
| 9355 | + }; | |
| 9356 | + var Stack = (0, import_element16.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { | |
| 9357 | + const style = { | |
| 9358 | + gap: gap && gapTokens[gap], | |
| 9359 | + alignItems: align, | |
| 9360 | + justifyContent: justify, | |
| 9361 | + flexDirection: direction, | |
| 9362 | + flexWrap: wrap | |
| 9363 | + }; | |
| 9364 | + const element = useRender({ | |
| 9365 | + render, | |
| 9366 | + ref, | |
| 9367 | + props: mergeProps(props, { style, className: style_default4.stack }) | |
| 9368 | + }); | |
| 9369 | + return element; | |
| 9370 | + }); | |
| 9198 | 9371 | |
| 9199 | 9372 | // packages/admin-ui/build-module/navigable-region/index.mjs |
| 9200 | 9373 | var import_element17 = __toESM(require_element(), 1); |
| 9201 | - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); | |
| 9374 | + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); | |
| 9202 | 9375 | var NavigableRegion = (0, import_element17.forwardRef)( |
| 9203 | 9376 | ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { |
| 9204 | - return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( | |
| 9377 | + return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 9205 | 9378 | Tag, |
| 9206 | 9379 | { |
| 9207 | 9380 | ref, |
| 9208 | 9381 | className: clsx_default("admin-ui-navigable-region", className), |
| @@ -9217,12 +9390,33 @@ | ||
| 9217 | 9390 | ); |
| 9218 | 9391 | NavigableRegion.displayName = "NavigableRegion"; |
| 9219 | 9392 | var navigable_region_default = NavigableRegion; |
| 9220 | 9393 | |
| 9394 | + // packages/admin-ui/build-module/admin-theme-colors/index.mjs | |
| 9395 | + var DEFAULT_THEME_COLORS = { | |
| 9396 | + primary: "#3858e9", | |
| 9397 | + background: "#222524" | |
| 9398 | + }; | |
| 9399 | + var ADMIN_THEME_COLORS = /* @__PURE__ */ new Map([ | |
| 9400 | + ["modern", DEFAULT_THEME_COLORS], | |
| 9401 | + ["fresh", { primary: "#007cba", background: "#25292b" }], | |
| 9402 | + ["midnight", { primary: "#cf4339", background: "#3d4042" }], | |
| 9403 | + ["coffee", { primary: "#916745", background: "#5b534d" }], | |
| 9404 | + ["ocean", { primary: "#567958", background: "#5f787f" }], | |
| 9405 | + ["blue", { primary: "#437aa8", background: "#3876a8" }], | |
| 9406 | + ["ectoplasm", { primary: "#646c3e", background: "#4f386e" }], | |
| 9407 | + ["sunrise", { primary: "#ad631e", background: "#cc4541" }], | |
| 9408 | + ["light", { primary: "#007cba", background: "#eaeeed" }] | |
| 9409 | + ]); | |
| 9410 | + function getAdminThemeColors() { | |
| 9411 | + const scheme = document.body.className.match(/admin-color-([\w-]+)/)?.[1] ?? "modern"; | |
| 9412 | + return ADMIN_THEME_COLORS.get(scheme) ?? DEFAULT_THEME_COLORS; | |
| 9413 | + } | |
| 9414 | + | |
| 9221 | 9415 | // packages/edit-post/build-module/components/layout/index.mjs |
| 9222 | - var import_editor17 = __toESM(require_editor(), 1); | |
| 9223 | - var import_data24 = __toESM(require_data(), 1); | |
| 9224 | - var import_block_editor = __toESM(require_block_editor(), 1); | |
| 9416 | + var import_editor19 = __toESM(require_editor(), 1); | |
| 9417 | + var import_data26 = __toESM(require_data(), 1); | |
| 9418 | + var import_block_editor2 = __toESM(require_block_editor(), 1); | |
| 9225 | 9419 | |
| 9226 | 9420 | // packages/global-styles-engine/build-module/utils/common.mjs |
| 9227 | 9421 | var import_style_engine = __toESM(require_style_engine(), 1); |
| 9228 | 9422 | var ROOT_BLOCK_SELECTOR = "body"; |
| @@ -9448,9 +9642,10 @@ | ||
| 9448 | 9642 | hasFallbackGapSupport, |
| 9449 | 9643 | fallbackGapValue |
| 9450 | 9644 | }) { |
| 9451 | 9645 | let ruleset = ""; |
| 9452 | - let gapValue = hasBlockGapSupport ? getGapCSSValue(style?.spacing?.blockGap) : ""; | |
| 9646 | + const blockGapValue = style?.spacing?.blockGap; | |
| 9647 | + let gapValue = hasBlockGapSupport ? getGapCSSValue(blockGapValue) : ""; | |
| 9453 | 9648 | if (hasFallbackGapSupport) { |
| 9454 | 9649 | if (selector === ROOT_BLOCK_SELECTOR) { |
| 9455 | 9650 | gapValue = !gapValue ? "0.5em" : gapValue; |
| 9456 | 9651 | } else if (!hasBlockGapSupport && fallbackGapValue) { |
| @@ -9456,8 +9651,9 @@ | ||
| 9456 | 9651 | } else if (!hasBlockGapSupport && fallbackGapValue) { |
| 9457 | 9652 | gapValue = fallbackGapValue; |
| 9458 | 9653 | } |
| 9459 | 9654 | } |
| 9655 | + const rowGapValue = hasBlockGapSupport && blockGapValue && typeof blockGapValue !== "string" ? getGapCSSValue(blockGapValue.top) : gapValue; | |
| 9460 | 9656 | if (gapValue && layoutDefinitions) { |
| 9461 | 9657 | Object.values(layoutDefinitions).forEach( |
| 9462 | 9658 | ({ className, name, spacingStyles }) => { |
| 9463 | 9659 | if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) { |
| @@ -9462,8 +9658,11 @@ | ||
| 9462 | 9658 | ({ className, name, spacingStyles }) => { |
| 9463 | 9659 | if (!hasBlockGapSupport && "flex" !== name && "grid" !== name) { |
| 9464 | 9660 | return; |
| 9465 | 9661 | } |
| 9662 | + const layoutGapValue = ["default", "constrained"].includes( | |
| 9663 | + name | |
| 9664 | + ) ? rowGapValue : gapValue; | |
| 9466 | 9665 | if (spacingStyles?.length) { |
| 9467 | 9666 | spacingStyles.forEach((spacingStyle) => { |
| 9468 | 9667 | const declarations = []; |
| 9469 | 9668 | if (spacingStyle.rules) { |
| @@ -9469,9 +9668,9 @@ | ||
| 9469 | 9668 | if (spacingStyle.rules) { |
| 9470 | 9669 | Object.entries(spacingStyle.rules).forEach( |
| 9471 | 9670 | ([cssProperty, cssValue]) => { |
| 9472 | 9671 | declarations.push( |
| 9473 | - `${cssProperty}: ${cssValue ? cssValue : gapValue}` | |
| 9672 | + `${cssProperty}: ${cssValue ? cssValue : layoutGapValue}` | |
| 9474 | 9673 | ); |
| 9475 | 9674 | } |
| 9476 | 9675 | ); |
| 9477 | 9676 | } |
| @@ -9528,32 +9727,34 @@ | ||
| 9528 | 9727 | } |
| 9529 | 9728 | |
| 9530 | 9729 | // packages/edit-post/build-module/components/layout/index.mjs |
| 9531 | 9730 | var import_plugins = __toESM(require_plugins(), 1); |
| 9532 | - var import_i18n14 = __toESM(require_i18n(), 1); | |
| 9533 | - var import_element28 = __toESM(require_element(), 1); | |
| 9731 | + var import_i18n15 = __toESM(require_i18n(), 1); | |
| 9732 | + var import_element29 = __toESM(require_element(), 1); | |
| 9534 | 9733 | var import_notices3 = __toESM(require_notices(), 1); |
| 9535 | 9734 | var import_preferences10 = __toESM(require_preferences(), 1); |
| 9536 | 9735 | var import_commands2 = __toESM(require_commands(), 1); |
| 9537 | - var import_block_library = __toESM(require_block_library(), 1); | |
| 9538 | - var import_url5 = __toESM(require_url(), 1); | |
| 9736 | + var import_url6 = __toESM(require_url(), 1); | |
| 9539 | 9737 | var import_html_entities = __toESM(require_html_entities(), 1); |
| 9540 | - var import_core_data8 = __toESM(require_core_data(), 1); | |
| 9541 | - var import_components9 = __toESM(require_components(), 1); | |
| 9738 | + var import_core_data9 = __toESM(require_core_data(), 1); | |
| 9739 | + var import_components8 = __toESM(require_components(), 1); | |
| 9542 | 9740 | var import_compose2 = __toESM(require_compose(), 1); |
| 9741 | + var import_theme = __toESM(require_theme(), 1); | |
| 9543 | 9742 | |
| 9544 | 9743 | // packages/edit-post/build-module/components/back-button/index.mjs |
| 9545 | 9744 | var import_editor2 = __toESM(require_editor(), 1); |
| 9546 | 9745 | var import_components2 = __toESM(require_components(), 1); |
| 9746 | + var import_preferences = __toESM(require_preferences(), 1); | |
| 9747 | + var import_data3 = __toESM(require_data(), 1); | |
| 9547 | 9748 | |
| 9548 | 9749 | // packages/edit-post/build-module/components/back-button/fullscreen-mode-close.mjs |
| 9549 | 9750 | var import_data2 = __toESM(require_data(), 1); |
| 9550 | 9751 | var import_components = __toESM(require_components(), 1); |
| 9551 | - var import_i18n = __toESM(require_i18n(), 1); | |
| 9752 | + var import_i18n2 = __toESM(require_i18n(), 1); | |
| 9552 | 9753 | var import_url = __toESM(require_url(), 1); |
| 9553 | 9754 | var import_editor = __toESM(require_editor(), 1); |
| 9554 | 9755 | var import_core_data = __toESM(require_core_data(), 1); |
| 9555 | - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); | |
| 9756 | + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); | |
| 9556 | 9757 | function FullscreenModeClose({ showTooltip, icon, href, initialPost }) { |
| 9557 | 9758 | const postType = (0, import_data2.useSelect)( |
| 9558 | 9759 | (select3) => { |
| 9559 | 9760 | const { getCurrentPostType } = select3(import_editor.store); |
| @@ -9567,10 +9768,10 @@ | ||
| 9567 | 9768 | } |
| 9568 | 9769 | const buttonHref = href ?? (0, import_url.addQueryArgs)("edit.php", { |
| 9569 | 9770 | post_type: postType.slug |
| 9570 | 9771 | }); |
| 9571 | - const buttonLabel = postType?.labels?.view_items ?? (0, import_i18n.__)("Back"); | |
| 9572 | - return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 9772 | + const buttonLabel = postType?.labels?.view_items ?? (0, import_i18n2.__)("Back"); | |
| 9773 | + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 9573 | 9774 | import_components.Button, |
| 9574 | 9775 | { |
| 9575 | 9776 | size: "compact", |
| 9576 | 9777 | href: buttonHref, |
| @@ -9576,9 +9777,9 @@ | ||
| 9576 | 9777 | href: buttonHref, |
| 9577 | 9778 | label: buttonLabel, |
| 9578 | 9779 | showTooltip, |
| 9579 | 9780 | tooltipPosition: "bottom", |
| 9580 | - icon: icon ?? ((0, import_i18n.isRTL)() ? chevron_right_default : chevron_left_default) | |
| 9781 | + icon: icon ?? ((0, import_i18n2.isRTL)() ? chevron_right_default : chevron_left_default) | |
| 9581 | 9782 | } |
| 9582 | 9783 | ); |
| 9583 | 9784 | } |
| 9584 | 9785 | var fullscreen_mode_close_default = FullscreenModeClose; |
| @@ -9590,9 +9791,9 @@ | ||
| 9590 | 9791 | "@wordpress/edit-post" |
| 9591 | 9792 | ); |
| 9592 | 9793 | |
| 9593 | 9794 | // packages/edit-post/build-module/components/back-button/index.mjs |
| 9594 | - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); | |
| 9795 | + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); | |
| 9595 | 9796 | var { BackButton: BackButtonFill } = unlock2(import_editor2.privateApis); |
| 9596 | 9797 | var slideX = { |
| 9597 | 9798 | hidden: { x: "-100%" }, |
| 9598 | 9799 | distractionFreeInactive: { x: 0 }, |
| @@ -9598,17 +9799,20 @@ | ||
| 9598 | 9799 | distractionFreeInactive: { x: 0 }, |
| 9599 | 9800 | hover: { x: 0, transition: { type: "tween", delay: 0.2 } } |
| 9600 | 9801 | }; |
| 9601 | 9802 | function BackButton({ initialPost }) { |
| 9602 | - return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 9803 | + const showIconLabels = (0, import_data3.useSelect)((select3) => { | |
| 9804 | + return select3(import_preferences.store).get("core", "showIconLabels"); | |
| 9805 | + }, []); | |
| 9806 | + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(BackButtonFill, { children: ({ length }) => length <= 1 && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( | |
| 9603 | 9807 | import_components2.__unstableMotion.div, |
| 9604 | 9808 | { |
| 9605 | 9809 | variants: slideX, |
| 9606 | 9810 | transition: { type: "tween", delay: 0.8 }, |
| 9607 | - children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 9811 | + children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( | |
| 9608 | 9812 | fullscreen_mode_close_default, |
| 9609 | 9813 | { |
| 9610 | - showTooltip: true, | |
| 9814 | + showTooltip: !showIconLabels, | |
| 9611 | 9815 | initialPost |
| 9612 | 9816 | } |
| 9613 | 9817 | ) |
| 9614 | 9818 | } |
| @@ -9616,9 +9820,9 @@ | ||
| 9616 | 9820 | } |
| 9617 | 9821 | var back_button_default = BackButton; |
| 9618 | 9822 | |
| 9619 | 9823 | // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs |
| 9620 | - var import_data3 = __toESM(require_data(), 1); | |
| 9824 | + var import_data4 = __toESM(require_data(), 1); | |
| 9621 | 9825 | var import_element18 = __toESM(require_element(), 1); |
| 9622 | 9826 | var import_editor3 = __toESM(require_editor(), 1); |
| 9623 | 9827 | var import_core_data2 = __toESM(require_core_data(), 1); |
| 9624 | 9828 | |
| @@ -9628,9 +9832,9 @@ | ||
| 9628 | 9832 | var VIEW_AS_PREVIEW_LINK_SELECTOR = "#wp-admin-bar-preview a"; |
| 9629 | 9833 | |
| 9630 | 9834 | // packages/edit-post/build-module/components/editor-initialization/listener-hooks.mjs |
| 9631 | 9835 | var useUpdatePostLinkListener = () => { |
| 9632 | - const { isViewable, newPermalink } = (0, import_data3.useSelect)((select3) => { | |
| 9836 | + const { isViewable, newPermalink } = (0, import_data4.useSelect)((select3) => { | |
| 9633 | 9837 | const { getPostType } = select3(import_core_data2.store); |
| 9634 | 9838 | const { getCurrentPost, getEditedPostAttribute } = select3(import_editor3.store); |
| 9635 | 9839 | const postType = getPostType(getEditedPostAttribute("type")); |
| 9636 | 9840 | return { |
| @@ -9662,17 +9866,17 @@ | ||
| 9662 | 9866 | } |
| 9663 | 9867 | |
| 9664 | 9868 | // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs |
| 9665 | 9869 | var import_element19 = __toESM(require_element(), 1); |
| 9666 | - var import_data7 = __toESM(require_data(), 1); | |
| 9870 | + var import_data8 = __toESM(require_data(), 1); | |
| 9667 | 9871 | var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); |
| 9668 | - var import_i18n3 = __toESM(require_i18n(), 1); | |
| 9872 | + var import_i18n4 = __toESM(require_i18n(), 1); | |
| 9669 | 9873 | |
| 9670 | 9874 | // packages/edit-post/build-module/store/index.mjs |
| 9671 | - var import_data6 = __toESM(require_data(), 1); | |
| 9875 | + var import_data7 = __toESM(require_data(), 1); | |
| 9672 | 9876 | |
| 9673 | 9877 | // packages/edit-post/build-module/store/reducer.mjs |
| 9674 | - var import_data4 = __toESM(require_data(), 1); | |
| 9878 | + var import_data5 = __toESM(require_data(), 1); | |
| 9675 | 9879 | function isSavingMetaBoxes(state = false, action) { |
| 9676 | 9880 | switch (action.type) { |
| 9677 | 9881 | case "REQUEST_META_BOX_UPDATES": |
| 9678 | 9882 | return true; |
| @@ -9723,14 +9927,14 @@ | ||
| 9723 | 9927 | return true; |
| 9724 | 9928 | } |
| 9725 | 9929 | return state; |
| 9726 | 9930 | } |
| 9727 | - var metaBoxes = (0, import_data4.combineReducers)({ | |
| 9931 | + var metaBoxes = (0, import_data5.combineReducers)({ | |
| 9728 | 9932 | isSaving: isSavingMetaBoxes, |
| 9729 | 9933 | locations: metaBoxLocations, |
| 9730 | 9934 | initialized: metaBoxesInitialized |
| 9731 | 9935 | }); |
| 9732 | - var reducer_default = (0, import_data4.combineReducers)({ | |
| 9936 | + var reducer_default = (0, import_data5.combineReducers)({ | |
| 9733 | 9937 | metaBoxes |
| 9734 | 9938 | }); |
| 9735 | 9939 | |
| 9736 | 9940 | // packages/edit-post/build-module/store/actions.mjs |
| @@ -9765,15 +9969,15 @@ | ||
| 9765 | 9969 | togglePublishSidebar: () => togglePublishSidebar, |
| 9766 | 9970 | updatePreferredStyleVariations: () => updatePreferredStyleVariations |
| 9767 | 9971 | }); |
| 9768 | 9972 | var import_api_fetch = __toESM(require_api_fetch(), 1); |
| 9769 | - var import_preferences = __toESM(require_preferences(), 1); | |
| 9973 | + var import_preferences2 = __toESM(require_preferences(), 1); | |
| 9770 | 9974 | var import_editor4 = __toESM(require_editor(), 1); |
| 9771 | 9975 | var import_deprecated = __toESM(require_deprecated(), 1); |
| 9772 | 9976 | var import_hooks = __toESM(require_hooks(), 1); |
| 9773 | 9977 | var import_core_data3 = __toESM(require_core_data(), 1); |
| 9774 | 9978 | var import_notices = __toESM(require_notices(), 1); |
| 9775 | - var import_i18n2 = __toESM(require_i18n(), 1); | |
| 9979 | + var import_i18n3 = __toESM(require_i18n(), 1); | |
| 9776 | 9980 | |
| 9777 | 9981 | // packages/edit-post/build-module/utils/meta-boxes.mjs |
| 9778 | 9982 | var getMetaBoxContainer = (location) => { |
| 9779 | 9983 | const area = document.querySelector( |
| @@ -9846,9 +10050,9 @@ | ||
| 9846 | 10050 | alternative: "dispatch( 'core/editor').removeEditorPanel" |
| 9847 | 10051 | }); |
| 9848 | 10052 | registry.dispatch(import_editor4.store).removeEditorPanel(panelName); |
| 9849 | 10053 | }; |
| 9850 | - var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences.store).toggle("core/edit-post", feature); | |
| 10054 | + var toggleFeature = (feature) => ({ registry }) => registry.dispatch(import_preferences2.store).toggle("core/edit-post", feature); | |
| 9851 | 10055 | var switchEditorMode = (mode) => ({ registry }) => { |
| 9852 | 10056 | (0, import_deprecated.default)("dispatch( 'core/edit-post' ).switchEditorMode", { |
| 9853 | 10057 | since: "6.6", |
| 9854 | 10058 | alternative: "dispatch( 'core/editor').switchEditorMode" |
| @@ -10007,20 +10211,20 @@ | ||
| 10007 | 10211 | }); |
| 10008 | 10212 | registry.dispatch(import_editor4.store).toggleDistractionFree(); |
| 10009 | 10213 | }; |
| 10010 | 10214 | var toggleFullscreenMode = () => ({ registry }) => { |
| 10011 | - const isFullscreen = registry.select(import_preferences.store).get("core/edit-post", "fullscreenMode"); | |
| 10012 | - registry.dispatch(import_preferences.store).toggle("core/edit-post", "fullscreenMode"); | |
| 10215 | + const isFullscreen = registry.select(import_preferences2.store).get("core/edit-post", "fullscreenMode"); | |
| 10216 | + registry.dispatch(import_preferences2.store).toggle("core/edit-post", "fullscreenMode"); | |
| 10013 | 10217 | registry.dispatch(import_notices.store).createInfoNotice( |
| 10014 | - isFullscreen ? (0, import_i18n2.__)("Fullscreen mode deactivated.") : (0, import_i18n2.__)("Fullscreen mode activated."), | |
| 10218 | + isFullscreen ? (0, import_i18n3.__)("Fullscreen mode deactivated.") : (0, import_i18n3.__)("Fullscreen mode activated."), | |
| 10015 | 10219 | { |
| 10016 | 10220 | id: "core/edit-post/toggle-fullscreen-mode/notice", |
| 10017 | 10221 | type: "snackbar", |
| 10018 | 10222 | actions: [ |
| 10019 | 10223 | { |
| 10020 | - label: (0, import_i18n2.__)("Undo"), | |
| 10224 | + label: (0, import_i18n3.__)("Undo"), | |
| 10021 | 10225 | onClick: () => { |
| 10022 | - registry.dispatch(import_preferences.store).toggle( | |
| 10226 | + registry.dispatch(import_preferences2.store).toggle( | |
| 10023 | 10227 | "core/edit-post", |
| 10024 | 10228 | "fullscreenMode" |
| 10025 | 10229 | ); |
| 10026 | 10230 | } |
| @@ -10061,10 +10265,10 @@ | ||
| 10061 | 10265 | isPluginSidebarOpened: () => isPluginSidebarOpened, |
| 10062 | 10266 | isPublishSidebarOpened: () => isPublishSidebarOpened, |
| 10063 | 10267 | isSavingMetaBoxes: () => isSavingMetaBoxes2 |
| 10064 | 10268 | }); |
| 10065 | - var import_data5 = __toESM(require_data(), 1); | |
| 10066 | - var import_preferences2 = __toESM(require_preferences(), 1); | |
| 10269 | + var import_data6 = __toESM(require_data(), 1); | |
| 10270 | + var import_preferences3 = __toESM(require_preferences(), 1); | |
| 10067 | 10271 | var import_core_data4 = __toESM(require_core_data(), 1); |
| 10068 | 10272 | var import_editor5 = __toESM(require_editor(), 1); |
| 10069 | 10273 | var import_deprecated2 = __toESM(require_deprecated(), 1); |
| 10070 | 10274 | var { interfaceStore: interfaceStore2 } = unlock2(import_editor5.privateApis); |
| @@ -10069,12 +10273,12 @@ | ||
| 10069 | 10273 | var import_deprecated2 = __toESM(require_deprecated(), 1); |
| 10070 | 10274 | var { interfaceStore: interfaceStore2 } = unlock2(import_editor5.privateApis); |
| 10071 | 10275 | var EMPTY_ARRAY2 = []; |
| 10072 | 10276 | var EMPTY_OBJECT2 = {}; |
| 10073 | - var getEditorMode = (0, import_data5.createRegistrySelector)( | |
| 10074 | - (select3) => () => select3(import_preferences2.store).get("core", "editorMode") ?? "visual" | |
| 10277 | + var getEditorMode = (0, import_data6.createRegistrySelector)( | |
| 10278 | + (select3) => () => select3(import_preferences3.store).get("core", "editorMode") ?? "visual" | |
| 10075 | 10279 | ); |
| 10076 | - var isEditorSidebarOpened = (0, import_data5.createRegistrySelector)( | |
| 10280 | + var isEditorSidebarOpened = (0, import_data6.createRegistrySelector)( | |
| 10077 | 10281 | (select3) => () => { |
| 10078 | 10282 | const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core"); |
| 10079 | 10283 | return ["edit-post/document", "edit-post/block"].includes( |
| 10080 | 10284 | activeGeneralSidebar |
| @@ -10080,9 +10284,9 @@ | ||
| 10080 | 10284 | activeGeneralSidebar |
| 10081 | 10285 | ); |
| 10082 | 10286 | } |
| 10083 | 10287 | ); |
| 10084 | - var isPluginSidebarOpened = (0, import_data5.createRegistrySelector)( | |
| 10288 | + var isPluginSidebarOpened = (0, import_data6.createRegistrySelector)( | |
| 10085 | 10289 | (select3) => () => { |
| 10086 | 10290 | const activeGeneralSidebar = select3(interfaceStore2).getActiveComplementaryArea("core"); |
| 10087 | 10291 | return !!activeGeneralSidebar && !["edit-post/document", "edit-post/block"].includes( |
| 10088 | 10292 | activeGeneralSidebar |
| @@ -10088,9 +10292,9 @@ | ||
| 10088 | 10292 | activeGeneralSidebar |
| 10089 | 10293 | ); |
| 10090 | 10294 | } |
| 10091 | 10295 | ); |
| 10092 | - var getActiveGeneralSidebarName = (0, import_data5.createRegistrySelector)( | |
| 10296 | + var getActiveGeneralSidebarName = (0, import_data6.createRegistrySelector)( | |
| 10093 | 10297 | (select3) => () => { |
| 10094 | 10298 | return select3(interfaceStore2).getActiveComplementaryArea("core"); |
| 10095 | 10299 | } |
| 10096 | 10300 | ); |
| @@ -10115,9 +10319,9 @@ | ||
| 10115 | 10319 | }; |
| 10116 | 10320 | }, panelsWithEnabledState ?? {}); |
| 10117 | 10321 | return panels ?? panelsWithEnabledState ?? EMPTY_OBJECT2; |
| 10118 | 10322 | } |
| 10119 | - var getPreferences = (0, import_data5.createRegistrySelector)((select3) => () => { | |
| 10323 | + var getPreferences = (0, import_data6.createRegistrySelector)((select3) => () => { | |
| 10120 | 10324 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).getPreferences`, { |
| 10121 | 10325 | since: "6.0", |
| 10122 | 10326 | alternative: `select( 'core/preferences' ).get` |
| 10123 | 10327 | }); |
| @@ -10122,9 +10326,9 @@ | ||
| 10122 | 10326 | alternative: `select( 'core/preferences' ).get` |
| 10123 | 10327 | }); |
| 10124 | 10328 | const corePreferences = ["editorMode", "hiddenBlockTypes"].reduce( |
| 10125 | 10329 | (accumulatedPrefs, preferenceKey) => { |
| 10126 | - const value = select3(import_preferences2.store).get( | |
| 10330 | + const value = select3(import_preferences3.store).get( | |
| 10127 | 10331 | "core", |
| 10128 | 10332 | preferenceKey |
| 10129 | 10333 | ); |
| 10130 | 10334 | return { |
| @@ -10133,13 +10337,13 @@ | ||
| 10133 | 10337 | }; |
| 10134 | 10338 | }, |
| 10135 | 10339 | {} |
| 10136 | 10340 | ); |
| 10137 | - const inactivePanels = select3(import_preferences2.store).get( | |
| 10341 | + const inactivePanels = select3(import_preferences3.store).get( | |
| 10138 | 10342 | "core", |
| 10139 | 10343 | "inactivePanels" |
| 10140 | 10344 | ); |
| 10141 | - const openPanels = select3(import_preferences2.store).get("core", "openPanels"); | |
| 10345 | + const openPanels = select3(import_preferences3.store).get("core", "openPanels"); | |
| 10142 | 10346 | const panels = convertPanelsToOldFormat(inactivePanels, openPanels); |
| 10143 | 10347 | return { |
| 10144 | 10348 | ...corePreferences, |
| 10145 | 10349 | panels |
| @@ -10153,12 +10357,12 @@ | ||
| 10153 | 10357 | const preferences = getPreferences(state); |
| 10154 | 10358 | const value = preferences[preferenceKey]; |
| 10155 | 10359 | return value === void 0 ? defaultValue : value; |
| 10156 | 10360 | } |
| 10157 | - var getHiddenBlockTypes = (0, import_data5.createRegistrySelector)((select3) => () => { | |
| 10158 | - return select3(import_preferences2.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY2; | |
| 10361 | + var getHiddenBlockTypes = (0, import_data6.createRegistrySelector)((select3) => () => { | |
| 10362 | + return select3(import_preferences3.store).get("core", "hiddenBlockTypes") ?? EMPTY_ARRAY2; | |
| 10159 | 10363 | }); |
| 10160 | - var isPublishSidebarOpened = (0, import_data5.createRegistrySelector)( | |
| 10364 | + var isPublishSidebarOpened = (0, import_data6.createRegistrySelector)( | |
| 10161 | 10365 | (select3) => () => { |
| 10162 | 10366 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isPublishSidebarOpened`, { |
| 10163 | 10367 | since: "6.6", |
| 10164 | 10368 | alternative: `select( 'core/editor' ).isPublishSidebarOpened` |
| @@ -10165,9 +10369,9 @@ | ||
| 10165 | 10369 | }); |
| 10166 | 10370 | return select3(import_editor5.store).isPublishSidebarOpened(); |
| 10167 | 10371 | } |
| 10168 | 10372 | ); |
| 10169 | - var isEditorPanelRemoved = (0, import_data5.createRegistrySelector)( | |
| 10373 | + var isEditorPanelRemoved = (0, import_data6.createRegistrySelector)( | |
| 10170 | 10374 | (select3) => (state, panelName) => { |
| 10171 | 10375 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelRemoved`, { |
| 10172 | 10376 | since: "6.5", |
| 10173 | 10377 | alternative: `select( 'core/editor' ).isEditorPanelRemoved` |
| @@ -10174,9 +10378,9 @@ | ||
| 10174 | 10378 | }); |
| 10175 | 10379 | return select3(import_editor5.store).isEditorPanelRemoved(panelName); |
| 10176 | 10380 | } |
| 10177 | 10381 | ); |
| 10178 | - var isEditorPanelEnabled = (0, import_data5.createRegistrySelector)( | |
| 10382 | + var isEditorPanelEnabled = (0, import_data6.createRegistrySelector)( | |
| 10179 | 10383 | (select3) => (state, panelName) => { |
| 10180 | 10384 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelEnabled`, { |
| 10181 | 10385 | since: "6.5", |
| 10182 | 10386 | alternative: `select( 'core/editor' ).isEditorPanelEnabled` |
| @@ -10183,9 +10387,9 @@ | ||
| 10183 | 10387 | }); |
| 10184 | 10388 | return select3(import_editor5.store).isEditorPanelEnabled(panelName); |
| 10185 | 10389 | } |
| 10186 | 10390 | ); |
| 10187 | - var isEditorPanelOpened = (0, import_data5.createRegistrySelector)( | |
| 10391 | + var isEditorPanelOpened = (0, import_data6.createRegistrySelector)( | |
| 10188 | 10392 | (select3) => (state, panelName) => { |
| 10189 | 10393 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditorPanelOpened`, { |
| 10190 | 10394 | since: "6.5", |
| 10191 | 10395 | alternative: `select( 'core/editor' ).isEditorPanelOpened` |
| @@ -10192,9 +10396,9 @@ | ||
| 10192 | 10396 | }); |
| 10193 | 10397 | return select3(import_editor5.store).isEditorPanelOpened(panelName); |
| 10194 | 10398 | } |
| 10195 | 10399 | ); |
| 10196 | - var isModalActive = (0, import_data5.createRegistrySelector)( | |
| 10400 | + var isModalActive = (0, import_data6.createRegistrySelector)( | |
| 10197 | 10401 | (select3) => (state, modalName) => { |
| 10198 | 10402 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isModalActive`, { |
| 10199 | 10403 | since: "6.3", |
| 10200 | 10404 | alternative: `select( 'core/interface' ).isModalActive` |
| @@ -10201,19 +10405,19 @@ | ||
| 10201 | 10405 | }); |
| 10202 | 10406 | return !!select3(interfaceStore2).isModalActive(modalName); |
| 10203 | 10407 | } |
| 10204 | 10408 | ); |
| 10205 | - var isFeatureActive = (0, import_data5.createRegistrySelector)( | |
| 10409 | + var isFeatureActive = (0, import_data6.createRegistrySelector)( | |
| 10206 | 10410 | (select3) => (state, feature) => { |
| 10207 | - return !!select3(import_preferences2.store).get("core/edit-post", feature); | |
| 10411 | + return !!select3(import_preferences3.store).get("core/edit-post", feature); | |
| 10208 | 10412 | } |
| 10209 | 10413 | ); |
| 10210 | - var isPluginItemPinned = (0, import_data5.createRegistrySelector)( | |
| 10414 | + var isPluginItemPinned = (0, import_data6.createRegistrySelector)( | |
| 10211 | 10415 | (select3) => (state, pluginName) => { |
| 10212 | 10416 | return select3(interfaceStore2).isItemPinned("core", pluginName); |
| 10213 | 10417 | } |
| 10214 | 10418 | ); |
| 10215 | - var getActiveMetaBoxLocations = (0, import_data5.createSelector)( | |
| 10419 | + var getActiveMetaBoxLocations = (0, import_data6.createSelector)( | |
| 10216 | 10420 | (state) => { |
| 10217 | 10421 | return Object.keys(state.metaBoxes.locations).filter( |
| 10218 | 10422 | (location) => isMetaBoxLocationActive(state, location) |
| 10219 | 10423 | ); |
| @@ -10219,9 +10423,9 @@ | ||
| 10219 | 10423 | ); |
| 10220 | 10424 | }, |
| 10221 | 10425 | (state) => [state.metaBoxes.locations] |
| 10222 | 10426 | ); |
| 10223 | - var isMetaBoxLocationVisible = (0, import_data5.createRegistrySelector)( | |
| 10427 | + var isMetaBoxLocationVisible = (0, import_data6.createRegistrySelector)( | |
| 10224 | 10428 | (select3) => (state, location) => { |
| 10225 | 10429 | return isMetaBoxLocationActive(state, location) && getMetaBoxesPerLocation(state, location)?.some(({ id }) => { |
| 10226 | 10430 | return select3(import_editor5.store).isEditorPanelEnabled( |
| 10227 | 10431 | `meta-box-${id}` |
| @@ -10235,9 +10439,9 @@ | ||
| 10235 | 10439 | } |
| 10236 | 10440 | function getMetaBoxesPerLocation(state, location) { |
| 10237 | 10441 | return state.metaBoxes.locations[location]; |
| 10238 | 10442 | } |
| 10239 | - var getAllMetaBoxes = (0, import_data5.createSelector)( | |
| 10443 | + var getAllMetaBoxes = (0, import_data6.createSelector)( | |
| 10240 | 10444 | (state) => { |
| 10241 | 10445 | return Object.values(state.metaBoxes.locations).flat(); |
| 10242 | 10446 | }, |
| 10243 | 10447 | (state) => [state.metaBoxes.locations] |
| @@ -10247,9 +10451,9 @@ | ||
| 10247 | 10451 | } |
| 10248 | 10452 | function isSavingMetaBoxes2(state) { |
| 10249 | 10453 | return state.metaBoxes.isSaving; |
| 10250 | 10454 | } |
| 10251 | - var __experimentalGetPreviewDeviceType = (0, import_data5.createRegistrySelector)( | |
| 10455 | + var __experimentalGetPreviewDeviceType = (0, import_data6.createRegistrySelector)( | |
| 10252 | 10456 | (select3) => () => { |
| 10253 | 10457 | (0, import_deprecated2.default)( |
| 10254 | 10458 | `select( 'core/edit-site' ).__experimentalGetPreviewDeviceType`, |
| 10255 | 10459 | { |
| @@ -10260,9 +10464,9 @@ | ||
| 10260 | 10464 | ); |
| 10261 | 10465 | return select3(import_editor5.store).getDeviceType(); |
| 10262 | 10466 | } |
| 10263 | 10467 | ); |
| 10264 | - var isInserterOpened = (0, import_data5.createRegistrySelector)((select3) => () => { | |
| 10468 | + var isInserterOpened = (0, import_data6.createRegistrySelector)((select3) => () => { | |
| 10265 | 10469 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isInserterOpened`, { |
| 10266 | 10470 | since: "6.5", |
| 10267 | 10471 | alternative: `select( 'core/editor' ).isInserterOpened` |
| 10268 | 10472 | }); |
| @@ -10267,9 +10471,9 @@ | ||
| 10267 | 10471 | alternative: `select( 'core/editor' ).isInserterOpened` |
| 10268 | 10472 | }); |
| 10269 | 10473 | return select3(import_editor5.store).isInserterOpened(); |
| 10270 | 10474 | }); |
| 10271 | - var __experimentalGetInsertionPoint = (0, import_data5.createRegistrySelector)( | |
| 10475 | + var __experimentalGetInsertionPoint = (0, import_data6.createRegistrySelector)( | |
| 10272 | 10476 | (select3) => () => { |
| 10273 | 10477 | (0, import_deprecated2.default)( |
| 10274 | 10478 | `select( 'core/edit-post' ).__experimentalGetInsertionPoint`, |
| 10275 | 10479 | { |
| @@ -10279,9 +10483,9 @@ | ||
| 10279 | 10483 | ); |
| 10280 | 10484 | return unlock2(select3(import_editor5.store)).getInserter(); |
| 10281 | 10485 | } |
| 10282 | 10486 | ); |
| 10283 | - var isListViewOpened = (0, import_data5.createRegistrySelector)((select3) => () => { | |
| 10487 | + var isListViewOpened = (0, import_data6.createRegistrySelector)((select3) => () => { | |
| 10284 | 10488 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isListViewOpened`, { |
| 10285 | 10489 | since: "6.5", |
| 10286 | 10490 | alternative: `select( 'core/editor' ).isListViewOpened` |
| 10287 | 10491 | }); |
| @@ -10286,9 +10490,9 @@ | ||
| 10286 | 10490 | alternative: `select( 'core/editor' ).isListViewOpened` |
| 10287 | 10491 | }); |
| 10288 | 10492 | return select3(import_editor5.store).isListViewOpened(); |
| 10289 | 10493 | }); |
| 10290 | - var isEditingTemplate = (0, import_data5.createRegistrySelector)((select3) => () => { | |
| 10494 | + var isEditingTemplate = (0, import_data6.createRegistrySelector)((select3) => () => { | |
| 10291 | 10495 | (0, import_deprecated2.default)(`select( 'core/edit-post' ).isEditingTemplate`, { |
| 10292 | 10496 | since: "6.5", |
| 10293 | 10497 | alternative: `select( 'core/editor' ).getRenderingMode` |
| 10294 | 10498 | }); |
| @@ -10296,9 +10500,9 @@ | ||
| 10296 | 10500 | }); |
| 10297 | 10501 | function areMetaBoxesInitialized(state) { |
| 10298 | 10502 | return state.metaBoxes.initialized; |
| 10299 | 10503 | } |
| 10300 | - var getEditedPostTemplate = (0, import_data5.createRegistrySelector)( | |
| 10504 | + var getEditedPostTemplate = (0, import_data6.createRegistrySelector)( | |
| 10301 | 10505 | (select3) => () => { |
| 10302 | 10506 | const { id: postId, type: postType } = select3(import_editor5.store).getCurrentPost(); |
| 10303 | 10507 | const templateId = unlock2(select3(import_core_data4.store)).getTemplateId( |
| 10304 | 10508 | postType, |
| @@ -10315,24 +10519,24 @@ | ||
| 10315 | 10519 | } |
| 10316 | 10520 | ); |
| 10317 | 10521 | |
| 10318 | 10522 | // packages/edit-post/build-module/store/index.mjs |
| 10319 | - var store = (0, import_data6.createReduxStore)(STORE_NAME, { | |
| 10523 | + var store = (0, import_data7.createReduxStore)(STORE_NAME, { | |
| 10320 | 10524 | reducer: reducer_default, |
| 10321 | 10525 | actions: actions_exports, |
| 10322 | 10526 | selectors: selectors_exports |
| 10323 | 10527 | }); |
| 10324 | - (0, import_data6.register)(store); | |
| 10528 | + (0, import_data7.register)(store); | |
| 10325 | 10529 | |
| 10326 | 10530 | // packages/edit-post/build-module/components/keyboard-shortcuts/index.mjs |
| 10327 | 10531 | function KeyboardShortcuts() { |
| 10328 | - const { toggleFullscreenMode: toggleFullscreenMode2 } = (0, import_data7.useDispatch)(store); | |
| 10329 | - const { registerShortcut } = (0, import_data7.useDispatch)(import_keyboard_shortcuts.store); | |
| 10532 | + const { toggleFullscreenMode: toggleFullscreenMode2 } = (0, import_data8.useDispatch)(store); | |
| 10533 | + const { registerShortcut } = (0, import_data8.useDispatch)(import_keyboard_shortcuts.store); | |
| 10330 | 10534 | (0, import_element19.useEffect)(() => { |
| 10331 | 10535 | registerShortcut({ |
| 10332 | 10536 | name: "core/edit-post/toggle-fullscreen", |
| 10333 | 10537 | category: "global", |
| 10334 | - description: (0, import_i18n3.__)("Enable or disable fullscreen mode."), | |
| 10538 | + description: (0, import_i18n4.__)("Enable or disable fullscreen mode."), | |
| 10335 | 10539 | keyCombination: { |
| 10336 | 10540 | modifier: "secondary", |
| 10337 | 10541 | character: "f" |
| 10338 | 10542 | } |
| @@ -10345,17 +10549,17 @@ | ||
| 10345 | 10549 | } |
| 10346 | 10550 | var keyboard_shortcuts_default = KeyboardShortcuts; |
| 10347 | 10551 | |
| 10348 | 10552 | // packages/edit-post/build-module/components/init-pattern-modal/index.mjs |
| 10349 | - var import_data8 = __toESM(require_data(), 1); | |
| 10350 | - var import_i18n4 = __toESM(require_i18n(), 1); | |
| 10553 | + var import_data9 = __toESM(require_data(), 1); | |
| 10554 | + var import_i18n5 = __toESM(require_i18n(), 1); | |
| 10351 | 10555 | var import_components3 = __toESM(require_components(), 1); |
| 10352 | 10556 | var import_element20 = __toESM(require_element(), 1); |
| 10353 | 10557 | var import_editor6 = __toESM(require_editor(), 1); |
| 10354 | - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); | |
| 10558 | + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); | |
| 10355 | 10559 | function InitPatternModal() { |
| 10356 | - const { editPost } = (0, import_data8.useDispatch)(import_editor6.store); | |
| 10357 | - const { isCleanNewPost } = (0, import_data8.useSelect)(import_editor6.store); | |
| 10560 | + const { editPost } = (0, import_data9.useDispatch)(import_editor6.store); | |
| 10561 | + const { isCleanNewPost } = (0, import_data9.useSelect)(import_editor6.store); | |
| 10358 | 10562 | const [syncType, setSyncType] = (0, import_element20.useState)(void 0); |
| 10359 | 10563 | const [title, setTitle] = (0, import_element20.useState)(""); |
| 10360 | 10564 | const [isModalOpen, setIsModalOpen] = (0, import_element20.useState)(() => isCleanNewPost()); |
| 10361 | 10565 | if (!isModalOpen) { |
| @@ -10360,17 +10564,17 @@ | ||
| 10360 | 10564 | const [isModalOpen, setIsModalOpen] = (0, import_element20.useState)(() => isCleanNewPost()); |
| 10361 | 10565 | if (!isModalOpen) { |
| 10362 | 10566 | return null; |
| 10363 | 10567 | } |
| 10364 | - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 10568 | + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 10365 | 10569 | import_components3.Modal, |
| 10366 | 10570 | { |
| 10367 | - title: (0, import_i18n4.__)("Create pattern"), | |
| 10571 | + title: (0, import_i18n5.__)("Create pattern"), | |
| 10368 | 10572 | onRequestClose: () => { |
| 10369 | 10573 | setIsModalOpen(false); |
| 10370 | 10574 | }, |
| 10371 | 10575 | overlayClassName: "patterns-create-modal", |
| 10372 | - children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 10576 | + children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 10373 | 10577 | "form", |
| 10374 | 10578 | { |
| 10375 | 10579 | onSubmit: (event) => { |
| 10376 | 10580 | event.preventDefault(); |
| @@ -10381,24 +10585,24 @@ | ||
| 10381 | 10585 | wp_pattern_sync_status: syncType |
| 10382 | 10586 | } |
| 10383 | 10587 | }); |
| 10384 | 10588 | }, |
| 10385 | - children: /* @__PURE__ */ (0, import_jsx_runtime25.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 10386 | - /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 10589 | + children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 10590 | + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 10387 | 10591 | import_components3.TextControl, |
| 10388 | 10592 | { |
| 10389 | - label: (0, import_i18n4.__)("Name"), | |
| 10593 | + label: (0, import_i18n5.__)("Name"), | |
| 10390 | 10594 | value: title, |
| 10391 | 10595 | onChange: setTitle, |
| 10392 | - placeholder: (0, import_i18n4.__)("My pattern"), | |
| 10596 | + placeholder: (0, import_i18n5.__)("My pattern"), | |
| 10393 | 10597 | className: "patterns-create-modal__name-input" |
| 10394 | 10598 | } |
| 10395 | 10599 | ), |
| 10396 | - /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 10600 | + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 10397 | 10601 | import_components3.ToggleControl, |
| 10398 | 10602 | { |
| 10399 | - label: (0, import_i18n4._x)("Synced", "pattern (singular)"), | |
| 10400 | - help: (0, import_i18n4.__)( | |
| 10603 | + label: (0, import_i18n5._x)("Synced", "pattern (singular)"), | |
| 10604 | + help: (0, import_i18n5.__)( | |
| 10401 | 10605 | "Sync this pattern across multiple locations." |
| 10402 | 10606 | ), |
| 10403 | 10607 | checked: !syncType, |
| 10404 | 10608 | onChange: () => { |
| @@ -10405,9 +10609,9 @@ | ||
| 10405 | 10609 | setSyncType(!syncType ? "unsynced" : void 0); |
| 10406 | 10610 | } |
| 10407 | 10611 | } |
| 10408 | 10612 | ), |
| 10409 | - /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Stack, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 10613 | + /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Stack, { justify: "end", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 10410 | 10614 | import_components3.Button, |
| 10411 | 10615 | { |
| 10412 | 10616 | __next40pxDefaultSize: true, |
| 10413 | 10617 | variant: "primary", |
| @@ -10413,9 +10617,9 @@ | ||
| 10413 | 10617 | variant: "primary", |
| 10414 | 10618 | type: "submit", |
| 10415 | 10619 | disabled: !title, |
| 10416 | 10620 | accessibleWhenDisabled: true, |
| 10417 | - children: (0, import_i18n4.__)("Create") | |
| 10621 | + children: (0, import_i18n5.__)("Create") | |
| 10418 | 10622 | } |
| 10419 | 10623 | ) }) |
| 10420 | 10624 | ] }) |
| 10421 | 10625 | } |
| @@ -10424,19 +10628,91 @@ | ||
| 10424 | 10628 | ); |
| 10425 | 10629 | } |
| 10426 | 10630 | |
| 10427 | 10631 | // packages/edit-post/build-module/components/browser-url/index.mjs |
| 10632 | + var import_element22 = __toESM(require_element(), 1); | |
| 10633 | + var import_data11 = __toESM(require_data(), 1); | |
| 10634 | + var import_url3 = __toESM(require_url(), 1); | |
| 10635 | + var import_editor8 = __toESM(require_editor(), 1); | |
| 10636 | + | |
| 10637 | + // packages/edit-post/build-module/components/browser-url/use-classic-revision-redirect.mjs | |
| 10638 | + var import_data10 = __toESM(require_data(), 1); | |
| 10639 | + var import_core_data5 = __toESM(require_core_data(), 1); | |
| 10640 | + var import_editor7 = __toESM(require_editor(), 1); | |
| 10428 | 10641 | var import_element21 = __toESM(require_element(), 1); |
| 10429 | - var import_data9 = __toESM(require_data(), 1); | |
| 10430 | 10642 | var import_url2 = __toESM(require_url(), 1); |
| 10431 | - var import_editor7 = __toESM(require_editor(), 1); | |
| 10432 | - function getPostEditURL(postId) { | |
| 10433 | - return (0, import_url2.addQueryArgs)("post.php", { post: postId, action: "edit" }); | |
| 10643 | + function useClassicRevisionRedirect() { | |
| 10644 | + const registry = (0, import_data10.useRegistry)(); | |
| 10645 | + const { disableVisualRevisions, currentRevisionId, postType, postId } = (0, import_data10.useSelect)((select3) => { | |
| 10646 | + const editor = select3(import_editor7.store); | |
| 10647 | + return { | |
| 10648 | + disableVisualRevisions: !!editor.getEditorSettings().disableVisualRevisions, | |
| 10649 | + currentRevisionId: unlock2(editor).getCurrentRevisionId(), | |
| 10650 | + postType: editor.getCurrentPostType(), | |
| 10651 | + postId: editor.getCurrentPostId() | |
| 10652 | + }; | |
| 10653 | + }, []); | |
| 10654 | + const hasClassicRevisionScreen = ![ | |
| 10655 | + "wp_template", | |
| 10656 | + "wp_template_part" | |
| 10657 | + ].includes(postType); | |
| 10658 | + (0, import_element21.useEffect)(() => { | |
| 10659 | + if (!disableVisualRevisions || !hasClassicRevisionScreen || !currentRevisionId || !postType || !postId) { | |
| 10660 | + return; | |
| 10661 | + } | |
| 10662 | + let cancelled = false; | |
| 10663 | + registry.resolveSelect(import_core_data5.store).getRevision("postType", postType, postId, currentRevisionId, { | |
| 10664 | + context: "edit", | |
| 10665 | + _fields: "id" | |
| 10666 | + }).then((revision) => { | |
| 10667 | + if (cancelled || !revision) { | |
| 10668 | + return; | |
| 10669 | + } | |
| 10670 | + const editor = registry.select(import_editor7.store); | |
| 10671 | + const isStillSelected = !!editor.getEditorSettings().disableVisualRevisions && editor.getCurrentPostType() === postType && String(editor.getCurrentPostId()) === String(postId) && unlock2(editor).getCurrentRevisionId() === currentRevisionId; | |
| 10672 | + if (!isStillSelected) { | |
| 10673 | + return; | |
| 10674 | + } | |
| 10675 | + window.location.replace( | |
| 10676 | + (0, import_url2.addQueryArgs)("revision.php", { | |
| 10677 | + revision: currentRevisionId | |
| 10678 | + }) | |
| 10679 | + ); | |
| 10680 | + }); | |
| 10681 | + return () => { | |
| 10682 | + cancelled = true; | |
| 10683 | + }; | |
| 10684 | + }, [ | |
| 10685 | + disableVisualRevisions, | |
| 10686 | + hasClassicRevisionScreen, | |
| 10687 | + currentRevisionId, | |
| 10688 | + postType, | |
| 10689 | + postId, | |
| 10690 | + registry | |
| 10691 | + ]); | |
| 10434 | 10692 | } |
| 10693 | + | |
| 10694 | + // packages/edit-post/build-module/components/browser-url/index.mjs | |
| 10695 | + var URL_WRITE_DEBOUNCE_MS = 300; | |
| 10696 | + function getPostEditURL(postId, revisionId) { | |
| 10697 | + const args = { post: postId, action: "edit" }; | |
| 10698 | + if (revisionId) { | |
| 10699 | + args.revision = revisionId; | |
| 10700 | + } | |
| 10701 | + return (0, import_url3.addQueryArgs)("post.php", args); | |
| 10702 | + } | |
| 10435 | 10703 | function BrowserURL() { |
| 10436 | - const [historyId, setHistoryId] = (0, import_element21.useState)(null); | |
| 10437 | - const { postId, postStatus } = (0, import_data9.useSelect)((select3) => { | |
| 10438 | - const { getCurrentPost } = select3(import_editor7.store); | |
| 10704 | + useClassicRevisionRedirect(); | |
| 10705 | + const [initialRevisionId] = (0, import_element22.useState)(() => { | |
| 10706 | + const revision = Number( | |
| 10707 | + (0, import_url3.getQueryArg)(window.location.href, "revision") | |
| 10708 | + ); | |
| 10709 | + return Number.isInteger(revision) && revision > 0 ? revision : null; | |
| 10710 | + }); | |
| 10711 | + const hasHandledInitialRevisionRef = (0, import_element22.useRef)(false); | |
| 10712 | + const { postId, postStatus, currentRevisionId } = (0, import_data11.useSelect)((select3) => { | |
| 10713 | + const { getCurrentPost } = select3(import_editor8.store); | |
| 10714 | + const { getCurrentRevisionId } = unlock2(select3(import_editor8.store)); | |
| 10439 | 10715 | const post = getCurrentPost(); |
| 10440 | 10716 | let { id, status, type } = post; |
| 10441 | 10717 | const isTemplate = ["wp_template", "wp_template_part"].includes( |
| 10442 | 10718 | type |
| @@ -10445,57 +10721,110 @@ | ||
| 10445 | 10721 | id = post.wp_id; |
| 10446 | 10722 | } |
| 10447 | 10723 | return { |
| 10448 | 10724 | postId: id, |
| 10449 | - postStatus: status | |
| 10725 | + postStatus: status, | |
| 10726 | + // `post.php` rejects templates because `show_ui` is false. Adding | |
| 10727 | + // their revision ID to this URL would create a dead link. | |
| 10728 | + currentRevisionId: isTemplate ? null : getCurrentRevisionId() | |
| 10450 | 10729 | }; |
| 10451 | 10730 | }, []); |
| 10452 | - (0, import_element21.useEffect)(() => { | |
| 10453 | - if (postId && postId !== historyId && postStatus !== "auto-draft") { | |
| 10454 | - window.history.replaceState( | |
| 10455 | - { id: postId }, | |
| 10456 | - "Post " + postId, | |
| 10457 | - getPostEditURL(postId) | |
| 10458 | - ); | |
| 10459 | - setHistoryId(postId); | |
| 10731 | + const { openRevision } = unlock2((0, import_data11.useDispatch)(import_editor8.store)); | |
| 10732 | + const lastURLWriteTimeRef = (0, import_element22.useRef)(null); | |
| 10733 | + const lastPostIdRef = (0, import_element22.useRef)(null); | |
| 10734 | + (0, import_element22.useEffect)(() => { | |
| 10735 | + if (!postId) { | |
| 10736 | + return; | |
| 10460 | 10737 | } |
| 10461 | - }, [postId, postStatus, historyId]); | |
| 10738 | + if (initialRevisionId && !hasHandledInitialRevisionRef.current) { | |
| 10739 | + hasHandledInitialRevisionRef.current = true; | |
| 10740 | + openRevision(initialRevisionId); | |
| 10741 | + return; | |
| 10742 | + } | |
| 10743 | + if (postStatus === "auto-draft") { | |
| 10744 | + return; | |
| 10745 | + } | |
| 10746 | + const previousPostId = lastPostIdRef.current; | |
| 10747 | + lastPostIdRef.current = postId; | |
| 10748 | + const url = getPostEditURL(postId, currentRevisionId); | |
| 10749 | + const write = () => { | |
| 10750 | + lastURLWriteTimeRef.current = Date.now(); | |
| 10751 | + try { | |
| 10752 | + window.history.replaceState( | |
| 10753 | + { id: postId }, | |
| 10754 | + "Post " + postId, | |
| 10755 | + url | |
| 10756 | + ); | |
| 10757 | + } catch { | |
| 10758 | + } | |
| 10759 | + }; | |
| 10760 | + if (previousPostId !== null && previousPostId !== postId) { | |
| 10761 | + write(); | |
| 10762 | + return; | |
| 10763 | + } | |
| 10764 | + if (lastURLWriteTimeRef.current === null) { | |
| 10765 | + write(); | |
| 10766 | + return; | |
| 10767 | + } | |
| 10768 | + if (Date.now() - lastURLWriteTimeRef.current >= URL_WRITE_DEBOUNCE_MS) { | |
| 10769 | + write(); | |
| 10770 | + return; | |
| 10771 | + } | |
| 10772 | + const timeoutId = setTimeout(write, URL_WRITE_DEBOUNCE_MS); | |
| 10773 | + return () => clearTimeout(timeoutId); | |
| 10774 | + }, [ | |
| 10775 | + postId, | |
| 10776 | + postStatus, | |
| 10777 | + currentRevisionId, | |
| 10778 | + initialRevisionId, | |
| 10779 | + openRevision | |
| 10780 | + ]); | |
| 10462 | 10781 | return null; |
| 10463 | 10782 | } |
| 10464 | 10783 | |
| 10465 | 10784 | // packages/edit-post/build-module/components/meta-boxes/index.mjs |
| 10466 | - var import_data12 = __toESM(require_data(), 1); | |
| 10785 | + var import_data14 = __toESM(require_data(), 1); | |
| 10467 | 10786 | |
| 10468 | 10787 | // packages/edit-post/build-module/components/meta-boxes/meta-boxes-area/index.mjs |
| 10469 | - var import_element22 = __toESM(require_element(), 1); | |
| 10788 | + var import_element23 = __toESM(require_element(), 1); | |
| 10470 | 10789 | var import_components4 = __toESM(require_components(), 1); |
| 10471 | - var import_data10 = __toESM(require_data(), 1); | |
| 10472 | - var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); | |
| 10790 | + var import_data12 = __toESM(require_data(), 1); | |
| 10791 | + var import_block_editor = __toESM(require_block_editor(), 1); | |
| 10792 | + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); | |
| 10793 | + var { useNativeUndo } = unlock2(import_block_editor.privateApis); | |
| 10794 | + function move(parent, node) { | |
| 10795 | + if (parent.moveBefore && parent.isConnected && node.isConnected) { | |
| 10796 | + parent.moveBefore(node, null); | |
| 10797 | + } else { | |
| 10798 | + parent.appendChild(node); | |
| 10799 | + } | |
| 10800 | + } | |
| 10473 | 10801 | function MetaBoxesArea({ location }) { |
| 10474 | - const container = (0, import_element22.useRef)(null); | |
| 10475 | - const formRef = (0, import_element22.useRef)(null); | |
| 10476 | - (0, import_element22.useEffect)(() => { | |
| 10802 | + const container = (0, import_element23.useRef)(null); | |
| 10803 | + const formRef = (0, import_element23.useRef)(null); | |
| 10804 | + (0, import_element23.useLayoutEffect)(() => { | |
| 10477 | 10805 | formRef.current = document.querySelector( |
| 10478 | 10806 | ".metabox-location-" + location |
| 10479 | 10807 | ); |
| 10480 | 10808 | if (formRef.current) { |
| 10481 | - container.current.appendChild(formRef.current); | |
| 10809 | + move(container.current, formRef.current); | |
| 10482 | 10810 | } |
| 10483 | 10811 | return () => { |
| 10484 | 10812 | if (formRef.current) { |
| 10485 | - document.querySelector("#metaboxes").appendChild(formRef.current); | |
| 10813 | + move(document.querySelector("#metaboxes"), formRef.current); | |
| 10486 | 10814 | } |
| 10487 | 10815 | }; |
| 10488 | 10816 | }, [location]); |
| 10489 | - const isSaving = (0, import_data10.useSelect)((select3) => { | |
| 10817 | + const isSaving = (0, import_data12.useSelect)((select3) => { | |
| 10490 | 10818 | return select3(store).isSavingMetaBoxes(); |
| 10491 | 10819 | }, []); |
| 10492 | 10820 | const classes = clsx_default("edit-post-meta-boxes-area", `is-${location}`, { |
| 10493 | 10821 | "is-loading": isSaving |
| 10494 | 10822 | }); |
| 10495 | - return /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)("div", { className: classes, children: [ | |
| 10496 | - isSaving && /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_components4.Spinner, { className: "edit-post-meta-boxes-area__spinner" }), | |
| 10497 | - /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( | |
| 10823 | + const nativeUndoRef = useNativeUndo(); | |
| 10824 | + return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)("div", { className: classes, ref: nativeUndoRef, children: [ | |
| 10825 | + isSaving && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components4.Spinner, { className: "edit-post-meta-boxes-area__spinner" }), | |
| 10826 | + /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( | |
| 10498 | 10827 | "div", |
| 10499 | 10828 | { |
| 10500 | 10829 | className: "edit-post-meta-boxes-area__container", |
| 10501 | 10830 | ref: container |
| @@ -10500,27 +10829,27 @@ | ||
| 10500 | 10829 | className: "edit-post-meta-boxes-area__container", |
| 10501 | 10830 | ref: container |
| 10502 | 10831 | } |
| 10503 | 10832 | ), |
| 10504 | - /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("div", { className: "edit-post-meta-boxes-area__clear" }) | |
| 10833 | + /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("div", { className: "edit-post-meta-boxes-area__clear" }) | |
| 10505 | 10834 | ] }); |
| 10506 | 10835 | } |
| 10507 | 10836 | var meta_boxes_area_default = MetaBoxesArea; |
| 10508 | 10837 | |
| 10509 | 10838 | // packages/edit-post/build-module/components/meta-boxes/meta-box-visibility.mjs |
| 10510 | - var import_element23 = __toESM(require_element(), 1); | |
| 10511 | - var import_data11 = __toESM(require_data(), 1); | |
| 10512 | - var import_editor8 = __toESM(require_editor(), 1); | |
| 10839 | + var import_element24 = __toESM(require_element(), 1); | |
| 10840 | + var import_data13 = __toESM(require_data(), 1); | |
| 10841 | + var import_editor9 = __toESM(require_editor(), 1); | |
| 10513 | 10842 | function MetaBoxVisibility({ id }) { |
| 10514 | - const isVisible = (0, import_data11.useSelect)( | |
| 10843 | + const isVisible = (0, import_data13.useSelect)( | |
| 10515 | 10844 | (select3) => { |
| 10516 | - return select3(import_editor8.store).isEditorPanelEnabled( | |
| 10845 | + return select3(import_editor9.store).isEditorPanelEnabled( | |
| 10517 | 10846 | `meta-box-${id}` |
| 10518 | 10847 | ); |
| 10519 | 10848 | }, |
| 10520 | 10849 | [id] |
| 10521 | 10850 | ); |
| 10522 | - (0, import_element23.useEffect)(() => { | |
| 10851 | + (0, import_element24.useEffect)(() => { | |
| 10523 | 10852 | const element = document.getElementById(id); |
| 10524 | 10853 | if (!element) { |
| 10525 | 10854 | return; |
| 10526 | 10855 | } |
| @@ -10533,41 +10862,41 @@ | ||
| 10533 | 10862 | return null; |
| 10534 | 10863 | } |
| 10535 | 10864 | |
| 10536 | 10865 | // packages/edit-post/build-module/components/meta-boxes/index.mjs |
| 10537 | - var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); | |
| 10866 | + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); | |
| 10538 | 10867 | function MetaBoxes({ location }) { |
| 10539 | - const metaBoxes2 = (0, import_data12.useSelect)( | |
| 10868 | + const metaBoxes2 = (0, import_data14.useSelect)( | |
| 10540 | 10869 | (select3) => select3(store).getMetaBoxesPerLocation(location), |
| 10541 | 10870 | [location] |
| 10542 | 10871 | ); |
| 10543 | - return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [ | |
| 10544 | - (metaBoxes2 ?? []).map(({ id }) => /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(MetaBoxVisibility, { id }, id)), | |
| 10545 | - /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(meta_boxes_area_default, { location }) | |
| 10872 | + return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [ | |
| 10873 | + (metaBoxes2 ?? []).map(({ id }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(MetaBoxVisibility, { id }, id)), | |
| 10874 | + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(meta_boxes_area_default, { location }) | |
| 10546 | 10875 | ] }); |
| 10547 | 10876 | } |
| 10548 | 10877 | |
| 10549 | 10878 | // packages/edit-post/build-module/components/more-menu/index.mjs |
| 10550 | - var import_i18n10 = __toESM(require_i18n(), 1); | |
| 10879 | + var import_i18n11 = __toESM(require_i18n(), 1); | |
| 10551 | 10880 | var import_compose = __toESM(require_compose(), 1); |
| 10552 | - var import_editor14 = __toESM(require_editor(), 1); | |
| 10881 | + var import_editor16 = __toESM(require_editor(), 1); | |
| 10553 | 10882 | var import_keycodes = __toESM(require_keycodes(), 1); |
| 10554 | - var import_preferences8 = __toESM(require_preferences(), 1); | |
| 10555 | 10883 | |
| 10556 | 10884 | // packages/edit-post/build-module/components/more-menu/manage-patterns-menu-item.mjs |
| 10557 | - var import_components5 = __toESM(require_components(), 1); | |
| 10558 | - var import_core_data5 = __toESM(require_core_data(), 1); | |
| 10559 | - var import_data13 = __toESM(require_data(), 1); | |
| 10560 | - var import_i18n5 = __toESM(require_i18n(), 1); | |
| 10561 | - var import_url3 = __toESM(require_url(), 1); | |
| 10562 | - var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); | |
| 10885 | + var import_core_data6 = __toESM(require_core_data(), 1); | |
| 10886 | + var import_data15 = __toESM(require_data(), 1); | |
| 10887 | + var import_editor10 = __toESM(require_editor(), 1); | |
| 10888 | + var import_i18n6 = __toESM(require_i18n(), 1); | |
| 10889 | + var import_url4 = __toESM(require_url(), 1); | |
| 10890 | + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); | |
| 10891 | + var { MoreMenuItem } = unlock2(import_editor10.privateApis); | |
| 10563 | 10892 | function ManagePatternsMenuItem() { |
| 10564 | - const url = (0, import_data13.useSelect)((select3) => { | |
| 10565 | - const { canUser } = select3(import_core_data5.store); | |
| 10566 | - const defaultUrl = (0, import_url3.addQueryArgs)("edit.php", { | |
| 10893 | + const url = (0, import_data15.useSelect)((select3) => { | |
| 10894 | + const { canUser } = select3(import_core_data6.store); | |
| 10895 | + const defaultUrl = (0, import_url4.addQueryArgs)("edit.php", { | |
| 10567 | 10896 | post_type: "wp_block" |
| 10568 | 10897 | }); |
| 10569 | - const patternsUrl = (0, import_url3.addQueryArgs)("site-editor.php", { | |
| 10898 | + const patternsUrl = (0, import_url4.addQueryArgs)("site-editor.php", { | |
| 10570 | 10899 | p: "/pattern" |
| 10571 | 10900 | }); |
| 10572 | 10901 | return canUser("create", { |
| 10573 | 10902 | kind: "postType", |
| @@ -10573,69 +10902,74 @@ | ||
| 10573 | 10902 | kind: "postType", |
| 10574 | 10903 | name: "wp_template" |
| 10575 | 10904 | }) ? patternsUrl : defaultUrl; |
| 10576 | 10905 | }, []); |
| 10577 | - return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_components5.MenuItem, { role: "menuitem", href: url, children: (0, import_i18n5.__)("Manage patterns") }); | |
| 10906 | + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(MoreMenuItem, { href: url, children: (0, import_i18n6.__)("Manage patterns") }); | |
| 10578 | 10907 | } |
| 10579 | 10908 | var manage_patterns_menu_item_default = ManagePatternsMenuItem; |
| 10580 | 10909 | |
| 10581 | 10910 | // packages/edit-post/build-module/components/more-menu/welcome-guide-menu-item.mjs |
| 10582 | - var import_data14 = __toESM(require_data(), 1); | |
| 10583 | - var import_preferences3 = __toESM(require_preferences(), 1); | |
| 10584 | - var import_i18n6 = __toESM(require_i18n(), 1); | |
| 10585 | - var import_editor9 = __toESM(require_editor(), 1); | |
| 10586 | - var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); | |
| 10911 | + var import_i18n7 = __toESM(require_i18n(), 1); | |
| 10912 | + var import_data16 = __toESM(require_data(), 1); | |
| 10913 | + var import_editor11 = __toESM(require_editor(), 1); | |
| 10914 | + var import_preferences4 = __toESM(require_preferences(), 1); | |
| 10915 | + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); | |
| 10916 | + var { MoreMenuItem: MoreMenuItem2 } = unlock2(import_editor11.privateApis); | |
| 10587 | 10917 | function WelcomeGuideMenuItem() { |
| 10588 | - const isEditingTemplate2 = (0, import_data14.useSelect)( | |
| 10589 | - (select3) => select3(import_editor9.store).getCurrentPostType() === "wp_template", | |
| 10918 | + const isEditingTemplate2 = (0, import_data16.useSelect)( | |
| 10919 | + (select3) => select3(import_editor11.store).getCurrentPostType() === "wp_template", | |
| 10590 | 10920 | [] |
| 10591 | 10921 | ); |
| 10592 | - return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 10593 | - import_preferences3.PreferenceToggleMenuItem, | |
| 10922 | + const { toggle } = (0, import_data16.useDispatch)(import_preferences4.store); | |
| 10923 | + return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( | |
| 10924 | + MoreMenuItem2, | |
| 10594 | 10925 | { |
| 10595 | - scope: "core/edit-post", | |
| 10596 | - name: isEditingTemplate2 ? "welcomeGuideTemplate" : "welcomeGuide", | |
| 10597 | - label: (0, import_i18n6.__)("Welcome Guide") | |
| 10926 | + onClick: () => toggle( | |
| 10927 | + "core/edit-post", | |
| 10928 | + isEditingTemplate2 ? "welcomeGuideTemplate" : "welcomeGuide" | |
| 10929 | + ), | |
| 10930 | + "aria-haspopup": "dialog", | |
| 10931 | + children: (0, import_i18n7.__)("Welcome Guide") | |
| 10598 | 10932 | } |
| 10599 | 10933 | ); |
| 10600 | 10934 | } |
| 10601 | 10935 | |
| 10602 | 10936 | // packages/edit-post/build-module/components/preferences-modal/index.mjs |
| 10937 | + var import_i18n10 = __toESM(require_i18n(), 1); | |
| 10938 | + var import_preferences8 = __toESM(require_preferences(), 1); | |
| 10939 | + var import_editor15 = __toESM(require_editor(), 1); | |
| 10940 | + | |
| 10941 | + // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs | |
| 10603 | 10942 | var import_i18n9 = __toESM(require_i18n(), 1); |
| 10943 | + var import_data19 = __toESM(require_data(), 1); | |
| 10944 | + var import_editor14 = __toESM(require_editor(), 1); | |
| 10604 | 10945 | var import_preferences7 = __toESM(require_preferences(), 1); |
| 10605 | - var import_editor13 = __toESM(require_editor(), 1); | |
| 10606 | 10946 | |
| 10607 | - // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs | |
| 10947 | + // packages/edit-post/build-module/components/preferences-modal/enable-custom-fields.mjs | |
| 10948 | + var import_element25 = __toESM(require_element(), 1); | |
| 10608 | 10949 | var import_i18n8 = __toESM(require_i18n(), 1); |
| 10950 | + var import_components5 = __toESM(require_components(), 1); | |
| 10609 | 10951 | var import_data17 = __toESM(require_data(), 1); |
| 10610 | 10952 | var import_editor12 = __toESM(require_editor(), 1); |
| 10611 | - var import_preferences6 = __toESM(require_preferences(), 1); | |
| 10612 | - | |
| 10613 | - // packages/edit-post/build-module/components/preferences-modal/enable-custom-fields.mjs | |
| 10614 | - var import_element24 = __toESM(require_element(), 1); | |
| 10615 | - var import_i18n7 = __toESM(require_i18n(), 1); | |
| 10616 | - var import_components6 = __toESM(require_components(), 1); | |
| 10617 | - var import_data15 = __toESM(require_data(), 1); | |
| 10618 | - var import_editor10 = __toESM(require_editor(), 1); | |
| 10619 | - var import_preferences4 = __toESM(require_preferences(), 1); | |
| 10620 | - var import_url4 = __toESM(require_url(), 1); | |
| 10621 | - var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); | |
| 10622 | - var { PreferenceBaseOption } = unlock2(import_preferences4.privateApis); | |
| 10953 | + var import_preferences5 = __toESM(require_preferences(), 1); | |
| 10954 | + var import_url5 = __toESM(require_url(), 1); | |
| 10955 | + var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); | |
| 10956 | + var { PreferenceBaseOption } = unlock2(import_preferences5.privateApis); | |
| 10623 | 10957 | function submitCustomFieldsForm() { |
| 10624 | 10958 | const customFieldsForm = document.getElementById( |
| 10625 | 10959 | "toggle-custom-fields-form" |
| 10626 | 10960 | ); |
| 10627 | - customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute("value", (0, import_url4.getPathAndQueryString)(window.location.href)); | |
| 10961 | + customFieldsForm.querySelector('[name="_wp_http_referer"]').setAttribute("value", (0, import_url5.getPathAndQueryString)(window.location.href)); | |
| 10628 | 10962 | customFieldsForm.submit(); |
| 10629 | 10963 | } |
| 10630 | 10964 | function CustomFieldsConfirmation({ willEnable }) { |
| 10631 | - const [isReloading, setIsReloading] = (0, import_element24.useState)(false); | |
| 10632 | - return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [ | |
| 10633 | - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0, import_i18n7.__)( | |
| 10965 | + const [isReloading, setIsReloading] = (0, import_element25.useState)(false); | |
| 10966 | + return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_jsx_runtime32.Fragment, { children: [ | |
| 10967 | + /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", { className: "edit-post-preferences-modal__custom-fields-confirmation-message", children: (0, import_i18n8.__)( | |
| 10634 | 10968 | "A page reload is required for this change. Make sure your content is saved before reloading." |
| 10635 | 10969 | ) }), |
| 10636 | - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 10637 | - import_components6.Button, | |
| 10970 | + /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 10971 | + import_components5.Button, | |
| 10638 | 10972 | { |
| 10639 | 10973 | __next40pxDefaultSize: true, |
| 10640 | 10974 | variant: "secondary", |
| 10641 | 10975 | isBusy: isReloading, |
| @@ -10644,40 +10978,40 @@ | ||
| 10644 | 10978 | onClick: () => { |
| 10645 | 10979 | setIsReloading(true); |
| 10646 | 10980 | submitCustomFieldsForm(); |
| 10647 | 10981 | }, |
| 10648 | - children: willEnable ? (0, import_i18n7.__)("Show & Reload Page") : (0, import_i18n7.__)("Hide & Reload Page") | |
| 10982 | + children: willEnable ? (0, import_i18n8.__)("Show & Reload Page") : (0, import_i18n8.__)("Hide & Reload Page") | |
| 10649 | 10983 | } |
| 10650 | 10984 | ) |
| 10651 | 10985 | ] }); |
| 10652 | 10986 | } |
| 10653 | 10987 | function EnableCustomFieldsOption({ label }) { |
| 10654 | - const areCustomFieldsEnabled = (0, import_data15.useSelect)((select3) => { | |
| 10655 | - return !!select3(import_editor10.store).getEditorSettings().enableCustomFields; | |
| 10988 | + const areCustomFieldsEnabled = (0, import_data17.useSelect)((select3) => { | |
| 10989 | + return !!select3(import_editor12.store).getEditorSettings().enableCustomFields; | |
| 10656 | 10990 | }, []); |
| 10657 | - const [isChecked, setIsChecked] = (0, import_element24.useState)(areCustomFieldsEnabled); | |
| 10658 | - return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 10991 | + const [isChecked, setIsChecked] = (0, import_element25.useState)(areCustomFieldsEnabled); | |
| 10992 | + return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 10659 | 10993 | PreferenceBaseOption, |
| 10660 | 10994 | { |
| 10661 | 10995 | label, |
| 10662 | 10996 | isChecked, |
| 10663 | 10997 | onChange: setIsChecked, |
| 10664 | - children: isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CustomFieldsConfirmation, { willEnable: isChecked }) | |
| 10998 | + children: isChecked !== areCustomFieldsEnabled && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CustomFieldsConfirmation, { willEnable: isChecked }) | |
| 10665 | 10999 | } |
| 10666 | 11000 | ); |
| 10667 | 11001 | } |
| 10668 | 11002 | |
| 10669 | 11003 | // packages/edit-post/build-module/components/preferences-modal/enable-panel.mjs |
| 10670 | - var import_data16 = __toESM(require_data(), 1); | |
| 10671 | - var import_editor11 = __toESM(require_editor(), 1); | |
| 10672 | - var import_preferences5 = __toESM(require_preferences(), 1); | |
| 10673 | - var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); | |
| 10674 | - var { PreferenceBaseOption: PreferenceBaseOption2 } = unlock2(import_preferences5.privateApis); | |
| 11004 | + var import_data18 = __toESM(require_data(), 1); | |
| 11005 | + var import_editor13 = __toESM(require_editor(), 1); | |
| 11006 | + var import_preferences6 = __toESM(require_preferences(), 1); | |
| 11007 | + var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); | |
| 11008 | + var { PreferenceBaseOption: PreferenceBaseOption2 } = unlock2(import_preferences6.privateApis); | |
| 10675 | 11009 | function EnablePanelOption(props) { |
| 10676 | - const { toggleEditorPanelEnabled: toggleEditorPanelEnabled2 } = (0, import_data16.useDispatch)(import_editor11.store); | |
| 10677 | - const { isChecked, isRemoved } = (0, import_data16.useSelect)( | |
| 11010 | + const { toggleEditorPanelEnabled: toggleEditorPanelEnabled2 } = (0, import_data18.useDispatch)(import_editor13.store); | |
| 11011 | + const { isChecked, isRemoved } = (0, import_data18.useSelect)( | |
| 10678 | 11012 | (select3) => { |
| 10679 | - const { isEditorPanelEnabled: isEditorPanelEnabled2, isEditorPanelRemoved: isEditorPanelRemoved2 } = select3(import_editor11.store); | |
| 11013 | + const { isEditorPanelEnabled: isEditorPanelEnabled2, isEditorPanelRemoved: isEditorPanelRemoved2 } = select3(import_editor13.store); | |
| 10680 | 11014 | return { |
| 10681 | 11015 | isChecked: isEditorPanelEnabled2(props.panelName), |
| 10682 | 11016 | isRemoved: isEditorPanelRemoved2(props.panelName) |
| 10683 | 11017 | }; |
| @@ -10686,9 +11020,9 @@ | ||
| 10686 | 11020 | ); |
| 10687 | 11021 | if (isRemoved) { |
| 10688 | 11022 | return null; |
| 10689 | 11023 | } |
| 10690 | - return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( | |
| 11024 | + return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 10691 | 11025 | PreferenceBaseOption2, |
| 10692 | 11026 | { |
| 10693 | 11027 | isChecked, |
| 10694 | 11028 | onChange: () => toggleEditorPanelEnabled2(props.panelName), |
| @@ -10697,13 +11031,13 @@ | ||
| 10697 | 11031 | ); |
| 10698 | 11032 | } |
| 10699 | 11033 | |
| 10700 | 11034 | // packages/edit-post/build-module/components/preferences-modal/meta-boxes-section.mjs |
| 10701 | - var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); | |
| 10702 | - var { PreferencesModalSection } = unlock2(import_preferences6.privateApis); | |
| 11035 | + var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); | |
| 11036 | + var { PreferencesModalSection } = unlock2(import_preferences7.privateApis); | |
| 10703 | 11037 | function MetaBoxesSection(sectionProps) { |
| 10704 | - const { areCustomFieldsRegistered, metaBoxes: metaBoxes2 } = (0, import_data17.useSelect)((select3) => { | |
| 10705 | - const { getEditorSettings } = select3(import_editor12.store); | |
| 11038 | + const { areCustomFieldsRegistered, metaBoxes: metaBoxes2 } = (0, import_data19.useSelect)((select3) => { | |
| 11039 | + const { getEditorSettings } = select3(import_editor14.store); | |
| 10706 | 11040 | const { getAllMetaBoxes: getAllMetaBoxes2 } = select3(store); |
| 10707 | 11041 | return { |
| 10708 | 11042 | areCustomFieldsRegistered: getEditorSettings().enableCustomFields !== void 0, |
| 10709 | 11043 | metaBoxes: getAllMetaBoxes2() |
| @@ -10714,11 +11048,11 @@ | ||
| 10714 | 11048 | ); |
| 10715 | 11049 | if (!areCustomFieldsRegistered && thirdPartyMetaBoxes.length === 0) { |
| 10716 | 11050 | return null; |
| 10717 | 11051 | } |
| 10718 | - return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(PreferencesModalSection, { ...sectionProps, children: [ | |
| 10719 | - areCustomFieldsRegistered && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EnableCustomFieldsOption, { label: (0, import_i18n8.__)("Custom fields") }), | |
| 10720 | - thirdPartyMetaBoxes.map(({ id, title }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 11052 | + return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(PreferencesModalSection, { ...sectionProps, children: [ | |
| 11053 | + areCustomFieldsRegistered && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EnableCustomFieldsOption, { label: (0, import_i18n9.__)("Custom fields") }), | |
| 11054 | + thirdPartyMetaBoxes.map(({ id, title }) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( | |
| 10721 | 11055 | EnablePanelOption, |
| 10722 | 11056 | { |
| 10723 | 11057 | label: title, |
| 10724 | 11058 | panelName: `meta-box-${id}` |
| @@ -10728,70 +11062,70 @@ | ||
| 10728 | 11062 | ] }); |
| 10729 | 11063 | } |
| 10730 | 11064 | |
| 10731 | 11065 | // packages/edit-post/build-module/components/preferences-modal/index.mjs |
| 10732 | - var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); | |
| 10733 | - var { PreferenceToggleControl } = unlock2(import_preferences7.privateApis); | |
| 10734 | - var { PreferencesModal } = unlock2(import_editor13.privateApis); | |
| 11066 | + var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); | |
| 11067 | + var { PreferenceToggleControl } = unlock2(import_preferences8.privateApis); | |
| 11068 | + var { PreferencesModal } = unlock2(import_editor15.privateApis); | |
| 10735 | 11069 | function EditPostPreferencesModal() { |
| 10736 | 11070 | const extraSections = { |
| 10737 | - general: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(MetaBoxesSection, { title: (0, import_i18n9.__)("Advanced") }), | |
| 10738 | - appearance: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 11071 | + general: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(MetaBoxesSection, { title: (0, import_i18n10.__)("Advanced") }), | |
| 11072 | + appearance: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( | |
| 10739 | 11073 | PreferenceToggleControl, |
| 10740 | 11074 | { |
| 10741 | 11075 | scope: "core/edit-post", |
| 10742 | 11076 | featureName: "themeStyles", |
| 10743 | - help: (0, import_i18n9.__)("Make the editor look like your theme."), | |
| 10744 | - label: (0, import_i18n9.__)("Use theme styles") | |
| 11077 | + help: (0, import_i18n10.__)("Make the editor look like your theme."), | |
| 11078 | + label: (0, import_i18n10.__)("Use theme styles") | |
| 10745 | 11079 | } |
| 10746 | 11080 | ) |
| 10747 | 11081 | }; |
| 10748 | - return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(PreferencesModal, { extraSections }); | |
| 11082 | + return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(PreferencesModal, { extraSections }); | |
| 10749 | 11083 | } |
| 10750 | 11084 | |
| 10751 | 11085 | // packages/edit-post/build-module/components/more-menu/index.mjs |
| 10752 | - var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); | |
| 10753 | - var { ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock2(import_editor14.privateApis); | |
| 11086 | + var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); | |
| 11087 | + var { MoreMenuPreferenceItem, ToolsMoreMenuGroup, ViewMoreMenuGroup } = unlock2(import_editor16.privateApis); | |
| 10754 | 11088 | var MoreMenu = () => { |
| 10755 | 11089 | const isLargeViewport = (0, import_compose.useViewportMatch)("large"); |
| 10756 | - return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [ | |
| 10757 | - isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(ViewMoreMenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( | |
| 10758 | - import_preferences8.PreferenceToggleMenuItem, | |
| 11090 | + return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [ | |
| 11091 | + isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(ViewMoreMenuGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11092 | + MoreMenuPreferenceItem, | |
| 10759 | 11093 | { |
| 10760 | 11094 | scope: "core/edit-post", |
| 10761 | 11095 | name: "fullscreenMode", |
| 10762 | - label: (0, import_i18n10.__)("Fullscreen mode"), | |
| 10763 | - info: (0, import_i18n10.__)("Show and hide the admin user interface"), | |
| 10764 | - messageActivated: (0, import_i18n10.__)("Fullscreen mode activated."), | |
| 10765 | - messageDeactivated: (0, import_i18n10.__)( | |
| 11096 | + label: (0, import_i18n11.__)("Fullscreen mode"), | |
| 11097 | + info: (0, import_i18n11.__)("Show and hide the admin user interface"), | |
| 11098 | + messageActivated: (0, import_i18n11.__)("Fullscreen mode activated."), | |
| 11099 | + messageDeactivated: (0, import_i18n11.__)( | |
| 10766 | 11100 | "Fullscreen mode deactivated." |
| 10767 | 11101 | ), |
| 10768 | - shortcut: import_keycodes.displayShortcut.secondary("f") | |
| 11102 | + shortcut: import_keycodes.keyboardShortcut.secondary("f") | |
| 10769 | 11103 | } |
| 10770 | 11104 | ) }), |
| 10771 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(ToolsMoreMenuGroup, { children: [ | |
| 10772 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(manage_patterns_menu_item_default, {}), | |
| 10773 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(WelcomeGuideMenuItem, {}) | |
| 11105 | + /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(ToolsMoreMenuGroup, { children: [ | |
| 11106 | + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(manage_patterns_menu_item_default, {}), | |
| 11107 | + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(WelcomeGuideMenuItem, {}) | |
| 10774 | 11108 | ] }), |
| 10775 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(EditPostPreferencesModal, {}) | |
| 11109 | + /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(EditPostPreferencesModal, {}) | |
| 10776 | 11110 | ] }); |
| 10777 | 11111 | }; |
| 10778 | 11112 | var more_menu_default = MoreMenu; |
| 10779 | 11113 | |
| 10780 | 11114 | // packages/edit-post/build-module/components/welcome-guide/index.mjs |
| 10781 | - var import_data20 = __toESM(require_data(), 1); | |
| 11115 | + var import_data22 = __toESM(require_data(), 1); | |
| 10782 | 11116 | |
| 10783 | 11117 | // packages/edit-post/build-module/components/welcome-guide/default.mjs |
| 10784 | - var import_data18 = __toESM(require_data(), 1); | |
| 10785 | - var import_components7 = __toESM(require_components(), 1); | |
| 10786 | - var import_i18n11 = __toESM(require_i18n(), 1); | |
| 10787 | - var import_element25 = __toESM(require_element(), 1); | |
| 11118 | + var import_data20 = __toESM(require_data(), 1); | |
| 11119 | + var import_components6 = __toESM(require_components(), 1); | |
| 11120 | + var import_i18n12 = __toESM(require_i18n(), 1); | |
| 11121 | + var import_element26 = __toESM(require_element(), 1); | |
| 10788 | 11122 | |
| 10789 | 11123 | // packages/edit-post/build-module/components/welcome-guide/image.mjs |
| 10790 | - var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); | |
| 11124 | + var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); | |
| 10791 | 11125 | function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { |
| 10792 | - return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [ | |
| 10793 | - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( | |
| 11126 | + return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)("picture", { className: "edit-post-welcome-guide__image", children: [ | |
| 11127 | + /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 10794 | 11128 | "source", |
| 10795 | 11129 | { |
| 10796 | 11130 | srcSet: nonAnimatedSrc, |
| 10797 | 11131 | media: "(prefers-reduced-motion: reduce)" |
| @@ -10796,26 +11130,26 @@ | ||
| 10796 | 11130 | srcSet: nonAnimatedSrc, |
| 10797 | 11131 | media: "(prefers-reduced-motion: reduce)" |
| 10798 | 11132 | } |
| 10799 | 11133 | ), |
| 10800 | - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) | |
| 11134 | + /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) | |
| 10801 | 11135 | ] }); |
| 10802 | 11136 | } |
| 10803 | 11137 | |
| 10804 | 11138 | // packages/edit-post/build-module/components/welcome-guide/default.mjs |
| 10805 | - var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); | |
| 11139 | + var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); | |
| 10806 | 11140 | function WelcomeGuideDefault() { |
| 10807 | - const { toggleFeature: toggleFeature2 } = (0, import_data18.useDispatch)(store); | |
| 10808 | - return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 10809 | - import_components7.Guide, | |
| 11141 | + const { toggleFeature: toggleFeature2 } = (0, import_data20.useDispatch)(store); | |
| 11142 | + return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 11143 | + import_components6.Guide, | |
| 10810 | 11144 | { |
| 10811 | 11145 | className: "edit-post-welcome-guide", |
| 10812 | - contentLabel: (0, import_i18n11.__)("Welcome to the editor"), | |
| 10813 | - finishButtonText: (0, import_i18n11.__)("Get started"), | |
| 11146 | + contentLabel: (0, import_i18n12.__)("Welcome to the editor"), | |
| 11147 | + finishButtonText: (0, import_i18n12.__)("Get started"), | |
| 10814 | 11148 | onFinish: () => toggleFeature2("welcomeGuide"), |
| 10815 | 11149 | pages: [ |
| 10816 | 11150 | { |
| 10817 | - image: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11151 | + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 10818 | 11152 | WelcomeGuideImage, |
| 10819 | 11153 | { |
| 10820 | 11154 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
| 10821 | 11155 | animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
| @@ -10820,17 +11154,17 @@ | ||
| 10820 | 11154 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", |
| 10821 | 11155 | animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" |
| 10822 | 11156 | } |
| 10823 | 11157 | ), |
| 10824 | - content: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [ | |
| 10825 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Welcome to the editor") }), | |
| 10826 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)( | |
| 11158 | + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [ | |
| 11159 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Welcome to the editor") }), | |
| 11160 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)( | |
| 10827 | 11161 | "In the WordPress editor, each paragraph, image, or video is presented as a distinct \u201Cblock\u201D of content." |
| 10828 | 11162 | ) }) |
| 10829 | 11163 | ] }) |
| 10830 | 11164 | }, |
| 10831 | 11165 | { |
| 10832 | - image: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11166 | + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 10833 | 11167 | WelcomeGuideImage, |
| 10834 | 11168 | { |
| 10835 | 11169 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", |
| 10836 | 11170 | animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
| @@ -10835,17 +11169,17 @@ | ||
| 10835 | 11169 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", |
| 10836 | 11170 | animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" |
| 10837 | 11171 | } |
| 10838 | 11172 | ), |
| 10839 | - content: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [ | |
| 10840 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Customize each block") }), | |
| 10841 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n11.__)( | |
| 11173 | + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [ | |
| 11174 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Customize each block") }), | |
| 11175 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)( | |
| 10842 | 11176 | "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected." |
| 10843 | 11177 | ) }) |
| 10844 | 11178 | ] }) |
| 10845 | 11179 | }, |
| 10846 | 11180 | { |
| 10847 | - image: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11181 | + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 10848 | 11182 | WelcomeGuideImage, |
| 10849 | 11183 | { |
| 10850 | 11184 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", |
| 10851 | 11185 | animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
| @@ -10850,19 +11184,19 @@ | ||
| 10850 | 11184 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", |
| 10851 | 11185 | animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" |
| 10852 | 11186 | } |
| 10853 | 11187 | ), |
| 10854 | - content: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [ | |
| 10855 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Explore all blocks") }), | |
| 10856 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element25.createInterpolateElement)( | |
| 10857 | - (0, import_i18n11.__)( | |
| 11188 | + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [ | |
| 11189 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Explore all blocks") }), | |
| 11190 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element26.createInterpolateElement)( | |
| 11191 | + (0, import_i18n12.__)( | |
| 10858 | 11192 | "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon." |
| 10859 | 11193 | ), |
| 10860 | 11194 | { |
| 10861 | - InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11195 | + InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 10862 | 11196 | "img", |
| 10863 | 11197 | { |
| 10864 | - alt: (0, import_i18n11.__)("inserter"), | |
| 11198 | + alt: (0, import_i18n12.__)("inserter"), | |
| 10865 | 11199 | src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" |
| 10866 | 11200 | } |
| 10867 | 11201 | ) |
| 10868 | 11202 | } |
| @@ -10869,9 +11203,9 @@ | ||
| 10869 | 11203 | ) }) |
| 10870 | 11204 | ] }) |
| 10871 | 11205 | }, |
| 10872 | 11206 | { |
| 10873 | - image: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 11207 | + image: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 10874 | 11208 | WelcomeGuideImage, |
| 10875 | 11209 | { |
| 10876 | 11210 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", |
| 10877 | 11211 | animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
| @@ -10876,19 +11210,19 @@ | ||
| 10876 | 11210 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", |
| 10877 | 11211 | animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" |
| 10878 | 11212 | } |
| 10879 | 11213 | ), |
| 10880 | - content: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_jsx_runtime36.Fragment, { children: [ | |
| 10881 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n11.__)("Learn more") }), | |
| 10882 | - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element25.createInterpolateElement)( | |
| 10883 | - (0, import_i18n11.__)( | |
| 11214 | + content: /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_jsx_runtime38.Fragment, { children: [ | |
| 11215 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Learn more") }), | |
| 11216 | + /* @__PURE__ */ (0, import_jsx_runtime38.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_element26.createInterpolateElement)( | |
| 11217 | + (0, import_i18n12.__)( | |
| 10884 | 11218 | "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>" |
| 10885 | 11219 | ), |
| 10886 | 11220 | { |
| 10887 | - a: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 10888 | - import_components7.ExternalLink, | |
| 11221 | + a: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 11222 | + import_components6.ExternalLink, | |
| 10889 | 11223 | { |
| 10890 | - href: (0, import_i18n11.__)( | |
| 11224 | + href: (0, import_i18n12.__)( | |
| 10891 | 11225 | "https://wordpress.org/documentation/article/wordpress-block-editor/" |
| 10892 | 11226 | ) |
| 10893 | 11227 | } |
| 10894 | 11228 | ) |
| @@ -10901,24 +11235,24 @@ | ||
| 10901 | 11235 | ); |
| 10902 | 11236 | } |
| 10903 | 11237 | |
| 10904 | 11238 | // packages/edit-post/build-module/components/welcome-guide/template.mjs |
| 10905 | - var import_data19 = __toESM(require_data(), 1); | |
| 10906 | - var import_components8 = __toESM(require_components(), 1); | |
| 10907 | - var import_i18n12 = __toESM(require_i18n(), 1); | |
| 10908 | - var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); | |
| 11239 | + var import_data21 = __toESM(require_data(), 1); | |
| 11240 | + var import_components7 = __toESM(require_components(), 1); | |
| 11241 | + var import_i18n13 = __toESM(require_i18n(), 1); | |
| 11242 | + var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); | |
| 10909 | 11243 | function WelcomeGuideTemplate() { |
| 10910 | - const { toggleFeature: toggleFeature2 } = (0, import_data19.useDispatch)(store); | |
| 10911 | - return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 10912 | - import_components8.Guide, | |
| 11244 | + const { toggleFeature: toggleFeature2 } = (0, import_data21.useDispatch)(store); | |
| 11245 | + return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( | |
| 11246 | + import_components7.Guide, | |
| 10913 | 11247 | { |
| 10914 | 11248 | className: "edit-template-welcome-guide", |
| 10915 | - contentLabel: (0, import_i18n12.__)("Welcome to the template editor"), | |
| 10916 | - finishButtonText: (0, import_i18n12.__)("Get started"), | |
| 11249 | + contentLabel: (0, import_i18n13.__)("Welcome to the template editor"), | |
| 11250 | + finishButtonText: (0, import_i18n13.__)("Get started"), | |
| 10917 | 11251 | onFinish: () => toggleFeature2("welcomeGuideTemplate"), |
| 10918 | 11252 | pages: [ |
| 10919 | 11253 | { |
| 10920 | - image: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 11254 | + image: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( | |
| 10921 | 11255 | WelcomeGuideImage, |
| 10922 | 11256 | { |
| 10923 | 11257 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", |
| 10924 | 11258 | animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" |
| @@ -10923,11 +11257,11 @@ | ||
| 10923 | 11257 | nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.svg", |
| 10924 | 11258 | animatedSrc: "https://s.w.org/images/block-editor/welcome-template-editor.gif" |
| 10925 | 11259 | } |
| 10926 | 11260 | ), |
| 10927 | - content: /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [ | |
| 10928 | - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n12.__)("Welcome to the template editor") }), | |
| 10929 | - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n12.__)( | |
| 11261 | + content: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [ | |
| 11262 | + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("h1", { className: "edit-post-welcome-guide__heading", children: (0, import_i18n13.__)("Welcome to the template editor") }), | |
| 11263 | + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("p", { className: "edit-post-welcome-guide__text", children: (0, import_i18n13.__)( | |
| 10930 | 11264 | "Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor." |
| 10931 | 11265 | ) }) |
| 10932 | 11266 | ] }) |
| 10933 | 11267 | } |
| @@ -10936,11 +11270,11 @@ | ||
| 10936 | 11270 | ); |
| 10937 | 11271 | } |
| 10938 | 11272 | |
| 10939 | 11273 | // packages/edit-post/build-module/components/welcome-guide/index.mjs |
| 10940 | - var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); | |
| 11274 | + var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); | |
| 10941 | 11275 | function WelcomeGuide({ postType }) { |
| 10942 | - const { isActive, isEditingTemplate: isEditingTemplate2 } = (0, import_data20.useSelect)( | |
| 11276 | + const { isActive, isEditingTemplate: isEditingTemplate2 } = (0, import_data22.useSelect)( | |
| 10943 | 11277 | (select3) => { |
| 10944 | 11278 | const { isFeatureActive: isFeatureActive2 } = select3(store); |
| 10945 | 11279 | const _isEditingTemplate = postType === "wp_template"; |
| 10946 | 11280 | const feature = _isEditingTemplate ? "welcomeGuideTemplate" : "welcomeGuide"; |
| @@ -10953,29 +11287,29 @@ | ||
| 10953 | 11287 | ); |
| 10954 | 11288 | if (!isActive) { |
| 10955 | 11289 | return null; |
| 10956 | 11290 | } |
| 10957 | - return isEditingTemplate2 ? /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WelcomeGuideTemplate, {}) : /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(WelcomeGuideDefault, {}); | |
| 11291 | + return isEditingTemplate2 ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(WelcomeGuideTemplate, {}) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(WelcomeGuideDefault, {}); | |
| 10958 | 11292 | } |
| 10959 | 11293 | |
| 10960 | 11294 | // packages/edit-post/build-module/commands/use-commands.mjs |
| 10961 | - var import_data21 = __toESM(require_data(), 1); | |
| 10962 | - var import_i18n13 = __toESM(require_i18n(), 1); | |
| 11295 | + var import_data23 = __toESM(require_data(), 1); | |
| 11296 | + var import_i18n14 = __toESM(require_i18n(), 1); | |
| 10963 | 11297 | var import_commands = __toESM(require_commands(), 1); |
| 10964 | 11298 | var import_preferences9 = __toESM(require_preferences(), 1); |
| 10965 | 11299 | var import_notices2 = __toESM(require_notices(), 1); |
| 10966 | 11300 | function useCommands() { |
| 10967 | - const { isFullscreen } = (0, import_data21.useSelect)((select3) => { | |
| 11301 | + const { isFullscreen } = (0, import_data23.useSelect)((select3) => { | |
| 10968 | 11302 | const { get } = select3(import_preferences9.store); |
| 10969 | 11303 | return { |
| 10970 | 11304 | isFullscreen: get("core/edit-post", "fullscreenMode") |
| 10971 | 11305 | }; |
| 10972 | 11306 | }, []); |
| 10973 | - const { toggle } = (0, import_data21.useDispatch)(import_preferences9.store); | |
| 10974 | - const { createInfoNotice } = (0, import_data21.useDispatch)(import_notices2.store); | |
| 11307 | + const { toggle } = (0, import_data23.useDispatch)(import_preferences9.store); | |
| 11308 | + const { createInfoNotice } = (0, import_data23.useDispatch)(import_notices2.store); | |
| 10975 | 11309 | (0, import_commands.useCommand)({ |
| 10976 | 11310 | name: "core/toggle-fullscreen-mode", |
| 10977 | - label: isFullscreen ? (0, import_i18n13.__)("Exit fullscreen") : (0, import_i18n13.__)("Enter fullscreen"), | |
| 11311 | + label: isFullscreen ? (0, import_i18n14.__)("Exit fullscreen") : (0, import_i18n14.__)("Enter fullscreen"), | |
| 10978 | 11312 | icon: fullscreen_default, |
| 10979 | 11313 | category: "command", |
| 10980 | 11314 | callback: ({ close }) => { |
| 10981 | 11315 | toggle("core/edit-post", "fullscreenMode"); |
| @@ -10980,15 +11314,15 @@ | ||
| 10980 | 11314 | callback: ({ close }) => { |
| 10981 | 11315 | toggle("core/edit-post", "fullscreenMode"); |
| 10982 | 11316 | close(); |
| 10983 | 11317 | createInfoNotice( |
| 10984 | - isFullscreen ? (0, import_i18n13.__)("Fullscreen off.") : (0, import_i18n13.__)("Fullscreen on."), | |
| 11318 | + isFullscreen ? (0, import_i18n14.__)("Fullscreen off.") : (0, import_i18n14.__)("Fullscreen on."), | |
| 10985 | 11319 | { |
| 10986 | 11320 | id: "core/edit-post/toggle-fullscreen-mode/notice", |
| 10987 | 11321 | type: "snackbar", |
| 10988 | 11322 | actions: [ |
| 10989 | 11323 | { |
| 10990 | - label: (0, import_i18n13.__)("Undo"), | |
| 11324 | + label: (0, import_i18n14.__)("Undo"), | |
| 10991 | 11325 | onClick: () => { |
| 10992 | 11326 | toggle("core/edit-post", "fullscreenMode"); |
| 10993 | 11327 | } |
| 10994 | 11328 | } |
| @@ -10999,15 +11333,15 @@ | ||
| 10999 | 11333 | }); |
| 11000 | 11334 | } |
| 11001 | 11335 | |
| 11002 | 11336 | // packages/edit-post/build-module/hooks/use-navigate-to-entity-record.mjs |
| 11003 | - var import_element26 = __toESM(require_element(), 1); | |
| 11004 | - var import_data22 = __toESM(require_data(), 1); | |
| 11005 | - var import_editor15 = __toESM(require_editor(), 1); | |
| 11006 | - var import_core_data6 = __toESM(require_core_data(), 1); | |
| 11337 | + var import_element27 = __toESM(require_element(), 1); | |
| 11338 | + var import_data24 = __toESM(require_data(), 1); | |
| 11339 | + var import_editor17 = __toESM(require_editor(), 1); | |
| 11340 | + var import_core_data7 = __toESM(require_core_data(), 1); | |
| 11007 | 11341 | function useNavigateToEntityRecord(initialPostId, initialPostType, defaultRenderingMode) { |
| 11008 | - const registry = (0, import_data22.useRegistry)(); | |
| 11009 | - const [postHistory, dispatch2] = (0, import_element26.useReducer)( | |
| 11342 | + const registry = (0, import_data24.useRegistry)(); | |
| 11343 | + const [postHistory, dispatch2] = (0, import_element27.useReducer)( | |
| 11010 | 11344 | (historyState, { type, post: post2, previousRenderingMode: previousRenderingMode2, selectedBlockClientId }) => { |
| 11011 | 11345 | if (type === "push") { |
| 11012 | 11346 | const updatedHistory = [...historyState]; |
| 11013 | 11347 | const currentIndex = updatedHistory.length - 1; |
| @@ -11030,14 +11364,14 @@ | ||
| 11030 | 11364 | } |
| 11031 | 11365 | ] |
| 11032 | 11366 | ); |
| 11033 | 11367 | const { post, previousRenderingMode } = postHistory[postHistory.length - 1]; |
| 11034 | - const { getRenderingMode } = (0, import_data22.useSelect)(import_editor15.store); | |
| 11035 | - const { setRenderingMode } = (0, import_data22.useDispatch)(import_editor15.store); | |
| 11036 | - const { editEntityRecord } = (0, import_data22.useDispatch)(import_core_data6.store); | |
| 11037 | - const onNavigateToEntityRecord = (0, import_element26.useCallback)( | |
| 11368 | + const { getRenderingMode } = (0, import_data24.useSelect)(import_editor17.store); | |
| 11369 | + const { setRenderingMode } = (0, import_data24.useDispatch)(import_editor17.store); | |
| 11370 | + const { editEntityRecord } = (0, import_data24.useDispatch)(import_core_data7.store); | |
| 11371 | + const onNavigateToEntityRecord = (0, import_element27.useCallback)( | |
| 11038 | 11372 | (params) => { |
| 11039 | - const entityEdits = registry.select(import_core_data6.store).getEntityRecordEdits("postType", post.postType, post.postId); | |
| 11373 | + const entityEdits = registry.select(import_core_data7.store).getEntityRecordEdits("postType", post.postType, post.postId); | |
| 11040 | 11374 | const externalClientId = entityEdits?.selection?.selectionStart?.clientId ?? null; |
| 11041 | 11375 | dispatch2({ |
| 11042 | 11376 | type: "push", |
| 11043 | 11377 | post: { postId: params.postId, postType: params.postType }, |
| @@ -11055,9 +11389,9 @@ | ||
| 11055 | 11389 | setRenderingMode, |
| 11056 | 11390 | defaultRenderingMode |
| 11057 | 11391 | ] |
| 11058 | 11392 | ); |
| 11059 | - const onNavigateToPreviousEntityRecord = (0, import_element26.useCallback)(() => { | |
| 11393 | + const onNavigateToPreviousEntityRecord = (0, import_element27.useCallback)(() => { | |
| 11060 | 11394 | if (postHistory.length > 1) { |
| 11061 | 11395 | const previousItem = postHistory[postHistory.length - 2]; |
| 11062 | 11396 | if (previousItem.selectedBlockClientId) { |
| 11063 | 11397 | editEntityRecord( |
| @@ -11097,12 +11431,12 @@ | ||
| 11097 | 11431 | }; |
| 11098 | 11432 | } |
| 11099 | 11433 | |
| 11100 | 11434 | // packages/edit-post/build-module/components/meta-boxes/use-meta-box-initialization.mjs |
| 11101 | - var import_data23 = __toESM(require_data(), 1); | |
| 11102 | - var import_editor16 = __toESM(require_editor(), 1); | |
| 11103 | - var import_core_data7 = __toESM(require_core_data(), 1); | |
| 11104 | - var import_element27 = __toESM(require_element(), 1); | |
| 11435 | + var import_data25 = __toESM(require_data(), 1); | |
| 11436 | + var import_editor18 = __toESM(require_editor(), 1); | |
| 11437 | + var import_core_data8 = __toESM(require_core_data(), 1); | |
| 11438 | + var import_element28 = __toESM(require_element(), 1); | |
| 11105 | 11439 | var useMetaBoxInitialization = (enabled) => { |
| 11106 | 11440 | const { |
| 11107 | 11441 | isEnabledAndEditorReady, |
| 11108 | 11442 | isCollaborationEnabled, |
| @@ -11107,14 +11441,14 @@ | ||
| 11107 | 11441 | isEnabledAndEditorReady, |
| 11108 | 11442 | isCollaborationEnabled, |
| 11109 | 11443 | hasIncompatibleMetaBoxes, |
| 11110 | 11444 | hasActiveMetaBoxes |
| 11111 | - } = (0, import_data23.useSelect)( | |
| 11445 | + } = (0, import_data25.useSelect)( | |
| 11112 | 11446 | (select3) => { |
| 11113 | 11447 | const { |
| 11114 | 11448 | __unstableIsEditorReady, |
| 11115 | 11449 | isCollaborationEnabledForCurrentPost |
| 11116 | - } = unlock2(select3(import_editor16.store)); | |
| 11450 | + } = unlock2(select3(import_editor18.store)); | |
| 11117 | 11451 | return { |
| 11118 | 11452 | isEnabledAndEditorReady: enabled && __unstableIsEditorReady(), |
| 11119 | 11453 | isCollaborationEnabled: isCollaborationEnabledForCurrentPost(), |
| 11120 | 11454 | hasIncompatibleMetaBoxes: enabled ? select3(store).getAllMetaBoxes().some((metaBox) => !metaBox.__rtc_compatible) : false, |
| @@ -11122,12 +11456,12 @@ | ||
| 11122 | 11456 | }; |
| 11123 | 11457 | }, |
| 11124 | 11458 | [enabled] |
| 11125 | 11459 | ); |
| 11126 | - const { setCollaborationSupported } = unlock2((0, import_data23.useDispatch)(import_core_data7.store)); | |
| 11127 | - const { updateEditorSettings } = (0, import_data23.useDispatch)(import_editor16.store); | |
| 11128 | - const { initializeMetaBoxes: initializeMetaBoxes2 } = (0, import_data23.useDispatch)(store); | |
| 11129 | - (0, import_element27.useEffect)(() => { | |
| 11460 | + const { setCollaborationSupported } = unlock2((0, import_data25.useDispatch)(import_core_data8.store)); | |
| 11461 | + const { updateEditorSettings } = (0, import_data25.useDispatch)(import_editor18.store); | |
| 11462 | + const { initializeMetaBoxes: initializeMetaBoxes2 } = (0, import_data25.useDispatch)(store); | |
| 11463 | + (0, import_element28.useEffect)(() => { | |
| 11130 | 11464 | if (isEnabledAndEditorReady) { |
| 11131 | 11465 | initializeMetaBoxes2(); |
| 11132 | 11466 | if (isCollaborationEnabled && hasIncompatibleMetaBoxes) { |
| 11133 | 11467 | setCollaborationSupported(false); |
| @@ -11147,13 +11481,12 @@ | ||
| 11147 | 11481 | ]); |
| 11148 | 11482 | }; |
| 11149 | 11483 | |
| 11150 | 11484 | // packages/edit-post/build-module/components/layout/index.mjs |
| 11151 | - var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); | |
| 11485 | + var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); | |
| 11152 | 11486 | var { useCommandContext } = unlock2(import_commands2.privateApis); |
| 11153 | - var { useDrag } = unlock2(import_components9.privateApis); | |
| 11154 | - var { Editor, FullscreenMode, UploadProgressSnackbar } = unlock2(import_editor17.privateApis); | |
| 11155 | - var { BlockKeyboardShortcuts } = unlock2(import_block_library.privateApis); | |
| 11487 | + var { useDrag } = unlock2(import_components8.privateApis); | |
| 11488 | + var { Editor, FullscreenMode, UploadProgressSnackbar } = unlock2(import_editor19.privateApis); | |
| 11156 | 11489 | var DESIGN_POST_TYPES = [ |
| 11157 | 11490 | "wp_template", |
| 11158 | 11491 | "wp_template_part", |
| 11159 | 11492 | "wp_block", |
| @@ -11159,14 +11492,14 @@ | ||
| 11159 | 11492 | "wp_block", |
| 11160 | 11493 | "wp_navigation" |
| 11161 | 11494 | ]; |
| 11162 | 11495 | function useEditorStyles(settings) { |
| 11163 | - const { hasThemeStyleSupport } = (0, import_data24.useSelect)((select3) => { | |
| 11496 | + const { hasThemeStyleSupport } = (0, import_data26.useSelect)((select3) => { | |
| 11164 | 11497 | return { |
| 11165 | 11498 | hasThemeStyleSupport: select3(store).isFeatureActive("themeStyles") |
| 11166 | 11499 | }; |
| 11167 | 11500 | }, []); |
| 11168 | - return (0, import_element28.useMemo)(() => { | |
| 11501 | + return (0, import_element29.useMemo)(() => { | |
| 11169 | 11502 | const presetStyles = settings.styles?.filter( |
| 11170 | 11503 | (style) => style.__unstableType && style.__unstableType !== "theme" |
| 11171 | 11504 | ) ?? []; |
| 11172 | 11505 | const defaultEditorStyles = [ |
| @@ -11193,9 +11526,9 @@ | ||
| 11193 | 11526 | hasThemeStyleSupport |
| 11194 | 11527 | ]); |
| 11195 | 11528 | } |
| 11196 | 11529 | function MetaBoxesMain() { |
| 11197 | - const [isOpen, openHeight, hasAnyVisible] = (0, import_data24.useSelect)((select3) => { | |
| 11530 | + const [isOpen, openHeight, hasAnyVisible] = (0, import_data26.useSelect)((select3) => { | |
| 11198 | 11531 | const { get } = select3(import_preferences10.store); |
| 11199 | 11532 | const { isMetaBoxLocationVisible: isMetaBoxLocationVisible2 } = select3(store); |
| 11200 | 11533 | return [ |
| 11201 | 11534 | !!get("core/edit-post", "metaBoxesMainIsOpen"), |
| @@ -11202,11 +11535,11 @@ | ||
| 11202 | 11535 | get("core/edit-post", "metaBoxesMainOpenHeight"), |
| 11203 | 11536 | isMetaBoxLocationVisible2("normal") || isMetaBoxLocationVisible2("advanced") || isMetaBoxLocationVisible2("side") |
| 11204 | 11537 | ]; |
| 11205 | 11538 | }, []); |
| 11206 | - const { set: setPreference } = (0, import_data24.useDispatch)(import_preferences10.store); | |
| 11539 | + const { set: setPreference } = (0, import_data26.useDispatch)(import_preferences10.store); | |
| 11207 | 11540 | const isShort = (0, import_compose2.useMediaQuery)("(max-height: 549px)"); |
| 11208 | - const [{ min: min2 = 0, max: max2 }, setHeightConstraints] = (0, import_element28.useState)(() => ({})); | |
| 11541 | + const [{ min: min2 = 0, max: max2 }, setHeightConstraints] = (0, import_element29.useState)(() => ({})); | |
| 11209 | 11542 | const effectSizeConstraints = (0, import_compose2.useRefEffect)((node) => { |
| 11210 | 11543 | const container = node.closest( |
| 11211 | 11544 | ".interface-interface-skeleton__content" |
| 11212 | 11545 | ); |
| @@ -11232,16 +11565,16 @@ | ||
| 11232 | 11565 | observer.observe(noticeContainer); |
| 11233 | 11566 | } |
| 11234 | 11567 | return () => observer.disconnect(); |
| 11235 | 11568 | }, []); |
| 11236 | - const metaBoxesMainRef = (0, import_element28.useRef)(); | |
| 11569 | + const metaBoxesMainRef = (0, import_element29.useRef)(); | |
| 11237 | 11570 | const setMainRefs = (0, import_compose2.useMergeRefs)([ |
| 11238 | 11571 | metaBoxesMainRef, |
| 11239 | 11572 | effectSizeConstraints |
| 11240 | 11573 | ]); |
| 11241 | - const separatorRef = (0, import_element28.useRef)(); | |
| 11242 | - const separatorHelpId = (0, import_element28.useId)(); | |
| 11243 | - const heightRef = (0, import_element28.useRef)(); | |
| 11574 | + const separatorRef = (0, import_element29.useRef)(); | |
| 11575 | + const separatorHelpId = (0, import_element29.useId)(); | |
| 11576 | + const heightRef = (0, import_element29.useRef)(); | |
| 11244 | 11577 | const getAriaValueNow = (height) => Math.round((height - min2) / (max2 - min2) * 100); |
| 11245 | 11578 | const persistIsOpen = (to = !isOpen) => setPreference("core/edit-post", "metaBoxesMainIsOpen", to); |
| 11246 | 11579 | const applyHeight = (candidateHeight = "auto", isPersistent) => { |
| 11247 | 11580 | let styleHeight; |
| @@ -11301,16 +11634,16 @@ | ||
| 11301 | 11634 | ); |
| 11302 | 11635 | if (!hasAnyVisible) { |
| 11303 | 11636 | return; |
| 11304 | 11637 | } |
| 11305 | - const contents = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( | |
| 11638 | + const contents = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( | |
| 11306 | 11639 | "div", |
| 11307 | 11640 | { |
| 11308 | 11641 | className: "edit-post-layout__metaboxes edit-post-meta-boxes-main__liner", |
| 11309 | 11642 | hidden: !isOpen, |
| 11310 | 11643 | children: [ |
| 11311 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MetaBoxes, { location: "normal" }), | |
| 11312 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MetaBoxes, { location: "advanced" }) | |
| 11644 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "normal" }), | |
| 11645 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "advanced" }) | |
| 11313 | 11646 | ] |
| 11314 | 11647 | } |
| 11315 | 11648 | ); |
| 11316 | 11649 | const isAutoHeight = openHeight === void 0; |
| @@ -11316,10 +11649,10 @@ | ||
| 11316 | 11649 | const isAutoHeight = openHeight === void 0; |
| 11317 | 11650 | const usedOpenHeight = isShort ? "auto" : openHeight; |
| 11318 | 11651 | const usedHeight = isOpen ? usedOpenHeight : min2; |
| 11319 | 11652 | const usedAriaValueNow = max2 === void 0 || isAutoHeight ? 50 : getAriaValueNow(usedHeight); |
| 11320 | - const paneLabel = (0, import_i18n14.__)("Meta Boxes"); | |
| 11321 | - const toggle = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( | |
| 11653 | + const paneLabel = (0, import_i18n15.__)("Meta Boxes"); | |
| 11654 | + const toggle = /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( | |
| 11322 | 11655 | "button", |
| 11323 | 11656 | { |
| 11324 | 11657 | "aria-expanded": isOpen, |
| 11325 | 11658 | onClick: ({ detail }) => { |
| @@ -11329,24 +11662,24 @@ | ||
| 11329 | 11662 | }, |
| 11330 | 11663 | ...!isShort && bindDragGesture(persistIsOpen), |
| 11331 | 11664 | children: [ |
| 11332 | 11665 | paneLabel, |
| 11333 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components9.Icon, { icon: isOpen ? chevron_up_default : chevron_down_default }) | |
| 11666 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components8.Icon, { icon: isOpen ? chevron_up_default : chevron_down_default }) | |
| 11334 | 11667 | ] |
| 11335 | 11668 | } |
| 11336 | 11669 | ); |
| 11337 | - const separator = !isShort && /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_jsx_runtime39.Fragment, { children: [ | |
| 11338 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(tooltip_exports.Root, { children: [ | |
| 11339 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( | |
| 11670 | + const separator = !isShort && /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [ | |
| 11671 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(tooltip_exports.Root, { children: [ | |
| 11672 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( | |
| 11340 | 11673 | tooltip_exports.Trigger, |
| 11341 | 11674 | { |
| 11342 | - render: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( | |
| 11675 | + render: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( | |
| 11343 | 11676 | "button", |
| 11344 | 11677 | { |
| 11345 | 11678 | ref: separatorRef, |
| 11346 | 11679 | role: "separator", |
| 11347 | 11680 | "aria-valuenow": usedAriaValueNow, |
| 11348 | - "aria-label": (0, import_i18n14.__)("Drag to resize"), | |
| 11681 | + "aria-label": (0, import_i18n15.__)("Drag to resize"), | |
| 11349 | 11682 | "aria-describedby": separatorHelpId, |
| 11350 | 11683 | ...bindDragGesture() |
| 11351 | 11684 | } |
| 11352 | 11685 | ) |
| @@ -11351,15 +11684,15 @@ | ||
| 11351 | 11684 | } |
| 11352 | 11685 | ) |
| 11353 | 11686 | } |
| 11354 | 11687 | ), |
| 11355 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(tooltip_exports.Popup, { children: (0, import_i18n14.__)("Drag to resize") }) | |
| 11688 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(tooltip_exports.Popup, { children: (0, import_i18n15.__)("Drag to resize") }) | |
| 11356 | 11689 | ] }), |
| 11357 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(VisuallyHidden, { id: separatorHelpId, children: (0, import_i18n14.__)( | |
| 11690 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(VisuallyHidden, { id: separatorHelpId, children: (0, import_i18n15.__)( | |
| 11358 | 11691 | "Use up and down arrow keys to resize the meta box pane." |
| 11359 | 11692 | ) }) |
| 11360 | 11693 | ] }); |
| 11361 | - return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( | |
| 11694 | + return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( | |
| 11362 | 11695 | navigable_region_default, |
| 11363 | 11696 | { |
| 11364 | 11697 | ariaLabel: paneLabel, |
| 11365 | 11698 | ref: setMainRefs, |
| @@ -11368,9 +11701,9 @@ | ||
| 11368 | 11701 | !isShort && "is-resizable" |
| 11369 | 11702 | ), |
| 11370 | 11703 | style: { height: usedHeight }, |
| 11371 | 11704 | children: [ |
| 11372 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)("div", { className: "edit-post-meta-boxes-main__presenter", children: [ | |
| 11705 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: "edit-post-meta-boxes-main__presenter", children: [ | |
| 11373 | 11706 | toggle, |
| 11374 | 11707 | separator |
| 11375 | 11708 | ] }), |
| 11376 | 11709 | contents |
| @@ -11384,9 +11717,9 @@ | ||
| 11384 | 11717 | settings, |
| 11385 | 11718 | initialEdits |
| 11386 | 11719 | }) { |
| 11387 | 11720 | useCommands(); |
| 11388 | - const { createErrorNotice } = (0, import_data24.useDispatch)(import_notices3.store); | |
| 11721 | + const { createErrorNotice } = (0, import_data26.useDispatch)(import_notices3.store); | |
| 11389 | 11722 | const { |
| 11390 | 11723 | currentPost: { postId: currentPostId, postType: currentPostType }, |
| 11391 | 11724 | onNavigateToEntityRecord, |
| 11392 | 11725 | onNavigateToPreviousEntityRecord |
| @@ -11406,14 +11739,14 @@ | ||
| 11406 | 11739 | isDistractionFree, |
| 11407 | 11740 | showMetaBoxes, |
| 11408 | 11741 | isWelcomeGuideVisible, |
| 11409 | 11742 | templateId |
| 11410 | - } = (0, import_data24.useSelect)( | |
| 11743 | + } = (0, import_data26.useSelect)( | |
| 11411 | 11744 | (select3) => { |
| 11412 | 11745 | const { get } = select3(import_preferences10.store); |
| 11413 | 11746 | const { isFeatureActive: isFeatureActive2, hasMetaBoxes: hasMetaBoxes2 } = select3(store); |
| 11414 | 11747 | const { canUser, getPostType, getTemplateId } = unlock2( |
| 11415 | - select3(import_core_data8.store) | |
| 11748 | + select3(import_core_data9.store) | |
| 11416 | 11749 | ); |
| 11417 | 11750 | const supportsTemplateMode = settings.supportsTemplateMode; |
| 11418 | 11751 | const isViewable = getPostType(currentPostType)?.viewable ?? false; |
| 11419 | 11752 | const canViewTemplate = canUser("read", { |
| @@ -11420,12 +11753,12 @@ | ||
| 11420 | 11753 | kind: "postType", |
| 11421 | 11754 | name: "wp_template" |
| 11422 | 11755 | }); |
| 11423 | 11756 | const { getBlockSelectionStart, isZoomOut } = unlock2( |
| 11424 | - select3(import_block_editor.store) | |
| 11757 | + select3(import_block_editor2.store) | |
| 11425 | 11758 | ); |
| 11426 | 11759 | const { getEditorMode: getEditorMode2, getDefaultRenderingMode } = unlock2( |
| 11427 | - select3(import_editor17.store) | |
| 11760 | + select3(import_editor19.store) | |
| 11428 | 11761 | ); |
| 11429 | 11762 | const isNotDesignPostType = !DESIGN_POST_TYPES.includes(currentPostType); |
| 11430 | 11763 | const isDirectlyEditingPattern = currentPostType === "wp_block" && !onNavigateToPreviousEntityRecord; |
| 11431 | 11764 | const _templateId = getTemplateId(currentPostType, currentPostId); |
| @@ -11454,9 +11787,9 @@ | ||
| 11454 | 11787 | useMetaBoxInitialization(hasActiveMetaboxes && hasResolvedMode); |
| 11455 | 11788 | const commandContext = hasBlockSelected ? "block-selection-edit" : "entity-edit"; |
| 11456 | 11789 | useCommandContext(commandContext); |
| 11457 | 11790 | const styles = useEditorStyles(settings); |
| 11458 | - const editorSettings = (0, import_element28.useMemo)( | |
| 11791 | + const editorSettings = (0, import_element29.useMemo)( | |
| 11459 | 11792 | () => ({ |
| 11460 | 11793 | ...settings, |
| 11461 | 11794 | styles, |
| 11462 | 11795 | onNavigateToEntityRecord, |
| @@ -11473,17 +11806,17 @@ | ||
| 11473 | 11806 | document.body.classList.add("show-icon-labels"); |
| 11474 | 11807 | } else { |
| 11475 | 11808 | document.body.classList.remove("show-icon-labels"); |
| 11476 | 11809 | } |
| 11477 | - const navigateRegionsProps = (0, import_components9.__unstableUseNavigateRegions)(); | |
| 11810 | + const navigateRegionsProps = (0, import_components8.__unstableUseNavigateRegions)(); | |
| 11478 | 11811 | const className = clsx_default("edit-post-layout", "is-mode-" + mode, { |
| 11479 | 11812 | "has-metaboxes": hasActiveMetaboxes |
| 11480 | 11813 | }); |
| 11481 | 11814 | function onPluginAreaError(name) { |
| 11482 | 11815 | createErrorNotice( |
| 11483 | - (0, import_i18n14.sprintf)( | |
| 11816 | + (0, import_i18n15.sprintf)( | |
| 11484 | 11817 | /* translators: %s: plugin name */ |
| 11485 | - (0, import_i18n14.__)( | |
| 11818 | + (0, import_i18n15.__)( | |
| 11486 | 11819 | 'The "%s" plugin has encountered an error and cannot be rendered.' |
| 11487 | 11820 | ), |
| 11488 | 11821 | name |
| 11489 | 11822 | ) |
| @@ -11488,15 +11821,15 @@ | ||
| 11488 | 11821 | name |
| 11489 | 11822 | ) |
| 11490 | 11823 | ); |
| 11491 | 11824 | } |
| 11492 | - const { createSuccessNotice } = (0, import_data24.useDispatch)(import_notices3.store); | |
| 11493 | - const onActionPerformed = (0, import_element28.useCallback)( | |
| 11825 | + const { createSuccessNotice } = (0, import_data26.useDispatch)(import_notices3.store); | |
| 11826 | + const onActionPerformed = (0, import_element29.useCallback)( | |
| 11494 | 11827 | (actionId, items) => { |
| 11495 | 11828 | switch (actionId) { |
| 11496 | 11829 | case "move-to-trash": |
| 11497 | 11830 | { |
| 11498 | - document.location.href = (0, import_url5.addQueryArgs)("edit.php", { | |
| 11831 | + document.location.href = (0, import_url6.addQueryArgs)("edit.php", { | |
| 11499 | 11832 | trashed: 1, |
| 11500 | 11833 | post_type: items[0].type, |
| 11501 | 11834 | ids: items[0].id |
| 11502 | 11835 | }); |
| @@ -11506,12 +11839,12 @@ | ||
| 11506 | 11839 | { |
| 11507 | 11840 | const newItem = items[0]; |
| 11508 | 11841 | const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; |
| 11509 | 11842 | createSuccessNotice( |
| 11510 | - (0, import_i18n14.sprintf)( | |
| 11843 | + (0, import_i18n15.sprintf)( | |
| 11511 | 11844 | // translators: %s: Title of the created post or template, e.g: "Hello world". |
| 11512 | - (0, import_i18n14.__)('"%s" successfully created.'), | |
| 11513 | - (0, import_html_entities.decodeEntities)(title) || (0, import_i18n14.__)("(no title)") | |
| 11845 | + (0, import_i18n15.__)('"%s" successfully created.'), | |
| 11846 | + (0, import_html_entities.decodeEntities)(title) || (0, import_i18n15.__)("(no title)") | |
| 11514 | 11847 | ), |
| 11515 | 11848 | { |
| 11516 | 11849 | type: "snackbar", |
| 11517 | 11850 | id: "duplicate-post-action", |
| @@ -11516,12 +11849,12 @@ | ||
| 11516 | 11849 | type: "snackbar", |
| 11517 | 11850 | id: "duplicate-post-action", |
| 11518 | 11851 | actions: [ |
| 11519 | 11852 | { |
| 11520 | - label: (0, import_i18n14.__)("Edit"), | |
| 11853 | + label: (0, import_i18n15.__)("Edit"), | |
| 11521 | 11854 | onClick: () => { |
| 11522 | 11855 | const postId = newItem.id; |
| 11523 | - document.location.href = (0, import_url5.addQueryArgs)("post.php", { | |
| 11856 | + document.location.href = (0, import_url6.addQueryArgs)("post.php", { | |
| 11524 | 11857 | post: postId, |
| 11525 | 11858 | action: "edit" |
| 11526 | 11859 | }); |
| 11527 | 11860 | } |
| @@ -11534,18 +11867,19 @@ | ||
| 11534 | 11867 | } |
| 11535 | 11868 | }, |
| 11536 | 11869 | [createSuccessNotice] |
| 11537 | 11870 | ); |
| 11538 | - const initialPost = (0, import_element28.useMemo)(() => { | |
| 11871 | + const initialPost = (0, import_element29.useMemo)(() => { | |
| 11539 | 11872 | return { |
| 11540 | 11873 | type: initialPostType, |
| 11541 | 11874 | id: initialPostId |
| 11542 | 11875 | }; |
| 11543 | 11876 | }, [initialPostType, initialPostId]); |
| 11544 | - const backButton = (0, import_compose2.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(back_button_default, { initialPost }) : null; | |
| 11545 | - return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components9.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(tooltip_exports.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_editor17.ErrorBoundary, { canCopyContent: true, children: [ | |
| 11546 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(WelcomeGuide, { postType: currentPostType }), | |
| 11547 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { ...navigateRegionsProps, children: /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( | |
| 11877 | + const backButton = (0, import_compose2.useViewportMatch)("medium") && isFullscreenActive ? /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(back_button_default, { initialPost }) : null; | |
| 11878 | + const adminPrimary = (0, import_element29.useMemo)(() => getAdminThemeColors().primary, []); | |
| 11879 | + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components8.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(tooltip_exports.Provider, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_theme.ThemeProvider, { isRoot: true, color: { primary: adminPrimary }, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_editor19.ErrorBoundary, { canCopyContent: true, children: [ | |
| 11880 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(WelcomeGuide, { postType: currentPostType }), | |
| 11881 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("div", { ...navigateRegionsProps, children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( | |
| 11548 | 11882 | Editor, |
| 11549 | 11883 | { |
| 11550 | 11884 | settings: editorSettings, |
| 11551 | 11885 | initialEdits, |
| @@ -11555,41 +11889,44 @@ | ||
| 11555 | 11889 | className, |
| 11556 | 11890 | forceIsDirty: hasActiveMetaboxes, |
| 11557 | 11891 | autoFocus: !isWelcomeGuideVisible, |
| 11558 | 11892 | onActionPerformed, |
| 11559 | - extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MetaBoxes, { location: "side" }), | |
| 11560 | - extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(MetaBoxesMain, {}), | |
| 11893 | + extraSidebarPanels: showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxes, { location: "side" }), | |
| 11894 | + extraContent: !isDistractionFree && showMetaBoxes && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(MetaBoxesMain, {}), | |
| 11561 | 11895 | children: [ |
| 11562 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor17.PostLockedModal, {}), | |
| 11563 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(EditorInitialization, {}), | |
| 11564 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(FullscreenMode, { isActive: isFullscreenActive }), | |
| 11565 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BrowserURL, {}), | |
| 11566 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor17.UnsavedChangesWarning, {}), | |
| 11567 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor17.AutosaveMonitor, {}), | |
| 11568 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor17.LocalAutosaveMonitor, {}), | |
| 11569 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(keyboard_shortcuts_default, {}), | |
| 11570 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_editor17.EditorKeyboardShortcutsRegister, {}), | |
| 11571 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(BlockKeyboardShortcuts, {}), | |
| 11572 | - currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(InitPatternModal, {}), | |
| 11573 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }), | |
| 11574 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(more_menu_default, {}), | |
| 11896 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.PostLockedModal, {}), | |
| 11897 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(EditorInitialization, {}), | |
| 11898 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( | |
| 11899 | + FullscreenMode, | |
| 11900 | + { | |
| 11901 | + isActive: isFullscreenActive | |
| 11902 | + } | |
| 11903 | + ), | |
| 11904 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(BrowserURL, {}), | |
| 11905 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.UnsavedChangesWarning, {}), | |
| 11906 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.AutosaveMonitor, {}), | |
| 11907 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_editor19.LocalAutosaveMonitor, {}), | |
| 11908 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(keyboard_shortcuts_default, {}), | |
| 11909 | + currentPostType === "wp_block" && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(InitPatternModal, {}), | |
| 11910 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_plugins.PluginArea, { onError: onPluginAreaError }), | |
| 11911 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(more_menu_default, {}), | |
| 11575 | 11912 | backButton, |
| 11576 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_notices3.SnackbarNotices, { className: "edit-post-layout__snackbar" }), | |
| 11577 | - /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(UploadProgressSnackbar, {}) | |
| 11913 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_notices3.SnackbarNotices, { className: "edit-post-layout__snackbar" }), | |
| 11914 | + /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(UploadProgressSnackbar, {}) | |
| 11578 | 11915 | ] |
| 11579 | 11916 | } |
| 11580 | 11917 | ) }) |
| 11581 | - ] }) }) }); | |
| 11918 | + ] }) }) }) }); | |
| 11582 | 11919 | } |
| 11583 | 11920 | var layout_default = Layout; |
| 11584 | 11921 | |
| 11585 | 11922 | // packages/edit-post/build-module/deprecated.mjs |
| 11586 | - var import_editor18 = __toESM(require_editor(), 1); | |
| 11587 | - var import_url6 = __toESM(require_url(), 1); | |
| 11923 | + var import_editor20 = __toESM(require_editor(), 1); | |
| 11924 | + var import_url7 = __toESM(require_url(), 1); | |
| 11588 | 11925 | var import_deprecated3 = __toESM(require_deprecated(), 1); |
| 11589 | - var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); | |
| 11590 | - var { PluginPostExcerpt } = unlock2(import_editor18.privateApis); | |
| 11591 | - var isSiteEditor = (0, import_url6.getPath)(window.location.href)?.includes( | |
| 11926 | + var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); | |
| 11927 | + var { PluginPostExcerpt } = unlock2(import_editor20.privateApis); | |
| 11928 | + var isSiteEditor = (0, import_url7.getPath)(window.location.href)?.includes( | |
| 11592 | 11929 | "site-editor.php" |
| 11593 | 11930 | ); |
| 11594 | 11931 | var deprecateSlot = (name) => { |
| 11595 | 11932 | (0, import_deprecated3.default)(`wp.editPost.${name}`, { |
| @@ -11601,9 +11938,9 @@ | ||
| 11601 | 11938 | if (isSiteEditor) { |
| 11602 | 11939 | return null; |
| 11603 | 11940 | } |
| 11604 | 11941 | deprecateSlot("PluginBlockSettingsMenuItem"); |
| 11605 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginBlockSettingsMenuItem, { ...props }); | |
| 11942 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginBlockSettingsMenuItem, { ...props }); | |
| 11606 | 11943 | } |
| 11607 | 11944 | function PluginDocumentSettingPanel(props) { |
| 11608 | 11945 | if (isSiteEditor) { |
| 11609 | 11946 | return null; |
| @@ -11608,9 +11945,9 @@ | ||
| 11608 | 11945 | if (isSiteEditor) { |
| 11609 | 11946 | return null; |
| 11610 | 11947 | } |
| 11611 | 11948 | deprecateSlot("PluginDocumentSettingPanel"); |
| 11612 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginDocumentSettingPanel, { ...props }); | |
| 11949 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginDocumentSettingPanel, { ...props }); | |
| 11613 | 11950 | } |
| 11614 | 11951 | function PluginMoreMenuItem(props) { |
| 11615 | 11952 | if (isSiteEditor) { |
| 11616 | 11953 | return null; |
| @@ -11615,9 +11952,9 @@ | ||
| 11615 | 11952 | if (isSiteEditor) { |
| 11616 | 11953 | return null; |
| 11617 | 11954 | } |
| 11618 | 11955 | deprecateSlot("PluginMoreMenuItem"); |
| 11619 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginMoreMenuItem, { ...props }); | |
| 11956 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginMoreMenuItem, { ...props }); | |
| 11620 | 11957 | } |
| 11621 | 11958 | function PluginPrePublishPanel(props) { |
| 11622 | 11959 | if (isSiteEditor) { |
| 11623 | 11960 | return null; |
| @@ -11622,9 +11959,9 @@ | ||
| 11622 | 11959 | if (isSiteEditor) { |
| 11623 | 11960 | return null; |
| 11624 | 11961 | } |
| 11625 | 11962 | deprecateSlot("PluginPrePublishPanel"); |
| 11626 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginPrePublishPanel, { ...props }); | |
| 11963 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPrePublishPanel, { ...props }); | |
| 11627 | 11964 | } |
| 11628 | 11965 | function PluginPostPublishPanel(props) { |
| 11629 | 11966 | if (isSiteEditor) { |
| 11630 | 11967 | return null; |
| @@ -11629,9 +11966,9 @@ | ||
| 11629 | 11966 | if (isSiteEditor) { |
| 11630 | 11967 | return null; |
| 11631 | 11968 | } |
| 11632 | 11969 | deprecateSlot("PluginPostPublishPanel"); |
| 11633 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginPostPublishPanel, { ...props }); | |
| 11970 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPostPublishPanel, { ...props }); | |
| 11634 | 11971 | } |
| 11635 | 11972 | function PluginPostStatusInfo(props) { |
| 11636 | 11973 | if (isSiteEditor) { |
| 11637 | 11974 | return null; |
| @@ -11636,9 +11973,9 @@ | ||
| 11636 | 11973 | if (isSiteEditor) { |
| 11637 | 11974 | return null; |
| 11638 | 11975 | } |
| 11639 | 11976 | deprecateSlot("PluginPostStatusInfo"); |
| 11640 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginPostStatusInfo, { ...props }); | |
| 11977 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginPostStatusInfo, { ...props }); | |
| 11641 | 11978 | } |
| 11642 | 11979 | function PluginSidebar(props) { |
| 11643 | 11980 | if (isSiteEditor) { |
| 11644 | 11981 | return null; |
| @@ -11643,9 +11980,9 @@ | ||
| 11643 | 11980 | if (isSiteEditor) { |
| 11644 | 11981 | return null; |
| 11645 | 11982 | } |
| 11646 | 11983 | deprecateSlot("PluginSidebar"); |
| 11647 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginSidebar, { ...props }); | |
| 11984 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginSidebar, { ...props }); | |
| 11648 | 11985 | } |
| 11649 | 11986 | function PluginSidebarMoreMenuItem(props) { |
| 11650 | 11987 | if (isSiteEditor) { |
| 11651 | 11988 | return null; |
| @@ -11650,9 +11987,9 @@ | ||
| 11650 | 11987 | if (isSiteEditor) { |
| 11651 | 11988 | return null; |
| 11652 | 11989 | } |
| 11653 | 11990 | deprecateSlot("PluginSidebarMoreMenuItem"); |
| 11654 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_editor18.PluginSidebarMoreMenuItem, { ...props }); | |
| 11991 | + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_editor20.PluginSidebarMoreMenuItem, { ...props }); | |
| 11655 | 11992 | } |
| 11656 | 11993 | function __experimentalPluginPostExcerpt() { |
| 11657 | 11994 | if (isSiteEditor) { |
| 11658 | 11995 | return null; |
| @@ -11665,30 +12002,28 @@ | ||
| 11665 | 12002 | return PluginPostExcerpt; |
| 11666 | 12003 | } |
| 11667 | 12004 | |
| 11668 | 12005 | // packages/edit-post/build-module/index.mjs |
| 11669 | - var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); | |
| 12006 | + var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); | |
| 11670 | 12007 | var { |
| 11671 | 12008 | BackButton: __experimentalMainDashboardButton, |
| 11672 | 12009 | registerCoreBlockBindingsSources |
| 11673 | - } = unlock2(import_editor19.privateApis); | |
| 12010 | + } = unlock2(import_editor21.privateApis); | |
| 11674 | 12011 | var { enablePreloadMultiUse, clearPreloadedData } = unlock2( |
| 11675 | 12012 | import_api_fetch2.default.privateApis |
| 11676 | 12013 | ); |
| 11677 | 12014 | function initializeEditor(id, postType, postId, settings, initialEdits) { |
| 11678 | - const isMediumOrBigger = window.matchMedia("(min-width: 782px)").matches; | |
| 11679 | 12015 | const target = document.getElementById(id); |
| 11680 | - const root = (0, import_element29.createRoot)(target); | |
| 11681 | - (0, import_data25.dispatch)(import_preferences11.store).setDefaults("core/edit-post", { | |
| 12016 | + const root = (0, import_element30.createRoot)(target); | |
| 12017 | + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core/edit-post", { | |
| 11682 | 12018 | fullscreenMode: true, |
| 11683 | 12019 | themeStyles: true, |
| 11684 | 12020 | welcomeGuide: true, |
| 11685 | 12021 | welcomeGuideTemplate: true |
| 11686 | 12022 | }); |
| 11687 | - (0, import_data25.dispatch)(import_preferences11.store).setDefaults("core", { | |
| 12023 | + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core", { | |
| 11688 | 12024 | allowRightClickOverrides: true, |
| 11689 | 12025 | editorMode: "visual", |
| 11690 | - editorTool: "edit", | |
| 11691 | 12026 | fixedToolbar: false, |
| 11692 | 12027 | hiddenBlockTypes: [], |
| 11693 | 12028 | inactivePanels: [], |
| 11694 | 12029 | openPanels: ["post-status"], |
| @@ -11702,23 +12037,20 @@ | ||
| 11702 | 12037 | showCollaborationLeaveNotifications: true, |
| 11703 | 12038 | showCollaborationPostSaveNotifications: true |
| 11704 | 12039 | }); |
| 11705 | 12040 | if (window.__clientSideMediaProcessing) { |
| 11706 | - (0, import_data25.dispatch)(import_preferences11.store).setDefaults("core/media", { | |
| 12041 | + (0, import_data27.dispatch)(import_preferences11.store).setDefaults("core/media", { | |
| 11707 | 12042 | requireApproval: true, |
| 11708 | 12043 | optimizeOnUpload: true |
| 11709 | 12044 | }); |
| 11710 | 12045 | } |
| 11711 | - (0, import_data25.dispatch)(import_blocks2.store).reapplyBlockTypeFilters(); | |
| 11712 | - if (isMediumOrBigger && (0, import_data25.select)(import_preferences11.store).get("core", "showListViewByDefault") && !(0, import_data25.select)(import_preferences11.store).get("core", "distractionFree")) { | |
| 11713 | - (0, import_data25.dispatch)(import_editor19.store).setIsListViewOpened(true); | |
| 11714 | - } | |
| 11715 | - (0, import_block_library2.registerCoreBlocks)(); | |
| 12046 | + (0, import_data27.dispatch)(import_blocks2.store).reapplyBlockTypeFilters(); | |
| 12047 | + (0, import_block_library.registerCoreBlocks)(); | |
| 11716 | 12048 | registerCoreBlockBindingsSources(); |
| 11717 | 12049 | (0, import_widgets.registerLegacyWidgetBlock)({ inserter: false }); |
| 11718 | 12050 | (0, import_widgets.registerWidgetGroupBlock)({ inserter: false }); |
| 11719 | 12051 | if (true) { |
| 11720 | - (0, import_block_library2.__experimentalRegisterExperimentalCoreBlocks)({ | |
| 12052 | + (0, import_block_library.__experimentalRegisterExperimentalCoreBlocks)({ | |
| 11721 | 12053 | enableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks |
| 11722 | 12054 | }); |
| 11723 | 12055 | } |
| 11724 | 12056 | const documentMode = document.compatMode === "CSS1Compat" ? "Standards" : "Quirks"; |
| @@ -11726,24 +12058,8 @@ | ||
| 11726 | 12058 | console.warn( |
| 11727 | 12059 | "Your browser is using Quirks Mode. \nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins." |
| 11728 | 12060 | ); |
| 11729 | 12061 | } |
| 11730 | - const isIphone = window.navigator.userAgent.indexOf("iPhone") !== -1; | |
| 11731 | - if (isIphone) { | |
| 11732 | - window.addEventListener("scroll", (event) => { | |
| 11733 | - const editorScrollContainer = document.getElementsByClassName( | |
| 11734 | - "interface-interface-skeleton__body" | |
| 11735 | - )[0]; | |
| 11736 | - if (event.target === document) { | |
| 11737 | - if (window.scrollY > 100) { | |
| 11738 | - editorScrollContainer.scrollTop = editorScrollContainer.scrollTop + window.scrollY; | |
| 11739 | - } | |
| 11740 | - if (document.getElementsByClassName("is-mode-visual")[0]) { | |
| 11741 | - window.scrollTo(0, 0); | |
| 11742 | - } | |
| 11743 | - } | |
| 11744 | - }); | |
| 11745 | - } | |
| 11746 | 12062 | window.addEventListener("dragover", (e) => e.preventDefault(), false); |
| 11747 | 12063 | window.addEventListener("drop", (e) => e.preventDefault(), false); |
| 11748 | 12064 | enablePreloadMultiUse(); |
| 11749 | 12065 | const preloadedResolutions = preloadResolutions(postType, postId); |
| @@ -11749,15 +12065,15 @@ | ||
| 11749 | 12065 | const preloadedResolutions = preloadResolutions(postType, postId); |
| 11750 | 12066 | preloadedResolutions.finally(() => { |
| 11751 | 12067 | clearPreloadedData(); |
| 11752 | 12068 | if (postType && postId) { |
| 11753 | - const post = (0, import_data25.select)(import_core_data9.store).getEntityRecord( | |
| 12069 | + const post = (0, import_data27.select)(import_core_data10.store).getEntityRecord( | |
| 11754 | 12070 | "postType", |
| 11755 | 12071 | postType, |
| 11756 | 12072 | postId |
| 11757 | 12073 | ); |
| 11758 | 12074 | if (post) { |
| 11759 | - (0, import_data25.dispatch)(import_editor19.store).setupEditor( | |
| 12075 | + (0, import_data27.dispatch)(import_editor21.store).setupEditor( | |
| 11760 | 12076 | post, |
| 11761 | 12077 | initialEdits, |
| 11762 | 12078 | settings.template |
| 11763 | 12079 | ); |
| @@ -11763,9 +12079,9 @@ | ||
| 11763 | 12079 | ); |
| 11764 | 12080 | } |
| 11765 | 12081 | } |
| 11766 | 12082 | root.render( |
| 11767 | - /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_element29.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( | |
| 12083 | + /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_element30.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 11768 | 12084 | layout_default, |
| 11769 | 12085 | { |
| 11770 | 12086 | settings, |
| 11771 | 12087 | postId, |
| @@ -11777,10 +12093,10 @@ | ||
| 11777 | 12093 | }); |
| 11778 | 12094 | return root; |
| 11779 | 12095 | } |
| 11780 | 12096 | async function preloadResolutions(postType, postId) { |
| 11781 | - const core = (0, import_data25.resolveSelect)(import_core_data9.store); | |
| 11782 | - const coreSelect = (0, import_data25.select)(import_core_data9.store); | |
| 12097 | + const core = (0, import_data27.resolveSelect)(import_core_data10.store); | |
| 12098 | + const coreSelect = (0, import_data27.select)(import_core_data10.store); | |
| 11783 | 12099 | try { |
| 11784 | 12100 | await Promise.all([ |
| 11785 | 12101 | core.getCurrentUser(), |
| 11786 | 12102 | core.getEntitiesConfig("postType"), |
| @@ -11795,9 +12111,8 @@ | ||
| 11795 | 12111 | core.__experimentalGetCurrentGlobalStylesId(), |
| 11796 | 12112 | core.__experimentalGetCurrentThemeBaseGlobalStyles(), |
| 11797 | 12113 | core.__experimentalGetCurrentThemeGlobalStylesVariations(), |
| 11798 | 12114 | core.getEntityRecord("root", "__unstableBase"), |
| 11799 | - core.getEntityRecord("root", "site"), | |
| 11800 | 12115 | core.canUser("read", { kind: "root", name: "site" }), |
| 11801 | 12116 | core.canUser("create", { kind: "postType", name: "attachment" }), |
| 11802 | 12117 | core.canUser("create", { kind: "postType", name: "page" }), |
| 11803 | 12118 | core.canUser("create", { kind: "postType", name: "wp_block" }), |
| @@ -11833,13 +12148,15 @@ | ||
| 11833 | 12148 | }) |
| 11834 | 12149 | ] : [] |
| 11835 | 12150 | ]); |
| 11836 | 12151 | const tasks = []; |
| 12152 | + if (coreSelect.canUser("read", { kind: "root", name: "site" })) { | |
| 12153 | + tasks.push(core.getEntityRecord("root", "site")); | |
| 12154 | + } | |
| 11837 | 12155 | const globalStylesId = coreSelect.__experimentalGetCurrentGlobalStylesId(); |
| 11838 | 12156 | if (globalStylesId) { |
| 11839 | 12157 | tasks.push( |
| 11840 | - core.getEntityRecord("root", "globalStyles", globalStylesId), | |
| 11841 | - core.canUser("read", { | |
| 12158 | + core.canUser("update", { | |
| 11842 | 12159 | kind: "root", |
| 11843 | 12160 | name: "globalStyles", |
| 11844 | 12161 | id: globalStylesId |
| 11845 | 12162 | }) |
| @@ -11869,8 +12186,28 @@ | ||
| 11869 | 12186 | } |
| 11870 | 12187 | if (tasks.length) { |
| 11871 | 12188 | await Promise.all(tasks); |
| 11872 | 12189 | } |
| 12190 | + if (globalStylesId) { | |
| 12191 | + if (coreSelect.canUser("update", { | |
| 12192 | + kind: "root", | |
| 12193 | + name: "globalStyles", | |
| 12194 | + id: globalStylesId | |
| 12195 | + })) { | |
| 12196 | + await core.getEntityRecord( | |
| 12197 | + "root", | |
| 12198 | + "globalStyles", | |
| 12199 | + globalStylesId | |
| 12200 | + ); | |
| 12201 | + } else { | |
| 12202 | + await core.getEntityRecord( | |
| 12203 | + "root", | |
| 12204 | + "globalStyles", | |
| 12205 | + globalStylesId, | |
| 12206 | + { context: "view" } | |
| 12207 | + ); | |
| 12208 | + } | |
| 12209 | + } | |
| 11873 | 12210 | } catch { |
| 11874 | 12211 | } |
| 11875 | 12212 | } |
| 11876 | 12213 | function reinitializeEditor() { |
| @@ -11904,5 +12241,7 @@ | ||
| 11904 | 12241 | * This source code is licensed under the MIT license found in the |
| 11905 | 12242 | * LICENSE file in the root directory of this source tree. |
| 11906 | 12243 | *) |
| 11907 | 12244 | */ |
| 12245 | +(window.wp ||= {}).editPost = wp.editPost; | |
| 12246 | +})(); | |
| 11908 | 12247 | //# sourceMappingURL=index.js.map |