@stll/folio-core 0.46.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 +26 -24
- package/dist/ai-edits/headless.js +1 -1
- 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/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/section-boundary-properties.js +1 -2
- package/dist/content-controls/checkboxDisplay.d.ts +8 -2
- package/dist/content-controls/checkboxDisplay.js +11 -5
- package/dist/content-controls/mutateContentControls.js +41 -42
- package/dist/controller/layoutPipeline.js +8 -3
- package/dist/display-list/build/buildDisplayList.js +7 -7
- package/dist/display-list/build/imagePrimitives.d.ts +4 -4
- package/dist/display-list/build/imagePrimitives.js +38 -20
- package/dist/display-list/build/pageBorderPrimitives.js +2 -1
- package/dist/display-list/build/paragraphPrimitives.js +93 -13
- 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 +1 -19
- package/dist/display-list/primitives.d.ts +13 -2
- package/dist/display-list/primitives.js +36 -1
- package/dist/document-operations.js +2 -1
- package/dist/docx/attributeRemainder.d.ts +34 -1
- package/dist/docx/attributeRemainder.js +49 -3
- package/dist/docx/blockContentParser.d.ts +2 -0
- package/dist/docx/blockContentParser.js +39 -67
- package/dist/docx/blockPlainText.js +3 -1
- 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.js +1 -1
- package/dist/docx/commentParser.js +3 -3
- package/dist/docx/commentRangeIntegrity.js +1 -1
- package/dist/docx/commentRangeJoin.js +1 -1
- package/dist/docx/commentReferenceNormalization.js +3 -2
- package/dist/docx/commentReplyMarkers.js +1 -1
- package/dist/docx/compatibility.js +56 -42
- package/dist/docx/containerChildren.d.ts +110 -13
- package/dist/docx/containerChildren.gen.d.ts +16 -1
- package/dist/docx/containerChildren.gen.js +18 -1
- package/dist/docx/containerChildren.js +63 -13
- package/dist/docx/diagramPreview.d.ts +14 -2
- package/dist/docx/diagramPreview.js +81 -169
- package/dist/docx/documentParser.js +4 -1
- 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/fontTableParser.js +102 -41
- package/dist/docx/footnoteParser.js +10 -6
- package/dist/docx/groupDrawingParser.js +4 -3
- package/dist/docx/headerFooterReferenceNormalization.js +1 -1
- package/dist/docx/hyperlinkParser.d.ts +45 -7
- package/dist/docx/hyperlinkParser.js +126 -57
- package/dist/docx/imageParser.js +127 -107
- 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 +84 -3
- package/dist/docx/inlineWrapperContent.js +85 -4
- 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 +4 -2
- 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 +91 -1
- package/dist/docx/paraIdAttribute.js +79 -1
- package/dist/docx/paragraphParser.d.ts +9 -24
- package/dist/docx/paragraphParser.js +212 -396
- package/dist/docx/paragraphProperties.d.ts +23 -0
- package/dist/docx/paragraphProperties.js +279 -0
- package/dist/docx/paragraphPropertySource.js +2 -0
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +2 -1
- package/dist/docx/paragraphTextBoxEnrichment.js +14 -7
- package/dist/docx/paragraphTraversal.d.ts +14 -10
- package/dist/docx/paragraphTraversal.js +47 -49
- package/dist/docx/parseWarningMessage.js +3 -0
- package/dist/docx/parserEnums.d.ts +6 -8
- package/dist/docx/parserEnums.js +4 -6
- package/dist/docx/preservedRunContent.js +16 -6
- 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 +2 -2
- package/dist/docx/rezip.d.ts +28 -2
- package/dist/docx/rezip.js +78 -9
- package/dist/docx/runConsolidator.d.ts +42 -2
- package/dist/docx/runConsolidator.js +60 -6
- package/dist/docx/runParser.d.ts +54 -18
- package/dist/docx/runParser.js +379 -295
- 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 +236 -240
- package/dist/docx/selectiveSave.js +3 -2
- package/dist/docx/selectiveXmlPatch.d.ts +21 -2
- package/dist/docx/selectiveXmlPatch.js +195 -99
- package/dist/docx/serializer/blockSdtSerializer.js +2 -96
- package/dist/docx/serializer/borderSerializer.d.ts +5 -5
- package/dist/docx/serializer/borderSerializer.js +10 -8
- package/dist/docx/serializer/documentSerializer.js +3 -0
- package/dist/docx/serializer/fontTableSerializer.js +31 -3
- package/dist/docx/serializer/headerFooterSerializer.js +3 -0
- package/dist/docx/serializer/markupRangeAttributes.d.ts +9 -1
- package/dist/docx/serializer/markupRangeAttributes.js +9 -1
- package/dist/docx/serializer/noteSerializer.js +3 -0
- 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 +88 -188
- package/dist/docx/serializer/runSerializer.d.ts +1 -5
- package/dist/docx/serializer/runSerializer.js +109 -59
- package/dist/docx/serializer/sdtPropertiesSerializer.d.ts +26 -0
- package/dist/docx/serializer/sdtPropertiesSerializer.js +111 -0
- package/dist/docx/serializer/sectionPropertiesSerializer.js +34 -45
- package/dist/docx/serializer/settingsSerializer.js +6 -4
- package/dist/docx/serializer/stylesSerializer.js +8 -11
- package/dist/docx/serializer/tableSerializer.js +268 -100
- 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 +18 -16
- package/dist/docx/server/migrateYjsAttrSchema.js +3 -3
- 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 +8 -3
- 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 +10 -1
- package/dist/docx/tableParser.js +505 -181
- package/dist/docx/textBoxParser.d.ts +3 -1
- package/dist/docx/textBoxParser.js +18 -8
- 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/vmlImageParser.d.ts +13 -4
- package/dist/docx/vmlImageParser.js +74 -31
- 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/xmlParser.d.ts +14 -1
- package/dist/docx/xmlParser.js +18 -2
- package/dist/fonts/embeddedFonts.js +3 -3
- package/dist/headless-layout.js +2 -0
- 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/internal/headlessRevisionResolution.js +9 -0
- package/dist/internal/pageBreakRunSourceDescendantIndex.js +3 -1
- 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 +177 -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/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 +47 -17
- package/dist/layout-engine/types.js +16 -1
- package/dist/layout-painter/borderStroke.d.ts +18 -4
- package/dist/layout-painter/renderPage.js +6 -4
- package/dist/layout-painter/renderParagraph.d.ts +2 -1
- package/dist/layout-painter/renderParagraph.js +13 -26
- 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/markdown/renderBlock.js +3 -1
- package/dist/markdown/renderRuns.js +7 -2
- package/dist/markdown/renderTable.js +2 -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/prosemirror/attrs/index.d.ts +22 -4
- package/dist/prosemirror/attrs/index.js +498 -60
- 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 +24 -19
- package/dist/prosemirror/commands/image.d.ts +1 -1
- package/dist/prosemirror/commands/image.js +4 -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/conversion/fromProseDoc.d.ts +18 -2
- package/dist/prosemirror/conversion/fromProseDoc.js +330 -183
- 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.js +371 -141
- package/dist/prosemirror/emptyRangeAnchor.d.ts +53 -0
- package/dist/prosemirror/emptyRangeAnchor.js +158 -0
- package/dist/prosemirror/extensions/StarterKit.js +8 -2
- package/dist/prosemirror/extensions/core/DocExtension.js +1 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +19 -15
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +3 -2
- package/dist/prosemirror/extensions/features/ListExtension.js +43 -24
- 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 +26 -2
- package/dist/prosemirror/extensions/markRegistry.js +73 -10
- package/dist/prosemirror/extensions/marks/InlineWrapperExtension.js +17 -3
- 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.js +2 -1
- 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.js +10 -0
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +8 -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/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 +4 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +141 -123
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +4 -0
- 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.js +20 -3
- 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/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 +1 -1
- package/dist/prosemirror/replacedAnnotations.js +24 -6
- package/dist/prosemirror/revisionCarriers.d.ts +86 -2
- package/dist/prosemirror/revisionCarriers.js +86 -60
- package/dist/prosemirror/runFormattingInlineCarriers.d.ts +2 -0
- package/dist/prosemirror/runFormattingInlineCarriers.js +2 -0
- 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 +2 -2
- package/dist/prosemirror/schema/marks.d.ts +23 -4
- package/dist/prosemirror/schema/nodes.d.ts +220 -24
- 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 +2 -0
- package/dist/prosemirror/trackedRunInlineAtoms.js +2 -0
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +10 -11
- package/dist/prosemirror/utils/extractTrackedChanges.js +109 -92
- package/dist/prosemirror/validation.js +17 -6
- package/dist/prosemirror/yjsDocumentMetadata.d.ts +2 -2
- package/dist/prosemirror/yjsDocumentMetadata.js +428 -7
- package/dist/prosemirror/zeroWidthAnchors.js +4 -0
- 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/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/mergeDocumentContent.js +5 -3
- package/dist/utils/paragraphFormattingMerge.js +27 -6
- package/dist/utils/replaceText.js +1 -1
- 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/bookmarkPlacement.d.ts +0 -9
- package/dist/docx/bookmarkPlacement.js +0 -52
- 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
|
@@ -44,11 +44,23 @@ const TRACKED_CHANGE_WRAPPER_CONTENT = {
|
|
|
44
44
|
* the bidirectional wrapper: OOXML allows runs, hyperlinks, simple/complex
|
|
45
45
|
* fields, nested SDTs, tracked insertions/deletions/moves, math, markup folio
|
|
46
46
|
* does not model, and the bidirectional controls directly inside
|
|
47
|
-
* `<w:sdtContent>`.
|
|
48
|
-
*
|
|
47
|
+
* `<w:sdtContent>`.
|
|
48
|
+
*
|
|
49
|
+
* The bookmark boundaries are admitted for the reason the revision wrapper
|
|
50
|
+
* admits them: `CT_SdtContentRun` reaches `EG_RangeMarkupElements` through
|
|
51
|
+
* `EG_RunLevelElts`, so the marker is valid where Word wrote it, and lifting
|
|
52
|
+
* it out changes what the bookmark covers. A range whose extent was the
|
|
53
|
+
* control's content comes back covering the control plus whatever follows, so
|
|
54
|
+
* a `REF` field or a link to it resolves to the wrong text.
|
|
55
|
+
*
|
|
56
|
+
* The other range markers are not: a `w:commentRangeStart` or a
|
|
57
|
+
* `w:moveFromRangeStart` inside the control is a marker the control does not
|
|
58
|
+
* own, and the pairing passes read it as a paragraph-level sibling.
|
|
49
59
|
*/
|
|
50
60
|
const INLINE_SDT_CONTENT = {
|
|
51
61
|
inlineWrapper: true,
|
|
62
|
+
bookmarkEnd: true,
|
|
63
|
+
bookmarkStart: true,
|
|
52
64
|
complexField: true,
|
|
53
65
|
deletion: true,
|
|
54
66
|
hyperlink: true,
|
|
@@ -60,15 +72,80 @@ const INLINE_SDT_CONTENT = {
|
|
|
60
72
|
preservedInline: true,
|
|
61
73
|
run: true,
|
|
62
74
|
simpleField: true,
|
|
75
|
+
commentRangeEnd: false,
|
|
76
|
+
commentRangeStart: false,
|
|
77
|
+
commentReference: false,
|
|
78
|
+
moveFromRangeEnd: false,
|
|
79
|
+
moveFromRangeStart: false,
|
|
80
|
+
moveToRangeEnd: false,
|
|
81
|
+
moveToRangeStart: false
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* What a `w:hyperlink` keeps inside itself (CT_Hyperlink).
|
|
85
|
+
*
|
|
86
|
+
* Runs, the bookmark boundaries a link's target sits on, markup folio does not
|
|
87
|
+
* model, and the four transparent wrappers: `CT_Hyperlink` is `EG_PContent`,
|
|
88
|
+
* which declares `w:bdo`, `w:dir`, `w:smartTag` and the run-level
|
|
89
|
+
* `w:customXml`, so `w:hyperlink > w:bdo > w:r` is a link an author may write
|
|
90
|
+
* and folio reads it as authored.
|
|
91
|
+
*
|
|
92
|
+
* A revision is not admitted, and the exclusion is the model's, not the
|
|
93
|
+
* schema's: OOXML nests `w:ins` inside `w:hyperlink` and folio nests the link
|
|
94
|
+
* inside the revision, so the paragraph parser hoists one around the link.
|
|
95
|
+
*/
|
|
96
|
+
const HYPERLINK_CONTENT = {
|
|
97
|
+
bookmarkEnd: true,
|
|
98
|
+
bookmarkStart: true,
|
|
99
|
+
inlineWrapper: true,
|
|
100
|
+
preservedInline: true,
|
|
101
|
+
run: true,
|
|
102
|
+
commentRangeEnd: false,
|
|
103
|
+
commentRangeStart: false,
|
|
104
|
+
commentReference: false,
|
|
105
|
+
complexField: false,
|
|
106
|
+
deletion: false,
|
|
107
|
+
hyperlink: false,
|
|
108
|
+
inlineSdt: false,
|
|
109
|
+
insertion: false,
|
|
110
|
+
mathEquation: false,
|
|
111
|
+
moveFrom: false,
|
|
112
|
+
moveFromRangeEnd: false,
|
|
113
|
+
moveFromRangeStart: false,
|
|
114
|
+
moveTo: false,
|
|
115
|
+
moveToRangeEnd: false,
|
|
116
|
+
moveToRangeStart: false,
|
|
117
|
+
simpleField: false
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* What a `w:fldSimple` keeps inside itself (CT_SimpleField).
|
|
121
|
+
*
|
|
122
|
+
* The cached result's runs and the link one may carry, the same four
|
|
123
|
+
* transparent wrappers `EG_PContent` declares, and markup folio does not
|
|
124
|
+
* model. `w:fldData` is the field's own child rather than its content, so it
|
|
125
|
+
* rides `dispatchChildren`'s sink like any other capture.
|
|
126
|
+
*/
|
|
127
|
+
const SIMPLE_FIELD_CONTENT = {
|
|
128
|
+
hyperlink: true,
|
|
129
|
+
inlineWrapper: true,
|
|
130
|
+
preservedInline: true,
|
|
131
|
+
run: true,
|
|
63
132
|
bookmarkEnd: false,
|
|
64
133
|
bookmarkStart: false,
|
|
65
134
|
commentRangeEnd: false,
|
|
66
135
|
commentRangeStart: false,
|
|
67
136
|
commentReference: false,
|
|
137
|
+
complexField: false,
|
|
138
|
+
deletion: false,
|
|
139
|
+
inlineSdt: false,
|
|
140
|
+
insertion: false,
|
|
141
|
+
mathEquation: false,
|
|
142
|
+
moveFrom: false,
|
|
68
143
|
moveFromRangeEnd: false,
|
|
69
144
|
moveFromRangeStart: false,
|
|
145
|
+
moveTo: false,
|
|
70
146
|
moveToRangeEnd: false,
|
|
71
|
-
moveToRangeStart: false
|
|
147
|
+
moveToRangeStart: false,
|
|
148
|
+
simpleField: false
|
|
72
149
|
};
|
|
73
150
|
/**
|
|
74
151
|
* Whether a revision wrapper keeps this content inside itself.
|
|
@@ -80,5 +157,9 @@ const INLINE_SDT_CONTENT = {
|
|
|
80
157
|
const isTrackedChangeWrapperChild = (content) => TRACKED_CHANGE_WRAPPER_CONTENT[content.type];
|
|
81
158
|
/** Whether an inline content control keeps this content inside `<w:sdtContent>`. */
|
|
82
159
|
const isInlineSdtContent = (content) => INLINE_SDT_CONTENT[content.type];
|
|
160
|
+
/** Whether a `w:hyperlink` keeps this content inside itself. */
|
|
161
|
+
const isHyperlinkContent = (content) => HYPERLINK_CONTENT[content.type];
|
|
162
|
+
/** Whether a `w:fldSimple` keeps this content inside itself. */
|
|
163
|
+
const isSimpleFieldContent = (content) => SIMPLE_FIELD_CONTENT[content.type];
|
|
83
164
|
//#endregion
|
|
84
|
-
export { INLINE_SDT_CONTENT, TRACKED_CHANGE_WRAPPER_CONTENT, isInlineSdtContent, isTrackedChangeWrapperChild };
|
|
165
|
+
export { HYPERLINK_CONTENT, INLINE_SDT_CONTENT, SIMPLE_FIELD_CONTENT, TRACKED_CHANGE_WRAPPER_CONTENT, isHyperlinkContent, isInlineSdtContent, isSimpleFieldContent, isTrackedChangeWrapperChild };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
import { XmlElement } from "./xmlParser.js";
|
|
3
|
+
//#region src/docx/inlineWrapperParser.d.ts
|
|
4
|
+
/** The elements that spell a transparent inline wrapper. */
|
|
5
|
+
declare const INLINE_WRAPPER_ELEMENTS: readonly ["bdo", "dir", "smartTag", "customXml"];
|
|
6
|
+
/** One of them, as the child dispatcher names it. */
|
|
7
|
+
type InlineWrapperElement = (typeof INLINE_WRAPPER_ELEMENTS)[number];
|
|
8
|
+
/** The wrapper `element` spells, around content the caller has already read. */
|
|
9
|
+
declare const inlineWrapperOf: (element: InlineWrapperElement, node: XmlElement, content: document_d_exports.ParagraphContent[]) => document_d_exports.InlineWrapper;
|
|
10
|
+
//#endregion
|
|
11
|
+
export { INLINE_WRAPPER_ELEMENTS, InlineWrapperElement, inlineWrapperOf };
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { captureVerbatimXml } from "./verbatimCapture.js";
|
|
2
|
+
import { findChild, getAttribute } from "./xmlParser.js";
|
|
3
|
+
import { BIDI_CONTROLS } from "@stll/docx-core/model";
|
|
4
|
+
//#region src/docx/inlineWrapperParser.ts
|
|
5
|
+
/** The elements that spell a transparent inline wrapper. */
|
|
6
|
+
const INLINE_WRAPPER_ELEMENTS = [
|
|
7
|
+
"bdo",
|
|
8
|
+
"dir",
|
|
9
|
+
"smartTag",
|
|
10
|
+
"customXml"
|
|
11
|
+
];
|
|
12
|
+
/**
|
|
13
|
+
* A `w:bdo` or `w:dir`: a bidirectional override or embedding. Both hold
|
|
14
|
+
* inline content and change only how it is laid out, so the wrapper carries
|
|
15
|
+
* its direction and nothing else.
|
|
16
|
+
*/
|
|
17
|
+
const bidiWrapper = (node, control, content) => {
|
|
18
|
+
const wrapper = {
|
|
19
|
+
type: "inlineWrapper",
|
|
20
|
+
kind: "bidi",
|
|
21
|
+
control,
|
|
22
|
+
content
|
|
23
|
+
};
|
|
24
|
+
const direction = getAttribute(node, "w", "val");
|
|
25
|
+
if (direction === "ltr" || direction === "rtl") wrapper.direction = direction;
|
|
26
|
+
return wrapper;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* A `w:smartTag` or a run-level `w:customXml`. Both name an element in another
|
|
30
|
+
* vocabulary around content that is ordinary inline content; what the wrapper
|
|
31
|
+
* adds is its name, its namespace and a properties bag folio replays rather
|
|
32
|
+
* than reads. The `w:element` attribute is required by both content models,
|
|
33
|
+
* and a tag without one names nothing, so it is read as the empty string
|
|
34
|
+
* rather than refused: the content is what matters.
|
|
35
|
+
*/
|
|
36
|
+
const taggedWrapper = (node, kind, content) => {
|
|
37
|
+
const wrapper = {
|
|
38
|
+
type: "inlineWrapper",
|
|
39
|
+
kind,
|
|
40
|
+
element: getAttribute(node, "w", "element") ?? "",
|
|
41
|
+
content
|
|
42
|
+
};
|
|
43
|
+
const uri = getAttribute(node, "w", "uri");
|
|
44
|
+
if (uri !== null) wrapper.uri = uri;
|
|
45
|
+
const properties = findChild(node, "w", kind === "smartTag" ? "smartTagPr" : "customXmlPr");
|
|
46
|
+
if (properties) wrapper.propertiesXml = captureVerbatimXml(properties);
|
|
47
|
+
return wrapper;
|
|
48
|
+
};
|
|
49
|
+
/** The wrapper `element` spells, around content the caller has already read. */
|
|
50
|
+
const inlineWrapperOf = (element, node, content) => {
|
|
51
|
+
switch (element) {
|
|
52
|
+
case "bdo": return bidiWrapper(node, BIDI_CONTROLS.override, content);
|
|
53
|
+
case "dir": return bidiWrapper(node, BIDI_CONTROLS.embedding, content);
|
|
54
|
+
case "smartTag": return taggedWrapper(node, "smartTag", content);
|
|
55
|
+
case "customXml": return taggedWrapper(node, "customXml", content);
|
|
56
|
+
default: return element;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { INLINE_WRAPPER_ELEMENTS, inlineWrapperOf };
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
1
2
|
import { XmlElement } from "./xmlParser.js";
|
|
2
3
|
//#region src/docx/nonVisualDrawingProps.d.ts
|
|
3
|
-
/** The authored name, alt text and title of a drawing object. */
|
|
4
|
-
type NonVisualDrawingNames = {
|
|
5
|
-
/** `@name`, schema-required, so `""` means the object was never named. */
|
|
6
|
-
name?: string;
|
|
7
|
-
/** `@descr`: alt text, accessibility content. */
|
|
8
|
-
alt?: string;
|
|
9
|
-
/** `@title`. */
|
|
10
|
-
title?: string;
|
|
11
|
-
};
|
|
12
4
|
/**
|
|
13
5
|
* Read `@name`, `@descr` and `@title` off a `CT_NonVisualDrawingProps` element.
|
|
14
6
|
*
|
|
@@ -19,7 +11,7 @@ type NonVisualDrawingNames = {
|
|
|
19
11
|
* tell the two apart. `@descr` and `@title` are optional and written only when
|
|
20
12
|
* authored, so `""` in either is a string someone wrote.
|
|
21
13
|
*/
|
|
22
|
-
declare const parseNonVisualDrawingNames: (element: XmlElement | null | undefined) => NonVisualDrawingNames;
|
|
14
|
+
declare const parseNonVisualDrawingNames: (element: XmlElement | null | undefined) => document_d_exports.NonVisualDrawingNames;
|
|
23
15
|
/**
|
|
24
16
|
* The `name`, `descr` and `title` attributes of a `CT_NonVisualDrawingProps`
|
|
25
17
|
* element, leading space included.
|
|
@@ -29,6 +21,6 @@ declare const parseNonVisualDrawingNames: (element: XmlElement | null | undefine
|
|
|
29
21
|
* "Shape 3" would overwrite the author's own name for every drawing whose
|
|
30
22
|
* name did not survive the model, and read back as authored content.
|
|
31
23
|
*/
|
|
32
|
-
declare const serializeNonVisualDrawingNames: (names: NonVisualDrawingNames) => string;
|
|
33
|
-
|
|
34
|
-
export { NonVisualDrawingNames, parseNonVisualDrawingNames, serializeNonVisualDrawingNames };
|
|
24
|
+
declare const serializeNonVisualDrawingNames: (names: document_d_exports.NonVisualDrawingNames) => string;
|
|
25
|
+
type NonVisualDrawingNames = document_d_exports.NonVisualDrawingNames;
|
|
26
|
+
export { type NonVisualDrawingNames, parseNonVisualDrawingNames, serializeNonVisualDrawingNames };
|
|
@@ -52,14 +52,16 @@ const normalizeCellBlock = (block, styles) => {
|
|
|
52
52
|
switch (block.type) {
|
|
53
53
|
case "paragraph": return normalizeParagraph(block, styles);
|
|
54
54
|
case "table": return normalizeTable(block, styles);
|
|
55
|
-
case "preservedBlock":
|
|
55
|
+
case "preservedBlock":
|
|
56
|
+
case "bookmarkStart":
|
|
57
|
+
case "bookmarkEnd": return block;
|
|
56
58
|
default: return block;
|
|
57
59
|
}
|
|
58
60
|
};
|
|
59
61
|
const normalizeBlocks = (blocks, styles) => blocks.map((block) => {
|
|
60
62
|
if (block.type === "paragraph") return normalizeParagraph(block, styles);
|
|
61
63
|
if (block.type === "table") return normalizeTable(block, styles);
|
|
62
|
-
if (block.type === "preservedBlock") return block;
|
|
64
|
+
if (block.type === "preservedBlock" || block.type === "bookmarkStart" || block.type === "bookmarkEnd") return block;
|
|
63
65
|
return {
|
|
64
66
|
...block,
|
|
65
67
|
content: normalizeBlocks(block.content, styles)
|
|
@@ -24,6 +24,29 @@ type NumberingMap = {
|
|
|
24
24
|
* @returns NumberingMap with definitions and helper functions
|
|
25
25
|
*/
|
|
26
26
|
declare function parseNumbering(numberingXml: string | null): NumberingMap;
|
|
27
|
+
/** A `w:numFmt` as the model holds it: the token, plus what `custom` defers to. */
|
|
28
|
+
type ResolvedNumFmt = Pick<document_d_exports.ListLevel, "numFmt" | "numFmtFormat">;
|
|
29
|
+
/**
|
|
30
|
+
* The width a `custom` format's zero-padded first token counts to, or
|
|
31
|
+
* `undefined` for a pattern folio does not render.
|
|
32
|
+
*
|
|
33
|
+
* ECMA-376 §17.9.17: `@w:format` is an XSLT token list like
|
|
34
|
+
* "0001, 0002, 0003, ...". Word only emits zero-padded decimal customs this
|
|
35
|
+
* way; the width is the digit count of the first token, clamped to five.
|
|
36
|
+
*/
|
|
37
|
+
declare const customNumberFormatPadWidth: (format: string | undefined) => number | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* The `@w:format` a level's `w:numFmt` writes, which only `custom` carries.
|
|
40
|
+
*
|
|
41
|
+
* `custom` is the reserved member that defers to another attribute, so the
|
|
42
|
+
* comparison lives here, in the module the reserved-value registry names as
|
|
43
|
+
* its owner, rather than in the serializer that needs the answer.
|
|
44
|
+
*/
|
|
45
|
+
declare const customNumberFormatOf: (level: ResolvedNumFmt) => string | undefined;
|
|
46
|
+
/** What the marker renderer counts a level in; `custom` decides by pad width. */
|
|
47
|
+
declare const counterFormatOf: (level: ResolvedNumFmt) => document_d_exports.CounterFormat;
|
|
48
|
+
/** {@link MARKER_ALIGNMENT} for a level that may not state a justification. */
|
|
49
|
+
declare const markerAlignmentForLevel: (lvlJc: document_d_exports.ParagraphAlignment | undefined) => document_d_exports.ListRendering["markerAlignment"];
|
|
27
50
|
declare const markerFormattingFromLevel: (formatting: document_d_exports.TextFormatting | undefined) => document_d_exports.ListMarkerFormatting | undefined;
|
|
28
51
|
declare function getCachedNumberingMap(definitions: document_d_exports.NumberingDefinitions): NumberingMap;
|
|
29
52
|
/**
|
|
@@ -54,7 +77,7 @@ declare function computeListRendering(numPr: {
|
|
|
54
77
|
* @param formats - Array of number formats for each level
|
|
55
78
|
* @returns Rendered marker text
|
|
56
79
|
*/
|
|
57
|
-
declare function renderListMarker(lvlText: string, counters: number[], formats: document_d_exports.
|
|
80
|
+
declare function renderListMarker(lvlText: string, counters: number[], formats: document_d_exports.CounterFormat[]): string;
|
|
58
81
|
/**
|
|
59
82
|
* Get the bullet character for a bullet list level
|
|
60
83
|
*
|
|
@@ -69,4 +92,4 @@ declare function isBulletLevel(level: document_d_exports.ListLevel): boolean;
|
|
|
69
92
|
/** Whether a numbering level reserves horizontal space for a visible marker. */
|
|
70
93
|
declare const numberingLevelHasMarkerSlot: (level: Pick<document_d_exports.ListLevel, "numFmt">) => boolean;
|
|
71
94
|
//#endregion
|
|
72
|
-
export { NumberingMap, computeListRendering, createNumberingMap, formatOoxmlCounter as formatNumber, getBulletCharacter, getCachedNumberingMap, isBulletLevel, markerFormattingFromLevel, numberingLevelHasMarkerSlot, padDecimal, parseNumbering, renderListMarker };
|
|
95
|
+
export { NumberingMap, computeListRendering, counterFormatOf, createNumberingMap, customNumberFormatOf, customNumberFormatPadWidth, formatOoxmlCounter as formatNumber, getBulletCharacter, getCachedNumberingMap, isBulletLevel, markerAlignmentForLevel, markerFormattingFromLevel, numberingLevelHasMarkerSlot, padDecimal, parseNumbering, renderListMarker };
|