@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,91 @@
|
|
|
1
|
+
/** Line splitting preserving endings and offsets, plus the trailing-line-ending helpers. */
|
|
2
|
+
/** Length of `raw` excluding any trailing line ending (LF or CRLF). */
|
|
3
|
+
export function displayLength(raw) {
|
|
4
|
+
if (raw.endsWith('\r\n'))
|
|
5
|
+
return raw.length - 2;
|
|
6
|
+
if (raw.endsWith('\n'))
|
|
7
|
+
return raw.length - 1;
|
|
8
|
+
return raw.length;
|
|
9
|
+
}
|
|
10
|
+
export function trimTrailingLineEnding(raw) {
|
|
11
|
+
return raw.slice(0, displayLength(raw));
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The ending `raw` actually carries — {@link trimTrailingLineEnding}'s complement, the two
|
|
15
|
+
* partitioning `raw`. What {@link trailingLineEnding} answers instead is which ending the
|
|
16
|
+
* DOCUMENT uses, so a site reattaching a block's own bytes reads this one (G4.20).
|
|
17
|
+
*/
|
|
18
|
+
export function ownTrailingLineEnding(raw) {
|
|
19
|
+
return raw.slice(displayLength(raw));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* `offset` moved off the interior of a surrogate pair, back to the pair's own start. Caret
|
|
23
|
+
* offsets are UTF-16 code units, so a cut at one can halve an astral scalar and leave a lone
|
|
24
|
+
* surrogate — bytes no UTF-8 encoder round-trips (`TextEncoder` yields U+FFFD) and no inverse
|
|
25
|
+
* gesture restores. Scalars only: a grapheme cluster is a rendering question, and answering it
|
|
26
|
+
* here would move a caret the author placed between two legitimately separate scalars.
|
|
27
|
+
*/
|
|
28
|
+
export function snapToScalarBoundary(raw, offset) {
|
|
29
|
+
if (offset <= 0 || offset >= raw.length)
|
|
30
|
+
return offset;
|
|
31
|
+
const splitsPair = (raw.charCodeAt(offset - 1) & 0xfc00) === 0xd800 &&
|
|
32
|
+
(raw.charCodeAt(offset) & 0xfc00) === 0xdc00;
|
|
33
|
+
return splitsPair ? offset - 1 : offset;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* The block's authored trailing line ending. Every site that reattaches or mints one reads it
|
|
37
|
+
* here (G4.20), so a CRLF-authored block keeps its ending and an unterminated one gets `\n`.
|
|
38
|
+
*/
|
|
39
|
+
export function trailingLineEnding(raw) {
|
|
40
|
+
return raw.endsWith('\r\n') ? '\r\n' : '\n';
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Keep a truncated slice line-terminated, borrowing `sourceRaw`'s own ending (G4.20). A slice
|
|
44
|
+
* whose last line stays open swallows whatever follows it once the bytes stand alone.
|
|
45
|
+
*/
|
|
46
|
+
export function terminateLine(text, sourceRaw) {
|
|
47
|
+
return text.endsWith('\n') ? text : text + trailingLineEnding(sourceRaw);
|
|
48
|
+
}
|
|
49
|
+
/** Paste entry points funnel through here so Windows CRLF does not leak into a note. */
|
|
50
|
+
export function normalizeLineEndings(text) {
|
|
51
|
+
return text.replace(/\r\n/g, '\n');
|
|
52
|
+
}
|
|
53
|
+
export function splitLines(source) {
|
|
54
|
+
const lines = [];
|
|
55
|
+
let start = 0;
|
|
56
|
+
for (let i = 0; i < source.length; i++) {
|
|
57
|
+
if (source[i] === '\n') {
|
|
58
|
+
const raw = source.slice(start, i + 1);
|
|
59
|
+
const lineEnding = source[i - 1] === '\r' ? '\r\n' : '\n';
|
|
60
|
+
const text = raw.slice(0, raw.length - lineEnding.length);
|
|
61
|
+
lines.push({ raw, text, lineEnding, start, end: i + 1 });
|
|
62
|
+
start = i + 1;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (start < source.length) {
|
|
66
|
+
const raw = source.slice(start);
|
|
67
|
+
lines.push({ raw, text: raw, lineEnding: '', start, end: source.length });
|
|
68
|
+
}
|
|
69
|
+
return lines;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Re-mint a `ParsedLine[]` after a per-line strip, as the container parsers do when they reparse
|
|
73
|
+
* a prefix-stripped body. Recompute, not spread: reusing an input line's offsets after shortening
|
|
74
|
+
* its text desyncs the offsets from the bytes.
|
|
75
|
+
*/
|
|
76
|
+
export function remapStrippedLines(lines, stripLine) {
|
|
77
|
+
let offset = 0;
|
|
78
|
+
return lines.map((line, index) => {
|
|
79
|
+
const text = stripLine(line, index);
|
|
80
|
+
const raw = text + line.lineEnding;
|
|
81
|
+
const stripped = {
|
|
82
|
+
raw,
|
|
83
|
+
text,
|
|
84
|
+
lineEnding: line.lineEnding,
|
|
85
|
+
start: offset,
|
|
86
|
+
end: offset + raw.length
|
|
87
|
+
};
|
|
88
|
+
offset += raw.length;
|
|
89
|
+
return stripped;
|
|
90
|
+
});
|
|
91
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* G1.9 in the type system (G3.8): a snapshot-shared node is read-only on its serialized bytes,
|
|
3
|
+
* so a view freezes every byte-carrying field. `childIds`, `childSpans` and `ownerEpoch` are
|
|
4
|
+
* editor bookkeeping, not round-trip bytes, and stay writable through a view. The ONE sanctioned
|
|
5
|
+
* view-to-mutable door is the unshare seam (`tree-operations/unshare.ts`) plus the commit
|
|
6
|
+
* ceremony's owned scope views (G4.13); everywhere else the source-scan lint holds the perimeter.
|
|
7
|
+
*/
|
|
8
|
+
import type { CstNode, Document } from './nodes';
|
|
9
|
+
type BytesWritableKey = 'childIds' | 'childSpans' | 'ownerEpoch';
|
|
10
|
+
/** Primitives pass through untouched, so branded string kinds keep their brands. */
|
|
11
|
+
export type BytesView<T> = T extends string | number | boolean | bigint | symbol | null | undefined ? T : T extends readonly (infer E)[] ? readonly BytesView<E>[] : {
|
|
12
|
+
readonly [K in keyof T as K extends BytesWritableKey ? never : K]: BytesView<T[K]>;
|
|
13
|
+
} & {
|
|
14
|
+
[K in keyof T as K extends BytesWritableKey ? K : never]: T[K];
|
|
15
|
+
};
|
|
16
|
+
export type NodeView = BytesView<CstNode>;
|
|
17
|
+
export type DocumentView = BytesView<Document>;
|
|
18
|
+
/** A spine root the unshare seam accepts: the live document or a caller-owned children wrapper. */
|
|
19
|
+
export type NodeParentView = {
|
|
20
|
+
readonly children: readonly NodeView[];
|
|
21
|
+
};
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* G1.9 in the type system (G3.8): a snapshot-shared node is read-only on its serialized bytes,
|
|
3
|
+
* so a view freezes every byte-carrying field. `childIds`, `childSpans` and `ownerEpoch` are
|
|
4
|
+
* editor bookkeeping, not round-trip bytes, and stay writable through a view. The ONE sanctioned
|
|
5
|
+
* view-to-mutable door is the unshare seam (`tree-operations/unshare.ts`) plus the commit
|
|
6
|
+
* ceremony's owned scope views (G4.13); everywhere else the source-scan lint holds the perimeter.
|
|
7
|
+
*/
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
/** CST node types for the GFM parser: mutable plain objects. Spec: docs/design/syntax-tree.md. */
|
|
2
|
+
import type { BytesView, NodeView } from './node-views';
|
|
3
|
+
export type LeafBlockKind = 'heading' | 'setextHeading' | 'paragraph' | 'fencedCode' | 'thematicBreak' | 'indentedCode' | 'htmlBlock' | 'linkReferenceDefinition' | 'tableCell' | 'unrecognized';
|
|
4
|
+
export type ContainerBlockKind = 'blockquote' | 'list' | 'listItem' | 'table' | 'tableRow';
|
|
5
|
+
export type BlockKind = LeafBlockKind | ContainerBlockKind;
|
|
6
|
+
/**
|
|
7
|
+
* The single union-derived source for "iterate over all kinds": `Record<BlockKind, true>` makes
|
|
8
|
+
* the compiler flag a missing or stray member, where a hand-kept list passes vacuously.
|
|
9
|
+
*/
|
|
10
|
+
export declare const BLOCK_KIND_TABLE: Record<BlockKind, true>;
|
|
11
|
+
export declare const ALL_BLOCK_KINDS: BlockKind[];
|
|
12
|
+
declare const PluginKindBrand: unique symbol;
|
|
13
|
+
/**
|
|
14
|
+
* A plugin-declared block kind, a plain string at runtime. The brand keeps `BlockKind` switches
|
|
15
|
+
* exhaustive over built-ins while the registries key plugin kinds. Create via `declarePluginKind`.
|
|
16
|
+
*/
|
|
17
|
+
export type PluginBlockKind = string & {
|
|
18
|
+
readonly [PluginKindBrand]: true;
|
|
19
|
+
};
|
|
20
|
+
export type AnyBlockKind = BlockKind | PluginBlockKind;
|
|
21
|
+
export declare function isBuiltinBlockKind(kind: AnyBlockKind): kind is BlockKind;
|
|
22
|
+
export interface HeadingMetadata {
|
|
23
|
+
level: number;
|
|
24
|
+
}
|
|
25
|
+
export interface SetextHeadingMetadata {
|
|
26
|
+
level: 1 | 2;
|
|
27
|
+
}
|
|
28
|
+
export interface FencedCodeMetadata {
|
|
29
|
+
fenceMarker: '`' | '~';
|
|
30
|
+
fenceLength: number;
|
|
31
|
+
info: string;
|
|
32
|
+
closed: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface ThematicBreakMetadata {
|
|
35
|
+
marker: string;
|
|
36
|
+
}
|
|
37
|
+
export interface LinkReferenceDefinitionMetadata {
|
|
38
|
+
label: string;
|
|
39
|
+
url?: string;
|
|
40
|
+
title?: string;
|
|
41
|
+
}
|
|
42
|
+
export type TableAlignment = 'none' | 'left' | 'center' | 'right';
|
|
43
|
+
export interface TableMetadata {
|
|
44
|
+
columnCount: number;
|
|
45
|
+
alignments: TableAlignment[];
|
|
46
|
+
}
|
|
47
|
+
export interface TableRowMetadata {
|
|
48
|
+
isHeader: boolean;
|
|
49
|
+
}
|
|
50
|
+
export interface BlockquoteMetadata {
|
|
51
|
+
quoteDepth: number;
|
|
52
|
+
}
|
|
53
|
+
export interface ListMetadata {
|
|
54
|
+
ordered: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface ListItemMetadata {
|
|
57
|
+
marker: string;
|
|
58
|
+
taskItem: boolean;
|
|
59
|
+
taskChecked: boolean;
|
|
60
|
+
taskMarker: string | null;
|
|
61
|
+
}
|
|
62
|
+
export type BlockMetadata = HeadingMetadata | SetextHeadingMetadata | FencedCodeMetadata | ThematicBreakMetadata | LinkReferenceDefinitionMetadata | TableMetadata | TableRowMetadata | BlockquoteMetadata | ListMetadata | ListItemMetadata;
|
|
63
|
+
/** Metadata-less kinds are intentionally absent, so `metadataOf` rejects them. */
|
|
64
|
+
export interface BlockMetadataByKind {
|
|
65
|
+
heading: HeadingMetadata;
|
|
66
|
+
setextHeading: SetextHeadingMetadata;
|
|
67
|
+
fencedCode: FencedCodeMetadata;
|
|
68
|
+
thematicBreak: ThematicBreakMetadata;
|
|
69
|
+
linkReferenceDefinition: LinkReferenceDefinitionMetadata;
|
|
70
|
+
table: TableMetadata;
|
|
71
|
+
tableRow: TableRowMetadata;
|
|
72
|
+
blockquote: BlockquoteMetadata;
|
|
73
|
+
list: ListMetadata;
|
|
74
|
+
listItem: ListItemMetadata;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* The one sanctioned metadata cast, for contexts a narrowed `BuiltinCstNode` arm cannot reach:
|
|
78
|
+
* a generic `K`, or a full `CstNode` whose branded plugin arm blocks `kind` narrowing. Prefer
|
|
79
|
+
* reading `node.metadata` off a narrowed arm. Pass the kind you have already established.
|
|
80
|
+
*/
|
|
81
|
+
export declare function metadataOf<K extends keyof BlockMetadataByKind>(node: CstNode, kind: K): BlockMetadataByKind[K];
|
|
82
|
+
export declare function metadataOf<K extends keyof BlockMetadataByKind>(node: NodeView, kind: K): BytesView<BlockMetadataByKind[K]>;
|
|
83
|
+
/**
|
|
84
|
+
* `BlockMetadata` is closed over the built-ins, so bridging a plugin's shape needs a cast and
|
|
85
|
+
* this pair is the one place it lives. Keep the stored shape primitive-valued: the one-level
|
|
86
|
+
* undo clone (G1.6) shallow-copies metadata.
|
|
87
|
+
*/
|
|
88
|
+
export declare function setPluginMetadata<T>(node: CstNode, data: T): void;
|
|
89
|
+
export declare function getPluginMetadata<T>(node: NodeView): T | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Null for any non-heading node. The one heading-metadata read on the authoring barrel:
|
|
92
|
+
* `metadata.level` narrows only past `isBuiltinBlockNode`, which the barrel does not export.
|
|
93
|
+
*/
|
|
94
|
+
export declare function headingLevel(node: NodeView): number | null;
|
|
95
|
+
/** `ownerEpoch` is structural-sharing bookkeeping, not round-trip bytes. */
|
|
96
|
+
interface BlockNodeBase {
|
|
97
|
+
leadingTrivia: string;
|
|
98
|
+
raw: string;
|
|
99
|
+
ownerEpoch?: number;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* G1.5 forbids `children` and the container structural fields on non-containers, so the arms pin
|
|
103
|
+
* them `undefined` and the union rejects a leaf that grew a child at the type level.
|
|
104
|
+
*/
|
|
105
|
+
interface LeafBlockNodeBase extends BlockNodeBase {
|
|
106
|
+
children?: undefined;
|
|
107
|
+
innerPrefix?: undefined;
|
|
108
|
+
innerSuffix?: undefined;
|
|
109
|
+
childIds?: undefined;
|
|
110
|
+
childSpans?: undefined;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* G1.5 is one-directional (a container may be transiently childless mid-edit), so every
|
|
114
|
+
* structural field stays optional. `childIds` mirrors `children` for keyed rendering;
|
|
115
|
+
* `childSpans` records where each child's bytes sit in `raw` (`schema/child-spans.ts`).
|
|
116
|
+
*/
|
|
117
|
+
interface ContainerBlockNodeBase extends BlockNodeBase {
|
|
118
|
+
children?: CstNode[];
|
|
119
|
+
innerPrefix?: string;
|
|
120
|
+
innerSuffix?: string;
|
|
121
|
+
childIds?: string[];
|
|
122
|
+
childSpans?: Uint32Array;
|
|
123
|
+
}
|
|
124
|
+
export interface ParagraphNode extends LeafBlockNodeBase {
|
|
125
|
+
kind: 'paragraph';
|
|
126
|
+
metadata?: undefined;
|
|
127
|
+
}
|
|
128
|
+
export interface HeadingNode extends LeafBlockNodeBase {
|
|
129
|
+
kind: 'heading';
|
|
130
|
+
metadata: HeadingMetadata;
|
|
131
|
+
}
|
|
132
|
+
export interface SetextHeadingNode extends LeafBlockNodeBase {
|
|
133
|
+
kind: 'setextHeading';
|
|
134
|
+
metadata: SetextHeadingMetadata;
|
|
135
|
+
}
|
|
136
|
+
export interface FencedCodeNode extends LeafBlockNodeBase {
|
|
137
|
+
kind: 'fencedCode';
|
|
138
|
+
metadata: FencedCodeMetadata;
|
|
139
|
+
}
|
|
140
|
+
export interface ThematicBreakNode extends LeafBlockNodeBase {
|
|
141
|
+
kind: 'thematicBreak';
|
|
142
|
+
metadata: ThematicBreakMetadata;
|
|
143
|
+
}
|
|
144
|
+
export interface IndentedCodeNode extends LeafBlockNodeBase {
|
|
145
|
+
kind: 'indentedCode';
|
|
146
|
+
metadata?: undefined;
|
|
147
|
+
}
|
|
148
|
+
export interface HtmlBlockNode extends LeafBlockNodeBase {
|
|
149
|
+
kind: 'htmlBlock';
|
|
150
|
+
metadata?: undefined;
|
|
151
|
+
}
|
|
152
|
+
export interface LinkReferenceDefinitionNode extends LeafBlockNodeBase {
|
|
153
|
+
kind: 'linkReferenceDefinition';
|
|
154
|
+
metadata: LinkReferenceDefinitionMetadata;
|
|
155
|
+
}
|
|
156
|
+
export interface TableCellNode extends LeafBlockNodeBase {
|
|
157
|
+
kind: 'tableCell';
|
|
158
|
+
metadata?: undefined;
|
|
159
|
+
}
|
|
160
|
+
export interface UnrecognizedNode extends LeafBlockNodeBase {
|
|
161
|
+
kind: 'unrecognized';
|
|
162
|
+
metadata?: undefined;
|
|
163
|
+
}
|
|
164
|
+
export interface BlockquoteNode extends ContainerBlockNodeBase {
|
|
165
|
+
kind: 'blockquote';
|
|
166
|
+
metadata: BlockquoteMetadata;
|
|
167
|
+
}
|
|
168
|
+
export interface ListNode extends ContainerBlockNodeBase {
|
|
169
|
+
kind: 'list';
|
|
170
|
+
metadata: ListMetadata;
|
|
171
|
+
}
|
|
172
|
+
export interface ListItemNode extends ContainerBlockNodeBase {
|
|
173
|
+
kind: 'listItem';
|
|
174
|
+
metadata: ListItemMetadata;
|
|
175
|
+
}
|
|
176
|
+
export interface TableNode extends ContainerBlockNodeBase {
|
|
177
|
+
kind: 'table';
|
|
178
|
+
metadata: TableMetadata;
|
|
179
|
+
}
|
|
180
|
+
export interface TableRowNode extends ContainerBlockNodeBase {
|
|
181
|
+
kind: 'tableRow';
|
|
182
|
+
metadata: TableRowMetadata;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* A branded-string kind, so this arm is NOT discriminable by `switch (node.kind)`: narrow past
|
|
186
|
+
* it with `isBuiltinBlockNode` first. A plugin block may be a leaf or a container, so the
|
|
187
|
+
* structural fields stay optional.
|
|
188
|
+
*/
|
|
189
|
+
export interface PluginBlockNode extends BlockNodeBase {
|
|
190
|
+
kind: PluginBlockKind;
|
|
191
|
+
metadata?: BlockMetadata;
|
|
192
|
+
children?: CstNode[];
|
|
193
|
+
innerPrefix?: string;
|
|
194
|
+
innerSuffix?: string;
|
|
195
|
+
childIds?: string[];
|
|
196
|
+
childSpans?: Uint32Array;
|
|
197
|
+
}
|
|
198
|
+
/** A genuine discriminated union: `switch (node.kind)` narrows `node.metadata` with no cast. */
|
|
199
|
+
export type BuiltinCstNode = ParagraphNode | HeadingNode | SetextHeadingNode | FencedCodeNode | ThematicBreakNode | IndentedCodeNode | HtmlBlockNode | LinkReferenceDefinitionNode | TableCellNode | UnrecognizedNode | BlockquoteNode | ListNode | ListItemNode | TableNode | TableRowNode;
|
|
200
|
+
/**
|
|
201
|
+
* The open `PluginBlockNode` arm does not discriminate, so full-union `kind` checks do not
|
|
202
|
+
* narrow: reach the discriminated world through `isBuiltinBlockNode`. Common fields (`raw`,
|
|
203
|
+
* `leadingTrivia`, `kind`) project across every arm and read without narrowing.
|
|
204
|
+
*/
|
|
205
|
+
export type CstNode = BuiltinCstNode | PluginBlockNode;
|
|
206
|
+
/**
|
|
207
|
+
* The door to the `switch (node.kind)` narrowing the branded plugin arm blocks. Mirrored for
|
|
208
|
+
* views, so a reader that narrows a `NodeView` reads each arm's metadata with no `metadataOf`.
|
|
209
|
+
*/
|
|
210
|
+
export declare function isBuiltinBlockNode(node: CstNode): node is BuiltinCstNode;
|
|
211
|
+
export declare function isBuiltinBlockNode(node: NodeView): node is BytesView<BuiltinCstNode>;
|
|
212
|
+
/**
|
|
213
|
+
* The ONE place the runtime-kind construction cast lives. A construction door, not the
|
|
214
|
+
* view-to-mutable strip door: the spread returns a FRESH object, so passing a view mints a copy
|
|
215
|
+
* instead of stripping its readonly-ness, which is why G4.13 sanctions this file. Fields are not
|
|
216
|
+
* checked against the arm, so a metadata-less node of a metadata-carrying kind is mintable (a
|
|
217
|
+
* transient re-parse probe does this) and its `metadata` must not be read before re-parse.
|
|
218
|
+
*/
|
|
219
|
+
export declare function makeBlockNode(fields: {
|
|
220
|
+
kind: AnyBlockKind;
|
|
221
|
+
leadingTrivia: string;
|
|
222
|
+
raw: string;
|
|
223
|
+
metadata?: BlockMetadata;
|
|
224
|
+
children?: CstNode[];
|
|
225
|
+
innerPrefix?: string;
|
|
226
|
+
innerSuffix?: string;
|
|
227
|
+
childIds?: string[];
|
|
228
|
+
ownerEpoch?: number;
|
|
229
|
+
}): CstNode;
|
|
230
|
+
export interface Document {
|
|
231
|
+
kind: 'document';
|
|
232
|
+
prefix: string;
|
|
233
|
+
children: CstNode[];
|
|
234
|
+
suffix: string;
|
|
235
|
+
/** The root's parallel id array while a caller keeps one here — the editor's own live ids
|
|
236
|
+
* are editor state, but the splice doors maintain whatever array the parent carries. */
|
|
237
|
+
childIds?: string[];
|
|
238
|
+
}
|
|
239
|
+
export type InlineNodeKind = 'text' | 'emphasis' | 'strong' | 'strikethrough' | 'inlineCode' | 'link' | 'image' | 'autolink' | 'hardLineBreak' | 'escape' | 'entityReference' | 'unresolvedReference' | 'rawHtml';
|
|
240
|
+
declare const InlineKindBrand: unique symbol;
|
|
241
|
+
/** The inline sibling of `PluginBlockKind`; create via `declarePluginInlineKind`. */
|
|
242
|
+
export type PluginInlineKind = string & {
|
|
243
|
+
readonly [InlineKindBrand]: true;
|
|
244
|
+
};
|
|
245
|
+
export type AnyInlineKind = InlineNodeKind | PluginInlineKind;
|
|
246
|
+
export declare const INLINE_KIND_TABLE: Record<InlineNodeKind, true>;
|
|
247
|
+
export declare function isBuiltinInlineKind(kind: AnyInlineKind): kind is InlineNodeKind;
|
|
248
|
+
/** start/end are byte offsets into the parent block's raw, including markers. */
|
|
249
|
+
export interface InlineNode {
|
|
250
|
+
kind: AnyInlineKind;
|
|
251
|
+
start: number;
|
|
252
|
+
end: number;
|
|
253
|
+
text?: string;
|
|
254
|
+
children?: InlineNode[];
|
|
255
|
+
url?: string;
|
|
256
|
+
title?: string;
|
|
257
|
+
label?: string;
|
|
258
|
+
alt?: string;
|
|
259
|
+
decoded?: string;
|
|
260
|
+
width?: number;
|
|
261
|
+
height?: number;
|
|
262
|
+
/** Discriminator for `unresolvedReference` nodes: which form they would have been. */
|
|
263
|
+
refKind?: 'link' | 'image';
|
|
264
|
+
/**
|
|
265
|
+
* Stamped by the scan when a plugin rung claimed these bytes, derived per scan and never
|
|
266
|
+
* persisted. Write paths read it to re-serialize in the claiming syntax, not built-in GFM.
|
|
267
|
+
*/
|
|
268
|
+
syntaxClaim?: InlineSyntaxClaim;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Optional keys are omitted rather than set to `undefined`, so a serializer can tell "no title"
|
|
272
|
+
* from "empty title" and reproduce a node that never carried one.
|
|
273
|
+
*/
|
|
274
|
+
export interface ImageFields {
|
|
275
|
+
alt: string;
|
|
276
|
+
url: string;
|
|
277
|
+
title?: string;
|
|
278
|
+
width?: number;
|
|
279
|
+
height?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Reference-style images only (`![alt][label]`). When set, the serializer emits the reference
|
|
282
|
+
* form and writes no url/title: those live in the LRD, and inlining them would orphan it.
|
|
283
|
+
*/
|
|
284
|
+
label?: string;
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Re-serializes an image an inline rung minted over its own bytes: `source` in, its replacement
|
|
288
|
+
* in the rung's syntax out, or `null` to decline the edit rather than rewrite the bytes as GFM.
|
|
289
|
+
*/
|
|
290
|
+
export type ImageSyntaxRewriter = (source: string, fields: ImageFields) => string | null;
|
|
291
|
+
/** What the scan records on a node an inline rung claimed. */
|
|
292
|
+
export interface InlineSyntaxClaim {
|
|
293
|
+
/** The claiming rung's prefix: its bare trigger, or its multi-char prefix. */
|
|
294
|
+
prefix: string;
|
|
295
|
+
rewriteImage?: ImageSyntaxRewriter;
|
|
296
|
+
}
|
|
297
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/** CST node types for the GFM parser: mutable plain objects. Spec: docs/design/syntax-tree.md. */
|
|
2
|
+
/**
|
|
3
|
+
* The single union-derived source for "iterate over all kinds": `Record<BlockKind, true>` makes
|
|
4
|
+
* the compiler flag a missing or stray member, where a hand-kept list passes vacuously.
|
|
5
|
+
*/
|
|
6
|
+
export const BLOCK_KIND_TABLE = {
|
|
7
|
+
heading: true,
|
|
8
|
+
setextHeading: true,
|
|
9
|
+
paragraph: true,
|
|
10
|
+
fencedCode: true,
|
|
11
|
+
thematicBreak: true,
|
|
12
|
+
indentedCode: true,
|
|
13
|
+
htmlBlock: true,
|
|
14
|
+
linkReferenceDefinition: true,
|
|
15
|
+
tableCell: true,
|
|
16
|
+
unrecognized: true,
|
|
17
|
+
blockquote: true,
|
|
18
|
+
list: true,
|
|
19
|
+
listItem: true,
|
|
20
|
+
table: true,
|
|
21
|
+
tableRow: true
|
|
22
|
+
};
|
|
23
|
+
export const ALL_BLOCK_KINDS = Object.keys(BLOCK_KIND_TABLE);
|
|
24
|
+
export function isBuiltinBlockKind(kind) {
|
|
25
|
+
return kind in BLOCK_KIND_TABLE;
|
|
26
|
+
}
|
|
27
|
+
export function metadataOf(node, kind) {
|
|
28
|
+
void kind;
|
|
29
|
+
return node.metadata;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `BlockMetadata` is closed over the built-ins, so bridging a plugin's shape needs a cast and
|
|
33
|
+
* this pair is the one place it lives. Keep the stored shape primitive-valued: the one-level
|
|
34
|
+
* undo clone (G1.6) shallow-copies metadata.
|
|
35
|
+
*/
|
|
36
|
+
export function setPluginMetadata(node, data) {
|
|
37
|
+
node.metadata = data;
|
|
38
|
+
}
|
|
39
|
+
export function getPluginMetadata(node) {
|
|
40
|
+
return node.metadata;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Null for any non-heading node. The one heading-metadata read on the authoring barrel:
|
|
44
|
+
* `metadata.level` narrows only past `isBuiltinBlockNode`, which the barrel does not export.
|
|
45
|
+
*/
|
|
46
|
+
export function headingLevel(node) {
|
|
47
|
+
if (node.kind === 'heading')
|
|
48
|
+
return metadataOf(node, 'heading').level;
|
|
49
|
+
if (node.kind === 'setextHeading')
|
|
50
|
+
return metadataOf(node, 'setextHeading').level;
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
export function isBuiltinBlockNode(node) {
|
|
54
|
+
return isBuiltinBlockKind(node.kind);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* The ONE place the runtime-kind construction cast lives. A construction door, not the
|
|
58
|
+
* view-to-mutable strip door: the spread returns a FRESH object, so passing a view mints a copy
|
|
59
|
+
* instead of stripping its readonly-ness, which is why G4.13 sanctions this file. Fields are not
|
|
60
|
+
* checked against the arm, so a metadata-less node of a metadata-carrying kind is mintable (a
|
|
61
|
+
* transient re-parse probe does this) and its `metadata` must not be read before re-parse.
|
|
62
|
+
*/
|
|
63
|
+
export function makeBlockNode(fields) {
|
|
64
|
+
return { ...fields };
|
|
65
|
+
}
|
|
66
|
+
export const INLINE_KIND_TABLE = {
|
|
67
|
+
text: true,
|
|
68
|
+
emphasis: true,
|
|
69
|
+
strong: true,
|
|
70
|
+
strikethrough: true,
|
|
71
|
+
inlineCode: true,
|
|
72
|
+
link: true,
|
|
73
|
+
image: true,
|
|
74
|
+
autolink: true,
|
|
75
|
+
hardLineBreak: true,
|
|
76
|
+
escape: true,
|
|
77
|
+
entityReference: true,
|
|
78
|
+
unresolvedReference: true,
|
|
79
|
+
rawHtml: true
|
|
80
|
+
};
|
|
81
|
+
export function isBuiltinInlineKind(kind) {
|
|
82
|
+
return kind in INLINE_KIND_TABLE;
|
|
83
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single-pass GFM block parser, producing a CST where serialize(parse(source)) === source.
|
|
3
|
+
* Per-kind parsers live in parsers/; this file holds dispatch and shared utilities only.
|
|
4
|
+
*/
|
|
5
|
+
import type { CstNode, Document } from './nodes';
|
|
6
|
+
import { type ParsedLine } from './lines';
|
|
7
|
+
import { type GrammarView } from '../schema/block-openers';
|
|
8
|
+
/**
|
|
9
|
+
* Container-nesting cap: past it the remaining prefix parses as paragraph content instead of
|
|
10
|
+
* recursing, so pathological input degrades rather than overflowing the stack. Sits well under
|
|
11
|
+
* the empirical crash point, with headroom for the tree walks that recurse to the same depth.
|
|
12
|
+
* Byte-preserving, since only a top-level node's `raw` serializes and that is fixed first.
|
|
13
|
+
*/
|
|
14
|
+
export declare const MAX_NESTING_DEPTH = 512;
|
|
15
|
+
/** Whether `source` is a whole document or one block's bytes read standalone. */
|
|
16
|
+
export type ParseScope = 'document' | 'fragment';
|
|
17
|
+
/**
|
|
18
|
+
* Parse GFM to a lossless CST. `opts.grammar` is the per-instance grammar view, defaulting to
|
|
19
|
+
* the global openers. It filters only the TOP-LEVEL opener dispatch: nested container reparses
|
|
20
|
+
* and the paragraph-interrupt scan read the global grammar, the documented enablement boundary,
|
|
21
|
+
* so a top-level disabled kind is skipped and a nested one is not. `opts.scope` reaches openers
|
|
22
|
+
* as `ctx.isDocumentParse`; it defaults to `'document'`, so whole-source callers need nothing.
|
|
23
|
+
*/
|
|
24
|
+
export declare function parse(source: string, opts?: {
|
|
25
|
+
grammar?: GrammarView;
|
|
26
|
+
scope?: ParseScope;
|
|
27
|
+
}): Document;
|
|
28
|
+
interface ParseBlocksResult {
|
|
29
|
+
children: CstNode[];
|
|
30
|
+
suffix: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The seam block-incremental parsing re-parses ranges through: a block-aligned window parses
|
|
34
|
+
* identically to a full parse of the window's text. A window is a FRAGMENT unless its caller
|
|
35
|
+
* says otherwise, so `parse` alone defaults to document scope. Blank-line rule
|
|
36
|
+
* (`design/syntax-tree.md`): the first blank line of a run separates and folds into trivia;
|
|
37
|
+
* every later one is an empty paragraph carrying its own bytes.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseBlocks(lines: ParsedLine[], start: number, end: number, grammar?: GrammarView, depth?: number, isDocumentParse?: boolean): ParseBlocksResult;
|
|
40
|
+
export interface ContainerBodyWrap {
|
|
41
|
+
/** A chrome line of the container's own sits above the body (`:::note`, `<summary>`). */
|
|
42
|
+
afterOpenerLine?: boolean;
|
|
43
|
+
/** A chrome line of the container's own sits below the body (`:::`, `</details>`). */
|
|
44
|
+
beforeCloserLine?: boolean;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Parse a container body between the container's own chrome lines; a body starting at the
|
|
48
|
+
* container's own first line (blockquote, list item) has no wrap and uses `parse`. A blank line
|
|
49
|
+
* against a chrome line separates as it does between blocks, landing in `prefix`/`suffix` while
|
|
50
|
+
* the rest of its run materializes as body content; one with no body on its far side separated
|
|
51
|
+
* nothing and stays content. `opts.scope` is required: a new entry cannot recover it (G4.27).
|
|
52
|
+
*/
|
|
53
|
+
export declare function parseContainerBody(bodyText: string, wrap: ContainerBodyWrap, opts: {
|
|
54
|
+
scope: ParseScope;
|
|
55
|
+
depth?: number;
|
|
56
|
+
}): Document;
|
|
57
|
+
export declare function isBlankLine(text: string): boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Nothing but blank lines — what the blank-line rule mints a block from. Blankness is the
|
|
60
|
+
* parser's (GFM §2.1), never `String.trim()`: a non-breaking space is content.
|
|
61
|
+
*/
|
|
62
|
+
export declare function isBlankSource(source: string): boolean;
|
|
63
|
+
export declare function isBlankParagraph(node: {
|
|
64
|
+
kind: string;
|
|
65
|
+
raw: string;
|
|
66
|
+
}): boolean;
|
|
67
|
+
export declare function joinRaw(lines: ParsedLine[], startIndex: number, endIndex: number): string;
|
|
68
|
+
export {};
|