@stll/folio-core 0.72.0 → 0.74.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 (244) hide show
  1. package/README.md +12 -6
  2. package/dist/ai-edits/applyTypes.d.ts +85 -0
  3. package/dist/ai-edits/applyTypes.js +24 -0
  4. package/dist/ai-edits/clean-text.d.ts +7 -1
  5. package/dist/ai-edits/clean-text.js +23 -2
  6. package/dist/ai-edits/finalSectionReview.d.ts +1 -1
  7. package/dist/ai-edits/headless.d.ts +29 -147
  8. package/dist/ai-edits/headless.js +215 -1639
  9. package/dist/ai-edits/index.d.ts +3 -3
  10. package/dist/ai-edits/index.js +2 -3
  11. package/dist/ai-edits/pending-suggestions.d.ts +14 -4
  12. package/dist/ai-edits/pending-suggestions.js +183 -90
  13. package/dist/ai-edits/pendingJoin.js +6 -1
  14. package/dist/ai-edits/retired-comment-receipts.d.ts +1 -1
  15. package/dist/ai-edits/snapshot.js +9 -4
  16. package/dist/ai-edits/table-cell-mutations.d.ts +1 -1
  17. package/dist/ai-edits/table-cell-mutations.js +2 -2
  18. package/dist/ai-edits/table-geometry.d.ts +1 -1
  19. package/dist/ai-edits/table-geometry.js +1 -1
  20. package/dist/ai-edits/table-row-column-mutations.d.ts +1 -1
  21. package/dist/ai-edits/table-row-column-mutations.js +1 -1
  22. package/dist/ai-edits/tableNodes.d.ts +38 -0
  23. package/dist/ai-edits/tableNodes.js +86 -0
  24. package/dist/ai-edits/tracked-batch-fidelity.d.ts +1 -1
  25. package/dist/ai-edits/tracked-batch-fidelity.js +1 -1
  26. package/dist/ai-edits/undefinedReferences.d.ts +7 -0
  27. package/dist/canonical/batchCommentReferences.js +1 -0
  28. package/dist/canonical/canonicalInlineGaps.d.ts +56 -0
  29. package/dist/canonical/canonicalInlineGaps.js +118 -0
  30. package/dist/canonical/canonicalInlineProjection.d.ts +4 -13
  31. package/dist/canonical/canonicalInlineProjection.js +5 -27
  32. package/dist/canonical/canonicalProjectionBlocks.d.ts +4 -4
  33. package/dist/canonical/canonicalPublicOperations.js +282 -75
  34. package/dist/canonical/canonicalSelection.js +1 -1
  35. package/dist/canonical/canonicalSession.d.ts +9 -1
  36. package/dist/canonical/canonicalSession.js +106 -33
  37. package/dist/compare/compare.d.ts +1 -1
  38. package/dist/compare/inline-atoms-model.d.ts +1 -1
  39. package/dist/compare/inline-atoms.d.ts +2 -2
  40. package/dist/compare/inline-provenance-model.d.ts +1 -1
  41. package/dist/compare/inline-provenance.d.ts +2 -2
  42. package/dist/compat/eigenpal.d.ts +3 -3
  43. package/dist/compat/eigenpal.js +2 -3
  44. package/dist/controller/autocompleteSuggestion.js +1 -1
  45. package/dist/controller/canonicalClipboard.d.ts +13 -3
  46. package/dist/controller/canonicalClipboard.js +186 -50
  47. package/dist/controller/canonicalClipboardResources.d.ts +9 -1
  48. package/dist/controller/canonicalClipboardResources.js +22 -2
  49. package/dist/controller/canonicalComposition.js +1 -1
  50. package/dist/controller/canonicalInput.js +1 -1
  51. package/dist/controller/canonicalPresence.js +1 -1
  52. package/dist/controller/canonicalReview.d.ts +1 -1
  53. package/dist/controller/canonicalReview.js +1 -1
  54. package/dist/controller/canonicalRoomAuthority.js +1 -1
  55. package/dist/controller/canonicalRoomWire.js +1 -1
  56. package/dist/controller/canonicalStructure.js +1 -1
  57. package/dist/controller/canonicalTabRoom.js +1 -1
  58. package/dist/controller/canonicalWatermark.d.ts +10 -0
  59. package/dist/controller/canonicalWatermark.js +37 -0
  60. package/dist/controller/canonicalYjsRoom.js +1 -1
  61. package/dist/controller/hiddenEditorApi.d.ts +1 -1
  62. package/dist/controller/hiddenEditorApi.js +2 -17
  63. package/dist/controller/hiddenEditorManager.d.ts +4 -3
  64. package/dist/controller/hiddenEditorManager.js +79 -23
  65. package/dist/document-operations.d.ts +1 -14
  66. package/dist/document-operations.js +1 -278
  67. package/dist/docx/canonicalSave.d.ts +1 -1
  68. package/dist/docx/canonicalSave.js +1 -1
  69. package/dist/docx/canonicalSessionInput.js +1 -1
  70. package/dist/docx/containerChildren.js +1 -1
  71. package/dist/docx/createDocx.d.ts +4 -0
  72. package/dist/docx/createDocx.js +6 -0
  73. package/dist/docx/paragraphParser.js +2 -2
  74. package/dist/docx/paragraphPropertySource.d.ts +1 -1
  75. package/dist/docx/parser.js +1 -1
  76. package/dist/docx/reviewResolutionProvenance.d.ts +3 -2
  77. package/dist/docx/reviewResolutionProvenance.js +31 -8
  78. package/dist/docx/revisionIdNormalization.js +30 -7
  79. package/dist/docx/rezip.d.ts +1 -1
  80. package/dist/docx/rezip.js +1 -1
  81. package/dist/docx/serializer/tableSerializer.js +4 -36
  82. package/dist/docx/server/templatePlan/apply.d.ts +15 -0
  83. package/dist/docx/server/templatePlan/apply.js +658 -0
  84. package/dist/docx/server/templatePlan/blocks.d.ts +97 -0
  85. package/dist/docx/server/templatePlan/blocks.js +355 -0
  86. package/dist/docx/server/templatePlan/builders.d.ts +72 -0
  87. package/dist/docx/server/templatePlan/builders.js +237 -0
  88. package/dist/docx/server/templatePlan/emit.d.ts +118 -0
  89. package/dist/docx/server/templatePlan/emit.js +466 -0
  90. package/dist/docx/server/templatePlan/emphasis.d.ts +62 -0
  91. package/dist/docx/server/templatePlan/emphasis.js +173 -0
  92. package/dist/docx/server/templatePlan/inspect.d.ts +22 -0
  93. package/dist/docx/server/templatePlan/inspect.js +230 -0
  94. package/dist/docx/server/templatePlan/labels.d.ts +45 -0
  95. package/dist/docx/server/templatePlan/labels.js +155 -0
  96. package/dist/docx/server/templatePlan/package.d.ts +34 -0
  97. package/dist/docx/server/templatePlan/package.js +99 -0
  98. package/dist/docx/server/templatePlan/plan.d.ts +145 -0
  99. package/dist/docx/server/templatePlan/plan.js +875 -0
  100. package/dist/docx/server/templatePlan/planShape.d.ts +9 -0
  101. package/dist/docx/server/templatePlan/planShape.js +180 -0
  102. package/dist/docx/server/templatePlan/resources.d.ts +41 -0
  103. package/dist/docx/server/templatePlan/resources.js +136 -0
  104. package/dist/docx/server/templatePlan/story.d.ts +128 -0
  105. package/dist/docx/server/templatePlan/story.js +440 -0
  106. package/dist/docx/server/templatePlan/types.d.ts +442 -0
  107. package/dist/docx/server/templatePlan/types.js +29 -0
  108. package/dist/docx/server/templatePlan/verify.d.ts +40 -0
  109. package/dist/docx/server/templatePlan/verify.js +976 -0
  110. package/dist/docx/server/templatePlan/xml.d.ts +74 -0
  111. package/dist/docx/server/templatePlan/xml.js +125 -0
  112. package/dist/docx/settingsHeaderFooterUpdate.d.ts +9 -0
  113. package/dist/docx/settingsHeaderFooterUpdate.js +45 -10
  114. package/dist/docx/structuralXmlPatch.js +9 -1
  115. package/dist/docx/tableGridXml.d.ts +30 -0
  116. package/dist/docx/tableGridXml.js +54 -0
  117. package/dist/docx/tableParser.js +7 -0
  118. package/dist/i18n/loadMessages.d.ts +5 -0
  119. package/dist/i18n/loadMessages.js +46 -0
  120. package/dist/i18n/locales.d.ts +3 -0
  121. package/dist/i18n/locales.js +17 -0
  122. package/dist/i18n/messages.d.ts +3 -2
  123. package/dist/i18n/messages.js +4 -16
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +2 -3
  126. package/dist/internal/clipboardTransformPlugin.d.ts +3 -0
  127. package/dist/internal/clipboardTransformPlugin.js +13 -0
  128. package/dist/internal/extensionRuntime.d.ts +7 -0
  129. package/dist/internal/extensionRuntime.js +28 -0
  130. package/dist/internal/starterKitExtensions.d.ts +20 -0
  131. package/dist/internal/starterKitExtensions.js +123 -0
  132. package/dist/internal/wholeStoryRevisionResolution.js +1 -1
  133. package/dist/managers/ContextMenuManager.js +2 -1
  134. package/dist/managers/editorShortcuts.d.ts +1 -1
  135. package/dist/prosemirror/anchoredTextBoxes.d.ts +1 -1
  136. package/dist/prosemirror/attrs/index.js +1 -1
  137. package/dist/prosemirror/canonicalCommands.d.ts +1 -1
  138. package/dist/prosemirror/canonicalSelectionRange.d.ts +1 -1
  139. package/dist/prosemirror/canonicalSelectionRange.js +1 -1
  140. package/dist/prosemirror/canonicalTableCommands.js +3 -3
  141. package/dist/prosemirror/commands/comments.js +4 -4
  142. package/dist/prosemirror/commands/contentControls.d.ts +1 -1
  143. package/dist/prosemirror/commands/contentControls.js +1 -1
  144. package/dist/prosemirror/commands/formatPainter.d.ts +1 -1
  145. package/dist/prosemirror/commands/formatting.d.ts +1 -1
  146. package/dist/prosemirror/commands/pastePlainText.d.ts +1 -1
  147. package/dist/prosemirror/commands/pastePlainText.js +2 -3
  148. package/dist/prosemirror/commands/replaceRangeText.js +1 -1
  149. package/dist/prosemirror/commands/sectionBreak.js +1 -1
  150. package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +1 -1
  151. package/dist/prosemirror/commands/tableMergeFoldDecisions.d.ts +1 -1
  152. package/dist/prosemirror/commentRecords.d.ts +1 -1
  153. package/dist/prosemirror/commentRecords.js +2 -2
  154. package/dist/prosemirror/contentControlRevisions.d.ts +1 -1
  155. package/dist/prosemirror/conversion/fromProseDoc.d.ts +0 -5
  156. package/dist/prosemirror/conversion/fromProseDoc.js +2 -9
  157. package/dist/prosemirror/conversion/index.d.ts +2 -2
  158. package/dist/prosemirror/conversion/index.js +2 -2
  159. package/dist/prosemirror/documentStructureCounts.d.ts +24 -0
  160. package/dist/prosemirror/documentStructureCounts.js +76 -0
  161. package/dist/prosemirror/extensions/ExtensionManager.d.ts +1 -1
  162. package/dist/prosemirror/extensions/ExtensionManager.js +4 -22
  163. package/dist/prosemirror/extensions/StarterKit.d.ts +4 -27
  164. package/dist/prosemirror/extensions/StarterKit.js +29 -115
  165. package/dist/prosemirror/extensions/core/ParagraphExtension.js +1 -1
  166. package/dist/prosemirror/extensions/core/historyCommands.d.ts +16 -0
  167. package/dist/prosemirror/extensions/core/historyCommands.js +19 -0
  168. package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +1 -1
  169. package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +1 -1
  170. package/dist/prosemirror/extensions/features/ListExtension.js +7 -2
  171. package/dist/prosemirror/extensions/features/pastedCellSections.d.ts +1 -1
  172. package/dist/prosemirror/extensions/index.d.ts +2 -1
  173. package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +8 -3
  174. package/dist/prosemirror/extensions/marks/markUtils.d.ts +1 -1
  175. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +1 -1
  176. package/dist/prosemirror/extensions/nodes/TableExtension.js +8 -41
  177. package/dist/prosemirror/extensions/types.d.ts +1 -1
  178. package/dist/prosemirror/findReplaceSelection.d.ts +1 -1
  179. package/dist/prosemirror/hyperlinkRemoval.d.ts +1 -1
  180. package/dist/prosemirror/hyperlinkRemoval.js +7 -2
  181. package/dist/prosemirror/index.d.ts +3 -3
  182. package/dist/prosemirror/index.js +3 -3
  183. package/dist/prosemirror/insertionGaps.d.ts +1 -1
  184. package/dist/prosemirror/keptRangeBoundaries.d.ts +1 -1
  185. package/dist/prosemirror/keptRangeBoundaries.js +1 -1
  186. package/dist/prosemirror/listNumbering.d.ts +1 -1
  187. package/dist/prosemirror/listNumbering.js +1 -1
  188. package/dist/prosemirror/lockedControls.d.ts +1 -1
  189. package/dist/prosemirror/markupViewProjection.d.ts +1 -1
  190. package/dist/prosemirror/noteReferenceOccurrences.d.ts +1 -1
  191. package/dist/prosemirror/noteReferenceOccurrences.js +1 -1
  192. package/dist/prosemirror/noteReferenceReview.d.ts +2 -56
  193. package/dist/prosemirror/noteReferenceReview.js +2 -243
  194. package/dist/prosemirror/{extensions/features/ParaIdAllocatorExtension.d.ts → paraIds.d.ts} +13 -23
  195. package/dist/prosemirror/paraIds.js +152 -0
  196. package/dist/prosemirror/paragraphChangeTrackerMeta.d.ts +97 -0
  197. package/dist/prosemirror/paragraphChangeTrackerMeta.js +87 -0
  198. package/dist/prosemirror/paragraphMarkJoin.d.ts +1 -1
  199. package/dist/prosemirror/paragraphPropertyCarry.d.ts +1 -1
  200. package/dist/prosemirror/pastedCommentCopies.d.ts +1 -1
  201. package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +1 -1
  202. package/dist/prosemirror/plugins/documentNumbering.d.ts +1 -1
  203. package/dist/prosemirror/plugins/documentNumbering.js +1 -1
  204. package/dist/prosemirror/plugins/documentStyles.js +1 -1
  205. package/dist/prosemirror/plugins/templateDirectives.d.ts +1 -1
  206. package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +1 -1
  207. package/dist/prosemirror/rebaseParagraphRuns.d.ts +1 -1
  208. package/dist/prosemirror/rejoinRunCarriers.d.ts +1 -1
  209. package/dist/prosemirror/replacedAnnotations.d.ts +1 -1
  210. package/dist/prosemirror/replacedAnnotations.js +17 -2
  211. package/dist/prosemirror/revisionCarriers.d.ts +1 -1
  212. package/dist/prosemirror/runFormattingInlineCarriers.d.ts +1 -1
  213. package/dist/prosemirror/sectionMarkEdits.d.ts +1 -1
  214. package/dist/prosemirror/selectionBounds.d.ts +10 -0
  215. package/dist/prosemirror/selectionBounds.js +22 -0
  216. package/dist/prosemirror/storyListNumbering.d.ts +1 -1
  217. package/dist/prosemirror/suggestionCommands.d.ts +47 -0
  218. package/dist/prosemirror/suggestionCommands.js +31 -0
  219. package/dist/prosemirror/tableCellPaste.d.ts +1 -1
  220. package/dist/prosemirror/tableCellPaste.js +1 -1
  221. package/dist/prosemirror/tableGridMutation.d.ts +1 -1
  222. package/dist/prosemirror/tableRunIn.js +1 -1
  223. package/dist/prosemirror/textInput.d.ts +1 -1
  224. package/dist/prosemirror/textInput.js +1 -1
  225. package/dist/server.d.ts +7 -2
  226. package/dist/server.js +6 -1
  227. package/dist/types/canonicalCapabilities.d.ts +13 -92
  228. package/dist/types/canonicalCapabilities.js +11 -85
  229. package/package.json +4 -4
  230. package/dist/ai-edits/apply.d.ts +0 -202
  231. package/dist/ai-edits/apply.js +0 -6759
  232. package/dist/ai-edits/note-story-inventory.d.ts +0 -5
  233. package/dist/ai-edits/note-story-inventory.js +0 -10
  234. package/dist/ai-edits/revisionStretches.d.ts +0 -32
  235. package/dist/ai-edits/revisionStretches.js +0 -147
  236. package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +0 -18
  237. package/dist/prosemirror/extensions/core/HistoryExtension.js +0 -122
  238. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +0 -408
  239. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +0 -135
  240. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +0 -566
  241. package/dist/prosemirror/plugins/suggestionMode.d.ts +0 -92
  242. package/dist/prosemirror/plugins/suggestionMode.js +0 -1515
  243. package/dist/prosemirror/tablePositionedBookmarks.d.ts +0 -8
  244. package/dist/prosemirror/tablePositionedBookmarks.js +0 -80
