@voithos-labs/aragonite 0.10.3 → 0.10.7
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/README.md +2 -2
- package/dist/a11y-strings.d.ts +12 -5
- package/dist/a11y-strings.js +61 -5
- package/dist/action-contracts.d.ts +242 -155
- package/dist/action-contracts.js +2 -2
- package/dist/active-editor.d.ts +3 -3
- package/dist/active-editor.js +8 -9
- package/dist/ambient/ambient-dom.d.ts +2 -5
- package/dist/ambient/ambient-dom.js +16 -62
- package/dist/assert.js +6 -5
- package/dist/block-component.d.ts +135 -109
- package/dist/block-component.js +30 -22
- package/dist/block-id.d.ts +6 -10
- package/dist/block-id.js +25 -14
- package/dist/bounded-memo.d.ts +5 -5
- package/dist/bounded-memo.js +6 -6
- package/dist/components/BlockDragHandle.svelte +13 -20
- package/dist/components/BlockHost.svelte +56 -134
- package/dist/components/BlockList.svelte +22 -19
- package/dist/components/DecorationOverlay.svelte +9 -10
- package/dist/components/DecorationOverlay.svelte.d.ts +2 -2
- package/dist/components/Editor.svelte +619 -1089
- package/dist/components/Editor.svelte.d.ts +9 -20
- package/dist/components/GapCaret.svelte +26 -59
- package/dist/components/SelectionOverlay.svelte +36 -67
- package/dist/components/SelectionOverlay.svelte.d.ts +6 -4
- package/dist/components/TailInsert.svelte +8 -55
- package/dist/components/TailInsert.svelte.d.ts +4 -6
- package/dist/components/block-content-selector.d.ts +11 -11
- package/dist/components/block-content-selector.js +11 -11
- package/dist/components/block-el-lookup.d.ts +6 -0
- package/dist/components/block-el-lookup.js +27 -0
- package/dist/components/blocks/BlockquoteBlock.svelte +3 -3
- package/dist/components/blocks/ThematicBreakBlock.svelte +22 -63
- package/dist/components/blocks/ThematicBreakBlock.svelte.d.ts +0 -2
- package/dist/components/blocks/code/CodeBlock.svelte +255 -276
- package/dist/components/blocks/code/CodeBlock.svelte.d.ts +2 -3
- package/dist/components/blocks/code/CodeBlockRail.svelte +103 -100
- package/dist/components/blocks/code/CodeBlockRail.svelte.d.ts +9 -4
- package/dist/components/blocks/code/code-beforeinput.d.ts +1 -1
- package/dist/components/blocks/code/code-bootstrap.d.ts +3 -5
- package/dist/components/blocks/code/code-bootstrap.js +35 -28
- package/dist/components/blocks/code/code-context-actions.js +5 -4
- package/dist/components/blocks/code/code-enter.js +2 -2
- package/dist/components/blocks/code/code-fence-boundary.d.ts +29 -46
- package/dist/components/blocks/code/code-fence-boundary.js +40 -66
- package/dist/components/blocks/code/code-fence-exit.d.ts +6 -11
- package/dist/components/blocks/code/code-fence-exit.js +24 -25
- package/dist/components/blocks/code/code-indent.d.ts +2 -2
- package/dist/components/blocks/code/code-indent.js +4 -7
- package/dist/components/blocks/code/code-languages.d.ts +16 -12
- package/dist/components/blocks/code/code-languages.js +58 -32
- package/dist/components/blocks/code/code-paste-surface.d.ts +3 -2
- package/dist/components/blocks/code/code-paste-surface.js +9 -18
- package/dist/components/blocks/code/code-renderer.d.ts +21 -5
- package/dist/components/blocks/code/code-renderer.js +90 -125
- package/dist/components/blocks/directive/DirectiveContainerBlock.svelte +5 -8
- package/dist/components/blocks/directive/activate-directives.d.ts +4 -4
- package/dist/components/blocks/directive/activate-directives.js +18 -13
- package/dist/components/blocks/editable-leaf.d.ts +50 -74
- package/dist/components/blocks/editable-leaf.js +144 -202
- package/dist/components/blocks/editable-surface.d.ts +96 -100
- package/dist/components/blocks/editable-surface.js +101 -109
- package/dist/components/blocks/list/ListBlock.svelte +46 -90
- package/dist/components/blocks/list/ListItemBlock.svelte +99 -144
- package/dist/components/blocks/list/ListItemBlock.svelte.d.ts +3 -0
- package/dist/components/blocks/list/task-checkbox.d.ts +5 -2
- package/dist/components/blocks/list/task-checkbox.js +12 -7
- package/dist/components/blocks/plain-text-backend.d.ts +4 -20
- package/dist/components/blocks/plain-text-backend.js +9 -43
- package/dist/components/blocks/surface-wiring.svelte.d.ts +8 -9
- package/dist/components/blocks/surface-wiring.svelte.js +15 -34
- package/dist/components/blocks/table/TableActionMenu.svelte +19 -18
- package/dist/components/blocks/table/TableActionMenu.svelte.d.ts +3 -1
- package/dist/components/blocks/table/TableBlock.svelte +100 -165
- package/dist/components/blocks/table/TableBlock.svelte.d.ts +3 -3
- package/dist/components/blocks/table/TableCellBlock.svelte +307 -385
- package/dist/components/blocks/table/TableCellBlock.svelte.d.ts +1 -0
- package/dist/components/blocks/table/TableRowBlock.svelte +60 -104
- package/dist/components/blocks/table/TableRowBlock.svelte.d.ts +0 -1
- package/dist/components/blocks/table/cell-keydown-plan.d.ts +4 -9
- package/dist/components/blocks/table/cell-keydown-plan.js +8 -12
- package/dist/components/blocks/table/cell-pointer.d.ts +18 -23
- package/dist/components/blocks/table/cell-pointer.js +49 -71
- package/dist/components/blocks/table/cell-render.d.ts +24 -29
- package/dist/components/blocks/table/cell-render.js +29 -31
- package/dist/components/blocks/table/selected-cells.d.ts +7 -7
- package/dist/components/blocks/table/selected-cells.js +9 -13
- package/dist/components/blocks/table/table-caret-at-point.d.ts +4 -4
- package/dist/components/blocks/table/table-caret-at-point.js +5 -5
- package/dist/components/blocks/table/table-cell-paste.d.ts +5 -11
- package/dist/components/blocks/table/table-cell-paste.js +27 -43
- package/dist/components/blocks/table/table-drag-hit-test.js +2 -1
- package/dist/components/blocks/table/table-menu-model.d.ts +4 -8
- package/dist/components/blocks/table/table-menu-model.js +6 -10
- package/dist/components/blocks/table/table-navigation.js +2 -2
- package/dist/components/blocks/text/TextEditableBlock.svelte +392 -310
- package/dist/components/blocks/text/TextEditableBlock.svelte.d.ts +2 -1
- package/dist/components/blocks/text/auto-pair-record.d.ts +23 -0
- package/dist/components/blocks/text/auto-pair-record.js +51 -0
- package/dist/components/blocks/text/click-snap-guard.d.ts +9 -4
- package/dist/components/blocks/text/click-snap-guard.js +16 -5
- package/dist/components/blocks/text/composition-seat.d.ts +17 -14
- package/dist/components/blocks/text/composition-seat.js +11 -11
- package/dist/components/blocks/text/construct-edge-delete.d.ts +20 -20
- package/dist/components/blocks/text/construct-edge-delete.js +50 -65
- package/dist/components/blocks/text/construct-reveal.d.ts +16 -21
- package/dist/components/blocks/text/construct-reveal.js +13 -14
- package/dist/components/blocks/text/delimiter-autopair.d.ts +51 -34
- package/dist/components/blocks/text/delimiter-autopair.js +87 -103
- package/dist/components/blocks/text/edge-policy-dispatch.d.ts +44 -46
- package/dist/components/blocks/text/edge-policy-dispatch.js +164 -180
- package/dist/components/blocks/text/edge-seat.d.ts +17 -26
- package/dist/components/blocks/text/edge-seat.js +43 -70
- package/dist/components/blocks/text/link-at-point.d.ts +9 -9
- package/dist/components/blocks/text/link-at-point.js +12 -15
- package/dist/components/blocks/text/live-join-seam.d.ts +6 -9
- package/dist/components/blocks/text/live-join-seam.js +75 -112
- package/dist/components/blocks/text/live-selection-edit.d.ts +14 -43
- package/dist/components/blocks/text/live-selection-edit.js +32 -105
- package/dist/components/blocks/text/live-split-rebalance.d.ts +9 -13
- package/dist/components/blocks/text/live-split-rebalance.js +50 -67
- package/dist/components/blocks/text/marker-completion.d.ts +7 -12
- package/dist/components/blocks/text/marker-completion.js +17 -10
- package/dist/components/blocks/text/pending-mark-insert.d.ts +11 -18
- package/dist/components/blocks/text/pending-mark-insert.js +30 -49
- package/dist/components/blocks/text/screen-diff.d.ts +5 -15
- package/dist/components/blocks/text/screen-diff.js +5 -19
- package/dist/components/blocks/text/text-clipboard.d.ts +23 -32
- package/dist/components/blocks/text/text-clipboard.js +27 -32
- package/dist/components/blocks/text/text-keydown.d.ts +20 -30
- package/dist/components/blocks/text/text-keydown.js +54 -51
- package/dist/components/blocks/text/text-render.d.ts +25 -35
- package/dist/components/blocks/text/text-render.js +82 -61
- package/dist/components/blocks/text/widget-adjacency.d.ts +9 -9
- package/dist/components/blocks/text/widget-adjacency.js +17 -17
- package/dist/components/blocks/text/widget-interaction.d.ts +67 -43
- package/dist/components/blocks/text/widget-interaction.js +243 -208
- package/dist/components/blocks/widget-portal.d.ts +20 -29
- package/dist/components/blocks/widget-portal.js +16 -14
- package/dist/components/built-in-blocks.d.ts +3 -4
- package/dist/components/built-in-blocks.js +17 -18
- package/dist/components/drag-handle.d.ts +13 -30
- package/dist/components/drag-handle.js +25 -63
- package/dist/components/editor-built-ins.d.ts +1 -0
- package/dist/components/editor-built-ins.js +16 -0
- package/dist/components/editor-root-clipboard.d.ts +6 -6
- package/dist/components/editor-root-clipboard.js +16 -27
- package/dist/components/editor-root-document-swap.d.ts +49 -0
- package/dist/components/editor-root-document-swap.js +54 -0
- package/dist/components/editor-root-focus.d.ts +5 -4
- package/dist/components/editor-root-focus.js +51 -22
- package/dist/components/editor-root-focused-surface.d.ts +35 -0
- package/dist/components/editor-root-focused-surface.js +65 -0
- package/dist/components/editor-root-geometry.d.ts +15 -24
- package/dist/components/editor-root-geometry.js +27 -31
- package/dist/components/editor-root-gestures.d.ts +39 -0
- package/dist/components/editor-root-gestures.js +189 -0
- package/dist/components/editor-root-keydown.d.ts +10 -25
- package/dist/components/editor-root-keydown.js +19 -43
- package/dist/components/editor-root-listeners.d.ts +22 -31
- package/dist/components/editor-root-listeners.js +49 -46
- package/dist/components/editor-root-menus.d.ts +51 -0
- package/dist/components/editor-root-menus.js +147 -0
- package/dist/components/editor-root-mode-flip.d.ts +16 -11
- package/dist/components/editor-root-mode-flip.js +36 -34
- package/dist/components/editor-root-scroll-host.d.ts +22 -0
- package/dist/components/editor-root-scroll-host.js +34 -0
- package/dist/components/editor-root-test-surface.d.ts +48 -0
- package/dist/components/editor-root-test-surface.js +6 -0
- package/dist/components/image/ImageOverlayHost.svelte +44 -35
- package/dist/components/image/ImageOverlayHost.svelte.d.ts +5 -6
- package/dist/components/image/ImageProperties.svelte +37 -41
- package/dist/components/image/ImageProperties.svelte.d.ts +9 -4
- package/dist/components/image/ImageResizeHandles.svelte +26 -30
- package/dist/components/image/image-crop.d.ts +5 -11
- package/dist/components/image/image-crop.js +5 -11
- package/dist/components/image/image-edit-commit.d.ts +19 -16
- package/dist/components/image/image-edit-commit.js +74 -38
- package/dist/components/image/image-resize.d.ts +2 -5
- package/dist/components/image/image-resize.js +3 -6
- package/dist/components/image/image-widget-editing.d.ts +3 -3
- package/dist/components/image/image-widget-editing.js +9 -9
- package/dist/components/image/widget-dom.d.ts +2 -3
- package/dist/components/image/widget-dom.js +19 -24
- package/dist/components/image/widget-selection-state.svelte.d.ts +10 -11
- package/dist/components/image/widget-selection-state.svelte.js +26 -19
- package/dist/components/kind-cue.svelte.d.ts +21 -0
- package/dist/components/kind-cue.svelte.js +35 -0
- package/dist/components/link-card/LinkCard.svelte +115 -64
- package/dist/components/link-card/LinkCard.svelte.d.ts +7 -5
- package/dist/components/link-card/LinkCardHost.svelte +42 -33
- package/dist/components/link-card/LinkCardHost.svelte.d.ts +10 -8
- package/dist/components/link-card/link-card-commit.d.ts +16 -19
- package/dist/components/link-card/link-card-commit.js +21 -30
- package/dist/components/link-card/link-card-entry.d.ts +13 -23
- package/dist/components/link-card/link-card-entry.js +16 -24
- package/dist/components/link-card/link-card-state.svelte.d.ts +17 -21
- package/dist/components/link-card/link-card-state.svelte.js +2 -2
- package/dist/components/lrd-map-gate.d.ts +4 -11
- package/dist/components/lrd-map-gate.js +5 -11
- package/dist/components/menu/BlockMenu.svelte +20 -81
- package/dist/components/menu/BlockMenu.svelte.d.ts +11 -9
- package/dist/components/menu/InlineMenuHost.svelte +191 -0
- package/dist/components/menu/InlineMenuHost.svelte.d.ts +13 -0
- package/dist/components/menu/MenuIcon.svelte +3 -103
- package/dist/components/menu/MenuIcon.svelte.d.ts +2 -44
- package/dist/components/menu/SelectionToolbar.svelte +380 -0
- package/dist/components/menu/SelectionToolbar.svelte.d.ts +14 -0
- package/dist/components/menu/clipboard-actions.d.ts +3 -4
- package/dist/components/menu/clipboard-actions.js +3 -4
- package/dist/components/menu/default-context-actions.d.ts +4 -13
- package/dist/components/menu/default-context-actions.js +49 -67
- package/dist/components/menu/flyout-placement.d.ts +2 -2
- package/dist/components/menu/flyout-placement.js +2 -2
- package/dist/components/menu/menu-presence.svelte.d.ts +12 -0
- package/dist/components/menu/menu-presence.svelte.js +19 -0
- package/dist/components/paste-image-arm.d.ts +6 -11
- package/dist/components/paste-image-arm.js +11 -18
- package/dist/components/portal.d.ts +2 -5
- package/dist/components/portal.js +4 -7
- package/dist/core/directive/activate.d.ts +4 -5
- package/dist/core/directive/activate.js +8 -9
- package/dist/core/directive/container-opener.js +13 -12
- package/dist/core/directive/grammar.d.ts +2 -5
- package/dist/core/directive/grammar.js +10 -10
- package/dist/core/directive/kinds.d.ts +4 -7
- package/dist/core/directive/kinds.js +14 -16
- package/dist/core/directive/registry.d.ts +12 -9
- package/dist/core/directive/registry.js +19 -20
- package/dist/core/directive/text-recognizer.d.ts +3 -2
- package/dist/core/directive/text-recognizer.js +5 -9
- package/dist/core/escapable.d.ts +1 -5
- package/dist/core/escapable.js +1 -5
- package/dist/core/inline/backticks.d.ts +3 -4
- package/dist/core/inline/backticks.js +3 -4
- package/dist/core/inline/character-refs.js +2 -1
- package/dist/core/inline/destination-bytes.d.ts +6 -3
- package/dist/core/inline/destination-bytes.js +50 -8
- package/dist/core/inline/entity-widget.d.ts +4 -3
- package/dist/core/inline/entity-widget.js +6 -6
- package/dist/core/inline/format-toggle.d.ts +22 -28
- package/dist/core/inline/format-toggle.js +97 -129
- package/dist/core/inline/html-entities.d.ts +2 -3
- package/dist/core/inline/html-entities.js +2 -3
- package/dist/core/inline/html-tag-grammar.js +6 -2
- package/dist/core/inline/image-dimensions.d.ts +2 -0
- package/dist/core/inline/image-dimensions.js +19 -2
- package/dist/core/inline/image-source-bytes.d.ts +11 -0
- package/dist/core/inline/image-source-bytes.js +71 -0
- package/dist/core/inline/index.d.ts +28 -21
- package/dist/core/inline/index.js +56 -34
- package/dist/core/inline/inline-cache.d.ts +12 -15
- package/dist/core/inline/inline-cache.js +11 -14
- package/dist/core/inline/inline-widgets.d.ts +55 -68
- package/dist/core/inline/inline-widgets.js +55 -58
- package/dist/core/inline/link-destination.d.ts +31 -0
- package/dist/core/inline/link-destination.js +129 -0
- package/dist/core/inline/link-reference-resolver.d.ts +8 -6
- package/dist/core/inline/link-reference-resolver.js +10 -6
- package/dist/core/inline/link-source-bytes.d.ts +31 -0
- package/dist/{components/blocks/text → core/inline}/link-source-bytes.js +43 -54
- package/dist/core/inline/live-edit/read-back.d.ts +29 -0
- package/dist/core/inline/live-edit/read-back.js +50 -0
- package/dist/core/inline/picture.d.ts +10 -0
- package/dist/core/inline/picture.js +40 -0
- package/dist/core/inline/scan/autolinks.d.ts +7 -8
- package/dist/core/inline/scan/autolinks.js +80 -59
- package/dist/core/inline/scan/brackets.d.ts +2 -2
- package/dist/core/inline/scan/brackets.js +6 -103
- package/dist/core/inline/scan/code-spans.d.ts +4 -0
- package/dist/core/inline/scan/code-spans.js +8 -0
- package/dist/core/inline/scan/emphasis.js +10 -14
- package/dist/core/inline/scan/index.d.ts +3 -1
- package/dist/core/inline/scan/index.js +32 -33
- package/dist/core/inline/scan/plugin-syntax.d.ts +28 -36
- package/dist/core/inline/scan/plugin-syntax.js +75 -89
- package/dist/core/inline/scan/scan-state.d.ts +2 -0
- package/dist/core/inline/scan/scan-state.js +1 -0
- package/dist/core/inline/scan/simple-nodes.d.ts +2 -5
- package/dist/core/inline/scan/simple-nodes.js +2 -5
- package/dist/core/inline/scan/triggers.d.ts +17 -0
- package/dist/core/inline/scan/triggers.js +26 -0
- package/dist/core/inline/scan/url.js +8 -10
- package/dist/core/inline/transparency.d.ts +2 -1
- package/dist/core/inline/transparency.js +33 -17
- package/dist/core/inline/visibility.d.ts +30 -49
- package/dist/core/inline/visibility.js +31 -49
- package/dist/core/inline/walk.d.ts +4 -10
- package/dist/core/inline/walk.js +4 -10
- package/dist/core/inline-render.d.ts +22 -27
- package/dist/core/inline-render.js +51 -60
- package/dist/core/lines.d.ts +67 -26
- package/dist/core/lines.js +164 -33
- package/dist/core/metadata-parity.d.ts +9 -0
- package/dist/core/metadata-parity.js +25 -0
- package/dist/core/node-views.d.ts +7 -6
- package/dist/core/node-views.js +5 -5
- package/dist/core/nodes.d.ts +34 -44
- package/dist/core/nodes.js +4 -12
- package/dist/core/parser.d.ts +27 -34
- package/dist/core/parser.js +53 -67
- package/dist/core/parsers/blockquote.d.ts +5 -8
- package/dist/core/parsers/blockquote.js +11 -10
- package/dist/core/parsers/built-in-openers.d.ts +2 -5
- package/dist/core/parsers/built-in-openers.js +5 -8
- package/dist/core/parsers/fence-syntax.d.ts +36 -7
- package/dist/core/parsers/fence-syntax.js +61 -11
- package/dist/core/parsers/fenced-code.d.ts +16 -0
- package/dist/core/parsers/fenced-code.js +16 -15
- package/dist/core/parsers/heading.d.ts +19 -2
- package/dist/core/parsers/heading.js +50 -2
- package/dist/core/parsers/html-block.d.ts +3 -6
- package/dist/core/parsers/html-block.js +10 -11
- package/dist/core/parsers/indented-code.d.ts +1 -1
- package/dist/core/parsers/indented-code.js +2 -8
- package/dist/core/parsers/link-reference.d.ts +5 -3
- package/dist/core/parsers/link-reference.js +116 -120
- package/dist/core/parsers/list.d.ts +12 -5
- package/dist/core/parsers/list.js +53 -36
- package/dist/core/parsers/paragraph.d.ts +3 -3
- package/dist/core/parsers/paragraph.js +14 -5
- package/dist/core/parsers/table-completion.d.ts +2 -5
- package/dist/core/parsers/table-completion.js +7 -10
- package/dist/core/parsers/table.d.ts +8 -8
- package/dist/core/parsers/table.js +23 -26
- package/dist/core/parsers/thematic-break.js +15 -14
- package/dist/core/paths.d.ts +13 -0
- package/dist/core/paths.js +31 -0
- package/dist/core/terminator-escalation.d.ts +0 -7
- package/dist/core/terminator-escalation.js +5 -8
- package/dist/core/url-policy.d.ts +2 -5
- package/dist/core/url-policy.js +8 -12
- package/dist/cursor/caret-memory.d.ts +34 -0
- package/dist/cursor/caret-memory.js +82 -0
- package/dist/cursor/coordinate-spaces.d.ts +26 -19
- package/dist/cursor/coordinate-spaces.js +32 -20
- package/dist/cursor/dom-walk.d.ts +7 -13
- package/dist/cursor/dom-walk.js +7 -13
- package/dist/cursor/edge-affinity.d.ts +7 -35
- package/dist/cursor/edge-affinity.js +13 -44
- package/dist/cursor/focused-caret.d.ts +6 -8
- package/dist/cursor/focused-caret.js +7 -16
- package/dist/cursor/height-model.d.ts +3 -3
- package/dist/cursor/height-model.js +5 -5
- package/dist/cursor/height-oracle.d.ts +10 -7
- package/dist/cursor/height-oracle.js +26 -75
- package/dist/cursor/observe-resize.d.ts +13 -0
- package/dist/cursor/observe-resize.js +43 -0
- package/dist/cursor/overlay-rects.d.ts +2 -5
- package/dist/cursor/overlay-rects.js +2 -5
- package/dist/cursor/overlay-remeasure.d.ts +6 -7
- package/dist/cursor/overlay-remeasure.js +10 -14
- package/dist/cursor/pending-marks.d.ts +7 -9
- package/dist/cursor/pending-marks.js +6 -27
- package/dist/cursor/point-offset.d.ts +16 -10
- package/dist/cursor/point-offset.js +60 -25
- package/dist/cursor/reveal-source.d.ts +7 -11
- package/dist/cursor/reveal-source.js +10 -18
- package/dist/cursor/scroll-ancestors.d.ts +9 -20
- package/dist/cursor/scroll-ancestors.js +14 -26
- package/dist/cursor/scroll-owner.d.ts +92 -0
- package/dist/cursor/scroll-owner.js +283 -0
- package/dist/cursor/scrollport.d.ts +16 -8
- package/dist/cursor/scrollport.js +28 -5
- package/dist/cursor/sticky-column.d.ts +6 -29
- package/dist/cursor/sticky-column.js +6 -49
- package/dist/cursor/sticky-measure.d.ts +14 -9
- package/dist/cursor/sticky-measure.js +99 -49
- package/dist/cursor/surface-backend.d.ts +41 -0
- package/dist/cursor/surface-backend.js +78 -0
- package/dist/cursor/typography-estimates.d.ts +3 -3
- package/dist/cursor/typography-estimates.js +3 -3
- package/dist/cursor/visual-lines.d.ts +25 -13
- package/dist/cursor/visual-lines.js +72 -28
- package/dist/cursor/widget-edge-snap.d.ts +23 -0
- package/dist/cursor/widget-edge-snap.js +39 -0
- package/dist/cursor/widget-offset.d.ts +111 -102
- package/dist/cursor/widget-offset.js +352 -177
- package/dist/debug/diagnostics-report.d.ts +6 -6
- package/dist/debug/diagnostics-report.js +5 -5
- package/dist/debug/dump-tree.js +2 -2
- package/dist/debug/editor-diagnostics.d.ts +15 -0
- package/dist/debug/editor-diagnostics.js +33 -0
- package/dist/debug/inspect.d.ts +2 -2
- package/dist/debug/inspect.js +4 -4
- package/dist/debug/interaction-trace.d.ts +14 -15
- package/dist/debug/interaction-trace.js +19 -20
- package/dist/debug/operations-log.d.ts +1 -1
- package/dist/debug/operations-log.js +1 -1
- package/dist/decorations/buckets.d.ts +6 -12
- package/dist/decorations/buckets.js +4 -11
- package/dist/decorations/decoration-state.svelte.d.ts +2 -3
- package/dist/decorations/decoration-state.svelte.js +24 -26
- package/dist/decorations/island-dom.d.ts +10 -18
- package/dist/decorations/island-dom.js +25 -50
- package/dist/decorations/reserved-attrs.d.ts +6 -8
- package/dist/decorations/reserved-attrs.js +31 -17
- package/dist/decorations/types.d.ts +6 -7
- package/dist/decorations/types.js +2 -1
- package/dist/decorations/use-block-decorations.svelte.d.ts +19 -0
- package/dist/decorations/use-block-decorations.svelte.js +71 -0
- package/dist/decorations/widget-dom.d.ts +3 -3
- package/dist/decorations/widget-dom.js +5 -5
- package/dist/dev-warn.d.ts +5 -2
- package/dist/dev-warn.js +16 -4
- package/dist/editor-actions/ancestry-folds.d.ts +9 -14
- package/dist/editor-actions/ancestry-folds.js +13 -18
- package/dist/editor-actions/block-edit-core.d.ts +49 -22
- package/dist/editor-actions/block-edit-core.js +279 -151
- package/dist/editor-actions/block-edit-scope.d.ts +63 -50
- package/dist/editor-actions/block-edit-scope.js +100 -48
- package/dist/editor-actions/block-edit.d.ts +2 -3
- package/dist/editor-actions/block-edit.js +14 -90
- package/dist/editor-actions/commit/history.d.ts +4 -4
- package/dist/editor-actions/commit/history.js +33 -34
- package/dist/editor-actions/commit/reading-write-gate.d.ts +18 -0
- package/dist/editor-actions/commit/reading-write-gate.js +56 -0
- package/dist/editor-actions/commit/text-batch.d.ts +7 -11
- package/dist/editor-actions/commit/text-batch.js +6 -7
- package/dist/editor-actions/commit/undo-controller.d.ts +6 -4
- package/dist/editor-actions/commit/undo-controller.js +346 -216
- package/dist/editor-actions/container-block-component.d.ts +32 -51
- package/dist/editor-actions/container-block-component.js +66 -92
- package/dist/editor-actions/container-edit.d.ts +4 -2
- package/dist/editor-actions/container-edit.js +14 -44
- package/dist/editor-actions/container-exit-overrides.d.ts +6 -4
- package/dist/editor-actions/container-exit-overrides.js +19 -21
- package/dist/editor-actions/deps.d.ts +25 -32
- package/dist/editor-actions/enter-completion.d.ts +12 -15
- package/dist/editor-actions/enter-completion.js +49 -51
- package/dist/editor-actions/focus/focus-dispatch.d.ts +24 -25
- package/dist/editor-actions/focus/focus-dispatch.js +33 -52
- package/dist/editor-actions/focus/focus-landing.d.ts +11 -5
- package/dist/editor-actions/focus/focus-landing.js +29 -14
- package/dist/editor-actions/focus/focus.d.ts +3 -2
- package/dist/editor-actions/focus/focus.js +42 -59
- package/dist/editor-actions/index.d.ts +4 -3
- package/dist/editor-actions/index.js +5 -4
- package/dist/editor-actions/inline-range-commit.d.ts +18 -16
- package/dist/editor-actions/inline-range-commit.js +45 -54
- package/dist/editor-actions/leaf-write.d.ts +11 -0
- package/dist/editor-actions/leaf-write.js +102 -0
- package/dist/editor-actions/list-context.d.ts +9 -10
- package/dist/editor-actions/list-context.js +115 -110
- package/dist/editor-actions/list-overrides.d.ts +13 -5
- package/dist/editor-actions/list-overrides.js +36 -12
- package/dist/editor-actions/merge-fallback.d.ts +10 -16
- package/dist/editor-actions/merge-fallback.js +11 -22
- package/dist/editor-actions/nested/container-actions.d.ts +37 -0
- package/dist/editor-actions/nested/container-actions.js +42 -0
- package/dist/editor-actions/nested/emptied-container.d.ts +5 -0
- package/dist/editor-actions/nested/emptied-container.js +5 -0
- package/dist/editor-actions/nested/nested-actions.d.ts +22 -25
- package/dist/editor-actions/nested/nested-actions.js +17 -15
- package/dist/editor-actions/nested/nested-block-edit.d.ts +3 -4
- package/dist/editor-actions/nested/nested-block-edit.js +40 -134
- package/dist/editor-actions/nested/nested-focus.d.ts +2 -3
- package/dist/editor-actions/nested/nested-focus.js +33 -21
- package/dist/editor-actions/paste-coordinator.d.ts +3 -2
- package/dist/editor-actions/paste-coordinator.js +17 -13
- package/dist/editor-actions/plugin/chrome-leaf.d.ts +11 -9
- package/dist/editor-actions/plugin/chrome-leaf.js +14 -13
- package/dist/editor-actions/plugin/container.d.ts +55 -76
- package/dist/editor-actions/plugin/container.js +105 -186
- package/dist/editor-actions/plugin/directive-container.d.ts +4 -4
- package/dist/editor-actions/plugin/directive-container.js +7 -8
- package/dist/editor-actions/reorder-action.d.ts +7 -12
- package/dist/editor-actions/reorder-action.js +32 -48
- package/dist/editor-actions/reorder-drag.d.ts +12 -8
- package/dist/editor-actions/reorder-drag.js +45 -41
- package/dist/editor-actions/replacement-focus.d.ts +13 -21
- package/dist/editor-actions/replacement-focus.js +32 -33
- package/dist/editor-actions/search-replace.js +71 -67
- package/dist/editor-actions/stored-caret.d.ts +7 -0
- package/dist/editor-actions/stored-caret.js +10 -0
- package/dist/editor-actions/table-context.d.ts +9 -11
- package/dist/editor-actions/table-context.js +70 -93
- package/dist/editor-actions/unwrap-strategies.d.ts +4 -5
- package/dist/editor-actions/unwrap-strategies.js +52 -63
- package/dist/editor-actions/whole-block-focus-surface.d.ts +19 -28
- package/dist/editor-actions/whole-block-focus-surface.js +43 -53
- package/dist/editor-events.d.ts +25 -29
- package/dist/editor-events.js +17 -28
- package/dist/editor-keys.d.ts +96 -104
- package/dist/editor-keys.js +11 -24
- package/dist/editor-props.d.ts +91 -71
- package/dist/editor-rects.d.ts +23 -34
- package/dist/editor-rects.js +9 -77
- package/dist/env.d.ts +6 -4
- package/dist/env.js +8 -4
- package/dist/index.d.ts +6 -2
- package/dist/index.js +5 -2
- package/dist/inline-menu/inline-menu-session.d.ts +37 -0
- package/dist/inline-menu/inline-menu-session.js +98 -0
- package/dist/inline-menu/inline-menu-state.svelte.d.ts +63 -0
- package/dist/inline-menu/inline-menu-state.svelte.js +409 -0
- package/dist/inline-menu/types.d.ts +77 -0
- package/dist/inline-menu/types.js +7 -0
- package/dist/invariants/child-id-parity.d.ts +23 -0
- package/dist/invariants/child-id-parity.js +39 -0
- package/dist/invariants/commit-paths.d.ts +4 -4
- package/dist/invariants/commit-paths.js +4 -4
- package/dist/invariants/commit-scope.d.ts +4 -4
- package/dist/invariants/commit-scope.js +9 -8
- package/dist/invariants/context-keys.d.ts +2 -5
- package/dist/invariants/context-keys.js +3 -6
- package/dist/invariants/descriptor.d.ts +2 -6
- package/dist/invariants/descriptor.js +2 -6
- package/dist/invariants/inline-transitions.d.ts +9 -16
- package/dist/invariants/inline-transitions.js +10 -18
- package/dist/invariants/install.d.ts +18 -27
- package/dist/invariants/install.js +29 -30
- package/dist/invariants/keeps-a-block.d.ts +7 -0
- package/dist/invariants/keeps-a-block.js +14 -0
- package/dist/invariants/landable-caret.d.ts +5 -7
- package/dist/invariants/landable-caret.js +8 -11
- package/dist/invariants/landing-focus-scroll.d.ts +7 -0
- package/dist/invariants/landing-focus-scroll.js +13 -0
- package/dist/invariants/landing-value.d.ts +13 -0
- package/dist/invariants/landing-value.js +27 -0
- package/dist/invariants/marker-css-parity.d.ts +5 -6
- package/dist/invariants/marker-css-parity.js +11 -12
- package/dist/invariants/measures-in-own-list.d.ts +6 -0
- package/dist/invariants/measures-in-own-list.js +13 -0
- package/dist/invariants/node-shape.d.ts +18 -37
- package/dist/invariants/node-shape.js +123 -79
- package/dist/invariants/open-tail.d.ts +7 -0
- package/dist/invariants/open-tail.js +45 -0
- package/dist/invariants/placement-ends-widget.d.ts +8 -0
- package/dist/invariants/placement-ends-widget.js +13 -0
- package/dist/invariants/registry.d.ts +27 -66
- package/dist/invariants/registry.js +61 -137
- package/dist/invariants/render-fidelity.d.ts +4 -4
- package/dist/invariants/render-fidelity.js +5 -5
- package/dist/invariants/selection-endpoints.d.ts +6 -7
- package/dist/invariants/selection-endpoints.js +18 -16
- package/dist/invariants/single-node-sink.d.ts +4 -5
- package/dist/invariants/single-node-sink.js +4 -5
- package/dist/invariants/snapshot-integrity.d.ts +5 -6
- package/dist/invariants/snapshot-integrity.js +1 -1
- package/dist/invariants/structural-descriptor.d.ts +6 -15
- package/dist/invariants/structural-descriptor.js +6 -15
- package/dist/menu-icons.d.ts +47 -0
- package/dist/menu-icons.js +113 -0
- package/dist/perf/instruments.d.ts +20 -5
- package/dist/perf/instruments.js +35 -15
- package/dist/perf/use-mount-gauge.svelte.js +4 -4
- package/dist/plugin.d.ts +38 -8
- package/dist/plugin.js +102 -74
- package/dist/plugins/admonitions/AdmonitionBlock.svelte +14 -11
- package/dist/plugins/admonitions/admonition-kind.js +12 -10
- package/dist/plugins/admonitions/convert-document.d.ts +5 -5
- package/dist/plugins/admonitions/convert-document.js +8 -7
- package/dist/plugins/admonitions/gh-alert.d.ts +8 -1
- package/dist/plugins/admonitions/gh-alert.js +21 -22
- package/dist/plugins/admonitions/github-alert-kind.d.ts +5 -7
- package/dist/plugins/admonitions/github-alert-kind.js +28 -37
- package/dist/plugins/admonitions/index.js +2 -2
- package/dist/plugins/admonitions/kinds.d.ts +1 -1
- package/dist/plugins/admonitions/register.js +11 -2
- package/dist/plugins/details/DetailsBlock.svelte +20 -20
- package/dist/plugins/details/details-disclosure.svelte.d.ts +5 -6
- package/dist/plugins/details/details-disclosure.svelte.js +6 -7
- package/dist/plugins/details/details-kind.d.ts +6 -7
- package/dist/plugins/details/details-kind.js +44 -59
- package/dist/plugins/emoji/emoji-recognizer.d.ts +4 -7
- package/dist/plugins/emoji/emoji-recognizer.js +7 -14
- package/dist/plugins/footnotes/FootnoteDefinition.svelte +33 -16
- package/dist/plugins/footnotes/FootnoteReference.svelte +39 -19
- package/dist/plugins/footnotes/constants.d.ts +2 -0
- package/dist/plugins/footnotes/constants.js +3 -0
- package/dist/plugins/footnotes/footnote-definition.d.ts +8 -6
- package/dist/plugins/footnotes/footnote-definition.js +69 -45
- package/dist/plugins/footnotes/footnote-lookup.d.ts +3 -3
- package/dist/plugins/footnotes/footnote-lookup.js +14 -26
- package/dist/plugins/footnotes/footnote-numbering.d.ts +11 -11
- package/dist/plugins/footnotes/footnote-numbering.js +22 -31
- package/dist/plugins/footnotes/footnote-reference.d.ts +4 -4
- package/dist/plugins/footnotes/footnote-reference.js +8 -13
- package/dist/plugins/footnotes/index.js +2 -3
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.d.ts +5 -8
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.js +8 -3
- package/dist/plugins/highlight-occurrences/occurrence-source.d.ts +10 -12
- package/dist/plugins/highlight-occurrences/occurrence-source.js +21 -18
- package/dist/plugins/highlight-occurrences/occurrences.d.ts +11 -11
- package/dist/plugins/highlight-occurrences/occurrences.js +14 -36
- package/dist/plugins/highlight-occurrences/word-char.d.ts +1 -0
- package/dist/plugins/highlight-occurrences/word-char.js +4 -0
- package/dist/plugins/latex/BlockMath.svelte +58 -75
- package/dist/plugins/latex/BlockMath.svelte.d.ts +2 -4
- package/dist/plugins/latex/MathInline.svelte +10 -9
- package/dist/plugins/latex/flanking.d.ts +1 -0
- package/dist/plugins/latex/flanking.js +3 -0
- package/dist/plugins/latex/index.d.ts +1 -1
- package/dist/plugins/latex/latex-kind.d.ts +4 -4
- package/dist/plugins/latex/latex-kind.js +113 -85
- package/dist/plugins/latex/math-completion.d.ts +1 -1
- package/dist/plugins/latex/math-completion.js +5 -8
- package/dist/plugins/latex/math-layout.d.ts +2 -8
- package/dist/plugins/latex/math-layout.js +0 -9
- package/dist/plugins/latex/math-renderer.d.ts +17 -20
- package/dist/plugins/latex/math-renderer.js +21 -38
- package/dist/plugins/latex/math-source.d.ts +4 -8
- package/dist/plugins/latex/math-source.js +36 -75
- package/dist/plugins/latex/register.d.ts +10 -11
- package/dist/plugins/latex/register.js +24 -10
- package/dist/plugins/latex/renderer.d.ts +9 -10
- package/dist/plugins/latex/renderer.js +9 -24
- package/dist/plugins/mermaid/MermaidBlock.svelte +63 -47
- package/dist/plugins/mermaid/index.js +1 -1
- package/dist/plugins/mermaid/mermaid-kind.d.ts +4 -7
- package/dist/plugins/mermaid/mermaid-kind.js +30 -47
- package/dist/plugins/mermaid/mermaid-renderer.d.ts +9 -16
- package/dist/plugins/mermaid/mermaid-renderer.js +12 -31
- package/dist/plugins/mermaid/register.d.ts +3 -3
- package/dist/plugins/mermaid/register.js +5 -5
- package/dist/plugins/mermaid/renderer.d.ts +5 -5
- package/dist/plugins/mermaid/renderer.js +8 -11
- package/dist/plugins/parrot/ParrotBlock.svelte +18 -7
- package/dist/plugins/parrot/ParrotBlock.svelte.d.ts +2 -2
- package/dist/plugins/parrot/parrot-plugin.js +3 -3
- package/dist/plugins/slash-commands/filter.d.ts +23 -0
- package/dist/plugins/slash-commands/filter.js +31 -0
- package/dist/plugins/slash-commands/index.d.ts +2 -0
- package/dist/plugins/slash-commands/index.js +2 -0
- package/dist/plugins/slash-commands/slash-commands-plugin.d.ts +12 -0
- package/dist/plugins/slash-commands/slash-commands-plugin.js +40 -0
- package/dist/plugins/slash-commands/slash-source.d.ts +36 -0
- package/dist/plugins/slash-commands/slash-source.js +108 -0
- package/dist/plugins/toc/TocBlock.svelte +23 -22
- package/dist/plugins/toc/TocBlock.svelte.d.ts +2 -3
- package/dist/plugins/toc/heading-outline.d.ts +7 -12
- package/dist/plugins/toc/heading-outline.js +22 -36
- package/dist/plugins/toc/navigation-queue.d.ts +2 -4
- package/dist/plugins/toc/toc-plugin.d.ts +5 -5
- package/dist/plugins/toc/toc-plugin.js +20 -13
- package/dist/presentation-mode.d.ts +15 -23
- package/dist/presentation-mode.js +19 -25
- package/dist/reactivity/block-list-state.svelte.d.ts +9 -11
- package/dist/reactivity/block-list-state.svelte.js +8 -9
- package/dist/reactivity/block-window.svelte.d.ts +12 -6
- package/dist/reactivity/block-window.svelte.js +44 -17
- package/dist/reactivity/child-list.d.ts +34 -0
- package/dist/reactivity/child-list.js +48 -0
- package/dist/reactivity/content-version.svelte.d.ts +4 -7
- package/dist/reactivity/content-version.svelte.js +3 -5
- package/dist/reactivity/hold-across.d.ts +39 -0
- package/dist/reactivity/hold-across.js +57 -0
- package/dist/reactivity/layout-state.svelte.d.ts +27 -0
- package/dist/reactivity/layout-state.svelte.js +51 -0
- package/dist/reactivity/list-tree.d.ts +39 -0
- package/dist/reactivity/list-tree.js +132 -0
- package/dist/reactivity/list-windowing.svelte.d.ts +50 -71
- package/dist/reactivity/list-windowing.svelte.js +143 -292
- package/dist/reactivity/measure-batch.d.ts +6 -8
- package/dist/reactivity/measure-batch.js +5 -6
- package/dist/reactivity/publish-ref.svelte.d.ts +16 -41
- package/dist/reactivity/publish-ref.svelte.js +21 -85
- package/dist/reactivity/scope-geometry.d.ts +6 -13
- package/dist/reactivity/scope-geometry.js +7 -14
- package/dist/reactivity/state-registry.d.ts +5 -5
- package/dist/reactivity/state-registry.js +11 -15
- package/dist/reactivity/use-container-windowing.svelte.d.ts +13 -26
- package/dist/reactivity/use-container-windowing.svelte.js +64 -74
- package/dist/reactivity/use-measured-child.svelte.d.ts +10 -0
- package/dist/reactivity/use-measured-child.svelte.js +41 -0
- package/dist/reactivity/use-window-floor.svelte.d.ts +2 -0
- package/dist/reactivity/use-window-floor.svelte.js +27 -0
- package/dist/reactivity/window-slice.d.ts +4 -4
- package/dist/reactivity/window-slice.js +0 -2
- package/dist/renderer-slot.d.ts +48 -0
- package/dist/renderer-slot.js +85 -0
- package/dist/scan-index.d.ts +4 -4
- package/dist/scan-index.js +4 -4
- package/dist/schema/block-commands.d.ts +69 -54
- package/dist/schema/block-commands.js +91 -104
- package/dist/schema/block-completions.d.ts +16 -19
- package/dist/schema/block-completions.js +25 -32
- package/dist/schema/block-component-registry.d.ts +13 -14
- package/dist/schema/block-component-registry.js +19 -17
- package/dist/schema/block-kind-descriptor.d.ts +234 -168
- package/dist/schema/block-kind-descriptor.js +151 -66
- package/dist/schema/block-openers.d.ts +48 -39
- package/dist/schema/block-openers.js +73 -83
- package/dist/schema/built-in-descriptors.d.ts +3 -5
- package/dist/schema/built-in-descriptors.js +96 -80
- package/dist/schema/child-spans.d.ts +12 -10
- package/dist/schema/child-spans.js +68 -34
- package/dist/schema/closure.d.ts +18 -16
- package/dist/schema/closure.js +24 -14
- package/dist/schema/command-id.d.ts +6 -8
- package/dist/schema/command-id.js +20 -25
- package/dist/schema/commands.d.ts +79 -81
- package/dist/schema/commands.js +156 -116
- package/dist/schema/container-raw.d.ts +51 -11
- package/dist/schema/container-raw.js +143 -14
- package/dist/schema/container-rebuilders.d.ts +17 -15
- package/dist/schema/container-rebuilders.js +30 -22
- package/dist/schema/context-actions.d.ts +25 -13
- package/dist/schema/context-actions.js +32 -17
- package/dist/schema/define-plugin-block.d.ts +8 -6
- package/dist/schema/define-plugin-block.js +6 -4
- package/dist/schema/fenced-code-raw.d.ts +30 -17
- package/dist/schema/fenced-code-raw.js +155 -107
- package/dist/schema/global-commands.d.ts +6 -6
- package/dist/schema/global-commands.js +14 -22
- package/dist/schema/height-estimates.d.ts +31 -0
- package/dist/schema/height-estimates.js +64 -0
- package/dist/schema/inline-construct-policy.d.ts +42 -55
- package/dist/schema/inline-construct-policy.js +36 -35
- package/dist/schema/insert-catalogue.d.ts +30 -0
- package/dist/schema/insert-catalogue.js +95 -0
- package/dist/schema/keybinding-overrides.d.ts +9 -11
- package/dist/schema/keybinding-overrides.js +1 -1
- package/dist/schema/keybindings.d.ts +15 -7
- package/dist/schema/keybindings.js +21 -9
- package/dist/schema/merge-rules.d.ts +5 -7
- package/dist/schema/merge-rules.js +7 -9
- package/dist/schema/opener-priorities.d.ts +4 -4
- package/dist/schema/opener-priorities.js +4 -4
- package/dist/schema/operations.d.ts +9 -11
- package/dist/schema/operations.js +3 -3
- package/dist/schema/page-role.d.ts +14 -0
- package/dist/schema/page-role.js +19 -0
- package/dist/schema/plugin-activation.d.ts +4 -6
- package/dist/schema/plugin-activation.js +12 -10
- package/dist/schema/plugin-editor-context.d.ts +25 -10
- package/dist/schema/plugin-editor-context.js +40 -9
- package/dist/schema/plugin-install.d.ts +49 -17
- package/dist/schema/plugin-install.js +51 -25
- package/dist/schema/plugin-kind.d.ts +12 -8
- package/dist/schema/plugin-kind.js +35 -42
- package/dist/schema/plugin-name.js +3 -3
- package/dist/schema/plugin-registry.d.ts +54 -0
- package/dist/schema/plugin-registry.js +70 -0
- package/dist/schema/reading.d.ts +23 -0
- package/dist/schema/reading.js +7 -0
- package/dist/schema/register-once.d.ts +3 -5
- package/dist/schema/register-once.js +7 -16
- package/dist/schema/registration-checks.d.ts +12 -16
- package/dist/schema/registration-checks.js +35 -51
- package/dist/schema/registration-pairs.d.ts +54 -0
- package/dist/schema/registration-pairs.js +48 -0
- package/dist/schema/registration-pending.d.ts +8 -12
- package/dist/schema/registration-pending.js +9 -9
- package/dist/schema/registry-reset.d.ts +8 -4
- package/dist/schema/registry-reset.js +13 -26
- package/dist/schema/registry-view.d.ts +25 -13
- package/dist/schema/registry-view.js +26 -20
- package/dist/schema/reserved-chords.d.ts +9 -10
- package/dist/schema/reserved-chords.js +73 -78
- package/dist/schema/reserved-chrome.d.ts +12 -11
- package/dist/schema/reserved-chrome.js +15 -11
- package/dist/schema/setext-raw.d.ts +13 -0
- package/dist/schema/setext-raw.js +33 -0
- package/dist/schema/stored-as.d.ts +20 -0
- package/dist/schema/stored-as.js +6 -0
- package/dist/schema/table-cell-raw.d.ts +18 -7
- package/dist/schema/table-cell-raw.js +28 -7
- package/dist/schema/whole-block-unit.d.ts +5 -4
- package/dist/schema/whole-block-unit.js +5 -4
- package/dist/search/document-scan.d.ts +3 -3
- package/dist/search/document-scan.js +2 -2
- package/dist/search/matcher.d.ts +1 -1
- package/dist/search/regex-executor.d.ts +5 -6
- package/dist/search/regex-executor.js +6 -8
- package/dist/search/replace.d.ts +2 -5
- package/dist/search/replace.js +2 -5
- package/dist/search/search-state.svelte.d.ts +5 -5
- package/dist/search/search-state.svelte.js +12 -16
- package/dist/selection/autoscroll.d.ts +6 -9
- package/dist/selection/block-hit-test.d.ts +16 -24
- package/dist/selection/block-hit-test.js +29 -22
- package/dist/selection/caret-doors.d.ts +15 -14
- package/dist/selection/caret-doors.js +37 -26
- package/dist/selection/caret-landing.d.ts +62 -0
- package/dist/selection/caret-landing.js +157 -0
- package/dist/selection/caret-restore.d.ts +17 -10
- package/dist/selection/caret-restore.js +10 -22
- package/dist/selection/caret-target.d.ts +30 -0
- package/dist/selection/caret-target.js +84 -0
- package/dist/selection/char-endpoint-snap.d.ts +6 -10
- package/dist/selection/char-endpoint-snap.js +8 -14
- package/dist/selection/clipboard-text.d.ts +5 -12
- package/dist/selection/clipboard-text.js +69 -172
- package/dist/selection/covered-block.d.ts +6 -8
- package/dist/selection/covered-block.js +8 -19
- package/dist/selection/cross-block/clipboard.d.ts +3 -2
- package/dist/selection/cross-block/clipboard.js +13 -4
- package/dist/selection/cross-block/dispatch.d.ts +47 -43
- package/dist/selection/cross-block/dispatch.js +12 -23
- package/dist/selection/cross-block/format-range.d.ts +18 -21
- package/dist/selection/cross-block/format-range.js +104 -103
- package/dist/selection/cross-block/format-toggle.d.ts +10 -15
- package/dist/selection/cross-block/format-toggle.js +28 -33
- package/dist/selection/cross-block/keydown.d.ts +4 -4
- package/dist/selection/cross-block/keydown.js +93 -152
- package/dist/selection/cross-block/ops.d.ts +19 -34
- package/dist/selection/cross-block/ops.js +110 -95
- package/dist/selection/cross-block/paste.d.ts +2 -3
- package/dist/selection/cross-block/paste.js +61 -104
- package/dist/selection/cross-block/pointer.d.ts +17 -15
- package/dist/selection/cross-block/pointer.js +74 -25
- package/dist/selection/cross-block/type-replace.d.ts +4 -6
- package/dist/selection/cross-block/type-replace.js +53 -146
- package/dist/selection/dead-space-caret.d.ts +20 -28
- package/dist/selection/dead-space-caret.js +79 -87
- package/dist/selection/drag-pointer.d.ts +22 -5
- package/dist/selection/drag-pointer.js +63 -31
- package/dist/selection/gap-caret.d.ts +17 -28
- package/dist/selection/gap-caret.js +14 -26
- package/dist/selection/grid-selection.d.ts +12 -0
- package/dist/selection/grid-selection.js +22 -0
- package/dist/selection/keyboard-extend.d.ts +27 -39
- package/dist/selection/keyboard-extend.js +94 -116
- package/dist/selection/multi-click.d.ts +37 -0
- package/dist/selection/multi-click.js +197 -0
- package/dist/selection/native-bridge.d.ts +30 -37
- package/dist/selection/native-bridge.js +80 -100
- package/dist/selection/nearest-block.d.ts +17 -12
- package/dist/selection/nearest-block.js +37 -18
- package/dist/selection/path-lookup.d.ts +31 -14
- package/dist/selection/path-lookup.js +110 -20
- package/dist/selection/path-math.d.ts +9 -11
- package/dist/selection/path-math.js +5 -7
- package/dist/selection/pointer-gesture.d.ts +9 -0
- package/dist/selection/pointer-gesture.js +11 -0
- package/dist/selection/pointer-session.d.ts +10 -16
- package/dist/selection/pointer-session.js +6 -7
- package/dist/selection/primitives.d.ts +64 -33
- package/dist/selection/primitives.js +61 -53
- package/dist/selection/range-coverage.d.ts +94 -0
- package/dist/selection/range-coverage.js +365 -0
- package/dist/selection/range-delete-ceremony.d.ts +28 -74
- package/dist/selection/range-delete-ceremony.js +100 -141
- package/dist/selection/range-delete-chrome.d.ts +20 -33
- package/dist/selection/range-delete-chrome.js +53 -78
- package/dist/selection/range-delete-table-coverage.d.ts +11 -25
- package/dist/selection/range-delete-table-coverage.js +42 -112
- package/dist/selection/range-delete-table.d.ts +14 -12
- package/dist/selection/range-delete-table.js +106 -310
- package/dist/selection/range-delete.d.ts +18 -19
- package/dist/selection/range-delete.js +83 -123
- package/dist/selection/round-trip-restore.d.ts +18 -0
- package/dist/selection/round-trip-restore.js +19 -0
- package/dist/selection/selection-announcer.d.ts +17 -0
- package/dist/selection/selection-announcer.js +25 -0
- package/dist/selection/selection-description.d.ts +4 -3
- package/dist/selection/selection-description.js +5 -4
- package/dist/selection/selection-drop.d.ts +52 -0
- package/dist/selection/selection-drop.js +317 -0
- package/dist/selection/selection-restore.d.ts +20 -33
- package/dist/selection/selection-restore.js +21 -44
- package/dist/selection/selection-state.svelte.d.ts +50 -42
- package/dist/selection/selection-state.svelte.js +144 -98
- package/dist/selection/shared-keydown.d.ts +22 -27
- package/dist/selection/shared-keydown.js +25 -45
- package/dist/selection/table-endpoint-snap.d.ts +17 -41
- package/dist/selection/table-endpoint-snap.js +54 -80
- package/dist/selection/table-rect-extend.d.ts +3 -6
- package/dist/selection/table-rect-extend.js +19 -14
- package/dist/styles/editor-theme.css +75 -53
- package/dist/styles/editor.css +248 -139
- package/dist/testing/conformance-core.d.ts +50 -18
- package/dist/testing/conformance-core.js +88 -50
- package/dist/testing/container-conformance.d.ts +48 -84
- package/dist/testing/container-conformance.js +159 -285
- package/dist/testing/headless-actions.d.ts +34 -19
- package/dist/testing/headless-actions.js +116 -65
- package/dist/testing/headless-block-list.svelte.d.ts +16 -0
- package/dist/testing/headless-block-list.svelte.js +22 -0
- package/dist/testing/inline-conformance.d.ts +15 -22
- package/dist/testing/inline-conformance.js +131 -148
- package/dist/testing/kind-conformance.d.ts +19 -24
- package/dist/testing/kind-conformance.js +204 -117
- package/dist/testing/kit-reading.d.ts +7 -0
- package/dist/testing/kit-reading.js +16 -0
- package/dist/testing/mount-dom-stubs.d.ts +4 -5
- package/dist/testing/mount-dom-stubs.js +8 -5
- package/dist/testing/parse-convergence.d.ts +10 -10
- package/dist/testing/parse-convergence.js +14 -49
- package/dist/testing.d.ts +13 -9
- package/dist/testing.js +28 -38
- package/dist/tree-operations/blockquote.d.ts +8 -14
- package/dist/tree-operations/blockquote.js +25 -45
- package/dist/tree-operations/chain-rebuild.d.ts +34 -25
- package/dist/tree-operations/chain-rebuild.js +115 -52
- package/dist/tree-operations/children.d.ts +5 -9
- package/dist/tree-operations/children.js +7 -11
- package/dist/tree-operations/cleanup.d.ts +6 -7
- package/dist/tree-operations/cleanup.js +14 -11
- package/dist/tree-operations/clone.js +5 -4
- package/dist/tree-operations/container-lift.d.ts +10 -5
- package/dist/tree-operations/container-lift.js +20 -14
- package/dist/tree-operations/container-offsets.d.ts +22 -0
- package/dist/tree-operations/container-offsets.js +89 -0
- package/dist/tree-operations/content-write.d.ts +52 -29
- package/dist/tree-operations/content-write.js +155 -110
- package/dist/tree-operations/index.d.ts +4 -4
- package/dist/tree-operations/index.js +4 -4
- package/dist/tree-operations/keep-one-block.d.ts +10 -0
- package/dist/tree-operations/keep-one-block.js +19 -0
- package/dist/tree-operations/leaf-range.d.ts +33 -0
- package/dist/tree-operations/leaf-range.js +67 -0
- package/dist/tree-operations/list/empty-check.d.ts +2 -3
- package/dist/tree-operations/list/empty-check.js +4 -4
- package/dist/tree-operations/list/exit-replacement.d.ts +4 -6
- package/dist/tree-operations/list/exit-replacement.js +4 -9
- package/dist/tree-operations/list/item-partition.d.ts +2 -2
- package/dist/tree-operations/list/item-partition.js +2 -2
- package/dist/tree-operations/list/list-builders.d.ts +18 -16
- package/dist/tree-operations/list/list-builders.js +59 -30
- package/dist/tree-operations/list/ordered-markers.d.ts +7 -16
- package/dist/tree-operations/list/ordered-markers.js +7 -16
- package/dist/tree-operations/list/reconcile-task.d.ts +16 -7
- package/dist/tree-operations/list/reconcile-task.js +80 -23
- package/dist/tree-operations/list/sublist-separator.d.ts +7 -7
- package/dist/tree-operations/list/sublist-separator.js +20 -27
- package/dist/tree-operations/list/task-paragraph.d.ts +25 -0
- package/dist/tree-operations/list/task-paragraph.js +54 -0
- package/dist/tree-operations/list/unwrap-merge.d.ts +8 -16
- package/dist/tree-operations/list/unwrap-merge.js +44 -79
- package/dist/tree-operations/node-ops.d.ts +30 -52
- package/dist/tree-operations/node-ops.js +152 -218
- package/dist/tree-operations/node-primitives.d.ts +44 -31
- package/dist/tree-operations/node-primitives.js +84 -60
- package/dist/tree-operations/open-tail.d.ts +25 -0
- package/dist/tree-operations/open-tail.js +100 -0
- package/dist/tree-operations/parse-block.d.ts +15 -2
- package/dist/tree-operations/parse-block.js +19 -4
- package/dist/tree-operations/paste/apply.d.ts +7 -8
- package/dist/tree-operations/paste/apply.js +33 -63
- package/dist/tree-operations/paste/body-write.d.ts +8 -6
- package/dist/tree-operations/paste/body-write.js +13 -14
- package/dist/tree-operations/paste/container-match.d.ts +7 -10
- package/dist/tree-operations/paste/container-match.js +76 -58
- package/dist/tree-operations/paste/container-paste.d.ts +3 -3
- package/dist/tree-operations/paste/container-paste.js +3 -3
- package/dist/tree-operations/paste/dispatch.d.ts +26 -29
- package/dist/tree-operations/paste/dispatch.js +68 -53
- package/dist/tree-operations/paste/focus-target.d.ts +11 -14
- package/dist/tree-operations/paste/focus-target.js +13 -18
- package/dist/tree-operations/paste/hooks.d.ts +7 -12
- package/dist/tree-operations/paste/hooks.js +49 -46
- package/dist/tree-operations/paste/line-ending.d.ts +11 -0
- package/dist/tree-operations/paste/line-ending.js +32 -0
- package/dist/tree-operations/paste/list-absorb.d.ts +8 -11
- package/dist/tree-operations/paste/list-absorb.js +17 -19
- package/dist/tree-operations/paste/list-break-out.d.ts +12 -11
- package/dist/tree-operations/paste/list-break-out.js +24 -32
- package/dist/tree-operations/paste/parent-scope.d.ts +8 -12
- package/dist/tree-operations/paste/parent-scope.js +9 -16
- package/dist/tree-operations/paste/paste-deps.d.ts +14 -9
- package/dist/tree-operations/paste/paste-replacement.d.ts +20 -3
- package/dist/tree-operations/paste/paste-replacement.js +73 -42
- package/dist/tree-operations/paste/paste-transforms.d.ts +5 -7
- package/dist/tree-operations/paste/paste-transforms.js +18 -27
- package/dist/tree-operations/paste/replacement-parse.d.ts +19 -0
- package/dist/tree-operations/paste/replacement-parse.js +24 -0
- package/dist/tree-operations/paste/strategy.d.ts +1 -1
- package/dist/tree-operations/paste/strategy.js +1 -1
- package/dist/tree-operations/paste/table-slice.js +15 -10
- package/dist/tree-operations/paste-surfaces.d.ts +18 -29
- package/dist/tree-operations/paste-surfaces.js +14 -10
- package/dist/tree-operations/path-mutate.d.ts +7 -8
- package/dist/tree-operations/path-mutate.js +4 -4
- package/dist/tree-operations/reorder-unit.d.ts +4 -5
- package/dist/tree-operations/reorder-unit.js +5 -6
- package/dist/tree-operations/reorder.d.ts +7 -9
- package/dist/tree-operations/reorder.js +39 -40
- package/dist/tree-operations/settle.d.ts +42 -53
- package/dist/tree-operations/settle.js +241 -162
- package/dist/tree-operations/sharing.d.ts +5 -5
- package/dist/tree-operations/splice-many.d.ts +5 -5
- package/dist/tree-operations/splice-many.js +5 -5
- package/dist/tree-operations/stored-as.d.ts +13 -0
- package/dist/tree-operations/stored-as.js +48 -0
- package/dist/tree-operations/structural-change.d.ts +11 -15
- package/dist/tree-operations/structural-change.js +10 -14
- package/dist/tree-operations/structural-suffix.d.ts +22 -0
- package/dist/tree-operations/structural-suffix.js +61 -0
- package/dist/tree-operations/sub-table-copy.d.ts +7 -0
- package/dist/tree-operations/sub-table-copy.js +40 -36
- package/dist/tree-operations/table-grid-clipboard.d.ts +2 -7
- package/dist/tree-operations/table-grid-clipboard.js +11 -36
- package/dist/tree-operations/table-mutations.d.ts +7 -3
- package/dist/tree-operations/table-mutations.js +45 -9
- package/dist/tree-operations/unshare.d.ts +11 -15
- package/dist/tree-operations/unshare.js +15 -17
- package/dist/undo/manager.js +1 -1
- package/dist/undo/types.d.ts +2 -2
- package/docs/guide/consumer-guide.md +329 -205
- package/docs/guide/directives.md +7 -7
- package/docs/guide/plugin-api.md +267 -183
- package/docs/guide/plugin-guide.md +341 -235
- package/docs/guide/plugin-testing.md +96 -82
- package/package.json +17 -21
- package/dist/ambient/ambient-cursor.d.ts +0 -41
- package/dist/ambient/ambient-cursor.js +0 -120
- package/dist/components/blocks/code/code-paste.d.ts +0 -24
- package/dist/components/blocks/code/code-paste.js +0 -21
- package/dist/components/blocks/table/cell-clipboard.d.ts +0 -33
- package/dist/components/blocks/table/cell-clipboard.js +0 -67
- package/dist/components/blocks/text/hidden-suffix.d.ts +0 -10
- package/dist/components/blocks/text/hidden-suffix.js +0 -15
- package/dist/components/blocks/text/link-source-bytes.d.ts +0 -37
- package/dist/components/image/image-source-bytes.d.ts +0 -15
- package/dist/components/image/image-source-bytes.js +0 -80
- package/dist/cursor/content-offsets.d.ts +0 -29
- package/dist/cursor/content-offsets.js +0 -151
- package/dist/cursor/reveal-anchor.d.ts +0 -30
- package/dist/cursor/reveal-anchor.js +0 -31
- package/dist/invariants/split-landing.d.ts +0 -8
- package/dist/invariants/split-landing.js +0 -15
- package/dist/selection/double-click-trim.d.ts +0 -17
- package/dist/selection/double-click-trim.js +0 -57
- package/dist/tree-operations/list/terminator.d.ts +0 -17
- package/dist/tree-operations/list/terminator.js +0 -60
- package/dist/tree-operations/paste/replace-block-at-parent.d.ts +0 -29
- package/dist/tree-operations/paste/replace-block-at-parent.js +0 -75
package/docs/guide/plugin-api.md
CHANGED
|
@@ -1,196 +1,206 @@
|
|
|
1
1
|
# Plugin API Reference
|
|
2
2
|
|
|
3
|
-
Every export of `@voithos-labs/aragonite/plugin`, grouped by job, so you can find a name and what it does without reading the package's entry module. Nobody reads this page top to bottom; Ctrl+F your way to the name you're after. The recipes behind the names live in the [plugin guide](plugin-guide.md), and
|
|
3
|
+
Every export of `@voithos-labs/aragonite/plugin`, grouped by job, so you can find a name and what it does without reading the package's entry module. Nobody reads this page top to bottom; Ctrl+F your way to the name you're after. The recipes behind the names live in the [plugin guide](plugin-guide.md), and most groups link to their section there.
|
|
4
4
|
|
|
5
5
|
## API reference
|
|
6
6
|
|
|
7
7
|
Values are the calls you make, and the types beside them describe what those calls take and hand back.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Four words recur in every table, so here they are once:
|
|
10
10
|
|
|
11
11
|
- A **kind** is aragonite's word for a block type. Paragraph is a kind, fenced code is a kind, your plugin's block is about to be one.
|
|
12
|
-
- A block's **raw** is its exact source bytes, and saving a document is just concatenating them.
|
|
12
|
+
- A block's **raw** is its exact source bytes, and saving a document is just concatenating them (with the blank lines kept between blocks).
|
|
13
13
|
- An **opener** is the piece of the parser that recognizes the line a block starts with.
|
|
14
14
|
- A **leaf** is a block with no child blocks; a **container** holds other blocks.
|
|
15
|
-
- To **mint** is to create a branded, registry-backed identity (a kind, a command id) in the one authorized place; a duplicate throws.
|
|
16
15
|
|
|
17
|
-
A group tagged _(pre-freeze / unstable)_ may still change shape until the
|
|
18
|
-
|
|
19
|
-
Adding an export? Give it a row in its group, tagged the way its entry-module section is tagged. A test (`src/lib/test/plugins/plugin-guide-coverage.test.ts`) diffs this page against the entry module and fails naming any export without a row. It finds the catalog by the exact `## API reference` heading above, so if you rename the heading, rename it there too.
|
|
16
|
+
A group tagged _(pre-freeze / unstable)_ may still change shape until the freeze at the public release, and so may a single row tagged the same way inside an untagged group. In an untagged group the model is settled (which calls exist, that each registers once, what a kind is), and the exact call shapes freeze with everything else at the public release. The tags follow the section notes in the package's entry module (`src/lib/plugin.ts`) and the plugin contract (`docs/design/plugin-contract.md` in the repository), which is where `lineStartsOuterBlock`'s row tag comes from.
|
|
20
17
|
|
|
21
18
|
The groups, in page order:
|
|
22
19
|
|
|
23
20
|
| Group | What it covers |
|
|
24
21
|
| ------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
|
|
25
22
|
| [The plugin unit](#the-plugin-unit) | Packaging your extension, installing it, and what each mounted editor hands it back |
|
|
26
|
-
| [Kind declaration](#kind-declaration) |
|
|
23
|
+
| [Kind declaration](#kind-declaration) | Creating a new block type's identity |
|
|
27
24
|
| [The block-kind descriptor](#the-block-kind-descriptor) | Telling the editor how your block type behaves, and the checklist every one must fill in |
|
|
28
25
|
| [The component registry](#the-component-registry) | Binding a block type to the Svelte component that renders it |
|
|
29
|
-
| [Code-block languages](#code-block-languages) | Adding syntax-highlighting grammars beyond the bundled set |
|
|
30
26
|
| [The parser opener](#the-parser-opener) | Teaching the parser to recognize your block's syntax |
|
|
31
27
|
| [Enter completion](#enter-completion) | Letting one typed line become a construct whose lines must sit together |
|
|
32
28
|
| [Registration probes](#registration-probes) | Checking what's already registered, so a module that runs twice stays safe |
|
|
33
29
|
| [Directive authoring](#directive-authoring) | Owning a `:::name` block without writing your own parsing |
|
|
34
30
|
| [Container authoring](#container-authoring) | Blocks that hold other blocks, plus their title line |
|
|
35
31
|
| [Editable-leaf authoring](#editable-leaf-authoring) | A text-editing block with the editor's own caret, undo, and selection |
|
|
32
|
+
| [Code-block languages](#code-block-languages) | Adding syntax-highlighting grammars beyond the bundled set |
|
|
36
33
|
| [Inline authoring](#inline-authoring) | Your own syntax inside a paragraph, rendered as a widget |
|
|
37
34
|
| [Commands and keybindings](#commands-and-keybindings) | Keyboard shortcuts and commands, per block type or editor-wide |
|
|
38
35
|
| [Paste transforms](#paste-transforms) | Rewriting pasted text before the editor parses it |
|
|
39
36
|
| [Decorations](#decorations) | View-only annotations over content your plugin does not own |
|
|
37
|
+
| [Inline menus](#inline-menus) | A list under the caret that a typed trigger opens |
|
|
38
|
+
| [Insert catalogue](#insert-catalogue) | The blocks the insert menus offer, and adding your own |
|
|
40
39
|
| [Events](#events) | What the editor tells your plugin has happened, and the shapes it says it in |
|
|
41
40
|
| [Rects](#rects) | Where things are on screen: block boxes, ranges, the caret, scrolling to a block |
|
|
42
41
|
| [Caret geometry](#caret-geometry) | Answering where a press inside your block puts the caret |
|
|
42
|
+
| [Pointer gestures](#pointer-gestures) | Keeping a drag that belongs to your block (a pan, a brush) from starting a selection |
|
|
43
43
|
| [Selection geometry](#selection-geometry) | The shapes that describe what the user has selected |
|
|
44
44
|
| [Parse and serialize](#parse-and-serialize) | Markdown in, tree out, and back again |
|
|
45
45
|
| [Grammar scanners](#grammar-scanners) | The editor's own code-fence, HTML-tag, and blockquote rules, reusable so you never fork them |
|
|
46
46
|
| [Node access and metadata](#node-access-and-metadata) | Reading the document tree, and storing your own data on a block |
|
|
47
|
+
| [Injected renderers](#injected-renderers) | A library the host hands you to draw your block (KaTeX, mermaid), cached per theme |
|
|
47
48
|
| [Performance helpers](#performance-helpers) | A small cache and a scan index for render and recognition work |
|
|
48
49
|
|
|
49
50
|
### The plugin unit
|
|
50
51
|
|
|
51
52
|
_(pre-freeze / unstable)_ The installable package, and the per-editor context it gets back. Wiring and the traps: [The plugin unit](plugin-guide.md#the-plugin-unit) and [One process, many editors](plugin-guide.md#one-process-many-editors).
|
|
52
53
|
|
|
53
|
-
| Export
|
|
54
|
-
|
|
|
55
|
-
| `definePlugin`
|
|
56
|
-
| `definePluginBlock`
|
|
57
|
-
| `isPluginInstalled`
|
|
58
|
-
| `EditorPlugin`
|
|
59
|
-
| The `plugins` prop
|
|
60
|
-
| `EditorPluginEntry`
|
|
61
|
-
| `PluginSetupContext`
|
|
62
|
-
| `OnEditorCallback`
|
|
63
|
-
| `EditorContext`
|
|
64
|
-
| `
|
|
54
|
+
| Export | Role |
|
|
55
|
+
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
56
|
+
| `definePlugin` | Validate a `{ name, setup }` unit at definition time and return it, ready for the editor's `plugins` prop. Optional `defaults` are where every editor's `options` start, and `parseOptions(raw)` checks an editor's entry before it lands on them |
|
|
57
|
+
| `definePluginBlock` | The single-block shortcut: one kind, one component, one register step, packaged as a unit; takes `defaults` and `parseOptions` like `definePlugin` |
|
|
58
|
+
| `isPluginInstalled` | Has a plugin of this name installed? For the rare setup that has to branch on it |
|
|
59
|
+
| `EditorPlugin` | The unit's shape; the `plugins` prop and the main entry's `installPlugins` take these |
|
|
60
|
+
| The `plugins` prop | Installs once per process, and activates per editor: an editor runs the hooks, kinds, commands and paste transforms of exactly the plugins it lists (no prop at all activates every installed one) |
|
|
61
|
+
| `EditorPluginEntry` | One `plugins` prop entry: a bare unit, or `{ plugin, options }` to vary options per editor. A field you pass replaces the plugin's default for it (arrays too); the rest keep theirs |
|
|
62
|
+
| `PluginSetupContext` | What `setup(ctx)` receives; its `onEditor(cb)` registers a per-editor callback (call it from `setup`, synchronously) |
|
|
63
|
+
| `OnEditorCallback` | The callback itself: receives the `EditorContext` of each mounted editor that listed your plugin, may return a cleanup function the editor runs at unmount |
|
|
64
|
+
| `EditorContext` | One editor's view for your plugin: `editorId`, the live read-only `document` and its `documentGeneration`, subscribe-only `events`, this editor's `options` (its entry over your `defaults`), its `decorations`, `rects` and `inlineMenus`, the live `insertCatalogue`, `presentationMode` and `theme`, `insertMarkdown` (a promise, resolved when the insert lands) and `runCommand`, which act like the instance's own methods and return false where those would, and `computeInlineContent`, this editor's inline parse |
|
|
65
|
+
| `InsertMarkdownOptions` | `insertMarkdown`'s second argument: `placement: 'below'` puts the text into a new paragraph after the top-level block holding the caret, the way the right-click "Insert block" rows do, the paragraph and the text in one undo entry; the default inserts at the caret |
|
|
66
|
+
| `PresentationMode` | The union of the editor's view modes (source, reading, the previews, live); every mode read reports the effective one, meaning the mode actually in force. [Presentation modes](plugin-guide.md#presentation-modes) |
|
|
65
67
|
|
|
66
68
|
### Kind declaration
|
|
67
69
|
|
|
68
70
|
Every kind starts here. No other call accepts a bare string where a kind goes.
|
|
69
71
|
|
|
70
|
-
| Export | Role
|
|
71
|
-
| --------------------------------- |
|
|
72
|
-
| `declarePluginKind` |
|
|
73
|
-
| `declaredPluginKind` | Recover an already-declared kind in another module, no cast; throws for a name nobody declared
|
|
74
|
-
| `PluginBlockKind`, `AnyBlockKind` | The plugin-declared kind type, and the union of built-in and plugin kinds a node can carry
|
|
72
|
+
| Export | Role |
|
|
73
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
74
|
+
| `declarePluginKind` | Create a block kind from a name and get the kind back; a collision with a built-in or a prior kind throws, and so do the reserved names `document` and `global` and a name that isn't a lowercase letter followed by letters, digits and hyphens |
|
|
75
|
+
| `declaredPluginKind` | Recover an already-declared kind in another module, no cast; throws for a name nobody declared |
|
|
76
|
+
| `PluginBlockKind`, `AnyBlockKind` | The plugin-declared kind type, and the union of built-in and plugin kinds a node can carry |
|
|
75
77
|
|
|
76
78
|
### The block-kind descriptor
|
|
77
79
|
|
|
78
80
|
The **descriptor** is a kind's written behavior: how it merges, whether it's editable, its container shape. Its required `closure` field is the kind's answer to each cross-cutting editor system (undo, search, selection, clipboard and friends), so a new kind can't ship silently broken under a subsystem nobody asked about. Cell by cell: [The closure block](plugin-guide.md#the-closure-block).
|
|
79
81
|
|
|
80
|
-
| Export | Role
|
|
81
|
-
| ---------------------------------------------- |
|
|
82
|
-
| `registerBlockKind` | Register a kind's descriptor; the kind errors at first use without one
|
|
83
|
-
| `augmentBlockKind` | Merge extra fields into a kind your own plugin registered; built-in kinds and another plugin's kinds are refused with a throw
|
|
84
|
-
| `BlockKindRegistration
|
|
85
|
-
| `
|
|
86
|
-
| `
|
|
87
|
-
| `
|
|
88
|
-
| `
|
|
89
|
-
| `
|
|
90
|
-
| `
|
|
91
|
-
| `
|
|
82
|
+
| Export | Role |
|
|
83
|
+
| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
84
|
+
| `registerBlockKind` | Register a kind's descriptor; the kind errors at first use without one |
|
|
85
|
+
| `augmentBlockKind` | Merge extra fields into a kind your own plugin registered; built-in kinds and another plugin's kinds are refused with a throw |
|
|
86
|
+
| `BlockKindRegistration` | What `registerBlockKind` accepts. Its optional `label` is what a screen reader and the block menu call the block, `pageRole` whether it reads as prose (no drag handle) or as an object, `estimateHeight(node, env)` its height guess before it's measured, and `dragLabel` what the drag ghost calls it. Fields that only work as a pair are declared as one (`contentStart: { range, backspace? }` for a kind whose markers sit in front of its text, and the `container` group), so a registration that can't work, like a block focused as one unit that also parses inline syntax, won't compile |
|
|
87
|
+
| `HeightEstimateEnv` | What `estimateHeight` reads besides the block: the editor's width, its line heights and character width, the frame it adds to every block, and the floor for an unsized image |
|
|
88
|
+
| `BlockKindAugmentation` | The patch `augmentBlockKind` merges; a partial `container` group merges into the existing one. The fields other fields depend on (`blockFocus`, `supportsInline`, `contentStart`, the title row and the unwrap strategies) are fixed at registration, and an augment naming one throws, even from plain JavaScript |
|
|
89
|
+
| `WriteRule`, `WriteContext` | A kind's write rule: `rawWrite` for its own bytes, `container.bodyWrite` for a child's. `normalize(raw, ctx)` makes written bytes legal, and `mapOffset(raw, offset, ctx)` says where a caret in them lands. `ctx` carries the block (`node`), the document's `lineEnding` for any line the rule puts back, and a `mode`: `'authored'` when the user typed the bytes in the block (an editable leaf's commits, and typing in the code, text and cell surfaces), `'literal'` for content that arrives whole (a paste, a replace, a range delete). The editor runs your rule on every content write and moves the caret with your `mapOffset`, so a rule that repairs half-written syntax should check `mode`, or it'll fight the user's typing |
|
|
90
|
+
| `ContainerDescriptorGroup` | The descriptor's container-only half: the required `contract` (`'strip'`, `'grid'` or `'opaque'`) and `rebuildRaw` (the hook that recomputes a container's raw from its children after an edit), plus the body wrap, the body write rule, the reserved title line, unwrap behavior, paste merging, a content line's first space (`contentStartSpace`), and whether its children reorder among themselves. A declared title line (`reservedChrome`) already decides what Backspace does at its start, so its `unwrapRole` names only `middleChildBackspace` |
|
|
91
|
+
| `MergeRole`, `ContainerUnwrapRole` | Closed sets naming how a kind merges on Backspace, and how a container releases a child at its edge |
|
|
92
|
+
| `ChildRawChange` | `rebuildRaw`'s optional second argument: which one child's bytes just moved, for a rebuilder that re-emits only that region. Ignoring it and re-deriving the whole raw is always correct, just slower |
|
|
93
|
+
| `ClosureBlock`, `ClosureColumn`, `ClosureCell` | The closure matrix: nine columns, one cell each, and a cell is `implemented` (name the mechanism), `inherit-default`, or `not-supported` (name the degradation). A missing column fails the typecheck |
|
|
94
|
+
| `simpleLeafClosure`, `SimpleLeafClosureCells` | Closure preset for a plain text leaf: bakes the five cells every such leaf answers alike, requires the four your component determines (`focus`, `searchPaint`, `undo`, `simOracle`) |
|
|
95
|
+
| `containerClosure`, `ContainerClosureCells` | Closure preset for a container of real child blocks: bakes the four structural cells plus `roundTrip: implemented`, requires the round trip's `via` string and the four the container determines |
|
|
92
96
|
|
|
93
97
|
### The component registry
|
|
94
98
|
|
|
95
|
-
| Export | Role
|
|
96
|
-
| ----------------------------------------- |
|
|
97
|
-
| `registerBlockComponent` | Bind a kind to the Svelte component that renders it; without one the kind renders as a visible raw-text fallback (you'll notice)
|
|
98
|
-
| `defineBlockComponent` | Wrap your component into the registry's entry shape; a container that forgot to publish its API fails the typecheck here
|
|
99
|
-
| `BlockComponentEntry` | The registry entry: the component, plus an optional per-node extra-props hook
|
|
100
|
-
| `BlockComponent`, `BlockComponentExports` | The surface a block component publishes: a leaf's own members, or a container's single `containerApi` export
|
|
101
|
-
| `BlockComponentProps` | The props every block component receives: its node, its
|
|
99
|
+
| Export | Role |
|
|
100
|
+
| ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `registerBlockComponent` | Bind a kind to the Svelte component that renders it; without one the kind renders as a visible raw-text fallback (you'll notice) |
|
|
102
|
+
| `defineBlockComponent` | Wrap your component into the registry's entry shape; a container that forgot to publish its API fails the typecheck here |
|
|
103
|
+
| `BlockComponentEntry` | The registry entry: the component, plus an optional per-node extra-props hook |
|
|
104
|
+
| `BlockComponent`, `BlockComponentExports` | The surface a block component publishes: a leaf's own members, or a container's single `containerApi` export |
|
|
105
|
+
| `BlockComponentProps` | The props every block component receives: its node, its index and path, the marker prefix a container hands its first child (a list item's `- `; a leaf that drops it loses its markers on screen), the read-only whole document, the editor's geometry surface |
|
|
102
106
|
|
|
103
107
|
### The parser opener
|
|
104
108
|
|
|
105
|
-
Where your opener sits
|
|
109
|
+
Where your opener sits in the priority order, and the two placement rules: [Opener priority](plugin-guide.md#opener-priority).
|
|
106
110
|
|
|
107
|
-
| Export | Role
|
|
108
|
-
| ---------------------------------------- |
|
|
109
|
-
| `registerBlockOpener` | Teach the parser to recognize your kind's Markdown syntax
|
|
110
|
-
| `BlockOpener`, `OpenContext` | The opener contract, and the line cursor its `tryOpen` inspects: the lines, the position, the parse's scope and depth
|
|
111
|
-
| `BlockOpenerResult` | A claim: the node built, plus `consumed`, the count of lines it took
|
|
112
|
-
| `OPENER_PRIORITIES` | The built-in priorities your opener picks its own number relative to; lower dispatches first _(pre-freeze / unstable)_
|
|
113
|
-
| `lineStartsOuterBlock`, `OuterBlockScan` | "Does this line start a block at the outer level?" The shared end-of-extent test for a container opener scanning its own lines, and its
|
|
111
|
+
| Export | Role |
|
|
112
|
+
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
113
|
+
| `registerBlockOpener` | Teach the parser to recognize your kind's Markdown syntax |
|
|
114
|
+
| `BlockOpener`, `OpenContext` | The opener contract, and the line cursor its `tryOpen` inspects: the lines, the position, the blank lines above (`leadingTrivia`), the parse's scope and depth, and the `grammar` to pass on to any nested parse |
|
|
115
|
+
| `BlockOpenerResult` | A claim: the node built, plus `consumed`, the count of lines it took |
|
|
116
|
+
| `OPENER_PRIORITIES` | The built-in priorities your opener picks its own number relative to; lower dispatches first _(pre-freeze / unstable)_ |
|
|
117
|
+
| `lineStartsOuterBlock`, `OuterBlockScan` | "Does this line start a block at the outer level?" The shared end-of-extent test for a container opener scanning its own lines, and its inputs: whether a paragraph is open above, the grammar (required: pass the one your opener was given, so a syntax the editor left out starts nothing), and optionally the lines around it, for an opener that needs a later line to open _(pre-freeze / unstable)_ |
|
|
114
118
|
|
|
115
119
|
### Enter completion
|
|
116
120
|
|
|
117
121
|
_(pre-freeze / unstable)_ The recipe: [Typing a multi-line construct into existence](plugin-guide.md#typing-a-multi-line-construct-into-existence).
|
|
118
122
|
|
|
119
|
-
| Export | Role
|
|
120
|
-
| ------------------------ |
|
|
121
|
-
| `registerBlockCompleter` | Let one typed line complete into a grammar whose lines must sit adjacent, which Enter alone can never type
|
|
122
|
-
| `BlockCompleter` | The contract: `tryComplete(line)` claims with a result, or declines with null; `onType: true` also consults it as the line is typed
|
|
123
|
-
| `CompletionResult` | A claim: the lines to insert, endings omitted (the editor attaches the
|
|
123
|
+
| Export | Role |
|
|
124
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
|
+
| `registerBlockCompleter` | Let one typed line complete into a grammar whose lines must sit adjacent, which Enter alone can never type |
|
|
126
|
+
| `BlockCompleter` | The contract: `tryComplete(line)` claims with a result, or declines with null; `onType: true` also consults it as the line is typed |
|
|
127
|
+
| `CompletionResult` | A claim: the lines to insert, endings omitted (the editor attaches the block's own ending, else the document's), plus where the caret lands inside the insertion |
|
|
124
128
|
|
|
125
129
|
### Registration probes
|
|
126
130
|
|
|
127
|
-
Every registry on this surface is register-once
|
|
131
|
+
Every process-global registry on this surface is register-once: a duplicate throws in production and under test, and never silently overrides (a dev server replaces the entry and warns, so an edited module takes effect on re-run). These are the matching is-it-there checks, for a module that may run twice (hot reload, a re-import) to ask before registering. Guard on these rather than on a module-level flag of your own: the flag outlives the test kit's platform reset, and the guide's registration section tells you how that goes. The directive and inline tiers keep their own probes, `isDirectiveRegistered` and `isInlineKindDeclared`, in their groups below.
|
|
128
132
|
|
|
129
|
-
| Export | Role
|
|
130
|
-
| -------------------------------------------------------------------------------------------------------------- |
|
|
131
|
-
| `isBlockKindDeclared` | Is this kind name already declared?
|
|
132
|
-
| `isBlockKindRegistered`, `isBlockComponentRegistered`, `isBlockOpenerRegistered`, `isBlockCompleterRegistered` | One guard per register-once call on the block side
|
|
133
|
-
| `isPasteTransformRegistered` | The same guard, keyed by a paste transform's name
|
|
133
|
+
| Export | Role |
|
|
134
|
+
| -------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------- |
|
|
135
|
+
| `isBlockKindDeclared` | Is this kind name already declared? |
|
|
136
|
+
| `isBlockKindRegistered`, `isBlockComponentRegistered`, `isBlockOpenerRegistered`, `isBlockCompleterRegistered` | One guard per register-once call on the block side |
|
|
137
|
+
| `isPasteTransformRegistered` | The same guard, keyed by a paste transform's name |
|
|
138
|
+
| `isLanguageRegistered` | The same guard, keyed by a code-block language's name |
|
|
134
139
|
|
|
135
140
|
### Directive authoring
|
|
136
141
|
|
|
137
142
|
_(pre-freeze / unstable)_ The `:::name` grammar itself is the [directives guide](directives.md)'s subject; the worked container is [the walkthrough](plugin-guide.md#walkthrough-a-conspiracy-container-end-to-end).
|
|
138
143
|
|
|
139
|
-
| Export | Role
|
|
140
|
-
| -------------------------------------------------------- |
|
|
141
|
-
| `activateDirectives` | Turn the `:::name` grammar on, once at startup, before the first parse;
|
|
142
|
-
| `registerDirective` | Map a `(tier, name)` pair to one of your kinds; a container mapping must bring its node factory (`fromDirective`), or registration throws
|
|
143
|
-
| `isDirectiveRegistered` | The is-it-there check for a directive name
|
|
144
|
-
| `parseDirectiveAttributes` | Opt-in reader pulling a `[label]` and a `{#id .class key=val}` block out of a directive's info string; one-way, it reads and never writes back
|
|
145
|
-
| `serializeDirective` | Re-emit a directive's exact bytes from its parts (colon count, name, verbatim info string, body, closer shape), growing the fences itself so no body line reads as the closer
|
|
146
|
-
| `escalatedColonCount` | The fence length a body forces, for an emitter building `:::name` text by hand instead of through `serializeDirective`
|
|
147
|
-
| `createDirectiveRebuild` | Build the raw-recompute hook (`rebuildRaw`) for a directive container whose child 0 is an editable title; owns the fence bytes, CRLF included
|
|
148
|
-
| `DIRECTIVE_BODY_WRAP` | The wrap every `:::` body parses with; declare it as your container kind's `bodyWrap` so a blank line against the fence
|
|
149
|
-
| `DirectiveDefinition`, `ParsedDirective` | The registration's shape, and the parsed fence your factory receives: the fence parts, the parsed body, the exact consumed bytes
|
|
150
|
-
| `DirectiveTier`, `DirectiveFence`, `DirectiveAttributes` | The three tiers (container, leaf, text), one parsed opener line, and what the attribute reader returns
|
|
144
|
+
| Export | Role |
|
|
145
|
+
| -------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
+
| `activateDirectives` | Turn the `:::name` grammar on, once at startup, before the first parse; until it runs no `:::` line parses as a directive, so a `registerDirective` mapping has nothing to act on (the pure helpers below work either way) |
|
|
147
|
+
| `registerDirective` | Map a `(tier, name)` pair to one of your kinds; a container mapping must bring its node factory (`fromDirective`) and a text mapping must not, or registration throws |
|
|
148
|
+
| `isDirectiveRegistered` | The is-it-there check for a directive, asked as `(tier, name)` |
|
|
149
|
+
| `parseDirectiveAttributes` | Opt-in reader pulling a `[label]` and a `{#id .class key=val}` block out of a directive's info string; one-way, it reads and never writes back |
|
|
150
|
+
| `serializeDirective` | Re-emit a directive's exact bytes from its parts (colon count, name, verbatim info string, body, closer shape), growing the fences itself so no body line reads as the closer |
|
|
151
|
+
| `escalatedColonCount` | The fence length a body forces, for an emitter building `:::name` text by hand instead of through `serializeDirective` |
|
|
152
|
+
| `createDirectiveRebuild` | Build the raw-recompute hook (`rebuildRaw`) for a directive container whose child 0 is an editable title; owns the fence bytes, CRLF included |
|
|
153
|
+
| `DIRECTIVE_BODY_WRAP` | The wrap every `:::` body parses with; declare it as your container kind's `bodyWrap` so a blank line against the fence stays with the fence |
|
|
154
|
+
| `DirectiveDefinition`, `ParsedDirective` | The registration's shape, and the parsed fence your factory receives: the fence parts, the parsed body, the exact consumed bytes |
|
|
155
|
+
| `DirectiveTier`, `DirectiveFence`, `DirectiveAttributes` | The three tiers (container, leaf, text), one parsed opener line, and what the attribute reader returns |
|
|
151
156
|
|
|
152
157
|
### Container authoring
|
|
153
158
|
|
|
154
159
|
_(pre-freeze / unstable)_ A container's **chrome** is its own furniture: the border, the title line, an icon if you like. The factory hides everything else (child-list state, ancestor wiring, the mounting of only what's visible), so your component only has to supply the chrome. Worked end to end in [the walkthrough](plugin-guide.md#walkthrough-a-conspiracy-container-end-to-end).
|
|
155
160
|
|
|
156
|
-
| Export | Role
|
|
157
|
-
| ----------------------------------------------- |
|
|
158
|
-
| `createContainerBlock` | Wire a nested-child-list container so your component is as thin as the built-in blockquote's
|
|
159
|
-
| `BlockList` | The child-list component your container renders, spread with the factory's props, as a direct child of your box
|
|
160
|
-
| `registerChromeLeaf` | Register a container's title or summary line as a kind of its own, with a sensible default keymap
|
|
161
|
-
| `chromeChild` | Build the reserved child-0 node for that line: the title text plus its newline (an empty title keeps the bare newline)
|
|
162
|
-
| `isCollapsedContainer` | Read a container's collapse state through its descriptor, so your component and the editor's own walks agree
|
|
163
|
-
| `ContainerBlock`, `ContainerBlockComponent` | What the factory returns (the child-list props, the `containerApi` you publish, the keydown handler, plus the commit, focus-exit, mode, theme and
|
|
164
|
-
| `ContainerBlockDeps`, `ContainerBlockListProps` | The factory's inputs, live getters rather than captured values, and the props `BlockList` takes
|
|
165
|
-
| `RefSlots` | The per-child reference accessors the child-list props carry
|
|
166
|
-
| `
|
|
161
|
+
| Export | Role |
|
|
162
|
+
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
163
|
+
| `createContainerBlock` | Wire a nested-child-list container so your component is as thin as the built-in blockquote's |
|
|
164
|
+
| `BlockList` | The child-list component your container renders, spread with the factory's props, as a direct child of your box |
|
|
165
|
+
| `registerChromeLeaf` | Register a container's title or summary line as a kind of its own, with a sensible default keymap |
|
|
166
|
+
| `chromeChild` | Build the reserved child-0 node for that line: the title text plus its newline (an empty title keeps the bare newline) |
|
|
167
|
+
| `isCollapsedContainer` | Read a container's collapse state through its descriptor, so your component and the editor's own walks agree |
|
|
168
|
+
| `ContainerBlock`, `ContainerBlockComponent` | What the factory returns (the child-list props, the `containerApi` you publish, the keydown handler, plus the commit, focus-exit, mode, theme, options and scroll-hold entries, and `getEditor` for this editor's `EditorContext`), and the shape that `containerApi` must satisfy. The commit can also say where the caret goes after it |
|
|
169
|
+
| `ContainerBlockDeps`, `ContainerBlockListProps` | The factory's inputs, live getters rather than captured values, and the props `BlockList` takes |
|
|
170
|
+
| `RefSlots` | The per-child reference accessors the child-list props carry |
|
|
171
|
+
| `ChildList` | A container's children as the editor walks down to one: their references, their render window, and whether the body is collapsed. `containerApi.childList()` returns it; the factory builds yours, so you'd only write one for a hand-rolled container |
|
|
172
|
+
| `ChromeLeafOptions` | `registerChromeLeaf`'s options: the name a screen reader and the block menu give the line, a CSS class for styling it, keymap overrides, the merge role |
|
|
167
173
|
|
|
168
174
|
### Editable-leaf authoring
|
|
169
175
|
|
|
170
176
|
_(pre-freeze / unstable)_ The container factory's sibling for leaves; the full story is [The editable leaf](plugin-guide.md#the-editable-leaf).
|
|
171
177
|
|
|
172
|
-
| Export | Role
|
|
173
|
-
| ----------------------------------------------------- |
|
|
174
|
-
| `createEditableLeaf` | Wire a text-editing leaf with the editor's own caret, IME, undo, selection and clipboard; one spread wires the whole surface
|
|
175
|
-
| `EditableLeaf` | What the factory returns: the spreads, the focus surface your component re-exports, the mode and option reads
|
|
176
|
-
| `EditableLeafMode` | The two modes: `'plain'` (always-editable source, per-keystroke commits) and `'render-primary'` (rendered view, reveal to edit, one commit on leaving)
|
|
177
|
-
| `EditableLeafSurfaceProps`, `EditableLeafRenderProps` | The two spreads: the source surface's, and the folded rendered view's (a render-primary block spreads both)
|
|
178
|
-
| `EditableLeafDeps` | The factory's inputs: live getters for the node, the index, the path, and your source element,
|
|
179
|
-
| `StickyColumnDirection` | Which vertical direction the caret is entering your block from, handed to `focusAtColumn` so the column carries across lines
|
|
178
|
+
| Export | Role |
|
|
179
|
+
| ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `createEditableLeaf` | Wire a text-editing leaf with the editor's own caret, IME, undo, selection and clipboard; one spread wires the whole surface |
|
|
181
|
+
| `EditableLeaf` | What the factory returns: the spreads, the focus surface your component re-exports (`afterSourceCommit` included), `sourceText`, the mode, theme and option reads, `getEditor` for this editor's `EditorContext`, and the programmatic edits (`insertMarkdown`, `reveal`, `commitSource`, `repaintSource`) |
|
|
182
|
+
| `EditableLeafMode` | The two modes: `'plain'` (always-editable source, per-keystroke commits) and `'render-primary'` (rendered view, reveal to edit, one commit on leaving) |
|
|
183
|
+
| `EditableLeafSurfaceProps`, `EditableLeafRenderProps` | The two spreads: the source surface's, and the folded rendered view's (a render-primary block spreads both) |
|
|
184
|
+
| `EditableLeafDeps` | The factory's inputs: live getters for the node, the index, the path, and your source element, the static `mode` and `singleLine` settings, and the optional rest: `isRevealed` / `setRevealed` (required in render-primary mode, where you own the swap), `commandHooks`, and the painted-source trio `renderSource`, `onSourceEdit`, `completeBareSource` |
|
|
185
|
+
| `StickyColumnDirection` | Which vertical direction the caret is entering your block from, handed to `focusAtColumn` so the column carries across lines |
|
|
180
186
|
|
|
181
187
|
### Code-block languages
|
|
182
188
|
|
|
183
|
-
_(pre-freeze / unstable)_ The syntax-highlighting registry behind fenced code. The editor bootstraps a curated
|
|
189
|
+
_(pre-freeze / unstable)_ The syntax-highlighting registry behind fenced code. The editor bootstraps a curated couple dozen (the usual suspects: javascript, python, rust, bash, sql, the C family, and friends) plus their aliases, because every grammar is static bundle weight for every consumer. `listLanguages()` tells you exactly which ones you have; a host needing more registers them itself.
|
|
184
190
|
|
|
185
|
-
Register **before mounting an editor**: a block already on screen re-tokenizes only when its own bytes next change. An unregistered language is not an error
|
|
191
|
+
Register **before mounting an editor**: a block already on screen re-tokenizes only when its own bytes next change. An unregistered language is not an error: the fence still authors, commits and round-trips, and its body renders untokenized. A language your plugin's `setup` registers highlights, and shows in the picker, only in the editors that list your plugin. `listLanguages`, `getLanguageAliases` and `highlightCode` have no editor to ask, so they answer for every installed plugin.
|
|
186
192
|
|
|
187
|
-
| Export
|
|
188
|
-
|
|
|
189
|
-
| `registerLanguage`
|
|
190
|
-
| `listLanguages`
|
|
191
|
-
| `
|
|
192
|
-
| `
|
|
193
|
-
| `
|
|
193
|
+
| Export | Role |
|
|
194
|
+
| ----------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
195
|
+
| `registerLanguage` | Add a grammar under a name, with optional aliases; register-once, so a repeat call with the same name throws (a dev server replaces it) |
|
|
196
|
+
| `listLanguages` | Every registered language once, under its canonical name, sorted: the rows a picker with every installed plugin offers |
|
|
197
|
+
| `getLanguageAliases` | The other spellings a language answers to, asked by any of them: what a picker's filter matches on |
|
|
198
|
+
| `highlightCode` | The code block's tokenizer: `(body, language)` to a text-preserving fragment of `code-tok-*` spans, for a plugin's own source surface |
|
|
199
|
+
| `LanguageGrammar` | The registry's read shape: the resolved name and its definition |
|
|
200
|
+
| `LanguageFn` | highlight.js's grammar-definition type, re-exported so you needn't import highlight.js directly (you hold it only as a transitive dep) |
|
|
201
|
+
| `sliceFencedSource`, `FencedSource` | A fenced source split into its opener line, body and closer line, each keeping its own ending; null when the first line opens no fence |
|
|
202
|
+
| `renderFencedSource` | The code block's own drawing of a fenced source: the fence lines as markers the marker-hiding modes collapse, and the body through the painter you pass (`highlightCode`, say). Text-preserving, and it keeps a line for the caret under an empty last body line |
|
|
203
|
+
| `fenceBodyAsDrawn` | The body as `renderFencedSource` draws it: the line break before the closer belongs to the closer's line, unless the body is blank or nothing closes the fence |
|
|
194
204
|
|
|
195
205
|
```ts
|
|
196
206
|
import { registerLanguage } from '@voithos-labs/aragonite/plugin';
|
|
@@ -199,55 +209,55 @@ import elixir from 'highlight.js/lib/languages/elixir';
|
|
|
199
209
|
registerLanguage('elixir', elixir, ['ex', 'exs']);
|
|
200
210
|
```
|
|
201
211
|
|
|
202
|
-
|
|
212
|
+
The picker shows `elixir` once, and `ex` and `exs` are search keys for that row, so a user typing `ex` finds it without knowing the full name.
|
|
203
213
|
|
|
204
214
|
### Inline authoring
|
|
205
215
|
|
|
206
|
-
_(pre-freeze / unstable)_ Syntax inside a paragraph: recognize it at a trigger character, render it as an **atomic widget** (one indivisible rendered thing the caret can sit beside but not inside), give it an editing policy.
|
|
207
|
-
|
|
208
|
-
| Export | Role
|
|
209
|
-
| --------------------------------------------------------- |
|
|
210
|
-
| `declarePluginInlineKind` |
|
|
211
|
-
| `declaredPluginInlineKind` | Recover a declared inline kind in another module
|
|
212
|
-
| `isInlineKindDeclared` | The is-it-there check for an inline kind
|
|
213
|
-
| `registerInlineSyntax` | Hook the inline scanner on one trigger character with your recognizer; a reserved trigger (one a built-in owns, like `[`) takes a prefix
|
|
214
|
-
| `INLINE_PRIORITIES` | The inline
|
|
215
|
-
| `InlineSyntaxRecognizer` | The recognizer contract: inspect the raw at the trigger, claim a span by returning a node, or decline with null
|
|
216
|
-
| `InlineSyntaxOptions` | The options bag: the multi-character `prefix`, the `priority`, `rewriteImage`, and `autoPair`
|
|
217
|
-
| `ImageSyntaxRewriter`, `ImageFields` | The `rewriteImage` contract, for a
|
|
218
|
-
| `registerInlineWidgetKind` | Render an inline kind as a live atomic widget: a Svelte `component` (recommended) or a hand-built `buildWidget`, never both
|
|
219
|
-
| `mintWidgetShell` |
|
|
220
|
-
| `PluginInlineKind`, `InlineNode` | The inline kind type, and the node your recognizer builds
|
|
221
|
-
| `InlineWidgetDescriptor` | The widget registration: the is-this-a-widget test, one render path, the editing policy
|
|
222
|
-
| `InlineWidgetComponentProps` | A component widget's props: frozen `{ inline, source }`, plus live getters for the mode, the theme, the document, and the content version,
|
|
223
|
-
| `InlineWidgetEditingPolicy`, `InlineWidgetEditingContext` | The policy (reveal source on caret entry, where the content sits inside the delimiters so a
|
|
224
|
-
| `isWidgetActivationClick` | Whether a click activates a widget: a Ctrl/Cmd chord while editing, a plain click in reading mode
|
|
216
|
+
_(pre-freeze / unstable)_ Syntax inside a paragraph: recognize it at a trigger character, render it as an **atomic widget** (one indivisible rendered thing the caret can sit beside but not inside), give it an editing policy. Several recognizers can share one trigger character; the editor asks them in priority order, and a **prefix handler** is one that's only asked where its multi-character prefix matches. The render paths and the tier's limits: [Inline kinds](plugin-guide.md#inline-kinds).
|
|
217
|
+
|
|
218
|
+
| Export | Role |
|
|
219
|
+
| --------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
220
|
+
| `declarePluginInlineKind` | Create an inline kind, the one-level-down twin of `declarePluginKind` |
|
|
221
|
+
| `declaredPluginInlineKind` | Recover a declared inline kind in another module |
|
|
222
|
+
| `isInlineKindDeclared` | The is-it-there check for an inline kind |
|
|
223
|
+
| `registerInlineSyntax` | Hook the inline scanner on one trigger character with your recognizer; a reserved trigger (one a built-in owns, like `[`) takes only a prefix handler, priced below `INLINE_PRIORITIES.builtin` |
|
|
224
|
+
| `INLINE_PRIORITIES` | The inline priority order, lower asked first: `prefixOverride` (40) outranks a reserved trigger's built-in case, `builtin` (50) is where that case sits and the ceiling a reserved-trigger prefix stays under, `plugin` (100) is the bare-trigger default |
|
|
225
|
+
| `InlineSyntaxRecognizer` | The recognizer contract: inspect the raw at the trigger, claim a span by returning a node, or decline with null |
|
|
226
|
+
| `InlineSyntaxOptions` | The options bag: the multi-character `prefix`, the `priority`, `rewriteImage`, and `autoPair` |
|
|
227
|
+
| `ImageSyntaxRewriter`, `ImageFields` | The `rewriteImage` contract, for a registration whose recognizer builds built-in image nodes and must write edits back in its own syntax, and the edited fields it receives |
|
|
228
|
+
| `registerInlineWidgetKind` | Render an inline kind as a live atomic widget: a Svelte `component` (recommended) or a hand-built `buildWidget`, never both |
|
|
229
|
+
| `mintWidgetShell` | Build the marked span a `buildWidget` returns, with the attributes the caret's position walk reads to know which source bytes it stands for |
|
|
230
|
+
| `PluginInlineKind`, `InlineNode` | The inline kind type, and the node your recognizer builds |
|
|
231
|
+
| `InlineWidgetDescriptor` | The widget registration: the is-this-a-widget test, one render path, the editing policy |
|
|
232
|
+
| `InlineWidgetComponentProps` | A component widget's props: frozen `{ inline, source }`, plus live getters (all always passed, so there's no default to pick) for the mode, the theme, the document, and the content version, `navigateTo` to jump to another block, optionally at an offset in it (a container path with no offset lands at the start of its first line, and an offset into its bytes lands in the child holding that byte), and `computeInlineContent`, the editor's own inline parse |
|
|
233
|
+
| `InlineWidgetEditingPolicy`, `InlineWidgetEditingContext` | The policy (reveal source on caret entry, where the content sits inside the delimiters, which offset a press on the rendered widget names via `revealOffsetAtPoint` so a click puts the caret where it landed, delete granularity, edge behavior, a selected-key handler, whether the widget claims the activation click), and the context that handler receives |
|
|
234
|
+
| `isWidgetActivationClick` | Whether a click activates a widget: a Ctrl/Cmd chord while editing, a plain click in reading mode |
|
|
225
235
|
|
|
226
236
|
### Commands and keybindings
|
|
227
237
|
|
|
228
238
|
_(pre-freeze / unstable)_ Which tier dispatches what: [Block commands](plugin-guide.md#block-commands).
|
|
229
239
|
|
|
230
|
-
| Export | Role
|
|
231
|
-
| -------------------------------------------- |
|
|
232
|
-
| `registerBlockCommand` |
|
|
233
|
-
| `registerBlockContextActions` | Add the actions a right-click on a block of `kind` offers (its context menu), ahead of the editor's own copy, replace and remove rows
|
|
234
|
-
| `BlockContextAction` | One such action: id, label, optional glyph and danger flag, and `run(ctx)`
|
|
235
|
-
| `BlockActionContext` | What `run` receives: the node, its path, `deleteBlock()` and `replaceRaw(raw)`
|
|
236
|
-
| `BlockContextActionProvider` | The registered function: `(node, path) => BlockContextAction[]`, consulted on every open
|
|
237
|
-
| `registerGlobalCommand` |
|
|
238
|
-
| `CommandId` | A built-in command's id; a vocabulary your keymaps may bind too
|
|
239
|
-
| `KeyBinding` | One keymap entry: a chord (
|
|
240
|
-
| `BlockCommandContext`, `BlockCommandHandler` | What a block command's handler receives (the focused node, read-only; the argument; `updateMetadata`, the way to commit a metadata change; the mounted component's own hooks), and the handler's signature
|
|
241
|
-
| `PluginCommandId`, `AnyCommandId` |
|
|
240
|
+
| Export | Role |
|
|
241
|
+
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
242
|
+
| `registerBlockCommand` | Create a `(kind, name)` command and get back its id, for a keymap binding to target |
|
|
243
|
+
| `registerBlockContextActions` | Add, under a name unique to `kind`, the actions a right-click on a block of `kind` offers (its context menu), ahead of the editor's own copy, replace and remove rows; listed only in the editors that activate your plugin |
|
|
244
|
+
| `BlockContextAction` | One such action: id, label, optional glyph and danger flag, and `run(ctx)` |
|
|
245
|
+
| `BlockActionContext` | What `run` receives: the node, its path, `deleteBlock()` and `replaceRaw(raw)` (one undo entry each, and `replaceRaw`'s bytes go through your kind's write rule, every line break in the document's ending), `transformPaste(text)` (the paste transforms of the plugins that editor lists), and `lineEnding`, the document's, for a line you rebuild from the block's own bytes |
|
|
246
|
+
| `BlockContextActionProvider` | The registered function: `(node, path, noun) => BlockContextAction[]`, consulted on every open; `noun` is what the menu calls the block |
|
|
247
|
+
| `registerGlobalCommand` | Create a process-wide command run against whichever editor dispatched it, optionally on a global chord; also returns its id. The handler receives that editor's `EditorContext` and the argument `runCommand(id, arg)` or the chord's binding carried |
|
|
248
|
+
| `CommandId` | A built-in command's id; a vocabulary your keymaps may bind too |
|
|
249
|
+
| `KeyBinding` | One keymap entry: a chord (`Mod` / `Alt` / `Shift` plus the key, normalized to that order), a command id, an optional baked argument. A chord with an unknown modifier or no key throws when the kind registers or is augmented |
|
|
250
|
+
| `BlockCommandContext`, `BlockCommandHandler` | What a block command's handler receives (the focused node, read-only; the argument; `updateMetadata`, the way to commit a metadata change; the mounted component's own hooks; `editor`, the dispatching editor's `EditorContext`), and the handler's signature |
|
|
251
|
+
| `PluginCommandId`, `AnyCommandId` | The id `registerBlockCommand` or `registerGlobalCommand` hands back, and the union of that and a built-in `CommandId` |
|
|
242
252
|
|
|
243
253
|
### Paste transforms
|
|
244
254
|
|
|
245
255
|
_(pre-freeze / unstable)_ The recipe: [Paste transforms](plugin-guide.md#paste-transforms).
|
|
246
256
|
|
|
247
|
-
| Export | Role
|
|
248
|
-
| ------------------------ |
|
|
249
|
-
| `registerPasteTransform` | Register a pre-parse rewrite of pasted text; transforms run at every paste site, in install order, each seeing the previous one's output, and never on load or typing |
|
|
250
|
-
| `PasteTransform` | The unit: a process-unique `name`, plus `transform(text)` returning the replacement or null for "not mine"
|
|
257
|
+
| Export | Role |
|
|
258
|
+
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
259
|
+
| `registerPasteTransform` | Register a pre-parse rewrite of pasted text; transforms run at every paste site, in install order, each seeing the previous one's output (the first gets CRLF already turned to LF), and never on load or typing |
|
|
260
|
+
| `PasteTransform` | The unit: a process-unique `name`, plus `transform(text)` returning the replacement or null for "not mine" |
|
|
251
261
|
|
|
252
262
|
### Decorations
|
|
253
263
|
|
|
@@ -263,6 +273,30 @@ _(pre-freeze / unstable)_ View-only annotations drawn over the rendered document
|
|
|
263
273
|
| `MarkDecoration`, `WidgetDecoration`, `ReplaceDecoration`, `BlockDecoration` | The four: a styled span over an inline range, a zero-width widget at an offset, a widget covering a range whose bytes stay in the document, and a whole-block treatment with an optional badge |
|
|
264
274
|
| `DecorationWidgetSpec` | How a decoration's widget renders: a Svelte `component`, or a hand-built `buildDom` |
|
|
265
275
|
|
|
276
|
+
### Inline menus
|
|
277
|
+
|
|
278
|
+
_(pre-freeze / unstable)_ A list the editor opens under the caret while the author types after a trigger: `#` for a tag, `[[` for a link to another document. You register a source per editor through `editor.inlineMenus` (your `onEditor` context); a host that owns the data reaches the same registry as `getInlineMenus()`. The editor owns the session: it notices the typed trigger, holds the arrow keys, Enter, Tab and Escape while a list is up, anchors the list to the typed range, and writes the pick over the trigger and the query as one undo entry. The caret never leaves the document. The recipe: [Recipe: a typed-trigger menu](consumer-guide.md#recipe-a-typed-trigger-menu).
|
|
279
|
+
|
|
280
|
+
| Export | Role |
|
|
281
|
+
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
282
|
+
| `InlineMenuRegistry` | The `editor.inlineMenus` surface: `addSource` registers a source and returns its handle, `open(name, { query })` types a source's trigger, then the query if given, at the caret as one undo entry and opens its list over it (what a shortcut or a toolbar button calls; `false`, writing nothing, for an unknown name, in reading mode, with no caret in prose, or a query holding a line break), `close()` dismisses, and `isOpen` is true while a list is on screen |
|
|
283
|
+
| `InlineMenuSource` | A named source: its `trigger` (one line, never empty), an `items(query)` that returns the list or a promise of it, and optionally `opensAt` (decline a trigger by position), `accepts` (end the session on a query that is no longer yours), `onCommit` (after the bytes land, with the range the pick replaced, so the caret is at `start + insert.length`; if it returns a promise, every write that lands while it is pending, up to the author's next input, is part of the pick's undo entry), and a `row` component that paints a row's content |
|
|
284
|
+
| `InlineMenuOpenOptions` | `open`'s second argument: a `query` typed after the trigger, so the list opens already narrowed |
|
|
285
|
+
| `InlineMenuSourceHandle` | The handle back: `dispose()` removes the source and closes its list |
|
|
286
|
+
| `InlineMenuItem` | One row: an `id` unique within the list, a `label`, an optional dim `detail`, an optional `icon` (a menu glyph name the default row draws), and `insert`, the bytes that replace the trigger and the query. Where two rows share an id the first is kept and the rest are dropped and reported on the `error` event. One line of inline bytes, empty allowed; a line break is refused and reported, and a block belongs in `onCommit` |
|
|
287
|
+
| `InlineMenuQuery` | What `items` is asked: the `query` typed so far, the leaf's `path`, the raw range `[start, end)` a pick would replace, and a `signal` aborted once a later keystroke supersedes the read |
|
|
288
|
+
| `InlineMenuRowProps` | What a `row` component receives: the `item`, whether it is `active`, and the `query` (for highlighting the match) |
|
|
289
|
+
|
|
290
|
+
### Insert catalogue
|
|
291
|
+
|
|
292
|
+
_(pre-freeze / unstable)_ The blocks the insert menus offer: the built-in lists, quote, divider, code block and table, then the blocks plugins add. Read it through `editor.insertCatalogue` (your `onEditor` context); a host reads the same list as `getInsertCatalogue()`.
|
|
293
|
+
|
|
294
|
+
| Export | Role |
|
|
295
|
+
| --------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
296
|
+
| `registerInsertEntry` | Add your block to every insert menu, called from `setup`. It is listed only in the editors that activate your plugin. Throws on a duplicate id and on an icon the menu cannot draw |
|
|
297
|
+
| `InsertEntry` | One entry: an `id`, a `label`, an `icon`, `keywords` a filter should also match, its `markdown`, and an optional `withArgument` giving the Markdown and dim text for `/table 3x4` |
|
|
298
|
+
| `MenuIconName` | The glyph names a menu row can draw |
|
|
299
|
+
|
|
266
300
|
### Events
|
|
267
301
|
|
|
268
302
|
_(pre-freeze / unstable)_ The payloads `EditorContext.events` delivers to an `on(name, handler)` subscription. The channel itself: [The plugin unit](plugin-guide.md#the-plugin-unit).
|
|
@@ -273,85 +307,135 @@ _(pre-freeze / unstable)_ The payloads `EditorContext.events` delivers to an `on
|
|
|
273
307
|
| `EditEvent` | The `edit` payload: `op`, the `path` it landed at, a per-op `detail`, and a `timestamp`. `op` and `detail` are correlated, so narrowing `op` narrows `detail` with it |
|
|
274
308
|
| `OperationKind` | The structural-operation vocabulary `EditEvent.op` draws from |
|
|
275
309
|
| `SelectionChangeEvent`, `EditorError` | The other two payloads worth naming: the anchor/focus pair (or null), and a contained failure with its `origin` and context |
|
|
310
|
+
| `SourceSwapEvent` | The `sourceSwap` payload: the `generation` a `source` write replaced the document at |
|
|
276
311
|
|
|
277
312
|
### Rects
|
|
278
313
|
|
|
279
314
|
_(pre-freeze / unstable)_ Where things are on screen, reached through `editor.rects` (your `onEditor` context) or the `rects` prop every block component receives.
|
|
280
315
|
|
|
281
|
-
| Export | Role
|
|
282
|
-
| ------------- |
|
|
283
|
-
| `EditorRects` | The geometry surface: a block's box, an inline range's rects (one per visual line), the native caret, a `reveal` that mounts a block the editor had skipped (it only mounts blocks in view), a `scrollTo` that mounts then brings a block into view, and a `navigateTo` that also lands the caret there, at the block's start or at an offset you name |
|
|
316
|
+
| Export | Role |
|
|
317
|
+
| ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
318
|
+
| `EditorRects` | The geometry surface: a block's box, an inline range's rects (one per visual line, or one per cell in a table), the native caret, a `reveal` that mounts a block the editor had skipped (it only mounts blocks in view), a `scrollTo` that mounts then brings a block into view, and a `navigateTo` that also lands the caret there, at the block's start or at an offset you name |
|
|
284
319
|
|
|
285
320
|
### Caret geometry
|
|
286
321
|
|
|
287
322
|
_(pre-freeze / unstable)_ What a kind fills its descriptor's `caretTargetAtPoint` with. The rendered view and the source are different strings, so only your kind knows how a press on one lines up with the other; these three are the pieces that don't depend on your grammar. The worked example is the quickstart's parrot: [The first fifteen minutes](plugin-guide.md#the-first-fifteen-minutes).
|
|
288
323
|
|
|
289
|
-
| Export | Role
|
|
290
|
-
| ------------------------- |
|
|
291
|
-
| `caretOffsetAtPoint` | The character offset in one of your own elements nearest a viewport point; the point clamps into that element's box first, so a press on your chrome still names one, and null means the element holds no position at all |
|
|
292
|
-
| `CaretTarget` | What the hook answers: the child path to the leaf (empty when your block is the leaf) and the offset inside it
|
|
293
|
-
| `CURSOR_END`, `CursorEnd` | The offset meaning "wherever that leaf ends", and its type; a plain `0` is the other end, since that one is a real offset
|
|
324
|
+
| Export | Role |
|
|
325
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
326
|
+
| `caretOffsetAtPoint` | The character offset in one of your own elements nearest a viewport point; the point clamps into that element's box first, so a press on your chrome still names one, and a press in its top or bottom padding takes the column under it on the nearest line; null means the element holds no position at all |
|
|
327
|
+
| `CaretTarget` | What the hook answers: the child path to the leaf (empty when your block is the leaf) and the offset inside it |
|
|
328
|
+
| `CURSOR_END`, `CursorEnd` | The offset meaning "wherever that leaf ends", and its type; a plain `0` is the other end, since that one is a real offset |
|
|
329
|
+
|
|
330
|
+
### Pointer gestures
|
|
331
|
+
|
|
332
|
+
_(pre-freeze / unstable)_ One attribute, for a block whose drags are its own (a diagram you pan, a canvas you draw on). Without it the editor reads the press as the start of a selection, and your pan runs under a painted block range. Calling `stopPropagation()` in your own handler doesn't help: Svelte delivers pointer events from the app root, so the editor's listener has already run.
|
|
333
|
+
|
|
334
|
+
| Export | Role |
|
|
335
|
+
| ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
336
|
+
| `POINTER_GESTURE_ATTR` | Put it on the element whose drags are yours. A press inside it is left alone by drag-to-select, and by the double and triple click too, as long as the element sits outside any `contenteditable` (an inline widget inside your own editable text follows the inline widget's rule instead, where a third click selects the block unless the editor already holds that widget selected whole). The editor reads it at press time, so declare it always or only while your gesture is armed |
|
|
337
|
+
|
|
338
|
+
```svelte
|
|
339
|
+
<div class="viewport" {...{ [POINTER_GESTURE_ATTR]: focused ? '' : undefined }} onpointerdown={beginPan}>
|
|
340
|
+
```
|
|
341
|
+
|
|
342
|
+
That is what mermaid does: unfocused, a drag on the diagram selects like it would on any block; focused, it pans.
|
|
294
343
|
|
|
295
344
|
### Selection geometry
|
|
296
345
|
|
|
297
346
|
_(pre-freeze / unstable)_ The selection shapes a decoration source or geometry consumer reads.
|
|
298
347
|
|
|
299
|
-
| Export | Role
|
|
300
|
-
| ----------------------------------- |
|
|
301
|
-
| `EditorSelection`, `SelectionPoint` | The `selectionChange` payload, an anchor/focus pair, and one endpoint of it: a `{ path, offset }`. Inside a table `offset` counts cells rather than characters, and `cellCoordinate`
|
|
302
|
-
| `SELECTION_END`, `SelectionEnd` | The importable "through the end of this block's measurable content" value `rangeRects` accepts as `end`, and its type
|
|
348
|
+
| Export | Role |
|
|
349
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
350
|
+
| `EditorSelection`, `SelectionPoint` | The `selectionChange` payload, an anchor/focus pair, and one endpoint of it: a `{ path, offset }`. Inside a table `offset` counts cells rather than characters, and `cellCoordinate: true` says so on every such point; [the consumer guide](consumer-guide.md#reading-the-document-and-the-selection) has the rest |
|
|
351
|
+
| `SELECTION_END`, `SelectionEnd` | The importable "through the end of this block's measurable content" value `rangeRects` accepts as `end`, and its type |
|
|
303
352
|
|
|
304
353
|
### Parse and serialize
|
|
305
354
|
|
|
306
355
|
_(pre-freeze / unstable)_ The editor's own parse and serialize entries, re-exported here so an opener or a transform never digs into the package's internals.
|
|
307
356
|
|
|
308
|
-
| Export | Role
|
|
309
|
-
| ----------------------------------------- |
|
|
310
|
-
| `parse` | Parse a body of Markdown into a document you can lift children from
|
|
311
|
-
| `ParseScope` | What a parse entry is told about its input: a whole document, or one block's bytes (`'fragment'`)
|
|
312
|
-
| `parseContainerBody`, `ContainerBodyWrap` | Parse a body that sits between your container's own fence lines, keeping the separating blank lines out of the children; the wrap says which fence lines exist, and matches your kind's `bodyWrap` |
|
|
313
|
-
| `serialize` | A whole document back to its exact source bytes
|
|
314
|
-
| `serializeChildren` | Child nodes joined back into their exact source bytes
|
|
315
|
-
| `Document` | The parsed-document shape both parse entries return
|
|
316
|
-
| `splitLines` | Split source into the parsed lines every line-scoped helper here consumes
|
|
317
|
-
| `ParsedLine` | One source line: its text, its bytes with the ending, the ending itself, its offsets
|
|
318
|
-
| `isBlankLine` | The GFM blank-line test, spaces and tabs only. Don't substitute `trim()`: it would let a pasted non-breaking space split a block
|
|
319
|
-
| `
|
|
320
|
-
| `
|
|
357
|
+
| Export | Role |
|
|
358
|
+
| ----------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
359
|
+
| `parse` | Parse a body of Markdown into a document you can lift children from |
|
|
360
|
+
| `ParseScope` | What a parse entry is told about its input: a whole document, or one block's bytes (`'fragment'`) |
|
|
361
|
+
| `parseContainerBody`, `ContainerBodyWrap` | Parse a body that sits between your container's own fence lines, keeping the separating blank lines out of the children; the wrap says which fence lines exist, and matches your kind's `bodyWrap`. The options take a `scope` and the grammar, both required (pass the grammar your opener was given, so the body reads with the syntaxes the editor has on), and an optional `depth` |
|
|
362
|
+
| `serialize` | A whole document back to its exact source bytes |
|
|
363
|
+
| `serializeChildren` | Child nodes joined back into their exact source bytes |
|
|
364
|
+
| `Document` | The parsed-document shape both parse entries return |
|
|
365
|
+
| `splitLines` | Split source into the parsed lines every line-scoped helper here consumes |
|
|
366
|
+
| `ParsedLine` | One source line: its text, its bytes with the ending, the ending itself, its offsets |
|
|
367
|
+
| `isBlankLine` | The GFM blank-line test, spaces and tabs only. Don't substitute `trim()`: it would let a pasted non-breaking space split a block |
|
|
368
|
+
| `isBlankText` | The same test over a whole block's text, line breaks allowed. Use it for "is this block empty?", since `trim()` also throws away a non-breaking space, and that's a character someone typed |
|
|
369
|
+
| `isWhitespaceChar` | Whether one character is Markdown whitespace: a space, a tab, or a line-break character (GFM also counts vertical tab and form feed). A non-breaking space isn't, so ask this where your grammar would've reached for `/\s/` |
|
|
370
|
+
| `trimWhitespace` | `trim()`, but Markdown's: the characters `isWhitespaceChar` accepts come off both ends, and a non-breaking space stays. Use it on an info string or a caption before you show it |
|
|
371
|
+
| `trimTrailingLineEnding` | Cut the one trailing line ending (LF or CRLF) off a block's bytes, giving the text you display |
|
|
372
|
+
| `ownTrailingLineEnding` | The ending a block's bytes close with (`''` when they have none): what you put back after editing the display |
|
|
373
|
+
| `trailingLineEnding` | The ending a line rebuilt from a block's bytes takes: the block's own, else the fallback you pass (a write rule's or a context action's `ctx.lineEnding`, or `documentLineEnding` of a document you hold) |
|
|
374
|
+
| `firstLineEnding` | The first line break in some bytes, or `null`. In a document with one ending (nearly all of them), any break in your block's bytes is the document's |
|
|
375
|
+
| `documentLineEnding` | The ending every line written into a document takes: its first line break, else LF |
|
|
376
|
+
| `LineEnding` | `'\n'` or `'\r\n'` |
|
|
377
|
+
| `displayLines` | A block's display as lines, each line's text apart from its ending, so a `\r` never reaches a line match |
|
|
378
|
+
| `joinDisplayLines` | Lines from `displayLines` back into their exact bytes |
|
|
379
|
+
| `normalizeLineEndings` | CRLF to LF, for text arriving from outside the document (a plugin-owned input surface) |
|
|
321
380
|
|
|
322
381
|
### Grammar scanners
|
|
323
382
|
|
|
324
383
|
_(pre-freeze / unstable)_ The built-in rules for three grammars a plugin commonly claims, exported so you reuse them instead of forking the spec (the spec is longer than it looks, every time, trust me).
|
|
325
384
|
|
|
326
|
-
| Export
|
|
327
|
-
|
|
|
328
|
-
| `matchFenceOpen`
|
|
329
|
-
| `matchFenceClose`
|
|
330
|
-
| `escalatedFenceLength`
|
|
331
|
-
| `FenceOpen`
|
|
332
|
-
| `
|
|
333
|
-
| `
|
|
385
|
+
| Export | Role |
|
|
386
|
+
| ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
387
|
+
| `matchFenceOpen` | Recognize a CommonMark code-fence opener line, keeping the verbatim indent and info bytes a byte-exact rebuild needs |
|
|
388
|
+
| `matchFenceClose` | Is this line the closer for a matched opener (same marker, at least its run length)? |
|
|
389
|
+
| `escalatedFenceLength` | The fence run a body forces so none of its lines reads as the closer; a floor, never a shortening. A kind that rebuilds its own raw around a body has to apply it, and grow the closer to match |
|
|
390
|
+
| `FenceOpen` | A matched opener: marker, run length, trimmed `info`, verbatim `indent` and `infoRaw` |
|
|
391
|
+
| `matchFenceInfo` | Build an opener matcher that claims only fences whose info string's first word is your token: `matchFenceInfo('mermaid')` is how the bundled diagram kind takes ` ```mermaid ` from the code block |
|
|
392
|
+
| `findFenceCloser`, `FenceRun` | The index of the first line in a range that closes a fence of that marker and run length (the closer the parser would pick), or -1 |
|
|
393
|
+
| `scanFence`, `FenceScan` | A fence's extent from its opener line, as an opener's `tryOpen` needs it: the closer's index (-1 when nothing closes it), the lines consumed, the exact bytes, and the body between the fence lines |
|
|
394
|
+
| `fenceAnatomy`, `FenceAnatomy` | Where a fenced block's parts sit in its bytes: the opener's indent, marker run and info string, the body, and the closer line; null when the first line opens no fence |
|
|
395
|
+
| `fenceRawWrite`, `fenceShapeOfRaw`, `FenceShape` | The code block's write rule for any kind that holds its own fence: declare `rawWrite: fenceRawWrite(fenceShapeOfRaw)` and a write from outside your block (a find/replace, a range delete, a paste) keeps one opener and one closer, growing both runs past a body line that would close the block early |
|
|
396
|
+
| `htmlBlockTagLineMatcher` | Build a recognizer answering `'open'`, `'close'`, or null for one tag name's HTML block line, in every spelling the spec passes through (indented, upper-cased, trailing space), not just the canonical one |
|
|
397
|
+
| `blockquoteExtent` | Scan a blockquote's full extent (CommonMark lazy continuation) from a start line: its exact bytes plus the index past it (a slice bound, not a consumed count), no child decomposition. Its optional grammar argument defaults to every installed plugin's |
|
|
334
398
|
|
|
335
399
|
### Node access and metadata
|
|
336
400
|
|
|
337
401
|
_(pre-freeze / unstable, beyond the stable metadata pair `setPluginMetadata` / `getPluginMetadata`)_ The document tree from a plugin's side of the glass: what you read arrives read-only, and what you build yourself stays writable ([Views](plugin-guide.md#views-what-you-read-what-you-own)).
|
|
338
402
|
|
|
339
|
-
| Export | Role
|
|
340
|
-
| ---------------------------------------- |
|
|
341
|
-
| `CstNode` | The writable tree-node shape you construct: what a factory builds and a `rebuildRaw` mutates
|
|
342
|
-
| `NodeView`, `DocumentView` | The read-only views every read surface hands you. Writing bytes through one is a compile error
|
|
343
|
-
| `setPluginMetadata`, `getPluginMetadata` | Store and read your kind's own typed per-node data, no casting; keep the stored shape primitive-valued
|
|
344
|
-
| `getContentRange`, `ContentRange` | The content span inside a block's raw, syntax markers excluded (a heading's
|
|
345
|
-
| `headingLevel` | A heading's level, ATX or setext, null for anything else: the outline read a table-of-contents plugin wants
|
|
346
|
-
| `computeInlineContent` | Inline-parse a prose leaf,
|
|
347
|
-
| `isProseKind` | Does this kind host inline content? The gate that keeps a code block's bytes out of an inline walk
|
|
403
|
+
| Export | Role |
|
|
404
|
+
| ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
405
|
+
| `CstNode` | The writable tree-node shape you construct: what a factory builds and a `rebuildRaw` mutates |
|
|
406
|
+
| `NodeView`, `DocumentView` | The read-only views every read surface hands you. Writing bytes through one is a compile error |
|
|
407
|
+
| `setPluginMetadata`, `getPluginMetadata` | Store and read your kind's own typed per-node data, no casting; keep the stored shape primitive-valued |
|
|
408
|
+
| `getContentRange`, `ContentRange` | The content span inside a block's raw, syntax markers excluded (a heading's `#`s at either end, a setext underline) |
|
|
409
|
+
| `headingLevel` | A heading's level, ATX or setext, null for anything else: the outline read a table-of-contents plugin wants |
|
|
410
|
+
| `computeInlineContent` | Inline-parse a prose leaf with every installed plugin's syntax, for a pipeline with no editor mounted; inside an editor use `editor.computeInlineContent`, which reads only what that editor lists. Uncached; with no document to define them, reference-style links come back as plain text |
|
|
411
|
+
| `isProseKind` | Does this kind host inline content? The gate that keeps a code block's bytes out of an inline walk |
|
|
412
|
+
| `walkBlocks` | Visit every block under a document or a block, parents first, each with its path (yours to keep). Return `'skip'` to leave a block's children out, `'stop'` to quit (it returns true). Walking a subtree? Pass its path third to get document paths |
|
|
413
|
+
| `blockNodeAt` | The block at a path, or null when there's none. The empty path is the document itself, which isn't a block, so that's null too |
|
|
414
|
+
|
|
415
|
+
### Injected renderers
|
|
416
|
+
|
|
417
|
+
_(pre-freeze / unstable)_ For a block or widget drawn by a library the host hands your plugin (KaTeX, mermaid). A **renderer slot** is the one place that library plugs in: your plugin's setup calls `set`, your component calls `render`, and the slot handles the caching and the fallbacks. The [render-primary recipe](plugin-guide.md#recipe-a-render-primary-block) walks through one.
|
|
418
|
+
|
|
419
|
+
| Export | Role |
|
|
420
|
+
| ----------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
421
|
+
| `createRendererSlot` | A slot for a renderer that answers right away. Each render is cached under the editor's theme plus your `key(input)`, so a theme switch misses the cache and switching back is a hit. With no renderer set you get `missing(input)`; when it throws, `failed(input, error)`, cached like a success. Pass `cloneOnRead` when the output holds a live DOM node |
|
|
422
|
+
| `createAsyncRendererSlot` | The same for a renderer that returns a promise. The promise is what's cached, so two blocks asking for one diagram share a single call, and a rejection resolves through `failed` |
|
|
423
|
+
| `RendererSlot`, `AsyncRendererSlot` | What the two hand back: `set(renderer)` (`null` removes it, and either way the cache empties), `configured`, and `render(input, ctx)`. `resetPluginPlatformForTests` removes the renderer too |
|
|
424
|
+
| `RendererSlotSpec` | What you pass either one: `key`, `missing`, `failed`, and an optional `cap` (256 renders by default) |
|
|
425
|
+
| `SyncRendererSlotSpec` | `createRendererSlot`'s spec: a `RendererSlotSpec` plus an optional `cloneOnRead(value)`, which hands each caller its own copy of a cached value. The async slot caches a promise, so it has no use for one |
|
|
426
|
+
| `RenderContext` | `{ theme }`, the second argument to every `render` and to your renderer. It's required, so nothing gets drawn or cached without a theme. Read the theme with `getTheme()` inside your render effect, since that read is what redraws the block on a switch |
|
|
427
|
+
| `renderSourceFallback` | `renderSourceFallback(source, message)` builds the typed source in the code font, with `message` on hover: a decent `missing` or `failed` output for anything drawn from source text. It's neutral, so add your own error color where a failure should look like one (math does) |
|
|
348
428
|
|
|
349
429
|
### Performance helpers
|
|
350
430
|
|
|
351
|
-
_(pre-freeze / unstable)_ Two small tools the renderer
|
|
431
|
+
_(pre-freeze / unstable)_ Two small tools: the cache under the renderer slot, and a scan index the inline recognizers lean on.
|
|
352
432
|
|
|
353
433
|
| Export | Role |
|
|
354
434
|
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
355
435
|
| `createBoundedMemo` | A bounded, least-recently-used memo for per-source work. Async work stores the promise (in-flight renders shared, failures cached like successes); `cloneOnRead` covers a cached value holding a live DOM node |
|
|
356
436
|
| `BoundedMemoOptions` | The memo's options: the entry `cap`, the optional `cloneOnRead` |
|
|
357
437
|
| `createScanIndex` | Turn a per-block position collector into a "first candidate at or after this offset" lookup (-1 when none), so a recognizer's decline costs one block scan instead of one per trigger |
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
Working on aragonite itself and adding an export? Give it a row in its group, tagged the way its entry-module section is tagged. A test (`src/lib/test/plugins/plugin-guide-coverage.test.ts`) diffs this page against the entry module and fails naming any export without a row. It finds the catalog by the exact `## API reference` heading, so if you rename the heading, rename it there too.
|