@stll/folio-core 0.11.0 → 0.13.0

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 (263) hide show
  1. package/dist/ai-edits/apply.d.ts +2 -1
  2. package/dist/ai-edits/apply.js +693 -63
  3. package/dist/ai-edits/block-identity.d.ts +4 -0
  4. package/dist/ai-edits/block-identity.js +9 -0
  5. package/dist/ai-edits/blockRange.d.ts +28 -1
  6. package/dist/ai-edits/blockRange.js +68 -2
  7. package/dist/ai-edits/clean-text.js +2 -1
  8. package/dist/ai-edits/headless.d.ts +4 -4
  9. package/dist/ai-edits/headless.js +9 -9
  10. package/dist/ai-edits/index.d.ts +2 -2
  11. package/dist/ai-edits/index.js +2 -2
  12. package/dist/ai-edits/read.d.ts +7 -7
  13. package/dist/ai-edits/read.js +110 -3
  14. package/dist/ai-edits/snapshot.js +21 -3
  15. package/dist/ai-edits/table-cell-mutations.d.ts +48 -0
  16. package/dist/ai-edits/table-cell-mutations.js +238 -0
  17. package/dist/ai-edits/table-mutation-plan.d.ts +38 -0
  18. package/dist/ai-edits/table-mutation-plan.js +90 -0
  19. package/dist/ai-edits/table-row-column-mutations.d.ts +108 -0
  20. package/dist/ai-edits/table-row-column-mutations.js +300 -0
  21. package/dist/ai-edits/table-targets.d.ts +32 -0
  22. package/dist/ai-edits/table-targets.js +70 -0
  23. package/dist/ai-edits/types.d.ts +62 -1
  24. package/dist/ai-edits/word-diff.js +21 -0
  25. package/dist/compat/eigenpal.d.ts +3 -3
  26. package/dist/compat/eigenpal.js +3 -3
  27. package/dist/content-controls/mutateContentControls.js +1 -1
  28. package/dist/controller/activeEditorStory.d.ts +36 -0
  29. package/dist/controller/activeEditorStory.js +30 -0
  30. package/dist/controller/contentControlWidgetController.d.ts +55 -0
  31. package/dist/controller/contentControlWidgetController.js +141 -0
  32. package/dist/controller/fontReadiness.js +2 -0
  33. package/dist/controller/headerFooterEditorManager.js +2 -2
  34. package/dist/controller/hiddenEditorApi.js +2 -2
  35. package/dist/controller/hiddenEditorManager.d.ts +12 -1
  36. package/dist/controller/hiddenEditorManager.js +44 -12
  37. package/dist/controller/layoutPipeline.d.ts +2 -0
  38. package/dist/controller/layoutPipeline.js +17 -2
  39. package/dist/controller/noteEditorManager.d.ts +36 -0
  40. package/dist/controller/noteEditorManager.js +210 -0
  41. package/dist/document-operations.d.ts +43 -11
  42. package/dist/document-operations.js +186 -18
  43. package/dist/docx/blockContentParser.js +21 -7
  44. package/dist/docx/commentParser.js +6 -1
  45. package/dist/docx/commentRangeIntegrity.d.ts +6 -0
  46. package/dist/docx/commentRangeIntegrity.js +186 -0
  47. package/dist/docx/conformance.js +62 -1
  48. package/dist/docx/documentGrid.d.ts +8 -0
  49. package/dist/docx/documentGrid.js +8 -0
  50. package/dist/docx/drawingUtils.js +1 -1
  51. package/dist/docx/encryption/agileDecryption.js +12 -2
  52. package/dist/docx/encryption/compoundFile.js +6 -1
  53. package/dist/docx/encryption/encryptionInfo.d.ts +9 -1
  54. package/dist/docx/encryption/encryptionInfo.js +18 -2
  55. package/dist/docx/encryption/openEncryptedDocx.js +1 -1
  56. package/dist/docx/ensureParaIds.js +8 -7
  57. package/dist/docx/fieldParser.js +1 -1
  58. package/dist/docx/groupDrawingParser.js +10 -5
  59. package/dist/docx/hyperlinkParser.js +1 -1
  60. package/dist/docx/imageParser.js +10 -6
  61. package/dist/docx/metadataPrivacy.js +17 -3
  62. package/dist/docx/notePropertiesParser.js +1 -1
  63. package/dist/docx/numberingParser.js +1 -1
  64. package/dist/docx/paragraphParser.js +70 -61
  65. package/dist/docx/paragraphTextBoxEnrichment.d.ts +2 -1
  66. package/dist/docx/paragraphTextBoxEnrichment.js +67 -13
  67. package/dist/docx/paragraphTraversal.js +1 -1
  68. package/dist/docx/parser.js +3 -3
  69. package/dist/docx/rezip.js +20 -9
  70. package/dist/docx/runParser.js +17 -6
  71. package/dist/docx/sdtProperties.js +1 -1
  72. package/dist/docx/sectionParser.js +18 -5
  73. package/dist/docx/selectiveSave.js +5 -1
  74. package/dist/docx/selectiveXmlPatch.d.ts +22 -1
  75. package/dist/docx/selectiveXmlPatch.js +61 -1
  76. package/dist/docx/serializer/blockSdtSerializer.js +3 -2
  77. package/dist/docx/serializer/commentSerializer.js +5 -6
  78. package/dist/docx/serializer/documentSerializer.js +2 -2
  79. package/dist/docx/serializer/headerFooterSerializer.js +2 -2
  80. package/dist/docx/serializer/noteSerializer.js +2 -2
  81. package/dist/docx/serializer/paragraphSerializer.js +23 -15
  82. package/dist/docx/serializer/runSerializer.js +25 -21
  83. package/dist/docx/serializer/sectionPropertiesSerializer.js +2 -1
  84. package/dist/docx/serializer/stylesSerializer.js +1 -1
  85. package/dist/docx/serializer/tableSerializer.d.ts +5 -4
  86. package/dist/docx/serializer/tableSerializer.js +26 -20
  87. package/dist/docx/serializer/xmlUtils.d.ts +13 -1
  88. package/dist/docx/serializer/xmlUtils.js +27 -1
  89. package/dist/docx/server/applyDocxXmlPatchProposal.d.ts +87 -0
  90. package/dist/docx/server/applyDocxXmlPatchProposal.js +204 -0
  91. package/dist/docx/server/boundedArchive.d.ts +14 -3
  92. package/dist/docx/server/boundedArchive.js +56 -11
  93. package/dist/docx/server/evaluateDocxXmlPatchProposal.d.ts +85 -0
  94. package/dist/docx/server/evaluateDocxXmlPatchProposal.js +361 -0
  95. package/dist/docx/server/extractDocxText.js +55 -8
  96. package/dist/docx/server/inspectDocxPackage.d.ts +70 -0
  97. package/dist/docx/server/inspectDocxPackage.js +217 -0
  98. package/dist/docx/server/validateDocxConformance.d.ts +41 -0
  99. package/dist/docx/server/validateDocxConformance.js +336 -0
  100. package/dist/docx/settingsParser.js +26 -3
  101. package/dist/docx/shapeParser.js +1 -1
  102. package/dist/docx/styleParser.js +4 -2
  103. package/dist/docx/tableParser.d.ts +8 -1
  104. package/dist/docx/tableParser.js +31 -10
  105. package/dist/docx/textBoxParser.d.ts +3 -3
  106. package/dist/docx/textBoxParser.js +16 -12
  107. package/dist/docx/unzip.js +1 -0
  108. package/dist/docx/vmlImageParser.js +11 -3
  109. package/dist/docx/xmlParser.js +11 -1
  110. package/dist/docx/xmlSafety.d.ts +5 -0
  111. package/dist/docx/xmlSafety.js +9 -0
  112. package/dist/fields/resolveFieldValues.js +1 -3
  113. package/dist/fonts/embeddedFonts.d.ts +33 -5
  114. package/dist/fonts/embeddedFonts.js +37 -8
  115. package/dist/i18n/messages/catalogs.gen.d.ts +17 -0
  116. package/dist/i18n/messages/catalogs.gen.js +17 -0
  117. package/dist/i18n/messages/messages.gen.d.ts +1 -0
  118. package/dist/index.d.ts +3 -3
  119. package/dist/index.js +3 -3
  120. package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
  121. package/dist/layout-bridge/convert/footnoteLayout.js +47 -40
  122. package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
  123. package/dist/layout-bridge/convert/headerFooterLayout.js +3 -0
  124. package/dist/layout-bridge/convert/templatePreviewFlow.js +3 -3
  125. package/dist/layout-bridge/convert/toFlowBlocks.d.ts +4 -2
  126. package/dist/layout-bridge/convert/toFlowBlocks.js +151 -20
  127. package/dist/layout-bridge/dom/noteStoryDom.d.ts +6 -0
  128. package/dist/layout-bridge/dom/noteStoryDom.js +17 -0
  129. package/dist/layout-bridge/engine/clickToPosition.js +2 -2
  130. package/dist/layout-engine/index.d.ts +2 -2
  131. package/dist/layout-engine/index.js +58 -30
  132. package/dist/layout-engine/justificationCompatibility.d.ts +6 -0
  133. package/dist/layout-engine/justificationCompatibility.js +8 -0
  134. package/dist/layout-engine/keep-together.js +11 -1
  135. package/dist/layout-engine/measure/cache.js +23 -5
  136. package/dist/layout-engine/measure/effectiveLineBreakPolicy.js +8 -2
  137. package/dist/layout-engine/measure/lineBreakProvider.d.ts +2 -2
  138. package/dist/layout-engine/measure/lineBreakProvider.js +56 -37
  139. package/dist/layout-engine/measure/measureBlocks.js +15 -4
  140. package/dist/layout-engine/measure/measureContainer.js +1 -1
  141. package/dist/layout-engine/measure/measureHelpers.d.ts +11 -2
  142. package/dist/layout-engine/measure/measureHelpers.js +15 -4
  143. package/dist/layout-engine/measure/measureParagraph.js +85 -25
  144. package/dist/layout-engine/measure/measureProvider.js +4 -3
  145. package/dist/layout-engine/measure/tableCellFlow.js +5 -2
  146. package/dist/layout-engine/measure/textBoxParagraphLayout.d.ts +9 -7
  147. package/dist/layout-engine/measure/textBoxParagraphLayout.js +22 -6
  148. package/dist/layout-engine/measure/textMeasurementPolicy.d.ts +3 -1
  149. package/dist/layout-engine/measure/textMeasurementPolicy.js +7 -1
  150. package/dist/layout-engine/paginator.js +5 -1
  151. package/dist/layout-engine/paragraphSpacing.d.ts +28 -4
  152. package/dist/layout-engine/paragraphSpacing.js +107 -13
  153. package/dist/layout-engine/renderedBreakReconciliation.js +1 -1
  154. package/dist/layout-engine/types.d.ts +48 -15
  155. package/dist/layout-painter/registry/modules/textBox.js +5 -1
  156. package/dist/layout-painter/renderImage.d.ts +12 -1
  157. package/dist/layout-painter/renderImage.js +21 -4
  158. package/dist/layout-painter/renderPage.d.ts +5 -2
  159. package/dist/layout-painter/renderPage.js +59 -14
  160. package/dist/layout-painter/renderParagraph.js +55 -15
  161. package/dist/layout-painter/renderTable.d.ts +5 -1
  162. package/dist/layout-painter/renderTable.js +7 -3
  163. package/dist/layout-painter/renderTextBox.d.ts +2 -1
  164. package/dist/layout-painter/renderTextBox.js +25 -14
  165. package/dist/layout-painter/renderWatermark.d.ts +1 -1
  166. package/dist/layout-painter/renderWatermark.js +2 -1
  167. package/dist/managers/DocumentLoaderManager.js +1 -1
  168. package/dist/markdown/fromMarkdown.js +1 -1
  169. package/dist/model.js +1 -1
  170. package/dist/prosemirror/attrs/index.d.ts +4 -2
  171. package/dist/prosemirror/attrs/index.js +175 -18
  172. package/dist/prosemirror/commands/comments.d.ts +79 -4
  173. package/dist/prosemirror/commands/comments.js +622 -13
  174. package/dist/prosemirror/commands/contentControls.js +1 -1
  175. package/dist/prosemirror/commands/hyperlink.js +15 -1
  176. package/dist/prosemirror/commands/image.js +7 -1
  177. package/dist/prosemirror/commands/index.d.ts +2 -2
  178. package/dist/prosemirror/commands/index.js +2 -2
  179. package/dist/prosemirror/commands/pageBreak.js +1 -1
  180. package/dist/prosemirror/commands/propertyChangeScope.d.ts +2 -2
  181. package/dist/prosemirror/commands/propertyChangeScope.js +3 -2
  182. package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +9 -0
  183. package/dist/prosemirror/commands/tableCellMergeResolution.js +181 -0
  184. package/dist/prosemirror/commentIdAllocator.js +13 -3
  185. package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -1
  186. package/dist/prosemirror/conversion/fromProseDoc.js +404 -62
  187. package/dist/prosemirror/conversion/index.js +1 -1
  188. package/dist/prosemirror/conversion/sdtAttrs.d.ts +9 -0
  189. package/dist/prosemirror/conversion/sdtAttrs.js +49 -0
  190. package/dist/prosemirror/conversion/toProseDoc.d.ts +2 -1
  191. package/dist/prosemirror/conversion/toProseDoc.js +364 -103
  192. package/dist/prosemirror/extensions/ExtensionManager.js +1 -1
  193. package/dist/prosemirror/extensions/StarterKit.js +6 -1
  194. package/dist/prosemirror/extensions/core/ParagraphExtension.js +6 -2
  195. package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +1 -0
  196. package/dist/prosemirror/extensions/features/ImagePasteExtension.js +10 -2
  197. package/dist/prosemirror/extensions/features/ListExtension.js +1 -1
  198. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +10 -1
  199. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +93 -2
  200. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +2 -1
  201. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +6 -2
  202. package/dist/prosemirror/extensions/features/pasteCleanup.js +15 -2
  203. package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.js +1 -1
  204. package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +30 -4
  205. package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +9 -1
  206. package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +70 -11
  207. package/dist/prosemirror/extensions/nodes/FieldExtension.js +1 -1
  208. package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.d.ts +7 -0
  209. package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.js +22 -0
  210. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +1 -1
  211. package/dist/prosemirror/extensions/nodes/TableExtension.js +14 -6
  212. package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.d.ts +13 -0
  213. package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.js +41 -0
  214. package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +5 -2
  215. package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +4 -1
  216. package/dist/prosemirror/index.d.ts +1 -1
  217. package/dist/prosemirror/index.js +1 -1
  218. package/dist/prosemirror/plugins/contentControlWidgets.d.ts +36 -10
  219. package/dist/prosemirror/plugins/contentControlWidgets.js +128 -94
  220. package/dist/prosemirror/plugins/revisionIds.d.ts +23 -0
  221. package/dist/prosemirror/plugins/revisionIds.js +57 -0
  222. package/dist/prosemirror/plugins/selectionTracker.js +1 -0
  223. package/dist/prosemirror/plugins/suggestionMode.js +5 -4
  224. package/dist/prosemirror/runFormattingMarkNames.d.ts +14 -0
  225. package/dist/prosemirror/runFormattingMarkNames.js +40 -0
  226. package/dist/prosemirror/schema/index.d.ts +2 -2
  227. package/dist/prosemirror/schema/marks.d.ts +30 -3
  228. package/dist/prosemirror/schema/marks.js +15 -0
  229. package/dist/prosemirror/schema/nodes.d.ts +111 -6
  230. package/dist/prosemirror/selectionState.js +1 -0
  231. package/dist/prosemirror/styles/resolvedStyleAttrs.js +1 -0
  232. package/dist/prosemirror/tableCellMergeRevision.d.ts +9 -0
  233. package/dist/prosemirror/tableCellMergeRevision.js +22 -0
  234. package/dist/prosemirror/textBoxAnchorAttrs.d.ts +9 -0
  235. package/dist/prosemirror/textBoxAnchorAttrs.js +33 -0
  236. package/dist/prosemirror/utils/extractTrackedChanges.d.ts +1 -1
  237. package/dist/prosemirror/utils/extractTrackedChanges.js +62 -14
  238. package/dist/prosemirror/validation.js +9 -1
  239. package/dist/render-dom/RemoteSelectionOverlay.js +2 -2
  240. package/dist/server.d.ts +7 -3
  241. package/dist/server.js +7 -3
  242. package/dist/utils/clipboard.d.ts +10 -1
  243. package/dist/utils/clipboard.js +33 -6
  244. package/dist/utils/colorResolver.d.ts +8 -1
  245. package/dist/utils/colorResolver.js +35 -5
  246. package/dist/utils/fontFamilyMerge.js +9 -11
  247. package/dist/utils/fontLoader.js +3 -2
  248. package/dist/utils/fontResolver.d.ts +2 -1
  249. package/dist/utils/fontResolver.js +31 -7
  250. package/dist/utils/fontWeights.d.ts +1 -1
  251. package/dist/utils/fontWeights.js +1 -1
  252. package/dist/utils/hexId.d.ts +11 -1
  253. package/dist/utils/hexId.js +11 -1
  254. package/dist/utils/paragraphFormattingMerge.js +1 -0
  255. package/dist/utils/sanitizeImageSrc.d.ts +21 -0
  256. package/dist/utils/sanitizeImageSrc.js +30 -0
  257. package/dist/utils/stripXmlDeclarations.d.ts +11 -0
  258. package/dist/utils/stripXmlDeclarations.js +35 -0
  259. package/dist/version-comparison.d.ts +22 -2
  260. package/dist/version-comparison.js +41 -12
  261. package/dist/watermark/index.d.ts +11 -1
  262. package/dist/watermark/index.js +22 -1
  263. package/package.json +3 -2
