@stll/folio-core 0.67.0 → 0.69.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/dist/ai-edits/apply.d.ts +9 -1
- package/dist/ai-edits/apply.js +94 -8
- package/dist/ai-edits/headless.d.ts +36 -21
- package/dist/ai-edits/headless.js +106 -36
- package/dist/ai-edits/index.d.ts +2 -2
- package/dist/ai-edits/newListNumbering.d.ts +14 -1
- package/dist/ai-edits/newListNumbering.js +24 -1
- package/dist/ai-edits/note-references.d.ts +6 -0
- package/dist/ai-edits/note-references.js +7 -1
- package/dist/ai-edits/pending-suggestions.js +2 -2
- package/dist/ai-edits/read.d.ts +19 -0
- package/dist/ai-edits/snapshot.d.ts +6 -0
- package/dist/ai-edits/snapshot.js +8 -3
- package/dist/ai-edits/types.d.ts +9 -1
- package/dist/ai-suggestions/apply.js +13 -4
- package/dist/compare/compare.js +2 -1
- package/dist/compare/inserted-resource-snapshot.d.ts +4 -1
- package/dist/compare/inserted-resource-snapshot.js +7 -3
- package/dist/controller/canonicalClipboard.js +31 -14
- package/dist/controller/canonicalComposition.js +35 -6
- package/dist/controller/canonicalInlineProjection.d.ts +35 -10
- package/dist/controller/canonicalInlineProjection.js +192 -28
- package/dist/controller/canonicalInput.d.ts +2 -1
- package/dist/controller/canonicalInput.js +32 -7
- package/dist/controller/canonicalListRendering.d.ts +2 -1
- package/dist/controller/canonicalListRendering.js +1 -1
- package/dist/controller/canonicalLockGuard.d.ts +23 -0
- package/dist/controller/canonicalLockGuard.js +133 -0
- package/dist/controller/canonicalProjectionBlocks.d.ts +79 -0
- package/dist/controller/canonicalProjectionBlocks.js +75 -0
- package/dist/controller/canonicalPublicOperations.d.ts +12 -4
- package/dist/controller/canonicalPublicOperations.js +676 -46
- package/dist/controller/canonicalSeedContent.d.ts +12 -0
- package/dist/controller/canonicalSeedContent.js +131 -0
- package/dist/controller/canonicalSession.d.ts +133 -21
- package/dist/controller/canonicalSession.js +738 -205
- package/dist/controller/canonicalSourceNormalization.d.ts +21 -0
- package/dist/controller/canonicalSourceNormalization.js +148 -0
- package/dist/controller/canonicalStoryEditor.d.ts +4 -3
- package/dist/controller/canonicalStoryEditor.js +20 -15
- package/dist/controller/canonicalStructure.d.ts +2 -1
- package/dist/controller/canonicalStructure.js +129 -7
- package/dist/controller/contentControlWidgetController.d.ts +5 -0
- package/dist/controller/contentControlWidgetController.js +13 -1
- package/dist/controller/folioEditor.js +4 -0
- package/dist/controller/headerFooterEditorManager.d.ts +7 -2
- package/dist/controller/headerFooterEditorManager.js +11 -6
- package/dist/controller/hiddenEditorApi.d.ts +17 -2
- package/dist/controller/hiddenEditorApi.js +4 -0
- package/dist/controller/hiddenEditorManager.d.ts +11 -3
- package/dist/controller/hiddenEditorManager.js +157 -48
- package/dist/controller/layoutPipeline.js +50 -16
- package/dist/controller/layoutSession.d.ts +3 -0
- package/dist/controller/layoutSession.js +3 -1
- package/dist/controller/noteEditorManager.d.ts +7 -2
- package/dist/controller/noteEditorManager.js +11 -6
- package/dist/display-list/build/pageFurniture.js +41 -19
- package/dist/display-list/build/tablePrimitives.js +23 -4
- package/dist/display-list/dom/renderDisplayListToDom.js +13 -11
- package/dist/document-operations.d.ts +9 -1
- package/dist/document-operations.js +4 -3
- package/dist/docx/blockContentParser.d.ts +7 -3
- package/dist/docx/blockContentParser.js +2 -3
- package/dist/docx/blockPlainText.js +2 -0
- package/dist/docx/bookmarkRangeJoin.d.ts +6 -0
- package/dist/docx/bookmarkRangeJoin.js +43 -0
- package/dist/docx/canonicalSave.js +11 -2
- package/dist/docx/canonicalSessionInput.d.ts +5 -1
- package/dist/docx/canonicalSessionInput.js +7 -2
- package/dist/docx/commentAnchorIndex.d.ts +40 -5
- package/dist/docx/commentAnchorIndex.js +94 -12
- package/dist/docx/commentRangeIntegrity.js +30 -24
- package/dist/docx/commentRangeJoin.d.ts +4 -0
- package/dist/docx/commentRangeJoin.js +26 -12
- package/dist/docx/commentReferenceCompletion.js +5 -4
- package/dist/docx/commentReferenceNormalization.js +40 -18
- package/dist/docx/compatibility.js +9 -2
- package/dist/docx/containerChildren.js +22 -1
- package/dist/docx/contentTypeRegistry.js +1 -1
- package/dist/docx/encryption/compoundFile.js +9 -1
- package/dist/docx/encryption/encryptionInfo.js +16 -2
- package/dist/docx/ensureParaIds.js +46 -7
- package/dist/docx/ensureUniqueControlIds.d.ts +25 -0
- package/dist/docx/ensureUniqueControlIds.js +110 -0
- package/dist/docx/headerFooterVerbatim.d.ts +7 -0
- package/dist/docx/headerFooterVerbatim.js +13 -2
- package/dist/docx/hostCommentThreads.d.ts +27 -0
- package/dist/docx/hostCommentThreads.js +72 -0
- package/dist/docx/hyperlinkParser.js +9 -2
- package/dist/docx/inlineWrapperContent.d.ts +8 -1
- package/dist/docx/inlineWrapperContent.js +9 -2
- package/dist/docx/listMarkerComputation.d.ts +35 -1
- package/dist/docx/listMarkerComputation.js +39 -1
- package/dist/docx/listModelNormalization.d.ts +44 -1
- package/dist/docx/listModelNormalization.js +226 -96
- package/dist/docx/listNumberingInstances.d.ts +1 -1
- package/dist/docx/listNumberingInstances.js +2 -2
- package/dist/docx/markupRangeMarker.d.ts +14 -0
- package/dist/docx/markupRangeMarker.js +15 -1
- package/dist/docx/metadataPrivacy.js +43 -22
- package/dist/docx/normalizeBaseDirection.js +3 -1
- package/dist/docx/numberingIds.d.ts +6 -0
- package/dist/docx/numberingIds.js +6 -1
- package/dist/docx/numberingReferenceNormalization.d.ts +4 -0
- package/dist/docx/numberingReferenceNormalization.js +12 -2
- package/dist/docx/paragraphParser.js +159 -48
- package/dist/docx/paragraphPropertySource.d.ts +29 -0
- package/dist/docx/paragraphPropertySource.js +106 -16
- package/dist/docx/paragraphTextBoxEnrichment.js +2 -1
- package/dist/docx/paragraphTraversal.js +2 -0
- package/dist/docx/parseWarningMessage.js +2 -1
- package/dist/docx/parser.js +8 -0
- package/dist/docx/removeHeaderFooterParts.js +1 -1
- package/dist/docx/renderedPageBreakNormalization.js +1 -1
- package/dist/docx/reviewProvenanceDiagnostics.d.ts +7 -0
- package/dist/docx/reviewProvenanceDiagnostics.js +39 -0
- package/dist/docx/reviewResolutionProvenance.d.ts +29 -3
- package/dist/docx/reviewResolutionProvenance.js +171 -33
- package/dist/docx/rezip.d.ts +6 -0
- package/dist/docx/rezip.js +38 -21
- package/dist/docx/selectiveSave.js +6 -10
- package/dist/docx/selectiveXmlPatch.d.ts +5 -4
- package/dist/docx/selectiveXmlPatch.js +11 -7
- package/dist/docx/serializer/documentSerializer.js +5 -2
- package/dist/docx/serializer/headerFooterSerializer.js +3 -1
- package/dist/docx/serializer/markupRangeAttributes.d.ts +6 -1
- package/dist/docx/serializer/markupRangeAttributes.js +6 -1
- package/dist/docx/serializer/noteSerializer.d.ts +17 -4
- package/dist/docx/serializer/noteSerializer.js +23 -16
- package/dist/docx/serializer/paragraphSerializer.js +56 -12
- package/dist/docx/serializer/partNamespaces.d.ts +1 -1
- package/dist/docx/serializer/partNamespaces.js +1 -1
- package/dist/docx/serializer/runSerializer.d.ts +1 -3
- package/dist/docx/serializer/runSerializer.js +2 -2
- package/dist/docx/serializer/tableSerializer.d.ts +4 -0
- package/dist/docx/serializer/tableSerializer.js +4 -2
- package/dist/docx/server/applyDocxXmlPatchProposal.js +8 -4
- package/dist/docx/server/build.d.ts +1 -1
- package/dist/docx/server/createBilingualDocument.js +27 -5
- package/dist/docx/server/migrateYjsAttrSchema.js +4 -0
- package/dist/docx/sessionListPruning.d.ts +2 -0
- package/dist/docx/sessionListPruning.js +50 -0
- package/dist/docx/splitRevisionPieces.d.ts +10 -0
- package/dist/docx/splitRevisionPieces.js +14 -0
- package/dist/docx/storyBlockReplay.js +19 -2
- package/dist/docx/structuralXmlPatch.js +44 -11
- package/dist/docx/tableParser.d.ts +6 -2
- package/dist/docx/tableParser.js +2 -3
- package/dist/docx/textBoxContentParser.d.ts +11 -0
- package/dist/docx/textBoxContentParser.js +51 -0
- package/dist/docx/textBoxParser.d.ts +0 -5
- package/dist/docx/textBoxParser.js +1 -23
- package/dist/docx/verticalMergeProjection.js +1 -1
- package/dist/docx/xmlParser.d.ts +1 -1
- package/dist/docx/xmlParser.js +2 -3
- package/dist/fonts/fontsourceFaces.d.ts +2 -8
- package/dist/fonts/fontsourceFaces.js +1 -7
- package/dist/i18n/messages/ar.gen.js +3 -0
- package/dist/i18n/messages/catalogs.gen.d.ts +51 -0
- package/dist/i18n/messages/catalogs.gen.js +51 -0
- package/dist/i18n/messages/cs.gen.js +3 -0
- package/dist/i18n/messages/de.gen.js +3 -0
- package/dist/i18n/messages/en.gen.js +3 -0
- package/dist/i18n/messages/es.gen.js +3 -0
- package/dist/i18n/messages/et.gen.js +3 -0
- package/dist/i18n/messages/fr.gen.js +3 -0
- package/dist/i18n/messages/he.gen.js +3 -0
- package/dist/i18n/messages/hi.gen.js +3 -0
- package/dist/i18n/messages/hu.gen.js +3 -0
- package/dist/i18n/messages/lt.gen.js +3 -0
- package/dist/i18n/messages/lv.gen.js +3 -0
- package/dist/i18n/messages/messages.gen.d.ts +3 -0
- package/dist/i18n/messages/pl.gen.js +3 -0
- package/dist/i18n/messages/pt-BR.gen.js +3 -0
- package/dist/i18n/messages/sk.gen.js +3 -0
- package/dist/i18n/messages/tr.gen.js +3 -0
- package/dist/i18n/messages/zh-CN.gen.js +3 -0
- package/dist/internal/acceptedBlockProjection.js +2 -0
- package/dist/internal/pageBreakRunDescendantIndex.d.ts +7 -2
- package/dist/internal/pageBreakRunDescendantIndex.js +12 -3
- package/dist/internal/pageBreakRunSourceDescendantIndex.d.ts +5 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +5 -0
- package/dist/internal/revisionResolutionInline.js +1 -2
- package/dist/internal/subtreeHolds.d.ts +12 -0
- package/dist/internal/subtreeHolds.js +25 -0
- package/dist/internal/wholeStoryRevisionResolution.js +1 -1
- package/dist/layout-bridge/cellSelectionHighlight.js +3 -3
- package/dist/layout-bridge/convert/flowBlockPostprocessing.js +20 -12
- package/dist/layout-bridge/convert/flowConversionShared.d.ts +15 -1
- package/dist/layout-bridge/convert/flowConversionShared.js +9 -1
- package/dist/layout-bridge/convert/paragraphAttrs.d.ts +15 -4
- package/dist/layout-bridge/convert/paragraphAttrs.js +11 -4
- package/dist/layout-bridge/convert/paragraphBlockCache.d.ts +26 -0
- package/dist/layout-bridge/convert/paragraphBlockCache.js +137 -0
- package/dist/layout-bridge/convert/paragraphConversion.d.ts +12 -2
- package/dist/layout-bridge/convert/paragraphConversion.js +37 -5
- package/dist/layout-bridge/convert/paragraphRuns.d.ts +2 -2
- package/dist/layout-bridge/convert/sectionBoundaries.js +16 -0
- package/dist/layout-bridge/convert/tableConversion.js +19 -8
- package/dist/layout-bridge/convert/toFlowBlocks.js +144 -15
- package/dist/layout-bridge/convert/topLevelConversion.d.ts +74 -0
- package/dist/layout-bridge/convert/topLevelConversion.js +109 -0
- package/dist/layout-bridge/dom/clickToPositionDom.js +41 -40
- package/dist/layout-bridge/dom/findBodyPmSpans.js +4 -3
- package/dist/layout-bridge/dom/findHfPmSpans.js +10 -15
- package/dist/layout-bridge/dom/imeCaretAnchor.d.ts +8 -0
- package/dist/layout-bridge/dom/imeCaretAnchor.js +71 -7
- package/dist/layout-bridge/dom/textStreamDom.js +3 -2
- package/dist/layout-bridge/engine/blockIndex.d.ts +7 -0
- package/dist/layout-bridge/engine/blockIndex.js +12 -0
- package/dist/layout-bridge/engine/hitTest.js +9 -10
- package/dist/layout-bridge/engine/selectionRects.js +6 -6
- package/dist/layout-bridge/headerFooterLayout.js +12 -11
- package/dist/layout-bridge/tableInsertHover.js +2 -1
- package/dist/layout-engine/footnoteContinuation.d.ts +36 -0
- package/dist/layout-engine/footnoteContinuation.js +210 -0
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +7 -2
- package/dist/layout-engine/measure/cache.d.ts +2 -0
- package/dist/layout-engine/measure/cache.js +16 -6
- package/dist/layout-engine/measure/measureParagraph.js +1 -1
- package/dist/layout-engine/measure/paragraphKeyMemo.d.ts +8 -0
- package/dist/layout-engine/measure/paragraphKeyMemo.js +92 -0
- package/dist/layout-engine/tableLayout.js +29 -5
- package/dist/layout-engine/tableRowBreak.d.ts +36 -0
- package/dist/layout-engine/tableRowBreak.js +43 -1
- package/dist/layout-engine/types.d.ts +42 -1
- package/dist/layout-painter/imageLayout.js +2 -1
- package/dist/layout-painter/pageShellStyles.d.ts +10 -0
- package/dist/layout-painter/pageShellStyles.js +32 -0
- package/dist/layout-painter/reconcileRenderedContent.d.ts +19 -0
- package/dist/layout-painter/reconcileRenderedContent.js +117 -0
- package/dist/layout-painter/renderFragment.js +4 -6
- package/dist/layout-painter/renderImage.js +2 -2
- package/dist/layout-painter/renderPage.d.ts +4 -4
- package/dist/layout-painter/renderPage.js +54 -46
- package/dist/layout-painter/renderParagraph.js +3 -3
- package/dist/layout-painter/renderTable.js +16 -16
- package/dist/layout-painter/renderTextBox.js +2 -2
- package/dist/layout-painter/sdtBoundary.js +3 -2
- package/dist/managers/AutoSaveManager.d.ts +5 -1
- package/dist/managers/FindReplaceManager.js +3 -10
- package/dist/markdown/escape.d.ts +20 -1
- package/dist/markdown/escape.js +43 -1
- package/dist/markdown/renderBlock.js +4 -1
- package/dist/markdown/renderParagraph.js +13 -27
- package/dist/markdown/renderTable.js +6 -2
- package/dist/markdown/trailers.js +1 -0
- package/dist/paged-layout/blockGeometry.js +3 -2
- package/dist/paged-layout/editorScrollRoot.d.ts +9 -0
- package/dist/paged-layout/editorScrollRoot.js +10 -1
- package/dist/paged-layout/rangeProjection.js +5 -4
- package/dist/paged-layout/scrollToPmPosition.js +3 -3
- package/dist/paged-layout/selectionViewportRect.d.ts +6 -0
- package/dist/paged-layout/selectionViewportRect.js +8 -2
- package/dist/pdf/images.d.ts +17 -1
- package/dist/pdf/images.js +22 -4
- package/dist/pdf/writePdf.js +4 -2
- package/dist/prosemirror/attrs/index.js +2 -0
- package/dist/prosemirror/canonicalCommands.d.ts +39 -1
- package/dist/prosemirror/canonicalTableCommands.d.ts +28 -0
- package/dist/prosemirror/canonicalTableCommands.js +362 -0
- package/dist/prosemirror/commands/comments.d.ts +30 -2
- package/dist/prosemirror/commands/comments.js +189 -18
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/index.d.ts +1 -1
- package/dist/prosemirror/commentIdAllocator.js +2 -2
- package/dist/prosemirror/commentRangeBoundaryAttrs.d.ts +6 -0
- package/dist/prosemirror/commentRangeBoundaryAttrs.js +9 -3
- package/dist/prosemirror/commentRecords.d.ts +137 -0
- package/dist/prosemirror/commentRecords.js +400 -0
- package/dist/prosemirror/commentReferenceIntegrity.js +3 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +85 -34
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/toProseDoc.d.ts +140 -4
- package/dist/prosemirror/conversion/toProseDoc.js +432 -76
- package/dist/prosemirror/extensions/StarterKit.js +2 -0
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +23 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +61 -32
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +5 -4
- package/dist/prosemirror/extensions/marks/CommentExtension.js +8 -3
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.d.ts +4 -0
- package/dist/prosemirror/extensions/nodes/BlockCommentRangeBoundaryExtension.js +49 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +3 -1
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +12 -3
- package/dist/prosemirror/extensions/nodes/TableExtension.js +32 -31
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +1 -1
- package/dist/prosemirror/index.d.ts +3 -3
- package/dist/prosemirror/listLabels.js +3 -2
- package/dist/prosemirror/listNumbering.d.ts +6 -0
- package/dist/prosemirror/listNumbering.js +12 -9
- package/dist/prosemirror/lockedControls.d.ts +13 -0
- package/dist/prosemirror/lockedControls.js +106 -0
- package/dist/prosemirror/markupViewProjection.js +1 -1
- package/dist/prosemirror/nativeSelection.d.ts +33 -0
- package/dist/prosemirror/nativeSelection.js +74 -0
- package/dist/prosemirror/noteReferenceReview.js +2 -2
- package/dist/prosemirror/numberedRefFields.d.ts +2 -0
- package/dist/prosemirror/numberedRefFields.js +16 -5
- package/dist/prosemirror/paragraphMarkJoin.d.ts +6 -8
- package/dist/prosemirror/paragraphMarkJoin.js +155 -16
- package/dist/prosemirror/plugins/contentControlWidgets.js +2 -2
- package/dist/prosemirror/plugins/documentNumbering.js +37 -15
- package/dist/prosemirror/plugins/suggestionMode.js +33 -10
- package/dist/prosemirror/plugins/templatePreviewValues.js +16 -1
- package/dist/prosemirror/rebaseParagraphRuns.js +1 -1
- package/dist/prosemirror/replacedAnnotations.js +1 -0
- package/dist/prosemirror/runFormattingFromMarks.d.ts +0 -1
- package/dist/prosemirror/runFormattingFromMarks.js +2 -4
- package/dist/prosemirror/runFormattingReconciliation.js +2 -2
- package/dist/prosemirror/runIdentityAcrossRevisions.d.ts +23 -1
- package/dist/prosemirror/runIdentityAcrossRevisions.js +57 -8
- package/dist/prosemirror/runPropertyChangeResolution.js +1 -2
- package/dist/prosemirror/runStyleFormatting.d.ts +14 -4
- package/dist/prosemirror/runStyleFormatting.js +16 -13
- package/dist/prosemirror/schema/marks.d.ts +13 -1
- package/dist/prosemirror/storyListNumbering.js +7 -2
- package/dist/prosemirror/styles/paragraphStyleCascade.js +2 -2
- package/dist/prosemirror/tableResize.d.ts +10 -9
- package/dist/prosemirror/tableResize.js +60 -49
- package/dist/prosemirror/textInput.d.ts +30 -1
- package/dist/prosemirror/textInput.js +144 -17
- package/dist/prosemirror/utils/visualLineNavigation.js +20 -18
- package/dist/prosemirror/validation.d.ts +19 -0
- package/dist/prosemirror/validation.js +79 -5
- package/dist/redline.js +23 -9
- package/dist/render-dom/HeaderFooterSelectionOverlay.js +5 -4
- package/dist/render-dom/RenderedDomContext.js +7 -6
- package/dist/server.d.ts +2 -2
- package/dist/style-sets/extract.js +2 -2
- package/dist/types/canonicalCapabilities.d.ts +38 -16
- package/dist/types/canonicalCapabilities.js +21 -18
- package/dist/utils/cssString.d.ts +7 -0
- package/dist/utils/cssString.js +9 -0
- package/dist/utils/findMatchView.js +4 -3
- package/dist/utils/fontResolver.js +4 -1
- package/dist/utils/formatToStyle.d.ts +1 -1
- package/dist/utils/mergeDocumentContent.js +2 -2
- package/dist/utils/paintedPositions.d.ts +60 -0
- package/dist/utils/paintedPositions.js +101 -0
- package/dist/utils/replaceText.d.ts +11 -0
- package/dist/utils/replaceText.js +39 -7
- package/dist/version-comparison.d.ts +9 -1
- package/dist/version-comparison.js +11 -5
- package/package.json +2 -3
package/dist/ai-edits/apply.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NumberingIdsInUse } from "../docx/numberingIds.js";
|
|
2
2
|
import { FolioTableTemplates } from "./table-template.js";
|
|
3
|
-
import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot } from "./types.js";
|
|
3
|
+
import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot, FolioAIResolvedEditOperation } from "./types.js";
|
|
4
4
|
import { WordDiffGranularity } from "./word-diff.js";
|
|
5
5
|
import { Node } from "prosemirror-model";
|
|
6
6
|
import { EditorState, Transaction } from "prosemirror-state";
|
|
@@ -124,6 +124,14 @@ export type FolioAIEditApplyOutcome = FolioAIEditApplyResult & {
|
|
|
124
124
|
*/
|
|
125
125
|
nextRevisionId: number;
|
|
126
126
|
};
|
|
127
|
+
/**
|
|
128
|
+
* Operation types applied in `"suggested"` mode. Every produced revision — an
|
|
129
|
+
* inline mark, a whole-node `_suggestedInsert` marker, or a suggested
|
|
130
|
+
* `trIns`/`trDel`/`cellMarker` — is stripped from serialized DOCX until
|
|
131
|
+
* accepted. Cell merge/split (not row/column ops) and comment ops stay
|
|
132
|
+
* `unsupportedMode`.
|
|
133
|
+
*/
|
|
134
|
+
export declare const SUGGESTED_SUPPORTED_OPERATION_TYPES: ReadonlySet<FolioAIResolvedEditOperation["type"]>;
|
|
127
135
|
export declare const applyFolioAIEditOperations: (options: ApplyFolioAIEditOperationsOptions) => FolioAIEditApplyOutcome;
|
|
128
136
|
/** {@link applyFolioAIEditOperations} for a caller holding every story. Internal. */
|
|
129
137
|
export declare const applyFolioAIEditOperationsInPackage: (options: ApplyFolioAIEditOperationsInPackageOptions) => FolioAIEditApplyOutcome;
|
package/dist/ai-edits/apply.js
CHANGED
|
@@ -16,6 +16,7 @@ import { markStructuralChange } from "../prosemirror/extensions/features/Paragra
|
|
|
16
16
|
import "../prosemirror/extensions/nodes/TextBoxAnchorExtension.js";
|
|
17
17
|
import { blockBoundariesOf, carriesCommentAnchor, inlineBoundariesOf, isBlockBoundaryNode, removeResolvedSubtree } from "../prosemirror/keptRangeBoundaries.js";
|
|
18
18
|
import { CLEARED_LIST_RENDERING_ATTRS } from "../prosemirror/listMarker.js";
|
|
19
|
+
import { lockedControlSpans } from "../prosemirror/lockedControls.js";
|
|
19
20
|
import { effectiveParagraphNumbering, paragraphNumberingAttr, paragraphNumberingSourcesFromBoundary, readParagraphNumberingAttr, removedNumberingAttr } from "../prosemirror/numberingAttr.js";
|
|
20
21
|
import { directParagraphAlignment } from "../prosemirror/paragraphAlignment.js";
|
|
21
22
|
import { styleResolvedParagraphFormatting } from "../prosemirror/paragraphFormattingProvenance.js";
|
|
@@ -46,11 +47,11 @@ import { buildCleanBlockText, resolveCleanTextRange } from "./clean-text.js";
|
|
|
46
47
|
import { hasInlineEmphasis, parseInlineEmphasisRuns, stripInlineEmphasisMarkers } from "./inline-emphasis.js";
|
|
47
48
|
import { applyTextChanges, changesFromSegments, keepAtomicSpans, planTextChanges, widenChangesToAtomicSpans } from "./minimal-replacement.js";
|
|
48
49
|
import { assertNewListsAllocated, resolveNewListOperations, stageNewListOperations } from "./newListNumbering.js";
|
|
49
|
-
import { cutsIntoNoteReference, noteReferenceEditsAllowed, noteReferenceOf, noteReferenceSpansWithin, planChangesAroundNoteReferences, segmentsAroundNoteReferences } from "./note-references.js";
|
|
50
|
+
import { comparisonApplying, cutsIntoNoteReference, noteReferenceEditsAllowed, noteReferenceOf, noteReferenceSpansWithin, planChangesAroundNoteReferences, segmentsAroundNoteReferences } from "./note-references.js";
|
|
50
51
|
import { classifyResourceReference } from "./referenceClassification.js";
|
|
51
52
|
import { getFolioDocumentOperationRemovedBlockIds, getTrackedFolioDocumentOperationCarrierBlockId, getTrackedFolioDocumentOperationRemovedBlockIds } from "./removed-blocks.js";
|
|
52
53
|
import { separateRevisionStretches } from "./revisionStretches.js";
|
|
53
|
-
import { collectNoteReferenceLabels, hashFolioAIBlockStructuralBoundaries, hashFolioAIBlockText, isHiddenTableRow
|
|
54
|
+
import { collectNoteReferenceLabels, hashFolioAIBlockContent, hashFolioAIBlockStructuralBoundaries, hashFolioAIBlockText, isHiddenTableRow } from "./snapshot.js";
|
|
54
55
|
import { isEmptyTableCell, mergeTableRectangle, mergeTrackedVerticalTableCells, splitTableRectangle, splitTrackedVerticalTableCell } from "./table-cell-mutations.js";
|
|
55
56
|
import { planTableMutations } from "./table-mutation-plan.js";
|
|
56
57
|
import { applyTableColumnDeletion, applyTableColumnInsertion, applyTableRowDeletion, applyTableRowInsertion, describeUnplacedCellTexts, findTableColumnInsertion, findTableRowInsertion, getTableColumnCoordinateKey, markTableRowContent, splitCellParagraphTexts } from "./table-row-column-mutations.js";
|
|
@@ -58,7 +59,7 @@ import { findEnclosingTableCell, findEnclosingTableRow, findOutermostTableBounda
|
|
|
58
59
|
import { tableFromTemplate } from "./table-template.js";
|
|
59
60
|
import { wordDiffSessionFromOptions } from "./word-diff.js";
|
|
60
61
|
import { panic } from "better-result";
|
|
61
|
-
import { REVIEW_CARRIERS } from "@stll/docx-core/model";
|
|
62
|
+
import { CONTENT_CONTROL_LOCK, REVIEW_CARRIERS, firstLockedControlViolation, lockedControlMessage } from "@stll/docx-core/model";
|
|
62
63
|
import { Fragment, Mark } from "prosemirror-model";
|
|
63
64
|
import { TableMap } from "prosemirror-tables";
|
|
64
65
|
import { canSplit } from "prosemirror-transform";
|
|
@@ -561,8 +562,7 @@ const applyBlockParagraphProperties = ({ tr, position, node, properties, styleRe
|
|
|
561
562
|
const OPERATION_TEXT_CONTEXT = {
|
|
562
563
|
baseParagraphFormatting: void 0,
|
|
563
564
|
paragraphFormatting: void 0,
|
|
564
|
-
paragraphMarkFormatting: void 0
|
|
565
|
-
paragraphMarkPrecedesStyle: false
|
|
565
|
+
paragraphMarkFormatting: void 0
|
|
566
566
|
};
|
|
567
567
|
const applyReplaceBlockStyleId = ({ item, tr, styleResolver, revisionInfo }) => {
|
|
568
568
|
if (item.operation.type !== "replaceBlock" || item.operation.styleId === void 0) return {
|
|
@@ -912,7 +912,7 @@ const collectLiveBlocksByHash = (doc) => {
|
|
|
912
912
|
fieldResults: "text",
|
|
913
913
|
noteReferences
|
|
914
914
|
}).text;
|
|
915
|
-
const hash =
|
|
915
|
+
const hash = hashFolioAIBlockContent(cleanText);
|
|
916
916
|
const bucket = byHash.get(hash) ?? [];
|
|
917
917
|
bucket.push({
|
|
918
918
|
from: pos,
|
|
@@ -1195,6 +1195,75 @@ const batchClaimOf = ({ item, doc, producesTrackedChanges }) => {
|
|
|
1195
1195
|
}
|
|
1196
1196
|
};
|
|
1197
1197
|
/**
|
|
1198
|
+
* The stretches an operation changes, for the content-control lock rule
|
|
1199
|
+
* (`lockedControlViolation`), read off the claim the batch already makes for
|
|
1200
|
+
* it. A comment changes nothing a lock guards, so it touches nothing.
|
|
1201
|
+
*/
|
|
1202
|
+
const lockTouchesOf = (item, claim) => {
|
|
1203
|
+
switch (claim.type) {
|
|
1204
|
+
case "text":
|
|
1205
|
+
case "split": return [{
|
|
1206
|
+
from: claim.from,
|
|
1207
|
+
to: claim.to,
|
|
1208
|
+
effect: "edit"
|
|
1209
|
+
}];
|
|
1210
|
+
case "annotation": return item.operation.type === "formatRange" ? [{
|
|
1211
|
+
from: claim.from,
|
|
1212
|
+
to: claim.to,
|
|
1213
|
+
effect: "edit"
|
|
1214
|
+
}] : [];
|
|
1215
|
+
case "rewriteBlock": {
|
|
1216
|
+
const content = {
|
|
1217
|
+
from: claim.block + 1,
|
|
1218
|
+
to: item.blockTo - 1
|
|
1219
|
+
};
|
|
1220
|
+
return [{
|
|
1221
|
+
...content,
|
|
1222
|
+
effect: "remove"
|
|
1223
|
+
}, {
|
|
1224
|
+
...content,
|
|
1225
|
+
effect: "edit"
|
|
1226
|
+
}];
|
|
1227
|
+
}
|
|
1228
|
+
case "paragraphProperties": return [{
|
|
1229
|
+
from: claim.block,
|
|
1230
|
+
to: claim.block,
|
|
1231
|
+
effect: "edit"
|
|
1232
|
+
}];
|
|
1233
|
+
case "deleteBlock": return [{
|
|
1234
|
+
from: claim.block,
|
|
1235
|
+
to: claim.end,
|
|
1236
|
+
effect: "remove"
|
|
1237
|
+
}];
|
|
1238
|
+
case "merge": return [{
|
|
1239
|
+
from: claim.next - 1,
|
|
1240
|
+
to: claim.next + 1,
|
|
1241
|
+
effect: "remove"
|
|
1242
|
+
}];
|
|
1243
|
+
case "insertion": return [{
|
|
1244
|
+
from: claim.at,
|
|
1245
|
+
to: claim.at,
|
|
1246
|
+
effect: "edit"
|
|
1247
|
+
}];
|
|
1248
|
+
case "tableRemoval": return claim.ranges.map(({ from, to }) => ({
|
|
1249
|
+
from,
|
|
1250
|
+
to,
|
|
1251
|
+
effect: "remove"
|
|
1252
|
+
}));
|
|
1253
|
+
case "tableStructure": return [{
|
|
1254
|
+
from: claim.table,
|
|
1255
|
+
to: claim.table,
|
|
1256
|
+
effect: "edit"
|
|
1257
|
+
}, ...claim.folded.map(({ from, to }) => ({
|
|
1258
|
+
from,
|
|
1259
|
+
to,
|
|
1260
|
+
effect: "remove"
|
|
1261
|
+
}))];
|
|
1262
|
+
case "unclaimed": return [];
|
|
1263
|
+
default: return panic("Unhandled batch claim", { claim });
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
/**
|
|
1198
1267
|
* The snapshot recorded an `hashOccurrenceCount` per anchor but
|
|
1199
1268
|
* not which ordinal within that bucket the block was — recompute
|
|
1200
1269
|
* on demand from the snapshot's anchor map. Stable iteration
|
|
@@ -2814,6 +2883,7 @@ const applyFolioAIEditOperationsInternal = ({ view, snapshot, operations: reques
|
|
|
2814
2883
|
const claimedTableRows = /* @__PURE__ */ new Set();
|
|
2815
2884
|
const claimedTableColumns = /* @__PURE__ */ new Set();
|
|
2816
2885
|
const batchClaims = new BatchClaims();
|
|
2886
|
+
const lockedControls = () => lockedControlSpans(view.state.doc);
|
|
2817
2887
|
const removedBlocksBy = /* @__PURE__ */ new Map();
|
|
2818
2888
|
const diffText = wordDiffMode === "coarse" ? coarseWordDiff : wordDiffSessionFromOptions(wordDiff).diff;
|
|
2819
2889
|
const producesTrackedChanges = mode !== "direct";
|
|
@@ -2941,6 +3011,15 @@ const applyFolioAIEditOperationsInternal = ({ view, snapshot, operations: reques
|
|
|
2941
3011
|
doc: view.state.doc,
|
|
2942
3012
|
producesTrackedChanges
|
|
2943
3013
|
});
|
|
3014
|
+
const lockViolation = comparisonApplying() ? null : firstLockedControlViolation(lockedControls(), lockTouchesOf(resolution.operation, claim));
|
|
3015
|
+
if (lockViolation !== null) {
|
|
3016
|
+
skipped.push({
|
|
3017
|
+
id: operation.id,
|
|
3018
|
+
reason: CONTENT_CONTROL_LOCK,
|
|
3019
|
+
message: lockedControlMessage(lockViolation)
|
|
3020
|
+
});
|
|
3021
|
+
continue;
|
|
3022
|
+
}
|
|
2944
3023
|
const claimedBy = batchClaims.conflictOf(claim);
|
|
2945
3024
|
if (claimedBy !== null) {
|
|
2946
3025
|
skipped.push({
|
|
@@ -4276,6 +4355,13 @@ const applyFolioAIEditOperationsInternal = ({ view, snapshot, operations: reques
|
|
|
4276
4355
|
});
|
|
4277
4356
|
continue;
|
|
4278
4357
|
}
|
|
4358
|
+
if (tr.doc.resolve(item.from).parent !== tr.doc.nodeAt(item.blockFrom)) {
|
|
4359
|
+
skipped.push({
|
|
4360
|
+
id: item.operation.id,
|
|
4361
|
+
reason: "unsupportedBlock"
|
|
4362
|
+
});
|
|
4363
|
+
continue;
|
|
4364
|
+
}
|
|
4279
4365
|
allocateNewLists({
|
|
4280
4366
|
status: "willApply",
|
|
4281
4367
|
items: [item]
|
|
@@ -5561,7 +5647,7 @@ const resolveStableBlock = ({ snapshot, blockId, liveBlocks, liveBlocksByParaId,
|
|
|
5561
5647
|
noteReferences
|
|
5562
5648
|
});
|
|
5563
5649
|
const currentText = cleanBlock.text;
|
|
5564
|
-
const currentTextHash =
|
|
5650
|
+
const currentTextHash = hashFolioAIBlockContent(currentText);
|
|
5565
5651
|
const structuralBoundaryHash = hashFolioAIBlockStructuralBoundaries(cleanBlock);
|
|
5566
5652
|
if (currentTextHash !== anchor.textHash || structuralBoundaryHash !== anchor.structuralBoundaryHash) return {
|
|
5567
5653
|
type: "skip",
|
|
@@ -6379,4 +6465,4 @@ const getOperationQuote = (operation) => {
|
|
|
6379
6465
|
if (operation.type === "replaceInBlock") return operation.find;
|
|
6380
6466
|
if (operation.type === "commentOnBlock") return operation.quote;
|
|
6381
6467
|
};
|
|
6382
|
-
export { applyFolioAIEditOperations, applyFolioAIEditOperationsInPackage, insertCleanText, previewFolioAIEditOperations, previewFolioAIEditOperationsWithResult };
|
|
6468
|
+
export { SUGGESTED_SUPPORTED_OPERATION_TYPES, applyFolioAIEditOperations, applyFolioAIEditOperationsInPackage, insertCleanText, previewFolioAIEditOperations, previewFolioAIEditOperationsWithResult };
|
|
@@ -7,11 +7,17 @@ import { InlineProvenanceTargetOptions } from "../compare/inline-provenance.js";
|
|
|
7
7
|
import { ImportReferencedStyleDefinitionsResult } from "../compare/style-resources.js";
|
|
8
8
|
import { FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult } from "../document-operations.js";
|
|
9
9
|
import { FolioPendingSuggestionLoadResult, FolioPendingSuggestionRecord } from "./pending-suggestions.js";
|
|
10
|
-
import { FolioReviewChange, FolioReviewChangeKind } from "./read.js";
|
|
10
|
+
import { FolioReviewChange, FolioReviewChangeKind, FolioReviewResolution, FolioReviewResolutionSkip } from "./read.js";
|
|
11
11
|
import { FolioStoryTable } from "./snapshot.js";
|
|
12
12
|
import { TableGeometryPairing } from "./table-geometry.js";
|
|
13
13
|
import { Node } from "prosemirror-model";
|
|
14
14
|
import { TaggedErrorClass } from "better-result";
|
|
15
|
+
/**
|
|
16
|
+
* How many document-operation batches a reviewer can step back through.
|
|
17
|
+
* Each entry holds the story's state before and after its batch; older
|
|
18
|
+
* entries are dropped, as an editor's undo history drops its oldest steps.
|
|
19
|
+
*/
|
|
20
|
+
export declare const FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT = 100;
|
|
15
21
|
/** Options for {@link FolioDocxReviewer.fromBuffer}. */
|
|
16
22
|
export type FolioDocxReviewerOptions = {
|
|
17
23
|
/** Default author for tracked changes and comments. (default: `"AI"`) */
|
|
@@ -319,21 +325,6 @@ export type FolioReviewCommentFilter = {
|
|
|
319
325
|
author?: string;
|
|
320
326
|
done?: boolean;
|
|
321
327
|
};
|
|
322
|
-
/**
|
|
323
|
-
* Headless `.docx` reviewer. Parse a buffer, read blocks, apply
|
|
324
|
-
* `FolioAIEditOperation`s against the document model, and write the reviewed
|
|
325
|
-
* `.docx` back out — no editor instance, no DOM.
|
|
326
|
-
*
|
|
327
|
-
* @example
|
|
328
|
-
* ```ts
|
|
329
|
-
* const reviewer = await FolioDocxReviewer.fromBuffer(buffer, { author: "AI" });
|
|
330
|
-
* const { blocks } = reviewer.snapshot();
|
|
331
|
-
* reviewer.applyOperations([
|
|
332
|
-
* { id: "1", type: "replaceInBlock", blockId: blocks[0].id, find: "$50k", replace: "$500k" },
|
|
333
|
-
* ], { undefinedReferences: "refuse" });
|
|
334
|
-
* const reviewed = await reviewer.toBuffer();
|
|
335
|
-
* ```
|
|
336
|
-
*/
|
|
337
328
|
export declare class FolioDocxReviewer {
|
|
338
329
|
/** Default author for tracked changes and comments. */
|
|
339
330
|
readonly author: string;
|
|
@@ -405,8 +396,14 @@ export declare class FolioDocxReviewer {
|
|
|
405
396
|
* renumbered — which is right for an insertion that renumbers the items
|
|
406
397
|
* below it, and wrong for a list whose FORMAT changed. Sorted so two
|
|
407
398
|
* packages can be compared entry by entry.
|
|
399
|
+
*
|
|
400
|
+
* Read for one story (the main one by default): a header, footer or note
|
|
401
|
+
* starts its lists against the package alone, so the lists it started are
|
|
402
|
+
* defined in its own reading, as its labels are, and in no other story's.
|
|
408
403
|
*/
|
|
409
404
|
readNumberingDefinitions(): FolioNumberingLevel[];
|
|
405
|
+
/** `null` when the document has no such story. */
|
|
406
|
+
readNumberingDefinitions(story: FolioEditableDocumentStoryHandle): FolioNumberingLevel[] | null;
|
|
410
407
|
/** Return parsed package metadata without exposing the mutable document model. */
|
|
411
408
|
getDocumentProperties(): Readonly<NonNullable<document_d_exports.Document["package"]["properties"]>> | null;
|
|
412
409
|
/** Snapshot one editable story into stable, operation-ready blocks. */
|
|
@@ -459,7 +456,11 @@ export declare class FolioDocxReviewer {
|
|
|
459
456
|
/** Apply a batch; the notes whose references it deletes or removes follow them. */
|
|
460
457
|
private applyDocumentOperationsInternal;
|
|
461
458
|
private applyDocumentOperationsToStoryState;
|
|
462
|
-
/**
|
|
459
|
+
/**
|
|
460
|
+
* Undo the latest unchanged document-operation batch and its created
|
|
461
|
+
* comments. Only the last {@link FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT}
|
|
462
|
+
* batches are kept; an older handle is `unknownHandle`.
|
|
463
|
+
*/
|
|
463
464
|
undoDocumentOperations(undoHandle: FolioDocumentOperationUndoHandle): FolioDocumentOperationUndoResult;
|
|
464
465
|
/**
|
|
465
466
|
* The body blocks with their stable ids, in document order — the same
|
|
@@ -551,7 +552,10 @@ export declare class FolioDocxReviewer {
|
|
|
551
552
|
* redline. Pass a {@link FolioReviewChange} from {@link getChanges} or its
|
|
552
553
|
* revision id. Reuses the editor's own accept command headlessly, so the
|
|
553
554
|
* resolved state persists on {@link toBuffer}. Returns `false` when the
|
|
554
|
-
* revision is no longer present (already resolved, or never existed)
|
|
555
|
+
* revision is no longer present (already resolved, or never existed), or
|
|
556
|
+
* when a content control's lock holds it: accepting would change a
|
|
557
|
+
* content-locked control's content or remove a control locked against
|
|
558
|
+
* removal. A held change stays pending as it is.
|
|
555
559
|
*/
|
|
556
560
|
acceptChange(target: FolioReviewChange | number): boolean;
|
|
557
561
|
private acceptChangeInternal;
|
|
@@ -575,10 +579,15 @@ export declare class FolioDocxReviewer {
|
|
|
575
579
|
* Every story, not just the body: a revision in a header or a footnote is
|
|
576
580
|
* one a reviewer meant to resolve, and leaving it behind means an accepted
|
|
577
581
|
* document still carries a redline nobody can see from the body.
|
|
582
|
+
*
|
|
583
|
+
* A change a content control's lock holds (see {@link acceptChange}) stays
|
|
584
|
+
* pending as it is and is listed in `skipped`; `resolved` counts the
|
|
585
|
+
* ordinary changes resolved.
|
|
578
586
|
*/
|
|
579
|
-
acceptAll():
|
|
587
|
+
acceptAll(): FolioReviewResolution;
|
|
580
588
|
/** Reject every tracked change in the package. See {@link acceptAll}. */
|
|
581
|
-
rejectAll():
|
|
589
|
+
rejectAll(): FolioReviewResolution;
|
|
590
|
+
private resolveAll;
|
|
582
591
|
private resolveWithSectionReferenceHistory;
|
|
583
592
|
private resolveEveryFinalSectionChange;
|
|
584
593
|
private resolveEveryStory;
|
|
@@ -598,6 +607,12 @@ export declare class FolioDocxReviewer {
|
|
|
598
607
|
*/
|
|
599
608
|
private noteKeysReferencedOutsideBody;
|
|
600
609
|
private resolveEveryStoryOnce;
|
|
610
|
+
/**
|
|
611
|
+
* Resolve each change of a story a content control's lock does not hold, on
|
|
612
|
+
* its own: the one-pass resolver takes the whole story or nothing. The held
|
|
613
|
+
* changes stay pending as they are and are reported in `skipped`.
|
|
614
|
+
*/
|
|
615
|
+
private resolveStoryAroundHeldChanges;
|
|
601
616
|
private acceptOrdinaryChangesWithSuggestions;
|
|
602
617
|
/** Resolve ordinary revisions on a detached in-memory document. */
|
|
603
618
|
toResolvedDocument(decision: "accept" | "reject"): document_d_exports.Document;
|
|
@@ -711,4 +726,4 @@ export type ApplyFolioAIEditsToBufferResult = FolioAIEditApplyResult & {
|
|
|
711
726
|
* operations to run.
|
|
712
727
|
*/
|
|
713
728
|
export declare const applyFolioAIEditsToBuffer: (buffer: ArrayBuffer, operations: FolioAIEditOperation[], options?: ApplyFolioAIEditsToBufferOptions) => Promise<ApplyFolioAIEditsToBufferResult>;
|
|
714
|
-
export type { FolioReviewChange, FolioReviewChangeKind, FolioRevisionStamp };
|
|
729
|
+
export type { FolioReviewChange, FolioReviewChangeKind, FolioReviewResolution, FolioReviewResolutionSkip, FolioRevisionStamp };
|
|
@@ -10,7 +10,7 @@ import { buildSections } from "../docx/documentParser.js";
|
|
|
10
10
|
import { rebindDrawingImageRelationship } from "../docx/drawingRelationships.js";
|
|
11
11
|
import { isSeparatorEndnote, isSeparatorFootnote } from "../docx/footnoteParser.js";
|
|
12
12
|
import { normalizeListModelRendering } from "../docx/listModelNormalization.js";
|
|
13
|
-
import { createNumberingIdAllocator } from "../docx/numberingIds.js";
|
|
13
|
+
import { createNumberingIdAllocator, numberingNumIdsTaken } from "../docx/numberingIds.js";
|
|
14
14
|
import { getCachedNumberingMap } from "../docx/numberingParser.js";
|
|
15
15
|
import { visitDocxParagraphs } from "../docx/paragraphTraversal.js";
|
|
16
16
|
import { parseDocx } from "../docx/parser.js";
|
|
@@ -23,7 +23,7 @@ import { pluginsForHeadlessRevisionResolution } from "../internal/headlessRevisi
|
|
|
23
23
|
import { withTrackedSectionEndpointRemoval } from "../internal/sectionEndpointResolution.js";
|
|
24
24
|
import { captureSectionReferenceInventory, resolvedSectionReferenceLosses, withSectionReferenceResolution } from "../internal/sectionReferenceResolution.js";
|
|
25
25
|
import { expectCharacterStyleMarkAttrs, expectFootnoteRefMarkAttrs } from "../prosemirror/attrs/index.js";
|
|
26
|
-
import { acceptAIEditRevision, acceptSuggestion, getSuggestions, rejectAIEditRevision, rejectAllSuggestions, rejectSuggestion, resolveAllChangesInHeadlessState, suggestionIdOfRevision } from "../prosemirror/commands/comments.js";
|
|
26
|
+
import { acceptAIEditRevision, acceptSuggestion, getSuggestions, rejectAIEditRevision, rejectAllSuggestions, rejectSuggestion, resolveAllChangesInHeadlessState, revisionResolutionLockViolation, suggestionIdOfRevision } from "../prosemirror/commands/comments.js";
|
|
27
27
|
import { sectionRejectProperties } from "../prosemirror/commands/propertyChangeScope.js";
|
|
28
28
|
import { allocateCommentId, createCommentIdAllocator, seedCommentAllocator } from "../prosemirror/commentIdAllocator.js";
|
|
29
29
|
import { fromProseDoc, proseDocToBlocks } from "../prosemirror/conversion/fromProseDoc.js";
|
|
@@ -33,6 +33,7 @@ import { ensureParaIdsInDoc } from "../prosemirror/extensions/features/ParaIdAll
|
|
|
33
33
|
import { getChangedParagraphIds, getTrackedSectionEndpointRemoval, hasStructuralChanges, hasUntrackedChanges } from "../prosemirror/extensions/features/ParagraphChangeTrackerExtension.js";
|
|
34
34
|
import { completeNumberingForDoc } from "../prosemirror/listInstanceReferences.js";
|
|
35
35
|
import "../prosemirror/listMarker.js";
|
|
36
|
+
import { lockedControlSpans } from "../prosemirror/lockedControls.js";
|
|
36
37
|
import { deleteNoteWithReference, noteDeletionRevisions, noteKeysReferencedIn, noteReferenceStates, noteReferencesRestored, referenceDeletions, referencedNotes } from "../prosemirror/noteReferenceReview.js";
|
|
37
38
|
import { createDocumentNumberingPlugin, getDocumentNumbering, withDocumentNumbering } from "../prosemirror/plugins/documentNumbering.js";
|
|
38
39
|
import { getDocumentStyleResolver } from "../prosemirror/plugins/documentStyleState.js";
|
|
@@ -53,7 +54,7 @@ import { collectNoteReferenceLabels, createFolioAIEditSnapshotWithStyleResolver,
|
|
|
53
54
|
import { matchTableGeometry } from "./table-geometry.js";
|
|
54
55
|
import { tableTemplateCanCrossPackageLosslessly } from "./table-template.js";
|
|
55
56
|
import { TaggedError, panic } from "better-result";
|
|
56
|
-
import { REVIEW_CARRIERS, finalizeParagraphFormatting, numberingLevelEntries, setDocumentBodyComments } from "@stll/docx-core/model";
|
|
57
|
+
import { CONTENT_CONTROL_LOCK, REVIEW_CARRIERS, finalizeParagraphFormatting, lockedControlMessage, numberingLevelEntries, setDocumentBodyComments } from "@stll/docx-core/model";
|
|
57
58
|
import { reconcileDocumentPartRelationships } from "@stll/docx-core/ops";
|
|
58
59
|
import { EditorState } from "prosemirror-state";
|
|
59
60
|
import { ZipArchive } from "@stll/docx-core/zip";
|
|
@@ -85,6 +86,12 @@ const createReviewerComment = ({ id, text, author, date }) => ({
|
|
|
85
86
|
date: date ?? (/* @__PURE__ */ new Date()).toISOString(),
|
|
86
87
|
content: [commentTextParagraph(text)]
|
|
87
88
|
});
|
|
89
|
+
/**
|
|
90
|
+
* How many document-operation batches a reviewer can step back through.
|
|
91
|
+
* Each entry holds the story's state before and after its batch; older
|
|
92
|
+
* entries are dropped, as an editor's undo history drops its oldest steps.
|
|
93
|
+
*/
|
|
94
|
+
const FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT = 100;
|
|
88
95
|
const FOLIO_REVIEWED_VIEWS = Object.freeze([
|
|
89
96
|
"original",
|
|
90
97
|
"current-markup",
|
|
@@ -238,9 +245,9 @@ const rejectSuggestions = (state) => {
|
|
|
238
245
|
return settled;
|
|
239
246
|
};
|
|
240
247
|
const createHeadlessPlugins = (styles, numbering) => [
|
|
248
|
+
createDocumentNumberingPlugin(numbering),
|
|
241
249
|
...pluginsForHeadlessRevisionResolution(singletonManager.getPlugins()),
|
|
242
|
-
createDocumentStylesPlugin(styles)
|
|
243
|
-
createDocumentNumberingPlugin(numbering)
|
|
250
|
+
createDocumentStylesPlugin(styles)
|
|
244
251
|
];
|
|
245
252
|
const createStateSnapshot = (state) => createFolioAIEditSnapshotWithStyleResolver(state.doc, getDocumentStyleResolver(state), getDocumentNumbering(state));
|
|
246
253
|
const formatStorySnapshotForLLM = (snapshot, annotated) => {
|
|
@@ -310,6 +317,22 @@ const paragraphPlainText = (paragraph) => {
|
|
|
310
317
|
* const reviewed = await reviewer.toBuffer();
|
|
311
318
|
* ```
|
|
312
319
|
*/
|
|
320
|
+
/**
|
|
321
|
+
* The changes of a story, by revision id, that a content control's lock keeps
|
|
322
|
+
* from being resolved in `mode`: every physical revision of one change is
|
|
323
|
+
* resolved together, so the change is held when resolving them would break a
|
|
324
|
+
* lock. Empty without a locked control.
|
|
325
|
+
*/
|
|
326
|
+
const lockHeldChanges = (state, mode) => {
|
|
327
|
+
const held = /* @__PURE__ */ new Map();
|
|
328
|
+
if (lockedControlSpans(state.doc).length === 0) return held;
|
|
329
|
+
for (const { id } of getTrackedChangesFromDoc(state.doc)) {
|
|
330
|
+
const ids = getTrackedChangeGroupIdsFromDoc(state.doc, id);
|
|
331
|
+
const violation = revisionResolutionLockViolation(state, ids, mode);
|
|
332
|
+
if (violation !== null) held.set(id, violation);
|
|
333
|
+
}
|
|
334
|
+
return held;
|
|
335
|
+
};
|
|
313
336
|
var FolioDocxReviewer = class FolioDocxReviewer {
|
|
314
337
|
/** Default author for tracked changes and comments. */
|
|
315
338
|
author;
|
|
@@ -576,7 +599,7 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
576
599
|
const targetNums = new Map(target.nums.map((entry) => [entry.numId, entry]));
|
|
577
600
|
const targetAbstracts = new Map(target.abstractNums.map((entry) => [entry.abstractNumId, entry]));
|
|
578
601
|
const levelsByNumId = referencedNumberingLevelsByNumId({ references });
|
|
579
|
-
const existingNumIds = [...
|
|
602
|
+
const existingNumIds = [...numberingNumIdsTaken(current), ...numberingNumIdsTaken(target)];
|
|
580
603
|
const numberingIds = createNumberingIdAllocator("num", existingNumIds);
|
|
581
604
|
const remapped = /* @__PURE__ */ new Map();
|
|
582
605
|
for (const numId of levelsByNumId.keys()) {
|
|
@@ -692,19 +715,10 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
692
715
|
}
|
|
693
716
|
});
|
|
694
717
|
}
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
*
|
|
700
|
-
* Labels are rendered from these definitions rather than stored on the
|
|
701
|
-
* paragraphs, so nothing in a block projection changes when a list is
|
|
702
|
-
* renumbered — which is right for an insertion that renumbers the items
|
|
703
|
-
* below it, and wrong for a list whose FORMAT changed. Sorted so two
|
|
704
|
-
* packages can be compared entry by entry.
|
|
705
|
-
*/
|
|
706
|
-
readNumberingDefinitions() {
|
|
707
|
-
return numberingLevelsOf(completeNumberingForDoc(this.baseDocument.package.numbering, this.state.doc)).toSorted((left, right) => left.numId - right.numId || left.level - right.level);
|
|
718
|
+
readNumberingDefinitions(story = MAIN_STORY) {
|
|
719
|
+
const doc = story.type === "main" ? this.state.doc : this.readSecondaryStoryDoc(story);
|
|
720
|
+
if (!doc) return null;
|
|
721
|
+
return numberingLevelsOf(completeNumberingForDoc(this.baseDocument.package.numbering, doc)).toSorted((left, right) => left.numId - right.numId || left.level - right.level);
|
|
708
722
|
}
|
|
709
723
|
/** Return parsed package metadata without exposing the mutable document model. */
|
|
710
724
|
getDocumentProperties() {
|
|
@@ -969,17 +983,25 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
969
983
|
activeSuggestionIds
|
|
970
984
|
});
|
|
971
985
|
}
|
|
972
|
-
if (result.undoHandle !== null)
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
986
|
+
if (result.undoHandle !== null) {
|
|
987
|
+
this.documentOperationUndoEntries.push({
|
|
988
|
+
undoHandle: result.undoHandle,
|
|
989
|
+
story,
|
|
990
|
+
beforeState,
|
|
991
|
+
afterState: view.state,
|
|
992
|
+
createdCommentsLengthBefore,
|
|
993
|
+
createdCommentsLengthAfter: this.createdComments.length
|
|
994
|
+
});
|
|
995
|
+
const excess = this.documentOperationUndoEntries.length - 100;
|
|
996
|
+
if (excess > 0) this.documentOperationUndoEntries.splice(0, excess);
|
|
997
|
+
}
|
|
980
998
|
return result;
|
|
981
999
|
}
|
|
982
|
-
/**
|
|
1000
|
+
/**
|
|
1001
|
+
* Undo the latest unchanged document-operation batch and its created
|
|
1002
|
+
* comments. Only the last {@link FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT}
|
|
1003
|
+
* batches are kept; an older handle is `unknownHandle`.
|
|
1004
|
+
*/
|
|
983
1005
|
undoDocumentOperations(undoHandle) {
|
|
984
1006
|
const entryIndex = this.documentOperationUndoEntries.findIndex((entry) => entry.undoHandle.type === undoHandle.type && entry.undoHandle.id === undoHandle.id);
|
|
985
1007
|
if (entryIndex === -1) return {
|
|
@@ -1376,7 +1398,10 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1376
1398
|
* redline. Pass a {@link FolioReviewChange} from {@link getChanges} or its
|
|
1377
1399
|
* revision id. Reuses the editor's own accept command headlessly, so the
|
|
1378
1400
|
* resolved state persists on {@link toBuffer}. Returns `false` when the
|
|
1379
|
-
* revision is no longer present (already resolved, or never existed)
|
|
1401
|
+
* revision is no longer present (already resolved, or never existed), or
|
|
1402
|
+
* when a content control's lock holds it: accepting would change a
|
|
1403
|
+
* content-locked control's content or remove a control locked against
|
|
1404
|
+
* removal. A held change stays pending as it is.
|
|
1380
1405
|
*/
|
|
1381
1406
|
acceptChange(target) {
|
|
1382
1407
|
return this.resolveWithSectionReferenceHistory(() => this.withNotesFollowingReferences(() => this.acceptChangeInternal(target)));
|
|
@@ -1384,6 +1409,7 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1384
1409
|
acceptChangeInternal(target) {
|
|
1385
1410
|
const id = revisionIdOf(target);
|
|
1386
1411
|
const ids = getTrackedChangeGroupIdsFromDoc(this.state.doc, id);
|
|
1412
|
+
if (revisionResolutionLockViolation(this.state, ids, "accept") !== null) return false;
|
|
1387
1413
|
const suggestionId = suggestionIdOfRevision(this.state, id);
|
|
1388
1414
|
if (suggestionId !== null && !this.runCommand(acceptSuggestion(suggestionId, { author: this.author }))) return false;
|
|
1389
1415
|
let bodyChanged = false;
|
|
@@ -1401,6 +1427,7 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1401
1427
|
rejectChangeInternal(target) {
|
|
1402
1428
|
const id = revisionIdOf(target);
|
|
1403
1429
|
const ids = getTrackedChangeGroupIdsFromDoc(this.state.doc, id);
|
|
1430
|
+
if (revisionResolutionLockViolation(this.state, ids, "reject") !== null) return false;
|
|
1404
1431
|
const suggestionId = suggestionIdOfRevision(this.state, id);
|
|
1405
1432
|
if (suggestionId !== null && this.runCommand(rejectSuggestion(suggestionId))) return true;
|
|
1406
1433
|
let bodyChanged = false;
|
|
@@ -1440,13 +1467,26 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1440
1467
|
* Every story, not just the body: a revision in a header or a footnote is
|
|
1441
1468
|
* one a reviewer meant to resolve, and leaving it behind means an accepted
|
|
1442
1469
|
* document still carries a redline nobody can see from the body.
|
|
1470
|
+
*
|
|
1471
|
+
* A change a content control's lock holds (see {@link acceptChange}) stays
|
|
1472
|
+
* pending as it is and is listed in `skipped`; `resolved` counts the
|
|
1473
|
+
* ordinary changes resolved.
|
|
1443
1474
|
*/
|
|
1444
1475
|
acceptAll() {
|
|
1445
|
-
return this.
|
|
1476
|
+
return this.resolveAll("accept");
|
|
1446
1477
|
}
|
|
1447
1478
|
/** Reject every tracked change in the package. See {@link acceptAll}. */
|
|
1448
1479
|
rejectAll() {
|
|
1449
|
-
return this.
|
|
1480
|
+
return this.resolveAll("reject");
|
|
1481
|
+
}
|
|
1482
|
+
resolveAll(mode) {
|
|
1483
|
+
return this.resolveWithSectionReferenceHistory(() => {
|
|
1484
|
+
const skipped = [];
|
|
1485
|
+
return {
|
|
1486
|
+
resolved: this.resolveEveryStory(mode, skipped) + this.resolveEveryFinalSectionChange(mode),
|
|
1487
|
+
skipped
|
|
1488
|
+
};
|
|
1489
|
+
});
|
|
1450
1490
|
}
|
|
1451
1491
|
resolveWithSectionReferenceHistory(resolve) {
|
|
1452
1492
|
const before = captureSectionReferenceInventory(this.state.doc, this.currentFinalSectionProperties());
|
|
@@ -1482,8 +1522,8 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1482
1522
|
});
|
|
1483
1523
|
return propertyChanges?.length ?? 0;
|
|
1484
1524
|
}
|
|
1485
|
-
resolveEveryStory(mode) {
|
|
1486
|
-
return this.withNotesFollowingReferences(() => this.resolveEveryStoryOnce(mode));
|
|
1525
|
+
resolveEveryStory(mode, skipped) {
|
|
1526
|
+
return this.withNotesFollowingReferences(() => this.resolveEveryStoryOnce(mode, skipped));
|
|
1487
1527
|
}
|
|
1488
1528
|
/**
|
|
1489
1529
|
* Change the body the way a note follows its reference: a note whose
|
|
@@ -1553,13 +1593,18 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1553
1593
|
}
|
|
1554
1594
|
return keys;
|
|
1555
1595
|
}
|
|
1556
|
-
resolveEveryStoryOnce(mode) {
|
|
1596
|
+
resolveEveryStoryOnce(mode, skipped) {
|
|
1557
1597
|
let count = 0;
|
|
1558
1598
|
const resolvedStories = [];
|
|
1559
1599
|
const refreshes = [];
|
|
1560
1600
|
for (const handle of this.listStoryHandlesInternal()) {
|
|
1561
1601
|
const state = this.getEditableStoryState(handle);
|
|
1562
1602
|
if (!state) continue;
|
|
1603
|
+
const held = lockHeldChanges(state, mode);
|
|
1604
|
+
if (held.size > 0) {
|
|
1605
|
+
count += this.resolveStoryAroundHeldChanges(handle, mode, held, skipped);
|
|
1606
|
+
continue;
|
|
1607
|
+
}
|
|
1563
1608
|
const ordinaryCount = getTrackedChangesFromDoc(state.doc).filter(({ id }) => mode === "reject" || suggestionIdOfRevision(state, id) === null).length;
|
|
1564
1609
|
count += ordinaryCount;
|
|
1565
1610
|
const withSuggestions = mode === "accept" && ordinaryCount > 0 && getSuggestions(state).length > 0 ? this.acceptOrdinaryChangesWithSuggestions(state, handle) : null;
|
|
@@ -1580,6 +1625,31 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1580
1625
|
}
|
|
1581
1626
|
return count;
|
|
1582
1627
|
}
|
|
1628
|
+
/**
|
|
1629
|
+
* Resolve each change of a story a content control's lock does not hold, on
|
|
1630
|
+
* its own: the one-pass resolver takes the whole story or nothing. The held
|
|
1631
|
+
* changes stay pending as they are and are reported in `skipped`.
|
|
1632
|
+
*/
|
|
1633
|
+
resolveStoryAroundHeldChanges(handle, mode, held, skipped) {
|
|
1634
|
+
for (const [id, violation] of held) skipped.push({
|
|
1635
|
+
id,
|
|
1636
|
+
reason: CONTENT_CONTROL_LOCK,
|
|
1637
|
+
message: lockedControlMessage(violation)
|
|
1638
|
+
});
|
|
1639
|
+
const state = this.getEditableStoryState(handle);
|
|
1640
|
+
if (!state) return 0;
|
|
1641
|
+
let resolved = 0;
|
|
1642
|
+
for (const { id } of getTrackedChangesFromDoc(state.doc).toReversed()) {
|
|
1643
|
+
if (held.has(id)) continue;
|
|
1644
|
+
const current = this.getEditableStoryState(handle);
|
|
1645
|
+
if (!current) break;
|
|
1646
|
+
const ids = getTrackedChangeGroupIdsFromDoc(current.doc, id);
|
|
1647
|
+
if (ids.length === 0) continue;
|
|
1648
|
+
const resolveOne = mode === "accept" ? acceptAIEditRevision(ids) : rejectAIEditRevision(ids);
|
|
1649
|
+
if (this.runStoryCommand(resolveOne, handle)) resolved += 1;
|
|
1650
|
+
}
|
|
1651
|
+
return resolved;
|
|
1652
|
+
}
|
|
1583
1653
|
acceptOrdinaryChangesWithSuggestions(state, story) {
|
|
1584
1654
|
const originalSuggestions = getSuggestions(state);
|
|
1585
1655
|
const records = this.exportPendingSuggestions().filter((record) => editableStoryKey(record.story) === editableStoryKey(story));
|
|
@@ -1775,7 +1845,7 @@ var FolioDocxReviewer = class FolioDocxReviewer {
|
|
|
1775
1845
|
}));
|
|
1776
1846
|
}
|
|
1777
1847
|
if (kept.length !== definitions.length || snapshot.createdComments.length > 0 || snapshot.resolvedOverrides.size > 0) setDocumentBodyComments(document.package.document, this.withResolvedOverrides(kept, snapshot.resolvedOverrides));
|
|
1778
|
-
const normalized = normalizeListModelRendering(reconcileDocumentPartRelationships(document)).document;
|
|
1848
|
+
const normalized = normalizeListModelRendering(reconcileDocumentPartRelationships(document), { inverse: "omit" }).document;
|
|
1779
1849
|
visitDocxParagraphs({
|
|
1780
1850
|
documentBody: normalized.package.document,
|
|
1781
1851
|
headers: normalized.package.headers,
|
|
@@ -2310,4 +2380,4 @@ const applyFolioAIEditsToBuffer = async (buffer, operations, options = {}) => {
|
|
|
2310
2380
|
skipped
|
|
2311
2381
|
};
|
|
2312
2382
|
};
|
|
2313
|
-
export { FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FolioDocumentStoryNotFoundError, FolioDocxReviewer, UnsupportedFolioReviewedViewError, applyFolioAIEditsToBuffer, getFolioDocxComparisonAccess, isFolioResolvedReviewedView, isFolioReviewedView };
|
|
2383
|
+
export { FOLIO_DOCUMENT_OPERATION_UNDO_LIMIT, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FolioDocumentStoryNotFoundError, FolioDocxReviewer, UnsupportedFolioReviewedViewError, applyFolioAIEditsToBuffer, getFolioDocxComparisonAccess, isFolioResolvedReviewedView, isFolioReviewedView };
|
package/dist/ai-edits/index.d.ts
CHANGED
|
@@ -6,10 +6,10 @@ import { DocPositionRange, clampRangeToDocSize, resolveFolioAIBlockRange, resolv
|
|
|
6
6
|
import { buildAnnotatedBlockText } from "./clean-text.js";
|
|
7
7
|
import { ApplyFolioDocumentOperationsOptions, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FolioDocumentOperation, FolioDocumentOperationAffectedTarget, FolioDocumentOperationBatch, FolioDocumentOperationCapabilities, FolioDocumentOperationIssue, FolioDocumentOperationMode, FolioDocumentOperationPrecondition, FolioDocumentOperationReceipt, FolioDocumentOperationRecovery, FolioDocumentOperationResult, FolioDocumentOperationResultBase, FolioDocumentOperationStatus, FolioDocumentOperationStory, FolioDocumentOperationType, FolioDocumentOperationUndoFailureReason, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, isFolioDocumentOperationModeSupported, isSupportedFolioDocumentOperationVersion, parseFolioDocumentOperationBatch } from "../document-operations.js";
|
|
8
8
|
import { FOLIO_PENDING_SUGGESTION_VERSION, FolioPendingSuggestionLoadResult, FolioPendingSuggestionRecord, FolioPendingSuggestionRegistry, FolioPendingSuggestionStaleReason, createPendingSuggestionSourceSnapshot } from "./pending-suggestions.js";
|
|
9
|
-
import { FolioCommentAnchor, FolioReviewChange, FolioReviewChangeKind, getCommentAnchorsFromDoc, getTrackedChangesFromDoc } from "./read.js";
|
|
9
|
+
import { FolioCommentAnchor, FolioReviewChange, FolioReviewChangeKind, FolioReviewResolution, FolioReviewResolutionSkip, getCommentAnchorsFromDoc, getTrackedChangesFromDoc } from "./read.js";
|
|
10
10
|
import { createFolioAIEditSnapshot, createFolioAIEditSnapshotWithStyleResolver, createFolioAITextRangeHandle, hashFolioAIBlockText, isFolioAIContentBlock, normalizeFolioAIBlockText } from "./snapshot.js";
|
|
11
11
|
import { FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, FolioApplyDocumentOperationsToStoryOptions, FolioDocumentStory, FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, FolioEditableDocumentStoryHandle, FolioReadReviewedStoryOptions, FolioResolveReviewedStoryOptions, FolioResolvedReviewedView, FolioReviewedStory, FolioReviewedView, UnsupportedFolioReviewedViewError, isFolioResolvedReviewedView, isFolioReviewedView } from "./headless.js";
|
|
12
12
|
import { getFolioDocumentOutline, readFolioDocumentSection } from "./scoped-reading.js";
|
|
13
13
|
import { getFolioDocumentOperationRemovedBlockIds } from "./removed-blocks.js";
|
|
14
14
|
import { getFolioParaIdFromBlockId } from "../types/block-id.js";
|
|
15
|
-
export { type ApplyFolioDocumentOperationsOptions, type DocPositionRange, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_PENDING_SUGGESTION_VERSION, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIEditView, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIInsertFormattingScope, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsToStoryOptions, type FolioCommentAnchor, type FolioContentParagraphKind, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioEditableDocumentStoryHandle, type FolioPendingSuggestionLoadResult, type FolioPendingSuggestionRecord, FolioPendingSuggestionRegistry, type FolioPendingSuggestionStaleReason, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeKind, type FolioReviewedStory, type FolioReviewedView, type FolioRevisionStamp, type FolioUndefinedReferencePolicy, type FolioWordDiffOptions, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioReviewedViewError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, applyFolioAIEditOperations, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, buildAnnotatedBlockText, clampRangeToDocSize, createFolioAIEditSnapshot, createFolioAIEditSnapshotWithStyleResolver, createFolioAITextRangeHandle, createPendingSuggestionSourceSnapshot, diffWordSegments, getCommentAnchorsFromDoc, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedChangesFromDoc, hashFolioAIBlockText, isFolioAIContentBlock, isFolioDocumentOperationModeSupported, isFolioResolvedReviewedView, isFolioReviewedView, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, readFolioDocumentSection, resolveFolioAIBlockRange, resolveFolioAITextRange, resolvePassageRange };
|
|
15
|
+
export { type ApplyFolioDocumentOperationsOptions, type DocPositionRange, FOLIO_DOCUMENT_OPERATION_BATCH_MODES, FOLIO_DOCUMENT_OPERATION_CONTRACT_VERSION, FOLIO_DOCUMENT_OPERATION_MODES, FOLIO_DOCUMENT_OPERATION_MODES_BY_TYPE, FOLIO_DOCUMENT_OPERATION_PRECONDITIONS, FOLIO_DOCUMENT_OPERATION_STORIES, FOLIO_DOCUMENT_OPERATION_TYPES, FOLIO_LINE_SPACING_RULE_VALUES, FOLIO_PARAGRAPH_ALIGNMENT_VALUES, FOLIO_PENDING_SUGGESTION_VERSION, FOLIO_RESOLVED_REVIEWED_VIEWS, FOLIO_REVIEWED_VIEWS, type FolioAIBlock, type FolioAIBlockAnchor, type FolioAIBlockKind, type FolioAIBlockPreviewRun, type FolioAIBlockStructuralBoundary, type FolioAIBlockTableLocation, type FolioAIComment, type FolioAIDiagnosticBlock, type FolioAIEditAppliedOperation, type FolioAIEditApplyMode, type FolioAIEditApplyOutcome, type FolioAIEditApplyResult, type FolioAIEditNormalization, type FolioAIEditNormalizationCode, type FolioAIEditOperation, type FolioAIEditPrecondition, type FolioAIEditReviewMeta, type FolioAIEditSeverity, type FolioAIEditSkipReason, type FolioAIEditSkippedOperation, type FolioAIEditSnapshot, type FolioAIEditView, type FolioAIInlineBooleanProperty, type FolioAIInlineFormatting, type FolioAIInlineFormattingPatch, type FolioAIInsertFormattingScope, type FolioAIParagraphBlock, type FolioAIParagraphSpacing, type FolioAISignatureParty, type FolioAITextRangeHandle, type FolioApplyDocumentOperationsToStoryOptions, type FolioCommentAnchor, type FolioContentParagraphKind, type FolioDocumentNavigationTarget, type FolioDocumentOperation, type FolioDocumentOperationAffectedTarget, type FolioDocumentOperationBatch, type FolioDocumentOperationCapabilities, type FolioDocumentOperationIssue, type FolioDocumentOperationMode, type FolioDocumentOperationPrecondition, type FolioDocumentOperationReceipt, type FolioDocumentOperationRecovery, type FolioDocumentOperationResult, type FolioDocumentOperationResultBase, type FolioDocumentOperationStatus, type FolioDocumentOperationStory, type FolioDocumentOperationType, type FolioDocumentOperationUndoFailureReason, type FolioDocumentOperationUndoHandle, type FolioDocumentOperationUndoResult, type FolioDocumentOutline, type FolioDocumentOutlineEntry, type FolioDocumentSection, type FolioDocumentSectionHandle, type FolioDocumentSectionReadResult, type FolioDocumentStory, type FolioDocumentStoryHandle, FolioDocumentStoryNotFoundError, type FolioEditableDocumentStoryHandle, type FolioPendingSuggestionLoadResult, type FolioPendingSuggestionRecord, FolioPendingSuggestionRegistry, type FolioPendingSuggestionStaleReason, type FolioReadReviewedStoryOptions, type FolioResolveReviewedStoryOptions, type FolioResolvedReviewedView, type FolioReviewChange, type FolioReviewChangeKind, type FolioReviewResolution, type FolioReviewResolutionSkip, type FolioReviewedStory, type FolioReviewedView, type FolioRevisionStamp, type FolioUndefinedReferencePolicy, type FolioWordDiffOptions, InvalidFolioDocumentOperationBatchError, UnsupportedFolioDocumentOperationVersionError, UnsupportedFolioReviewedViewError, WORD_DIFF_GRANULARITIES, type WordDiffGranularity, type WordDiffNormalization, type WordDiffOptions, type WordDiffSegment, applyFolioAIEditOperations, applyFolioDocumentOperations, assertSupportedFolioDocumentOperationVersion, buildAnnotatedBlockText, clampRangeToDocSize, createFolioAIEditSnapshot, createFolioAIEditSnapshotWithStyleResolver, createFolioAITextRangeHandle, createPendingSuggestionSourceSnapshot, diffWordSegments, getCommentAnchorsFromDoc, getFolioDocumentOperationCapabilities, getFolioDocumentOperationIssues, getFolioDocumentOperationReceipts, getFolioDocumentOperationRemovedBlockIds, getFolioDocumentOutline, getFolioParaIdFromBlockId, getTrackedChangesFromDoc, hashFolioAIBlockText, isFolioAIContentBlock, isFolioDocumentOperationModeSupported, isFolioResolvedReviewedView, isFolioReviewedView, isSupportedFolioDocumentOperationVersion, normalizeFolioAIBlockText, parseFolioDocumentOperationBatch, readFolioDocumentSection, resolveFolioAIBlockRange, resolveFolioAITextRange, resolvePassageRange };
|