@qredence/fleet 0.5.1 → 0.5.7
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/CHANGELOG.md +19 -0
- package/bin/fleet-prime.mjs +6 -0
- package/dist/web/client/assets/action-swap-roll-BB8DFMuf.js +1 -0
- package/dist/web/client/assets/agent-activity-CDcDNVC6.js +1 -0
- package/dist/web/client/assets/agent-disclosure-B8SnhQXL.js +1 -0
- package/dist/web/client/assets/analytics-stub-B8MIkiDB.js +1 -0
- package/dist/web/client/assets/{artifacts-panel-CX62LQ13.js → artifacts-panel-CmHYXfoo.js} +1 -1
- package/dist/web/client/assets/button-BV9NafmI.js +1 -0
- package/dist/web/client/assets/{chat-CsepBQwy.js → chat-W-yOMyG_.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-DiG-i3uJ.js +1 -0
- package/dist/web/client/assets/check-JjHKAZas.js +1 -0
- package/dist/web/client/assets/chevron-up-CnSvySGH.js +1 -0
- package/dist/web/client/assets/circle-alert-CONlFReH.js +1 -0
- package/dist/web/client/assets/circle-x-CkKCB__4.js +1 -0
- package/dist/web/client/assets/citations-CpTFUvx7.js +2 -0
- package/dist/web/client/assets/collapsible-BoXtZZWN.js +1 -0
- package/dist/web/client/assets/command-Cx-UYeQ9.js +1 -0
- package/dist/web/client/assets/createBaseUIEventDetails-DV0dQrBX.js +1 -0
- package/dist/web/client/assets/dialog-Dh7WpGIu.js +1 -0
- package/dist/web/client/assets/dist-BPaFisIZ.js +41 -0
- package/dist/web/client/assets/earth-DGZXAN5r.js +1 -0
- package/dist/web/client/assets/ease-u56MhKYS.js +1 -0
- package/dist/web/client/assets/file-text-T-NcAlZs.js +1 -0
- package/dist/web/client/assets/fleet-message-queue-B6zAK-hX.js +1 -0
- package/dist/web/client/assets/{fleet-pi-tool-renderer-BD_ZAjlG.js → fleet-pi-tool-renderer-Btq9mDUe.js} +29 -29
- package/dist/web/client/assets/fleet-reasoning-panel-MtbSdoCv.js +1 -0
- package/dist/web/client/assets/fleet-subagent-list-iszvrvy_.js +1 -0
- package/dist/web/client/assets/fleet-tool-timeline-COzPrwr8.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-C2cVJUbf.js → fork-picker-dialog-CAhWx0G5.js} +1 -1
- package/dist/web/client/assets/gauge-DNpstbBn.js +1 -0
- package/dist/web/client/assets/generative-text-renderer-C1JrmYfx.js +6 -0
- package/dist/web/client/assets/globals-Bfr0jrPq.css +2 -0
- package/dist/web/client/assets/horizontal-resize-Bl3AyBJg.js +1 -0
- package/dist/web/client/assets/image-BbPmlw-n.js +1 -0
- package/dist/web/client/assets/index-QgUwd4m8.js +12 -0
- package/dist/web/client/assets/input-Bol3TP4v.js +1 -0
- package/dist/web/client/assets/input-group-D5gi9zBK.js +1 -0
- package/dist/web/client/assets/{ipython-tool-BfeIa0nK.js → ipython-tool-BrMePqD-.js} +1 -1
- package/dist/web/client/assets/{markdown-DG7pUdsX.js → markdown-RD_ydkyD.js} +2 -2
- package/dist/web/client/assets/{markdown-code-BgMzpy7O.js → markdown-code-ETqXqY8E.js} +1 -1
- package/dist/web/client/assets/message-square-hbDao-A1.js +1 -0
- package/dist/web/client/assets/model-selector-list-CJY9pyt2.js +1 -0
- package/dist/web/client/assets/notify-DKTqXChG.js +1 -0
- package/dist/web/client/assets/{openui-renderer-DlUo6ehT.js → openui-renderer-BZMghkzQ.js} +8 -8
- package/dist/web/client/assets/{prime-agent-artifacts-CHGb5V_j.js → prime-agent-artifacts-C-g1VPiW.js} +1 -1
- package/dist/web/client/assets/prompt-suggestions-CXM6knMK.js +1 -0
- package/dist/web/client/assets/provider-catalog-CHKFGwHr.js +1 -0
- package/dist/web/client/assets/provider-label-KkqVX1CI.js +1 -0
- package/dist/web/client/assets/range-BWOHiLNe.js +1 -0
- package/dist/web/client/assets/refresh-cw-IThTJ3j-.js +1 -0
- package/dist/web/client/assets/repl-panel-CCh4ly7J.js +1 -0
- package/dist/web/client/assets/{resource-helpers-ULlyU8qK.js → resource-helpers-Q2T0YCMO.js} +1 -1
- package/dist/web/client/assets/resources-panel-Bo8dfUdm.js +1 -0
- package/dist/web/client/assets/right-panel-context-B2VAZ2p4.js +1 -0
- package/dist/web/client/assets/right-panel-registry-C5fQcBKw.js +2 -0
- package/dist/web/client/assets/routes-C1hRkRkv.js +16 -0
- package/dist/web/client/assets/safe-external-url-D3PJJIcM.js +1 -0
- package/dist/web/client/assets/session-insights-panel-CQdT90Op.js +1 -0
- package/dist/web/client/assets/settings-dialog-CvvM6T0m.js +1 -0
- package/dist/web/client/assets/{sparkles-C5H3Jtgf.js → shield-check-CkA2viVW.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-fStjEeRP.js → skeleton-loaders-DjGv9LLA.js} +1 -1
- package/dist/web/client/assets/sparkles-DuclzqlE.js +1 -0
- package/dist/web/client/assets/subagent-chat-panel-tGCg6gcn.js +1 -0
- package/dist/web/client/assets/subagent-transcript-NO0PR8RU.js +1 -0
- package/dist/web/client/assets/subagent-utils-CQbaJ1g-.js +1 -0
- package/dist/web/client/assets/subagents-panel-BkFLsQQY.js +1 -0
- package/dist/web/client/assets/surfaces-cW-gp56p.js +1 -0
- package/dist/web/client/assets/switch-CcOFiQBK.js +1 -0
- package/dist/web/client/assets/terminal-DOS1s1gm.js +1 -0
- package/dist/web/client/assets/toast-ATq44uAL.js +1 -0
- package/dist/web/client/assets/tool-result-pklnrxSW.js +4 -0
- package/dist/web/client/assets/use-reduced-motion-eORd7fqW.js +9 -0
- package/dist/web/client/assets/useBaseUiId-CHqXB2UQ.js +1 -0
- package/dist/web/client/assets/useControlled-CJJ9BOQB.js +1 -0
- package/dist/web/client/assets/workspace-panel-BmMW7h7b.js +1 -0
- package/dist/web/client/assets/wrench-BJNNe07k.js +1 -0
- package/dist/web/client/assets/x-CsRC_tCI.js +1 -0
- package/dist/web/client/bundle-budget.json +10 -0
- package/dist/web/server/_tanstack-start-manifest_v-B4BnRTa_-DR7WQTT5.js +90 -0
- package/dist/web/server/agent-activity-Dx6AlDhN-JXOL2EXK.js +514 -0
- package/dist/web/server/{artifacts-panel-D9w1DHAN-FGRDCYU2.js → artifacts-panel-CloS3-ij-XWYXKL6A.js} +30 -22
- package/dist/web/server/{chat-command-palette-BaenPkCN-BHSOPGU4.js → chat-command-palette-Cc0uGvNm-GKENKTO7.js} +48 -22
- package/dist/web/server/{chunk-KPNGZR2R.js → chunk-3B6M63AO.js} +206 -209
- package/dist/web/server/chunk-3D4Z32XA.js +22 -0
- package/dist/web/server/chunk-3SSHBMDS.js +196 -0
- package/dist/web/server/chunk-4PQ6OD6J.js +22 -0
- package/dist/web/server/{chunk-5AVQZ4AZ.js → chunk-4UBOIY2S.js} +2 -1
- package/dist/web/server/chunk-56SEDI5N.js +19 -0
- package/dist/web/server/chunk-6QNW66XR.js +19 -0
- package/dist/web/server/chunk-744IIIDL.js +19 -0
- package/dist/web/server/{chunk-52SJQXO4.js → chunk-7PQTPSEE.js} +568 -568
- package/dist/web/server/{chunk-XYYNYFFD.js → chunk-7SR6WDM2.js} +2 -2
- package/dist/web/server/chunk-ANL4B775.js +60 -0
- package/dist/web/server/chunk-BNQWMQHD.js +35 -0
- package/dist/web/server/{chunk-X2TUFLTP.js → chunk-C5X6G26O.js} +436 -454
- package/dist/web/server/chunk-C66BSNA6.js +42 -0
- package/dist/web/server/{chunk-3GSFXWL5.js → chunk-DEUBJJZN.js} +4 -59
- package/dist/web/server/chunk-E365EOXJ.js +35 -0
- package/dist/web/server/{chunk-5WZFFNFY.js → chunk-EFAGCVZ3.js} +2 -23
- package/dist/web/server/{chunk-Y6LJ4WBI.js → chunk-EGQ6ZX4D.js} +563 -830
- package/dist/web/server/{chunk-DO3TVNGA.js → chunk-EKBKGAWX.js} +12 -10
- package/dist/web/server/{chunk-RPROZ2JC.js → chunk-F6MGAW3L.js} +133 -133
- package/dist/web/server/chunk-GABXCOY3.js +37 -0
- package/dist/web/server/chunk-GV7DJIHY.js +36 -0
- package/dist/web/server/{chunk-PWK2HJIV.js → chunk-HSJMLO36.js} +5 -252
- package/dist/web/server/{chunk-46VQY7SG.js → chunk-HU4AIJV3.js} +4 -4
- package/dist/web/server/{chunk-H64JLONZ.js → chunk-HZY3LBGP.js} +146 -2
- package/dist/web/server/{chunk-3IKSPTYI.js → chunk-J6MRJXUH.js} +22 -15
- package/dist/web/server/{chunk-FE4KN6T2.js → chunk-JOSTE7WK.js} +7 -5
- package/dist/web/server/{chunk-QJBEWT4E.js → chunk-K3BXQG3N.js} +27 -292
- package/dist/web/server/chunk-K4ESBQ3R.js +20 -0
- package/dist/web/server/chunk-KOIPYBJF.js +3773 -0
- package/dist/web/server/{chunk-44IVTHDV.js → chunk-KZSM3BHO.js} +28 -119
- package/dist/web/server/chunk-L46H6IDX.js +13 -0
- package/dist/web/server/chunk-LNGWHEE6.js +206 -0
- package/dist/web/server/{chunk-2U7PWSJX.js → chunk-MOSVTKH5.js} +262 -3661
- package/dist/web/server/{chunk-MDYA4NXK.js → chunk-NJRYX4A2.js} +4 -4
- package/dist/web/server/chunk-NNMZQN7Q.js +296 -0
- package/dist/web/server/{chunk-VHCAD46L.js → chunk-NPPG2GTW.js} +7 -7
- package/dist/web/server/{chunk-AZZHUVJR.js → chunk-PJNYH5SR.js} +7 -303
- package/dist/web/server/{chunk-7APYEQIO.js → chunk-QAE5SXDK.js} +1 -24
- package/dist/web/server/chunk-QTFCJGOY.js +189 -0
- package/dist/web/server/{chunk-FBOO3G67.js → chunk-RANJ6OJ3.js} +9 -9
- package/dist/web/server/chunk-RPBSDXJ4.js +62 -0
- package/dist/web/server/{chunk-PCJ5EKFE.js → chunk-RYHIJMFD.js} +63 -34
- package/dist/web/server/{chunk-NLIUTTKL.js → chunk-S3PQ6HKH.js} +1 -16
- package/dist/web/server/chunk-SG4W4SPQ.js +31 -0
- package/dist/web/server/{chunk-LESNF5O4.js → chunk-T23OO4SC.js} +2 -11
- package/dist/web/server/{chunk-FVWDJNXR.js → chunk-UNZJQ7CY.js} +6 -4
- package/dist/web/server/chunk-V3S6BVXO.js +22 -0
- package/dist/web/server/{chunk-M2FGGPNA.js → chunk-VGDP4YDU.js} +70 -45
- package/dist/web/server/{chunk-WK7CQS2N.js → chunk-W5GRNHV5.js} +51 -49
- package/dist/web/server/{chunk-HBZ6YKRB.js → chunk-WN77JNYY.js} +2 -2
- package/dist/web/server/{chunk-B2F6MLVZ.js → chunk-XFVL5ITL.js} +2246 -2228
- package/dist/web/server/{chunk-EIVNRYP3.js → chunk-XKYEXPLQ.js} +2 -17
- package/dist/web/server/{chunk-6GMKRR3C.js → chunk-XNYQSCB2.js} +2 -2
- package/dist/web/server/chunk-YHXAXJ6I.js +22 -0
- package/dist/web/server/chunk-YLMXYMLG.js +86 -0
- package/dist/web/server/chunk-YNGDUWCF.js +56 -0
- package/dist/web/server/chunk-ZJFA4F5X.js +280 -0
- package/dist/web/server/fleet-message-queue-Bn0_3Efe-G4BZR2EU.js +74 -0
- package/dist/web/server/fleet-pi-tool-renderer-C52SZmPx-CIAH3IV7.js +51 -0
- package/dist/web/server/fleet-reasoning-panel-C_e7wzVm-SDHEWDQT.js +199 -0
- package/dist/web/server/fleet-subagent-list-CQltKswG-EKCMQHDI.js +18 -0
- package/dist/web/server/fleet-tool-timeline-KENErMKg-HTN7SW3D.js +16 -0
- package/dist/web/server/{fork-picker-dialog-BZzfxdQd-Y725VJ7G.js → fork-picker-dialog-DK9YGQuB-4QEFWRU4.js} +6 -5
- package/dist/web/server/{markdown-Boni3lHk-AZGKDNAR.js → markdown-QcSUaLyd-6DJUK5NC.js} +1 -1
- package/dist/web/server/{markdown-code-BrWukbg3-D2GN4Y77.js → markdown-code-Dyo1_13a-52ZQZSPE.js} +2 -2
- package/dist/web/server/model-selector-list-CEfWjRc--GBW2GUO6.js +289 -0
- package/dist/web/server/{openui-renderer-Cg4RSE9k-7BTJIYZJ.js → openui-renderer-Dk0Ak9cW-MUJQHDAS.js} +19 -16
- package/dist/web/server/prompt-suggestions-BOmHi4-J-C563CHFU.js +30 -0
- package/dist/web/server/{repl-panel-BEQrC2ef-V3YEZ7EO.js → repl-panel-D9E8nkQy-L45ZNG2V.js} +4 -3
- package/dist/web/server/{resources-panel-CwKh4U9f-D3VDEMDW.js → resources-panel-B03M8bEp-SZG726N5.js} +7 -6
- package/dist/web/server/{router-CEahIUpn-SRG7XKIH.js → router-BE9HcX2W-JMQ3JWE5.js} +1756 -1374
- package/dist/web/server/{routes-BznemByz-F4DJAYIM.js → routes-CJTRGB1Z-WJKXJFFT.js} +3748 -3955
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/{session-insights-panel-JfeTHE0d-3HZB3ZWI.js → session-insights-panel-BHZyKDTo-LRMAMA3O.js} +4 -2
- package/dist/web/server/{settings-dialog-DgeBMORv-7SRSENPM.js → settings-dialog-yDibpbBH-TCLJ7NRJ.js} +172 -161
- package/dist/web/server/{start-CLAD7RcD-56S4BWMM.js → start-BYVnok_H-IA6TWGA3.js} +1 -1
- package/dist/web/server/subagent-chat-panel-B1YoZIKO-DFRUDQJ2.js +82 -0
- package/dist/web/server/subagents-panel-dJJwpsEL-FTWWCHND.js +200 -0
- package/dist/web/server/{workspace-panel-y54P79_B-VPIYUXF6.js → workspace-panel-BC_H8Jri-5MHAEQQS.js} +22 -18
- package/package.json +5 -5
- package/dist/web/client/assets/analytics-stub-Jh3lkb8P.js +0 -1
- package/dist/web/client/assets/button-0At5xSyU.js +0 -1
- package/dist/web/client/assets/chat-command-palette-C4sSf8Kg.js +0 -1
- package/dist/web/client/assets/collapsible-DmyYcezk.js +0 -1
- package/dist/web/client/assets/command-CB6emP8m.js +0 -2
- package/dist/web/client/assets/conversation-turns-ByFoWPXe.js +0 -6
- package/dist/web/client/assets/dialog-DZ44tBtH.js +0 -1
- package/dist/web/client/assets/dist-MNgIFxqY.js +0 -41
- package/dist/web/client/assets/ease-vFBiNFNK.js +0 -9
- package/dist/web/client/assets/file-text-BhQ0ZnoU.js +0 -1
- package/dist/web/client/assets/globals-CqqQdk2S.css +0 -2
- package/dist/web/client/assets/horizontal-resize-C1TpRLNC.js +0 -1
- package/dist/web/client/assets/index-DweoFRMs.js +0 -12
- package/dist/web/client/assets/input-CqC82Agz.js +0 -1
- package/dist/web/client/assets/input-group-H0TG-mkU.js +0 -1
- package/dist/web/client/assets/notify-Duj26eeZ.js +0 -1
- package/dist/web/client/assets/provider-catalog-BZhZuKSz.js +0 -1
- package/dist/web/client/assets/provider-label-jKm8v18u.js +0 -1
- package/dist/web/client/assets/range-vSJ7Ux_5.js +0 -2
- package/dist/web/client/assets/repl-panel-DiGS6uCw.js +0 -1
- package/dist/web/client/assets/resources-panel-DSU7VGX2.js +0 -1
- package/dist/web/client/assets/routes-CxlNCi_v.js +0 -16
- package/dist/web/client/assets/safe-external-url-Bl_78dpZ.js +0 -1
- package/dist/web/client/assets/session-insights-panel-DwmwiikS.js +0 -1
- package/dist/web/client/assets/settings-dialog-CkfpTKfM.js +0 -1
- package/dist/web/client/assets/subagents-panel-DGnsK6Nx.js +0 -1
- package/dist/web/client/assets/switch-BFEBpUEU.js +0 -1
- package/dist/web/client/assets/toast-C4s7FYYa.js +0 -1
- package/dist/web/client/assets/tool-result-CBzwwUE9.js +0 -4
- package/dist/web/client/assets/useBaseUiId-B9f7fokB.js +0 -1
- package/dist/web/client/assets/useControlled-CoY1jSuL.js +0 -1
- package/dist/web/client/assets/workspace-panel-CjdXlEvd.js +0 -1
- package/dist/web/client/assets/x-BgciQ7_C.js +0 -1
- package/dist/web/server/_tanstack-start-manifest_v-bDUlyKY0-KFW35JRO.js +0 -82
- package/dist/web/server/chunk-ZEVZFLIY.js +0 -334
- package/dist/web/server/fleet-pi-tool-renderer-lJvZWmBJ-4M5YI6VS.js +0 -35
- package/dist/web/server/subagents-panel-CzZe3co7-2VZ5JTWF.js +0 -332
|
@@ -1,62 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
createLucideIcon
|
|
3
|
-
} from "./chunk-E26EAQIM.js";
|
|
4
|
-
|
|
5
|
-
// web/app/dist/server/assets/x-khP_XZ-2.js
|
|
1
|
+
// web/app/dist/server/assets/createBaseUIEventDetails-BA7pBwxQ.js
|
|
6
2
|
import * as React$1 from "react";
|
|
7
3
|
import { createElement as createElement2 } from "react";
|
|
8
4
|
import * as ReactDOM from "react-dom";
|
|
9
|
-
function NOOP() {
|
|
10
|
-
}
|
|
11
|
-
var EMPTY_ARRAY = Object.freeze([]);
|
|
12
|
-
var EMPTY_OBJECT = Object.freeze({});
|
|
13
|
-
function useOnMount(fn) {
|
|
14
|
-
React$1.useEffect(fn, EMPTY_ARRAY);
|
|
15
|
-
}
|
|
16
|
-
var UNINITIALIZED = {};
|
|
17
|
-
function useRefWithInit(init, initArg) {
|
|
18
|
-
const ref = React$1.useRef(UNINITIALIZED);
|
|
19
|
-
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
20
|
-
return ref;
|
|
21
|
-
}
|
|
22
|
-
var noop = () => {
|
|
23
|
-
};
|
|
24
|
-
var useIsoLayoutEffect = typeof document !== "undefined" ? React$1.useLayoutEffect : noop;
|
|
25
|
-
function createFormatErrorMessage(baseUrl, prefix) {
|
|
26
|
-
return function formatErrorMessage2(code, ...args) {
|
|
27
|
-
const url = new URL(baseUrl);
|
|
28
|
-
url.searchParams.set("code", code.toString());
|
|
29
|
-
args.forEach((arg) => url.searchParams.append("args[]", arg));
|
|
30
|
-
return `${prefix} error #${code}; visit ${url} for the full message.`;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
var formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
|
|
34
|
-
var majorVersion = parseInt(React$1.version, 10);
|
|
35
|
-
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
36
|
-
return majorVersion >= reactVersionToCheck;
|
|
37
|
-
}
|
|
38
|
-
var SafeReact = { ...React$1 };
|
|
39
|
-
var useInsertionEffect$1 = SafeReact.useInsertionEffect;
|
|
40
|
-
var useSafeInsertionEffect = useInsertionEffect$1 && useInsertionEffect$1 !== SafeReact.useLayoutEffect ? useInsertionEffect$1 : (fn) => fn();
|
|
41
|
-
function useStableCallback(callback) {
|
|
42
|
-
const stable = useRefWithInit(createStableCallback).current;
|
|
43
|
-
stable.next = callback;
|
|
44
|
-
useSafeInsertionEffect(stable.effect);
|
|
45
|
-
return stable.trampoline;
|
|
46
|
-
}
|
|
47
|
-
function createStableCallback() {
|
|
48
|
-
const stable = {
|
|
49
|
-
next: void 0,
|
|
50
|
-
callback: assertNotCalled,
|
|
51
|
-
trampoline: (...args) => stable.callback?.(...args),
|
|
52
|
-
effect: () => {
|
|
53
|
-
stable.callback = stable.next;
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
return stable;
|
|
57
|
-
}
|
|
58
|
-
function assertNotCalled() {
|
|
59
|
-
}
|
|
60
5
|
function hasWindow() {
|
|
61
6
|
return typeof window !== "undefined";
|
|
62
7
|
}
|
|
@@ -169,163 +114,37 @@ function getOverflowAncestors(node, list, traverseIframes) {
|
|
|
169
114
|
function getFrameElement(win) {
|
|
170
115
|
return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;
|
|
171
116
|
}
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
var EMPTY = null;
|
|
179
|
-
globalThis.requestAnimationFrame;
|
|
180
|
-
var Scheduler = class {
|
|
181
|
-
callbacks = [];
|
|
182
|
-
callbacksCount = 0;
|
|
183
|
-
nextId = 1;
|
|
184
|
-
startId = 1;
|
|
185
|
-
isScheduled = false;
|
|
186
|
-
tick = (timestamp) => {
|
|
187
|
-
this.isScheduled = false;
|
|
188
|
-
const currentCallbacks = this.callbacks;
|
|
189
|
-
const currentCallbacksCount = this.callbacksCount;
|
|
190
|
-
this.callbacks = [];
|
|
191
|
-
this.callbacksCount = 0;
|
|
192
|
-
this.startId = this.nextId;
|
|
193
|
-
if (currentCallbacksCount > 0) for (let i = 0; i < currentCallbacks.length; i += 1) currentCallbacks[i]?.(timestamp);
|
|
194
|
-
};
|
|
195
|
-
request(fn) {
|
|
196
|
-
const id = this.nextId;
|
|
197
|
-
this.nextId += 1;
|
|
198
|
-
this.callbacks.push(fn);
|
|
199
|
-
this.callbacksCount += 1;
|
|
200
|
-
if (!this.isScheduled || false) {
|
|
201
|
-
requestAnimationFrame(this.tick);
|
|
202
|
-
this.isScheduled = true;
|
|
203
|
-
}
|
|
204
|
-
return id;
|
|
205
|
-
}
|
|
206
|
-
cancel(id) {
|
|
207
|
-
const index = id - this.startId;
|
|
208
|
-
if (index < 0 || index >= this.callbacks.length) return;
|
|
209
|
-
this.callbacks[index] = null;
|
|
210
|
-
this.callbacksCount -= 1;
|
|
211
|
-
}
|
|
212
|
-
};
|
|
213
|
-
var scheduler = new Scheduler();
|
|
214
|
-
var AnimationFrame = class AnimationFrame2 {
|
|
215
|
-
static create() {
|
|
216
|
-
return new AnimationFrame2();
|
|
217
|
-
}
|
|
218
|
-
static request(fn) {
|
|
219
|
-
return scheduler.request(fn);
|
|
220
|
-
}
|
|
221
|
-
static cancel(id) {
|
|
222
|
-
return scheduler.cancel(id);
|
|
223
|
-
}
|
|
224
|
-
currentId = EMPTY;
|
|
225
|
-
/**
|
|
226
|
-
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
227
|
-
*/
|
|
228
|
-
request(fn) {
|
|
229
|
-
this.cancel();
|
|
230
|
-
this.currentId = scheduler.request(() => {
|
|
231
|
-
this.currentId = EMPTY;
|
|
232
|
-
fn();
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
cancel = () => {
|
|
236
|
-
if (this.currentId !== EMPTY) {
|
|
237
|
-
scheduler.cancel(this.currentId);
|
|
238
|
-
this.currentId = EMPTY;
|
|
239
|
-
}
|
|
240
|
-
};
|
|
241
|
-
disposeEffect = () => {
|
|
242
|
-
return this.cancel;
|
|
243
|
-
};
|
|
244
|
-
};
|
|
245
|
-
function useAnimationFrame() {
|
|
246
|
-
const timeout = useRefWithInit(AnimationFrame.create).current;
|
|
247
|
-
useOnMount(timeout.disposeEffect);
|
|
248
|
-
return timeout;
|
|
249
|
-
}
|
|
250
|
-
function useMergedRefs(a, b, c, d) {
|
|
251
|
-
const forkRef = useRefWithInit(createForkRef).current;
|
|
252
|
-
if (didChange(forkRef, a, b, c, d)) update(forkRef, [
|
|
253
|
-
a,
|
|
254
|
-
b,
|
|
255
|
-
c,
|
|
256
|
-
d
|
|
257
|
-
]);
|
|
258
|
-
return forkRef.callback;
|
|
259
|
-
}
|
|
260
|
-
function useMergedRefsN(refs) {
|
|
261
|
-
const forkRef = useRefWithInit(createForkRef).current;
|
|
262
|
-
if (didChangeN(forkRef, refs)) update(forkRef, refs);
|
|
263
|
-
return forkRef.callback;
|
|
264
|
-
}
|
|
265
|
-
function createForkRef() {
|
|
266
|
-
return {
|
|
267
|
-
callback: null,
|
|
268
|
-
cleanup: null,
|
|
269
|
-
refs: []
|
|
270
|
-
};
|
|
271
|
-
}
|
|
272
|
-
function didChange(forkRef, a, b, c, d) {
|
|
273
|
-
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
|
|
117
|
+
var SafeReact = { ...React$1 };
|
|
118
|
+
var UNINITIALIZED = {};
|
|
119
|
+
function useRefWithInit(init, initArg) {
|
|
120
|
+
const ref = React$1.useRef(UNINITIALIZED);
|
|
121
|
+
if (ref.current === UNINITIALIZED) ref.current = init(initArg);
|
|
122
|
+
return ref;
|
|
274
123
|
}
|
|
275
|
-
|
|
276
|
-
|
|
124
|
+
var useInsertionEffect$1 = SafeReact.useInsertionEffect;
|
|
125
|
+
var useSafeInsertionEffect = useInsertionEffect$1 && useInsertionEffect$1 !== SafeReact.useLayoutEffect ? useInsertionEffect$1 : (fn) => fn();
|
|
126
|
+
function useStableCallback(callback) {
|
|
127
|
+
const stable = useRefWithInit(createStableCallback).current;
|
|
128
|
+
stable.next = callback;
|
|
129
|
+
useSafeInsertionEffect(stable.effect);
|
|
130
|
+
return stable.trampoline;
|
|
277
131
|
}
|
|
278
|
-
function
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
if (forkRef.cleanup) {
|
|
286
|
-
forkRef.cleanup();
|
|
287
|
-
forkRef.cleanup = null;
|
|
288
|
-
}
|
|
289
|
-
if (instance != null) {
|
|
290
|
-
const cleanupCallbacks = Array(refs.length).fill(null);
|
|
291
|
-
for (let i = 0; i < refs.length; i += 1) {
|
|
292
|
-
const ref = refs[i];
|
|
293
|
-
if (ref == null) continue;
|
|
294
|
-
switch (typeof ref) {
|
|
295
|
-
case "function": {
|
|
296
|
-
const refCleanup = ref(instance);
|
|
297
|
-
if (typeof refCleanup === "function") cleanupCallbacks[i] = refCleanup;
|
|
298
|
-
break;
|
|
299
|
-
}
|
|
300
|
-
case "object":
|
|
301
|
-
ref.current = instance;
|
|
302
|
-
}
|
|
303
|
-
}
|
|
304
|
-
forkRef.cleanup = () => {
|
|
305
|
-
for (let i = 0; i < refs.length; i += 1) {
|
|
306
|
-
const ref = refs[i];
|
|
307
|
-
if (ref == null) continue;
|
|
308
|
-
switch (typeof ref) {
|
|
309
|
-
case "function": {
|
|
310
|
-
const cleanupCallback = cleanupCallbacks[i];
|
|
311
|
-
if (typeof cleanupCallback === "function") cleanupCallback();
|
|
312
|
-
else ref(null);
|
|
313
|
-
break;
|
|
314
|
-
}
|
|
315
|
-
case "object":
|
|
316
|
-
ref.current = null;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
};
|
|
132
|
+
function createStableCallback() {
|
|
133
|
+
const stable = {
|
|
134
|
+
next: void 0,
|
|
135
|
+
callback: assertNotCalled,
|
|
136
|
+
trampoline: (...args) => stable.callback?.(...args),
|
|
137
|
+
effect: () => {
|
|
138
|
+
stable.callback = stable.next;
|
|
320
139
|
}
|
|
321
140
|
};
|
|
141
|
+
return stable;
|
|
322
142
|
}
|
|
323
|
-
function
|
|
324
|
-
if (!/* @__PURE__ */ React$1.isValidElement(element)) return null;
|
|
325
|
-
const reactElement = element;
|
|
326
|
-
const propsWithRef = reactElement.props;
|
|
327
|
-
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
|
|
143
|
+
function assertNotCalled() {
|
|
328
144
|
}
|
|
145
|
+
var noop = () => {
|
|
146
|
+
};
|
|
147
|
+
var useIsoLayoutEffect = typeof document !== "undefined" ? React$1.useLayoutEffect : noop;
|
|
329
148
|
function mergeObjects(a, b) {
|
|
330
149
|
if (a && !b) return a;
|
|
331
150
|
if (!a && b) return b;
|
|
@@ -334,26 +153,6 @@ function mergeObjects(a, b) {
|
|
|
334
153
|
...b
|
|
335
154
|
};
|
|
336
155
|
}
|
|
337
|
-
function getStateAttributesProps(state, customMapping) {
|
|
338
|
-
const props = {};
|
|
339
|
-
for (const key in state) {
|
|
340
|
-
const value = state[key];
|
|
341
|
-
if (customMapping?.hasOwnProperty(key)) {
|
|
342
|
-
const customProps = customMapping[key](value);
|
|
343
|
-
if (customProps != null) Object.assign(props, customProps);
|
|
344
|
-
continue;
|
|
345
|
-
}
|
|
346
|
-
if (value === true) props[`data-${key.toLowerCase()}`] = "";
|
|
347
|
-
else if (value) props[`data-${key.toLowerCase()}`] = value.toString();
|
|
348
|
-
}
|
|
349
|
-
return props;
|
|
350
|
-
}
|
|
351
|
-
function resolveClassName(className, state) {
|
|
352
|
-
return typeof className === "function" ? className(state) : className;
|
|
353
|
-
}
|
|
354
|
-
function resolveStyle(style, state) {
|
|
355
|
-
return typeof style === "function" ? style(state) : style;
|
|
356
|
-
}
|
|
357
156
|
var EMPTY_PROPS = {};
|
|
358
157
|
function mergeProps(a, b, c, d, e) {
|
|
359
158
|
if (!c && !d && !e && !a) return createInitialMergedProps(b);
|
|
@@ -459,14 +258,283 @@ function mergeClassNames(ourClassName, theirClassName) {
|
|
|
459
258
|
function isSyntheticEvent(event) {
|
|
460
259
|
return event != null && typeof event === "object" && "nativeEvent" in event;
|
|
461
260
|
}
|
|
462
|
-
function
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
}
|
|
468
|
-
|
|
469
|
-
|
|
261
|
+
function createFormatErrorMessage(baseUrl, prefix) {
|
|
262
|
+
return function formatErrorMessage2(code, ...args) {
|
|
263
|
+
const url = new URL(baseUrl);
|
|
264
|
+
url.searchParams.set("code", code.toString());
|
|
265
|
+
args.forEach((arg) => url.searchParams.append("args[]", arg));
|
|
266
|
+
return `${prefix} error #${code}; visit ${url} for the full message.`;
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
var formatErrorMessage = createFormatErrorMessage("https://base-ui.com/production-error", "Base UI");
|
|
270
|
+
var CompositeRootContext = /* @__PURE__ */ React$1.createContext(void 0);
|
|
271
|
+
function useCompositeRootContext(optional = false) {
|
|
272
|
+
const context = React$1.useContext(CompositeRootContext);
|
|
273
|
+
if (context === void 0 && !optional) throw new Error(formatErrorMessage(16));
|
|
274
|
+
return context;
|
|
275
|
+
}
|
|
276
|
+
function useFocusableWhenDisabled(parameters) {
|
|
277
|
+
const { focusableWhenDisabled, disabled: disabled2, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters;
|
|
278
|
+
const isFocusableComposite = composite && focusableWhenDisabled !== false;
|
|
279
|
+
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
|
|
280
|
+
return { props: React$1.useMemo(() => {
|
|
281
|
+
const additionalProps = { onKeyDown(event) {
|
|
282
|
+
if (disabled2 && focusableWhenDisabled && event.key !== "Tab") event.preventDefault();
|
|
283
|
+
} };
|
|
284
|
+
if (!composite) {
|
|
285
|
+
additionalProps.tabIndex = tabIndexProp;
|
|
286
|
+
if (!isNativeButton && disabled2) additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
|
|
287
|
+
}
|
|
288
|
+
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) additionalProps["aria-disabled"] = disabled2;
|
|
289
|
+
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) additionalProps.disabled = disabled2;
|
|
290
|
+
return additionalProps;
|
|
291
|
+
}, [
|
|
292
|
+
composite,
|
|
293
|
+
disabled2,
|
|
294
|
+
focusableWhenDisabled,
|
|
295
|
+
isFocusableComposite,
|
|
296
|
+
isNonFocusableComposite,
|
|
297
|
+
isNativeButton,
|
|
298
|
+
tabIndexProp
|
|
299
|
+
]) };
|
|
300
|
+
}
|
|
301
|
+
function dispatchClickWithModifiers(target, sourceEvent, { detail = 0 } = {}) {
|
|
302
|
+
target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
|
|
303
|
+
bubbles: true,
|
|
304
|
+
cancelable: true,
|
|
305
|
+
composed: true,
|
|
306
|
+
detail,
|
|
307
|
+
shiftKey: sourceEvent.shiftKey,
|
|
308
|
+
ctrlKey: sourceEvent.ctrlKey,
|
|
309
|
+
altKey: sourceEvent.altKey,
|
|
310
|
+
metaKey: sourceEvent.metaKey
|
|
311
|
+
}));
|
|
312
|
+
}
|
|
313
|
+
function useButton(parameters = {}) {
|
|
314
|
+
const { disabled: disabled2 = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters;
|
|
315
|
+
const elementRef = React$1.useRef(null);
|
|
316
|
+
const compositeRootContext = useCompositeRootContext(true);
|
|
317
|
+
const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
|
|
318
|
+
const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({
|
|
319
|
+
focusableWhenDisabled,
|
|
320
|
+
disabled: disabled2,
|
|
321
|
+
composite: isCompositeItem,
|
|
322
|
+
tabIndex,
|
|
323
|
+
isNativeButton
|
|
324
|
+
});
|
|
325
|
+
const updateDisabled = React$1.useCallback(() => {
|
|
326
|
+
const element = elementRef.current;
|
|
327
|
+
if (!isButtonElement(element)) return;
|
|
328
|
+
if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) element.disabled = false;
|
|
329
|
+
}, [
|
|
330
|
+
disabled2,
|
|
331
|
+
focusableWhenDisabledProps.disabled,
|
|
332
|
+
isCompositeItem
|
|
333
|
+
]);
|
|
334
|
+
useIsoLayoutEffect(updateDisabled, [updateDisabled]);
|
|
335
|
+
return {
|
|
336
|
+
getButtonProps: React$1.useCallback((externalProps = {}) => {
|
|
337
|
+
const { onClick: externalOnClick, onMouseDown: externalOnMouseDown, onKeyUp: externalOnKeyUp, onKeyDown: externalOnKeyDown, onPointerDown: externalOnPointerDown, ...otherExternalProps } = externalProps;
|
|
338
|
+
return mergeProps({
|
|
339
|
+
onClick(event) {
|
|
340
|
+
if (disabled2) {
|
|
341
|
+
event.preventDefault();
|
|
342
|
+
return;
|
|
343
|
+
}
|
|
344
|
+
externalOnClick?.(event);
|
|
345
|
+
},
|
|
346
|
+
onMouseDown(event) {
|
|
347
|
+
if (!disabled2) externalOnMouseDown?.(event);
|
|
348
|
+
},
|
|
349
|
+
onKeyDown(event) {
|
|
350
|
+
if (disabled2) return;
|
|
351
|
+
makeEventPreventable(event);
|
|
352
|
+
externalOnKeyDown?.(event);
|
|
353
|
+
if (event.baseUIHandlerPrevented) return;
|
|
354
|
+
const isCurrentTarget = event.target === event.currentTarget;
|
|
355
|
+
const currentTarget = event.currentTarget;
|
|
356
|
+
const isButton = isButtonElement(currentTarget);
|
|
357
|
+
const isLink = !isNativeButton && isValidLinkElement(currentTarget);
|
|
358
|
+
const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
|
|
359
|
+
const isEnterKey = event.key === "Enter";
|
|
360
|
+
const isSpaceKey = event.key === " ";
|
|
361
|
+
const role = currentTarget.getAttribute("role");
|
|
362
|
+
const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
|
|
363
|
+
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
|
|
364
|
+
if (event.defaultPrevented && isTextNavigationRole) return;
|
|
365
|
+
event.preventDefault();
|
|
366
|
+
if (!isNativeButton || isButton) {
|
|
367
|
+
event.preventBaseUIHandler();
|
|
368
|
+
dispatchClickWithModifiers(currentTarget, event);
|
|
369
|
+
}
|
|
370
|
+
return;
|
|
371
|
+
}
|
|
372
|
+
if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
|
|
373
|
+
if (isCurrentTarget && isLink && isSpaceKey) event.preventDefault();
|
|
374
|
+
return;
|
|
375
|
+
}
|
|
376
|
+
if (event.defaultPrevented) return;
|
|
377
|
+
event.preventDefault();
|
|
378
|
+
if (isEnterKey) {
|
|
379
|
+
event.preventBaseUIHandler();
|
|
380
|
+
dispatchClickWithModifiers(currentTarget, event);
|
|
381
|
+
}
|
|
382
|
+
},
|
|
383
|
+
onKeyUp(event) {
|
|
384
|
+
if (disabled2) return;
|
|
385
|
+
makeEventPreventable(event);
|
|
386
|
+
externalOnKeyUp?.(event);
|
|
387
|
+
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
|
|
388
|
+
event.preventDefault();
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
if (event.baseUIHandlerPrevented) return;
|
|
392
|
+
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
|
|
393
|
+
event.preventBaseUIHandler();
|
|
394
|
+
dispatchClickWithModifiers(event.currentTarget, event);
|
|
395
|
+
}
|
|
396
|
+
},
|
|
397
|
+
onPointerDown(event) {
|
|
398
|
+
if (disabled2) {
|
|
399
|
+
event.preventDefault();
|
|
400
|
+
return;
|
|
401
|
+
}
|
|
402
|
+
externalOnPointerDown?.(event);
|
|
403
|
+
}
|
|
404
|
+
}, isNativeButton ? { type: "button" } : { role: "button" }, focusableWhenDisabledProps, otherExternalProps);
|
|
405
|
+
}, [
|
|
406
|
+
disabled2,
|
|
407
|
+
focusableWhenDisabledProps,
|
|
408
|
+
isCompositeItem,
|
|
409
|
+
isNativeButton
|
|
410
|
+
]),
|
|
411
|
+
buttonRef: useStableCallback((element) => {
|
|
412
|
+
elementRef.current = element;
|
|
413
|
+
updateDisabled();
|
|
414
|
+
})
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
function isButtonElement(elem) {
|
|
418
|
+
return isHTMLElement(elem) && elem.tagName === "BUTTON";
|
|
419
|
+
}
|
|
420
|
+
function isValidLinkElement(elem) {
|
|
421
|
+
return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
|
|
422
|
+
}
|
|
423
|
+
function useMergedRefs(a, b, c, d) {
|
|
424
|
+
const forkRef = useRefWithInit(createForkRef).current;
|
|
425
|
+
if (didChange(forkRef, a, b, c, d)) update(forkRef, [
|
|
426
|
+
a,
|
|
427
|
+
b,
|
|
428
|
+
c,
|
|
429
|
+
d
|
|
430
|
+
]);
|
|
431
|
+
return forkRef.callback;
|
|
432
|
+
}
|
|
433
|
+
function useMergedRefsN(refs) {
|
|
434
|
+
const forkRef = useRefWithInit(createForkRef).current;
|
|
435
|
+
if (didChangeN(forkRef, refs)) update(forkRef, refs);
|
|
436
|
+
return forkRef.callback;
|
|
437
|
+
}
|
|
438
|
+
function createForkRef() {
|
|
439
|
+
return {
|
|
440
|
+
callback: null,
|
|
441
|
+
cleanup: null,
|
|
442
|
+
refs: []
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function didChange(forkRef, a, b, c, d) {
|
|
446
|
+
return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
|
|
447
|
+
}
|
|
448
|
+
function didChangeN(forkRef, newRefs) {
|
|
449
|
+
return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
|
|
450
|
+
}
|
|
451
|
+
function update(forkRef, refs) {
|
|
452
|
+
forkRef.refs = refs;
|
|
453
|
+
if (refs.every((ref) => ref == null)) {
|
|
454
|
+
forkRef.callback = null;
|
|
455
|
+
return;
|
|
456
|
+
}
|
|
457
|
+
forkRef.callback = (instance) => {
|
|
458
|
+
if (forkRef.cleanup) {
|
|
459
|
+
forkRef.cleanup();
|
|
460
|
+
forkRef.cleanup = null;
|
|
461
|
+
}
|
|
462
|
+
if (instance != null) {
|
|
463
|
+
const cleanupCallbacks = Array(refs.length).fill(null);
|
|
464
|
+
for (let i = 0; i < refs.length; i += 1) {
|
|
465
|
+
const ref = refs[i];
|
|
466
|
+
if (ref == null) continue;
|
|
467
|
+
switch (typeof ref) {
|
|
468
|
+
case "function": {
|
|
469
|
+
const refCleanup = ref(instance);
|
|
470
|
+
if (typeof refCleanup === "function") cleanupCallbacks[i] = refCleanup;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
case "object":
|
|
474
|
+
ref.current = instance;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
forkRef.cleanup = () => {
|
|
478
|
+
for (let i = 0; i < refs.length; i += 1) {
|
|
479
|
+
const ref = refs[i];
|
|
480
|
+
if (ref == null) continue;
|
|
481
|
+
switch (typeof ref) {
|
|
482
|
+
case "function": {
|
|
483
|
+
const cleanupCallback = cleanupCallbacks[i];
|
|
484
|
+
if (typeof cleanupCallback === "function") cleanupCallback();
|
|
485
|
+
else ref(null);
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
case "object":
|
|
489
|
+
ref.current = null;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
};
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
var majorVersion = parseInt(React$1.version, 10);
|
|
497
|
+
function isReactVersionAtLeast(reactVersionToCheck) {
|
|
498
|
+
return majorVersion >= reactVersionToCheck;
|
|
499
|
+
}
|
|
500
|
+
function getReactElementRef(element) {
|
|
501
|
+
if (!/* @__PURE__ */ React$1.isValidElement(element)) return null;
|
|
502
|
+
const reactElement = element;
|
|
503
|
+
const propsWithRef = reactElement.props;
|
|
504
|
+
return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
|
|
505
|
+
}
|
|
506
|
+
function NOOP() {
|
|
507
|
+
}
|
|
508
|
+
var EMPTY_ARRAY = Object.freeze([]);
|
|
509
|
+
var EMPTY_OBJECT = Object.freeze({});
|
|
510
|
+
function getStateAttributesProps(state, customMapping) {
|
|
511
|
+
const props = {};
|
|
512
|
+
for (const key in state) {
|
|
513
|
+
const value = state[key];
|
|
514
|
+
if (customMapping?.hasOwnProperty(key)) {
|
|
515
|
+
const customProps = customMapping[key](value);
|
|
516
|
+
if (customProps != null) Object.assign(props, customProps);
|
|
517
|
+
continue;
|
|
518
|
+
}
|
|
519
|
+
if (value === true) props[`data-${key.toLowerCase()}`] = "";
|
|
520
|
+
else if (value) props[`data-${key.toLowerCase()}`] = value.toString();
|
|
521
|
+
}
|
|
522
|
+
return props;
|
|
523
|
+
}
|
|
524
|
+
function resolveClassName(className, state) {
|
|
525
|
+
return typeof className === "function" ? className(state) : className;
|
|
526
|
+
}
|
|
527
|
+
function resolveStyle(style, state) {
|
|
528
|
+
return typeof style === "function" ? style(state) : style;
|
|
529
|
+
}
|
|
530
|
+
function useRenderElement(element, componentProps, params = {}) {
|
|
531
|
+
const renderProp = componentProps.render;
|
|
532
|
+
const outProps = useRenderElementProps(componentProps, params);
|
|
533
|
+
if (params.enabled === false) return null;
|
|
534
|
+
return evaluateRenderProp(element, renderProp, outProps, params.state ?? EMPTY_OBJECT);
|
|
535
|
+
}
|
|
536
|
+
function useRenderElementProps(componentProps, params = {}) {
|
|
537
|
+
const { className: classNameProp, style: styleProp, render: renderProp } = componentProps;
|
|
470
538
|
const { state = EMPTY_OBJECT, ref, props, stateAttributesMapping, enabled = true } = params;
|
|
471
539
|
const className = enabled ? resolveClassName(classNameProp, state) : void 0;
|
|
472
540
|
const style = enabled ? resolveStyle(styleProp, state) : void 0;
|
|
@@ -482,42 +550,123 @@ function useRenderElementProps(componentProps, params = {}) {
|
|
|
482
550
|
]);
|
|
483
551
|
else outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
|
|
484
552
|
}
|
|
485
|
-
if (!enabled) return EMPTY_OBJECT;
|
|
486
|
-
if (className !== void 0) outProps.className = mergeClassNames(outProps.className, className);
|
|
487
|
-
if (style !== void 0) outProps.style = mergeObjects(outProps.style, style);
|
|
488
|
-
return outProps;
|
|
489
|
-
}
|
|
490
|
-
function resolveRenderFunctionProps(props) {
|
|
491
|
-
if (Array.isArray(props)) return mergePropsN(props);
|
|
492
|
-
return mergeProps(void 0, props);
|
|
493
|
-
}
|
|
494
|
-
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
495
|
-
function evaluateRenderProp(element, render, props, state) {
|
|
496
|
-
if (render) {
|
|
497
|
-
if (typeof render === "function") return render(props, state);
|
|
498
|
-
const mergedProps = mergeProps(props, render.props);
|
|
499
|
-
mergedProps.ref = props.ref;
|
|
500
|
-
let newElement = render;
|
|
501
|
-
if (newElement?.$$typeof === REACT_LAZY_TYPE) newElement = React$1.Children.toArray(render)[0];
|
|
502
|
-
return /* @__PURE__ */ React$1.cloneElement(newElement, mergedProps);
|
|
553
|
+
if (!enabled) return EMPTY_OBJECT;
|
|
554
|
+
if (className !== void 0) outProps.className = mergeClassNames(outProps.className, className);
|
|
555
|
+
if (style !== void 0) outProps.style = mergeObjects(outProps.style, style);
|
|
556
|
+
return outProps;
|
|
557
|
+
}
|
|
558
|
+
function resolveRenderFunctionProps(props) {
|
|
559
|
+
if (Array.isArray(props)) return mergePropsN(props);
|
|
560
|
+
return mergeProps(void 0, props);
|
|
561
|
+
}
|
|
562
|
+
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
|
|
563
|
+
function evaluateRenderProp(element, render, props, state) {
|
|
564
|
+
if (render) {
|
|
565
|
+
if (typeof render === "function") return render(props, state);
|
|
566
|
+
const mergedProps = mergeProps(props, render.props);
|
|
567
|
+
mergedProps.ref = props.ref;
|
|
568
|
+
let newElement = render;
|
|
569
|
+
if (newElement?.$$typeof === REACT_LAZY_TYPE) newElement = React$1.Children.toArray(render)[0];
|
|
570
|
+
return /* @__PURE__ */ React$1.cloneElement(newElement, mergedProps);
|
|
571
|
+
}
|
|
572
|
+
if (element) {
|
|
573
|
+
if (typeof element === "string") return renderTag(element, props);
|
|
574
|
+
}
|
|
575
|
+
throw new Error(formatErrorMessage(8));
|
|
576
|
+
}
|
|
577
|
+
function renderTag(Tag, props) {
|
|
578
|
+
if (Tag === "button") return /* @__PURE__ */ createElement2("button", {
|
|
579
|
+
type: "button",
|
|
580
|
+
...props,
|
|
581
|
+
key: props.key
|
|
582
|
+
});
|
|
583
|
+
if (Tag === "img") return /* @__PURE__ */ createElement2("img", {
|
|
584
|
+
alt: "",
|
|
585
|
+
...props,
|
|
586
|
+
key: props.key
|
|
587
|
+
});
|
|
588
|
+
return /* @__PURE__ */ React$1.createElement(Tag, props);
|
|
589
|
+
}
|
|
590
|
+
function useOnMount(fn) {
|
|
591
|
+
React$1.useEffect(fn, EMPTY_ARRAY);
|
|
592
|
+
}
|
|
593
|
+
function addEventListener(target, type, listener, options) {
|
|
594
|
+
target.addEventListener(type, listener, options);
|
|
595
|
+
return () => {
|
|
596
|
+
target.removeEventListener(type, listener, options);
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
var EMPTY = null;
|
|
600
|
+
globalThis.requestAnimationFrame;
|
|
601
|
+
var Scheduler = class {
|
|
602
|
+
callbacks = [];
|
|
603
|
+
callbacksCount = 0;
|
|
604
|
+
nextId = 1;
|
|
605
|
+
startId = 1;
|
|
606
|
+
isScheduled = false;
|
|
607
|
+
tick = (timestamp) => {
|
|
608
|
+
this.isScheduled = false;
|
|
609
|
+
const currentCallbacks = this.callbacks;
|
|
610
|
+
const currentCallbacksCount = this.callbacksCount;
|
|
611
|
+
this.callbacks = [];
|
|
612
|
+
this.callbacksCount = 0;
|
|
613
|
+
this.startId = this.nextId;
|
|
614
|
+
if (currentCallbacksCount > 0) for (let i = 0; i < currentCallbacks.length; i += 1) currentCallbacks[i]?.(timestamp);
|
|
615
|
+
};
|
|
616
|
+
request(fn) {
|
|
617
|
+
const id = this.nextId;
|
|
618
|
+
this.nextId += 1;
|
|
619
|
+
this.callbacks.push(fn);
|
|
620
|
+
this.callbacksCount += 1;
|
|
621
|
+
if (!this.isScheduled || false) {
|
|
622
|
+
requestAnimationFrame(this.tick);
|
|
623
|
+
this.isScheduled = true;
|
|
624
|
+
}
|
|
625
|
+
return id;
|
|
626
|
+
}
|
|
627
|
+
cancel(id) {
|
|
628
|
+
const index = id - this.startId;
|
|
629
|
+
if (index < 0 || index >= this.callbacks.length) return;
|
|
630
|
+
this.callbacks[index] = null;
|
|
631
|
+
this.callbacksCount -= 1;
|
|
632
|
+
}
|
|
633
|
+
};
|
|
634
|
+
var scheduler = new Scheduler();
|
|
635
|
+
var AnimationFrame = class AnimationFrame2 {
|
|
636
|
+
static create() {
|
|
637
|
+
return new AnimationFrame2();
|
|
503
638
|
}
|
|
504
|
-
|
|
505
|
-
|
|
639
|
+
static request(fn) {
|
|
640
|
+
return scheduler.request(fn);
|
|
506
641
|
}
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
642
|
+
static cancel(id) {
|
|
643
|
+
return scheduler.cancel(id);
|
|
644
|
+
}
|
|
645
|
+
currentId = EMPTY;
|
|
646
|
+
/**
|
|
647
|
+
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
648
|
+
*/
|
|
649
|
+
request(fn) {
|
|
650
|
+
this.cancel();
|
|
651
|
+
this.currentId = scheduler.request(() => {
|
|
652
|
+
this.currentId = EMPTY;
|
|
653
|
+
fn();
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
cancel = () => {
|
|
657
|
+
if (this.currentId !== EMPTY) {
|
|
658
|
+
scheduler.cancel(this.currentId);
|
|
659
|
+
this.currentId = EMPTY;
|
|
660
|
+
}
|
|
661
|
+
};
|
|
662
|
+
disposeEffect = () => {
|
|
663
|
+
return this.cancel;
|
|
664
|
+
};
|
|
665
|
+
};
|
|
666
|
+
function useAnimationFrame() {
|
|
667
|
+
const timeout = useRefWithInit(AnimationFrame.create).current;
|
|
668
|
+
useOnMount(timeout.disposeEffect);
|
|
669
|
+
return timeout;
|
|
521
670
|
}
|
|
522
671
|
var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) {
|
|
523
672
|
TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style";
|
|
@@ -621,159 +770,6 @@ function useId$1(idOverride, prefix) {
|
|
|
621
770
|
}
|
|
622
771
|
return useGlobalId(idOverride, prefix);
|
|
623
772
|
}
|
|
624
|
-
var CompositeRootContext = /* @__PURE__ */ React$1.createContext(void 0);
|
|
625
|
-
function useCompositeRootContext(optional = false) {
|
|
626
|
-
const context = React$1.useContext(CompositeRootContext);
|
|
627
|
-
if (context === void 0 && !optional) throw new Error(formatErrorMessage(16));
|
|
628
|
-
return context;
|
|
629
|
-
}
|
|
630
|
-
function useFocusableWhenDisabled(parameters) {
|
|
631
|
-
const { focusableWhenDisabled, disabled: disabled2, composite = false, tabIndex: tabIndexProp = 0, isNativeButton } = parameters;
|
|
632
|
-
const isFocusableComposite = composite && focusableWhenDisabled !== false;
|
|
633
|
-
const isNonFocusableComposite = composite && focusableWhenDisabled === false;
|
|
634
|
-
return { props: React$1.useMemo(() => {
|
|
635
|
-
const additionalProps = { onKeyDown(event) {
|
|
636
|
-
if (disabled2 && focusableWhenDisabled && event.key !== "Tab") event.preventDefault();
|
|
637
|
-
} };
|
|
638
|
-
if (!composite) {
|
|
639
|
-
additionalProps.tabIndex = tabIndexProp;
|
|
640
|
-
if (!isNativeButton && disabled2) additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
|
|
641
|
-
}
|
|
642
|
-
if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) additionalProps["aria-disabled"] = disabled2;
|
|
643
|
-
if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) additionalProps.disabled = disabled2;
|
|
644
|
-
return additionalProps;
|
|
645
|
-
}, [
|
|
646
|
-
composite,
|
|
647
|
-
disabled2,
|
|
648
|
-
focusableWhenDisabled,
|
|
649
|
-
isFocusableComposite,
|
|
650
|
-
isNonFocusableComposite,
|
|
651
|
-
isNativeButton,
|
|
652
|
-
tabIndexProp
|
|
653
|
-
]) };
|
|
654
|
-
}
|
|
655
|
-
function dispatchClickWithModifiers(target, sourceEvent, { detail = 0 } = {}) {
|
|
656
|
-
target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
|
|
657
|
-
bubbles: true,
|
|
658
|
-
cancelable: true,
|
|
659
|
-
composed: true,
|
|
660
|
-
detail,
|
|
661
|
-
shiftKey: sourceEvent.shiftKey,
|
|
662
|
-
ctrlKey: sourceEvent.ctrlKey,
|
|
663
|
-
altKey: sourceEvent.altKey,
|
|
664
|
-
metaKey: sourceEvent.metaKey
|
|
665
|
-
}));
|
|
666
|
-
}
|
|
667
|
-
function useButton(parameters = {}) {
|
|
668
|
-
const { disabled: disabled2 = false, focusableWhenDisabled, tabIndex = 0, native: isNativeButton = true, composite: compositeProp } = parameters;
|
|
669
|
-
const elementRef = React$1.useRef(null);
|
|
670
|
-
const compositeRootContext = useCompositeRootContext(true);
|
|
671
|
-
const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
|
|
672
|
-
const { props: focusableWhenDisabledProps } = useFocusableWhenDisabled({
|
|
673
|
-
focusableWhenDisabled,
|
|
674
|
-
disabled: disabled2,
|
|
675
|
-
composite: isCompositeItem,
|
|
676
|
-
tabIndex,
|
|
677
|
-
isNativeButton
|
|
678
|
-
});
|
|
679
|
-
const updateDisabled = React$1.useCallback(() => {
|
|
680
|
-
const element = elementRef.current;
|
|
681
|
-
if (!isButtonElement(element)) return;
|
|
682
|
-
if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) element.disabled = false;
|
|
683
|
-
}, [
|
|
684
|
-
disabled2,
|
|
685
|
-
focusableWhenDisabledProps.disabled,
|
|
686
|
-
isCompositeItem
|
|
687
|
-
]);
|
|
688
|
-
useIsoLayoutEffect(updateDisabled, [updateDisabled]);
|
|
689
|
-
return {
|
|
690
|
-
getButtonProps: React$1.useCallback((externalProps = {}) => {
|
|
691
|
-
const { onClick: externalOnClick, onMouseDown: externalOnMouseDown, onKeyUp: externalOnKeyUp, onKeyDown: externalOnKeyDown, onPointerDown: externalOnPointerDown, ...otherExternalProps } = externalProps;
|
|
692
|
-
return mergeProps({
|
|
693
|
-
onClick(event) {
|
|
694
|
-
if (disabled2) {
|
|
695
|
-
event.preventDefault();
|
|
696
|
-
return;
|
|
697
|
-
}
|
|
698
|
-
externalOnClick?.(event);
|
|
699
|
-
},
|
|
700
|
-
onMouseDown(event) {
|
|
701
|
-
if (!disabled2) externalOnMouseDown?.(event);
|
|
702
|
-
},
|
|
703
|
-
onKeyDown(event) {
|
|
704
|
-
if (disabled2) return;
|
|
705
|
-
makeEventPreventable(event);
|
|
706
|
-
externalOnKeyDown?.(event);
|
|
707
|
-
if (event.baseUIHandlerPrevented) return;
|
|
708
|
-
const isCurrentTarget = event.target === event.currentTarget;
|
|
709
|
-
const currentTarget = event.currentTarget;
|
|
710
|
-
const isButton = isButtonElement(currentTarget);
|
|
711
|
-
const isLink = !isNativeButton && isValidLinkElement(currentTarget);
|
|
712
|
-
const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink);
|
|
713
|
-
const isEnterKey = event.key === "Enter";
|
|
714
|
-
const isSpaceKey = event.key === " ";
|
|
715
|
-
const role = currentTarget.getAttribute("role");
|
|
716
|
-
const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
|
|
717
|
-
if (isCurrentTarget && isCompositeItem && isSpaceKey) {
|
|
718
|
-
if (event.defaultPrevented && isTextNavigationRole) return;
|
|
719
|
-
event.preventDefault();
|
|
720
|
-
if (!isNativeButton || isButton) {
|
|
721
|
-
event.preventBaseUIHandler();
|
|
722
|
-
dispatchClickWithModifiers(currentTarget, event);
|
|
723
|
-
}
|
|
724
|
-
return;
|
|
725
|
-
}
|
|
726
|
-
if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
|
|
727
|
-
if (isCurrentTarget && isLink && isSpaceKey) event.preventDefault();
|
|
728
|
-
return;
|
|
729
|
-
}
|
|
730
|
-
if (event.defaultPrevented) return;
|
|
731
|
-
event.preventDefault();
|
|
732
|
-
if (isEnterKey) {
|
|
733
|
-
event.preventBaseUIHandler();
|
|
734
|
-
dispatchClickWithModifiers(currentTarget, event);
|
|
735
|
-
}
|
|
736
|
-
},
|
|
737
|
-
onKeyUp(event) {
|
|
738
|
-
if (disabled2) return;
|
|
739
|
-
makeEventPreventable(event);
|
|
740
|
-
externalOnKeyUp?.(event);
|
|
741
|
-
if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
|
|
742
|
-
event.preventDefault();
|
|
743
|
-
return;
|
|
744
|
-
}
|
|
745
|
-
if (event.baseUIHandlerPrevented) return;
|
|
746
|
-
if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
|
|
747
|
-
event.preventBaseUIHandler();
|
|
748
|
-
dispatchClickWithModifiers(event.currentTarget, event);
|
|
749
|
-
}
|
|
750
|
-
},
|
|
751
|
-
onPointerDown(event) {
|
|
752
|
-
if (disabled2) {
|
|
753
|
-
event.preventDefault();
|
|
754
|
-
return;
|
|
755
|
-
}
|
|
756
|
-
externalOnPointerDown?.(event);
|
|
757
|
-
}
|
|
758
|
-
}, isNativeButton ? { type: "button" } : { role: "button" }, focusableWhenDisabledProps, otherExternalProps);
|
|
759
|
-
}, [
|
|
760
|
-
disabled2,
|
|
761
|
-
focusableWhenDisabledProps,
|
|
762
|
-
isCompositeItem,
|
|
763
|
-
isNativeButton
|
|
764
|
-
]),
|
|
765
|
-
buttonRef: useStableCallback((element) => {
|
|
766
|
-
elementRef.current = element;
|
|
767
|
-
updateDisabled();
|
|
768
|
-
})
|
|
769
|
-
};
|
|
770
|
-
}
|
|
771
|
-
function isButtonElement(elem) {
|
|
772
|
-
return isHTMLElement(elem) && elem.tagName === "BUTTON";
|
|
773
|
-
}
|
|
774
|
-
function isValidLinkElement(elem) {
|
|
775
|
-
return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
|
|
776
|
-
}
|
|
777
773
|
var none = "none";
|
|
778
774
|
var triggerPress = "trigger-press";
|
|
779
775
|
var triggerHover = "trigger-hover";
|
|
@@ -813,24 +809,8 @@ function createChangeEventDetails(reason, event, trigger, customProperties) {
|
|
|
813
809
|
...custom
|
|
814
810
|
};
|
|
815
811
|
}
|
|
816
|
-
var X = createLucideIcon("x", [["path", {
|
|
817
|
-
d: "M18 6 6 18",
|
|
818
|
-
key: "1bl5f8"
|
|
819
|
-
}], ["path", {
|
|
820
|
-
d: "m6 6 12 12",
|
|
821
|
-
key: "d8bk6v"
|
|
822
|
-
}]]);
|
|
823
812
|
|
|
824
813
|
export {
|
|
825
|
-
NOOP,
|
|
826
|
-
EMPTY_ARRAY,
|
|
827
|
-
EMPTY_OBJECT,
|
|
828
|
-
useOnMount,
|
|
829
|
-
useRefWithInit,
|
|
830
|
-
useIsoLayoutEffect,
|
|
831
|
-
formatErrorMessage,
|
|
832
|
-
isReactVersionAtLeast,
|
|
833
|
-
useStableCallback,
|
|
834
814
|
getNodeName,
|
|
835
815
|
getWindow,
|
|
836
816
|
getDocumentElement,
|
|
@@ -850,23 +830,32 @@ export {
|
|
|
850
830
|
getParentNode,
|
|
851
831
|
getOverflowAncestors,
|
|
852
832
|
getFrameElement,
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
833
|
+
useRefWithInit,
|
|
834
|
+
useStableCallback,
|
|
835
|
+
useIsoLayoutEffect,
|
|
836
|
+
mergeProps,
|
|
837
|
+
formatErrorMessage,
|
|
838
|
+
CompositeRootContext,
|
|
839
|
+
useCompositeRootContext,
|
|
840
|
+
dispatchClickWithModifiers,
|
|
841
|
+
useButton,
|
|
856
842
|
useMergedRefs,
|
|
843
|
+
isReactVersionAtLeast,
|
|
844
|
+
NOOP,
|
|
845
|
+
EMPTY_ARRAY,
|
|
846
|
+
EMPTY_OBJECT,
|
|
857
847
|
resolveStyle,
|
|
858
|
-
mergeProps,
|
|
859
848
|
useRenderElement,
|
|
849
|
+
useOnMount,
|
|
850
|
+
addEventListener,
|
|
851
|
+
AnimationFrame,
|
|
852
|
+
useAnimationFrame,
|
|
860
853
|
TransitionStatusDataAttributes,
|
|
861
854
|
transitionStatusMapping,
|
|
862
855
|
resolveRef,
|
|
863
856
|
useAnimationsFinished,
|
|
864
857
|
useOpenChangeComplete,
|
|
865
858
|
useId$1,
|
|
866
|
-
CompositeRootContext,
|
|
867
|
-
useCompositeRootContext,
|
|
868
|
-
dispatchClickWithModifiers,
|
|
869
|
-
useButton,
|
|
870
859
|
none,
|
|
871
860
|
triggerPress,
|
|
872
861
|
triggerHover,
|
|
@@ -883,12 +872,5 @@ export {
|
|
|
883
872
|
initial,
|
|
884
873
|
imperativeAction,
|
|
885
874
|
windowResize,
|
|
886
|
-
createChangeEventDetails
|
|
887
|
-
X
|
|
875
|
+
createChangeEventDetails
|
|
888
876
|
};
|
|
889
|
-
/**
|
|
890
|
-
* @license lucide-react v1.33.0 - ISC
|
|
891
|
-
*
|
|
892
|
-
* This source code is licensed under the ISC license.
|
|
893
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
894
|
-
*/
|