@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
|
@@ -5,6 +5,7 @@ import { buildTableCellGrid, buildTableCellPlacements, getSourceCellAt } from ".
|
|
|
5
5
|
import { tableFragmentBottomBorders } from "../layout-engine/measure/tableFragmentBorderGeometry.js";
|
|
6
6
|
import { resolveTableInlineOffset, resolveTableInlinePlacement } from "../layout-engine/measure/tableInlinePlacement.js";
|
|
7
7
|
import { isFloatingImageRun, isFloatingTextBoxBlock, resolveTableCellPadding, tableColumnsArePinned } from "../layout-engine/types.js";
|
|
8
|
+
import { paintsCssBorder } from "../utils/borderCss.js";
|
|
8
9
|
import { applySanitizedImageSrc } from "../utils/sanitizeImageSrc.js";
|
|
9
10
|
import { emuToPixels } from "../utils/units.js";
|
|
10
11
|
import { resolveAnchoredImagePosition } from "./anchoredImagePosition.js";
|
|
@@ -14,6 +15,7 @@ import { applyImageVisualAttrs, hasImageCrop, hasImageVisualAttrs } from "./rend
|
|
|
14
15
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
15
16
|
import { renderTextBoxFragment } from "./renderTextBox.js";
|
|
16
17
|
import { ownedRowBottomBorderOffsets } from "./tableRowPaintGeometry.js";
|
|
18
|
+
import { TEXT_DIRECTION_FLOW_BY_TOKEN } from "@stll/docx-core/model";
|
|
17
19
|
//#region src/layout-painter/renderTable.ts
|
|
18
20
|
/**
|
|
19
21
|
* Table Renderer
|
|
@@ -40,29 +42,27 @@ const TABLE_CLASS_NAMES = {
|
|
|
40
42
|
const CELL_DIAGONAL_BORDER_CLASS = "layout-table-cell-diagonal-border";
|
|
41
43
|
const CELL_BOTTOM_BORDER_CLASS = "layout-table-cell-bottom-border";
|
|
42
44
|
/**
|
|
43
|
-
* Quarter turn a
|
|
44
|
-
* short spellings Word also writes).
|
|
45
|
+
* Quarter turn a text flow puts on cell content.
|
|
45
46
|
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
47
|
+
* Keyed by flow, not by token: `ST_TextDirection` spells each of these six
|
|
48
|
+
* flows twice, and the two spellings have to turn the same way. `lr` runs
|
|
49
|
+
* bottom-to-top up the left edge, so it turns counter-clockwise; `rl` and
|
|
50
|
+
* `lrV` run down the right edge and turn clockwise. `tb` and `tbV` are the
|
|
51
|
+
* horizontal flows and do not turn at all.
|
|
51
52
|
*
|
|
52
|
-
* Total over the
|
|
53
|
-
* rather than silently falling back to horizontal.
|
|
53
|
+
* Total over the flows on purpose: a flow nobody mapped has to state its turn
|
|
54
|
+
* here rather than silently falling back to horizontal.
|
|
54
55
|
*/
|
|
55
56
|
const CELL_TEXT_ROTATION_DEGREES = {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
rl:
|
|
59
|
-
rlV:
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
tbRl: 90,
|
|
63
|
-
tbRlV: 90,
|
|
64
|
-
btLr: -90
|
|
57
|
+
tb: 0,
|
|
58
|
+
tbV: 0,
|
|
59
|
+
rl: 90,
|
|
60
|
+
rlV: 90,
|
|
61
|
+
lrV: 90,
|
|
62
|
+
lr: -90
|
|
65
63
|
};
|
|
64
|
+
/** The quarter turn a cell's `w:textDirection` puts on its content. */
|
|
65
|
+
const cellTextRotationDegrees = (direction) => direction === void 0 ? 0 : CELL_TEXT_ROTATION_DEGREES[TEXT_DIRECTION_FLOW_BY_TOKEN[direction]];
|
|
66
66
|
function renderCellContent({ cell, cellMeasure, context, doc, contentWidthOverride, pageContentPosition }) {
|
|
67
67
|
const contentEl = doc.createElement("div");
|
|
68
68
|
contentEl.className = TABLE_CLASS_NAMES.cellContent;
|
|
@@ -336,7 +336,7 @@ function renderNestedTable(block, measure, context, doc, frameWidth = context.co
|
|
|
336
336
|
*/
|
|
337
337
|
function applyBorder(el, side, border) {
|
|
338
338
|
const styleProp = `border${side.charAt(0).toUpperCase() + side.slice(1)}`;
|
|
339
|
-
if (!border || border.style
|
|
339
|
+
if (!border || !paintsCssBorder(border.style)) el.style[styleProp] = "none";
|
|
340
340
|
else el.style[styleProp] = borderStrokeToCss(border);
|
|
341
341
|
}
|
|
342
342
|
function renderCellDiagonalBorder({ border, direction, cellWidth, cellHeight, doc }) {
|
|
@@ -415,7 +415,7 @@ function renderTableCell({ cell, cellMeasure, x, width, rowHeight, borderFlags,
|
|
|
415
415
|
default: break;
|
|
416
416
|
}
|
|
417
417
|
}
|
|
418
|
-
const cellTextRotation = cell.textDirection
|
|
418
|
+
const cellTextRotation = cellTextRotationDegrees(cell.textDirection);
|
|
419
419
|
const contentWidthOverride = cellTextRotation === 0 ? void 0 : Math.max(1, rowHeight - padTop - padBottom);
|
|
420
420
|
const renderedContent = renderCellContent({
|
|
421
421
|
cell,
|
|
@@ -479,7 +479,7 @@ function renderTableCell({ cell, cellMeasure, x, width, rowHeight, borderFlags,
|
|
|
479
479
|
}
|
|
480
480
|
return cellEl;
|
|
481
481
|
}
|
|
482
|
-
const hasVisibleBorder = (border) => border !== void 0 && border.style
|
|
482
|
+
const hasVisibleBorder = (border) => border !== void 0 && paintsCssBorder(border.style);
|
|
483
483
|
const isMinimumHeightRow = (row) => row?.height !== void 0 && row.heightRule !== "exact";
|
|
484
484
|
const rowHasVerticalMerge = (row) => row?.cells.some((cell) => (cell.rowSpan ?? 1) > 1) === true;
|
|
485
485
|
const continuationRowBottomBorderOffsets = (fragment, block, measure, cellGrid) => {
|
|
@@ -803,4 +803,4 @@ function renderTableFragment(fragment, block, measure, context, options = {}) {
|
|
|
803
803
|
return tableEl;
|
|
804
804
|
}
|
|
805
805
|
//#endregion
|
|
806
|
-
export { TABLE_CLASS_NAMES, renderNestedTable, renderTableFragment };
|
|
806
|
+
export { TABLE_CLASS_NAMES, cellTextRotationDegrees, renderNestedTable, renderTableFragment };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { layoutTextBoxContent } from "../layout-engine/measure/textBoxParagraphLayout.js";
|
|
2
2
|
import { DEFAULT_TEXTBOX_MARGINS } from "../layout-engine/types.js";
|
|
3
|
+
import { presetDashForOutlineAttr } from "../types/documentEnumValues.js";
|
|
4
|
+
import { cssBorderStyleForDash } from "../utils/borderCss.js";
|
|
3
5
|
import { setAuthoredBackgroundColor } from "./documentColors.js";
|
|
4
6
|
import { renderParagraphFragment } from "./renderParagraph.js";
|
|
5
7
|
import { panic } from "better-result";
|
|
@@ -30,10 +32,10 @@ function renderTextBoxFragment(fragment, block, measure, context, options = {})
|
|
|
30
32
|
containerEl.style.overflow = block.textWrap === "none" ? "visible" : "hidden";
|
|
31
33
|
containerEl.style.boxSizing = "border-box";
|
|
32
34
|
if (block.fillColor) setAuthoredBackgroundColor(containerEl.style, block.fillColor);
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const outlineDash = presetDashForOutlineAttr(block.outlineStyle) ?? "solid";
|
|
36
|
+
if (block.outlineWidth && block.outlineWidth > 0 && outlineDash !== "none") {
|
|
35
37
|
const color = block.outlineColor || "#000000";
|
|
36
|
-
containerEl.style.border = `${block.outlineWidth}px ${
|
|
38
|
+
containerEl.style.border = `${block.outlineWidth}px ${cssBorderStyleForDash(outlineDash)} ${color}`;
|
|
37
39
|
}
|
|
38
40
|
const margins = block.margins ?? DEFAULT_TEXTBOX_MARGINS;
|
|
39
41
|
containerEl.style.padding = `${margins.top}px ${margins.right}px ${margins.bottom}px ${margins.left}px`;
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import { document_d_exports } from "../types/document.js";
|
|
2
2
|
//#region src/managers/autoSaveCodec.d.ts
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Version 3 renamed the model's `bidiWrapper` to `inlineWrapper` and gave it a
|
|
5
|
+
* `kind`. The codec serialises the model itself, so a version-2 envelope holds
|
|
6
|
+
* paragraph content under the old discriminator: the model validator would
|
|
7
|
+
* reject it, and a reader that did not validate would drop the wrapper. The
|
|
8
|
+
* envelope is a local draft of one editing session, so it is refused and
|
|
9
|
+
* re-taken rather than migrated.
|
|
10
|
+
*/
|
|
11
|
+
declare const AUTOSAVE_FORMAT_VERSION = 3;
|
|
4
12
|
type DecodedAutoSave = {
|
|
5
13
|
document: document_d_exports.Document;
|
|
6
14
|
savedAt: string;
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
import { validateFolioDocumentModel } from "../docx/modelValidation.js";
|
|
2
2
|
import { bytesToBase64 } from "../utils/base64.js";
|
|
3
3
|
//#region src/managers/autoSaveCodec.ts
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Version 3 renamed the model's `bidiWrapper` to `inlineWrapper` and gave it a
|
|
6
|
+
* `kind`. The codec serialises the model itself, so a version-2 envelope holds
|
|
7
|
+
* paragraph content under the old discriminator: the model validator would
|
|
8
|
+
* reject it, and a reader that did not validate would drop the wrapper. The
|
|
9
|
+
* envelope is a local draft of one editing session, so it is refused and
|
|
10
|
+
* re-taken rather than migrated.
|
|
11
|
+
*/
|
|
12
|
+
const AUTOSAVE_FORMAT_VERSION = 3;
|
|
5
13
|
const decodeBase64 = (value) => {
|
|
6
14
|
const binary = atob(value);
|
|
7
15
|
const bytes = new Uint8Array(binary.length);
|
|
@@ -80,20 +88,20 @@ const encodeAutoSaveDocument = (document) => {
|
|
|
80
88
|
};
|
|
81
89
|
return { json: JSON.stringify(encodeValue(snapshot)) };
|
|
82
90
|
};
|
|
83
|
-
const encodeAutoSaveEnvelopeFromDocument = (document, savedAt) => `{"document":${document.json},"savedAt":${JSON.stringify(savedAt)},"version":
|
|
91
|
+
const encodeAutoSaveEnvelopeFromDocument = (document, savedAt) => `{"document":${document.json},"savedAt":${JSON.stringify(savedAt)},"version":3}`;
|
|
84
92
|
const encodeAutoSaveEnvelope = (document, savedAt) => encodeAutoSaveEnvelopeFromDocument(encodeAutoSaveDocument(document), savedAt);
|
|
85
93
|
const decodeAutoSaveEnvelope = (json) => {
|
|
86
94
|
try {
|
|
87
95
|
const parsed = JSON.parse(json);
|
|
88
96
|
if (typeof parsed !== "object" || !parsed || !("document" in parsed) || !("savedAt" in parsed) || !("version" in parsed)) return null;
|
|
89
|
-
if (parsed.version !==
|
|
97
|
+
if (parsed.version !== 3 || typeof parsed.savedAt !== "string" || !Number.isFinite(Date.parse(parsed.savedAt))) return null;
|
|
90
98
|
const document = decodeValue(parsed.document);
|
|
91
99
|
if (typeof document !== "object" || !document) return null;
|
|
92
100
|
if (!validateFolioDocumentModel(document).valid) return null;
|
|
93
101
|
return {
|
|
94
102
|
document,
|
|
95
103
|
savedAt: parsed.savedAt,
|
|
96
|
-
version:
|
|
104
|
+
version: 3
|
|
97
105
|
};
|
|
98
106
|
} catch {
|
|
99
107
|
return null;
|
|
@@ -71,6 +71,9 @@ function renderBlocks(ctx, pkg, blocks) {
|
|
|
71
71
|
}
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
|
+
case "preservedBlock":
|
|
75
|
+
case "bookmarkStart":
|
|
76
|
+
case "bookmarkEnd": break;
|
|
74
77
|
default: panic(`Unsupported block content in markdown: ${JSON.stringify(block)}`);
|
|
75
78
|
}
|
|
76
79
|
return out.join("\n");
|
|
@@ -5,6 +5,6 @@ import { RenderContext } from "./types.js";
|
|
|
5
5
|
* Render the full inline content of a paragraph, tracking comment-range
|
|
6
6
|
* boundaries to apply the configured wrapper.
|
|
7
7
|
*/
|
|
8
|
-
declare function renderParagraphInline(ctx: RenderContext, pkg: document_d_exports.DocxPackage | undefined, content: document_d_exports.ParagraphContent[], paraId: string | undefined): string;
|
|
8
|
+
declare function renderParagraphInline(ctx: RenderContext, pkg: document_d_exports.DocxPackage | undefined, content: readonly document_d_exports.ParagraphContent[], paraId: string | undefined): string;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { renderParagraphInline };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getHyperlinkRuns } from "../docx/hyperlinkParser.js";
|
|
1
2
|
import { RELATIONSHIP_TYPES, resolveRelationshipIdOfType } from "../docx/relsParser.js";
|
|
2
3
|
import { decodeOoxmlSymbolCharacter } from "../utils/ooxmlSymbol.js";
|
|
3
4
|
import { wrapComment, wrapDeletion, wrapInsertion, wrapMoveFrom, wrapMoveTo } from "./annotations.js";
|
|
@@ -76,6 +77,9 @@ function renderRunContent(ctx, pkg, content, paraId) {
|
|
|
76
77
|
case "noBreakHyphen":
|
|
77
78
|
out += "‑";
|
|
78
79
|
break;
|
|
80
|
+
case "preservedXml":
|
|
81
|
+
out += escapeInline(item.text);
|
|
82
|
+
break;
|
|
79
83
|
case "footnoteRef":
|
|
80
84
|
case "endnoteRef": {
|
|
81
85
|
if (ctx.opts.footnotes === "strip") break;
|
|
@@ -128,7 +132,7 @@ function renderRun(ctx, pkg, run, paraId) {
|
|
|
128
132
|
return `${lead}${applyMarks(core, marksFor(run))}${trail}`;
|
|
129
133
|
}
|
|
130
134
|
function renderHyperlink(ctx, pkg, link, paraId) {
|
|
131
|
-
const inner = link.
|
|
135
|
+
const inner = getHyperlinkRuns(link).map((run) => renderRun(ctx, pkg, run, paraId)).join("");
|
|
132
136
|
if (!inner) return "";
|
|
133
137
|
const href = link.href ?? (link.anchor ? `#${link.anchor}` : "");
|
|
134
138
|
if (!href) {
|
|
@@ -147,10 +151,23 @@ function renderHyperlink(ctx, pkg, link, paraId) {
|
|
|
147
151
|
}
|
|
148
152
|
function renderTrackedWrapper(ctx, pkg, wrapper, paraId) {
|
|
149
153
|
const renderChild = (child) => {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
switch (child.type) {
|
|
155
|
+
case "run": return renderRun(ctx, pkg, child, paraId);
|
|
156
|
+
case "hyperlink": return renderHyperlink(ctx, pkg, child, paraId);
|
|
157
|
+
case "mathEquation": return child.plainText ? escapeInline(child.plainText) : "";
|
|
158
|
+
case "inlineWrapper":
|
|
159
|
+
case "inlineSdt": return renderParagraphInline(ctx, pkg, child.content, paraId);
|
|
160
|
+
case "insertion":
|
|
161
|
+
case "deletion":
|
|
162
|
+
case "moveFrom":
|
|
163
|
+
case "moveTo": return renderTrackedWrapper(ctx, pkg, child, paraId);
|
|
164
|
+
case "simpleField":
|
|
165
|
+
case "complexField": return renderParagraphInline(ctx, pkg, [child], paraId);
|
|
166
|
+
case "bookmarkStart":
|
|
167
|
+
case "bookmarkEnd":
|
|
168
|
+
case "preservedInline": return "";
|
|
169
|
+
default: return child;
|
|
170
|
+
}
|
|
154
171
|
};
|
|
155
172
|
if (ctx.opts.trackedChanges === "clean") {
|
|
156
173
|
if (wrapper.type === "insertion" || wrapper.type === "moveTo") return wrapper.content.map(renderChild).join("");
|
|
@@ -196,10 +213,21 @@ function renderParagraphInline(ctx, pkg, content, paraId) {
|
|
|
196
213
|
case "simpleField":
|
|
197
214
|
case "complexField": {
|
|
198
215
|
const runs = item.type === "simpleField" ? item.content : item.fieldResult;
|
|
199
|
-
for (const child of runs)
|
|
216
|
+
for (const child of runs) {
|
|
217
|
+
if (child.type === "run") {
|
|
218
|
+
out += renderRun(ctx, pkg, child, paraId);
|
|
219
|
+
continue;
|
|
220
|
+
}
|
|
221
|
+
if (child.type === "hyperlink") {
|
|
222
|
+
out += renderHyperlink(ctx, pkg, child, paraId);
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
out += child.type === "inlineWrapper" ? renderParagraphInline(ctx, pkg, child.content, paraId) : child.text;
|
|
226
|
+
}
|
|
200
227
|
break;
|
|
201
228
|
}
|
|
202
229
|
case "inlineSdt":
|
|
230
|
+
case "inlineWrapper":
|
|
203
231
|
out += renderParagraphInline(ctx, pkg, item.content, paraId);
|
|
204
232
|
break;
|
|
205
233
|
case "mathEquation":
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getHyperlinkRuns } from "../docx/hyperlinkParser.js";
|
|
1
2
|
import { RELATIONSHIP_TYPES, resolveRelationshipIdOfType } from "../docx/relsParser.js";
|
|
2
3
|
import { decodeOoxmlSymbolCharacter } from "../utils/ooxmlSymbol.js";
|
|
3
4
|
import { escapeTableCell } from "./escape.js";
|
|
@@ -113,7 +114,7 @@ function renderHtmlCell(ctx, pkg, cell) {
|
|
|
113
114
|
for (const item of cell.content) if (item.type === "paragraph") {
|
|
114
115
|
const inner = renderHtmlInline(ctx, pkg, item.content, item.paraId);
|
|
115
116
|
if (inner) parts.push(inner);
|
|
116
|
-
} else {
|
|
117
|
+
} else if (item.type === "table") {
|
|
117
118
|
const nested = renderHtmlTable(ctx, pkg, item.rows, true);
|
|
118
119
|
if (nested) parts.push(nested);
|
|
119
120
|
}
|
|
@@ -148,6 +149,7 @@ function renderHtmlInline(ctx, pkg, content, paraId) {
|
|
|
148
149
|
break;
|
|
149
150
|
}
|
|
150
151
|
case "inlineSdt":
|
|
152
|
+
case "inlineWrapper":
|
|
151
153
|
out += renderHtmlInline(ctx, pkg, item.content, paraId);
|
|
152
154
|
break;
|
|
153
155
|
case "mathEquation":
|
|
@@ -159,10 +161,23 @@ function renderHtmlInline(ctx, pkg, content, paraId) {
|
|
|
159
161
|
}
|
|
160
162
|
function renderHtmlChildren(ctx, pkg, children, paraId) {
|
|
161
163
|
return children.map((child) => {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
164
|
+
switch (child.type) {
|
|
165
|
+
case "run": return renderHtmlRun(ctx, pkg, child, paraId);
|
|
166
|
+
case "hyperlink": return renderHtmlHyperlink(ctx, pkg, child, paraId);
|
|
167
|
+
case "mathEquation": return child.plainText ? escapeHtml(child.plainText) : "";
|
|
168
|
+
case "inlineWrapper":
|
|
169
|
+
case "inlineSdt":
|
|
170
|
+
case "simpleField":
|
|
171
|
+
case "complexField":
|
|
172
|
+
case "insertion":
|
|
173
|
+
case "deletion":
|
|
174
|
+
case "moveFrom":
|
|
175
|
+
case "moveTo": return renderHtmlInline(ctx, pkg, [child], paraId);
|
|
176
|
+
case "bookmarkStart":
|
|
177
|
+
case "bookmarkEnd":
|
|
178
|
+
case "preservedInline": return "";
|
|
179
|
+
default: return child;
|
|
180
|
+
}
|
|
166
181
|
}).join("");
|
|
167
182
|
}
|
|
168
183
|
function renderHtmlRun(ctx, pkg, run, paraId) {
|
|
@@ -184,6 +199,9 @@ function renderHtmlRun(ctx, pkg, run, paraId) {
|
|
|
184
199
|
case "noBreakHyphen":
|
|
185
200
|
text += "‑";
|
|
186
201
|
break;
|
|
202
|
+
case "preservedXml":
|
|
203
|
+
text += escapeHtml(item.text);
|
|
204
|
+
break;
|
|
187
205
|
case "softHyphen": break;
|
|
188
206
|
case "drawing": {
|
|
189
207
|
const ref = resolveRelationshipIdOfType(pkg?.relationships, item.image.rId, RELATIONSHIP_TYPES.image);
|
|
@@ -226,7 +244,7 @@ function renderHtmlRun(ctx, pkg, run, paraId) {
|
|
|
226
244
|
return text;
|
|
227
245
|
}
|
|
228
246
|
function renderHtmlHyperlink(ctx, pkg, link, paraId) {
|
|
229
|
-
const inner = link
|
|
247
|
+
const inner = getHyperlinkRuns(link).map((run) => renderHtmlRun(ctx, pkg, run, paraId)).join("");
|
|
230
248
|
if (!inner) return "";
|
|
231
249
|
const href = link.href ?? (link.anchor ? `#${link.anchor}` : "");
|
|
232
250
|
if (!href) return inner;
|
|
@@ -65,12 +65,15 @@ function inlineText(content) {
|
|
|
65
65
|
case "moveFrom":
|
|
66
66
|
case "moveTo":
|
|
67
67
|
case "inlineSdt":
|
|
68
|
-
case "
|
|
68
|
+
case "inlineWrapper":
|
|
69
69
|
out += inlineText(item.content);
|
|
70
70
|
break;
|
|
71
71
|
case "mathEquation":
|
|
72
72
|
out += item.plainText ?? "";
|
|
73
73
|
break;
|
|
74
|
+
case "preservedInline":
|
|
75
|
+
out += item.text;
|
|
76
|
+
break;
|
|
74
77
|
case "bookmarkStart":
|
|
75
78
|
case "bookmarkEnd":
|
|
76
79
|
case "commentRangeStart":
|
package/dist/model.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { document_d_exports } from "./types/document.js";
|
|
2
|
-
import {
|
|
2
|
+
import { CONDITIONAL_STYLE_TYPE_VALUES, COUNTER_FORMAT_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_TEXT_ANCHOR_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_DIRECTION_VALUES, TEXT_EFFECT_VALUES, UNDERLINE_STYLE_VALUES, normalizeShapeTextAnchor, outlineAttrForDash, presetDashForOutlineAttr } from "./types/documentEnumValues.js";
|
|
3
3
|
import { DeriveBlockIdInput, FolioBlockId, currentFolioBlockId, deriveBlankBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isBlankFolioBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
4
4
|
import { types_d_exports } from "./layout-engine/types.js";
|
|
5
5
|
import { measureTypes_d_exports } from "./layout-engine/measure/measureTypes.js";
|
|
6
6
|
export * from "@stll/docx-core/model";
|
|
7
7
|
declare namespace model_d_exports {
|
|
8
|
-
export {
|
|
8
|
+
export { CONDITIONAL_STYLE_TYPE_VALUES, COUNTER_FORMAT_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_TEXT_ANCHOR_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_DIRECTION_VALUES, TEXT_EFFECT_VALUES, UNDERLINE_STYLE_VALUES, currentFolioBlockId, deriveBlankBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isBlankFolioBlockId, isFolioBlockId, isSequentialFolioBlockId, normalizeShapeTextAnchor, outlineAttrForDash, presetDashForOutlineAttr };
|
|
9
9
|
}
|
|
10
10
|
//#endregion
|
|
11
|
-
export {
|
|
11
|
+
export { CONDITIONAL_STYLE_TYPE_VALUES, COUNTER_FORMAT_VALUES, DeriveBlockIdInput, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, FolioBlockId, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_d_exports as Layout, type measureTypes_d_exports as Measure, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIAS_VALUES, OutlineStyleAttr, OutlineStyleCssAlias, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_TEXT_ANCHOR_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_DIRECTION_VALUES, TEXT_EFFECT_VALUES, UNDERLINE_STYLE_VALUES, currentFolioBlockId, deriveBlankBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isBlankFolioBlockId, isFolioBlockId, isSequentialFolioBlockId, normalizeShapeTextAnchor, outlineAttrForDash, presetDashForOutlineAttr };
|
package/dist/model.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { types_exports } from "./layout-engine/types.js";
|
|
2
2
|
import { currentFolioBlockId, deriveBlankBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isBlankFolioBlockId, isFolioBlockId, isSequentialFolioBlockId } from "./types/block-id.js";
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
3
|
+
import { CONDITIONAL_STYLE_TYPE_VALUES, COUNTER_FORMAT_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_TEXT_ANCHOR_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_DIRECTION_VALUES, TEXT_EFFECT_VALUES, UNDERLINE_STYLE_VALUES, normalizeShapeTextAnchor, outlineAttrForDash, presetDashForOutlineAttr } from "./types/documentEnumValues.js";
|
|
4
|
+
export { CONDITIONAL_STYLE_TYPE_VALUES, COUNTER_FORMAT_VALUES, EMPHASIS_MARK_VALUES, FIELD_TYPE_VALUES, FLOATING_TABLE_X_SPEC_VALUES, FLOATING_TABLE_Y_SPEC_VALUES, FONT_HINT_VALUES, FONT_THEME_VALUES, FRAME_WRAP_VALUES, FRAME_X_ALIGN_VALUES, FRAME_Y_ALIGN_VALUES, HIGHLIGHT_COLOR_VALUES, IMAGE_HORIZONTAL_ALIGNMENT_VALUES, IMAGE_HORIZONTAL_RELATIVE_TO_VALUES, IMAGE_VERTICAL_ALIGNMENT_VALUES, IMAGE_VERTICAL_RELATIVE_TO_VALUES, IMAGE_WRAP_TEXT_VALUES, IMAGE_WRAP_TYPE_VALUES, LEVEL_SUFFIX_VALUES, LINE_SPACING_RULE_VALUES, types_exports as Layout, NUMBER_FORMAT_VALUES, OUTLINE_STYLE_ATTR_VALUES, OUTLINE_STYLE_CSS_ALIAS_VALUES, PARAGRAPH_ALIGNMENT_VALUES, POSITIONAL_TAB_ALIGNMENT_VALUES, POSITIONAL_TAB_LEADER_VALUES, POSITIONAL_TAB_RELATIVE_TO_VALUES, SDT_LOCK_VALUES, SDT_TYPE_VALUES, SHADING_PATTERN_VALUES, SHAPE_TEXT_ANCHOR_VALUES, SHAPE_TYPE_VALUES, STYLE_TYPE_VALUES, TABLE_CELL_VERTICAL_ALIGNMENT_VALUES, TABLE_JUSTIFICATION_VALUES, TABLE_ROW_HEIGHT_RULE_VALUES, TABLE_WIDTH_TYPE_VALUES, TAB_LEADER_VALUES, TAB_STOP_ALIGNMENT_VALUES, TEXT_DIRECTION_VALUES, TEXT_EFFECT_VALUES, UNDERLINE_STYLE_VALUES, currentFolioBlockId, deriveBlankBlockId, deriveBlockId, getFolioParaIdFromBlockId, getSequentialFolioBlockIdIndex, isBlankFolioBlockId, isFolioBlockId, isSequentialFolioBlockId, normalizeShapeTextAnchor, outlineAttrForDash, presetDashForOutlineAttr };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { FlowBlock } from "../layout-engine/types.js";
|
|
2
|
+
import { SectionStartAdvance } from "../layout-engine/section-breaks.js";
|
|
2
3
|
import { SectionLayoutConfig } from "../layout-engine/index.js";
|
|
3
4
|
//#region src/paged-layout/sectionBlockWidths.d.ts
|
|
4
5
|
type ComputePerBlockMeasureInput = {
|
|
@@ -27,6 +28,8 @@ type PerBlockMeasureInputs = {
|
|
|
27
28
|
contentLefts: number[];
|
|
28
29
|
columnIndices: number[];
|
|
29
30
|
columnCounts: number[];
|
|
31
|
+
/** Resolved paginator transition at each section-break block. */
|
|
32
|
+
sectionAdvances: (SectionStartAdvance | undefined)[];
|
|
30
33
|
physicalPageGeometry: PerBlockPhysicalPageGeometry;
|
|
31
34
|
};
|
|
32
35
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { collectSectionConfigs } from "../layout-engine/index.js";
|
|
2
2
|
import { hasPageBreakBefore } from "../layout-engine/keep-together.js";
|
|
3
3
|
import { calculateColumnLefts, calculateColumnWidths } from "../layout-engine/paginator.js";
|
|
4
|
-
import {
|
|
4
|
+
import { physicalColumnRegionIsShared, sectionStartAdvanceOf } from "../layout-engine/section-breaks.js";
|
|
5
5
|
//#region src/paged-layout/sectionBlockWidths.ts
|
|
6
6
|
function resolvePreBlockPageTransition(block, config) {
|
|
7
7
|
if (!hasPageBreakBefore(block)) return { type: "none" };
|
|
@@ -57,11 +57,13 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
57
57
|
const contentLefts = [];
|
|
58
58
|
const columnIndices = [];
|
|
59
59
|
const columnCounts = [];
|
|
60
|
+
const sectionAdvances = [];
|
|
60
61
|
const initialConfig = sectionConfigs[0] ?? finalConfig;
|
|
61
62
|
let physicalPageGeometry = {
|
|
62
63
|
pageSize: initialConfig.pageSize,
|
|
63
64
|
margins: initialConfig.margins
|
|
64
65
|
};
|
|
66
|
+
let hasPhysicalPage = false;
|
|
65
67
|
let hasPhysicalPageContent = false;
|
|
66
68
|
for (let i = 0; i < blocks.length; i++) {
|
|
67
69
|
const config = sectionConfigs[sectionIdx] ?? finalConfig;
|
|
@@ -70,6 +72,7 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
70
72
|
switch (preBlockTransition.type) {
|
|
71
73
|
case "physicalPage":
|
|
72
74
|
physicalPageGeometry = preBlockTransition.geometry;
|
|
75
|
+
hasPhysicalPage = true;
|
|
73
76
|
hasPhysicalPageContent = false;
|
|
74
77
|
columnGeometryDirty = true;
|
|
75
78
|
columnIndex = 0;
|
|
@@ -88,6 +91,7 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
88
91
|
contentLefts.push(activeContentLefts[columnIndex] ?? physicalPageGeometry.margins.left);
|
|
89
92
|
columnIndices.push(columnIndex);
|
|
90
93
|
columnCounts.push(activeColumns.count);
|
|
94
|
+
sectionAdvances.push(void 0);
|
|
91
95
|
marginTops.push(config.margins.top);
|
|
92
96
|
physicalMarginTops.push(physicalPageGeometry.margins.top);
|
|
93
97
|
pageHeights.push(config.pageSize.h);
|
|
@@ -103,21 +107,34 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
103
107
|
if (sectionIdx < breakIndices.length && i === breakIndices[sectionIdx]) {
|
|
104
108
|
const sectionBreak = block;
|
|
105
109
|
const nextConfig = sectionConfigs[sectionIdx + 1] ?? finalConfig;
|
|
106
|
-
|
|
110
|
+
const advance = sectionBreak?.kind === "sectionBreak" ? sectionStartAdvanceOf(sectionBreak.type) : "page";
|
|
111
|
+
const sharesColumnRegion = hasPhysicalPage && advance === "column" && physicalColumnRegionIsShared({
|
|
112
|
+
...physicalPageGeometry,
|
|
113
|
+
columns: activeColumns
|
|
114
|
+
}, nextConfig);
|
|
115
|
+
const continuesInNextColumn = sharesColumnRegion && columnIndex + 1 < activeColumns.count;
|
|
116
|
+
const pageSizeIsShared = Math.round(nextConfig.pageSize.w) === Math.round(physicalPageGeometry.pageSize.w) && Math.round(nextConfig.pageSize.h) === Math.round(physicalPageGeometry.pageSize.h);
|
|
117
|
+
let sectionAdvance = "region";
|
|
118
|
+
if (advance === "page" || !pageSizeIsShared || sharesColumnRegion && !continuesInNextColumn) sectionAdvance = "page";
|
|
119
|
+
else if (continuesInNextColumn) sectionAdvance = "column";
|
|
120
|
+
sectionAdvances[i] = sectionAdvance;
|
|
121
|
+
if (!(sectionAdvance === "column" || sectionAdvance === "region" && hasPhysicalPageContent)) {
|
|
107
122
|
physicalPageGeometry = {
|
|
108
123
|
pageSize: nextConfig.pageSize,
|
|
109
124
|
margins: nextConfig.margins
|
|
110
125
|
};
|
|
111
126
|
hasPhysicalPageContent = false;
|
|
112
127
|
}
|
|
128
|
+
if (sectionAdvance === "page") hasPhysicalPage = true;
|
|
113
129
|
columnGeometryDirty = true;
|
|
114
130
|
sectionIdx++;
|
|
115
|
-
columnIndex = 0;
|
|
131
|
+
columnIndex = sectionAdvance === "column" ? columnIndex + 1 : 0;
|
|
116
132
|
} else if (block.kind === "pageBreak") {
|
|
117
133
|
physicalPageGeometry = {
|
|
118
134
|
pageSize: config.pageSize,
|
|
119
135
|
margins: config.margins
|
|
120
136
|
};
|
|
137
|
+
hasPhysicalPage = true;
|
|
121
138
|
hasPhysicalPageContent = false;
|
|
122
139
|
columnGeometryDirty = true;
|
|
123
140
|
columnIndex = 0;
|
|
@@ -130,8 +147,12 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
130
147
|
hasPhysicalPageContent = false;
|
|
131
148
|
columnGeometryDirty = true;
|
|
132
149
|
}
|
|
150
|
+
hasPhysicalPage = true;
|
|
133
151
|
columnIndex = (columnIndex + 1) % activeColumns.count;
|
|
134
|
-
} else
|
|
152
|
+
} else {
|
|
153
|
+
hasPhysicalPage = true;
|
|
154
|
+
hasPhysicalPageContent = true;
|
|
155
|
+
}
|
|
135
156
|
}
|
|
136
157
|
return {
|
|
137
158
|
widths,
|
|
@@ -144,6 +165,7 @@ function computePerBlockMeasureInputs({ blocks, bodyConfig, finalConfig }) {
|
|
|
144
165
|
contentLefts,
|
|
145
166
|
columnIndices,
|
|
146
167
|
columnCounts,
|
|
168
|
+
sectionAdvances,
|
|
147
169
|
physicalPageGeometry: {
|
|
148
170
|
pageHeights: physicalPageHeights,
|
|
149
171
|
pageWidths: physicalPageWidths,
|