@beyondwork/docx-react-component 1.0.29 → 1.0.30

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 (381) hide show
  1. package/package.json +65 -96
  2. package/src/README.md +85 -0
  3. package/src/api/README.md +26 -0
  4. package/src/api/public-types.ts +1952 -0
  5. package/src/api/session-state.ts +62 -0
  6. package/src/compare/diff-engine.ts +623 -0
  7. package/src/compare/export-redlines.ts +280 -0
  8. package/src/compare/index.ts +25 -0
  9. package/src/compare/snapshot.ts +97 -0
  10. package/src/component-inventory.md +99 -0
  11. package/src/core/README.md +10 -0
  12. package/src/core/commands/README.md +3 -0
  13. package/{dist/chunk-TJBP2K4T.js → src/core/commands/formatting-commands.ts} +536 -196
  14. package/src/core/commands/image-commands.ts +373 -0
  15. package/src/core/commands/index.ts +1879 -0
  16. package/src/core/commands/list-commands.ts +565 -0
  17. package/src/core/commands/paragraph-layout-commands.ts +339 -0
  18. package/src/core/commands/review-commands.ts +108 -0
  19. package/{dist/core/commands/section-layout-commands.cjs → src/core/commands/section-layout-commands.ts} +340 -137
  20. package/src/core/commands/structural-helpers.ts +309 -0
  21. package/{dist/core/commands/style-commands.cjs → src/core/commands/style-commands.ts} +113 -65
  22. package/src/core/commands/table-structure-commands.ts +854 -0
  23. package/{dist/chunk-UZXBISGO.js → src/core/commands/text-commands.ts} +142 -86
  24. package/src/core/schema/README.md +3 -0
  25. package/src/core/schema/text-schema.ts +516 -0
  26. package/src/core/search/search-text.ts +357 -0
  27. package/src/core/selection/README.md +3 -0
  28. package/src/core/selection/mapping.ts +289 -0
  29. package/src/core/selection/review-anchors.ts +183 -0
  30. package/src/core/state/README.md +3 -0
  31. package/src/core/state/editor-state.ts +892 -0
  32. package/src/core/state/text-transaction.ts +869 -0
  33. package/src/formats/xlsx/io/parse-shared-strings.ts +41 -0
  34. package/src/formats/xlsx/io/parse-sheet.ts +459 -0
  35. package/src/formats/xlsx/io/parse-styles.ts +59 -0
  36. package/src/formats/xlsx/io/parse-workbook.ts +75 -0
  37. package/src/formats/xlsx/io/serialize-shared-strings.ts +72 -0
  38. package/src/formats/xlsx/io/serialize-sheet.ts +333 -0
  39. package/src/formats/xlsx/io/serialize-styles.ts +98 -0
  40. package/src/formats/xlsx/io/serialize-workbook.ts +429 -0
  41. package/src/formats/xlsx/io/xlsx-session.ts +314 -0
  42. package/src/formats/xlsx/model/cell.ts +189 -0
  43. package/src/formats/xlsx/model/sheet.ts +326 -0
  44. package/src/formats/xlsx/model/styles.ts +118 -0
  45. package/src/formats/xlsx/model/workbook.ts +453 -0
  46. package/src/formats/xlsx/runtime/cell-commands.ts +567 -0
  47. package/src/formats/xlsx/runtime/sheet-commands.ts +206 -0
  48. package/src/formats/xlsx/runtime/workbook-runtime.ts +177 -0
  49. package/src/formats/xlsx/runtime/workbook-transaction.ts +822 -0
  50. package/src/index.ts +142 -0
  51. package/src/io/README.md +10 -0
  52. package/src/io/docx-session.ts +3175 -0
  53. package/src/io/export/README.md +3 -0
  54. package/src/io/export/export-session.ts +220 -0
  55. package/src/io/export/minimal-docx.ts +115 -0
  56. package/src/io/export/reattach-preserved-parts.ts +54 -0
  57. package/src/io/export/serialize-comments.ts +947 -0
  58. package/src/io/export/serialize-footnotes.ts +394 -0
  59. package/src/io/export/serialize-headers-footers.ts +368 -0
  60. package/src/io/export/serialize-main-document.ts +1342 -0
  61. package/src/io/export/serialize-numbering.ts +218 -0
  62. package/src/io/export/serialize-revisions.ts +389 -0
  63. package/src/io/export/serialize-runtime-revisions.ts +463 -0
  64. package/src/io/export/serialize-tables.ts +174 -0
  65. package/src/io/export/split-review-boundaries.ts +356 -0
  66. package/src/io/export/split-story-blocks-for-runtime-revisions.ts +252 -0
  67. package/src/io/export/table-properties-xml.ts +318 -0
  68. package/src/io/normalize/README.md +3 -0
  69. package/src/io/normalize/normalize-text.ts +670 -0
  70. package/src/io/ooxml/README.md +3 -0
  71. package/src/io/ooxml/highlight-colors.ts +39 -0
  72. package/src/io/ooxml/numbering-sentinels.ts +44 -0
  73. package/src/io/ooxml/parse-comments.ts +852 -0
  74. package/src/io/ooxml/parse-complex-content.ts +287 -0
  75. package/src/io/ooxml/parse-fields.ts +834 -0
  76. package/src/io/ooxml/parse-footnotes.ts +952 -0
  77. package/src/io/ooxml/parse-headers-footers.ts +1212 -0
  78. package/src/io/ooxml/parse-inline-media.ts +461 -0
  79. package/src/io/ooxml/parse-main-document.ts +2947 -0
  80. package/src/io/ooxml/parse-numbering.ts +747 -0
  81. package/src/io/ooxml/parse-revisions.ts +1045 -0
  82. package/src/io/ooxml/parse-settings.ts +184 -0
  83. package/src/io/ooxml/parse-shapes.ts +296 -0
  84. package/src/io/ooxml/parse-styles.ts +639 -0
  85. package/src/io/ooxml/parse-tables.ts +627 -0
  86. package/src/io/ooxml/parse-theme.ts +346 -0
  87. package/src/io/ooxml/part-manifest.ts +136 -0
  88. package/src/io/ooxml/revision-boundaries.ts +475 -0
  89. package/src/io/ooxml/workflow-payload.ts +544 -0
  90. package/src/io/opc/README.md +3 -0
  91. package/src/io/opc/corrupt-package.ts +166 -0
  92. package/src/io/opc/docx-package.ts +74 -0
  93. package/src/io/opc/package-reader.ts +325 -0
  94. package/src/io/opc/package-writer.ts +273 -0
  95. package/src/io/source-package-provenance.ts +241 -0
  96. package/{dist/chunk-RMH72RZI.js → src/legal/bookmarks.ts} +130 -44
  97. package/src/legal/cross-references.ts +414 -0
  98. package/src/legal/defined-terms.ts +203 -0
  99. package/src/legal/index.ts +32 -0
  100. package/src/legal/signature-blocks.ts +259 -0
  101. package/src/model/README.md +3 -0
  102. package/src/model/canonical-document.ts +2722 -0
  103. package/src/model/cds-1.0.0.ts +212 -0
  104. package/src/model/snapshot.ts +760 -0
  105. package/src/preservation/README.md +3 -0
  106. package/src/preservation/markup-compatibility.ts +48 -0
  107. package/src/preservation/opaque-fragment-store.ts +89 -0
  108. package/src/preservation/opaque-region.ts +233 -0
  109. package/src/preservation/package-preservation.ts +113 -0
  110. package/src/preservation/preserved-part-manifest.ts +56 -0
  111. package/src/preservation/relationship-retention.ts +57 -0
  112. package/src/preservation/store.ts +255 -0
  113. package/src/review/README.md +16 -0
  114. package/src/review/store/README.md +3 -0
  115. package/src/review/store/comment-anchors.ts +70 -0
  116. package/src/review/store/comment-remapping.ts +154 -0
  117. package/src/review/store/comment-store.ts +349 -0
  118. package/src/review/store/comment-thread.ts +109 -0
  119. package/src/review/store/revision-actions.ts +423 -0
  120. package/src/review/store/revision-store.ts +323 -0
  121. package/src/review/store/revision-types.ts +182 -0
  122. package/src/review/store/runtime-comment-store.ts +43 -0
  123. package/src/runtime/README.md +3 -0
  124. package/src/runtime/ai-action-policy.ts +764 -0
  125. package/src/runtime/context-analytics.ts +824 -0
  126. package/src/runtime/document-layout.ts +332 -0
  127. package/src/runtime/document-locations.ts +521 -0
  128. package/src/runtime/document-navigation.ts +616 -0
  129. package/src/runtime/document-outline.ts +440 -0
  130. package/src/runtime/document-runtime.ts +4055 -0
  131. package/src/runtime/document-search.ts +145 -0
  132. package/src/runtime/event-refresh-hints.ts +137 -0
  133. package/src/runtime/numbering-prefix.ts +244 -0
  134. package/src/runtime/page-layout-estimation.ts +305 -0
  135. package/src/runtime/read-only-diagnostics-runtime.ts +241 -0
  136. package/src/runtime/resolved-numbering-geometry.ts +293 -0
  137. package/src/runtime/review-runtime.ts +44 -0
  138. package/src/runtime/revision-runtime.ts +107 -0
  139. package/src/runtime/session-capabilities.ts +192 -0
  140. package/src/runtime/story-context.ts +164 -0
  141. package/src/runtime/story-targeting.ts +162 -0
  142. package/src/runtime/suggestions-snapshot.ts +137 -0
  143. package/src/runtime/surface-projection.ts +1553 -0
  144. package/src/runtime/table-commands.ts +173 -0
  145. package/src/runtime/table-schema.ts +309 -0
  146. package/src/runtime/table-style-resolver.ts +409 -0
  147. package/src/runtime/view-state.ts +493 -0
  148. package/src/runtime/virtualized-rendering.ts +258 -0
  149. package/src/runtime/workflow-markup.ts +393 -0
  150. package/src/ui/README.md +30 -0
  151. package/src/ui/WordReviewEditor.tsx +5268 -0
  152. package/src/ui/browser-export.ts +52 -0
  153. package/src/ui/comments/README.md +3 -0
  154. package/src/ui/compatibility/README.md +3 -0
  155. package/src/ui/editor-command-bag.ts +127 -0
  156. package/src/ui/editor-runtime-boundary.ts +1558 -0
  157. package/src/ui/editor-shell-view.tsx +144 -0
  158. package/src/ui/editor-surface/README.md +3 -0
  159. package/src/ui/editor-surface-controller.tsx +66 -0
  160. package/src/ui/headless/comment-decoration-model.ts +124 -0
  161. package/src/ui/headless/preserve-editor-selection.ts +5 -0
  162. package/src/ui/headless/revision-decoration-model.ts +128 -0
  163. package/src/ui/headless/selection-helpers.ts +54 -0
  164. package/src/ui/headless/selection-tool-context.ts +19 -0
  165. package/src/ui/headless/selection-tool-resolver.ts +752 -0
  166. package/src/ui/headless/selection-tool-types.ts +129 -0
  167. package/src/ui/headless/selection-toolbar-model.ts +11 -0
  168. package/src/ui/headless/use-editor-keyboard.ts +103 -0
  169. package/src/ui/review/README.md +3 -0
  170. package/src/ui/runtime-shortcut-dispatch.ts +365 -0
  171. package/src/ui/runtime-snapshot-selectors.ts +197 -0
  172. package/src/ui/shared/revision-filters.ts +31 -0
  173. package/src/ui/status/README.md +3 -0
  174. package/src/ui/theme/README.md +3 -0
  175. package/src/ui/toolbar/README.md +3 -0
  176. package/src/ui/workflow-surface-blocked-rails.ts +94 -0
  177. package/src/ui-tailwind/chrome/chrome-preset-model.ts +107 -0
  178. package/src/ui-tailwind/chrome/chrome-preset-toolbar.tsx +15 -0
  179. package/src/ui-tailwind/chrome/review-queue-bar.tsx +97 -0
  180. package/src/ui-tailwind/chrome/tw-alert-banner.tsx +64 -0
  181. package/src/ui-tailwind/chrome/tw-context-analytics-summary.tsx +122 -0
  182. package/src/ui-tailwind/chrome/tw-image-context-toolbar.tsx +121 -0
  183. package/src/ui-tailwind/chrome/tw-layout-panel.tsx +114 -0
  184. package/src/ui-tailwind/chrome/tw-object-context-toolbar.tsx +30 -0
  185. package/src/ui-tailwind/chrome/tw-page-ruler.tsx +365 -0
  186. package/src/ui-tailwind/chrome/tw-selection-tool-blocked.tsx +23 -0
  187. package/src/ui-tailwind/chrome/tw-selection-tool-comment.tsx +35 -0
  188. package/src/ui-tailwind/chrome/tw-selection-tool-formatting.tsx +37 -0
  189. package/src/ui-tailwind/chrome/tw-selection-tool-host.tsx +298 -0
  190. package/src/ui-tailwind/chrome/tw-selection-tool-structure.tsx +116 -0
  191. package/src/ui-tailwind/chrome/tw-selection-tool-suggestion.tsx +29 -0
  192. package/src/ui-tailwind/chrome/tw-selection-tool-workflow.tsx +27 -0
  193. package/src/ui-tailwind/chrome/tw-selection-toolbar.tsx +186 -0
  194. package/src/ui-tailwind/chrome/tw-suggestion-card.tsx +139 -0
  195. package/src/ui-tailwind/chrome/tw-table-context-toolbar.tsx +200 -0
  196. package/src/ui-tailwind/chrome/tw-unsaved-modal.tsx +58 -0
  197. package/src/ui-tailwind/chrome/use-before-unload.ts +20 -0
  198. package/src/ui-tailwind/editor-surface/perf-probe.ts +179 -0
  199. package/src/ui-tailwind/editor-surface/pm-command-bridge.ts +189 -0
  200. package/src/ui-tailwind/editor-surface/pm-contextual-ui.ts +31 -0
  201. package/src/ui-tailwind/editor-surface/pm-decorations.ts +411 -0
  202. package/src/ui-tailwind/editor-surface/pm-position-map.ts +123 -0
  203. package/src/ui-tailwind/editor-surface/pm-schema.ts +927 -0
  204. package/src/ui-tailwind/editor-surface/pm-state-from-snapshot.ts +567 -0
  205. package/src/ui-tailwind/editor-surface/search-plugin.ts +168 -0
  206. package/src/ui-tailwind/editor-surface/surface-build-keys.ts +65 -0
  207. package/src/ui-tailwind/editor-surface/tw-caret.tsx +12 -0
  208. package/src/ui-tailwind/editor-surface/tw-editor-surface.tsx +150 -0
  209. package/src/ui-tailwind/editor-surface/tw-inline-token.tsx +129 -0
  210. package/src/ui-tailwind/editor-surface/tw-opaque-block.tsx +58 -0
  211. package/src/ui-tailwind/editor-surface/tw-paragraph-block.tsx +151 -0
  212. package/src/ui-tailwind/editor-surface/tw-prosemirror-surface.tsx +1047 -0
  213. package/src/ui-tailwind/editor-surface/tw-segment-view.tsx +111 -0
  214. package/src/ui-tailwind/editor-surface/tw-table-node-view.tsx +503 -0
  215. package/src/ui-tailwind/index.ts +62 -0
  216. package/src/ui-tailwind/page-chrome-model.ts +27 -0
  217. package/src/ui-tailwind/review/tw-comment-sidebar.tsx +406 -0
  218. package/src/ui-tailwind/review/tw-health-panel.tsx +149 -0
  219. package/src/ui-tailwind/review/tw-review-rail.tsx +122 -0
  220. package/src/ui-tailwind/review/tw-revision-sidebar.tsx +164 -0
  221. package/src/ui-tailwind/status/tw-status-bar.tsx +65 -0
  222. package/{dist → src}/ui-tailwind/theme/editor-theme.css +58 -40
  223. package/src/ui-tailwind/toolbar/tw-toolbar-icon-button.tsx +52 -0
  224. package/src/ui-tailwind/toolbar/tw-toolbar.tsx +1133 -0
  225. package/src/ui-tailwind/tw-review-workspace.tsx +1460 -0
  226. package/src/validation/README.md +3 -0
  227. package/src/validation/compatibility-engine.ts +878 -0
  228. package/src/validation/compatibility-report.ts +161 -0
  229. package/src/validation/diagnostics.ts +204 -0
  230. package/src/validation/docx-comment-proof.ts +720 -0
  231. package/src/validation/import-diagnostics.ts +128 -0
  232. package/src/validation/low-priority-word-surfaces.ts +373 -0
  233. package/dist/canonical-document-BLEbzL2J.d.cts +0 -844
  234. package/dist/canonical-document-BLEbzL2J.d.ts +0 -844
  235. package/dist/chunk-2FJS5GZM.js +0 -763
  236. package/dist/chunk-2FJS5GZM.js.map +0 -1
  237. package/dist/chunk-2OQBZS3F.js +0 -446
  238. package/dist/chunk-2OQBZS3F.js.map +0 -1
  239. package/dist/chunk-2S7W4KFO.js +0 -127
  240. package/dist/chunk-2S7W4KFO.js.map +0 -1
  241. package/dist/chunk-2TG72QSW.js +0 -3874
  242. package/dist/chunk-2TG72QSW.js.map +0 -1
  243. package/dist/chunk-36QNIZBO.js +0 -532
  244. package/dist/chunk-36QNIZBO.js.map +0 -1
  245. package/dist/chunk-4AQOYAW4.js +0 -3069
  246. package/dist/chunk-4AQOYAW4.js.map +0 -1
  247. package/dist/chunk-4D5EWJ3P.js +0 -77
  248. package/dist/chunk-4D5EWJ3P.js.map +0 -1
  249. package/dist/chunk-5FN54NDH.js +0 -2257
  250. package/dist/chunk-5FN54NDH.js.map +0 -1
  251. package/dist/chunk-BOYGQYRQ.js +0 -7306
  252. package/dist/chunk-BOYGQYRQ.js.map +0 -1
  253. package/dist/chunk-CN3XMECL.js +0 -212
  254. package/dist/chunk-CN3XMECL.js.map +0 -1
  255. package/dist/chunk-EBI3BX6U.js +0 -164
  256. package/dist/chunk-EBI3BX6U.js.map +0 -1
  257. package/dist/chunk-EILUG3VB.js +0 -1275
  258. package/dist/chunk-EILUG3VB.js.map +0 -1
  259. package/dist/chunk-FUDY333O.js +0 -70
  260. package/dist/chunk-FUDY333O.js.map +0 -1
  261. package/dist/chunk-GBVOWFIK.js +0 -1237
  262. package/dist/chunk-GBVOWFIK.js.map +0 -1
  263. package/dist/chunk-H4TQ3H3Y.js +0 -262
  264. package/dist/chunk-H4TQ3H3Y.js.map +0 -1
  265. package/dist/chunk-JGB3IXZO.js +0 -189
  266. package/dist/chunk-JGB3IXZO.js.map +0 -1
  267. package/dist/chunk-KD2QRQPY.js +0 -4342
  268. package/dist/chunk-KD2QRQPY.js.map +0 -1
  269. package/dist/chunk-KLMXQVYK.js +0 -369
  270. package/dist/chunk-KLMXQVYK.js.map +0 -1
  271. package/dist/chunk-KZUG5KFQ.js +0 -214
  272. package/dist/chunk-KZUG5KFQ.js.map +0 -1
  273. package/dist/chunk-QDAQ4CJU.js +0 -345
  274. package/dist/chunk-QDAQ4CJU.js.map +0 -1
  275. package/dist/chunk-RMH72RZI.js.map +0 -1
  276. package/dist/chunk-SWKWQZXM.js +0 -117
  277. package/dist/chunk-SWKWQZXM.js.map +0 -1
  278. package/dist/chunk-TJBP2K4T.js.map +0 -1
  279. package/dist/chunk-TLCEAQDQ.js +0 -542
  280. package/dist/chunk-TLCEAQDQ.js.map +0 -1
  281. package/dist/chunk-UZXBISGO.js.map +0 -1
  282. package/dist/chunk-WGBAKP3Q.js +0 -3220
  283. package/dist/chunk-WGBAKP3Q.js.map +0 -1
  284. package/dist/compare/index.cjs +0 -5475
  285. package/dist/compare/index.cjs.map +0 -1
  286. package/dist/compare/index.d.cts +0 -114
  287. package/dist/compare/index.d.ts +0 -114
  288. package/dist/compare/index.js +0 -731
  289. package/dist/compare/index.js.map +0 -1
  290. package/dist/core/commands/formatting-commands.cjs +0 -828
  291. package/dist/core/commands/formatting-commands.cjs.map +0 -1
  292. package/dist/core/commands/formatting-commands.d.cts +0 -63
  293. package/dist/core/commands/formatting-commands.d.ts +0 -63
  294. package/dist/core/commands/formatting-commands.js +0 -37
  295. package/dist/core/commands/formatting-commands.js.map +0 -1
  296. package/dist/core/commands/image-commands.cjs +0 -2023
  297. package/dist/core/commands/image-commands.cjs.map +0 -1
  298. package/dist/core/commands/image-commands.d.cts +0 -58
  299. package/dist/core/commands/image-commands.d.ts +0 -58
  300. package/dist/core/commands/image-commands.js +0 -18
  301. package/dist/core/commands/image-commands.js.map +0 -1
  302. package/dist/core/commands/section-layout-commands.cjs.map +0 -1
  303. package/dist/core/commands/section-layout-commands.d.cts +0 -62
  304. package/dist/core/commands/section-layout-commands.d.ts +0 -62
  305. package/dist/core/commands/section-layout-commands.js +0 -21
  306. package/dist/core/commands/section-layout-commands.js.map +0 -1
  307. package/dist/core/commands/style-commands.cjs.map +0 -1
  308. package/dist/core/commands/style-commands.d.cts +0 -13
  309. package/dist/core/commands/style-commands.d.ts +0 -13
  310. package/dist/core/commands/style-commands.js +0 -9
  311. package/dist/core/commands/style-commands.js.map +0 -1
  312. package/dist/core/commands/table-structure-commands.cjs +0 -1883
  313. package/dist/core/commands/table-structure-commands.cjs.map +0 -1
  314. package/dist/core/commands/table-structure-commands.d.cts +0 -59
  315. package/dist/core/commands/table-structure-commands.d.ts +0 -59
  316. package/dist/core/commands/table-structure-commands.js +0 -12
  317. package/dist/core/commands/table-structure-commands.js.map +0 -1
  318. package/dist/core/commands/text-commands.cjs +0 -2391
  319. package/dist/core/commands/text-commands.cjs.map +0 -1
  320. package/dist/core/commands/text-commands.d.cts +0 -24
  321. package/dist/core/commands/text-commands.d.ts +0 -24
  322. package/dist/core/commands/text-commands.js +0 -28
  323. package/dist/core/commands/text-commands.js.map +0 -1
  324. package/dist/core/selection/mapping.cjs +0 -200
  325. package/dist/core/selection/mapping.cjs.map +0 -1
  326. package/dist/core/selection/mapping.d.cts +0 -2
  327. package/dist/core/selection/mapping.d.ts +0 -2
  328. package/dist/core/selection/mapping.js +0 -31
  329. package/dist/core/selection/mapping.js.map +0 -1
  330. package/dist/core/state/editor-state.cjs +0 -2278
  331. package/dist/core/state/editor-state.cjs.map +0 -1
  332. package/dist/core/state/editor-state.d.cts +0 -2
  333. package/dist/core/state/editor-state.d.ts +0 -2
  334. package/dist/core/state/editor-state.js +0 -26
  335. package/dist/core/state/editor-state.js.map +0 -1
  336. package/dist/index.cjs +0 -38553
  337. package/dist/index.cjs.map +0 -1
  338. package/dist/index.d.cts +0 -15
  339. package/dist/index.d.ts +0 -15
  340. package/dist/index.js +0 -7856
  341. package/dist/index.js.map +0 -1
  342. package/dist/io/docx-session.cjs +0 -16236
  343. package/dist/io/docx-session.cjs.map +0 -1
  344. package/dist/io/docx-session.d.cts +0 -21
  345. package/dist/io/docx-session.d.ts +0 -21
  346. package/dist/io/docx-session.js +0 -18
  347. package/dist/io/docx-session.js.map +0 -1
  348. package/dist/legal/index.cjs +0 -3900
  349. package/dist/legal/index.cjs.map +0 -1
  350. package/dist/legal/index.d.cts +0 -86
  351. package/dist/legal/index.d.ts +0 -86
  352. package/dist/legal/index.js +0 -616
  353. package/dist/legal/index.js.map +0 -1
  354. package/dist/public-types-7ZL_94cz.d.ts +0 -1573
  355. package/dist/public-types-CeMaDueh.d.cts +0 -1573
  356. package/dist/public-types.cjs +0 -19
  357. package/dist/public-types.cjs.map +0 -1
  358. package/dist/public-types.d.cts +0 -2
  359. package/dist/public-types.d.ts +0 -2
  360. package/dist/public-types.js +0 -1
  361. package/dist/public-types.js.map +0 -1
  362. package/dist/runtime/document-runtime.cjs +0 -11140
  363. package/dist/runtime/document-runtime.cjs.map +0 -1
  364. package/dist/runtime/document-runtime.d.cts +0 -231
  365. package/dist/runtime/document-runtime.d.ts +0 -231
  366. package/dist/runtime/document-runtime.js +0 -21
  367. package/dist/runtime/document-runtime.js.map +0 -1
  368. package/dist/structural-helpers-CilgOVhh.d.cts +0 -10
  369. package/dist/structural-helpers-q0Gd-eBN.d.ts +0 -10
  370. package/dist/ui-tailwind/editor-surface/search-plugin.cjs +0 -313
  371. package/dist/ui-tailwind/editor-surface/search-plugin.cjs.map +0 -1
  372. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +0 -67
  373. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +0 -67
  374. package/dist/ui-tailwind/editor-surface/search-plugin.js +0 -23
  375. package/dist/ui-tailwind/editor-surface/search-plugin.js.map +0 -1
  376. package/dist/ui-tailwind/index.cjs +0 -4833
  377. package/dist/ui-tailwind/index.cjs.map +0 -1
  378. package/dist/ui-tailwind/index.d.cts +0 -617
  379. package/dist/ui-tailwind/index.d.ts +0 -617
  380. package/dist/ui-tailwind/index.js +0 -575
  381. package/dist/ui-tailwind/index.js.map +0 -1
