@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,389 @@
|
|
|
1
|
+
import { document_d_exports } from "../../types/document.js";
|
|
2
|
+
import { OutlineStyleAttr } from "../../types/documentEnumValues.js";
|
|
3
|
+
import { SpacingExplicit } from "../../types/formatting.js";
|
|
4
|
+
import { ParagraphDirection } from "../paragraphDirection.js";
|
|
5
|
+
|
|
6
|
+
//#region src/prosemirror/schema/nodes.d.ts
|
|
7
|
+
type HardBreakAttrs = {
|
|
8
|
+
breakType?: "column";
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Paragraph node attributes - maps to ParagraphFormatting
|
|
12
|
+
*/
|
|
13
|
+
type ParagraphAttrs = {
|
|
14
|
+
paraId?: string;
|
|
15
|
+
textId?: string;
|
|
16
|
+
alignment?: document_d_exports.ParagraphAlignment;
|
|
17
|
+
spaceBefore?: number;
|
|
18
|
+
spaceAfter?: number;
|
|
19
|
+
lineSpacing?: number;
|
|
20
|
+
lineSpacingRule?: document_d_exports.LineSpacingRule;
|
|
21
|
+
spacingExplicit?: SpacingExplicit;
|
|
22
|
+
indentLeft?: number;
|
|
23
|
+
indentRight?: number;
|
|
24
|
+
indentFirstLine?: number;
|
|
25
|
+
hangingIndent?: boolean;
|
|
26
|
+
numPr?: {
|
|
27
|
+
numId?: number;
|
|
28
|
+
ilvl?: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* The style-sourced numPr value when `numPr` came from the paragraph
|
|
32
|
+
* style rather than direct formatting. While `numPr` still equals this,
|
|
33
|
+
* fromProseDoc omits it from serialized formatting (writing it as direct
|
|
34
|
+
* `<w:numPr>` would flip Word's level-indent precedence on reload). List
|
|
35
|
+
* commands that change `numPr` make the values diverge, which re-enables
|
|
36
|
+
* direct serialization — no explicit clearing needed.
|
|
37
|
+
*/
|
|
38
|
+
numPrFromStyle?: {
|
|
39
|
+
numId?: number;
|
|
40
|
+
ilvl?: number;
|
|
41
|
+
}; /** List number format (decimal, lowerRoman, upperRoman, etc.) for CSS counter styling */
|
|
42
|
+
listNumFmt?: document_d_exports.NumberFormat; /** Whether this is a bullet list */
|
|
43
|
+
listIsBullet?: boolean; /** Whether this level uses legal numbering (parent placeholders render decimal). */
|
|
44
|
+
listIsLegal?: boolean; /** Computed list marker text (e.g., "1.", "1.1.", "•") */
|
|
45
|
+
listMarker?: string; /** Whether the list marker is hidden (w:vanish on numbering level rPr) */
|
|
46
|
+
listMarkerHidden?: boolean; /** Marker font family from numbering level rPr */
|
|
47
|
+
listMarkerFontFamily?: string; /** Marker font size from numbering level rPr, in points */
|
|
48
|
+
listMarkerFontSize?: number;
|
|
49
|
+
/**
|
|
50
|
+
* `w:suff` (§17.9.25) — what follows the marker before body text.
|
|
51
|
+
* `tab` (default) grows the marker to the next tab stop; `space` adds one
|
|
52
|
+
* space glyph; `nothing` lets body text butt against the marker.
|
|
53
|
+
*/
|
|
54
|
+
listMarkerSuffix?: "tab" | "space" | "nothing"; /** `w:caps` on the numbering level rPr — render marker in upper case. */
|
|
55
|
+
listMarkerAllCaps?: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Inline LISTNUM count carried by this paragraph. Each advances the
|
|
58
|
+
* counter at `ilvl + 1` so a later sibling at that depth renders the
|
|
59
|
+
* next marker letter.
|
|
60
|
+
*/
|
|
61
|
+
listImplicitChildLevelAdvances?: number;
|
|
62
|
+
/**
|
|
63
|
+
* When the marker text contains a TAB separator, this column offset (in
|
|
64
|
+
* twips) is where the slot after the tab should land — used to align an
|
|
65
|
+
* inline LISTNUM "(a)" with the deeper level's marker column.
|
|
66
|
+
*/
|
|
67
|
+
listMarkerSecondSlotOffsetTwips?: number; /** Number format for each level used by multi-level marker templates. */
|
|
68
|
+
listLevelNumFmts?: document_d_exports.NumberFormat[]; /** Abstract numbering ID shared by numbering instances. */
|
|
69
|
+
listAbstractNumId?: number; /** Numbering start override for this numId/level. */
|
|
70
|
+
listStartOverride?: number;
|
|
71
|
+
styleId?: string;
|
|
72
|
+
borders?: {
|
|
73
|
+
top?: document_d_exports.BorderSpec;
|
|
74
|
+
bottom?: document_d_exports.BorderSpec;
|
|
75
|
+
left?: document_d_exports.BorderSpec;
|
|
76
|
+
right?: document_d_exports.BorderSpec;
|
|
77
|
+
between?: document_d_exports.BorderSpec;
|
|
78
|
+
bar?: document_d_exports.BorderSpec;
|
|
79
|
+
};
|
|
80
|
+
shading?: document_d_exports.ShadingProperties;
|
|
81
|
+
tabs?: document_d_exports.TabStop[];
|
|
82
|
+
pageBreakBefore?: boolean; /** Word's cached rendered-page-break marker; preserved for round-trip only. */
|
|
83
|
+
renderedPageBreakBefore?: boolean;
|
|
84
|
+
keepNext?: boolean;
|
|
85
|
+
keepLines?: boolean; /** Contextual spacing — suppress space between same-style paragraphs */
|
|
86
|
+
contextualSpacing?: boolean;
|
|
87
|
+
defaultTextFormatting?: document_d_exports.TextFormatting;
|
|
88
|
+
sectionBreakType?: "nextPage" | "continuous" | "oddPage" | "evenPage";
|
|
89
|
+
/**
|
|
90
|
+
* Base text direction as a discriminated union (undecided when absent). Maps
|
|
91
|
+
* to the serialized OOXML `w:bidi` tri-state via `directionToBidi`; the
|
|
92
|
+
* `source` discriminates an authoritative manual/import decision from a
|
|
93
|
+
* re-evaluable auto-detected one. See `paragraphDirection.ts`.
|
|
94
|
+
*/
|
|
95
|
+
direction?: ParagraphDirection | null;
|
|
96
|
+
outlineLevel?: number;
|
|
97
|
+
bookmarks?: {
|
|
98
|
+
id: number;
|
|
99
|
+
name: string;
|
|
100
|
+
}[];
|
|
101
|
+
/** Empty `w:hyperlink` elements cannot be represented as text marks.
|
|
102
|
+
* Preserve their relationship metadata at the paragraph boundary so a
|
|
103
|
+
* no-edit DOCX round-trip does not silently drop hyperlink elements. */
|
|
104
|
+
_emptyHyperlinks?: {
|
|
105
|
+
/** ProseMirror inline offset where the zero-width hyperlink appeared. */offset: number;
|
|
106
|
+
href?: document_d_exports.Hyperlink["href"];
|
|
107
|
+
anchor?: document_d_exports.Hyperlink["anchor"];
|
|
108
|
+
tooltip?: document_d_exports.Hyperlink["tooltip"];
|
|
109
|
+
rId?: document_d_exports.Hyperlink["rId"];
|
|
110
|
+
}[];
|
|
111
|
+
/**
|
|
112
|
+
* Run-in heading flag: this paragraph's mark carries
|
|
113
|
+
* `<w:specVanish/>` and the next paragraph should flow inline on
|
|
114
|
+
* the same line (NVCA-style "6.11 Severability" → "The
|
|
115
|
+
* invalidity..." merges). Layout consumes this in toFlowBlocks.
|
|
116
|
+
*/
|
|
117
|
+
runInWithNext?: boolean;
|
|
118
|
+
/** Original inline paragraph formatting from DOCX (pre-style-resolution).
|
|
119
|
+
* Used by fromProseDoc for lossless round-trip serialization. */
|
|
120
|
+
_originalFormatting?: document_d_exports.ParagraphFormatting;
|
|
121
|
+
/** Import-effective spacing baseline for HTML auto-spacing detection.
|
|
122
|
+
* PM-only; never serialized back into DOCX formatting. */
|
|
123
|
+
_autospacingBase?: {
|
|
124
|
+
before?: number | null;
|
|
125
|
+
after?: number | null;
|
|
126
|
+
};
|
|
127
|
+
/** Full section properties for paragraphs that end a section.
|
|
128
|
+
* Used by layout engine for per-section column/page config and round-trip. */
|
|
129
|
+
_sectionProperties?: document_d_exports.SectionProperties;
|
|
130
|
+
/** Paragraph-property-change tracking entries (`w:pPrChange`).
|
|
131
|
+
* Preserved opaquely through ProseMirror — the editor does not surface
|
|
132
|
+
* them in UI today, but stripping them on every edit would corrupt the
|
|
133
|
+
* `w:pPrChange` history Word relies on for "show previous formatting"
|
|
134
|
+
* and for reverting an accepted property change. */
|
|
135
|
+
_propertyChanges?: document_d_exports.ParagraphPropertyChange[];
|
|
136
|
+
/** Paragraph-mark insertion / deletion (`<w:pPr><w:rPr><w:ins/>` /
|
|
137
|
+
* `<w:del/>`). Word emits this when the paragraph break itself was
|
|
138
|
+
* authored in track-changes mode — pressing Enter mid-paragraph
|
|
139
|
+
* produces an `ins`, Backspace-at-start / Delete-at-end produce a
|
|
140
|
+
* `del`. Stored as a discriminated union to mirror folio's
|
|
141
|
+
* `TrackedChangeWrapperType` model rather than two parallel attrs. */
|
|
142
|
+
pPrMark?: document_d_exports.ParagraphMarkChange;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* Image position for floating images (horizontal and vertical positioning)
|
|
146
|
+
*/
|
|
147
|
+
type ImagePositionAttrs = {
|
|
148
|
+
horizontal?: {
|
|
149
|
+
relativeTo?: NonNullable<document_d_exports.ImagePosition["horizontal"]["relativeTo"]>;
|
|
150
|
+
posOffset?: number;
|
|
151
|
+
align?: NonNullable<document_d_exports.ImagePosition["horizontal"]["alignment"]>;
|
|
152
|
+
};
|
|
153
|
+
vertical?: {
|
|
154
|
+
relativeTo?: NonNullable<document_d_exports.ImagePosition["vertical"]["relativeTo"]>;
|
|
155
|
+
posOffset?: number;
|
|
156
|
+
align?: NonNullable<document_d_exports.ImagePosition["vertical"]["alignment"]>;
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Image node attributes
|
|
161
|
+
*/
|
|
162
|
+
type ImageAttrs = {
|
|
163
|
+
src: string;
|
|
164
|
+
alt?: string;
|
|
165
|
+
title?: string; /** Width in pixels (already converted from EMU) */
|
|
166
|
+
width?: number; /** Height in pixels (already converted from EMU) */
|
|
167
|
+
height?: number;
|
|
168
|
+
rId?: string; /** Wrap type from DOCX: inline, square, tight, through, topAndBottom, behind, inFront */
|
|
169
|
+
wrapType?: document_d_exports.ImageWrap["type"]; /** Display mode for CSS: inline (flows with text), float (left/right float), block (centered) */
|
|
170
|
+
displayMode?: "inline" | "float" | "block"; /** CSS float direction for floating images */
|
|
171
|
+
cssFloat?: "left" | "right" | "none"; /** CSS transform string (rotation, flip) */
|
|
172
|
+
transform?: string;
|
|
173
|
+
/**
|
|
174
|
+
* Opacity in [0, 1] from `<a:alphaModFix amt>`. Undefined / 1 means fully
|
|
175
|
+
* opaque (no CSS `opacity` emitted). eigenpal #424.
|
|
176
|
+
*/
|
|
177
|
+
opacity?: number; /** Distance from text above (pixels) */
|
|
178
|
+
distTop?: number; /** Distance from text below (pixels) */
|
|
179
|
+
distBottom?: number; /** Distance from text left (pixels) */
|
|
180
|
+
distLeft?: number; /** Distance from text right (pixels) */
|
|
181
|
+
distRight?: number;
|
|
182
|
+
/**
|
|
183
|
+
* wp:srcRect crop fractions in [0, 1]. Carried through the editor so a
|
|
184
|
+
* cropped image survives parse → edit → serialize. eigenpal #424
|
|
185
|
+
* (image-crop subset).
|
|
186
|
+
*/
|
|
187
|
+
cropTop?: number;
|
|
188
|
+
cropRight?: number;
|
|
189
|
+
cropBottom?: number;
|
|
190
|
+
cropLeft?: number; /** Position for floating images (horizontal and vertical alignment) */
|
|
191
|
+
position?: ImagePositionAttrs; /** Border width in pixels */
|
|
192
|
+
borderWidth?: number; /** Border color as CSS color string */
|
|
193
|
+
borderColor?: string; /** Border style (CSS border-style value) */
|
|
194
|
+
borderStyle?: string; /** Wrap text setting from DOCX (left, right, bothSides, largest) for round-trip */
|
|
195
|
+
wrapText?: NonNullable<document_d_exports.ImageWrap["wrapText"]>; /** Hyperlink URL for clickable image */
|
|
196
|
+
hlinkHref?: string; /** Original OOXML for opaque/unsupported DOCX drawings. */
|
|
197
|
+
_docxRawXml?: string;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Field node attributes
|
|
201
|
+
*/
|
|
202
|
+
type FieldAttrs = {
|
|
203
|
+
/** Field type: PAGE, NUMPAGES, DATE, MERGEFIELD, etc. */fieldType: document_d_exports.FieldType; /** Full field instruction (e.g. "PAGE \\* MERGEFORMAT") */
|
|
204
|
+
instruction: string; /** Current/cached display text */
|
|
205
|
+
displayText: string; /** Whether the field came from w:fldSimple or a complex fldChar range */
|
|
206
|
+
fieldKind: "simple" | "complex"; /** Field is locked */
|
|
207
|
+
fldLock?: boolean; /** Field is dirty and should be recalculated by the host application */
|
|
208
|
+
dirty?: boolean;
|
|
209
|
+
};
|
|
210
|
+
/**
|
|
211
|
+
* Math equation node attributes
|
|
212
|
+
*/
|
|
213
|
+
type MathAttrs = {
|
|
214
|
+
/** Whether this is inline OMML or a block equation paragraph */display?: "inline" | "block"; /** Raw OMML XML for round-trip preservation */
|
|
215
|
+
ommlXml: string; /** Plain text fallback used by the editor and layout engine */
|
|
216
|
+
plainText?: string;
|
|
217
|
+
};
|
|
218
|
+
/**
|
|
219
|
+
* Structured document tag node attributes
|
|
220
|
+
*/
|
|
221
|
+
type SdtAttrs = {
|
|
222
|
+
/** SDT type */sdtType: document_d_exports.SdtType; /** Alias (friendly name) */
|
|
223
|
+
alias?: string; /** Tag (developer identifier) */
|
|
224
|
+
tag?: string; /** Numeric `w:id/@w:val`. */
|
|
225
|
+
id?: number; /** Lock setting */
|
|
226
|
+
lock?: NonNullable<document_d_exports.SdtProperties["lock"]>; /** Placeholder text */
|
|
227
|
+
placeholder?: string; /** Whether showing placeholder */
|
|
228
|
+
showingPlaceholder?: boolean; /** Date format for date controls */
|
|
229
|
+
dateFormat?: string; /** ISO 8601 bound date value (`w:date@w:fullDate`). */
|
|
230
|
+
dateValueISO?: string; /** Dropdown/combobox list items as JSON string */
|
|
231
|
+
listItems?: string; /** Selected dropdown / comboBox value (`w:dropDownList@w:lastValue`). */
|
|
232
|
+
dropdownLastValue?: string; /** Checkbox checked state */
|
|
233
|
+
checked?: boolean; /** Captured `<w:sdtPr>…</w:sdtPr>` for round-trip replay. */
|
|
234
|
+
rawPropertiesXml?: string; /** Captured `<w:sdtEndPr>…</w:sdtEndPr>` for round-trip replay. */
|
|
235
|
+
rawEndPropertiesXml?: string;
|
|
236
|
+
};
|
|
237
|
+
/**
|
|
238
|
+
* Block-level structured document tag node attributes. Mirrors `SdtAttrs`
|
|
239
|
+
* plus an optional numeric `w:id` and the verbatim `w:sdtPr`/`w:sdtEndPr`
|
|
240
|
+
* strings captured by the parser for lossless round-trip.
|
|
241
|
+
*/
|
|
242
|
+
type BlockSdtAttrs = {
|
|
243
|
+
sdtType: document_d_exports.SdtType;
|
|
244
|
+
alias?: string;
|
|
245
|
+
tag?: string; /** Numeric `w:id/@w:val`. */
|
|
246
|
+
id?: number;
|
|
247
|
+
lock?: NonNullable<document_d_exports.SdtProperties["lock"]>;
|
|
248
|
+
placeholder?: string;
|
|
249
|
+
showingPlaceholder?: boolean;
|
|
250
|
+
dateFormat?: string; /** ISO 8601 bound date value (`w:date@w:fullDate`). */
|
|
251
|
+
dateValueISO?: string; /** Dropdown/combobox list items as JSON string. */
|
|
252
|
+
listItems?: string; /** Selected dropdown / comboBox value (`w:dropDownList@w:lastValue`). */
|
|
253
|
+
dropdownLastValue?: string;
|
|
254
|
+
checked?: boolean;
|
|
255
|
+
/**
|
|
256
|
+
* Marker: source had empty `<w:sdtContent/>`. `toProseDoc` inserts a
|
|
257
|
+
* filler paragraph to satisfy PM's `block+`; on save the converter
|
|
258
|
+
* uses this flag to drop the filler instead of guessing from shape.
|
|
259
|
+
*/
|
|
260
|
+
_originallyEmpty?: boolean; /** Captured `<w:sdtPr>…</w:sdtPr>` for round-trip replay. */
|
|
261
|
+
rawPropertiesXml?: string; /** Captured `<w:sdtEndPr>…</w:sdtEndPr>` for round-trip replay. */
|
|
262
|
+
rawEndPropertiesXml?: string; /** Verbatim XML for sdt siblings before sdtContent (range markers). */
|
|
263
|
+
rawSdtChildrenBeforeContent?: string; /** Verbatim XML for sdt siblings after sdtContent (range markers). */
|
|
264
|
+
rawSdtChildrenAfterContent?: string;
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Shape node attributes
|
|
268
|
+
*/
|
|
269
|
+
type ShapeAttrs = {
|
|
270
|
+
/** Shape type preset */shapeType?: string; /** Unique identifier */
|
|
271
|
+
shapeId?: string; /** Width in pixels */
|
|
272
|
+
width?: number; /** Height in pixels */
|
|
273
|
+
height?: number; /** Fill color as CSS color */
|
|
274
|
+
fillColor?: string; /** Fill type: none, solid, gradient, pattern, picture */
|
|
275
|
+
fillType?: document_d_exports.ShapeFill["type"]; /** Gradient type: linear, radial, rectangular, path */
|
|
276
|
+
gradientType?: NonNullable<document_d_exports.ShapeFill["gradient"]>["type"]; /** Gradient angle in degrees (for linear) */
|
|
277
|
+
gradientAngle?: number; /** Gradient stops as JSON string: [{position, color}] */
|
|
278
|
+
gradientStops?: string; /** Outline width in pixels */
|
|
279
|
+
outlineWidth?: number; /** Outline color as CSS color */
|
|
280
|
+
outlineColor?: string; /** Outline dash style, or `"none"` for an explicit no-outline. */
|
|
281
|
+
outlineStyle?: OutlineStyleAttr; /** Line cap */
|
|
282
|
+
outlineCap?: NonNullable<document_d_exports.ShapeOutline["cap"]>; /** Head arrow/end marker */
|
|
283
|
+
outlineHeadEnd?: NonNullable<document_d_exports.ShapeOutline["headEnd"]>; /** Tail arrow/end marker */
|
|
284
|
+
outlineTailEnd?: NonNullable<document_d_exports.ShapeOutline["tailEnd"]>; /** CSS transform */
|
|
285
|
+
transform?: string; /** Display mode */
|
|
286
|
+
displayMode?: "inline" | "float" | "block"; /** CSS float */
|
|
287
|
+
cssFloat?: "left" | "right" | "none"; /** Wrap type */
|
|
288
|
+
wrapType?: document_d_exports.ImageWrap["type"]; /** Wrap text setting from DOCX (left, right, bothSides, largest) for round-trip */
|
|
289
|
+
wrapText?: NonNullable<document_d_exports.ImageWrap["wrapText"]>; /** Distance from text above (pixels) */
|
|
290
|
+
distTop?: number; /** Distance from text below (pixels) */
|
|
291
|
+
distBottom?: number; /** Distance from text left (pixels) */
|
|
292
|
+
distLeft?: number; /** Distance from text right (pixels) */
|
|
293
|
+
distRight?: number; /** Position for floating shapes (horizontal and vertical alignment) */
|
|
294
|
+
position?: ImagePositionAttrs; /** Shadow color as CSS color */
|
|
295
|
+
shadowColor?: string; /** Shadow blur radius in pixels */
|
|
296
|
+
shadowBlur?: number; /** Shadow X offset in pixels */
|
|
297
|
+
shadowOffsetX?: number; /** Shadow Y offset in pixels */
|
|
298
|
+
shadowOffsetY?: number; /** Glow color as CSS color */
|
|
299
|
+
glowColor?: string; /** Glow radius in pixels */
|
|
300
|
+
glowRadius?: number;
|
|
301
|
+
};
|
|
302
|
+
/**
|
|
303
|
+
* Text box node attributes
|
|
304
|
+
*/
|
|
305
|
+
type TextBoxAttrs = {
|
|
306
|
+
/** Width in pixels */width?: number; /** Height in pixels */
|
|
307
|
+
height?: number; /** Unique identifier */
|
|
308
|
+
textBoxId?: string; /** Fill color as CSS color */
|
|
309
|
+
fillColor?: string; /** Outline width in pixels */
|
|
310
|
+
outlineWidth?: number; /** Outline color as CSS color */
|
|
311
|
+
outlineColor?: string; /** Outline dash style, or `"none"` for an explicit no-outline. */
|
|
312
|
+
outlineStyle?: OutlineStyleAttr; /** Internal margin top in pixels */
|
|
313
|
+
marginTop?: number; /** Internal margin bottom in pixels */
|
|
314
|
+
marginBottom?: number; /** Internal margin left in pixels */
|
|
315
|
+
marginLeft?: number; /** Internal margin right in pixels */
|
|
316
|
+
marginRight?: number; /** Vertical text alignment */
|
|
317
|
+
verticalAlign?: string; /** Display mode */
|
|
318
|
+
displayMode?: "inline" | "float" | "block"; /** CSS float direction */
|
|
319
|
+
cssFloat?: "left" | "right" | "none"; /** Wrap type */
|
|
320
|
+
wrapType?: document_d_exports.ImageWrap["type"]; /** OOXML wrapText direction for anchored text boxes (eigenpal #474). */
|
|
321
|
+
wrapText?: "bothSides" | "left" | "right" | "largest"; /** Wrap distance from top edge, in pixels (OOXML distT, EMU-converted). */
|
|
322
|
+
distTop?: number; /** Wrap distance from bottom edge, in pixels. */
|
|
323
|
+
distBottom?: number; /** Wrap distance from left edge, in pixels. */
|
|
324
|
+
distLeft?: number; /** Wrap distance from right edge, in pixels. */
|
|
325
|
+
distRight?: number; /** Position for floating/anchored text boxes */
|
|
326
|
+
position?: ImagePositionAttrs; /** Original DOCX placement hint for save-path reconstruction. */
|
|
327
|
+
_docxPlacement?: "standalone" | "inlineWithPrevious"; /** Original DOCX paragraph group for standalone text-box reconstruction. */
|
|
328
|
+
_docxGroupId?: string;
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Table node attributes
|
|
332
|
+
*/
|
|
333
|
+
type TableAttrs = {
|
|
334
|
+
/** Table style ID */styleId?: string; /** Table width (in twips) */
|
|
335
|
+
width?: number; /** Table width type ('auto', 'pct', 'dxa') */
|
|
336
|
+
widthType?: document_d_exports.TableWidthType; /** Table justification/alignment */
|
|
337
|
+
justification?: "left" | "center" | "right"; /** Column widths (in twips) from w:tblGrid */
|
|
338
|
+
columnWidths?: number[]; /** Floating table properties (w:tblpPr) */
|
|
339
|
+
floating?: document_d_exports.FloatingTableProperties; /** Default cell margins for the table (w:tblCellMar), in twips */
|
|
340
|
+
cellMargins?: {
|
|
341
|
+
top?: number;
|
|
342
|
+
bottom?: number;
|
|
343
|
+
left?: number;
|
|
344
|
+
right?: number;
|
|
345
|
+
}; /** Table look flags for conditional formatting (w:tblLook) */
|
|
346
|
+
look?: document_d_exports.TableLook; /** Table-level borders (w:tblBorders) — full BorderSpec per side */
|
|
347
|
+
borders?: document_d_exports.TableBorders; /** Original table formatting from DOCX for lossless round-trip serialization */
|
|
348
|
+
_originalFormatting?: document_d_exports.TableFormatting;
|
|
349
|
+
};
|
|
350
|
+
/**
|
|
351
|
+
* Table row attributes
|
|
352
|
+
*/
|
|
353
|
+
type TableRowAttrs = {
|
|
354
|
+
/** Row height (in twips) */height?: number; /** Height rule ('auto', 'exact', 'atLeast') */
|
|
355
|
+
heightRule?: NonNullable<document_d_exports.TableRowFormatting["heightRule"]>; /** Is header row */
|
|
356
|
+
isHeader?: boolean; /** Original row formatting from DOCX for lossless round-trip serialization */
|
|
357
|
+
_originalFormatting?: document_d_exports.TableRowFormatting;
|
|
358
|
+
};
|
|
359
|
+
/**
|
|
360
|
+
* Table cell attributes
|
|
361
|
+
*/
|
|
362
|
+
type TableCellAttrs = {
|
|
363
|
+
/** Column span */colspan: number; /** Row span */
|
|
364
|
+
rowspan: number; /** Column widths for prosemirror-tables resizing (array of pixel widths) */
|
|
365
|
+
colwidth?: number[] | null; /** Cell width (in twips) */
|
|
366
|
+
width?: number; /** Cell width type */
|
|
367
|
+
widthType?: document_d_exports.TableWidthType; /** Vertical alignment */
|
|
368
|
+
verticalAlign?: "top" | "center" | "bottom"; /** Background color (RGB hex) */
|
|
369
|
+
backgroundColor?: string; /** OOXML text direction (e.g. 'tbRl', 'btLr') */
|
|
370
|
+
textDirection?: NonNullable<document_d_exports.TableCellFormatting["textDirection"]>; /** No text wrapping in cell */
|
|
371
|
+
noWrap?: boolean; /** Cell borders — full BorderSpec per side (style, color, size) */
|
|
372
|
+
borders?: {
|
|
373
|
+
top?: document_d_exports.BorderSpec;
|
|
374
|
+
bottom?: document_d_exports.BorderSpec;
|
|
375
|
+
left?: document_d_exports.BorderSpec;
|
|
376
|
+
right?: document_d_exports.BorderSpec;
|
|
377
|
+
}; /** Cell margins/padding in twips per side */
|
|
378
|
+
margins?: {
|
|
379
|
+
top?: number;
|
|
380
|
+
bottom?: number;
|
|
381
|
+
left?: number;
|
|
382
|
+
right?: number;
|
|
383
|
+
}; /** Original cell formatting from DOCX for lossless round-trip serialization */
|
|
384
|
+
_originalFormatting?: document_d_exports.TableCellFormatting; /** Preserve a DOCX vMerge restart even when PM cannot model it as a rowspan. */
|
|
385
|
+
_preserveVMergeRestart?: boolean; /** Original DOCX vMerge continuation cells skipped into this PM rowspan. */
|
|
386
|
+
_docxVMergeContinuationCells?: document_d_exports.TableCell[];
|
|
387
|
+
};
|
|
388
|
+
//#endregion
|
|
389
|
+
export { BlockSdtAttrs, FieldAttrs, HardBreakAttrs, ImageAttrs, ImagePositionAttrs, MathAttrs, ParagraphAttrs, SdtAttrs, ShapeAttrs, TableAttrs, TableCellAttrs, TableRowAttrs, TextBoxAttrs };
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { document_d_exports } from "../types/document.js";
|
|
2
|
+
import { EditorState } from "prosemirror-state";
|
|
3
|
+
|
|
4
|
+
//#region src/prosemirror/selectionState.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Selection state for toolbar integration
|
|
7
|
+
*/
|
|
8
|
+
type SelectionState = {
|
|
9
|
+
/** Whether there's an active selection (not just cursor) */hasSelection: boolean; /** Whether selection spans multiple paragraphs */
|
|
10
|
+
isMultiParagraph: boolean; /** Current text formatting at selection/cursor */
|
|
11
|
+
textFormatting: document_d_exports.TextFormatting; /** Current paragraph formatting */
|
|
12
|
+
paragraphFormatting: document_d_exports.ParagraphFormatting; /** Current paragraph style ID (e.g., 'Heading1', 'Normal') */
|
|
13
|
+
styleId: string | null; /** Start paragraph index */
|
|
14
|
+
startParagraphIndex: number; /** End paragraph index */
|
|
15
|
+
endParagraphIndex: number;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Extract selection state from editor state.
|
|
19
|
+
* Used by PagedEditor integration in DocxEditor for toolbar state.
|
|
20
|
+
*/
|
|
21
|
+
declare function extractSelectionState(state: EditorState): SelectionState | null;
|
|
22
|
+
//#endregion
|
|
23
|
+
export { SelectionState, extractSelectionState };
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { directionIsRtl } from "./paragraphDirection.js";
|
|
2
|
+
//#region src/prosemirror/selectionState.ts
|
|
3
|
+
/**
|
|
4
|
+
* Extract selection state from editor state.
|
|
5
|
+
* Used by PagedEditor integration in DocxEditor for toolbar state.
|
|
6
|
+
*/
|
|
7
|
+
function extractSelectionState(state) {
|
|
8
|
+
const { selection, doc } = state;
|
|
9
|
+
const { from, to, empty } = selection;
|
|
10
|
+
const $from = doc.resolve(from);
|
|
11
|
+
let startParagraphIndex = 0;
|
|
12
|
+
let endParagraphIndex = 0;
|
|
13
|
+
doc.forEach((_node, offset, index) => {
|
|
14
|
+
if (offset <= from) startParagraphIndex = index;
|
|
15
|
+
if (offset <= to) endParagraphIndex = index;
|
|
16
|
+
});
|
|
17
|
+
let textFormatting = {};
|
|
18
|
+
const paragraph = $from.parent;
|
|
19
|
+
const isEmptyParagraph = paragraph.type.name === "paragraph" && paragraph.textContent.length === 0;
|
|
20
|
+
const paragraphDefaultFormatting = paragraph.attrs["defaultTextFormatting"];
|
|
21
|
+
const marks = empty ? state.storedMarks || selection.$from.marks() : collectMarksInRange(doc, from, to);
|
|
22
|
+
if (isEmptyParagraph && marks.length === 0 && paragraphDefaultFormatting) textFormatting = { ...paragraphDefaultFormatting };
|
|
23
|
+
for (const mark of marks) switch (mark.type.name) {
|
|
24
|
+
case "bold":
|
|
25
|
+
textFormatting.bold = true;
|
|
26
|
+
break;
|
|
27
|
+
case "italic":
|
|
28
|
+
textFormatting.italic = true;
|
|
29
|
+
break;
|
|
30
|
+
case "underline":
|
|
31
|
+
textFormatting.underline = {
|
|
32
|
+
style: mark.attrs["style"] || "single",
|
|
33
|
+
color: mark.attrs["color"]
|
|
34
|
+
};
|
|
35
|
+
break;
|
|
36
|
+
case "strike":
|
|
37
|
+
if (mark.attrs["double"]) textFormatting.doubleStrike = true;
|
|
38
|
+
else textFormatting.strike = true;
|
|
39
|
+
break;
|
|
40
|
+
case "textColor":
|
|
41
|
+
textFormatting.color = {
|
|
42
|
+
rgb: mark.attrs["rgb"],
|
|
43
|
+
themeColor: mark.attrs["themeColor"]
|
|
44
|
+
};
|
|
45
|
+
break;
|
|
46
|
+
case "highlight":
|
|
47
|
+
textFormatting.highlight = mark.attrs["color"];
|
|
48
|
+
break;
|
|
49
|
+
case "fontSize":
|
|
50
|
+
textFormatting.fontSize = mark.attrs["size"];
|
|
51
|
+
break;
|
|
52
|
+
case "fontFamily":
|
|
53
|
+
textFormatting.fontFamily = {
|
|
54
|
+
ascii: mark.attrs["ascii"],
|
|
55
|
+
hAnsi: mark.attrs["hAnsi"]
|
|
56
|
+
};
|
|
57
|
+
break;
|
|
58
|
+
case "superscript":
|
|
59
|
+
textFormatting.vertAlign = "superscript";
|
|
60
|
+
break;
|
|
61
|
+
case "subscript":
|
|
62
|
+
textFormatting.vertAlign = "subscript";
|
|
63
|
+
break;
|
|
64
|
+
default: break;
|
|
65
|
+
}
|
|
66
|
+
const paragraphFormatting = {};
|
|
67
|
+
let styleId = null;
|
|
68
|
+
if (paragraph.type.name === "paragraph") {
|
|
69
|
+
if (paragraph.attrs["alignment"]) paragraphFormatting.alignment = paragraph.attrs["alignment"];
|
|
70
|
+
if (paragraph.attrs["lineSpacing"]) {
|
|
71
|
+
paragraphFormatting.lineSpacing = paragraph.attrs["lineSpacing"];
|
|
72
|
+
paragraphFormatting.lineSpacingRule = paragraph.attrs["lineSpacingRule"];
|
|
73
|
+
}
|
|
74
|
+
if (paragraph.attrs["numPr"]) paragraphFormatting.numPr = paragraph.attrs["numPr"];
|
|
75
|
+
if (paragraph.attrs["indentLeft"]) paragraphFormatting.indentLeft = paragraph.attrs["indentLeft"];
|
|
76
|
+
if (paragraph.attrs["indentRight"]) paragraphFormatting.indentRight = paragraph.attrs["indentRight"];
|
|
77
|
+
if (paragraph.attrs["indentFirstLine"]) paragraphFormatting.indentFirstLine = paragraph.attrs["indentFirstLine"];
|
|
78
|
+
if (paragraph.attrs["hangingIndent"]) paragraphFormatting.hangingIndent = paragraph.attrs["hangingIndent"];
|
|
79
|
+
if (paragraph.attrs["tabs"]) paragraphFormatting.tabs = paragraph.attrs["tabs"];
|
|
80
|
+
if (directionIsRtl(paragraph.attrs["direction"])) paragraphFormatting.bidi = true;
|
|
81
|
+
if (paragraph.attrs["styleId"]) styleId = paragraph.attrs["styleId"];
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
hasSelection: !empty,
|
|
85
|
+
isMultiParagraph: startParagraphIndex !== endParagraphIndex,
|
|
86
|
+
textFormatting,
|
|
87
|
+
paragraphFormatting,
|
|
88
|
+
styleId,
|
|
89
|
+
startParagraphIndex,
|
|
90
|
+
endParagraphIndex
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Collect the first occurrence of each mark type found on any text node within
|
|
95
|
+
* the range. Mirrors the "any inline child has this mark" semantics that
|
|
96
|
+
* prosemirror-commands' toggleMark uses to decide add-vs-remove, so the
|
|
97
|
+
* toolbar's active state stays consistent with what a toggle click will do.
|
|
98
|
+
*/
|
|
99
|
+
function collectMarksInRange(doc, from, to) {
|
|
100
|
+
const seen = /* @__PURE__ */ new Map();
|
|
101
|
+
doc.nodesBetween(from, to, (node) => {
|
|
102
|
+
if (!node.isText) return;
|
|
103
|
+
for (const mark of node.marks) {
|
|
104
|
+
const name = mark.type.name;
|
|
105
|
+
if (!seen.has(name)) seen.set(name, mark);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return Array.from(seen.values());
|
|
109
|
+
}
|
|
110
|
+
//#endregion
|
|
111
|
+
export { extractSelectionState };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { NumberingMap } from "../../docx/numberingParser.js";
|
|
2
|
+
import { ResolvedParagraphStyle } from "./styleResolver.js";
|
|
3
|
+
|
|
4
|
+
//#region src/prosemirror/styles/resolvedStyleAttrs.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The paragraph attrs a style definition controls. Applying a style resets
|
|
7
|
+
* every one of these to the style's value (or `null` to clear), so a prior
|
|
8
|
+
* style's properties (e.g. a heading's spacing) never leak through. Returns
|
|
9
|
+
* a partial attrs object to merge over the paragraph's existing attrs.
|
|
10
|
+
*/
|
|
11
|
+
declare function paragraphAttrsFromResolvedStyle(resolved: ResolvedParagraphStyle): Record<string, unknown>;
|
|
12
|
+
/**
|
|
13
|
+
* The list attrs a style's `w:pPr/w:numPr` controls (numbering reference plus
|
|
14
|
+
* the baked marker-rendering attrs that `toProseDoc` normally derives from
|
|
15
|
+
* `listRendering` at load time). Returns null when the style defines no
|
|
16
|
+
* numbering — applying such a style leaves any existing list attrs alone, so
|
|
17
|
+
* directly-applied (toolbar) lists survive a style switch the way they do in
|
|
18
|
+
* Word, where numbering is not cleared by applying an unnumbered style.
|
|
19
|
+
*
|
|
20
|
+
* When the style does define numbering, the full attr group is reset so a
|
|
21
|
+
* previous list's marker attrs never leak into the new one. Without the
|
|
22
|
+
* numbering definitions the marker template can't be resolved and the painter
|
|
23
|
+
* falls back to a plain decimal marker.
|
|
24
|
+
*
|
|
25
|
+
* The content-derived marker attrs (`listImplicitChildLevelAdvances`,
|
|
26
|
+
* `listMarkerSecondSlotOffsetTwips`) are nulled — they depend on the
|
|
27
|
+
* paragraph's inline LISTNUM fields, which the picker has no view of. A
|
|
28
|
+
* subsequent save + reload re-derives them from the document content.
|
|
29
|
+
*/
|
|
30
|
+
declare function listAttrsFromResolvedStyle(resolved: ResolvedParagraphStyle, numbering: NumberingMap | null | undefined): Record<string, unknown> | null;
|
|
31
|
+
//#endregion
|
|
32
|
+
export { listAttrsFromResolvedStyle, paragraphAttrsFromResolvedStyle };
|