@stll/folio-core 0.52.0 → 0.54.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -0
- package/dist/ai-edits/apply.d.ts +26 -1
- package/dist/ai-edits/apply.js +1779 -141
- package/dist/ai-edits/batch-claims.d.ts +145 -0
- package/dist/ai-edits/batch-claims.js +275 -0
- package/dist/ai-edits/blockRange.js +9 -3
- package/dist/ai-edits/character-boundaries.d.ts +43 -0
- package/dist/ai-edits/character-boundaries.js +95 -0
- package/dist/ai-edits/clean-text.d.ts +33 -3
- package/dist/ai-edits/clean-text.js +52 -6
- package/dist/ai-edits/comment-lifecycle.d.ts +18 -0
- package/dist/ai-edits/comment-lifecycle.js +52 -0
- package/dist/ai-edits/headless.d.ts +91 -7
- package/dist/ai-edits/headless.js +520 -51
- package/dist/ai-edits/index.d.ts +2 -1
- package/dist/ai-edits/index.js +2 -1
- package/dist/ai-edits/minimal-replacement.d.ts +21 -6
- package/dist/ai-edits/minimal-replacement.js +134 -15
- package/dist/ai-edits/newListNumbering.d.ts +23 -0
- package/dist/ai-edits/newListNumbering.js +94 -0
- package/dist/ai-edits/note-references.d.ts +96 -0
- package/dist/ai-edits/note-references.js +139 -0
- package/dist/ai-edits/pending-suggestions.d.ts +79 -0
- package/dist/ai-edits/pending-suggestions.js +306 -0
- package/dist/ai-edits/read.d.ts +6 -4
- package/dist/ai-edits/read.js +113 -50
- package/dist/ai-edits/result-validation.d.ts +29 -0
- package/dist/ai-edits/result-validation.js +164 -0
- package/dist/ai-edits/revisionStretches.d.ts +17 -0
- package/dist/ai-edits/revisionStretches.js +80 -0
- package/dist/ai-edits/snapshot.d.ts +36 -3
- package/dist/ai-edits/snapshot.js +180 -25
- package/dist/ai-edits/table-cell-mutations.d.ts +4 -2
- package/dist/ai-edits/table-cell-mutations.js +6 -2
- package/dist/ai-edits/table-geometry.d.ts +1 -1
- package/dist/ai-edits/table-row-column-mutations.d.ts +44 -17
- package/dist/ai-edits/table-row-column-mutations.js +86 -34
- package/dist/ai-edits/types.d.ts +155 -16
- package/dist/compare/compare.d.ts +1 -1
- package/dist/compare/compare.js +65 -16
- package/dist/compare/content-alignment.d.ts +5 -1
- package/dist/compare/content-alignment.js +52 -34
- package/dist/compare/content-types.d.ts +7 -0
- package/dist/compare/content.d.ts +4 -1
- package/dist/compare/content.js +6 -1
- package/dist/compare/formatting.js +2 -1
- package/dist/compare/inline-atoms.d.ts +21 -4
- package/dist/compare/inline-atoms.js +138 -16
- package/dist/compare/inline-provenance.js +1 -1
- package/dist/compare/plan.js +10 -5
- package/dist/compare/scenario.js +14 -3
- package/dist/compare/section-boundary-properties.js +1 -1
- package/dist/compare/types.d.ts +4 -2
- package/dist/compare/types.js +2 -1
- package/dist/compare/verification.d.ts +1 -1
- package/dist/compare/verification.js +15 -3
- package/dist/controller/committedLayoutDiff.d.ts +25 -0
- package/dist/controller/committedLayoutDiff.js +71 -0
- package/dist/controller/contentControlWidgetController.d.ts +1 -1
- package/dist/controller/folioEditor.d.ts +1 -1
- package/dist/controller/fontReadiness.d.ts +70 -3
- package/dist/controller/fontReadiness.js +100 -10
- package/dist/controller/headerFooterEditorManager.js +6 -1
- package/dist/controller/layoutPipeline.d.ts +12 -10
- package/dist/controller/layoutPipeline.js +65 -11
- package/dist/controller/layoutRunOptions.d.ts +24 -0
- package/dist/controller/layoutRunOptions.js +17 -0
- package/dist/controller/layoutScheduler.d.ts +19 -14
- package/dist/controller/layoutScheduler.js +15 -12
- package/dist/controller/layoutSession.d.ts +26 -2
- package/dist/controller/layoutSession.js +1 -1
- package/dist/controller/noteEditorManager.js +8 -3
- package/dist/document-operations.d.ts +11 -2
- package/dist/document-operations.js +230 -21
- package/dist/docx/altChunk.d.ts +8 -0
- package/dist/docx/altChunk.js +17 -0
- package/dist/docx/archiveInflation.d.ts +127 -0
- package/dist/docx/archiveInflation.js +181 -0
- package/dist/docx/attributeRemainder.d.ts +1 -1
- package/dist/docx/blockContentParser.d.ts +64 -1
- package/dist/docx/blockContentParser.js +17 -4
- package/dist/docx/blockCustomXmlShell.d.ts +7 -0
- package/dist/docx/blockCustomXmlShell.js +14 -0
- package/dist/docx/blockPlainText.js +7 -0
- package/dist/docx/commentAnchorIndex.js +1 -1
- package/dist/docx/commentRangeIntegrity.js +8 -3
- package/dist/docx/commentReferenceNormalization.js +1 -1
- package/dist/docx/commentReplyMarkers.js +20 -1
- package/dist/docx/compatibility.d.ts +1 -1
- package/dist/docx/compatibility.js +34 -13
- package/dist/docx/containerChildren.gen.d.ts +1 -1
- package/dist/docx/containerChildren.gen.js +1 -0
- package/dist/docx/documentParser.js +12 -12
- package/dist/docx/drawingIdNormalization.d.ts +3 -1
- package/dist/docx/drawingIdNormalization.js +6 -1
- package/dist/docx/ensureParaIds.js +119 -97
- package/dist/docx/footnoteParser.js +8 -4
- package/dist/docx/headerFooterParser.js +3 -3
- package/dist/docx/headerFooterReferenceNormalization.d.ts +20 -1
- package/dist/docx/headerFooterReferenceNormalization.js +52 -27
- package/dist/docx/hyperlinkParser.d.ts +1 -1
- package/dist/docx/index.d.ts +1 -1
- package/dist/docx/listNumberingInstances.d.ts +59 -0
- package/dist/docx/listNumberingInstances.js +249 -0
- package/dist/docx/metadataPrivacy.js +24 -1
- package/dist/docx/normalizeBaseDirection.js +2 -1
- package/dist/docx/noteReferenceMark.d.ts +15 -0
- package/dist/docx/noteReferenceMark.js +48 -0
- package/dist/docx/opaqueCarrier.d.ts +7 -0
- package/dist/docx/opaqueCarrier.js +38 -0
- package/dist/docx/packageParts.js +4 -1
- package/dist/docx/paragraphParser.js +96 -27
- package/dist/docx/paragraphPropertySource.d.ts +4 -2
- package/dist/docx/paragraphPropertySource.js +10 -2
- package/dist/docx/paragraphTraversal.js +1 -0
- package/dist/docx/parseWarningMessage.js +4 -1
- package/dist/docx/parser.js +175 -22
- package/dist/docx/rezip.js +31 -7
- package/dist/docx/sdtProperties.js +1 -1
- package/dist/docx/sdtPropertiesPatch.js +3 -0
- package/dist/docx/selectiveSave.js +16 -9
- package/dist/docx/selectiveXmlPatch.d.ts +3 -1
- package/dist/docx/selectiveXmlPatch.js +186 -39
- package/dist/docx/serializer/blockCustomXmlSerializer.d.ts +5 -0
- package/dist/docx/serializer/blockCustomXmlSerializer.js +4 -0
- package/dist/docx/serializer/documentSerializer.js +2 -0
- package/dist/docx/serializer/headerFooterSerializer.js +2 -0
- package/dist/docx/serializer/noteSerializer.js +3 -1
- package/dist/docx/serializer/paragraphSerializer.js +33 -9
- package/dist/docx/serializer/tableSerializer.js +25 -38
- package/dist/docx/server/boundedArchive.d.ts +8 -13
- package/dist/docx/server/boundedArchive.js +70 -59
- package/dist/docx/server/createBilingualDocument.js +3 -3
- package/dist/docx/server/extractDocxText.d.ts +8 -2
- package/dist/docx/server/extractDocxText.js +2 -2
- package/dist/docx/server/validateDocxConformance.d.ts +1 -1
- package/dist/docx/server/validateDocxConformance.js +1 -0
- package/dist/docx/tableParser.d.ts +157 -1
- package/dist/docx/tableParser.js +89 -10
- package/dist/docx/textBoxParser.js +1 -1
- package/dist/docx/unzip.d.ts +20 -2
- package/dist/docx/unzip.js +136 -25
- package/dist/docx/wordprocessingPrefixes.d.ts +78 -0
- package/dist/docx/wordprocessingPrefixes.js +286 -0
- package/dist/fonts/embeddedFonts.js +1 -1
- package/dist/i18n/messages/catalogs.gen.d.ts +170 -34
- package/dist/i18n/messages/catalogs.gen.js +187 -51
- package/dist/i18n/messages/messages.gen.d.ts +10 -2
- package/dist/internal/compare/inline-presentation.d.ts +2 -1
- package/dist/internal/compare/inline-presentation.js +11 -10
- package/dist/internal/headlessRevisionResolutionGuard.d.ts +2 -8
- package/dist/internal/headlessRevisionResolutionGuard.js +2 -11
- package/dist/internal/indexedPositionMap.d.ts +11 -0
- package/dist/internal/indexedPositionMap.js +42 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +2 -1
- package/dist/internal/revisionResolutionEdits.d.ts +13 -0
- package/dist/internal/revisionResolutionEdits.js +19 -0
- package/dist/internal/revisionResolutionInline.d.ts +24 -0
- package/dist/internal/{headlessRevisionResolution.js → revisionResolutionInline.js} +61 -43
- package/dist/internal/revisionResolutionStep.d.ts +34 -0
- package/dist/internal/revisionResolutionStep.js +282 -0
- package/dist/internal/revisionResolutionTracking.d.ts +11 -0
- package/dist/internal/revisionResolutionTracking.js +124 -0
- package/dist/internal/wholeStoryRevisionResolution.d.ts +56 -0
- package/dist/internal/wholeStoryRevisionResolution.js +600 -0
- package/dist/layout-bridge/convert/markupViewFlow.d.ts +20 -0
- package/dist/layout-bridge/convert/markupViewFlow.js +123 -0
- package/dist/layout-bridge/convert/tableConversion.js +1 -1
- package/dist/layout-bridge/convert/toFlowBlocks.js +10 -1
- package/dist/layout-engine/layoutInstrumentation.d.ts +9 -1
- package/dist/layout-engine/layoutInstrumentation.js +4 -1
- package/dist/layout-engine/measure/cache.d.ts +18 -1
- package/dist/layout-engine/measure/cache.js +31 -1
- package/dist/layout-engine/measure/font-metrics.worker.js +3 -7
- package/dist/layout-engine/measure/measureContainer.js +7 -47
- package/dist/layout-engine/measure/measureHelpers.d.ts +6 -1
- package/dist/layout-engine/measure/measureHelpers.js +22 -2
- package/dist/layout-engine/measure/measureParagraph.js +2 -2
- package/dist/layout-engine/measure/measureWorker.js +2 -3
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +6 -7
- package/dist/layout-engine/measure/measureWorkerProtocol.js +1 -2
- package/dist/layout-engine/measure/paragraphMeasureShared.d.ts +12 -1
- package/dist/layout-engine/measure/paragraphMeasureShared.js +14 -1
- package/dist/layout-engine/types.d.ts +6 -0
- package/dist/layout-painter/renderPage.js +1 -0
- package/dist/layout-painter/renderParagraph.js +1 -1
- package/dist/managers/ContextMenuManager.js +5 -2
- package/dist/managers/types.d.ts +3 -0
- package/dist/markdown/escape.d.ts +2 -2
- package/dist/markdown/escape.js +4 -5
- package/dist/markdown/fromMarkdown.js +2 -1
- package/dist/markdown/internals.d.ts +11 -1
- package/dist/markdown/internals.js +24 -3
- package/dist/markdown/renderBlock.js +121 -25
- package/dist/markdown/renderParagraph.d.ts +13 -1
- package/dist/markdown/renderParagraph.js +85 -38
- package/dist/markdown/renderRuns.d.ts +10 -1
- package/dist/markdown/renderRuns.js +323 -69
- package/dist/markdown/renderTable.js +24 -12
- package/dist/markdown/trailers.js +2 -2
- package/dist/markdown/types.d.ts +29 -7
- package/dist/paged-layout/incrementalMeasure.d.ts +1 -2
- package/dist/paged-layout/incrementalMeasure.js +1 -9
- package/dist/paged-layout/transactionDirtyRange.d.ts +1 -3
- package/dist/paged-layout/transactionDirtyRange.js +29 -41
- package/dist/panel-layout.d.ts +83 -0
- package/dist/panel-layout.js +96 -0
- package/dist/prosemirror/anchoredTextBoxes.d.ts +37 -0
- package/dist/prosemirror/anchoredTextBoxes.js +156 -0
- package/dist/prosemirror/attrs/index.d.ts +6 -2
- package/dist/prosemirror/attrs/index.js +172 -1
- package/dist/prosemirror/clearRunColor.d.ts +6 -0
- package/dist/prosemirror/clearRunColor.js +46 -0
- package/dist/prosemirror/commands/comments.d.ts +7 -8
- package/dist/prosemirror/commands/comments.js +281 -212
- package/dist/prosemirror/commands/contentControls.d.ts +1 -1
- package/dist/prosemirror/commands/formatPainter.d.ts +1 -1
- package/dist/prosemirror/commands/formatPainter.js +1 -1
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/hyperlink.js +2 -1
- package/dist/prosemirror/commands/index.d.ts +2 -2
- package/dist/prosemirror/commands/index.js +2 -2
- package/dist/prosemirror/commands/paragraph.d.ts +7 -1
- package/dist/prosemirror/commands/paragraph.js +9 -1
- package/dist/prosemirror/commands/paragraphBookmarkJoin.d.ts +13 -0
- package/dist/prosemirror/commands/paragraphBookmarkJoin.js +22 -0
- package/dist/prosemirror/commands/pastePlainText.d.ts +1 -1
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +3 -2
- package/dist/prosemirror/commands/propertyChangeScope.js +24 -3
- package/dist/prosemirror/commands/resolveAllTableChanges.d.ts +40 -0
- package/dist/prosemirror/commands/resolveAllTableChanges.js +620 -0
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.d.ts +15 -0
- package/dist/prosemirror/commands/resolveNodePropertyChangeAttrs.js +46 -0
- package/dist/prosemirror/commands/resolveParagraphProperties.d.ts +16 -0
- package/dist/prosemirror/commands/resolveParagraphProperties.js +73 -0
- package/dist/prosemirror/commands/sectionBreak.js +2 -1
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +15 -2
- package/dist/prosemirror/commands/tableCellMergeResolution.js +23 -7
- package/dist/prosemirror/containerFinalParagraph.d.ts +11 -5
- package/dist/prosemirror/containerFinalParagraph.js +7 -6
- package/dist/prosemirror/contentControlRevisions.d.ts +1 -1
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +2 -13
- package/dist/prosemirror/conversion/fromProseDoc.js +177 -605
- package/dist/prosemirror/conversion/toProseDoc.d.ts +4 -11
- package/dist/prosemirror/conversion/toProseDoc.js +70 -154
- package/dist/prosemirror/documentSchema.d.ts +8 -0
- package/dist/prosemirror/documentSchema.js +18 -0
- package/dist/prosemirror/emptyFieldResultRuns.d.ts +18 -0
- package/dist/prosemirror/emptyFieldResultRuns.js +33 -0
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +1 -1
- package/dist/prosemirror/extensions/ExtensionManager.js +3 -1
- package/dist/prosemirror/extensions/StarterKit.js +5 -1
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +116 -63
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +4 -1
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +24 -3
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.d.ts +20 -0
- package/dist/prosemirror/extensions/features/JoinedRunStyleExtension.js +43 -0
- package/dist/prosemirror/extensions/features/ListExtension.js +167 -128
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +19 -2
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +33 -20
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +31 -2
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +270 -99
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +3 -2
- package/dist/prosemirror/extensions/features/pasteCleanup.js +2 -1
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +1 -1
- package/dist/prosemirror/extensions/features/pastedHtmlLists.d.ts +12 -0
- package/dist/prosemirror/extensions/features/pastedHtmlLists.js +124 -0
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +33 -11
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +8 -4
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +21 -18
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.js +37 -17
- package/dist/prosemirror/extensions/marks/StrikeExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/SubscriptExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.js +2 -2
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +4 -3
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +15 -8
- package/dist/prosemirror/extensions/marks/markUtils.js +25 -10
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.d.ts +12 -0
- package/dist/prosemirror/extensions/marks/noteReferenceDeletion.js +46 -0
- package/dist/prosemirror/extensions/nodes/BlockCustomXmlExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/nodes/BlockCustomXmlExtension.js +52 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +2 -2
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +50 -15
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.js +5 -3
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.js +4 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +1 -1
- package/dist/prosemirror/extensions/nodes/TableExtension.js +121 -226
- package/dist/prosemirror/extensions/types.d.ts +11 -1
- package/dist/prosemirror/findReplaceSelection.js +1 -1
- package/dist/prosemirror/hyperlinkRemoval.d.ts +9 -0
- package/dist/prosemirror/hyperlinkRemoval.js +129 -0
- package/dist/prosemirror/index.d.ts +5 -3
- package/dist/prosemirror/index.js +5 -3
- package/dist/prosemirror/indexedNodeLookup.d.ts +17 -0
- package/dist/prosemirror/indexedNodeLookup.js +103 -0
- package/dist/prosemirror/listAutoformatMarkers.d.ts +19 -0
- package/dist/prosemirror/listAutoformatMarkers.js +98 -0
- package/dist/prosemirror/listInstanceReferences.d.ts +12 -0
- package/dist/prosemirror/listInstanceReferences.js +72 -0
- package/dist/prosemirror/listLabels.d.ts +24 -0
- package/dist/prosemirror/listLabels.js +111 -0
- package/dist/prosemirror/listNumbering.d.ts +92 -0
- package/dist/prosemirror/listNumbering.js +330 -0
- package/dist/prosemirror/listRendering.d.ts +27 -0
- package/dist/prosemirror/listRendering.js +27 -0
- package/dist/prosemirror/listRenderingAttrs.d.ts +11 -2
- package/dist/prosemirror/listRenderingAttrs.js +8 -1
- package/dist/prosemirror/markupViewNotes.d.ts +8 -0
- package/dist/prosemirror/markupViewNotes.js +49 -0
- package/dist/prosemirror/markupViewProjection.d.ts +97 -0
- package/dist/prosemirror/markupViewProjection.js +88 -0
- package/dist/prosemirror/noteReferenceReview.d.ts +77 -0
- package/dist/prosemirror/noteReferenceReview.js +332 -0
- package/dist/prosemirror/numberingAttr.d.ts +9 -1
- package/dist/prosemirror/numberingAttr.js +9 -1
- package/dist/prosemirror/outlineLevelAttr.js +1 -1
- package/dist/prosemirror/paragraphIndentation.d.ts +10 -1
- package/dist/prosemirror/paragraphIndentation.js +32 -7
- package/dist/prosemirror/paragraphMarkJoin.d.ts +21 -0
- package/dist/prosemirror/paragraphMarkJoin.js +26 -0
- package/dist/prosemirror/paragraphPropertyCarry.d.ts +64 -0
- package/dist/prosemirror/paragraphPropertyCarry.js +158 -0
- package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +1 -1
- package/dist/prosemirror/plugins/documentNumbering.d.ts +27 -1
- package/dist/prosemirror/plugins/documentNumbering.js +97 -11
- package/dist/prosemirror/plugins/documentStyleState.d.ts +26 -0
- package/dist/prosemirror/plugins/documentStyleState.js +32 -0
- package/dist/prosemirror/plugins/documentStyles.d.ts +3 -13
- package/dist/prosemirror/plugins/documentStyles.js +67 -17
- package/dist/prosemirror/plugins/index.d.ts +2 -1
- package/dist/prosemirror/plugins/index.js +2 -1
- package/dist/prosemirror/plugins/paragraphStyleResolution.d.ts +15 -0
- package/dist/prosemirror/plugins/paragraphStyleResolution.js +230 -0
- package/dist/prosemirror/plugins/suggestionMode.d.ts +27 -3
- package/dist/prosemirror/plugins/suggestionMode.js +490 -63
- package/dist/prosemirror/plugins/templateDirectives.d.ts +1 -1
- package/dist/prosemirror/plugins/transactionInvariants.d.ts +32 -0
- package/dist/prosemirror/plugins/transactionInvariants.js +86 -0
- package/dist/prosemirror/positionSweep.d.ts +24 -0
- package/dist/prosemirror/positionSweep.js +222 -0
- package/dist/prosemirror/rebaseParagraphRunFormatting.d.ts +23 -3
- package/dist/prosemirror/rebaseParagraphRunFormatting.js +39 -13
- package/dist/prosemirror/rebaseParagraphRuns.d.ts +36 -0
- package/dist/prosemirror/rebaseParagraphRuns.js +99 -0
- package/dist/prosemirror/rejoinRunCarriers.d.ts +1 -1
- package/dist/prosemirror/replacedAnnotations.d.ts +33 -1
- package/dist/prosemirror/replacedAnnotations.js +170 -1
- package/dist/prosemirror/runFormattingFromMarks.d.ts +18 -0
- package/dist/prosemirror/runFormattingFromMarks.js +567 -0
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +1 -1
- package/dist/prosemirror/runFormattingReconciliation.js +10 -9
- package/dist/prosemirror/schema/index.d.ts +2 -2
- package/dist/prosemirror/schema/index.js +3 -0
- package/dist/prosemirror/schema/nodes.d.ts +44 -11
- package/dist/prosemirror/sectionMarkEdits.d.ts +20 -0
- package/dist/prosemirror/sectionMarkEdits.js +59 -0
- package/dist/prosemirror/storyListNumbering.d.ts +17 -0
- package/dist/prosemirror/storyListNumbering.js +102 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.d.ts +59 -0
- package/dist/prosemirror/styles/paragraphStyleCascade.js +145 -0
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +21 -2
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +38 -1
- package/dist/prosemirror/styles/tableStyleRegions.d.ts +31 -0
- package/dist/prosemirror/styles/tableStyleRegions.js +55 -0
- package/dist/prosemirror/tableCellPaste.d.ts +74 -0
- package/dist/prosemirror/tableCellPaste.js +525 -0
- package/dist/prosemirror/tableGridMutation.d.ts +87 -2
- package/dist/prosemirror/tableGridMutation.js +255 -2
- package/dist/prosemirror/tableRunIn.d.ts +51 -0
- package/dist/prosemirror/tableRunIn.js +165 -0
- package/dist/prosemirror/textInput.js +11 -2
- package/dist/prosemirror/trackedRevisionPath.d.ts +17 -0
- package/dist/prosemirror/trackedRevisionPath.js +32 -0
- package/dist/prosemirror/validation.js +5 -1
- package/dist/redline.js +93 -9
- package/dist/render-dom/BodySelectionOverlay.d.ts +4 -1
- package/dist/render-dom/BodySelectionOverlay.js +3 -2
- package/dist/server.d.ts +2 -2
- package/dist/utils/findReplace.js +2 -2
- package/dist/utils/mergeDocumentContent.js +1 -1
- package/dist/utils/noteReferenceLabels.d.ts +36 -0
- package/dist/utils/noteReferenceLabels.js +32 -0
- package/dist/utils/replaceText.js +1 -1
- package/dist/version-comparison.d.ts +1 -0
- package/dist/version-comparison.js +1 -0
- package/package.json +6 -5
- package/dist/internal/headlessRevisionResolution.d.ts +0 -23
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { document_d_exports } from "../../types/document.js";
|
|
2
|
-
import { StyleEngine } from "../../style-engine/styleEngine.js";
|
|
3
|
-
import "../../style-engine/index.js";
|
|
4
2
|
import { ParseContext } from "../../docx/parseContext.js";
|
|
5
3
|
import { Node } from "prosemirror-model";
|
|
6
4
|
//#region src/prosemirror/conversion/toProseDoc.d.ts
|
|
@@ -26,15 +24,10 @@ type ToProseDocOptions = {
|
|
|
26
24
|
*/
|
|
27
25
|
declare function toProseDoc(document: document_d_exports.Document, options?: ToProseDocOptions): Node;
|
|
28
26
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* document defaults, and will layer these own properties over it.
|
|
27
|
+
* Whether a cell carries content a vertical-merge continuation must not hide.
|
|
28
|
+
* The reader keeps such a continuation as a cell of its own.
|
|
32
29
|
*/
|
|
33
|
-
|
|
34
|
-
/** @internal Recompute a paragraph's inherited run defaults from authored package state. */
|
|
35
|
-
declare function resolveParagraphDefaultTextFormatting(styleId: string | undefined, formatting: document_d_exports.Paragraph["formatting"] | undefined, styleResolver: ParagraphDefaultFormattingResolver, options?: {
|
|
36
|
-
includeParagraphMarkRunProperties?: boolean;
|
|
37
|
-
}): document_d_exports.TextFormatting | undefined;
|
|
30
|
+
declare function tableCellHasMeaningfulContent(cell: document_d_exports.TableCell): boolean;
|
|
38
31
|
declare function standaloneTableCellToProseMirror(cell: document_d_exports.TableCell, nodeType: "tableCell" | "tableHeader"): Node;
|
|
39
32
|
/**
|
|
40
33
|
* Convert HeaderFooter content (array of Paragraph/Table blocks) to a ProseMirror document.
|
|
@@ -51,4 +44,4 @@ declare function footnoteToProseDoc(content: document_d_exports.BlockContent[],
|
|
|
51
44
|
*/
|
|
52
45
|
declare function createEmptyDoc(): Node;
|
|
53
46
|
//#endregion
|
|
54
|
-
export { ToProseDocOptions, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc,
|
|
47
|
+
export { ToProseDocOptions, createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, standaloneTableCellToProseMirror, tableCellHasMeaningfulContent, toProseDoc };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { rangedCommentIds } from "../../docx/commentAnchorIndex.js";
|
|
2
2
|
import { resolveColorValueToHex } from "../../docx/drawingUtils.js";
|
|
3
3
|
import { isInlineSdtContent, isTrackedChangeWrapperChild } from "../../docx/inlineWrapperContent.js";
|
|
4
|
-
import { mergeParagraphNumbering as mergeParagraphNumbering$1, paragraphNumberingReferenceId as paragraphNumberingReferenceId$1 } from "../../docx/numberingReference.js";
|
|
5
4
|
import { PROSE_PARAGRAPH_SOURCE_CONTRACT_ATTR, createProseParagraphWithPropertySource, getDocumentParagraphPropertySourceContract, proseParagraphAttrsWithoutPropertySource, recreateProseNodeWithParagraphPropertySource, transportTableCellsWithParagraphPropertySources } from "../../docx/paragraphPropertySource.js";
|
|
6
5
|
import { isBaselineVertAlign } from "../../docx/runParser.js";
|
|
7
6
|
import { replayableShapeAlternateContent } from "../../docx/shapeAlternateContent.js";
|
|
@@ -13,7 +12,7 @@ import { createStyleEngine } from "../../style-engine/styleEngine.js";
|
|
|
13
12
|
import { outlineAttrForDash } from "../../types/documentEnumValues.js";
|
|
14
13
|
import { cssBorderStyleForDash } from "../../utils/borderCss.js";
|
|
15
14
|
import { normalizeHorizontalScalePercent } from "../../utils/horizontalScale.js";
|
|
16
|
-
import { mergeParagraphFormatting
|
|
15
|
+
import { mergeParagraphFormatting } from "../../utils/paragraphFormattingMerge.js";
|
|
17
16
|
import { tableOfContentsStyleLevel } from "../../utils/tableOfContentsStyle.js";
|
|
18
17
|
import { mergeTextFormatting } from "../../utils/textFormattingMerge.js";
|
|
19
18
|
import { emuToPixels, emuToStrokePixels } from "../../utils/units.js";
|
|
@@ -22,6 +21,7 @@ import { expectInlineWrapperMarkAttrs, expectTrackedChangeMarkAttrs } from "../a
|
|
|
22
21
|
import { authoredTransformAttrs } from "../authoredTransformAttrs.js";
|
|
23
22
|
import { setAutospacingBaseValue } from "../autospacingBase.js";
|
|
24
23
|
import { withEnclosingRevision } from "../contentControlRevisions.js";
|
|
24
|
+
import { emptyFieldRunPropertyChanges } from "../emptyFieldResultRuns.js";
|
|
25
25
|
import { planEmptyRanges } from "../emptyRangeAnchor.js";
|
|
26
26
|
import { INLINE_WRAPPER_MARK_NAME } from "../extensions/marks/InlineWrapperExtension.js";
|
|
27
27
|
import { textFormattingToMarks } from "../extensions/marks/markUtils.js";
|
|
@@ -34,14 +34,15 @@ import { stampNumberedRefFieldBaselines } from "../numberedRefFields.js";
|
|
|
34
34
|
import { paragraphNumberingAttr } from "../numberingAttr.js";
|
|
35
35
|
import { pageBreakRunParagraphProjectionDispositionForFeatures } from "../pageBreakRunProjection.js";
|
|
36
36
|
import { directionFromBidi } from "../paragraphDirection.js";
|
|
37
|
-
import { styleResolvedParagraphFormatting } from "../paragraphFormattingProvenance.js";
|
|
38
37
|
import { lineSpacingProvenanceFromSpacing } from "../paragraphSpacing.js";
|
|
39
38
|
import { RUN_IDENTITY_MARK_NAME, hasRunIdentityPayload, runIdentityAttrs } from "../runIdentity.js";
|
|
40
39
|
import { continueRunIdentitiesAcrossRevisions } from "../runIdentityAcrossRevisions.js";
|
|
41
40
|
import { getParagraphMarkSuppressionOverrides, hasDirectRunFormatting, resolveParagraphBodyRunFormatting, stripParagraphMarkFormattingForBodyRuns, stripParagraphMarkOnlyFormatting, suppressParagraphMarkFormatting } from "../runStyleFormatting.js";
|
|
42
41
|
import { schema } from "../schema/index.js";
|
|
43
42
|
import { PRESERVED_XML_LEVELS } from "../schema/nodes.js";
|
|
43
|
+
import { extractTableParagraphOverlay, paragraphStyleCascadeAttrs, resolveRunFormattingWithoutDefaults } from "../styles/paragraphStyleCascade.js";
|
|
44
44
|
import { cascadeStyleTextFormatting } from "../styles/styleToggleCascade.js";
|
|
45
|
+
import { tableCellStyleRegions, tableRowBand } from "../styles/tableStyleRegions.js";
|
|
45
46
|
import { canCarryTrackedRunMark, trackedRunInlineAtomDisposition } from "../trackedRunInlineAtoms.js";
|
|
46
47
|
import { assertValidProseMirrorDocument } from "../validation.js";
|
|
47
48
|
import { resolveEffectiveTableCellFormatting } from "./effectiveTableCellFormatting.js";
|
|
@@ -197,6 +198,7 @@ const collectPairedBookmarkIds = (blocks) => {
|
|
|
197
198
|
}
|
|
198
199
|
break;
|
|
199
200
|
case "blockSdt":
|
|
201
|
+
case "blockCustomXml":
|
|
200
202
|
visitBlocks(block.content);
|
|
201
203
|
break;
|
|
202
204
|
case "preservedBlock": break;
|
|
@@ -250,6 +252,9 @@ function toProseDoc(document, options) {
|
|
|
250
252
|
case "blockSdt":
|
|
251
253
|
out.push(convertBlockSdt(block, convertBodyBlocks));
|
|
252
254
|
break;
|
|
255
|
+
case "blockCustomXml":
|
|
256
|
+
out.push(convertBlockCustomXml(block, convertBodyBlocks));
|
|
257
|
+
break;
|
|
253
258
|
case "preservedBlock":
|
|
254
259
|
out.push(convertPreservedBlock(block));
|
|
255
260
|
break;
|
|
@@ -282,7 +287,10 @@ function toProseDoc(document, options) {
|
|
|
282
287
|
* no index and nothing has to keep one honest as the blocks around it change.
|
|
283
288
|
*/
|
|
284
289
|
function convertPreservedBlock(block) {
|
|
285
|
-
return schema.node("preservedBlock", {
|
|
290
|
+
return schema.node("preservedBlock", {
|
|
291
|
+
xml: block.xml,
|
|
292
|
+
readerText: block.readerText ?? null
|
|
293
|
+
});
|
|
286
294
|
}
|
|
287
295
|
/**
|
|
288
296
|
* Carry a bookmark marker that stands between two blocks into the editor.
|
|
@@ -354,6 +362,15 @@ function convertBlockSdt(blockSdt, convertBlocks) {
|
|
|
354
362
|
if (children.length === 0) children.push(schema.node("paragraph", {}, []));
|
|
355
363
|
return schema.node("blockSdt", attrs, children);
|
|
356
364
|
}
|
|
365
|
+
function convertBlockCustomXml(block, convertBlocks) {
|
|
366
|
+
const children = convertBlocks(block.content);
|
|
367
|
+
if (children.length === 0) children.push(schema.node("paragraph", {}, []));
|
|
368
|
+
return schema.node("blockCustomXml", {
|
|
369
|
+
openingXml: block.openingXml,
|
|
370
|
+
closingXml: block.closingXml,
|
|
371
|
+
_originallyEmpty: block.content.length === 0
|
|
372
|
+
}, children);
|
|
373
|
+
}
|
|
357
374
|
/**
|
|
358
375
|
* Convert a Paragraph to a ProseMirror paragraph node
|
|
359
376
|
*
|
|
@@ -755,54 +772,15 @@ function paragraphFormattingToAttrs(paragraph, styleResolver, tableParagraphOver
|
|
|
755
772
|
};
|
|
756
773
|
let stylePpr;
|
|
757
774
|
if (styleResolver) {
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
set("lineSpacingExplicit", lineSpacingProvenanceFromSpacing(formatting));
|
|
768
|
-
set("snapToGrid", formatting?.snapToGrid ?? stylePpr?.snapToGrid);
|
|
769
|
-
set("spacingExplicit", formatting?.spacingExplicit);
|
|
770
|
-
const paragraphStyle = styleId ? styleResolver.getStyle(styleId) ?? styleResolver.getDefaultParagraphStyle() : styleResolver.getDefaultParagraphStyle();
|
|
771
|
-
const docDefaultSpacing = styleResolver.getDocDefaults()?.pPr;
|
|
772
|
-
const spacingFromStyle = {};
|
|
773
|
-
if (formatting?.spaceBefore === void 0 && stylePpr?.spaceBefore !== void 0) spacingFromStyle.before = true;
|
|
774
|
-
if (formatting?.spaceAfter === void 0 && stylePpr?.spaceAfter !== void 0) spacingFromStyle.after = true;
|
|
775
|
-
if (spacingFromStyle.before || spacingFromStyle.after) attrs.spacingFromImplicitDefaultStyle = spacingFromStyle;
|
|
776
|
-
const spacingFromDocDefaults = {};
|
|
777
|
-
if (formatting?.spaceBefore === void 0 && tableParagraphOverlay?.spaceBefore === void 0 && paragraphStyle?.pPr?.spaceBefore === void 0 && docDefaultSpacing?.spaceBefore !== void 0) spacingFromDocDefaults.before = true;
|
|
778
|
-
if (formatting?.spaceAfter === void 0 && tableParagraphOverlay?.spaceAfter === void 0 && paragraphStyle?.pPr?.spaceAfter === void 0 && docDefaultSpacing?.spaceAfter !== void 0) spacingFromDocDefaults.after = true;
|
|
779
|
-
if (spacingFromDocDefaults.before || spacingFromDocDefaults.after) attrs.spacingFromDocDefaults = spacingFromDocDefaults;
|
|
780
|
-
const effectiveIndent = mergeParagraphFormatting(formatting?.numPr?.kind === "none" && paragraphNumberingReferenceId$1(stylePpr?.numPr) !== void 0 ? void 0 : stylePpr, formatting);
|
|
781
|
-
set("indentLeft", effectiveIndent?.indentLeft);
|
|
782
|
-
set("indentRight", formatting?.indentRight ?? stylePpr?.indentRight);
|
|
783
|
-
set("indentFirstLine", effectiveIndent?.indentFirstLine);
|
|
784
|
-
set("hangingIndent", effectiveIndent?.hangingIndent);
|
|
785
|
-
set("borders", formatting?.borders ?? stylePpr?.borders);
|
|
786
|
-
set("shading", formatting?.shading ?? stylePpr?.shading);
|
|
787
|
-
set("tabs", mergeParagraphTabStops(stylePpr?.tabs, formatting?.tabs));
|
|
788
|
-
set("kinsoku", formatting?.kinsoku ?? stylePpr?.kinsoku);
|
|
789
|
-
set("overflowPunctuation", formatting?.overflowPunctuation ?? stylePpr?.overflowPunctuation);
|
|
790
|
-
set("suppressAutoHyphens", formatting?.suppressAutoHyphens ?? stylePpr?.suppressAutoHyphens);
|
|
791
|
-
set("pageBreakBefore", formatting?.pageBreakBefore ?? stylePpr?.pageBreakBefore);
|
|
792
|
-
set("keepNext", formatting?.keepNext ?? stylePpr?.keepNext);
|
|
793
|
-
set("keepLines", formatting?.keepLines ?? stylePpr?.keepLines);
|
|
794
|
-
set("widowControl", formatting?.widowControl ?? stylePpr?.widowControl);
|
|
795
|
-
set("contextualSpacing", formatting?.contextualSpacing ?? stylePpr?.contextualSpacing);
|
|
796
|
-
set("runInWithNext", formatting?.runInWithNext ?? stylePpr?.runInWithNext);
|
|
797
|
-
set("outlineLevel", formatting?.outlineLevel ?? stylePpr?.outlineLevel);
|
|
798
|
-
set("direction", directionFromBidi(formatting?.bidi ?? stylePpr?.bidi));
|
|
799
|
-
set("defaultTextFormatting", resolveParagraphDefaultTextFormatting(styleId, formatting, styleResolver, { includeParagraphMarkRunProperties: tableOfContentsLevel === void 0 && (styleId === void 0 || paragraph.content.length === 0) }));
|
|
800
|
-
const styleNumbering = stylePpr?.numPr;
|
|
801
|
-
if (styleNumbering?.kind === "reference" && (formatting?.numPr === void 0 || formatting.numPr.kind === "levelOnly")) {
|
|
802
|
-
const merged = mergeParagraphNumbering$1(styleNumbering, formatting?.numPr);
|
|
803
|
-
if (merged !== void 0) attrs.numPr = paragraphNumberingAttr(merged);
|
|
804
|
-
attrs.numPrFromStyle = paragraphNumberingAttr(styleNumbering);
|
|
805
|
-
}
|
|
775
|
+
const cascade = paragraphStyleCascadeAttrs({
|
|
776
|
+
styleId,
|
|
777
|
+
formatting,
|
|
778
|
+
styleResolver,
|
|
779
|
+
tableParagraphOverlay,
|
|
780
|
+
includeParagraphMarkRunProperties: tableOfContentsLevel === void 0 && (styleId === void 0 || paragraph.content.length === 0)
|
|
781
|
+
});
|
|
782
|
+
stylePpr = cascade.stylePpr;
|
|
783
|
+
Object.assign(attrs, cascade.attrs);
|
|
806
784
|
} else {
|
|
807
785
|
set("alignment", formatting?.alignment);
|
|
808
786
|
set("spaceBefore", formatting?.spaceBefore);
|
|
@@ -850,21 +828,6 @@ function paragraphFormattingToAttrs(paragraph, styleResolver, tableParagraphOver
|
|
|
850
828
|
};
|
|
851
829
|
}
|
|
852
830
|
/**
|
|
853
|
-
* Pick the modeled paragraph fields out of a table style's (or conditional
|
|
854
|
-
* region's) `w:pPr` for use as the cell-paragraph cascade overlay.
|
|
855
|
-
*/
|
|
856
|
-
function extractTableParagraphOverlay(pPr) {
|
|
857
|
-
if (!pPr) return;
|
|
858
|
-
const overlay = {};
|
|
859
|
-
if (pPr.spaceBefore !== void 0) overlay.spaceBefore = pPr.spaceBefore;
|
|
860
|
-
if (pPr.spaceAfter !== void 0) overlay.spaceAfter = pPr.spaceAfter;
|
|
861
|
-
if (pPr.lineSpacing !== void 0) overlay.lineSpacing = pPr.lineSpacing;
|
|
862
|
-
if (pPr.lineSpacingRule !== void 0) overlay.lineSpacingRule = pPr.lineSpacingRule;
|
|
863
|
-
if (pPr.contextualSpacing !== void 0) overlay.contextualSpacing = pPr.contextualSpacing;
|
|
864
|
-
if (pPr.frame !== void 0) overlay.frame = pPr.frame;
|
|
865
|
-
return Object.keys(overlay).length > 0 ? overlay : void 0;
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
831
|
* Resolve table style conditional formatting
|
|
869
832
|
*/
|
|
870
833
|
function resolveTableStyleConditional(styleResolver, tableStyleId, conditionType) {
|
|
@@ -930,45 +893,6 @@ function resolveTextFormatting(formatting, styleResolver) {
|
|
|
930
893
|
if (!styleResolver) return formatting;
|
|
931
894
|
return mergeTextFormatting(styleResolver.resolveRunStyle(formatting.styleId), formatting);
|
|
932
895
|
}
|
|
933
|
-
function resolveRunFormattingWithoutDefaults(formatting, styleResolver) {
|
|
934
|
-
if (!formatting || !styleResolver) return formatting;
|
|
935
|
-
return cascadeStyleTextFormatting([{
|
|
936
|
-
formatting: formatting.styleId ? styleResolver.getRunStyleOwnProperties(formatting.styleId) : void 0,
|
|
937
|
-
type: "style"
|
|
938
|
-
}, {
|
|
939
|
-
formatting,
|
|
940
|
-
type: "direct"
|
|
941
|
-
}]).formatting;
|
|
942
|
-
}
|
|
943
|
-
/** @internal Recompute a paragraph's inherited run defaults from authored package state. */
|
|
944
|
-
function resolveParagraphDefaultTextFormatting(styleId, formatting, styleResolver, options = {}) {
|
|
945
|
-
const style = styleId ? styleResolver.getStyle(styleId) ?? styleResolver.getDefaultParagraphStyle() : styleResolver.getDefaultParagraphStyle();
|
|
946
|
-
const paragraphStyleRpr = style?.type === "paragraph" ? style.rPr : void 0;
|
|
947
|
-
const rawParagraphMarkRpr = options.includeParagraphMarkRunProperties === false ? void 0 : formatting?.runProperties;
|
|
948
|
-
const paragraphRunProperties = rawParagraphMarkRpr ? stripParagraphMarkOnlyFormatting(resolveRunFormattingWithoutDefaults(rawParagraphMarkRpr, styleResolver) ?? {}) : void 0;
|
|
949
|
-
const orderedBodyToggleFormatting = cascadeStyleTextFormatting([
|
|
950
|
-
{
|
|
951
|
-
formatting: styleResolver.getDocDefaults()?.rPr,
|
|
952
|
-
type: "defaults"
|
|
953
|
-
},
|
|
954
|
-
{
|
|
955
|
-
formatting: paragraphStyleRpr,
|
|
956
|
-
type: "style"
|
|
957
|
-
},
|
|
958
|
-
{
|
|
959
|
-
formatting: styleResolver.getDefaultCharacterStyle()?.rPr,
|
|
960
|
-
type: "style"
|
|
961
|
-
}
|
|
962
|
-
], { ordinaryFormatting: mergeTextFormatting(mergeTextFormatting(styleResolver.getDocDefaults()?.rPr, styleResolver.getDefaultCharacterStyle()?.rPr), paragraphStyleRpr) });
|
|
963
|
-
const bodyRunDefaults = orderedBodyToggleFormatting.formatting;
|
|
964
|
-
return cascadeStyleTextFormatting([{
|
|
965
|
-
cascade: orderedBodyToggleFormatting,
|
|
966
|
-
type: "carried"
|
|
967
|
-
}, {
|
|
968
|
-
formatting: paragraphRunProperties,
|
|
969
|
-
type: "direct"
|
|
970
|
-
}], { ordinaryFormatting: mergeTextFormatting(bodyRunDefaults, paragraphRunProperties) }).formatting;
|
|
971
|
-
}
|
|
972
896
|
function calculateRowSpans(table) {
|
|
973
897
|
const result = /* @__PURE__ */ new Map();
|
|
974
898
|
const numRows = table.rows.length;
|
|
@@ -1065,6 +989,10 @@ function closeVerticalMerge(activeMerges, result, colIndex) {
|
|
|
1065
989
|
function clearActiveVerticalMerges(activeMerges, result) {
|
|
1066
990
|
for (const colIndex of [...activeMerges.keys()]) closeVerticalMerge(activeMerges, result, colIndex);
|
|
1067
991
|
}
|
|
992
|
+
/**
|
|
993
|
+
* Whether a cell carries content a vertical-merge continuation must not hide.
|
|
994
|
+
* The reader keeps such a continuation as a cell of its own.
|
|
995
|
+
*/
|
|
1068
996
|
function tableCellHasMeaningfulContent(cell) {
|
|
1069
997
|
return cell.content.some(blockHasMeaningfulContent);
|
|
1070
998
|
}
|
|
@@ -1072,7 +1000,7 @@ function blockHasMeaningfulContent(block) {
|
|
|
1072
1000
|
if (block.type === "preservedBlock") return true;
|
|
1073
1001
|
if (block.type === "bookmarkStart" || block.type === "bookmarkEnd") return true;
|
|
1074
1002
|
if (block.type === "table") return block.rows.some((row) => row.cells.some((cell) => tableCellHasMeaningfulContent(cell)));
|
|
1075
|
-
if (block.type === "blockSdt") return true;
|
|
1003
|
+
if (block.type === "blockSdt" || block.type === "blockCustomXml") return true;
|
|
1076
1004
|
return block.content.some(paragraphContentHasMeaningfulContent);
|
|
1077
1005
|
}
|
|
1078
1006
|
function paragraphContentHasMeaningfulContent(content) {
|
|
@@ -1132,6 +1060,7 @@ function convertTable(table, styleResolver, context) {
|
|
|
1132
1060
|
if (table.propertyChanges && table.propertyChanges.length > 0) attrs.tblPrChange = [...table.propertyChanges];
|
|
1133
1061
|
if (table.bookmarks && table.bookmarks.length > 0) attrs._bookmarks = table.bookmarks;
|
|
1134
1062
|
if (hasSinkChildren(table.preserved)) attrs._preserved = table.preserved;
|
|
1063
|
+
if (table.carrierStack?.length) attrs.carrierStack = table.carrierStack;
|
|
1135
1064
|
const conditionalStyles = {};
|
|
1136
1065
|
const setCS = (key, type) => {
|
|
1137
1066
|
const val = resolveTableStyleConditional(styleResolver, conditionalTableStyleId, type);
|
|
@@ -1152,24 +1081,13 @@ function convertTable(table, styleResolver, context) {
|
|
|
1152
1081
|
setCS("neCell", "neCell");
|
|
1153
1082
|
setCS("swCell", "swCell");
|
|
1154
1083
|
setCS("seCell", "seCell");
|
|
1155
|
-
const bandingEnabledH = !look.noHBand;
|
|
1156
|
-
const bandingEnabledV = !look.noVBand;
|
|
1157
|
-
let dataRowIndex = 0;
|
|
1158
1084
|
const totalRows = table.rows.length;
|
|
1159
1085
|
const gridColumnCount = columnWidths?.length ?? 0;
|
|
1160
1086
|
const totalColumns = gridColumnCount > 0 ? gridColumnCount : countTableColumns(table.rows);
|
|
1161
1087
|
const rows = table.rows.map((row, rowIndex) => {
|
|
1162
1088
|
const isFirstRowStyled = rowIndex === 0 && look.firstRow;
|
|
1163
|
-
const isLastRow = rowIndex === totalRows - 1 && look.lastRow;
|
|
1164
|
-
const rowBandStyle = (() => {
|
|
1165
|
-
if (bandingEnabledH && !isFirstRowStyled && !isLastRow) return (() => {
|
|
1166
|
-
if (dataRowIndex % 2 === 0) return conditionalStyles.band1Horz;
|
|
1167
|
-
return conditionalStyles.band2Horz;
|
|
1168
|
-
})();
|
|
1169
|
-
})();
|
|
1170
|
-
if (bandingEnabledH && !isFirstRowStyled && !isLastRow) dataRowIndex++;
|
|
1171
1089
|
const resolvedRowJustification = tableStyle?.trPr?.justification ?? fallbackTableStyle?.trPr?.justification;
|
|
1172
|
-
return convertTableRow(row, styleResolver, context, isFirstRowStyled, columnWidths, totalWidth, conditionalStyles,
|
|
1090
|
+
return convertTableRow(row, styleResolver, context, isFirstRowStyled, columnWidths, totalWidth, conditionalStyles, tableRowBand(look, rowIndex, totalRows), look, resolvedTableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, cellMarginsAttr, resolvedRowJustification);
|
|
1173
1091
|
});
|
|
1174
1092
|
return schema.node("table", attrs, rows);
|
|
1175
1093
|
}
|
|
@@ -1199,7 +1117,7 @@ function createOmittedGridSlotCell({ colspan, slot, columnWidths, totalWidth, st
|
|
|
1199
1117
|
/**
|
|
1200
1118
|
* Convert a TableRow to a ProseMirror table row node
|
|
1201
1119
|
*/
|
|
1202
|
-
function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths, totalWidth, conditionalStyles,
|
|
1120
|
+
function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths, totalWidth, conditionalStyles, rowBand, tableLook, tableBorders, rowIndex, totalRows, totalColumns, rowSpanMap, defaultCellMargins, resolvedJustification) {
|
|
1203
1121
|
const attrsWithoutStructuralChange = { isHeader: !!row.formatting?.header };
|
|
1204
1122
|
if (row.formatting?.height?.value !== void 0) attrsWithoutStructuralChange.height = row.formatting.height.value;
|
|
1205
1123
|
if (row.formatting?.heightRule) attrsWithoutStructuralChange.heightRule = row.formatting.heightRule;
|
|
@@ -1212,6 +1130,7 @@ function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths,
|
|
|
1212
1130
|
if (row.preservedAttributes && row.preservedAttributes.length > 0) attrsWithoutStructuralChange._preservedAttributes = row.preservedAttributes;
|
|
1213
1131
|
if (row.bookmarks && row.bookmarks.length > 0) attrsWithoutStructuralChange._bookmarks = row.bookmarks;
|
|
1214
1132
|
if (row.contentControls && row.contentControls.length > 0) attrsWithoutStructuralChange.contentControls = row.contentControls;
|
|
1133
|
+
if (row.carrierStack?.length) attrsWithoutStructuralChange.carrierStack = row.carrierStack;
|
|
1215
1134
|
if (hasSinkChildren(row.preserved)) attrsWithoutStructuralChange._preserved = row.preserved;
|
|
1216
1135
|
let attrs = attrsWithoutStructuralChange;
|
|
1217
1136
|
const rowStructuralChange = row.structuralChange;
|
|
@@ -1248,8 +1167,6 @@ function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths,
|
|
|
1248
1167
|
const isFirstRow = rowIndex === 0;
|
|
1249
1168
|
const isLastRow = rowIndex === (totalRows ?? 1) - 1;
|
|
1250
1169
|
const rowCnf = row.formatting?.conditionalFormat;
|
|
1251
|
-
const rowIsFirstRow = rowCnf?.firstRow ?? isFirstRow;
|
|
1252
|
-
const rowIsLastRow = rowCnf?.lastRow ?? isLastRow;
|
|
1253
1170
|
const totalCols = totalColumns != null && totalColumns > 0 ? totalColumns : Math.max(numCells, 1);
|
|
1254
1171
|
let effectiveCells = row.cells;
|
|
1255
1172
|
const uncoveredColumns = Math.max(0, totalCols - gridBefore - gridAfter);
|
|
@@ -1288,35 +1205,18 @@ function convertTableRow(row, styleResolver, context, isHeaderRow, columnWidths,
|
|
|
1288
1205
|
if (shouldSkip) continue;
|
|
1289
1206
|
const isFirstCol = colIndex - colspan === 0;
|
|
1290
1207
|
const isLastCol = colIndex === totalCols;
|
|
1291
|
-
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
else if (cellCnf?.evenVBand) vertBandStyle = conditionalStyles?.band2Vert;
|
|
1304
|
-
let effectiveRowBandStyle = rowBandStyle;
|
|
1305
|
-
if (rowCnf?.oddHBand) effectiveRowBandStyle = conditionalStyles?.band1Horz;
|
|
1306
|
-
else if (rowCnf?.evenHBand) effectiveRowBandStyle = conditionalStyles?.band2Horz;
|
|
1307
|
-
if (cellCnf?.oddHBand) effectiveRowBandStyle = conditionalStyles?.band1Horz;
|
|
1308
|
-
else if (cellCnf?.evenHBand) effectiveRowBandStyle = conditionalStyles?.band2Horz;
|
|
1309
|
-
let cellConditionalStyle = conditionalStyles?.wholeTable;
|
|
1310
|
-
cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, effectiveRowBandStyle);
|
|
1311
|
-
cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, vertBandStyle);
|
|
1312
|
-
if (cellIsFirstCol && (tableLook?.firstColumn || rowCnf?.firstColumn || cellCnf?.firstColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.firstCol);
|
|
1313
|
-
if (cellIsLastCol && (tableLook?.lastColumn || rowCnf?.lastColumn || cellCnf?.lastColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.lastCol);
|
|
1314
|
-
if (cellIsFirstRow && (tableLook?.firstRow || rowCnf?.firstRow || cellCnf?.firstRow)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.firstRow);
|
|
1315
|
-
if (cellIsLastRow && (tableLook?.lastRow || rowCnf?.lastRow || cellCnf?.lastRow)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.lastRow);
|
|
1316
|
-
if (cellIsFirstRow && cellIsFirstCol && (tableLook?.firstRow || rowCnf?.firstRow || cellCnf?.firstRow) && (tableLook?.firstColumn || rowCnf?.firstColumn || cellCnf?.firstColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.nwCell);
|
|
1317
|
-
if (cellIsFirstRow && cellIsLastCol && (tableLook?.firstRow || rowCnf?.firstRow || cellCnf?.firstRow) && (tableLook?.lastColumn || rowCnf?.lastColumn || cellCnf?.lastColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.neCell);
|
|
1318
|
-
if (cellIsLastRow && cellIsFirstCol && (tableLook?.lastRow || rowCnf?.lastRow || cellCnf?.lastRow) && (tableLook?.firstColumn || rowCnf?.firstColumn || cellCnf?.firstColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.swCell);
|
|
1319
|
-
if (cellIsLastRow && cellIsLastCol && (tableLook?.lastRow || rowCnf?.lastRow || cellCnf?.lastRow) && (tableLook?.lastColumn || rowCnf?.lastColumn || cellCnf?.lastColumn)) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.seCell);
|
|
1208
|
+
let cellConditionalStyle;
|
|
1209
|
+
for (const region of tableCellStyleRegions({
|
|
1210
|
+
look: tableLook ?? resolveTableLook(void 0),
|
|
1211
|
+
rowIndex: rowIndex ?? 0,
|
|
1212
|
+
totalRows: totalRows ?? 1,
|
|
1213
|
+
column: colIndex - colspan,
|
|
1214
|
+
colspan,
|
|
1215
|
+
totalColumns: totalCols,
|
|
1216
|
+
rowBand,
|
|
1217
|
+
rowConditionalFormat: rowCnf,
|
|
1218
|
+
cellConditionalFormat: cell.formatting?.conditionalFormat
|
|
1219
|
+
})) cellConditionalStyle = mergeConditionalStyles(cellConditionalStyle, conditionalStyles?.[region]);
|
|
1320
1220
|
cells.push(convertTableCell({
|
|
1321
1221
|
cell,
|
|
1322
1222
|
styleResolver,
|
|
@@ -1394,6 +1294,7 @@ function convertTableCell({ cell, styleResolver, context, isHeader, gridWidthPer
|
|
|
1394
1294
|
if (formatting) attrs._originalFormatting = formatting;
|
|
1395
1295
|
if (cell.propertyChanges && cell.propertyChanges.length > 0) attrs.tcPrChange = [...cell.propertyChanges];
|
|
1396
1296
|
if (cell.contentControls && cell.contentControls.length > 0) attrs.contentControls = cell.contentControls;
|
|
1297
|
+
if (cell.carrierStack?.length) attrs.carrierStack = cell.carrierStack;
|
|
1397
1298
|
const cellStructuralChange = cell.structuralChange;
|
|
1398
1299
|
if (cellStructuralChange) {
|
|
1399
1300
|
const info = {
|
|
@@ -1448,6 +1349,9 @@ function convertTableCell({ cell, styleResolver, context, isHeader, gridWidthPer
|
|
|
1448
1349
|
case "blockSdt":
|
|
1449
1350
|
nodes.push(convertBlockSdt(block, convertCellBlocks));
|
|
1450
1351
|
break;
|
|
1352
|
+
case "blockCustomXml":
|
|
1353
|
+
nodes.push(convertBlockCustomXml(block, convertCellBlocks));
|
|
1354
|
+
break;
|
|
1451
1355
|
case "preservedBlock":
|
|
1452
1356
|
nodes.push(convertPreservedBlock(block));
|
|
1453
1357
|
break;
|
|
@@ -1548,7 +1452,10 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1548
1452
|
const hasConvertedPreservedContent = inlineNodes.some((node) => node.type.name === "preservedXml");
|
|
1549
1453
|
const hasConvertedWrapperContent = inlineNodes.some((node) => node.marks.some((mark) => mark.type.name === INLINE_WRAPPER_MARK_NAME));
|
|
1550
1454
|
const createStructuredField = hasConvertedPageBreakContent || hasConvertedPreservedContent || hasStructuredSourceContent && (hasConvertedHyperlinkContent || hasConvertedWrapperContent);
|
|
1551
|
-
|
|
1455
|
+
const resultRuns = field.type === "simpleField" ? field.content.flatMap((content) => content.type === "run" ? [content] : []) : field.fieldResult;
|
|
1456
|
+
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;
|
|
1457
|
+
const resultPropertyChanges = emptyResultRuns ? emptyFieldRunPropertyChanges(emptyResultRuns) : fieldPropertyChanges;
|
|
1458
|
+
if (!createStructuredField && resultPropertyChanges && resultPropertyChanges.length > 0) marks.push(schema.mark("runPropertyChange", { changes: [...resultPropertyChanges] }));
|
|
1552
1459
|
return schema.node(createStructuredField ? "structuredField" : "field", {
|
|
1553
1460
|
fieldType: field.fieldType,
|
|
1554
1461
|
instruction: field.instruction,
|
|
@@ -1556,7 +1463,13 @@ function convertField(field, { getInheritedRunFormatting, styleResolver, nextHyp
|
|
|
1556
1463
|
fieldKind: field.type === "simpleField" ? "simple" : "complex",
|
|
1557
1464
|
fldLock: field.fldLock ?? null,
|
|
1558
1465
|
dirty: field.dirty ?? null,
|
|
1559
|
-
fieldResultIsFallback: field.type === "complexField" ? field.fieldResultIsFallback ?? null : null
|
|
1466
|
+
fieldResultIsFallback: field.type === "complexField" ? field.fieldResultIsFallback ?? null : null,
|
|
1467
|
+
formFieldDataXml: field.type === "complexField" ? field.formFieldDataXml ?? null : null,
|
|
1468
|
+
_docxEmptyResultRuns: emptyResultRuns ?? null,
|
|
1469
|
+
_docxFieldCode: field.type === "complexField" && field.fieldCode.length > 0 ? {
|
|
1470
|
+
instruction: field.instruction,
|
|
1471
|
+
runs: field.fieldCode
|
|
1472
|
+
} : null
|
|
1560
1473
|
}, createStructuredField ? inlineNodes : void 0, marks);
|
|
1561
1474
|
}
|
|
1562
1475
|
/**
|
|
@@ -2897,6 +2810,9 @@ function headerFooterToProseDoc(content, options) {
|
|
|
2897
2810
|
case "blockSdt":
|
|
2898
2811
|
out.push(convertBlockSdt(block, convertBlocks));
|
|
2899
2812
|
break;
|
|
2813
|
+
case "blockCustomXml":
|
|
2814
|
+
out.push(convertBlockCustomXml(block, convertBlocks));
|
|
2815
|
+
break;
|
|
2900
2816
|
case "preservedBlock":
|
|
2901
2817
|
out.push(convertPreservedBlock(block));
|
|
2902
2818
|
break;
|
|
@@ -2924,4 +2840,4 @@ function createEmptyDoc() {
|
|
|
2924
2840
|
return schema.node("doc", null, [schema.node("paragraph", {}, [])]);
|
|
2925
2841
|
}
|
|
2926
2842
|
//#endregion
|
|
2927
|
-
export { createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc,
|
|
2843
|
+
export { createEmptyDoc, footnoteToProseDoc, headerFooterToProseDoc, standaloneTableCellToProseMirror, tableCellHasMeaningfulContent, toProseDoc };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { MarkType, Schema } from "prosemirror-model";
|
|
2
|
+
//#region src/prosemirror/documentSchema.d.ts
|
|
3
|
+
/** `type`'s counterpart in the schema of `state`. */
|
|
4
|
+
declare const documentMarkType: (state: {
|
|
5
|
+
readonly schema: Schema;
|
|
6
|
+
}, type: MarkType) => MarkType;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { documentMarkType };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { panic } from "better-result";
|
|
2
|
+
//#region src/prosemirror/documentSchema.ts
|
|
3
|
+
/**
|
|
4
|
+
* The document's own mark types.
|
|
5
|
+
*
|
|
6
|
+
* An extension sees the schema its runtime was built with, but the editor it
|
|
7
|
+
* runs in may hold a document of another schema instance with the same specs:
|
|
8
|
+
* header, footer and note editors each build a runtime of their own, while
|
|
9
|
+
* every document is parsed into the shared schema. Marks made from the
|
|
10
|
+
* runtime's types do not belong to such a document, and a runtime type
|
|
11
|
+
* compared against the document's marks never matches. Commands therefore
|
|
12
|
+
* resolve the types they build with, and compare against, through the state
|
|
13
|
+
* they act on.
|
|
14
|
+
*/
|
|
15
|
+
/** `type`'s counterpart in the schema of `state`. */
|
|
16
|
+
const documentMarkType = (state, type) => type.schema === state.schema ? type : state.schema.marks[type.name] ?? panic(`The document schema has no mark ${type.name}`);
|
|
17
|
+
//#endregion
|
|
18
|
+
export { documentMarkType };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
//#region src/prosemirror/emptyFieldResultRuns.d.ts
|
|
3
|
+
/** The single field mark lists every revision held by its invisible result runs. */
|
|
4
|
+
declare const emptyFieldRunPropertyChanges: (runs: readonly document_d_exports.Run[]) => document_d_exports.RunPropertyChange[];
|
|
5
|
+
type ResolveEmptyFieldResultRunsOptions = {
|
|
6
|
+
runs: readonly document_d_exports.Run[];
|
|
7
|
+
mode: "accept" | "reject";
|
|
8
|
+
revisionIds: ReadonlySet<number> | null;
|
|
9
|
+
};
|
|
10
|
+
type ResolvedEmptyFieldResultRuns = {
|
|
11
|
+
runs: document_d_exports.Run[];
|
|
12
|
+
visibleFormatting: document_d_exports.TextFormatting | undefined;
|
|
13
|
+
visibleFormattingChanged: boolean;
|
|
14
|
+
};
|
|
15
|
+
/** Resolve each authored run separately; a field mark carries their combined revisions. */
|
|
16
|
+
declare const resolveEmptyFieldResultRuns: ({ runs, mode, revisionIds }: ResolveEmptyFieldResultRunsOptions) => ResolvedEmptyFieldResultRuns | null;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { emptyFieldRunPropertyChanges, resolveEmptyFieldResultRuns };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { canonicalJson } from "../utils/canonicalJson.js";
|
|
2
|
+
//#region src/prosemirror/emptyFieldResultRuns.ts
|
|
3
|
+
/** The single field mark lists every revision held by its invisible result runs. */
|
|
4
|
+
const emptyFieldRunPropertyChanges = (runs) => runs.flatMap((run) => run.propertyChanges ?? []);
|
|
5
|
+
const visibleFormatting = (runs) => runs.find((run) => run.formatting !== void 0)?.formatting;
|
|
6
|
+
/** Resolve each authored run separately; a field mark carries their combined revisions. */
|
|
7
|
+
const resolveEmptyFieldResultRuns = ({ runs, mode, revisionIds }) => {
|
|
8
|
+
let changed = false;
|
|
9
|
+
const resolved = runs.map((run) => {
|
|
10
|
+
const matches = run.propertyChanges?.filter((change) => revisionIds === null || revisionIds.has(change.info.id));
|
|
11
|
+
if (!matches?.length) return run;
|
|
12
|
+
changed = true;
|
|
13
|
+
const remaining = run.propertyChanges?.filter((change) => revisionIds !== null && !revisionIds.has(change.info.id));
|
|
14
|
+
const formatting = mode === "reject" ? matches.at(0)?.previousFormatting : run.formatting;
|
|
15
|
+
return {
|
|
16
|
+
type: "run",
|
|
17
|
+
content: run.content,
|
|
18
|
+
...formatting !== void 0 ? { formatting } : {},
|
|
19
|
+
...remaining?.length ? { propertyChanges: remaining } : {},
|
|
20
|
+
...run.preservedAttributes ? { preservedAttributes: run.preservedAttributes } : {}
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
if (!changed) return null;
|
|
24
|
+
const before = visibleFormatting(runs);
|
|
25
|
+
const after = visibleFormatting(resolved);
|
|
26
|
+
return {
|
|
27
|
+
runs: resolved,
|
|
28
|
+
visibleFormatting: after,
|
|
29
|
+
visibleFormattingChanged: canonicalJson(before) !== canonicalJson(after)
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { emptyFieldRunPropertyChanges, resolveEmptyFieldResultRuns };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnyExtension, CommandFactory, CommandMap, FolioCommandArguments, FolioCommandName } from "./types.js";
|
|
2
|
-
import { Plugin } from "prosemirror-state";
|
|
3
2
|
import { Schema } from "prosemirror-model";
|
|
3
|
+
import { Plugin } from "prosemirror-state";
|
|
4
4
|
//#region src/prosemirror/extensions/ExtensionManager.d.ts
|
|
5
5
|
declare class ExtensionManager {
|
|
6
6
|
private readonly extensions;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { areTransactionInvariantsEnabled, createTransactionInvariantPlugin } from "../plugins/transactionInvariants.js";
|
|
1
2
|
import { createTextInputPlugin } from "../textInput.js";
|
|
2
3
|
import { panic } from "better-result";
|
|
3
4
|
import { Schema } from "prosemirror-model";
|
|
@@ -50,7 +51,8 @@ var ExtensionManager = class {
|
|
|
50
51
|
this.plugins = [
|
|
51
52
|
createTextInputPlugin(),
|
|
52
53
|
...allPlugins,
|
|
53
|
-
...allKeyboardShortcuts.map((shortcuts) => keymap(shortcuts))
|
|
54
|
+
...allKeyboardShortcuts.map((shortcuts) => keymap(shortcuts)),
|
|
55
|
+
...areTransactionInvariantsEnabled() ? [createTransactionInvariantPlugin()] : []
|
|
54
56
|
];
|
|
55
57
|
this.commands = allCommands;
|
|
56
58
|
}
|
|
@@ -11,6 +11,7 @@ import { EmptyParagraphFormatExtension } from "./features/EmptyParagraphFormatEx
|
|
|
11
11
|
import { GapCursorExtension } from "./features/GapCursorExtension.js";
|
|
12
12
|
import { ImageDragExtension } from "./features/ImageDragExtension.js";
|
|
13
13
|
import { ImagePasteExtension } from "./features/ImagePasteExtension.js";
|
|
14
|
+
import { JoinedRunStyleExtension } from "./features/JoinedRunStyleExtension.js";
|
|
14
15
|
import { ListExtension } from "./features/ListExtension.js";
|
|
15
16
|
import { ParaIdAllocatorExtension } from "./features/ParaIdAllocatorExtension.js";
|
|
16
17
|
import { ParagraphChangeTrackerExtension } from "./features/ParagraphChangeTrackerExtension.js";
|
|
@@ -19,6 +20,7 @@ import { PasteStyleInlinerExtension } from "./features/PasteStyleInlinerExtensio
|
|
|
19
20
|
import { SelectionTrackerExtension } from "./features/SelectionTrackerExtension.js";
|
|
20
21
|
import { MARK_EXTENSIONS, MARK_NESTING_ORDER } from "./markRegistry.js";
|
|
21
22
|
import { BlockBookmarkBoundaryExtension } from "./nodes/BlockBookmarkBoundaryExtension.js";
|
|
23
|
+
import { BlockCustomXmlExtension } from "./nodes/BlockCustomXmlExtension.js";
|
|
22
24
|
import { BlockSdtExtension } from "./nodes/BlockSdtExtension.js";
|
|
23
25
|
import { BookmarkBoundaryExtension } from "./nodes/BookmarkBoundaryExtension.js";
|
|
24
26
|
import { CommentReferenceExtension } from "./nodes/CommentReferenceExtension.js";
|
|
@@ -86,10 +88,11 @@ function createStarterKit(options = {}) {
|
|
|
86
88
|
add("pageBreak", PageBreakExtension());
|
|
87
89
|
add("pageBreakRun", PageBreakRunExtension());
|
|
88
90
|
add("renderedPageBreak", RenderedPageBreakExtension());
|
|
89
|
-
add("field", FieldExtension());
|
|
91
|
+
add("field", FieldExtension({ getInternalClipboardToken }));
|
|
90
92
|
add("field", StructuredFieldExtension({ getInternalClipboardToken }));
|
|
91
93
|
add("sdt", SdtExtension());
|
|
92
94
|
add("blockSdt", BlockSdtExtension());
|
|
95
|
+
add("blockCustomXml", BlockCustomXmlExtension());
|
|
93
96
|
add("preservedBlock", PreservedBlockExtension());
|
|
94
97
|
add("math", MathExtension());
|
|
95
98
|
if (!disabled.has("table")) extensions.push(...createTableExtensions());
|
|
@@ -98,6 +101,7 @@ function createStarterKit(options = {}) {
|
|
|
98
101
|
add("list", ListExtension());
|
|
99
102
|
add("baseKeymap", BaseKeymapExtension());
|
|
100
103
|
add("emptyParagraphFormat", EmptyParagraphFormatExtension());
|
|
104
|
+
add("joinedRunStyle", JoinedRunStyleExtension());
|
|
101
105
|
add("selectionTracker", options.onSelectionChange === void 0 ? SelectionTrackerExtension() : SelectionTrackerExtension({ onSelectionChange: options.onSelectionChange }));
|
|
102
106
|
add("paraIdAllocator", ParaIdAllocatorExtension());
|
|
103
107
|
add("paragraphChangeTracker", ParagraphChangeTrackerExtension());
|
|
@@ -14,7 +14,7 @@ const DocExtension = createNodeExtension({
|
|
|
14
14
|
_adjustLineHeightInTable: { default: false },
|
|
15
15
|
_doNotUseIndentAsNumberingTabStop: { default: false }
|
|
16
16
|
},
|
|
17
|
-
content: "(paragraph | horizontalRule | pageBreak | table | textBox | blockSdt | preservedBlock | blockBookmarkBoundary)+"
|
|
17
|
+
content: "(paragraph | horizontalRule | pageBreak | table | textBox | blockSdt | blockCustomXml | preservedBlock | blockBookmarkBoundary)+"
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
//#endregion
|