@arbidocs/blocks 0.5.132 → 0.5.134

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.
Files changed (330) hide show
  1. package/dist/{ConnectedCallDock-CJ7RWP5B.cjs → ConnectedCallDock-ZNS5BS2R.cjs} +22 -22
  2. package/dist/{ConnectedCallDock-CJ7RWP5B.cjs.map → ConnectedCallDock-ZNS5BS2R.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-JPJCXP6X.cjs → ConnectedCallRoom-ACNVSFH7.cjs} +14 -14
  4. package/dist/{ConnectedCallRoom-JPJCXP6X.cjs.map → ConnectedCallRoom-ACNVSFH7.cjs.map} +1 -1
  5. package/dist/ConnectedMailInviteCard-AJI7JZYJ.cjs +22 -0
  6. package/dist/{ConnectedMailInviteCard-EINB3THA.cjs.map → ConnectedMailInviteCard-AJI7JZYJ.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxComparison-5TZAIR4V.cjs → ConnectedNativeDocxComparison-H72RQJKH.cjs} +19 -19
  8. package/dist/{ConnectedNativeDocxComparison-5TZAIR4V.cjs.map → ConnectedNativeDocxComparison-H72RQJKH.cjs.map} +1 -1
  9. package/dist/{ConnectedPresentation-SEUUNFUA.cjs → ConnectedPresentation-3JXN6SRT.cjs} +19 -19
  10. package/dist/{ConnectedPresentation-SEUUNFUA.cjs.map → ConnectedPresentation-3JXN6SRT.cjs.map} +1 -1
  11. package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs → ConnectedProductionSetDialog-EOWZQ6J3.cjs} +9 -9
  12. package/dist/{ConnectedProductionSetDialog-LHB4VQWC.cjs.map → ConnectedProductionSetDialog-EOWZQ6J3.cjs.map} +1 -1
  13. package/dist/{ConnectedSlidesTab-3ATAKNSJ.cjs → ConnectedSlidesTab-IECS2MJI.cjs} +18 -18
  14. package/dist/{ConnectedSlidesTab-3ATAKNSJ.cjs.map → ConnectedSlidesTab-IECS2MJI.cjs.map} +1 -1
  15. package/dist/{ConnectedStreamedWordArtifact-BKPOMQ6G.cjs → ConnectedStreamedWordArtifact-T7PZIRBY.cjs} +19 -19
  16. package/dist/{ConnectedStreamedWordArtifact-BKPOMQ6G.cjs.map → ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map} +1 -1
  17. package/dist/{DocumentReviewCard-2VI5OOLE.cjs → DocumentReviewCard-EM2AJUF3.cjs} +22 -22
  18. package/dist/{DocumentReviewCard-2VI5OOLE.cjs.map → DocumentReviewCard-EM2AJUF3.cjs.map} +1 -1
  19. package/dist/{FilesViewerDialog-77YTFIX3.cjs → FilesViewerDialog-PA2B7O7I.cjs} +45 -45
  20. package/dist/{FilesViewerDialog-77YTFIX3.cjs.map → FilesViewerDialog-PA2B7O7I.cjs.map} +1 -1
  21. package/dist/{NativeDocxEditor-2PTEK6ND.cjs → NativeDocxEditor-XZAEU5QU.cjs} +8 -8
  22. package/dist/{NativeDocxEditor-2PTEK6ND.cjs.map → NativeDocxEditor-XZAEU5QU.cjs.map} +1 -1
  23. package/dist/{WorkspaceTableView-7BMZ2O3Y.cjs → WorkspaceTableView-HMQ6PXUC.cjs} +9 -9
  24. package/dist/{WorkspaceTableView-7BMZ2O3Y.cjs.map → WorkspaceTableView-HMQ6PXUC.cjs.map} +1 -1
  25. package/dist/agents/index.cjs +194 -194
  26. package/dist/{ai-4XJ2VFNS.cjs → ai-QEXZ4SYR.cjs} +25 -25
  27. package/dist/ai-QEXZ4SYR.cjs.map +1 -0
  28. package/dist/calls/index.cjs +118 -118
  29. package/dist/chat/index.cjs +30 -30
  30. package/dist/{chunk-PSIKUQYM.cjs → chunk-2FA7UVLG.cjs} +12 -12
  31. package/dist/{chunk-PSIKUQYM.cjs.map → chunk-2FA7UVLG.cjs.map} +1 -1
  32. package/dist/{chunk-ZYGAXD3N.cjs → chunk-2SWS7ESM.cjs} +3 -3
  33. package/dist/{chunk-ZYGAXD3N.cjs.map → chunk-2SWS7ESM.cjs.map} +1 -1
  34. package/dist/{chunk-YZ6YOOTF.cjs → chunk-32W2S6DE.cjs} +4 -4
  35. package/dist/{chunk-YZ6YOOTF.cjs.map → chunk-32W2S6DE.cjs.map} +1 -1
  36. package/dist/{chunk-IZBAWZTB.cjs → chunk-3RAW2ZH5.cjs} +8 -8
  37. package/dist/{chunk-IZBAWZTB.cjs.map → chunk-3RAW2ZH5.cjs.map} +1 -1
  38. package/dist/{chunk-MXBXZXXQ.cjs → chunk-3Y75LUCT.cjs} +4 -4
  39. package/dist/{chunk-MXBXZXXQ.cjs.map → chunk-3Y75LUCT.cjs.map} +1 -1
  40. package/dist/{chunk-PL7HUTM3.cjs → chunk-57LUHZLV.cjs} +8 -8
  41. package/dist/{chunk-PL7HUTM3.cjs.map → chunk-57LUHZLV.cjs.map} +1 -1
  42. package/dist/{chunk-MXGXKUSW.cjs → chunk-5GHGIDZP.cjs} +15 -15
  43. package/dist/{chunk-MXGXKUSW.cjs.map → chunk-5GHGIDZP.cjs.map} +1 -1
  44. package/dist/{chunk-Q6IKXWPG.cjs → chunk-64247UHS.cjs} +4 -4
  45. package/dist/{chunk-Q6IKXWPG.cjs.map → chunk-64247UHS.cjs.map} +1 -1
  46. package/dist/{chunk-HBUHOCWF.cjs → chunk-6CGMSJLB.cjs} +4 -4
  47. package/dist/{chunk-HBUHOCWF.cjs.map → chunk-6CGMSJLB.cjs.map} +1 -1
  48. package/dist/{chunk-VRK3IQAP.cjs → chunk-6RC6GYIW.cjs} +4 -4
  49. package/dist/{chunk-VRK3IQAP.cjs.map → chunk-6RC6GYIW.cjs.map} +1 -1
  50. package/dist/{chunk-VJCSEMXT.cjs → chunk-6THN5ZGA.cjs} +4 -4
  51. package/dist/{chunk-VJCSEMXT.cjs.map → chunk-6THN5ZGA.cjs.map} +1 -1
  52. package/dist/{chunk-ZESMRGDV.cjs → chunk-7NJKDJVO.cjs} +6 -6
  53. package/dist/{chunk-ZESMRGDV.cjs.map → chunk-7NJKDJVO.cjs.map} +1 -1
  54. package/dist/{chunk-SBWIA4PL.cjs → chunk-AGL7Z6Y2.cjs} +21 -21
  55. package/dist/{chunk-SBWIA4PL.cjs.map → chunk-AGL7Z6Y2.cjs.map} +1 -1
  56. package/dist/{chunk-PDDYAY4Z.cjs → chunk-BN33PC5F.cjs} +82 -82
  57. package/dist/{chunk-PDDYAY4Z.cjs.map → chunk-BN33PC5F.cjs.map} +1 -1
  58. package/dist/{chunk-TBPCG2PV.cjs → chunk-C5APAFUY.cjs} +224 -165
  59. package/dist/chunk-C5APAFUY.cjs.map +1 -0
  60. package/dist/{chunk-H7PHOTX2.cjs → chunk-C6RJQQLG.cjs} +10 -10
  61. package/dist/{chunk-H7PHOTX2.cjs.map → chunk-C6RJQQLG.cjs.map} +1 -1
  62. package/dist/{chunk-HQDR43JC.cjs → chunk-CENMN32L.cjs} +6 -6
  63. package/dist/{chunk-HQDR43JC.cjs.map → chunk-CENMN32L.cjs.map} +1 -1
  64. package/dist/{chunk-ULWRNGGE.cjs → chunk-CVPV4I7Z.cjs} +4 -3
  65. package/dist/chunk-CVPV4I7Z.cjs.map +1 -0
  66. package/dist/{chunk-QECKDZ47.cjs → chunk-CYN66TBO.cjs} +3 -3
  67. package/dist/chunk-CYN66TBO.cjs.map +1 -0
  68. package/dist/{chunk-B3BZ6MNI.cjs → chunk-DGAGSP5G.cjs} +6 -6
  69. package/dist/{chunk-B3BZ6MNI.cjs.map → chunk-DGAGSP5G.cjs.map} +1 -1
  70. package/dist/{chunk-325GVZE6.cjs → chunk-ECSOXKJQ.cjs} +6 -6
  71. package/dist/{chunk-325GVZE6.cjs.map → chunk-ECSOXKJQ.cjs.map} +1 -1
  72. package/dist/{chunk-GNZAH6UI.cjs → chunk-ETMSINQS.cjs} +6 -6
  73. package/dist/{chunk-GNZAH6UI.cjs.map → chunk-ETMSINQS.cjs.map} +1 -1
  74. package/dist/{chunk-SGYSDABK.cjs → chunk-EYXU32D7.cjs} +6 -6
  75. package/dist/{chunk-SGYSDABK.cjs.map → chunk-EYXU32D7.cjs.map} +1 -1
  76. package/dist/{chunk-UZHWXKS6.cjs → chunk-F6F375V7.cjs} +7 -7
  77. package/dist/{chunk-UZHWXKS6.cjs.map → chunk-F6F375V7.cjs.map} +1 -1
  78. package/dist/{chunk-ALK3PUUB.cjs → chunk-FYFL3CET.cjs} +25 -25
  79. package/dist/{chunk-ALK3PUUB.cjs.map → chunk-FYFL3CET.cjs.map} +1 -1
  80. package/dist/{chunk-IWHP7FAB.cjs → chunk-IFJBE7M5.cjs} +10 -10
  81. package/dist/{chunk-IWHP7FAB.cjs.map → chunk-IFJBE7M5.cjs.map} +1 -1
  82. package/dist/{chunk-AFXLRO6E.cjs → chunk-IN3KXI3K.cjs} +6 -6
  83. package/dist/{chunk-AFXLRO6E.cjs.map → chunk-IN3KXI3K.cjs.map} +1 -1
  84. package/dist/{chunk-MLA2BJ2Y.cjs → chunk-JYZ6UE5X.cjs} +28 -28
  85. package/dist/{chunk-MLA2BJ2Y.cjs.map → chunk-JYZ6UE5X.cjs.map} +1 -1
  86. package/dist/{chunk-QMIHLJMH.cjs → chunk-JZQ47OW5.cjs} +6 -6
  87. package/dist/{chunk-QMIHLJMH.cjs.map → chunk-JZQ47OW5.cjs.map} +1 -1
  88. package/dist/{chunk-VWTOIGX4.cjs → chunk-K3ZZ6IH3.cjs} +4 -4
  89. package/dist/{chunk-VWTOIGX4.cjs.map → chunk-K3ZZ6IH3.cjs.map} +1 -1
  90. package/dist/chunk-KWD5Q4XH.cjs +18 -0
  91. package/dist/{chunk-TDA6KESI.cjs.map → chunk-KWD5Q4XH.cjs.map} +1 -1
  92. package/dist/{chunk-ESVRVZ53.cjs → chunk-L4Y6UMRC.cjs} +5 -5
  93. package/dist/{chunk-ESVRVZ53.cjs.map → chunk-L4Y6UMRC.cjs.map} +1 -1
  94. package/dist/{chunk-YWHUWIHP.cjs → chunk-LFMOQALU.cjs} +75 -75
  95. package/dist/{chunk-YWHUWIHP.cjs.map → chunk-LFMOQALU.cjs.map} +1 -1
  96. package/dist/{chunk-VCEX7COE.cjs → chunk-LIDXIX36.cjs} +10 -5
  97. package/dist/chunk-LIDXIX36.cjs.map +1 -0
  98. package/dist/{chunk-TKHCIHE2.cjs → chunk-LIKDQBNJ.cjs} +7 -7
  99. package/dist/{chunk-TKHCIHE2.cjs.map → chunk-LIKDQBNJ.cjs.map} +1 -1
  100. package/dist/{chunk-ADDQKZ5I.cjs → chunk-LLD4PNBW.cjs} +4 -4
  101. package/dist/{chunk-ADDQKZ5I.cjs.map → chunk-LLD4PNBW.cjs.map} +1 -1
  102. package/dist/{chunk-2Z25MUAY.cjs → chunk-MEYQLQWS.cjs} +12 -12
  103. package/dist/{chunk-2Z25MUAY.cjs.map → chunk-MEYQLQWS.cjs.map} +1 -1
  104. package/dist/{chunk-H4ID6S4P.cjs → chunk-MSJGEZHL.cjs} +6 -6
  105. package/dist/{chunk-H4ID6S4P.cjs.map → chunk-MSJGEZHL.cjs.map} +1 -1
  106. package/dist/{chunk-ORELHENJ.cjs → chunk-NZNBJF3M.cjs} +12 -2
  107. package/dist/chunk-NZNBJF3M.cjs.map +1 -0
  108. package/dist/{chunk-KSDTK66A.cjs → chunk-O5WVYUFT.cjs} +20 -20
  109. package/dist/{chunk-KSDTK66A.cjs.map → chunk-O5WVYUFT.cjs.map} +1 -1
  110. package/dist/{chunk-P5AQYC4D.cjs → chunk-OA3AN6WW.cjs} +4 -4
  111. package/dist/{chunk-P5AQYC4D.cjs.map → chunk-OA3AN6WW.cjs.map} +1 -1
  112. package/dist/{chunk-A6GBPE5E.cjs → chunk-OOHBXCDV.cjs} +5 -5
  113. package/dist/{chunk-A6GBPE5E.cjs.map → chunk-OOHBXCDV.cjs.map} +1 -1
  114. package/dist/{chunk-DBN6GBRQ.cjs → chunk-OOW7H2YD.cjs} +14 -14
  115. package/dist/{chunk-DBN6GBRQ.cjs.map → chunk-OOW7H2YD.cjs.map} +1 -1
  116. package/dist/{chunk-JV5TVUOU.cjs → chunk-OUGRCQM7.cjs} +4 -4
  117. package/dist/{chunk-JV5TVUOU.cjs.map → chunk-OUGRCQM7.cjs.map} +1 -1
  118. package/dist/{chunk-JH6JTI76.cjs → chunk-OUYBYZ7Y.cjs} +6 -6
  119. package/dist/{chunk-JH6JTI76.cjs.map → chunk-OUYBYZ7Y.cjs.map} +1 -1
  120. package/dist/{chunk-TXP2N3DC.cjs → chunk-P7VUIW24.cjs} +6 -6
  121. package/dist/{chunk-TXP2N3DC.cjs.map → chunk-P7VUIW24.cjs.map} +1 -1
  122. package/dist/{chunk-OD6NGGL3.cjs → chunk-R5NTEW4L.cjs} +28 -28
  123. package/dist/{chunk-OD6NGGL3.cjs.map → chunk-R5NTEW4L.cjs.map} +1 -1
  124. package/dist/{chunk-SUOHAB7N.cjs → chunk-RSQGDXAF.cjs} +8 -8
  125. package/dist/{chunk-SUOHAB7N.cjs.map → chunk-RSQGDXAF.cjs.map} +1 -1
  126. package/dist/{chunk-U7KB42OQ.cjs → chunk-RZSBHRQL.cjs} +70 -70
  127. package/dist/{chunk-U7KB42OQ.cjs.map → chunk-RZSBHRQL.cjs.map} +1 -1
  128. package/dist/{chunk-YVCOQHCE.cjs → chunk-S5OGPQSB.cjs} +5 -5
  129. package/dist/{chunk-YVCOQHCE.cjs.map → chunk-S5OGPQSB.cjs.map} +1 -1
  130. package/dist/{chunk-ULPTSXXO.cjs → chunk-SD7GUB44.cjs} +4 -4
  131. package/dist/{chunk-ULPTSXXO.cjs.map → chunk-SD7GUB44.cjs.map} +1 -1
  132. package/dist/{chunk-ERRXU2HL.cjs → chunk-SK6LFIU2.cjs} +11 -11
  133. package/dist/{chunk-ERRXU2HL.cjs.map → chunk-SK6LFIU2.cjs.map} +1 -1
  134. package/dist/{chunk-23I5EUZA.cjs → chunk-T2DUNNYY.cjs} +4 -4
  135. package/dist/{chunk-23I5EUZA.cjs.map → chunk-T2DUNNYY.cjs.map} +1 -1
  136. package/dist/{chunk-E3Y7RI3J.cjs → chunk-T6WA6S5T.cjs} +4 -4
  137. package/dist/{chunk-E3Y7RI3J.cjs.map → chunk-T6WA6S5T.cjs.map} +1 -1
  138. package/dist/{chunk-XJE7W42L.cjs → chunk-TENWM7BH.cjs} +10 -13
  139. package/dist/chunk-TENWM7BH.cjs.map +1 -0
  140. package/dist/{chunk-XCW6OY7E.cjs → chunk-TOYKBRAU.cjs} +14 -14
  141. package/dist/{chunk-XCW6OY7E.cjs.map → chunk-TOYKBRAU.cjs.map} +1 -1
  142. package/dist/{chunk-FQRJCAT2.cjs → chunk-TXBXIUTX.cjs} +7 -7
  143. package/dist/{chunk-FQRJCAT2.cjs.map → chunk-TXBXIUTX.cjs.map} +1 -1
  144. package/dist/{chunk-7OPOPYV6.cjs → chunk-U6XMZG6G.cjs} +4 -4
  145. package/dist/{chunk-7OPOPYV6.cjs.map → chunk-U6XMZG6G.cjs.map} +1 -1
  146. package/dist/{chunk-4EK7TAP7.cjs → chunk-UOI6JJPG.cjs} +5 -5
  147. package/dist/{chunk-4EK7TAP7.cjs.map → chunk-UOI6JJPG.cjs.map} +1 -1
  148. package/dist/{chunk-TZYB22FM.cjs → chunk-UOZ237OW.cjs} +22 -22
  149. package/dist/{chunk-TZYB22FM.cjs.map → chunk-UOZ237OW.cjs.map} +1 -1
  150. package/dist/{chunk-QXMPATG6.cjs → chunk-UWTCK5IN.cjs} +14 -14
  151. package/dist/{chunk-QXMPATG6.cjs.map → chunk-UWTCK5IN.cjs.map} +1 -1
  152. package/dist/{chunk-HORAMB52.cjs → chunk-V6SFJ44C.cjs} +101 -101
  153. package/dist/{chunk-HORAMB52.cjs.map → chunk-V6SFJ44C.cjs.map} +1 -1
  154. package/dist/{chunk-NY3YUCOW.cjs → chunk-VCDD763Y.cjs} +4 -4
  155. package/dist/{chunk-NY3YUCOW.cjs.map → chunk-VCDD763Y.cjs.map} +1 -1
  156. package/dist/{chunk-BQ5RIWWT.cjs → chunk-VF26CUE3.cjs} +28 -28
  157. package/dist/{chunk-BQ5RIWWT.cjs.map → chunk-VF26CUE3.cjs.map} +1 -1
  158. package/dist/{chunk-5QERK4PK.cjs → chunk-VIUEPJ3Y.cjs} +42 -42
  159. package/dist/{chunk-5QERK4PK.cjs.map → chunk-VIUEPJ3Y.cjs.map} +1 -1
  160. package/dist/{chunk-7PN3YENO.cjs → chunk-VPKKPHJY.cjs} +4 -4
  161. package/dist/{chunk-7PN3YENO.cjs.map → chunk-VPKKPHJY.cjs.map} +1 -1
  162. package/dist/{chunk-CMGNRMPA.cjs → chunk-WNAZM2YS.cjs} +4 -4
  163. package/dist/{chunk-CMGNRMPA.cjs.map → chunk-WNAZM2YS.cjs.map} +1 -1
  164. package/dist/{chunk-7LEN65YI.cjs → chunk-X46QYO4S.cjs} +4 -4
  165. package/dist/{chunk-7LEN65YI.cjs.map → chunk-X46QYO4S.cjs.map} +1 -1
  166. package/dist/{chunk-5SKHK3BG.cjs → chunk-XZMYSDU4.cjs} +4 -4
  167. package/dist/{chunk-5SKHK3BG.cjs.map → chunk-XZMYSDU4.cjs.map} +1 -1
  168. package/dist/{chunk-JR2YSBD5.cjs → chunk-YKOPKLYP.cjs} +6 -6
  169. package/dist/{chunk-JR2YSBD5.cjs.map → chunk-YKOPKLYP.cjs.map} +1 -1
  170. package/dist/{chunk-JDFBEGQO.cjs → chunk-YZBDHBKI.cjs} +7 -7
  171. package/dist/chunk-YZBDHBKI.cjs.map +1 -0
  172. package/dist/{chunk-GNX3FBBX.cjs → chunk-ZM6B5WJW.cjs} +4 -4
  173. package/dist/{chunk-GNX3FBBX.cjs.map → chunk-ZM6B5WJW.cjs.map} +1 -1
  174. package/dist/{chunk-5UYFLFNR.cjs → chunk-ZOU6K6DD.cjs} +4 -4
  175. package/dist/{chunk-5UYFLFNR.cjs.map → chunk-ZOU6K6DD.cjs.map} +1 -1
  176. package/dist/{chunk-NM7RWZ4E.cjs → chunk-ZTHYJP4G.cjs} +21 -21
  177. package/dist/{chunk-NM7RWZ4E.cjs.map → chunk-ZTHYJP4G.cjs.map} +1 -1
  178. package/dist/citations/index.cjs +10 -10
  179. package/dist/collaboration/index.cjs +70 -70
  180. package/dist/components/UsageMeter.d.ts +2 -0
  181. package/dist/components/UsageMeter.js +10 -0
  182. package/dist/components/UsageMeter.js.map +2 -2
  183. package/dist/connect/docx.cjs +23 -23
  184. package/dist/connect/index.cjs +3231 -2462
  185. package/dist/connect/index.cjs.map +1 -1
  186. package/dist/connect/viewer.cjs +31 -31
  187. package/dist/connection/auth/ConnectedSsoCallback.js +21 -5
  188. package/dist/connection/auth/ConnectedSsoCallback.js.map +2 -2
  189. package/dist/connection/billing/AddAddonDialog.js +1 -1
  190. package/dist/connection/billing/AddAddonDialog.js.map +2 -2
  191. package/dist/connection/billing/BillingCard.d.ts +1 -1
  192. package/dist/connection/billing/BillingCard.js.map +1 -1
  193. package/dist/connection/billing/ChangePlanDialog.d.ts +1 -1
  194. package/dist/connection/billing/ChangePlanDialog.js +2 -5
  195. package/dist/connection/billing/ChangePlanDialog.js.map +2 -2
  196. package/dist/connection/billing/ChangeProPlan.js +2 -2
  197. package/dist/connection/billing/ChangeProPlan.js.map +2 -2
  198. package/dist/connection/billing/CollaboratorPlan.d.ts +2 -1
  199. package/dist/connection/billing/CollaboratorPlan.js +115 -52
  200. package/dist/connection/billing/CollaboratorPlan.js.map +2 -2
  201. package/dist/connection/billing/ConnectedSubscriptionSetup.d.ts +1 -0
  202. package/dist/connection/billing/ConnectedSubscriptionSetup.js +198 -0
  203. package/dist/connection/billing/ConnectedSubscriptionSetup.js.map +7 -0
  204. package/dist/connection/billing/ConnectedWelcomeDialog.d.ts +3 -13
  205. package/dist/connection/billing/ConnectedWelcomeDialog.js +26 -30
  206. package/dist/connection/billing/ConnectedWelcomeDialog.js.map +2 -2
  207. package/dist/connection/billing/InvoicesModal.js +2 -2
  208. package/dist/connection/billing/InvoicesModal.js.map +1 -1
  209. package/dist/connection/billing/ManualSubscriptionAdjustments.d.ts +12 -0
  210. package/dist/connection/billing/ManualSubscriptionAdjustments.js +424 -0
  211. package/dist/connection/billing/ManualSubscriptionAdjustments.js.map +7 -0
  212. package/dist/connection/billing/MonthlySpendCap.d.ts +3 -1
  213. package/dist/connection/billing/MonthlySpendCap.js +11 -7
  214. package/dist/connection/billing/MonthlySpendCap.js.map +2 -2
  215. package/dist/connection/billing/NewProjectFlow.d.ts +4 -1
  216. package/dist/connection/billing/NewProjectFlow.js +44 -37
  217. package/dist/connection/billing/NewProjectFlow.js.map +2 -2
  218. package/dist/connection/billing/PlanChangeLines.d.ts +1 -1
  219. package/dist/connection/billing/PlanChangeLines.js.map +1 -1
  220. package/dist/connection/billing/ProjectBilling.d.ts +3 -3
  221. package/dist/connection/billing/ProjectBilling.js +2 -2
  222. package/dist/connection/billing/ProjectBilling.js.map +2 -2
  223. package/dist/connection/billing/ProjectDetail.js +17 -2
  224. package/dist/connection/billing/ProjectDetail.js.map +2 -2
  225. package/dist/connection/billing/ProjectPurchaseOptions.d.ts +2 -14
  226. package/dist/connection/billing/ProjectPurchaseOptions.js +289 -440
  227. package/dist/connection/billing/ProjectPurchaseOptions.js.map +2 -2
  228. package/dist/connection/billing/ProjectUsageCard.js +4 -4
  229. package/dist/connection/billing/ProjectUsageCard.js.map +2 -2
  230. package/dist/connection/billing/SharedProjects.js +1 -1
  231. package/dist/connection/billing/SharedProjects.js.map +1 -1
  232. package/dist/connection/billing/StripeCheckoutModal.d.ts +2 -1
  233. package/dist/connection/billing/StripeCheckoutModal.js +20 -4
  234. package/dist/connection/billing/StripeCheckoutModal.js.map +2 -2
  235. package/dist/connection/billing/SubscriptionIntervalToggle.d.ts +9 -0
  236. package/dist/connection/billing/SubscriptionIntervalToggle.js +40 -0
  237. package/dist/connection/billing/SubscriptionIntervalToggle.js.map +7 -0
  238. package/dist/connection/billing/SubscriptionPlans.d.ts +3 -4
  239. package/dist/connection/billing/SubscriptionPlans.js +35 -112
  240. package/dist/connection/billing/SubscriptionPlans.js.map +2 -2
  241. package/dist/connection/billing/SubscriptionSetupDialog.d.ts +26 -0
  242. package/dist/connection/billing/SubscriptionSetupDialog.js +248 -0
  243. package/dist/connection/billing/SubscriptionSetupDialog.js.map +7 -0
  244. package/dist/connection/billing/addon-pricing.d.ts +2 -2
  245. package/dist/connection/billing/addon-pricing.js +2 -2
  246. package/dist/connection/billing/addon-pricing.js.map +1 -1
  247. package/dist/connection/billing/plan-pricing.d.ts +2 -2
  248. package/dist/connection/billing/plan-pricing.js +1 -1
  249. package/dist/connection/billing/plan-pricing.js.map +2 -2
  250. package/dist/connection/contacts/ConnectedWelcomeInvitations.js +11 -11
  251. package/dist/connection/contacts/ConnectedWelcomeInvitations.js.map +2 -2
  252. package/dist/connection/conversation/ConnectedConversationPage.js +1 -1
  253. package/dist/connection/conversation/ConnectedConversationPage.js.map +2 -2
  254. package/dist/connection/dialogs/ConnectedGlobalDialogs.js +9 -5
  255. package/dist/connection/dialogs/ConnectedGlobalDialogs.js.map +2 -2
  256. package/dist/connection/export/ConnectedExportPanel.js +1 -1
  257. package/dist/connection/export/ConnectedExportPanel.js.map +2 -2
  258. package/dist/connection/files/page/DocumentsUploadButton.js +1 -1
  259. package/dist/connection/files/page/DocumentsUploadButton.js.map +2 -2
  260. package/dist/connection/runtime/ConnectedAppRuntime.js.map +1 -1
  261. package/dist/connection/runtime/usePaymentReturn.js +62 -18
  262. package/dist/connection/runtime/usePaymentReturn.js.map +3 -3
  263. package/dist/connection/runtime/useWelcomeDialog.d.ts +0 -2
  264. package/dist/connection/runtime/useWelcomeDialog.js +11 -20
  265. package/dist/connection/runtime/useWelcomeDialog.js.map +2 -2
  266. package/dist/connection/sharing/WorkspaceMembersList.js.map +1 -1
  267. package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.d.ts +1 -1
  268. package/dist/connection/workspace-access/ConnectedGrantWorkspaceAccessDialog.js.map +1 -1
  269. package/dist/connection/workspace-list/WorkspaceCardsView.js +1 -1
  270. package/dist/connection/workspace-list/WorkspaceCardsView.js.map +1 -1
  271. package/dist/connection/workspace-list/projectBilling.d.ts +1 -1
  272. package/dist/connection/workspace-list/projectBilling.js.map +1 -1
  273. package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +2 -0
  274. package/dist/dashboards/index.cjs +24 -24
  275. package/dist/document-tools/index.cjs +26 -26
  276. package/dist/document-tools/viewer/SignatureRequestEditor.js +1 -1
  277. package/dist/document-tools/viewer/SignatureRequestEditor.js.map +2 -2
  278. package/dist/document-tools/viewer/index.cjs +12 -12
  279. package/dist/document-tools/viewer/index.cjs.map +1 -1
  280. package/dist/docx/index.cjs +40 -40
  281. package/dist/embed/index.cjs +34 -34
  282. package/dist/facts/index.cjs +46 -46
  283. package/dist/files/index.cjs +226 -226
  284. package/dist/home/index.cjs +34 -34
  285. package/dist/index.cjs +451 -451
  286. package/dist/provider/dialog-registry.d.ts +4 -0
  287. package/dist/provider/dialog-registry.js.map +2 -2
  288. package/dist/retrieval/index.cjs +6 -6
  289. package/dist/settings/Billing.d.ts +1 -1
  290. package/dist/settings/Billing.js.map +1 -1
  291. package/dist/settings/IdentityVerification.js +3 -3
  292. package/dist/settings/IdentityVerification.js.map +2 -2
  293. package/dist/settings/ModalScaffold.d.ts +3 -1
  294. package/dist/settings/ModalScaffold.js +2 -1
  295. package/dist/settings/ModalScaffold.js.map +2 -2
  296. package/dist/settings/PlanCard.d.ts +1 -1
  297. package/dist/settings/PlanCard.js +2 -2
  298. package/dist/settings/PlanCard.js.map +1 -1
  299. package/dist/settings/SubscriptionParts.js +1 -1
  300. package/dist/settings/SubscriptionParts.js.map +1 -1
  301. package/dist/settings/WelcomeDialog.d.ts +7 -3
  302. package/dist/settings/WelcomeDialog.js +194 -135
  303. package/dist/settings/WelcomeDialog.js.map +2 -2
  304. package/dist/settings/index.cjs +154 -154
  305. package/dist/shell/AccountBanners.d.ts +2 -7
  306. package/dist/shell/AccountBanners.js +9 -3
  307. package/dist/shell/AccountBanners.js.map +2 -2
  308. package/dist/shell/index.cjs +62 -62
  309. package/dist/studio/index.cjs +33 -33
  310. package/dist/styles.css +1 -1
  311. package/dist/workflow-canvas/index.cjs +51 -51
  312. package/dist/workspaces/WorkspaceGroup.d.ts +1 -1
  313. package/dist/workspaces/WorkspaceGroup.js.map +1 -1
  314. package/dist/workspaces/index.cjs +33 -33
  315. package/dist/workspaces/workspace-roles.d.ts +2 -2
  316. package/dist/workspaces/workspace-roles.js +1 -1
  317. package/dist/workspaces/workspace-roles.js.map +1 -1
  318. package/node_modules/@arbidocs/coedit/package.json +1 -1
  319. package/package.json +5 -5
  320. package/src/connection/billing/project-purchase.css +364 -9
  321. package/dist/ConnectedMailInviteCard-EINB3THA.cjs +0 -22
  322. package/dist/ai-4XJ2VFNS.cjs.map +0 -1
  323. package/dist/chunk-JDFBEGQO.cjs.map +0 -1
  324. package/dist/chunk-ORELHENJ.cjs.map +0 -1
  325. package/dist/chunk-QECKDZ47.cjs.map +0 -1
  326. package/dist/chunk-TBPCG2PV.cjs.map +0 -1
  327. package/dist/chunk-TDA6KESI.cjs +0 -18
  328. package/dist/chunk-ULWRNGGE.cjs.map +0 -1
  329. package/dist/chunk-VCEX7COE.cjs.map +0 -1
  330. package/dist/chunk-XJE7W42L.cjs.map +0 -1
