@arbidocs/blocks 0.5.21 → 0.5.22

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 (208) hide show
  1. package/dist/{ConnectedCallDock-ZWNWGEST.js → ConnectedCallDock-AQ33U57C.js} +7 -7
  2. package/dist/{ConnectedCallDock-ZWNWGEST.js.map → ConnectedCallDock-AQ33U57C.js.map} +1 -1
  3. package/dist/{ConnectedCallDock-7FPHYOMU.cjs → ConnectedCallDock-JRWGC6UT.cjs} +8 -8
  4. package/dist/{ConnectedCallDock-7FPHYOMU.cjs.map → ConnectedCallDock-JRWGC6UT.cjs.map} +1 -1
  5. package/dist/{ConnectedCallRoom-QAF3ZOEC.js → ConnectedCallRoom-5YNFPS6E.js} +7 -7
  6. package/dist/{ConnectedCallRoom-QAF3ZOEC.js.map → ConnectedCallRoom-5YNFPS6E.js.map} +1 -1
  7. package/dist/{ConnectedCallRoom-HSLYF6YL.cjs → ConnectedCallRoom-CCEIJAOG.cjs} +8 -8
  8. package/dist/{ConnectedCallRoom-HSLYF6YL.cjs.map → ConnectedCallRoom-CCEIJAOG.cjs.map} +1 -1
  9. package/dist/{ConnectedNativeDocxComparison-4X7H57LE.js → ConnectedNativeDocxComparison-GMQHSY3Z.js} +10 -10
  10. package/dist/{ConnectedNativeDocxComparison-4X7H57LE.js.map → ConnectedNativeDocxComparison-GMQHSY3Z.js.map} +1 -1
  11. package/dist/{ConnectedNativeDocxComparison-7WTVHEKI.cjs → ConnectedNativeDocxComparison-HH3PHNXU.cjs} +11 -11
  12. package/dist/{ConnectedNativeDocxComparison-7WTVHEKI.cjs.map → ConnectedNativeDocxComparison-HH3PHNXU.cjs.map} +1 -1
  13. package/dist/{ConnectedNativeDocxEditor-I6RQUSR3.js → ConnectedNativeDocxEditor-4IAKVBEF.js} +9 -9
  14. package/dist/{ConnectedNativeDocxEditor-I6RQUSR3.js.map → ConnectedNativeDocxEditor-4IAKVBEF.js.map} +1 -1
  15. package/dist/{ConnectedNativeDocxEditor-PZ2ASQO3.cjs → ConnectedNativeDocxEditor-JNHNZG3P.cjs} +11 -11
  16. package/dist/{ConnectedNativeDocxEditor-PZ2ASQO3.cjs.map → ConnectedNativeDocxEditor-JNHNZG3P.cjs.map} +1 -1
  17. package/dist/{ConnectedStreamedWordArtifact-Q5KC4W7O.cjs → ConnectedStreamedWordArtifact-CZZOH667.cjs} +11 -11
  18. package/dist/ConnectedStreamedWordArtifact-CZZOH667.cjs.map +1 -0
  19. package/dist/{ConnectedStreamedWordArtifact-KCYSJ3B2.js → ConnectedStreamedWordArtifact-GLJCJPTP.js} +10 -10
  20. package/dist/ConnectedStreamedWordArtifact-GLJCJPTP.js.map +1 -0
  21. package/dist/agents/index.cjs +328 -328
  22. package/dist/agents/index.js +6 -6
  23. package/dist/calls/index.cjs +39 -39
  24. package/dist/calls/index.js +7 -7
  25. package/dist/chat/index.cjs +145 -145
  26. package/dist/chat/index.js +4 -4
  27. package/dist/{chunk-R2HXGTVB.cjs → chunk-2QQUGL2V.cjs} +2 -2
  28. package/dist/{chunk-R2HXGTVB.cjs.map → chunk-2QQUGL2V.cjs.map} +1 -1
  29. package/dist/{chunk-DTENNALR.js → chunk-44FPFTU2.js} +6 -6
  30. package/dist/{chunk-DTENNALR.js.map → chunk-44FPFTU2.js.map} +1 -1
  31. package/dist/{chunk-MJT7KHHT.cjs → chunk-75UVQKQ5.cjs} +52 -52
  32. package/dist/{chunk-MJT7KHHT.cjs.map → chunk-75UVQKQ5.cjs.map} +1 -1
  33. package/dist/{chunk-GK2U3VU6.cjs → chunk-7DDMF3DZ.cjs} +4 -4
  34. package/dist/{chunk-GK2U3VU6.cjs.map → chunk-7DDMF3DZ.cjs.map} +1 -1
  35. package/dist/{chunk-JWUUGVQR.js → chunk-7JJ7LU3T.js} +5 -5
  36. package/dist/{chunk-JWUUGVQR.js.map → chunk-7JJ7LU3T.js.map} +1 -1
  37. package/dist/{chunk-YT5OOFK3.js → chunk-7S76Q5RK.js} +3 -3
  38. package/dist/{chunk-YT5OOFK3.js.map → chunk-7S76Q5RK.js.map} +1 -1
  39. package/dist/{chunk-S5XIMM27.cjs → chunk-7ZHPLTGK.cjs} +9 -9
  40. package/dist/{chunk-S5XIMM27.cjs.map → chunk-7ZHPLTGK.cjs.map} +1 -1
  41. package/dist/{chunk-F6LC2CRB.js → chunk-AAVFCPKD.js} +6 -6
  42. package/dist/{chunk-F6LC2CRB.js.map → chunk-AAVFCPKD.js.map} +1 -1
  43. package/dist/{chunk-ZMYK7XTS.js → chunk-AF24CV6J.js} +3 -3
  44. package/dist/{chunk-ZMYK7XTS.js.map → chunk-AF24CV6J.js.map} +1 -1
  45. package/dist/{chunk-EW2ZGGWH.cjs → chunk-ASTMGLHT.cjs} +7 -7
  46. package/dist/{chunk-EW2ZGGWH.cjs.map → chunk-ASTMGLHT.cjs.map} +1 -1
  47. package/dist/{chunk-T4OJYZSY.cjs → chunk-B26FXLMG.cjs} +5 -5
  48. package/dist/{chunk-T4OJYZSY.cjs.map → chunk-B26FXLMG.cjs.map} +1 -1
  49. package/dist/{chunk-PFVCOUU6.cjs → chunk-BL74GYSA.cjs} +26 -26
  50. package/dist/{chunk-PFVCOUU6.cjs.map → chunk-BL74GYSA.cjs.map} +1 -1
  51. package/dist/{chunk-F7IQGPZH.js → chunk-C6P2QW36.js} +5 -5
  52. package/dist/{chunk-F7IQGPZH.js.map → chunk-C6P2QW36.js.map} +1 -1
  53. package/dist/{chunk-KILCORJ7.js → chunk-DHPEUC6H.js} +3 -3
  54. package/dist/{chunk-KILCORJ7.js.map → chunk-DHPEUC6H.js.map} +1 -1
  55. package/dist/{chunk-MSCDYRSA.cjs → chunk-DXO2RXVQ.cjs} +4 -4
  56. package/dist/{chunk-MSCDYRSA.cjs.map → chunk-DXO2RXVQ.cjs.map} +1 -1
  57. package/dist/{chunk-FOW7TRQR.js → chunk-ENAXJ63V.js} +3 -3
  58. package/dist/{chunk-FOW7TRQR.js.map → chunk-ENAXJ63V.js.map} +1 -1
  59. package/dist/{chunk-MCU4HJDM.cjs → chunk-EWWVKXEQ.cjs} +4 -4
  60. package/dist/{chunk-MCU4HJDM.cjs.map → chunk-EWWVKXEQ.cjs.map} +1 -1
  61. package/dist/{chunk-UEDM2NNI.cjs → chunk-FCWS7I5C.cjs} +9 -9
  62. package/dist/{chunk-UEDM2NNI.cjs.map → chunk-FCWS7I5C.cjs.map} +1 -1
  63. package/dist/{chunk-525U3M3N.js → chunk-FUOCCKE4.js} +3 -3
  64. package/dist/{chunk-525U3M3N.js.map → chunk-FUOCCKE4.js.map} +1 -1
  65. package/dist/{chunk-BQQTLZBN.js → chunk-GRT4EH76.js} +2 -2
  66. package/dist/{chunk-BQQTLZBN.js.map → chunk-GRT4EH76.js.map} +1 -1
  67. package/dist/{chunk-YRHQ7OLG.cjs → chunk-I5RK4WAE.cjs} +8 -8
  68. package/dist/{chunk-YRHQ7OLG.cjs.map → chunk-I5RK4WAE.cjs.map} +1 -1
  69. package/dist/{chunk-YFLXVKMR.js → chunk-IKTPM73F.js} +4 -4
  70. package/dist/{chunk-YFLXVKMR.js.map → chunk-IKTPM73F.js.map} +1 -1
  71. package/dist/{chunk-YQJOWQDJ.cjs → chunk-IWT4QVQL.cjs} +4 -4
  72. package/dist/{chunk-YQJOWQDJ.cjs.map → chunk-IWT4QVQL.cjs.map} +1 -1
  73. package/dist/{chunk-5ZU2XYXO.cjs → chunk-KJVDYWAM.cjs} +30 -4
  74. package/dist/chunk-KJVDYWAM.cjs.map +1 -0
  75. package/dist/{chunk-CQU37FNV.cjs → chunk-KKT53TZQ.cjs} +5 -5
  76. package/dist/{chunk-CQU37FNV.cjs.map → chunk-KKT53TZQ.cjs.map} +1 -1
  77. package/dist/{chunk-RJY5NX72.cjs → chunk-KXSXIQSW.cjs} +12 -12
  78. package/dist/{chunk-RJY5NX72.cjs.map → chunk-KXSXIQSW.cjs.map} +1 -1
  79. package/dist/{chunk-SPSODKUF.js → chunk-M4FLTGFM.js} +5 -5
  80. package/dist/{chunk-SPSODKUF.js.map → chunk-M4FLTGFM.js.map} +1 -1
  81. package/dist/{chunk-K35WQH42.js → chunk-MD2XJASR.js} +3 -3
  82. package/dist/{chunk-K35WQH42.js.map → chunk-MD2XJASR.js.map} +1 -1
  83. package/dist/{chunk-KMF3ORIV.js → chunk-MQEN62NR.js} +3 -3
  84. package/dist/{chunk-KMF3ORIV.js.map → chunk-MQEN62NR.js.map} +1 -1
  85. package/dist/{chunk-J5J5JRPL.js → chunk-MUF3RFJZ.js} +4 -4
  86. package/dist/{chunk-J5J5JRPL.js.map → chunk-MUF3RFJZ.js.map} +1 -1
  87. package/dist/{chunk-K4PGCNCI.cjs → chunk-O4TCX6PD.cjs} +5 -5
  88. package/dist/{chunk-K4PGCNCI.cjs.map → chunk-O4TCX6PD.cjs.map} +1 -1
  89. package/dist/{chunk-D3BHUDOU.js → chunk-PZRTRYPD.js} +3 -3
  90. package/dist/{chunk-D3BHUDOU.js.map → chunk-PZRTRYPD.js.map} +1 -1
  91. package/dist/{chunk-4C2S3Z3I.cjs → chunk-QW3SVHGM.cjs} +4 -4
  92. package/dist/{chunk-4C2S3Z3I.cjs.map → chunk-QW3SVHGM.cjs.map} +1 -1
  93. package/dist/{chunk-F4AJTY45.cjs → chunk-R7M5LN7D.cjs} +4 -4
  94. package/dist/{chunk-F4AJTY45.cjs.map → chunk-R7M5LN7D.cjs.map} +1 -1
  95. package/dist/{chunk-UNZUM76L.js → chunk-RRIXIUYD.js} +3 -3
  96. package/dist/{chunk-UNZUM76L.js.map → chunk-RRIXIUYD.js.map} +1 -1
  97. package/dist/{chunk-FQIJICZE.cjs → chunk-S4G3DNMA.cjs} +18 -18
  98. package/dist/{chunk-FQIJICZE.cjs.map → chunk-S4G3DNMA.cjs.map} +1 -1
  99. package/dist/{chunk-ML62FUHZ.js → chunk-SUDPZ5IQ.js} +3 -3
  100. package/dist/{chunk-ML62FUHZ.js.map → chunk-SUDPZ5IQ.js.map} +1 -1
  101. package/dist/{chunk-I3G7DQJH.cjs → chunk-T3VDKPKH.cjs} +18 -18
  102. package/dist/{chunk-I3G7DQJH.cjs.map → chunk-T3VDKPKH.cjs.map} +1 -1
  103. package/dist/{chunk-G2XAACRG.cjs → chunk-TATPWHHN.cjs} +5 -5
  104. package/dist/{chunk-G2XAACRG.cjs.map → chunk-TATPWHHN.cjs.map} +1 -1
  105. package/dist/{chunk-IJQ5DIZT.cjs → chunk-TTJGCJWX.cjs} +5 -5
  106. package/dist/{chunk-IJQ5DIZT.cjs.map → chunk-TTJGCJWX.cjs.map} +1 -1
  107. package/dist/{chunk-WYUFBKQ4.js → chunk-V5HVPQP7.js} +3 -3
  108. package/dist/{chunk-WYUFBKQ4.js.map → chunk-V5HVPQP7.js.map} +1 -1
  109. package/dist/{chunk-BITGO5LI.cjs → chunk-VNHLFS6T.cjs} +4 -4
  110. package/dist/{chunk-BITGO5LI.cjs.map → chunk-VNHLFS6T.cjs.map} +1 -1
  111. package/dist/{chunk-CHHE2UNJ.js → chunk-WNC5INOD.js} +4 -4
  112. package/dist/{chunk-CHHE2UNJ.js.map → chunk-WNC5INOD.js.map} +1 -1
  113. package/dist/{chunk-6EGWPMPU.cjs → chunk-WPOQLGKJ.cjs} +14 -14
  114. package/dist/{chunk-6EGWPMPU.cjs.map → chunk-WPOQLGKJ.cjs.map} +1 -1
  115. package/dist/{chunk-FERNQVSH.js → chunk-X4Y7ZHFB.js} +30 -5
  116. package/dist/chunk-X4Y7ZHFB.js.map +1 -0
  117. package/dist/{chunk-UAFP562F.js → chunk-XL55UDLO.js} +3 -3
  118. package/dist/{chunk-UAFP562F.js.map → chunk-XL55UDLO.js.map} +1 -1
  119. package/dist/{chunk-P3HSWP2P.js → chunk-XVGUR746.js} +3 -3
  120. package/dist/{chunk-P3HSWP2P.js.map → chunk-XVGUR746.js.map} +1 -1
  121. package/dist/{chunk-YVA6SCVO.js → chunk-Y5ER2GAU.js} +3 -3
  122. package/dist/{chunk-YVA6SCVO.js.map → chunk-Y5ER2GAU.js.map} +1 -1
  123. package/dist/{chunk-O3TAF4ZM.js → chunk-Y7DWW5XD.js} +3 -3
  124. package/dist/{chunk-O3TAF4ZM.js.map → chunk-Y7DWW5XD.js.map} +1 -1
  125. package/dist/{chunk-APVKLXM5.cjs → chunk-YBTKLOGG.cjs} +4 -4
  126. package/dist/{chunk-APVKLXM5.cjs.map → chunk-YBTKLOGG.cjs.map} +1 -1
  127. package/dist/{chunk-YVEMNMIA.cjs → chunk-YOMT5FFH.cjs} +6 -6
  128. package/dist/{chunk-YVEMNMIA.cjs.map → chunk-YOMT5FFH.cjs.map} +1 -1
  129. package/dist/{chunk-VFZLZSJ3.js → chunk-ZYGQFD5Y.js} +3 -3
  130. package/dist/{chunk-VFZLZSJ3.js.map → chunk-ZYGQFD5Y.js.map} +1 -1
  131. package/dist/citations/index.cjs +10 -10
  132. package/dist/citations/index.js +2 -2
  133. package/dist/connect/docx.cjs +13 -13
  134. package/dist/connect/docx.js +9 -9
  135. package/dist/connect/index.cjs +1230 -808
  136. package/dist/connect/index.cjs.map +1 -1
  137. package/dist/connect/index.d.ts +1 -0
  138. package/dist/connect/index.js +457 -43
  139. package/dist/connect/index.js.map +1 -1
  140. package/dist/connect/viewer.cjs +77 -77
  141. package/dist/connect/viewer.js +12 -12
  142. package/dist/connection/billing/ProjectUsageContent.d.ts +7 -4
  143. package/dist/connection/billing/index.d.ts +1 -0
  144. package/dist/connection/defaultHost.d.ts +1 -1
  145. package/dist/connection/entities/ConnectedProjectEntity.d.ts +8 -0
  146. package/dist/connection/entities/ConnectedUserEntity.d.ts +20 -0
  147. package/dist/connection/entities/ConnectedWorkspaceEntity.d.ts +31 -0
  148. package/dist/connection/entities/index.d.ts +5 -0
  149. package/dist/connection/entities/renderConnectedUser.d.ts +6 -0
  150. package/dist/connection/settings-page/index.d.ts +1 -0
  151. package/dist/connection/settings-page/sections.d.ts +44 -0
  152. package/dist/facts/index.cjs +3 -3
  153. package/dist/facts/index.js +2 -2
  154. package/dist/files/index.cjs +223 -223
  155. package/dist/files/index.js +3 -3
  156. package/dist/home/index.cjs +30 -30
  157. package/dist/home/index.js +5 -5
  158. package/dist/index.cjs +596 -596
  159. package/dist/index.js +16 -16
  160. package/dist/provider/environment.d.ts +2 -0
  161. package/dist/retrieval/index.cjs +4 -4
  162. package/dist/retrieval/index.js +2 -2
  163. package/dist/shell/index.cjs +46 -46
  164. package/dist/shell/index.js +3 -3
  165. package/dist/studio/index.cjs +14 -14
  166. package/dist/studio/index.js +6 -6
  167. package/dist/workflow-canvas/index.cjs +26 -26
  168. package/dist/workflow-canvas/index.js +8 -8
  169. package/dist/workspaces/WorkspaceTypeBadge.d.ts +14 -0
  170. package/dist/workspaces/index.cjs +32 -28
  171. package/dist/workspaces/index.d.ts +1 -0
  172. package/dist/workspaces/index.js +4 -4
  173. package/node_modules/@arbidocs/coedit/dist/encoding.cjs +54 -56
  174. package/node_modules/@arbidocs/coedit/dist/encoding.cjs.map +1 -1
  175. package/node_modules/@arbidocs/coedit/dist/encoding.d.cts +50 -14
  176. package/node_modules/@arbidocs/coedit/dist/encoding.d.ts +50 -14
  177. package/node_modules/@arbidocs/coedit/dist/encoding.js +54 -57
  178. package/node_modules/@arbidocs/coedit/dist/encoding.js.map +1 -1
  179. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs +211 -109
  180. package/node_modules/@arbidocs/coedit/dist/hocuspocus.cjs.map +1 -1
  181. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js +211 -109
  182. package/node_modules/@arbidocs/coedit/dist/hocuspocus.js.map +1 -1
  183. package/node_modules/@arbidocs/coedit/dist/index.cjs +210 -108
  184. package/node_modules/@arbidocs/coedit/dist/index.cjs.map +1 -1
  185. package/node_modules/@arbidocs/coedit/dist/index.d.cts +1 -1
  186. package/node_modules/@arbidocs/coedit/dist/index.d.ts +1 -1
  187. package/node_modules/@arbidocs/coedit/dist/index.js +210 -108
  188. package/node_modules/@arbidocs/coedit/dist/index.js.map +1 -1
  189. package/node_modules/@arbidocs/coedit/dist/server.cjs +214 -112
  190. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
  191. package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
  192. package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
  193. package/node_modules/@arbidocs/coedit/dist/server.js +214 -112
  194. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
  195. package/node_modules/@arbidocs/coedit/dist/template.cjs +3 -2
  196. package/node_modules/@arbidocs/coedit/dist/template.cjs.map +1 -1
  197. package/node_modules/@arbidocs/coedit/dist/template.d.cts +5 -0
  198. package/node_modules/@arbidocs/coedit/dist/template.d.ts +5 -0
  199. package/node_modules/@arbidocs/coedit/dist/template.js +3 -2
  200. package/node_modules/@arbidocs/coedit/dist/template.js.map +1 -1
  201. package/node_modules/@arbidocs/coedit/dist/{versions-DXiFQMA6.d.ts → versions-XSYTVmOU.d.cts} +1 -1
  202. package/node_modules/@arbidocs/coedit/dist/{versions-DXiFQMA6.d.cts → versions-XSYTVmOU.d.ts} +1 -1
  203. package/node_modules/@arbidocs/coedit/package.json +1 -1
  204. package/package.json +5 -5
  205. package/dist/ConnectedStreamedWordArtifact-KCYSJ3B2.js.map +0 -1
  206. package/dist/ConnectedStreamedWordArtifact-Q5KC4W7O.cjs.map +0 -1
  207. package/dist/chunk-5ZU2XYXO.cjs.map +0 -1
  208. package/dist/chunk-FERNQVSH.js.map +0 -1
