@stll/folio-core 0.0.1-placeholder.0 → 0.1.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/LICENSE +202 -0
- package/NOTICE.md +29 -0
- package/README.md +41 -0
- package/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/ai-edits/apply.d.ts +35 -0
- package/dist/ai-edits/apply.js +683 -0
- package/dist/ai-edits/clean-text.d.ts +28 -0
- package/dist/ai-edits/clean-text.js +23 -0
- package/dist/ai-edits/headless.d.ts +225 -0
- package/dist/ai-edits/headless.js +513 -0
- package/dist/ai-edits/index.d.ts +6 -0
- package/dist/ai-edits/index.js +5 -0
- package/dist/ai-edits/inline-emphasis.d.ts +38 -0
- package/dist/ai-edits/inline-emphasis.js +78 -0
- package/dist/ai-edits/snapshot.d.ts +9 -0
- package/dist/ai-edits/snapshot.js +195 -0
- package/dist/ai-edits/types.d.ts +156 -0
- package/dist/ai-edits/types.js +0 -0
- package/dist/ai-edits/word-diff.d.ts +20 -0
- package/dist/ai-edits/word-diff.js +77 -0
- package/dist/ai-suggestions/apply.d.ts +17 -0
- package/dist/ai-suggestions/apply.js +64 -0
- package/dist/ai-suggestions/conflict.d.ts +22 -0
- package/dist/ai-suggestions/conflict.js +67 -0
- package/dist/ai-suggestions/text-positions.d.ts +21 -0
- package/dist/ai-suggestions/text-positions.js +48 -0
- package/dist/ai-suggestions/types.d.ts +199 -0
- package/dist/ai-suggestions/types.js +59 -0
- package/dist/content-controls/errors.d.ts +52 -0
- package/dist/content-controls/errors.js +36 -0
- package/dist/content-controls/findContentControls.d.ts +55 -0
- package/dist/content-controls/findContentControls.js +75 -0
- package/dist/content-controls/index.d.ts +4 -0
- package/dist/content-controls/index.js +4 -0
- package/dist/content-controls/mutateContentControls.d.ts +51 -0
- package/dist/content-controls/mutateContentControls.js +377 -0
- package/dist/controller/folioEditor.d.ts +21 -0
- package/dist/controller/folioEditor.js +29 -0
- package/dist/controller/folioEditorEvents.d.ts +23 -0
- package/dist/controller/folioEditorEvents.js +24 -0
- package/dist/controller/hiddenEditorApi.d.ts +35 -0
- package/dist/controller/hiddenEditorApi.js +112 -0
- package/dist/controller/hiddenEditorManager.d.ts +93 -0
- package/dist/controller/hiddenEditorManager.js +308 -0
- package/dist/controller/layoutPipeline.d.ts +63 -0
- package/dist/controller/layoutPipeline.js +406 -0
- package/dist/controller/layoutScheduler.d.ts +41 -0
- package/dist/controller/layoutScheduler.js +59 -0
- package/dist/controller/layoutSession.d.ts +24 -0
- package/dist/controller/layoutSession.js +13 -0
- package/dist/docx/blockContentParser.d.ts +13 -0
- package/dist/docx/blockContentParser.js +289 -0
- package/dist/docx/bookmarkParser.d.ts +178 -0
- package/dist/docx/bookmarkParser.js +246 -0
- package/dist/docx/bookmarkPlacement.d.ts +10 -0
- package/dist/docx/bookmarkPlacement.js +50 -0
- package/dist/docx/bulletMarkers.d.ts +4 -0
- package/dist/docx/bulletMarkers.js +42 -0
- package/dist/docx/commentParser.d.ts +34 -0
- package/dist/docx/commentParser.js +127 -0
- package/dist/docx/commentReferenceNormalization.d.ts +25 -0
- package/dist/docx/commentReferenceNormalization.js +97 -0
- package/dist/docx/commentReplyMarkers.d.ts +20 -0
- package/dist/docx/commentReplyMarkers.js +123 -0
- package/dist/docx/compatibility.d.ts +12 -0
- package/dist/docx/compatibility.js +77 -0
- package/dist/docx/documentParser.d.ts +65 -0
- package/dist/docx/documentParser.js +209 -0
- package/dist/docx/drawingUtils.d.ts +56 -0
- package/dist/docx/drawingUtils.js +305 -0
- package/dist/docx/fieldParser.d.ts +228 -0
- package/dist/docx/fieldParser.js +559 -0
- package/dist/docx/footnoteParser.d.ts +109 -0
- package/dist/docx/footnoteParser.js +270 -0
- package/dist/docx/headerFooterParser.d.ts +119 -0
- package/dist/docx/headerFooterParser.js +266 -0
- package/dist/docx/headerFooterRefParser.d.ts +22 -0
- package/dist/docx/headerFooterRefParser.js +52 -0
- package/dist/docx/headerFooterReferenceNormalization.d.ts +19 -0
- package/dist/docx/headerFooterReferenceNormalization.js +64 -0
- package/dist/docx/hyperlinkParser.d.ts +108 -0
- package/dist/docx/hyperlinkParser.js +230 -0
- package/dist/docx/imageParser.d.ts +93 -0
- package/dist/docx/imageParser.js +522 -0
- package/dist/docx/mathToMathml.d.ts +15 -0
- package/dist/docx/mathToMathml.js +357 -0
- package/dist/docx/modelValidation.d.ts +13 -0
- package/dist/docx/modelValidation.js +21 -0
- package/dist/docx/normalizeBaseDirection.d.ts +12 -0
- package/dist/docx/normalizeBaseDirection.js +81 -0
- package/dist/docx/notePropertiesParser.d.ts +16 -0
- package/dist/docx/notePropertiesParser.js +99 -0
- package/dist/docx/numberingParser.d.ts +86 -0
- package/dist/docx/numberingParser.js +735 -0
- package/dist/docx/numberingReferenceNormalization.d.ts +25 -0
- package/dist/docx/numberingReferenceNormalization.js +22 -0
- package/dist/docx/paragraphParser.d.ts +86 -0
- package/dist/docx/paragraphParser.js +1132 -0
- package/dist/docx/paragraphTraversal.d.ts +19 -0
- package/dist/docx/paragraphTraversal.js +76 -0
- package/dist/docx/parser.d.ts +67 -0
- package/dist/docx/parser.js +391 -0
- package/dist/docx/parserEnums.d.ts +45 -0
- package/dist/docx/parserEnums.js +70 -0
- package/dist/docx/relsParser.d.ts +160 -0
- package/dist/docx/relsParser.js +235 -0
- package/dist/docx/replyToComment.d.ts +29 -0
- package/dist/docx/replyToComment.js +73 -0
- package/dist/docx/rezip.d.ts +166 -0
- package/dist/docx/rezip.js +1194 -0
- package/dist/docx/runConsolidator.d.ts +57 -0
- package/dist/docx/runConsolidator.js +224 -0
- package/dist/docx/runParser.d.ts +78 -0
- package/dist/docx/runParser.js +661 -0
- package/dist/docx/sdtProperties.d.ts +15 -0
- package/dist/docx/sdtProperties.js +290 -0
- package/dist/docx/sdtPropertiesPatch.d.ts +16 -0
- package/dist/docx/sdtPropertiesPatch.js +144 -0
- package/dist/docx/sectionParser.d.ts +95 -0
- package/dist/docx/sectionParser.js +534 -0
- package/dist/docx/selectiveSave.d.ts +25 -0
- package/dist/docx/selectiveSave.js +247 -0
- package/dist/docx/selectiveSaveFlags.d.ts +33 -0
- package/dist/docx/selectiveSaveFlags.js +11 -0
- package/dist/docx/selectiveSaveTripwire.d.ts +33 -0
- package/dist/docx/selectiveSaveTripwire.js +79 -0
- package/dist/docx/selectiveXmlPatch.d.ts +103 -0
- package/dist/docx/selectiveXmlPatch.js +493 -0
- package/dist/docx/serializer/blockSdtSerializer.d.ts +6 -0
- package/dist/docx/serializer/blockSdtSerializer.js +88 -0
- package/dist/docx/serializer/borderSerializer.d.ts +25 -0
- package/dist/docx/serializer/borderSerializer.js +44 -0
- package/dist/docx/serializer/commentSerializer.d.ts +31 -0
- package/dist/docx/serializer/commentSerializer.js +184 -0
- package/dist/docx/serializer/documentSerializer.d.ts +65 -0
- package/dist/docx/serializer/documentSerializer.js +199 -0
- package/dist/docx/serializer/headerFooterSerializer.d.ts +12 -0
- package/dist/docx/serializer/headerFooterSerializer.js +84 -0
- package/dist/docx/serializer/noteSerializer.d.ts +19 -0
- package/dist/docx/serializer/noteSerializer.js +70 -0
- package/dist/docx/serializer/numberingSerializer.d.ts +12 -0
- package/dist/docx/serializer/numberingSerializer.js +93 -0
- package/dist/docx/serializer/paragraphSerializer.d.ts +48 -0
- package/dist/docx/serializer/paragraphSerializer.js +559 -0
- package/dist/docx/serializer/runSerializer.d.ts +56 -0
- package/dist/docx/serializer/runSerializer.js +621 -0
- package/dist/docx/serializer/sectionPropertiesSerializer.d.ts +6 -0
- package/dist/docx/serializer/sectionPropertiesSerializer.js +187 -0
- package/dist/docx/serializer/tableSerializer.d.ts +79 -0
- package/dist/docx/serializer/tableSerializer.js +422 -0
- package/dist/docx/serializer/xmlUtils.d.ts +20 -0
- package/dist/docx/serializer/xmlUtils.js +25 -0
- package/dist/docx/settingsParser.d.ts +8 -0
- package/dist/docx/settingsParser.js +36 -0
- package/dist/docx/shapeParser.d.ts +20 -0
- package/dist/docx/shapeParser.js +272 -0
- package/dist/docx/styleParser.d.ts +50 -0
- package/dist/docx/styleParser.js +905 -0
- package/dist/docx/tableParser.d.ts +202 -0
- package/dist/docx/tableParser.js +811 -0
- package/dist/docx/textBoxParser.d.ts +117 -0
- package/dist/docx/textBoxParser.js +262 -0
- package/dist/docx/themeParser.d.ts +77 -0
- package/dist/docx/themeParser.js +330 -0
- package/dist/docx/trackedMoveRangeNormalization.d.ts +22 -0
- package/dist/docx/trackedMoveRangeNormalization.js +100 -0
- package/dist/docx/unzip.d.ts +118 -0
- package/dist/docx/unzip.js +383 -0
- package/dist/docx/vmlImageParser.d.ts +16 -0
- package/dist/docx/vmlImageParser.js +100 -0
- package/dist/docx/watermarkParser.d.ts +45 -0
- package/dist/docx/watermarkParser.js +348 -0
- package/dist/docx/wrapTypes.d.ts +29 -0
- package/dist/docx/wrapTypes.js +48 -0
- package/dist/docx/xmlParser.d.ts +297 -0
- package/dist/docx/xmlParser.js +527 -0
- package/dist/fields/bookmarkPages.d.ts +13 -0
- package/dist/fields/bookmarkPages.js +66 -0
- package/dist/fields/bookmarkText.d.ts +16 -0
- package/dist/fields/bookmarkText.js +61 -0
- package/dist/fields/evaluateField.d.ts +23 -0
- package/dist/fields/evaluateField.js +77 -0
- package/dist/fields/fieldContext.d.ts +21 -0
- package/dist/fields/fieldContext.js +0 -0
- package/dist/fields/resolveFieldValues.d.ts +44 -0
- package/dist/fields/resolveFieldValues.js +204 -0
- package/dist/fields/sectionPageCounts.d.ts +11 -0
- package/dist/fields/sectionPageCounts.js +16 -0
- package/dist/fields/seqValues.d.ts +14 -0
- package/dist/fields/seqValues.js +36 -0
- package/dist/fonts/embeddedFontTable.d.ts +42 -0
- package/dist/fonts/embeddedFontTable.js +80 -0
- package/dist/fonts/embeddedFonts.d.ts +46 -0
- package/dist/fonts/embeddedFonts.js +112 -0
- package/dist/fonts/fontDeobfuscation.d.ts +30 -0
- package/dist/fonts/fontDeobfuscation.js +57 -0
- package/dist/index.d.ts +28 -0
- package/dist/index.js +23 -0
- package/dist/layout-bridge/convert/footnoteLayout.d.ts +57 -0
- package/dist/layout-bridge/convert/footnoteLayout.js +316 -0
- package/dist/layout-bridge/convert/headerFooterLayout.d.ts +74 -0
- package/dist/layout-bridge/convert/headerFooterLayout.js +432 -0
- package/dist/layout-bridge/convert/templatePreviewFlow.d.ts +36 -0
- package/dist/layout-bridge/convert/templatePreviewFlow.js +176 -0
- package/dist/layout-bridge/convert/toFlowBlocks.d.ts +65 -0
- package/dist/layout-bridge/convert/toFlowBlocks.js +1309 -0
- package/dist/layout-bridge/convert/wrapEditorViewAsSurface.d.ts +17 -0
- package/dist/layout-bridge/convert/wrapEditorViewAsSurface.js +36 -0
- package/dist/layout-bridge/dom/clickToPositionDom.d.ts +66 -0
- package/dist/layout-bridge/dom/clickToPositionDom.js +304 -0
- package/dist/layout-bridge/dom/findBodyPmSpans.d.ts +7 -0
- package/dist/layout-bridge/dom/findBodyPmSpans.js +17 -0
- package/dist/layout-bridge/dom/findHfPmSpans.d.ts +62 -0
- package/dist/layout-bridge/dom/findHfPmSpans.js +197 -0
- package/dist/layout-bridge/engine/clickToPosition.d.ts +66 -0
- package/dist/layout-bridge/engine/clickToPosition.js +403 -0
- package/dist/layout-bridge/engine/hitTest.d.ts +135 -0
- package/dist/layout-bridge/engine/hitTest.js +375 -0
- package/dist/layout-bridge/engine/measuring/index.d.ts +10 -0
- package/dist/layout-bridge/engine/measuring/index.js +9 -0
- package/dist/layout-bridge/engine/selectionRects.d.ts +59 -0
- package/dist/layout-bridge/engine/selectionRects.js +485 -0
- package/dist/layout-bridge/engine/tableWidthUtils.d.ts +7 -0
- package/dist/layout-bridge/engine/tableWidthUtils.js +25 -0
- package/dist/layout-engine/index.d.ts +44 -0
- package/dist/layout-engine/index.js +691 -0
- package/dist/layout-engine/keep-together.d.ts +43 -0
- package/dist/layout-engine/keep-together.js +98 -0
- package/dist/layout-engine/layoutInstrumentation.d.ts +50 -0
- package/dist/layout-engine/layoutInstrumentation.js +43 -0
- package/dist/layout-engine/lineFlow.d.ts +8 -0
- package/dist/layout-engine/lineFlow.js +17 -0
- package/dist/layout-engine/measure/cache.d.ts +93 -0
- package/dist/layout-engine/measure/cache.js +245 -0
- package/dist/layout-engine/measure/clampFloatingWrapMargins.d.ts +20 -0
- package/dist/layout-engine/measure/clampFloatingWrapMargins.js +29 -0
- package/dist/layout-engine/measure/featureFlags.d.ts +44 -0
- package/dist/layout-engine/measure/featureFlags.js +19 -0
- package/dist/layout-engine/measure/floatingZones.d.ts +89 -0
- package/dist/layout-engine/measure/floatingZones.js +152 -0
- package/dist/layout-engine/measure/font-metrics.worker.d.ts +17 -0
- package/dist/layout-engine/measure/font-metrics.worker.js +104 -0
- package/dist/layout-engine/measure/index.d.ts +9 -0
- package/dist/layout-engine/measure/index.js +8 -0
- package/dist/layout-engine/measure/listMarkerWidth.d.ts +40 -0
- package/dist/layout-engine/measure/listMarkerWidth.js +76 -0
- package/dist/layout-engine/measure/measureBlocks.d.ts +25 -0
- package/dist/layout-engine/measure/measureBlocks.js +450 -0
- package/dist/layout-engine/measure/measureContainer.d.ts +24 -0
- package/dist/layout-engine/measure/measureContainer.js +280 -0
- package/dist/layout-engine/measure/measureHelpers.d.ts +82 -0
- package/dist/layout-engine/measure/measureHelpers.js +156 -0
- package/dist/layout-engine/measure/measureParagraph.d.ts +61 -0
- package/dist/layout-engine/measure/measureParagraph.js +724 -0
- package/dist/layout-engine/measure/measureProvider.d.ts +23 -0
- package/dist/layout-engine/measure/measureProvider.js +35 -0
- package/dist/layout-engine/measure/measureTypes.d.ts +61 -0
- package/dist/layout-engine/measure/measureTypes.js +0 -0
- package/dist/layout-engine/measure/measureWorker.d.ts +54 -0
- package/dist/layout-engine/measure/measureWorker.js +249 -0
- package/dist/layout-engine/measure/measureWorkerProtocol.d.ts +88 -0
- package/dist/layout-engine/measure/measureWorkerProtocol.js +20 -0
- package/dist/layout-engine/measure/tableCellFloating.d.ts +26 -0
- package/dist/layout-engine/measure/tableCellFloating.js +99 -0
- package/dist/layout-engine/paginator.d.ts +84 -0
- package/dist/layout-engine/paginator.js +348 -0
- package/dist/layout-engine/paragraphFragmentRange.d.ts +9 -0
- package/dist/layout-engine/paragraphFragmentRange.js +40 -0
- package/dist/layout-engine/section-breaks.d.ts +78 -0
- package/dist/layout-engine/section-breaks.js +182 -0
- package/dist/layout-engine/tableRowBreak.d.ts +23 -0
- package/dist/layout-engine/tableRowBreak.js +147 -0
- package/dist/layout-engine/textBoxFlow.d.ts +50 -0
- package/dist/layout-engine/textBoxFlow.js +160 -0
- package/dist/layout-engine/types.d.ts +1031 -0
- package/dist/layout-engine/types.js +100 -0
- package/dist/layout-painter/documentColors.d.ts +4 -0
- package/dist/layout-painter/documentColors.js +40 -0
- package/dist/layout-painter/index.d.ts +110 -0
- package/dist/layout-painter/index.js +182 -0
- package/dist/layout-painter/registry/modules/image.d.ts +6 -0
- package/dist/layout-painter/registry/modules/image.js +17 -0
- package/dist/layout-painter/registry/modules/paragraph.d.ts +6 -0
- package/dist/layout-painter/registry/modules/paragraph.js +18 -0
- package/dist/layout-painter/registry/modules/table.d.ts +6 -0
- package/dist/layout-painter/registry/modules/table.js +16 -0
- package/dist/layout-painter/registry/modules/textBox.d.ts +6 -0
- package/dist/layout-painter/registry/modules/textBox.js +13 -0
- package/dist/layout-painter/registry/modules.d.ts +6 -0
- package/dist/layout-painter/registry/modules.js +26 -0
- package/dist/layout-painter/registry/registry.d.ts +24 -0
- package/dist/layout-painter/registry/registry.js +53 -0
- package/dist/layout-painter/registry/types.d.ts +61 -0
- package/dist/layout-painter/registry/types.js +0 -0
- package/dist/layout-painter/renderFragment.d.ts +32 -0
- package/dist/layout-painter/renderFragment.js +114 -0
- package/dist/layout-painter/renderImage.d.ts +88 -0
- package/dist/layout-painter/renderImage.js +130 -0
- package/dist/layout-painter/renderPage.d.ts +264 -0
- package/dist/layout-painter/renderPage.js +1795 -0
- package/dist/layout-painter/renderParagraph.d.ts +93 -0
- package/dist/layout-painter/renderParagraph.js +1300 -0
- package/dist/layout-painter/renderTable.d.ts +36 -0
- package/dist/layout-painter/renderTable.js +432 -0
- package/dist/layout-painter/renderTextBox.d.ts +22 -0
- package/dist/layout-painter/renderTextBox.js +67 -0
- package/dist/layout-painter/renderUtils.d.ts +42 -0
- package/dist/layout-painter/renderUtils.js +30 -0
- package/dist/layout-painter/renderWatermark.d.ts +16 -0
- package/dist/layout-painter/renderWatermark.js +61 -0
- package/dist/layout-painter/sdtBoundary.d.ts +6 -0
- package/dist/layout-painter/sdtBoundary.js +28 -0
- package/dist/managers/ContextMenuManager.d.ts +28 -0
- package/dist/managers/ContextMenuManager.js +48 -0
- package/dist/managers/DocumentLoaderManager.d.ts +47 -0
- package/dist/managers/DocumentLoaderManager.js +69 -0
- package/dist/managers/EditorModeManager.d.ts +28 -0
- package/dist/managers/EditorModeManager.js +50 -0
- package/dist/managers/ErrorManager.d.ts +26 -0
- package/dist/managers/ErrorManager.js +85 -0
- package/dist/managers/FindReplaceManager.d.ts +54 -0
- package/dist/managers/FindReplaceManager.js +104 -0
- package/dist/managers/HistoryManager.d.ts +92 -0
- package/dist/managers/HistoryManager.js +193 -0
- package/dist/managers/Subscribable.d.ts +34 -0
- package/dist/managers/Subscribable.js +46 -0
- package/dist/managers/TableSelectionManager.d.ts +74 -0
- package/dist/managers/TableSelectionManager.js +225 -0
- package/dist/managers/editorShortcuts.d.ts +42 -0
- package/dist/managers/editorShortcuts.js +60 -0
- package/dist/managers/types.d.ts +41 -0
- package/dist/managers/types.js +0 -0
- package/dist/markdown/annotations.d.ts +14 -0
- package/dist/markdown/annotations.js +42 -0
- package/dist/markdown/escape.d.ts +36 -0
- package/dist/markdown/escape.js +59 -0
- package/dist/markdown/fromMarkdown.d.ts +11 -0
- package/dist/markdown/fromMarkdown.js +223 -0
- package/dist/markdown/headings.d.ts +13 -0
- package/dist/markdown/headings.js +20 -0
- package/dist/markdown/images.d.ts +13 -0
- package/dist/markdown/images.js +63 -0
- package/dist/markdown/index.d.ts +18 -0
- package/dist/markdown/index.js +33 -0
- package/dist/markdown/internals.d.ts +15 -0
- package/dist/markdown/internals.js +35 -0
- package/dist/markdown/renderBlock.d.ts +7 -0
- package/dist/markdown/renderBlock.js +68 -0
- package/dist/markdown/renderParagraph.d.ts +11 -0
- package/dist/markdown/renderParagraph.js +64 -0
- package/dist/markdown/renderRuns.d.ts +11 -0
- package/dist/markdown/renderRuns.js +265 -0
- package/dist/markdown/renderTable.d.ts +8 -0
- package/dist/markdown/renderTable.js +229 -0
- package/dist/markdown/trailers.d.ts +13 -0
- package/dist/markdown/trailers.js +54 -0
- package/dist/markdown/types.d.ts +118 -0
- package/dist/markdown/types.js +0 -0
- package/dist/model.d.ts +13 -0
- package/dist/model.js +4 -0
- package/dist/paged-layout/LayoutSelectionGate.d.ts +80 -0
- package/dist/paged-layout/LayoutSelectionGate.js +131 -0
- package/dist/paged-layout/headerFooterMargins.d.ts +73 -0
- package/dist/paged-layout/headerFooterMargins.js +120 -0
- package/dist/paged-layout/hiddenEditorScroll.d.ts +4 -0
- package/dist/paged-layout/hiddenEditorScroll.js +4 -0
- package/dist/paged-layout/incrementalMeasure.d.ts +33 -0
- package/dist/paged-layout/incrementalMeasure.js +56 -0
- package/dist/paged-layout/rangeProjection.d.ts +51 -0
- package/dist/paged-layout/rangeProjection.js +153 -0
- package/dist/paged-layout/readOnlyEditAttempt.d.ts +5 -0
- package/dist/paged-layout/readOnlyEditAttempt.js +22 -0
- package/dist/paged-layout/scrollNavigation.d.ts +23 -0
- package/dist/paged-layout/scrollNavigation.js +31 -0
- package/dist/paged-layout/scrollPageInfo.d.ts +41 -0
- package/dist/paged-layout/scrollPageInfo.js +34 -0
- package/dist/paged-layout/scrollToPmPosition.d.ts +17 -0
- package/dist/paged-layout/scrollToPmPosition.js +95 -0
- package/dist/paged-layout/sectionBlockWidths.d.ts +35 -0
- package/dist/paged-layout/sectionBlockWidths.js +52 -0
- package/dist/paged-layout/sectionGeometry.d.ts +21 -0
- package/dist/paged-layout/sectionGeometry.js +36 -0
- package/dist/paged-layout/selectionViewportRect.d.ts +29 -0
- package/dist/paged-layout/selectionViewportRect.js +55 -0
- package/dist/paged-layout/tableColumnResize.d.ts +19 -0
- package/dist/paged-layout/tableColumnResize.js +28 -0
- package/dist/paged-layout/tableInsertButtonGeometry.d.ts +15 -0
- package/dist/paged-layout/tableInsertButtonGeometry.js +15 -0
- package/dist/paged-layout/transactionDirtyRange.d.ts +7 -0
- package/dist/paged-layout/transactionDirtyRange.js +27 -0
- package/dist/paged-layout/zoomScrollAnchor.d.ts +40 -0
- package/dist/paged-layout/zoomScrollAnchor.js +25 -0
- package/dist/prosemirror/attrs/index.d.ts +80 -0
- package/dist/prosemirror/attrs/index.js +1218 -0
- package/dist/prosemirror/autospacingBase.d.ts +11 -0
- package/dist/prosemirror/autospacingBase.js +16 -0
- package/dist/prosemirror/commands/comments.d.ts +93 -0
- package/dist/prosemirror/commands/comments.js +435 -0
- package/dist/prosemirror/commands/contentControls.d.ts +45 -0
- package/dist/prosemirror/commands/contentControls.js +294 -0
- package/dist/prosemirror/commands/contentControlsBlockFill.d.ts +15 -0
- package/dist/prosemirror/commands/contentControlsBlockFill.js +19 -0
- package/dist/prosemirror/commands/formatPainter.d.ts +31 -0
- package/dist/prosemirror/commands/formatPainter.js +130 -0
- package/dist/prosemirror/commands/formatting.d.ts +32 -0
- package/dist/prosemirror/commands/formatting.js +45 -0
- package/dist/prosemirror/commands/hyperlink.d.ts +31 -0
- package/dist/prosemirror/commands/hyperlink.js +79 -0
- package/dist/prosemirror/commands/image.d.ts +59 -0
- package/dist/prosemirror/commands/image.js +219 -0
- package/dist/prosemirror/commands/index.d.ts +13 -0
- package/dist/prosemirror/commands/index.js +13 -0
- package/dist/prosemirror/commands/pageBreak.d.ts +10 -0
- package/dist/prosemirror/commands/pageBreak.js +47 -0
- package/dist/prosemirror/commands/paragraph.d.ts +39 -0
- package/dist/prosemirror/commands/paragraph.js +64 -0
- package/dist/prosemirror/commands/pastePlainText.d.ts +39 -0
- package/dist/prosemirror/commands/pastePlainText.js +67 -0
- package/dist/prosemirror/commands/table.d.ts +83 -0
- package/dist/prosemirror/commands/table.js +105 -0
- package/dist/prosemirror/conversion/fromProseDoc.d.ts +27 -0
- package/dist/prosemirror/conversion/fromProseDoc.js +1550 -0
- package/dist/prosemirror/conversion/index.d.ts +4 -0
- package/dist/prosemirror/conversion/index.js +4 -0
- package/dist/prosemirror/conversion/runShadingMark.d.ts +16 -0
- package/dist/prosemirror/conversion/runShadingMark.js +39 -0
- package/dist/prosemirror/conversion/toProseDoc.d.ts +39 -0
- package/dist/prosemirror/conversion/toProseDoc.js +1404 -0
- package/dist/prosemirror/extensions/ExtensionManager.d.ts +43 -0
- package/dist/prosemirror/extensions/ExtensionManager.js +86 -0
- package/dist/prosemirror/extensions/StarterKit.d.ts +16 -0
- package/dist/prosemirror/extensions/StarterKit.js +132 -0
- package/dist/prosemirror/extensions/core/DocExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/core/DocExtension.js +12 -0
- package/dist/prosemirror/extensions/core/HistoryExtension.d.ts +13 -0
- package/dist/prosemirror/extensions/core/HistoryExtension.js +28 -0
- package/dist/prosemirror/extensions/core/ParagraphExtension.d.ts +25 -0
- package/dist/prosemirror/extensions/core/ParagraphExtension.js +619 -0
- package/dist/prosemirror/extensions/core/TextExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/core/TextExtension.js +12 -0
- package/dist/prosemirror/extensions/create.d.ts +17 -0
- package/dist/prosemirror/extensions/create.js +129 -0
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.d.ts +23 -0
- package/dist/prosemirror/extensions/features/AutoBidiDetectionExtension.js +106 -0
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.d.ts +8 -0
- package/dist/prosemirror/extensions/features/BaseKeymapExtension.js +172 -0
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.d.ts +16 -0
- package/dist/prosemirror/extensions/features/BidiShortcutExtension.js +38 -0
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.d.ts +16 -0
- package/dist/prosemirror/extensions/features/ContentControlWidgetsExtension.js +21 -0
- package/dist/prosemirror/extensions/features/DropCursorExtension.d.ts +12 -0
- package/dist/prosemirror/extensions/features/DropCursorExtension.js +20 -0
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.d.ts +8 -0
- package/dist/prosemirror/extensions/features/EmptyParagraphFormatExtension.js +44 -0
- package/dist/prosemirror/extensions/features/GapCursorExtension.d.ts +19 -0
- package/dist/prosemirror/extensions/features/GapCursorExtension.js +24 -0
- package/dist/prosemirror/extensions/features/ImageDragExtension.d.ts +15 -0
- package/dist/prosemirror/extensions/features/ImageDragExtension.js +66 -0
- package/dist/prosemirror/extensions/features/ImagePasteExtension.d.ts +12 -0
- package/dist/prosemirror/extensions/features/ImagePasteExtension.js +91 -0
- package/dist/prosemirror/extensions/features/ListExtension.d.ts +14 -0
- package/dist/prosemirror/extensions/features/ListExtension.js +340 -0
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/features/ParaIdAllocatorExtension.js +60 -0
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.d.ts +35 -0
- package/dist/prosemirror/extensions/features/ParagraphChangeTrackerExtension.js +188 -0
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.d.ts +20 -0
- package/dist/prosemirror/extensions/features/PasteCleanupExtension.js +34 -0
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.d.ts +20 -0
- package/dist/prosemirror/extensions/features/PasteStyleInlinerExtension.js +145 -0
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.d.ts +10 -0
- package/dist/prosemirror/extensions/features/SelectionTrackerExtension.js +17 -0
- package/dist/prosemirror/extensions/features/bidiShortcutController.d.ts +31 -0
- package/dist/prosemirror/extensions/features/bidiShortcutController.js +27 -0
- package/dist/prosemirror/extensions/features/pasteCleanup.d.ts +31 -0
- package/dist/prosemirror/extensions/features/pasteCleanup.js +159 -0
- package/dist/prosemirror/extensions/marks/AllCapsExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/AllCapsExtension.js +24 -0
- package/dist/prosemirror/extensions/marks/BoldExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/BoldExtension.js +41 -0
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.d.ts +14 -0
- package/dist/prosemirror/extensions/marks/CharacterSpacingExtension.js +64 -0
- package/dist/prosemirror/extensions/marks/CharacterStyleExtension.d.ts +23 -0
- package/dist/prosemirror/extensions/marks/CharacterStyleExtension.js +47 -0
- package/dist/prosemirror/extensions/marks/CommentExtension.d.ts +12 -0
- package/dist/prosemirror/extensions/marks/CommentExtension.js +38 -0
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/FontFamilyExtension.js +55 -0
- package/dist/prosemirror/extensions/marks/FontSizeExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/FontSizeExtension.js +47 -0
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/marks/FootnoteRefExtension.js +92 -0
- package/dist/prosemirror/extensions/marks/HiddenTextExtension.d.ts +23 -0
- package/dist/prosemirror/extensions/marks/HiddenTextExtension.js +35 -0
- package/dist/prosemirror/extensions/marks/HighlightExtension.d.ts +10 -0
- package/dist/prosemirror/extensions/marks/HighlightExtension.js +115 -0
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.d.ts +13 -0
- package/dist/prosemirror/extensions/marks/HyperlinkExtension.js +146 -0
- package/dist/prosemirror/extensions/marks/ItalicExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/ItalicExtension.js +34 -0
- package/dist/prosemirror/extensions/marks/RtlExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/marks/RtlExtension.js +21 -0
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.d.ts +11 -0
- package/dist/prosemirror/extensions/marks/RunFormattingOverrideExtension.js +75 -0
- package/dist/prosemirror/extensions/marks/RunShadingExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/marks/RunShadingExtension.js +38 -0
- package/dist/prosemirror/extensions/marks/SmallCapsExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/SmallCapsExtension.js +24 -0
- package/dist/prosemirror/extensions/marks/StrikeExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/StrikeExtension.js +33 -0
- package/dist/prosemirror/extensions/marks/SubscriptExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/SubscriptExtension.js +25 -0
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/SuperscriptExtension.js +25 -0
- package/dist/prosemirror/extensions/marks/TextColorExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/TextColorExtension.js +50 -0
- package/dist/prosemirror/extensions/marks/TextEffectExtension.d.ts +6 -0
- package/dist/prosemirror/extensions/marks/TextEffectExtension.js +35 -0
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.d.ts +31 -0
- package/dist/prosemirror/extensions/marks/TextEffectsExtensions.js +134 -0
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.d.ts +22 -0
- package/dist/prosemirror/extensions/marks/TrackedChangeExtensions.js +113 -0
- package/dist/prosemirror/extensions/marks/UnderlineExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/marks/UnderlineExtension.js +60 -0
- package/dist/prosemirror/extensions/marks/markUtils.d.ts +34 -0
- package/dist/prosemirror/extensions/marks/markUtils.js +233 -0
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.d.ts +22 -0
- package/dist/prosemirror/extensions/nodes/BlockSdtExtension.js +122 -0
- package/dist/prosemirror/extensions/nodes/FieldExtension.d.ts +12 -0
- package/dist/prosemirror/extensions/nodes/FieldExtension.js +87 -0
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/nodes/HardBreakExtension.js +38 -0
- package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/nodes/HorizontalRuleExtension.js +18 -0
- package/dist/prosemirror/extensions/nodes/ImageExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/nodes/ImageExtension.js +132 -0
- package/dist/prosemirror/extensions/nodes/MathExtension.d.ts +13 -0
- package/dist/prosemirror/extensions/nodes/MathExtension.js +56 -0
- package/dist/prosemirror/extensions/nodes/PageBreakExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/nodes/PageBreakExtension.js +20 -0
- package/dist/prosemirror/extensions/nodes/SdtExtension.d.ts +12 -0
- package/dist/prosemirror/extensions/nodes/SdtExtension.js +107 -0
- package/dist/prosemirror/extensions/nodes/ShapeExtension.d.ts +30 -0
- package/dist/prosemirror/extensions/nodes/ShapeExtension.js +502 -0
- package/dist/prosemirror/extensions/nodes/TabExtension.d.ts +9 -0
- package/dist/prosemirror/extensions/nodes/TabExtension.js +27 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.d.ts +34 -0
- package/dist/prosemirror/extensions/nodes/TableExtension.js +1972 -0
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.d.ts +34 -0
- package/dist/prosemirror/extensions/nodes/TextBoxExtension.js +150 -0
- package/dist/prosemirror/extensions/types.d.ts +101 -0
- package/dist/prosemirror/extensions/types.js +10 -0
- package/dist/prosemirror/findReplaceSelection.d.ts +23 -0
- package/dist/prosemirror/findReplaceSelection.js +86 -0
- package/dist/prosemirror/index.d.ts +25 -0
- package/dist/prosemirror/index.js +23 -0
- package/dist/prosemirror/insertOperations.d.ts +12 -0
- package/dist/prosemirror/insertOperations.js +19 -0
- package/dist/prosemirror/paragraphDirection.d.ts +42 -0
- package/dist/prosemirror/paragraphDirection.js +33 -0
- package/dist/prosemirror/plugins/aiCitationDecorations.d.ts +40 -0
- package/dist/prosemirror/plugins/aiCitationDecorations.js +90 -0
- package/dist/prosemirror/plugins/aiSuggestionDecorations.d.ts +42 -0
- package/dist/prosemirror/plugins/aiSuggestionDecorations.js +135 -0
- package/dist/prosemirror/plugins/anonymizationDecorations.d.ts +60 -0
- package/dist/prosemirror/plugins/anonymizationDecorations.js +120 -0
- package/dist/prosemirror/plugins/autocompleteSuggestion.d.ts +123 -0
- package/dist/prosemirror/plugins/autocompleteSuggestion.js +283 -0
- package/dist/prosemirror/plugins/contentControlWidgets.d.ts +56 -0
- package/dist/prosemirror/plugins/contentControlWidgets.js +192 -0
- package/dist/prosemirror/plugins/createDocScanPlugin.d.ts +37 -0
- package/dist/prosemirror/plugins/createDocScanPlugin.js +55 -0
- package/dist/prosemirror/plugins/documentStyles.d.ts +18 -0
- package/dist/prosemirror/plugins/documentStyles.js +46 -0
- package/dist/prosemirror/plugins/index.d.ts +3 -0
- package/dist/prosemirror/plugins/index.js +3 -0
- package/dist/prosemirror/plugins/pmTextScan.d.ts +19 -0
- package/dist/prosemirror/plugins/pmTextScan.js +39 -0
- package/dist/prosemirror/plugins/selectionTracker.d.ts +43 -0
- package/dist/prosemirror/plugins/selectionTracker.js +179 -0
- package/dist/prosemirror/plugins/suggestionMode.d.ts +70 -0
- package/dist/prosemirror/plugins/suggestionMode.js +489 -0
- package/dist/prosemirror/plugins/templateDirectives.d.ts +25 -0
- package/dist/prosemirror/plugins/templateDirectives.js +67 -0
- package/dist/prosemirror/plugins/templatePreviewValues.d.ts +49 -0
- package/dist/prosemirror/plugins/templatePreviewValues.js +117 -0
- package/dist/prosemirror/plugins/templateSlashMenu.d.ts +57 -0
- package/dist/prosemirror/plugins/templateSlashMenu.js +184 -0
- package/dist/prosemirror/schema/index.d.ts +15 -0
- package/dist/prosemirror/schema/index.js +20 -0
- package/dist/prosemirror/schema/marks.d.ts +118 -0
- package/dist/prosemirror/schema/marks.js +0 -0
- package/dist/prosemirror/schema/nodes.d.ts +389 -0
- package/dist/prosemirror/schema/nodes.js +0 -0
- package/dist/prosemirror/selectionState.d.ts +23 -0
- package/dist/prosemirror/selectionState.js +111 -0
- package/dist/prosemirror/styles/index.d.ts +2 -0
- package/dist/prosemirror/styles/index.js +2 -0
- package/dist/prosemirror/styles/resolvedStyleAttrs.d.ts +32 -0
- package/dist/prosemirror/styles/resolvedStyleAttrs.js +108 -0
- package/dist/prosemirror/styles/styleResolver.d.ts +94 -0
- package/dist/prosemirror/styles/styleResolver.js +200 -0
- package/dist/prosemirror/utils/findParagraphByParaId.d.ts +26 -0
- package/dist/prosemirror/utils/findParagraphByParaId.js +37 -0
- package/dist/prosemirror/utils/tabCalculator.d.ts +110 -0
- package/dist/prosemirror/utils/tabCalculator.js +137 -0
- package/dist/prosemirror/validation.d.ts +20 -0
- package/dist/prosemirror/validation.js +177 -0
- package/dist/server.d.ts +7 -0
- package/dist/server.js +6 -0
- package/dist/style-engine/index.d.ts +3 -0
- package/dist/style-engine/index.js +2 -0
- package/dist/style-engine/styleEngine.d.ts +67 -0
- package/dist/style-engine/styleEngine.js +70 -0
- package/dist/types/block-id.d.ts +58 -0
- package/dist/types/block-id.js +61 -0
- package/dist/types/colors.d.ts +2 -0
- package/dist/types/colors.js +0 -0
- package/dist/types/content.d.ts +2 -0
- package/dist/types/content.js +0 -0
- package/dist/types/document.d.ts +7 -0
- package/dist/types/document.js +0 -0
- package/dist/types/documentEnumValues.d.ts +89 -0
- package/dist/types/documentEnumValues.js +693 -0
- package/dist/types/formatting.d.ts +2 -0
- package/dist/types/formatting.js +0 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/index.js +0 -0
- package/dist/utils/authorColors.d.ts +16 -0
- package/dist/utils/authorColors.js +30 -0
- package/dist/utils/baseDirection.d.ts +23 -0
- package/dist/utils/baseDirection.js +34 -0
- package/dist/utils/clipboard.d.ts +126 -0
- package/dist/utils/clipboard.js +622 -0
- package/dist/utils/colorResolver.d.ts +158 -0
- package/dist/utils/colorResolver.js +557 -0
- package/dist/utils/createDocument.d.ts +50 -0
- package/dist/utils/createDocument.js +262 -0
- package/dist/utils/documentLoaderBehavior.d.ts +22 -0
- package/dist/utils/documentLoaderBehavior.js +14 -0
- package/dist/utils/docxInput.d.ts +22 -0
- package/dist/utils/docxInput.js +16 -0
- package/dist/utils/domGuards.d.ts +59 -0
- package/dist/utils/domGuards.js +82 -0
- package/dist/utils/fontFamilyMerge.d.ts +7 -0
- package/dist/utils/fontFamilyMerge.js +31 -0
- package/dist/utils/fontLoader.d.ts +50 -0
- package/dist/utils/fontLoader.js +177 -0
- package/dist/utils/fontResolver.d.ts +61 -0
- package/dist/utils/fontResolver.js +651 -0
- package/dist/utils/fontWeights.d.ts +4 -0
- package/dist/utils/fontWeights.js +4 -0
- package/dist/utils/formatToStyle.d.ts +103 -0
- package/dist/utils/formatToStyle.js +289 -0
- package/dist/utils/headerFooter.d.ts +74 -0
- package/dist/utils/headerFooter.js +257 -0
- package/dist/utils/headingCollector.d.ts +22 -0
- package/dist/utils/headingCollector.js +36 -0
- package/dist/utils/hexId.d.ts +33 -0
- package/dist/utils/hexId.js +37 -0
- package/dist/utils/imageValidation.d.ts +5 -0
- package/dist/utils/imageValidation.js +31 -0
- package/dist/utils/paragraphFormattingMerge.d.ts +14 -0
- package/dist/utils/paragraphFormattingMerge.js +68 -0
- package/dist/utils/replaceText.d.ts +17 -0
- package/dist/utils/replaceText.js +161 -0
- package/dist/utils/rotationBoundingBox.d.ts +12 -0
- package/dist/utils/rotationBoundingBox.js +36 -0
- package/dist/utils/scriptSegments.d.ts +36 -0
- package/dist/utils/scriptSegments.js +52 -0
- package/dist/utils/tableOperations.d.ts +87 -0
- package/dist/utils/tableOperations.js +259 -0
- package/dist/utils/textFormattingMerge.d.ts +6 -0
- package/dist/utils/textFormattingMerge.js +31 -0
- package/dist/utils/tiffConverter.d.ts +18 -0
- package/dist/utils/tiffConverter.js +83 -0
- package/dist/utils/units.d.ts +99 -0
- package/dist/utils/units.js +139 -0
- package/dist/utils/urlSecurity.d.ts +7 -0
- package/dist/utils/urlSecurity.js +65 -0
- package/dist/watermark/index.d.ts +39 -0
- package/dist/watermark/index.js +149 -0
- package/package.json +122 -2
|
@@ -0,0 +1,1031 @@
|
|
|
1
|
+
import { OutlineStyleAttr } from "../types/documentEnumValues.js";
|
|
2
|
+
import { ImagePosition, ImageWrap, SdtProperties, SdtType, TableWidthType } from "@stll/docx-core/model";
|
|
3
|
+
|
|
4
|
+
//#region src/layout-engine/types.d.ts
|
|
5
|
+
declare namespace types_d_exports {
|
|
6
|
+
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, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun };
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Unique identifier for a block in the document.
|
|
10
|
+
* Format: typically `${index}-${type}` or just the block index.
|
|
11
|
+
*/
|
|
12
|
+
type BlockId = string | number;
|
|
13
|
+
/**
|
|
14
|
+
* Common run formatting properties applied to text runs.
|
|
15
|
+
*/
|
|
16
|
+
type RunFormatting = {
|
|
17
|
+
bold?: boolean;
|
|
18
|
+
italic?: boolean;
|
|
19
|
+
underline?: boolean | {
|
|
20
|
+
style?: string;
|
|
21
|
+
color?: string;
|
|
22
|
+
};
|
|
23
|
+
strike?: boolean;
|
|
24
|
+
color?: string;
|
|
25
|
+
textColorSource?: "direct" | "paragraphDefault";
|
|
26
|
+
highlight?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Run-level shading (w:shd) used as a background, stored as a *resolved CSS*
|
|
29
|
+
* color (like `highlight`). Painted only when there is no `highlight` (an
|
|
30
|
+
* explicit highlight wins). eigenpal #722 (#712).
|
|
31
|
+
*/
|
|
32
|
+
shading?: string;
|
|
33
|
+
fontFamily?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Resolved East-Asian font (`w:eastAsia` / `eastAsiaTheme`). CJK code points
|
|
36
|
+
* in this run measure and paint with this font; non-CJK keeps `fontFamily`
|
|
37
|
+
* (ascii/hAnsi). Both the measurer and the painter segment identically (see
|
|
38
|
+
* `segmentByScript`) so wrapping stays correct. Absent means CJK falls back
|
|
39
|
+
* to `fontFamily`.
|
|
40
|
+
*/
|
|
41
|
+
eastAsiaFontFamily?: string;
|
|
42
|
+
fontSize?: number;
|
|
43
|
+
letterSpacing?: number;
|
|
44
|
+
superscript?: boolean;
|
|
45
|
+
subscript?: boolean; /** Render glyphs as uppercase regardless of source case. */
|
|
46
|
+
allCaps?: boolean; /** Render lowercase glyphs as small uppercase. */
|
|
47
|
+
smallCaps?: boolean; /** Vertical baseline shift in CSS pixels. */
|
|
48
|
+
positionPx?: number; /** Horizontal text scale as a percentage. */
|
|
49
|
+
horizontalScale?: number; /** Minimum font size in points at which kerning is enabled. */
|
|
50
|
+
kerningMinPt?: number;
|
|
51
|
+
imprint?: boolean;
|
|
52
|
+
emboss?: boolean;
|
|
53
|
+
textShadow?: boolean;
|
|
54
|
+
textOutline?: boolean;
|
|
55
|
+
emphasisMark?: "dot" | "comma" | "circle" | "underDot";
|
|
56
|
+
/**
|
|
57
|
+
* Hidden run (OOXML w:vanish, §17.3.2.41). Word's print/normal view
|
|
58
|
+
* suppresses it entirely, but the editing view dims it with a dotted
|
|
59
|
+
* underline so the author can navigate to and edit it. The painter
|
|
60
|
+
* mirrors the editing-view treatment so PM cursor traversal works.
|
|
61
|
+
*/
|
|
62
|
+
hidden?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Per-run right-to-left direction (w:rtl). When true the painter sets
|
|
65
|
+
* `dir="rtl"` on the run span; the browser's bidi algorithm handles
|
|
66
|
+
* reordering. `false` means an explicit override that disables inherited
|
|
67
|
+
* RTL; the painter sets `dir="ltr"` so style/paragraph RTL does not leak in.
|
|
68
|
+
*/
|
|
69
|
+
rtl?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Text effect animation hint (w:effect). Word 2013+ no longer animates,
|
|
72
|
+
* but the painter emits `docx-text-effect-<name>` plus `data-effect` so
|
|
73
|
+
* host CSS can opt in.
|
|
74
|
+
*/
|
|
75
|
+
textEffect?: "blinkBackground" | "lights" | "antsBlack" | "antsRed" | "shimmer" | "sparkle"; /** Hyperlink info if this run is a link */
|
|
76
|
+
hyperlink?: HyperlinkInfo; /** Footnote reference ID (if this run contains a footnote reference) */
|
|
77
|
+
footnoteRefId?: number; /** Endnote reference ID (if this run contains an endnote reference) */
|
|
78
|
+
endnoteRefId?: number; /** Comment IDs if this run is within a comment range */
|
|
79
|
+
commentIds?: number[]; /** Whether this run is a tracked insertion */
|
|
80
|
+
isInsertion?: boolean; /** Whether this run is a tracked deletion */
|
|
81
|
+
isDeletion?: boolean; /** Author of the tracked change */
|
|
82
|
+
changeAuthor?: string; /** Date of the tracked change */
|
|
83
|
+
changeDate?: string; /** Revision ID of the tracked change (for sidebar matching) */
|
|
84
|
+
changeRevisionId?: number;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Hyperlink information for a run.
|
|
88
|
+
*/
|
|
89
|
+
type HyperlinkInfo = {
|
|
90
|
+
href: string;
|
|
91
|
+
tooltip?: string;
|
|
92
|
+
/**
|
|
93
|
+
* When true, the painter must not apply Word-default link styling
|
|
94
|
+
* (blue + underline) to this run. Set by the bridge for TOC entries —
|
|
95
|
+
* Word renders TOCx hyperlinks in the paragraph's own colour, not in
|
|
96
|
+
* the Hyperlink character style. The PM doc keeps the original marks
|
|
97
|
+
* so copy/paste out of a TOC still carries Hyperlink styling.
|
|
98
|
+
*/
|
|
99
|
+
noDefaultStyle?: boolean;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* A text run within a paragraph.
|
|
103
|
+
*/
|
|
104
|
+
type TextRun = RunFormatting & {
|
|
105
|
+
kind: "text";
|
|
106
|
+
text: string; /** Hyperlink information if this run is a link. */
|
|
107
|
+
hyperlink?: HyperlinkInfo; /** Absolute ProseMirror position (inclusive) of first character. */
|
|
108
|
+
pmStart?: number; /** Absolute ProseMirror position (exclusive) after last character. */
|
|
109
|
+
pmEnd?: number;
|
|
110
|
+
/**
|
|
111
|
+
* Set when this run is a template fill-preview substitution: the text is
|
|
112
|
+
* the typed value while [pmStart, pmEnd) still addresses the source
|
|
113
|
+
* `{{marker}}` range, so `text.length` may differ from the PM span. The
|
|
114
|
+
* painter adds the preview classes from this (`highlighted` paints the
|
|
115
|
+
* accent chip); pm↔char mappers must use the run's own pm bounds instead
|
|
116
|
+
* of assuming one PM position per character.
|
|
117
|
+
*/
|
|
118
|
+
templatePreview?: "highlighted" | "plain";
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* A tab character run.
|
|
122
|
+
*/
|
|
123
|
+
type TabRun = RunFormatting & {
|
|
124
|
+
kind: "tab";
|
|
125
|
+
width?: number;
|
|
126
|
+
pmStart?: number;
|
|
127
|
+
pmEnd?: number;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Position data for floating/anchored images.
|
|
131
|
+
*/
|
|
132
|
+
type ImageRunPosition = {
|
|
133
|
+
horizontal?: {
|
|
134
|
+
relativeTo?: NonNullable<ImagePosition["horizontal"]["relativeTo"]>;
|
|
135
|
+
posOffset?: number;
|
|
136
|
+
align?: NonNullable<ImagePosition["horizontal"]["alignment"]>;
|
|
137
|
+
};
|
|
138
|
+
vertical?: {
|
|
139
|
+
relativeTo?: NonNullable<ImagePosition["vertical"]["relativeTo"]>;
|
|
140
|
+
posOffset?: number;
|
|
141
|
+
align?: NonNullable<ImagePosition["vertical"]["alignment"]>;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* An inline image run.
|
|
146
|
+
*/
|
|
147
|
+
type ImageRun = {
|
|
148
|
+
kind: "image";
|
|
149
|
+
src: string;
|
|
150
|
+
width: number;
|
|
151
|
+
height: number;
|
|
152
|
+
alt?: string; /** CSS transform string (rotation, flip) */
|
|
153
|
+
transform?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
|
|
156
|
+
* fully opaque; the painter emits no CSS `opacity` in that case.
|
|
157
|
+
* eigenpal #424 (opacity render pipeline).
|
|
158
|
+
*/
|
|
159
|
+
opacity?: number; /** Position for floating/anchored images */
|
|
160
|
+
position?: ImageRunPosition; /** Wrap type from DOCX (inline, square, tight, through, topAndBottom, etc.) */
|
|
161
|
+
wrapType?: ImageWrap["type"]; /** Display mode for CSS rendering */
|
|
162
|
+
displayMode?: "inline" | "block" | "float"; /** CSS float direction */
|
|
163
|
+
cssFloat?: "left" | "right" | "none"; /** Wrap distances in pixels */
|
|
164
|
+
distTop?: number;
|
|
165
|
+
distBottom?: number;
|
|
166
|
+
distLeft?: number;
|
|
167
|
+
distRight?: number;
|
|
168
|
+
/**
|
|
169
|
+
* wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`
|
|
170
|
+
* to match Word's visible region. eigenpal #424 (image-crop subset).
|
|
171
|
+
*/
|
|
172
|
+
cropTop?: number;
|
|
173
|
+
cropRight?: number;
|
|
174
|
+
cropBottom?: number;
|
|
175
|
+
cropLeft?: number; /** Whether this picture is itself a tracked insertion (`<w:ins>`). eigenpal #641. */
|
|
176
|
+
isInsertion?: boolean; /** Whether this picture is itself a tracked deletion (`<w:del>`). eigenpal #641. */
|
|
177
|
+
isDeletion?: boolean; /** Author of the tracked change wrapping the picture. eigenpal #641. */
|
|
178
|
+
changeAuthor?: string; /** Date of the tracked change wrapping the picture. eigenpal #641. */
|
|
179
|
+
changeDate?: string; /** Revision id of the tracked change wrapping the picture. eigenpal #641. */
|
|
180
|
+
changeRevisionId?: number;
|
|
181
|
+
pmStart?: number;
|
|
182
|
+
pmEnd?: number;
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* A line break run.
|
|
186
|
+
*/
|
|
187
|
+
type LineBreakRun = {
|
|
188
|
+
kind: "lineBreak";
|
|
189
|
+
pmStart?: number;
|
|
190
|
+
pmEnd?: number;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* A field run (PAGE, NUMPAGES, etc.) that gets substituted at render time.
|
|
194
|
+
*/
|
|
195
|
+
type FieldRun = RunFormatting & {
|
|
196
|
+
kind: "field"; /** Coarse render category, kept for cache keys and caret-width fast paths. */
|
|
197
|
+
fieldType: "PAGE" | "NUMPAGES" | "DATE" | "TIME" | "OTHER";
|
|
198
|
+
/** Full OOXML field instruction (e.g. `PAGE \* ROMAN`, `PAGEREF _Ref1 \h`)
|
|
199
|
+
* for live evaluation; falls back to `fieldType` when absent. */
|
|
200
|
+
instruction?: string; /** Fallback text if field can't be resolved */
|
|
201
|
+
fallback?: string; /** Whether OOXML marked this field as locked (`w:fldLock`). */
|
|
202
|
+
fldLock?: boolean;
|
|
203
|
+
pmStart?: number;
|
|
204
|
+
pmEnd?: number;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* A native math equation run. The painter converts `ommlXml` to MathML
|
|
208
|
+
* and injects a `<math>` element inline; `plainText` is the screen-reader
|
|
209
|
+
* fallback and the measurer's width estimate.
|
|
210
|
+
*
|
|
211
|
+
* The raw OMML XML lives on the run so the painter can re-convert when
|
|
212
|
+
* markup changes; it is never modified on save (round-trip happens via
|
|
213
|
+
* the document model, not the layout layer).
|
|
214
|
+
*/
|
|
215
|
+
type MathRun = RunFormatting & {
|
|
216
|
+
kind: "math"; /** `inline` = `<m:oMath>`, `block` = `<m:oMathPara>`. */
|
|
217
|
+
display: "inline" | "block"; /** Raw OMML XML for conversion + round-trip. */
|
|
218
|
+
ommlXml: string; /** Plain-text fallback used when MathML rendering is unavailable. */
|
|
219
|
+
plainText: string;
|
|
220
|
+
pmStart?: number;
|
|
221
|
+
pmEnd?: number;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* Union of all run types.
|
|
225
|
+
*/
|
|
226
|
+
type Run = TextRun | TabRun | ImageRun | LineBreakRun | FieldRun | MathRun;
|
|
227
|
+
/**
|
|
228
|
+
* Paragraph spacing configuration.
|
|
229
|
+
*/
|
|
230
|
+
type ParagraphSpacing = {
|
|
231
|
+
before?: number;
|
|
232
|
+
after?: number;
|
|
233
|
+
line?: number;
|
|
234
|
+
lineUnit?: "px" | "multiplier";
|
|
235
|
+
lineRule?: "auto" | "exact" | "atLeast";
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Paragraph indentation configuration.
|
|
239
|
+
*/
|
|
240
|
+
type ParagraphIndent = {
|
|
241
|
+
left?: number;
|
|
242
|
+
right?: number;
|
|
243
|
+
firstLine?: number;
|
|
244
|
+
hanging?: number;
|
|
245
|
+
};
|
|
246
|
+
/**
|
|
247
|
+
* Tab stop alignment types
|
|
248
|
+
*/
|
|
249
|
+
type TabAlignment = "start" | "end" | "center" | "decimal" | "bar" | "clear";
|
|
250
|
+
/**
|
|
251
|
+
* Tab stop definition
|
|
252
|
+
*/
|
|
253
|
+
type TabStop = {
|
|
254
|
+
/** Tab alignment mode */val: TabAlignment; /** Position in twips from left margin */
|
|
255
|
+
pos: number; /** Optional leader character */
|
|
256
|
+
leader?: "none" | "dot" | "hyphen" | "underscore" | "heavy" | "middleDot";
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* Border specification for paragraphs.
|
|
260
|
+
*/
|
|
261
|
+
type BorderStyle = {
|
|
262
|
+
style?: string;
|
|
263
|
+
width?: number;
|
|
264
|
+
color?: string;
|
|
265
|
+
space?: number;
|
|
266
|
+
};
|
|
267
|
+
/**
|
|
268
|
+
* Paragraph borders.
|
|
269
|
+
*/
|
|
270
|
+
type ParagraphBorders = {
|
|
271
|
+
top?: BorderStyle;
|
|
272
|
+
bottom?: BorderStyle;
|
|
273
|
+
left?: BorderStyle;
|
|
274
|
+
right?: BorderStyle;
|
|
275
|
+
between?: BorderStyle;
|
|
276
|
+
bar?: BorderStyle;
|
|
277
|
+
};
|
|
278
|
+
/**
|
|
279
|
+
* List numbering properties for a paragraph.
|
|
280
|
+
*/
|
|
281
|
+
type ListNumPr = {
|
|
282
|
+
numId?: number;
|
|
283
|
+
ilvl?: number;
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Paragraph block attributes.
|
|
287
|
+
*/
|
|
288
|
+
type ParagraphAttrs = {
|
|
289
|
+
alignment?: "left" | "center" | "right" | "justify";
|
|
290
|
+
spacing?: ParagraphSpacing;
|
|
291
|
+
/**
|
|
292
|
+
* Tracks which `spacing` sides came from inline (`<w:pPr><w:spacing>`)
|
|
293
|
+
* formatting versus inherited via paragraph style. Word collapses
|
|
294
|
+
* style-inherited spacing on empty paragraphs (only direct formatting
|
|
295
|
+
* survives), so the layout engine consults this flag in
|
|
296
|
+
* `getSpacingBefore`/`getSpacingAfter`. Both sides default to false (style
|
|
297
|
+
* inheritance assumed) when the field is absent.
|
|
298
|
+
*/
|
|
299
|
+
spacingExplicit?: {
|
|
300
|
+
before?: boolean;
|
|
301
|
+
after?: boolean;
|
|
302
|
+
};
|
|
303
|
+
indent?: ParagraphIndent;
|
|
304
|
+
keepNext?: boolean;
|
|
305
|
+
keepLines?: boolean;
|
|
306
|
+
pageBreakBefore?: boolean;
|
|
307
|
+
styleId?: string;
|
|
308
|
+
contextualSpacing?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Run-in heading: paragraph mark carries `<w:specVanish/>` and the
|
|
311
|
+
* next paragraph should flow inline on the same line. The layout
|
|
312
|
+
* stage merges the next paragraph's runs into this paragraph's
|
|
313
|
+
* fragment (keeping pmStart/pmEnd intact for editing).
|
|
314
|
+
*/
|
|
315
|
+
runInWithNext?: boolean; /** Right-to-left paragraph direction */
|
|
316
|
+
bidi?: boolean;
|
|
317
|
+
borders?: ParagraphBorders;
|
|
318
|
+
shading?: string;
|
|
319
|
+
tabs?: TabStop[]; /** Render structural empty paragraphs as zero-height anchors. */
|
|
320
|
+
suppressEmptyParagraphHeight?: boolean;
|
|
321
|
+
numPr?: ListNumPr;
|
|
322
|
+
listMarker?: string;
|
|
323
|
+
listIsBullet?: boolean;
|
|
324
|
+
listMarkerHidden?: boolean;
|
|
325
|
+
listMarkerFontFamily?: string;
|
|
326
|
+
listMarkerFontSize?: number;
|
|
327
|
+
/**
|
|
328
|
+
* `w:suff` (§17.9.25) — what follows the marker before body text.
|
|
329
|
+
* `tab` (default) grows the marker to the next tab stop; `space` adds
|
|
330
|
+
* one space glyph; `nothing` lets body text butt against the marker.
|
|
331
|
+
*/
|
|
332
|
+
listMarkerSuffix?: "tab" | "space" | "nothing";
|
|
333
|
+
/**
|
|
334
|
+
* Tracked-change state of the list numbering itself. When a list is applied
|
|
335
|
+
* (or removed) under suggesting mode, the marker paints in the insertion /
|
|
336
|
+
* deletion color so an inserted list item's number reads as part of the
|
|
337
|
+
* suggestion, matching Word. `undefined` = numbering is not a pending change.
|
|
338
|
+
*/
|
|
339
|
+
listMarkerRevision?: {
|
|
340
|
+
kind: "ins" | "del";
|
|
341
|
+
author?: string;
|
|
342
|
+
date?: string;
|
|
343
|
+
revisionId?: number;
|
|
344
|
+
};
|
|
345
|
+
/**
|
|
346
|
+
* When the marker text contains a TAB character (\t), the marker is
|
|
347
|
+
* rendered as a flex layout with two slots; this is the column offset
|
|
348
|
+
* (in twips, from the marker zone's left edge) where the second slot
|
|
349
|
+
* lands. Used to align an inline LISTNUM "(a)" with the deeper level's
|
|
350
|
+
* marker column.
|
|
351
|
+
*/
|
|
352
|
+
listMarkerSecondSlotOffsetTwips?: number;
|
|
353
|
+
defaultFontSize?: number;
|
|
354
|
+
defaultFontFamily?: string;
|
|
355
|
+
/**
|
|
356
|
+
* Document-wide `w:defaultTabStop` (§17.6.13) in twips. Read by the list
|
|
357
|
+
* marker tab-stop math so long markers align body text at the document's
|
|
358
|
+
* configured grid. Stamped onto every paragraph block by `toFlowBlocks`
|
|
359
|
+
* so paragraph-local helpers stay decoupled from `Document`.
|
|
360
|
+
*/
|
|
361
|
+
defaultTabStopTwips?: number;
|
|
362
|
+
};
|
|
363
|
+
/**
|
|
364
|
+
* A paragraph block containing runs.
|
|
365
|
+
*/
|
|
366
|
+
type ParagraphBlock = {
|
|
367
|
+
kind: "paragraph";
|
|
368
|
+
id: BlockId;
|
|
369
|
+
runs: Run[];
|
|
370
|
+
attrs?: ParagraphAttrs;
|
|
371
|
+
/** Names of bookmarks anchored to this paragraph; used to map a bookmark to
|
|
372
|
+
* the page it lands on for PAGEREF/REF resolution. */
|
|
373
|
+
bookmarks?: string[]; /** ProseMirror start position for this block. */
|
|
374
|
+
pmStart?: number; /** ProseMirror end position for this block. */
|
|
375
|
+
pmEnd?: number;
|
|
376
|
+
/**
|
|
377
|
+
* Outer→inner SDT wrappers enclosing this block. Empty / undefined when
|
|
378
|
+
* the block sits at the body root. The painter stamps `data-sdt-*` from
|
|
379
|
+
* the innermost group and draws boundary chrome per outer→inner level.
|
|
380
|
+
*/
|
|
381
|
+
sdtGroups?: SdtGroup[];
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Cell border specification for rendering.
|
|
385
|
+
*/
|
|
386
|
+
type CellBorderSpec = {
|
|
387
|
+
width?: number;
|
|
388
|
+
color?: string;
|
|
389
|
+
style?: string;
|
|
390
|
+
};
|
|
391
|
+
/**
|
|
392
|
+
* Cell borders (all four sides).
|
|
393
|
+
*/
|
|
394
|
+
type CellBorders = {
|
|
395
|
+
top?: CellBorderSpec;
|
|
396
|
+
bottom?: CellBorderSpec;
|
|
397
|
+
left?: CellBorderSpec;
|
|
398
|
+
right?: CellBorderSpec;
|
|
399
|
+
};
|
|
400
|
+
/**
|
|
401
|
+
* A table cell with content.
|
|
402
|
+
*/
|
|
403
|
+
type TableCell = {
|
|
404
|
+
id: BlockId;
|
|
405
|
+
blocks: FlowBlock[];
|
|
406
|
+
colSpan?: number;
|
|
407
|
+
rowSpan?: number;
|
|
408
|
+
width?: number;
|
|
409
|
+
verticalAlign?: "top" | "center" | "bottom";
|
|
410
|
+
background?: string;
|
|
411
|
+
borders?: CellBorders; /** Per-cell padding in pixels (from w:tcMar or table-level w:tblCellMar) */
|
|
412
|
+
padding?: {
|
|
413
|
+
top: number;
|
|
414
|
+
right: number;
|
|
415
|
+
bottom: number;
|
|
416
|
+
left: number;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* `w:noWrap` (§17.4.30): when true, the cell forbids soft-wrapping inside
|
|
420
|
+
* it. The painter emits `white-space: nowrap` on the cell box so content
|
|
421
|
+
* stays on a single line and the cell expands horizontally instead.
|
|
422
|
+
*/
|
|
423
|
+
noWrap?: boolean;
|
|
424
|
+
};
|
|
425
|
+
/**
|
|
426
|
+
* A table row containing cells.
|
|
427
|
+
*/
|
|
428
|
+
type TableRow = {
|
|
429
|
+
id: BlockId;
|
|
430
|
+
cells: TableCell[];
|
|
431
|
+
height?: number;
|
|
432
|
+
heightRule?: "auto" | "atLeast" | "exact";
|
|
433
|
+
isHeader?: boolean;
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Floating table positioning info (pixel values).
|
|
437
|
+
*/
|
|
438
|
+
type FloatingTablePosition = {
|
|
439
|
+
horzAnchor?: "margin" | "page" | "text";
|
|
440
|
+
vertAnchor?: "margin" | "page" | "text";
|
|
441
|
+
tblpX?: number;
|
|
442
|
+
tblpXSpec?: "left" | "center" | "right" | "inside" | "outside";
|
|
443
|
+
tblpY?: number;
|
|
444
|
+
tblpYSpec?: "top" | "center" | "bottom" | "inside" | "outside" | "inline";
|
|
445
|
+
topFromText?: number;
|
|
446
|
+
bottomFromText?: number;
|
|
447
|
+
leftFromText?: number;
|
|
448
|
+
rightFromText?: number;
|
|
449
|
+
};
|
|
450
|
+
/**
|
|
451
|
+
* A table block containing rows.
|
|
452
|
+
*/
|
|
453
|
+
type TableBlock = {
|
|
454
|
+
kind: "table";
|
|
455
|
+
id: BlockId;
|
|
456
|
+
rows: TableRow[];
|
|
457
|
+
columnWidths?: number[]; /** Table width value (twips for dxa, 50ths of percent for pct). */
|
|
458
|
+
width?: number; /** Table width type ('auto', 'pct', 'dxa', 'nil'). */
|
|
459
|
+
widthType?: TableWidthType; /** Table horizontal alignment */
|
|
460
|
+
justification?: "left" | "center" | "right"; /** Table indent from left margin (in pixels, from w:tblInd) */
|
|
461
|
+
indent?: number; /** Right-to-left column order (w:bidiVisual): logical column 0 paints on the right. */
|
|
462
|
+
bidi?: boolean; /** Floating table properties (pixel values). */
|
|
463
|
+
floating?: FloatingTablePosition;
|
|
464
|
+
pmStart?: number;
|
|
465
|
+
pmEnd?: number; /** Outer→inner SDT wrappers enclosing this table (see ParagraphBlock). */
|
|
466
|
+
sdtGroups?: SdtGroup[];
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* An anchored/floating image block.
|
|
470
|
+
*/
|
|
471
|
+
type ImageBlock = {
|
|
472
|
+
kind: "image";
|
|
473
|
+
id: BlockId;
|
|
474
|
+
src: string;
|
|
475
|
+
width: number;
|
|
476
|
+
height: number;
|
|
477
|
+
alt?: string; /** CSS transform string (rotation, flip) */
|
|
478
|
+
transform?: string;
|
|
479
|
+
/**
|
|
480
|
+
* Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined or `1` means
|
|
481
|
+
* fully opaque; the painter emits no CSS `opacity` in that case.
|
|
482
|
+
* eigenpal #424 (opacity render pipeline).
|
|
483
|
+
*/
|
|
484
|
+
opacity?: number;
|
|
485
|
+
anchor?: {
|
|
486
|
+
isAnchored?: boolean;
|
|
487
|
+
offsetH?: number;
|
|
488
|
+
offsetV?: number;
|
|
489
|
+
behindDoc?: boolean;
|
|
490
|
+
}; /** Hyperlink URL for clickable image */
|
|
491
|
+
hlinkHref?: string;
|
|
492
|
+
/**
|
|
493
|
+
* wp:srcRect crop fractions in [0, 1]; emit as CSS `clip-path: inset(...)`.
|
|
494
|
+
* eigenpal #424 (image-crop subset).
|
|
495
|
+
*/
|
|
496
|
+
cropTop?: number;
|
|
497
|
+
cropRight?: number;
|
|
498
|
+
cropBottom?: number;
|
|
499
|
+
cropLeft?: number;
|
|
500
|
+
pmStart?: number;
|
|
501
|
+
pmEnd?: number;
|
|
502
|
+
};
|
|
503
|
+
/**
|
|
504
|
+
* Section break block defining page layout changes.
|
|
505
|
+
*/
|
|
506
|
+
type SectionBreakBlock = {
|
|
507
|
+
kind: "sectionBreak";
|
|
508
|
+
id: BlockId;
|
|
509
|
+
type?: "continuous" | "nextPage" | "evenPage" | "oddPage";
|
|
510
|
+
pageSize?: {
|
|
511
|
+
w: number;
|
|
512
|
+
h: number;
|
|
513
|
+
};
|
|
514
|
+
orientation?: "portrait" | "landscape";
|
|
515
|
+
margins?: PageMargins;
|
|
516
|
+
columns?: ColumnLayout;
|
|
517
|
+
};
|
|
518
|
+
type PageHeaderFooterRefs = {
|
|
519
|
+
titlePg?: boolean;
|
|
520
|
+
headerDefault?: string;
|
|
521
|
+
headerFirst?: string;
|
|
522
|
+
headerEven?: string;
|
|
523
|
+
footerDefault?: string;
|
|
524
|
+
footerFirst?: string;
|
|
525
|
+
footerEven?: string;
|
|
526
|
+
};
|
|
527
|
+
/**
|
|
528
|
+
* Explicit page break block.
|
|
529
|
+
*/
|
|
530
|
+
type PageBreakBlock = {
|
|
531
|
+
kind: "pageBreak";
|
|
532
|
+
id: BlockId;
|
|
533
|
+
pmStart?: number;
|
|
534
|
+
pmEnd?: number;
|
|
535
|
+
};
|
|
536
|
+
/**
|
|
537
|
+
* Column break block.
|
|
538
|
+
*/
|
|
539
|
+
type ColumnBreakBlock = {
|
|
540
|
+
kind: "columnBreak";
|
|
541
|
+
id: BlockId;
|
|
542
|
+
pmStart?: number;
|
|
543
|
+
pmEnd?: number;
|
|
544
|
+
};
|
|
545
|
+
/** Default internal margins for text boxes (OOXML defaults in pixels) */
|
|
546
|
+
declare const DEFAULT_TEXTBOX_MARGINS: {
|
|
547
|
+
top: number;
|
|
548
|
+
bottom: number;
|
|
549
|
+
left: number;
|
|
550
|
+
right: number;
|
|
551
|
+
};
|
|
552
|
+
/** Default text box width in pixels when no width is specified */
|
|
553
|
+
declare const DEFAULT_TEXTBOX_WIDTH = 200;
|
|
554
|
+
/**
|
|
555
|
+
* Text box block — positioned container with paragraph content.
|
|
556
|
+
*/
|
|
557
|
+
type TextBoxBlock = {
|
|
558
|
+
kind: "textBox";
|
|
559
|
+
id: BlockId; /** Width in pixels */
|
|
560
|
+
width: number; /** Height in pixels (may be auto-calculated) */
|
|
561
|
+
height?: number; /** Fill/background color */
|
|
562
|
+
fillColor?: string; /** Border width in pixels */
|
|
563
|
+
outlineWidth?: number; /** Border color */
|
|
564
|
+
outlineColor?: string; /** Outline dash style, or `"none"` for an explicit no-outline. */
|
|
565
|
+
outlineStyle?: OutlineStyleAttr; /** Internal padding */
|
|
566
|
+
margins?: {
|
|
567
|
+
top: number;
|
|
568
|
+
bottom: number;
|
|
569
|
+
left: number;
|
|
570
|
+
right: number;
|
|
571
|
+
}; /** Paragraph blocks inside the text box */
|
|
572
|
+
content: ParagraphBlock[]; /** Display mode copied from the ProseMirror text box node. */
|
|
573
|
+
displayMode?: "inline" | "float" | "block"; /** CSS float direction copied from the ProseMirror text box node. */
|
|
574
|
+
cssFloat?: "left" | "right" | "none"; /** OOXML wrap type for anchored text boxes. */
|
|
575
|
+
wrapType?: ImageWrap["type"]; /** OOXML wrapText direction for anchored text boxes. */
|
|
576
|
+
wrapText?: "bothSides" | "left" | "right" | "largest"; /** Position for floating/anchored text boxes (OOXML EMU offsets). */
|
|
577
|
+
position?: ImageRunPosition; /** Wrap distances in pixels. */
|
|
578
|
+
distTop?: number;
|
|
579
|
+
distBottom?: number;
|
|
580
|
+
distLeft?: number;
|
|
581
|
+
distRight?: number;
|
|
582
|
+
pmStart?: number;
|
|
583
|
+
pmEnd?: number;
|
|
584
|
+
};
|
|
585
|
+
/**
|
|
586
|
+
* Block-level content-control (OOXML `w:sdt`) projection attached to flow
|
|
587
|
+
* blocks that fall inside an SDT wrapper. The painter stamps `data-sdt-*`
|
|
588
|
+
* attributes from this so CSS / interactive widgets can find the group.
|
|
589
|
+
*
|
|
590
|
+
* `id` is a per-document, monotonically assigned identifier so nested SDTs
|
|
591
|
+
* stay disambiguated even when alias/tag/sdtId collide.
|
|
592
|
+
*/
|
|
593
|
+
type SdtGroup = {
|
|
594
|
+
/** Folio-local identifier (stable within one toFlowBlocks call). */id: string;
|
|
595
|
+
/**
|
|
596
|
+
* ProseMirror position of the blockSdt's open token in the source doc.
|
|
597
|
+
* Stable across renders for the same control and unique per instance —
|
|
598
|
+
* the addressing API uses this to disambiguate SDTs that share a tag.
|
|
599
|
+
*/
|
|
600
|
+
pmPos: number;
|
|
601
|
+
sdtType: SdtType; /** OOXML `w:alias` (friendly display name). */
|
|
602
|
+
alias?: string; /** OOXML `w:tag` (developer identifier — anchor for addressing API). */
|
|
603
|
+
tag?: string; /** OOXML numeric `w:id`. */
|
|
604
|
+
sdtId?: number; /** OOXML `w:lock` setting. */
|
|
605
|
+
lock?: NonNullable<SdtProperties["lock"]>; /** True if `w:showingPlcHdr` is set. */
|
|
606
|
+
showingPlaceholder?: boolean; /** Modeled checkbox state, when the control is `w14:checkbox`. */
|
|
607
|
+
checked?: boolean; /** Modeled `w:date/w:dateFormat`. */
|
|
608
|
+
dateFormat?: string; /** Modeled `w:dropDownList`/`w:comboBox` items (JSON-encoded). */
|
|
609
|
+
listItemsJson?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Position of the carrying block within its SDT group (`first`/`middle`/
|
|
612
|
+
* `last`/`only`). The painter stamps `data-sdt-position` from this so the
|
|
613
|
+
* CSS chrome can draw a continuous outline across the block sequence —
|
|
614
|
+
* top edge on `first`, bottom edge on `last`, only side edges in
|
|
615
|
+
* between. Without this, every block painted its own closed box and a
|
|
616
|
+
* multi-paragraph SDT looked like several stacked rectangles.
|
|
617
|
+
*/
|
|
618
|
+
position?: "first" | "middle" | "last" | "only";
|
|
619
|
+
};
|
|
620
|
+
/**
|
|
621
|
+
* Union of all flow block types (input to layout engine).
|
|
622
|
+
*/
|
|
623
|
+
type FlowBlock = ParagraphBlock | TableBlock | ImageBlock | TextBoxBlock | SectionBreakBlock | PageBreakBlock | ColumnBreakBlock;
|
|
624
|
+
/**
|
|
625
|
+
* A measured line within a paragraph.
|
|
626
|
+
*/
|
|
627
|
+
type MeasuredLine = {
|
|
628
|
+
/** Starting run index (inclusive). */fromRun: number; /** Starting character index within fromRun. */
|
|
629
|
+
fromChar: number; /** Ending run index (inclusive). */
|
|
630
|
+
toRun: number; /** Ending character index within toRun (exclusive). */
|
|
631
|
+
toChar: number; /** Total width of the line in pixels. */
|
|
632
|
+
width: number; /** Ascent (height above baseline) in pixels. */
|
|
633
|
+
ascent: number; /** Descent (height below baseline) in pixels. */
|
|
634
|
+
descent: number; /** Total line height in pixels. */
|
|
635
|
+
lineHeight: number; /** Left offset from floating images (pixels from content left edge). */
|
|
636
|
+
leftOffset?: number; /** Right offset from floating images (pixels from content right edge). */
|
|
637
|
+
rightOffset?: number;
|
|
638
|
+
/**
|
|
639
|
+
* Vertical space inserted before this line to skip past floats that leave
|
|
640
|
+
* no usable horizontal room at the natural line Y. Painters render this
|
|
641
|
+
* as marginTop on the line element; measurement adds it to totalHeight.
|
|
642
|
+
*/
|
|
643
|
+
floatSkipBefore?: number;
|
|
644
|
+
};
|
|
645
|
+
/**
|
|
646
|
+
* Measurement result for a paragraph block.
|
|
647
|
+
*/
|
|
648
|
+
type ParagraphMeasure = {
|
|
649
|
+
kind: "paragraph";
|
|
650
|
+
lines: MeasuredLine[];
|
|
651
|
+
totalHeight: number;
|
|
652
|
+
};
|
|
653
|
+
/**
|
|
654
|
+
* Measurement result for an image block.
|
|
655
|
+
*/
|
|
656
|
+
type ImageMeasure = {
|
|
657
|
+
kind: "image";
|
|
658
|
+
width: number;
|
|
659
|
+
height: number;
|
|
660
|
+
/**
|
|
661
|
+
* Leading space (px) layout inserts before the block to clear a page-pinned
|
|
662
|
+
* topAndBottom band on the same page. Paragraphs absorb this per line via
|
|
663
|
+
* `floatSkipBefore`; non-paragraph blocks reserve it here. eigenpal #694.
|
|
664
|
+
*/
|
|
665
|
+
bandSkipBefore?: number;
|
|
666
|
+
};
|
|
667
|
+
/**
|
|
668
|
+
* Measurement result for a table cell.
|
|
669
|
+
*/
|
|
670
|
+
type TableCellMeasure = {
|
|
671
|
+
blocks: Measure[];
|
|
672
|
+
width: number;
|
|
673
|
+
height: number;
|
|
674
|
+
colSpan?: number;
|
|
675
|
+
rowSpan?: number;
|
|
676
|
+
};
|
|
677
|
+
/**
|
|
678
|
+
* Measurement result for a table row.
|
|
679
|
+
*/
|
|
680
|
+
type TableRowMeasure = {
|
|
681
|
+
cells: TableCellMeasure[];
|
|
682
|
+
height: number;
|
|
683
|
+
};
|
|
684
|
+
/**
|
|
685
|
+
* Measurement result for a table block.
|
|
686
|
+
*/
|
|
687
|
+
type TableMeasure = {
|
|
688
|
+
kind: "table";
|
|
689
|
+
rows: TableRowMeasure[];
|
|
690
|
+
columnWidths: number[];
|
|
691
|
+
totalWidth: number;
|
|
692
|
+
totalHeight: number;
|
|
693
|
+
/** Leading space (px) before the table to clear a page-pinned band on the
|
|
694
|
+
* same page; applied to the table's first fragment. See {@link ImageMeasure}. */
|
|
695
|
+
bandSkipBefore?: number;
|
|
696
|
+
};
|
|
697
|
+
/**
|
|
698
|
+
* Measurement result for section break (no visual size).
|
|
699
|
+
*/
|
|
700
|
+
type SectionBreakMeasure = {
|
|
701
|
+
kind: "sectionBreak";
|
|
702
|
+
};
|
|
703
|
+
/**
|
|
704
|
+
* Measurement result for page break (no visual size).
|
|
705
|
+
*/
|
|
706
|
+
type PageBreakMeasure = {
|
|
707
|
+
kind: "pageBreak";
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Measurement result for column break (no visual size).
|
|
711
|
+
*/
|
|
712
|
+
type ColumnBreakMeasure = {
|
|
713
|
+
kind: "columnBreak";
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Measurement result for a text box block.
|
|
717
|
+
*/
|
|
718
|
+
type TextBoxMeasure = {
|
|
719
|
+
kind: "textBox";
|
|
720
|
+
width: number;
|
|
721
|
+
height: number; /** Pre-measured inner paragraph measures (avoids re-measuring during render) */
|
|
722
|
+
innerMeasures: ParagraphMeasure[];
|
|
723
|
+
};
|
|
724
|
+
/**
|
|
725
|
+
* Union of all measurement types.
|
|
726
|
+
*/
|
|
727
|
+
type Measure = ParagraphMeasure | ImageMeasure | TableMeasure | TextBoxMeasure | SectionBreakMeasure | PageBreakMeasure | ColumnBreakMeasure;
|
|
728
|
+
/**
|
|
729
|
+
* Base fragment properties common to all fragment types.
|
|
730
|
+
*/
|
|
731
|
+
type FragmentBase = {
|
|
732
|
+
/** Block ID this fragment belongs to. */blockId: BlockId; /** X position on page (relative to page left). */
|
|
733
|
+
x: number; /** Y position on page (relative to page top). */
|
|
734
|
+
y: number; /** Width of the fragment. */
|
|
735
|
+
width: number; /** ProseMirror start position (for click mapping). */
|
|
736
|
+
pmStart?: number; /** ProseMirror end position (for click mapping). */
|
|
737
|
+
pmEnd?: number;
|
|
738
|
+
/**
|
|
739
|
+
* Outer→inner SDT wrappers enclosing the originating block. Copied
|
|
740
|
+
* verbatim from the FlowBlock so the painter can stamp `data-sdt-*`
|
|
741
|
+
* attributes per fragment.
|
|
742
|
+
*/
|
|
743
|
+
sdtGroups?: SdtGroup[];
|
|
744
|
+
};
|
|
745
|
+
/**
|
|
746
|
+
* A paragraph fragment positioned on a page.
|
|
747
|
+
* May span only part of the paragraph's lines if split across pages.
|
|
748
|
+
*/
|
|
749
|
+
type ParagraphFragment = FragmentBase & {
|
|
750
|
+
kind: "paragraph"; /** First line index (inclusive) from the measure. */
|
|
751
|
+
fromLine: number; /** Last line index (exclusive) from the measure. */
|
|
752
|
+
toLine: number; /** Height of this fragment. */
|
|
753
|
+
height: number; /** True if this continues from a previous page. */
|
|
754
|
+
continuesFromPrev?: boolean; /** True if this continues onto the next page. */
|
|
755
|
+
continuesOnNext?: boolean;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* A table fragment positioned on a page.
|
|
759
|
+
* May span only part of the table's rows if split across pages.
|
|
760
|
+
*/
|
|
761
|
+
type TableFragment = FragmentBase & {
|
|
762
|
+
kind: "table"; /** First row index (inclusive). */
|
|
763
|
+
fromRow: number; /** Last row index (exclusive). */
|
|
764
|
+
toRow: number; /** Height of this fragment. */
|
|
765
|
+
height: number; /** True if this is a floating table. */
|
|
766
|
+
isFloating?: boolean; /** True if this continues from a previous page. */
|
|
767
|
+
continuesFromPrev?: boolean; /** True if this continues onto the next page. */
|
|
768
|
+
continuesOnNext?: boolean; /** Number of header rows prepended to this continuation fragment (0 or undefined for first fragment). */
|
|
769
|
+
headerRowCount?: number;
|
|
770
|
+
/**
|
|
771
|
+
* Mid-content row break (eigenpal #698): when a single row is taller than a
|
|
772
|
+
* whole page it is split across pages between whole text lines. The visible
|
|
773
|
+
* band of the broken row is `[topClip, bottomClip)` in the row's own
|
|
774
|
+
* coordinates. `topClip` is the px already shown on the previous page (the
|
|
775
|
+
* continuation fragment starts here); `bottomClip` is where this fragment
|
|
776
|
+
* cuts the row. Undefined on fragments that break only at row boundaries.
|
|
777
|
+
*/
|
|
778
|
+
topClip?: number;
|
|
779
|
+
bottomClip?: number;
|
|
780
|
+
};
|
|
781
|
+
/**
|
|
782
|
+
* An image fragment positioned on a page.
|
|
783
|
+
*/
|
|
784
|
+
type ImageFragment = FragmentBase & {
|
|
785
|
+
kind: "image"; /** Height of the image. */
|
|
786
|
+
height: number; /** True if this is an anchored/floating image. */
|
|
787
|
+
isAnchored?: boolean; /** Z-index for layering. */
|
|
788
|
+
zIndex?: number;
|
|
789
|
+
};
|
|
790
|
+
/**
|
|
791
|
+
* A text box fragment positioned on a page.
|
|
792
|
+
*/
|
|
793
|
+
type TextBoxFragment = FragmentBase & {
|
|
794
|
+
kind: "textBox"; /** Height of the text box. */
|
|
795
|
+
height: number;
|
|
796
|
+
};
|
|
797
|
+
/**
|
|
798
|
+
* Union of all fragment types.
|
|
799
|
+
*/
|
|
800
|
+
type Fragment = ParagraphFragment | TableFragment | ImageFragment | TextBoxFragment;
|
|
801
|
+
/**
|
|
802
|
+
* Page margin configuration.
|
|
803
|
+
*/
|
|
804
|
+
type PageMargins = {
|
|
805
|
+
top: number;
|
|
806
|
+
right: number;
|
|
807
|
+
bottom: number;
|
|
808
|
+
left: number; /** Distance from page top to header content. */
|
|
809
|
+
header?: number; /** Distance from page bottom to footer content. */
|
|
810
|
+
footer?: number;
|
|
811
|
+
};
|
|
812
|
+
/**
|
|
813
|
+
* A rendered page containing positioned fragments.
|
|
814
|
+
*/
|
|
815
|
+
type Page = {
|
|
816
|
+
/** Page number (1-indexed). */number: number; /** Fragments positioned on this page. */
|
|
817
|
+
fragments: Fragment[]; /** Page margins. */
|
|
818
|
+
margins: PageMargins; /** Page size (width, height). */
|
|
819
|
+
size: {
|
|
820
|
+
w: number;
|
|
821
|
+
h: number;
|
|
822
|
+
}; /** Page orientation. */
|
|
823
|
+
orientation?: "portrait" | "landscape"; /** Section index this page belongs to. */
|
|
824
|
+
sectionIndex?: number; /** 1-based page number within the active section. */
|
|
825
|
+
sectionPageNumber?: number; /** Header/footer references for this page. */
|
|
826
|
+
headerFooterRefs?: PageHeaderFooterRefs; /** Footnote IDs that appear on this page (for rendering). */
|
|
827
|
+
footnoteIds?: number[]; /** Height reserved for the footnote area at page bottom (pixels). */
|
|
828
|
+
footnoteReservedHeight?: number; /** Column layout for this page (if multi-column). */
|
|
829
|
+
columns?: ColumnLayout;
|
|
830
|
+
};
|
|
831
|
+
/**
|
|
832
|
+
* Column layout configuration.
|
|
833
|
+
*/
|
|
834
|
+
type ColumnLayout = {
|
|
835
|
+
count: number;
|
|
836
|
+
gap: number;
|
|
837
|
+
equalWidth?: boolean; /** Draw vertical separator line between columns (w:sep). */
|
|
838
|
+
separator?: boolean;
|
|
839
|
+
};
|
|
840
|
+
/**
|
|
841
|
+
* Header/footer layout for a specific type.
|
|
842
|
+
*/
|
|
843
|
+
type HeaderFooterLayout = {
|
|
844
|
+
height: number;
|
|
845
|
+
fragments: Fragment[];
|
|
846
|
+
};
|
|
847
|
+
/**
|
|
848
|
+
* Final layout output ready for rendering/painting.
|
|
849
|
+
*/
|
|
850
|
+
type Layout = {
|
|
851
|
+
/** Default page size for the document. */pageSize: {
|
|
852
|
+
w: number;
|
|
853
|
+
h: number;
|
|
854
|
+
}; /** All rendered pages with positioned fragments. */
|
|
855
|
+
pages: Page[]; /** Column configuration (if multi-column). */
|
|
856
|
+
columns?: ColumnLayout; /** Header layouts by type (default, first, even). */
|
|
857
|
+
headers?: Record<string, HeaderFooterLayout>; /** Footer layouts by type (default, first, even). */
|
|
858
|
+
footers?: Record<string, HeaderFooterLayout>; /** Gap between pages in pixels (for rendering). */
|
|
859
|
+
pageGap?: number;
|
|
860
|
+
};
|
|
861
|
+
/**
|
|
862
|
+
* Header/footer content heights by variant type.
|
|
863
|
+
*/
|
|
864
|
+
type HeaderFooterContentHeights = Partial<Record<"default" | "first" | "even" | "odd", number>>;
|
|
865
|
+
/**
|
|
866
|
+
* Pre-calculated footnote content for layout and rendering.
|
|
867
|
+
*/
|
|
868
|
+
type FootnoteContent = {
|
|
869
|
+
/** Footnote ID. */id: number; /** Display number (e.g. 1, 2, 3). */
|
|
870
|
+
displayNumber: number; /** FlowBlocks for rendering the footnote content. */
|
|
871
|
+
blocks: FlowBlock[]; /** Measurements for the blocks. */
|
|
872
|
+
measures: Measure[]; /** Total height in pixels. */
|
|
873
|
+
height: number;
|
|
874
|
+
};
|
|
875
|
+
/**
|
|
876
|
+
* Options for the layout engine.
|
|
877
|
+
*/
|
|
878
|
+
type LayoutOptions = {
|
|
879
|
+
/** Initial page size. */pageSize: {
|
|
880
|
+
w: number;
|
|
881
|
+
h: number;
|
|
882
|
+
}; /** Initial page margins. */
|
|
883
|
+
margins: PageMargins;
|
|
884
|
+
/**
|
|
885
|
+
* Margins applied only to page 1 (the title page) when the first
|
|
886
|
+
* section has `<w:titlePg/>`. Used to extend the top margin for an
|
|
887
|
+
* overflowing first-page header without forcing pages 2+ to inherit the
|
|
888
|
+
* same extension.
|
|
889
|
+
*/
|
|
890
|
+
firstPageMargins?: PageMargins; /** Body-level final section page size. */
|
|
891
|
+
finalPageSize?: {
|
|
892
|
+
w: number;
|
|
893
|
+
h: number;
|
|
894
|
+
}; /** Body-level final section margins. */
|
|
895
|
+
finalMargins?: PageMargins; /** Column configuration. */
|
|
896
|
+
columns?: ColumnLayout; /** Gap between rendered pages (for UI). */
|
|
897
|
+
pageGap?: number; /** Default line height multiplier. */
|
|
898
|
+
defaultLineHeight?: number; /** Header content heights by variant. */
|
|
899
|
+
headerContentHeights?: HeaderFooterContentHeights; /** Footer content heights by variant. */
|
|
900
|
+
footerContentHeights?: HeaderFooterContentHeights; /** Whether section has different first page header/footer. */
|
|
901
|
+
titlePage?: boolean; /** Whether section has different even/odd headers/footers. */
|
|
902
|
+
evenAndOddHeaders?: boolean; /** Per-page footnote reserved heights (pageNumber → height in pixels). */
|
|
903
|
+
footnoteReservedHeights?: Map<number, number>;
|
|
904
|
+
/**
|
|
905
|
+
* Footnote content heights keyed by internal footnote id (the OOXML
|
|
906
|
+
* `<w:footnoteReference w:id>`). When provided, the layout engine
|
|
907
|
+
* tracks footnote demand per body line: each line carrying a fn ref
|
|
908
|
+
* grows its page's reservation by that fn's height before the next
|
|
909
|
+
* line is fitted. This single-pass approach avoids the static-
|
|
910
|
+
* reservation + iterative-convergence loop that produced oscillation
|
|
911
|
+
* (and either body-overflow into the footer or large empty gaps
|
|
912
|
+
* above the fn area) on documents with multiple long footnotes per
|
|
913
|
+
* page.
|
|
914
|
+
*/
|
|
915
|
+
footnoteHeightById?: Map<number, number>; /** Section break type for the body-level (final) section (for section transition logic). */
|
|
916
|
+
bodyBreakType?: "continuous" | "nextPage" | "evenPage" | "oddPage"; /** Header/footer references for each document section, by section index. */
|
|
917
|
+
sectionHeaderFooterRefs?: PageHeaderFooterRefs[];
|
|
918
|
+
};
|
|
919
|
+
/**
|
|
920
|
+
* Result of hit-testing a click position.
|
|
921
|
+
*/
|
|
922
|
+
type HitTestResult = {
|
|
923
|
+
/** Page index (0-based). */pageIndex: number; /** Fragment that was hit, if any. */
|
|
924
|
+
fragment?: Fragment; /** Local X coordinate within the fragment. */
|
|
925
|
+
localX?: number; /** Local Y coordinate within the fragment. */
|
|
926
|
+
localY?: number;
|
|
927
|
+
};
|
|
928
|
+
/**
|
|
929
|
+
* Position within the document model.
|
|
930
|
+
*/
|
|
931
|
+
type DocumentPosition = {
|
|
932
|
+
/** Block index. */blockIndex: number; /** Run index within the block (for paragraphs). */
|
|
933
|
+
runIndex?: number; /** Character offset within the run. */
|
|
934
|
+
charOffset?: number; /** ProseMirror position. */
|
|
935
|
+
pmPos?: number;
|
|
936
|
+
};
|
|
937
|
+
/**
|
|
938
|
+
* Height of the horizontal separator line drawn above the footnote stack.
|
|
939
|
+
* Used by the paginator when reserving space and by the painter when laying
|
|
940
|
+
* out the stack at the bottom of the page.
|
|
941
|
+
*/
|
|
942
|
+
declare const FOOTNOTE_SEPARATOR_HEIGHT = 12;
|
|
943
|
+
/**
|
|
944
|
+
* Extra bottom margin applied to every rendered footnote entry, in CSS pixels.
|
|
945
|
+
*
|
|
946
|
+
* Word footnotes are separate paragraphs in the footnote story, so their
|
|
947
|
+
* own paragraph spacing already describes the vertical gap between notes.
|
|
948
|
+
* Keep the wrapper margin at zero to avoid adding whitespace that is not
|
|
949
|
+
* present in the source DOCX.
|
|
950
|
+
*/
|
|
951
|
+
declare const FOOTNOTE_ENTRY_MARGIN_BOTTOM = 0;
|
|
952
|
+
/**
|
|
953
|
+
* Line height used when a footnote entry has no measured line height yet.
|
|
954
|
+
* Conservative fallback so a missing measure does not collapse the entry.
|
|
955
|
+
*/
|
|
956
|
+
declare const FOOTNOTE_FALLBACK_LINE_HEIGHT = 13;
|
|
957
|
+
/**
|
|
958
|
+
* Header / footer content prepared by the bridge for the painter. Lives here
|
|
959
|
+
* because both layers reference the shape; the painter must not import it from
|
|
960
|
+
* the bridge and the bridge must not import it from the painter.
|
|
961
|
+
*/
|
|
962
|
+
type HeaderFooterContent = {
|
|
963
|
+
/** Flow blocks for the header/footer content. */blocks: FlowBlock[]; /** Measurements for the blocks. */
|
|
964
|
+
measures: Measure[]; /** Total height of the content. */
|
|
965
|
+
height: number; /** Top-most visual extent relative to the nominal flow origin. */
|
|
966
|
+
visualTop?: number; /** Bottom-most visual extent relative to the nominal flow origin. */
|
|
967
|
+
visualBottom?: number;
|
|
968
|
+
/**
|
|
969
|
+
* Flow-only bounds used by `computeHeaderFooterMarginExtender` to push
|
|
970
|
+
* body margins clear of HF overflow. Excludes `behindDoc` images that
|
|
971
|
+
* the renderer paints behind body content; including them would reserve
|
|
972
|
+
* a full-page letterhead as body push-down.
|
|
973
|
+
*/
|
|
974
|
+
marginPushTop?: number;
|
|
975
|
+
marginPushBottom?: number;
|
|
976
|
+
/**
|
|
977
|
+
* Relationship id (`rId`) of the source HF part. Emitted as `data-rid`
|
|
978
|
+
* on the painted `.layout-page-header` / `.layout-page-footer` so the
|
|
979
|
+
* pointer pipeline can resolve clicks to the matching hidden HF
|
|
980
|
+
* EditorView.
|
|
981
|
+
*/
|
|
982
|
+
rId?: string;
|
|
983
|
+
/**
|
|
984
|
+
* Cheap text fingerprint of the rendered blocks. Used to invalidate
|
|
985
|
+
* cached options hashes so same-height in-place HF edits force the
|
|
986
|
+
* painter to re-render shells.
|
|
987
|
+
*/
|
|
988
|
+
textSig?: string;
|
|
989
|
+
};
|
|
990
|
+
/**
|
|
991
|
+
* `true` when the image run is anchored at page-level coordinates instead of
|
|
992
|
+
* participating in inline flow. Covers the OOXML floating wrap types
|
|
993
|
+
* (`square`, `tight`, `through`, `behind`, `inFront`) and the legacy
|
|
994
|
+
* `displayMode === "float"` escape hatch used by ProseMirror nodes that
|
|
995
|
+
* pre-date the wrap-type round-trip.
|
|
996
|
+
*
|
|
997
|
+
* Pure predicate over `ImageRun` — no DOM, no measurement state. Lives here
|
|
998
|
+
* so the bridge can call it without importing from the painter.
|
|
999
|
+
*/
|
|
1000
|
+
declare const isFloatingImageRun: (run: ImageRun) => boolean;
|
|
1001
|
+
/**
|
|
1002
|
+
* `true` when a floating image should also shrink surrounding line widths.
|
|
1003
|
+
* `behind` / `inFront` (wrapNone) and `topAndBottom` do not — text either
|
|
1004
|
+
* paints over/under them or flows above/below as a block — only
|
|
1005
|
+
* `square` / `tight` / `through` carve a horizontal exclusion. The legacy
|
|
1006
|
+
* `displayMode === "float"` path is treated as wrapping when a CSS float
|
|
1007
|
+
* direction is set.
|
|
1008
|
+
*/
|
|
1009
|
+
declare const isTextWrappingFloatingImageRun: (run: ImageRun) => boolean;
|
|
1010
|
+
type TextBoxFlowAttrs = Pick<TextBoxBlock, "displayMode" | "wrapType">;
|
|
1011
|
+
/**
|
|
1012
|
+
* `true` when the text box is anchored outside normal block flow — either
|
|
1013
|
+
* via the `float` display mode or via an OOXML floating wrap type (which
|
|
1014
|
+
* includes `topAndBottom`; see {@link floatingTextBoxReservesBand}).
|
|
1015
|
+
*/
|
|
1016
|
+
declare function isFloatingTextBoxBlock(block: TextBoxFlowAttrs): boolean;
|
|
1017
|
+
/**
|
|
1018
|
+
* `true` when a floating text box should also reduce surrounding text
|
|
1019
|
+
* line widths. Excludes wrapNone (`behind`/`inFront`) and `topAndBottom`
|
|
1020
|
+
* which are positioned floats but do not carve a horizontal exclusion.
|
|
1021
|
+
*/
|
|
1022
|
+
declare function floatingTextBoxWrapsText(block: TextBoxFlowAttrs): boolean;
|
|
1023
|
+
/**
|
|
1024
|
+
* `true` when a floating text box reserves a full-width vertical band rather
|
|
1025
|
+
* than a side exclusion. `topAndBottom` boxes break the text above and below
|
|
1026
|
+
* the box (no text beside it), so surrounding lines flow past the band.
|
|
1027
|
+
* Ported from eigenpal #694.
|
|
1028
|
+
*/
|
|
1029
|
+
declare function floatingTextBoxReservesBand(block: TextBoxFlowAttrs): boolean;
|
|
1030
|
+
//#endregion
|
|
1031
|
+
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, Run, RunFormatting, SdtGroup, SectionBreakBlock, SectionBreakMeasure, TabAlignment, TabRun, TabStop, TableBlock, TableCell, TableCellMeasure, TableFragment, TableMeasure, TableRow, TableRowMeasure, TextBoxBlock, TextBoxFlowAttrs, TextBoxFragment, TextBoxMeasure, TextRun, floatingTextBoxReservesBand, floatingTextBoxWrapsText, isFloatingImageRun, isFloatingTextBoxBlock, isTextWrappingFloatingImageRun, types_d_exports };
|