@@ -4,19 +4,24 @@
4
4
  var chunk34HQO4ZQ_cjs = require('./chunk-34HQO4ZQ.cjs');
5
5
  var chunkKKYNTWDU_cjs = require('./chunk-KKYNTWDU.cjs');
6
6
  var chunkPLIF5CUV_cjs = require('./chunk-PLIF5CUV.cjs');
7
+ var react = require('react');
7
8
  var client = require('@arbidocs/client');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
- var react = require('react');
10
10
  var lucideReact = require('lucide-react');
11
11
  var ui = require('@arbidocs/react/ui');
12
12
  var shell = require('@arbidocs/react/shell');
13
13
 
14
- var DEFAULT_INSECURE_SESSION_BANNER_TEXT = "This connection is not secure (no HTTPS), so your session is kept in memory only and you will be signed out when you reload. Use https:// or localhost for a persistent, encrypted session.";
14
+ var DEFAULT_INSECURE_SESSION_BANNER_TEXT = "Temporary session \u2014 reloading requires sign-in.";
15
15
  function InsecureSessionBanner({
16
16
  text = DEFAULT_INSECURE_SESSION_BANNER_TEXT,
17
17
  className
18
18
  }) {
19
- if (client.canPersistSession()) return null;
19
+ const persistent = react.useSyncExternalStore(
20
+ client.subscribeSessionPersistence,
21
+ client.canPersistSession,
22
+ client.canPersistSession
23
+ );
24
+ if (persistent) return null;
20
25
  return /* @__PURE__ */ jsxRuntime.jsx(
21
26
  chunk34HQO4ZQ_cjs.Banner,
22
27
  {
@@ -272,5 +277,5 @@ exports.SplitLayout = SplitLayout;
272
277
  exports.initInstallPrompt = initInstallPrompt;
273
278
  exports.promptAppInstall = promptAppInstall;
274
279
  exports.useInstallPrompt = useInstallPrompt;
275
- //# sourceMappingURL=chunk-VCEX7COE.cjs.map
276
- //# sourceMappingURL=chunk-VCEX7COE.cjs.map
280
+ //# sourceMappingURL=chunk-LIDXIX36.cjs.map
281
+ //# sourceMappingURL=chunk-LIDXIX36.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/shell/AccountBanners.tsx","../src/shell/use-install-prompt.ts","../src/shell/InstallPrompt.tsx","../src/shell/SplitLayout.tsx"],"names":["useSyncExternalStore","subscribeSessionPersistence","canPersistSession","jsx","Banner","useState","useEffect","useCallback","isIosDevice","getInstallInstructions","jsxs","testIdOr","cn","Download","X"],"mappings":";;;;;;;;;;;;AAIO,IAAM,oCAAA,GACX;AAQK,SAAS,qBAAA,CAAsB;AAAA,EACpC,IAAA,GAAO,oCAAA;AAAA,EACP;AACF,CAAA,EAA+B;AAC7B,EAAA,MAAM,UAAA,GAAaA,0BAAA;AAAA,IACjBC,kCAAA;AAAA,IACAC,wBAAA;AAAA,IACAA;AAAA,GACF;AACA,EAAA,IAAI,YAAY,OAAO,IAAA;AACvB,EAAA,uBACEC,cAAA;AAAA,IAACC,wBAAA;AAAA,IAAA;AAAA,MACC,OAAA,EAAQ,OAAA;AAAA,MACR,IAAA,EAAK,SAAA;AAAA,MACL,IAAA;AAAA,MACA,SAAA;AAAA,MACA,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WAAA,EAAU,eAAA,EAAgB,WAAWS,KAAAA,CAAG,qBAAA,EAAuB,gBAAgB,CAAA,EACjF,QAAA,EAAA,OAAA,EACH;AAAA;AAAA;AAAA,GACF;AAEJ","file":"chunk-LIDXIX36.cjs","sourcesContent":["import { useSyncExternalStore } from 'react'\nimport { canPersistSession, subscribeSessionPersistence } from '@arbidocs/client'\nimport { Banner } from '../components/Banner'\n\nexport const DEFAULT_INSECURE_SESSION_BANNER_TEXT =\n 'Temporary session — reloading requires sign-in.'\n\nexport interface InsecureSessionBannerProps {\n text?: string\n className?: string\n}\n\n/** Warn when encrypted persistence is unavailable, including browser storage failures. */\nexport function InsecureSessionBanner({\n text = DEFAULT_INSECURE_SESSION_BANNER_TEXT,\n className,\n}: InsecureSessionBannerProps) {\n const persistent = useSyncExternalStore(\n subscribeSessionPersistence,\n canPersistSession,\n canPersistSession\n )\n if (persistent) return null\n return (\n <Banner\n variant=\"alert\"\n tone=\"warning\"\n text={text}\n className={className}\n testId=\"insecure-context-banner\"\n />\n )\n}\n\nexport const DEFAULT_ACCOUNT_DELETION_BANNER_TEXT = (date: string) =>\n `Account deletion requested on ${date}. Your account and all data will be permanently deleted shortly.`\n\nexport interface AccountDeletionBannerProps {\n /** When the user asked for the deletion (ISO timestamp, the user setting `deletion_requested_at`). */\n requestedAt: string\n /** The notice, given the formatted request date. */\n text?: (date: string) => string\n className?: string\n}\n\n/** The account is due for deletion: a standing notice until it goes. */\nexport function AccountDeletionBanner({\n requestedAt,\n text = DEFAULT_ACCOUNT_DELETION_BANNER_TEXT,\n className,\n}: AccountDeletionBannerProps) {\n const date = new Date(requestedAt).toLocaleDateString('en-US', {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n })\n return (\n <Banner\n variant=\"alert\"\n tone=\"destructive\"\n text={text(date)}\n className={className}\n testId=\"account-deletion-banner\"\n />\n )\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport { getInstallInstructions, isIosDevice, type InstallGuide } from './install-instructions'\n\n/** Non-standard Chromium event, not in lib.dom types. */\ninterface BeforeInstallPromptEvent extends Event {\n readonly platforms: string[]\n readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed'; platform: string }>\n prompt(): Promise<void>\n}\n\nlet deferredPrompt: BeforeInstallPromptEvent | null = null\nlet installed = false\nlet initialized = false\nlet autoPromptParam: string | null = null\n\nconst subscribers = new Set<() => void>()\nconst notify = () => subscribers.forEach((fn) => fn())\n\nfunction isStandalone(): boolean {\n if (typeof window === 'undefined') return false\n const iosStandalone = (navigator as Navigator & { standalone?: boolean }).standalone === true\n return window.matchMedia?.('(display-mode: standalone)').matches === true || iosStandalone\n}\n\nfunction wantsAutoPrompt(): boolean {\n if (!autoPromptParam) return false\n return new URLSearchParams(window.location.search).get(autoPromptParam) === 'true'\n}\n\nfunction onBeforeInstallPrompt(event: Event): void {\n event.preventDefault()\n deferredPrompt = event as BeforeInstallPromptEvent\n notify()\n if (wantsAutoPrompt()) void promptAppInstall()\n}\n\nfunction onAppInstalled(): void {\n installed = true\n deferredPrompt = null\n notify()\n}\n\n/**\n * Begin capturing install events. Idempotent. Chromium fires `beforeinstallprompt` once, early,\n * usually before a lazy route has mounted, so call this at app startup (before the first render);\n * `useInstallPrompt` also calls it, which is enough when the hook mounts at the root.\n *\n * `options.autoPromptParam`: a share link `/?{param}=true` opens the native dialog as soon as the\n * browser is ready (Chromium).\n */\nexport function initInstallPrompt(options: { autoPromptParam?: string } = {}): void {\n if (options.autoPromptParam) autoPromptParam = options.autoPromptParam\n if (initialized || typeof window === 'undefined') return\n initialized = true\n installed = isStandalone()\n\n window.addEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.addEventListener('appinstalled', onAppInstalled)\n}\n\n/**\n * Open the browser's install dialog if one was captured. Returns false when there is none (the\n * caller then shows {@link getInstallInstructions}). A captured prompt works once.\n */\nexport async function promptAppInstall(): Promise<boolean> {\n if (!deferredPrompt) return false\n const prompt = deferredPrompt\n deferredPrompt = null\n notify()\n try {\n await prompt.prompt()\n } catch {\n // The user dismissed it or the browser rejected it: nothing actionable.\n }\n return true\n}\n\n/** Default storage key of the remembered dismissal. */\nexport const INSTALL_PROMPT_DISMISSED_KEY = 'arbi-blocks:install-prompt-dismissed'\nconst DAY_MS = 24 * 60 * 60 * 1000\n\nfunction readDismissedAt(key: string): number | null {\n try {\n const raw = window.localStorage.getItem(key)\n const at = raw ? Number(raw) : NaN\n return Number.isFinite(at) ? at : null\n } catch {\n return null\n }\n}\n\nexport interface UseInstallPromptOptions {\n /** localStorage key remembering a dismissal. */\n storageKey?: string\n /** Days a dismissal is remembered. Default 30. */\n dismissDays?: number\n /** Query param that turns a share link into a one-click install (`install` for `?install=true`). */\n autoPromptParam?: string\n /** App name used in the manual instructions. */\n appName?: string\n}\n\nexport interface UseInstallPromptResult {\n /** A native install dialog can be opened right now (Chromium, once the event fired). */\n canPrompt: boolean\n /** Running as an installed app, or `appinstalled` fired. */\n isInstalled: boolean\n /** iOS has no install API: offer manual instructions instead. */\n isIos: boolean\n /** The user dismissed the offer (remembered across visits). */\n isDismissed: boolean\n /** Open the native dialog; false when none is available. */\n promptInstall: () => Promise<boolean>\n /** Hide the offer and remember it. */\n dismiss: () => void\n /** Manual steps for this browser. */\n instructions: InstallGuide\n}\n\n/** The install state of the app, framework-neutral logic behind `InstallPrompt`. */\nexport function useInstallPrompt({\n storageKey = INSTALL_PROMPT_DISMISSED_KEY,\n dismissDays = 30,\n autoPromptParam: autoParam,\n appName,\n}: UseInstallPromptOptions = {}): UseInstallPromptResult {\n const [, forceRender] = useState(0)\n const [dismissedAt, setDismissedAt] = useState<number | null>(() =>\n typeof window === 'undefined' ? null : readDismissedAt(storageKey)\n )\n\n useEffect(() => {\n initInstallPrompt({ autoPromptParam: autoParam })\n const onChange = () => forceRender((n) => n + 1)\n subscribers.add(onChange)\n // The singleton may have started before this mount: pick up the current state.\n onChange()\n return () => {\n subscribers.delete(onChange)\n }\n }, [autoParam])\n\n const dismiss = useCallback(() => {\n const now = Date.now()\n setDismissedAt(now)\n try {\n window.localStorage.setItem(storageKey, String(now))\n } catch {\n // Storage blocked: the dismissal lasts for this page view only.\n }\n }, [storageKey])\n\n const isDismissed = dismissedAt !== null && Date.now() - dismissedAt < dismissDays * DAY_MS\n const isInstalled = installed || isStandalone()\n return {\n canPrompt: !isInstalled && deferredPrompt !== null,\n isInstalled,\n isIos: isIosDevice(),\n isDismissed,\n promptInstall: promptAppInstall,\n dismiss,\n instructions: getInstallInstructions({ appName }),\n }\n}\n\n/** Test seam: forget captured state (the singleton lives for the page). */\nexport function resetInstallPromptForTests(): void {\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.removeEventListener('appinstalled', onAppInstalled)\n }\n deferredPrompt = null\n installed = false\n initialized = false\n autoPromptParam = null\n subscribers.clear()\n}\n","import { useState } from 'react'\nimport { Download, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { useInstallPrompt, type UseInstallPromptOptions } from './use-install-prompt'\n\n/** Fixed strings of the install prompt. */\nexport interface InstallPromptLabels {\n /** The pill's text. */\n install: string\n /** The dismiss button's accessible name. */\n dismiss: string\n /** Accessible name of the pill (`{app}` is replaced by `appName`). */\n installAs: string\n}\n\nexport const DEFAULT_INSTALL_PROMPT_LABELS: InstallPromptLabels = {\n install: 'Install app',\n dismiss: 'Dismiss install prompt',\n installAs: 'Install {app} as an app',\n}\n\nexport interface InstallPromptProps extends UseInstallPromptOptions {\n labels?: Partial<InstallPromptLabels>\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * A small floating \"Install app\" pill. Renders only while the app can be installed (the browser\n * fired `beforeinstallprompt`, or on iOS where it shows the Add to Home Screen steps), is not\n * already installed, and was not dismissed (the dismissal is remembered for `dismissDays`).\n *\n * It sits above whatever is pinned to the bottom of the screen: it reads `--shell-bottom-inset`\n * (set by `MobileTabBar` and the chat composer, see `useShellBottomInset`) plus the device\n * safe area, so it never covers the tab bar or the composer. It sits in the bottom start corner\n * (clear of a bottom-right toaster) and clears a docked `Sidebar` (`--shell-start-inset`). Both\n * controls are 44px tall on a phone.\n */\nexport function InstallPrompt({\n labels,\n className,\n 'data-testid': testId,\n ...options\n}: InstallPromptProps) {\n const l = { ...DEFAULT_INSTALL_PROMPT_LABELS, ...labels }\n const install = useInstallPrompt(options)\n const [showSteps, setShowSteps] = useState(false)\n\n const isOffer = install.canPrompt || install.isIos\n if (install.isInstalled || install.isDismissed || !isOffer) return null\n\n const appName = options.appName ?? 'this app'\n const onInstall = async () => {\n if (install.canPrompt) await install.promptInstall()\n else setShowSteps((open) => !open)\n }\n\n return (\n <div\n data-slot=\"install-prompt\"\n data-testid={testIdOr(testId, { testId: 'install-app-prompt' })}\n className={cn(\n 'fixed z-30 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2',\n // Above the bottom bars (tab bar / composer) and the home indicator on a phone, a plain\n // corner offset from `sm` up where the tab bar is gone.\n 'bottom-[calc(max(var(--shell-bottom-inset,0px),env(safe-area-inset-bottom,0px))+0.75rem)] sm:bottom-[calc(env(safe-area-inset-bottom,0px)+0.75rem)]',\n // From `sm` up, clear of a docked sidebar (its footer holds the account menu).\n 'left-3 items-start sm:left-[calc(var(--shell-start-inset,0px)+0.75rem)]',\n className\n )}\n >\n {showSteps && (\n <div\n data-slot=\"install-prompt-steps\"\n className=\"w-72 max-w-full rounded-lg border border-border bg-card p-3 text-sm text-card-foreground shadow-lg\"\n >\n <p className=\"font-medium\">{install.instructions.heading}</p>\n <ol className=\"mt-2 list-decimal space-y-1 pl-5 text-muted-foreground\">\n {install.instructions.steps.map((step) => (\n <li key={step}>{step}</li>\n ))}\n </ol>\n </div>\n )}\n <div className=\"inline-flex items-center rounded-full border border-border bg-card/95 text-foreground shadow-sm backdrop-blur\">\n <button\n type=\"button\"\n onClick={() => void onInstall()}\n aria-label={l.installAs.replace('{app}', appName)}\n aria-expanded={install.canPrompt ? undefined : showSteps}\n data-slot=\"install-prompt-action\"\n className=\"inline-flex min-h-11 items-center gap-1.5 rounded-full pl-4 pr-2 text-xs font-medium transition-colors hover:bg-accent sm:min-h-9 sm:pl-3\"\n >\n <Download className=\"size-3.5\" aria-hidden=\"true\" />\n {l.install}\n </button>\n <button\n type=\"button\"\n onClick={install.dismiss}\n aria-label={l.dismiss}\n data-slot=\"install-prompt-dismiss\"\n className=\"inline-flex size-11 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground sm:size-9\"\n >\n <X className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface SplitLayoutProps {\n /** The main pane (the detail, the form, the transcript): takes the remaining width. */\n primary: ReactNode\n /**\n * The side pane (the picker, the launcher): 20rem wide at the start once side by side, on top\n * when stacked.\n */\n secondary: ReactNode\n className?: string\n primaryClassName?: string\n secondaryClassName?: string\n testId?: string\n}\n\n/**\n * Two panes (list and detail, form and preview) that stack by the width of their CONTAINER,\n * not the viewport: side by side from 48rem of container width, stacked below. Inside\n * `Shell.Content` / `PageContainer` (both are containers) an open dock or a narrow window\n * therefore stacks the panes instead of squeezing the main one to a sliver. Every pane has\n * `min-w-0`, so long words and wide tables shrink instead of stretching the grid.\n */\nexport function SplitLayout({\n primary,\n secondary,\n className,\n primaryClassName,\n secondaryClassName,\n testId = 'split-layout',\n}: SplitLayoutProps) {\n return (\n <div\n data-slot=\"split-layout\"\n data-testid={testId}\n className={cn('flex flex-col gap-6 @3xl:flex-row @3xl:items-start', className)}\n >\n <div\n data-slot=\"split-secondary\"\n className={cn('min-w-0 @3xl:w-80 @3xl:shrink-0', secondaryClassName)}\n >\n {secondary}\n </div>\n <div data-slot=\"split-primary\" className={cn('min-w-0 @3xl:flex-1', primaryClassName)}>\n {primary}\n </div>\n </div>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkJDFBEGQO_cjs = require('./chunk-JDFBEGQO.cjs');
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: chunkJDFBEGQO_cjs.confirmDialog,
110
- choose: chunkJDFBEGQO_cjs.choiceDialog,
111
- openDialog: chunkJDFBEGQO_cjs.openDialog,
112
- closeDialog: chunkJDFBEGQO_cjs.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-TKHCIHE2.cjs.map
207
- //# sourceMappingURL=chunk-TKHCIHE2.cjs.map
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,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,YAAA,CAAa,IAAI,OAAO,CAAA;AAAA,IAC1B,CAAC,CAAA;AAAA,IACD,qBACE,eAAA,CAAgB,WAAA,CAAY,qBAAqB,CAAC,mBAAA,KAAwB,CAAC,OAAA,KAAY;AACrF,MAAA,mBAAA,CAAoB,OAAO,CAAA;AAE3B,MAAA,MAAM,MAAA,GAAS,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAK;AACrC,MAAA,IAAI,MAAA,EAAQ,wBAAA,CAAyB,OAAA,CAAQ,MAAM,CAAA;AAAA,IACrD,CAAC,CAAA,IAAK;AAAA,GACV;AACA,EAAA,QAAA,CAAS,IAAI,KAAK,CAAA;AAClB,EAAA,OAAO,KAAA;AACT;AAQO,SAAS,wBACd,WAAA,EACmB;AACnB,EAAA,IAAI,QAAA,CAAS,GAAA,CAAI,WAAgC,CAAA,EAAG,OAAO,WAAA;AAC3D,EAAA,IAAI,KAAA,GAAQ,QAAA,CAAS,GAAA,CAAI,WAAW,CAAA;AACpC,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,GAAA,CAAI,aAAc,KAAA,GAAQ,OAAA,CAAQ,WAAW,CAAE,CAAA;AACpE,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,oBAAA,GAA0C;AACxD,EAAA,MAAM,WAAA,GAAcC,2BAAoB,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-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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A,EAAQ,OAAA,EAAS,MAAA,EAAQ,CAAA;AAC5F,MAAA,YAAA,CAAa,IAAI,OAAO,CAAA;AAAA,IAC1B,CAAC,CAAA;AAAA,IACD,qBACE,eAAA,CAAgB,WAAA,CAAY,qBAAqB,CAAC,mBAAA,KAAwB,CAAC,OAAA,KAAY;AACrF,MAAA,mBAAA,CAAoB,OAAO,CAAA;AAE3B,MAAA,MAAM,MAAA,GAAS,OAAA,EAAS,MAAA,EAAQ,IAAA,EAAK;AACrC,MAAA,IAAI,MAAA,EAAQ,wBAAA,CAAyB,OAAA,CAAQ,MAAM,CAAA;AAAA,IACrD,CAAC,CAAA,IAAK;AAAA,GACV;AACA,EAAA,QAAA,CAAS,IAAI,KAAK,CAAA;AAClB,EAAA,OAAO,KAAA;AACT;AAQO,SAAS,wBACd,WAAA,EACmB;AACnB,EAAA,IAAI,QAAA,CAAS,GAAA,CAAI,WAAgC,CAAA,EAAG,OAAO,WAAA;AAC3D,EAAA,IAAI,KAAA,GAAQ,QAAA,CAAS,GAAA,CAAI,WAAW,CAAA;AACpC,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,GAAA,CAAI,aAAc,KAAA,GAAQ,OAAA,CAAQ,WAAW,CAAE,CAAA;AACpE,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,oBAAA,GAA0C;AACxD,EAAA,MAAM,WAAA,GAAcC,2BAAoB,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 chunkALK3PUUB_cjs = require('./chunk-ALK3PUUB.cjs');
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: chunkALK3PUUB_cjs.DOCUMENTS_ROW_HEIGHT_INITIAL,
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-ADDQKZ5I.cjs.map
125
- //# sourceMappingURL=chunk-ADDQKZ5I.cjs.map
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,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,G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A,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-ADDQKZ5I.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,E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AC,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-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,8 +1,8 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkXCW6OY7E_cjs = require('./chunk-XCW6OY7E.cjs');
5
- var chunkHBUHOCWF_cjs = require('./chunk-HBUHOCWF.cjs');
4
+ var chunkTOYKBRAU_cjs = require('./chunk-TOYKBRAU.cjs');
5
+ var chunk6CGMSJLB_cjs = require('./chunk-6CGMSJLB.cjs');
6
6
  var chunk5A6T4W46_cjs = require('./chunk-5A6T4W46.cjs');
7
7
  var chunk5F4DCIHS_cjs = require('./chunk-5F4DCIHS.cjs');
8
8
  var chunkJN5YMHGI_cjs = require('./chunk-JN5YMHGI.cjs');
@@ -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 } = chunkHBUHOCWF_cjs.useWorkflowDefinitions();
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
- chunkXCW6OY7E_cjs.ConnectedWorkflowStart,
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 = chunkHBUHOCWF_cjs.useHostSkills();
87
- const listings = chunkHBUHOCWF_cjs.useUsableSkillListings(hostSkills);
88
- const skillsEnabled = chunkHBUHOCWF_cjs.useSkillsEnabled();
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 = chunkHBUHOCWF_cjs.useNamedWorkflows(builtinSkills);
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(chunkHBUHOCWF_cjs.hostSkillItem),
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: chunkHBUHOCWF_cjs.useCanBrowseSkills() };
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-2Z25MUAY.cjs.map
154
- //# sourceMappingURL=chunk-2Z25MUAY.cjs.map
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,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,C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AAW,QAAA,GAAW,MAAA;AAAA,QACpD,IAAA,EAAM;AAAA,OACR;AAAA,IACF,CAAC;AAAA,GACH;AACF","file":"chunk-2Z25MUAY.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,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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 chunkB3BZ6MNI_cjs = require('./chunk-B3BZ6MNI.cjs');
5
- var chunkA6GBPE5E_cjs = require('./chunk-A6GBPE5E.cjs');
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 = chunkB3BZ6MNI_cjs.useAssistantDock();
11
- const { isDockAvailable } = chunkA6GBPE5E_cjs.useChatSurface();
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-H4ID6S4P.cjs.map
17
- //# sourceMappingURL=chunk-H4ID6S4P.cjs.map
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-H4ID6S4P.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"]}
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-ORELHENJ.cjs.map
594
- //# sourceMappingURL=chunk-ORELHENJ.cjs.map
603
+ //# sourceMappingURL=chunk-NZNBJF3M.cjs.map
604
+ //# sourceMappingURL=chunk-NZNBJF3M.cjs.map