@@ -2,8 +2,8 @@
2
2
  'use strict';
3
3
 
4
4
  var chunkPCB2BPN3_cjs = require('./chunk-PCB2BPN3.cjs');
5
- var chunkCQU37FNV_cjs = require('./chunk-CQU37FNV.cjs');
6
- var chunk4C2S3Z3I_cjs = require('./chunk-4C2S3Z3I.cjs');
5
+ var chunkKKT53TZQ_cjs = require('./chunk-KKT53TZQ.cjs');
6
+ var chunkQW3SVHGM_cjs = require('./chunk-QW3SVHGM.cjs');
7
7
  var ui = require('@arbidocs/react/ui');
8
8
  var jsxRuntime = require('react/jsx-runtime');
9
9
  var lucideReact = require('lucide-react');
@@ -176,7 +176,7 @@ function FactsStrip({
176
176
  "data-testid": testId,
177
177
  children: [
178
178
  /* @__PURE__ */ jsxRuntime.jsx(
179
- chunkCQU37FNV_cjs.SectionHeader,
179
+ chunkKKT53TZQ_cjs.SectionHeader,
180
180
  {
181
181
  icon,
182
182
  title,
@@ -187,7 +187,7 @@ function FactsStrip({
187
187
  }
188
188
  ),
189
189
  filled.length === 0 ? empty && /* @__PURE__ */ jsxRuntime.jsx(
190
- chunkCQU37FNV_cjs.EmptyStrip,
190
+ chunkKKT53TZQ_cjs.EmptyStrip,
191
191
  {
192
192
  icon: empty.icon,
193
193
  label: empty.label,
@@ -238,7 +238,7 @@ function RecentList({
238
238
  "data-testid": testId,
239
239
  children: [
240
240
  /* @__PURE__ */ jsxRuntime.jsx(
241
- chunkCQU37FNV_cjs.SectionHeader,
241
+ chunkKKT53TZQ_cjs.SectionHeader,
242
242
  {
243
243
  icon,
244
244
  title,
@@ -250,7 +250,7 @@ function RecentList({
250
250
  }
251
251
  ),
252
252
  rows.length === 0 ? empty?.onSelect ? /* @__PURE__ */ jsxRuntime.jsx(
253
- chunkCQU37FNV_cjs.EmptyStrip,
253
+ chunkKKT53TZQ_cjs.EmptyStrip,
254
254
  {
255
255
  icon: empty.icon,
256
256
  label: empty.label,
@@ -267,7 +267,7 @@ function RecentList({
267
267
  "data-slot": "recent-row",
268
268
  children: [
269
269
  /* @__PURE__ */ jsxRuntime.jsxs(
270
- chunk4C2S3Z3I_cjs.ActionLink,
270
+ chunkQW3SVHGM_cjs.ActionLink,
271
271
  {
272
272
  href: row.href,
273
273
  onSelect: row.onSelect,
@@ -315,5 +315,5 @@ exports.HomeFrame = HomeFrame;
315
315
  exports.HomeLoadError = HomeLoadError;
316
316
  exports.HomeMain = HomeMain;
317
317
  exports.RecentList = RecentList;
318
- //# sourceMappingURL=chunk-UEDM2NNI.cjs.map
319
- //# sourceMappingURL=chunk-UEDM2NNI.cjs.map
318
+ //# sourceMappingURL=chunk-FCWS7I5C.cjs.map
319
+ //# sourceMappingURL=chunk-FCWS7I5C.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/home/HomeLayout.tsx","../src/home/CreateTile.tsx","../src/home/DashboardParts.tsx","../src/home/FactsStrip.tsx","../src/home/RecentList.tsx"],"names":["jsx","cn","Callout","jsxs","Plus","Button","SectionHeader","EmptyStrip","Fragment","ActionLink"],"mappings":";;;;;;;;;AAKO,SAAS,SAAA,CAAU;AAAA,EACxB,MAAA,GAAS,WAAA;AAAA,EACT;AACF,CAAA,EAGG;AACD,EAAA,uBACEA,cAAA,CAAC,SAAI,WAAA,EAAU,YAAA,EAAa,eAAa,MAAA,EAAQ,SAAA,EAAU,wBACxD,QAAA,EACH,CAAA;AAEJ;AAGO,SAAS,QAAA,CAAS,EAAE,QAAA,EAAS,EAA4B;AAC9D,EAAA,uBACEA,cAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAU,4DAAA;AAAA,MAET;AAAA;AAAA,GACH;AAEJ;AAMO,SAAS,kBAAA,CAAmB,EAAE,QAAA,EAAS,EAA4B;AACxE,EAAA,uBACEA,cAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,aAAA,EAAc,SAAA,EAAU,wBAAA,EACrC,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAqB,QAAA,EAAS,CAAA,EAC/C,CAAA;AAEJ;AAGO,SAAS,kBAAA,CAAmB;AAAA,EACjC,SAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,aAAA;AAAA,MACV,SAAA,EAAWC,KAAA,CAAG,4CAAA,EAA8C,SAAS,CAAA;AAAA,MAEpE;AAAA;AAAA,GACH;AAEJ;AAGO,SAAS,aAAA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qDAAA,EACb,QAAA,EAAA,GAAA,CAAI,IAAA,EACP;AAAA,yBAAA,EAEJ,CAAA;AAAA,wBACC,GAAA,CAAI,4BACHA,cAAAA,CAAC,OAAE,SAAA,EAAU,+CAAA,EACV,cAAI,QAAA,EACP;AAAA,uBAAA,EAEJ;AAAA;AAAA;AAAA,iBACF;AAAA,gBACC,GAAA,CAAI,2BAAWA,cAAAA,CAAC,SAAI,SAAA,EAAU,eAAA,EAAiB,QAAA,EAAA,GAAA,CAAI,QAAA,EAAS,CAAA,GAAS;AAAA;AAAA,aAAA;AAAA,YAlCjE,GAAA,CAAI;AAAA,WAoCZ,CAAA,EACH;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-UEDM2NNI.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Callout } from '../components/Callout'\n\n/** Column of the home page: greeting header, then the content. */\nexport function HomeFrame({\n testId = 'home-page',\n children,\n}: {\n testId?: string\n children: ReactNode\n}) {\n return (\n <div data-slot=\"home-frame\" data-testid={testId} className=\"flex h-full flex-col\">\n {children}\n </div>\n )\n}\n\n/** Content area under the header; the pages inside own their scrolling. */\nexport function HomeMain({ children }: { children: ReactNode }) {\n return (\n <main\n data-slot=\"home-main\"\n className=\"min-h-0 min-w-sidebar flex-1 overflow-hidden bg-background\"\n >\n {children}\n </main>\n )\n}\n\n/**\n * Scroll container that spans the full width (so its scrollbar rides the window edge) with the\n * content centred in a bounded column.\n */\nexport function HomeCenteredScroll({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"home-scroll\" className=\"h-full overflow-y-auto\">\n <div className=\"mx-auto max-w-6xl\">{children}</div>\n </div>\n )\n}\n\n/** Bounded, centred column for a full-height child (the workspaces table). */\nexport function HomeCenteredColumn({\n className,\n children,\n}: {\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"home-column\"\n className={cn('mx-auto h-full max-w-6xl px-4 pb-4 sm:px-8', className)}\n >\n {children}\n </div>\n )\n}\n\n/** Centred error notice for a page that could not load. */\nexport function HomeLoadError({\n title,\n body,\n testId,\n}: {\n title: string\n body: string\n testId?: string\n}) {\n return (\n <div\n data-slot=\"home-load-error\"\n className=\"flex h-full flex-col items-center justify-center p-8\"\n >\n <div className=\"w-full max-w-md\">\n <Callout variant=\"danger\" title={title} body={body} testId={testId} />\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface CreateTileProps {\n /** Visible label, e.g. \"New workspace\". */\n label: string\n /** Accessible name; defaults to `label`. */\n ariaLabel?: string\n onSelect?: () => void\n /** One line explaining what is being created (first-run empty state). */\n help?: ReactNode\n /** When set, the tile is disabled and shows this explanation instead of `help`. */\n disabledReason?: string\n className?: string\n testId?: string\n}\n\n/**\n * The \"create\" tile. Sits in the grid beside the workspace tiles at the same\n * height, in the same tonal family: no dashed outline, no shadow.\n */\nexport function CreateTile({\n label,\n ariaLabel,\n onSelect,\n help,\n disabledReason,\n className,\n testId,\n}: CreateTileProps) {\n const disabled = !!disabledReason\n const select = disabled ? undefined : onSelect\n return (\n <div\n className={cn(\n 'flex min-h-40 w-full flex-col items-center justify-center gap-1 rounded-lg p-4 text-muted-foreground border border-border bg-card shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n disabled\n ? 'cursor-not-allowed opacity-60'\n : 'cursor-pointer hover:border-ring/50 hover:bg-accent/40 hover:text-foreground',\n className\n )}\n onClick={select}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n select?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n aria-disabled={disabled || undefined}\n title={disabledReason}\n aria-label={ariaLabel ?? label}\n data-slot=\"create-tile\"\n data-testid={testId}\n >\n <span className=\"inline-flex flex-col items-center gap-2 text-sm font-medium\">\n <Plus className=\"size-6\" aria-hidden=\"true\" />\n {label}\n </span>\n {(disabledReason ?? help) && (\n <p className=\"max-w-64 px-4 text-center text-xs leading-snug text-muted-foreground\">\n {disabledReason ?? help}\n </p>\n )}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Button, cn } from '@arbidocs/react/ui'\n\n/** A section's quiet header action: ghost, small, still 44px on touch. */\nexport const DASHBOARD_QUIET_ACTION_CLASS =\n 'h-8 gap-1.5 px-2 text-sm bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground pointer-coarse:h-11'\n\n/** Column of the workspace dashboard's bands. A container, so children can use `@2xl:` queries. */\nexport function DashboardRoot({\n testId,\n className,\n children,\n}: {\n testId?: string\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard\"\n data-testid={testId}\n className={cn('flex flex-col gap-6', className)}\n >\n {children}\n </div>\n )\n}\n\n/** A dashboard band: `start` is the tiles under the identity bar, `recent` the lists with an eyebrow. */\nexport function DashboardBand({\n kind,\n children,\n}: {\n kind: 'start' | 'recent'\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard-band\"\n data-kind={kind}\n className={kind === 'start' ? 'mt-2' : 'mt-4 flex flex-col gap-3'}\n >\n {children}\n </div>\n )\n}\n\n/** Two equal columns from the `@2xl` container width, one below it. */\nexport function DashboardColumns({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"dashboard-columns\" className=\"grid gap-8 @2xl:grid-cols-2\">\n {children}\n </div>\n )\n}\n\n/** A fact row's mark: a quiet dot. */\nexport function FactMark() {\n return (\n <span\n data-slot=\"fact-mark\"\n className=\"mx-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/40\"\n aria-hidden\n />\n )\n}\n\nexport interface DashboardActionProps {\n /** `primary` is the page's one filled action; `quiet` the ghost header actions. */\n emphasis: 'primary' | 'quiet'\n icon: ReactNode\n label: string\n onClick: () => void\n testId?: string\n}\n\n/** Header action of a dashboard section (\"New chat\", \"New fact\"). */\nexport function DashboardAction({ emphasis, icon, label, onClick, testId }: DashboardActionProps) {\n return (\n <Button\n variant={emphasis === 'primary' ? 'default' : 'ghost'}\n size=\"sm\"\n className={\n emphasis === 'primary'\n ? 'h-8 gap-1.5 px-3 text-sm pointer-coarse:h-11'\n : DASHBOARD_QUIET_ACTION_CLASS\n }\n onClick={onClick}\n data-testid={testId}\n >\n {icon}\n {label}\n </Button>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { EmptyStrip, SectionHeader } from './sections'\n\nexport interface FactsStripRow {\n id: string\n leading?: ReactNode\n title: string\n /** Right-aligned stamp: a date or a time. */\n time?: string\n onSelect?: () => void\n}\n\nexport interface FactsStripGroup {\n /** Captions the group (\"Upcoming\", \"Created\"); an empty group is not rendered. */\n caption: string\n rows: FactsStripRow[]\n /** Test id of every row in this group. Defaults to `${testId}-row`. */\n rowTestId?: string\n}\n\nexport interface FactsStripEmpty {\n icon: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\nexport interface FactsStripProps {\n icon?: LucideIcon\n title: string\n count?: number\n onOpen?: () => void\n action?: ReactNode\n groups: FactsStripGroup[]\n empty?: FactsStripEmpty\n className?: string\n /** Root test id; the title button gets `${testId}-open`. */\n testId?: string\n}\n\n/**\n * A glanceable band of captioned groups (facts: upcoming, recently created).\n * Not a third list page: callers hand it a few rows per group.\n */\nexport function FactsStrip({\n icon,\n title,\n count,\n onOpen,\n action,\n groups,\n empty,\n className,\n testId,\n}: FactsStripProps) {\n const filled = groups.filter((g) => g.rows.length > 0)\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"facts-strip\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {filled.length === 0\n ? empty && (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={empty.testId}\n />\n )\n : filled.map((group) => (\n <div key={group.caption} className=\"min-w-0\">\n <p className=\"px-3 pb-1 pt-1 text-right text-xs text-muted-foreground\">\n {group.caption}\n </p>\n <ul>\n {group.rows.map((row) => (\n <li key={row.id}>\n <button\n type=\"button\"\n onClick={row.onSelect}\n title={row.title}\n className=\"flex w-full min-w-0 items-center gap-3 rounded-md px-3 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-muted pointer-coarse:min-h-11\"\n data-testid={group.rowTestId ?? (testId && `${testId}-row`)}\n >\n {row.leading}\n <span className=\"min-w-0 flex-1 truncate text-sm text-foreground\">\n {row.title}\n </span>\n {row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </section>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { EmptyStrip, SectionHeader } from './sections'\n\n/** One listed item. Source-agnostic: a chat, a file. */\nexport interface RecentRow {\n id: string\n /** Bare entity mark (an icon carries its own identity; no tinted box). */\n leading?: ReactNode\n title: string\n subtitle?: string\n /** Pinned right on the title line, like a message time. Hidden when `trailing` is set. */\n time?: string\n onSelect?: () => void\n /** Real link target; `onSelect` still fires on a plain click (see `ActionLink`). */\n href?: string\n /** A control rendered beside the row, outside its button. */\n trailing?: ReactNode\n}\n\nexport interface RecentListEmpty {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n /** Makes the empty strip an invitation button. */\n onSelect?: () => void\n}\n\nexport interface RecentListProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Opens the full list; makes the header title a button. */\n onOpen?: () => void\n /** Real link target of the header title (with `onOpen`, plain clicks call `onOpen`). */\n openHref?: string\n /** The section's one quiet header action. */\n action?: ReactNode\n rows: RecentRow[]\n /** Names the right-hand column (\"Added\", \"Messaged\"). */\n caption?: string\n /** What an empty section says. A plain muted line unless `onSelect` is set. */\n empty?: RecentListEmpty\n className?: string\n /** Root test id; derived ids: `-open`, `-caption`, `-row`, `-empty-action`. */\n testId?: string\n}\n\n/**\n * A titled list of recent items (files, chats): plain rows under a quiet\n * header. An empty list is one tonal strip that invites the first item.\n */\nexport function RecentList({\n icon,\n title,\n count,\n onOpen,\n openHref,\n action,\n rows,\n caption,\n empty,\n className,\n testId,\n}: RecentListProps) {\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"recent-list\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openHref={openHref}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {rows.length === 0 ? (\n empty?.onSelect ? (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={testId && `${testId}-empty-action`}\n />\n ) : (\n <p className=\"px-1 py-3 text-sm text-muted-foreground\">\n {empty?.description ?? empty?.label}\n </p>\n )\n ) : (\n <>\n {caption && (\n <p className=\"sr-only\" data-testid={testId && `${testId}-caption`}>\n {caption}\n </p>\n )}\n <ul>\n {rows.map((row) => (\n <li\n key={row.id}\n className=\"relative flex items-center rounded-md transition-colors [&:hover]:bg-muted has-[:focus-visible]:bg-muted\"\n data-slot=\"recent-row\"\n >\n <ActionLink\n href={row.href}\n onSelect={row.onSelect}\n title={row.title}\n className={cn(\n 'flex min-w-0 flex-1 items-start gap-3 rounded-md px-3 py-2 text-left focus-visible:outline-none',\n row.onSelect && 'cursor-pointer',\n 'pointer-coarse:min-h-11'\n )}\n data-testid={testId && `${testId}-row`}\n >\n {row.leading}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"min-w-0 flex-1 truncate text-sm font-medium text-foreground\">\n {row.title}\n </span>\n {!row.trailing && row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </div>\n {row.subtitle && (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {row.subtitle}\n </p>\n )}\n </div>\n </ActionLink>\n {row.trailing ? <div className=\"shrink-0 pr-3\">{row.trailing}</div> : null}\n </li>\n ))}\n </ul>\n </>\n )}\n </section>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/home/HomeLayout.tsx","../src/home/CreateTile.tsx","../src/home/DashboardParts.tsx","../src/home/FactsStrip.tsx","../src/home/RecentList.tsx"],"names":["jsx","cn","Callout","jsxs","Plus","Button","SectionHeader","EmptyStrip","Fragment","ActionLink"],"mappings":";;;;;;;;;AAKO,SAAS,SAAA,CAAU;AAAA,EACxB,MAAA,GAAS,WAAA;AAAA,EACT;AACF,CAAA,EAGG;AACD,EAAA,uBACEA,cAAA,CAAC,SAAI,WAAA,EAAU,YAAA,EAAa,eAAa,MAAA,EAAQ,SAAA,EAAU,wBACxD,QAAA,EACH,CAAA;AAEJ;AAGO,SAAS,QAAA,CAAS,EAAE,QAAA,EAAS,EAA4B;AAC9D,EAAA,uBACEA,cAAA;AAAA,IAAC,MAAA;AAAA,IAAA;AAAA,MACC,WAAA,EAAU,WAAA;AAAA,MACV,SAAA,EAAU,4DAAA;AAAA,MAET;AAAA;AAAA,GACH;AAEJ;AAMO,SAAS,kBAAA,CAAmB,EAAE,QAAA,EAAS,EAA4B;AACxE,EAAA,uBACEA,cAAA,CAAC,KAAA,EAAA,EAAI,WAAA,EAAU,aAAA,EAAc,SAAA,EAAU,wBAAA,EACrC,QAAA,kBAAAA,cAAA,CAAC,KAAA,EAAA,EAAI,SAAA,EAAU,mBAAA,EAAqB,QAAA,EAAS,CAAA,EAC/C,CAAA;AAEJ;AAGO,SAAS,kBAAA,CAAmB;AAAA,EACjC,SAAA;AAAA,EACA;AACF,CAAA,EAGG;AACD,EAAA,uBACEA,cAAA;AAAA,IAAC,KAAA;AAAA,IAAA;AAAA,MACC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,cAAI,KAAA,EACP,CAAA;AAAA,0BACC,CAAC,GAAA,CAAI,QAAA,IAAY,GAAA,CAAI,IAAA,oBACpBA,cAAAA,CAAC,MAAA,EAAA,EAAK,SAAA,EAAU,qDAAA,EACb,QAAA,EAAA,GAAA,CAAI,IAAA,EACP;AAAA,yBAAA,EAEJ,CAAA;AAAA,wBACC,GAAA,CAAI,4BACHA,cAAAA,CAAC,OAAE,SAAA,EAAU,+CAAA,EACV,cAAI,QAAA,EACP;AAAA,uBAAA,EAEJ;AAAA;AAAA;AAAA,iBACF;AAAA,gBACC,GAAA,CAAI,2BAAWA,cAAAA,CAAC,SAAI,SAAA,EAAU,eAAA,EAAiB,QAAA,EAAA,GAAA,CAAI,QAAA,EAAS,CAAA,GAAS;AAAA;AAAA,aAAA;AAAA,YAlCjE,GAAA,CAAI;AAAA,WAoCZ,CAAA,EACH;AAAA,SAAA,EACF;AAAA;AAAA;AAAA,GAEJ;AAEJ","file":"chunk-FCWS7I5C.cjs","sourcesContent":["import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\nimport { Callout } from '../components/Callout'\n\n/** Column of the home page: greeting header, then the content. */\nexport function HomeFrame({\n testId = 'home-page',\n children,\n}: {\n testId?: string\n children: ReactNode\n}) {\n return (\n <div data-slot=\"home-frame\" data-testid={testId} className=\"flex h-full flex-col\">\n {children}\n </div>\n )\n}\n\n/** Content area under the header; the pages inside own their scrolling. */\nexport function HomeMain({ children }: { children: ReactNode }) {\n return (\n <main\n data-slot=\"home-main\"\n className=\"min-h-0 min-w-sidebar flex-1 overflow-hidden bg-background\"\n >\n {children}\n </main>\n )\n}\n\n/**\n * Scroll container that spans the full width (so its scrollbar rides the window edge) with the\n * content centred in a bounded column.\n */\nexport function HomeCenteredScroll({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"home-scroll\" className=\"h-full overflow-y-auto\">\n <div className=\"mx-auto max-w-6xl\">{children}</div>\n </div>\n )\n}\n\n/** Bounded, centred column for a full-height child (the workspaces table). */\nexport function HomeCenteredColumn({\n className,\n children,\n}: {\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"home-column\"\n className={cn('mx-auto h-full max-w-6xl px-4 pb-4 sm:px-8', className)}\n >\n {children}\n </div>\n )\n}\n\n/** Centred error notice for a page that could not load. */\nexport function HomeLoadError({\n title,\n body,\n testId,\n}: {\n title: string\n body: string\n testId?: string\n}) {\n return (\n <div\n data-slot=\"home-load-error\"\n className=\"flex h-full flex-col items-center justify-center p-8\"\n >\n <div className=\"w-full max-w-md\">\n <Callout variant=\"danger\" title={title} body={body} testId={testId} />\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Plus } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport interface CreateTileProps {\n /** Visible label, e.g. \"New workspace\". */\n label: string\n /** Accessible name; defaults to `label`. */\n ariaLabel?: string\n onSelect?: () => void\n /** One line explaining what is being created (first-run empty state). */\n help?: ReactNode\n /** When set, the tile is disabled and shows this explanation instead of `help`. */\n disabledReason?: string\n className?: string\n testId?: string\n}\n\n/**\n * The \"create\" tile. Sits in the grid beside the workspace tiles at the same\n * height, in the same tonal family: no dashed outline, no shadow.\n */\nexport function CreateTile({\n label,\n ariaLabel,\n onSelect,\n help,\n disabledReason,\n className,\n testId,\n}: CreateTileProps) {\n const disabled = !!disabledReason\n const select = disabled ? undefined : onSelect\n return (\n <div\n className={cn(\n 'flex min-h-40 w-full flex-col items-center justify-center gap-1 rounded-lg p-4 text-muted-foreground border border-border bg-card shadow-xs transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n disabled\n ? 'cursor-not-allowed opacity-60'\n : 'cursor-pointer hover:border-ring/50 hover:bg-accent/40 hover:text-foreground',\n className\n )}\n onClick={select}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n select?.()\n }\n }}\n role=\"button\"\n tabIndex={0}\n aria-disabled={disabled || undefined}\n title={disabledReason}\n aria-label={ariaLabel ?? label}\n data-slot=\"create-tile\"\n data-testid={testId}\n >\n <span className=\"inline-flex flex-col items-center gap-2 text-sm font-medium\">\n <Plus className=\"size-6\" aria-hidden=\"true\" />\n {label}\n </span>\n {(disabledReason ?? help) && (\n <p className=\"max-w-64 px-4 text-center text-xs leading-snug text-muted-foreground\">\n {disabledReason ?? help}\n </p>\n )}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { Button, cn } from '@arbidocs/react/ui'\n\n/** A section's quiet header action: ghost, small, still 44px on touch. */\nexport const DASHBOARD_QUIET_ACTION_CLASS =\n 'h-8 gap-1.5 px-2 text-sm bg-transparent text-muted-foreground hover:bg-muted hover:text-foreground pointer-coarse:h-11'\n\n/** Column of the workspace dashboard's bands. A container, so children can use `@2xl:` queries. */\nexport function DashboardRoot({\n testId,\n className,\n children,\n}: {\n testId?: string\n className?: string\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard\"\n data-testid={testId}\n className={cn('flex flex-col gap-6', className)}\n >\n {children}\n </div>\n )\n}\n\n/** A dashboard band: `start` is the tiles under the identity bar, `recent` the lists with an eyebrow. */\nexport function DashboardBand({\n kind,\n children,\n}: {\n kind: 'start' | 'recent'\n children: ReactNode\n}) {\n return (\n <div\n data-slot=\"dashboard-band\"\n data-kind={kind}\n className={kind === 'start' ? 'mt-2' : 'mt-4 flex flex-col gap-3'}\n >\n {children}\n </div>\n )\n}\n\n/** Two equal columns from the `@2xl` container width, one below it. */\nexport function DashboardColumns({ children }: { children: ReactNode }) {\n return (\n <div data-slot=\"dashboard-columns\" className=\"grid gap-8 @2xl:grid-cols-2\">\n {children}\n </div>\n )\n}\n\n/** A fact row's mark: a quiet dot. */\nexport function FactMark() {\n return (\n <span\n data-slot=\"fact-mark\"\n className=\"mx-1 size-1.5 shrink-0 rounded-full bg-muted-foreground/40\"\n aria-hidden\n />\n )\n}\n\nexport interface DashboardActionProps {\n /** `primary` is the page's one filled action; `quiet` the ghost header actions. */\n emphasis: 'primary' | 'quiet'\n icon: ReactNode\n label: string\n onClick: () => void\n testId?: string\n}\n\n/** Header action of a dashboard section (\"New chat\", \"New fact\"). */\nexport function DashboardAction({ emphasis, icon, label, onClick, testId }: DashboardActionProps) {\n return (\n <Button\n variant={emphasis === 'primary' ? 'default' : 'ghost'}\n size=\"sm\"\n className={\n emphasis === 'primary'\n ? 'h-8 gap-1.5 px-3 text-sm pointer-coarse:h-11'\n : DASHBOARD_QUIET_ACTION_CLASS\n }\n onClick={onClick}\n data-testid={testId}\n >\n {icon}\n {label}\n </Button>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { EmptyStrip, SectionHeader } from './sections'\n\nexport interface FactsStripRow {\n id: string\n leading?: ReactNode\n title: string\n /** Right-aligned stamp: a date or a time. */\n time?: string\n onSelect?: () => void\n}\n\nexport interface FactsStripGroup {\n /** Captions the group (\"Upcoming\", \"Created\"); an empty group is not rendered. */\n caption: string\n rows: FactsStripRow[]\n /** Test id of every row in this group. Defaults to `${testId}-row`. */\n rowTestId?: string\n}\n\nexport interface FactsStripEmpty {\n icon: LucideIcon\n label: ReactNode\n description?: ReactNode\n onSelect?: () => void\n testId?: string\n}\n\nexport interface FactsStripProps {\n icon?: LucideIcon\n title: string\n count?: number\n onOpen?: () => void\n action?: ReactNode\n groups: FactsStripGroup[]\n empty?: FactsStripEmpty\n className?: string\n /** Root test id; the title button gets `${testId}-open`. */\n testId?: string\n}\n\n/**\n * A glanceable band of captioned groups (facts: upcoming, recently created).\n * Not a third list page: callers hand it a few rows per group.\n */\nexport function FactsStrip({\n icon,\n title,\n count,\n onOpen,\n action,\n groups,\n empty,\n className,\n testId,\n}: FactsStripProps) {\n const filled = groups.filter((g) => g.rows.length > 0)\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"facts-strip\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {filled.length === 0\n ? empty && (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={empty.testId}\n />\n )\n : filled.map((group) => (\n <div key={group.caption} className=\"min-w-0\">\n <p className=\"px-3 pb-1 pt-1 text-right text-xs text-muted-foreground\">\n {group.caption}\n </p>\n <ul>\n {group.rows.map((row) => (\n <li key={row.id}>\n <button\n type=\"button\"\n onClick={row.onSelect}\n title={row.title}\n className=\"flex w-full min-w-0 items-center gap-3 rounded-md px-3 py-2 text-left transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring [&:hover]:bg-muted pointer-coarse:min-h-11\"\n data-testid={group.rowTestId ?? (testId && `${testId}-row`)}\n >\n {row.leading}\n <span className=\"min-w-0 flex-1 truncate text-sm text-foreground\">\n {row.title}\n </span>\n {row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </section>\n )\n}\n","import type { ReactNode } from 'react'\nimport type { LucideIcon } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { EmptyStrip, SectionHeader } from './sections'\n\n/** One listed item. Source-agnostic: a chat, a file. */\nexport interface RecentRow {\n id: string\n /** Bare entity mark (an icon carries its own identity; no tinted box). */\n leading?: ReactNode\n title: string\n subtitle?: string\n /** Pinned right on the title line, like a message time. Hidden when `trailing` is set. */\n time?: string\n onSelect?: () => void\n /** Real link target; `onSelect` still fires on a plain click (see `ActionLink`). */\n href?: string\n /** A control rendered beside the row, outside its button. */\n trailing?: ReactNode\n}\n\nexport interface RecentListEmpty {\n icon?: LucideIcon\n label: ReactNode\n description?: ReactNode\n /** Makes the empty strip an invitation button. */\n onSelect?: () => void\n}\n\nexport interface RecentListProps {\n icon?: LucideIcon\n title: string\n count?: number\n /** Opens the full list; makes the header title a button. */\n onOpen?: () => void\n /** Real link target of the header title (with `onOpen`, plain clicks call `onOpen`). */\n openHref?: string\n /** The section's one quiet header action. */\n action?: ReactNode\n rows: RecentRow[]\n /** Names the right-hand column (\"Added\", \"Messaged\"). */\n caption?: string\n /** What an empty section says. A plain muted line unless `onSelect` is set. */\n empty?: RecentListEmpty\n className?: string\n /** Root test id; derived ids: `-open`, `-caption`, `-row`, `-empty-action`. */\n testId?: string\n}\n\n/**\n * A titled list of recent items (files, chats): plain rows under a quiet\n * header. An empty list is one tonal strip that invites the first item.\n */\nexport function RecentList({\n icon,\n title,\n count,\n onOpen,\n openHref,\n action,\n rows,\n caption,\n empty,\n className,\n testId,\n}: RecentListProps) {\n return (\n <section\n className={cn('flex min-w-0 flex-col gap-1', className)}\n data-slot=\"recent-list\"\n data-testid={testId}\n >\n <SectionHeader\n icon={icon}\n title={title}\n count={count}\n onOpen={onOpen}\n openHref={openHref}\n openTestId={testId && `${testId}-open`}\n action={action}\n />\n {rows.length === 0 ? (\n empty?.onSelect ? (\n <EmptyStrip\n icon={empty.icon}\n label={empty.label}\n description={empty.description}\n onSelect={empty.onSelect}\n testId={testId && `${testId}-empty-action`}\n />\n ) : (\n <p className=\"px-1 py-3 text-sm text-muted-foreground\">\n {empty?.description ?? empty?.label}\n </p>\n )\n ) : (\n <>\n {caption && (\n <p className=\"sr-only\" data-testid={testId && `${testId}-caption`}>\n {caption}\n </p>\n )}\n <ul>\n {rows.map((row) => (\n <li\n key={row.id}\n className=\"relative flex items-center rounded-md transition-colors [&:hover]:bg-muted has-[:focus-visible]:bg-muted\"\n data-slot=\"recent-row\"\n >\n <ActionLink\n href={row.href}\n onSelect={row.onSelect}\n title={row.title}\n className={cn(\n 'flex min-w-0 flex-1 items-start gap-3 rounded-md px-3 py-2 text-left focus-visible:outline-none',\n row.onSelect && 'cursor-pointer',\n 'pointer-coarse:min-h-11'\n )}\n data-testid={testId && `${testId}-row`}\n >\n {row.leading}\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline gap-2\">\n <span className=\"min-w-0 flex-1 truncate text-sm font-medium text-foreground\">\n {row.title}\n </span>\n {!row.trailing && row.time && (\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {row.time}\n </span>\n )}\n </div>\n {row.subtitle && (\n <p className=\"mt-0.5 truncate text-xs text-muted-foreground\">\n {row.subtitle}\n </p>\n )}\n </div>\n </ActionLink>\n {row.trailing ? <div className=\"shrink-0 pr-3\">{row.trailing}</div> : null}\n </li>\n ))}\n </ul>\n </>\n )}\n </section>\n )\n}\n"]}
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { useBlocksEnvironment } from './chunk-BQQTLZBN.js';
2
+ import { useBlocksEnvironment } from './chunk-GRT4EH76.js';
3
3
  import { useCallback, useState, useRef, useEffect } from 'react';
4
4
  import { Check, Copy } from 'lucide-react';
5
5
  import { cn, MarkMenu, Tooltip, TooltipTrigger, TooltipContent } from '@arbidocs/react/ui';
@@ -402,5 +402,5 @@ function NoteMark({
402
402
  }
403
403
 
404
404
  export { DEFAULT_PASSAGE_PILL_LABELS, DEFAULT_QUIET_MARK_LABELS, LabelMark, NoteMark, PassageMark, PassagePill, QuietLink, useCopyText };
405
- //# sourceMappingURL=chunk-525U3M3N.js.map
406
- //# sourceMappingURL=chunk-525U3M3N.js.map
405
+ //# sourceMappingURL=chunk-FUOCCKE4.js.map
406
+ //# sourceMappingURL=chunk-FUOCCKE4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/citations/PassagePill.tsx","../src/citations/QuietMarks.tsx"],"names":["jsx","cn"],"mappings":";;;;;;AA4BO,IAAM,2BAAA,GAAiD;AAAA,EAC5D,QAAA,EAAU,mBAAA;AAAA,EACV,MAAA,EAAQ,qBAAA;AAAA,EACR,UAAA,EAAY,iCAAA;AAAA,EACZ,WAAA,EAAa,cAAA;AAAA,EACb,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EAC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;AAAA,EACT,SAAA;AAAA,EACA;AACF,CAAA,EAAkB;AAChB,EAAA,uBACEA,GAAAA;AAAA,IAAC,QAAA;AAAA,IAAA;AAAA,MACC,KAAA;AAAA,MACA,OAAA,EACE,wBAAQA,GAAAA,CAAC,UAAK,SAAA,EAAU,qCAAA,EAAuC,iBAAM,CAAA,GAAU,MAAA;AAAA,MAEjF,SAAA;AAAA,MACA,MAAA;AAAA,MACA,WAAA,EAAU,WAAA;AAAA,MACV,gBAAA,EAAe,MAAA;AAAA,MACf,SAAA,EAAWC,EAAAA;AAAA,QACT,4OAAA;AAAA,QACA;AAAA,OACF;AAAA,MAEC,QAAA,EAAA;AAAA;AAAA,GACH;AAEJ","file":"chunk-525U3M3N.js","sourcesContent":["import {\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { Check, Copy } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/** Every fixed string of the passage pill. */\nexport interface PassagePillLabels {\n copyLink: string\n /** Announced and notified after the link was copied. */\n copied: string\n /** Notified when the clipboard refused the write. */\n copyFailed: string\n viewPassage: string\n page: string\n pages: string\n passage: string\n passages: string\n /** Visible abbreviation of \"page\" in the pill (\"p.3\"). */\n pageAbbreviation: string\n}\n\nexport const DEFAULT_PASSAGE_PILL_LABELS: PassagePillLabels = {\n copyLink: 'Copy passage link',\n copied: 'Passage link copied',\n copyFailed: 'Could not copy the passage link',\n viewPassage: 'View passage',\n page: 'Page',\n pages: 'Pages',\n passage: 'Passage',\n passages: 'Passages',\n pageAbbreviation: 'p.',\n}\n\n/** Overridable `data-testid`s of the pill (defaults keep the app's existing ids). */\ninterface PassagePillTestIds {\n root: string\n copy: string\n}\n\nexport interface PassagePillProps {\n /** Glyph of the cited document (host-supplied: file-type icon). */\n icon: ReactNode\n documentTitle: string\n /** `pill`: title + page; `icon`: glyph only; `compact`: page/passage ref + copy link. */\n variant?: 'icon' | 'pill' | 'compact'\n pageNumber?: number\n passageIndex?: number\n /** End of a contiguous passage run: the label collapses to \"4–9\" instead of a pill each. */\n passageIndexEnd?: number\n /** End page of a range: \"p.3–5(4–9)\". */\n pageNumberEnd?: number\n /** Makes the element a link. */\n href?: string\n /** Makes the element a button (ignored for the element role when `href` is set). */\n onClick?: (e: MouseEvent) => void\n showTooltip?: boolean\n labelMaxWidth?: string\n size?: 'sm' | 'base'\n className?: string\n labels?: Partial<PassagePillLabels>\n testIds?: Partial<PassagePillTestIds>\n /** Root test id (default `passage-entity`); the copy button gets `<id>-copy`. */\n testId?: string\n}\n\nconst COPIED_RESET_MS = 2000\n\n/** Plain-language name of a passage reference: \"Title, Page 3, Passage 4\". */\nfunction describePassage(\n documentTitle: string,\n l: PassagePillLabels,\n page: { text?: string; isRange: boolean },\n passage: { text?: string; isRange: boolean }\n): string {\n return [\n documentTitle,\n page.text !== undefined ? `${page.isRange ? l.pages : l.page} ${page.text}` : null,\n passage.text !== undefined\n ? `${passage.isRange ? l.passages : l.passage} ${passage.text}`\n : null,\n ]\n .filter(Boolean)\n .join(', ')\n}\n\ninterface PillSurfaceProps {\n href?: string\n onClick?: (e: MouseEvent) => void\n className: string\n testId: string\n /** What assistive tech reads; the visible content is hidden from it. */\n accessibleName: string\n children: ReactNode\n tooltip?: ReactNode\n tooltipSide?: 'top' | 'bottom'\n}\n\n/**\n * The ONE interactive element of a pill: a link, a button or (when there is no action) plain text.\n * Never nests another interactive element, so it is valid inside any host container.\n */\nfunction PillSurface({\n href,\n onClick,\n className,\n testId,\n accessibleName,\n children,\n tooltip,\n tooltipSide = 'bottom',\n}: PillSurfaceProps) {\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"inline-flex min-w-0 items-center gap-1\">\n {children}\n </span>\n <span className=\"sr-only\">{accessibleName}</span>\n </>\n )\n const interactive = cn(\n 'relative cursor-pointer hover:bg-muted/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n )\n\n let surface: ReactNode\n if (href) {\n surface = (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </a>\n )\n } else if (onClick) {\n surface = (\n <button\n type=\"button\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </button>\n )\n } else {\n surface = (\n <span className={className} data-testid={testId}>\n {content}\n </span>\n )\n }\n\n if (!tooltip) return surface\n return (\n <Tooltip>\n <TooltipTrigger asChild>{surface as ReactElement}</TooltipTrigger>\n <TooltipContent side={tooltipSide}>{tooltip}</TooltipContent>\n </Tooltip>\n )\n}\n\nfunction CopyLinkButton({\n href,\n labels,\n testId,\n}: {\n href: string\n labels: PassagePillLabels\n testId: string\n}) {\n const { notify } = useBlocksEnvironment()\n const [copied, setCopied] = useState(false)\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current)\n },\n []\n )\n\n const handleCopy = async (e: MouseEvent) => {\n e.stopPropagation()\n try {\n await navigator.clipboard.writeText(href)\n } catch {\n // Say so instead of pretending: the host's notify surfaces the failure.\n notify(labels.copyFailed, 'error')\n return\n }\n setCopied(true)\n notify(labels.copied, 'success')\n if (timer.current) clearTimeout(timer.current)\n timer.current = setTimeout(() => setCopied(false), COPIED_RESET_MS)\n }\n\n return (\n <>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"relative inline-flex items-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:min-h-6 pointer-fine:min-w-6 pointer-fine:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center\"\n title={labels.copyLink}\n aria-label={labels.copyLink}\n data-testid={testId}\n >\n {copied ? (\n <Check className=\"size-3\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"size-3\" aria-hidden=\"true\" />\n )}\n </button>\n <span role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : ''}\n </span>\n </>\n )\n}\n\n/** A citation to a passage of a document, as a pill, a bare icon or a compact page reference. */\nexport function PassagePill({\n icon,\n documentTitle,\n variant = 'pill',\n pageNumber,\n passageIndex,\n passageIndexEnd,\n pageNumberEnd,\n href,\n className,\n onClick,\n showTooltip = true,\n labelMaxWidth,\n size = 'sm',\n labels,\n testIds,\n testId = 'passage-entity',\n}: PassagePillProps) {\n const l = { ...DEFAULT_PASSAGE_PILL_LABELS, ...labels }\n const ids: PassagePillTestIds = {\n root: testIds?.root ?? testId,\n copy: testIds?.copy ?? `${testIds?.root ?? testId}-copy`,\n }\n // Ranges collapse to \"4–9\"; a range of one renders as a plain \"4\".\n const isPassageRange = passageIndexEnd !== undefined && passageIndexEnd > (passageIndex ?? 0)\n const isPageRange = pageNumberEnd !== undefined && pageNumberEnd > (pageNumber ?? 0)\n const passageText = isPassageRange ? `${passageIndex}–${passageIndexEnd}` : `${passageIndex}`\n const pageText = isPageRange ? `${pageNumber}–${pageNumberEnd}` : `${pageNumber}`\n const accessibleName = describePassage(\n documentTitle,\n l,\n { text: pageNumber !== undefined ? pageText : undefined, isRange: isPageRange },\n { text: passageIndex !== undefined ? passageText : undefined, isRange: isPassageRange }\n )\n const hasAction = Boolean(href || onClick)\n\n if (variant === 'icon') {\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn('inline-flex items-center rounded-sm', className)}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={\n showTooltip ? (\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium\">{documentTitle}</span>\n {(pageNumber !== undefined || passageIndex !== undefined) && (\n <span className=\"text-xs text-muted-foreground\">\n {pageNumber !== undefined && `${isPageRange ? l.pages : l.page} ${pageText}`}\n {pageNumber !== undefined && passageIndex !== undefined && ', '}\n {passageIndex !== undefined &&\n `${isPassageRange ? l.passages : l.passage} ${passageText}`}\n </span>\n )}\n </div>\n ) : undefined\n }\n >\n {icon}\n </PillSurface>\n )\n }\n\n if (variant === 'compact') {\n const label =\n [\n pageNumber !== undefined ? `${l.pageAbbreviation}${pageText}` : null,\n passageIndex !== undefined ? `(${passageText})` : null,\n ]\n .filter(Boolean)\n .join('') || '—'\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md border border-transparent bg-muted px-1 text-sm font-medium',\n className\n )}\n >\n <PillSurface\n href={href}\n onClick={onClick}\n className=\"inline-flex items-center gap-1 rounded-sm\"\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip ? documentTitle : undefined}\n >\n {icon}\n <span className=\"leading-tight\">{label}</span>\n </PillSurface>\n {href && <CopyLinkButton href={href} labels={l} testId={ids.copy} />}\n </span>\n )\n }\n\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn(\n 'group/pill inline-flex items-center rounded-md border border-border bg-muted transition-all',\n size === 'base' ? 'gap-1.5 px-1.5 py-0.5 text-base' : 'gap-1 px-1 text-sm',\n className\n )}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip && hasAction ? l.viewPassage : undefined}\n >\n {icon}\n <span\n className={cn(\n 'min-w-0 truncate font-medium leading-tight',\n labelMaxWidth ?? 'max-w-[320px]'\n )}\n >\n {documentTitle}\n </span>\n {pageNumber ? (\n <span className=\"flex-shrink-0 text-xs leading-none text-muted-foreground\">\n {l.pageAbbreviation}\n {pageText}\n </span>\n ) : null}\n </PillSurface>\n )\n}\n","import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n"]}
1
+ {"version":3,"sources":["../src/citations/PassagePill.tsx","../src/citations/QuietMarks.tsx"],"names":["jsx","cn"],"mappings":";;;;;;AA4BO,IAAM,2BAAA,GAAiD;AAAA,EAC5D,QAAA,EAAU,mBAAA;AAAA,EACV,MAAA,EAAQ,qBAAA;AAAA,EACR,UAAA,EAAY,iCAAA;AAAA,EACZ,WAAA,EAAa,cAAA;AAAA,EACb,IAAA,EAAM,MAAA;AAAA,EACN,KAAA,EAAO,OAAA;AAAA,EACP,OAAA,EAAS,SAAA;AAAA,EACT,QAAA,EAAU,UAAA;AAAA,EACV,gBAAA,EAAkB;AACpB;AAkCA,IAAM,eAAA,GAAkB,GAAA;AAGxB,SAAS,eAAA,CACP,aAAA,EACA,CAAA,EACA,IAAA,EACA,OAAA,EACQ;AACR,EAAA,OAAO;AAAA,IACL,aAAA;AAAA,IACA,IAAA,CAAK,IAAA,KAAS,MAAA,GAAY,CAAA,EAAG,IAAA,CAAK,OAAA,GAAU,CAAA,CAAE,KAAA,GAAQ,CAAA,CAAE,IAAI,CAAA,CAAA,EAAI,IAAA,CAAK,IAAI,CAAA,CAAA,GAAK,IAAA;AAAA,IAC9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AAA;AAAA,GACH;AAEJ","file":"chunk-FUOCCKE4.js","sourcesContent":["import {\n useEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactElement,\n type ReactNode,\n} from 'react'\nimport { Check, Copy } from 'lucide-react'\nimport { Tooltip, TooltipContent, TooltipTrigger, cn } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/** Every fixed string of the passage pill. */\nexport interface PassagePillLabels {\n copyLink: string\n /** Announced and notified after the link was copied. */\n copied: string\n /** Notified when the clipboard refused the write. */\n copyFailed: string\n viewPassage: string\n page: string\n pages: string\n passage: string\n passages: string\n /** Visible abbreviation of \"page\" in the pill (\"p.3\"). */\n pageAbbreviation: string\n}\n\nexport const DEFAULT_PASSAGE_PILL_LABELS: PassagePillLabels = {\n copyLink: 'Copy passage link',\n copied: 'Passage link copied',\n copyFailed: 'Could not copy the passage link',\n viewPassage: 'View passage',\n page: 'Page',\n pages: 'Pages',\n passage: 'Passage',\n passages: 'Passages',\n pageAbbreviation: 'p.',\n}\n\n/** Overridable `data-testid`s of the pill (defaults keep the app's existing ids). */\ninterface PassagePillTestIds {\n root: string\n copy: string\n}\n\nexport interface PassagePillProps {\n /** Glyph of the cited document (host-supplied: file-type icon). */\n icon: ReactNode\n documentTitle: string\n /** `pill`: title + page; `icon`: glyph only; `compact`: page/passage ref + copy link. */\n variant?: 'icon' | 'pill' | 'compact'\n pageNumber?: number\n passageIndex?: number\n /** End of a contiguous passage run: the label collapses to \"4–9\" instead of a pill each. */\n passageIndexEnd?: number\n /** End page of a range: \"p.3–5(4–9)\". */\n pageNumberEnd?: number\n /** Makes the element a link. */\n href?: string\n /** Makes the element a button (ignored for the element role when `href` is set). */\n onClick?: (e: MouseEvent) => void\n showTooltip?: boolean\n labelMaxWidth?: string\n size?: 'sm' | 'base'\n className?: string\n labels?: Partial<PassagePillLabels>\n testIds?: Partial<PassagePillTestIds>\n /** Root test id (default `passage-entity`); the copy button gets `<id>-copy`. */\n testId?: string\n}\n\nconst COPIED_RESET_MS = 2000\n\n/** Plain-language name of a passage reference: \"Title, Page 3, Passage 4\". */\nfunction describePassage(\n documentTitle: string,\n l: PassagePillLabels,\n page: { text?: string; isRange: boolean },\n passage: { text?: string; isRange: boolean }\n): string {\n return [\n documentTitle,\n page.text !== undefined ? `${page.isRange ? l.pages : l.page} ${page.text}` : null,\n passage.text !== undefined\n ? `${passage.isRange ? l.passages : l.passage} ${passage.text}`\n : null,\n ]\n .filter(Boolean)\n .join(', ')\n}\n\ninterface PillSurfaceProps {\n href?: string\n onClick?: (e: MouseEvent) => void\n className: string\n testId: string\n /** What assistive tech reads; the visible content is hidden from it. */\n accessibleName: string\n children: ReactNode\n tooltip?: ReactNode\n tooltipSide?: 'top' | 'bottom'\n}\n\n/**\n * The ONE interactive element of a pill: a link, a button or (when there is no action) plain text.\n * Never nests another interactive element, so it is valid inside any host container.\n */\nfunction PillSurface({\n href,\n onClick,\n className,\n testId,\n accessibleName,\n children,\n tooltip,\n tooltipSide = 'bottom',\n}: PillSurfaceProps) {\n const content = (\n <>\n <span aria-hidden=\"true\" className=\"inline-flex min-w-0 items-center gap-1\">\n {children}\n </span>\n <span className=\"sr-only\">{accessibleName}</span>\n </>\n )\n const interactive = cn(\n 'relative cursor-pointer hover:bg-muted/80 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n \"pointer-coarse:after:absolute pointer-coarse:after:inset-x-0 pointer-coarse:after:-inset-y-3 pointer-coarse:after:content-['']\"\n )\n\n let surface: ReactNode\n if (href) {\n surface = (\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </a>\n )\n } else if (onClick) {\n surface = (\n <button\n type=\"button\"\n className={cn(className, interactive)}\n onClick={onClick}\n data-testid={testId}\n >\n {content}\n </button>\n )\n } else {\n surface = (\n <span className={className} data-testid={testId}>\n {content}\n </span>\n )\n }\n\n if (!tooltip) return surface\n return (\n <Tooltip>\n <TooltipTrigger asChild>{surface as ReactElement}</TooltipTrigger>\n <TooltipContent side={tooltipSide}>{tooltip}</TooltipContent>\n </Tooltip>\n )\n}\n\nfunction CopyLinkButton({\n href,\n labels,\n testId,\n}: {\n href: string\n labels: PassagePillLabels\n testId: string\n}) {\n const { notify } = useBlocksEnvironment()\n const [copied, setCopied] = useState(false)\n const timer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(\n () => () => {\n if (timer.current) clearTimeout(timer.current)\n },\n []\n )\n\n const handleCopy = async (e: MouseEvent) => {\n e.stopPropagation()\n try {\n await navigator.clipboard.writeText(href)\n } catch {\n // Say so instead of pretending: the host's notify surfaces the failure.\n notify(labels.copyFailed, 'error')\n return\n }\n setCopied(true)\n notify(labels.copied, 'success')\n if (timer.current) clearTimeout(timer.current)\n timer.current = setTimeout(() => setCopied(false), COPIED_RESET_MS)\n }\n\n return (\n <>\n <button\n type=\"button\"\n onClick={handleCopy}\n className=\"relative inline-flex items-center text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-fine:min-h-6 pointer-fine:min-w-6 pointer-fine:justify-center pointer-coarse:min-h-11 pointer-coarse:min-w-11 pointer-coarse:justify-center\"\n title={labels.copyLink}\n aria-label={labels.copyLink}\n data-testid={testId}\n >\n {copied ? (\n <Check className=\"size-3\" aria-hidden=\"true\" />\n ) : (\n <Copy className=\"size-3\" aria-hidden=\"true\" />\n )}\n </button>\n <span role=\"status\" className=\"sr-only\">\n {copied ? labels.copied : ''}\n </span>\n </>\n )\n}\n\n/** A citation to a passage of a document, as a pill, a bare icon or a compact page reference. */\nexport function PassagePill({\n icon,\n documentTitle,\n variant = 'pill',\n pageNumber,\n passageIndex,\n passageIndexEnd,\n pageNumberEnd,\n href,\n className,\n onClick,\n showTooltip = true,\n labelMaxWidth,\n size = 'sm',\n labels,\n testIds,\n testId = 'passage-entity',\n}: PassagePillProps) {\n const l = { ...DEFAULT_PASSAGE_PILL_LABELS, ...labels }\n const ids: PassagePillTestIds = {\n root: testIds?.root ?? testId,\n copy: testIds?.copy ?? `${testIds?.root ?? testId}-copy`,\n }\n // Ranges collapse to \"4–9\"; a range of one renders as a plain \"4\".\n const isPassageRange = passageIndexEnd !== undefined && passageIndexEnd > (passageIndex ?? 0)\n const isPageRange = pageNumberEnd !== undefined && pageNumberEnd > (pageNumber ?? 0)\n const passageText = isPassageRange ? `${passageIndex}–${passageIndexEnd}` : `${passageIndex}`\n const pageText = isPageRange ? `${pageNumber}–${pageNumberEnd}` : `${pageNumber}`\n const accessibleName = describePassage(\n documentTitle,\n l,\n { text: pageNumber !== undefined ? pageText : undefined, isRange: isPageRange },\n { text: passageIndex !== undefined ? passageText : undefined, isRange: isPassageRange }\n )\n const hasAction = Boolean(href || onClick)\n\n if (variant === 'icon') {\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn('inline-flex items-center rounded-sm', className)}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={\n showTooltip ? (\n <div className=\"flex flex-col gap-0.5\">\n <span className=\"font-medium\">{documentTitle}</span>\n {(pageNumber !== undefined || passageIndex !== undefined) && (\n <span className=\"text-xs text-muted-foreground\">\n {pageNumber !== undefined && `${isPageRange ? l.pages : l.page} ${pageText}`}\n {pageNumber !== undefined && passageIndex !== undefined && ', '}\n {passageIndex !== undefined &&\n `${isPassageRange ? l.passages : l.passage} ${passageText}`}\n </span>\n )}\n </div>\n ) : undefined\n }\n >\n {icon}\n </PillSurface>\n )\n }\n\n if (variant === 'compact') {\n const label =\n [\n pageNumber !== undefined ? `${l.pageAbbreviation}${pageText}` : null,\n passageIndex !== undefined ? `(${passageText})` : null,\n ]\n .filter(Boolean)\n .join('') || '—'\n return (\n <span\n className={cn(\n 'inline-flex items-center gap-1 rounded-md border border-transparent bg-muted px-1 text-sm font-medium',\n className\n )}\n >\n <PillSurface\n href={href}\n onClick={onClick}\n className=\"inline-flex items-center gap-1 rounded-sm\"\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip ? documentTitle : undefined}\n >\n {icon}\n <span className=\"leading-tight\">{label}</span>\n </PillSurface>\n {href && <CopyLinkButton href={href} labels={l} testId={ids.copy} />}\n </span>\n )\n }\n\n return (\n <PillSurface\n href={href}\n onClick={onClick}\n className={cn(\n 'group/pill inline-flex items-center rounded-md border border-border bg-muted transition-all',\n size === 'base' ? 'gap-1.5 px-1.5 py-0.5 text-base' : 'gap-1 px-1 text-sm',\n className\n )}\n testId={ids.root}\n accessibleName={accessibleName}\n tooltip={showTooltip && hasAction ? l.viewPassage : undefined}\n >\n {icon}\n <span\n className={cn(\n 'min-w-0 truncate font-medium leading-tight',\n labelMaxWidth ?? 'max-w-[320px]'\n )}\n >\n {documentTitle}\n </span>\n {pageNumber ? (\n <span className=\"flex-shrink-0 text-xs leading-none text-muted-foreground\">\n {l.pageAbbreviation}\n {pageText}\n </span>\n ) : null}\n </PillSurface>\n )\n}\n","import { useCallback, type ReactNode } from 'react'\nimport { MarkMenu, cn, type MarkMenuItem } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../provider/environment'\n\n/**\n * Quiet inline marks: links, bookmarks, passage references, label and note marks.\n *\n * Each is typographically distinct TEXT (no pill, no button chrome, no icon in the flow) and owns\n * exactly one contextual menu through the shared `MarkMenu`. Domain-neutral: hosts supply the\n * handlers that make a row mean something.\n */\n\n/** Every fixed string of the quiet marks. */\nexport interface QuietMarkLabels {\n openLink: string\n copyLink: string\n linkCopied: string\n copyFailed: string\n jumpHere: string\n copyPlaceLink: string\n openDocument: string\n linkMenu: string\n bookmarkMenu: string\n}\n\nexport const DEFAULT_QUIET_MARK_LABELS: QuietMarkLabels = {\n openLink: 'Open link',\n copyLink: 'Copy link',\n linkCopied: 'Link copied',\n copyFailed: 'Could not copy',\n jumpHere: 'Jump to here',\n copyPlaceLink: 'Copy link to this place',\n openDocument: 'Open document',\n linkMenu: 'Link actions',\n bookmarkMenu: 'Bookmark actions',\n}\n\n/**\n * Copy text to the clipboard and say so (or say it failed) through the host's `notify`. Resolves\n * whether it was copied.\n */\nexport function useCopyText(labels?: Partial<Pick<QuietMarkLabels, 'linkCopied' | 'copyFailed'>>) {\n const { notify } = useBlocksEnvironment()\n const done = labels?.linkCopied ?? DEFAULT_QUIET_MARK_LABELS.linkCopied\n const failed = labels?.copyFailed ?? DEFAULT_QUIET_MARK_LABELS.copyFailed\n return useCallback(\n async (text: string, message?: string): Promise<boolean> => {\n try {\n await navigator.clipboard.writeText(text)\n notify(message ?? done, 'success')\n return true\n } catch {\n notify(failed, 'error')\n return false\n }\n },\n [notify, done, failed]\n )\n}\n\nexport type QuietLinkKind = 'external' | 'anchor' | 'document'\n\nexport interface QuietLinkProps {\n href?: string\n /** `external` (default) opens elsewhere, `anchor` jumps within the page, `document` is an in-app target. */\n kind?: QuietLinkKind\n /** The primary action. Defaults: external opens a new tab, anchor scrolls to the id. */\n onOpen?: () => void\n /** Absolute URL a copied anchor should carry; defaults to the current page plus the hash. */\n placeLink?: string\n labels?: Partial<QuietMarkLabels>\n className?: string\n testId?: string\n children: ReactNode\n}\n\nconst LINK_STYLE: Record<QuietLinkKind, string> = {\n external:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n document:\n 'text-primary underline decoration-primary/40 decoration-1 underline-offset-[3px] transition-colors hover:decoration-primary focus-visible:decoration-primary',\n // A bookmark is nearly invisible until hovered or focused.\n anchor:\n 'text-inherit underline decoration-dotted decoration-1 decoration-foreground/25 underline-offset-[3px] transition-colors hover:decoration-foreground/70 focus-visible:decoration-foreground/70',\n}\n\nfunction scrollToHash(href: string | undefined) {\n const id = href?.startsWith('#') ? decodeURIComponent(href.slice(1)) : ''\n document.getElementById(id)?.scrollIntoView({ behavior: 'smooth', block: 'start' })\n}\n\n/** A hyperlink, bookmark or document link as quiet text with one menu (open / copy). */\nexport function QuietLink({\n href,\n kind = 'external',\n onOpen,\n placeLink,\n labels,\n className,\n testId,\n children,\n}: QuietLinkProps) {\n const l = { ...DEFAULT_QUIET_MARK_LABELS, ...labels }\n const copy = useCopyText(l)\n\n const open =\n onOpen ??\n (kind === 'anchor'\n ? () => scrollToHash(href)\n : () => {\n if (href) window.open(href, '_blank', 'noopener,noreferrer')\n })\n const copyTarget =\n kind === 'anchor'\n ? (placeLink ?? `${window.location.href.split('#')[0]}${href ?? ''}`)\n : (placeLink ?? href ?? '')\n\n const items: MarkMenuItem[] = [\n {\n id: 'open',\n label: kind === 'anchor' ? l.jumpHere : kind === 'document' ? l.openDocument : l.openLink,\n primary: true,\n onSelect: open,\n testId: 'mark-open',\n },\n {\n id: 'copy',\n label: kind === 'anchor' ? l.copyPlaceLink : l.copyLink,\n onSelect: () => void copy(copyTarget),\n testId: 'mark-copy',\n },\n ]\n\n return (\n <MarkMenu\n as=\"a\"\n href={href}\n items={items}\n menuLabel={kind === 'anchor' ? l.bookmarkMenu : l.linkMenu}\n preview={\n kind === 'external' && href ? (\n <span className=\"block break-all text-xs text-muted-foreground\">{href}</span>\n ) : undefined\n }\n className={cn(LINK_STYLE[kind], 'cursor-pointer', className)}\n testId={testId}\n data-mark-kind={kind}\n >\n {children}\n </MarkMenu>\n )\n}\n\nexport interface PassageMarkProps {\n /** The reference as plain text, e.g. \"¶4\" or \"¶4–9 · p.1\". */\n label: string\n menuLabel: string\n /** Menu rows: copy, link, label, open in navigator. */\n items: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/** A passage's reference as a faint text mark in the margin; its menu carries the passage actions. */\nexport function PassageMark({ label, menuLabel, items, className, testId }: PassageMarkProps) {\n return (\n <MarkMenu\n items={items}\n menuLabel={menuLabel}\n testId={testId}\n data-mark-kind=\"passage\"\n className={cn(\n 'touch-hit cursor-pointer select-none rounded-sm px-1 text-xs tabular-nums text-muted-foreground/80 transition-colors hover:text-foreground focus-visible:text-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-2',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n\nexport interface LabelMarkProps {\n /** Colours of every label marking the passage. */\n colors: string[]\n menuLabel: string\n /** Names of the labels, shown in the menu. */\n preview?: ReactNode\n items: MarkMenuItem[]\n /** Accessible name of the stripes. */\n name: string\n className?: string\n testId?: string\n}\n\n/** The labels on a passage as thin margin stripes (not a chip); the menu shows / removes them. */\nexport function LabelMark({\n colors,\n menuLabel,\n preview,\n items,\n name,\n className,\n testId,\n}: LabelMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={preview}\n menuLabel={menuLabel}\n testId={testId}\n aria-label={name}\n data-mark-kind=\"label\"\n className={cn(\n 'flex cursor-pointer flex-col gap-1 rounded-full focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:px-2 pointer-coarse:py-1',\n className\n )}\n >\n {colors.slice(0, 4).map((c, i) => (\n <span\n key={i}\n aria-hidden=\"true\"\n className=\"h-2.5 w-1 rounded-full\"\n style={{ backgroundColor: c }}\n />\n ))}\n </MarkMenu>\n )\n}\n\nexport interface NoteMarkProps {\n /** Short label, e.g. the passage range this run covers (\"¶4–9\"). */\n label: string\n /** Full note text, shown as the menu preview so the mark is self-explaining. */\n title?: string\n menuLabel?: string\n /** Rows such as \"Show note\" and \"Edit\". With none, the menu is a read-only preview. */\n items?: MarkMenuItem[]\n className?: string\n testId?: string\n}\n\n/**\n * Marks a passage as cited by a Note: small text with a soft yellow underline, drawn once on\n * each CONTIGUOUS run of cited passages (a run is one citation).\n */\nexport function NoteMark({\n label,\n title,\n menuLabel = 'Note actions',\n items = [],\n className,\n testId,\n}: NoteMarkProps) {\n return (\n <MarkMenu\n items={items}\n preview={\n title ? <span className=\"block text-xs text-muted-foreground\">{title}</span> : undefined\n }\n menuLabel={menuLabel}\n testId={testId}\n data-slot=\"note-mark\"\n data-mark-kind=\"note\"\n className={cn(\n 'cursor-default select-none rounded-sm px-1 text-xs font-medium tabular-nums text-foreground/80 underline decoration-yellow-400 decoration-2 underline-offset-[3px] focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n className\n )}\n >\n {label}\n </MarkMenu>\n )\n}\n"]}
@@ -167,5 +167,5 @@ function useOpenWorkflow() {
167
167
  }
168
168
 
169
169
  export { conversationStartRequest, createBlocksEnvironment, mailDraftRequest, requestCalendarComposer, requestCalendarEvent, requestSettingsSection, useBlocksEnvironment, useCalendarViewStore, useIntentRequest, useOpenWorkflow, useRequestedSettingsSection };
170
- //# sourceMappingURL=chunk-BQQTLZBN.js.map
171
- //# sourceMappingURL=chunk-BQQTLZBN.js.map
170
+ //# sourceMappingURL=chunk-GRT4EH76.js.map
171
+ //# sourceMappingURL=chunk-GRT4EH76.js.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":["listeners","notifyStore"],"mappings":";;;;;;AAqCO,IAAM,uBAAuB,MAAA,EAA0B;AAAA,EAC5D,OAAA;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,EAAS,iBAAA,CAAkB,MAAM,YAAY,CAAA;AAAA,MAC7C,YAAY,CAAC,CAAA,MAAO,EAAE,IAAA,EAAM,EAAE,IAAA,EAAK;A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A,CAAS,GAAA,CAAI,WAAgC,CAAA,EAAG,OAAO,WAAA;AAC3D,EAAA,IAAI,KAAA,GAAQ,QAAA,CAAS,GAAA,CAAI,WAAW,CAAA;AACpC,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,GAAA,CAAI,aAAc,KAAA,GAAQ,OAAA,CAAQ,WAAW,CAAE,CAAA;AACpE,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,oBAAA,GAA0C;AACxD,EAAA,MAAM,WAAA,GAAc,qBAAoB,CAAE,WAAA;AAC1C,EAAA,OAAO,WAAA,GAAc,uBAAA,CAAwB,WAAW,CAAA,GAAI,kBAAA;AAC9D;AAMO,SAAS,eAAA,GAAqD;AACnE,EAAA,MAAM,EAAE,YAAA,EAAc,UAAA,EAAW,GAAI,oBAAA,EAAqB;AAC1D,EAAA,MAAM,OAAA,GAAU,WAAW,WAAW,CAAA;AACtC,EAAA,OAAO,UAAU,YAAA,GAAe,MAAA;AAClC","file":"chunk-BQQTLZBN.js","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 })`) and the email draft to show\n * (`openMail({ draftId })`). The environment records the request before the host navigates; the\n * surface takes it when it mounts, or at once while it is already on screen. Taking clears it, so\n * a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from '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","import type { ReactNode } from '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 { conversationStartRequest, mailDraftRequest } 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\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 /** The viewer tab to show: `pdf` is where a signature request is reviewed and signed. */\n tab?: 'pdf'\n}\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 /** The workflow's editor (default) or its runs. */\n view?: 'builder' | 'runs'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** Parts of the product a host can turn off (a setting, a plan): a kit offers them only when on. */\nexport type BlocksFeature = 'workflows'\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\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 /** 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 /** 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-style paths (`/wrk-…/doc-…`): `deepLinkHref`.\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 * `ConnectedConversation`, `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 /** Show the host's notification centre (`ConnectedNotificationCenter`). Absent: not offered. */\n openNotifications?: () => 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`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * A React hook: whether a part of the product is on for this user (a setting, a plan). Kits\n * offer what is off nowhere. Default: everything is on.\n */\n useFeature: (feature: BlocksFeature) => boolean\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 defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\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 useFeature: () => true,\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 openMail(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/**\n * How to open a workflow in the host's Workflows page, or `undefined` while there is none (the\n * host has no `openWorkflow`, or the `workflows` feature is off).\n */\nexport function useOpenWorkflow(): BlocksEnvironment['openWorkflow'] {\n const { openWorkflow, useFeature } = useBlocksEnvironment()\n const enabled = useFeature('workflows')\n return enabled ? openWorkflow : undefined\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":["listeners","notifyStore"],"mappings":";;;;;;AAqCO,IAAM,uBAAuB,MAAA,EAA0B;AAAA,EAC5D,OAAA;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,CA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,wBAAA,CAAyB,OAAA,CAAQ,MAAM,CAAA;AAAA,IACrD,CAAC,CAAA,IAAK;AAAA,GACV;AACA,EAAA,QAAA,CAAS,IAAI,KAAK,CAAA;AAClB,EAAA,OAAO,KAAA;AACT;AAQO,SAAS,wBACd,WAAA,EACmB;AACnB,EAAA,IAAI,QAAA,CAAS,GAAA,CAAI,WAAgC,CAAA,EAAG,OAAO,WAAA;AAC3D,EAAA,IAAI,KAAA,GAAQ,QAAA,CAAS,GAAA,CAAI,WAAW,CAAA;AACpC,EAAA,IAAI,CAAC,OAAO,QAAA,CAAS,GAAA,CAAI,aAAc,KAAA,GAAQ,OAAA,CAAQ,WAAW,CAAE,CAAA;AACpE,EAAA,OAAO,KAAA;AACT;AAGO,SAAS,oBAAA,GAA0C;AACxD,EAAA,MAAM,WAAA,GAAc,qBAAoB,CAAE,WAAA;AAC1C,EAAA,OAAO,WAAA,GAAc,uBAAA,CAAwB,WAAW,CAAA,GAAI,kBAAA;AAC9D;AAMO,SAAS,eAAA,GAAqD;AACnE,EAAA,MAAM,EAAE,YAAA,EAAc,UAAA,EAAW,GAAI,oBAAA,EAAqB;AAC1D,EAAA,MAAM,OAAA,GAAU,WAAW,WAAW,CAAA;AACtC,EAAA,OAAO,UAAU,YAAA,GAAe,MAAA;AAClC","file":"chunk-GRT4EH76.js","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 })`) and the email draft to show\n * (`openMail({ draftId })`). The environment records the request before the host navigates; the\n * surface takes it when it mounts, or at once while it is already on screen. Taking clears it, so\n * a request is acted on once, by one surface.\n */\nimport { useEffect, useRef } from '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","import type { ReactNode } from '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 { conversationStartRequest, mailDraftRequest } 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\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 /** The viewer tab to show: `pdf` is where a signature request is reviewed and signed. */\n tab?: 'pdf'\n}\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 /** The workflow's editor (default) or its runs. */\n view?: 'builder' | 'runs'\n /** The workspace the workflow is in, when it is not the open one. */\n workspaceId?: string\n}\n\nexport interface OpenMailOptions {\n /** The email draft to show (a draft a workflow step or an agent left), to check and send. */\n draftId?: string\n /** The folder to show (`inbox`, `sent`, `trash`, `outbox`…). Default: the host's own. */\n folder?: string\n}\n\nexport interface OpenCalendarOptions {\n /** The event to open on. */\n event?: PendingCalendarEvent\n}\n\n/** Parts of the product a host can turn off (a setting, a plan): a kit offers them only when on. */\nexport type BlocksFeature = 'workflows'\n\n/** Where files are added from: this device, links, or an email account. */\nexport type UploadSource = 'computer' | 'internet' | 'email'\n\n/** What `openShare` shares by email. */\nexport interface ShareRequest {\n resourceType: 'document' | 'conversation'\n resourceExtId: string\n workspaceExtId: string\n resourceName?: string\n /** Whether it is private to its owner now: the dialog offers to share it with the workspace. */\n isPrivate: boolean\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 /** 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 /** 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-style paths (`/wrk-…/doc-…`): `deepLinkHref`.\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 * `ConnectedConversation`, `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 /** Show the host's notification centre (`ConnectedNotificationCenter`). Absent: not offered. */\n openNotifications?: () => 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`). Absent: never.\n */\n openWorkflow?: (workflowId?: string, options?: OpenWorkflowOptions) => void\n /**\n * A React hook: whether a part of the product is on for this user (a setting, a plan). Kits\n * offer what is off nowhere. Default: everything is on.\n */\n useFeature: (feature: BlocksFeature) => boolean\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 defaultEnvironment: BlocksEnvironment = {\n navigate: (href) => {\n if (typeof window !== 'undefined') window.location.assign(href)\n },\n notify: (message, kind = 'info', options) => {\n notifyStore[kind](message, options)\n },\n confirm: confirmDialog,\n choose: choiceDialog,\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 useFeature: () => true,\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 openMail(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/**\n * How to open a workflow in the host's Workflows page, or `undefined` while there is none (the\n * host has no `openWorkflow`, or the `workflows` feature is off).\n */\nexport function useOpenWorkflow(): BlocksEnvironment['openWorkflow'] {\n const { openWorkflow, useFeature } = useBlocksEnvironment()\n const enabled = useFeature('workflows')\n return enabled ? openWorkflow : undefined\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkCQU37FNV_cjs = require('./chunk-CQU37FNV.cjs');
4
+ var chunkKKT53TZQ_cjs = require('./chunk-KKT53TZQ.cjs');
5
5
  var chunkAQPZ4QMV_cjs = require('./chunk-AQPZ4QMV.cjs');
6
6
  var chunkV4ISCZJ7_cjs = require('./chunk-V4ISCZJ7.cjs');
7
7
  var chunkAHDJXIUB_cjs = require('./chunk-AHDJXIUB.cjs');
@@ -317,7 +317,7 @@ function SchemaForm({
317
317
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-col gap-4", className), "data-slot": "schema-form", children: [
318
318
  common.map(render),
319
319
  advanced.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(
320
- chunkCQU37FNV_cjs.FoldSection,
320
+ chunkKKT53TZQ_cjs.FoldSection,
321
321
  {
322
322
  label: l.advanced,
323
323
  open: advancedOpen,
@@ -477,7 +477,7 @@ function WorkflowConfigDialog({
477
477
  const firstField = workflow.inputs.find((f) => !f.advanced);
478
478
  const focusPromptFirst = firstField?.type === "text" || firstField?.type === "longtext";
479
479
  const defaultScopeRender = scopeSource ? (_field, value, onChange) => /* @__PURE__ */ jsxRuntime.jsx(
480
- chunkCQU37FNV_cjs.ScopePicker,
480
+ chunkKKT53TZQ_cjs.ScopePicker,
481
481
  {
482
482
  folders: scopeSource.folders,
483
483
  unfiledCount: scopeSource.unfiledCount,
@@ -510,7 +510,7 @@ function WorkflowConfigDialog({
510
510
  },
511
511
  children: [
512
512
  /* @__PURE__ */ jsxRuntime.jsx(
513
- chunkCQU37FNV_cjs.QuickActionDialogHeader,
513
+ chunkKKT53TZQ_cjs.QuickActionDialogHeader,
514
514
  {
515
515
  icon: workflow.icon && renderIcon ? renderIcon(workflow.icon) : null,
516
516
  title: workflow.title,
@@ -528,7 +528,7 @@ function WorkflowConfigDialog({
528
528
  submit();
529
529
  },
530
530
  children: noFiles ? /* @__PURE__ */ jsxRuntime.jsx(
531
- chunkCQU37FNV_cjs.AddFilesFirst,
531
+ chunkKKT53TZQ_cjs.AddFilesFirst,
532
532
  {
533
533
  reason: l.addFilesReason,
534
534
  action: addFilesAction,
@@ -652,7 +652,7 @@ function WorkflowLauncher({
652
652
  });
653
653
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className, "data-slot": "workflow-launcher", children: [
654
654
  showTiles && /* @__PURE__ */ jsxRuntime.jsx(
655
- chunkCQU37FNV_cjs.StartTiles,
655
+ chunkKKT53TZQ_cjs.StartTiles,
656
656
  {
657
657
  items: [...tiles, ...extraTiles],
658
658
  caption,
@@ -1629,5 +1629,5 @@ exports.matchWorkflowScope = matchWorkflowScope;
1629
1629
  exports.workflowRunStatusLabel = workflowRunStatusLabel;
1630
1630
  exports.workflowStatus = workflowStatus;
1631
1631
  exports.workflowTriggerType = workflowTriggerType;
1632
- //# sourceMappingURL=chunk-YRHQ7OLG.cjs.map
1633
- //# sourceMappingURL=chunk-YRHQ7OLG.cjs.map
1632
+ //# sourceMappingURL=chunk-I5RK4WAE.cjs.map
1633
+ //# sourceMappingURL=chunk-I5RK4WAE.cjs.map