@arbidocs/blocks 0.5.131 → 0.5.133
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/dist/{ConnectedCallDock-GJ4LO7I3.cjs → ConnectedCallDock-ZNS5BS2R.cjs} +28 -28
- package/dist/{ConnectedCallDock-GJ4LO7I3.cjs.map → ConnectedCallDock-ZNS5BS2R.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-SL3GMHO7.cjs → ConnectedCallRoom-ACNVSFH7.cjs} +20 -20
- package/dist/{ConnectedCallRoom-SL3GMHO7.cjs.map → ConnectedCallRoom-ACNVSFH7.cjs.map} +1 -1
- package/dist/ConnectedMailInviteCard-AJI7JZYJ.cjs +22 -0
- package/dist/{ConnectedMailInviteCard-EINB3THA.cjs.map → ConnectedMailInviteCard-AJI7JZYJ.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-OY4RTJKA.cjs → ConnectedNativeDocxComparison-H72RQJKH.cjs} +26 -26
- package/dist/{ConnectedNativeDocxComparison-OY4RTJKA.cjs.map → ConnectedNativeDocxComparison-H72RQJKH.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-5W26JTH6.cjs → ConnectedPresentation-3JXN6SRT.cjs} +24 -24
- package/dist/{ConnectedPresentation-5W26JTH6.cjs.map → ConnectedPresentation-3JXN6SRT.cjs.map} +1 -1
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs → ConnectedProductionSetDialog-EOWZQ6J3.cjs} +9 -9
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs.map → ConnectedProductionSetDialog-EOWZQ6J3.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-YS2XRWUC.cjs → ConnectedSlidesTab-IECS2MJI.cjs} +21 -21
- package/dist/{ConnectedSlidesTab-YS2XRWUC.cjs.map → ConnectedSlidesTab-IECS2MJI.cjs.map} +1 -1
- package/dist/{ConnectedStreamedWordArtifact-6Y24NJON.cjs → ConnectedStreamedWordArtifact-T7PZIRBY.cjs} +26 -26
- package/dist/{ConnectedStreamedWordArtifact-6Y24NJON.cjs.map → ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-DIUHU76E.cjs → DocumentReviewCard-EM2AJUF3.cjs} +24 -24
- package/dist/{DocumentReviewCard-DIUHU76E.cjs.map → DocumentReviewCard-EM2AJUF3.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-H6ZXLUO3.cjs → FilesViewerDialog-OA3HDLOI.cjs} +62 -62
- package/dist/{FilesViewerDialog-H6ZXLUO3.cjs.map → FilesViewerDialog-OA3HDLOI.cjs.map} +1 -1
- package/dist/{NativeDocxEditor-2PTEK6ND.cjs → NativeDocxEditor-XZAEU5QU.cjs} +8 -8
- package/dist/{NativeDocxEditor-2PTEK6ND.cjs.map → NativeDocxEditor-XZAEU5QU.cjs.map} +1 -1
- package/dist/{WorkspaceTableView-44555T3K.cjs → WorkspaceTableView-HMQ6PXUC.cjs} +11 -11
- package/dist/{WorkspaceTableView-44555T3K.cjs.map → WorkspaceTableView-HMQ6PXUC.cjs.map} +1 -1
- package/dist/agents/index.cjs +208 -208
- package/dist/{ai-V4X2E6Y4.cjs → ai-QEXZ4SYR.cjs} +30 -30
- package/dist/ai-QEXZ4SYR.cjs.map +1 -0
- package/dist/calls/index.cjs +148 -148
- package/dist/chat/index.cjs +30 -30
- package/dist/{chunk-PSIKUQYM.cjs → chunk-2FA7UVLG.cjs} +12 -12
- package/dist/{chunk-PSIKUQYM.cjs.map → chunk-2FA7UVLG.cjs.map} +1 -1
- package/dist/{chunk-ZYGAXD3N.cjs → chunk-2SWS7ESM.cjs} +3 -3
- package/dist/{chunk-ZYGAXD3N.cjs.map → chunk-2SWS7ESM.cjs.map} +1 -1
- package/dist/{chunk-YZ6YOOTF.cjs → chunk-32W2S6DE.cjs} +4 -4
- package/dist/{chunk-YZ6YOOTF.cjs.map → chunk-32W2S6DE.cjs.map} +1 -1
- package/dist/{chunk-IZBAWZTB.cjs → chunk-3RAW2ZH5.cjs} +8 -8
- package/dist/{chunk-IZBAWZTB.cjs.map → chunk-3RAW2ZH5.cjs.map} +1 -1
- package/dist/{chunk-MXBXZXXQ.cjs → chunk-3Y75LUCT.cjs} +4 -4
- package/dist/{chunk-MXBXZXXQ.cjs.map → chunk-3Y75LUCT.cjs.map} +1 -1
- package/dist/{chunk-PL7HUTM3.cjs → chunk-57LUHZLV.cjs} +8 -8
- package/dist/{chunk-PL7HUTM3.cjs.map → chunk-57LUHZLV.cjs.map} +1 -1
- package/dist/{chunk-ZEQE4I46.cjs → chunk-5GHGIDZP.cjs} +15 -15
- package/dist/{chunk-ZEQE4I46.cjs.map → chunk-5GHGIDZP.cjs.map} +1 -1
- package/dist/{chunk-Z4O324CO.cjs → chunk-5JK3232B.cjs} +20 -20
- package/dist/{chunk-Z4O324CO.cjs.map → chunk-5JK3232B.cjs.map} +1 -1
- package/dist/{chunk-Q6IKXWPG.cjs → chunk-64247UHS.cjs} +4 -4
- package/dist/{chunk-Q6IKXWPG.cjs.map → chunk-64247UHS.cjs.map} +1 -1
- package/dist/{chunk-PD23GDT7.cjs → chunk-6CGMSJLB.cjs} +5 -5
- package/dist/{chunk-PD23GDT7.cjs.map → chunk-6CGMSJLB.cjs.map} +1 -1
- package/dist/{chunk-VRK3IQAP.cjs → chunk-6RC6GYIW.cjs} +4 -4
- package/dist/{chunk-VRK3IQAP.cjs.map → chunk-6RC6GYIW.cjs.map} +1 -1
- package/dist/{chunk-VJCSEMXT.cjs → chunk-6THN5ZGA.cjs} +4 -4
- package/dist/{chunk-VJCSEMXT.cjs.map → chunk-6THN5ZGA.cjs.map} +1 -1
- package/dist/{chunk-ZESMRGDV.cjs → chunk-7NJKDJVO.cjs} +6 -6
- package/dist/{chunk-ZESMRGDV.cjs.map → chunk-7NJKDJVO.cjs.map} +1 -1
- package/dist/{chunk-SBWIA4PL.cjs → chunk-AGL7Z6Y2.cjs} +21 -21
- package/dist/{chunk-SBWIA4PL.cjs.map → chunk-AGL7Z6Y2.cjs.map} +1 -1
- package/dist/{chunk-BAA44UEC.cjs → chunk-BN33PC5F.cjs} +88 -88
- package/dist/{chunk-BAA44UEC.cjs.map → chunk-BN33PC5F.cjs.map} +1 -1
- package/dist/{chunk-XKCIDXMP.cjs → chunk-C5APAFUY.cjs} +229 -169
- package/dist/chunk-C5APAFUY.cjs.map +1 -0
- package/dist/{chunk-H7PHOTX2.cjs → chunk-C6RJQQLG.cjs} +10 -10
- package/dist/{chunk-H7PHOTX2.cjs.map → chunk-C6RJQQLG.cjs.map} +1 -1
- package/dist/{chunk-HQDR43JC.cjs → chunk-CENMN32L.cjs} +6 -6
- package/dist/{chunk-HQDR43JC.cjs.map → chunk-CENMN32L.cjs.map} +1 -1
- package/dist/{chunk-ULWRNGGE.cjs → chunk-CVPV4I7Z.cjs} +4 -3
- package/dist/chunk-CVPV4I7Z.cjs.map +1 -0
- package/dist/{chunk-QECKDZ47.cjs → chunk-CYN66TBO.cjs} +3 -3
- package/dist/chunk-CYN66TBO.cjs.map +1 -0
- package/dist/{chunk-B3BZ6MNI.cjs → chunk-DGAGSP5G.cjs} +6 -6
- package/dist/{chunk-B3BZ6MNI.cjs.map → chunk-DGAGSP5G.cjs.map} +1 -1
- package/dist/{chunk-Q6DQGGP4.cjs → chunk-ECSOXKJQ.cjs} +6 -6
- package/dist/{chunk-Q6DQGGP4.cjs.map → chunk-ECSOXKJQ.cjs.map} +1 -1
- package/dist/{chunk-GNZAH6UI.cjs → chunk-ETMSINQS.cjs} +6 -6
- package/dist/{chunk-GNZAH6UI.cjs.map → chunk-ETMSINQS.cjs.map} +1 -1
- package/dist/{chunk-2W5E62EY.cjs → chunk-EYXU32D7.cjs} +6 -6
- package/dist/{chunk-2W5E62EY.cjs.map → chunk-EYXU32D7.cjs.map} +1 -1
- package/dist/{chunk-UZHWXKS6.cjs → chunk-F6F375V7.cjs} +7 -7
- package/dist/{chunk-UZHWXKS6.cjs.map → chunk-F6F375V7.cjs.map} +1 -1
- package/dist/{chunk-JQLWKNJO.cjs → chunk-FYFL3CET.cjs} +26 -26
- package/dist/{chunk-JQLWKNJO.cjs.map → chunk-FYFL3CET.cjs.map} +1 -1
- package/dist/{chunk-NZN7SK4W.cjs → chunk-IFJBE7M5.cjs} +11 -11
- package/dist/{chunk-NZN7SK4W.cjs.map → chunk-IFJBE7M5.cjs.map} +1 -1
- package/dist/{chunk-SHPETTGW.cjs → chunk-IN3KXI3K.cjs} +6 -6
- package/dist/{chunk-SHPETTGW.cjs.map → chunk-IN3KXI3K.cjs.map} +1 -1
- package/dist/{chunk-RYVZDFVO.cjs → chunk-JJZOL5MG.cjs} +3 -3
- package/dist/{chunk-RYVZDFVO.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/{chunk-4RBQ44RY.cjs → chunk-JYZ6UE5X.cjs} +28 -28
- package/dist/{chunk-4RBQ44RY.cjs.map → chunk-JYZ6UE5X.cjs.map} +1 -1
- package/dist/{chunk-QMIHLJMH.cjs → chunk-JZQ47OW5.cjs} +6 -6
- package/dist/{chunk-QMIHLJMH.cjs.map → chunk-JZQ47OW5.cjs.map} +1 -1
- package/dist/{chunk-VWTOIGX4.cjs → chunk-K3ZZ6IH3.cjs} +4 -4
- package/dist/{chunk-VWTOIGX4.cjs.map → chunk-K3ZZ6IH3.cjs.map} +1 -1
- package/dist/chunk-KWD5Q4XH.cjs +18 -0
- package/dist/{chunk-KAR326FU.cjs.map → chunk-KWD5Q4XH.cjs.map} +1 -1
- package/dist/{chunk-ESVRVZ53.cjs → chunk-L4Y6UMRC.cjs} +5 -5
- package/dist/{chunk-ESVRVZ53.cjs.map → chunk-L4Y6UMRC.cjs.map} +1 -1
- package/dist/{chunk-UXBFXF26.cjs → chunk-LFMOQALU.cjs} +76 -76
- package/dist/{chunk-UXBFXF26.cjs.map → chunk-LFMOQALU.cjs.map} +1 -1
- package/dist/{chunk-TKHCIHE2.cjs → chunk-LIKDQBNJ.cjs} +7 -7
- package/dist/{chunk-TKHCIHE2.cjs.map → chunk-LIKDQBNJ.cjs.map} +1 -1
- package/dist/{chunk-734NPQNR.cjs → chunk-LLD4PNBW.cjs} +4 -4
- package/dist/{chunk-734NPQNR.cjs.map → chunk-LLD4PNBW.cjs.map} +1 -1
- package/dist/{chunk-A2YUBDCO.cjs → chunk-MEYQLQWS.cjs} +13 -13
- package/dist/{chunk-A2YUBDCO.cjs.map → chunk-MEYQLQWS.cjs.map} +1 -1
- package/dist/{chunk-H4ID6S4P.cjs → chunk-MSJGEZHL.cjs} +6 -6
- package/dist/{chunk-H4ID6S4P.cjs.map → chunk-MSJGEZHL.cjs.map} +1 -1
- package/dist/{chunk-ORELHENJ.cjs → chunk-NZNBJF3M.cjs} +12 -2
- package/dist/chunk-NZNBJF3M.cjs.map +1 -0
- package/dist/{chunk-P5AQYC4D.cjs → chunk-OA3AN6WW.cjs} +4 -4
- package/dist/{chunk-P5AQYC4D.cjs.map → chunk-OA3AN6WW.cjs.map} +1 -1
- package/dist/{chunk-A6GBPE5E.cjs → chunk-OOHBXCDV.cjs} +5 -5
- package/dist/{chunk-A6GBPE5E.cjs.map → chunk-OOHBXCDV.cjs.map} +1 -1
- package/dist/{chunk-R7IA2F2G.cjs → chunk-OOW7H2YD.cjs} +14 -14
- package/dist/{chunk-R7IA2F2G.cjs.map → chunk-OOW7H2YD.cjs.map} +1 -1
- package/dist/{chunk-JV5TVUOU.cjs → chunk-OUGRCQM7.cjs} +4 -4
- package/dist/{chunk-JV5TVUOU.cjs.map → chunk-OUGRCQM7.cjs.map} +1 -1
- package/dist/{chunk-JH6JTI76.cjs → chunk-OUYBYZ7Y.cjs} +6 -6
- package/dist/{chunk-JH6JTI76.cjs.map → chunk-OUYBYZ7Y.cjs.map} +1 -1
- package/dist/{chunk-TXP2N3DC.cjs → chunk-P7VUIW24.cjs} +6 -6
- package/dist/{chunk-TXP2N3DC.cjs.map → chunk-P7VUIW24.cjs.map} +1 -1
- package/dist/{chunk-TW4RV3QK.cjs → chunk-R5NTEW4L.cjs} +33 -33
- package/dist/{chunk-TW4RV3QK.cjs.map → chunk-R5NTEW4L.cjs.map} +1 -1
- package/dist/{chunk-6NT377PS.cjs → chunk-RSQGDXAF.cjs} +9 -9
- package/dist/{chunk-6NT377PS.cjs.map → chunk-RSQGDXAF.cjs.map} +1 -1
- package/dist/{chunk-AFG7YCCJ.cjs → chunk-RZSBHRQL.cjs} +73 -73
- package/dist/{chunk-AFG7YCCJ.cjs.map → chunk-RZSBHRQL.cjs.map} +1 -1
- package/dist/{chunk-YVCOQHCE.cjs → chunk-S5OGPQSB.cjs} +5 -5
- package/dist/{chunk-YVCOQHCE.cjs.map → chunk-S5OGPQSB.cjs.map} +1 -1
- package/dist/{chunk-ULPTSXXO.cjs → chunk-SD7GUB44.cjs} +4 -4
- package/dist/{chunk-ULPTSXXO.cjs.map → chunk-SD7GUB44.cjs.map} +1 -1
- package/dist/{chunk-CNLIXB6S.cjs → chunk-SK6LFIU2.cjs} +11 -11
- package/dist/{chunk-CNLIXB6S.cjs.map → chunk-SK6LFIU2.cjs.map} +1 -1
- package/dist/{chunk-23I5EUZA.cjs → chunk-T2DUNNYY.cjs} +4 -4
- package/dist/{chunk-23I5EUZA.cjs.map → chunk-T2DUNNYY.cjs.map} +1 -1
- package/dist/{chunk-E3Y7RI3J.cjs → chunk-T6WA6S5T.cjs} +4 -4
- package/dist/{chunk-E3Y7RI3J.cjs.map → chunk-T6WA6S5T.cjs.map} +1 -1
- package/dist/{chunk-KUVGR5KE.cjs → chunk-TENWM7BH.cjs} +10 -13
- package/dist/chunk-TENWM7BH.cjs.map +1 -0
- package/dist/{chunk-SZCDYKS4.cjs → chunk-TOYKBRAU.cjs} +15 -15
- package/dist/{chunk-SZCDYKS4.cjs.map → chunk-TOYKBRAU.cjs.map} +1 -1
- package/dist/{chunk-GKMUXI4V.cjs → chunk-TXBXIUTX.cjs} +8 -8
- package/dist/{chunk-GKMUXI4V.cjs.map → chunk-TXBXIUTX.cjs.map} +1 -1
- package/dist/{chunk-H5OLHP2U.cjs → chunk-U6XMZG6G.cjs} +5 -5
- package/dist/{chunk-H5OLHP2U.cjs.map → chunk-U6XMZG6G.cjs.map} +1 -1
- package/dist/{chunk-4EK7TAP7.cjs → chunk-UOI6JJPG.cjs} +5 -5
- package/dist/{chunk-4EK7TAP7.cjs.map → chunk-UOI6JJPG.cjs.map} +1 -1
- package/dist/{chunk-XX5SH4WE.cjs → chunk-UOZ237OW.cjs} +26 -26
- package/dist/{chunk-XX5SH4WE.cjs.map → chunk-UOZ237OW.cjs.map} +1 -1
- package/dist/{chunk-QYX2U7TI.cjs → chunk-UWTCK5IN.cjs} +14 -14
- package/dist/{chunk-QYX2U7TI.cjs.map → chunk-UWTCK5IN.cjs.map} +1 -1
- package/dist/{chunk-PASJI6JZ.cjs → chunk-V6SFJ44C.cjs} +104 -104
- package/dist/{chunk-PASJI6JZ.cjs.map → chunk-V6SFJ44C.cjs.map} +1 -1
- package/dist/{chunk-4NPCDS2X.cjs → chunk-VCDD763Y.cjs} +4 -4
- package/dist/{chunk-4NPCDS2X.cjs.map → chunk-VCDD763Y.cjs.map} +1 -1
- package/dist/{chunk-4VZZWYEC.cjs → chunk-VF26CUE3.cjs} +29 -29
- package/dist/{chunk-4VZZWYEC.cjs.map → chunk-VF26CUE3.cjs.map} +1 -1
- package/dist/{chunk-BVAT4EVC.cjs → chunk-VIUEPJ3Y.cjs} +42 -42
- package/dist/{chunk-BVAT4EVC.cjs.map → chunk-VIUEPJ3Y.cjs.map} +1 -1
- package/dist/{chunk-W6B3RYTX.cjs → chunk-VPKKPHJY.cjs} +4 -4
- package/dist/{chunk-W6B3RYTX.cjs.map → chunk-VPKKPHJY.cjs.map} +1 -1
- package/dist/{chunk-CMGNRMPA.cjs → chunk-WNAZM2YS.cjs} +4 -4
- package/dist/{chunk-CMGNRMPA.cjs.map → chunk-WNAZM2YS.cjs.map} +1 -1
- package/dist/{chunk-IIYG542W.cjs → chunk-X46QYO4S.cjs} +4 -4
- package/dist/{chunk-IIYG542W.cjs.map → chunk-X46QYO4S.cjs.map} +1 -1
- package/dist/{chunk-5SKHK3BG.cjs → chunk-XZMYSDU4.cjs} +4 -4
- package/dist/{chunk-5SKHK3BG.cjs.map → chunk-XZMYSDU4.cjs.map} +1 -1
- package/dist/{chunk-JR2YSBD5.cjs → chunk-YKOPKLYP.cjs} +6 -6
- package/dist/{chunk-JR2YSBD5.cjs.map → chunk-YKOPKLYP.cjs.map} +1 -1
- package/dist/{chunk-JDFBEGQO.cjs → chunk-YZBDHBKI.cjs} +7 -7
- package/dist/chunk-YZBDHBKI.cjs.map +1 -0
- package/dist/{chunk-GNX3FBBX.cjs → chunk-ZM6B5WJW.cjs} +4 -4
- package/dist/{chunk-GNX3FBBX.cjs.map → chunk-ZM6B5WJW.cjs.map} +1 -1
- package/dist/{chunk-5UYFLFNR.cjs → chunk-ZOU6K6DD.cjs} +4 -4
- package/dist/{chunk-5UYFLFNR.cjs.map → chunk-ZOU6K6DD.cjs.map} +1 -1
- package/dist/{chunk-MEZ7WSW3.cjs → chunk-ZTHYJP4G.cjs} +21 -21
- package/dist/{chunk-MEZ7WSW3.cjs.map → chunk-ZTHYJP4G.cjs.map} +1 -1
- package/dist/citations/index.cjs +10 -10
- package/dist/collaboration/index.cjs +70 -70
- package/dist/components/UsageMeter.d.ts +2 -0
- package/dist/components/UsageMeter.js +10 -0
- package/dist/components/UsageMeter.js.map +2 -2
- package/dist/connect/docx.cjs +30 -30
- package/dist/connect/index.cjs +3247 -2479
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +47 -47
- package/dist/connection/billing/AddAddonDialog.js +1 -1
- package/dist/connection/billing/AddAddonDialog.js.map +2 -2
- package/dist/connection/billing/BillingCard.d.ts +1 -1
- package/dist/connection/billing/BillingCard.js.map +1 -1
- package/dist/connection/billing/ChangePlanDialog.d.ts +1 -1
- package/dist/connection/billing/ChangePlanDialog.js +2 -5
- package/dist/connection/billing/ChangePlanDialog.js.map +2 -2
- package/dist/connection/billing/ChangeProPlan.js +2 -2
- package/dist/connection/billing/ChangeProPlan.js.map +2 -2
- package/dist/connection/billing/CollaboratorPlan.d.ts +2 -1
- package/dist/connection/billing/CollaboratorPlan.js +115 -52
- package/dist/connection/billing/CollaboratorPlan.js.map +2 -2
- package/dist/connection/billing/ConnectedSubscriptionSetup.d.ts +1 -0
- package/dist/connection/billing/ConnectedSubscriptionSetup.js +198 -0
- package/dist/connection/billing/ConnectedSubscriptionSetup.js.map +7 -0
- package/dist/connection/billing/ConnectedWelcomeDialog.d.ts +3 -13
- package/dist/connection/billing/ConnectedWelcomeDialog.js +26 -30
- package/dist/connection/billing/ConnectedWelcomeDialog.js.map +2 -2
- package/dist/connection/billing/InvoicesModal.js +2 -2
- package/dist/connection/billing/InvoicesModal.js.map +1 -1
- package/dist/connection/billing/ManualSubscriptionAdjustments.d.ts +12 -0
- package/dist/connection/billing/ManualSubscriptionAdjustments.js +424 -0
- package/dist/connection/billing/ManualSubscriptionAdjustments.js.map +7 -0
- package/dist/connection/billing/MonthlySpendCap.d.ts +3 -1
- package/dist/connection/billing/MonthlySpendCap.js +11 -7
- package/dist/connection/billing/MonthlySpendCap.js.map +2 -2
- package/dist/connection/billing/NewProjectFlow.d.ts +4 -1
- package/dist/connection/billing/NewProjectFlow.js +44 -37
- package/dist/connection/billing/NewProjectFlow.js.map +2 -2
- package/dist/connection/billing/PlanChangeLines.d.ts +1 -1
- package/dist/connection/billing/PlanChangeLines.js.map +1 -1
- package/dist/connection/billing/ProjectBilling.d.ts +3 -3
- package/dist/connection/billing/ProjectBilling.js +2 -2
- package/dist/connection/billing/ProjectBilling.js.map +2 -2
- package/dist/connection/billing/ProjectDetail.js +17 -2
- package/dist/connection/billing/ProjectDetail.js.map +2 -2
- package/dist/connection/billing/ProjectPurchaseOptions.d.ts +2 -14
- package/dist/connection/billing/ProjectPurchaseOptions.js +289 -440
- package/dist/connection/billing/ProjectPurchaseOptions.js.map +2 -2
- package/dist/connection/billing/ProjectUsageCard.js +4 -4
- package/dist/connection/billing/ProjectUsageCard.js.map +2 -2
- package/dist/connection/billing/SharedProjects.js +1 -1
- package/dist/connection/billing/SharedProjects.js.map +1 -1
- package/dist/connection/billing/StripeCheckoutModal.d.ts +2 -1
- package/dist/connection/billing/StripeCheckoutModal.js +20 -4
- package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
- package/dist/connection/billing/SubscriptionIntervalToggle.d.ts +9 -0
- package/dist/connection/billing/SubscriptionIntervalToggle.js +40 -0
- package/dist/connection/billing/SubscriptionIntervalToggle.js.map +7 -0
- package/dist/connection/billing/SubscriptionPlans.d.ts +3 -4
- package/dist/connection/billing/SubscriptionPlans.js +35 -112
- package/dist/connection/billing/SubscriptionPlans.js.map +2 -2
- package/dist/connection/billing/SubscriptionSetupDialog.d.ts +26 -0
- package/dist/connection/billing/SubscriptionSetupDialog.js +248 -0
- package/dist/connection/billing/SubscriptionSetupDialog.js.map +7 -0
- package/dist/connection/billing/addon-pricing.d.ts +2 -2
- package/dist/connection/billing/addon-pricing.js +2 -2
- package/dist/connection/billing/addon-pricing.js.map +1 -1
- package/dist/connection/billing/plan-pricing.d.ts +2 -2
- package/dist/connection/billing/plan-pricing.js +1 -1
- package/dist/connection/billing/plan-pricing.js.map +2 -2
- package/dist/connection/command/ConnectedCommandPalette.js +2 -0
- package/dist/connection/command/ConnectedCommandPalette.js.map +2 -2
- package/dist/connection/command/actions.js +1 -1
- package/dist/connection/command/actions.js.map +2 -2
- package/dist/connection/contacts/ConnectedWelcomeInvitations.js +11 -11
- package/dist/connection/contacts/ConnectedWelcomeInvitations.js.map +2 -2
- package/dist/connection/conversation/ConnectedConversationPage.js +1 -1
- package/dist/connection/conversation/ConnectedConversationPage.js.map +2 -2
- package/dist/connection/dialogs/ConnectedGlobalDialogs.js +9 -5
- package/dist/connection/dialogs/ConnectedGlobalDialogs.js.map +2 -2
- package/dist/connection/export/ConnectedExportPanel.js +1 -1
- package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
- package/dist/connection/files/page/DocumentsUploadButton.js +1 -1
- package/dist/connection/files/page/DocumentsUploadButton.js.map +2 -2
- package/dist/connection/projects/ConnectedProjectsPanel.js +17 -5
- package/dist/connection/projects/ConnectedProjectsPanel.js.map +2 -2
- package/dist/connection/runtime/usePaymentReturn.js +62 -18
- package/dist/connection/runtime/usePaymentReturn.js.map +3 -3
- package/dist/connection/sharing/WorkspaceMembersList.js.map +1 -1
- package/dist/connection/shell/ConnectedWorkspaceSwitcher.js +3 -3
- package/dist/connection/shell/ConnectedWorkspaceSwitcher.js.map +2 -2
- package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.d.ts +1 -1
- package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.js.map +1 -1
- package/dist/connection/workspace-form/ConnectedWorkspaceFormModal.js +2 -2
- package/dist/connection/workspace-form/ConnectedWorkspaceFormModal.js.map +2 -2
- package/dist/connection/workspace-list/ConnectedWorkspaceList.js +1 -1
- package/dist/connection/workspace-list/ConnectedWorkspaceList.js.map +2 -2
- package/dist/connection/workspace-list/WorkspaceCardsView.js +1 -1
- package/dist/connection/workspace-list/WorkspaceCardsView.js.map +1 -1
- package/dist/connection/workspace-list/projectBilling.d.ts +1 -1
- package/dist/connection/workspace-list/projectBilling.js.map +1 -1
- package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +3 -1
- package/dist/connection/workspace-list/useConnectedWorkspaceList.js +4 -4
- package/dist/connection/workspace-list/useConnectedWorkspaceList.js.map +2 -2
- package/dist/dashboards/index.cjs +25 -25
- package/dist/document-tools/index.cjs +26 -26
- package/dist/document-tools/viewer/SignatureRequestEditor.js +1 -1
- package/dist/document-tools/viewer/SignatureRequestEditor.js.map +2 -2
- package/dist/document-tools/viewer/index.cjs +12 -12
- package/dist/document-tools/viewer/index.cjs.map +1 -1
- package/dist/docx/index.cjs +40 -40
- package/dist/embed/index.cjs +49 -49
- package/dist/facts/index.cjs +46 -46
- package/dist/files/index.cjs +227 -227
- package/dist/home/index.cjs +34 -34
- package/dist/index.cjs +1549 -1549
- package/dist/index.cjs.map +1 -1
- package/dist/nav/actions.d.ts +2 -0
- package/dist/nav/actions.js.map +2 -2
- package/dist/provider/dialog-registry.d.ts +4 -0
- package/dist/provider/dialog-registry.js.map +2 -2
- package/dist/retrieval/index.cjs +6 -6
- package/dist/settings/Billing.d.ts +1 -1
- package/dist/settings/Billing.js.map +1 -1
- package/dist/settings/IdentityVerification.js +3 -3
- package/dist/settings/IdentityVerification.js.map +2 -2
- package/dist/settings/ModalScaffold.d.ts +3 -1
- package/dist/settings/ModalScaffold.js +2 -1
- package/dist/settings/ModalScaffold.js.map +2 -2
- package/dist/settings/PanelFrame.d.ts +3 -1
- package/dist/settings/PanelFrame.js +3 -2
- package/dist/settings/PanelFrame.js.map +2 -2
- package/dist/settings/PlanCard.d.ts +1 -1
- package/dist/settings/PlanCard.js +2 -2
- package/dist/settings/PlanCard.js.map +1 -1
- package/dist/settings/SubscriptionParts.js +1 -1
- package/dist/settings/SubscriptionParts.js.map +1 -1
- package/dist/settings/WelcomeDialog.d.ts +7 -3
- package/dist/settings/WelcomeDialog.js +194 -135
- package/dist/settings/WelcomeDialog.js.map +2 -2
- package/dist/settings/index.cjs +156 -156
- package/dist/shell/index.cjs +81 -81
- package/dist/studio/index.cjs +44 -44
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +65 -65
- package/dist/workspaces/WorkspaceGroup.d.ts +1 -1
- package/dist/workspaces/WorkspaceGroup.js.map +1 -1
- package/dist/workspaces/index.cjs +33 -33
- package/dist/workspaces/workspace-roles.d.ts +2 -2
- package/dist/workspaces/workspace-roles.js +1 -1
- package/dist/workspaces/workspace-roles.js.map +1 -1
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/src/connection/billing/project-purchase.css +362 -9
- package/dist/ConnectedMailInviteCard-EINB3THA.cjs +0 -22
- package/dist/ai-V4X2E6Y4.cjs.map +0 -1
- package/dist/chunk-JDFBEGQO.cjs.map +0 -1
- package/dist/chunk-KAR326FU.cjs +0 -18
- package/dist/chunk-KUVGR5KE.cjs.map +0 -1
- package/dist/chunk-ORELHENJ.cjs.map +0 -1
- package/dist/chunk-QECKDZ47.cjs.map +0 -1
- package/dist/chunk-ULWRNGGE.cjs.map +0 -1
- package/dist/chunk-XKCIDXMP.cjs.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkYZBDHBKI_cjs = require('./chunk-YZBDHBKI.cjs');
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var middleware = require('zustand/middleware');
|
|
7
7
|
var react = require('react');
|
|
@@ -106,10 +106,10 @@ var defaultEnvironment = {
|
|
|
106
106
|
notify: (message, kind = "info", options) => {
|
|
107
107
|
shell.notify[kind](message, options);
|
|
108
108
|
},
|
|
109
|
-
confirm:
|
|
110
|
-
choose:
|
|
111
|
-
openDialog:
|
|
112
|
-
closeDialog:
|
|
109
|
+
confirm: chunkYZBDHBKI_cjs.confirmDialog,
|
|
110
|
+
choose: chunkYZBDHBKI_cjs.choiceDialog,
|
|
111
|
+
openDialog: chunkYZBDHBKI_cjs.openDialog,
|
|
112
|
+
closeDialog: chunkYZBDHBKI_cjs.closeDialog,
|
|
113
113
|
runtimeConfig: {
|
|
114
114
|
apiBaseUrl: "",
|
|
115
115
|
deploymentDomain: typeof window !== "undefined" ? window.location.host : ""
|
|
@@ -203,5 +203,5 @@ exports.useCalendarViewStore = useCalendarViewStore;
|
|
|
203
203
|
exports.useIntentRequest = useIntentRequest;
|
|
204
204
|
exports.useRequestedSettingsSection = useRequestedSettingsSection;
|
|
205
205
|
exports.workflowOpenRequest = workflowOpenRequest;
|
|
206
|
-
//# sourceMappingURL=chunk-
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
206
|
+
//# sourceMappingURL=chunk-LIKDQBNJ.cjs.map
|
|
207
|
+
//# sourceMappingURL=chunk-LIKDQBNJ.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/settings-section.ts","../src/provider/requests.ts","../src/provider/environment.ts"],"names":["create","persist","createJSONStorage","useSyncExternalStore","listeners","useRef","useEffect","notifyStore","confirmDialog","choiceDialog","openDialog","closeDialog","useHostConfigRecord"],"mappings":";;;;;;;;AAqCO,IAAM,uBAAuBA,cAAA,EAA0B;AAAA,EAC5DC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB,CAAA;AAAA,MAChE,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc;AAAA,KACzD,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA;AACrC;AAEJ;AAEA,IAAM,MAAA,GAAS,sBAAA;AAGR,SAAS,qBAAqB,KAAA,EAAmC;AACtE,EAAA,IAAI,MAAA,CAAO,KAAK,KAAA,CAAM,EAAE,GAAG,oBAAA,CAAqB,QAAA,EAAS,CAAE,eAAA,CAAgB,KAAK,CAAA;AAClF;AAGO,SAAS,wBAAwB,OAAA,EAAwC;AAC9E,EAAA,oBAAA,CAAqB,QAAA,EAAS,CA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AAW,CAAA,GAAI,kBAAA;AAC9D;AAGO,SAAS,gBAAA,GAA0E;AACxF,EAAA,MAAM,EAAE,UAAA,EAAAF,WAAAA,EAAY,WAAA,EAAAC,YAAAA,KAAgB,oBAAA,EAAqB;AACzD,EAAA,OAAO,EAAE,UAAA,EAAAD,WAAAA,EAAY,WAAA,EAAAC,YAAAA,EAAY;AACnC","file":"chunk-TKHCIHE2.cjs","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","/**\n * What an intent asks of the surface it opens, carried across the navigation: the first message\n * of a new conversation (`openNewConversation({ prompt })`), the email draft or message to show\n * (`openMail({ draftId })`, `openMail({ messageId })`), the folder (`openMail({ folder })`), a new\n * message with files (`openMail({ attachments })`) and the workflow to show\n * (`openWorkflow(id, { view })`). The environment records the request before the host navigates;\n * the surface takes it when it mounts, or at once while it is already on screen. Taking clears it,\n * so a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from 'react'\nimport type { MailAttachment } from '@arbidocs/react'\n\nexport interface IntentRequest<T> {\n /** Record a request (replacing one not taken yet). */\n request(value: T): void\n /** The pending request, cleared: `undefined` when there is none. */\n take(): T | undefined\n /** Calls `listener` whenever a request is made. */\n subscribe(listener: () => void): () => void\n}\n\nfunction intentRequest<T>(): IntentRequest<T> {\n let pending: { value: T } | undefined\n const listeners = new Set<() => void>()\n return {\n request(value) {\n pending = { value }\n listeners.forEach((listener) => listener())\n },\n take() {\n const taken = pending\n pending = undefined\n return taken?.value\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n}\n\n/**\n * Take each request while `enabled`: the one pending on mount and every later one. The latest\n * `onRequest` is called.\n */\nexport function useIntentRequest<T>(\n store: IntentRequest<T>,\n onRequest: (value: T) => void,\n enabled = true\n): void {\n const latest = useRef(onRequest)\n latest.current = onRequest\n useEffect(() => {\n if (!enabled) return\n const take = () => {\n const value = store.take()\n if (value !== undefined) latest.current(value)\n }\n take()\n return store.subscribe(take)\n }, [store, enabled])\n}\n\n/** The first message of the new conversation `openNewConversation({ prompt })` showed. */\nexport const conversationStartRequest = intentRequest<string>()\n\n/** The email draft `openMail({ draftId })` showed. */\nexport const mailDraftRequest = intentRequest<string>()\n\n/** The message `openMail({ messageId })` showed. */\nexport const mailMessageRequest = intentRequest<string>()\n\n/** The folder `openMail({ folder })` showed (a role such as `outbox`, or an id). */\nexport const mailFolderRequest = intentRequest<string>()\n\n/** The new message `openMail({ attachments })` starts, with these files attached. */\nexport const mailComposeRequest = intentRequest<MailAttachment[]>()\n\n/**\n * The workflow `openWorkflow(id, { view })` showed: its editor, its runs, or (`run`, a host\n * catalogue entry) its run page (no id: the list).\n */\nexport const workflowOpenRequest = intentRequest<{\n workflowId?: string\n view?: 'builder' | 'runs' | 'run'\n /** No workflow: a new one's builder starts from this preset. */\n preset?: 'schedule'\n}>()\n","import { useSyncExternalStore, type ReactNode } from 'react'\nimport type { AnalyticsChartRequest, MailAttachment } from '@arbidocs/react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport {\n closeDialog,\n openDialog,\n type BlocksDialogKind,\n type DialogPropsArg,\n type ShareRequest,\n type UploadSource,\n} from './dialog-registry'\nimport {\n conversationStartRequest,\n mailDraftRequest,\n mailMessageRequest,\n mailFolderRequest,\n mailComposeRequest,\n workflowOpenRequest,\n} from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n /** Where seats are added for this deployment (a Box's licence page); none: its settings. */\n licenceUrl?: string\n /**\n * A public page where a Microsoft administrator approves SharePoint access, for the user to send\n * them (the accounts import offers the link). None: no link.\n */\n sharePointAdminUrl?: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /**\n * The viewer tab to show: `pdf` is where a signature request is reviewed and signed, and where\n * a copy the document tools made (frozen, signed) opens.\n */\n tab?: 'pdf'\n}\n\nexport type { ShareRequest, UploadSource }\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /**\n * The workflow's editor (default), its runs, or (`run`, a host catalogue entry) where it starts.\n * The Workflows page (`ConnectedWorkflowsPage`) opens the editor, the runs or the run page\n * (`ConnectedWorkflowRunPage`) itself; the host only shows the page.\n */\n view?: 'builder' | 'runs' | 'run'\n /**\n * With no workflow: a new workflow's builder starts from this preset instead of a blank one\n * (`schedule`: a repeating schedule with one task prompt to fill in).\n */\n preset?: 'schedule'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n /** A message to show in the native inbox (a secure message just claimed from its link). */\n messageId?: string\n /** Start a new message with these files attached (\"Email\" on a document). */\n attachments?: MailAttachment[]\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /**\n * A hook: the address on screen (path, then any search), re-rendering when it changes. A routed\n * shell reads its current row from it. A host with a router adapts that router's location\n * (react-router: `() => { const l = useLocation(); return l.pathname + l.search }`); keep the\n * same hook for the host's life. Default: the window's address, following Back/Forward.\n */\n useLocation: () => string\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /**\n * Open a global dialog by kind (`BlocksDialogProps`), shown by the one `<ConnectedGlobalDialogs>`\n * in the shell. Default: the blocks dialog registry.\n */\n openDialog: <K extends BlocksDialogKind>(kind: K, ...props: DialogPropsArg<K>) => void\n /** Close a global dialog. Default: the blocks dialog registry. */\n closeDialog: (kind: BlocksDialogKind) => void\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI's addresses (`/wrk-…/doc-…`): the route codec's `hrefFor`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversationThread`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Open the direct chat with a person (the host's messenger). Absent: not offered. */\n openDirectChat?: (userId: string) => void\n /** Open one of my chats (a group or meeting chat) in the host's messenger. Absent: not offered. */\n openChat?: (chatId: string) => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`), optionally on one\n * entry (`focusId`). Absent: not offered. */\n openNotifications?: (options?: { focusId?: string }) => void\n /** Show the host's contacts (a panel it toggles, a page). Absent: not offered. */\n openContacts?: () => void\n /** Show the host's databases page (user-defined tables). Absent: not offered. */\n openDatabases?: () => void\n /** Show the host's Analytics page (saved dashboards); `database`: with a new dashboard charting that\n * database (a database's \"Chart this\"). Absent: not offered. */\n openAnalytics?: (options?: { database?: AnalyticsChartRequest }) => void\n /** Show the host's tags page (people, organisations and the other tags). Absent: not offered. */\n openTags?: () => void\n /** Show the host's facts page; `compose`: with its composer open for a new fact; `focusId`: at\n * that fact. Absent: not offered. */\n openFacts?: (options?: { compose?: boolean; focusId?: string }) => void\n /** Show the open workspace's threads (the host's threads page). Absent: not offered. */\n openThreads?: () => void\n /** Show the host's Smart Search page (`ConnectedSearchPage`). Absent: not offered. */\n openSmartSearch?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow` in `/connect`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * Show the open workspace's document processing (the host's processing panel: what is indexing,\n * what failed). Absent: not offered.\n */\n openProcessing?: () => void\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst subscribeToHistory = (listener: () => void) => {\n window.addEventListener('popstate', listener)\n return () => window.removeEventListener('popstate', listener)\n}\nconst windowAddress = () => window.location.pathname + window.location.search\n\n/** The window's address, following Back/Forward (the environment's default `useLocation`). */\nfunction useWindowLocation(): string {\n return useSyncExternalStore(subscribeToHistory, windowAddress, () => '/')\n}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n useLocation: useWindowLocation,\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n openDialog,\n closeDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n if (options?.messageId) mailMessageRequest.request(options.messageId)\n if (options?.folder) mailFolderRequest.request(options.folder)\n if (options?.attachments?.length) mailComposeRequest.request(options.attachments)\n openMail(options)\n }),\n openWorkflow: recordingIntent(environment.openWorkflow, (openWorkflow) => (id, options) => {\n workflowOpenRequest.request({ workflowId: id, view: options?.view, preset: options?.preset })\n openWorkflow(id, options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/** Open and close the global dialogs (`<ConnectedGlobalDialogs>`), the host's way. */\nexport function useBlocksDialogs(): Pick<BlocksEnvironment, 'openDialog' | 'closeDialog'> {\n const { openDialog, closeDialog } = useBlocksEnvironment()\n return { openDialog, closeDialog }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/settings-section.ts","../src/provider/requests.ts","../src/provider/environment.ts"],"names":["create","persist","createJSONStorage","useSyncExternalStore","listeners","useRef","useEffect","notifyStore","confirmDialog","choiceDialog","openDialog","closeDialog","useHostConfigRecord"],"mappings":";;;;;;;;AAqCO,IAAM,uBAAuBA,cAAA,EAA0B;AAAA,EAC5DC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB,CAAA;AAAA,MAChE,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc;AAAA,KACzD,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA;AACrC;AAEJ;AAEA,IAAM,MAAA,GAAS,sBAAA;AAGR,SAAS,qBAAqB,KAAA,EAAmC;AACtE,EAAA,IAAI,MAAA,CAAO,KAAK,KAAA,CAAM,EAAE,GAAG,oBAAA,CAAqB,QAAA,EAAS,CAAE,eAAA,CAAgB,KAAK,CAAA;AAClF;AAGO,SAAS,wBA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,CAAE,WAAA;AAC1C,EAAA,OAAO,WAAA,GAAc,uBAAA,CAAwB,WAAW,CAAA,GAAI,kBAAA;AAC9D;AAGO,SAAS,gBAAA,GAA0E;AACxF,EAAA,MAAM,EAAE,UAAA,EAAAF,WAAAA,EAAY,WAAA,EAAAC,YAAAA,KAAgB,oBAAA,EAAqB;AACzD,EAAA,OAAO,EAAE,UAAA,EAAAD,WAAAA,EAAY,WAAA,EAAAC,YAAAA,EAAY;AACnC","file":"chunk-LIKDQBNJ.cjs","sourcesContent":["/**\n * The connected calendar's view state: the chosen view is remembered across reloads (localStorage),\n * the anchor date lives for the session, and two requests carry intents from elsewhere into the\n * calendar once it mounts: an event to open (a deep link, a reminder) and a prefilled new event\n * (\"Schedule a call\" from a thread). The host navigates to its calendar page after making one.\n */\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport type { CalendarViewKind } from '../../calendar/types'\n\n/** \"Schedule a call\" from elsewhere (a thread, a DM, a dashboard): the editor opens prefilled. */\nexport interface CalendarComposerPrefill {\n title?: string\n attendees?: { email?: string | null; user_id?: string | null; name?: string | null }[]\n conversationId?: string | null\n /** Add an ARBI call when the event is saved (\"Add ARBI call\" ticked). */\n addCall?: boolean\n}\n\nexport interface PendingCalendarEvent {\n id: string\n recurrenceId?: string | null\n}\n\ninterface CalendarViewState {\n /** `null` until the user picks one: the settings' default view applies. */\n view: CalendarViewKind | null\n /** YYYY-MM-DD anchor; `null` = today. */\n date: string | null\n pendingEvent: PendingCalendarEvent | null\n pendingComposer: CalendarComposerPrefill | null\n setPendingComposer: (prefill: CalendarComposerPrefill | null) => void\n setView: (view: CalendarViewKind) => void\n setDate: (date: string | null) => void\n setPendingEvent: (pending: PendingCalendarEvent | null) => void\n}\n\nexport const useCalendarViewStore = create<CalendarViewState>()(\n persist(\n (set) => ({\n view: null,\n date: null,\n pendingEvent: null,\n pendingComposer: null,\n setPendingComposer: (pendingComposer) => set({ pendingComposer }),\n setView: (view) => set({ view }),\n setDate: (date) => set({ date }),\n setPendingEvent: (pendingEvent) => set({ pendingEvent }),\n }),\n {\n name: 'arbi-calendar-view',\n storage: createJSONStorage(() => localStorage),\n partialize: (s) => ({ view: s.view }),\n }\n )\n)\n\nconst EVT_RE = /^evt-[A-Za-z0-9]{8}$/\n\n/** Ask the calendar to open on an event (ignored unless it is an `evt-` id). */\nexport function requestCalendarEvent(event: PendingCalendarEvent): void {\n if (EVT_RE.test(event.id)) useCalendarViewStore.getState().setPendingEvent(event)\n}\n\n/** Ask the calendar to open the event editor prefilled. */\nexport function requestCalendarComposer(prefill: CalendarComposerPrefill): void {\n useCalendarViewStore.getState().setPendingComposer(prefill)\n}\n","/**\n * The settings section asked for last, so `openSettings(section)` opens that section in every host.\n *\n * `BlocksEnvironment.openSettings` records the section here before the host shows its settings\n * (a panel, a route); a `ConnectedSettingsPage` without its own `section` prop opens at it and\n * follows every later request, even one for the section asked for before. A host that keeps the\n * open section itself (`section` + `onSectionChange`) routes `openSettings` to its own state.\n */\nimport { useSyncExternalStore } from 'react'\n\nexport interface SettingsSectionRequest {\n section: string\n /** Increases with every request, so asking again for the same section is a new request. */\n seq: number\n}\n\nlet request: SettingsSectionRequest | undefined\nconst listeners = new Set<() => void>()\n\n/** Ask for a settings section; no section asks for none (the page stays where it is). */\nexport function requestSettingsSection(section?: string): void {\n if (!section) return\n request = { section, seq: (request?.seq ?? 0) + 1 }\n listeners.forEach((listener) => listener())\n}\n\nfunction subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => listeners.delete(listener)\n}\n\nconst snapshot = () => request\n\n/** The last settings-section request (`undefined` until there is one). */\nexport function useRequestedSettingsSection(): SettingsSectionRequest | undefined {\n return useSyncExternalStore(subscribe, snapshot, snapshot)\n}\n","/**\n * What an intent asks of the surface it opens, carried across the navigation: the first message\n * of a new conversation (`openNewConversation({ prompt })`), the email draft or message to show\n * (`openMail({ draftId })`, `openMail({ messageId })`), the folder (`openMail({ folder })`), a new\n * message with files (`openMail({ attachments })`) and the workflow to show\n * (`openWorkflow(id, { view })`). The environment records the request before the host navigates;\n * the surface takes it when it mounts, or at once while it is already on screen. Taking clears it,\n * so a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from 'react'\nimport type { MailAttachment } from '@arbidocs/react'\n\nexport interface IntentRequest<T> {\n /** Record a request (replacing one not taken yet). */\n request(value: T): void\n /** The pending request, cleared: `undefined` when there is none. */\n take(): T | undefined\n /** Calls `listener` whenever a request is made. */\n subscribe(listener: () => void): () => void\n}\n\nfunction intentRequest<T>(): IntentRequest<T> {\n let pending: { value: T } | undefined\n const listeners = new Set<() => void>()\n return {\n request(value) {\n pending = { value }\n listeners.forEach((listener) => listener())\n },\n take() {\n const taken = pending\n pending = undefined\n return taken?.value\n },\n subscribe(listener) {\n listeners.add(listener)\n return () => listeners.delete(listener)\n },\n }\n}\n\n/**\n * Take each request while `enabled`: the one pending on mount and every later one. The latest\n * `onRequest` is called.\n */\nexport function useIntentRequest<T>(\n store: IntentRequest<T>,\n onRequest: (value: T) => void,\n enabled = true\n): void {\n const latest = useRef(onRequest)\n latest.current = onRequest\n useEffect(() => {\n if (!enabled) return\n const take = () => {\n const value = store.take()\n if (value !== undefined) latest.current(value)\n }\n take()\n return store.subscribe(take)\n }, [store, enabled])\n}\n\n/** The first message of the new conversation `openNewConversation({ prompt })` showed. */\nexport const conversationStartRequest = intentRequest<string>()\n\n/** The email draft `openMail({ draftId })` showed. */\nexport const mailDraftRequest = intentRequest<string>()\n\n/** The message `openMail({ messageId })` showed. */\nexport const mailMessageRequest = intentRequest<string>()\n\n/** The folder `openMail({ folder })` showed (a role such as `outbox`, or an id). */\nexport const mailFolderRequest = intentRequest<string>()\n\n/** The new message `openMail({ attachments })` starts, with these files attached. */\nexport const mailComposeRequest = intentRequest<MailAttachment[]>()\n\n/**\n * The workflow `openWorkflow(id, { view })` showed: its editor, its runs, or (`run`, a host\n * catalogue entry) its run page (no id: the list).\n */\nexport const workflowOpenRequest = intentRequest<{\n workflowId?: string\n view?: 'builder' | 'runs' | 'run'\n /** No workflow: a new one's builder starts from this preset. */\n preset?: 'schedule'\n}>()\n","import { useSyncExternalStore, type ReactNode } from 'react'\nimport type { AnalyticsChartRequest, MailAttachment } from '@arbidocs/react'\nimport {\n notify as notifyStore,\n useHostConfigRecord,\n type NotifyOptions,\n type NotifyVariant,\n} from '@arbidocs/react/shell'\nimport type { BlockLinkComponent } from '../components/blockLink'\nimport { requestCalendarEvent, type PendingCalendarEvent } from '../connection/calendar/store'\nimport { choiceDialog, confirmDialog, type ChoiceRequest, type ConfirmRequest } from './dialogs'\nimport {\n closeDialog,\n openDialog,\n type BlocksDialogKind,\n type DialogPropsArg,\n type ShareRequest,\n type UploadSource,\n} from './dialog-registry'\nimport {\n conversationStartRequest,\n mailDraftRequest,\n mailMessageRequest,\n mailFolderRequest,\n mailComposeRequest,\n workflowOpenRequest,\n} from './requests'\nimport { requestSettingsSection } from './settings-section'\n\n/** What blocks need from the host's runtime configuration (the app's `config.json`). */\nexport interface BlocksRuntimeConfig {\n /** Origin of the ARBI API; `''` means the page's own origin. */\n apiBaseUrl: string\n /** The deployment's domain, e.g. `www.arbidocs.com` (deep links, key derivation, labels). */\n deploymentDomain: string\n /** Where seats are added for this deployment (a Box's licence page); none: its settings. */\n licenceUrl?: string\n /**\n * A public page where a Microsoft administrator approves SharePoint access, for the user to send\n * them (the accounts import offers the link). None: no link.\n */\n sharePointAdminUrl?: string\n}\n\nexport interface OpenDocumentOptions {\n /** 1-based page to scroll to. */\n page?: number\n /** Passage (chunk) to highlight. */\n passageId?: string\n /**\n * The workspace the document is in, when it is not the open one (a document an agent wrote in\n * its own workspace): the host opens that workspace first.\n */\n workspaceId?: string\n /** An earlier version (1-based); none: the current one. */\n version?: number\n /**\n * The viewer tab to show: `pdf` is where a signature request is reviewed and signed, and where\n * a copy the document tools made (frozen, signed) opens.\n */\n tab?: 'pdf'\n}\n\nexport type { ShareRequest, UploadSource }\n\nexport interface OpenWordEditorOptions {\n /** The comment to show (a mention in it, a reply to it). */\n commentId?: string\n /** The workspace the document is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenConversationOptions {\n /** The message to scroll to. */\n messageId?: string\n /** The open document stays on screen beside the thread (a thread about it). */\n keepDocumentOpen?: boolean\n /** The workspace the thread is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenNewConversationOptions {\n /** Its first message, sent once the new conversation is ready (an ask bar, \"Ask about this\"). */\n prompt?: string\n /** The open document stays on screen beside it (a chat started from it). */\n keepDocumentOpen?: boolean\n}\n\nexport interface OpenWorkflowOptions {\n /**\n * The workflow's editor (default), its runs, or (`run`, a host catalogue entry) where it starts.\n * The Workflows page (`ConnectedWorkflowsPage`) opens the editor, the runs or the run page\n * (`ConnectedWorkflowRunPage`) itself; the host only shows the page.\n */\n view?: 'builder' | 'runs' | 'run'\n /**\n * With no workflow: a new workflow's builder starts from this preset instead of a blank one\n * (`schedule`: a repeating schedule with one task prompt to fill in).\n */\n preset?: 'schedule'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n /** A message to show in the native inbox (a secure message just claimed from its link). */\n messageId?: string\n /** Start a new message with these files attached (\"Email\" on a document). */\n attachments?: MailAttachment[]\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** What `openFiles` shows: some files selected, and the list narrowed. */\nexport interface OpenFilesOptions {\n /** Files to select. */\n select?: string[]\n /** Quick filters by key (a label id, `folder:<path>`, `folder:none`): show or hide those files. */\n filters?: Record<string, 'include' | 'exclude'>\n}\n\n/**\n * Something a kit links to (the target of an `open…` intent), for `hrefFor`. `workspaceId` is the\n * workspace it is in, when the kit knows it.\n */\nexport type LinkTarget =\n | { kind: 'document'; documentId: string; workspaceId?: string | null }\n | {\n kind: 'conversation'\n conversationId: string\n workspaceId?: string | null\n messageId?: string\n }\n | { kind: 'workspace'; workspaceId: string }\n /** A project; none: the projects list. */\n | { kind: 'project'; projectId?: string }\n /** A workflow (its editor); none: the workflows list. */\n | { kind: 'workflow'; workflowId?: string; workspaceId?: string | null }\n /** The mailbox, on an email draft when given. */\n | { kind: 'mail'; draftId?: string }\n /** The user's settings, at a section when given. */\n | { kind: 'settings'; section?: string }\n /** The calendar, on an event when given. */\n | { kind: 'calendar'; eventId?: string }\n\n/**\n * The only way blocks reach the host app's environment: the host configuration's `environment`\n * (`<ArbiHost config={{ environment: { navigate, notify, … } }}>`). Blocks never import a router, a\n * toast library or an app store; the host gives what it has, and every field has a safe default so\n * a block renders correctly with no host at all. A nested host overrides only the fields it gives\n * and inherits the rest.\n */\nexport interface BlocksEnvironment {\n /** Router-aware link (keeps navigation in-SPA). Default: a plain `<a href>`. */\n linkComponent?: BlockLinkComponent\n /** Imperative navigation for buttons and keyboard shortcuts. Default: `window.location.assign`. */\n navigate: (href: string) => void\n /**\n * A hook: the address on screen (path, then any search), re-rendering when it changes. A routed\n * shell reads its current row from it. A host with a router adapts that router's location\n * (react-router: `() => { const l = useLocation(); return l.pathname + l.search }`); keep the\n * same hook for the host's life. Default: the window's address, following Back/Forward.\n */\n useLocation: () => string\n /** Surface a transient message (and record it in the notification centre). Default: the shared\n * `@arbidocs/react` notify store, rendered by its `<Toaster/>`. */\n notify: (message: ReactNode, kind?: NotifyVariant, options?: NotifyOptions) => void\n /** Ask the user to confirm. Default: the blocks prompt dialog. */\n confirm: (request: ConfirmRequest) => Promise<boolean>\n /** Ask the user to pick one of several choices; `null` when dismissed. Default: the blocks\n * prompt dialog. */\n choose: <T extends string>(request: ChoiceRequest<T>) => Promise<T | null>\n /**\n * Open a global dialog by kind (`BlocksDialogProps`), shown by the one `<ConnectedGlobalDialogs>`\n * in the shell. Default: the blocks dialog registry.\n */\n openDialog: <K extends BlocksDialogKind>(kind: K, ...props: DialogPropsArg<K>) => void\n /** Close a global dialog. Default: the blocks dialog registry. */\n closeDialog: (kind: BlocksDialogKind) => void\n /** Deployment configuration. Default: same-origin API on the page's own host. */\n runtimeConfig: BlocksRuntimeConfig\n /**\n * The address of a target in the host's router, for a real link (open in a new tab, middle-click,\n * copy link) beside the matching `open…` intent: a kit never builds an app path itself, so its\n * links and its navigation agree on every site. `undefined`: no link (the row still opens on a\n * click). Default: none. ARBI's addresses (`/wrk-…/doc-…`): the route codec's `hrefFor`.\n */\n hrefFor: (target: LinkTarget) => string | undefined\n /** Open a document (optionally at a page / passage) wherever the host shows documents.\n * Default: no-op. */\n openDocument: (documentId: string, options?: OpenDocumentOptions) => void\n /**\n * Open a Word document (`opensInWord`) in the host's Word editor, optionally on a comment.\n * Default: `openDocument` (a host whose viewer edits Word documents in place needs no other).\n */\n openWordEditor: (documentId: string, options?: OpenWordEditorOptions) => void\n /** Open a conversation thread, optionally scrolled to a message. Default: no-op. */\n openConversation: (conversationId: string, options?: OpenConversationOptions) => void\n /**\n * Show a new, empty conversation, unbound to any document. With a `prompt` it is sent as the\n * first message once the conversation is ready (recorded for the chat that shows it:\n * `ConnectedConversationThread`, `ChatPage`). Without one a launch composes into the session's draft\n * after this. Default: no-op.\n */\n openNewConversation: (options?: OpenNewConversationOptions) => void\n /**\n * Open the user's settings, optionally at a section (a `ConnectedSettingsPage` section id).\n * The section is always recorded for `ConnectedSettingsPage` first (`requestSettingsSection`);\n * the host's handler then shows its settings. Default: only that record.\n */\n openSettings: (section?: string) => void\n /** Open a project; no id: the projects list. Default: no-op. */\n openProject: (projectId?: string) => void\n /**\n * Show the calendar page (`ConnectedCalendar`), optionally on an event (recorded for the\n * calendar first: `requestCalendarEvent`). Default: only that record.\n */\n openCalendar: (options?: OpenCalendarOptions) => void\n /**\n * Show the mailbox (`ConnectedMailbox`), optionally on an email draft (recorded for the mailbox\n * first). Absent: the host has no mail, and a kit offers no way to open it.\n */\n openMail?: (options?: OpenMailOptions) => void\n /** Show the host's calls page (call history, scheduled calls). Absent: not offered. */\n openCalls?: () => void\n /** Open the direct chat with a person (the host's messenger). Absent: not offered. */\n openDirectChat?: (userId: string) => void\n /** Open one of my chats (a group or meeting chat) in the host's messenger. Absent: not offered. */\n openChat?: (chatId: string) => void\n /** Show the host's notification centre (`ConnectedNotificationCenter`), optionally on one\n * entry (`focusId`). Absent: not offered. */\n openNotifications?: (options?: { focusId?: string }) => void\n /** Show the host's contacts (a panel it toggles, a page). Absent: not offered. */\n openContacts?: () => void\n /** Show the host's databases page (user-defined tables). Absent: not offered. */\n openDatabases?: () => void\n /** Show the host's Analytics page (saved dashboards); `database`: with a new dashboard charting that\n * database (a database's \"Chart this\"). Absent: not offered. */\n openAnalytics?: (options?: { database?: AnalyticsChartRequest }) => void\n /** Show the host's tags page (people, organisations and the other tags). Absent: not offered. */\n openTags?: () => void\n /** Show the host's facts page; `compose`: with its composer open for a new fact; `focusId`: at\n * that fact. Absent: not offered. */\n openFacts?: (options?: { compose?: boolean; focusId?: string }) => void\n /** Show the open workspace's threads (the host's threads page). Absent: not offered. */\n openThreads?: () => void\n /** Show the host's Smart Search page (`ConnectedSearchPage`). Absent: not offered. */\n openSmartSearch?: () => void\n /**\n * Open a workflow in the host's Workflows page (its editor, or its runs); no id: the list.\n * Offered only while the `workflows` feature is on (`useOpenWorkflow` in `/connect`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * Show the open workspace's document processing (the host's processing panel: what is indexing,\n * what failed). Absent: not offered.\n */\n openProcessing?: () => void\n /** Show the open workspace's files, optionally with some selected and the list narrowed. Default: no-op. */\n openFiles: (options?: OpenFilesOptions) => void\n /**\n * Add files the host's way (its upload dialog), optionally with some already picked, or from one\n * source. Absent: a kit that adds files uploads them itself.\n */\n openUpload?: (files?: File[], options?: { source?: UploadSource }) => void\n /** Open the host's skills browser, optionally at one skill. Absent: not offered. */\n openSkillsBrowser?: (skillSlug?: string) => void\n /** Share a document or a thread by email (the host's share dialog). Absent: not offered. */\n openShare?: (request: ShareRequest) => void\n /**\n * Show a workspace (its own page). Under `defaultHost`'s sign-in layer the kits select it first\n * (`useConnectedWorkspace().openWorkspace`); a host that keeps its own session switches to it\n * here. `name` is for the host's messages. Default: no-op.\n */\n openWorkspace: (workspaceId: string, options?: { name?: string }) => void\n}\n\nconst noop = () => {}\n\nconst subscribeToHistory = (listener: () => void) => {\n window.addEventListener('popstate', listener)\n return () => window.removeEventListener('popstate', listener)\n}\nconst windowAddress = () => window.location.pathname + window.location.search\n\n/** The window's address, following Back/Forward (the environment's default `useLocation`). */\nfunction useWindowLocation(): string {\n return useSyncExternalStore(subscribeToHistory, windowAddress, () => '/')\n}\n\nconst defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n useLocation: useWindowLocation,\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\n openDialog,\n closeDialog,\n runtimeConfig: {\n apiBaseUrl: '',\n deploymentDomain: typeof window !== 'undefined' ? window.location.host : '',\n },\n hrefFor: () => undefined,\n openDocument: noop,\n openWordEditor: noop,\n openConversation: noop,\n openNewConversation: noop,\n openSettings: requestSettingsSection,\n openProject: noop,\n openCalendar: (options) => {\n if (options?.event) requestCalendarEvent(options.event)\n },\n openFiles: noop,\n openWorkspace: noop,\n}\n\nconst resolved = new WeakMap<object, BlocksEnvironment>()\nconst complete = new WeakSet<BlocksEnvironment>()\n// The intents below that record what they open on: a resolved environment passed on again (a\n// nested host's, `createBlocksEnvironment`'s) records once, not twice.\nconst recording = new WeakSet<object>()\n\nfunction records<F extends object>(intent: F): F {\n recording.add(intent)\n return intent\n}\n\nfunction recordingIntent<F extends object>(\n host: F | undefined,\n wrap: (host: F) => F\n): F | undefined {\n if (!host) return undefined\n return recording.has(host) ? host : records(wrap(host))\n}\n\nfunction resolve(environment: Partial<BlocksEnvironment>): BlocksEnvironment {\n const { openDocument } = environment\n const value: BlocksEnvironment = {\n ...defaultEnvironment,\n openWordEditor: openDocument\n ? (documentId, options) => openDocument(documentId, { workspaceId: options?.workspaceId })\n : noop,\n ...environment,\n // What an intent opens on is recorded for the surface before the host shows it.\n openSettings:\n recordingIntent(environment.openSettings, (openSettings) => (section) => {\n requestSettingsSection(section)\n openSettings(section)\n }) ?? defaultEnvironment.openSettings,\n openCalendar:\n recordingIntent(environment.openCalendar, (openCalendar) => (options) => {\n defaultEnvironment.openCalendar(options)\n openCalendar(options)\n }) ?? defaultEnvironment.openCalendar,\n openMail: recordingIntent(environment.openMail, (openMail) => (options) => {\n if (options?.draftId) mailDraftRequest.request(options.draftId)\n if (options?.messageId) mailMessageRequest.request(options.messageId)\n if (options?.folder) mailFolderRequest.request(options.folder)\n if (options?.attachments?.length) mailComposeRequest.request(options.attachments)\n openMail(options)\n }),\n openWorkflow: recordingIntent(environment.openWorkflow, (openWorkflow) => (id, options) => {\n workflowOpenRequest.request({ workflowId: id, view: options?.view, preset: options?.preset })\n openWorkflow(id, options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/** Open and close the global dialogs (`<ConnectedGlobalDialogs>`), the host's way. */\nexport function useBlocksDialogs(): Pick<BlocksEnvironment, 'openDialog' | 'closeDialog'> {\n const { openDialog, closeDialog } = useBlocksEnvironment()\n return { openDialog, closeDialog }\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkFYFL3CET_cjs = require('./chunk-FYFL3CET.cjs');
|
|
5
5
|
var zustand = require('zustand');
|
|
6
6
|
var middleware = require('zustand/middleware');
|
|
7
7
|
|
|
@@ -50,7 +50,7 @@ var useFilesPrefs = zustand.create()(
|
|
|
50
50
|
(state) => state.viewModes[prefsKey] === viewMode ? state : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }
|
|
51
51
|
),
|
|
52
52
|
// New users start at the compact minimum (more rows at once).
|
|
53
|
-
rowHeight:
|
|
53
|
+
rowHeight: chunkFYFL3CET_cjs.DOCUMENTS_ROW_HEIGHT_INITIAL,
|
|
54
54
|
setRowHeight: (rowHeight) => set({ rowHeight })
|
|
55
55
|
}),
|
|
56
56
|
{
|
|
@@ -121,5 +121,5 @@ exports.useFilesGridStates = useFilesGridStates;
|
|
|
121
121
|
exports.useFilesPrefs = useFilesPrefs;
|
|
122
122
|
exports.useFilesStore = useFilesStore;
|
|
123
123
|
exports.usePendingFolders = usePendingFolders;
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
125
|
-
//# sourceMappingURL=chunk-
|
|
124
|
+
//# sourceMappingURL=chunk-LLD4PNBW.cjs.map
|
|
125
|
+
//# sourceMappingURL=chunk-LLD4PNBW.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/files/store.ts"],"names":["create","persist","createJSONStorage","DOCUMENTS_ROW_HEIGHT_INITIAL"],"mappings":";;;;;;AAmBO,IAAM,gBAAgBA,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AAS;AAAA,MACR,YAAY,EAAC;AAAA,MACb,cAAc,CAAC,MAAA,EAAQ,UACrB,GAAA,CAAI,CAAC,aAAa,EAAE,UAAA,EAAY,EAAE,GAAG,QAAQ,UAAA,EAAY,CAAC,MAAM,GAAG,KAAA,IAAQ,CAAE;AAAA,KACjF,CAAA;AAAA,IACA,EAAE,IAAA,EAAM,kBAAA,EAAoB,SAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAE;AAE/E;AA0BO,IAAM,eAAA,GAAkBF,cAAA,EAA0B,CAAE,CAAC,GAAA,MAAS;AAAA,EACnE,IAAA,EAAM,IAAA;AAAA,EACN,QAAA,EAAU,CAAC,MAAA,GAAS,IAAA,KAAS,GAAA,CAAI,EAAE,IAAA,EAAM,EAAE,MAAA,EAAO,EAAG,CAAA;AAAA,EACrD,WAAW,MAAM,GAAA,CAAI,EAAE,IAAA,EAAM,MAAM,CAAA;AAAA,EACnC,YAAA,EAAc,KAAA;AAAA,EACd,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc,CAAA;AAAA,EACvD,aAAA,EAAe,IAAA;AAAA,EACf,eAAe,CAAC,aAAA,KAAkB,GAAA,CAAI,EAAE,eAAe,CAAA;AAAA,EACvD,UAAA,EAAY,KAAA;AAAA,EACZ,eAAe,CAAC,UAAA,KAAe,GAAA,CAAI,EAAE,YAAY;AACnD,CAAA,CAAE","file":"chunk-734NPQNR.cjs","sourcesContent":["/**\n * The Files kits' own state: empty folders the user created (a folder exists only through its\n * documents, so a new one is a placeholder until something is moved into it), per workspace, for\n * the session (kept in `sessionStorage`, so a reload keeps them).\n */\n\nimport type { GridState } from 'ag-grid-community'\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport { DOCUMENTS_ROW_HEIGHT_INITIAL } from '../../files/documentColumns'\nimport type { ExplorerFolder } from '../../files/folders/folderPaths'\n\ninterface FilesState {\n /** Placeholder folder paths per workspace. */\n pendingFolders: Readonly<Record<string, readonly string[]>>\n addPendingFolder: (workspaceId: string, path: string) => void\n removePendingFolder: (workspaceId: string, path: string) => void\n}\n\nexport const useFilesStore = create<FilesState>()(\n persist(\n (set) => ({\n pendingFolders: {},\n addPendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (current.includes(path)) return state\n return { pendingFolders: { ...state.pendingFolders, [workspaceId]: [...current, path] } }\n }),\n removePendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (!current.includes(path)) return state\n return {\n pendingFolders: {\n ...state.pendingFolders,\n [workspaceId]: current.filter((p) => p !== path),\n },\n }\n }),\n }),\n {\n name: 'arbi_explorer_pending_folders',\n storage: createJSONStorage(() => sessionStorage),\n partialize: (state) => ({ pendingFolders: state.pendingFolders }),\n }\n )\n)\n\nconst NONE: readonly string[] = []\n\n/** A workspace's placeholder folders. */\nexport function usePendingFolders(workspaceId: string | null | undefined): readonly string[] {\n return useFilesStore(\n (state) => (workspaceId ? state.pendingFolders[workspaceId] : undefined) ?? NONE\n )\n}\n\n/** How the files page shows the documents: a table, the explorer, review one by one, or search. */\nexport type FilesViewMode = 'grid' | 'explorer' | 'navigator' | 'search'\n\n/** The files page's own preferences key (`ConnectedFilesPage` `prefsKey`). */\nexport const FILES_PREFS_KEY = 'files'\nconst DEFAULT_VIEW_MODE: FilesViewMode = 'explorer'\n\ninterface FilesPrefsState {\n /** The documents list's tri-state filters (filter id → include / exclude / off). */\n documentFilters: Readonly<Record<string, 'include' | 'exclude' | null>>\n setDocumentFilters: (filters: Record<string, 'include' | 'exclude' | null>) => void\n /**\n * Each files page's view, by its `prefsKey` (a page that is the same kit in another role, e.g.\n * a tabular review in the table view, keeps its own). Absent: that page's default.\n */\n viewModes: Readonly<Record<string, FilesViewMode>>\n /** Set a page's view (default: the files page's). */\n setViewMode: (mode: FilesViewMode, prefsKey?: string) => void\n /** The table's row height (density). */\n rowHeight: number\n setRowHeight: (height: number) => void\n}\n\n/** The Files kits' preferences, kept on this device (`localStorage`) across sessions. */\nexport const useFilesPrefs = create<FilesPrefsState>()(\n persist(\n (set) => ({\n documentFilters: {},\n setDocumentFilters: (documentFilters) => set({ documentFilters }),\n viewModes: {},\n setViewMode: (viewMode, prefsKey = FILES_PREFS_KEY) =>\n set((state) =>\n state.viewModes[prefsKey] === viewMode\n ? state\n : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }\n ),\n // New users start at the compact minimum (more rows at once).\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n setRowHeight: (rowHeight) => set({ rowHeight }),\n }),\n {\n name: 'arbi_files_prefs',\n storage: createJSONStorage(() => localStorage),\n version: 1,\n // Version 0 kept one view for every files page: it becomes the files page's own.\n migrate: (persisted, version) => {\n const state = (persisted ?? {}) as Record<string, unknown>\n if (version >= 1) return state as Partial<FilesPrefsState>\n const { viewMode, ...rest } = state\n return {\n ...rest,\n viewModes: viewMode ? { [FILES_PREFS_KEY]: viewMode as FilesViewMode } : {},\n } as Partial<FilesPrefsState>\n },\n partialize: (state) => ({\n documentFilters: state.documentFilters,\n viewModes: state.viewModes,\n rowHeight: state.rowHeight,\n }),\n }\n )\n)\n\n/** A files page's view (`prefsKey`, default the files page's), else its `defaultViewMode`. */\nexport function filesViewMode(\n state: Pick<FilesPrefsState, 'viewModes'>,\n prefsKey: string = FILES_PREFS_KEY,\n defaultViewMode: FilesViewMode = DEFAULT_VIEW_MODE\n): FilesViewMode {\n return state.viewModes[prefsKey] ?? defaultViewMode\n}\n\n/** An AI review run: the fields, the documents, and which of them the server finished. */\nexport interface AiReviewRun {\n tags: { id: string; name: string }[]\n docIds: string[]\n /** The documents the server finished (a finished cell with no value will not fill). */\n finishedDocIds?: string[]\n /** It replaces values already there: a cell shows its new value only once finished. */\n replacing?: boolean\n}\n\ninterface AiReviewState {\n /** The AI review dialog is open. */\n open: boolean\n /** The run on screen, kept after closing so \"View results\" can bring the answers back. */\n run: AiReviewRun | null\n setOpen: (open: boolean) => void\n setRun: (run: AiReviewRun | null) => void\n /** The server finished these documents of the run (with or without a value). */\n markFinished: (docIds: string[]) => void\n}\n\n/** The AI review dialog and its run, reachable from outside React (a finished-run notice). */\nexport const useAiReviewStore = create<AiReviewState>()((set) => ({\n open: false,\n run: null,\n setOpen: (open) => set({ open }),\n setRun: (run) => set({ run }),\n markFinished: (docIds) =>\n set((state) => {\n const run = state.run\n if (!run) return state\n const finished = new Set(run.finishedDocIds ?? [])\n const added = docIds.filter((id) => run.docIds.includes(id) && !finished.has(id))\n if (added.length === 0) return state\n return { run: { ...run, finishedDocIds: [...finished, ...added] } }\n }),\n}))\n\ninterface GridStatesState {\n /** AG Grid's saved state (columns, widths, sort) per grid id. */\n gridStates: Readonly<Record<string, GridState>>\n setGridState: (gridId: string, state: GridState) => void\n}\n\n/** The Files grids' saved state, kept on this device, for hosts that keep none of their own. */\nexport const useFilesGridStates = create<GridStatesState>()(\n persist(\n (set) => ({\n gridStates: {},\n setGridState: (gridId, state) =>\n set((current) => ({ gridStates: { ...current.gridStates, [gridId]: state } })),\n }),\n { name: 'arbi_files_grids', storage: createJSONStorage(() => localStorage) }\n )\n)\n\n/** A document the Delete confirmation asks about. */\nexport interface DeleteRequestDocument {\n external_id: string\n file_name?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\ninterface FilesDialogsState {\n /** Move the selection (or `folder`) to a folder. */\n move: { folder: ExplorerFolder | null } | null\n openMove: (folder?: ExplorerFolder | null) => void\n closeMove: () => void\n /** Edit the selection's labels and fields. */\n bulkTagsOpen: boolean\n setBulkTagsOpen: (open: boolean) => void\n /** Confirm deleting one document. */\n deleteRequest: DeleteRequestDocument | null\n requestDelete: (doc: DeleteRequestDocument | null) => void\n /** Export, copy or move the selection (the page's own dialog, when the host has none). */\n exportOpen: boolean\n setExportOpen: (open: boolean) => void\n}\n\n/** The files page's dialogs, also opened from outside it (commands, the viewer's related files). */\nexport const useFilesDialogs = create<FilesDialogsState>()((set) => ({\n move: null,\n openMove: (folder = null) => set({ move: { folder } }),\n closeMove: () => set({ move: null }),\n bulkTagsOpen: false,\n setBulkTagsOpen: (bulkTagsOpen) => set({ bulkTagsOpen }),\n deleteRequest: null,\n requestDelete: (deleteRequest) => set({ deleteRequest }),\n exportOpen: false,\n setExportOpen: (exportOpen) => set({ exportOpen }),\n}))\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/files/store.ts"],"names":["create","persist","createJSONStorage","DOCUMENTS_ROW_HEIGHT_INITIAL"],"mappings":";;;;;;AAmBO,IAAM,gBAAgBA,cAAA,EAAmB;AAAA,EAC9CC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,gBAAgB,EAAC;AAAA,MACjB,kBAAkB,CAAC,WAAA,EAAa,IAAA,KAC9B,GAAA,CAAI,CAAC,KAAA,KAAU;AACb,QAAA,MAAM,OAAA,GAAU,KAAA,CAAM,cAAA,CAAe,WAAW,KAAK,EAAC;AACtD,QAAA,IAAI,OAAA,CAAQ,QAAA,CAAS,IAAI,CAAA,EAAG,OAAO,KAAA;AACnC,QAAA,OAAO,EAAE,cAAA,EAAgB,EAAE,GAAG,MAAM,cAAA,EAAgB,CAAC,WAAW,GAAG,CAAC,GAAG,OAAA,EAAS,IAAI,GAAE,EAAE;AAAA,MAC1F,CAAC,CAAA;AAAA,MACH,qBAAqB,CAAC,WAAA,EAAa,IAAA,KACjC,GAAA,CAAI,CAAC,KAAA,KAAU;AACb,QAAA,MAAM,OAAA,GAAU,KAAA,CAAM,cAAA,CAAe,WAAW,KAAK,EAAC;AACtD,QAAA,IAAI,CAAC,OAAA,CAAQ,QAAA,CAAS,IAAI,GAAG,OAAO,KAAA;AACpC,QAAA,OAAO;AAAA,UACL,cAAA,EAAgB;AAAA,YACd,GAAG,KAAA,CAAM,cAAA;AAAA,YACT,CAAC,WAAW,GAAG,OAAA,CAAQ,OAAO,CAAC,CAAA,KAAM,MAAM,IAAI;AAAA;AACjD,SACF;AAAA,MACF,CAA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LLD4PNBW.cjs","sourcesContent":["/**\n * The Files kits' own state: empty folders the user created (a folder exists only through its\n * documents, so a new one is a placeholder until something is moved into it), per workspace, for\n * the session (kept in `sessionStorage`, so a reload keeps them).\n */\n\nimport type { GridState } from 'ag-grid-community'\nimport { create } from 'zustand'\nimport { createJSONStorage, persist } from 'zustand/middleware'\nimport { DOCUMENTS_ROW_HEIGHT_INITIAL } from '../../files/documentColumns'\nimport type { ExplorerFolder } from '../../files/folders/folderPaths'\n\ninterface FilesState {\n /** Placeholder folder paths per workspace. */\n pendingFolders: Readonly<Record<string, readonly string[]>>\n addPendingFolder: (workspaceId: string, path: string) => void\n removePendingFolder: (workspaceId: string, path: string) => void\n}\n\nexport const useFilesStore = create<FilesState>()(\n persist(\n (set) => ({\n pendingFolders: {},\n addPendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (current.includes(path)) return state\n return { pendingFolders: { ...state.pendingFolders, [workspaceId]: [...current, path] } }\n }),\n removePendingFolder: (workspaceId, path) =>\n set((state) => {\n const current = state.pendingFolders[workspaceId] ?? []\n if (!current.includes(path)) return state\n return {\n pendingFolders: {\n ...state.pendingFolders,\n [workspaceId]: current.filter((p) => p !== path),\n },\n }\n }),\n }),\n {\n name: 'arbi_explorer_pending_folders',\n storage: createJSONStorage(() => sessionStorage),\n partialize: (state) => ({ pendingFolders: state.pendingFolders }),\n }\n )\n)\n\nconst NONE: readonly string[] = []\n\n/** A workspace's placeholder folders. */\nexport function usePendingFolders(workspaceId: string | null | undefined): readonly string[] {\n return useFilesStore(\n (state) => (workspaceId ? state.pendingFolders[workspaceId] : undefined) ?? NONE\n )\n}\n\n/** How the files page shows the documents: a table, the explorer, review one by one, or search. */\nexport type FilesViewMode = 'grid' | 'explorer' | 'navigator' | 'search'\n\n/** The files page's own preferences key (`ConnectedFilesPage` `prefsKey`). */\nexport const FILES_PREFS_KEY = 'files'\nconst DEFAULT_VIEW_MODE: FilesViewMode = 'explorer'\n\ninterface FilesPrefsState {\n /** The documents list's tri-state filters (filter id → include / exclude / off). */\n documentFilters: Readonly<Record<string, 'include' | 'exclude' | null>>\n setDocumentFilters: (filters: Record<string, 'include' | 'exclude' | null>) => void\n /**\n * Each files page's view, by its `prefsKey` (a page that is the same kit in another role, e.g.\n * a tabular review in the table view, keeps its own). Absent: that page's default.\n */\n viewModes: Readonly<Record<string, FilesViewMode>>\n /** Set a page's view (default: the files page's). */\n setViewMode: (mode: FilesViewMode, prefsKey?: string) => void\n /** The table's row height (density). */\n rowHeight: number\n setRowHeight: (height: number) => void\n}\n\n/** The Files kits' preferences, kept on this device (`localStorage`) across sessions. */\nexport const useFilesPrefs = create<FilesPrefsState>()(\n persist(\n (set) => ({\n documentFilters: {},\n setDocumentFilters: (documentFilters) => set({ documentFilters }),\n viewModes: {},\n setViewMode: (viewMode, prefsKey = FILES_PREFS_KEY) =>\n set((state) =>\n state.viewModes[prefsKey] === viewMode\n ? state\n : { viewModes: { ...state.viewModes, [prefsKey]: viewMode } }\n ),\n // New users start at the compact minimum (more rows at once).\n rowHeight: DOCUMENTS_ROW_HEIGHT_INITIAL,\n setRowHeight: (rowHeight) => set({ rowHeight }),\n }),\n {\n name: 'arbi_files_prefs',\n storage: createJSONStorage(() => localStorage),\n version: 1,\n // Version 0 kept one view for every files page: it becomes the files page's own.\n migrate: (persisted, version) => {\n const state = (persisted ?? {}) as Record<string, unknown>\n if (version >= 1) return state as Partial<FilesPrefsState>\n const { viewMode, ...rest } = state\n return {\n ...rest,\n viewModes: viewMode ? { [FILES_PREFS_KEY]: viewMode as FilesViewMode } : {},\n } as Partial<FilesPrefsState>\n },\n partialize: (state) => ({\n documentFilters: state.documentFilters,\n viewModes: state.viewModes,\n rowHeight: state.rowHeight,\n }),\n }\n )\n)\n\n/** A files page's view (`prefsKey`, default the files page's), else its `defaultViewMode`. */\nexport function filesViewMode(\n state: Pick<FilesPrefsState, 'viewModes'>,\n prefsKey: string = FILES_PREFS_KEY,\n defaultViewMode: FilesViewMode = DEFAULT_VIEW_MODE\n): FilesViewMode {\n return state.viewModes[prefsKey] ?? defaultViewMode\n}\n\n/** An AI review run: the fields, the documents, and which of them the server finished. */\nexport interface AiReviewRun {\n tags: { id: string; name: string }[]\n docIds: string[]\n /** The documents the server finished (a finished cell with no value will not fill). */\n finishedDocIds?: string[]\n /** It replaces values already there: a cell shows its new value only once finished. */\n replacing?: boolean\n}\n\ninterface AiReviewState {\n /** The AI review dialog is open. */\n open: boolean\n /** The run on screen, kept after closing so \"View results\" can bring the answers back. */\n run: AiReviewRun | null\n setOpen: (open: boolean) => void\n setRun: (run: AiReviewRun | null) => void\n /** The server finished these documents of the run (with or without a value). */\n markFinished: (docIds: string[]) => void\n}\n\n/** The AI review dialog and its run, reachable from outside React (a finished-run notice). */\nexport const useAiReviewStore = create<AiReviewState>()((set) => ({\n open: false,\n run: null,\n setOpen: (open) => set({ open }),\n setRun: (run) => set({ run }),\n markFinished: (docIds) =>\n set((state) => {\n const run = state.run\n if (!run) return state\n const finished = new Set(run.finishedDocIds ?? [])\n const added = docIds.filter((id) => run.docIds.includes(id) && !finished.has(id))\n if (added.length === 0) return state\n return { run: { ...run, finishedDocIds: [...finished, ...added] } }\n }),\n}))\n\ninterface GridStatesState {\n /** AG Grid's saved state (columns, widths, sort) per grid id. */\n gridStates: Readonly<Record<string, GridState>>\n setGridState: (gridId: string, state: GridState) => void\n}\n\n/** The Files grids' saved state, kept on this device, for hosts that keep none of their own. */\nexport const useFilesGridStates = create<GridStatesState>()(\n persist(\n (set) => ({\n gridStates: {},\n setGridState: (gridId, state) =>\n set((current) => ({ gridStates: { ...current.gridStates, [gridId]: state } })),\n }),\n { name: 'arbi_files_grids', storage: createJSONStorage(() => localStorage) }\n )\n)\n\n/** A document the Delete confirmation asks about. */\nexport interface DeleteRequestDocument {\n external_id: string\n file_name?: string | null\n doc_metadata?: { title?: string | null } | null\n}\n\ninterface FilesDialogsState {\n /** Move the selection (or `folder`) to a folder. */\n move: { folder: ExplorerFolder | null } | null\n openMove: (folder?: ExplorerFolder | null) => void\n closeMove: () => void\n /** Edit the selection's labels and fields. */\n bulkTagsOpen: boolean\n setBulkTagsOpen: (open: boolean) => void\n /** Confirm deleting one document. */\n deleteRequest: DeleteRequestDocument | null\n requestDelete: (doc: DeleteRequestDocument | null) => void\n /** Export, copy or move the selection (the page's own dialog, when the host has none). */\n exportOpen: boolean\n setExportOpen: (open: boolean) => void\n}\n\n/** The files page's dialogs, also opened from outside it (commands, the viewer's related files). */\nexport const useFilesDialogs = create<FilesDialogsState>()((set) => ({\n move: null,\n openMove: (folder = null) => set({ move: { folder } }),\n closeMove: () => set({ move: null }),\n bulkTagsOpen: false,\n setBulkTagsOpen: (bulkTagsOpen) => set({ bulkTagsOpen }),\n deleteRequest: null,\n requestDelete: (deleteRequest) => set({ deleteRequest }),\n exportOpen: false,\n setExportOpen: (exportOpen) => set({ exportOpen }),\n}))\n"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
4
|
+
var chunkTOYKBRAU_cjs = require('./chunk-TOYKBRAU.cjs');
|
|
5
|
+
var chunk6CGMSJLB_cjs = require('./chunk-6CGMSJLB.cjs');
|
|
7
6
|
var chunk5A6T4W46_cjs = require('./chunk-5A6T4W46.cjs');
|
|
7
|
+
var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
|
|
8
8
|
var chunkJN5YMHGI_cjs = require('./chunk-JN5YMHGI.cjs');
|
|
9
9
|
var react$1 = require('react');
|
|
10
10
|
var react = require('@arbidocs/react');
|
|
@@ -19,7 +19,7 @@ function canOpenSkill(workflow, skillsEnabled) {
|
|
|
19
19
|
return workflow.run.kind === "prompt" && (skillsEnabled || chunk5A6T4W46_cjs.isSkillPackWorkflow(workflow));
|
|
20
20
|
}
|
|
21
21
|
function useSlashSkillWorkflows({ landing, send }) {
|
|
22
|
-
const { skills, skillsEnabled } =
|
|
22
|
+
const { skills, skillsEnabled } = chunk6CGMSJLB_cjs.useWorkflowDefinitions();
|
|
23
23
|
const { commands } = react.useBuiltinCommands();
|
|
24
24
|
const [active, setActive] = react$1.useState(null);
|
|
25
25
|
const open = react$1.useCallback(
|
|
@@ -67,7 +67,7 @@ function useSlashSkillWorkflows({ landing, send }) {
|
|
|
67
67
|
return field && active.text ? { [field]: active.text } : void 0;
|
|
68
68
|
};
|
|
69
69
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
70
|
-
|
|
70
|
+
chunkTOYKBRAU_cjs.ConnectedWorkflowStart,
|
|
71
71
|
{
|
|
72
72
|
workflows: skills,
|
|
73
73
|
showTiles: false,
|
|
@@ -83,11 +83,11 @@ function useSlashSkillWorkflows({ landing, send }) {
|
|
|
83
83
|
}
|
|
84
84
|
var NO_SKILLS = [];
|
|
85
85
|
function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
86
|
-
const hostSkills =
|
|
87
|
-
const listings =
|
|
88
|
-
const skillsEnabled =
|
|
86
|
+
const hostSkills = chunk6CGMSJLB_cjs.useHostSkills();
|
|
87
|
+
const listings = chunk6CGMSJLB_cjs.useUsableSkillListings(hostSkills);
|
|
88
|
+
const skillsEnabled = chunk6CGMSJLB_cjs.useSkillsEnabled();
|
|
89
89
|
const { commands } = react.useBuiltinCommands();
|
|
90
|
-
const builtins =
|
|
90
|
+
const builtins = chunk6CGMSJLB_cjs.useNamedWorkflows(builtinSkills);
|
|
91
91
|
const items = react$1.useMemo(() => {
|
|
92
92
|
const packSlugs = new Set(hostSkills.map((w) => w.id));
|
|
93
93
|
return chunk5F4DCIHS_cjs.buildSlashItems(
|
|
@@ -98,7 +98,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
98
98
|
kind: "command"
|
|
99
99
|
})),
|
|
100
100
|
[
|
|
101
|
-
...hostSkills.map(
|
|
101
|
+
...hostSkills.map(chunk6CGMSJLB_cjs.hostSkillItem),
|
|
102
102
|
...skillsEnabled ? skillItems(
|
|
103
103
|
builtins.filter((w) => !packSlugs.has(w.id)),
|
|
104
104
|
listings
|
|
@@ -106,7 +106,7 @@ function useSlashMenuItems(builtinSkills = NO_SKILLS) {
|
|
|
106
106
|
]
|
|
107
107
|
);
|
|
108
108
|
}, [commands, hostSkills, listings, skillsEnabled, builtins]);
|
|
109
|
-
return { items, canBrowseSkills:
|
|
109
|
+
return { items, canBrowseSkills: chunk6CGMSJLB_cjs.useCanBrowseSkills() };
|
|
110
110
|
}
|
|
111
111
|
function useSlashItems(text, builtinSkills = NO_SKILLS) {
|
|
112
112
|
const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills);
|
|
@@ -150,5 +150,5 @@ exports.parseTypedSkill = parseTypedSkill;
|
|
|
150
150
|
exports.useSlashItems = useSlashItems;
|
|
151
151
|
exports.useSlashMenuItems = useSlashMenuItems;
|
|
152
152
|
exports.useSlashSkillWorkflows = useSlashSkillWorkflows;
|
|
153
|
-
//# sourceMappingURL=chunk-
|
|
154
|
-
//# sourceMappingURL=chunk-
|
|
153
|
+
//# sourceMappingURL=chunk-MEYQLQWS.cjs.map
|
|
154
|
+
//# sourceMappingURL=chunk-MEYQLQWS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","useCallback","useMemo","promptFieldName","jsx","ConnectedWorkflowStart","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillWorkflows"],"mappings":";;;;;;;;;;;AAiCA,IAAM,WAAA,GAAc,qDAAA;AAGb,SAAS,gBAAgB,KAAA,EAAsD;AACpF,EAAA,MAAM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,MAAsB;AAAA,MACjC,MAAM,CAAA,CAAE,EAAA;AAAA,MACR,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,OAAA,EAAS,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,KAAA,IAAS,EAAA;AAAA,MAC/B,UAAA,EAAY,QAAA;AAAA,MACZ,IAAA,EAAM;AAAA,KACR,CAAE,CAAA;AAAA,IACF,GAAG,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAqB;AAClC,MAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-A2YUBDCO.cjs","sourcesContent":["/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/connection/workflows/useSlashSkillWorkflows.tsx","../src/connection/conversation/useSlashItems.ts"],"names":["isSkillPackWorkflow","useWorkflowDefinitions","useBuiltinCommands","useState","useCallback","useMemo","promptFieldName","jsx","ConnectedWorkflowStart","useHostSkills","useUsableSkillListings","useSkillsEnabled","useNamedWorkflows","buildSlashItems","hostSkillItem","useCanBrowseSkills","parseSlashTokenInProgress","filterSlashItems","mergeSkillWorkflows"],"mappings":";;;;;;;;;;;AAiCA,IAAM,WAAA,GAAc,qDAAA;AAGb,SAAS,gBAAgB,KAAA,EAAsD;AACpF,EAAA,MAAM,CAAA,GAAI,WAAA,CAAY,IAAA,CAAK,KAAK,CAAA;AAChC,EAAA,OAAO,CAAA,GAAI,EAAE,IAAA,EAAM,CAAA,CAAE,CAAC,CAAA,CAAE,WAAA,EAAY,EAAG,IAAA,EAAA,CAAO,EAAE,CAAC,CAAA,IAAK,EAAA,EAAI,IAAA,IAAO,GAAI,IAAA;AACvE;AAMO,SAAS,YAAA,CAAa,UAA8B,aAAA,EAAiC;AAC1F,EAAA,OAAO,SAAS,GAAA,CAAI,IAAA,KAAS,QAAA,KAAa,aAAA,IAAiBA,sCAAoB,QAAQ,CAAA,CAAA;AACzF;AAQO,SAAS,sBAAA,CAAuB,EAAE,OAAA,EAAS,IAAA,EAAK,EAiBrD;AACA,EAAA,MAAM,EAAE,MAAA,EAAQ,aAAA,EAAc,GAAIC,wCAAA,EAAuB;AACzD,EAAA,MAAM,EAAE,QAAA,EAAS,GAAIC,wBAAA,EAAmB;AACxC,EAAA,MAAM,CAAC,MAAA,EAAQ,SAAS,CAAA,GAAIC,iBAA8C,IAAI,CAAA;AAG9E,EAAA,MAAM,IAAA,GAAOC,mBAAA;AAAA,IACX,CAAC,UAA0C,IAAA,KAA0B;AACnE,MAAA,IAAI,CAAC,QAAA,IAAY,CAAC,aAAa,QAAA,EAAU,aAAa,GAAG,OAAO,KAAA;AAChE,MAAA,SAAA,CAAU,EAAE,EAAA,EAAI,QAAA,CAAS,EAAA,EAAI,MAAM,CAAA;AACnC,MAAA,OAAO,IAAA;AAAA,IACT,CAAA;AAAA,IACA,CAAC,aAAa;AAAA,GAChB;AAEA,EAAA,MAAM,OAAA,GAAUA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EAAG,QAAQ,CAAA;AACzE,EAAA,MAAM,OAAA,GAAU,IAAI,GAAA,CAAI,QAAA,CAAS,GAAA,CAAI,CAAC,CAAA,KAAM,CAAC,CAAA,CAAE,IAAA,EAAM,CAAC,CAAC,CAAC,CAAA;AACxD,EAAA,OAAO;AAAA,IACL,GAAG,IAAA,CAAK,GAAA,CAAI,CAAC,CAAA,MAAsB;AAAA,MACjC,MAAM,CAAA,CAAE,EAAA;AAAA,MACR,aAAa,CAAA,CAAE,WAAA;AAAA,MACf,OAAA,EAAS,CAAA,CAAE,MAAA,CAAO,CAAC,GAAG,KAAA,IAAS,EAAA;AAAA,MAC/B,UAAA,EAAY,QAAA;AAAA,MACZ,IAAA,EAAM;AAAA,KACR,CAAE,CAAA;AAAA,IACF,GAAG,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA,KAAqB;AAClC,MAAA,MAAM,CAAA,GAAI,OAAA,CAAQ,GAAA,CAAI,CAAA,CAAE,EAAE,CAAA;AAC1B,MAAA,OAAO;AAAA,QACL,MAAM,CAAA,CAAE,EAAA;AAAA,QACR,WAAA,EAAa,GAAG,WAAA,KAAgB,CAAA,CAAE,UAAU,CAAA,CAAE,EAAA,GAAK,EAAE,KAAA,GAAQ,EAAA,CAAA;AAAA,QAC7D,OAAA,EAAS,GAAG,QAAA,IAAY,EAAA;AAAA,QACxB,UAAA,EAAY,CAAA,EAAG,UAAA,KAAe,QAAA,GAAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-MEYQLQWS.cjs","sourcesContent":["/**\n * Slash skills are launched prompt-first, through the one workflow launcher.\n *\n * A skill (or a prompt-style built-in such as Deep research) is run WITH a prompt, so it never\n * just executes:\n * - picking it in the slash menu opens its form (the prompt field first, focused, required);\n * - typing `/slug` and pressing Enter opens the same form with the field empty;\n * - typing `/slug some text` and pressing Enter opens it with the text already in the field.\n * The rule is the same for any recognised skill slug as the FIRST token of the draft; a backend\n * command (`/goal`, `/compact`, ...) is never a skill and is sent as typed. Nothing is sent from\n * the composer until the user starts it in the form. Without skills enabled (`show_skills`) this\n * applies to the host's skill packs only (`host.workflows.skillPacks`): the menu lists no other\n * skills and any other `/text` is sent as typed.\n *\n * The run lands where the surface says (`landing`), through the one launch handler. A chat that\n * is not the session's conversation (`ChatPage`, the document ask) passes `send`: the composed\n * prompt then goes to its own send, as a typed message would.\n */\n\nimport { useCallback, useMemo, useState, type ReactNode } from 'react'\nimport { promptFieldName } from '../../agents/workflows/workflow'\nimport { isSkillPackWorkflow } from '../../agents/workflows/skillPack'\nimport { type SlashMenuItem } from '../../chat/SlashMenu'\nimport {\n type WorkflowDefinition,\n type WorkflowInputs,\n type WorkflowLanding,\n} from '../../agents/workflows/types'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport { ConnectedWorkflowStart } from './ConnectedWorkflowStart'\nimport { useWorkflowDefinitions } from './useWorkflowDefinitions'\n\n/** `/slug` or `/slug rest of the line`: the first token and the text after it. */\nconst TYPED_SKILL = /^\\s*\\/([a-zA-Z0-9][a-zA-Z0-9_-]*)(?:\\s+([\\s\\S]*))?$/\n\n/** What the typed draft names: its slug (lower-cased) and the text after it (trimmed). */\nexport function parseTypedSkill(draft: string): { slug: string; text: string } | null {\n const m = TYPED_SKILL.exec(draft)\n return m ? { slug: m[1].toLowerCase(), text: (m[2] ?? '').trim() } : null\n}\n\n/**\n * Whether a skill opens its form from a menu (the `/` menus, the command palette): a prompt skill,\n * and with skills switched off (`show_skills`) only the host's packs. The one gate both share.\n */\nexport function canOpenSkill(workflow: WorkflowDefinition, skillsEnabled: boolean): boolean {\n return workflow.run.kind === 'prompt' && (skillsEnabled || isSkillPackWorkflow(workflow))\n}\n\nexport interface UseSlashSkillWorkflowsOptions {\n landing: WorkflowLanding\n /** Where the composed prompt goes, for a chat that is not the session's conversation. */\n send?: (prompt: string) => void\n}\n\nexport function useSlashSkillWorkflows({ landing, send }: UseSlashSkillWorkflowsOptions): {\n /** Opens the launcher for a picked menu item. True when it did (the caller then clears the draft). */\n openFor: (item: SlashMenuItem) => boolean\n /**\n * Opens the launcher for a typed `/slug text` draft, text pre-filled. True when the draft names\n * a skill (the caller then clears the draft and sends nothing).\n */\n openForDraft: (draft: string) => boolean\n /**\n * Opens the launcher for a skill by id (a surface listing the skills itself, the command\n * palette). True when it is a skill this person may run here.\n */\n openSkill: (id: string) => boolean\n /** The skills this person may open here: the host's packs, and the rest with `show_skills`. */\n openable: WorkflowDefinition[]\n /** Render once, anywhere in the surface that hosts the slash menu. */\n launcher: ReactNode\n} {\n const { skills, skillsEnabled } = useWorkflowDefinitions()\n const { commands } = useBuiltinCommands()\n const [active, setActive] = useState<{ id: string; text: string } | null>(null)\n\n // Stable while the lists are, so a surface can memoise what it builds on them.\n const open = useCallback(\n (workflow: WorkflowDefinition | undefined, text: string): boolean => {\n if (!workflow || !canOpenSkill(workflow, skillsEnabled)) return false\n setActive({ id: workflow.id, text })\n return true\n },\n [skillsEnabled]\n )\n\n const openFor = useCallback(\n (item: SlashMenuItem): boolean =>\n item.kind === 'skill' &&\n open(\n skills.find((w) => w.id === item.name),\n ''\n ),\n [open, skills]\n )\n\n const openSkill = useCallback(\n (id: string): boolean =>\n open(\n skills.find((w) => w.id === id),\n ''\n ),\n [open, skills]\n )\n\n const openable = useMemo(\n () => skills.filter((w) => canOpenSkill(w, skillsEnabled)),\n [skills, skillsEnabled]\n )\n\n const openForDraft = useCallback(\n (draft: string): boolean => {\n const typed = parseTypedSkill(draft)\n if (!typed) return false\n // A backend command wins a name collision, as in the menu: it is sent as typed.\n if (commands.some((c) => c.name.toLowerCase() === typed.slug)) return false\n return open(\n skills.find((w) => w.id.toLowerCase() === typed.slug),\n typed.text\n )\n },\n [open, skills, commands]\n )\n\n // Mounted only while a workflow is open: the ask bar lives in every page's topbar, so the\n // launcher's data hooks (files, agents, tasks) must not run until it is needed.\n const launcher = useMemo(() => {\n if (active === null) return null\n const initialInputsFor = (\n workflow: WorkflowDefinition\n ): Partial<WorkflowInputs> | undefined => {\n const field = promptFieldName(workflow)\n return field && active.text ? { [field]: active.text } : undefined\n }\n return (\n <ConnectedWorkflowStart\n workflows={skills}\n showTiles={false}\n landing={landing}\n send={send}\n activeId={active.id}\n onActiveIdChange={(id) => id === null && setActive(null)}\n initialInputsFor={initialInputsFor}\n />\n )\n }, [active, skills, landing, send])\n\n return { openFor, openForDraft, openSkill, openable, launcher }\n}\n","/**\n * The slash menu's data, in one place for every surface that hosts it (the chat composers, the\n * workspace ask bar, the document ask and `ChatPage`): the backend's built-in commands, the host's\n * skill packs and the user's skills, filtered by the slash token in progress. Commands and the\n * user's skills are typed `/<slug>` and dispatched by the backend; a skill opens its form\n * (`useSlashSkillWorkflows`).\n */\n\nimport { useMemo } from 'react'\nimport { useBuiltinCommands } from '@arbidocs/react'\nimport type { SlashMenuItem } from '../../chat/SlashMenu'\nimport { buildSlashItems, filterSlashItems, parseSlashToken } from '../../chat/slash-menu-helpers'\nimport { mergeSkillWorkflows } from '../../agents/workflows/workflow'\nimport type { WorkflowDefinition } from '../../agents/workflows/types'\nimport { useCanBrowseSkills, useSkillsEnabled } from '../workflows/useSkillsEnabled'\nimport { hostSkillItem, useHostSkills } from '../workflows/useHostSkills'\nimport { useUsableSkillListings } from '../workflows/useWorkflowDefinitions'\nimport { useNamedWorkflows } from '../workflows/useNamedWorkflows'\n\nconst NO_SKILLS: ReadonlyArray<WorkflowDefinition> = []\n\n/**\n * Every row of the menu, unfiltered: commands, then the host's packs (always: the host offers\n * them), then, for skills users (`show_skills`), the built-in skills and the user's own.\n *\n * @param builtinSkills The built-in skills to offer (prompt workflows offered as `/slug`), for a\n * surface that can open their form; default none.\n */\nexport function useSlashMenuItems(builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS): {\n items: SlashMenuItem[]\n /** The menu's \"Browse all\" footer opens the Skills browser: skills users, never guests. */\n canBrowseSkills: boolean\n} {\n const hostSkills = useHostSkills()\n const listings = useUsableSkillListings(hostSkills)\n const skillsEnabled = useSkillsEnabled()\n const { commands } = useBuiltinCommands()\n const builtins = useNamedWorkflows(builtinSkills)\n const items = useMemo<SlashMenuItem[]>(() => {\n const packSlugs = new Set(hostSkills.map((w) => w.id))\n return buildSlashItems(\n commands.map((c) => ({\n name: c.name,\n description: c.description,\n argHint: c.arg_hint,\n kind: 'command' as const,\n })),\n [\n ...hostSkills.map(hostSkillItem),\n ...(skillsEnabled\n ? skillItems(\n builtins.filter((w) => !packSlugs.has(w.id)),\n listings\n )\n : []),\n ]\n )\n }, [commands, hostSkills, listings, skillsEnabled, builtins])\n return { items, canBrowseSkills: useCanBrowseSkills() }\n}\n\n/**\n * @param text The draft.\n * @param builtinSkills The built-in skills (prompt workflows offered as `/slug`).\n */\nexport function useSlashItems(\n text: string,\n builtinSkills: ReadonlyArray<WorkflowDefinition> = NO_SKILLS\n) {\n const { items, canBrowseSkills } = useSlashMenuItems(builtinSkills)\n const slashToken = parseSlashToken(text)\n const filteredItems = useMemo(\n () => (slashToken !== null ? filterSlashItems(items, slashToken) : []),\n [items, slashToken]\n )\n return {\n slashToken,\n filteredItems,\n isOpen: slashToken !== null && filteredItems.length > 0,\n canBrowseSkills,\n }\n}\n\ntype SkillListings = ReturnType<typeof useUsableSkillListings>\n\n/**\n * Built-in skills share the list and the `/slug` path; a same-slug skill of the user's own shadows\n * the built-in, as on the backend.\n */\nfunction skillItems(\n builtinSkills: ReadonlyArray<WorkflowDefinition>,\n listings: SkillListings\n): SlashMenuItem[] {\n const { host, skills } = mergeSkillWorkflows([...builtinSkills], listings)\n const listing = new Map(listings.map((s) => [s.slug, s]))\n return [\n ...host.map((w): SlashMenuItem => ({\n name: w.id,\n description: w.description,\n argHint: w.inputs[0]?.label ?? '',\n visibility: 'global',\n kind: 'skill',\n })),\n ...skills.map((w): SlashMenuItem => {\n const s = listing.get(w.id)\n return {\n name: w.id,\n description: s?.description || (w.title !== w.id ? w.title : ''),\n argHint: s?.arg_hint ?? '',\n visibility: s?.visibility === 'global' ? 'global' : 'mine',\n kind: 'skill',\n }\n }),\n ]\n}\n"]}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkDGAGSP5G_cjs = require('./chunk-DGAGSP5G.cjs');
|
|
5
|
+
var chunkOOHBXCDV_cjs = require('./chunk-OOHBXCDV.cjs');
|
|
6
6
|
var chunkCT3SLXB7_cjs = require('./chunk-CT3SLXB7.cjs');
|
|
7
7
|
var jsxRuntime = require('react/jsx-runtime');
|
|
8
8
|
|
|
9
9
|
function AssistantToaster(props) {
|
|
10
|
-
const dock =
|
|
11
|
-
const { isDockAvailable } =
|
|
10
|
+
const dock = chunkDGAGSP5G_cjs.useAssistantDock();
|
|
11
|
+
const { isDockAvailable } = chunkOOHBXCDV_cjs.useChatSurface();
|
|
12
12
|
return /* @__PURE__ */ jsxRuntime.jsx(chunkCT3SLXB7_cjs.Toaster, { ...props, dockOpen: dock.isOpen && isDockAvailable });
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
exports.AssistantToaster = AssistantToaster;
|
|
16
|
-
//# sourceMappingURL=chunk-
|
|
17
|
-
//# sourceMappingURL=chunk-
|
|
16
|
+
//# sourceMappingURL=chunk-MSJGEZHL.cjs.map
|
|
17
|
+
//# sourceMappingURL=chunk-MSJGEZHL.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/chat/AssistantToaster.tsx"],"names":["useAssistantDock","useChatSurface","Toaster"],"mappings":";;;;;;;AAWO,SAAS,iBAAiB,KAAA,EAA8B;AAC7D,EAAA,MAAM,OAAOA,kCAAA,EAAiB;AAC9B,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAIC,gCAAA,EAAe;AAC3C,EAAA,sCAAQC,yBAAA,EAAA,EAAS,GAAG,OAAO,QAAA,EAAU,IAAA,CAAK,UAAU,eAAA,EAAiB,CAAA;AACvE","file":"chunk-
|
|
1
|
+
{"version":3,"sources":["../src/chat/AssistantToaster.tsx"],"names":["useAssistantDock","useChatSurface","Toaster"],"mappings":";;;;;;;AAWO,SAAS,iBAAiB,KAAA,EAA8B;AAC7D,EAAA,MAAM,OAAOA,kCAAA,EAAiB;AAC9B,EAAA,MAAM,EAAE,eAAA,EAAgB,GAAIC,gCAAA,EAAe;AAC3C,EAAA,sCAAQC,yBAAA,EAAA,EAAS,GAAG,OAAO,QAAA,EAAU,IAAA,CAAK,UAAU,eAAA,EAAiB,CAAA;AACvE","file":"chunk-MSJGEZHL.cjs","sourcesContent":["import { Toaster, type ShellToasterProps } from '../shell/Toaster'\nimport { useAssistantDock } from './assistant-dock-state'\nimport { useChatSurface } from './chat-surface'\n\nexport type AssistantToasterProps = Omit<ShellToasterProps, 'dockOpen'>\n\n/**\n * The shell `Toaster` wired to the assistant dock: while the dock is open (and offered: a mounted\n * page chat hides it) a right-aligned toast stack slides clear of it. Pass `dockWidth` when the\n * `AssistantDock` has a custom `width`.\n */\nexport function AssistantToaster(props: AssistantToasterProps) {\n const dock = useAssistantDock()\n const { isDockAvailable } = useChatSurface()\n return <Toaster {...props} dockOpen={dock.isOpen && isDockAvailable} />\n}\n"]}
|
|
@@ -456,6 +456,16 @@ function AllowanceBar({ allowance, label }) {
|
|
|
456
456
|
"data-slot": "usage-meter-plan-mark"
|
|
457
457
|
}
|
|
458
458
|
),
|
|
459
|
+
[...new Set(allowance.markers ?? [])].filter((value) => Number.isFinite(value) && value > 0 && value < scale).map((value) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
460
|
+
"div",
|
|
461
|
+
{
|
|
462
|
+
className: "absolute inset-y-0 w-px -translate-x-1/2 bg-foreground/50",
|
|
463
|
+
style: { left: `${pctOf(value, scale)}%` },
|
|
464
|
+
"aria-hidden": true,
|
|
465
|
+
"data-slot": "usage-meter-step"
|
|
466
|
+
},
|
|
467
|
+
value
|
|
468
|
+
)),
|
|
459
469
|
room > 0 && total > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
460
470
|
"div",
|
|
461
471
|
{
|
|
@@ -590,5 +600,5 @@ exports.usageMeterState = usageMeterState;
|
|
|
590
600
|
exports.useActiveGuidedRun = useActiveGuidedRun;
|
|
591
601
|
exports.useGuidedRuns = useGuidedRuns;
|
|
592
602
|
exports.useMountedSurface = useMountedSurface;
|
|
593
|
-
//# sourceMappingURL=chunk-
|
|
594
|
-
//# sourceMappingURL=chunk-
|
|
603
|
+
//# sourceMappingURL=chunk-NZNBJF3M.cjs.map
|
|
604
|
+
//# sourceMappingURL=chunk-NZNBJF3M.cjs.map
|