| @@ -312,22 +312,8 @@ | ||
| 312 | 312 | } |
| 313 | 313 | } |
| 314 | 314 | }); |
| 315 | 315 | |
| 316 | - // package-external:@wordpress/a11y | |
| 317 | - var require_a11y = __commonJS({ | |
| 318 | - "package-external:@wordpress/a11y"(exports, module) { | |
| 319 | - module.exports = window.wp.a11y; | |
| 320 | - } | |
| 321 | - }); | |
| 322 | - | |
| 323 | - // package-external:@wordpress/primitives | |
| 324 | - var require_primitives = __commonJS({ | |
| 325 | - "package-external:@wordpress/primitives"(exports, module) { | |
| 326 | - module.exports = window.wp.primitives; | |
| 327 | - } | |
| 328 | - }); | |
| 329 | - | |
| 330 | 316 | // package-external:@wordpress/theme |
| 331 | 317 | var require_theme = __commonJS({ |
| 332 | 318 | "package-external:@wordpress/theme"(exports, module) { |
| 333 | 319 | module.exports = window.wp.theme; |
| @@ -340,8 +326,22 @@ | ||
| 340 | 326 | module.exports = window.wp.privateApis; |
| 341 | 327 | } |
| 342 | 328 | }); |
| 343 | 329 | |
| 330 | + // package-external:@wordpress/primitives | |
| 331 | + var require_primitives = __commonJS({ | |
| 332 | + "package-external:@wordpress/primitives"(exports, module) { | |
| 333 | + module.exports = window.wp.primitives; | |
| 334 | + } | |
| 335 | + }); | |
| 336 | + | |
| 337 | + // package-external:@wordpress/a11y | |
| 338 | + var require_a11y = __commonJS({ | |
| 339 | + "package-external:@wordpress/a11y"(exports, module) { | |
| 340 | + module.exports = window.wp.a11y; | |
| 341 | + } | |
| 342 | + }); | |
| 343 | + | |
| 344 | 344 | // packages/block-directory/build-module/index.mjs |
| 345 | 345 | var index_exports = {}; |
| 346 | 346 | __export(index_exports, { |
| 347 | 347 | store: () => store |
| @@ -938,8 +938,31 @@ | ||
| 938 | 938 | var import_html_entities = __toESM(require_html_entities(), 1); |
| 939 | 939 | var import_blocks3 = __toESM(require_blocks(), 1); |
| 940 | 940 | var import_data6 = __toESM(require_data(), 1); |
| 941 | 941 | |
| 942 | + // node_modules/@base-ui/utils/createLogOnce.mjs | |
| 943 | + var loggedMessages; | |
| 944 | + if (true) { | |
| 945 | + loggedMessages = /* @__PURE__ */ new Set(); | |
| 946 | + } | |
| 947 | + function createLogOnce(severity, prefix) { | |
| 948 | + return function logOnce(...messages) { | |
| 949 | + if (true) { | |
| 950 | + const message = messages.join(" "); | |
| 951 | + const output = prefix ? `${prefix}: ${message}` : message; | |
| 952 | + const key = `${severity}:${output}`; | |
| 953 | + if (!loggedMessages.has(key)) { | |
| 954 | + loggedMessages.add(key); | |
| 955 | + if (severity === "warn") { | |
| 956 | + console.warn(output); | |
| 957 | + } else { | |
| 958 | + console.error(output); | |
| 959 | + } | |
| 960 | + } | |
| 961 | + } | |
| 962 | + }; | |
| 963 | + } | |
| 964 | + | |
| 942 | 965 | // node_modules/@base-ui/utils/safeReact.mjs |
| 943 | 966 | var React = __toESM(require_react(), 1); |
| 944 | 967 | var SafeReact = { |
| 945 | 968 | ...React |
| @@ -989,21 +1012,15 @@ | ||
| 989 | 1012 | } |
| 990 | 1013 | } |
| 991 | 1014 | |
| 992 | 1015 | // node_modules/@base-ui/utils/warn.mjs |
| 993 | - var set; | |
| 994 | - if (true) { | |
| 995 | - set = /* @__PURE__ */ new Set(); | |
| 1016 | + var warn = createLogOnce("warn", "Base UI"); | |
| 1017 | + | |
| 1018 | + // node_modules/@base-ui/utils/empty.mjs | |
| 1019 | + function NOOP() { | |
| 996 | 1020 | } |
| 997 | - function warn(...messages) { | |
| 998 | - if (true) { | |
| 999 | - const messageKey = messages.join(" "); | |
| 1000 | - if (!set.has(messageKey)) { | |
| 1001 | - set.add(messageKey); | |
| 1002 | - console.warn(`Base UI: ${messageKey}`); | |
| 1003 | - } | |
| 1004 | - } | |
| 1005 | - } | |
| 1021 | + var EMPTY_ARRAY2 = Object.freeze([]); | |
| 1022 | + var EMPTY_OBJECT = Object.freeze({}); | |
| 1006 | 1023 | |
| 1007 | 1024 | // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs |
| 1008 | 1025 | var React3 = __toESM(require_react(), 1); |
| 1009 | 1026 | var noop = () => { |
| @@ -1138,14 +1155,8 @@ | ||
| 1138 | 1155 | } |
| 1139 | 1156 | return void 0; |
| 1140 | 1157 | } |
| 1141 | 1158 | |
| 1142 | - // node_modules/@base-ui/utils/empty.mjs | |
| 1143 | - function NOOP() { | |
| 1144 | - } | |
| 1145 | - var EMPTY_ARRAY2 = Object.freeze([]); | |
| 1146 | - var EMPTY_OBJECT = Object.freeze({}); | |
| 1147 | - | |
| 1148 | 1159 | // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs |
| 1149 | 1160 | function getStateAttributesProps(state, customMapping) { |
| 1150 | 1161 | const props = {}; |
| 1151 | 1162 | for (const key in state) { |
| @@ -1333,10 +1344,13 @@ | ||
| 1333 | 1344 | |
| 1334 | 1345 | // node_modules/@base-ui/react/internals/useRenderElement.mjs |
| 1335 | 1346 | var import_react = __toESM(require_react(), 1); |
| 1336 | 1347 | function useRenderElement(element, componentProps, params = {}) { |
| 1337 | - const renderProp = componentProps.render; | |
| 1338 | - const outProps = useRenderElementProps(componentProps, params); | |
| 1348 | + let renderProp = componentProps.render; | |
| 1349 | + if (params.enabled !== false) { | |
| 1350 | + renderProp = unwrapLazyRenderProp(renderProp); | |
| 1351 | + } | |
| 1352 | + const outProps = useRenderElementProps(componentProps, params, renderProp); | |
| 1339 | 1353 | if (params.enabled === false) { |
| 1340 | 1354 | return null; |
| 1341 | 1355 | } |
| 1342 | 1356 | const state = params.state ?? EMPTY_OBJECT; |
| @@ -1341,13 +1355,12 @@ | ||
| 1341 | 1355 | } |
| 1342 | 1356 | const state = params.state ?? EMPTY_OBJECT; |
| 1343 | 1357 | return evaluateRenderProp(element, renderProp, outProps, state); |
| 1344 | 1358 | } |
| 1345 | - function useRenderElementProps(componentProps, params = {}) { | |
| 1359 | + function useRenderElementProps(componentProps, params, renderProp) { | |
| 1346 | 1360 | const { |
| 1347 | 1361 | className: classNameProp, |
| 1348 | - style: styleProp, | |
| 1349 | - render: renderProp | |
| 1362 | + style: styleProp | |
| 1350 | 1363 | } = componentProps; |
| 1351 | 1364 | const { |
| 1352 | 1365 | state = EMPTY_OBJECT, |
| 1353 | 1366 | ref, |
| @@ -1388,8 +1401,15 @@ | ||
| 1388 | 1401 | } |
| 1389 | 1402 | var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); |
| 1390 | 1403 | var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; |
| 1391 | 1404 | var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; |
| 1405 | + function unwrapLazyRenderProp(render) { | |
| 1406 | + if (render?.$$typeof !== REACT_LAZY_TYPE) { | |
| 1407 | + return render; | |
| 1408 | + } | |
| 1409 | + const unwrapped = React6.Children.toArray(render)[0]; | |
| 1410 | + return /* @__PURE__ */ React6.isValidElement(unwrapped) ? unwrapped : render; | |
| 1411 | + } | |
| 1392 | 1412 | function evaluateRenderProp(element, render, props, state) { |
| 1393 | 1413 | if (render) { |
| 1394 | 1414 | if (typeof render === "function") { |
| 1395 | 1415 | if (true) { |
| @@ -1398,19 +1418,14 @@ | ||
| 1398 | 1418 | return render(props, state); |
| 1399 | 1419 | } |
| 1400 | 1420 | const mergedProps = mergeProps(props, render.props); |
| 1401 | 1421 | mergedProps.ref = props.ref; |
| 1402 | - let newElement = render; | |
| 1403 | - if (newElement?.$$typeof === REACT_LAZY_TYPE) { | |
| 1404 | - const children = React6.Children.toArray(render); | |
| 1405 | - newElement = children[0]; | |
| 1406 | - } | |
| 1407 | 1422 | if (true) { |
| 1408 | - if (!/* @__PURE__ */ React6.isValidElement(newElement)) { | |
| 1423 | + if (!/* @__PURE__ */ React6.isValidElement(render)) { | |
| 1409 | 1424 | 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")); |
| 1410 | 1425 | } |
| 1411 | 1426 | } |
| 1412 | - return /* @__PURE__ */ React6.cloneElement(newElement, mergedProps); | |
| 1427 | + return /* @__PURE__ */ React6.cloneElement(render, mergedProps); | |
| 1413 | 1428 | } |
| 1414 | 1429 | if (element) { |
| 1415 | 1430 | if (typeof element === "string") { |
| 1416 | 1431 | return renderTag(element, props); |
| @@ -1632,8 +1647,11 @@ | ||
| 1632 | 1647 | const index2 = id - this.startId; |
| 1633 | 1648 | if (index2 < 0 || index2 >= this.callbacks.length) { |
| 1634 | 1649 | return; |
| 1635 | 1650 | } |
| 1651 | + if (this.callbacks[index2] === null) { | |
| 1652 | + return; | |
| 1653 | + } | |
| 1636 | 1654 | this.callbacks[index2] = null; |
| 1637 | 1655 | this.callbacksCount -= 1; |
| 1638 | 1656 | } |
| 1639 | 1657 | }; |
| @@ -1675,23 +1693,23 @@ | ||
| 1675 | 1693 | return timeout; |
| 1676 | 1694 | } |
| 1677 | 1695 | |
| 1678 | 1696 | // node_modules/@base-ui/react/internals/useTransitionStatus.mjs |
| 1679 | - function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { | |
| 1680 | - const [transitionStatus, setTransitionStatus] = React9.useState(open && enableIdleState ? "idle" : void 0); | |
| 1681 | - const [mounted, setMounted] = React9.useState(open); | |
| 1682 | - if (open && !mounted) { | |
| 1697 | + function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { | |
| 1698 | + const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0); | |
| 1699 | + const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen); | |
| 1700 | + if (open2 && !mounted) { | |
| 1683 | 1701 | setMounted(true); |
| 1684 | 1702 | setTransitionStatus("starting"); |
| 1685 | 1703 | } |
| 1686 | - if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { | |
| 1704 | + if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) { | |
| 1687 | 1705 | setTransitionStatus("ending"); |
| 1688 | 1706 | } |
| 1689 | - if (!open && !mounted && transitionStatus === "ending") { | |
| 1707 | + if (!open2 && !mounted && transitionStatus === "ending") { | |
| 1690 | 1708 | setTransitionStatus(void 0); |
| 1691 | 1709 | } |
| 1692 | 1710 | useIsoLayoutEffect(() => { |
| 1693 | - if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { | |
| 1711 | + if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) { | |
| 1694 | 1712 | const frame = AnimationFrame.request(() => { |
| 1695 | 1713 | setTransitionStatus("ending"); |
| 1696 | 1714 | }); |
| 1697 | 1715 | return () => { |
| @@ -1698,11 +1716,11 @@ | ||
| 1698 | 1716 | AnimationFrame.cancel(frame); |
| 1699 | 1717 | }; |
| 1700 | 1718 | } |
| 1701 | 1719 | return void 0; |
| 1702 | - }, [open, mounted, transitionStatus, deferEndingState]); | |
| 1720 | + }, [open2, mounted, transitionStatus, deferEndingState]); | |
| 1703 | 1721 | useIsoLayoutEffect(() => { |
| 1704 | - if (!open || enableIdleState) { | |
| 1722 | + if (!open2 || enableIdleState) { | |
| 1705 | 1723 | return void 0; |
| 1706 | 1724 | } |
| 1707 | 1725 | const frame = AnimationFrame.request(() => { |
| 1708 | 1726 | setTransitionStatus(void 0); |
| @@ -1709,14 +1727,14 @@ | ||
| 1709 | 1727 | }); |
| 1710 | 1728 | return () => { |
| 1711 | 1729 | AnimationFrame.cancel(frame); |
| 1712 | 1730 | }; |
| 1713 | - }, [enableIdleState, open]); | |
| 1731 | + }, [enableIdleState, open2]); | |
| 1714 | 1732 | useIsoLayoutEffect(() => { |
| 1715 | - if (!open || !enableIdleState) { | |
| 1733 | + if (!open2 || !enableIdleState) { | |
| 1716 | 1734 | return void 0; |
| 1717 | 1735 | } |
| 1718 | - if (open && mounted && transitionStatus !== "idle") { | |
| 1736 | + if (open2 && mounted && transitionStatus !== "idle") { | |
| 1719 | 1737 | setTransitionStatus("starting"); |
| 1720 | 1738 | } |
| 1721 | 1739 | const frame = AnimationFrame.request(() => { |
| 1722 | 1740 | setTransitionStatus("idle"); |
| @@ -1723,9 +1741,9 @@ | ||
| 1723 | 1741 | }); |
| 1724 | 1742 | return () => { |
| 1725 | 1743 | AnimationFrame.cancel(frame); |
| 1726 | 1744 | }; |
| 1727 | - }, [enableIdleState, open, mounted, transitionStatus]); | |
| 1745 | + }, [enableIdleState, open2, mounted, transitionStatus]); | |
| 1728 | 1746 | return { |
| 1729 | 1747 | mounted, |
| 1730 | 1748 | setMounted, |
| 1731 | 1749 | transitionStatus |
| @@ -1731,19 +1749,18 @@ | ||
| 1731 | 1749 | transitionStatus |
| 1732 | 1750 | }; |
| 1733 | 1751 | } |
| 1734 | 1752 | |
| 1753 | + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs | |
| 1754 | + var startingStyle = "data-starting-style"; | |
| 1755 | + var endingStyle = "data-ending-style"; | |
| 1756 | + | |
| 1735 | 1757 | // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs |
| 1736 | - var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { | |
| 1737 | - TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; | |
| 1738 | - TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; | |
| 1739 | - return TransitionStatusDataAttributes2; | |
| 1740 | - })({}); | |
| 1741 | 1758 | var STARTING_HOOK = { |
| 1742 | - "data-starting-style": "" | |
| 1759 | + [startingStyle]: "" | |
| 1743 | 1760 | }; |
| 1744 | 1761 | var ENDING_HOOK = { |
| 1745 | - "data-ending-style": "" | |
| 1762 | + [endingStyle]: "" | |
| 1746 | 1763 | }; |
| 1747 | 1764 | var transitionStatusMapping = { |
| 1748 | 1765 | transitionStatus(value) { |
| 1749 | 1766 | if (value === "starting") { |
| @@ -1957,9 +1974,25 @@ | ||
| 1957 | 1974 | return "current" in maybeRef ? maybeRef.current : maybeRef; |
| 1958 | 1975 | } |
| 1959 | 1976 | |
| 1960 | 1977 | // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs |
| 1961 | - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) { | |
| 1978 | + var pendingCallbacks = null; | |
| 1979 | + function flushBeforePaint(fn) { | |
| 1980 | + if (!pendingCallbacks) { | |
| 1981 | + const callbacks = []; | |
| 1982 | + pendingCallbacks = callbacks; | |
| 1983 | + queueMicrotask(() => { | |
| 1984 | + pendingCallbacks = null; | |
| 1985 | + ReactDOM.flushSync(() => { | |
| 1986 | + for (const callback of callbacks) { | |
| 1987 | + callback(); | |
| 1988 | + } | |
| 1989 | + }); | |
| 1990 | + }); | |
| 1991 | + } | |
| 1992 | + pendingCallbacks.push(fn); | |
| 1993 | + } | |
| 1994 | + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { | |
| 1962 | 1995 | const frame = useAnimationFrame(); |
| 1963 | 1996 | return useStableCallback((fnToExecute, signal = null) => { |
| 1964 | 1997 | frame.cancel(); |
| 1965 | 1998 | const element = resolveRef(elementOrRef); |
| @@ -1967,9 +2000,17 @@ | ||
| 1967 | 2000 | return; |
| 1968 | 2001 | } |
| 1969 | 2002 | const resolvedElement = element; |
| 1970 | 2003 | const done = () => { |
| 1971 | - ReactDOM.flushSync(fnToExecute); | |
| 2004 | + if (!batch) { | |
| 2005 | + ReactDOM.flushSync(fnToExecute); | |
| 2006 | + return; | |
| 2007 | + } | |
| 2008 | + flushBeforePaint(() => { | |
| 2009 | + if (!signal?.aborted) { | |
| 2010 | + fnToExecute(); | |
| 2011 | + } | |
| 2012 | + }); | |
| 1972 | 2013 | }; |
| 1973 | 2014 | if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { |
| 1974 | 2015 | fnToExecute(); |
| 1975 | 2016 | return; |
| @@ -1991,9 +2032,9 @@ | ||
| 1991 | 2032 | done(); |
| 1992 | 2033 | }); |
| 1993 | 2034 | } |
| 1994 | 2035 | if (waitForStartingStyleRemoved) { |
| 1995 | - const startingStyleAttribute = "data-starting-style"; | |
| 2036 | + const startingStyleAttribute = startingStyle; | |
| 1996 | 2037 | if (!resolvedElement.hasAttribute(startingStyleAttribute)) { |
| 1997 | 2038 | frame.request(exec); |
| 1998 | 2039 | return; |
| 1999 | 2040 | } |
| @@ -2019,14 +2060,15 @@ | ||
| 2019 | 2060 | // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs |
| 2020 | 2061 | function useOpenChangeComplete(parameters) { |
| 2021 | 2062 | const { |
| 2022 | 2063 | enabled = true, |
| 2023 | - open, | |
| 2064 | + open: open2, | |
| 2024 | 2065 | ref, |
| 2066 | + batch = false, | |
| 2025 | 2067 | onComplete: onCompleteParam |
| 2026 | 2068 | } = parameters; |
| 2027 | 2069 | const onComplete = useStableCallback(onCompleteParam); |
| 2028 | - const runOnceAnimationsFinish = useAnimationsFinished(ref, open); | |
| 2070 | + const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); | |
| 2029 | 2071 | React10.useEffect(() => { |
| 2030 | 2072 | if (!enabled) { |
| 2031 | 2073 | return void 0; |
| 2032 | 2074 | } |
| @@ -2034,9 +2076,9 @@ | ||
| 2034 | 2076 | runOnceAnimationsFinish(onComplete, abortController.signal); |
| 2035 | 2077 | return () => { |
| 2036 | 2078 | abortController.abort(); |
| 2037 | 2079 | }; |
| 2038 | - }, [enabled, open, onComplete, runOnceAnimationsFinish]); | |
| 2080 | + }, [enabled, open2, onComplete, runOnceAnimationsFinish]); | |
| 2039 | 2081 | } |
| 2040 | 2082 | |
| 2041 | 2083 | // node_modules/@base-ui/utils/platform/parts.mjs |
| 2042 | 2084 | var parts_exports = {}; |
| @@ -2042,8 +2084,9 @@ | ||
| 2042 | 2084 | var parts_exports = {}; |
| 2043 | 2085 | __export(parts_exports, { |
| 2044 | 2086 | engine: () => engine_exports, |
| 2045 | 2087 | env: () => env_exports, |
| 2088 | + mediaQuery: () => media_query_exports, | |
| 2046 | 2089 | os: () => os_exports, |
| 2047 | 2090 | screenReader: () => screen_reader_exports |
| 2048 | 2091 | }); |
| 2049 | 2092 | |
| @@ -2127,8 +2170,15 @@ | ||
| 2127 | 2170 | jsdom: () => jsdom |
| 2128 | 2171 | }); |
| 2129 | 2172 | var jsdom = /jsdom|happydom/.test(lowerUserAgent); |
| 2130 | 2173 | |
| 2174 | + // node_modules/@base-ui/utils/platform/media-query.mjs | |
| 2175 | + var media_query_exports = {}; | |
| 2176 | + __export(media_query_exports, { | |
| 2177 | + iOS: () => iOS | |
| 2178 | + }); | |
| 2179 | + var iOS = "@supports (-webkit-touch-callout: none)"; | |
| 2180 | + | |
| 2131 | 2181 | // node_modules/@base-ui/utils/useTimeout.mjs |
| 2132 | 2182 | var EMPTY2 = 0; |
| 2133 | 2183 | var Timeout = class _Timeout { |
| 2134 | 2184 | static create() { |
| @@ -2170,8 +2220,17 @@ | ||
| 2170 | 2220 | // node_modules/@base-ui/react/floating-ui-react/utils/event.mjs |
| 2171 | 2221 | function isReactEvent(event) { |
| 2172 | 2222 | return "nativeEvent" in event; |
| 2173 | 2223 | } |
| 2224 | + function isVirtualClick(event) { | |
| 2225 | + if (event.pointerType === "" && event.isTrusted) { | |
| 2226 | + return true; | |
| 2227 | + } | |
| 2228 | + if (parts_exports.os.android && event.pointerType) { | |
| 2229 | + return event.type === "click" && event.buttons === 1; | |
| 2230 | + } | |
| 2231 | + return event.detail === 0 && !event.pointerType; | |
| 2232 | + } | |
| 2174 | 2233 | function isMouseLikePointerType(pointerType, strict) { |
| 2175 | 2234 | const values = ["mouse", "pen"]; |
| 2176 | 2235 | if (!strict) { |
| 2177 | 2236 | values.push("", void 0); |
| @@ -2182,13 +2241,9 @@ | ||
| 2182 | 2241 | const type = event.type; |
| 2183 | 2242 | return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; |
| 2184 | 2243 | } |
| 2185 | 2244 | |
| 2186 | - // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs | |
| 2187 | - var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; | |
| 2188 | - var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; | |
| 2189 | - | |
| 2190 | - // node_modules/@base-ui/react/internals/shadowDom.mjs | |
| 2245 | + // node_modules/@base-ui/utils/shadowDom.mjs | |
| 2191 | 2246 | function activeElement(doc) { |
| 2192 | 2247 | let element = doc.activeElement; |
| 2193 | 2248 | while (element?.shadowRoot?.activeElement != null) { |
| 2194 | 2249 | element = element.shadowRoot.activeElement; |
| @@ -2215,13 +2270,79 @@ | ||
| 2215 | 2270 | return false; |
| 2216 | 2271 | } |
| 2217 | 2272 | function getTarget(event) { |
| 2218 | 2273 | if ("composedPath" in event) { |
| 2219 | - return event.composedPath()[0]; | |
| 2274 | + return event.composedPath()[0] ?? event.target; | |
| 2220 | 2275 | } |
| 2221 | 2276 | return event.target; |
| 2222 | 2277 | } |
| 2223 | 2278 | |
| 2279 | + // node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs | |
| 2280 | + var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; | |
| 2281 | + var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; | |
| 2282 | + | |
| 2283 | + // node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs | |
| 2284 | + var open = "data-open"; | |
| 2285 | + var closed = "data-closed"; | |
| 2286 | + var anchorHidden = "data-anchor-hidden"; | |
| 2287 | + | |
| 2288 | + // node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs | |
| 2289 | + var CommonTriggerDataAttributes_exports = {}; | |
| 2290 | + __export(CommonTriggerDataAttributes_exports, { | |
| 2291 | + popupOpen: () => popupOpen, | |
| 2292 | + pressed: () => pressed | |
| 2293 | + }); | |
| 2294 | + var popupOpen = "data-popup-open"; | |
| 2295 | + var pressed = "data-pressed"; | |
| 2296 | + | |
| 2297 | + // node_modules/@base-ui/react/utils/popupStateMapping.mjs | |
| 2298 | + var TRIGGER_HOOK = { | |
| 2299 | + [popupOpen]: "" | |
| 2300 | + }; | |
| 2301 | + var PRESSABLE_TRIGGER_HOOK = { | |
| 2302 | + [popupOpen]: "", | |
| 2303 | + [pressed]: "" | |
| 2304 | + }; | |
| 2305 | + var POPUP_OPEN_HOOK = { | |
| 2306 | + [open]: "" | |
| 2307 | + }; | |
| 2308 | + var POPUP_CLOSED_HOOK = { | |
| 2309 | + [closed]: "" | |
| 2310 | + }; | |
| 2311 | + var ANCHOR_HIDDEN_HOOK = { | |
| 2312 | + [anchorHidden]: "" | |
| 2313 | + }; | |
| 2314 | + var triggerOpenStateMapping = { | |
| 2315 | + open(value) { | |
| 2316 | + if (value) { | |
| 2317 | + return TRIGGER_HOOK; | |
| 2318 | + } | |
| 2319 | + return null; | |
| 2320 | + } | |
| 2321 | + }; | |
| 2322 | + var popupStateMapping = { | |
| 2323 | + open(value) { | |
| 2324 | + if (value) { | |
| 2325 | + return POPUP_OPEN_HOOK; | |
| 2326 | + } | |
| 2327 | + return POPUP_CLOSED_HOOK; | |
| 2328 | + }, | |
| 2329 | + anchorHidden(value) { | |
| 2330 | + if (value) { | |
| 2331 | + return ANCHOR_HIDDEN_HOOK; | |
| 2332 | + } | |
| 2333 | + return null; | |
| 2334 | + } | |
| 2335 | + }; | |
| 2336 | + var popupTransitionStateMapping = { | |
| 2337 | + ...popupStateMapping, | |
| 2338 | + ...transitionStatusMapping | |
| 2339 | + }; | |
| 2340 | + | |
| 2341 | + // node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs | |
| 2342 | + var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; | |
| 2343 | + var triggerDisabled = "data-trigger-disabled"; | |
| 2344 | + | |
| 2224 | 2345 | // node_modules/@base-ui/react/floating-ui-react/utils/element.mjs |
| 2225 | 2346 | function isTargetInsideEnabledTrigger(target, triggerElements) { |
| 2226 | 2347 | if (!isElement(target)) { |
| 2227 | 2348 | return false; |
| @@ -2227,13 +2348,13 @@ | ||
| 2227 | 2348 | return false; |
| 2228 | 2349 | } |
| 2229 | 2350 | const targetElement = target; |
| 2230 | 2351 | if (triggerElements.hasElement(targetElement)) { |
| 2231 | - return !targetElement.hasAttribute("data-trigger-disabled"); | |
| 2352 | + return !targetElement.hasAttribute(triggerDisabled); | |
| 2232 | 2353 | } |
| 2233 | 2354 | for (const [, trigger] of triggerElements.entries()) { |
| 2234 | 2355 | if (contains(trigger, targetElement)) { |
| 2235 | - return !trigger.hasAttribute("data-trigger-disabled"); | |
| 2356 | + return !trigger.hasAttribute(triggerDisabled); | |
| 2236 | 2357 | } |
| 2237 | 2358 | } |
| 2238 | 2359 | return false; |
| 2239 | 2360 | } |
| @@ -2358,9 +2479,9 @@ | ||
| 2358 | 2479 | function useDelayGroup(context, options = { |
| 2359 | 2480 | open: false |
| 2360 | 2481 | }) { |
| 2361 | 2482 | const { |
| 2362 | - open | |
| 2483 | + open: open2 | |
| 2363 | 2484 | } = options; |
| 2364 | 2485 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 2365 | 2486 | const floatingId = store2.useState("floatingId"); |
| 2366 | 2487 | const groupContext = React11.useContext(FloatingDelayGroupContext); |
| @@ -2373,12 +2494,12 @@ | ||
| 2373 | 2494 | hasProvider, |
| 2374 | 2495 | timeout |
| 2375 | 2496 | } = groupContext; |
| 2376 | 2497 | const [isInstantPhase, setIsInstantPhase] = React11.useState(false); |
| 2377 | - const openRef = React11.useRef(open); | |
| 2498 | + const openRef = React11.useRef(open2); | |
| 2378 | 2499 | useIsoLayoutEffect(() => { |
| 2379 | - openRef.current = open; | |
| 2380 | - }, [open]); | |
| 2500 | + openRef.current = open2; | |
| 2501 | + }, [open2]); | |
| 2381 | 2502 | useIsoLayoutEffect(() => { |
| 2382 | 2503 | function unset() { |
| 2383 | 2504 | currentContextRef.current?.setIsInstantPhase(false); |
| 2384 | 2505 | currentIdRef.current = null; |
| @@ -2388,9 +2509,9 @@ | ||
| 2388 | 2509 | } |
| 2389 | 2510 | if (!currentIdRef.current) { |
| 2390 | 2511 | return void 0; |
| 2391 | 2512 | } |
| 2392 | - if (!open && currentIdRef.current === floatingId) { | |
| 2513 | + if (!open2 && currentIdRef.current === floatingId) { | |
| 2393 | 2514 | setIsInstantPhase(false); |
| 2394 | 2515 | if (timeoutMs) { |
| 2395 | 2516 | const closingId = floatingId; |
| 2396 | 2517 | timeout.start(timeoutMs, () => { |
| @@ -2407,11 +2528,11 @@ | ||
| 2407 | 2528 | } |
| 2408 | 2529 | unset(); |
| 2409 | 2530 | } |
| 2410 | 2531 | return void 0; |
| 2411 | - }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); | |
| 2532 | + }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); | |
| 2412 | 2533 | useIsoLayoutEffect(() => { |
| 2413 | - if (!open) { | |
| 2534 | + if (!open2) { | |
| 2414 | 2535 | return; |
| 2415 | 2536 | } |
| 2416 | 2537 | const prevContext = currentContextRef.current; |
| 2417 | 2538 | const prevId = currentIdRef.current; |
| @@ -2432,9 +2553,9 @@ | ||
| 2432 | 2553 | } else { |
| 2433 | 2554 | setIsInstantPhase(false); |
| 2434 | 2555 | prevContext?.setIsInstantPhase(false); |
| 2435 | 2556 | } |
| 2436 | - }, [open, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); | |
| 2557 | + }, [open2, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); | |
| 2437 | 2558 | useIsoLayoutEffect(() => { |
| 2438 | 2559 | return () => { |
| 2439 | 2560 | if (currentIdRef.current === floatingId) { |
| 2440 | 2561 | currentContextRef.current = null; |
| @@ -2447,12 +2568,13 @@ | ||
| 2447 | 2568 | } |
| 2448 | 2569 | }; |
| 2449 | 2570 | }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); |
| 2450 | 2571 | return React11.useMemo(() => ({ |
| 2572 | + activeIdRef: currentIdRef, | |
| 2451 | 2573 | hasProvider, |
| 2452 | 2574 | delayRef, |
| 2453 | 2575 | isInstantPhase |
| 2454 | - }), [hasProvider, delayRef, isInstantPhase]); | |
| 2576 | + }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); | |
| 2455 | 2577 | } |
| 2456 | 2578 | |
| 2457 | 2579 | // node_modules/@base-ui/utils/mergeCleanups.mjs |
| 2458 | 2580 | function mergeCleanups(...cleanups) { |
| @@ -2931,8 +3053,9 @@ | ||
| 2931 | 3053 | className, |
| 2932 | 3054 | style, |
| 2933 | 3055 | children, |
| 2934 | 3056 | container, |
| 3057 | + portalOwnerRole, | |
| 2935 | 3058 | ...elementProps |
| 2936 | 3059 | } = componentProps; |
| 2937 | 3060 | const { |
| 2938 | 3061 | node: portalNode, |
| @@ -2950,9 +3073,9 @@ | ||
| 2950 | 3073 | const afterInsideRef = React13.useRef(null); |
| 2951 | 3074 | const [focusManagerState, setFocusManagerState] = React13.useState(null); |
| 2952 | 3075 | const focusInsideDisabledRef = React13.useRef(false); |
| 2953 | 3076 | const modal = focusManagerState?.modal; |
| 2954 | - const open = focusManagerState?.open; | |
| 3077 | + const open2 = focusManagerState?.open; | |
| 2955 | 3078 | const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; |
| 2956 | 3079 | React13.useEffect(() => { |
| 2957 | 3080 | if (!portalNode || modal) { |
| 2958 | 3081 | return void 0; |
| @@ -2972,14 +3095,14 @@ | ||
| 2972 | 3095 | } |
| 2973 | 3096 | return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); |
| 2974 | 3097 | }, [portalNode, modal]); |
| 2975 | 3098 | useIsoLayoutEffect(() => { |
| 2976 | - if (!portalNode || open !== true || !focusInsideDisabledRef.current) { | |
| 3099 | + if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) { | |
| 2977 | 3100 | return; |
| 2978 | 3101 | } |
| 2979 | 3102 | enableFocusInside(portalNode); |
| 2980 | 3103 | focusInsideDisabledRef.current = false; |
| 2981 | - }, [open, portalNode]); | |
| 3104 | + }, [open2, portalNode]); | |
| 2982 | 3105 | const portalContextValue = React13.useMemo(() => ({ |
| 2983 | 3106 | beforeOutsideRef, |
| 2984 | 3107 | afterOutsideRef, |
| 2985 | 3108 | beforeInsideRef, |
| @@ -3002,8 +3125,9 @@ | ||
| 3002 | 3125 | prevTabbable?.focus(); |
| 3003 | 3126 | } |
| 3004 | 3127 | } |
| 3005 | 3128 | }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { |
| 3129 | + role: portalOwnerRole, | |
| 3006 | 3130 | "aria-owns": portalNodeId, |
| 3007 | 3131 | style: ownerVisuallyHidden |
| 3008 | 3132 | }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { |
| 3009 | 3133 | "data-type": "outside", |
| @@ -3123,9 +3247,9 @@ | ||
| 3123 | 3247 | enabled = true, |
| 3124 | 3248 | axis = "both" |
| 3125 | 3249 | } = props; |
| 3126 | 3250 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 3127 | - const open = store2.useState("open"); | |
| 3251 | + const open2 = store2.useState("open"); | |
| 3128 | 3252 | const floating = store2.useState("floatingElement"); |
| 3129 | 3253 | const domReference = store2.useState("domReferenceElement"); |
| 3130 | 3254 | const dataRef = store2.context.dataRef; |
| 3131 | 3255 | const initialRef = React15.useRef(false); |
| @@ -3150,9 +3274,9 @@ | ||
| 3150 | 3274 | pointerType |
| 3151 | 3275 | })); |
| 3152 | 3276 | }); |
| 3153 | 3277 | const handleReferenceEnterOrMove = useStableCallback((event) => { |
| 3154 | - if (!open) { | |
| 3278 | + if (!open2) { | |
| 3155 | 3279 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 3156 | 3280 | } else if (!cleanupListenerRef.current) { |
| 3157 | 3281 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 3158 | 3282 | setReactive([]); |
| @@ -3157,9 +3281,9 @@ | ||
| 3157 | 3281 | setReference(event.clientX, event.clientY, event.currentTarget); |
| 3158 | 3282 | setReactive([]); |
| 3159 | 3283 | } |
| 3160 | 3284 | }); |
| 3161 | - const openCheck = isMouseLikePointerType(pointerType) ? floating : open; | |
| 3285 | + const openCheck = isMouseLikePointerType(pointerType) ? floating : open2; | |
| 3162 | 3286 | React15.useEffect(() => { |
| 3163 | 3287 | if (!enabled) { |
| 3164 | 3288 | resetReference(domReference); |
| 3165 | 3289 | return void 0; |
| @@ -3195,12 +3319,12 @@ | ||
| 3195 | 3319 | initialRef.current = false; |
| 3196 | 3320 | } |
| 3197 | 3321 | }, [enabled, floating]); |
| 3198 | 3322 | React15.useEffect(() => { |
| 3199 | - if (!enabled && open) { | |
| 3323 | + if (!enabled && open2) { | |
| 3200 | 3324 | initialRef.current = true; |
| 3201 | 3325 | } |
| 3202 | - }, [enabled, open]); | |
| 3326 | + }, [enabled, open2]); | |
| 3203 | 3327 | const reference = React15.useMemo(() => { |
| 3204 | 3328 | function setPointerTypeRef(event) { |
| 3205 | 3329 | setPointerType(event.pointerType); |
| 3206 | 3330 | } |
| @@ -3238,12 +3362,13 @@ | ||
| 3238 | 3362 | bubbles, |
| 3239 | 3363 | externalTree |
| 3240 | 3364 | } = props; |
| 3241 | 3365 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 3242 | - const open = store2.useState("open"); | |
| 3366 | + const open2 = store2.useState("open"); | |
| 3243 | 3367 | const floatingElement = store2.useState("floatingElement"); |
| 3244 | 3368 | const { |
| 3245 | - dataRef | |
| 3369 | + dataRef, | |
| 3370 | + events | |
| 3246 | 3371 | } = store2.context; |
| 3247 | 3372 | const tree = useFloatingTree(externalTree); |
| 3248 | 3373 | const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); |
| 3249 | 3374 | const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; |
| @@ -3255,8 +3380,9 @@ | ||
| 3255 | 3380 | } = normalizeProp(bubbles); |
| 3256 | 3381 | const pressStartedInsideRef = React16.useRef(false); |
| 3257 | 3382 | const pressStartPreventedRef = React16.useRef(false); |
| 3258 | 3383 | const suppressNextOutsideClickRef = React16.useRef(false); |
| 3384 | + const sawPressWhileOpenRef = React16.useRef(false); | |
| 3259 | 3385 | const isComposingRef = React16.useRef(false); |
| 3260 | 3386 | const currentPointerTypeRef = React16.useRef(""); |
| 3261 | 3387 | const touchStateRef = React16.useRef(null); |
| 3262 | 3388 | const cancelDismissOnEndTimeout = useTimeout(); |
| @@ -3279,9 +3405,9 @@ | ||
| 3279 | 3405 | } |
| 3280 | 3406 | store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); |
| 3281 | 3407 | }); |
| 3282 | 3408 | const closeOnEscapeKeyDown = useStableCallback((event) => { |
| 3283 | - if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { | |
| 3409 | + if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") { | |
| 3284 | 3410 | return; |
| 3285 | 3411 | } |
| 3286 | 3412 | if (isComposingRef.current) { |
| 3287 | 3413 | return; |
| @@ -3303,9 +3429,9 @@ | ||
| 3303 | 3429 | dataRef.current.insideReactTree = true; |
| 3304 | 3430 | clearInsideReactTreeTimeout.start(0, clearInsideReactTree); |
| 3305 | 3431 | }); |
| 3306 | 3432 | const markPressStartedInsideReactTree = useStableCallback((event) => { |
| 3307 | - if (!open || !enabled || event.button !== 0) { | |
| 3433 | + if (!open2 || !enabled || event.button !== 0) { | |
| 3308 | 3434 | return; |
| 3309 | 3435 | } |
| 3310 | 3436 | const target = getTarget(event.nativeEvent); |
| 3311 | 3437 | if (!contains(store2.select("floatingElement"), target)) { |
| @@ -3316,9 +3442,9 @@ | ||
| 3316 | 3442 | pressStartPreventedRef.current = false; |
| 3317 | 3443 | } |
| 3318 | 3444 | }); |
| 3319 | 3445 | const markInsidePressStartPrevented = useStableCallback((event) => { |
| 3320 | - if (!open || !enabled) { | |
| 3446 | + if (!open2 || !enabled) { | |
| 3321 | 3447 | return; |
| 3322 | 3448 | } |
| 3323 | 3449 | if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { |
| 3324 | 3450 | return; |
| @@ -3327,9 +3453,23 @@ | ||
| 3327 | 3453 | pressStartPreventedRef.current = true; |
| 3328 | 3454 | } |
| 3329 | 3455 | }); |
| 3330 | 3456 | React16.useEffect(() => { |
| 3331 | - if (!open || !enabled) { | |
| 3457 | + function handleOpenChange(details) { | |
| 3458 | + if (!details.open) { | |
| 3459 | + sawPressWhileOpenRef.current = false; | |
| 3460 | + } | |
| 3461 | + } | |
| 3462 | + events.on("openchange", handleOpenChange); | |
| 3463 | + return () => { | |
| 3464 | + events.off("openchange", handleOpenChange); | |
| 3465 | + }; | |
| 3466 | + }, [events]); | |
| 3467 | + React16.useEffect(() => { | |
| 3468 | + if (!open2 || !enabled) { | |
| 3469 | + if (!open2) { | |
| 3470 | + sawPressWhileOpenRef.current = false; | |
| 3471 | + } | |
| 3332 | 3472 | return clearInsideReactTree; |
| 3333 | 3473 | } |
| 3334 | 3474 | dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; |
| 3335 | 3475 | dataRef.current.__outsidePressBubbles = outsidePressBubbles; |
| @@ -3334,8 +3474,9 @@ | ||
| 3334 | 3474 | dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; |
| 3335 | 3475 | dataRef.current.__outsidePressBubbles = outsidePressBubbles; |
| 3336 | 3476 | const compositionTimeout = new Timeout(); |
| 3337 | 3477 | const preventedPressSuppressionTimeout = new Timeout(); |
| 3478 | + const doc = ownerDocument(floatingElement); | |
| 3338 | 3479 | function handleCompositionStart() { |
| 3339 | 3480 | compositionTimeout.clear(); |
| 3340 | 3481 | isComposingRef.current = true; |
| 3341 | 3482 | } |
| @@ -3430,12 +3571,17 @@ | ||
| 3430 | 3571 | } |
| 3431 | 3572 | if (isEventWithinFloatingTree(event)) { |
| 3432 | 3573 | return; |
| 3433 | 3574 | } |
| 3434 | - if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { | |
| 3435 | - preventedPressSuppressionTimeout.clear(); | |
| 3436 | - suppressNextOutsideClickRef.current = false; | |
| 3437 | - return; | |
| 3575 | + if (getOutsidePressEvent() === "intentional") { | |
| 3576 | + if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) { | |
| 3577 | + return; | |
| 3578 | + } | |
| 3579 | + if (suppressNextOutsideClickRef.current) { | |
| 3580 | + preventedPressSuppressionTimeout.clear(); | |
| 3581 | + suppressNextOutsideClickRef.current = false; | |
| 3582 | + return; | |
| 3583 | + } | |
| 3438 | 3584 | } |
| 3439 | 3585 | if (typeof outsidePress2 === "function" && !outsidePress2(event)) { |
| 3440 | 3586 | return; |
| 3441 | 3587 | } |
| @@ -3488,8 +3634,11 @@ | ||
| 3488 | 3634 | } |
| 3489 | 3635 | function closeOnPressOutsideCapture(event) { |
| 3490 | 3636 | cancelDismissOnEndTimeout.clear(); |
| 3491 | 3637 | if (event.type === "pointerdown") { |
| 3638 | + if (event.button === 0) { | |
| 3639 | + sawPressWhileOpenRef.current = true; | |
| 3640 | + } | |
| 3492 | 3641 | currentPointerTypeRef.current = event.pointerType; |
| 3493 | 3642 | } |
| 3494 | 3643 | if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { |
| 3495 | 3644 | return; |
| @@ -3502,8 +3651,11 @@ | ||
| 3502 | 3651 | } |
| 3503 | 3652 | }); |
| 3504 | 3653 | } |
| 3505 | 3654 | function handlePressEndCapture(event) { |
| 3655 | + if (event.type === "pointercancel") { | |
| 3656 | + sawPressWhileOpenRef.current = false; | |
| 3657 | + } | |
| 3506 | 3658 | if (!pressStartedInsideRef.current) { |
| 3507 | 3659 | return; |
| 3508 | 3660 | } |
| 3509 | 3661 | const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; |
| @@ -3566,10 +3718,18 @@ | ||
| 3566 | 3718 | } |
| 3567 | 3719 | function handleTouchEndCapture(event) { |
| 3568 | 3720 | addTargetEventListenerOnce(event, handleTouchEnd); |
| 3569 | 3721 | } |
| 3570 | - const doc = ownerDocument(floatingElement); | |
| 3571 | - 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))); | |
| 3722 | + 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, { | |
| 3723 | + capture: true, | |
| 3724 | + passive: true | |
| 3725 | + }), addEventListener(doc, "touchmove", handleTouchMoveCapture, { | |
| 3726 | + capture: true, | |
| 3727 | + passive: true | |
| 3728 | + }), addEventListener(doc, "touchend", handleTouchEndCapture, { | |
| 3729 | + capture: true, | |
| 3730 | + passive: true | |
| 3731 | + }))); | |
| 3572 | 3732 | return () => { |
| 3573 | 3733 | unsubscribe(); |
| 3574 | 3734 | compositionTimeout.clear(); |
| 3575 | 3735 | preventedPressSuppressionTimeout.clear(); |
| @@ -3576,9 +3736,9 @@ | ||
| 3576 | 3736 | resetPressStartState(); |
| 3577 | 3737 | suppressNextOutsideClickRef.current = false; |
| 3578 | 3738 | clearInsideReactTree(); |
| 3579 | 3739 | }; |
| 3580 | - }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); | |
| 3740 | + }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout]); | |
| 3581 | 3741 | const reference = React16.useMemo(() => ({ |
| 3582 | 3742 | onKeyDown: closeOnEscapeKeyDown, |
| 3583 | 3743 | onPointerDown: closeOnReferencePress, |
| 3584 | 3744 | onClick: closeOnReferencePress |
| @@ -4155,27 +4315,27 @@ | ||
| 4155 | 4315 | const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); |
| 4156 | 4316 | const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); |
| 4157 | 4317 | const shiftData = state.middlewareData.shift; |
| 4158 | 4318 | const noShift = !shiftData; |
| 4159 | - let availableHeight = overflowAvailableHeight; | |
| 4160 | - let availableWidth = overflowAvailableWidth; | |
| 4319 | + let availableHeight2 = overflowAvailableHeight; | |
| 4320 | + let availableWidth2 = overflowAvailableWidth; | |
| 4161 | 4321 | if (shiftData != null && shiftData.enabled.x) { |
| 4162 | - availableWidth = maximumClippingWidth; | |
| 4322 | + availableWidth2 = maximumClippingWidth; | |
| 4163 | 4323 | } |
| 4164 | 4324 | if (shiftData != null && shiftData.enabled.y) { |
| 4165 | - availableHeight = maximumClippingHeight; | |
| 4325 | + availableHeight2 = maximumClippingHeight; | |
| 4166 | 4326 | } |
| 4167 | 4327 | if (noShift && !alignment) { |
| 4168 | 4328 | if (isYAxis) { |
| 4169 | - availableWidth = width - 2 * max(overflow.left, overflow.right); | |
| 4329 | + availableWidth2 = width - 2 * max(overflow.left, overflow.right); | |
| 4170 | 4330 | } else { |
| 4171 | - availableHeight = height - 2 * max(overflow.top, overflow.bottom); | |
| 4331 | + availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); | |
| 4172 | 4332 | } |
| 4173 | 4333 | } |
| 4174 | 4334 | await apply({ |
| 4175 | 4335 | ...state, |
| 4176 | - availableWidth, | |
| 4177 | - availableHeight | |
| 4336 | + availableWidth: availableWidth2, | |
| 4337 | + availableHeight: availableHeight2 | |
| 4178 | 4338 | }); |
| 4179 | 4339 | const nextDimensions = await platform3.getDimensions(elements.floating); |
| 4180 | 4340 | if (width !== nextDimensions.width || height !== nextDimensions.height) { |
| 4181 | 4341 | return { |
| @@ -4883,9 +5043,9 @@ | ||
| 4883 | 5043 | floating: externalFloating |
| 4884 | 5044 | } = {}, |
| 4885 | 5045 | transform = true, |
| 4886 | 5046 | whileElementsMounted, |
| 4887 | - open | |
| 5047 | + open: open2 | |
| 4888 | 5048 | } = options; |
| 4889 | 5049 | const [data, setData] = React17.useState({ |
| 4890 | 5050 | x: 0, |
| 4891 | 5051 | y: 0, |
| @@ -4919,9 +5079,9 @@ | ||
| 4919 | 5079 | const dataRef = React17.useRef(data); |
| 4920 | 5080 | const hasWhileElementsMounted = whileElementsMounted != null; |
| 4921 | 5081 | const whileElementsMountedRef = useLatestRef(whileElementsMounted); |
| 4922 | 5082 | const platformRef = useLatestRef(platform3); |
| 4923 | - const openRef = useLatestRef(open); | |
| 5083 | + const openRef = useLatestRef(open2); | |
| 4924 | 5084 | const update2 = React17.useCallback(() => { |
| 4925 | 5085 | if (!referenceRef.current || !floatingRef.current) { |
| 4926 | 5086 | return; |
| 4927 | 5087 | } |
| @@ -4950,9 +5110,9 @@ | ||
| 4950 | 5110 | } |
| 4951 | 5111 | }); |
| 4952 | 5112 | }, [latestMiddleware, placement, strategy, platformRef, openRef]); |
| 4953 | 5113 | index(() => { |
| 4954 | - if (open === false && dataRef.current.isPositioned) { | |
| 5114 | + if (open2 === false && dataRef.current.isPositioned) { | |
| 4955 | 5115 | dataRef.current.isPositioned = false; |
| 4956 | 5116 | setData((data2) => ({ |
| 4957 | 5117 | ...data2, |
| 4958 | 5118 | isPositioned: false |
| @@ -4957,9 +5117,9 @@ | ||
| 4957 | 5117 | ...data2, |
| 4958 | 5118 | isPositioned: false |
| 4959 | 5119 | })); |
| 4960 | 5120 | } |
| 4961 | - }, [open]); | |
| 5121 | + }, [open2]); | |
| 4962 | 5122 | const isMountedRef = React17.useRef(false); |
| 4963 | 5123 | index(() => { |
| 4964 | 5124 | isMountedRef.current = true; |
| 4965 | 5125 | return () => { |
| @@ -5127,10 +5287,10 @@ | ||
| 5127 | 5287 | }; |
| 5128 | 5288 | } |
| 5129 | 5289 | /** |
| 5130 | 5290 | * Points the handle at a root's store and notifies subscribers so detached triggers re-render and |
| 5131 | - * re-register into it (their registration ref re-fires on the store-pointer change). Returns a | |
| 5132 | - * cleanup function that detaches the store again. | |
| 5291 | + * re-register into it (their registration effect migrates them when the store pointer changes). | |
| 5292 | + * Returns a cleanup function that detaches the store again. | |
| 5133 | 5293 | * @internal |
| 5134 | 5294 | */ |
| 5135 | 5295 | attachStore(newStore) { |
| 5136 | 5296 | this.attachedStores.push(newStore); |
| @@ -5372,8 +5532,16 @@ | ||
| 5372 | 5532 | |
| 5373 | 5533 | // node_modules/@base-ui/utils/store/Store.mjs |
| 5374 | 5534 | var Store = class { |
| 5375 | 5535 | /** |
| 5536 | + * Creates a store with the given initial state, constructing the class it is called on. | |
| 5537 | + * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that | |
| 5538 | + * class but degrades the inferred instance type to `Store`; use `new` there instead. | |
| 5539 | + */ | |
| 5540 | + static create(state) { | |
| 5541 | + return new this(state); | |
| 5542 | + } | |
| 5543 | + /** | |
| 5376 | 5544 | * The current state of the store. |
| 5377 | 5545 | * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. |
| 5378 | 5546 | * 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). |
| 5379 | 5547 | * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. |
| @@ -5424,8 +5592,10 @@ | ||
| 5424 | 5592 | } |
| 5425 | 5593 | } |
| 5426 | 5594 | /** |
| 5427 | 5595 | * Merges the provided changes into the current state and notifies listeners if there are changes. |
| 5596 | + * Each value must match its state key. Pass an exact known subset rather than a broad | |
| 5597 | + * `Partial<State>`, which may contain `undefined` for required state fields. | |
| 5428 | 5598 | * |
| 5429 | 5599 | * @param changes An object containing the changes to apply to the current state. |
| 5430 | 5600 | */ |
| 5431 | 5601 | update(changes) { |
| @@ -5519,11 +5689,15 @@ | ||
| 5519 | 5689 | }, [store2, key, value]); |
| 5520 | 5690 | } |
| 5521 | 5691 | /** |
| 5522 | 5692 | * Synchronizes multiple external values into the store. |
| 5693 | + * Each value must match its state key. Pass an exact known subset rather than a broad | |
| 5694 | + * `Partial<State>`, which may contain `undefined` for required state fields. | |
| 5523 | 5695 | * |
| 5524 | 5696 | * Note that the while the values in `state` are updated immediately, the values returned |
| 5525 | 5697 | * by `useState` are updated before the next render (similarly to React's `useState`). |
| 5698 | + * | |
| 5699 | + * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted. | |
| 5526 | 5700 | */ |
| 5527 | 5701 | useSyncedValues(statePart) { |
| 5528 | 5702 | const store2 = this; |
| 5529 | 5703 | if (true) { |
| @@ -5720,9 +5894,9 @@ | ||
| 5720 | 5894 | floatingId, |
| 5721 | 5895 | nested, |
| 5722 | 5896 | onOpenChange |
| 5723 | 5897 | } = options; |
| 5724 | - const open = popupStore.useState("open"); | |
| 5898 | + const open2 = popupStore.useState("open"); | |
| 5725 | 5899 | const referenceElement = popupStore.useState("activeTriggerElement"); |
| 5726 | 5900 | const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); |
| 5727 | 5901 | const triggerElements = popupStore.context.triggerElements; |
| 5728 | 5902 | const handleOpenChange = onOpenChange; |
| @@ -5728,9 +5902,9 @@ | ||
| 5728 | 5902 | const handleOpenChange = onOpenChange; |
| 5729 | 5903 | const internalStoreRef = React21.useRef(null); |
| 5730 | 5904 | if (floatingRootContextProp === void 0 && internalStoreRef.current === null) { |
| 5731 | 5905 | internalStoreRef.current = new FloatingRootStore({ |
| 5732 | - open, | |
| 5906 | + open: open2, | |
| 5733 | 5907 | transitionStatus: void 0, |
| 5734 | 5908 | referenceElement, |
| 5735 | 5909 | floatingElement, |
| 5736 | 5910 | triggerElements, |
| @@ -5743,9 +5917,9 @@ | ||
| 5743 | 5917 | const store2 = floatingRootContextProp ?? internalStoreRef.current; |
| 5744 | 5918 | popupStore.useSyncedValue("floatingId", floatingId); |
| 5745 | 5919 | useIsoLayoutEffect(() => { |
| 5746 | 5920 | const valuesToSync = { |
| 5747 | - open, | |
| 5921 | + open: open2, | |
| 5748 | 5922 | floatingId, |
| 5749 | 5923 | referenceElement, |
| 5750 | 5924 | floatingElement |
| 5751 | 5925 | }; |
| @@ -5755,9 +5929,9 @@ | ||
| 5755 | 5929 | if (store2.state.positionReference === store2.state.referenceElement) { |
| 5756 | 5930 | valuesToSync.positionReference = referenceElement; |
| 5757 | 5931 | } |
| 5758 | 5932 | store2.update(valuesToSync); |
| 5759 | - }, [open, floatingId, referenceElement, floatingElement, store2]); | |
| 5933 | + }, [open2, floatingId, referenceElement, floatingElement, store2]); | |
| 5760 | 5934 | store2.context.onOpenChange = handleOpenChange; |
| 5761 | 5935 | store2.context.nested = nested; |
| 5762 | 5936 | return store2; |
| 5763 | 5937 | } |
| @@ -5789,52 +5963,60 @@ | ||
| 5789 | 5963 | return handle.attachStore(store2); |
| 5790 | 5964 | }, [handle, store2]); |
| 5791 | 5965 | return null; |
| 5792 | 5966 | } |
| 5967 | + function syncTriggerCount(store2) { | |
| 5968 | + const triggerCount = store2.context.triggerElements.size; | |
| 5969 | + if (store2.select("open") && store2.state.triggerCount !== triggerCount) { | |
| 5970 | + store2.set("triggerCount", triggerCount); | |
| 5971 | + } | |
| 5972 | + } | |
| 5793 | 5973 | function useTriggerRegistration(id, store2) { |
| 5794 | - const registeredElementIdRef = React22.useRef(null); | |
| 5795 | - const registeredElementRef = React22.useRef(null); | |
| 5796 | - return React22.useCallback((element) => { | |
| 5797 | - if (id === void 0) { | |
| 5798 | - return; | |
| 5799 | - } | |
| 5800 | - let shouldSyncTriggerCount = false; | |
| 5801 | - if (registeredElementIdRef.current !== null) { | |
| 5802 | - const registeredId = registeredElementIdRef.current; | |
| 5803 | - const registeredElement = registeredElementRef.current; | |
| 5804 | - const currentElement = store2.context.triggerElements.getById(registeredId); | |
| 5805 | - if (registeredElement && currentElement === registeredElement) { | |
| 5806 | - store2.context.triggerElements.delete(registeredId); | |
| 5807 | - shouldSyncTriggerCount = true; | |
| 5974 | + const registrationRef = React22.useRef(null); | |
| 5975 | + return useStableCallback((element) => { | |
| 5976 | + const registration = registrationRef.current; | |
| 5977 | + if (registration !== null) { | |
| 5978 | + if (registration.element === element && registration.store === store2 && registration.id === id) { | |
| 5979 | + return; | |
| 5808 | 5980 | } |
| 5809 | - registeredElementIdRef.current = null; | |
| 5810 | - registeredElementRef.current = null; | |
| 5981 | + registrationRef.current = null; | |
| 5982 | + const registeredStore = registration.store; | |
| 5983 | + if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { | |
| 5984 | + registeredStore.context.triggerElements.delete(registration.id); | |
| 5985 | + syncTriggerCount(registeredStore); | |
| 5986 | + } | |
| 5811 | 5987 | } |
| 5812 | - if (element !== null) { | |
| 5813 | - registeredElementIdRef.current = id; | |
| 5814 | - registeredElementRef.current = element; | |
| 5988 | + if (element !== null && id !== void 0) { | |
| 5989 | + registrationRef.current = { | |
| 5990 | + store: store2, | |
| 5991 | + id, | |
| 5992 | + element | |
| 5993 | + }; | |
| 5815 | 5994 | store2.context.triggerElements.add(id, element); |
| 5816 | - shouldSyncTriggerCount = true; | |
| 5995 | + syncTriggerCount(store2); | |
| 5817 | 5996 | } |
| 5818 | - if (shouldSyncTriggerCount) { | |
| 5819 | - const triggerCount = store2.context.triggerElements.size; | |
| 5820 | - if (store2.select("open") && store2.state.triggerCount !== triggerCount) { | |
| 5821 | - store2.set("triggerCount", triggerCount); | |
| 5822 | - } | |
| 5823 | - } | |
| 5824 | - }, [store2, id]); | |
| 5997 | + }); | |
| 5825 | 5998 | } |
| 5826 | - function setPopupOpenState(state, open, trigger, preventUnmountOnClose = false) { | |
| 5827 | - if (open) { | |
| 5828 | - state.preventUnmountingOnClose = false; | |
| 5999 | + function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) { | |
| 6000 | + let preventUnmountingOnClose = state.preventUnmountingOnClose; | |
| 6001 | + if (open2) { | |
| 6002 | + preventUnmountingOnClose = false; | |
| 5829 | 6003 | } else if (preventUnmountOnClose) { |
| 5830 | - state.preventUnmountingOnClose = true; | |
| 6004 | + preventUnmountingOnClose = true; | |
| 5831 | 6005 | } |
| 5832 | 6006 | const triggerId = trigger?.id ?? null; |
| 5833 | - if (triggerId || open) { | |
| 5834 | - state.activeTriggerId = triggerId; | |
| 5835 | - state.activeTriggerElement = trigger ?? null; | |
| 6007 | + let activeTriggerId = state.activeTriggerId; | |
| 6008 | + let activeTriggerElement = state.activeTriggerElement; | |
| 6009 | + if (triggerId || open2) { | |
| 6010 | + activeTriggerId = triggerId; | |
| 6011 | + activeTriggerElement = trigger ?? null; | |
| 5836 | 6012 | } |
| 6013 | + return { | |
| 6014 | + open: open2, | |
| 6015 | + preventUnmountingOnClose, | |
| 6016 | + activeTriggerId, | |
| 6017 | + activeTriggerElement | |
| 6018 | + }; | |
| 5837 | 6019 | } |
| 5838 | 6020 | function attachPreventUnmountOnClose(eventDetails) { |
| 5839 | 6021 | let preventUnmountOnClose = false; |
| 5840 | 6022 | eventDetails.preventUnmountOnClose = () => { |
| @@ -5854,11 +6036,12 @@ | ||
| 5854 | 6036 | } |
| 5855 | 6037 | options.onBeforeDispatch?.(); |
| 5856 | 6038 | store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); |
| 5857 | 6039 | const changeState = () => { |
| 6040 | + const popupOpenState = createPopupOpenState(store2.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); | |
| 5858 | 6041 | const updatedState = { |
| 5859 | 6042 | ...options.extraState, |
| 5860 | - open: nextOpen | |
| 6043 | + ...popupOpenState | |
| 5861 | 6044 | }; |
| 5862 | 6045 | if (isFocusOpen) { |
| 5863 | 6046 | updatedState.instantType = "focus"; |
| 5864 | 6047 | } else if (isDismissClose) { |
| @@ -5865,9 +6048,8 @@ | ||
| 5865 | 6048 | updatedState.instantType = "dismiss"; |
| 5866 | 6049 | } else if (isHover) { |
| 5867 | 6050 | updatedState.instantType = void 0; |
| 5868 | 6051 | } |
| 5869 | - setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); | |
| 5870 | 6052 | store2.update(updatedState); |
| 5871 | 6053 | }; |
| 5872 | 6054 | if (isHover) { |
| 5873 | 6055 | ReactDOM4.flushSync(changeState); |
| @@ -5878,37 +6060,44 @@ | ||
| 5878 | 6060 | function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) { |
| 5879 | 6061 | const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId); |
| 5880 | 6062 | const baseRegisterTrigger = useTriggerRegistration(triggerId, store2); |
| 5881 | 6063 | const applyTriggerData = useStableCallback((element) => { |
| 5882 | - const open = store2.select("open"); | |
| 6064 | + const open2 = store2.select("open"); | |
| 5883 | 6065 | const activeTriggerId = store2.select("activeTriggerId"); |
| 5884 | 6066 | if (activeTriggerId === triggerId) { |
| 5885 | - store2.update({ | |
| 6067 | + const changes = { | |
| 5886 | 6068 | activeTriggerElement: element, |
| 5887 | - ...open ? stateUpdates : null | |
| 5888 | - }); | |
| 6069 | + ...open2 ? stateUpdates : null | |
| 6070 | + }; | |
| 6071 | + store2.update(changes); | |
| 5889 | 6072 | return; |
| 5890 | 6073 | } |
| 5891 | - if (activeTriggerId == null && open) { | |
| 5892 | - store2.update({ | |
| 5893 | - activeTriggerId: triggerId, | |
| 6074 | + if (activeTriggerId == null && open2) { | |
| 6075 | + const changes = { | |
| 6076 | + activeTriggerId: triggerId ?? null, | |
| 5894 | 6077 | activeTriggerElement: element, |
| 5895 | 6078 | ...stateUpdates |
| 5896 | - }); | |
| 6079 | + }; | |
| 6080 | + store2.update(changes); | |
| 5897 | 6081 | } |
| 5898 | 6082 | }); |
| 5899 | - const registerTrigger = React22.useCallback((element) => { | |
| 6083 | + const registerTrigger = useStableCallback((element) => { | |
| 5900 | 6084 | baseRegisterTrigger(element); |
| 5901 | 6085 | if (element) { |
| 5902 | 6086 | applyTriggerData(element); |
| 5903 | 6087 | } |
| 5904 | - }, [baseRegisterTrigger, applyTriggerData]); | |
| 6088 | + }); | |
| 5905 | 6089 | useIsoLayoutEffect(() => { |
| 6090 | + registerTrigger(triggerElementRef.current); | |
| 6091 | + return () => registerTrigger(null); | |
| 6092 | + }, [registerTrigger, triggerElementRef, store2, triggerId]); | |
| 6093 | + useIsoLayoutEffect(() => { | |
| 5906 | 6094 | if (isMountedByThisTrigger) { |
| 5907 | - store2.update({ | |
| 6095 | + const changes = { | |
| 5908 | 6096 | activeTriggerElement: triggerElementRef.current, |
| 5909 | 6097 | ...stateUpdates |
| 5910 | - }); | |
| 6098 | + }; | |
| 6099 | + store2.update(changes); | |
| 5911 | 6100 | } |
| 5912 | 6101 | }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]); |
| 5913 | 6102 | return { |
| 5914 | 6103 | registerTrigger, |
| @@ -5919,14 +6108,14 @@ | ||
| 5919 | 6108 | const { |
| 5920 | 6109 | closeOnActiveTriggerUnmount = false |
| 5921 | 6110 | } = options; |
| 5922 | 6111 | const resolvedActiveTriggerIdRef = React22.useRef(null); |
| 5923 | - const open = store2.useState("open"); | |
| 6112 | + const open2 = store2.useState("open"); | |
| 5924 | 6113 | const reactiveTriggerCount = store2.useState("triggerCount"); |
| 5925 | 6114 | const activeTriggerId = store2.useState("activeTriggerId"); |
| 5926 | 6115 | const reactiveActiveTriggerElement = store2.useState("activeTriggerElement"); |
| 5927 | 6116 | useIsoLayoutEffect(() => { |
| 5928 | - if (!open) { | |
| 6117 | + if (!open2) { | |
| 5929 | 6118 | resolvedActiveTriggerIdRef.current = null; |
| 5930 | 6119 | if (store2.state.triggerCount !== 0) { |
| 5931 | 6120 | store2.set("triggerCount", 0); |
| 5932 | 6121 | } |
| @@ -5993,18 +6182,18 @@ | ||
| 5993 | 6182 | } |
| 5994 | 6183 | }); |
| 5995 | 6184 | } |
| 5996 | 6185 | } |
| 5997 | - }, [open, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); | |
| 6186 | + }, [open2, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); | |
| 5998 | 6187 | } |
| 5999 | - function useOpenStateTransitions(open, store2, onUnmount) { | |
| 6188 | + function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) { | |
| 6000 | 6189 | const { |
| 6001 | 6190 | mounted, |
| 6002 | 6191 | setMounted, |
| 6003 | 6192 | transitionStatus |
| 6004 | - } = useTransitionStatus(open); | |
| 6193 | + } = useTransitionStatus(open2, false, false, animateInitialOpen); | |
| 6005 | 6194 | const preventUnmountingOnClose = store2.useState("preventUnmountingOnClose"); |
| 6006 | - const syncedPreventUnmountingOnClose = open ? false : preventUnmountingOnClose; | |
| 6195 | + const syncedPreventUnmountingOnClose = open2 ? false : preventUnmountingOnClose; | |
| 6007 | 6196 | store2.useSyncedValues({ |
| 6008 | 6197 | mounted, |
| 6009 | 6198 | transitionStatus, |
| 6010 | 6199 | preventUnmountingOnClose: syncedPreventUnmountingOnClose |
| @@ -6020,13 +6209,13 @@ | ||
| 6020 | 6209 | onUnmount?.(); |
| 6021 | 6210 | store2.context.onOpenChangeComplete?.(false); |
| 6022 | 6211 | }); |
| 6023 | 6212 | useOpenChangeComplete({ |
| 6024 | - enabled: mounted && !open && !syncedPreventUnmountingOnClose, | |
| 6025 | - open, | |
| 6213 | + enabled: mounted && !open2 && !syncedPreventUnmountingOnClose, | |
| 6214 | + open: open2, | |
| 6026 | 6215 | ref: store2.context.popupRef, |
| 6027 | 6216 | onComplete() { |
| 6028 | - if (!open) { | |
| 6217 | + if (!open2) { | |
| 6029 | 6218 | forceUnmount(); |
| 6030 | 6219 | } |
| 6031 | 6220 | } |
| 6032 | 6221 | }); |
| @@ -6140,32 +6329,27 @@ | ||
| 6140 | 6329 | return this.idMap.size; |
| 6141 | 6330 | } |
| 6142 | 6331 | }; |
| 6143 | 6332 | |
| 6144 | - // node_modules/@base-ui/react/floating-ui-react/utils/getEmptyRootContext.mjs | |
| 6145 | - function getEmptyRootContext() { | |
| 6146 | - return new FloatingRootStore({ | |
| 6147 | - open: false, | |
| 6148 | - transitionStatus: void 0, | |
| 6149 | - floatingElement: null, | |
| 6150 | - referenceElement: null, | |
| 6151 | - triggerElements: new PopupTriggerMap(), | |
| 6152 | - floatingId: void 0, | |
| 6153 | - syncOnly: false, | |
| 6154 | - nested: false, | |
| 6155 | - onOpenChange: void 0 | |
| 6156 | - }); | |
| 6157 | - } | |
| 6158 | - | |
| 6159 | 6333 | // node_modules/@base-ui/react/utils/popups/store.mjs |
| 6160 | - function createInitialPopupStoreState() { | |
| 6334 | + function createInitialPopupStoreState(triggerElements, floatingId, nested = false) { | |
| 6161 | 6335 | return { |
| 6162 | 6336 | open: false, |
| 6163 | 6337 | openProp: void 0, |
| 6164 | 6338 | mounted: false, |
| 6165 | 6339 | transitionStatus: void 0, |
| 6166 | - floatingRootContext: getEmptyRootContext(), | |
| 6167 | - floatingId: void 0, | |
| 6340 | + floatingRootContext: new FloatingRootStore({ | |
| 6341 | + open: false, | |
| 6342 | + transitionStatus: void 0, | |
| 6343 | + floatingElement: null, | |
| 6344 | + referenceElement: null, | |
| 6345 | + triggerElements, | |
| 6346 | + floatingId, | |
| 6347 | + syncOnly: true, | |
| 6348 | + nested, | |
| 6349 | + onOpenChange: void 0 | |
| 6350 | + }), | |
| 6351 | + floatingId, | |
| 6168 | 6352 | triggerCount: 0, |
| 6169 | 6353 | preventUnmountingOnClose: false, |
| 6170 | 6354 | payload: void 0, |
| 6171 | 6355 | activeTriggerId: null, |
| @@ -6177,21 +6361,8 @@ | ||
| 6177 | 6361 | inactiveTriggerProps: EMPTY_OBJECT, |
| 6178 | 6362 | popupProps: EMPTY_OBJECT |
| 6179 | 6363 | }; |
| 6180 | 6364 | } |
| 6181 | - function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) { | |
| 6182 | - return new FloatingRootStore({ | |
| 6183 | - open: false, | |
| 6184 | - transitionStatus: void 0, | |
| 6185 | - floatingElement: null, | |
| 6186 | - referenceElement: null, | |
| 6187 | - triggerElements, | |
| 6188 | - floatingId, | |
| 6189 | - syncOnly: true, | |
| 6190 | - nested, | |
| 6191 | - onOpenChange: void 0 | |
| 6192 | - }); | |
| 6193 | - } | |
| 6194 | 6365 | var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; |
| 6195 | 6366 | var openSelector = (state) => state.openProp ?? state.open; |
| 6196 | 6367 | var popupIdSelector = (state) => { |
| 6197 | 6368 | const popupId = state.popupElement?.id ?? state.floatingId; |
| @@ -6266,9 +6437,9 @@ | ||
| 6266 | 6437 | } = options; |
| 6267 | 6438 | const referenceElement = store2.useState("referenceElement"); |
| 6268 | 6439 | const floatingElement = store2.useState("floatingElement"); |
| 6269 | 6440 | const domReferenceElement = store2.useState("domReferenceElement"); |
| 6270 | - const open = store2.useState("open"); | |
| 6441 | + const open2 = store2.useState("open"); | |
| 6271 | 6442 | const floatingId = store2.useState("floatingId"); |
| 6272 | 6443 | const [positionReference, setPositionReferenceRaw] = React24.useState(null); |
| 6273 | 6444 | const [localDomReference, setLocalDomReference] = React24.useState(void 0); |
| 6274 | 6445 | const [localFloatingElement, setLocalFloatingElement] = React24.useState(void 0); |
| @@ -6331,9 +6502,9 @@ | ||
| 6331 | 6502 | }), [position.elements, domReferenceElement]); |
| 6332 | 6503 | const context = React24.useMemo(() => ({ |
| 6333 | 6504 | ...position, |
| 6334 | 6505 | dataRef: store2.context.dataRef, |
| 6335 | - open, | |
| 6506 | + open: open2, | |
| 6336 | 6507 | onOpenChange: store2.setOpen, |
| 6337 | 6508 | events: store2.context.events, |
| 6338 | 6509 | floatingId, |
| 6339 | 6510 | refs, |
| @@ -6339,9 +6510,9 @@ | ||
| 6339 | 6510 | refs, |
| 6340 | 6511 | elements, |
| 6341 | 6512 | nodeId, |
| 6342 | 6513 | rootStore: store2 |
| 6343 | - }), [position, refs, elements, nodeId, store2, open, floatingId]); | |
| 6514 | + }), [position, refs, elements, nodeId, store2, open2, floatingId]); | |
| 6344 | 6515 | useIsoLayoutEffect(() => { |
| 6345 | 6516 | if (domReferenceElement) { |
| 6346 | 6517 | domReferenceRef.current = domReferenceElement; |
| 6347 | 6518 | } |
| @@ -6388,8 +6559,9 @@ | ||
| 6388 | 6559 | function onBlur() { |
| 6389 | 6560 | const currentDomReference = store2.select("domReferenceElement"); |
| 6390 | 6561 | if (!store2.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { |
| 6391 | 6562 | blockFocusRef.current = true; |
| 6563 | + blockedReferenceRef.current = currentDomReference; | |
| 6392 | 6564 | } |
| 6393 | 6565 | } |
| 6394 | 6566 | function onKeyDown() { |
| 6395 | 6567 | keyboardModalityRef.current = true; |
| @@ -6574,9 +6746,9 @@ | ||
| 6574 | 6746 | closeDelay: closeDelayProp = 0, |
| 6575 | 6747 | nodeId: nodeIdProp |
| 6576 | 6748 | } = parameters; |
| 6577 | 6749 | const store2 = "rootStore" in context ? context.rootStore : context; |
| 6578 | - const open = store2.useState("open"); | |
| 6750 | + const open2 = store2.useState("open"); | |
| 6579 | 6751 | const floatingElement = store2.useState("floatingElement"); |
| 6580 | 6752 | const domReferenceElement = store2.useState("domReferenceElement"); |
| 6581 | 6753 | const { |
| 6582 | 6754 | dataRef |
| @@ -6594,15 +6766,15 @@ | ||
| 6594 | 6766 | const clearPointerEvents = useStableCallback(() => { |
| 6595 | 6767 | clearSafePolygonPointerEventsMutation(instance); |
| 6596 | 6768 | }); |
| 6597 | 6769 | useIsoLayoutEffect(() => { |
| 6598 | - if (!open) { | |
| 6770 | + if (!open2) { | |
| 6599 | 6771 | instance.pointerType = void 0; |
| 6600 | 6772 | instance.restTimeoutPending = false; |
| 6601 | 6773 | instance.interactedInside = false; |
| 6602 | 6774 | clearPointerEvents(); |
| 6603 | 6775 | } |
| 6604 | - }, [open, instance, clearPointerEvents]); | |
| 6776 | + }, [open2, instance, clearPointerEvents]); | |
| 6605 | 6777 | React26.useEffect(() => { |
| 6606 | 6778 | return clearPointerEvents; |
| 6607 | 6779 | }, [clearPointerEvents]); |
| 6608 | 6780 | useIsoLayoutEffect(() => { |
| @@ -6608,9 +6780,9 @@ | ||
| 6608 | 6780 | useIsoLayoutEffect(() => { |
| 6609 | 6781 | if (!enabled) { |
| 6610 | 6782 | return void 0; |
| 6611 | 6783 | } |
| 6612 | - if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { | |
| 6784 | + if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { | |
| 6613 | 6785 | const ref = domReferenceElement; |
| 6614 | 6786 | const floatingEl = floatingElement; |
| 6615 | 6787 | const doc = ownerDocument(floatingElement); |
| 6616 | 6788 | const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; |
| @@ -6629,9 +6801,9 @@ | ||
| 6629 | 6801 | clearPointerEvents(); |
| 6630 | 6802 | }; |
| 6631 | 6803 | } |
| 6632 | 6804 | return void 0; |
| 6633 | - }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); | |
| 6805 | + }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); | |
| 6634 | 6806 | React26.useEffect(() => { |
| 6635 | 6807 | if (!enabled) { |
| 6636 | 6808 | return void 0; |
| 6637 | 6809 | } |
| @@ -6769,9 +6941,9 @@ | ||
| 6769 | 6941 | const clearPointerEvents = useStableCallback(() => { |
| 6770 | 6942 | clearSafePolygonPointerEventsMutation(instance); |
| 6771 | 6943 | }); |
| 6772 | 6944 | if (isActiveTrigger) { |
| 6773 | - instance.handleCloseOptions = handleCloseRef.current?.__options; | |
| 6945 | + instance.handleCloseOptions = handleClose?.__options; | |
| 6774 | 6946 | } |
| 6775 | 6947 | React27.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); |
| 6776 | 6948 | React27.useEffect(() => { |
| 6777 | 6949 | if (!enabled) { |
| @@ -7219,58 +7391,8 @@ | ||
| 7219 | 7391 | notifyAll() { |
| 7220 | 7392 | } |
| 7221 | 7393 | }; |
| 7222 | 7394 | |
| 7223 | - // node_modules/@base-ui/react/utils/popupStateMapping.mjs | |
| 7224 | - var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { | |
| 7225 | - CommonPopupDataAttributes2["open"] = "data-open"; | |
| 7226 | - CommonPopupDataAttributes2["closed"] = "data-closed"; | |
| 7227 | - CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; | |
| 7228 | - CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; | |
| 7229 | - CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; | |
| 7230 | - CommonPopupDataAttributes2["side"] = "data-side"; | |
| 7231 | - CommonPopupDataAttributes2["align"] = "data-align"; | |
| 7232 | - return CommonPopupDataAttributes2; | |
| 7233 | - })({}); | |
| 7234 | - var TRIGGER_HOOK = { | |
| 7235 | - "data-popup-open": "" | |
| 7236 | - }; | |
| 7237 | - var POPUP_OPEN_HOOK = { | |
| 7238 | - "data-open": "" | |
| 7239 | - }; | |
| 7240 | - var POPUP_CLOSED_HOOK = { | |
| 7241 | - "data-closed": "" | |
| 7242 | - }; | |
| 7243 | - var ANCHOR_HIDDEN_HOOK = { | |
| 7244 | - "data-anchor-hidden": "" | |
| 7245 | - }; | |
| 7246 | - var triggerOpenStateMapping = { | |
| 7247 | - open(value) { | |
| 7248 | - if (value) { | |
| 7249 | - return TRIGGER_HOOK; | |
| 7250 | - } | |
| 7251 | - return null; | |
| 7252 | - } | |
| 7253 | - }; | |
| 7254 | - var popupStateMapping = { | |
| 7255 | - open(value) { | |
| 7256 | - if (value) { | |
| 7257 | - return POPUP_OPEN_HOOK; | |
| 7258 | - } | |
| 7259 | - return POPUP_CLOSED_HOOK; | |
| 7260 | - }, | |
| 7261 | - anchorHidden(value) { | |
| 7262 | - if (value) { | |
| 7263 | - return ANCHOR_HIDDEN_HOOK; | |
| 7264 | - } | |
| 7265 | - return null; | |
| 7266 | - } | |
| 7267 | - }; | |
| 7268 | - var popupTransitionStateMapping = { | |
| 7269 | - ...popupStateMapping, | |
| 7270 | - ...transitionStatusMapping | |
| 7271 | - }; | |
| 7272 | - | |
| 7273 | 7395 | // node_modules/@base-ui/utils/inertValue.mjs |
| 7274 | 7396 | function inertValue(value) { |
| 7275 | 7397 | if (isReactVersionAtLeast(19)) { |
| 7276 | 7398 | return value; |
| @@ -7353,12 +7475,19 @@ | ||
| 7353 | 7475 | reset: shouldAddOffset |
| 7354 | 7476 | }; |
| 7355 | 7477 | } |
| 7356 | 7478 | }); |
| 7357 | - var arrow4 = (options, deps) => ({ | |
| 7358 | - ...baseArrow(options), | |
| 7359 | - options: [options, deps] | |
| 7360 | - }); | |
| 7479 | + var arrow4 = (options, deps) => { | |
| 7480 | + const { | |
| 7481 | + name, | |
| 7482 | + fn | |
| 7483 | + } = baseArrow(options); | |
| 7484 | + return { | |
| 7485 | + name, | |
| 7486 | + fn, | |
| 7487 | + options: [options, deps] | |
| 7488 | + }; | |
| 7489 | + }; | |
| 7361 | 7490 | |
| 7362 | 7491 | // node_modules/@base-ui/react/utils/hideMiddleware.mjs |
| 7363 | 7492 | var hide4 = { |
| 7364 | 7493 | name: "hide", |
| @@ -7368,9 +7497,9 @@ | ||
| 7368 | 7497 | height, |
| 7369 | 7498 | x, |
| 7370 | 7499 | y |
| 7371 | 7500 | } = state.rects.reference; |
| 7372 | - const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0; | |
| 7501 | + const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0; | |
| 7373 | 7502 | const overflow = await state.platform.detectOverflow(state, { |
| 7374 | 7503 | elementContext: "reference" |
| 7375 | 7504 | }); |
| 7376 | 7505 | const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; |
| @@ -7375,9 +7504,9 @@ | ||
| 7375 | 7504 | }); |
| 7376 | 7505 | const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; |
| 7377 | 7506 | return { |
| 7378 | 7507 | data: { |
| 7379 | - referenceHidden: referenceHidden || anchorHidden | |
| 7508 | + referenceHidden: referenceHidden || anchorHidden2 | |
| 7380 | 7509 | } |
| 7381 | 7510 | }; |
| 7382 | 7511 | } |
| 7383 | 7512 | }; |
| @@ -7387,11 +7516,20 @@ | ||
| 7387 | 7516 | sideX: "left", |
| 7388 | 7517 | sideY: "top" |
| 7389 | 7518 | }; |
| 7390 | 7519 | |
| 7520 | + // node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs | |
| 7521 | + var availableWidth = "--available-width"; | |
| 7522 | + var availableHeight = "--available-height"; | |
| 7523 | + var anchorWidth = "--anchor-width"; | |
| 7524 | + var anchorHeight = "--anchor-height"; | |
| 7525 | + var transformOrigin = "--transform-origin"; | |
| 7526 | + var positionerWidth = "--positioner-width"; | |
| 7527 | + var positionerHeight = "--positioner-height"; | |
| 7528 | + | |
| 7391 | 7529 | // node_modules/@base-ui/react/internals/useAnchorPositioning.mjs |
| 7392 | - var AVAILABLE_WIDTH_VAR = "--available-width"; | |
| 7393 | - var AVAILABLE_HEIGHT_VAR = "--available-height"; | |
| 7530 | + var AVAILABLE_WIDTH_VAR = availableWidth; | |
| 7531 | + var AVAILABLE_HEIGHT_VAR = availableHeight; | |
| 7394 | 7532 | function getLogicalSide(sideParam, renderedSide, isRtl) { |
| 7395 | 7533 | const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; |
| 7396 | 7534 | const logicalRight = isRtl ? "inline-start" : "inline-end"; |
| 7397 | 7535 | const logicalLeft = isRtl ? "inline-end" : "inline-start"; |
| @@ -7567,10 +7705,10 @@ | ||
| 7567 | 7705 | apply({ |
| 7568 | 7706 | elements: { |
| 7569 | 7707 | floating |
| 7570 | 7708 | }, |
| 7571 | - availableWidth, | |
| 7572 | - availableHeight, | |
| 7709 | + availableWidth: availableWidth2, | |
| 7710 | + availableHeight: availableHeight2, | |
| 7573 | 7711 | rects |
| 7574 | 7712 | }) { |
| 7575 | 7713 | if (!mountedRef.current) { |
| 7576 | 7714 | return; |
| @@ -7575,10 +7713,10 @@ | ||
| 7575 | 7713 | if (!mountedRef.current) { |
| 7576 | 7714 | return; |
| 7577 | 7715 | } |
| 7578 | 7716 | const floatingStyle = floating.style; |
| 7579 | - floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth}px`); | |
| 7580 | - floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight}px`); | |
| 7717 | + floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `${availableWidth2}px`); | |
| 7718 | + floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `${availableHeight2}px`); | |
| 7581 | 7719 | const dpr = getWindow(floating).devicePixelRatio || 1; |
| 7582 | 7720 | const { |
| 7583 | 7721 | x: x2, |
| 7584 | 7722 | y: y2, |
| @@ -7584,50 +7722,51 @@ | ||
| 7584 | 7722 | y: y2, |
| 7585 | 7723 | width, |
| 7586 | 7724 | height |
| 7587 | 7725 | } = rects.reference; |
| 7588 | - const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; | |
| 7589 | - const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; | |
| 7590 | - floatingStyle.setProperty("--anchor-width", `${anchorWidth}px`); | |
| 7591 | - floatingStyle.setProperty("--anchor-height", `${anchorHeight}px`); | |
| 7726 | + const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; | |
| 7727 | + const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; | |
| 7728 | + floatingStyle.setProperty(anchorWidth, `${anchorWidth2}px`); | |
| 7729 | + floatingStyle.setProperty(anchorHeight, `${anchorHeight2}px`); | |
| 7592 | 7730 | } |
| 7593 | 7731 | }), arrow4((state) => ({ |
| 7594 | 7732 | // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, |
| 7595 | 7733 | // we'll create a fake element. |
| 7596 | 7734 | element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), |
| 7597 | - padding: arrowPadding, | |
| 7735 | + // No padding for the fake arrow: it would displace aligned popups on narrow anchors. | |
| 7736 | + padding: arrowRef.current ? arrowPadding : 0, | |
| 7598 | 7737 | offsetParent: "floating" |
| 7599 | 7738 | }), [arrowPadding]), { |
| 7600 | 7739 | name: "transformOrigin", |
| 7601 | 7740 | fn(state) { |
| 7602 | 7741 | const { |
| 7603 | - elements: elements2, | |
| 7742 | + elements: { | |
| 7743 | + floating | |
| 7744 | + }, | |
| 7604 | 7745 | middlewareData: middlewareData2, |
| 7605 | 7746 | placement: renderedPlacement2, |
| 7747 | + platform: platform3, | |
| 7606 | 7748 | rects, |
| 7607 | 7749 | y: y2 |
| 7608 | 7750 | } = state; |
| 7609 | - const currentRenderedSide = getSide(renderedPlacement2); | |
| 7610 | - const currentRenderedAxis = getSideAxis(currentRenderedSide); | |
| 7751 | + const renderedSide2 = getSide(renderedPlacement2); | |
| 7752 | + const renderedAlign2 = getAlignment(renderedPlacement2); | |
| 7753 | + const isVertical = getSideAxis(renderedSide2) === "y"; | |
| 7611 | 7754 | const arrowEl = arrowRef.current; |
| 7612 | - const arrowX = middlewareData2.arrow?.x || 0; | |
| 7613 | - const arrowY = middlewareData2.arrow?.y || 0; | |
| 7614 | - const arrowWidth = arrowEl?.clientWidth || 0; | |
| 7615 | - const arrowHeight = arrowEl?.clientHeight || 0; | |
| 7616 | - const transformX = arrowX + arrowWidth / 2; | |
| 7617 | - const transformY = arrowY + arrowHeight / 2; | |
| 7618 | - const shiftY = Math.abs(middlewareData2.shift?.y || 0); | |
| 7619 | - const halfAnchorHeight = rects.reference.height / 2; | |
| 7620 | 7755 | const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; |
| 7621 | - const isOverlappingAnchor = shiftY > sideOffsetValue; | |
| 7622 | - const adjacentTransformOrigin = { | |
| 7623 | - top: `${transformX}px calc(100% + ${sideOffsetValue}px)`, | |
| 7624 | - bottom: `${transformX}px ${-sideOffsetValue}px`, | |
| 7625 | - left: `calc(100% + ${sideOffsetValue}px) ${transformY}px`, | |
| 7626 | - right: `${-sideOffsetValue}px ${transformY}px` | |
| 7627 | - }[currentRenderedSide]; | |
| 7628 | - const overlapTransformOrigin = `${transformX}px ${rects.reference.y + halfAnchorHeight - y2}px`; | |
| 7629 | - elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); | |
| 7756 | + let crossOrigin; | |
| 7757 | + if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) { | |
| 7758 | + crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%"; | |
| 7759 | + } else { | |
| 7760 | + const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0; | |
| 7761 | + const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0; | |
| 7762 | + crossOrigin = `${arrowOffset + arrowSize / 2}px`; | |
| 7763 | + } | |
| 7764 | + let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + ${sideOffsetValue}px)` : `${-sideOffsetValue}px`; | |
| 7765 | + if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) { | |
| 7766 | + sideOrigin = `${rects.reference.y + rects.reference.height / 2 - y2}px`; | |
| 7767 | + } | |
| 7768 | + floating.style.setProperty(transformOrigin, isVertical ? `${crossOrigin} ${sideOrigin}` : `${sideOrigin} ${crossOrigin}`); | |
| 7630 | 7769 | return {}; |
| 7631 | 7770 | } |
| 7632 | 7771 | }, hide4, adaptiveOrigin2); |
| 7633 | 7772 | useIsoLayoutEffect(() => { |
| @@ -7640,8 +7779,9 @@ | ||
| 7640 | 7779 | }); |
| 7641 | 7780 | } |
| 7642 | 7781 | }, [mounted, floatingRootContext]); |
| 7643 | 7782 | const autoUpdateOptions = React29.useMemo(() => ({ |
| 7783 | + ancestorScroll: !disableAnchorTracking, | |
| 7644 | 7784 | elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", |
| 7645 | 7785 | layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" |
| 7646 | 7786 | }), [disableAnchorTracking]); |
| 7647 | 7787 | const { |
| @@ -7732,9 +7872,9 @@ | ||
| 7732 | 7872 | }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); |
| 7733 | 7873 | const renderedSide = getSide(renderedPlacement); |
| 7734 | 7874 | const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); |
| 7735 | 7875 | const renderedAlign = getAlignment(renderedPlacement) || "center"; |
| 7736 | - const anchorHidden = Boolean(middlewareData.hide?.referenceHidden); | |
| 7876 | + const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden); | |
| 7737 | 7877 | useIsoLayoutEffect(() => { |
| 7738 | 7878 | if (lazyFlip && mounted && isPositioned && renderedSide !== side) { |
| 7739 | 7879 | setMountSide(renderedSide); |
| 7740 | 7880 | } |
| @@ -7752,14 +7892,14 @@ | ||
| 7752 | 7892 | arrowUncentered, |
| 7753 | 7893 | side: logicalRenderedSide, |
| 7754 | 7894 | align: renderedAlign, |
| 7755 | 7895 | physicalSide: renderedSide, |
| 7756 | - anchorHidden, | |
| 7896 | + anchorHidden: anchorHidden2, | |
| 7757 | 7897 | refs, |
| 7758 | 7898 | context, |
| 7759 | 7899 | isPositioned, |
| 7760 | 7900 | update: update2 |
| 7761 | - }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); | |
| 7901 | + }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]); | |
| 7762 | 7902 | } |
| 7763 | 7903 | function isRef(param) { |
| 7764 | 7904 | return param != null && "current" in param; |
| 7765 | 7905 | } |
| @@ -7837,8 +7977,12 @@ | ||
| 7837 | 7977 | height |
| 7838 | 7978 | }; |
| 7839 | 7979 | } |
| 7840 | 7980 | |
| 7981 | + // node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs | |
| 7982 | + var popupWidth = "--popup-width"; | |
| 7983 | + var popupHeight = "--popup-height"; | |
| 7984 | + | |
| 7841 | 7985 | // node_modules/@base-ui/react/utils/usePopupAutoResize.mjs |
| 7842 | 7986 | function usePopupAutoResize(parameters) { |
| 7843 | 7987 | const { |
| 7844 | 7988 | popupElement, |
| @@ -7873,10 +8017,10 @@ | ||
| 7873 | 8017 | const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); |
| 7874 | 8018 | const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); |
| 7875 | 8019 | const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); |
| 7876 | 8020 | const restorePositionerAvailableSize = applyElementStyles(positionerElement, { |
| 7877 | - "--available-width": "max-content", | |
| 7878 | - "--available-height": "max-content" | |
| 8021 | + [availableWidth]: "max-content", | |
| 8022 | + [availableHeight]: "max-content" | |
| 7879 | 8023 | }); |
| 7880 | 8024 | function restoreMeasurementOverrides() { |
| 7881 | 8025 | restorePopupPosition(); |
| 7882 | 8026 | restorePopupTransform(); |
| @@ -7911,10 +8055,10 @@ | ||
| 7911 | 8055 | const abortController = new AbortController(); |
| 7912 | 8056 | animationFrame.request(() => { |
| 7913 | 8057 | setPopupCssSize(popupElement, newDimensions); |
| 7914 | 8058 | runOnceAnimationsFinish(() => { |
| 7915 | - popupElement.style.setProperty("--popup-width", "auto"); | |
| 7916 | - popupElement.style.setProperty("--popup-height", "auto"); | |
| 8059 | + popupElement.style.setProperty(popupWidth, "auto"); | |
| 8060 | + popupElement.style.setProperty(popupHeight, "auto"); | |
| 7917 | 8061 | }, abortController.signal); |
| 7918 | 8062 | }); |
| 7919 | 8063 | return () => { |
| 7920 | 8064 | abortController.abort(); |
| @@ -7954,16 +8098,16 @@ | ||
| 7954 | 8098 | } |
| 7955 | 8099 | function setPopupCssSize(popupElement, size4) { |
| 7956 | 8100 | const width = size4 === "auto" ? "auto" : `${size4.width}px`; |
| 7957 | 8101 | const height = size4 === "auto" ? "auto" : `${size4.height}px`; |
| 7958 | - popupElement.style.setProperty("--popup-width", width); | |
| 7959 | - popupElement.style.setProperty("--popup-height", height); | |
| 8102 | + popupElement.style.setProperty(popupWidth, width); | |
| 8103 | + popupElement.style.setProperty(popupHeight, height); | |
| 7960 | 8104 | } |
| 7961 | 8105 | function setPositionerCssSize(positionerElement, size4) { |
| 7962 | 8106 | const width = size4 === "max-content" ? "max-content" : `${size4.width}px`; |
| 7963 | 8107 | const height = size4 === "max-content" ? "max-content" : `${size4.height}px`; |
| 7964 | - positionerElement.style.setProperty("--positioner-width", width); | |
| 7965 | - positionerElement.style.setProperty("--positioner-height", height); | |
| 8108 | + positionerElement.style.setProperty(positionerWidth, width); | |
| 8109 | + positionerElement.style.setProperty(positionerHeight, height); | |
| 7966 | 8110 | } |
| 7967 | 8111 | |
| 7968 | 8112 | // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs |
| 7969 | 8113 | var React32 = __toESM(require_react(), 1); |
| @@ -8049,13 +8193,16 @@ | ||
| 8049 | 8193 | }; |
| 8050 | 8194 | } |
| 8051 | 8195 | }; |
| 8052 | 8196 | |
| 8197 | + // node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs | |
| 8198 | + var activationDirection = "data-activation-direction"; | |
| 8199 | + | |
| 8053 | 8200 | // node_modules/@base-ui/react/utils/usePopupViewport.mjs |
| 8054 | 8201 | var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); |
| 8055 | 8202 | var popupViewportStateMapping = { |
| 8056 | 8203 | activationDirection: (value) => value ? { |
| 8057 | - "data-activation-direction": value | |
| 8204 | + [activationDirection]: value | |
| 8058 | 8205 | } : null |
| 8059 | 8206 | }; |
| 8060 | 8207 | function usePopupViewport(parameters) { |
| 8061 | 8208 | const { |
| @@ -8065,14 +8212,14 @@ | ||
| 8065 | 8212 | } = parameters; |
| 8066 | 8213 | const direction = useDirection(); |
| 8067 | 8214 | const activeTrigger = store2.useState("activeTriggerElement"); |
| 8068 | 8215 | const activeTriggerId = store2.useState("activeTriggerId"); |
| 8069 | - const open = store2.useState("open"); | |
| 8216 | + const open2 = store2.useState("open"); | |
| 8070 | 8217 | const payload = store2.useState("payload"); |
| 8071 | 8218 | const mounted = store2.useState("mounted"); |
| 8072 | 8219 | const popupElement = store2.useState("popupElement"); |
| 8073 | 8220 | const positionerElement = store2.useState("positionerElement"); |
| 8074 | - const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null); | |
| 8221 | + const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null); | |
| 8075 | 8222 | const currentContentKey = usePopupContentKey(activeTriggerId, payload); |
| 8076 | 8223 | const capturedNodeRef = React33.useRef(null); |
| 8077 | 8224 | const [previousContentNode, setPreviousContentNode] = React33.useState(null); |
| 8078 | 8225 | const [newTriggerOffset, setNewTriggerOffset] = React33.useState(null); |
| @@ -8113,12 +8260,12 @@ | ||
| 8113 | 8260 | }, controller.signal); |
| 8114 | 8261 | }); |
| 8115 | 8262 | const lastHandledTriggerRef = React33.useRef(null); |
| 8116 | 8263 | useIsoLayoutEffect(() => { |
| 8117 | - if (!open || !mounted) { | |
| 8264 | + if (!open2 || !mounted) { | |
| 8118 | 8265 | lastHandledTriggerRef.current = null; |
| 8119 | 8266 | } |
| 8120 | - }, [open, mounted]); | |
| 8267 | + }, [open2, mounted]); | |
| 8121 | 8268 | useIsoLayoutEffect(() => { |
| 8122 | 8269 | if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { |
| 8123 | 8270 | setPreviousContentNode(capturedNodeRef.current); |
| 8124 | 8271 | setShowStartingStyleAttribute(true); |
| @@ -8166,10 +8313,10 @@ | ||
| 8166 | 8313 | inert: inertValue(true), |
| 8167 | 8314 | ref: previousContainerRef, |
| 8168 | 8315 | style: { |
| 8169 | 8316 | ...previousContentDimensions ? { |
| 8170 | - "--popup-width": `${previousContentDimensions.width}px`, | |
| 8171 | - "--popup-height": `${previousContentDimensions.height}px` | |
| 8317 | + [popupWidth]: `${previousContentDimensions.width}px`, | |
| 8318 | + [popupHeight]: `${previousContentDimensions.height}px` | |
| 8172 | 8319 | } : null, |
| 8173 | 8320 | position: "absolute" |
| 8174 | 8321 | }, |
| 8175 | 8322 | "data-ending-style": showStartingStyleAttribute ? void 0 : "" |
| @@ -8362,9 +8509,9 @@ | ||
| 8362 | 8509 | }); |
| 8363 | 8510 | } |
| 8364 | 8511 | function createInitialState(initialState, triggerElements, floatingId, nested = false) { |
| 8365 | 8512 | const state = { |
| 8366 | - ...createInitialPopupStoreState(), | |
| 8513 | + ...createInitialPopupStoreState(triggerElements, floatingId, nested), | |
| 8367 | 8514 | disabled: false, |
| 8368 | 8515 | instantType: void 0, |
| 8369 | 8516 | isInstantPhase: false, |
| 8370 | 8517 | trackCursorAxis: "none", |
| @@ -8374,9 +8521,8 @@ | ||
| 8374 | 8521 | closeDelay: 0, |
| 8375 | 8522 | adaptiveOrigin: void 0, |
| 8376 | 8523 | ...initialState |
| 8377 | 8524 | }; |
| 8378 | - state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested); | |
| 8379 | 8525 | return state; |
| 8380 | 8526 | } |
| 8381 | 8527 | function createInitialContext(triggerElements) { |
| 8382 | 8528 | return { |
| @@ -8414,9 +8560,9 @@ | ||
| 8414 | 8560 | store2.useControlledProp("triggerIdProp", triggerIdProp); |
| 8415 | 8561 | store2.useContextCallback("onOpenChange", onOpenChange); |
| 8416 | 8562 | store2.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); |
| 8417 | 8563 | const openState = store2.useState("open"); |
| 8418 | - const open = !disabled2 && openState; | |
| 8564 | + const open2 = !disabled2 && openState; | |
| 8419 | 8565 | const activeTriggerId = store2.useState("activeTriggerId"); |
| 8420 | 8566 | const mounted = store2.useState("mounted"); |
| 8421 | 8567 | const payload = store2.useState("payload"); |
| 8422 | 8568 | store2.useSyncedValues({ |
| @@ -8429,9 +8575,9 @@ | ||
| 8429 | 8575 | }); |
| 8430 | 8576 | const { |
| 8431 | 8577 | forceUnmount, |
| 8432 | 8578 | transitionStatus |
| 8433 | - } = useOpenStateTransitions(open, store2); | |
| 8579 | + } = useOpenStateTransitions(open2, store2); | |
| 8434 | 8580 | const isInstantPhase = store2.useState("isInstantPhase"); |
| 8435 | 8581 | const instantType = store2.useState("instantType"); |
| 8436 | 8582 | const lastOpenChangeReason = store2.useState("lastOpenChangeReason"); |
| 8437 | 8583 | const previousInstantTypeRef = React37.useRef(null); |
| @@ -8451,19 +8597,19 @@ | ||
| 8451 | 8597 | previousInstantTypeRef.current = null; |
| 8452 | 8598 | } |
| 8453 | 8599 | }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store2]); |
| 8454 | 8600 | useIsoLayoutEffect(() => { |
| 8455 | - if (open) { | |
| 8601 | + if (open2) { | |
| 8456 | 8602 | if (activeTriggerId == null) { |
| 8457 | 8603 | store2.set("payload", void 0); |
| 8458 | 8604 | } |
| 8459 | 8605 | } |
| 8460 | - }, [store2, activeTriggerId, open]); | |
| 8606 | + }, [store2, activeTriggerId, open2]); | |
| 8461 | 8607 | React37.useImperativeHandle(actionsRef, () => ({ |
| 8462 | 8608 | unmount: forceUnmount, |
| 8463 | 8609 | close: () => store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) |
| 8464 | 8610 | }), [forceUnmount, store2]); |
| 8465 | - const shouldRenderInteractions = open || mounted || !disabled2 && trackCursorAxis !== "none"; | |
| 8611 | + const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none"; | |
| 8466 | 8612 | return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(TooltipRootContext.Provider, { |
| 8467 | 8613 | value: store2, |
| 8468 | 8614 | children: [handle && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(PopupHandleAttachment, { |
| 8469 | 8615 | handle, |
| @@ -8569,9 +8715,8 @@ | ||
| 8569 | 8715 | const isTriggerActive = store2.useState("isTriggerActive", thisTriggerId); |
| 8570 | 8716 | const isOpenedByThisTrigger = store2.useState("isOpenedByTrigger", thisTriggerId); |
| 8571 | 8717 | const floatingRootContext = store2.useState("floatingRootContext"); |
| 8572 | 8718 | const triggerElementRef = React39.useRef(null); |
| 8573 | - const delayWithDefault = delay ?? OPEN_DELAY; | |
| 8574 | 8719 | const closeDelayWithDefault = closeDelay ?? 0; |
| 8575 | 8720 | const { |
| 8576 | 8721 | registerTrigger, |
| 8577 | 8722 | isMountedByThisTrigger |
| @@ -8581,8 +8726,9 @@ | ||
| 8581 | 8726 | closeDelay: closeDelayWithDefault |
| 8582 | 8727 | }); |
| 8583 | 8728 | const providerDelay = useTooltipProviderContext(); |
| 8584 | 8729 | const { |
| 8730 | + activeIdRef, | |
| 8585 | 8731 | delayRef, |
| 8586 | 8732 | isInstantPhase, |
| 8587 | 8733 | hasProvider |
| 8588 | 8734 | } = useDelayGroup(floatingRootContext, { |
| @@ -8598,12 +8744,12 @@ | ||
| 8598 | 8744 | const isNestedTriggerHoveredRef = React39.useRef(false); |
| 8599 | 8745 | const nestedTriggerOpenTimeout = useTimeout(); |
| 8600 | 8746 | const pointerTypeRef = React39.useRef(void 0); |
| 8601 | 8747 | function getOpenDelay() { |
| 8602 | - if (!hasProvider) { | |
| 8603 | - return delayWithDefault; | |
| 8748 | + if (hasProvider && activeIdRef.current != null) { | |
| 8749 | + return 0; | |
| 8604 | 8750 | } |
| 8605 | - return getDelay(delayRef.current, "open") === 0 ? 0 : delay ?? providerDelay ?? OPEN_DELAY; | |
| 8751 | + return delay ?? providerDelay ?? OPEN_DELAY; | |
| 8606 | 8752 | } |
| 8607 | 8753 | function isEnabledNestedTriggerTarget(target) { |
| 8608 | 8754 | const triggerEl = triggerElementRef.current; |
| 8609 | 8755 | if (!triggerEl || !target) { |
| @@ -8660,9 +8806,9 @@ | ||
| 8660 | 8806 | return; |
| 8661 | 8807 | } |
| 8662 | 8808 | if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store2.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. |
| 8663 | 8809 | isMouseLikePointerType(pointerTypeRef.current)) { |
| 8664 | - const open = () => { | |
| 8810 | + const open2 = () => { | |
| 8665 | 8811 | if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store2.select("open")) { |
| 8666 | 8812 | store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); |
| 8667 | 8813 | } |
| 8668 | 8814 | }; |
| @@ -8668,11 +8814,11 @@ | ||
| 8668 | 8814 | }; |
| 8669 | 8815 | const openDelay = getOpenDelay(); |
| 8670 | 8816 | if (openDelay === 0) { |
| 8671 | 8817 | nestedTriggerOpenTimeout.clear(); |
| 8672 | - open(); | |
| 8818 | + open2(); | |
| 8673 | 8819 | } else { |
| 8674 | - nestedTriggerOpenTimeout.start(openDelay, open); | |
| 8820 | + nestedTriggerOpenTimeout.start(openDelay, open2); | |
| 8675 | 8821 | } |
| 8676 | 8822 | } |
| 8677 | 8823 | }; |
| 8678 | 8824 | const rootTriggerProps = store2.useState("triggerProps", isMountedByThisTrigger); |
| @@ -8712,9 +8858,9 @@ | ||
| 8712 | 8858 | store2.cancelPendingOpen(event.nativeEvent); |
| 8713 | 8859 | } |
| 8714 | 8860 | }, |
| 8715 | 8861 | id: thisTriggerId, |
| 8716 | - "data-trigger-disabled": disabled2 ? "" : void 0, | |
| 8862 | + [triggerDisabled]: disabled2 ? "" : void 0, | |
| 8717 | 8863 | [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" |
| 8718 | 8864 | }, elementProps], |
| 8719 | 8865 | stateAttributesMapping: triggerOpenStateMapping |
| 8720 | 8866 | }); |
| @@ -8797,9 +8943,9 @@ | ||
| 8797 | 8943 | ...elementProps |
| 8798 | 8944 | } = componentProps; |
| 8799 | 8945 | const store2 = useTooltipRootContext(); |
| 8800 | 8946 | const keepMounted = useTooltipPortalContext(); |
| 8801 | - const open = store2.useState("open"); | |
| 8947 | + const open2 = store2.useState("open"); | |
| 8802 | 8948 | const mounted = store2.useState("mounted"); |
| 8803 | 8949 | const trackCursorAxis = store2.useState("trackCursorAxis"); |
| 8804 | 8950 | const disableHoverablePopup = store2.useState("disableHoverablePopup"); |
| 8805 | 8951 | const floatingRootContext = store2.useState("floatingRootContext"); |
| @@ -8824,14 +8970,14 @@ | ||
| 8824 | 8970 | collisionAvoidance, |
| 8825 | 8971 | adaptiveOrigin: adaptiveOrigin2 |
| 8826 | 8972 | }); |
| 8827 | 8973 | const state = React43.useMemo(() => ({ |
| 8828 | - open, | |
| 8974 | + open: open2, | |
| 8829 | 8975 | side: positioning.side, |
| 8830 | 8976 | align: positioning.align, |
| 8831 | 8977 | anchorHidden: positioning.anchorHidden, |
| 8832 | 8978 | instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType |
| 8833 | - }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); | |
| 8979 | + }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); | |
| 8834 | 8980 | const element = usePositioner(componentProps, state, { |
| 8835 | 8981 | styles: positioning.positionerStyles, |
| 8836 | 8982 | transitionStatus, |
| 8837 | 8983 | props: elementProps, |
| @@ -8836,9 +8982,9 @@ | ||
| 8836 | 8982 | transitionStatus, |
| 8837 | 8983 | props: elementProps, |
| 8838 | 8984 | refs: [forwardedRef, store2.useStateSetter("positionerElement")], |
| 8839 | 8985 | hidden: !mounted, |
| 8840 | - inert: !open || trackCursorAxis === "both" || disableHoverablePopup | |
| 8986 | + inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup | |
| 8841 | 8987 | }); |
| 8842 | 8988 | return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPositionerContext.Provider, { |
| 8843 | 8989 | value: positioning, |
| 8844 | 8990 | children: element |
| @@ -8859,9 +9005,9 @@ | ||
| 8859 | 9005 | const { |
| 8860 | 9006 | side, |
| 8861 | 9007 | align |
| 8862 | 9008 | } = useTooltipPositionerContext(); |
| 8863 | - const open = store2.useState("open"); | |
| 9009 | + const open2 = store2.useState("open"); | |
| 8864 | 9010 | const instantType = store2.useState("instantType"); |
| 8865 | 9011 | const transitionStatus = store2.useState("transitionStatus"); |
| 8866 | 9012 | const popupProps = store2.useState("popupProps"); |
| 8867 | 9013 | const floatingContext = store2.useState("floatingRootContext"); |
| @@ -8867,12 +9013,12 @@ | ||
| 8867 | 9013 | const floatingContext = store2.useState("floatingRootContext"); |
| 8868 | 9014 | const disabled2 = store2.useState("disabled"); |
| 8869 | 9015 | const closeDelay = store2.useState("closeDelay"); |
| 8870 | 9016 | useOpenChangeComplete({ |
| 8871 | - open, | |
| 9017 | + open: open2, | |
| 8872 | 9018 | ref: store2.context.popupRef, |
| 8873 | 9019 | onComplete() { |
| 8874 | - if (open) { | |
| 9020 | + if (open2) { | |
| 8875 | 9021 | store2.context.onOpenChangeComplete?.(true); |
| 8876 | 9022 | } |
| 8877 | 9023 | } |
| 8878 | 9024 | }); |
| @@ -8881,9 +9027,9 @@ | ||
| 8881 | 9027 | closeDelay |
| 8882 | 9028 | }); |
| 8883 | 9029 | const setPopupElement = store2.useStateSetter("popupElement"); |
| 8884 | 9030 | const state = { |
| 8885 | - open, | |
| 9031 | + open: open2, | |
| 8886 | 9032 | side, |
| 8887 | 9033 | align, |
| 8888 | 9034 | instant: instantType, |
| 8889 | 9035 | transitionStatus |
| @@ -8914,12 +9060,12 @@ | ||
| 8914 | 9060 | align, |
| 8915 | 9061 | arrowUncentered, |
| 8916 | 9062 | arrowStyles |
| 8917 | 9063 | } = useTooltipPositionerContext(); |
| 8918 | - const open = store2.useState("open"); | |
| 9064 | + const open2 = store2.useState("open"); | |
| 8919 | 9065 | const instantType = store2.useState("instantType"); |
| 8920 | 9066 | const state = { |
| 8921 | - open, | |
| 9067 | + open: open2, | |
| 8922 | 9068 | side, |
| 8923 | 9069 | align, |
| 8924 | 9070 | uncentered: arrowUncentered, |
| 8925 | 9071 | instant: instantType |
| @@ -9037,36 +9183,8 @@ | ||
| 9037 | 9183 | function useRender(params) { |
| 9038 | 9184 | return useRenderElement(params.defaultTagName ?? "div", params, params); |
| 9039 | 9185 | } |
| 9040 | 9186 | |
| 9041 | - // packages/icons/build-module/icon/index.mjs | |
| 9042 | - var import_element11 = __toESM(require_element(), 1); | |
| 9043 | - var icon_default = (0, import_element11.forwardRef)( | |
| 9044 | - ({ icon, size: size4 = 24, ...props }, ref) => { | |
| 9045 | - return (0, import_element11.cloneElement)(icon, { | |
| 9046 | - width: size4, | |
| 9047 | - height: size4, | |
| 9048 | - ...props, | |
| 9049 | - ref | |
| 9050 | - }); | |
| 9051 | - } | |
| 9052 | - ); | |
| 9053 | - | |
| 9054 | - // packages/icons/build-module/library/star-empty.mjs | |
| 9055 | - var import_primitives = __toESM(require_primitives(), 1); | |
| 9056 | - var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); | |
| 9057 | - var star_empty_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z" }) }); | |
| 9058 | - | |
| 9059 | - // packages/icons/build-module/library/star-filled.mjs | |
| 9060 | - var import_primitives2 = __toESM(require_primitives(), 1); | |
| 9061 | - var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); | |
| 9062 | - var star_filled_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives2.Path, { d: "M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z" }) }); | |
| 9063 | - | |
| 9064 | - // packages/icons/build-module/library/star-half.mjs | |
| 9065 | - var import_primitives3 = __toESM(require_primitives(), 1); | |
| 9066 | - var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); | |
| 9067 | - var star_half_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives3.Path, { d: "M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z" }) }); | |
| 9068 | - | |
| 9069 | 9187 | // packages/ui/build-module/tooltip/index.mjs |
| 9070 | 9188 | var tooltip_exports = {}; |
| 9071 | 9189 | __export(tooltip_exports, { |
| 9072 | 9190 | Popup: () => Popup, |
| @@ -9077,12 +9195,12 @@ | ||
| 9077 | 9195 | Trigger: () => Trigger |
| 9078 | 9196 | }); |
| 9079 | 9197 | |
| 9080 | 9198 | // packages/ui/build-module/tooltip/popup.mjs |
| 9081 | - var import_element15 = __toESM(require_element(), 1); | |
| 9199 | + var import_element14 = __toESM(require_element(), 1); | |
| 9082 | 9200 | |
| 9083 | 9201 | // packages/ui/build-module/tooltip/portal.mjs |
| 9084 | - var import_element12 = __toESM(require_element(), 1); | |
| 9202 | + var import_element11 = __toESM(require_element(), 1); | |
| 9085 | 9203 | |
| 9086 | 9204 | // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs |
| 9087 | 9205 | var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; |
| 9088 | 9206 | function getRuntime() { |
| @@ -9223,12 +9341,12 @@ | ||
| 9223 | 9341 | return cachedSlot; |
| 9224 | 9342 | } |
| 9225 | 9343 | |
| 9226 | 9344 | // packages/ui/build-module/tooltip/portal.mjs |
| 9227 | - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 9228 | - var Portal = (0, import_element12.forwardRef)( | |
| 9345 | + var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); | |
| 9346 | + var Portal = (0, import_element11.forwardRef)( | |
| 9229 | 9347 | function TooltipPortal3({ container, ...restProps }, ref) { |
| 9230 | - return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 9348 | + return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)( | |
| 9231 | 9349 | index_parts_exports.Portal, |
| 9232 | 9350 | { |
| 9233 | 9351 | container: container ?? getWpCompatOverlaySlot(), |
| 9234 | 9352 | ...restProps, |
| @@ -9238,10 +9356,10 @@ | ||
| 9238 | 9356 | } |
| 9239 | 9357 | ); |
| 9240 | 9358 | |
| 9241 | 9359 | // packages/ui/build-module/tooltip/positioner.mjs |
| 9242 | - var import_element13 = __toESM(require_element(), 1); | |
| 9243 | - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 9360 | + var import_element12 = __toESM(require_element(), 1); | |
| 9361 | + var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); | |
| 9244 | 9362 | var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; |
| 9245 | 9363 | function getRuntime2() { |
| 9246 | 9364 | const globalScope = globalThis; |
| 9247 | 9365 | if (globalScope.__wpStyleRuntime) { |
| @@ -9328,11 +9446,11 @@ | ||
| 9328 | 9446 | if (typeof process === "undefined" || true) { |
| 9329 | 9447 | 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}}}}'); |
| 9330 | 9448 | } |
| 9331 | 9449 | var style_default = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; |
| 9332 | - var Positioner = (0, import_element13.forwardRef)( | |
| 9450 | + var Positioner = (0, import_element12.forwardRef)( | |
| 9333 | 9451 | function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { |
| 9334 | - return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 9452 | + return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( | |
| 9335 | 9453 | index_parts_exports.Positioner, |
| 9336 | 9454 | { |
| 9337 | 9455 | ref, |
| 9338 | 9456 | align, |
| @@ -9349,11 +9467,11 @@ | ||
| 9349 | 9467 | } |
| 9350 | 9468 | ); |
| 9351 | 9469 | |
| 9352 | 9470 | // packages/ui/build-module/utils/render-slot-with-children.mjs |
| 9353 | - var import_element14 = __toESM(require_element(), 1); | |
| 9471 | + var import_element13 = __toESM(require_element(), 1); | |
| 9354 | 9472 | function renderSlotWithChildren(slot, defaultSlot, children) { |
| 9355 | - return (0, import_element14.cloneElement)(slot ?? defaultSlot, { children }); | |
| 9473 | + return (0, import_element13.cloneElement)(slot ?? defaultSlot, { children }); | |
| 9356 | 9474 | } |
| 9357 | 9475 | |
| 9358 | 9476 | // packages/ui/build-module/utils/theme-provider.mjs |
| 9359 | 9477 | var theme = __toESM(require_theme(), 1); |
| @@ -9382,9 +9500,9 @@ | ||
| 9382 | 9500 | } |
| 9383 | 9501 | var ThemeProvider = getThemeProvider(); |
| 9384 | 9502 | |
| 9385 | 9503 | // packages/ui/build-module/tooltip/popup.mjs |
| 9386 | - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 9504 | + var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); | |
| 9387 | 9505 | var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; |
| 9388 | 9506 | function getRuntime3() { |
| 9389 | 9507 | const globalScope = globalThis; |
| 9390 | 9508 | if (globalScope.__wpStyleRuntime) { |
| @@ -9468,10 +9586,10 @@ | ||
| 9468 | 9586 | 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}}}}'); |
| 9469 | 9587 | } |
| 9470 | 9588 | var style_default2 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; |
| 9471 | 9589 | var POPUP_COLOR = { background: "#1e1e1e" }; |
| 9472 | - var Popup = (0, import_element15.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { | |
| 9473 | - const popupContent = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( | |
| 9590 | + var Popup = (0, import_element14.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { | |
| 9591 | + const popupContent = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( | |
| 9474 | 9592 | index_parts_exports.Popup, |
| 9475 | 9593 | { |
| 9476 | 9594 | ref, |
| 9477 | 9595 | className: clsx_default(style_default2.popup, className), |
| @@ -9480,42 +9598,79 @@ | ||
| 9480 | 9598 | } |
| 9481 | 9599 | ) }); |
| 9482 | 9600 | const positionedPopup = renderSlotWithChildren( |
| 9483 | 9601 | positioner, |
| 9484 | - /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Positioner, {}), | |
| 9602 | + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Positioner, {}), | |
| 9485 | 9603 | popupContent |
| 9486 | 9604 | ); |
| 9487 | - return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(Portal, {}), positionedPopup); | |
| 9605 | + return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Portal, {}), positionedPopup); | |
| 9488 | 9606 | }); |
| 9489 | 9607 | |
| 9490 | 9608 | // packages/ui/build-module/tooltip/trigger.mjs |
| 9491 | - var import_element16 = __toESM(require_element(), 1); | |
| 9492 | - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); | |
| 9493 | - var Trigger = (0, import_element16.forwardRef)( | |
| 9609 | + var import_element15 = __toESM(require_element(), 1); | |
| 9610 | + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 9611 | + var Trigger = (0, import_element15.forwardRef)( | |
| 9494 | 9612 | function TooltipTrigger3(props, ref) { |
| 9495 | - return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Trigger, { ref, ...props }); | |
| 9613 | + return /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(index_parts_exports.Trigger, { ref, ...props }); | |
| 9496 | 9614 | } |
| 9497 | 9615 | ); |
| 9498 | 9616 | |
| 9499 | 9617 | // packages/ui/build-module/utils/direction-provider.mjs |
| 9500 | 9618 | var import_i18n2 = __toESM(require_i18n(), 1); |
| 9501 | - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 9619 | + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 9502 | 9620 | function DirectionProvider3({ children }) { |
| 9503 | - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(DirectionProvider, { direction: (0, import_i18n2.isRTL)() ? "rtl" : "ltr", children }); | |
| 9621 | + return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(DirectionProvider, { direction: (0, import_i18n2.isRTL)() ? "rtl" : "ltr", children }); | |
| 9504 | 9622 | } |
| 9505 | 9623 | |
| 9506 | 9624 | // packages/ui/build-module/tooltip/root.mjs |
| 9507 | - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 9625 | + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 9508 | 9626 | function Root(props) { |
| 9509 | - return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(index_parts_exports.Root, { ...props }) }); | |
| 9627 | + return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(index_parts_exports.Root, { ...props }) }); | |
| 9510 | 9628 | } |
| 9511 | 9629 | |
| 9512 | 9630 | // packages/ui/build-module/tooltip/provider.mjs |
| 9513 | - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 9631 | + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); | |
| 9514 | 9632 | function Provider({ ...props }) { |
| 9515 | - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(index_parts_exports.Provider, { ...props }); | |
| 9633 | + return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(index_parts_exports.Provider, { ...props }); | |
| 9516 | 9634 | } |
| 9517 | 9635 | |
| 9636 | + // packages/icons/build-module/icon/index.mjs | |
| 9637 | + var import_element16 = __toESM(require_element(), 1); | |
| 9638 | + var icon_default = (0, import_element16.forwardRef)( | |
| 9639 | + ({ icon, size: size4 = 24, style, ...props }, ref) => { | |
| 9640 | + const intrinsicStyle = icon.props.style; | |
| 9641 | + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0; | |
| 9642 | + return (0, import_element16.cloneElement)(icon, { | |
| 9643 | + width: size4, | |
| 9644 | + height: size4, | |
| 9645 | + ...props, | |
| 9646 | + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on | |
| 9647 | + // stroke-based icons) is preserved unless the consumer overrides | |
| 9648 | + // the same property explicitly. | |
| 9649 | + ...mergedStyle ? { style: mergedStyle } : {}, | |
| 9650 | + ref | |
| 9651 | + }); | |
| 9652 | + } | |
| 9653 | + ); | |
| 9654 | + | |
| 9655 | + // packages/icons/build-module/library/star-empty.mjs | |
| 9656 | + var import_primitives = __toESM(require_primitives(), 1); | |
| 9657 | + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 9658 | + var star_empty_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: "M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z", vectorEffect: "non-scaling-stroke" }) }); | |
| 9659 | + | |
| 9660 | + // packages/icons/build-module/library/star-filled.mjs | |
| 9661 | + var import_primitives2 = __toESM(require_primitives(), 1); | |
| 9662 | + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 9663 | + var star_filled_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: "M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) }); | |
| 9664 | + | |
| 9665 | + // packages/icons/build-module/library/star-half.mjs | |
| 9666 | + var import_primitives3 = __toESM(require_primitives(), 1); | |
| 9667 | + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 9668 | + var star_half_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ | |
| 9669 | + /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.Path, { d: "M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z", vectorEffect: "non-scaling-stroke" }), | |
| 9670 | + /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives3.Path, { d: "M11.4653 15.4048C11.7941 15.232 12 14.8912 12 14.5197V5.71576L10.3894 8.97924C10.2437 9.27438 9.96215 9.47895 9.63644 9.52628L6.03497 10.0496L8.64102 12.5899C8.8767 12.8196 8.98425 13.1506 8.92861 13.475L8.31341 17.0619L11.4653 15.4048Z", fill: "currentColor", stroke: "none" }) | |
| 9671 | + ] }); | |
| 9672 | + | |
| 9518 | 9673 | // packages/ui/build-module/visually-hidden/visually-hidden.mjs |
| 9519 | 9674 | var import_element17 = __toESM(require_element(), 1); |
| 9520 | 9675 | var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; |
| 9521 | 9676 | function getRuntime4() { |
| @@ -9597,9 +9752,9 @@ | ||
| 9597 | 9752 | injectStyle4(targetDocument, hash, css); |
| 9598 | 9753 | } |
| 9599 | 9754 | } |
| 9600 | 9755 | if (typeof process === "undefined" || true) { |
| 9601 | - registerStyle4("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}}}"); | |
| 9756 | + 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}}}"); | |
| 9602 | 9757 | } |
| 9603 | 9758 | var style_default3 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; |
| 9604 | 9759 | var VisuallyHidden = (0, import_element17.forwardRef)( |
| 9605 | 9760 | function VisuallyHidden2({ render, ...restProps }, ref) { |