@stll/folio-core 0.45.0 → 0.47.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai-edits/apply.js +85 -43
- package/dist/ai-edits/headless.js +2 -2
- package/dist/ai-edits/read.d.ts +1 -0
- package/dist/ai-edits/read.js +1 -0
- package/dist/ai-edits/snapshot.js +32 -27
- package/dist/ai-edits/table-cell-mutations.js +15 -7
- package/dist/ai-edits/table-geometry.js +21 -18
- package/dist/ai-edits/table-template.js +2 -2
- package/dist/compare/compare.js +2 -5
- package/dist/compare/content-alignment.js +108 -12
- package/dist/compare/content-types.d.ts +8 -2
- package/dist/compare/content.js +2 -11
- package/dist/compare/plan.js +7 -4
- package/dist/compare/scenario.js +2 -5
- package/dist/compare/section-boundary-properties.js +1 -2
- package/dist/compare/types.d.ts +9 -1
- package/dist/compare/types.js +12 -1
- package/dist/compat/eigenpal.d.ts +2 -1
- package/dist/compat/eigenpal.js +2 -1
- package/dist/content-controls/checkboxDisplay.d.ts +17 -0
- package/dist/content-controls/checkboxDisplay.js +46 -0
- package/dist/content-controls/findContentControls.js +3 -1
- package/dist/content-controls/mutateContentControls.js +57 -43
- package/dist/controller/contentControlWidgetController.d.ts +1 -0
- package/dist/controller/contentControlWidgetController.js +3 -0
- package/dist/controller/hiddenEditorApi.js +3 -1
- package/dist/controller/hiddenEditorManager.d.ts +1 -1
- package/dist/controller/hiddenEditorManager.js +6 -3
- package/dist/controller/layoutPipeline.js +8 -3
- package/dist/display-list/build/buildDisplayList.js +20 -1
- package/dist/display-list/build/imagePrimitives.d.ts +4 -4
- package/dist/display-list/build/imagePrimitives.js +38 -18
- package/dist/display-list/build/pageBorderPrimitives.js +2 -1
- package/dist/display-list/build/paragraphPrimitives.js +113 -14
- package/dist/display-list/build/previewPrimitives.d.ts +10 -0
- package/dist/display-list/build/previewPrimitives.js +89 -0
- package/dist/display-list/build/strokes.d.ts +177 -8
- package/dist/display-list/build/strokes.js +167 -47
- package/dist/display-list/build/tablePrimitives.js +4 -2
- package/dist/display-list/build/textBoxPrimitives.js +6 -4
- package/dist/display-list/build/textDecorations.d.ts +15 -1
- package/dist/display-list/build/textDecorations.js +15 -1
- package/dist/display-list/dom/renderDisplayListToDom.js +11 -21
- package/dist/display-list/primitives.d.ts +13 -2
- package/dist/display-list/primitives.js +36 -1
- package/dist/display-list/types.d.ts +17 -0
- package/dist/document-operations.js +2 -1
- package/dist/docx/attributeRemainder.d.ts +76 -0
- package/dist/docx/attributeRemainder.js +111 -0
- package/dist/docx/blockContentParser.d.ts +3 -1
- package/dist/docx/blockContentParser.js +102 -106
- package/dist/docx/blockPlainText.d.ts +3 -4
- package/dist/docx/blockPlainText.js +3 -0
- package/dist/docx/borderParser.js +26 -11
- package/dist/docx/builtInStyles.d.ts +8 -16
- package/dist/docx/builtInStyles.js +54 -17
- package/dist/docx/commentAnchorIndex.d.ts +30 -0
- package/dist/docx/commentAnchorIndex.js +50 -0
- package/dist/docx/commentParser.d.ts +1 -1
- package/dist/docx/commentParser.js +56 -39
- package/dist/docx/commentRangeIntegrity.d.ts +16 -1
- package/dist/docx/commentRangeIntegrity.js +42 -1
- package/dist/docx/commentRangeJoin.d.ts +9 -0
- package/dist/docx/commentRangeJoin.js +33 -0
- package/dist/docx/commentReferenceCompletion.d.ts +9 -0
- package/dist/docx/commentReferenceCompletion.js +47 -0
- package/dist/docx/commentReferenceNormalization.js +3 -1
- package/dist/docx/commentReplyMarkers.js +11 -19
- package/dist/docx/compatibility.js +56 -41
- package/dist/docx/containerChildren.d.ts +208 -0
- package/dist/docx/containerChildren.gen.d.ts +43 -0
- package/dist/docx/containerChildren.gen.js +263 -0
- package/dist/docx/containerChildren.js +153 -0
- package/dist/docx/diagramPreview.d.ts +14 -2
- package/dist/docx/diagramPreview.js +81 -169
- package/dist/docx/documentParser.d.ts +1 -1
- package/dist/docx/documentParser.js +7 -4
- package/dist/docx/drawingAnchor.d.ts +87 -0
- package/dist/docx/drawingAnchor.js +201 -0
- package/dist/docx/drawingUtils.d.ts +43 -38
- package/dist/docx/drawingUtils.js +205 -118
- package/dist/docx/ensureParaIds.js +17 -7
- package/dist/docx/fieldParser.d.ts +1 -1
- package/dist/docx/fieldParser.js +4 -4
- package/dist/docx/fieldState.d.ts +26 -0
- package/dist/docx/fieldState.js +53 -0
- package/dist/docx/fontTableParser.js +102 -41
- package/dist/docx/footnoteParser.d.ts +1 -1
- package/dist/docx/footnoteParser.js +10 -6
- package/dist/docx/graphicFrameLocks.d.ts +16 -4
- package/dist/docx/graphicFrameLocks.js +19 -6
- package/dist/docx/groupDrawingParser.js +4 -3
- package/dist/docx/headerFooterParser.js +1 -1
- package/dist/docx/headerFooterReferenceNormalization.js +1 -0
- package/dist/docx/hyperlinkParser.d.ts +66 -9
- package/dist/docx/hyperlinkParser.js +153 -26
- package/dist/docx/imageParser.js +160 -115
- package/dist/docx/index.d.ts +2 -1
- package/dist/docx/index.js +2 -1
- package/dist/docx/inlineContentRemovals.d.ts +28 -0
- package/dist/docx/inlineContentRemovals.js +46 -0
- package/dist/docx/inlineWrapperContent.d.ts +166 -0
- package/dist/docx/inlineWrapperContent.js +165 -0
- package/dist/docx/inlineWrapperParser.d.ts +11 -0
- package/dist/docx/inlineWrapperParser.js +60 -0
- package/dist/docx/nonVisualDrawingProps.d.ts +5 -13
- package/dist/docx/normalizeBaseDirection.js +12 -1
- package/dist/docx/numberingParser.d.ts +25 -2
- package/dist/docx/numberingParser.js +264 -361
- package/dist/docx/numberingReference.d.ts +9 -16
- package/dist/docx/numberingReference.js +17 -16
- package/dist/docx/numberingReferenceNormalization.js +7 -7
- package/dist/docx/ooxmlCounterFormatter.d.ts +1 -1
- package/dist/docx/ooxmlCounterFormatter.js +4 -1
- package/dist/docx/paraIdAttribute.d.ts +111 -0
- package/dist/docx/paraIdAttribute.js +142 -0
- package/dist/docx/paragraphParser.d.ts +10 -25
- package/dist/docx/paragraphParser.js +421 -496
- package/dist/docx/paragraphProperties.d.ts +23 -0
- package/dist/docx/paragraphProperties.js +279 -0
- package/dist/docx/paragraphPropertySource.js +7 -1
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +3 -2
- package/dist/docx/paragraphTextBoxEnrichment.js +20 -59
- package/dist/docx/paragraphTraversal.d.ts +14 -10
- package/dist/docx/paragraphTraversal.js +53 -52
- package/dist/docx/parseWarningMessage.js +5 -1
- package/dist/docx/parserEnums.d.ts +6 -8
- package/dist/docx/parserEnums.js +4 -6
- package/dist/docx/preservedRunContent.d.ts +32 -0
- package/dist/docx/preservedRunContent.js +96 -0
- package/dist/docx/previewBudget.d.ts +44 -23
- package/dist/docx/previewBudget.js +61 -30
- package/dist/docx/propertyElementAttributes.d.ts +178 -0
- package/dist/docx/propertyElementAttributes.js +114 -0
- package/dist/docx/renderedPageBreakNormalization.js +4 -6
- package/dist/docx/rezip.d.ts +28 -2
- package/dist/docx/rezip.js +152 -27
- package/dist/docx/runConsolidator.d.ts +42 -2
- package/dist/docx/runConsolidator.js +60 -6
- package/dist/docx/runParser.d.ts +55 -19
- package/dist/docx/runParser.js +394 -306
- package/dist/docx/runPayload.d.ts +5 -0
- package/dist/docx/runPayload.js +4 -0
- package/dist/docx/sdtProperties.d.ts +39 -5
- package/dist/docx/sdtProperties.js +205 -84
- package/dist/docx/sdtPropertiesPatch.d.ts +5 -9
- package/dist/docx/sdtPropertiesPatch.js +68 -112
- package/dist/docx/sectionParser.d.ts +1 -2
- package/dist/docx/sectionParser.js +241 -238
- package/dist/docx/selectiveSave.js +3 -2
- package/dist/docx/selectiveXmlPatch.d.ts +66 -3
- package/dist/docx/selectiveXmlPatch.js +276 -133
- package/dist/docx/serializer/blockSdtSerializer.js +2 -96
- package/dist/docx/serializer/borderSerializer.d.ts +5 -5
- package/dist/docx/serializer/borderSerializer.js +12 -10
- package/dist/docx/serializer/commentSerializer.js +5 -7
- package/dist/docx/serializer/documentSerializer.js +11 -11
- package/dist/docx/serializer/fontTableSerializer.js +31 -3
- package/dist/docx/serializer/headerFooterSerializer.js +10 -9
- package/dist/docx/serializer/markupRangeAttributes.d.ts +9 -1
- package/dist/docx/serializer/markupRangeAttributes.js +9 -1
- package/dist/docx/serializer/noteSerializer.js +11 -8
- package/dist/docx/serializer/numberingSerializer.d.ts +1 -6
- package/dist/docx/serializer/numberingSerializer.js +81 -79
- package/dist/docx/serializer/paragraphSerializer.d.ts +1 -9
- package/dist/docx/serializer/paragraphSerializer.js +156 -236
- package/dist/docx/serializer/runSerializer.d.ts +1 -5
- package/dist/docx/serializer/runSerializer.js +134 -75
- package/dist/docx/serializer/sdtPropertiesSerializer.d.ts +26 -0
- package/dist/docx/serializer/sdtPropertiesSerializer.js +111 -0
- package/dist/docx/serializer/sectionPropertiesSerializer.js +42 -49
- package/dist/docx/serializer/settingsSerializer.js +6 -4
- package/dist/docx/serializer/stylesSerializer.js +8 -11
- package/dist/docx/serializer/tableSerializer.js +283 -105
- package/dist/docx/serializer/textFormattingSerializer.d.ts +28 -4
- package/dist/docx/serializer/textFormattingSerializer.js +111 -101
- package/dist/docx/serializer/xmlUtils.d.ts +1 -1
- package/dist/docx/serializer/xmlUtils.js +1 -1
- package/dist/docx/server/createBilingualDocument.js +20 -16
- package/dist/docx/server/materializeYjsDocx.d.ts +1 -1
- package/dist/docx/server/materializeYjsDocx.js +9 -1
- package/dist/docx/server/migrateYjsAttrSchema.d.ts +55 -0
- package/dist/docx/server/migrateYjsAttrSchema.js +95 -0
- package/dist/docx/settingsParser.js +7 -4
- package/dist/docx/shadingParser.d.ts +2 -1
- package/dist/docx/shadingParser.js +43 -7
- package/dist/docx/shapeParser.js +13 -8
- package/dist/docx/strictNames.d.ts +11 -0
- package/dist/docx/strictNames.gen.d.ts +45 -0
- package/dist/docx/strictNames.gen.js +50 -0
- package/dist/docx/strictNames.js +43 -0
- package/dist/docx/strictValueEncodings.gen.js +133 -131
- package/dist/docx/styleParser.js +17 -349
- package/dist/docx/tableParser.d.ts +11 -2
- package/dist/docx/tableParser.js +665 -220
- package/dist/docx/textBoxParser.d.ts +28 -3
- package/dist/docx/textBoxParser.js +69 -9
- package/dist/docx/themeColorAttribute.d.ts +13 -0
- package/dist/docx/themeColorAttribute.js +24 -0
- package/dist/docx/trackedMoveRangeNormalization.js +2 -1
- package/dist/docx/unzip.js +5 -4
- package/dist/docx/vmlImageParser.d.ts +30 -5
- package/dist/docx/vmlImageParser.js +91 -32
- package/dist/docx/vmlPreview.js +2 -2
- package/dist/docx/wrapPolygon.d.ts +30 -0
- package/dist/docx/wrapPolygon.js +70 -0
- package/dist/docx/xmlEncoding.d.ts +5 -0
- package/dist/docx/xmlEncoding.js +12 -0
- package/dist/docx/xmlParser.d.ts +23 -1
- package/dist/docx/xmlParser.js +31 -2
- package/dist/fonts/embeddedFonts.js +3 -3
- package/dist/headless-layout.js +12 -1
- package/dist/i18n/messages/catalogs.gen.d.ts +68 -0
- package/dist/i18n/messages/catalogs.gen.js +102 -34
- package/dist/i18n/messages/messages.gen.d.ts +4 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/internal/headlessRevisionResolution.js +9 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +7 -2
- package/dist/internal/paragraphFormattingSerialization.d.ts +20 -9
- package/dist/internal/paragraphFormattingSerialization.js +118 -83
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +1 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +2 -0
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +17 -12
- package/dist/layout-bridge/convert/toFlowBlocks.js +267 -101
- package/dist/layout-engine/index.d.ts +2 -2
- package/dist/layout-engine/index.js +53 -17
- package/dist/layout-engine/measure/measureBlocks.d.ts +3 -0
- package/dist/layout-engine/measure/measureBlocks.js +6 -10
- package/dist/layout-engine/measure/tableCellFloating.d.ts +2 -0
- package/dist/layout-engine/measure/tableCellFloating.js +2 -0
- package/dist/layout-engine/measure/tableCellGrid.js +2 -1
- package/dist/layout-engine/measure/tableFragmentBorderGeometry.js +2 -1
- package/dist/layout-engine/measure/tableInlinePlacement.js +2 -5
- package/dist/layout-engine/paragraphSequence.js +3 -2
- package/dist/layout-engine/renderedBreakReconciliation.js +2 -1
- package/dist/layout-engine/section-breaks.d.ts +49 -2
- package/dist/layout-engine/section-breaks.js +55 -4
- package/dist/layout-engine/types.d.ts +69 -17
- package/dist/layout-engine/types.js +16 -1
- package/dist/layout-painter/borderStroke.d.ts +18 -4
- package/dist/layout-painter/renderImage.d.ts +5 -1
- package/dist/layout-painter/renderImage.js +10 -3
- package/dist/layout-painter/renderPage.d.ts +2 -0
- package/dist/layout-painter/renderPage.js +10 -4
- package/dist/layout-painter/renderParagraph.d.ts +14 -1
- package/dist/layout-painter/renderParagraph.js +34 -28
- package/dist/layout-painter/renderTable.d.ts +4 -1
- package/dist/layout-painter/renderTable.js +22 -22
- package/dist/layout-painter/renderTextBox.js +5 -3
- package/dist/managers/autoSaveCodec.d.ts +9 -1
- package/dist/managers/autoSaveCodec.js +12 -4
- package/dist/markdown/renderBlock.js +3 -0
- package/dist/markdown/renderRuns.d.ts +1 -1
- package/dist/markdown/renderRuns.js +34 -6
- package/dist/markdown/renderTable.js +24 -6
- package/dist/markdown/trailers.js +4 -1
- package/dist/model.d.ts +3 -3
- package/dist/model.js +2 -2
- package/dist/paged-layout/sectionBlockWidths.d.ts +3 -0
- package/dist/paged-layout/sectionBlockWidths.js +26 -4
- package/dist/pdf/images.js +142 -6
- package/dist/prosemirror/attrs/index.d.ts +34 -5
- package/dist/prosemirror/attrs/index.js +639 -48
- package/dist/prosemirror/authoredTransformAttrs.d.ts +28 -0
- package/dist/prosemirror/authoredTransformAttrs.js +64 -0
- package/dist/prosemirror/bookmarkBoundaryAttrs.d.ts +9 -1
- package/dist/prosemirror/bookmarkBoundaryAttrs.js +22 -3
- package/dist/prosemirror/commands/comments.js +68 -53
- package/dist/prosemirror/commands/contentControls.js +33 -20
- package/dist/prosemirror/commands/image.d.ts +10 -3
- package/dist/prosemirror/commands/image.js +46 -29
- package/dist/prosemirror/commands/pageBreak.js +1 -1
- package/dist/prosemirror/commands/paragraph.d.ts +2 -1
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +12 -4
- package/dist/prosemirror/commands/propertyChangeScope.js +22 -4
- package/dist/prosemirror/commands/sectionBreak.d.ts +33 -1
- package/dist/prosemirror/commands/sectionBreak.js +187 -11
- package/dist/prosemirror/commentReferenceAttrs.d.ts +8 -0
- package/dist/prosemirror/commentReferenceAttrs.js +33 -0
- package/dist/prosemirror/commentReferenceIntegrity.d.ts +47 -0
- package/dist/prosemirror/commentReferenceIntegrity.js +43 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +17 -12
- package/dist/prosemirror/conversion/fromProseDoc.js +553 -207
- package/dist/prosemirror/conversion/index.d.ts +2 -2
- package/dist/prosemirror/conversion/preservedSinkCarriers.d.ts +39 -0
- package/dist/prosemirror/conversion/preservedSinkCarriers.js +19 -0
- package/dist/prosemirror/conversion/runShadingMark.js +14 -1
- package/dist/prosemirror/conversion/sdtAttrs.d.ts +10 -1
- package/dist/prosemirror/conversion/sdtAttrs.js +19 -5
- package/dist/prosemirror/conversion/toProseDoc.d.ts +7 -9
- package/dist/prosemirror/conversion/toProseDoc.js +801 -411
- package/dist/prosemirror/emptyRangeAnchor.d.ts +53 -0
- package/dist/prosemirror/emptyRangeAnchor.js +158 -0
- package/dist/prosemirror/extensions/StarterKit.js +14 -58
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +21 -16
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +48 -29
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +3 -1
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +5 -3
- package/dist/prosemirror/extensions/features/ListExtension.js +43 -24
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +1 -0
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +4 -3
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +3 -3
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +5 -5
- package/dist/prosemirror/extensions/features/pasteCleanup.d.ts +3 -1
- package/dist/prosemirror/extensions/features/pasteCleanup.js +56 -2
- package/dist/prosemirror/extensions/features/pastedHeadingStyles.js +5 -4
- package/dist/prosemirror/extensions/markRegistry.d.ts +65 -0
- package/dist/prosemirror/extensions/markRegistry.js +138 -0
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.d.ts +18 -0
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.js +77 -0
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.d.ts +26 -0
- package/dist/prosemirror/extensions/marks/RunIdentityExtension.js +134 -0
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +2 -1
- package/dist/prosemirror/extensions/marks/UnderlineExtension.js +12 -18
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +2 -1
- package/dist/prosemirror/extensions/marks/markUtils.js +49 -5
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.d.ts +29 -0
- package/dist/prosemirror/extensions/nodes/BlockBookmarkBoundaryExtension.js +46 -0
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +4 -3
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.js +18 -13
- package/dist/prosemirror/extensions/nodes/BookmarkBoundaryExtension.js +28 -53
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/nodes/CommentReferenceExtension.js +97 -0
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +9 -7
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +24 -1
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/nodes/MoveRangeBoundaryExtension.js +43 -0
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.d.ts +32 -0
- package/dist/prosemirror/extensions/nodes/PreservedBlockExtension.js +67 -0
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.d.ts +16 -0
- package/dist/prosemirror/extensions/nodes/PreservedXmlExtension.js +60 -0
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.d.ts +13 -0
- package/dist/prosemirror/extensions/nodes/RangeAnchorExtension.js +65 -0
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +3 -1
- package/dist/prosemirror/extensions/nodes/SdtExtension.js +22 -16
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +7 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +142 -123
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +9 -1
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.d.ts +23 -0
- package/dist/prosemirror/extensions/nodes/bookmarkBoundaryDom.js +57 -0
- package/dist/prosemirror/extensions/types.d.ts +12 -3
- package/dist/prosemirror/index.d.ts +4 -2
- package/dist/prosemirror/index.js +2 -1
- package/dist/prosemirror/inlineWrapperStack.d.ts +39 -0
- package/dist/prosemirror/inlineWrapperStack.js +92 -0
- package/dist/prosemirror/listMarker.d.ts +2 -2
- package/dist/prosemirror/listMarker.js +7 -8
- package/dist/prosemirror/listRenderingAttrs.js +11 -1
- package/dist/prosemirror/listState.d.ts +62 -0
- package/dist/prosemirror/listState.js +49 -0
- package/dist/prosemirror/moveRangeBoundaryAttrs.d.ts +13 -0
- package/dist/prosemirror/moveRangeBoundaryAttrs.js +114 -0
- package/dist/prosemirror/numberedRefFields.js +4 -4
- package/dist/prosemirror/numberingAttr.d.ts +55 -0
- package/dist/prosemirror/numberingAttr.js +74 -0
- package/dist/prosemirror/outlineLevelAttr.d.ts +29 -0
- package/dist/prosemirror/outlineLevelAttr.js +42 -0
- package/dist/prosemirror/pageBreakRunProjection.d.ts +17 -7
- package/dist/prosemirror/pageBreakRunProjection.js +19 -9
- package/dist/prosemirror/paragraphFormattingProvenance.d.ts +9 -0
- package/dist/prosemirror/paragraphFormattingProvenance.js +4 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +3 -6
- package/dist/prosemirror/plugins/selectionTracker.js +3 -10
- package/dist/prosemirror/rangeAnchorAttrs.d.ts +14 -0
- package/dist/prosemirror/rangeAnchorAttrs.js +101 -0
- package/dist/prosemirror/replacedAnnotations.d.ts +59 -0
- package/dist/prosemirror/replacedAnnotations.js +183 -0
- package/dist/prosemirror/revisionCarriers.d.ts +86 -2
- package/dist/prosemirror/revisionCarriers.js +86 -60
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +5 -1
- package/dist/prosemirror/runFormattingInlineCarriers.js +7 -1
- package/dist/prosemirror/runIdentity.d.ts +28 -0
- package/dist/prosemirror/runIdentity.js +36 -0
- package/dist/prosemirror/runStyleFormatting.js +1 -1
- package/dist/prosemirror/schema/index.d.ts +3 -3
- package/dist/prosemirror/schema/marks.d.ts +47 -4
- package/dist/prosemirror/schema/nodes.d.ts +309 -26
- package/dist/prosemirror/schema/nodes.js +16 -1
- package/dist/prosemirror/sectionCarrier.d.ts +37 -0
- package/dist/prosemirror/sectionCarrier.js +40 -0
- package/dist/prosemirror/selectionState.d.ts +3 -0
- package/dist/prosemirror/selectionState.js +4 -1
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +5 -4
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +15 -13
- package/dist/prosemirror/tableResize.js +5 -6
- package/dist/prosemirror/trackedRunInlineAtoms.d.ts +4 -0
- package/dist/prosemirror/trackedRunInlineAtoms.js +4 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +10 -11
- package/dist/prosemirror/utils/extractTrackedChanges.js +109 -92
- package/dist/prosemirror/validation.js +31 -6
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +73 -0
- package/dist/prosemirror/yjsDocumentMetadata.js +592 -0
- package/dist/prosemirror/zeroWidthAnchors.js +6 -0
- package/dist/render-dom/commentAnchorAttributes.d.ts +37 -0
- package/dist/render-dom/commentAnchorAttributes.js +54 -0
- package/dist/server.d.ts +3 -1
- package/dist/server.js +3 -1
- package/dist/style-sets/extract.js +4 -4
- package/dist/style-sets/stellaStyle.js +36 -23
- package/dist/types/colors.d.ts +2 -2
- package/dist/types/content.d.ts +2 -2
- package/dist/types/documentEnumValues.d.ts +53 -26
- package/dist/types/documentEnumValues.js +72 -174
- package/dist/types/formatting.d.ts +2 -2
- package/dist/types/index.d.ts +9 -2
- package/dist/utils/borderCss.d.ts +246 -0
- package/dist/utils/borderCss.js +325 -0
- package/dist/utils/clipboard.d.ts +9 -1
- package/dist/utils/clipboard.js +27 -1
- package/dist/utils/colorResolver.d.ts +4 -3
- package/dist/utils/colorResolver.js +45 -76
- package/dist/utils/createDocument.js +24 -6
- package/dist/utils/findReplace.js +52 -10
- package/dist/utils/formatToStyle.d.ts +84 -2
- package/dist/utils/formatToStyle.js +133 -52
- package/dist/utils/headingCollector.js +3 -2
- package/dist/utils/imageLuminance.d.ts +15 -0
- package/dist/utils/imageLuminance.js +32 -0
- package/dist/utils/mergeDocumentContent.js +12 -20
- package/dist/utils/paragraphFormattingMerge.js +27 -6
- package/dist/utils/replaceText.js +1 -0
- package/dist/utils/tableOperations.d.ts +5 -3
- package/dist/utils/tableOperations.js +14 -1
- package/dist/utils/tablePlacement.d.ts +7 -0
- package/dist/utils/tablePlacement.js +14 -0
- package/dist/utils/textDirectionFlow.d.ts +15 -0
- package/dist/utils/textDirectionFlow.js +38 -0
- package/dist/utils/textFormattingMerge.js +16 -4
- package/package.json +10 -10
- package/dist/ai-edits/__fixtures__/paragraphs.d.ts +0 -17
- package/dist/ai-edits/__fixtures__/paragraphs.js +0 -33
- package/dist/compare/__fixtures__/body-sequence.d.ts +0 -119
- package/dist/compare/__fixtures__/body-sequence.js +0 -225
- package/dist/compare/__fixtures__/nested-table.d.ts +0 -16
- package/dist/compare/__fixtures__/nested-table.js +0 -50
- package/dist/compare/__fixtures__/numbered-list.d.ts +0 -34
- package/dist/compare/__fixtures__/numbered-list.js +0 -85
- package/dist/docx/blockRangeMarkers.d.ts +0 -36
- package/dist/docx/blockRangeMarkers.js +0 -59
- package/dist/docx/bookmarkPlacement.d.ts +0 -9
- package/dist/docx/bookmarkPlacement.js +0 -50
- package/dist/fonts/embeddedFontTable.d.ts +0 -45
- package/dist/fonts/embeddedFontTable.js +0 -80
- package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.d.ts +0 -13
- package/dist/prosemirror/extensions/marks/PageBreakRunOwnerExtension.js +0 -39
- package/dist/prosemirror/yjsParagraphSourceContract.d.ts +0 -9
- package/dist/prosemirror/yjsParagraphSourceContract.js +0 -26
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isBulletLevel } from "../../../docx/numberingParser.js";
|
|
2
|
+
import { NO_PARAGRAPH_NUMBERING, paragraphNumberingLevel, paragraphNumberingReference, paragraphNumberingReferenceId } from "../../../docx/numberingReference.js";
|
|
2
3
|
import { expectParagraphAttrs } from "../../attrs/index.js";
|
|
3
4
|
import { PPR_CHANGE_SCOPED_ATTR_KEYS, hasSerializableParagraphPropertyChange } from "../../commands/propertyChangeScope.js";
|
|
4
5
|
import { CLEARED_LIST_RENDERING_ATTRS } from "../../listMarker.js";
|
|
5
6
|
import { LIST_RENDERING_ATTR_KEYS } from "../../listRenderingAttrs.js";
|
|
7
|
+
import { resolveListState } from "../../listState.js";
|
|
8
|
+
import { paragraphNumberingAttr } from "../../numberingAttr.js";
|
|
6
9
|
import { getDocumentNumbering } from "../../plugins/documentNumbering.js";
|
|
7
10
|
import { SUGGESTION_META, makeRevisionInfo } from "../../plugins/suggestionMode.js";
|
|
8
11
|
import { listLevelAttrPatch } from "../../styles/resolvedStyleAttrs.js";
|
|
@@ -49,11 +52,7 @@ function getPreviousListFormatting(attrs) {
|
|
|
49
52
|
return previousFormatting;
|
|
50
53
|
}
|
|
51
54
|
function clearListAttrs(attrs) {
|
|
52
|
-
const
|
|
53
|
-
const numPr = isNumberingReference(styleNumPr?.numId) ? {
|
|
54
|
-
numId: 0,
|
|
55
|
-
ilvl: attrs.numPr?.ilvl ?? styleNumPr?.ilvl ?? 0
|
|
56
|
-
} : null;
|
|
55
|
+
const numPr = paragraphNumberingReferenceId(attrs.numPrFromStyle) === void 0 ? null : paragraphNumberingAttr(NO_PARAGRAPH_NUMBERING);
|
|
57
56
|
return {
|
|
58
57
|
...attrs,
|
|
59
58
|
numPr,
|
|
@@ -61,14 +60,31 @@ function clearListAttrs(attrs) {
|
|
|
61
60
|
};
|
|
62
61
|
}
|
|
63
62
|
function hasActiveListNumbering(attrs) {
|
|
64
|
-
return
|
|
63
|
+
return attrs.numPr?.kind === "reference";
|
|
65
64
|
}
|
|
66
|
-
|
|
65
|
+
/**
|
|
66
|
+
* The numbering instances Folio mints for its own toolbar lists. They are the
|
|
67
|
+
* ids the autoformat rules and the list buttons create; a document Folio did
|
|
68
|
+
* not create numbers its lists however its author did, which is why nothing
|
|
69
|
+
* reads a list's kind off its id any more.
|
|
70
|
+
*/
|
|
71
|
+
const FOLIO_BULLET_NUM_ID = 1;
|
|
72
|
+
const FOLIO_NUMBERED_NUM_ID = 2;
|
|
73
|
+
const targetNumIdForIntent = (numbering, preferredNumId, ilvl, intent) => {
|
|
74
|
+
const matchesIntent = (numId) => {
|
|
75
|
+
const level = numbering?.getLevel(numId, ilvl) ?? null;
|
|
76
|
+
return level !== null && (isBulletLevel(level) ? "bullet" : "numbered") === intent;
|
|
77
|
+
};
|
|
78
|
+
if (matchesIntent(preferredNumId)) return preferredNumId;
|
|
79
|
+
return numbering?.definitions.nums.find(({ numId }) => matchesIntent(numId))?.numId ?? preferredNumId;
|
|
80
|
+
};
|
|
81
|
+
function toggleList(numId, intent) {
|
|
67
82
|
return (state, dispatch) => {
|
|
68
83
|
const { $from, $to } = state.selection;
|
|
69
84
|
const paragraph = $from.parent;
|
|
70
85
|
if (paragraph.type.name !== "paragraph") return false;
|
|
71
|
-
const
|
|
86
|
+
const numbering = getDocumentNumbering(state);
|
|
87
|
+
const isInSameList = resolveListState(numbering, expectParagraphAttrs(paragraph).numPr).type === intent;
|
|
72
88
|
const rev = makeRevisionInfo(state);
|
|
73
89
|
if (rev) {
|
|
74
90
|
let hasPendingChange = false;
|
|
@@ -89,16 +105,19 @@ function toggleList(numId) {
|
|
|
89
105
|
let nextAttrs;
|
|
90
106
|
if (isInSameList) nextAttrs = clearListAttrs(expectParagraphAttrs(node));
|
|
91
107
|
else {
|
|
92
|
-
const
|
|
108
|
+
const ilvl = paragraphNumberingLevel(expectParagraphAttrs(node).numPr) ?? 0;
|
|
109
|
+
const targetNumId = targetNumIdForIntent(numbering, numId, ilvl, intent);
|
|
110
|
+
const definition = numbering?.getLevel(targetNumId, ilvl) ?? null;
|
|
111
|
+
const isBullet = definition === null ? intent === "bullet" : isBulletLevel(definition);
|
|
93
112
|
nextAttrs = {
|
|
94
113
|
...node.attrs,
|
|
95
114
|
...CLEARED_LIST_RENDERING_ATTRS,
|
|
96
|
-
numPr: {
|
|
97
|
-
numId,
|
|
98
|
-
ilvl
|
|
99
|
-
},
|
|
115
|
+
numPr: paragraphNumberingAttr(paragraphNumberingReference({
|
|
116
|
+
numId: targetNumId,
|
|
117
|
+
ilvl
|
|
118
|
+
})),
|
|
100
119
|
listIsBullet: isBullet,
|
|
101
|
-
listNumFmt: isBullet ? null : "decimal"
|
|
120
|
+
listNumFmt: isBullet ? null : definition?.numFmt ?? "decimal"
|
|
102
121
|
};
|
|
103
122
|
}
|
|
104
123
|
if (rev) {
|
|
@@ -113,8 +132,8 @@ function toggleList(numId) {
|
|
|
113
132
|
return true;
|
|
114
133
|
};
|
|
115
134
|
}
|
|
116
|
-
const toggleBulletList = (state, dispatch) => toggleList(
|
|
117
|
-
const toggleNumberedList = (state, dispatch) => toggleList(
|
|
135
|
+
const toggleBulletList = (state, dispatch) => toggleList(FOLIO_BULLET_NUM_ID, "bullet")(state, dispatch);
|
|
136
|
+
const toggleNumberedList = (state, dispatch) => toggleList(FOLIO_NUMBERED_NUM_ID, "numbered")(state, dispatch);
|
|
118
137
|
const attrsForListLevel = (state, attrs, level) => {
|
|
119
138
|
if (!hasActiveListNumbering(attrs)) panic("Cannot change the level of a list without a numbering id");
|
|
120
139
|
return {
|
|
@@ -131,7 +150,7 @@ const increaseListLevel = (state, dispatch) => {
|
|
|
131
150
|
if (paragraph.type.name !== "paragraph") return false;
|
|
132
151
|
const attrs = expectParagraphAttrs(paragraph);
|
|
133
152
|
if (!hasActiveListNumbering(attrs)) return false;
|
|
134
|
-
const currentLevel = attrs.numPr.ilvl
|
|
153
|
+
const currentLevel = attrs.numPr.ilvl ?? 0;
|
|
135
154
|
if (currentLevel >= 8) return false;
|
|
136
155
|
if (!dispatch) return true;
|
|
137
156
|
const paragraphPos = $from.before($from.depth);
|
|
@@ -144,7 +163,7 @@ const decreaseListLevel = (state, dispatch) => {
|
|
|
144
163
|
if (paragraph.type.name !== "paragraph") return false;
|
|
145
164
|
const attrs = expectParagraphAttrs(paragraph);
|
|
146
165
|
if (!hasActiveListNumbering(attrs)) return false;
|
|
147
|
-
const currentLevel = attrs.numPr.ilvl
|
|
166
|
+
const currentLevel = attrs.numPr.ilvl ?? 0;
|
|
148
167
|
if (!dispatch) return true;
|
|
149
168
|
const paragraphPos = $from.before($from.depth);
|
|
150
169
|
if (currentLevel <= 0) dispatch(state.tr.setNodeMarkup(paragraphPos, void 0, {
|
|
@@ -184,7 +203,7 @@ function getListInfo(state) {
|
|
|
184
203
|
if (!hasActiveListNumbering(attrs)) return null;
|
|
185
204
|
return {
|
|
186
205
|
numId: attrs.numPr.numId,
|
|
187
|
-
ilvl: attrs.numPr.ilvl
|
|
206
|
+
ilvl: attrs.numPr.ilvl ?? 0
|
|
188
207
|
};
|
|
189
208
|
}
|
|
190
209
|
function exitListOnEmptyEnter() {
|
|
@@ -240,7 +259,7 @@ function increaseListIndent() {
|
|
|
240
259
|
if (node.type.name === "paragraph") {
|
|
241
260
|
const attrs = expectParagraphAttrs(node);
|
|
242
261
|
if (!hasActiveListNumbering(attrs)) return;
|
|
243
|
-
if ((attrs.numPr
|
|
262
|
+
if ((attrs.numPr.ilvl ?? 0) < 8) positions.push({
|
|
244
263
|
pos,
|
|
245
264
|
attrs
|
|
246
265
|
});
|
|
@@ -249,7 +268,7 @@ function increaseListIndent() {
|
|
|
249
268
|
if (positions.length === 0) return false;
|
|
250
269
|
if (dispatch) {
|
|
251
270
|
let tr = state.tr;
|
|
252
|
-
for (const { pos, attrs } of positions) tr = tr.setNodeMarkup(pos, void 0, attrsForListLevel(state, attrs, (attrs.numPr
|
|
271
|
+
for (const { pos, attrs } of positions) tr = tr.setNodeMarkup(pos, void 0, attrsForListLevel(state, attrs, (attrs.numPr.ilvl ?? 0) + 1));
|
|
253
272
|
dispatch(tr);
|
|
254
273
|
}
|
|
255
274
|
return true;
|
|
@@ -272,7 +291,7 @@ function decreaseListIndent() {
|
|
|
272
291
|
if (dispatch) {
|
|
273
292
|
let tr = state.tr;
|
|
274
293
|
for (const { pos, attrs } of positions) {
|
|
275
|
-
const currentLevel = attrs.numPr
|
|
294
|
+
const currentLevel = attrs.numPr.ilvl ?? 0;
|
|
276
295
|
if (currentLevel <= 0) tr = tr.setNodeMarkup(pos, void 0, {
|
|
277
296
|
...clearListAttrs(attrs),
|
|
278
297
|
indentLeft: null,
|
|
@@ -318,7 +337,7 @@ const listAutoformat = (marker, toggleCommand) => new InputRule(marker, (state,
|
|
|
318
337
|
const { $from } = state.selection;
|
|
319
338
|
if ($from.parent.type.name !== "paragraph") return null;
|
|
320
339
|
if (start !== $from.start()) return null;
|
|
321
|
-
if (expectParagraphAttrs($from.parent).numPr
|
|
340
|
+
if (paragraphNumberingReferenceId(expectParagraphAttrs($from.parent).numPr) !== void 0) return null;
|
|
322
341
|
if (makeRevisionInfo(state)) return null;
|
|
323
342
|
const toggled = captureTransaction(toggleCommand, state);
|
|
324
343
|
if (!toggled) return null;
|
|
@@ -322,6 +322,7 @@ const createParaIdAllocatorPlugin = () => new Plugin({
|
|
|
322
322
|
ignoreTrackedChanges(tr);
|
|
323
323
|
tr.setMeta(paraIdAllocatorKey, "allocated");
|
|
324
324
|
tr.setMeta("addToHistory", false);
|
|
325
|
+
if (newState.storedMarks !== null) tr.setStoredMarks(newState.storedMarks);
|
|
325
326
|
return tr;
|
|
326
327
|
}
|
|
327
328
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { canonicalJson } from "../../../utils/canonicalJson.js";
|
|
2
|
+
import { sectionPropertiesOf } from "../../sectionCarrier.js";
|
|
2
3
|
import { createExtension } from "../create.js";
|
|
3
4
|
import { AddMarkStep, AddNodeMarkStep, AttrStep, RemoveMarkStep, RemoveNodeMarkStep } from "prosemirror-transform";
|
|
4
5
|
import { Plugin, PluginKey } from "prosemirror-state";
|
|
@@ -22,13 +23,13 @@ function countDocumentStructure(doc) {
|
|
|
22
23
|
parent.forEach((node, _offset, index) => {
|
|
23
24
|
if (node.type.name === "paragraph") {
|
|
24
25
|
paragraphs++;
|
|
25
|
-
|
|
26
|
+
const sectionProperties = sectionPropertiesOf(node);
|
|
27
|
+
if (sectionProperties !== null) {
|
|
26
28
|
sectionEndpoints++;
|
|
27
29
|
endpointRecords.push({
|
|
28
30
|
path: parentPath.length === 0 ? `${index}` : `${parentPath}.${index}`,
|
|
29
31
|
paraId: node.attrs["paraId"] ?? null,
|
|
30
|
-
|
|
31
|
-
sectionProperties: node.attrs["_sectionProperties"] ?? null
|
|
32
|
+
sectionProperties
|
|
32
33
|
});
|
|
33
34
|
}
|
|
34
35
|
return;
|
|
@@ -11,9 +11,9 @@ import { Extension } from "../types.js";
|
|
|
11
11
|
* default clipboard parser; ProseMirror chains every plugin's
|
|
12
12
|
* `transformPastedHTML`, so this cooperates with the inliner rather than
|
|
13
13
|
* replacing it, and `<style>` blocks are left intact for it to resolve.
|
|
14
|
-
* 2. `transformPasted` — drops unpaired bookmark boundaries,
|
|
15
|
-
* pasted headings at the open document's own heading style
|
|
16
|
-
* {@link retargetPastedHeadingStyles}).
|
|
14
|
+
* 2. `transformPasted` — drops unpaired bookmark and move-range boundaries,
|
|
15
|
+
* then points pasted headings at the open document's own heading style
|
|
16
|
+
* (see {@link retargetPastedHeadingStyles}).
|
|
17
17
|
* 3. `Mod-Alt-v` — "paste without formatting", inserting clipboard text with
|
|
18
18
|
* the source formatting stripped (see {@link pasteWithoutFormatting}).
|
|
19
19
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { pasteWithoutFormatting } from "../../commands/pastePlainText.js";
|
|
2
2
|
import { createExtension } from "../create.js";
|
|
3
3
|
import { Priority } from "../types.js";
|
|
4
|
-
import { cleanPastedHtml, removeUnpairedBookmarkBoundaries } from "./pasteCleanup.js";
|
|
4
|
+
import { cleanPastedHtml, removeUnpairedBookmarkBoundaries, removeUnpairedMoveRangeBoundaries } from "./pasteCleanup.js";
|
|
5
5
|
import { retargetPastedHeadingStyles } from "./pastedHeadingStyles.js";
|
|
6
6
|
import { Plugin } from "prosemirror-state";
|
|
7
7
|
//#region src/prosemirror/extensions/features/PasteCleanupExtension.ts
|
|
@@ -16,9 +16,9 @@ import { Plugin } from "prosemirror-state";
|
|
|
16
16
|
* default clipboard parser; ProseMirror chains every plugin's
|
|
17
17
|
* `transformPastedHTML`, so this cooperates with the inliner rather than
|
|
18
18
|
* replacing it, and `<style>` blocks are left intact for it to resolve.
|
|
19
|
-
* 2. `transformPasted` — drops unpaired bookmark boundaries,
|
|
20
|
-
* pasted headings at the open document's own heading style
|
|
21
|
-
* {@link retargetPastedHeadingStyles}).
|
|
19
|
+
* 2. `transformPasted` — drops unpaired bookmark and move-range boundaries,
|
|
20
|
+
* then points pasted headings at the open document's own heading style
|
|
21
|
+
* (see {@link retargetPastedHeadingStyles}).
|
|
22
22
|
* 3. `Mod-Alt-v` — "paste without formatting", inserting clipboard text with
|
|
23
23
|
* the source formatting stripped (see {@link pasteWithoutFormatting}).
|
|
24
24
|
*/
|
|
@@ -32,7 +32,7 @@ const PasteCleanupExtension = createExtension({
|
|
|
32
32
|
const internalClipboardToken = options.getInternalClipboardToken?.();
|
|
33
33
|
return cleanPastedHtml(html, { ...internalClipboardToken ? { internalClipboardToken } : {} });
|
|
34
34
|
},
|
|
35
|
-
transformPasted: (slice, view) => retargetPastedHeadingStyles(removeUnpairedBookmarkBoundaries(slice), view)
|
|
35
|
+
transformPasted: (slice, view) => retargetPastedHeadingStyles(removeUnpairedMoveRangeBoundaries(removeUnpairedBookmarkBoundaries(slice)), view)
|
|
36
36
|
} })],
|
|
37
37
|
keyboardShortcuts: { "Mod-Alt-v": pasteWithoutFormatting }
|
|
38
38
|
};
|
|
@@ -14,5 +14,7 @@ type CleanPastedHtmlOptions = {
|
|
|
14
14
|
declare function cleanPastedHtml(html: string, options?: CleanPastedHtmlOptions): string;
|
|
15
15
|
/** Remove incomplete or duplicate bookmark pairs at copied slice edges. */
|
|
16
16
|
declare function removeUnpairedBookmarkBoundaries(slice: Slice): Slice;
|
|
17
|
+
/** Remove incomplete, duplicate, or reversed tracked-move pairs at copied slice edges. */
|
|
18
|
+
declare function removeUnpairedMoveRangeBoundaries(slice: Slice): Slice;
|
|
17
19
|
//#endregion
|
|
18
|
-
export { cleanPastedHtml, removeUnpairedBookmarkBoundaries };
|
|
20
|
+
export { cleanPastedHtml, removeUnpairedBookmarkBoundaries, removeUnpairedMoveRangeBoundaries };
|
|
@@ -2,6 +2,7 @@ import { htmlCommentEnd } from "../../../utils/htmlComments.js";
|
|
|
2
2
|
import { stripXmlDeclarations } from "../../../utils/stripXmlDeclarations.js";
|
|
3
3
|
import { readBookmarkBoundaryAttrs } from "../../bookmarkBoundaryAttrs.js";
|
|
4
4
|
import { findInvalidBookmarkBoundaryIds } from "../../bookmarkBoundaryIntegrity.js";
|
|
5
|
+
import { readMoveRangeBoundaryAttrs } from "../../moveRangeBoundaryAttrs.js";
|
|
5
6
|
import { Fragment, Slice } from "prosemirror-model";
|
|
6
7
|
//#region src/prosemirror/extensions/features/pasteCleanup.ts
|
|
7
8
|
/**
|
|
@@ -124,6 +125,8 @@ const MAX_EMPTY_SPAN_PASSES = 5;
|
|
|
124
125
|
const INTERNAL_CLIPBOARD_ATTR_PATTERN = /\s+data-docx-internal-clipboard(?:="([^"]*)"|='([^']*)'|=([^\s>]+))?/gi;
|
|
125
126
|
const TEXTBOX_ANCHOR_ATTR = /\s+data-docx-textbox-anchor(?:="[^"]*"|='[^']*')?/gi;
|
|
126
127
|
const BOOKMARK_BOUNDARY_ATTR = /\s+data-docx-bookmark-(?:boundary|id|name|col-first|col-last)(?:="[^"]*"|='[^']*'|=[^\s>]+)?/gi;
|
|
128
|
+
const RANGE_ANCHOR_ATTR = /\s+data-docx-range-anchor(?:="[^"]*"|='[^']*'|=[^\s>]+)?/gi;
|
|
129
|
+
const MOVE_RANGE_BOUNDARY_ATTR = /\s+data-docx-move-range-boundary(?:="[^"]*"|='[^']*'|=[^\s>]+)?/gi;
|
|
127
130
|
const STRUCTURED_FIELD_ATTR = /\s+data-field-structured(?:="[^"]*"|='[^']*'|=[^\s>]+)?/gi;
|
|
128
131
|
/**
|
|
129
132
|
* Treat reconstruction attributes as internal only when the HTML carries the
|
|
@@ -144,6 +147,10 @@ function stripForeignBookmarkBoundaries(html, internal) {
|
|
|
144
147
|
if (internal) return html;
|
|
145
148
|
return html.replace(BOOKMARK_BOUNDARY_ATTR, "");
|
|
146
149
|
}
|
|
150
|
+
function stripForeignRangeCarriers(html, internal) {
|
|
151
|
+
if (internal) return html;
|
|
152
|
+
return html.replace(RANGE_ANCHOR_ATTR, "").replace(MOVE_RANGE_BOUNDARY_ATTR, "");
|
|
153
|
+
}
|
|
147
154
|
function stripForeignStructuredFields(html, internal) {
|
|
148
155
|
if (internal) return html;
|
|
149
156
|
return html.replace(STRUCTURED_FIELD_ATTR, "");
|
|
@@ -158,7 +165,7 @@ function stripEmptySpans(html, preserveInternalAtoms) {
|
|
|
158
165
|
let current = html;
|
|
159
166
|
for (let pass = 0; pass < MAX_EMPTY_SPAN_PASSES; pass++) {
|
|
160
167
|
const next = current.replace(EMPTY_SPAN, (span) => {
|
|
161
|
-
if (preserveInternalAtoms && /\bdata-docx-(?:bookmark-boundary|textbox-anchor)\s*=/i.test(span)) return span;
|
|
168
|
+
if (preserveInternalAtoms && /\bdata-docx-(?:bookmark-boundary|textbox-anchor|range-anchor|move-range-boundary)\s*=/i.test(span)) return span;
|
|
162
169
|
return "";
|
|
163
170
|
});
|
|
164
171
|
if (next === current) break;
|
|
@@ -179,6 +186,7 @@ function cleanPastedHtml(html, options = {}) {
|
|
|
179
186
|
cleaned = stripEmptySpans(cleaned, internal);
|
|
180
187
|
cleaned = stripForeignTextBoxAnchors(cleaned, internal);
|
|
181
188
|
cleaned = stripForeignBookmarkBoundaries(cleaned, internal);
|
|
189
|
+
cleaned = stripForeignRangeCarriers(cleaned, internal);
|
|
182
190
|
cleaned = stripForeignStructuredFields(cleaned, internal);
|
|
183
191
|
cleaned = cleaned.replace(INTERNAL_CLIPBOARD_ATTR_PATTERN, "");
|
|
184
192
|
return cleaned.trim();
|
|
@@ -218,5 +226,51 @@ function removeUnpairedBookmarkBoundaries(slice) {
|
|
|
218
226
|
};
|
|
219
227
|
return new Slice(filterFragment(slice.content), slice.openStart, slice.openEnd);
|
|
220
228
|
}
|
|
229
|
+
const moveRangeKey = (marker) => {
|
|
230
|
+
return `${marker.type.startsWith("moveFrom") ? "moveFrom" : "moveTo"}:${marker.id}`;
|
|
231
|
+
};
|
|
232
|
+
const moveRangeBoundaryType = (marker) => marker.type.endsWith("Start") ? "start" : "end";
|
|
233
|
+
/** Remove incomplete, duplicate, or reversed tracked-move pairs at copied slice edges. */
|
|
234
|
+
function removeUnpairedMoveRangeBoundaries(slice) {
|
|
235
|
+
const summaries = /* @__PURE__ */ new Map();
|
|
236
|
+
const malformedNodes = /* @__PURE__ */ new Set();
|
|
237
|
+
let boundaryIndex = 0;
|
|
238
|
+
slice.content.descendants((node) => {
|
|
239
|
+
if (node.type.name !== "moveRangeBoundary") return true;
|
|
240
|
+
const result = readMoveRangeBoundaryAttrs(node);
|
|
241
|
+
if (!result.ok) {
|
|
242
|
+
malformedNodes.add(node);
|
|
243
|
+
return false;
|
|
244
|
+
}
|
|
245
|
+
const key = moveRangeKey(result.value);
|
|
246
|
+
const summary = summaries.get(key) ?? {
|
|
247
|
+
startPositions: [],
|
|
248
|
+
endPositions: []
|
|
249
|
+
};
|
|
250
|
+
summary[moveRangeBoundaryType(result.value) === "start" ? "startPositions" : "endPositions"].push(boundaryIndex);
|
|
251
|
+
summaries.set(key, summary);
|
|
252
|
+
boundaryIndex += 1;
|
|
253
|
+
return false;
|
|
254
|
+
});
|
|
255
|
+
const invalidKeys = /* @__PURE__ */ new Set();
|
|
256
|
+
for (const [key, { startPositions, endPositions }] of summaries) {
|
|
257
|
+
const start = startPositions.at(0);
|
|
258
|
+
const end = endPositions.at(0);
|
|
259
|
+
if (startPositions.length !== 1 || endPositions.length !== 1 || start === void 0 || end === void 0 || start >= end) invalidKeys.add(key);
|
|
260
|
+
}
|
|
261
|
+
const filterFragment = (fragment) => {
|
|
262
|
+
const children = [];
|
|
263
|
+
fragment.forEach((node) => {
|
|
264
|
+
if (node.type.name === "moveRangeBoundary") {
|
|
265
|
+
const result = readMoveRangeBoundaryAttrs(node);
|
|
266
|
+
if (result.ok && !malformedNodes.has(node) && !invalidKeys.has(moveRangeKey(result.value))) children.push(node);
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
children.push(node.childCount === 0 ? node : node.copy(filterFragment(node.content)));
|
|
270
|
+
});
|
|
271
|
+
return Fragment.fromArray(children);
|
|
272
|
+
};
|
|
273
|
+
return new Slice(filterFragment(slice.content), slice.openStart, slice.openEnd);
|
|
274
|
+
}
|
|
221
275
|
//#endregion
|
|
222
|
-
export { cleanPastedHtml, removeUnpairedBookmarkBoundaries };
|
|
276
|
+
export { cleanPastedHtml, removeUnpairedBookmarkBoundaries, removeUnpairedMoveRangeBoundaries };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readOutlineLevelAttr } from "../../outlineLevelAttr.js";
|
|
2
2
|
import { getDocumentBuiltInStyles, getDocumentStyleResolver } from "../../plugins/documentStyles.js";
|
|
3
|
+
import { headingLevelOf } from "@stll/docx-core/model";
|
|
3
4
|
import { Fragment, Slice } from "prosemirror-model";
|
|
4
5
|
//#region src/prosemirror/extensions/features/pastedHeadingStyles.ts
|
|
5
6
|
/**
|
|
@@ -39,11 +40,11 @@ const nearestHeadingStyleId = (outlineLevel, styles) => {
|
|
|
39
40
|
const retargetedStyleId = (node, view) => {
|
|
40
41
|
const styleId = node.attrs["styleId"];
|
|
41
42
|
if (typeof styleId !== "string") return;
|
|
42
|
-
const
|
|
43
|
-
if (
|
|
43
|
+
const headingLevel = headingLevelOf(readOutlineLevelAttr(node.attrs["outlineLevel"]));
|
|
44
|
+
if (headingLevel === void 0) return;
|
|
44
45
|
const resolver = getDocumentStyleResolver(view.state);
|
|
45
46
|
if (resolver === null || resolver.getStyle(styleId) !== void 0) return;
|
|
46
|
-
const target = nearestHeadingStyleId(
|
|
47
|
+
const target = nearestHeadingStyleId(headingLevel, getDocumentBuiltInStyles(view.state));
|
|
47
48
|
return target === styleId ? void 0 : target;
|
|
48
49
|
};
|
|
49
50
|
const retargetFragment = (fragment, view) => {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { MarkExtension } from "./types.js";
|
|
2
|
+
//#region src/prosemirror/extensions/markRegistry.d.ts
|
|
3
|
+
declare const MARK_EXTENSIONS: {
|
|
4
|
+
readonly bold: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
5
|
+
readonly italic: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
6
|
+
readonly underline: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
7
|
+
readonly strike: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
8
|
+
readonly textColor: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
9
|
+
readonly runShading: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
10
|
+
readonly highlight: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
11
|
+
readonly fontSize: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
12
|
+
readonly fontFamily: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
13
|
+
readonly language: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
14
|
+
readonly superscript: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
15
|
+
readonly subscript: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
16
|
+
readonly hyperlink: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
17
|
+
readonly allCaps: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
18
|
+
readonly smallCaps: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
19
|
+
readonly footnoteRef: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
20
|
+
readonly characterSpacing: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
21
|
+
readonly emboss: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
22
|
+
readonly imprint: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
23
|
+
readonly hidden: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
24
|
+
readonly textShadow: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
25
|
+
readonly emphasisMark: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
26
|
+
readonly textOutline: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
27
|
+
readonly rtl: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
28
|
+
readonly textEffect: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
29
|
+
readonly runFormattingOverride: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
30
|
+
readonly characterStyle: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
31
|
+
readonly runIdentity: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
32
|
+
readonly comment: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
33
|
+
readonly insertion: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
34
|
+
readonly deletion: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
35
|
+
readonly runPropertyChange: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
36
|
+
readonly inlineWrapper: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
37
|
+
};
|
|
38
|
+
/** A mark the editor schema declares. */
|
|
39
|
+
type SchemaMarkName = keyof typeof MARK_EXTENSIONS;
|
|
40
|
+
/**
|
|
41
|
+
* Outermost first: the order the editor registers marks in, which is the order
|
|
42
|
+
* it nests their DOM elements in.
|
|
43
|
+
*
|
|
44
|
+
* Five of these marks are containers on the save leg as well, and their
|
|
45
|
+
* relative order is that leg's rather than a choice made here.
|
|
46
|
+
* `extractParagraphContent` opens a comment range around everything a leaf
|
|
47
|
+
* produces (it flushes the open run and hyperlink and drops the tracked wrapper
|
|
48
|
+
* before pushing the marker: `fromProseDoc.ts:2359-2369`), then the revision
|
|
49
|
+
* wrapper (`fromProseDoc.ts:2530`), then the wrapper stack inside that revision
|
|
50
|
+
* (`nestInlineWrapperGroups`, `fromProseDoc.ts:2200`), then the hyperlink and
|
|
51
|
+
* the runs it holds (`fromProseDoc.ts:2567`). So the save writes
|
|
52
|
+
* `w:commentRangeStart … w:ins > w:bdo > w:hyperlink > w:r`, and the editor DOM
|
|
53
|
+
* nests `span.docx-comment > span.docx-insertion > bdo > a`.
|
|
54
|
+
* `markNestingOrder.test.ts` holds the two legs to each other.
|
|
55
|
+
*
|
|
56
|
+
* `runIdentity` is the fifth: `w:r` is the element it names, and it is the
|
|
57
|
+
* innermost element that leg emits.
|
|
58
|
+
*
|
|
59
|
+
* Every other mark is a run property or run content: it has no element of its
|
|
60
|
+
* own in OOXML, so the save leg ranks it against nothing and its place here is
|
|
61
|
+
* a presentation decision.
|
|
62
|
+
*/
|
|
63
|
+
declare const MARK_NESTING_ORDER: readonly ["bold", "italic", "underline", "strike", "textColor", "runShading", "highlight", "fontSize", "fontFamily", "language", "superscript", "subscript", "allCaps", "smallCaps", "footnoteRef", "characterSpacing", "emboss", "imprint", "hidden", "textShadow", "emphasisMark", "textOutline", "rtl", "textEffect", "runFormattingOverride", "characterStyle", "comment", "insertion", "deletion", "inlineWrapper", "hyperlink", "runPropertyChange", "runIdentity"];
|
|
64
|
+
//#endregion
|
|
65
|
+
export { MARK_EXTENSIONS, MARK_NESTING_ORDER, SchemaMarkName };
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { AllCapsExtension } from "./marks/AllCapsExtension.js";
|
|
2
|
+
import { BoldExtension } from "./marks/BoldExtension.js";
|
|
3
|
+
import { CharacterSpacingExtension } from "./marks/CharacterSpacingExtension.js";
|
|
4
|
+
import { CharacterStyleExtension } from "./marks/CharacterStyleExtension.js";
|
|
5
|
+
import { CommentExtension } from "./marks/CommentExtension.js";
|
|
6
|
+
import { FontFamilyExtension } from "./marks/FontFamilyExtension.js";
|
|
7
|
+
import { FontSizeExtension } from "./marks/FontSizeExtension.js";
|
|
8
|
+
import { FootnoteRefExtension } from "./marks/FootnoteRefExtension.js";
|
|
9
|
+
import { HiddenTextExtension } from "./marks/HiddenTextExtension.js";
|
|
10
|
+
import { HighlightExtension } from "./marks/HighlightExtension.js";
|
|
11
|
+
import { HyperlinkExtension } from "./marks/HyperlinkExtension.js";
|
|
12
|
+
import { InlineWrapperExtension } from "./marks/InlineWrapperExtension.js";
|
|
13
|
+
import { ItalicExtension } from "./marks/ItalicExtension.js";
|
|
14
|
+
import { LanguageExtension } from "./marks/LanguageExtension.js";
|
|
15
|
+
import { RtlExtension } from "./marks/RtlExtension.js";
|
|
16
|
+
import { RunFormattingOverrideExtension } from "./marks/RunFormattingOverrideExtension.js";
|
|
17
|
+
import { RunIdentityExtension } from "./marks/RunIdentityExtension.js";
|
|
18
|
+
import { RunShadingExtension } from "./marks/RunShadingExtension.js";
|
|
19
|
+
import { SmallCapsExtension } from "./marks/SmallCapsExtension.js";
|
|
20
|
+
import { StrikeExtension } from "./marks/StrikeExtension.js";
|
|
21
|
+
import { SubscriptExtension } from "./marks/SubscriptExtension.js";
|
|
22
|
+
import { SuperscriptExtension } from "./marks/SuperscriptExtension.js";
|
|
23
|
+
import { TextColorExtension } from "./marks/TextColorExtension.js";
|
|
24
|
+
import { TextEffectExtension } from "./marks/TextEffectExtension.js";
|
|
25
|
+
import { EmbossExtension, EmphasisMarkExtension, ImprintExtension, TextOutlineExtension, TextShadowExtension } from "./marks/TextEffectsExtensions.js";
|
|
26
|
+
import { DeletionExtension, InsertionExtension, RunPropertyChangeExtension } from "./marks/TrackedChangeExtensions.js";
|
|
27
|
+
import { UnderlineExtension } from "./marks/UnderlineExtension.js";
|
|
28
|
+
//#region src/prosemirror/extensions/markRegistry.ts
|
|
29
|
+
/**
|
|
30
|
+
* Every mark the editor schema declares, and the order they nest in.
|
|
31
|
+
*
|
|
32
|
+
* `StarterKit` builds the schema from this record and from nothing else, so
|
|
33
|
+
* `SchemaMarkName` is the set of marks that exist rather than a list beside it
|
|
34
|
+
* — a table that must decide something per mark (what the painter does with
|
|
35
|
+
* it) can be checked total against this union, and a mark added without that
|
|
36
|
+
* decision does not compile.
|
|
37
|
+
*
|
|
38
|
+
* The record answers which marks exist and how each is built; its key order
|
|
39
|
+
* answers nothing. `MARK_NESTING_ORDER` is the registration order, and
|
|
40
|
+
* registration order is DOM nesting order.
|
|
41
|
+
*/
|
|
42
|
+
const MARK_EXTENSIONS = {
|
|
43
|
+
bold: BoldExtension,
|
|
44
|
+
italic: ItalicExtension,
|
|
45
|
+
underline: UnderlineExtension,
|
|
46
|
+
strike: StrikeExtension,
|
|
47
|
+
textColor: TextColorExtension,
|
|
48
|
+
runShading: RunShadingExtension,
|
|
49
|
+
highlight: HighlightExtension,
|
|
50
|
+
fontSize: FontSizeExtension,
|
|
51
|
+
fontFamily: FontFamilyExtension,
|
|
52
|
+
language: LanguageExtension,
|
|
53
|
+
superscript: SuperscriptExtension,
|
|
54
|
+
subscript: SubscriptExtension,
|
|
55
|
+
hyperlink: HyperlinkExtension,
|
|
56
|
+
allCaps: AllCapsExtension,
|
|
57
|
+
smallCaps: SmallCapsExtension,
|
|
58
|
+
footnoteRef: FootnoteRefExtension,
|
|
59
|
+
characterSpacing: CharacterSpacingExtension,
|
|
60
|
+
emboss: EmbossExtension,
|
|
61
|
+
imprint: ImprintExtension,
|
|
62
|
+
hidden: HiddenTextExtension,
|
|
63
|
+
textShadow: TextShadowExtension,
|
|
64
|
+
emphasisMark: EmphasisMarkExtension,
|
|
65
|
+
textOutline: TextOutlineExtension,
|
|
66
|
+
rtl: RtlExtension,
|
|
67
|
+
textEffect: TextEffectExtension,
|
|
68
|
+
runFormattingOverride: RunFormattingOverrideExtension,
|
|
69
|
+
characterStyle: CharacterStyleExtension,
|
|
70
|
+
runIdentity: RunIdentityExtension,
|
|
71
|
+
comment: CommentExtension,
|
|
72
|
+
insertion: InsertionExtension,
|
|
73
|
+
deletion: DeletionExtension,
|
|
74
|
+
runPropertyChange: RunPropertyChangeExtension,
|
|
75
|
+
inlineWrapper: InlineWrapperExtension
|
|
76
|
+
};
|
|
77
|
+
/** The order, rejected unless it names every mark; a repeat is the test's. */
|
|
78
|
+
const markNestingOrder = (names) => names;
|
|
79
|
+
/**
|
|
80
|
+
* Outermost first: the order the editor registers marks in, which is the order
|
|
81
|
+
* it nests their DOM elements in.
|
|
82
|
+
*
|
|
83
|
+
* Five of these marks are containers on the save leg as well, and their
|
|
84
|
+
* relative order is that leg's rather than a choice made here.
|
|
85
|
+
* `extractParagraphContent` opens a comment range around everything a leaf
|
|
86
|
+
* produces (it flushes the open run and hyperlink and drops the tracked wrapper
|
|
87
|
+
* before pushing the marker: `fromProseDoc.ts:2359-2369`), then the revision
|
|
88
|
+
* wrapper (`fromProseDoc.ts:2530`), then the wrapper stack inside that revision
|
|
89
|
+
* (`nestInlineWrapperGroups`, `fromProseDoc.ts:2200`), then the hyperlink and
|
|
90
|
+
* the runs it holds (`fromProseDoc.ts:2567`). So the save writes
|
|
91
|
+
* `w:commentRangeStart … w:ins > w:bdo > w:hyperlink > w:r`, and the editor DOM
|
|
92
|
+
* nests `span.docx-comment > span.docx-insertion > bdo > a`.
|
|
93
|
+
* `markNestingOrder.test.ts` holds the two legs to each other.
|
|
94
|
+
*
|
|
95
|
+
* `runIdentity` is the fifth: `w:r` is the element it names, and it is the
|
|
96
|
+
* innermost element that leg emits.
|
|
97
|
+
*
|
|
98
|
+
* Every other mark is a run property or run content: it has no element of its
|
|
99
|
+
* own in OOXML, so the save leg ranks it against nothing and its place here is
|
|
100
|
+
* a presentation decision.
|
|
101
|
+
*/
|
|
102
|
+
const MARK_NESTING_ORDER = markNestingOrder([
|
|
103
|
+
"bold",
|
|
104
|
+
"italic",
|
|
105
|
+
"underline",
|
|
106
|
+
"strike",
|
|
107
|
+
"textColor",
|
|
108
|
+
"runShading",
|
|
109
|
+
"highlight",
|
|
110
|
+
"fontSize",
|
|
111
|
+
"fontFamily",
|
|
112
|
+
"language",
|
|
113
|
+
"superscript",
|
|
114
|
+
"subscript",
|
|
115
|
+
"allCaps",
|
|
116
|
+
"smallCaps",
|
|
117
|
+
"footnoteRef",
|
|
118
|
+
"characterSpacing",
|
|
119
|
+
"emboss",
|
|
120
|
+
"imprint",
|
|
121
|
+
"hidden",
|
|
122
|
+
"textShadow",
|
|
123
|
+
"emphasisMark",
|
|
124
|
+
"textOutline",
|
|
125
|
+
"rtl",
|
|
126
|
+
"textEffect",
|
|
127
|
+
"runFormattingOverride",
|
|
128
|
+
"characterStyle",
|
|
129
|
+
"comment",
|
|
130
|
+
"insertion",
|
|
131
|
+
"deletion",
|
|
132
|
+
"inlineWrapper",
|
|
133
|
+
"hyperlink",
|
|
134
|
+
"runPropertyChange",
|
|
135
|
+
"runIdentity"
|
|
136
|
+
]);
|
|
137
|
+
//#endregion
|
|
138
|
+
export { MARK_EXTENSIONS, MARK_NESTING_ORDER };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { MarkExtension } from "../types.js";
|
|
2
|
+
//#region src/prosemirror/extensions/marks/InlineWrapperExtension.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Inline wrapper mark — the transparent wrappers a leaf sits inside.
|
|
5
|
+
*
|
|
6
|
+
* One mark for every wrapper kind rather than one mark per kind: ProseMirror's
|
|
7
|
+
* mark set is unordered across types, so two marks could not say which wrapper
|
|
8
|
+
* is inside which. The nesting lives in the `stack` attr, outermost first, and
|
|
9
|
+
* the mark excludes itself (ProseMirror's default) because a second one would
|
|
10
|
+
* be a second answer to the same question.
|
|
11
|
+
*
|
|
12
|
+
* `inclusive: false` so typing at the end of a wrapped span does not silently
|
|
13
|
+
* extend the wrapper over text the author wrote outside it.
|
|
14
|
+
*/
|
|
15
|
+
declare const INLINE_WRAPPER_MARK_NAME = "inlineWrapper";
|
|
16
|
+
declare const InlineWrapperExtension: (options?: Partial<Record<string, unknown>> | undefined) => MarkExtension;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { INLINE_WRAPPER_MARK_NAME, InlineWrapperExtension };
|