@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
|
@@ -0,0 +1,362 @@
|
|
|
1
|
+
import { expectTableAttrs, expectTableCellAttrs, expectTableRowAttrs } from "./attrs/index.js";
|
|
2
|
+
import { withCanonicalCommand } from "./canonicalCommands.js";
|
|
3
|
+
import { standaloneTableRowsFromProseMirror, tableAttrsToFormatting, tableCellAttrsToFormatting, tableRowAttrsToFormatting } from "./conversion/fromProseDoc.js";
|
|
4
|
+
import { isInTable, selectedRect } from "prosemirror-tables";
|
|
5
|
+
import { DOCUMENT_OP_TYPES } from "@stll/docx-core/ops";
|
|
6
|
+
// src/prosemirror/canonicalTableCommands.ts
|
|
7
|
+
const SCOPES = {
|
|
8
|
+
table: "table",
|
|
9
|
+
tableRow: "row",
|
|
10
|
+
tableCell: "cell",
|
|
11
|
+
tableHeader: "cell"
|
|
12
|
+
};
|
|
13
|
+
const isScoped = (name) => Object.hasOwn(SCOPES, name);
|
|
14
|
+
/** Keys whose saved value changed: the new value, or null where the key went. */
|
|
15
|
+
const patchBetween = (before, after) => {
|
|
16
|
+
const patch = {};
|
|
17
|
+
const keys = Object.keys({
|
|
18
|
+
...before,
|
|
19
|
+
...after
|
|
20
|
+
});
|
|
21
|
+
for (const key of keys) {
|
|
22
|
+
const was = before?.[key];
|
|
23
|
+
const is = after?.[key];
|
|
24
|
+
if (JSON.stringify(was) === JSON.stringify(is)) continue;
|
|
25
|
+
patch[key] = after !== void 0 && Object.hasOwn(after, key) ? is : null;
|
|
26
|
+
}
|
|
27
|
+
return patch;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* The patch of the formatting the save writes for a table, row or cell node,
|
|
31
|
+
* between its attributes before and after the command, as a target at `at`.
|
|
32
|
+
*/
|
|
33
|
+
const targetBetween = (scope, before, after, at) => {
|
|
34
|
+
switch (scope) {
|
|
35
|
+
case "table": return {
|
|
36
|
+
scope,
|
|
37
|
+
at,
|
|
38
|
+
patch: patchBetween(tableAttrsToFormatting(expectTableAttrs(before)), tableAttrsToFormatting(expectTableAttrs(after)))
|
|
39
|
+
};
|
|
40
|
+
case "row": return {
|
|
41
|
+
scope,
|
|
42
|
+
at,
|
|
43
|
+
patch: patchBetween(tableRowAttrsToFormatting(expectTableRowAttrs(before)), tableRowAttrsToFormatting(expectTableRowAttrs(after)))
|
|
44
|
+
};
|
|
45
|
+
case "cell": return {
|
|
46
|
+
scope,
|
|
47
|
+
at,
|
|
48
|
+
patch: patchBetween(tableCellAttrsToFormatting(expectTableCellAttrs(before)), tableCellAttrsToFormatting(expectTableCellAttrs(after)))
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* A position inside the first paragraph that belongs to the node itself, which
|
|
54
|
+
* addresses it. A paragraph of a nested table would address the inner table.
|
|
55
|
+
*/
|
|
56
|
+
const firstParagraphPosition = (node, position) => {
|
|
57
|
+
let found;
|
|
58
|
+
node.descendants((child, offset) => {
|
|
59
|
+
if (found !== void 0 || child.type.name === "table") return false;
|
|
60
|
+
if (child.isTextblock) {
|
|
61
|
+
found = position + 1 + offset + 1;
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return true;
|
|
65
|
+
});
|
|
66
|
+
return found;
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* What an attribute-only table command does, as table formatting patches.
|
|
70
|
+
*
|
|
71
|
+
* The command runs against the state without dispatching to the view. Every
|
|
72
|
+
* table, row and cell whose attributes it changed lowers to a patch of the
|
|
73
|
+
* formatting the save would write for it, so the session applies exactly what
|
|
74
|
+
* the editor would have saved. A command that changes anything else (content,
|
|
75
|
+
* a node's type, a span) has no attribute lowering and stays refused.
|
|
76
|
+
*/
|
|
77
|
+
const lowerTableAttributeCommand = (command, state) => {
|
|
78
|
+
let transaction;
|
|
79
|
+
if (!command(state, (dispatched) => {
|
|
80
|
+
transaction = dispatched;
|
|
81
|
+
}) || transaction === void 0) return void 0;
|
|
82
|
+
const changed = transaction;
|
|
83
|
+
const targets = [];
|
|
84
|
+
const grids = [];
|
|
85
|
+
const expected = state.tr;
|
|
86
|
+
let lowerable = true;
|
|
87
|
+
state.doc.descendants((node, position) => {
|
|
88
|
+
if (!lowerable) return false;
|
|
89
|
+
if (!isScoped(node.type.name)) return true;
|
|
90
|
+
const after = changed.doc.nodeAt(changed.mapping.map(position, -1));
|
|
91
|
+
if (after === null || after.type !== node.type) {
|
|
92
|
+
lowerable = false;
|
|
93
|
+
return false;
|
|
94
|
+
}
|
|
95
|
+
if (after.attrs["colspan"] !== node.attrs["colspan"] || after.attrs["rowspan"] !== node.attrs["rowspan"]) {
|
|
96
|
+
lowerable = false;
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
if (JSON.stringify(after.attrs) === JSON.stringify(node.attrs)) return true;
|
|
100
|
+
expected.setNodeMarkup(position, void 0, after.attrs, node.marks);
|
|
101
|
+
const at = firstParagraphPosition(node, position);
|
|
102
|
+
if (node.type.name === "table") {
|
|
103
|
+
const grid = gridEdit(node, after, at);
|
|
104
|
+
if (grid === null) {
|
|
105
|
+
lowerable = false;
|
|
106
|
+
return false;
|
|
107
|
+
}
|
|
108
|
+
if (grid !== void 0) grids.push(grid);
|
|
109
|
+
}
|
|
110
|
+
const target = targetBetween(SCOPES[node.type.name], node, after, at ?? 0);
|
|
111
|
+
if (Object.keys(target.patch).length === 0) return true;
|
|
112
|
+
if (at === void 0) {
|
|
113
|
+
lowerable = false;
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
targets.push(target);
|
|
117
|
+
return true;
|
|
118
|
+
});
|
|
119
|
+
if (!lowerable || !expected.doc.eq(changed.doc)) return void 0;
|
|
120
|
+
return [...grids, ...targets.length === 0 ? [] : [{
|
|
121
|
+
type: "formatTable",
|
|
122
|
+
targets
|
|
123
|
+
}]];
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* The grid a command left on a table, as a grid edit: `undefined` when the
|
|
127
|
+
* grid is unchanged, `null` when the change cannot be written as a grid.
|
|
128
|
+
*/
|
|
129
|
+
const gridEdit = (before, after, at) => {
|
|
130
|
+
const was = expectTableAttrs(before).columnWidths;
|
|
131
|
+
const is = expectTableAttrs(after).columnWidths;
|
|
132
|
+
if (JSON.stringify(was) === JSON.stringify(is)) return void 0;
|
|
133
|
+
if (at === void 0 || is === void 0 || is.length === 0) return null;
|
|
134
|
+
return {
|
|
135
|
+
type: "editTable",
|
|
136
|
+
at,
|
|
137
|
+
edit: {
|
|
138
|
+
type: DOCUMENT_OP_TYPES.SET_TABLE_GRID,
|
|
139
|
+
columnWidths: [...is]
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
/** Register a command whose whole effect is table, row and cell attributes. */
|
|
144
|
+
const withCanonicalTableAttributeCommand = (command) => withCanonicalCommand(command, (state) => lowerTableAttributeCommand(command, state));
|
|
145
|
+
/** A paragraph of the table's own, outside the given columns, that addresses it. */
|
|
146
|
+
const tableAnchor = (rect, avoid = {
|
|
147
|
+
left: 0,
|
|
148
|
+
right: 0
|
|
149
|
+
}) => {
|
|
150
|
+
const { map, table, tableStart } = rect;
|
|
151
|
+
for (let row = 0; row < map.height; row += 1) for (let column = 0; column < map.width; column += 1) {
|
|
152
|
+
if (column >= avoid.left && column < avoid.right) continue;
|
|
153
|
+
const offset = map.map[row * map.width + column];
|
|
154
|
+
if (offset === void 0) continue;
|
|
155
|
+
const cell = table.nodeAt(offset);
|
|
156
|
+
if (cell === null || cell.attrs["_omittedGridSlot"] != null) continue;
|
|
157
|
+
const cellRect = map.findCell(offset);
|
|
158
|
+
if (cellRect.left < avoid.right && cellRect.right > avoid.left) continue;
|
|
159
|
+
const at = firstParagraphPosition(cell, tableStart + offset);
|
|
160
|
+
if (at !== void 0) return at;
|
|
161
|
+
}
|
|
162
|
+
};
|
|
163
|
+
/**
|
|
164
|
+
* Register a command that changes a table's columns or cells, lowered from the
|
|
165
|
+
* selection it acts on to the engine's table edit. The command still runs
|
|
166
|
+
* against the state first: one it would refuse has no lowering.
|
|
167
|
+
*/
|
|
168
|
+
const withCanonicalTableStructureCommand = (command, lower) => withCanonicalCommand(command, (state) => {
|
|
169
|
+
if (!isInTable(state)) return void 0;
|
|
170
|
+
let transaction;
|
|
171
|
+
if (!command(state, (dispatched) => {
|
|
172
|
+
transaction = dispatched;
|
|
173
|
+
}) || transaction === void 0) return void 0;
|
|
174
|
+
return lower(selectedRect(state), state, transaction);
|
|
175
|
+
});
|
|
176
|
+
/** The width the command gave the column it inserted, from the table it left. */
|
|
177
|
+
const insertedWidth = (rect, changed, column) => {
|
|
178
|
+
const after = changed.doc.nodeAt(changed.mapping.map(rect.tableStart - 1, -1));
|
|
179
|
+
if (after === null || after.type.name !== "table") return void 0;
|
|
180
|
+
return expectTableAttrs(after).columnWidths?.[column];
|
|
181
|
+
};
|
|
182
|
+
const insertColumn = (side) => (rect, _state, changed) => {
|
|
183
|
+
const column = side === "left" ? rect.left : rect.right;
|
|
184
|
+
const width = insertedWidth(rect, changed, column);
|
|
185
|
+
const at = tableAnchor(rect);
|
|
186
|
+
if (width === void 0 || at === void 0) return void 0;
|
|
187
|
+
return [{
|
|
188
|
+
type: "editTable",
|
|
189
|
+
at,
|
|
190
|
+
edit: {
|
|
191
|
+
type: DOCUMENT_OP_TYPES.INSERT_COLUMN,
|
|
192
|
+
column,
|
|
193
|
+
width
|
|
194
|
+
}
|
|
195
|
+
}];
|
|
196
|
+
};
|
|
197
|
+
/** Each selected column, from the right so the indices still hold. */
|
|
198
|
+
const deleteColumns = (rect) => {
|
|
199
|
+
const at = tableAnchor(rect, {
|
|
200
|
+
left: rect.left,
|
|
201
|
+
right: rect.right
|
|
202
|
+
});
|
|
203
|
+
if (at === void 0) return void 0;
|
|
204
|
+
const intents = [];
|
|
205
|
+
for (let column = rect.right - 1; column >= rect.left; column -= 1) intents.push({
|
|
206
|
+
type: "editTable",
|
|
207
|
+
at,
|
|
208
|
+
edit: {
|
|
209
|
+
type: DOCUMENT_OP_TYPES.DELETE_COLUMN,
|
|
210
|
+
column
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
return intents;
|
|
214
|
+
};
|
|
215
|
+
const mergeCells$1 = (rect) => {
|
|
216
|
+
const at = tableAnchor(rect);
|
|
217
|
+
if (at === void 0) return void 0;
|
|
218
|
+
return [{
|
|
219
|
+
type: "editTable",
|
|
220
|
+
at,
|
|
221
|
+
edit: {
|
|
222
|
+
type: DOCUMENT_OP_TYPES.MERGE_CELLS,
|
|
223
|
+
top: rect.top,
|
|
224
|
+
bottom: rect.bottom,
|
|
225
|
+
left: rect.left,
|
|
226
|
+
right: rect.right
|
|
227
|
+
}
|
|
228
|
+
}];
|
|
229
|
+
};
|
|
230
|
+
/** The cell at the selection's top left, addressed by its own paragraph. */
|
|
231
|
+
const splitCell$1 = (rect) => {
|
|
232
|
+
const offset = rect.map.map[rect.top * rect.map.width + rect.left];
|
|
233
|
+
const cell = offset === void 0 ? null : rect.table.nodeAt(offset);
|
|
234
|
+
if (offset === void 0 || cell === null) return void 0;
|
|
235
|
+
const at = firstParagraphPosition(cell, rect.tableStart + offset);
|
|
236
|
+
if (at === void 0) return void 0;
|
|
237
|
+
return [{
|
|
238
|
+
type: "editTable",
|
|
239
|
+
at,
|
|
240
|
+
edit: { type: DOCUMENT_OP_TYPES.SPLIT_CELL }
|
|
241
|
+
}];
|
|
242
|
+
};
|
|
243
|
+
const withCanonicalColumnInsertion = (command, side) => withCanonicalTableStructureCommand(command, insertColumn(side));
|
|
244
|
+
const withCanonicalColumnDeletion = (command) => withCanonicalTableStructureCommand(command, deleteColumns);
|
|
245
|
+
const withCanonicalCellMerge = (command) => withCanonicalTableStructureCommand(command, mergeCells$1);
|
|
246
|
+
const withCanonicalCellSplit = (command) => withCanonicalTableStructureCommand(command, splitCell$1);
|
|
247
|
+
/** A paragraph of the table's own in the given row. */
|
|
248
|
+
const rowAnchor = (rect, row) => {
|
|
249
|
+
const { map, table, tableStart } = rect;
|
|
250
|
+
for (let column = 0; column < map.width; column += 1) {
|
|
251
|
+
const offset = map.map[row * map.width + column];
|
|
252
|
+
if (offset === void 0) continue;
|
|
253
|
+
const cell = table.nodeAt(offset);
|
|
254
|
+
if (cell === null || cell.attrs["_omittedGridSlot"] != null) continue;
|
|
255
|
+
if (map.findCell(offset).top !== row) continue;
|
|
256
|
+
const at = firstParagraphPosition(cell, tableStart + offset);
|
|
257
|
+
if (at !== void 0) return at;
|
|
258
|
+
}
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* The row the command inserted, as the save would write it. Revision marks
|
|
262
|
+
* the command put on it are left to the engine, which records its own.
|
|
263
|
+
*/
|
|
264
|
+
const insertedRow = (rect, changed, index) => {
|
|
265
|
+
const after = changed.doc.nodeAt(changed.mapping.map(rect.tableStart - 1, -1));
|
|
266
|
+
if (after === null || after.type.name !== "table") return void 0;
|
|
267
|
+
const row = standaloneTableRowsFromProseMirror(after)[index];
|
|
268
|
+
if (row === void 0) return void 0;
|
|
269
|
+
const { structuralChange: _structuralChange, propertyChanges: _propertyChanges, ...plain } = row;
|
|
270
|
+
return plain;
|
|
271
|
+
};
|
|
272
|
+
const insertRow = (side) => (rect, _state, changed) => {
|
|
273
|
+
const index = side === "above" ? rect.top : rect.bottom;
|
|
274
|
+
const row = insertedRow(rect, changed, index);
|
|
275
|
+
const at = rowAnchor(rect, side === "above" ? rect.top : rect.bottom - 1);
|
|
276
|
+
if (row === void 0 || at === void 0) return void 0;
|
|
277
|
+
return [{
|
|
278
|
+
type: "editTableRow",
|
|
279
|
+
at,
|
|
280
|
+
edit: {
|
|
281
|
+
type: DOCUMENT_OP_TYPES.INSERT_ROW,
|
|
282
|
+
at: index,
|
|
283
|
+
row
|
|
284
|
+
}
|
|
285
|
+
}];
|
|
286
|
+
};
|
|
287
|
+
/** Each selected row from the bottom, addressed by a paragraph of its own. */
|
|
288
|
+
const deleteRows = (rect) => {
|
|
289
|
+
const intents = [];
|
|
290
|
+
for (let row = rect.bottom - 1; row >= rect.top; row -= 1) {
|
|
291
|
+
const at = rowAnchor(rect, row);
|
|
292
|
+
if (at === void 0) return void 0;
|
|
293
|
+
intents.push({
|
|
294
|
+
type: "editTableRow",
|
|
295
|
+
at,
|
|
296
|
+
edit: { type: DOCUMENT_OP_TYPES.DELETE_ROW }
|
|
297
|
+
});
|
|
298
|
+
}
|
|
299
|
+
return intents;
|
|
300
|
+
};
|
|
301
|
+
const withCanonicalRowInsertion = (command, side) => withCanonicalTableStructureCommand(command, insertRow(side));
|
|
302
|
+
const withCanonicalRowDeletion = (command) => withCanonicalTableStructureCommand(command, deleteRows);
|
|
303
|
+
/** The table the selection is in, addressed by a paragraph of its own. */
|
|
304
|
+
const deleteTable = (rect) => {
|
|
305
|
+
const at = tableAnchor(rect);
|
|
306
|
+
if (at === void 0) return void 0;
|
|
307
|
+
return [{
|
|
308
|
+
type: "editTableBlock",
|
|
309
|
+
at,
|
|
310
|
+
edit: { type: DOCUMENT_OP_TYPES.DELETE_TABLE }
|
|
311
|
+
}];
|
|
312
|
+
};
|
|
313
|
+
const withCanonicalTableDeletion = (command) => withCanonicalTableStructureCommand(command, deleteTable);
|
|
314
|
+
/**
|
|
315
|
+
* Register the insert table command, lowered to a table and an empty
|
|
316
|
+
* paragraph after the paragraph that holds the caret, as the command places
|
|
317
|
+
* them. The table is the one the command built, without the revision marks
|
|
318
|
+
* it put on its rows; in suggesting mode the engine records its own.
|
|
319
|
+
*/
|
|
320
|
+
const withCanonicalTableInsertion = (command) => withCanonicalCommand(command, (state) => {
|
|
321
|
+
const { $from } = state.selection;
|
|
322
|
+
let depth = $from.depth;
|
|
323
|
+
while (depth > 0 && $from.node(depth).type.name !== "paragraph" && $from.node(depth).type.name !== "table") depth -= 1;
|
|
324
|
+
const afterTable = depth > 0 && $from.node(depth).type.name === "table";
|
|
325
|
+
const atStart = depth === 0 && $from.pos === 0 && state.doc.firstChild?.type.name === "paragraph";
|
|
326
|
+
if (depth === 0 && !atStart) return void 0;
|
|
327
|
+
const following = afterTable ? state.doc.resolve($from.after(depth)).nodeAfter : null;
|
|
328
|
+
if (afterTable && following?.type.name !== "paragraph") return void 0;
|
|
329
|
+
let transaction;
|
|
330
|
+
if (!command(state, (dispatched) => {
|
|
331
|
+
transaction = dispatched;
|
|
332
|
+
}) || transaction === void 0) return void 0;
|
|
333
|
+
const at = atStart ? 0 : transaction.mapping.map($from.after(depth), -1);
|
|
334
|
+
const leading = afterTable ? transaction.doc.nodeAt(at) : null;
|
|
335
|
+
const inserted = transaction.doc.nodeAt(leading?.type.name === "paragraph" ? at + leading.nodeSize : at);
|
|
336
|
+
const before = atStart || afterTable;
|
|
337
|
+
const anchorPosition = () => {
|
|
338
|
+
if (atStart) return 1;
|
|
339
|
+
if (afterTable) return $from.after(depth) + 1;
|
|
340
|
+
return $from.start(depth);
|
|
341
|
+
};
|
|
342
|
+
if (inserted === null || inserted.type.name !== "table") return void 0;
|
|
343
|
+
const formatting = tableAttrsToFormatting(expectTableAttrs(inserted));
|
|
344
|
+
const columnWidths = expectTableAttrs(inserted).columnWidths;
|
|
345
|
+
const table = {
|
|
346
|
+
type: "table",
|
|
347
|
+
...formatting === void 0 ? {} : { formatting },
|
|
348
|
+
...columnWidths === void 0 ? {} : { columnWidths: [...columnWidths] },
|
|
349
|
+
rows: standaloneTableRowsFromProseMirror(inserted).map(({ structuralChange: _change, propertyChanges: _changes, ...row }) => row)
|
|
350
|
+
};
|
|
351
|
+
return [{
|
|
352
|
+
type: "editTableBlock",
|
|
353
|
+
at: anchorPosition(),
|
|
354
|
+
edit: {
|
|
355
|
+
type: DOCUMENT_OP_TYPES.INSERT_TABLE,
|
|
356
|
+
table,
|
|
357
|
+
...before ? { side: "before" } : {},
|
|
358
|
+
...afterTable ? { separated: true } : {}
|
|
359
|
+
}
|
|
360
|
+
}];
|
|
361
|
+
});
|
|
362
|
+
export { lowerTableAttributeCommand, withCanonicalCellMerge, withCanonicalCellSplit, withCanonicalColumnDeletion, withCanonicalColumnInsertion, withCanonicalRowDeletion, withCanonicalRowInsertion, withCanonicalTableAttributeCommand, withCanonicalTableDeletion, withCanonicalTableInsertion };
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { TrackedChangeEntry } from "../utils/extractTrackedChanges.js";
|
|
1
2
|
import { Command, EditorState } from "prosemirror-state";
|
|
3
|
+
import { LockedControlViolation } from "@stll/docx-core/model";
|
|
2
4
|
import { Mapping } from "prosemirror-transform";
|
|
3
5
|
/**
|
|
4
6
|
* Add a comment mark to the current selection.
|
|
@@ -18,6 +20,21 @@ export type ParagraphBoundaryChange = {
|
|
|
18
20
|
revisionId?: number;
|
|
19
21
|
};
|
|
20
22
|
export declare function findParagraphBoundaryChangeAtPosition(state: EditorState, pos: number): ParagraphBoundaryChange | null;
|
|
23
|
+
/**
|
|
24
|
+
* What the content-control locks say about resolving the tracked changes
|
|
25
|
+
* between `from` and `to` (only those of `revisionIds`, when given): `null`
|
|
26
|
+
* when they allow it or there is nothing there to resolve. A revision whose
|
|
27
|
+
* resolution would change a content-locked control's content, or remove a
|
|
28
|
+
* control locked against removal, stays pending.
|
|
29
|
+
*/
|
|
30
|
+
export declare const changeResolutionLockViolation: (state: EditorState, { from, to, mode, revisionIds }: {
|
|
31
|
+
from: number;
|
|
32
|
+
to: number;
|
|
33
|
+
mode: "accept" | "reject";
|
|
34
|
+
revisionIds?: readonly number[];
|
|
35
|
+
}) => LockedControlViolation | null;
|
|
36
|
+
/** {@link changeResolutionLockViolation} for the revisions `revisionIds`, wherever they are. */
|
|
37
|
+
export declare const revisionResolutionLockViolation: (state: EditorState, revisionIds: number | readonly number[], mode: "accept" | "reject") => LockedControlViolation | null;
|
|
21
38
|
/**
|
|
22
39
|
* Accept a tracked change at the given range.
|
|
23
40
|
* - Insertion: remove mark, keep text
|
|
@@ -39,6 +56,14 @@ export declare function acceptAllChanges(): Command;
|
|
|
39
56
|
* Reject all tracked changes in the document.
|
|
40
57
|
*/
|
|
41
58
|
export declare function rejectAllChanges(): Command;
|
|
59
|
+
/**
|
|
60
|
+
* The revisions of `state` that a content control's lock keeps from being
|
|
61
|
+
* resolved in `mode`, each with the lock's verdict: see
|
|
62
|
+
* {@link changeResolutionLockViolation}. Empty without a locked control.
|
|
63
|
+
*/
|
|
64
|
+
export declare const lockHeldRevisions: (state: EditorState, mode: "accept" | "reject") => Map<number, LockedControlViolation>;
|
|
65
|
+
/** Every revision id one sidebar entry stands for. */
|
|
66
|
+
export declare const trackedChangeEntryRevisionIds: (entry: TrackedChangeEntry) => number[];
|
|
42
67
|
/**
|
|
43
68
|
* Resolve a complete state synchronously for a headless reader or writer.
|
|
44
69
|
*
|
|
@@ -74,13 +99,16 @@ export declare function acceptAIEditRevision(revisionIds: number | readonly numb
|
|
|
74
99
|
* See {@link acceptAIEditRevision} for the id semantics.
|
|
75
100
|
*/
|
|
76
101
|
export declare function rejectAIEditRevision(revisionIds: number | readonly number[]): Command;
|
|
77
|
-
|
|
102
|
+
/** The ids of the comments a pending suggestion proposes. */
|
|
103
|
+
export declare function suggestionCommentIds(state: EditorState, suggestionId: string): number[];
|
|
104
|
+
export type SuggestionKind = "insertion" | "deletion" | "formatting" | "insertBlock" | "insertTable" | "insertRow" | "deleteRow" | "insertColumn" | "deleteColumn" | "comment";
|
|
78
105
|
/**
|
|
79
106
|
* How a suggestion is applied when accepted:
|
|
80
107
|
* - `"tracked"` — converts to a normal OOXML tracked change (`w:ins`/`w:del`,
|
|
81
108
|
* paragraph-mark `w:ins`, row/cell `w:ins`/`w:del`);
|
|
82
109
|
* - `"direct"` — no OOXML tracked representation exists (a whole inserted
|
|
83
|
-
* table), so accepting applies it directly;
|
|
110
|
+
* table), so accepting applies it directly; a suggestion that only
|
|
111
|
+
* proposes a comment is accepted as an ordinary comment;
|
|
84
112
|
* - `"mixed"` — a heterogeneous group (one `suggestionId` spanning a whole
|
|
85
113
|
* inserted table AND other edits) whose parts apply both ways. Accept still
|
|
86
114
|
* resolves the whole group in one transaction; this flag lets the host
|