@@ -0,0 +1,40 @@
1
+ //#region src/prosemirror/runFormattingMarkNames.ts
2
+ /**
3
+ * Names of the marks that carry run-level (character) formatting.
4
+ *
5
+ * Single source of truth shared by every place that must swap a run's live
6
+ * formatting back to a previously recorded set: rejecting a `runPropertyChange`
7
+ * (commands/comments.ts) and stripping a *suggested* `runPropertyChange` at the
8
+ * serialization boundary (conversion/fromProseDoc.ts). Keeping one list makes
9
+ * it structurally impossible for the two paths to drift and let a formatting
10
+ * mark survive a revert.
11
+ */
12
+ const RUN_FORMATTING_MARK_NAMES = /* @__PURE__ */ new Set([
13
+ "bold",
14
+ "italic",
15
+ "underline",
16
+ "strike",
17
+ "textColor",
18
+ "highlight",
19
+ "runShading",
20
+ "fontSize",
21
+ "fontFamily",
22
+ "language",
23
+ "superscript",
24
+ "subscript",
25
+ "allCaps",
26
+ "smallCaps",
27
+ "characterSpacing",
28
+ "emboss",
29
+ "imprint",
30
+ "hidden",
31
+ "textShadow",
32
+ "emphasisMark",
33
+ "textOutline",
34
+ "rtl",
35
+ "textEffect",
36
+ "runFormattingOverride",
37
+ "characterStyle"
38
+ ]);
39
+ //#endregion
40
+ export { RUN_FORMATTING_MARK_NAMES };
@@ -1,6 +1,6 @@
1
+ import { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunPropertyChangeMarkAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs } from "./marks.js";
1
2
  import { ExtensionManager } from "../extensions/ExtensionManager.js";
