@arbidocs/blocks 0.5.152 → 0.5.154

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 (273) hide show
  1. package/dist/{ConnectedNativeDocxComparison-244UIHSM.cjs → ConnectedNativeDocxComparison-2DAQX5GX.cjs} +9 -9
  2. package/dist/{ConnectedStreamedWordArtifact-V6BRZMEQ.cjs.map → ConnectedNativeDocxComparison-2DAQX5GX.cjs.map} +1 -1
  3. package/dist/{ConnectedPresentation-JUXIXKYN.cjs → ConnectedPresentation-J42JPUVR.cjs} +13 -13
  4. package/dist/{ConnectedPresentation-JUXIXKYN.cjs.map → ConnectedPresentation-J42JPUVR.cjs.map} +1 -1
  5. package/dist/{ConnectedSlidesTab-JA3VB66W.cjs → ConnectedSlidesTab-BYS7HFNK.cjs} +12 -12
  6. package/dist/{ConnectedSlidesTab-JA3VB66W.cjs.map → ConnectedSlidesTab-BYS7HFNK.cjs.map} +1 -1
  7. package/dist/{ConnectedStreamedWordArtifact-V6BRZMEQ.cjs → ConnectedStreamedWordArtifact-LTYB62VM.cjs} +9 -9
  8. package/dist/{ConnectedNativeDocxComparison-244UIHSM.cjs.map → ConnectedStreamedWordArtifact-LTYB62VM.cjs.map} +1 -1
  9. package/dist/{DocumentReviewCard-5W2QQWKA.cjs → DocumentReviewCard-ILDLYZ5A.cjs} +15 -13
  10. package/dist/DocumentReviewCard-ILDLYZ5A.cjs.map +1 -0
  11. package/dist/{FilesViewerDialog-63QUTG4L.cjs → FilesViewerDialog-YLD5YFP2.cjs} +25 -22
  12. package/dist/FilesViewerDialog-YLD5YFP2.cjs.map +1 -0
  13. package/dist/{RechartsRenderer-NU6WUZJS.cjs → RechartsRenderer-EPVL5QZA.cjs} +2 -2
  14. package/dist/{RechartsRenderer-NU6WUZJS.cjs.map → RechartsRenderer-EPVL5QZA.cjs.map} +1 -1
  15. package/dist/{SpotlightStrip-HXQFPAAL.cjs → SpotlightStrip-JE6MXUBT.cjs} +6 -6
  16. package/dist/{SpotlightStrip-HXQFPAAL.cjs.map → SpotlightStrip-JE6MXUBT.cjs.map} +1 -1
  17. package/dist/{WorkspaceTableView-2QP2HJLK.cjs → WorkspaceTableView-V3N64LJG.cjs} +13 -11
  18. package/dist/WorkspaceTableView-V3N64LJG.cjs.map +1 -0
  19. package/dist/agents/index.cjs +245 -244
  20. package/dist/agents/workflows/WorkflowLauncher.d.ts +3 -1
  21. package/dist/agents/workflows/WorkflowLauncher.js +2 -0
  22. package/dist/agents/workflows/WorkflowLauncher.js.map +2 -2
  23. package/dist/{ai-ODGRIL6Y.cjs → ai-QFY4LYQZ.cjs} +16 -16
  24. package/dist/ai-QFY4LYQZ.cjs.map +1 -0
  25. package/dist/calls/index.cjs +25 -24
  26. package/dist/calls/index.cjs.map +1 -1
  27. package/dist/{chunk-MAKCWF45.cjs → chunk-6GKCGCMT.cjs} +4 -4
  28. package/dist/{chunk-MAKCWF45.cjs.map → chunk-6GKCGCMT.cjs.map} +1 -1
  29. package/dist/{chunk-LYKT336H.cjs → chunk-6I5HHWCD.cjs} +5 -5
  30. package/dist/{chunk-LYKT336H.cjs.map → chunk-6I5HHWCD.cjs.map} +1 -1
  31. package/dist/{chunk-KWJW5TMH.cjs → chunk-6OPDKROP.cjs} +4 -41
  32. package/dist/chunk-6OPDKROP.cjs.map +1 -0
  33. package/dist/{chunk-QWOPEBH2.cjs → chunk-6P4U63HO.cjs} +4 -4
  34. package/dist/{chunk-QWOPEBH2.cjs.map → chunk-6P4U63HO.cjs.map} +1 -1
  35. package/dist/{chunk-QKCFV36K.cjs → chunk-7UPEFZCV.cjs} +9 -9
  36. package/dist/{chunk-QKCFV36K.cjs.map → chunk-7UPEFZCV.cjs.map} +1 -1
  37. package/dist/{chunk-DUNXLT63.cjs → chunk-AHUEBRLX.cjs} +2 -238
  38. package/dist/chunk-AHUEBRLX.cjs.map +1 -0
  39. package/dist/{chunk-B5BGVPQ5.cjs → chunk-AURL2KT5.cjs} +4 -4
  40. package/dist/{chunk-B5BGVPQ5.cjs.map → chunk-AURL2KT5.cjs.map} +1 -1
  41. package/dist/chunk-BH322H5B.cjs +594 -0
  42. package/dist/chunk-BH322H5B.cjs.map +1 -0
  43. package/dist/{chunk-ZCQXQIBA.cjs → chunk-BNDIMTWJ.cjs} +28 -28
  44. package/dist/{chunk-ZCQXQIBA.cjs.map → chunk-BNDIMTWJ.cjs.map} +1 -1
  45. package/dist/{chunk-AG6KAGAX.cjs → chunk-BTQ7IAOH.cjs} +4 -4
  46. package/dist/{chunk-AG6KAGAX.cjs.map → chunk-BTQ7IAOH.cjs.map} +1 -1
  47. package/dist/{chunk-FCT62ZPE.cjs → chunk-BZVK7JW5.cjs} +5 -5
  48. package/dist/{chunk-FCT62ZPE.cjs.map → chunk-BZVK7JW5.cjs.map} +1 -1
  49. package/dist/{chunk-WUM76MJU.cjs → chunk-CNBYM5Q7.cjs} +7 -7
  50. package/dist/{chunk-WUM76MJU.cjs.map → chunk-CNBYM5Q7.cjs.map} +1 -1
  51. package/dist/{chunk-HNLNRAEU.cjs → chunk-DSLMJ24E.cjs} +2 -261
  52. package/dist/chunk-DSLMJ24E.cjs.map +1 -0
  53. package/dist/chunk-DWRUGOTQ.cjs +35 -0
  54. package/dist/chunk-DWRUGOTQ.cjs.map +1 -0
  55. package/dist/{chunk-GAA222SK.cjs → chunk-EG3DPKXM.cjs} +5 -5
  56. package/dist/{chunk-GAA222SK.cjs.map → chunk-EG3DPKXM.cjs.map} +1 -1
  57. package/dist/chunk-FEAHTNTY.cjs +1447 -0
  58. package/dist/chunk-FEAHTNTY.cjs.map +1 -0
  59. package/dist/{chunk-VSDD5TH5.cjs → chunk-G3MRW4WB.cjs} +10 -8
  60. package/dist/chunk-G3MRW4WB.cjs.map +1 -0
  61. package/dist/{chunk-TFRCNIUY.cjs → chunk-GF6AYAMI.cjs} +9 -9
  62. package/dist/{chunk-TFRCNIUY.cjs.map → chunk-GF6AYAMI.cjs.map} +1 -1
  63. package/dist/{chunk-4ZR4O5SP.cjs → chunk-GK3U3FWY.cjs} +60 -28
  64. package/dist/chunk-GK3U3FWY.cjs.map +1 -0
  65. package/dist/{chunk-3CJTO6RV.cjs → chunk-GXRD5OSU.cjs} +8 -8
  66. package/dist/{chunk-3CJTO6RV.cjs.map → chunk-GXRD5OSU.cjs.map} +1 -1
  67. package/dist/{chunk-JLNKD56X.cjs → chunk-GYI4UXX6.cjs} +4 -4
  68. package/dist/{chunk-JLNKD56X.cjs.map → chunk-GYI4UXX6.cjs.map} +1 -1
  69. package/dist/{chunk-4I2PCP7O.cjs → chunk-I3XTTTPZ.cjs} +41 -40
  70. package/dist/chunk-I3XTTTPZ.cjs.map +1 -0
  71. package/dist/chunk-JWCVA4LC.cjs +248 -0
  72. package/dist/chunk-JWCVA4LC.cjs.map +1 -0
  73. package/dist/{chunk-UM3EWCDE.cjs → chunk-K5F2VNCX.cjs} +35 -10
  74. package/dist/chunk-K5F2VNCX.cjs.map +1 -0
  75. package/dist/chunk-KD66CBYO.cjs +44 -0
  76. package/dist/chunk-KD66CBYO.cjs.map +1 -0
  77. package/dist/chunk-LLVE5TST.cjs +318 -0
  78. package/dist/chunk-LLVE5TST.cjs.map +1 -0
  79. package/dist/{chunk-JCFXS336.cjs → chunk-NRGLF4J4.cjs} +2 -466
  80. package/dist/chunk-NRGLF4J4.cjs.map +1 -0
  81. package/dist/{chunk-CVVQHFLR.cjs → chunk-O7U6KL2W.cjs} +72 -650
  82. package/dist/chunk-O7U6KL2W.cjs.map +1 -0
  83. package/dist/{chunk-Z3N32LL4.cjs → chunk-OOANNOH4.cjs} +35 -33
  84. package/dist/chunk-OOANNOH4.cjs.map +1 -0
  85. package/dist/chunk-SGYURQ23.cjs +271 -0
  86. package/dist/chunk-SGYURQ23.cjs.map +1 -0
  87. package/dist/{chunk-A5SKK3CU.cjs → chunk-SLCH5JRI.cjs} +64 -35
  88. package/dist/chunk-SLCH5JRI.cjs.map +1 -0
  89. package/dist/chunk-T26UYA6Q.cjs +64 -0
  90. package/dist/chunk-T26UYA6Q.cjs.map +1 -0
  91. package/dist/chunk-T3Y3LZ4Y.cjs +477 -0
  92. package/dist/chunk-T3Y3LZ4Y.cjs.map +1 -0
  93. package/dist/{chunk-4XNP27N4.cjs → chunk-T7BUGVSG.cjs} +36 -36
  94. package/dist/{chunk-4XNP27N4.cjs.map → chunk-T7BUGVSG.cjs.map} +1 -1
  95. package/dist/{chunk-SMO4SPPB.cjs → chunk-TD5V5BZ3.cjs} +5 -5
  96. package/dist/{chunk-SMO4SPPB.cjs.map → chunk-TD5V5BZ3.cjs.map} +1 -1
  97. package/dist/{chunk-IXTDOPSB.cjs → chunk-TSAZWUPZ.cjs} +4 -4
  98. package/dist/{chunk-IXTDOPSB.cjs.map → chunk-TSAZWUPZ.cjs.map} +1 -1
  99. package/dist/{chunk-5DGNJ6VJ.cjs → chunk-UD3LPATQ.cjs} +6 -6
  100. package/dist/{chunk-5DGNJ6VJ.cjs.map → chunk-UD3LPATQ.cjs.map} +1 -1
  101. package/dist/{chunk-OF7KMG6R.cjs → chunk-UJHQ4DA4.cjs} +5 -5
  102. package/dist/{chunk-OF7KMG6R.cjs.map → chunk-UJHQ4DA4.cjs.map} +1 -1
  103. package/dist/{chunk-NUFZFWHZ.cjs → chunk-W5QSKW7T.cjs} +3 -29
  104. package/dist/chunk-W5QSKW7T.cjs.map +1 -0
  105. package/dist/{chunk-NNZFZYTI.cjs → chunk-WOVNXJK5.cjs} +4 -54
  106. package/dist/chunk-WOVNXJK5.cjs.map +1 -0
  107. package/dist/{chunk-E6BM5ENI.cjs → chunk-WRTEKOQP.cjs} +2 -309
  108. package/dist/chunk-WRTEKOQP.cjs.map +1 -0
  109. package/dist/{chunk-KRQCUVH7.cjs → chunk-YSAUOJA7.cjs} +9 -3
  110. package/dist/chunk-YSAUOJA7.cjs.map +1 -0
  111. package/dist/{chunk-6ZZWQ3OL.cjs → chunk-YXY52OGU.cjs} +4 -4
  112. package/dist/{chunk-6ZZWQ3OL.cjs.map → chunk-YXY52OGU.cjs.map} +1 -1
  113. package/dist/{chunk-D5DOK2AE.cjs → chunk-ZW2ZFC3Q.cjs} +58 -58
  114. package/dist/{chunk-D5DOK2AE.cjs.map → chunk-ZW2ZFC3Q.cjs.map} +1 -1
  115. package/dist/components/gestures/usePointerGesture.d.ts +13 -1
  116. package/dist/components/gestures/usePointerGesture.js +33 -8
  117. package/dist/components/gestures/usePointerGesture.js.map +2 -2
  118. package/dist/connect/docx.cjs +12 -12
  119. package/dist/connect/index.cjs +1319 -2361
  120. package/dist/connect/index.cjs.map +1 -1
  121. package/dist/connect/index.d.ts +1 -0
  122. package/dist/connect/index.js +1 -0
  123. package/dist/connect/index.js.map +2 -2
  124. package/dist/connect/viewer.cjs +15 -12
  125. package/dist/connection/dashboards/DashboardPanel.d.ts +2 -0
  126. package/dist/connection/dashboards/DashboardPanel.js +4 -0
  127. package/dist/connection/dashboards/DashboardPanel.js.map +2 -2
  128. package/dist/connection/dashboards/index.d.ts +1 -1
  129. package/dist/connection/dashboards/index.js +2 -0
  130. package/dist/connection/dashboards/index.js.map +2 -2
  131. package/dist/connection/dashboards/templates.d.ts +10 -5
  132. package/dist/connection/dashboards/templates.js +7 -1
  133. package/dist/connection/dashboards/templates.js.map +2 -2
  134. package/dist/connection/live-blocks/ConnectedAgendaBlock.d.ts +13 -0
  135. package/dist/connection/live-blocks/ConnectedAgendaBlock.js +19 -0
  136. package/dist/connection/live-blocks/ConnectedAgendaBlock.js.map +7 -0
  137. package/dist/connection/live-blocks/ConnectedCarouselBlock.d.ts +7 -0
  138. package/dist/connection/live-blocks/ConnectedCarouselBlock.js +84 -0
  139. package/dist/connection/live-blocks/ConnectedCarouselBlock.js.map +7 -0
  140. package/dist/connection/live-blocks/ConnectedListBlock.d.ts +29 -0
  141. package/dist/connection/live-blocks/ConnectedListBlock.js +193 -0
  142. package/dist/connection/live-blocks/ConnectedListBlock.js.map +7 -0
  143. package/dist/connection/live-blocks/ConnectedStartBlock.d.ts +7 -0
  144. package/dist/connection/live-blocks/ConnectedStartBlock.js +16 -0
  145. package/dist/connection/live-blocks/ConnectedStartBlock.js.map +7 -0
  146. package/dist/connection/live-blocks/DashboardAgenda.d.ts +10 -0
  147. package/dist/connection/{workspace-dashboard → live-blocks}/DashboardAgenda.js +10 -2
  148. package/dist/connection/live-blocks/DashboardAgenda.js.map +7 -0
  149. package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.js.map +1 -1
  150. package/dist/connection/live-blocks/LiveBlockRoot.d.ts +11 -0
  151. package/dist/connection/live-blocks/LiveBlockRoot.js +22 -0
  152. package/dist/connection/live-blocks/LiveBlockRoot.js.map +7 -0
  153. package/dist/connection/live-blocks/index.d.ts +5 -0
  154. package/dist/connection/live-blocks/index.js +20 -0
  155. package/dist/connection/live-blocks/index.js.map +7 -0
  156. package/dist/connection/{workspace-dashboard/dashboard-rows.d.ts → live-blocks/list-rows.d.ts} +22 -4
  157. package/dist/connection/{workspace-dashboard/dashboard-rows.js → live-blocks/list-rows.js} +13 -8
  158. package/dist/connection/live-blocks/list-rows.js.map +7 -0
  159. package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.js.map +1 -1
  160. package/dist/connection/live-blocks/workspace-dashboard-blocks.d.ts +23 -0
  161. package/dist/connection/live-blocks/workspace-dashboard-blocks.js +58 -0
  162. package/dist/connection/live-blocks/workspace-dashboard-blocks.js.map +7 -0
  163. package/dist/connection/pages/BlockEditor.d.ts +3 -1
  164. package/dist/connection/pages/BlockEditor.js +18 -1
  165. package/dist/connection/pages/BlockEditor.js.map +2 -2
  166. package/dist/connection/pages/ConnectedPagesPage.d.ts +5 -4
  167. package/dist/connection/pages/ConnectedPagesPage.js +122 -46
  168. package/dist/connection/pages/ConnectedPagesPage.js.map +2 -2
  169. package/dist/connection/pages/EditablePageGrid.d.ts +25 -15
  170. package/dist/connection/pages/EditablePageGrid.js +145 -50
  171. package/dist/connection/pages/EditablePageGrid.js.map +2 -2
  172. package/dist/connection/pages/LiveBlockEditor.d.ts +30 -0
  173. package/dist/connection/pages/LiveBlockEditor.js +175 -0
  174. package/dist/connection/pages/LiveBlockEditor.js.map +7 -0
  175. package/dist/connection/pages/PageBlockView.d.ts +5 -3
  176. package/dist/connection/pages/PageBlockView.js +69 -4
  177. package/dist/connection/pages/PageBlockView.js.map +2 -2
  178. package/dist/connection/pages/PageGrid.d.ts +4 -3
  179. package/dist/connection/pages/PageGrid.js +4 -2
  180. package/dist/connection/pages/PageGrid.js.map +2 -2
  181. package/dist/connection/pages/PagesList.d.ts +4 -3
  182. package/dist/connection/pages/PagesList.js.map +2 -2
  183. package/dist/connection/pages/TableViewBlock.d.ts +5 -4
  184. package/dist/connection/pages/TableViewBlock.js +19 -19
  185. package/dist/connection/pages/TableViewBlock.js.map +2 -2
  186. package/dist/connection/pages/grid-layout.d.ts +44 -12
  187. package/dist/connection/pages/grid-layout.js +71 -27
  188. package/dist/connection/pages/grid-layout.js.map +2 -2
  189. package/dist/connection/pages/index.d.ts +4 -2
  190. package/dist/connection/pages/index.js +34 -5
  191. package/dist/connection/pages/index.js.map +2 -2
  192. package/dist/connection/pages/labels.js +5 -1
  193. package/dist/connection/pages/labels.js.map +2 -2
  194. package/dist/connection/pages/page-templates.d.ts +10 -0
  195. package/dist/connection/pages/page-templates.js +16 -0
  196. package/dist/connection/pages/page-templates.js.map +7 -0
  197. package/dist/connection/storage/ConnectedStorageProjectCard.js +1 -1
  198. package/dist/connection/storage/ConnectedStorageProjectCard.js.map +2 -2
  199. package/dist/connection/storage/ConnectedWorkspaceTrash.d.ts +3 -0
  200. package/dist/connection/storage/ConnectedWorkspaceTrash.js +41 -17
  201. package/dist/connection/storage/ConnectedWorkspaceTrash.js.map +2 -2
  202. package/dist/connection/workflows/ConnectedWorkflowStart.d.ts +2 -0
  203. package/dist/connection/workflows/ConnectedWorkflowStart.js.map +2 -2
  204. package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.d.ts +10 -7
  205. package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.js +31 -171
  206. package/dist/connection/workspace-dashboard/ConnectedWorkspaceDashboard.js.map +3 -3
  207. package/dist/dashboards/ChartRenderer.d.ts +5 -3
  208. package/dist/dashboards/ChartRenderer.js +29 -18
  209. package/dist/dashboards/ChartRenderer.js.map +2 -2
  210. package/dist/dashboards/PanelView.d.ts +6 -1
  211. package/dist/dashboards/PanelView.js +24 -7
  212. package/dist/dashboards/PanelView.js.map +2 -2
  213. package/dist/dashboards/RechartsRenderer.d.ts +2 -1
  214. package/dist/dashboards/RechartsRenderer.js.map +2 -2
  215. package/dist/dashboards/index.cjs +25 -21
  216. package/dist/embed/index.cjs +23 -20
  217. package/dist/files/index.cjs +250 -249
  218. package/dist/home/FactsStrip.d.ts +3 -1
  219. package/dist/home/FactsStrip.js +3 -2
  220. package/dist/home/FactsStrip.js.map +2 -2
  221. package/dist/home/RecentList.d.ts +4 -2
  222. package/dist/home/RecentList.js +3 -2
  223. package/dist/home/RecentList.js.map +2 -2
  224. package/dist/home/StartTiles.d.ts +6 -1
  225. package/dist/home/StartTiles.js +55 -33
  226. package/dist/home/StartTiles.js.map +2 -2
  227. package/dist/home/index.cjs +62 -57
  228. package/dist/home/index.d.ts +1 -1
  229. package/dist/home/index.js +2 -1
  230. package/dist/home/index.js.map +2 -2
  231. package/dist/home/sections.d.ts +5 -0
  232. package/dist/home/sections.js +7 -0
  233. package/dist/home/sections.js.map +2 -2
  234. package/dist/index.cjs +339 -337
  235. package/dist/index.cjs.map +1 -1
  236. package/dist/pages/index.cjs +635 -157
  237. package/dist/pages/index.cjs.map +1 -1
  238. package/dist/settings/index.cjs +170 -169
  239. package/dist/shell/index.cjs +35 -34
  240. package/dist/studio/index.cjs +12 -12
  241. package/dist/styles.css +1 -1
  242. package/dist/workflow-canvas/index.cjs +33 -29
  243. package/dist/workflow-canvas/index.cjs.map +1 -1
  244. package/dist/workspaces/index.cjs +49 -47
  245. package/dist/workspaces/index.cjs.map +1 -1
  246. package/node_modules/@arbidocs/coedit/package.json +1 -1
  247. package/package.json +5 -5
  248. package/dist/DocumentReviewCard-5W2QQWKA.cjs.map +0 -1
  249. package/dist/FilesViewerDialog-63QUTG4L.cjs.map +0 -1
  250. package/dist/WorkspaceTableView-2QP2HJLK.cjs.map +0 -1
  251. package/dist/ai-ODGRIL6Y.cjs.map +0 -1
  252. package/dist/chunk-4I2PCP7O.cjs.map +0 -1
  253. package/dist/chunk-4ZR4O5SP.cjs.map +0 -1
  254. package/dist/chunk-A5SKK3CU.cjs.map +0 -1
  255. package/dist/chunk-CVVQHFLR.cjs.map +0 -1
  256. package/dist/chunk-DUNXLT63.cjs.map +0 -1
  257. package/dist/chunk-E6BM5ENI.cjs.map +0 -1
  258. package/dist/chunk-HNLNRAEU.cjs.map +0 -1
  259. package/dist/chunk-JCFXS336.cjs.map +0 -1
  260. package/dist/chunk-KRQCUVH7.cjs.map +0 -1
  261. package/dist/chunk-KWJW5TMH.cjs.map +0 -1
  262. package/dist/chunk-NNZFZYTI.cjs.map +0 -1
  263. package/dist/chunk-NUFZFWHZ.cjs.map +0 -1
  264. package/dist/chunk-UM3EWCDE.cjs.map +0 -1
  265. package/dist/chunk-VSDD5TH5.cjs.map +0 -1
  266. package/dist/chunk-Z3N32LL4.cjs.map +0 -1
  267. package/dist/connection/workspace-dashboard/DashboardAgenda.d.ts +0 -1
  268. package/dist/connection/workspace-dashboard/DashboardAgenda.js.map +0 -7
  269. package/dist/connection/workspace-dashboard/dashboard-rows.js.map +0 -7
  270. /package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.d.ts +0 -0
  271. /package/dist/connection/{workspace-dashboard → live-blocks}/DashboardStart.js +0 -0
  272. /package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.d.ts +0 -0
  273. /package/dist/connection/{workspace-dashboard → live-blocks}/useDashboardAdd.js +0 -0
