@stll/folio-core 0.71.1 → 0.73.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 (213) hide show
  1. package/README.md +14 -8
  2. package/dist/ai-edits/apply.d.ts +6 -114
  3. package/dist/ai-edits/apply.js +9 -131
  4. package/dist/ai-edits/applyTypes.d.ts +85 -0
  5. package/dist/ai-edits/applyTypes.js +24 -0
  6. package/dist/ai-edits/clean-text.d.ts +7 -1
  7. package/dist/ai-edits/clean-text.js +23 -2
  8. package/dist/ai-edits/finalSectionReview.d.ts +1 -1
  9. package/dist/ai-edits/headless.d.ts +29 -147
  10. package/dist/ai-edits/headless.js +213 -1634
  11. package/dist/ai-edits/index.d.ts +3 -3
  12. package/dist/ai-edits/index.js +2 -3
  13. package/dist/ai-edits/pending-suggestions.d.ts +14 -4
  14. package/dist/ai-edits/pending-suggestions.js +183 -90
  15. package/dist/ai-edits/result-validation.js +1 -1
  16. package/dist/ai-edits/retired-comment-receipts.d.ts +1 -1
  17. package/dist/ai-edits/snapshot.js +8 -3
  18. package/dist/ai-edits/table-cell-mutations.d.ts +1 -1
  19. package/dist/ai-edits/table-cell-mutations.js +1 -1
  20. package/dist/ai-edits/table-geometry.d.ts +1 -1
  21. package/dist/ai-edits/table-geometry.js +1 -1
  22. package/dist/ai-edits/table-row-column-mutations.d.ts +1 -1
  23. package/dist/ai-edits/table-row-column-mutations.js +1 -1
  24. package/dist/ai-edits/tableNodes.d.ts +38 -0
  25. package/dist/ai-edits/tableNodes.js +86 -0
  26. package/dist/ai-edits/tracked-batch-fidelity.d.ts +1 -1
  27. package/dist/ai-edits/undefinedReferences.d.ts +7 -0
  28. package/dist/canonical/batchCommentReferences.js +1 -0
  29. package/dist/canonical/canonicalInlineProjection.js +1 -1
  30. package/dist/canonical/canonicalPublicOperations.js +228 -64
  31. package/dist/canonical/canonicalSession.d.ts +9 -1
  32. package/dist/canonical/canonicalSession.js +95 -15
  33. package/dist/compare/compare.d.ts +1 -1
  34. package/dist/compare/inline-atoms-model.d.ts +1 -1
  35. package/dist/compare/inline-atoms.d.ts +2 -2
  36. package/dist/compare/inline-provenance-model.d.ts +1 -1
  37. package/dist/compare/inline-provenance.d.ts +2 -2
  38. package/dist/compat/eigenpal.d.ts +3 -4
  39. package/dist/compat/eigenpal.js +2 -4
  40. package/dist/controller/canonicalClipboard.d.ts +13 -3
  41. package/dist/controller/canonicalClipboard.js +185 -49
  42. package/dist/controller/canonicalClipboardResources.d.ts +9 -1
  43. package/dist/controller/canonicalClipboardResources.js +22 -2
  44. package/dist/controller/canonicalReview.d.ts +1 -1
  45. package/dist/controller/canonicalReview.js +1 -1
  46. package/dist/controller/canonicalStructure.js +1 -1
  47. package/dist/controller/canonicalWatermark.d.ts +10 -0
  48. package/dist/controller/canonicalWatermark.js +37 -0
  49. package/dist/controller/canonicalYjsRoom.d.ts +1 -1
  50. package/dist/controller/headerFooterEditorManager.d.ts +11 -7
  51. package/dist/controller/headerFooterEditorManager.js +39 -151
  52. package/dist/controller/hiddenEditorApi.d.ts +1 -1
  53. package/dist/controller/hiddenEditorManager.d.ts +6 -40
  54. package/dist/controller/hiddenEditorManager.js +173 -306
  55. package/dist/controller/noteEditorManager.d.ts +3 -10
  56. package/dist/controller/noteEditorManager.js +33 -206
  57. package/dist/document-operations-apply.d.ts +15 -0
  58. package/dist/document-operations-apply.js +280 -0
  59. package/dist/document-operations.d.ts +1 -14
  60. package/dist/document-operations.js +2 -279
  61. package/dist/docx/modelValidation.js +1 -1
  62. package/dist/docx/paragraphParser.js +2 -2
  63. package/dist/docx/paragraphPropertySource.d.ts +1 -1
  64. package/dist/docx/reviewResolutionProvenance.d.ts +3 -2
  65. package/dist/docx/reviewResolutionProvenance.js +32 -9
  66. package/dist/docx/revisionIdNormalization.js +30 -7
  67. package/dist/docx/rezip.js +1 -1
  68. package/dist/docx/serializer/borderSerializer.js +1 -1
  69. package/dist/docx/serializer/commentSerializer.js +1 -1
  70. package/dist/docx/serializer/documentSerializer.js +1 -1
  71. package/dist/docx/serializer/paragraphSerializer.js +3 -3
  72. package/dist/docx/serializer/runSerializer.js +1 -1
  73. package/dist/docx/serializer/sectionPropertiesSerializer.js +1 -1
  74. package/dist/docx/serializer/tableSerializer.js +5 -37
  75. package/dist/docx/serializer/textFormattingSerializer.js +1 -1
  76. package/dist/docx/serializer/trackedChangeAttributes.js +1 -1
  77. package/dist/docx/server/templatePlan/apply.d.ts +15 -0
  78. package/dist/docx/server/templatePlan/apply.js +600 -0
  79. package/dist/docx/server/templatePlan/blocks.d.ts +97 -0
  80. package/dist/docx/server/templatePlan/blocks.js +355 -0
  81. package/dist/docx/server/templatePlan/builders.d.ts +72 -0
  82. package/dist/docx/server/templatePlan/builders.js +237 -0
  83. package/dist/docx/server/templatePlan/emit.d.ts +118 -0
  84. package/dist/docx/server/templatePlan/emit.js +466 -0
  85. package/dist/docx/server/templatePlan/emphasis.d.ts +62 -0
  86. package/dist/docx/server/templatePlan/emphasis.js +173 -0
  87. package/dist/docx/server/templatePlan/inspect.d.ts +22 -0
  88. package/dist/docx/server/templatePlan/inspect.js +177 -0
  89. package/dist/docx/server/templatePlan/labels.d.ts +36 -0
  90. package/dist/docx/server/templatePlan/labels.js +126 -0
  91. package/dist/docx/server/templatePlan/package.d.ts +34 -0
  92. package/dist/docx/server/templatePlan/package.js +99 -0
  93. package/dist/docx/server/templatePlan/plan.d.ts +143 -0
  94. package/dist/docx/server/templatePlan/plan.js +841 -0
  95. package/dist/docx/server/templatePlan/planShape.d.ts +9 -0
  96. package/dist/docx/server/templatePlan/planShape.js +161 -0
  97. package/dist/docx/server/templatePlan/resources.d.ts +41 -0
  98. package/dist/docx/server/templatePlan/resources.js +136 -0
  99. package/dist/docx/server/templatePlan/story.d.ts +128 -0
  100. package/dist/docx/server/templatePlan/story.js +440 -0
  101. package/dist/docx/server/templatePlan/types.d.ts +406 -0
  102. package/dist/docx/server/templatePlan/types.js +28 -0
  103. package/dist/docx/server/templatePlan/verify.d.ts +40 -0
  104. package/dist/docx/server/templatePlan/verify.js +968 -0
  105. package/dist/docx/server/templatePlan/xml.d.ts +69 -0
  106. package/dist/docx/server/templatePlan/xml.js +119 -0
  107. package/dist/docx/settingsHeaderFooterUpdate.d.ts +9 -0
  108. package/dist/docx/settingsHeaderFooterUpdate.js +45 -10
  109. package/dist/docx/storyBlockReplay.js +1 -1
  110. package/dist/docx/structuralXmlPatch.js +9 -1
  111. package/dist/docx/tableGridXml.d.ts +30 -0
  112. package/dist/docx/tableGridXml.js +54 -0
  113. package/dist/docx/tableParser.js +7 -0
  114. package/dist/docx/xmlParser.js +1 -1
  115. package/dist/index.d.ts +3 -4
  116. package/dist/index.js +2 -4
  117. package/dist/internal/paragraphFormattingSerialization.js +1 -1
  118. package/dist/internal/wholeStoryRevisionResolution.js +1 -1
  119. package/dist/managers/ContextMenuManager.js +2 -1
  120. package/dist/managers/DocumentLoaderManager.d.ts +0 -4
  121. package/dist/managers/DocumentLoaderManager.js +4 -12
  122. package/dist/managers/editorShortcuts.d.ts +1 -1
  123. package/dist/prosemirror/anchoredTextBoxes.d.ts +1 -1
  124. package/dist/prosemirror/canonicalCommands.d.ts +1 -1
  125. package/dist/prosemirror/canonicalSelectionRange.d.ts +1 -1
  126. package/dist/prosemirror/canonicalTableCommands.js +2 -2
  127. package/dist/prosemirror/commands/comments.js +3 -3
  128. package/dist/prosemirror/commands/contentControls.d.ts +1 -1
  129. package/dist/prosemirror/commands/formatPainter.d.ts +1 -1
  130. package/dist/prosemirror/commands/formatting.d.ts +1 -1
  131. package/dist/prosemirror/commands/pastePlainText.d.ts +1 -1
  132. package/dist/prosemirror/commands/sectionBreak.js +1 -1
  133. package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +1 -1
  134. package/dist/prosemirror/commands/tableMergeFoldDecisions.d.ts +1 -1
  135. package/dist/prosemirror/commentRecords.d.ts +1 -1
  136. package/dist/prosemirror/contentControlRevisions.d.ts +1 -1
  137. package/dist/prosemirror/conversion/fromProseDoc.js +1 -1
  138. package/dist/prosemirror/documentStructureCounts.d.ts +24 -0
  139. package/dist/prosemirror/documentStructureCounts.js +76 -0
  140. package/dist/prosemirror/extensions/ExtensionManager.d.ts +1 -1
  141. package/dist/prosemirror/extensions/StarterKit.d.ts +1 -1
  142. package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +1 -7
  143. package/dist/prosemirror/extensions/core/HistoryExtension.js +5 -13
  144. package/dist/prosemirror/extensions/core/ParagraphExtension.js +1 -1
  145. package/dist/prosemirror/extensions/core/historyCommands.d.ts +16 -0
  146. package/dist/prosemirror/extensions/core/historyCommands.js +19 -0
  147. package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +1 -1
  148. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +2 -35
  149. package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +4 -142
  150. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +3 -87
  151. package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +7 -162
  152. package/dist/prosemirror/extensions/features/pastedCellSections.d.ts +1 -1
  153. package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +1 -1
  154. package/dist/prosemirror/extensions/marks/markUtils.d.ts +1 -1
  155. package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +1 -1
  156. package/dist/prosemirror/extensions/nodes/TableExtension.js +2 -2
  157. package/dist/prosemirror/extensions/types.d.ts +1 -1
  158. package/dist/prosemirror/findReplaceSelection.d.ts +1 -1
  159. package/dist/prosemirror/hyperlinkRemoval.d.ts +1 -1
  160. package/dist/prosemirror/index.d.ts +1 -1
  161. package/dist/prosemirror/index.js +1 -1
  162. package/dist/prosemirror/insertionGaps.d.ts +1 -1
  163. package/dist/prosemirror/keptRangeBoundaries.d.ts +1 -1
  164. package/dist/prosemirror/listNumbering.d.ts +1 -1
  165. package/dist/prosemirror/lockedControls.d.ts +1 -1
  166. package/dist/prosemirror/markupViewProjection.d.ts +1 -1
  167. package/dist/prosemirror/noteReferenceOccurrences.d.ts +1 -1
  168. package/dist/prosemirror/noteReferenceReview.js +1 -1
  169. package/dist/prosemirror/numberingAttr.d.ts +1 -2
  170. package/dist/prosemirror/numberingAttr.js +1 -2
  171. package/dist/prosemirror/outlineLevelAttr.d.ts +1 -2
  172. package/dist/prosemirror/outlineLevelAttr.js +1 -2
  173. package/dist/prosemirror/paraIds.d.ts +46 -0
  174. package/dist/prosemirror/paraIds.js +152 -0
  175. package/dist/prosemirror/paragraphChangeTrackerMeta.d.ts +97 -0
  176. package/dist/prosemirror/paragraphChangeTrackerMeta.js +87 -0
  177. package/dist/prosemirror/paragraphMarkJoin.d.ts +1 -1
  178. package/dist/prosemirror/paragraphPropertyCarry.d.ts +1 -1
  179. package/dist/prosemirror/pastedCommentCopies.d.ts +1 -1
  180. package/dist/prosemirror/pastedCommentCopies.js +1 -1
  181. package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +1 -1
  182. package/dist/prosemirror/plugins/documentNumbering.d.ts +1 -1
  183. package/dist/prosemirror/plugins/suggestionMode.d.ts +1 -1
  184. package/dist/prosemirror/plugins/templateDirectives.d.ts +1 -1
  185. package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +1 -1
  186. package/dist/prosemirror/rebaseParagraphRuns.d.ts +1 -1
  187. package/dist/prosemirror/rejoinRunCarriers.d.ts +1 -1
  188. package/dist/prosemirror/replacedAnnotations.d.ts +1 -1
  189. package/dist/prosemirror/replacedAnnotations.js +16 -1
  190. package/dist/prosemirror/revisionCarriers.d.ts +1 -1
  191. package/dist/prosemirror/runFormattingInlineCarriers.d.ts +1 -1
  192. package/dist/prosemirror/sectionMarkEdits.d.ts +1 -1
  193. package/dist/prosemirror/selectionBounds.d.ts +10 -0
  194. package/dist/prosemirror/selectionBounds.js +22 -0
  195. package/dist/prosemirror/storyListNumbering.d.ts +1 -1
  196. package/dist/prosemirror/tableCellPaste.d.ts +1 -1
  197. package/dist/prosemirror/tableGridMutation.d.ts +1 -1
  198. package/dist/prosemirror/textInput.d.ts +1 -1
  199. package/dist/server.d.ts +7 -5
  200. package/dist/server.js +6 -4
  201. package/dist/types/canonicalCapabilities.d.ts +8 -41
  202. package/dist/types/canonicalCapabilities.js +6 -34
  203. package/package.json +4 -6
  204. package/dist/controller/collaborationModules.d.ts +0 -3
  205. package/dist/controller/collaborationModules.js +0 -14
  206. package/dist/docx/server/materializeYjsDocx.d.ts +0 -30
  207. package/dist/docx/server/materializeYjsDocx.js +0 -96
  208. package/dist/docx/server/migrateYjsAttrSchema.d.ts +0 -53
  209. package/dist/docx/server/migrateYjsAttrSchema.js +0 -111
  210. package/dist/prosemirror/plugins/derivedFields.d.ts +0 -8
  211. package/dist/prosemirror/plugins/derivedFields.js +0 -52
  212. package/dist/prosemirror/yjsDocumentMetadata.d.ts +0 -89
  213. package/dist/prosemirror/yjsDocumentMetadata.js +0 -697
