@stll/folio-core 0.15.0 → 0.15.2
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.d.ts +2 -2
- package/dist/ai-edits/blockRange.d.ts +3 -17
- package/dist/ai-edits/clean-text.d.ts +0 -1
- package/dist/ai-edits/headless.d.ts +23 -19
- package/dist/ai-edits/read.d.ts +8 -5
- package/dist/ai-edits/scoped-reading.d.ts +0 -1
- package/dist/ai-edits/snapshot.d.ts +1 -7
- package/dist/ai-edits/table-cell-mutations.d.ts +4 -31
- package/dist/ai-edits/table-row-column-mutations.d.ts +9 -39
- package/dist/ai-edits/table-targets.d.ts +0 -1
- package/dist/ai-edits/types.d.ts +32 -17
- package/dist/ai-suggestions/apply.d.ts +0 -1
- package/dist/ai-suggestions/conflict.d.ts +0 -1
- package/dist/ai-suggestions/text-positions.d.ts +2 -2
- package/dist/ai-suggestions/types.d.ts +27 -13
- package/dist/content-controls/errors.d.ts +0 -1
- package/dist/content-controls/findContentControls.d.ts +6 -4
- package/dist/content-controls/mutateContentControls.d.ts +0 -1
- package/dist/controller/activeEditorStory.d.ts +1 -6
- package/dist/controller/collaborationModules.d.ts +0 -1
- package/dist/controller/contentControlWidgetController.d.ts +0 -1
- package/dist/controller/folioEditor.d.ts +2 -2
- package/dist/controller/folioEditorEvents.d.ts +5 -3
- package/dist/controller/fontReadiness.d.ts +0 -1
- package/dist/controller/headerFooterEditorManager.d.ts +1 -5
- package/dist/controller/hiddenEditorApi.d.ts +35 -18
- package/dist/controller/hiddenEditorManager.d.ts +5 -3
- package/dist/controller/latestRequestGate.d.ts +3 -1
- package/dist/controller/layoutPipeline.d.ts +1 -1
- package/dist/controller/layoutScheduler.d.ts +8 -5
- package/dist/controller/layoutSession.d.ts +0 -1
- package/dist/controller/noteEditorManager.d.ts +0 -1
- package/dist/document-operations.d.ts +5 -12
- package/dist/document-stories.d.ts +0 -1
- package/dist/docx/blockContentParser.d.ts +0 -1
- package/dist/docx/blockContentParser.js +1 -0
- package/dist/docx/bookmarkParser.d.ts +5 -3
- package/dist/docx/bookmarkPlacement.d.ts +0 -1
- package/dist/docx/commentParser.d.ts +0 -1
- package/dist/docx/commentParser.js +30 -2
- package/dist/docx/commentRangeIntegrity.d.ts +0 -1
- package/dist/docx/commentReferenceNormalization.d.ts +1 -9
- package/dist/docx/commentReplyMarkers.d.ts +0 -1
- package/dist/docx/compatibility.d.ts +0 -1
- package/dist/docx/conformance.d.ts +0 -1
- package/dist/docx/corePropertiesParser.d.ts +0 -1
- package/dist/docx/documentParser.d.ts +0 -1
- package/dist/docx/documentParser.js +3 -1
- package/dist/docx/drawingIdNormalization.d.ts +5 -0
- package/dist/docx/drawingIdNormalization.js +35 -0
- package/dist/docx/drawingUtils.d.ts +24 -3
- package/dist/docx/drawingUtils.js +134 -28
- package/dist/docx/encryption/agileDecryption.d.ts +0 -1
- package/dist/docx/encryption/cryptoBytes.js +4 -1
- package/dist/docx/encryption/openEncryptedDocx.d.ts +5 -2
- package/dist/docx/ensureParaIds.d.ts +7 -3
- package/dist/docx/fieldParser.d.ts +23 -11
- package/dist/docx/fontTableParser.d.ts +0 -1
- package/dist/docx/footnoteParser.d.ts +26 -13
- package/dist/docx/footnoteParser.js +4 -2
- package/dist/docx/groupDrawingParser.d.ts +0 -1
- package/dist/docx/headerFooterParser.d.ts +9 -5
- package/dist/docx/headerFooterRefParser.d.ts +0 -1
- package/dist/docx/headerFooterReferenceNormalization.d.ts +1 -6
- package/dist/docx/headerFooterVerbatim.d.ts +4 -3
- package/dist/docx/headerFooterVerbatim.js +6 -1
- package/dist/docx/hyperlinkParser.d.ts +0 -1
- package/dist/docx/hyperlinkParser.js +1 -9
- package/dist/docx/imageParser.d.ts +0 -1
- package/dist/docx/imageParser.js +15 -7
- package/dist/docx/mathToMathml.d.ts +0 -1
- package/dist/docx/metadataPrivacy.d.ts +1 -3
- package/dist/docx/modelValidation.d.ts +0 -1
- package/dist/docx/newImage.d.ts +11 -0
- package/dist/docx/newImage.js +11 -0
- package/dist/docx/normalizeBaseDirection.d.ts +0 -1
- package/dist/docx/notePropertiesParser.d.ts +0 -1
- package/dist/docx/numberingParser.d.ts +10 -6
- package/dist/docx/numberingParser.js +4 -2
- package/dist/docx/numberingReferenceNormalization.d.ts +1 -9
- package/dist/docx/paragraphParser.d.ts +0 -1
- package/dist/docx/paragraphParser.js +31 -15
- package/dist/docx/paragraphTextBoxEnrichment.d.ts +0 -1
- package/dist/docx/paragraphTextBoxEnrichment.js +2 -1
- package/dist/docx/paragraphTraversal.d.ts +5 -10
- package/dist/docx/paragraphTraversal.js +20 -13
- package/dist/docx/parser.d.ts +15 -8
- package/dist/docx/parser.js +22 -1
- package/dist/docx/parserEnums.d.ts +5 -2
- package/dist/docx/parserEnums.js +6 -2
- package/dist/docx/relsParser.d.ts +1 -0
- package/dist/docx/renderedPageBreakNormalization.d.ts +12 -0
- package/dist/docx/renderedPageBreakNormalization.js +59 -0
- package/dist/docx/replyToComment.d.ts +2 -2
- package/dist/docx/rezip.d.ts +6 -7
- package/dist/docx/rezip.js +136 -102
- package/dist/docx/runConsolidator.d.ts +0 -1
- package/dist/docx/runConsolidator.js +0 -1
- package/dist/docx/runParser.d.ts +0 -1
- package/dist/docx/runParser.js +25 -12
- package/dist/docx/sdtProperties.d.ts +0 -1
- package/dist/docx/sdtPropertiesPatch.d.ts +0 -1
- package/dist/docx/sectionParser.d.ts +0 -1
- package/dist/docx/selectiveSave.d.ts +5 -3
- package/dist/docx/selectiveSave.js +2 -2
- package/dist/docx/selectiveSaveFlags.d.ts +4 -2
- package/dist/docx/selectiveXmlPatch.js +20 -8
- package/dist/docx/serializer/blockSdtSerializer.d.ts +0 -1
- package/dist/docx/serializer/blockSdtSerializer.js +2 -1
- package/dist/docx/serializer/borderSerializer.d.ts +0 -1
- package/dist/docx/serializer/commentSerializer.d.ts +0 -1
- package/dist/docx/serializer/commentSerializer.js +19 -40
- package/dist/docx/serializer/documentSerializer.d.ts +0 -1
- package/dist/docx/serializer/documentSerializer.js +1 -1
- package/dist/docx/serializer/fontTableSerializer.d.ts +0 -1
- package/dist/docx/serializer/headerFooterSerializer.d.ts +0 -1
- package/dist/docx/serializer/headerFooterSerializer.js +1 -1
- package/dist/docx/serializer/noteSerializer.d.ts +0 -1
- package/dist/docx/serializer/noteSerializer.js +1 -1
- package/dist/docx/serializer/numberingSerializer.d.ts +0 -1
- package/dist/docx/serializer/paragraphSerializer.d.ts +0 -1
- package/dist/docx/serializer/paragraphSerializer.js +10 -23
- package/dist/docx/serializer/runSerializer.d.ts +0 -1
- package/dist/docx/serializer/runSerializer.js +53 -32
- package/dist/docx/serializer/sectionPropertiesSerializer.d.ts +0 -1
- package/dist/docx/serializer/sectionPropertiesSerializer.js +7 -5
- package/dist/docx/serializer/settingsSerializer.d.ts +0 -1
- package/dist/docx/serializer/stylesSerializer.d.ts +0 -1
- package/dist/docx/serializer/tableSerializer.d.ts +0 -1
- package/dist/docx/serializer/tableSerializer.js +2 -0
- package/dist/docx/serializer/themeSerializer.d.ts +0 -1
- package/dist/docx/serializer/xmlUtils.js +10 -1
- package/dist/docx/server/applyDocxXmlPatchProposal.d.ts +3 -10
- package/dist/docx/server/docxToMarkdown.d.ts +0 -1
- package/dist/docx/server/evaluateDocxXmlPatchProposal.d.ts +3 -9
- package/dist/docx/server/inspectDocxPackage.d.ts +3 -8
- package/dist/docx/server/validateDocxConformance.d.ts +0 -1
- package/dist/docx/settingsParser.d.ts +2 -2
- package/dist/docx/shapeParser.d.ts +0 -1
- package/dist/docx/shapeParser.js +16 -123
- package/dist/docx/streamingXmlParser.d.ts +16 -0
- package/dist/docx/streamingXmlParser.js +248 -0
- package/dist/docx/styleParser.d.ts +0 -1
- package/dist/docx/styleParser.js +6 -4
- package/dist/docx/tableParser.d.ts +1 -2
- package/dist/docx/tableParser.js +11 -12
- package/dist/docx/textBoxParser.d.ts +1 -2
- package/dist/docx/textBoxParser.js +5 -2
- package/dist/docx/textWhitespace.d.ts +4 -0
- package/dist/docx/textWhitespace.js +4 -0
- package/dist/docx/themeParser.d.ts +0 -1
- package/dist/docx/trackedMoveRangeNormalization.d.ts +1 -8
- package/dist/docx/unzip.d.ts +6 -3
- package/dist/docx/unzip.js +96 -40
- package/dist/docx/vmlImageParser.d.ts +0 -1
- package/dist/docx/vmlImageParser.js +3 -1
- package/dist/docx/watermarkParser.d.ts +0 -1
- package/dist/docx/xmlParser.d.ts +21 -8
- package/dist/docx/xmlParser.js +126 -43
- package/dist/fields/bookmarkPages.d.ts +0 -1
- package/dist/fields/bookmarkText.d.ts +0 -1
- package/dist/fields/evaluateField.d.ts +5 -3
- package/dist/fields/fieldContext.d.ts +11 -5
- package/dist/fields/resolveFieldValues.d.ts +4 -3
- package/dist/fields/sectionPageCounts.d.ts +0 -1
- package/dist/fields/seqValues.d.ts +0 -1
- package/dist/fonts/embeddedFontTable.d.ts +5 -2
- package/dist/fonts/embeddedFonts.d.ts +15 -7
- package/dist/index.d.ts +1 -0
- package/dist/layout-bridge/cellSelectionHighlight.d.ts +0 -1
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +5 -3
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +2 -2
- package/dist/layout-bridge/convert/paragraphFrames.d.ts +0 -1
- package/dist/layout-bridge/convert/templatePreviewFlow.d.ts +8 -8
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +25 -13
- package/dist/layout-bridge/convert/wrapEditorViewAsSurface.d.ts +3 -2
- package/dist/layout-bridge/dom/findHfPmSpans.d.ts +2 -1
- package/dist/layout-bridge/dom/noteStoryDom.d.ts +0 -1
- package/dist/layout-bridge/engine/clickToPosition.d.ts +5 -3
- package/dist/layout-bridge/engine/hitTest.d.ts +40 -19
- package/dist/layout-bridge/engine/selectionRects.d.ts +16 -8
- package/dist/layout-bridge/engine/tableWidthUtils.d.ts +0 -1
- package/dist/layout-bridge/headerFooterLayout.d.ts +0 -1
- package/dist/layout-bridge/sectionColumns.d.ts +0 -1
- package/dist/layout-bridge/tableInsertHover.d.ts +8 -4
- package/dist/layout-engine/headerFooterRefs.d.ts +0 -1
- package/dist/layout-engine/index.d.ts +0 -1
- package/dist/layout-engine/justificationCompatibility.d.ts +0 -1
- package/dist/layout-engine/keep-together.d.ts +7 -4
- package/dist/layout-engine/layoutInstrumentation.d.ts +0 -1
- package/dist/layout-engine/lineFlow.d.ts +0 -1
- package/dist/layout-engine/measure/cache.d.ts +0 -1
- package/dist/layout-engine/measure/effectiveLineBreakPolicy.d.ts +6 -7
- package/dist/layout-engine/measure/floatingTablePosition.d.ts +0 -1
- package/dist/layout-engine/measure/floatingZones.d.ts +14 -6
- package/dist/layout-engine/measure/font-metrics.worker.d.ts +0 -1
- package/dist/layout-engine/measure/lineBreakProvider.d.ts +20 -9
- package/dist/layout-engine/measure/lineBreaks.d.ts +0 -1
- package/dist/layout-engine/measure/listMarkerWidth.d.ts +0 -1
- package/dist/layout-engine/measure/measureBlocks.d.ts +1 -0
- package/dist/layout-engine/measure/measureContainer.d.ts +0 -1
- package/dist/layout-engine/measure/measureHelpers.d.ts +0 -1
- package/dist/layout-engine/measure/measureParagraph.d.ts +3 -2
- package/dist/layout-engine/measure/measureParagraph.js +23 -3
- package/dist/layout-engine/measure/measureProvider.d.ts +0 -1
- package/dist/layout-engine/measure/measureTypes.d.ts +4 -2
- package/dist/layout-engine/measure/measureWorker.d.ts +0 -1
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +0 -1
- package/dist/layout-engine/measure/tableCellFloating.d.ts +0 -1
- package/dist/layout-engine/measure/tableCellFlow.d.ts +0 -1
- package/dist/layout-engine/measure/tableCellGrid.d.ts +0 -1
- package/dist/layout-engine/measure/textBoxParagraphLayout.d.ts +0 -1
- package/dist/layout-engine/measure/textMeasurementPolicy.d.ts +0 -1
- package/dist/layout-engine/paginator.d.ts +66 -33
- package/dist/layout-engine/paragraphFragmentRange.d.ts +0 -1
- package/dist/layout-engine/paragraphFrame.d.ts +0 -1
- package/dist/layout-engine/paragraphSequence.d.ts +0 -1
- package/dist/layout-engine/paragraphSpacing.d.ts +1 -5
- package/dist/layout-engine/pmPageIndex.d.ts +0 -1
- package/dist/layout-engine/renderedBreakReconciliation.d.ts +2 -17
- package/dist/layout-engine/section-breaks.d.ts +34 -17
- package/dist/layout-engine/tableRowBreak.d.ts +4 -3
- package/dist/layout-engine/textBoxFlow.d.ts +0 -1
- package/dist/layout-engine/textBoxGroup.d.ts +0 -1
- package/dist/layout-engine/types.d.ts +382 -189
- package/dist/layout-painter/anchoredImagePosition.d.ts +0 -1
- package/dist/layout-painter/borderStroke.d.ts +0 -1
- package/dist/layout-painter/imageLayout.d.ts +14 -7
- package/dist/layout-painter/index.d.ts +9 -5
- package/dist/layout-painter/registry/modules/image.d.ts +0 -1
- package/dist/layout-painter/registry/modules/paragraph.d.ts +0 -1
- package/dist/layout-painter/registry/modules/table.d.ts +0 -1
- package/dist/layout-painter/registry/modules/textBox.d.ts +0 -1
- package/dist/layout-painter/registry/modules.d.ts +0 -1
- package/dist/layout-painter/registry/registry.d.ts +0 -1
- package/dist/layout-painter/registry/types.d.ts +0 -1
- package/dist/layout-painter/renderFragment.d.ts +2 -2
- package/dist/layout-painter/renderImage.d.ts +0 -1
- package/dist/layout-painter/renderPage.d.ts +71 -42
- package/dist/layout-painter/renderParagraph.d.ts +28 -14
- package/dist/layout-painter/renderParagraph.js +6 -2
- package/dist/layout-painter/renderTable.d.ts +0 -1
- package/dist/layout-painter/renderTextBox.d.ts +0 -1
- package/dist/layout-painter/renderUtils.d.ts +17 -9
- package/dist/layout-painter/renderWatermark.d.ts +2 -2
- package/dist/layout-painter/sdtBoundary.d.ts +0 -1
- package/dist/managers/AutoSaveManager.d.ts +22 -11
- package/dist/managers/ClipboardManager.d.ts +0 -1
- package/dist/managers/ContextMenuManager.d.ts +5 -8
- package/dist/managers/DocumentLoaderManager.d.ts +12 -6
- package/dist/managers/EditorModeManager.d.ts +3 -2
- package/dist/managers/ErrorManager.d.ts +0 -1
- package/dist/managers/FindReplaceManager.d.ts +0 -1
- package/dist/managers/HistoryManager.d.ts +19 -9
- package/dist/managers/TableSelectionManager.d.ts +0 -1
- package/dist/managers/editorShortcuts.d.ts +4 -6
- package/dist/markdown/annotations.d.ts +0 -1
- package/dist/markdown/fromMarkdown.d.ts +0 -1
- package/dist/markdown/images.d.ts +0 -1
- package/dist/markdown/index.d.ts +0 -1
- package/dist/markdown/internals.d.ts +0 -1
- package/dist/markdown/renderBlock.d.ts +0 -1
- package/dist/markdown/renderParagraph.d.ts +0 -1
- package/dist/markdown/renderRuns.d.ts +0 -1
- package/dist/markdown/renderTable.d.ts +0 -1
- package/dist/markdown/trailers.d.ts +0 -1
- package/dist/markdown/types.d.ts +39 -18
- package/dist/model.d.ts +3 -5
- package/dist/model.js +2 -2
- package/dist/paged-layout/incrementalMeasure.d.ts +1 -10
- package/dist/paged-layout/pageText.d.ts +1 -1
- package/dist/paged-layout/paragraphFlash.d.ts +0 -1
- package/dist/paged-layout/paragraphFlashTypes.d.ts +5 -2
- package/dist/paged-layout/rangeProjection.d.ts +10 -5
- package/dist/paged-layout/scrollNavigation.d.ts +0 -1
- package/dist/paged-layout/scrollPageInfo.d.ts +12 -13
- package/dist/paged-layout/scrollToPmPosition.d.ts +0 -1
- package/dist/paged-layout/sectionBlockWidths.d.ts +2 -11
- package/dist/paged-layout/sectionGeometry.d.ts +0 -1
- package/dist/paged-layout/selectionViewportRect.d.ts +0 -1
- package/dist/paged-layout/transactionDirtyRange.d.ts +0 -1
- package/dist/paged-layout/zoomScrollAnchor.d.ts +2 -12
- package/dist/prosemirror/attrs/index.d.ts +6 -4
- package/dist/prosemirror/attrs/index.js +22 -2
- package/dist/prosemirror/autospacingBase.d.ts +0 -1
- package/dist/prosemirror/cellDragSelection.d.ts +6 -4
- package/dist/prosemirror/commands/comments.d.ts +6 -4
- package/dist/prosemirror/commands/contentControls.d.ts +5 -3
- package/dist/prosemirror/commands/contentControlsBlockFill.d.ts +1 -1
- package/dist/prosemirror/commands/formatPainter.d.ts +0 -1
- package/dist/prosemirror/commands/formatting.d.ts +1 -1
- package/dist/prosemirror/commands/hyperlink.d.ts +4 -9
- package/dist/prosemirror/commands/image.d.ts +0 -1
- package/dist/prosemirror/commands/pageBreak.d.ts +0 -1
- package/dist/prosemirror/commands/paragraph.d.ts +0 -1
- package/dist/prosemirror/commands/pastePlainText.d.ts +0 -1
- package/dist/prosemirror/commands/propertyChangeScope.d.ts +0 -1
- package/dist/prosemirror/commands/sectionBreak.d.ts +0 -1
- package/dist/prosemirror/commands/table.d.ts +0 -1
- package/dist/prosemirror/commands/tableCellMergeResolution.d.ts +0 -1
- package/dist/prosemirror/commentIdAllocator.d.ts +2 -2
- package/dist/prosemirror/commentOps.d.ts +0 -1
- package/dist/prosemirror/conversion/effectiveTableCellFormatting.d.ts +1 -10
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +0 -1
- package/dist/prosemirror/conversion/fromProseDoc.js +17 -10
- package/dist/prosemirror/conversion/runShadingMark.d.ts +0 -1
- package/dist/prosemirror/conversion/sdtAttrs.d.ts +0 -1
- package/dist/prosemirror/conversion/toProseDoc.d.ts +3 -2
- package/dist/prosemirror/conversion/toProseDoc.js +17 -3
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +0 -1
- package/dist/prosemirror/extensions/StarterKit.d.ts +7 -4
- package/dist/prosemirror/extensions/core/DocExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/core/TextExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/create.d.ts +0 -1
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/DropCursorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/GapCursorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ImageDragExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ImagePasteExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ListExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +7 -4
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/features/bidiShortcutController.d.ts +3 -1
- package/dist/prosemirror/extensions/marks/AllCapsExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/BoldExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/CharacterStyleExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/CommentExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.js +1 -0
- package/dist/prosemirror/extensions/marks/FontSizeExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/HiddenTextExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/HighlightExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/ItalicExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/LanguageExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/RtlExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/RunShadingExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/SmallCapsExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/StrikeExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/SubscriptExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/TextColorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/TextEffectExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/UnderlineExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +0 -1
- package/dist/prosemirror/extensions/marks/markUtils.js +4 -1
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/ImageExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +2 -0
- package/dist/prosemirror/extensions/nodes/MathExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/PageBreakExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/RenderedPageBreakExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/ShapeExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +2 -0
- package/dist/prosemirror/extensions/nodes/TabExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/TabExtension.js +32 -9
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +4 -3
- package/dist/prosemirror/extensions/nodes/TextBoxAnchorExtension.d.ts +0 -1
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +53 -27
- package/dist/prosemirror/extensions/types.d.ts +0 -1
- package/dist/prosemirror/findReplaceSelection.d.ts +5 -3
- package/dist/prosemirror/imageCommit.d.ts +0 -1
- package/dist/prosemirror/index.d.ts +4 -0
- package/dist/prosemirror/insertOperations.d.ts +0 -1
- package/dist/prosemirror/paraText.d.ts +0 -1
- package/dist/prosemirror/plugins/aiCitationDecorations.d.ts +2 -2
- package/dist/prosemirror/plugins/aiSuggestionDecorations.d.ts +0 -1
- package/dist/prosemirror/plugins/anonymizationDecorations.d.ts +9 -7
- package/dist/prosemirror/plugins/autocompleteSuggestion.d.ts +2 -2
- package/dist/prosemirror/plugins/contentControlWidgets.d.ts +4 -7
- package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +3 -8
- package/dist/prosemirror/plugins/documentStyles.d.ts +0 -1
- package/dist/prosemirror/plugins/pmTextScan.d.ts +2 -2
- package/dist/prosemirror/plugins/revisionIds.d.ts +0 -1
- package/dist/prosemirror/plugins/selectionTracker.d.ts +23 -12
- package/dist/prosemirror/plugins/suggestionMode.d.ts +0 -1
- package/dist/prosemirror/plugins/templateDirectives.d.ts +10 -8
- package/dist/prosemirror/plugins/templatePreviewValues.d.ts +10 -5
- package/dist/prosemirror/plugins/templateSlashMenu.d.ts +2 -2
- package/dist/prosemirror/queries.d.ts +0 -1
- package/dist/prosemirror/schema/index.d.ts +2 -3
- package/dist/prosemirror/schema/marks.d.ts +8 -5
- package/dist/prosemirror/schema/nodes.d.ts +344 -164
- package/dist/prosemirror/selectionState.d.ts +13 -7
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +0 -1
- package/dist/prosemirror/styles/styleResolver.d.ts +3 -2
- package/dist/prosemirror/tableCellMergeRevision.d.ts +0 -1
- package/dist/prosemirror/tableResize.d.ts +0 -1
- package/dist/prosemirror/textBoxAnchorAttrs.d.ts +0 -1
- package/dist/prosemirror/utils/extractTrackedChanges.d.ts +8 -5
- package/dist/prosemirror/utils/findParagraphByParaId.d.ts +0 -1
- package/dist/prosemirror/utils/tabCalculator.d.ts +18 -7
- package/dist/prosemirror/utils/visualLineNavigation.d.ts +0 -1
- package/dist/prosemirror/validation.d.ts +0 -1
- package/dist/prosemirror/validation.js +5 -3
- package/dist/redline.d.ts +16 -8
- package/dist/render-dom/BodySelectionOverlay.d.ts +1 -9
- package/dist/render-dom/HeaderFooterSelectionOverlay.d.ts +0 -1
- package/dist/render-dom/RemoteSelectionOverlay.d.ts +1 -8
- package/dist/render-dom/resolveSidebarItemPositions.d.ts +1 -9
- package/dist/style-engine/styleEngine.d.ts +21 -11
- package/dist/style-sets/extract.d.ts +4 -3
- package/dist/style-sets/stellaStyle.d.ts +0 -1
- package/dist/style-sets/types.d.ts +0 -1
- package/dist/symbols.d.ts +6 -2
- package/dist/types/block-id.d.ts +3 -6
- package/dist/types/content.d.ts +2 -2
- package/dist/types/document.d.ts +0 -3
- package/dist/types/documentEnumValues.d.ts +5 -1
- package/dist/types/documentEnumValues.js +19 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/utils/clipboard.d.ts +17 -8
- package/dist/utils/colorResolver.d.ts +9 -5
- package/dist/utils/createDocument.d.ts +19 -10
- package/dist/utils/documentLoaderBehavior.d.ts +1 -5
- package/dist/utils/docxInput.js +1 -0
- package/dist/utils/findReplace.d.ts +0 -1
- package/dist/utils/fontFamilyMerge.d.ts +0 -1
- package/dist/utils/fontResolver.d.ts +10 -4
- package/dist/utils/formatToStyle.d.ts +0 -1
- package/dist/utils/headerFooter.d.ts +8 -16
- package/dist/utils/headingCollector.d.ts +7 -4
- package/dist/utils/mergeDocumentContent.d.ts +0 -1
- package/dist/utils/paragraphFormattingMerge.d.ts +0 -1
- package/dist/utils/replaceText.d.ts +0 -1
- package/dist/utils/rotationBoundingBox.d.ts +0 -1
- package/dist/utils/tableOperations.d.ts +0 -1
- package/dist/utils/textFormattingMerge.d.ts +0 -1
- package/dist/version-comparison.d.ts +12 -6
- package/dist/watermark/index.d.ts +0 -1
- package/package.json +3 -3
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { OutlineStyleAttr } from "../types/documentEnumValues.js";
|
|
2
2
|
import { ImagePosition, ImageWrap, SdtProperties, SdtType, ShapeTextBody, TableCellFormatting, TableWidthType } from "@stll/docx-core/model";
|
|
3
|
-
|
|
4
|
-
//#region src/layout-engine/types.d.ts
|
|
5
3
|
declare namespace types_d_exports {
|
|
6
4
|
export { BlockId, BorderStyle, CellBorderSpec, CellBorders, ColumnBreakBlock, ColumnBreakMeasure, ColumnLayout, DEFAULT_TEXTBOX_MARGINS, DEFAULT_TEXTBOX_WIDTH, DocumentPosition, FOOTNOTE_ENTRY_MARGIN_BOTTOM, FOOTNOTE_FALLBACK_LINE_HEIGHT, FOOTNOTE_SEPARATOR_HEIGHT, FieldRun, FloatingTablePosition, FlowBlock, FootnoteContent, Fragment, FragmentBase, HeaderFooterContent, HeaderFooterContentHeights, HeaderFooterLayout, HitTestResult, HyperlinkInfo, ImageBlock, ImageFragment, ImageMeasure, ImageRun, ImageRunPosition, Layout, LayoutOptions, LineBreakRun, ListNumPr, MathRun, Measure, MeasuredLine, Page, PageBreakBlock, PageBreakMeasure, PageHeaderFooterRefs, PageMargins, ParagraphAttrs, ParagraphBlock, ParagraphBorders, ParagraphFragment, ParagraphIndent, ParagraphMeasure, ParagraphSpacing, RenderedPageBreakRun, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, getTableRowLeadingWidth, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, tableColumnsArePinned };
|
|
7
5
|
}
|
|
@@ -38,7 +36,8 @@ type RunFormatting = {
|
|
|
38
36
|
* `segmentByScript`) so wrapping stays correct. Absent means CJK falls back
|
|
39
37
|
* to `fontFamily`.
|
|
40
38
|
*/
|
|
41
|
-
eastAsiaFontFamily?: string;
|
|
39
|
+
eastAsiaFontFamily?: string;
|
|
40
|
+
/** Run language metadata resolved from `w:lang`. */
|
|
42
41
|
language?: {
|
|
43
42
|
val?: string;
|
|
44
43
|
eastAsia?: string;
|
|
@@ -47,11 +46,16 @@ type RunFormatting = {
|
|
|
47
46
|
fontSize?: number;
|
|
48
47
|
letterSpacing?: number;
|
|
49
48
|
superscript?: boolean;
|
|
50
|
-
subscript?: boolean;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
subscript?: boolean;
|
|
50
|
+
/** Render glyphs as uppercase regardless of source case. */
|
|
51
|
+
allCaps?: boolean;
|
|
52
|
+
/** Render lowercase glyphs as small uppercase. */
|
|
53
|
+
smallCaps?: boolean;
|
|
54
|
+
/** Vertical baseline shift in CSS pixels. */
|
|
55
|
+
positionPx?: number;
|
|
56
|
+
/** Horizontal text scale as a percentage. */
|
|
57
|
+
horizontalScale?: number;
|
|
58
|
+
/** Minimum font size in points at which kerning is enabled. */
|
|
55
59
|
kerningMinPt?: number;
|
|
56
60
|
imprint?: boolean;
|
|
57
61
|
emboss?: boolean;
|
|
@@ -77,15 +81,24 @@ type RunFormatting = {
|
|
|
77
81
|
* but the painter emits `docx-text-effect-<name>` plus `data-effect` so
|
|
78
82
|
* host CSS can opt in.
|
|
79
83
|
*/
|
|
80
|
-
textEffect?: "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle";
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
textEffect?: "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle";
|
|
85
|
+
/** Hyperlink info if this run is a link */
|
|
86
|
+
hyperlink?: HyperlinkInfo;
|
|
87
|
+
/** Footnote reference ID (if this run contains a footnote reference) */
|
|
88
|
+
footnoteRefId?: number;
|
|
89
|
+
/** Endnote reference ID (if this run contains an endnote reference) */
|
|
90
|
+
endnoteRefId?: number;
|
|
91
|
+
/** Comment IDs if this run is within a comment range */
|
|
92
|
+
commentIds?: number[];
|
|
93
|
+
/** Whether this run is a tracked insertion */
|
|
94
|
+
isInsertion?: boolean;
|
|
95
|
+
/** Whether this run is a tracked deletion */
|
|
96
|
+
isDeletion?: boolean;
|
|
97
|
+
/** Author of the tracked change */
|
|
98
|
+
changeAuthor?: string;
|
|
99
|
+
/** Date of the tracked change */
|
|
100
|
+
changeDate?: string;
|
|
101
|
+
/** Revision ID of the tracked change (for sidebar matching) */
|
|
89
102
|
changeRevisionId?: number;
|
|
90
103
|
/**
|
|
91
104
|
* Whether this tracked insertion/deletion is an AI-proposed *suggestion*
|
|
@@ -93,7 +106,8 @@ type RunFormatting = {
|
|
|
93
106
|
* dotted stroke and a dedicated hue; they are stripped from serialized DOCX
|
|
94
107
|
* until accepted.
|
|
95
108
|
*/
|
|
96
|
-
isSuggestion?: boolean;
|
|
109
|
+
isSuggestion?: boolean;
|
|
110
|
+
/** Groups a suggestion's runs for accept/reject and scroll-to. */
|
|
97
111
|
suggestionId?: string;
|
|
98
112
|
};
|
|
99
113
|
/**
|
|
@@ -116,9 +130,12 @@ type HyperlinkInfo = {
|
|
|
116
130
|
*/
|
|
117
131
|
type TextRun = RunFormatting & {
|
|
118
132
|
kind: "text";
|
|
119
|
-
text: string;
|
|
120
|
-
|
|
121
|
-
|
|
133
|
+
text: string;
|
|
134
|
+
/** Hyperlink information if this run is a link. */
|
|
135
|
+
hyperlink?: HyperlinkInfo;
|
|
136
|
+
/** Absolute ProseMirror position (inclusive) of first character. */
|
|
137
|
+
pmStart?: number;
|
|
138
|
+
/** Absolute ProseMirror position (exclusive) after last character. */
|
|
122
139
|
pmEnd?: number;
|
|
123
140
|
/**
|
|
124
141
|
* Set when this run is a template fill-preview substitution: the text is
|
|
@@ -162,23 +179,31 @@ type ImageRun = {
|
|
|
162
179
|
src: string;
|
|
163
180
|
width: number;
|
|
164
181
|
height: number;
|
|
165
|
-
alt?: string;
|
|
182
|
+
alt?: string;
|
|
183
|
+
/** CSS transform string (rotation, flip) */
|
|
166
184
|
transform?: string;
|
|
167
185
|
/**
|
|
168
186
|
* Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
|
|
169
187
|
* fully opaque; the painter emits no CSS `opacity` in that case.
|
|
170
188
|
* eigenpal #424 (opacity render pipeline).
|
|
171
189
|
*/
|
|
172
|
-
opacity?: number;
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
190
|
+
opacity?: number;
|
|
191
|
+
/** Position for floating/anchored images */
|
|
192
|
+
position?: ImageRunPosition;
|
|
193
|
+
/** Whether a table-cell anchor uses the cell as its positioning scope. Undefined defaults true. */
|
|
194
|
+
layoutInCell?: boolean;
|
|
195
|
+
/** Wrap type from DOCX (inline, square, tight, through, topAndBottom, etc.) */
|
|
196
|
+
wrapType?: ImageWrap["type"];
|
|
197
|
+
/** Display mode for CSS rendering */
|
|
198
|
+
displayMode?: "inline" | "block" | "float";
|
|
199
|
+
/** CSS float direction */
|
|
200
|
+
cssFloat?: "left" | "right" | "none";
|
|
201
|
+
/** Wrap distances in pixels */
|
|
178
202
|
distTop?: number;
|
|
179
203
|
distBottom?: number;
|
|
180
204
|
distLeft?: number;
|
|
181
|
-
distRight?: number;
|
|
205
|
+
distRight?: number;
|
|
206
|
+
/** Use the image box as the exact line height for an embedded-object preview. */
|
|
182
207
|
exactLineHeight?: boolean;
|
|
183
208
|
/**
|
|
184
209
|
* wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`
|
|
@@ -187,14 +212,22 @@ type ImageRun = {
|
|
|
187
212
|
cropTop?: number;
|
|
188
213
|
cropRight?: number;
|
|
189
214
|
cropBottom?: number;
|
|
190
|
-
cropLeft?: number;
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
215
|
+
cropLeft?: number;
|
|
216
|
+
/** CSS border width in pixels. eigenpal #1096. */
|
|
217
|
+
borderWidth?: number;
|
|
218
|
+
/** CSS border color. eigenpal #1096. */
|
|
219
|
+
borderColor?: string;
|
|
220
|
+
/** CSS border style. eigenpal #1096. */
|
|
221
|
+
borderStyle?: string;
|
|
222
|
+
/** Whether this picture is itself a tracked insertion (`<w:ins>`). eigenpal #641. */
|
|
223
|
+
isInsertion?: boolean;
|
|
224
|
+
/** Whether this picture is itself a tracked deletion (`<w:del>`). eigenpal #641. */
|
|
225
|
+
isDeletion?: boolean;
|
|
226
|
+
/** Author of the tracked change wrapping the picture. eigenpal #641. */
|
|
227
|
+
changeAuthor?: string;
|
|
228
|
+
/** Date of the tracked change wrapping the picture. eigenpal #641. */
|
|
229
|
+
changeDate?: string;
|
|
230
|
+
/** Revision id of the tracked change wrapping the picture. eigenpal #641. */
|
|
198
231
|
changeRevisionId?: number;
|
|
199
232
|
pmStart?: number;
|
|
200
233
|
pmEnd?: number;
|
|
@@ -217,12 +250,15 @@ type RenderedPageBreakRun = RunFormatting & {
|
|
|
217
250
|
* A field run (PAGE, NUMPAGES, etc.) that gets substituted at render time.
|
|
218
251
|
*/
|
|
219
252
|
type FieldRun = RunFormatting & {
|
|
220
|
-
kind: "field";
|
|
253
|
+
kind: "field";
|
|
254
|
+
/** Coarse render category, kept for cache keys and caret-width fast paths. */
|
|
221
255
|
fieldType: "PAGE" | "NUMPAGES" | "DATE" | "TIME" | "OTHER";
|
|
222
256
|
/** Full OOXML field instruction (e.g. `PAGE \* ROMAN`, `PAGEREF _Ref1 \h`)
|
|
223
257
|
* for live evaluation; falls back to `fieldType` when absent. */
|
|
224
|
-
instruction?: string;
|
|
225
|
-
|
|
258
|
+
instruction?: string;
|
|
259
|
+
/** Fallback text if field can't be resolved */
|
|
260
|
+
fallback?: string;
|
|
261
|
+
/** Whether OOXML marked this field as locked (`w:fldLock`). */
|
|
226
262
|
fldLock?: boolean;
|
|
227
263
|
pmStart?: number;
|
|
228
264
|
pmEnd?: number;
|
|
@@ -237,9 +273,12 @@ type FieldRun = RunFormatting & {
|
|
|
237
273
|
* the document model, not the layout layer).
|
|
238
274
|
*/
|
|
239
275
|
type MathRun = RunFormatting & {
|
|
240
|
-
kind: "math";
|
|
241
|
-
|
|
242
|
-
|
|
276
|
+
kind: "math";
|
|
277
|
+
/** `inline` = `<m:oMath>`, `block` = `<m:oMathPara>`. */
|
|
278
|
+
display: "inline" | "block";
|
|
279
|
+
/** Raw OMML XML for conversion + round-trip. */
|
|
280
|
+
ommlXml: string;
|
|
281
|
+
/** Plain-text fallback used when MathML rendering is unavailable. */
|
|
243
282
|
plainText: string;
|
|
244
283
|
pmStart?: number;
|
|
245
284
|
pmEnd?: number;
|
|
@@ -275,8 +314,11 @@ type TabAlignment = "start" | "end" | "center" | "decimal" | "bar" | "clear";
|
|
|
275
314
|
* Tab stop definition
|
|
276
315
|
*/
|
|
277
316
|
type TabStop = {
|
|
278
|
-
/** Tab alignment mode */
|
|
279
|
-
|
|
317
|
+
/** Tab alignment mode */
|
|
318
|
+
val: TabAlignment;
|
|
319
|
+
/** Position in twips from left margin */
|
|
320
|
+
pos: number;
|
|
321
|
+
/** Optional leader character */
|
|
280
322
|
leader?: "none" | "dot" | "hyphen" | "underscore" | "heavy" | "middleDot";
|
|
281
323
|
};
|
|
282
324
|
/**
|
|
@@ -310,19 +352,26 @@ type ListNumPr = {
|
|
|
310
352
|
* Paragraph block attributes.
|
|
311
353
|
*/
|
|
312
354
|
type ParagraphAttrs = {
|
|
313
|
-
alignment?: "left" | "center" | "right" | "justify";
|
|
355
|
+
alignment?: "left" | "center" | "right" | "justify";
|
|
356
|
+
/** Document-generation policy for justified line fitting. */
|
|
314
357
|
justificationCompatibility?: {
|
|
315
358
|
type: "legacy";
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
359
|
+
};
|
|
360
|
+
/** East Asian first/last-character restrictions (`w:kinsoku`). */
|
|
361
|
+
kinsoku?: boolean;
|
|
362
|
+
/** Hanging punctuation (`w:overflowPunct`); defaults to enabled when omitted. */
|
|
363
|
+
overflowPunctuation?: boolean;
|
|
364
|
+
/** Exempt this paragraph from document automatic hyphenation. */
|
|
365
|
+
suppressAutoHyphens?: boolean;
|
|
366
|
+
/** Document-wide automatic hyphenation controls retained for line layout. */
|
|
320
367
|
automaticHyphenation?: {
|
|
321
368
|
enabled: true;
|
|
322
369
|
doNotHyphenateCaps?: boolean;
|
|
323
|
-
consecutiveLineLimit?: number;
|
|
370
|
+
consecutiveLineLimit?: number;
|
|
371
|
+
/** Maximum tolerated line-end whitespace before hyphenation, in twips. */
|
|
324
372
|
hyphenationZoneTwips?: number;
|
|
325
|
-
};
|
|
373
|
+
};
|
|
374
|
+
/** Document-wide custom line-edge characters and compatibility behavior. */
|
|
326
375
|
lineBreakRules?: {
|
|
327
376
|
noLineBreaksBefore?: {
|
|
328
377
|
language?: string;
|
|
@@ -333,11 +382,15 @@ type ParagraphAttrs = {
|
|
|
333
382
|
characters: string;
|
|
334
383
|
};
|
|
335
384
|
useLegacyEthiopicAmharicRules?: boolean;
|
|
336
|
-
};
|
|
385
|
+
};
|
|
386
|
+
/** OOXML outline level (`w:outlineLvl`), where zero is the top level. */
|
|
337
387
|
outlineLevel?: number;
|
|
338
|
-
spacing?: ParagraphSpacing;
|
|
339
|
-
|
|
340
|
-
|
|
388
|
+
spacing?: ParagraphSpacing;
|
|
389
|
+
/** Whether this paragraph participates in the active section line grid. */
|
|
390
|
+
snapToGrid?: boolean;
|
|
391
|
+
/** Active section line pitch in pixels; present only on top-level body paragraphs. */
|
|
392
|
+
documentGridLinePitch?: number;
|
|
393
|
+
/** Spacing sides resolved from OOXML automatic paragraph spacing. */
|
|
341
394
|
automaticSpacing?: {
|
|
342
395
|
before?: boolean;
|
|
343
396
|
after?: boolean;
|
|
@@ -359,13 +412,15 @@ type ParagraphAttrs = {
|
|
|
359
412
|
* source `w:pPr`. Word treats such a blank as authored and keeps its
|
|
360
413
|
* inherited spacing; a bare empty paragraph still collapses that spacing.
|
|
361
414
|
*/
|
|
362
|
-
hasDirectParagraphFormatting?: boolean;
|
|
415
|
+
hasDirectParagraphFormatting?: boolean;
|
|
416
|
+
/** Whether an empty paragraph carries direct formatting on its paragraph mark. */
|
|
363
417
|
hasDirectParagraphMarkFormatting?: boolean;
|
|
364
418
|
indent?: ParagraphIndent;
|
|
365
419
|
keepNext?: boolean;
|
|
366
420
|
keepLines?: boolean;
|
|
367
421
|
widowControl?: boolean;
|
|
368
|
-
pageBreakBefore?: boolean;
|
|
422
|
+
pageBreakBefore?: boolean;
|
|
423
|
+
/** Cached OOXML pagination hint (`w:lastRenderedPageBreak`). */
|
|
369
424
|
renderedPageBreakBefore?: boolean;
|
|
370
425
|
styleId?: string;
|
|
371
426
|
contextualSpacing?: boolean;
|
|
@@ -375,12 +430,15 @@ type ParagraphAttrs = {
|
|
|
375
430
|
* stage merges the next paragraph's runs into this paragraph's
|
|
376
431
|
* fragment (keeping pmStart/pmEnd intact for editing).
|
|
377
432
|
*/
|
|
378
|
-
runInWithNext?: boolean;
|
|
433
|
+
runInWithNext?: boolean;
|
|
434
|
+
/** Right-to-left paragraph direction */
|
|
379
435
|
bidi?: boolean;
|
|
380
436
|
borders?: ParagraphBorders;
|
|
381
437
|
shading?: string;
|
|
382
|
-
tabs?: TabStop[];
|
|
383
|
-
|
|
438
|
+
tabs?: TabStop[];
|
|
439
|
+
/** Render structural empty paragraphs as zero-height anchors. */
|
|
440
|
+
suppressEmptyParagraphHeight?: boolean;
|
|
441
|
+
/** Reserve the reference extra line advance for a story-leading empty level-0 outline paragraph. */
|
|
384
442
|
reserveEmptyOutlineHeight?: boolean;
|
|
385
443
|
numPr?: ListNumPr;
|
|
386
444
|
listMarker?: string;
|
|
@@ -394,7 +452,8 @@ type ParagraphAttrs = {
|
|
|
394
452
|
* that line box without enlarging the marker or Western text glyphs.
|
|
395
453
|
*/
|
|
396
454
|
listParagraphMarkFontSize?: number;
|
|
397
|
-
listMarkerBold?: boolean;
|
|
455
|
+
listMarkerBold?: boolean;
|
|
456
|
+
/** Horizontal alignment of the marker around the paragraph's list anchor. */
|
|
398
457
|
listMarkerAlignment?: "left" | "center" | "right";
|
|
399
458
|
/**
|
|
400
459
|
* `w:suff` (§17.9.25) — what follows the marker before body text.
|
|
@@ -437,14 +496,17 @@ type ParagraphAttrs = {
|
|
|
437
496
|
*/
|
|
438
497
|
type ParagraphBlock = {
|
|
439
498
|
kind: "paragraph";
|
|
440
|
-
id: BlockId;
|
|
499
|
+
id: BlockId;
|
|
500
|
+
/** Stable Word `w14:paraId` / PM `paraId`, when available. */
|
|
441
501
|
paraId?: string;
|
|
442
502
|
runs: Run[];
|
|
443
503
|
attrs?: ParagraphAttrs;
|
|
444
504
|
/** Names of bookmarks anchored to this paragraph; used to map a bookmark to
|
|
445
505
|
* the page it lands on for PAGEREF/REF resolution. */
|
|
446
|
-
bookmarks?: string[];
|
|
447
|
-
|
|
506
|
+
bookmarks?: string[];
|
|
507
|
+
/** ProseMirror start position for this block. */
|
|
508
|
+
pmStart?: number;
|
|
509
|
+
/** ProseMirror end position for this block. */
|
|
448
510
|
pmEnd?: number;
|
|
449
511
|
/**
|
|
450
512
|
* Outer→inner SDT wrappers enclosing this block. Empty / undefined when
|
|
@@ -484,7 +546,8 @@ type TableCell = {
|
|
|
484
546
|
verticalAlign?: "top" | "center" | "bottom";
|
|
485
547
|
textDirection?: NonNullable<TableCellFormatting["textDirection"]>;
|
|
486
548
|
background?: string;
|
|
487
|
-
borders?: CellBorders;
|
|
549
|
+
borders?: CellBorders;
|
|
550
|
+
/** Per-cell padding in pixels (from w:tcMar or table-level w:tblCellMar) */
|
|
488
551
|
padding?: {
|
|
489
552
|
top: number;
|
|
490
553
|
right: number;
|
|
@@ -508,7 +571,8 @@ type TableRow = {
|
|
|
508
571
|
gridAfter?: number;
|
|
509
572
|
height?: number;
|
|
510
573
|
heightRule?: "auto" | "atLeast" | "exact";
|
|
511
|
-
isHeader?: boolean;
|
|
574
|
+
isHeader?: boolean;
|
|
575
|
+
/** `w:cantSplit`: keep this row in one flow region. */
|
|
512
576
|
cantSplit?: boolean;
|
|
513
577
|
hidden?: boolean;
|
|
514
578
|
};
|
|
@@ -534,8 +598,10 @@ type TableBlock = {
|
|
|
534
598
|
kind: "table";
|
|
535
599
|
id: BlockId;
|
|
536
600
|
rows: TableRow[];
|
|
537
|
-
columnWidths?: number[];
|
|
538
|
-
|
|
601
|
+
columnWidths?: number[];
|
|
602
|
+
/** Table width value (twips for dxa, 50ths of percent for pct). */
|
|
603
|
+
width?: number;
|
|
604
|
+
/** Table width type ('auto', 'pct', 'dxa', 'nil'). */
|
|
539
605
|
widthType?: TableWidthType;
|
|
540
606
|
/**
|
|
541
607
|
* Table layout algorithm (`w:tblLayout`). "fixed" pins columns to their grid
|
|
@@ -543,13 +609,18 @@ type TableBlock = {
|
|
|
543
609
|
* content. Consulted alongside `widthType` to decide whether `w:noWrap` cells
|
|
544
610
|
* can be honored (see `tableColumnsArePinned`).
|
|
545
611
|
*/
|
|
546
|
-
layout?: "fixed" | "autofit";
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
612
|
+
layout?: "fixed" | "autofit";
|
|
613
|
+
/** Table horizontal alignment */
|
|
614
|
+
justification?: "left" | "center" | "right";
|
|
615
|
+
/** Table indent from left margin (in pixels, from w:tblInd) */
|
|
616
|
+
indent?: number;
|
|
617
|
+
/** Right-to-left column order (w:bidiVisual): logical column 0 paints on the right. */
|
|
618
|
+
bidi?: boolean;
|
|
619
|
+
/** Floating table properties (pixel values). */
|
|
550
620
|
floating?: FloatingTablePosition;
|
|
551
621
|
pmStart?: number;
|
|
552
|
-
pmEnd?: number;
|
|
622
|
+
pmEnd?: number;
|
|
623
|
+
/** Outer→inner SDT wrappers enclosing this table (see ParagraphBlock). */
|
|
553
624
|
sdtGroups?: SdtGroup[];
|
|
554
625
|
};
|
|
555
626
|
/**
|
|
@@ -561,7 +632,8 @@ type ImageBlock = {
|
|
|
561
632
|
src: string;
|
|
562
633
|
width: number;
|
|
563
634
|
height: number;
|
|
564
|
-
alt?: string;
|
|
635
|
+
alt?: string;
|
|
636
|
+
/** CSS transform string (rotation, flip) */
|
|
565
637
|
transform?: string;
|
|
566
638
|
/**
|
|
567
639
|
* Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
|
|
@@ -574,7 +646,8 @@ type ImageBlock = {
|
|
|
574
646
|
offsetH?: number;
|
|
575
647
|
offsetV?: number;
|
|
576
648
|
behindDoc?: boolean;
|
|
577
|
-
};
|
|
649
|
+
};
|
|
650
|
+
/** Hyperlink URL for clickable image */
|
|
578
651
|
hlinkHref?: string;
|
|
579
652
|
/**
|
|
580
653
|
* wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`.
|
|
@@ -583,9 +656,12 @@ type ImageBlock = {
|
|
|
583
656
|
cropTop?: number;
|
|
584
657
|
cropRight?: number;
|
|
585
658
|
cropBottom?: number;
|
|
586
|
-
cropLeft?: number;
|
|
587
|
-
|
|
588
|
-
|
|
659
|
+
cropLeft?: number;
|
|
660
|
+
/** CSS border width in pixels. eigenpal #1096. */
|
|
661
|
+
borderWidth?: number;
|
|
662
|
+
/** CSS border color. eigenpal #1096. */
|
|
663
|
+
borderColor?: string;
|
|
664
|
+
/** CSS border style. eigenpal #1096. */
|
|
589
665
|
borderStyle?: string;
|
|
590
666
|
pmStart?: number;
|
|
591
667
|
pmEnd?: number;
|
|
@@ -603,7 +679,8 @@ type SectionBreakBlock = {
|
|
|
603
679
|
};
|
|
604
680
|
orientation?: "portrait" | "landscape";
|
|
605
681
|
margins?: PageMargins;
|
|
606
|
-
columns?: ColumnLayout;
|
|
682
|
+
columns?: ColumnLayout;
|
|
683
|
+
/** Line pitch authored by the section properties that end at this boundary, in twips. */
|
|
607
684
|
documentGridLinePitchTwips?: number;
|
|
608
685
|
};
|
|
609
686
|
type PageHeaderFooterRefs = {
|
|
@@ -648,26 +725,41 @@ declare const DEFAULT_TEXTBOX_WIDTH = 200;
|
|
|
648
725
|
*/
|
|
649
726
|
type TextBoxBlock = {
|
|
650
727
|
kind: "textBox";
|
|
651
|
-
id: BlockId;
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
728
|
+
id: BlockId;
|
|
729
|
+
/** Width in pixels */
|
|
730
|
+
width: number;
|
|
731
|
+
/** Height in pixels (may be auto-calculated) */
|
|
732
|
+
height?: number;
|
|
733
|
+
/** Text fitting behavior */
|
|
734
|
+
autoFit?: ShapeTextBody["autoFit"];
|
|
735
|
+
/** Fill/background color */
|
|
736
|
+
fillColor?: string;
|
|
737
|
+
/** Border width in pixels */
|
|
738
|
+
outlineWidth?: number;
|
|
739
|
+
/** Border color */
|
|
740
|
+
outlineColor?: string;
|
|
741
|
+
/** Outline dash style, or `"none"` for an explicit no-outline. */
|
|
742
|
+
outlineStyle?: OutlineStyleAttr;
|
|
743
|
+
/** Internal padding */
|
|
659
744
|
margins?: {
|
|
660
745
|
top: number;
|
|
661
746
|
bottom: number;
|
|
662
747
|
left: number;
|
|
663
748
|
right: number;
|
|
664
|
-
};
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
749
|
+
};
|
|
750
|
+
/** Flow blocks inside the text box */
|
|
751
|
+
content: (ParagraphBlock | TableBlock)[];
|
|
752
|
+
/** Display mode copied from the ProseMirror text box node. */
|
|
753
|
+
displayMode?: "inline" | "float" | "block";
|
|
754
|
+
/** CSS float direction copied from the ProseMirror text box node. */
|
|
755
|
+
cssFloat?: "left" | "right" | "none";
|
|
756
|
+
/** OOXML wrap type for anchored text boxes. */
|
|
757
|
+
wrapType?: ImageWrap["type"];
|
|
758
|
+
/** OOXML wrapText direction for anchored text boxes. */
|
|
759
|
+
wrapText?: "bothSides" | "left" | "right" | "largest";
|
|
760
|
+
/** Position for floating/anchored text boxes (OOXML EMU offsets). */
|
|
761
|
+
position?: ImageRunPosition;
|
|
762
|
+
/** Wrap distances in pixels. */
|
|
671
763
|
distTop?: number;
|
|
672
764
|
distBottom?: number;
|
|
673
765
|
distLeft?: number;
|
|
@@ -684,21 +776,30 @@ type TextBoxBlock = {
|
|
|
684
776
|
* stay disambiguated even when alias/tag/sdtId collide.
|
|
685
777
|
*/
|
|
686
778
|
type SdtGroup = {
|
|
687
|
-
/** Folio-local identifier (stable within one toFlowBlocks call). */
|
|
779
|
+
/** Folio-local identifier (stable within one toFlowBlocks call). */
|
|
780
|
+
id: string;
|
|
688
781
|
/**
|
|
689
782
|
* ProseMirror position of the blockSdt's open token in the source doc.
|
|
690
783
|
* Stable across renders for the same control and unique per instance —
|
|
691
784
|
* the addressing API uses this to disambiguate SDTs that share a tag.
|
|
692
785
|
*/
|
|
693
786
|
pmPos: number;
|
|
694
|
-
sdtType: SdtType;
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
787
|
+
sdtType: SdtType;
|
|
788
|
+
/** OOXML `w:alias` (friendly display name). */
|
|
789
|
+
alias?: string;
|
|
790
|
+
/** OOXML `w:tag` (developer identifier — anchor for addressing API). */
|
|
791
|
+
tag?: string;
|
|
792
|
+
/** OOXML numeric `w:id`. */
|
|
793
|
+
sdtId?: number;
|
|
794
|
+
/** OOXML `w:lock` setting. */
|
|
795
|
+
lock?: NonNullable<SdtProperties["lock"]>;
|
|
796
|
+
/** True if `w:showingPlcHdr` is set. */
|
|
797
|
+
showingPlaceholder?: boolean;
|
|
798
|
+
/** Modeled checkbox state, when the control is `w14:checkbox`. */
|
|
799
|
+
checked?: boolean;
|
|
800
|
+
/** Modeled `w:date/w:dateFormat`. */
|
|
801
|
+
dateFormat?: string;
|
|
802
|
+
/** Modeled `w:dropDownList`/`w:comboBox` items (JSON-encoded). */
|
|
702
803
|
listItemsJson?: string;
|
|
703
804
|
/**
|
|
704
805
|
* Position of the carrying block within its SDT group (`first`/`middle`/
|
|
@@ -718,25 +819,37 @@ type FlowBlock = ParagraphBlock | TableBlock | ImageBlock | TextBoxBlock | Secti
|
|
|
718
819
|
* A measured line within a paragraph.
|
|
719
820
|
*/
|
|
720
821
|
type MeasuredLine = {
|
|
721
|
-
/** Starting run index (inclusive). */
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
822
|
+
/** Starting run index (inclusive). */
|
|
823
|
+
fromRun: number;
|
|
824
|
+
/** Starting character index within fromRun. */
|
|
825
|
+
fromChar: number;
|
|
826
|
+
/** Ending run index (inclusive). */
|
|
827
|
+
toRun: number;
|
|
828
|
+
/** Ending character index within toRun (exclusive). */
|
|
829
|
+
toChar: number;
|
|
830
|
+
/** Total width of the line in pixels. */
|
|
831
|
+
width: number;
|
|
832
|
+
/** Ascent (height above baseline) in pixels. */
|
|
833
|
+
ascent: number;
|
|
834
|
+
/** Descent (height below baseline) in pixels. */
|
|
835
|
+
descent: number;
|
|
836
|
+
/** Total line height in pixels. */
|
|
837
|
+
lineHeight: number;
|
|
838
|
+
/** Left offset from floating images (pixels from content left edge). */
|
|
839
|
+
leftOffset?: number;
|
|
840
|
+
/** Right offset from floating images (pixels from content right edge). */
|
|
730
841
|
rightOffset?: number;
|
|
731
842
|
/**
|
|
732
843
|
* Vertical space inserted before this line to skip past floats that leave
|
|
733
844
|
* no usable horizontal room at the natural line Y. Painters render this
|
|
734
845
|
* as marginTop on the line element; measurement adds it to totalHeight.
|
|
735
846
|
*/
|
|
736
|
-
floatSkipBefore?: number;
|
|
847
|
+
floatSkipBefore?: number;
|
|
848
|
+
/** Decorative hyphen inserted at a dictionary break without changing source text. */
|
|
737
849
|
discretionaryHyphen?: {
|
|
738
850
|
runIndex: number;
|
|
739
|
-
};
|
|
851
|
+
};
|
|
852
|
+
/** A cached pagination boundary occurs immediately before this line. */
|
|
740
853
|
renderedPageBreakBefore?: boolean;
|
|
741
854
|
};
|
|
742
855
|
/**
|
|
@@ -815,7 +928,8 @@ type ColumnBreakMeasure = {
|
|
|
815
928
|
type TextBoxMeasure = {
|
|
816
929
|
kind: "textBox";
|
|
817
930
|
width: number;
|
|
818
|
-
height: number;
|
|
931
|
+
height: number;
|
|
932
|
+
/** Pre-measured inner content (avoids re-measuring during render) */
|
|
819
933
|
innerMeasures: (ParagraphMeasure | TableMeasure)[];
|
|
820
934
|
};
|
|
821
935
|
/**
|
|
@@ -826,11 +940,17 @@ type Measure = ParagraphMeasure | ImageMeasure | TableMeasure | TextBoxMeasure |
|
|
|
826
940
|
* Base fragment properties common to all fragment types.
|
|
827
941
|
*/
|
|
828
942
|
type FragmentBase = {
|
|
829
|
-
/** Block ID this fragment belongs to. */
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
943
|
+
/** Block ID this fragment belongs to. */
|
|
944
|
+
blockId: BlockId;
|
|
945
|
+
/** X position on page (relative to page left). */
|
|
946
|
+
x: number;
|
|
947
|
+
/** Y position on page (relative to page top). */
|
|
948
|
+
y: number;
|
|
949
|
+
/** Width of the fragment. */
|
|
950
|
+
width: number;
|
|
951
|
+
/** ProseMirror start position (for click mapping). */
|
|
952
|
+
pmStart?: number;
|
|
953
|
+
/** ProseMirror end position (for click mapping). */
|
|
834
954
|
pmEnd?: number;
|
|
835
955
|
/**
|
|
836
956
|
* Outer→inner SDT wrappers enclosing the originating block. Copied
|
|
@@ -844,11 +964,16 @@ type FragmentBase = {
|
|
|
844
964
|
* May span only part of the paragraph's lines if split across pages.
|
|
845
965
|
*/
|
|
846
966
|
type ParagraphFragment = FragmentBase & {
|
|
847
|
-
kind: "paragraph";
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
967
|
+
kind: "paragraph";
|
|
968
|
+
/** First line index (inclusive) from the measure. */
|
|
969
|
+
fromLine: number;
|
|
970
|
+
/** Last line index (exclusive) from the measure. */
|
|
971
|
+
toLine: number;
|
|
972
|
+
/** Height of this fragment. */
|
|
973
|
+
height: number;
|
|
974
|
+
/** True if this continues from a previous page. */
|
|
975
|
+
continuesFromPrev?: boolean;
|
|
976
|
+
/** True if this continues onto the next page. */
|
|
852
977
|
continuesOnNext?: boolean;
|
|
853
978
|
};
|
|
854
979
|
/**
|
|
@@ -856,13 +981,20 @@ type ParagraphFragment = FragmentBase & {
|
|
|
856
981
|
* May span only part of the table's rows if split across pages.
|
|
857
982
|
*/
|
|
858
983
|
type TableFragment = FragmentBase & {
|
|
859
|
-
kind: "table";
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
984
|
+
kind: "table";
|
|
985
|
+
/** First row index (inclusive). */
|
|
986
|
+
fromRow: number;
|
|
987
|
+
/** Last row index (exclusive). */
|
|
988
|
+
toRow: number;
|
|
989
|
+
/** Height of this fragment. */
|
|
990
|
+
height: number;
|
|
991
|
+
/** True if this is a floating table. */
|
|
992
|
+
isFloating?: boolean;
|
|
993
|
+
/** True if this continues from a previous page. */
|
|
994
|
+
continuesFromPrev?: boolean;
|
|
995
|
+
/** True if this continues onto the next page. */
|
|
996
|
+
continuesOnNext?: boolean;
|
|
997
|
+
/** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
|
|
866
998
|
headerRowCount?: number;
|
|
867
999
|
/**
|
|
868
1000
|
* Mid-content row break (eigenpal #698): when a single row is taller than a
|
|
@@ -879,16 +1011,20 @@ type TableFragment = FragmentBase & {
|
|
|
879
1011
|
* An image fragment positioned on a page.
|
|
880
1012
|
*/
|
|
881
1013
|
type ImageFragment = FragmentBase & {
|
|
882
|
-
kind: "image";
|
|
883
|
-
|
|
884
|
-
|
|
1014
|
+
kind: "image";
|
|
1015
|
+
/** Height of the image. */
|
|
1016
|
+
height: number;
|
|
1017
|
+
/** True if this is an anchored/floating image. */
|
|
1018
|
+
isAnchored?: boolean;
|
|
1019
|
+
/** Z-index for layering. */
|
|
885
1020
|
zIndex?: number;
|
|
886
1021
|
};
|
|
887
1022
|
/**
|
|
888
1023
|
* A text box fragment positioned on a page.
|
|
889
1024
|
*/
|
|
890
1025
|
type TextBoxFragment = FragmentBase & {
|
|
891
|
-
kind: "textBox";
|
|
1026
|
+
kind: "textBox";
|
|
1027
|
+
/** Height of the text box. */
|
|
892
1028
|
height: number;
|
|
893
1029
|
};
|
|
894
1030
|
/**
|
|
@@ -902,27 +1038,40 @@ type PageMargins = {
|
|
|
902
1038
|
top: number;
|
|
903
1039
|
right: number;
|
|
904
1040
|
bottom: number;
|
|
905
|
-
left: number;
|
|
906
|
-
|
|
1041
|
+
left: number;
|
|
1042
|
+
/** Distance from page top to header content. */
|
|
1043
|
+
header?: number;
|
|
1044
|
+
/** Distance from page bottom to footer content. */
|
|
907
1045
|
footer?: number;
|
|
908
1046
|
};
|
|
909
1047
|
/**
|
|
910
1048
|
* A rendered page containing positioned fragments.
|
|
911
1049
|
*/
|
|
912
1050
|
type Page = {
|
|
913
|
-
/** Page number (1-indexed). */
|
|
914
|
-
|
|
915
|
-
|
|
1051
|
+
/** Page number (1-indexed). */
|
|
1052
|
+
number: number;
|
|
1053
|
+
/** Fragments positioned on this page. */
|
|
1054
|
+
fragments: Fragment[];
|
|
1055
|
+
/** Page margins. */
|
|
1056
|
+
margins: PageMargins;
|
|
1057
|
+
/** Page size (width, height). */
|
|
916
1058
|
size: {
|
|
917
1059
|
w: number;
|
|
918
1060
|
h: number;
|
|
919
|
-
};
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
1061
|
+
};
|
|
1062
|
+
/** Page orientation. */
|
|
1063
|
+
orientation?: "portrait" | "landscape";
|
|
1064
|
+
/** Section index this page belongs to. */
|
|
1065
|
+
sectionIndex?: number;
|
|
1066
|
+
/** 1-based page number within the active section. */
|
|
1067
|
+
sectionPageNumber?: number;
|
|
1068
|
+
/** Header/footer references for this page. */
|
|
1069
|
+
headerFooterRefs?: PageHeaderFooterRefs;
|
|
1070
|
+
/** Footnote IDs that appear on this page (for rendering). */
|
|
1071
|
+
footnoteIds?: number[];
|
|
1072
|
+
/** Height reserved for the footnote area at page bottom (pixels). */
|
|
1073
|
+
footnoteReservedHeight?: number;
|
|
1074
|
+
/** Column layout for this page (if multi-column). */
|
|
926
1075
|
columns?: ColumnLayout;
|
|
927
1076
|
};
|
|
928
1077
|
/**
|
|
@@ -931,9 +1080,12 @@ type Page = {
|
|
|
931
1080
|
type ColumnLayout = {
|
|
932
1081
|
count: number;
|
|
933
1082
|
gap: number;
|
|
934
|
-
equalWidth?: boolean;
|
|
935
|
-
|
|
936
|
-
|
|
1083
|
+
equalWidth?: boolean;
|
|
1084
|
+
/** Authored widths for unequal-width section columns. */
|
|
1085
|
+
widths?: number[];
|
|
1086
|
+
/** Authored space after each column except the last. */
|
|
1087
|
+
gaps?: number[];
|
|
1088
|
+
/** Draw vertical separator line between columns (w:sep). */
|
|
937
1089
|
separator?: boolean;
|
|
938
1090
|
};
|
|
939
1091
|
/**
|
|
@@ -947,14 +1099,20 @@ type HeaderFooterLayout = {
|
|
|
947
1099
|
* Final layout output ready for rendering/painting.
|
|
948
1100
|
*/
|
|
949
1101
|
type Layout = {
|
|
950
|
-
/** Default page size for the document. */
|
|
1102
|
+
/** Default page size for the document. */
|
|
1103
|
+
pageSize: {
|
|
951
1104
|
w: number;
|
|
952
1105
|
h: number;
|
|
953
|
-
};
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1106
|
+
};
|
|
1107
|
+
/** All rendered pages with positioned fragments. */
|
|
1108
|
+
pages: Page[];
|
|
1109
|
+
/** Column configuration (if multi-column). */
|
|
1110
|
+
columns?: ColumnLayout;
|
|
1111
|
+
/** Header layouts by type (default, first, even). */
|
|
1112
|
+
headers?: Record<string, HeaderFooterLayout>;
|
|
1113
|
+
/** Footer layouts by type (default, first, even). */
|
|
1114
|
+
footers?: Record<string, HeaderFooterLayout>;
|
|
1115
|
+
/** Gap between pages in pixels (for rendering). */
|
|
958
1116
|
pageGap?: number;
|
|
959
1117
|
};
|
|
960
1118
|
/**
|
|
@@ -965,20 +1123,27 @@ type HeaderFooterContentHeights = Partial<Record<"default" | "first" | "even" |
|
|
|
965
1123
|
* Pre-calculated footnote content for layout and rendering.
|
|
966
1124
|
*/
|
|
967
1125
|
type FootnoteContent = {
|
|
968
|
-
/** Footnote ID. */
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
1126
|
+
/** Footnote ID. */
|
|
1127
|
+
id: number;
|
|
1128
|
+
/** Display number (e.g. 1, 2, 3). */
|
|
1129
|
+
displayNumber: number;
|
|
1130
|
+
/** FlowBlocks for rendering the footnote content. */
|
|
1131
|
+
blocks: FlowBlock[];
|
|
1132
|
+
/** Measurements for the blocks. */
|
|
1133
|
+
measures: Measure[];
|
|
1134
|
+
/** Total height in pixels. */
|
|
972
1135
|
height: number;
|
|
973
1136
|
};
|
|
974
1137
|
/**
|
|
975
1138
|
* Options for the layout engine.
|
|
976
1139
|
*/
|
|
977
1140
|
type LayoutOptions = {
|
|
978
|
-
/** Initial page size. */
|
|
1141
|
+
/** Initial page size. */
|
|
1142
|
+
pageSize: {
|
|
979
1143
|
w: number;
|
|
980
1144
|
h: number;
|
|
981
|
-
};
|
|
1145
|
+
};
|
|
1146
|
+
/** Initial page margins. */
|
|
982
1147
|
margins: PageMargins;
|
|
983
1148
|
/**
|
|
984
1149
|
* Margins applied only to page 1 (the title page) when the first
|
|
@@ -986,22 +1151,35 @@ type LayoutOptions = {
|
|
|
986
1151
|
* overflowing first-page header without forcing pages 2+ to inherit the
|
|
987
1152
|
* same extension.
|
|
988
1153
|
*/
|
|
989
|
-
firstPageMargins?: PageMargins;
|
|
990
|
-
|
|
1154
|
+
firstPageMargins?: PageMargins;
|
|
1155
|
+
/** Per-section body margins used on even section pages. */
|
|
1156
|
+
sectionEvenPageMargins?: (PageMargins | undefined)[];
|
|
1157
|
+
/** Body-level final section page size. */
|
|
991
1158
|
finalPageSize?: {
|
|
992
1159
|
w: number;
|
|
993
1160
|
h: number;
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1161
|
+
};
|
|
1162
|
+
/** Body-level final section margins. */
|
|
1163
|
+
finalMargins?: PageMargins;
|
|
1164
|
+
/** Body-level final section column configuration. */
|
|
1165
|
+
finalColumns?: ColumnLayout;
|
|
1166
|
+
/** Column configuration. */
|
|
1167
|
+
columns?: ColumnLayout;
|
|
1168
|
+
/** Gap between rendered pages (for UI). */
|
|
1169
|
+
pageGap?: number;
|
|
1170
|
+
/** Default line height multiplier. */
|
|
1171
|
+
defaultLineHeight?: number;
|
|
1172
|
+
/** Header content heights by variant. */
|
|
1173
|
+
headerContentHeights?: HeaderFooterContentHeights;
|
|
1174
|
+
/** Footer content heights by variant. */
|
|
1175
|
+
footerContentHeights?: HeaderFooterContentHeights;
|
|
1176
|
+
/** Whether section has different first page header/footer. */
|
|
1177
|
+
titlePage?: boolean;
|
|
1178
|
+
/** Whether section has different even/odd headers/footers. */
|
|
1179
|
+
evenAndOddHeaders?: boolean;
|
|
1180
|
+
/** Swap left/right margins on even physical pages. */
|
|
1181
|
+
mirrorMargins?: boolean;
|
|
1182
|
+
/** Per-page footnote reserved heights (pageNumber → height in pixels). */
|
|
1005
1183
|
footnoteReservedHeights?: Map<number, number>;
|
|
1006
1184
|
/**
|
|
1007
1185
|
* Footnote content heights keyed by internal footnote id (the OOXML
|
|
@@ -1014,26 +1192,36 @@ type LayoutOptions = {
|
|
|
1014
1192
|
* above the fn area) on documents with multiple long footnotes per
|
|
1015
1193
|
* page.
|
|
1016
1194
|
*/
|
|
1017
|
-
footnoteHeightById?: Map<number, number>;
|
|
1018
|
-
|
|
1195
|
+
footnoteHeightById?: Map<number, number>;
|
|
1196
|
+
/** Section break type for the body-level (final) section (for section transition logic). */
|
|
1197
|
+
bodyBreakType?: "continuous" | "nextPage" | "evenPage" | "oddPage";
|
|
1198
|
+
/** Header/footer references for each document section, by section index. */
|
|
1019
1199
|
sectionHeaderFooterRefs?: PageHeaderFooterRefs[];
|
|
1020
1200
|
};
|
|
1021
1201
|
/**
|
|
1022
1202
|
* Result of hit-testing a click position.
|
|
1023
1203
|
*/
|
|
1024
1204
|
type HitTestResult = {
|
|
1025
|
-
/** Page index (0-based). */
|
|
1026
|
-
|
|
1027
|
-
|
|
1205
|
+
/** Page index (0-based). */
|
|
1206
|
+
pageIndex: number;
|
|
1207
|
+
/** Fragment that was hit, if any. */
|
|
1208
|
+
fragment?: Fragment;
|
|
1209
|
+
/** Local X coordinate within the fragment. */
|
|
1210
|
+
localX?: number;
|
|
1211
|
+
/** Local Y coordinate within the fragment. */
|
|
1028
1212
|
localY?: number;
|
|
1029
1213
|
};
|
|
1030
1214
|
/**
|
|
1031
1215
|
* Position within the document model.
|
|
1032
1216
|
*/
|
|
1033
1217
|
type DocumentPosition = {
|
|
1034
|
-
/** Block index. */
|
|
1035
|
-
|
|
1036
|
-
|
|
1218
|
+
/** Block index. */
|
|
1219
|
+
blockIndex: number;
|
|
1220
|
+
/** Run index within the block (for paragraphs). */
|
|
1221
|
+
runIndex?: number;
|
|
1222
|
+
/** Character offset within the run. */
|
|
1223
|
+
charOffset?: number;
|
|
1224
|
+
/** ProseMirror position. */
|
|
1037
1225
|
pmPos?: number;
|
|
1038
1226
|
};
|
|
1039
1227
|
/**
|
|
@@ -1062,10 +1250,15 @@ declare const FOOTNOTE_FALLBACK_LINE_HEIGHT = 13;
|
|
|
1062
1250
|
* the bridge and the bridge must not import it from the painter.
|
|
1063
1251
|
*/
|
|
1064
1252
|
type HeaderFooterContent = {
|
|
1065
|
-
/** Flow blocks for the header/footer content. */
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1253
|
+
/** Flow blocks for the header/footer content. */
|
|
1254
|
+
blocks: FlowBlock[];
|
|
1255
|
+
/** Measurements for the blocks. */
|
|
1256
|
+
measures: Measure[];
|
|
1257
|
+
/** Total height of the content. */
|
|
1258
|
+
height: number;
|
|
1259
|
+
/** Top-most visual extent relative to the nominal flow origin. */
|
|
1260
|
+
visualTop?: number;
|
|
1261
|
+
/** Bottom-most visual extent relative to the nominal flow origin. */
|
|
1069
1262
|
visualBottom?: number;
|
|
1070
1263
|
/**
|
|
1071
1264
|
* Flow-only bounds for consumers that need to distinguish normal
|