@@ -1,26 +1,55 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkUM3EWCDE_cjs = require('../chunk-UM3EWCDE.cjs');
4
+ var chunkK5F2VNCX_cjs = require('../chunk-K5F2VNCX.cjs');
5
+ var chunkFEAHTNTY_cjs = require('../chunk-FEAHTNTY.cjs');
6
+ require('../chunk-DWRUGOTQ.cjs');
7
+ require('../chunk-KD66CBYO.cjs');
8
+ require('../chunk-7UPEFZCV.cjs');
9
+ require('../chunk-V27WLYTG.cjs');
10
+ require('../chunk-SGYURQ23.cjs');
5
11
  var chunkDLGYR4JL_cjs = require('../chunk-DLGYR4JL.cjs');
6
- var chunkLYKT336H_cjs = require('../chunk-LYKT336H.cjs');
7
- var chunkKRQCUVH7_cjs = require('../chunk-KRQCUVH7.cjs');
8
- var chunk4ZR4O5SP_cjs = require('../chunk-4ZR4O5SP.cjs');
12
+ require('../chunk-JWCVA4LC.cjs');
13
+ require('../chunk-T3Y3LZ4Y.cjs');
14
+ require('../chunk-5GBM7BQB.cjs');
15
+ require('../chunk-UD3LPATQ.cjs');
16
+ var chunk6I5HHWCD_cjs = require('../chunk-6I5HHWCD.cjs');
17
+ var chunkYSAUOJA7_cjs = require('../chunk-YSAUOJA7.cjs');
18
+ var chunkGK3U3FWY_cjs = require('../chunk-GK3U3FWY.cjs');
9
19
  require('../chunk-PBPO54KZ.cjs');
