@kky42/pievo-server 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{LoopView-B4H9QibC.js → LoopView-d0XYkzpx.js} +3 -3
- package/.output/public/assets/Modal-D_od-AuP.js +1 -0
- package/.output/public/assets/{SignIn-SHuRRyOv.js → SignIn-CbMeIAJZ.js} +1 -1
- package/.output/public/assets/app-BKySt9Ta.css +2 -0
- package/.output/public/assets/{artifactView-DFuubXLJ.js → artifactView-DekEs5ME.js} +1 -1
- package/.output/public/assets/index-C4UaIr-9.js +12 -0
- package/.output/public/assets/{invite._token-T8oo4Qtw.js → invite._token-CnyCmLfD.js} +1 -1
- package/.output/public/assets/{lifecycleUi-DKkChdnU.js → lifecycleUi-DGVOf5yS.js} +1 -1
- package/.output/public/assets/{loopApi-BM2nj71x.js → loopApi-5s2-kCnu.js} +1 -1
- package/.output/public/assets/loops._loopId-DdWM2f1F.js +5 -0
- package/.output/public/assets/{loops._loopId_.runs._runId-_CflHV38.js → loops._loopId_.runs._runId-DTwSFHkl.js} +2 -2
- package/.output/public/assets/notifyFns-b_jCi5XK.js +1 -0
- package/.output/public/assets/{preload-helper-CKUiEq3b.js → preload-helper-ycaoAemE.js} +1 -1
- package/.output/public/assets/{routes-B9tgli5f.js → routes-G3WYRyPN.js} +1 -1
- package/.output/public/assets/{t._teamId-Bm21mngW.js → t._teamId-CGv7Oq6A.js} +1 -1
- package/.output/server/_libs/@base-ui/react+[...].mjs +23 -2375
- package/.output/server/_libs/@tanstack/react-router+[...].mjs +1 -1
- package/.output/server/_libs/html-react-parser+[...].mjs +1 -1
- package/.output/server/_libs/react-redux+[...].mjs +1 -1
- package/.output/server/_libs/recharts+victory-vendor.mjs +1 -1
- package/.output/server/_libs/uiw__react-codemirror.mjs +1 -1
- package/.output/server/_ssr/CodeField-tm4rr6G3.mjs +1 -1
- package/.output/server/_ssr/{DashboardView-CC7htv28.mjs → DashboardView-CmDqjCiq.mjs} +45 -35
- package/.output/server/_ssr/{LoopPlaybook-BXH8mhiX.mjs → LoopPlaybook-BBn-xXpG.mjs} +3 -3
- package/.output/server/_ssr/{LoopView-DCugEbHx.mjs → LoopView-DdyJYOCY.mjs} +5 -5
- package/.output/server/_ssr/Modal-DpKZHLZK.mjs +1 -1
- package/.output/server/_ssr/{SignIn-dTndU6Hw.mjs → SignIn-RJN_0GFZ.mjs} +3 -3
- package/.output/server/_ssr/actionUi-CZbEixbf.mjs +1 -1
- package/.output/server/_ssr/{adapters-BS8XosjF.mjs → adapters-CJUhP66K.mjs} +9 -3
- package/.output/server/_ssr/{artifactFiles-Cagtj7J0.mjs → artifactFiles-zP43a-_v.mjs} +3 -3
- package/.output/server/_ssr/{artifactView-DS4O22wl.mjs → artifactView-CYV1r48i.mjs} +3 -3
- package/.output/server/_ssr/artifacts-CwCDal_d.mjs +2 -0
- package/.output/server/_ssr/{auth-DY1DuYZd.mjs → auth-D2SlCxwE.mjs} +9 -9
- package/.output/server/_ssr/{boot-CMHTxQpJ.mjs → boot-BHTcCXzm.mjs} +1 -1
- package/.output/server/_ssr/{boot-BbtG0ImW.mjs → boot-aI3l2EYT.mjs} +494 -107
- package/.output/server/_ssr/{bun-sqlite-dialect-BW9W1_Ps-CU1Spd6z.mjs → bun-sqlite-dialect-BW9W1_Ps-B-3PhI3u.mjs} +2 -2
- package/.output/server/_ssr/{d1-sqlite-dialect-BLC8LXE6-DfG7tB8s.mjs → d1-sqlite-dialect-BLC8LXE6-Dm_NrETM.mjs} +2 -2
- package/.output/server/_ssr/db-7gZ8_zkc.mjs +2 -0
- package/.output/server/_ssr/{dist-BIxFFVZg.mjs → dist-DW3TO9NM.mjs} +2 -2
- package/.output/server/_ssr/{factory-Blq0DYfT.mjs → factory-Voe90MEY.mjs} +2 -2
- package/.output/server/_ssr/{invite._token-NewFt27g.mjs → invite._token-CeD9PCvh.mjs} +6 -6
- package/.output/server/_ssr/{invite._token-BRCo9LGB.mjs → invite._token-D80GP0-u.mjs} +4 -4
- package/.output/server/_ssr/invite._token-DJxGLILJ.mjs +1 -1
- package/.output/server/_ssr/{kysely-adapter-D3XTe64J.mjs → kysely-adapter-DSLWmYjO.mjs} +1 -1
- package/.output/server/_ssr/{lifecycleUi-C9lg1r3r.mjs → lifecycleUi-BhRsBvJ7.mjs} +4 -4
- package/.output/server/_ssr/logger-Dbz2vUU-.mjs +2 -0
- package/.output/server/_ssr/{loopApi-Cxe8WyOB.mjs → loopApi-BfMnXaKT.mjs} +7 -7
- package/.output/server/_ssr/{loopApi-BtfkZQYK.mjs → loopApi-ByX_X17-.mjs} +31 -14
- package/.output/server/_ssr/{loops._loopId-DhnArGdL.mjs → loops._loopId-BODmoHPu.mjs} +236 -370
- package/.output/server/_ssr/{loops._loopId-7NQJPB9W.mjs → loops._loopId-u8Dr2J5f.mjs} +4 -4
- package/.output/server/_ssr/{loops._loopId_.runs._runId-Dip5Xk-q.mjs → loops._loopId_.runs._runId-DaKJdso2.mjs} +48 -6
- package/.output/server/_ssr/{loops._loopId_.runs._runId-Bvuo2nki.mjs → loops._loopId_.runs._runId-kGL-CMG6.mjs} +4 -4
- package/.output/server/_ssr/{machineFns-Dvr5ICUy.mjs → machineFns-MMSoHs7N.mjs} +3 -3
- package/.output/server/_ssr/{node-sqlite-dialect-DhyOpJTX.mjs → node-sqlite-dialect-Y22MTyEv.mjs} +2 -2
- package/.output/server/_ssr/{notifyFns-BcMRY5kP.mjs → notifyFns-Bmqhlrkc.mjs} +3 -3
- package/.output/server/_ssr/{notifyFns-Q458pZmE.mjs → notifyFns-CdrijMGW.mjs} +5 -5
- package/.output/server/_ssr/{router-J8KZ30xw.mjs → router-CdxedJtm.mjs} +30 -30
- package/.output/server/_ssr/routes-Bcs4T1ox.mjs +1 -1
- package/.output/server/_ssr/{routes-D4am3Zff.mjs → routes-Bhay1OjL.mjs} +6 -6
- package/.output/server/_ssr/{routes-BoGrcf-b.mjs → routes-ROFun1nJ.mjs} +5 -5
- package/.output/server/_ssr/{runDiff-CpEFqo7G.mjs → runDiff-DWwt7qXb.mjs} +2 -2
- package/.output/server/_ssr/ssr.mjs +49 -49
- package/.output/server/_ssr/store-D75hcTob.mjs +2 -0
- package/.output/server/_ssr/{t._teamId-DR-hQK7o.mjs → t._teamId-CGba9PRq.mjs} +5 -5
- package/.output/server/_ssr/{t._teamId-CeUhzgzT.mjs → t._teamId-DTKU7GOp.mjs} +6 -6
- package/.output/server/_ssr/t._teamId-Dy_McbRt.mjs +1 -1
- package/.output/server/_ssr/{teamFns-BIDnsg2A.mjs → teamFns-BMDqynoT.mjs} +3 -3
- package/.output/server/_ssr/{teamFns-DA4ovI5g.mjs → teamFns-D4I-0dEB.mjs} +2 -2
- package/.output/server/_ssr/tokens-BHjz7Lvx.mjs +2 -0
- package/.output/server/_ssr/ui-Dej2qjuS.mjs +1 -1
- package/.output/server/{_tanstack-start-manifest_v-CVS6c7re.mjs → _tanstack-start-manifest_v-BwejIUux.mjs} +21 -21
- package/.output/server/drizzle/0009_ordinary_electro.sql +1 -0
- package/.output/server/drizzle/0010_workable_rage.sql +14 -0
- package/.output/server/drizzle/meta/0009_snapshot.json +1793 -0
- package/.output/server/drizzle/meta/0010_snapshot.json +1891 -0
- package/.output/server/drizzle/meta/_journal.json +14 -0
- package/.output/server/index.mjs +102 -102
- package/drizzle/0009_ordinary_electro.sql +1 -0
- package/drizzle/0010_workable_rage.sql +14 -0
- package/drizzle/meta/0009_snapshot.json +1793 -0
- package/drizzle/meta/0010_snapshot.json +1891 -0
- package/drizzle/meta/_journal.json +14 -0
- package/package.json +1 -1
- package/scripts/pievo-server.mjs +5 -0
- package/scripts/server-cli-lib.mjs +2 -0
- package/.output/public/assets/Modal-D33gNSgx.js +0 -1
- package/.output/public/assets/app-DElSo_jy.css +0 -2
- package/.output/public/assets/index-DfpTWRSz.js +0 -12
- package/.output/public/assets/loops._loopId-B19Jw7jC.js +0 -5
- package/.output/public/assets/notifyFns-DCubjpRy.js +0 -1
- package/.output/server/_ssr/artifacts-DngKyW2u.mjs +0 -2
- package/.output/server/_ssr/db-DWAuZq1o.mjs +0 -2
- package/.output/server/_ssr/logger-Dw82jNjH.mjs +0 -2
- package/.output/server/_ssr/store-b3JcQ08F.mjs +0 -2
- package/.output/server/_ssr/tokens-ytd60FUt.mjs +0 -2
|
@@ -861,7 +861,7 @@ function mergeObjects(a, b) {
|
|
|
861
861
|
//#endregion
|
|
862
862
|
//#region ../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/utils/empty.mjs
|
|
863
863
|
function NOOP() {}
|
|
864
|
-
|
|
864
|
+
Object.freeze([]);
|
|
865
865
|
var EMPTY_OBJECT = Object.freeze({});
|
|
866
866
|
//#endregion
|
|
867
867
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
|
|
@@ -1191,10 +1191,7 @@ var CommonTriggerDataAttributes = /*#__PURE__*/ function(CommonTriggerDataAttrib
|
|
|
1191
1191
|
return CommonTriggerDataAttributes;
|
|
1192
1192
|
}({});
|
|
1193
1193
|
var TRIGGER_HOOK = { [CommonTriggerDataAttributes.popupOpen]: "" };
|
|
1194
|
-
|
|
1195
|
-
[CommonTriggerDataAttributes.popupOpen]: "",
|
|
1196
|
-
[CommonTriggerDataAttributes.pressed]: ""
|
|
1197
|
-
};
|
|
1194
|
+
CommonTriggerDataAttributes.popupOpen, CommonTriggerDataAttributes.pressed;
|
|
1198
1195
|
var POPUP_OPEN_HOOK = { [CommonPopupDataAttributes.open]: "" };
|
|
1199
1196
|
var POPUP_CLOSED_HOOK = { [CommonPopupDataAttributes.closed]: "" };
|
|
1200
1197
|
var ANCHOR_HIDDEN_HOOK = { [CommonPopupDataAttributes.anchorHidden]: "" };
|
|
@@ -1202,10 +1199,6 @@ var triggerOpenStateMapping = { open(value) {
|
|
|
1202
1199
|
if (value) return TRIGGER_HOOK;
|
|
1203
1200
|
return null;
|
|
1204
1201
|
} };
|
|
1205
|
-
var pressableTriggerOpenStateMapping = { open(value) {
|
|
1206
|
-
if (value) return PRESSABLE_TRIGGER_HOOK;
|
|
1207
|
-
return null;
|
|
1208
|
-
} };
|
|
1209
1202
|
var popupStateMapping = {
|
|
1210
1203
|
open(value) {
|
|
1211
1204
|
if (value) return POPUP_OPEN_HOOK;
|
|
@@ -1218,7 +1211,7 @@ var popupStateMapping = {
|
|
|
1218
1211
|
};
|
|
1219
1212
|
//#endregion
|
|
1220
1213
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
|
|
1221
|
-
var stateAttributesMapping$
|
|
1214
|
+
var stateAttributesMapping$2 = {
|
|
1222
1215
|
...popupStateMapping,
|
|
1223
1216
|
...transitionStatusMapping
|
|
1224
1217
|
};
|
|
@@ -1240,7 +1233,7 @@ var DialogBackdrop = /*#__PURE__*/ import_react.forwardRef(function DialogBackdr
|
|
|
1240
1233
|
transitionStatus: store.useState("transitionStatus")
|
|
1241
1234
|
},
|
|
1242
1235
|
ref: [store.context.backdropRef, forwardedRef],
|
|
1243
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
1236
|
+
stateAttributesMapping: stateAttributesMapping$2,
|
|
1244
1237
|
props: [{
|
|
1245
1238
|
role: "presentation",
|
|
1246
1239
|
hidden: !mounted,
|
|
@@ -1367,7 +1360,6 @@ function getFrameElement(win) {
|
|
|
1367
1360
|
}
|
|
1368
1361
|
//#endregion
|
|
1369
1362
|
//#region ../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/utils/safeReact.mjs
|
|
1370
|
-
var import_jsx_runtime = require_jsx_runtime();
|
|
1371
1363
|
/**
|
|
1372
1364
|
* A clone of the React namespace for reading APIs that may be missing in older
|
|
1373
1365
|
* supported React versions. Bundlers can rewrite direct `React.someNewApi`
|
|
@@ -1415,9 +1407,6 @@ var noop = () => {};
|
|
|
1415
1407
|
var useIsoLayoutEffect = typeof document !== "undefined" ? import_react.useLayoutEffect : noop;
|
|
1416
1408
|
//#endregion
|
|
1417
1409
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
|
|
1418
|
-
var import_shim = require_shim();
|
|
1419
|
-
var import_with_selector = require_with_selector();
|
|
1420
|
-
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
|
1421
1410
|
var CompositeRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
1422
1411
|
function useCompositeRootContext(optional = false) {
|
|
1423
1412
|
const context = import_react.useContext(CompositeRootContext);
|
|
@@ -1564,13 +1553,9 @@ var triggerPress = "trigger-press";
|
|
|
1564
1553
|
var triggerHover = "trigger-hover";
|
|
1565
1554
|
var triggerFocus = "trigger-focus";
|
|
1566
1555
|
var outsidePress = "outside-press";
|
|
1567
|
-
var itemPress = "item-press";
|
|
1568
1556
|
var closePress = "close-press";
|
|
1569
1557
|
var focusOut = "focus-out";
|
|
1570
1558
|
var escapeKey = "escape-key";
|
|
1571
|
-
var listNavigation = "list-navigation";
|
|
1572
|
-
var cancelOpen = "cancel-open";
|
|
1573
|
-
var siblingOpen = "sibling-open";
|
|
1574
1559
|
var disabled = "disabled";
|
|
1575
1560
|
var imperativeAction = "imperative-action";
|
|
1576
1561
|
//#endregion
|
|
@@ -1643,6 +1628,8 @@ var DialogClose = /*#__PURE__*/ import_react.forwardRef(function DialogClose(com
|
|
|
1643
1628
|
});
|
|
1644
1629
|
//#endregion
|
|
1645
1630
|
//#region ../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/utils/useId.mjs
|
|
1631
|
+
var import_jsx_runtime = require_jsx_runtime();
|
|
1632
|
+
var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
|
|
1646
1633
|
var globalId = 0;
|
|
1647
1634
|
function useGlobalId(idOverride, prefix = "mui") {
|
|
1648
1635
|
const [defaultId, setDefaultId] = import_react.useState(idOverride);
|
|
@@ -1671,6 +1658,8 @@ function useId(idOverride, prefix) {
|
|
|
1671
1658
|
}
|
|
1672
1659
|
//#endregion
|
|
1673
1660
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/useBaseUiId.mjs
|
|
1661
|
+
var import_shim = require_shim();
|
|
1662
|
+
var import_with_selector = require_with_selector();
|
|
1674
1663
|
/**
|
|
1675
1664
|
* Wraps `useId` and prefixes generated `id`s with `base-ui-`
|
|
1676
1665
|
* @param {string | undefined} idOverride overrides the generated id when provided
|
|
@@ -1815,10 +1804,6 @@ function isClickLikeEvent(event) {
|
|
|
1815
1804
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs
|
|
1816
1805
|
var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable";
|
|
1817
1806
|
var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";
|
|
1818
|
-
var ARROW_LEFT$1 = "ArrowLeft";
|
|
1819
|
-
var ARROW_RIGHT$1 = "ArrowRight";
|
|
1820
|
-
var ARROW_UP$1 = "ArrowUp";
|
|
1821
|
-
var ARROW_DOWN$1 = "ArrowDown";
|
|
1822
1807
|
//#endregion
|
|
1823
1808
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/shadowDom.mjs
|
|
1824
1809
|
function activeElement(doc) {
|
|
@@ -2388,33 +2373,6 @@ function rectToClientRect(rect) {
|
|
|
2388
2373
|
}
|
|
2389
2374
|
//#endregion
|
|
2390
2375
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
|
|
2391
|
-
function isIndexOutOfListBounds(list, index) {
|
|
2392
|
-
return index < 0 || index >= list.length;
|
|
2393
|
-
}
|
|
2394
|
-
function getMinListIndex(listRef, disabledIndices) {
|
|
2395
|
-
return findNonDisabledListIndex(listRef.current, { disabledIndices });
|
|
2396
|
-
}
|
|
2397
|
-
function getMaxListIndex(listRef, disabledIndices) {
|
|
2398
|
-
return findNonDisabledListIndex(listRef.current, {
|
|
2399
|
-
decrement: true,
|
|
2400
|
-
startingIndex: listRef.current.length,
|
|
2401
|
-
disabledIndices
|
|
2402
|
-
});
|
|
2403
|
-
}
|
|
2404
|
-
function findNonDisabledListIndex(list, { startingIndex = -1, decrement = false, disabledIndices, amount = 1 } = {}) {
|
|
2405
|
-
let index = startingIndex;
|
|
2406
|
-
do
|
|
2407
|
-
index += decrement ? -amount : amount;
|
|
2408
|
-
while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));
|
|
2409
|
-
return index;
|
|
2410
|
-
}
|
|
2411
|
-
function isListIndexDisabled(list, index, disabledIndices) {
|
|
2412
|
-
if (typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false) return true;
|
|
2413
|
-
const element = list[index];
|
|
2414
|
-
if (!element) return false;
|
|
2415
|
-
if (!isElementVisible(element)) return true;
|
|
2416
|
-
return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
|
|
2417
|
-
}
|
|
2418
2376
|
function isHiddenByStyles(styles) {
|
|
2419
2377
|
return styles.visibility === "hidden" || styles.visibility === "collapse";
|
|
2420
2378
|
}
|
|
@@ -2532,21 +2490,6 @@ function getNextTabbable(referenceElement) {
|
|
|
2532
2490
|
function getPreviousTabbable(referenceElement) {
|
|
2533
2491
|
return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement;
|
|
2534
2492
|
}
|
|
2535
|
-
function getTabbableNearElement(referenceElement, dir) {
|
|
2536
|
-
if (!referenceElement) return null;
|
|
2537
|
-
const list = tabbable(ownerDocument(referenceElement).body);
|
|
2538
|
-
const elementCount = list.length;
|
|
2539
|
-
if (elementCount === 0) return null;
|
|
2540
|
-
const index = list.indexOf(referenceElement);
|
|
2541
|
-
if (index === -1) return null;
|
|
2542
|
-
return list[(index + dir + elementCount) % elementCount];
|
|
2543
|
-
}
|
|
2544
|
-
function getTabbableAfterElement(referenceElement) {
|
|
2545
|
-
return getTabbableNearElement(referenceElement, 1);
|
|
2546
|
-
}
|
|
2547
|
-
function getTabbableBeforeElement(referenceElement) {
|
|
2548
|
-
return getTabbableNearElement(referenceElement, -1);
|
|
2549
|
-
}
|
|
2550
2493
|
function isOutsideEvent(event, container) {
|
|
2551
2494
|
const containerElement = container || event.currentTarget;
|
|
2552
2495
|
const relatedTarget = event.relatedTarget;
|
|
@@ -2732,11 +2675,6 @@ var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
|
|
|
2732
2675
|
`${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}`;
|
|
2733
2676
|
`${LEGACY_SWIPE_IGNORE_ATTRIBUTE}`;
|
|
2734
2677
|
/**
|
|
2735
|
-
* Used for dropdowns that usually strictly prefer top/bottom placements and
|
|
2736
|
-
* use `var(--available-height)` to limit their height.
|
|
2737
|
-
*/
|
|
2738
|
-
var DROPDOWN_COLLISION_AVOIDANCE = { fallbackAxisSide: "none" };
|
|
2739
|
-
/**
|
|
2740
2678
|
* Used by regular popups that usually aren't scrollable and are allowed to
|
|
2741
2679
|
* freely flip to any axis of placement.
|
|
2742
2680
|
*/
|
|
@@ -2911,23 +2849,6 @@ function createEventEmitter() {
|
|
|
2911
2849
|
};
|
|
2912
2850
|
}
|
|
2913
2851
|
//#endregion
|
|
2914
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/components/FloatingTreeStore.mjs
|
|
2915
|
-
/**
|
|
2916
|
-
* Stores and manages floating elements in a tree structure.
|
|
2917
|
-
* This is a backing store for the `FloatingTree` component.
|
|
2918
|
-
*/
|
|
2919
|
-
var FloatingTreeStore = class {
|
|
2920
|
-
nodesRef = { current: [] };
|
|
2921
|
-
events = createEventEmitter();
|
|
2922
|
-
addNode(node) {
|
|
2923
|
-
this.nodesRef.current.push(node);
|
|
2924
|
-
}
|
|
2925
|
-
removeNode(node) {
|
|
2926
|
-
const index = this.nodesRef.current.findIndex((n) => n === node);
|
|
2927
|
-
if (index !== -1) this.nodesRef.current.splice(index, 1);
|
|
2928
|
-
}
|
|
2929
|
-
};
|
|
2930
|
-
//#endregion
|
|
2931
2852
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs
|
|
2932
2853
|
var FloatingNodeContext = /*#__PURE__*/ import_react.createContext(null);
|
|
2933
2854
|
var FloatingTreeContext = /*#__PURE__*/ import_react.createContext(null);
|
|
@@ -2939,66 +2860,6 @@ var useFloatingTree = (externalTree) => {
|
|
|
2939
2860
|
const contextTree = import_react.useContext(FloatingTreeContext);
|
|
2940
2861
|
return externalTree ?? contextTree;
|
|
2941
2862
|
};
|
|
2942
|
-
/**
|
|
2943
|
-
* Registers a node into the `FloatingTree`, returning its id.
|
|
2944
|
-
* @see https://floating-ui.com/docs/FloatingTree
|
|
2945
|
-
*/
|
|
2946
|
-
function useFloatingNodeId(externalTree) {
|
|
2947
|
-
const id = useId();
|
|
2948
|
-
const tree = useFloatingTree(externalTree);
|
|
2949
|
-
const parentId = useFloatingParentNodeId();
|
|
2950
|
-
useIsoLayoutEffect(() => {
|
|
2951
|
-
if (!id) return;
|
|
2952
|
-
const node = {
|
|
2953
|
-
id,
|
|
2954
|
-
parentId
|
|
2955
|
-
};
|
|
2956
|
-
tree?.addNode(node);
|
|
2957
|
-
return () => {
|
|
2958
|
-
tree?.removeNode(node);
|
|
2959
|
-
};
|
|
2960
|
-
}, [
|
|
2961
|
-
tree,
|
|
2962
|
-
id,
|
|
2963
|
-
parentId
|
|
2964
|
-
]);
|
|
2965
|
-
return id;
|
|
2966
|
-
}
|
|
2967
|
-
/**
|
|
2968
|
-
* Provides parent node context for nested floating elements.
|
|
2969
|
-
* @see https://floating-ui.com/docs/FloatingTree
|
|
2970
|
-
* @internal
|
|
2971
|
-
*/
|
|
2972
|
-
function FloatingNode(props) {
|
|
2973
|
-
const { children, id } = props;
|
|
2974
|
-
const parentId = useFloatingParentNodeId();
|
|
2975
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingNodeContext.Provider, {
|
|
2976
|
-
value: import_react.useMemo(() => ({
|
|
2977
|
-
id,
|
|
2978
|
-
parentId
|
|
2979
|
-
}), [id, parentId]),
|
|
2980
|
-
children
|
|
2981
|
-
});
|
|
2982
|
-
}
|
|
2983
|
-
/**
|
|
2984
|
-
* Provides context for nested floating elements when they are not children of
|
|
2985
|
-
* each other on the DOM.
|
|
2986
|
-
* This is not necessary in all cases, except when there must be explicit communication between parent and child floating elements. It is necessary for:
|
|
2987
|
-
* - The `bubbles` option in the `useDismiss()` Hook
|
|
2988
|
-
* - Nested virtual list navigation
|
|
2989
|
-
* - Nested floating elements that each open on hover
|
|
2990
|
-
* - Custom communication between parent and child floating elements
|
|
2991
|
-
* @see https://floating-ui.com/docs/FloatingTree
|
|
2992
|
-
* @internal
|
|
2993
|
-
*/
|
|
2994
|
-
function FloatingTree(props) {
|
|
2995
|
-
const { children, externalTree } = props;
|
|
2996
|
-
const tree = useRefWithInit(() => externalTree ?? new FloatingTreeStore()).current;
|
|
2997
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingTreeContext.Provider, {
|
|
2998
|
-
value: tree,
|
|
2999
|
-
children
|
|
3000
|
-
});
|
|
3001
|
-
}
|
|
3002
2863
|
//#endregion
|
|
3003
2864
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/resolveRef.mjs
|
|
3004
2865
|
/**
|
|
@@ -3445,84 +3306,6 @@ function FloatingFocusManager(props) {
|
|
|
3445
3306
|
] });
|
|
3446
3307
|
}
|
|
3447
3308
|
//#endregion
|
|
3448
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/hooks/useClick.mjs
|
|
3449
|
-
/**
|
|
3450
|
-
* Opens or closes the floating element when clicking the reference element.
|
|
3451
|
-
* @see https://floating-ui.com/docs/useClick
|
|
3452
|
-
*/
|
|
3453
|
-
function useClick(context, props = {}) {
|
|
3454
|
-
const { enabled = true, event: eventOption = "click", toggle = true, ignoreMouse = false, stickIfOpen = true, touchOpenDelay = 0, reason = triggerPress } = props;
|
|
3455
|
-
const store = "rootStore" in context ? context.rootStore : context;
|
|
3456
|
-
const dataRef = store.context.dataRef;
|
|
3457
|
-
const pointerTypeRef = import_react.useRef(void 0);
|
|
3458
|
-
const frame = useAnimationFrame();
|
|
3459
|
-
const touchOpenTimeout = useTimeout();
|
|
3460
|
-
const reference = import_react.useMemo(() => {
|
|
3461
|
-
function setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType) {
|
|
3462
|
-
const details = createChangeEventDetails(reason, nativeEvent, target);
|
|
3463
|
-
if (nextOpen && pointerType === "touch" && touchOpenDelay > 0) touchOpenTimeout.start(touchOpenDelay, () => {
|
|
3464
|
-
store.setOpen(true, details);
|
|
3465
|
-
});
|
|
3466
|
-
else store.setOpen(nextOpen, details);
|
|
3467
|
-
}
|
|
3468
|
-
function getNextOpen(open, currentTarget, isClickLikeOpenEvent) {
|
|
3469
|
-
const openEvent = dataRef.current.openEvent;
|
|
3470
|
-
const hasClickedOnInactiveTrigger = store.select("domReferenceElement") !== currentTarget;
|
|
3471
|
-
if (open && hasClickedOnInactiveTrigger) return true;
|
|
3472
|
-
if (!open) return true;
|
|
3473
|
-
if (!toggle) return true;
|
|
3474
|
-
if (openEvent && stickIfOpen) return !isClickLikeOpenEvent(openEvent.type);
|
|
3475
|
-
return false;
|
|
3476
|
-
}
|
|
3477
|
-
return {
|
|
3478
|
-
onPointerDown(event) {
|
|
3479
|
-
pointerTypeRef.current = event.pointerType;
|
|
3480
|
-
},
|
|
3481
|
-
onMouseDown(event) {
|
|
3482
|
-
const pointerType = pointerTypeRef.current;
|
|
3483
|
-
const nativeEvent = event.nativeEvent;
|
|
3484
|
-
const open = store.select("open");
|
|
3485
|
-
if (event.button !== 0 || eventOption === "click" || isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
3486
|
-
const nextOpen = getNextOpen(open, event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown");
|
|
3487
|
-
const target = getTarget(nativeEvent);
|
|
3488
|
-
if (isTypeableElement(target)) {
|
|
3489
|
-
setOpenWithTouchDelay(nextOpen, nativeEvent, target, pointerType);
|
|
3490
|
-
return;
|
|
3491
|
-
}
|
|
3492
|
-
const eventCurrentTarget = event.currentTarget;
|
|
3493
|
-
frame.request(() => {
|
|
3494
|
-
setOpenWithTouchDelay(nextOpen, nativeEvent, eventCurrentTarget, pointerType);
|
|
3495
|
-
});
|
|
3496
|
-
},
|
|
3497
|
-
onClick(event) {
|
|
3498
|
-
if (eventOption === "mousedown-only") return;
|
|
3499
|
-
const pointerType = pointerTypeRef.current;
|
|
3500
|
-
if (eventOption === "mousedown" && pointerType) {
|
|
3501
|
-
pointerTypeRef.current = void 0;
|
|
3502
|
-
return;
|
|
3503
|
-
}
|
|
3504
|
-
if (isMouseLikePointerType(pointerType, true) && ignoreMouse) return;
|
|
3505
|
-
setOpenWithTouchDelay(getNextOpen(store.select("open"), event.currentTarget, (openEventType) => openEventType === "click" || openEventType === "mousedown" || openEventType === "keydown" || openEventType === "keyup"), event.nativeEvent, event.currentTarget, pointerType);
|
|
3506
|
-
},
|
|
3507
|
-
onKeyDown() {
|
|
3508
|
-
pointerTypeRef.current = void 0;
|
|
3509
|
-
}
|
|
3510
|
-
};
|
|
3511
|
-
}, [
|
|
3512
|
-
dataRef,
|
|
3513
|
-
eventOption,
|
|
3514
|
-
ignoreMouse,
|
|
3515
|
-
reason,
|
|
3516
|
-
store,
|
|
3517
|
-
stickIfOpen,
|
|
3518
|
-
toggle,
|
|
3519
|
-
frame,
|
|
3520
|
-
touchOpenTimeout,
|
|
3521
|
-
touchOpenDelay
|
|
3522
|
-
]);
|
|
3523
|
-
return import_react.useMemo(() => enabled ? { reference } : EMPTY_OBJECT, [enabled, reference]);
|
|
3524
|
-
}
|
|
3525
|
-
//#endregion
|
|
3526
3309
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs
|
|
3527
3310
|
function createVirtualElement(domElement, data) {
|
|
3528
3311
|
let offsetX = null;
|
|
@@ -5738,7 +5521,7 @@ var ReactStore = class extends Store {
|
|
|
5738
5521
|
};
|
|
5739
5522
|
//#endregion
|
|
5740
5523
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs
|
|
5741
|
-
var selectors$
|
|
5524
|
+
var selectors$2 = {
|
|
5742
5525
|
open: createSelector((state) => state.open),
|
|
5743
5526
|
transitionStatus: createSelector((state) => state.transitionStatus),
|
|
5744
5527
|
domReferenceElement: createSelector((state) => state.domReferenceElement),
|
|
@@ -5759,7 +5542,7 @@ var FloatingRootStore = class extends ReactStore {
|
|
|
5759
5542
|
events: createEventEmitter(),
|
|
5760
5543
|
nested,
|
|
5761
5544
|
triggerElements
|
|
5762
|
-
}, selectors$
|
|
5545
|
+
}, selectors$2);
|
|
5763
5546
|
this.syncOnly = syncOnly;
|
|
5764
5547
|
}
|
|
5765
5548
|
/**
|
|
@@ -7157,542 +6940,6 @@ function useHoverReferenceInteraction(context, props = {}) {
|
|
|
7157
6940
|
]);
|
|
7158
6941
|
}
|
|
7159
6942
|
//#endregion
|
|
7160
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/hooks/useListNavigation.mjs
|
|
7161
|
-
var ESCAPE = "Escape";
|
|
7162
|
-
function doSwitch(orientation, vertical, horizontal) {
|
|
7163
|
-
switch (orientation) {
|
|
7164
|
-
case "vertical": return vertical;
|
|
7165
|
-
case "horizontal": return horizontal;
|
|
7166
|
-
default: return vertical || horizontal;
|
|
7167
|
-
}
|
|
7168
|
-
}
|
|
7169
|
-
function isMainOrientationKey(key, orientation) {
|
|
7170
|
-
return doSwitch(orientation, key === "ArrowUp" || key === "ArrowDown", key === "ArrowLeft" || key === "ArrowRight");
|
|
7171
|
-
}
|
|
7172
|
-
function isMainOrientationToEndKey(key, orientation, rtl) {
|
|
7173
|
-
return doSwitch(orientation, key === "ArrowDown", rtl ? key === "ArrowLeft" : key === "ArrowRight") || key === "Enter" || key === " " || key === "";
|
|
7174
|
-
}
|
|
7175
|
-
function isCrossOrientationOpenKey(key, orientation, rtl) {
|
|
7176
|
-
return doSwitch(orientation, rtl ? key === ARROW_LEFT$1 : key === ARROW_RIGHT$1, key === ARROW_DOWN$1);
|
|
7177
|
-
}
|
|
7178
|
-
function isCrossOrientationCloseKey(key, orientation, rtl, grid) {
|
|
7179
|
-
const vertical = rtl ? key === ARROW_RIGHT$1 : key === ARROW_LEFT$1;
|
|
7180
|
-
const horizontal = key === ARROW_UP$1;
|
|
7181
|
-
if (orientation === "both" || orientation === "horizontal" && grid) return key === ESCAPE;
|
|
7182
|
-
return doSwitch(orientation, vertical, horizontal);
|
|
7183
|
-
}
|
|
7184
|
-
/**
|
|
7185
|
-
* Adds arrow key-based navigation of a list of items, either using real DOM
|
|
7186
|
-
* focus or virtual focus.
|
|
7187
|
-
* @see https://floating-ui.com/docs/useListNavigation
|
|
7188
|
-
*/
|
|
7189
|
-
function useListNavigation(context, props) {
|
|
7190
|
-
const { listRef, activeIndex, onNavigate: onNavigateProp = () => {}, enabled = true, selectedIndex = null, allowEscape = false, loopFocus = false, nested = false, rtl = false, virtual = false, focusItemOnOpen = "auto", focusItemOnHover = true, openOnArrowKeyDown = true, disabledIndices = void 0, orientation = "vertical", parentOrientation, id, resetOnPointerLeave = true, externalTree, grid: navigateGrid } = props;
|
|
7191
|
-
const isGrid = navigateGrid != null;
|
|
7192
|
-
const store = "rootStore" in context ? context.rootStore : context;
|
|
7193
|
-
const open = store.useState("open");
|
|
7194
|
-
const floatingElement = store.useState("floatingElement");
|
|
7195
|
-
const domReferenceElement = store.useState("domReferenceElement");
|
|
7196
|
-
const dataRef = store.context.dataRef;
|
|
7197
|
-
const floatingFocusElement = getFloatingFocusElement(floatingElement);
|
|
7198
|
-
const typeableComboboxReference = isTypeableCombobox(domReferenceElement);
|
|
7199
|
-
const floatingFocusElementRef = useValueAsRef(floatingFocusElement);
|
|
7200
|
-
const parentId = useFloatingParentNodeId();
|
|
7201
|
-
const tree = useFloatingTree(externalTree);
|
|
7202
|
-
const focusItemOnOpenRef = import_react.useRef(focusItemOnOpen);
|
|
7203
|
-
const indexRef = import_react.useRef(selectedIndex ?? -1);
|
|
7204
|
-
const keyRef = import_react.useRef(null);
|
|
7205
|
-
const isPointerModalityRef = import_react.useRef(true);
|
|
7206
|
-
const onNavigate = useStableCallback((event) => {
|
|
7207
|
-
onNavigateProp(indexRef.current === -1 ? null : indexRef.current, event);
|
|
7208
|
-
});
|
|
7209
|
-
const previousMountedRef = import_react.useRef(!!floatingElement);
|
|
7210
|
-
const previousOpenRef = import_react.useRef(open);
|
|
7211
|
-
const forceSyncFocusRef = import_react.useRef(false);
|
|
7212
|
-
const forceScrollIntoViewRef = import_react.useRef(false);
|
|
7213
|
-
const cancelQueuedFocusRef = import_react.useRef(null);
|
|
7214
|
-
const disabledIndicesRef = useValueAsRef(disabledIndices);
|
|
7215
|
-
const latestOpenRef = useValueAsRef(open);
|
|
7216
|
-
const selectedIndexRef = useValueAsRef(selectedIndex);
|
|
7217
|
-
const resetOnPointerLeaveRef = useValueAsRef(resetOnPointerLeave);
|
|
7218
|
-
const focusFrame = useAnimationFrame();
|
|
7219
|
-
const waitForListPopulatedFrame = useAnimationFrame();
|
|
7220
|
-
const focusItem = useStableCallback(() => {
|
|
7221
|
-
function runFocus(item) {
|
|
7222
|
-
if (virtual) tree?.events.emit("virtualfocus", item);
|
|
7223
|
-
else cancelQueuedFocusRef.current = enqueueFocus(item, {
|
|
7224
|
-
sync: forceSyncFocusRef.current,
|
|
7225
|
-
preventScroll: true
|
|
7226
|
-
});
|
|
7227
|
-
}
|
|
7228
|
-
const initialItem = listRef.current[indexRef.current];
|
|
7229
|
-
const forceScrollIntoView = forceScrollIntoViewRef.current;
|
|
7230
|
-
if (initialItem) runFocus(initialItem);
|
|
7231
|
-
(forceSyncFocusRef.current ? (callback) => callback() : (callback) => focusFrame.request(callback))(() => {
|
|
7232
|
-
const waitedItem = listRef.current[indexRef.current] || initialItem;
|
|
7233
|
-
if (!waitedItem) return;
|
|
7234
|
-
if (!initialItem) runFocus(waitedItem);
|
|
7235
|
-
if (item && (forceScrollIntoView || !isPointerModalityRef.current)) waitedItem.scrollIntoView?.({
|
|
7236
|
-
block: "nearest",
|
|
7237
|
-
inline: "nearest"
|
|
7238
|
-
});
|
|
7239
|
-
});
|
|
7240
|
-
});
|
|
7241
|
-
useIsoLayoutEffect(() => {
|
|
7242
|
-
dataRef.current.orientation = orientation;
|
|
7243
|
-
}, [dataRef, orientation]);
|
|
7244
|
-
useIsoLayoutEffect(() => {
|
|
7245
|
-
if (!enabled) return;
|
|
7246
|
-
if (open && floatingElement) {
|
|
7247
|
-
indexRef.current = selectedIndex ?? -1;
|
|
7248
|
-
if (focusItemOnOpenRef.current && selectedIndex != null) {
|
|
7249
|
-
forceScrollIntoViewRef.current = true;
|
|
7250
|
-
onNavigate();
|
|
7251
|
-
}
|
|
7252
|
-
} else if (previousMountedRef.current) {
|
|
7253
|
-
indexRef.current = -1;
|
|
7254
|
-
onNavigate();
|
|
7255
|
-
}
|
|
7256
|
-
}, [
|
|
7257
|
-
enabled,
|
|
7258
|
-
open,
|
|
7259
|
-
floatingElement,
|
|
7260
|
-
selectedIndex,
|
|
7261
|
-
onNavigate
|
|
7262
|
-
]);
|
|
7263
|
-
useIsoLayoutEffect(() => {
|
|
7264
|
-
if (!enabled) return;
|
|
7265
|
-
if (!open) {
|
|
7266
|
-
forceSyncFocusRef.current = false;
|
|
7267
|
-
return;
|
|
7268
|
-
}
|
|
7269
|
-
if (!floatingElement) return;
|
|
7270
|
-
if (activeIndex == null) {
|
|
7271
|
-
forceSyncFocusRef.current = false;
|
|
7272
|
-
if (selectedIndexRef.current != null) return;
|
|
7273
|
-
if (previousMountedRef.current) {
|
|
7274
|
-
indexRef.current = -1;
|
|
7275
|
-
focusItem();
|
|
7276
|
-
}
|
|
7277
|
-
if ((!previousOpenRef.current || !previousMountedRef.current) && focusItemOnOpenRef.current && (keyRef.current != null || focusItemOnOpenRef.current === true && keyRef.current == null)) {
|
|
7278
|
-
let runs = 0;
|
|
7279
|
-
const waitForListPopulated = () => {
|
|
7280
|
-
if (listRef.current[0] == null) {
|
|
7281
|
-
if (runs < 2) (runs ? (callback) => waitForListPopulatedFrame.request(callback) : queueMicrotask)(waitForListPopulated);
|
|
7282
|
-
runs += 1;
|
|
7283
|
-
} else {
|
|
7284
|
-
indexRef.current = keyRef.current == null || isMainOrientationToEndKey(keyRef.current, orientation, rtl) || nested ? getMinListIndex(listRef) : getMaxListIndex(listRef);
|
|
7285
|
-
keyRef.current = null;
|
|
7286
|
-
onNavigate();
|
|
7287
|
-
}
|
|
7288
|
-
};
|
|
7289
|
-
waitForListPopulated();
|
|
7290
|
-
}
|
|
7291
|
-
} else if (!isIndexOutOfListBounds(listRef.current, activeIndex)) {
|
|
7292
|
-
indexRef.current = activeIndex;
|
|
7293
|
-
focusItem();
|
|
7294
|
-
forceScrollIntoViewRef.current = false;
|
|
7295
|
-
}
|
|
7296
|
-
}, [
|
|
7297
|
-
enabled,
|
|
7298
|
-
open,
|
|
7299
|
-
floatingElement,
|
|
7300
|
-
activeIndex,
|
|
7301
|
-
selectedIndexRef,
|
|
7302
|
-
nested,
|
|
7303
|
-
listRef,
|
|
7304
|
-
orientation,
|
|
7305
|
-
rtl,
|
|
7306
|
-
onNavigate,
|
|
7307
|
-
focusItem,
|
|
7308
|
-
waitForListPopulatedFrame
|
|
7309
|
-
]);
|
|
7310
|
-
useIsoLayoutEffect(() => {
|
|
7311
|
-
if (!enabled || floatingElement || !tree || virtual || !previousMountedRef.current) return;
|
|
7312
|
-
const nodes = tree.nodesRef.current;
|
|
7313
|
-
const parent = nodes.find((node) => node.id === parentId)?.context?.elements.floating;
|
|
7314
|
-
const activeEl = activeElement(ownerDocument(domReferenceElement ?? parent ?? null));
|
|
7315
|
-
const treeContainsActiveEl = nodes.some((node) => node.context && contains(node.context.elements.floating, activeEl));
|
|
7316
|
-
if (parent && !treeContainsActiveEl && isPointerModalityRef.current) parent.focus({ preventScroll: true });
|
|
7317
|
-
}, [
|
|
7318
|
-
enabled,
|
|
7319
|
-
floatingElement,
|
|
7320
|
-
domReferenceElement,
|
|
7321
|
-
tree,
|
|
7322
|
-
parentId,
|
|
7323
|
-
virtual
|
|
7324
|
-
]);
|
|
7325
|
-
useIsoLayoutEffect(() => {
|
|
7326
|
-
previousOpenRef.current = open;
|
|
7327
|
-
previousMountedRef.current = !!floatingElement;
|
|
7328
|
-
});
|
|
7329
|
-
useIsoLayoutEffect(() => {
|
|
7330
|
-
if (!open) {
|
|
7331
|
-
keyRef.current = null;
|
|
7332
|
-
focusItemOnOpenRef.current = focusItemOnOpen;
|
|
7333
|
-
}
|
|
7334
|
-
}, [open, focusItemOnOpen]);
|
|
7335
|
-
const hasActiveIndex = activeIndex != null;
|
|
7336
|
-
const syncCurrentTarget = useStableCallback((event) => {
|
|
7337
|
-
if (!latestOpenRef.current) return;
|
|
7338
|
-
const index = listRef.current.indexOf(event.currentTarget);
|
|
7339
|
-
if (index !== -1 && (indexRef.current !== index || activeIndex !== index)) {
|
|
7340
|
-
indexRef.current = index;
|
|
7341
|
-
onNavigate(event);
|
|
7342
|
-
}
|
|
7343
|
-
});
|
|
7344
|
-
const getParentOrientation = useStableCallback(() => {
|
|
7345
|
-
return parentOrientation ?? tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.dataRef?.current.orientation;
|
|
7346
|
-
});
|
|
7347
|
-
const getMinEnabledIndex = useStableCallback(() => {
|
|
7348
|
-
return getMinListIndex(listRef, disabledIndicesRef.current);
|
|
7349
|
-
});
|
|
7350
|
-
const commonOnKeyDown = useStableCallback((event) => {
|
|
7351
|
-
isPointerModalityRef.current = false;
|
|
7352
|
-
forceSyncFocusRef.current = true;
|
|
7353
|
-
if (event.which === 229) return;
|
|
7354
|
-
if (!latestOpenRef.current && event.currentTarget === floatingFocusElementRef.current) return;
|
|
7355
|
-
if (nested && isCrossOrientationCloseKey(event.key, orientation, rtl, isGrid)) {
|
|
7356
|
-
if (!isMainOrientationKey(event.key, getParentOrientation())) stopEvent(event);
|
|
7357
|
-
store.setOpen(false, createChangeEventDetails(listNavigation, event.nativeEvent));
|
|
7358
|
-
if (isHTMLElement(domReferenceElement)) if (virtual) tree?.events.emit("virtualfocus", domReferenceElement);
|
|
7359
|
-
else domReferenceElement.focus();
|
|
7360
|
-
return;
|
|
7361
|
-
}
|
|
7362
|
-
const currentIndex = indexRef.current;
|
|
7363
|
-
const minIndex = getMinListIndex(listRef, disabledIndices);
|
|
7364
|
-
const maxIndex = getMaxListIndex(listRef, disabledIndices);
|
|
7365
|
-
if (!typeableComboboxReference) {
|
|
7366
|
-
if (event.key === "Home") {
|
|
7367
|
-
stopEvent(event);
|
|
7368
|
-
indexRef.current = minIndex;
|
|
7369
|
-
onNavigate(event);
|
|
7370
|
-
}
|
|
7371
|
-
if (event.key === "End") {
|
|
7372
|
-
stopEvent(event);
|
|
7373
|
-
indexRef.current = maxIndex;
|
|
7374
|
-
onNavigate(event);
|
|
7375
|
-
}
|
|
7376
|
-
}
|
|
7377
|
-
if (navigateGrid != null) {
|
|
7378
|
-
const index = navigateGrid(event, indexRef.current, listRef, orientation, loopFocus, rtl, disabledIndices, minIndex, maxIndex);
|
|
7379
|
-
if (index != null) {
|
|
7380
|
-
indexRef.current = index;
|
|
7381
|
-
onNavigate(event);
|
|
7382
|
-
}
|
|
7383
|
-
if (orientation === "both") return;
|
|
7384
|
-
}
|
|
7385
|
-
if (isMainOrientationKey(event.key, orientation)) {
|
|
7386
|
-
stopEvent(event);
|
|
7387
|
-
if (open && !virtual && activeElement(event.currentTarget.ownerDocument) === event.currentTarget) {
|
|
7388
|
-
indexRef.current = isMainOrientationToEndKey(event.key, orientation, rtl) ? minIndex : maxIndex;
|
|
7389
|
-
onNavigate(event);
|
|
7390
|
-
return;
|
|
7391
|
-
}
|
|
7392
|
-
if (isMainOrientationToEndKey(event.key, orientation, rtl)) if (loopFocus) if (currentIndex >= maxIndex) if (allowEscape && currentIndex !== listRef.current.length) indexRef.current = -1;
|
|
7393
|
-
else {
|
|
7394
|
-
forceSyncFocusRef.current = false;
|
|
7395
|
-
indexRef.current = minIndex;
|
|
7396
|
-
}
|
|
7397
|
-
else indexRef.current = findNonDisabledListIndex(listRef.current, {
|
|
7398
|
-
startingIndex: currentIndex,
|
|
7399
|
-
disabledIndices
|
|
7400
|
-
});
|
|
7401
|
-
else indexRef.current = Math.min(maxIndex, findNonDisabledListIndex(listRef.current, {
|
|
7402
|
-
startingIndex: currentIndex,
|
|
7403
|
-
disabledIndices
|
|
7404
|
-
}));
|
|
7405
|
-
else if (loopFocus) if (currentIndex <= minIndex) if (allowEscape && currentIndex !== -1) indexRef.current = listRef.current.length;
|
|
7406
|
-
else {
|
|
7407
|
-
forceSyncFocusRef.current = false;
|
|
7408
|
-
indexRef.current = maxIndex;
|
|
7409
|
-
}
|
|
7410
|
-
else indexRef.current = findNonDisabledListIndex(listRef.current, {
|
|
7411
|
-
startingIndex: currentIndex,
|
|
7412
|
-
decrement: true,
|
|
7413
|
-
disabledIndices
|
|
7414
|
-
});
|
|
7415
|
-
else indexRef.current = Math.max(minIndex, findNonDisabledListIndex(listRef.current, {
|
|
7416
|
-
startingIndex: currentIndex,
|
|
7417
|
-
decrement: true,
|
|
7418
|
-
disabledIndices
|
|
7419
|
-
}));
|
|
7420
|
-
if (isIndexOutOfListBounds(listRef.current, indexRef.current)) indexRef.current = -1;
|
|
7421
|
-
onNavigate(event);
|
|
7422
|
-
}
|
|
7423
|
-
});
|
|
7424
|
-
const item = import_react.useMemo(() => {
|
|
7425
|
-
return {
|
|
7426
|
-
onFocus(event) {
|
|
7427
|
-
forceSyncFocusRef.current = true;
|
|
7428
|
-
syncCurrentTarget(event);
|
|
7429
|
-
},
|
|
7430
|
-
onClick: ({ currentTarget }) => currentTarget.focus({ preventScroll: true }),
|
|
7431
|
-
onMouseMove(event) {
|
|
7432
|
-
forceSyncFocusRef.current = true;
|
|
7433
|
-
forceScrollIntoViewRef.current = false;
|
|
7434
|
-
if (focusItemOnHover) syncCurrentTarget(event);
|
|
7435
|
-
},
|
|
7436
|
-
onPointerLeave(event) {
|
|
7437
|
-
if (!latestOpenRef.current || !isPointerModalityRef.current || event.pointerType === "touch") return;
|
|
7438
|
-
forceSyncFocusRef.current = true;
|
|
7439
|
-
const relatedTarget = event.relatedTarget;
|
|
7440
|
-
if (!focusItemOnHover || listRef.current.includes(relatedTarget)) return;
|
|
7441
|
-
if (!resetOnPointerLeaveRef.current) return;
|
|
7442
|
-
cancelQueuedFocusRef.current?.();
|
|
7443
|
-
cancelQueuedFocusRef.current = null;
|
|
7444
|
-
indexRef.current = -1;
|
|
7445
|
-
onNavigate(event);
|
|
7446
|
-
if (!virtual) {
|
|
7447
|
-
const floatingFocusEl = floatingFocusElementRef.current;
|
|
7448
|
-
const activeEl = activeElement(ownerDocument(floatingFocusEl));
|
|
7449
|
-
if (floatingFocusEl && contains(floatingFocusEl, activeEl)) floatingFocusEl.focus({ preventScroll: true });
|
|
7450
|
-
}
|
|
7451
|
-
}
|
|
7452
|
-
};
|
|
7453
|
-
}, [
|
|
7454
|
-
syncCurrentTarget,
|
|
7455
|
-
latestOpenRef,
|
|
7456
|
-
floatingFocusElementRef,
|
|
7457
|
-
focusItemOnHover,
|
|
7458
|
-
listRef,
|
|
7459
|
-
onNavigate,
|
|
7460
|
-
resetOnPointerLeaveRef,
|
|
7461
|
-
virtual
|
|
7462
|
-
]);
|
|
7463
|
-
const ariaActiveDescendantProp = import_react.useMemo(() => {
|
|
7464
|
-
return virtual && open && hasActiveIndex && { "aria-activedescendant": `${id}-${activeIndex}` };
|
|
7465
|
-
}, [
|
|
7466
|
-
virtual,
|
|
7467
|
-
open,
|
|
7468
|
-
hasActiveIndex,
|
|
7469
|
-
id,
|
|
7470
|
-
activeIndex
|
|
7471
|
-
]);
|
|
7472
|
-
const floating = import_react.useMemo(() => {
|
|
7473
|
-
return {
|
|
7474
|
-
"aria-orientation": orientation === "both" ? void 0 : orientation,
|
|
7475
|
-
...!typeableComboboxReference ? ariaActiveDescendantProp : {},
|
|
7476
|
-
onKeyDown(event) {
|
|
7477
|
-
if (event.key === "Tab" && event.shiftKey && open && !virtual) {
|
|
7478
|
-
const target = getTarget(event.nativeEvent);
|
|
7479
|
-
if (target && !contains(floatingFocusElementRef.current, target)) return;
|
|
7480
|
-
stopEvent(event);
|
|
7481
|
-
store.setOpen(false, createChangeEventDetails(focusOut, event.nativeEvent));
|
|
7482
|
-
if (isHTMLElement(domReferenceElement)) domReferenceElement.focus();
|
|
7483
|
-
return;
|
|
7484
|
-
}
|
|
7485
|
-
commonOnKeyDown(event);
|
|
7486
|
-
},
|
|
7487
|
-
onPointerMove() {
|
|
7488
|
-
isPointerModalityRef.current = true;
|
|
7489
|
-
}
|
|
7490
|
-
};
|
|
7491
|
-
}, [
|
|
7492
|
-
ariaActiveDescendantProp,
|
|
7493
|
-
commonOnKeyDown,
|
|
7494
|
-
floatingFocusElementRef,
|
|
7495
|
-
orientation,
|
|
7496
|
-
typeableComboboxReference,
|
|
7497
|
-
store,
|
|
7498
|
-
open,
|
|
7499
|
-
virtual,
|
|
7500
|
-
domReferenceElement
|
|
7501
|
-
]);
|
|
7502
|
-
const trigger = import_react.useMemo(() => {
|
|
7503
|
-
function openOnNavigationKeyDown(event) {
|
|
7504
|
-
store.setOpen(true, createChangeEventDetails(listNavigation, event.nativeEvent, event.currentTarget));
|
|
7505
|
-
}
|
|
7506
|
-
function checkVirtualMouse(event) {
|
|
7507
|
-
if (focusItemOnOpen === "auto" && isVirtualClick(event.nativeEvent)) focusItemOnOpenRef.current = !virtual;
|
|
7508
|
-
}
|
|
7509
|
-
function checkVirtualPointer(event) {
|
|
7510
|
-
focusItemOnOpenRef.current = focusItemOnOpen;
|
|
7511
|
-
if (focusItemOnOpen === "auto" && isVirtualPointerEvent(event.nativeEvent)) focusItemOnOpenRef.current = true;
|
|
7512
|
-
}
|
|
7513
|
-
return {
|
|
7514
|
-
onKeyDown(event) {
|
|
7515
|
-
const currentOpen = store.select("open");
|
|
7516
|
-
isPointerModalityRef.current = false;
|
|
7517
|
-
const isArrowKey = event.key.startsWith("Arrow");
|
|
7518
|
-
const isParentCrossOpenKey = isCrossOrientationOpenKey(event.key, getParentOrientation(), rtl);
|
|
7519
|
-
const isMainKey = isMainOrientationKey(event.key, orientation);
|
|
7520
|
-
const isNavigationKey = (nested ? isParentCrossOpenKey : isMainKey) || event.key === "Enter" || event.key.trim() === "";
|
|
7521
|
-
if (virtual && currentOpen) return commonOnKeyDown(event);
|
|
7522
|
-
if (!currentOpen && !openOnArrowKeyDown && isArrowKey) return;
|
|
7523
|
-
if (isNavigationKey) {
|
|
7524
|
-
const isParentMainKey = isMainOrientationKey(event.key, getParentOrientation());
|
|
7525
|
-
keyRef.current = nested && isParentMainKey ? null : event.key;
|
|
7526
|
-
}
|
|
7527
|
-
if (nested) {
|
|
7528
|
-
if (isParentCrossOpenKey) {
|
|
7529
|
-
stopEvent(event);
|
|
7530
|
-
if (currentOpen) {
|
|
7531
|
-
indexRef.current = getMinEnabledIndex();
|
|
7532
|
-
onNavigate(event);
|
|
7533
|
-
} else openOnNavigationKeyDown(event);
|
|
7534
|
-
}
|
|
7535
|
-
return;
|
|
7536
|
-
}
|
|
7537
|
-
if (isMainKey) {
|
|
7538
|
-
if (selectedIndexRef.current != null) indexRef.current = selectedIndexRef.current;
|
|
7539
|
-
stopEvent(event);
|
|
7540
|
-
if (!currentOpen && openOnArrowKeyDown) openOnNavigationKeyDown(event);
|
|
7541
|
-
else commonOnKeyDown(event);
|
|
7542
|
-
if (currentOpen) onNavigate(event);
|
|
7543
|
-
}
|
|
7544
|
-
},
|
|
7545
|
-
onFocus(event) {
|
|
7546
|
-
if (store.select("open") && !virtual) {
|
|
7547
|
-
indexRef.current = -1;
|
|
7548
|
-
onNavigate(event);
|
|
7549
|
-
}
|
|
7550
|
-
},
|
|
7551
|
-
onPointerDown: checkVirtualPointer,
|
|
7552
|
-
onPointerEnter: checkVirtualPointer,
|
|
7553
|
-
onMouseDown: checkVirtualMouse,
|
|
7554
|
-
onClick: checkVirtualMouse
|
|
7555
|
-
};
|
|
7556
|
-
}, [
|
|
7557
|
-
commonOnKeyDown,
|
|
7558
|
-
focusItemOnOpen,
|
|
7559
|
-
getMinEnabledIndex,
|
|
7560
|
-
nested,
|
|
7561
|
-
onNavigate,
|
|
7562
|
-
store,
|
|
7563
|
-
openOnArrowKeyDown,
|
|
7564
|
-
orientation,
|
|
7565
|
-
getParentOrientation,
|
|
7566
|
-
rtl,
|
|
7567
|
-
selectedIndexRef,
|
|
7568
|
-
virtual
|
|
7569
|
-
]);
|
|
7570
|
-
const reference = import_react.useMemo(() => {
|
|
7571
|
-
return {
|
|
7572
|
-
...ariaActiveDescendantProp,
|
|
7573
|
-
...trigger
|
|
7574
|
-
};
|
|
7575
|
-
}, [ariaActiveDescendantProp, trigger]);
|
|
7576
|
-
return import_react.useMemo(() => enabled ? {
|
|
7577
|
-
reference,
|
|
7578
|
-
floating,
|
|
7579
|
-
item,
|
|
7580
|
-
trigger
|
|
7581
|
-
} : {}, [
|
|
7582
|
-
enabled,
|
|
7583
|
-
reference,
|
|
7584
|
-
floating,
|
|
7585
|
-
trigger,
|
|
7586
|
-
item
|
|
7587
|
-
]);
|
|
7588
|
-
}
|
|
7589
|
-
//#endregion
|
|
7590
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/hooks/useTypeahead.mjs
|
|
7591
|
-
/**
|
|
7592
|
-
* Provides a matching callback that can be used to focus an item as the user
|
|
7593
|
-
* types, often used in tandem with `useListNavigation()`.
|
|
7594
|
-
* @see https://floating-ui.com/docs/useTypeahead
|
|
7595
|
-
*/
|
|
7596
|
-
function useTypeahead(context, props) {
|
|
7597
|
-
const { listRef, elementsRef, activeIndex, onMatch: onMatchProp, disabledIndices, onTyping, enabled = true, resetMs = 750, selectedIndex = null } = props;
|
|
7598
|
-
const store = "rootStore" in context ? context.rootStore : context;
|
|
7599
|
-
const open = store.useState("open");
|
|
7600
|
-
const timeout = useTimeout();
|
|
7601
|
-
const stringRef = import_react.useRef("");
|
|
7602
|
-
const prevIndexRef = import_react.useRef(selectedIndex ?? activeIndex ?? -1);
|
|
7603
|
-
const matchIndexRef = import_react.useRef(null);
|
|
7604
|
-
const onKeyDown = useStableCallback((event) => {
|
|
7605
|
-
function isVisible(index) {
|
|
7606
|
-
const element = elementsRef?.current[index];
|
|
7607
|
-
return !element || isElementVisible(element);
|
|
7608
|
-
}
|
|
7609
|
-
function isItemAvailable(index) {
|
|
7610
|
-
if (!isVisible(index)) return false;
|
|
7611
|
-
return disabledIndices == null || !isListIndexDisabled(EMPTY_ARRAY, index, disabledIndices);
|
|
7612
|
-
}
|
|
7613
|
-
function getMatchingIndex(list, string, startIndex = 0) {
|
|
7614
|
-
if (list.length === 0) return -1;
|
|
7615
|
-
const normalizedStartIndex = (startIndex % list.length + list.length) % list.length;
|
|
7616
|
-
const lowerString = string.toLowerCase();
|
|
7617
|
-
for (let offset = 0; offset < list.length; offset += 1) {
|
|
7618
|
-
const index = (normalizedStartIndex + offset) % list.length;
|
|
7619
|
-
if (!list[index]?.toLowerCase().startsWith(lowerString) || !isItemAvailable(index)) continue;
|
|
7620
|
-
return index;
|
|
7621
|
-
}
|
|
7622
|
-
return -1;
|
|
7623
|
-
}
|
|
7624
|
-
const listContent = listRef.current;
|
|
7625
|
-
if (stringRef.current.length > 0 && event.key === " ") {
|
|
7626
|
-
stopEvent(event);
|
|
7627
|
-
onTyping?.(true);
|
|
7628
|
-
}
|
|
7629
|
-
if (stringRef.current.length > 0 && stringRef.current[0] !== " ") {
|
|
7630
|
-
if (getMatchingIndex(listContent, stringRef.current) === -1 && event.key !== " ") onTyping?.(false);
|
|
7631
|
-
}
|
|
7632
|
-
if (listContent == null || event.key.length !== 1 || event.ctrlKey || event.metaKey || event.altKey) return;
|
|
7633
|
-
if (open && event.key !== " ") {
|
|
7634
|
-
stopEvent(event);
|
|
7635
|
-
onTyping?.(true);
|
|
7636
|
-
}
|
|
7637
|
-
const isNewSession = stringRef.current === "";
|
|
7638
|
-
if (isNewSession) prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;
|
|
7639
|
-
if (listContent.every((text, index) => text && isItemAvailable(index) ? text[0]?.toLowerCase() !== text[1]?.toLowerCase() : true) && stringRef.current === event.key) {
|
|
7640
|
-
stringRef.current = "";
|
|
7641
|
-
prevIndexRef.current = matchIndexRef.current;
|
|
7642
|
-
}
|
|
7643
|
-
stringRef.current += event.key;
|
|
7644
|
-
timeout.start(resetMs, () => {
|
|
7645
|
-
stringRef.current = "";
|
|
7646
|
-
prevIndexRef.current = matchIndexRef.current;
|
|
7647
|
-
onTyping?.(false);
|
|
7648
|
-
});
|
|
7649
|
-
const startIndex = ((isNewSession ? selectedIndex ?? activeIndex ?? -1 : prevIndexRef.current) ?? 0) + 1;
|
|
7650
|
-
const index = getMatchingIndex(listContent, stringRef.current, startIndex);
|
|
7651
|
-
if (index !== -1) {
|
|
7652
|
-
onMatchProp?.(index);
|
|
7653
|
-
matchIndexRef.current = index;
|
|
7654
|
-
} else if (event.key !== " ") {
|
|
7655
|
-
stringRef.current = "";
|
|
7656
|
-
onTyping?.(false);
|
|
7657
|
-
}
|
|
7658
|
-
});
|
|
7659
|
-
const onBlur = useStableCallback((event) => {
|
|
7660
|
-
const next = event.relatedTarget;
|
|
7661
|
-
const currentDomReferenceElement = store.select("domReferenceElement");
|
|
7662
|
-
const currentFloatingElement = store.select("floatingElement");
|
|
7663
|
-
if (contains(currentDomReferenceElement, next) || contains(currentFloatingElement, next)) return;
|
|
7664
|
-
timeout.clear();
|
|
7665
|
-
stringRef.current = "";
|
|
7666
|
-
prevIndexRef.current = matchIndexRef.current;
|
|
7667
|
-
onTyping?.(false);
|
|
7668
|
-
});
|
|
7669
|
-
useIsoLayoutEffect(() => {
|
|
7670
|
-
if (!open && selectedIndex !== null) return;
|
|
7671
|
-
timeout.clear();
|
|
7672
|
-
matchIndexRef.current = null;
|
|
7673
|
-
if (stringRef.current !== "") stringRef.current = "";
|
|
7674
|
-
}, [
|
|
7675
|
-
open,
|
|
7676
|
-
selectedIndex,
|
|
7677
|
-
timeout
|
|
7678
|
-
]);
|
|
7679
|
-
useIsoLayoutEffect(() => {
|
|
7680
|
-
if (open && stringRef.current === "") prevIndexRef.current = selectedIndex ?? activeIndex ?? -1;
|
|
7681
|
-
}, [
|
|
7682
|
-
open,
|
|
7683
|
-
selectedIndex,
|
|
7684
|
-
activeIndex
|
|
7685
|
-
]);
|
|
7686
|
-
const sharedProps = import_react.useMemo(() => ({
|
|
7687
|
-
onKeyDown,
|
|
7688
|
-
onBlur
|
|
7689
|
-
}), [onKeyDown, onBlur]);
|
|
7690
|
-
return import_react.useMemo(() => enabled ? {
|
|
7691
|
-
reference: sharedProps,
|
|
7692
|
-
floating: sharedProps
|
|
7693
|
-
} : {}, [enabled, sharedProps]);
|
|
7694
|
-
}
|
|
7695
|
-
//#endregion
|
|
7696
6943
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs
|
|
7697
6944
|
var CURSOR_SPEED_THRESHOLD = .1;
|
|
7698
6945
|
var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD;
|
|
@@ -7936,7 +7183,7 @@ var COMPOSITE_KEYS = new Set([
|
|
|
7936
7183
|
]);
|
|
7937
7184
|
//#endregion
|
|
7938
7185
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
|
|
7939
|
-
var stateAttributesMapping$
|
|
7186
|
+
var stateAttributesMapping$1 = {
|
|
7940
7187
|
...popupStateMapping,
|
|
7941
7188
|
...transitionStatusMapping,
|
|
7942
7189
|
nestedDialogOpen(value) {
|
|
@@ -8006,7 +7253,7 @@ var DialogPopup = /*#__PURE__*/ import_react.forwardRef(function DialogPopup(com
|
|
|
8006
7253
|
store.context.popupRef,
|
|
8007
7254
|
setPopupElement
|
|
8008
7255
|
],
|
|
8009
|
-
stateAttributesMapping: stateAttributesMapping$
|
|
7256
|
+
stateAttributesMapping: stateAttributesMapping$1
|
|
8010
7257
|
});
|
|
8011
7258
|
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
|
8012
7259
|
context: floatingRootContext,
|
|
@@ -8337,7 +7584,7 @@ function DialogInteractions({ store, parentContext, isDrawer }) {
|
|
|
8337
7584
|
}
|
|
8338
7585
|
//#endregion
|
|
8339
7586
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/dialog/store/DialogStore.mjs
|
|
8340
|
-
var selectors$
|
|
7587
|
+
var selectors$1 = {
|
|
8341
7588
|
...popupStoreSelectors,
|
|
8342
7589
|
modal: createSelector((state) => state.modal),
|
|
8343
7590
|
nested: createSelector((state) => state.nested),
|
|
@@ -8353,7 +7600,7 @@ var selectors$2 = {
|
|
|
8353
7600
|
var DialogStore = class DialogStore extends ReactStore {
|
|
8354
7601
|
constructor(initialState, floatingId, nested = false) {
|
|
8355
7602
|
const triggerElements = new PopupTriggerMap();
|
|
8356
|
-
const state = createInitialState$
|
|
7603
|
+
const state = createInitialState$1(initialState);
|
|
8357
7604
|
state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);
|
|
8358
7605
|
super(state, {
|
|
8359
7606
|
popupRef: /*#__PURE__*/ import_react.createRef(),
|
|
@@ -8363,7 +7610,7 @@ var DialogStore = class DialogStore extends ReactStore {
|
|
|
8363
7610
|
triggerElements,
|
|
8364
7611
|
onOpenChange: void 0,
|
|
8365
7612
|
onOpenChangeComplete: void 0
|
|
8366
|
-
}, selectors$
|
|
7613
|
+
}, selectors$1);
|
|
8367
7614
|
}
|
|
8368
7615
|
setOpen = (nextOpen, eventDetails) => {
|
|
8369
7616
|
eventDetails.preventUnmountOnClose = () => {
|
|
@@ -8381,7 +7628,7 @@ var DialogStore = class DialogStore extends ReactStore {
|
|
|
8381
7628
|
return usePopupStore(externalStore, (floatingId, nested) => new DialogStore(initialState, floatingId, nested), true).store;
|
|
8382
7629
|
}
|
|
8383
7630
|
};
|
|
8384
|
-
function createInitialState$
|
|
7631
|
+
function createInitialState$1(initialState = {}) {
|
|
8385
7632
|
return {
|
|
8386
7633
|
...createInitialPopupStoreState(),
|
|
8387
7634
|
modal: true,
|
|
@@ -8488,75 +7735,6 @@ var DialogTitle = /*#__PURE__*/ import_react.forwardRef(function DialogTitle(com
|
|
|
8488
7735
|
});
|
|
8489
7736
|
});
|
|
8490
7737
|
//#endregion
|
|
8491
|
-
//#region ../../node_modules/.pnpm/@base-ui+utils@0.3.1_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/utils/useEnhancedClickHandler.mjs
|
|
8492
|
-
/**
|
|
8493
|
-
* Provides a cross-browser way to determine the type of the pointer used to click.
|
|
8494
|
-
* Safari and Firefox do not provide the PointerEvent to the click handler (they use MouseEvent) yet.
|
|
8495
|
-
* Additionally, this implementation detects if the click was triggered by the keyboard.
|
|
8496
|
-
*
|
|
8497
|
-
* @param handler The function to be called when the button is clicked. The first parameter is the original event and the second parameter is the pointer type.
|
|
8498
|
-
*/
|
|
8499
|
-
function useEnhancedClickHandler(handler) {
|
|
8500
|
-
const lastClickInteractionTypeRef = import_react.useRef("");
|
|
8501
|
-
const handlePointerDown = import_react.useCallback((event) => {
|
|
8502
|
-
if (event.defaultPrevented) return;
|
|
8503
|
-
lastClickInteractionTypeRef.current = event.pointerType;
|
|
8504
|
-
handler(event, event.pointerType);
|
|
8505
|
-
}, [handler]);
|
|
8506
|
-
return {
|
|
8507
|
-
onClick: import_react.useCallback((event) => {
|
|
8508
|
-
if (event.detail === 0) {
|
|
8509
|
-
handler(event, "keyboard");
|
|
8510
|
-
return;
|
|
8511
|
-
}
|
|
8512
|
-
if ("pointerType" in event) handler(event, event.pointerType);
|
|
8513
|
-
else handler(event, lastClickInteractionTypeRef.current);
|
|
8514
|
-
lastClickInteractionTypeRef.current = "";
|
|
8515
|
-
}, [handler]),
|
|
8516
|
-
onPointerDown: handlePointerDown
|
|
8517
|
-
};
|
|
8518
|
-
}
|
|
8519
|
-
//#endregion
|
|
8520
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/useValueChanged.mjs
|
|
8521
|
-
function useValueChanged(value, onChange) {
|
|
8522
|
-
const valueRef = import_react.useRef(value);
|
|
8523
|
-
const onChangeCallback = useStableCallback(onChange);
|
|
8524
|
-
useIsoLayoutEffect(() => {
|
|
8525
|
-
if (valueRef.current === value) return;
|
|
8526
|
-
onChangeCallback(valueRef.current);
|
|
8527
|
-
}, [value, onChangeCallback]);
|
|
8528
|
-
useIsoLayoutEffect(() => {
|
|
8529
|
-
valueRef.current = value;
|
|
8530
|
-
}, [value]);
|
|
8531
|
-
}
|
|
8532
|
-
//#endregion
|
|
8533
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/useOpenInteractionType.mjs
|
|
8534
|
-
function useOpenMethodTriggerProps(open, setOpenMethod) {
|
|
8535
|
-
const { onClick, onPointerDown } = useEnhancedClickHandler(useStableCallback((_, interactionType) => {
|
|
8536
|
-
if (!(typeof open === "function" ? open() : open)) setOpenMethod(interactionType || (ios ? "touch" : ""));
|
|
8537
|
-
}));
|
|
8538
|
-
return import_react.useMemo(() => ({
|
|
8539
|
-
onClick,
|
|
8540
|
-
onPointerDown
|
|
8541
|
-
}), [onClick, onPointerDown]);
|
|
8542
|
-
}
|
|
8543
|
-
/**
|
|
8544
|
-
* Determines the interaction type (keyboard, mouse, touch, etc.) that opened the component.
|
|
8545
|
-
*
|
|
8546
|
-
* @param open The open state of the component.
|
|
8547
|
-
*/
|
|
8548
|
-
function useOpenInteractionType(open) {
|
|
8549
|
-
const [openMethod, setOpenMethod] = import_react.useState(null);
|
|
8550
|
-
const triggerProps = useOpenMethodTriggerProps(open, setOpenMethod);
|
|
8551
|
-
useValueChanged(open, (previousOpen) => {
|
|
8552
|
-
if (previousOpen && !open) setOpenMethod(null);
|
|
8553
|
-
});
|
|
8554
|
-
return import_react.useMemo(() => ({
|
|
8555
|
-
openMethod,
|
|
8556
|
-
triggerProps
|
|
8557
|
-
}), [openMethod, triggerProps]);
|
|
8558
|
-
}
|
|
8559
|
-
//#endregion
|
|
8560
7738
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs
|
|
8561
7739
|
var TooltipRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
8562
7740
|
function useTooltipRootContext(optional) {
|
|
@@ -8566,7 +7744,7 @@ function useTooltipRootContext(optional) {
|
|
|
8566
7744
|
}
|
|
8567
7745
|
//#endregion
|
|
8568
7746
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs
|
|
8569
|
-
var selectors
|
|
7747
|
+
var selectors = {
|
|
8570
7748
|
...popupStoreSelectors,
|
|
8571
7749
|
disabled: createSelector((state) => state.disabled),
|
|
8572
7750
|
instantType: createSelector((state) => state.instantType),
|
|
@@ -8582,7 +7760,7 @@ var TooltipStore = class TooltipStore extends ReactStore {
|
|
|
8582
7760
|
constructor(initialState, floatingId, nested = false) {
|
|
8583
7761
|
const triggerElements = new PopupTriggerMap();
|
|
8584
7762
|
const state = {
|
|
8585
|
-
...createInitialState
|
|
7763
|
+
...createInitialState(),
|
|
8586
7764
|
...initialState
|
|
8587
7765
|
};
|
|
8588
7766
|
state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested);
|
|
@@ -8591,7 +7769,7 @@ var TooltipStore = class TooltipStore extends ReactStore {
|
|
|
8591
7769
|
onOpenChange: void 0,
|
|
8592
7770
|
onOpenChangeComplete: void 0,
|
|
8593
7771
|
triggerElements
|
|
8594
|
-
}, selectors
|
|
7772
|
+
}, selectors);
|
|
8595
7773
|
}
|
|
8596
7774
|
setOpen = (nextOpen, eventDetails) => {
|
|
8597
7775
|
applyPopupOpenChange(this, nextOpen, eventDetails, { extraState: { openChangeReason: eventDetails.reason } });
|
|
@@ -8603,7 +7781,7 @@ var TooltipStore = class TooltipStore extends ReactStore {
|
|
|
8603
7781
|
return usePopupStore(externalStore, (floatingId, nested) => new TooltipStore(initialState, floatingId, nested)).store;
|
|
8604
7782
|
}
|
|
8605
7783
|
};
|
|
8606
|
-
function createInitialState
|
|
7784
|
+
function createInitialState() {
|
|
8607
7785
|
return {
|
|
8608
7786
|
...createInitialPopupStoreState(),
|
|
8609
7787
|
disabled: false,
|
|
@@ -9510,7 +8688,7 @@ var TooltipPositioner = /*#__PURE__*/ import_react.forwardRef(function TooltipPo
|
|
|
9510
8688
|
});
|
|
9511
8689
|
//#endregion
|
|
9512
8690
|
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs
|
|
9513
|
-
var stateAttributesMapping
|
|
8691
|
+
var stateAttributesMapping = {
|
|
9514
8692
|
...popupStateMapping,
|
|
9515
8693
|
...transitionStatusMapping
|
|
9516
8694
|
};
|
|
@@ -9561,7 +8739,7 @@ var TooltipPopup = /*#__PURE__*/ import_react.forwardRef(function TooltipPopup(c
|
|
|
9561
8739
|
getDisabledMountTransitionStyles(transitionStatus),
|
|
9562
8740
|
elementProps
|
|
9563
8741
|
],
|
|
9564
|
-
stateAttributesMapping
|
|
8742
|
+
stateAttributesMapping
|
|
9565
8743
|
});
|
|
9566
8744
|
});
|
|
9567
8745
|
//#endregion
|
|
@@ -9592,1534 +8770,4 @@ var TooltipProvider = function TooltipProvider(props) {
|
|
|
9592
8770
|
});
|
|
9593
8771
|
};
|
|
9594
8772
|
//#endregion
|
|
9595
|
-
|
|
9596
|
-
var MenuPositionerContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
9597
|
-
function useMenuPositionerContext(optional) {
|
|
9598
|
-
const context = import_react.useContext(MenuPositionerContext);
|
|
9599
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(33));
|
|
9600
|
-
return context;
|
|
9601
|
-
}
|
|
9602
|
-
//#endregion
|
|
9603
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/root/MenuRootContext.mjs
|
|
9604
|
-
var MenuRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
9605
|
-
function useMenuRootContext(optional) {
|
|
9606
|
-
const context = import_react.useContext(MenuRootContext);
|
|
9607
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(36));
|
|
9608
|
-
return context;
|
|
9609
|
-
}
|
|
9610
|
-
//#endregion
|
|
9611
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/context-menu/root/ContextMenuRootContext.mjs
|
|
9612
|
-
var ContextMenuRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
9613
|
-
function useContextMenuRootContext(optional = true) {
|
|
9614
|
-
const context = import_react.useContext(ContextMenuRootContext);
|
|
9615
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(25));
|
|
9616
|
-
return context;
|
|
9617
|
-
}
|
|
9618
|
-
//#endregion
|
|
9619
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/item/useMenuItemCommonProps.mjs
|
|
9620
|
-
/**
|
|
9621
|
-
* Returns common props shared by all menu item types.
|
|
9622
|
-
* This hook extracts the shared logic for id, role, tabIndex, onKeyDown,
|
|
9623
|
-
* onMouseMove, onClick, and onMouseUp handlers.
|
|
9624
|
-
*/
|
|
9625
|
-
function useMenuItemCommonProps(params) {
|
|
9626
|
-
const { closeOnClick, highlighted, id, nodeId, store, typingRef, itemRef, itemMetadata } = params;
|
|
9627
|
-
const { events: menuEvents } = store.useState("floatingTreeRoot");
|
|
9628
|
-
const open = store.useState("open");
|
|
9629
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
9630
|
-
const isContextMenu = contextMenuContext !== void 0;
|
|
9631
|
-
return import_react.useMemo(() => ({
|
|
9632
|
-
id,
|
|
9633
|
-
role: "menuitem",
|
|
9634
|
-
tabIndex: open && highlighted ? 0 : -1,
|
|
9635
|
-
onKeyDown(event) {
|
|
9636
|
-
if (event.key === " " && typingRef?.current) event.preventDefault();
|
|
9637
|
-
},
|
|
9638
|
-
onMouseMove(event) {
|
|
9639
|
-
if (!nodeId) return;
|
|
9640
|
-
menuEvents.emit("itemhover", {
|
|
9641
|
-
nodeId,
|
|
9642
|
-
target: event.currentTarget
|
|
9643
|
-
});
|
|
9644
|
-
},
|
|
9645
|
-
onClick(event) {
|
|
9646
|
-
if (closeOnClick) menuEvents.emit("close", {
|
|
9647
|
-
domEvent: event,
|
|
9648
|
-
reason: itemPress
|
|
9649
|
-
});
|
|
9650
|
-
},
|
|
9651
|
-
onMouseUp(event) {
|
|
9652
|
-
if (contextMenuContext) {
|
|
9653
|
-
const initialCursorPoint = contextMenuContext.initialCursorPointRef.current;
|
|
9654
|
-
contextMenuContext.initialCursorPointRef.current = null;
|
|
9655
|
-
if (isContextMenu && initialCursorPoint && Math.abs(event.clientX - initialCursorPoint.x) <= 1 && Math.abs(event.clientY - initialCursorPoint.y) <= 1) return;
|
|
9656
|
-
if (isContextMenu && !mac && event.button === 2) return;
|
|
9657
|
-
}
|
|
9658
|
-
if (itemRef.current && store.context.allowMouseUpTriggerRef.current && (!isContextMenu || event.button === 2)) {
|
|
9659
|
-
if (!itemMetadata || itemMetadata.type === "regular-item") itemRef.current.click();
|
|
9660
|
-
}
|
|
9661
|
-
}
|
|
9662
|
-
}), [
|
|
9663
|
-
closeOnClick,
|
|
9664
|
-
highlighted,
|
|
9665
|
-
id,
|
|
9666
|
-
menuEvents,
|
|
9667
|
-
nodeId,
|
|
9668
|
-
open,
|
|
9669
|
-
store,
|
|
9670
|
-
typingRef,
|
|
9671
|
-
itemRef,
|
|
9672
|
-
contextMenuContext,
|
|
9673
|
-
isContextMenu,
|
|
9674
|
-
itemMetadata
|
|
9675
|
-
]);
|
|
9676
|
-
}
|
|
9677
|
-
//#endregion
|
|
9678
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/item/useMenuItem.mjs
|
|
9679
|
-
var REGULAR_ITEM = { type: "regular-item" };
|
|
9680
|
-
function useMenuItem(params) {
|
|
9681
|
-
const { closeOnClick, disabled: disabledProp = false, highlighted, id, store, typingRef = store.context.typingRef, nativeButton, itemMetadata, nodeId } = params;
|
|
9682
|
-
const rootDisabled = store.useState("disabled");
|
|
9683
|
-
const disabled = disabledProp || rootDisabled;
|
|
9684
|
-
const itemRef = import_react.useRef(null);
|
|
9685
|
-
const { getButtonProps, buttonRef } = useButton({
|
|
9686
|
-
disabled,
|
|
9687
|
-
focusableWhenDisabled: true,
|
|
9688
|
-
native: nativeButton,
|
|
9689
|
-
composite: true
|
|
9690
|
-
});
|
|
9691
|
-
const commonProps = useMenuItemCommonProps({
|
|
9692
|
-
closeOnClick,
|
|
9693
|
-
highlighted,
|
|
9694
|
-
id,
|
|
9695
|
-
nodeId,
|
|
9696
|
-
store,
|
|
9697
|
-
typingRef,
|
|
9698
|
-
itemRef,
|
|
9699
|
-
itemMetadata
|
|
9700
|
-
});
|
|
9701
|
-
const getItemProps = import_react.useCallback((externalProps) => {
|
|
9702
|
-
return mergeProps(commonProps, { onMouseEnter() {
|
|
9703
|
-
if (itemMetadata.type !== "submenu-trigger") return;
|
|
9704
|
-
itemMetadata.setActive();
|
|
9705
|
-
} }, externalProps, getButtonProps);
|
|
9706
|
-
}, [
|
|
9707
|
-
commonProps,
|
|
9708
|
-
getButtonProps,
|
|
9709
|
-
itemMetadata
|
|
9710
|
-
]);
|
|
9711
|
-
const mergedRef = useMergedRefs(itemRef, buttonRef);
|
|
9712
|
-
return import_react.useMemo(() => ({
|
|
9713
|
-
getItemProps,
|
|
9714
|
-
itemRef: mergedRef
|
|
9715
|
-
}), [getItemProps, mergedRef]);
|
|
9716
|
-
}
|
|
9717
|
-
//#endregion
|
|
9718
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
|
|
9719
|
-
var CompositeListContext = /*#__PURE__*/ import_react.createContext({
|
|
9720
|
-
register: () => {},
|
|
9721
|
-
unregister: () => {},
|
|
9722
|
-
subscribeMapChange: () => {
|
|
9723
|
-
return () => {};
|
|
9724
|
-
},
|
|
9725
|
-
elementsRef: { current: [] },
|
|
9726
|
-
nextIndexRef: { current: 0 }
|
|
9727
|
-
});
|
|
9728
|
-
function useCompositeListContext() {
|
|
9729
|
-
return import_react.useContext(CompositeListContext);
|
|
9730
|
-
}
|
|
9731
|
-
//#endregion
|
|
9732
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
|
|
9733
|
-
var IndexGuessBehavior = /*#__PURE__*/ function(IndexGuessBehavior) {
|
|
9734
|
-
IndexGuessBehavior[IndexGuessBehavior["None"] = 0] = "None";
|
|
9735
|
-
IndexGuessBehavior[IndexGuessBehavior["GuessFromOrder"] = 1] = "GuessFromOrder";
|
|
9736
|
-
return IndexGuessBehavior;
|
|
9737
|
-
}({});
|
|
9738
|
-
/**
|
|
9739
|
-
* Used to register a list item and its index (DOM position) in the `CompositeList`.
|
|
9740
|
-
*/
|
|
9741
|
-
function useCompositeListItem(params = {}) {
|
|
9742
|
-
const { label, metadata, textRef, indexGuessBehavior, index: externalIndex } = params;
|
|
9743
|
-
const { register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef } = useCompositeListContext();
|
|
9744
|
-
const indexRef = import_react.useRef(-1);
|
|
9745
|
-
const [index, setIndex] = import_react.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
|
|
9746
|
-
if (indexRef.current === -1) {
|
|
9747
|
-
const newIndex = nextIndexRef.current;
|
|
9748
|
-
nextIndexRef.current += 1;
|
|
9749
|
-
indexRef.current = newIndex;
|
|
9750
|
-
}
|
|
9751
|
-
return indexRef.current;
|
|
9752
|
-
} : -1));
|
|
9753
|
-
const componentRef = import_react.useRef(null);
|
|
9754
|
-
const ref = import_react.useCallback((node) => {
|
|
9755
|
-
componentRef.current = node;
|
|
9756
|
-
if (index !== -1 && node !== null) {
|
|
9757
|
-
elementsRef.current[index] = node;
|
|
9758
|
-
if (labelsRef) {
|
|
9759
|
-
const isLabelDefined = label !== void 0;
|
|
9760
|
-
labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
|
|
9761
|
-
}
|
|
9762
|
-
}
|
|
9763
|
-
}, [
|
|
9764
|
-
index,
|
|
9765
|
-
elementsRef,
|
|
9766
|
-
labelsRef,
|
|
9767
|
-
label,
|
|
9768
|
-
textRef
|
|
9769
|
-
]);
|
|
9770
|
-
useIsoLayoutEffect(() => {
|
|
9771
|
-
if (externalIndex != null) return;
|
|
9772
|
-
const node = componentRef.current;
|
|
9773
|
-
if (node) {
|
|
9774
|
-
register(node, metadata);
|
|
9775
|
-
return () => {
|
|
9776
|
-
unregister(node);
|
|
9777
|
-
};
|
|
9778
|
-
}
|
|
9779
|
-
}, [
|
|
9780
|
-
externalIndex,
|
|
9781
|
-
register,
|
|
9782
|
-
unregister,
|
|
9783
|
-
metadata
|
|
9784
|
-
]);
|
|
9785
|
-
useIsoLayoutEffect(() => {
|
|
9786
|
-
if (externalIndex != null) return;
|
|
9787
|
-
return subscribeMapChange((map) => {
|
|
9788
|
-
const i = componentRef.current ? map.get(componentRef.current)?.index : null;
|
|
9789
|
-
if (i != null) setIndex(i);
|
|
9790
|
-
});
|
|
9791
|
-
}, [
|
|
9792
|
-
externalIndex,
|
|
9793
|
-
subscribeMapChange,
|
|
9794
|
-
setIndex
|
|
9795
|
-
]);
|
|
9796
|
-
return {
|
|
9797
|
-
ref,
|
|
9798
|
-
index
|
|
9799
|
-
};
|
|
9800
|
-
}
|
|
9801
|
-
//#endregion
|
|
9802
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/item/MenuItem.mjs
|
|
9803
|
-
/**
|
|
9804
|
-
* An individual interactive item in the menu.
|
|
9805
|
-
* Renders a `<div>` element.
|
|
9806
|
-
*
|
|
9807
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
9808
|
-
*/
|
|
9809
|
-
var MenuItem = /*#__PURE__*/ import_react.forwardRef(function MenuItem(componentProps, forwardedRef) {
|
|
9810
|
-
const { render, className, id: idProp, label, nativeButton = false, disabled = false, closeOnClick = true, style, ...elementProps } = componentProps;
|
|
9811
|
-
const listItem = useCompositeListItem({ label });
|
|
9812
|
-
const menuPositionerContext = useMenuPositionerContext(true);
|
|
9813
|
-
const id = useBaseUiId(idProp);
|
|
9814
|
-
const { store } = useMenuRootContext();
|
|
9815
|
-
const highlighted = store.useState("isActive", listItem.index);
|
|
9816
|
-
const itemProps = store.useState("itemProps");
|
|
9817
|
-
const { getItemProps, itemRef } = useMenuItem({
|
|
9818
|
-
closeOnClick,
|
|
9819
|
-
disabled,
|
|
9820
|
-
highlighted,
|
|
9821
|
-
id,
|
|
9822
|
-
store,
|
|
9823
|
-
nativeButton,
|
|
9824
|
-
nodeId: menuPositionerContext?.context.nodeId,
|
|
9825
|
-
itemMetadata: REGULAR_ITEM
|
|
9826
|
-
});
|
|
9827
|
-
return useRenderElement("div", componentProps, {
|
|
9828
|
-
state: {
|
|
9829
|
-
disabled,
|
|
9830
|
-
highlighted
|
|
9831
|
-
},
|
|
9832
|
-
props: [
|
|
9833
|
-
itemProps,
|
|
9834
|
-
elementProps,
|
|
9835
|
-
getItemProps
|
|
9836
|
-
],
|
|
9837
|
-
ref: [
|
|
9838
|
-
itemRef,
|
|
9839
|
-
forwardedRef,
|
|
9840
|
-
listItem.ref
|
|
9841
|
-
]
|
|
9842
|
-
});
|
|
9843
|
-
});
|
|
9844
|
-
//#endregion
|
|
9845
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/toolbar/root/ToolbarRootContext.mjs
|
|
9846
|
-
var ToolbarRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
9847
|
-
function useToolbarRootContext(optional) {
|
|
9848
|
-
const context = import_react.useContext(ToolbarRootContext);
|
|
9849
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(69));
|
|
9850
|
-
return context;
|
|
9851
|
-
}
|
|
9852
|
-
//#endregion
|
|
9853
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/popup/MenuPopup.mjs
|
|
9854
|
-
var stateAttributesMapping = {
|
|
9855
|
-
...popupStateMapping,
|
|
9856
|
-
...transitionStatusMapping
|
|
9857
|
-
};
|
|
9858
|
-
/**
|
|
9859
|
-
* A container for the menu items.
|
|
9860
|
-
* Renders a `<div>` element.
|
|
9861
|
-
*
|
|
9862
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
9863
|
-
*/
|
|
9864
|
-
var MenuPopup = /*#__PURE__*/ import_react.forwardRef(function MenuPopup(componentProps, forwardedRef) {
|
|
9865
|
-
const { render, className, style, finalFocus, ...elementProps } = componentProps;
|
|
9866
|
-
const { store } = useMenuRootContext();
|
|
9867
|
-
const { side, align } = useMenuPositionerContext();
|
|
9868
|
-
const insideToolbar = useToolbarRootContext(true) != null;
|
|
9869
|
-
const open = store.useState("open");
|
|
9870
|
-
const transitionStatus = store.useState("transitionStatus");
|
|
9871
|
-
const popupProps = store.useState("popupProps");
|
|
9872
|
-
const mounted = store.useState("mounted");
|
|
9873
|
-
const instantType = store.useState("instantType");
|
|
9874
|
-
const triggerElement = store.useState("activeTriggerElement");
|
|
9875
|
-
const parent = store.useState("parent");
|
|
9876
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
9877
|
-
const rootId = store.useState("rootId");
|
|
9878
|
-
const floatingContext = store.useState("floatingRootContext");
|
|
9879
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
9880
|
-
const closeDelay = store.useState("closeDelay");
|
|
9881
|
-
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
9882
|
-
const hoverEnabled = store.useState("hoverEnabled");
|
|
9883
|
-
const disabled = store.useState("disabled");
|
|
9884
|
-
const openMethod = store.useState("openMethod");
|
|
9885
|
-
const isContextMenu = parent.type === "context-menu";
|
|
9886
|
-
useOpenChangeComplete({
|
|
9887
|
-
open,
|
|
9888
|
-
ref: store.context.popupRef,
|
|
9889
|
-
onComplete() {
|
|
9890
|
-
if (open) store.context.onOpenChangeComplete?.(true);
|
|
9891
|
-
}
|
|
9892
|
-
});
|
|
9893
|
-
import_react.useEffect(() => {
|
|
9894
|
-
function handleClose(event) {
|
|
9895
|
-
store.setOpen(false, createChangeEventDetails(event.reason, event.domEvent));
|
|
9896
|
-
}
|
|
9897
|
-
floatingTreeRoot.events.on("close", handleClose);
|
|
9898
|
-
return () => {
|
|
9899
|
-
floatingTreeRoot.events.off("close", handleClose);
|
|
9900
|
-
};
|
|
9901
|
-
}, [floatingTreeRoot.events, store]);
|
|
9902
|
-
useHoverFloatingInteraction(floatingContext, {
|
|
9903
|
-
enabled: hoverEnabled && !disabled && !isContextMenu && parent.type !== "menubar",
|
|
9904
|
-
closeDelay
|
|
9905
|
-
});
|
|
9906
|
-
const setPopupElement = import_react.useCallback((element) => {
|
|
9907
|
-
store.set("popupElement", element);
|
|
9908
|
-
}, [store]);
|
|
9909
|
-
const element = useRenderElement("div", componentProps, {
|
|
9910
|
-
state: {
|
|
9911
|
-
transitionStatus,
|
|
9912
|
-
side,
|
|
9913
|
-
align,
|
|
9914
|
-
open,
|
|
9915
|
-
nested: parent.type === "menu",
|
|
9916
|
-
instant: instantType
|
|
9917
|
-
},
|
|
9918
|
-
ref: [
|
|
9919
|
-
forwardedRef,
|
|
9920
|
-
store.context.popupRef,
|
|
9921
|
-
setPopupElement
|
|
9922
|
-
],
|
|
9923
|
-
stateAttributesMapping,
|
|
9924
|
-
props: [
|
|
9925
|
-
popupProps,
|
|
9926
|
-
{ onKeyDown(event) {
|
|
9927
|
-
if (insideToolbar && COMPOSITE_KEYS.has(event.key)) event.stopPropagation();
|
|
9928
|
-
} },
|
|
9929
|
-
getDisabledMountTransitionStyles(transitionStatus),
|
|
9930
|
-
elementProps,
|
|
9931
|
-
{ "data-rootownerid": rootId }
|
|
9932
|
-
]
|
|
9933
|
-
});
|
|
9934
|
-
let returnFocus = parent.type === void 0 || isContextMenu;
|
|
9935
|
-
if (triggerElement || parent.type === "menubar" && lastOpenChangeReason !== "outside-press") returnFocus = true;
|
|
9936
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingFocusManager, {
|
|
9937
|
-
context: floatingContext,
|
|
9938
|
-
openInteractionType: openMethod,
|
|
9939
|
-
modal: isContextMenu,
|
|
9940
|
-
disabled: !mounted,
|
|
9941
|
-
returnFocus: finalFocus === void 0 ? returnFocus : finalFocus,
|
|
9942
|
-
initialFocus: parent.type !== "menu",
|
|
9943
|
-
restoreFocus: true,
|
|
9944
|
-
externalTree: parent.type !== "menubar" ? floatingTreeRoot : void 0,
|
|
9945
|
-
previousFocusableElement: activeTriggerElement,
|
|
9946
|
-
nextFocusableElement: parent.type === void 0 ? store.context.triggerFocusTargetRef : void 0,
|
|
9947
|
-
beforeContentFocusGuardRef: parent.type === void 0 ? store.context.beforeContentFocusGuardRef : void 0,
|
|
9948
|
-
children: element
|
|
9949
|
-
});
|
|
9950
|
-
});
|
|
9951
|
-
//#endregion
|
|
9952
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/portal/MenuPortalContext.mjs
|
|
9953
|
-
var MenuPortalContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
9954
|
-
function useMenuPortalContext() {
|
|
9955
|
-
const value = import_react.useContext(MenuPortalContext);
|
|
9956
|
-
if (value === void 0) throw new Error(formatErrorMessage(32));
|
|
9957
|
-
return value;
|
|
9958
|
-
}
|
|
9959
|
-
//#endregion
|
|
9960
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/portal/MenuPortal.mjs
|
|
9961
|
-
/**
|
|
9962
|
-
* A portal element that moves the popup to a different part of the DOM.
|
|
9963
|
-
* By default, the portal element is appended to `<body>`.
|
|
9964
|
-
* Renders a `<div>` element.
|
|
9965
|
-
*
|
|
9966
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
9967
|
-
*/
|
|
9968
|
-
var MenuPortal = /*#__PURE__*/ import_react.forwardRef(function MenuPortal(props, forwardedRef) {
|
|
9969
|
-
const { keepMounted = false, ...portalProps } = props;
|
|
9970
|
-
const { store } = useMenuRootContext();
|
|
9971
|
-
if (!(store.useState("mounted") || keepMounted)) return null;
|
|
9972
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(MenuPortalContext.Provider, {
|
|
9973
|
-
value: keepMounted,
|
|
9974
|
-
children: /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingPortal, {
|
|
9975
|
-
ref: forwardedRef,
|
|
9976
|
-
...portalProps
|
|
9977
|
-
})
|
|
9978
|
-
});
|
|
9979
|
-
});
|
|
9980
|
-
//#endregion
|
|
9981
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
|
|
9982
|
-
/**
|
|
9983
|
-
* Provides context for a list of items in a composite component.
|
|
9984
|
-
* @internal
|
|
9985
|
-
*/
|
|
9986
|
-
function CompositeList(props) {
|
|
9987
|
-
const { children, elementsRef, labelsRef, onMapChange: onMapChangeProp } = props;
|
|
9988
|
-
const onMapChange = useStableCallback(onMapChangeProp);
|
|
9989
|
-
const nextIndexRef = import_react.useRef(0);
|
|
9990
|
-
const listeners = useRefWithInit(createListeners).current;
|
|
9991
|
-
const map = useRefWithInit(createMap).current;
|
|
9992
|
-
const [mapTick, setMapTick] = import_react.useState(0);
|
|
9993
|
-
const lastTickRef = import_react.useRef(mapTick);
|
|
9994
|
-
const register = useStableCallback((node, metadata) => {
|
|
9995
|
-
map.set(node, metadata ?? null);
|
|
9996
|
-
lastTickRef.current += 1;
|
|
9997
|
-
setMapTick(lastTickRef.current);
|
|
9998
|
-
});
|
|
9999
|
-
const unregister = useStableCallback((node) => {
|
|
10000
|
-
map.delete(node);
|
|
10001
|
-
lastTickRef.current += 1;
|
|
10002
|
-
setMapTick(lastTickRef.current);
|
|
10003
|
-
});
|
|
10004
|
-
const sortedMap = import_react.useMemo(() => {
|
|
10005
|
-
const newMap = /* @__PURE__ */ new Map();
|
|
10006
|
-
Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition).forEach((node, index) => {
|
|
10007
|
-
const metadata = map.get(node) ?? {};
|
|
10008
|
-
newMap.set(node, {
|
|
10009
|
-
...metadata,
|
|
10010
|
-
index
|
|
10011
|
-
});
|
|
10012
|
-
});
|
|
10013
|
-
return newMap;
|
|
10014
|
-
}, [map, mapTick]);
|
|
10015
|
-
useIsoLayoutEffect(() => {
|
|
10016
|
-
if (typeof MutationObserver !== "function" || sortedMap.size === 0) return;
|
|
10017
|
-
const mutationObserver = new MutationObserver((entries) => {
|
|
10018
|
-
const diff = /* @__PURE__ */ new Set();
|
|
10019
|
-
const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
|
|
10020
|
-
entries.forEach((entry) => {
|
|
10021
|
-
entry.removedNodes.forEach(updateDiff);
|
|
10022
|
-
entry.addedNodes.forEach(updateDiff);
|
|
10023
|
-
});
|
|
10024
|
-
if (diff.size === 0) {
|
|
10025
|
-
lastTickRef.current += 1;
|
|
10026
|
-
setMapTick(lastTickRef.current);
|
|
10027
|
-
}
|
|
10028
|
-
});
|
|
10029
|
-
sortedMap.forEach((_, node) => {
|
|
10030
|
-
if (node.parentElement) mutationObserver.observe(node.parentElement, { childList: true });
|
|
10031
|
-
});
|
|
10032
|
-
return () => {
|
|
10033
|
-
mutationObserver.disconnect();
|
|
10034
|
-
};
|
|
10035
|
-
}, [sortedMap]);
|
|
10036
|
-
useIsoLayoutEffect(() => {
|
|
10037
|
-
if (lastTickRef.current === mapTick) {
|
|
10038
|
-
if (elementsRef.current.length !== sortedMap.size) elementsRef.current.length = sortedMap.size;
|
|
10039
|
-
if (labelsRef && labelsRef.current.length !== sortedMap.size) labelsRef.current.length = sortedMap.size;
|
|
10040
|
-
nextIndexRef.current = sortedMap.size;
|
|
10041
|
-
}
|
|
10042
|
-
onMapChange(sortedMap);
|
|
10043
|
-
}, [
|
|
10044
|
-
onMapChange,
|
|
10045
|
-
sortedMap,
|
|
10046
|
-
elementsRef,
|
|
10047
|
-
labelsRef,
|
|
10048
|
-
mapTick
|
|
10049
|
-
]);
|
|
10050
|
-
useIsoLayoutEffect(() => {
|
|
10051
|
-
return () => {
|
|
10052
|
-
elementsRef.current = [];
|
|
10053
|
-
};
|
|
10054
|
-
}, [elementsRef]);
|
|
10055
|
-
useIsoLayoutEffect(() => {
|
|
10056
|
-
return () => {
|
|
10057
|
-
if (labelsRef) labelsRef.current = [];
|
|
10058
|
-
};
|
|
10059
|
-
}, [labelsRef]);
|
|
10060
|
-
const subscribeMapChange = useStableCallback((fn) => {
|
|
10061
|
-
listeners.add(fn);
|
|
10062
|
-
return () => {
|
|
10063
|
-
listeners.delete(fn);
|
|
10064
|
-
};
|
|
10065
|
-
});
|
|
10066
|
-
useIsoLayoutEffect(() => {
|
|
10067
|
-
listeners.forEach((l) => l(sortedMap));
|
|
10068
|
-
}, [listeners, sortedMap]);
|
|
10069
|
-
const contextValue = import_react.useMemo(() => ({
|
|
10070
|
-
register,
|
|
10071
|
-
unregister,
|
|
10072
|
-
subscribeMapChange,
|
|
10073
|
-
elementsRef,
|
|
10074
|
-
labelsRef,
|
|
10075
|
-
nextIndexRef
|
|
10076
|
-
}), [
|
|
10077
|
-
register,
|
|
10078
|
-
unregister,
|
|
10079
|
-
subscribeMapChange,
|
|
10080
|
-
elementsRef,
|
|
10081
|
-
labelsRef,
|
|
10082
|
-
nextIndexRef
|
|
10083
|
-
]);
|
|
10084
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(CompositeListContext.Provider, {
|
|
10085
|
-
value: contextValue,
|
|
10086
|
-
children
|
|
10087
|
-
});
|
|
10088
|
-
}
|
|
10089
|
-
function createMap() {
|
|
10090
|
-
return /* @__PURE__ */ new Map();
|
|
10091
|
-
}
|
|
10092
|
-
function createListeners() {
|
|
10093
|
-
return /* @__PURE__ */ new Set();
|
|
10094
|
-
}
|
|
10095
|
-
function sortByDocumentPosition(a, b) {
|
|
10096
|
-
const position = a.compareDocumentPosition(b);
|
|
10097
|
-
if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) return -1;
|
|
10098
|
-
if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) return 1;
|
|
10099
|
-
return 0;
|
|
10100
|
-
}
|
|
10101
|
-
//#endregion
|
|
10102
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/useAnchoredPopupScrollLock.mjs
|
|
10103
|
-
var VIEWPORT_WIDTH_TOLERANCE_PX = 20;
|
|
10104
|
-
/**
|
|
10105
|
-
* Manages scroll lock for anchored popups. For non-touch opens, scroll lock is applied when
|
|
10106
|
-
* enabled. For touch opens, scroll lock is applied only when the positioner width is effectively
|
|
10107
|
-
* viewport-sized.
|
|
10108
|
-
*/
|
|
10109
|
-
function useAnchoredPopupScrollLock(enabled, touchOpen, positionerElement, referenceElement) {
|
|
10110
|
-
const [touchOpenShouldLockScroll, setTouchOpenShouldLockScroll] = import_react.useState(false);
|
|
10111
|
-
useIsoLayoutEffect(() => {
|
|
10112
|
-
if (!enabled || !touchOpen || positionerElement == null) {
|
|
10113
|
-
setTouchOpenShouldLockScroll(false);
|
|
10114
|
-
return;
|
|
10115
|
-
}
|
|
10116
|
-
const viewportWidth = ownerDocument(positionerElement).documentElement.clientWidth;
|
|
10117
|
-
const popupWidth = positionerElement.offsetWidth;
|
|
10118
|
-
setTouchOpenShouldLockScroll(viewportWidth > 0 && popupWidth > 0 && popupWidth >= viewportWidth - VIEWPORT_WIDTH_TOLERANCE_PX);
|
|
10119
|
-
}, [
|
|
10120
|
-
enabled,
|
|
10121
|
-
touchOpen,
|
|
10122
|
-
positionerElement
|
|
10123
|
-
]);
|
|
10124
|
-
useScrollLock(enabled && (!touchOpen || touchOpenShouldLockScroll), referenceElement);
|
|
10125
|
-
}
|
|
10126
|
-
//#endregion
|
|
10127
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/positioner/MenuPositioner.mjs
|
|
10128
|
-
/**
|
|
10129
|
-
* Positions the menu popup against the trigger.
|
|
10130
|
-
* Renders a `<div>` element.
|
|
10131
|
-
*
|
|
10132
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
10133
|
-
*/
|
|
10134
|
-
var MenuPositioner = /*#__PURE__*/ import_react.forwardRef(function MenuPositioner(componentProps, forwardedRef) {
|
|
10135
|
-
const { anchor: anchorProp, positionMethod: positionMethodProp = "absolute", className, render, side, align: alignProp, sideOffset: sideOffsetProp = 0, alignOffset: alignOffsetProp = 0, collisionBoundary = "clipping-ancestors", collisionPadding = 5, arrowPadding = 5, sticky = false, disableAnchorTracking = false, collisionAvoidance: collisionAvoidanceProp = DROPDOWN_COLLISION_AVOIDANCE, style, ...elementProps } = componentProps;
|
|
10136
|
-
const { store } = useMenuRootContext();
|
|
10137
|
-
const keepMounted = useMenuPortalContext();
|
|
10138
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
10139
|
-
const parent = store.useState("parent");
|
|
10140
|
-
const floatingRootContext = store.useState("floatingRootContext");
|
|
10141
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
10142
|
-
const mounted = store.useState("mounted");
|
|
10143
|
-
const open = store.useState("open");
|
|
10144
|
-
const modal = store.useState("modal");
|
|
10145
|
-
const openMethod = store.useState("openMethod");
|
|
10146
|
-
const triggerElement = store.useState("activeTriggerElement");
|
|
10147
|
-
const transitionStatus = store.useState("transitionStatus");
|
|
10148
|
-
const positionerElement = store.useState("positionerElement");
|
|
10149
|
-
const instantType = store.useState("instantType");
|
|
10150
|
-
const hasViewport = store.useState("hasViewport");
|
|
10151
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
10152
|
-
const floatingNodeId = store.useState("floatingNodeId");
|
|
10153
|
-
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
10154
|
-
const domReference = floatingRootContext.useState("domReferenceElement");
|
|
10155
|
-
const previousTriggerRef = import_react.useRef(null);
|
|
10156
|
-
const runOnceAnimationsFinish = useAnimationsFinished(positionerElement, false, false);
|
|
10157
|
-
let anchor = anchorProp;
|
|
10158
|
-
let sideOffset = sideOffsetProp;
|
|
10159
|
-
let alignOffset = alignOffsetProp;
|
|
10160
|
-
let align = alignProp;
|
|
10161
|
-
let collisionAvoidance = collisionAvoidanceProp;
|
|
10162
|
-
if (parent.type === "context-menu") {
|
|
10163
|
-
anchor = anchorProp ?? parent.context?.anchor;
|
|
10164
|
-
align = align ?? "start";
|
|
10165
|
-
if (!side && align !== "center") {
|
|
10166
|
-
alignOffset = componentProps.alignOffset ?? 2;
|
|
10167
|
-
sideOffset = componentProps.sideOffset ?? -5;
|
|
10168
|
-
}
|
|
10169
|
-
}
|
|
10170
|
-
let computedSide = side;
|
|
10171
|
-
let computedAlign = align;
|
|
10172
|
-
if (parent.type === "menu") {
|
|
10173
|
-
computedSide = computedSide ?? "inline-end";
|
|
10174
|
-
computedAlign = computedAlign ?? "start";
|
|
10175
|
-
collisionAvoidance = componentProps.collisionAvoidance ?? POPUP_COLLISION_AVOIDANCE;
|
|
10176
|
-
} else if (parent.type === "menubar") {
|
|
10177
|
-
computedSide = computedSide ?? (parent.context.orientation === "vertical" ? "inline-end" : "bottom");
|
|
10178
|
-
computedAlign = computedAlign ?? "start";
|
|
10179
|
-
}
|
|
10180
|
-
const contextMenu = parent.type === "context-menu";
|
|
10181
|
-
const positioner = useAnchorPositioning({
|
|
10182
|
-
anchor,
|
|
10183
|
-
floatingRootContext,
|
|
10184
|
-
positionMethod: contextMenuContext ? "fixed" : positionMethodProp,
|
|
10185
|
-
mounted,
|
|
10186
|
-
side: computedSide,
|
|
10187
|
-
sideOffset,
|
|
10188
|
-
align: computedAlign,
|
|
10189
|
-
alignOffset,
|
|
10190
|
-
arrowPadding: contextMenu ? 0 : arrowPadding,
|
|
10191
|
-
collisionBoundary,
|
|
10192
|
-
collisionPadding,
|
|
10193
|
-
sticky,
|
|
10194
|
-
nodeId: floatingNodeId,
|
|
10195
|
-
keepMounted,
|
|
10196
|
-
disableAnchorTracking,
|
|
10197
|
-
collisionAvoidance,
|
|
10198
|
-
shiftCrossAxis: contextMenu && !("side" in collisionAvoidance && collisionAvoidance.side === "flip"),
|
|
10199
|
-
externalTree: floatingTreeRoot,
|
|
10200
|
-
adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0
|
|
10201
|
-
});
|
|
10202
|
-
import_react.useEffect(() => {
|
|
10203
|
-
function onMenuOpenChange(details) {
|
|
10204
|
-
if (details.open) {
|
|
10205
|
-
if (details.parentNodeId === floatingNodeId) store.set("hoverEnabled", false);
|
|
10206
|
-
if (details.nodeId !== floatingNodeId && details.parentNodeId === store.select("floatingParentNodeId")) store.setOpen(false, createChangeEventDetails(siblingOpen));
|
|
10207
|
-
}
|
|
10208
|
-
}
|
|
10209
|
-
floatingTreeRoot.events.on("menuopenchange", onMenuOpenChange);
|
|
10210
|
-
return () => {
|
|
10211
|
-
floatingTreeRoot.events.off("menuopenchange", onMenuOpenChange);
|
|
10212
|
-
};
|
|
10213
|
-
}, [
|
|
10214
|
-
store,
|
|
10215
|
-
floatingTreeRoot.events,
|
|
10216
|
-
floatingNodeId
|
|
10217
|
-
]);
|
|
10218
|
-
import_react.useEffect(() => {
|
|
10219
|
-
if (store.select("floatingParentNodeId") == null) return;
|
|
10220
|
-
function onParentClose(details) {
|
|
10221
|
-
if (details.open || details.nodeId !== store.select("floatingParentNodeId")) return;
|
|
10222
|
-
const reason = details.reason ?? "sibling-open";
|
|
10223
|
-
store.setOpen(false, createChangeEventDetails(reason));
|
|
10224
|
-
}
|
|
10225
|
-
floatingTreeRoot.events.on("menuopenchange", onParentClose);
|
|
10226
|
-
return () => {
|
|
10227
|
-
floatingTreeRoot.events.off("menuopenchange", onParentClose);
|
|
10228
|
-
};
|
|
10229
|
-
}, [floatingTreeRoot.events, store]);
|
|
10230
|
-
const closeTimeout = useTimeout();
|
|
10231
|
-
import_react.useEffect(() => {
|
|
10232
|
-
if (!open) closeTimeout.clear();
|
|
10233
|
-
}, [open, closeTimeout]);
|
|
10234
|
-
import_react.useEffect(() => {
|
|
10235
|
-
function onItemHover(event) {
|
|
10236
|
-
if (!open || event.nodeId !== store.select("floatingParentNodeId")) return;
|
|
10237
|
-
if (event.target && triggerElement && triggerElement !== event.target) {
|
|
10238
|
-
const delay = store.select("closeDelay");
|
|
10239
|
-
if (delay > 0) {
|
|
10240
|
-
if (!closeTimeout.isStarted()) closeTimeout.start(delay, () => {
|
|
10241
|
-
store.setOpen(false, createChangeEventDetails(siblingOpen));
|
|
10242
|
-
});
|
|
10243
|
-
} else store.setOpen(false, createChangeEventDetails(siblingOpen));
|
|
10244
|
-
} else closeTimeout.clear();
|
|
10245
|
-
}
|
|
10246
|
-
floatingTreeRoot.events.on("itemhover", onItemHover);
|
|
10247
|
-
return () => {
|
|
10248
|
-
floatingTreeRoot.events.off("itemhover", onItemHover);
|
|
10249
|
-
};
|
|
10250
|
-
}, [
|
|
10251
|
-
floatingTreeRoot.events,
|
|
10252
|
-
open,
|
|
10253
|
-
triggerElement,
|
|
10254
|
-
store,
|
|
10255
|
-
closeTimeout
|
|
10256
|
-
]);
|
|
10257
|
-
import_react.useEffect(() => {
|
|
10258
|
-
const eventDetails = {
|
|
10259
|
-
open,
|
|
10260
|
-
nodeId: floatingNodeId,
|
|
10261
|
-
parentNodeId: floatingParentNodeId,
|
|
10262
|
-
reason: store.select("lastOpenChangeReason")
|
|
10263
|
-
};
|
|
10264
|
-
floatingTreeRoot.events.emit("menuopenchange", eventDetails);
|
|
10265
|
-
}, [
|
|
10266
|
-
floatingTreeRoot.events,
|
|
10267
|
-
open,
|
|
10268
|
-
store,
|
|
10269
|
-
floatingNodeId,
|
|
10270
|
-
floatingParentNodeId
|
|
10271
|
-
]);
|
|
10272
|
-
useIsoLayoutEffect(() => {
|
|
10273
|
-
const currentTrigger = domReference;
|
|
10274
|
-
const previousTrigger = previousTriggerRef.current;
|
|
10275
|
-
if (currentTrigger) previousTriggerRef.current = currentTrigger;
|
|
10276
|
-
if (previousTrigger && currentTrigger && currentTrigger !== previousTrigger) {
|
|
10277
|
-
store.set("instantType", void 0);
|
|
10278
|
-
const abortController = new AbortController();
|
|
10279
|
-
runOnceAnimationsFinish(() => {
|
|
10280
|
-
store.set("instantType", "trigger-change");
|
|
10281
|
-
}, abortController.signal);
|
|
10282
|
-
return () => {
|
|
10283
|
-
abortController.abort();
|
|
10284
|
-
};
|
|
10285
|
-
}
|
|
10286
|
-
}, [
|
|
10287
|
-
domReference,
|
|
10288
|
-
runOnceAnimationsFinish,
|
|
10289
|
-
store
|
|
10290
|
-
]);
|
|
10291
|
-
const state = {
|
|
10292
|
-
open,
|
|
10293
|
-
side: positioner.side,
|
|
10294
|
-
align: positioner.align,
|
|
10295
|
-
anchorHidden: positioner.anchorHidden,
|
|
10296
|
-
nested: parent.type === "menu",
|
|
10297
|
-
instant: instantType
|
|
10298
|
-
};
|
|
10299
|
-
const menubarModal = parent.type === "menubar" && parent.context.modal;
|
|
10300
|
-
useAnchoredPopupScrollLock(open && (menubarModal || modal && lastOpenChangeReason !== "trigger-hover"), openMethod === "touch", positionerElement, triggerElement);
|
|
10301
|
-
const element = usePositioner(componentProps, state, {
|
|
10302
|
-
styles: positioner.positionerStyles,
|
|
10303
|
-
transitionStatus,
|
|
10304
|
-
props: elementProps,
|
|
10305
|
-
refs: [forwardedRef, store.useStateSetter("positionerElement")],
|
|
10306
|
-
hidden: !mounted,
|
|
10307
|
-
inert: !open
|
|
10308
|
-
});
|
|
10309
|
-
const shouldRenderBackdrop = mounted && parent.type !== "menu" && (parent.type !== "menubar" && modal && lastOpenChangeReason !== "trigger-hover" || parent.type === "menubar" && parent.context.modal);
|
|
10310
|
-
let backdropCutout = null;
|
|
10311
|
-
if (parent.type === "menubar") backdropCutout = parent.context.contentElement;
|
|
10312
|
-
else if (parent.type === void 0) backdropCutout = triggerElement;
|
|
10313
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsxs)(MenuPositionerContext.Provider, {
|
|
10314
|
-
value: positioner,
|
|
10315
|
-
children: [shouldRenderBackdrop && /*#__PURE__*/ (0, import_jsx_runtime.jsx)(InternalBackdrop, {
|
|
10316
|
-
ref: parent.type === "context-menu" || parent.type === "nested-context-menu" ? parent.context.internalBackdropRef : null,
|
|
10317
|
-
inert: inertValue(!open),
|
|
10318
|
-
cutout: backdropCutout
|
|
10319
|
-
}), /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingNode, {
|
|
10320
|
-
id: floatingNodeId,
|
|
10321
|
-
children: /*#__PURE__*/ (0, import_jsx_runtime.jsx)(CompositeList, {
|
|
10322
|
-
elementsRef: store.context.itemDomElements,
|
|
10323
|
-
labelsRef: store.context.itemLabels,
|
|
10324
|
-
children: element
|
|
10325
|
-
})
|
|
10326
|
-
})]
|
|
10327
|
-
});
|
|
10328
|
-
});
|
|
10329
|
-
//#endregion
|
|
10330
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menubar/MenubarContext.mjs
|
|
10331
|
-
var MenubarContext = /*#__PURE__*/ import_react.createContext(null);
|
|
10332
|
-
function useMenubarContext(optional) {
|
|
10333
|
-
const context = import_react.useContext(MenubarContext);
|
|
10334
|
-
if (context === null && !optional) throw new Error(formatErrorMessage(5));
|
|
10335
|
-
return context;
|
|
10336
|
-
}
|
|
10337
|
-
//#endregion
|
|
10338
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/store/MenuStore.mjs
|
|
10339
|
-
var selectors = {
|
|
10340
|
-
...popupStoreSelectors,
|
|
10341
|
-
disabled: createSelector((state) => state.parent.type === "menubar" ? state.parent.context.disabled || state.disabled : state.disabled),
|
|
10342
|
-
modal: createSelector((state) => (state.parent.type === void 0 || state.parent.type === "context-menu") && (state.modal ?? true)),
|
|
10343
|
-
openMethod: createSelector((state) => state.openMethod),
|
|
10344
|
-
allowMouseEnter: createSelector((state) => state.allowMouseEnter),
|
|
10345
|
-
highlightItemOnHover: createSelector((state) => state.highlightItemOnHover),
|
|
10346
|
-
stickIfOpen: createSelector((state) => state.stickIfOpen),
|
|
10347
|
-
parent: createSelector((state) => state.parent),
|
|
10348
|
-
rootId: createSelector((state) => {
|
|
10349
|
-
if (state.parent.type === "menu") return state.parent.store.select("rootId");
|
|
10350
|
-
return state.parent.type !== void 0 ? state.parent.context.rootId : state.rootId;
|
|
10351
|
-
}),
|
|
10352
|
-
activeIndex: createSelector((state) => state.activeIndex),
|
|
10353
|
-
isActive: createSelector((state, itemIndex) => state.activeIndex === itemIndex),
|
|
10354
|
-
hoverEnabled: createSelector((state) => state.hoverEnabled),
|
|
10355
|
-
instantType: createSelector((state) => state.instantType),
|
|
10356
|
-
lastOpenChangeReason: createSelector((state) => state.openChangeReason),
|
|
10357
|
-
floatingTreeRoot: createSelector((state) => {
|
|
10358
|
-
if (state.parent.type === "menu") return state.parent.store.select("floatingTreeRoot");
|
|
10359
|
-
return state.floatingTreeRoot;
|
|
10360
|
-
}),
|
|
10361
|
-
floatingNodeId: createSelector((state) => state.floatingNodeId),
|
|
10362
|
-
floatingParentNodeId: createSelector((state) => state.floatingParentNodeId),
|
|
10363
|
-
itemProps: createSelector((state) => state.itemProps),
|
|
10364
|
-
closeDelay: createSelector((state) => state.closeDelay),
|
|
10365
|
-
hasViewport: createSelector((state) => state.hasViewport),
|
|
10366
|
-
keyboardEventRelay: createSelector((state) => {
|
|
10367
|
-
if (state.keyboardEventRelay) return state.keyboardEventRelay;
|
|
10368
|
-
if (state.parent.type === "menu") return state.parent.store.select("keyboardEventRelay");
|
|
10369
|
-
})
|
|
10370
|
-
};
|
|
10371
|
-
var MenuStore = class MenuStore extends ReactStore {
|
|
10372
|
-
constructor(initialState) {
|
|
10373
|
-
super({
|
|
10374
|
-
...createInitialState(),
|
|
10375
|
-
...initialState
|
|
10376
|
-
}, {
|
|
10377
|
-
positionerRef: /*#__PURE__*/ import_react.createRef(),
|
|
10378
|
-
popupRef: /*#__PURE__*/ import_react.createRef(),
|
|
10379
|
-
typingRef: { current: false },
|
|
10380
|
-
itemDomElements: { current: [] },
|
|
10381
|
-
itemLabels: { current: [] },
|
|
10382
|
-
allowMouseUpTriggerRef: { current: false },
|
|
10383
|
-
triggerFocusTargetRef: /*#__PURE__*/ import_react.createRef(),
|
|
10384
|
-
beforeContentFocusGuardRef: /*#__PURE__*/ import_react.createRef(),
|
|
10385
|
-
onOpenChangeComplete: void 0,
|
|
10386
|
-
triggerElements: new PopupTriggerMap()
|
|
10387
|
-
}, selectors);
|
|
10388
|
-
this.unsubscribeParentListener = this.observe("parent", (parent) => {
|
|
10389
|
-
this.unsubscribeParentListener?.();
|
|
10390
|
-
if (parent.type === "menu") {
|
|
10391
|
-
let rootId = parent.store.select("rootId");
|
|
10392
|
-
let floatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
10393
|
-
let keyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
10394
|
-
this.unsubscribeParentListener = parent.store.subscribe(() => {
|
|
10395
|
-
const nextRootId = parent.store.select("rootId");
|
|
10396
|
-
const nextFloatingTreeRoot = parent.store.select("floatingTreeRoot");
|
|
10397
|
-
const nextKeyboardEventRelay = parent.store.select("keyboardEventRelay");
|
|
10398
|
-
if (rootId === nextRootId && floatingTreeRoot === nextFloatingTreeRoot && keyboardEventRelay === nextKeyboardEventRelay) return;
|
|
10399
|
-
rootId = nextRootId;
|
|
10400
|
-
floatingTreeRoot = nextFloatingTreeRoot;
|
|
10401
|
-
keyboardEventRelay = nextKeyboardEventRelay;
|
|
10402
|
-
this.notifyAll();
|
|
10403
|
-
});
|
|
10404
|
-
this.context.allowMouseUpTriggerRef = parent.store.context.allowMouseUpTriggerRef;
|
|
10405
|
-
return;
|
|
10406
|
-
}
|
|
10407
|
-
if (parent.type !== void 0) this.context.allowMouseUpTriggerRef = parent.context.allowMouseUpTriggerRef;
|
|
10408
|
-
this.unsubscribeParentListener = null;
|
|
10409
|
-
});
|
|
10410
|
-
}
|
|
10411
|
-
setOpen(open, eventDetails) {
|
|
10412
|
-
this.state.floatingRootContext.context.events.emit("setOpen", {
|
|
10413
|
-
open,
|
|
10414
|
-
eventDetails
|
|
10415
|
-
});
|
|
10416
|
-
}
|
|
10417
|
-
static useStore(externalStore, initialState) {
|
|
10418
|
-
const internalStore = useRefWithInit(() => {
|
|
10419
|
-
return new MenuStore(initialState);
|
|
10420
|
-
}).current;
|
|
10421
|
-
return externalStore ?? internalStore;
|
|
10422
|
-
}
|
|
10423
|
-
unsubscribeParentListener = null;
|
|
10424
|
-
};
|
|
10425
|
-
function createInitialState() {
|
|
10426
|
-
return {
|
|
10427
|
-
...createInitialPopupStoreState(),
|
|
10428
|
-
disabled: false,
|
|
10429
|
-
modal: true,
|
|
10430
|
-
openMethod: null,
|
|
10431
|
-
allowMouseEnter: false,
|
|
10432
|
-
highlightItemOnHover: true,
|
|
10433
|
-
stickIfOpen: true,
|
|
10434
|
-
parent: { type: void 0 },
|
|
10435
|
-
rootId: void 0,
|
|
10436
|
-
activeIndex: null,
|
|
10437
|
-
hoverEnabled: true,
|
|
10438
|
-
instantType: void 0,
|
|
10439
|
-
openChangeReason: null,
|
|
10440
|
-
floatingTreeRoot: new FloatingTreeStore(),
|
|
10441
|
-
floatingNodeId: void 0,
|
|
10442
|
-
floatingParentNodeId: null,
|
|
10443
|
-
itemProps: EMPTY_OBJECT,
|
|
10444
|
-
keyboardEventRelay: void 0,
|
|
10445
|
-
closeDelay: 0,
|
|
10446
|
-
hasViewport: false
|
|
10447
|
-
};
|
|
10448
|
-
}
|
|
10449
|
-
//#endregion
|
|
10450
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/submenu-root/MenuSubmenuRootContext.mjs
|
|
10451
|
-
var MenuSubmenuRootContext = /*#__PURE__*/ import_react.createContext(void 0);
|
|
10452
|
-
function useMenuSubmenuRootContext() {
|
|
10453
|
-
return import_react.useContext(MenuSubmenuRootContext);
|
|
10454
|
-
}
|
|
10455
|
-
//#endregion
|
|
10456
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/root/MenuRoot.mjs
|
|
10457
|
-
/**
|
|
10458
|
-
* Groups all parts of the menu.
|
|
10459
|
-
* Doesn't render its own HTML element.
|
|
10460
|
-
*
|
|
10461
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
10462
|
-
*/
|
|
10463
|
-
var MenuRoot = fastComponent(function MenuRoot(props) {
|
|
10464
|
-
const { children, open: openProp, onOpenChange, onOpenChangeComplete, defaultOpen = false, disabled: disabledProp = false, modal: modalProp, loopFocus = true, orientation = "vertical", actionsRef, closeParentOnEsc = false, handle, triggerId: triggerIdProp, defaultTriggerId: defaultTriggerIdProp = null, highlightItemOnHover = true } = props;
|
|
10465
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
10466
|
-
const parentMenuRootContext = useMenuRootContext(true);
|
|
10467
|
-
const menubarContext = useMenubarContext(true);
|
|
10468
|
-
const isSubmenu = useMenuSubmenuRootContext();
|
|
10469
|
-
const parentFromContext = import_react.useMemo(() => {
|
|
10470
|
-
if (isSubmenu && parentMenuRootContext) return {
|
|
10471
|
-
type: "menu",
|
|
10472
|
-
store: parentMenuRootContext.store
|
|
10473
|
-
};
|
|
10474
|
-
if (menubarContext) return {
|
|
10475
|
-
type: "menubar",
|
|
10476
|
-
context: menubarContext
|
|
10477
|
-
};
|
|
10478
|
-
if (contextMenuContext && !parentMenuRootContext) return {
|
|
10479
|
-
type: "context-menu",
|
|
10480
|
-
context: contextMenuContext
|
|
10481
|
-
};
|
|
10482
|
-
return { type: void 0 };
|
|
10483
|
-
}, [
|
|
10484
|
-
contextMenuContext,
|
|
10485
|
-
parentMenuRootContext,
|
|
10486
|
-
menubarContext,
|
|
10487
|
-
isSubmenu
|
|
10488
|
-
]);
|
|
10489
|
-
const store = MenuStore.useStore(handle?.store, {
|
|
10490
|
-
open: defaultOpen,
|
|
10491
|
-
openProp,
|
|
10492
|
-
activeTriggerId: defaultTriggerIdProp,
|
|
10493
|
-
triggerIdProp,
|
|
10494
|
-
parent: parentFromContext
|
|
10495
|
-
});
|
|
10496
|
-
useInitialOpenSync(store, openProp, defaultOpen, defaultTriggerIdProp);
|
|
10497
|
-
store.useControlledProp("openProp", openProp);
|
|
10498
|
-
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
10499
|
-
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
10500
|
-
const rootId = useId();
|
|
10501
|
-
const floatingId = useId();
|
|
10502
|
-
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
10503
|
-
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
|
10504
|
-
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
10505
|
-
const open = store.useState("open");
|
|
10506
|
-
const activeTriggerElement = store.useState("activeTriggerElement");
|
|
10507
|
-
const positionerElement = store.useState("positionerElement");
|
|
10508
|
-
const hoverEnabled = store.useState("hoverEnabled");
|
|
10509
|
-
const disabled = store.useState("disabled");
|
|
10510
|
-
const lastOpenChangeReason = store.useState("lastOpenChangeReason");
|
|
10511
|
-
const parent = store.useState("parent");
|
|
10512
|
-
const activeIndex = store.useState("activeIndex");
|
|
10513
|
-
const payload = store.useState("payload");
|
|
10514
|
-
const floatingParentNodeId = store.useState("floatingParentNodeId");
|
|
10515
|
-
const openEventRef = import_react.useRef(null);
|
|
10516
|
-
const allowOutsidePressDismissalRef = import_react.useRef(parent.type !== "context-menu");
|
|
10517
|
-
const allowOutsidePressDismissalTimeout = useTimeout();
|
|
10518
|
-
const allowTouchToCloseRef = import_react.useRef(true);
|
|
10519
|
-
const allowTouchToCloseTimeout = useTimeout();
|
|
10520
|
-
const nested = floatingParentNodeId != null;
|
|
10521
|
-
const { openMethod, triggerProps: interactionTypeProps } = useOpenInteractionType(open);
|
|
10522
|
-
store.useSyncedValues({
|
|
10523
|
-
disabled: disabledProp,
|
|
10524
|
-
highlightItemOnHover,
|
|
10525
|
-
modal: parent.type === void 0 ? modalProp : void 0,
|
|
10526
|
-
openMethod,
|
|
10527
|
-
rootId
|
|
10528
|
-
});
|
|
10529
|
-
useImplicitActiveTrigger(store);
|
|
10530
|
-
const { forceUnmount } = useOpenStateTransitions(open, store, () => {
|
|
10531
|
-
store.update({
|
|
10532
|
-
allowMouseEnter: false,
|
|
10533
|
-
stickIfOpen: true
|
|
10534
|
-
});
|
|
10535
|
-
});
|
|
10536
|
-
useIsoLayoutEffect(() => {
|
|
10537
|
-
if (contextMenuContext && !parentMenuRootContext) store.update({
|
|
10538
|
-
parent: {
|
|
10539
|
-
type: "context-menu",
|
|
10540
|
-
context: contextMenuContext
|
|
10541
|
-
},
|
|
10542
|
-
floatingNodeId: floatingNodeIdFromContext,
|
|
10543
|
-
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
10544
|
-
});
|
|
10545
|
-
else if (parentMenuRootContext) store.update({
|
|
10546
|
-
floatingNodeId: floatingNodeIdFromContext,
|
|
10547
|
-
floatingParentNodeId: floatingParentNodeIdFromContext
|
|
10548
|
-
});
|
|
10549
|
-
}, [
|
|
10550
|
-
contextMenuContext,
|
|
10551
|
-
parentMenuRootContext,
|
|
10552
|
-
floatingNodeIdFromContext,
|
|
10553
|
-
floatingParentNodeIdFromContext,
|
|
10554
|
-
store
|
|
10555
|
-
]);
|
|
10556
|
-
import_react.useEffect(() => {
|
|
10557
|
-
if (!open) openEventRef.current = null;
|
|
10558
|
-
if (parent.type !== "context-menu") return;
|
|
10559
|
-
if (!open) {
|
|
10560
|
-
allowOutsidePressDismissalTimeout.clear();
|
|
10561
|
-
allowOutsidePressDismissalRef.current = false;
|
|
10562
|
-
return;
|
|
10563
|
-
}
|
|
10564
|
-
allowOutsidePressDismissalTimeout.start(500, () => {
|
|
10565
|
-
allowOutsidePressDismissalRef.current = true;
|
|
10566
|
-
});
|
|
10567
|
-
}, [
|
|
10568
|
-
allowOutsidePressDismissalTimeout,
|
|
10569
|
-
open,
|
|
10570
|
-
parent.type
|
|
10571
|
-
]);
|
|
10572
|
-
useIsoLayoutEffect(() => {
|
|
10573
|
-
if (!open && !hoverEnabled) store.set("hoverEnabled", true);
|
|
10574
|
-
}, [
|
|
10575
|
-
open,
|
|
10576
|
-
hoverEnabled,
|
|
10577
|
-
store
|
|
10578
|
-
]);
|
|
10579
|
-
const setOpen = useStableCallback((nextOpen, eventDetails) => {
|
|
10580
|
-
const reason = eventDetails.reason;
|
|
10581
|
-
if (open === nextOpen && eventDetails.trigger === activeTriggerElement && lastOpenChangeReason === reason) return;
|
|
10582
|
-
const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails);
|
|
10583
|
-
if (!nextOpen && eventDetails.trigger == null) eventDetails.trigger = activeTriggerElement ?? void 0;
|
|
10584
|
-
onOpenChange?.(nextOpen, eventDetails);
|
|
10585
|
-
if (eventDetails.isCanceled) return;
|
|
10586
|
-
store.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
10587
|
-
const nativeEvent = eventDetails.event;
|
|
10588
|
-
if (nextOpen === false && nativeEvent?.type === "click" && nativeEvent.pointerType === "touch" && !allowTouchToCloseRef.current) return;
|
|
10589
|
-
if (nextOpen && reason === "trigger-focus") {
|
|
10590
|
-
allowTouchToCloseRef.current = false;
|
|
10591
|
-
allowTouchToCloseTimeout.start(300, () => {
|
|
10592
|
-
allowTouchToCloseRef.current = true;
|
|
10593
|
-
});
|
|
10594
|
-
} else {
|
|
10595
|
-
allowTouchToCloseRef.current = true;
|
|
10596
|
-
allowTouchToCloseTimeout.clear();
|
|
10597
|
-
}
|
|
10598
|
-
const isKeyboardClick = (reason === "trigger-press" || reason === "item-press") && nativeEvent.detail === 0 && nativeEvent?.isTrusted;
|
|
10599
|
-
const isDismissClose = !nextOpen && (reason === "escape-key" || reason == null);
|
|
10600
|
-
const updatedState = {
|
|
10601
|
-
open: nextOpen,
|
|
10602
|
-
openChangeReason: reason
|
|
10603
|
-
};
|
|
10604
|
-
openEventRef.current = eventDetails.event ?? null;
|
|
10605
|
-
setPopupOpenState(updatedState, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose());
|
|
10606
|
-
store.update(updatedState);
|
|
10607
|
-
if (parent.type === "menubar" && (reason === "trigger-focus" || reason === "focus-out" || reason === "trigger-hover" || reason === "list-navigation" || reason === "sibling-open")) store.set("instantType", "group");
|
|
10608
|
-
else if (isKeyboardClick || isDismissClose) store.set("instantType", isKeyboardClick ? "click" : "dismiss");
|
|
10609
|
-
else store.set("instantType", void 0);
|
|
10610
|
-
});
|
|
10611
|
-
const floatingRootContext = useSyncedFloatingRootContext({
|
|
10612
|
-
popupStore: store,
|
|
10613
|
-
floatingId,
|
|
10614
|
-
nested: floatingParentNodeIdFromContext != null,
|
|
10615
|
-
onOpenChange: setOpen
|
|
10616
|
-
});
|
|
10617
|
-
const floatingEvents = floatingRootContext.context.events;
|
|
10618
|
-
import_react.useEffect(() => {
|
|
10619
|
-
const handleSetOpenEvent = ({ open: nextOpen, eventDetails }) => setOpen(nextOpen, eventDetails);
|
|
10620
|
-
floatingEvents.on("setOpen", handleSetOpenEvent);
|
|
10621
|
-
return () => {
|
|
10622
|
-
floatingEvents?.off("setOpen", handleSetOpenEvent);
|
|
10623
|
-
};
|
|
10624
|
-
}, [floatingEvents, setOpen]);
|
|
10625
|
-
const handleImperativeClose = import_react.useCallback(() => {
|
|
10626
|
-
store.setOpen(false, createChangeEventDetails(imperativeAction));
|
|
10627
|
-
}, [store]);
|
|
10628
|
-
import_react.useImperativeHandle(actionsRef, () => ({
|
|
10629
|
-
unmount: forceUnmount,
|
|
10630
|
-
close: handleImperativeClose
|
|
10631
|
-
}), [forceUnmount, handleImperativeClose]);
|
|
10632
|
-
let ctx;
|
|
10633
|
-
if (parent.type === "context-menu") ctx = parent.context;
|
|
10634
|
-
import_react.useImperativeHandle(ctx?.positionerRef, () => positionerElement, [positionerElement]);
|
|
10635
|
-
import_react.useImperativeHandle(ctx?.actionsRef, () => ({ setOpen }), [setOpen]);
|
|
10636
|
-
const dismiss = useDismiss(floatingRootContext, {
|
|
10637
|
-
enabled: !disabled,
|
|
10638
|
-
bubbles: { escapeKey: closeParentOnEsc && parent.type === "menu" },
|
|
10639
|
-
outsidePress() {
|
|
10640
|
-
if (parent.type !== "context-menu" || openEventRef.current?.type === "contextmenu") return true;
|
|
10641
|
-
return allowOutsidePressDismissalRef.current;
|
|
10642
|
-
},
|
|
10643
|
-
externalTree: nested ? floatingTreeRoot : void 0
|
|
10644
|
-
});
|
|
10645
|
-
const direction = useDirection();
|
|
10646
|
-
const setActiveIndex = import_react.useCallback((index) => {
|
|
10647
|
-
if (store.select("activeIndex") === index) return;
|
|
10648
|
-
store.set("activeIndex", index);
|
|
10649
|
-
}, [store]);
|
|
10650
|
-
const listNavigation$1 = useListNavigation(floatingRootContext, {
|
|
10651
|
-
enabled: !disabled,
|
|
10652
|
-
listRef: store.context.itemDomElements,
|
|
10653
|
-
activeIndex,
|
|
10654
|
-
nested: parent.type !== void 0,
|
|
10655
|
-
loopFocus,
|
|
10656
|
-
orientation,
|
|
10657
|
-
parentOrientation: parent.type === "menubar" ? parent.context.orientation : void 0,
|
|
10658
|
-
rtl: direction === "rtl",
|
|
10659
|
-
disabledIndices: EMPTY_ARRAY,
|
|
10660
|
-
onNavigate: setActiveIndex,
|
|
10661
|
-
openOnArrowKeyDown: parent.type !== "context-menu",
|
|
10662
|
-
externalTree: nested ? floatingTreeRoot : void 0,
|
|
10663
|
-
focusItemOnHover: highlightItemOnHover
|
|
10664
|
-
});
|
|
10665
|
-
const onTyping = import_react.useCallback((nextTyping) => {
|
|
10666
|
-
store.context.typingRef.current = nextTyping;
|
|
10667
|
-
}, [store]);
|
|
10668
|
-
const typeahead = useTypeahead(floatingRootContext, {
|
|
10669
|
-
enabled: !disabled,
|
|
10670
|
-
listRef: store.context.itemLabels,
|
|
10671
|
-
elementsRef: store.context.itemDomElements,
|
|
10672
|
-
activeIndex,
|
|
10673
|
-
resetMs: 500,
|
|
10674
|
-
onMatch: (index) => {
|
|
10675
|
-
if (open && index !== activeIndex) store.set("activeIndex", index);
|
|
10676
|
-
},
|
|
10677
|
-
onTyping
|
|
10678
|
-
});
|
|
10679
|
-
usePopupInteractionProps(store, {
|
|
10680
|
-
floatingRootContext,
|
|
10681
|
-
activeTriggerProps: import_react.useMemo(() => {
|
|
10682
|
-
const mergedProps = mergeProps(typeahead.reference, listNavigation$1.reference, dismiss.reference, { onMouseMove() {
|
|
10683
|
-
store.set("allowMouseEnter", true);
|
|
10684
|
-
} }, interactionTypeProps);
|
|
10685
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
10686
|
-
mergedProps["aria-expanded"] = open;
|
|
10687
|
-
return mergedProps;
|
|
10688
|
-
}, [
|
|
10689
|
-
store,
|
|
10690
|
-
typeahead.reference,
|
|
10691
|
-
listNavigation$1.reference,
|
|
10692
|
-
dismiss.reference,
|
|
10693
|
-
interactionTypeProps,
|
|
10694
|
-
open
|
|
10695
|
-
]),
|
|
10696
|
-
inactiveTriggerProps: import_react.useMemo(() => {
|
|
10697
|
-
const mergedProps = mergeProps(listNavigation$1.trigger, dismiss.trigger, interactionTypeProps);
|
|
10698
|
-
mergedProps["aria-haspopup"] = "menu";
|
|
10699
|
-
mergedProps["aria-expanded"] = false;
|
|
10700
|
-
return mergedProps;
|
|
10701
|
-
}, [
|
|
10702
|
-
listNavigation$1.trigger,
|
|
10703
|
-
dismiss.trigger,
|
|
10704
|
-
interactionTypeProps
|
|
10705
|
-
]),
|
|
10706
|
-
popupProps: import_react.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, {
|
|
10707
|
-
id: floatingId,
|
|
10708
|
-
role: "menu",
|
|
10709
|
-
"aria-labelledby": activeTriggerElement?.id,
|
|
10710
|
-
onMouseMove() {
|
|
10711
|
-
store.set("allowMouseEnter", true);
|
|
10712
|
-
if (parent.type === "menu") store.set("hoverEnabled", false);
|
|
10713
|
-
},
|
|
10714
|
-
onClick() {
|
|
10715
|
-
if (store.select("hoverEnabled")) store.set("hoverEnabled", false);
|
|
10716
|
-
},
|
|
10717
|
-
onKeyDown(event) {
|
|
10718
|
-
const relay = store.select("keyboardEventRelay");
|
|
10719
|
-
if (relay && !event.isPropagationStopped()) relay(event);
|
|
10720
|
-
}
|
|
10721
|
-
}, typeahead.floating, listNavigation$1.floating, dismiss.floating), [
|
|
10722
|
-
activeTriggerElement,
|
|
10723
|
-
floatingId,
|
|
10724
|
-
parent.type,
|
|
10725
|
-
store,
|
|
10726
|
-
typeahead.floating,
|
|
10727
|
-
listNavigation$1.floating,
|
|
10728
|
-
dismiss.floating
|
|
10729
|
-
]),
|
|
10730
|
-
itemProps: listNavigation$1.item ?? EMPTY_OBJECT
|
|
10731
|
-
});
|
|
10732
|
-
const context = import_react.useMemo(() => ({
|
|
10733
|
-
store,
|
|
10734
|
-
parent: parentFromContext
|
|
10735
|
-
}), [store, parentFromContext]);
|
|
10736
|
-
const content = /*#__PURE__*/ (0, import_jsx_runtime.jsx)(MenuRootContext.Provider, {
|
|
10737
|
-
value: context,
|
|
10738
|
-
children: typeof children === "function" ? children({ payload }) : children
|
|
10739
|
-
});
|
|
10740
|
-
if (parent.type === void 0 || parent.type === "context-menu") return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(FloatingTree, {
|
|
10741
|
-
externalTree: floatingTreeRoot,
|
|
10742
|
-
children: content
|
|
10743
|
-
});
|
|
10744
|
-
return content;
|
|
10745
|
-
});
|
|
10746
|
-
//#endregion
|
|
10747
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/getPseudoElementBounds.mjs
|
|
10748
|
-
function getPseudoElementBounds(element) {
|
|
10749
|
-
const elementRect = element.getBoundingClientRect();
|
|
10750
|
-
const win = getWindow(element);
|
|
10751
|
-
if (jsdom) return elementRect;
|
|
10752
|
-
const beforeStyles = win.getComputedStyle(element, "::before");
|
|
10753
|
-
const afterStyles = win.getComputedStyle(element, "::after");
|
|
10754
|
-
if (!(beforeStyles.content !== "none" || afterStyles.content !== "none")) return elementRect;
|
|
10755
|
-
const beforeWidth = parseFloat(beforeStyles.width) || 0;
|
|
10756
|
-
const beforeHeight = parseFloat(beforeStyles.height) || 0;
|
|
10757
|
-
const afterWidth = parseFloat(afterStyles.width) || 0;
|
|
10758
|
-
const afterHeight = parseFloat(afterStyles.height) || 0;
|
|
10759
|
-
const totalWidth = Math.max(elementRect.width, beforeWidth, afterWidth);
|
|
10760
|
-
const totalHeight = Math.max(elementRect.height, beforeHeight, afterHeight);
|
|
10761
|
-
const widthDiff = totalWidth - elementRect.width;
|
|
10762
|
-
const heightDiff = totalHeight - elementRect.height;
|
|
10763
|
-
return {
|
|
10764
|
-
left: elementRect.left - widthDiff / 2,
|
|
10765
|
-
right: elementRect.right + widthDiff / 2,
|
|
10766
|
-
top: elementRect.top - heightDiff / 2,
|
|
10767
|
-
bottom: elementRect.bottom + heightDiff / 2
|
|
10768
|
-
};
|
|
10769
|
-
}
|
|
10770
|
-
//#endregion
|
|
10771
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
|
|
10772
|
-
function useCompositeItem(params = {}) {
|
|
10773
|
-
const { highlightItemOnHover, highlightedIndex, onHighlightedIndexChange } = useCompositeRootContext();
|
|
10774
|
-
const { ref, index } = useCompositeListItem(params);
|
|
10775
|
-
const isHighlighted = highlightedIndex === index;
|
|
10776
|
-
const itemRef = import_react.useRef(null);
|
|
10777
|
-
const mergedRef = useMergedRefs(ref, itemRef);
|
|
10778
|
-
return {
|
|
10779
|
-
compositeProps: {
|
|
10780
|
-
tabIndex: isHighlighted ? 0 : -1,
|
|
10781
|
-
onFocus() {
|
|
10782
|
-
onHighlightedIndexChange(index);
|
|
10783
|
-
},
|
|
10784
|
-
onMouseMove() {
|
|
10785
|
-
const item = itemRef.current;
|
|
10786
|
-
if (!highlightItemOnHover || !item) return;
|
|
10787
|
-
const disabled = item.hasAttribute("disabled") || item.ariaDisabled === "true";
|
|
10788
|
-
if (!isHighlighted && !disabled) item.focus();
|
|
10789
|
-
}
|
|
10790
|
-
},
|
|
10791
|
-
compositeRef: mergedRef,
|
|
10792
|
-
index
|
|
10793
|
-
};
|
|
10794
|
-
}
|
|
10795
|
-
//#endregion
|
|
10796
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/internals/composite/item/CompositeItem.mjs
|
|
10797
|
-
/**
|
|
10798
|
-
* @internal
|
|
10799
|
-
*/
|
|
10800
|
-
function CompositeItem(componentProps) {
|
|
10801
|
-
const { render, className, style, state = EMPTY_OBJECT, props = EMPTY_ARRAY, refs = EMPTY_ARRAY, metadata, stateAttributesMapping, tag = "div", ...elementProps } = componentProps;
|
|
10802
|
-
const { compositeProps, compositeRef } = useCompositeItem({ metadata });
|
|
10803
|
-
return useRenderElement(tag, componentProps, {
|
|
10804
|
-
state,
|
|
10805
|
-
ref: [...refs, compositeRef],
|
|
10806
|
-
props: [
|
|
10807
|
-
compositeProps,
|
|
10808
|
-
...props,
|
|
10809
|
-
elementProps
|
|
10810
|
-
],
|
|
10811
|
-
stateAttributesMapping
|
|
10812
|
-
});
|
|
10813
|
-
}
|
|
10814
|
-
//#endregion
|
|
10815
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/utils/findRootOwnerId.mjs
|
|
10816
|
-
function findRootOwnerId(node) {
|
|
10817
|
-
if (isHTMLElement(node) && node.hasAttribute("data-rootownerid")) return node.getAttribute("data-rootownerid") ?? void 0;
|
|
10818
|
-
if (isLastTraversableNode(node)) return;
|
|
10819
|
-
return findRootOwnerId(getParentNode(node));
|
|
10820
|
-
}
|
|
10821
|
-
//#endregion
|
|
10822
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/popups/useTriggerFocusGuards.mjs
|
|
10823
|
-
/**
|
|
10824
|
-
* Minimal store interface required by the focus guard hook.
|
|
10825
|
-
* Both PopoverStore and MenuStore satisfy this interface.
|
|
10826
|
-
*/
|
|
10827
|
-
/**
|
|
10828
|
-
* Provides focus guard handlers for popup triggers (Popover, Menu).
|
|
10829
|
-
*
|
|
10830
|
-
* When the popup is open, invisible focus guard elements are placed before and after
|
|
10831
|
-
* the trigger. These handlers close the popup and move focus to the appropriate
|
|
10832
|
-
* tabbable element when the guards receive focus (i.e. when the user tabs out).
|
|
10833
|
-
*/
|
|
10834
|
-
function useTriggerFocusGuards(store, triggerElementRef) {
|
|
10835
|
-
const preFocusGuardRef = import_react.useRef(null);
|
|
10836
|
-
function handlePreFocusGuardFocus(event) {
|
|
10837
|
-
import_react_dom.flushSync(() => {
|
|
10838
|
-
store.setOpen(false, createChangeEventDetails(focusOut, event.nativeEvent, event.currentTarget));
|
|
10839
|
-
});
|
|
10840
|
-
getTabbableBeforeElement(preFocusGuardRef.current)?.focus();
|
|
10841
|
-
}
|
|
10842
|
-
function handleFocusTargetFocus(event) {
|
|
10843
|
-
const positionerElement = store.select("positionerElement");
|
|
10844
|
-
if (positionerElement && isOutsideEvent(event, positionerElement)) store.context.beforeContentFocusGuardRef.current?.focus();
|
|
10845
|
-
else {
|
|
10846
|
-
import_react_dom.flushSync(() => {
|
|
10847
|
-
store.setOpen(false, createChangeEventDetails(focusOut, event.nativeEvent, event.currentTarget));
|
|
10848
|
-
});
|
|
10849
|
-
let nextTabbable = getTabbableAfterElement(store.context.triggerFocusTargetRef.current || triggerElementRef.current);
|
|
10850
|
-
while (nextTabbable !== null && contains(positionerElement, nextTabbable)) {
|
|
10851
|
-
const prevTabbable = nextTabbable;
|
|
10852
|
-
nextTabbable = getNextTabbable(nextTabbable);
|
|
10853
|
-
if (nextTabbable === prevTabbable) break;
|
|
10854
|
-
}
|
|
10855
|
-
nextTabbable?.focus();
|
|
10856
|
-
}
|
|
10857
|
-
}
|
|
10858
|
-
return {
|
|
10859
|
-
preFocusGuardRef,
|
|
10860
|
-
handlePreFocusGuardFocus,
|
|
10861
|
-
handleFocusTargetFocus
|
|
10862
|
-
};
|
|
10863
|
-
}
|
|
10864
|
-
//#endregion
|
|
10865
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/utils/useMixedToggleClickHandler.mjs
|
|
10866
|
-
/**
|
|
10867
|
-
* Returns `click` and `mousedown` handlers that fix the behavior of triggers of popups that are toggled by different events.
|
|
10868
|
-
* For example, a button that opens a popup on mousedown and closes it on click.
|
|
10869
|
-
* This hook prevents the popup from closing immediately after the mouse button is released.
|
|
10870
|
-
*/
|
|
10871
|
-
function useMixedToggleClickHandler(params) {
|
|
10872
|
-
const { enabled = true, mouseDownAction, open } = params;
|
|
10873
|
-
const ignoreClickRef = import_react.useRef(false);
|
|
10874
|
-
return import_react.useMemo(() => {
|
|
10875
|
-
if (!enabled) return EMPTY_OBJECT;
|
|
10876
|
-
return {
|
|
10877
|
-
onMouseDown: (event) => {
|
|
10878
|
-
if (mouseDownAction === "open" && !open || mouseDownAction === "close" && open) {
|
|
10879
|
-
ignoreClickRef.current = true;
|
|
10880
|
-
ownerDocument(event.currentTarget).addEventListener("click", () => {
|
|
10881
|
-
ignoreClickRef.current = false;
|
|
10882
|
-
}, { once: true });
|
|
10883
|
-
}
|
|
10884
|
-
},
|
|
10885
|
-
onClick: (event) => {
|
|
10886
|
-
if (ignoreClickRef.current) {
|
|
10887
|
-
ignoreClickRef.current = false;
|
|
10888
|
-
event.preventBaseUIHandler();
|
|
10889
|
-
}
|
|
10890
|
-
}
|
|
10891
|
-
};
|
|
10892
|
-
}, [
|
|
10893
|
-
enabled,
|
|
10894
|
-
mouseDownAction,
|
|
10895
|
-
open
|
|
10896
|
-
]);
|
|
10897
|
-
}
|
|
10898
|
-
//#endregion
|
|
10899
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/menu/trigger/MenuTrigger.mjs
|
|
10900
|
-
var BOUNDARY_OFFSET = 2;
|
|
10901
|
-
/**
|
|
10902
|
-
* A button that opens the menu.
|
|
10903
|
-
* Renders a `<button>` element.
|
|
10904
|
-
*
|
|
10905
|
-
* Documentation: [Base UI Menu](https://base-ui.com/react/components/menu)
|
|
10906
|
-
*/
|
|
10907
|
-
var MenuTrigger = fastComponentRef(function MenuTrigger(componentProps, forwardedRef) {
|
|
10908
|
-
const { render, className, style, disabled: disabledProp = false, nativeButton = true, id: idProp, openOnHover: openOnHoverProp, delay = 100, closeDelay = 0, handle, payload, ...elementProps } = componentProps;
|
|
10909
|
-
const rootContext = useMenuRootContext(true);
|
|
10910
|
-
const store = handle?.store ?? rootContext?.store;
|
|
10911
|
-
if (!store) throw new Error(formatErrorMessage(85));
|
|
10912
|
-
const thisTriggerId = useBaseUiId(idProp);
|
|
10913
|
-
const isTriggerActive = store.useState("isTriggerActive", thisTriggerId);
|
|
10914
|
-
const floatingRootContext = store.useState("floatingRootContext");
|
|
10915
|
-
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
|
10916
|
-
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
10917
|
-
const triggerElementRef = import_react.useRef(null);
|
|
10918
|
-
const parent = useMenuParent();
|
|
10919
|
-
const compositeRootContext = useCompositeRootContext(true);
|
|
10920
|
-
const floatingTreeRootFromContext = useFloatingTree();
|
|
10921
|
-
const floatingTreeRoot = import_react.useMemo(() => {
|
|
10922
|
-
return floatingTreeRootFromContext ?? new FloatingTreeStore();
|
|
10923
|
-
}, [floatingTreeRootFromContext]);
|
|
10924
|
-
const { registerTrigger, isMountedByThisTrigger } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
10925
|
-
payload,
|
|
10926
|
-
closeDelay,
|
|
10927
|
-
parent,
|
|
10928
|
-
floatingTreeRoot,
|
|
10929
|
-
floatingNodeId: useFloatingNodeId(floatingTreeRoot),
|
|
10930
|
-
floatingParentNodeId: useFloatingParentNodeId(),
|
|
10931
|
-
keyboardEventRelay: compositeRootContext?.relayKeyboardEvent
|
|
10932
|
-
});
|
|
10933
|
-
const isInMenubar = parent.type === "menubar";
|
|
10934
|
-
const rootDisabled = store.useState("disabled");
|
|
10935
|
-
const disabled = disabledProp || rootDisabled || isInMenubar && parent.context.disabled;
|
|
10936
|
-
const { getButtonProps, buttonRef } = useButton({
|
|
10937
|
-
disabled,
|
|
10938
|
-
native: nativeButton
|
|
10939
|
-
});
|
|
10940
|
-
import_react.useEffect(() => {
|
|
10941
|
-
if (!isOpenedByThisTrigger && parent.type === void 0) store.context.allowMouseUpTriggerRef.current = false;
|
|
10942
|
-
}, [
|
|
10943
|
-
store,
|
|
10944
|
-
isOpenedByThisTrigger,
|
|
10945
|
-
parent.type
|
|
10946
|
-
]);
|
|
10947
|
-
const triggerRef = import_react.useRef(null);
|
|
10948
|
-
const allowMouseUpTriggerTimeout = useTimeout();
|
|
10949
|
-
const handleDocumentMouseUp = useStableCallback((mouseEvent) => {
|
|
10950
|
-
if (!triggerRef.current) return;
|
|
10951
|
-
allowMouseUpTriggerTimeout.clear();
|
|
10952
|
-
store.context.allowMouseUpTriggerRef.current = false;
|
|
10953
|
-
const mouseUpTarget = mouseEvent.target;
|
|
10954
|
-
if (contains(triggerRef.current, mouseUpTarget) || contains(store.select("positionerElement"), mouseUpTarget) || mouseUpTarget === triggerRef.current) return;
|
|
10955
|
-
if (mouseUpTarget != null && findRootOwnerId(mouseUpTarget) === store.select("rootId")) return;
|
|
10956
|
-
const bounds = getPseudoElementBounds(triggerRef.current);
|
|
10957
|
-
if (mouseEvent.clientX >= bounds.left - BOUNDARY_OFFSET && mouseEvent.clientX <= bounds.right + BOUNDARY_OFFSET && mouseEvent.clientY >= bounds.top - BOUNDARY_OFFSET && mouseEvent.clientY <= bounds.bottom + BOUNDARY_OFFSET) return;
|
|
10958
|
-
floatingTreeRoot.events.emit("close", {
|
|
10959
|
-
domEvent: mouseEvent,
|
|
10960
|
-
reason: cancelOpen
|
|
10961
|
-
});
|
|
10962
|
-
});
|
|
10963
|
-
import_react.useEffect(() => {
|
|
10964
|
-
if (isOpenedByThisTrigger && store.select("lastOpenChangeReason") === "trigger-hover") ownerDocument(triggerRef.current).addEventListener("mouseup", handleDocumentMouseUp, { once: true });
|
|
10965
|
-
}, [
|
|
10966
|
-
isOpenedByThisTrigger,
|
|
10967
|
-
handleDocumentMouseUp,
|
|
10968
|
-
store
|
|
10969
|
-
]);
|
|
10970
|
-
const parentMenubarHasSubmenuOpen = isInMenubar && parent.context.hasSubmenuOpen;
|
|
10971
|
-
const hoverProps = useHoverReferenceInteraction(floatingRootContext, {
|
|
10972
|
-
enabled: (openOnHoverProp ?? parentMenubarHasSubmenuOpen) && !disabled && parent.type !== "context-menu" && (!isInMenubar || parentMenubarHasSubmenuOpen && !isMountedByThisTrigger),
|
|
10973
|
-
handleClose: safePolygon({ blockPointerEvents: !isInMenubar }),
|
|
10974
|
-
mouseOnly: true,
|
|
10975
|
-
move: false,
|
|
10976
|
-
restMs: parent.type === void 0 ? delay : void 0,
|
|
10977
|
-
delay: { close: closeDelay },
|
|
10978
|
-
triggerElementRef,
|
|
10979
|
-
externalTree: floatingTreeRoot,
|
|
10980
|
-
isActiveTrigger: isTriggerActive,
|
|
10981
|
-
isClosing: () => store.select("transitionStatus") === "ending"
|
|
10982
|
-
});
|
|
10983
|
-
const stickIfOpen = useStickIfOpen(isOpenedByThisTrigger, store.select("lastOpenChangeReason"));
|
|
10984
|
-
const click = useClick(floatingRootContext, {
|
|
10985
|
-
enabled: !disabled && parent.type !== "context-menu",
|
|
10986
|
-
event: isOpenedByThisTrigger && isInMenubar ? "click" : "mousedown",
|
|
10987
|
-
toggle: true,
|
|
10988
|
-
ignoreMouse: false,
|
|
10989
|
-
stickIfOpen: parent.type === void 0 ? stickIfOpen : false
|
|
10990
|
-
});
|
|
10991
|
-
const focus = useFocus(floatingRootContext, { enabled: !disabled && parentMenubarHasSubmenuOpen });
|
|
10992
|
-
const mixedToggleHandlers = useMixedToggleClickHandler({
|
|
10993
|
-
open: isOpenedByThisTrigger,
|
|
10994
|
-
enabled: isInMenubar,
|
|
10995
|
-
mouseDownAction: "open"
|
|
10996
|
-
});
|
|
10997
|
-
const localInteractionProps = import_react.useMemo(() => mergeProps(focus.reference, click.reference), [focus.reference, click.reference]);
|
|
10998
|
-
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
|
10999
|
-
const { preFocusGuardRef, handlePreFocusGuardFocus, handleFocusTargetFocus } = useTriggerFocusGuards(store, triggerElementRef);
|
|
11000
|
-
const state = {
|
|
11001
|
-
disabled,
|
|
11002
|
-
open: isOpenedByThisTrigger
|
|
11003
|
-
};
|
|
11004
|
-
const ref = [
|
|
11005
|
-
triggerRef,
|
|
11006
|
-
forwardedRef,
|
|
11007
|
-
buttonRef,
|
|
11008
|
-
registerTrigger,
|
|
11009
|
-
triggerElementRef
|
|
11010
|
-
];
|
|
11011
|
-
const props = [
|
|
11012
|
-
localInteractionProps,
|
|
11013
|
-
hoverProps ?? EMPTY_OBJECT,
|
|
11014
|
-
rootTriggerProps,
|
|
11015
|
-
{
|
|
11016
|
-
"aria-haspopup": "menu",
|
|
11017
|
-
"aria-controls": popupId,
|
|
11018
|
-
id: thisTriggerId,
|
|
11019
|
-
onMouseDown: (event) => {
|
|
11020
|
-
if (store.select("open")) return;
|
|
11021
|
-
allowMouseUpTriggerTimeout.start(200, () => {
|
|
11022
|
-
store.context.allowMouseUpTriggerRef.current = true;
|
|
11023
|
-
});
|
|
11024
|
-
ownerDocument(event.currentTarget).addEventListener("mouseup", handleDocumentMouseUp, { once: true });
|
|
11025
|
-
}
|
|
11026
|
-
},
|
|
11027
|
-
isInMenubar ? { role: "menuitem" } : {},
|
|
11028
|
-
mixedToggleHandlers,
|
|
11029
|
-
elementProps,
|
|
11030
|
-
getButtonProps
|
|
11031
|
-
];
|
|
11032
|
-
const element = useRenderElement("button", componentProps, {
|
|
11033
|
-
enabled: !isInMenubar,
|
|
11034
|
-
stateAttributesMapping: pressableTriggerOpenStateMapping,
|
|
11035
|
-
state,
|
|
11036
|
-
ref,
|
|
11037
|
-
props
|
|
11038
|
-
});
|
|
11039
|
-
if (isInMenubar) return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(CompositeItem, {
|
|
11040
|
-
tag: "button",
|
|
11041
|
-
render,
|
|
11042
|
-
className,
|
|
11043
|
-
style,
|
|
11044
|
-
state,
|
|
11045
|
-
refs: ref,
|
|
11046
|
-
props,
|
|
11047
|
-
stateAttributesMapping: pressableTriggerOpenStateMapping
|
|
11048
|
-
});
|
|
11049
|
-
if (isOpenedByThisTrigger) return /*#__PURE__*/ (0, import_jsx_runtime.jsxs)(import_react.Fragment, { children: [
|
|
11050
|
-
/*#__PURE__*/ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
|
11051
|
-
ref: preFocusGuardRef,
|
|
11052
|
-
onFocus: handlePreFocusGuardFocus
|
|
11053
|
-
}, `${thisTriggerId}-pre-focus-guard`),
|
|
11054
|
-
/*#__PURE__*/ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId),
|
|
11055
|
-
/*#__PURE__*/ (0, import_jsx_runtime.jsx)(FocusGuard, {
|
|
11056
|
-
ref: store.context.triggerFocusTargetRef,
|
|
11057
|
-
onFocus: handleFocusTargetFocus
|
|
11058
|
-
}, `${thisTriggerId}-post-focus-guard`)
|
|
11059
|
-
] });
|
|
11060
|
-
return /*#__PURE__*/ (0, import_jsx_runtime.jsx)(import_react.Fragment, { children: element }, thisTriggerId);
|
|
11061
|
-
});
|
|
11062
|
-
/**
|
|
11063
|
-
* Determines whether to ignore clicks after a hover-open.
|
|
11064
|
-
*/
|
|
11065
|
-
function useStickIfOpen(open, openReason) {
|
|
11066
|
-
const stickIfOpenTimeout = useTimeout();
|
|
11067
|
-
const [stickIfOpen, setStickIfOpen] = import_react.useState(false);
|
|
11068
|
-
useIsoLayoutEffect(() => {
|
|
11069
|
-
if (open && openReason === "trigger-hover") {
|
|
11070
|
-
setStickIfOpen(true);
|
|
11071
|
-
stickIfOpenTimeout.start(500, () => {
|
|
11072
|
-
setStickIfOpen(false);
|
|
11073
|
-
});
|
|
11074
|
-
} else if (!open) {
|
|
11075
|
-
stickIfOpenTimeout.clear();
|
|
11076
|
-
setStickIfOpen(false);
|
|
11077
|
-
}
|
|
11078
|
-
}, [
|
|
11079
|
-
open,
|
|
11080
|
-
openReason,
|
|
11081
|
-
stickIfOpenTimeout
|
|
11082
|
-
]);
|
|
11083
|
-
return stickIfOpen;
|
|
11084
|
-
}
|
|
11085
|
-
function useMenuParent() {
|
|
11086
|
-
const contextMenuContext = useContextMenuRootContext(true);
|
|
11087
|
-
const parentContext = useMenuRootContext(true);
|
|
11088
|
-
const menubarContext = useMenubarContext(true);
|
|
11089
|
-
return import_react.useMemo(() => {
|
|
11090
|
-
if (menubarContext) return {
|
|
11091
|
-
type: "menubar",
|
|
11092
|
-
context: menubarContext
|
|
11093
|
-
};
|
|
11094
|
-
if (contextMenuContext && !parentContext) return {
|
|
11095
|
-
type: "context-menu",
|
|
11096
|
-
context: contextMenuContext
|
|
11097
|
-
};
|
|
11098
|
-
return { type: void 0 };
|
|
11099
|
-
}, [
|
|
11100
|
-
contextMenuContext,
|
|
11101
|
-
parentContext,
|
|
11102
|
-
menubarContext
|
|
11103
|
-
]);
|
|
11104
|
-
}
|
|
11105
|
-
//#endregion
|
|
11106
|
-
//#region ../../node_modules/.pnpm/@base-ui+react@1.6.0_@types+react@19.2.17_react-dom@19.2.7_react@19.2.7/node_modules/@base-ui/react/separator/Separator.mjs
|
|
11107
|
-
/**
|
|
11108
|
-
* A separator element accessible to screen readers.
|
|
11109
|
-
* Renders a `<div>` element.
|
|
11110
|
-
*
|
|
11111
|
-
* Documentation: [Base UI Separator](https://base-ui.com/react/components/separator)
|
|
11112
|
-
*/
|
|
11113
|
-
var Separator = /*#__PURE__*/ import_react.forwardRef(function SeparatorComponent(componentProps, forwardedRef) {
|
|
11114
|
-
const { className, render, orientation = "horizontal", style, ...elementProps } = componentProps;
|
|
11115
|
-
return useRenderElement("div", componentProps, {
|
|
11116
|
-
state: { orientation },
|
|
11117
|
-
ref: forwardedRef,
|
|
11118
|
-
props: [{
|
|
11119
|
-
role: "separator",
|
|
11120
|
-
"aria-orientation": orientation
|
|
11121
|
-
}, elementProps]
|
|
11122
|
-
});
|
|
11123
|
-
});
|
|
11124
|
-
//#endregion
|
|
11125
|
-
export { require_jsx_runtime as C, require_react as S, DialogPopup as _, MenuPortal as a, require_react_dom as b, TooltipProvider as c, TooltipPortal as d, TooltipTrigger as f, DialogPortal as g, DialogRoot as h, MenuPositioner as i, TooltipPopup as l, DialogTitle as m, MenuTrigger as n, MenuPopup as o, TooltipRoot as p, MenuRoot as r, MenuItem as s, Separator as t, TooltipPositioner as u, DialogClose as v, require_with_selector as x, DialogBackdrop as y };
|
|
8773
|
+
export { TooltipTrigger as a, DialogRoot as c, DialogClose as d, DialogBackdrop as f, require_jsx_runtime as g, require_react as h, TooltipPortal as i, DialogPortal as l, require_with_selector as m, TooltipPopup as n, TooltipRoot as o, require_react_dom as p, TooltipPositioner as r, DialogTitle as s, TooltipProvider as t, DialogPopup as u };
|