@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,41 @@
|
|
|
1
|
+
// The paragraph-interruption guard is dispatch context, not a line-level match, so it lives
|
|
2
|
+
// with the opener registration rather than the matcher.
|
|
3
|
+
import { joinRaw, isBlankLine } from '../parser';
|
|
4
|
+
export function matchIndentedCode(text) {
|
|
5
|
+
// GFM §2.2: a tab advances to the next 4-column stop, so ` \t` is four columns of indent.
|
|
6
|
+
let col = 0;
|
|
7
|
+
for (let i = 0; i < text.length && (text[i] === ' ' || text[i] === '\t'); i++) {
|
|
8
|
+
col += text[i] === '\t' ? 4 - (col % 4) : 1;
|
|
9
|
+
if (col >= 4)
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
export function parseIndentedCode(lines, startIndex, endIndex, leadingTrivia) {
|
|
15
|
+
let i = startIndex;
|
|
16
|
+
while (i < endIndex) {
|
|
17
|
+
if (matchIndentedCode(lines[i].text)) {
|
|
18
|
+
i++;
|
|
19
|
+
}
|
|
20
|
+
else if (isBlankLine(lines[i].text)) {
|
|
21
|
+
// Blank lines stay inside the block only if followed by more indented content.
|
|
22
|
+
let j = i + 1;
|
|
23
|
+
while (j < endIndex && isBlankLine(lines[j].text))
|
|
24
|
+
j++;
|
|
25
|
+
if (j < endIndex && matchIndentedCode(lines[j].text)) {
|
|
26
|
+
i = j;
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
else {
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const raw = joinRaw(lines, startIndex, i);
|
|
37
|
+
return {
|
|
38
|
+
node: { kind: 'indentedCode', leadingTrivia, raw },
|
|
39
|
+
consumed: i - startIndex
|
|
40
|
+
};
|
|
41
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link reference definition parser, CommonMark §4.7 (`[label]: url "title"`, URL and title
|
|
3
|
+
* allowed on continuation lines). Footnote labels (`[^...]:`) are excluded; they stay paragraphs.
|
|
4
|
+
*/
|
|
5
|
+
import type { ParsedLine } from '../lines';
|
|
6
|
+
import { type BlockOpenerResult } from '../../schema/block-openers';
|
|
7
|
+
export declare function parseLinkReferenceDefinition(lines: ParsedLine[], startIndex: number, endIndex: number, leadingTrivia: string): BlockOpenerResult | null;
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Link reference definition parser, CommonMark §4.7 (`[label]: url "title"`, URL and title
|
|
3
|
+
* allowed on continuation lines). Footnote labels (`[^...]:`) are excluded; they stay paragraphs.
|
|
4
|
+
*/
|
|
5
|
+
import { ESCAPABLE_PUNCTUATION } from '../escapable';
|
|
6
|
+
import { joinRaw } from '../parser';
|
|
7
|
+
import { lineInterruptsParagraph } from '../../schema/block-openers';
|
|
8
|
+
import { matchSetextUnderline } from './paragraph';
|
|
9
|
+
export function parseLinkReferenceDefinition(lines, startIndex, endIndex, leadingTrivia) {
|
|
10
|
+
const first = lines[startIndex];
|
|
11
|
+
const opener = matchLabelOpener(first.text);
|
|
12
|
+
if (!opener)
|
|
13
|
+
return null;
|
|
14
|
+
const { label, afterColon } = opener;
|
|
15
|
+
if (label.startsWith('^'))
|
|
16
|
+
return null;
|
|
17
|
+
// Resolve which line the destination sits on first, then run one url + title tail over it.
|
|
18
|
+
const destination = resolveDestinationSegment(afterColon, lines, startIndex, endIndex);
|
|
19
|
+
if (!destination)
|
|
20
|
+
return null;
|
|
21
|
+
const urlResult = parseUrl(destination.segment);
|
|
22
|
+
if (!urlResult)
|
|
23
|
+
return null;
|
|
24
|
+
const url = urlResult.url;
|
|
25
|
+
let lineCursor = destination.segmentLine;
|
|
26
|
+
const afterUrl = stripLeadingSpaces(destination.segment.slice(urlResult.consumed));
|
|
27
|
+
const tail = resolveTitle(afterUrl, lines, lineCursor + 1, endIndex);
|
|
28
|
+
if (!tail)
|
|
29
|
+
return null;
|
|
30
|
+
const title = tail.title;
|
|
31
|
+
if (tail.titleLine !== null)
|
|
32
|
+
lineCursor = tail.titleLine;
|
|
33
|
+
const raw = joinRaw(lines, startIndex, lineCursor + 1);
|
|
34
|
+
return {
|
|
35
|
+
node: {
|
|
36
|
+
kind: 'linkReferenceDefinition',
|
|
37
|
+
leadingTrivia,
|
|
38
|
+
raw,
|
|
39
|
+
metadata: {
|
|
40
|
+
label,
|
|
41
|
+
url,
|
|
42
|
+
...(title !== undefined ? { title } : {})
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
consumed: lineCursor + 1 - startIndex
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
function stripLeadingSpaces(s) {
|
|
49
|
+
return s.replace(/^[ \t]*/, '');
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* CommonMark §4.7 allows one line ending before the destination, so an empty same-line tail
|
|
53
|
+
* defers to the next line. A next line that opens a block or underlines the label line as a
|
|
54
|
+
* setext heading, and an empty one, decline.
|
|
55
|
+
*/
|
|
56
|
+
function resolveDestinationSegment(afterColon, lines, startIndex, endIndex) {
|
|
57
|
+
const sameLine = stripLeadingSpaces(afterColon);
|
|
58
|
+
if (sameLine.length > 0)
|
|
59
|
+
return { segment: sameLine, segmentLine: startIndex };
|
|
60
|
+
const nextLineIndex = startIndex + 1;
|
|
61
|
+
if (nextLineIndex >= endIndex)
|
|
62
|
+
return null;
|
|
63
|
+
const nextLine = lines[nextLineIndex];
|
|
64
|
+
if (lineInterruptsParagraph(nextLine.text))
|
|
65
|
+
return null;
|
|
66
|
+
if (matchSetextUnderline(nextLine.text))
|
|
67
|
+
return null;
|
|
68
|
+
const segment = stripLeadingSpaces(nextLine.text);
|
|
69
|
+
if (segment.length === 0)
|
|
70
|
+
return null;
|
|
71
|
+
return { segment, segmentLine: nextLineIndex };
|
|
72
|
+
}
|
|
73
|
+
// CommonMark §4.7: brackets inside a label may be backslash-escaped. Multi-line labels and
|
|
74
|
+
// unescaped-`[` rejection are out of scope for this line-oriented parser.
|
|
75
|
+
function matchLabelOpener(line) {
|
|
76
|
+
let i = 0;
|
|
77
|
+
while (i < line.length && i < 3 && line[i] === ' ')
|
|
78
|
+
i++;
|
|
79
|
+
if (line[i] !== '[')
|
|
80
|
+
return null;
|
|
81
|
+
const labelStart = i + 1;
|
|
82
|
+
let j = labelStart;
|
|
83
|
+
while (j < line.length) {
|
|
84
|
+
const ch = line[j];
|
|
85
|
+
if (ch === '\\' && j + 1 < line.length && ESCAPABLE_PUNCTUATION.has(line[j + 1])) {
|
|
86
|
+
j += 2;
|
|
87
|
+
continue;
|
|
88
|
+
}
|
|
89
|
+
if (ch === ']')
|
|
90
|
+
break;
|
|
91
|
+
j++;
|
|
92
|
+
}
|
|
93
|
+
if (j >= line.length || line[j] !== ']')
|
|
94
|
+
return null;
|
|
95
|
+
if (j + 1 >= line.length || line[j + 1] !== ':')
|
|
96
|
+
return null;
|
|
97
|
+
const label = line.slice(labelStart, j);
|
|
98
|
+
// §4.7: a label holds at least one non-whitespace character.
|
|
99
|
+
if (label.trim() === '')
|
|
100
|
+
return null;
|
|
101
|
+
return { label, afterColon: line.slice(j + 2) };
|
|
102
|
+
}
|
|
103
|
+
function parseUrl(s) {
|
|
104
|
+
if (s.length === 0)
|
|
105
|
+
return null;
|
|
106
|
+
if (s[0] === '<') {
|
|
107
|
+
const close = s.indexOf('>', 1);
|
|
108
|
+
if (close === -1)
|
|
109
|
+
return null;
|
|
110
|
+
return { url: s.slice(1, close), consumed: close + 1 };
|
|
111
|
+
}
|
|
112
|
+
const m = s.match(/^(\S+)/);
|
|
113
|
+
if (!m)
|
|
114
|
+
return null;
|
|
115
|
+
return { url: m[1], consumed: m[1].length };
|
|
116
|
+
}
|
|
117
|
+
const TITLE_CLOSER = { '"': '"', "'": "'", '(': ')' };
|
|
118
|
+
function matchTitleSingleLine(s) {
|
|
119
|
+
const closer = TITLE_CLOSER[s[0]];
|
|
120
|
+
if (!closer)
|
|
121
|
+
return null;
|
|
122
|
+
const close = s.indexOf(closer, 1);
|
|
123
|
+
if (close === -1)
|
|
124
|
+
return null;
|
|
125
|
+
return { title: s.slice(1, close), consumed: close + 1 };
|
|
126
|
+
}
|
|
127
|
+
/** A title iff `s` holds one well-formed title and nothing but spaces after it. */
|
|
128
|
+
function wholeLineTitle(s) {
|
|
129
|
+
const t = matchTitleSingleLine(s);
|
|
130
|
+
if (!t)
|
|
131
|
+
return null;
|
|
132
|
+
return stripLeadingSpaces(s.slice(t.consumed)).length === 0 ? { title: t.title } : null;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* `null` invalidates the whole definition (CommonMark §4.7): non-whitespace after the
|
|
136
|
+
* destination that isn't a well-formed title means it was never a definition. An absent
|
|
137
|
+
* title succeeds.
|
|
138
|
+
*/
|
|
139
|
+
function resolveTitle(afterUrl, lines, continuationLine, endIndex) {
|
|
140
|
+
if (afterUrl.length > 0) {
|
|
141
|
+
const trailing = wholeLineTitle(afterUrl);
|
|
142
|
+
if (!trailing)
|
|
143
|
+
return null;
|
|
144
|
+
return { title: trailing.title, titleLine: null };
|
|
145
|
+
}
|
|
146
|
+
if (continuationLine < endIndex) {
|
|
147
|
+
const next = wholeLineTitle(stripLeadingSpaces(lines[continuationLine].text));
|
|
148
|
+
if (next)
|
|
149
|
+
return { title: next.title, titleLine: continuationLine };
|
|
150
|
+
}
|
|
151
|
+
return { title: undefined, titleLine: null };
|
|
152
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List parser with CommonMark §5.2 lazy continuation. "Open paragraph" is approximated per
|
|
3
|
+
* line (non-blank, not a paragraph interrupter), as in the blockquote parser. Laziness reaches
|
|
4
|
+
* only the item's own top-level paragraph, never one open inside a nested sub-list.
|
|
5
|
+
*/
|
|
6
|
+
import { type ParsedLine } from '../lines';
|
|
7
|
+
import { type BlockOpenerResult } from '../../schema/block-openers';
|
|
8
|
+
export declare function matchListItem(text: string): {
|
|
9
|
+
marker: string;
|
|
10
|
+
ordered: boolean;
|
|
11
|
+
indent: number;
|
|
12
|
+
} | null;
|
|
13
|
+
/**
|
|
14
|
+
* CommonMark §5.2: a marker interrupts a paragraph only if bullet or starting at `1` AND its
|
|
15
|
+
* first item is non-empty, so neither "... is 2. bananas" nor a content-less marker is a list.
|
|
16
|
+
* Standalone list parsing (`matchListItem`) accepts both.
|
|
17
|
+
*/
|
|
18
|
+
export declare function canInterruptParagraph(text: string): boolean;
|
|
19
|
+
export declare function parseList(lines: ParsedLine[], startIndex: number, endIndex: number, leadingTrivia: string, depth?: number, isDocumentParse?: boolean): BlockOpenerResult;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* List parser with CommonMark §5.2 lazy continuation. "Open paragraph" is approximated per
|
|
3
|
+
* line (non-blank, not a paragraph interrupter), as in the blockquote parser. Laziness reaches
|
|
4
|
+
* only the item's own top-level paragraph, never one open inside a nested sub-list.
|
|
5
|
+
*/
|
|
6
|
+
import { remapStrippedLines } from '../lines';
|
|
7
|
+
import { joinRaw, isBlankLine, parseBlocks } from '../parser';
|
|
8
|
+
import { defaultGrammarView, lineInterruptsParagraph, lineStartsOuterBlock } from '../../schema/block-openers';
|
|
9
|
+
export function matchListItem(text) {
|
|
10
|
+
const m = text.match(/^( {0,3})((?:[-*+]|\d{1,9}[.)])\s+)/);
|
|
11
|
+
if (!m)
|
|
12
|
+
return null;
|
|
13
|
+
return {
|
|
14
|
+
marker: m[2],
|
|
15
|
+
ordered: /^\d/.test(m[2]),
|
|
16
|
+
indent: m[0].length
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
function matchTaskCheckbox(text) {
|
|
20
|
+
const m = text.match(/^\[( |x|X)\]\s+/);
|
|
21
|
+
return m ? { checked: m[1].toLowerCase() === 'x', rawMarker: m[0] } : null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* CommonMark §5.2: a marker interrupts a paragraph only if bullet or starting at `1` AND its
|
|
25
|
+
* first item is non-empty, so neither "... is 2. bananas" nor a content-less marker is a list.
|
|
26
|
+
* Standalone list parsing (`matchListItem`) accepts both.
|
|
27
|
+
*/
|
|
28
|
+
export function canInterruptParagraph(text) {
|
|
29
|
+
return /^ {0,3}(?:[-*+]|1[.)])[ \t]+\S/.test(text);
|
|
30
|
+
}
|
|
31
|
+
export function parseList(lines, startIndex, endIndex, leadingTrivia, depth = 0, isDocumentParse = false) {
|
|
32
|
+
const firstMatch = matchListItem(lines[startIndex].text);
|
|
33
|
+
const ordered = firstMatch.ordered;
|
|
34
|
+
const items = [];
|
|
35
|
+
let i = startIndex;
|
|
36
|
+
while (i < endIndex) {
|
|
37
|
+
const itemMatch = matchListItem(lines[i].text);
|
|
38
|
+
if (!itemMatch || itemMatch.ordered !== ordered)
|
|
39
|
+
break;
|
|
40
|
+
const contentIndent = itemMatch.indent;
|
|
41
|
+
const itemStartIndex = i;
|
|
42
|
+
// The marker line strips to its content; a paragraph is open unless that content opens a block.
|
|
43
|
+
let paragraphOpen = wouldKeepParagraphOpen(lines[i].text.slice(contentIndent));
|
|
44
|
+
i++;
|
|
45
|
+
// Blank lines are absorbed if followed by indented content, making multi-paragraph items.
|
|
46
|
+
while (i < endIndex) {
|
|
47
|
+
if (isBlankLine(lines[i].text)) {
|
|
48
|
+
let j = i;
|
|
49
|
+
while (j < endIndex && isBlankLine(lines[j].text))
|
|
50
|
+
j++;
|
|
51
|
+
if (j < endIndex && getIndent(lines[j].text) >= contentIndent) {
|
|
52
|
+
paragraphOpen = wouldKeepParagraphOpen(lines[j].text.slice(contentIndent));
|
|
53
|
+
i = j + 1;
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
break;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
else if (getIndent(lines[i].text) >= contentIndent) {
|
|
60
|
+
paragraphOpen = wouldKeepParagraphOpen(lines[i].text.slice(contentIndent));
|
|
61
|
+
i++;
|
|
62
|
+
}
|
|
63
|
+
else if (paragraphOpen &&
|
|
64
|
+
wouldKeepParagraphOpen(lines[i].text) &&
|
|
65
|
+
!lineStartsOuterBlock(lines[i], { paragraphOpen: true })) {
|
|
66
|
+
// Lazy continuation: the verbatim bytes stay in raw, and stripListItemLines
|
|
67
|
+
// feeds the paragraph parser one continuous paragraph.
|
|
68
|
+
i++;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const itemRaw = joinRaw(lines, itemStartIndex, i);
|
|
75
|
+
const baseLines = stripListItemLines(lines, itemStartIndex, i, contentIndent);
|
|
76
|
+
// A leading `[ ] ` is the task marker; re-mint so body offsets match its shortened bytes.
|
|
77
|
+
const task = matchTaskCheckbox(baseLines.length > 0 ? baseLines[0].text : '');
|
|
78
|
+
const strippedLines = task
|
|
79
|
+
? remapStrippedLines(baseLines, (line, index) => index === 0 ? line.text.slice(task.rawMarker.length) : line.text)
|
|
80
|
+
: baseLines;
|
|
81
|
+
const inner = parseBlocks(strippedLines, 0, strippedLines.length, defaultGrammarView, depth + 1, isDocumentParse);
|
|
82
|
+
items.push({
|
|
83
|
+
kind: 'listItem',
|
|
84
|
+
leadingTrivia: '',
|
|
85
|
+
raw: itemRaw,
|
|
86
|
+
metadata: {
|
|
87
|
+
marker: itemMatch.marker,
|
|
88
|
+
taskItem: task !== null,
|
|
89
|
+
taskChecked: task?.checked ?? false,
|
|
90
|
+
taskMarker: task?.rawMarker ?? null
|
|
91
|
+
},
|
|
92
|
+
innerPrefix: '',
|
|
93
|
+
children: inner.children,
|
|
94
|
+
innerSuffix: inner.suffix
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
const raw = joinRaw(lines, startIndex, i);
|
|
98
|
+
return {
|
|
99
|
+
node: {
|
|
100
|
+
kind: 'list',
|
|
101
|
+
leadingTrivia,
|
|
102
|
+
raw,
|
|
103
|
+
metadata: { ordered },
|
|
104
|
+
innerPrefix: '',
|
|
105
|
+
children: items,
|
|
106
|
+
innerSuffix: ''
|
|
107
|
+
},
|
|
108
|
+
consumed: i - startIndex
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
function getIndent(text) {
|
|
112
|
+
return text.match(/^ */)[0].length;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Lazy continuation extends only an open paragraph. Any list marker is block-level, resolved
|
|
116
|
+
* by the outer item loop, so an ordered marker not starting at 1 is excluded here even though
|
|
117
|
+
* §5.2 says it cannot interrupt a paragraph.
|
|
118
|
+
*/
|
|
119
|
+
function wouldKeepParagraphOpen(strippedText) {
|
|
120
|
+
if (isBlankLine(strippedText))
|
|
121
|
+
return false;
|
|
122
|
+
if (matchListItem(strippedText))
|
|
123
|
+
return false;
|
|
124
|
+
if (lineInterruptsParagraph(strippedText))
|
|
125
|
+
return false;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
function stripListItemLines(lines, startIndex, endIndex, contentIndent) {
|
|
129
|
+
return remapStrippedLines(lines.slice(startIndex, endIndex), (line, i) => {
|
|
130
|
+
const stripCount = i === 0 ? contentIndent : Math.min(getIndent(line.text), contentIndent);
|
|
131
|
+
return line.text.slice(stripCount);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paragraph fallback. Owns setext-heading and table detection too: both emerge from
|
|
3
|
+
* paragraph continuation (next-line lookahead), not from their own top-level matchers.
|
|
4
|
+
*/
|
|
5
|
+
import type { ParsedLine } from '../lines';
|
|
6
|
+
import { type BlockOpenerResult } from '../../schema/block-openers';
|
|
7
|
+
export declare function parseParagraph(lines: ParsedLine[], startIndex: number, endIndex: number, leadingTrivia: string): BlockOpenerResult;
|
|
8
|
+
export declare function matchSetextUnderline(text: string): {
|
|
9
|
+
level: 1 | 2;
|
|
10
|
+
} | null;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Paragraph fallback. Owns setext-heading and table detection too: both emerge from
|
|
3
|
+
* paragraph continuation (next-line lookahead), not from their own top-level matchers.
|
|
4
|
+
*/
|
|
5
|
+
import { joinRaw, isBlankLine } from '../parser';
|
|
6
|
+
import { lineInterruptsParagraph } from '../../schema/block-openers';
|
|
7
|
+
import { matchTableDelimiterRow, parseTable, tableHeaderCells } from './table';
|
|
8
|
+
export function parseParagraph(lines, startIndex, endIndex, leadingTrivia) {
|
|
9
|
+
if (startIndex + 1 < endIndex) {
|
|
10
|
+
const delimiter = matchTableDelimiterRow(lines[startIndex + 1].text);
|
|
11
|
+
const header = tableHeaderCells(lines[startIndex].text);
|
|
12
|
+
// GFM §4.10: a header/delimiter count mismatch is no table; accepting it would
|
|
13
|
+
// truncate surplus header cells out of the model.
|
|
14
|
+
if (delimiter && header && header.length === delimiter.columnCount) {
|
|
15
|
+
return parseTable(lines, startIndex, endIndex, leadingTrivia, delimiter);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
let i = startIndex + 1;
|
|
19
|
+
while (i < endIndex && !isBlankLine(lines[i].text) && !lineInterruptsParagraph(lines[i].text)) {
|
|
20
|
+
const setext = matchSetextUnderline(lines[i].text);
|
|
21
|
+
if (setext) {
|
|
22
|
+
const raw = joinRaw(lines, startIndex, i + 1);
|
|
23
|
+
return {
|
|
24
|
+
node: { kind: 'setextHeading', leadingTrivia, raw, metadata: { level: setext.level } },
|
|
25
|
+
consumed: i + 1 - startIndex
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
i++;
|
|
29
|
+
}
|
|
30
|
+
const raw = joinRaw(lines, startIndex, i);
|
|
31
|
+
return {
|
|
32
|
+
node: { kind: 'paragraph', leadingTrivia, raw },
|
|
33
|
+
consumed: i - startIndex
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
export function matchSetextUnderline(text) {
|
|
37
|
+
if (/^ {0,3}=+\s*$/.test(text))
|
|
38
|
+
return { level: 1 };
|
|
39
|
+
if (/^ {0,3}-+\s*$/.test(text))
|
|
40
|
+
return { level: 2 };
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The table's Enter completer: a lone header-shaped row completes into that header, the
|
|
3
|
+
* canonical delimiter row and one empty body row, caret in the first body cell. Registered from
|
|
4
|
+
* `core/parser.ts`, the guaranteed load path the built-in openers already ride.
|
|
5
|
+
*/
|
|
6
|
+
import { type CompletionResult } from '../../schema/block-completions';
|
|
7
|
+
/**
|
|
8
|
+
* A leading pipe on top of the parser's row predicate: prose carries pipes too (`ls | grep foo`),
|
|
9
|
+
* which the scan alone would take as a two-cell header. The predicate stays the outer bound — a
|
|
10
|
+
* row it rejects never completes.
|
|
11
|
+
*/
|
|
12
|
+
export declare function tryCompleteTableRow(line: string): CompletionResult | null;
|
|
13
|
+
export declare function registerTableCompleter(): void;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The table's Enter completer: a lone header-shaped row completes into that header, the
|
|
3
|
+
* canonical delimiter row and one empty body row, caret in the first body cell. Registered from
|
|
4
|
+
* `core/parser.ts`, the guaranteed load path the built-in openers already ride.
|
|
5
|
+
*/
|
|
6
|
+
import { trimTrailingLineEnding } from '../lines';
|
|
7
|
+
import { registerBlockCompleter } from '../../schema/block-completions';
|
|
8
|
+
import { writeTableRow } from '../../schema/container-rebuilders';
|
|
9
|
+
import { tableHeaderCells } from './table';
|
|
10
|
+
// `parseTable` seats the header at child 0 and synthesizes the delimiter from metadata, so the
|
|
11
|
+
// first body row is child 1.
|
|
12
|
+
const FIRST_BODY_CELL = [1, 0];
|
|
13
|
+
/**
|
|
14
|
+
* A leading pipe on top of the parser's row predicate: prose carries pipes too (`ls | grep foo`),
|
|
15
|
+
* which the scan alone would take as a two-cell header. The predicate stays the outer bound — a
|
|
16
|
+
* row it rejects never completes.
|
|
17
|
+
*/
|
|
18
|
+
export function tryCompleteTableRow(line) {
|
|
19
|
+
if (!line.trim().startsWith('|'))
|
|
20
|
+
return null;
|
|
21
|
+
const cells = tableHeaderCells(line);
|
|
22
|
+
if (!cells || cells.length < 2)
|
|
23
|
+
return null;
|
|
24
|
+
return {
|
|
25
|
+
lines: [
|
|
26
|
+
canonicalRow(cells),
|
|
27
|
+
canonicalRow(cells.map(() => '---')),
|
|
28
|
+
canonicalRow(cells.map(() => ''))
|
|
29
|
+
],
|
|
30
|
+
caret: { path: FIRST_BODY_CELL, line: 0, column: 0 }
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
export function registerTableCompleter() {
|
|
34
|
+
registerBlockCompleter('table', { tryComplete: tryCompleteTableRow });
|
|
35
|
+
}
|
|
36
|
+
/** Through the row rebuilder, so minted padding is the padding the serializer emits. The seam
|
|
37
|
+
* owns line endings, so the rebuilder's is trimmed back off. */
|
|
38
|
+
function canonicalRow(cells) {
|
|
39
|
+
const row = {
|
|
40
|
+
kind: 'tableRow',
|
|
41
|
+
leadingTrivia: '',
|
|
42
|
+
raw: '',
|
|
43
|
+
metadata: { isHeader: false },
|
|
44
|
+
children: cells.map((raw) => ({ kind: 'tableCell', leadingTrivia: '', raw }))
|
|
45
|
+
};
|
|
46
|
+
writeTableRow(row, '\n');
|
|
47
|
+
return trimTrailingLineEnding(row.raw);
|
|
48
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TableAlignment } from '../nodes';
|
|
2
|
+
import type { ParsedLine } from '../lines';
|
|
3
|
+
import { type BlockOpenerResult } from '../../schema/block-openers';
|
|
4
|
+
export declare function splitRowCells(rowText: string): string[];
|
|
5
|
+
/**
|
|
6
|
+
* The cells a line offers as a table header row, or null when it offers none — the one home for
|
|
7
|
+
* the shape, so a row the continuation scan accepts and the Enter completer refuses cannot exist.
|
|
8
|
+
* Arity against the delimiter is the caller's check.
|
|
9
|
+
*/
|
|
10
|
+
export declare function tableHeaderCells(text: string): string[] | null;
|
|
11
|
+
export declare function matchTableDelimiterRow(text: string): {
|
|
12
|
+
columnCount: number;
|
|
13
|
+
alignments: TableAlignment[];
|
|
14
|
+
} | null;
|
|
15
|
+
export declare function parseTable(lines: ParsedLine[], startIndex: number, endIndex: number, leadingTrivia: string, delimiter: {
|
|
16
|
+
columnCount: number;
|
|
17
|
+
alignments: TableAlignment[];
|
|
18
|
+
}): BlockOpenerResult;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { joinRaw, isBlankLine } from '../parser';
|
|
2
|
+
import { lineStartsOuterBlock } from '../../schema/block-openers';
|
|
3
|
+
// ── Cell splitter ──────────────────────────────────────────────────────────
|
|
4
|
+
// Cell padding is cosmetic. Pre-edit bytes survive in `table.raw`; post-edit,
|
|
5
|
+
// rebuildTableRowRaw emits canonical single-space padding for every row.
|
|
6
|
+
export function splitRowCells(rowText) {
|
|
7
|
+
const trimmed = rowText.trim();
|
|
8
|
+
const head = trimmed.startsWith('|') ? trimmed.slice(1) : trimmed;
|
|
9
|
+
const inner = head.endsWith('|') ? head.slice(0, -1) : head;
|
|
10
|
+
const cells = [];
|
|
11
|
+
let current = '';
|
|
12
|
+
let escaped = false;
|
|
13
|
+
for (let i = 0; i < inner.length; i++) {
|
|
14
|
+
const ch = inner[i];
|
|
15
|
+
if (ch === '|' && !escaped) {
|
|
16
|
+
cells.push(current.trim());
|
|
17
|
+
current = '';
|
|
18
|
+
continue;
|
|
19
|
+
}
|
|
20
|
+
current += ch;
|
|
21
|
+
escaped = ch === '\\' && !escaped;
|
|
22
|
+
}
|
|
23
|
+
cells.push(current.trim());
|
|
24
|
+
return cells;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The cells a line offers as a table header row, or null when it offers none — the one home for
|
|
28
|
+
* the shape, so a row the continuation scan accepts and the Enter completer refuses cannot exist.
|
|
29
|
+
* Arity against the delimiter is the caller's check.
|
|
30
|
+
*/
|
|
31
|
+
export function tableHeaderCells(text) {
|
|
32
|
+
if (!text.includes('|'))
|
|
33
|
+
return null;
|
|
34
|
+
return splitRowCells(text);
|
|
35
|
+
}
|
|
36
|
+
// ── Delimiter row ──────────────────────────────────────────────────────────
|
|
37
|
+
export function matchTableDelimiterRow(text) {
|
|
38
|
+
const trimmed = text.trim();
|
|
39
|
+
if (!trimmed.includes('|'))
|
|
40
|
+
return null;
|
|
41
|
+
const inner = trimmed.replace(/^\||\|$/g, '');
|
|
42
|
+
const cells = inner.split('|');
|
|
43
|
+
const alignments = [];
|
|
44
|
+
for (const cell of cells) {
|
|
45
|
+
const c = cell.trim();
|
|
46
|
+
if (!/^:?-+:?$/.test(c))
|
|
47
|
+
return null;
|
|
48
|
+
const left = c.startsWith(':');
|
|
49
|
+
const right = c.endsWith(':');
|
|
50
|
+
if (left && right)
|
|
51
|
+
alignments.push('center');
|
|
52
|
+
else if (left)
|
|
53
|
+
alignments.push('left');
|
|
54
|
+
else if (right)
|
|
55
|
+
alignments.push('right');
|
|
56
|
+
else
|
|
57
|
+
alignments.push('none');
|
|
58
|
+
}
|
|
59
|
+
return { columnCount: cells.length, alignments };
|
|
60
|
+
}
|
|
61
|
+
// ── Block parser ───────────────────────────────────────────────────────────
|
|
62
|
+
export function parseTable(lines, startIndex, endIndex, leadingTrivia, delimiter) {
|
|
63
|
+
// GFM: the table breaks at a blank line or the start of another block, so a body row is a
|
|
64
|
+
// pipe-carrying line no opener claims. No paragraph is open here, so nothing is transparent
|
|
65
|
+
// but the definition, which is never a block start.
|
|
66
|
+
let i = startIndex + 2;
|
|
67
|
+
while (i < endIndex &&
|
|
68
|
+
!isBlankLine(lines[i].text) &&
|
|
69
|
+
lines[i].text.includes('|') &&
|
|
70
|
+
!lineStartsOuterBlock(lines[i], { paragraphOpen: false })) {
|
|
71
|
+
i++;
|
|
72
|
+
}
|
|
73
|
+
const rows = [];
|
|
74
|
+
rows.push(buildRow(lines[startIndex], delimiter.columnCount, true));
|
|
75
|
+
for (let r = startIndex + 2; r < i; r++) {
|
|
76
|
+
rows.push(buildRow(lines[r], delimiter.columnCount, false));
|
|
77
|
+
}
|
|
78
|
+
const raw = joinRaw(lines, startIndex, i);
|
|
79
|
+
return {
|
|
80
|
+
node: {
|
|
81
|
+
kind: 'table',
|
|
82
|
+
leadingTrivia,
|
|
83
|
+
raw,
|
|
84
|
+
metadata: { columnCount: delimiter.columnCount, alignments: delimiter.alignments },
|
|
85
|
+
children: rows
|
|
86
|
+
},
|
|
87
|
+
consumed: i - startIndex
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
// GFM pads short BODY rows and truncates long ones to the delimiter column count. The header
|
|
91
|
+
// always matches: a mismatch rejects the whole table at recognition (GFM §4.10, paragraph.ts).
|
|
92
|
+
function buildRow(line, columnCount, isHeader) {
|
|
93
|
+
const cellTexts = splitRowCells(line.text);
|
|
94
|
+
while (cellTexts.length < columnCount)
|
|
95
|
+
cellTexts.push('');
|
|
96
|
+
if (cellTexts.length > columnCount)
|
|
97
|
+
cellTexts.length = columnCount;
|
|
98
|
+
const cells = cellTexts.map((text) => ({
|
|
99
|
+
kind: 'tableCell',
|
|
100
|
+
leadingTrivia: '',
|
|
101
|
+
raw: text
|
|
102
|
+
}));
|
|
103
|
+
return {
|
|
104
|
+
kind: 'tableRow',
|
|
105
|
+
leadingTrivia: '',
|
|
106
|
+
raw: line.raw,
|
|
107
|
+
metadata: { isHeader },
|
|
108
|
+
children: cells
|
|
109
|
+
};
|
|
110
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function matchThematicBreak(text: string): string | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Ambiguity with setext underlines is resolved in paragraph.ts; top-level
|
|
2
|
+
// dispatch only reaches here after a blank line or a non-paragraph state.
|
|
3
|
+
export function matchThematicBreak(text) {
|
|
4
|
+
// CommonMark §4.1: 0-3 columns of indent; 4+ is indented code (tabs advance to the next 4).
|
|
5
|
+
let col = 0;
|
|
6
|
+
for (let i = 0; i < text.length && (text[i] === ' ' || text[i] === '\t'); i++) {
|
|
7
|
+
col += text[i] === '\t' ? 4 - (col % 4) : 1;
|
|
8
|
+
if (col >= 4)
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
const trimmed = text.trim();
|
|
12
|
+
if (/^(\*[ \t]*){3,}$/.test(trimmed))
|
|
13
|
+
return '*';
|
|
14
|
+
if (/^(-[ \t]*){3,}$/.test(trimmed))
|
|
15
|
+
return '-';
|
|
16
|
+
if (/^(_[ \t]*){3,}$/.test(trimmed))
|
|
17
|
+
return '_';
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface Serializable {
|
|
2
|
+
readonly prefix: string;
|
|
3
|
+
readonly children: readonly {
|
|
4
|
+
readonly leadingTrivia: string;
|
|
5
|
+
readonly raw: string;
|
|
6
|
+
}[];
|
|
7
|
+
readonly suffix: string;
|
|
8
|
+
}
|
|
9
|
+
/** The one child-join: container rebuilders and serialize() share it. */
|
|
10
|
+
export declare function concatChildren(children: readonly {
|
|
11
|
+
readonly leadingTrivia: string;
|
|
12
|
+
readonly raw: string;
|
|
13
|
+
}[]): string;
|
|
14
|
+
export declare function serialize(document: Serializable): string;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// Structurally typed so nested containers and readonly node views serialize without a class.
|
|
2
|
+
/** The one child-join: container rebuilders and serialize() share it. */
|
|
3
|
+
export function concatChildren(children) {
|
|
4
|
+
let out = '';
|
|
5
|
+
for (const c of children)
|
|
6
|
+
out += c.leadingTrivia + c.raw;
|
|
7
|
+
return out;
|
|
8
|
+
}
|
|
9
|
+
export function serialize(document) {
|
|
10
|
+
return document.prefix + concatChildren(document.children) + document.suffix;
|
|
11
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
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 declare function escalateTerminatorRun(body: string, minimum: number, closerRun: (text: string, required: number) => number | null): number;
|