10
20
  var chunkQ25CZLK6_cjs = require('../chunk-Q25CZLK6.cjs');
11
- require('../chunk-MWHVETKN.cjs');
21
+ var chunkMWHVETKN_cjs = require('../chunk-MWHVETKN.cjs');
12
22
  var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
23
+ require('../chunk-7G2LJMUG.cjs');
24
+ require('../chunk-WRTEKOQP.cjs');
13
25
  require('../chunk-2P7VH2SK.cjs');
14
26
  require('../chunk-ZU2B2RZK.cjs');
27
+ require('../chunk-BH322H5B.cjs');
28
+ require('../chunk-M55XUF4L.cjs');
29
+ require('../chunk-EVZH6Z5O.cjs');
30
+ require('../chunk-G3MRW4WB.cjs');
31
+ require('../chunk-AHDJXIUB.cjs');
32
+ require('../chunk-SLCH5JRI.cjs');
15
33
  require('../chunk-YA6GXWC2.cjs');
16
34
  require('../chunk-ZVEW3JBT.cjs');
17
35
  var chunkMHIG6GGS_cjs = require('../chunk-MHIG6GGS.cjs');
18
36
  require('../chunk-VG24E4JJ.cjs');
19
37
  require('../chunk-U2FFG2B3.cjs');
38
+ require('../chunk-4M3OIBIS.cjs');
39
+ require('../chunk-6U3CYVZC.cjs');
40
+ require('../chunk-QUMUAJ2P.cjs');
41
+ require('../chunk-ZKKSTMMI.cjs');
42
+ require('../chunk-VZOOGA47.cjs');
43
+ require('../chunk-T26UYA6Q.cjs');
44
+ require('../chunk-DWN5AUMH.cjs');
20
45
  require('../chunk-GB5MN5FC.cjs');
46
+ require('../chunk-TMX7YFVM.cjs');
21
47
  require('../chunk-3YZKDCWY.cjs');
22
48
  var chunkZW6FPIFC_cjs = require('../chunk-ZW6FPIFC.cjs');
49
+ require('../chunk-SQCCQU3K.cjs');
50
+ require('../chunk-UDSHVNU3.cjs');
23
51
  require('../chunk-IPSHAMO2.cjs');
52
+ require('../chunk-PPCATBOY.cjs');
24
53
  var chunk46LX6EQT_cjs = require('../chunk-46LX6EQT.cjs');
25
54
  require('../chunk-K67VMSOX.cjs');
26
55
  require('../chunk-CVPV4I7Z.cjs');
@@ -34,6 +63,13 @@ var artifacts = require('@arbidocs/react/artifacts');
34
63
  var documentTools = require('@arbidocs/react/document-tools');
35
64
  var viewers = require('@arbidocs/react/viewers');
36
65
 
