@beyondwork/docx-react-component 1.0.27 → 1.0.29

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 (356) hide show
  1. package/dist/canonical-document-BLEbzL2J.d.cts +844 -0
  2. package/dist/canonical-document-BLEbzL2J.d.ts +844 -0
  3. package/dist/chunk-2FJS5GZM.js +763 -0
  4. package/dist/chunk-2FJS5GZM.js.map +1 -0
  5. package/{src/core/commands/section-layout-commands.ts → dist/chunk-2OQBZS3F.js} +106 -340
  6. package/dist/chunk-2OQBZS3F.js.map +1 -0
  7. package/dist/chunk-2S7W4KFO.js +127 -0
  8. package/dist/chunk-2S7W4KFO.js.map +1 -0
  9. package/dist/chunk-2TG72QSW.js +3874 -0
  10. package/dist/chunk-2TG72QSW.js.map +1 -0
  11. package/{src/core/commands/table-structure-commands.ts → dist/chunk-36QNIZBO.js} +126 -315
  12. package/dist/chunk-36QNIZBO.js.map +1 -0
  13. package/dist/chunk-4AQOYAW4.js +3069 -0
  14. package/dist/chunk-4AQOYAW4.js.map +1 -0
  15. package/dist/chunk-4D5EWJ3P.js +77 -0
  16. package/dist/chunk-4D5EWJ3P.js.map +1 -0
  17. package/dist/chunk-5FN54NDH.js +2257 -0
  18. package/dist/chunk-5FN54NDH.js.map +1 -0
  19. package/dist/chunk-BOYGQYRQ.js +7306 -0
  20. package/dist/chunk-BOYGQYRQ.js.map +1 -0
  21. package/dist/chunk-CN3XMECL.js +212 -0
  22. package/dist/chunk-CN3XMECL.js.map +1 -0
  23. package/dist/chunk-EBI3BX6U.js +164 -0
  24. package/dist/chunk-EBI3BX6U.js.map +1 -0
  25. package/dist/chunk-EILUG3VB.js +1275 -0
  26. package/dist/chunk-EILUG3VB.js.map +1 -0
  27. package/dist/chunk-FUDY333O.js +70 -0
  28. package/dist/chunk-FUDY333O.js.map +1 -0
  29. package/dist/chunk-GBVOWFIK.js +1237 -0
  30. package/dist/chunk-GBVOWFIK.js.map +1 -0
  31. package/dist/chunk-H4TQ3H3Y.js +262 -0
  32. package/dist/chunk-H4TQ3H3Y.js.map +1 -0
  33. package/{src/core/commands/style-commands.ts → dist/chunk-JGB3IXZO.js} +40 -113
  34. package/dist/chunk-JGB3IXZO.js.map +1 -0
  35. package/dist/chunk-KD2QRQPY.js +4342 -0
  36. package/dist/chunk-KD2QRQPY.js.map +1 -0
  37. package/dist/chunk-KLMXQVYK.js +369 -0
  38. package/dist/chunk-KLMXQVYK.js.map +1 -0
  39. package/dist/chunk-KZUG5KFQ.js +214 -0
  40. package/dist/chunk-KZUG5KFQ.js.map +1 -0
  41. package/{src/core/state/text-transaction.ts → dist/chunk-QDAQ4CJU.js} +79 -236
  42. package/dist/chunk-QDAQ4CJU.js.map +1 -0
  43. package/{src/legal/bookmarks.ts → dist/chunk-RMH72RZI.js} +44 -130
  44. package/dist/chunk-RMH72RZI.js.map +1 -0
  45. package/dist/chunk-SWKWQZXM.js +117 -0
  46. package/dist/chunk-SWKWQZXM.js.map +1 -0
  47. package/{src/core/commands/formatting-commands.ts → dist/chunk-TJBP2K4T.js} +196 -536
  48. package/dist/chunk-TJBP2K4T.js.map +1 -0
  49. package/dist/chunk-TLCEAQDQ.js +542 -0
  50. package/dist/chunk-TLCEAQDQ.js.map +1 -0
  51. package/{src/core/commands/text-commands.ts → dist/chunk-UZXBISGO.js} +86 -142
  52. package/dist/chunk-UZXBISGO.js.map +1 -0
  53. package/dist/chunk-WGBAKP3Q.js +3220 -0
  54. package/dist/chunk-WGBAKP3Q.js.map +1 -0
  55. package/dist/compare/index.cjs +5475 -0
  56. package/dist/compare/index.cjs.map +1 -0
  57. package/dist/compare/index.d.cts +114 -0
  58. package/dist/compare/index.d.ts +114 -0
  59. package/dist/compare/index.js +731 -0
  60. package/dist/compare/index.js.map +1 -0
  61. package/dist/core/commands/formatting-commands.cjs +828 -0
  62. package/dist/core/commands/formatting-commands.cjs.map +1 -0
  63. package/dist/core/commands/formatting-commands.d.cts +63 -0
  64. package/dist/core/commands/formatting-commands.d.ts +63 -0
  65. package/dist/core/commands/formatting-commands.js +37 -0
  66. package/dist/core/commands/formatting-commands.js.map +1 -0
  67. package/dist/core/commands/image-commands.cjs +2023 -0
  68. package/dist/core/commands/image-commands.cjs.map +1 -0
  69. package/dist/core/commands/image-commands.d.cts +58 -0
  70. package/dist/core/commands/image-commands.d.ts +58 -0
  71. package/dist/core/commands/image-commands.js +18 -0
  72. package/dist/core/commands/image-commands.js.map +1 -0
  73. package/dist/core/commands/section-layout-commands.cjs +477 -0
  74. package/dist/core/commands/section-layout-commands.cjs.map +1 -0
  75. package/dist/core/commands/section-layout-commands.d.cts +62 -0
  76. package/dist/core/commands/section-layout-commands.d.ts +62 -0
  77. package/dist/core/commands/section-layout-commands.js +21 -0
  78. package/dist/core/commands/section-layout-commands.js.map +1 -0
  79. package/dist/core/commands/style-commands.cjs +214 -0
  80. package/dist/core/commands/style-commands.cjs.map +1 -0
  81. package/dist/core/commands/style-commands.d.cts +13 -0
  82. package/dist/core/commands/style-commands.d.ts +13 -0
  83. package/dist/core/commands/style-commands.js +9 -0
  84. package/dist/core/commands/style-commands.js.map +1 -0
  85. package/dist/core/commands/table-structure-commands.cjs +1883 -0
  86. package/dist/core/commands/table-structure-commands.cjs.map +1 -0
  87. package/dist/core/commands/table-structure-commands.d.cts +59 -0
  88. package/dist/core/commands/table-structure-commands.d.ts +59 -0
  89. package/dist/core/commands/table-structure-commands.js +12 -0
  90. package/dist/core/commands/table-structure-commands.js.map +1 -0
  91. package/dist/core/commands/text-commands.cjs +2391 -0
  92. package/dist/core/commands/text-commands.cjs.map +1 -0
  93. package/dist/core/commands/text-commands.d.cts +24 -0
  94. package/dist/core/commands/text-commands.d.ts +24 -0
  95. package/dist/core/commands/text-commands.js +28 -0
  96. package/dist/core/commands/text-commands.js.map +1 -0
  97. package/dist/core/selection/mapping.cjs +200 -0
  98. package/dist/core/selection/mapping.cjs.map +1 -0
  99. package/dist/core/selection/mapping.d.cts +2 -0
  100. package/dist/core/selection/mapping.d.ts +2 -0
  101. package/dist/core/selection/mapping.js +31 -0
  102. package/dist/core/selection/mapping.js.map +1 -0
  103. package/dist/core/state/editor-state.cjs +2278 -0
  104. package/dist/core/state/editor-state.cjs.map +1 -0
  105. package/dist/core/state/editor-state.d.cts +2 -0
  106. package/dist/core/state/editor-state.d.ts +2 -0
  107. package/dist/core/state/editor-state.js +26 -0
  108. package/dist/core/state/editor-state.js.map +1 -0
  109. package/dist/index.cjs +38553 -0
  110. package/dist/index.cjs.map +1 -0
  111. package/dist/index.d.cts +15 -0
  112. package/dist/index.d.ts +15 -0
  113. package/dist/index.js +7856 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/io/docx-session.cjs +16236 -0
  116. package/dist/io/docx-session.cjs.map +1 -0
  117. package/dist/io/docx-session.d.cts +21 -0
  118. package/dist/io/docx-session.d.ts +21 -0
  119. package/dist/io/docx-session.js +18 -0
  120. package/dist/io/docx-session.js.map +1 -0
  121. package/dist/legal/index.cjs +3900 -0
  122. package/dist/legal/index.cjs.map +1 -0
  123. package/dist/legal/index.d.cts +86 -0
  124. package/dist/legal/index.d.ts +86 -0
  125. package/dist/legal/index.js +616 -0
  126. package/dist/legal/index.js.map +1 -0
  127. package/dist/public-types-7ZL_94cz.d.ts +1573 -0
  128. package/dist/public-types-CeMaDueh.d.cts +1573 -0
  129. package/dist/public-types.cjs +19 -0
  130. package/dist/public-types.cjs.map +1 -0
  131. package/dist/public-types.d.cts +2 -0
  132. package/dist/public-types.d.ts +2 -0
  133. package/dist/public-types.js +1 -0
  134. package/dist/public-types.js.map +1 -0
  135. package/dist/runtime/document-runtime.cjs +11140 -0
  136. package/dist/runtime/document-runtime.cjs.map +1 -0
  137. package/dist/runtime/document-runtime.d.cts +231 -0
  138. package/dist/runtime/document-runtime.d.ts +231 -0
  139. package/dist/runtime/document-runtime.js +21 -0
  140. package/dist/runtime/document-runtime.js.map +1 -0
  141. package/dist/structural-helpers-CilgOVhh.d.cts +10 -0
  142. package/dist/structural-helpers-q0Gd-eBN.d.ts +10 -0
  143. package/dist/ui-tailwind/editor-surface/search-plugin.cjs +313 -0
  144. package/dist/ui-tailwind/editor-surface/search-plugin.cjs.map +1 -0
  145. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +67 -0
  146. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +67 -0
  147. package/dist/ui-tailwind/editor-surface/search-plugin.js +23 -0
  148. package/dist/ui-tailwind/editor-surface/search-plugin.js.map +1 -0
  149. package/dist/ui-tailwind/index.cjs +4833 -0
  150. package/dist/ui-tailwind/index.cjs.map +1 -0
  151. package/dist/ui-tailwind/index.d.cts +617 -0
  152. package/dist/ui-tailwind/index.d.ts +617 -0
  153. package/dist/ui-tailwind/index.js +575 -0
  154. package/dist/ui-tailwind/index.js.map +1 -0
  155. package/package.json +64 -54
  156. package/src/README.md +0 -85
  157. package/src/api/README.md +0 -26
  158. package/src/api/public-types.ts +0 -1418
  159. package/src/api/session-state.ts +0 -60
  160. package/src/compare/diff-engine.ts +0 -623
  161. package/src/compare/export-redlines.ts +0 -280
  162. package/src/compare/index.ts +0 -25
  163. package/src/compare/snapshot.ts +0 -97
  164. package/src/component-inventory.md +0 -99
  165. package/src/core/README.md +0 -10
  166. package/src/core/commands/README.md +0 -3
  167. package/src/core/commands/image-commands.ts +0 -373
  168. package/src/core/commands/index.ts +0 -1757
  169. package/src/core/commands/list-commands.ts +0 -565
  170. package/src/core/commands/paragraph-layout-commands.ts +0 -339
  171. package/src/core/commands/review-commands.ts +0 -108
  172. package/src/core/commands/structural-helpers.ts +0 -309
  173. package/src/core/schema/README.md +0 -3
  174. package/src/core/schema/text-schema.ts +0 -516
  175. package/src/core/search/search-text.ts +0 -357
  176. package/src/core/selection/README.md +0 -3
  177. package/src/core/selection/mapping.ts +0 -289
  178. package/src/core/selection/review-anchors.ts +0 -183
  179. package/src/core/state/README.md +0 -3
  180. package/src/core/state/editor-state.ts +0 -892
  181. package/src/formats/xlsx/io/parse-shared-strings.ts +0 -41
  182. package/src/formats/xlsx/io/parse-sheet.ts +0 -459
  183. package/src/formats/xlsx/io/parse-styles.ts +0 -59
  184. package/src/formats/xlsx/io/parse-workbook.ts +0 -75
  185. package/src/formats/xlsx/io/serialize-shared-strings.ts +0 -72
  186. package/src/formats/xlsx/io/serialize-sheet.ts +0 -333
  187. package/src/formats/xlsx/io/serialize-styles.ts +0 -98
  188. package/src/formats/xlsx/io/serialize-workbook.ts +0 -429
  189. package/src/formats/xlsx/io/xlsx-session.ts +0 -314
  190. package/src/formats/xlsx/model/cell.ts +0 -189
  191. package/src/formats/xlsx/model/sheet.ts +0 -326
  192. package/src/formats/xlsx/model/styles.ts +0 -118
  193. package/src/formats/xlsx/model/workbook.ts +0 -453
  194. package/src/formats/xlsx/runtime/cell-commands.ts +0 -567
  195. package/src/formats/xlsx/runtime/sheet-commands.ts +0 -206
  196. package/src/formats/xlsx/runtime/workbook-runtime.ts +0 -177
  197. package/src/formats/xlsx/runtime/workbook-transaction.ts +0 -822
  198. package/src/index.ts +0 -101
  199. package/src/io/README.md +0 -10
  200. package/src/io/docx-session.ts +0 -2882
  201. package/src/io/export/README.md +0 -3
  202. package/src/io/export/export-session.ts +0 -220
  203. package/src/io/export/minimal-docx.ts +0 -115
  204. package/src/io/export/reattach-preserved-parts.ts +0 -54
  205. package/src/io/export/serialize-comments.ts +0 -947
  206. package/src/io/export/serialize-footnotes.ts +0 -399
  207. package/src/io/export/serialize-headers-footers.ts +0 -372
  208. package/src/io/export/serialize-main-document.ts +0 -1376
  209. package/src/io/export/serialize-numbering.ts +0 -118
  210. package/src/io/export/serialize-revisions.ts +0 -389
  211. package/src/io/export/serialize-runtime-revisions.ts +0 -269
  212. package/src/io/export/serialize-tables.ts +0 -174
  213. package/src/io/export/split-review-boundaries.ts +0 -356
  214. package/src/io/normalize/README.md +0 -3
  215. package/src/io/normalize/normalize-text.ts +0 -639
  216. package/src/io/ooxml/README.md +0 -3
  217. package/src/io/ooxml/highlight-colors.ts +0 -39
  218. package/src/io/ooxml/numbering-sentinels.ts +0 -44
  219. package/src/io/ooxml/parse-comments.ts +0 -846
  220. package/src/io/ooxml/parse-complex-content.ts +0 -287
  221. package/src/io/ooxml/parse-fields.ts +0 -834
  222. package/src/io/ooxml/parse-footnotes.ts +0 -896
  223. package/src/io/ooxml/parse-headers-footers.ts +0 -1169
  224. package/src/io/ooxml/parse-inline-media.ts +0 -461
  225. package/src/io/ooxml/parse-main-document.ts +0 -2877
  226. package/src/io/ooxml/parse-numbering.ts +0 -432
  227. package/src/io/ooxml/parse-revisions.ts +0 -931
  228. package/src/io/ooxml/parse-settings.ts +0 -184
  229. package/src/io/ooxml/parse-shapes.ts +0 -296
  230. package/src/io/ooxml/parse-styles.ts +0 -463
  231. package/src/io/ooxml/parse-tables.ts +0 -618
  232. package/src/io/ooxml/parse-theme.ts +0 -346
  233. package/src/io/ooxml/part-manifest.ts +0 -136
  234. package/src/io/ooxml/revision-boundaries.ts +0 -351
  235. package/src/io/opc/README.md +0 -3
  236. package/src/io/opc/corrupt-package.ts +0 -166
  237. package/src/io/opc/docx-package.ts +0 -74
  238. package/src/io/opc/package-reader.ts +0 -325
  239. package/src/io/opc/package-writer.ts +0 -273
  240. package/src/io/source-package-provenance.ts +0 -241
  241. package/src/legal/cross-references.ts +0 -414
  242. package/src/legal/defined-terms.ts +0 -203
  243. package/src/legal/index.ts +0 -32
  244. package/src/legal/signature-blocks.ts +0 -259
  245. package/src/model/README.md +0 -3
  246. package/src/model/canonical-document.ts +0 -2632
  247. package/src/model/cds-1.0.0.ts +0 -212
  248. package/src/model/snapshot.ts +0 -649
  249. package/src/preservation/README.md +0 -3
  250. package/src/preservation/markup-compatibility.ts +0 -48
  251. package/src/preservation/opaque-fragment-store.ts +0 -89
  252. package/src/preservation/opaque-region.ts +0 -233
  253. package/src/preservation/package-preservation.ts +0 -113
  254. package/src/preservation/preserved-part-manifest.ts +0 -56
  255. package/src/preservation/relationship-retention.ts +0 -57
  256. package/src/preservation/store.ts +0 -185
  257. package/src/review/README.md +0 -16
  258. package/src/review/store/README.md +0 -3
  259. package/src/review/store/comment-anchors.ts +0 -70
  260. package/src/review/store/comment-remapping.ts +0 -154
  261. package/src/review/store/comment-store.ts +0 -331
  262. package/src/review/store/comment-thread.ts +0 -109
  263. package/src/review/store/revision-actions.ts +0 -394
  264. package/src/review/store/revision-store.ts +0 -312
  265. package/src/review/store/revision-types.ts +0 -171
  266. package/src/review/store/runtime-comment-store.ts +0 -43
  267. package/src/runtime/README.md +0 -3
  268. package/src/runtime/ai-action-policy.ts +0 -764
  269. package/src/runtime/collab-review-sync.ts +0 -254
  270. package/src/runtime/document-layout.ts +0 -332
  271. package/src/runtime/document-navigation.ts +0 -603
  272. package/src/runtime/document-runtime.ts +0 -3159
  273. package/src/runtime/document-search.ts +0 -145
  274. package/src/runtime/numbering-prefix.ts +0 -216
  275. package/src/runtime/page-layout-estimation.ts +0 -212
  276. package/src/runtime/read-only-diagnostics-runtime.ts +0 -241
  277. package/src/runtime/review-runtime.ts +0 -44
  278. package/src/runtime/revision-runtime.ts +0 -107
  279. package/src/runtime/session-capabilities.ts +0 -192
  280. package/src/runtime/story-context.ts +0 -164
  281. package/src/runtime/story-targeting.ts +0 -162
  282. package/src/runtime/surface-projection.ts +0 -1357
  283. package/src/runtime/table-commands.ts +0 -173
  284. package/src/runtime/table-schema.ts +0 -309
  285. package/src/runtime/view-state.ts +0 -477
  286. package/src/runtime/virtualized-rendering.ts +0 -258
  287. package/src/runtime/workflow-markup.ts +0 -353
  288. package/src/ui/README.md +0 -30
  289. package/src/ui/WordReviewEditor.tsx +0 -4097
  290. package/src/ui/browser-export.ts +0 -52
  291. package/src/ui/comments/README.md +0 -3
  292. package/src/ui/compatibility/README.md +0 -3
  293. package/src/ui/editor-command-bag.ts +0 -120
  294. package/src/ui/editor-runtime-boundary.ts +0 -1457
  295. package/src/ui/editor-shell-view.tsx +0 -142
  296. package/src/ui/editor-surface/README.md +0 -3
  297. package/src/ui/editor-surface-controller.tsx +0 -63
  298. package/src/ui/headless/comment-decoration-model.ts +0 -124
  299. package/src/ui/headless/preserve-editor-selection.ts +0 -5
  300. package/src/ui/headless/revision-decoration-model.ts +0 -128
  301. package/src/ui/headless/selection-helpers.ts +0 -54
  302. package/src/ui/headless/selection-toolbar-model.ts +0 -34
  303. package/src/ui/headless/use-editor-keyboard.ts +0 -103
  304. package/src/ui/review/README.md +0 -3
  305. package/src/ui/runtime-snapshot-selectors.ts +0 -197
  306. package/src/ui/shared/revision-filters.ts +0 -31
  307. package/src/ui/status/README.md +0 -3
  308. package/src/ui/theme/README.md +0 -3
  309. package/src/ui/toolbar/README.md +0 -3
  310. package/src/ui/workflow-surface-blocked-rails.ts +0 -94
  311. package/src/ui-tailwind/chrome/tw-alert-banner.tsx +0 -64
  312. package/src/ui-tailwind/chrome/tw-image-context-toolbar.tsx +0 -129
  313. package/src/ui-tailwind/chrome/tw-layout-panel.tsx +0 -114
  314. package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +0 -34
  315. package/src/ui-tailwind/chrome/tw-page-ruler.tsx +0 -386
  316. package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +0 -186
  317. package/src/ui-tailwind/chrome/tw-suggestion-card.tsx +0 -139
  318. package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +0 -128
  319. package/src/ui-tailwind/chrome/tw-unsaved-modal.tsx +0 -58
  320. package/src/ui-tailwind/chrome/use-before-unload.ts +0 -20
  321. package/src/ui-tailwind/editor-surface/perf-probe.ts +0 -179
  322. package/src/ui-tailwind/editor-surface/pm-collab-plugins.ts +0 -40
  323. package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +0 -178
  324. package/src/ui-tailwind/editor-surface/pm-contextual-ui.ts +0 -31
  325. package/src/ui-tailwind/editor-surface/pm-decorations.ts +0 -427
  326. package/src/ui-tailwind/editor-surface/pm-position-map.ts +0 -123
  327. package/src/ui-tailwind/editor-surface/pm-schema.ts +0 -876
  328. package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +0 -504
  329. package/src/ui-tailwind/editor-surface/search-plugin.ts +0 -168
  330. package/src/ui-tailwind/editor-surface/surface-build-keys.ts +0 -61
  331. package/src/ui-tailwind/editor-surface/tw-caret.tsx +0 -12
  332. package/src/ui-tailwind/editor-surface/tw-editor-surface.tsx +0 -150
  333. package/src/ui-tailwind/editor-surface/tw-inline-token.tsx +0 -129
  334. package/src/ui-tailwind/editor-surface/tw-opaque-block.tsx +0 -58
  335. package/src/ui-tailwind/editor-surface/tw-paragraph-block.tsx +0 -151
  336. package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +0 -973
  337. package/src/ui-tailwind/editor-surface/tw-segment-view.tsx +0 -111
  338. package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +0 -436
  339. package/src/ui-tailwind/index.ts +0 -62
  340. package/src/ui-tailwind/page-chrome-model.ts +0 -27
  341. package/src/ui-tailwind/review/tw-comment-sidebar.tsx +0 -406
  342. package/src/ui-tailwind/review/tw-health-panel.tsx +0 -149
  343. package/src/ui-tailwind/review/tw-review-rail.tsx +0 -120
  344. package/src/ui-tailwind/review/tw-revision-sidebar.tsx +0 -164
  345. package/src/ui-tailwind/status/tw-status-bar.tsx +0 -61
  346. package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +0 -52
  347. package/src/ui-tailwind/toolbar/tw-toolbar.tsx +0 -1064
  348. package/src/ui-tailwind/tw-review-workspace.tsx +0 -1417
  349. package/src/validation/README.md +0 -3
  350. package/src/validation/compatibility-engine.ts +0 -634
  351. package/src/validation/compatibility-report.ts +0 -161
  352. package/src/validation/diagnostics.ts +0 -204
  353. package/src/validation/docx-comment-proof.ts +0 -707
  354. package/src/validation/import-diagnostics.ts +0 -128
  355. package/src/validation/low-priority-word-surfaces.ts +0 -373
  356. /package/{src → dist}/ui-tailwind/theme/editor-theme.css +0 -0
