@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
|
@@ -3,7 +3,7 @@ import { resolveColorValueToHex } from "../../docx/drawingUtils.js";
|
|
|
3
3
|
import { isInlineSdtContent, isTrackedChangeWrapperChild } from "../../docx/inlineWrapperContent.js";
|
|
4
4
|
import { listRenderingDefinitionsMatch, resolveListRenderingDefinition } from "../../docx/listRendering.js";
|
|
5
5
|
import { getCachedNumberingMap } from "../../docx/numberingParser.js";
|
|
6
|
-
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, createProseParagraphWithPropertySource, getDocumentParagraphPropertySourceContract, paragraphFormattingWithAuthoredIndentation, proseParagraphAttrsWithoutPropertySource, recreateProseNodeWithParagraphPropertySource, transportTableCellsWithParagraphPropertySources } from "../../docx/paragraphPropertySource.js";
|
|
6
|
+
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, createProseParagraphWithPropertySource, getDocumentParagraphPropertySourceContract, paragraphFormattingWithAuthoredIndentation, paragraphPropertySourceStamp, paragraphPropertySourceStampMatches, proseParagraphAttrsWithoutPropertySource, recreateProseNodeWithParagraphPropertySource, transportTableCellsWithParagraphPropertySources } from "../../docx/paragraphPropertySource.js";
|
|
7
7
|
import { visitInlineContentSlots, visitInlineContentSlotsInContent } from "../../docx/paragraphTraversal.js";
|
|
8
8
|
import { isBaselineVertAlign } from "../../docx/runParser.js";
|
|
9
9
|
import { replayableShapeAlternateContent } from "../../docx/shapeAlternateContent.js";
|
|
@@ -30,6 +30,7 @@ import { withEnclosingRevision } from "../contentControlRevisions.js";
|
|
|
30
30
|
import { emptyFieldRunPropertyChanges } from "../emptyFieldResultRuns.js";
|
|
31
31
|
import { planEmptyRanges } from "../emptyRangeAnchor.js";
|
|
32
32
|
import { textFormattingToMarks } from "../extensions/marks/markUtils.js";
|
|
33
|
+
import { BLOCK_COMMENT_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/BlockCommentRangeBoundaryExtension.js";
|
|
33
34
|
import { BLOCK_MOVE_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/BlockMoveRangeBoundaryExtension.js";
|
|
34
35
|
import { COMMENT_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/CommentRangeBoundaryExtension.js";
|
|
35
36
|
import { MOVE_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/MoveRangeBoundaryExtension.js";
|
|
@@ -49,7 +50,7 @@ import { paragraphIndentationFromFormatting } from "../paragraphIndentation.js";
|
|
|
49
50
|
import { lineSpacingProvenanceFromSpacing } from "../paragraphSpacing.js";
|
|
50
51
|
import { isRunContentProjectionNode } from "../runContentProjection.js";
|
|
51
52
|
import { RUN_IDENTITY_MARK_NAME, hasRunIdentityPayload, runIdentityAttrs } from "../runIdentity.js";
|
|
52
|
-
import { continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks, continueSourceCarrierIdentitiesAcrossRevisions } from "../runIdentityAcrossRevisions.js";
|
|
53
|
+
import { CarrierContinuationCache, continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks, continueSourceCarrierIdentitiesAcrossRevisions, continueSourceCarrierIdentitiesKeeping } from "../runIdentityAcrossRevisions.js";
|
|
53
54
|
import { getParagraphMarkSuppressionOverrides, hasDirectRunFormatting, isParagraphMarkSuppressionEligible, resolveParagraphInheritedRunFormatting, stripParagraphMarkOnlyFormatting, suppressParagraphMarkFormatting } from "../runStyleFormatting.js";
|
|
54
55
|
import { schema } from "../schema/index.js";
|
|
55
56
|
import { PRESERVED_XML_LEVELS } from "../schema/nodes.js";
|
|
@@ -58,7 +59,7 @@ import { listIndentationProvenancePatch } from "../styles/resolvedStyleAttrs.js"
|
|
|
58
59
|
import { cascadeStyleTextFormatting } from "../styles/styleToggleCascade.js";
|
|
59
60
|
import { tableCellStyleRegions, tableRowBand } from "../styles/tableStyleRegions.js";
|
|
60
61
|
import { canCarryTrackedRunMark, trackedRunInlineAtomDisposition } from "../trackedRunInlineAtoms.js";
|
|
61
|
-
import { assertValidProseMirrorDocument } from "../validation.js";
|
|
62
|
+
import { assertValidProseMirrorDocument, assertValidProseMirrorDocumentKeeping } from "../validation.js";
|
|
62
63
|
import { resolveEffectiveTableCellFormatting } from "./effectiveTableCellFormatting.js";
|
|
63
64
|
import { HYPHEN_ELEMENT_MARK_NAME, HYPHEN_TEXT_CARRIERS } from "./hyphenTextCarriers.js";
|
|
64
65
|
import { createMarkInterner } from "./markInterner.js";
|
|
@@ -85,11 +86,10 @@ const pageBreakProjectionWarn = (warn) => warn === void 0 ? noPageBreakProjectio
|
|
|
85
86
|
* span carrying a guessed/copied id could collide with and hijack a real
|
|
86
87
|
* text box anchored in a completely different document.
|
|
87
88
|
*/
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
89
|
+
const newTextBoxGroupSalt = () => Math.random().toString(36).slice(2, 10);
|
|
90
|
+
/** Text-box group ids under one salt, counted from `counter`. */
|
|
91
|
+
const textBoxGroupIdsFrom = (salt, counter) => () => `${salt}:${counter.value++}`;
|
|
92
|
+
const createTextBoxGroupIdFactory = (salt = newTextBoxGroupSalt()) => textBoxGroupIdsFrom(salt, { value: 0 });
|
|
93
93
|
/**
|
|
94
94
|
* The identity mark for one authored `w:r`, or `null` when it carries nothing
|
|
95
95
|
* worth a mark.
|
|
@@ -122,28 +122,17 @@ const createNoteReferenceOccurrenceAllocator = () => {
|
|
|
122
122
|
return () => `source-note:${index++}`;
|
|
123
123
|
};
|
|
124
124
|
/**
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
125
|
+
* Every bookmark boundary of a story's blocks, in the document order the
|
|
126
|
+
* conversion meets them, across every editable inline wrapper. Each endpoint
|
|
127
|
+
* is converted at its own structural position, so a range may start outside
|
|
128
|
+
* a hyperlink and end inside it (or the inverse).
|
|
128
129
|
*/
|
|
129
|
-
const
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
const countBoundary = (id, type) => {
|
|
133
|
-
const count = counts.get(id) ?? {
|
|
134
|
-
starts: 0,
|
|
135
|
-
ends: 0
|
|
136
|
-
};
|
|
137
|
-
if (type === "start") {
|
|
138
|
-
count.starts += 1;
|
|
139
|
-
count.firstStart ??= position;
|
|
140
|
-
} else {
|
|
141
|
-
count.ends += 1;
|
|
142
|
-
count.firstEnd ??= position;
|
|
143
|
-
}
|
|
144
|
-
position += 1;
|
|
145
|
-
counts.set(id, count);
|
|
130
|
+
const visitBookmarkBoundaries = (blocks, countBoundary) => {
|
|
131
|
+
const countMarkersWhere = (markers, stands) => {
|
|
132
|
+
for (const { index, marker } of markers ?? []) if (stands(index)) countBoundary(marker.id, marker.type === "bookmarkStart" ? "start" : "end");
|
|
146
133
|
};
|
|
134
|
+
const countMarkersAt = (markers, at) => countMarkersWhere(markers, (index) => index === at);
|
|
135
|
+
const countMarkersFrom = (markers, from) => countMarkersWhere(markers, (index) => index >= from);
|
|
147
136
|
const visitRun = (run) => {
|
|
148
137
|
for (const content of run.content) if (content.type === "shape" && content.shape.textBody) visitBlocks(content.shape.textBody.content);
|
|
149
138
|
};
|
|
@@ -167,7 +156,8 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
167
156
|
break;
|
|
168
157
|
case "preservedInline": break;
|
|
169
158
|
case "inlineWrapper":
|
|
170
|
-
|
|
159
|
+
case "complexField":
|
|
160
|
+
visitParagraphContent(child);
|
|
171
161
|
break;
|
|
172
162
|
default: panic(`Unsupported hyperlink child: ${JSON.stringify(child)}`);
|
|
173
163
|
}
|
|
@@ -218,11 +208,15 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
218
208
|
for (const content of block.content) visitParagraphContent(content);
|
|
219
209
|
break;
|
|
220
210
|
case "table":
|
|
221
|
-
for (const
|
|
222
|
-
|
|
223
|
-
for (const
|
|
224
|
-
|
|
211
|
+
for (const [rowIndex, row] of block.rows.entries()) {
|
|
212
|
+
countMarkersAt(block.bookmarks, rowIndex);
|
|
213
|
+
for (const [cellIndex, cell] of row.cells.entries()) {
|
|
214
|
+
countMarkersAt(row.bookmarks, cellIndex);
|
|
215
|
+
visitBlocks(cell.content);
|
|
216
|
+
}
|
|
217
|
+
countMarkersFrom(row.bookmarks, row.cells.length);
|
|
225
218
|
}
|
|
219
|
+
countMarkersFrom(block.bookmarks, block.rows.length);
|
|
226
220
|
break;
|
|
227
221
|
case "blockSdt":
|
|
228
222
|
case "blockCustomXml":
|
|
@@ -235,6 +229,8 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
235
229
|
case "bookmarkEnd":
|
|
236
230
|
countBoundary(block.id, "end");
|
|
237
231
|
break;
|
|
232
|
+
case "commentRangeStart":
|
|
233
|
+
case "commentRangeEnd":
|
|
238
234
|
case "moveFromRangeStart":
|
|
239
235
|
case "moveFromRangeEnd":
|
|
240
236
|
case "moveToRangeStart":
|
|
@@ -243,8 +239,209 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
243
239
|
}
|
|
244
240
|
};
|
|
245
241
|
visitBlocks(blocks);
|
|
242
|
+
};
|
|
243
|
+
/** The bookmarks of a story's blocks whose one start opens before their one end. */
|
|
244
|
+
const collectPairedBookmarkIds = (blocks) => {
|
|
245
|
+
const counts = /* @__PURE__ */ new Map();
|
|
246
|
+
let position = 0;
|
|
247
|
+
visitBookmarkBoundaries(blocks, (id, type) => {
|
|
248
|
+
const count = counts.get(id) ?? {
|
|
249
|
+
starts: 0,
|
|
250
|
+
ends: 0
|
|
251
|
+
};
|
|
252
|
+
if (type === "start") {
|
|
253
|
+
count.starts += 1;
|
|
254
|
+
count.firstStart ??= position;
|
|
255
|
+
} else {
|
|
256
|
+
count.ends += 1;
|
|
257
|
+
count.firstEnd ??= position;
|
|
258
|
+
}
|
|
259
|
+
position += 1;
|
|
260
|
+
counts.set(id, count);
|
|
261
|
+
});
|
|
246
262
|
return new Set([...counts].flatMap(([id, count]) => count.starts === 1 && count.ends === 1 && count.firstStart !== void 0 && count.firstEnd !== void 0 && count.firstStart < count.firstEnd ? [id] : []));
|
|
247
263
|
};
|
|
264
|
+
/** A membership whose answers a block's conversion read, recorded to check later. */
|
|
265
|
+
var RecordedMembership = class {
|
|
266
|
+
answers = /* @__PURE__ */ new Map();
|
|
267
|
+
source;
|
|
268
|
+
constructor(source) {
|
|
269
|
+
this.source = source;
|
|
270
|
+
}
|
|
271
|
+
has(value) {
|
|
272
|
+
const answer = this.source.has(value);
|
|
273
|
+
this.answers.set(value, answer);
|
|
274
|
+
return answer;
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
const sameIds = (left, right) => left.length === right.length && left.every((value, index) => value === right[index]);
|
|
278
|
+
const setReadsHold = (reads, set) => {
|
|
279
|
+
for (const [value, answer] of reads.answers) if (set.has(value) !== answer) return false;
|
|
280
|
+
return true;
|
|
281
|
+
};
|
|
282
|
+
const storyReadsHold = (reads, state) => (!reads.textBoxGroups.used || reads.textBoxGroups.start === state.textBoxGroups.value) && (reads.hyperlinks.taken === 0 || reads.hyperlinks.start === state.hyperlinks.value) && (reads.noteOccurrences.taken === 0 || reads.noteOccurrences.start === state.noteOccurrences.value) && setReadsHold(reads.pairedBookmarkIds, state.pairedBookmarkIds) && setReadsHold(reads.storyRangedCommentIds, state.storyRangedCommentIds) && sameIds(reads.openCommentIds.start, [...state.openCommentIds]);
|
|
283
|
+
/** Advance the story past a block whose reads hold, as converting it would. */
|
|
284
|
+
const advanceStory = (reads, state) => {
|
|
285
|
+
state.textBoxGroups.value += reads.textBoxGroups.taken;
|
|
286
|
+
state.hyperlinks.value += reads.hyperlinks.taken;
|
|
287
|
+
state.noteOccurrences.value += reads.noteOccurrences.taken;
|
|
288
|
+
state.openCommentIds.clear();
|
|
289
|
+
for (const id of reads.openCommentIds.end) state.openCommentIds.add(id);
|
|
290
|
+
};
|
|
291
|
+
const setReadsOf = (set) => ({ answers: set.answers });
|
|
292
|
+
/**
|
|
293
|
+
* Where the facts kept outside the fields of a block's paragraphs stood, a
|
|
294
|
+
* table's in document order: a converted block is reused only while none of
|
|
295
|
+
* them changed.
|
|
296
|
+
*/
|
|
297
|
+
const blockSourceStamps = (block) => {
|
|
298
|
+
const stamps = [];
|
|
299
|
+
const visit = (blocks) => {
|
|
300
|
+
for (const child of blocks) switch (child.type) {
|
|
301
|
+
case "paragraph":
|
|
302
|
+
stamps.push({
|
|
303
|
+
paragraph: child,
|
|
304
|
+
stamp: paragraphPropertySourceStamp(child)
|
|
305
|
+
});
|
|
306
|
+
break;
|
|
307
|
+
case "table":
|
|
308
|
+
for (const row of child.rows) for (const cell of row.cells) visit(cell.content);
|
|
309
|
+
break;
|
|
310
|
+
case "blockSdt":
|
|
311
|
+
case "blockCustomXml":
|
|
312
|
+
visit(child.content);
|
|
313
|
+
break;
|
|
314
|
+
case "preservedBlock":
|
|
315
|
+
case "bookmarkStart":
|
|
316
|
+
case "bookmarkEnd":
|
|
317
|
+
case "commentRangeStart":
|
|
318
|
+
case "commentRangeEnd":
|
|
319
|
+
case "moveFromRangeStart":
|
|
320
|
+
case "moveFromRangeEnd":
|
|
321
|
+
case "moveToRangeStart":
|
|
322
|
+
case "moveToRangeEnd": break;
|
|
323
|
+
default: return child;
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
visit([block]);
|
|
327
|
+
return stamps;
|
|
328
|
+
};
|
|
329
|
+
/**
|
|
330
|
+
* Whether no fact kept outside the fields of the paragraphs of `block`, the
|
|
331
|
+
* same object the stamps were read from, changed since.
|
|
332
|
+
*/
|
|
333
|
+
const sourceStampsHold = (stamps) => stamps.every(({ paragraph, stamp }) => paragraphPropertySourceStampMatches(paragraph, stamp));
|
|
334
|
+
/**
|
|
335
|
+
* Converted blocks kept across projections of one story.
|
|
336
|
+
*
|
|
337
|
+
* A block is the same object in the next document when an edit left it, so
|
|
338
|
+
* its nodes can be reused where the story facts its conversion read are the
|
|
339
|
+
* same: the counters it drew from, the comments open at its start, and the
|
|
340
|
+
* bookmark and comment ids it asked about. The package inputs (styles,
|
|
341
|
+
* theme, numbering) are part of the cache: a projection over other ones
|
|
342
|
+
* starts the cache over.
|
|
343
|
+
*/
|
|
344
|
+
var ProjectionBlockCache = class {
|
|
345
|
+
salt = newTextBoxGroupSalt();
|
|
346
|
+
/** The story's top-level blocks as the last pass continued them. */
|
|
347
|
+
carriers = new CarrierContinuationCache();
|
|
348
|
+
/** The last story document that passed validation. */
|
|
349
|
+
validated;
|
|
350
|
+
inputs;
|
|
351
|
+
context;
|
|
352
|
+
blocks = /* @__PURE__ */ new WeakMap();
|
|
353
|
+
/** The package context for these inputs, the cache started over if they changed. */
|
|
354
|
+
packageContext(inputs) {
|
|
355
|
+
const current = this.inputs;
|
|
356
|
+
if (this.context !== void 0 && current !== void 0 && current.styles === inputs.styles && current.theme === inputs.theme && current.numbering === inputs.numbering && current.warn === inputs.warn) return this.context;
|
|
357
|
+
this.inputs = inputs;
|
|
358
|
+
this.blocks = /* @__PURE__ */ new WeakMap();
|
|
359
|
+
this.context = {
|
|
360
|
+
styleResolver: createStyleEngine(inputs.styles),
|
|
361
|
+
listRenderings: /* @__PURE__ */ new Map(),
|
|
362
|
+
numbering: inputs.numbering === void 0 ? void 0 : getCachedNumberingMap(inputs.numbering),
|
|
363
|
+
theme: inputs.theme,
|
|
364
|
+
pageBreakRunSourceDescendants: buildPageBreakRunSourceDescendantIndex([]),
|
|
365
|
+
warnPageBreakProjection: pageBreakProjectionWarn(inputs.warn),
|
|
366
|
+
createMark: createMarkInterner(schema)
|
|
367
|
+
};
|
|
368
|
+
return this.context;
|
|
369
|
+
}
|
|
370
|
+
/**
|
|
371
|
+
* The nodes of `paragraph` from the story state it starts at, reused when
|
|
372
|
+
* every story fact its last conversion read still holds, else converted.
|
|
373
|
+
*/
|
|
374
|
+
block(block, state, convert) {
|
|
375
|
+
const known = this.blocks.get(block);
|
|
376
|
+
if (known !== void 0 && sourceStampsHold(known.sourceStamps) && storyReadsHold(known.reads, state)) {
|
|
377
|
+
advanceStory(known.reads, state);
|
|
378
|
+
return known.nodes;
|
|
379
|
+
}
|
|
380
|
+
const context = this.context ?? panic("A block cache converts after its package context");
|
|
381
|
+
const textBoxGroups = {
|
|
382
|
+
start: state.textBoxGroups.value,
|
|
383
|
+
taken: 0
|
|
384
|
+
};
|
|
385
|
+
const hyperlinks = {
|
|
386
|
+
start: state.hyperlinks.value,
|
|
387
|
+
taken: 0
|
|
388
|
+
};
|
|
389
|
+
const noteOccurrences = {
|
|
390
|
+
start: state.noteOccurrences.value,
|
|
391
|
+
taken: 0
|
|
392
|
+
};
|
|
393
|
+
const pairedBookmarkIds = new RecordedMembership(state.pairedBookmarkIds);
|
|
394
|
+
const storyRangedCommentIds = new RecordedMembership(state.storyRangedCommentIds);
|
|
395
|
+
const openStart = [...state.openCommentIds];
|
|
396
|
+
const story = {
|
|
397
|
+
nextTextBoxGroupId: () => {
|
|
398
|
+
textBoxGroups.taken += 1;
|
|
399
|
+
return `${this.salt}:${state.textBoxGroups.value++}`;
|
|
400
|
+
},
|
|
401
|
+
nextHyperlinkInstanceIndex: () => {
|
|
402
|
+
hyperlinks.taken += 1;
|
|
403
|
+
return state.hyperlinks.value++;
|
|
404
|
+
},
|
|
405
|
+
nextNoteReferenceOccurrenceId: () => {
|
|
406
|
+
noteOccurrences.taken += 1;
|
|
407
|
+
return `source-note:${state.noteOccurrences.value++}`;
|
|
408
|
+
},
|
|
409
|
+
pairedBookmarkIds,
|
|
410
|
+
storyRangedCommentIds,
|
|
411
|
+
openCommentIds: state.openCommentIds
|
|
412
|
+
};
|
|
413
|
+
const nodes = convert({
|
|
414
|
+
listRenderings: context.listRenderings,
|
|
415
|
+
numbering: context.numbering,
|
|
416
|
+
theme: context.theme,
|
|
417
|
+
pageBreakRunSourceDescendants: context.pageBreakRunSourceDescendants,
|
|
418
|
+
warnPageBreakProjection: context.warnPageBreakProjection,
|
|
419
|
+
createMark: context.createMark,
|
|
420
|
+
...story
|
|
421
|
+
});
|
|
422
|
+
const saltMark = `"${this.salt}:`;
|
|
423
|
+
const reads = {
|
|
424
|
+
textBoxGroups: {
|
|
425
|
+
...textBoxGroups,
|
|
426
|
+
used: nodes.some((node) => JSON.stringify(node.toJSON()).includes(saltMark))
|
|
427
|
+
},
|
|
428
|
+
hyperlinks,
|
|
429
|
+
noteOccurrences,
|
|
430
|
+
pairedBookmarkIds: setReadsOf(pairedBookmarkIds),
|
|
431
|
+
storyRangedCommentIds: setReadsOf(storyRangedCommentIds),
|
|
432
|
+
openCommentIds: {
|
|
433
|
+
start: openStart,
|
|
434
|
+
end: [...state.openCommentIds]
|
|
435
|
+
}
|
|
436
|
+
};
|
|
437
|
+
this.blocks.set(block, {
|
|
438
|
+
nodes,
|
|
439
|
+
reads,
|
|
440
|
+
sourceStamps: blockSourceStamps(block)
|
|
441
|
+
});
|
|
442
|
+
return nodes;
|
|
443
|
+
}
|
|
444
|
+
};
|
|
248
445
|
/**
|
|
249
446
|
* Convert a Document to a ProseMirror document
|
|
250
447
|
*
|
|
@@ -254,37 +451,53 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
254
451
|
function toProseDoc(document, options) {
|
|
255
452
|
const paragraphs = document.package.document.content;
|
|
256
453
|
const nodes = [];
|
|
257
|
-
const
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
454
|
+
const cache = options?.blockCache;
|
|
455
|
+
const packageInputs = {
|
|
456
|
+
styles: options?.styles ?? document.package.styles,
|
|
457
|
+
theme: options?.theme ?? document.package.theme ?? null,
|
|
458
|
+
numbering: document.package.numbering,
|
|
459
|
+
warn: options?.warn
|
|
460
|
+
};
|
|
461
|
+
const shared = cache?.packageContext(packageInputs);
|
|
462
|
+
shared?.pageBreakRunSourceDescendants.include(paragraphs);
|
|
463
|
+
const styleResolver = shared?.styleResolver ?? createStyleEngine(packageInputs.styles);
|
|
464
|
+
const salt = cache?.salt ?? options?.textBoxGroupSalt ?? newTextBoxGroupSalt();
|
|
465
|
+
const story = {
|
|
466
|
+
textBoxGroups: { value: 0 },
|
|
467
|
+
hyperlinks: { value: 0 },
|
|
468
|
+
noteOccurrences: { value: 0 },
|
|
469
|
+
pairedBookmarkIds: collectPairedBookmarkIds(paragraphs),
|
|
272
470
|
storyRangedCommentIds: rangedCommentIds(paragraphs),
|
|
273
|
-
openCommentIds: /* @__PURE__ */ new Set()
|
|
274
|
-
|
|
275
|
-
|
|
471
|
+
openCommentIds: /* @__PURE__ */ new Set()
|
|
472
|
+
};
|
|
473
|
+
const conversionContext = {
|
|
474
|
+
listRenderings: shared?.listRenderings ?? /* @__PURE__ */ new Map(),
|
|
475
|
+
numbering: shared?.numbering ?? (packageInputs.numbering === void 0 ? void 0 : getCachedNumberingMap(packageInputs.numbering)),
|
|
476
|
+
theme: shared?.theme ?? packageInputs.theme,
|
|
477
|
+
nextTextBoxGroupId: textBoxGroupIdsFrom(salt, story.textBoxGroups),
|
|
478
|
+
nextHyperlinkInstanceIndex: () => story.hyperlinks.value++,
|
|
479
|
+
nextNoteReferenceOccurrenceId: () => `source-note:${story.noteOccurrences.value++}`,
|
|
480
|
+
pairedBookmarkIds: story.pairedBookmarkIds,
|
|
481
|
+
pageBreakRunSourceDescendants: shared?.pageBreakRunSourceDescendants ?? buildPageBreakRunSourceDescendantIndex(paragraphs),
|
|
482
|
+
storyRangedCommentIds: story.storyRangedCommentIds,
|
|
483
|
+
openCommentIds: story.openCommentIds,
|
|
484
|
+
warnPageBreakProjection: shared?.warnPageBreakProjection ?? pageBreakProjectionWarn(options?.warn),
|
|
485
|
+
createMark: shared?.createMark ?? createMarkInterner(schema)
|
|
276
486
|
};
|
|
277
487
|
const convertBodyBlocks = (blocks) => {
|
|
278
488
|
const out = [];
|
|
279
489
|
for (const block of blocks) switch (block.type) {
|
|
280
490
|
case "paragraph":
|
|
281
|
-
out.push(...convertParagraphWithTextBoxes(block, styleResolver, {
|
|
282
|
-
textBoxGroupId: nextTextBoxGroupId(),
|
|
491
|
+
out.push(...cache === void 0 ? convertParagraphWithTextBoxes(block, styleResolver, {
|
|
492
|
+
textBoxGroupId: conversionContext.nextTextBoxGroupId(),
|
|
283
493
|
context: conversionContext
|
|
284
|
-
}))
|
|
494
|
+
}) : cache.block(block, story, (context) => convertParagraphWithTextBoxes(block, styleResolver, {
|
|
495
|
+
textBoxGroupId: context.nextTextBoxGroupId(),
|
|
496
|
+
context
|
|
497
|
+
})));
|
|
285
498
|
break;
|
|
286
499
|
case "table":
|
|
287
|
-
out.push(convertTable(block, styleResolver, conversionContext));
|
|
500
|
+
out.push(...cache === void 0 ? [convertTable(block, styleResolver, conversionContext)] : cache.block(block, story, (context) => [convertTable(block, styleResolver, context)]));
|
|
288
501
|
break;
|
|
289
502
|
case "blockSdt":
|
|
290
503
|
out.push(convertBlockSdt(block, convertBodyBlocks));
|
|
@@ -299,6 +512,10 @@ function toProseDoc(document, options) {
|
|
|
299
512
|
case "bookmarkEnd":
|
|
300
513
|
out.push(convertBlockBookmarkBoundary(block));
|
|
301
514
|
break;
|
|
515
|
+
case "commentRangeStart":
|
|
516
|
+
case "commentRangeEnd":
|
|
517
|
+
out.push(convertBlockCommentRangeBoundary(block, conversionContext.openCommentIds));
|
|
518
|
+
break;
|
|
302
519
|
case "moveFromRangeStart":
|
|
303
520
|
case "moveFromRangeEnd":
|
|
304
521
|
case "moveToRangeStart":
|
|
@@ -311,6 +528,8 @@ function toProseDoc(document, options) {
|
|
|
311
528
|
};
|
|
312
529
|
nodes.push(...convertBodyBlocks(paragraphs));
|
|
313
530
|
if (nodes.length === 0) nodes.push(schema.node("paragraph", {}, []));
|
|
531
|
+
const suggestedComments = suggestedCommentIdsOf(document);
|
|
532
|
+
if (suggestedComments.size > 0) for (const [index, node] of nodes.entries()) nodes[index] = withSuggestedCommentMarks(node, suggestedComments);
|
|
314
533
|
const finalSectionStart = document.package.document.sections?.at(-1)?.properties.sectionStart ?? null;
|
|
315
534
|
const adjustLineHeightInTable = document.package.settings?.adjustLineHeightInTable === true;
|
|
316
535
|
const doNotUseIndentAsNumberingTabStop = document.package.settings?.doNotUseIndentAsNumberingTabStop === true;
|
|
@@ -319,10 +538,48 @@ function toProseDoc(document, options) {
|
|
|
319
538
|
_finalSectionStart: finalSectionStart,
|
|
320
539
|
_adjustLineHeightInTable: adjustLineHeightInTable,
|
|
321
540
|
_doNotUseIndentAsNumberingTabStop: doNotUseIndentAsNumberingTabStop
|
|
322
|
-
}, [...continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks(nodes)]));
|
|
323
|
-
|
|
541
|
+
}, [...cache === void 0 ? continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks(nodes) : continueSourceCarrierIdentitiesKeeping(nodes, cache.carriers)]));
|
|
542
|
+
const invalid = "Document conversion produced an invalid ProseMirror document";
|
|
543
|
+
if (cache === void 0) assertValidProseMirrorDocument(pmDoc, invalid);
|
|
544
|
+
else cache.validated = assertValidProseMirrorDocumentKeeping(pmDoc, invalid, cache.validated);
|
|
324
545
|
return pmDoc;
|
|
325
546
|
}
|
|
547
|
+
/** The comments pending suggestions propose, by comment id. */
|
|
548
|
+
const suggestedCommentIdsOf = (document) => {
|
|
549
|
+
const suggested = /* @__PURE__ */ new Map();
|
|
550
|
+
for (const comment of document.package.document.comments ?? []) if (comment.suggestionId !== void 0) suggested.set(comment.id, comment.suggestionId);
|
|
551
|
+
return suggested;
|
|
552
|
+
};
|
|
553
|
+
/**
|
|
554
|
+
* Give the comment marks of a proposed comment the suggestion that proposes
|
|
555
|
+
* it, so the editor lists, accepts and rejects the comment with it. Nodes
|
|
556
|
+
* with nothing to stamp are returned as they are.
|
|
557
|
+
*/
|
|
558
|
+
const withSuggestedCommentMarks = (node, suggested) => {
|
|
559
|
+
let marks = node.marks;
|
|
560
|
+
for (const mark of node.marks) {
|
|
561
|
+
if (mark.type.name !== "comment") continue;
|
|
562
|
+
const suggestionId = suggested.get(mark.attrs["commentId"]);
|
|
563
|
+
if (suggestionId === void 0 || mark.attrs["suggestionId"] === suggestionId) continue;
|
|
564
|
+
marks = node.type.schema.mark(mark.type, {
|
|
565
|
+
...mark.attrs,
|
|
566
|
+
suggestionId
|
|
567
|
+
}).addToSet(mark.removeFromSet(marks));
|
|
568
|
+
}
|
|
569
|
+
if (node.childCount === 0) return marks === node.marks ? node : node.mark(marks);
|
|
570
|
+
const children = [];
|
|
571
|
+
let changed = marks !== node.marks;
|
|
572
|
+
for (let index = 0; index < node.childCount; index += 1) {
|
|
573
|
+
const child = node.child(index);
|
|
574
|
+
const stamped = withSuggestedCommentMarks(child, suggested);
|
|
575
|
+
changed ||= stamped !== child;
|
|
576
|
+
children.push(stamped);
|
|
577
|
+
}
|
|
578
|
+
return changed ? recreateProseNodeWithParagraphPropertySource(node, {
|
|
579
|
+
content: children,
|
|
580
|
+
marks
|
|
581
|
+
}) : node;
|
|
582
|
+
};
|
|
326
583
|
/**
|
|
327
584
|
* Carry a block folio does not model into the editor as a zero-width node.
|
|
328
585
|
*
|
|
@@ -347,6 +604,16 @@ function convertPreservedBlock(block) {
|
|
|
347
604
|
function convertBlockBookmarkBoundary(block) {
|
|
348
605
|
return schema.node("blockBookmarkBoundary", bookmarkBoundaryAttrsFromMarker(block));
|
|
349
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* A comment range marker standing between blocks, kept between the same two.
|
|
609
|
+
* It opens or closes the comment for the text that follows, as the same
|
|
610
|
+
* marker inside a paragraph does, so the comment's mark covers that text.
|
|
611
|
+
*/
|
|
612
|
+
function convertBlockCommentRangeBoundary(block, openCommentIds) {
|
|
613
|
+
if (block.type === "commentRangeStart") openCommentIds.add(block.id);
|
|
614
|
+
else openCommentIds.delete(block.id);
|
|
615
|
+
return schema.node(BLOCK_COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: block });
|
|
616
|
+
}
|
|
350
617
|
/** A move range marker standing between blocks, kept between the same two. */
|
|
351
618
|
function convertBlockMoveRangeBoundary(block) {
|
|
352
619
|
return schema.node(BLOCK_MOVE_RANGE_BOUNDARY_NODE_NAME, { marker: block });
|
|
@@ -544,7 +811,8 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
544
811
|
const paragraphMarkOverrides = getParagraphMarkSuppressionOverrides({
|
|
545
812
|
directFormatting: formatting,
|
|
546
813
|
paragraphMarkFormatting: inheritableParagraphRunFormatting,
|
|
547
|
-
suppressedFormatting
|
|
814
|
+
suppressedFormatting,
|
|
815
|
+
characterStyleFormatting: formatting?.styleId === void 0 ? void 0 : styleResolver?.getRunStyleOwnProperties(formatting.styleId) ?? void 0
|
|
548
816
|
}) ?? (inheritableParagraphRunFormatting ? {} : void 0);
|
|
549
817
|
return {
|
|
550
818
|
formatting: suppressedFormatting,
|
|
@@ -701,7 +969,10 @@ function applyCommentMarks(nodes, commentIds) {
|
|
|
701
969
|
});
|
|
702
970
|
}
|
|
703
971
|
function anchorPointComment(nodes, commentId) {
|
|
704
|
-
const commentMark = schema.marks["comment"]?.create({
|
|
972
|
+
const commentMark = schema.marks["comment"]?.create({
|
|
973
|
+
commentId,
|
|
974
|
+
point: true
|
|
975
|
+
});
|
|
705
976
|
if (!commentMark) return;
|
|
706
977
|
for (let index = nodes.length - 1; index >= 0; index--) {
|
|
707
978
|
const node = nodes[index];
|
|
@@ -742,6 +1013,26 @@ const withTrackedRunMark = (node, mark, ancestor) => {
|
|
|
742
1013
|
if (canCarryTrackedRunMark(node)) return node.mark(mark.addToSet(node.marks));
|
|
743
1014
|
return node;
|
|
744
1015
|
};
|
|
1016
|
+
/** A revision's info as the review surface reads it: a suggestion's says so. */
|
|
1017
|
+
const suggestedRevisionInfo = (info) => info.suggestionId === void 0 ? info : {
|
|
1018
|
+
...info,
|
|
1019
|
+
provenance: "suggested"
|
|
1020
|
+
};
|
|
1021
|
+
/**
|
|
1022
|
+
* The mark a run's property changes ride. Changes that all belong to one
|
|
1023
|
+
* pending suggestion show as that suggestion, as tracked text does.
|
|
1024
|
+
*/
|
|
1025
|
+
const runPropertyChangeMark = (changes) => {
|
|
1026
|
+
const suggestionIds = new Set(changes.map(({ info }) => info.suggestionId));
|
|
1027
|
+
const [suggestionId] = suggestionIds;
|
|
1028
|
+
return schema.mark("runPropertyChange", {
|
|
1029
|
+
changes: [...changes],
|
|
1030
|
+
...suggestionIds.size === 1 && suggestionId !== void 0 ? {
|
|
1031
|
+
provenance: "suggested",
|
|
1032
|
+
suggestionId
|
|
1033
|
+
} : {}
|
|
1034
|
+
});
|
|
1035
|
+
};
|
|
745
1036
|
function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runScope, runFormattingResolvers, styleResolver, moveKind, textBoxAnchors, wrappedBy, openCommentIds, options = {}) {
|
|
746
1037
|
const nodes = [];
|
|
747
1038
|
const preserveParentBoundaryOwnership = options.preserveParentBoundaryOwnership ?? true;
|
|
@@ -842,6 +1133,10 @@ function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runS
|
|
|
842
1133
|
date: change.info.date ?? null,
|
|
843
1134
|
utcDate: change.info.utcDate?.value ?? null,
|
|
844
1135
|
initials: change.info.initials ?? null,
|
|
1136
|
+
...change.info.suggestionId === void 0 ? {} : {
|
|
1137
|
+
provenance: "suggested",
|
|
1138
|
+
suggestionId: change.info.suggestionId
|
|
1139
|
+
},
|
|
845
1140
|
moveKind,
|
|
846
1141
|
_docxOuterWrapperCount: wrappedBy.length,
|
|
847
1142
|
_docxResolutionJoins: change.resolutionJoins ?? null,
|
|
@@ -878,7 +1173,11 @@ function paragraphFormattingToAttrs(paragraph, styleResolver, tableParagraphOver
|
|
|
878
1173
|
if (formatting?.numPrFromStyle) attrs.numPrFromStyle = paragraphNumberingAttr(formatting.numPrFromStyle);
|
|
879
1174
|
if (paragraph.listRendering && formatting?.numPr?.kind !== "none") Object.assign(attrs, CLEARED_LIST_RENDERING_ATTRS, listRenderingAttrPatch(paragraph.listRendering));
|
|
880
1175
|
if (formatting) attrs._originalFormatting = formatting;
|
|
881
|
-
if (paragraph.propertyChanges && paragraph.propertyChanges.length > 0) attrs._propertyChanges = paragraph.propertyChanges.map(({ previousFormatting, ...
|
|
1176
|
+
if (paragraph.propertyChanges && paragraph.propertyChanges.length > 0) attrs._propertyChanges = paragraph.propertyChanges.map(({ previousFormatting, ...modelChange }) => {
|
|
1177
|
+
const change = {
|
|
1178
|
+
...modelChange,
|
|
1179
|
+
info: suggestedRevisionInfo(modelChange.info)
|
|
1180
|
+
};
|
|
882
1181
|
if (previousFormatting === void 0) return change;
|
|
883
1182
|
const { numPr, numPrFromStyle, ...rest } = previousFormatting;
|
|
884
1183
|
return {
|
|
@@ -891,7 +1190,10 @@ function paragraphFormattingToAttrs(paragraph, styleResolver, tableParagraphOver
|
|
|
891
1190
|
};
|
|
892
1191
|
});
|
|
893
1192
|
if (paragraph.preservedAttributes && paragraph.preservedAttributes.length > 0) attrs._preservedAttributes = paragraph.preservedAttributes;
|
|
894
|
-
if (paragraph.pPrMark) attrs.pPrMark = paragraph.pPrMark
|
|
1193
|
+
if (paragraph.pPrMark) attrs.pPrMark = paragraph.pPrMark.info.suggestionId === void 0 ? paragraph.pPrMark : {
|
|
1194
|
+
...paragraph.pPrMark,
|
|
1195
|
+
info: suggestedRevisionInfo(paragraph.pPrMark.info)
|
|
1196
|
+
};
|
|
895
1197
|
const set = (key, val) => {
|
|
896
1198
|
if (val !== void 0) attrs[key] = val;
|
|
897
1199
|
};
|
|
@@ -1377,6 +1679,10 @@ function convertTableCell({ cell, styleResolver, context, isHeader, gridWidthPer
|
|
|
1377
1679
|
case "bookmarkEnd":
|
|
1378
1680
|
nodes.push(convertBlockBookmarkBoundary(block));
|
|
1379
1681
|
break;
|
|
1682
|
+
case "commentRangeStart":
|
|
1683
|
+
case "commentRangeEnd":
|
|
1684
|
+
nodes.push(convertBlockCommentRangeBoundary(block, context.openCommentIds));
|
|
1685
|
+
break;
|
|
1380
1686
|
case "moveFromRangeStart":
|
|
1381
1687
|
case "moveFromRangeEnd":
|
|
1382
1688
|
case "moveToRangeStart":
|
|
@@ -1535,7 +1841,7 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1535
1841
|
const displayText = getInlineDisplayText(schema.node("paragraph", null, inlineNodes));
|
|
1536
1842
|
const emptyResultRuns = displayText === "" && resultRuns.length > 0 && (field.type === "complexField" || field.content.length === resultRuns.length) && resultRuns.every((run) => run.content.every((item) => item.type === "text" && item.text === "")) ? resultRuns : void 0;
|
|
1537
1843
|
const resultPropertyChanges = emptyResultRuns ? emptyFieldRunPropertyChanges(emptyResultRuns) : fieldPropertyChanges;
|
|
1538
|
-
if (!createStructuredField && resultPropertyChanges && resultPropertyChanges.length > 0) marks.push(
|
|
1844
|
+
if (!createStructuredField && resultPropertyChanges && resultPropertyChanges.length > 0) marks.push(runPropertyChangeMark(resultPropertyChanges));
|
|
1539
1845
|
const fieldNode = schema.node(createStructuredField ? "structuredField" : "field", {
|
|
1540
1846
|
fieldType: field.fieldType,
|
|
1541
1847
|
instruction: field.instruction,
|
|
@@ -1735,7 +2041,7 @@ function convertRun(run, resolvedStyleFormatting, runScope, styleResolver, textB
|
|
|
1735
2041
|
styleResolver,
|
|
1736
2042
|
createMark: runScope.createMark
|
|
1737
2043
|
});
|
|
1738
|
-
if (run.propertyChanges && run.propertyChanges.length > 0) marks.push(
|
|
2044
|
+
if (run.propertyChanges && run.propertyChanges.length > 0) marks.push(runPropertyChangeMark(run.propertyChanges));
|
|
1739
2045
|
const identity = runIdentityMark(run, runScope.nextRunIdentityId);
|
|
1740
2046
|
if (identity) marks.push(identity);
|
|
1741
2047
|
for (const content of run.content) {
|
|
@@ -1969,7 +2275,7 @@ const RUN_FORMATTING_INFERENCE = {
|
|
|
1969
2275
|
italic: "ordinary-toggle",
|
|
1970
2276
|
italicCs: "structural",
|
|
1971
2277
|
underline: "underline",
|
|
1972
|
-
strike: "
|
|
2278
|
+
strike: "strike",
|
|
1973
2279
|
doubleStrike: "double-strike",
|
|
1974
2280
|
vertAlign: "visible-value",
|
|
1975
2281
|
smallCaps: "visible-boolean",
|
|
@@ -2042,6 +2348,10 @@ const canReconstructAuthoredRunFormatting = ({ directFormatting, effectiveFormat
|
|
|
2042
2348
|
case "underline":
|
|
2043
2349
|
if (typeof directValue === "object" && directValue !== null && Reflect.get(directValue, "style") !== "none" && Reflect.get(directValue, "color") === void 0 && sameFormattingValue(directValue, effectiveValue) && !sameFormattingValue(directValue, inheritedValue)) continue;
|
|
2044
2350
|
return false;
|
|
2351
|
+
case "strike":
|
|
2352
|
+
if (directValue === false) continue;
|
|
2353
|
+
if (directValue === true && inheritedFormatting?.strike !== true && inheritedFormatting?.doubleStrike !== true && effectiveFormatting?.doubleStrike !== true) continue;
|
|
2354
|
+
return false;
|
|
2045
2355
|
case "double-strike":
|
|
2046
2356
|
if (directValue === false) continue;
|
|
2047
2357
|
if (directValue === true && inheritedFormatting?.strike !== true && inheritedFormatting?.doubleStrike !== true) continue;
|
|
@@ -2456,7 +2766,7 @@ function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver,
|
|
|
2456
2766
|
styleResolver,
|
|
2457
2767
|
createMark: runScope.createMark
|
|
2458
2768
|
});
|
|
2459
|
-
if (child.propertyChanges && child.propertyChanges.length > 0) runMarks.push(
|
|
2769
|
+
if (child.propertyChanges && child.propertyChanges.length > 0) runMarks.push(runPropertyChangeMark(child.propertyChanges));
|
|
2460
2770
|
const identity = runIdentityMark(child, runScope.nextRunIdentityId);
|
|
2461
2771
|
if (identity) runMarks.push(identity);
|
|
2462
2772
|
const allMarks = [...runMarks, linkMark];
|
|
@@ -2471,6 +2781,19 @@ function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver,
|
|
|
2471
2781
|
}));
|
|
2472
2782
|
break;
|
|
2473
2783
|
}
|
|
2784
|
+
case "complexField": {
|
|
2785
|
+
const fieldNode = convertField(child, {
|
|
2786
|
+
getInheritedRunFormatting,
|
|
2787
|
+
styleResolver,
|
|
2788
|
+
nextHyperlinkInstanceIndex: () => panic("A complex field result holds no hyperlink."),
|
|
2789
|
+
runScope,
|
|
2790
|
+
textBoxAnchors,
|
|
2791
|
+
openCommentIds
|
|
2792
|
+
});
|
|
2793
|
+
if (fieldNode) childNodes.push(fieldNode.mark(linkMark.addToSet(fieldNode.marks)));
|
|
2794
|
+
commentsAlreadyApplied = true;
|
|
2795
|
+
break;
|
|
2796
|
+
}
|
|
2474
2797
|
}
|
|
2475
2798
|
const wrappedNodes = withInlineWrapperMark(childNodes, stack, {
|
|
2476
2799
|
hyperlinkIndex,
|
|
@@ -2803,17 +3126,46 @@ function convertTextBox(textBox, styleResolver, options) {
|
|
|
2803
3126
|
...options.context,
|
|
2804
3127
|
openCommentIds: /* @__PURE__ */ new Set()
|
|
2805
3128
|
};
|
|
2806
|
-
const
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
3129
|
+
const convertBoxBlocks = (blocks) => {
|
|
3130
|
+
const nodes = [];
|
|
3131
|
+
for (const block of blocks) switch (block.type) {
|
|
3132
|
+
case "paragraph":
|
|
3133
|
+
nodes.push(...convertParagraphWithTextBoxes(block, styleResolver, {
|
|
3134
|
+
textBoxGroupId: textBoxContext.nextTextBoxGroupId(),
|
|
3135
|
+
context: textBoxContext
|
|
3136
|
+
}));
|
|
3137
|
+
break;
|
|
3138
|
+
case "table":
|
|
3139
|
+
nodes.push(convertTable(block, styleResolver, textBoxContext));
|
|
3140
|
+
break;
|
|
3141
|
+
case "blockSdt":
|
|
3142
|
+
nodes.push(convertBlockSdt(block, convertBoxBlocks));
|
|
3143
|
+
break;
|
|
3144
|
+
case "blockCustomXml":
|
|
3145
|
+
nodes.push(convertBlockCustomXml(block, convertBoxBlocks));
|
|
3146
|
+
break;
|
|
3147
|
+
case "preservedBlock":
|
|
3148
|
+
nodes.push(convertPreservedBlock(block));
|
|
3149
|
+
break;
|
|
3150
|
+
case "bookmarkStart":
|
|
3151
|
+
case "bookmarkEnd":
|
|
3152
|
+
nodes.push(convertBlockBookmarkBoundary(block));
|
|
3153
|
+
break;
|
|
3154
|
+
case "commentRangeStart":
|
|
3155
|
+
case "commentRangeEnd":
|
|
3156
|
+
nodes.push(convertBlockCommentRangeBoundary(block, textBoxContext.openCommentIds));
|
|
3157
|
+
break;
|
|
3158
|
+
case "moveFromRangeStart":
|
|
3159
|
+
case "moveFromRangeEnd":
|
|
3160
|
+
case "moveToRangeStart":
|
|
3161
|
+
case "moveToRangeEnd":
|
|
3162
|
+
nodes.push(convertBlockMoveRangeBoundary(block));
|
|
3163
|
+
break;
|
|
3164
|
+
default: return block;
|
|
2814
3165
|
}
|
|
2815
|
-
|
|
2816
|
-
}
|
|
3166
|
+
return nodes;
|
|
3167
|
+
};
|
|
3168
|
+
const contentNodes = convertBoxBlocks(textBox.content);
|
|
2817
3169
|
if (contentNodes.length === 0) contentNodes.push(schema.node("paragraph", {}, []));
|
|
2818
3170
|
const wrapType = textBox.wrap?.type;
|
|
2819
3171
|
const wrapText = textBox.wrap?.wrapText;
|
|
@@ -2972,6 +3324,10 @@ function headerFooterToProseDoc(content, options) {
|
|
|
2972
3324
|
case "bookmarkEnd":
|
|
2973
3325
|
out.push(convertBlockBookmarkBoundary(block));
|
|
2974
3326
|
break;
|
|
3327
|
+
case "commentRangeStart":
|
|
3328
|
+
case "commentRangeEnd":
|
|
3329
|
+
out.push(convertBlockCommentRangeBoundary(block, conversionContext.openCommentIds));
|
|
3330
|
+
break;
|
|
2975
3331
|
case "moveFromRangeStart":
|
|
2976
3332
|
case "moveFromRangeEnd":
|
|
2977
3333
|
case "moveToRangeStart":
|
|
@@ -2997,4 +3353,4 @@ function footnoteToProseDoc(content, options) {
|
|
|
2997
3353
|
function createEmptyDoc() {
|
|
2998
3354
|
return schema.node("doc", null, [schema.node("paragraph", {}, [])]);
|
|
2999
3355
|
}
|
|
3000
|
-
export { collectPairedBookmarkIds, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, hostParagraphAttrs, standaloneTableCellToProseMirror, toProseDoc };
|
|
3356
|
+
export { ProjectionBlockCache, collectPairedBookmarkIds, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, hostParagraphAttrs, standaloneTableCellToProseMirror, toProseDoc, visitBookmarkBoundaries };
|