66
+ var PAGE_TEMPLATES = [
67
+ chunkFEAHTNTY_cjs.WORKSPACE_DASHBOARD_PAGE,
68
+ ...chunkYSAUOJA7_cjs.DASHBOARD_TEMPLATES
69
+ ];
70
+ function pageOfTemplate(template) {
71
+ return "panels" in template ? react.pageFromDashboard(template) : structuredClone(template);
72
+ }
37
73
  var DEFAULT_DOCUMENTS_PICKER_LABELS = {
38
74
  label: "Documents",
39
75
  search: "Search documents\u2026",
@@ -63,7 +99,7 @@ function DocumentsPicker({
63
99
  [all]
64
100
  );
65
101
  const found = all.filter((d) => (d.file_name ?? "").toLowerCase().includes(query.trim().toLowerCase())).slice(0, 50);
66
- const pick = (id) => {
102
+ const pick2 = (id) => {
67
103
  if (!multiple) return onChange([id]);
68
104
  onChange(value.includes(id) ? value.filter((v) => v !== id) : [...value, id]);
69
105
  };
@@ -95,7 +131,7 @@ function DocumentsPicker({
95
131
  role: "option",
96
132
  "aria-selected": chosen,
97
133
  disabled: blocked,
98
- onClick: () => pick(d.external_id),
134
+ onClick: () => pick2(d.external_id),
99
135
  className: ui.cn(
100
136
  "flex w-full items-center justify-between gap-2 px-3 py-1.5 text-left text-sm hover:bg-muted disabled:cursor-not-allowed disabled:opacity-60",
101
137
  chosen && "bg-muted font-medium"
@@ -156,6 +192,170 @@ function DocumentsPicker({
156
192
  sharedOnly && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-muted-foreground", children: l.sharedOnlyHint })
157
193
  ] });
158
194
  }
195
+ var DEFAULT_LIVE_BLOCK_EDITOR_LABELS = {
196
+ listSource: "Shows",
197
+ listSources: { documents: "Recent files", conversations: "Recent threads", facts: "Facts" },
198
+ factsGroups: "Facts shown",
199
+ factsGroupOptions: {
200
+ upcoming_and_newest: "Upcoming, then the newest",
201
+ upcoming: "Upcoming dated facts",
202
+ newest: "The newest facts"
203
+ },
204
+ rows: "Rows",
205
+ carouselSource: "Shows",
206
+ carouselSources: { skills: "Skills", workflows: "Workflows" },
207
+ cards: "Cards",
208
+ agendaDays: "Days ahead",
209
+ agendaEvents: "Events",
210
+ startNote: 'What you can start, "Create a file" and Add, as on the workspace dashboard. Nothing to set.'
211
+ };
212
+ var LIST_SOURCES = [
213
+ "documents",
214
+ "conversations",
215
+ "facts"
216
+ ];
217
+ var FACTS_GROUPS = [
218
+ "upcoming_and_newest",
219
+ "upcoming",
220
+ "newest"
221
+ ];
222
+ var CAROUSEL_SOURCES = ["skills", "workflows"];
223
+ var pick = (options, v) => options.find((o) => o === v);
224
+ function LiveBlockEditor({
225
+ value,
226
+ onChange,
227
+ workflowsOn,
228
+ labels,
229
+ testId = "live-block-editor"
230
+ }) {
231
+ const l = { ...DEFAULT_LIVE_BLOCK_EDITOR_LABELS, ...labels };
232
+ switch (value.kind) {
233
+ case "list": {
234
+ const { config } = value;
235
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-3", "data-testid": testId, children: [
236
+ /* @__PURE__ */ jsxRuntime.jsx(
237
+ chunkMWHVETKN_cjs.EditorSelect,
238
+ {
239
+ label: l.listSource,
240
+ value: config.source,
241
+ options: LIST_SOURCES.map((s) => ({ value: s, label: l.listSources[s] })),
242
+ onChange: (v) => {
243
+ const source = pick(LIST_SOURCES, v);
244
+ if (source) onChange({ ...value, config: { source, limit: config.limit } });
245
+ },
246
+ testId: `${testId}-source`
247
+ }
248
+ ),
249
+ /* @__PURE__ */ jsxRuntime.jsx(
250
+ NumberField,
251
+ {
252
+ label: l.rows,
253
+ value: config.limit,
254
+ bounds: react.LIVE_BLOCK_LIMITS.listRows,
255
+ onChange: (limit) => onChange({ ...value, config: { ...config, limit } }),
256
+ testId: `${testId}-limit`
257
+ }
258
+ ),
259
+ config.source === "facts" && /* @__PURE__ */ jsxRuntime.jsx(
260
+ chunkMWHVETKN_cjs.EditorSelect,
261
+ {
262
+ label: l.factsGroups,
263
+ value: config.facts ?? "upcoming_and_newest",
264
+ options: FACTS_GROUPS.map((g) => ({ value: g, label: l.factsGroupOptions[g] })),
265
+ onChange: (v) => {
266
+ const facts = pick(FACTS_GROUPS, v);
267
+ if (facts) onChange({ ...value, config: { ...config, facts } });
268
+ },
269
+ testId: `${testId}-facts`
270
+ }
271
+ )
272
+ ] });
273
+ }
274
+ case "carousel": {
275
+ const { config } = value;
276
+ const sources = CAROUSEL_SOURCES.filter((s) => s !== "workflows" || workflowsOn);
277
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-3", "data-testid": testId, children: [
278
+ /* @__PURE__ */ jsxRuntime.jsx(
279
+ chunkMWHVETKN_cjs.EditorSelect,
280
+ {
281
+ label: l.carouselSource,
282
+ value: config.source,
283
+ options: sources.map((s) => ({ value: s, label: l.carouselSources[s] })),
284
+ onChange: (v) => {
285
+ const source = pick(sources, v);
286
+ if (source) onChange({ ...value, config: { ...config, source } });
287
+ },
288
+ testId: `${testId}-source`
289
+ }
290
+ ),
291
+ /* @__PURE__ */ jsxRuntime.jsx(
292
+ NumberField,
293
+ {
294
+ label: l.cards,
295
+ value: config.limit,
296
+ bounds: react.LIVE_BLOCK_LIMITS.carouselItems,
297
+ onChange: (limit) => onChange({ ...value, config: { ...config, limit } }),
298
+ testId: `${testId}-limit`
299
+ }
300
+ )
301
+ ] });
302
+ }
303
+ case "agenda": {
304
+ const { config } = value;
305
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid gap-4 sm:grid-cols-3", "data-testid": testId, children: [
306
+ /* @__PURE__ */ jsxRuntime.jsx(
307
+ NumberField,
308
+ {
309
+ label: l.agendaDays,
310
+ value: config.days,
311
+ bounds: react.LIVE_BLOCK_LIMITS.agendaDays,
312
+ onChange: (days) => onChange({ ...value, config: { ...config, days } }),
313
+ testId: `${testId}-days`
314
+ }
315
+ ),
316
+ /* @__PURE__ */ jsxRuntime.jsx(
317
+ NumberField,
318
+ {
319
+ label: l.agendaEvents,
320
+ value: config.limit,
321
+ bounds: react.LIVE_BLOCK_LIMITS.agendaEvents,
322
+ onChange: (limit) => onChange({ ...value, config: { ...config, limit } }),
323
+ testId: `${testId}-limit`
324
+ }
325
+ )
326
+ ] });
327
+ }
328
+ case "start":
329
+ return /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", "data-testid": testId, children: l.startNote });
330
+ }
331
+ }
332
+ function NumberField({
333
+ label,
334
+ value,
335
+ bounds,
336
+ onChange,
337
+ testId
338
+ }) {
339
+ const id = react$1.useId();
340
+ return /* @__PURE__ */ jsxRuntime.jsx(chunkMWHVETKN_cjs.EditorField, { label, htmlFor: id, children: /* @__PURE__ */ jsxRuntime.jsx(
341
+ ui.Input,
342
+ {
343
+ id,
344
+ type: "number",
345
+ inputMode: "numeric",
346
+ min: bounds.min,
347
+ max: bounds.max,
348
+ step: 1,
349
+ value,
350
+ onChange: (e) => {
351
+ const n = Math.round(Number(e.target.value));
352
+ if (Number.isFinite(n)) onChange(Math.min(bounds.max, Math.max(bounds.min, n)));
353
+ },
354
+ className: "bg-card text-sm",
355
+ "data-testid": testId
356
+ }
357
+ ) });
358
+ }
159
359
  var DEFAULT_VIEW_PICKER_LABELS = {
160
360
  label: "Table view",
161
361
  placeholder: "Choose a view\u2026",
@@ -220,9 +420,11 @@ function BlockEditor({
220
420
  editorLabels,
221
421
  pickerLabels,
222
422
  documentsLabels,
423
+ liveLabels,
223
424
  testId = "page-block-editor"
224
425
  }) {
225
426
  const l = { ...DEFAULT_BLOCK_EDITOR_LABELS, ...labels };
427
+ const workflowsOn = react.useFeature("workflows");
226
428
  const [value, setValue] = react$1.useState(block);
227
429
  react$1.useEffect(() => setValue(block), [block]);
228
430
  const setPanel = (panel) => setValue((b) => b ? { ...react.blockOfPanel(panel, b.layout.h), layout: b.layout } : b);
@@ -234,7 +436,7 @@ function BlockEditor({
234
436
  ] }),
235
437
  value && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-4", children: [
236
438
  (value.kind === "chart" || value.kind === "metric") && /* @__PURE__ */ jsxRuntime.jsx(
237
- chunkLYKT336H_cjs.PanelEditor,
439
+ chunk6I5HHWCD_cjs.PanelEditor,
238
440
  {
239
441
  value: react.panelOfBlock(value),
240
442
  onChange: setPanel,
@@ -277,6 +479,16 @@ function BlockEditor({
277
479
  labels: documentsLabels,
278
480
  testId: `${testId}-documents`
279
481
  }
482
+ ),
483
+ (value.kind === "list" || value.kind === "carousel" || value.kind === "agenda" || value.kind === "start") && /* @__PURE__ */ jsxRuntime.jsx(
484
+ LiveBlockEditor,
485
+ {
486
+ value,
487
+ onChange: setValue,
488
+ workflowsOn,
489
+ labels: liveLabels,
490
+ testId: `${testId}-live`
491
+ }
280
492
  )
281
493
  ] }),
282
494
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DialogFooter, { children: [
@@ -293,16 +505,27 @@ function BlockEditor({
293
505
  ] })
294
506
  ] }) });
295
507
  }
296
- var MIN_BLOCK_SIZE = {
297
- metric: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.metric },
298
- text: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.text },
299
- chart: { w: 3, h: react.DEFAULT_BLOCK_HEIGHT.chart },
300
- table: { w: 4, h: react.DEFAULT_BLOCK_HEIGHT.table },
301
- document: { w: 3, h: react.DEFAULT_BLOCK_HEIGHT.document },
302
- gallery: { w: 3, h: react.DEFAULT_BLOCK_HEIGHT.gallery }
508
+ var SLOT_COLUMNS = 3;
509
+ var SLOT_ROWS = 3;
510
+ var SLOTS_ACROSS = react.PAGE_GRID_COLUMNS / SLOT_COLUMNS;
511
+ var MAX_BLOCK_SLOTS = 4;
512
+ var DEFAULT_BLOCK_SLOTS = {
513
+ metric: { w: 1, h: react.DEFAULT_BLOCK_HEIGHT.metric / SLOT_ROWS },
514
+ text: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.text / SLOT_ROWS },
515
+ chart: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.chart / SLOT_ROWS },
516
+ table: { w: 4, h: react.DEFAULT_BLOCK_HEIGHT.table / SLOT_ROWS },
517
+ document: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.document / SLOT_ROWS },
518
+ gallery: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.gallery / SLOT_ROWS },
519
+ list: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.list / SLOT_ROWS },
520
+ carousel: { w: 4, h: react.DEFAULT_BLOCK_HEIGHT.carousel / SLOT_ROWS },
521
+ agenda: { w: 2, h: react.DEFAULT_BLOCK_HEIGHT.agenda / SLOT_ROWS },
522
+ start: { w: 4, h: react.DEFAULT_BLOCK_HEIGHT.start / SLOT_ROWS }
303
523
  };
