@stll/folio-core 0.52.0 → 0.54.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.
- package/README.md +23 -0
- package/dist/ai-edits/apply.d.ts +26 -1
- package/dist/ai-edits/apply.js +1779 -141
- package/dist/ai-edits/batch-claims.d.ts +145 -0
- package/dist/ai-edits/batch-claims.js +275 -0
- package/dist/ai-edits/blockRange.js +9 -3
- package/dist/ai-edits/character-boundaries.d.ts +43 -0
- package/dist/ai-edits/character-boundaries.js +95 -0
- package/dist/ai-edits/clean-text.d.ts +33 -3
- package/dist/ai-edits/clean-text.js +52 -6
- package/dist/ai-edits/comment-lifecycle.d.ts +18 -0
- package/dist/ai-edits/comment-lifecycle.js +52 -0
- package/dist/ai-edits/headless.d.ts +91 -7
- package/dist/ai-edits/headless.js +520 -51
- package/dist/ai-edits/index.d.ts +2 -1
- package/dist/ai-edits/index.js +2 -1
- package/dist/ai-edits/minimal-replacement.d.ts +21 -6
- package/dist/ai-edits/minimal-replacement.js +134 -15
- package/dist/ai-edits/newListNumbering.d.ts +23 -0
- package/dist/ai-edits/newListNumbering.js +94 -0
- package/dist/ai-edits/note-references.d.ts +96 -0
- package/dist/ai-edits/note-references.js +139 -0
- package/dist/ai-edits/pending-suggestions.d.ts +79 -0
- package/dist/ai-edits/pending-suggestions.js +306 -0
- package/dist/ai-edits/read.d.ts +6 -4
- package/dist/ai-edits/read.js +113 -50
- package/dist/ai-edits/result-validation.d.ts +29 -0
- package/dist/ai-edits/result-validation.js +164 -0
- package/dist/ai-edits/revisionStretches.d.ts +17 -0
- package/dist/ai-edits/revisionStretches.js +80 -0
- package/dist/ai-edits/snapshot.d.ts +36 -3
- package/dist/ai-edits/snapshot.js +180 -25
- package/dist/ai-edits/table-cell-mutations.d.ts +4 -2
- package/dist/ai-edits/table-cell-mutations.js +6 -2
- package/dist/ai-edits/table-geometry.d.ts +1 -1
- package/dist/ai-edits/table-row-column-mutations.d.ts +44 -17
- package/dist/ai-edits/table-row-column-mutations.js +86 -34
- package/dist/ai-edits/types.d.ts +155 -16
- package/dist/compare/compare.d.ts +1 -1
- package/dist/compare/compare.js +65 -16
- package/dist/compare/content-alignment.d.ts +5 -1
- package/dist/compare/content-alignment.js +52 -34
- package/dist/compare/content-types.d.ts +7 -0
- package/dist/compare/content.d.ts +4 -1
- package/dist/compare/content.js +6 -1
- package/dist/compare/formatting.js +2 -1
- package/dist/compare/inline-atoms.d.ts +21 -4
- package/dist/compare/inline-atoms.js +138 -16
- package/dist/compare/inline-provenance.js +1 -1
- package/dist/compare/plan.js +10 -5
- package/dist/compare/scenario.js +14 -3
- package/dist/compare/section-boundary-properties.js +1 -1
- package/dist/compare/types.d.ts +4 -2
- package/dist/compare/types.js +2 -1
- package/dist/compare/verification.d.ts +1 -1
- package/dist/compare/verification.js +15 -3
- package/dist/controller/committedLayoutDiff.d.ts +25 -0
- package/dist/controller/committedLayoutDiff.js +71 -0
- package/dist/controller/contentControlWidgetController.d.ts +1 -1
- package/dist/controller/folioEditor.d.ts +1 -1
- package/dist/controller/fontReadiness.d.ts +70 -3
- package/dist/controller/fontReadiness.js +100 -10
- package/dist/controller/headerFooterEditorManager.js +6 -1
- package/dist/controller/layoutPipeline.d.ts +12 -10
- package/dist/controller/layoutPipeline.js +65 -11
- package/dist/controller/layoutRunOptions.d.ts +24 -0
- package/dist/controller/layoutRunOptions.js +17 -0
- package/dist/controller/layoutScheduler.d.ts +19 -14
- package/dist/controller/layoutScheduler.js +15 -12
- package/dist/controller/layoutSession.d.ts +26 -2
- package/dist/controller/layoutSession.js +1 -1
- package/dist/controller/noteEditorManager.js +8 -3
- package/dist/document-operations.d.ts +11 -2
- package/dist/document-operations.js +230 -21
- package/dist/docx/altChunk.d.ts +8 -0
- package/dist/docx/altChunk.js +17 -0
- package/dist/docx/archiveInflation.d.ts +127 -0
- package/dist/docx/archiveInflation.js +181 -0
- package/dist/docx/attributeRemainder.d.ts +1 -1
- package/dist/docx/blockContentParser.d.ts +64 -1
- package/dist/docx/blockContentParser.js +17 -4
- package/dist/docx/blockCustomXmlShell.d.ts +7 -0
- package/dist/docx/blockCustomXmlShell.js +14 -0
- package/dist/docx/blockPlainText.js +7 -0
- package/dist/docx/commentAnchorIndex.js +1 -1
- package/dist/docx/commentRangeIntegrity.js +8 -3
- package/dist/docx/commentReferenceNormalization.js +1 -1
- package/dist/docx/commentReplyMarkers.js +20 -1
- package/dist/docx/compatibility.d.ts +1 -1
- package/dist/docx/compatibility.js +34 -13
- package/dist/docx/containerChildren.gen.d.ts +1 -1
- package/dist/docx/containerChildren.gen.js +1 -0
- package/dist/docx/documentParser.js +12 -12
- package/dist/docx/drawingIdNormalization.d.ts +3 -1
- package/dist/docx/drawingIdNormalization.js +6 -1
- package/dist/docx/ensureParaIds.js +119 -97
- package/dist/docx/footnoteParser.js +8 -4
- package/dist/docx/headerFooterParser.js +3 -3
- package/dist/docx/headerFooterReferenceNormalization.d.ts +20 -1
- package/dist/docx/headerFooterReferenceNormalization.js +52 -27
- package/dist/docx/hyperlinkParser.d.ts +1 -1
- package/dist/docx/index.d.ts +1 -1
- package/dist/docx/listNumberingInstances.d.ts +59 -0
- package/dist/docx/listNumberingInstances.js +249 -0
- package/dist/docx/metadataPrivacy.js +24 -1
- package/dist/docx/normalizeBaseDirection.js +2 -1
- package/dist/docx/noteReferenceMark.d.ts +15 -0
- package/dist/docx/noteReferenceMark.js +48 -0
- package/dist/docx/opaqueCarrier.d.ts +7 -0
- package/dist/docx/opaqueCarrier.js +38 -0
- package/dist/docx/packageParts.js +4 -1
- package/dist/docx/paragraphParser.js +96 -27
- package/dist/docx/paragraphPropertySource.d.ts +4 -2
- package/dist/docx/paragraphPropertySource.js +10 -2
- package/dist/docx/paragraphTraversal.js +1 -0
- package/dist/docx/parseWarningMessage.js +4 -1
- package/dist/docx/parser.js +175 -22
- package/dist/docx/rezip.js +31 -7
- package/dist/docx/sdtProperties.js +1 -1
- package/dist/docx/sdtPropertiesPatch.js +3 -0
- package/dist/docx/selectiveSave.js +16 -9
- package/dist/docx/selectiveXmlPatch.d.ts +3 -1
- package/dist/docx/selectiveXmlPatch.js +186 -39
- package/dist/docx/serializer/blockCustomXmlSerializer.d.ts +5 -0
- package/dist/docx/serializer/blockCustomXmlSerializer.js +4 -0
- package/dist/docx/serializer/documentSerializer.js +2 -0
- package/dist/docx/serializer/headerFooterSerializer.js +2 -0
- package/dist/docx/serializer/noteSerializer.js +3 -1
- package/dist/docx/serializer/paragraphSerializer.js +33 -9
- package/dist/docx/serializer/tableSerializer.js +25 -38
- package/dist/docx/server/boundedArchive.d.ts +8 -13
- package/dist/docx/server/boundedArchive.js +70 -59
- package/dist/docx/server/createBilingualDocument.js +3 -3
- package/dist/docx/server/extractDocxText.d.ts +8 -2
- package/dist/docx/server/extractDocxText.js +2 -2
- package/dist/docx/server/validateDocxConformance.d.ts +1 -1
- package/dist/docx/server/validateDocxConformance.js +1 -0
- package/dist/docx/tableParser.d.ts +157 -1
- package/dist/docx/tableParser.js +89 -10
- package/dist/docx/textBoxParser.js +1 -1
- package/dist/docx/unzip.d.ts +20 -2
- package/dist/docx/unzip.js +136 -25
- package/dist/docx/wordprocessingPrefixes.d.ts +78 -0
- package/dist/docx/wordprocessingPrefixes.js +286 -0
- package/dist/fonts/embeddedFonts.js +1 -1
- package/dist/i18n/messages/catalogs.gen.d.ts +170 -34
- package/dist/i18n/messages/catalogs.gen.js +187 -51
- package/dist/i18n/messages/messages.gen.d.ts +10 -2
- package/dist/internal/compare/inline-presentation.d.ts +2 -1
- package/dist/internal/compare/inline-presentation.js +11 -10
- package/dist/internal/headlessRevisionResolutionGuard.d.ts +2 -8
- package/dist/internal/headlessRevisionResolutionGuard.js +2 -11
- package/dist/internal/indexedPositionMap.d.ts +11 -0
- package/dist/internal/indexedPositionMap.js +42 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +2 -1
- package/dist/internal/revisionResolutionEdits.d.ts +13 -0
- package/dist/internal/revisionResolutionEdits.js +19 -0
- package/dist/internal/revisionResolutionInline.d.ts +24 -0
- package/dist/internal/{headlessRevisionResolution.js → revisionResolutionInline.js} +61 -43
- package/dist/internal/revisionResolutionStep.d.ts +34 -0
- package/dist/internal/revisionResolutionStep.js +282 -0
- package/dist/internal/revisionResolutionTracking.d.ts +11 -0
- package/dist/internal/revisionResolutionTracking.js +124 -0
- package/dist/internal/wholeStoryRevisionResolution.d.ts +56 -0
- package/dist/internal/wholeStoryRevisionResolution.js +600 -0
- package/dist/layout-bridge/convert/markupViewFlow.d.ts +20 -0
- package/dist/layout-bridge/convert/markupViewFlow.js +123 -0
- package/dist/layout-bridge/convert/tableConversion.js +1 -1
- package/dist/layout-bridge/convert/toFlowBlocks.js +10 -1
- package/dist/layout-engine/layoutInstrumentation.d.ts +9 -1
- package/dist/layout-engine/layoutInstrumentation.js +4 -1
- package/dist/layout-engine/measure/cache.d.ts +18 -1
- package/dist/layout-engine/measure/cache.js +31 -1
- package/dist/layout-engine/measure/font-metrics.worker.js +3 -7
- package/dist/layout-engine/measure/measureContainer.js +7 -47
- package/dist/layout-engine/measure/measureHelpers.d.ts +6 -1
- package/dist/layout-engine/measure/measureHelpers.js +22 -2
- package/dist/layout-engine/measure/measureParagraph.js +2 -2
- package/dist/layout-engine/measure/measureWorker.js +2 -3
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +6 -7
- package/dist/layout-engine/measure/measureWorkerProtocol.js +1 -2
- package/dist/layout-engine/measure/paragraphMeasureShared.d.ts +12 -1
- package/dist/layout-engine/measure/paragraphMeasureShared.js +14 -1
- package/dist/layout-engine/types.d.ts +6 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderParagraph.js +1 -1
- package/dist/managers/ContextMenuManager.js +5 -2
- package/dist/managers/types.d.ts +3 -0
- package/dist/markdown/escape.d.ts +2 -2
- package/dist/markdown/escape.js +4 -5
- package/dist/markdown/fromMarkdown.js +2 -1
- package/dist/markdown/internals.d.ts +11 -1
- package/dist/markdown/internals.js +24 -3
- package/dist/markdown/renderBlock.js +121 -25
- package/dist/markdown/renderParagraph.d.ts +13 -1
- package/dist/markdown/renderParagraph.js +85 -38
- package/dist/markdown/renderRuns.d.ts +10 -1
- package/dist/markdown/renderRuns.js +323 -69
- package/dist/markdown/renderTable.js +24 -12
- package/dist/markdown/trailers.js +2 -2
- package/dist/markdown/types.d.ts +29 -7
- package/dist/paged-layout/incrementalMeasure.d.ts +1 -2
- package/dist/paged-layout/incrementalMeasure.js +1 -9
- package/dist/paged-layout/transactionDirtyRange.d.ts +1 -3
- package/dist/paged-layout/transactionDirtyRange.js +29 -41
- package/dist/panel-layout.d.ts +83 -0
- package/dist/panel-layout.js +96 -0
- package/dist/prosemirror/anchoredTextBoxes.d.ts +37 -0
- package/dist/prosemirror/anchoredTextBoxes.js +156 -0
- package/dist/prosemirror/attrs/index.d.ts +6 -2
- package/dist/prosemirror/attrs/index.js +172 -1
- package/dist/prosemirror/clearRunColor.d.ts +6 -0
- package/dist/prosemirror/clearRunColor.js +46 -0
- package/dist/prosemirror/commands/comments.d.ts +7 -8
- package/dist/prosemirror/commands/comments.js +281 -212
- package/dist/prosemirror/commands/contentControls.d.ts +1 -1
- package/dist/prosemirror/commands/formatPainter.d.ts +1 -1
- package/dist/prosemirror/commands/formatPainter.js +1 -1
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/hyperlink.js +2 -1
- package/dist/prosemirror/commands/index.d.ts +2 -2
- package/dist/prosemirror/commands/index.js +2 -2
- package/dist/prosemirror/commands/paragraph.d.ts +7 -1
- package/dist/prosemirror/commands/paragraph.js +9 -1
- package/dist/prosemirror/commands/paragraphBookmarkJoin.d.ts +13 -0
- package/dist/prosemirror/commands/paragraphBookmarkJoin.js +22 -0
- package/dist/prosemirror/commands/pastePlainText.d.ts +1 -1
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +3 -2
- package/dist/prosemirror/commands/propertyChangeScope.js +24 -3
- package/dist/prosemirror/commands/resolveAllTableChanges.d.ts +40 -0
- package/dist/prosemirror/commands/resolveAllTableChanges.js +620 -0
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.d.ts +15 -0
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.js +46 -0
- package/dist/prosemirror/commands/resolveParagraphProperties.d.ts +16 -0
- package/dist/prosemirror/commands/resolveParagraphProperties.js +73 -0
- package/dist/prosemirror/commands/sectionBreak.js +2 -1
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +15 -2
- package/dist/prosemirror/commands/tableCellMergeResolution.js +23 -7
- package/dist/prosemirror/containerFinalParagraph.d.ts +11 -5
- package/dist/prosemirror/containerFinalParagraph.js +7 -6
- package/dist/prosemirror/contentControlRevisions.d.ts +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -13
- package/dist/prosemirror/conversion/fromProseDoc.js +177 -605
- package/dist/prosemirror/conversion/toProseDoc.d.ts +4 -11
- package/dist/prosemirror/conversion/toProseDoc.js +70 -154
- package/dist/prosemirror/documentSchema.d.ts +8 -0
- package/dist/prosemirror/documentSchema.js +18 -0
- package/dist/prosemirror/emptyFieldResultRuns.d.ts +18 -0
- package/dist/prosemirror/emptyFieldResultRuns.js +33 -0
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +1 -1
- package/dist/prosemirror/extensions/ExtensionManager.js +3 -1
- package/dist/prosemirror/extensions/StarterKit.js +5 -1
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +116 -63
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +4 -1
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +24 -3
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +20 -0
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.js +43 -0
- package/dist/prosemirror/extensions/features/ListExtension.js +167 -128
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +19 -2
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +33 -20
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +31 -2
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +270 -99
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +3 -2
- package/dist/prosemirror/extensions/features/pasteCleanup.js +2 -1
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +1 -1
- package/dist/prosemirror/extensions/features/pastedHtmlLists.d.ts +12 -0
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +124 -0
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +33 -11
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +8 -4
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +21 -18
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.js +37 -17
- package/dist/prosemirror/extensions/marks/StrikeExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/SubscriptExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +4 -3
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +15 -8
- package/dist/prosemirror/extensions/marks/markUtils.js +25 -10
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.d.ts +12 -0
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.js +46 -0
- package/dist/prosemirror/extensions/nodes/BlockCustomXmlExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/nodes/BlockCustomXmlExtension.js +52 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +2 -2
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +50 -15
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.js +5 -3
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.js +4 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +121 -226
- package/dist/prosemirror/extensions/types.d.ts +11 -1
- package/dist/prosemirror/findReplaceSelection.js +1 -1
- package/dist/prosemirror/hyperlinkRemoval.d.ts +9 -0
- package/dist/prosemirror/hyperlinkRemoval.js +129 -0
- package/dist/prosemirror/index.d.ts +5 -3
- package/dist/prosemirror/index.js +5 -3
- package/dist/prosemirror/indexedNodeLookup.d.ts +17 -0
- package/dist/prosemirror/indexedNodeLookup.js +103 -0
- package/dist/prosemirror/listAutoformatMarkers.d.ts +19 -0
- package/dist/prosemirror/listAutoformatMarkers.js +98 -0
- package/dist/prosemirror/listInstanceReferences.d.ts +12 -0
- package/dist/prosemirror/listInstanceReferences.js +72 -0
- package/dist/prosemirror/listLabels.d.ts +24 -0
- package/dist/prosemirror/listLabels.js +111 -0
- package/dist/prosemirror/listNumbering.d.ts +92 -0
- package/dist/prosemirror/listNumbering.js +330 -0
- package/dist/prosemirror/listRendering.d.ts +27 -0
- package/dist/prosemirror/listRendering.js +27 -0
- package/dist/prosemirror/listRenderingAttrs.d.ts +11 -2
- package/dist/prosemirror/listRenderingAttrs.js +8 -1
- package/dist/prosemirror/markupViewNotes.d.ts +8 -0
- package/dist/prosemirror/markupViewNotes.js +49 -0
- package/dist/prosemirror/markupViewProjection.d.ts +97 -0
- package/dist/prosemirror/markupViewProjection.js +88 -0
- package/dist/prosemirror/noteReferenceReview.d.ts +77 -0
- package/dist/prosemirror/noteReferenceReview.js +332 -0
- package/dist/prosemirror/numberingAttr.d.ts +9 -1
- package/dist/prosemirror/numberingAttr.js +9 -1
- package/dist/prosemirror/outlineLevelAttr.js +1 -1
- package/dist/prosemirror/paragraphIndentation.d.ts +10 -1
- package/dist/prosemirror/paragraphIndentation.js +32 -7
- package/dist/prosemirror/paragraphMarkJoin.d.ts +21 -0
- package/dist/prosemirror/paragraphMarkJoin.js +26 -0
- package/dist/prosemirror/paragraphPropertyCarry.d.ts +64 -0
- package/dist/prosemirror/paragraphPropertyCarry.js +158 -0
- package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +1 -1
- package/dist/prosemirror/plugins/documentNumbering.d.ts +27 -1
- package/dist/prosemirror/plugins/documentNumbering.js +97 -11
- package/dist/prosemirror/plugins/documentStyleState.d.ts +26 -0
- package/dist/prosemirror/plugins/documentStyleState.js +32 -0
- package/dist/prosemirror/plugins/documentStyles.d.ts +3 -13
- package/dist/prosemirror/plugins/documentStyles.js +67 -17
- package/dist/prosemirror/plugins/index.d.ts +2 -1
- package/dist/prosemirror/plugins/index.js +2 -1
- package/dist/prosemirror/plugins/paragraphStyleResolution.d.ts +15 -0
- package/dist/prosemirror/plugins/paragraphStyleResolution.js +230 -0
- package/dist/prosemirror/plugins/suggestionMode.d.ts +27 -3
- package/dist/prosemirror/plugins/suggestionMode.js +490 -63
- package/dist/prosemirror/plugins/templateDirectives.d.ts +1 -1
- package/dist/prosemirror/plugins/transactionInvariants.d.ts +32 -0
- package/dist/prosemirror/plugins/transactionInvariants.js +86 -0
- package/dist/prosemirror/positionSweep.d.ts +24 -0
- package/dist/prosemirror/positionSweep.js +222 -0
- package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +23 -3
- package/dist/prosemirror/rebaseParagraphRunFormatting.js +39 -13
- package/dist/prosemirror/rebaseParagraphRuns.d.ts +36 -0
- package/dist/prosemirror/rebaseParagraphRuns.js +99 -0
- package/dist/prosemirror/rejoinRunCarriers.d.ts +1 -1
- package/dist/prosemirror/replacedAnnotations.d.ts +33 -1
- package/dist/prosemirror/replacedAnnotations.js +170 -1
- package/dist/prosemirror/runFormattingFromMarks.d.ts +18 -0
- package/dist/prosemirror/runFormattingFromMarks.js +567 -0
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +1 -1
- package/dist/prosemirror/runFormattingReconciliation.js +10 -9
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/index.js +3 -0
- package/dist/prosemirror/schema/nodes.d.ts +44 -11
- package/dist/prosemirror/sectionMarkEdits.d.ts +20 -0
- package/dist/prosemirror/sectionMarkEdits.js +59 -0
- package/dist/prosemirror/storyListNumbering.d.ts +17 -0
- package/dist/prosemirror/storyListNumbering.js +102 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.d.ts +59 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.js +145 -0
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +21 -2
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +38 -1
- package/dist/prosemirror/styles/tableStyleRegions.d.ts +31 -0
- package/dist/prosemirror/styles/tableStyleRegions.js +55 -0
- package/dist/prosemirror/tableCellPaste.d.ts +74 -0
- package/dist/prosemirror/tableCellPaste.js +525 -0
- package/dist/prosemirror/tableGridMutation.d.ts +87 -2
- package/dist/prosemirror/tableGridMutation.js +255 -2
- package/dist/prosemirror/tableRunIn.d.ts +51 -0
- package/dist/prosemirror/tableRunIn.js +165 -0
- package/dist/prosemirror/textInput.js +11 -2
- package/dist/prosemirror/trackedRevisionPath.d.ts +17 -0
- package/dist/prosemirror/trackedRevisionPath.js +32 -0
- package/dist/prosemirror/validation.js +5 -1
- package/dist/redline.js +93 -9
- package/dist/render-dom/BodySelectionOverlay.d.ts +4 -1
- package/dist/render-dom/BodySelectionOverlay.js +3 -2
- package/dist/server.d.ts +2 -2
- package/dist/utils/findReplace.js +2 -2
- package/dist/utils/mergeDocumentContent.js +1 -1
- package/dist/utils/noteReferenceLabels.d.ts +36 -0
- package/dist/utils/noteReferenceLabels.js +32 -0
- package/dist/utils/replaceText.js +1 -1
- package/dist/version-comparison.d.ts +1 -0
- package/dist/version-comparison.js +1 -0
- package/package.json +6 -5
- package/dist/internal/headlessRevisionResolution.d.ts +0 -23
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { expectPageBreakRunAttrs } from "../prosemirror/attrs/index.js";
|
|
2
2
|
import { runFormattingInlineAtomCleanText, runFormattingInlineControlCharacter } from "../prosemirror/runFormattingInlineCarriers.js";
|
|
3
|
+
import { createNoteReferenceNumbering, noteReferenceMarker } from "../utils/noteReferenceLabels.js";
|
|
4
|
+
import { noteReferenceOf } from "./note-references.js";
|
|
3
5
|
//#region src/ai-edits/clean-text.ts
|
|
4
6
|
const EMPTY_CLEAN_TEXT_STRUCTURAL_BOUNDARIES = Object.freeze([]);
|
|
5
7
|
const cutsIntoSpan = ({ offset, length }, boundaryOffset) => boundaryOffset > offset && boundaryOffset < offset + length;
|
|
@@ -24,7 +26,7 @@ const resolveCleanTextRange = ({ cleanBlock, startOffset, endOffset }) => {
|
|
|
24
26
|
let from = baseFrom;
|
|
25
27
|
let to = baseTo;
|
|
26
28
|
for (const boundary of structuralBoundaries) {
|
|
27
|
-
if (boundary.type === "field") {
|
|
29
|
+
if (boundary.type === "field" || boundary.type === "noteReference") {
|
|
28
30
|
if (cutsIntoSpan(boundary, startOffset) || cutsIntoSpan(boundary, endOffset)) return null;
|
|
29
31
|
continue;
|
|
30
32
|
}
|
|
@@ -47,12 +49,48 @@ const COMMENT_MARK = "comment";
|
|
|
47
49
|
const HIDDEN_MARK = "hidden";
|
|
48
50
|
const isOmittedFromCleanView = (node) => node.marks.some((mark) => mark.type.name === DELETION_MARK || mark.type.name === HIDDEN_MARK);
|
|
49
51
|
const DEFAULT_BUILD_CLEAN_BLOCK_TEXT_OPTIONS = { fieldResults: "text" };
|
|
50
|
-
|
|
52
|
+
/**
|
|
53
|
+
* The marker a reference reads as: the story's number when the labels know
|
|
54
|
+
* the note, else the next number of a block-local sequence.
|
|
55
|
+
*/
|
|
56
|
+
const noteReferenceLabelFor = (node, labels, local) => {
|
|
57
|
+
const reference = noteReferenceOf(node);
|
|
58
|
+
if (reference === null) return null;
|
|
59
|
+
const known = labels?.labelOf(reference);
|
|
60
|
+
if (known !== void 0) return known;
|
|
61
|
+
const { displayNumber } = local().next(reference.noteType, reference.noteId);
|
|
62
|
+
return noteReferenceMarker(reference.noteType, displayNumber);
|
|
63
|
+
};
|
|
64
|
+
const buildCleanBlockText = (blockNode, blockFrom, { fieldResults, noteReferences } = DEFAULT_BUILD_CLEAN_BLOCK_TEXT_OPTIONS) => {
|
|
51
65
|
let text = "";
|
|
52
66
|
const offsets = [];
|
|
53
67
|
let structuralBoundaries;
|
|
54
68
|
let lastEnd = blockFrom + 1;
|
|
69
|
+
const labels = noteReferences === "sourceText" ? void 0 : noteReferences;
|
|
70
|
+
let localNumbering;
|
|
71
|
+
const local = () => localNumbering ??= createNoteReferenceNumbering();
|
|
55
72
|
blockNode.descendants((node, pos) => {
|
|
73
|
+
if (noteReferences !== "sourceText" && node.isText && !isOmittedFromCleanView(node)) {
|
|
74
|
+
const reference = noteReferenceOf(node);
|
|
75
|
+
const label = reference === null ? null : noteReferenceLabelFor(node, labels, local);
|
|
76
|
+
if (reference !== null && label !== null) {
|
|
77
|
+
const from = blockFrom + 1 + pos;
|
|
78
|
+
const to = from + node.nodeSize;
|
|
79
|
+
(structuralBoundaries ??= []).push({
|
|
80
|
+
type: "noteReference",
|
|
81
|
+
offset: text.length,
|
|
82
|
+
length: label.length,
|
|
83
|
+
from,
|
|
84
|
+
to,
|
|
85
|
+
noteType: reference.noteType,
|
|
86
|
+
noteId: reference.noteId
|
|
87
|
+
});
|
|
88
|
+
for (let index = 0; index < label.length; index++) offsets.push(from);
|
|
89
|
+
text += label;
|
|
90
|
+
lastEnd = to;
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
56
94
|
if (node.type.name === "pageBreakRun") {
|
|
57
95
|
const from = blockFrom + 1 + pos;
|
|
58
96
|
const { clear } = expectPageBreakRunAttrs(node);
|
|
@@ -114,12 +152,20 @@ const buildCleanBlockText = (blockNode, blockFrom, { fieldResults } = DEFAULT_BU
|
|
|
114
152
|
*
|
|
115
153
|
* This is the view a consumer embeds when it wants the model to reason about
|
|
116
154
|
* the redline itself, in contrast to {@link buildCleanBlockText}'s
|
|
117
|
-
* post-tracked-changes view.
|
|
155
|
+
* post-tracked-changes view. A footnote or endnote reference reads as its
|
|
156
|
+
* marker (`[^1]`), numbered within the block.
|
|
157
|
+
*/
|
|
158
|
+
const buildAnnotatedBlockText = (blockNode) => buildAnnotatedBlockTextWithNoteReferences(blockNode, void 0);
|
|
159
|
+
/**
|
|
160
|
+
* {@link buildAnnotatedBlockText} with a story's reference numbering, so a
|
|
161
|
+
* reference reads as the marker every other reader of the story shows.
|
|
118
162
|
*/
|
|
119
|
-
const
|
|
163
|
+
const buildAnnotatedBlockTextWithNoteReferences = (blockNode, noteReferences) => {
|
|
120
164
|
const segments = [];
|
|
165
|
+
let localNumbering;
|
|
166
|
+
const local = () => localNumbering ??= createNoteReferenceNumbering();
|
|
121
167
|
blockNode.descendants((node) => {
|
|
122
|
-
const text = node.isText ? node.text : runFormattingInlineAtomCleanText(node);
|
|
168
|
+
const text = node.isText ? noteReferenceLabelFor(node, noteReferences, local) ?? node.text : runFormattingInlineAtomCleanText(node);
|
|
123
169
|
if (text === void 0 || text === null) return true;
|
|
124
170
|
const annotation = annotationOf(node.marks);
|
|
125
171
|
const previous = segments.at(-1);
|
|
@@ -165,4 +211,4 @@ const renderAnnotatedSegment = ({ annotation, text }) => {
|
|
|
165
211
|
return inner;
|
|
166
212
|
};
|
|
167
213
|
//#endregion
|
|
168
|
-
export { buildAnnotatedBlockText, buildCleanBlockText, resolveCleanTextRange };
|
|
214
|
+
export { buildAnnotatedBlockText, buildAnnotatedBlockTextWithNoteReferences, buildCleanBlockText, resolveCleanTextRange };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
import { Node } from "prosemirror-model";
|
|
3
|
+
//#region src/ai-edits/comment-lifecycle.d.ts
|
|
4
|
+
/** Ids of the comments an editor document anchors: by mark, reference or point anchor. */
|
|
5
|
+
declare const anchoredCommentIdsInProseDoc: (doc: Node) => Set<number>;
|
|
6
|
+
/** Ids of the comments a model story's blocks hold any marker of. */
|
|
7
|
+
declare const anchoredCommentIdsInBlocks: (blocks: readonly document_d_exports.BlockContent[]) => Set<number>;
|
|
8
|
+
/**
|
|
9
|
+
* `comments` without the threads whose root lost its anchor: the root, and
|
|
10
|
+
* every reply that threads under it. A reply's own markers repeat its root's
|
|
11
|
+
* range, so a reply is judged by its root, never on its own.
|
|
12
|
+
*/
|
|
13
|
+
declare const withoutLostCommentThreads: (comments: readonly document_d_exports.Comment[], { anchoredBefore, anchoredNow }: {
|
|
14
|
+
anchoredBefore: ReadonlySet<number>;
|
|
15
|
+
anchoredNow: ReadonlySet<number>;
|
|
16
|
+
}) => document_d_exports.Comment[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { anchoredCommentIdsInBlocks, anchoredCommentIdsInProseDoc, withoutLostCommentThreads };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { visitCommentMarkers } from "../docx/commentAnchorIndex.js";
|
|
2
|
+
import { readCommentReferenceAttrs } from "../prosemirror/commentReferenceAttrs.js";
|
|
3
|
+
import "../prosemirror/extensions/nodes/CommentReferenceExtension.js";
|
|
4
|
+
import "../prosemirror/extensions/nodes/RangeAnchorExtension.js";
|
|
5
|
+
import { readRangeAnchorAttrs } from "../prosemirror/rangeAnchorAttrs.js";
|
|
6
|
+
//#region src/ai-edits/comment-lifecycle.ts
|
|
7
|
+
/** Ids of the comments an editor document anchors: by mark, reference or point anchor. */
|
|
8
|
+
const anchoredCommentIdsInProseDoc = (doc) => {
|
|
9
|
+
const ids = /* @__PURE__ */ new Set();
|
|
10
|
+
doc.descendants((node) => {
|
|
11
|
+
if (node.type.name === "commentReference") {
|
|
12
|
+
const attrs = readCommentReferenceAttrs(node);
|
|
13
|
+
if (attrs.ok) ids.add(attrs.value.commentId);
|
|
14
|
+
} else if (node.type.name === "rangeAnchor") {
|
|
15
|
+
const attrs = readRangeAnchorAttrs(node);
|
|
16
|
+
if (attrs.ok && attrs.value.start.type === "commentRangeStart") ids.add(attrs.value.start.id);
|
|
17
|
+
}
|
|
18
|
+
for (const mark of node.marks) {
|
|
19
|
+
const commentId = mark.attrs["commentId"];
|
|
20
|
+
if (mark.type.name === "comment" && typeof commentId === "number") ids.add(commentId);
|
|
21
|
+
}
|
|
22
|
+
return true;
|
|
23
|
+
});
|
|
24
|
+
return ids;
|
|
25
|
+
};
|
|
26
|
+
/** Ids of the comments a model story's blocks hold any marker of. */
|
|
27
|
+
const anchoredCommentIdsInBlocks = (blocks) => {
|
|
28
|
+
const ids = /* @__PURE__ */ new Set();
|
|
29
|
+
visitCommentMarkers(blocks, ({ item }) => ids.add(item.id));
|
|
30
|
+
return ids;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* `comments` without the threads whose root lost its anchor: the root, and
|
|
34
|
+
* every reply that threads under it. A reply's own markers repeat its root's
|
|
35
|
+
* range, so a reply is judged by its root, never on its own.
|
|
36
|
+
*/
|
|
37
|
+
const withoutLostCommentThreads = (comments, { anchoredBefore, anchoredNow }) => {
|
|
38
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
39
|
+
for (const comment of comments) if (comment.parentId === void 0 && anchoredBefore.has(comment.id) && !anchoredNow.has(comment.id)) dropped.add(comment.id);
|
|
40
|
+
if (dropped.size === 0) return [...comments];
|
|
41
|
+
let grew = true;
|
|
42
|
+
while (grew) {
|
|
43
|
+
grew = false;
|
|
44
|
+
for (const comment of comments) if (!dropped.has(comment.id) && comment.parentId !== void 0 && dropped.has(comment.parentId)) {
|
|
45
|
+
dropped.add(comment.id);
|
|
46
|
+
grew = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return comments.filter((comment) => !dropped.has(comment.id));
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { anchoredCommentIdsInBlocks, anchoredCommentIdsInProseDoc, withoutLostCommentThreads };
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
import { FolioTableTemplates } from "./table-template.js";
|
|
3
3
|
import { FolioAIBlock, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot } from "./types.js";
|
|
4
|
-
import { FolioReplacementBackground, FolioRevisionStamp, FolioWordDiffOptions } from "./apply.js";
|
|
4
|
+
import { FolioReplacementBackground, FolioRevisionStamp, FolioUndefinedStylePolicy, FolioWordDiffOptions } from "./apply.js";
|
|
5
5
|
import { ImportReferencedStyleDefinitionsResult } from "../compare/style-resources.js";
|
|
6
6
|
import { InlineProvenanceTargetOptions } from "../compare/inline-provenance.js";
|
|
7
7
|
import { MatchInlineAtomsOptions } from "../compare/inline-atoms.js";
|
|
8
8
|
import { FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult } from "../document-operations.js";
|
|
9
|
+
import { FolioPendingSuggestionLoadResult, FolioPendingSuggestionRecord } from "./pending-suggestions.js";
|
|
9
10
|
import { FolioReviewChange, FolioReviewChangeKind } from "./read.js";
|
|
10
11
|
import { FolioStoryTable } from "./snapshot.js";
|
|
11
12
|
import { TableGeometryPairing } from "./table-geometry.js";
|
|
@@ -159,6 +160,13 @@ type FolioApplyDocumentOperationsToStoryOptions = FolioApplyDocumentOperationsOp
|
|
|
159
160
|
* the target document — keeps them instead.
|
|
160
161
|
*/
|
|
161
162
|
replacementBackground?: FolioReplacementBackground;
|
|
163
|
+
/**
|
|
164
|
+
* What an operation naming a paragraph style the document does not define
|
|
165
|
+
* does. Refusing it is the default; a caller copying another document's
|
|
166
|
+
* style references — `compareDocx` and `generateRedlineDocx` reproducing the
|
|
167
|
+
* revised document — keeps them instead.
|
|
168
|
+
*/
|
|
169
|
+
undefinedStyles?: FolioUndefinedStylePolicy;
|
|
162
170
|
};
|
|
163
171
|
type FolioHeaderFooterStoryHandle = Extract<FolioEditableDocumentStoryHandle, {
|
|
164
172
|
type: "header" | "footer";
|
|
@@ -200,6 +208,7 @@ type StoryInlineAtomsResult = {
|
|
|
200
208
|
documentChanged: boolean;
|
|
201
209
|
} | {
|
|
202
210
|
status: "unalignable";
|
|
211
|
+
detail?: string;
|
|
203
212
|
} | {
|
|
204
213
|
status: "budget-exceeded";
|
|
205
214
|
};
|
|
@@ -288,8 +297,17 @@ type FolioReviewComment = {
|
|
|
288
297
|
text: string;
|
|
289
298
|
/** The document text the comment is anchored to, or `""` when unanchored. */
|
|
290
299
|
anchoredText: string;
|
|
291
|
-
/**
|
|
300
|
+
/**
|
|
301
|
+
* Stable id of the anchored block, or `null` when the anchor is absent. The
|
|
302
|
+
* id is the one {@link FolioDocxReviewer.snapshotStory} gives the block in
|
|
303
|
+
* {@link FolioReviewComment.story}.
|
|
304
|
+
*/
|
|
292
305
|
blockId: string | null;
|
|
306
|
+
/**
|
|
307
|
+
* The story holding the anchor — the body, a header or footer, a footnote or
|
|
308
|
+
* an endnote — or `null` when the anchor is absent.
|
|
309
|
+
*/
|
|
310
|
+
story: FolioDocumentStoryHandle | null;
|
|
293
311
|
replies: FolioReviewCommentReply[];
|
|
294
312
|
/** Whether the comment is marked resolved / done. */
|
|
295
313
|
done: boolean;
|
|
@@ -323,6 +341,8 @@ declare class FolioDocxReviewer {
|
|
|
323
341
|
private state;
|
|
324
342
|
private readonly secondaryStoryStates;
|
|
325
343
|
private readonly removedHeaderFooterStories;
|
|
344
|
+
/** Notes whose reference a resolution removed: a note exists only through its reference. */
|
|
345
|
+
private readonly removedNoteStories;
|
|
326
346
|
private readonly sectionReferenceRemovals;
|
|
327
347
|
private importedStyles;
|
|
328
348
|
private readonly importedMedia;
|
|
@@ -331,7 +351,10 @@ declare class FolioDocxReviewer {
|
|
|
331
351
|
private readonly resolvedStoryExpectations;
|
|
332
352
|
private readonly createdComments;
|
|
333
353
|
private readonly usedCommentIds;
|
|
354
|
+
/** Comments the body anchored when it was loaded, read as the editor projects it. */
|
|
355
|
+
private readonly loadedMainCommentIds;
|
|
334
356
|
private readonly documentOperationUndoEntries;
|
|
357
|
+
private readonly pendingSuggestions;
|
|
335
358
|
/**
|
|
336
359
|
* Resolved-state overrides recorded by {@link resolveComment}, keyed by
|
|
337
360
|
* comment id. Applied on read ({@link getComments}) and on write
|
|
@@ -359,6 +382,10 @@ declare class FolioDocxReviewer {
|
|
|
359
382
|
* the anchor map the apply layer resolves operations against.
|
|
360
383
|
*/
|
|
361
384
|
snapshot(): FolioAIEditSnapshot;
|
|
385
|
+
/** Export staged AI operations for storage by the host, outside the DOCX. */
|
|
386
|
+
exportPendingSuggestions(): FolioPendingSuggestionRecord[];
|
|
387
|
+
/** Validate saved proposals against this document before restaging them. */
|
|
388
|
+
loadPendingSuggestions(records: readonly unknown[]): FolioPendingSuggestionLoadResult[];
|
|
362
389
|
/**
|
|
363
390
|
* The package's numbering, flattened to what a reader sees: one entry per
|
|
364
391
|
* numbering instance and level, with the format and level text that produce
|
|
@@ -419,8 +446,10 @@ declare class FolioDocxReviewer {
|
|
|
419
446
|
*/
|
|
420
447
|
applyDocumentOperations(batch: FolioDocumentOperationBatch, options?: FolioApplyDocumentOperationsOptions): FolioDocumentOperationResult;
|
|
421
448
|
/** Apply a versioned operation batch to one editable document story. */
|
|
422
|
-
applyDocumentOperationsToStory({ story, batch, snapshot, revisionStamp, wordDiff, tableTemplates, replacementBackground }: FolioApplyDocumentOperationsToStoryOptions): FolioDocumentOperationResult;
|
|
449
|
+
applyDocumentOperationsToStory({ story, batch, snapshot, revisionStamp, wordDiff, tableTemplates, replacementBackground, undefinedStyles }: FolioApplyDocumentOperationsToStoryOptions): FolioDocumentOperationResult;
|
|
450
|
+
/** Apply a batch; the notes whose references it deletes or removes follow them. */
|
|
423
451
|
private applyDocumentOperationsInternal;
|
|
452
|
+
private applyDocumentOperationsToStoryState;
|
|
424
453
|
/** Undo the latest unchanged document-operation batch and its created comments. */
|
|
425
454
|
undoDocumentOperations(undoHandle: FolioDocumentOperationUndoHandle): FolioDocumentOperationUndoResult;
|
|
426
455
|
/**
|
|
@@ -446,6 +475,10 @@ declare class FolioDocxReviewer {
|
|
|
446
475
|
* one per non-empty part: `[header default] …`, `[footer default] …`,
|
|
447
476
|
* `[footnote #N] …`, `[endnote #N] …`. Lines reflect in-memory edits. Empty
|
|
448
477
|
* parts and separator notes are omitted.
|
|
478
|
+
*
|
|
479
|
+
* A header or footer is labelled with the role its section references give
|
|
480
|
+
* it (`default`, `first`, `even`); in a document with several sections, also
|
|
481
|
+
* with the sections that show it: `[header first (sections 1, 3)] …`.
|
|
449
482
|
*/
|
|
450
483
|
getNotesAsText(): string;
|
|
451
484
|
private listStoryHandlesInternal;
|
|
@@ -472,10 +505,12 @@ declare class FolioDocxReviewer {
|
|
|
472
505
|
* {@link getComments} or its id; the reply threads under that comment's root
|
|
473
506
|
* (Word threads are flat). On {@link toBuffer} the reply is written as a real
|
|
474
507
|
* Word reply — linked via `commentsExtended.xml` and given its own
|
|
475
|
-
* `commentRange` markers + reference anchored on the parent's range.
|
|
508
|
+
* `commentRange` markers + reference anchored on the parent's range. The
|
|
509
|
+
* live document carries the same anchor. Returns
|
|
476
510
|
* the created reply, or `null` when the target comment is absent.
|
|
477
511
|
*/
|
|
478
512
|
replyTo(target: FolioReviewComment | number, input: FolioReviewReplyInput): FolioReviewCommentReply | null;
|
|
513
|
+
private anchorReplyInEditor;
|
|
479
514
|
/**
|
|
480
515
|
* Mark a comment thread resolved, or reopen a previously resolved one. Pass
|
|
481
516
|
* the id from {@link getComments} / {@link FolioReviewComment.id}. Applies
|
|
@@ -491,6 +526,13 @@ declare class FolioDocxReviewer {
|
|
|
491
526
|
resolveComment(commentId: string, options?: {
|
|
492
527
|
resolved?: boolean;
|
|
493
528
|
}): boolean;
|
|
529
|
+
/**
|
|
530
|
+
* Where each header and footer part is shown, as the live section
|
|
531
|
+
* references state it: its role (`w:type`) and the 1-based section, in
|
|
532
|
+
* section order. A part's own `hdrFtrType` holds one role, and one part can
|
|
533
|
+
* serve several sections, in different roles.
|
|
534
|
+
*/
|
|
535
|
+
private headerFooterPlacements;
|
|
494
536
|
private currentFinalSectionProperties;
|
|
495
537
|
private stageFinalSectionProperties;
|
|
496
538
|
private stageMappedSectionBoundaries;
|
|
@@ -510,9 +552,16 @@ declare class FolioDocxReviewer {
|
|
|
510
552
|
*/
|
|
511
553
|
rejectChange(target: FolioReviewChange | number): boolean;
|
|
512
554
|
private rejectChangeInternal;
|
|
555
|
+
/** Convert one pending suggestion into an ordinary tracked change. */
|
|
556
|
+
acceptSuggestion(suggestionId: string, options?: {
|
|
557
|
+
author?: string;
|
|
558
|
+
}): boolean;
|
|
559
|
+
/** Remove one pending suggestion without applying it. */
|
|
560
|
+
rejectSuggestion(suggestionId: string): boolean;
|
|
513
561
|
/**
|
|
514
|
-
* Accept every tracked change in the package.
|
|
515
|
-
*
|
|
562
|
+
* Accept every ordinary tracked change in the package. Pending suggestions
|
|
563
|
+
* remain staged until {@link acceptSuggestion} is called. Returns the number
|
|
564
|
+
* of ordinary changes present before the sweep.
|
|
516
565
|
*
|
|
517
566
|
* Every story, not just the body: a revision in a header or a footnote is
|
|
518
567
|
* one a reviewer meant to resolve, and leaving it behind means an accepted
|
|
@@ -524,6 +573,23 @@ declare class FolioDocxReviewer {
|
|
|
524
573
|
private resolveWithSectionReferenceHistory;
|
|
525
574
|
private resolveEveryFinalSectionChange;
|
|
526
575
|
private resolveEveryStory;
|
|
576
|
+
/**
|
|
577
|
+
* Change the body the way a note follows its reference: a note whose
|
|
578
|
+
* reference goes, goes too, as a note no text refers to does; a note whose
|
|
579
|
+
* reference an edit deletes as a tracked change has its text deleted with
|
|
580
|
+
* it; a note whose reference's deletion is rejected gets back the text that
|
|
581
|
+
* deletion took.
|
|
582
|
+
*/
|
|
583
|
+
private withNotesFollowingReferences;
|
|
584
|
+
/** Delete the text of each note whose reference went from live to a tracked deletion. */
|
|
585
|
+
private deleteNotesWithTheirReferences;
|
|
586
|
+
/**
|
|
587
|
+
* The notes a story other than the body refers to (a header, a footer, a
|
|
588
|
+
* comment, another note), leaving out references inside the `skipped` notes.
|
|
589
|
+
*/
|
|
590
|
+
private noteKeysReferencedOutsideBody;
|
|
591
|
+
private resolveEveryStoryOnce;
|
|
592
|
+
private acceptOrdinaryChangesWithSuggestions;
|
|
527
593
|
/** The current document model with edits merged back in. */
|
|
528
594
|
toDocument(): document_d_exports.Document;
|
|
529
595
|
private captureReviewerState;
|
|
@@ -551,6 +617,14 @@ declare class FolioDocxReviewer {
|
|
|
551
617
|
*/
|
|
552
618
|
private trySelectiveSave;
|
|
553
619
|
private getEditableStoryState;
|
|
620
|
+
/**
|
|
621
|
+
* A secondary story as its editable state holds it: the loaded state's
|
|
622
|
+
* document once an operation has loaded it, otherwise the conversion loading
|
|
623
|
+
* performs — with the same deterministic block ids — without retaining a
|
|
624
|
+
* state for a story nothing edits.
|
|
625
|
+
*/
|
|
626
|
+
private readSecondaryStoryDoc;
|
|
627
|
+
private secondaryStoryDoc;
|
|
554
628
|
private requireEditableStoryState;
|
|
555
629
|
private setEditableStoryState;
|
|
556
630
|
private getHeaderFooterStory;
|
|
@@ -575,7 +649,17 @@ declare class FolioDocxReviewer {
|
|
|
575
649
|
private mergeEditedSecondaryStories;
|
|
576
650
|
/** Apply any {@link resolveComment} overrides recorded for these comments. */
|
|
577
651
|
private withResolvedOverrides;
|
|
578
|
-
/**
|
|
652
|
+
/**
|
|
653
|
+
* `comments` without the threads an edit left anchored nowhere: anchored in
|
|
654
|
+
* a story when it was loaded (or created anchored by this reviewer), and
|
|
655
|
+
* anchored in no story now. See `comment-lifecycle.ts`.
|
|
656
|
+
*/
|
|
657
|
+
private keptCommentThreads;
|
|
658
|
+
/**
|
|
659
|
+
* Map each anchored comment id to its anchored text, its containing block id
|
|
660
|
+
* and the story holding it. A comment can be anchored in any story, so every
|
|
661
|
+
* story is read, not only the body.
|
|
662
|
+
*/
|
|
579
663
|
private commentAnchors;
|
|
580
664
|
/** Allocate outside every parsed or newly-created comment and reply id. */
|
|
581
665
|
private nextCommentId;
|