@@ -0,0 +1,1573 @@
1
+ import { d as PersistedEditorSnapshotVersion, e as CDS_SCHEMA_VERSION, I as ISO8601DateTime, C as CanonicalDocument, f as CompatibilityReportVersion, g as Base64, h as CommentThread, i as CommentEntry, j as CommentResolution, R as RevisionMetadataRecord$1, k as RevisionRecord$1, S as SupportedFieldFamily$1, F as FieldRefreshStatus$1, l as FieldFamily$1 } from './canonical-document-BLEbzL2J.js';
2
+
3
+ type Position = number;
4
+ type Assoc = -1 | 1;
5
+ interface DocRange {
6
+ from: Position;
7
+ to: Position;
8
+ }
9
+ interface BoundaryAssoc {
10
+ start: Assoc;
11
+ end: Assoc;
12
+ }
13
+ interface RangeAnchor {
14
+ kind: "range";
15
+ range: DocRange;
16
+ assoc: BoundaryAssoc;
17
+ }
18
+ interface NodeAnchor {
19
+ kind: "node";
20
+ at: Position;
21
+ assoc: Assoc;
22
+ }
23
+ interface DetachedAnchor {
24
+ kind: "detached";
25
+ lastKnownRange: DocRange;
26
+ reason: "deleted" | "invalidatedByStructureChange" | "importAmbiguity";
27
+ }
28
+ type EditorAnchorProjection$1 = RangeAnchor | NodeAnchor | DetachedAnchor;
29
+ interface MappingStep {
30
+ from: Position;
31
+ to: Position;
32
+ insertSize: number;
33
+ }
34
+ interface MappingResult {
35
+ position: Position;
36
+ deleted: boolean;
37
+ }
38
+ interface TransactionMapping {
39
+ steps: MappingStep[];
40
+ metadata?: {
41
+ invalidatesStructures?: boolean;
42
+ affectsComments?: boolean;
43
+ affectsRevisions?: boolean;
44
+ affectsOpaqueFragments?: boolean;
45
+ [key: string]: unknown;
46
+ };
47
+ }
48
+ declare const DEFAULT_BOUNDARY_ASSOC: BoundaryAssoc;
49
+ declare function createRangeAnchor(from: Position, to?: number, assoc?: BoundaryAssoc): RangeAnchor;
50
+ declare function createNodeAnchor(at: Position, assoc?: Assoc): NodeAnchor;
51
+ declare function createDetachedAnchor(lastKnownRange: DocRange, reason: DetachedAnchor["reason"]): DetachedAnchor;
52
+ declare function createEmptyMapping(): TransactionMapping;
53
+ declare function normalizeRange(range: DocRange): DocRange;
54
+ declare function getEffectiveRange(anchor: EditorAnchorProjection$1): DocRange;
55
+ declare function mapPosition(position: Position, assoc: Assoc, mapping: TransactionMapping): MappingResult;
56
+ declare function mapAnchor(anchor: EditorAnchorProjection$1, mapping: TransactionMapping): EditorAnchorProjection$1;
57
+ declare function mapRange(range: DocRange, assoc: BoundaryAssoc, mapping: TransactionMapping): RangeAnchor | DetachedAnchor;
58
+ declare function areAnchorsEqual(left: EditorAnchorProjection$1, right: EditorAnchorProjection$1): boolean;
59
+ declare function storyTargetsEqual(left: EditorStoryTarget | undefined, right: EditorStoryTarget | undefined): boolean;
60
+ declare const MAIN_STORY_TARGET: EditorStoryTarget;
61
+
62
+ type EditorWarningCode$2 = "unsupported_ooxml_preserved" | "unsupported_ooxml_locked" | "import_normalized" | "export_roundtrip_risk" | "comment_anchor_detached" | "revision_anchor_detached" | "large_document_degraded" | "font_substitution" | "image_missing";
63
+ interface EditorWarning$2 {
64
+ warningId: string;
65
+ code: EditorWarningCode$2;
66
+ severity: "info" | "warning";
67
+ message: string;
68
+ source: "import" | "runtime" | "review" | "preservation" | "validation" | "export";
69
+ affectedAnchor?: Record<string, unknown>;
70
+ featureEntryId?: string;
71
+ details?: Record<string, unknown>;
72
+ }
73
+ type EditorErrorCode$1 = "import_failed" | "export_failed" | "package_corrupt" | "validation_failed" | "datastore_failed" | "internal_invariant";
74
+ interface EditorError$2 {
75
+ errorId: string;
76
+ code: EditorErrorCode$1;
77
+ message: string;
78
+ isFatal: boolean;
79
+ source: "import" | "runtime" | "validation" | "datastore" | "host" | "export";
80
+ details?: Record<string, unknown>;
81
+ }
82
+ type CompatibilityFeatureClass$2 = "supported-roundtrip" | "preserve-only" | "unsupported-fatal";
83
+ interface CompatibilityFeatureEntry$2 {
84
+ featureEntryId: string;
85
+ featureKey: string;
86
+ featureClass: CompatibilityFeatureClass$2;
87
+ message: string;
88
+ affectedAnchor?: Record<string, unknown>;
89
+ details?: Record<string, unknown>;
90
+ }
91
+ interface CompatibilityReport$2 {
92
+ reportVersion: CompatibilityReportVersion;
93
+ generatedAt: ISO8601DateTime;
94
+ blockExport: boolean;
95
+ featureEntries: CompatibilityFeatureEntry$2[];
96
+ warnings: EditorWarning$2[];
97
+ errors: EditorError$2[];
98
+ }
99
+ interface PersistedSourcePackage {
100
+ format: "docx";
101
+ storage: "embedded-base64";
102
+ mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
103
+ sourceLabel?: string;
104
+ sha256Hex: string;
105
+ bytesBase64: Base64;
106
+ }
107
+ interface PersistedEditorSnapshot$2 {
108
+ snapshotVersion: PersistedEditorSnapshotVersion;
109
+ schemaVersion: typeof CDS_SCHEMA_VERSION;
110
+ documentId: string;
111
+ docId: string;
112
+ createdAt: ISO8601DateTime;
113
+ updatedAt: ISO8601DateTime;
114
+ savedAt: ISO8601DateTime;
115
+ editorBuild: string;
116
+ canonicalDocument: CanonicalDocument;
117
+ compatibility: CompatibilityReport$2;
118
+ warningLog: EditorWarning$2[];
119
+ protectionSnapshot?: ProtectionSnapshotRecord;
120
+ sourcePackage?: PersistedSourcePackage;
121
+ }
122
+ interface ProtectionRangeRecord {
123
+ rangeId: string;
124
+ start?: number;
125
+ end?: number;
126
+ editorGroup?: string;
127
+ editor?: string;
128
+ enforced: boolean;
129
+ enforcementReason: string;
130
+ }
131
+ interface ProtectionSnapshotRecord {
132
+ hasDocumentProtection: boolean;
133
+ editType?: string;
134
+ enforcementActive: boolean;
135
+ ranges: ProtectionRangeRecord[];
136
+ enforcedRangeCount: number;
137
+ preservedRangeCount: number;
138
+ }
139
+
140
+ type RuntimePhase = "loading" | "ready" | "error";
141
+ type EditorWarningCode$1 = "unsupported_ooxml_preserved" | "unsupported_ooxml_locked" | "import_normalized" | "export_roundtrip_risk" | "comment_anchor_detached" | "revision_anchor_detached" | "large_document_degraded" | "font_substitution" | "image_missing";
142
+ interface EditorWarning$1 {
143
+ warningId: string;
144
+ code: EditorWarningCode$1;
145
+ severity: "info" | "warning";
146
+ message: string;
147
+ source: "import" | "runtime" | "review" | "preservation" | "validation" | "export";
148
+ affectedAnchor?: EditorAnchorProjection$1;
149
+ featureEntryId?: string;
150
+ details?: Record<string, unknown>;
151
+ }
152
+ interface EditorError$1 {
153
+ errorId: string;
154
+ code: "import_failed" | "export_failed" | "package_corrupt" | "validation_failed" | "datastore_failed" | "internal_invariant";
155
+ message: string;
156
+ isFatal: boolean;
157
+ source: "import" | "runtime" | "validation" | "datastore" | "host" | "export";
158
+ details?: Record<string, unknown>;
159
+ }
160
+ type CompatibilityFeatureClass$1 = "supported-roundtrip" | "preserve-only" | "unsupported-fatal";
161
+ interface CompatibilityFeatureEntry$1 {
162
+ featureEntryId: string;
163
+ featureKey: string;
164
+ featureClass: CompatibilityFeatureClass$1;
165
+ message: string;
166
+ affectedAnchor?: EditorAnchorProjection$1;
167
+ details?: Record<string, unknown>;
168
+ }
169
+ interface CompatibilityReport$1 {
170
+ reportVersion: "compatibility-report/1";
171
+ generatedAt: string;
172
+ blockExport: boolean;
173
+ featureEntries: CompatibilityFeatureEntry$1[];
174
+ warnings: EditorWarning$1[];
175
+ errors: EditorError$1[];
176
+ }
177
+ type CommentEntryRecord = CommentEntry;
178
+ type CommentResolutionRecord = CommentResolution;
179
+ type CommentThreadRecord = CommentThread;
180
+ type RevisionMetadataRecord = RevisionMetadataRecord$1;
181
+ type RevisionRecord = RevisionRecord$1;
182
+ type ReviewStore = CanonicalDocument["review"];
183
+ type CanonicalDocumentEnvelope = CanonicalDocument;
184
+ interface SelectionSnapshot$1 {
185
+ anchor: number;
186
+ head: number;
187
+ isCollapsed: boolean;
188
+ activeRange: EditorAnchorProjection$1;
189
+ }
190
+ interface DocumentStats$1 {
191
+ paragraphCount: number;
192
+ wordCount: number;
193
+ characterCount: number;
194
+ commentCount: number;
195
+ revisionCount: number;
196
+ }
197
+ interface CommentSidebarSnapshot$1 {
198
+ activeCommentId?: string;
199
+ openThreadCount: number;
200
+ resolvedThreadCount: number;
201
+ threads: CommentThreadRecord[];
202
+ }
203
+ interface TrackedChangesSnapshot$1 {
204
+ totalCount: number;
205
+ pendingCount: number;
206
+ acceptedCount: number;
207
+ rejectedCount: number;
208
+ }
209
+ interface CompatibilityPanelSnapshot$1 {
210
+ report: CompatibilityReport$1;
211
+ blockExport: boolean;
212
+ totalEntries: number;
213
+ }
214
+ interface CommandStateSnapshot$1 {
215
+ canUndo: boolean;
216
+ canRedo: boolean;
217
+ canAddComment: boolean;
218
+ canAcceptAllChanges: boolean;
219
+ canRejectAllChanges: boolean;
220
+ }
221
+ interface RuntimeRenderSnapshot$1 {
222
+ documentId: string;
223
+ sessionId: string;
224
+ sourceLabel?: string;
225
+ revisionToken: string;
226
+ isReady: boolean;
227
+ isDirty: boolean;
228
+ readOnly: boolean;
229
+ selection: SelectionSnapshot$1;
230
+ documentStats: DocumentStats$1;
231
+ comments: CommentSidebarSnapshot$1;
232
+ trackedChanges: TrackedChangesSnapshot$1;
233
+ compatibility: CompatibilityPanelSnapshot$1;
234
+ warnings: EditorWarning$1[];
235
+ fatalError?: EditorError$1;
236
+ commandState: CommandStateSnapshot$1;
237
+ }
238
+ interface PersistedEditorSnapshot$1 extends Omit<PersistedEditorSnapshot$2, "canonicalDocument" | "compatibility" | "warningLog"> {
239
+ canonicalDocument: CanonicalDocumentEnvelope;
240
+ compatibility: CompatibilityReport$1;
241
+ warningLog: EditorWarning$1[];
242
+ }
243
+ interface EditorRuntimeState {
244
+ hasFocus: boolean;
245
+ activeCommentId?: string;
246
+ }
247
+ interface EditorState {
248
+ phase: RuntimePhase;
249
+ documentId: string;
250
+ sessionId: string;
251
+ sourceLabel?: string;
252
+ sourcePackage?: PersistedEditorSnapshot$2["sourcePackage"];
253
+ revision: number;
254
+ revisionToken: string;
255
+ isDirty: boolean;
256
+ readOnly: boolean;
257
+ document: CanonicalDocumentEnvelope;
258
+ selection: SelectionSnapshot$1;
259
+ warnings: EditorWarning$1[];
260
+ compatibility: CompatibilityReport$1;
261
+ fatalError?: EditorError$1;
262
+ runtime: EditorRuntimeState;
263
+ }
264
+ interface CreateEditorStateOptions {
265
+ documentId: string;
266
+ sessionId: string;
267
+ sourceLabel?: string;
268
+ readOnly?: boolean;
269
+ canonicalDocument?: CanonicalDocumentEnvelope;
270
+ persistedSnapshot?: PersistedEditorSnapshot$1;
271
+ compatibility?: CompatibilityReport$1;
272
+ warnings?: EditorWarning$1[];
273
+ fatalError?: EditorError$1;
274
+ }
275
+ declare function createEmptyReviewStore(): ReviewStore;
276
+ declare function createDefaultCanonicalDocument(documentId: string, timestamp: string): CanonicalDocumentEnvelope;
277
+ declare function createSelectionSnapshot(anchor?: number, head?: number): SelectionSnapshot$1;
278
+ declare function createEmptyCompatibilityReport(generatedAt: string): CompatibilityReport$1;
279
+ declare function createEditorState(options: CreateEditorStateOptions): EditorState;
280
+ declare function deriveDocumentStats(state: Pick<EditorState, "document">): DocumentStats$1;
281
+ declare function deriveRenderSnapshot(state: EditorState, history: {
282
+ canUndo: boolean;
283
+ canRedo: boolean;
284
+ }): RuntimeRenderSnapshot$1;
285
+ declare function createPersistedEditorSnapshot(state: EditorState, options: {
286
+ editorBuild: string;
287
+ savedAt: string;
288
+ compatibility?: CompatibilityReport$1;
289
+ protectionSnapshot?: ProtectionSnapshotRecord;
290
+ }): PersistedEditorSnapshot$1;
291
+ declare function createCanonicalDocumentId(documentId: string): string;
292
+ declare function normalizeCommentThreadRecord(value: unknown): CommentThreadRecord;
293
+
294
+ type FieldFamily = FieldFamily$1;
295
+ type FieldRefreshStatus = FieldRefreshStatus$1;
296
+ type SupportedFieldFamily = SupportedFieldFamily$1;
297
+ type ExternalDocumentSource = {
298
+ kind: "docx";
299
+ bytes: Uint8Array | ArrayBuffer;
300
+ sourceLabel?: string;
301
+ } | {
302
+ kind: "session";
303
+ sessionState: EditorSessionState;
304
+ sourceLabel?: string;
305
+ } | {
306
+ kind: "snapshot";
307
+ snapshot: PersistedEditorSnapshot;
308
+ sourceLabel?: string;
309
+ };
310
+ type LoadSourcePolicy = "prefer-saved-state" | "prefer-source-package";
311
+ interface LoadRequest {
312
+ documentId: string;
313
+ loadRevision?: string;
314
+ loadSourcePolicy?: LoadSourcePolicy;
315
+ }
316
+ interface EditorUser {
317
+ userId: string;
318
+ displayName: string;
319
+ email?: string;
320
+ avatarUrl?: string;
321
+ }
322
+ type EditorAnchorProjection = {
323
+ kind: "range";
324
+ from: number;
325
+ to: number;
326
+ assoc: {
327
+ start: -1 | 1;
328
+ end: -1 | 1;
329
+ };
330
+ } | {
331
+ kind: "node";
332
+ at: number;
333
+ assoc: -1 | 1;
334
+ } | {
335
+ kind: "detached";
336
+ lastKnownRange: {
337
+ from: number;
338
+ to: number;
339
+ };
340
+ reason: "deleted" | "invalidatedByStructureChange" | "importAmbiguity";
341
+ };
342
+ type EditorStoryTarget = {
343
+ kind: "main";
344
+ } | {
345
+ kind: "header";
346
+ relationshipId: string;
347
+ variant: "default" | "first" | "even";
348
+ sectionIndex?: number;
349
+ } | {
350
+ kind: "footer";
351
+ relationshipId: string;
352
+ variant: "default" | "first" | "even";
353
+ sectionIndex?: number;
354
+ } | {
355
+ kind: "footnote";
356
+ noteId: string;
357
+ } | {
358
+ kind: "endnote";
359
+ noteId: string;
360
+ };
361
+ interface SelectionSnapshot {
362
+ anchor: number;
363
+ head: number;
364
+ isCollapsed: boolean;
365
+ activeRange: EditorAnchorProjection;
366
+ storyTarget?: EditorStoryTarget;
367
+ }
368
+ interface PageLayoutSnapshot {
369
+ sectionIndex: number;
370
+ sectionType?: "continuous" | "nextPage" | "evenPage" | "oddPage" | "nextColumn";
371
+ pageWidth: number;
372
+ pageHeight: number;
373
+ marginTop: number;
374
+ marginBottom: number;
375
+ marginLeft: number;
376
+ marginRight: number;
377
+ headerMargin: number;
378
+ footerMargin: number;
379
+ gutter: number;
380
+ orientation: "portrait" | "landscape";
381
+ columns: number;
382
+ differentFirstPage: boolean;
383
+ differentOddEvenPages: boolean;
384
+ pageNumbering?: {
385
+ format?: string;
386
+ start?: number;
387
+ chapterStyle?: string;
388
+ chapterSeparator?: string;
389
+ };
390
+ lineNumbering?: {
391
+ countBy?: number;
392
+ start?: number;
393
+ distance?: number;
394
+ restart?: "newPage" | "newSection" | "continuous";
395
+ };
396
+ pageBorders?: {
397
+ top?: {
398
+ value?: string;
399
+ size?: number;
400
+ space?: number;
401
+ color?: string;
402
+ };
403
+ left?: {
404
+ value?: string;
405
+ size?: number;
406
+ space?: number;
407
+ color?: string;
408
+ };
409
+ bottom?: {
410
+ value?: string;
411
+ size?: number;
412
+ space?: number;
413
+ color?: string;
414
+ };
415
+ right?: {
416
+ value?: string;
417
+ size?: number;
418
+ space?: number;
419
+ color?: string;
420
+ };
421
+ offsetFrom?: "page" | "text";
422
+ display?: "allPages" | "firstPage" | "notFirstPage";
423
+ zOrder?: "front" | "back";
424
+ };
425
+ documentGrid?: {
426
+ type?: "default" | "lines" | "linesAndChars" | "snapToChars";
427
+ linePitch?: number;
428
+ charSpace?: number;
429
+ };
430
+ columnDefinitions: Array<{
431
+ width: number;
432
+ space?: number;
433
+ }>;
434
+ equalWidthColumns: boolean;
435
+ columnSeparator: boolean;
436
+ headerVariants: Array<{
437
+ variant: "default" | "first" | "even";
438
+ relationshipId: string;
439
+ }>;
440
+ footerVariants: Array<{
441
+ variant: "default" | "first" | "even";
442
+ relationshipId: string;
443
+ }>;
444
+ }
445
+ type WorkspaceMode = "canvas" | "page";
446
+ type ZoomLevel = "pageWidth" | "onePage" | number;
447
+ type SectionBreakType = "nextPage" | "continuous" | "evenPage" | "oddPage" | "nextColumn";
448
+ interface SectionLayoutPatch {
449
+ pageSize?: Partial<{
450
+ width: number;
451
+ height: number;
452
+ orientation: "portrait" | "landscape";
453
+ }>;
454
+ pageMargins?: Partial<{
455
+ top: number;
456
+ right: number;
457
+ bottom: number;
458
+ left: number;
459
+ header: number;
460
+ footer: number;
461
+ gutter: number;
462
+ }>;
463
+ columns?: Partial<{
464
+ count: number;
465
+ space: number;
466
+ equalWidth: boolean;
467
+ columns: Array<{
468
+ width: number;
469
+ space?: number;
470
+ }>;
471
+ separator: boolean;
472
+ }>;
473
+ titlePage?: boolean;
474
+ sectionType?: SectionBreakType;
475
+ }
476
+ interface SectionPageNumberingPatch {
477
+ format?: string | null;
478
+ start?: number | null;
479
+ chapterStyle?: string | null;
480
+ chapterSeparator?: string | null;
481
+ }
482
+ interface HeaderFooterLinkPatch {
483
+ kind: "header" | "footer";
484
+ variant: "default" | "first" | "even";
485
+ linkToPrevious: boolean;
486
+ relationshipId?: string | null;
487
+ }
488
+ interface DocumentStats {
489
+ storyLength: number;
490
+ commentCount: number;
491
+ revisionCount: number;
492
+ opaqueFragmentCount: number;
493
+ }
494
+ interface CommentSidebarSnapshot {
495
+ activeCommentId?: string;
496
+ openCommentIds: string[];
497
+ resolvedCommentIds: string[];
498
+ detachedCommentIds: string[];
499
+ totalCount: number;
500
+ threads: CommentSidebarThreadSnapshot[];
501
+ }
502
+ interface CommentSidebarThreadEntrySnapshot {
503
+ entryId: string;
504
+ authorId: string;
505
+ body: string;
506
+ createdAt: string;
507
+ }
508
+ interface CommentSidebarThreadSnapshot {
509
+ commentId: string;
510
+ status: "open" | "resolved" | "detached";
511
+ anchor: EditorAnchorProjection;
512
+ excerpt: string;
513
+ entryCount: number;
514
+ entries: CommentSidebarThreadEntrySnapshot[];
515
+ createdAt: string;
516
+ createdBy: string;
517
+ warningCount: number;
518
+ anchorLabel: string;
519
+ isActive: boolean;
520
+ resolvedAt?: string;
521
+ resolvedBy?: string;
522
+ }
523
+ interface TrackedChangeEntrySnapshot {
524
+ revisionId: string;
525
+ kind: "insertion" | "deletion" | "formatting" | "move" | "property-change";
526
+ label: string;
527
+ status: "active" | "accepted" | "rejected" | "detached";
528
+ actionability: "actionable" | "preserve-only";
529
+ storyTarget?: EditorStoryTarget;
530
+ importedRevisionForm?: "run-insertion" | "run-deletion" | "paragraph-insertion" | "paragraph-deletion";
531
+ anchor: EditorAnchorProjection;
532
+ anchorLabel: string;
533
+ createdAt: string;
534
+ authorId: string;
535
+ warningCount: number;
536
+ canAccept: boolean;
537
+ canReject: boolean;
538
+ preserveOnlyReason?: string;
539
+ excerpt?: string;
540
+ detail?: string;
541
+ }
542
+ interface TrackedChangesSnapshot {
543
+ pendingChangeIds: string[];
544
+ acceptedChangeIds: string[];
545
+ rejectedChangeIds: string[];
546
+ detachedChangeIds: string[];
547
+ actionableChangeIds: string[];
548
+ preserveOnlyChangeIds: string[];
549
+ totalCount: number;
550
+ revisions: TrackedChangeEntrySnapshot[];
551
+ }
552
+ type FormattingAlignment = "left" | "center" | "right" | "justify";
553
+ interface FormattingBreadcrumbItem {
554
+ kind: "table" | "table_row" | "table_cell" | "paragraph" | "sdt_block" | "opaque_block";
555
+ label: string;
556
+ from: number;
557
+ to: number;
558
+ }
559
+ interface FormattingStateSnapshot {
560
+ bold: boolean;
561
+ italic: boolean;
562
+ underline: boolean;
563
+ strikethrough: boolean;
564
+ superscript: boolean;
565
+ subscript: boolean;
566
+ fontFamily?: string;
567
+ fontSize?: number;
568
+ textColor?: string;
569
+ highlightColor?: string | null;
570
+ alignment?: FormattingAlignment;
571
+ paragraphStyleId?: string;
572
+ breadcrumb: FormattingBreadcrumbItem[];
573
+ }
574
+ interface SearchOptions {
575
+ matchCase?: boolean;
576
+ wholeWord?: boolean;
577
+ limit?: number;
578
+ }
579
+ interface SearchResultSnapshot {
580
+ resultId: string;
581
+ anchor: EditorAnchorProjection;
582
+ excerpt: string;
583
+ isActive: boolean;
584
+ storyTarget?: EditorStoryTarget;
585
+ sectionIndex?: number;
586
+ pageIndex?: number;
587
+ }
588
+ /**
589
+ * Runtime-owned snapshot of the document's page stack, heading outline, and
590
+ * navigation context. Derived from canonical document state and section
591
+ * properties — never from DOM scroll position or CSS layout.
592
+ */
593
+ interface DocumentNavigationSnapshot {
594
+ /** Total estimated page count across all sections. */
595
+ pageCount: number;
596
+ /** Ordered page descriptors, one per logical page. */
597
+ pages: DocumentPageSnapshot[];
598
+ /** Ordered heading outline extracted from paragraph styles. */
599
+ headings: DocumentHeadingSnapshot[];
600
+ /** Index of the page containing the current selection head. */
601
+ activePageIndex: number;
602
+ /** Section index containing the current selection head. */
603
+ activeSectionIndex: number;
604
+ }
605
+ /** Runtime-derived descriptor for a single logical page. */
606
+ interface DocumentPageSnapshot {
607
+ /** Zero-based page index within the whole document. */
608
+ pageIndex: number;
609
+ /** Section that owns this page (zero-based). */
610
+ sectionIndex: number;
611
+ /** Zero-based page index within its owning section. */
612
+ pageInSection: number;
613
+ /** Estimated character offset where the page begins in the main story. */
614
+ startOffset: number;
615
+ /** Estimated character offset where the page ends in the main story. */
616
+ endOffset: number;
617
+ /** Page layout properties inherited from the section. */
618
+ layout: PageLayoutSnapshot;
619
+ }
620
+ /** A heading entry in the document outline. */
621
+ interface DocumentHeadingSnapshot {
622
+ /** Stable identifier for the heading (derived from block position). */
623
+ headingId: string;
624
+ /** Outline level (1 = Heading 1, 2 = Heading 2, etc.). */
625
+ level: number;
626
+ /** Plain-text content of the heading paragraph. */
627
+ text: string;
628
+ /** Character offset of the heading in the main story. */
629
+ offset: number;
630
+ /** Zero-based page index where the heading lives. */
631
+ pageIndex: number;
632
+ /** Section index where the heading lives. */
633
+ sectionIndex: number;
634
+ }
635
+ /** A single field entry in the runtime field snapshot. */
636
+ interface FieldEntrySnapshot {
637
+ /** Stable index of the field in document order. */
638
+ index: number;
639
+ /** Classified field family. */
640
+ fieldFamily: FieldFamily;
641
+ /** Whether this family is in the supported refresh slice. */
642
+ supported: boolean;
643
+ /** Raw field instruction string. */
644
+ instruction: string;
645
+ /** Target bookmark for REF/PAGEREF/NOTEREF fields. */
646
+ fieldTarget?: string;
647
+ /** Current refresh status. */
648
+ refreshStatus: FieldRefreshStatus;
649
+ /** Resolved display text (from field children). */
650
+ displayText: string;
651
+ }
652
+ /** Runtime field snapshot — read-only view of all fields in the document. */
653
+ interface FieldSnapshot {
654
+ /** Total number of fields in the document. */
655
+ totalCount: number;
656
+ /** Number of fields in the supported refresh slice. */
657
+ supportedCount: number;
658
+ /** Number of fields that are preserve-only. */
659
+ preserveOnlyCount: number;
660
+ /** Ordered field entries. */
661
+ fields: FieldEntrySnapshot[];
662
+ }
663
+ /** Options for runtime-backed field refresh. */
664
+ interface UpdateFieldsOptions {
665
+ /** When true, only refresh fields in the supported slice. Default true. */
666
+ supportedOnly?: boolean;
667
+ }
668
+ /** Result of a runtime-backed field refresh operation. */
669
+ interface UpdateFieldsResult {
670
+ /** Total number of fields in the document. */
671
+ totalCount: number;
672
+ /** Number of fields that were refreshed. */
673
+ updatedCount: number;
674
+ /** Number of preserve-only fields left unchanged. */
675
+ preserveOnlyCount: number;
676
+ }
677
+ /** Options for runtime-backed TOC refresh. */
678
+ interface TocRefreshOptions {
679
+ /** Maximum heading outline level to include (1–9, default 3). */
680
+ maxLevel?: number;
681
+ }
682
+ /** Result of a TOC refresh operation. */
683
+ interface TocRefreshResult {
684
+ /** Number of TOC entries generated from heading structure. */
685
+ entryCount: number;
686
+ /** Heading entries that populated the TOC. */
687
+ entries: Array<{
688
+ level: number;
689
+ text: string;
690
+ pageIndex: number;
691
+ }>;
692
+ }
693
+ interface StyleCatalogEntrySnapshot {
694
+ styleId: string;
695
+ displayName: string;
696
+ kind: "paragraph" | "character" | "table";
697
+ isDefault: boolean;
698
+ basedOn?: string;
699
+ nextStyle?: string;
700
+ }
701
+ interface StyleCatalogSnapshot {
702
+ paragraphs: StyleCatalogEntrySnapshot[];
703
+ characters: StyleCatalogEntrySnapshot[];
704
+ tables: StyleCatalogEntrySnapshot[];
705
+ fromPackage: boolean;
706
+ }
707
+ interface InsertTableOptions {
708
+ rows: number;
709
+ columns: number;
710
+ }
711
+ interface InsertImageOptions {
712
+ data: Uint8Array;
713
+ mimeType: string;
714
+ width?: number;
715
+ height?: number;
716
+ altText?: string;
717
+ }
718
+ type SurfaceTextMark = "bold" | "italic" | "underline" | "strikethrough" | "doubleStrikethrough" | "superscript" | "subscript" | "vanish" | "emboss" | "imprint" | "shadow" | "smallCaps" | "allCaps";
719
+ type SurfaceInlineSegment = {
720
+ segmentId: string;
721
+ kind: "text";
722
+ from: number;
723
+ to: number;
724
+ text: string;
725
+ marks?: SurfaceTextMark[];
726
+ markAttrs?: {
727
+ backgroundColor?: string;
728
+ charSpacing?: number;
729
+ kerning?: number;
730
+ textFill?: string;
731
+ fontFamily?: string;
732
+ fontSize?: number;
733
+ textColor?: string;
734
+ };
735
+ hyperlinkHref?: string;
736
+ } | {
737
+ segmentId: string;
738
+ kind: "tab" | "hard_break";
739
+ from: number;
740
+ to: number;
741
+ hyperlinkHref?: string;
742
+ } | {
743
+ segmentId: string;
744
+ kind: "image";
745
+ from: number;
746
+ to: number;
747
+ mediaId: string;
748
+ altText?: string;
749
+ state: "editable" | "missing";
750
+ display?: "inline" | "floating";
751
+ detail?: string;
752
+ } | {
753
+ segmentId: string;
754
+ kind: "opaque_inline";
755
+ from: number;
756
+ to: number;
757
+ fragmentId: string;
758
+ warningId: string;
759
+ label: string;
760
+ detail: string;
761
+ presentation?: "inline-chip" | "quiet-marker";
762
+ state: "locked-preserve-only";
763
+ } | {
764
+ segmentId: string;
765
+ kind: "note_ref";
766
+ from: number;
767
+ to: number;
768
+ noteKind: "footnote" | "endnote";
769
+ noteId: string;
770
+ label: string;
771
+ } | {
772
+ segmentId: string;
773
+ kind: "field_ref";
774
+ from: number;
775
+ to: number;
776
+ fieldFamily: SupportedFieldFamily;
777
+ fieldTarget?: string;
778
+ instruction: string;
779
+ refreshStatus: FieldRefreshStatus;
780
+ label: string;
781
+ };
782
+ interface SurfaceTableCellSnapshot {
783
+ gridSpan: number;
784
+ verticalMerge: "restart" | "continue" | null;
785
+ colspan: number;
786
+ rowspan: number;
787
+ backgroundColor?: string | null;
788
+ verticalAlign?: "top" | "center" | "bottom" | null;
789
+ borderTop?: string | null;
790
+ borderRight?: string | null;
791
+ borderBottom?: string | null;
792
+ borderLeft?: string | null;
793
+ content: SurfaceBlockSnapshot[];
794
+ }
795
+ interface SurfaceTableRowSnapshot {
796
+ cells: SurfaceTableCellSnapshot[];
797
+ gridBefore?: number;
798
+ gridAfter?: number;
799
+ height?: number;
800
+ heightRule?: "auto" | "atLeast" | "exact";
801
+ isHeader?: boolean;
802
+ }
803
+ type SurfaceBlockSnapshot = {
804
+ blockId: string;
805
+ kind: "paragraph";
806
+ from: number;
807
+ to: number;
808
+ styleId?: string;
809
+ numbering?: {
810
+ numberingInstanceId: string;
811
+ level: number;
812
+ };
813
+ numberingPrefix?: string;
814
+ numberingSuffix?: "tab" | "space" | "nothing";
815
+ alignment?: "left" | "center" | "right" | "both" | "distribute";
816
+ spacing?: {
817
+ before?: number;
818
+ after?: number;
819
+ line?: number;
820
+ lineRule?: string;
821
+ };
822
+ contextualSpacing?: boolean;
823
+ indentation?: {
824
+ left?: number;
825
+ right?: number;
826
+ firstLine?: number;
827
+ hanging?: number;
828
+ };
829
+ borders?: {
830
+ top?: unknown;
831
+ left?: unknown;
832
+ bottom?: unknown;
833
+ right?: unknown;
834
+ bar?: unknown;
835
+ between?: unknown;
836
+ };
837
+ shading?: {
838
+ fill?: string;
839
+ color?: string;
840
+ val?: string;
841
+ };
842
+ tabStops?: Array<{
843
+ pos: number;
844
+ val?: string;
845
+ leader?: string;
846
+ }>;
847
+ keepNext?: boolean;
848
+ keepLines?: boolean;
849
+ pageBreakBefore?: boolean;
850
+ outlineLevel?: number;
851
+ bidi?: boolean;
852
+ suppressLineNumbers?: boolean;
853
+ segments: SurfaceInlineSegment[];
854
+ } | {
855
+ blockId: string;
856
+ kind: "table";
857
+ from: number;
858
+ to: number;
859
+ styleId?: string;
860
+ gridColumns: number[];
861
+ alignment?: "left" | "center" | "right";
862
+ tblLook?: {
863
+ firstRow?: boolean;
864
+ lastRow?: boolean;
865
+ firstColumn?: boolean;
866
+ lastColumn?: boolean;
867
+ noHBand?: boolean;
868
+ noVBand?: boolean;
869
+ };
870
+ rows: SurfaceTableRowSnapshot[];
871
+ } | {
872
+ blockId: string;
873
+ kind: "sdt_block";
874
+ from: number;
875
+ to: number;
876
+ sdtType?: string;
877
+ alias?: string;
878
+ tag?: string;
879
+ lock?: string;
880
+ checkboxChecked?: boolean;
881
+ dateValue?: string;
882
+ dropdownItems?: Array<{
883
+ displayText?: string;
884
+ value: string;
885
+ }>;
886
+ comboBoxItems?: Array<{
887
+ displayText?: string;
888
+ value: string;
889
+ }>;
890
+ showingPlcHdr?: boolean;
891
+ children: SurfaceBlockSnapshot[];
892
+ } | {
893
+ blockId: string;
894
+ kind: "opaque_block";
895
+ from: number;
896
+ to: number;
897
+ fragmentId: string;
898
+ warningId: string;
899
+ label: string;
900
+ detail: string;
901
+ state: "locked-preserve-only";
902
+ };
903
+ interface SecondaryStorySurface {
904
+ target: EditorStoryTarget;
905
+ label: string;
906
+ storySize: number;
907
+ blocks: SurfaceBlockSnapshot[];
908
+ }
909
+ interface EditorSurfaceSnapshot {
910
+ storySize: number;
911
+ plainText: string;
912
+ blocks: SurfaceBlockSnapshot[];
913
+ lockedFragmentIds: string[];
914
+ secondaryStories: SecondaryStorySurface[];
915
+ }
916
+ type EditorWarningCode = "unsupported_ooxml_preserved" | "unsupported_ooxml_locked" | "import_normalized" | "export_roundtrip_risk" | "comment_anchor_detached" | "revision_anchor_detached" | "large_document_degraded" | "font_substitution" | "image_missing";
917
+ interface EditorWarning {
918
+ warningId: string;
919
+ code: EditorWarningCode;
920
+ severity: "info" | "warning";
921
+ message: string;
922
+ source: "import" | "runtime" | "review" | "preservation" | "validation" | "export";
923
+ affectedAnchor?: EditorAnchorProjection;
924
+ featureEntryId?: string;
925
+ details?: Record<string, unknown>;
926
+ }
927
+ type EditorErrorCode = "import_failed" | "export_failed" | "package_corrupt" | "validation_failed" | "datastore_failed" | "internal_invariant";
928
+ interface EditorError {
929
+ errorId: string;
930
+ code: EditorErrorCode;
931
+ message: string;
932
+ isFatal: boolean;
933
+ source: "import" | "runtime" | "validation" | "datastore" | "host" | "export";
934
+ details?: Record<string, unknown>;
935
+ }
936
+ type CompatibilityFeatureClass = "supported-roundtrip" | "preserve-only" | "unsupported-fatal";
937
+ interface CompatibilityFeatureEntry {
938
+ featureEntryId: string;
939
+ featureKey: string;
940
+ featureClass: CompatibilityFeatureClass;
941
+ message: string;
942
+ affectedAnchor?: EditorAnchorProjection;
943
+ details?: Record<string, unknown>;
944
+ }
945
+ interface CompatibilityReport {
946
+ reportVersion: "compatibility-report/1";
947
+ generatedAt: string;
948
+ blockExport: boolean;
949
+ featureEntries: CompatibilityFeatureEntry[];
950
+ warnings: EditorWarning[];
951
+ errors: EditorError[];
952
+ }
953
+ interface CompatibilityPanelSnapshot {
954
+ blockExport: boolean;
955
+ blockExportReasons: string[];
956
+ warningCount: number;
957
+ errorCount: number;
958
+ featureEntries: CompatibilityFeatureEntry[];
959
+ }
960
+ type ViewMode = "editing" | "review" | "view";
961
+ /**
962
+ * Runtime document-mode — controls whether editing is unrestricted, restricted
963
+ * to suggestions, or fully read-only at the document level.
964
+ *
965
+ * Distinct from `ViewMode` (editor posture) and `WorkspaceMode` (shell layout).
966
+ * `DocumentMode` reflects document-level editing authority, not presentation.
967
+ */
968
+ type DocumentMode = "editing" | "suggesting" | "viewing";
969
+ /**
970
+ * A single permission range parsed from `w:permStart` / `w:permEnd` in the
971
+ * source package. Ranges carry stable ids, edit-rights metadata, and an
972
+ * enforcement reason that the UI can display.
973
+ */
974
+ interface ProtectionRange {
975
+ /** Stable range id from `w:id` on the originating `w:permStart`. */
976
+ rangeId: string;
977
+ /** Start offset of the editable range when the runtime can map it safely. */
978
+ start?: number;
979
+ /** End offset of the editable range when the runtime can map it safely. */
980
+ end?: number;
981
+ /** Editor group allowed to edit this range (`w:edGrp`), if specified. */
982
+ editorGroup?: string;
983
+ /** Specific editor identity (`w:ed`), if specified. */
984
+ editor?: string;
985
+ /** Whether this range is currently enforced by the runtime. */
986
+ enforced: boolean;
987
+ /** Human-readable reason for the enforcement state. */
988
+ enforcementReason: string;
989
+ }
990
+ /**
991
+ * Snapshot of the document's protection posture. Descriptive and bounded —
992
+ * no public bypass around protected ranges, export blockers, or preserve-only
993
+ * regions.
994
+ */
995
+ interface ProtectionSnapshot {
996
+ /** Whether document-level protection is declared in the source package. */
997
+ hasDocumentProtection: boolean;
998
+ /**
999
+ * The declared protection edit type from `w:documentProtection` in
1000
+ * `settings.xml` (e.g. `"readOnly"`, `"comments"`, `"trackedChanges"`,
1001
+ * `"forms"`, `"none"`). `undefined` when no protection element exists.
1002
+ */
1003
+ editType?: string;
1004
+ /** Whether the declared protection is enforced (`w:enforcement="1"`). */
1005
+ enforcementActive: boolean;
1006
+ /** All parsed permission ranges from the source package. */
1007
+ ranges: ProtectionRange[];
1008
+ /** Count of permission ranges that are currently enforced. */
1009
+ enforcedRangeCount: number;
1010
+ /** Count of permission ranges preserved but not live-enforced. */
1011
+ preservedRangeCount: number;
1012
+ }
1013
+ type CaretAffinity = "forward" | "backward" | "none";
1014
+ interface ActiveListContext {
1015
+ numberingInstanceId: string;
1016
+ level: number;
1017
+ isOrdered: boolean;
1018
+ markerText?: string;
1019
+ }
1020
+ interface ActiveNoteContext {
1021
+ noteKind: "footnote" | "endnote";
1022
+ noteId: string;
1023
+ referencePosition: number;
1024
+ }
1025
+ interface PageRegionHitTest {
1026
+ region: "body" | "header" | "footer" | "margin" | "gutter";
1027
+ sectionIndex: number;
1028
+ columnIndex: number;
1029
+ }
1030
+ interface LayoutMeasurement {
1031
+ pageRegions: PageRegionHitTest[];
1032
+ caretAffinity: CaretAffinity;
1033
+ tabStops: Array<{
1034
+ pos: number;
1035
+ val?: string;
1036
+ leader?: string;
1037
+ }>;
1038
+ listMarkerLane?: {
1039
+ indent: number;
1040
+ markerWidth: number;
1041
+ };
1042
+ objectFrame?: {
1043
+ kind: "image" | "textbox" | "shape";
1044
+ anchorPos: number;
1045
+ display: "inline" | "floating";
1046
+ };
1047
+ }
1048
+ interface EditorViewStateSnapshot {
1049
+ viewMode: ViewMode;
1050
+ documentMode: DocumentMode;
1051
+ workspaceMode: WorkspaceMode;
1052
+ zoomLevel: ZoomLevel;
1053
+ activeStory: EditorStoryTarget;
1054
+ selection: SelectionSnapshot;
1055
+ caretAffinity: CaretAffinity;
1056
+ activeListContext: ActiveListContext | null;
1057
+ activeNoteContext: ActiveNoteContext | null;
1058
+ activePageRegion: PageRegionHitTest | null;
1059
+ activeObjectFrame: LayoutMeasurement["objectFrame"] | null;
1060
+ measurement: LayoutMeasurement;
1061
+ isFocused: boolean;
1062
+ }
1063
+ interface CommandStateSnapshot {
1064
+ canUndo: boolean;
1065
+ canRedo: boolean;
1066
+ readOnly: boolean;
1067
+ }
1068
+ interface RuntimeRenderSnapshot {
1069
+ documentId: string;
1070
+ sessionId: string;
1071
+ sourceLabel?: string;
1072
+ revisionToken: string;
1073
+ isReady: boolean;
1074
+ isDirty: boolean;
1075
+ readOnly: boolean;
1076
+ documentMode: DocumentMode;
1077
+ selection: SelectionSnapshot;
1078
+ activeStory: EditorStoryTarget;
1079
+ pageLayout?: PageLayoutSnapshot;
1080
+ documentStats: DocumentStats;
1081
+ comments: CommentSidebarSnapshot;
1082
+ trackedChanges: TrackedChangesSnapshot;
1083
+ compatibility: CompatibilityPanelSnapshot;
1084
+ warnings: EditorWarning[];
1085
+ fatalError?: EditorError;
1086
+ commandState: CommandStateSnapshot;
1087
+ surface?: EditorSurfaceSnapshot;
1088
+ protectionSnapshot: ProtectionSnapshot;
1089
+ }
1090
+ interface EditorSessionState {
1091
+ sessionVersion: "editor-session-state/1";
1092
+ schemaVersion: PersistedEditorSnapshot$1["schemaVersion"];
1093
+ documentId: string;
1094
+ docId: string;
1095
+ createdAt: string;
1096
+ updatedAt: string;
1097
+ editorBuild: string;
1098
+ canonicalDocument: PersistedEditorSnapshot$1["canonicalDocument"];
1099
+ compatibility: CompatibilityReport;
1100
+ warningLog: EditorWarning[];
1101
+ protectionSnapshot?: ProtectionSnapshot;
1102
+ sourcePackage?: PersistedEditorSnapshot$1["sourcePackage"];
1103
+ }
1104
+ interface PersistedEditorSnapshot {
1105
+ snapshotVersion: PersistedEditorSnapshot$1["snapshotVersion"];
1106
+ schemaVersion: PersistedEditorSnapshot$1["schemaVersion"];
1107
+ documentId: string;
1108
+ docId: string;
1109
+ createdAt: string;
1110
+ updatedAt: string;
1111
+ savedAt: string;
1112
+ editorBuild: string;
1113
+ canonicalDocument: PersistedEditorSnapshot$1["canonicalDocument"];
1114
+ compatibility: CompatibilityReport;
1115
+ warningLog: EditorWarning[];
1116
+ protectionSnapshot?: ProtectionSnapshot;
1117
+ sourcePackage?: PersistedEditorSnapshot$1["sourcePackage"];
1118
+ }
1119
+ interface AddCommentParams {
1120
+ anchor?: EditorAnchorProjection;
1121
+ body?: string;
1122
+ authorId?: string;
1123
+ }
1124
+ interface ExportDocxOptions {
1125
+ fileName?: string;
1126
+ reason?: string;
1127
+ }
1128
+ interface ExportDelivery {
1129
+ mode: "downloaded" | "persisted-by-host" | "exported-bytes-only";
1130
+ savedAt?: string;
1131
+ }
1132
+ interface ExportResult {
1133
+ bytes: Uint8Array;
1134
+ mimeType: string;
1135
+ fileName: string;
1136
+ delivery: ExportDelivery;
1137
+ }
1138
+ type WorkflowScopeMode = "edit" | "suggest" | "comment" | "view";
1139
+ interface WorkflowCandidateRange {
1140
+ candidateId: string;
1141
+ storyTarget?: EditorStoryTarget;
1142
+ anchor: EditorAnchorProjection;
1143
+ label?: string;
1144
+ source?: "search" | "playbook" | "host" | "ai";
1145
+ }
1146
+ interface WorkflowScope {
1147
+ scopeId: string;
1148
+ mode: WorkflowScopeMode;
1149
+ anchor: EditorAnchorProjection;
1150
+ storyTarget?: EditorStoryTarget;
1151
+ workItemId?: string;
1152
+ label?: string;
1153
+ domain?: "legal" | "commercial" | "finance" | "other";
1154
+ }
1155
+ interface WorkflowWorkItem {
1156
+ workItemId: string;
1157
+ title: string;
1158
+ description?: string;
1159
+ domain?: "legal" | "commercial" | "finance" | "other";
1160
+ status?: "pending" | "active" | "done" | "blocked";
1161
+ scopeIds: string[];
1162
+ }
1163
+ interface WorkflowOverlay {
1164
+ overlayVersion: "workflow-overlay/1";
1165
+ candidates?: WorkflowCandidateRange[];
1166
+ scopes: WorkflowScope[];
1167
+ workItems?: WorkflowWorkItem[];
1168
+ activeWorkItemId?: string | null;
1169
+ }
1170
+ interface WorkflowBlockedCommandReason {
1171
+ code: "outside_workflow_scope" | "workflow_comment_only" | "workflow_view_only" | "workflow_preserve_only" | "workflow_blocked_import" | "document_read_only" | "document_viewing_mode" | "protected_range" | "unsupported_surface" | "suggesting_unsupported";
1172
+ message: string;
1173
+ scopeId?: string;
1174
+ workItemId?: string;
1175
+ anchor?: EditorAnchorProjection;
1176
+ storyTarget?: EditorStoryTarget;
1177
+ }
1178
+ interface WorkflowScopeSnapshot {
1179
+ overlayPresent: boolean;
1180
+ activeWorkItemId?: string | null;
1181
+ activeWorkItem?: WorkflowWorkItem;
1182
+ scopes: WorkflowScope[];
1183
+ candidates: WorkflowCandidateRange[];
1184
+ blockedReasons: WorkflowBlockedCommandReason[];
1185
+ }
1186
+ type EffectiveSelectionMode = WorkflowScopeMode | "blocked";
1187
+ interface InteractionGuardSnapshot {
1188
+ effectiveMode: EffectiveSelectionMode;
1189
+ matchedScopeId?: string;
1190
+ matchedScopeMode?: WorkflowScopeMode;
1191
+ disabledReason?: string;
1192
+ blockedReasons: WorkflowBlockedCommandReason[];
1193
+ }
1194
+ type WorkflowMarkupKind = "highlight" | "comment" | "revision" | "field" | "protected_range" | "opaque_fragment";
1195
+ interface WorkflowMarkupBase {
1196
+ markupId: string;
1197
+ kind: WorkflowMarkupKind;
1198
+ anchor: EditorAnchorProjection;
1199
+ storyTarget?: EditorStoryTarget;
1200
+ label: string;
1201
+ excerpt?: string;
1202
+ }
1203
+ interface WorkflowHighlightMarkup extends WorkflowMarkupBase {
1204
+ kind: "highlight";
1205
+ color: string;
1206
+ text: string;
1207
+ }
1208
+ interface WorkflowCommentMarkup extends WorkflowMarkupBase {
1209
+ kind: "comment";
1210
+ commentId: string;
1211
+ status: CommentSidebarThreadSnapshot["status"];
1212
+ warningCount: number;
1213
+ entryCount: number;
1214
+ createdAt: string;
1215
+ createdBy: string;
1216
+ }
1217
+ interface WorkflowRevisionMarkup extends WorkflowMarkupBase {
1218
+ kind: "revision";
1219
+ revisionId: string;
1220
+ revisionKind: TrackedChangeEntrySnapshot["kind"];
1221
+ status: TrackedChangeEntrySnapshot["status"];
1222
+ actionability: TrackedChangeEntrySnapshot["actionability"];
1223
+ authorId: string;
1224
+ createdAt: string;
1225
+ preserveOnlyReason?: string;
1226
+ }
1227
+ interface WorkflowFieldMarkup extends WorkflowMarkupBase {
1228
+ kind: "field";
1229
+ fieldIndex: number;
1230
+ fieldFamily: FieldFamily;
1231
+ fieldTarget?: string;
1232
+ refreshStatus: FieldRefreshStatus;
1233
+ displayText: string;
1234
+ }
1235
+ interface WorkflowProtectedRangeMarkup extends WorkflowMarkupBase {
1236
+ kind: "protected_range";
1237
+ rangeId: string;
1238
+ enforced: boolean;
1239
+ enforcementReason: string;
1240
+ editorGroup?: string;
1241
+ editor?: string;
1242
+ }
1243
+ interface WorkflowOpaqueFragmentMarkup extends WorkflowMarkupBase {
1244
+ kind: "opaque_fragment";
1245
+ fragmentId: string;
1246
+ warningId: string;
1247
+ detail: string;
1248
+ blockedReasonCode: "workflow_preserve_only" | "workflow_blocked_import";
1249
+ }
1250
+ type WorkflowMarkupItem = WorkflowHighlightMarkup | WorkflowCommentMarkup | WorkflowRevisionMarkup | WorkflowFieldMarkup | WorkflowProtectedRangeMarkup | WorkflowOpaqueFragmentMarkup;
1251
+ interface WorkflowMarkupSnapshot {
1252
+ totalCount: number;
1253
+ items: WorkflowMarkupItem[];
1254
+ highlights: WorkflowHighlightMarkup[];
1255
+ comments: WorkflowCommentMarkup[];
1256
+ revisions: WorkflowRevisionMarkup[];
1257
+ fields: WorkflowFieldMarkup[];
1258
+ protectedRanges: WorkflowProtectedRangeMarkup[];
1259
+ opaqueFragments: WorkflowOpaqueFragmentMarkup[];
1260
+ }
1261
+ type HostAnnotationKind = "note" | "scope_hint" | "readonly_marker" | "suggestion" | "warning";
1262
+ interface HostAnnotationItem {
1263
+ annotationId: string;
1264
+ kind: HostAnnotationKind;
1265
+ label: string;
1266
+ anchor: EditorAnchorProjection;
1267
+ storyTarget?: EditorStoryTarget;
1268
+ detail?: string;
1269
+ scopeMode?: WorkflowScopeMode;
1270
+ severity?: "low" | "medium" | "high";
1271
+ workItemId?: string;
1272
+ provenance: "host";
1273
+ }
1274
+ interface HostAnnotationOverlay {
1275
+ overlayVersion: "host-annotation-overlay/1";
1276
+ annotations: HostAnnotationItem[];
1277
+ }
1278
+ interface HostAnnotationSnapshot {
1279
+ totalCount: number;
1280
+ annotations: HostAnnotationItem[];
1281
+ }
1282
+ interface WorkflowCandidateRangeOptions {
1283
+ kinds?: WorkflowMarkupKind[];
1284
+ includeDetached?: boolean;
1285
+ source?: WorkflowCandidateRange["source"];
1286
+ }
1287
+ type AutosaveState = {
1288
+ status: "idle";
1289
+ } | {
1290
+ status: "saving";
1291
+ } | {
1292
+ status: "saved";
1293
+ savedAt: string;
1294
+ } | {
1295
+ status: "error";
1296
+ error: EditorError;
1297
+ };
1298
+ interface AutosaveConfig {
1299
+ enabled?: boolean;
1300
+ debounceMs?: number;
1301
+ }
1302
+ type WordReviewEditorEvent = {
1303
+ type: "ready";
1304
+ documentId: string;
1305
+ sessionId: string;
1306
+ source: "docx" | "session" | "snapshot";
1307
+ stats: DocumentStats;
1308
+ compatibility: CompatibilityReport;
1309
+ comments: CommentSidebarSnapshot;
1310
+ trackedChanges: TrackedChangesSnapshot;
1311
+ } | {
1312
+ type: "dirty_changed";
1313
+ documentId: string;
1314
+ isDirty: boolean;
1315
+ } | {
1316
+ type: "selection_changed";
1317
+ documentId: string;
1318
+ selection: SelectionSnapshot;
1319
+ } | {
1320
+ type: "comment_added";
1321
+ documentId: string;
1322
+ commentId: string;
1323
+ anchor: EditorAnchorProjection;
1324
+ } | {
1325
+ type: "comment_resolved";
1326
+ documentId: string;
1327
+ commentId: string;
1328
+ } | {
1329
+ type: "change_accepted";
1330
+ documentId: string;
1331
+ changeId: string;
1332
+ } | {
1333
+ type: "change_rejected";
1334
+ documentId: string;
1335
+ changeId: string;
1336
+ } | {
1337
+ type: "story_changed";
1338
+ documentId: string;
1339
+ activeStory: EditorStoryTarget;
1340
+ } | {
1341
+ type: "warning_added";
1342
+ documentId: string;
1343
+ warning: EditorWarning;
1344
+ } | {
1345
+ type: "warning_cleared";
1346
+ documentId: string;
1347
+ warningId: string;
1348
+ code: EditorWarningCode;
1349
+ } | {
1350
+ type: "error";
1351
+ documentId: string;
1352
+ error: EditorError;
1353
+ } | {
1354
+ type: "autosave_state";
1355
+ documentId: string;
1356
+ state: AutosaveState;
1357
+ } | {
1358
+ type: "snapshot_saved";
1359
+ documentId: string;
1360
+ snapshot: PersistedEditorSnapshot;
1361
+ isAutosave: boolean;
1362
+ } | {
1363
+ type: "session_saved";
1364
+ documentId: string;
1365
+ sessionState: EditorSessionState;
1366
+ savedAt: string;
1367
+ isAutosave: boolean;
1368
+ } | {
1369
+ type: "export_completed";
1370
+ documentId: string;
1371
+ result: ExportResult;
1372
+ } | {
1373
+ type: "workflow_overlay_changed";
1374
+ documentId: string;
1375
+ snapshot: WorkflowScopeSnapshot;
1376
+ } | {
1377
+ type: "workflow_active_work_item_changed";
1378
+ documentId: string;
1379
+ activeWorkItemId: string | null;
1380
+ } | {
1381
+ type: "host_annotation_overlay_changed";
1382
+ documentId: string;
1383
+ snapshot: HostAnnotationSnapshot;
1384
+ } | {
1385
+ type: "change_authored";
1386
+ documentId: string;
1387
+ changeId: string;
1388
+ kind: "insertion" | "deletion";
1389
+ } | {
1390
+ type: "command_blocked";
1391
+ documentId: string;
1392
+ command: string;
1393
+ reasons: WorkflowBlockedCommandReason[];
1394
+ };
1395
+ interface LoadResult {
1396
+ source?: ExternalDocumentSource;
1397
+ }
1398
+ interface SaveSnapshotParams {
1399
+ documentId: string;
1400
+ snapshot: PersistedEditorSnapshot;
1401
+ isAutosave: boolean;
1402
+ }
1403
+ interface SaveSnapshotResult {
1404
+ savedAt: string;
1405
+ }
1406
+ interface SaveSessionParams {
1407
+ documentId: string;
1408
+ sessionState: EditorSessionState;
1409
+ isAutosave: boolean;
1410
+ }
1411
+ interface SaveSessionResult {
1412
+ savedAt: string;
1413
+ }
1414
+ interface SaveExportParams {
1415
+ documentId: string;
1416
+ result: ExportResult;
1417
+ }
1418
+ interface SaveExportResult {
1419
+ savedAt: string;
1420
+ }
1421
+ interface EditorTelemetryEvent {
1422
+ type: string;
1423
+ documentId: string;
1424
+ detail?: Record<string, unknown>;
1425
+ }
1426
+ interface EditorHostAdapter {
1427
+ load?(params: LoadRequest): Promise<LoadResult>;
1428
+ saveSession?(params: SaveSessionParams): Promise<SaveSessionResult>;
1429
+ saveExport?(params: SaveExportParams): Promise<SaveExportResult>;
1430
+ logEvent?(event: EditorTelemetryEvent): void;
1431
+ }
1432
+ interface EditorDatastoreAdapter {
1433
+ load(params: LoadRequest): Promise<LoadResult>;
1434
+ saveSnapshot(params: SaveSnapshotParams): Promise<SaveSnapshotResult>;
1435
+ saveExport?(params: SaveExportParams): Promise<SaveExportResult>;
1436
+ logEvent?(event: EditorTelemetryEvent): void;
1437
+ }
1438
+ interface WordReviewEditorRef {
1439
+ focus(): void;
1440
+ blur(): void;
1441
+ undo(): void;
1442
+ redo(): void;
1443
+ addComment(params: AddCommentParams): string;
1444
+ openComment(commentId: string): void;
1445
+ resolveComment(commentId: string): void;
1446
+ reopenComment(commentId: string): void;
1447
+ addCommentReply(commentId: string, body: string): void;
1448
+ editCommentBody(commentId: string, body: string): void;
1449
+ deleteComment(commentId: string): void;
1450
+ acceptChange(changeId: string): void;
1451
+ rejectChange(changeId: string): void;
1452
+ acceptAllChanges(): void;
1453
+ rejectAllChanges(): void;
1454
+ exportDocx(options?: ExportDocxOptions): Promise<ExportResult>;
1455
+ getSessionState(): EditorSessionState;
1456
+ getSnapshot(): PersistedEditorSnapshot;
1457
+ getRenderSnapshot(): RuntimeRenderSnapshot;
1458
+ getCompatibilityReport(): CompatibilityReport;
1459
+ getWarnings(): EditorWarning[];
1460
+ getCommentSidebarSnapshot(): CommentSidebarSnapshot;
1461
+ getTrackedChangesSnapshot(): TrackedChangesSnapshot;
1462
+ getComments(): CommentSidebarSnapshot;
1463
+ getTrackedChanges(): TrackedChangesSnapshot;
1464
+ isDirty(): boolean;
1465
+ getFormattingState(): FormattingStateSnapshot;
1466
+ getStyleCatalog(): StyleCatalogSnapshot;
1467
+ replaceText(text: string, target?: EditorAnchorProjection): void;
1468
+ toggleBold(): void;
1469
+ toggleItalic(): void;
1470
+ toggleUnderline(): void;
1471
+ toggleStrikethrough(): void;
1472
+ toggleSuperscript(): void;
1473
+ toggleSubscript(): void;
1474
+ setFontFamily(fontFamily: string | null): void;
1475
+ setFontSize(size: number | null): void;
1476
+ setTextColor(color: string | null): void;
1477
+ setHighlightColor(color: string | null): void;
1478
+ setAlignment(alignment: FormattingAlignment): void;
1479
+ setParagraphStyle(styleId: string | null): void;
1480
+ setTableStyle(styleId: string | null): void;
1481
+ indent(): void;
1482
+ outdent(): void;
1483
+ insertPageBreak(): void;
1484
+ insertTable(options: InsertTableOptions): void;
1485
+ insertImage(options: InsertImageOptions): void;
1486
+ addRowBefore(): void;
1487
+ addRowAfter(): void;
1488
+ addColumnBefore(): void;
1489
+ addColumnAfter(): void;
1490
+ deleteRow(): void;
1491
+ deleteColumn(): void;
1492
+ deleteTable(): void;
1493
+ mergeCells(): void;
1494
+ splitCell(): void;
1495
+ setCellBackground(color: string): void;
1496
+ search(query: string, options?: SearchOptions): SearchResultSnapshot[];
1497
+ clearSearch(): void;
1498
+ setSelection(selection: SelectionSnapshot | null): void;
1499
+ scrollToRevision(revisionId: string): void;
1500
+ scrollToComment(commentId: string): void;
1501
+ openStory(target: EditorStoryTarget): void;
1502
+ closeStory(): void;
1503
+ getPageLayoutSnapshot(): PageLayoutSnapshot | null;
1504
+ getDocumentNavigationSnapshot(): DocumentNavigationSnapshot;
1505
+ getFieldSnapshot(): FieldSnapshot;
1506
+ updateFields(options?: UpdateFieldsOptions): UpdateFieldsResult;
1507
+ updateTableOfContents(options?: TocRefreshOptions): TocRefreshResult;
1508
+ getViewState(): EditorViewStateSnapshot;
1509
+ setDocumentMode(mode: DocumentMode): void;
1510
+ getProtectionSnapshot(): ProtectionSnapshot;
1511
+ setWorkspaceMode(mode: WorkspaceMode): void;
1512
+ setZoom(level: ZoomLevel): void;
1513
+ insertSectionBreak(type: SectionBreakType, options?: {
1514
+ afterSectionIndex?: number;
1515
+ }): void;
1516
+ deleteSectionBreak(sectionIndex: number): void;
1517
+ updateSectionLayout(sectionIndex: number, patch: SectionLayoutPatch): void;
1518
+ setSectionPageNumbering(sectionIndex: number, patch: SectionPageNumberingPatch | null): void;
1519
+ setHeaderFooterLink(sectionIndex: number, params: HeaderFooterLinkPatch): void;
1520
+ setImageLayout(mediaId: string, dimensions: {
1521
+ widthEmu: number;
1522
+ heightEmu: number;
1523
+ }): void;
1524
+ setImageFrame(mediaId: string, offsets: {
1525
+ horizontalOffsetEmu?: number;
1526
+ verticalOffsetEmu?: number;
1527
+ }): void;
1528
+ setWorkflowOverlay(overlay: WorkflowOverlay): void;
1529
+ clearWorkflowOverlay(): void;
1530
+ getWorkflowScopeSnapshot(): WorkflowScopeSnapshot | null;
1531
+ getInteractionGuardSnapshot(): InteractionGuardSnapshot;
1532
+ getWorkflowMarkupSnapshot(): WorkflowMarkupSnapshot;
1533
+ setHostAnnotationOverlay(overlay: HostAnnotationOverlay): void;
1534
+ clearHostAnnotationOverlay(): void;
1535
+ getHostAnnotationSnapshot(): HostAnnotationSnapshot;
1536
+ getWorkflowCandidateRanges(options?: WorkflowCandidateRangeOptions): WorkflowCandidateRange[];
1537
+ replaceWorkflowMarkupText(markupId: string, text: string): void;
1538
+ }
1539
+ interface WordReviewEditorProps {
1540
+ documentId: string;
1541
+ currentUser: EditorUser;
1542
+ initialDocx?: Uint8Array | ArrayBuffer;
1543
+ initialSessionState?: EditorSessionState;
1544
+ initialSnapshot?: PersistedEditorSnapshot;
1545
+ initialSourceLabel?: string;
1546
+ externalDocumentRevision?: string;
1547
+ externalDocSource?: ExternalDocumentSource;
1548
+ loadRevision?: string;
1549
+ loadSourcePolicy?: LoadSourcePolicy;
1550
+ readOnly?: boolean;
1551
+ reviewMode?: "editing" | "review";
1552
+ suggestionsEnabled?: boolean;
1553
+ markupDisplay?: "clean" | "simple" | "all";
1554
+ showReviewPanel?: boolean;
1555
+ chromeVisibility?: Partial<WordReviewEditorChromeVisibility>;
1556
+ hostAdapter?: EditorHostAdapter;
1557
+ datastore?: EditorDatastoreAdapter;
1558
+ autosave?: AutosaveConfig;
1559
+ onEvent?: (event: WordReviewEditorEvent) => void;
1560
+ onWarning?: (warning: EditorWarning) => void;
1561
+ onError?: (error: EditorError) => void;
1562
+ }
1563
+ interface WordReviewEditorChromeVisibility {
1564
+ toolbar: boolean;
1565
+ alerts: boolean;
1566
+ selectionOverlay: boolean;
1567
+ contextToolbars: boolean;
1568
+ pageChrome: boolean;
1569
+ statusBar: boolean;
1570
+ reviewRail: boolean;
1571
+ }
1572
+
1573
+ export { type SaveSessionResult as $, type ActiveListContext as A, type EditorWarning as B, type CaretAffinity as C, type DocumentHeadingSnapshot as D, type EditorSessionState as E, type EditorWarningCode as F, type ExportDocxOptions as G, type ExportResult as H, type ExternalDocumentSource as I, type HeaderFooterLinkPatch as J, type HostAnnotationItem as K, type HostAnnotationKind as L, type HostAnnotationOverlay as M, type HostAnnotationSnapshot as N, type InteractionGuardSnapshot as O, type PersistedEditorSnapshot as P, type LayoutMeasurement as Q, type LoadRequest as R, type LoadResult as S, type LoadSourcePolicy as T, type PageLayoutSnapshot as U, type PageRegionHitTest as V, type WordReviewEditorProps as W, type RuntimeRenderSnapshot as X, type SaveExportParams as Y, type SaveExportResult as Z, type SaveSessionParams as _, type WordReviewEditorRef as a, type MappingResult as a$, type SaveSnapshotParams as a0, type SaveSnapshotResult as a1, type SectionBreakType as a2, type SectionLayoutPatch as a3, type SectionPageNumberingPatch as a4, type SelectionSnapshot as a5, type StyleCatalogEntrySnapshot as a6, type StyleCatalogSnapshot as a7, type SurfaceBlockSnapshot as a8, type SurfaceInlineSegment as a9, type WorkspaceMode as aA, type ZoomLevel as aB, type FormattingAlignment as aC, type InsertImageOptions as aD, type FormattingStateSnapshot as aE, type ProtectionSnapshot as aF, type SelectionSnapshot$1 as aG, type CanonicalDocumentEnvelope as aH, type TransactionMapping as aI, type EditorWarning$1 as aJ, type CommentThreadRecord as aK, type DocumentMode as aL, type FieldSnapshot as aM, type UpdateFieldsOptions as aN, type UpdateFieldsResult as aO, type TocRefreshOptions as aP, type TocRefreshResult as aQ, type InsertTableOptions as aR, type SearchOptions as aS, type SecondaryStorySurface as aT, type Assoc as aU, type BoundaryAssoc as aV, DEFAULT_BOUNDARY_ASSOC as aW, type DetachedAnchor as aX, type DocRange as aY, type EditorAnchorProjection$1 as aZ, MAIN_STORY_TARGET as a_, type SurfaceTableCellSnapshot as aa, type SurfaceTableRowSnapshot as ab, type SurfaceTextMark as ac, type TrackedChangeEntrySnapshot as ad, type TrackedChangesSnapshot as ae, type ViewMode as af, type WordReviewEditorChromeVisibility as ag, type WordReviewEditorEvent as ah, type WorkflowBlockedCommandReason as ai, type WorkflowCandidateRange as aj, type WorkflowCandidateRangeOptions as ak, type WorkflowCommentMarkup as al, type WorkflowFieldMarkup as am, type WorkflowHighlightMarkup as an, type WorkflowMarkupBase as ao, type WorkflowMarkupItem as ap, type WorkflowMarkupKind as aq, type WorkflowMarkupSnapshot as ar, type WorkflowOpaqueFragmentMarkup as as, type WorkflowOverlay as at, type WorkflowProtectedRangeMarkup as au, type WorkflowRevisionMarkup as av, type WorkflowScope as aw, type WorkflowScopeMode as ax, type WorkflowScopeSnapshot as ay, type WorkflowWorkItem as az, type ActiveNoteContext as b, type MappingStep as b0, type NodeAnchor as b1, type Position as b2, type RangeAnchor as b3, areAnchorsEqual as b4, createDetachedAnchor as b5, createEmptyMapping as b6, createNodeAnchor as b7, createRangeAnchor as b8, getEffectiveRange as b9, createCanonicalDocumentId as bA, createDefaultCanonicalDocument as bB, createEditorState as bC, createEmptyCompatibilityReport as bD, createEmptyReviewStore as bE, createPersistedEditorSnapshot as bF, createSelectionSnapshot as bG, deriveDocumentStats as bH, deriveRenderSnapshot as bI, normalizeCommentThreadRecord as bJ, type EffectiveSelectionMode as bK, type ExportDelivery as bL, type FieldEntrySnapshot as bM, type FieldFamily as bN, type FieldRefreshStatus as bO, type FormattingBreadcrumbItem as bP, type ProtectionRange as bQ, type SearchResultSnapshot as bR, type SupportedFieldFamily as bS, mapAnchor as ba, mapPosition as bb, mapRange as bc, normalizeRange as bd, storyTargetsEqual as be, type CommandStateSnapshot$1 as bf, type CommentEntryRecord as bg, type CommentResolutionRecord as bh, type CommentSidebarSnapshot$1 as bi, type CompatibilityFeatureClass$1 as bj, type CompatibilityFeatureEntry$1 as bk, type CompatibilityPanelSnapshot$1 as bl, type CompatibilityReport$1 as bm, type CreateEditorStateOptions as bn, type DocumentStats$1 as bo, type EditorError$1 as bp, type EditorRuntimeState as bq, type EditorState as br, type EditorWarningCode$1 as bs, type PersistedEditorSnapshot$1 as bt, type ReviewStore as bu, type RevisionMetadataRecord as bv, type RevisionRecord as bw, type RuntimePhase as bx, type RuntimeRenderSnapshot$1 as by, type TrackedChangesSnapshot$1 as bz, type AddCommentParams as c, type AutosaveConfig as d, type AutosaveState as e, type CommandStateSnapshot as f, type CommentSidebarSnapshot as g, type CommentSidebarThreadEntrySnapshot as h, type CommentSidebarThreadSnapshot as i, type CompatibilityFeatureClass as j, type CompatibilityFeatureEntry as k, type CompatibilityPanelSnapshot as l, type CompatibilityReport as m, type DocumentNavigationSnapshot as n, type DocumentPageSnapshot as o, type DocumentStats as p, type EditorAnchorProjection as q, type EditorDatastoreAdapter as r, type EditorError as s, type EditorErrorCode as t, type EditorHostAdapter as u, type EditorStoryTarget as v, type EditorSurfaceSnapshot as w, type EditorTelemetryEvent as x, type EditorUser as y, type EditorViewStateSnapshot as z };