@@ -0,0 +1,1952 @@
1
+ import type { PersistedEditorSnapshot as RuntimePersistedEditorSnapshot } from "../core/state/editor-state.ts";
2
+ import type {
3
+ FieldFamily as FieldFamilyType,
4
+ FieldRefreshStatus as FieldRefreshStatusType,
5
+ SupportedFieldFamily as SupportedFieldFamilyType,
6
+ } from "../model/canonical-document.ts";
7
+
8
+ export type FieldFamily = FieldFamilyType;
9
+ export type FieldRefreshStatus = FieldRefreshStatusType;
10
+ export type SupportedFieldFamily = SupportedFieldFamilyType;
11
+
12
+ export type ExternalDocumentSource =
13
+ | {
14
+ kind: "docx";
15
+ bytes: Uint8Array | ArrayBuffer;
16
+ sourceLabel?: string;
17
+ }
18
+ | {
19
+ kind: "session";
20
+ sessionState: EditorSessionState;
21
+ sourceLabel?: string;
22
+ }
23
+ | {
24
+ kind: "snapshot";
25
+ snapshot: PersistedEditorSnapshot;
26
+ sourceLabel?: string;
27
+ };
28
+
29
+ export type LoadSourcePolicy = "prefer-saved-state" | "prefer-source-package";
30
+
31
+ export interface LoadRequest {
32
+ documentId: string;
33
+ loadRevision?: string;
34
+ loadSourcePolicy?: LoadSourcePolicy;
35
+ }
36
+
37
+ export interface EditorUser {
38
+ userId: string;
39
+ displayName: string;
40
+ email?: string;
41
+ avatarUrl?: string;
42
+ }
43
+
44
+ export type EditorAnchorProjection =
45
+ | {
46
+ kind: "range";
47
+ from: number;
48
+ to: number;
49
+ assoc: {
50
+ start: -1 | 1;
51
+ end: -1 | 1;
52
+ };
53
+ }
54
+ | {
55
+ kind: "node";
56
+ at: number;
57
+ assoc: -1 | 1;
58
+ }
59
+ | {
60
+ kind: "detached";
61
+ lastKnownRange: {
62
+ from: number;
63
+ to: number;
64
+ };
65
+ reason: "deleted" | "invalidatedByStructureChange" | "importAmbiguity";
66
+ };
67
+
68
+ export type EditorStoryTarget =
69
+ | { kind: "main" }
70
+ | {
71
+ kind: "header";
72
+ relationshipId: string;
73
+ variant: "default" | "first" | "even";
74
+ sectionIndex?: number;
75
+ }
76
+ | {
77
+ kind: "footer";
78
+ relationshipId: string;
79
+ variant: "default" | "first" | "even";
80
+ sectionIndex?: number;
81
+ }
82
+ | { kind: "footnote"; noteId: string }
83
+ | { kind: "endnote"; noteId: string };
84
+
85
+ export interface SelectionSnapshot {
86
+ anchor: number;
87
+ head: number;
88
+ isCollapsed: boolean;
89
+ activeRange: EditorAnchorProjection;
90
+ storyTarget?: EditorStoryTarget;
91
+ }
92
+
93
+ export interface PageLayoutSnapshot {
94
+ sectionIndex: number;
95
+ sectionType?: "continuous" | "nextPage" | "evenPage" | "oddPage" | "nextColumn";
96
+ pageWidth: number;
97
+ pageHeight: number;
98
+ marginTop: number;
99
+ marginBottom: number;
100
+ marginLeft: number;
101
+ marginRight: number;
102
+ headerMargin: number;
103
+ footerMargin: number;
104
+ gutter: number;
105
+ orientation: "portrait" | "landscape";
106
+ columns: number;
107
+ differentFirstPage: boolean;
108
+ differentOddEvenPages: boolean;
109
+ pageNumbering?: {
110
+ format?: string;
111
+ start?: number;
112
+ chapterStyle?: string;
113
+ chapterSeparator?: string;
114
+ };
115
+ lineNumbering?: {
116
+ countBy?: number;
117
+ start?: number;
118
+ distance?: number;
119
+ restart?: "newPage" | "newSection" | "continuous";
120
+ };
121
+ pageBorders?: {
122
+ top?: { value?: string; size?: number; space?: number; color?: string };
123
+ left?: { value?: string; size?: number; space?: number; color?: string };
124
+ bottom?: { value?: string; size?: number; space?: number; color?: string };
125
+ right?: { value?: string; size?: number; space?: number; color?: string };
126
+ offsetFrom?: "page" | "text";
127
+ display?: "allPages" | "firstPage" | "notFirstPage";
128
+ zOrder?: "front" | "back";
129
+ };
130
+ documentGrid?: {
131
+ type?: "default" | "lines" | "linesAndChars" | "snapToChars";
132
+ linePitch?: number;
133
+ charSpace?: number;
134
+ };
135
+ columnDefinitions: Array<{ width: number; space?: number }>;
136
+ equalWidthColumns: boolean;
137
+ columnSeparator: boolean;
138
+ headerVariants: Array<{ variant: "default" | "first" | "even"; relationshipId: string }>;
139
+ footerVariants: Array<{ variant: "default" | "first" | "even"; relationshipId: string }>;
140
+ }
141
+
142
+ export type WorkspaceMode = "canvas" | "page";
143
+
144
+ export type ZoomLevel = "pageWidth" | "onePage" | number;
145
+
146
+ export type SectionBreakType =
147
+ | "nextPage"
148
+ | "continuous"
149
+ | "evenPage"
150
+ | "oddPage"
151
+ | "nextColumn";
152
+
153
+ export interface SectionLayoutPatch {
154
+ pageSize?: Partial<{
155
+ width: number;
156
+ height: number;
157
+ orientation: "portrait" | "landscape";
158
+ }>;
159
+ pageMargins?: Partial<{
160
+ top: number;
161
+ right: number;
162
+ bottom: number;
163
+ left: number;
164
+ header: number;
165
+ footer: number;
166
+ gutter: number;
167
+ }>;
168
+ columns?: Partial<{
169
+ count: number;
170
+ space: number;
171
+ equalWidth: boolean;
172
+ columns: Array<{ width: number; space?: number }>;
173
+ separator: boolean;
174
+ }>;
175
+ titlePage?: boolean;
176
+ sectionType?: SectionBreakType;
177
+ }
178
+
179
+ export interface SectionPageNumberingPatch {
180
+ format?: string | null;
181
+ start?: number | null;
182
+ chapterStyle?: string | null;
183
+ chapterSeparator?: string | null;
184
+ }
185
+
186
+ export interface HeaderFooterLinkPatch {
187
+ kind: "header" | "footer";
188
+ variant: "default" | "first" | "even";
189
+ linkToPrevious: boolean;
190
+ relationshipId?: string | null;
191
+ }
192
+
193
+ export interface DocumentStats {
194
+ storyLength: number;
195
+ commentCount: number;
196
+ revisionCount: number;
197
+ opaqueFragmentCount: number;
198
+ }
199
+
200
+ export interface CommentSidebarSnapshot {
201
+ activeCommentId?: string;
202
+ openCommentIds: string[];
203
+ resolvedCommentIds: string[];
204
+ detachedCommentIds: string[];
205
+ totalCount: number;
206
+ threads: CommentSidebarThreadSnapshot[];
207
+ }
208
+
209
+ export interface CommentSidebarThreadEntrySnapshot {
210
+ entryId: string;
211
+ authorId: string;
212
+ body: string;
213
+ createdAt: string;
214
+ }
215
+
216
+ export interface CommentSidebarThreadSnapshot {
217
+ commentId: string;
218
+ status: "open" | "resolved" | "detached";
219
+ anchor: EditorAnchorProjection;
220
+ excerpt: string;
221
+ entryCount: number;
222
+ entries: CommentSidebarThreadEntrySnapshot[];
223
+ createdAt: string;
224
+ createdBy: string;
225
+ warningCount: number;
226
+ anchorLabel: string;
227
+ detachedReason?: "incomplete-markers" | "multi-paragraph" | "opaque-region" | "revision-overlap";
228
+ actionabilityNote?: string;
229
+ isActive: boolean;
230
+ resolvedAt?: string;
231
+ resolvedBy?: string;
232
+ }
233
+
234
+ export interface TrackedChangeEntrySnapshot {
235
+ revisionId: string;
236
+ kind: "insertion" | "deletion" | "formatting" | "move" | "property-change";
237
+ source?: "runtime" | "import";
238
+ suggestionId?: string;
239
+ semanticKind?:
240
+ | "insertion"
241
+ | "deletion"
242
+ | "replacement"
243
+ | "formatting-change"
244
+ | "paragraph-property-change"
245
+ | "structural-change"
246
+ | "object-change";
247
+ linkedRevisionIds?: string[];
248
+ predecessorSuggestionId?: string;
249
+ label: string;
250
+ status: "active" | "accepted" | "rejected" | "detached";
251
+ actionability: "actionable" | "preserve-only";
252
+ storyTarget?: EditorStoryTarget;
253
+ importedRevisionForm?:
254
+ | "run-insertion"
255
+ | "run-deletion"
256
+ | "paragraph-insertion"
257
+ | "paragraph-deletion";
258
+ anchor: EditorAnchorProjection;
259
+ anchorLabel: string;
260
+ createdAt: string;
261
+ authorId: string;
262
+ warningCount: number;
263
+ canAccept: boolean;
264
+ canReject: boolean;
265
+ preserveOnlyReason?: string;
266
+ excerpt?: string;
267
+ detail?: string;
268
+ }
269
+
270
+ export interface TrackedChangesSnapshot {
271
+ pendingChangeIds: string[];
272
+ acceptedChangeIds: string[];
273
+ rejectedChangeIds: string[];
274
+ detachedChangeIds: string[];
275
+ actionableChangeIds: string[];
276
+ preserveOnlyChangeIds: string[];
277
+ totalCount: number;
278
+ revisions: TrackedChangeEntrySnapshot[];
279
+ }
280
+
281
+ export interface SuggestionEntrySnapshot {
282
+ suggestionId: string;
283
+ kind:
284
+ | "insertion"
285
+ | "deletion"
286
+ | "replacement"
287
+ | "formatting-change"
288
+ | "paragraph-property-change"
289
+ | "structural-change"
290
+ | "object-change";
291
+ source: "runtime" | "import";
292
+ status: "active" | "accepted" | "rejected" | "detached";
293
+ actionability: "actionable" | "preserve-only";
294
+ storyTarget: EditorStoryTarget;
295
+ anchor: EditorAnchorProjection;
296
+ anchorLabel: string;
297
+ createdAt: string;
298
+ authorId: string;
299
+ changeIds: string[];
300
+ editable: boolean;
301
+ canAccept: boolean;
302
+ canReject: boolean;
303
+ isReplacement: boolean;
304
+ preserveOnlyReason?: string;
305
+ excerpt?: string;
306
+ detail?: string;
307
+ }
308
+
309
+ export interface SuggestionsSnapshot {
310
+ totalCount: number;
311
+ actionableSuggestionIds: string[];
312
+ preserveOnlySuggestionIds: string[];
313
+ activeSuggestionIds: string[];
314
+ acceptedSuggestionIds: string[];
315
+ rejectedSuggestionIds: string[];
316
+ detachedSuggestionIds: string[];
317
+ suggestions: SuggestionEntrySnapshot[];
318
+ }
319
+
320
+ export type FormattingAlignment = "left" | "center" | "right" | "justify";
321
+
322
+ export interface FormattingBreadcrumbItem {
323
+ kind: "table" | "table_row" | "table_cell" | "paragraph" | "sdt_block" | "opaque_block";
324
+ label: string;
325
+ from: number;
326
+ to: number;
327
+ }
328
+
329
+ export interface FormattingStateSnapshot {
330
+ bold: boolean;
331
+ italic: boolean;
332
+ underline: boolean;
333
+ strikethrough: boolean;
334
+ superscript: boolean;
335
+ subscript: boolean;
336
+ fontFamily?: string;
337
+ fontSize?: number;
338
+ textColor?: string;
339
+ highlightColor?: string | null;
340
+ alignment?: FormattingAlignment;
341
+ paragraphStyleId?: string;
342
+ breadcrumb: FormattingBreadcrumbItem[];
343
+ }
344
+
345
+ export interface SearchOptions {
346
+ matchCase?: boolean;
347
+ wholeWord?: boolean;
348
+ limit?: number;
349
+ }
350
+
351
+ export interface SearchResultSnapshot {
352
+ resultId: string;
353
+ anchor: EditorAnchorProjection;
354
+ excerpt: string;
355
+ isActive: boolean;
356
+ storyTarget?: EditorStoryTarget;
357
+ sectionIndex?: number;
358
+ pageIndex?: number;
359
+ }
360
+
361
+ // ---------------------------------------------------------------------------
362
+ // Document Navigation Model (Wave 37)
363
+ // ---------------------------------------------------------------------------
364
+
365
+ /**
366
+ * Runtime-owned snapshot of the document's page stack, heading outline, and
367
+ * navigation context. Derived from canonical document state and section
368
+ * properties — never from DOM scroll position or CSS layout.
369
+ */
370
+ export interface DocumentNavigationSnapshot {
371
+ /** Total estimated page count across all sections. */
372
+ pageCount: number;
373
+ /** Ordered page descriptors, one per logical page. */
374
+ pages: DocumentPageSnapshot[];
375
+ /** Ordered heading outline extracted from paragraph styles. */
376
+ headings: DocumentHeadingSnapshot[];
377
+ /** Index of the page containing the current selection head. */
378
+ activePageIndex: number;
379
+ /** Section index containing the current selection head. */
380
+ activeSectionIndex: number;
381
+ }
382
+
383
+ /** Runtime-derived descriptor for a single logical page. */
384
+ export interface DocumentPageSnapshot {
385
+ /** Zero-based page index within the whole document. */
386
+ pageIndex: number;
387
+ /** Section that owns this page (zero-based). */
388
+ sectionIndex: number;
389
+ /** Zero-based page index within its owning section. */
390
+ pageInSection: number;
391
+ /** Estimated character offset where the page begins in the main story. */
392
+ startOffset: number;
393
+ /** Estimated character offset where the page ends in the main story. */
394
+ endOffset: number;
395
+ /** Page layout properties inherited from the section. */
396
+ layout: PageLayoutSnapshot;
397
+ }
398
+
399
+ /** A heading entry in the document outline. */
400
+ export interface DocumentHeadingSnapshot {
401
+ /** Stable identifier for the heading (derived from block position). */
402
+ headingId: string;
403
+ /** Outline level (1 = Heading 1, 2 = Heading 2, etc.). */
404
+ level: number;
405
+ /** Plain-text content of the heading paragraph. */
406
+ text: string;
407
+ /** Character offset of the heading in the main story. */
408
+ offset: number;
409
+ /** Zero-based page index where the heading lives. */
410
+ pageIndex: number;
411
+ /** Section index where the heading lives. */
412
+ sectionIndex: number;
413
+ }
414
+
415
+ /** A single field entry in the runtime field snapshot. */
416
+ export interface FieldEntrySnapshot {
417
+ /** Stable index of the field in document order. */
418
+ index: number;
419
+ /** Classified field family. */
420
+ fieldFamily: FieldFamily;
421
+ /** Whether this family is in the supported refresh slice. */
422
+ supported: boolean;
423
+ /** Raw field instruction string. */
424
+ instruction: string;
425
+ /** Target bookmark for REF/PAGEREF/NOTEREF fields. */
426
+ fieldTarget?: string;
427
+ /** Current refresh status. */
428
+ refreshStatus: FieldRefreshStatus;
429
+ /** Resolved display text (from field children). */
430
+ displayText: string;
431
+ }
432
+
433
+ /** Runtime field snapshot — read-only view of all fields in the document. */
434
+ export interface FieldSnapshot {
435
+ /** Total number of fields in the document. */
436
+ totalCount: number;
437
+ /** Number of fields in the supported refresh slice. */
438
+ supportedCount: number;
439
+ /** Number of fields that are preserve-only. */
440
+ preserveOnlyCount: number;
441
+ /** Ordered field entries. */
442
+ fields: FieldEntrySnapshot[];
443
+ }
444
+
445
+ /** Options for runtime-backed field refresh. */
446
+ export interface UpdateFieldsOptions {
447
+ /** When true, only refresh fields in the supported slice. Default true. */
448
+ supportedOnly?: boolean;
449
+ }
450
+
451
+ /** Result of a runtime-backed field refresh operation. */
452
+ export interface UpdateFieldsResult {
453
+ /** Total number of fields in the document. */
454
+ totalCount: number;
455
+ /** Number of fields that were refreshed. */
456
+ updatedCount: number;
457
+ /** Number of preserve-only fields left unchanged. */
458
+ preserveOnlyCount: number;
459
+ }
460
+
461
+ /** Options for runtime-backed TOC refresh. */
462
+ export interface TocRefreshOptions {
463
+ /** Maximum heading outline level to include (1–9, default 3). */
464
+ maxLevel?: number;
465
+ }
466
+
467
+ /** Result of a TOC refresh operation. */
468
+ export interface TocRefreshResult {
469
+ /** Number of TOC entries generated from heading structure. */
470
+ entryCount: number;
471
+ /** Heading entries that populated the TOC. */
472
+ entries: Array<{
473
+ level: number;
474
+ text: string;
475
+ pageIndex: number;
476
+ }>;
477
+ }
478
+
479
+ export type DocumentLocationSource =
480
+ | { kind: "selection" }
481
+ | { kind: "search"; resultId?: string; query?: string }
482
+ | { kind: "workflow"; markupId?: string; candidateId?: string }
483
+ | { kind: "navigation" };
484
+
485
+ export interface DocumentLocationSnapshot {
486
+ locationId: string;
487
+ anchor: EditorAnchorProjection;
488
+ storyTarget?: EditorStoryTarget;
489
+ sectionIndex?: number;
490
+ pageIndex?: number;
491
+ headingId?: string;
492
+ headingPath?: string[];
493
+ bookmarkName?: string;
494
+ source: DocumentLocationSource;
495
+ }
496
+
497
+ export type RestorePointCheckpointType = "selection" | "search-result" | "workflow-item" | "manual";
498
+
499
+ export interface RestorePointSnapshot {
500
+ restorePointId: string;
501
+ location: DocumentLocationSnapshot;
502
+ revisionToken: string;
503
+ createdAt: string;
504
+ checkpointType: RestorePointCheckpointType;
505
+ }
506
+
507
+ export interface RestoreResult {
508
+ status: "restored" | "remapped" | "detached" | "blocked";
509
+ selection?: SelectionSnapshot;
510
+ location?: DocumentLocationSnapshot;
511
+ reasons?: string[];
512
+ }
513
+
514
+ export interface DocumentOutlineHeadingSnapshot extends DocumentHeadingSnapshot {
515
+ parentHeadingIds: string[];
516
+ }
517
+
518
+ export interface DocumentOutlineSnapshot {
519
+ activeHeadingId?: string;
520
+ headings: DocumentOutlineHeadingSnapshot[];
521
+ }
522
+
523
+ export interface TocEntrySnapshot {
524
+ tocEntryId: string;
525
+ level: number;
526
+ text: string;
527
+ pageIndex?: number;
528
+ anchor?: EditorAnchorProjection;
529
+ bookmarkName?: string;
530
+ headingId?: string;
531
+ }
532
+
533
+ export interface TocSnapshot {
534
+ status: "current" | "stale" | "missing";
535
+ sourceFieldIndex?: number;
536
+ instruction?: string;
537
+ entries: TocEntrySnapshot[];
538
+ }
539
+
540
+ export interface DocumentSectionSnapshot {
541
+ sectionId: string;
542
+ sectionIndex: number;
543
+ pageRange: { start: number; end: number };
544
+ headingPath: string[];
545
+ primaryHeadingId?: string;
546
+ primaryHeadingText?: string;
547
+ layout?: PageLayoutSnapshot;
548
+ anchor: EditorAnchorProjection;
549
+ storyTargets: EditorStoryTarget[];
550
+ }
551
+
552
+ export type SnapshotRefreshInvalidateTarget =
553
+ | "selection"
554
+ | "render"
555
+ | "navigation"
556
+ | "fields"
557
+ | "comments"
558
+ | "trackedChanges"
559
+ | "workflowScope"
560
+ | "workflowMarkup"
561
+ | "reviewWork"
562
+ | "contextAnalytics"
563
+ | "chunks"
564
+ | "outline"
565
+ | "toc"
566
+ | "sections"
567
+ | "locations"
568
+ | "textStream";
569
+
570
+ export type SnapshotRefreshStaleTarget =
571
+ | "search_results"
572
+ | "anchors"
573
+ | "selection_only"
574
+ | "none";
575
+
576
+ export type SnapshotRefreshChangeKind =
577
+ | "selection"
578
+ | "content"
579
+ | "review"
580
+ | "workflow"
581
+ | "structure"
582
+ | "checkpoint";
583
+
584
+ export interface SnapshotRefreshHints {
585
+ invalidate: SnapshotRefreshInvalidateTarget[];
586
+ staleTargets: SnapshotRefreshStaleTarget[];
587
+ changeKinds: SnapshotRefreshChangeKind[];
588
+ checkpointType?: "session" | "snapshot" | "export";
589
+ }
590
+
591
+ export interface StyleCatalogEntrySnapshot {
592
+ styleId: string;
593
+ displayName: string;
594
+ kind: "paragraph" | "character" | "table";
595
+ isDefault: boolean;
596
+ basedOn?: string;
597
+ nextStyle?: string;
598
+ }
599
+
600
+ export interface StyleCatalogSnapshot {
601
+ paragraphs: StyleCatalogEntrySnapshot[];
602
+ characters: StyleCatalogEntrySnapshot[];
603
+ tables: StyleCatalogEntrySnapshot[];
604
+ fromPackage: boolean;
605
+ }
606
+
607
+ export interface InsertTableOptions {
608
+ rows: number;
609
+ columns: number;
610
+ }
611
+
612
+ export interface InsertImageOptions {
613
+ data: Uint8Array;
614
+ mimeType: string;
615
+ width?: number;
616
+ height?: number;
617
+ altText?: string;
618
+ }
619
+
620
+ export type SurfaceTextMark =
621
+ | "bold"
622
+ | "italic"
623
+ | "underline"
624
+ | "strikethrough"
625
+ | "doubleStrikethrough"
626
+ | "superscript"
627
+ | "subscript"
628
+ | "vanish"
629
+ | "emboss"
630
+ | "imprint"
631
+ | "shadow"
632
+ | "smallCaps"
633
+ | "allCaps";
634
+
635
+ export type SurfaceInlineSegment =
636
+ | {
637
+ segmentId: string;
638
+ kind: "text";
639
+ from: number;
640
+ to: number;
641
+ text: string;
642
+ marks?: SurfaceTextMark[];
643
+ markAttrs?: {
644
+ backgroundColor?: string;
645
+ charSpacing?: number;
646
+ kerning?: number;
647
+ textFill?: string;
648
+ fontFamily?: string;
649
+ fontSize?: number;
650
+ textColor?: string;
651
+ };
652
+ hyperlinkHref?: string;
653
+ }
654
+ | {
655
+ segmentId: string;
656
+ kind: "tab" | "hard_break";
657
+ from: number;
658
+ to: number;
659
+ hyperlinkHref?: string;
660
+ }
661
+ | {
662
+ segmentId: string;
663
+ kind: "image";
664
+ from: number;
665
+ to: number;
666
+ mediaId: string;
667
+ altText?: string;
668
+ state: "editable" | "missing";
669
+ display?: "inline" | "floating";
670
+ detail?: string;
671
+ }
672
+ | {
673
+ segmentId: string;
674
+ kind: "opaque_inline";
675
+ from: number;
676
+ to: number;
677
+ fragmentId: string;
678
+ warningId: string;
679
+ label: string;
680
+ detail: string;
681
+ featureKey?: string;
682
+ blockedReasonCode?: "workflow_preserve_only" | "workflow_blocked_import";
683
+ presentation?: "inline-chip" | "quiet-marker";
684
+ state: "locked-preserve-only";
685
+ }
686
+ | {
687
+ segmentId: string;
688
+ kind: "note_ref";
689
+ from: number;
690
+ to: number;
691
+ noteKind: "footnote" | "endnote";
692
+ noteId: string;
693
+ label: string;
694
+ }
695
+ | {
696
+ segmentId: string;
697
+ kind: "field_ref";
698
+ from: number;
699
+ to: number;
700
+ fieldFamily: SupportedFieldFamily;
701
+ fieldTarget?: string;
702
+ instruction: string;
703
+ refreshStatus: FieldRefreshStatus;
704
+ label: string;
705
+ };
706
+
707
+ export interface SurfaceTableCellSnapshot {
708
+ gridSpan: number;
709
+ verticalMerge: "restart" | "continue" | null;
710
+ colspan: number;
711
+ rowspan: number;
712
+ backgroundColor?: string | null;
713
+ verticalAlign?: "top" | "center" | "bottom" | null;
714
+ borderTop?: string | null;
715
+ borderRight?: string | null;
716
+ borderBottom?: string | null;
717
+ borderLeft?: string | null;
718
+ content: SurfaceBlockSnapshot[];
719
+ }
720
+
721
+ export interface SurfaceTableRowSnapshot {
722
+ cells: SurfaceTableCellSnapshot[];
723
+ gridBefore?: number;
724
+ gridAfter?: number;
725
+ height?: number;
726
+ heightRule?: "auto" | "atLeast" | "exact";
727
+ isHeader?: boolean;
728
+ }
729
+
730
+ export interface ResolvedNumberingGeometrySnapshot {
731
+ markerJustification?: "left" | "center" | "right" | "both" | "distribute";
732
+ spacing?: { before?: number; after?: number; line?: number; lineRule?: string };
733
+ indentation?: { left?: number; right?: number; firstLine?: number; hanging?: number };
734
+ tabStops?: Array<{ pos: number; val?: string; leader?: string }>;
735
+ markerLane?: { start: number; width: number; textStart: number };
736
+ textColumn?: { start: number; right?: number; firstLine?: number; hanging?: number };
737
+ }
738
+
739
+ export interface ResolvedNumberingSnapshot {
740
+ level: number;
741
+ format: string;
742
+ text?: string;
743
+ startAt: number;
744
+ paragraphStyleId?: string;
745
+ isLegalNumbering?: boolean;
746
+ suffix?: "tab" | "space" | "nothing";
747
+ geometry: ResolvedNumberingGeometrySnapshot;
748
+ }
749
+
750
+ export type SurfaceBlockSnapshot =
751
+ | {
752
+ blockId: string;
753
+ kind: "paragraph";
754
+ from: number;
755
+ to: number;
756
+ styleId?: string;
757
+ numbering?: {
758
+ numberingInstanceId: string;
759
+ level: number;
760
+ };
761
+ numberingPrefix?: string;
762
+ numberingSuffix?: "tab" | "space" | "nothing";
763
+ resolvedNumbering?: ResolvedNumberingSnapshot;
764
+ alignment?: "left" | "center" | "right" | "both" | "distribute";
765
+ spacing?: { before?: number; after?: number; line?: number; lineRule?: string };
766
+ contextualSpacing?: boolean;
767
+ indentation?: { left?: number; right?: number; firstLine?: number; hanging?: number };
768
+ borders?: { top?: unknown; left?: unknown; bottom?: unknown; right?: unknown; bar?: unknown; between?: unknown };
769
+ shading?: { fill?: string; color?: string; val?: string };
770
+ tabStops?: Array<{ pos: number; val?: string; leader?: string }>;
771
+ keepNext?: boolean;
772
+ keepLines?: boolean;
773
+ pageBreakBefore?: boolean;
774
+ outlineLevel?: number;
775
+ bidi?: boolean;
776
+ suppressLineNumbers?: boolean;
777
+ segments: SurfaceInlineSegment[];
778
+ }
779
+ | {
780
+ blockId: string;
781
+ kind: "table";
782
+ from: number;
783
+ to: number;
784
+ styleId?: string;
785
+ gridColumns: number[];
786
+ alignment?: "left" | "center" | "right";
787
+ tblLook?: {
788
+ firstRow?: boolean;
789
+ lastRow?: boolean;
790
+ firstColumn?: boolean;
791
+ lastColumn?: boolean;
792
+ noHBand?: boolean;
793
+ noVBand?: boolean;
794
+ };
795
+ rows: SurfaceTableRowSnapshot[];
796
+ }
797
+ | {
798
+ blockId: string;
799
+ kind: "sdt_block";
800
+ from: number;
801
+ to: number;
802
+ sdtType?: string;
803
+ alias?: string;
804
+ tag?: string;
805
+ lock?: string;
806
+ checkboxChecked?: boolean;
807
+ dateValue?: string;
808
+ dropdownItems?: Array<{ displayText?: string; value: string }>;
809
+ comboBoxItems?: Array<{ displayText?: string; value: string }>;
810
+ showingPlcHdr?: boolean;
811
+ children: SurfaceBlockSnapshot[];
812
+ }
813
+ | {
814
+ blockId: string;
815
+ kind: "opaque_block";
816
+ from: number;
817
+ to: number;
818
+ fragmentId: string;
819
+ warningId: string;
820
+ label: string;
821
+ detail: string;
822
+ featureKey?: string;
823
+ blockedReasonCode?: "workflow_preserve_only" | "workflow_blocked_import";
824
+ state: "locked-preserve-only";
825
+ };
826
+
827
+ export interface SecondaryStorySurface {
828
+ target: EditorStoryTarget;
829
+ label: string;
830
+ storySize: number;
831
+ blocks: SurfaceBlockSnapshot[];
832
+ }
833
+
834
+ export interface EditorSurfaceSnapshot {
835
+ storySize: number;
836
+ plainText: string;
837
+ blocks: SurfaceBlockSnapshot[];
838
+ lockedFragmentIds: string[];
839
+ secondaryStories: SecondaryStorySurface[];
840
+ }
841
+
842
+ export type EditorWarningCode =
843
+ | "unsupported_ooxml_preserved"
844
+ | "unsupported_ooxml_locked"
845
+ | "import_normalized"
846
+ | "export_roundtrip_risk"
847
+ | "comment_anchor_detached"
848
+ | "revision_anchor_detached"
849
+ | "large_document_degraded"
850
+ | "font_substitution"
851
+ | "image_missing";
852
+
853
+ export interface EditorWarning {
854
+ warningId: string;
855
+ code: EditorWarningCode;
856
+ severity: "info" | "warning";
857
+ message: string;
858
+ source:
859
+ | "import"
860
+ | "runtime"
861
+ | "review"
862
+ | "preservation"
863
+ | "validation"
864
+ | "export";
865
+ affectedAnchor?: EditorAnchorProjection;
866
+ featureEntryId?: string;
867
+ details?: Record<string, unknown>;
868
+ }
869
+
870
+ export type EditorErrorCode =
871
+ | "import_failed"
872
+ | "export_failed"
873
+ | "package_corrupt"
874
+ | "validation_failed"
875
+ | "datastore_failed"
876
+ | "internal_invariant";
877
+
878
+ export interface EditorError {
879
+ errorId: string;
880
+ code: EditorErrorCode;
881
+ message: string;
882
+ isFatal: boolean;
883
+ source: "import" | "runtime" | "validation" | "datastore" | "host" | "export";
884
+ details?: Record<string, unknown>;
885
+ }
886
+
887
+ export type CompatibilityFeatureClass =
888
+ | "supported-roundtrip"
889
+ | "preserve-only"
890
+ | "unsupported-fatal";
891
+
892
+ export interface CompatibilityFeatureEntry {
893
+ featureEntryId: string;
894
+ featureKey: string;
895
+ featureClass: CompatibilityFeatureClass;
896
+ message: string;
897
+ affectedAnchor?: EditorAnchorProjection;
898
+ details?: Record<string, unknown>;
899
+ }
900
+
901
+ export interface CompatibilityReport {
902
+ reportVersion: "compatibility-report/1";
903
+ generatedAt: string;
904
+ blockExport: boolean;
905
+ featureEntries: CompatibilityFeatureEntry[];
906
+ warnings: EditorWarning[];
907
+ errors: EditorError[];
908
+ }
909
+
910
+ export interface CompatibilityPanelSnapshot {
911
+ blockExport: boolean;
912
+ blockExportReasons: string[];
913
+ warningCount: number;
914
+ errorCount: number;
915
+ featureEntries: CompatibilityFeatureEntry[];
916
+ }
917
+
918
+ export type ViewMode = "editing" | "review" | "view";
919
+
920
+ /**
921
+ * Runtime document-mode — controls whether editing is unrestricted, restricted
922
+ * to suggestions, or fully read-only at the document level.
923
+ *
924
+ * Distinct from `ViewMode` (editor posture) and `WorkspaceMode` (shell layout).
925
+ * `DocumentMode` reflects document-level editing authority, not presentation.
926
+ */
927
+ export type DocumentMode = "editing" | "suggesting" | "viewing";
928
+
929
+ /**
930
+ * A single permission range parsed from `w:permStart` / `w:permEnd` in the
931
+ * source package. Ranges carry stable ids, edit-rights metadata, and an
932
+ * enforcement reason that the UI can display.
933
+ */
934
+ export interface ProtectionRange {
935
+ /** Stable range id from `w:id` on the originating `w:permStart`. */
936
+ rangeId: string;
937
+ /** Start offset of the editable range when the runtime can map it safely. */
938
+ start?: number;
939
+ /** End offset of the editable range when the runtime can map it safely. */
940
+ end?: number;
941
+ /** Editor group allowed to edit this range (`w:edGrp`), if specified. */
942
+ editorGroup?: string;
943
+ /** Specific editor identity (`w:ed`), if specified. */
944
+ editor?: string;
945
+ /** Whether this range is currently enforced by the runtime. */
946
+ enforced: boolean;
947
+ /** Human-readable reason for the enforcement state. */
948
+ enforcementReason: string;
949
+ }
950
+
951
+ /**
952
+ * Snapshot of the document's protection posture. Descriptive and bounded —
953
+ * no public bypass around protected ranges, export blockers, or preserve-only
954
+ * regions.
955
+ */
956
+ export interface ProtectionSnapshot {
957
+ /** Whether document-level protection is declared in the source package. */
958
+ hasDocumentProtection: boolean;
959
+ /**
960
+ * The declared protection edit type from `w:documentProtection` in
961
+ * `settings.xml` (e.g. `"readOnly"`, `"comments"`, `"trackedChanges"`,
962
+ * `"forms"`, `"none"`). `undefined` when no protection element exists.
963
+ */
964
+ editType?: string;
965
+ /** Whether the declared protection is enforced (`w:enforcement="1"`). */
966
+ enforcementActive: boolean;
967
+ /** All parsed permission ranges from the source package. */
968
+ ranges: ProtectionRange[];
969
+ /** Count of permission ranges that are currently enforced. */
970
+ enforcedRangeCount: number;
971
+ /** Count of permission ranges preserved but not live-enforced. */
972
+ preservedRangeCount: number;
973
+ }
974
+
975
+ export type CaretAffinity = "forward" | "backward" | "none";
976
+
977
+ export interface ActiveListContext {
978
+ numberingInstanceId: string;
979
+ level: number;
980
+ isOrdered: boolean;
981
+ markerText?: string;
982
+ }
983
+
984
+ export interface ActiveNoteContext {
985
+ noteKind: "footnote" | "endnote";
986
+ noteId: string;
987
+ referencePosition: number;
988
+ }
989
+
990
+ export interface TableOperationCapabilitySnapshot {
991
+ enabled: boolean;
992
+ reason?: string;
993
+ }
994
+
995
+ export interface TableStructureContextSnapshot {
996
+ tableBlockIndex: number;
997
+ currentStyleId?: string | null;
998
+ selectionKind: "text" | "cell";
999
+ rowCount: number;
1000
+ columnCount: number;
1001
+ selectedCellCount: number;
1002
+ isSimpleTable: boolean;
1003
+ currentCell: {
1004
+ rowIndex: number;
1005
+ columnIndex: number;
1006
+ isHeader: boolean;
1007
+ };
1008
+ operations: {
1009
+ setTableStyle: TableOperationCapabilitySnapshot;
1010
+ setCellBackground: TableOperationCapabilitySnapshot;
1011
+ addRowBefore: TableOperationCapabilitySnapshot;
1012
+ addRowAfter: TableOperationCapabilitySnapshot;
1013
+ deleteRow: TableOperationCapabilitySnapshot;
1014
+ addColumnBefore: TableOperationCapabilitySnapshot;
1015
+ addColumnAfter: TableOperationCapabilitySnapshot;
1016
+ deleteColumn: TableOperationCapabilitySnapshot;
1017
+ mergeCells: TableOperationCapabilitySnapshot;
1018
+ splitCell: TableOperationCapabilitySnapshot;
1019
+ deleteTable: TableOperationCapabilitySnapshot;
1020
+ };
1021
+ }
1022
+
1023
+ export interface PageRegionHitTest {
1024
+ region: "body" | "header" | "footer" | "margin" | "gutter";
1025
+ sectionIndex: number;
1026
+ columnIndex: number;
1027
+ }
1028
+
1029
+ export interface LayoutMeasurement {
1030
+ pageRegions: PageRegionHitTest[];
1031
+ caretAffinity: CaretAffinity;
1032
+ tabStops: Array<{ pos: number; val?: string; leader?: string }>;
1033
+ listMarkerLane?: { indent: number; markerWidth: number };
1034
+ objectFrame?: { kind: "image" | "textbox" | "shape"; anchorPos: number; display: "inline" | "floating" };
1035
+ }
1036
+
1037
+ export interface EditorViewStateSnapshot {
1038
+ viewMode: ViewMode;
1039
+ documentMode: DocumentMode;
1040
+ workspaceMode: WorkspaceMode;
1041
+ zoomLevel: ZoomLevel;
1042
+ activeStory: EditorStoryTarget;
1043
+ selection: SelectionSnapshot;
1044
+ caretAffinity: CaretAffinity;
1045
+ activeListContext: ActiveListContext | null;
1046
+ activeNoteContext: ActiveNoteContext | null;
1047
+ activePageRegion: PageRegionHitTest | null;
1048
+ activeObjectFrame: LayoutMeasurement["objectFrame"] | null;
1049
+ measurement: LayoutMeasurement;
1050
+ isFocused: boolean;
1051
+ }
1052
+
1053
+ export interface CommandStateSnapshot {
1054
+ canUndo: boolean;
1055
+ canRedo: boolean;
1056
+ readOnly: boolean;
1057
+ }
1058
+
1059
+ export interface RuntimeRenderSnapshot {
1060
+ documentId: string;
1061
+ sessionId: string;
1062
+ sourceLabel?: string;
1063
+ revisionToken: string;
1064
+ isReady: boolean;
1065
+ isDirty: boolean;
1066
+ readOnly: boolean;
1067
+ documentMode: DocumentMode;
1068
+ selection: SelectionSnapshot;
1069
+ activeStory: EditorStoryTarget;
1070
+ pageLayout?: PageLayoutSnapshot;
1071
+ documentStats: DocumentStats;
1072
+ comments: CommentSidebarSnapshot;
1073
+ trackedChanges: TrackedChangesSnapshot;
1074
+ compatibility: CompatibilityPanelSnapshot;
1075
+ warnings: EditorWarning[];
1076
+ fatalError?: EditorError;
1077
+ commandState: CommandStateSnapshot;
1078
+ surface?: EditorSurfaceSnapshot;
1079
+ protectionSnapshot: ProtectionSnapshot;
1080
+ }
1081
+
1082
+ export interface EditorSessionState {
1083
+ sessionVersion: "editor-session-state/1";
1084
+ schemaVersion: RuntimePersistedEditorSnapshot["schemaVersion"];
1085
+ documentId: string;
1086
+ docId: string;
1087
+ createdAt: string;
1088
+ updatedAt: string;
1089
+ editorBuild: string;
1090
+ canonicalDocument: RuntimePersistedEditorSnapshot["canonicalDocument"];
1091
+ compatibility: CompatibilityReport;
1092
+ warningLog: EditorWarning[];
1093
+ protectionSnapshot?: ProtectionSnapshot;
1094
+ sourcePackage?: RuntimePersistedEditorSnapshot["sourcePackage"];
1095
+ workflowMetadata?: WorkflowMetadataSnapshot;
1096
+ }
1097
+
1098
+ export interface PersistedEditorSnapshot {
1099
+ snapshotVersion: RuntimePersistedEditorSnapshot["snapshotVersion"];
1100
+ schemaVersion: RuntimePersistedEditorSnapshot["schemaVersion"];
1101
+ documentId: string;
1102
+ docId: string;
1103
+ createdAt: string;
1104
+ updatedAt: string;
1105
+ savedAt: string;
1106
+ editorBuild: string;
1107
+ canonicalDocument: RuntimePersistedEditorSnapshot["canonicalDocument"];
1108
+ compatibility: CompatibilityReport;
1109
+ warningLog: EditorWarning[];
1110
+ protectionSnapshot?: ProtectionSnapshot;
1111
+ sourcePackage?: RuntimePersistedEditorSnapshot["sourcePackage"];
1112
+ workflowMetadata?: WorkflowMetadataSnapshot;
1113
+ }
1114
+
1115
+ export interface AddCommentParams {
1116
+ anchor?: EditorAnchorProjection;
1117
+ body?: string;
1118
+ authorId?: string;
1119
+ }
1120
+
1121
+ export interface ExportDocxOptions {
1122
+ fileName?: string;
1123
+ reason?: string;
1124
+ }
1125
+
1126
+ export interface ExportDelivery {
1127
+ mode: "downloaded" | "persisted-by-host" | "exported-bytes-only";
1128
+ savedAt?: string;
1129
+ }
1130
+
1131
+ export interface ExportResult {
1132
+ bytes: Uint8Array;
1133
+ mimeType: string;
1134
+ fileName: string;
1135
+ delivery: ExportDelivery;
1136
+ }
1137
+
1138
+ export type WorkflowScopeMode = "edit" | "suggest" | "comment" | "view";
1139
+
1140
+ export interface WorkflowCandidateRange {
1141
+ candidateId: string;
1142
+ storyTarget?: EditorStoryTarget;
1143
+ anchor: EditorAnchorProjection;
1144
+ label?: string;
1145
+ source?: "search" | "playbook" | "host" | "ai";
1146
+ }
1147
+
1148
+ export interface WorkflowScope {
1149
+ scopeId: string;
1150
+ mode: WorkflowScopeMode;
1151
+ anchor: EditorAnchorProjection;
1152
+ storyTarget?: EditorStoryTarget;
1153
+ workItemId?: string;
1154
+ label?: string;
1155
+ domain?: "legal" | "commercial" | "finance" | "other";
1156
+ metadataRefs?: string[];
1157
+ }
1158
+
1159
+ export interface WorkflowWorkItem {
1160
+ workItemId: string;
1161
+ title: string;
1162
+ description?: string;
1163
+ domain?: "legal" | "commercial" | "finance" | "other";
1164
+ status?: "pending" | "active" | "done" | "blocked";
1165
+ scopeIds: string[];
1166
+ }
1167
+
1168
+ export interface WorkflowOverlay {
1169
+ overlayVersion: "workflow-overlay/1";
1170
+ candidates?: WorkflowCandidateRange[];
1171
+ scopes: WorkflowScope[];
1172
+ workItems?: WorkflowWorkItem[];
1173
+ activeWorkItemId?: string | null;
1174
+ }
1175
+
1176
+ export type WorkflowMetadataPersistence =
1177
+ | "runtime-only"
1178
+ | "session"
1179
+ | "document-metadata";
1180
+
1181
+ export interface WorkflowMetadataDefinition {
1182
+ metadataId: string;
1183
+ kind: string;
1184
+ label: string;
1185
+ color?: string;
1186
+ icon?: string;
1187
+ dataSchema?: Record<string, unknown>;
1188
+ persistence: WorkflowMetadataPersistence;
1189
+ }
1190
+
1191
+ export interface WorkflowMetadataEntry {
1192
+ entryId: string;
1193
+ metadataId: string;
1194
+ anchor: EditorAnchorProjection;
1195
+ storyTarget?: EditorStoryTarget;
1196
+ value?: Record<string, unknown>;
1197
+ scopeId?: string;
1198
+ workItemId?: string;
1199
+ }
1200
+
1201
+ export interface WorkflowMetadataSnapshot {
1202
+ definitions: WorkflowMetadataDefinition[];
1203
+ entries: WorkflowMetadataEntry[];
1204
+ }
1205
+
1206
+ export interface WorkflowBlockedCommandReason {
1207
+ code:
1208
+ | "outside_workflow_scope"
1209
+ | "workflow_comment_only"
1210
+ | "workflow_view_only"
1211
+ | "workflow_preserve_only"
1212
+ | "workflow_blocked_import"
1213
+ | "document_read_only"
1214
+ | "document_viewing_mode"
1215
+ | "protected_range"
1216
+ | "unsupported_surface"
1217
+ | "suggesting_unsupported";
1218
+ message: string;
1219
+ scopeId?: string;
1220
+ workItemId?: string;
1221
+ anchor?: EditorAnchorProjection;
1222
+ storyTarget?: EditorStoryTarget;
1223
+ }
1224
+
1225
+ export interface WorkflowScopeSnapshot {
1226
+ overlayPresent: boolean;
1227
+ activeWorkItemId?: string | null;
1228
+ activeWorkItem?: WorkflowWorkItem;
1229
+ scopes: WorkflowScope[];
1230
+ candidates: WorkflowCandidateRange[];
1231
+ blockedReasons: WorkflowBlockedCommandReason[];
1232
+ }
1233
+
1234
+ export type EffectiveSelectionMode = WorkflowScopeMode | "blocked";
1235
+
1236
+ export interface InteractionGuardSnapshot {
1237
+ effectiveMode: EffectiveSelectionMode;
1238
+ matchedScopeId?: string;
1239
+ matchedScopeMode?: WorkflowScopeMode;
1240
+ targetAccess?: "direct-edit" | "suggest" | "comment-only" | "view-only" | "blocked";
1241
+ commandCapabilities?: Array<{
1242
+ family: "text" | "formatting" | "structure";
1243
+ supported: boolean;
1244
+ blockedReasons: WorkflowBlockedCommandReason[];
1245
+ }>;
1246
+ disabledReason?: string;
1247
+ blockedReasons: WorkflowBlockedCommandReason[];
1248
+ }
1249
+
1250
+ export type WorkflowMarkupKind =
1251
+ | "highlight"
1252
+ | "metadata"
1253
+ | "comment"
1254
+ | "revision"
1255
+ | "field"
1256
+ | "protected_range"
1257
+ | "opaque_fragment";
1258
+
1259
+ export interface WorkflowMarkupBase {
1260
+ markupId: string;
1261
+ kind: WorkflowMarkupKind;
1262
+ anchor: EditorAnchorProjection;
1263
+ storyTarget?: EditorStoryTarget;
1264
+ label: string;
1265
+ excerpt?: string;
1266
+ }
1267
+
1268
+ export interface WorkflowHighlightMarkup extends WorkflowMarkupBase {
1269
+ kind: "highlight";
1270
+ color: string;
1271
+ text: string;
1272
+ }
1273
+
1274
+ export interface WorkflowMetadataMarkup extends WorkflowMarkupBase {
1275
+ kind: "metadata";
1276
+ entryId: string;
1277
+ metadataId: string;
1278
+ color?: string;
1279
+ icon?: string;
1280
+ persistence: WorkflowMetadataPersistence;
1281
+ value?: Record<string, unknown>;
1282
+ scopeId?: string;
1283
+ workItemId?: string;
1284
+ }
1285
+
1286
+ export interface WorkflowCommentMarkup extends WorkflowMarkupBase {
1287
+ kind: "comment";
1288
+ commentId: string;
1289
+ status: CommentSidebarThreadSnapshot["status"];
1290
+ warningCount: number;
1291
+ entryCount: number;
1292
+ createdAt: string;
1293
+ createdBy: string;
1294
+ }
1295
+
1296
+ export interface WorkflowRevisionMarkup extends WorkflowMarkupBase {
1297
+ kind: "revision";
1298
+ revisionId: string;
1299
+ revisionKind: TrackedChangeEntrySnapshot["kind"];
1300
+ status: TrackedChangeEntrySnapshot["status"];
1301
+ actionability: TrackedChangeEntrySnapshot["actionability"];
1302
+ authorId: string;
1303
+ createdAt: string;
1304
+ preserveOnlyReason?: string;
1305
+ }
1306
+
1307
+ export interface WorkflowFieldMarkup extends WorkflowMarkupBase {
1308
+ kind: "field";
1309
+ fieldIndex: number;
1310
+ fieldFamily: FieldFamily;
1311
+ fieldTarget?: string;
1312
+ refreshStatus: FieldRefreshStatus;
1313
+ displayText: string;
1314
+ }
1315
+
1316
+ export interface WorkflowProtectedRangeMarkup extends WorkflowMarkupBase {
1317
+ kind: "protected_range";
1318
+ rangeId: string;
1319
+ enforced: boolean;
1320
+ enforcementReason: string;
1321
+ editorGroup?: string;
1322
+ editor?: string;
1323
+ }
1324
+
1325
+ export interface WorkflowOpaqueFragmentMarkup extends WorkflowMarkupBase {
1326
+ kind: "opaque_fragment";
1327
+ fragmentId: string;
1328
+ warningId: string;
1329
+ detail: string;
1330
+ blockedReasonCode: "workflow_preserve_only" | "workflow_blocked_import";
1331
+ }
1332
+
1333
+ export type WorkflowMarkupItem =
1334
+ | WorkflowHighlightMarkup
1335
+ | WorkflowMetadataMarkup
1336
+ | WorkflowCommentMarkup
1337
+ | WorkflowRevisionMarkup
1338
+ | WorkflowFieldMarkup
1339
+ | WorkflowProtectedRangeMarkup
1340
+ | WorkflowOpaqueFragmentMarkup;
1341
+
1342
+ export interface WorkflowMarkupSnapshot {
1343
+ totalCount: number;
1344
+ items: WorkflowMarkupItem[];
1345
+ highlights: WorkflowHighlightMarkup[];
1346
+ metadata: WorkflowMetadataMarkup[];
1347
+ comments: WorkflowCommentMarkup[];
1348
+ revisions: WorkflowRevisionMarkup[];
1349
+ fields: WorkflowFieldMarkup[];
1350
+ protectedRanges: WorkflowProtectedRangeMarkup[];
1351
+ opaqueFragments: WorkflowOpaqueFragmentMarkup[];
1352
+ }
1353
+
1354
+ export type HostAnnotationKind =
1355
+ | "note"
1356
+ | "scope_hint"
1357
+ | "readonly_marker"
1358
+ | "suggestion"
1359
+ | "warning";
1360
+
1361
+ export interface HostAnnotationItem {
1362
+ annotationId: string;
1363
+ kind: HostAnnotationKind;
1364
+ label: string;
1365
+ anchor: EditorAnchorProjection;
1366
+ storyTarget?: EditorStoryTarget;
1367
+ detail?: string;
1368
+ scopeMode?: WorkflowScopeMode;
1369
+ severity?: "low" | "medium" | "high";
1370
+ workItemId?: string;
1371
+ provenance: "host";
1372
+ }
1373
+
1374
+ export interface HostAnnotationOverlay {
1375
+ overlayVersion: "host-annotation-overlay/1";
1376
+ annotations: HostAnnotationItem[];
1377
+ }
1378
+
1379
+ export interface HostAnnotationSnapshot {
1380
+ totalCount: number;
1381
+ annotations: HostAnnotationItem[];
1382
+ }
1383
+
1384
+ export type ReviewQueueItemKind = "comment" | "change" | "section_mark";
1385
+
1386
+ export interface ReviewQueueItem {
1387
+ itemId: string;
1388
+ kind: ReviewQueueItemKind;
1389
+ label: string;
1390
+ storyTarget?: EditorStoryTarget;
1391
+ anchor: EditorAnchorProjection;
1392
+ sectionIndex?: number;
1393
+ pageIndex?: number;
1394
+ status: "open" | "resolved";
1395
+ actionable: boolean;
1396
+ }
1397
+
1398
+ export interface ReviewQueueSnapshot {
1399
+ totalCount: number;
1400
+ openCount: number;
1401
+ activeIndex: number;
1402
+ items: ReviewQueueItem[];
1403
+ }
1404
+
1405
+ export interface DocumentTextToken {
1406
+ tokenId: string;
1407
+ storyTarget?: EditorStoryTarget;
1408
+ blockId: string;
1409
+ blockKind: SurfaceBlockSnapshot["kind"];
1410
+ segmentId?: string;
1411
+ kind: SurfaceInlineSegment["kind"] | "paragraph_boundary" | "table_boundary";
1412
+ from: number;
1413
+ to: number;
1414
+ text?: string;
1415
+ marks?: SurfaceTextMark[];
1416
+ pageIndex?: number;
1417
+ sectionIndex?: number;
1418
+ }
1419
+
1420
+ export interface StoryTextStreamSnapshot {
1421
+ target: EditorStoryTarget;
1422
+ label: string;
1423
+ storySize: number;
1424
+ tokens: DocumentTextToken[];
1425
+ }
1426
+
1427
+ export type DocumentChunkKind = "retrieval" | "action" | "workflow";
1428
+
1429
+ export interface DocumentChunkSnapshot {
1430
+ chunkId: string;
1431
+ kind: DocumentChunkKind;
1432
+ label: string;
1433
+ text: string;
1434
+ storyTarget?: EditorStoryTarget;
1435
+ anchor: EditorAnchorProjection;
1436
+ sectionIndex?: number;
1437
+ pageRange?: { start: number; end: number };
1438
+ headingPath: string[];
1439
+ blockRefs: Array<{ blockId: string; kind: string }>;
1440
+ source:
1441
+ | { type: "surface" }
1442
+ | { type: "search"; query: string }
1443
+ | { type: "workflow"; candidateId?: string; markupId?: string };
1444
+ cautionFlags: Array<
1445
+ | "contains_table"
1446
+ | "contains_protected_range"
1447
+ | "contains_preserve_only"
1448
+ | "contains_detached_anchor"
1449
+ >;
1450
+ }
1451
+
1452
+ export interface ReviewWorkItemSnapshot {
1453
+ workId: string;
1454
+ kind: "comment" | "revision" | "protected_range" | "opaque_fragment";
1455
+ label: string;
1456
+ excerpt: string;
1457
+ anchor: EditorAnchorProjection;
1458
+ storyTarget?: EditorStoryTarget;
1459
+ sectionIndex?: number;
1460
+ pageIndex?: number;
1461
+ }
1462
+
1463
+ export interface ReviewWorkSnapshot {
1464
+ openCommentCount: number;
1465
+ actionableRevisionCount: number;
1466
+ items: ReviewWorkItemSnapshot[];
1467
+ }
1468
+
1469
+ export type RuntimeContextAnalyticsScopeKind =
1470
+ | "selection"
1471
+ | "workflow_scope"
1472
+ | "work_item"
1473
+ | "document";
1474
+
1475
+ export interface RuntimeContextAnalyticsQuery {
1476
+ scopeKind?: RuntimeContextAnalyticsScopeKind;
1477
+ scopeId?: string;
1478
+ workItemId?: string;
1479
+ }
1480
+
1481
+ export interface RuntimeContextAnalyticsBadge {
1482
+ key: string;
1483
+ label: string;
1484
+ value?: string | number;
1485
+ tone?: "neutral" | "accent" | "warning" | "danger" | "success";
1486
+ priority?: 1 | 2 | 3;
1487
+ }
1488
+
1489
+ export interface RuntimeContextAnalyticsActionHint {
1490
+ key: string;
1491
+ label: string;
1492
+ kind: "next_step" | "blocker" | "warning" | "approval";
1493
+ }
1494
+
1495
+ export interface RuntimeContextAnalyticsCounts {
1496
+ tasksRemaining?: number;
1497
+ unresolvedComments?: number;
1498
+ pendingRevisions?: number;
1499
+ pendingSuggestions?: number;
1500
+ blockedCommands?: number;
1501
+ approvalsRemaining?: number;
1502
+ overdueItems?: number;
1503
+ warnings?: number;
1504
+ errors?: number;
1505
+ openWorkItems?: number;
1506
+ exportBlockers?: number;
1507
+ }
1508
+
1509
+ export interface RuntimeContextAnalyticsState {
1510
+ effectiveMode?: EffectiveSelectionMode;
1511
+ isBlocked?: boolean;
1512
+ disabledReason?: string;
1513
+ completionState?: "not_started" | "in_progress" | "ready" | "done";
1514
+ exportReadiness?: "ready" | "warning" | "blocked";
1515
+ lastTouchedAt?: string;
1516
+ }
1517
+
1518
+ export type RuntimeContextAnalyticsUnavailableField =
1519
+ | "tasksRemaining"
1520
+ | "approvalsRemaining"
1521
+ | "overdueItems"
1522
+ | "tags"
1523
+ | "assignee"
1524
+ | "dueDate"
1525
+ | "lastTouchedAt";
1526
+
1527
+ export interface RuntimeContextAnalyticsProvenance {
1528
+ kind: "runtime-derived";
1529
+ derivedFrom: Array<
1530
+ | "render"
1531
+ | "workflowScope"
1532
+ | "interactionGuard"
1533
+ | "workflowMarkup"
1534
+ | "reviewWork"
1535
+ | "warnings"
1536
+ | "compatibility"
1537
+ >;
1538
+ unavailable: RuntimeContextAnalyticsUnavailableField[];
1539
+ }
1540
+
1541
+ export interface RuntimeContextAnalyticsSnapshot {
1542
+ scopeKind: RuntimeContextAnalyticsScopeKind;
1543
+ scopeId?: string;
1544
+ workItemId?: string | null;
1545
+ badges: RuntimeContextAnalyticsBadge[];
1546
+ nextActions: RuntimeContextAnalyticsActionHint[];
1547
+ counts: RuntimeContextAnalyticsCounts;
1548
+ state: RuntimeContextAnalyticsState;
1549
+ provenance: RuntimeContextAnalyticsProvenance;
1550
+ }
1551
+
1552
+ export interface WorkflowCandidateRangeOptions {
1553
+ kinds?: WorkflowMarkupKind[];
1554
+ includeDetached?: boolean;
1555
+ source?: WorkflowCandidateRange["source"];
1556
+ }
1557
+
1558
+ export type AutosaveState =
1559
+ | { status: "idle" }
1560
+ | { status: "saving" }
1561
+ | { status: "saved"; savedAt: string }
1562
+ | { status: "error"; error: EditorError };
1563
+
1564
+ export interface AutosaveConfig {
1565
+ enabled?: boolean;
1566
+ debounceMs?: number;
1567
+ }
1568
+
1569
+ export type WordReviewEditorEvent =
1570
+ | {
1571
+ type: "ready";
1572
+ documentId: string;
1573
+ sessionId: string;
1574
+ source: "docx" | "session" | "snapshot";
1575
+ stats: DocumentStats;
1576
+ compatibility: CompatibilityReport;
1577
+ comments: CommentSidebarSnapshot;
1578
+ trackedChanges: TrackedChangesSnapshot;
1579
+ }
1580
+ | {
1581
+ type: "dirty_changed";
1582
+ documentId: string;
1583
+ isDirty: boolean;
1584
+ }
1585
+ | {
1586
+ type: "selection_changed";
1587
+ documentId: string;
1588
+ selection: SelectionSnapshot;
1589
+ }
1590
+ | {
1591
+ type: "comment_added";
1592
+ documentId: string;
1593
+ commentId: string;
1594
+ anchor: EditorAnchorProjection;
1595
+ }
1596
+ | {
1597
+ type: "comment_resolved";
1598
+ documentId: string;
1599
+ commentId: string;
1600
+ }
1601
+ | {
1602
+ type: "change_accepted";
1603
+ documentId: string;
1604
+ changeId: string;
1605
+ }
1606
+ | {
1607
+ type: "change_rejected";
1608
+ documentId: string;
1609
+ changeId: string;
1610
+ }
1611
+ | {
1612
+ type: "story_changed";
1613
+ documentId: string;
1614
+ activeStory: EditorStoryTarget;
1615
+ }
1616
+ | {
1617
+ type: "warning_added";
1618
+ documentId: string;
1619
+ warning: EditorWarning;
1620
+ }
1621
+ | {
1622
+ type: "warning_cleared";
1623
+ documentId: string;
1624
+ warningId: string;
1625
+ code: EditorWarningCode;
1626
+ }
1627
+ | {
1628
+ type: "error";
1629
+ documentId: string;
1630
+ error: EditorError;
1631
+ }
1632
+ | {
1633
+ type: "autosave_state";
1634
+ documentId: string;
1635
+ state: AutosaveState;
1636
+ }
1637
+ | {
1638
+ type: "snapshot_saved";
1639
+ documentId: string;
1640
+ snapshot: PersistedEditorSnapshot;
1641
+ isAutosave: boolean;
1642
+ }
1643
+ | {
1644
+ type: "session_saved";
1645
+ documentId: string;
1646
+ sessionState: EditorSessionState;
1647
+ savedAt: string;
1648
+ isAutosave: boolean;
1649
+ }
1650
+ | {
1651
+ type: "export_completed";
1652
+ documentId: string;
1653
+ result: ExportResult;
1654
+ }
1655
+ | {
1656
+ type: "workflow_overlay_changed";
1657
+ documentId: string;
1658
+ snapshot: WorkflowScopeSnapshot;
1659
+ }
1660
+ | {
1661
+ type: "workflow_active_work_item_changed";
1662
+ documentId: string;
1663
+ activeWorkItemId: string | null;
1664
+ }
1665
+ | {
1666
+ type: "workflow_metadata_changed";
1667
+ documentId: string;
1668
+ snapshot: WorkflowMetadataSnapshot;
1669
+ }
1670
+ | {
1671
+ type: "host_annotation_overlay_changed";
1672
+ documentId: string;
1673
+ snapshot: HostAnnotationSnapshot;
1674
+ }
1675
+ | {
1676
+ type: "context_analytics_changed";
1677
+ documentId: string;
1678
+ snapshot: RuntimeContextAnalyticsSnapshot | null;
1679
+ }
1680
+ | {
1681
+ type: "change_authored";
1682
+ documentId: string;
1683
+ changeId: string;
1684
+ kind: "insertion" | "deletion";
1685
+ }
1686
+ | {
1687
+ type: "suggestion_authored";
1688
+ documentId: string;
1689
+ suggestionId: string;
1690
+ changeIds: string[];
1691
+ suggestionKind: SuggestionEntrySnapshot["kind"];
1692
+ storyTarget: EditorStoryTarget;
1693
+ anchor: EditorAnchorProjection;
1694
+ isReplacement: boolean;
1695
+ }
1696
+ | {
1697
+ type: "suggestion_updated";
1698
+ documentId: string;
1699
+ suggestionId: string;
1700
+ changeIds: string[];
1701
+ suggestionKind: SuggestionEntrySnapshot["kind"];
1702
+ status: SuggestionEntrySnapshot["status"];
1703
+ storyTarget: EditorStoryTarget;
1704
+ anchor: EditorAnchorProjection;
1705
+ }
1706
+ | {
1707
+ type: "command_blocked";
1708
+ documentId: string;
1709
+ command: string;
1710
+ reasons: WorkflowBlockedCommandReason[];
1711
+ };
1712
+
1713
+ export interface LoadResult {
1714
+ source?: ExternalDocumentSource;
1715
+ }
1716
+
1717
+ export interface SaveSnapshotParams {
1718
+ documentId: string;
1719
+ snapshot: PersistedEditorSnapshot;
1720
+ isAutosave: boolean;
1721
+ }
1722
+
1723
+ export interface SaveSnapshotResult {
1724
+ savedAt: string;
1725
+ }
1726
+
1727
+ export interface SaveSessionParams {
1728
+ documentId: string;
1729
+ sessionState: EditorSessionState;
1730
+ isAutosave: boolean;
1731
+ }
1732
+
1733
+ export interface SaveSessionResult {
1734
+ savedAt: string;
1735
+ }
1736
+
1737
+ export interface SaveExportParams {
1738
+ documentId: string;
1739
+ result: ExportResult;
1740
+ }
1741
+
1742
+ export interface SaveExportResult {
1743
+ savedAt: string;
1744
+ }
1745
+
1746
+ export interface EditorTelemetryEvent {
1747
+ type: string;
1748
+ documentId: string;
1749
+ detail?: Record<string, unknown>;
1750
+ }
1751
+
1752
+ export interface EditorHostAdapter {
1753
+ load?(params: LoadRequest): Promise<LoadResult>;
1754
+ saveSession?(params: SaveSessionParams): Promise<SaveSessionResult>;
1755
+ saveExport?(params: SaveExportParams): Promise<SaveExportResult>;
1756
+ logEvent?(event: EditorTelemetryEvent): void;
1757
+ }
1758
+
1759
+ export interface EditorDatastoreAdapter {
1760
+ load(params: LoadRequest): Promise<LoadResult>;
1761
+ saveSnapshot(params: SaveSnapshotParams): Promise<SaveSnapshotResult>;
1762
+ saveExport?(params: SaveExportParams): Promise<SaveExportResult>;
1763
+ logEvent?(event: EditorTelemetryEvent): void;
1764
+ }
1765
+
1766
+ export interface WordReviewEditorRef {
1767
+ focus(): void;
1768
+ blur(): void;
1769
+ undo(): void;
1770
+ redo(): void;
1771
+ addComment(params: AddCommentParams): string;
1772
+ openComment(commentId: string): void;
1773
+ resolveComment(commentId: string): void;
1774
+ reopenComment(commentId: string): void;
1775
+ addCommentReply(commentId: string, body: string): void;
1776
+ editCommentBody(commentId: string, body: string): void;
1777
+ deleteComment(commentId: string): void;
1778
+ acceptChange(changeId: string): void;
1779
+ rejectChange(changeId: string): void;
1780
+ acceptAllChanges(): void;
1781
+ rejectAllChanges(): void;
1782
+ exportDocx(options?: ExportDocxOptions): Promise<ExportResult>;
1783
+ getSessionState(): EditorSessionState;
1784
+ getSnapshot(): PersistedEditorSnapshot;
1785
+ getRenderSnapshot(): RuntimeRenderSnapshot;
1786
+ getCompatibilityReport(): CompatibilityReport;
1787
+ getWarnings(): EditorWarning[];
1788
+ getCommentSidebarSnapshot(): CommentSidebarSnapshot;
1789
+ getTrackedChangesSnapshot(): TrackedChangesSnapshot;
1790
+ getSuggestionsSnapshot(): SuggestionsSnapshot;
1791
+ getComments(): CommentSidebarSnapshot;
1792
+ getTrackedChanges(): TrackedChangesSnapshot;
1793
+ isDirty(): boolean;
1794
+ getFormattingState(): FormattingStateSnapshot;
1795
+ getStyleCatalog(): StyleCatalogSnapshot;
1796
+ replaceText(text: string, target?: EditorAnchorProjection): void;
1797
+ toggleBulletedList(): void;
1798
+ toggleNumberedList(): void;
1799
+ toggleBold(): void;
1800
+ toggleItalic(): void;
1801
+ toggleUnderline(): void;
1802
+ toggleStrikethrough(): void;
1803
+ toggleSuperscript(): void;
1804
+ toggleSubscript(): void;
1805
+ setFontFamily(fontFamily: string | null): void;
1806
+ setFontSize(size: number | null): void;
1807
+ setTextColor(color: string | null): void;
1808
+ setHighlightColor(color: string | null): void;
1809
+ setAlignment(alignment: FormattingAlignment): void;
1810
+ setParagraphStyle(styleId: string | null): void;
1811
+ setTableStyle(styleId: string | null): void;
1812
+ indent(): void;
1813
+ outdent(): void;
1814
+ restartNumbering(): void;
1815
+ continueNumbering(): void;
1816
+ insertPageBreak(): void;
1817
+ insertTable(options: InsertTableOptions): void;
1818
+ insertImage(options: InsertImageOptions): void;
1819
+ addRowBefore(): void;
1820
+ addRowAfter(): void;
1821
+ addColumnBefore(): void;
1822
+ addColumnAfter(): void;
1823
+ deleteRow(): void;
1824
+ deleteColumn(): void;
1825
+ deleteTable(): void;
1826
+ mergeCells(): void;
1827
+ splitCell(): void;
1828
+ setCellBackground(color: string): void;
1829
+ search(query: string, options?: SearchOptions): SearchResultSnapshot[];
1830
+ clearSearch(): void;
1831
+ setSelection(selection: SelectionSnapshot | null): void;
1832
+ scrollToRevision(revisionId: string): void;
1833
+ scrollToComment(commentId: string): void;
1834
+ openStory(target: EditorStoryTarget): void;
1835
+ closeStory(): void;
1836
+ getPageLayoutSnapshot(): PageLayoutSnapshot | null;
1837
+ getDocumentNavigationSnapshot(): DocumentNavigationSnapshot;
1838
+ getCurrentLocation(): DocumentLocationSnapshot | null;
1839
+ getLocationForSelection(selection: SelectionSnapshot): DocumentLocationSnapshot | null;
1840
+ getLocationForAnchor(
1841
+ anchor: EditorAnchorProjection,
1842
+ storyTarget?: EditorStoryTarget,
1843
+ ): DocumentLocationSnapshot | null;
1844
+ captureRestorePoint(
1845
+ input?: SelectionSnapshot | EditorAnchorProjection,
1846
+ ): RestorePointSnapshot | null;
1847
+ restoreToPoint(
1848
+ point: RestorePointSnapshot,
1849
+ options?: { behavior?: "exact" | "semantic"; scroll?: boolean },
1850
+ ): RestoreResult;
1851
+ getOutlineSnapshot(): DocumentOutlineSnapshot;
1852
+ getTocSnapshot(): TocSnapshot | null;
1853
+ getSections(): DocumentSectionSnapshot[];
1854
+ getSectionSnapshot(input: {
1855
+ sectionIndex?: number;
1856
+ headingId?: string;
1857
+ bookmarkName?: string;
1858
+ }): DocumentSectionSnapshot | null;
1859
+ describeEventImpact(event: WordReviewEditorEvent): SnapshotRefreshHints;
1860
+ getFieldSnapshot(): FieldSnapshot;
1861
+ updateFields(options?: UpdateFieldsOptions): UpdateFieldsResult;
1862
+ updateTableOfContents(options?: TocRefreshOptions): TocRefreshResult;
1863
+ getViewState(): EditorViewStateSnapshot;
1864
+ setDocumentMode(mode: DocumentMode): void;
1865
+ getProtectionSnapshot(): ProtectionSnapshot;
1866
+ setWorkspaceMode(mode: WorkspaceMode): void;
1867
+ setZoom(level: ZoomLevel): void;
1868
+ insertSectionBreak(type: SectionBreakType, options?: { afterSectionIndex?: number }): void;
1869
+ deleteSectionBreak(sectionIndex: number): void;
1870
+ updateSectionLayout(sectionIndex: number, patch: SectionLayoutPatch): void;
1871
+ setSectionPageNumbering(
1872
+ sectionIndex: number,
1873
+ patch: SectionPageNumberingPatch | null,
1874
+ ): void;
1875
+ setHeaderFooterLink(sectionIndex: number, params: HeaderFooterLinkPatch): void;
1876
+ setImageLayout(mediaId: string, dimensions: { widthEmu: number; heightEmu: number }): void;
1877
+ setImageFrame(mediaId: string, offsets: { horizontalOffsetEmu?: number; verticalOffsetEmu?: number }): void;
1878
+ setWorkflowOverlay(overlay: WorkflowOverlay): void;
1879
+ clearWorkflowOverlay(): void;
1880
+ getWorkflowScopeSnapshot(): WorkflowScopeSnapshot | null;
1881
+ getInteractionGuardSnapshot(): InteractionGuardSnapshot;
1882
+ getWorkflowMarkupSnapshot(): WorkflowMarkupSnapshot;
1883
+ setWorkflowMetadataDefinitions(definitions: WorkflowMetadataDefinition[]): void;
1884
+ clearWorkflowMetadataDefinitions(): void;
1885
+ setWorkflowMetadataEntries(entries: WorkflowMetadataEntry[]): void;
1886
+ clearWorkflowMetadataEntries(): void;
1887
+ getWorkflowMetadataSnapshot(): WorkflowMetadataSnapshot;
1888
+ setHostAnnotationOverlay(overlay: HostAnnotationOverlay): void;
1889
+ clearHostAnnotationOverlay(): void;
1890
+ getHostAnnotationSnapshot(): HostAnnotationSnapshot;
1891
+ getReviewQueueSnapshot(): ReviewQueueSnapshot;
1892
+ goToNextReviewItem(): ReviewQueueItem | null;
1893
+ goToPreviousReviewItem(): ReviewQueueItem | null;
1894
+ markSectionForReview(input?: { sectionIndex?: number; label?: string }): string | null;
1895
+ clearSectionReviewMark(annotationId: string): void;
1896
+ getWorkflowCandidateRanges(options?: WorkflowCandidateRangeOptions): WorkflowCandidateRange[];
1897
+ replaceWorkflowMarkupText(markupId: string, text: string): void;
1898
+ getRuntimeContextAnalytics(
1899
+ query?: RuntimeContextAnalyticsQuery,
1900
+ ): RuntimeContextAnalyticsSnapshot | null;
1901
+ }
1902
+
1903
+ export type WordReviewEditorChromePreset =
1904
+ | "selection"
1905
+ | "simple"
1906
+ | "advanced"
1907
+ | "review";
1908
+
1909
+ export interface WordReviewEditorChromeOptions {
1910
+ showReviewQueueBar: boolean;
1911
+ showSectionTagAction: boolean;
1912
+ showReviewRail: boolean;
1913
+ }
1914
+
1915
+ export interface WordReviewEditorProps {
1916
+ documentId: string;
1917
+ currentUser: EditorUser;
1918
+ initialDocx?: Uint8Array | ArrayBuffer;
1919
+ initialSessionState?: EditorSessionState;
1920
+ initialSnapshot?: PersistedEditorSnapshot;
1921
+ initialSourceLabel?: string;
1922
+ externalDocumentRevision?: string;
1923
+ externalDocSource?: ExternalDocumentSource;
1924
+ loadRevision?: string;
1925
+ loadSourcePolicy?: LoadSourcePolicy;
1926
+ readOnly?: boolean;
1927
+ reviewMode?: "editing" | "review";
1928
+ suggestionsEnabled?: boolean;
1929
+ chromePreset?: WordReviewEditorChromePreset;
1930
+ chromeOptions?: Partial<WordReviewEditorChromeOptions>;
1931
+ markupDisplay?: "clean" | "simple" | "all";
1932
+ showUnsupportedObjectPreviews?: boolean;
1933
+ showReviewPanel?: boolean;
1934
+ chromeVisibility?: Partial<WordReviewEditorChromeVisibility>;
1935
+ hostAdapter?: EditorHostAdapter;
1936
+ datastore?: EditorDatastoreAdapter;
1937
+ autosave?: AutosaveConfig;
1938
+ onEvent?: (event: WordReviewEditorEvent) => void;
1939
+ onWarning?: (warning: EditorWarning) => void;
1940
+ onError?: (error: EditorError) => void;
1941
+ }
1942
+
1943
+ export interface WordReviewEditorChromeVisibility {
1944
+ toolbar: boolean;
1945
+ alerts: boolean;
1946
+ selectionOverlay: boolean;
1947
+ contextToolbars: boolean;
1948
+ contextAnalytics: boolean;
1949
+ pageChrome: boolean;
1950
+ statusBar: boolean;
1951
+ reviewRail: boolean;
1952
+ }