2
3
  import { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs } from "./nodes.js";
3
- import { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs } from "./marks.js";
4
4
 
5
5
  //#region src/prosemirror/schema/index.d.ts
6
6
  declare const singletonManager: ExtensionManager;
@@ -12,4 +12,4 @@ type DocxSchema = typeof schema;
12
12
  type DocxNode = ReturnType<typeof schema.node>;
13
13
  type DocxMark = ReturnType<typeof schema.mark>;
14
14
  //#endregion
15
- export { type BlockSdtAttrs, type CharacterSpacingAttrs, type CharacterStyleAttrs, type CommentAttrs, DocxMark, DocxNode, DocxSchema, type EmphasisMarkAttrs, type FieldAttrs, type FontFamilyAttrs, type FontSizeAttrs, type FootnoteRefAttrs, type HardBreakAttrs, type HighlightAttrs, type HyperlinkAttrs, type ImageAttrs, type ImagePositionAttrs, type LanguageAttrs, type MathAttrs, type ParagraphAttrs, type RunFormattingOverrideAttrs, type RunShadingAttrs, type SdtAttrs, type ShapeAttrs, type StrikeAttrs, type TableAttrs, type TableCellAttrs, type TableRowAttrs, type TextBoxAttrs, type TextColorAttrs, type TextEffectAttrs, type TrackedChangeMarkAttrs, type UnderlineAttrs, schema, singletonManager };
15
+ export { type BlockSdtAttrs, type CharacterSpacingAttrs, type CharacterStyleAttrs, type CommentAttrs, DocxMark, DocxNode, DocxSchema, type EmphasisMarkAttrs, type FieldAttrs, type FontFamilyAttrs, type FontSizeAttrs, type FootnoteRefAttrs, type HardBreakAttrs, type HighlightAttrs, type HyperlinkAttrs, type ImageAttrs, type ImagePositionAttrs, type LanguageAttrs, type MathAttrs, type ParagraphAttrs, type RunFormattingOverrideAttrs, type RunPropertyChangeMarkAttrs, type RunShadingAttrs, type SdtAttrs, type ShapeAttrs, type StrikeAttrs, type TableAttrs, type TableCellAttrs, type TableRowAttrs, type TextBoxAttrs, type TextColorAttrs, type TextEffectAttrs, type TrackedChangeMarkAttrs, type UnderlineAttrs, schema, singletonManager };
@@ -85,11 +85,38 @@ type FootnoteRefAttrs = {
85
85
  type CommentAttrs = {
86
86
  commentId: number;
87
87
  };
88
+ /**
89
+ * Provenance of a tracked change.
90
+ *
91
+ * - `"user"` — a normal tracked change authored by a person (or an
92
+ * accepted suggestion). Serializes to OOXML `w:ins` / `w:del` /
93
+ * `w:rPrChange`.
94
+ * - `"suggested"` — an AI-proposed edit rendered with the tracked-change
95
+ * visual grammar but ALWAYS stripped from serialized DOCX output until
96
+ * accepted. Suggested marks never round-trip through OOXML; parsing a
97
+ * DOCX can only ever produce `"user"` marks.
98
+ */
99
+ declare const TRACKED_CHANGE_PROVENANCE_VALUES: readonly ["user", "suggested"];
100
+ type TrackedChangeProvenance = (typeof TRACKED_CHANGE_PROVENANCE_VALUES)[number];
88
101
  type TrackedChangeMarkAttrs = {
89
102
  revisionId: number;
90
103
  author: string;
91
- date?: string;
92
- moveKind?: "moveTo" | "moveFrom";
104
+ date?: string; /** Optional author initials (w:initials) carried through the round-trip. */
105
+ initials?: string;
106
+ moveKind?: "moveTo" | "moveFrom"; /** Defaults to `"user"`; `"suggested"` for AI-proposed, non-serialized edits. */
107
+ provenance: TrackedChangeProvenance;
108
+ /**
109
+ * Groups every mark belonging to one logical suggestion so the host can
110
+ * accept/reject them together. Absent for `"user"` provenance (the mark's
111
+ * `null` default is normalized to absent by the attrs reader).
112
+ */
113
+ suggestionId?: string;
114
+ };
115
+ /** Run-property revisions carried through the editable model. */
116
+ type RunPropertyChangeMarkAttrs = {
117
+ changes: document_d_exports.RunPropertyChange[]; /** See {@link TrackedChangeProvenance}. Defaults to `"user"`. */
118
+ provenance: TrackedChangeProvenance;
119
+ suggestionId?: string;
93
120
  };
94
121
  type RunFormattingOverrideAttrs = { [K in keyof Pick<document_d_exports.TextFormatting, "bold" | "italic" | "strike" | "doubleStrike" | "allCaps" | "smallCaps" | "hidden" | "emboss" | "imprint" | "shadow" | "outline" | "rtl">]?: false } & {
95
122
  underline?: "none";
@@ -120,4 +147,4 @@ type HyperlinkAttrs = {
120
147
  _docxHyperlinkIndex?: number;
121
148
  };
122
149
  //#endregion
123
- export { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunShadingAttrs, StrikeAttrs, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, UnderlineAttrs };
150
+ export { CharacterSpacingAttrs, CharacterStyleAttrs, CommentAttrs, EmphasisMarkAttrs, FontFamilyAttrs, FontSizeAttrs, FootnoteRefAttrs, HighlightAttrs, HyperlinkAttrs, LanguageAttrs, RunFormattingOverrideAttrs, RunPropertyChangeMarkAttrs, RunShadingAttrs, StrikeAttrs, TRACKED_CHANGE_PROVENANCE_VALUES, TextColorAttrs, TextEffectAttrs, TrackedChangeMarkAttrs, TrackedChangeProvenance, UnderlineAttrs };
@@ -0,0 +1,15 @@
1
+ //#region src/prosemirror/schema/marks.ts
2
+ /**
3
+ * Provenance of a tracked change.
4
+ *
5
+ * - `"user"` — a normal tracked change authored by a person (or an
6
+ * accepted suggestion). Serializes to OOXML `w:ins` / `w:del` /
7
+ * `w:rPrChange`.
8
+ * - `"suggested"` — an AI-proposed edit rendered with the tracked-change
9
+ * visual grammar but ALWAYS stripped from serialized DOCX output until
10
+ * accepted. Suggested marks never round-trip through OOXML; parsing a
11
+ * DOCX can only ever produce `"user"` marks.
12
+ */
13
+ const TRACKED_CHANGE_PROVENANCE_VALUES = ["user", "suggested"];
14
+ //#endregion
15
+ export { TRACKED_CHANGE_PROVENANCE_VALUES };
@@ -1,4 +1,5 @@
1
1
  import { document_d_exports } from "../../types/document.js";
2
+ import { TrackedChangeProvenance } from "./marks.js";
2
3
  import { OutlineStyleAttr } from "../../types/documentEnumValues.js";
3
4
  import { SpacingExplicit } from "../../types/formatting.js";
4
5
  import { ParagraphDirection } from "../paragraphDirection.js";
@@ -21,8 +22,10 @@ type ParagraphAttrs = {
21
22
  spaceAfter?: number;
22
23
  lineSpacing?: number;
23
24
  lineSpacingRule?: document_d_exports.LineSpacingRule;
25
+ snapToGrid?: boolean;
24
26
  spacingExplicit?: SpacingExplicit; /** Layout provenance: document defaults survive on empty paragraphs. */
25
- spacingFromDocDefaults?: SpacingExplicit;
27
+ spacingFromDocDefaults?: SpacingExplicit; /** Layout provenance: implicit default-style spacing survives on empty paragraphs. */
28
+ spacingFromImplicitDefaultStyle?: SpacingExplicit;
26
29
  indentLeft?: number;
27
30
  indentRight?: number;
28
31
  indentFirstLine?: number;
@@ -88,7 +91,8 @@ type ParagraphAttrs = {
88
91
  tabs?: document_d_exports.TabStop[];
89
92
  pageBreakBefore?: boolean; /** Word's cached rendered-page-break marker; preserved for round-trip only. */
90
93
  renderedPageBreakBefore?: boolean; /** Internal import marker for a paragraph whose only run content is a hard page break. */
91
- _pageBreakCarrier?: boolean;
94
+ _pageBreakCarrier?: boolean; /** Internal import marker for a hard page break after this paragraph's text. */
95
+ _trailingPageBreak?: boolean;
92
96
  keepNext?: boolean;
93
97
  keepLines?: boolean;
94
98
  widowControl?: boolean; /** Contextual spacing — suppress space between same-style paragraphs */
@@ -149,6 +153,12 @@ type ParagraphAttrs = {
149
153
  * `del`. Stored as a discriminated union to mirror folio's
150
154
  * `TrackedChangeWrapperType` model rather than two parallel attrs. */
151
155
  pPrMark?: document_d_exports.ParagraphMarkChange;
156
+ /**
157
+ * Marks this whole paragraph as a *suggested* insertion (AI proposal). The
158
+ * paragraph is dropped from serialized DOCX until accepted; accepting turns
159
+ * it into a real inserted-paragraph tracked change (paragraph-mark `w:ins`).
160
+ */
161
+ _suggestedInsert?: SuggestedStructuralMarker | null;
152
162
  };
153
163
  /**
154
164
  * Image position for floating images (horizontal and vertical positioning)
@@ -337,7 +347,26 @@ type TextBoxAttrs = {
337
347
  distRight?: number; /** Position for floating/anchored text boxes */
338
348
  position?: ImagePositionAttrs; /** Original DOCX placement hint for save-path reconstruction. */
339
349
  _docxPlacement?: "standalone" | "inlineWithPrevious"; /** Original DOCX paragraph group for standalone text-box reconstruction. */
340
- _docxGroupId?: string;
350
+ _docxGroupId?: string; /** Inline anchor linking this block node to its source run position. */
351
+ _docxAnchorId?: string; /** Original run-level revision wrapper for save-path reconstruction. */
352
+ _docxTrackedChange?: {
353
+ type: "insertion";
354
+ info: document_d_exports.TrackedChangeInfo;
355
+ } | {
356
+ type: "deletion";
357
+ info: document_d_exports.TrackedChangeInfo;
358
+ } | {
359
+ type: "moveFrom";
360
+ info: document_d_exports.TrackedChangeInfo;
361
+ } | {
362
+ type: "moveTo";
363
+ info: document_d_exports.TrackedChangeInfo;
364
+ }; /** Original inline content-control ancestry for save-path reconstruction. */
365
+ _docxInlineSdts?: SdtAttrs[];
366
+ };
367
+ /** Internal inline position marker for an extracted text box block. */
368
+ type TextBoxAnchorAttrs = {
369
+ anchorId: string;
341
370
  };
342
371
  /**
343
372
  * Table node attributes
@@ -360,6 +389,12 @@ type TableAttrs = {
360
389
  _resolvedIndent?: NonNullable<document_d_exports.TableFormatting["indent"]>; /** Original table formatting from DOCX for lossless round-trip serialization */
361
390
  _originalFormatting?: document_d_exports.TableFormatting; /** Tracked table property changes (w:tblPrChange) for round-trip + accept/reject */
362
391
  tblPrChange?: document_d_exports.TablePropertyChange[];
392
+ /**
393
+ * Marks this whole table as a *suggested* insertion (AI proposal). The table
394
+ * is dropped from serialized DOCX until accepted; because OOXML has no tracked
395
+ * whole-table-insert primitive, accepting applies it directly.
396
+ */
397
+ _suggestedInsert?: SuggestedStructuralMarker | null;
363
398
  };
364
399
  /**
365
400
  * Table row attributes
@@ -371,6 +406,49 @@ type TableRowAttrs = {
371
406
  hidden?: boolean; /** Original row formatting from DOCX for lossless round-trip serialization */
372
407
  _originalFormatting?: document_d_exports.TableRowFormatting; /** Tracked row property changes (w:trPrChange) for round-trip + accept/reject */
373
408
  trPrChange?: document_d_exports.TableRowPropertyChange[];
409
+ } & ({
410
+ /**
411
+ * Tracked structural row insertion (w:trPr/w:ins). A `"suggested"`
412
+ * provenance marks a whole-row AI proposal: stripped from serialized DOCX
413
+ * until accepted, at which point it becomes a real (user) `trIns`. Rows use
414
+ * this, NOT `_suggestedInsert` (that marker is paragraph/table only).
415
+ */
416
+ trIns: {
417
+ revisionId: number;
418
+ author: string;
419
+ date?: string | null;
420
+ initials?: string | null;
421
+ provenance?: TrackedChangeProvenance;
422
+ suggestionId?: string | null;
423
+ };
424
+ trDel?: never;
425
+ } | {
426
+ trIns?: never; /** Tracked structural row deletion (w:trPr/w:del). */
427
+ trDel: {
428
+ revisionId: number;
429
+ author: string;
430
+ date?: string | null;
431
+ initials?: string | null;
432
+ provenance?: TrackedChangeProvenance;
433
+ suggestionId?: string | null;
434
+ };
435
+ } | {
436
+ trIns?: never;
437
+ trDel?: never;
438
+ });
439
+ /**
440
+ * A whole-node *suggested* insertion marker (AI proposal) carried on a
441
+ * paragraph or table node. The node is dropped entirely from serialized DOCX
442
+ * until accepted; accepting converts it to a real tracked change (paragraph
443
+ * mark `w:ins`) or, where OOXML has no tracked representation (whole table),
444
+ * applies it directly.
445
+ */
446
+ type SuggestedStructuralMarker = {
447
+ suggestionId: string;
448
+ revisionId: number;
449
+ author: string;
450
+ date?: string | null;
451
+ initials?: string | null;
374
452
  };
375
453
  /**
376
454
  * Table cell attributes
@@ -385,7 +463,8 @@ type TableCellAttrs = {
385
463
  backgroundColor?: string; /** Resolved source color. PM-only; distinguishes theme rendering from a user override. */
386
464
  _resolvedBackgroundColor?: string; /** OOXML text direction (e.g. 'tbRl', 'btLr') */
387
465
  textDirection?: NonNullable<document_d_exports.TableCellFormatting["textDirection"]>; /** No text wrapping in cell */
388
- noWrap?: boolean; /** Cell borders full BorderSpec per side (style, color, size) */
466
+ noWrap?: boolean; /** Effective end-of-cell marker suppression (`w:hideMark`). */
467
+ hideMark?: boolean; /** Cell borders — full BorderSpec per side (style, color, size) */
389
468
  borders?: document_d_exports.TableCellBorders; /** Cell margins/padding in twips per side */
390
469
  margins?: {
391
470
  top?: number;
@@ -394,9 +473,35 @@ type TableCellAttrs = {
394
473
  right?: number;
395
474
  }; /** Original cell formatting from DOCX for lossless round-trip serialization */
396
475
  _originalFormatting?: document_d_exports.TableCellFormatting; /** Tracked cell property changes (w:tcPrChange) for round-trip + accept/reject */
397
- tcPrChange?: document_d_exports.TableCellPropertyChange[]; /** Preserve a DOCX vMerge restart even when PM cannot model it as a rowspan. */
476
+ tcPrChange?: document_d_exports.TableCellPropertyChange[]; /** Tracked cell structural revision for round-trip + accept/reject. */
477
+ cellMarker?: {
478
+ kind: "ins" | "del";
479
+ info: {
480
+ revisionId: number;
481
+ author: string;
482
+ date?: string | null;
483
+ initials?: string | null; /** `"suggested"` marks this as an AI proposal (stripped until accepted). */
484
+ provenance?: TrackedChangeProvenance;
485
+ suggestionId?: string | null;
486
+ };
487
+ } | {
488
+ kind: "merge";
489
+ /**
490
+ * Merge markers resolve via cell-merge resolution and are never
491
+ * produced in suggested mode (cell merge/split reports
492
+ * `unsupportedMode`), so they carry no suggestion provenance.
493
+ */
494
+ info: {
495
+ revisionId: number;
496
+ author: string;
497
+ date?: string | null;
498
+ initials?: string | null;
499
+ };
500
+ verticalMerge?: "continue" | "rest";
501
+ verticalMergeOriginal?: "continue" | "rest";
502
+ }; /** Preserve a DOCX vMerge restart even when PM cannot model it as a rowspan. */
398
503
  _preserveVMergeRestart?: boolean; /** Original DOCX vMerge continuation cells skipped into this PM rowspan. */
399
504
  _docxVMergeContinuationCells?: document_d_exports.TableCell[];
400
505
  };
401
506
  //#endregion
402
- export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs };
507
+ export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, SuggestedStructuralMarker, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAnchorAttrs, TextBoxAttrs };
@@ -71,6 +71,7 @@ function extractSelectionState(state) {
71
71
  paragraphFormatting.lineSpacing = paragraph.attrs["lineSpacing"];
72
72
  paragraphFormatting.lineSpacingRule = paragraph.attrs["lineSpacingRule"];
73
73
  }
