@arbidocs/blocks 0.5.134 → 0.5.136

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 (231) hide show
  1. package/dist/{ConnectedNativeDocxComparison-H72RQJKH.cjs → ConnectedNativeDocxComparison-W4KIGO54.cjs} +8 -8
  2. package/dist/{ConnectedNativeDocxComparison-H72RQJKH.cjs.map → ConnectedNativeDocxComparison-W4KIGO54.cjs.map} +1 -1
  3. package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs → ConnectedStreamedWordArtifact-764NSXPQ.cjs} +8 -8
  4. package/dist/{ConnectedStreamedWordArtifact-T7PZIRBY.cjs.map → ConnectedStreamedWordArtifact-764NSXPQ.cjs.map} +1 -1
  5. package/dist/{DocumentReviewCard-EM2AJUF3.cjs → DocumentReviewCard-UV3DLFCB.cjs} +3 -3
  6. package/dist/{DocumentReviewCard-EM2AJUF3.cjs.map → DocumentReviewCard-UV3DLFCB.cjs.map} +1 -1
  7. package/dist/{FilesViewerDialog-PA2B7O7I.cjs → FilesViewerDialog-IFF2JR2A.cjs} +6 -6
  8. package/dist/{FilesViewerDialog-PA2B7O7I.cjs.map → FilesViewerDialog-IFF2JR2A.cjs.map} +1 -1
  9. package/dist/{NativeDocxEditor-XZAEU5QU.cjs → NativeDocxEditor-KM6U4ZLA.cjs} +6 -6
  10. package/dist/{NativeDocxEditor-XZAEU5QU.cjs.map → NativeDocxEditor-KM6U4ZLA.cjs.map} +1 -1
  11. package/dist/{chunk-T2DUNNYY.cjs → chunk-C6DF6WB2.cjs} +745 -21
  12. package/dist/chunk-C6DF6WB2.cjs.map +1 -0
  13. package/dist/{chunk-64247UHS.cjs → chunk-DBGBAD4J.cjs} +4 -4
  14. package/dist/{chunk-64247UHS.cjs.map → chunk-DBGBAD4J.cjs.map} +1 -1
  15. package/dist/{chunk-UOZ237OW.cjs → chunk-FABKMTAI.cjs} +42 -5
  16. package/dist/chunk-FABKMTAI.cjs.map +1 -0
  17. package/dist/{chunk-L4Y6UMRC.cjs → chunk-FDRZJFNV.cjs} +5 -5
  18. package/dist/{chunk-L4Y6UMRC.cjs.map → chunk-FDRZJFNV.cjs.map} +1 -1
  19. package/dist/{chunk-O5WVYUFT.cjs → chunk-IEAZX7L6.cjs} +4 -4
  20. package/dist/{chunk-O5WVYUFT.cjs.map → chunk-IEAZX7L6.cjs.map} +1 -1
  21. package/dist/{chunk-2SWS7ESM.cjs → chunk-L62EU3TQ.cjs} +3 -3
  22. package/dist/{chunk-2SWS7ESM.cjs.map → chunk-L62EU3TQ.cjs.map} +1 -1
  23. package/dist/{chunk-IN3KXI3K.cjs → chunk-LG36LSVZ.cjs} +6 -6
  24. package/dist/{chunk-IN3KXI3K.cjs.map → chunk-LG36LSVZ.cjs.map} +1 -1
  25. package/dist/{chunk-RZSBHRQL.cjs → chunk-MMKMQZ2B.cjs} +5 -5
  26. package/dist/{chunk-RZSBHRQL.cjs.map → chunk-MMKMQZ2B.cjs.map} +1 -1
  27. package/dist/chunk-MMMGOZYH.cjs +18 -0
  28. package/dist/{chunk-KWD5Q4XH.cjs.map → chunk-MMMGOZYH.cjs.map} +1 -1
  29. package/dist/{chunk-V6SFJ44C.cjs → chunk-ZN2JXV65.cjs} +50 -13
  30. package/dist/chunk-ZN2JXV65.cjs.map +1 -0
  31. package/dist/connect/docx.cjs +12 -12
  32. package/dist/connect/index.cjs +86 -86
  33. package/dist/connect/viewer.cjs +4 -4
  34. package/dist/connection/docx/ConnectedNativeDocxEditor.js +39 -2
  35. package/dist/connection/docx/ConnectedNativeDocxEditor.js.map +2 -2
  36. package/dist/connection/viewer/ConnectedDocumentViewer.js +43 -6
  37. package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
  38. package/dist/docx/NativeDocxEditor.d.ts +12 -1
  39. package/dist/docx/NativeDocxEditor.js +513 -20
  40. package/dist/docx/NativeDocxEditor.js.map +3 -3
  41. package/dist/docx/index.cjs +38 -38
  42. package/dist/docx/recoveryStore.d.ts +8 -0
  43. package/dist/docx/recoveryStore.js +208 -0
  44. package/dist/docx/recoveryStore.js.map +7 -0
  45. package/dist/docx/temporaryRecovery.d.ts +8 -0
  46. package/dist/docx/temporaryRecovery.js +37 -0
  47. package/dist/docx/temporaryRecovery.js.map +7 -0
  48. package/dist/index.cjs +72 -72
  49. package/dist/styles.css +1 -1
  50. package/dist/vite/index.cjs +11 -1
  51. package/dist/vite/index.cjs.map +1 -1
  52. package/dist/vite/index.d.ts +13 -0
  53. package/dist/vite/index.js +11 -1
  54. package/dist/vite/index.js.map +1 -1
  55. package/dist/workflow-canvas/index.cjs +10 -10
  56. package/node_modules/@arbidocs/coedit/dist/commands.cjs +18 -1
  57. package/node_modules/@arbidocs/coedit/dist/commands.cjs.map +1 -1
  58. package/node_modules/@arbidocs/coedit/dist/commands.d.cts +2 -2
  59. package/node_modules/@arbidocs/coedit/dist/commands.d.ts +2 -2
  60. package/node_modules/@arbidocs/coedit/dist/commands.js +18 -1
  61. package/node_modules/@arbidocs/coedit/dist/commands.js.map +1 -1
  62. package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.cts → port-DXBNxZYw.d.cts} +2 -0
  63. package/node_modules/@arbidocs/coedit/dist/{port-BbN5OZHx.d.ts → port-DXBNxZYw.d.ts} +2 -0
  64. package/node_modules/@arbidocs/coedit/dist/server.cjs +16 -0
  65. package/node_modules/@arbidocs/coedit/dist/server.cjs.map +1 -1
  66. package/node_modules/@arbidocs/coedit/dist/server.d.cts +1 -1
  67. package/node_modules/@arbidocs/coedit/dist/server.d.ts +1 -1
  68. package/node_modules/@arbidocs/coedit/dist/server.js +16 -0
  69. package/node_modules/@arbidocs/coedit/dist/server.js.map +1 -1
  70. package/node_modules/@arbidocs/coedit/package.json +2 -2
  71. package/node_modules/@docx-editor.dev/core/README.md +25 -1
  72. package/node_modules/@docx-editor.dev/core/THIRD_PARTY_NOTICES.md +1 -0
  73. package/node_modules/@docx-editor.dev/core/dist/automation.cjs +1 -1
  74. package/node_modules/@docx-editor.dev/core/dist/automation.d.ts +21 -63
  75. package/node_modules/@docx-editor.dev/core/dist/automation.js +1 -1
  76. package/node_modules/@docx-editor.dev/core/dist/binding.cjs +1 -1
  77. package/node_modules/@docx-editor.dev/core/dist/binding.d.ts +49 -40
  78. package/node_modules/@docx-editor.dev/core/dist/binding.js +1 -1
  79. package/node_modules/@docx-editor.dev/core/dist/{chrome-print-CAs51cpq.d.ts → chrome-print-CrPI9ZQc.d.ts} +714 -290
  80. package/node_modules/@docx-editor.dev/core/dist/chunk-23MKR33J.js +4 -0
  81. package/node_modules/@docx-editor.dev/core/dist/chunk-2CWQY27B.cjs +1 -0
  82. package/node_modules/@docx-editor.dev/core/dist/chunk-2DEY5NUC.cjs +32 -0
  83. package/node_modules/@docx-editor.dev/core/dist/chunk-2DR4TH6B.js +1 -0
  84. package/node_modules/@docx-editor.dev/core/dist/chunk-2F2UEAE2.js +2 -0
  85. package/node_modules/@docx-editor.dev/core/dist/chunk-2GPGAFOJ.cjs +5 -0
  86. package/node_modules/@docx-editor.dev/core/dist/chunk-ALD626VU.cjs +2 -0
  87. package/node_modules/@docx-editor.dev/core/dist/chunk-AU33YWEJ.js +236 -0
  88. package/node_modules/@docx-editor.dev/core/dist/chunk-AXU63LYW.cjs +1 -0
  89. package/node_modules/@docx-editor.dev/core/dist/chunk-CM5VZRBV.js +32 -0
  90. package/node_modules/@docx-editor.dev/core/dist/chunk-D7FAFFTN.js +1 -0
  91. package/node_modules/@docx-editor.dev/core/dist/chunk-DYUVJNDD.cjs +1 -0
  92. package/node_modules/@docx-editor.dev/core/dist/chunk-ESYUKD5D.js +2 -0
  93. package/node_modules/@docx-editor.dev/core/dist/chunk-F7TGQMVR.js +5 -0
  94. package/node_modules/@docx-editor.dev/core/dist/chunk-FLW7KIQX.js +30 -0
  95. package/node_modules/@docx-editor.dev/core/dist/chunk-JG4A6W6I.js +7 -0
  96. package/node_modules/@docx-editor.dev/core/dist/chunk-JNGLSBPH.js +2 -0
  97. package/node_modules/@docx-editor.dev/core/dist/chunk-KE6ZWRIY.cjs +236 -0
  98. package/node_modules/@docx-editor.dev/core/dist/chunk-L3YXJDPX.js +1 -0
  99. package/node_modules/@docx-editor.dev/core/dist/chunk-LI42N7OW.cjs +4 -0
  100. package/node_modules/@docx-editor.dev/core/dist/chunk-PLKDS4JT.js +1 -0
  101. package/node_modules/@docx-editor.dev/core/dist/chunk-PXMTQ73F.cjs +2 -0
  102. package/node_modules/@docx-editor.dev/core/dist/chunk-R4R3AAE4.js +1 -0
  103. package/node_modules/@docx-editor.dev/core/dist/chunk-RFUNFTGV.cjs +1 -0
  104. package/node_modules/@docx-editor.dev/core/dist/chunk-SVM6PGMS.js +3 -0
  105. package/node_modules/@docx-editor.dev/core/dist/chunk-SZURLHR3.cjs +3 -0
  106. package/node_modules/@docx-editor.dev/core/dist/chunk-UYCGCVZ2.cjs +1 -0
  107. package/node_modules/@docx-editor.dev/core/dist/chunk-WN7ICTA5.js +1 -0
  108. package/node_modules/@docx-editor.dev/core/dist/chunk-X34QRAUU.cjs +1 -0
  109. package/node_modules/@docx-editor.dev/core/dist/chunk-XNBYG4XJ.cjs +30 -0
  110. package/node_modules/@docx-editor.dev/core/dist/chunk-ZDFJW5XS.cjs +2 -0
  111. package/node_modules/@docx-editor.dev/core/dist/chunk-ZWO4JHNN.cjs +7 -0
  112. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.cjs +1 -1
  113. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.d.ts +29 -5
  114. package/node_modules/@docx-editor.dev/core/dist/collaboration/replication.js +1 -1
  115. package/node_modules/@docx-editor.dev/core/dist/collaboration.cjs +1 -1
  116. package/node_modules/@docx-editor.dev/core/dist/collaboration.d.ts +5 -6
  117. package/node_modules/@docx-editor.dev/core/dist/collaboration.js +1 -1
  118. package/node_modules/@docx-editor.dev/core/dist/contracts/document.d.ts +3 -3
  119. package/node_modules/@docx-editor.dev/core/dist/contracts/editor.d.ts +13 -10
  120. package/node_modules/@docx-editor.dev/core/dist/contracts/interaction.d.ts +2 -2
  121. package/node_modules/@docx-editor.dev/core/dist/contracts/modules.d.ts +15 -13
  122. package/node_modules/@docx-editor.dev/core/dist/contracts/types.d.ts +135 -2
  123. package/node_modules/@docx-editor.dev/core/dist/{custom-node-writes-Bn6uciLb.d.ts → custom-node-writes-AqY5KpVx.d.ts} +7 -2
  124. package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-CuzhOX0g.d.ts +98 -0
  125. package/node_modules/@docx-editor.dev/core/dist/{diagnostic-hints-BeVjfNOv.d.ts → diagnostic-hints-BtCaCqQC.d.ts} +14 -7
  126. package/node_modules/@docx-editor.dev/core/dist/{document-protection-CUb55pl_.d.ts → document-protection-BvbpSXbQ.d.ts} +1 -1
  127. package/node_modules/@docx-editor.dev/core/dist/drawing-graphic-kind-CXYGYbB3.d.ts +324 -0
  128. package/node_modules/@docx-editor.dev/core/dist/drawing-preview-package-B9lSLRg4.d.ts +115 -0
  129. package/node_modules/@docx-editor.dev/core/dist/{editor-CZQZmTIU.d.ts → editor-B7OOAAie.d.ts} +536 -283
  130. package/node_modules/@docx-editor.dev/core/dist/editor-fonts-D_-vjuJi.d.ts +53 -0
  131. package/node_modules/@docx-editor.dev/core/dist/editor-scope-CA6egMaK.d.ts +141 -0
  132. package/node_modules/@docx-editor.dev/core/dist/editor.cjs +1 -1
  133. package/node_modules/@docx-editor.dev/core/dist/editor.css +6 -4
  134. package/node_modules/@docx-editor.dev/core/dist/editor.d.ts +834 -34
  135. package/node_modules/@docx-editor.dev/core/dist/editor.js +1 -1
  136. package/node_modules/@docx-editor.dev/core/dist/export.cjs +2 -2
  137. package/node_modules/@docx-editor.dev/core/dist/export.d.ts +52 -21
  138. package/node_modules/@docx-editor.dev/core/dist/export.js +2 -2
  139. package/node_modules/@docx-editor.dev/core/dist/{failure-NS2lsya4.d.ts → failure-6KGFrDO9.d.ts} +1 -1
  140. package/node_modules/@docx-editor.dev/core/dist/{font-resolver-lSBLirLR.d.ts → font-resolver-Bm9XqTNO.d.ts} +15 -1
  141. package/node_modules/@docx-editor.dev/core/dist/font-shaping-policy-BvpkrfxM.d.ts +7 -0
  142. package/node_modules/@docx-editor.dev/core/dist/index.cjs +1 -1
  143. package/node_modules/@docx-editor.dev/core/dist/index.d.ts +44 -27
  144. package/node_modules/@docx-editor.dev/core/dist/index.js +1 -1
  145. package/node_modules/@docx-editor.dev/core/dist/{layout-shaping-BD-dF_rn.d.ts → layout-shaping-Ci_BTnSU.d.ts} +3 -2
  146. package/node_modules/@docx-editor.dev/core/dist/layout.cjs +1 -1
  147. package/node_modules/@docx-editor.dev/core/dist/layout.d.ts +276 -126
  148. package/node_modules/@docx-editor.dev/core/dist/layout.js +1 -1
  149. package/node_modules/@docx-editor.dev/core/dist/metafile-drawing-DtMFyMKq.d.ts +107 -0
  150. package/node_modules/@docx-editor.dev/core/dist/{note-properties-qQUjO1GQ.d.ts → note-properties-DCIJUKIy.d.ts} +1 -1
  151. package/node_modules/@docx-editor.dev/core/dist/output.cjs +1 -1
  152. package/node_modules/@docx-editor.dev/core/dist/output.d.ts +24 -10
  153. package/node_modules/@docx-editor.dev/core/dist/output.js +1 -1
  154. package/node_modules/@docx-editor.dev/core/dist/{protocol-DYzzz2ej.d.ts → protocol-Cp_QzVxS.d.ts} +167 -5
  155. package/node_modules/@docx-editor.dev/core/dist/{review-paragraph-order-CN_0l2Cb.d.ts → review-paragraph-order-BJQ43_r0.d.ts} +1 -1
  156. package/node_modules/@docx-editor.dev/core/dist/revision-projection-OVusTS77.d.ts +258 -0
  157. package/node_modules/@docx-editor.dev/core/dist/{semantic-cell-selection-eYag3P47.d.ts → semantic-cell-selection-CoI5hHBm.d.ts} +2 -2
  158. package/node_modules/@docx-editor.dev/core/dist/{semantic-interaction-kR_QB845.d.ts → semantic-interaction-BbA4dgEo.d.ts} +1 -1
  159. package/node_modules/@docx-editor.dev/core/dist/{semantic-paint-ZayFF3tD.d.ts → semantic-paint-B5JcIv9c.d.ts} +19 -9
  160. package/node_modules/@docx-editor.dev/core/dist/{semantic-record-queries-Bsgth6lv.d.ts → semantic-record-queries-DnO8J5_j.d.ts} +1 -1
  161. package/node_modules/@docx-editor.dev/core/dist/{semantic-records-DQmumPgL.d.ts → semantic-records-DoK0lNjS.d.ts} +697 -608
  162. package/node_modules/@docx-editor.dev/core/dist/store.cjs +1 -1
  163. package/node_modules/@docx-editor.dev/core/dist/store.d.ts +527 -123
  164. package/node_modules/@docx-editor.dev/core/dist/store.js +1 -1
  165. package/node_modules/@docx-editor.dev/core/dist/{types-barrel-DuC5QBNC.d.ts → tree-op-types-Df4oY2u4.d.ts} +1723 -765
  166. package/node_modules/@docx-editor.dev/core/dist/{tree-package-store-CovjNARF.d.ts → tree-package-store-DXhX1PE-.d.ts} +617 -428
  167. package/node_modules/@docx-editor.dev/core/dist/{tree-session-contract-CZVAGl51.d.ts → tree-session-contract-CF2625mv.d.ts} +28 -13
  168. package/node_modules/@docx-editor.dev/core/dist/unsupported-elements-CUojsaCr.d.ts +23 -0
  169. package/node_modules/@docx-editor.dev/core/docs/accept-reject-without-scrolling.md +95 -0
  170. package/node_modules/@docx-editor.dev/core/docs/comment-on-found-text.md +72 -0
  171. package/node_modules/@docx-editor.dev/core/docs/custom-review-cards.md +178 -0
  172. package/node_modules/@docx-editor.dev/core/docs/highlight-ranges.md +48 -0
  173. package/node_modules/@docx-editor.dev/core/docs/index.md +36 -0
  174. package/node_modules/@docx-editor.dev/core/docs/propose-rewrite.md +247 -0
  175. package/node_modules/@docx-editor.dev/core/docs/tracked-replacement.md +68 -0
  176. package/node_modules/@docx-editor.dev/core/licenses/ECMA-376.md +29 -0
  177. package/node_modules/@docx-editor.dev/core/package.json +3 -2
  178. package/node_modules/@docx-editor.dev/react/README.md +71 -0
  179. package/node_modules/@docx-editor.dev/react/dist/index.d.mts +936 -86
  180. package/node_modules/@docx-editor.dev/react/dist/index.d.ts +936 -86
  181. package/node_modules/@docx-editor.dev/react/dist/index.js +3 -3
  182. package/node_modules/@docx-editor.dev/react/dist/index.mjs +3 -3
  183. package/node_modules/@docx-editor.dev/react/docs/accept-reject-without-scrolling.md +72 -0
  184. package/node_modules/@docx-editor.dev/react/docs/comment-on-found-text.md +47 -0
  185. package/node_modules/@docx-editor.dev/react/docs/custom-review-cards.md +105 -0
  186. package/node_modules/@docx-editor.dev/react/docs/highlight-ranges.md +25 -0
  187. package/node_modules/@docx-editor.dev/react/docs/index.md +36 -0
  188. package/node_modules/@docx-editor.dev/react/docs/propose-rewrite.md +247 -0
  189. package/node_modules/@docx-editor.dev/react/docs/tracked-replacement.md +45 -0
  190. package/node_modules/@docx-editor.dev/react/package.json +4 -3
  191. package/package.json +8 -8
  192. package/src/docx/styles.css +37 -7
  193. package/dist/chunk-KWD5Q4XH.cjs +0 -18
  194. package/dist/chunk-T2DUNNYY.cjs.map +0 -1
  195. package/dist/chunk-UOZ237OW.cjs.map +0 -1
  196. package/dist/chunk-V6SFJ44C.cjs.map +0 -1
  197. package/node_modules/@docx-editor.dev/core/dist/chunk-236O4YQW.js +0 -2
  198. package/node_modules/@docx-editor.dev/core/dist/chunk-6JIJOZDW.js +0 -1
  199. package/node_modules/@docx-editor.dev/core/dist/chunk-6JPL6ZAS.cjs +0 -5
  200. package/node_modules/@docx-editor.dev/core/dist/chunk-6ZQP4HQ7.js +0 -3
  201. package/node_modules/@docx-editor.dev/core/dist/chunk-7WQ7AAHW.cjs +0 -2
  202. package/node_modules/@docx-editor.dev/core/dist/chunk-BCXH4BXB.js +0 -5
  203. package/node_modules/@docx-editor.dev/core/dist/chunk-BTQKU64Q.cjs +0 -1
  204. package/node_modules/@docx-editor.dev/core/dist/chunk-BY2ACZZ6.cjs +0 -1
  205. package/node_modules/@docx-editor.dev/core/dist/chunk-CAJEXXVG.cjs +0 -4
  206. package/node_modules/@docx-editor.dev/core/dist/chunk-CPWLFPWC.js +0 -30
  207. package/node_modules/@docx-editor.dev/core/dist/chunk-D7ZMDMPX.cjs +0 -3
  208. package/node_modules/@docx-editor.dev/core/dist/chunk-DOHF6FA7.cjs +0 -30
  209. package/node_modules/@docx-editor.dev/core/dist/chunk-DVX32P2P.js +0 -27
  210. package/node_modules/@docx-editor.dev/core/dist/chunk-E4LOMDNL.js +0 -1
  211. package/node_modules/@docx-editor.dev/core/dist/chunk-EKLM7NWB.cjs +0 -7
  212. package/node_modules/@docx-editor.dev/core/dist/chunk-G3K63G7P.cjs +0 -27
  213. package/node_modules/@docx-editor.dev/core/dist/chunk-G4HOFIKJ.js +0 -1
  214. package/node_modules/@docx-editor.dev/core/dist/chunk-JLVBDYVQ.cjs +0 -2
  215. package/node_modules/@docx-editor.dev/core/dist/chunk-LQX36Z5P.js +0 -7
  216. package/node_modules/@docx-editor.dev/core/dist/chunk-LSZ6KPKK.js +0 -1
  217. package/node_modules/@docx-editor.dev/core/dist/chunk-MM5QBMTE.cjs +0 -1
  218. package/node_modules/@docx-editor.dev/core/dist/chunk-OMCG63ZF.js +0 -1
  219. package/node_modules/@docx-editor.dev/core/dist/chunk-OSFOJTHU.cjs +0 -18
  220. package/node_modules/@docx-editor.dev/core/dist/chunk-RCLZXP3B.js +0 -2
  221. package/node_modules/@docx-editor.dev/core/dist/chunk-T6K2QYNZ.cjs +0 -2
  222. package/node_modules/@docx-editor.dev/core/dist/chunk-TRGAVV2Y.js +0 -4
  223. package/node_modules/@docx-editor.dev/core/dist/chunk-U4JZVSOE.js +0 -2
  224. package/node_modules/@docx-editor.dev/core/dist/chunk-UHHYFIDT.cjs +0 -1
  225. package/node_modules/@docx-editor.dev/core/dist/chunk-W35WTWAO.cjs +0 -1
  226. package/node_modules/@docx-editor.dev/core/dist/chunk-YQ5G6LC7.js +0 -18
  227. package/node_modules/@docx-editor.dev/core/dist/diagnostic-context-B8M79cfK.d.ts +0 -30
  228. package/node_modules/@docx-editor.dev/core/dist/editor-scope-7o9xweiJ.d.ts +0 -84
  229. package/node_modules/@docx-editor.dev/core/dist/headless-document-view-pp3q7wIh.d.ts +0 -143
  230. package/node_modules/@docx-editor.dev/core/dist/image-resources-tXLQShoC.d.ts +0 -211
  231. package/node_modules/@docx-editor.dev/core/dist/omml-equation-BUbU0utM.d.ts +0 -85
