@qredence/fleet 0.7.4 → 0.9.0
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 +48 -0
- package/README.md +5 -4
- package/bin/fleet-prime.mjs +33 -6
- package/bin/prime-runtime.mjs +79 -0
- package/dist/runtime-manifest.json +32 -0
- package/dist/web/client/assets/DialogTitle-BlVq-tcv.js +1 -0
- package/dist/web/client/assets/FloatingPortal-D8-EPDs2.js +1 -0
- package/dist/web/client/assets/activity-BPIKUzOU.js +1 -0
- package/dist/web/client/assets/agents-CGjUBYX7.js +2 -0
- package/dist/web/client/assets/agents-page-CTuFJL9H.js +1 -0
- package/dist/web/client/assets/alert-CzWGeumf.js +1 -0
- package/dist/web/client/assets/alert-dialog-D-e1Pr4q.js +1 -0
- package/dist/web/client/assets/arrow-up-right-CG9RNk4p.js +1 -0
- package/dist/web/client/assets/artifacts-panel-6JEdy6jU.js +1 -0
- package/dist/web/client/assets/badge-CzQFgmVK.js +1 -0
- package/dist/web/client/assets/button-CWYjn8Zk.js +1 -0
- package/dist/web/client/assets/{card-Hngi3HGC.js → card-Dj1SnGUU.js} +1 -1
- package/dist/web/client/assets/chat-command-palette-Bxr5EkO6.js +1 -0
- package/dist/web/client/assets/chat-hpzV6IA6.js +57 -0
- package/dist/web/client/assets/chat-queries-CfZiupub.js +3 -0
- package/dist/web/client/assets/clock-3-BwWCSCm_.js +1 -0
- package/dist/web/client/assets/code-block-pKKmFZ5w.js +3 -0
- package/dist/web/client/assets/collapsible-Bk6zCsRX.js +1 -0
- package/dist/web/client/assets/{command-CmtCIDdH.js → command-xo-NK4xO.js} +1 -1
- package/dist/web/client/assets/connectors-CFxLqG2x.js +2 -0
- package/dist/web/client/assets/connectors-page-DQJdoAnl.js +1 -0
- package/dist/web/client/assets/create-project-dialog-Db-WhUmP.js +1 -0
- package/dist/web/client/assets/createBaseUIEventDetails-DIxvaz-Y.js +1 -0
- package/dist/web/client/assets/dialog-CK8dym6z.js +1 -0
- package/dist/web/client/assets/eye-iNSvs0UA.js +1 -0
- package/dist/web/client/assets/file-code-corner-BkDULqko.js +1 -0
- package/dist/web/client/assets/{fork-picker-dialog-DfGlB17w.js → fork-picker-dialog-DSaFeUii.js} +1 -1
- package/dist/web/client/assets/globals-DJhWyayo.css +2 -0
- package/dist/web/client/assets/index-C9FHZDGw.js +13 -0
- package/dist/web/client/assets/input-CBoTMPC_.js +1 -0
- package/dist/web/client/assets/{input-group-EPMGh55u.js → input-group-BFubAtz9.js} +1 -1
- package/dist/web/client/assets/{ipython-tool-CMhnRVrC.js → ipython-tool-bieUhw9K.js} +1 -1
- package/dist/web/client/assets/markdown-CvBfbPCn.js +2 -0
- package/dist/web/client/assets/markdown-code-rFOkzN5N.js +4 -0
- package/dist/web/client/assets/mcp-connections-section-DEo6Kemv.js +2 -0
- package/dist/web/client/assets/message-queue-Btjt9wK2.js +1 -0
- package/dist/web/client/assets/{model-selector-list-BiU_7ivt.js → model-selector-list-CbDAT0Rw.js} +1 -1
- package/dist/web/client/assets/mutation-Da9zdeWr.js +1 -0
- package/dist/web/client/assets/notify-BIL0-CGy.js +1 -0
- package/dist/web/client/assets/open-panel-action-message-SdA1VU42.js +1 -0
- package/dist/web/client/assets/openui-renderer-DG-iML7M.js +291 -0
- package/dist/web/client/assets/pencil-Cbgq3ybX.js +1 -0
- package/dist/web/client/assets/plus-DUP2JPVG.js +1 -0
- package/dist/web/client/assets/product-page-header-Ck6I13CE.js +1 -0
- package/dist/web/client/assets/{prompt-input-Dy-DSPqF.js → prompt-input-CoV1gTUQ.js} +1 -1
- package/dist/web/client/assets/{prompt-suggestions-CrpAiKeB.js → prompt-suggestions-CAY5JI-C.js} +1 -1
- package/dist/web/client/assets/provider-catalog-CLEDlH_v.js +1 -0
- package/dist/web/client/assets/provider-label-BItazQ6H.js +1 -0
- package/dist/web/client/assets/reasoning-line-DGdPUMwT.js +1 -0
- package/dist/web/client/assets/rehype-katex-DITkIpVl.js +259 -0
- package/dist/web/client/assets/{repl-panel-DN5kZAcB.js → repl-panel-5xgkDXO5.js} +1 -1
- package/dist/web/client/assets/{resources-panel-DD6iWOF3.js → resources-panel-aJCKt9eF.js} +1 -1
- package/dist/web/client/assets/right-panel-context-CjX-HkDO.js +1 -0
- package/dist/web/client/assets/right-panel-registry-BAJ6TuEY.js +2 -0
- package/dist/web/client/assets/rotate-ccw-DLkfsmG9.js +1 -0
- package/dist/web/client/assets/routes-ja_liP8Z.js +14 -0
- package/dist/web/client/assets/select-DYh951qi.js +1 -0
- package/dist/web/client/assets/session-activity-panel-DwaXiSrS.js +1 -0
- package/dist/web/client/assets/{session-insights-panel-D0v_DKcb.js → session-insights-panel-BXEmuJKf.js} +1 -1
- package/dist/web/client/assets/session-reasoning-panel-CjJJK_bq.js +1 -0
- package/dist/web/client/assets/session-tool-renderer-DEABxZG3.js +166 -0
- package/dist/web/client/assets/{session-tree-panel-BBwP_EK2.js → session-tree-panel-5QgMvXoX.js} +1 -1
- package/dist/web/client/assets/settings-dialog-DiikSLhF.js +1 -0
- package/dist/web/client/assets/shield-check-7HDd-2Fn.js +1 -0
- package/dist/web/client/assets/{skeleton-DNAr5ULI.js → skeleton-B_Lq2XFl.js} +1 -1
- package/dist/web/client/assets/{skeleton-loaders-B28mF4tJ.js → skeleton-loaders-DWc1eDL3.js} +1 -1
- package/dist/web/client/assets/sparkles-CASAe1AI.js +1 -0
- package/dist/web/client/assets/{spinner-CSBXk3Lo.js → spinner-B5TaKP7k.js} +1 -1
- package/dist/web/client/assets/{subagent-chat-panel-DhvBO4dQ.js → subagent-chat-panel-R2RoX1Yt.js} +1 -1
- package/dist/web/client/assets/subagent-transcript-DVZhMo7a.js +1 -0
- package/dist/web/client/assets/{subagents-panel-DRo8Xs6j.js → subagents-panel-CMMRUP8F.js} +1 -1
- package/dist/web/client/assets/surfaces-BUjUJTyD.js +1 -0
- package/dist/web/client/assets/switch-BrxDfsX6.js +1 -0
- package/dist/web/client/assets/toast-BNWkgZ0u.js +1 -0
- package/dist/web/client/assets/tool-output-normalizer-DDU09Zc6.js +4 -0
- package/dist/web/client/assets/tool-part-normalizer-CF6bmJ0s.js +4 -0
- package/dist/web/client/assets/tool-result-7qREIVv_.js +5 -0
- package/dist/web/client/assets/tool-timeline-CGhwMeNl.js +2 -0
- package/dist/web/client/assets/trace-IsV5RRvM.js +1 -0
- package/dist/web/client/assets/trash-sm2UyOxe.js +1 -0
- package/dist/web/client/assets/types-gIgIxnnG.js +1 -0
- package/dist/web/client/assets/ui-preferences-B-PNDkyY.js +1 -0
- package/dist/web/client/assets/use-hover-capable-CLq8BADD.js +1 -0
- package/dist/web/client/assets/useBaseUiId-lKfDDIcw.js +1 -0
- package/dist/web/client/assets/useButton-CvcmqA2s.js +1 -0
- package/dist/web/client/assets/useNavigate-CVhM7pag.js +1 -0
- package/dist/web/client/assets/useRender-CzJUrRlB.js +1 -0
- package/dist/web/client/assets/useScrollLock-BcsteNzT.js +1 -0
- package/dist/web/client/assets/{utils-CFDGLzf6.js → utils-oBThwhjm.js} +1 -1
- package/dist/web/client/assets/with-selector-B_VDO56x.js +1 -0
- package/dist/web/client/assets/{workspace-panel-DdZutYnd.js → workspace-panel-Da5I4p_t.js} +1 -1
- package/dist/web/client/assets/workspace-path-nav-D-77sJ_A.js +2 -0
- package/dist/web/client/assets/wrench-BXX_Ah2s.js +1 -0
- package/dist/web/client/bundle-budget.json +6 -6
- package/dist/web/server/_tanstack-start-manifest_v-B6ne-00G-OFX7UD4K.js +119 -0
- package/dist/web/server/agents-BwzqhPjK-ANFHE5AG.js +22 -0
- package/dist/web/server/agents-page-DEqPV-eG-BR5MR74O.js +215 -0
- package/dist/web/server/{artifacts-panel-COSC8o7j-GKW2HH2G.js → artifacts-panel-DLO8OfXb-B2ZWCDFP.js} +35 -29
- package/dist/web/server/{chat-command-palette-CuOWdzkk-PKZQ5EZP.js → chat-command-palette-CaDQAMAu-KDH7BTDS.js} +22 -15
- package/dist/web/server/chunk-2ETDIMNM.js +40 -0
- package/dist/web/server/{chunk-2VKVSL6Y.js → chunk-35RIM6VP.js} +128 -127
- package/dist/web/server/chunk-5IE54MRG.js +207 -0
- package/dist/web/server/{chunk-VUBITQ5X.js → chunk-5MOXRFX6.js} +180 -7
- package/dist/web/server/{chunk-6GTTTYSE.js → chunk-6AFVCERK.js} +72 -79
- package/dist/web/server/chunk-6GYLXDX3.js +588 -0
- package/dist/web/server/chunk-7DQQMT5V.js +8993 -0
- package/dist/web/server/chunk-APOS34PW.js +8965 -0
- package/dist/web/server/{chunk-BUKOEXE7.js → chunk-AXN2OBPF.js} +2 -4
- package/dist/web/server/{chunk-WCKKN5BR.js → chunk-B5FKCW75.js} +357 -910
- package/dist/web/server/chunk-BD7YKYWL.js +1007 -0
- package/dist/web/server/{chunk-36CAMOVG.js → chunk-BZ2EAUZZ.js} +10 -12
- package/dist/web/server/chunk-CE7U5QB2.js +42 -0
- package/dist/web/server/chunk-FNV3WZXL.js +125 -0
- package/dist/web/server/{chunk-GLSR4ZI2.js → chunk-FSQWWR2M.js} +698 -832
- package/dist/web/server/chunk-FT7HNDR5.js +143 -0
- package/dist/web/server/chunk-GNXIDE26.js +44 -0
- package/dist/web/server/{chunk-ORCOCCER.js → chunk-HAFELESQ.js} +5 -7
- package/dist/web/server/{chunk-LLO4MNGE.js → chunk-HUHUPGHT.js} +53 -45
- package/dist/web/server/{chunk-QSM3BRMA.js → chunk-KBMRRJQN.js} +256 -157
- package/dist/web/server/chunk-KDCSEISZ.js +6890 -0
- package/dist/web/server/chunk-KSGGSGOA.js +50 -0
- package/dist/web/server/chunk-PQVTLG3E.js +270 -0
- package/dist/web/server/{chunk-YU6RHHK6.js → chunk-Q4ECIATK.js} +65 -53
- package/dist/web/server/{chunk-IN2ATSEG.js → chunk-R4BS3KYI.js} +2 -4
- package/dist/web/server/chunk-RX2ZJARF.js +73 -0
- package/dist/web/server/{chunk-AKSDWYJY.js → chunk-SYS5FDNA.js} +5 -5
- package/dist/web/server/chunk-TOJA3X5N.js +421 -0
- package/dist/web/server/chunk-TQ2RECTH.js +193 -0
- package/dist/web/server/{chunk-KHHXJZK7.js → chunk-TTNONWZZ.js} +16001 -14668
- package/dist/web/server/chunk-TXZDDJCT.js +5115 -0
- package/dist/web/server/{chunk-XA7EOCHM.js → chunk-UDUG3MYZ.js} +2 -2
- package/dist/web/server/{chunk-EBC7QORX.js → chunk-V2GCVTDP.js} +5056 -12556
- package/dist/web/server/{chunk-TMQ3MT3D.js → chunk-VDEUVEWL.js} +2255 -1
- package/dist/web/server/chunk-VM3U6PUU.js +769 -0
- package/dist/web/server/connectors-C0xm91Ss-DJVBGD73.js +22 -0
- package/dist/web/server/connectors-page-B6tJNZ6c-R5K4NSAT.js +66 -0
- package/dist/web/server/{create-project-dialog-0-arQpsX-ZELQKHS5.js → create-project-dialog-PFPHHWIV-GH7JR5IK.js} +27 -18
- package/dist/web/server/{dist-7G2NZPF4.js → dist-GQUZLXN5.js} +2 -2
- package/dist/web/server/{dist-E5637ZAY.js → dist-MN5NWCX6.js} +1 -1
- package/dist/web/server/{fork-picker-dialog-fj9p33Mq-I5SA3GLJ.js → fork-picker-dialog-DFpKOdAw-JPLJSYYU.js} +7 -12
- package/dist/web/server/{markdown-CShfYRVO-RBTK7TRB.js → markdown-Cc8V9dOF-JTNTJKQU.js} +7 -5
- package/dist/web/server/{markdown-code-BDV_2b2T-6JYA5FWZ.js → markdown-code-gaRnbgNM-V5LIRYCD.js} +46 -8
- package/dist/web/server/{message-queue-BBC843IU-GY4ZIMM4.js → message-queue-nQ2_kU82-KKSLYR4S.js} +7 -16
- package/dist/web/server/{model-selector-list-DE6aLNXt-LJZMCYOI.js → model-selector-list-By_G7_Hr-GXT27BZO.js} +12 -16
- package/dist/web/server/{openui-renderer-C3aqSKuS-PWLWJFYO.js → openui-renderer-B9D8-Av--LFZP4U5V.js} +20 -15
- package/dist/web/server/{prompt-suggestions-CpTK_fHV-UKJDTLVM.js → prompt-suggestions-B67Uy5Rk-5SMTSIFQ.js} +5 -4
- package/dist/web/server/{rehype-katex-IDPYWU6M.js → rehype-katex-CYHGKI6Q.js} +490 -843
- package/dist/web/server/{repl-panel-1kSS1UGd-U64BPA7X.js → repl-panel-1kSS1UGd-POXRYDDJ.js} +2 -3
- package/dist/web/server/{resources-panel-DWb0eGKa-K4EM3H7Y.js → resources-panel-CTzOOKPz-5G6RS2D6.js} +18 -12
- package/dist/web/server/router-CnBux_Ld-YTVBMJFL.js +23 -0
- package/dist/web/server/routes-BUGzvQoO-WW43X7W2.js +124 -0
- package/dist/web/server/server.js +3 -3
- package/dist/web/server/session-activity-panel-f0d3fCm7-I6L5IKFQ.js +181 -0
- package/dist/web/server/{session-insights-panel-CfMX2NRu-6HWZTTAC.js → session-insights-panel-BiVObm_6-AP4FITT7.js} +2 -12
- package/dist/web/server/session-reasoning-panel-QIt_xjP0-FKJWMNHO.js +70 -0
- package/dist/web/server/session-tool-renderer-Cg_ZPHxS-BNQKNJNZ.js +34 -0
- package/dist/web/server/{session-tree-panel-HNl6R9VZ-4JUF34M7.js → session-tree-panel-B--el8O5-NZOZJM5L.js} +18 -13
- package/dist/web/server/{settings-dialog-DGZBA5Z_-6HYFMPNZ.js → settings-dialog-D_eJN2ia-W47Y474K.js} +104 -795
- package/dist/web/server/{subagent-chat-panel-DuB4hqUk-LDCAJOCL.js → subagent-chat-panel-C9nWP21E-D5C2TTYD.js} +22 -17
- package/dist/web/server/{subagents-panel-wAvx3-Rs-L6UTDFUX.js → subagents-panel-fAKvBNRG-O7QHXNE2.js} +26 -22
- package/dist/web/server/{workspace-panel-CPzJZwgv-YS7PTI5C.js → workspace-panel-CZMNMU63-SYOSM3B7.js} +23 -17
- package/package.json +2 -2
- package/dist/web/client/assets/DialogTitle-D-zqaHvF.js +0 -1
- package/dist/web/client/assets/FloatingPortal-73ZRZeD9.js +0 -1
- package/dist/web/client/assets/action-swap-BcFwS6is.js +0 -1
- package/dist/web/client/assets/alert-dialog-DtXvVhsF.js +0 -1
- package/dist/web/client/assets/artifacts-panel-Bseg97yQ.js +0 -1
- package/dist/web/client/assets/badge-C--lf3bb.js +0 -57
- package/dist/web/client/assets/button-BJZe4vNJ.js +0 -1
- package/dist/web/client/assets/chat-command-palette-D_rm1r9d.js +0 -1
- package/dist/web/client/assets/chevron-up-CqeJYyZO.js +0 -1
- package/dist/web/client/assets/collapsible-DauSnbYp.js +0 -1
- package/dist/web/client/assets/create-project-dialog-m-9aoobN.js +0 -1
- package/dist/web/client/assets/createBaseUIEventDetails-DklXWq23.js +0 -1
- package/dist/web/client/assets/dialog-Ddouieuu.js +0 -1
- package/dist/web/client/assets/eye-Cs0lNChA.js +0 -1
- package/dist/web/client/assets/globals-C961mr-b.css +0 -2
- package/dist/web/client/assets/index-Bz5W4EOn.js +0 -13
- package/dist/web/client/assets/input-Def1xOZz.js +0 -1
- package/dist/web/client/assets/markdown-Big27m-v.js +0 -2
- package/dist/web/client/assets/markdown-code-7L4RiS50.js +0 -3
- package/dist/web/client/assets/message-queue-Bg2MiJHM.js +0 -1
- package/dist/web/client/assets/mutation-DOi2Qgfa.js +0 -1
- package/dist/web/client/assets/notify-DhtmUPfE.js +0 -1
- package/dist/web/client/assets/openui-renderer-MIB3JKYa.js +0 -291
- package/dist/web/client/assets/provider-label-B_vy60P0.js +0 -1
- package/dist/web/client/assets/rehype-katex-A4PtQgTX.js +0 -259
- package/dist/web/client/assets/right-panel-context-DHKWoetk.js +0 -1
- package/dist/web/client/assets/right-panel-registry-hKJN__3l.js +0 -2
- package/dist/web/client/assets/routes-C3h32Lj_.js +0 -16
- package/dist/web/client/assets/select-Buvv1tIo.js +0 -1
- package/dist/web/client/assets/session-reasoning-panel-DmEbXOrR.js +0 -1
- package/dist/web/client/assets/session-tool-renderer-Daol5fJw.js +0 -169
- package/dist/web/client/assets/settings-dialog-DYbx3xuq.js +0 -2
- package/dist/web/client/assets/sparkles-D_ANe-HY.js +0 -1
- package/dist/web/client/assets/subagent-transcript-Bx-rHni-.js +0 -1
- package/dist/web/client/assets/surfaces-B8xTOFeK.js +0 -1
- package/dist/web/client/assets/switch-CDfAwEvs.js +0 -1
- package/dist/web/client/assets/terminal-Ceucj7us.js +0 -1
- package/dist/web/client/assets/toast-9zXN-yVk.js +0 -1
- package/dist/web/client/assets/tool-part-normalizer-NbPs9kd1.js +0 -4
- package/dist/web/client/assets/tool-result-BccnO34D.js +0 -4
- package/dist/web/client/assets/tool-timeline-DlBZyd4j.js +0 -1
- package/dist/web/client/assets/types-D5hZ8IyV.js +0 -1
- package/dist/web/client/assets/ui-preferences-1YaENqef.js +0 -1
- package/dist/web/client/assets/use-hover-capable-MwFjBLZQ.js +0 -1
- package/dist/web/client/assets/workspace-path-nav-BRwuLsFl.js +0 -2
- package/dist/web/client/assets/wrench-BYnD147U.js +0 -1
- package/dist/web/server/_tanstack-start-manifest_v-YlngJGUa-YTWBGR7L.js +0 -93
- package/dist/web/server/chunk-2PAW6K4Q.js +0 -56
- package/dist/web/server/chunk-CHSKEU3V.js +0 -166
- package/dist/web/server/chunk-FB3UHLLN.js +0 -49
- package/dist/web/server/chunk-GLH2GWMG.js +0 -2182
- package/dist/web/server/chunk-OXEAXEWD.js +0 -13
- package/dist/web/server/chunk-SIJVVYQT.js +0 -234
- package/dist/web/server/chunk-UQV2NU63.js +0 -163
- package/dist/web/server/chunk-ZUZPJNLY.js +0 -25217
- package/dist/web/server/router-DZYr-9uT-AEXHEFXF.js +0 -31
- package/dist/web/server/routes-vYxWRhis-AAZ73SNP.js +0 -120
- package/dist/web/server/session-reasoning-panel-XXU2yIOW-XXCKHISS.js +0 -192
- package/dist/web/server/session-tool-renderer-Dtt74Mts-7YYNSWRV.js +0 -29
- package/dist/web/server/tool-timeline-BKWsrZHK-3LGCOTPH.js +0 -12
|
@@ -0,0 +1,1007 @@
|
|
|
1
|
+
import {
|
|
2
|
+
COMPOSITE_KEYS,
|
|
3
|
+
FOCUSABLE_POPUP_PROPS,
|
|
4
|
+
InternalBackdrop,
|
|
5
|
+
PopupHandleAttachment,
|
|
6
|
+
createDefaultInitialFocus,
|
|
7
|
+
createPopupOpenState,
|
|
8
|
+
useBaseUiId,
|
|
9
|
+
useImplicitActiveTrigger,
|
|
10
|
+
useOpenMethodTriggerProps,
|
|
11
|
+
useOpenStateTransitions,
|
|
12
|
+
usePopupInteractionProps,
|
|
13
|
+
usePopupRootStore,
|
|
14
|
+
usePopupRootSync,
|
|
15
|
+
useScrollLock,
|
|
16
|
+
useTriggerDataForwarding
|
|
17
|
+
} from "./chunk-TXZDDJCT.js";
|
|
18
|
+
import {
|
|
19
|
+
AnimationFrame,
|
|
20
|
+
CLICK_TRIGGER_IDENTIFIER,
|
|
21
|
+
CommonPopupDataAttributes_exports,
|
|
22
|
+
FloatingFocusManager,
|
|
23
|
+
FloatingPortal,
|
|
24
|
+
FloatingRootStore,
|
|
25
|
+
PopupTriggerMap,
|
|
26
|
+
ReactStore,
|
|
27
|
+
contains,
|
|
28
|
+
createChangeEventDetails,
|
|
29
|
+
fastComponentRef,
|
|
30
|
+
getTarget,
|
|
31
|
+
inertValue,
|
|
32
|
+
popupStateMapping,
|
|
33
|
+
popupTransitionStateMapping,
|
|
34
|
+
reason_parts_exports,
|
|
35
|
+
transitionStatusMapping,
|
|
36
|
+
triggerOpenStateMapping,
|
|
37
|
+
useClick,
|
|
38
|
+
useDismiss,
|
|
39
|
+
useOpenChangeComplete
|
|
40
|
+
} from "./chunk-APOS34PW.js";
|
|
41
|
+
import {
|
|
42
|
+
EMPTY_OBJECT,
|
|
43
|
+
NOOP,
|
|
44
|
+
formatErrorMessage_default,
|
|
45
|
+
useButton,
|
|
46
|
+
useIsoLayoutEffect,
|
|
47
|
+
useRenderElement
|
|
48
|
+
} from "./chunk-FSQWWR2M.js";
|
|
49
|
+
|
|
50
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
|
|
51
|
+
import * as React2 from "react";
|
|
52
|
+
|
|
53
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/DialogRootContext.mjs
|
|
54
|
+
import * as React from "react";
|
|
55
|
+
var DialogRootContext = /* @__PURE__ */ React.createContext(void 0);
|
|
56
|
+
if (process.env.NODE_ENV !== "production") DialogRootContext.displayName = "DialogRootContext";
|
|
57
|
+
function useDialogRootContext(optional) {
|
|
58
|
+
const store = React.useContext(DialogRootContext);
|
|
59
|
+
if (!optional && store === void 0) {
|
|
60
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: DialogRootContext is missing. Dialog parts must be placed within <Dialog.Root>." : formatErrorMessage_default(27));
|
|
61
|
+
}
|
|
62
|
+
return store;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/backdrop/DialogBackdrop.mjs
|
|
66
|
+
var DialogBackdrop = /* @__PURE__ */ React2.forwardRef(function DialogBackdrop2(componentProps, forwardedRef) {
|
|
67
|
+
const {
|
|
68
|
+
render,
|
|
69
|
+
className,
|
|
70
|
+
style,
|
|
71
|
+
forceRender = false,
|
|
72
|
+
...elementProps
|
|
73
|
+
} = componentProps;
|
|
74
|
+
const store = useDialogRootContext();
|
|
75
|
+
const open2 = store.useState("open");
|
|
76
|
+
const nested = store.useState("nested");
|
|
77
|
+
const mounted = store.useState("mounted");
|
|
78
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
79
|
+
const state = {
|
|
80
|
+
open: open2,
|
|
81
|
+
transitionStatus
|
|
82
|
+
};
|
|
83
|
+
return useRenderElement("div", componentProps, {
|
|
84
|
+
state,
|
|
85
|
+
ref: [store.context.backdropRef, forwardedRef],
|
|
86
|
+
stateAttributesMapping: popupTransitionStateMapping,
|
|
87
|
+
props: [{
|
|
88
|
+
role: "presentation",
|
|
89
|
+
hidden: !mounted,
|
|
90
|
+
style: {
|
|
91
|
+
userSelect: "none",
|
|
92
|
+
WebkitUserSelect: "none"
|
|
93
|
+
}
|
|
94
|
+
}, elementProps],
|
|
95
|
+
enabled: forceRender || !nested
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
if (process.env.NODE_ENV !== "production") DialogBackdrop.displayName = "DialogBackdrop";
|
|
99
|
+
|
|
100
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/close/DialogClose.mjs
|
|
101
|
+
import * as React3 from "react";
|
|
102
|
+
var DialogClose = /* @__PURE__ */ React3.forwardRef(function DialogClose2(componentProps, forwardedRef) {
|
|
103
|
+
const {
|
|
104
|
+
render,
|
|
105
|
+
className,
|
|
106
|
+
style,
|
|
107
|
+
disabled = false,
|
|
108
|
+
nativeButton = true,
|
|
109
|
+
...elementProps
|
|
110
|
+
} = componentProps;
|
|
111
|
+
const store = useDialogRootContext();
|
|
112
|
+
const open2 = store.useState("open");
|
|
113
|
+
const {
|
|
114
|
+
getButtonProps,
|
|
115
|
+
buttonRef
|
|
116
|
+
} = useButton({
|
|
117
|
+
disabled,
|
|
118
|
+
native: nativeButton
|
|
119
|
+
});
|
|
120
|
+
const state = {
|
|
121
|
+
disabled
|
|
122
|
+
};
|
|
123
|
+
function handleClick(event) {
|
|
124
|
+
if (open2) {
|
|
125
|
+
store.setOpen(false, createChangeEventDetails(reason_parts_exports.closePress, event.nativeEvent));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
return useRenderElement("button", componentProps, {
|
|
129
|
+
state,
|
|
130
|
+
ref: [forwardedRef, buttonRef],
|
|
131
|
+
props: [{
|
|
132
|
+
onClick: handleClick
|
|
133
|
+
}, elementProps, getButtonProps]
|
|
134
|
+
});
|
|
135
|
+
});
|
|
136
|
+
if (process.env.NODE_ENV !== "production") DialogClose.displayName = "DialogClose";
|
|
137
|
+
|
|
138
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/description/DialogDescription.mjs
|
|
139
|
+
import * as React4 from "react";
|
|
140
|
+
var DialogDescription = /* @__PURE__ */ React4.forwardRef(function DialogDescription2(componentProps, forwardedRef) {
|
|
141
|
+
const {
|
|
142
|
+
render,
|
|
143
|
+
className,
|
|
144
|
+
style,
|
|
145
|
+
id: idProp,
|
|
146
|
+
...elementProps
|
|
147
|
+
} = componentProps;
|
|
148
|
+
const store = useDialogRootContext();
|
|
149
|
+
const id = useBaseUiId(idProp);
|
|
150
|
+
store.useSyncedValueWithCleanup("descriptionElementId", id);
|
|
151
|
+
return useRenderElement("p", componentProps, {
|
|
152
|
+
ref: forwardedRef,
|
|
153
|
+
props: [{
|
|
154
|
+
id
|
|
155
|
+
}, elementProps]
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
if (process.env.NODE_ENV !== "production") DialogDescription.displayName = "DialogDescription";
|
|
159
|
+
|
|
160
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
|
|
161
|
+
import * as React7 from "react";
|
|
162
|
+
|
|
163
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/popupHandle.mjs
|
|
164
|
+
var BasePopupHandle = class {
|
|
165
|
+
/**
|
|
166
|
+
* Stores of every root currently using this handle, in attach order. A handle is meant to be used
|
|
167
|
+
* by a single mounted root, but roots can transiently overlap (e.g. during an animated route
|
|
168
|
+
* transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of
|
|
169
|
+
* leaving a still-mounted root uncontrollable when a newer overlapping root detaches first.
|
|
170
|
+
*/
|
|
171
|
+
attachedStores = [];
|
|
172
|
+
/**
|
|
173
|
+
* Store of the root that currently controls the handle: the most recently attached one still
|
|
174
|
+
* mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`.
|
|
175
|
+
*/
|
|
176
|
+
attachedStoreValue = null;
|
|
177
|
+
/**
|
|
178
|
+
* Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer.
|
|
179
|
+
*/
|
|
180
|
+
storeListeners = /* @__PURE__ */ new Set();
|
|
181
|
+
/**
|
|
182
|
+
* Creates a handle backed by the store used while no root is attached.
|
|
183
|
+
*
|
|
184
|
+
* @param fallbackStore Inert, closed store handed to detached triggers while no root is attached,
|
|
185
|
+
* so they can render and register without a mounted root. Triggers register into whichever store
|
|
186
|
+
* `store` currently resolves to, so while detached they live in this store's trigger map and
|
|
187
|
+
* migrate themselves to the root's store (and back) as it attaches/detaches.
|
|
188
|
+
* @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces
|
|
189
|
+
* `MenuHandle.open()` in warning text.
|
|
190
|
+
* @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is
|
|
191
|
+
* registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to,
|
|
192
|
+
* so they throw; Dialog is not anchored and instead opens unassociated with a dev warning.
|
|
193
|
+
*/
|
|
194
|
+
constructor(fallbackStore, componentName, throwOnMissingTrigger = true) {
|
|
195
|
+
this.fallbackStore = fallbackStore;
|
|
196
|
+
this.componentName = componentName;
|
|
197
|
+
this.throwOnMissingTrigger = throwOnMissingTrigger;
|
|
198
|
+
}
|
|
199
|
+
get attachedStore() {
|
|
200
|
+
return this.attachedStoreValue;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Store that detached triggers read from: the attached root's store, or an inert fallback store
|
|
204
|
+
* used while no root is attached.
|
|
205
|
+
* @internal
|
|
206
|
+
*/
|
|
207
|
+
get store() {
|
|
208
|
+
return this.attachedStoreValue ?? this.fallbackStore;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on
|
|
212
|
+
* the handle during render because a handle can be shared by concurrent server-rendered requests.
|
|
213
|
+
* @internal
|
|
214
|
+
*/
|
|
215
|
+
get serverStore() {
|
|
216
|
+
return this.fallbackStore;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind
|
|
220
|
+
* when a root attaches or detaches. Returns a function that removes the listener.
|
|
221
|
+
* @internal
|
|
222
|
+
*/
|
|
223
|
+
subscribeStore(listener) {
|
|
224
|
+
this.storeListeners.add(listener);
|
|
225
|
+
return () => {
|
|
226
|
+
this.storeListeners.delete(listener);
|
|
227
|
+
};
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Points the handle at a root's store and notifies subscribers so detached triggers re-render and
|
|
231
|
+
* re-register into it (their registration effect migrates them when the store pointer changes).
|
|
232
|
+
* Returns a cleanup function that detaches the store again.
|
|
233
|
+
* @internal
|
|
234
|
+
*/
|
|
235
|
+
attachStore(newStore) {
|
|
236
|
+
this.attachedStores.push(newStore);
|
|
237
|
+
this.setActiveStore(newStore);
|
|
238
|
+
if (process.env.NODE_ENV !== "production") {
|
|
239
|
+
if (this.attachedStores.length > 1) {
|
|
240
|
+
const dev = this;
|
|
241
|
+
(dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => {
|
|
242
|
+
if (this.attachedStores.length > 1) {
|
|
243
|
+
console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle.");
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return () => {
|
|
249
|
+
const index = this.attachedStores.lastIndexOf(newStore);
|
|
250
|
+
if (index !== -1) {
|
|
251
|
+
this.attachedStores.splice(index, 1);
|
|
252
|
+
}
|
|
253
|
+
this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null);
|
|
254
|
+
};
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Sets the store that currently controls the handle and notifies subscribers when it changes, so
|
|
258
|
+
* detached triggers re-render and migrate their registration to the new store.
|
|
259
|
+
*/
|
|
260
|
+
setActiveStore(store) {
|
|
261
|
+
if (this.attachedStoreValue !== store) {
|
|
262
|
+
this.attachedStoreValue = store;
|
|
263
|
+
this.storeListeners.forEach((listener) => {
|
|
264
|
+
listener();
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Opens the attached root's store and associates it with the trigger with the given id, or a
|
|
270
|
+
* no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public
|
|
271
|
+
* `open()` method, which only narrows the parameter type.
|
|
272
|
+
*
|
|
273
|
+
* When a trigger id is given but no matching trigger is registered, anchored popups throw (see
|
|
274
|
+
* `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead.
|
|
275
|
+
*
|
|
276
|
+
* This method should only be called in an event handler or an effect (not during rendering).
|
|
277
|
+
*
|
|
278
|
+
* @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open
|
|
279
|
+
* without associating any trigger.
|
|
280
|
+
*/
|
|
281
|
+
openByTrigger(triggerId) {
|
|
282
|
+
const attachedStore = this.attachedStore;
|
|
283
|
+
if (attachedStore === null) {
|
|
284
|
+
if (process.env.NODE_ENV !== "production") {
|
|
285
|
+
console.warn(`Base UI: ${this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`);
|
|
286
|
+
}
|
|
287
|
+
return;
|
|
288
|
+
}
|
|
289
|
+
let triggerElement;
|
|
290
|
+
if (triggerId) {
|
|
291
|
+
for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) {
|
|
292
|
+
triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId);
|
|
293
|
+
}
|
|
294
|
+
triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId);
|
|
295
|
+
}
|
|
296
|
+
if (triggerId && !triggerElement) {
|
|
297
|
+
if (this.throwOnMissingTrigger) {
|
|
298
|
+
throw new Error(process.env.NODE_ENV !== "production" ? `Base UI: ${this.componentName}Handle.open() was called with the trigger id "${triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted ${this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName));
|
|
299
|
+
}
|
|
300
|
+
if (process.env.NODE_ENV !== "production") {
|
|
301
|
+
console.warn(`Base UI: ${this.componentName}Handle.open: No trigger found with id "${triggerId}". The popup will open, but the trigger will not be associated with it.`);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement));
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning)
|
|
308
|
+
* while no root is attached. Shared by every concrete handle's public `close()` method.
|
|
309
|
+
*
|
|
310
|
+
* This method should only be called in an event handler or an effect (not during rendering).
|
|
311
|
+
*/
|
|
312
|
+
closePopup() {
|
|
313
|
+
const attachedStore = this.attachedStore;
|
|
314
|
+
if (attachedStore === null) {
|
|
315
|
+
if (process.env.NODE_ENV !== "production") {
|
|
316
|
+
console.warn(`Base UI: ${this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`);
|
|
317
|
+
}
|
|
318
|
+
return;
|
|
319
|
+
}
|
|
320
|
+
attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction));
|
|
321
|
+
}
|
|
322
|
+
};
|
|
323
|
+
|
|
324
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/store.mjs
|
|
325
|
+
function createInitialPopupStoreState(triggerElements, floatingId, nested = false) {
|
|
326
|
+
return {
|
|
327
|
+
open: false,
|
|
328
|
+
openProp: void 0,
|
|
329
|
+
mounted: false,
|
|
330
|
+
transitionStatus: void 0,
|
|
331
|
+
floatingRootContext: new FloatingRootStore({
|
|
332
|
+
open: false,
|
|
333
|
+
transitionStatus: void 0,
|
|
334
|
+
floatingElement: null,
|
|
335
|
+
referenceElement: null,
|
|
336
|
+
triggerElements,
|
|
337
|
+
floatingId,
|
|
338
|
+
syncOnly: true,
|
|
339
|
+
nested,
|
|
340
|
+
onOpenChange: void 0
|
|
341
|
+
}),
|
|
342
|
+
floatingId,
|
|
343
|
+
triggerCount: 0,
|
|
344
|
+
preventUnmountingOnClose: false,
|
|
345
|
+
payload: void 0,
|
|
346
|
+
activeTriggerId: null,
|
|
347
|
+
activeTriggerElement: null,
|
|
348
|
+
triggerIdProp: void 0,
|
|
349
|
+
popupElement: null,
|
|
350
|
+
positionerElement: null,
|
|
351
|
+
activeTriggerProps: EMPTY_OBJECT,
|
|
352
|
+
inactiveTriggerProps: EMPTY_OBJECT,
|
|
353
|
+
popupProps: EMPTY_OBJECT
|
|
354
|
+
};
|
|
355
|
+
}
|
|
356
|
+
var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId;
|
|
357
|
+
var openSelector = (state) => state.openProp ?? state.open;
|
|
358
|
+
var popupIdSelector = (state) => {
|
|
359
|
+
const popupId = state.popupElement?.id ?? state.floatingId;
|
|
360
|
+
return popupId || void 0;
|
|
361
|
+
};
|
|
362
|
+
function triggerOwnsOpenPopup(state, triggerId) {
|
|
363
|
+
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId;
|
|
364
|
+
}
|
|
365
|
+
function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) {
|
|
366
|
+
if (triggerOwnsOpenPopup(state, triggerId)) {
|
|
367
|
+
return true;
|
|
368
|
+
}
|
|
369
|
+
return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1;
|
|
370
|
+
}
|
|
371
|
+
var popupStoreSelectors = {
|
|
372
|
+
open: openSelector,
|
|
373
|
+
mounted: (state) => state.mounted,
|
|
374
|
+
transitionStatus: (state) => state.transitionStatus,
|
|
375
|
+
floatingRootContext: (state) => state.floatingRootContext,
|
|
376
|
+
triggerCount: (state) => state.triggerCount,
|
|
377
|
+
preventUnmountingOnClose: (state) => state.preventUnmountingOnClose,
|
|
378
|
+
payload: (state) => state.payload,
|
|
379
|
+
activeTriggerId: activeTriggerIdSelector,
|
|
380
|
+
activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null,
|
|
381
|
+
popupId: popupIdSelector,
|
|
382
|
+
/**
|
|
383
|
+
* Whether the trigger with the given ID was used to open the popup.
|
|
384
|
+
*/
|
|
385
|
+
isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId,
|
|
386
|
+
/**
|
|
387
|
+
* Whether the popup is open and was activated by a trigger with the given ID.
|
|
388
|
+
*/
|
|
389
|
+
isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId),
|
|
390
|
+
/**
|
|
391
|
+
* Whether the popup is mounted and was activated by a trigger with the given ID.
|
|
392
|
+
*/
|
|
393
|
+
isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted,
|
|
394
|
+
triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps,
|
|
395
|
+
/**
|
|
396
|
+
* Popup id for the trigger that currently owns the open popup.
|
|
397
|
+
*/
|
|
398
|
+
triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0,
|
|
399
|
+
popupProps: (state) => state.popupProps,
|
|
400
|
+
popupElement: (state) => state.popupElement,
|
|
401
|
+
positionerElement: (state) => state.positionerElement
|
|
402
|
+
};
|
|
403
|
+
|
|
404
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs
|
|
405
|
+
import * as React5 from "react";
|
|
406
|
+
import { useSyncExternalStore } from "use-sync-external-store/shim";
|
|
407
|
+
function usePopupHandleStore(handle) {
|
|
408
|
+
const subscribe = React5.useCallback((listener) => {
|
|
409
|
+
if (handle === void 0) {
|
|
410
|
+
return NOOP;
|
|
411
|
+
}
|
|
412
|
+
return handle.subscribeStore(listener);
|
|
413
|
+
}, [handle]);
|
|
414
|
+
const getSnapshot = React5.useCallback(() => {
|
|
415
|
+
return handle === void 0 ? void 0 : handle.store;
|
|
416
|
+
}, [handle]);
|
|
417
|
+
return useSyncExternalStore(subscribe, getSnapshot, () => handle?.serverStore);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortalContext.mjs
|
|
421
|
+
import * as React6 from "react";
|
|
422
|
+
var DialogPortalContext = /* @__PURE__ */ React6.createContext(void 0);
|
|
423
|
+
if (process.env.NODE_ENV !== "production") DialogPortalContext.displayName = "DialogPortalContext";
|
|
424
|
+
function useDialogPortalContext() {
|
|
425
|
+
const value = React6.useContext(DialogPortalContext);
|
|
426
|
+
if (value === void 0) {
|
|
427
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Portal> is missing." : formatErrorMessage_default(26));
|
|
428
|
+
}
|
|
429
|
+
return value;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopupCssVars.mjs
|
|
433
|
+
var nestedDialogs = "--nested-dialogs";
|
|
434
|
+
|
|
435
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopupDataAttributes.mjs
|
|
436
|
+
var open = CommonPopupDataAttributes_exports.open;
|
|
437
|
+
var closed = CommonPopupDataAttributes_exports.closed;
|
|
438
|
+
var startingStyle = CommonPopupDataAttributes_exports.startingStyle;
|
|
439
|
+
var endingStyle = CommonPopupDataAttributes_exports.endingStyle;
|
|
440
|
+
var nestedDialogOpen = "data-nested-dialog-open";
|
|
441
|
+
|
|
442
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/utils/stateAttributesMapping.mjs
|
|
443
|
+
var dialogStateAttributesMapping = {
|
|
444
|
+
...popupStateMapping,
|
|
445
|
+
...transitionStatusMapping,
|
|
446
|
+
nestedDialogOpen(value) {
|
|
447
|
+
return value ? {
|
|
448
|
+
[nestedDialogOpen]: ""
|
|
449
|
+
} : null;
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
|
|
453
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/popup/DialogPopup.mjs
|
|
454
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
455
|
+
var DialogPopup = /* @__PURE__ */ React7.forwardRef(function DialogPopup2(componentProps, forwardedRef) {
|
|
456
|
+
const {
|
|
457
|
+
render,
|
|
458
|
+
className,
|
|
459
|
+
style,
|
|
460
|
+
finalFocus,
|
|
461
|
+
initialFocus,
|
|
462
|
+
...elementProps
|
|
463
|
+
} = componentProps;
|
|
464
|
+
const store = useDialogRootContext();
|
|
465
|
+
const descriptionElementId = store.useState("descriptionElementId");
|
|
466
|
+
const disablePointerDismissal = store.useState("disablePointerDismissal");
|
|
467
|
+
const floatingRootContext = store.useState("floatingRootContext");
|
|
468
|
+
const rootPopupProps = store.useState("popupProps");
|
|
469
|
+
const modal = store.useState("modal");
|
|
470
|
+
const mounted = store.useState("mounted");
|
|
471
|
+
const nested = store.useState("nested");
|
|
472
|
+
const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
|
|
473
|
+
const open2 = store.useState("open");
|
|
474
|
+
const openMethod = store.useState("openMethod");
|
|
475
|
+
const titleElementId = store.useState("titleElementId");
|
|
476
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
477
|
+
const role = store.useState("role");
|
|
478
|
+
const floatingId = floatingRootContext.useState("floatingId");
|
|
479
|
+
useDialogPortalContext();
|
|
480
|
+
useOpenChangeComplete({
|
|
481
|
+
open: open2,
|
|
482
|
+
ref: store.context.popupRef,
|
|
483
|
+
onComplete() {
|
|
484
|
+
if (open2) {
|
|
485
|
+
store.context.onOpenChangeComplete?.(true);
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
const resolvedInitialFocus = initialFocus === void 0 ? createDefaultInitialFocus(store.context.popupRef) : initialFocus;
|
|
490
|
+
const nestedDialogOpen2 = nestedOpenDialogCount > 0;
|
|
491
|
+
const setPopupElement = store.useStateSetter("popupElement");
|
|
492
|
+
const state = {
|
|
493
|
+
open: open2,
|
|
494
|
+
nested,
|
|
495
|
+
transitionStatus,
|
|
496
|
+
nestedDialogOpen: nestedDialogOpen2
|
|
497
|
+
};
|
|
498
|
+
const element = useRenderElement("div", componentProps, {
|
|
499
|
+
state,
|
|
500
|
+
props: [rootPopupProps, {
|
|
501
|
+
id: floatingId,
|
|
502
|
+
"aria-labelledby": titleElementId,
|
|
503
|
+
"aria-describedby": descriptionElementId,
|
|
504
|
+
role,
|
|
505
|
+
...FOCUSABLE_POPUP_PROPS,
|
|
506
|
+
hidden: !mounted,
|
|
507
|
+
onKeyDown(event) {
|
|
508
|
+
if (COMPOSITE_KEYS.has(event.key)) {
|
|
509
|
+
event.stopPropagation();
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
style: {
|
|
513
|
+
[nestedDialogs]: nestedOpenDialogCount
|
|
514
|
+
}
|
|
515
|
+
}, elementProps],
|
|
516
|
+
ref: [forwardedRef, store.context.popupRef, setPopupElement],
|
|
517
|
+
stateAttributesMapping: dialogStateAttributesMapping
|
|
518
|
+
});
|
|
519
|
+
return /* @__PURE__ */ _jsx(FloatingFocusManager, {
|
|
520
|
+
context: floatingRootContext,
|
|
521
|
+
openInteractionType: openMethod,
|
|
522
|
+
disabled: !mounted,
|
|
523
|
+
closeOnFocusOut: !disablePointerDismissal,
|
|
524
|
+
initialFocus: resolvedInitialFocus,
|
|
525
|
+
returnFocus: finalFocus,
|
|
526
|
+
modal: modal !== false,
|
|
527
|
+
restoreFocus: "popup",
|
|
528
|
+
children: element
|
|
529
|
+
});
|
|
530
|
+
});
|
|
531
|
+
if (process.env.NODE_ENV !== "production") DialogPopup.displayName = "DialogPopup";
|
|
532
|
+
|
|
533
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/portal/DialogPortal.mjs
|
|
534
|
+
import * as React8 from "react";
|
|
535
|
+
import { jsx as _jsx2, jsxs as _jsxs } from "react/jsx-runtime";
|
|
536
|
+
var DialogPortal = /* @__PURE__ */ React8.forwardRef(function DialogPortal2(props, forwardedRef) {
|
|
537
|
+
const {
|
|
538
|
+
keepMounted = false,
|
|
539
|
+
...portalProps
|
|
540
|
+
} = props;
|
|
541
|
+
const store = useDialogRootContext();
|
|
542
|
+
const mounted = store.useState("mounted");
|
|
543
|
+
const modal = store.useState("modal");
|
|
544
|
+
const open2 = store.useState("open");
|
|
545
|
+
const shouldRender = mounted || keepMounted;
|
|
546
|
+
if (!shouldRender) {
|
|
547
|
+
return null;
|
|
548
|
+
}
|
|
549
|
+
return /* @__PURE__ */ _jsx2(DialogPortalContext.Provider, {
|
|
550
|
+
value: keepMounted,
|
|
551
|
+
children: /* @__PURE__ */ _jsxs(FloatingPortal, {
|
|
552
|
+
ref: forwardedRef,
|
|
553
|
+
...portalProps,
|
|
554
|
+
children: [mounted && modal === true && /* @__PURE__ */ _jsx2(InternalBackdrop, {
|
|
555
|
+
ref: store.context.internalBackdropRef,
|
|
556
|
+
inert: inertValue(!open2)
|
|
557
|
+
}), props.children]
|
|
558
|
+
})
|
|
559
|
+
});
|
|
560
|
+
});
|
|
561
|
+
if (process.env.NODE_ENV !== "production") DialogPortal.displayName = "DialogPortal";
|
|
562
|
+
|
|
563
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/title/DialogTitle.mjs
|
|
564
|
+
import * as React9 from "react";
|
|
565
|
+
var DialogTitle = /* @__PURE__ */ React9.forwardRef(function DialogTitle2(componentProps, forwardedRef) {
|
|
566
|
+
const {
|
|
567
|
+
render,
|
|
568
|
+
className,
|
|
569
|
+
style,
|
|
570
|
+
id: idProp,
|
|
571
|
+
...elementProps
|
|
572
|
+
} = componentProps;
|
|
573
|
+
const store = useDialogRootContext();
|
|
574
|
+
const id = useBaseUiId(idProp);
|
|
575
|
+
store.useSyncedValueWithCleanup("titleElementId", id);
|
|
576
|
+
return useRenderElement("h2", componentProps, {
|
|
577
|
+
ref: forwardedRef,
|
|
578
|
+
props: [{
|
|
579
|
+
id
|
|
580
|
+
}, elementProps]
|
|
581
|
+
});
|
|
582
|
+
});
|
|
583
|
+
if (process.env.NODE_ENV !== "production") DialogTitle.displayName = "DialogTitle";
|
|
584
|
+
|
|
585
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/viewport/DialogViewport.mjs
|
|
586
|
+
import * as React10 from "react";
|
|
587
|
+
var DialogViewport = /* @__PURE__ */ React10.forwardRef(function DialogViewport2(componentProps, forwardedRef) {
|
|
588
|
+
const {
|
|
589
|
+
render,
|
|
590
|
+
className,
|
|
591
|
+
style,
|
|
592
|
+
children,
|
|
593
|
+
...elementProps
|
|
594
|
+
} = componentProps;
|
|
595
|
+
const keepMounted = useDialogPortalContext();
|
|
596
|
+
const store = useDialogRootContext();
|
|
597
|
+
const open2 = store.useState("open");
|
|
598
|
+
const nested = store.useState("nested");
|
|
599
|
+
const transitionStatus = store.useState("transitionStatus");
|
|
600
|
+
const nestedOpenDialogCount = store.useState("nestedOpenDialogCount");
|
|
601
|
+
const mounted = store.useState("mounted");
|
|
602
|
+
const setViewportElement = store.useStateSetter("viewportElement");
|
|
603
|
+
const nestedDialogOpen2 = nestedOpenDialogCount > 0;
|
|
604
|
+
const state = {
|
|
605
|
+
open: open2,
|
|
606
|
+
nested,
|
|
607
|
+
transitionStatus,
|
|
608
|
+
nestedDialogOpen: nestedDialogOpen2
|
|
609
|
+
};
|
|
610
|
+
const shouldRender = keepMounted || mounted;
|
|
611
|
+
return useRenderElement("div", componentProps, {
|
|
612
|
+
enabled: shouldRender,
|
|
613
|
+
state,
|
|
614
|
+
ref: [forwardedRef, setViewportElement],
|
|
615
|
+
stateAttributesMapping: dialogStateAttributesMapping,
|
|
616
|
+
props: [{
|
|
617
|
+
role: "presentation",
|
|
618
|
+
hidden: !mounted,
|
|
619
|
+
style: {
|
|
620
|
+
pointerEvents: !open2 ? "none" : void 0
|
|
621
|
+
},
|
|
622
|
+
children
|
|
623
|
+
}, elementProps]
|
|
624
|
+
});
|
|
625
|
+
});
|
|
626
|
+
if (process.env.NODE_ENV !== "production") DialogViewport.displayName = "DialogViewport";
|
|
627
|
+
|
|
628
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs
|
|
629
|
+
import * as React13 from "react";
|
|
630
|
+
|
|
631
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useDialogRoot.mjs
|
|
632
|
+
import * as React11 from "react";
|
|
633
|
+
function DialogInteractions({
|
|
634
|
+
store,
|
|
635
|
+
parentContext,
|
|
636
|
+
isDrawer
|
|
637
|
+
}) {
|
|
638
|
+
const open2 = store.useState("open");
|
|
639
|
+
const disablePointerDismissal = store.useState("disablePointerDismissal");
|
|
640
|
+
const modal = store.useState("modal");
|
|
641
|
+
const popupElement = store.useState("popupElement");
|
|
642
|
+
const floatingRootContext = store.useState("floatingRootContext");
|
|
643
|
+
const [ownNestedOpenDialogs, setOwnNestedOpenDialogs] = React11.useState(0);
|
|
644
|
+
const [ownNestedOpenDrawers, setOwnNestedOpenDrawers] = React11.useState(0);
|
|
645
|
+
const isTopmost = ownNestedOpenDialogs === 0;
|
|
646
|
+
const dismiss = useDismiss(floatingRootContext, {
|
|
647
|
+
outsidePressEvent() {
|
|
648
|
+
if (store.context.internalBackdropRef.current || store.context.backdropRef.current) {
|
|
649
|
+
return "intentional";
|
|
650
|
+
}
|
|
651
|
+
return {
|
|
652
|
+
mouse: modal === "trap-focus" ? "sloppy" : "intentional",
|
|
653
|
+
touch: "sloppy"
|
|
654
|
+
};
|
|
655
|
+
},
|
|
656
|
+
outsidePress(event) {
|
|
657
|
+
if (!store.context.outsidePressEnabledRef.current) {
|
|
658
|
+
return false;
|
|
659
|
+
}
|
|
660
|
+
if ("button" in event && event.button !== 0) {
|
|
661
|
+
return false;
|
|
662
|
+
}
|
|
663
|
+
if ("touches" in event) {
|
|
664
|
+
if (event.type === "touchend") {
|
|
665
|
+
if (event.changedTouches.length !== 1 || event.touches.length !== 0) {
|
|
666
|
+
return false;
|
|
667
|
+
}
|
|
668
|
+
} else if (event.touches.length !== 1) {
|
|
669
|
+
return false;
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
const target = getTarget(event);
|
|
673
|
+
if (isTopmost && !disablePointerDismissal) {
|
|
674
|
+
if (modal) {
|
|
675
|
+
const internalBackdrop = store.context.internalBackdropRef.current;
|
|
676
|
+
const backdrop = store.context.backdropRef.current;
|
|
677
|
+
return internalBackdrop || backdrop ? internalBackdrop === target || backdrop === target || contains(target, popupElement) && !target?.hasAttribute("data-base-ui-portal") : true;
|
|
678
|
+
}
|
|
679
|
+
return true;
|
|
680
|
+
}
|
|
681
|
+
return false;
|
|
682
|
+
},
|
|
683
|
+
escapeKey: isTopmost
|
|
684
|
+
});
|
|
685
|
+
useScrollLock(open2 && modal === true, popupElement);
|
|
686
|
+
store.useContextCallback("onNestedDialogOpen", (dialogCount, drawerCount) => {
|
|
687
|
+
setOwnNestedOpenDialogs(dialogCount);
|
|
688
|
+
setOwnNestedOpenDrawers(drawerCount);
|
|
689
|
+
});
|
|
690
|
+
useIsoLayoutEffect(() => {
|
|
691
|
+
if (parentContext?.onNestedDialogOpen) {
|
|
692
|
+
if (open2) {
|
|
693
|
+
parentContext.onNestedDialogOpen(ownNestedOpenDialogs + 1, ownNestedOpenDrawers + (isDrawer ? 1 : 0));
|
|
694
|
+
} else {
|
|
695
|
+
parentContext.onNestedDialogOpen(0, 0);
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
return () => {
|
|
699
|
+
if (parentContext?.onNestedDialogOpen && open2) {
|
|
700
|
+
parentContext.onNestedDialogOpen(0, 0);
|
|
701
|
+
}
|
|
702
|
+
};
|
|
703
|
+
}, [isDrawer, open2, ownNestedOpenDialogs, ownNestedOpenDrawers, parentContext]);
|
|
704
|
+
usePopupInteractionProps(store, {
|
|
705
|
+
// `enabled` is not passed to `useDismiss`, so its props are always defined,
|
|
706
|
+
// and `trigger` is the same object as `reference`.
|
|
707
|
+
activeTriggerProps: dismiss.reference,
|
|
708
|
+
inactiveTriggerProps: dismiss.trigger,
|
|
709
|
+
// DialogPopup and DrawerPopup spread `FOCUSABLE_POPUP_PROPS` directly, so
|
|
710
|
+
// this only needs to carry the dismiss handlers.
|
|
711
|
+
popupProps: dismiss.floating,
|
|
712
|
+
nestedOpenDialogCount: ownNestedOpenDialogs,
|
|
713
|
+
nestedOpenDrawerCount: ownNestedOpenDrawers
|
|
714
|
+
});
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogStore.mjs
|
|
719
|
+
import * as React12 from "react";
|
|
720
|
+
|
|
721
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/utils/NullStore.mjs
|
|
722
|
+
var NullStore = class extends ReactStore {
|
|
723
|
+
// `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding
|
|
724
|
+
// `setState` alone would neutralize them today. They are overridden explicitly so the store stays
|
|
725
|
+
// inert even if a future base-class change stops routing a mutator through `setState`.
|
|
726
|
+
setState(_newState) {
|
|
727
|
+
}
|
|
728
|
+
update(_changes) {
|
|
729
|
+
}
|
|
730
|
+
set(_key, _value) {
|
|
731
|
+
}
|
|
732
|
+
notifyAll() {
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
|
|
736
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogStore.mjs
|
|
737
|
+
var selectors = {
|
|
738
|
+
...popupStoreSelectors,
|
|
739
|
+
modal: (state) => state.modal,
|
|
740
|
+
nested: (state) => state.nested,
|
|
741
|
+
nestedOpenDialogCount: (state) => state.nestedOpenDialogCount,
|
|
742
|
+
nestedOpenDrawerCount: (state) => state.nestedOpenDrawerCount,
|
|
743
|
+
disablePointerDismissal: (state) => state.disablePointerDismissal,
|
|
744
|
+
openMethod: (state) => state.openMethod,
|
|
745
|
+
descriptionElementId: (state) => state.descriptionElementId,
|
|
746
|
+
titleElementId: (state) => state.titleElementId,
|
|
747
|
+
viewportElement: (state) => state.viewportElement,
|
|
748
|
+
role: (state) => state.role
|
|
749
|
+
};
|
|
750
|
+
var DialogStore = class extends ReactStore {
|
|
751
|
+
constructor(initialState, floatingId, nested) {
|
|
752
|
+
const triggerElements = new PopupTriggerMap();
|
|
753
|
+
const state = createInitialState(initialState, triggerElements, floatingId, nested);
|
|
754
|
+
super(state, createInitialContext(triggerElements), selectors);
|
|
755
|
+
}
|
|
756
|
+
setOpen = (nextOpen, eventDetails) => {
|
|
757
|
+
eventDetails.preventUnmountOnClose = () => {
|
|
758
|
+
this.set("preventUnmountingOnClose", true);
|
|
759
|
+
};
|
|
760
|
+
if (!nextOpen && eventDetails.trigger == null && this.state.activeTriggerId != null) {
|
|
761
|
+
eventDetails.trigger = this.state.activeTriggerElement ?? void 0;
|
|
762
|
+
}
|
|
763
|
+
this.context.onOpenChange?.(nextOpen, eventDetails);
|
|
764
|
+
if (eventDetails.isCanceled) {
|
|
765
|
+
return;
|
|
766
|
+
}
|
|
767
|
+
this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails);
|
|
768
|
+
this.update(createPopupOpenState(this.state, nextOpen, eventDetails.trigger));
|
|
769
|
+
};
|
|
770
|
+
};
|
|
771
|
+
function createNullDialogStore() {
|
|
772
|
+
const triggerElements = new PopupTriggerMap();
|
|
773
|
+
return new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors);
|
|
774
|
+
}
|
|
775
|
+
function createInitialState(initialState, triggerElements, floatingId, nested = false) {
|
|
776
|
+
const state = {
|
|
777
|
+
...createInitialPopupStoreState(triggerElements, floatingId, nested),
|
|
778
|
+
modal: true,
|
|
779
|
+
disablePointerDismissal: false,
|
|
780
|
+
viewportElement: null,
|
|
781
|
+
descriptionElementId: void 0,
|
|
782
|
+
titleElementId: void 0,
|
|
783
|
+
openMethod: null,
|
|
784
|
+
nested: false,
|
|
785
|
+
nestedOpenDialogCount: 0,
|
|
786
|
+
nestedOpenDrawerCount: 0,
|
|
787
|
+
role: "dialog",
|
|
788
|
+
...initialState
|
|
789
|
+
};
|
|
790
|
+
return state;
|
|
791
|
+
}
|
|
792
|
+
function createInitialContext(triggerElements) {
|
|
793
|
+
return {
|
|
794
|
+
popupRef: /* @__PURE__ */ React12.createRef(),
|
|
795
|
+
backdropRef: /* @__PURE__ */ React12.createRef(),
|
|
796
|
+
internalBackdropRef: /* @__PURE__ */ React12.createRef(),
|
|
797
|
+
outsidePressEnabledRef: {
|
|
798
|
+
current: true
|
|
799
|
+
},
|
|
800
|
+
triggerElements,
|
|
801
|
+
onOpenChange: void 0,
|
|
802
|
+
onOpenChangeComplete: void 0
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/root/useRenderDialogRoot.mjs
|
|
807
|
+
import { jsx as _jsx3, jsxs as _jsxs2 } from "react/jsx-runtime";
|
|
808
|
+
function useRenderDialogRoot(mode, props) {
|
|
809
|
+
const {
|
|
810
|
+
children,
|
|
811
|
+
open: openProp,
|
|
812
|
+
defaultOpen = false,
|
|
813
|
+
onOpenChange,
|
|
814
|
+
onOpenChangeComplete,
|
|
815
|
+
disablePointerDismissal: disablePointerDismissalProp = false,
|
|
816
|
+
modal: modalProp = true,
|
|
817
|
+
actionsRef,
|
|
818
|
+
handle,
|
|
819
|
+
triggerId: triggerIdProp,
|
|
820
|
+
defaultTriggerId: defaultTriggerIdProp = null
|
|
821
|
+
} = props;
|
|
822
|
+
const isDrawer = mode === "drawer";
|
|
823
|
+
const isAlertDialog = mode === "alert-dialog";
|
|
824
|
+
const modal = isAlertDialog ? true : modalProp;
|
|
825
|
+
const disablePointerDismissal = isAlertDialog || disablePointerDismissalProp;
|
|
826
|
+
const role = isAlertDialog ? "alertdialog" : "dialog";
|
|
827
|
+
const parentStore = useDialogRootContext(true);
|
|
828
|
+
const nested = parentStore != null;
|
|
829
|
+
const rootState = {
|
|
830
|
+
modal,
|
|
831
|
+
disablePointerDismissal,
|
|
832
|
+
nested,
|
|
833
|
+
role
|
|
834
|
+
};
|
|
835
|
+
const store = usePopupRootStore((floatingId, floatingNested) => new DialogStore({
|
|
836
|
+
open: defaultOpen,
|
|
837
|
+
openProp,
|
|
838
|
+
activeTriggerId: defaultTriggerIdProp,
|
|
839
|
+
triggerIdProp,
|
|
840
|
+
...rootState
|
|
841
|
+
}, floatingId, floatingNested), true);
|
|
842
|
+
store.useControlledProp("openProp", openProp);
|
|
843
|
+
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
844
|
+
store.useSyncedValues(rootState);
|
|
845
|
+
store.useContextCallback("onOpenChange", onOpenChange);
|
|
846
|
+
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
847
|
+
const open2 = store.useState("open");
|
|
848
|
+
const mounted = store.useState("mounted");
|
|
849
|
+
const payload = store.useState("payload");
|
|
850
|
+
usePopupRootSync(store, open2);
|
|
851
|
+
useImplicitActiveTrigger(store);
|
|
852
|
+
const {
|
|
853
|
+
forceUnmount
|
|
854
|
+
} = useOpenStateTransitions(open2, store);
|
|
855
|
+
React13.useImperativeHandle(actionsRef, () => ({
|
|
856
|
+
unmount: forceUnmount,
|
|
857
|
+
close: () => store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction))
|
|
858
|
+
}), [forceUnmount, store]);
|
|
859
|
+
const shouldRenderInteractions = open2 || mounted;
|
|
860
|
+
return /* @__PURE__ */ _jsxs2(DialogRootContext.Provider, {
|
|
861
|
+
value: store,
|
|
862
|
+
children: [handle && /* @__PURE__ */ _jsx3(PopupHandleAttachment, {
|
|
863
|
+
handle,
|
|
864
|
+
store
|
|
865
|
+
}), shouldRenderInteractions && /* @__PURE__ */ _jsx3(DialogInteractions, {
|
|
866
|
+
store,
|
|
867
|
+
parentContext: parentStore?.context,
|
|
868
|
+
isDrawer
|
|
869
|
+
}), typeof children === "function" ? children({
|
|
870
|
+
payload
|
|
871
|
+
}) : children]
|
|
872
|
+
});
|
|
873
|
+
}
|
|
874
|
+
|
|
875
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/trigger/DialogTrigger.mjs
|
|
876
|
+
import * as React14 from "react";
|
|
877
|
+
var DialogTrigger = fastComponentRef(function DialogTrigger2(componentProps, forwardedRef) {
|
|
878
|
+
const {
|
|
879
|
+
render,
|
|
880
|
+
className,
|
|
881
|
+
style,
|
|
882
|
+
disabled = false,
|
|
883
|
+
nativeButton = true,
|
|
884
|
+
id: idProp,
|
|
885
|
+
payload,
|
|
886
|
+
handle,
|
|
887
|
+
...elementProps
|
|
888
|
+
} = componentProps;
|
|
889
|
+
const dialogRootStore = useDialogRootContext(true);
|
|
890
|
+
const handleStore = usePopupHandleStore(handle);
|
|
891
|
+
const store = handleStore ?? dialogRootStore;
|
|
892
|
+
if (!store) {
|
|
893
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: <Dialog.Trigger> must be used within <Dialog.Root> or provided with a handle." : formatErrorMessage_default(79));
|
|
894
|
+
}
|
|
895
|
+
const thisTriggerId = useBaseUiId(idProp);
|
|
896
|
+
const floatingContext = store.useState("floatingRootContext");
|
|
897
|
+
const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId);
|
|
898
|
+
const popupId = store.useState("triggerPopupId", thisTriggerId);
|
|
899
|
+
const triggerElementRef = React14.useRef(null);
|
|
900
|
+
const {
|
|
901
|
+
registerTrigger,
|
|
902
|
+
isMountedByThisTrigger
|
|
903
|
+
} = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, {
|
|
904
|
+
payload
|
|
905
|
+
});
|
|
906
|
+
const {
|
|
907
|
+
getButtonProps,
|
|
908
|
+
buttonRef
|
|
909
|
+
} = useButton({
|
|
910
|
+
disabled,
|
|
911
|
+
native: nativeButton
|
|
912
|
+
});
|
|
913
|
+
const click = useClick(floatingContext);
|
|
914
|
+
const interactionTypeProps = useOpenMethodTriggerProps(() => store.select("open"), (interactionType) => {
|
|
915
|
+
store.set("openMethod", interactionType);
|
|
916
|
+
});
|
|
917
|
+
const state = {
|
|
918
|
+
disabled,
|
|
919
|
+
open: isOpenedByThisTrigger
|
|
920
|
+
};
|
|
921
|
+
const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger);
|
|
922
|
+
return useRenderElement("button", componentProps, {
|
|
923
|
+
state,
|
|
924
|
+
ref: [buttonRef, forwardedRef, registerTrigger, triggerElementRef],
|
|
925
|
+
props: [click.reference, rootTriggerProps, interactionTypeProps, {
|
|
926
|
+
[CLICK_TRIGGER_IDENTIFIER]: "",
|
|
927
|
+
id: thisTriggerId,
|
|
928
|
+
"aria-haspopup": "dialog",
|
|
929
|
+
"aria-expanded": isOpenedByThisTrigger,
|
|
930
|
+
"aria-controls": popupId
|
|
931
|
+
}, elementProps, getButtonProps],
|
|
932
|
+
stateAttributesMapping: triggerOpenStateMapping
|
|
933
|
+
});
|
|
934
|
+
});
|
|
935
|
+
if (process.env.NODE_ENV !== "production") DialogTrigger.displayName = "DialogTrigger";
|
|
936
|
+
|
|
937
|
+
// node_modules/.pnpm/@base-ui+react@1.8.0_@date-fns+tz@1.5.0_@types+react@19.3.0_date-fns@4.4.0_react-dom@19.3.0_react@19.3.0__react@19.3.0/node_modules/@base-ui/react/dialog/store/DialogHandle.mjs
|
|
938
|
+
var DialogHandle = class extends BasePopupHandle {
|
|
939
|
+
constructor() {
|
|
940
|
+
super(createNullDialogStore(), "Dialog", false);
|
|
941
|
+
}
|
|
942
|
+
/**
|
|
943
|
+
* Opens the dialog, optionally associating it with a trigger.
|
|
944
|
+
*
|
|
945
|
+
* This method should only be called in an event handler or an effect (not during rendering).
|
|
946
|
+
*
|
|
947
|
+
* @param triggerId ID of the trigger to associate with the dialog. The trigger must be a matching
|
|
948
|
+
* `Dialog.Trigger` with this handle passed as a prop. Pass `null` to open without associating any trigger.
|
|
949
|
+
*/
|
|
950
|
+
open(triggerId) {
|
|
951
|
+
this.openByTrigger(triggerId);
|
|
952
|
+
}
|
|
953
|
+
/**
|
|
954
|
+
* Opens the dialog with the given payload, without associating it with any trigger.
|
|
955
|
+
*
|
|
956
|
+
* This method should only be called in an event handler or an effect (not during rendering).
|
|
957
|
+
*
|
|
958
|
+
* @param payload Payload to set when opening the dialog. It is exposed to the root's render-prop children.
|
|
959
|
+
*/
|
|
960
|
+
openWithPayload(payload) {
|
|
961
|
+
const attachedStore = this.attachedStore;
|
|
962
|
+
if (attachedStore === null) {
|
|
963
|
+
if (process.env.NODE_ENV !== "production") {
|
|
964
|
+
console.warn("Base UI: DialogHandle.openWithPayload() was called while no root using this handle is mounted. The call and its payload were ignored; mount a root with this handle before opening it imperatively.");
|
|
965
|
+
}
|
|
966
|
+
return;
|
|
967
|
+
}
|
|
968
|
+
attachedStore.set("payload", payload);
|
|
969
|
+
attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction));
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Closes the dialog.
|
|
973
|
+
*
|
|
974
|
+
* This method should only be called in an event handler or an effect (not during rendering).
|
|
975
|
+
*/
|
|
976
|
+
close() {
|
|
977
|
+
this.closePopup();
|
|
978
|
+
}
|
|
979
|
+
/**
|
|
980
|
+
* Whether the dialog is currently open. Returns `false` while no root is attached to the handle.
|
|
981
|
+
*/
|
|
982
|
+
get isOpen() {
|
|
983
|
+
return this.attachedStore?.select("open") ?? false;
|
|
984
|
+
}
|
|
985
|
+
};
|
|
986
|
+
function createDialogHandle() {
|
|
987
|
+
return new DialogHandle();
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
export {
|
|
991
|
+
BasePopupHandle,
|
|
992
|
+
createInitialPopupStoreState,
|
|
993
|
+
popupStoreSelectors,
|
|
994
|
+
usePopupHandleStore,
|
|
995
|
+
NullStore,
|
|
996
|
+
useRenderDialogRoot,
|
|
997
|
+
DialogBackdrop,
|
|
998
|
+
DialogClose,
|
|
999
|
+
DialogDescription,
|
|
1000
|
+
DialogPopup,
|
|
1001
|
+
DialogPortal,
|
|
1002
|
+
DialogTitle,
|
|
1003
|
+
DialogTrigger,
|
|
1004
|
+
DialogViewport,
|
|
1005
|
+
DialogHandle,
|
|
1006
|
+
createDialogHandle
|
|
1007
|
+
};
|