@@ -5,7 +5,7 @@ import { ImportReferencedStyleDefinitionsResult } from "../compare/style-resourc
5
5
  import { FolioDocumentOperationBatchInput, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult } from "../document-operations.js";
6
6
  import { HeadlessReviewerSession } from "../types/canonicalCapabilities.js";
7
7
  import { document_d_exports } from "../types/document.js";
8
- import { FolioReplacementBackground, FolioRevisionStamp, FolioWordDiffOptions } from "./apply.js";
8
+ import { FolioReplacementBackground, FolioRevisionStamp, FolioWordDiffOptions } from "./applyTypes.js";
9
9
  import { FolioPendingSuggestionLoadResult, FolioPendingSuggestionRecord } from "./pending-suggestions.js";
10
10
  import { FolioAbsorbedBlock, FolioReviewChange, FolioReviewChangeKind, FolioReviewResolution, FolioReviewResolutionSkip } from "./read.js";
11
11
  import { FolioStoryTable } from "./snapshot.js";
@@ -29,20 +29,9 @@ export type FolioDocxReviewerOptions = {
29
29
  /** Password for Agile-encrypted .docx files (Office 2010+). */
30
30
  password?: string | undefined;
31
31
  /**
32
- * The engine the document is held in. (default: `"canonical"`)
33
- *
34
- * `"canonical"` loads the document into the canonical session the editors'
35
- * canonical mode runs. Every read comes from it, and operations in every
36
- * story, their undo, comment replies and resolution, the resolution of
37
- * tracked changes and the save run on it as the canonical editor runs
38
- * them, and resolved views are read from a second session resolved to
39
- * the view; suggested batches stage on it and its suggestions resolve
40
- * through its suggestion intent across all stories. Comparison
41
- * inline-provenance matching throws a `CanonicalSessionError` under
42
- * `publicOps.headlessSession`.
43
- * Resolving one story to a view also refuses while it holds staged
44
- * suggestions. Locks that prevent a complete view refuse rather than
45
- * returning a partial view. These paths never fall back to the legacy engine.
32
+ * The engine the document is held in: the canonical session the editors
33
+ * run. Every read, operation, undo, resolution, resolved view and save runs
34
+ * on it; what the session cannot express throws a `CanonicalSessionError`.
46
35
  */
47
36
  session?: HeadlessReviewerSession;
48
37
  };