@@ -1,202 +0,0 @@
1
- import { NumberingIdsInUse } from "../docx/numberingIds.js";
2
- import { FolioTableTemplates, TableStructureRevision } from "./table-template.js";
3
- import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot, FolioAIResolvedEditOperation, FolioAISignatureParty } from "./types.js";
4
- import { FolioUndefinedReferencePolicy } from "./undefinedReferences.js";
5
- import { WordDiffGranularity } from "./word-diff.js";
6
- import { Node, Schema } from "prosemirror-model";
7
- import { EditorState, Transaction } from "prosemirror-state";
8
- /**
9
- * The only editor surface the apply logic touches: a current `state`
10
- * and a `dispatch` that swaps in the next one. A live `EditorView`
11
- * satisfies this structurally, and so does a headless seam
12
- * (`{ state, dispatch: (tr) => { state = state.apply(tr); } }`) — the
13
- * apply path never reaches for anything DOM-bound on the view, which is
14
- * what lets the same operation applier drive both the React editor and
15
- * the server-side reviewer in `./headless`.
16
- */
17
- export type FolioAIEditView = {
18
- state: EditorState;
19
- dispatch: (transaction: Transaction) => void;
20
- };
21
- /**
22
- * Fixed revision provenance, for callers whose output must be reproducible.
23
- * Both halves of the stamp travel together because either one left to the
24
- * ambient clock (`new Date()` for the date, the shared bounded allocator for
25
- * the ids) makes the produced package differ between two runs over the same
26
- * inputs. `idSeed` starts a contiguous range the batch allocates from, so it
27
- * must sit above every revision id the target document already carries.
28
- */
29
- export type FolioRevisionStamp = {
30
- /** ISO-8601 date stamped on every `w:ins` / `w:del` this batch produces. */
31
- date: string;
32
- /** First revision id the batch may allocate. */
33
- idSeed: number;
34
- };
35
- type ApplyFolioAIEditOperationsOptions = {
36
- view: FolioAIEditView;
37
- snapshot: FolioAIEditSnapshot;
38
- operations: readonly FolioAIEditOperation[];
39
- mode?: FolioAIEditApplyMode;
40
- author?: string;
41
- /** Optional author initials (w:initials) stamped alongside the author. */
42
- initials?: string;
43
- createCommentId?: (text: string) => number;
44
- /** Omit to stamp revisions from the wall clock and the shared id cursor. */
45
- revisionStamp?: FolioRevisionStamp;
46
- /** How a replacement's redline is cut. */
47
- wordDiff?: FolioWordDiffOptions;
48
- /**
49
- * Tables and rows an `insertTable` / `insertTableRow` operation should place
50
- * verbatim, by operation id.
51
- *
52
- * The operations describe their content as cell texts, which is what a
53
- * caller writing a table from nothing has. A caller copying one it already
54
- * holds — a comparison placing the target document's table — has the whole
55
- * thing: `w:tblPr`, the `w:tblGrid` widths, `w:trPr`, `w:tcPr` with its
56
- * spans and merges, and cell paragraphs with their own properties. Rebuilt
57
- * from text, none of that survives. Kept out of the operation payload
58
- * because it is a document node rather than JSON: the serialized contract
59
- * still describes a table by its cell texts.
60
- */
61
- tableTemplates?: FolioTableTemplates;
62
- /** What a replacement does with a background the text it replaces carries. */
63
- replacementBackground?: FolioReplacementBackground;
64
- /** Policy for undefined style and numbering references; see FolioUndefinedReferencePolicy. */
65
- undefinedReferences: FolioUndefinedReferencePolicy;
66
- };
67
- /**
68
- * Options of a caller that holds every story of the package. Numbering ids
69
- * are package-wide while a story's state completes its numbering from its own
70
- * paragraphs, so the caller names the ids the other stories define and a list
71
- * the batch starts takes none of them.
72
- */
73
- type ApplyFolioAIEditOperationsInPackageOptions = ApplyFolioAIEditOperationsOptions & {
74
- numberingIdsElsewhere: NumberingIdsInUse;
75
- refuseCrossAuthorRevisions?: boolean;
76
- };
77
- /**
78
- * How an apply batch cuts the redline for a replacement. Word-level by
79
- * default; character granularity marks the changed letters inside a token,
80
- * which reads well for a reference or a date. Normalization is deliberately
81
- * absent: a batch that leaves a difference unmarked does not accept back to
82
- * the text the caller asked for.
83
- */
84
- export type FolioWordDiffOptions = {
85
- granularity?: WordDiffGranularity;
86
- };
87
- /**
88
- * What a replacement does with a highlight or `w:shd` the text it replaces
89
- * carries.
90
- *
91
- * `clear` is the authoring default: text typed over a highlighted placeholder
92
- * is new text, and keeping the marker that said "fill this in" would carry it
93
- * into the finished document. `keep` is for a caller that states the
94
- * replacement's own run properties rather than letting it inherit them — a
95
- * comparison reproducing a revised document holds the properties that document
96
- * has, and clearing them first records a run-property change it takes straight
97
- * back, which reaches the reader as a revision whose before and after are the
98
- * same.
99
- */
100
- export type FolioReplacementBackground = "clear" | "keep";
101
- /**
102
- * An apply result plus where the batch left the revision-id counter.
103
- *
104
- * A caller writing several batches into one package — a comparison walking
105
- * the main story, then each header, footer and note — has to give every batch
106
- * a seed above the last id the previous one used, or two stories claim the
107
- * same `w:id` and a consumer resolving one revision resolves the other with
108
- * it. The batch is the only thing that knows how many ids it took, so it says
109
- * so rather than making the caller guess a stride.
110
- */
111
- export type FolioAIEditApplyOutcome = FolioAIEditApplyResult & {
112
- /** The held transaction was refused when its final geometry exposed a protected break. */
113
- heldRevisionConflict?: true;
114
- /**
115
- * First revision id a following batch may allocate: one past the last id
116
- * this batch used, or the seed it started from when it allocated none.
117
- */
118
- nextRevisionId: number;
119
- };
120
- /**
121
- * Operation types applied in `"suggested"` mode. Every produced revision — an
122
- * inline mark, a whole-node `_suggestedInsert` marker, or a suggested
123
- * `trIns`/`trDel`/`cellMarker` — is stripped from serialized DOCX until
124
- * accepted. Cell merge/split (not row/column ops) and comment ops stay
125
- * `unsupportedMode`.
126
- */
127
- export declare const SUGGESTED_SUPPORTED_OPERATION_TYPES: ReadonlySet<FolioAIResolvedEditOperation["type"]>;
128
- type BuildTableNodeOptions = {
129
- schema: Schema;
130
- rows: readonly (readonly string[])[];
131
- /** Present in tracked mode: every row is stamped as an insertion. */
132
- revision?: TableStructureRevision;
133
- };
134
- /**
135
- * A plain table from a grid of cell texts, `null` when the schema has no
136
- * tables. In tracked mode every row carries `trIns` and every run inside it
137
- * carries `w:ins`, which is how the format says "this table is new": there is
138
- * no whole-table insertion element, only rows that were inserted, and a
139
- * consumer that reads only run-level revisions keeps the text of a rejected
140
- * insertion when the row marker stands alone.
141
- */
142
- export declare const buildTableNode: ({ schema, rows, revision }: BuildTableNodeOptions) => Node | null;
143
- type BuildSignatureTableNodeOptions = {
144
- schema: Schema;
145
- parties: readonly FolioAISignatureParty[];
146
- };
147
- /**
148
- * Build a borderless PM table mirroring docx-core's
149
- * `signatureTable` helper: one row, one cell per party, each cell
150
- * containing party name (bold), two spacer paragraphs, a signature
151
- * rule, then optional signatory and italic title lines.
152
- *
153
- * Returns `null` when the editor schema is missing one of the
154
- * required node types — callers should surface the op as a skip
155
- * rather than crashing.
156
- */
157
- export declare const buildSignatureTableNode: ({ schema, parties }: BuildSignatureTableNodeOptions) => Node | null;
158
- export declare const applyFolioAIEditOperations: (options: ApplyFolioAIEditOperationsOptions) => FolioAIEditApplyOutcome;
159
- /** {@link applyFolioAIEditOperations} for a caller holding every story. Internal. */
160
- export declare const applyFolioAIEditOperationsInPackage: (options: ApplyFolioAIEditOperationsInPackageOptions) => FolioAIEditApplyOutcome;
161
- export declare const previewFolioAIEditOperations: (options: ApplyFolioAIEditOperationsOptions) => FolioAIEditApplyOutcome;
162
- /**
163
- * A preview together with the document it would leave and the provisional
164
- * comment ids it placed, for a caller that checks the result before reporting
165
- * it. Internal: not re-exported from the package entry points.
166
- */
167
- export declare const previewFolioAIEditOperationsWithResult: (options: ApplyFolioAIEditOperationsInPackageOptions, wordDiffMode?: "coarse" | "bounded") => {
168
- outcome: FolioAIEditApplyOutcome;
169
- doc: Node;
170
- commentIds: readonly number[];
171
- };
172
- type InsertCleanTextOptions = {
173
- tr: Transaction;
174
- from: number;
175
- to: number;
176
- text: string;
177
- /**
178
- * The span this insertion stands in for, when the two together are a
179
- * replacement the tracked-changes path splits into a deletion and an
180
- * insertion. The insertion carries that span's marks, so accepting the
181
- * change leaves the link and the comment on the new text. Its anchors are
182
- * left alone: a tracked deletion removes nothing.
183
- */
184
- standsInFor?: {
185
- from: number;
186
- to: number;
187
- };
188
- /**
189
- * The span stood in for stays, as a tracked deletion: a comment on it then
190
- * goes on the insertion only where the insertion continues its range.
191
- */
192
- keepsReplacedText?: boolean;
193
- };
194
- type InsertedCleanText = {
195
- transaction: Transaction;
196
- /** Start of the inserted text, past any anchor restored before it. */
197
- start: number;
198
- /** End of the inserted text, before any anchor restored after it. */
199
- end: number;
200
- };
201
- export declare const insertCleanText: ({ tr, from, to, text, standsInFor, keepsReplacedText }: InsertCleanTextOptions) => InsertedCleanText;
202
- export type { FolioUndefinedReferencePolicy };