superdoc 2.2.1 → 2.3.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/AGENTS.md +337 -0
- package/LICENSE +661 -0
- package/NOTICE +8 -0
- package/README.md +107 -0
- package/dist/chunks/FindReplaceSurface-BEW-1NhM.es.js +344 -0
- package/dist/chunks/FindReplaceSurface-DLxnCQOB.cjs +346 -0
- package/dist/chunks/PasswordPromptSurface-BA6HHqEa.es.js +111 -0
- package/dist/chunks/PasswordPromptSurface-DMbfDvpQ.cjs +113 -0
- package/dist/chunks/PdfViewer-CNOtyS-I.es.js +531 -0
- package/dist/chunks/PdfViewer-CoFiGAhm.cjs +535 -0
- package/dist/chunks/_plugin-vue_export-helper-BTwbGDKw.cjs +11 -0
- package/dist/chunks/_plugin-vue_export-helper-CInC0bKI.es.js +6 -0
- package/dist/chunks/blank-docx-CJAXnJKp.es.js +2 -0
- package/dist/chunks/blank-docx-DA-G-3VB.cjs +7 -0
- package/dist/chunks/constants-CY3R3_kF.es.js +3 -0
- package/dist/chunks/constants-sbCZ2O_A.cjs +14 -0
- package/dist/chunks/create-super-doc-ui-CXCqHc2m.cjs +9451 -0
- package/dist/chunks/create-super-doc-ui-fxF2Q8Ib.es.js +9188 -0
- package/dist/chunks/eventemitter3-B60Fsz-a.es.js +131 -0
- package/dist/chunks/eventemitter3-DCfwFVNn.cjs +137 -0
- package/dist/chunks/jszip-BdUBlUeG.cjs +4679 -0
- package/dist/chunks/jszip-DzmwAHr3.es.js +4650 -0
- package/dist/chunks/rolldown-runtime-BJVcqBbz.es.js +43 -0
- package/dist/chunks/rolldown-runtime-_dR15c8t.cjs +68 -0
- package/dist/chunks/uuid-B2Sqk-3p.es.js +32 -0
- package/dist/chunks/uuid-CFp0WGVU.cjs +38 -0
- package/dist/collaboration-upgrade-engine.cjs +37 -0
- package/dist/collaboration-upgrade-engine.es.js +30 -0
- package/dist/document-api/src/authorities/authorities.d.ts +29 -0
- package/dist/document-api/src/authorities/authorities.types.d.ts +113 -0
- package/dist/document-api/src/blocks/blocks.d.ts +29 -0
- package/dist/document-api/src/bookmarks/bookmarks.d.ts +15 -0
- package/dist/document-api/src/bookmarks/bookmarks.types.d.ts +82 -0
- package/dist/document-api/src/capabilities/capabilities.d.ts +82 -0
- package/dist/document-api/src/captions/captions.d.ts +17 -0
- package/dist/document-api/src/captions/captions.types.d.ts +61 -0
- package/dist/document-api/src/citations/citations.d.ts +39 -0
- package/dist/document-api/src/citations/citations.types.d.ts +151 -0
- package/dist/document-api/src/clear-content/clear-content.d.ts +25 -0
- package/dist/document-api/src/clipboard/clipboard.d.ts +11 -0
- package/dist/document-api/src/comments/comments.d.ts +222 -0
- package/dist/document-api/src/comments/comments.types.d.ts +227 -0
- package/dist/document-api/src/content-controls/content-controls.d.ts +136 -0
- package/dist/document-api/src/content-controls/content-controls.types.d.ts +453 -0
- package/dist/document-api/src/contract/command-catalog.d.ts +17 -0
- package/dist/document-api/src/contract/index.d.ts +9 -0
- package/dist/document-api/src/contract/metadata-types.d.ts +30 -0
- package/dist/document-api/src/contract/operation-definitions.d.ts +3645 -0
- package/dist/document-api/src/contract/operation-map.d.ts +5 -0
- package/dist/document-api/src/contract/operation-registry.d.ts +2002 -0
- package/dist/document-api/src/contract/reference-aliases.d.ts +19 -0
- package/dist/document-api/src/contract/reference-doc-map.d.ts +12 -0
- package/dist/document-api/src/contract/schemas.d.ts +35 -0
- package/dist/document-api/src/contract/step-op-catalog.d.ts +26 -0
- package/dist/document-api/src/contract/types.d.ts +31 -0
- package/dist/document-api/src/create/create.d.ts +27 -0
- package/dist/document-api/src/cross-refs/cross-refs.d.ts +15 -0
- package/dist/document-api/src/cross-refs/cross-refs.types.d.ts +68 -0
- package/dist/document-api/src/customXml/customXml.d.ts +19 -0
- package/dist/document-api/src/customXml/customXml.types.d.ts +148 -0
- package/dist/document-api/src/delete/delete.d.ts +20 -0
- package/dist/document-api/src/diff/diff.d.ts +14 -0
- package/dist/document-api/src/diff/diff.types.d.ts +83 -0
- package/dist/document-api/src/diff/index.d.ts +3 -0
- package/dist/document-api/src/errors.d.ts +11 -0
- package/dist/document-api/src/export/export.d.ts +10 -0
- package/dist/document-api/src/export/export.types.d.ts +40 -0
- package/dist/document-api/src/extract/extract.d.ts +15 -0
- package/dist/document-api/src/fields/fields.d.ts +15 -0
- package/dist/document-api/src/fields/fields.types.d.ts +90 -0
- package/dist/document-api/src/find/find.d.ts +52 -0
- package/dist/document-api/src/footnotes/footnotes.d.ts +17 -0
- package/dist/document-api/src/footnotes/footnotes.types.d.ts +104 -0
- package/dist/document-api/src/format/format.d.ts +92 -0
- package/dist/document-api/src/format/inline-run-patch.d.ts +138 -0
- package/dist/document-api/src/get/get.d.ts +19 -0
- package/dist/document-api/src/get-html/get-html.d.ts +27 -0
- package/dist/document-api/src/get-markdown/get-markdown.d.ts +22 -0
- package/dist/document-api/src/get-node/get-node.d.ts +46 -0
- package/dist/document-api/src/get-text/get-text.d.ts +22 -0
- package/dist/document-api/src/header-footers/header-footers.d.ts +37 -0
- package/dist/document-api/src/header-footers/header-footers.types.d.ts +116 -0
- package/dist/document-api/src/history/history.d.ts +38 -0
- package/dist/document-api/src/history/history.types.d.ts +100 -0
- package/dist/document-api/src/hyperlinks/hyperlinks.d.ts +17 -0
- package/dist/document-api/src/hyperlinks/hyperlinks.types.d.ts +112 -0
- package/dist/document-api/src/images/images.d.ts +63 -0
- package/dist/document-api/src/images/images.types.d.ts +209 -0
- package/dist/document-api/src/images/z-order.d.ts +10 -0
- package/dist/document-api/src/index/index.d.ts +29 -0
- package/dist/document-api/src/index/index.types.d.ts +125 -0
- package/dist/document-api/src/index.d.ts +560 -0
- package/dist/document-api/src/info/info.d.ts +19 -0
- package/dist/document-api/src/inline-semantics/directives.d.ts +95 -0
- package/dist/document-api/src/inline-semantics/error-types.d.ts +68 -0
- package/dist/document-api/src/inline-semantics/index.d.ts +20 -0
- package/dist/document-api/src/inline-semantics/property-ids.d.ts +24 -0
- package/dist/document-api/src/inline-semantics/token-parsers.d.ts +59 -0
- package/dist/document-api/src/inline-semantics/token-sets.d.ts +34 -0
- package/dist/document-api/src/insert/insert.d.ts +65 -0
- package/dist/document-api/src/invoke/invoke.d.ts +17 -0
- package/dist/document-api/src/lists/lists.d.ts +100 -0
- package/dist/document-api/src/lists/lists.types.d.ts +499 -0
- package/dist/document-api/src/markdown-to-fragment/markdown-to-fragment.d.ts +15 -0
- package/dist/document-api/src/metadata/anchored-metadata.d.ts +33 -0
- package/dist/document-api/src/metadata/anchored-metadata.types.d.ts +175 -0
- package/dist/document-api/src/paragraphs/paragraphs.d.ts +84 -0
- package/dist/document-api/src/paragraphs/paragraphs.types.d.ts +214 -0
- package/dist/document-api/src/permission-ranges/permission-ranges.d.ts +15 -0
- package/dist/document-api/src/permission-ranges/permission-ranges.types.d.ts +49 -0
- package/dist/document-api/src/plan/plan.d.ts +73 -0
- package/dist/document-api/src/protection/protection.d.ts +11 -0
- package/dist/document-api/src/protection/protection.types.d.ts +47 -0
- package/dist/document-api/src/ranges/index.d.ts +2 -0
- package/dist/document-api/src/ranges/ranges.types.d.ts +121 -0
- package/dist/document-api/src/ranges/resolve.d.ts +2 -0
- package/dist/document-api/src/receipt-bridge.d.ts +30 -0
- package/dist/document-api/src/replace/replace.d.ts +24 -0
- package/dist/document-api/src/sections/sections.d.ts +42 -0
- package/dist/document-api/src/sections/sections.types.d.ts +236 -0
- package/dist/document-api/src/selection/selection.d.ts +23 -0
- package/dist/document-api/src/selection/selection.types.d.ts +85 -0
- package/dist/document-api/src/selection-mutation.d.ts +46 -0
- package/dist/document-api/src/styles/apply.d.ts +142 -0
- package/dist/document-api/src/styles/catalog.d.ts +154 -0
- package/dist/document-api/src/styles/index.d.ts +14 -0
- package/dist/document-api/src/styles/registry.d.ts +43 -0
- package/dist/document-api/src/styles/schema.d.ts +9 -0
- package/dist/document-api/src/styles/validation.d.ts +38 -0
- package/dist/document-api/src/tables/color-formats.d.ts +12 -0
- package/dist/document-api/src/tables/tables.d.ts +83 -0
- package/dist/document-api/src/templates/apply.d.ts +160 -0
- package/dist/document-api/src/templates/index.d.ts +7 -0
- package/dist/document-api/src/toc/toc.d.ts +25 -0
- package/dist/document-api/src/toc/toc.types.d.ts +247 -0
- package/dist/document-api/src/track-changes/track-changes.d.ts +177 -0
- package/dist/document-api/src/types/adapter-result.d.ts +10 -0
- package/dist/document-api/src/types/address.d.ts +169 -0
- package/dist/document-api/src/types/base.d.ts +89 -0
- package/dist/document-api/src/types/blocks.types.d.ts +190 -0
- package/dist/document-api/src/types/clipboard.d.ts +216 -0
- package/dist/document-api/src/types/comments.types.d.ts +17 -0
- package/dist/document-api/src/types/create.types.d.ts +56 -0
- package/dist/document-api/src/types/discovery.d.ts +99 -0
- package/dist/document-api/src/types/extract.types.d.ts +163 -0
- package/dist/document-api/src/types/fragment.d.ts +29 -0
- package/dist/document-api/src/types/index.d.ts +30 -0
- package/dist/document-api/src/types/info.types.d.ts +109 -0
- package/dist/document-api/src/types/inline.types.d.ts +28 -0
- package/dist/document-api/src/types/media.types.d.ts +72 -0
- package/dist/document-api/src/types/mutation-plan.types.d.ts +264 -0
- package/dist/document-api/src/types/node.d.ts +9 -0
- package/dist/document-api/src/types/paragraph.types.d.ts +61 -0
- package/dist/document-api/src/types/placement.d.ts +24 -0
- package/dist/document-api/src/types/query-match.types.d.ts +212 -0
- package/dist/document-api/src/types/query.d.ts +133 -0
- package/dist/document-api/src/types/receipt.d.ts +191 -0
- package/dist/document-api/src/types/references.types.d.ts +9 -0
- package/dist/document-api/src/types/sd-contract.d.ts +54 -0
- package/dist/document-api/src/types/sd-envelope.d.ts +59 -0
- package/dist/document-api/src/types/sd-nodes.d.ts +375 -0
- package/dist/document-api/src/types/sd-objects.d.ts +144 -0
- package/dist/document-api/src/types/sd-props.d.ts +240 -0
- package/dist/document-api/src/types/sd-sections.d.ts +126 -0
- package/dist/document-api/src/types/sd-styles.d.ts +36 -0
- package/dist/document-api/src/types/step-manifest.types.d.ts +30 -0
- package/dist/document-api/src/types/story.types.d.ts +123 -0
- package/dist/document-api/src/types/structural-input.d.ts +40 -0
- package/dist/document-api/src/types/structured.types.d.ts +21 -0
- package/dist/document-api/src/types/style-policy.types.d.ts +49 -0
- package/dist/document-api/src/types/table-operations.types.d.ts +618 -0
- package/dist/document-api/src/types/tables.types.d.ts +43 -0
- package/dist/document-api/src/types/toc.types.d.ts +1 -0
- package/dist/document-api/src/types/track-changes.types.d.ts +703 -0
- package/dist/document-api/src/validation/create-location-validator.d.ts +2 -0
- package/dist/document-api/src/validation/fragment-validator.d.ts +13 -0
- package/dist/document-api/src/validation/selection-target-validator.d.ts +7 -0
- package/dist/document-api/src/validation/story-validator.d.ts +12 -0
- package/dist/document-api/src/validation-primitives.d.ts +29 -0
- package/dist/document-api/src/write/locator.d.ts +24 -0
- package/dist/document-api/src/write/write.d.ts +73 -0
- package/dist/images/altText_add.svg +3 -0
- package/dist/images/altText_disclaimer.svg +3 -0
- package/dist/images/altText_done.svg +3 -0
- package/dist/images/altText_spinner.svg +30 -0
- package/dist/images/altText_warning.svg +3 -0
- package/dist/images/annotation-check.svg +11 -0
- package/dist/images/annotation-comment.svg +16 -0
- package/dist/images/annotation-help.svg +26 -0
- package/dist/images/annotation-insert.svg +10 -0
- package/dist/images/annotation-key.svg +11 -0
- package/dist/images/annotation-newparagraph.svg +11 -0
- package/dist/images/annotation-noicon.svg +7 -0
- package/dist/images/annotation-note.svg +42 -0
- package/dist/images/annotation-paperclip.svg +6 -0
- package/dist/images/annotation-paragraph.svg +16 -0
- package/dist/images/annotation-pushpin.svg +7 -0
- package/dist/images/checkmark.svg +5 -0
- package/dist/images/comment-actionsButton.svg +3 -0
- package/dist/images/comment-closeButton.svg +3 -0
- package/dist/images/comment-editButton.svg +8 -0
- package/dist/images/comment-popup-editButton.svg +5 -0
- package/dist/images/cursor-editorFreeHighlight.svg +6 -0
- package/dist/images/cursor-editorFreeText.svg +3 -0
- package/dist/images/cursor-editorInk.svg +4 -0
- package/dist/images/cursor-editorTextHighlight.svg +8 -0
- package/dist/images/editor-toolbar-delete.svg +5 -0
- package/dist/images/editor-toolbar-edit.svg +3 -0
- package/dist/images/findbarButton-next.svg +3 -0
- package/dist/images/findbarButton-previous.svg +3 -0
- package/dist/images/gv-toolbarButton-download.svg +3 -0
- package/dist/images/loading-icon.gif +0 -0
- package/dist/images/loading.svg +1 -0
- package/dist/images/messageBar_closingButton.svg +3 -0
- package/dist/images/messageBar_info.svg +3 -0
- package/dist/images/messageBar_warning.svg +3 -0
- package/dist/images/pages_closeButton.svg +3 -0
- package/dist/images/pages_selected.svg +7 -0
- package/dist/images/pages_viewArrow.svg +3 -0
- package/dist/images/pages_viewButton.svg +3 -0
- package/dist/images/secondaryToolbarButton-documentProperties.svg +3 -0
- package/dist/images/secondaryToolbarButton-firstPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-handTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-lastPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCcw.svg +3 -0
- package/dist/images/secondaryToolbarButton-rotateCw.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollHorizontal.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollPage.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollVertical.svg +3 -0
- package/dist/images/secondaryToolbarButton-scrollWrapped.svg +3 -0
- package/dist/images/secondaryToolbarButton-selectTool.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadEven.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadNone.svg +3 -0
- package/dist/images/secondaryToolbarButton-spreadOdd.svg +3 -0
- package/dist/images/toolbarButton-bookmark.svg +3 -0
- package/dist/images/toolbarButton-currentOutlineItem.svg +3 -0
- package/dist/images/toolbarButton-download.svg +4 -0
- package/dist/images/toolbarButton-editorFreeText.svg +5 -0
- package/dist/images/toolbarButton-editorHighlight.svg +6 -0
- package/dist/images/toolbarButton-editorInk.svg +4 -0
- package/dist/images/toolbarButton-editorSignature.svg +6 -0
- package/dist/images/toolbarButton-editorStamp.svg +8 -0
- package/dist/images/toolbarButton-menuArrow.svg +3 -0
- package/dist/images/toolbarButton-openFile.svg +3 -0
- package/dist/images/toolbarButton-pageDown.svg +3 -0
- package/dist/images/toolbarButton-pageUp.svg +3 -0
- package/dist/images/toolbarButton-presentationMode.svg +3 -0
- package/dist/images/toolbarButton-print.svg +3 -0
- package/dist/images/toolbarButton-search.svg +3 -0
- package/dist/images/toolbarButton-secondaryToolbarToggle.svg +3 -0
- package/dist/images/toolbarButton-viewAttachments.svg +3 -0
- package/dist/images/toolbarButton-viewLayers.svg +3 -0
- package/dist/images/toolbarButton-viewOutline.svg +3 -0
- package/dist/images/toolbarButton-viewThumbnail.svg +3 -0
- package/dist/images/toolbarButton-viewsManagerToggle.svg +3 -0
- package/dist/images/toolbarButton-zoomIn.svg +3 -0
- package/dist/images/toolbarButton-zoomOut.svg +3 -0
- package/dist/images/treeitem-collapsed.svg +1 -0
- package/dist/images/treeitem-expanded.svg +1 -0
- package/dist/layout-engine/contracts/src/author-colors.d.ts +56 -0
- package/dist/layout-engine/contracts/src/cell-spacing.d.ts +12 -0
- package/dist/layout-engine/contracts/src/clip-path-inset.d.ts +27 -0
- package/dist/layout-engine/contracts/src/column-layout.d.ts +79 -0
- package/dist/layout-engine/contracts/src/direction-context.d.ts +219 -0
- package/dist/layout-engine/contracts/src/drawing-taxonomy.d.ts +126 -0
- package/dist/layout-engine/contracts/src/engines/image-wrap.d.ts +54 -0
- package/dist/layout-engine/contracts/src/engines/index.d.ts +17 -0
- package/dist/layout-engine/contracts/src/engines/lists.d.ts +57 -0
- package/dist/layout-engine/contracts/src/engines/paragraph.d.ts +59 -0
- package/dist/layout-engine/contracts/src/engines/tables.d.ts +89 -0
- package/dist/layout-engine/contracts/src/engines/tabs.d.ts +117 -0
- package/dist/layout-engine/contracts/src/graphic-placement.d.ts +76 -0
- package/dist/layout-engine/contracts/src/header-footer-inheritance.d.ts +22 -0
- package/dist/layout-engine/contracts/src/header-footer-resolution.d.ts +28 -0
- package/dist/layout-engine/contracts/src/incremental-dependency.d.ts +10 -0
- package/dist/layout-engine/contracts/src/index.d.ts +2459 -0
- package/dist/layout-engine/contracts/src/justify-utils.d.ts +98 -0
- package/dist/layout-engine/contracts/src/layout-identity.d.ts +136 -0
- package/dist/layout-engine/contracts/src/ooxml-z-index.d.ts +46 -0
- package/dist/layout-engine/contracts/src/page-number-formatting.d.ts +26 -0
- package/dist/layout-engine/contracts/src/page-ref-anchor.d.ts +2 -0
- package/dist/layout-engine/contracts/src/pm-range.d.ts +45 -0
- package/dist/layout-engine/contracts/src/resolved-layout.d.ts +541 -0
- package/dist/layout-engine/contracts/src/run-helpers.d.ts +23 -0
- package/dist/layout-engine/contracts/src/sdt-container.d.ts +13 -0
- package/dist/layout-engine/contracts/src/segment-geometry.d.ts +192 -0
- package/dist/layout-engine/contracts/src/semantic-colors.d.ts +150 -0
- package/dist/layout-engine/contracts/src/table-cell-spacing.d.ts +12 -0
- package/dist/layout-engine/contracts/src/table-column-rescale.d.ts +13 -0
- package/dist/layout-engine/contracts/src/vertical-text.d.ts +43 -0
- package/dist/layout-engine/dom-contract/src/class-names.d.ts +62 -0
- package/dist/layout-engine/dom-contract/src/data-attrs.d.ts +103 -0
- package/dist/layout-engine/dom-contract/src/index.d.ts +18 -0
- package/dist/layout-engine/dom-contract/src/selectors.d.ts +47 -0
- package/dist/layout-engine/layout-bridge/src/cache-warmer.d.ts +73 -0
- package/dist/layout-engine/layout-bridge/src/cache.d.ts +143 -0
- package/dist/layout-engine/layout-bridge/src/cacheInvalidation.d.ts +117 -0
- package/dist/layout-engine/layout-bridge/src/cursor-renderer.d.ts +201 -0
- package/dist/layout-engine/layout-bridge/src/debounced-passes.d.ts +130 -0
- package/dist/layout-engine/layout-bridge/src/diff.d.ts +36 -0
- package/dist/layout-engine/layout-bridge/src/dirty-tracker.d.ts +128 -0
- package/dist/layout-engine/layout-bridge/src/dom-mapping.d.ts +80 -0
- package/dist/layout-engine/layout-bridge/src/featureFlags.d.ts +95 -0
- package/dist/layout-engine/layout-bridge/src/field-annotation-key.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/focus-watchdog.d.ts +170 -0
- package/dist/layout-engine/layout-bridge/src/font-metrics-cache.d.ts +164 -0
- package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +63 -0
- package/dist/layout-engine/layout-bridge/src/headerFooterUtils.d.ts +218 -0
- package/dist/layout-engine/layout-bridge/src/ime-handler.d.ts +81 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +390 -0
- package/dist/layout-engine/layout-bridge/src/index.d.ts +211 -0
- package/dist/layout-engine/layout-bridge/src/instrumentation.d.ts +245 -0
- package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +123 -0
- package/dist/layout-engine/layout-bridge/src/list-indent-utils.d.ts +205 -0
- package/dist/layout-engine/layout-bridge/src/local-paragraph-layout.d.ts +93 -0
- package/dist/layout-engine/layout-bridge/src/neutral-hit.d.ts +142 -0
- package/dist/layout-engine/layout-bridge/src/neutral-segment-geometry.d.ts +32 -0
- package/dist/layout-engine/layout-bridge/src/page-geometry-helper.d.ts +197 -0
- package/dist/layout-engine/layout-bridge/src/paragraph-hash-utils.d.ts +126 -0
- package/dist/layout-engine/layout-bridge/src/paragraph-line-cache.d.ts +152 -0
- package/dist/layout-engine/layout-bridge/src/performance-metrics.d.ts +249 -0
- package/dist/layout-engine/layout-bridge/src/pm-dom-fallback.d.ts +188 -0
- package/dist/layout-engine/layout-bridge/src/pm-position-validator.d.ts +100 -0
- package/dist/layout-engine/layout-bridge/src/position-hit.d.ts +167 -0
- package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +75 -0
- package/dist/layout-engine/layout-bridge/src/resolveHeaderFooterTokens.d.ts +76 -0
- package/dist/layout-engine/layout-bridge/src/rtl-text-geometry.d.ts +34 -0
- package/dist/layout-engine/layout-bridge/src/run-visual-marks.d.ts +12 -0
- package/dist/layout-engine/layout-bridge/src/safety-net.d.ts +234 -0
- package/dist/layout-engine/layout-bridge/src/sectionAwareHeaderFooter.d.ts +15 -0
- package/dist/layout-engine/layout-bridge/src/table-handler.d.ts +86 -0
- package/dist/layout-engine/layout-bridge/src/text-boundaries.d.ts +17 -0
- package/dist/layout-engine/layout-bridge/src/text-measurement.d.ts +69 -0
- package/dist/layout-engine/layout-bridge/src/track-changes-handler.d.ts +90 -0
- package/dist/layout-engine/layout-bridge/src/tracked-changes-utils.d.ts +41 -0
- package/dist/layout-engine/layout-engine/src/anchors.d.ts +52 -0
- package/dist/layout-engine/layout-engine/src/column-balancing.d.ts +255 -0
- package/dist/layout-engine/layout-engine/src/column-utils.d.ts +1 -0
- package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +60 -0
- package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +21 -0
- package/dist/layout-engine/layout-engine/src/index.d.ts +349 -0
- package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +60 -0
- package/dist/layout-engine/layout-engine/src/layout-image.d.ts +16 -0
- package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +101 -0
- package/dist/layout-engine/layout-engine/src/layout-table.d.ts +71 -0
- package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +4 -0
- package/dist/layout-engine/layout-engine/src/layout-utils.d.ts +104 -0
- package/dist/layout-engine/layout-engine/src/normalize-header-footer-fragments.d.ts +45 -0
- package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +73 -0
- package/dist/layout-engine/layout-engine/src/paginator.d.ts +131 -0
- package/dist/layout-engine/layout-engine/src/paragraph-layout-eligibility.d.ts +1 -0
- package/dist/layout-engine/layout-engine/src/resolvePageRefs.d.ts +31 -0
- package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +82 -0
- package/dist/layout-engine/layout-engine/src/section-breaks.d.ts +98 -0
- package/dist/layout-engine/layout-engine/src/section-props.d.ts +65 -0
- package/dist/layout-engine/layout-engine/src/table-cell-slice.d.ts +98 -0
- package/dist/layout-engine/painters/dom/src/_test-utils.d.ts +21 -0
- package/dist/layout-engine/painters/dom/src/chart-renderer.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/constants.d.ts +10 -0
- package/dist/layout-engine/painters/dom/src/css-token.d.ts +10 -0
- package/dist/layout-engine/painters/dom/src/features/feature-registry.d.ts +41 -0
- package/dist/layout-engine/painters/dom/src/features/inline-direction/index.d.ts +22 -0
- package/dist/layout-engine/painters/dom/src/features/inline-direction/rtl-styles.d.ts +27 -0
- package/dist/layout-engine/painters/dom/src/features/inline-direction/run-direction.d.ts +75 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/accent.d.ts +25 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/bar.d.ts +16 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/box.d.ts +38 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/delimiter.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/equation-array.d.ts +19 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/fraction.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/function.d.ts +16 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/group-character.d.ts +26 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/index.d.ts +27 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/lower-limit.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/math-run.d.ts +47 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/matrix.d.ts +23 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/nary.d.ts +23 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/phantom.d.ts +17 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/pre-sub-superscript.d.ts +25 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/radical.d.ts +14 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/sub-superscript.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/subscript.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/superscript.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/converters/upper-limit.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/features/math/index.d.ts +14 -0
- package/dist/layout-engine/painters/dom/src/features/math/omml-to-mathml.d.ts +18 -0
- package/dist/layout-engine/painters/dom/src/features/math/types.d.ts +41 -0
- package/dist/layout-engine/painters/dom/src/images/drawing-image.d.ts +5 -0
- package/dist/layout-engine/painters/dom/src/images/hyperlink.d.ts +2 -0
- package/dist/layout-engine/painters/dom/src/images/image-block.d.ts +15 -0
- package/dist/layout-engine/painters/dom/src/images/image-clip-path.d.ts +17 -0
- package/dist/layout-engine/painters/dom/src/images/image-fragment.d.ts +34 -0
- package/dist/layout-engine/painters/dom/src/images/image-selectors.d.ts +9 -0
- package/dist/layout-engine/painters/dom/src/images/types.d.ts +2 -0
- package/dist/layout-engine/painters/dom/src/index.d.ts +125 -0
- package/dist/layout-engine/painters/dom/src/page-content.d.ts +209 -0
- package/dist/layout-engine/painters/dom/src/paragraph/block-version.d.ts +8 -0
- package/dist/layout-engine/painters/dom/src/paragraph/borders/border-layer.d.ts +59 -0
- package/dist/layout-engine/painters/dom/src/paragraph/borders/group-analysis.d.ts +38 -0
- package/dist/layout-engine/painters/dom/src/paragraph/borders/index.d.ts +18 -0
- package/dist/layout-engine/painters/dom/src/paragraph/frame.d.ts +3 -0
- package/dist/layout-engine/painters/dom/src/paragraph/indentation.d.ts +25 -0
- package/dist/layout-engine/painters/dom/src/paragraph/list-marker.d.ts +51 -0
- package/dist/layout-engine/painters/dom/src/paragraph/marker-tracked-change.d.ts +34 -0
- package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphContent.d.ts +87 -0
- package/dist/layout-engine/painters/dom/src/paragraph/renderParagraphFragment.d.ts +33 -0
- package/dist/layout-engine/painters/dom/src/paragraph/styles.d.ts +3 -0
- package/dist/layout-engine/painters/dom/src/paragraph-hash-utils.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/pm-position-validation.d.ts +149 -0
- package/dist/layout-engine/painters/dom/src/renderer.d.ts +681 -0
- package/dist/layout-engine/painters/dom/src/ruler/index.d.ts +41 -0
- package/dist/layout-engine/painters/dom/src/ruler/ruler-core.d.ts +195 -0
- package/dist/layout-engine/painters/dom/src/ruler/ruler-renderer.d.ts +97 -0
- package/dist/layout-engine/painters/dom/src/ruler/ruler-styles.d.ts +31 -0
- package/dist/layout-engine/painters/dom/src/runs/field-annotation-run.d.ts +14 -0
- package/dist/layout-engine/painters/dom/src/runs/font-synthesis.d.ts +1 -0
- package/dist/layout-engine/painters/dom/src/runs/formatting-marks.d.ts +3 -0
- package/dist/layout-engine/painters/dom/src/runs/hash.d.ts +82 -0
- package/dist/layout-engine/painters/dom/src/runs/image-run.d.ts +37 -0
- package/dist/layout-engine/painters/dom/src/runs/index.d.ts +13 -0
- package/dist/layout-engine/painters/dom/src/runs/links.d.ts +58 -0
- package/dist/layout-engine/painters/dom/src/runs/math-run.d.ts +7 -0
- package/dist/layout-engine/painters/dom/src/runs/render-line.d.ts +2 -0
- package/dist/layout-engine/painters/dom/src/runs/render-run.d.ts +12 -0
- package/dist/layout-engine/painters/dom/src/runs/tab-run.d.ts +66 -0
- package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +35 -0
- package/dist/layout-engine/painters/dom/src/runs/tracked-changes.d.ts +90 -0
- package/dist/layout-engine/painters/dom/src/runs/types.d.ts +67 -0
- package/dist/layout-engine/painters/dom/src/sdt/boundaries.d.ts +16 -0
- package/dist/layout-engine/painters/dom/src/sdt/container.d.ts +32 -0
- package/dist/layout-engine/painters/dom/src/sdt/dataset.d.ts +7 -0
- package/dist/layout-engine/painters/dom/src/sdt/inline.d.ts +9 -0
- package/dist/layout-engine/painters/dom/src/sdt/snapshot.d.ts +29 -0
- package/dist/layout-engine/painters/dom/src/styles.d.ts +71 -0
- package/dist/layout-engine/painters/dom/src/svg-utils.d.ts +101 -0
- package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +185 -0
- package/dist/layout-engine/painters/dom/src/table/grid-geometry.d.ts +69 -0
- package/dist/layout-engine/painters/dom/src/table/renderTableCell.d.ts +170 -0
- package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +132 -0
- package/dist/layout-engine/painters/dom/src/table/renderTableRow.d.ts +146 -0
- package/dist/layout-engine/painters/dom/src/test-utils/normalize-line.d.ts +39 -0
- package/dist/layout-engine/painters/dom/src/utils/anchor-helpers.d.ts +3 -0
- package/dist/layout-engine/painters/dom/src/utils/apply-styles.d.ts +1 -0
- package/dist/layout-engine/painters/dom/src/utils/layout-identity.d.ts +9 -0
- package/dist/layout-engine/painters/dom/src/utils/source-anchor.d.ts +2 -0
- package/dist/layout-engine/style-engine/src/bench/resolveSdtMetadata.bench.d.ts +1 -0
- package/dist/layout-engine/style-engine/src/cascade.d.ts +43 -0
- package/dist/layout-engine/style-engine/src/index.d.ts +121 -0
- package/dist/layout-engine/style-engine/src/normalize/colors.d.ts +13 -0
- package/dist/layout-engine/style-engine/src/normalize/index.d.ts +13 -0
- package/dist/layout-engine/style-engine/src/normalize/paragraph-attrs.d.ts +3 -0
- package/dist/layout-engine/style-engine/src/normalize/run-attrs.d.ts +17 -0
- package/dist/layout-engine/style-engine/src/normalize/types.d.ts +36 -0
- package/dist/layout-engine/style-engine/src/normalize/units.d.ts +13 -0
- package/dist/layout-engine/style-engine/src/ooxml/index.d.ts +64 -0
- package/dist/layout-engine/style-engine/src/ooxml/numbering-types.d.ts +126 -0
- package/dist/layout-engine/style-engine/src/ooxml/styles-types.d.ts +363 -0
- package/dist/layout-engine/style-engine/src/ooxml/table-style-selection.d.ts +86 -0
- package/dist/layout-engine/style-engine/src/ooxml/types.d.ts +459 -0
- package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +33 -0
- package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-xml.d.ts +29 -0
- package/dist/public/ui-react.cjs +175 -0
- package/dist/public/ui-react.es.js +159 -0
- package/dist/public/ui.cjs +5 -0
- package/dist/public/ui.es.js +2 -0
- package/dist/shared/common/comments-types.d.ts +102 -0
- package/dist/shared/common/layout-constants.d.ts +7 -0
- package/dist/shared/common/list-marker-utils.d.ts +186 -0
- package/dist/shared/common/list-numbering/index.d.ts +16 -0
- package/dist/shared/font-system/src/activation.d.ts +64 -0
- package/dist/shared/font-system/src/bundled-manifest.d.ts +32 -0
- package/dist/shared/font-system/src/bundled.d.ts +41 -0
- package/dist/shared/font-system/src/document-font-options.d.ts +53 -0
- package/dist/shared/font-system/src/epoch.d.ts +6 -0
- package/dist/shared/font-system/src/font-offerings.d.ts +120 -0
- package/dist/shared/font-system/src/index.d.ts +35 -0
- package/dist/shared/font-system/src/os2.d.ts +30 -0
- package/dist/shared/font-system/src/registry.d.ts +188 -0
- package/dist/shared/font-system/src/report.d.ts +98 -0
- package/dist/shared/font-system/src/resolver.d.ts +215 -0
- package/dist/shared/font-system/src/substitution-evidence.d.ts +103 -0
- package/dist/shared/font-system/src/types.d.ts +128 -0
- package/dist/style.css +3316 -0
- package/dist/style.layered.css +3316 -0
- package/dist/superdoc/src/SuperDoc.vue.d.ts +88 -0
- package/dist/superdoc/src/cdn-entry.d.ts +2 -0
- package/dist/superdoc/src/components/CommentsLayer/CommentDialog.vue.d.ts +62 -0
- package/dist/superdoc/src/components/CommentsLayer/CommentHeader.vue.d.ts +26 -0
- package/dist/superdoc/src/components/CommentsLayer/CommentInput.vue.d.ts +19 -0
- package/dist/superdoc/src/components/CommentsLayer/CommentsDropdown.vue.d.ts +30 -0
- package/dist/superdoc/src/components/CommentsLayer/InternalDropdown.vue.d.ts +10 -0
- package/dist/superdoc/src/components/CommentsLayer/collect-removed-comment-ids.d.ts +1 -0
- package/dist/superdoc/src/components/CommentsLayer/collect-tracked-change-thread.d.ts +6 -0
- package/dist/superdoc/src/components/CommentsLayer/comment-schemas.d.ts +18 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/commentsList.vue.d.ts +9 -0
- package/dist/superdoc/src/components/CommentsLayer/commentsList/super-comments-list.d.ts +21 -0
- package/dist/superdoc/src/components/CommentsLayer/floating-comment-positioning.d.ts +28 -0
- package/dist/superdoc/src/components/CommentsLayer/helpers.d.ts +7 -0
- package/dist/superdoc/src/components/CommentsLayer/tracked-change-threading.d.ts +2 -0
- package/dist/superdoc/src/components/CommentsLayer/types.d.ts +3 -0
- package/dist/superdoc/src/components/CommentsLayer/use-comment.d.ts +8 -0
- package/dist/superdoc/src/components/CommentsLayer/use-conversation.d.ts +22 -0
- package/dist/superdoc/src/components/CommentsLayer/use-floating-comment.d.ts +11 -0
- package/dist/superdoc/src/components/HtmlViewer/HtmlViewer.vue.d.ts +10 -0
- package/dist/superdoc/src/components/PdfViewer/PdfViewer.vue.d.ts +61 -0
- package/dist/superdoc/src/components/PdfViewer/PdfViewerDocument.vue.d.ts +21 -0
- package/dist/superdoc/src/components/PdfViewer/PdfViewerPage.vue.d.ts +24 -0
- package/dist/superdoc/src/components/Whiteboard/WhiteboardLayer.vue.d.ts +19 -0
- package/dist/superdoc/src/components/Whiteboard/WhiteboardPage.vue.d.ts +17 -0
- package/dist/superdoc/src/components/Whiteboard/use-whiteboard.d.ts +18 -0
- package/dist/superdoc/src/components/surfaces/FindReplaceSurface.vue.d.ts +19 -0
- package/dist/superdoc/src/components/surfaces/PasswordPromptSurface.vue.d.ts +17 -0
- package/dist/superdoc/src/components/surfaces/SurfaceDialog.vue.d.ts +12 -0
- package/dist/superdoc/src/components/surfaces/SurfaceExternalMount.vue.d.ts +19 -0
- package/dist/superdoc/src/components/surfaces/SurfaceFloating.vue.d.ts +10 -0
- package/dist/superdoc/src/components/surfaces/SurfaceHost.vue.d.ts +31 -0
- package/dist/superdoc/src/components/surfaces/focusable-selector.d.ts +5 -0
- package/dist/superdoc/src/composables/find-shortcut-owner.d.ts +32 -0
- package/dist/superdoc/src/composables/replace-continuation.d.ts +37 -0
- package/dist/superdoc/src/composables/use-ai.d.ts +10 -0
- package/dist/superdoc/src/composables/use-comment-small-screen.d.ts +10 -0
- package/dist/superdoc/src/composables/use-compact-comment-popover.d.ts +21 -0
- package/dist/superdoc/src/composables/use-document.d.ts +34 -0
- package/dist/superdoc/src/composables/use-field.d.ts +33 -0
- package/dist/superdoc/src/composables/use-find-replace.d.ts +83 -0
- package/dist/superdoc/src/composables/use-high-contrast-mode.d.ts +4 -0
- package/dist/superdoc/src/composables/use-link-popover.d.ts +221 -0
- package/dist/superdoc/src/composables/use-password-prompt.d.ts +33 -0
- package/dist/superdoc/src/composables/use-selected-text.d.ts +16 -0
- package/dist/superdoc/src/composables/use-viewport-fit.d.ts +50 -0
- package/dist/superdoc/src/composables/useUiFontFamily.d.ts +24 -0
- package/dist/superdoc/src/core/EventEmitter.d.ts +55 -0
- package/dist/superdoc/src/core/SuperDoc.d.ts +775 -0
- package/dist/superdoc/src/core/collaboration/collaboration-comments.d.ts +4 -0
- package/dist/superdoc/src/core/collaboration/collaboration.d.ts +28 -0
- package/dist/superdoc/src/core/collaboration/helpers.d.ts +8 -0
- package/dist/superdoc/src/core/collaboration/permissions.d.ts +19 -0
- package/dist/superdoc/src/core/collaboration/resolve-v2-collaboration-target.d.ts +99 -0
- package/dist/superdoc/src/core/collaboration/room-overwrite.d.ts +22 -0
- package/dist/superdoc/src/core/collaboration/v2-awareness-bridge.d.ts +57 -0
- package/dist/superdoc/src/core/config/merge-defined.d.ts +35 -0
- package/dist/superdoc/src/core/config/normalize-interaction-config.d.ts +15 -0
- package/dist/superdoc/src/core/config/normalize-surfaces-config.d.ts +23 -0
- package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +62 -0
- package/dist/superdoc/src/core/create-app.d.ts +32 -0
- package/dist/superdoc/src/core/editor-runtime/conformance/fake-v2-runtime.d.ts +9 -0
- package/dist/superdoc/src/core/editor-runtime/editor-runtime-registry.d.ts +117 -0
- package/dist/superdoc/src/core/editor-runtime/index.d.ts +1 -0
- package/dist/superdoc/src/core/editor-runtime/root-marker.d.ts +33 -0
- package/dist/superdoc/src/core/editor-runtime/types.d.ts +405 -0
- package/dist/superdoc/src/core/editor-runtime/v2/v2-editor-runtime-adapter.d.ts +185 -0
- package/dist/superdoc/src/core/editor-runtime/v2/v2-session-shortcut-routes.d.ts +47 -0
- package/dist/superdoc/src/core/extensions/define.d.ts +56 -0
- package/dist/superdoc/src/core/extensions/index.d.ts +2 -0
- package/dist/superdoc/src/core/extensions/types.d.ts +519 -0
- package/dist/superdoc/src/core/helpers/export.d.ts +2 -0
- package/dist/superdoc/src/core/helpers/file.d.ts +43 -0
- package/dist/superdoc/src/core/helpers/normalize-track-changes-config.d.ts +60 -0
- package/dist/superdoc/src/core/helpers/normalize-user.d.ts +13 -0
- package/dist/superdoc/src/core/index.d.ts +1 -0
- package/dist/superdoc/src/core/pdf/helpers/constants.d.ts +2 -0
- package/dist/superdoc/src/core/pdf/helpers/floor.d.ts +1 -0
- package/dist/superdoc/src/core/pdf/helpers/range.d.ts +1 -0
- package/dist/superdoc/src/core/pdf/helpers/read-file.d.ts +1 -0
- package/dist/superdoc/src/core/pdf/pdf-adapter.d.ts +66 -0
- package/dist/superdoc/src/core/surface-manager.d.ts +90 -0
- package/dist/superdoc/src/core/theme/create-theme.d.ts +82 -0
- package/dist/superdoc/src/core/types/index.d.ts +3006 -0
- package/dist/superdoc/src/core/v2-integration/browser-peer-runtime.d.ts +3 -0
- package/dist/superdoc/src/core/v2-integration/cdn-engine-loader.d.ts +16 -0
- package/dist/superdoc/src/core/v2-integration/v2-integration.d.ts +97 -0
- package/dist/superdoc/src/core/whiteboard/Whiteboard.d.ts +247 -0
- package/dist/superdoc/src/core/whiteboard/WhiteboardPage.d.ts +251 -0
- package/dist/superdoc/src/core/whiteboard/WhiteboardRenderer.d.ts +2 -0
- package/dist/superdoc/src/core/whiteboard/helpers/createTextarea.d.ts +1 -0
- package/dist/superdoc/src/core/whiteboard/helpers/flattenPoints.d.ts +1 -0
- package/dist/superdoc/src/core/whiteboard/helpers/getRandomId.d.ts +1 -0
- package/dist/superdoc/src/helpers/collect-touched-tracked-change-ids.d.ts +11 -0
- package/dist/superdoc/src/helpers/comment-focus.d.ts +4 -0
- package/dist/superdoc/src/helpers/comment-small-screen.d.ts +14 -0
- package/dist/superdoc/src/helpers/deprecation.d.ts +26 -0
- package/dist/superdoc/src/helpers/floor.d.ts +1 -0
- package/dist/superdoc/src/helpers/group-changes.d.ts +1 -0
- package/dist/superdoc/src/helpers/interaction-trace.d.ts +26 -0
- package/dist/superdoc/src/helpers/selection-source.d.ts +1 -0
- package/dist/superdoc/src/helpers/transaction-touches-structural-change.d.ts +19 -0
- package/dist/superdoc/src/helpers/use-selection.d.ts +17 -0
- package/dist/superdoc/src/helpers/v2-author-required-rejection.d.ts +22 -0
- package/dist/superdoc/src/helpers/v2-remote-review-hydration.d.ts +12 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-impact.d.ts +15 -0
- package/dist/superdoc/src/helpers/v2-review-mutation-reconciler.d.ts +19 -0
- package/dist/superdoc/src/helpers/v2-review-target.d.ts +7 -0
- package/dist/superdoc/src/helpers/v2-selection-sync.d.ts +12 -0
- package/dist/superdoc/src/helpers/v2-typing-mutation-event.d.ts +5 -0
- package/dist/superdoc/src/icons.d.ts +11 -0
- package/dist/superdoc/src/index.d.cts +13 -0
- package/dist/superdoc/src/index.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/built-in/AIWriter.vue.d.ts +21 -0
- package/dist/superdoc/src/internal/toolbar/built-in/AlignmentButtons.vue.d.ts +6 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ButtonGroup.vue.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/DocumentMode.vue.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/FontFamilyCombobox.vue.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/FontSizeCombobox.vue.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/IconGrid.vue.d.ts +14 -0
- package/dist/superdoc/src/internal/toolbar/built-in/IconGridRow.vue.d.ts +13 -0
- package/dist/superdoc/src/internal/toolbar/built-in/LinkInput.vue.d.ts +37 -0
- package/dist/superdoc/src/internal/toolbar/built-in/LinkedStyle.vue.d.ts +12 -0
- package/dist/superdoc/src/internal/toolbar/built-in/OverflowMenu.vue.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/SdTooltip.vue.d.ts +34 -0
- package/dist/superdoc/src/internal/toolbar/built-in/StyleButtonsList.vue.d.ts +14 -0
- package/dist/superdoc/src/internal/toolbar/built-in/TableActions.vue.d.ts +8 -0
- package/dist/superdoc/src/internal/toolbar/built-in/TableGrid.vue.d.ts +6 -0
- package/dist/superdoc/src/internal/toolbar/built-in/Toolbar.vue.d.ts +4 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButton.vue.d.ts +24 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarButtonIcon.vue.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarComboBox.vue.d.ts +18 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarDropdown.vue.d.ts +38 -0
- package/dist/superdoc/src/internal/toolbar/built-in/ToolbarSeparator.vue.d.ts +8 -0
- package/dist/superdoc/src/internal/toolbar/built-in/color-dropdown-helpers.d.ts +24 -0
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +102 -0
- package/dist/superdoc/src/internal/toolbar/built-in/default-items.d.ts +17 -0
- package/dist/superdoc/src/internal/toolbar/built-in/font-options.d.ts +1 -0
- package/dist/superdoc/src/internal/toolbar/built-in/font-typeahead.d.ts +11 -0
- package/dist/superdoc/src/internal/toolbar/built-in/format-negation.d.ts +5 -0
- package/dist/superdoc/src/internal/toolbar/built-in/general.d.ts +1 -0
- package/dist/superdoc/src/internal/toolbar/built-in/helpers.d.ts +5 -0
- package/dist/superdoc/src/internal/toolbar/built-in/list-style-buttons.d.ts +10 -0
- package/dist/superdoc/src/internal/toolbar/built-in/scroll-helpers.d.ts +4 -0
- package/dist/superdoc/src/internal/toolbar/built-in/toolbar-focus-helpers.d.ts +1 -0
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarIcons.d.ts +76 -0
- package/dist/superdoc/src/internal/toolbar/built-in/toolbarTexts.d.ts +58 -0
- package/dist/superdoc/src/internal/toolbar/built-in/url-safety.d.ts +8 -0
- package/dist/superdoc/src/internal/toolbar/built-in/use-toolbar-item.d.ts +48 -0
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +237 -0
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +59 -0
- package/dist/superdoc/src/internal/toolbar/image-upload.d.ts +63 -0
- package/dist/superdoc/src/internal/toolbar/index.d.ts +10 -0
- package/dist/superdoc/src/main.d.ts +1 -0
- package/dist/superdoc/src/public/browser-document-api.d.ts +53 -0
- package/dist/superdoc/src/public/collaboration-upgrade-engine.d.cts +26 -0
- package/dist/superdoc/src/public/collaboration-upgrade-engine.d.ts +130 -0
- package/dist/superdoc/src/public/index.d.cts +359 -0
- package/dist/superdoc/src/public/index.d.ts +179 -0
- package/dist/superdoc/src/public/ui/commands.d.ts +249 -0
- package/dist/superdoc/src/public/ui/create-super-doc-ui.d.ts +18 -0
- package/dist/superdoc/src/public/ui/entity-at.d.ts +29 -0
- package/dist/superdoc/src/public/ui/equality.d.ts +10 -0
- package/dist/superdoc/src/public/ui/format-painter-helpers.d.ts +36 -0
- package/dist/superdoc/src/public/ui/react.d.ts +81 -0
- package/dist/superdoc/src/public/ui/reasons.d.ts +99 -0
- package/dist/superdoc/src/public/ui/types.d.ts +1425 -0
- package/dist/superdoc/src/public/ui-react.d.cts +20 -0
- package/dist/superdoc/src/public/ui-react.d.ts +20 -0
- package/dist/superdoc/src/public/ui.d.cts +194 -0
- package/dist/superdoc/src/public/ui.d.ts +29 -0
- package/dist/superdoc/src/stores/comments-store.d.ts +676 -0
- package/dist/superdoc/src/stores/helpers/floating-comment-instances.d.ts +14 -0
- package/dist/superdoc/src/stores/helpers/tracked-change-thread-index.d.ts +14 -0
- package/dist/superdoc/src/stores/hrbr-fields-store.d.ts +43 -0
- package/dist/superdoc/src/stores/superdoc-store.d.ts +2182 -0
- package/dist/superdoc.cjs +36521 -0
- package/dist/superdoc.es.js +36449 -0
- package/dist/word-layout/src/index.d.ts +64 -0
- package/dist/word-layout/src/list-marker.d.ts +68 -0
- package/dist/word-layout/src/marker-utils.d.ts +20 -0
- package/dist/word-layout/src/numbering-manager.d.ts +85 -0
- package/dist/word-layout/src/tab-layout.d.ts +193 -0
- package/dist/word-layout/src/types.d.ts +106 -0
- package/dist/word-layout/src/unit-conversions.d.ts +120 -0
- package/dist-cdn/style.layered.css +2 -0
- package/dist-cdn/superdoc.min.css +2 -0
- package/dist-cdn/superdoc.min.js +108 -0
- package/package.json +137 -24
- package/.npmignore +0 -4
- package/data.json +0 -17
- package/index.js +0 -2
- package/lib/Augmenter.js +0 -27
- package/lib/Runner.js +0 -80
- package/lib/Stopper.js +0 -71
- package/test/superdoc.js +0 -126
- package/utils/app.js +0 -18
- package/utils/server.js +0 -2
- package/web/index.js +0 -54
- package/web/public/style.css +0 -76
- package/web/views/index.ejs +0 -53
- package/web/views/layout.ejs +0 -13
- package/web/views/method.ejs +0 -59
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
import { PageCheckpointDependencyClass, FlowBlock, Layout, Measure, HeaderFooterLayout, ParagraphBlock, ParagraphMeasure, ColumnLayout } from '../../contracts/src/index.js';
|
|
2
|
+
import { FontMeasureContext } from '../../../shared/font-system/src/index.js';
|
|
3
|
+
import { LayoutOptions, HeaderFooterConstraints } from '../../layout-engine/src/index.js';
|
|
4
|
+
import { computeDirtyRegions } from './diff.js';
|
|
5
|
+
import { MeasureCache } from './cache.js';
|
|
6
|
+
import { HeaderFooterBatch } from './layoutHeaderFooter.js';
|
|
7
|
+
export type HeaderFooterMeasureFn = (block: FlowBlock, constraints: {
|
|
8
|
+
maxWidth: number;
|
|
9
|
+
maxHeight: number;
|
|
10
|
+
}) => Promise<Measure>;
|
|
11
|
+
export type HeaderFooterLayoutResult = {
|
|
12
|
+
kind: 'header' | 'footer';
|
|
13
|
+
type: keyof HeaderFooterBatch;
|
|
14
|
+
layout: HeaderFooterLayout;
|
|
15
|
+
blocks: FlowBlock[];
|
|
16
|
+
measures: Measure[];
|
|
17
|
+
/** Effective layout width when table grid widths exceed section content width (SD-1837). */
|
|
18
|
+
effectiveWidth?: number;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* SD-3432: the footnote reserve fixed point of a completed layout run, used to
|
|
22
|
+
* warm-start the next run's convergence loop. The seed is ONLY a starting
|
|
23
|
+
* vector — every run re-validates it through the full convergence machinery
|
|
24
|
+
* (pass-1 relayout + plan stability + grow/tighten + widow + trials), so a
|
|
25
|
+
* stale or wrong seed costs extra passes, never correctness. Captured only
|
|
26
|
+
* when the run ended on an EXACT fixed point (plan === applied reserves), so
|
|
27
|
+
* an unchanged document warm-validates in a single relayout.
|
|
28
|
+
*
|
|
29
|
+
* Guards carried with the vector (fontSignature / measurement constraints)
|
|
30
|
+
* exist purely to discard pathological starting vectors after zoom or font
|
|
31
|
+
* changes; they carry no document identity (no footnote ids, no content
|
|
32
|
+
* hashes — see the SD-3418 post-mortem for why identity keys are forbidden).
|
|
33
|
+
*/
|
|
34
|
+
export type FootnoteReserveSeed = {
|
|
35
|
+
reserves: number[];
|
|
36
|
+
/** Sparse page indexes that held a reserve, ledger, or injected note slice. */
|
|
37
|
+
notePageIndexes?: number[];
|
|
38
|
+
separatorSpacingBefore: number | undefined;
|
|
39
|
+
fontSignature: string;
|
|
40
|
+
measurementWidth: number;
|
|
41
|
+
measurementHeight: number;
|
|
42
|
+
/** Exact note measurement width retained with unchanged section geometry. */
|
|
43
|
+
footnoteMeasurementWidth?: number;
|
|
44
|
+
/** Section-column inputs used to derive the retained note measurement width. */
|
|
45
|
+
sectionColumnsByIndex?: Map<number, ColumnLayout>;
|
|
46
|
+
/** Exact note block objects retained by the host's authoritative note-bundle proof. */
|
|
47
|
+
noteBlocksByBlockId?: Map<string, FlowBlock>;
|
|
48
|
+
/** Measures paired with `noteBlocksByBlockId`; object identity is revalidated before reuse. */
|
|
49
|
+
noteMeasuresByBlockId?: Map<string, Measure>;
|
|
50
|
+
noteBodyHeightById?: Map<string, number>;
|
|
51
|
+
noteFirstLineHeightById?: Map<string, number>;
|
|
52
|
+
};
|
|
53
|
+
export type IncrementalLayoutResult = {
|
|
54
|
+
layout: Layout;
|
|
55
|
+
measures: Measure[];
|
|
56
|
+
dirty: ReturnType<typeof computeDirtyRegions>;
|
|
57
|
+
headers?: HeaderFooterLayoutResult[];
|
|
58
|
+
footers?: HeaderFooterLayoutResult[];
|
|
59
|
+
/**
|
|
60
|
+
* Extra blocks/measures that should be added to the painter's lookup table.
|
|
61
|
+
* Used for rendering non-body fragments injected into the layout (e.g., footnotes).
|
|
62
|
+
*/
|
|
63
|
+
extraBlocks?: FlowBlock[];
|
|
64
|
+
extraMeasures?: Measure[];
|
|
65
|
+
/**
|
|
66
|
+
* SD-3432: next-run warm-start seed for the footnote convergence loop.
|
|
67
|
+
* Null when this run did not end on an exact footnote fixed point (or laid
|
|
68
|
+
* out no footnotes) — the next run then starts cold.
|
|
69
|
+
*/
|
|
70
|
+
footnoteReserveSeed?: FootnoteReserveSeed | null;
|
|
71
|
+
layoutReuse?: IncrementalLayoutReuseSummary;
|
|
72
|
+
measureReuse?: {
|
|
73
|
+
mode: 'full-scan' | 'proved-dirty-only';
|
|
74
|
+
blocksMeasured: number;
|
|
75
|
+
measuresAdopted: number;
|
|
76
|
+
reason: string;
|
|
77
|
+
};
|
|
78
|
+
/**
|
|
79
|
+
* Per-call bridge-owned timing. This is returned with the canonical layout
|
|
80
|
+
* result so callers do not need to read the process-global metrics collector.
|
|
81
|
+
* Substage fields are non-overlapping for the top-level reconciliation:
|
|
82
|
+
* `measureTotalMs` includes cache lookup and actual measurement details,
|
|
83
|
+
* and `pageTokenTotalMs` includes token remeasure/relayout details.
|
|
84
|
+
*/
|
|
85
|
+
bridgeTiming: IncrementalLayoutBridgeTiming;
|
|
86
|
+
};
|
|
87
|
+
export type IncrementalLayoutBridgeTiming = {
|
|
88
|
+
totalMs: number;
|
|
89
|
+
inputPreparationMs: number;
|
|
90
|
+
measureTotalMs: number;
|
|
91
|
+
/** Union wall time spent inside caller-owned measure callbacks across body and furniture. */
|
|
92
|
+
measureCallbackWallMs: number;
|
|
93
|
+
measureCacheLookupMs: number;
|
|
94
|
+
measureActualMs: number;
|
|
95
|
+
headerFooterPreLayoutMs: number;
|
|
96
|
+
headerPreLayoutMs: number;
|
|
97
|
+
footerPreLayoutMs: number;
|
|
98
|
+
warmStartPreparationMs: number;
|
|
99
|
+
/** Wall time inside the initial body `layoutDocument` invocation only. */
|
|
100
|
+
layoutDocumentMs: number;
|
|
101
|
+
/** Initial body-layout wrapper work outside `layoutDocument` (proof, slice, convergence, splice). */
|
|
102
|
+
layoutReuseOrchestrationMs: number;
|
|
103
|
+
paginationMs: number;
|
|
104
|
+
pageTokenSetupMs: number;
|
|
105
|
+
pageTokenTotalMs: number;
|
|
106
|
+
pageTokenRemeasureMs: number;
|
|
107
|
+
pageTokenRelayoutMs: number;
|
|
108
|
+
footnoteMs: number;
|
|
109
|
+
numberingMs: number;
|
|
110
|
+
finalHeaderFooterMs: number;
|
|
111
|
+
layoutExposureMs: number;
|
|
112
|
+
unattributedMs: number;
|
|
113
|
+
counters: {
|
|
114
|
+
blocksRead: number;
|
|
115
|
+
cacheHits: number;
|
|
116
|
+
cacheMisses: number;
|
|
117
|
+
measuresAdopted: number;
|
|
118
|
+
pagesPaginated: number | null;
|
|
119
|
+
pagesSplicedByReuse: number;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Structural discriminator for what happened to the document tail (SD-3772
|
|
124
|
+
* D5). Consumers branch on THIS, never on the diagnostic `reason` string:
|
|
125
|
+
* - `none`: no retained tail exists (full recompute).
|
|
126
|
+
* - `adopted-source-tail`: a convergence page was proved and the source tail
|
|
127
|
+
* was adopted; `tailAdoption` is non-null and range-valid.
|
|
128
|
+
* - `relaid-to-document-end`: the bounded slice reached the exact end of the
|
|
129
|
+
* document and every terminal page was freshly paginated; `tailAdoption`
|
|
130
|
+
* is null. Every other combination fails closed before publication.
|
|
131
|
+
*/
|
|
132
|
+
export type IncrementalLayoutTailDisposition = 'none' | 'adopted-source-tail' | 'relaid-to-document-end';
|
|
133
|
+
export type IncrementalLayoutReuseSummary = {
|
|
134
|
+
mode: 'full' | 'prefix-resume' | 'tail-splice';
|
|
135
|
+
/** Diagnostic label only; never drives product behavior (SD-3772 D5). */
|
|
136
|
+
reason: string;
|
|
137
|
+
tailDisposition: IncrementalLayoutTailDisposition;
|
|
138
|
+
checkpointPageIndex: number | null;
|
|
139
|
+
/** Last prior page that can be affected by the dirty content/dependencies. */
|
|
140
|
+
affectedFrontierPageIndex: number | null;
|
|
141
|
+
/** Last source-generation page covered by the dirty content. */
|
|
142
|
+
sourceAffectedFrontierPageIndex: number | null;
|
|
143
|
+
convergencePageIndex: number | null;
|
|
144
|
+
/** Source-generation page adopted at convergence (may differ after page-count shifts). */
|
|
145
|
+
sourceConvergencePageIndex: number | null;
|
|
146
|
+
pagesPaginated: number | null;
|
|
147
|
+
pagesSplicedByReuse: number;
|
|
148
|
+
/**
|
|
149
|
+
* Proof for a retained tail. Pages in this interval remain byte-for-byte
|
|
150
|
+
* retained; consumers apply the position transforms only when a page enters
|
|
151
|
+
* the active paint window.
|
|
152
|
+
*/
|
|
153
|
+
tailAdoption: IncrementalLayoutTailAdoption | null;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Exact dirty-measure proof that is useful even when pagination reuse is
|
|
157
|
+
* independently vetoed. Keeping it separate prevents a global layout
|
|
158
|
+
* dependency from forcing an O(document) measurement-preparation scan.
|
|
159
|
+
*/
|
|
160
|
+
export type IncrementalMeasureReuseProof = Pick<IncrementalLayoutReuseOptions, 'provedDirtyRegion' | 'dependencyProof' | 'previousBlockIndexById' | 'currentBlockIndexById' | 'provedDirtyMeasureConstraints'>;
|
|
161
|
+
export type LayoutPositionTransform = {
|
|
162
|
+
atChar: number;
|
|
163
|
+
delta: number;
|
|
164
|
+
};
|
|
165
|
+
export type IncrementalSectionPageNumberTransform = {
|
|
166
|
+
/** Section whose retained pages need rebasing before its next boundary. */
|
|
167
|
+
sectionIndex: number;
|
|
168
|
+
/** Difference between target and source section-relative page positions. */
|
|
169
|
+
delta: number;
|
|
170
|
+
};
|
|
171
|
+
export type IncrementalLayoutTailAdoption = {
|
|
172
|
+
startPageIndex: number;
|
|
173
|
+
endPageIndexExclusive: number;
|
|
174
|
+
sourcePageStartIndex: number;
|
|
175
|
+
sourcePageEndIndexExclusive: number;
|
|
176
|
+
pageIndexDelta: number;
|
|
177
|
+
sectionPageNumberTransform: IncrementalSectionPageNumberTransform | null;
|
|
178
|
+
sourceLayoutEpoch: number | null;
|
|
179
|
+
positionTransforms: readonly LayoutPositionTransform[];
|
|
180
|
+
/** Lazy old->current block-id rekeys for an ordinal-changing structural splice. */
|
|
181
|
+
blockIdRewrites?: ReadonlyMap<string, string> | null;
|
|
182
|
+
};
|
|
183
|
+
type IncrementalPaginationProofBase = {
|
|
184
|
+
blockIdsUnchanged: true;
|
|
185
|
+
blockIdsUnique: true;
|
|
186
|
+
renderInputsUnchanged: true;
|
|
187
|
+
/** The retained dependency scan proved that no body or furniture PAGE_REF token exists. */
|
|
188
|
+
pageReferencesAbsent: boolean;
|
|
189
|
+
pageReferenceDependencyClosure?: {
|
|
190
|
+
referenceBlockIds: readonly string[];
|
|
191
|
+
targetBookmarkIds: readonly string[];
|
|
192
|
+
};
|
|
193
|
+
};
|
|
194
|
+
export type IncrementalPaginationProof = IncrementalPaginationProofBase & ({
|
|
195
|
+
profile: 'single-section-local-text';
|
|
196
|
+
globalDependenciesAbsent: true;
|
|
197
|
+
globalDependenciesFencedByDocumentStart?: never;
|
|
198
|
+
} | {
|
|
199
|
+
/** Stable dependency-rich documents must replay from a page-zero checkpoint. */
|
|
200
|
+
profile: 'document-start-local-text';
|
|
201
|
+
globalDependenciesAbsent: false;
|
|
202
|
+
globalDependenciesFencedByDocumentStart: true;
|
|
203
|
+
multiColumnSectionsProvedNonBalanceable: true;
|
|
204
|
+
} | {
|
|
205
|
+
/** Stable dependency-rich documents may replay from an engine-seeded page checkpoint. */
|
|
206
|
+
profile: 'page-checkpoint-local-text';
|
|
207
|
+
globalDependenciesAbsent: false;
|
|
208
|
+
globalDependenciesFencedByPageCheckpoint: true;
|
|
209
|
+
admittedDependencyClasses: readonly PageCheckpointDependencyClass[];
|
|
210
|
+
localKeepDependencyClosure?: {
|
|
211
|
+
checkpointPageIndex: number;
|
|
212
|
+
checkpointBlockId: string | null;
|
|
213
|
+
predecessorBlockId: string | null;
|
|
214
|
+
};
|
|
215
|
+
/**
|
|
216
|
+
* SD-3772 D1: the host proved (via the shared
|
|
217
|
+
* `hasGenuinelyUnequalExplicitColumnWidths` predicate) that no
|
|
218
|
+
* potentially balanceable multi-column section exists anywhere in the
|
|
219
|
+
* retained document. Balancing is a post-pagination finalizer that a
|
|
220
|
+
* mid-section checkpoint cannot seed; a packet without this proof
|
|
221
|
+
* fails validation and takes the canonical full layout.
|
|
222
|
+
*/
|
|
223
|
+
multiColumnSectionsProvedNonBalanceable: true;
|
|
224
|
+
});
|
|
225
|
+
export type IncrementalLayoutReuseOptions = {
|
|
226
|
+
previousLayout: Layout | null;
|
|
227
|
+
/** Epoch that produced every retained page/index/key in this reuse packet. */
|
|
228
|
+
retainedMetadataSourceLayoutEpoch?: number | null;
|
|
229
|
+
previousPageStartKeys: readonly string[] | null;
|
|
230
|
+
previousBlockPageIndex: Map<string, {
|
|
231
|
+
firstPage: number;
|
|
232
|
+
lastPage: number;
|
|
233
|
+
}> | null;
|
|
234
|
+
maxRelaidPages?: number;
|
|
235
|
+
requireDocumentStartCheckpoint?: boolean;
|
|
236
|
+
allowBlockIdChurn?: boolean;
|
|
237
|
+
pmShift?: LayoutPositionTransform | null;
|
|
238
|
+
/** Exact dirty identities from the commit envelope when already available. */
|
|
239
|
+
dirtyBlockIds?: readonly string[];
|
|
240
|
+
/** Exact retained block index, required to align a structural ±1 measure plane. */
|
|
241
|
+
previousBlockIndexById?: ReadonlyMap<string, number> | null;
|
|
242
|
+
/** Optional retained ordinal index, avoiding a whole-array checkpoint lookup. */
|
|
243
|
+
currentBlockIndexById?: ReadonlyMap<string, number> | null;
|
|
244
|
+
/** Inverse identity proof for ordinal-scoped ids shifted by a structural edit. */
|
|
245
|
+
blockIdRewrites?: {
|
|
246
|
+
previousToCurrent: ReadonlyMap<string, string>;
|
|
247
|
+
currentToPrevious: ReadonlyMap<string, string>;
|
|
248
|
+
} | null;
|
|
249
|
+
/** Retained dependency proof; avoids rescanning every block on a warm edit. */
|
|
250
|
+
dependencyProof?: IncrementalPaginationProof | null;
|
|
251
|
+
/** Exact retained dirty analysis; bypasses computeDirtyRegions on a proved warm edit. */
|
|
252
|
+
provedDirtyRegion?: ReturnType<typeof computeDirtyRegions> | null;
|
|
253
|
+
/** Cold-observed exact section constraints for each dirty block. */
|
|
254
|
+
provedDirtyMeasureConstraints?: ReadonlyMap<string, {
|
|
255
|
+
maxWidth: number;
|
|
256
|
+
maxHeight: number;
|
|
257
|
+
}> | null;
|
|
258
|
+
/** Retained key index used for O(1) convergence candidate lookup. */
|
|
259
|
+
previousPageStartKeyIndex?: ReadonlyMap<string, readonly number[]> | null;
|
|
260
|
+
/**
|
|
261
|
+
* Host-proved note-only refresh. Body ids are unchanged reference anchors;
|
|
262
|
+
* only the named note projections may differ from the retained note plane.
|
|
263
|
+
*/
|
|
264
|
+
provedNoteOnlyRefresh?: {
|
|
265
|
+
noteIds: readonly string[];
|
|
266
|
+
bodyReferenceBlockIds: readonly string[];
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
export declare const measureCache: MeasureCache<Measure>;
|
|
270
|
+
/**
|
|
271
|
+
* Reset every module-global cache this bridge holds (measure cache,
|
|
272
|
+
* header/footer measure cache, header/footer invalidation state). A clean
|
|
273
|
+
* cold-recompute oracle must start from exactly the state a fresh worker
|
|
274
|
+
* would have; clearing only the measure cache leaves warm header/footer
|
|
275
|
+
* state that can legally shift page geometry.
|
|
276
|
+
*/
|
|
277
|
+
export declare function clearIncrementalModuleState(): void;
|
|
278
|
+
export interface IncrementalLayoutExecutionControl {
|
|
279
|
+
/** Budget-aware host-task yield; may resolve immediately. */
|
|
280
|
+
yieldToHost?: () => Promise<void>;
|
|
281
|
+
/** Checkpoint cadence for the block measurement loop. Defaults to 32. */
|
|
282
|
+
yieldEveryBlocks?: number;
|
|
283
|
+
}
|
|
284
|
+
export declare function incrementalLayout(previousBlocks: FlowBlock[], _previousLayout: Layout | null, nextBlocks: FlowBlock[], options: LayoutOptions, measureBlock: (block: FlowBlock, constraints: {
|
|
285
|
+
maxWidth: number;
|
|
286
|
+
maxHeight: number;
|
|
287
|
+
}) => Promise<Measure>, headerFooter?: {
|
|
288
|
+
headerBlocks?: HeaderFooterBatch;
|
|
289
|
+
footerBlocks?: HeaderFooterBatch;
|
|
290
|
+
headerBlocksByRId?: Map<string, FlowBlock[]>;
|
|
291
|
+
footerBlocksByRId?: Map<string, FlowBlock[]>;
|
|
292
|
+
constraints: HeaderFooterConstraints;
|
|
293
|
+
measure?: HeaderFooterMeasureFn;
|
|
294
|
+
/**
|
|
295
|
+
* When `false`, header/footer NUMPAGES/SECTIONPAGES fields keep their
|
|
296
|
+
* source-cached DOCX text (em dash when absent) instead of resolving to
|
|
297
|
+
* the current — possibly partial — page total. Defaults to exact.
|
|
298
|
+
*/
|
|
299
|
+
pageCountFieldsExact?: boolean;
|
|
300
|
+
/**
|
|
301
|
+
* @deprecated Compatibility-only. Measurement identity is derived from
|
|
302
|
+
* content, constraints, font signature, and page-count field mode; render
|
|
303
|
+
* generation must not invalidate unchanged header/footer measurements.
|
|
304
|
+
*/
|
|
305
|
+
cacheGeneration?: number;
|
|
306
|
+
}, previousMeasures?: Measure[] | null, fontRuntime?: {
|
|
307
|
+
fontContext?: FontMeasureContext;
|
|
308
|
+
previousFontSignature?: string;
|
|
309
|
+
}, warmStart?: {
|
|
310
|
+
footnoteReserveSeed?: FootnoteReserveSeed | null;
|
|
311
|
+
/** Host proved the authoritative note projection bundle was retained exactly. */
|
|
312
|
+
noteMeasurePlaneRetainedExact?: true;
|
|
313
|
+
/** Extra note/decorative planes paired with the retained note bundle. */
|
|
314
|
+
retainedFootnoteExtras?: {
|
|
315
|
+
blocks: FlowBlock[];
|
|
316
|
+
measures: Measure[];
|
|
317
|
+
};
|
|
318
|
+
}, layoutReuse?: IncrementalLayoutReuseOptions, measureReuseProof?: IncrementalMeasureReuseProof, execution?: IncrementalLayoutExecutionControl): Promise<IncrementalLayoutResult>;
|
|
319
|
+
/**
|
|
320
|
+
* Normalizes a margin value, using a fallback for undefined or non-finite values.
|
|
321
|
+
* Prevents NaN content sizes when margin properties are partially defined.
|
|
322
|
+
*
|
|
323
|
+
* @param value - The margin value to normalize (may be undefined)
|
|
324
|
+
* @param fallback - The default margin value to use if value is invalid
|
|
325
|
+
* @returns The normalized margin value (guaranteed to be finite)
|
|
326
|
+
*/
|
|
327
|
+
export declare const normalizeMargin: (value: number | undefined, fallback: number) => number;
|
|
328
|
+
/**
|
|
329
|
+
* Walks table blocks (including nested tables) and computes `contentMeasures` for any
|
|
330
|
+
* `textboxShape` drawings found in table cells. Stores results directly on the block so
|
|
331
|
+
* the painter can read them without a `DrawingFragment` (table-cell drawings have none).
|
|
332
|
+
*/
|
|
333
|
+
export declare function hydrateTableTextboxMeasures(blocks: FlowBlock[], remeasure: (block: ParagraphBlock, maxWidth: number) => ParagraphMeasure): void;
|
|
334
|
+
/**
|
|
335
|
+
* Resolves the maximum measurement constraints (width and height) needed for measuring blocks
|
|
336
|
+
* across all sections in a document.
|
|
337
|
+
*
|
|
338
|
+
* This function scans the entire document (including all section breaks) to determine the
|
|
339
|
+
* widest column configuration and tallest content area that will be encountered during layout.
|
|
340
|
+
* The result is used for cache invalidation and backward-compatible comparison (see
|
|
341
|
+
* `canReusePreviousMeasures`). Actual per-block measurement uses `computePerSectionConstraints`.
|
|
342
|
+
*
|
|
343
|
+
* Algorithm:
|
|
344
|
+
* 1. Start with base content width/height from options.pageSize and options.margins
|
|
345
|
+
* 2. Calculate base column width from options.columns (if multi-column)
|
|
346
|
+
* 3. Scan all sectionBreak blocks to find maximum column width and content height
|
|
347
|
+
* 4. For each section: compute content area, calculate column width, track maximum
|
|
348
|
+
* 5. Return the widest column width and tallest content height found
|
|
349
|
+
*
|
|
350
|
+
* Column width calculation:
|
|
351
|
+
* - Single column: contentWidth (no gap subtraction)
|
|
352
|
+
* - Multi-column: (contentWidth - totalGap) / columnCount
|
|
353
|
+
* - Total gap = gap * (columnCount - 1)
|
|
354
|
+
*
|
|
355
|
+
* @param options - Layout options containing default page size, margins, and columns
|
|
356
|
+
* @param blocks - Optional array of flow blocks to scan for section breaks
|
|
357
|
+
* If not provided, only base constraints from options are used
|
|
358
|
+
* @returns Object containing:
|
|
359
|
+
* - measurementWidth: Maximum column width in pixels (guaranteed positive)
|
|
360
|
+
* - measurementHeight: Maximum content height in pixels (guaranteed positive)
|
|
361
|
+
*
|
|
362
|
+
* @throws Error if resolved constraints are non-positive (indicates invalid configuration)
|
|
363
|
+
*
|
|
364
|
+
* @example
|
|
365
|
+
* ```typescript
|
|
366
|
+
* // Document with two sections: single column and 2-column
|
|
367
|
+
* const options = {
|
|
368
|
+
* pageSize: { w: 612, h: 792 }, // Letter size
|
|
369
|
+
* margins: { top: 72, right: 72, bottom: 72, left: 72 },
|
|
370
|
+
* columns: { count: 1, gap: 0 }
|
|
371
|
+
* };
|
|
372
|
+
* const blocks = [
|
|
373
|
+
* // ... content blocks ...
|
|
374
|
+
* {
|
|
375
|
+
* kind: 'sectionBreak',
|
|
376
|
+
* columns: { count: 2, gap: 48 },
|
|
377
|
+
* // ... other section properties ...
|
|
378
|
+
* }
|
|
379
|
+
* ];
|
|
380
|
+
* const constraints = resolveMeasurementConstraints(options, blocks);
|
|
381
|
+
* // Returns: { measurementWidth: 468, measurementHeight: 648 }
|
|
382
|
+
* // 468px = (612 - 72 - 72) width, single column (wider than 2-column: 234px)
|
|
383
|
+
* // All blocks measured at 468px will fit in both sections
|
|
384
|
+
* ```
|
|
385
|
+
*/
|
|
386
|
+
export declare function resolveMeasurementConstraints(options: LayoutOptions, blocks?: FlowBlock[]): {
|
|
387
|
+
measurementWidth: number;
|
|
388
|
+
measurementHeight: number;
|
|
389
|
+
};
|
|
390
|
+
export {};
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import { FlowBlock, Layout, Measure, Line } from '../../contracts/src/index.js';
|
|
2
|
+
import { Point, FragmentHit, PositionHit } from './position-hit.js';
|
|
3
|
+
export type { HeaderFooterType } from '../../contracts/src/index.js';
|
|
4
|
+
export { selectHeaderFooterVariantForPage, resolveEffectiveHeaderFooterRef, type HeaderFooterKind, type HeaderFooterVariant, type HeaderFooterSectionRefs, type HeaderFooterResolutionSection, type HeaderFooterVariantSelectionInput, type HeaderFooterEffectiveRefInput, type HeaderFooterEffectiveRefResult, } from '../../contracts/src/index.js';
|
|
5
|
+
export { extractIdentifierFromConverter, getHeaderFooterType, defaultHeaderFooterIdentifier, resolveHeaderFooterForPage, buildMultiSectionIdentifier, defaultMultiSectionIdentifier, getHeaderFooterTypeForSection, getHeaderFooterIdForPage, resolveHeaderFooterForPageAndSection, } from './headerFooterUtils.js';
|
|
6
|
+
export type { HeaderFooterIdentifier, MultiSectionHeaderFooterIdentifier, SectionHeaderFooterIds, } from './headerFooterUtils.js';
|
|
7
|
+
export { layoutHeaderFooterWithCache, invalidateHeaderFooterMeasureCache, type HeaderFooterBatchResult, getBucketForPageNumber, getBucketRepresentative, } from './layoutHeaderFooter.js';
|
|
8
|
+
export type { HeaderFooterBatch, DigitBucket } from './layoutHeaderFooter.js';
|
|
9
|
+
export { resolveHeaderFooterTokens, PROVISIONAL_PAGE_COUNT_PLACEHOLDER, type ResolveHeaderFooterTokensOptions, } from './resolveHeaderFooterTokens.js';
|
|
10
|
+
export { findWordBoundaries, findParagraphBoundaries } from './text-boundaries.js';
|
|
11
|
+
export type { BoundaryRange } from './text-boundaries.js';
|
|
12
|
+
export { buildSectionAwareHeaderFooterLayoutKey, buildSectionContentWidth, buildEffectiveHeaderFooterRefsBySection, collectReferencedHeaderFooterRIds, buildSectionAwareHeaderFooterMeasurementGroups, } from './sectionAwareHeaderFooter.js';
|
|
13
|
+
export type { HeaderFooterSectionKind, HeaderFooterRefs, SectionAwareHeaderFooterMeasurementGroup, } from './sectionAwareHeaderFooter.js';
|
|
14
|
+
export { clearIncrementalModuleState, incrementalLayout, measureCache, normalizeMargin, hydrateTableTextboxMeasures, } from './incrementalLayout.js';
|
|
15
|
+
export type { HeaderFooterLayoutResult, IncrementalLayoutBridgeTiming, IncrementalLayoutResult, IncrementalMeasureReuseProof, IncrementalLayoutReuseOptions, IncrementalLayoutReuseSummary, IncrementalSectionPageNumberTransform, IncrementalLayoutTailAdoption, IncrementalLayoutTailDisposition, IncrementalPaginationProof, LayoutPositionTransform, FootnoteReserveSeed, } from './incrementalLayout.js';
|
|
16
|
+
export { collectFootnoteLedgers, getPreferredReserveCandidates, getPreferredReserveTrialTargets, isMandatoryOnlyFootnotePage, scoreFootnoteWindow, summarizeFootnoteWindow, } from './footnote-scorer.js';
|
|
17
|
+
export type { FootnotePreferredReserveCandidate, FootnoteWindowScoreInput, FootnoteWindowScoreReason, FootnoteWindowScoreResult, FootnoteWindowStats, } from './footnote-scorer.js';
|
|
18
|
+
export { computeDisplayPageNumber } from '../../layout-engine/src/index.js';
|
|
19
|
+
export type { DisplayPageInfo, HeaderFooterConstraints } from '../../layout-engine/src/index.js';
|
|
20
|
+
export { clearRemeasureTextCaches, remeasureParagraph } from './remeasure.js';
|
|
21
|
+
export { findCharacterAtX, measureCharacterX } from './text-measurement.js';
|
|
22
|
+
export { sliceRunsForLine } from '../../contracts/src/index.js';
|
|
23
|
+
export { clickToPositionDom, findPageElement } from './dom-mapping.js';
|
|
24
|
+
export { isListItem, getWordLayoutConfig, calculateTextStartIndent, extractParagraphIndent } from './list-indent-utils.js';
|
|
25
|
+
export type { TextIndentCalculationParams } from './list-indent-utils.js';
|
|
26
|
+
export { LayoutVersionLogger } from './instrumentation.js';
|
|
27
|
+
export type { LayoutMetrics } from './instrumentation.js';
|
|
28
|
+
export { hitTestTextboxFragment, resolveTextboxContentHit } from './position-hit.js';
|
|
29
|
+
export type { TextboxHitResult } from './position-hit.js';
|
|
30
|
+
export { FontMetricsCache } from './font-metrics-cache.js';
|
|
31
|
+
export type { FontMetrics, FontMetricsCacheConfig } from './font-metrics-cache.js';
|
|
32
|
+
export { ParagraphLineCache } from './paragraph-line-cache.js';
|
|
33
|
+
export type { LineInfo, ParagraphLines } from './paragraph-line-cache.js';
|
|
34
|
+
export { CursorRenderer } from './cursor-renderer.js';
|
|
35
|
+
export type { CursorRendererOptions, CursorRect } from './cursor-renderer.js';
|
|
36
|
+
export { LocalParagraphLayout } from './local-paragraph-layout.js';
|
|
37
|
+
export type { LocalLayoutResult, TextRun } from './local-paragraph-layout.js';
|
|
38
|
+
export { PmDomFallback } from './pm-dom-fallback.js';
|
|
39
|
+
export type { PageTransform, PmEditorView } from './pm-dom-fallback.js';
|
|
40
|
+
export { PageGeometryHelper } from './page-geometry-helper.js';
|
|
41
|
+
export type { PageGeometryConfig } from './page-geometry-helper.js';
|
|
42
|
+
export { DirtyTracker } from './dirty-tracker.js';
|
|
43
|
+
export type { DirtyRange } from './dirty-tracker.js';
|
|
44
|
+
export { DebouncedPassManager } from './debounced-passes.js';
|
|
45
|
+
export type { DebouncedPass } from './debounced-passes.js';
|
|
46
|
+
export { PmPositionValidator } from './pm-position-validator.js';
|
|
47
|
+
export type { ValidationResult, ValidationError } from './pm-position-validator.js';
|
|
48
|
+
export { ImeHandler } from './ime-handler.js';
|
|
49
|
+
export type { ImeState } from './ime-handler.js';
|
|
50
|
+
export { TableHandler } from './table-handler.js';
|
|
51
|
+
export type { TableLayoutState } from './table-handler.js';
|
|
52
|
+
export { TrackChangesHandler } from './track-changes-handler.js';
|
|
53
|
+
export type { TrackChangeSpan } from './track-changes-handler.js';
|
|
54
|
+
export { CacheWarmer } from './cache-warmer.js';
|
|
55
|
+
export type { WarmingConfig, ParagraphWarmInfo } from './cache-warmer.js';
|
|
56
|
+
export { PerformanceMetricsCollector, perfMetrics } from './performance-metrics.js';
|
|
57
|
+
export type { MetricSample, MetricSummary, TypingPerfMetrics, BudgetViolation } from './performance-metrics.js';
|
|
58
|
+
export { SafetyNet } from './safety-net.js';
|
|
59
|
+
export type { FallbackReason, SafetyConfig } from './safety-net.js';
|
|
60
|
+
export { FocusWatchdog } from './focus-watchdog.js';
|
|
61
|
+
export type { FocusWatchdogConfig } from './focus-watchdog.js';
|
|
62
|
+
export { hashParagraphBorder, hashParagraphBorders, hashParagraphAttrs, hashBorderSpec, hashTableBorderValue, hashTableBorders, hashCellBorders, hasStringProp, hasNumberProp, hasBooleanProp, getRunStringProp, getRunNumberProp, getRunBooleanProp, } from './paragraph-hash-utils.js';
|
|
63
|
+
export type { LayoutHit, LayoutHitDiagnostic, LayoutFragmentOpaqueRange, LayoutFragmentSubrange, LayoutRangeMapping, LayoutRect, PmOpaqueRange, } from './neutral-hit.js';
|
|
64
|
+
export { hitTestNeutral, mapRangeToFragmentsNeutral } from './neutral-hit.js';
|
|
65
|
+
export { collectSegmentGeometry } from './neutral-segment-geometry.js';
|
|
66
|
+
export type { CollectSegmentGeometryOptions } from './neutral-segment-geometry.js';
|
|
67
|
+
export { lineHasComplexBidiContent, logicalAdvanceToContainerX, containerXToLogicalAdvance, } from './rtl-text-geometry.js';
|
|
68
|
+
export type { Point, PageHit, FragmentHit, PositionHit, TableHitResult, GeometryPageHint, ClickToPositionGeometryOptions, } from './position-hit.js';
|
|
69
|
+
export { isAtomicFragment, getAtomicPmRange, isRtlBlock, determineColumn, findLineIndexAtY, mapPointToPm, snapToNearestFragment, hitTestPage, hitTestFragment, hitTestAtomicFragment, hitTestTableFragment, findBlockIndexByFragmentId, calculatePageTopFallback, resolvePositionHitFromDomPosition, clickToPositionGeometry, } from './position-hit.js';
|
|
70
|
+
export type Rect = {
|
|
71
|
+
x: number;
|
|
72
|
+
y: number;
|
|
73
|
+
width: number;
|
|
74
|
+
height: number;
|
|
75
|
+
pageIndex: number;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Compatibility wrapper — delegates to resolvePositionHitFromDomPosition and
|
|
79
|
+
* clickToPositionGeometry from position-hit.ts.
|
|
80
|
+
*
|
|
81
|
+
* Production editor-runtime callers should use resolvePointerPositionHit from
|
|
82
|
+
* their pointer resolver instead. This wrapper exists so that external
|
|
83
|
+
* consumers and tests that import clickToPosition from @superdoc/layout-bridge
|
|
84
|
+
* continue to work unchanged.
|
|
85
|
+
*/
|
|
86
|
+
export declare function clickToPosition(layout: Layout, blocks: FlowBlock[], measures: Measure[], containerPoint: Point, domContainer?: HTMLElement, clientX?: number, clientY?: number, geometryHelper?: import('./page-geometry-helper.js').PageGeometryHelper): PositionHit | null;
|
|
87
|
+
/**
|
|
88
|
+
* Given a PM range [from, to), return selection rectangles for highlighting.
|
|
89
|
+
*
|
|
90
|
+
* @param layout - The layout containing page and fragment data
|
|
91
|
+
* @param blocks - Array of flow blocks
|
|
92
|
+
* @param measures - Array of measurements corresponding to blocks
|
|
93
|
+
* @param from - Start PM position
|
|
94
|
+
* @param to - End PM position
|
|
95
|
+
* @param geometryHelper - Optional PageGeometryHelper for accurate Y calculations (recommended)
|
|
96
|
+
* @returns Array of selection rectangles in container space
|
|
97
|
+
*/
|
|
98
|
+
export declare function selectionToRects(layout: Layout, blocks: FlowBlock[], measures: Measure[], from: number, to: number, geometryHelper?: import('./page-geometry-helper.js').PageGeometryHelper): Rect[];
|
|
99
|
+
export declare function getFragmentAtPosition(layout: Layout, blocks: FlowBlock[], measures: Measure[], pos: number): FragmentHit | null;
|
|
100
|
+
export declare function findLinesIntersectingRange(block: FlowBlock, measure: Measure, from: number, to: number): {
|
|
101
|
+
line: Line;
|
|
102
|
+
index: number;
|
|
103
|
+
}[];
|
|
104
|
+
/**
|
|
105
|
+
* Computes the ProseMirror position range for a line within a paragraph block.
|
|
106
|
+
*
|
|
107
|
+
* This function calculates the start and end PM positions by iterating through all runs
|
|
108
|
+
* that contribute to the line, handling partial runs at line boundaries and accounting
|
|
109
|
+
* for various run types (text, images, breaks, annotations).
|
|
110
|
+
*
|
|
111
|
+
* **Empty Run Handling (SD-1108 Fix):**
|
|
112
|
+
* Unlike `pmPosToCharOffset` which skips empty runs during position-to-character mapping,
|
|
113
|
+
* this function intentionally PRESERVES empty runs to support cursor positioning in
|
|
114
|
+
* zero-width content like empty table cells. Empty runs carry PM position metadata that
|
|
115
|
+
* enables click-to-position mapping even when there's no visible text.
|
|
116
|
+
*
|
|
117
|
+
* **Why the difference?**
|
|
118
|
+
* - `computeLinePmRange`: Used for spatial operations (click mapping, selection highlighting)
|
|
119
|
+
* where we need to know the PM range of ALL content, including zero-width positions.
|
|
120
|
+
* - `pmPosToCharOffset`: Used for text measurement where only visible characters matter.
|
|
121
|
+
* Empty runs contribute no pixels and should be skipped during character-based calculations.
|
|
122
|
+
*
|
|
123
|
+
* **Algorithm:**
|
|
124
|
+
* 1. Filter out atomic runs (images, line breaks, field annotations) - they have no text length
|
|
125
|
+
* 2. For each text run in the line:
|
|
126
|
+
* a. If the run is empty (length 0), preserve its PM positions for cursor support
|
|
127
|
+
* b. If the run has text, calculate PM positions based on character offsets
|
|
128
|
+
* c. Handle partial runs (first/last in line) by adjusting offsets
|
|
129
|
+
* 3. Return the accumulated PM range
|
|
130
|
+
*
|
|
131
|
+
* **Edge Cases Handled:**
|
|
132
|
+
* - Empty runs (zero text length but valid PM positions) - PRESERVED for SD-1108
|
|
133
|
+
* - Atomic runs (images, breaks) - skipped, don't contribute to text range
|
|
134
|
+
* - Runs with missing PM data - skipped with warning logged
|
|
135
|
+
* - Runs with invalid PM positions (negative, Infinity, NaN) - logged as warnings
|
|
136
|
+
* - Partial runs at line boundaries - offset calculations applied
|
|
137
|
+
*
|
|
138
|
+
* @param block - The flow block to compute PM range for (must be a paragraph block)
|
|
139
|
+
* @param line - The line specification including run range (fromRun to toRun) and character offsets
|
|
140
|
+
* @returns Object containing pmStart and pmEnd positions, or empty object if block is not a paragraph
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* // Normal text run
|
|
145
|
+
* const range = computeLinePmRange(paragraphBlock, line);
|
|
146
|
+
* // { pmStart: 10, pmEnd: 25 }
|
|
147
|
+
*
|
|
148
|
+
* // Empty table cell (SD-1108 fix)
|
|
149
|
+
* const emptyRange = computeLinePmRange(emptyParagraphBlock, line);
|
|
150
|
+
* // { pmStart: 15, pmEnd: 15 } - zero-width but valid for cursor positioning
|
|
151
|
+
* ```
|
|
152
|
+
*
|
|
153
|
+
* @see pmPosToCharOffset - Related function that skips empty runs during character offset calculation
|
|
154
|
+
*/
|
|
155
|
+
export declare function computeLinePmRange(block: FlowBlock, line: Line): {
|
|
156
|
+
pmStart?: number;
|
|
157
|
+
pmEnd?: number;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Convert a ProseMirror position to a character offset within a line.
|
|
161
|
+
*
|
|
162
|
+
* This function performs ratio-based interpolation to handle cases where the PM position
|
|
163
|
+
* range doesn't match the text length (e.g., when a run has formatting marks or when
|
|
164
|
+
* there are position gaps between runs due to wrapper nodes).
|
|
165
|
+
*
|
|
166
|
+
* Algorithm:
|
|
167
|
+
* 1. Iterate through runs in the line
|
|
168
|
+
* 2. For each run, calculate its PM range and character count
|
|
169
|
+
* 3. If pmPos falls within the run's PM range:
|
|
170
|
+
* - Use ratio interpolation: (pmPos - runStart) / runPmRange * runCharCount
|
|
171
|
+
* - This handles cases where PM positions don't align 1:1 with characters
|
|
172
|
+
* 4. Return the accumulated character offset
|
|
173
|
+
*
|
|
174
|
+
* Edge Cases:
|
|
175
|
+
* - Position before line start: Returns 0
|
|
176
|
+
* - Position after line end: Returns total character count of the line
|
|
177
|
+
* - Empty runs (images, breaks): Skipped, don't contribute to character count
|
|
178
|
+
* - Runs with missing PM data: Skipped
|
|
179
|
+
* - Zero-length PM range: Returns current accumulated offset without adding
|
|
180
|
+
*
|
|
181
|
+
* Performance:
|
|
182
|
+
* - Time complexity: O(n) where n is the number of runs in the line
|
|
183
|
+
* - Space complexity: O(1)
|
|
184
|
+
*
|
|
185
|
+
* @param block - The paragraph block containing the line
|
|
186
|
+
* @param line - The line containing the position
|
|
187
|
+
* @param pmPos - The ProseMirror position to convert
|
|
188
|
+
* @returns Character offset from start of line (0-based), or 0 if position not found
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```typescript
|
|
192
|
+
* // Run with PM range [10, 15] containing "Hello" (5 chars)
|
|
193
|
+
* // pmPos = 12 should map to character offset 2 within the run
|
|
194
|
+
* const offset = pmPosToCharOffset(block, line, 12);
|
|
195
|
+
* // offset = 2 (ratio: (12-10)/(15-10) * 5 = 2/5 * 5 = 2)
|
|
196
|
+
* ```
|
|
197
|
+
*/
|
|
198
|
+
export declare function pmPosToCharOffset(block: FlowBlock, line: Line, pmPos: number): number;
|
|
199
|
+
/**
|
|
200
|
+
* Convert a ProseMirror position to a rendered character offset within a line.
|
|
201
|
+
*
|
|
202
|
+
* Unlike {@link pmPosToCharOffset}, this helper includes visual-only text runs
|
|
203
|
+
* that do not carry PM positions. That matters for selection highlighting when
|
|
204
|
+
* a line starts with rendered chrome such as a synthetic footnote number:
|
|
205
|
+
* the marker consumes horizontal space in the painter, but it is not part of
|
|
206
|
+
* the editable PM story. Using a PM-only offset would place the highlight too
|
|
207
|
+
* far left by the marker's width.
|
|
208
|
+
*
|
|
209
|
+
* The returned offset is intended for visual X mapping, not for slicing PM text.
|
|
210
|
+
*/
|
|
211
|
+
export declare function pmPosToVisualCharOffset(block: FlowBlock, line: Line, pmPos: number): number;
|