@@ -168,13 +157,12 @@ export declare class UnsupportedFolioReviewedViewError extends UnsupportedFolioR
168
157
  }> {}
169
158
  declare const FolioRoomJournalErrorBase: TaggedErrorClass<"FolioRoomJournalError">;
170
159
  /**
171
- * Why a reviewer could not replay a room's journal. `legacyEngine`: only a
172
- * canonical reviewer follows a room. `revisionGap`: a batch is not the one
173
- * after the last the reviewer applied.
160
+ * Why a reviewer could not replay a room's journal. `revisionGap`: a batch is
161
+ * not the one after the last the reviewer applied.
174
162
  */
175
163
  export declare class FolioRoomJournalError extends FolioRoomJournalErrorBase<{
176
164
  message: string;
177
- reason: "legacyEngine" | "revisionGap";
165
+ reason: "revisionGap";
178
166
  expectedRevision: number;
179
167
  receivedRevision: number | undefined;
180
168
  }> {}
@@ -387,23 +375,10 @@ export declare class FolioDocxReviewer {
387
375
  private snapshotOf;
388
376
  /** Default author for tracked changes and comments. */
389
377
  readonly author: string;
390
- /** The legacy reviewer's parsed model; a canonical one reads its session's. */
378
+ /** The model the reviewer was opened on; the readers follow the session's. */
391
379
  private readonly loadedDocument;
392
- private finalSectionPropertiesOverride;
393
380
  private readonly originalBuffer;
394
381
  private state;
395
- private readonly secondaryStoryStates;
396
- private readonly removedHeaderFooterStories;
397
- /** Notes whose reference a resolution removed: a note exists only through its reference. */
398
- private readonly removedNoteStories;
399
- private readonly sectionReferenceRemovals;
400
- private importedStyles;
401
- private readonly importedMedia;
402
- private readonly importedHeaders;
403
- private readonly importedFooters;
404
- private readonly resolvedStoryExpectations;
405
- private readonly createdComments;
406
- private deletedCommentIds;
407
382
  /** Comments the body anchored when it was loaded, read as the editor projects it. */
408
383
  private readonly loadedMainCommentIds;
409
384
  /**
@@ -412,17 +387,7 @@ export declare class FolioDocxReviewer {
412
387
  * pairs two documents' paragraphs by them.
413
388
  */
414
389
  private readonly positionalParaIds;
415
- private readonly documentOperationUndoEntries;
416
390
  private pendingSuggestions;
417
- /**
418
- * Resolved-state overrides recorded by {@link resolveComment}, keyed by
419
- * comment id. Applied on read ({@link getComments}) and on write
420
- * ({@link toDocument}) rather than mutating the parsed `Comment` objects in
421
- * place, matching how the parser/serializer treat `Comment` as immutable
422
- * (`commentParser.ts` replaces array slots via spread; the serializer
423
- * types its inputs `readonly Comment[]`).
424
- */
425
- private readonly resolvedOverrides;
426
391
  /** The last room revision {@link applyRoomJournal} applied. */
427
392
  private roomRevision;
428
393
  /** The resolved copies {@link resolvedSessionReader} last read, by view. */
@@ -433,14 +398,6 @@ export declare class FolioDocxReviewer {
433
398
  private constructor();
434
399
  private registerComparisonAccess;
435
400
  private stageTargetStyles;
436
- private installImportedStyles;
437
- /**
438
- * A raw final table has no paragraph mark after it for Word to merge into
439
- * when the target ends in a paragraph. Folio-exact comparison adds this
440
- * untracked receiver before planning; its private marker makes resolving in
441
- * Folio restore the raw source view.
442
- */
443
- private stageTerminalTableReviewCarrier;
444
401
  private stageTargetNumbering;
445
402
  private planTargetNumberingReferences;
446
403
  /**
@@ -451,11 +408,6 @@ export declare class FolioDocxReviewer {
451
408
  static openRoomBase(buffer: ArrayBuffer): Promise<CanonicalRoomBase>;
452
409
  /** Parse a `.docx` buffer into a reviewer. */
453
410
  static fromBuffer(buffer: ArrayBuffer, options?: FolioDocxReviewerOptions): Promise<FolioDocxReviewer>;
454
- /**
455
- * A legacy reviewer over a parsed or resolved document. A resolved one names
456
- * the ids its source read as positional, which its model now spells as ids.
457
- */
458
- private static legacyOver;
459
411
  /**
460
412
  * Load as a canonical editor does: the same input normalization (paragraph
461
413
  * and content control ids minted in the package), then the session over the
@@ -479,8 +431,6 @@ export declare class FolioDocxReviewer {
479
431
  * either leave the other as it is. The copy's undo history starts empty.
480
432
  */
481
433
  fork(): FolioDocxReviewer;
482
- /** A constructor-backed copy over the legacy snapshot owner. */
483
- private forkLegacy;
484
434
  private canonicalComparisonAccess;
485
435
  private stageFinalSectionPropertiesOnSession;
486
436
  /** Resolve on an independent fork, then publish only the complete semantic projection. */
@@ -494,12 +444,7 @@ export declare class FolioDocxReviewer {
494
444
  applyRoomJournal(journal: readonly SequencedBatch[]): void;
495
445
  private commitOpsOnSession;
496
446
  private stageMappedSectionBoundariesOnSession;
497
- /** Restore the authoritative snapshot into an independent reviewer's collections. */
498
- private restoreReviewerState;
499
- /**
500
- * The model the readers read: the parsed package on the legacy engine, the
501
- * session's document, as it is after every commit, on the canonical one.
502
- */
447
+ /** The model the readers read: the session's document after every commit. */
503
448
  private get baseDocument();
504
449
  /**
505
450
  * Publish a commit the session prepared on the reviewer's main state. The
@@ -530,21 +475,15 @@ export declare class FolioDocxReviewer {
530
475
  * the anchor map the apply layer resolves operations against.
531
476
  */
532
477
  snapshot(): FolioAIEditSnapshot;
533
- /**
534
- * The numbering ids every story but `story` defines: the package's and the
535
- * lists each story started. Numbering ids are package-wide, while a story's
536
- * state completes its numbering from its own paragraphs only.
537
- */
538
- private numberingIdsOutside;
539
478
  /** Every suggestion id the document's stories still carry. */
540
479
  private activeSuggestionIds;
541
480
  /** Export staged AI operations for storage by the host, outside the DOCX. */
542
481
  exportPendingSuggestions(): FolioPendingSuggestionRecord[];
543
482
  /**
544
483
  * A story as a save writes it, every pending suggestion rejected: what a
545
- * suggestion record's fingerprint describes. On the canonical engine it is
546
- * read from a session over the document the save writes, so a reviewer
547
- * reopened on the saved package reads the same story.
484
+ * suggestion record's fingerprint describes. It is read from a session over
485
+ * the document the save writes, so a reviewer reopened on the saved package
486
+ * reads the same story.
548
487
  */
549
488
  private pendingSuggestionSource;
550
489
  /** Validate saved proposals against this document before restaging them. */
@@ -572,7 +511,6 @@ export declare class FolioDocxReviewer {
572
511
  /** Snapshot one editable story into stable, operation-ready blocks. */
573
512
  snapshotStory(story: FolioEditableDocumentStoryHandle): FolioAIEditSnapshot | null;
574
513
  private snapshotReviewedStoryInternal;
575
- private projectComparisonStoriesInternal;
576
514
  /**
577
515
  * One story's tables, in the document order {@link snapshotStory} numbers
578
516
  * them with, read through a reviewed view.
@@ -602,13 +540,12 @@ export declare class FolioDocxReviewer {
602
540
  */
603
541
  readReviewedStory(options?: FolioReadReviewedStoryOptions): FolioReviewedStory | null;
604
542
  /**
605
- * Resolve one editable story to its original or final state. A canonical
606
- * target story holding staged suggestions refuses; resolve those through
607
- * the suggestion methods first. A lock that prevents any target change
608
- * from resolving refuses before mutation.
543
+ * Resolve one editable story to its original or final state, its staged
544
+ * suggestions with its other changes. A suggestion that reaches another
545
+ * story resolves only whole, through the suggestion methods. A lock that
546
+ * prevents any target change from resolving refuses before mutation.
609
547
  */
610
548
  resolveReviewedStory({ story, view }: FolioResolveReviewedStoryOptions): boolean;
611
- private resolveReviewedStorySnapshotInternal;
612
549
  /**
613
550
  * Apply operations against the current state. Reuses the live-editor applier
614
551
  * verbatim via a headless `{ state, dispatch }` seam; the resulting state
@@ -624,9 +561,6 @@ export declare class FolioDocxReviewer {
624
561
  applyDocumentOperations(batch: FolioDocumentOperationBatchInput, options: FolioApplyDocumentOperationsOptions): FolioDocumentOperationResult;
625
562
  /** Apply a versioned operation batch to one editable document story. */
626
563
  applyDocumentOperationsToStory({ story, batch, snapshot, revisionStamp, wordDiff, tableTemplates, replacementBackground, undefinedReferences }: FolioApplyDocumentOperationsToStoryOptions): FolioDocumentOperationResult;
627
- /** Apply a batch; the notes whose references it deletes or removes follow them. */
628
- private applyDocumentOperationsInternal;
629
- private applyDocumentOperationsToStoryState;
630
564
  /**
631
565
  * Undo the latest unchanged document-operation batch and its created
632
566
  * comments. Only the last {@link FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT}
@@ -695,7 +629,6 @@ export declare class FolioDocxReviewer {
695
629
  deleted: number[];
696
630
  };
697
631
  private currentCommentDefinitions;
698
- private deleteCommentAnchors;
699
632
  /**
700
633
  * Add a reply to a comment thread. Pass a {@link FolioReviewComment} from
701
634
  * {@link getComments} or its id; the reply threads under that comment's root
@@ -706,7 +639,6 @@ export declare class FolioDocxReviewer {
706
639
  * the created reply, or `null` when the target comment is absent.
707
640
  */
708
641
  replyTo(target: FolioReviewComment | number, input: FolioReviewReplyInput): FolioReviewCommentReply | null;
709
- private anchorReplyInEditor;
710
642
  /**
711
643
  * Mark a comment thread resolved, or reopen a previously resolved one. Pass
712
644
  * the id from {@link getComments} / {@link FolioReviewComment.id}. Applies
@@ -740,9 +672,6 @@ export declare class FolioDocxReviewer {
740
672
  */
741
673
  private headerFooterPlacements;
742
674
  private currentFinalSectionProperties;
743
- private stageFinalSectionProperties;
744
- private stageMappedSectionBoundaries;
745
- private resolveFinalSectionProperties;
746
675
  /**
747
676
  * Accept an existing tracked change, keeping its text and dropping the
748
677
  * redline. Pass a {@link FolioReviewChange} from {@link getChanges} or its
@@ -754,13 +683,11 @@ export declare class FolioDocxReviewer {
754
683
  * removal. A held change stays pending as it is.
755
684
  */
756
685
  acceptChange(target: FolioReviewChange | number): boolean;
757
- private acceptChangeInternal;
758
686
  /**
759
687
  * Reject an existing tracked change: an insertion's text is removed, a
760
688
  * deletion's text is restored. See {@link acceptChange} for targeting.
761
689
  */
762
690
  rejectChange(target: FolioReviewChange | number): boolean;
763
- private rejectChangeInternal;
764
691
  /** Convert one pending suggestion into an ordinary tracked change. */
765
692
  acceptSuggestion(suggestionId: string, options?: {
766
693
  author?: string;
@@ -801,33 +728,6 @@ export declare class FolioDocxReviewer {
801
728
  * `skipped`, as on the legacy engine.
802
729
  */
803
730
  private resolveAllOnSession;
804
- private resolveAll;
805
- private resolveWithSectionReferenceHistory;
806
- private resolveEveryFinalSectionChange;
807
- private resolveEveryStory;
808
- /**
809
- * Change the body the way a note follows its reference: a note whose
810
- * reference goes, goes too, as a note no text refers to does; a note whose
811
- * reference an edit deletes as a tracked change has its text deleted with
812
- * it; a note whose reference's deletion is rejected gets back the text that
813
- * deletion took.
814
- */
815
- private withNotesFollowingReferences;
816
- /** Delete the text of each note whose reference went from live to a tracked deletion. */
817
- private deleteNotesWithTheirReferences;
818
- /**
819
- * The notes a story other than the body refers to (a header, a footer, a
820
- * comment, another note), leaving out references inside the `skipped` notes.
821
- */
822
- private noteKeysReferencedOutsideBody;
823
- private resolveEveryStoryOnce;
824
- /**
825
- * Resolve each change of a story a content control's lock does not hold, on
826
- * its own: the one-pass resolver takes the whole story or nothing. The held
827
- * changes stay pending as they are and are reported in `skipped`.
828
- */
829
- private resolveStoryAroundHeldChanges;
830
- private acceptOrdinaryChangesWithSuggestions;
831
731
  /** Resolve ordinary revisions on a detached in-memory document. */
832
732
  toResolvedDocument(decision: "accept" | "reject"): document_d_exports.Document;
833
733
  /**
@@ -845,11 +745,6 @@ export declare class FolioDocxReviewer {
845
745
  * weakly, so a reviewer does not keep the copy's session alive.
846
746
  */
847
747
  private resolvedSessionReader;
848
- /**
849
- * The paragraph ids this reviewer's stories read as positional: ids it
850
- * minted where the package named none, which `toDocument` writes as ids.
851
- */
852
- private storyPositionalParaIds;
853
748
  /**
854
749
  * A reviewer on a second session over the current document, as a reviewer
855
750
  * reopened on it would hold it, with every change resolved to `view`. This
@@ -857,6 +752,19 @@ export declare class FolioDocxReviewer {
857
752
  * cannot resolve yet refuses as `acceptAll` and `rejectAll` do.
858
753
  */
859
754
  private resolvedSessionCopy;
755
+ /**
756
+ * Turn every staged suggestion into an ordinary tracked change, so that
757
+ * accepting every change accepts the suggestions too.
758
+ */
759
+ private promoteSuggestionsOnSession;
760
+ /**
761
+ * A story holding staged suggestions resolved to `view`: its suggestions
762
+ * resolve with its other changes, on a fork, and the fork's operations
763
+ * land here as one commit, so a refusal leaves this reviewer as it was. A
764
+ * suggestion that reaches another story resolves only whole, so resolving
765
+ * one of its stories refuses.
766
+ */
767
+ private resolveStoryWithSuggestions;
860
768
  /**
861
769
  * Resolve one story's changes to `view` in one session commit: the body's
862
770
  * through the review intent, another story's as its resolution operation.
@@ -864,9 +772,6 @@ export declare class FolioDocxReviewer {
864
772
  private resolveStoryOnSession;
865
773
  /** The current document model with edits merged back in. */
866
774
  toDocument(): document_d_exports.Document;
867
- private captureReviewerState;
868
- private documentFromStateSnapshot;
869
- private captureSaveSnapshot;
870
775
  /**
871
776
  * Serialise the reviewed document to a new `.docx` buffer. Tries a selective
872
777
  * patch first (only changed paragraphs are rewritten; every other byte of the
@@ -887,14 +792,6 @@ export declare class FolioDocxReviewer {
887
792
  * writes them.
888
793
  */
889
794
  private saveOnSession;
890
- private assertResolvedStoriesSerialized;
891
- /**
892
- * Attempt the selective patch, treating a throw the same as a decline. Odd
893
- * source XML can make the paragraph diff throw rather than return `null`; a
894
- * full repack is the correct lossless fallback in both cases, so the fallback
895
- * is the graceful handling — no separate error surface is needed here.
896
- */
897
- private trySelectiveSave;
898
795
  private getEditableStoryState;
899
796
  /**
900
797
  * A secondary story as its editable state holds it: the loaded state's
@@ -911,8 +808,6 @@ export declare class FolioDocxReviewer {
911
808
  * session's story projections yet.
912
809
  */
913
810
  private secondaryStoryDoc;
914
- private requireEditableStoryState;
915
- private setEditableStoryState;
916
811
  private getHeaderFooterStory;
917
812
  private createComparisonHeaderFooter;
918
813
  private canImportHeaderFooterContent;
@@ -928,13 +823,9 @@ export declare class FolioDocxReviewer {
928
823
  * another after. This is the conversion the save path already performs on the
929
824
  * same states, so the text now describes exactly what a save would write.
930
825
  */
931
- private storyBlocks;
932
826
  private getHeaderFooterStoryText;
933
827
  private getNoteStoryText;
934
828
  private getStoryText;
935
- private mergeEditedSecondaryStories;
936
- /** Apply any {@link resolveComment} overrides recorded for these comments. */
937
- private withResolvedOverrides;
938
829
  /**
939
830
  * `comments` without the threads an edit left anchored nowhere: anchored in
940
831
  * a story when it was loaded (or created anchored by this reviewer), and
@@ -947,15 +838,6 @@ export declare class FolioDocxReviewer {
947
838
  * story is read, not only the body.
948
839
  */
949
840
  private commentAnchors;
950
- /** Allocate outside every parsed or newly-created comment and reply id. */
951
- private nextCommentId;
952
- /**
953
- * Drive a ProseMirror command against the reviewer's headless state via the
954
- * same `{ state, dispatch }` seam {@link applyOperations} uses, retaining the
955
- * resulting state for {@link toBuffer}.
956
- */
957
- private runCommand;
958
- private runStoryCommand;
959
841
  }
960
842
  /** @internal Comparison-only access to atomic and fresh reviewer projections. */
961
843
  export declare const getFolioDocxComparisonAccess: (reviewer: FolioDocxReviewer) => FolioDocxComparisonAccess;