524
+ function defaultLayout(kind) {
525
+ const { w, h } = DEFAULT_BLOCK_SLOTS[kind];
526
+ return { x: 0, y: 0, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
527
+ }
304
528
  var overlaps = (a, b) => a.x < b.x + b.w && b.x < a.x + a.w && a.y < b.y + b.h && b.y < a.y + a.h;
305
- var clampInt = (n, lo, hi) => Math.min(hi, Math.max(lo, Math.round(n)));
306
529
  function compactLayout(items, pinned) {
307
530
  const placed = [];
308
531
  const out = /* @__PURE__ */ new Map();
@@ -346,37 +569,61 @@ function place(items, id, layout) {
346
569
  moved
347
570
  );
348
571
  }
572
+ var clampSlots = (n, lo, hi) => Math.min(hi, Math.max(lo, Math.round(n)));
573
+ function snapLayout(layout) {
574
+ const w = clampSlots(layout.w / SLOT_COLUMNS, 1, MAX_BLOCK_SLOTS);
575
+ const h = clampSlots(layout.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS);
576
+ const x = clampSlots(layout.x / SLOT_COLUMNS, 0, SLOTS_ACROSS - w);
577
+ const y = Math.max(0, Math.round(layout.y / SLOT_ROWS));
578
+ return { x: x * SLOT_COLUMNS, y: y * SLOT_ROWS, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
579
+ }
580
+ function normalizeLayout(items) {
581
+ return compactLayout(items.map((i) => ({ ...i, layout: snapLayout(i.layout) })));
582
+ }
349
583
  function moveBlock(items, id, to, settle = true) {
350
584
  const item = items.find((i) => i.id === id);
351
585
  if (!item) return [...items];
352
- const layout = {
353
- ...item.layout,
354
- x: clampInt(to.x, 0, react.PAGE_GRID_COLUMNS - item.layout.w),
355
- y: Math.max(0, Math.round(to.y))
356
- };
586
+ const layout = snapLayout({ ...item.layout, x: to.x, y: to.y });
357
587
  const next = compactLayout(place(items, id, layout), id);
358
588
  return settle ? compactLayout(next) : next;
359
589
  }
360
590
  function resizeBlock(items, id, to, settle = true) {
361
591
  const item = items.find((i) => i.id === id);
362
592
  if (!item) return [...items];
363
- const min = MIN_BLOCK_SIZE[item.kind];
364
- const layout = {
365
- ...item.layout,
366
- w: clampInt(
367
- to.w,
368
- Math.min(min.w, react.PAGE_GRID_COLUMNS - item.layout.x),
369
- react.PAGE_GRID_COLUMNS - item.layout.x
370
- ),
371
- h: Math.max(min.h, Math.round(to.h))
372
- };
593
+ const room = SLOTS_ACROSS - item.layout.x / SLOT_COLUMNS;
594
+ const w = clampSlots(to.w / SLOT_COLUMNS, 1, Math.min(MAX_BLOCK_SLOTS, room));
595
+ const h = clampSlots(to.h / SLOT_ROWS, 1, MAX_BLOCK_SLOTS);
596
+ const layout = { ...item.layout, w: w * SLOT_COLUMNS, h: h * SLOT_ROWS };
373
597
  const next = compactLayout(place(items, id, layout), id);
374
598
  return settle ? compactLayout(next) : next;
375
599
  }
600
+ function stepSize(items, id, dw, dh) {
601
+ const item = items.find((i) => i.id === id);
602
+ if (!item) return [...items];
603
+ return resizeBlock(items, id, {
604
+ w: item.layout.w + dw * SLOT_COLUMNS,
605
+ h: item.layout.h + dh * SLOT_ROWS
606
+ });
607
+ }
608
+ function stepMove(items, id, dx, dy) {
609
+ const item = items.find((i) => i.id === id);
610
+ if (!item) return [...items];
611
+ const at = item.layout;
612
+ if (dx) return moveBlock(items, id, { x: at.x + dx * SLOT_COLUMNS, y: at.y });
613
+ if (!dy) return [...items];
614
+ const sameColumns = (b) => b.x < at.x + at.w && at.x < b.x + b.w;
615
+ const others = items.filter((i) => i.id !== id && sameColumns(i.layout)).map((i) => i.layout);
616
+ if (dy > 0) {
617
+ const below = others.filter((b) => b.y >= at.y + at.h).sort((a, b) => a.y - b.y)[0];
618
+ return below ? moveBlock(items, id, { x: at.x, y: below.y + below.h - at.h }) : [...items];
619
+ }
620
+ const above = others.filter((b) => b.y + b.h <= at.y).sort((a, b) => b.y - a.y)[0];
621
+ return above ? moveBlock(items, id, { x: at.x, y: above.y }) : [...items];
622
+ }
376
623
  function appendBlock(items, item) {
377
624
  const bottom = Math.max(0, ...items.map((i) => i.layout.y + i.layout.h));
378
- const w = clampInt(item.layout.w, 1, react.PAGE_GRID_COLUMNS);
379
- return compactLayout([...items, { ...item, layout: { ...item.layout, x: 0, y: bottom, w } }]);
625
+ const layout = snapLayout({ ...item.layout, x: 0, y: bottom });
626
+ return compactLayout([...items, { ...item, layout }]);
380
627
  }
381
628
  var PAGE_ROW_HEIGHT = "4.5rem";
382
629
  function PageGrid({ children, className, testId, gridRef }) {
@@ -384,8 +631,10 @@ function PageGrid({ children, className, testId, gridRef }) {
384
631
  "div",
385
632
  {
386
633
  ref: gridRef,
387
- className: ui.cn("grid grid-cols-1 gap-4 md:grid-cols-12", className),
388
- style: { gridAutoRows: `minmax(${PAGE_ROW_HEIGHT}, auto)` },
634
+ className: ui.cn(
635
+ "grid auto-rows-[minmax(4.5rem,auto)] grid-cols-1 gap-4 md:auto-rows-[4.5rem] md:grid-cols-12",
636
+ className
637
+ ),
389
638
  "data-slot": "page-grid",
390
639
  "data-testid": testId,
391
640
  children
@@ -425,15 +674,17 @@ function PageCell({
425
674
  );
426
675
  }
427
676
  var DEFAULT_EDITABLE_PAGE_GRID_LABELS = {
428
- move: "Move the block",
429
- moveHint: "Drag to move. Arrow keys move it; Shift and the arrow keys resize it.",
430
- resize: "Resize the block"
677
+ move: "Drag to move",
678
+ arrange: "Arrow keys move the block a slot; Shift and the arrow keys resize it.",
679
+ resize: "Drag to resize"
431
680
  };
681
+ var NO_DRAG = 'input, textarea, select, button, a[href], label, [contenteditable="true"], [contenteditable=""], [role="button"], [role="slider"], [role="scrollbar"], [data-no-drag]';
432
682
  var RESIZE_HANDLES = [
433
683
  { kind: "e", left: "100%", top: "50%", cursor: "ew-resize" },
434
684
  { kind: "s", left: "50%", top: "100%", cursor: "ns-resize" },
435
685
  { kind: "se", left: "100%", top: "100%", cursor: "nwse-resize" }
436
686
  ];
687
+ var ON_HOVER = "z-10 hidden opacity-0 transition-opacity group-hover/cell:opacity-100 group-focus-within/cell:opacity-100 md:flex";
437
688
  var px = (value) => {
438
689
  const n = parseFloat(value);
439
690
  return Number.isFinite(n) ? n : 0;
@@ -442,15 +693,26 @@ function pitchOf(grid) {
442
693
  if (!grid) return { col: 0, row: 0 };
443
694
  const view = grid.ownerDocument.defaultView ?? window;
444
695
  const style = view.getComputedStyle(grid);
696
+ const tracks = style.gridTemplateColumns.trim();
697
+ if (tracks && tracks !== "none" && tracks.split(/\s+/).length < 12) return { col: 0, row: 0 };
445
698
  const rem = px(view.getComputedStyle(grid.ownerDocument.documentElement).fontSize) || 16;
446
- const gapX = px(style.columnGap);
447
- const gapY = px(style.rowGap);
448
699
  return {
449
- col: (grid.getBoundingClientRect().width + gapX) / 12,
450
- row: px(PAGE_ROW_HEIGHT) * rem + gapY
700
+ col: (grid.getBoundingClientRect().width + px(style.columnGap)) / 12,
701
+ row: px(PAGE_ROW_HEIGHT) * rem + px(style.rowGap)
451
702
  };
452
703
  }
704
+ function pressesHeader(target) {
705
+ if (!(target instanceof Element)) return false;
706
+ if (target.closest("[data-page-move]")) return true;
707
+ return !!target.closest("[data-page-header]") && !target.closest(NO_DRAG);
708
+ }
453
709
  var keyOf = (blocks) => blocks.map((b) => `${b.id}:${b.layout.x},${b.layout.y},${b.layout.w},${b.layout.h}`).join("|");
710
+ var ARROWS = {
711
+ ArrowLeft: [-1, 0],
712
+ ArrowRight: [1, 0],
713
+ ArrowUp: [0, -1],
714
+ ArrowDown: [0, 1]
715
+ };
454
716
  function EditableCell({
455
717
  block,
456
718
  layout,
@@ -460,24 +722,34 @@ function EditableCell({
460
722
  onPreview,
461
723
  onCommit,
462
724
  renderBlock,
725
+ actionsOf,
463
726
  l,
727
+ hintId,
464
728
  testId
465
729
  }) {
466
730
  const element = react$1.useRef(null);
467
- const gesture = chunkUM3EWCDE_cjs.usePointerGesture({
731
+ const dropped = react$1.useRef(false);
732
+ const escape = react$1.useRef(null);
733
+ const gesture = chunkK5F2VNCX_cjs.usePointerGesture({
468
734
  element,
469
- threshold: 3,
470
- begin: () => {
735
+ threshold: 4,
736
+ begin: (kind, event) => {
737
+ if (kind === "move" && !pressesHeader(event.target)) return null;
471
738
  const { col, row } = pitchOf(grid());
472
739
  if (!col || !row) return null;
473
740
  return { base: blocks, start: block.layout, col, row, shown: keyOf(blocks) };
474
741
  },
475
742
  dragStart: () => {
476
743
  if (element.current) element.current.style.willChange = "transform";
744
+ const doc = element.current?.ownerDocument ?? document;
745
+ escape.current = (event) => {
746
+ if (event.key === "Escape") gesture.cancel();
747
+ };
748
+ doc.addEventListener("keydown", escape.current);
477
749
  },
478
750
  update: (g, kind, { dx, dy }) => {
479
- const cols = Math.round(dx / g.col);
480
- const rows = Math.round(dy / g.row);
751
+ const cols = dx / g.col;
752
+ const rows = dy / g.row;
481
753
  const next = kind === "move" ? moveBlock(g.base, block.id, { x: g.start.x + cols, y: g.start.y + rows }, false) : resizeBlock(
482
754
  g.base,
483
755
  block.id,
@@ -499,67 +771,105 @@ function EditableCell({
499
771
  }
500
772
  },
501
773
  end: (g, next, kind) => {
502
- if (element.current) {
503
- element.current.style.transform = "";
504
- element.current.style.willChange = "";
774
+ const el = element.current;
775
+ if (el) {
776
+ el.style.transform = "";
777
+ el.style.willChange = "";
778
+ }
779
+ if (escape.current) {
780
+ (el?.ownerDocument ?? document).removeEventListener("keydown", escape.current);
781
+ escape.current = null;
505
782
  }
506
783
  onPreview(null);
507
784
  if (!next) return;
785
+ dropped.current = true;
508
786
  const to = next.blocks.find((b) => b.id === block.id)?.layout ?? block.layout;
509
787
  const settled = kind === "move" ? moveBlock(g.base, block.id, to) : resizeBlock(g.base, block.id, to);
510
788
  if (keyOf(settled) !== keyOf(g.base)) onCommit(settled);
511
789
  }
512
790
  });
513
791
  const onKeyDown = (event) => {
514
- const step = {
515
- ArrowLeft: [-1, 0],
516
- ArrowRight: [1, 0],
517
- ArrowUp: [0, -1],
518
- ArrowDown: [0, 1]
519
- }[event.key];
520
- if (!step) return;
792
+ if (event.key === "Escape" && gesture.active()) {
793
+ gesture.cancel();
794
+ return;
795
+ }
796
+ const arrow = ARROWS[event.key];
797
+ if (!arrow) return;
521
798
  event.preventDefault();
522
- const [x, y] = step;
523
- const { layout: at } = block;
524
- onCommit(
525
- event.shiftKey ? resizeBlock(blocks, block.id, { w: at.w + x, h: at.h + y }) : moveBlock(blocks, block.id, { x: at.x + x, y: at.y + y })
526
- );
799
+ const [dx, dy] = arrow;
800
+ const next = event.shiftKey ? stepSize(blocks, block.id, dx, dy) : stepMove(blocks, block.id, dx, dy);
801
+ if (keyOf(next) !== keyOf(blocks)) onCommit(next);
527
802
  };
528
- const grip = /* @__PURE__ */ jsxRuntime.jsx(
529
- ui.Button,
530
- {
531
- variant: "ghost",
532
- size: "icon",
533
- className: "hidden size-7 cursor-grab touch-none active:cursor-grabbing md:inline-flex",
534
- "aria-label": l.move,
535
- title: l.moveHint,
536
- onPointerDown: (event) => gesture.start(event, "move"),
537
- onKeyDown,
538
- "data-testid": `${testId}-move-${block.id}`,
539
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.GripVertical, { className: "size-3.5" })
540
- }
541
- );
542
803
  return /* @__PURE__ */ jsxRuntime.jsxs(
543
804
  PageCell,
544
805
  {
545
806
  layout,
546
807
  cellRef: element,
547
- className: ui.cn("group/cell relative", dragged && "z-10 opacity-90"),
808
+ tabIndex: -1,
809
+ className: ui.cn(
810
+ "group/cell relative rounded-xl outline-none",
811
+ // Lifted while dragged: above the others, a strong outline, a shadow.
812
+ dragged && "z-20 scale-[1.02] select-none shadow-xl ring-2 ring-primary"
813
+ ),
814
+ "data-dragging": dragged || void 0,
548
815
  ...gesture.handlers,
816
+ onClickCapture: (event) => {
817
+ if (!dropped.current) return;
818
+ dropped.current = false;
819
+ event.preventDefault();
820
+ event.stopPropagation();
821
+ },
549
822
  testId: `${testId}-cell-${block.id}`,
550
823
  children: [
551
- renderBlock(block, grip),
824
+ renderBlock(block),
825
+ /* @__PURE__ */ jsxRuntime.jsxs(
826
+ "div",
827
+ {
828
+ className: ui.cn(
829
+ "absolute inset-x-0 top-0 z-10 flex h-10 items-center justify-end gap-1 rounded-t-xl px-2 md:touch-none",
830
+ dragged ? "cursor-grabbing" : "md:cursor-grab"
831
+ ),
832
+ "data-page-header": true,
833
+ onPointerDown: (event) => {
834
+ dropped.current = false;
835
+ gesture.start(event, "move", { lazy: true });
836
+ },
837
+ "data-testid": `${testId}-header-${block.id}`,
838
+ children: [
839
+ actionsOf?.(block),
840
+ /* @__PURE__ */ jsxRuntime.jsx(
841
+ ui.Button,
842
+ {
843
+ variant: "ghost",
844
+ size: "icon",
845
+ className: ui.cn(
846
+ "hidden size-7 opacity-0 transition-opacity focus-visible:opacity-100 group-hover/cell:opacity-100 group-focus-within/cell:opacity-100 md:inline-flex",
847
+ dragged ? "cursor-grabbing opacity-100" : "cursor-grab"
848
+ ),
849
+ "aria-label": l.move,
850
+ "aria-describedby": hintId,
851
+ title: l.move,
852
+ "data-page-move": true,
853
+ onKeyDown,
854
+ "data-testid": `${testId}-move-${block.id}`,
855
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Move, { className: "size-3.5" })
856
+ }
857
+ )
858
+ ]
859
+ }
860
+ ),
552
861
  RESIZE_HANDLES.map(({ kind, left, top, cursor }) => /* @__PURE__ */ jsxRuntime.jsx(
553
- chunkUM3EWCDE_cjs.GestureHandle,
862
+ chunkK5F2VNCX_cjs.GestureHandle,
554
863
  {
555
864
  left,
556
865
  top,
557
866
  cursor,
558
867
  size: "sm",
559
868
  bar: kind === "e" ? "v" : kind === "s" ? "h" : void 0,
560
- className: "hidden opacity-0 transition-opacity group-hover/cell:opacity-100 pointer-coarse:opacity-100 md:flex",
869
+ className: ON_HOVER,
561
870
  onPointerDown: (event) => gesture.start(event, kind),
562
871
  "aria-label": l.resize,
872
+ title: l.resize,
563
873
  testId: `${testId}-resize-${kind}-${block.id}`
564
874
  },
565
875
  kind
@@ -569,23 +879,44 @@ function EditableCell({
569
879
  );
570
880
  }
571
881
  function EditablePageGrid({
572
- blocks,
882
+ blocks: saved,
573
883
  onChange,
574
884
  renderBlock,
885
+ actionsOf,
575
886
  labels,
576
887
  testId = "page"
577
888
  }) {
578
889
  const l = { ...DEFAULT_EDITABLE_PAGE_GRID_LABELS, ...labels };
579
890
  const grid = react$1.useRef(null);
891
+ const hintId = react$1.useId();
892
+ const blocks = react$1.useMemo(() => normalizeLayout(saved), [saved]);
580
893
  const [preview, setPreview] = react$1.useState(null);
581
894
  const placeOf = (block) => preview?.blocks.find((b) => b.id === block.id)?.layout ?? block.layout;
582
- const target = preview?.moving ? preview.blocks.find((b) => b.id === preview.id) : void 0;
895
+ const target = preview?.blocks.find((b) => b.id === preview.id);
896
+ const slotRows = preview ? Math.max(...preview.blocks.map((b) => b.layout.y + b.layout.h)) / SLOT_ROWS + 1 : 0;
897
+ const cells = Array.from({ length: slotRows * SLOTS_ACROSS }, (_, i) => ({
898
+ x: i % SLOTS_ACROSS * SLOT_COLUMNS,
899
+ y: Math.floor(i / SLOTS_ACROSS) * SLOT_ROWS,
900
+ w: SLOT_COLUMNS,
901
+ h: SLOT_ROWS
902
+ }));
583
903
  return /* @__PURE__ */ jsxRuntime.jsxs(PageGrid, { testId: `${testId}-grid`, gridRef: grid, children: [
904
+ /* @__PURE__ */ jsxRuntime.jsx("p", { id: hintId, className: "sr-only", children: l.arrange }),
905
+ cells.map((cell) => /* @__PURE__ */ jsxRuntime.jsx(
906
+ PageCell,
907
+ {
908
+ layout: cell,
909
+ className: "pointer-events-none hidden rounded-xl border border-dashed border-border bg-muted/20 md:block",
910
+ "aria-hidden": true,
911
+ testId: `${testId}-slot`
912
+ },
913
+ `${cell.x}-${cell.y}`
914
+ )),
584
915
  target && /* @__PURE__ */ jsxRuntime.jsx(
585
916
  PageCell,
586
917
  {
587
918
  layout: target.layout,
588
- className: "rounded-xl border-2 border-dashed border-primary/30 bg-primary/5",
919
+ className: "pointer-events-none hidden rounded-xl border-2 border-primary/50 bg-primary/10 md:block",
589
920
  "aria-hidden": true,
590
921
  testId: `${testId}-drop-target`
591
922
  }
@@ -603,7 +934,9 @@ function EditablePageGrid({
603
934
  onPreview: setPreview,
604
935
  onCommit: onChange,
605
936
  renderBlock,
937
+ actionsOf,
606
938
  l,
939
+ hintId,
607
940
  testId
608
941
  },
609
942
  block.id
@@ -805,6 +1138,12 @@ var toRowView = (r) => ({
805
1138
  titles: { ...r.titles ?? {} },
806
1139
  shared: r.shared ?? true
807
1140
  });
1141
+ var GRID_TYPES = new Set(chunkQ25CZLK6_cjs.DATABASE_COLUMN_TYPES);
1142
+ var isGridType = (type) => GRID_TYPES.has(type);
1143
+ var toColumnView = (c) => ({
1144
+ ...c,
1145
+ type: isGridType(c.type) ? c.type : "text"
1146
+ });
808
1147
  function TableViewBlock({
809
1148
  viewId,
810
1149
  actions,
@@ -813,34 +1152,25 @@ function TableViewBlock({
813
1152
  testId
814
1153
  }) {
815
1154
  const l = { ...DEFAULT_TABLE_VIEW_BLOCK_LABELS, ...labels };
816
- const view = react.useTableView(viewId || null);
817
- const target = view.data?.target ?? null;
818
- const databaseId = target && target.startsWith("dbs-") ? target : null;
819
- const database = react.useDatabase(databaseId);
820
- const rows = react.useDatabaseRows(databaseId, "", { view: viewId });
821
- const columns = react$1.useMemo(() => {
822
- const all = database.data?.columns ?? [];
823
- const wanted = view.data?.spec.columns ?? [];
824
- if (!wanted.length) return all;
825
- const byId = new Map(all.map((c) => [c.id, c]));
826
- return wanted.flatMap((id) => byId.get(id) ?? []);
827
- }, [database.data, view.data]);
1155
+ const read = react.useTableViewRows(viewId || null);
1156
+ const data = read.data;
1157
+ const columns = react$1.useMemo(() => (data?.columns ?? []).map(toColumnView), [data]);
1158
+ const rows = react$1.useMemo(() => (data?.rows ?? []).map(toRowView), [data]);
828
1159
  let body;
829
- if (view.isError || database.isError) {
1160
+ if (read.isError) {
830
1161
  body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "p-4 text-sm text-muted-foreground", children: l.unavailable });
831
- } else if (view.data && !databaseId) {
1162
+ } else if (data && !data.database) {
832
1163
  body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "p-4 text-sm text-muted-foreground", children: l.notADatabase });
833
- } else if (!view.data || !database.data) {
1164
+ } else if (!data) {
834
1165
  body = /* @__PURE__ */ jsxRuntime.jsx("p", { className: "p-4 text-sm text-muted-foreground", children: l.loading });
835
1166
  } else {
836
1167
  body = /* @__PURE__ */ jsxRuntime.jsx(
837
1168
  chunkQ25CZLK6_cjs.DatabaseTable,
838
1169
  {
839
1170
  columns,
840
- rows: (rows.data?.rows ?? []).map(toRowView),
1171
+ rows,
841
1172
  readOnly: true,
842
1173
  isFiltered: true,
843
- isLoading: rows.isLoading,
844
1174
  gridId: `page-view-${viewId}`,
845
1175
  height: "100%",
846
1176
  testId: testId && `${testId}-table`
@@ -856,7 +1186,7 @@ function TableViewBlock({
856
1186
  children: [
857
1187
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2 border-b border-border px-4 py-2", children: [
858
1188
  /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table2, { className: "size-4 text-muted-foreground" }),
859
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-medium", "data-testid": testId && `${testId}-name`, children: view.data?.spec.name ?? "" }),
1189
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-sm font-medium", "data-testid": testId && `${testId}-name`, children: data?.view.spec.name ?? "" }),
860
1190
  actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex gap-1", children: actions })
861
1191
  ] }),
862
1192
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-h-0 flex-1", children: body })
@@ -864,6 +1194,35 @@ function TableViewBlock({
864
1194
  }
865
1195
  );
866
1196
  }
1197
+ function LiveBlockCard({
1198
+ actions,
1199
+ className,
1200
+ testId,
1201
+ children
1202
+ }) {
1203
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1204
+ ui.Card,
1205
+ {
1206
+ variant: "elevated",
1207
+ className: ui.cn(
1208
+ "@container flex h-full min-w-0 flex-col gap-1 overflow-auto rounded-xl p-4",
1209
+ className
1210
+ ),
1211
+ "data-testid": testId,
1212
+ children: [
1213
+ actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 justify-end gap-1", children: actions }),
1214
+ children
1215
+ ]
1216
+ }
1217
+ );
1218
+ }
1219
+ function WithNewFileMenu({ children }) {
1220
+ const [open, setOpen] = react$1.useState(false);
1221
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1222
+ children(() => setOpen(true)),
1223
+ /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedNewFileMenu, { open, onOpenChange: setOpen })
1224
+ ] });
1225
+ }
867
1226
  function PageBlockView({
868
1227
  block,
869
1228
  actions,
@@ -877,11 +1236,12 @@ function PageBlockView({
877
1236
  case "chart":
878
1237
  case "metric":
879
1238
  return /* @__PURE__ */ jsxRuntime.jsx(
880
- chunk4ZR4O5SP_cjs.DashboardPanel,
1239
+ chunkGK3U3FWY_cjs.DashboardPanel,
881
1240
  {
882
1241
  panel: react.panelOfBlock(block),
883
1242
  actions,
884
1243
  labels: panelLabels,
1244
+ fit: true,
885
1245
  className: ui.cn("h-full", className),
886
1246
  testId
887
1247
  }
@@ -891,11 +1251,18 @@ function PageBlockView({
891
1251
  ui.Card,
892
1252
  {
893
1253
  variant: "elevated",
894
- className: ui.cn("relative h-full overflow-auto rounded-xl p-4", className),
1254
+ className: ui.cn("flex h-full flex-col overflow-hidden rounded-xl", className),
895
1255
  "data-testid": testId,
896
1256
  children: [
897
- actions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute right-2 top-2 flex gap-1", children: actions }),
898
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm max-w-none text-foreground dark:prose-invert", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MarkdownRenderer, { children: block.config.text }) })
1257
+ /* @__PURE__ */ jsxRuntime.jsx(
1258
+ "div",
1259
+ {
1260
+ className: "flex h-9 shrink-0 items-center justify-end gap-1 px-2",
1261
+ "data-slot": "block-header",
1262
+ children: actions
1263
+ }
1264
+ ),
1265
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "prose prose-sm min-h-0 max-w-none flex-1 overflow-auto px-4 pb-4 text-foreground dark:prose-invert", children: /* @__PURE__ */ jsxRuntime.jsx(ui.MarkdownRenderer, { children: block.config.text }) })
899
1266
  ]
900
1267
  }
901
1268
  );
@@ -932,6 +1299,28 @@ function PageBlockView({
932
1299
  testId
933
1300
  }
934
1301
  ) });
1302
+ case "list":
1303
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: block.config.source === "documents" ? /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(
1304
+ chunkFEAHTNTY_cjs.ConnectedListBlock,
1305
+ {
1306
+ config: block.config,
1307
+ onCreateNew,
1308
+ testId: testId && `${testId}-list`
1309
+ }
1310
+ ) }) : /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedListBlock, { config: block.config, testId: testId && `${testId}-list` }) });
1311
+ case "carousel":
1312
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedCarouselBlock, { config: block.config, testId: testId && `${testId}-carousel` }) });
1313
+ case "agenda":
1314
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(
1315
+ chunkFEAHTNTY_cjs.ConnectedAgendaBlock,
1316
+ {
1317
+ config: block.config,
1318
+ className: "border-0 p-0",
1319
+ testId: testId && `${testId}-agenda`
1320
+ }
1321
+ ) });
1322
+ case "start":
1323
+ return /* @__PURE__ */ jsxRuntime.jsx(LiveBlockCard, { actions, className, testId, children: /* @__PURE__ */ jsxRuntime.jsx(WithNewFileMenu, { children: (onCreateNew) => /* @__PURE__ */ jsxRuntime.jsx(chunkFEAHTNTY_cjs.ConnectedStartBlock, { onCreateNew }) }) });
935
1324
  }
936
1325
  }
937
1326
  function NewPageButton({
@@ -1169,7 +1558,11 @@ var DEFAULT_PAGES_PAGE_LABELS = {
1169
1558
  text: "Text",
1170
1559
  table: "Table",
1171
1560
  document: "Document",
1172
- gallery: "Gallery"
1561
+ gallery: "Gallery",
1562
+ list: "Recent list",
1563
+ carousel: "Carousel",
1564
+ agenda: "Agenda",
1565
+ start: "Start"
1173
1566
  },
1174
1567
  editBlock: "Edit the block",
1175
1568
  removeBlock: "Remove the block",
@@ -1194,21 +1587,53 @@ var KIND_ICONS = {
1194
1587
  text: lucideReact.FileText,
1195
1588
  table: lucideReact.Table2,
1196
1589
  document: lucideReact.FileImage,
1197
- gallery: lucideReact.Images
1590
+ gallery: lucideReact.Images,
1591
+ list: lucideReact.ListOrdered,
1592
+ carousel: lucideReact.GalleryHorizontal,
1593
+ agenda: lucideReact.CalendarClock,
1594
+ start: lucideReact.Rocket
1198
1595
  };
1596
+ var ADDABLE_KINDS = [
1597
+ "chart",
1598
+ "metric",
1599
+ "text",
1600
+ "table",
1601
+ "document",
1602
+ "gallery",
1603
+ "list",
1604
+ "carousel",
1605
+ "agenda",
1606
+ "start"
1607
+ ];
1199
1608
  function newBlock(kind) {
1200
- const layout = { x: 0, y: 0, w: kind === "metric" ? 3 : 12, h: react.DEFAULT_BLOCK_HEIGHT[kind] };
1609
+ const layout = defaultLayout(kind);
1201
1610
  if (kind === "chart" || kind === "metric") {
1202
- const panel = chunkKRQCUVH7_cjs.newPanel();
1611
+ const panel = chunkYSAUOJA7_cjs.newPanel();
1203
1612
  return {
1204
1613
  ...react.blockOfPanel({ ...panel, chart: kind === "metric" ? { type: "metric" } : panel.chart }),
1205
1614
  layout
1206
1615
  };
1207
1616
  }
1208
- if (kind === "text") return { id: chunkKRQCUVH7_cjs.newPanelId(), kind, layout, config: { text: "" } };
1209
- if (kind === "document") return { id: chunkKRQCUVH7_cjs.newPanelId(), kind, layout, config: { document: "" } };
1210
- if (kind === "gallery") return { id: chunkKRQCUVH7_cjs.newPanelId(), kind, layout, config: { documents: [] } };
1211
- return { id: chunkKRQCUVH7_cjs.newPanelId(), kind, layout, config: { view: "" } };
1617
+ if (kind === "text") return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config: { text: "" } };
1618
+ if (kind === "document") return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config: { document: "" } };
1619
+ if (kind === "gallery") return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config: { documents: [] } };
1620
+ if (kind === "list") {
1621
+ const config = { source: "documents", limit: react.LIVE_BLOCK_LIMITS.listRows.default };
1622
+ return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config };
1623
+ }
1624
+ if (kind === "carousel") {
1625
+ const config = { source: "skills", limit: react.LIVE_BLOCK_LIMITS.carouselItems.default };
1626
+ return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config };
1627
+ }
1628
+ if (kind === "agenda") {
1629
+ const config = {
1630
+ days: react.LIVE_BLOCK_LIMITS.agendaDays.default,
1631
+ limit: react.LIVE_BLOCK_LIMITS.agendaEvents.default
1632
+ };
1633
+ return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config };
1634
+ }
1635
+ if (kind === "start") return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config: {} };
1636
+ return { id: chunkYSAUOJA7_cjs.newPanelId(), kind, layout, config: { view: "" } };
1212
1637
  }
1213
1638
  var errorText = (error) => error instanceof Error ? error.message : String(error);
1214
1639
  function ConnectedPagesPage({
@@ -1230,7 +1655,7 @@ function ConnectedPagesPage({
1230
1655
  const arbi = react.useArbi();
1231
1656
  const me = arbi.isLoggedIn ? arbi.user.identity()?.externalId ?? null : null;
1232
1657
  const workflowsOn = react.useFeature("workflows");
1233
- const templates = siteTemplates ?? chunkKRQCUVH7_cjs.templatesFor(chunkKRQCUVH7_cjs.DASHBOARD_TEMPLATES, { workflows: workflowsOn });
1658
+ const templates = siteTemplates ?? chunkYSAUOJA7_cjs.templatesFor(PAGE_TEMPLATES, { workflows: workflowsOn });
1234
1659
  const canEditShared = react.useCanEditShared();
1235
1660
  const isOwner = react.useIsWorkspaceOwner();
1236
1661
  const pages = react.usePages();
@@ -1272,14 +1697,26 @@ function ConnectedPagesPage({
1272
1697
  version: 1,
1273
1698
  title: chartRequest.name,
1274
1699
  panels: [
1275
- { ...chunkKRQCUVH7_cjs.newPanel(), title: l.rows, source, chart: { type: "metric" }, width: 3 },
1276
- { ...chunkKRQCUVH7_cjs.newPanel(), title: chartRequest.name, source, chart: { type: "table" }, width: 12 }
1700
+ { ...chunkYSAUOJA7_cjs.newPanel(), title: l.rows, source, chart: { type: "metric" }, width: 3 },
1701
+ { ...chunkYSAUOJA7_cjs.newPanel(), title: chartRequest.name, source, chart: { type: "table" }, width: 12 }
1277
1702
  ]
1278
1703
  });
1279
1704
  setDraft({ spec, base: spec, shared: false });
1280
1705
  }, [chartRequest]);
1281
1706
  const canEdit = (p) => p.shared ? canEditShared : p.legacy || p.createdBy === null || p.createdBy === me;
1282
1707
  const canDelete = (p) => p.shared ? isOwner : canEdit(p);
1708
+ const canArrange = (p) => canEdit(p) && !p.legacy;
1709
+ const [arranged, setArranged] = react$1.useState(null);
1710
+ const arrange = async (p, blocks) => {
1711
+ setArranged({ id: p.id, blocks });
1712
+ try {
1713
+ await save.mutateAsync({ id: p.id, spec: { ...p.spec, blocks } });
1714
+ } catch (error) {
1715
+ notify(`${l.saveFailed}: ${errorText(error)}`, "error");
1716
+ } finally {
1717
+ setArranged((a) => a?.blocks === blocks ? null : a);
1718
+ }
1719
+ };
1283
1720
  const startEditing = (p) => setDraft({ id: p.id, spec: p.spec, base: p.spec, shared: p.shared });
1284
1721
  const createBlank = () => {
1285
1722
  const spec = { version: 1, title: l.untitled, blocks: [] };
@@ -1290,7 +1727,7 @@ function ConnectedPagesPage({
1290
1727
  setCreating(true);
1291
1728
  const openWhenStarted = openIdRef.current;
1292
1729
  try {
1293
- const result = await save.mutateAsync({ spec: react.pageFromDashboard(template) });
1730
+ const result = await save.mutateAsync({ spec: pageOfTemplate(template) });
1294
1731
  if (openIdRef.current === openWhenStarted) setOpenId(result.id);
1295
1732
  notify(l.saved, "success");
1296
1733
  } catch (error) {
@@ -1400,42 +1837,41 @@ function ConnectedPagesPage({
1400
1837
  onChange: setBlocks,
1401
1838
  labels: gridLabels,
1402
1839
  testId,
1403
- renderBlock: (block, grip) => /* @__PURE__ */ jsxRuntime.jsx(
1840
+ renderBlock: (block) => /* @__PURE__ */ jsxRuntime.jsx(
1404
1841
  PageBlockView,
1405
1842
  {
1406
1843
  block,
1407
1844
  panelLabels,
1408
1845
  tableLabels,
1409
- testId: `${testId}-block-${block.id}`,
1410
- actions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1411
- grip,
1412
- /* @__PURE__ */ jsxRuntime.jsx(
1413
- ui.Button,
1414
- {
1415
- variant: "ghost",
1416
- size: "icon",
1417
- className: "size-7",
1418
- "aria-label": l.editBlock,
1419
- onClick: () => setEditing({ block, isNew: false }),
1420
- "data-testid": `${testId}-edit-block-${block.id}`,
1421
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
1422
- }
1423
- ),
1424
- /* @__PURE__ */ jsxRuntime.jsx(
1425
- ui.Button,
1426
- {
1427
- variant: "ghost",
1428
- size: "icon",
1429
- className: "size-7",
1430
- "aria-label": l.removeBlock,
1431
- onClick: () => setBlocks(compactLayout(blocks.filter((b) => b.id !== block.id))),
1432
- "data-testid": `${testId}-remove-block-${block.id}`,
1433
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-3.5" })
1434
- }
1435
- )
1436
- ] })
1846
+ testId: `${testId}-block-${block.id}`
1437
1847
  }
1438
- )
1848
+ ),
1849
+ actionsOf: (block) => /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1850
+ /* @__PURE__ */ jsxRuntime.jsx(
1851
+ ui.Button,
1852
+ {
1853
+ variant: "ghost",
1854
+ size: "icon",
1855
+ className: "size-7",
1856
+ "aria-label": l.editBlock,
1857
+ onClick: () => setEditing({ block, isNew: false }),
1858
+ "data-testid": `${testId}-edit-block-${block.id}`,
1859
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Pencil, { className: "size-3.5" })
1860
+ }
1861
+ ),
1862
+ /* @__PURE__ */ jsxRuntime.jsx(
1863
+ ui.Button,
1864
+ {
1865
+ variant: "ghost",
1866
+ size: "icon",
1867
+ className: "size-7",
1868
+ "aria-label": l.removeBlock,
1869
+ onClick: () => setBlocks(compactLayout(blocks.filter((b) => b.id !== block.id))),
1870
+ "data-testid": `${testId}-remove-block-${block.id}`,
1871
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "size-3.5" })
1872
+ }
1873
+ )
1874
+ ] })
1439
1875
  }
1440
1876
  ) : /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: l.noBlocks }),
