@arbidocs/blocks 0.5.150 → 0.5.152

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 (301) hide show
  1. package/dist/{ConnectedCallDock-L3QIWXAA.cjs → ConnectedCallDock-SD4DKTMX.cjs} +28 -28
  2. package/dist/{ConnectedCallDock-L3QIWXAA.cjs.map → ConnectedCallDock-SD4DKTMX.cjs.map} +1 -1
  3. package/dist/{ConnectedCallRoom-S7INF4I5.cjs → ConnectedCallRoom-2FLGH3JB.cjs} +20 -20
  4. package/dist/{ConnectedCallRoom-S7INF4I5.cjs.map → ConnectedCallRoom-2FLGH3JB.cjs.map} +1 -1
  5. package/dist/{ConnectedMailInviteCard-ITMZRPIP.cjs → ConnectedMailInviteCard-VMFTQ5PW.cjs} +6 -6
  6. package/dist/{ConnectedMailInviteCard-ITMZRPIP.cjs.map → ConnectedMailInviteCard-VMFTQ5PW.cjs.map} +1 -1
  7. package/dist/{ConnectedNativeDocxComparison-BVECWYJ5.cjs → ConnectedNativeDocxComparison-244UIHSM.cjs} +22 -22
  8. package/dist/{ConnectedNativeDocxComparison-BVECWYJ5.cjs.map → ConnectedNativeDocxComparison-244UIHSM.cjs.map} +1 -1
  9. package/dist/{ConnectedPresentation-F6NYQ2X7.cjs → ConnectedPresentation-JUXIXKYN.cjs} +27 -26
  10. package/dist/ConnectedPresentation-JUXIXKYN.cjs.map +1 -0
  11. package/dist/{ConnectedProductionSetDialog-T5J4YLA7.cjs → ConnectedProductionSetDialog-LB5B7OXR.cjs} +11 -11
  12. package/dist/{ConnectedProductionSetDialog-T5J4YLA7.cjs.map → ConnectedProductionSetDialog-LB5B7OXR.cjs.map} +1 -1
  13. package/dist/{ConnectedSlidesTab-WY6JCGWZ.cjs → ConnectedSlidesTab-JA3VB66W.cjs} +22 -21
  14. package/dist/ConnectedSlidesTab-JA3VB66W.cjs.map +1 -0
  15. package/dist/{ConnectedStreamedWordArtifact-ELNWWKZD.cjs → ConnectedStreamedWordArtifact-V6BRZMEQ.cjs} +22 -22
  16. package/dist/{ConnectedStreamedWordArtifact-ELNWWKZD.cjs.map → ConnectedStreamedWordArtifact-V6BRZMEQ.cjs.map} +1 -1
  17. package/dist/{DocumentReviewCard-KV2B7BD3.cjs → DocumentReviewCard-5W2QQWKA.cjs} +22 -22
  18. package/dist/{DocumentReviewCard-KV2B7BD3.cjs.map → DocumentReviewCard-5W2QQWKA.cjs.map} +1 -1
  19. package/dist/{FilesViewerDialog-HJABYPOA.cjs → FilesViewerDialog-63QUTG4L.cjs} +57 -57
  20. package/dist/{FilesViewerDialog-HJABYPOA.cjs.map → FilesViewerDialog-63QUTG4L.cjs.map} +1 -1
  21. package/dist/{RechartsRenderer-NRLQZSSY.cjs → RechartsRenderer-NU6WUZJS.cjs} +21 -20
  22. package/dist/RechartsRenderer-NU6WUZJS.cjs.map +1 -0
  23. package/dist/{SpotlightStrip-QQ2WUI32.cjs → SpotlightStrip-HXQFPAAL.cjs} +6 -5
  24. package/dist/SpotlightStrip-HXQFPAAL.cjs.map +1 -0
  25. package/dist/{WorkspaceTableView-XXCJ7LBO.cjs → WorkspaceTableView-2QP2HJLK.cjs} +9 -9
  26. package/dist/{WorkspaceTableView-XXCJ7LBO.cjs.map → WorkspaceTableView-2QP2HJLK.cjs.map} +1 -1
  27. package/dist/agents/index.cjs +304 -304
  28. package/dist/{ai-RKRKOYO4.cjs → ai-ODGRIL6Y.cjs} +29 -29
  29. package/dist/ai-ODGRIL6Y.cjs.map +1 -0
  30. package/dist/auth/index.cjs +11 -11
  31. package/dist/calls/connected/ConnectedCallChatHistory.d.ts +1 -1
  32. package/dist/calls/connected/ConnectedCallChatHistory.js +55 -45
  33. package/dist/calls/connected/ConnectedCallChatHistory.js.map +2 -2
  34. package/dist/calls/index.cjs +148 -148
  35. package/dist/chat/index.cjs +30 -30
  36. package/dist/{chunk-F4ULSAOA.cjs → chunk-2P7VH2SK.cjs} +5 -5
  37. package/dist/chunk-2P7VH2SK.cjs.map +1 -0
  38. package/dist/{chunk-NWU2QMW4.cjs → chunk-2QLO3HBN.cjs} +6 -6
  39. package/dist/{chunk-NWU2QMW4.cjs.map → chunk-2QLO3HBN.cjs.map} +1 -1
  40. package/dist/{chunk-6IS6TZ7F.cjs → chunk-2XHJVYNY.cjs} +4 -4
  41. package/dist/{chunk-6IS6TZ7F.cjs.map → chunk-2XHJVYNY.cjs.map} +1 -1
  42. package/dist/{chunk-SK6BONXE.cjs → chunk-36NQMOJE.cjs} +6 -6
  43. package/dist/{chunk-SK6BONXE.cjs.map → chunk-36NQMOJE.cjs.map} +1 -1
  44. package/dist/{chunk-7Q46YAX4.cjs → chunk-3CJTO6RV.cjs} +152 -199
  45. package/dist/chunk-3CJTO6RV.cjs.map +1 -0
  46. package/dist/{chunk-JOYB727S.cjs → chunk-3GQQUR27.cjs} +4 -4
  47. package/dist/{chunk-JOYB727S.cjs.map → chunk-3GQQUR27.cjs.map} +1 -1
  48. package/dist/{chunk-VMXTOIXB.cjs → chunk-46LX6EQT.cjs} +7 -7
  49. package/dist/{chunk-VMXTOIXB.cjs.map → chunk-46LX6EQT.cjs.map} +1 -1
  50. package/dist/{chunk-AUEFLW3V.cjs → chunk-4I2PCP7O.cjs} +69 -69
  51. package/dist/{chunk-AUEFLW3V.cjs.map → chunk-4I2PCP7O.cjs.map} +1 -1
  52. package/dist/{chunk-P65JMN57.cjs → chunk-4XNP27N4.cjs} +40 -40
  53. package/dist/{chunk-P65JMN57.cjs.map → chunk-4XNP27N4.cjs.map} +1 -1
  54. package/dist/{chunk-NVECYF2N.cjs → chunk-4ZR4O5SP.cjs} +28 -10
  55. package/dist/chunk-4ZR4O5SP.cjs.map +1 -0
  56. package/dist/{chunk-YRU6ZJUW.cjs → chunk-5DGNJ6VJ.cjs} +14 -14
  57. package/dist/{chunk-YRU6ZJUW.cjs.map → chunk-5DGNJ6VJ.cjs.map} +1 -1
  58. package/dist/{chunk-7KSOMWCS.cjs → chunk-5GBM7BQB.cjs} +4 -4
  59. package/dist/{chunk-7KSOMWCS.cjs.map → chunk-5GBM7BQB.cjs.map} +1 -1
  60. package/dist/{chunk-FPSHZW4W.cjs → chunk-6XKQAQWF.cjs} +4 -4
  61. package/dist/{chunk-FPSHZW4W.cjs.map → chunk-6XKQAQWF.cjs.map} +1 -1
  62. package/dist/{chunk-UBKJNCWY.cjs → chunk-6ZZWQ3OL.cjs} +24 -24
  63. package/dist/{chunk-UBKJNCWY.cjs.map → chunk-6ZZWQ3OL.cjs.map} +1 -1
  64. package/dist/{chunk-CSN52UFI.cjs → chunk-73KNWWBW.cjs} +72 -72
  65. package/dist/{chunk-CSN52UFI.cjs.map → chunk-73KNWWBW.cjs.map} +1 -1
  66. package/dist/{chunk-WECRDCH4.cjs → chunk-A5SKK3CU.cjs} +5 -5
  67. package/dist/{chunk-WECRDCH4.cjs.map → chunk-A5SKK3CU.cjs.map} +1 -1
  68. package/dist/{chunk-FE4H7Z37.cjs → chunk-AG6KAGAX.cjs} +4 -4
  69. package/dist/{chunk-FE4H7Z37.cjs.map → chunk-AG6KAGAX.cjs.map} +1 -1
  70. package/dist/{chunk-CFSLZW4Y.cjs → chunk-B5BGVPQ5.cjs} +4 -4
  71. package/dist/{chunk-CFSLZW4Y.cjs.map → chunk-B5BGVPQ5.cjs.map} +1 -1
  72. package/dist/{chunk-UHEOY35C.cjs → chunk-CULUTYOD.cjs} +4 -4
  73. package/dist/{chunk-UHEOY35C.cjs.map → chunk-CULUTYOD.cjs.map} +1 -1
  74. package/dist/{chunk-2XIENKEI.cjs → chunk-CVVQHFLR.cjs} +40 -40
  75. package/dist/{chunk-2XIENKEI.cjs.map → chunk-CVVQHFLR.cjs.map} +1 -1
  76. package/dist/{chunk-WREXDEOM.cjs → chunk-CYWOL2LS.cjs} +11 -11
  77. package/dist/{chunk-WREXDEOM.cjs.map → chunk-CYWOL2LS.cjs.map} +1 -1
  78. package/dist/{chunk-ETMSINQS.cjs → chunk-D4SJT3NG.cjs} +4 -4
  79. package/dist/{chunk-ETMSINQS.cjs.map → chunk-D4SJT3NG.cjs.map} +1 -1
  80. package/dist/{chunk-YF5J44EA.cjs → chunk-D5DOK2AE.cjs} +90 -90
  81. package/dist/{chunk-YF5J44EA.cjs.map → chunk-D5DOK2AE.cjs.map} +1 -1
  82. package/dist/{chunk-43D2KKWT.cjs → chunk-DLGYR4JL.cjs} +8 -8
  83. package/dist/{chunk-43D2KKWT.cjs.map → chunk-DLGYR4JL.cjs.map} +1 -1
  84. package/dist/{chunk-TGZAJVDV.cjs → chunk-DUNXLT63.cjs} +4 -4
  85. package/dist/{chunk-TGZAJVDV.cjs.map → chunk-DUNXLT63.cjs.map} +1 -1
  86. package/dist/{chunk-U2HDSS5R.cjs → chunk-DWN5AUMH.cjs} +6 -6
  87. package/dist/{chunk-U2HDSS5R.cjs.map → chunk-DWN5AUMH.cjs.map} +1 -1
  88. package/dist/{chunk-DEJTECAY.cjs → chunk-DYIZ7W4P.cjs} +6 -6
  89. package/dist/{chunk-DEJTECAY.cjs.map → chunk-DYIZ7W4P.cjs.map} +1 -1
  90. package/dist/{chunk-N2IQSGYU.cjs → chunk-E6BM5ENI.cjs} +4 -4
  91. package/dist/{chunk-N2IQSGYU.cjs.map → chunk-E6BM5ENI.cjs.map} +1 -1
  92. package/dist/{chunk-XFZKPEUD.cjs → chunk-EKFA2OS3.cjs} +4 -4
  93. package/dist/{chunk-XFZKPEUD.cjs.map → chunk-EKFA2OS3.cjs.map} +1 -1
  94. package/dist/{chunk-FVFIAQ2S.cjs → chunk-FCT62ZPE.cjs} +25 -25
  95. package/dist/{chunk-FVFIAQ2S.cjs.map → chunk-FCT62ZPE.cjs.map} +1 -1
  96. package/dist/{chunk-XJAPT42P.cjs → chunk-GAA222SK.cjs} +5 -5
  97. package/dist/{chunk-XJAPT42P.cjs.map → chunk-GAA222SK.cjs.map} +1 -1
  98. package/dist/{chunk-P2K4XL4T.cjs → chunk-GB5MN5FC.cjs} +6 -6
  99. package/dist/{chunk-P2K4XL4T.cjs.map → chunk-GB5MN5FC.cjs.map} +1 -1
  100. package/dist/{chunk-BL3UUWIU.cjs → chunk-HNLNRAEU.cjs} +10 -10
  101. package/dist/{chunk-BL3UUWIU.cjs.map → chunk-HNLNRAEU.cjs.map} +1 -1
  102. package/dist/{chunk-6LTUUXRL.cjs → chunk-IXTDOPSB.cjs} +4 -4
  103. package/dist/{chunk-6LTUUXRL.cjs.map → chunk-IXTDOPSB.cjs.map} +1 -1
  104. package/dist/{chunk-Y3OI7ZP7.cjs → chunk-JARBYN6Z.cjs} +3 -3
  105. package/dist/{chunk-Y3OI7ZP7.cjs.map → chunk-JARBYN6Z.cjs.map} +1 -1
  106. package/dist/{chunk-JUFSJGTN.cjs → chunk-JCFXS336.cjs} +5 -5
  107. package/dist/{chunk-JUFSJGTN.cjs.map → chunk-JCFXS336.cjs.map} +1 -1
  108. package/dist/{chunk-M53KQLFA.cjs → chunk-JLNKD56X.cjs} +4 -4
  109. package/dist/{chunk-M53KQLFA.cjs.map → chunk-JLNKD56X.cjs.map} +1 -1
  110. package/dist/{chunk-YZBDHBKI.cjs → chunk-K67VMSOX.cjs} +2 -2
  111. package/dist/chunk-K67VMSOX.cjs.map +1 -0
  112. package/dist/{chunk-ZNPBC4MK.cjs → chunk-KWWGUQJV.cjs} +3 -3
  113. package/dist/{chunk-ZNPBC4MK.cjs.map → chunk-KWWGUQJV.cjs.map} +1 -1
  114. package/dist/{chunk-JOUMBLGL.cjs → chunk-LOSCXAAF.cjs} +5 -2
  115. package/dist/chunk-LOSCXAAF.cjs.map +1 -0
  116. package/dist/{chunk-UGSN47YE.cjs → chunk-LYKT336H.cjs} +5 -5
  117. package/dist/{chunk-UGSN47YE.cjs.map → chunk-LYKT336H.cjs.map} +1 -1
  118. package/dist/{chunk-7PUVSSXX.cjs → chunk-MAKCWF45.cjs} +4 -4
  119. package/dist/{chunk-7PUVSSXX.cjs.map → chunk-MAKCWF45.cjs.map} +1 -1
  120. package/dist/{chunk-SDGE2F77.cjs → chunk-MB2Y2ZGM.cjs} +6 -6
  121. package/dist/{chunk-SDGE2F77.cjs.map → chunk-MB2Y2ZGM.cjs.map} +1 -1
  122. package/dist/{chunk-H7SGZN33.cjs → chunk-NGM4HIPP.cjs} +21 -21
  123. package/dist/{chunk-H7SGZN33.cjs.map → chunk-NGM4HIPP.cjs.map} +1 -1
  124. package/dist/{chunk-IC3NREIK.cjs → chunk-NNZFZYTI.cjs} +83 -73
  125. package/dist/chunk-NNZFZYTI.cjs.map +1 -0
  126. package/dist/{chunk-HZF3YPEG.cjs → chunk-NUFZFWHZ.cjs} +4 -4
  127. package/dist/{chunk-HZF3YPEG.cjs.map → chunk-NUFZFWHZ.cjs.map} +1 -1
  128. package/dist/{chunk-KGAYY7LB.cjs → chunk-OF7KMG6R.cjs} +14 -14
  129. package/dist/{chunk-KGAYY7LB.cjs.map → chunk-OF7KMG6R.cjs.map} +1 -1
  130. package/dist/{chunk-L7QNPS52.cjs → chunk-PIWXX2M4.cjs} +11 -11
  131. package/dist/{chunk-L7QNPS52.cjs.map → chunk-PIWXX2M4.cjs.map} +1 -1
  132. package/dist/{chunk-AN4YKCBD.cjs → chunk-QDZDHP23.cjs} +4 -4
  133. package/dist/{chunk-AN4YKCBD.cjs.map → chunk-QDZDHP23.cjs.map} +1 -1
  134. package/dist/{chunk-LW7TDQ63.cjs → chunk-QKCFV36K.cjs} +15 -15
  135. package/dist/{chunk-LW7TDQ63.cjs.map → chunk-QKCFV36K.cjs.map} +1 -1
  136. package/dist/{chunk-ZX76KVRE.cjs → chunk-QWOPEBH2.cjs} +13 -13
  137. package/dist/{chunk-ZX76KVRE.cjs.map → chunk-QWOPEBH2.cjs.map} +1 -1
  138. package/dist/{chunk-C36NH6PR.cjs → chunk-SH7W4WVI.cjs} +6 -6
  139. package/dist/{chunk-C36NH6PR.cjs.map → chunk-SH7W4WVI.cjs.map} +1 -1
  140. package/dist/{chunk-VGRLKOIZ.cjs → chunk-SMO4SPPB.cjs} +8 -8
  141. package/dist/{chunk-VGRLKOIZ.cjs.map → chunk-SMO4SPPB.cjs.map} +1 -1
  142. package/dist/{chunk-RBBUKGG4.cjs → chunk-TFRCNIUY.cjs} +13 -13
  143. package/dist/{chunk-RBBUKGG4.cjs.map → chunk-TFRCNIUY.cjs.map} +1 -1
  144. package/dist/{chunk-VZZ2YIN4.cjs → chunk-TN3UP3CI.cjs} +4 -4
  145. package/dist/{chunk-VZZ2YIN4.cjs.map → chunk-TN3UP3CI.cjs.map} +1 -1
  146. package/dist/{chunk-X6QGVLMV.cjs → chunk-U4KUTO6O.cjs} +5 -5
  147. package/dist/{chunk-X6QGVLMV.cjs.map → chunk-U4KUTO6O.cjs.map} +1 -1
  148. package/dist/{chunk-QVKSN3G3.cjs → chunk-U4YOVI5D.cjs} +6 -6
  149. package/dist/{chunk-QVKSN3G3.cjs.map → chunk-U4YOVI5D.cjs.map} +1 -1
  150. package/dist/chunk-UM3EWCDE.cjs +105 -0
  151. package/dist/chunk-UM3EWCDE.cjs.map +1 -0
  152. package/dist/{chunk-TBLQCML6.cjs → chunk-V27WLYTG.cjs} +5 -5
  153. package/dist/{chunk-TBLQCML6.cjs.map → chunk-V27WLYTG.cjs.map} +1 -1
  154. package/dist/{chunk-5636X4OX.cjs → chunk-VSDD5TH5.cjs} +9 -9
  155. package/dist/{chunk-5636X4OX.cjs.map → chunk-VSDD5TH5.cjs.map} +1 -1
  156. package/dist/{chunk-RDBUQCAS.cjs → chunk-WQ2KG4LS.cjs} +5 -5
  157. package/dist/{chunk-RDBUQCAS.cjs.map → chunk-WQ2KG4LS.cjs.map} +1 -1
  158. package/dist/{chunk-QRCYKBLX.cjs → chunk-WUM76MJU.cjs} +7 -7
  159. package/dist/{chunk-QRCYKBLX.cjs.map → chunk-WUM76MJU.cjs.map} +1 -1
  160. package/dist/{chunk-2XZJBPBV.cjs → chunk-XMSK3LQX.cjs} +4 -4
  161. package/dist/{chunk-2XZJBPBV.cjs.map → chunk-XMSK3LQX.cjs.map} +1 -1
  162. package/dist/{chunk-2FA7UVLG.cjs → chunk-XYN3RP5W.cjs} +11 -8
  163. package/dist/chunk-XYN3RP5W.cjs.map +1 -0
  164. package/dist/{chunk-GAVQFR6P.cjs → chunk-YA6GXWC2.cjs} +4 -4
  165. package/dist/{chunk-GAVQFR6P.cjs.map → chunk-YA6GXWC2.cjs.map} +1 -1
  166. package/dist/{chunk-BDLXTMOK.cjs → chunk-Z3N32LL4.cjs} +102 -102
  167. package/dist/{chunk-BDLXTMOK.cjs.map → chunk-Z3N32LL4.cjs.map} +1 -1
  168. package/dist/{chunk-RCUM5HQN.cjs → chunk-ZCQXQIBA.cjs} +28 -28
  169. package/dist/{chunk-RCUM5HQN.cjs.map → chunk-ZCQXQIBA.cjs.map} +1 -1
  170. package/dist/citations/index.cjs +9 -9
  171. package/dist/components/MetricCard.js +1 -1
  172. package/dist/components/MetricCard.js.map +2 -2
  173. package/dist/components/gestures/GestureHandle.d.ts +21 -0
  174. package/dist/components/gestures/GestureHandle.js +44 -0
  175. package/dist/components/gestures/GestureHandle.js.map +7 -0
  176. package/dist/components/gestures/handles.d.ts +43 -0
  177. package/dist/components/gestures/handles.js +18 -0
  178. package/dist/components/gestures/handles.js.map +7 -0
  179. package/dist/components/gestures/index.d.ts +3 -0
  180. package/dist/components/gestures/index.js +5 -0
  181. package/dist/components/gestures/index.js.map +7 -0
  182. package/dist/components/gestures/usePointerGesture.d.ts +51 -0
  183. package/dist/components/gestures/usePointerGesture.js +61 -0
  184. package/dist/components/gestures/usePointerGesture.js.map +7 -0
  185. package/dist/connect/docx.cjs +25 -25
  186. package/dist/connect/index.cjs +1742 -1501
  187. package/dist/connect/index.cjs.map +1 -1
  188. package/dist/connect/viewer.cjs +42 -42
  189. package/dist/connection/dashboards/DashboardPanel.js +6 -1
  190. package/dist/connection/dashboards/DashboardPanel.js.map +2 -2
  191. package/dist/connection/dialogs/ConnectedGlobalDialogs.js +3 -1
  192. package/dist/connection/dialogs/ConnectedGlobalDialogs.js.map +2 -2
  193. package/dist/connection/messenger/ConnectedChatThread.js +31 -5
  194. package/dist/connection/messenger/ConnectedChatThread.js.map +2 -2
  195. package/dist/connection/messenger/ConnectedMessenger.js +7 -1
  196. package/dist/connection/messenger/ConnectedMessenger.js.map +2 -2
  197. package/dist/connection/messenger/DmFileShareCard.d.ts +16 -0
  198. package/dist/connection/messenger/DmFileShareCard.js +123 -0
  199. package/dist/connection/messenger/DmFileShareCard.js.map +7 -0
  200. package/dist/connection/messenger/file-share-status.d.ts +23 -0
  201. package/dist/connection/messenger/file-share-status.js +40 -0
  202. package/dist/connection/messenger/file-share-status.js.map +7 -0
  203. package/dist/connection/messenger/thread-entries.d.ts +25 -0
  204. package/dist/connection/messenger/thread-entries.js +31 -0
  205. package/dist/connection/messenger/thread-entries.js.map +7 -0
  206. package/dist/connection/messenger/types.d.ts +7 -0
  207. package/dist/connection/notification-center/useOpenNotificationTarget.js +8 -0
  208. package/dist/connection/notification-center/useOpenNotificationTarget.js.map +2 -2
  209. package/dist/connection/pages/BlockEditor.d.ts +0 -5
  210. package/dist/connection/pages/BlockEditor.js +3 -65
  211. package/dist/connection/pages/BlockEditor.js.map +2 -2
  212. package/dist/connection/pages/ConnectedPagesPage.d.ts +4 -1
  213. package/dist/connection/pages/ConnectedPagesPage.js +52 -71
  214. package/dist/connection/pages/ConnectedPagesPage.js.map +2 -2
  215. package/dist/connection/pages/DocumentBlocks.js +3 -3
  216. package/dist/connection/pages/DocumentBlocks.js.map +2 -2
  217. package/dist/connection/pages/DocumentsPicker.js +1 -1
  218. package/dist/connection/pages/DocumentsPicker.js.map +2 -2
  219. package/dist/connection/pages/EditablePageGrid.d.ts +31 -0
  220. package/dist/connection/pages/EditablePageGrid.js +200 -0
  221. package/dist/connection/pages/EditablePageGrid.js.map +7 -0
  222. package/dist/connection/pages/PageGrid.d.ts +7 -4
  223. package/dist/connection/pages/PageGrid.js +9 -3
  224. package/dist/connection/pages/PageGrid.js.map +2 -2
  225. package/dist/connection/pages/TableViewBlock.js +1 -1
  226. package/dist/connection/pages/TableViewBlock.js.map +2 -2
  227. package/dist/connection/pages/grid-layout.d.ts +38 -0
  228. package/dist/connection/pages/grid-layout.js +98 -0
  229. package/dist/connection/pages/grid-layout.js.map +7 -0
  230. package/dist/connection/pages/index.d.ts +2 -0
  231. package/dist/connection/pages/index.js +19 -1
  232. package/dist/connection/pages/index.js.map +2 -2
  233. package/dist/connection/pages/labels.d.ts +0 -2
  234. package/dist/connection/pages/labels.js +0 -2
  235. package/dist/connection/pages/labels.js.map +2 -2
  236. package/dist/connection/shell/experimentalNav.d.ts +8 -0
  237. package/dist/connection/shell/experimentalNav.js +23 -0
  238. package/dist/connection/shell/experimentalNav.js.map +7 -0
  239. package/dist/connection/viewer/ConnectedSharedFileDialog.d.ts +2 -0
  240. package/dist/connection/viewer/ConnectedSharedFileDialog.js +59 -0
  241. package/dist/connection/viewer/ConnectedSharedFileDialog.js.map +7 -0
  242. package/dist/connection/viewer/ConnectedSharedFilesPage.js +2 -15
  243. package/dist/connection/viewer/ConnectedSharedFilesPage.js.map +2 -2
  244. package/dist/connection/viewer/publish-shared-file.d.ts +7 -0
  245. package/dist/connection/viewer/publish-shared-file.js +13 -0
  246. package/dist/connection/viewer/publish-shared-file.js.map +7 -0
  247. package/dist/dashboards/ChartRenderer.d.ts +6 -0
  248. package/dist/dashboards/ChartRenderer.js +7 -2
  249. package/dist/dashboards/ChartRenderer.js.map +2 -2
  250. package/dist/dashboards/PanelView.d.ts +2 -0
  251. package/dist/dashboards/PanelView.js +12 -2
  252. package/dist/dashboards/PanelView.js.map +2 -2
  253. package/dist/dashboards/RechartsRenderer.js +19 -18
  254. package/dist/dashboards/RechartsRenderer.js.map +2 -2
  255. package/dist/dashboards/index.cjs +20 -20
  256. package/dist/document-tools/index.cjs +7 -7
  257. package/dist/document-tools/viewer/SharedFileView.d.ts +5 -1
  258. package/dist/document-tools/viewer/SharedFileView.js +9 -6
  259. package/dist/document-tools/viewer/SharedFileView.js.map +2 -2
  260. package/dist/document-tools/viewer/index.cjs +9 -9
  261. package/dist/embed/index.cjs +49 -49
  262. package/dist/facts/index.cjs +45 -45
  263. package/dist/files/index.cjs +229 -229
  264. package/dist/home/index.cjs +33 -33
  265. package/dist/index.cjs +1659 -1641
  266. package/dist/index.cjs.map +1 -1
  267. package/dist/index.d.ts +1 -0
  268. package/dist/index.js +3 -0
  269. package/dist/index.js.map +2 -2
  270. package/dist/lib/routes.d.ts +2 -0
  271. package/dist/lib/routes.js +3 -0
  272. package/dist/lib/routes.js.map +2 -2
  273. package/dist/pages/index.cjs +397 -189
  274. package/dist/pages/index.cjs.map +1 -1
  275. package/dist/presentation/StageBox.js +63 -86
  276. package/dist/presentation/StageBox.js.map +2 -2
  277. package/dist/presentation/StageItem.js +86 -117
  278. package/dist/presentation/StageItem.js.map +2 -2
  279. package/dist/provider/dialog-registry.d.ts +5 -0
  280. package/dist/provider/dialog-registry.js.map +2 -2
  281. package/dist/retrieval/index.cjs +5 -5
  282. package/dist/settings/index.cjs +149 -149
  283. package/dist/shell/index.cjs +89 -89
  284. package/dist/studio/index.cjs +44 -44
  285. package/dist/styles.css +1 -1
  286. package/dist/workflow-canvas/index.cjs +72 -72
  287. package/dist/workspaces/index.cjs +19 -19
  288. package/node_modules/@arbidocs/coedit/package.json +1 -1
  289. package/package.json +5 -5
  290. package/dist/ConnectedPresentation-F6NYQ2X7.cjs.map +0 -1
  291. package/dist/ConnectedSlidesTab-WY6JCGWZ.cjs.map +0 -1
  292. package/dist/RechartsRenderer-NRLQZSSY.cjs.map +0 -1
  293. package/dist/SpotlightStrip-QQ2WUI32.cjs.map +0 -1
  294. package/dist/ai-RKRKOYO4.cjs.map +0 -1
  295. package/dist/chunk-2FA7UVLG.cjs.map +0 -1
  296. package/dist/chunk-7Q46YAX4.cjs.map +0 -1
  297. package/dist/chunk-F4ULSAOA.cjs.map +0 -1
  298. package/dist/chunk-IC3NREIK.cjs.map +0 -1
  299. package/dist/chunk-JOUMBLGL.cjs.map +0 -1
  300. package/dist/chunk-NVECYF2N.cjs.map +0 -1
  301. package/dist/chunk-YZBDHBKI.cjs.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/presentation/MediaClip.tsx","../src/presentation/ClipImage.tsx","../src/presentation/ClipViewControls.tsx","../src/presentation/ClipActionBar.tsx","../src/presentation/SlideDecor.tsx","../src/components/gestures/handles.ts","../src/presentation/StageItem.tsx","../src/presentation/box-style.ts","../src/presentation/StageBox.tsx","../src/presentation/BoxActionBar.tsx","../src/presentation/useClipDrag.ts","../src/presentation/PresentationStage.tsx"],"names":["useObjectUrl","useRef","useEffect","jsx","cn","STAGE_VIDEO_ATTRIBUTE","memo","ClipImage","useState","useLayoutEffect","renderPdfRegion","closePdfRegionImage","jsxs","usePresentation","ChevronUp","ChevronLeft","ChevronRight","ChevronDown","ZoomSlider","Maximize2","MoveHorizontal","MoveVertical","AlignStartVertical","AlignCenterVertical","AlignEndVertical","AlignStartHorizontal","AlignCenterHorizontal","AlignEndHorizontal","DropdownMenu","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuItem","Popover","PopoverTrigger","ZoomIn","PopoverContent","MoreHorizontal","Crop","Sparkles","DropdownMenuSeparator","BringToFront","SendToBack","Trash2","TEXT_COLORS","SlideDecor","slideGeometry","LAYOUT_INFO","accentColor","textLines","clipEdgeCss","StageItem","usePointerGesture","reshapeFrame","moveFrame","resizeFrame","frameHeight","GestureHandle","pointsToStage","DEFAULT_TEXT_SIZE","STAGE_ASPECT","Fragment","StageBox","moveBox","stretchBox","DEFAULT_INSET","firstRun","boxText","AlignLeft","AlignCenter","AlignRight","styleRuns","AArrowDown","AArrowUp","Bold","Baseline","PaintBucket","DropdownMenuCheckboxItem","Italic","index","forwardRef","GuideLayer","useImperativeHandle","useMemo","FONTS","slideBackgroundCss","backgroundCss","clipLabel"],"mappings":";;;;;;;;;;;;;AAiBA,SAAS,UAAU,IAAA,EAAmC;AACpD,EAAA,OAAO;AAAA,IACL,QAAA,EAAU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IAAA,CAAK,EAAA;AAAA,kBACxC,GAAA,EAAK,KAAA;AAAA,kBACL,KAAA,EAAO,QAAA,GAAWmF,2BAAA,CAAU,IAAA,EAAM,YAAY,CAAA,GAAI,EAAA;AAAA,kBAClD;AAAA,iBAAA;AAAA,gBAPK,IAAA,CAAK;AAAA,eAQZ;AAAA,YAEJ,CAAC,CAAA;AAAA,YACA,YAAY,IAAI,CAAA;AAAA,YAEhB,QAAA,oBAAYnF,cAAAA,CAAC,UAAA,EAAA,EAAW,KAAK,UAAA,EAAY,CAAA;AAAA,YAEzC,QAAA,IAAY,aAAA,IAAiB,QAAA,IAAY,CAAC,4BACzCA,cAAAA;AAAA,cAAC,aAAA;AAAA,cAAA;AAAA,gBACC,MAAA,EAAQ,QAAA;AAAA,gBACR,EAAA,EAAI,aAAA;AAAA,gBACJ,SAAA,EAAW,MAAM,QAAA,GAAW,IAAI,CAAA;AAAA,gBAChC,WAAA,EACE,WAAA,IAAe,MAAA,CAAO,QAAQ,CAAA,EAAG,SAAS,OAAA,GACtC,MAAM,WAAA,CAAY,QAAQ,CAAA,GAC1B,MAAA;AAAA,gBAEN,WAAA,EACE,WAAA,IAAe,MAAA,CAAO,QAAQ,CAAA,EAAG,SAAS,OAAA,GACtC,MAAM,WAAA,CAAY,QAAQ,CAAA,GAC1B;AAAA;AAAA,aAER;AAAA,YAED,QAAA,IAAY,WAAA,oBACXA,cAAAA,CAAC,YAAA,EAAA,EAAa,GAAA,EAAK,WAAA,EAAa,SAAA,EAAW,MAAM,QAAA,GAAW,IAAI,CAAA,EAAG,CAAA;AAAA,YAEpE;AAAA;AAAA;AAAA;AACH;AAAA,GACF;AAEJ","file":"chunk-3CJTO6RV.cjs","sourcesContent":["/**\n * An image or video clip: the original file, cropped to the clipped area with CSS (the element is\n * scaled so the area fills the box), so the browser draws it from the file's own pixels: its\n * native resolution, nothing re-encoded.\n *\n * A video clip waits at its start, muted, in the editor and the tray. On the presented stage\n * (`live`) it has its sound and is played and paused with Space (`toggleStageVideos`); no\n * controls are ever drawn, since the stage is what the audience sees.\n */\n\nimport { useEffect, useRef, type CSSProperties } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport type { Clip } from './model'\nimport { STAGE_VIDEO_ATTRIBUTE } from './stage-videos'\nimport { useObjectUrl } from './useObjectUrl'\n\n/** The element scaled and shifted so the clipped area fills its box. */\nfunction cropStyle(rect: Clip['rect']): CSSProperties {\n return {\n position: 'absolute',\n width: `${100 / rect.w}%`,\n height: `${100 / rect.h}%`,\n left: `${(-rect.x / rect.w) * 100}%`,\n top: `${(-rect.y / rect.h) * 100}%`,\n maxWidth: 'none',\n }\n}\n\nexport function MediaClip({\n clip,\n className,\n live,\n}: {\n clip: Clip\n className?: string\n live: boolean\n}) {\n const url = useObjectUrl(clip.source)\n const videoRef = useRef<HTMLVideoElement>(null)\n\n // A video shows its first frame at the clip's start.\n useEffect(() => {\n const video = videoRef.current\n if (!video) return\n const toStart = () => {\n video.currentTime = clip.start ?? 0\n }\n if (video.readyState >= 1) toStart()\n else video.addEventListener('loadedmetadata', toStart, { once: true })\n return () => video.removeEventListener('loadedmetadata', toStart)\n }, [clip.start, url])\n\n return (\n <div\n className={cn('relative h-full w-full overflow-hidden bg-black', className)}\n data-testid={`clip-image-${clip.id}`}\n >\n {clip.kind === 'video' ? (\n <video\n ref={videoRef}\n src={url}\n muted={!live}\n playsInline\n preload=\"auto\"\n className=\"pointer-events-none block select-none\"\n style={cropStyle(clip.rect)}\n {...(live ? { [STAGE_VIDEO_ATTRIBUTE]: '' } : {})}\n />\n ) : (\n <img\n src={url}\n alt={clip.caption}\n draggable={false}\n className=\"pointer-events-none block select-none\"\n style={cropStyle(clip.rect)}\n />\n )}\n </div>\n )\n}\n","/**\n * A clip as shown on a slide or in the tray.\n *\n * A PDF clip is drawn into a canvas the size of its box in device pixels (measured in whichever\n * window it is in), from a bitmap of its region rendered for that size: as sharp as the screen\n * allows. The canvas remembers what area its bitmap covers, so when the clip is scrolled or\n * resized it is redrawn at once from the bitmap it has (shifted or scaled: cheap), and the sharp\n * rendering follows once the change settles. An older render still running is cancelled; renders\n * across clips are queued a few at a time (`renderPdfRegion`), so the page stays smooth.\n *\n * An image or video clip is its own file, cropped (`MediaClip`).\n */\n\nimport { memo, useEffect, useLayoutEffect, useRef, useState } from 'react'\nimport { closePdfRegionImage, renderPdfRegion, type PdfRegionImage } from '@arbidocs/react/viewers'\nimport { cn } from '@arbidocs/react/ui'\nimport { MediaClip } from './MediaClip'\nimport type { Clip, Rect } from './model'\n\n/** Rendered widths are rounded up to this step, so small size changes reuse the rendering. */\nconst WIDTH_STEP = 160\n/** A new rendering is asked for once the clip has stopped changing for this long. */\nconst SETTLE_MS = 150\n\nexport interface ClipImageProps {\n clip: Clip\n className?: string\n /** On the presented stage: a video clip plays with its sound (the editor's copy is muted). */\n live?: boolean\n}\n\n/** An image or video clip is its own file, cropped; a PDF clip is drawn for its size. */\nexport const ClipImage = memo(function ClipImage({\n clip,\n className,\n live = false,\n}: ClipImageProps) {\n return clip.kind === 'pdf' ? (\n <PdfClip clip={clip} className={className} />\n ) : (\n <MediaClip clip={clip} className={className} live={live} />\n )\n})\n\ninterface Rendered {\n image: PdfRegionImage\n /** The page area the image shows. */\n rect: Rect\n /** Its width in device pixels. */\n width: number\n}\n\nconst sameRect = (a: Rect, b: Rect) => a.x === b.x && a.y === b.y && a.w === b.w && a.h === b.h\n\nfunction PdfClip({ clip, className }: Omit<ClipImageProps, 'live'>) {\n const canvasRef = useRef<HTMLCanvasElement>(null)\n // The canvas's size in device pixels.\n const [size, setSize] = useState({ width: 0, height: 0 })\n const [rendered, setRendered] = useState<Rendered | null>(null)\n const [failed, setFailed] = useState(false)\n\n // Layout dimensions exclude the spotlight's temporary fly-in transform. A transformed\n // bounding box can be thumbnail-sized, and transforms never trigger ResizeObserver again.\n // Render from the PDF at the final layout size in this window's device pixels.\n useEffect(() => {\n const canvas = canvasRef.current\n const view = canvas?.ownerDocument.defaultView\n if (!canvas || !view) return\n const measure = () => {\n const dpr = view.devicePixelRatio || 1\n const width = Math.max(1, Math.round(canvas.clientWidth * dpr))\n const height = Math.max(1, Math.round(canvas.clientHeight * dpr))\n setSize((s) => (s.width === width && s.height === height ? s : { width, height }))\n }\n measure()\n const Observer = (view as typeof window).ResizeObserver ?? ResizeObserver\n const observer = new Observer(measure)\n observer.observe(canvas)\n view.addEventListener('resize', measure)\n return () => {\n observer.disconnect()\n view.removeEventListener('resize', measure)\n }\n }, [])\n\n // Draw what there is now: the last rendering placed where its area falls in the clip's area.\n useLayoutEffect(() => {\n const canvas = canvasRef.current\n const context = canvas?.getContext('2d')\n if (!canvas || !context || !size.width) return\n if (canvas.width !== size.width) canvas.width = size.width\n if (canvas.height !== size.height) canvas.height = size.height\n context.fillStyle = '#fff'\n context.fillRect(0, 0, size.width, size.height)\n if (!rendered) return\n const { rect } = clip\n const sx = size.width / rect.w\n const sy = size.height / rect.h\n try {\n context.drawImage(\n rendered.image,\n (rendered.rect.x - rect.x) * sx,\n (rendered.rect.y - rect.y) * sy,\n rendered.rect.w * sx,\n rendered.rect.h * sy\n )\n } catch {\n // A rendering already freed: draw it again rather than fail.\n setRendered(null)\n }\n }, [size, rendered, clip])\n\n // Render the region again once the clip has settled, if what is drawn is not sharp or not it.\n const wanted = Math.ceil(size.width / WIDTH_STEP) * WIDTH_STEP\n const stale =\n wanted > 0 &&\n (!rendered ||\n !sameRect(rendered.rect, clip.rect) ||\n wanted > rendered.width ||\n wanted < rendered.width / 2)\n useEffect(() => {\n if (!stale) return\n const controller = new AbortController()\n const rect = clip.rect\n const timer = setTimeout(() => {\n renderPdfRegion({\n file: clip.source,\n page: clip.page,\n rect,\n masks: clip.masks,\n width: wanted,\n signal: controller.signal,\n })\n .then((image) => {\n if (controller.signal.aborted) return closePdfRegionImage(image)\n setFailed(false)\n setRendered({ image, rect, width: wanted })\n })\n .catch(() => !controller.signal.aborted && setFailed(true))\n }, SETTLE_MS)\n return () => {\n clearTimeout(timer)\n controller.abort()\n }\n }, [stale, wanted, clip.source, clip.page, clip.rect, clip.masks])\n\n // A rendering's memory is freed once the next has replaced it on screen. Never in a cleanup: a\n // remount (React's StrictMode replays mount effects) would free the one still in use. One left\n // when the clip goes is reclaimed by the browser with it.\n const previous = useRef<Rendered | null>(null)\n useEffect(() => {\n if (previous.current && previous.current !== rendered) {\n closePdfRegionImage(previous.current.image)\n }\n previous.current = rendered\n }, [rendered])\n\n return (\n <div\n className={cn('relative h-full w-full overflow-hidden bg-white', className)}\n data-testid={`clip-image-${clip.id}`}\n >\n <canvas\n ref={canvasRef}\n className=\"pointer-events-none block h-full w-full\"\n role=\"img\"\n aria-label={clip.caption}\n aria-busy={!rendered}\n />\n {failed && !rendered && (\n <div className=\"absolute inset-0 flex items-center justify-center p-2 text-center text-xs text-neutral-500\">\n {\"Couldn't draw this clip\"}\n </div>\n )}\n </div>\n )\n}\n","/**\n * A clip's view controls (in its action bar's View popover, so nothing covers what it shows):\n * arrows scroll what the clip shows over its source (a press steps, holding keeps scrolling; an\n * arrow at the source's edge is off), and a zoom slider zooms about the clip's centre.\n * The clip's frame on the slide does not change; only the part of the source it shows. Presses\n * here never start moving the clip.\n */\n\nimport { useEffect, useRef, type PointerEvent as ReactPointerEvent, type ReactNode } from 'react'\nimport { ChevronDown, ChevronLeft, ChevronRight, ChevronUp } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ZoomSlider } from '../components/ZoomSlider'\nimport type { Clip } from './model'\nimport { usePresentation } from './store'\n\n/** One step scrolls this much of what the clip shows. */\nconst PAN_STEP = 0.1\n/** The closest a clip zooms, in percent of how close it was cut. */\nconst MAX_ZOOM = 800\n/** Holding a button repeats it after this long, this often. */\nconst HOLD_DELAY = 350\nconst HOLD_EVERY = 90\n\nconst BUTTON =\n 'flex size-7 items-center justify-center rounded-full border border-border bg-background text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-30 pointer-coarse:size-11'\n\n/** A button that acts on press and keeps acting while held. */\nfunction HoldButton({\n label,\n disabled,\n onStep,\n className,\n children,\n}: {\n label: string\n disabled?: boolean\n onStep: () => void\n className?: string\n children: ReactNode\n}) {\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n const stop = () => {\n if (timer.current) clearTimeout(timer.current)\n timer.current = null\n }\n useEffect(() => stop, [])\n useEffect(() => {\n if (disabled) stop()\n }, [disabled])\n const start = (event: ReactPointerEvent) => {\n event.stopPropagation()\n if (disabled || event.button !== 0) return\n onStep()\n const repeat = () => {\n onStep()\n timer.current = setTimeout(repeat, HOLD_EVERY)\n }\n timer.current = setTimeout(repeat, HOLD_DELAY)\n }\n return (\n <button\n type=\"button\"\n className={cn(BUTTON, className)}\n title={label}\n aria-label={label}\n disabled={disabled}\n onPointerDown={start}\n onPointerUp={stop}\n onPointerLeave={stop}\n onPointerCancel={stop}\n // Keyboard: Enter / Space step once.\n onClick={(event) => event.detail === 0 && onStep()}\n >\n {children}\n </button>\n )\n}\n\nexport function ClipViewControls({ clip }: { clip: Clip }) {\n const { panClip, setClipZoom } = usePresentation.getState()\n const { rect } = clip\n const zoomBase = clip.zoomBase ?? rect.w\n // As far out as it goes: the widest area of this shape the source holds.\n const minZoom = Math.min(100, Math.floor((zoomBase / Math.min(1, rect.w / rect.h)) * 100))\n const pan = (dx: number, dy: number) => () => panClip(clip.id, dx * rect.w, dy * rect.h)\n const zoom = Math.round((zoomBase / rect.w) * 100)\n const edge = 1e-6\n return (\n <div\n className=\"flex flex-col items-center gap-2 p-1\"\n // A press here is not a press on the clip (which would start moving it).\n onPointerDown={(event) => event.stopPropagation()}\n data-testid=\"clip-view-controls\"\n >\n {/* Move the view: what the clip shows, over its source (the wheel does the same). */}\n <div className=\"grid grid-cols-3 grid-rows-3 place-items-center gap-0.5\">\n <HoldButton\n label=\"Show more above\"\n disabled={rect.y <= edge}\n onStep={pan(0, -PAN_STEP)}\n className=\"col-start-2 row-start-1\"\n >\n <ChevronUp className=\"size-4\" />\n </HoldButton>\n <HoldButton\n label=\"Show more on the left\"\n disabled={rect.x <= edge}\n onStep={pan(-PAN_STEP, 0)}\n className=\"col-start-1 row-start-2\"\n >\n <ChevronLeft className=\"size-4\" />\n </HoldButton>\n <HoldButton\n label=\"Show more on the right\"\n disabled={rect.x + rect.w >= 1 - edge}\n onStep={pan(PAN_STEP, 0)}\n className=\"col-start-3 row-start-2\"\n >\n <ChevronRight className=\"size-4\" />\n </HoldButton>\n <HoldButton\n label=\"Show more below\"\n disabled={rect.y + rect.h >= 1 - edge}\n onStep={pan(0, PAN_STEP)}\n className=\"col-start-2 row-start-3\"\n >\n <ChevronDown className=\"size-4\" />\n </HoldButton>\n </div>\n {/* Zoom: a slider, from as far out as the source allows to MAX_ZOOM. */}\n <div data-testid=\"clip-zoom-control\">\n <ZoomSlider\n value={zoom}\n min={minZoom}\n max={Math.max(MAX_ZOOM, zoom)}\n zoomOutStep={25}\n onChange={(value) => setClipZoom(clip.id, value)}\n label=\"Zoom\"\n valueLabel={<span data-testid=\"clip-zoom\">{zoom}%</span>}\n className=\"pointer-coarse:h-11\"\n sliderClassName=\"w-28\"\n />\n </div>\n </div>\n )\n}\n","/**\n * The floating action bar over the selected clip (the markup overlay's pattern): size it to the\n * stage, align it, put it in front or behind, take it off the slide. Icons with labels on hover\n * (`title`: portalled tooltips misplace in a popped-out window).\n */\n\nimport type { ReactNode } from 'react'\nimport {\n AlignCenterHorizontal,\n AlignCenterVertical,\n AlignEndHorizontal,\n AlignEndVertical,\n AlignStartHorizontal,\n AlignStartVertical,\n BringToFront,\n Crop,\n Maximize2,\n MoreHorizontal,\n MoveHorizontal,\n MoveVertical,\n SendToBack,\n Sparkles,\n Trash2,\n ZoomIn,\n} from 'lucide-react'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n Popover,\n PopoverContent,\n PopoverTrigger,\n cn,\n} from '@arbidocs/react/ui'\nimport { ClipViewControls } from './ClipViewControls'\nimport type { Alignment } from './model'\nimport { usePresentation, type FrameCommand } from './store'\n\nexport const ACTION =\n 'inline-flex size-7 items-center justify-center rounded text-foreground hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11'\n\nconst SIZES: { command: FrameCommand; label: string; icon: ReactNode }[] = [\n { command: 'fit', label: 'Fit the slide', icon: <Maximize2 className=\"size-4\" /> },\n { command: 'fullWidth', label: 'Full width', icon: <MoveHorizontal className=\"size-4\" /> },\n { command: 'fullHeight', label: 'Full height', icon: <MoveVertical className=\"size-4\" /> },\n]\n\nconst ALIGNMENTS: { alignment: Alignment; label: string; icon: ReactNode }[] = [\n { alignment: 'left', label: 'Left', icon: <AlignStartVertical className=\"size-4\" /> },\n { alignment: 'centre', label: 'Centre', icon: <AlignCenterVertical className=\"size-4\" /> },\n { alignment: 'right', label: 'Right', icon: <AlignEndVertical className=\"size-4\" /> },\n { alignment: 'top', label: 'Top', icon: <AlignStartHorizontal className=\"size-4\" /> },\n { alignment: 'middle', label: 'Middle', icon: <AlignCenterHorizontal className=\"size-4\" /> },\n { alignment: 'bottom', label: 'Bottom', icon: <AlignEndHorizontal className=\"size-4\" /> },\n]\n\nexport function Action({\n label,\n onClick,\n children,\n}: {\n label: string\n onClick: () => void\n children: ReactNode\n}) {\n return (\n <button type=\"button\" className={ACTION} title={label} aria-label={label} onClick={onClick}>\n {children}\n </button>\n )\n}\n\nexport interface ClipActionBarProps {\n clipId: string\n /** The clip's top-left, as fractions of the stage. */\n at: { x: number; y: number }\n onRemoved: () => void\n /** An image clip: make a new version of the image (Generate image with it as the reference). */\n onEditImage?: () => void\n /** An image clip: choose the part of the image it shows. */\n onCropImage?: () => void\n}\n\nexport function ClipActionBar({\n clipId,\n at,\n onRemoved,\n onEditImage,\n onCropImage,\n}: ClipActionBarProps) {\n const actions = usePresentation.getState()\n const clip = usePresentation((state) => state.clips.find((entry) => entry.id === clipId))\n return (\n <div\n role=\"toolbar\"\n aria-label=\"Clip\"\n className=\"absolute z-20 flex items-center gap-0.5 rounded-md border border-border bg-background p-0.5 shadow-md\"\n style={{ left: `${at.x * 100}%`, top: `calc(${at.y * 100}% - 40px)` }}\n // Its clicks are not a click on the stage (which would deselect the clip).\n onPointerDown={(event) => event.stopPropagation()}\n data-testid=\"clip-action-bar\"\n >\n {/* The commonest: fit it to the slide, line it up, adjust what it shows. */}\n <Action label=\"Fit the slide\" onClick={() => actions.applyFrame(clipId, 'fit')}>\n <Maximize2 className=\"size-4\" />\n </Action>\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button type=\"button\" className={ACTION} title=\"Align\" aria-label=\"Align\">\n <AlignCenterHorizontal className=\"size-4\" />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {ALIGNMENTS.map(({ alignment, label, icon }) => (\n <DropdownMenuItem key={alignment} onSelect={() => actions.align(clipId, alignment)}>\n {icon}\n <span className=\"ml-2\">{label}</span>\n </DropdownMenuItem>\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n {clip && (\n <Popover>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n className={ACTION}\n title=\"View: scroll or zoom what the clip shows (or scroll over it)\"\n aria-label=\"View\"\n data-testid=\"clip-view-button\"\n >\n <ZoomIn className=\"size-4\" />\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-auto p-2\">\n <ClipViewControls clip={clip} />\n </PopoverContent>\n </Popover>\n )}\n {/* The rest, behind \"…\". */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className={ACTION}\n title=\"More\"\n aria-label=\"More\"\n data-testid=\"clip-more-menu\"\n >\n <MoreHorizontal className=\"size-4\" />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {SIZES.filter(({ command }) => command !== 'fit').map(({ command, label, icon }) => (\n <DropdownMenuItem key={command} onSelect={() => actions.applyFrame(clipId, command)}>\n {icon}\n <span className=\"ml-2\">{label}</span>\n </DropdownMenuItem>\n ))}\n {onCropImage && (\n <DropdownMenuItem onSelect={onCropImage}>\n <Crop className=\"size-4\" />\n <span className=\"ml-2\">Crop</span>\n </DropdownMenuItem>\n )}\n {onEditImage && (\n <DropdownMenuItem onSelect={onEditImage}>\n <Sparkles className=\"size-4\" />\n <span className=\"ml-2\">Edit image</span>\n </DropdownMenuItem>\n )}\n <DropdownMenuSeparator />\n <DropdownMenuItem onSelect={() => actions.bringToFront(clipId)}>\n <BringToFront className=\"size-4\" />\n <span className=\"ml-2\">Bring to front</span>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={() => actions.sendToBack(clipId)}>\n <SendToBack className=\"size-4\" />\n <span className=\"ml-2\">Send to back</span>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n <div className=\"mx-0.5 h-5 w-px bg-border\" />\n <button\n type=\"button\"\n className={cn(ACTION, 'text-destructive hover:bg-destructive/10')}\n title=\"Remove from slide (Delete)\"\n aria-label=\"Remove from slide\"\n onClick={() => {\n actions.unplace(clipId)\n onRemoved()\n }}\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n )\n}\n","/**\n * What a slide shows besides its clips, by its layout and the theme: its title with the accent\n * rule, its points (accent bullets) or subtitle, and the logo in the footer. Positioned on the\n * stage from `slideGeometry`, sized in container units (`cqw`) so it scales with the stage. The\n * saved PDF and the PowerPoint export draw the same geometry.\n *\n * In the editor (`editing`), the title and text are typed on the slide itself: a click swaps the\n * text for a field with the same type, size and place, so nothing moves while it is edited.\n */\n\nimport { memo, useState, type CSSProperties } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport type { Slide } from './model'\nimport { LAYOUT_INFO, slideGeometry, textLines, type Box, type TextBox } from './slide-layout'\nimport { TEXT_COLORS, accentColor, type Theme } from './theme'\nimport { useObjectUrl } from './useObjectUrl'\n\n/** Typing a slide's title and text on the slide. */\nexport interface SlideTextEditing {\n onTitle(title: string): void\n onPoints(points: string): void\n}\n\nconst boxStyle = (box: Box) => ({\n left: `${box.x * 100}%`,\n top: `${box.y * 100}%`,\n width: `${box.w * 100}%`,\n height: `${box.h * 100}%`,\n})\n\nconst textStyle = (box: TextBox, color: string): CSSProperties => ({\n ...boxStyle(box),\n fontSize: `${box.size * 100}cqw`,\n fontWeight: box.weight,\n lineHeight: box.leading,\n color,\n letterSpacing: box.tone === 'title' ? '-0.01em' : undefined,\n})\n\nconst PLACEHOLDER_COLOR = 'rgba(255,255,255,0.32)'\n\nfunction Text({\n box,\n lines,\n accent,\n placeholder,\n onEdit,\n testId,\n}: {\n box: TextBox\n lines: string[]\n accent: string\n /** Shown faintly in the editor while the text is empty. */\n placeholder?: string\n /** A click starts typing (the editor). */\n onEdit?: () => void\n testId: string\n}) {\n const empty = lines.length === 0\n if (empty && !placeholder) return null\n return (\n <div\n className={cn(\n 'absolute flex flex-col overflow-hidden',\n onEdit\n ? 'pointer-events-auto cursor-text rounded-[0.3cqw] hover:outline hover:outline-1 hover:outline-white/25'\n : 'pointer-events-none',\n box.align === 'center' && 'text-center',\n box.bullets && 'gap-[0.6cqw]',\n box.anchor === 'middle' && 'justify-center',\n box.anchor === 'bottom' && 'justify-end'\n )}\n style={textStyle(box, empty ? PLACEHOLDER_COLOR : TEXT_COLORS[box.tone])}\n onPointerDown={onEdit ? (event) => event.stopPropagation() : undefined}\n onClick={onEdit}\n data-testid={testId}\n >\n {(empty ? [placeholder!] : lines).map((line, index) =>\n box.bullets ? (\n <div key={index} className=\"flex items-baseline gap-[0.8em]\">\n <span\n aria-hidden\n className=\"inline-block size-[0.42em] shrink-0 -translate-y-[0.12em]\"\n style={{ background: empty ? 'currentColor' : accent }}\n />\n <span>{line}</span>\n </div>\n ) : (\n <div key={index}>{line}</div>\n )\n )}\n </div>\n )\n}\n\n/** The field a title or text is typed in: the text's own type, size and place. */\nfunction TextField({\n box,\n value,\n placeholder,\n multiline,\n onChange,\n onDone,\n testId,\n}: {\n box: TextBox\n value: string\n placeholder: string\n multiline: boolean\n onChange: (value: string) => void\n onDone: () => void\n testId: string\n}) {\n return (\n <textarea\n autoFocus\n value={value}\n placeholder={placeholder}\n onChange={(event) =>\n onChange(multiline ? event.target.value : event.target.value.replace(/\\n/g, ' '))\n }\n onBlur={onDone}\n onPointerDown={(event) => event.stopPropagation()}\n onKeyDown={(event) => {\n if (event.key === 'Escape' || (!multiline && event.key === 'Enter')) {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n className={cn(\n 'pointer-events-auto absolute resize-none overflow-hidden rounded-[0.3cqw] bg-white/5 p-0 outline outline-1 outline-white/40 placeholder:text-white/30 focus:outline-white/60',\n box.align === 'center' && 'text-center'\n )}\n style={{\n ...textStyle(box, TEXT_COLORS[box.tone]),\n fontFamily: 'inherit',\n // Bulleted lines keep their indent while typed.\n paddingLeft: box.bullets ? '1.22em' : undefined,\n }}\n aria-label={placeholder}\n data-testid={testId}\n />\n )\n}\n\nfunction Logo({ image, box }: { image: Blob; box: Box }) {\n const url = useObjectUrl(image)\n if (!url) return null\n return (\n <img\n src={url}\n alt=\"\"\n className=\"pointer-events-none absolute object-contain opacity-90\"\n style={{ ...boxStyle(box), objectPosition: box.x < 0.5 ? 'left bottom' : 'right bottom' }}\n data-testid=\"stage-logo\"\n />\n )\n}\n\nexport const SlideDecor = memo(function SlideDecor({\n slide,\n theme,\n labels,\n logoImage,\n editable,\n editing,\n dim,\n}: {\n slide: Pick<Slide, 'layout' | 'caption' | 'points'>\n theme: Theme\n labels: boolean\n logoImage: Blob | null\n editable: boolean\n editing?: SlideTextEditing\n dim?: boolean\n}) {\n const [typing, setTyping] = useState<'title' | 'text' | null>(null)\n const geometry = slideGeometry(slide, { labels, logo: theme.logo?.corner ?? null })\n const title = slide.caption.trim()\n const titled = slide.layout === 'title' || slide.layout === 'section'\n const info = LAYOUT_INFO[slide.layout]\n return (\n <div className={cn('pointer-events-none absolute inset-0', dim && 'opacity-30')}>\n {!geometry.title ? null : editing && typing === 'title' ? (\n <TextField\n box={geometry.title}\n value={slide.caption}\n placeholder=\"Title\"\n multiline={false}\n onChange={editing.onTitle}\n onDone={() => setTyping(null)}\n testId=\"stage-slide-caption-input\"\n />\n ) : (\n <Text\n box={geometry.title}\n lines={title ? [title] : []}\n accent={accentColor(theme.accent)}\n placeholder={editable && (titled || editing) ? 'Click to add a title' : undefined}\n onEdit={editing ? () => setTyping('title') : undefined}\n testId=\"stage-slide-caption\"\n />\n )}\n {geometry.rule && (title || (editable && titled)) && (\n <div\n className=\"absolute\"\n style={{ ...boxStyle(geometry.rule), background: accentColor(theme.accent) }}\n />\n )}\n {geometry.text &&\n (editing && typing === 'text' ? (\n <TextField\n box={geometry.text}\n value={slide.points}\n placeholder={info.text ?? ''}\n multiline\n onChange={editing.onPoints}\n onDone={() => setTyping(null)}\n testId=\"stage-slide-points-input\"\n />\n ) : (\n <Text\n box={geometry.text}\n lines={textLines(slide.points)}\n accent={accentColor(theme.accent)}\n placeholder={editable ? info.text : undefined}\n onEdit={editing ? () => setTyping('text') : undefined}\n testId=\"stage-slide-points\"\n />\n ))}\n {geometry.logo && logoImage && <Logo image={logoImage} box={geometry.logo} />}\n </div>\n )\n})\n","/** The handles of a box's four corners and four sides' middles, with their cursors. */\nexport const CORNER_HANDLES = [\n { handle: 'nw', left: '0%', top: '0%', cursor: 'nwse-resize' },\n { handle: 'ne', left: '100%', top: '0%', cursor: 'nesw-resize' },\n { handle: 'sw', left: '0%', top: '100%', cursor: 'nesw-resize' },\n { handle: 'se', left: '100%', top: '100%', cursor: 'nwse-resize' },\n] as const\n\nexport const SIDE_HANDLES = [\n { handle: 'n', left: '50%', top: '0%', cursor: 'ns-resize' },\n { handle: 'e', left: '100%', top: '50%', cursor: 'ew-resize' },\n { handle: 's', left: '50%', top: '100%', cursor: 'ns-resize' },\n { handle: 'w', left: '0%', top: '50%', cursor: 'ew-resize' },\n] as const\n","/**\n * One clip on the stage, and its own gestures: moved by dragging it, resized from a corner (its\n * shape kept), reshaped from a side's middle (more or less of the page that way), snapping to the\n * stage and to the other clips.\n *\n * Built for smooth dragging: while a clip is moved or resized nothing re-renders and nothing is\n * laid out again. Its element is moved by a GPU transform (translate, scale) once per animation\n * frame, and the new frame reaches the presentation once, when the drag ends. Only reshaping, which\n * changes what the clip shows, re-renders the clip itself (and nothing else). The component is\n * memoised: other clips, the slide's text and the other slides are untouched by its drags.\n */\n\nimport { memo, useRef, useState } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport {\n CORNER_HANDLES,\n GestureHandle,\n SIDE_HANDLES,\n usePointerGesture,\n} from '../components/gestures'\nimport { ClipImage } from './ClipImage'\nimport {\n frameHeight,\n moveFrame,\n reshapeFrame,\n resizeFrame,\n type Clip,\n type Corner,\n type Edge,\n type Frame,\n type Guide,\n type Placed,\n} from './model'\nimport { TEXT_COLORS, clipEdgeCss } from './theme'\n\ntype Kind = 'move' | Corner | Edge\n\nconst isEdge = (kind: Kind): kind is Edge =>\n kind === 'n' || kind === 'e' || kind === 's' || kind === 'w'\n\n/** What each side's middle handle is for: drag it to show more (or less) of the page that way. */\nconst SIDE_NAMES: Record<Edge, string> = { n: 'top', e: 'right', s: 'bottom', w: 'left' }\n\nconst EDGE_CSS = clipEdgeCss()\n\n/** What a stage gives its clips (stable across renders: the clips are memoised). */\nexport interface StageItemHost {\n /** The stage's box on screen, as a gesture begins. */\n stageBox(): DOMRect | null\n /** The other clips of the slide, as a gesture begins: what this one snaps to. */\n others(clipId: string): Placed[]\n select(clipId: string): void\n /** The snap lines to draw while a clip is dragged (empty: none). */\n guides(guides: Guide[]): void\n /** A drag is on (the stage hides the selected clip's floating actions meanwhile). */\n dragging(on: boolean): void\n /** The drag's result, once it ends. */\n commit(clipId: string, frame: Frame, shape?: Pick<Clip, 'rect' | 'aspect'>): void\n}\n\nexport interface StageItemProps {\n clip: Clip\n frame: Frame\n editable: boolean\n selected: boolean\n dim: boolean\n /** Its source label, under it (empty: none). */\n label: string\n host: StageItemHost\n}\n\ninterface Gesture {\n frame: Frame\n shape: Pick<Clip, 'rect' | 'aspect'>\n stage: DOMRect\n others: Placed[]\n guidesKey: string\n}\n\ntype Next = { frame: Frame; shape?: Pick<Clip, 'rect' | 'aspect'>; guides: Guide[] }\n\nexport const StageItem = memo(function StageItem({\n clip,\n frame,\n editable,\n selected,\n dim,\n label,\n host,\n}: StageItemProps) {\n const element = useRef<HTMLDivElement>(null)\n // Being reshaped: drawn as it will be (the one case that re-renders while dragging).\n const [reshape, setReshape] = useState<{\n frame: Frame\n shape: Pick<Clip, 'rect' | 'aspect'>\n } | null>(null)\n\n const shown = reshape ? { ...clip, ...reshape.shape } : clip\n const box = reshape?.frame ?? frame\n\n const gesture = usePointerGesture<Kind, Gesture, Next>({\n element,\n begin: () => {\n if (!editable) return null\n const stage = host.stageBox()\n if (!stage) return null\n host.select(clip.id)\n return {\n frame,\n shape: { rect: clip.rect, aspect: clip.aspect },\n stage,\n others: host.others(clip.id),\n guidesKey: '',\n }\n },\n // The first move: the drag is on (handles and actions hide; the layer is promoted).\n dragStart: () => {\n host.dragging(true)\n if (element.current) element.current.style.willChange = 'transform'\n },\n update: (g, kind, { dx: px, dy: py, event }) => {\n const dx = px / g.stage.width\n const dy = py / g.stage.height\n // Alt (Option) places freely, without snapping.\n const free = event.altKey\n if (isEdge(kind)) {\n const result = reshapeFrame(g.frame, g.shape, kind, dx, dy, g.others, free)\n return {\n frame: result.frame,\n shape: { rect: result.rect, aspect: result.aspect },\n guides: result.guides,\n }\n }\n return kind === 'move'\n ? moveFrame(g.frame, g.shape.aspect, dx, dy, g.others, free)\n : resizeFrame(g.frame, g.shape.aspect, kind, dx, dy, g.others, free)\n },\n apply: (g, next) => {\n const el = element.current\n if (!el) return\n if (next.shape) {\n setReshape({ frame: next.frame, shape: next.shape })\n } else {\n // Moved or resized: a transform from where the drag began (top left fixed as the origin).\n const dx = (next.frame.x - g.frame.x) * g.stage.width\n const dy = (next.frame.y - g.frame.y) * g.stage.height\n const scale = next.frame.w / g.frame.w\n el.style.transform = `translate3d(${dx}px, ${dy}px, 0) scale(${scale})`\n }\n const key = next.guides.map((guide) => `${guide.axis}${guide.at}`).join()\n if (key !== g.guidesKey) {\n g.guidesKey = key\n host.guides(next.guides)\n }\n },\n end: (_g, next) => {\n const el = element.current\n if (el) {\n el.style.transform = ''\n el.style.willChange = ''\n }\n if (!next) return // a click: the clip is selected, nothing moved\n setReshape(null)\n host.dragging(false)\n host.guides([])\n host.commit(clip.id, next.frame, next.shape)\n },\n })\n\n return (\n <div\n ref={element}\n className={cn(\n 'absolute origin-top-left',\n // Lifted off the background (a picture that is part of the slide's design is not).\n !clip.plain && 'rounded-[0.6cqw] shadow-[0_0.5cqw_1.6cqw_rgba(0,0,0,0.5)]',\n editable && 'cursor-move touch-none',\n selected && 'outline outline-2 outline-offset-2 outline-primary',\n dim && 'opacity-30'\n )}\n style={{\n left: `${box.x * 100}%`,\n top: `${box.y * 100}%`,\n width: `${box.w * 100}%`,\n height: `${frameHeight(box, shown.aspect) * 100}%`,\n }}\n onPointerDown={(event) => gesture.start(event, 'move')}\n {...gesture.handlers}\n data-testid={`stage-item-${clip.id}`}\n >\n {/* Softly rounded, with a faint light edge: crisp on any background. */}\n <div className={cn('absolute inset-0 overflow-hidden', !clip.plain && 'rounded-[0.6cqw]')}>\n <ClipImage clip={shown} live={!editable} />\n {/* A page's text fades out at the clip's edge rather than being sliced. */}\n {clip.kind === 'pdf' && !clip.plain && (\n <div\n className=\"pointer-events-none absolute inset-0\"\n style={{ background: EDGE_CSS }}\n data-testid=\"stage-clip-edge\"\n />\n )}\n {!clip.plain && (\n <div className=\"pointer-events-none absolute inset-0 rounded-[0.6cqw] ring-1 ring-inset ring-white/15\" />\n )}\n </div>\n {label && !clip.plain && (\n // Under the clip, in the room the layout keeps (CAPTION_SPACE): never over it.\n <div\n className=\"pointer-events-none absolute left-0 top-full mt-[0.5cqw] max-w-full truncate text-[1.7cqw] leading-tight\"\n style={{ color: TEXT_COLORS.muted }}\n >\n {label}\n </div>\n )}\n {/* A handle on each corner (a small dot in a finger-sized target), and a bar on each side's\n middle; their moves bubble to the clip's handlers while the gesture lasts. */}\n {selected &&\n CORNER_HANDLES.map(({ handle: corner, left, top, cursor }) => (\n <GestureHandle\n key={corner}\n left={left}\n top={top}\n cursor={cursor}\n onPointerDown={(event) => gesture.start(event, corner)}\n aria-label={`Resize from the ${corner} corner`}\n testId={`stage-item-resize-${corner}`}\n />\n ))}\n {selected &&\n SIDE_HANDLES.map(({ handle: edge, left, top, cursor }) => (\n <GestureHandle\n key={edge}\n left={left}\n top={top}\n cursor={cursor}\n bar={edge === 'n' || edge === 's' ? 'h' : 'v'}\n onPointerDown={(event) => gesture.start(event, edge)}\n aria-label={`Show more or less at the ${SIDE_NAMES[edge]}`}\n title=\"Drag to show more or less of the page\"\n testId={`stage-item-reshape-${edge}`}\n />\n ))}\n </div>\n )\n})\n","/** Text boxes' type as CSS (container units: it scales with the stage). */\n\nimport type { CSSProperties } from 'react'\nimport { DEFAULT_TEXT_SIZE, pointsToStage, type TextRun } from './boxes'\nimport { TEXT_COLORS } from './theme'\n\n/** A size in points as CSS (container units). */\nexport const cqw = (points: number) => `${pointsToStage(points) * 100}cqw`\n\nexport function runStyle(run: TextRun, font: string): CSSProperties {\n return {\n fontSize: cqw(run.size ?? DEFAULT_TEXT_SIZE),\n fontWeight: run.bold ? 700 : 400,\n fontStyle: run.italic ? 'italic' : undefined,\n textDecoration: run.underline ? 'underline' : undefined,\n color: run.color ?? TEXT_COLORS.body,\n fontFamily: run.font ? `\"${run.font}\", ${font}` : font,\n }\n}\n","/**\n * A text box or shape on the stage (`boxes`), drawn in CSS sized in container units so it scales\n * with the stage. In the editor it is selected with a click, moved by dragging it, resized from\n * its eight handles (its shape free), and typed in after a second click (a double click, or\n * Enter): the text is edited in place, in its own type.\n *\n * Like a clip, it moves on the GPU while dragged: a transform (or, resizing, its box) is set once\n * per animation frame and the new frame reaches the presentation when the drag ends.\n */\n\nimport { memo, useRef, useState, type CSSProperties } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport {\n CORNER_HANDLES,\n GestureHandle,\n SIDE_HANDLES,\n usePointerGesture,\n} from '../components/gestures'\nimport {\n DEFAULT_INSET,\n DEFAULT_TEXT_SIZE,\n boxText,\n firstRun,\n moveBox,\n stretchBox,\n type BoxFrame,\n type BoxHandle,\n type Paragraph,\n type SlideBox,\n} from './boxes'\nimport { STAGE_ASPECT } from './model'\nimport { TEXT_COLORS } from './theme'\nimport { cqw, runStyle } from './box-style'\n\n/** The eight handles, clockwise from the top left corner. */\nconst HANDLES: { handle: BoxHandle; left: string; top: string; cursor: string }[] = [\n CORNER_HANDLES[0],\n SIDE_HANDLES[0],\n CORNER_HANDLES[1],\n SIDE_HANDLES[1],\n CORNER_HANDLES[3],\n SIDE_HANDLES[2],\n CORNER_HANDLES[2],\n SIDE_HANDLES[3],\n]\n\nconst withAlpha = (hex: string, alpha = 1) => {\n if (alpha >= 1) return hex\n const n = parseInt(hex.slice(1), 16)\n return `rgba(${(n >> 16) & 255}, ${(n >> 8) & 255}, ${n & 255}, ${alpha})`\n}\n\n/** A box's shape and outline, as CSS. */\nfunction shapeStyle(box: SlideBox): CSSProperties {\n const { frame } = box\n const line = box.line\n // A rounded rectangle's corners: a sixth of its shorter side, as PowerPoint's default.\n const shorter = Math.min(frame.w, (frame.h * 1) / STAGE_ASPECT)\n return {\n background: box.fill && box.shape !== 'line' ? withAlpha(box.fill, box.fillAlpha) : undefined,\n border:\n line && box.shape !== 'line'\n ? `${cqw(line.width)} ${line.dash ? 'dashed' : 'solid'} ${line.color}`\n : undefined,\n borderRadius:\n box.shape === 'ellipse'\n ? '50%'\n : box.shape === 'roundRect'\n ? `${shorter * 16.67}cqw`\n : undefined,\n }\n}\n\nexport function Paragraphs({\n paragraphs,\n font,\n}: {\n paragraphs: readonly Paragraph[]\n font: string\n}) {\n return (\n <>\n {paragraphs.map((paragraph, index) => {\n const first = paragraph.runs[0]\n const size = first?.size ?? DEFAULT_TEXT_SIZE\n const indent = (paragraph.level ?? 0) * 0.5 * size\n const empty = !paragraph.runs.some((run) => run.text)\n return (\n <div\n key={index}\n className=\"whitespace-pre-wrap break-words\"\n style={{\n textAlign: paragraph.align ?? 'left',\n lineHeight: 1.2,\n paddingLeft: cqw(indent + (paragraph.bullet ? size * 0.9 : 0)),\n textIndent: paragraph.bullet ? cqw(-size * 0.9) : undefined,\n // An empty line keeps its height.\n fontSize: cqw(size),\n }}\n >\n {paragraph.bullet && (\n <span\n style={{\n ...runStyle(first ?? { text: '' }, font),\n display: 'inline-block',\n width: cqw(size * 0.9),\n textIndent: 0,\n }}\n >\n •\n </span>\n )}\n {empty\n ? '​'\n : paragraph.runs.map((run, i) => (\n <span key={i} style={runStyle(run, font)}>\n {run.text}\n </span>\n ))}\n </div>\n )\n })}\n </>\n )\n}\n\n/** What a stage gives its boxes (stable: the boxes are memoised). */\nexport interface StageBoxHost {\n stageBox(): DOMRect | null\n select(boxId: string): void\n commit(boxId: string, frame: BoxFrame): void\n setText(boxId: string, text: string): void\n}\n\nexport interface StageBoxProps {\n box: SlideBox\n /** The theme's typeface (CSS), for runs without one of their own. */\n font: string\n editable: boolean\n selected: boolean\n host: StageBoxHost\n}\n\ntype Kind = BoxHandle | 'move'\n\ninterface Gesture {\n frame: BoxFrame\n stage: DOMRect\n /** The box was already selected: a click on it (no move) starts typing. */\n wasSelected: boolean\n}\n\nexport const StageBox = memo(function StageBox({\n box,\n font,\n editable,\n selected,\n host,\n}: StageBoxProps) {\n const element = useRef<HTMLDivElement>(null)\n const [typing, setTyping] = useState(false)\n const [dragging, setDragging] = useState(false)\n const { frame } = box\n\n const gesture = usePointerGesture<Kind, Gesture, BoxFrame>({\n element,\n begin: () => {\n if (!editable || typing) return null\n const stage = host.stageBox()\n if (!stage) return null\n host.select(box.id)\n return { frame, stage, wasSelected: selected }\n },\n dragStart: () => setDragging(true),\n update: (g, handle, { dx, dy }) =>\n handle === 'move'\n ? moveBox(g.frame, dx / g.stage.width, dy / g.stage.height)\n : stretchBox(g.frame, handle, dx / g.stage.width, dy / g.stage.height),\n apply: (g, next, handle) => {\n const el = element.current\n if (!el) return\n if (handle === 'move') {\n el.style.translate = `${(next.x - g.frame.x) * g.stage.width}px ${(next.y - g.frame.y) * g.stage.height}px`\n } else {\n el.style.left = `${next.x * 100}%`\n el.style.top = `${next.y * 100}%`\n el.style.width = `${next.w * 100}%`\n el.style.height = `${next.h * 100}%`\n }\n },\n end: (g, next, handle) => {\n if (!next) {\n // A click: selected; on a box already selected, typing starts (as in PowerPoint).\n if (g.wasSelected && handle === 'move' && hasText) setTyping(true)\n return\n }\n const el = element.current\n if (el) {\n // Back to the frame React set (the committed one replaces it on the next render).\n el.style.translate = ''\n el.style.left = `${g.frame.x * 100}%`\n el.style.top = `${g.frame.y * 100}%`\n el.style.width = `${g.frame.w * 100}%`\n el.style.height = `${g.frame.h * 100}%`\n }\n setDragging(false)\n host.commit(box.id, next)\n },\n })\n\n const hasText = box.shape !== 'line'\n const inset = cqw(box.inset ?? DEFAULT_INSET)\n const run = firstRun(box)\n const transform = box.rotation ? `rotate(${box.rotation}deg)` : undefined\n\n return (\n <div\n ref={element}\n className={cn(\n 'absolute',\n editable ? 'pointer-events-auto' : 'pointer-events-none',\n editable && !typing && 'cursor-move touch-none',\n editable && !selected && 'hover:outline hover:outline-1 hover:outline-white/30',\n selected && 'outline outline-2 outline-offset-1 outline-primary'\n )}\n style={{\n left: `${frame.x * 100}%`,\n top: `${frame.y * 100}%`,\n width: `${frame.w * 100}%`,\n height: `${frame.h * 100}%`,\n transform,\n willChange: dragging ? 'translate' : undefined,\n }}\n onPointerDown={(event) => gesture.start(event, 'move')}\n {...gesture.handlers}\n onDoubleClick={() => editable && hasText && setTyping(true)}\n onKeyDown={(event) => {\n if (selected && !typing && event.key === 'Enter' && hasText) {\n event.preventDefault()\n setTyping(true)\n }\n }}\n tabIndex={editable ? 0 : undefined}\n data-testid={`stage-box-${box.id}`}\n >\n {box.shape === 'line' ? (\n <svg\n className=\"absolute inset-0 size-full overflow-visible\"\n preserveAspectRatio=\"none\"\n aria-hidden\n >\n <line\n x1=\"0%\"\n y1={box.flipV ? '100%' : '0%'}\n x2=\"100%\"\n y2={box.flipV ? '0%' : '100%'}\n stroke={box.line?.color ?? TEXT_COLORS.body}\n style={{ strokeWidth: cqw(box.line?.width ?? 1) }}\n strokeDasharray={box.line?.dash ? '6 4' : undefined}\n />\n </svg>\n ) : (\n <div\n className={cn(\n 'absolute inset-0 box-border flex flex-col overflow-hidden',\n box.anchor === 'middle' && 'justify-center',\n box.anchor === 'bottom' && 'justify-end'\n )}\n style={{ ...shapeStyle(box), padding: inset }}\n >\n {typing ? (\n <textarea\n autoFocus\n defaultValue={boxText(box)}\n className=\"pointer-events-auto w-full flex-1 resize-none bg-transparent p-0 outline-none\"\n style={{\n ...runStyle(run ?? { text: '' }, font),\n lineHeight: 1.2,\n textAlign: box.paragraphs[0]?.align ?? 'left',\n }}\n onPointerDown={(event) => event.stopPropagation()}\n onBlur={(event) => {\n host.setText(box.id, event.currentTarget.value)\n setTyping(false)\n }}\n onKeyDown={(event) => {\n event.stopPropagation()\n if (event.key === 'Escape') event.currentTarget.blur()\n }}\n aria-label=\"Text\"\n data-testid=\"stage-box-text-input\"\n />\n ) : boxText(box) || !editable ? (\n <Paragraphs paragraphs={box.paragraphs} font={font} />\n ) : (\n box.shape === 'text' && (\n <span\n className=\"text-white/40\"\n style={{ fontSize: cqw(run?.size ?? DEFAULT_TEXT_SIZE) }}\n >\n Double-click to type\n </span>\n )\n )}\n </div>\n )}\n {selected &&\n !typing &&\n !dragging &&\n HANDLES.filter(\n ({ handle }) =>\n box.shape !== 'line' ||\n handle === 'e' ||\n handle === 'w' ||\n handle === 'n' ||\n handle === 's'\n ).map(({ handle, left, top, cursor }) => (\n <GestureHandle\n key={handle}\n left={left}\n top={top}\n cursor={cursor}\n size=\"sm\"\n onPointerDown={(event) => gesture.start(event, handle)}\n aria-label={`Resize from ${handle}`}\n testId={`stage-box-resize-${handle}`}\n />\n ))}\n </div>\n )\n})\n","/**\n * The floating bar over a selected text box or shape: its type (smaller, larger, bold, its\n * colour), its fill and delete; italic, alignment and stacking in its \"…\". Colours are picked with\n * the system's colour picker.\n */\n\nimport type { ReactNode } from 'react'\nimport {\n AlignCenter,\n AlignLeft,\n AlignRight,\n AArrowDown,\n AArrowUp,\n Baseline,\n Bold,\n BringToFront,\n Italic,\n MoreHorizontal,\n PaintBucket,\n SendToBack,\n Trash2,\n} from 'lucide-react'\nimport {\n DropdownMenu,\n DropdownMenuCheckboxItem,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n cn,\n} from '@arbidocs/react/ui'\nimport { ACTION, Action } from './ClipActionBar'\nimport { DEFAULT_TEXT_SIZE, firstRun, styleRuns, type SlideBox, type TextAlign } from './boxes'\nimport { usePresentation } from './store'\nimport { TEXT_COLORS } from './theme'\n\nconst SIZE_STEPS = [8, 10, 12, 14, 16, 18, 20, 24, 28, 32, 36, 44, 54, 66, 80, 96]\n\nconst nextSize = (size: number, up: boolean) =>\n up\n ? (SIZE_STEPS.find((step) => step > size + 0.5) ?? size)\n : ([...SIZE_STEPS].reverse().find((step) => step < size - 0.5) ?? size)\n\nconst ALIGN_ICON: Record<TextAlign, ReactNode> = {\n left: <AlignLeft className=\"size-4\" />,\n center: <AlignCenter className=\"size-4\" />,\n right: <AlignRight className=\"size-4\" />,\n justify: <AlignLeft className=\"size-4\" />,\n}\n\n/** A button that opens the system colour picker. */\nfunction ColorAction({\n label,\n value,\n onChange,\n children,\n}: {\n label: string\n value: string\n onChange: (color: string) => void\n children: ReactNode\n}) {\n return (\n <label className={cn(ACTION, 'relative cursor-pointer')} title={label} aria-label={label}>\n {children}\n <span\n className=\"pointer-events-none absolute inset-x-1.5 bottom-0.5 h-0.5 rounded-full\"\n style={{ background: value }}\n />\n <input\n type=\"color\"\n value={value}\n onChange={(event) => onChange(event.target.value)}\n className=\"absolute inset-0 size-full cursor-pointer opacity-0\"\n aria-label={label}\n />\n </label>\n )\n}\n\nexport interface BoxActionBarProps {\n box: SlideBox\n onRemoved: () => void\n}\n\nexport function BoxActionBar({ box, onRemoved }: BoxActionBarProps) {\n const actions = usePresentation.getState()\n const run = firstRun(box)\n const size = run?.size ?? DEFAULT_TEXT_SIZE\n const align = box.paragraphs[0]?.align ?? 'left'\n const update = (change: (b: SlideBox) => SlideBox) => actions.updateBox(box.id, change)\n const text = box.shape !== 'line'\n const top = Math.max(0, box.frame.y)\n return (\n <div\n role=\"toolbar\"\n aria-label=\"Text box\"\n className=\"absolute z-20 flex items-center gap-0.5 rounded-md border border-border bg-background p-0.5 shadow-md\"\n style={{\n left: `${Math.min(Math.max(0, box.frame.x), 0.6) * 100}%`,\n top: `calc(${top * 100}% - 40px)`,\n }}\n onPointerDown={(event) => event.stopPropagation()}\n data-testid=\"box-action-bar\"\n >\n {text && (\n <>\n <Action\n label=\"Smaller\"\n onClick={() =>\n update((b) => styleRuns(b, (r) => ({ ...r, size: nextSize(r.size ?? size, false) })))\n }\n >\n <AArrowDown className=\"size-4\" />\n </Action>\n <span\n className=\"w-7 text-center text-xs tabular-nums text-muted-foreground\"\n data-testid=\"box-text-size\"\n >\n {Math.round(size)}\n </span>\n <Action\n label=\"Larger\"\n onClick={() =>\n update((b) => styleRuns(b, (r) => ({ ...r, size: nextSize(r.size ?? size, true) })))\n }\n >\n <AArrowUp className=\"size-4\" />\n </Action>\n <Action\n label=\"Bold\"\n onClick={() => update((b) => styleRuns(b, (r) => ({ ...r, bold: !run?.bold })))}\n >\n <Bold className={cn('size-4', run?.bold && 'text-primary')} />\n </Action>\n <ColorAction\n label=\"Text colour\"\n value={run?.color ?? TEXT_COLORS.body}\n onChange={(color) => update((b) => styleRuns(b, (r) => ({ ...r, color })))}\n >\n <Baseline className=\"size-4\" />\n </ColorAction>\n </>\n )}\n <ColorAction\n label={box.shape === 'line' ? 'Line colour' : 'Fill'}\n value={(box.shape === 'line' ? box.line?.color : box.fill) ?? '#ffffff'}\n onChange={(color) =>\n update((b) =>\n b.shape === 'line'\n ? { ...b, line: { width: b.line?.width ?? 2, ...b.line, color } }\n : { ...b, fill: color, shape: b.shape === 'text' ? 'rect' : b.shape }\n )\n }\n >\n <PaintBucket className=\"size-4\" />\n </ColorAction>\n {/* The rest, behind \"…\": italic, alignment, in front of or behind the clips. */}\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n className={ACTION}\n title=\"More\"\n aria-label=\"More\"\n data-testid=\"box-more-menu\"\n >\n <MoreHorizontal className=\"size-4\" />\n </button>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\">\n {text && (\n <>\n <DropdownMenuCheckboxItem\n checked={!!run?.italic}\n onCheckedChange={() =>\n update((b) => styleRuns(b, (r) => ({ ...r, italic: !run?.italic })))\n }\n >\n <Italic className=\"size-4\" />\n <span className=\"ml-2\">Italic</span>\n </DropdownMenuCheckboxItem>\n {(['left', 'center', 'right'] as const).map((value) => (\n <DropdownMenuCheckboxItem\n key={value}\n checked={align === value}\n onCheckedChange={() =>\n update((b) => ({\n ...b,\n paragraphs: b.paragraphs.map((p) => ({ ...p, align: value })),\n }))\n }\n >\n {ALIGN_ICON[value]}\n <span className=\"ml-2\">\n {value === 'left'\n ? 'Align left'\n : value === 'center'\n ? 'Centre'\n : 'Align right'}\n </span>\n </DropdownMenuCheckboxItem>\n ))}\n <DropdownMenuSeparator />\n </>\n )}\n <DropdownMenuItem onSelect={() => actions.restackBox(box.id, 'front')}>\n <BringToFront className=\"size-4\" />\n <span className=\"ml-2\">In front of the clips</span>\n </DropdownMenuItem>\n <DropdownMenuItem onSelect={() => actions.restackBox(box.id, 'back')}>\n <SendToBack className=\"size-4\" />\n <span className=\"ml-2\">Behind the clips</span>\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n <button\n type=\"button\"\n className={cn(ACTION, 'text-destructive hover:bg-destructive/10')}\n title=\"Delete (Delete)\"\n aria-label=\"Delete\"\n onClick={() => {\n actions.removeBox(box.id)\n onRemoved()\n }}\n >\n <Trash2 className=\"size-4\" />\n </button>\n </div>\n )\n}\n","/**\n * Dragging a clip from the tray onto a slide, with pointer events: the same for a mouse, a pen and\n * a finger (HTML drag and drop does not work on touch screens). A drag starts once the pointer has\n * moved a little; a thumbnail follows it; on release, what is under it decides: the stage (the\n * clip goes on the current slide where it was dropped) or a slide chip (on that slide). A press\n * that does not move is a tap.\n *\n * Drop targets are marked with `data-presentation-drop` (\"stage\", or \"slide\" with\n * `data-slide-index`), so they are found under the pointer in whichever window the tray is in.\n */\n\nimport { useRef, useState, type PointerEvent as ReactPointerEvent } from 'react'\nimport { usePresentation } from './store'\n\n/** How far (px) the pointer moves before a press becomes a drag. */\nconst DRAG_THRESHOLD = 6\n\nexport const DROP_ATTRIBUTE = 'data-presentation-drop'\n\nexport interface ClipDrag {\n /** Where the dragged thumbnail is (client px), while dragging. */\n ghost: { x: number; y: number } | null\n handlers: {\n onPointerDown: (event: ReactPointerEvent<HTMLElement>) => void\n onPointerMove: (event: ReactPointerEvent<HTMLElement>) => void\n onPointerUp: (event: ReactPointerEvent<HTMLElement>) => void\n onPointerCancel: () => void\n }\n}\n\n/** Drop a clip at a point of the window: on the stage there, or on a slide chip. */\nfunction dropAt(doc: Document, clipId: string, x: number, y: number): boolean {\n const target = doc.elementFromPoint(x, y)?.closest(`[${DROP_ATTRIBUTE}]`)\n if (!target) return false\n const state = usePresentation.getState()\n if (target.getAttribute(DROP_ATTRIBUTE) === 'slide') {\n const index = Number(target.getAttribute('data-slide-index'))\n if (!Number.isInteger(index)) return false\n state.goTo(index)\n state.place(clipId)\n return true\n }\n // A slide's stage (the editor shows them all): that slide, at the point.\n const index = Number(target.getAttribute('data-slide-index'))\n if (target.hasAttribute('data-slide-index') && Number.isInteger(index)) state.goTo(index)\n const box = target.getBoundingClientRect()\n state.place(clipId, { x: (x - box.left) / box.width, y: (y - box.top) / box.height })\n return true\n}\n\nexport function useClipDrag(clipId: string, onTap: () => void): ClipDrag {\n const press = useRef<{ x: number; y: number; dragging: boolean } | null>(null)\n const [ghost, setGhost] = useState<{ x: number; y: number } | null>(null)\n\n const end = () => {\n press.current = null\n setGhost(null)\n usePresentation.getState().setDragging(null)\n }\n\n return {\n ghost,\n handlers: {\n onPointerDown: (event) => {\n if (event.button !== 0) return\n press.current = { x: event.clientX, y: event.clientY, dragging: false }\n },\n onPointerMove: (event) => {\n const p = press.current\n if (!p) return\n if (!p.dragging) {\n if (Math.hypot(event.clientX - p.x, event.clientY - p.y) < DRAG_THRESHOLD) return\n p.dragging = true\n // Keep receiving the pointer wherever it goes, and stop the browser scrolling for it.\n event.currentTarget.setPointerCapture(event.pointerId)\n usePresentation.getState().setDragging(clipId)\n }\n event.preventDefault()\n setGhost({ x: event.clientX, y: event.clientY })\n },\n onPointerUp: (event) => {\n const p = press.current\n if (p?.dragging)\n dropAt(event.currentTarget.ownerDocument, clipId, event.clientX, event.clientY)\n else if (p) onTap()\n end()\n },\n onPointerCancel: end,\n },\n }\n}\n","/**\n * The 16:9 stage: a slide's clips in their frames, its title, points and logo, as large as the\n * container allows. Presenting shows it bare; the editor's copy is `editable`: each clip\n * (`StageItem`) is moved, resized and reshaped by dragging, snapping with guide lines; clips are\n * selected for their floating actions, and clips dragged from the tray are dropped onto it.\n *\n * A slide's stage re-renders only when its slide (or the clips, theme or labels) change; a clip's\n * drag re-renders nothing here but the guides and, at its start and end, the floating actions.\n */\n\nimport {\n forwardRef,\n memo,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ClipActionBar } from './ClipActionBar'\nimport { SlideDecor, type SlideTextEditing } from './SlideDecor'\nimport { StageItem, type StageItemHost } from './StageItem'\nimport { StageBox, type StageBoxHost } from './StageBox'\nimport { BoxActionBar } from './BoxActionBar'\nimport { FONTS, backgroundCss, slideBackgroundCss } from './theme'\nimport { clipLabel, type Clip, type Frame, type Guide, type Slide } from './model'\nimport { usePresentation } from './store'\nimport { DROP_ATTRIBUTE } from './useClipDrag'\n\nexport interface PresentationStageProps {\n editable?: boolean\n /** The slide shown (default: the current one). */\n slideIndex?: number\n /**\n * A slide that is not one of the presentation's, shown with its own clips (the viewer's\n * spotlight); the presentation's look still applies.\n */\n show?: { slide: Slide; clips: readonly Clip[] }\n selected?: string | null\n onSelect?: (clipId: string | null) => void\n /** Offered on a selected image clip: make a new version of it. */\n onEditImage?: (clipId: string) => void\n /** Offered on a selected image clip: choose the part of the image it shows. */\n onCropImage?: (clipId: string) => void\n /** Typing the slide's title and points on the slide itself (the editor's stages). */\n textEditing?: SlideTextEditing\n /** Over the slide (e.g. the editor's hover actions). */\n overlay?: ReactNode\n className?: string\n}\n\nexport interface GuideLayerHandle {\n set(guides: Guide[]): void\n}\n\n/** The snap lines of a dragged clip: its own state, so drawing them re-renders nothing else. */\nconst GuideLayer = memo(\n forwardRef<GuideLayerHandle>(function GuideLayer(_, ref) {\n const [guides, setGuides] = useState<Guide[]>([])\n useImperativeHandle(ref, () => ({ set: setGuides }), [])\n return (\n <>\n {guides.map((guide) => (\n <div\n key={`${guide.axis}-${guide.at}`}\n className=\"pointer-events-none absolute z-10 bg-primary\"\n style={\n guide.axis === 'x'\n ? { left: `${guide.at * 100}%`, top: 0, bottom: 0, width: 1 }\n : { top: `${guide.at * 100}%`, left: 0, right: 0, height: 1 }\n }\n data-testid={`stage-guide-${guide.axis}`}\n />\n ))}\n </>\n )\n })\n)\n\nexport function PresentationStage({\n editable = false,\n slideIndex,\n show,\n selected = null,\n onSelect,\n onEditImage,\n onCropImage,\n textEditing,\n overlay,\n className,\n}: PresentationStageProps) {\n const index = usePresentation((s) => slideIndex ?? s.current)\n const deckSlide = usePresentation((s) => s.slides[index])\n const deckClips = usePresentation((s) => s.clips)\n const slide = show?.slide ?? deckSlide\n const clips = show?.clips ?? deckClips\n const blank = usePresentation((s) => s.blank && !editable && !show)\n const captions = usePresentation((s) => s.captions)\n const columnValues = usePresentation((s) => s.columnValues)\n const theme = usePresentation((s) => s.theme)\n const logoImage = usePresentation((s) => s.logoImage)\n const media = usePresentation((s) => s.media)\n const stageRef = useRef<HTMLDivElement>(null)\n const guideLayer = useRef<GuideLayerHandle>(null)\n // A clip dragged from the tray: the stage shows it can take it.\n const dropping = usePresentation((s) => editable && s.dragging !== null)\n // A clip being dragged on the stage: its floating actions hide meanwhile.\n const [dragging, setDragging] = useState(false)\n\n // The latest values the clips' gestures read as they begin (the host itself never changes).\n const latest = useRef({ slide, clips, index, onSelect })\n latest.current = { slide, clips, index, onSelect }\n const host = useMemo<StageItemHost>(\n () => ({\n stageBox: () => stageRef.current?.getBoundingClientRect() ?? null,\n others: (clipId) => {\n const { slide: current, clips: all } = latest.current\n return (current?.items ?? [])\n .filter((item) => item.clipId !== clipId)\n .map((item) => ({\n frame: item.frame,\n aspect: all.find((clip) => clip.id === item.clipId)?.aspect ?? 1,\n }))\n },\n select: (clipId) => {\n usePresentation.getState().goTo(latest.current.index)\n latest.current.onSelect?.(clipId)\n },\n guides: (guides) => guideLayer.current?.set(guides),\n dragging: setDragging,\n commit: (clipId: string, frame: Frame, shape?: Pick<Clip, 'rect' | 'aspect'>) => {\n const state = usePresentation.getState()\n state.goTo(latest.current.index)\n if (shape) state.reshapeClip(clipId, frame, shape.rect, shape.aspect)\n else state.setFrame(clipId, frame)\n },\n }),\n []\n )\n\n const boxHost = useMemo<StageBoxHost>(\n () => ({\n stageBox: () => stageRef.current?.getBoundingClientRect() ?? null,\n select: (boxId) => {\n usePresentation.getState().goTo(latest.current.index)\n latest.current.onSelect?.(boxId)\n },\n commit: (boxId, frame) =>\n usePresentation.getState().updateBox(boxId, (box) => ({ ...box, frame })),\n setText: (boxId, text) => usePresentation.getState().setBoxText(boxId, text),\n }),\n []\n )\n const font = FONTS[theme.font].css\n const boxes = slide?.boxes ?? []\n const selectedBox = selected ? boxes.find((box) => box.id === selected) : undefined\n const renderBoxes = (front: boolean) =>\n boxes\n .filter((box) => !!box.front === front)\n .map((box) => (\n <StageBox\n key={box.id}\n box={box}\n font={font}\n editable={editable}\n selected={editable && selected === box.id}\n host={boxHost}\n />\n ))\n\n const clipOf = (id: string): Clip | undefined => clips.find((clip) => clip.id === id)\n const selectedFrame = selected\n ? slide?.items.find((item) => item.clipId === selected)?.frame\n : undefined\n\n // Scrolling over the selected clip (wheel or trackpad; Shift for sideways) scrolls what it shows\n // over its source: the lines above or below, say. A native listener, so the editor itself does\n // not scroll; steps are gathered and applied once per animation frame.\n useEffect(() => {\n const stage = stageRef.current\n const view = stage?.ownerDocument.defaultView\n if (!editable || !selected || !stage || !view) return\n let sum = { x: 0, y: 0 }\n let request: number | null = null\n const onWheel = (event: WheelEvent) => {\n const item = (event.target as Element | null)?.closest?.(\n `[data-testid=\"stage-item-${selected}\"]`\n )\n const clip = usePresentation.getState().clips.find((entry) => entry.id === selected)\n if (!item || !clip) return\n event.preventDefault()\n const box = item.getBoundingClientRect()\n const horizontal = event.shiftKey && !event.deltaX\n const deltaX = horizontal ? event.deltaY : event.deltaX\n const deltaY = horizontal ? 0 : event.deltaY\n // Screen pixels to fractions of the source: the clip's area spans the clip's box.\n sum = {\n x: sum.x + (deltaX / box.width) * clip.rect.w,\n y: sum.y + (deltaY / box.height) * clip.rect.h,\n }\n request ??= view.requestAnimationFrame(() => {\n request = null\n usePresentation.getState().panClip(selected, sum.x, sum.y)\n sum = { x: 0, y: 0 }\n })\n }\n stage.addEventListener('wheel', onWheel, { passive: false })\n return () => {\n stage.removeEventListener('wheel', onWheel)\n if (request !== null) view.cancelAnimationFrame(request)\n }\n }, [editable, selected])\n\n return (\n <div\n className={cn('relative h-full w-full', !editable && 'overflow-hidden bg-black', className)}\n // The stage's size comes from this box's (container query units): 16:9, as large as fits.\n style={{ containerType: 'size' }}\n data-testid={editable ? 'presentation-stage-editor' : 'presentation-stage'}\n >\n <div\n ref={stageRef}\n className={cn(\n 'absolute inset-0 m-auto',\n editable ? 'shadow-md' : 'overflow-hidden',\n dropping && 'outline outline-2 outline-offset-2 outline-primary'\n )}\n style={{\n width: 'min(100cqw, calc(100cqh * 16 / 9))',\n height: 'min(100cqh, calc(100cqw * 9 / 16))',\n containerType: 'inline-size',\n background: slide?.background\n ? slideBackgroundCss(slide.background, media)\n : backgroundCss(theme.background),\n fontFamily: FONTS[theme.font].css,\n }}\n onPointerDown={() => {\n if (!editable) return\n usePresentation.getState().goTo(index)\n onSelect?.(null)\n }}\n {...(editable ? { [DROP_ATTRIBUTE]: 'stage', 'data-slide-index': index } : {})}\n aria-label={`Slide ${index + 1}`}\n >\n {/* Blanked: the shared stage is black. */}\n {blank && <div className=\"absolute inset-0 z-20 bg-black\" />}\n {/* The title, points and logo, by the slide's layout. */}\n {slide && (\n <SlideDecor\n slide={slide}\n theme={theme}\n labels={captions}\n logoImage={logoImage}\n editable={editable}\n editing={textEditing}\n />\n )}\n {renderBoxes(false)}\n {slide?.items.map((item) => {\n const clip = clipOf(item.clipId)\n if (!clip) return null\n return (\n <StageItem\n key={clip.id}\n clip={clip}\n frame={item.frame}\n editable={editable}\n selected={editable && selected === clip.id}\n dim={false}\n label={captions ? clipLabel(clip, columnValues) : ''}\n host={host}\n />\n )\n })}\n {renderBoxes(true)}\n {/* Smart guides: the lines the dragged clip snapped to (editor only). */}\n {editable && <GuideLayer ref={guideLayer} />}\n {/* The selected clip's floating actions, above it (the stage leaves room). */}\n {editable && selectedFrame && selected && !dragging && (\n <ClipActionBar\n clipId={selected}\n at={selectedFrame}\n onRemoved={() => onSelect?.(null)}\n onEditImage={\n onEditImage && clipOf(selected)?.kind === 'image'\n ? () => onEditImage(selected)\n : undefined\n }\n onCropImage={\n onCropImage && clipOf(selected)?.kind === 'image'\n ? () => onCropImage(selected)\n : undefined\n }\n />\n )}\n {editable && selectedBox && (\n <BoxActionBar box={selectedBox} onRemoved={() => onSelect?.(null)} />\n )}\n {overlay}\n </div>\n </div>\n )\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkC36NH6PR_cjs = require('./chunk-C36NH6PR.cjs');
4
+ var chunkSH7W4WVI_cjs = require('./chunk-SH7W4WVI.cjs');
5
5
  var chunkZBP4ZSAJ_cjs = require('./chunk-ZBP4ZSAJ.cjs');
6
6
  var jsxRuntime = require('react/jsx-runtime');
7
7
  var react = require('react');
@@ -26,7 +26,7 @@ function TranscriptEntry({
26
26
  {
27
27
  speakerId,
28
28
  speakerName,
29
- speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkC36NH6PR_cjs.CallUserPill, { identity: speakerId, name: speakerName }),
29
+ speaker: /* @__PURE__ */ jsxRuntime.jsx(chunkSH7W4WVI_cjs.CallUserPill, { identity: speakerId, name: speakerName }),
30
30
  time: formatTime(at),
31
31
  text,
32
32
  continued,
@@ -57,5 +57,5 @@ exports.TranscriptEntry = TranscriptEntry;
57
57
  exports.TranscriptRunsContext = TranscriptRunsContext;
58
58
  exports.threadTranscriptRuns = threadTranscriptRuns;
59
59
  exports.useTranscriptRuns = useTranscriptRuns;
60
- //# sourceMappingURL=chunk-JOYB727S.cjs.map
61
- //# sourceMappingURL=chunk-JOYB727S.cjs.map
60
+ //# sourceMappingURL=chunk-3GQQUR27.cjs.map
61
+ //# sourceMappingURL=chunk-3GQQUR27.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/calls/connected/TranscriptEntry.tsx","../src/calls/connected/transcript-runs-context.ts"],"names":["jsx","TranscriptLine","CallUserPill","createContext","useContext","transcriptSegmentOf","transcriptRuns"],"mappings":";;;;;;;;AAUA,SAAS,WAAW,GAAA,EAAwC;AAC1D,EAAA,IAAI,CAAC,KAAK,OAAO,EAAA;AACjB,EAAA,MAAM,EAAA,GAAK,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AACzB,EAAA,IAAI,MAAA,CAAO,KAAA,CAAM,EAAE,CAAA,EAAG,OAAO,EAAA;AAC7B,EAAA,OAAO,IAAI,IAAA,CAAK,EAAE,CAAA,CAAE,kBA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CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,EAAE,MAAA,CAAO,CAAC,EAAA,KAAqB,CAAC,CAAC,EAAE;AAAA;AACjF,GACF;AACF","file":"chunk-JOYB727S.cjs","sourcesContent":["/**\n * One stored line of a call transcript in its conversation (meeting chat or workspace meeting\n * thread): `TranscriptLine` from `@arbidocs/blocks`, centred for everyone. What someone is saying\n * right now shows as a provisional \"is speaking…\" row below, not as a highlight on a past line.\n */\n\nimport type { ReactElement } from 'react'\nimport { TranscriptLine } from '../../chat/TranscriptLine'\nimport { CallUserPill } from './CallUserPill'\n\nfunction formatTime(iso: string | null | undefined): string {\n if (!iso) return ''\n const at = Date.parse(iso)\n if (Number.isNaN(at)) return ''\n return new Date(at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n}\n\nexport function TranscriptEntry({\n speakerId,\n speakerName,\n text,\n at,\n continued = false,\n className,\n}: {\n /** The speaker's identity (user ext id), for `data-speaker`. */\n speakerId: string\n /** The name to show (\"Me\" for my own lines). */\n speakerName: string\n text: string\n /** ISO time the segment started (or the message was stored). */\n at: string | null | undefined\n /** A further line of the same speaker's run (no name repeated). */\n continued?: boolean\n className?: string\n}): ReactElement {\n return (\n <TranscriptLine\n speakerId={speakerId}\n speakerName={speakerName}\n speaker={<CallUserPill identity={speakerId} name={speakerName} />}\n time={formatTime(at)}\n text={text}\n continued={continued}\n className={className}\n />\n )\n}\n","/**\n * How a meeting thread's transcript lines group: which messages continue their speaker's run (the\n * name is not repeated). Provided by the conversation page, read by each transcript message.\n */\n\nimport { createContext, useContext } from 'react'\nimport { transcriptRuns } from '../../chat/transcript-runs'\nimport { transcriptSegmentOf } from '@arbidocs/react'\n\nexport interface TranscriptRunInfo {\n continued: ReadonlySet<string>\n}\n\nconst EMPTY: TranscriptRunInfo = { continued: new Set() }\n\nexport const TranscriptRunsContext = createContext<TranscriptRunInfo>(EMPTY)\n\nexport function useTranscriptRuns(): TranscriptRunInfo {\n return useContext(TranscriptRunsContext)\n}\n\ninterface ThreadMessageLike {\n external_id?: string | null\n created_at?: string | null\n tools?: unknown\n meta?: { tools?: unknown } | null\n}\n\n/** Runs of a thread's messages (in display order). */\nexport function threadTranscriptRuns(messages: ThreadMessageLike[]): TranscriptRunInfo {\n const segmentOf = (m: ThreadMessageLike) => transcriptSegmentOf(m.tools ?? m.meta?.tools)\n const continuedItems = transcriptRuns(\n messages,\n (m) => segmentOf(m)?.speaker_ext_id ?? null,\n (m) => Date.parse(segmentOf(m)?.started_at ?? m.created_at ?? '') || 0\n )\n return {\n continued: new Set(\n [...continuedItems].map((m) => m.external_id).filter((id): id is string => !!id)\n ),\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/calls/connected/TranscriptEntry.tsx","../src/calls/connected/transcript-runs-context.ts"],"names":["jsx","TranscriptLine","CallUserPill","createContext","useContext","transcriptSegmentOf","transcriptRuns"],"mappings":";;;;;;;;AAUA,SAAS,WAAW,GAAA,EAAwC;AAC1D,EAAA,IAAI,CAAC,KAAK,OAAO,EAAA;AACjB,EAAA,MAAM,EAAA,GAAK,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AACzB,EAAA,IAAI,MAAA,CAAO,KAAA,CAAM,EAAE,CAAA,EAAG,OAAO,EAAA;AAC7B,EAAA,OAAO,IAAI,IAAA,CAAK,EAAE,CAAA,CAAE,kBAAA,CAAmB,EAAC,EAAG,EAAE,IAAA,EAAM,SAAA,EAAW,MAAA,EAAQ,SAAA,EAAW,CAAA;AACnF;AAEO,SAAS,eAAA,CAAgB;AAAA,EAC9B,SAAA;AAAA,EACA,WAAA;AAAA,EACA,IAAA;AAAA,EACA,EAAA;AAAA,EACA,SAAA,GAAY,KAAA;AAAA,EACZ;AACF,CAAA,EAWiB;AACf,EAAA,uBACEA,cAAA;AAAA,IAACC,gCAAA;AAAA,IAAA;AAAA,MACC,SAAA;AAAA,MACA,WAAA;AAAA,MACA,yBAASD,cAAA,CAACE,8BAAA,EAAA,EAAa,QAAA,EAAU,SAAA,EAAW,MAAM,WAAA,EAAa,CAAA;AAAA,MAC/D,IAAA,EAAM,WAAW,EAAE,CAAA;AAAA,MACnB,IAAA;AAAA,MACA,SAAA;AAAA,MACA;AAAA;AAAA,GACF;AAEJ;AClCA,IAAM,KAAA,GAA2B,EAAE,SAAA,kBAAW,IAAI,KAAI,EAAE;AAEjD,IAAM,qBAAA,GAAwBC,oBAAiC,KAAK;AAEpE,SAAS,iBAAA,GAAuC;AACrD,EAAA,OAAOC,iBAAW,qBAAqB,CAAA;AACzC;AAUO,SAAS,qBAAqB,QAAA,EAAkD;AACrF,EAAA,MAAM,SAAA,GAAY,CAAC,CAAA,KAAyBC,2BAAA,CAAoB,EAAE,KAAA,IAAS,CAAA,CAAE,MAAM,KAAK,CAAA;AACxF,EAAA,MAAM,cAAA,GAAiBC,gCAAA;AAAA,IACrB,QAAA;AAAA,IACA,CAAC,CAAA,KAAM,SAAA,CAAU,CAAC,GAAG,cAAA,IAAkB,IAAA;AAAA,IACvC,CAAC,CAAA,KAAM,IAAA,CAAK,KAAA,CAAM,SAAA,CAAU,CAAC,CAAA,EAAG,UAAA,IAAc,CAAA,CAAE,UAAA,IAAc,EAAE,CAAA,IAAK;AAAA,GACvE;AACA,EAAA,OAAO;AAAA,IACL,WAAW,IAAI,GAAA;AAAA,MACb,CAAC,GAAG,cAAc,CAAA,CAAE,IAAI,CAAC,CAAA,KAAM,CAAA,CAAE,WAAW,EAAE,MAAA,CAAO,CAAC,EAAA,KAAqB,CAAC,CAAC,EAAE;AAAA;AACjF,GACF;AACF","file":"chunk-3GQQUR27.cjs","sourcesContent":["/**\n * One stored line of a call transcript in its conversation (meeting chat or workspace meeting\n * thread): `TranscriptLine` from `@arbidocs/blocks`, centred for everyone. What someone is saying\n * right now shows as a provisional \"is speaking…\" row below, not as a highlight on a past line.\n */\n\nimport type { ReactElement } from 'react'\nimport { TranscriptLine } from '../../chat/TranscriptLine'\nimport { CallUserPill } from './CallUserPill'\n\nfunction formatTime(iso: string | null | undefined): string {\n if (!iso) return ''\n const at = Date.parse(iso)\n if (Number.isNaN(at)) return ''\n return new Date(at).toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })\n}\n\nexport function TranscriptEntry({\n speakerId,\n speakerName,\n text,\n at,\n continued = false,\n className,\n}: {\n /** The speaker's identity (user ext id), for `data-speaker`. */\n speakerId: string\n /** The name to show (\"Me\" for my own lines). */\n speakerName: string\n text: string\n /** ISO time the segment started (or the message was stored). */\n at: string | null | undefined\n /** A further line of the same speaker's run (no name repeated). */\n continued?: boolean\n className?: string\n}): ReactElement {\n return (\n <TranscriptLine\n speakerId={speakerId}\n speakerName={speakerName}\n speaker={<CallUserPill identity={speakerId} name={speakerName} />}\n time={formatTime(at)}\n text={text}\n continued={continued}\n className={className}\n />\n )\n}\n","/**\n * How a meeting thread's transcript lines group: which messages continue their speaker's run (the\n * name is not repeated). Provided by the conversation page, read by each transcript message.\n */\n\nimport { createContext, useContext } from 'react'\nimport { transcriptRuns } from '../../chat/transcript-runs'\nimport { transcriptSegmentOf } from '@arbidocs/react'\n\nexport interface TranscriptRunInfo {\n continued: ReadonlySet<string>\n}\n\nconst EMPTY: TranscriptRunInfo = { continued: new Set() }\n\nexport const TranscriptRunsContext = createContext<TranscriptRunInfo>(EMPTY)\n\nexport function useTranscriptRuns(): TranscriptRunInfo {\n return useContext(TranscriptRunsContext)\n}\n\ninterface ThreadMessageLike {\n external_id?: string | null\n created_at?: string | null\n tools?: unknown\n meta?: { tools?: unknown } | null\n}\n\n/** Runs of a thread's messages (in display order). */\nexport function threadTranscriptRuns(messages: ThreadMessageLike[]): TranscriptRunInfo {\n const segmentOf = (m: ThreadMessageLike) => transcriptSegmentOf(m.tools ?? m.meta?.tools)\n const continuedItems = transcriptRuns(\n messages,\n (m) => segmentOf(m)?.speaker_ext_id ?? null,\n (m) => Date.parse(segmentOf(m)?.started_at ?? m.created_at ?? '') || 0\n )\n return {\n continued: new Set(\n [...continuedItems].map((m) => m.external_id).filter((id): id is string => !!id)\n ),\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkYZBDHBKI_cjs = require('./chunk-YZBDHBKI.cjs');
4
+ var chunkK67VMSOX_cjs = require('./chunk-K67VMSOX.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: chunkYZBDHBKI_cjs.confirmDialog,
110
- choose: chunkYZBDHBKI_cjs.choiceDialog,
111
- openDialog: chunkYZBDHBKI_cjs.openDialog,
112
- closeDialog: chunkYZBDHBKI_cjs.closeDialog,
109
+ confirm: chunkK67VMSOX_cjs.confirmDialog,
110
+ choose: chunkK67VMSOX_cjs.choiceDialog,
111
+ openDialog: chunkK67VMSOX_cjs.openDialog,
112
+ closeDialog: chunkK67VMSOX_cjs.closeDialog,
113
113
  runtimeConfig: {
114
114
  apiBaseUrl: "",
115
115
  deploymentDomain: typeof window !== "undefined" ? window.location.host : ""
@@ -208,5 +208,5 @@ exports.useCalendarViewStore = useCalendarViewStore;
208
208
  exports.useIntentRequest = useIntentRequest;
209
209
  exports.useRequestedSettingsSection = useRequestedSettingsSection;
210
210
  exports.workflowOpenRequest = workflowOpenRequest;
211
- //# sourceMappingURL=chunk-VMXTOIXB.cjs.map
212
- //# sourceMappingURL=chunk-VMXTOIXB.cjs.map
211
+ //# sourceMappingURL=chunk-46LX6EQT.cjs.map
212
+ //# sourceMappingURL=chunk-46LX6EQT.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":";;;;;;;;AA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XTOIXB.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 /** `run` on a saved workflow: the workspace to start it in. */\n runIn?: string\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 * `run` on a saved workflow: the workspace to start it in (opened for the run, its pickers that\n * workspace's), e.g. a matter's for a process of the skills workspace. Absent: the open one.\n */\n runIn?: 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({\n workflowId: id,\n view: options?.view,\n preset: options?.preset,\n runIn: options?.runIn,\n })\n openWorkflow(id, options)\n }),\n openNewConversation:\n recordingIntent(environment.openNewConversation, (openNewConversation) => (options) => {\n openNewConversation(options)\n // After the host's reset of the new conversation, which clears its draft.\n const prompt = options?.prompt?.trim()\n if (prompt) conversationStartRequest.request(prompt)\n }) ?? noop,\n }\n complete.add(value)\n return value\n}\n\n/**\n * The environment with every field filled in (the defaults where `environment` gives none), and\n * every intent recording what it opens on. A host calls it for code outside React (a store action,\n * a notification handler); passing the result as the host configuration's `environment` uses it\n * as is.\n */\nexport function createBlocksEnvironment(\n environment: Partial<BlocksEnvironment>\n): BlocksEnvironment {\n if (complete.has(environment as BlocksEnvironment)) return environment as BlocksEnvironment\n let value = resolved.get(environment)\n if (!value) resolved.set(environment, (value = resolve(environment)))\n return value\n}\n\n/** The host's environment, every field filled in (the defaults where the host gives none). */\nexport function useBlocksEnvironment(): BlocksEnvironment {\n const environment = useHostConfigRecord().environment as Partial<BlocksEnvironment> | undefined\n return environment ? createBlocksEnvironment(environment) : defaultEnvironment\n}\n\n/** Open and close the global dialogs (`<ConnectedGlobalDialogs>`), the host's way. */\nexport function useBlocksDialogs(): Pick<BlocksEnvironment, 'openDialog' | 'closeDialog'> {\n const { openDialog, closeDialog } = useBlocksEnvironment()\n return { openDialog, closeDialog }\n}\n"]}
1
+ {"version":3,"sources":["../src/connection/calendar/store.ts","../src/provider/settings-section.ts","../src/provider/requests.ts","../src/provider/environment.ts"],"names":["create","persist","createJSONStorage","useSyncExternalStore","listeners","useRef","useEffect","notifyStore","confirmDialog","choiceDialog","openDialog","closeDialog","useHostConfigRecord"],"mappings":";;;;;;;;AAqCO,IAAM,uBAAuBA,cAAA,EAA0B;AAAA,EAC5DC,kBAAA;AAAA,IACE,CAAC,GAAA,MAAS;AAAA,MACR,IAAA,EAAM,IAAA;AAAA,MACN,IAAA,EAAM,IAAA;AAAA,MACN,YAAA,EAAc,IAAA;AAAA,MACd,eAAA,EAAiB,IAAA;AAAA,MACjB,oBAAoB,CAAC,eAAA,KAAoB,GAAA,CAAI,EAAE,iBAAiB,CAAA;AAAA,MAChE,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,SAAS,CAAC,IAAA,KAAS,GAAA,CAAI,EAAE,MAAM,CAAA;AAAA,MAC/B,iBAAiB,CAAC,YAAA,KAAiB,GAAA,CAAI,EAAE,cAAc;AAAA,KACzD,CAAA;AAAA,IACA;AAAA,MACE,IAAA,EAAM,oBAAA;AAAA,MACN,OAAA,EAASC,4BAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;AAAA;AACrC;AAEJ;AAEA,IAAM,MAAA,GAAS,sBAAA;AAGR,SAAS,qBAAqB,KAAA,EAAmC;AACtE,EAAA,IAAI,MAAA,CAAO,KAAK,KAAA,CAAM,EAAE,GAAG,oBAAA,CAAqB,QAAA,EAAS,CAAE,eAAA,CAAgB,KAAK,CAAA;AAClF;AAGO,SAAS,wBAAwB,OAAA,EAAwC;AAC9E,EAAA,oBAAA,CAAqB,QAAA,EAAS,CAAE,kBAAA,CAAmB,OAAO,C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Ac,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-46LX6EQT.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 /** `run` on a saved workflow: the workspace to start it in. */\n runIn?: string\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 * `run` on a saved workflow: the workspace to start it in (opened for the run, its pickers that\n * workspace's), e.g. a matter's for a process of the skills workspace. Absent: the open one.\n */\n runIn?: 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({\n workflowId: id,\n view: options?.view,\n preset: options?.preset,\n runIn: options?.runIn,\n })\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"]}