@voithos-labs/aragonite 0.10.1
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 +661 -0
- package/README.md +365 -0
- package/THIRD-PARTY-NOTICES.md +102 -0
- package/dist/a11y-strings.d.ts +46 -0
- package/dist/a11y-strings.js +62 -0
- package/dist/action-contracts.d.ts +301 -0
- package/dist/action-contracts.js +5 -0
- package/dist/active-editor.d.ts +16 -0
- package/dist/active-editor.js +67 -0
- package/dist/ambient/ambient-cursor.d.ts +41 -0
- package/dist/ambient/ambient-cursor.js +120 -0
- package/dist/ambient/ambient-dom.d.ts +9 -0
- package/dist/ambient/ambient-dom.js +102 -0
- package/dist/assert.d.ts +6 -0
- package/dist/assert.js +17 -0
- package/dist/block-component.d.ts +274 -0
- package/dist/block-component.js +43 -0
- package/dist/block-id.d.ts +14 -0
- package/dist/block-id.js +34 -0
- package/dist/bounded-memo.d.ts +14 -0
- package/dist/bounded-memo.js +32 -0
- package/dist/components/BlockDragHandle.svelte +66 -0
- package/dist/components/BlockDragHandle.svelte.d.ts +18 -0
- package/dist/components/BlockHost.svelte +328 -0
- package/dist/components/BlockHost.svelte.d.ts +15 -0
- package/dist/components/BlockList.svelte +114 -0
- package/dist/components/BlockList.svelte.d.ts +16 -0
- package/dist/components/DecorationOverlay.svelte +156 -0
- package/dist/components/DecorationOverlay.svelte.d.ts +14 -0
- package/dist/components/Editor.svelte +1849 -0
- package/dist/components/Editor.svelte.d.ts +49 -0
- package/dist/components/GapCaret.svelte +226 -0
- package/dist/components/GapCaret.svelte.d.ts +9 -0
- package/dist/components/SearchBar.svelte +243 -0
- package/dist/components/SearchBar.svelte.d.ts +7 -0
- package/dist/components/SelectionOverlay.svelte +171 -0
- package/dist/components/SelectionOverlay.svelte.d.ts +14 -0
- package/dist/components/block-content-selector.d.ts +12 -0
- package/dist/components/block-content-selector.js +12 -0
- package/dist/components/blocks/BlockquoteBlock.svelte +32 -0
- package/dist/components/blocks/BlockquoteBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/ThematicBreakBlock.svelte +156 -0
- package/dist/components/blocks/ThematicBreakBlock.svelte.d.ts +17 -0
- package/dist/components/blocks/code/CodeBlock.svelte +726 -0
- package/dist/components/blocks/code/CodeBlock.svelte.d.ts +23 -0
- package/dist/components/blocks/code/CodeLanguageChip.svelte +127 -0
- package/dist/components/blocks/code/CodeLanguageChip.svelte.d.ts +14 -0
- package/dist/components/blocks/code/code-beforeinput.d.ts +30 -0
- package/dist/components/blocks/code/code-beforeinput.js +40 -0
- package/dist/components/blocks/code/code-bootstrap.d.ts +8 -0
- package/dist/components/blocks/code/code-bootstrap.js +54 -0
- package/dist/components/blocks/code/code-editing.d.ts +28 -0
- package/dist/components/blocks/code/code-editing.js +79 -0
- package/dist/components/blocks/code/code-enter.d.ts +22 -0
- package/dist/components/blocks/code/code-enter.js +19 -0
- package/dist/components/blocks/code/code-fence-boundary.d.ts +77 -0
- package/dist/components/blocks/code/code-fence-boundary.js +169 -0
- package/dist/components/blocks/code/code-fence-exit.d.ts +24 -0
- package/dist/components/blocks/code/code-fence-exit.js +36 -0
- package/dist/components/blocks/code/code-indent.d.ts +14 -0
- package/dist/components/blocks/code/code-indent.js +87 -0
- package/dist/components/blocks/code/code-languages.d.ts +15 -0
- package/dist/components/blocks/code/code-languages.js +30 -0
- package/dist/components/blocks/code/code-paste-surface.d.ts +6 -0
- package/dist/components/blocks/code/code-paste-surface.js +29 -0
- package/dist/components/blocks/code/code-paste.d.ts +24 -0
- package/dist/components/blocks/code/code-paste.js +21 -0
- package/dist/components/blocks/code/code-renderer.d.ts +18 -0
- package/dist/components/blocks/code/code-renderer.js +249 -0
- package/dist/components/blocks/directive/DirectiveContainerBlock.svelte +51 -0
- package/dist/components/blocks/directive/DirectiveContainerBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/directive/activate-directives.d.ts +7 -0
- package/dist/components/blocks/directive/activate-directives.js +23 -0
- package/dist/components/blocks/editable-leaf.d.ts +126 -0
- package/dist/components/blocks/editable-leaf.js +410 -0
- package/dist/components/blocks/editable-surface.d.ts +209 -0
- package/dist/components/blocks/editable-surface.js +331 -0
- package/dist/components/blocks/list/ListBlock.svelte +162 -0
- package/dist/components/blocks/list/ListBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/list/ListItemBlock.svelte +324 -0
- package/dist/components/blocks/list/ListItemBlock.svelte.d.ts +14 -0
- package/dist/components/blocks/list/task-checkbox.d.ts +3 -0
- package/dist/components/blocks/list/task-checkbox.js +33 -0
- package/dist/components/blocks/plain-text-backend.d.ts +21 -0
- package/dist/components/blocks/plain-text-backend.js +47 -0
- package/dist/components/blocks/surface-wiring.svelte.d.ts +18 -0
- package/dist/components/blocks/surface-wiring.svelte.js +68 -0
- package/dist/components/blocks/table/TableActionMenu.svelte +267 -0
- package/dist/components/blocks/table/TableActionMenu.svelte.d.ts +15 -0
- package/dist/components/blocks/table/TableBlock.svelte +765 -0
- package/dist/components/blocks/table/TableBlock.svelte.d.ts +30 -0
- package/dist/components/blocks/table/TableCellBlock.svelte +1075 -0
- package/dist/components/blocks/table/TableCellBlock.svelte.d.ts +30 -0
- package/dist/components/blocks/table/TableGrip.svelte +91 -0
- package/dist/components/blocks/table/TableGrip.svelte.d.ts +8 -0
- package/dist/components/blocks/table/TableRowBlock.svelte +233 -0
- package/dist/components/blocks/table/TableRowBlock.svelte.d.ts +34 -0
- package/dist/components/blocks/table/cell-clipboard.d.ts +23 -0
- package/dist/components/blocks/table/cell-clipboard.js +34 -0
- package/dist/components/blocks/table/cell-keydown-plan.d.ts +37 -0
- package/dist/components/blocks/table/cell-keydown-plan.js +66 -0
- package/dist/components/blocks/table/cell-pointer.d.ts +58 -0
- package/dist/components/blocks/table/cell-pointer.js +153 -0
- package/dist/components/blocks/table/cell-render.d.ts +51 -0
- package/dist/components/blocks/table/cell-render.js +98 -0
- package/dist/components/blocks/table/cell-table-commands.d.ts +12 -0
- package/dist/components/blocks/table/cell-table-commands.js +21 -0
- package/dist/components/blocks/table/cell-x-mapping.d.ts +6 -0
- package/dist/components/blocks/table/cell-x-mapping.js +16 -0
- package/dist/components/blocks/table/selected-cells.d.ts +19 -0
- package/dist/components/blocks/table/selected-cells.js +35 -0
- package/dist/components/blocks/table/table-caret-at-point.d.ts +8 -0
- package/dist/components/blocks/table/table-caret-at-point.js +35 -0
- package/dist/components/blocks/table/table-cell-paste.d.ts +16 -0
- package/dist/components/blocks/table/table-cell-paste.js +75 -0
- package/dist/components/blocks/table/table-drag-hit-test.d.ts +5 -0
- package/dist/components/blocks/table/table-drag-hit-test.js +20 -0
- package/dist/components/blocks/table/table-drop-target.d.ts +1 -0
- package/dist/components/blocks/table/table-drop-target.js +16 -0
- package/dist/components/blocks/table/table-menu-model.d.ts +52 -0
- package/dist/components/blocks/table/table-menu-model.js +78 -0
- package/dist/components/blocks/table/table-navigation.d.ts +8 -0
- package/dist/components/blocks/table/table-navigation.js +22 -0
- package/dist/components/blocks/table/table-reorder-drag.d.ts +78 -0
- package/dist/components/blocks/table/table-reorder-drag.js +97 -0
- package/dist/components/blocks/text/TextEditableBlock.svelte +1012 -0
- package/dist/components/blocks/text/TextEditableBlock.svelte.d.ts +33 -0
- package/dist/components/blocks/text/click-snap-guard.d.ts +8 -0
- package/dist/components/blocks/text/click-snap-guard.js +19 -0
- package/dist/components/blocks/text/composition-seat.d.ts +50 -0
- package/dist/components/blocks/text/composition-seat.js +65 -0
- package/dist/components/blocks/text/construct-edge-delete.d.ts +47 -0
- package/dist/components/blocks/text/construct-edge-delete.js +164 -0
- package/dist/components/blocks/text/construct-reveal.d.ts +39 -0
- package/dist/components/blocks/text/construct-reveal.js +164 -0
- package/dist/components/blocks/text/edge-policy-dispatch.d.ts +91 -0
- package/dist/components/blocks/text/edge-policy-dispatch.js +457 -0
- package/dist/components/blocks/text/edge-seat.d.ts +42 -0
- package/dist/components/blocks/text/edge-seat.js +197 -0
- package/dist/components/blocks/text/hidden-suffix.d.ts +10 -0
- package/dist/components/blocks/text/hidden-suffix.js +15 -0
- package/dist/components/blocks/text/link-at-point.d.ts +33 -0
- package/dist/components/blocks/text/link-at-point.js +47 -0
- package/dist/components/blocks/text/link-source-bytes.d.ts +37 -0
- package/dist/components/blocks/text/link-source-bytes.js +161 -0
- package/dist/components/blocks/text/live-join-seam.d.ts +15 -0
- package/dist/components/blocks/text/live-join-seam.js +327 -0
- package/dist/components/blocks/text/live-selection-edit.d.ts +68 -0
- package/dist/components/blocks/text/live-selection-edit.js +120 -0
- package/dist/components/blocks/text/live-split-rebalance.d.ts +56 -0
- package/dist/components/blocks/text/live-split-rebalance.js +239 -0
- package/dist/components/blocks/text/marker-completion.d.ts +18 -0
- package/dist/components/blocks/text/marker-completion.js +29 -0
- package/dist/components/blocks/text/pending-mark-insert.d.ts +37 -0
- package/dist/components/blocks/text/pending-mark-insert.js +188 -0
- package/dist/components/blocks/text/screen-diff.d.ts +20 -0
- package/dist/components/blocks/text/screen-diff.js +39 -0
- package/dist/components/blocks/text/text-clipboard.d.ts +70 -0
- package/dist/components/blocks/text/text-clipboard.js +131 -0
- package/dist/components/blocks/text/text-keydown.d.ts +39 -0
- package/dist/components/blocks/text/text-keydown.js +80 -0
- package/dist/components/blocks/text/text-render.d.ts +67 -0
- package/dist/components/blocks/text/text-render.js +215 -0
- package/dist/components/blocks/text/widget-adjacency.d.ts +30 -0
- package/dist/components/blocks/text/widget-adjacency.js +68 -0
- package/dist/components/blocks/text/widget-interaction.d.ts +90 -0
- package/dist/components/blocks/text/widget-interaction.js +591 -0
- package/dist/components/blocks/widget-portal.d.ts +54 -0
- package/dist/components/blocks/widget-portal.js +136 -0
- package/dist/components/built-in-blocks.d.ts +7 -0
- package/dist/components/built-in-blocks.js +77 -0
- package/dist/components/editor-root-clipboard.d.ts +29 -0
- package/dist/components/editor-root-clipboard.js +105 -0
- package/dist/components/editor-root-keydown.d.ts +47 -0
- package/dist/components/editor-root-keydown.js +88 -0
- package/dist/components/editor-root-listeners.d.ts +44 -0
- package/dist/components/editor-root-listeners.js +112 -0
- package/dist/components/image/ImageOverlayHost.svelte +115 -0
- package/dist/components/image/ImageOverlayHost.svelte.d.ts +20 -0
- package/dist/components/image/ImageProperties.svelte +153 -0
- package/dist/components/image/ImageProperties.svelte.d.ts +14 -0
- package/dist/components/image/ImageResizeHandles.svelte +188 -0
- package/dist/components/image/ImageResizeHandles.svelte.d.ts +10 -0
- package/dist/components/image/image-edit-commit.d.ts +38 -0
- package/dist/components/image/image-edit-commit.js +159 -0
- package/dist/components/image/image-resize.d.ts +11 -0
- package/dist/components/image/image-resize.js +38 -0
- package/dist/components/image/image-source-bytes.d.ts +15 -0
- package/dist/components/image/image-source-bytes.js +73 -0
- package/dist/components/image/image-widget-editing.d.ts +7 -0
- package/dist/components/image/image-widget-editing.js +41 -0
- package/dist/components/image/widget-dom.d.ts +11 -0
- package/dist/components/image/widget-dom.js +110 -0
- package/dist/components/image/widget-selection-state.svelte.d.ts +18 -0
- package/dist/components/image/widget-selection-state.svelte.js +26 -0
- package/dist/components/link-card/LinkCard.svelte +190 -0
- package/dist/components/link-card/LinkCard.svelte.d.ts +18 -0
- package/dist/components/link-card/LinkCardHost.svelte +181 -0
- package/dist/components/link-card/LinkCardHost.svelte.d.ts +25 -0
- package/dist/components/link-card/link-card-commit.d.ts +50 -0
- package/dist/components/link-card/link-card-commit.js +134 -0
- package/dist/components/link-card/link-card-entry.d.ts +39 -0
- package/dist/components/link-card/link-card-entry.js +51 -0
- package/dist/components/link-card/link-card-state.svelte.d.ts +44 -0
- package/dist/components/link-card/link-card-state.svelte.js +46 -0
- package/dist/components/lrd-map-gate.d.ts +18 -0
- package/dist/components/lrd-map-gate.js +22 -0
- package/dist/components/paste-image-arm.d.ts +29 -0
- package/dist/components/paste-image-arm.js +61 -0
- package/dist/components/portal.d.ts +11 -0
- package/dist/components/portal.js +29 -0
- package/dist/core/directive/activate.d.ts +8 -0
- package/dist/core/directive/activate.js +25 -0
- package/dist/core/directive/container-opener.d.ts +7 -0
- package/dist/core/directive/container-opener.js +162 -0
- package/dist/core/directive/grammar.d.ts +50 -0
- package/dist/core/directive/grammar.js +88 -0
- package/dist/core/directive/kinds.d.ts +31 -0
- package/dist/core/directive/kinds.js +137 -0
- package/dist/core/directive/registry.d.ts +39 -0
- package/dist/core/directive/registry.js +49 -0
- package/dist/core/directive/text-recognizer.d.ts +8 -0
- package/dist/core/directive/text-recognizer.js +87 -0
- package/dist/core/escapable.d.ts +6 -0
- package/dist/core/escapable.js +6 -0
- package/dist/core/inline/backticks.d.ts +16 -0
- package/dist/core/inline/backticks.js +62 -0
- package/dist/core/inline/character-refs.d.ts +7 -0
- package/dist/core/inline/character-refs.js +70 -0
- package/dist/core/inline/destination-bytes.d.ts +7 -0
- package/dist/core/inline/destination-bytes.js +14 -0
- package/dist/core/inline/entity-widget.d.ts +11 -0
- package/dist/core/inline/entity-widget.js +21 -0
- package/dist/core/inline/format-toggle.d.ts +50 -0
- package/dist/core/inline/format-toggle.js +533 -0
- package/dist/core/inline/html-entities.d.ts +8 -0
- package/dist/core/inline/html-entities.js +2134 -0
- package/dist/core/inline/html-tag-grammar.d.ts +16 -0
- package/dist/core/inline/html-tag-grammar.js +58 -0
- package/dist/core/inline/image-dimensions.d.ts +6 -0
- package/dist/core/inline/image-dimensions.js +42 -0
- package/dist/core/inline/index.d.ts +42 -0
- package/dist/core/inline/index.js +77 -0
- package/dist/core/inline/inline-cache.d.ts +20 -0
- package/dist/core/inline/inline-cache.js +28 -0
- package/dist/core/inline/inline-widgets.d.ts +124 -0
- package/dist/core/inline/inline-widgets.js +131 -0
- package/dist/core/inline/link-reference-resolver.d.ts +21 -0
- package/dist/core/inline/link-reference-resolver.js +46 -0
- package/dist/core/inline/raw-html-widget.d.ts +10 -0
- package/dist/core/inline/raw-html-widget.js +22 -0
- package/dist/core/inline/scan/autolinks.d.ts +23 -0
- package/dist/core/inline/scan/autolinks.js +354 -0
- package/dist/core/inline/scan/brackets.d.ts +11 -0
- package/dist/core/inline/scan/brackets.js +284 -0
- package/dist/core/inline/scan/code-spans.d.ts +7 -0
- package/dist/core/inline/scan/code-spans.js +27 -0
- package/dist/core/inline/scan/emphasis.d.ts +10 -0
- package/dist/core/inline/scan/emphasis.js +276 -0
- package/dist/core/inline/scan/index.d.ts +7 -0
- package/dist/core/inline/scan/index.js +176 -0
- package/dist/core/inline/scan/plugin-syntax.d.ts +62 -0
- package/dist/core/inline/scan/plugin-syntax.js +150 -0
- package/dist/core/inline/scan/scan-state.d.ts +47 -0
- package/dist/core/inline/scan/scan-state.js +48 -0
- package/dist/core/inline/scan/simple-nodes.d.ts +14 -0
- package/dist/core/inline/scan/simple-nodes.js +53 -0
- package/dist/core/inline/scan/url.d.ts +12 -0
- package/dist/core/inline/scan/url.js +82 -0
- package/dist/core/inline/transparency.d.ts +8 -0
- package/dist/core/inline/transparency.js +39 -0
- package/dist/core/inline/visibility.d.ts +81 -0
- package/dist/core/inline/visibility.js +144 -0
- package/dist/core/inline/walk.d.ts +14 -0
- package/dist/core/inline/walk.js +29 -0
- package/dist/core/inline-render.d.ts +48 -0
- package/dist/core/inline-render.js +322 -0
- package/dist/core/lines.d.ts +44 -0
- package/dist/core/lines.js +91 -0
- package/dist/core/node-views.d.ts +22 -0
- package/dist/core/node-views.js +8 -0
- package/dist/core/nodes.d.ts +297 -0
- package/dist/core/nodes.js +83 -0
- package/dist/core/parser.d.ts +68 -0
- package/dist/core/parser.js +189 -0
- package/dist/core/parsers/blockquote.d.ts +17 -0
- package/dist/core/parsers/blockquote.js +69 -0
- package/dist/core/parsers/built-in-openers.d.ts +8 -0
- package/dist/core/parsers/built-in-openers.js +124 -0
- package/dist/core/parsers/fence-syntax.d.ts +24 -0
- package/dist/core/parsers/fence-syntax.js +44 -0
- package/dist/core/parsers/fenced-code.d.ts +7 -0
- package/dist/core/parsers/fenced-code.js +29 -0
- package/dist/core/parsers/heading.d.ts +3 -0
- package/dist/core/parsers/heading.js +6 -0
- package/dist/core/parsers/html-block.d.ts +17 -0
- package/dist/core/parsers/html-block.js +94 -0
- package/dist/core/parsers/indented-code.d.ts +4 -0
- package/dist/core/parsers/indented-code.js +41 -0
- package/dist/core/parsers/link-reference.d.ts +7 -0
- package/dist/core/parsers/link-reference.js +152 -0
- package/dist/core/parsers/list.d.ts +19 -0
- package/dist/core/parsers/list.js +133 -0
- package/dist/core/parsers/paragraph.d.ts +10 -0
- package/dist/core/parsers/paragraph.js +42 -0
- package/dist/core/parsers/table-completion.d.ts +13 -0
- package/dist/core/parsers/table-completion.js +48 -0
- package/dist/core/parsers/table.d.ts +18 -0
- package/dist/core/parsers/table.js +110 -0
- package/dist/core/parsers/thematic-break.d.ts +1 -0
- package/dist/core/parsers/thematic-break.js +19 -0
- package/dist/core/serializer.d.ts +15 -0
- package/dist/core/serializer.js +11 -0
- package/dist/core/terminator-escalation.d.ts +8 -0
- package/dist/core/terminator-escalation.js +18 -0
- package/dist/core/url-policy.d.ts +14 -0
- package/dist/core/url-policy.js +44 -0
- package/dist/cursor/content-offsets.d.ts +29 -0
- package/dist/cursor/content-offsets.js +151 -0
- package/dist/cursor/coordinate-spaces.d.ts +65 -0
- package/dist/cursor/coordinate-spaces.js +66 -0
- package/dist/cursor/dom-walk.d.ts +18 -0
- package/dist/cursor/dom-walk.js +31 -0
- package/dist/cursor/edge-affinity.d.ts +44 -0
- package/dist/cursor/edge-affinity.js +60 -0
- package/dist/cursor/focused-caret.d.ts +10 -0
- package/dist/cursor/focused-caret.js +24 -0
- package/dist/cursor/height-model.d.ts +24 -0
- package/dist/cursor/height-model.js +72 -0
- package/dist/cursor/height-oracle.d.ts +24 -0
- package/dist/cursor/height-oracle.js +94 -0
- package/dist/cursor/overlay-rects.d.ts +8 -0
- package/dist/cursor/overlay-rects.js +19 -0
- package/dist/cursor/overlay-remeasure.d.ts +17 -0
- package/dist/cursor/overlay-remeasure.js +31 -0
- package/dist/cursor/pending-marks.d.ts +24 -0
- package/dist/cursor/pending-marks.js +36 -0
- package/dist/cursor/point-offset.d.ts +21 -0
- package/dist/cursor/point-offset.js +48 -0
- package/dist/cursor/reveal-anchor.d.ts +30 -0
- package/dist/cursor/reveal-anchor.js +31 -0
- package/dist/cursor/reveal-source.d.ts +35 -0
- package/dist/cursor/reveal-source.js +51 -0
- package/dist/cursor/scroll-ancestors.d.ts +28 -0
- package/dist/cursor/scroll-ancestors.js +89 -0
- package/dist/cursor/scrollport.d.ts +20 -0
- package/dist/cursor/scrollport.js +41 -0
- package/dist/cursor/sticky-column.d.ts +35 -0
- package/dist/cursor/sticky-column.js +64 -0
- package/dist/cursor/sticky-measure.d.ts +16 -0
- package/dist/cursor/sticky-measure.js +97 -0
- package/dist/cursor/typography-estimates.d.ts +21 -0
- package/dist/cursor/typography-estimates.js +21 -0
- package/dist/cursor/visual-lines.d.ts +25 -0
- package/dist/cursor/visual-lines.js +125 -0
- package/dist/cursor/widget-offset.d.ts +132 -0
- package/dist/cursor/widget-offset.js +543 -0
- package/dist/debug/diagnostics-report.d.ts +17 -0
- package/dist/debug/diagnostics-report.js +25 -0
- package/dist/debug/dump-tree.d.ts +6 -0
- package/dist/debug/dump-tree.js +114 -0
- package/dist/debug/inspect.d.ts +19 -0
- package/dist/debug/inspect.js +116 -0
- package/dist/debug/interaction-trace.d.ts +39 -0
- package/dist/debug/interaction-trace.js +105 -0
- package/dist/debug/operations-log.d.ts +14 -0
- package/dist/debug/operations-log.js +30 -0
- package/dist/decorations/buckets.d.ts +40 -0
- package/dist/decorations/buckets.js +87 -0
- package/dist/decorations/decoration-state.svelte.d.ts +20 -0
- package/dist/decorations/decoration-state.svelte.js +195 -0
- package/dist/decorations/island-dom.d.ts +35 -0
- package/dist/decorations/island-dom.js +148 -0
- package/dist/decorations/reserved-attrs.d.ts +12 -0
- package/dist/decorations/reserved-attrs.js +47 -0
- package/dist/decorations/types.d.ts +68 -0
- package/dist/decorations/types.js +5 -0
- package/dist/decorations/widget-dom.d.ts +15 -0
- package/dist/decorations/widget-dom.js +35 -0
- package/dist/dev-warn.d.ts +13 -0
- package/dist/dev-warn.js +28 -0
- package/dist/editor-actions/ancestry-folds.d.ts +32 -0
- package/dist/editor-actions/ancestry-folds.js +106 -0
- package/dist/editor-actions/block-edit-core.d.ts +29 -0
- package/dist/editor-actions/block-edit-core.js +277 -0
- package/dist/editor-actions/block-edit-scope.d.ts +79 -0
- package/dist/editor-actions/block-edit-scope.js +76 -0
- package/dist/editor-actions/block-edit.d.ts +8 -0
- package/dist/editor-actions/block-edit.js +111 -0
- package/dist/editor-actions/commit/history.d.ts +9 -0
- package/dist/editor-actions/commit/history.js +77 -0
- package/dist/editor-actions/commit/text-batch.d.ts +34 -0
- package/dist/editor-actions/commit/text-batch.js +61 -0
- package/dist/editor-actions/commit/undo-controller.d.ts +7 -0
- package/dist/editor-actions/commit/undo-controller.js +570 -0
- package/dist/editor-actions/container-block-component.d.ts +85 -0
- package/dist/editor-actions/container-block-component.js +228 -0
- package/dist/editor-actions/container-edit.d.ts +7 -0
- package/dist/editor-actions/container-edit.js +49 -0
- package/dist/editor-actions/container-exit-overrides.d.ts +16 -0
- package/dist/editor-actions/container-exit-overrides.js +38 -0
- package/dist/editor-actions/deps.d.ts +60 -0
- package/dist/editor-actions/deps.js +1 -0
- package/dist/editor-actions/enter-completion.d.ts +25 -0
- package/dist/editor-actions/enter-completion.js +76 -0
- package/dist/editor-actions/focus/focus-dispatch.d.ts +36 -0
- package/dist/editor-actions/focus/focus-dispatch.js +106 -0
- package/dist/editor-actions/focus/focus-landing.d.ts +7 -0
- package/dist/editor-actions/focus/focus-landing.js +39 -0
- package/dist/editor-actions/focus/focus.d.ts +7 -0
- package/dist/editor-actions/focus/focus.js +74 -0
- package/dist/editor-actions/index.d.ts +15 -0
- package/dist/editor-actions/index.js +19 -0
- package/dist/editor-actions/inline-range-commit.d.ts +20 -0
- package/dist/editor-actions/inline-range-commit.js +63 -0
- package/dist/editor-actions/list-context.d.ts +25 -0
- package/dist/editor-actions/list-context.js +285 -0
- package/dist/editor-actions/list-overrides.d.ts +13 -0
- package/dist/editor-actions/list-overrides.js +26 -0
- package/dist/editor-actions/merge-fallback.d.ts +19 -0
- package/dist/editor-actions/merge-fallback.js +27 -0
- package/dist/editor-actions/nested/nested-actions.d.ts +65 -0
- package/dist/editor-actions/nested/nested-actions.js +59 -0
- package/dist/editor-actions/nested/nested-block-edit.d.ts +10 -0
- package/dist/editor-actions/nested/nested-block-edit.js +181 -0
- package/dist/editor-actions/nested/nested-focus.d.ts +9 -0
- package/dist/editor-actions/nested/nested-focus.js +30 -0
- package/dist/editor-actions/paste-coordinator.d.ts +4 -0
- package/dist/editor-actions/paste-coordinator.js +20 -0
- package/dist/editor-actions/plugin/chrome-leaf.d.ts +25 -0
- package/dist/editor-actions/plugin/chrome-leaf.js +80 -0
- package/dist/editor-actions/plugin/container.d.ts +137 -0
- package/dist/editor-actions/plugin/container.js +351 -0
- package/dist/editor-actions/plugin/directive-container.d.ts +13 -0
- package/dist/editor-actions/plugin/directive-container.js +31 -0
- package/dist/editor-actions/reorder-action.d.ts +17 -0
- package/dist/editor-actions/reorder-action.js +104 -0
- package/dist/editor-actions/reorder-drag.d.ts +34 -0
- package/dist/editor-actions/reorder-drag.js +152 -0
- package/dist/editor-actions/replacement-focus.d.ts +27 -0
- package/dist/editor-actions/replacement-focus.js +60 -0
- package/dist/editor-actions/search-replace.d.ts +6 -0
- package/dist/editor-actions/search-replace.js +145 -0
- package/dist/editor-actions/table-context.d.ts +34 -0
- package/dist/editor-actions/table-context.js +292 -0
- package/dist/editor-actions/unwrap-strategies.d.ts +14 -0
- package/dist/editor-actions/unwrap-strategies.js +131 -0
- package/dist/editor-actions/whole-block-focus-surface.d.ts +51 -0
- package/dist/editor-actions/whole-block-focus-surface.js +171 -0
- package/dist/editor-events.d.ts +89 -0
- package/dist/editor-events.js +96 -0
- package/dist/editor-keys.d.ts +197 -0
- package/dist/editor-keys.js +40 -0
- package/dist/editor-props.d.ts +164 -0
- package/dist/editor-props.js +1 -0
- package/dist/editor-rects.d.ts +58 -0
- package/dist/editor-rects.js +114 -0
- package/dist/env.d.ts +12 -0
- package/dist/env.js +20 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +19 -0
- package/dist/invariants/commit-paths.d.ts +10 -0
- package/dist/invariants/commit-paths.js +25 -0
- package/dist/invariants/commit-scope.d.ts +9 -0
- package/dist/invariants/commit-scope.js +16 -0
- package/dist/invariants/context-keys.d.ts +7 -0
- package/dist/invariants/context-keys.js +14 -0
- package/dist/invariants/descriptor.d.ts +10 -0
- package/dist/invariants/descriptor.js +24 -0
- package/dist/invariants/inline-transitions.d.ts +23 -0
- package/dist/invariants/inline-transitions.js +52 -0
- package/dist/invariants/install.d.ts +36 -0
- package/dist/invariants/install.js +66 -0
- package/dist/invariants/landable-caret.d.ts +12 -0
- package/dist/invariants/landable-caret.js +31 -0
- package/dist/invariants/marker-css-parity.d.ts +10 -0
- package/dist/invariants/marker-css-parity.js +87 -0
- package/dist/invariants/node-shape.d.ts +44 -0
- package/dist/invariants/node-shape.js +258 -0
- package/dist/invariants/registry.d.ts +126 -0
- package/dist/invariants/registry.js +349 -0
- package/dist/invariants/render-fidelity.d.ts +8 -0
- package/dist/invariants/render-fidelity.js +33 -0
- package/dist/invariants/selection-endpoints.d.ts +19 -0
- package/dist/invariants/selection-endpoints.js +78 -0
- package/dist/invariants/single-node-sink.d.ts +9 -0
- package/dist/invariants/single-node-sink.js +16 -0
- package/dist/invariants/snapshot-integrity.d.ts +17 -0
- package/dist/invariants/snapshot-integrity.js +24 -0
- package/dist/invariants/split-landing.d.ts +8 -0
- package/dist/invariants/split-landing.js +15 -0
- package/dist/invariants/structural-descriptor.d.ts +21 -0
- package/dist/invariants/structural-descriptor.js +50 -0
- package/dist/perf/instruments.d.ts +49 -0
- package/dist/perf/instruments.js +154 -0
- package/dist/perf/use-mount-gauge.svelte.d.ts +1 -0
- package/dist/perf/use-mount-gauge.svelte.js +15 -0
- package/dist/plugin.d.ts +102 -0
- package/dist/plugin.js +156 -0
- package/dist/plugins/admonitions/AdmonitionBlock.svelte +144 -0
- package/dist/plugins/admonitions/AdmonitionBlock.svelte.d.ts +11 -0
- package/dist/plugins/admonitions/admonition-kind.d.ts +8 -0
- package/dist/plugins/admonitions/admonition-kind.js +97 -0
- package/dist/plugins/admonitions/convert-document.d.ts +11 -0
- package/dist/plugins/admonitions/convert-document.js +39 -0
- package/dist/plugins/admonitions/gh-alert.d.ts +13 -0
- package/dist/plugins/admonitions/gh-alert.js +83 -0
- package/dist/plugins/admonitions/github-alert-kind.d.ts +12 -0
- package/dist/plugins/admonitions/github-alert-kind.js +125 -0
- package/dist/plugins/admonitions/index.d.ts +6 -0
- package/dist/plugins/admonitions/index.js +8 -0
- package/dist/plugins/admonitions/kinds.d.ts +26 -0
- package/dist/plugins/admonitions/kinds.js +18 -0
- package/dist/plugins/admonitions/register.d.ts +7 -0
- package/dist/plugins/admonitions/register.js +12 -0
- package/dist/plugins/details/DetailsBlock.svelte +129 -0
- package/dist/plugins/details/DetailsBlock.svelte.d.ts +11 -0
- package/dist/plugins/details/details-disclosure.svelte.d.ts +17 -0
- package/dist/plugins/details/details-disclosure.svelte.js +24 -0
- package/dist/plugins/details/details-kind.d.ts +25 -0
- package/dist/plugins/details/details-kind.js +237 -0
- package/dist/plugins/details/index.d.ts +2 -0
- package/dist/plugins/details/index.js +2 -0
- package/dist/plugins/details/register.d.ts +6 -0
- package/dist/plugins/details/register.js +15 -0
- package/dist/plugins/emoji/emoji-plugin.d.ts +2 -0
- package/dist/plugins/emoji/emoji-plugin.js +10 -0
- package/dist/plugins/emoji/emoji-recognizer.d.ts +18 -0
- package/dist/plugins/emoji/emoji-recognizer.js +63 -0
- package/dist/plugins/emoji/emoji-table.d.ts +1 -0
- package/dist/plugins/emoji/emoji-table.js +1919 -0
- package/dist/plugins/emoji/index.d.ts +3 -0
- package/dist/plugins/emoji/index.js +4 -0
- package/dist/plugins/footnotes/FootnoteDefinition.svelte +103 -0
- package/dist/plugins/footnotes/FootnoteDefinition.svelte.d.ts +13 -0
- package/dist/plugins/footnotes/FootnoteReference.svelte +50 -0
- package/dist/plugins/footnotes/FootnoteReference.svelte.d.ts +4 -0
- package/dist/plugins/footnotes/constants.d.ts +2 -0
- package/dist/plugins/footnotes/constants.js +4 -0
- package/dist/plugins/footnotes/footnote-definition.d.ts +14 -0
- package/dist/plugins/footnotes/footnote-definition.js +147 -0
- package/dist/plugins/footnotes/footnote-lookup.d.ts +9 -0
- package/dist/plugins/footnotes/footnote-lookup.js +33 -0
- package/dist/plugins/footnotes/footnote-numbering.d.ts +23 -0
- package/dist/plugins/footnotes/footnote-numbering.js +78 -0
- package/dist/plugins/footnotes/footnote-reference.d.ts +7 -0
- package/dist/plugins/footnotes/footnote-reference.js +54 -0
- package/dist/plugins/footnotes/footnotes-plugin.d.ts +7 -0
- package/dist/plugins/footnotes/footnotes-plugin.js +17 -0
- package/dist/plugins/footnotes/index.d.ts +5 -0
- package/dist/plugins/footnotes/index.js +6 -0
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.d.ts +17 -0
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.js +31 -0
- package/dist/plugins/highlight-occurrences/index.d.ts +1 -0
- package/dist/plugins/highlight-occurrences/index.js +1 -0
- package/dist/plugins/highlight-occurrences/occurrence-source.d.ts +26 -0
- package/dist/plugins/highlight-occurrences/occurrence-source.js +54 -0
- package/dist/plugins/highlight-occurrences/occurrences.d.ts +33 -0
- package/dist/plugins/highlight-occurrences/occurrences.js +108 -0
- package/dist/plugins/latex/BlockMath.svelte +119 -0
- package/dist/plugins/latex/BlockMath.svelte.d.ts +21 -0
- package/dist/plugins/latex/MathInline.svelte +28 -0
- package/dist/plugins/latex/MathInline.svelte.d.ts +4 -0
- package/dist/plugins/latex/index.d.ts +3 -0
- package/dist/plugins/latex/index.js +4 -0
- package/dist/plugins/latex/latex-kind.d.ts +17 -0
- package/dist/plugins/latex/latex-kind.js +224 -0
- package/dist/plugins/latex/math-completion.d.ts +10 -0
- package/dist/plugins/latex/math-completion.js +19 -0
- package/dist/plugins/latex/math-renderer.d.ts +26 -0
- package/dist/plugins/latex/math-renderer.js +42 -0
- package/dist/plugins/latex/register.d.ts +10 -0
- package/dist/plugins/latex/register.js +23 -0
- package/dist/plugins/latex/renderer.d.ts +13 -0
- package/dist/plugins/latex/renderer.js +34 -0
- package/dist/plugins/mermaid/MermaidBlock.svelte +572 -0
- package/dist/plugins/mermaid/MermaidBlock.svelte.d.ts +11 -0
- package/dist/plugins/mermaid/index.d.ts +3 -0
- package/dist/plugins/mermaid/index.js +3 -0
- package/dist/plugins/mermaid/mermaid-kind.d.ts +38 -0
- package/dist/plugins/mermaid/mermaid-kind.js +176 -0
- package/dist/plugins/mermaid/mermaid-renderer.d.ts +28 -0
- package/dist/plugins/mermaid/mermaid-renderer.js +35 -0
- package/dist/plugins/mermaid/register.d.ts +10 -0
- package/dist/plugins/mermaid/register.js +20 -0
- package/dist/plugins/mermaid/renderer.d.ts +11 -0
- package/dist/plugins/mermaid/renderer.js +53 -0
- package/dist/plugins/parrot/ParrotBlock.svelte +342 -0
- package/dist/plugins/parrot/ParrotBlock.svelte.d.ts +21 -0
- package/dist/plugins/parrot/index.d.ts +1 -0
- package/dist/plugins/parrot/index.js +2 -0
- package/dist/plugins/parrot/parrot-plugin.d.ts +3 -0
- package/dist/plugins/parrot/parrot-plugin.js +49 -0
- package/dist/plugins/toc/TocBlock.svelte +218 -0
- package/dist/plugins/toc/TocBlock.svelte.d.ts +24 -0
- package/dist/plugins/toc/heading-outline.d.ts +28 -0
- package/dist/plugins/toc/heading-outline.js +65 -0
- package/dist/plugins/toc/index.d.ts +2 -0
- package/dist/plugins/toc/index.js +2 -0
- package/dist/plugins/toc/navigation-queue.d.ts +12 -0
- package/dist/plugins/toc/navigation-queue.js +21 -0
- package/dist/plugins/toc/toc-plugin.d.ts +16 -0
- package/dist/plugins/toc/toc-plugin.js +71 -0
- package/dist/presentation-mode.d.ts +32 -0
- package/dist/presentation-mode.js +50 -0
- package/dist/reactivity/block-list-state.svelte.d.ts +22 -0
- package/dist/reactivity/block-list-state.svelte.js +46 -0
- package/dist/reactivity/block-window.svelte.d.ts +41 -0
- package/dist/reactivity/block-window.svelte.js +93 -0
- package/dist/reactivity/content-version.svelte.d.ts +14 -0
- package/dist/reactivity/content-version.svelte.js +16 -0
- package/dist/reactivity/list-windowing.svelte.d.ts +100 -0
- package/dist/reactivity/list-windowing.svelte.js +402 -0
- package/dist/reactivity/measure-batch.d.ts +15 -0
- package/dist/reactivity/measure-batch.js +18 -0
- package/dist/reactivity/publish-ref.svelte.d.ts +54 -0
- package/dist/reactivity/publish-ref.svelte.js +128 -0
- package/dist/reactivity/scope-geometry.d.ts +18 -0
- package/dist/reactivity/scope-geometry.js +29 -0
- package/dist/reactivity/state-registry.d.ts +10 -0
- package/dist/reactivity/state-registry.js +44 -0
- package/dist/reactivity/use-container-windowing.svelte.d.ts +35 -0
- package/dist/reactivity/use-container-windowing.svelte.js +95 -0
- package/dist/reactivity/window-slice.d.ts +11 -0
- package/dist/reactivity/window-slice.js +9 -0
- package/dist/scan-index.d.ts +11 -0
- package/dist/scan-index.js +27 -0
- package/dist/schema/block-commands.d.ts +105 -0
- package/dist/schema/block-commands.js +179 -0
- package/dist/schema/block-completions.d.ts +33 -0
- package/dist/schema/block-completions.js +49 -0
- package/dist/schema/block-component-registry.d.ts +33 -0
- package/dist/schema/block-component-registry.js +33 -0
- package/dist/schema/block-kind-descriptor.d.ts +281 -0
- package/dist/schema/block-kind-descriptor.js +187 -0
- package/dist/schema/block-openers.d.ts +94 -0
- package/dist/schema/block-openers.js +150 -0
- package/dist/schema/built-in-descriptors.d.ts +8 -0
- package/dist/schema/built-in-descriptors.js +560 -0
- package/dist/schema/child-spans.d.ts +25 -0
- package/dist/schema/child-spans.js +161 -0
- package/dist/schema/closure.d.ts +39 -0
- package/dist/schema/closure.js +55 -0
- package/dist/schema/command-id.d.ts +20 -0
- package/dist/schema/command-id.js +42 -0
- package/dist/schema/commands.d.ts +147 -0
- package/dist/schema/commands.js +294 -0
- package/dist/schema/container-raw.d.ts +21 -0
- package/dist/schema/container-raw.js +43 -0
- package/dist/schema/container-rebuilders.d.ts +32 -0
- package/dist/schema/container-rebuilders.js +95 -0
- package/dist/schema/define-plugin-block.d.ts +15 -0
- package/dist/schema/define-plugin-block.js +18 -0
- package/dist/schema/fenced-code-raw.d.ts +43 -0
- package/dist/schema/fenced-code-raw.js +220 -0
- package/dist/schema/global-commands.d.ts +11 -0
- package/dist/schema/global-commands.js +40 -0
- package/dist/schema/inline-construct-policy.d.ts +131 -0
- package/dist/schema/inline-construct-policy.js +96 -0
- package/dist/schema/keybinding-overrides.d.ts +39 -0
- package/dist/schema/keybinding-overrides.js +43 -0
- package/dist/schema/keybindings.d.ts +36 -0
- package/dist/schema/keybindings.js +75 -0
- package/dist/schema/merge-rules.d.ts +28 -0
- package/dist/schema/merge-rules.js +57 -0
- package/dist/schema/opener-priorities.d.ts +16 -0
- package/dist/schema/opener-priorities.js +16 -0
- package/dist/schema/operations.d.ts +110 -0
- package/dist/schema/operations.js +6 -0
- package/dist/schema/plugin-activation.d.ts +13 -0
- package/dist/schema/plugin-activation.js +18 -0
- package/dist/schema/plugin-editor-context.d.ts +33 -0
- package/dist/schema/plugin-editor-context.js +65 -0
- package/dist/schema/plugin-install.d.ts +58 -0
- package/dist/schema/plugin-install.js +132 -0
- package/dist/schema/plugin-kind.d.ts +21 -0
- package/dist/schema/plugin-kind.js +86 -0
- package/dist/schema/plugin-name.d.ts +1 -0
- package/dist/schema/plugin-name.js +7 -0
- package/dist/schema/register-once.d.ts +9 -0
- package/dist/schema/register-once.js +35 -0
- package/dist/schema/registration-checks.d.ts +32 -0
- package/dist/schema/registration-checks.js +122 -0
- package/dist/schema/registration-pending.d.ts +28 -0
- package/dist/schema/registration-pending.js +48 -0
- package/dist/schema/registry-reset.d.ts +7 -0
- package/dist/schema/registry-reset.js +30 -0
- package/dist/schema/registry-view.d.ts +30 -0
- package/dist/schema/registry-view.js +39 -0
- package/dist/schema/reserved-chords.d.ts +35 -0
- package/dist/schema/reserved-chords.js +313 -0
- package/dist/schema/reserved-chrome.d.ts +23 -0
- package/dist/schema/reserved-chrome.js +33 -0
- package/dist/schema/table-cell-raw.d.ts +14 -0
- package/dist/schema/table-cell-raw.js +30 -0
- package/dist/schema/whole-block-unit.d.ts +8 -0
- package/dist/schema/whole-block-unit.js +12 -0
- package/dist/search/document-scan.d.ts +22 -0
- package/dist/search/document-scan.js +39 -0
- package/dist/search/matcher.d.ts +31 -0
- package/dist/search/matcher.js +70 -0
- package/dist/search/regex-executor.d.ts +41 -0
- package/dist/search/regex-executor.js +165 -0
- package/dist/search/replace.d.ts +15 -0
- package/dist/search/replace.js +29 -0
- package/dist/search/search-state.svelte.d.ts +59 -0
- package/dist/search/search-state.svelte.js +231 -0
- package/dist/selection/autoscroll.d.ts +26 -0
- package/dist/selection/autoscroll.js +91 -0
- package/dist/selection/block-hit-test.d.ts +37 -0
- package/dist/selection/block-hit-test.js +59 -0
- package/dist/selection/caret-doors.d.ts +20 -0
- package/dist/selection/caret-doors.js +44 -0
- package/dist/selection/caret-restore.d.ts +15 -0
- package/dist/selection/caret-restore.js +32 -0
- package/dist/selection/char-endpoint-snap.d.ts +15 -0
- package/dist/selection/char-endpoint-snap.js +39 -0
- package/dist/selection/clipboard-text.d.ts +13 -0
- package/dist/selection/clipboard-text.js +314 -0
- package/dist/selection/cross-block/clipboard.d.ts +14 -0
- package/dist/selection/cross-block/clipboard.js +20 -0
- package/dist/selection/cross-block/dispatch.d.ts +78 -0
- package/dist/selection/cross-block/dispatch.js +57 -0
- package/dist/selection/cross-block/format-range.d.ts +38 -0
- package/dist/selection/cross-block/format-range.js +193 -0
- package/dist/selection/cross-block/format-toggle.d.ts +27 -0
- package/dist/selection/cross-block/format-toggle.js +109 -0
- package/dist/selection/cross-block/keydown.d.ts +11 -0
- package/dist/selection/cross-block/keydown.js +339 -0
- package/dist/selection/cross-block/ops.d.ts +56 -0
- package/dist/selection/cross-block/ops.js +210 -0
- package/dist/selection/cross-block/paste.d.ts +8 -0
- package/dist/selection/cross-block/paste.js +156 -0
- package/dist/selection/cross-block/pointer.d.ts +19 -0
- package/dist/selection/cross-block/pointer.js +80 -0
- package/dist/selection/cross-block/type-replace.d.ts +10 -0
- package/dist/selection/cross-block/type-replace.js +129 -0
- package/dist/selection/dead-space-caret.d.ts +39 -0
- package/dist/selection/dead-space-caret.js +173 -0
- package/dist/selection/drag-pointer.d.ts +22 -0
- package/dist/selection/drag-pointer.js +89 -0
- package/dist/selection/gap-caret.d.ts +47 -0
- package/dist/selection/gap-caret.js +72 -0
- package/dist/selection/keyboard-extend.d.ts +43 -0
- package/dist/selection/keyboard-extend.js +257 -0
- package/dist/selection/native-bridge.d.ts +47 -0
- package/dist/selection/native-bridge.js +204 -0
- package/dist/selection/nearest-block.d.ts +43 -0
- package/dist/selection/nearest-block.js +73 -0
- package/dist/selection/path-lookup.d.ts +32 -0
- package/dist/selection/path-lookup.js +132 -0
- package/dist/selection/path-math.d.ts +35 -0
- package/dist/selection/path-math.js +90 -0
- package/dist/selection/pointer-session.d.ts +43 -0
- package/dist/selection/pointer-session.js +111 -0
- package/dist/selection/primitives.d.ts +75 -0
- package/dist/selection/primitives.js +91 -0
- package/dist/selection/range-delete-ceremony.d.ts +85 -0
- package/dist/selection/range-delete-ceremony.js +197 -0
- package/dist/selection/range-delete-chrome.d.ts +39 -0
- package/dist/selection/range-delete-chrome.js +105 -0
- package/dist/selection/range-delete-table-coverage.d.ts +28 -0
- package/dist/selection/range-delete-table-coverage.js +168 -0
- package/dist/selection/range-delete-table.d.ts +16 -0
- package/dist/selection/range-delete-table.js +347 -0
- package/dist/selection/range-delete.d.ts +33 -0
- package/dist/selection/range-delete.js +121 -0
- package/dist/selection/selection-description.d.ts +7 -0
- package/dist/selection/selection-description.js +18 -0
- package/dist/selection/selection-restore.d.ts +46 -0
- package/dist/selection/selection-restore.js +66 -0
- package/dist/selection/selection-state.svelte.d.ts +72 -0
- package/dist/selection/selection-state.svelte.js +247 -0
- package/dist/selection/shared-keydown.d.ts +61 -0
- package/dist/selection/shared-keydown.js +150 -0
- package/dist/selection/table-endpoint-snap.d.ts +55 -0
- package/dist/selection/table-endpoint-snap.js +143 -0
- package/dist/selection/table-rect-extend.d.ts +23 -0
- package/dist/selection/table-rect-extend.js +46 -0
- package/dist/selection/widget-range-paint.d.ts +12 -0
- package/dist/selection/widget-range-paint.js +44 -0
- package/dist/styles/editor-theme.css +151 -0
- package/dist/styles/editor.css +585 -0
- package/dist/testing/conformance-core.d.ts +45 -0
- package/dist/testing/conformance-core.js +105 -0
- package/dist/testing/container-conformance.d.ts +137 -0
- package/dist/testing/container-conformance.js +533 -0
- package/dist/testing/headless-actions.d.ts +37 -0
- package/dist/testing/headless-actions.js +118 -0
- package/dist/testing/inline-conformance.d.ts +50 -0
- package/dist/testing/inline-conformance.js +442 -0
- package/dist/testing/kind-conformance.d.ts +54 -0
- package/dist/testing/kind-conformance.js +325 -0
- package/dist/testing/mount-dom-stubs.d.ts +8 -0
- package/dist/testing/mount-dom-stubs.js +19 -0
- package/dist/testing/parse-convergence.d.ts +14 -0
- package/dist/testing/parse-convergence.js +81 -0
- package/dist/testing.d.ts +20 -0
- package/dist/testing.js +61 -0
- package/dist/tree-operations/blockquote.d.ts +18 -0
- package/dist/tree-operations/blockquote.js +59 -0
- package/dist/tree-operations/children.d.ts +17 -0
- package/dist/tree-operations/children.js +56 -0
- package/dist/tree-operations/cleanup.d.ts +10 -0
- package/dist/tree-operations/cleanup.js +25 -0
- package/dist/tree-operations/clone.d.ts +5 -0
- package/dist/tree-operations/clone.js +43 -0
- package/dist/tree-operations/container-lift.d.ts +9 -0
- package/dist/tree-operations/container-lift.js +29 -0
- package/dist/tree-operations/index.d.ts +16 -0
- package/dist/tree-operations/index.js +14 -0
- package/dist/tree-operations/list/empty-check.d.ts +7 -0
- package/dist/tree-operations/list/empty-check.js +19 -0
- package/dist/tree-operations/list/exit-replacement.d.ts +13 -0
- package/dist/tree-operations/list/exit-replacement.js +49 -0
- package/dist/tree-operations/list/item-partition.d.ts +13 -0
- package/dist/tree-operations/list/item-partition.js +33 -0
- package/dist/tree-operations/list/list-builders.d.ts +44 -0
- package/dist/tree-operations/list/list-builders.js +129 -0
- package/dist/tree-operations/list/ordered-markers.d.ts +36 -0
- package/dist/tree-operations/list/ordered-markers.js +114 -0
- package/dist/tree-operations/list/reconcile-task.d.ts +12 -0
- package/dist/tree-operations/list/reconcile-task.js +47 -0
- package/dist/tree-operations/list/sublist-separator.d.ts +13 -0
- package/dist/tree-operations/list/sublist-separator.js +34 -0
- package/dist/tree-operations/list/terminator.d.ts +17 -0
- package/dist/tree-operations/list/terminator.js +60 -0
- package/dist/tree-operations/list/unwrap-merge.d.ts +29 -0
- package/dist/tree-operations/list/unwrap-merge.js +202 -0
- package/dist/tree-operations/node-ops.d.ts +296 -0
- package/dist/tree-operations/node-ops.js +1428 -0
- package/dist/tree-operations/parse-block.d.ts +3 -0
- package/dist/tree-operations/parse-block.js +8 -0
- package/dist/tree-operations/paste/apply.d.ts +12 -0
- package/dist/tree-operations/paste/apply.js +75 -0
- package/dist/tree-operations/paste/body-write.d.ts +19 -0
- package/dist/tree-operations/paste/body-write.js +53 -0
- package/dist/tree-operations/paste/container-match.d.ts +32 -0
- package/dist/tree-operations/paste/container-match.js +238 -0
- package/dist/tree-operations/paste/container-paste.d.ts +10 -0
- package/dist/tree-operations/paste/container-paste.js +27 -0
- package/dist/tree-operations/paste/dispatch.d.ts +61 -0
- package/dist/tree-operations/paste/dispatch.js +138 -0
- package/dist/tree-operations/paste/find-enclosing-list.d.ts +8 -0
- package/dist/tree-operations/paste/find-enclosing-list.js +30 -0
- package/dist/tree-operations/paste/focus-target.d.ts +27 -0
- package/dist/tree-operations/paste/focus-target.js +40 -0
- package/dist/tree-operations/paste/hooks.d.ts +17 -0
- package/dist/tree-operations/paste/hooks.js +80 -0
- package/dist/tree-operations/paste/list-absorb.d.ts +29 -0
- package/dist/tree-operations/paste/list-absorb.js +106 -0
- package/dist/tree-operations/paste/list-break-out.d.ts +42 -0
- package/dist/tree-operations/paste/list-break-out.js +136 -0
- package/dist/tree-operations/paste/parent-scope.d.ts +17 -0
- package/dist/tree-operations/paste/parent-scope.js +35 -0
- package/dist/tree-operations/paste/paste-deps.d.ts +20 -0
- package/dist/tree-operations/paste/paste-deps.js +6 -0
- package/dist/tree-operations/paste/paste-replacement.d.ts +8 -0
- package/dist/tree-operations/paste/paste-replacement.js +60 -0
- package/dist/tree-operations/paste/paste-transforms.d.ts +25 -0
- package/dist/tree-operations/paste/paste-transforms.js +72 -0
- package/dist/tree-operations/paste/replace-block-at-parent.d.ts +29 -0
- package/dist/tree-operations/paste/replace-block-at-parent.js +75 -0
- package/dist/tree-operations/paste/strategy.d.ts +9 -0
- package/dist/tree-operations/paste/strategy.js +20 -0
- package/dist/tree-operations/paste/table-slice.d.ts +10 -0
- package/dist/tree-operations/paste/table-slice.js +39 -0
- package/dist/tree-operations/paste-surfaces.d.ts +61 -0
- package/dist/tree-operations/paste-surfaces.js +15 -0
- package/dist/tree-operations/path-mutate.d.ts +12 -0
- package/dist/tree-operations/path-mutate.js +20 -0
- package/dist/tree-operations/reorder-unit.d.ts +17 -0
- package/dist/tree-operations/reorder-unit.js +37 -0
- package/dist/tree-operations/reorder.d.ts +13 -0
- package/dist/tree-operations/reorder.js +57 -0
- package/dist/tree-operations/sharing.d.ts +18 -0
- package/dist/tree-operations/sharing.js +14 -0
- package/dist/tree-operations/splice-many.d.ts +9 -0
- package/dist/tree-operations/splice-many.js +22 -0
- package/dist/tree-operations/structural-change.d.ts +65 -0
- package/dist/tree-operations/structural-change.js +117 -0
- package/dist/tree-operations/sub-table-copy.d.ts +6 -0
- package/dist/tree-operations/sub-table-copy.js +43 -0
- package/dist/tree-operations/table-mutations.d.ts +17 -0
- package/dist/tree-operations/table-mutations.js +101 -0
- package/dist/tree-operations/unshare.d.ts +101 -0
- package/dist/tree-operations/unshare.js +248 -0
- package/dist/undo/manager.d.ts +2 -0
- package/dist/undo/manager.js +50 -0
- package/dist/undo/types.d.ts +44 -0
- package/dist/undo/types.js +7 -0
- package/docs/guide/consumer-guide.md +1098 -0
- package/docs/guide/directives.md +223 -0
- package/docs/guide/plugin-api.md +329 -0
- package/docs/guide/plugin-guide/conspiracy.gif +0 -0
- package/docs/guide/plugin-guide/parrot-frames.md +209 -0
- package/docs/guide/plugin-guide/parrot.gif +0 -0
- package/docs/guide/plugin-guide.md +1693 -0
- package/docs/guide/plugin-testing.md +463 -0
- package/package.json +238 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The walk behind every "widen the opener past its own body" rule: raise `minimum` one past
|
|
3
|
+
* each body line that would close the block at the width reached so far. A core leaf because
|
|
4
|
+
* the fence grammar and the directive grammar both need it, and neither should import the
|
|
5
|
+
* other's directory. Per-syntax knowledge stays in `closerRun`, which reports the closing
|
|
6
|
+
* line's run length or `null` for a line that does not close.
|
|
7
|
+
*/
|
|
8
|
+
export function escalateTerminatorRun(body, minimum, closerRun) {
|
|
9
|
+
let required = minimum;
|
|
10
|
+
for (const line of body.split('\n')) {
|
|
11
|
+
// Splitting on `\n` leaves a CRLF body's `\r` on the tail; a closer line's text excludes it.
|
|
12
|
+
const text = line.endsWith('\r') ? line.slice(0, -1) : line;
|
|
13
|
+
const run = closerRun(text, required);
|
|
14
|
+
if (run !== null)
|
|
15
|
+
required = run + 1;
|
|
16
|
+
}
|
|
17
|
+
return required;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL scheme allowlist for rendered href/src, enforced at the render sinks so author-controlled
|
|
3
|
+
* URLs cannot smuggle script execution into the DOM. `defaultLinkActivation` is the one DOM sink.
|
|
4
|
+
*/
|
|
5
|
+
/** A schemeless URL (relative, fragment, protocol-relative) is allowed. */
|
|
6
|
+
export declare function isAllowedHrefScheme(url: string): boolean;
|
|
7
|
+
/** Same rule as href over a different set: schemes that hand bytes to an `<img>`. */
|
|
8
|
+
export declare function isAllowedImageSrcScheme(url: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* The default when a consumer supplies no `onLinkActivate`, gated on the href allowlist. A block
|
|
11
|
+
* is a security-relevant signal a production host can act on, so it reports through `onBlocked`
|
|
12
|
+
* (the editor's `error` channel) rather than only reaching a dev console.
|
|
13
|
+
*/
|
|
14
|
+
export declare function defaultLinkActivation(url: string, _event: MouseEvent, onBlocked?: (url: string) => void): void;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL scheme allowlist for rendered href/src, enforced at the render sinks so author-controlled
|
|
3
|
+
* URLs cannot smuggle script execution into the DOM. `defaultLinkActivation` is the one DOM sink.
|
|
4
|
+
*/
|
|
5
|
+
import { devWarn } from '../dev-warn';
|
|
6
|
+
const ALLOWED_HREF_SCHEMES = new Set(['http', 'https', 'mailto', 'tel']);
|
|
7
|
+
// `asset:` is a desktop shell's local-file protocol off Windows, where the same URL arrives as
|
|
8
|
+
// `http://asset.localhost/...`, so omitting it blocks every image on macOS and Linux while
|
|
9
|
+
// passing on a Windows dev box. It carries no script capability: no browser resolves it.
|
|
10
|
+
const ALLOWED_IMG_SCHEMES = new Set(['http', 'https', 'data', 'asset']);
|
|
11
|
+
// Matches the WHATWG URL parser's pre-scheme normalization: it strips ASCII tab/newline anywhere
|
|
12
|
+
// and leading C0-control-or-space. `java\tscript:` runs in the browser, so normalizing the same
|
|
13
|
+
// way here is what stops a control byte from trivially bypassing the allowlist.
|
|
14
|
+
function schemeOf(url) {
|
|
15
|
+
const stripped = url.replace(/[\t\n\r]/g, '');
|
|
16
|
+
let i = 0;
|
|
17
|
+
while (i < stripped.length && stripped.charCodeAt(i) <= 0x20)
|
|
18
|
+
i++;
|
|
19
|
+
const match = /^([a-zA-Z][a-zA-Z0-9+.-]*):/.exec(stripped.slice(i));
|
|
20
|
+
return match ? match[1].toLowerCase() : null;
|
|
21
|
+
}
|
|
22
|
+
/** A schemeless URL (relative, fragment, protocol-relative) is allowed. */
|
|
23
|
+
export function isAllowedHrefScheme(url) {
|
|
24
|
+
const scheme = schemeOf(url);
|
|
25
|
+
return scheme === null || ALLOWED_HREF_SCHEMES.has(scheme);
|
|
26
|
+
}
|
|
27
|
+
/** Same rule as href over a different set: schemes that hand bytes to an `<img>`. */
|
|
28
|
+
export function isAllowedImageSrcScheme(url) {
|
|
29
|
+
const scheme = schemeOf(url);
|
|
30
|
+
return scheme === null || ALLOWED_IMG_SCHEMES.has(scheme);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The default when a consumer supplies no `onLinkActivate`, gated on the href allowlist. A block
|
|
34
|
+
* is a security-relevant signal a production host can act on, so it reports through `onBlocked`
|
|
35
|
+
* (the editor's `error` channel) rather than only reaching a dev console.
|
|
36
|
+
*/
|
|
37
|
+
export function defaultLinkActivation(url, _event, onBlocked) {
|
|
38
|
+
if (isAllowedHrefScheme(url)) {
|
|
39
|
+
window.open(url, '_blank', 'noopener,noreferrer');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
devWarn('url-policy', `blocked link with disallowed scheme: ${url}`);
|
|
43
|
+
onBlocked?.(url);
|
|
44
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor / range / selection helpers for contenteditable text surfaces. Offsets count DOM
|
|
3
|
+
* text characters ambient-inclusively (`Range.toString()` does not skip
|
|
4
|
+
* contenteditable=false islands), so they are `DomTextOffset`. An offset inside a span the
|
|
5
|
+
* cursor may not enter — an atomic inline widget, or marker text the mode hides — snaps to
|
|
6
|
+
* that span's leading or trailing edge.
|
|
7
|
+
*/
|
|
8
|
+
import { type DomTextOffset } from './coordinate-spaces';
|
|
9
|
+
export declare function createRangeFromOffsets(container: HTMLElement, start: DomTextOffset, end: DomTextOffset): Range | null;
|
|
10
|
+
export declare function setCursorOffset(container: HTMLElement, offset: DomTextOffset): void;
|
|
11
|
+
/** The range START (anchor for forward selections); the moving endpoint during Shift+Arrow
|
|
12
|
+
* extension is `getSelectionFocusOffset`. */
|
|
13
|
+
export declare function getCursorOffset(container: HTMLElement): DomTextOffset | null;
|
|
14
|
+
/** The moving endpoint of the selection, distinct from the anchor once extended. */
|
|
15
|
+
export declare function getSelectionFocusOffset(container: HTMLElement): DomTextOffset | null;
|
|
16
|
+
export declare function getSelectionOffsets(container: HTMLElement): {
|
|
17
|
+
start: DomTextOffset;
|
|
18
|
+
end: DomTextOffset;
|
|
19
|
+
} | null;
|
|
20
|
+
/**
|
|
21
|
+
* Offsets for an arbitrary range inside `container` — an InputEvent's `getTargetRanges()`
|
|
22
|
+
* pending-edit range is not the live selection (a word delete at a collapsed caret reports
|
|
23
|
+
* the whole word). Null when either endpoint sits outside the container.
|
|
24
|
+
*/
|
|
25
|
+
export declare function getRangeOffsets(container: HTMLElement, range: AbstractRange): {
|
|
26
|
+
start: DomTextOffset;
|
|
27
|
+
end: DomTextOffset;
|
|
28
|
+
} | null;
|
|
29
|
+
export declare function hasSelection(): boolean;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cursor / range / selection helpers for contenteditable text surfaces. Offsets count DOM
|
|
3
|
+
* text characters ambient-inclusively (`Range.toString()` does not skip
|
|
4
|
+
* contenteditable=false islands), so they are `DomTextOffset`. An offset inside a span the
|
|
5
|
+
* cursor may not enter — an atomic inline widget, or marker text the mode hides — snaps to
|
|
6
|
+
* that span's leading or trailing edge.
|
|
7
|
+
*/
|
|
8
|
+
import { asDomTextOffset } from './coordinate-spaces';
|
|
9
|
+
import { domDescendants } from './dom-walk';
|
|
10
|
+
import { isAtomicInlineWidget, isHiddenMarkerRoot } from './widget-offset';
|
|
11
|
+
/**
|
|
12
|
+
* Length of a span the cursor may not enter, or null when it is transparent. Atomic widgets
|
|
13
|
+
* and marker text the mode paints nothing for are both opaque: an offset inside either has
|
|
14
|
+
* no position to seat, and hiding is classified at its one home, never re-derived here.
|
|
15
|
+
*/
|
|
16
|
+
function opaqueSpanLength(node, container) {
|
|
17
|
+
if (node.nodeType !== Node.ELEMENT_NODE)
|
|
18
|
+
return null;
|
|
19
|
+
const el = node;
|
|
20
|
+
if (!isAtomicInlineWidget(el) && !isHiddenMarkerRoot(el, container))
|
|
21
|
+
return null;
|
|
22
|
+
return el.textContent?.length ?? 0;
|
|
23
|
+
}
|
|
24
|
+
export function createRangeFromOffsets(container, start, end) {
|
|
25
|
+
const range = document.createRange();
|
|
26
|
+
let charCount = 0;
|
|
27
|
+
let startSet = false;
|
|
28
|
+
let endFound = false;
|
|
29
|
+
// One classification per node, though the walk and the body below both ask: the read is a
|
|
30
|
+
// `contains` plus a `closest` per element, and a caret seat spends this walk on every step.
|
|
31
|
+
const opaque = new Map();
|
|
32
|
+
const opaqueLengthOf = (node) => {
|
|
33
|
+
if (!opaque.has(node))
|
|
34
|
+
opaque.set(node, opaqueSpanLength(node, container));
|
|
35
|
+
return opaque.get(node) ?? null;
|
|
36
|
+
};
|
|
37
|
+
for (const node of domDescendants(container, (node) => opaqueLengthOf(node) === null)) {
|
|
38
|
+
// The cursor never lands inside an opaque span: snap to the nearer edge.
|
|
39
|
+
const opaqueLen = opaqueLengthOf(node);
|
|
40
|
+
if (opaqueLen !== null) {
|
|
41
|
+
if (!startSet && start <= charCount + opaqueLen) {
|
|
42
|
+
if (start <= charCount)
|
|
43
|
+
range.setStartBefore(node);
|
|
44
|
+
else
|
|
45
|
+
range.setStartAfter(node);
|
|
46
|
+
startSet = true;
|
|
47
|
+
}
|
|
48
|
+
if (startSet && end <= charCount + opaqueLen) {
|
|
49
|
+
if (end <= charCount)
|
|
50
|
+
range.setEndBefore(node);
|
|
51
|
+
else
|
|
52
|
+
range.setEndAfter(node);
|
|
53
|
+
endFound = true;
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
charCount += opaqueLen;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
60
|
+
const len = node.textContent?.length ?? 0;
|
|
61
|
+
if (!startSet && charCount + len >= start) {
|
|
62
|
+
range.setStart(node, start - charCount);
|
|
63
|
+
startSet = true;
|
|
64
|
+
}
|
|
65
|
+
if (startSet && charCount + len >= end) {
|
|
66
|
+
range.setEnd(node, end - charCount);
|
|
67
|
+
endFound = true;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
charCount += len;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
if (!startSet) {
|
|
74
|
+
range.selectNodeContents(container);
|
|
75
|
+
range.collapse(false);
|
|
76
|
+
}
|
|
77
|
+
else if (!endFound) {
|
|
78
|
+
range.setEndAfter(container);
|
|
79
|
+
}
|
|
80
|
+
return range;
|
|
81
|
+
}
|
|
82
|
+
export function setCursorOffset(container, offset) {
|
|
83
|
+
const range = createRangeFromOffsets(container, offset, offset);
|
|
84
|
+
if (!range)
|
|
85
|
+
return;
|
|
86
|
+
const sel = window.getSelection();
|
|
87
|
+
sel?.removeAllRanges();
|
|
88
|
+
sel?.addRange(range);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The one "DOM (node, offset) → content-offset" read here. `Selection.toString()` skips
|
|
92
|
+
* text inside contenteditable=false islands and is unreliable across them; `Range.toString()`
|
|
93
|
+
* on a prefix range does not skip, so all readers funnel through this.
|
|
94
|
+
*/
|
|
95
|
+
function nodeOffsetToContent(container, node, offset) {
|
|
96
|
+
const preRange = document.createRange();
|
|
97
|
+
preRange.selectNodeContents(container);
|
|
98
|
+
try {
|
|
99
|
+
preRange.setEnd(node, offset);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
return asDomTextOffset(0);
|
|
103
|
+
}
|
|
104
|
+
return asDomTextOffset(preRange.toString().length);
|
|
105
|
+
}
|
|
106
|
+
/** The range START (anchor for forward selections); the moving endpoint during Shift+Arrow
|
|
107
|
+
* extension is `getSelectionFocusOffset`. */
|
|
108
|
+
export function getCursorOffset(container) {
|
|
109
|
+
if (document.activeElement !== container)
|
|
110
|
+
return null;
|
|
111
|
+
const sel = window.getSelection();
|
|
112
|
+
if (!sel || sel.rangeCount === 0)
|
|
113
|
+
return null;
|
|
114
|
+
const range = sel.getRangeAt(0);
|
|
115
|
+
return nodeOffsetToContent(container, range.startContainer, range.startOffset);
|
|
116
|
+
}
|
|
117
|
+
/** The moving endpoint of the selection, distinct from the anchor once extended. */
|
|
118
|
+
export function getSelectionFocusOffset(container) {
|
|
119
|
+
if (document.activeElement !== container)
|
|
120
|
+
return null;
|
|
121
|
+
const sel = window.getSelection();
|
|
122
|
+
if (!sel || sel.focusNode === null)
|
|
123
|
+
return null;
|
|
124
|
+
if (!container.contains(sel.focusNode))
|
|
125
|
+
return null;
|
|
126
|
+
return nodeOffsetToContent(container, sel.focusNode, sel.focusOffset);
|
|
127
|
+
}
|
|
128
|
+
export function getSelectionOffsets(container) {
|
|
129
|
+
const sel = window.getSelection();
|
|
130
|
+
if (!sel || sel.isCollapsed)
|
|
131
|
+
return null;
|
|
132
|
+
return getRangeOffsets(container, sel.getRangeAt(0));
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Offsets for an arbitrary range inside `container` — an InputEvent's `getTargetRanges()`
|
|
136
|
+
* pending-edit range is not the live selection (a word delete at a collapsed caret reports
|
|
137
|
+
* the whole word). Null when either endpoint sits outside the container.
|
|
138
|
+
*/
|
|
139
|
+
export function getRangeOffsets(container, range) {
|
|
140
|
+
if (!container.contains(range.startContainer) || !container.contains(range.endContainer)) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
return {
|
|
144
|
+
start: nodeOffsetToContent(container, range.startContainer, range.startOffset),
|
|
145
|
+
end: nodeOffsetToContent(container, range.endContainer, range.endOffset)
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
export function hasSelection() {
|
|
149
|
+
const sel = window.getSelection();
|
|
150
|
+
return Boolean(sel && !sel.isCollapsed);
|
|
151
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor's coordinate spaces as branded numbers (G3.7), so mixing them is a type error
|
|
3
|
+
* at the seam instead of a caret bug later. A brand is produced only by its space's home
|
|
4
|
+
* module or an `as*` boundary mint at a declared public door — the coordinate-brand-mints
|
|
5
|
+
* lint holds that list closed — and moves between spaces only through the named
|
|
6
|
+
* conversions below, one home per direction. Public API doors keep `number` and mint once.
|
|
7
|
+
*/
|
|
8
|
+
import type { DocPath } from '../selection/path-math';
|
|
9
|
+
declare const rawOffsetBrand: unique symbol;
|
|
10
|
+
/** Byte offset into a block node's raw content (CST-facing; ambient marker excluded). */
|
|
11
|
+
export type RawOffset = number & {
|
|
12
|
+
readonly [rawOffsetBrand]: true;
|
|
13
|
+
};
|
|
14
|
+
declare const domTextOffsetBrand: unique symbol;
|
|
15
|
+
/**
|
|
16
|
+
* Offset in the widget-offset walk space: raw offset plus the leading ambient marker's
|
|
17
|
+
* text length. Home: `cursor/widget-offset.ts`, with `cursor/content-offsets.ts` as the
|
|
18
|
+
* widget-free equivalent.
|
|
19
|
+
*/
|
|
20
|
+
export type DomTextOffset = number & {
|
|
21
|
+
readonly [domTextOffsetBrand]: true;
|
|
22
|
+
};
|
|
23
|
+
declare const editorXBrand: unique symbol;
|
|
24
|
+
/** Editor-relative pixel X (viewport X minus the editor container's left) — scroll-invariant. */
|
|
25
|
+
export type EditorX = number & {
|
|
26
|
+
readonly [editorXBrand]: true;
|
|
27
|
+
};
|
|
28
|
+
declare const viewportXBrand: unique symbol;
|
|
29
|
+
/** Raw client-rect pixel X. */
|
|
30
|
+
export type ViewportX = number & {
|
|
31
|
+
readonly [viewportXBrand]: true;
|
|
32
|
+
};
|
|
33
|
+
declare const cellIndexBrand: unique symbol;
|
|
34
|
+
/** Row-major table cell index. Declared ahead of its home's conversion so the
|
|
35
|
+
* `as CellIndex` lint rule exists before the first cast does. */
|
|
36
|
+
export type CellIndex = number & {
|
|
37
|
+
readonly [cellIndexBrand]: true;
|
|
38
|
+
};
|
|
39
|
+
export declare function toDomTextOffset(raw: RawOffset, ambientLength: number): DomTextOffset;
|
|
40
|
+
export declare function toRawOffset(domText: DomTextOffset, ambientLength: number): RawOffset;
|
|
41
|
+
/** `toRawOffset` clamped to raw 0, for DOM reads that may land inside the leading ambient
|
|
42
|
+
* marker, where the unclamped result goes negative. */
|
|
43
|
+
export declare function toClampedRawOffset(domText: DomTextOffset, ambientLength: number): RawOffset;
|
|
44
|
+
export declare function toEditorX(viewport: ViewportX, editorLeft: number): EditorX;
|
|
45
|
+
export declare function toViewportX(editor: EditorX, editorLeft: number): ViewportX;
|
|
46
|
+
export declare function asRawOffset(n: number): RawOffset;
|
|
47
|
+
export declare function asDomTextOffset(n: number): DomTextOffset;
|
|
48
|
+
export declare function asEditorX(n: number): EditorX;
|
|
49
|
+
export declare function asViewportX(n: number): ViewportX;
|
|
50
|
+
export declare function asCellIndex(n: number): CellIndex;
|
|
51
|
+
/**
|
|
52
|
+
* Row-major cell index → `{ row, col }` for a table of `colCount` columns — the one home
|
|
53
|
+
* for the divmod the selection and table-overlay paths otherwise hand-roll. Takes a plain
|
|
54
|
+
* number so a `CellIndex` holder and a bare loop counter both reach it without a cast.
|
|
55
|
+
*/
|
|
56
|
+
export declare function cellRowCol(cellIdx: number, colCount: number): {
|
|
57
|
+
row: number;
|
|
58
|
+
col: number;
|
|
59
|
+
};
|
|
60
|
+
/** Append a child index to a parent path, yielding a doc-absolute path. */
|
|
61
|
+
export declare function extendDocPath(parent: readonly number[], index: number): DocPath;
|
|
62
|
+
/** Brand a complete doc-absolute path (copied) for composers that already hold one;
|
|
63
|
+
* `extendDocPath` covers the parent-plus-index case, this covers the rest. */
|
|
64
|
+
export declare function docPathFrom(indices: readonly number[]): DocPath;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The editor's coordinate spaces as branded numbers (G3.7), so mixing them is a type error
|
|
3
|
+
* at the seam instead of a caret bug later. A brand is produced only by its space's home
|
|
4
|
+
* module or an `as*` boundary mint at a declared public door — the coordinate-brand-mints
|
|
5
|
+
* lint holds that list closed — and moves between spaces only through the named
|
|
6
|
+
* conversions below, one home per direction. Public API doors keep `number` and mint once.
|
|
7
|
+
*/
|
|
8
|
+
// ── Conversions (the inter-space arithmetic — one home per direction) ────────
|
|
9
|
+
export function toDomTextOffset(raw, ambientLength) {
|
|
10
|
+
return (raw + ambientLength);
|
|
11
|
+
}
|
|
12
|
+
export function toRawOffset(domText, ambientLength) {
|
|
13
|
+
return (domText - ambientLength);
|
|
14
|
+
}
|
|
15
|
+
/** `toRawOffset` clamped to raw 0, for DOM reads that may land inside the leading ambient
|
|
16
|
+
* marker, where the unclamped result goes negative. */
|
|
17
|
+
export function toClampedRawOffset(domText, ambientLength) {
|
|
18
|
+
return Math.max(0, toRawOffset(domText, ambientLength));
|
|
19
|
+
}
|
|
20
|
+
export function toEditorX(viewport, editorLeft) {
|
|
21
|
+
return (viewport - editorLeft);
|
|
22
|
+
}
|
|
23
|
+
export function toViewportX(editor, editorLeft) {
|
|
24
|
+
return (editor + editorLeft);
|
|
25
|
+
}
|
|
26
|
+
// ── Boundary mints (space homes and declared doors only — see the lint) ──────
|
|
27
|
+
export function asRawOffset(n) {
|
|
28
|
+
return n;
|
|
29
|
+
}
|
|
30
|
+
export function asDomTextOffset(n) {
|
|
31
|
+
return n;
|
|
32
|
+
}
|
|
33
|
+
export function asEditorX(n) {
|
|
34
|
+
return n;
|
|
35
|
+
}
|
|
36
|
+
export function asViewportX(n) {
|
|
37
|
+
return n;
|
|
38
|
+
}
|
|
39
|
+
export function asCellIndex(n) {
|
|
40
|
+
return n;
|
|
41
|
+
}
|
|
42
|
+
// ── Cell grid decode ─────────────────────────────────────────────────────────
|
|
43
|
+
/**
|
|
44
|
+
* Row-major cell index → `{ row, col }` for a table of `colCount` columns — the one home
|
|
45
|
+
* for the divmod the selection and table-overlay paths otherwise hand-roll. Takes a plain
|
|
46
|
+
* number so a `CellIndex` holder and a bare loop counter both reach it without a cast.
|
|
47
|
+
*/
|
|
48
|
+
export function cellRowCol(cellIdx, colCount) {
|
|
49
|
+
const row = Math.floor(cellIdx / colCount);
|
|
50
|
+
return { row, col: cellIdx - row * colCount };
|
|
51
|
+
}
|
|
52
|
+
// ── DocPath composition (the doc-absolute path helpers, at the neutral leaf) ──
|
|
53
|
+
//
|
|
54
|
+
// `DocPath`'s type and base mint live in `selection/path-math.ts`; its composers live here
|
|
55
|
+
// because `tree-operations/` must reach them without depending on `selection/`. Bare
|
|
56
|
+
// `as DocPath` casts for the same reason — importing the runtime mint would reopen the
|
|
57
|
+
// cursor↔selection cycle, while the type-only `DocPath` edge is erased.
|
|
58
|
+
/** Append a child index to a parent path, yielding a doc-absolute path. */
|
|
59
|
+
export function extendDocPath(parent, index) {
|
|
60
|
+
return [...parent, index];
|
|
61
|
+
}
|
|
62
|
+
/** Brand a complete doc-absolute path (copied) for composers that already hold one;
|
|
63
|
+
* `extendDocPath` covers the parent-plus-index case, this covers the rest. */
|
|
64
|
+
export function docPathFrom(indices) {
|
|
65
|
+
return [...indices];
|
|
66
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one iterative pre-order over rendered inline DOM — the caret-space twin of
|
|
3
|
+
* `core/inline/walk.ts`, and here rather than beside it because `cursor/` is what a DOM walk may
|
|
4
|
+
* import from (`ambient/` reads this direction too, `core/` never does). Nesting depth is
|
|
5
|
+
* input-controlled, so a per-level call frame overflows the stack and strands the block in the
|
|
6
|
+
* unhealable failed-block fallback.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* `root`, then its descendants, in document order. `fromEnd` MIRRORS that walk rather than
|
|
10
|
+
* reversing it — each level's children come last-first, a parent still ahead of them — so the
|
|
11
|
+
* leaves arrive reversed and a search for the last matching one reads them in the order it wants.
|
|
12
|
+
* `descend` declines a node's children: the node itself is still yielded, and is asked only when
|
|
13
|
+
* it has any. Each child list is read when its parent pops, so a consumer that rewrites the tree
|
|
14
|
+
* must finish the walk first.
|
|
15
|
+
*/
|
|
16
|
+
export declare function domDescendants(root: Node, descend?: (node: Node) => boolean, options?: {
|
|
17
|
+
fromEnd?: boolean;
|
|
18
|
+
}): Generator<Node>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The one iterative pre-order over rendered inline DOM — the caret-space twin of
|
|
3
|
+
* `core/inline/walk.ts`, and here rather than beside it because `cursor/` is what a DOM walk may
|
|
4
|
+
* import from (`ambient/` reads this direction too, `core/` never does). Nesting depth is
|
|
5
|
+
* input-controlled, so a per-level call frame overflows the stack and strands the block in the
|
|
6
|
+
* unhealable failed-block fallback.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* `root`, then its descendants, in document order. `fromEnd` MIRRORS that walk rather than
|
|
10
|
+
* reversing it — each level's children come last-first, a parent still ahead of them — so the
|
|
11
|
+
* leaves arrive reversed and a search for the last matching one reads them in the order it wants.
|
|
12
|
+
* `descend` declines a node's children: the node itself is still yielded, and is asked only when
|
|
13
|
+
* it has any. Each child list is read when its parent pops, so a consumer that rewrites the tree
|
|
14
|
+
* must finish the walk first.
|
|
15
|
+
*/
|
|
16
|
+
export function* domDescendants(root, descend, options = {}) {
|
|
17
|
+
const stack = [root];
|
|
18
|
+
while (stack.length > 0) {
|
|
19
|
+
const node = stack.pop();
|
|
20
|
+
yield node;
|
|
21
|
+
const children = node.childNodes;
|
|
22
|
+
if (children.length === 0)
|
|
23
|
+
continue;
|
|
24
|
+
if (descend && !descend(node))
|
|
25
|
+
continue;
|
|
26
|
+
// Reversed push, so pop order is the walk's order: document order, or its reverse.
|
|
27
|
+
for (let i = 0; i < children.length; i++) {
|
|
28
|
+
stack.push(children[options.fromEnd ? i : children.length - 1 - i]);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge affinity: which of the two raw offsets a caret means when it sits beside a hidden
|
|
3
|
+
* marker run, whose interior paints nothing so both offsets land on one pixel. CAPTURE: the
|
|
4
|
+
* arrival that put the caret there, via `note` on the shared keydown door. CONSUME: the
|
|
5
|
+
* typing seat, which reads `get()` and keeps its own default when it answers null.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Which raw offset a hidden run's one pixel names. Two answers are positional — the run's
|
|
9
|
+
* `near` (earlier) or `far` (later) walk-order side — and one is construct-relative:
|
|
10
|
+
* `outside` means past the construct's delimiters whichever side that lands on, so it reads
|
|
11
|
+
* as the run's start at an opener and its end at a closer.
|
|
12
|
+
*/
|
|
13
|
+
export type EdgeAffinity = 'near' | 'far' | 'outside';
|
|
14
|
+
export interface EdgeAffinityState {
|
|
15
|
+
get(): EdgeAffinity | null;
|
|
16
|
+
/**
|
|
17
|
+
* The only door a keydown handler may use; `reset()` stays public for the lifecycle,
|
|
18
|
+
* commit, undo and pointer callers, whose unconditional clear has no key to classify.
|
|
19
|
+
*/
|
|
20
|
+
note(e: Pick<KeyboardEvent, 'key' | 'altKey'> & Partial<Pick<KeyboardEvent, 'metaKey'>>): void;
|
|
21
|
+
/** A committed keystroke belongs to the content whatever arrival preceded it. */
|
|
22
|
+
noteTyping(): void;
|
|
23
|
+
/**
|
|
24
|
+
* A caret seated at an EXTREME rather than stepped there — a range collapsing onto its own
|
|
25
|
+
* edge. The key that triggered it is directional, but the caret took no step, so the side it
|
|
26
|
+
* means is construct-relative, the same answer a line extreme gives.
|
|
27
|
+
*/
|
|
28
|
+
noteExtreme(): void;
|
|
29
|
+
reset(): void;
|
|
30
|
+
}
|
|
31
|
+
export interface EdgeAffinityDeps {
|
|
32
|
+
/**
|
|
33
|
+
* Ephemeral caret state with this same lifetime rides the invalidation (pending marks,
|
|
34
|
+
* `cursor/pending-marks.ts`). Composed rather than copied at each seam: every seat below
|
|
35
|
+
* already reaches exactly one of these three doors.
|
|
36
|
+
*/
|
|
37
|
+
onInvalidate?: () => void;
|
|
38
|
+
}
|
|
39
|
+
export declare function createEdgeAffinityState(deps?: EdgeAffinityDeps): EdgeAffinityState;
|
|
40
|
+
/** What a keydown does to the affinity. */
|
|
41
|
+
export type EdgeAffinityAction = EdgeAffinity | 'preserve' | 'reset';
|
|
42
|
+
/** The decision {@link EdgeAffinityState.note} enacts. Pure on the key, so the matrix is
|
|
43
|
+
* testable without a DOM or a state instance. */
|
|
44
|
+
export declare function classifyArrivalKey(key: string, metaKey?: boolean): EdgeAffinityAction;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Edge affinity: which of the two raw offsets a caret means when it sits beside a hidden
|
|
3
|
+
* marker run, whose interior paints nothing so both offsets land on one pixel. CAPTURE: the
|
|
4
|
+
* arrival that put the caret there, via `note` on the shared keydown door. CONSUME: the
|
|
5
|
+
* typing seat, which reads `get()` and keeps its own default when it answers null.
|
|
6
|
+
*/
|
|
7
|
+
import { BARE_MODIFIER_KEYS, isCharacterKey } from '../schema/keybindings';
|
|
8
|
+
export function createEdgeAffinityState(deps = {}) {
|
|
9
|
+
let affinity = null;
|
|
10
|
+
/** Sets the side AND settles everything riding on it — the two are one act, so no caller
|
|
11
|
+
* can do the first without the second. */
|
|
12
|
+
function settle(next) {
|
|
13
|
+
affinity = next;
|
|
14
|
+
deps.onInvalidate?.();
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
get: () => affinity,
|
|
18
|
+
noteTyping: () => settle('near'),
|
|
19
|
+
noteExtreme: () => settle('outside'),
|
|
20
|
+
reset: () => settle(null),
|
|
21
|
+
note: (e) => {
|
|
22
|
+
// Alt+Arrow is the block-reorder chord, not caret nav.
|
|
23
|
+
if (e.altKey && (e.key === 'ArrowUp' || e.key === 'ArrowDown'))
|
|
24
|
+
return;
|
|
25
|
+
const action = classifyArrivalKey(e.key, e.metaKey);
|
|
26
|
+
// A preserved key left the caret where it was — the chord that pends a mark and the
|
|
27
|
+
// byte that spends it are both preserved, so neither may invalidate.
|
|
28
|
+
if (action === 'preserve')
|
|
29
|
+
return;
|
|
30
|
+
settle(action === 'reset' ? null : action);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
/** The decision {@link EdgeAffinityState.note} enacts. Pure on the key, so the matrix is
|
|
35
|
+
* testable without a DOM or a state instance. */
|
|
36
|
+
export function classifyArrivalKey(key, metaKey = false) {
|
|
37
|
+
// macOS Cmd+Arrow is the line extreme — a seat, not a step, so it takes Home/End's
|
|
38
|
+
// construct-relative answer. Windows/Linux never deliver meta+arrow to the page.
|
|
39
|
+
if (metaKey && (key === 'ArrowLeft' || key === 'ArrowRight'))
|
|
40
|
+
return 'outside';
|
|
41
|
+
// A step stops on the side of the run it approached from, so one press never changes which
|
|
42
|
+
// construct the caret is in: forward keys reach the near side, backward keys the far one.
|
|
43
|
+
if (key === 'ArrowRight' || key === 'ArrowDown' || key === 'PageDown')
|
|
44
|
+
return 'near';
|
|
45
|
+
if (key === 'ArrowLeft' || key === 'ArrowUp' || key === 'PageUp')
|
|
46
|
+
return 'far';
|
|
47
|
+
// A line extreme is construct-relative, not directional: `Home` before a line-leading
|
|
48
|
+
// construct means before its opener, which is the run's EARLIER side — the opposite
|
|
49
|
+
// walk-order answer from `End` after a line-trailing one.
|
|
50
|
+
if (key === 'Home' || key === 'End')
|
|
51
|
+
return 'outside';
|
|
52
|
+
// Bare modifiers are read from the chord parser rather than re-listed — a local copy
|
|
53
|
+
// missing AltGraph is how a modifier tap mid-arrow-run drops the side. A printable key
|
|
54
|
+
// preserves because its write seat reads the side later in this same keydown.
|
|
55
|
+
if (BARE_MODIFIER_KEYS.includes(key) || isCharacterKey(key))
|
|
56
|
+
return 'preserve';
|
|
57
|
+
// Anything left lands by a mutation or a command, not by an arrival; the commit seams
|
|
58
|
+
// re-arm through `noteTyping`.
|
|
59
|
+
return 'reset';
|
|
60
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carry a focused caret across an imperative DOM rebuild. A decoration-driven rebuild
|
|
3
|
+
* mints fresh spans with no edit-path pending offset, so the render path captures the
|
|
4
|
+
* caret in walk space before the rebuild and restores it after — through the single-home
|
|
5
|
+
* offset walk (`widget-offset.ts`), shared by the prose and table-cell render paths.
|
|
6
|
+
*/
|
|
7
|
+
import type { DomTextOffset } from './coordinate-spaces';
|
|
8
|
+
/** The live caret as a walk-space offset, or null when `el` does not own focus. */
|
|
9
|
+
export declare function captureFocusedCaretWalkOffset(el: HTMLElement): DomTextOffset | null;
|
|
10
|
+
export declare function restoreCaretAtWalkOffset(el: HTMLElement, walkOffset: DomTextOffset): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Carry a focused caret across an imperative DOM rebuild. A decoration-driven rebuild
|
|
3
|
+
* mints fresh spans with no edit-path pending offset, so the render path captures the
|
|
4
|
+
* caret in walk space before the rebuild and restores it after — through the single-home
|
|
5
|
+
* offset walk (`widget-offset.ts`), shared by the prose and table-cell render paths.
|
|
6
|
+
*/
|
|
7
|
+
import { createRangeAtDomTextOffsets, domTextOffsetAtNode } from './widget-offset';
|
|
8
|
+
/** The live caret as a walk-space offset, or null when `el` does not own focus. */
|
|
9
|
+
export function captureFocusedCaretWalkOffset(el) {
|
|
10
|
+
if (!document.activeElement || !el.contains(document.activeElement))
|
|
11
|
+
return null;
|
|
12
|
+
const sel = window.getSelection();
|
|
13
|
+
if (!sel?.focusNode || !el.contains(sel.focusNode))
|
|
14
|
+
return null;
|
|
15
|
+
return domTextOffsetAtNode(el, sel.focusNode, sel.focusOffset);
|
|
16
|
+
}
|
|
17
|
+
export function restoreCaretAtWalkOffset(el, walkOffset) {
|
|
18
|
+
const range = createRangeAtDomTextOffsets(el, walkOffset, walkOffset);
|
|
19
|
+
if (!range)
|
|
20
|
+
return;
|
|
21
|
+
const sel = window.getSelection();
|
|
22
|
+
sel?.removeAllRanges();
|
|
23
|
+
sel?.addRange(range);
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cumulative block-height model for one BlockList: a Fenwick tree giving O(log n)
|
|
3
|
+
* prefix-sum, offset→index lookup, and per-index update. Virtual rendering maps scrollTop
|
|
4
|
+
* to a window range through it without laying off-screen blocks out.
|
|
5
|
+
*/
|
|
6
|
+
export declare class HeightModel {
|
|
7
|
+
private tree;
|
|
8
|
+
private heights;
|
|
9
|
+
private count;
|
|
10
|
+
constructor(initialHeights: number[]);
|
|
11
|
+
get size(): number;
|
|
12
|
+
/** Total pixel height of all entries. */
|
|
13
|
+
total(): number;
|
|
14
|
+
/** Pixel offset of the top of index `i` (sum of heights[0..i)); `offsetOf(count)` == total. */
|
|
15
|
+
offsetOf(i: number): number;
|
|
16
|
+
/** Current height stored for index `i`. */
|
|
17
|
+
heightOf(i: number): number;
|
|
18
|
+
/** Set index `i` to `height` in O(log n). No-op when unchanged or out of range. */
|
|
19
|
+
setHeight(i: number, height: number): void;
|
|
20
|
+
/** Largest index whose top offset is <= `y` (the block visible at scroll y), clamped to [0, count-1]. */
|
|
21
|
+
indexAtOffset(y: number): number;
|
|
22
|
+
private bump;
|
|
23
|
+
private prefix;
|
|
24
|
+
}
|