1441
1877
  /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
@@ -1444,7 +1880,7 @@ function ConnectedPagesPage({
1444
1880
  " ",
1445
1881
  l.addBlock
1446
1882
  ] }) }),
1447
- /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", children: ["chart", "metric", "text", "table", "document", "gallery"].map((kind) => {
1883
+ /* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", children: ADDABLE_KINDS.map((kind) => {
1448
1884
  const Icon = KIND_ICONS[kind];
1449
1885
  return /* @__PURE__ */ jsxRuntime.jsxs(
1450
1886
  ui.DropdownMenuItem,
@@ -1496,15 +1932,43 @@ function ConnectedPagesPage({
1496
1932
  onShare: () => void sharePage(open),
1497
1933
  onDelete: () => void deletePage(open),
1498
1934
  testId,
1499
- children: open.spec.blocks.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(PageGrid, { testId: `${testId}-grid`, children: inReadingOrder(open.spec.blocks).map((block) => /* @__PURE__ */ jsxRuntime.jsx(PageCell, { layout: block.layout, testId: `${testId}-cell-${block.id}`, children: /* @__PURE__ */ jsxRuntime.jsx(
1500
- PageBlockView,
1935
+ children: open.spec.blocks.length > 0 && (canArrange(open) ? (
1936
+ // Who may change the page arranges it as it is read: a drop saves at once.
1937
+ /* @__PURE__ */ jsxRuntime.jsx(
1938
+ EditablePageGrid,
1939
+ {
1940
+ blocks: arranged?.id === open.id ? arranged.blocks : open.spec.blocks,
1941
+ onChange: (blocks) => void arrange(open, blocks),
1942
+ labels: gridLabels,
1943
+ testId,
1944
+ renderBlock: (block) => /* @__PURE__ */ jsxRuntime.jsx(
1945
+ PageBlockView,
1946
+ {
1947
+ block,
1948
+ panelLabels,
1949
+ tableLabels,
1950
+ testId: `${testId}-block-${block.id}`
1951
+ }
1952
+ )
1953
+ }
1954
+ )
1955
+ ) : /* @__PURE__ */ jsxRuntime.jsx(PageGrid, { testId: `${testId}-grid`, children: inReadingOrder(normalizeLayout(open.spec.blocks)).map((block) => /* @__PURE__ */ jsxRuntime.jsx(
1956
+ PageCell,
1501
1957
  {
1502
- block,
1503
- panelLabels,
1504
- tableLabels,
1505
- testId: `${testId}-block-${block.id}`
1506
- }
1507
- ) }, block.id)) })
1958
+ layout: block.layout,
1959
+ testId: `${testId}-cell-${block.id}`,
1960
+ children: /* @__PURE__ */ jsxRuntime.jsx(
1961
+ PageBlockView,
1962
+ {
1963
+ block,
1964
+ panelLabels,
1965
+ tableLabels,
1966
+ testId: `${testId}-block-${block.id}`
1967
+ }
1968
+ )
1969
+ },
1970
+ block.id
1971
+ )) }))
1508
1972
  }
1509
1973
  );