74
+ if (typeof paragraph.attrs["snapToGrid"] === "boolean") paragraphFormatting.snapToGrid = paragraph.attrs["snapToGrid"];
74
75
  if (paragraph.attrs["numPr"]) paragraphFormatting.numPr = paragraph.attrs["numPr"];
75
76
  if (paragraph.attrs["indentLeft"]) paragraphFormatting.indentLeft = paragraph.attrs["indentLeft"];
76
77
  if (paragraph.attrs["indentRight"]) paragraphFormatting.indentRight = paragraph.attrs["indentRight"];
@@ -27,6 +27,7 @@ function paragraphAttrsFromResolvedStyle(resolved) {
27
27
  spaceAfter: ppr?.spaceAfter ?? null,
28
28
  lineSpacing: ppr?.lineSpacing ?? null,
29
29
  lineSpacingRule: ppr?.lineSpacingRule ?? null,
30
+ snapToGrid: ppr?.snapToGrid ?? null,
30
31
  indentLeft: ppr?.indentLeft ?? null,
31
32
  indentRight: ppr?.indentRight ?? null,
32
33
  indentFirstLine: ppr?.indentFirstLine ?? null,
@@ -0,0 +1,9 @@
1
+ import { document_d_exports } from "../types/document.js";
2
+
3
+ //#region src/prosemirror/tableCellMergeRevision.d.ts
4
+ type TableCellMergeChange = Extract<NonNullable<document_d_exports.TableCell["structuralChange"]>, {
5
+ type: "tableCellMerge";
6
+ }>;
7
+ declare const getTableCellMergeChange: (value: unknown) => TableCellMergeChange | null;
8
+ //#endregion
9
+ export { TableCellMergeChange, getTableCellMergeChange };
@@ -0,0 +1,22 @@
1
+ //#region src/prosemirror/tableCellMergeRevision.ts
2
+ const isRecord = (value) => typeof value === "object" && value !== null;
3
+ const isVerticalMergeRevisionValue = (value) => value === "continue" || value === "rest";
4
+ const getTableCellMergeChange = (value) => {
5
+ if (!isRecord(value)) return null;
6
+ const change = value["structuralChange"];
7
+ if (!isRecord(change) || change["type"] !== "tableCellMerge") return null;
8
+ const info = change["info"];
9
+ if (!isRecord(info) || typeof info["id"] !== "number" || typeof info["author"] !== "string") return null;
10
+ return {
11
+ type: "tableCellMerge",
12
+ info: {
13
+ id: info["id"],
14
+ author: info["author"],
15
+ ...typeof info["date"] === "string" ? { date: info["date"] } : {}
16
+ },
17
+ ...isVerticalMergeRevisionValue(change["verticalMerge"]) ? { verticalMerge: change["verticalMerge"] } : {},
18
+ ...isVerticalMergeRevisionValue(change["verticalMergeOriginal"]) ? { verticalMergeOriginal: change["verticalMergeOriginal"] } : {}
19
+ };
20
+ };
21
+ //#endregion
22
+ export { getTableCellMergeChange };
@@ -0,0 +1,9 @@
1
+ import { TextBoxAnchorAttrs } from "./schema/nodes.js";
2
+ import { ReadProseMirrorAttrsResult } from "./attrs/index.js";
3
+ import { Node } from "prosemirror-model";
4
+
5
+ //#region src/prosemirror/textBoxAnchorAttrs.d.ts
6
+ declare const readTextBoxAnchorAttrs: (node: Node) => ReadProseMirrorAttrsResult<TextBoxAnchorAttrs>;
7
+ declare const expectTextBoxAnchorAttrs: (node: Node) => TextBoxAnchorAttrs;
8
+ //#endregion
9
+ export { expectTextBoxAnchorAttrs, readTextBoxAnchorAttrs };
@@ -0,0 +1,33 @@
1
+ import { panic } from "better-result";
2
+ //#region src/prosemirror/textBoxAnchorAttrs.ts
3
+ const attrsCache = /* @__PURE__ */ new WeakMap();
4
+ const readTextBoxAnchorAttrs = (node) => {
5
+ const issues = [];
6
+ if (node.type.name !== "textBoxAnchor") issues.push({
7
+ path: "textBoxAnchor.type.name",
8
+ message: `Expected textBoxAnchor, got ${node.type.name}.`
9
+ });
10
+ const anchorId = node.attrs["anchorId"];
11
+ if (typeof anchorId !== "string" || anchorId.length === 0) issues.push({
12
+ path: "textBoxAnchor.attrs.anchorId",
13
+ message: "Expected a non-empty string."
14
+ });
15
+ if (issues.length > 0 || typeof anchorId !== "string") return {
16
+ ok: false,
17
+ issues
18
+ };
19
+ return {
20
+ ok: true,
21
+ value: { anchorId }
22
+ };
23
+ };
24
+ const expectTextBoxAnchorAttrs = (node) => {
25
+ const cached = attrsCache.get(node);
26
+ if (cached) return cached;
27
+ const result = readTextBoxAnchorAttrs(node);
28
+ if (!result.ok) panic(`Invalid ProseMirror text box anchor attrs:\n${result.issues.map((issue) => `${issue.path}: ${issue.message}`).join("\n")}`);
29
+ attrsCache.set(node, result.value);
30
+ return result.value;
31
+ };
32
+ //#endregion
33
+ export { expectTextBoxAnchorAttrs, readTextBoxAnchorAttrs };
@@ -32,7 +32,7 @@ type TrackedChangeEntry = {
32
32
  * - `tablePropertiesChanged` — table-level formatting
33
33
  * (`<w:tblPrChange>`).
34
34
  */
35
- type: "insertion" | "deletion" | "replacement" | "paragraphMarkInsertion" | "paragraphMarkDeletion" | "paragraphPropertiesChanged" | "rowInserted" | "rowDeleted" | "rowPropertiesChanged" | "cellInserted" | "cellDeleted" | "cellMerged" | "cellPropertiesChanged" | "tableInserted" | "tableDeleted" | "tablePropertiesChanged";
35
+ type: "insertion" | "deletion" | "replacement" | "runPropertiesChanged" | "paragraphMarkInsertion" | "paragraphMarkDeletion" | "paragraphPropertiesChanged" | "rowInserted" | "rowDeleted" | "rowPropertiesChanged" | "cellInserted" | "cellDeleted" | "cellMerged" | "cellPropertiesChanged" | "tableInserted" | "tableDeleted" | "tablePropertiesChanged";
36
36
  /**
37
37
  * Affected text. For inline types this is the run's text; for
38
38
  * structural types it's the surrounding paragraph / cell content
@@ -1,3 +1,5 @@
1
+ import { expectRunPropertyChangeMarkAttrs } from "../attrs/index.js";
2
+ import { getTableCellMergeChange } from "../tableCellMergeRevision.js";
1
3
  //#region src/prosemirror/utils/extractTrackedChanges.ts
2
4
  const EMPTY_RESULT = {
3
5
  entries: [],
@@ -23,7 +25,8 @@ function extractTrackedChanges(state) {
23
25
  const insertionType = schema.marks["insertion"];
24
26
  const deletionType = schema.marks["deletion"];
25
27
  const commentType = schema.marks["comment"];
26
- if (!insertionType && !deletionType) return EMPTY_RESULT;
28
+ const runPropertyChangeType = schema.marks["runPropertyChange"];
29
+ if (!insertionType && !deletionType && !runPropertyChangeType) return EMPTY_RESULT;
27
30
  const raw = [];
28
31
  const commentToRevision = /* @__PURE__ */ new Map();
29
32
  const commentMetadata = /* @__PURE__ */ new Map();
@@ -116,6 +119,20 @@ function extractTrackedChanges(state) {
116
119
  revisionId: cellMarker.info.revisionId
117
120
  });
118
121
  }