@@ -34,7 +34,17 @@ function codeSplitting() {
34
34
  return {
35
35
  groups: [
36
36
  { name: "preload-helper", test: /vite\/preload-helper/, priority: 100 },
37
- { name: vendorChunkOf }
37
+ { name: vendorChunkOf },
38
+ // Vite's build-import lexer has a fixed WASM heap: the combined Word editor
39
+ // can exceed it. Bound its chunks without pulling lazy editor code into an
40
+ // eager vendor group or capturing its shared React/runtime dependencies.
41
+ {
42
+ name: "docx-editor",
43
+ test: /node_modules\/@docx-editor\.dev\//,
44
+ entriesAware: true,
45
+ includeDependenciesRecursively: false,
46
+ maxSize: 2e6
47
+ }
38
48
  ]
39
49
  };
40
50
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/vite/index.ts"],"names":["readdir","path","promisify","brotliCompress","gzip","readFile","constants","writeFile","require","createRequire","createReadStream"],"mappings":";;;;;;;;;;;;;;AAyBO,SAAS,cAAc,EAAA,EAA2B;AACvD,EAAA,IAAI,GAAG,QAAA,CAAS,qBAAqB,CAAA,IAAK,EAAA,CAAG,SAAS,yBAAyB,CAAA;AAC7E,IAAA,OAAO,YAAA;AACT,EAAA,IACE,GAAG,QAAA,CAAS,yBAAyB,KACrC,EAAA,CAAG,QAAA,CAAS,wCAAwC,CAAA,IACpD,EAAA,CAAG,QAAA,CAAS,oBAAoB,KAChC,EAAA,CAAG,QAAA,CAAS,8BAA8B,CAAA,IAC1C,EAAA,CAAG,SAAS,mCAAmC,CAAA;AAE/C,IAAA,OAAO,eAAA;AACT,EAAA,IAAI,GAAG,QAAA,CAAS,4BAA4B,CAAA,IAAK,EAAA,CAAG,SAAS,gCAAgC,CAAA;AAC3F,IAAA,OAAO,SAAA;AAET,EAAA,IACE,EAAA,CAAG,QAAA,CAAS,8BAA8B,CAAA,IACzC,EAAA,CAAG,SAAS,sBAAsB,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AC,CAAA,GAAI;AAAC,GAChF;AACF","file":"index.cjs","sourcesContent":["/**\n * `@arbidocs/blocks/vite`: the build settings every site built from the kits shares. Node only: a\n * site's `vite.config` imports it, never its browser code.\n *\n * In a site's `vite.config`: `plugins: [react(), ...arbiVitePlugins()]`, and the vendor groups as\n * `build.rolldownOptions.output.codeSplitting = codeSplitting()` (Vite 8) or\n * `build.rollupOptions.output.manualChunks = manualChunks` (Vite 6/7).\n *\n * The heavy kit parts (the Word editor, the PDF engine, the data grid, the calendar) are loaded on\n * demand by the kits themselves and get their own chunks without help. The vendor groups below\n * deliberately leave them out: pinning a lazily loaded library into a named chunk lets the bundler\n * park shared helpers there, and the sign-in page then downloads the whole library.\n */\nimport { createReadStream } from 'node:fs'\nimport { readdir, readFile, writeFile } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { brotliCompress, constants, gzip } from 'node:zlib'\nimport type { Plugin } from 'vite'\n\n/**\n * The vendor chunk a module belongs to, or null (left to the bundler): libraries every page loads\n * and that rarely change, so they stay cached across a site's deploys.\n */\nexport function vendorChunkOf(id: string): string | null {\n if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/'))\n return 'react-core'\n if (\n id.includes('node_modules/@radix-ui/') ||\n id.includes('node_modules/class-variance-authority/') ||\n id.includes('node_modules/clsx/') ||\n id.includes('node_modules/tailwind-merge/') ||\n id.includes('node_modules/tailwindcss-animate/')\n )\n return 'ui-components'\n if (id.includes('node_modules/react-router/') || id.includes('node_modules/react-router-dom/'))\n return 'routing'\n // KaTeX (rehype-katex / remark-math) is loaded on demand when content has math: left out.\n if (\n id.includes('node_modules/react-markdown/') ||\n (id.includes('node_modules/rehype-') && !id.includes('node_modules/rehype-katex/')) ||\n (id.includes('node_modules/remark-') && !id.includes('node_modules/remark-math/')) ||\n id.includes('node_modules/shiki/')\n )\n return 'markdown'\n if (\n id.includes('node_modules/zustand/') ||\n id.includes('node_modules/immer/') ||\n id.includes('node_modules/remeda/') ||\n id.includes('node_modules/@tanstack/react-query/')\n )\n return 'state-utils'\n if (id.includes('node_modules/framer-motion/') || id.includes('node_modules/sonner/'))\n return 'animation'\n if (\n id.includes('node_modules/@auth0/') ||\n id.includes('node_modules/axios/') ||\n id.includes('node_modules/js-cookie/')\n )\n return 'auth-api'\n // The end-to-end encryption library: needed at sign-in, large, and it never changes.\n if (id.includes('node_modules/libsodium')) return 'sodium'\n return null\n}\n\n/**\n * Rolldown's (Vite 8) `build.rolldownOptions.output.codeSplitting`. Vite's dynamic-import preload\n * helper gets its own chunk: left unpinned, the bundler parks it in a chunk that also imports\n * lazily, and the entry then preloads that whole chunk before the page renders.\n */\nexport function codeSplitting() {\n return {\n groups: [\n { name: 'preload-helper', test: /vite\\/preload-helper/, priority: 100 },\n { name: vendorChunkOf },\n ],\n }\n}\n\n/** Rollup's (Vite 6/7) `build.rollupOptions.output.manualChunks`, with the same vendor groups. */\nexport function manualChunks(id: string): string | undefined {\n return vendorChunkOf(id) ?? undefined\n}\n\nconst COMPRESSIBLE = /\\.(?:m?js|css|html|json|svg|wasm|txt|xml|webmanifest|ttf|otf)$/\n\n/**\n * Files a deployment rewrites after `vite build` (a compressed copy would serve the stale bytes):\n * the service worker (stamped with the build), the runtime config and web manifests (rendered when\n * the container starts), and `index.html` (tiny, and never cached).\n */\nexport const PRECOMPRESS_EXCLUDE: readonly string[] = [\n 'sw.js',\n 'config.json',\n '*.webmanifest',\n 'asset-manifest.json',\n 'index.html',\n]\n\nexport interface PrecompressOptions {\n /** Smallest file compressed, in bytes. Default 1024. */\n minSize?: number\n /**\n * File names (or `*` patterns, matched against the file name) never compressed: anything the\n * deployment changes after the build. Default `PRECOMPRESS_EXCLUDE`; pass your own list to\n * replace it (`[...PRECOMPRESS_EXCLUDE, 'extra.json']` to extend it).\n */\n exclude?: readonly string[]\n}\n\nasync function filesUnder(dir: string): Promise<string[]> {\n const entries = await readdir(dir, { withFileTypes: true, recursive: true })\n return entries.filter((e) => e.isFile()).map((e) => path.join(e.parentPath, e.name))\n}\n\nconst toPattern = (glob: string) =>\n new RegExp(`^${glob.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')}$`)\n\n/** Runs `task` over `items`, `limit` at a time. */\nasync function eachLimited<T>(\n items: readonly T[],\n limit: number,\n task: (item: T) => Promise<void>\n) {\n let next = 0\n const worker = async () => {\n while (next < items.length) await task(items[next++])\n }\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker))\n}\n\n/**\n * Writes `<file>.br` (brotli, quality 11) and `<file>.gz` (gzip, level 9) beside every compressible\n * file of the build, including those copied from `public/`, so the web server sends them as they\n * are (nginx `gzip_static` / `brotli_static`): the smallest transfer, at no cost per request. Files\n * the deployment rewrites later are left out (`exclude`).\n */\nexport function precompress({\n minSize = 1024,\n exclude = PRECOMPRESS_EXCLUDE,\n}: PrecompressOptions = {}): Plugin {\n const br = promisify(brotliCompress)\n const gz = promisify(gzip)\n const excluded = exclude.map(toPattern)\n let outDir = ''\n return {\n name: 'arbi-precompress',\n apply: 'build',\n enforce: 'post',\n configResolved(config) {\n outDir = path.resolve(config.root, config.build.outDir)\n },\n async closeBundle() {\n const files = (await filesUnder(outDir)).filter(\n (f) => COMPRESSIBLE.test(f) && !excluded.some((p) => p.test(path.basename(f)))\n )\n // Brotli at quality 11 is CPU-heavy: a few files at a time.\n await eachLimited(files, 6, async (file) => {\n const data = await readFile(file)\n if (data.length < minSize) return\n const [brotli, gzipped] = await Promise.all([\n br(data, {\n params: {\n [constants.BROTLI_PARAM_QUALITY]: 11,\n [constants.BROTLI_PARAM_SIZE_HINT]: data.length,\n },\n }),\n gz(data, { level: 9 }),\n ])\n await Promise.all([writeFile(`${file}.br`, brotli), writeFile(`${file}.gz`, gzipped)])\n })\n },\n }\n}\n\n/**\n * The Word editor's text shaping loads `harfbuzz.wasm` with `new URL('harfbuzz.wasm',\n * import.meta.url)`. A build emits that asset, but the dev server's pre-bundle moves the editor into\n * `.vite/deps`, where the URL has no file and the SPA fallback answers with HTML (\"HarfBuzz shaping\n * failed\"). Serves the installed package's binary at that address. Dev server only.\n */\nexport function serveHarfBuzzWasm(): Plugin {\n return {\n name: 'arbi-harfbuzz-wasm',\n apply: 'serve',\n configureServer(server) {\n let wasm: string\n try {\n const require = createRequire(path.join(server.config.root, 'package.json'))\n wasm = path.join(path.dirname(require.resolve('@docx-editor.dev/core')), 'harfbuzz.wasm')\n } catch {\n return // The site does not use the Word editor.\n }\n server.middlewares.use((req, res, next) => {\n if (!req.url?.split('?')[0].endsWith('/.vite/deps/harfbuzz.wasm')) return next()\n res.setHeader('Content-Type', 'application/wasm')\n createReadStream(wasm).pipe(res)\n })\n },\n }\n}\n\nexport interface ArbiVitePluginsOptions {\n /** Precompress the build (`.br` and `.gz`). Default on. */\n precompress?: boolean | PrecompressOptions\n}\n\n/** The plugins every kit-built site uses: precompression and the Word editor's wasm in dev. */\nexport function arbiVitePlugins({\n precompress: compress = true,\n}: ArbiVitePluginsOptions = {}): Plugin[] {\n return [\n serveHarfBuzzWasm(),\n ...(compress ? [precompress(typeof compress === 'object' ? compress : {})] : []),\n ]\n}\n"]}
1
+ {"version":3,"sources":["../../src/vite/index.ts"],"names":["readdir","path","promisify","brotliCompress","gzip","readFile","constants","writeFile","require","createRequire","createReadStream"],"mappings":";;;;;;;;;;;;;;AAyBO,SAAS,cAAc,EAAA,EAA2B;AACvD,EAAA,IAAI,GAAG,QAAA,CAAS,qBAAqB,CAAA,IAAK,EAAA,CAAG,SAAS,yBAAyB,CAAA;AAC7E,IAAA,OAAO,YAAA;AACT,EAAA,IACE,GAAG,QAAA,CAAS,yBAAyB,KACrC,EAAA,CAAG,QAAA,CAAS,wCAAwC,CAAA,IACpD,EAAA,CAAG,QAAA,CAAS,oBAAoB,KAChC,EAAA,CAAG,QAAA,CAAS,8BAA8B,CAAA,IAC1C,EAAA,CAAG,SAAS,mCAAmC,CAAA;AAE/C,IAAA,OAAO,eAAA;AACT,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AU,gBAAgB,kBAAkB,CAAA;AAChD,QAAAE,mBAAA,CAAiB,IAAI,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,MACjC,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;AAQO,SAAS,eAAA,CAAgB;AAAA,EAC9B,aAAa,QAAA,GAAW;AAC1B,CAAA,GAA4B,EAAC,EAAa;AACxC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAkB;AAAA,IAClB,GAAI,QAAA,GAAW,CAAC,WAAA,CAAY,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,EAAE,CAAC,CAAA,GAAI;AAAC,GAChF;AACF","file":"index.cjs","sourcesContent":["/**\n * `@arbidocs/blocks/vite`: the build settings every site built from the kits shares. Node only: a\n * site's `vite.config` imports it, never its browser code.\n *\n * In a site's `vite.config`: `plugins: [react(), ...arbiVitePlugins()]`, and the vendor groups as\n * `build.rolldownOptions.output.codeSplitting = codeSplitting()` (Vite 8) or\n * `build.rollupOptions.output.manualChunks = manualChunks` (Vite 6/7).\n *\n * The heavy kit parts (the Word editor, the PDF engine, the data grid, the calendar) are loaded on\n * demand by the kits themselves. Eager vendor groups leave them out: mixing shared helpers into\n * a lazy library chunk would make sign-in download the whole library. The Word editor has its\n * own size-bounded, entry-aware group that does not capture its shared dependencies.\n */\nimport { createReadStream } from 'node:fs'\nimport { readdir, readFile, writeFile } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { brotliCompress, constants, gzip } from 'node:zlib'\nimport type { Plugin } from 'vite'\n\n/**\n * The vendor chunk a module belongs to, or null (left to the bundler): libraries every page loads\n * and that rarely change, so they stay cached across a site's deploys.\n */\nexport function vendorChunkOf(id: string): string | null {\n if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/'))\n return 'react-core'\n if (\n id.includes('node_modules/@radix-ui/') ||\n id.includes('node_modules/class-variance-authority/') ||\n id.includes('node_modules/clsx/') ||\n id.includes('node_modules/tailwind-merge/') ||\n id.includes('node_modules/tailwindcss-animate/')\n )\n return 'ui-components'\n if (id.includes('node_modules/react-router/') || id.includes('node_modules/react-router-dom/'))\n return 'routing'\n // KaTeX (rehype-katex / remark-math) is loaded on demand when content has math: left out.\n if (\n id.includes('node_modules/react-markdown/') ||\n (id.includes('node_modules/rehype-') && !id.includes('node_modules/rehype-katex/')) ||\n (id.includes('node_modules/remark-') && !id.includes('node_modules/remark-math/')) ||\n id.includes('node_modules/shiki/')\n )\n return 'markdown'\n if (\n id.includes('node_modules/zustand/') ||\n id.includes('node_modules/immer/') ||\n id.includes('node_modules/remeda/') ||\n id.includes('node_modules/@tanstack/react-query/')\n )\n return 'state-utils'\n if (id.includes('node_modules/framer-motion/') || id.includes('node_modules/sonner/'))\n return 'animation'\n if (\n id.includes('node_modules/@auth0/') ||\n id.includes('node_modules/axios/') ||\n id.includes('node_modules/js-cookie/')\n )\n return 'auth-api'\n // The end-to-end encryption library: needed at sign-in, large, and it never changes.\n if (id.includes('node_modules/libsodium')) return 'sodium'\n return null\n}\n\n/**\n * Rolldown's (Vite 8) `build.rolldownOptions.output.codeSplitting`. Vite's dynamic-import preload\n * helper gets its own chunk: left unpinned, the bundler parks it in a chunk that also imports\n * lazily, and the entry then preloads that whole chunk before the page renders.\n */\nexport function codeSplitting() {\n return {\n groups: [\n { name: 'preload-helper', test: /vite\\/preload-helper/, priority: 100 },\n { name: vendorChunkOf },\n // Vite's build-import lexer has a fixed WASM heap: the combined Word editor\n // can exceed it. Bound its chunks without pulling lazy editor code into an\n // eager vendor group or capturing its shared React/runtime dependencies.\n {\n name: 'docx-editor',\n test: /node_modules\\/@docx-editor\\.dev\\//,\n entriesAware: true,\n includeDependenciesRecursively: false,\n maxSize: 2_000_000,\n },\n ],\n }\n}\n\n/** Rollup's (Vite 6/7) `build.rollupOptions.output.manualChunks`, with the same vendor groups. */\nexport function manualChunks(id: string): string | undefined {\n return vendorChunkOf(id) ?? undefined\n}\n\nconst COMPRESSIBLE = /\\.(?:m?js|css|html|json|svg|wasm|txt|xml|webmanifest|ttf|otf)$/\n\n/**\n * Files a deployment rewrites after `vite build` (a compressed copy would serve the stale bytes):\n * the service worker (stamped with the build), the runtime config and web manifests (rendered when\n * the container starts), and `index.html` (tiny, and never cached).\n */\nexport const PRECOMPRESS_EXCLUDE: readonly string[] = [\n 'sw.js',\n 'config.json',\n '*.webmanifest',\n 'asset-manifest.json',\n 'index.html',\n]\n\nexport interface PrecompressOptions {\n /** Smallest file compressed, in bytes. Default 1024. */\n minSize?: number\n /**\n * File names (or `*` patterns, matched against the file name) never compressed: anything the\n * deployment changes after the build. Default `PRECOMPRESS_EXCLUDE`; pass your own list to\n * replace it (`[...PRECOMPRESS_EXCLUDE, 'extra.json']` to extend it).\n */\n exclude?: readonly string[]\n}\n\nasync function filesUnder(dir: string): Promise<string[]> {\n const entries = await readdir(dir, { withFileTypes: true, recursive: true })\n return entries.filter((e) => e.isFile()).map((e) => path.join(e.parentPath, e.name))\n}\n\nconst toPattern = (glob: string) =>\n new RegExp(`^${glob.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')}$`)\n\n/** Runs `task` over `items`, `limit` at a time. */\nasync function eachLimited<T>(\n items: readonly T[],\n limit: number,\n task: (item: T) => Promise<void>\n) {\n let next = 0\n const worker = async () => {\n while (next < items.length) await task(items[next++])\n }\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker))\n}\n\n/**\n * Writes `<file>.br` (brotli, quality 11) and `<file>.gz` (gzip, level 9) beside every compressible\n * file of the build, including those copied from `public/`, so the web server sends them as they\n * are (nginx `gzip_static` / `brotli_static`): the smallest transfer, at no cost per request. Files\n * the deployment rewrites later are left out (`exclude`).\n */\nexport function precompress({\n minSize = 1024,\n exclude = PRECOMPRESS_EXCLUDE,\n}: PrecompressOptions = {}): Plugin {\n const br = promisify(brotliCompress)\n const gz = promisify(gzip)\n const excluded = exclude.map(toPattern)\n let outDir = ''\n return {\n name: 'arbi-precompress',\n apply: 'build',\n enforce: 'post',\n configResolved(config) {\n outDir = path.resolve(config.root, config.build.outDir)\n },\n async closeBundle() {\n const files = (await filesUnder(outDir)).filter(\n (f) => COMPRESSIBLE.test(f) && !excluded.some((p) => p.test(path.basename(f)))\n )\n // Brotli at quality 11 is CPU-heavy: a few files at a time.\n await eachLimited(files, 6, async (file) => {\n const data = await readFile(file)\n if (data.length < minSize) return\n const [brotli, gzipped] = await Promise.all([\n br(data, {\n params: {\n [constants.BROTLI_PARAM_QUALITY]: 11,\n [constants.BROTLI_PARAM_SIZE_HINT]: data.length,\n },\n }),\n gz(data, { level: 9 }),\n ])\n await Promise.all([writeFile(`${file}.br`, brotli), writeFile(`${file}.gz`, gzipped)])\n })\n },\n }\n}\n\n/**\n * The Word editor's text shaping loads `harfbuzz.wasm` with `new URL('harfbuzz.wasm',\n * import.meta.url)`. A build emits that asset, but the dev server's pre-bundle moves the editor into\n * `.vite/deps`, where the URL has no file and the SPA fallback answers with HTML (\"HarfBuzz shaping\n * failed\"). Serves the installed package's binary at that address. Dev server only.\n */\nexport function serveHarfBuzzWasm(): Plugin {\n return {\n name: 'arbi-harfbuzz-wasm',\n apply: 'serve',\n configureServer(server) {\n let wasm: string\n try {\n const require = createRequire(path.join(server.config.root, 'package.json'))\n wasm = path.join(path.dirname(require.resolve('@docx-editor.dev/core')), 'harfbuzz.wasm')\n } catch {\n return // The site does not use the Word editor.\n }\n server.middlewares.use((req, res, next) => {\n if (!req.url?.split('?')[0].endsWith('/.vite/deps/harfbuzz.wasm')) return next()\n res.setHeader('Content-Type', 'application/wasm')\n createReadStream(wasm).pipe(res)\n })\n },\n }\n}\n\nexport interface ArbiVitePluginsOptions {\n /** Precompress the build (`.br` and `.gz`). Default on. */\n precompress?: boolean | PrecompressOptions\n}\n\n/** The plugins every kit-built site uses: precompression and the Word editor's wasm in dev. */\nexport function arbiVitePlugins({\n precompress: compress = true,\n}: ArbiVitePluginsOptions = {}): Plugin[] {\n return [\n serveHarfBuzzWasm(),\n ...(compress ? [precompress(typeof compress === 'object' ? compress : {})] : []),\n ]\n}\n"]}
@@ -14,10 +14,23 @@ export declare function codeSplitting(): {
14
14
  name: string;
15
15
  test: RegExp;
16
16
  priority: number;
17
+ entriesAware?: undefined;
18
+ includeDependenciesRecursively?: undefined;
19
+ maxSize?: undefined;
17
20
  } | {
18
21
  name: typeof vendorChunkOf;
19
22
  test?: undefined;
20
23
  priority?: undefined;
24
+ entriesAware?: undefined;
25
+ includeDependenciesRecursively?: undefined;
26
+ maxSize?: undefined;
27
+ } | {
28
+ name: string;
29
+ test: RegExp;
30
+ entriesAware: boolean;
31
+ includeDependenciesRecursively: boolean;
32
+ maxSize: number;
33
+ priority?: undefined;
21
34
  })[];
22
35
  };
23
36
  /** Rollup's (Vite 6/7) `build.rollupOptions.output.manualChunks`, with the same vendor groups. */
@@ -28,7 +28,17 @@ function codeSplitting() {
28
28
  return {
29
29
  groups: [
30
30
  { name: "preload-helper", test: /vite\/preload-helper/, priority: 100 },
31
- { name: vendorChunkOf }
31
+ { name: vendorChunkOf },
32
+ // Vite's build-import lexer has a fixed WASM heap: the combined Word editor
33
+ // can exceed it. Bound its chunks without pulling lazy editor code into an
34
+ // eager vendor group or capturing its shared React/runtime dependencies.
35
+ {
36
+ name: "docx-editor",
37
+ test: /node_modules\/@docx-editor\.dev\//,
38
+ entriesAware: true,
39
+ includeDependenciesRecursively: false,
40
+ maxSize: 2e6
41
+ }
32
42
  ]
33
43
  };
34
44
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/vite/index.ts"],"names":["require"],"mappings":";;;;;;;;AAyBO,SAAS,cAAc,EAAA,EAA2B;AACvD,EAAA,IAAI,GAAG,QAAA,CAAS,qBAAqB,CAAA,IAAK,EAAA,CAAG,SAAS,yBAAyB,CAAA;AAC7E,IAAA,OAAO,YAAA;AACT,EAAA,IACE,GAAG,QAAA,CAAS,yBAAyB,KACrC,EAAA,CAAG,QAAA,CAAS,wCA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iB,IAAI,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,MACjC,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;AAQO,SAAS,eAAA,CAAgB;AAAA,EAC9B,aAAa,QAAA,GAAW;AAC1B,CAAA,GAA4B,EAAC,EAAa;AACxC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAkB;AAAA,IAClB,GAAI,QAAA,GAAW,CAAC,WAAA,CAAY,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,EAAE,CAAC,CAAA,GAAI;AAAC,GAChF;AACF","file":"index.js","sourcesContent":["/**\n * `@arbidocs/blocks/vite`: the build settings every site built from the kits shares. Node only: a\n * site's `vite.config` imports it, never its browser code.\n *\n * In a site's `vite.config`: `plugins: [react(), ...arbiVitePlugins()]`, and the vendor groups as\n * `build.rolldownOptions.output.codeSplitting = codeSplitting()` (Vite 8) or\n * `build.rollupOptions.output.manualChunks = manualChunks` (Vite 6/7).\n *\n * The heavy kit parts (the Word editor, the PDF engine, the data grid, the calendar) are loaded on\n * demand by the kits themselves and get their own chunks without help. The vendor groups below\n * deliberately leave them out: pinning a lazily loaded library into a named chunk lets the bundler\n * park shared helpers there, and the sign-in page then downloads the whole library.\n */\nimport { createReadStream } from 'node:fs'\nimport { readdir, readFile, writeFile } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { brotliCompress, constants, gzip } from 'node:zlib'\nimport type { Plugin } from 'vite'\n\n/**\n * The vendor chunk a module belongs to, or null (left to the bundler): libraries every page loads\n * and that rarely change, so they stay cached across a site's deploys.\n */\nexport function vendorChunkOf(id: string): string | null {\n if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/'))\n return 'react-core'\n if (\n id.includes('node_modules/@radix-ui/') ||\n id.includes('node_modules/class-variance-authority/') ||\n id.includes('node_modules/clsx/') ||\n id.includes('node_modules/tailwind-merge/') ||\n id.includes('node_modules/tailwindcss-animate/')\n )\n return 'ui-components'\n if (id.includes('node_modules/react-router/') || id.includes('node_modules/react-router-dom/'))\n return 'routing'\n // KaTeX (rehype-katex / remark-math) is loaded on demand when content has math: left out.\n if (\n id.includes('node_modules/react-markdown/') ||\n (id.includes('node_modules/rehype-') && !id.includes('node_modules/rehype-katex/')) ||\n (id.includes('node_modules/remark-') && !id.includes('node_modules/remark-math/')) ||\n id.includes('node_modules/shiki/')\n )\n return 'markdown'\n if (\n id.includes('node_modules/zustand/') ||\n id.includes('node_modules/immer/') ||\n id.includes('node_modules/remeda/') ||\n id.includes('node_modules/@tanstack/react-query/')\n )\n return 'state-utils'\n if (id.includes('node_modules/framer-motion/') || id.includes('node_modules/sonner/'))\n return 'animation'\n if (\n id.includes('node_modules/@auth0/') ||\n id.includes('node_modules/axios/') ||\n id.includes('node_modules/js-cookie/')\n )\n return 'auth-api'\n // The end-to-end encryption library: needed at sign-in, large, and it never changes.\n if (id.includes('node_modules/libsodium')) return 'sodium'\n return null\n}\n\n/**\n * Rolldown's (Vite 8) `build.rolldownOptions.output.codeSplitting`. Vite's dynamic-import preload\n * helper gets its own chunk: left unpinned, the bundler parks it in a chunk that also imports\n * lazily, and the entry then preloads that whole chunk before the page renders.\n */\nexport function codeSplitting() {\n return {\n groups: [\n { name: 'preload-helper', test: /vite\\/preload-helper/, priority: 100 },\n { name: vendorChunkOf },\n ],\n }\n}\n\n/** Rollup's (Vite 6/7) `build.rollupOptions.output.manualChunks`, with the same vendor groups. */\nexport function manualChunks(id: string): string | undefined {\n return vendorChunkOf(id) ?? undefined\n}\n\nconst COMPRESSIBLE = /\\.(?:m?js|css|html|json|svg|wasm|txt|xml|webmanifest|ttf|otf)$/\n\n/**\n * Files a deployment rewrites after `vite build` (a compressed copy would serve the stale bytes):\n * the service worker (stamped with the build), the runtime config and web manifests (rendered when\n * the container starts), and `index.html` (tiny, and never cached).\n */\nexport const PRECOMPRESS_EXCLUDE: readonly string[] = [\n 'sw.js',\n 'config.json',\n '*.webmanifest',\n 'asset-manifest.json',\n 'index.html',\n]\n\nexport interface PrecompressOptions {\n /** Smallest file compressed, in bytes. Default 1024. */\n minSize?: number\n /**\n * File names (or `*` patterns, matched against the file name) never compressed: anything the\n * deployment changes after the build. Default `PRECOMPRESS_EXCLUDE`; pass your own list to\n * replace it (`[...PRECOMPRESS_EXCLUDE, 'extra.json']` to extend it).\n */\n exclude?: readonly string[]\n}\n\nasync function filesUnder(dir: string): Promise<string[]> {\n const entries = await readdir(dir, { withFileTypes: true, recursive: true })\n return entries.filter((e) => e.isFile()).map((e) => path.join(e.parentPath, e.name))\n}\n\nconst toPattern = (glob: string) =>\n new RegExp(`^${glob.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')}$`)\n\n/** Runs `task` over `items`, `limit` at a time. */\nasync function eachLimited<T>(\n items: readonly T[],\n limit: number,\n task: (item: T) => Promise<void>\n) {\n let next = 0\n const worker = async () => {\n while (next < items.length) await task(items[next++])\n }\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker))\n}\n\n/**\n * Writes `<file>.br` (brotli, quality 11) and `<file>.gz` (gzip, level 9) beside every compressible\n * file of the build, including those copied from `public/`, so the web server sends them as they\n * are (nginx `gzip_static` / `brotli_static`): the smallest transfer, at no cost per request. Files\n * the deployment rewrites later are left out (`exclude`).\n */\nexport function precompress({\n minSize = 1024,\n exclude = PRECOMPRESS_EXCLUDE,\n}: PrecompressOptions = {}): Plugin {\n const br = promisify(brotliCompress)\n const gz = promisify(gzip)\n const excluded = exclude.map(toPattern)\n let outDir = ''\n return {\n name: 'arbi-precompress',\n apply: 'build',\n enforce: 'post',\n configResolved(config) {\n outDir = path.resolve(config.root, config.build.outDir)\n },\n async closeBundle() {\n const files = (await filesUnder(outDir)).filter(\n (f) => COMPRESSIBLE.test(f) && !excluded.some((p) => p.test(path.basename(f)))\n )\n // Brotli at quality 11 is CPU-heavy: a few files at a time.\n await eachLimited(files, 6, async (file) => {\n const data = await readFile(file)\n if (data.length < minSize) return\n const [brotli, gzipped] = await Promise.all([\n br(data, {\n params: {\n [constants.BROTLI_PARAM_QUALITY]: 11,\n [constants.BROTLI_PARAM_SIZE_HINT]: data.length,\n },\n }),\n gz(data, { level: 9 }),\n ])\n await Promise.all([writeFile(`${file}.br`, brotli), writeFile(`${file}.gz`, gzipped)])\n })\n },\n }\n}\n\n/**\n * The Word editor's text shaping loads `harfbuzz.wasm` with `new URL('harfbuzz.wasm',\n * import.meta.url)`. A build emits that asset, but the dev server's pre-bundle moves the editor into\n * `.vite/deps`, where the URL has no file and the SPA fallback answers with HTML (\"HarfBuzz shaping\n * failed\"). Serves the installed package's binary at that address. Dev server only.\n */\nexport function serveHarfBuzzWasm(): Plugin {\n return {\n name: 'arbi-harfbuzz-wasm',\n apply: 'serve',\n configureServer(server) {\n let wasm: string\n try {\n const require = createRequire(path.join(server.config.root, 'package.json'))\n wasm = path.join(path.dirname(require.resolve('@docx-editor.dev/core')), 'harfbuzz.wasm')\n } catch {\n return // The site does not use the Word editor.\n }\n server.middlewares.use((req, res, next) => {\n if (!req.url?.split('?')[0].endsWith('/.vite/deps/harfbuzz.wasm')) return next()\n res.setHeader('Content-Type', 'application/wasm')\n createReadStream(wasm).pipe(res)\n })\n },\n }\n}\n\nexport interface ArbiVitePluginsOptions {\n /** Precompress the build (`.br` and `.gz`). Default on. */\n precompress?: boolean | PrecompressOptions\n}\n\n/** The plugins every kit-built site uses: precompression and the Word editor's wasm in dev. */\nexport function arbiVitePlugins({\n precompress: compress = true,\n}: ArbiVitePluginsOptions = {}): Plugin[] {\n return [\n serveHarfBuzzWasm(),\n ...(compress ? [precompress(typeof compress === 'object' ? compress : {})] : []),\n ]\n}\n"]}
1
+ {"version":3,"sources":["../../src/vite/index.ts"],"names":["require"],"mappings":";;;;;;;;AAyBO,SAAS,cAAc,EAAA,EAA2B;AACvD,EAAA,IAAI,GAAG,QAAA,CAAS,qBAAqB,CAAA,IAAK,EAAA,CAAG,SAAS,yBAAyB,CAAA;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CAAY,GAAA,CAAI,CAAC,GAAA,EAAK,KAAK,IAAA,KAAS;AACzC,QAAA,IAAI,CAAC,GAAA,CAAI,GAAA,EAAK,KAAA,CAAM,GAAG,CAAA,CAAE,CAAC,CAAA,CAAE,QAAA,CAAS,2BAA2B,CAAA,EAAG,OAAO,IAAA,EAAK;AAC/E,QAAA,GAAA,CAAI,SAAA,CAAU,gBAAgB,kBAAkB,CAAA;AAChD,QAAA,gBAAA,CAAiB,IAAI,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,MACjC,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF;AAQO,SAAS,eAAA,CAAgB;AAAA,EAC9B,aAAa,QAAA,GAAW;AAC1B,CAAA,GAA4B,EAAC,EAAa;AACxC,EAAA,OAAO;AAAA,IACL,iBAAA,EAAkB;AAAA,IAClB,GAAI,QAAA,GAAW,CAAC,WAAA,CAAY,OAAO,QAAA,KAAa,QAAA,GAAW,QAAA,GAAW,EAAE,CAAC,CAAA,GAAI;AAAC,GAChF;AACF","file":"index.js","sourcesContent":["/**\n * `@arbidocs/blocks/vite`: the build settings every site built from the kits shares. Node only: a\n * site's `vite.config` imports it, never its browser code.\n *\n * In a site's `vite.config`: `plugins: [react(), ...arbiVitePlugins()]`, and the vendor groups as\n * `build.rolldownOptions.output.codeSplitting = codeSplitting()` (Vite 8) or\n * `build.rollupOptions.output.manualChunks = manualChunks` (Vite 6/7).\n *\n * The heavy kit parts (the Word editor, the PDF engine, the data grid, the calendar) are loaded on\n * demand by the kits themselves. Eager vendor groups leave them out: mixing shared helpers into\n * a lazy library chunk would make sign-in download the whole library. The Word editor has its\n * own size-bounded, entry-aware group that does not capture its shared dependencies.\n */\nimport { createReadStream } from 'node:fs'\nimport { readdir, readFile, writeFile } from 'node:fs/promises'\nimport { createRequire } from 'node:module'\nimport path from 'node:path'\nimport { promisify } from 'node:util'\nimport { brotliCompress, constants, gzip } from 'node:zlib'\nimport type { Plugin } from 'vite'\n\n/**\n * The vendor chunk a module belongs to, or null (left to the bundler): libraries every page loads\n * and that rarely change, so they stay cached across a site's deploys.\n */\nexport function vendorChunkOf(id: string): string | null {\n if (id.includes('node_modules/react/') || id.includes('node_modules/react-dom/'))\n return 'react-core'\n if (\n id.includes('node_modules/@radix-ui/') ||\n id.includes('node_modules/class-variance-authority/') ||\n id.includes('node_modules/clsx/') ||\n id.includes('node_modules/tailwind-merge/') ||\n id.includes('node_modules/tailwindcss-animate/')\n )\n return 'ui-components'\n if (id.includes('node_modules/react-router/') || id.includes('node_modules/react-router-dom/'))\n return 'routing'\n // KaTeX (rehype-katex / remark-math) is loaded on demand when content has math: left out.\n if (\n id.includes('node_modules/react-markdown/') ||\n (id.includes('node_modules/rehype-') && !id.includes('node_modules/rehype-katex/')) ||\n (id.includes('node_modules/remark-') && !id.includes('node_modules/remark-math/')) ||\n id.includes('node_modules/shiki/')\n )\n return 'markdown'\n if (\n id.includes('node_modules/zustand/') ||\n id.includes('node_modules/immer/') ||\n id.includes('node_modules/remeda/') ||\n id.includes('node_modules/@tanstack/react-query/')\n )\n return 'state-utils'\n if (id.includes('node_modules/framer-motion/') || id.includes('node_modules/sonner/'))\n return 'animation'\n if (\n id.includes('node_modules/@auth0/') ||\n id.includes('node_modules/axios/') ||\n id.includes('node_modules/js-cookie/')\n )\n return 'auth-api'\n // The end-to-end encryption library: needed at sign-in, large, and it never changes.\n if (id.includes('node_modules/libsodium')) return 'sodium'\n return null\n}\n\n/**\n * Rolldown's (Vite 8) `build.rolldownOptions.output.codeSplitting`. Vite's dynamic-import preload\n * helper gets its own chunk: left unpinned, the bundler parks it in a chunk that also imports\n * lazily, and the entry then preloads that whole chunk before the page renders.\n */\nexport function codeSplitting() {\n return {\n groups: [\n { name: 'preload-helper', test: /vite\\/preload-helper/, priority: 100 },\n { name: vendorChunkOf },\n // Vite's build-import lexer has a fixed WASM heap: the combined Word editor\n // can exceed it. Bound its chunks without pulling lazy editor code into an\n // eager vendor group or capturing its shared React/runtime dependencies.\n {\n name: 'docx-editor',\n test: /node_modules\\/@docx-editor\\.dev\\//,\n entriesAware: true,\n includeDependenciesRecursively: false,\n maxSize: 2_000_000,\n },\n ],\n }\n}\n\n/** Rollup's (Vite 6/7) `build.rollupOptions.output.manualChunks`, with the same vendor groups. */\nexport function manualChunks(id: string): string | undefined {\n return vendorChunkOf(id) ?? undefined\n}\n\nconst COMPRESSIBLE = /\\.(?:m?js|css|html|json|svg|wasm|txt|xml|webmanifest|ttf|otf)$/\n\n/**\n * Files a deployment rewrites after `vite build` (a compressed copy would serve the stale bytes):\n * the service worker (stamped with the build), the runtime config and web manifests (rendered when\n * the container starts), and `index.html` (tiny, and never cached).\n */\nexport const PRECOMPRESS_EXCLUDE: readonly string[] = [\n 'sw.js',\n 'config.json',\n '*.webmanifest',\n 'asset-manifest.json',\n 'index.html',\n]\n\nexport interface PrecompressOptions {\n /** Smallest file compressed, in bytes. Default 1024. */\n minSize?: number\n /**\n * File names (or `*` patterns, matched against the file name) never compressed: anything the\n * deployment changes after the build. Default `PRECOMPRESS_EXCLUDE`; pass your own list to\n * replace it (`[...PRECOMPRESS_EXCLUDE, 'extra.json']` to extend it).\n */\n exclude?: readonly string[]\n}\n\nasync function filesUnder(dir: string): Promise<string[]> {\n const entries = await readdir(dir, { withFileTypes: true, recursive: true })\n return entries.filter((e) => e.isFile()).map((e) => path.join(e.parentPath, e.name))\n}\n\nconst toPattern = (glob: string) =>\n new RegExp(`^${glob.replace(/[.+?^${}()|[\\]\\\\]/g, '\\\\$&').replace(/\\*/g, '.*')}$`)\n\n/** Runs `task` over `items`, `limit` at a time. */\nasync function eachLimited<T>(\n items: readonly T[],\n limit: number,\n task: (item: T) => Promise<void>\n) {\n let next = 0\n const worker = async () => {\n while (next < items.length) await task(items[next++])\n }\n await Promise.all(Array.from({ length: Math.min(limit, items.length) }, worker))\n}\n\n/**\n * Writes `<file>.br` (brotli, quality 11) and `<file>.gz` (gzip, level 9) beside every compressible\n * file of the build, including those copied from `public/`, so the web server sends them as they\n * are (nginx `gzip_static` / `brotli_static`): the smallest transfer, at no cost per request. Files\n * the deployment rewrites later are left out (`exclude`).\n */\nexport function precompress({\n minSize = 1024,\n exclude = PRECOMPRESS_EXCLUDE,\n}: PrecompressOptions = {}): Plugin {\n const br = promisify(brotliCompress)\n const gz = promisify(gzip)\n const excluded = exclude.map(toPattern)\n let outDir = ''\n return {\n name: 'arbi-precompress',\n apply: 'build',\n enforce: 'post',\n configResolved(config) {\n outDir = path.resolve(config.root, config.build.outDir)\n },\n async closeBundle() {\n const files = (await filesUnder(outDir)).filter(\n (f) => COMPRESSIBLE.test(f) && !excluded.some((p) => p.test(path.basename(f)))\n )\n // Brotli at quality 11 is CPU-heavy: a few files at a time.\n await eachLimited(files, 6, async (file) => {\n const data = await readFile(file)\n if (data.length < minSize) return\n const [brotli, gzipped] = await Promise.all([\n br(data, {\n params: {\n [constants.BROTLI_PARAM_QUALITY]: 11,\n [constants.BROTLI_PARAM_SIZE_HINT]: data.length,\n },\n }),\n gz(data, { level: 9 }),\n ])\n await Promise.all([writeFile(`${file}.br`, brotli), writeFile(`${file}.gz`, gzipped)])\n })\n },\n }\n}\n\n/**\n * The Word editor's text shaping loads `harfbuzz.wasm` with `new URL('harfbuzz.wasm',\n * import.meta.url)`. A build emits that asset, but the dev server's pre-bundle moves the editor into\n * `.vite/deps`, where the URL has no file and the SPA fallback answers with HTML (\"HarfBuzz shaping\n * failed\"). Serves the installed package's binary at that address. Dev server only.\n */\nexport function serveHarfBuzzWasm(): Plugin {\n return {\n name: 'arbi-harfbuzz-wasm',\n apply: 'serve',\n configureServer(server) {\n let wasm: string\n try {\n const require = createRequire(path.join(server.config.root, 'package.json'))\n wasm = path.join(path.dirname(require.resolve('@docx-editor.dev/core')), 'harfbuzz.wasm')\n } catch {\n return // The site does not use the Word editor.\n }\n server.middlewares.use((req, res, next) => {\n if (!req.url?.split('?')[0].endsWith('/.vite/deps/harfbuzz.wasm')) return next()\n res.setHeader('Content-Type', 'application/wasm')\n createReadStream(wasm).pipe(res)\n })\n },\n }\n}\n\nexport interface ArbiVitePluginsOptions {\n /** Precompress the build (`.br` and `.gz`). Default on. */\n precompress?: boolean | PrecompressOptions\n}\n\n/** The plugins every kit-built site uses: precompression and the Word editor's wasm in dev. */\nexport function arbiVitePlugins({\n precompress: compress = true,\n}: ArbiVitePluginsOptions = {}): Plugin[] {\n return [\n serveHarfBuzzWasm(),\n ...(compress ? [precompress(typeof compress === 'object' ? compress : {})] : []),\n ]\n}\n"]}
@@ -1,13 +1,13 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkRZSBHRQL_cjs = require('../chunk-RZSBHRQL.cjs');
4
+ var chunkMMKMQZ2B_cjs = require('../chunk-MMKMQZ2B.cjs');
5
5
  require('../chunk-32W2S6DE.cjs');
6
6
  require('../chunk-KWJW5TMH.cjs');
7
+ require('../chunk-AEQT2QQX.cjs');
7
8
  require('../chunk-5GHGIDZP.cjs');
8
9
  require('../chunk-VPKKPHJY.cjs');
9
10
  var chunk6CGMSJLB_cjs = require('../chunk-6CGMSJLB.cjs');
10
- require('../chunk-AEQT2QQX.cjs');
11
11
  var chunkLLD4PNBW_cjs = require('../chunk-LLD4PNBW.cjs');
12
12
  require('../chunk-VIUEPJ3Y.cjs');
13
13
  require('../chunk-C5APAFUY.cjs');
@@ -15,7 +15,7 @@ require('../chunk-HYUKPHCT.cjs');
15
15
  require('../chunk-FYFL3CET.cjs');
16
16
  require('../chunk-223D4727.cjs');
17
17
  require('../chunk-SNUBQMIS.cjs');
18
- var chunkUOZ237OW_cjs = require('../chunk-UOZ237OW.cjs');
18
+ var chunkFABKMTAI_cjs = require('../chunk-FABKMTAI.cjs');
19
19
  require('../chunk-4ONPEVTP.cjs');
20
20
  require('../chunk-V3KLUWQQ.cjs');
21
21
  var chunkOA3AN6WW_cjs = require('../chunk-OA3AN6WW.cjs');
@@ -29,7 +29,7 @@ require('../chunk-NZNBJF3M.cjs');
29
29
  require('../chunk-NWNVWO6L.cjs');
30
30
  require('../chunk-SK6HQ46Q.cjs');
31
31
  require('../chunk-TG2GM7WJ.cjs');
32
- require('../chunk-2SWS7ESM.cjs');
32
+ require('../chunk-L62EU3TQ.cjs');
33
33
  var chunkNSD37OF5_cjs = require('../chunk-NSD37OF5.cjs');
34
34
  require('../chunk-OEJQFPWO.cjs');
35
35
  var chunkX46QYO4S_cjs = require('../chunk-X46QYO4S.cjs');
@@ -3106,7 +3106,7 @@ function ConnectedWorkflowsPage({
3106
3106
  const config = host.workflows;
3107
3107
  const { openConversation, openFiles } = chunkLIKDQBNJ_cjs.useBlocksEnvironment();
3108
3108
  const openWorkflow = chunkOA3AN6WW_cjs.useOpenWorkflow();
3109
- const renderPerson = chunkRZSBHRQL_cjs.useRenderTaskPerson();
3109
+ const renderPerson = chunkMMKMQZ2B_cjs.useRenderTaskPerson();
3110
3110
  const refreshDocuments = react$2.useRefreshDocuments();
3111
3111
  const invalidateTags = react$2.useInvalidateTagData();
3112
3112
  const { data: tags = [] } = react$2.useTags();
@@ -3137,7 +3137,7 @@ function ConnectedWorkflowsPage({
3137
3137
  openHistory,
3138
3138
  closeHistoryTab,
3139
3139
  selectHistoryTab
3140
- } = chunkRZSBHRQL_cjs.useWorkflowsPageState({
3140
+ } = chunkMMKMQZ2B_cjs.useWorkflowsPageState({
3141
3141
  historyWorkflowId: requestedHistoryId ?? historyWorkflowId,
3142
3142
  onHistoryWorkflowConsumed: consumeHistory
3143
3143
  });
@@ -3205,7 +3205,7 @@ function ConnectedWorkflowsPage({
3205
3205
  return (
3206
3206
  // The page in the Workflows page's frame: padded, scrolling.
3207
3207
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-full min-h-0 w-full overflow-auto p-4 sm:p-6", children: /* @__PURE__ */ jsxRuntime.jsx(
3208
- chunkRZSBHRQL_cjs.ConnectedWorkflowRunPage,
3208
+ chunkMMKMQZ2B_cjs.ConnectedWorkflowRunPage,
3209
3209
  {
3210
3210
  workflow: running.workflow,
3211
3211
  projectFrom: running.projectFrom,
@@ -3293,7 +3293,7 @@ function ConnectedWorkflowsPage({
3293
3293
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex h-full min-h-0 flex-col", "data-testid": testId, children: [
3294
3294
  pageHeader && /* @__PURE__ */ jsxRuntime.jsx(chunkNSD37OF5_cjs.PageHeader, { ...pageHeader }),
3295
3295
  /* @__PURE__ */ jsxRuntime.jsx(
3296
- chunkUOZ237OW_cjs.ConnectedWorkflowsTable,
3296
+ chunkFABKMTAI_cjs.ConnectedWorkflowsTable,
3297
3297
  {
3298
3298
  onOpenTemplate: (id) => openBuilder({ kind: "template", id }),
3299
3299
  tabs: [
@@ -3323,7 +3323,7 @@ function ConnectedWorkflowsPage({
3323
3323
  }
3324
3324
  },
3325
3325
  content: hostTab ? hostTab.content : runsFor ? /* @__PURE__ */ jsxRuntime.jsx(
3326
- chunkRZSBHRQL_cjs.ConnectedWorkflowHistory,
3326
+ chunkMMKMQZ2B_cjs.ConnectedWorkflowHistory,
3327
3327
  {
3328
3328
  inline: true,
3329
3329
  hideHeader: true,
@@ -3387,7 +3387,7 @@ function ConnectedWorkflowsPage({
3387
3387
  }
3388
3388
  ),
3389
3389
  /* @__PURE__ */ jsxRuntime.jsx(
3390
- chunkRZSBHRQL_cjs.ConnectedTaskComposer,
3390
+ chunkMMKMQZ2B_cjs.ConnectedTaskComposer,
3391
3391
  {
3392
3392
  kind: "workflow",
3393
3393
  saveOnly: true,
@@ -1163,7 +1163,13 @@ var headingStyle = (paragraphs) => paragraphs.find((p) => p.topLevel && p.headin
1163
1163
  function insertParagraphs(port, index, body, count, keep) {
1164
1164
  const before = port.paragraphs();
1165
1165
  const kept = keep ? before.findIndex((p) => p.id === keep.paragraphId) : -1;
1166
- if (index < before.length) {
1166
+ const separateParagraph = index > 0 && index < before.length;
1167
+ if (separateParagraph) {
1168
+ const previous = before[index - 1];
1169
+ port.setCaret({ paragraphId: previous.id, offset: engineLength(previous) });
1170
+ port.splitParagraph();
1171
+ port.setCaret({ paragraphId: port.paragraphs()[index].id, offset: 0 });
1172
+ } else if (index < before.length) {
1167
1173
  port.setCaret({ paragraphId: before[index].id, offset: 0 });
1168
1174
  } else {
1169
1175
  const last = before[before.length - 1];
@@ -1173,6 +1179,17 @@ function insertParagraphs(port, index, body, count, keep) {
1173
1179
  port.setCaret({ paragraphId: opened[opened.length - 1].id, offset: 0 });
1174
1180
  }
1175
1181
  if (!port.paste(body, "", true)) throw new Error("The definition could not be added.");
1182
+ if (separateParagraph) {
1183
+ const inserted = port.paragraphs();
1184
+ const last = inserted[index + count - 1];
1185
+ const empty = inserted[index + count];
1186
+ if (port.joinEmptyParagraph) port.joinEmptyParagraph(last.id, empty.id);
1187
+ else
1188
+ port.deleteRange(
1189
+ { paragraphId: last.id, offset: engineLength(last) },
1190
+ { paragraphId: empty.id, offset: 0 }
1191
+ );
1192
+ }
1176
1193
  if (!keep || kept < 0) return keep;
1177
1194
  const after = port.paragraphs();
1178
1195
  const moved = index <= kept ? kept + count : kept;