@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,10 +1,36 @@
|
|
|
1
1
|
import { markStructuralChange } from "../prosemirror/extensions/features/ParagraphChangeTrackerExtension.js";
|
|
2
|
-
import { reconcileTableGridAfterColumnRemoval } from "../prosemirror/tableGridMutation.js";
|
|
2
|
+
import { markRowsEmptiedInBatch, reconcileTableGridAfterColumnInsertion, reconcileTableGridAfterColumnRemoval, removeRowsWithoutCells, removeTableRow } from "../prosemirror/tableGridMutation.js";
|
|
3
3
|
import { stripBlockIdentityAttrs } from "./block-identity.js";
|
|
4
4
|
import { findEnclosingTableCell, findEnclosingTableRow } from "./table-targets.js";
|
|
5
5
|
import { tableRowFromTemplate } from "./table-template.js";
|
|
6
|
-
import { TableMap, columnIsHeader, removeColumn,
|
|
6
|
+
import { TableMap, columnIsHeader, removeColumn, rowIsHeader, tableNodeTypes } from "prosemirror-tables";
|
|
7
7
|
//#region src/ai-edits/table-row-column-mutations.ts
|
|
8
|
+
/**
|
|
9
|
+
* The revision of the `index`th cell a column change marks. The save writes
|
|
10
|
+
* each cell's marker as a revision of its own, and each is accepted or
|
|
11
|
+
* rejected on its own; the reviewer's revisions are those from the start.
|
|
12
|
+
*/
|
|
13
|
+
const cellRevision = (revision, index) => ({
|
|
14
|
+
...revision,
|
|
15
|
+
revisionId: revision.revisionId + index
|
|
16
|
+
});
|
|
17
|
+
const UNPLACED_TEXT_PREVIEW_LENGTH = 40;
|
|
18
|
+
const previewCellText = (text) => JSON.stringify(text.length > UNPLACED_TEXT_PREVIEW_LENGTH ? `${text.slice(0, UNPLACED_TEXT_PREVIEW_LENGTH)}…` : text);
|
|
19
|
+
/**
|
|
20
|
+
* Name the `cellTexts` a new row or column has no cell for, or `null` when
|
|
21
|
+
* every one of them has a place.
|
|
22
|
+
*
|
|
23
|
+
* A row is narrower than the table where a vertical merge from above reaches
|
|
24
|
+
* through it, and a column is shorter than the table where a horizontal merge
|
|
25
|
+
* spans across it; the merged cell takes that slot, so the texts are counted
|
|
26
|
+
* against the cells that are really built. Anything past the last one would
|
|
27
|
+
* be dropped by an operation reported as applied.
|
|
28
|
+
*/
|
|
29
|
+
const describeUnplacedCellTexts = ({ cellTexts, capacity, target }) => {
|
|
30
|
+
if (cellTexts === void 0 || cellTexts.length <= capacity) return null;
|
|
31
|
+
const unplaced = cellTexts.slice(capacity).map((text, offset) => `cellTexts[${capacity + offset}] ${previewCellText(text)}`);
|
|
32
|
+
return `the new ${target} has ${capacity} cell${capacity === 1 ? "" : "s"} (${target === "row" ? "a merged cell from the row above reaches through the rest" : "a merged cell spans across the rest"}), so ${unplaced.join(", ")} would not be placed`;
|
|
33
|
+
};
|
|
8
34
|
const getTableColumnCoordinateKey = ({ tablePosition, columnIndex }) => `${tablePosition}:${columnIndex}`;
|
|
9
35
|
const findTableColumnInsertion = ({ doc, blockFrom, position }) => {
|
|
10
36
|
const target = findEnclosingTableCell(doc, blockFrom);
|
|
@@ -28,7 +54,6 @@ const findTableRowInsertion = ({ doc, blockFrom, position }) => {
|
|
|
28
54
|
});
|
|
29
55
|
};
|
|
30
56
|
const applyTableRowInsertion = ({ tr, insertion, cellTexts, revision, template }) => {
|
|
31
|
-
if (revision && insertion.rowspanUpdates.length > 0) return { type: "unsupported" };
|
|
32
57
|
const liveRowspanUpdates = [];
|
|
33
58
|
for (const updatePosition of insertion.rowspanUpdates) {
|
|
34
59
|
const cellPosition = insertion.tableStart + updatePosition;
|
|
@@ -46,7 +71,7 @@ const applyTableRowInsertion = ({ tr, insertion, cellTexts, revision, template }
|
|
|
46
71
|
rowspan: update.rowspan + 1
|
|
47
72
|
});
|
|
48
73
|
const rowAttrs = revision ? { trIns: revision } : null;
|
|
49
|
-
const templated = template === void 0 ? null : tableRowFromTemplate({
|
|
74
|
+
const templated = template === void 0 || insertion.rowspanUpdates.length > 0 ? null : tableRowFromTemplate({
|
|
50
75
|
template,
|
|
51
76
|
columnCount: insertion.columnCount
|
|
52
77
|
});
|
|
@@ -73,12 +98,14 @@ const applyTableRowInsertion = ({ tr, insertion, cellTexts, revision, template }
|
|
|
73
98
|
* accept and an inserted row's text on reject when the row marker stands
|
|
74
99
|
* alone, so the two must always be written together.
|
|
75
100
|
*
|
|
76
|
-
* Two kinds of run stay unmarked. A run that already carries a revision
|
|
77
|
-
* it, because
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
101
|
+
* Two kinds of run stay unmarked. A run that already carries a revision of the
|
|
102
|
+
* same kind keeps it, because overwriting would drop the earlier revision; a
|
|
103
|
+
* pending insertion inside a deleted row is marked deleted as well (`w:ins >
|
|
104
|
+
* w:del`), as `deleteBlock` marks one inside a deleted paragraph, so every
|
|
105
|
+
* reader leaves it out with the rest of the row. A cell that spans into the
|
|
106
|
+
* row below survives the deletion — `removeTableRow` moves it down and
|
|
107
|
+
* shortens its span — so marking its text would delete content the accepted
|
|
108
|
+
* document must still hold.
|
|
82
109
|
*/
|
|
83
110
|
const markTableRowContent = ({ tr, rowPosition, kind, revision }) => {
|
|
84
111
|
const row = tr.doc.nodeAt(rowPosition);
|
|
@@ -103,7 +130,7 @@ const markTableRowContent = ({ tr, rowPosition, kind, revision }) => {
|
|
|
103
130
|
if (!node.isInline) return true;
|
|
104
131
|
if (node.marks.some(isTrackedChangeMark)) {
|
|
105
132
|
wholeRowMarkable = false;
|
|
106
|
-
return false;
|
|
133
|
+
if (kind === "insertion" || node.marks.some(({ type }) => type.name === "deletion")) return false;
|
|
107
134
|
}
|
|
108
135
|
const from = contentFrom + offset;
|
|
109
136
|
markable.push({
|
|
@@ -127,14 +154,27 @@ const applyTableColumnInsertion = ({ tr, insertion, cellTexts, revision }) => {
|
|
|
127
154
|
const tablePosition = tr.mapping.map(insertion.tablePosition, 1);
|
|
128
155
|
const table = tr.doc.nodeAt(tablePosition);
|
|
129
156
|
if (!table || table.type.spec["tableRole"] !== "table") return { type: "unsupported" };
|
|
157
|
+
const map = TableMap.get(table);
|
|
158
|
+
if (insertion.columnIndex >= 0 && insertion.columnIndex <= map.width) {
|
|
159
|
+
const overflow = describeUnplacedCellTexts({
|
|
160
|
+
cellTexts,
|
|
161
|
+
capacity: getInsertedPhysicalColumnRows(map, insertion.columnIndex).length,
|
|
162
|
+
target: "column"
|
|
163
|
+
});
|
|
164
|
+
if (overflow !== null) return {
|
|
165
|
+
type: "payloadDoesNotFit",
|
|
166
|
+
message: overflow
|
|
167
|
+
};
|
|
168
|
+
}
|
|
130
169
|
const actions = buildTableColumnInsertionActions({
|
|
131
|
-
map
|
|
170
|
+
map,
|
|
132
171
|
table,
|
|
133
172
|
columnIndex: insertion.columnIndex,
|
|
134
173
|
cellTexts
|
|
135
174
|
});
|
|
136
175
|
if (!actions || revision && actions.some(({ type }) => type === "setColspan")) return { type: "unsupported" };
|
|
137
176
|
const mapFrom = tr.mapping.maps.length;
|
|
177
|
+
let markedCells = 0;
|
|
138
178
|
for (const action of actions) {
|
|
139
179
|
const position = tr.mapping.slice(mapFrom).map(tablePosition + 1 + action.position);
|
|
140
180
|
if (action.type === "setColspan") {
|
|
@@ -145,14 +185,20 @@ const applyTableColumnInsertion = ({ tr, insertion, cellTexts, revision }) => {
|
|
|
145
185
|
...action.cell.attrs,
|
|
146
186
|
cellMarker: {
|
|
147
187
|
kind: "ins",
|
|
148
|
-
info: revision
|
|
188
|
+
info: cellRevision(revision, markedCells++)
|
|
149
189
|
}
|
|
150
190
|
}, action.cell.content) : action.cell;
|
|
151
191
|
tr.insert(position, cell);
|
|
152
192
|
}
|
|
153
|
-
|
|
193
|
+
reconcileTableGridAfterColumnInsertion({
|
|
194
|
+
tr,
|
|
195
|
+
tablePosition,
|
|
196
|
+
previousTable: table,
|
|
197
|
+
insertedColumn: insertion.columnIndex
|
|
198
|
+
});
|
|
199
|
+
return applied(tr, revision, markedCells);
|
|
154
200
|
};
|
|
155
|
-
const applyTableColumnDeletion = ({ tr, deletion, insertedColumnCount, revision }) => {
|
|
201
|
+
const applyTableColumnDeletion = ({ tr, deletion, insertedColumnCount, revision, emptiedRows }) => {
|
|
156
202
|
const tablePosition = tr.mapping.map(deletion.tablePosition, 1);
|
|
157
203
|
const table = tr.doc.nodeAt(tablePosition);
|
|
158
204
|
if (!table || table.type.spec["tableRole"] !== "table") return { type: "unsupported" };
|
|
@@ -166,12 +212,12 @@ const applyTableColumnDeletion = ({ tr, deletion, insertedColumnCount, revision
|
|
|
166
212
|
columnIndex
|
|
167
213
|
});
|
|
168
214
|
if (!cellPositions) return { type: "unsupported" };
|
|
169
|
-
for (const cellPosition of cellPositions) tr.setNodeAttribute(tablePosition + 1 + cellPosition, "cellMarker", {
|
|
215
|
+
for (const [index, cellPosition] of cellPositions.entries()) tr.setNodeAttribute(tablePosition + 1 + cellPosition, "cellMarker", {
|
|
170
216
|
kind: "del",
|
|
171
|
-
info: revision
|
|
217
|
+
info: cellRevision(revision, index)
|
|
172
218
|
});
|
|
173
219
|
markStructuralChange(tr);
|
|
174
|
-
return applied(tr, revision);
|
|
220
|
+
return applied(tr, revision, cellPositions.length);
|
|
175
221
|
}
|
|
176
222
|
if (map.width === 1) {
|
|
177
223
|
const transaction = deleteTableNode({
|
|
@@ -196,6 +242,13 @@ const applyTableColumnDeletion = ({ tr, deletion, insertedColumnCount, revision
|
|
|
196
242
|
previousTable: table,
|
|
197
243
|
removedColumn: columnIndex
|
|
198
244
|
});
|
|
245
|
+
if (emptiedRows) markRowsEmptiedInBatch({
|
|
246
|
+
tr,
|
|
247
|
+
tablePosition,
|
|
248
|
+
previousTable: table,
|
|
249
|
+
emptied: emptiedRows
|
|
250
|
+
});
|
|
251
|
+
else removeRowsWithoutCells(tr, tablePosition);
|
|
199
252
|
return applied(tr, null);
|
|
200
253
|
};
|
|
201
254
|
const applyTableRowDeletion = ({ tr, deletion, revision }) => {
|
|
@@ -213,32 +266,30 @@ const applyTableRowDeletion = ({ tr, deletion, revision }) => {
|
|
|
213
266
|
markStructuralChange(tr);
|
|
214
267
|
return applied(tr, revision);
|
|
215
268
|
}
|
|
216
|
-
const
|
|
217
|
-
|
|
269
|
+
const at = tr.doc.resolve(tr.mapping.map(deletion.rowPosition));
|
|
270
|
+
const table = at.parent;
|
|
271
|
+
if (table.type.spec["tableRole"] !== "table" || at.nodeAfter?.type.spec["tableRole"] !== "row") return { type: "unsupported" };
|
|
272
|
+
const tablePosition = at.before();
|
|
218
273
|
if (table.childCount === 1) {
|
|
219
274
|
const transaction = deleteTableNode({
|
|
220
275
|
tr,
|
|
221
|
-
tablePosition
|
|
276
|
+
tablePosition,
|
|
222
277
|
table
|
|
223
278
|
});
|
|
224
279
|
return transaction ? applied(transaction, null) : { type: "unsupported" };
|
|
225
280
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
map,
|
|
281
|
+
removeTableRow(tr, {
|
|
282
|
+
map: TableMap.get(table),
|
|
229
283
|
table,
|
|
230
|
-
tableStart:
|
|
231
|
-
|
|
232
|
-
top: deletion.rowIndex,
|
|
233
|
-
right: map.width,
|
|
234
|
-
bottom: deletion.rowIndex + 1
|
|
235
|
-
}, deletion.rowIndex);
|
|
284
|
+
tableStart: at.start()
|
|
285
|
+
}, at.index());
|
|
236
286
|
return applied(tr, null);
|
|
237
287
|
};
|
|
238
|
-
const applied = (transaction, revision) => ({
|
|
288
|
+
const applied = (transaction, revision, revisionCount = 1) => ({
|
|
239
289
|
type: "applied",
|
|
240
290
|
transaction,
|
|
241
|
-
revisionId: revision?.revisionId ?? null
|
|
291
|
+
revisionId: revision?.revisionId ?? null,
|
|
292
|
+
revisionIds: revision ? Array.from({ length: revisionCount }, (_, index) => revision.revisionId + index) : []
|
|
242
293
|
});
|
|
243
294
|
const deleteTableNode = ({ tr, tablePosition, table }) => {
|
|
244
295
|
const tableEnd = tablePosition + table.nodeSize;
|
|
@@ -302,7 +353,8 @@ const splitCellParagraphTexts = (text) => text.split(CELL_LINE_BREAK_PATTERN);
|
|
|
302
353
|
* Fill the new row's cells from `cellTexts`, in order: the nth text goes in
|
|
303
354
|
* the nth cell the row actually has, which is how a caller reading the row
|
|
304
355
|
* through the block snapshot counts them (`table.cellIndex`). Cells the caller
|
|
305
|
-
* did not name stay empty.
|
|
356
|
+
* did not name stay empty. The resolver has already refused more texts than
|
|
357
|
+
* cells ({@link describeUnplacedCellTexts}).
|
|
306
358
|
*/
|
|
307
359
|
const populateTableRow = (row, cellTexts) => {
|
|
308
360
|
if (cellTexts === void 0) return row;
|
|
@@ -404,4 +456,4 @@ const getTableColumnDeletionCellPositions = ({ map, table, columnIndex }) => {
|
|
|
404
456
|
return [...positions];
|
|
405
457
|
};
|
|
406
458
|
//#endregion
|
|
407
|
-
export { applyTableColumnDeletion, applyTableColumnInsertion, applyTableRowDeletion, applyTableRowInsertion, findTableColumnInsertion, findTableRowInsertion, getTableColumnCoordinateKey, markTableRowContent, splitCellParagraphTexts };
|
|
459
|
+
export { applyTableColumnDeletion, applyTableColumnInsertion, applyTableRowDeletion, applyTableRowInsertion, describeUnplacedCellTexts, findTableColumnInsertion, findTableRowInsertion, getTableColumnCoordinateKey, markTableRowContent, splitCellParagraphTexts };
|
package/dist/ai-edits/types.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
import { FolioContentBlock, FolioContentInlineBooleanProperty, FolioContentInlineFormatting, FolioContentInlineFormattingPatch, FolioContentListReference, FolioContentParagraphIndentation, FolioContentParagraphKind, FolioContentParagraphSpacing, FolioContentRun, FolioContentSnapshot, FolioContentTableLocation } from "../compare/content-types.js";
|
|
3
|
+
import { ListKind } from "../docx/listNumberingInstances.js";
|
|
3
4
|
//#region src/ai-edits/types.d.ts
|
|
4
|
-
type FolioAIBlockKind = FolioContentParagraphKind;
|
|
5
|
+
type FolioAIBlockKind = FolioContentParagraphKind | "diagnostic";
|
|
5
6
|
/** Boolean run properties supported by snapshots and range-formatting mutations. */
|
|
6
7
|
type FolioAIInlineBooleanProperty = FolioContentInlineBooleanProperty;
|
|
7
8
|
type FolioAIInlineFormatting = FolioContentInlineFormatting;
|
|
@@ -12,15 +13,28 @@ type FolioAIInlineFormatting = FolioContentInlineFormatting;
|
|
|
12
13
|
type FolioAIInlineFormattingPatch = FolioContentInlineFormattingPatch;
|
|
13
14
|
type FolioAIBlockPreviewRun = FolioContentRun;
|
|
14
15
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* Inline structure inside a block's clean text.
|
|
17
|
+
*
|
|
18
|
+
* `pageBreak` is zero-width at one clean-text boundary and always represents
|
|
19
|
+
* an authored `<w:br w:type="page"/>`; an omitted `clear` remains distinct from
|
|
20
|
+
* any explicit value even though it does not affect layout for this break type.
|
|
21
|
+
*
|
|
22
|
+
* `noteReference` is a footnote or endnote reference, which the text shows as
|
|
23
|
+
* its marker (`[^1]` for the first footnote, `[^e1]` for the first endnote —
|
|
24
|
+
* the numbering the Markdown export uses) over `length` characters from
|
|
25
|
+
* `offset`. The marker is structure, not text: a range may not cut into it,
|
|
26
|
+
* and a text edit that would rewrite or remove it is refused
|
|
27
|
+
* (`protectedReference`).
|
|
19
28
|
*/
|
|
20
29
|
type FolioAIBlockStructuralBoundary = {
|
|
21
30
|
type: "pageBreak";
|
|
22
31
|
offset: number;
|
|
23
32
|
clear?: document_d_exports.BreakContent["clear"];
|
|
33
|
+
} | {
|
|
34
|
+
type: "noteReference";
|
|
35
|
+
noteType: "footnote" | "endnote";
|
|
36
|
+
offset: number;
|
|
37
|
+
length: number;
|
|
24
38
|
};
|
|
25
39
|
/**
|
|
26
40
|
* Where a block sits inside its innermost enclosing table. Every index is
|
|
@@ -33,6 +47,11 @@ type FolioAIBlockStructuralBoundary = {
|
|
|
33
47
|
type FolioAIBlockTableLocation = FolioContentTableLocation;
|
|
34
48
|
type FolioAIBlock = FolioContentBlock<FolioAIBlockKind> & {
|
|
35
49
|
structuralBoundaries?: readonly FolioAIBlockStructuralBoundary[];
|
|
50
|
+
/** Present on a read-only block that reports preserved content Folio cannot interpret. */
|
|
51
|
+
diagnostic?: {
|
|
52
|
+
type: "opaqueCarrier";
|
|
53
|
+
carrier: string;
|
|
54
|
+
};
|
|
36
55
|
};
|
|
37
56
|
/**
|
|
38
57
|
* The complete modeled attribute set of one direct `w:pPr/w:spacing` child.
|
|
@@ -43,6 +62,22 @@ type FolioAIParagraphSpacing = FolioContentParagraphSpacing;
|
|
|
43
62
|
/** The complete modeled attribute set of one direct `w:pPr/w:ind` child. */
|
|
44
63
|
type FolioAIParagraphIndentation = FolioContentParagraphIndentation;
|
|
45
64
|
type FolioAIListReference = FolioContentListReference;
|
|
65
|
+
/** The kinds of list an operation can start. */
|
|
66
|
+
type FolioAIListKind = ListKind;
|
|
67
|
+
/**
|
|
68
|
+
* Start a new list: a numbering instance of `kind`, defined for the
|
|
69
|
+
* operation, with its paragraphs at `level` (zero-based, default 0). Every
|
|
70
|
+
* paragraph one operation numbers this way joins the same new list; separate
|
|
71
|
+
* operations start separate lists. A package without a numbering part gets
|
|
72
|
+
* one.
|
|
73
|
+
*/
|
|
74
|
+
type FolioAINewListReference = {
|
|
75
|
+
start: "new";
|
|
76
|
+
kind: FolioAIListKind;
|
|
77
|
+
level?: number;
|
|
78
|
+
};
|
|
79
|
+
/** An existing numbering instance and level, or a new list. */
|
|
80
|
+
type FolioAIListNumbering = FolioAIListReference | FolioAINewListReference;
|
|
46
81
|
/** Which paragraphs split from one insertion's `text` receive its paragraph formatting. */
|
|
47
82
|
type FolioAIInsertFormattingScope = "firstParagraph" | "allParagraphs";
|
|
48
83
|
/**
|
|
@@ -53,13 +88,15 @@ type FolioAIInsertFormattingScope = "firstParagraph" | "allParagraphs";
|
|
|
53
88
|
type FolioAIBlockParagraphProperties = {
|
|
54
89
|
/** `w:pStyle`. `null` clears the style back to the default. */
|
|
55
90
|
styleId?: string | null;
|
|
91
|
+
/** Direct `w:outlineLvl`. `null` restores style inheritance. */
|
|
92
|
+
outlineLevel?: document_d_exports.OutlineLevel | null;
|
|
56
93
|
/**
|
|
57
94
|
* `w:numPr/w:ilvl`, zero-based. `null` removes numbering unless `numbering`
|
|
58
95
|
* supplies a concrete instance; together they retain that instance without
|
|
59
96
|
* an authored level.
|
|
60
97
|
*/
|
|
61
98
|
listLevel?: number | null;
|
|
62
|
-
numbering?:
|
|
99
|
+
numbering?: FolioAIListNumbering | null;
|
|
63
100
|
/** Direct `w:jc`. `null` clears the override and restores style inheritance. */
|
|
64
101
|
alignment?: document_d_exports.ParagraphAlignment | null;
|
|
65
102
|
/** Direct `w:spacing` attributes. `null` removes the whole direct child. */
|
|
@@ -234,8 +271,8 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
234
271
|
/**
|
|
235
272
|
* Which paragraphs split from `text` receive the operation's
|
|
236
273
|
* paragraph formatting: the inherited anchor formatting plus
|
|
237
|
-
* `styleId`, `listLevel`, `numbering`, `alignment`,
|
|
238
|
-
* `indentation`. `"firstParagraph"` (the default) formats the first
|
|
274
|
+
* `styleId`, `outlineLevel`, `listLevel`, `numbering`, `alignment`,
|
|
275
|
+
* `spacing` and `indentation`. `"firstParagraph"` (the default) formats the first
|
|
239
276
|
* and leaves the rest as body paragraphs, for a heading followed by
|
|
240
277
|
* its body. `"allParagraphs"` formats every paragraph alike, for
|
|
241
278
|
* several list items in one operation. `pageBreakBefore` and
|
|
@@ -270,6 +307,13 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
270
307
|
* inheritance alone cannot say.
|
|
271
308
|
*/
|
|
272
309
|
styleId?: string | null;
|
|
310
|
+
/**
|
|
311
|
+
* Direct `w:outlineLvl` for the inserted block. Without it the
|
|
312
|
+
* inserted paragraph keeps the level the anchor states itself, so a
|
|
313
|
+
* body paragraph inserted beside a heading that states its level
|
|
314
|
+
* becomes a heading. `null` clears it and lets the style decide.
|
|
315
|
+
*/
|
|
316
|
+
outlineLevel?: document_d_exports.OutlineLevel | null;
|
|
273
317
|
/**
|
|
274
318
|
* Override `w:numPr/w:ilvl` on the inserted block, keeping the
|
|
275
319
|
* anchor's `w:numId`. Without it the inserted paragraph takes the
|
|
@@ -279,7 +323,7 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
279
323
|
* they retain that instance without an authored level.
|
|
280
324
|
*/
|
|
281
325
|
listLevel?: number | null;
|
|
282
|
-
numbering?:
|
|
326
|
+
numbering?: FolioAIListNumbering | null;
|
|
283
327
|
/**
|
|
284
328
|
* Direct `w:jc` for the inserted block. `null` clears alignment copied
|
|
285
329
|
* from the anchor and lets the inserted paragraph's style decide.
|
|
@@ -456,10 +500,12 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
456
500
|
* Initial text for each cell of the new row, in order — the same order
|
|
457
501
|
* a block's `table.cellIndex` counts. Cells left unnamed stay empty.
|
|
458
502
|
*
|
|
459
|
-
* Sized against the
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
503
|
+
* Sized against the cells the new row really has, which is fewer than
|
|
504
|
+
* the table's columns where a vertical merge from the row above
|
|
505
|
+
* reaches through the insertion point (the merge grows through the
|
|
506
|
+
* new row and keeps its column). More texts than cells is refused as
|
|
507
|
+
* `payloadDoesNotFit`, naming the texts with no cell, before anything
|
|
508
|
+
* is written; fewer leaves the remaining cells empty.
|
|
463
509
|
*
|
|
464
510
|
* A line break in a cell's text starts a new paragraph in that cell,
|
|
465
511
|
* as in `insertTable`.
|
|
@@ -476,7 +522,11 @@ type FolioAIEditOperation = FolioAIEditReviewMeta & {
|
|
|
476
522
|
/** Stable paragraph anchor inside the cell that receives the new sibling column. */
|
|
477
523
|
blockId: string;
|
|
478
524
|
position?: "after" | "before";
|
|
479
|
-
/**
|
|
525
|
+
/**
|
|
526
|
+
* Initial text for newly created physical cells in row order. A
|
|
527
|
+
* horizontal merge the new column crosses widens instead of taking a
|
|
528
|
+
* cell, so more texts than new cells is refused as `payloadDoesNotFit`.
|
|
529
|
+
*/
|
|
480
530
|
cellTexts?: string[];
|
|
481
531
|
} | {
|
|
482
532
|
id: string;
|
|
@@ -539,7 +589,74 @@ type FolioAIEditSkipReason = "missingBlock" | "changedBlock" | "ambiguousFind" |
|
|
|
539
589
|
* no entity to attach suggestions to); the operation was neither applied
|
|
540
590
|
* nor queued.
|
|
541
591
|
*/
|
|
542
|
-
"documentNotEditable"
|
|
592
|
+
"documentNotEditable" |
|
|
593
|
+
/**
|
|
594
|
+
* The operation supplies more values than its target can hold, so applying
|
|
595
|
+
* it would drop some of them: an `insertTableRow` whose `cellTexts` outnumber
|
|
596
|
+
* the cells the new row has (a vertical merge crossing the insertion point
|
|
597
|
+
* extends through the new row and takes a column away from it), or an
|
|
598
|
+
* `insertTableColumn` whose `cellTexts` outnumber the cells the new column
|
|
599
|
+
* has. Nothing was applied; `message` names the values that do not fit.
|
|
600
|
+
* Supply fewer values, or anchor the operation where the table has room.
|
|
601
|
+
*/
|
|
602
|
+
"payloadDoesNotFit" |
|
|
603
|
+
/**
|
|
604
|
+
* An earlier operation of the same batch already claims this operation's
|
|
605
|
+
* target: it deletes, rewrites, splits or merges the block this one edits,
|
|
606
|
+
* or edits an overlapping stretch of its text. Operations of one batch all
|
|
607
|
+
* address the document as it was read, so this one would have landed on
|
|
608
|
+
* positions the other had moved. Nothing of it was applied; re-read the
|
|
609
|
+
* document after the batch and send it again, on its own.
|
|
610
|
+
*/
|
|
611
|
+
"overlappingOperation" |
|
|
612
|
+
/**
|
|
613
|
+
* An offset of the operation falls inside one character: between the two
|
|
614
|
+
* UTF-16 halves of a surrogate pair (an emoji, a character outside the
|
|
615
|
+
* Basic Multilingual Plane), or — for an operation that changes text or
|
|
616
|
+
* breaks a paragraph — inside a grapheme cluster (a letter and its combining
|
|
617
|
+
* marks, an emoji sequence joined with zero-width joiners, a flag). Text cut
|
|
618
|
+
* there cannot be written back whole. Nothing was applied; move the offset
|
|
619
|
+
* to the boundary before or after the character.
|
|
620
|
+
*/
|
|
621
|
+
"splitsCharacter" |
|
|
622
|
+
/**
|
|
623
|
+
* The text change would rewrite or remove a footnote or endnote reference
|
|
624
|
+
* (the `[^1]` / `[^e1]` markers the text shows), or write a marker-shaped
|
|
625
|
+
* string of its own. A reference is structure, not text: keep each marker
|
|
626
|
+
* the match covers in the replacement, in order, or match only the prose
|
|
627
|
+
* beside it.
|
|
628
|
+
*/
|
|
629
|
+
"protectedReference" |
|
|
630
|
+
/**
|
|
631
|
+
* The operation names a paragraph style (`styleId`) the document does not
|
|
632
|
+
* define, or one defined as a table, character or numbering style. Nothing
|
|
633
|
+
* was applied: such a `w:pStyle` confers no formatting, so the paragraph
|
|
634
|
+
* would keep its body look. Use a paragraph style the document defines, or
|
|
635
|
+
* `null` to clear the style.
|
|
636
|
+
*/
|
|
637
|
+
"missingStyle" |
|
|
638
|
+
/**
|
|
639
|
+
* The operation names a numbering instance (`numbering.numId`) the document
|
|
640
|
+
* does not define. Nothing was applied: a paragraph referencing a missing
|
|
641
|
+
* `w:num` cannot be saved. Re-read the document and use an instance it
|
|
642
|
+
* defines, or clear the numbering.
|
|
643
|
+
*/
|
|
644
|
+
"missingNumbering" |
|
|
645
|
+
/**
|
|
646
|
+
* Applying the operation would have left a document that cannot be saved:
|
|
647
|
+
* the save-time model validator rejected the result. Nothing from the
|
|
648
|
+
* operation was applied; `message` carries the validator's path and reason.
|
|
649
|
+
*/
|
|
650
|
+
"invalidResult" |
|
|
651
|
+
/**
|
|
652
|
+
* The block is pending deletion: a tracked change deletes its text and its
|
|
653
|
+
* paragraph mark, or the table row or cell holding it, so a reader lists it
|
|
654
|
+
* as a blank block and accepting removes it. Nothing was applied: text
|
|
655
|
+
* written there would join the next paragraph, or go with the row, once the
|
|
656
|
+
* deletion is accepted. Reject that deletion first, or insert a new block
|
|
657
|
+
* next to it.
|
|
658
|
+
*/
|
|
659
|
+
"pendingDeletion";
|
|
543
660
|
type FolioAIEditAppliedOperation = {
|
|
544
661
|
id: string;
|
|
545
662
|
commentId?: number;
|
|
@@ -572,6 +689,15 @@ type FolioAIEditAppliedOperation = {
|
|
|
572
689
|
type FolioAIEditSkippedOperation = {
|
|
573
690
|
id: string;
|
|
574
691
|
reason: FolioAIEditSkipReason;
|
|
692
|
+
/**
|
|
693
|
+
* What exactly was wrong when the reason alone does not say: the values a
|
|
694
|
+
* `payloadDoesNotFit` skip could not place, the earlier operation an
|
|
695
|
+
* `overlappingOperation` skip conflicts with, the offset and character of a
|
|
696
|
+
* `splitsCharacter` skip, the undefined style of a `missingStyle` skip, the
|
|
697
|
+
* undefined instance of a `missingNumbering` skip, or the validator's path
|
|
698
|
+
* and message of an `invalidResult` one.
|
|
699
|
+
*/
|
|
700
|
+
message?: string;
|
|
575
701
|
};
|
|
576
702
|
/**
|
|
577
703
|
* One automatic adjustment `apply.ts` made to an operation's input to keep the
|
|
@@ -600,6 +726,19 @@ type FolioAIEditNormalization =
|
|
|
600
726
|
id: string;
|
|
601
727
|
code: "unpairedMove";
|
|
602
728
|
moveId: string;
|
|
729
|
+
} |
|
|
730
|
+
/**
|
|
731
|
+
* A text replacement rewrote a stretch whose characters did not all carry
|
|
732
|
+
* the same formatting, link or comment. The new text takes the formatting
|
|
733
|
+
* of the first character it replaces, and every link and comment over the
|
|
734
|
+
* stretch; text the replacement keeps keeps its own. A change spanning
|
|
735
|
+
* several words keeps only whole words, so no word is left partly in the
|
|
736
|
+
* old formatting. Direct and tracked modes allocate alike: accepting the
|
|
737
|
+
* tracked replacement leaves what the direct one writes.
|
|
738
|
+
*/
|
|
739
|
+
{
|
|
740
|
+
id: string;
|
|
741
|
+
code: "uniformReplacementFormatting";
|
|
603
742
|
};
|
|
604
743
|
type FolioAIEditNormalizationCode = FolioAIEditNormalization["code"];
|
|
605
744
|
type FolioAIEditApplyResult = {
|
|
@@ -609,4 +748,4 @@ type FolioAIEditApplyResult = {
|
|
|
609
748
|
normalizations?: FolioAIEditNormalization[];
|
|
610
749
|
};
|
|
611
750
|
//#endregion
|
|
612
|
-
export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIInsertFormattingScope, FolioAIListReference, FolioAIParagraphIndentation, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
|
|
751
|
+
export { FolioAIBlock, FolioAIBlockAnchor, FolioAIBlockKind, FolioAIBlockParagraphProperties, FolioAIBlockPreviewRun, FolioAIBlockStructuralBoundary, FolioAIBlockTableLocation, FolioAIComment, FolioAIEditAppliedOperation, FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditNormalization, FolioAIEditNormalizationCode, FolioAIEditOperation, FolioAIEditPrecondition, FolioAIEditReviewMeta, FolioAIEditSeverity, FolioAIEditSkipReason, FolioAIEditSkippedOperation, FolioAIEditSnapshot, FolioAIInlineBooleanProperty, FolioAIInlineFormatting, FolioAIInlineFormattingPatch, FolioAIInsertFormattingScope, FolioAIListKind, FolioAIListNumbering, FolioAIListReference, FolioAINewListReference, FolioAIParagraphIndentation, FolioAIParagraphSpacing, FolioAISignatureParty, FolioAITextRangeHandle, FolioDocumentNavigationTarget, FolioDocumentOutline, FolioDocumentOutlineEntry, FolioDocumentSection, FolioDocumentSectionHandle, FolioDocumentSectionReadResult };
|
|
@@ -100,7 +100,7 @@ type AppliedComparison = {
|
|
|
100
100
|
* what you could not represent" and "give me nothing unless you can prove it"
|
|
101
101
|
* are both legitimate asks and only the caller knows which one it is making.
|
|
102
102
|
*/
|
|
103
|
-
declare const applyComparison: ({ reviewer, revisionStamp, granularity, revisionFormat, terminalTableCarrierStaged, numberingChanges, targetNumbering, targetNumberingReferences, targetNumberingReferenceMap, finalSectionComparison, styleImportFailure, pairs }: ParsedComparison, planned: readonly PlannedStoryComparison[]) => Result<AppliedComparison, CompareDocxApplyError | CompareDocxOperationLimitError>;
|
|
103
|
+
declare const applyComparison: ({ reviewer, revisionStamp, granularity, revisionFormat, terminalTableCarrierStaged, numberingChanges, targetNumbering, targetNumberingReferences, targetNumberingReferenceMap, finalSectionComparison, styleImportFailure, pairs, unsupported }: ParsedComparison, planned: readonly PlannedStoryComparison[]) => Result<AppliedComparison, CompareDocxApplyError | CompareDocxOperationLimitError>;
|
|
104
104
|
/**
|
|
105
105
|
* Stage 4: the result package, with every ZIP entry date pinned.
|
|
106
106
|
*
|