122
+ const continuationCells = node.attrs["_docxVMergeContinuationCells"];
123
+ if (Array.isArray(continuationCells)) for (const continuationCell of continuationCells) {
124
+ const change = getTableCellMergeChange(continuationCell);
125
+ if (!change) continue;
126
+ raw.push({
127
+ type: "cellMerged",
128
+ text: node.textContent || "",
129
+ author: change.info.author,
130
+ date: change.info.date,
131
+ from: pos,
132
+ to: pos + node.nodeSize,
133
+ revisionId: change.info.id
134
+ });
135
+ }
119
136
  const tcPrChange = node.attrs["tcPrChange"];
120
137
  if (Array.isArray(tcPrChange)) for (const entry of tcPrChange) {
121
138
  if (!entry?.info || typeof entry.info.id !== "number") continue;
@@ -193,17 +210,31 @@ function extractTrackedChanges(state) {
193
210
  else if (node.type.name === "image") inlineText = node.attrs["alt"] || "image";
194
211
  else inlineText = node.type.name;
195
212
  let tcMark = null;
196
- for (const mark of node.marks) if (mark.type === insertionType || mark.type === deletionType) {
197
- raw.push({
198
- type: mark.type === insertionType ? "insertion" : "deletion",
199
- text: inlineText,
200
- author: mark.attrs["author"] || "",
201
- date: mark.attrs["date"],
202
- from: pos,
203
- to: pos + node.nodeSize,
204
- revisionId: mark.attrs["revisionId"]
205
- });
206
- tcMark = mark;
213
+ for (const mark of node.marks) {
214
+ if (mark.type === runPropertyChangeType) {
215
+ for (const change of expectRunPropertyChangeMarkAttrs(mark).changes) raw.push({
216
+ type: "runPropertiesChanged",
217
+ text: inlineText,
218
+ author: change.info.author,
219
+ date: change.info.date,
220
+ from: pos,
221
+ to: pos + node.nodeSize,
222
+ revisionId: change.info.id
223
+ });
224
+ continue;
225
+ }
226
+ if (mark.type === insertionType || mark.type === deletionType) {
227
+ raw.push({
228
+ type: mark.type === insertionType ? "insertion" : "deletion",
229
+ text: inlineText,
230
+ author: mark.attrs["author"] || "",
231
+ date: mark.attrs["date"],
232
+ from: pos,
233
+ to: pos + node.nodeSize,
234
+ revisionId: mark.attrs["revisionId"]
235
+ });
236
+ tcMark = mark;
237
+ }
207
238
  }
208
239
  if (commentType) {
209
240
  const commentMark = node.marks.find((m) => m.type === commentType);
@@ -239,7 +270,24 @@ function extractTrackedChanges(state) {
239
270
  cellPropertiesChanged: 3,
240
271
  paragraphMarkInsertion: 2,
241
272
  paragraphMarkDeletion: 2,
242
- paragraphPropertiesChanged: 2
273
+ paragraphPropertiesChanged: 2,
274
+ runPropertiesChanged: 1
275
+ };
276
+ const STRUCTURAL_FAMILY_BY_TYPE = {
277
+ tableInserted: "insertion",
278
+ rowInserted: "insertion",
279
+ cellInserted: "insertion",
280
+ paragraphMarkInsertion: "insertion",
281
+ tableDeleted: "deletion",
282
+ rowDeleted: "deletion",
283
+ cellDeleted: "deletion",
284
+ paragraphMarkDeletion: "deletion",
285
+ tablePropertiesChanged: "properties",
286
+ rowPropertiesChanged: "properties",
287
+ cellPropertiesChanged: "properties",
288
+ paragraphPropertiesChanged: "properties",
289
+ runPropertiesChanged: "properties",
290
+ cellMerged: "merge"
243
291
  };
244
292
  const isStructuralType = (t) => t in STRUCTURAL_PRIORITY;
245
293
  const slotByKey = /* @__PURE__ */ new Map();
@@ -256,7 +304,7 @@ function extractTrackedChanges(state) {
256
304
  ordered.push(entry);
257
305
  continue;
258
306
  }
259
- const key = `${entry.author}|${entry.date ?? ""}`;
307
+ const key = `${STRUCTURAL_FAMILY_BY_TYPE[entry.type] ?? entry.type}|${entry.author}|${entry.date ?? ""}`;
260
308
  const slot = slotByKey.get(key);
261
309
  if (slot === void 0) {
262
310
  slotByKey.set(key, ordered.push(entry) - 1);
@@ -1,4 +1,5 @@
1
- import { readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs } from "./attrs/index.js";
1
+ import { readBlockSdtAttrs, readCharacterSpacingMarkAttrs, readCharacterStyleMarkAttrs, readCommentMarkAttrs, readEmphasisMarkAttrs, readFieldAttrs, readFontFamilyMarkAttrs, readFontSizeMarkAttrs, readFootnoteRefMarkAttrs, readHardBreakAttrs, readHighlightMarkAttrs, readHyperlinkMarkAttrs, readImageAttrs, readLanguageMarkAttrs, readMathAttrs, readParagraphAttrs, readRunFormattingOverrideMarkAttrs, readRunPropertyChangeMarkAttrs, readRunShadingMarkAttrs, readSdtAttrs, readShapeAttrs, readStrikeMarkAttrs, readTableAttrs, readTableCellAttrs, readTableRowAttrs, readTextBoxAttrs, readTextColorMarkAttrs, readTextEffectMarkAttrs, readTrackedChangeMarkAttrs, readUnderlineMarkAttrs } from "./attrs/index.js";
2
+ import { readTextBoxAnchorAttrs } from "./textBoxAnchorAttrs.js";
2
3
  //#region src/prosemirror/validation.ts
3
4
  var ProseMirrorDocumentValidationError = class extends Error {
4
5
  issues;
@@ -48,6 +49,7 @@ const validateNodeAttrs = (node, path, issues) => {
48
49
  case "text":
49
50
  case "horizontalRule":
50
51
  case "pageBreak":
52
+ case "renderedPageBreak":
51
53
  case "tab": return;
52
54
  case "hardBreak":
53
55
  appendAttrIssues(path, readHardBreakAttrs(node), issues);
@@ -87,6 +89,9 @@ const validateNodeAttrs = (node, path, issues) => {
87
89
  case "textBox":
88
90
  appendAttrIssues(path, readTextBoxAttrs(node), issues);
89
91
  return;
92
+ case "textBoxAnchor":
93
+ appendAttrIssues(path, readTextBoxAnchorAttrs(node), issues);
94
+ return;
90
95
  default: issues.push({
91
96
  path: `${path}.type.name`,
92
97
  message: `Unsupported ProseMirror node type ${node.type.name}.`
@@ -155,6 +160,9 @@ const validateMarks = (marks, path, issues) => {
155
160
  case "deletion":
156
161
  appendAttrIssues(markPath, readTrackedChangeMarkAttrs(mark), issues);
157
162
  continue;
163
+ case "runPropertyChange":
164
+ appendAttrIssues(markPath, readRunPropertyChangeMarkAttrs(mark), issues);
165
+ continue;
158
166
  case "runFormattingOverride":
159
167
  appendAttrIssues(markPath, readRunFormattingOverrideMarkAttrs(mark), issues);
160
168
  continue;
@@ -41,7 +41,7 @@ var RemoteSelectionOverlay = class {
41
41
  if (!caret) continue;
42
42
  const caretElement = createOverlayElement(pagesContainer, CARET_CLASS, zIndex + 1);
43
43
  caretElement.dataset["clientId"] = String(selection.clientId);
44
- caretElement.style.background = selection.color;
44
+ caretElement.style.backgroundColor = selection.color;
45
45
  setBox(caretElement, {
46
46
  ...caret,
47
47
  width: 2
@@ -50,7 +50,7 @@ var RemoteSelectionOverlay = class {
50
50
  const label = createOverlayElement(pagesContainer, LABEL_CLASS, zIndex + 2);
51
51
  label.dataset["clientId"] = String(selection.clientId);
52
52
  label.textContent = selection.name;
53
- label.style.background = selection.color;
53
+ label.style.backgroundColor = selection.color;
54
54
  label.style.color = "var(--background, #fff)";
55
55
  label.style.fontSize = "10px";
56
56
  label.style.lineHeight = "1";
package/dist/server.d.ts CHANGED
@@ -2,7 +2,7 @@ import { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockPreview
2
2
  import { FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FolioDocumentOperation, FolioDocumentOperationAffectedTarget, FolioDocumentOperationBatch, FolioDocumentOperationCapabilities, FolioDocumentOperationIssue, FolioDocumentOperationMode, FolioDocumentOperationPrecondition, FolioDocumentOperationReceipt, FolioDocumentOperationRecovery, FolioDocumentOperationResult, FolioDocumentOperationStatus, FolioDocumentOperationStory, FolioDocumentOperationType, FolioDocumentOperationUndoFailureReason, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, assertSupportedFolioDocumentOperationVersion, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, isFolioDocumentOperationModeSupported, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch } from "./document-operations.js";
3
3
  import { FolioReviewChange, FolioReviewChangeKind } from "./ai-edits/read.js";
4
4
  import { ApplyFolioAIEditsToBufferOptions, ApplyFolioAIEditsToBufferResult, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FolioApplyDocumentOperationsOptions, FolioApplyDocumentOperationsToStoryOptions, FolioApplyOperationsOptions, FolioDocumentStory, FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, FolioDocxReviewer, FolioDocxReviewerOptions, FolioEditableDocumentStoryHandle, FolioReadReviewedStoryOptions, FolioResolveReviewedStoryOptions, FolioResolvedReviewedView, FolioReviewChangeFilter, FolioReviewComment, FolioReviewCommentFilter, FolioReviewCommentReply, FolioReviewReplyInput, FolioReviewedStory, FolioReviewedView, UnsupportedFolioReviewedViewError, applyFolioAIEditsToBuffer, isFolioResolvedReviewedView, isFolioReviewedView } from "./ai-edits/headless.js";
5
- import { createFolioAITextRangeHandle } from "./ai-edits/snapshot.js";
5
+ import { createFolioAITextRangeHandle, hashFolioAIBlockText, normalizeFolioAIBlockText } from "./ai-edits/snapshot.js";
6
6
  import { getFolioDocumentOutline, readFolioDocumentSection } from "./ai-edits/scoped-reading.js";
7
7
  import { DeriveBlockIdInput, FolioBlockId, deriveBlockId, getFolioParaIdFromBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
8
8
  import { DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, DocumentPreset, DocumentStyleSet } from "./style-sets/types.js";
@@ -13,8 +13,12 @@ import { createDocx } from "./docx/rezip.js";
13
13
  import { EnsureParaIdsError, EnsureParaIdsOptions, EnsureParaIdsResult, ensureParaIds } from "./docx/ensureParaIds.js";
14
14
  import { FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FolioDocumentMetadataProperty, FolioDocumentPrivacyArchiveError, FolioDocumentPrivacyOptions, FolioDocumentPrivacyReport, FolioDocumentPrivacyTransform, InvalidFolioDocumentPrivacyOptionsError, RewriteDocxMetadataPrivacyResult, isFolioDocumentPrivacyTransform, rewriteDocxMetadataPrivacy } from "./docx/metadataPrivacy.js";
15
15
  import { CreateCommentReplyInput, replyToComment } from "./docx/replyToComment.js";
16
- import { DocxArchiveError } from "./docx/server/boundedArchive.js";
16
+ import { DocxArchiveError, DocxArchiveOptions } from "./docx/server/boundedArchive.js";
17
+ import { EvaluateDocxXmlPatchProposalArgs, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FolioDocxPreparedXmlReplacement, FolioDocxXmlPatchProposal, FolioDocxXmlPatchProposalEvaluation, FolioDocxXmlPatchProposalIssue, FolioDocxXmlPatchProposalIssueCode, FolioDocxXmlPatchProposalLimits, FolioDocxXmlReplacement, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, evaluateDocxXmlPatchProposal, parseFolioDocxXmlPatchProposal } from "./docx/server/evaluateDocxXmlPatchProposal.js";
18
+ import { FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FolioDocxConformanceCheck, FolioDocxConformanceCheckId, FolioDocxConformanceCheckStatus, FolioDocxConformanceIssue, FolioDocxConformanceIssueCode, FolioDocxConformanceReport, FolioDocxConformanceStatus, ValidateDocxConformanceOptions, validateDocxConformance } from "./docx/server/validateDocxConformance.js";
19
+ import { ApplyDocxXmlPatchProposalArgs, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, FolioDocxXmlPatchApplicationReceipt, UnsupportedFolioDocxXmlPatchApplicationProfileError, applyDocxXmlPatchProposal } from "./docx/server/applyDocxXmlPatchProposal.js";
17
20
  import { DocxParagraphSource, ExtractedDocxParagraph, ExtractedDocxText, extractDocxText } from "./docx/server/extractDocxText.js";
21
+ import { FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FolioDocxInspectedXmlPart, FolioDocxPackageInspection, FolioDocxPackageInspectionError, FolioDocxPackageInspectionErrorCode, FolioDocxPackageInspectionLimits, FolioDocxPackagePart, FolioDocxPackagePartKind, InspectDocxPackageOptions, inspectDocxPackage } from "./docx/server/inspectDocxPackage.js";
18
22
  import { GenerateRedlineDocxOptions, GenerateRedlineDocxResult, GenerateRedlineUnprocessedStory, InvalidGenerateRedlineDocxOptionsError, generateRedlineDocx } from "./redline.js";
19
23
  import { FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, FolioBlockDiff, FolioCompareDocxVersionsOptions, FolioDocumentMetadataValue, FolioFormatProperty, FolioMetadataDiff, FolioStoryDiff, FolioVersionBlockHandle, FolioVersionComparisonPrivacyTransform, FolioVersionComparisonScope, FolioVersionDiff, FolioVersionDiffPrivacyOptions, FolioVersionDiffPrivacyReport, FolioVersionDiffSegment, FolioVersionDiffSummaryCounts, InvalidFolioVersionComparisonOptionsError, applyFolioVersionDiffPrivacy, compareDocxVersions, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope } from "./version-comparison.js";
20
- export { type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxParagraphSource, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type ExtractDocumentStyleSetOptions, type ExtractedDocxParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineFormatting, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioCompareDocxVersionsOptions, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewedStory, type FolioReviewedView, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, type GenerateRedlineUnprocessedStory, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioReviewedViewError, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, assertSupportedFolioDocumentOperationVersion, compareDocxVersions, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, ensureParaIds, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, inspectDocumentStyles, inspectDocumentStylesFromDocx, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy };
24
+ export { type ApplyDocxXmlPatchProposalArgs, type ApplyFolioAIEditsToBufferOptions, type ApplyFolioAIEditsToBufferResult, type CreateCommentReplyInput, type CreateEmptyDocumentOptions, DOCUMENT_PRESET_VERSION, DOCUMENT_STYLE_SET_VERSION, type DeriveBlockIdInput, type DocumentPreset, type DocumentStyleCatalog, type DocumentStyleCatalogEntry, type DocumentStyleSet, DocxArchiveError, type DocxArchiveOptions, type DocxParagraphSource, EnsureParaIdsError, type EnsureParaIdsOptions, type EnsureParaIdsResult, type EvaluateDocxXmlPatchProposalArgs, type ExtractDocumentStyleSetOptions, type ExtractedDocxParagraph, type ExtractedDocxText, FOLIO_DOCUMENT_METADATA_PROPERTIES, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_DOCUMENT_PRIVACY_TRANSFORMS, FOLIO_DOCX_CONFORMANCE_CHECKS, FOLIO_DOCX_CONFORMANCE_ISSUE_CODES, FOLIO_DOCX_CONFORMANCE_PROFILE, FOLIO_DOCX_CONFORMANCE_REPORT_VERSION, FOLIO_DOCX_PACKAGE_INSPECTION_DEFAULTS, FOLIO_DOCX_PACKAGE_INSPECTION_ERROR_CODES, FOLIO_DOCX_PACKAGE_INSPECTION_VERSION, FOLIO_DOCX_XML_PATCH_APPLICATION_PROFILE, FOLIO_DOCX_XML_PATCH_APPLICATION_VERSION, FOLIO_DOCX_XML_PATCH_PROPOSAL_DEFAULTS, FOLIO_DOCX_XML_PATCH_PROPOSAL_ISSUE_CODES, FOLIO_DOCX_XML_PATCH_PROPOSAL_PROFILE, FOLIO_DOCX_XML_PATCH_PROPOSAL_VERSION, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FOLIO_VERSION_COMPARISON_PRIVACY_TRANSFORMS, FOLIO_VERSION_COMPARISON_SCOPES, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIComment, type FolioAIEditApplyMode, type FolioAIEditApplyResult, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditSnapshot, type FolioAIInlineFormatting, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsOptions, type FolioApplyDocumentOperationsToStoryOptions, type FolioApplyOperationsOptions, type FolioBlockDiff, type FolioBlockId, type FolioCompareDocxVersionsOptions, type FolioDocumentMetadataProperty, type FolioDocumentMetadataValue, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, FolioDocumentPrivacyArchiveError, type FolioDocumentPrivacyOptions, type FolioDocumentPrivacyReport, type FolioDocumentPrivacyTransform, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioDocxConformanceCheck, type FolioDocxConformanceCheckId, type FolioDocxConformanceCheckStatus, type FolioDocxConformanceIssue, type FolioDocxConformanceIssueCode, type FolioDocxConformanceReport, type FolioDocxConformanceStatus, type FolioDocxInspectedXmlPart, type FolioDocxPackageInspection, FolioDocxPackageInspectionError, type FolioDocxPackageInspectionErrorCode, type FolioDocxPackageInspectionLimits, type FolioDocxPackagePart, type FolioDocxPackagePartKind, type FolioDocxPreparedXmlReplacement, FolioDocxReviewer, type FolioDocxReviewerOptions, type FolioDocxXmlPatchApplication, FolioDocxXmlPatchApplicationError, type FolioDocxXmlPatchApplicationReceipt, type FolioDocxXmlPatchProposal, type FolioDocxXmlPatchProposalEvaluation, type FolioDocxXmlPatchProposalIssue, type FolioDocxXmlPatchProposalIssueCode, type FolioDocxXmlPatchProposalLimits, type FolioDocxXmlReplacement, type FolioEditableDocumentStoryHandle, type FolioFormatProperty, type FolioMetadataDiff, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeFilter, type FolioReviewChangeKind, type FolioReviewComment, type FolioReviewCommentFilter, type FolioReviewCommentReply, type FolioReviewReplyInput, type FolioReviewedStory, type FolioReviewedView, type FolioStoryDiff, type FolioVersionBlockHandle, type FolioVersionComparisonPrivacyTransform, type FolioVersionComparisonScope, type FolioVersionDiff, type FolioVersionDiffPrivacyOptions, type FolioVersionDiffPrivacyReport, type FolioVersionDiffSegment, type FolioVersionDiffSummaryCounts, type GenerateRedlineDocxOptions, type GenerateRedlineDocxResult, type GenerateRedlineUnprocessedStory, type InspectDocxPackageOptions, InvalidFolioDocumentOperationBatchError, InvalidFolioDocumentPrivacyOptionsError, InvalidFolioDocxXmlPatchProposalError, InvalidFolioDocxXmlPatchProposalOptionsError, InvalidFolioVersionComparisonOptionsError, InvalidGenerateRedlineDocxOptionsError, type RewriteDocxMetadataPrivacyResult, STELLA_STYLE_SET_NAME, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioDocxXmlPatchApplicationProfileError, UnsupportedFolioReviewedViewError, type ValidateDocxConformanceOptions, applyDocxXmlPatchProposal, applyFolioAIEditsToBuffer, applyFolioVersionDiffPrivacy, assertSupportedFolioDocumentOperationVersion, compareDocxVersions, createDocx, createEmptyDocument, createFolioAITextRangeHandle, createStellaStyleDocumentPreset, createStellaStyleSet, deriveBlockId, ensureParaIds, evaluateDocxXmlPatchProposal, extractDocumentStyleSet, extractDocumentStyleSetFromDocx, extractDocxText, generateRedlineDocx, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOutline, getFolioParaIdFromBlockId, hashFolioAIBlockText, inspectDocumentStyles, inspectDocumentStylesFromDocx, inspectDocxPackage, isFolioBlockId, isFolioDocumentOperationModeSupported, isFolioDocumentPrivacyTransform, isFolioResolvedReviewedView, isFolioReviewedView, isFolioVersionComparisonPrivacyTransform, isFolioVersionComparisonScope, isSequentialFolioBlockId, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, parseFolioDocxXmlPatchProposal, readFolioDocumentSection, replyToComment, rewriteDocxMetadataPrivacy, validateDocxConformance };