1510
1974
  } else {
@@ -1544,9 +2008,11 @@ function ConnectedPagesPage({
1544
2008
  exports.BlockEditor = BlockEditor;
1545
2009
  exports.ConnectedPagesPage = ConnectedPagesPage;
1546
2010
  exports.DEFAULT_BLOCK_EDITOR_LABELS = DEFAULT_BLOCK_EDITOR_LABELS;
2011
+ exports.DEFAULT_BLOCK_SLOTS = DEFAULT_BLOCK_SLOTS;
1547
2012
  exports.DEFAULT_DOCUMENTS_PICKER_LABELS = DEFAULT_DOCUMENTS_PICKER_LABELS;
1548
2013
  exports.DEFAULT_DOCUMENT_BLOCK_LABELS = DEFAULT_DOCUMENT_BLOCK_LABELS;
1549
2014
  exports.DEFAULT_EDITABLE_PAGE_GRID_LABELS = DEFAULT_EDITABLE_PAGE_GRID_LABELS;
2015
+ exports.DEFAULT_LIVE_BLOCK_EDITOR_LABELS = DEFAULT_LIVE_BLOCK_EDITOR_LABELS;
1550
2016
  exports.DEFAULT_PAGES_PAGE_LABELS = DEFAULT_PAGES_PAGE_LABELS;
1551
2017
  exports.DEFAULT_TABLE_VIEW_BLOCK_LABELS = DEFAULT_TABLE_VIEW_BLOCK_LABELS;
1552
2018
  exports.DEFAULT_VIEW_PICKER_LABELS = DEFAULT_VIEW_PICKER_LABELS;
@@ -1555,17 +2021,29 @@ exports.DocumentReadView = DocumentReadView;
1555
2021
  exports.DocumentsPicker = DocumentsPicker;
1556
2022
  exports.EditablePageGrid = EditablePageGrid;
1557
2023
  exports.GalleryBlockView = GalleryBlockView;
1558
- exports.MIN_BLOCK_SIZE = MIN_BLOCK_SIZE;
2024
+ exports.LiveBlockEditor = LiveBlockEditor;
2025
+ exports.MAX_BLOCK_SLOTS = MAX_BLOCK_SLOTS;
2026
+ exports.NO_DRAG = NO_DRAG;
1559
2027
  exports.PAGE_ROW_HEIGHT = PAGE_ROW_HEIGHT;
2028
+ exports.PAGE_TEMPLATES = PAGE_TEMPLATES;
1560
2029
  exports.PageBlockView = PageBlockView;
1561
2030
  exports.PageCell = PageCell;
1562
2031
  exports.PageGrid = PageGrid;
2032
+ exports.SLOTS_ACROSS = SLOTS_ACROSS;
2033
+ exports.SLOT_COLUMNS = SLOT_COLUMNS;
2034
+ exports.SLOT_ROWS = SLOT_ROWS;
1563
2035
  exports.TableViewBlock = TableViewBlock;
1564
2036
  exports.ViewPicker = ViewPicker;
1565
2037
  exports.appendBlock = appendBlock;
1566
2038
  exports.compactLayout = compactLayout;
2039
+ exports.defaultLayout = defaultLayout;
1567
2040
  exports.inReadingOrder = inReadingOrder;
1568
2041
  exports.moveBlock = moveBlock;
2042
+ exports.normalizeLayout = normalizeLayout;
2043
+ exports.pageOfTemplate = pageOfTemplate;
1569
2044
  exports.resizeBlock = resizeBlock;
2045
+ exports.snapLayout = snapLayout;
2046
+ exports.stepMove = stepMove;
2047
+ exports.stepSize = stepSize;
1570
2048
  //# sourceMappingURL=index.cjs.map
1571
2049
  //# sourceMappingURL=index.cjs.map