@stll/folio-core 0.62.0 → 0.63.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/dist/ai-edits/apply.d.ts +40 -10
- package/dist/ai-edits/apply.js +563 -219
- package/dist/ai-edits/batch-claims.d.ts +13 -4
- package/dist/ai-edits/batch-claims.js +6 -6
- package/dist/ai-edits/block-identity.d.ts +3 -4
- package/dist/ai-edits/block-identity.js +15 -1
- package/dist/ai-edits/blockRange.d.ts +7 -7
- package/dist/ai-edits/blockRange.js +2 -1
- package/dist/ai-edits/character-boundaries.d.ts +5 -6
- package/dist/ai-edits/clean-text.d.ts +8 -8
- package/dist/ai-edits/comment-lifecycle.d.ts +15 -6
- package/dist/ai-edits/comment-lifecycle.js +74 -23
- package/dist/ai-edits/headless.d.ts +39 -37
- package/dist/ai-edits/headless.js +147 -47
- package/dist/ai-edits/index.d.ts +2 -1
- package/dist/ai-edits/index.js +2 -1
- package/dist/ai-edits/inline-emphasis.d.ts +5 -6
- package/dist/ai-edits/minimal-replacement.d.ts +12 -13
- package/dist/ai-edits/newListNumbering.d.ts +16 -3
- package/dist/ai-edits/newListNumbering.js +97 -34
- package/dist/ai-edits/note-references.d.ts +14 -14
- package/dist/ai-edits/note-story-inventory.d.ts +2 -2
- package/dist/ai-edits/pending-suggestions.d.ts +8 -8
- package/dist/ai-edits/pending-suggestions.js +5 -1
- package/dist/ai-edits/read.d.ts +10 -11
- package/dist/ai-edits/read.js +6 -0
- package/dist/ai-edits/referenceClassification.d.ts +2 -2
- package/dist/ai-edits/removed-blocks.d.ts +20 -0
- package/dist/ai-edits/removed-blocks.js +69 -0
- package/dist/ai-edits/result-validation.d.ts +4 -5
- package/dist/ai-edits/result-validation.js +4 -3
- package/dist/ai-edits/revisionStretches.d.ts +3 -3
- package/dist/ai-edits/revisionStretches.js +17 -0
- package/dist/ai-edits/scoped-reading.d.ts +3 -4
- package/dist/ai-edits/snapshot.d.ts +24 -23
- package/dist/ai-edits/snapshot.js +44 -30
- package/dist/ai-edits/table-cell-mutations.d.ts +6 -6
- package/dist/ai-edits/table-cell-mutations.js +7 -4
- package/dist/ai-edits/table-geometry.d.ts +6 -6
- package/dist/ai-edits/table-mutation-plan.d.ts +5 -5
- package/dist/ai-edits/table-mutation-plan.js +1 -4
- package/dist/ai-edits/table-row-column-mutations.d.ts +16 -16
- package/dist/ai-edits/table-targets.d.ts +8 -9
- package/dist/ai-edits/table-template.d.ts +6 -6
- package/dist/ai-edits/types.d.ts +48 -44
- package/dist/ai-edits/word-diff.d.ts +12 -13
- package/dist/ai-edits/word-diff.js +23 -21
- package/dist/ai-suggestions/apply.d.ts +3 -3
- package/dist/ai-suggestions/apply.js +0 -12
- package/dist/ai-suggestions/conflict.d.ts +4 -5
- package/dist/ai-suggestions/conflict.js +3 -1
- package/dist/ai-suggestions/text-positions.d.ts +3 -4
- package/dist/ai-suggestions/types.d.ts +13 -14
- package/dist/compare/column-alignment.d.ts +4 -5
- package/dist/compare/compare.d.ts +12 -12
- package/dist/compare/compare.js +2 -1
- package/dist/compare/content-alignment.d.ts +16 -16
- package/dist/compare/content-alignment.js +29 -25
- package/dist/compare/content-types.d.ts +23 -24
- package/dist/compare/content.d.ts +23 -23
- package/dist/compare/formatting.d.ts +2 -2
- package/dist/compare/import-style-closure.d.ts +2 -2
- package/dist/compare/inline-atom-resources.d.ts +2 -3
- package/dist/compare/inline-atoms.d.ts +6 -7
- package/dist/compare/inline-provenance.d.ts +6 -7
- package/dist/compare/inline-provenance.js +22 -20
- package/dist/compare/inserted-resource-snapshot.d.ts +3 -3
- package/dist/compare/plan.d.ts +5 -6
- package/dist/compare/plan.js +5 -6
- package/dist/compare/reproducible-package.d.ts +2 -3
- package/dist/compare/reproducible-package.js +1 -1
- package/dist/compare/scenario.d.ts +9 -9
- package/dist/compare/section-boundary-properties.d.ts +6 -6
- package/dist/compare/section-boundary-properties.js +4 -4
- package/dist/compare/style-resources.d.ts +5 -6
- package/dist/compare/types.d.ts +21 -21
- package/dist/compare/verification.d.ts +11 -11
- package/dist/content-controls/checkboxDisplay.d.ts +2 -2
- package/dist/content-controls/checkboxDisplay.js +2 -1
- package/dist/content-controls/errors.d.ts +4 -4
- package/dist/content-controls/findContentControls.d.ts +7 -8
- package/dist/content-controls/mutateContentControls.d.ts +17 -6
- package/dist/content-controls/mutateContentControls.js +3 -2
- package/dist/controller/activeEditorStory.d.ts +4 -5
- package/dist/controller/canonicalClipboard.d.ts +3 -3
- package/dist/controller/canonicalClipboard.js +3 -1
- package/dist/controller/canonicalClipboardResources.d.ts +3 -3
- package/dist/controller/canonicalClipboardResources.js +3 -2
- package/dist/controller/canonicalComments.d.ts +5 -5
- package/dist/controller/canonicalComposition.d.ts +2 -2
- package/dist/controller/canonicalComposition.js +11 -14
- package/dist/controller/canonicalInlineProjection.d.ts +8 -7
- package/dist/controller/canonicalInlineProjection.js +68 -37
- package/dist/controller/canonicalInput.d.ts +3 -3
- package/dist/controller/canonicalInput.js +1 -3
- package/dist/controller/canonicalInputTimer.d.ts +5 -6
- package/dist/controller/canonicalListRendering.d.ts +2 -3
- package/dist/controller/canonicalOperations.d.ts +6 -6
- package/dist/controller/canonicalPublicOperations.d.ts +13 -13
- package/dist/controller/canonicalPublicOperations.js +12 -14
- package/dist/controller/canonicalReview.d.ts +2 -2
- package/dist/controller/canonicalSelection.d.ts +2 -2
- package/dist/controller/canonicalSelection.js +15 -0
- package/dist/controller/canonicalSession.d.ts +22 -14
- package/dist/controller/canonicalSession.js +229 -42
- package/dist/controller/canonicalStoryEditor.d.ts +2 -2
- package/dist/controller/canonicalStructure.d.ts +3 -3
- package/dist/controller/canonicalStructure.js +144 -21
- package/dist/controller/canonicalTocSelection.d.ts +2 -2
- package/dist/controller/collaborationModules.d.ts +2 -3
- package/dist/controller/committedLayoutDiff.d.ts +4 -5
- package/dist/controller/contentControlWidgetController.d.ts +7 -8
- package/dist/controller/folioEditor.d.ts +6 -6
- package/dist/controller/folioEditorEvents.d.ts +7 -8
- package/dist/controller/fontReadiness.d.ts +12 -12
- package/dist/controller/fontReadiness.js +123 -31
- package/dist/controller/headerFooterEditorManager.d.ts +9 -10
- package/dist/controller/headerFooterEditorManager.js +3 -10
- package/dist/controller/hiddenEditorApi.d.ts +5 -5
- package/dist/controller/hiddenEditorManager.d.ts +13 -13
- package/dist/controller/hiddenEditorManager.js +2 -0
- package/dist/controller/hyphenationReadiness.d.ts +4 -5
- package/dist/controller/hyphenationReadiness.js +0 -1
- package/dist/controller/latestRequestGate.d.ts +3 -4
- package/dist/controller/layoutPipeline.d.ts +7 -8
- package/dist/controller/layoutPipeline.js +16 -5
- package/dist/controller/layoutRunOptions.d.ts +4 -5
- package/dist/controller/layoutScheduler.d.ts +8 -9
- package/dist/controller/layoutSession.d.ts +7 -7
- package/dist/controller/noteEditorManager.d.ts +7 -7
- package/dist/controller/noteEditorManager.js +0 -1
- package/dist/controller/readOnlySelection.d.ts +12 -0
- package/dist/controller/readOnlySelection.js +62 -0
- package/dist/display-list/build/buildContext.d.ts +8 -6
- package/dist/display-list/build/buildDisplayList.d.ts +6 -6
- package/dist/display-list/build/buildDisplayList.js +20 -2
- package/dist/display-list/build/colors.d.ts +6 -7
- package/dist/display-list/build/commentAnnotations.d.ts +3 -4
- package/dist/display-list/build/floatingImages.d.ts +5 -6
- package/dist/display-list/build/fontTable.d.ts +4 -5
- package/dist/display-list/build/fontTable.js +2 -1
- package/dist/display-list/build/furniture.d.ts +7 -6
- package/dist/display-list/build/furniture.js +1 -0
- package/dist/display-list/build/glyphs.d.ts +7 -7
- package/dist/display-list/build/glyphs.js +17 -26
- package/dist/display-list/build/headerFooterPrimitives.d.ts +4 -5
- package/dist/display-list/build/headerFooterPrimitives.js +5 -1
- package/dist/display-list/build/imagePrimitives.d.ts +5 -5
- package/dist/display-list/build/imagePrimitives.js +0 -10
- package/dist/display-list/build/pageBorderPrimitives.d.ts +4 -5
- package/dist/display-list/build/pageBorderPrimitives.js +8 -11
- package/dist/display-list/build/pageFurniture.d.ts +6 -7
- package/dist/display-list/build/pageFurniture.js +5 -1
- package/dist/display-list/build/paragraphPrimitives.d.ts +5 -4
- package/dist/display-list/build/paragraphPrimitives.js +138 -108
- package/dist/display-list/build/previewPrimitives.d.ts +2 -3
- package/dist/display-list/build/previewPrimitives.js +38 -9
- package/dist/display-list/build/regions.d.ts +5 -5
- package/dist/display-list/build/storyPrimitives.d.ts +4 -4
- package/dist/display-list/build/strokes.d.ts +10 -10
- package/dist/display-list/build/tablePrimitives.d.ts +5 -5
- package/dist/display-list/build/tablePrimitives.js +15 -2
- package/dist/display-list/build/textBoxPrimitives.d.ts +3 -4
- package/dist/display-list/build/textBoxPrimitives.js +4 -0
- package/dist/display-list/build/textDecorations.d.ts +10 -11
- package/dist/display-list/build/unsupported.d.ts +4 -5
- package/dist/display-list/build/watermarkPrimitives.d.ts +5 -4
- package/dist/display-list/build/watermarkPrimitives.js +5 -17
- package/dist/display-list/dom/renderDisplayListToDom.d.ts +8 -8
- package/dist/display-list/dom/renderDisplayListToDom.js +52 -10
- package/dist/display-list/editor/displayListPagePainter.d.ts +4 -5
- package/dist/display-list/editor/pageRenderer.d.ts +5 -6
- package/dist/display-list/editor/pageRenderer.js +1 -0
- package/dist/display-list/html/renderDisplayListToHtml.d.ts +5 -6
- package/dist/display-list/pageResourceOwnership.d.ts +4 -0
- package/dist/display-list/pageResourceOwnership.js +32 -0
- package/dist/display-list/primitives.d.ts +13 -13
- package/dist/display-list/primitives.js +2 -0
- package/dist/display-list/selectDisplayPages.d.ts +2 -3
- package/dist/display-list/types.d.ts +54 -33
- package/dist/document-operations.d.ts +56 -44
- package/dist/document-operations.js +37 -2
- package/dist/document-stories.d.ts +3 -4
- package/dist/docx/altChunk.d.ts +5 -6
- package/dist/docx/appVersionNormalization.d.ts +4 -4
- package/dist/docx/archiveInflation.d.ts +16 -16
- package/dist/docx/archiveInflation.js +1 -1
- package/dist/docx/attributeRemainder.d.ts +8 -8
- package/dist/docx/attributeRemainder.js +34 -0
- package/dist/docx/blockContentParser.d.ts +15 -7
- package/dist/docx/blockContentParser.js +5 -6
- package/dist/docx/blockCustomXmlShell.d.ts +2 -3
- package/dist/docx/blockPlainText.d.ts +3 -4
- package/dist/docx/blockPlainText.js +5 -1
- package/dist/docx/bookmarkIdNormalization.d.ts +2 -3
- package/dist/docx/bookmarkIds.d.ts +5 -6
- package/dist/docx/bookmarkParser.d.ts +20 -21
- package/dist/docx/bookmarkParser.js +3 -2
- package/dist/docx/borderParser.d.ts +2 -3
- package/dist/docx/builtInStyles.d.ts +11 -11
- package/dist/docx/bulletMarkers.d.ts +8 -3
- package/dist/docx/bulletMarkers.js +3 -43
- package/dist/docx/canonicalModel.d.ts +2 -0
- package/dist/docx/canonicalModel.js +1 -0
- package/dist/docx/canonicalResourceSave.d.ts +3 -3
- package/dist/docx/canonicalSave.d.ts +3 -3
- package/dist/docx/canonicalSessionInput.d.ts +3 -3
- package/dist/docx/canonicalStoryRepack.d.ts +2 -2
- package/dist/docx/chartPreview.d.ts +6 -0
- package/dist/docx/chartPreview.js +302 -0
- package/dist/docx/commentAnchorIndex.d.ts +6 -5
- package/dist/docx/commentAnchorIndex.js +236 -1
- package/dist/docx/commentIdNormalization.d.ts +4 -5
- package/dist/docx/commentParser.d.ts +4 -5
- package/dist/docx/commentParser.js +2 -1
- package/dist/docx/commentRangeIntegrity.d.ts +6 -5
- package/dist/docx/commentRangeIntegrity.js +17 -1
- package/dist/docx/commentRangeJoin.d.ts +2 -3
- package/dist/docx/commentReferenceCompletion.d.ts +2 -3
- package/dist/docx/commentReferenceNormalization.d.ts +4 -4
- package/dist/docx/commentReplyMarkers.d.ts +3 -4
- package/dist/docx/commentTextParagraph.d.ts +2 -3
- package/dist/docx/commentThreadKey.d.ts +2 -3
- package/dist/docx/compatibility.d.ts +12 -13
- package/dist/docx/conformance.d.ts +2 -3
- package/dist/docx/conformance.js +1 -1
- package/dist/docx/containerChildren.d.ts +18 -18
- package/dist/docx/containerChildren.gen.d.ts +5 -6
- package/dist/docx/contentTypeRegistry.d.ts +2 -2
- package/dist/docx/corePropertiesParser.d.ts +2 -2
- package/dist/docx/danglingRelationshipReferences.d.ts +3 -3
- package/dist/docx/defaultParagraphStyle.d.ts +6 -6
- package/dist/docx/diagramPreview.d.ts +5 -4
- package/dist/docx/diagramPreview.js +8 -3
- package/dist/docx/documentClone.js +1 -2
- package/dist/docx/documentGrid.d.ts +2 -2
- package/dist/docx/documentParser.d.ts +11 -11
- package/dist/docx/documentSectionFacts.d.ts +5 -6
- package/dist/docx/drawingAnchor.d.ts +14 -14
- package/dist/docx/drawingGroupChildren.d.ts +8 -8
- package/dist/docx/drawingIdNormalization.d.ts +3 -4
- package/dist/docx/drawingRelationships.d.ts +2 -2
- package/dist/docx/drawingUtils.d.ts +16 -17
- package/dist/docx/drawingUtils.js +4 -2
- package/dist/docx/encryption/agileDecryption.d.ts +2 -3
- package/dist/docx/encryption/compoundFile.d.ts +5 -6
- package/dist/docx/encryption/containerFormat.d.ts +4 -5
- package/dist/docx/encryption/cryptoBytes.d.ts +8 -9
- package/dist/docx/encryption/encryptionInfo.d.ts +5 -6
- package/dist/docx/encryption/errors.d.ts +5 -5
- package/dist/docx/encryption/openEncryptedDocx.d.ts +5 -6
- package/dist/docx/ensureParaIds.d.ts +6 -6
- package/dist/docx/ensureParaIds.js +1 -1
- package/dist/docx/fieldParser.d.ts +32 -33
- package/dist/docx/fieldParser.js +8 -6
- package/dist/docx/fieldState.d.ts +5 -6
- package/dist/docx/foldedListNumberFields.d.ts +15 -16
- package/dist/docx/fontTableParser.d.ts +2 -3
- package/dist/docx/footnoteParser.d.ts +11 -11
- package/dist/docx/footnoteParser.js +19 -0
- package/dist/docx/graphicFrameLocks.d.ts +5 -6
- package/dist/docx/groupDrawingParser.d.ts +4 -5
- package/dist/docx/groupDrawingParser.js +10 -5
- package/dist/docx/headerFooterParser.d.ts +14 -14
- package/dist/docx/headerFooterRefParser.d.ts +6 -7
- package/dist/docx/headerFooterReferenceNormalization.d.ts +5 -5
- package/dist/docx/headerFooterVerbatim.d.ts +14 -14
- package/dist/docx/hyperlinkParser.d.ts +20 -21
- package/dist/docx/hyperlinkParser.js +54 -11
- package/dist/docx/imageParser.d.ts +18 -18
- package/dist/docx/imageParser.js +6 -3
- package/dist/docx/imageRawXml.d.ts +9 -10
- package/dist/docx/importedIdCollisions.d.ts +3 -4
- package/dist/docx/inlineContentRemovals.d.ts +2 -3
- package/dist/docx/inlineWrapperContent.d.ts +38 -33
- package/dist/docx/inlineWrapperContent.js +29 -23
- package/dist/docx/inlineWrapperParser.d.ts +4 -5
- package/dist/docx/inlineWrapperParser.js +14 -0
- package/dist/docx/linkedSdtPreservation.d.ts +3 -3
- package/dist/docx/listMarkerComputation.d.ts +4 -5
- package/dist/docx/listModelNormalization.d.ts +2 -2
- package/dist/docx/listModelNormalization.js +15 -11
- package/dist/docx/listNumberingInstances.d.ts +8 -8
- package/dist/docx/listRendering.d.ts +5 -6
- package/dist/docx/listTemplate.d.ts +5 -5
- package/dist/docx/markupRangeMarker.d.ts +21 -4
- package/dist/docx/markupRangeMarker.js +35 -1
- package/dist/docx/mathToMathml.d.ts +8 -3
- package/dist/docx/mathToMathml.js +72 -4
- package/dist/docx/metadataPrivacy.d.ts +14 -14
- package/dist/docx/metadataPrivacy.js +3 -3
- package/dist/docx/metafileRaster.d.ts +4 -5
- package/dist/docx/metafileSvg.d.ts +2 -3
- package/dist/docx/metafileSvg.js +28 -39
- package/dist/docx/metafileSvgShared.d.ts +27 -0
- package/dist/docx/metafileSvgShared.js +28 -0
- package/dist/docx/modelValidation.d.ts +5 -6
- package/dist/docx/modelValidation.js +144 -1
- package/dist/docx/newImage.d.ts +2 -3
- package/dist/docx/nonVisualDrawingProps.d.ts +3 -3
- package/dist/docx/normalizeBaseDirection.d.ts +2 -3
- package/dist/docx/normalizeBaseDirection.js +6 -2
- package/dist/docx/noteIds.d.ts +2 -3
- package/dist/docx/notePropertiesParser.d.ts +3 -4
- package/dist/docx/noteReferenceMark.d.ts +6 -6
- package/dist/docx/noteReferenceStyles.d.ts +7 -8
- package/dist/docx/noteReferenceStyles.js +0 -13
- package/dist/docx/numberingIds.d.ts +3 -3
- package/dist/docx/numberingParser.d.ts +15 -16
- package/dist/docx/numberingParser.js +6 -30
- package/dist/docx/numberingReference.d.ts +2 -2
- package/dist/docx/numberingReferenceNormalization.d.ts +5 -5
- package/dist/docx/numberingReferenceNormalization.js +6 -9
- package/dist/docx/numericIdAllocator.d.ts +2 -2
- package/dist/docx/numericIdNormalization.d.ts +3 -3
- package/dist/docx/numericIdNormalization.js +0 -1
- package/dist/docx/ooxmlCounterFormatter.d.ts +3 -4
- package/dist/docx/opaqueCarrier.d.ts +5 -6
- package/dist/docx/packageParts.d.ts +8 -9
- package/dist/docx/paraIdAttribute.d.ts +11 -12
- package/dist/docx/paraIdRangeNormalization.d.ts +3 -4
- package/dist/docx/paragraphMarkPropertyPresence.d.ts +4 -5
- package/dist/docx/paragraphParser.d.ts +9 -9
- package/dist/docx/paragraphParser.js +45 -23
- package/dist/docx/paragraphProperties.d.ts +2 -3
- package/dist/docx/paragraphProperties.js +15 -2
- package/dist/docx/paragraphPropertySource.d.ts +56 -56
- package/dist/docx/paragraphPropertySource.js +37 -1
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +2 -3
- package/dist/docx/paragraphTextBoxEnrichment.js +21 -6
- package/dist/docx/paragraphTraversal.d.ts +19 -10
- package/dist/docx/paragraphTraversal.js +110 -75
- package/dist/docx/parseContext.d.ts +5 -6
- package/dist/docx/parseWarningMessage.d.ts +3 -4
- package/dist/docx/parser.d.ts +11 -11
- package/dist/docx/parser.js +43 -15
- package/dist/docx/parserEnums.d.ts +37 -38
- package/dist/docx/preservedRunContent.d.ts +5 -6
- package/dist/docx/preservedRunContent.js +16 -0
- package/dist/docx/previewBudget.d.ts +6 -6
- package/dist/docx/previewBudget.js +1 -1
- package/dist/docx/propertyElementAttributes.d.ts +10 -11
- package/dist/docx/rasterMime.d.ts +4 -4
- package/dist/docx/relsParser.d.ts +20 -21
- package/dist/docx/removeHeaderFooterParts.d.ts +2 -2
- package/dist/docx/renderedPageBreakNormalization.d.ts +2 -2
- package/dist/docx/replyToComment.d.ts +4 -5
- package/dist/docx/replyToComment.js +2 -1
- package/dist/docx/reviewHistoryNamespace.d.ts +2 -3
- package/dist/docx/reviewResolutionProvenance.d.ts +15 -12
- package/dist/docx/reviewResolutionProvenance.js +15 -4
- package/dist/docx/revisionIdNormalization.d.ts +4 -4
- package/dist/docx/rezip.d.ts +40 -40
- package/dist/docx/rezip.js +113 -123
- package/dist/docx/runConsolidator.d.ts +7 -7
- package/dist/docx/runConsolidator.js +13 -0
- package/dist/docx/runParser.d.ts +12 -13
- package/dist/docx/runParser.js +31 -10
- package/dist/docx/runPayload.d.ts +2 -3
- package/dist/docx/runPropertyPresence.d.ts +7 -8
- package/dist/docx/saveDiagnostics.d.ts +3 -4
- package/dist/docx/sdtProperties.d.ts +6 -7
- package/dist/docx/sdtPropertiesPatch.d.ts +2 -3
- package/dist/docx/sectionParser.d.ts +15 -16
- package/dist/docx/sectionReferenceHistory.d.ts +6 -6
- package/dist/docx/selectedXmlIdentityScan.d.ts +2 -3
- package/dist/docx/selectiveSave.d.ts +3 -4
- package/dist/docx/selectiveSave.js +6 -3
- package/dist/docx/selectiveSaveFlags.d.ts +5 -6
- package/dist/docx/selectiveSaveFlags.js +1 -1
- package/dist/docx/selectiveSaveTripwire.d.ts +3 -4
- package/dist/docx/selectiveXmlPatch.d.ts +28 -28
- package/dist/docx/serializer/blockCustomXmlSerializer.d.ts +2 -3
- package/dist/docx/serializer/blockSdtSerializer.d.ts +2 -3
- package/dist/docx/serializer/blockSdtSerializer.js +2 -1
- package/dist/docx/serializer/borderSerializer.d.ts +2 -2
- package/dist/docx/serializer/borderSerializer.js +8 -0
- package/dist/docx/serializer/commentSerializer.d.ts +7 -8
- package/dist/docx/serializer/documentSerializer.d.ts +13 -14
- package/dist/docx/serializer/documentSerializer.js +17 -1
- package/dist/docx/serializer/fontTableSerializer.d.ts +2 -3
- package/dist/docx/serializer/groupTextBoxWriteBack.d.ts +2 -2
- package/dist/docx/serializer/groupTextBoxWriteBack.js +1 -4
- package/dist/docx/serializer/headerFooterSerializer.d.ts +2 -2
- package/dist/docx/serializer/headerFooterSerializer.js +5 -1
- package/dist/docx/serializer/markupRangeAttributes.d.ts +11 -6
- package/dist/docx/serializer/markupRangeAttributes.js +33 -6
- package/dist/docx/serializer/noteSerializer.d.ts +5 -6
- package/dist/docx/serializer/noteSerializer.js +26 -1
- package/dist/docx/serializer/numberingSerializer.d.ts +2 -3
- package/dist/docx/serializer/numberingSerializer.js +14 -0
- package/dist/docx/serializer/paragraphSerializer.d.ts +8 -9
- package/dist/docx/serializer/paragraphSerializer.js +27 -17
- package/dist/docx/serializer/partNamespaces.d.ts +9 -9
- package/dist/docx/serializer/runSerializer.d.ts +11 -12
- package/dist/docx/serializer/runSerializer.js +7 -2
- package/dist/docx/serializer/sdtPropertiesSerializer.d.ts +5 -6
- package/dist/docx/serializer/sectionPropertiesSerializer.d.ts +2 -3
- package/dist/docx/serializer/settingsSerializer.d.ts +2 -3
- package/dist/docx/serializer/settingsSerializer.js +9 -6
- package/dist/docx/serializer/stylesSerializer.d.ts +3 -4
- package/dist/docx/serializer/stylesSerializer.js +4 -1
- package/dist/docx/serializer/tableSerializer.d.ts +18 -18
- package/dist/docx/serializer/tableSerializer.js +22 -2
- package/dist/docx/serializer/textFormattingSerializer.d.ts +3 -3
- package/dist/docx/serializer/themeSerializer.d.ts +2 -3
- package/dist/docx/serializer/trackedChangeAttributes.d.ts +4 -4
- package/dist/docx/serializer/xmlUtils.d.ts +3 -4
- package/dist/docx/server/applyDocxXmlPatchProposal.d.ts +9 -9
- package/dist/docx/server/applyDocxXmlPatchProposal.js +1 -1
- package/dist/docx/server/boundedArchive.d.ts +11 -11
- package/dist/docx/server/boundedArchive.js +3 -3
- package/dist/docx/server/build.d.ts +14 -14
- package/dist/docx/server/build.js +9 -6
- package/dist/docx/server/createBilingualDocument.d.ts +13 -13
- package/dist/docx/server/createBilingualDocument.js +56 -21
- package/dist/docx/server/createBilingualDocx.d.ts +5 -6
- package/dist/docx/server/createBilingualDocx.js +7 -3
- package/dist/docx/server/docxToMarkdown.d.ts +2 -3
- package/dist/docx/server/docxToMarkdown.js +2 -1
- package/dist/docx/server/evaluateDocxXmlPatchProposal.d.ts +17 -17
- package/dist/docx/server/evaluateDocxXmlPatchProposal.js +2 -2
- package/dist/docx/server/extractDocxText.d.ts +10 -11
- package/dist/docx/server/extractDocxText.js +3 -2
- package/dist/docx/server/inspectDocxPackage.d.ts +14 -14
- package/dist/docx/server/inspectDocxPackage.js +3 -3
- package/dist/docx/server/materializeYjsDocx.d.ts +8 -8
- package/dist/docx/server/materializeYjsDocx.js +1 -1
- package/dist/docx/server/migrateYjsAttrSchema.d.ts +6 -6
- package/dist/docx/server/migrateYjsAttrSchema.js +3 -3
- package/dist/docx/server/validateDocxConformance.d.ts +14 -15
- package/dist/docx/settingsHeaderFooterUpdate.d.ts +2 -3
- package/dist/docx/settingsParser.d.ts +2 -2
- package/dist/docx/settingsParser.js +12 -0
- package/dist/docx/shadingParser.d.ts +2 -3
- package/dist/docx/shapeAlternateContent.d.ts +8 -7
- package/dist/docx/shapeAlternateContent.js +84 -9
- package/dist/docx/shapeParser.d.ts +4 -5
- package/dist/docx/shapeParser.js +2 -1
- package/dist/docx/storyBlockReplay.d.ts +5 -5
- package/dist/docx/storyBlockReplay.js +10 -2
- package/dist/docx/storyPlainText.d.ts +9 -10
- package/dist/docx/streamingXmlParser.d.ts +8 -8
- package/dist/docx/strictNames.d.ts +4 -5
- package/dist/docx/strictNames.gen.d.ts +6 -7
- package/dist/docx/strictValueEncodings.gen.d.ts +5 -6
- package/dist/docx/structuralXmlPatch.d.ts +2 -2
- package/dist/docx/styleParser.d.ts +11 -12
- package/dist/docx/styleParser.js +1 -3
- package/dist/docx/styleReferenceResolution.d.ts +3 -4
- package/dist/docx/tableLook.d.ts +7 -7
- package/dist/docx/tableParser.d.ts +47 -39
- package/dist/docx/tableParser.js +2 -4
- package/dist/docx/tableRowPropertyPresence.d.ts +5 -6
- package/dist/docx/textBoxParser.d.ts +25 -26
- package/dist/docx/textBoxParser.js +18 -19
- package/dist/docx/themeColorAttribute.d.ts +3 -4
- package/dist/docx/themeParser.d.ts +9 -10
- package/dist/docx/trackedChangeInfo.d.ts +5 -6
- package/dist/docx/trackedMoveRangeNormalization.d.ts +3 -3
- package/dist/docx/trackedMoveRangeNormalization.js +52 -21
- package/dist/docx/transitionalSpelling.d.ts +7 -8
- package/dist/docx/universalMeasure.d.ts +5 -6
- package/dist/docx/unzip.d.ts +15 -16
- package/dist/docx/unzip.js +2 -2
- package/dist/docx/verbatimCapture.d.ts +6 -6
- package/dist/docx/verbatimCapture.js +3 -2
- package/dist/docx/verticalMergeProjection.d.ts +4 -5
- package/dist/docx/verticalMergeProjection.js +1 -1
- package/dist/docx/vmlImageParser.d.ts +4 -5
- package/dist/docx/vmlPreview.d.ts +9 -10
- package/dist/docx/vmlPreview.js +0 -3
- package/dist/docx/watermarkParser.d.ts +4 -5
- package/dist/docx/wmfSvg.d.ts +10 -0
- package/dist/docx/wmfSvg.js +451 -0
- package/dist/docx/wordprocessingPrefixes.d.ts +12 -13
- package/dist/docx/wrapPolygon.d.ts +5 -6
- package/dist/docx/wrapTypes.js +1 -2
- package/dist/docx/xmlEncoding.d.ts +2 -3
- package/dist/docx/xmlNamespaceContext.d.ts +5 -6
- package/dist/docx/xmlParser.d.ts +49 -50
- package/dist/docx/xmlParser.js +12 -12
- package/dist/docx/xmlResourceLimits.d.ts +10 -10
- package/dist/docx/xmlResourceLimits.js +1 -1
- package/dist/docx/xmlSafety.d.ts +3 -4
- package/dist/export-pdf.d.ts +11 -11
- package/dist/export-pdf.js +2 -1
- package/dist/fields/bookmarkPages.d.ts +2 -3
- package/dist/fields/bookmarkText.d.ts +2 -2
- package/dist/fields/bookmarkText.js +3 -2
- package/dist/fields/evaluateField.d.ts +3 -3
- package/dist/fields/fieldContext.d.ts +2 -3
- package/dist/fields/resolveFieldValues.d.ts +7 -8
- package/dist/fields/sectionPageCounts.d.ts +2 -3
- package/dist/fields/seqValues.d.ts +2 -3
- package/dist/fonts/FontFaceLifecycle.d.ts +12 -0
- package/dist/fonts/FontFaceLifecycle.js +56 -0
- package/dist/fonts/documentFontFacts.d.ts +17 -0
- package/dist/fonts/documentFontFacts.js +41 -0
- package/dist/fonts/embeddedFontFingerprint.d.ts +2 -3
- package/dist/fonts/embeddedFontFingerprint.js +3 -2
- package/dist/fonts/embeddedFonts.d.ts +7 -8
- package/dist/fonts/fontAlternates.d.ts +4 -5
- package/dist/fonts/fontAlternates.js +2 -1
- package/dist/fonts/fontDeobfuscation.d.ts +3 -4
- package/dist/fonts/fontDeobfuscation.js +7 -3
- package/dist/fonts/fontsourceFaces.d.ts +7 -8
- package/dist/fonts/fontsourceFaces.js +16 -0
- package/dist/fonts/headlessMeasure.d.ts +10 -10
- package/dist/fonts/sfnt/parse.d.ts +5 -5
- package/dist/fonts/sfnt/parse.js +2 -1
- package/dist/fonts/sfnt/subset.d.ts +4 -4
- package/dist/fonts/sfnt/tables.d.ts +14 -14
- package/dist/fonts/sfnt/woff.d.ts +4 -4
- package/dist/headless-layout.d.ts +7 -7
- package/dist/headless-layout.js +7 -0
- package/dist/i18n/messages/ar.gen.d.ts +2 -2
- package/dist/i18n/messages/catalogs.gen.d.ts +2 -3
- package/dist/i18n/messages/cs.gen.d.ts +2 -2
- package/dist/i18n/messages/de.gen.d.ts +2 -2
- package/dist/i18n/messages/en.gen.d.ts +2 -2
- package/dist/i18n/messages/es.gen.d.ts +2 -2
- package/dist/i18n/messages/et.gen.d.ts +2 -2
- package/dist/i18n/messages/fr.gen.d.ts +2 -2
- package/dist/i18n/messages/he.gen.d.ts +2 -2
- package/dist/i18n/messages/hi.gen.d.ts +2 -2
- package/dist/i18n/messages/hu.gen.d.ts +2 -2
- package/dist/i18n/messages/locales.d.ts +3 -4
- package/dist/i18n/messages/lt.gen.d.ts +2 -2
- package/dist/i18n/messages/lv.gen.d.ts +2 -2
- package/dist/i18n/messages/pl.gen.d.ts +2 -2
- package/dist/i18n/messages/pt-BR.gen.d.ts +2 -2
- package/dist/i18n/messages/sk.gen.d.ts +2 -2
- package/dist/i18n/messages/tr.gen.d.ts +2 -2
- package/dist/i18n/messages/zh-CN.gen.d.ts +2 -2
- package/dist/i18n/messages.d.ts +4 -4
- package/dist/internal/acceptedBlockProjection.d.ts +2 -3
- package/dist/internal/acceptedBlockProjection.js +5 -1
- package/dist/internal/compare/inline-presentation.d.ts +4 -4
- package/dist/internal/headlessRevisionResolutionGuard.d.ts +2 -3
- package/dist/internal/indexedPositionMap.d.ts +2 -3
- package/dist/internal/noteMarkerAttrs.d.ts +3 -4
- package/dist/internal/pageBreakRunDescendantIndex.d.ts +3 -4
- package/dist/internal/pageBreakRunPartition.d.ts +4 -4
- package/dist/internal/pageBreakRunSourceDescendantIndex.d.ts +4 -5
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +5 -1
- package/dist/internal/paragraphFormattingSerialization.d.ts +6 -6
- package/dist/internal/paragraphFormattingSerialization.js +3 -1
- package/dist/internal/prosemirrorAttrBoundary.d.ts +9 -10
- package/dist/internal/prosemirrorAttrBoundary.js +2 -1
- package/dist/internal/revisionResolutionEdits.d.ts +2 -2
- package/dist/internal/revisionResolutionInline.d.ts +4 -3
- package/dist/internal/revisionResolutionInline.js +69 -48
- package/dist/internal/revisionResolutionStep.d.ts +3 -3
- package/dist/internal/revisionResolutionTracking.d.ts +2 -2
- package/dist/internal/revisionResolutionTracking.js +3 -3
- package/dist/internal/sectionEndpointResolution.d.ts +5 -5
- package/dist/internal/sectionReferenceResolution.d.ts +6 -7
- package/dist/internal/wholeStoryRevisionResolution.d.ts +6 -4
- package/dist/internal/wholeStoryRevisionResolution.js +168 -52
- package/dist/layout-bridge/cellSelectionHighlight.d.ts +2 -3
- package/dist/layout-bridge/convert/endnoteLayout.d.ts +8 -8
- package/dist/layout-bridge/convert/endnoteLayout.js +2 -1
- package/dist/layout-bridge/convert/fixedTableColumnWidths.d.ts +2 -3
- package/dist/layout-bridge/convert/flowBlockPostprocessing.d.ts +5 -6
- package/dist/layout-bridge/convert/flowBorders.d.ts +3 -4
- package/dist/layout-bridge/convert/flowConversionShared.d.ts +9 -7
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +14 -14
- package/dist/layout-bridge/convert/footnoteLayout.js +10 -0
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +13 -12
- package/dist/layout-bridge/convert/headerFooterLayout.js +10 -4
- package/dist/layout-bridge/convert/imageConversion.d.ts +6 -7
- package/dist/layout-bridge/convert/listMarkers.d.ts +9 -9
- package/dist/layout-bridge/convert/markupViewFlow.d.ts +3 -3
- package/dist/layout-bridge/convert/noteReferences.d.ts +2 -3
- package/dist/layout-bridge/convert/pageBreakSplitting.d.ts +4 -4
- package/dist/layout-bridge/convert/pageBreakSplitting.js +4 -0
- package/dist/layout-bridge/convert/paragraphAttrs.d.ts +2 -2
- package/dist/layout-bridge/convert/paragraphAttrs.js +18 -11
- package/dist/layout-bridge/convert/paragraphConversion.d.ts +4 -5
- package/dist/layout-bridge/convert/paragraphConversion.js +9 -2
- package/dist/layout-bridge/convert/paragraphFrames.d.ts +2 -2
- package/dist/layout-bridge/convert/paragraphFrames.js +1 -1
- package/dist/layout-bridge/convert/paragraphMarkFormatting.d.ts +3 -4
- package/dist/layout-bridge/convert/paragraphRuns.d.ts +3 -4
- package/dist/layout-bridge/convert/paragraphRuns.js +35 -14
- package/dist/layout-bridge/convert/runFormattingMerge.d.ts +5 -5
- package/dist/layout-bridge/convert/runFormattingMerge.js +1 -0
- package/dist/layout-bridge/convert/runMarkFormatting.d.ts +2 -3
- package/dist/layout-bridge/convert/runMarkFormatting.js +12 -4
- package/dist/layout-bridge/convert/sectionBoundaries.d.ts +6 -6
- package/dist/layout-bridge/convert/tableConversion.d.ts +3 -4
- package/dist/layout-bridge/convert/tableConversion.js +1 -1
- package/dist/layout-bridge/convert/templatePreviewFlow.d.ts +6 -7
- package/dist/layout-bridge/convert/textBoxFill.d.ts +3 -4
- package/dist/layout-bridge/convert/textFormattingConversion.d.ts +8 -7
- package/dist/layout-bridge/convert/textFormattingConversion.js +10 -1
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +3 -3
- package/dist/layout-bridge/convert/toFlowBlocks.js +19 -11
- package/dist/layout-bridge/convert/wrapEditorViewAsSurface.d.ts +3 -4
- package/dist/layout-bridge/dom/clickToPositionDom.d.ts +12 -13
- package/dist/layout-bridge/dom/clickToPositionDom.js +30 -4
- package/dist/layout-bridge/dom/findBodyPmSpans.d.ts +5 -6
- package/dist/layout-bridge/dom/findHfPmSpans.d.ts +10 -11
- package/dist/layout-bridge/dom/imeCaretAnchor.d.ts +3 -3
- package/dist/layout-bridge/dom/noteStoryDom.d.ts +2 -3
- package/dist/layout-bridge/dom/textStreamDom.d.ts +16 -9
- package/dist/layout-bridge/dom/textStreamDom.js +18 -3
- package/dist/layout-bridge/engine/clickToPosition.d.ts +8 -9
- package/dist/layout-bridge/engine/clickToPosition.js +77 -94
- package/dist/layout-bridge/engine/hitTest.d.ts +18 -19
- package/dist/layout-bridge/engine/hitTest.js +2 -1
- package/dist/layout-bridge/engine/linePmRange.d.ts +7 -0
- package/dist/layout-bridge/engine/linePmRange.js +34 -0
- package/dist/layout-bridge/engine/selectionRects.d.ts +7 -8
- package/dist/layout-bridge/engine/selectionRects.js +53 -77
- package/dist/layout-bridge/headerFooterLayout.d.ts +4 -5
- package/dist/layout-bridge/measuring/measureBlocksPipeline.d.ts +2 -3
- package/dist/layout-bridge/sectionColumns.d.ts +2 -3
- package/dist/layout-bridge/tableInsertHover.d.ts +6 -7
- package/dist/layout-engine/anchorLayoutInCellCompatibility.d.ts +2 -3
- package/dist/layout-engine/footnoteColumnReflow.d.ts +2 -2
- package/dist/layout-engine/headerFooterRefs.d.ts +2 -3
- package/dist/layout-engine/imageLayout.d.ts +2 -3
- package/dist/layout-engine/index.d.ts +3 -3
- package/dist/layout-engine/index.js +9 -6
- package/dist/layout-engine/justificationCompatibility.d.ts +2 -3
- package/dist/layout-engine/keep-together.d.ts +7 -8
- package/dist/layout-engine/keep-together.js +1 -1
- package/dist/layout-engine/layoutFlowShared.d.ts +3 -4
- package/dist/layout-engine/layoutInstrumentation.d.ts +18 -19
- package/dist/layout-engine/lineFlow.d.ts +4 -5
- package/dist/layout-engine/measure/advanceComposition.d.ts +8 -8
- package/dist/layout-engine/measure/advanceComposition.js +24 -5
- package/dist/layout-engine/measure/automaticTextSpacing.d.ts +36 -0
- package/dist/layout-engine/measure/automaticTextSpacing.js +178 -0
- package/dist/layout-engine/measure/cache.d.ts +22 -22
- package/dist/layout-engine/measure/cache.js +50 -14
- package/dist/layout-engine/measure/clampFloatingWrapMargins.d.ts +2 -3
- package/dist/layout-engine/measure/complexScriptFormatting.d.ts +5 -5
- package/dist/layout-engine/measure/crossRunWords.d.ts +8 -8
- package/dist/layout-engine/measure/crossRunWords.js +9 -4
- package/dist/layout-engine/measure/effectiveLineBreakPolicy.d.ts +3 -3
- package/dist/layout-engine/measure/effectiveLineBreakPolicy.js +3 -1
- package/dist/layout-engine/measure/featureFlags.d.ts +4 -5
- package/dist/layout-engine/measure/floatingLineClearance.d.ts +3 -4
- package/dist/layout-engine/measure/floatingTablePosition.d.ts +3 -3
- package/dist/layout-engine/measure/floatingZones.d.ts +11 -10
- package/dist/layout-engine/measure/font-metrics.worker.d.ts +3 -4
- package/dist/layout-engine/measure/hyperlinkInstance.d.ts +3 -4
- package/dist/layout-engine/measure/hyphenationDictionaries.d.ts +15 -15
- package/dist/layout-engine/measure/hyphenationDictionaries.js +4 -4
- package/dist/layout-engine/measure/hyphenationPreload.d.ts +2 -3
- package/dist/layout-engine/measure/inlineObjectMetrics.d.ts +3 -4
- package/dist/layout-engine/measure/justification.d.ts +7 -7
- package/dist/layout-engine/measure/lineBreakProvider.d.ts +16 -11
- package/dist/layout-engine/measure/lineBreakProvider.js +29 -4
- package/dist/layout-engine/measure/lineBreaks.d.ts +7 -8
- package/dist/layout-engine/measure/lineBreaks.js +5 -2
- package/dist/layout-engine/measure/lineFitting.d.ts +11 -11
- package/dist/layout-engine/measure/lineFitting.js +17 -6
- package/dist/layout-engine/measure/lineTypography.d.ts +7 -8
- package/dist/layout-engine/measure/lineTypography.js +1 -0
- package/dist/layout-engine/measure/listMarkerWidth.d.ts +9 -6
- package/dist/layout-engine/measure/listMarkerWidth.js +7 -3
- package/dist/layout-engine/measure/measureBlocks.d.ts +7 -7
- package/dist/layout-engine/measure/measureBlocks.js +13 -7
- package/dist/layout-engine/measure/measureContainer.d.ts +5 -6
- package/dist/layout-engine/measure/measureContainer.js +27 -6
- package/dist/layout-engine/measure/measureHelpers.d.ts +21 -18
- package/dist/layout-engine/measure/measureHelpers.js +12 -3
- package/dist/layout-engine/measure/measureParagraph.d.ts +5 -5
- package/dist/layout-engine/measure/measureParagraph.js +57 -11
- package/dist/layout-engine/measure/measureProvider.d.ts +15 -9
- package/dist/layout-engine/measure/measureProvider.js +66 -4
- package/dist/layout-engine/measure/measureTypes.d.ts +17 -14
- package/dist/layout-engine/measure/measureWorker.d.ts +8 -8
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +6 -7
- package/dist/layout-engine/measure/paragraphMeasureShared.d.ts +19 -20
- package/dist/layout-engine/measure/paragraphTabs.d.ts +6 -7
- package/dist/layout-engine/measure/paragraphTabs.js +16 -17
- package/dist/layout-engine/measure/smallCapsCasing.d.ts +6 -7
- package/dist/layout-engine/measure/tabCalculator.d.ts +15 -16
- package/dist/layout-engine/measure/tableCellFloating.d.ts +6 -6
- package/dist/layout-engine/measure/tableCellFlow.d.ts +7 -7
- package/dist/layout-engine/measure/tableCellGrid.d.ts +14 -14
- package/dist/layout-engine/measure/tableFragmentBorderGeometry.d.ts +2 -2
- package/dist/layout-engine/measure/tableInlinePlacement.d.ts +3 -3
- package/dist/layout-engine/measure/textBoxParagraphLayout.d.ts +4 -4
- package/dist/layout-engine/measure/textMeasurementPolicy.d.ts +8 -8
- package/dist/layout-engine/noColumnBalanceCompatibility.d.ts +7 -0
- package/dist/layout-engine/noColumnBalanceCompatibility.js +5 -0
- package/dist/layout-engine/noteAreaFlow.d.ts +4 -5
- package/dist/layout-engine/paginator.d.ts +18 -11
- package/dist/layout-engine/paginator.js +51 -11
- package/dist/layout-engine/paragraphFragmentRange.d.ts +2 -3
- package/dist/layout-engine/paragraphFrame.d.ts +2 -21
- package/dist/layout-engine/paragraphFrame.js +1 -17
- package/dist/layout-engine/paragraphLayout.d.ts +2 -2
- package/dist/layout-engine/paragraphLayout.js +28 -9
- package/dist/layout-engine/paragraphSequence.d.ts +3 -4
- package/dist/layout-engine/paragraphSpacing.d.ts +10 -10
- package/dist/layout-engine/pmPageIndex.d.ts +3 -4
- package/dist/layout-engine/renderedBreakReconciliation.d.ts +7 -7
- package/dist/layout-engine/section-breaks.d.ts +15 -15
- package/dist/layout-engine/sectionLayout.d.ts +7 -7
- package/dist/layout-engine/sectionLayout.js +1 -4
- package/dist/layout-engine/sectionVerticalAlignment.d.ts +2 -3
- package/dist/layout-engine/tableIndentCompatibility.d.ts +2 -3
- package/dist/layout-engine/tableLayout.d.ts +4 -5
- package/dist/layout-engine/tableLayout.js +17 -9
- package/dist/layout-engine/tableRowBreak.d.ts +6 -6
- package/dist/layout-engine/tableRowBreak.js +10 -5
- package/dist/layout-engine/textBoxFlow.d.ts +6 -6
- package/dist/layout-engine/textBoxGroup.d.ts +3 -4
- package/dist/layout-engine/textBoxLayout.d.ts +2 -2
- package/dist/layout-engine/types.d.ts +108 -88
- package/dist/layout-painter/anchoredImagePosition.d.ts +4 -5
- package/dist/layout-painter/borderStroke.d.ts +4 -4
- package/dist/layout-painter/cursiveJoiners.d.ts +7 -7
- package/dist/layout-painter/documentColors.d.ts +6 -7
- package/dist/layout-painter/imageLayout.d.ts +13 -14
- package/dist/layout-painter/index.d.ts +8 -7
- package/dist/layout-painter/index.js +7 -2
- package/dist/layout-painter/registry/modules/image.d.ts +2 -3
- package/dist/layout-painter/registry/modules/paragraph.d.ts +2 -3
- package/dist/layout-painter/registry/modules/table.d.ts +2 -3
- package/dist/layout-painter/registry/modules/textBox.d.ts +2 -3
- package/dist/layout-painter/registry/modules.d.ts +2 -3
- package/dist/layout-painter/registry/registry.d.ts +4 -5
- package/dist/layout-painter/registry/types.d.ts +8 -9
- package/dist/layout-painter/renderFragment.d.ts +4 -5
- package/dist/layout-painter/renderImage.d.ts +12 -13
- package/dist/layout-painter/renderPage.d.ts +27 -25
- package/dist/layout-painter/renderPage.js +116 -31
- package/dist/layout-painter/renderParagraph.d.ts +19 -15
- package/dist/layout-painter/renderParagraph.js +186 -46
- package/dist/layout-painter/renderTable.d.ts +7 -8
- package/dist/layout-painter/renderTable.js +27 -15
- package/dist/layout-painter/renderTextBox.d.ts +5 -6
- package/dist/layout-painter/renderTextBox.js +9 -1
- package/dist/layout-painter/renderUtils.d.ts +11 -14
- package/dist/layout-painter/renderUtils.js +1 -19
- package/dist/layout-painter/renderWatermark.d.ts +5 -4
- package/dist/layout-painter/sdtBoundary.d.ts +4 -5
- package/dist/layout-painter/tableRowPaintGeometry.d.ts +2 -2
- package/dist/managers/AutoSaveManager.d.ts +11 -12
- package/dist/managers/AutoSaveManager.js +17 -3
- package/dist/managers/ClipboardManager.d.ts +7 -8
- package/dist/managers/ContextMenuManager.d.ts +3 -4
- package/dist/managers/DocumentLoaderManager.d.ts +5 -6
- package/dist/managers/EditorModeManager.d.ts +12 -12
- package/dist/managers/ErrorManager.d.ts +2 -3
- package/dist/managers/FindReplaceManager.d.ts +6 -6
- package/dist/managers/HistoryManager.d.ts +9 -10
- package/dist/managers/Subscribable.d.ts +2 -3
- package/dist/managers/TableSelectionManager.d.ts +9 -10
- package/dist/managers/TableSelectionManager.js +3 -13
- package/dist/managers/autoSaveCodec.d.ts +8 -9
- package/dist/managers/editorShortcuts.d.ts +14 -15
- package/dist/managers/reviewDisplayMode.d.ts +4 -5
- package/dist/managers/types.d.ts +7 -8
- package/dist/markdown/annotations.d.ts +6 -7
- package/dist/markdown/escape.d.ts +6 -7
- package/dist/markdown/fromMarkdown.d.ts +2 -3
- package/dist/markdown/images.d.ts +2 -3
- package/dist/markdown/index.d.ts +3 -3
- package/dist/markdown/index.js +28 -2
- package/dist/markdown/internals.d.ts +4 -5
- package/dist/markdown/internals.js +3 -2
- package/dist/markdown/renderBlock.d.ts +2 -3
- package/dist/markdown/renderBlock.js +5 -1
- package/dist/markdown/renderParagraph.d.ts +4 -5
- package/dist/markdown/renderParagraph.js +42 -17
- package/dist/markdown/renderRuns.d.ts +3 -3
- package/dist/markdown/renderRuns.js +15 -10
- package/dist/markdown/renderTable.d.ts +2 -3
- package/dist/markdown/renderTable.js +21 -8
- package/dist/markdown/trailers.d.ts +2 -3
- package/dist/markdown/types.d.ts +7 -8
- package/dist/model.d.ts +1 -1
- package/dist/paged-layout/LayoutSelectionGate.d.ts +2 -2
- package/dist/paged-layout/blockGeometry.d.ts +5 -6
- package/dist/paged-layout/editorScrollRoot.d.ts +5 -5
- package/dist/paged-layout/fitWidthZoom.d.ts +36 -0
- package/dist/paged-layout/fitWidthZoom.js +31 -0
- package/dist/paged-layout/hiddenEditorScroll.d.ts +2 -3
- package/dist/paged-layout/incrementalMeasure.d.ts +6 -7
- package/dist/paged-layout/pageText.d.ts +2 -2
- package/dist/paged-layout/paragraphFlash.d.ts +7 -7
- package/dist/paged-layout/paragraphFlashTypes.d.ts +3 -4
- package/dist/paged-layout/rangeProjection.d.ts +11 -12
- package/dist/paged-layout/readOnlyEditAttempt.d.ts +2 -2
- package/dist/paged-layout/scrollNavigation.d.ts +5 -6
- package/dist/paged-layout/scrollPageInfo.d.ts +5 -6
- package/dist/paged-layout/scrollToPmPosition.d.ts +4 -5
- package/dist/paged-layout/sectionBlockWidths.d.ts +3 -3
- package/dist/paged-layout/sectionBlockWidths.js +0 -3
- package/dist/paged-layout/sectionGeometry.d.ts +10 -11
- package/dist/paged-layout/selectionViewportRect.d.ts +5 -6
- package/dist/paged-layout/tableColumnResize.d.ts +2 -3
- package/dist/paged-layout/tableInsertButtonGeometry.d.ts +2 -3
- package/dist/paged-layout/transactionDirtyRange.d.ts +2 -3
- package/dist/paged-layout/zoomScrollAnchor.d.ts +5 -5
- package/dist/panel-layout.d.ts +11 -12
- package/dist/pdf/contentStream.d.ts +11 -12
- package/dist/pdf/fonts.d.ts +11 -11
- package/dist/pdf/fonts.js +0 -19
- package/dist/pdf/images.d.ts +5 -5
- package/dist/pdf/images.js +4 -1
- package/dist/pdf/objects.d.ts +23 -24
- package/dist/pdf/pageSpace.d.ts +9 -10
- package/dist/pdf/paint.d.ts +6 -6
- package/dist/pdf/paint.js +28 -1
- package/dist/pdf/writePdf.d.ts +6 -6
- package/dist/prosemirror/addTrackedDeletionMark.d.ts +2 -2
- package/dist/prosemirror/alternateContentAttrs.d.ts +5 -4
- package/dist/prosemirror/alternateContentAttrs.js +13 -3
- package/dist/prosemirror/anchoredTextBoxes.d.ts +10 -11
- package/dist/prosemirror/attrs/index.d.ts +86 -86
- package/dist/prosemirror/attrs/index.js +127 -99
- package/dist/prosemirror/authoredTransformAttrs.d.ts +3 -3
- package/dist/prosemirror/autospacingBase.d.ts +5 -5
- package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +7 -7
- package/dist/prosemirror/bookmarkBoundaryAttrs.js +31 -2
- package/dist/prosemirror/bookmarkBoundaryIntegrity.d.ts +3 -4
- package/dist/prosemirror/canonicalCommands.d.ts +30 -13
- package/dist/prosemirror/canonicalCommands.js +5 -4
- package/dist/prosemirror/canonicalSelectionRange.d.ts +14 -4
- package/dist/prosemirror/canonicalSelectionRange.js +20 -1
- package/dist/prosemirror/cellDragSelection.d.ts +6 -7
- package/dist/prosemirror/cellDragSelection.js +9 -0
- package/dist/prosemirror/clearRunColor.d.ts +2 -3
- package/dist/prosemirror/clearRunColor.js +8 -5
- package/dist/prosemirror/clipboardIntent.d.ts +3 -4
- package/dist/prosemirror/commands/clearParagraphIndent.d.ts +2 -3
- package/dist/prosemirror/commands/comments.d.ts +28 -28
- package/dist/prosemirror/commands/comments.js +220 -83
- package/dist/prosemirror/commands/contentControls.d.ts +9 -9
- package/dist/prosemirror/commands/contentControls.js +2 -1
- package/dist/prosemirror/commands/contentControlsBlockFill.d.ts +2 -3
- package/dist/prosemirror/commands/contentControlsBlockFill.js +2 -1
- package/dist/prosemirror/commands/formatPainter.d.ts +5 -5
- package/dist/prosemirror/commands/formatPainter.js +14 -11
- package/dist/prosemirror/commands/formatting.d.ts +20 -20
- package/dist/prosemirror/commands/hyperlink.d.ts +5 -6
- package/dist/prosemirror/commands/hyperlink.js +7 -6
- package/dist/prosemirror/commands/image.d.ts +14 -14
- package/dist/prosemirror/commands/pageBreak.d.ts +2 -3
- package/dist/prosemirror/commands/pageBreak.js +2 -1
- package/dist/prosemirror/commands/paragraph.d.ts +35 -35
- package/dist/prosemirror/commands/paragraphBookmarkJoin.d.ts +5 -5
- package/dist/prosemirror/commands/paragraphBookmarkJoin.js +4 -7
- package/dist/prosemirror/commands/pastePlainText.d.ts +4 -5
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +13 -13
- package/dist/prosemirror/commands/propertyChangeScope.js +2 -0
- package/dist/prosemirror/commands/resolveAllTableChanges.d.ts +3 -3
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.d.ts +3 -3
- package/dist/prosemirror/commands/resolveParagraphProperties.d.ts +3 -3
- package/dist/prosemirror/commands/resolveParagraphProperties.js +1 -1
- package/dist/prosemirror/commands/sectionBreak.d.ts +9 -8
- package/dist/prosemirror/commands/sectionBreak.js +14 -1
- package/dist/prosemirror/commands/table.d.ts +34 -34
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +8 -8
- package/dist/prosemirror/commands/tableCellMergeResolution.js +3 -2
- package/dist/prosemirror/commands/tableMergeFoldDecisions.d.ts +4 -4
- package/dist/prosemirror/commentBoundaryOwnership.d.ts +15 -0
- package/dist/prosemirror/commentBoundaryOwnership.js +4 -0
- package/dist/prosemirror/commentIdAllocator.d.ts +8 -8
- package/dist/prosemirror/commentIdAllocator.js +2 -0
- package/dist/prosemirror/commentOps.d.ts +6 -7
- package/dist/prosemirror/commentOps.js +3 -19
- package/dist/prosemirror/commentRangeBoundaryAttrs.d.ts +16 -0
- package/dist/prosemirror/commentRangeBoundaryAttrs.js +51 -0
- package/dist/prosemirror/commentRangeInlineAtoms.d.ts +5 -5
- package/dist/prosemirror/commentRangeInlineAtoms.js +1 -0
- package/dist/prosemirror/commentReferenceAttrs.d.ts +3 -4
- package/dist/prosemirror/commentReferenceAttrs.js +4 -1
- package/dist/prosemirror/commentReferenceIntegrity.d.ts +15 -6
- package/dist/prosemirror/commentReferenceIntegrity.js +93 -1
- package/dist/prosemirror/containerFinalParagraph.d.ts +4 -4
- package/dist/prosemirror/contentControlRevisions.d.ts +7 -7
- package/dist/prosemirror/conversion/effectiveTableCellFormatting.d.ts +4 -4
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +10 -10
- package/dist/prosemirror/conversion/fromProseDoc.js +473 -176
- package/dist/prosemirror/conversion/hyphenTextCarriers.d.ts +2 -3
- package/dist/prosemirror/conversion/markInterner.d.ts +2 -3
- package/dist/prosemirror/conversion/preservedSinkCarriers.d.ts +5 -5
- package/dist/prosemirror/conversion/runShadingMark.d.ts +3 -4
- package/dist/prosemirror/conversion/sdtAttrs.d.ts +6 -7
- package/dist/prosemirror/conversion/toProseDoc.d.ts +15 -9
- package/dist/prosemirror/conversion/toProseDoc.js +318 -202
- package/dist/prosemirror/copyOriginDom.d.ts +8 -0
- package/dist/prosemirror/copyOriginDom.js +21 -0
- package/dist/prosemirror/copyOriginResolution.d.ts +15 -0
- package/dist/prosemirror/copyOriginResolution.js +202 -0
- package/dist/prosemirror/documentSchema.d.ts +2 -3
- package/dist/prosemirror/emptyFieldResultRuns.d.ts +3 -3
- package/dist/prosemirror/emptyRangeAnchor.d.ts +6 -6
- package/dist/prosemirror/executeEditorCommand.d.ts +4 -5
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +2 -3
- package/dist/prosemirror/extensions/StarterKit.d.ts +3 -4
- package/dist/prosemirror/extensions/StarterKit.js +5 -1
- package/dist/prosemirror/extensions/core/DocExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/core/HistoryExtension.js +5 -4
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +8 -9
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +17 -9
- package/dist/prosemirror/extensions/core/TextExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/create.d.ts +4 -5
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +4 -5
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/DropCursorExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/features/GapCursorExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/ImageDragExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/ImagePasteExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +2 -1
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/features/ListExtension.d.ts +6 -7
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +8 -8
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +17 -7
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +18 -18
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +2 -1
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +2 -2
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.d.ts +6 -3
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.js +5 -2
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.d.ts +2 -2
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.js +2 -8
- package/dist/prosemirror/extensions/features/bidiShortcutController.d.ts +5 -6
- package/dist/prosemirror/extensions/features/clipboardTrackedRevisions.d.ts +4 -0
- package/dist/prosemirror/extensions/features/clipboardTrackedRevisions.js +72 -0
- package/dist/prosemirror/extensions/features/pasteCleanup.d.ts +4 -4
- package/dist/prosemirror/extensions/features/pasteCleanup.js +3 -2
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.d.ts +2 -3
- package/dist/prosemirror/extensions/features/pastedHtmlLists.d.ts +3 -4
- package/dist/prosemirror/extensions/markRegistry.d.ts +4 -5
- package/dist/prosemirror/extensions/marks/AllCapsExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/BoldExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/CharacterStyleExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/CommentExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.js +12 -4
- package/dist/prosemirror/extensions/marks/FontSizeExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +42 -4
- package/dist/prosemirror/extensions/marks/HiddenTextExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/HighlightExtension.d.ts +4 -4
- package/dist/prosemirror/extensions/marks/HighlightExtension.js +6 -4
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.d.ts +5 -6
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +9 -3
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/marks/ItalicExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/LanguageExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/RtlExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.d.ts +5 -5
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/marks/RunShadingExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/SmallCapsExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/StrikeExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/StrikeExtension.js +9 -3
- package/dist/prosemirror/extensions/marks/SubscriptExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/SubscriptExtension.js +3 -2
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.js +3 -2
- package/dist/prosemirror/extensions/marks/TextColorExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +7 -6
- package/dist/prosemirror/extensions/marks/TextEffectExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.d.ts +6 -7
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.js +1 -4
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +4 -5
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +18 -2
- package/dist/prosemirror/extensions/marks/UnderlineExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/marks/UnderlineExtension.js +10 -3
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +82 -25
- package/dist/prosemirror/extensions/marks/markUtils.js +138 -74
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.d.ts +3 -3
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.d.ts +6 -3
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.js +4 -4
- package/dist/prosemirror/extensions/nodes/BlockCustomXmlExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/BlockMoveRangeBoundaryExtension.d.ts +24 -0
- package/dist/prosemirror/extensions/nodes/BlockMoveRangeBoundaryExtension.js +59 -0
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +1 -1
- package/dist/prosemirror/extensions/nodes/CommentRangeBoundaryExtension.d.ts +10 -0
- package/dist/prosemirror/extensions/nodes/CommentRangeBoundaryExtension.js +43 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.d.ts +3 -5
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +5 -73
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +4 -4
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +12 -2
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/ImageExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/MathExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.d.ts +4 -4
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.js +8 -4
- package/dist/prosemirror/extensions/nodes/NoteMarkerExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/nodes/PageBreakExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/PageBreakRunExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.d.ts +4 -4
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.js +20 -4
- package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +3 -4
- package/dist/prosemirror/extensions/nodes/ShapeExtension.d.ts +11 -11
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +5 -6
- package/dist/prosemirror/extensions/nodes/SymbolExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/SymbolExtension.js +3 -3
- package/dist/prosemirror/extensions/nodes/TabExtension.d.ts +2 -3
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +10 -10
- package/dist/prosemirror/extensions/nodes/TableExtension.js +11 -13
- package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +4 -5
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.d.ts +7 -5
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.js +9 -3
- package/dist/prosemirror/extensions/types.d.ts +27 -27
- package/dist/prosemirror/fieldRepresentation.d.ts +6 -5
- package/dist/prosemirror/fieldRepresentation.js +13 -3
- package/dist/prosemirror/findReplaceSelection.d.ts +9 -9
- package/dist/prosemirror/hyperlinkRemoval.d.ts +4 -4
- package/dist/prosemirror/hyperlinkRemoval.js +12 -0
- package/dist/prosemirror/imageCommit.d.ts +5 -23
- package/dist/prosemirror/imageCommit.js +1 -29
- package/dist/prosemirror/imagePictureNames.d.ts +4 -5
- package/dist/prosemirror/indexedNodeLookup.d.ts +4 -4
- package/dist/prosemirror/inlineDisplayText.d.ts +4 -5
- package/dist/prosemirror/inlineWrapperStack.d.ts +8 -9
- package/dist/prosemirror/insertOperations.d.ts +4 -4
- package/dist/prosemirror/keptRangeBoundaries.d.ts +76 -0
- package/dist/prosemirror/keptRangeBoundaries.js +381 -0
- package/dist/prosemirror/listAutoformatMarkers.d.ts +3 -4
- package/dist/prosemirror/listInstanceReferences.d.ts +3 -4
- package/dist/prosemirror/listInstanceReferences.js +1 -1
- package/dist/prosemirror/listLabels.d.ts +15 -5
- package/dist/prosemirror/listLabels.js +101 -16
- package/dist/prosemirror/listMarker.d.ts +13 -13
- package/dist/prosemirror/listMarker.js +7 -2
- package/dist/prosemirror/listNumbering.d.ts +11 -11
- package/dist/prosemirror/listNumbering.js +0 -16
- package/dist/prosemirror/listRendering.d.ts +5 -5
- package/dist/prosemirror/listRendering.js +4 -0
- package/dist/prosemirror/listRenderingAttrs.d.ts +12 -11
- package/dist/prosemirror/listRenderingAttrs.js +9 -5
- package/dist/prosemirror/listState.d.ts +9 -10
- package/dist/prosemirror/markupViewNotes.d.ts +2 -3
- package/dist/prosemirror/markupViewProjection.d.ts +9 -8
- package/dist/prosemirror/moveRangeBoundaryAttrs.d.ts +7 -6
- package/dist/prosemirror/moveRangeBoundaryAttrs.js +27 -4
- package/dist/prosemirror/noteReferenceOccurrenceId.d.ts +2 -3
- package/dist/prosemirror/noteReferenceOccurrences.d.ts +9 -9
- package/dist/prosemirror/noteReferenceReview.d.ts +13 -13
- package/dist/prosemirror/noteReferenceReview.js +4 -10
- package/dist/prosemirror/numberedRefFields.d.ts +5 -5
- package/dist/prosemirror/numberingAttr.d.ts +11 -11
- package/dist/prosemirror/outlineLevelAttr.d.ts +3 -4
- package/dist/prosemirror/pageBreakRunProjection.d.ts +5 -5
- package/dist/prosemirror/paraText.d.ts +4 -5
- package/dist/prosemirror/paragraphAlignment.d.ts +2 -3
- package/dist/prosemirror/paragraphDirection.d.ts +8 -9
- package/dist/prosemirror/paragraphFormattingProvenance.d.ts +14 -7
- package/dist/prosemirror/paragraphFormattingProvenance.js +8 -0
- package/dist/prosemirror/paragraphIndentation.d.ts +7 -7
- package/dist/prosemirror/paragraphList.d.ts +39 -0
- package/dist/prosemirror/paragraphList.js +81 -0
- package/dist/prosemirror/paragraphMarkJoin.d.ts +12 -2
- package/dist/prosemirror/paragraphMarkJoin.js +34 -3
- package/dist/prosemirror/paragraphPropertyCarry.d.ts +7 -7
- package/dist/prosemirror/paragraphSpacing.d.ts +9 -9
- package/dist/prosemirror/paragraphSpacing.js +16 -10
- package/dist/prosemirror/pluginKeyOwner.d.ts +3 -4
- package/dist/prosemirror/plugins/aiCitationDecorations.d.ts +6 -6
- package/dist/prosemirror/plugins/aiCitationDecorations.js +0 -12
- package/dist/prosemirror/plugins/aiSuggestionDecorations.d.ts +6 -6
- package/dist/prosemirror/plugins/aiSuggestionDecorations.js +0 -14
- package/dist/prosemirror/plugins/anonymizationDecorations.d.ts +9 -9
- package/dist/prosemirror/plugins/anonymizationDecorations.js +0 -18
- package/dist/prosemirror/plugins/autocompleteSuggestion.d.ts +19 -19
- package/dist/prosemirror/plugins/autocompleteSuggestion.js +3 -25
- package/dist/prosemirror/plugins/contentControlWidgets.d.ts +10 -10
- package/dist/prosemirror/plugins/contentControlWidgets.js +13 -7
- package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +6 -6
- package/dist/prosemirror/plugins/documentNumbering.d.ts +11 -9
- package/dist/prosemirror/plugins/documentNumbering.js +42 -42
- package/dist/prosemirror/plugins/documentStyleState.d.ts +5 -6
- package/dist/prosemirror/plugins/documentStyles.d.ts +4 -4
- package/dist/prosemirror/plugins/documentStyles.js +2 -1
- package/dist/prosemirror/plugins/lockedControlKeyHandling.d.ts +4 -0
- package/dist/prosemirror/plugins/lockedControlKeyHandling.js +16 -0
- package/dist/prosemirror/plugins/paragraphStyleResolution.d.ts +3 -3
- package/dist/prosemirror/plugins/paragraphStyleResolution.js +23 -1
- package/dist/prosemirror/plugins/pmTextScan.d.ts +5 -6
- package/dist/prosemirror/plugins/revisionIds.d.ts +11 -11
- package/dist/prosemirror/plugins/revisionIds.js +11 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +7 -8
- package/dist/prosemirror/plugins/suggestionMode.d.ts +16 -16
- package/dist/prosemirror/plugins/suggestionMode.js +11 -3
- package/dist/prosemirror/plugins/templateDirectives.d.ts +8 -8
- package/dist/prosemirror/plugins/templateDirectives.js +0 -17
- package/dist/prosemirror/plugins/templatePreviewValues.d.ts +12 -12
- package/dist/prosemirror/plugins/templatePreviewValues.js +0 -23
- package/dist/prosemirror/plugins/templateSlashMenu.d.ts +10 -11
- package/dist/prosemirror/plugins/templateSlashMenu.js +3 -21
- package/dist/prosemirror/plugins/transactionInvariants.d.ts +7 -8
- package/dist/prosemirror/positionSweep.d.ts +4 -5
- package/dist/prosemirror/positionSweep.js +1 -1
- package/dist/prosemirror/preservedXmlReview.d.ts +2 -3
- package/dist/prosemirror/queries.d.ts +5 -6
- package/dist/prosemirror/rangeAnchorAttrs.d.ts +4 -5
- package/dist/prosemirror/rangeAnchorAttrs.js +4 -1
- package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +3 -3
- package/dist/prosemirror/rebaseParagraphRunFormatting.js +6 -5
- package/dist/prosemirror/rebaseParagraphRuns.d.ts +4 -4
- package/dist/prosemirror/rebaseParagraphRuns.js +15 -11
- package/dist/prosemirror/rejoinRunCarriers.d.ts +3 -3
- package/dist/prosemirror/replacedAnnotations.d.ts +31 -17
- package/dist/prosemirror/replacedAnnotations.js +80 -11
- package/dist/prosemirror/revisionCarriers.d.ts +13 -13
- package/dist/prosemirror/runContentProjection.d.ts +6 -0
- package/dist/prosemirror/runContentProjection.js +24 -0
- package/dist/prosemirror/runFormattingFromMarks.d.ts +5 -6
- package/dist/prosemirror/runFormattingFromMarks.js +19 -17
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +16 -15
- package/dist/prosemirror/runFormattingInlineCarriers.js +1 -0
- package/dist/prosemirror/runFormattingMarkNames.d.ts +2 -3
- package/dist/prosemirror/runFormattingProvenance.d.ts +5 -6
- package/dist/prosemirror/runFormattingReconciliation.d.ts +4 -4
- package/dist/prosemirror/runFormattingReconciliation.js +6 -4
- package/dist/prosemirror/runIdentity.d.ts +6 -7
- package/dist/prosemirror/runIdentityAcrossRevisions.d.ts +16 -5
- package/dist/prosemirror/runIdentityAcrossRevisions.js +92 -32
- package/dist/prosemirror/runPropertyChangeResolution.d.ts +3 -3
- package/dist/prosemirror/runPropertyChangeResolution.js +11 -10
- package/dist/prosemirror/runStyleFormatting.d.ts +16 -16
- package/dist/prosemirror/runStyleFormatting.js +4 -2
- package/dist/prosemirror/schema/index.d.ts +6 -6
- package/dist/prosemirror/schema/marks.d.ts +36 -39
- package/dist/prosemirror/schema/nodes.d.ts +42 -35
- package/dist/prosemirror/sectionCarrier.d.ts +7 -8
- package/dist/prosemirror/sectionMarkEdits.d.ts +3 -4
- package/dist/prosemirror/sectionMarkEdits.js +21 -1
- package/dist/prosemirror/selectionMarks.d.ts +2 -2
- package/dist/prosemirror/selectionState.d.ts +5 -6
- package/dist/prosemirror/selectionState.js +1 -4
- package/dist/prosemirror/shapeGeometryAdjustments.d.ts +2 -3
- package/dist/prosemirror/storyListNumbering.d.ts +2 -2
- package/dist/prosemirror/storyListNumbering.js +2 -1
- package/dist/prosemirror/styles/index.js +1 -2
- package/dist/prosemirror/styles/paragraphStyleCascade.d.ts +9 -9
- package/dist/prosemirror/styles/paragraphStyleCascade.js +17 -2
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +8 -8
- package/dist/prosemirror/styles/styleResolver.d.ts +6 -7
- package/dist/prosemirror/styles/styleResolver.js +17 -0
- package/dist/prosemirror/styles/styleToggleCascade.d.ts +4 -4
- package/dist/prosemirror/styles/tableStyleRegions.d.ts +5 -6
- package/dist/prosemirror/tableCellMergeRevision.d.ts +3 -4
- package/dist/prosemirror/tableCellPaste.d.ts +11 -12
- package/dist/prosemirror/tableCellRevisionVisibility.d.ts +2 -3
- package/dist/prosemirror/tableGridMutation.d.ts +12 -12
- package/dist/prosemirror/tableResize.d.ts +18 -18
- package/dist/prosemirror/tableResize.js +64 -53
- package/dist/prosemirror/tableRunIn.d.ts +10 -5
- package/dist/prosemirror/tableRunIn.js +44 -9
- package/dist/prosemirror/textBoxAnchorAttrs.d.ts +3 -4
- package/dist/prosemirror/textBoxAnchorAttrs.js +4 -1
- package/dist/prosemirror/textBoxHostCollapse.d.ts +8 -0
- package/dist/prosemirror/textBoxHostCollapse.js +79 -0
- package/dist/prosemirror/textBoxHostParagraph.d.ts +2 -3
- package/dist/prosemirror/textInput.d.ts +12 -6
- package/dist/prosemirror/textInput.js +26 -2
- package/dist/prosemirror/trackedRevisionPath.d.ts +6 -6
- package/dist/prosemirror/trackedRevisionPath.js +7 -4
- package/dist/prosemirror/trackedRunInlineAtoms.d.ts +8 -8
- package/dist/prosemirror/trackedRunInlineAtoms.js +3 -2
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +4 -5
- package/dist/prosemirror/utils/findParagraphByParaId.d.ts +3 -4
- package/dist/prosemirror/utils/tabCalculator.js +1 -2
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +7 -7
- package/dist/prosemirror/utils/visualLineNavigation.js +2 -14
- package/dist/prosemirror/validation.d.ts +7 -8
- package/dist/prosemirror/validation.js +25 -10
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +15 -15
- package/dist/prosemirror/yjsDocumentMetadata.js +15 -12
- package/dist/prosemirror/zeroWidthAnchors.d.ts +7 -6
- package/dist/prosemirror/zeroWidthAnchors.js +53 -16
- package/dist/redline.d.ts +8 -8
- package/dist/redline.js +2 -1
- package/dist/redlineOperationLimit.d.ts +3 -3
- package/dist/render-dom/BodySelectionOverlay.d.ts +4 -5
- package/dist/render-dom/HeaderFooterSelectionOverlay.d.ts +6 -7
- package/dist/render-dom/RemoteSelectionOverlay.d.ts +5 -6
- package/dist/render-dom/RenderedDomContext.d.ts +6 -7
- package/dist/render-dom/commentAnchorAttributes.d.ts +6 -6
- package/dist/render-dom/resolveSidebarItemPositions.d.ts +5 -6
- package/dist/reviewHistoryLimits.d.ts +3 -0
- package/dist/reviewHistoryLimits.js +4 -0
- package/dist/server.d.ts +2 -1
- package/dist/server.js +2 -1
- package/dist/shaping/placeRun.d.ts +7 -8
- package/dist/shaping/shaper.d.ts +16 -16
- package/dist/style-engine/index.js +1 -2
- package/dist/style-engine/styleEngine.d.ts +5 -6
- package/dist/style-sets/extract.d.ts +8 -9
- package/dist/style-sets/stellaStyle.d.ts +4 -5
- package/dist/style-sets/styleSetNormalization.d.ts +6 -7
- package/dist/style-sets/types.d.ts +5 -6
- package/dist/symbols.d.ts +8 -9
- package/dist/types/block-id.d.ts +11 -12
- package/dist/types/canonicalCapabilities.d.ts +11 -19
- package/dist/types/canonicalCapabilities.js +5 -12
- package/dist/types/canonicalComments.d.ts +3 -4
- package/dist/types/canonicalSave.d.ts +2 -3
- package/dist/types/canonicalSections.d.ts +2 -3
- package/dist/types/documentEnumValues.d.ts +48 -49
- package/dist/types/docxSerialization.d.ts +4 -5
- package/dist/types/editor-story.d.ts +2 -3
- package/dist/types/remote-selection.d.ts +2 -3
- package/dist/types/wrap.d.ts +5 -6
- package/dist/utils/authorColors.d.ts +4 -5
- package/dist/utils/base64.d.ts +2 -2
- package/dist/utils/baseDirection.d.ts +4 -5
- package/dist/utils/borderCss.d.ts +9 -10
- package/dist/utils/boundedContentIdentity.d.ts +13 -0
- package/dist/utils/boundedContentIdentity.js +42 -0
- package/dist/utils/canonicalJson.d.ts +2 -3
- package/dist/utils/clipboard.d.ts +22 -22
- package/dist/utils/clipboard.js +9 -6
- package/dist/utils/colorResolver.d.ts +22 -23
- package/dist/utils/colorResolver.js +0 -20
- package/dist/utils/createDocument.d.ts +4 -4
- package/dist/utils/cursiveJoining.d.ts +7 -8
- package/dist/utils/documentLoaderBehavior.d.ts +3 -4
- package/dist/utils/documentPointerDown.d.ts +5 -0
- package/dist/utils/documentPointerDown.js +28 -0
- package/dist/utils/docxInput.d.ts +3 -4
- package/dist/utils/domGuards.d.ts +7 -8
- package/dist/utils/findMatchView.d.ts +4 -4
- package/dist/utils/findReplace.d.ts +16 -16
- package/dist/utils/findSearchKey.d.ts +5 -5
- package/dist/utils/findVerticalScrollParent.d.ts +3 -4
- package/dist/utils/fontFamilyMerge.d.ts +2 -2
- package/dist/utils/fontLoader.d.ts +12 -13
- package/dist/utils/fontResolver.d.ts +16 -14
- package/dist/utils/fontResolver.js +33 -5
- package/dist/utils/fontWeights.d.ts +2 -3
- package/dist/utils/formatToStyle.d.ts +14 -14
- package/dist/utils/formatToStyle.js +17 -15
- package/dist/utils/headerFooter.d.ts +11 -12
- package/dist/utils/headerFooter.js +10 -0
- package/dist/utils/headingCollector.d.ts +3 -4
- package/dist/utils/hexId.d.ts +6 -7
- package/dist/utils/hexId.js +1 -1
- package/dist/utils/horizontalScale.d.ts +5 -6
- package/dist/utils/htmlComments.d.ts +2 -3
- package/dist/utils/imageLuminance.d.ts +4 -5
- package/dist/utils/imageResize.d.ts +18 -0
- package/dist/utils/imageResize.js +37 -0
- package/dist/utils/imageValidation.d.ts +3 -4
- package/dist/utils/imageValidation.js +1 -1
- package/dist/utils/joiningTypes.gen.d.ts +5 -6
- package/dist/utils/mergeDocumentContent.d.ts +2 -3
- package/dist/utils/mergeDocumentContent.js +7 -0
- package/dist/utils/noteReferenceLabels.d.ts +7 -8
- package/dist/utils/ooxmlSymbol.d.ts +5 -3
- package/dist/utils/ooxmlSymbol.js +51 -1
- package/dist/utils/outlineDepth.d.ts +4 -5
- package/dist/utils/paragraphBaseDirection.d.ts +2 -3
- package/dist/utils/paragraphBaseDirection.js +2 -1
- package/dist/utils/paragraphFormattingMerge.d.ts +4 -5
- package/dist/utils/paragraphFormattingMerge.js +2 -0
- package/dist/utils/paragraphFrame.d.ts +20 -0
- package/dist/utils/paragraphFrame.js +13 -0
- package/dist/utils/paragraphInlineLayout.d.ts +101 -4
- package/dist/utils/paragraphInlineLayout.js +164 -1
- package/dist/utils/replaceText.d.ts +2 -2
- package/dist/utils/replaceText.js +4 -0
- package/dist/utils/rotationBoundingBox.d.ts +7 -8
- package/dist/utils/sanitizeImageSrc.d.ts +3 -4
- package/dist/utils/scriptSegments.d.ts +34 -16
- package/dist/utils/scriptSegments.js +26 -6
- package/dist/utils/sliceText.js +1 -2
- package/dist/utils/stripXmlDeclarations.d.ts +2 -3
- package/dist/utils/tableOfContentsStyle.d.ts +2 -2
- package/dist/utils/tableOperations.d.ts +16 -17
- package/dist/utils/tableOperations.js +44 -41
- package/dist/utils/tablePlacement.d.ts +3 -4
- package/dist/utils/textAdvanceGapsDom.d.ts +8 -0
- package/dist/utils/textAdvanceGapsDom.js +49 -0
- package/dist/utils/textDirectionFlow.d.ts +3 -4
- package/dist/utils/textEncoding.js +1 -2
- package/dist/utils/textFormattingMerge.d.ts +4 -5
- package/dist/utils/tiffConverter.d.ts +5 -6
- package/dist/utils/trailingText.d.ts +4 -5
- package/dist/utils/units.d.ts +19 -20
- package/dist/utils/urlSecurity.d.ts +6 -6
- package/dist/utils/urlSecurity.js +2 -1
- package/dist/utils/zoom.d.ts +4 -5
- package/dist/version-comparison.d.ts +28 -28
- package/dist/version-comparison.js +8 -7
- package/dist/watermark/index.d.ts +5 -5
- package/dist/watermark/index.js +9 -0
- package/package.json +16 -16
|
@@ -4,6 +4,7 @@ import { isInlineSdtContent, isTrackedChangeWrapperChild } from "../../docx/inli
|
|
|
4
4
|
import { listRenderingDefinitionsMatch, resolveListRenderingDefinition } from "../../docx/listRendering.js";
|
|
5
5
|
import { getCachedNumberingMap } from "../../docx/numberingParser.js";
|
|
6
6
|
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, createProseParagraphWithPropertySource, getDocumentParagraphPropertySourceContract, paragraphFormattingWithAuthoredIndentation, proseParagraphAttrsWithoutPropertySource, recreateProseNodeWithParagraphPropertySource, transportTableCellsWithParagraphPropertySources } from "../../docx/paragraphPropertySource.js";
|
|
7
|
+
import { visitInlineContentSlots, visitInlineContentSlotsInContent } from "../../docx/paragraphTraversal.js";
|
|
7
8
|
import { isBaselineVertAlign } from "../../docx/runParser.js";
|
|
8
9
|
import { replayableShapeAlternateContent } from "../../docx/shapeAlternateContent.js";
|
|
9
10
|
import { resolveTableLook } from "../../docx/tableLook.js";
|
|
@@ -23,14 +24,18 @@ import { withAlternateContent } from "../alternateContentAttrs.js";
|
|
|
23
24
|
import { expectInlineWrapperMarkAttrs, expectTrackedChangeMarkAttrs } from "../attrs/index.js";
|
|
24
25
|
import { authoredTransformAttrs } from "../authoredTransformAttrs.js";
|
|
25
26
|
import { setAutospacingBaseValue } from "../autospacingBase.js";
|
|
27
|
+
import { bookmarkBoundaryAttrsFromMarker } from "../bookmarkBoundaryAttrs.js";
|
|
28
|
+
import { trackedCommentBoundaryOwner } from "../commentBoundaryOwnership.js";
|
|
26
29
|
import { withEnclosingRevision } from "../contentControlRevisions.js";
|
|
27
30
|
import { emptyFieldRunPropertyChanges } from "../emptyFieldResultRuns.js";
|
|
28
31
|
import { planEmptyRanges } from "../emptyRangeAnchor.js";
|
|
29
32
|
import { textFormattingToMarks } from "../extensions/marks/markUtils.js";
|
|
33
|
+
import { BLOCK_MOVE_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/BlockMoveRangeBoundaryExtension.js";
|
|
34
|
+
import { COMMENT_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/CommentRangeBoundaryExtension.js";
|
|
30
35
|
import { MOVE_RANGE_BOUNDARY_NODE_NAME } from "../extensions/nodes/MoveRangeBoundaryExtension.js";
|
|
31
36
|
import { RANGE_ANCHOR_NODE_NAME } from "../extensions/nodes/RangeAnchorExtension.js";
|
|
32
37
|
import "../extensions/nodes/SdtExtension.js";
|
|
33
|
-
import { fieldRequiresStructuredContent } from "../fieldRepresentation.js";
|
|
38
|
+
import { fieldCommentCoverage, fieldRequiresStructuredContent } from "../fieldRepresentation.js";
|
|
34
39
|
import { getInlineDisplayText } from "../inlineDisplayText.js";
|
|
35
40
|
import { inlineWrapperLayer } from "../inlineWrapperStack.js";
|
|
36
41
|
import { CLEARED_LIST_RENDERING_ATTRS } from "../listMarker.js";
|
|
@@ -42,8 +47,9 @@ import { pageBreakRunParagraphProjectionDispositionForFeatures } from "../pageBr
|
|
|
42
47
|
import { directionFromBidi } from "../paragraphDirection.js";
|
|
43
48
|
import { paragraphIndentationFromFormatting } from "../paragraphIndentation.js";
|
|
44
49
|
import { lineSpacingProvenanceFromSpacing } from "../paragraphSpacing.js";
|
|
50
|
+
import { isRunContentProjectionNode } from "../runContentProjection.js";
|
|
45
51
|
import { RUN_IDENTITY_MARK_NAME, hasRunIdentityPayload, runIdentityAttrs } from "../runIdentity.js";
|
|
46
|
-
import { continueSourceCarrierIdentitiesAcrossRevisions } from "../runIdentityAcrossRevisions.js";
|
|
52
|
+
import { continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks, continueSourceCarrierIdentitiesAcrossRevisions } from "../runIdentityAcrossRevisions.js";
|
|
47
53
|
import { getParagraphMarkSuppressionOverrides, hasDirectRunFormatting, isParagraphMarkSuppressionEligible, resolveParagraphInheritedRunFormatting, stripParagraphMarkFormattingForBodyRuns, stripParagraphMarkOnlyFormatting, suppressParagraphMarkFormatting } from "../runStyleFormatting.js";
|
|
48
54
|
import { schema } from "../schema/index.js";
|
|
49
55
|
import { PRESERVED_XML_LEVELS } from "../schema/nodes.js";
|
|
@@ -61,19 +67,6 @@ import { sdtAttrsFromProperties } from "./sdtAttrs.js";
|
|
|
61
67
|
import { panic } from "better-result";
|
|
62
68
|
import { DRAWING_RAW_XML_MODES, PARSE_WARNING_CODES } from "@stll/docx-core/model";
|
|
63
69
|
//#region src/prosemirror/conversion/toProseDoc.ts
|
|
64
|
-
/**
|
|
65
|
-
* Document to ProseMirror Conversion
|
|
66
|
-
*
|
|
67
|
-
* Converts our Document type (from DOCX parsing) to a ProseMirror document.
|
|
68
|
-
* Preserves all formatting attributes for round-trip fidelity.
|
|
69
|
-
*
|
|
70
|
-
* Style Resolution:
|
|
71
|
-
* When styles are provided, paragraph properties are resolved from the style chain:
|
|
72
|
-
* - Document defaults (docDefaults)
|
|
73
|
-
* - Normal style (if no explicit styleId)
|
|
74
|
-
* - Style chain (basedOn inheritance)
|
|
75
|
-
* - Inline properties (highest priority)
|
|
76
|
-
*/
|
|
77
70
|
const DETACHED_WATERMARK_HOST = Symbol.for("stll.detachedWatermarkHost");
|
|
78
71
|
const noPageBreakProjectionWarning = () => {};
|
|
79
72
|
const pageBreakProjectionWarn = (warn) => warn === void 0 ? noPageBreakProjectionWarning : (detail) => {
|
|
@@ -162,6 +155,13 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
162
155
|
case "bookmarkEnd":
|
|
163
156
|
countBoundary(child.id, "end");
|
|
164
157
|
break;
|
|
158
|
+
case "commentRangeStart":
|
|
159
|
+
case "commentRangeEnd": break;
|
|
160
|
+
case "commentReference":
|
|
161
|
+
case "moveFromRangeStart":
|
|
162
|
+
case "moveFromRangeEnd":
|
|
163
|
+
case "moveToRangeStart":
|
|
164
|
+
case "moveToRangeEnd": break;
|
|
165
165
|
case "run":
|
|
166
166
|
visitRun(child);
|
|
167
167
|
break;
|
|
@@ -235,6 +235,10 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
235
235
|
case "bookmarkEnd":
|
|
236
236
|
countBoundary(block.id, "end");
|
|
237
237
|
break;
|
|
238
|
+
case "moveFromRangeStart":
|
|
239
|
+
case "moveFromRangeEnd":
|
|
240
|
+
case "moveToRangeStart":
|
|
241
|
+
case "moveToRangeEnd": break;
|
|
238
242
|
default: panic(`Unsupported block content: ${JSON.stringify(block)}`);
|
|
239
243
|
}
|
|
240
244
|
};
|
|
@@ -295,6 +299,12 @@ function toProseDoc(document, options) {
|
|
|
295
299
|
case "bookmarkEnd":
|
|
296
300
|
out.push(convertBlockBookmarkBoundary(block));
|
|
297
301
|
break;
|
|
302
|
+
case "moveFromRangeStart":
|
|
303
|
+
case "moveFromRangeEnd":
|
|
304
|
+
case "moveToRangeStart":
|
|
305
|
+
case "moveToRangeEnd":
|
|
306
|
+
out.push(convertBlockMoveRangeBoundary(block));
|
|
307
|
+
break;
|
|
298
308
|
default: panic(`Unsupported block content: ${JSON.stringify(block)}`);
|
|
299
309
|
}
|
|
300
310
|
return out;
|
|
@@ -309,7 +319,7 @@ function toProseDoc(document, options) {
|
|
|
309
319
|
_finalSectionStart: finalSectionStart,
|
|
310
320
|
_adjustLineHeightInTable: adjustLineHeightInTable,
|
|
311
321
|
_doNotUseIndentAsNumberingTabStop: doNotUseIndentAsNumberingTabStop
|
|
312
|
-
}, nodes));
|
|
322
|
+
}, [...continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks(nodes)]));
|
|
313
323
|
assertValidProseMirrorDocument(pmDoc, "Document conversion produced an invalid ProseMirror document");
|
|
314
324
|
return pmDoc;
|
|
315
325
|
}
|
|
@@ -335,18 +345,11 @@ function convertPreservedBlock(block) {
|
|
|
335
345
|
* has gone.
|
|
336
346
|
*/
|
|
337
347
|
function convertBlockBookmarkBoundary(block) {
|
|
338
|
-
return schema.node("blockBookmarkBoundary", block
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
colLast: block.colLast,
|
|
344
|
-
displacedByCustomXml: block.displacedByCustomXml
|
|
345
|
-
} : {
|
|
346
|
-
type: "end",
|
|
347
|
-
id: block.id,
|
|
348
|
-
displacedByCustomXml: block.displacedByCustomXml
|
|
349
|
-
});
|
|
348
|
+
return schema.node("blockBookmarkBoundary", bookmarkBoundaryAttrsFromMarker(block));
|
|
349
|
+
}
|
|
350
|
+
/** A move range marker standing between blocks, kept between the same two. */
|
|
351
|
+
function convertBlockMoveRangeBoundary(block) {
|
|
352
|
+
return schema.node(BLOCK_MOVE_RANGE_BOUNDARY_NODE_NAME, { marker: block });
|
|
350
353
|
}
|
|
351
354
|
/**
|
|
352
355
|
* Carry an inline child folio does not model into the editor as an opaque atom.
|
|
@@ -485,9 +488,11 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
485
488
|
let bookmarksArr;
|
|
486
489
|
let emptyHyperlinks;
|
|
487
490
|
let wrapperStack = [];
|
|
488
|
-
|
|
491
|
+
let paragraphContainsInlineSdt = false;
|
|
492
|
+
const emitInlineNodes = (nodes, commentsAlreadyApplied = false) => {
|
|
489
493
|
if (nodes.length === 0) return;
|
|
490
|
-
const
|
|
494
|
+
const wrappedNodes = withInlineWrapperMark(nodes, wrapperStack);
|
|
495
|
+
const markedNodes = commentsAlreadyApplied ? wrappedNodes : applyCommentMarks(wrappedNodes, openCommentIds);
|
|
491
496
|
inlineNodes.push(...markedNodes);
|
|
492
497
|
for (const node of markedNodes) inlineOffset += node.nodeSize;
|
|
493
498
|
};
|
|
@@ -559,9 +564,12 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
559
564
|
historical: getHistoricalRunFormatting
|
|
560
565
|
};
|
|
561
566
|
const emitTrackedChange = (change, markType, moveKind) => {
|
|
562
|
-
emitInlineNodes(convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runScope, trackedRunFormattingResolvers, styleResolver, moveKind, textBoxAnchors, wrapperStack));
|
|
567
|
+
emitInlineNodes(convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runScope, trackedRunFormattingResolvers, styleResolver, moveKind, textBoxAnchors, wrapperStack, openCommentIds, { preserveSdtBoundaryOccurrences: paragraphContainsInlineSdt }), true);
|
|
563
568
|
};
|
|
564
569
|
const stacked = withInlineWrapperStacks(paragraph.content);
|
|
570
|
+
visitInlineContentSlots(paragraph, ({ item }) => {
|
|
571
|
+
if (item.type === "inlineSdt") paragraphContainsInlineSdt = true;
|
|
572
|
+
});
|
|
565
573
|
const emptyRanges = planEmptyRanges(stacked.map((item) => item.content));
|
|
566
574
|
for (const [index, { content, stack }] of stacked.entries()) {
|
|
567
575
|
wrapperStack = stack;
|
|
@@ -574,9 +582,11 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
574
582
|
switch (content.type) {
|
|
575
583
|
case "commentRangeStart":
|
|
576
584
|
openCommentIds.add(content.id);
|
|
585
|
+
if (paragraphContainsInlineSdt) emitInlineNodes([schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: content })], true);
|
|
577
586
|
break;
|
|
578
587
|
case "commentRangeEnd":
|
|
579
588
|
openCommentIds.delete(content.id);
|
|
589
|
+
if (paragraphContainsInlineSdt) emitInlineNodes([schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: content })], true);
|
|
580
590
|
break;
|
|
581
591
|
case "commentReference":
|
|
582
592
|
if (!storyRangedCommentIds.has(content.id)) anchorPointComment(inlineNodes, content.id);
|
|
@@ -591,7 +601,8 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
591
601
|
styleResolver,
|
|
592
602
|
hyperlinkIndex: nextHyperlinkInstanceIndex(),
|
|
593
603
|
textBoxAnchors,
|
|
594
|
-
runScope
|
|
604
|
+
runScope,
|
|
605
|
+
openCommentIds
|
|
595
606
|
});
|
|
596
607
|
if (linkNodes.length === 0) {
|
|
597
608
|
const emptyWrapperStacks = emptyInlineWrapperStacks(content.children);
|
|
@@ -609,21 +620,22 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
609
620
|
});
|
|
610
621
|
break;
|
|
611
622
|
}
|
|
612
|
-
emitInlineNodes(linkNodes);
|
|
623
|
+
emitInlineNodes(linkNodes, true);
|
|
613
624
|
break;
|
|
614
625
|
}
|
|
615
626
|
case "simpleField":
|
|
616
627
|
case "complexField":
|
|
617
|
-
|
|
628
|
+
emitInlineNodes([convertField(content, {
|
|
618
629
|
getInheritedRunFormatting,
|
|
619
630
|
styleResolver,
|
|
620
631
|
nextHyperlinkInstanceIndex,
|
|
621
632
|
runScope,
|
|
622
|
-
textBoxAnchors
|
|
623
|
-
|
|
633
|
+
textBoxAnchors,
|
|
634
|
+
openCommentIds
|
|
635
|
+
})].filter((node) => node !== null), true);
|
|
624
636
|
break;
|
|
625
637
|
case "inlineSdt":
|
|
626
|
-
|
|
638
|
+
emitInlineNodes([convertInlineSdt(content, nextHyperlinkInstanceIndex, runScope, getInheritedRunFormatting, trackedRunFormattingResolvers, styleResolver, textBoxAnchors, stack, openCommentIds)].filter((node) => node !== null), true);
|
|
627
639
|
break;
|
|
628
640
|
case "insertion":
|
|
629
641
|
case "moveTo":
|
|
@@ -637,15 +649,8 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
637
649
|
emitInlineNode(convertMathEquation(content));
|
|
638
650
|
break;
|
|
639
651
|
case "bookmarkStart":
|
|
640
|
-
if (pairedBookmarkIds.has(content.id)) {
|
|
641
|
-
emitInlineNode(schema.node("bookmarkBoundary",
|
|
642
|
-
type: "start",
|
|
643
|
-
id: content.id,
|
|
644
|
-
name: content.name,
|
|
645
|
-
colFirst: content.colFirst,
|
|
646
|
-
colLast: content.colLast,
|
|
647
|
-
displacedByCustomXml: content.displacedByCustomXml
|
|
648
|
-
}));
|
|
652
|
+
if (pairedBookmarkIds.has(content.id) || content.copyOriginAncestors !== void 0) {
|
|
653
|
+
emitInlineNode(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(content)));
|
|
649
654
|
break;
|
|
650
655
|
}
|
|
651
656
|
if (!bookmarksArr) bookmarksArr = [];
|
|
@@ -655,11 +660,7 @@ function convertParagraph(paragraph, styleResolver, context, extraRunFormatting,
|
|
|
655
660
|
});
|
|
656
661
|
break;
|
|
657
662
|
case "bookmarkEnd":
|
|
658
|
-
if (pairedBookmarkIds.has(content.id)) emitInlineNode(schema.node("bookmarkBoundary",
|
|
659
|
-
type: "end",
|
|
660
|
-
id: content.id,
|
|
661
|
-
displacedByCustomXml: content.displacedByCustomXml
|
|
662
|
-
}));
|
|
663
|
+
if (pairedBookmarkIds.has(content.id) || content.copyOriginAncestors !== void 0) emitInlineNode(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(content)));
|
|
663
664
|
break;
|
|
664
665
|
case "moveFromRangeStart":
|
|
665
666
|
case "moveFromRangeEnd":
|
|
@@ -737,17 +738,52 @@ const withTrackedRunMark = (node, mark, ancestor) => {
|
|
|
737
738
|
if (canCarryTrackedRunMark(node)) return node.mark(mark.addToSet(node.marks));
|
|
738
739
|
return node;
|
|
739
740
|
};
|
|
740
|
-
|
|
741
|
-
* Convert tracked change (insertion or deletion) content to PM nodes with
|
|
742
|
-
* an insertion/deletion mark applied.
|
|
743
|
-
*/
|
|
744
|
-
function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runScope, runFormattingResolvers, styleResolver, moveKind = null, textBoxAnchors, wrappedBy = []) {
|
|
741
|
+
function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runScope, runFormattingResolvers, styleResolver, moveKind, textBoxAnchors, wrappedBy, openCommentIds, options = {}) {
|
|
745
742
|
const nodes = [];
|
|
743
|
+
const preserveParentBoundaryOwnership = options.preserveParentBoundaryOwnership ?? true;
|
|
744
|
+
const commentRangeBoundaries = [];
|
|
745
|
+
const commentsOpenBeforeRevision = new Set(openCommentIds);
|
|
746
|
+
const recordCommentBoundary = (type, commentId, owner) => {
|
|
747
|
+
commentRangeBoundaries.push({
|
|
748
|
+
type,
|
|
749
|
+
commentId,
|
|
750
|
+
owner: trackedCommentBoundaryOwner({
|
|
751
|
+
boundaries: commentRangeBoundaries,
|
|
752
|
+
type,
|
|
753
|
+
commentId,
|
|
754
|
+
fallback: owner
|
|
755
|
+
})
|
|
756
|
+
});
|
|
757
|
+
};
|
|
746
758
|
const getTrackedRunFormatting = markType === "deletion" ? runFormattingResolvers.historical : runFormattingResolvers.current;
|
|
747
|
-
|
|
759
|
+
const stacked = withInlineWrapperStacks(change.content);
|
|
760
|
+
let containsInlineSdt = false;
|
|
761
|
+
if (options.preserveSdtBoundaryOccurrences === void 0) visitInlineContentSlotsInContent(change.content, ({ item }) => {
|
|
762
|
+
if (item.type === "inlineSdt") containsInlineSdt = true;
|
|
763
|
+
});
|
|
764
|
+
const preserveBoundaryOccurrences = options.preserveSdtBoundaryOccurrences ?? containsInlineSdt;
|
|
765
|
+
const emptyRanges = planEmptyRanges(stacked.map(({ content }) => content));
|
|
766
|
+
for (const [index, { content: item, stack }] of stacked.entries()) {
|
|
748
767
|
if (!isTrackedChangeWrapperChild(item)) continue;
|
|
749
768
|
const itemNodes = [];
|
|
750
|
-
|
|
769
|
+
let commentsAlreadyApplied = false;
|
|
770
|
+
const anchored = emptyRanges.anchorAt.get(index);
|
|
771
|
+
if (anchored) itemNodes.push(schema.node(RANGE_ANCHOR_NODE_NAME, anchored));
|
|
772
|
+
else if (emptyRanges.closedAt.has(index)) continue;
|
|
773
|
+
else if (item.type === "commentRangeStart") {
|
|
774
|
+
openCommentIds.add(item.id);
|
|
775
|
+
if (preserveBoundaryOccurrences) {
|
|
776
|
+
itemNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: item }));
|
|
777
|
+
commentsAlreadyApplied = true;
|
|
778
|
+
} else recordCommentBoundary("start", item.id, "revision");
|
|
779
|
+
} else if (item.type === "commentRangeEnd") {
|
|
780
|
+
openCommentIds.delete(item.id);
|
|
781
|
+
if (preserveBoundaryOccurrences) {
|
|
782
|
+
itemNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: item }));
|
|
783
|
+
commentsAlreadyApplied = true;
|
|
784
|
+
} else recordCommentBoundary("end", item.id, "revision");
|
|
785
|
+
} else if (item.type === "commentReference") itemNodes.push(schema.node("commentReference", { commentId: item.id }));
|
|
786
|
+
else if (item.type === "run") itemNodes.push(...convertRun(item, getTrackedRunFormatting(item.formatting), runScope, styleResolver, textBoxAnchors));
|
|
751
787
|
else if (item.type === "hyperlink") {
|
|
752
788
|
const currentHyperlinkIndex = nextHyperlinkInstanceIndex();
|
|
753
789
|
itemNodes.push(...convertHyperlink(item, {
|
|
@@ -755,45 +791,47 @@ function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runS
|
|
|
755
791
|
styleResolver,
|
|
756
792
|
hyperlinkIndex: currentHyperlinkIndex,
|
|
757
793
|
textBoxAnchors,
|
|
758
|
-
runScope
|
|
794
|
+
runScope,
|
|
795
|
+
openCommentIds
|
|
759
796
|
}));
|
|
797
|
+
commentsAlreadyApplied = true;
|
|
760
798
|
} else if (item.type === "simpleField" || item.type === "complexField") {
|
|
761
799
|
const fieldNode = convertField(item, {
|
|
762
800
|
getInheritedRunFormatting: getTrackedRunFormatting,
|
|
763
801
|
styleResolver,
|
|
764
802
|
nextHyperlinkInstanceIndex,
|
|
765
803
|
runScope,
|
|
766
|
-
textBoxAnchors
|
|
804
|
+
textBoxAnchors,
|
|
805
|
+
openCommentIds
|
|
767
806
|
});
|
|
768
807
|
if (fieldNode) itemNodes.push(fieldNode);
|
|
808
|
+
commentsAlreadyApplied = true;
|
|
769
809
|
} else if (item.type === "mathEquation") {
|
|
770
810
|
const mathNode = convertMathEquation(item);
|
|
771
811
|
if (mathNode) itemNodes.push(mathNode);
|
|
772
812
|
} else if (item.type === "insertion" || item.type === "deletion" || item.type === "moveFrom" || item.type === "moveTo") {
|
|
773
813
|
const nestedMarkType = item.type === "insertion" || item.type === "moveTo" ? "insertion" : "deletion";
|
|
774
814
|
const nestedMoveKind = item.type === "moveFrom" || item.type === "moveTo" ? item.type : null;
|
|
775
|
-
itemNodes.push(...convertTrackedChange(item, nestedMarkType, nextHyperlinkInstanceIndex, runScope, runFormattingResolvers, styleResolver, nestedMoveKind, textBoxAnchors, [...wrappedBy, ...stack]
|
|
815
|
+
itemNodes.push(...convertTrackedChange(item, nestedMarkType, nextHyperlinkInstanceIndex, runScope, runFormattingResolvers, styleResolver, nestedMoveKind, textBoxAnchors, [...wrappedBy, ...stack], openCommentIds, {
|
|
816
|
+
preserveParentBoundaryOwnership,
|
|
817
|
+
preserveSdtBoundaryOccurrences: preserveBoundaryOccurrences
|
|
818
|
+
}));
|
|
819
|
+
commentsAlreadyApplied = true;
|
|
776
820
|
} else if (item.type === "inlineSdt") {
|
|
777
|
-
const sdtNode = convertInlineSdt(item, nextHyperlinkInstanceIndex, runScope, getTrackedRunFormatting, runFormattingResolvers, styleResolver, textBoxAnchors, [...wrappedBy, ...stack]);
|
|
821
|
+
const sdtNode = convertInlineSdt(item, nextHyperlinkInstanceIndex, runScope, getTrackedRunFormatting, runFormattingResolvers, styleResolver, textBoxAnchors, [...wrappedBy, ...stack], openCommentIds);
|
|
778
822
|
if (sdtNode) itemNodes.push(sdtNode);
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
name: item.name,
|
|
783
|
-
colFirst: item.colFirst,
|
|
784
|
-
colLast: item.colLast,
|
|
785
|
-
displacedByCustomXml: item.displacedByCustomXml
|
|
786
|
-
}));
|
|
787
|
-
else if (item.type === "bookmarkEnd") itemNodes.push(schema.node("bookmarkBoundary", {
|
|
788
|
-
type: "end",
|
|
789
|
-
id: item.id,
|
|
790
|
-
displacedByCustomXml: item.displacedByCustomXml
|
|
791
|
-
}));
|
|
823
|
+
commentsAlreadyApplied = true;
|
|
824
|
+
} else if (item.type === "bookmarkStart") itemNodes.push(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(item)));
|
|
825
|
+
else if (item.type === "bookmarkEnd") itemNodes.push(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(item)));
|
|
792
826
|
else if (item.type === "moveFromRangeStart" || item.type === "moveFromRangeEnd" || item.type === "moveToRangeStart" || item.type === "moveToRangeEnd") itemNodes.push(schema.node(MOVE_RANGE_BOUNDARY_NODE_NAME, { marker: item }));
|
|
793
827
|
else if (item.type === "preservedInline") itemNodes.push(preservedInlineNode(item));
|
|
794
828
|
else panic(`Unsupported tracked-run content: ${JSON.stringify(item)}`);
|
|
795
|
-
|
|
829
|
+
const wrappedNodes = withInlineWrapperMark(itemNodes, stack);
|
|
830
|
+
nodes.push(...commentsAlreadyApplied ? wrappedNodes : applyCommentMarks(wrappedNodes, openCommentIds));
|
|
796
831
|
}
|
|
832
|
+
if (preserveParentBoundaryOwnership) for (const commentId of commentsOpenBeforeRevision) recordCommentBoundary("start", commentId, "parent");
|
|
833
|
+
const boundaryCommentIds = new Set(commentRangeBoundaries.map(({ commentId }) => commentId));
|
|
834
|
+
for (const commentId of boundaryCommentIds) if (openCommentIds.has(commentId)) recordCommentBoundary("end", commentId, "parent");
|
|
797
835
|
const mark = schema.marks[markType].create({
|
|
798
836
|
revisionId: change.info.id,
|
|
799
837
|
author: change.info.author,
|
|
@@ -803,6 +841,7 @@ function convertTrackedChange(change, markType, nextHyperlinkInstanceIndex, runS
|
|
|
803
841
|
moveKind,
|
|
804
842
|
_docxOuterWrapperCount: wrappedBy.length,
|
|
805
843
|
_docxResolutionJoins: change.resolutionJoins ?? null,
|
|
844
|
+
_docxCommentRangeBoundaries: commentRangeBoundaries.length > 0 ? commentRangeBoundaries : void 0,
|
|
806
845
|
...markType === "deletion" ? { _historicalFormatting: true } : {}
|
|
807
846
|
});
|
|
808
847
|
const ancestor = {
|
|
@@ -880,6 +919,8 @@ function paragraphFormattingToAttrs(paragraph, styleResolver, tableParagraphOver
|
|
|
880
919
|
set("shading", formatting?.shading);
|
|
881
920
|
set("tabs", formatting?.tabs);
|
|
882
921
|
set("kinsoku", formatting?.kinsoku);
|
|
922
|
+
set("autoSpaceDE", formatting?.autoSpaceDE);
|
|
923
|
+
set("autoSpaceDN", formatting?.autoSpaceDN);
|
|
883
924
|
set("overflowPunctuation", formatting?.overflowPunctuation);
|
|
884
925
|
set("suppressAutoHyphens", formatting?.suppressAutoHyphens);
|
|
885
926
|
set("pageBreakBefore", formatting?.pageBreakBefore);
|
|
@@ -918,7 +959,9 @@ function resolveTableStyleConditional(styleResolver, tableStyleId, conditionType
|
|
|
918
959
|
if (!style?.tblStylePr) return;
|
|
919
960
|
const conditional = style.tblStylePr.find((p) => p.type === conditionType);
|
|
920
961
|
if (!conditional) return;
|
|
921
|
-
const
|
|
962
|
+
const runPropsFromPpr = conditional.pPr?.runProperties ? resolveRunFormattingWithoutDefaults(conditional.pPr.runProperties, styleResolver) : void 0;
|
|
963
|
+
const resolvedRpr = conditional.rPr ? resolveRunFormattingWithoutDefaults(conditional.rPr, styleResolver) : void 0;
|
|
964
|
+
const mergedRunProps = mergeTextFormatting(runPropsFromPpr, resolvedRpr);
|
|
922
965
|
const paragraphOverlay = extractTableParagraphOverlay(conditional.pPr);
|
|
923
966
|
const result = {};
|
|
924
967
|
if (conditional.tcPr) result.tcPr = conditional.tcPr;
|
|
@@ -930,7 +973,9 @@ function resolveTableBaseStyle(styleResolver, tableStyleId) {
|
|
|
930
973
|
if (!styleResolver || !tableStyleId) return;
|
|
931
974
|
const style = styleResolver.getStyle(tableStyleId);
|
|
932
975
|
if (!style) return;
|
|
933
|
-
const
|
|
976
|
+
const runPropsFromPpr = style.pPr?.runProperties ? resolveRunFormattingWithoutDefaults(style.pPr.runProperties, styleResolver) : void 0;
|
|
977
|
+
const resolvedRpr = style.rPr ? resolveRunFormattingWithoutDefaults(style.rPr, styleResolver) : void 0;
|
|
978
|
+
const mergedRunProps = mergeTextFormatting(runPropsFromPpr, resolvedRpr);
|
|
934
979
|
const paragraphOverlay = extractTableParagraphOverlay(style.pPr);
|
|
935
980
|
const result = {};
|
|
936
981
|
if (style.tcPr) result.tcPr = style.tcPr;
|
|
@@ -973,7 +1018,8 @@ function mergeConditionalStyles(base, override) {
|
|
|
973
1018
|
function resolveTextFormatting(formatting, styleResolver) {
|
|
974
1019
|
if (!formatting) return styleResolver?.resolveRunStyle(null);
|
|
975
1020
|
if (!styleResolver) return formatting;
|
|
976
|
-
|
|
1021
|
+
const styleFormatting = styleResolver.resolveRunStyle(formatting.styleId);
|
|
1022
|
+
return mergeTextFormatting(styleFormatting, formatting);
|
|
977
1023
|
}
|
|
978
1024
|
function convertTable(table, styleResolver, context) {
|
|
979
1025
|
for (const row of table.rows) for (const cell of row.cells) {
|
|
@@ -1325,6 +1371,12 @@ function convertTableCell({ cell, styleResolver, context, isHeader, gridWidthPer
|
|
|
1325
1371
|
case "bookmarkEnd":
|
|
1326
1372
|
nodes.push(convertBlockBookmarkBoundary(block));
|
|
1327
1373
|
break;
|
|
1374
|
+
case "moveFromRangeStart":
|
|
1375
|
+
case "moveFromRangeEnd":
|
|
1376
|
+
case "moveToRangeStart":
|
|
1377
|
+
case "moveToRangeEnd":
|
|
1378
|
+
nodes.push(convertBlockMoveRangeBoundary(block));
|
|
1379
|
+
break;
|
|
1328
1380
|
default: panic(`Unsupported table cell content: ${JSON.stringify(block)}`);
|
|
1329
1381
|
}
|
|
1330
1382
|
return nodes;
|
|
@@ -1368,11 +1420,11 @@ function standaloneTableCellToProseMirror(cell, nodeType) {
|
|
|
1368
1420
|
defaultCellMargins: void 0
|
|
1369
1421
|
});
|
|
1370
1422
|
}
|
|
1371
|
-
function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyperlinkInstanceIndex, runScope, textBoxAnchors }) {
|
|
1423
|
+
function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyperlinkInstanceIndex, runScope, textBoxAnchors, openCommentIds }) {
|
|
1372
1424
|
let fieldFormatting;
|
|
1373
1425
|
let fieldPropertyChanges;
|
|
1374
1426
|
const inlineNodes = [];
|
|
1375
|
-
const
|
|
1427
|
+
const commentsOpenBeforeField = new Set(openCommentIds);
|
|
1376
1428
|
const resultRuns = field.type === "complexField" ? field.fieldResult : field.content.flatMap((content) => content.type === "run" ? [content] : []);
|
|
1377
1429
|
const appendRun = (run, into) => {
|
|
1378
1430
|
fieldFormatting ??= run.formatting;
|
|
@@ -1418,6 +1470,7 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1418
1470
|
};
|
|
1419
1471
|
if (field.type === "simpleField") for (const { content, stack } of withInlineWrapperStacks(field.content)) {
|
|
1420
1472
|
const itemNodes = [];
|
|
1473
|
+
let commentsAlreadyApplied = false;
|
|
1421
1474
|
switch (content.type) {
|
|
1422
1475
|
case "run":
|
|
1423
1476
|
appendRun(content, itemNodes);
|
|
@@ -1435,8 +1488,10 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1435
1488
|
styleResolver,
|
|
1436
1489
|
hyperlinkIndex: nextHyperlinkInstanceIndex(),
|
|
1437
1490
|
textBoxAnchors,
|
|
1438
|
-
runScope
|
|
1491
|
+
runScope,
|
|
1492
|
+
openCommentIds
|
|
1439
1493
|
}));
|
|
1494
|
+
commentsAlreadyApplied = true;
|
|
1440
1495
|
break;
|
|
1441
1496
|
case "insertion":
|
|
1442
1497
|
case "deletion":
|
|
@@ -1446,13 +1501,22 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1446
1501
|
itemNodes.push(...convertTrackedChange(content, content.type === "insertion" || content.type === "moveTo" ? "insertion" : "deletion", nextHyperlinkInstanceIndex, runScope, {
|
|
1447
1502
|
current: getInheritedRunFormatting,
|
|
1448
1503
|
historical: getInheritedRunFormatting
|
|
1449
|
-
}, styleResolver, content.type === "moveFrom" || content.type === "moveTo" ? content.type : null, textBoxAnchors));
|
|
1504
|
+
}, styleResolver, content.type === "moveFrom" || content.type === "moveTo" ? content.type : null, textBoxAnchors, [], openCommentIds, { preserveParentBoundaryOwnership: false }));
|
|
1505
|
+
commentsAlreadyApplied = true;
|
|
1506
|
+
break;
|
|
1507
|
+
case "commentRangeStart":
|
|
1508
|
+
openCommentIds.add(content.id);
|
|
1450
1509
|
break;
|
|
1451
|
-
|
|
1510
|
+
case "commentRangeEnd": openCommentIds.delete(content.id);
|
|
1452
1511
|
}
|
|
1453
|
-
|
|
1512
|
+
const wrappedNodes = withInlineWrapperMark(itemNodes, stack);
|
|
1513
|
+
inlineNodes.push(...commentsAlreadyApplied ? wrappedNodes : applyCommentMarks(wrappedNodes, openCommentIds));
|
|
1514
|
+
}
|
|
1515
|
+
else for (const run of field.fieldResult) {
|
|
1516
|
+
const runNodes = [];
|
|
1517
|
+
appendRun(run, runNodes);
|
|
1518
|
+
inlineNodes.push(...runNodes);
|
|
1454
1519
|
}
|
|
1455
|
-
else for (const run of field.fieldResult) appendRun(run, inlineNodes);
|
|
1456
1520
|
if (!fieldFormatting && field.type === "complexField" && field.fieldResult.length === 0) fieldFormatting = field.formatting;
|
|
1457
1521
|
const inheritedFormatting = getInheritedRunFormatting(fieldFormatting, field.fieldType);
|
|
1458
1522
|
const { marks } = buildRunMarks({
|
|
@@ -1461,12 +1525,12 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1461
1525
|
styleResolver,
|
|
1462
1526
|
createMark: runScope.createMark
|
|
1463
1527
|
});
|
|
1464
|
-
const createStructuredField =
|
|
1528
|
+
const createStructuredField = fieldRequiresStructuredContent(inlineNodes);
|
|
1465
1529
|
const displayText = getInlineDisplayText(schema.node("paragraph", null, inlineNodes));
|
|
1466
1530
|
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;
|
|
1467
1531
|
const resultPropertyChanges = emptyResultRuns ? emptyFieldRunPropertyChanges(emptyResultRuns) : fieldPropertyChanges;
|
|
1468
1532
|
if (!createStructuredField && resultPropertyChanges && resultPropertyChanges.length > 0) marks.push(schema.mark("runPropertyChange", { changes: [...resultPropertyChanges] }));
|
|
1469
|
-
|
|
1533
|
+
const fieldNode = schema.node(createStructuredField ? "structuredField" : "field", {
|
|
1470
1534
|
fieldType: field.fieldType,
|
|
1471
1535
|
instruction: field.instruction,
|
|
1472
1536
|
displayText,
|
|
@@ -1481,6 +1545,7 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1481
1545
|
runs: field.fieldCode
|
|
1482
1546
|
} : null
|
|
1483
1547
|
}, createStructuredField ? inlineNodes : void 0, marks);
|
|
1548
|
+
return createStructuredField && fieldCommentCoverage(field.type === "simpleField" ? "simple" : "complex") === "children" ? fieldNode : applyCommentMarks([fieldNode], commentsOpenBeforeField).at(0) ?? fieldNode;
|
|
1484
1549
|
}
|
|
1485
1550
|
/**
|
|
1486
1551
|
* Lift the transparent wrappers out of an inline content list, remembering for
|
|
@@ -1546,14 +1611,16 @@ function convertMathEquation(math) {
|
|
|
1546
1611
|
* its own leaves, so nothing outside can mark them afterwards: the caller's
|
|
1547
1612
|
* stack has to reach them here, under the wrappers written inside the control.
|
|
1548
1613
|
*/
|
|
1549
|
-
function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInheritedRunFormatting, trackedRunFormattingResolvers, styleResolver, textBoxAnchors, wrappedBy
|
|
1614
|
+
function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInheritedRunFormatting, trackedRunFormattingResolvers, styleResolver, textBoxAnchors, wrappedBy, openCommentIds) {
|
|
1550
1615
|
const props = sdt.properties;
|
|
1551
1616
|
const inlineNodes = [];
|
|
1617
|
+
const commentsOpenBeforeSdt = new Set(openCommentIds);
|
|
1552
1618
|
const stacked = withInlineWrapperStacks(sdt.content, wrappedBy);
|
|
1553
1619
|
const emptyRanges = planEmptyRanges(stacked.map(({ content }) => content));
|
|
1554
1620
|
for (const [index, { content, stack }] of stacked.entries()) {
|
|
1555
1621
|
if (!isInlineSdtContent(content)) continue;
|
|
1556
1622
|
const itemNodes = [];
|
|
1623
|
+
let commentsAlreadyApplied = false;
|
|
1557
1624
|
const anchored = emptyRanges.anchorAt.get(index);
|
|
1558
1625
|
if (anchored) {
|
|
1559
1626
|
inlineNodes.push(...withInlineWrapperMark([schema.node(RANGE_ANCHOR_NODE_NAME, anchored)], stack));
|
|
@@ -1561,6 +1628,19 @@ function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInherite
|
|
|
1561
1628
|
}
|
|
1562
1629
|
if (emptyRanges.closedAt.has(index)) continue;
|
|
1563
1630
|
switch (content.type) {
|
|
1631
|
+
case "commentRangeStart":
|
|
1632
|
+
openCommentIds.add(content.id);
|
|
1633
|
+
itemNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: content }));
|
|
1634
|
+
commentsAlreadyApplied = true;
|
|
1635
|
+
break;
|
|
1636
|
+
case "commentRangeEnd":
|
|
1637
|
+
openCommentIds.delete(content.id);
|
|
1638
|
+
itemNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: content }));
|
|
1639
|
+
commentsAlreadyApplied = true;
|
|
1640
|
+
break;
|
|
1641
|
+
case "commentReference":
|
|
1642
|
+
itemNodes.push(schema.node("commentReference", { commentId: content.id }));
|
|
1643
|
+
break;
|
|
1564
1644
|
case "run":
|
|
1565
1645
|
itemNodes.push(...convertRun(content, getInheritedRunFormatting(content.formatting), runScope, styleResolver, textBoxAnchors));
|
|
1566
1646
|
break;
|
|
@@ -1571,8 +1651,10 @@ function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInherite
|
|
|
1571
1651
|
styleResolver,
|
|
1572
1652
|
hyperlinkIndex: currentHyperlinkIndex,
|
|
1573
1653
|
textBoxAnchors,
|
|
1574
|
-
runScope
|
|
1654
|
+
runScope,
|
|
1655
|
+
openCommentIds
|
|
1575
1656
|
}));
|
|
1657
|
+
commentsAlreadyApplied = true;
|
|
1576
1658
|
break;
|
|
1577
1659
|
}
|
|
1578
1660
|
case "simpleField":
|
|
@@ -1582,21 +1664,28 @@ function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInherite
|
|
|
1582
1664
|
styleResolver,
|
|
1583
1665
|
nextHyperlinkInstanceIndex,
|
|
1584
1666
|
runScope,
|
|
1585
|
-
textBoxAnchors
|
|
1667
|
+
textBoxAnchors,
|
|
1668
|
+
openCommentIds
|
|
1586
1669
|
});
|
|
1587
1670
|
if (fieldNode) itemNodes.push(fieldNode);
|
|
1671
|
+
commentsAlreadyApplied = true;
|
|
1588
1672
|
break;
|
|
1589
1673
|
}
|
|
1590
1674
|
case "inlineSdt": {
|
|
1591
|
-
const nestedSdt = convertInlineSdt(content, nextHyperlinkInstanceIndex, runScope, getInheritedRunFormatting, trackedRunFormattingResolvers, styleResolver, textBoxAnchors, stack);
|
|
1675
|
+
const nestedSdt = convertInlineSdt(content, nextHyperlinkInstanceIndex, runScope, getInheritedRunFormatting, trackedRunFormattingResolvers, styleResolver, textBoxAnchors, stack, openCommentIds);
|
|
1592
1676
|
if (nestedSdt) itemNodes.push(nestedSdt);
|
|
1677
|
+
commentsAlreadyApplied = true;
|
|
1593
1678
|
break;
|
|
1594
1679
|
}
|
|
1595
1680
|
case "insertion":
|
|
1596
1681
|
case "deletion":
|
|
1597
1682
|
case "moveTo":
|
|
1598
1683
|
case "moveFrom":
|
|
1599
|
-
itemNodes.push(...convertTrackedChange(content, content.type === "insertion" || content.type === "moveTo" ? "insertion" : "deletion", nextHyperlinkInstanceIndex, runScope, trackedRunFormattingResolvers, styleResolver, content.type === "moveTo" || content.type === "moveFrom" ? content.type : null, textBoxAnchors
|
|
1684
|
+
itemNodes.push(...convertTrackedChange(content, content.type === "insertion" || content.type === "moveTo" ? "insertion" : "deletion", nextHyperlinkInstanceIndex, runScope, trackedRunFormattingResolvers, styleResolver, content.type === "moveTo" || content.type === "moveFrom" ? content.type : null, textBoxAnchors, stack, openCommentIds, {
|
|
1685
|
+
preserveParentBoundaryOwnership: false,
|
|
1686
|
+
preserveSdtBoundaryOccurrences: true
|
|
1687
|
+
}));
|
|
1688
|
+
commentsAlreadyApplied = true;
|
|
1600
1689
|
break;
|
|
1601
1690
|
case "mathEquation": {
|
|
1602
1691
|
const mathNode = convertMathEquation(content);
|
|
@@ -1604,21 +1693,10 @@ function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInherite
|
|
|
1604
1693
|
break;
|
|
1605
1694
|
}
|
|
1606
1695
|
case "bookmarkStart":
|
|
1607
|
-
itemNodes.push(schema.node("bookmarkBoundary",
|
|
1608
|
-
type: "start",
|
|
1609
|
-
id: content.id,
|
|
1610
|
-
name: content.name,
|
|
1611
|
-
colFirst: content.colFirst,
|
|
1612
|
-
colLast: content.colLast,
|
|
1613
|
-
displacedByCustomXml: content.displacedByCustomXml
|
|
1614
|
-
}));
|
|
1696
|
+
itemNodes.push(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(content)));
|
|
1615
1697
|
break;
|
|
1616
1698
|
case "bookmarkEnd":
|
|
1617
|
-
itemNodes.push(schema.node("bookmarkBoundary",
|
|
1618
|
-
type: "end",
|
|
1619
|
-
id: content.id,
|
|
1620
|
-
displacedByCustomXml: content.displacedByCustomXml
|
|
1621
|
-
}));
|
|
1699
|
+
itemNodes.push(schema.node("bookmarkBoundary", bookmarkBoundaryAttrsFromMarker(content)));
|
|
1622
1700
|
break;
|
|
1623
1701
|
case "moveFromRangeStart":
|
|
1624
1702
|
case "moveFromRangeEnd":
|
|
@@ -1631,9 +1709,11 @@ function convertInlineSdt(sdt, nextHyperlinkInstanceIndex, runScope, getInherite
|
|
|
1631
1709
|
break;
|
|
1632
1710
|
default: panic(`Unsupported inline SDT content: ${JSON.stringify(content)}`);
|
|
1633
1711
|
}
|
|
1634
|
-
|
|
1712
|
+
const wrappedNodes = withInlineWrapperMark(itemNodes, stack);
|
|
1713
|
+
inlineNodes.push(...commentsAlreadyApplied ? wrappedNodes : applyCommentMarks(wrappedNodes, openCommentIds));
|
|
1635
1714
|
}
|
|
1636
|
-
|
|
1715
|
+
const sdtNode = schema.node("sdt", sdtAttrsFromProperties(props), inlineNodes.length > 0 ? inlineNodes : void 0);
|
|
1716
|
+
return sdtNode.childCount > 0 ? sdtNode : applyCommentMarks([sdtNode], commentsOpenBeforeSdt).at(0) ?? sdtNode;
|
|
1637
1717
|
}
|
|
1638
1718
|
/**
|
|
1639
1719
|
* Convert a Run to ProseMirror text nodes with marks
|
|
@@ -1661,6 +1741,7 @@ function convertRun(run, resolvedStyleFormatting, runScope, styleResolver, textB
|
|
|
1661
1741
|
authoredFormatting: run.formatting,
|
|
1662
1742
|
nextNoteReferenceOccurrenceId: runScope.nextNoteReferenceOccurrenceId
|
|
1663
1743
|
});
|
|
1744
|
+
for (const node of contentNodes) if (!isRunContentProjectionNode(content.type, node.type.name)) panic(`Run content ${content.type} projected unsupported inline node ${node.type.name}`);
|
|
1664
1745
|
nodes.push(...contentNodes);
|
|
1665
1746
|
}
|
|
1666
1747
|
return nodes;
|
|
@@ -2101,7 +2182,7 @@ function convertRunContent({ content, marks, formatting, textBoxAnchors, authore
|
|
|
2101
2182
|
const anchorId = textBoxAnchors?.get(shp);
|
|
2102
2183
|
return anchorId ? [schema.node("textBoxAnchor", { anchorId }).mark(marks)] : [];
|
|
2103
2184
|
}
|
|
2104
|
-
return [withRunBoundaryMarks(withAlternateContent(convertShape(shp, carriedRunFormatting(authoredFormatting)), replayableShapeAlternateContent(content)), marks)];
|
|
2185
|
+
return [withRunBoundaryMarks(withAlternateContent(convertShape(shp, carriedRunFormatting(authoredFormatting)), replayableShapeAlternateContent(content), content.alternateContent), marks)];
|
|
2105
2186
|
}
|
|
2106
2187
|
case "footnoteRef": {
|
|
2107
2188
|
const footnoteMark = schema.mark("footnoteRef", {
|
|
@@ -2199,12 +2280,13 @@ function convertImage({ image, rawXml, rawXmlMode, rawImageFingerprint, runForma
|
|
|
2199
2280
|
let cssFloat;
|
|
2200
2281
|
if (wrapType === "inline") cssFloat = "none";
|
|
2201
2282
|
else if (wrapType === "topAndBottom") cssFloat = "none";
|
|
2202
|
-
else if (wrapType === "square" || wrapType === "tight" || wrapType === "through")
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
|
|
2207
|
-
|
|
2283
|
+
else if (wrapType === "square" || wrapType === "tight" || wrapType === "through") {
|
|
2284
|
+
if (wrapText === "left") cssFloat = "right";
|
|
2285
|
+
else if (wrapText === "right") cssFloat = "left";
|
|
2286
|
+
else if (hAlign === "left") cssFloat = "left";
|
|
2287
|
+
else if (hAlign === "right") cssFloat = "right";
|
|
2288
|
+
else cssFloat = "none";
|
|
2289
|
+
} else cssFloat = "none";
|
|
2208
2290
|
let displayMode;
|
|
2209
2291
|
if (wrapType === "inline") displayMode = "inline";
|
|
2210
2292
|
else if (wrapType === "topAndBottom") displayMode = "block";
|
|
@@ -2300,11 +2382,12 @@ function convertImage({ image, rawXml, rawXmlMode, rawImageFingerprint, runForma
|
|
|
2300
2382
|
_docxRunFormatting: runFormatting
|
|
2301
2383
|
});
|
|
2302
2384
|
}
|
|
2303
|
-
function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver, hyperlinkIndex, textBoxAnchors, runScope }) {
|
|
2385
|
+
function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver, hyperlinkIndex, textBoxAnchors, runScope, openCommentIds }) {
|
|
2304
2386
|
const nodes = [];
|
|
2305
2387
|
const href = hyperlink.href || (hyperlink.anchor ? `#${hyperlink.anchor}` : "");
|
|
2306
2388
|
const linkMark = schema.mark("hyperlink", {
|
|
2307
2389
|
href,
|
|
2390
|
+
anchor: hyperlink.anchor,
|
|
2308
2391
|
tooltip: hyperlink.tooltip,
|
|
2309
2392
|
rId: hyperlink.rId,
|
|
2310
2393
|
target: hyperlink.target,
|
|
@@ -2314,7 +2397,27 @@ function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver,
|
|
|
2314
2397
|
});
|
|
2315
2398
|
for (const { content: child, stack } of withInlineWrapperStacks(hyperlink.children)) {
|
|
2316
2399
|
const childNodes = [];
|
|
2400
|
+
let commentsAlreadyApplied = false;
|
|
2317
2401
|
switch (child.type) {
|
|
2402
|
+
case "commentRangeStart":
|
|
2403
|
+
openCommentIds.add(child.id);
|
|
2404
|
+
childNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: child }, void 0, [linkMark]));
|
|
2405
|
+
commentsAlreadyApplied = true;
|
|
2406
|
+
break;
|
|
2407
|
+
case "commentRangeEnd":
|
|
2408
|
+
openCommentIds.delete(child.id);
|
|
2409
|
+
childNodes.push(schema.node(COMMENT_RANGE_BOUNDARY_NODE_NAME, { marker: child }, void 0, [linkMark]));
|
|
2410
|
+
commentsAlreadyApplied = true;
|
|
2411
|
+
break;
|
|
2412
|
+
case "commentReference":
|
|
2413
|
+
childNodes.push(schema.node("commentReference", { commentId: child.id }, void 0, [linkMark]));
|
|
2414
|
+
break;
|
|
2415
|
+
case "moveFromRangeStart":
|
|
2416
|
+
case "moveFromRangeEnd":
|
|
2417
|
+
case "moveToRangeStart":
|
|
2418
|
+
case "moveToRangeEnd":
|
|
2419
|
+
childNodes.push(schema.node(MOVE_RANGE_BOUNDARY_NODE_NAME, { marker: child }, void 0, [linkMark]));
|
|
2420
|
+
break;
|
|
2318
2421
|
case "bookmarkStart":
|
|
2319
2422
|
childNodes.push(schema.node("bookmarkBoundary", {
|
|
2320
2423
|
type: "start",
|
|
@@ -2357,12 +2460,12 @@ function convertHyperlink(hyperlink, { getInheritedRunFormatting, styleResolver,
|
|
|
2357
2460
|
}));
|
|
2358
2461
|
break;
|
|
2359
2462
|
}
|
|
2360
|
-
default: break;
|
|
2361
2463
|
}
|
|
2362
|
-
|
|
2464
|
+
const wrappedNodes = withInlineWrapperMark(childNodes, stack, {
|
|
2363
2465
|
hyperlinkIndex,
|
|
2364
2466
|
stackStart: 0
|
|
2365
|
-
})
|
|
2467
|
+
});
|
|
2468
|
+
nodes.push(...commentsAlreadyApplied ? wrappedNodes : applyCommentMarks(wrappedNodes, openCommentIds));
|
|
2366
2469
|
}
|
|
2367
2470
|
return nodes;
|
|
2368
2471
|
}
|
|
@@ -2489,7 +2592,7 @@ function convertParagraphWithTextBoxes(block, styleResolver, { textBoxGroupId, c
|
|
|
2489
2592
|
const keepWrapperParagraph = isEmptyAfterExtraction && (preserveEmptyWrapper === true || hasParagraphBoundaryPayload(block, pmParagraph));
|
|
2490
2593
|
if (!isEmptyAfterExtraction || keepWrapperParagraph) nodes.push(pmParagraph);
|
|
2491
2594
|
const standalone = isEmptyAfterExtraction && !keepWrapperParagraph;
|
|
2492
|
-
for (const [index, { textBox,
|
|
2595
|
+
for (const [index, { textBox, alternateContent, anchorId, trackedChange, inlineSdts }] of textBoxes.entries()) {
|
|
2493
2596
|
const textBoxNode = convertTextBox(textBox, styleResolver, {
|
|
2494
2597
|
placement: standalone ? "standalone" : "inlineWithPrevious",
|
|
2495
2598
|
groupId: textBoxGroupId,
|
|
@@ -2500,7 +2603,7 @@ function convertParagraphWithTextBoxes(block, styleResolver, { textBoxGroupId, c
|
|
|
2500
2603
|
...standalone && index === 0 && block.preservedAttributes ? { hostPreservedAttributes: block.preservedAttributes } : {},
|
|
2501
2604
|
...standalone && index === 0 ? { hostParagraph: hostParagraphAttrs(pmParagraph.attrs) } : {}
|
|
2502
2605
|
});
|
|
2503
|
-
nodes.push(withAlternateContent(textBoxNode,
|
|
2606
|
+
nodes.push(withAlternateContent(textBoxNode, alternateContent?.verbatimXml, alternateContent));
|
|
2504
2607
|
}
|
|
2505
2608
|
return nodes;
|
|
2506
2609
|
}
|
|
@@ -2539,93 +2642,99 @@ function extractTextBoxesFromParagraph(paragraph, textBoxGroupId) {
|
|
|
2539
2642
|
if (!mayContainTextBox(paragraph)) return NO_EXTRACTED_TEXT_BOXES;
|
|
2540
2643
|
return extractTextBoxes(paragraph, textBoxGroupId);
|
|
2541
2644
|
}
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2645
|
+
/** Walk the same projected child inventory for the fast path and collector. */
|
|
2646
|
+
function visitTextBoxRuns({ items, context, visitRun }) {
|
|
2647
|
+
for (const item of items) {
|
|
2648
|
+
if (item.type === "run") {
|
|
2649
|
+
if (visitRun(item, context)) return true;
|
|
2546
2650
|
continue;
|
|
2547
2651
|
}
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
}
|
|
2552
|
-
function extractTextBoxes(paragraph, textBoxGroupId) {
|
|
2553
|
-
const textBoxes = [];
|
|
2554
|
-
const textBoxAnchors = /* @__PURE__ */ new Map();
|
|
2555
|
-
const visitRun = (run, context) => {
|
|
2556
|
-
for (const runContent of run.content) {
|
|
2557
|
-
if (runContent.type !== "shape" || !runContent.shape.textBody) continue;
|
|
2558
|
-
const anchorId = `${textBoxGroupId}:${textBoxes.length}`;
|
|
2559
|
-
textBoxAnchors.set(runContent.shape, anchorId);
|
|
2560
|
-
textBoxes.push({
|
|
2561
|
-
textBox: textBoxFromShape(runContent.shape, runContent.shape.textBody),
|
|
2562
|
-
alternateContentXml: replayableShapeAlternateContent(runContent),
|
|
2563
|
-
anchorId,
|
|
2564
|
-
trackedChange: context.trackedChange,
|
|
2565
|
-
inlineSdts: context.inlineSdts
|
|
2566
|
-
});
|
|
2652
|
+
if (item.type === "complexField") {
|
|
2653
|
+
for (const run of item.fieldResult) if (visitRun(run, context)) return true;
|
|
2654
|
+
continue;
|
|
2567
2655
|
}
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2656
|
+
if (item.type === "simpleField") {
|
|
2657
|
+
if (visitTextBoxRuns({
|
|
2658
|
+
items: item.content,
|
|
2659
|
+
context,
|
|
2660
|
+
visitRun
|
|
2661
|
+
})) return true;
|
|
2662
|
+
continue;
|
|
2663
|
+
}
|
|
2664
|
+
if (item.type === "insertion" || item.type === "deletion" || item.type === "moveFrom" || item.type === "moveTo") {
|
|
2665
|
+
const trackedChange = {
|
|
2666
|
+
type: item.type,
|
|
2667
|
+
info: item.info
|
|
2668
|
+
};
|
|
2669
|
+
if (visitTextBoxRuns({
|
|
2670
|
+
items: item.content,
|
|
2671
|
+
context: {
|
|
2580
2672
|
...context,
|
|
2581
2673
|
trackedChange
|
|
2582
|
-
}
|
|
2583
|
-
|
|
2584
|
-
}
|
|
2585
|
-
if (item.type === "hyperlink") visitHyperlink(item, {
|
|
2586
|
-
...context,
|
|
2587
|
-
trackedChange
|
|
2588
|
-
});
|
|
2589
|
-
}
|
|
2590
|
-
};
|
|
2591
|
-
const visitInlineSdt = (sdt, context) => {
|
|
2592
|
-
const inlineSdts = [...context.inlineSdts, sdtAttrsFromProperties(sdt.properties)];
|
|
2593
|
-
const nestedContext = {
|
|
2594
|
-
...context,
|
|
2595
|
-
inlineSdts
|
|
2596
|
-
};
|
|
2597
|
-
for (const item of sdt.content) {
|
|
2598
|
-
if (item.type === "run") {
|
|
2599
|
-
visitRun(item, nestedContext);
|
|
2600
|
-
continue;
|
|
2601
|
-
}
|
|
2602
|
-
if (item.type === "inlineSdt") {
|
|
2603
|
-
visitInlineSdt(item, nestedContext);
|
|
2604
|
-
continue;
|
|
2605
|
-
}
|
|
2606
|
-
if (item.type === "hyperlink") {
|
|
2607
|
-
visitHyperlink(item, nestedContext);
|
|
2608
|
-
continue;
|
|
2609
|
-
}
|
|
2610
|
-
if (item.type === "insertion" || item.type === "deletion" || item.type === "moveFrom" || item.type === "moveTo") visitTrackedChange(item, nestedContext);
|
|
2611
|
-
}
|
|
2612
|
-
};
|
|
2613
|
-
const rootContext = { inlineSdts: [] };
|
|
2614
|
-
for (const item of paragraph.content) {
|
|
2615
|
-
if (item.type === "run") {
|
|
2616
|
-
visitRun(item, rootContext);
|
|
2674
|
+
},
|
|
2675
|
+
visitRun
|
|
2676
|
+
})) return true;
|
|
2617
2677
|
continue;
|
|
2618
2678
|
}
|
|
2619
2679
|
if (item.type === "inlineSdt") {
|
|
2620
|
-
|
|
2680
|
+
const inlineSdts = [...context.inlineSdts, sdtAttrsFromProperties(item.properties)];
|
|
2681
|
+
if (visitTextBoxRuns({
|
|
2682
|
+
items: item.content,
|
|
2683
|
+
context: {
|
|
2684
|
+
...context,
|
|
2685
|
+
inlineSdts
|
|
2686
|
+
},
|
|
2687
|
+
visitRun
|
|
2688
|
+
})) return true;
|
|
2621
2689
|
continue;
|
|
2622
2690
|
}
|
|
2623
2691
|
if (item.type === "hyperlink") {
|
|
2624
|
-
|
|
2692
|
+
if (visitTextBoxRuns({
|
|
2693
|
+
items: item.children,
|
|
2694
|
+
context,
|
|
2695
|
+
visitRun
|
|
2696
|
+
})) return true;
|
|
2625
2697
|
continue;
|
|
2626
2698
|
}
|
|
2627
|
-
if (item.type === "
|
|
2699
|
+
if (item.type === "inlineWrapper") {
|
|
2700
|
+
if (visitTextBoxRuns({
|
|
2701
|
+
items: item.content,
|
|
2702
|
+
context,
|
|
2703
|
+
visitRun
|
|
2704
|
+
})) return true;
|
|
2705
|
+
}
|
|
2628
2706
|
}
|
|
2707
|
+
return false;
|
|
2708
|
+
}
|
|
2709
|
+
function mayContainTextBox(paragraph) {
|
|
2710
|
+
return visitTextBoxRuns({
|
|
2711
|
+
items: paragraph.content,
|
|
2712
|
+
context: { inlineSdts: [] },
|
|
2713
|
+
visitRun: (run) => run.content.some((content) => content.type === "shape" && content.shape.textBody)
|
|
2714
|
+
});
|
|
2715
|
+
}
|
|
2716
|
+
function extractTextBoxes(paragraph, textBoxGroupId) {
|
|
2717
|
+
const textBoxes = [];
|
|
2718
|
+
const textBoxAnchors = /* @__PURE__ */ new Map();
|
|
2719
|
+
visitTextBoxRuns({
|
|
2720
|
+
items: paragraph.content,
|
|
2721
|
+
context: { inlineSdts: [] },
|
|
2722
|
+
visitRun: (run, context) => {
|
|
2723
|
+
for (const runContent of run.content) {
|
|
2724
|
+
if (runContent.type !== "shape" || !runContent.shape.textBody) continue;
|
|
2725
|
+
const anchorId = `${textBoxGroupId}:${textBoxes.length}`;
|
|
2726
|
+
textBoxAnchors.set(runContent.shape, anchorId);
|
|
2727
|
+
textBoxes.push({
|
|
2728
|
+
textBox: textBoxFromShape(runContent.shape, runContent.shape.textBody),
|
|
2729
|
+
alternateContent: replayableShapeAlternateContent(runContent) === void 0 ? void 0 : runContent.alternateContent,
|
|
2730
|
+
anchorId,
|
|
2731
|
+
trackedChange: context.trackedChange,
|
|
2732
|
+
inlineSdts: context.inlineSdts
|
|
2733
|
+
});
|
|
2734
|
+
}
|
|
2735
|
+
return false;
|
|
2736
|
+
}
|
|
2737
|
+
});
|
|
2629
2738
|
return {
|
|
2630
2739
|
textBoxes,
|
|
2631
2740
|
textBoxAnchors
|
|
@@ -2714,12 +2823,13 @@ function convertTextBox(textBox, styleResolver, options) {
|
|
|
2714
2823
|
let cssFloat;
|
|
2715
2824
|
if (wrapType === void 0 || wrapType === "inline") cssFloat = "none";
|
|
2716
2825
|
else if (wrapType === "topAndBottom") cssFloat = "none";
|
|
2717
|
-
else if (wrapType === "square" || wrapType === "tight" || wrapType === "through")
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2826
|
+
else if (wrapType === "square" || wrapType === "tight" || wrapType === "through") {
|
|
2827
|
+
if (wrapText === "left") cssFloat = "right";
|
|
2828
|
+
else if (wrapText === "right") cssFloat = "left";
|
|
2829
|
+
else if (hAlign === "left") cssFloat = "left";
|
|
2830
|
+
else if (hAlign === "right") cssFloat = "right";
|
|
2831
|
+
else cssFloat = "none";
|
|
2832
|
+
} else cssFloat = "none";
|
|
2723
2833
|
let displayMode;
|
|
2724
2834
|
if (wrapType === void 0 || wrapType === "inline") displayMode = "inline";
|
|
2725
2835
|
else if (wrapType === "topAndBottom") displayMode = "block";
|
|
@@ -2851,13 +2961,19 @@ function headerFooterToProseDoc(content, options) {
|
|
|
2851
2961
|
case "bookmarkEnd":
|
|
2852
2962
|
out.push(convertBlockBookmarkBoundary(block));
|
|
2853
2963
|
break;
|
|
2964
|
+
case "moveFromRangeStart":
|
|
2965
|
+
case "moveFromRangeEnd":
|
|
2966
|
+
case "moveToRangeStart":
|
|
2967
|
+
case "moveToRangeEnd":
|
|
2968
|
+
out.push(convertBlockMoveRangeBoundary(block));
|
|
2969
|
+
break;
|
|
2854
2970
|
default: panic(`Unsupported block content: ${JSON.stringify(block)}`);
|
|
2855
2971
|
}
|
|
2856
2972
|
return out;
|
|
2857
2973
|
};
|
|
2858
2974
|
nodes.push(...convertBlocks(content));
|
|
2859
2975
|
if (nodes.length === 0) nodes.push(schema.node("paragraph", {}, []));
|
|
2860
|
-
const pmDoc = stampNumberedRefFieldBaselines(schema.node("doc", null, nodes));
|
|
2976
|
+
const pmDoc = stampNumberedRefFieldBaselines(schema.node("doc", null, [...continueSourceCarrierIdentitiesAcrossInsertedParagraphMarks(nodes)]));
|
|
2861
2977
|
assertValidProseMirrorDocument(pmDoc, "Header/footer conversion produced an invalid ProseMirror document");
|
|
2862
2978
|
return pmDoc;
|
|
2863
2979
|
}
|
|
@@ -2871,4 +2987,4 @@ function createEmptyDoc() {
|
|
|
2871
2987
|
return schema.node("doc", null, [schema.node("paragraph", {}, [])]);
|
|
2872
2988
|
}
|
|
2873
2989
|
//#endregion
|
|
2874
|
-
export { collectPairedBookmarkIds, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, standaloneTableCellToProseMirror, toProseDoc };
|
|
2990
|
+
export { collectPairedBookmarkIds, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, hostParagraphAttrs, standaloneTableCellToProseMirror, toProseDoc };
|