@voithos-labs/aragonite 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +661 -0
- package/README.md +365 -0
- package/THIRD-PARTY-NOTICES.md +102 -0
- package/dist/a11y-strings.d.ts +46 -0
- package/dist/a11y-strings.js +62 -0
- package/dist/action-contracts.d.ts +301 -0
- package/dist/action-contracts.js +5 -0
- package/dist/active-editor.d.ts +16 -0
- package/dist/active-editor.js +67 -0
- package/dist/ambient/ambient-cursor.d.ts +41 -0
- package/dist/ambient/ambient-cursor.js +120 -0
- package/dist/ambient/ambient-dom.d.ts +9 -0
- package/dist/ambient/ambient-dom.js +102 -0
- package/dist/assert.d.ts +6 -0
- package/dist/assert.js +17 -0
- package/dist/block-component.d.ts +274 -0
- package/dist/block-component.js +43 -0
- package/dist/block-id.d.ts +14 -0
- package/dist/block-id.js +34 -0
- package/dist/bounded-memo.d.ts +14 -0
- package/dist/bounded-memo.js +32 -0
- package/dist/components/BlockDragHandle.svelte +66 -0
- package/dist/components/BlockDragHandle.svelte.d.ts +18 -0
- package/dist/components/BlockHost.svelte +328 -0
- package/dist/components/BlockHost.svelte.d.ts +15 -0
- package/dist/components/BlockList.svelte +114 -0
- package/dist/components/BlockList.svelte.d.ts +16 -0
- package/dist/components/DecorationOverlay.svelte +156 -0
- package/dist/components/DecorationOverlay.svelte.d.ts +14 -0
- package/dist/components/Editor.svelte +1849 -0
- package/dist/components/Editor.svelte.d.ts +49 -0
- package/dist/components/GapCaret.svelte +226 -0
- package/dist/components/GapCaret.svelte.d.ts +9 -0
- package/dist/components/SearchBar.svelte +243 -0
- package/dist/components/SearchBar.svelte.d.ts +7 -0
- package/dist/components/SelectionOverlay.svelte +171 -0
- package/dist/components/SelectionOverlay.svelte.d.ts +14 -0
- package/dist/components/block-content-selector.d.ts +12 -0
- package/dist/components/block-content-selector.js +12 -0
- package/dist/components/blocks/BlockquoteBlock.svelte +32 -0
- package/dist/components/blocks/BlockquoteBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/ThematicBreakBlock.svelte +156 -0
- package/dist/components/blocks/ThematicBreakBlock.svelte.d.ts +17 -0
- package/dist/components/blocks/code/CodeBlock.svelte +726 -0
- package/dist/components/blocks/code/CodeBlock.svelte.d.ts +23 -0
- package/dist/components/blocks/code/CodeLanguageChip.svelte +127 -0
- package/dist/components/blocks/code/CodeLanguageChip.svelte.d.ts +14 -0
- package/dist/components/blocks/code/code-beforeinput.d.ts +30 -0
- package/dist/components/blocks/code/code-beforeinput.js +40 -0
- package/dist/components/blocks/code/code-bootstrap.d.ts +8 -0
- package/dist/components/blocks/code/code-bootstrap.js +54 -0
- package/dist/components/blocks/code/code-editing.d.ts +28 -0
- package/dist/components/blocks/code/code-editing.js +79 -0
- package/dist/components/blocks/code/code-enter.d.ts +22 -0
- package/dist/components/blocks/code/code-enter.js +19 -0
- package/dist/components/blocks/code/code-fence-boundary.d.ts +77 -0
- package/dist/components/blocks/code/code-fence-boundary.js +169 -0
- package/dist/components/blocks/code/code-fence-exit.d.ts +24 -0
- package/dist/components/blocks/code/code-fence-exit.js +36 -0
- package/dist/components/blocks/code/code-indent.d.ts +14 -0
- package/dist/components/blocks/code/code-indent.js +87 -0
- package/dist/components/blocks/code/code-languages.d.ts +15 -0
- package/dist/components/blocks/code/code-languages.js +30 -0
- package/dist/components/blocks/code/code-paste-surface.d.ts +6 -0
- package/dist/components/blocks/code/code-paste-surface.js +29 -0
- package/dist/components/blocks/code/code-paste.d.ts +24 -0
- package/dist/components/blocks/code/code-paste.js +21 -0
- package/dist/components/blocks/code/code-renderer.d.ts +18 -0
- package/dist/components/blocks/code/code-renderer.js +249 -0
- package/dist/components/blocks/directive/DirectiveContainerBlock.svelte +51 -0
- package/dist/components/blocks/directive/DirectiveContainerBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/directive/activate-directives.d.ts +7 -0
- package/dist/components/blocks/directive/activate-directives.js +23 -0
- package/dist/components/blocks/editable-leaf.d.ts +126 -0
- package/dist/components/blocks/editable-leaf.js +410 -0
- package/dist/components/blocks/editable-surface.d.ts +209 -0
- package/dist/components/blocks/editable-surface.js +331 -0
- package/dist/components/blocks/list/ListBlock.svelte +162 -0
- package/dist/components/blocks/list/ListBlock.svelte.d.ts +11 -0
- package/dist/components/blocks/list/ListItemBlock.svelte +324 -0
- package/dist/components/blocks/list/ListItemBlock.svelte.d.ts +14 -0
- package/dist/components/blocks/list/task-checkbox.d.ts +3 -0
- package/dist/components/blocks/list/task-checkbox.js +33 -0
- package/dist/components/blocks/plain-text-backend.d.ts +21 -0
- package/dist/components/blocks/plain-text-backend.js +47 -0
- package/dist/components/blocks/surface-wiring.svelte.d.ts +18 -0
- package/dist/components/blocks/surface-wiring.svelte.js +68 -0
- package/dist/components/blocks/table/TableActionMenu.svelte +267 -0
- package/dist/components/blocks/table/TableActionMenu.svelte.d.ts +15 -0
- package/dist/components/blocks/table/TableBlock.svelte +765 -0
- package/dist/components/blocks/table/TableBlock.svelte.d.ts +30 -0
- package/dist/components/blocks/table/TableCellBlock.svelte +1075 -0
- package/dist/components/blocks/table/TableCellBlock.svelte.d.ts +30 -0
- package/dist/components/blocks/table/TableGrip.svelte +91 -0
- package/dist/components/blocks/table/TableGrip.svelte.d.ts +8 -0
- package/dist/components/blocks/table/TableRowBlock.svelte +233 -0
- package/dist/components/blocks/table/TableRowBlock.svelte.d.ts +34 -0
- package/dist/components/blocks/table/cell-clipboard.d.ts +23 -0
- package/dist/components/blocks/table/cell-clipboard.js +34 -0
- package/dist/components/blocks/table/cell-keydown-plan.d.ts +37 -0
- package/dist/components/blocks/table/cell-keydown-plan.js +66 -0
- package/dist/components/blocks/table/cell-pointer.d.ts +58 -0
- package/dist/components/blocks/table/cell-pointer.js +153 -0
- package/dist/components/blocks/table/cell-render.d.ts +51 -0
- package/dist/components/blocks/table/cell-render.js +98 -0
- package/dist/components/blocks/table/cell-table-commands.d.ts +12 -0
- package/dist/components/blocks/table/cell-table-commands.js +21 -0
- package/dist/components/blocks/table/cell-x-mapping.d.ts +6 -0
- package/dist/components/blocks/table/cell-x-mapping.js +16 -0
- package/dist/components/blocks/table/selected-cells.d.ts +19 -0
- package/dist/components/blocks/table/selected-cells.js +35 -0
- package/dist/components/blocks/table/table-caret-at-point.d.ts +8 -0
- package/dist/components/blocks/table/table-caret-at-point.js +35 -0
- package/dist/components/blocks/table/table-cell-paste.d.ts +16 -0
- package/dist/components/blocks/table/table-cell-paste.js +75 -0
- package/dist/components/blocks/table/table-drag-hit-test.d.ts +5 -0
- package/dist/components/blocks/table/table-drag-hit-test.js +20 -0
- package/dist/components/blocks/table/table-drop-target.d.ts +1 -0
- package/dist/components/blocks/table/table-drop-target.js +16 -0
- package/dist/components/blocks/table/table-menu-model.d.ts +52 -0
- package/dist/components/blocks/table/table-menu-model.js +78 -0
- package/dist/components/blocks/table/table-navigation.d.ts +8 -0
- package/dist/components/blocks/table/table-navigation.js +22 -0
- package/dist/components/blocks/table/table-reorder-drag.d.ts +78 -0
- package/dist/components/blocks/table/table-reorder-drag.js +97 -0
- package/dist/components/blocks/text/TextEditableBlock.svelte +1012 -0
- package/dist/components/blocks/text/TextEditableBlock.svelte.d.ts +33 -0
- package/dist/components/blocks/text/click-snap-guard.d.ts +8 -0
- package/dist/components/blocks/text/click-snap-guard.js +19 -0
- package/dist/components/blocks/text/composition-seat.d.ts +50 -0
- package/dist/components/blocks/text/composition-seat.js +65 -0
- package/dist/components/blocks/text/construct-edge-delete.d.ts +47 -0
- package/dist/components/blocks/text/construct-edge-delete.js +164 -0
- package/dist/components/blocks/text/construct-reveal.d.ts +39 -0
- package/dist/components/blocks/text/construct-reveal.js +164 -0
- package/dist/components/blocks/text/edge-policy-dispatch.d.ts +91 -0
- package/dist/components/blocks/text/edge-policy-dispatch.js +457 -0
- package/dist/components/blocks/text/edge-seat.d.ts +42 -0
- package/dist/components/blocks/text/edge-seat.js +197 -0
- package/dist/components/blocks/text/hidden-suffix.d.ts +10 -0
- package/dist/components/blocks/text/hidden-suffix.js +15 -0
- package/dist/components/blocks/text/link-at-point.d.ts +33 -0
- package/dist/components/blocks/text/link-at-point.js +47 -0
- package/dist/components/blocks/text/link-source-bytes.d.ts +37 -0
- package/dist/components/blocks/text/link-source-bytes.js +161 -0
- package/dist/components/blocks/text/live-join-seam.d.ts +15 -0
- package/dist/components/blocks/text/live-join-seam.js +327 -0
- package/dist/components/blocks/text/live-selection-edit.d.ts +68 -0
- package/dist/components/blocks/text/live-selection-edit.js +120 -0
- package/dist/components/blocks/text/live-split-rebalance.d.ts +56 -0
- package/dist/components/blocks/text/live-split-rebalance.js +239 -0
- package/dist/components/blocks/text/marker-completion.d.ts +18 -0
- package/dist/components/blocks/text/marker-completion.js +29 -0
- package/dist/components/blocks/text/pending-mark-insert.d.ts +37 -0
- package/dist/components/blocks/text/pending-mark-insert.js +188 -0
- package/dist/components/blocks/text/screen-diff.d.ts +20 -0
- package/dist/components/blocks/text/screen-diff.js +39 -0
- package/dist/components/blocks/text/text-clipboard.d.ts +70 -0
- package/dist/components/blocks/text/text-clipboard.js +131 -0
- package/dist/components/blocks/text/text-keydown.d.ts +39 -0
- package/dist/components/blocks/text/text-keydown.js +80 -0
- package/dist/components/blocks/text/text-render.d.ts +67 -0
- package/dist/components/blocks/text/text-render.js +215 -0
- package/dist/components/blocks/text/widget-adjacency.d.ts +30 -0
- package/dist/components/blocks/text/widget-adjacency.js +68 -0
- package/dist/components/blocks/text/widget-interaction.d.ts +90 -0
- package/dist/components/blocks/text/widget-interaction.js +591 -0
- package/dist/components/blocks/widget-portal.d.ts +54 -0
- package/dist/components/blocks/widget-portal.js +136 -0
- package/dist/components/built-in-blocks.d.ts +7 -0
- package/dist/components/built-in-blocks.js +77 -0
- package/dist/components/editor-root-clipboard.d.ts +29 -0
- package/dist/components/editor-root-clipboard.js +105 -0
- package/dist/components/editor-root-keydown.d.ts +47 -0
- package/dist/components/editor-root-keydown.js +88 -0
- package/dist/components/editor-root-listeners.d.ts +44 -0
- package/dist/components/editor-root-listeners.js +112 -0
- package/dist/components/image/ImageOverlayHost.svelte +115 -0
- package/dist/components/image/ImageOverlayHost.svelte.d.ts +20 -0
- package/dist/components/image/ImageProperties.svelte +153 -0
- package/dist/components/image/ImageProperties.svelte.d.ts +14 -0
- package/dist/components/image/ImageResizeHandles.svelte +188 -0
- package/dist/components/image/ImageResizeHandles.svelte.d.ts +10 -0
- package/dist/components/image/image-edit-commit.d.ts +38 -0
- package/dist/components/image/image-edit-commit.js +159 -0
- package/dist/components/image/image-resize.d.ts +11 -0
- package/dist/components/image/image-resize.js +38 -0
- package/dist/components/image/image-source-bytes.d.ts +15 -0
- package/dist/components/image/image-source-bytes.js +73 -0
- package/dist/components/image/image-widget-editing.d.ts +7 -0
- package/dist/components/image/image-widget-editing.js +41 -0
- package/dist/components/image/widget-dom.d.ts +11 -0
- package/dist/components/image/widget-dom.js +110 -0
- package/dist/components/image/widget-selection-state.svelte.d.ts +18 -0
- package/dist/components/image/widget-selection-state.svelte.js +26 -0
- package/dist/components/link-card/LinkCard.svelte +190 -0
- package/dist/components/link-card/LinkCard.svelte.d.ts +18 -0
- package/dist/components/link-card/LinkCardHost.svelte +181 -0
- package/dist/components/link-card/LinkCardHost.svelte.d.ts +25 -0
- package/dist/components/link-card/link-card-commit.d.ts +50 -0
- package/dist/components/link-card/link-card-commit.js +134 -0
- package/dist/components/link-card/link-card-entry.d.ts +39 -0
- package/dist/components/link-card/link-card-entry.js +51 -0
- package/dist/components/link-card/link-card-state.svelte.d.ts +44 -0
- package/dist/components/link-card/link-card-state.svelte.js +46 -0
- package/dist/components/lrd-map-gate.d.ts +18 -0
- package/dist/components/lrd-map-gate.js +22 -0
- package/dist/components/paste-image-arm.d.ts +29 -0
- package/dist/components/paste-image-arm.js +61 -0
- package/dist/components/portal.d.ts +11 -0
- package/dist/components/portal.js +29 -0
- package/dist/core/directive/activate.d.ts +8 -0
- package/dist/core/directive/activate.js +25 -0
- package/dist/core/directive/container-opener.d.ts +7 -0
- package/dist/core/directive/container-opener.js +162 -0
- package/dist/core/directive/grammar.d.ts +50 -0
- package/dist/core/directive/grammar.js +88 -0
- package/dist/core/directive/kinds.d.ts +31 -0
- package/dist/core/directive/kinds.js +137 -0
- package/dist/core/directive/registry.d.ts +39 -0
- package/dist/core/directive/registry.js +49 -0
- package/dist/core/directive/text-recognizer.d.ts +8 -0
- package/dist/core/directive/text-recognizer.js +87 -0
- package/dist/core/escapable.d.ts +6 -0
- package/dist/core/escapable.js +6 -0
- package/dist/core/inline/backticks.d.ts +16 -0
- package/dist/core/inline/backticks.js +62 -0
- package/dist/core/inline/character-refs.d.ts +7 -0
- package/dist/core/inline/character-refs.js +70 -0
- package/dist/core/inline/destination-bytes.d.ts +7 -0
- package/dist/core/inline/destination-bytes.js +14 -0
- package/dist/core/inline/entity-widget.d.ts +11 -0
- package/dist/core/inline/entity-widget.js +21 -0
- package/dist/core/inline/format-toggle.d.ts +50 -0
- package/dist/core/inline/format-toggle.js +533 -0
- package/dist/core/inline/html-entities.d.ts +8 -0
- package/dist/core/inline/html-entities.js +2134 -0
- package/dist/core/inline/html-tag-grammar.d.ts +16 -0
- package/dist/core/inline/html-tag-grammar.js +58 -0
- package/dist/core/inline/image-dimensions.d.ts +6 -0
- package/dist/core/inline/image-dimensions.js +42 -0
- package/dist/core/inline/index.d.ts +42 -0
- package/dist/core/inline/index.js +77 -0
- package/dist/core/inline/inline-cache.d.ts +20 -0
- package/dist/core/inline/inline-cache.js +28 -0
- package/dist/core/inline/inline-widgets.d.ts +124 -0
- package/dist/core/inline/inline-widgets.js +131 -0
- package/dist/core/inline/link-reference-resolver.d.ts +21 -0
- package/dist/core/inline/link-reference-resolver.js +46 -0
- package/dist/core/inline/raw-html-widget.d.ts +10 -0
- package/dist/core/inline/raw-html-widget.js +22 -0
- package/dist/core/inline/scan/autolinks.d.ts +23 -0
- package/dist/core/inline/scan/autolinks.js +354 -0
- package/dist/core/inline/scan/brackets.d.ts +11 -0
- package/dist/core/inline/scan/brackets.js +284 -0
- package/dist/core/inline/scan/code-spans.d.ts +7 -0
- package/dist/core/inline/scan/code-spans.js +27 -0
- package/dist/core/inline/scan/emphasis.d.ts +10 -0
- package/dist/core/inline/scan/emphasis.js +276 -0
- package/dist/core/inline/scan/index.d.ts +7 -0
- package/dist/core/inline/scan/index.js +176 -0
- package/dist/core/inline/scan/plugin-syntax.d.ts +62 -0
- package/dist/core/inline/scan/plugin-syntax.js +150 -0
- package/dist/core/inline/scan/scan-state.d.ts +47 -0
- package/dist/core/inline/scan/scan-state.js +48 -0
- package/dist/core/inline/scan/simple-nodes.d.ts +14 -0
- package/dist/core/inline/scan/simple-nodes.js +53 -0
- package/dist/core/inline/scan/url.d.ts +12 -0
- package/dist/core/inline/scan/url.js +82 -0
- package/dist/core/inline/transparency.d.ts +8 -0
- package/dist/core/inline/transparency.js +39 -0
- package/dist/core/inline/visibility.d.ts +81 -0
- package/dist/core/inline/visibility.js +144 -0
- package/dist/core/inline/walk.d.ts +14 -0
- package/dist/core/inline/walk.js +29 -0
- package/dist/core/inline-render.d.ts +48 -0
- package/dist/core/inline-render.js +322 -0
- package/dist/core/lines.d.ts +44 -0
- package/dist/core/lines.js +91 -0
- package/dist/core/node-views.d.ts +22 -0
- package/dist/core/node-views.js +8 -0
- package/dist/core/nodes.d.ts +297 -0
- package/dist/core/nodes.js +83 -0
- package/dist/core/parser.d.ts +68 -0
- package/dist/core/parser.js +189 -0
- package/dist/core/parsers/blockquote.d.ts +17 -0
- package/dist/core/parsers/blockquote.js +69 -0
- package/dist/core/parsers/built-in-openers.d.ts +8 -0
- package/dist/core/parsers/built-in-openers.js +124 -0
- package/dist/core/parsers/fence-syntax.d.ts +24 -0
- package/dist/core/parsers/fence-syntax.js +44 -0
- package/dist/core/parsers/fenced-code.d.ts +7 -0
- package/dist/core/parsers/fenced-code.js +29 -0
- package/dist/core/parsers/heading.d.ts +3 -0
- package/dist/core/parsers/heading.js +6 -0
- package/dist/core/parsers/html-block.d.ts +17 -0
- package/dist/core/parsers/html-block.js +94 -0
- package/dist/core/parsers/indented-code.d.ts +4 -0
- package/dist/core/parsers/indented-code.js +41 -0
- package/dist/core/parsers/link-reference.d.ts +7 -0
- package/dist/core/parsers/link-reference.js +152 -0
- package/dist/core/parsers/list.d.ts +19 -0
- package/dist/core/parsers/list.js +133 -0
- package/dist/core/parsers/paragraph.d.ts +10 -0
- package/dist/core/parsers/paragraph.js +42 -0
- package/dist/core/parsers/table-completion.d.ts +13 -0
- package/dist/core/parsers/table-completion.js +48 -0
- package/dist/core/parsers/table.d.ts +18 -0
- package/dist/core/parsers/table.js +110 -0
- package/dist/core/parsers/thematic-break.d.ts +1 -0
- package/dist/core/parsers/thematic-break.js +19 -0
- package/dist/core/serializer.d.ts +15 -0
- package/dist/core/serializer.js +11 -0
- package/dist/core/terminator-escalation.d.ts +8 -0
- package/dist/core/terminator-escalation.js +18 -0
- package/dist/core/url-policy.d.ts +14 -0
- package/dist/core/url-policy.js +44 -0
- package/dist/cursor/content-offsets.d.ts +29 -0
- package/dist/cursor/content-offsets.js +151 -0
- package/dist/cursor/coordinate-spaces.d.ts +65 -0
- package/dist/cursor/coordinate-spaces.js +66 -0
- package/dist/cursor/dom-walk.d.ts +18 -0
- package/dist/cursor/dom-walk.js +31 -0
- package/dist/cursor/edge-affinity.d.ts +44 -0
- package/dist/cursor/edge-affinity.js +60 -0
- package/dist/cursor/focused-caret.d.ts +10 -0
- package/dist/cursor/focused-caret.js +24 -0
- package/dist/cursor/height-model.d.ts +24 -0
- package/dist/cursor/height-model.js +72 -0
- package/dist/cursor/height-oracle.d.ts +24 -0
- package/dist/cursor/height-oracle.js +94 -0
- package/dist/cursor/overlay-rects.d.ts +8 -0
- package/dist/cursor/overlay-rects.js +19 -0
- package/dist/cursor/overlay-remeasure.d.ts +17 -0
- package/dist/cursor/overlay-remeasure.js +31 -0
- package/dist/cursor/pending-marks.d.ts +24 -0
- package/dist/cursor/pending-marks.js +36 -0
- package/dist/cursor/point-offset.d.ts +21 -0
- package/dist/cursor/point-offset.js +48 -0
- package/dist/cursor/reveal-anchor.d.ts +30 -0
- package/dist/cursor/reveal-anchor.js +31 -0
- package/dist/cursor/reveal-source.d.ts +35 -0
- package/dist/cursor/reveal-source.js +51 -0
- package/dist/cursor/scroll-ancestors.d.ts +28 -0
- package/dist/cursor/scroll-ancestors.js +89 -0
- package/dist/cursor/scrollport.d.ts +20 -0
- package/dist/cursor/scrollport.js +41 -0
- package/dist/cursor/sticky-column.d.ts +35 -0
- package/dist/cursor/sticky-column.js +64 -0
- package/dist/cursor/sticky-measure.d.ts +16 -0
- package/dist/cursor/sticky-measure.js +97 -0
- package/dist/cursor/typography-estimates.d.ts +21 -0
- package/dist/cursor/typography-estimates.js +21 -0
- package/dist/cursor/visual-lines.d.ts +25 -0
- package/dist/cursor/visual-lines.js +125 -0
- package/dist/cursor/widget-offset.d.ts +132 -0
- package/dist/cursor/widget-offset.js +543 -0
- package/dist/debug/diagnostics-report.d.ts +17 -0
- package/dist/debug/diagnostics-report.js +25 -0
- package/dist/debug/dump-tree.d.ts +6 -0
- package/dist/debug/dump-tree.js +114 -0
- package/dist/debug/inspect.d.ts +19 -0
- package/dist/debug/inspect.js +116 -0
- package/dist/debug/interaction-trace.d.ts +39 -0
- package/dist/debug/interaction-trace.js +105 -0
- package/dist/debug/operations-log.d.ts +14 -0
- package/dist/debug/operations-log.js +30 -0
- package/dist/decorations/buckets.d.ts +40 -0
- package/dist/decorations/buckets.js +87 -0
- package/dist/decorations/decoration-state.svelte.d.ts +20 -0
- package/dist/decorations/decoration-state.svelte.js +195 -0
- package/dist/decorations/island-dom.d.ts +35 -0
- package/dist/decorations/island-dom.js +148 -0
- package/dist/decorations/reserved-attrs.d.ts +12 -0
- package/dist/decorations/reserved-attrs.js +47 -0
- package/dist/decorations/types.d.ts +68 -0
- package/dist/decorations/types.js +5 -0
- package/dist/decorations/widget-dom.d.ts +15 -0
- package/dist/decorations/widget-dom.js +35 -0
- package/dist/dev-warn.d.ts +13 -0
- package/dist/dev-warn.js +28 -0
- package/dist/editor-actions/ancestry-folds.d.ts +32 -0
- package/dist/editor-actions/ancestry-folds.js +106 -0
- package/dist/editor-actions/block-edit-core.d.ts +29 -0
- package/dist/editor-actions/block-edit-core.js +277 -0
- package/dist/editor-actions/block-edit-scope.d.ts +79 -0
- package/dist/editor-actions/block-edit-scope.js +76 -0
- package/dist/editor-actions/block-edit.d.ts +8 -0
- package/dist/editor-actions/block-edit.js +111 -0
- package/dist/editor-actions/commit/history.d.ts +9 -0
- package/dist/editor-actions/commit/history.js +77 -0
- package/dist/editor-actions/commit/text-batch.d.ts +34 -0
- package/dist/editor-actions/commit/text-batch.js +61 -0
- package/dist/editor-actions/commit/undo-controller.d.ts +7 -0
- package/dist/editor-actions/commit/undo-controller.js +570 -0
- package/dist/editor-actions/container-block-component.d.ts +85 -0
- package/dist/editor-actions/container-block-component.js +228 -0
- package/dist/editor-actions/container-edit.d.ts +7 -0
- package/dist/editor-actions/container-edit.js +49 -0
- package/dist/editor-actions/container-exit-overrides.d.ts +16 -0
- package/dist/editor-actions/container-exit-overrides.js +38 -0
- package/dist/editor-actions/deps.d.ts +60 -0
- package/dist/editor-actions/deps.js +1 -0
- package/dist/editor-actions/enter-completion.d.ts +25 -0
- package/dist/editor-actions/enter-completion.js +76 -0
- package/dist/editor-actions/focus/focus-dispatch.d.ts +36 -0
- package/dist/editor-actions/focus/focus-dispatch.js +106 -0
- package/dist/editor-actions/focus/focus-landing.d.ts +7 -0
- package/dist/editor-actions/focus/focus-landing.js +39 -0
- package/dist/editor-actions/focus/focus.d.ts +7 -0
- package/dist/editor-actions/focus/focus.js +74 -0
- package/dist/editor-actions/index.d.ts +15 -0
- package/dist/editor-actions/index.js +19 -0
- package/dist/editor-actions/inline-range-commit.d.ts +20 -0
- package/dist/editor-actions/inline-range-commit.js +63 -0
- package/dist/editor-actions/list-context.d.ts +25 -0
- package/dist/editor-actions/list-context.js +285 -0
- package/dist/editor-actions/list-overrides.d.ts +13 -0
- package/dist/editor-actions/list-overrides.js +26 -0
- package/dist/editor-actions/merge-fallback.d.ts +19 -0
- package/dist/editor-actions/merge-fallback.js +27 -0
- package/dist/editor-actions/nested/nested-actions.d.ts +65 -0
- package/dist/editor-actions/nested/nested-actions.js +59 -0
- package/dist/editor-actions/nested/nested-block-edit.d.ts +10 -0
- package/dist/editor-actions/nested/nested-block-edit.js +181 -0
- package/dist/editor-actions/nested/nested-focus.d.ts +9 -0
- package/dist/editor-actions/nested/nested-focus.js +30 -0
- package/dist/editor-actions/paste-coordinator.d.ts +4 -0
- package/dist/editor-actions/paste-coordinator.js +20 -0
- package/dist/editor-actions/plugin/chrome-leaf.d.ts +25 -0
- package/dist/editor-actions/plugin/chrome-leaf.js +80 -0
- package/dist/editor-actions/plugin/container.d.ts +137 -0
- package/dist/editor-actions/plugin/container.js +351 -0
- package/dist/editor-actions/plugin/directive-container.d.ts +13 -0
- package/dist/editor-actions/plugin/directive-container.js +31 -0
- package/dist/editor-actions/reorder-action.d.ts +17 -0
- package/dist/editor-actions/reorder-action.js +104 -0
- package/dist/editor-actions/reorder-drag.d.ts +34 -0
- package/dist/editor-actions/reorder-drag.js +152 -0
- package/dist/editor-actions/replacement-focus.d.ts +27 -0
- package/dist/editor-actions/replacement-focus.js +60 -0
- package/dist/editor-actions/search-replace.d.ts +6 -0
- package/dist/editor-actions/search-replace.js +145 -0
- package/dist/editor-actions/table-context.d.ts +34 -0
- package/dist/editor-actions/table-context.js +292 -0
- package/dist/editor-actions/unwrap-strategies.d.ts +14 -0
- package/dist/editor-actions/unwrap-strategies.js +131 -0
- package/dist/editor-actions/whole-block-focus-surface.d.ts +51 -0
- package/dist/editor-actions/whole-block-focus-surface.js +171 -0
- package/dist/editor-events.d.ts +89 -0
- package/dist/editor-events.js +96 -0
- package/dist/editor-keys.d.ts +197 -0
- package/dist/editor-keys.js +40 -0
- package/dist/editor-props.d.ts +164 -0
- package/dist/editor-props.js +1 -0
- package/dist/editor-rects.d.ts +58 -0
- package/dist/editor-rects.js +114 -0
- package/dist/env.d.ts +12 -0
- package/dist/env.js +20 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.js +19 -0
- package/dist/invariants/commit-paths.d.ts +10 -0
- package/dist/invariants/commit-paths.js +25 -0
- package/dist/invariants/commit-scope.d.ts +9 -0
- package/dist/invariants/commit-scope.js +16 -0
- package/dist/invariants/context-keys.d.ts +7 -0
- package/dist/invariants/context-keys.js +14 -0
- package/dist/invariants/descriptor.d.ts +10 -0
- package/dist/invariants/descriptor.js +24 -0
- package/dist/invariants/inline-transitions.d.ts +23 -0
- package/dist/invariants/inline-transitions.js +52 -0
- package/dist/invariants/install.d.ts +36 -0
- package/dist/invariants/install.js +66 -0
- package/dist/invariants/landable-caret.d.ts +12 -0
- package/dist/invariants/landable-caret.js +31 -0
- package/dist/invariants/marker-css-parity.d.ts +10 -0
- package/dist/invariants/marker-css-parity.js +87 -0
- package/dist/invariants/node-shape.d.ts +44 -0
- package/dist/invariants/node-shape.js +258 -0
- package/dist/invariants/registry.d.ts +126 -0
- package/dist/invariants/registry.js +349 -0
- package/dist/invariants/render-fidelity.d.ts +8 -0
- package/dist/invariants/render-fidelity.js +33 -0
- package/dist/invariants/selection-endpoints.d.ts +19 -0
- package/dist/invariants/selection-endpoints.js +78 -0
- package/dist/invariants/single-node-sink.d.ts +9 -0
- package/dist/invariants/single-node-sink.js +16 -0
- package/dist/invariants/snapshot-integrity.d.ts +17 -0
- package/dist/invariants/snapshot-integrity.js +24 -0
- package/dist/invariants/split-landing.d.ts +8 -0
- package/dist/invariants/split-landing.js +15 -0
- package/dist/invariants/structural-descriptor.d.ts +21 -0
- package/dist/invariants/structural-descriptor.js +50 -0
- package/dist/perf/instruments.d.ts +49 -0
- package/dist/perf/instruments.js +154 -0
- package/dist/perf/use-mount-gauge.svelte.d.ts +1 -0
- package/dist/perf/use-mount-gauge.svelte.js +15 -0
- package/dist/plugin.d.ts +102 -0
- package/dist/plugin.js +156 -0
- package/dist/plugins/admonitions/AdmonitionBlock.svelte +144 -0
- package/dist/plugins/admonitions/AdmonitionBlock.svelte.d.ts +11 -0
- package/dist/plugins/admonitions/admonition-kind.d.ts +8 -0
- package/dist/plugins/admonitions/admonition-kind.js +97 -0
- package/dist/plugins/admonitions/convert-document.d.ts +11 -0
- package/dist/plugins/admonitions/convert-document.js +39 -0
- package/dist/plugins/admonitions/gh-alert.d.ts +13 -0
- package/dist/plugins/admonitions/gh-alert.js +83 -0
- package/dist/plugins/admonitions/github-alert-kind.d.ts +12 -0
- package/dist/plugins/admonitions/github-alert-kind.js +125 -0
- package/dist/plugins/admonitions/index.d.ts +6 -0
- package/dist/plugins/admonitions/index.js +8 -0
- package/dist/plugins/admonitions/kinds.d.ts +26 -0
- package/dist/plugins/admonitions/kinds.js +18 -0
- package/dist/plugins/admonitions/register.d.ts +7 -0
- package/dist/plugins/admonitions/register.js +12 -0
- package/dist/plugins/details/DetailsBlock.svelte +129 -0
- package/dist/plugins/details/DetailsBlock.svelte.d.ts +11 -0
- package/dist/plugins/details/details-disclosure.svelte.d.ts +17 -0
- package/dist/plugins/details/details-disclosure.svelte.js +24 -0
- package/dist/plugins/details/details-kind.d.ts +25 -0
- package/dist/plugins/details/details-kind.js +237 -0
- package/dist/plugins/details/index.d.ts +2 -0
- package/dist/plugins/details/index.js +2 -0
- package/dist/plugins/details/register.d.ts +6 -0
- package/dist/plugins/details/register.js +15 -0
- package/dist/plugins/emoji/emoji-plugin.d.ts +2 -0
- package/dist/plugins/emoji/emoji-plugin.js +10 -0
- package/dist/plugins/emoji/emoji-recognizer.d.ts +18 -0
- package/dist/plugins/emoji/emoji-recognizer.js +63 -0
- package/dist/plugins/emoji/emoji-table.d.ts +1 -0
- package/dist/plugins/emoji/emoji-table.js +1919 -0
- package/dist/plugins/emoji/index.d.ts +3 -0
- package/dist/plugins/emoji/index.js +4 -0
- package/dist/plugins/footnotes/FootnoteDefinition.svelte +103 -0
- package/dist/plugins/footnotes/FootnoteDefinition.svelte.d.ts +13 -0
- package/dist/plugins/footnotes/FootnoteReference.svelte +50 -0
- package/dist/plugins/footnotes/FootnoteReference.svelte.d.ts +4 -0
- package/dist/plugins/footnotes/constants.d.ts +2 -0
- package/dist/plugins/footnotes/constants.js +4 -0
- package/dist/plugins/footnotes/footnote-definition.d.ts +14 -0
- package/dist/plugins/footnotes/footnote-definition.js +147 -0
- package/dist/plugins/footnotes/footnote-lookup.d.ts +9 -0
- package/dist/plugins/footnotes/footnote-lookup.js +33 -0
- package/dist/plugins/footnotes/footnote-numbering.d.ts +23 -0
- package/dist/plugins/footnotes/footnote-numbering.js +78 -0
- package/dist/plugins/footnotes/footnote-reference.d.ts +7 -0
- package/dist/plugins/footnotes/footnote-reference.js +54 -0
- package/dist/plugins/footnotes/footnotes-plugin.d.ts +7 -0
- package/dist/plugins/footnotes/footnotes-plugin.js +17 -0
- package/dist/plugins/footnotes/index.d.ts +5 -0
- package/dist/plugins/footnotes/index.js +6 -0
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.d.ts +17 -0
- package/dist/plugins/highlight-occurrences/highlight-occurrences-plugin.js +31 -0
- package/dist/plugins/highlight-occurrences/index.d.ts +1 -0
- package/dist/plugins/highlight-occurrences/index.js +1 -0
- package/dist/plugins/highlight-occurrences/occurrence-source.d.ts +26 -0
- package/dist/plugins/highlight-occurrences/occurrence-source.js +54 -0
- package/dist/plugins/highlight-occurrences/occurrences.d.ts +33 -0
- package/dist/plugins/highlight-occurrences/occurrences.js +108 -0
- package/dist/plugins/latex/BlockMath.svelte +119 -0
- package/dist/plugins/latex/BlockMath.svelte.d.ts +21 -0
- package/dist/plugins/latex/MathInline.svelte +28 -0
- package/dist/plugins/latex/MathInline.svelte.d.ts +4 -0
- package/dist/plugins/latex/index.d.ts +3 -0
- package/dist/plugins/latex/index.js +4 -0
- package/dist/plugins/latex/latex-kind.d.ts +17 -0
- package/dist/plugins/latex/latex-kind.js +224 -0
- package/dist/plugins/latex/math-completion.d.ts +10 -0
- package/dist/plugins/latex/math-completion.js +19 -0
- package/dist/plugins/latex/math-renderer.d.ts +26 -0
- package/dist/plugins/latex/math-renderer.js +42 -0
- package/dist/plugins/latex/register.d.ts +10 -0
- package/dist/plugins/latex/register.js +23 -0
- package/dist/plugins/latex/renderer.d.ts +13 -0
- package/dist/plugins/latex/renderer.js +34 -0
- package/dist/plugins/mermaid/MermaidBlock.svelte +572 -0
- package/dist/plugins/mermaid/MermaidBlock.svelte.d.ts +11 -0
- package/dist/plugins/mermaid/index.d.ts +3 -0
- package/dist/plugins/mermaid/index.js +3 -0
- package/dist/plugins/mermaid/mermaid-kind.d.ts +38 -0
- package/dist/plugins/mermaid/mermaid-kind.js +176 -0
- package/dist/plugins/mermaid/mermaid-renderer.d.ts +28 -0
- package/dist/plugins/mermaid/mermaid-renderer.js +35 -0
- package/dist/plugins/mermaid/register.d.ts +10 -0
- package/dist/plugins/mermaid/register.js +20 -0
- package/dist/plugins/mermaid/renderer.d.ts +11 -0
- package/dist/plugins/mermaid/renderer.js +53 -0
- package/dist/plugins/parrot/ParrotBlock.svelte +342 -0
- package/dist/plugins/parrot/ParrotBlock.svelte.d.ts +21 -0
- package/dist/plugins/parrot/index.d.ts +1 -0
- package/dist/plugins/parrot/index.js +2 -0
- package/dist/plugins/parrot/parrot-plugin.d.ts +3 -0
- package/dist/plugins/parrot/parrot-plugin.js +49 -0
- package/dist/plugins/toc/TocBlock.svelte +218 -0
- package/dist/plugins/toc/TocBlock.svelte.d.ts +24 -0
- package/dist/plugins/toc/heading-outline.d.ts +28 -0
- package/dist/plugins/toc/heading-outline.js +65 -0
- package/dist/plugins/toc/index.d.ts +2 -0
- package/dist/plugins/toc/index.js +2 -0
- package/dist/plugins/toc/navigation-queue.d.ts +12 -0
- package/dist/plugins/toc/navigation-queue.js +21 -0
- package/dist/plugins/toc/toc-plugin.d.ts +16 -0
- package/dist/plugins/toc/toc-plugin.js +71 -0
- package/dist/presentation-mode.d.ts +32 -0
- package/dist/presentation-mode.js +50 -0
- package/dist/reactivity/block-list-state.svelte.d.ts +22 -0
- package/dist/reactivity/block-list-state.svelte.js +46 -0
- package/dist/reactivity/block-window.svelte.d.ts +41 -0
- package/dist/reactivity/block-window.svelte.js +93 -0
- package/dist/reactivity/content-version.svelte.d.ts +14 -0
- package/dist/reactivity/content-version.svelte.js +16 -0
- package/dist/reactivity/list-windowing.svelte.d.ts +100 -0
- package/dist/reactivity/list-windowing.svelte.js +402 -0
- package/dist/reactivity/measure-batch.d.ts +15 -0
- package/dist/reactivity/measure-batch.js +18 -0
- package/dist/reactivity/publish-ref.svelte.d.ts +54 -0
- package/dist/reactivity/publish-ref.svelte.js +128 -0
- package/dist/reactivity/scope-geometry.d.ts +18 -0
- package/dist/reactivity/scope-geometry.js +29 -0
- package/dist/reactivity/state-registry.d.ts +10 -0
- package/dist/reactivity/state-registry.js +44 -0
- package/dist/reactivity/use-container-windowing.svelte.d.ts +35 -0
- package/dist/reactivity/use-container-windowing.svelte.js +95 -0
- package/dist/reactivity/window-slice.d.ts +11 -0
- package/dist/reactivity/window-slice.js +9 -0
- package/dist/scan-index.d.ts +11 -0
- package/dist/scan-index.js +27 -0
- package/dist/schema/block-commands.d.ts +105 -0
- package/dist/schema/block-commands.js +179 -0
- package/dist/schema/block-completions.d.ts +33 -0
- package/dist/schema/block-completions.js +49 -0
- package/dist/schema/block-component-registry.d.ts +33 -0
- package/dist/schema/block-component-registry.js +33 -0
- package/dist/schema/block-kind-descriptor.d.ts +281 -0
- package/dist/schema/block-kind-descriptor.js +187 -0
- package/dist/schema/block-openers.d.ts +94 -0
- package/dist/schema/block-openers.js +150 -0
- package/dist/schema/built-in-descriptors.d.ts +8 -0
- package/dist/schema/built-in-descriptors.js +560 -0
- package/dist/schema/child-spans.d.ts +25 -0
- package/dist/schema/child-spans.js +161 -0
- package/dist/schema/closure.d.ts +39 -0
- package/dist/schema/closure.js +55 -0
- package/dist/schema/command-id.d.ts +20 -0
- package/dist/schema/command-id.js +42 -0
- package/dist/schema/commands.d.ts +147 -0
- package/dist/schema/commands.js +294 -0
- package/dist/schema/container-raw.d.ts +21 -0
- package/dist/schema/container-raw.js +43 -0
- package/dist/schema/container-rebuilders.d.ts +32 -0
- package/dist/schema/container-rebuilders.js +95 -0
- package/dist/schema/define-plugin-block.d.ts +15 -0
- package/dist/schema/define-plugin-block.js +18 -0
- package/dist/schema/fenced-code-raw.d.ts +43 -0
- package/dist/schema/fenced-code-raw.js +220 -0
- package/dist/schema/global-commands.d.ts +11 -0
- package/dist/schema/global-commands.js +40 -0
- package/dist/schema/inline-construct-policy.d.ts +131 -0
- package/dist/schema/inline-construct-policy.js +96 -0
- package/dist/schema/keybinding-overrides.d.ts +39 -0
- package/dist/schema/keybinding-overrides.js +43 -0
- package/dist/schema/keybindings.d.ts +36 -0
- package/dist/schema/keybindings.js +75 -0
- package/dist/schema/merge-rules.d.ts +28 -0
- package/dist/schema/merge-rules.js +57 -0
- package/dist/schema/opener-priorities.d.ts +16 -0
- package/dist/schema/opener-priorities.js +16 -0
- package/dist/schema/operations.d.ts +110 -0
- package/dist/schema/operations.js +6 -0
- package/dist/schema/plugin-activation.d.ts +13 -0
- package/dist/schema/plugin-activation.js +18 -0
- package/dist/schema/plugin-editor-context.d.ts +33 -0
- package/dist/schema/plugin-editor-context.js +65 -0
- package/dist/schema/plugin-install.d.ts +58 -0
- package/dist/schema/plugin-install.js +132 -0
- package/dist/schema/plugin-kind.d.ts +21 -0
- package/dist/schema/plugin-kind.js +86 -0
- package/dist/schema/plugin-name.d.ts +1 -0
- package/dist/schema/plugin-name.js +7 -0
- package/dist/schema/register-once.d.ts +9 -0
- package/dist/schema/register-once.js +35 -0
- package/dist/schema/registration-checks.d.ts +32 -0
- package/dist/schema/registration-checks.js +122 -0
- package/dist/schema/registration-pending.d.ts +28 -0
- package/dist/schema/registration-pending.js +48 -0
- package/dist/schema/registry-reset.d.ts +7 -0
- package/dist/schema/registry-reset.js +30 -0
- package/dist/schema/registry-view.d.ts +30 -0
- package/dist/schema/registry-view.js +39 -0
- package/dist/schema/reserved-chords.d.ts +35 -0
- package/dist/schema/reserved-chords.js +313 -0
- package/dist/schema/reserved-chrome.d.ts +23 -0
- package/dist/schema/reserved-chrome.js +33 -0
- package/dist/schema/table-cell-raw.d.ts +14 -0
- package/dist/schema/table-cell-raw.js +30 -0
- package/dist/schema/whole-block-unit.d.ts +8 -0
- package/dist/schema/whole-block-unit.js +12 -0
- package/dist/search/document-scan.d.ts +22 -0
- package/dist/search/document-scan.js +39 -0
- package/dist/search/matcher.d.ts +31 -0
- package/dist/search/matcher.js +70 -0
- package/dist/search/regex-executor.d.ts +41 -0
- package/dist/search/regex-executor.js +165 -0
- package/dist/search/replace.d.ts +15 -0
- package/dist/search/replace.js +29 -0
- package/dist/search/search-state.svelte.d.ts +59 -0
- package/dist/search/search-state.svelte.js +231 -0
- package/dist/selection/autoscroll.d.ts +26 -0
- package/dist/selection/autoscroll.js +91 -0
- package/dist/selection/block-hit-test.d.ts +37 -0
- package/dist/selection/block-hit-test.js +59 -0
- package/dist/selection/caret-doors.d.ts +20 -0
- package/dist/selection/caret-doors.js +44 -0
- package/dist/selection/caret-restore.d.ts +15 -0
- package/dist/selection/caret-restore.js +32 -0
- package/dist/selection/char-endpoint-snap.d.ts +15 -0
- package/dist/selection/char-endpoint-snap.js +39 -0
- package/dist/selection/clipboard-text.d.ts +13 -0
- package/dist/selection/clipboard-text.js +314 -0
- package/dist/selection/cross-block/clipboard.d.ts +14 -0
- package/dist/selection/cross-block/clipboard.js +20 -0
- package/dist/selection/cross-block/dispatch.d.ts +78 -0
- package/dist/selection/cross-block/dispatch.js +57 -0
- package/dist/selection/cross-block/format-range.d.ts +38 -0
- package/dist/selection/cross-block/format-range.js +193 -0
- package/dist/selection/cross-block/format-toggle.d.ts +27 -0
- package/dist/selection/cross-block/format-toggle.js +109 -0
- package/dist/selection/cross-block/keydown.d.ts +11 -0
- package/dist/selection/cross-block/keydown.js +339 -0
- package/dist/selection/cross-block/ops.d.ts +56 -0
- package/dist/selection/cross-block/ops.js +210 -0
- package/dist/selection/cross-block/paste.d.ts +8 -0
- package/dist/selection/cross-block/paste.js +156 -0
- package/dist/selection/cross-block/pointer.d.ts +19 -0
- package/dist/selection/cross-block/pointer.js +80 -0
- package/dist/selection/cross-block/type-replace.d.ts +10 -0
- package/dist/selection/cross-block/type-replace.js +129 -0
- package/dist/selection/dead-space-caret.d.ts +39 -0
- package/dist/selection/dead-space-caret.js +173 -0
- package/dist/selection/drag-pointer.d.ts +22 -0
- package/dist/selection/drag-pointer.js +89 -0
- package/dist/selection/gap-caret.d.ts +47 -0
- package/dist/selection/gap-caret.js +72 -0
- package/dist/selection/keyboard-extend.d.ts +43 -0
- package/dist/selection/keyboard-extend.js +257 -0
- package/dist/selection/native-bridge.d.ts +47 -0
- package/dist/selection/native-bridge.js +204 -0
- package/dist/selection/nearest-block.d.ts +43 -0
- package/dist/selection/nearest-block.js +73 -0
- package/dist/selection/path-lookup.d.ts +32 -0
- package/dist/selection/path-lookup.js +132 -0
- package/dist/selection/path-math.d.ts +35 -0
- package/dist/selection/path-math.js +90 -0
- package/dist/selection/pointer-session.d.ts +43 -0
- package/dist/selection/pointer-session.js +111 -0
- package/dist/selection/primitives.d.ts +75 -0
- package/dist/selection/primitives.js +91 -0
- package/dist/selection/range-delete-ceremony.d.ts +85 -0
- package/dist/selection/range-delete-ceremony.js +197 -0
- package/dist/selection/range-delete-chrome.d.ts +39 -0
- package/dist/selection/range-delete-chrome.js +105 -0
- package/dist/selection/range-delete-table-coverage.d.ts +28 -0
- package/dist/selection/range-delete-table-coverage.js +168 -0
- package/dist/selection/range-delete-table.d.ts +16 -0
- package/dist/selection/range-delete-table.js +347 -0
- package/dist/selection/range-delete.d.ts +33 -0
- package/dist/selection/range-delete.js +121 -0
- package/dist/selection/selection-description.d.ts +7 -0
- package/dist/selection/selection-description.js +18 -0
- package/dist/selection/selection-restore.d.ts +46 -0
- package/dist/selection/selection-restore.js +66 -0
- package/dist/selection/selection-state.svelte.d.ts +72 -0
- package/dist/selection/selection-state.svelte.js +247 -0
- package/dist/selection/shared-keydown.d.ts +61 -0
- package/dist/selection/shared-keydown.js +150 -0
- package/dist/selection/table-endpoint-snap.d.ts +55 -0
- package/dist/selection/table-endpoint-snap.js +143 -0
- package/dist/selection/table-rect-extend.d.ts +23 -0
- package/dist/selection/table-rect-extend.js +46 -0
- package/dist/selection/widget-range-paint.d.ts +12 -0
- package/dist/selection/widget-range-paint.js +44 -0
- package/dist/styles/editor-theme.css +151 -0
- package/dist/styles/editor.css +585 -0
- package/dist/testing/conformance-core.d.ts +45 -0
- package/dist/testing/conformance-core.js +105 -0
- package/dist/testing/container-conformance.d.ts +137 -0
- package/dist/testing/container-conformance.js +533 -0
- package/dist/testing/headless-actions.d.ts +37 -0
- package/dist/testing/headless-actions.js +118 -0
- package/dist/testing/inline-conformance.d.ts +50 -0
- package/dist/testing/inline-conformance.js +442 -0
- package/dist/testing/kind-conformance.d.ts +54 -0
- package/dist/testing/kind-conformance.js +325 -0
- package/dist/testing/mount-dom-stubs.d.ts +8 -0
- package/dist/testing/mount-dom-stubs.js +19 -0
- package/dist/testing/parse-convergence.d.ts +14 -0
- package/dist/testing/parse-convergence.js +81 -0
- package/dist/testing.d.ts +20 -0
- package/dist/testing.js +61 -0
- package/dist/tree-operations/blockquote.d.ts +18 -0
- package/dist/tree-operations/blockquote.js +59 -0
- package/dist/tree-operations/children.d.ts +17 -0
- package/dist/tree-operations/children.js +56 -0
- package/dist/tree-operations/cleanup.d.ts +10 -0
- package/dist/tree-operations/cleanup.js +25 -0
- package/dist/tree-operations/clone.d.ts +5 -0
- package/dist/tree-operations/clone.js +43 -0
- package/dist/tree-operations/container-lift.d.ts +9 -0
- package/dist/tree-operations/container-lift.js +29 -0
- package/dist/tree-operations/index.d.ts +16 -0
- package/dist/tree-operations/index.js +14 -0
- package/dist/tree-operations/list/empty-check.d.ts +7 -0
- package/dist/tree-operations/list/empty-check.js +19 -0
- package/dist/tree-operations/list/exit-replacement.d.ts +13 -0
- package/dist/tree-operations/list/exit-replacement.js +49 -0
- package/dist/tree-operations/list/item-partition.d.ts +13 -0
- package/dist/tree-operations/list/item-partition.js +33 -0
- package/dist/tree-operations/list/list-builders.d.ts +44 -0
- package/dist/tree-operations/list/list-builders.js +129 -0
- package/dist/tree-operations/list/ordered-markers.d.ts +36 -0
- package/dist/tree-operations/list/ordered-markers.js +114 -0
- package/dist/tree-operations/list/reconcile-task.d.ts +12 -0
- package/dist/tree-operations/list/reconcile-task.js +47 -0
- package/dist/tree-operations/list/sublist-separator.d.ts +13 -0
- package/dist/tree-operations/list/sublist-separator.js +34 -0
- package/dist/tree-operations/list/terminator.d.ts +17 -0
- package/dist/tree-operations/list/terminator.js +60 -0
- package/dist/tree-operations/list/unwrap-merge.d.ts +29 -0
- package/dist/tree-operations/list/unwrap-merge.js +202 -0
- package/dist/tree-operations/node-ops.d.ts +296 -0
- package/dist/tree-operations/node-ops.js +1428 -0
- package/dist/tree-operations/parse-block.d.ts +3 -0
- package/dist/tree-operations/parse-block.js +8 -0
- package/dist/tree-operations/paste/apply.d.ts +12 -0
- package/dist/tree-operations/paste/apply.js +75 -0
- package/dist/tree-operations/paste/body-write.d.ts +19 -0
- package/dist/tree-operations/paste/body-write.js +53 -0
- package/dist/tree-operations/paste/container-match.d.ts +32 -0
- package/dist/tree-operations/paste/container-match.js +238 -0
- package/dist/tree-operations/paste/container-paste.d.ts +10 -0
- package/dist/tree-operations/paste/container-paste.js +27 -0
- package/dist/tree-operations/paste/dispatch.d.ts +61 -0
- package/dist/tree-operations/paste/dispatch.js +138 -0
- package/dist/tree-operations/paste/find-enclosing-list.d.ts +8 -0
- package/dist/tree-operations/paste/find-enclosing-list.js +30 -0
- package/dist/tree-operations/paste/focus-target.d.ts +27 -0
- package/dist/tree-operations/paste/focus-target.js +40 -0
- package/dist/tree-operations/paste/hooks.d.ts +17 -0
- package/dist/tree-operations/paste/hooks.js +80 -0
- package/dist/tree-operations/paste/list-absorb.d.ts +29 -0
- package/dist/tree-operations/paste/list-absorb.js +106 -0
- package/dist/tree-operations/paste/list-break-out.d.ts +42 -0
- package/dist/tree-operations/paste/list-break-out.js +136 -0
- package/dist/tree-operations/paste/parent-scope.d.ts +17 -0
- package/dist/tree-operations/paste/parent-scope.js +35 -0
- package/dist/tree-operations/paste/paste-deps.d.ts +20 -0
- package/dist/tree-operations/paste/paste-deps.js +6 -0
- package/dist/tree-operations/paste/paste-replacement.d.ts +8 -0
- package/dist/tree-operations/paste/paste-replacement.js +60 -0
- package/dist/tree-operations/paste/paste-transforms.d.ts +25 -0
- package/dist/tree-operations/paste/paste-transforms.js +72 -0
- package/dist/tree-operations/paste/replace-block-at-parent.d.ts +29 -0
- package/dist/tree-operations/paste/replace-block-at-parent.js +75 -0
- package/dist/tree-operations/paste/strategy.d.ts +9 -0
- package/dist/tree-operations/paste/strategy.js +20 -0
- package/dist/tree-operations/paste/table-slice.d.ts +10 -0
- package/dist/tree-operations/paste/table-slice.js +39 -0
- package/dist/tree-operations/paste-surfaces.d.ts +61 -0
- package/dist/tree-operations/paste-surfaces.js +15 -0
- package/dist/tree-operations/path-mutate.d.ts +12 -0
- package/dist/tree-operations/path-mutate.js +20 -0
- package/dist/tree-operations/reorder-unit.d.ts +17 -0
- package/dist/tree-operations/reorder-unit.js +37 -0
- package/dist/tree-operations/reorder.d.ts +13 -0
- package/dist/tree-operations/reorder.js +57 -0
- package/dist/tree-operations/sharing.d.ts +18 -0
- package/dist/tree-operations/sharing.js +14 -0
- package/dist/tree-operations/splice-many.d.ts +9 -0
- package/dist/tree-operations/splice-many.js +22 -0
- package/dist/tree-operations/structural-change.d.ts +65 -0
- package/dist/tree-operations/structural-change.js +117 -0
- package/dist/tree-operations/sub-table-copy.d.ts +6 -0
- package/dist/tree-operations/sub-table-copy.js +43 -0
- package/dist/tree-operations/table-mutations.d.ts +17 -0
- package/dist/tree-operations/table-mutations.js +101 -0
- package/dist/tree-operations/unshare.d.ts +101 -0
- package/dist/tree-operations/unshare.js +248 -0
- package/dist/undo/manager.d.ts +2 -0
- package/dist/undo/manager.js +50 -0
- package/dist/undo/types.d.ts +44 -0
- package/dist/undo/types.js +7 -0
- package/docs/guide/consumer-guide.md +1098 -0
- package/docs/guide/directives.md +223 -0
- package/docs/guide/plugin-api.md +329 -0
- package/docs/guide/plugin-guide/conspiracy.gif +0 -0
- package/docs/guide/plugin-guide/parrot-frames.md +209 -0
- package/docs/guide/plugin-guide/parrot.gif +0 -0
- package/docs/guide/plugin-guide.md +1693 -0
- package/docs/guide/plugin-testing.md +463 -0
- package/package.json +238 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommonMark §6.6 HTML tag grammar, the one definition the inline `<` handler
|
|
3
|
+
* (scan/autolinks.ts) and the block-level type-7 catch-all (parsers/html-block.ts) share.
|
|
4
|
+
* The tag sources are exported so the block parser anchors them at line scope rather than
|
|
5
|
+
* keeping a copy that could drift.
|
|
6
|
+
*/
|
|
7
|
+
export type HtmlFormKind = 'openTag' | 'closeTag' | 'comment' | 'pi' | 'declaration' | 'cdata';
|
|
8
|
+
/** Open tag `<name (attrs)* /?>` (CommonMark §6.6), unanchored source. */
|
|
9
|
+
export declare const OPEN_TAG_SOURCE: string;
|
|
10
|
+
/** Close tag `</name>` with optional whitespace before `>`, unanchored source. */
|
|
11
|
+
export declare const CLOSE_TAG_SOURCE: string;
|
|
12
|
+
/** `pos` must point at `<`; every branch honors the `end` bound. */
|
|
13
|
+
export declare function matchHtmlFormAt(raw: string, pos: number, end: number): {
|
|
14
|
+
kind: HtmlFormKind;
|
|
15
|
+
length: number;
|
|
16
|
+
} | null;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommonMark §6.6 HTML tag grammar, the one definition the inline `<` handler
|
|
3
|
+
* (scan/autolinks.ts) and the block-level type-7 catch-all (parsers/html-block.ts) share.
|
|
4
|
+
* The tag sources are exported so the block parser anchors them at line scope rather than
|
|
5
|
+
* keeping a copy that could drift.
|
|
6
|
+
*/
|
|
7
|
+
const OPEN_TAG = /<[A-Za-z][A-Za-z0-9-]*(?:\s+[a-zA-Z_:][a-zA-Z0-9_.:-]*(?:\s*=\s*(?:[^\s"'=<>`]+|"[^"]*"|'[^']*'))?)*\s*\/?>/;
|
|
8
|
+
const CLOSE_TAG = /<\/[A-Za-z][A-Za-z0-9-]*\s*>/;
|
|
9
|
+
/** Open tag `<name (attrs)* /?>` (CommonMark §6.6), unanchored source. */
|
|
10
|
+
export const OPEN_TAG_SOURCE = OPEN_TAG.source;
|
|
11
|
+
/** Close tag `</name>` with optional whitespace before `>`, unanchored source. */
|
|
12
|
+
export const CLOSE_TAG_SOURCE = CLOSE_TAG.source;
|
|
13
|
+
const OPEN_TAG_AT_POS = new RegExp(`^${OPEN_TAG_SOURCE}`);
|
|
14
|
+
const CLOSE_TAG_AT_POS = new RegExp(`^${CLOSE_TAG_SOURCE}`);
|
|
15
|
+
/** `pos` must point at `<`; every branch honors the `end` bound. */
|
|
16
|
+
export function matchHtmlFormAt(raw, pos, end) {
|
|
17
|
+
if (pos >= end || raw[pos] !== '<' || pos + 1 >= end)
|
|
18
|
+
return null;
|
|
19
|
+
const next = raw[pos + 1];
|
|
20
|
+
if (next === '!') {
|
|
21
|
+
if (raw.startsWith('<!--', pos)) {
|
|
22
|
+
const closeAt = raw.indexOf('-->', pos + 4);
|
|
23
|
+
if (closeAt === -1 || closeAt + 3 > end)
|
|
24
|
+
return null;
|
|
25
|
+
return { kind: 'comment', length: closeAt + 3 - pos };
|
|
26
|
+
}
|
|
27
|
+
if (raw.startsWith('<![CDATA[', pos)) {
|
|
28
|
+
const closeAt = raw.indexOf(']]>', pos + 9);
|
|
29
|
+
if (closeAt === -1 || closeAt + 3 > end)
|
|
30
|
+
return null;
|
|
31
|
+
return { kind: 'cdata', length: closeAt + 3 - pos };
|
|
32
|
+
}
|
|
33
|
+
if (pos + 2 < end && /[A-Za-z]/.test(raw[pos + 2])) {
|
|
34
|
+
const closeAt = raw.indexOf('>', pos + 3);
|
|
35
|
+
if (closeAt === -1 || closeAt >= end)
|
|
36
|
+
return null;
|
|
37
|
+
return { kind: 'declaration', length: closeAt + 1 - pos };
|
|
38
|
+
}
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
if (next === '?') {
|
|
42
|
+
const closeAt = raw.indexOf('?>', pos + 2);
|
|
43
|
+
if (closeAt === -1 || closeAt + 2 > end)
|
|
44
|
+
return null;
|
|
45
|
+
return { kind: 'pi', length: closeAt + 2 - pos };
|
|
46
|
+
}
|
|
47
|
+
if (next === '/') {
|
|
48
|
+
const slice = raw.slice(pos, end);
|
|
49
|
+
const m = CLOSE_TAG_AT_POS.exec(slice);
|
|
50
|
+
return m ? { kind: 'closeTag', length: m[0].length } : null;
|
|
51
|
+
}
|
|
52
|
+
if (/[A-Za-z]/.test(next)) {
|
|
53
|
+
const slice = raw.slice(pos, end);
|
|
54
|
+
const m = OPEN_TAG_AT_POS.exec(slice);
|
|
55
|
+
return m ? { kind: 'openTag', length: m[0].length } : null;
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
// `|N` / `|NxM` is an Obsidian extension, not part of GFM.
|
|
2
|
+
const MAX_DIMENSION = 10000;
|
|
3
|
+
// The longest zero-free decodable suffix, `|10000x10000`. Bounding the pipe search to that tail
|
|
4
|
+
// keeps nested-label floods linear, at the deliberate cost of not decoding zero-padded runs.
|
|
5
|
+
const MAX_SUFFIX_SEARCH = 12;
|
|
6
|
+
export function parseImageDimensions(alt) {
|
|
7
|
+
const lastPipe = boundedLastPipe(alt);
|
|
8
|
+
const dims = lastPipe === -1 ? null : parseDimensionSuffix(alt.slice(lastPipe + 1));
|
|
9
|
+
if (dims === null)
|
|
10
|
+
return { displayAlt: alt, width: undefined, height: undefined };
|
|
11
|
+
return { displayAlt: alt.slice(0, lastPipe), width: dims.width, height: dims.height };
|
|
12
|
+
}
|
|
13
|
+
function boundedLastPipe(alt) {
|
|
14
|
+
const floor = alt.length > MAX_SUFFIX_SEARCH ? alt.length - MAX_SUFFIX_SEARCH : 0;
|
|
15
|
+
for (let i = alt.length - 1; i >= floor; i--) {
|
|
16
|
+
if (alt[i] === '|')
|
|
17
|
+
return i;
|
|
18
|
+
}
|
|
19
|
+
return -1;
|
|
20
|
+
}
|
|
21
|
+
function parseDimensionSuffix(s) {
|
|
22
|
+
const xIdx = s.indexOf('x');
|
|
23
|
+
if (xIdx === -1) {
|
|
24
|
+
const w = parseStrictInt(s);
|
|
25
|
+
if (w === null)
|
|
26
|
+
return null;
|
|
27
|
+
return { width: w, height: undefined };
|
|
28
|
+
}
|
|
29
|
+
const w = parseStrictInt(s.slice(0, xIdx));
|
|
30
|
+
const h = parseStrictInt(s.slice(xIdx + 1));
|
|
31
|
+
if (w === null || h === null)
|
|
32
|
+
return null;
|
|
33
|
+
return { width: w, height: h };
|
|
34
|
+
}
|
|
35
|
+
function parseStrictInt(s) {
|
|
36
|
+
if (s.length === 0 || !/^\d+$/.test(s))
|
|
37
|
+
return null;
|
|
38
|
+
const n = Number(s);
|
|
39
|
+
if (n <= 0 || n > MAX_DIMENSION)
|
|
40
|
+
return null;
|
|
41
|
+
return n;
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/** Inline parser entry. See docs/design/inline-parsing.md. */
|
|
2
|
+
import type { AnyInlineKind, CstNode, InlineNode } from '../nodes';
|
|
3
|
+
import type { NodeView } from '../node-views';
|
|
4
|
+
import type { LinkReferenceResolver } from './link-reference-resolver';
|
|
5
|
+
import { inlineDescendants } from './walk';
|
|
6
|
+
export interface ContentRange {
|
|
7
|
+
start: number;
|
|
8
|
+
end: number;
|
|
9
|
+
}
|
|
10
|
+
declare const contentLengthBrand: unique symbol;
|
|
11
|
+
/** Raw-space length of a block's rendered content, mintable only from its content range: a
|
|
12
|
+
* DOM-measured length answers in walk space and lags the pass that is rewriting the DOM. */
|
|
13
|
+
export type ContentLength = number & {
|
|
14
|
+
readonly [contentLengthBrand]: true;
|
|
15
|
+
};
|
|
16
|
+
/** Content range within a prose block's raw; marker-bearing kinds override via descriptor. */
|
|
17
|
+
export declare function getContentRange(node: NodeView): ContentRange;
|
|
18
|
+
/** The one {@link ContentLength} mint. */
|
|
19
|
+
export declare function contentLengthOf(node: NodeView): ContentLength;
|
|
20
|
+
export declare function isProseKind(kind: CstNode['kind']): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The bytes an INLINE construct's delimiters do not cover, or null for a kind that has none — a
|
|
23
|
+
* bare text run, an escape, a pair emptied of content. The inline twin of {@link getContentRange},
|
|
24
|
+
* here rather than beside one of its callers because the caret bounds, the typing seat, the
|
|
25
|
+
* destructive arm and the toggles all need the same answer.
|
|
26
|
+
*/
|
|
27
|
+
export declare function constructContentRange(node: InlineNode): ContentRange | null;
|
|
28
|
+
/**
|
|
29
|
+
* A prose node's inline tree, pure: no caching, no reactive reads. The render path calls this
|
|
30
|
+
* directly; the caching accessor (inline-cache.ts) calls it on a miss.
|
|
31
|
+
*/
|
|
32
|
+
export declare function computeInlineContent(node: NodeView, resolver?: LinkReferenceResolver): InlineNode[];
|
|
33
|
+
/**
|
|
34
|
+
* Parse inline content over raw[start, end). Node offsets are absolute into raw, and every byte
|
|
35
|
+
* lands in exactly one node's range. Both bounds are checked, not just typed: a caller the
|
|
36
|
+
* compiler cannot reach that passes only the source would otherwise get one whole-string text
|
|
37
|
+
* node, which is wrong output that looks like a result.
|
|
38
|
+
*/
|
|
39
|
+
export declare function parseInline(raw: string, start: number, end: number, resolver?: LinkReferenceResolver): InlineNode[];
|
|
40
|
+
export { inlineDescendants };
|
|
41
|
+
/** Every construct kind anywhere in a parse, at any depth. */
|
|
42
|
+
export declare function constructKinds(nodes: readonly InlineNode[]): Set<AnyInlineKind>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/** Inline parser entry. See docs/design/inline-parsing.md. */
|
|
2
|
+
import { displayLength } from '../lines';
|
|
3
|
+
import { getBlockKindDescriptor } from '../../schema/block-kind-descriptor';
|
|
4
|
+
// Registered before any descriptor read, headless of the editor mount. Explicit call: a bare
|
|
5
|
+
// side-effect import is tree-shaken from the production build.
|
|
6
|
+
import { registerBuiltInDescriptors } from '../../schema/built-in-descriptors';
|
|
7
|
+
import { scanInline } from './scan';
|
|
8
|
+
import { inlineDescendants } from './walk';
|
|
9
|
+
import { recordInlineCompute } from '../../perf/instruments';
|
|
10
|
+
registerBuiltInDescriptors();
|
|
11
|
+
/** Content range within a prose block's raw; marker-bearing kinds override via descriptor. */
|
|
12
|
+
export function getContentRange(node) {
|
|
13
|
+
const d = getBlockKindDescriptor(node.kind);
|
|
14
|
+
if (d.getContentRange)
|
|
15
|
+
return d.getContentRange(node);
|
|
16
|
+
return { start: 0, end: displayLength(node.raw) };
|
|
17
|
+
}
|
|
18
|
+
/** The one {@link ContentLength} mint. */
|
|
19
|
+
export function contentLengthOf(node) {
|
|
20
|
+
return getContentRange(node).end;
|
|
21
|
+
}
|
|
22
|
+
export function isProseKind(kind) {
|
|
23
|
+
return getBlockKindDescriptor(kind).supportsInline;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* The bytes an INLINE construct's delimiters do not cover, or null for a kind that has none — a
|
|
27
|
+
* bare text run, an escape, a pair emptied of content. The inline twin of {@link getContentRange},
|
|
28
|
+
* here rather than beside one of its callers because the caret bounds, the typing seat, the
|
|
29
|
+
* destructive arm and the toggles all need the same answer.
|
|
30
|
+
*/
|
|
31
|
+
export function constructContentRange(node) {
|
|
32
|
+
const children = node.children;
|
|
33
|
+
if (children && children.length > 0) {
|
|
34
|
+
return { start: children[0].start, end: children[children.length - 1].end };
|
|
35
|
+
}
|
|
36
|
+
// A code span carries its content as `text` rather than children, and a matched span's two
|
|
37
|
+
// backtick runs are equal, so what the content does not cover splits evenly between them.
|
|
38
|
+
if (node.kind === 'inlineCode' && node.text !== undefined) {
|
|
39
|
+
const fence = (node.end - node.start - node.text.length) / 2;
|
|
40
|
+
if (Number.isInteger(fence) && fence > 0) {
|
|
41
|
+
return { start: node.start + fence, end: node.end - fence };
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* A prose node's inline tree, pure: no caching, no reactive reads. The render path calls this
|
|
48
|
+
* directly; the caching accessor (inline-cache.ts) calls it on a miss.
|
|
49
|
+
*/
|
|
50
|
+
export function computeInlineContent(node, resolver) {
|
|
51
|
+
recordInlineCompute();
|
|
52
|
+
const range = getContentRange(node);
|
|
53
|
+
return parseInline(node.raw, range.start, range.end, resolver);
|
|
54
|
+
}
|
|
55
|
+
// ── Inline Parser ──────────────────────────────────────────────────────────
|
|
56
|
+
/**
|
|
57
|
+
* Parse inline content over raw[start, end). Node offsets are absolute into raw, and every byte
|
|
58
|
+
* lands in exactly one node's range. Both bounds are checked, not just typed: a caller the
|
|
59
|
+
* compiler cannot reach that passes only the source would otherwise get one whole-string text
|
|
60
|
+
* node, which is wrong output that looks like a result.
|
|
61
|
+
*/
|
|
62
|
+
export function parseInline(raw, start, end, resolver) {
|
|
63
|
+
if (!Number.isFinite(start) || !Number.isFinite(end)) {
|
|
64
|
+
throw new TypeError('parseInline requires both scan bounds — to scan a whole string, call parseInline(src, 0, src.length)');
|
|
65
|
+
}
|
|
66
|
+
return scanInline(raw, start, end, resolver);
|
|
67
|
+
}
|
|
68
|
+
// ── Inline Tree Walks ──────────────────────────────────────────────────────
|
|
69
|
+
export { inlineDescendants };
|
|
70
|
+
/** Every construct kind anywhere in a parse, at any depth. */
|
|
71
|
+
export function constructKinds(nodes) {
|
|
72
|
+
const kinds = new Set();
|
|
73
|
+
for (const node of inlineDescendants(nodes))
|
|
74
|
+
if (node.kind !== 'text')
|
|
75
|
+
kinds.add(node.kind);
|
|
76
|
+
return kinds;
|
|
77
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy `inlineContent` accessor for non-render consumers, over a node-keyed WeakMap.
|
|
3
|
+
* Non-reactive by design: never call from the render path (which uses computeInlineContent),
|
|
4
|
+
* since a reactive read+write here re-introduces the keyed-`{#each}` corruption G4.2 guards.
|
|
5
|
+
* One sub-entry per signature space, so resolver-less and signature-bearing callers cannot
|
|
6
|
+
* evict each other on a bracket-bearing block.
|
|
7
|
+
*/
|
|
8
|
+
import type { InlineNode } from '../nodes';
|
|
9
|
+
import type { NodeView } from '../node-views';
|
|
10
|
+
import type { LinkReferenceResolver } from './link-reference-resolver';
|
|
11
|
+
export declare function getInlineContent(node: NodeView, resolver?: LinkReferenceResolver, signature?: string): InlineNode[];
|
|
12
|
+
/**
|
|
13
|
+
* The one spelling of `getInlineContent(node, ref.current, ref.signature)`, so a non-render
|
|
14
|
+
* call site cannot drop the signature and silently desync from what render drew. `linkRef`
|
|
15
|
+
* stays structural: naming editor-keys' type would cycle that module back onto this layer.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolvedInlineContent(node: NodeView, linkRef?: {
|
|
18
|
+
current?: LinkReferenceResolver;
|
|
19
|
+
signature?: string;
|
|
20
|
+
}): InlineNode[];
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { computeInlineContent, isProseKind } from './index';
|
|
2
|
+
const cache = new WeakMap();
|
|
3
|
+
export function getInlineContent(node, resolver, signature = '') {
|
|
4
|
+
if (!isProseKind(node.kind))
|
|
5
|
+
return [];
|
|
6
|
+
// A block resolves through an LRD only if it holds a bracket; mirroring the render gate keeps
|
|
7
|
+
// a bracketless block off both the resolver and the signature.
|
|
8
|
+
const hasRef = node.raw.includes('[');
|
|
9
|
+
const sig = hasRef ? signature : '';
|
|
10
|
+
const effectiveResolver = hasRef ? resolver : undefined;
|
|
11
|
+
const entry = cache.get(node);
|
|
12
|
+
const slot = sig === '' ? 'plain' : 'resolved';
|
|
13
|
+
const hit = entry?.[slot];
|
|
14
|
+
if (hit && hit.raw === node.raw && hit.signature === sig)
|
|
15
|
+
return hit.content;
|
|
16
|
+
const content = computeInlineContent(node, effectiveResolver);
|
|
17
|
+
// Spread, so refilling one slot carries the other one through untouched.
|
|
18
|
+
cache.set(node, { ...entry, [slot]: { raw: node.raw, signature: sig, content } });
|
|
19
|
+
return content;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The one spelling of `getInlineContent(node, ref.current, ref.signature)`, so a non-render
|
|
23
|
+
* call site cannot drop the signature and silently desync from what render drew. `linkRef`
|
|
24
|
+
* stays structural: naming editor-keys' type would cycle that module back onto this layer.
|
|
25
|
+
*/
|
|
26
|
+
export function resolvedInlineContent(node, linkRef) {
|
|
27
|
+
return getInlineContent(node, linkRef?.current, linkRef?.signature ?? '');
|
|
28
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single source of truth for which inline kinds render as live atomic widgets
|
|
3
|
+
* (contenteditable=false islands marked `[data-inline-widget]`) and how each is recognized.
|
|
4
|
+
* Recognition is registry-owned; DOM building dispatches by layer: a `buildWidget` for
|
|
5
|
+
* core-built widgets, a `component` mounted through the injected portal builder, or neither
|
|
6
|
+
* for the image, whose per-instance builder is injected per render.
|
|
7
|
+
*/
|
|
8
|
+
import type { Component } from 'svelte';
|
|
9
|
+
import type { AnyInlineKind, InlineNode } from '../nodes';
|
|
10
|
+
import type { DocumentView, NodeView } from '../node-views';
|
|
11
|
+
import type { PresentationMode } from '../../presentation-mode';
|
|
12
|
+
/**
|
|
13
|
+
* The atomic-widget shell every core builder shares. Its `data-*` attributes are the offset
|
|
14
|
+
* walk's only handle, so the shell is minted here once and builders add only the body.
|
|
15
|
+
*/
|
|
16
|
+
export declare function mintWidgetShell(className: string, node: InlineNode): HTMLSpanElement;
|
|
17
|
+
/** The raw byte range a shell carries, or null when the attributes are absent or malformed —
|
|
18
|
+
* {@link mintWidgetShell}'s inverse, so the mint and every read-back move together. */
|
|
19
|
+
export declare function widgetSourceRange(el: Element): {
|
|
20
|
+
start: number;
|
|
21
|
+
end: number;
|
|
22
|
+
} | null;
|
|
23
|
+
/**
|
|
24
|
+
* Props a `component` widget kind is mounted with. Frozen at mount: the pool remounts on a
|
|
25
|
+
* source change, so `source` never shifts under a live instance, but `inline.start`/`end` CAN
|
|
26
|
+
* lag once adjacent typing moves the widget. The live position is the wrapper's re-stamped
|
|
27
|
+
* `data-source-*`, never these fields. The getters below are live for the same reason inverted:
|
|
28
|
+
* an instance the pool reuses would go stale on a frozen value.
|
|
29
|
+
*/
|
|
30
|
+
export interface InlineWidgetComponentProps {
|
|
31
|
+
inline: InlineNode;
|
|
32
|
+
source: string;
|
|
33
|
+
/** Absent reads as 'source'. */
|
|
34
|
+
getPresentationMode?: () => PresentationMode;
|
|
35
|
+
/** A widget whose body an ENGINE paints emits colors no stylesheet reaches, so it keys its
|
|
36
|
+
* render on this. One styled with CSS tokens needs nothing here. Absent reads as 'dark'. */
|
|
37
|
+
getTheme?: () => string;
|
|
38
|
+
/** The pool keys on `${kind} ${source}`, so a widget whose value derives from the document
|
|
39
|
+
* (footnote numbering) needs this to survive edits elsewhere that change no source. */
|
|
40
|
+
getDocument?: () => DocumentView | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Memo key for a whole-document derivation: the `$state` document is mutated in place, so
|
|
43
|
+
* its identity never changes and an identity-keyed memo would hit forever on stale data.
|
|
44
|
+
* Read it INSIDE the widget's `$derived`; that read is what subscribes it to edits anywhere.
|
|
45
|
+
*/
|
|
46
|
+
getContentVersion?: () => number;
|
|
47
|
+
/** `EditorRects.navigateTo`: reveal, scroll and land the caret at a raw offset in a block
|
|
48
|
+
* path. Absent in a bare harness, so a widget that navigates declines rather than throws. */
|
|
49
|
+
navigateTo?: (path: number[], offset?: number) => Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* The editor's activation gesture, shared by the surface deciding whether to reveal and the
|
|
53
|
+
* widget deciding whether to act: a Ctrl/Cmd chord while editing, a plain click in reading
|
|
54
|
+
* mode, where there is no caret for a plain click to place. The link click's rule
|
|
55
|
+
* (`Editor.svelte`), applied to widgets.
|
|
56
|
+
*/
|
|
57
|
+
export declare function isWidgetActivationClick(modified: boolean, mode: PresentationMode): boolean;
|
|
58
|
+
/** The closed vocabularies as values, so the published conformance kit checks a registration
|
|
59
|
+
* against the type's own members rather than a copy that ages out of step with it. */
|
|
60
|
+
export declare const DELETE_GRANULARITIES: readonly ["atomic", "select-then-delete"];
|
|
61
|
+
export declare const ON_EDGE_POLICIES: readonly ["select", "step-over"];
|
|
62
|
+
/**
|
|
63
|
+
* Per-kind editing behavior, read by the caret-edge dispatch
|
|
64
|
+
* (`components/blocks/text/edge-policy-dispatch.ts`). `atomic` deletes in one press where
|
|
65
|
+
* `select-then-delete` takes two; `onEdge` chooses between selecting the construct whole and
|
|
66
|
+
* stepping over it like a character.
|
|
67
|
+
*/
|
|
68
|
+
export interface InlineWidgetEditingPolicy {
|
|
69
|
+
revealSource?: boolean;
|
|
70
|
+
deleteGranularity?: (typeof DELETE_GRANULARITIES)[number];
|
|
71
|
+
onEdge?: (typeof ON_EDGE_POLICIES)[number];
|
|
72
|
+
onSelectedKey?: (e: KeyboardEvent, ctx: InlineWidgetEditingContext) => boolean;
|
|
73
|
+
/** The widget's own component handles an activation click ({@link isWidgetActivationClick}),
|
|
74
|
+
* so the surface stands its reveal down rather than unmounting the widget under it. */
|
|
75
|
+
claimsActivationClick?: boolean;
|
|
76
|
+
}
|
|
77
|
+
export interface InlineWidgetEditingContext {
|
|
78
|
+
/** Bytes-readonly (G1.9); edits go through `updateContent`. */
|
|
79
|
+
node: NodeView;
|
|
80
|
+
inline: InlineNode;
|
|
81
|
+
widgetStart: number;
|
|
82
|
+
widgetEnd: number;
|
|
83
|
+
index: number;
|
|
84
|
+
preSelectOffset: number;
|
|
85
|
+
editorContentWidth: number;
|
|
86
|
+
/** Effective mode at dispatch; a handler declines edits in 'reading'. */
|
|
87
|
+
presentationMode: PresentationMode;
|
|
88
|
+
/** Bound by the caller: core cannot reach the editor-actions block API. */
|
|
89
|
+
updateContent: (newRaw: string, caretBefore: number, caretAfter: number) => void;
|
|
90
|
+
}
|
|
91
|
+
export interface InlineWidgetDescriptor {
|
|
92
|
+
isWidget(node: InlineNode, raw: string): boolean;
|
|
93
|
+
/** Omitted for a kind whose builder is injected per render (image) or that uses `component`. */
|
|
94
|
+
buildWidget?(node: InlineNode, raw: string): HTMLElement;
|
|
95
|
+
/** The recommended path, mutually exclusive with `buildWidget`: the render layer wraps it in
|
|
96
|
+
* the atomic-island span and mounts it through the injected portal builder. */
|
|
97
|
+
component?: Component<InlineWidgetComponentProps>;
|
|
98
|
+
editing?: InlineWidgetEditingPolicy;
|
|
99
|
+
}
|
|
100
|
+
export declare function registerInlineWidgetKind(kind: AnyInlineKind, descriptor: InlineWidgetDescriptor): void;
|
|
101
|
+
/**
|
|
102
|
+
* Layer editing fields onto an already-registered kind. The editor-layer wire-up
|
|
103
|
+
* (components/built-in-blocks.ts) attaches behavior here that would otherwise make a core
|
|
104
|
+
* registration import a downstream layer. Throws for an unregistered kind.
|
|
105
|
+
*/
|
|
106
|
+
export declare function augmentInlineWidgetKind(kind: AnyInlineKind, editing: Partial<InlineWidgetEditingPolicy>): void;
|
|
107
|
+
/** Kind-level recognition, independent of per-block render policy (renderImagesAsWidgets). */
|
|
108
|
+
export declare function isInlineWidget(node: InlineNode, raw: string): boolean;
|
|
109
|
+
export declare function getInlineWidgetEditing(kind: AnyInlineKind): InlineWidgetEditingPolicy | undefined;
|
|
110
|
+
export declare function getInlineWidgetComponent(kind: AnyInlineKind): Component<InlineWidgetComponentProps> | undefined;
|
|
111
|
+
/**
|
|
112
|
+
* Every live widget reachable from `nodes`, in document order. Descends so a widget nested in a
|
|
113
|
+
* non-widget parent is found (the `image` inside `[![alt][ref]][repo]`), but never into a
|
|
114
|
+
* widget's own children, which are atomic. `raw` is the enclosing block's source.
|
|
115
|
+
*/
|
|
116
|
+
export declare function flattenInlineWidgets(nodes: ReadonlyArray<InlineNode>, raw: string): InlineNode[];
|
|
117
|
+
/**
|
|
118
|
+
* A `component` kind routes through the injected `buildPortalWidget` because the component layer
|
|
119
|
+
* owns Svelte mounting and `core/` stays framework-free. Null when the node is not a widget, its
|
|
120
|
+
* builder is injected per render (image), or the portal builder is absent or failed.
|
|
121
|
+
*/
|
|
122
|
+
export declare function buildCoreInlineWidget(node: InlineNode, raw: string, buildPortalWidget?: (node: InlineNode, raw: string) => HTMLElement | null): HTMLElement | null;
|
|
123
|
+
/** Test-only. Removes every plugin-registered inline-widget kind; built-ins survive. */
|
|
124
|
+
export declare function __resetInlineWidgetsForTests(): void;
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The single source of truth for which inline kinds render as live atomic widgets
|
|
3
|
+
* (contenteditable=false islands marked `[data-inline-widget]`) and how each is recognized.
|
|
4
|
+
* Recognition is registry-owned; DOM building dispatches by layer: a `buildWidget` for
|
|
5
|
+
* core-built widgets, a `component` mounted through the injected portal builder, or neither
|
|
6
|
+
* for the image, whose per-instance builder is injected per render.
|
|
7
|
+
*/
|
|
8
|
+
import { isLiveHtmlTag, buildLiveHtmlWidget } from './raw-html-widget';
|
|
9
|
+
import { entityRendersGlyph, buildEntityWidget } from './entity-widget';
|
|
10
|
+
import { registerOnce } from '../../schema/register-once';
|
|
11
|
+
import { inlineDescendants } from './walk';
|
|
12
|
+
/**
|
|
13
|
+
* The atomic-widget shell every core builder shares. Its `data-*` attributes are the offset
|
|
14
|
+
* walk's only handle, so the shell is minted here once and builders add only the body.
|
|
15
|
+
*/
|
|
16
|
+
export function mintWidgetShell(className, node) {
|
|
17
|
+
const shell = document.createElement('span');
|
|
18
|
+
shell.className = className;
|
|
19
|
+
shell.dataset.inlineWidget = '';
|
|
20
|
+
shell.dataset.sourceStart = String(node.start);
|
|
21
|
+
shell.dataset.sourceEnd = String(node.end);
|
|
22
|
+
shell.setAttribute('contenteditable', 'false');
|
|
23
|
+
return shell;
|
|
24
|
+
}
|
|
25
|
+
/** The raw byte range a shell carries, or null when the attributes are absent or malformed —
|
|
26
|
+
* {@link mintWidgetShell}'s inverse, so the mint and every read-back move together. */
|
|
27
|
+
export function widgetSourceRange(el) {
|
|
28
|
+
const start = parseInt(el.getAttribute('data-source-start') ?? '', 10);
|
|
29
|
+
const end = parseInt(el.getAttribute('data-source-end') ?? '', 10);
|
|
30
|
+
if (Number.isNaN(start) || Number.isNaN(end))
|
|
31
|
+
return null;
|
|
32
|
+
return { start, end };
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* The editor's activation gesture, shared by the surface deciding whether to reveal and the
|
|
36
|
+
* widget deciding whether to act: a Ctrl/Cmd chord while editing, a plain click in reading
|
|
37
|
+
* mode, where there is no caret for a plain click to place. The link click's rule
|
|
38
|
+
* (`Editor.svelte`), applied to widgets.
|
|
39
|
+
*/
|
|
40
|
+
export function isWidgetActivationClick(modified, mode) {
|
|
41
|
+
return modified || mode === 'reading';
|
|
42
|
+
}
|
|
43
|
+
/** The closed vocabularies as values, so the published conformance kit checks a registration
|
|
44
|
+
* against the type's own members rather than a copy that ages out of step with it. */
|
|
45
|
+
export const DELETE_GRANULARITIES = ['atomic', 'select-then-delete'];
|
|
46
|
+
export const ON_EDGE_POLICIES = ['select', 'step-over'];
|
|
47
|
+
const registry = new Map();
|
|
48
|
+
export function registerInlineWidgetKind(kind, descriptor) {
|
|
49
|
+
if (descriptor.component && descriptor.buildWidget) {
|
|
50
|
+
throw new Error(`registerInlineWidgetKind: "${kind}" declares both a component and a buildWidget — ` +
|
|
51
|
+
`a widget kind renders through exactly one. Drop one.`);
|
|
52
|
+
}
|
|
53
|
+
registerOnce(registry.has(kind), () => registry.set(kind, descriptor), `registerInlineWidgetKind: "${kind}" is already registered. Inline-widget kinds are ` +
|
|
54
|
+
`register-once — a re-registration would clobber a built-in (image/rawHtml).`);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Layer editing fields onto an already-registered kind. The editor-layer wire-up
|
|
58
|
+
* (components/built-in-blocks.ts) attaches behavior here that would otherwise make a core
|
|
59
|
+
* registration import a downstream layer. Throws for an unregistered kind.
|
|
60
|
+
*/
|
|
61
|
+
export function augmentInlineWidgetKind(kind, editing) {
|
|
62
|
+
const descriptor = registry.get(kind);
|
|
63
|
+
if (!descriptor) {
|
|
64
|
+
throw new Error(`augmentInlineWidgetKind: "${kind}" is not registered — register the widget kind before ` +
|
|
65
|
+
`augmenting its editing policy.`);
|
|
66
|
+
}
|
|
67
|
+
descriptor.editing = { ...descriptor.editing, ...editing };
|
|
68
|
+
}
|
|
69
|
+
/** Kind-level recognition, independent of per-block render policy (renderImagesAsWidgets). */
|
|
70
|
+
export function isInlineWidget(node, raw) {
|
|
71
|
+
const descriptor = registry.get(node.kind);
|
|
72
|
+
return descriptor ? descriptor.isWidget(node, raw) : false;
|
|
73
|
+
}
|
|
74
|
+
export function getInlineWidgetEditing(kind) {
|
|
75
|
+
return registry.get(kind)?.editing;
|
|
76
|
+
}
|
|
77
|
+
export function getInlineWidgetComponent(kind) {
|
|
78
|
+
return registry.get(kind)?.component;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Every live widget reachable from `nodes`, in document order. Descends so a widget nested in a
|
|
82
|
+
* non-widget parent is found (the `image` inside `[![alt][ref]][repo]`), but never into a
|
|
83
|
+
* widget's own children, which are atomic. `raw` is the enclosing block's source.
|
|
84
|
+
*/
|
|
85
|
+
export function flattenInlineWidgets(nodes, raw) {
|
|
86
|
+
const out = [];
|
|
87
|
+
for (const node of inlineDescendants(nodes, (parent) => !isInlineWidget(parent, raw))) {
|
|
88
|
+
if (isInlineWidget(node, raw))
|
|
89
|
+
out.push(node);
|
|
90
|
+
}
|
|
91
|
+
return out;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A `component` kind routes through the injected `buildPortalWidget` because the component layer
|
|
95
|
+
* owns Svelte mounting and `core/` stays framework-free. Null when the node is not a widget, its
|
|
96
|
+
* builder is injected per render (image), or the portal builder is absent or failed.
|
|
97
|
+
*/
|
|
98
|
+
export function buildCoreInlineWidget(node, raw, buildPortalWidget) {
|
|
99
|
+
const descriptor = registry.get(node.kind);
|
|
100
|
+
if (!descriptor || !descriptor.isWidget(node, raw))
|
|
101
|
+
return null;
|
|
102
|
+
if (descriptor.component)
|
|
103
|
+
return buildPortalWidget?.(node, raw) ?? null;
|
|
104
|
+
return descriptor.buildWidget ? descriptor.buildWidget(node, raw) : null;
|
|
105
|
+
}
|
|
106
|
+
registerInlineWidgetKind('image', {
|
|
107
|
+
isWidget: () => true,
|
|
108
|
+
// Empty because the image's edge behavior is the dispatch's default; the editor layer
|
|
109
|
+
// augments this with the resize `onSelectedKey` (components/built-in-blocks.ts).
|
|
110
|
+
editing: {}
|
|
111
|
+
});
|
|
112
|
+
registerInlineWidgetKind('rawHtml', {
|
|
113
|
+
isWidget: (node, raw) => isLiveHtmlTag(raw.slice(node.start, node.end)),
|
|
114
|
+
buildWidget: (node) => buildLiveHtmlWidget(node)
|
|
115
|
+
});
|
|
116
|
+
// Gated to visibly-rendering glyphs: an invisible entity keeps its literal-source span rather
|
|
117
|
+
// than becoming an atomic island the caret cannot see.
|
|
118
|
+
registerInlineWidgetKind('entityReference', {
|
|
119
|
+
isWidget: (node) => entityRendersGlyph(node.decoded),
|
|
120
|
+
buildWidget: (node) => buildEntityWidget(node),
|
|
121
|
+
editing: { deleteGranularity: 'atomic', onEdge: 'step-over' }
|
|
122
|
+
});
|
|
123
|
+
// Must stay below the built-in registrations: it snapshots what the test reset may not drop.
|
|
124
|
+
const BUILTIN_INLINE_WIDGET_KINDS = new Set(registry.keys());
|
|
125
|
+
/** Test-only. Removes every plugin-registered inline-widget kind; built-ins survive. */
|
|
126
|
+
export function __resetInlineWidgetsForTests() {
|
|
127
|
+
for (const kind of registry.keys()) {
|
|
128
|
+
if (!BUILTIN_INLINE_WIDGET_KINDS.has(kind))
|
|
129
|
+
registry.delete(kind);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** CommonMark §4.7 label normalization plus the resolver built from LRD nodes. */
|
|
2
|
+
import type { CstNode } from '../nodes';
|
|
3
|
+
/** CommonMark §4.7 normalization. BMP-only: full Unicode case-fold is deferred until reported. */
|
|
4
|
+
export declare function normalizeLinkLabel(raw: string): string;
|
|
5
|
+
export type ResolvedReference = Readonly<{
|
|
6
|
+
url: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
}>;
|
|
9
|
+
export type LinkReferenceResolver = (label: string) => ResolvedReference | undefined;
|
|
10
|
+
export interface LinkReferenceMap {
|
|
11
|
+
/** Takes a non-normalized label. */
|
|
12
|
+
resolve: LinkReferenceResolver;
|
|
13
|
+
/**
|
|
14
|
+
* Stable snapshot of the LRD set. The lazy inline cache validates reference-bearing blocks
|
|
15
|
+
* on it, so an LRD change elsewhere re-resolves them. The render path keys on a compact
|
|
16
|
+
* epoch instead, never this string: it reaches ~MB scale in reference-heavy documents.
|
|
17
|
+
*/
|
|
18
|
+
readonly signature: string;
|
|
19
|
+
}
|
|
20
|
+
/** Collects LRDs nested inside containers too. First-wins on duplicate labels (§4.7). */
|
|
21
|
+
export declare function buildLinkReferenceMap(nodes: CstNode[]): LinkReferenceMap;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/** CommonMark §4.7 label normalization plus the resolver built from LRD nodes. */
|
|
2
|
+
import { metadataOf } from '../nodes';
|
|
3
|
+
/** CommonMark §4.7 normalization. BMP-only: full Unicode case-fold is deferred until reported. */
|
|
4
|
+
export function normalizeLinkLabel(raw) {
|
|
5
|
+
return raw.trim().replace(/\s+/g, ' ').toLowerCase();
|
|
6
|
+
}
|
|
7
|
+
/** Collects LRDs nested inside containers too. First-wins on duplicate labels (§4.7). */
|
|
8
|
+
export function buildLinkReferenceMap(nodes) {
|
|
9
|
+
const entries = new Map();
|
|
10
|
+
collectLinkReferences(nodes, entries);
|
|
11
|
+
const sigParts = [];
|
|
12
|
+
for (const [label, ref] of entries) {
|
|
13
|
+
sigParts.push(`${label}<:>${ref.url}<:>${ref.title ?? ''}`);
|
|
14
|
+
}
|
|
15
|
+
sigParts.sort();
|
|
16
|
+
const signature = sigParts.join('|');
|
|
17
|
+
return {
|
|
18
|
+
resolve: (label) => entries.get(normalizeLinkLabel(label)),
|
|
19
|
+
signature
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function collectLinkReferences(nodes, entries) {
|
|
23
|
+
const stack = [];
|
|
24
|
+
// Reversed push, so pop order is document order — which is what first-wins reads.
|
|
25
|
+
const push = (level) => {
|
|
26
|
+
for (let i = level.length - 1; i >= 0; i--)
|
|
27
|
+
stack.push(level[i]);
|
|
28
|
+
};
|
|
29
|
+
push(nodes);
|
|
30
|
+
while (stack.length > 0) {
|
|
31
|
+
const node = stack.pop();
|
|
32
|
+
if (node.kind === 'linkReferenceDefinition') {
|
|
33
|
+
const meta = metadataOf(node, 'linkReferenceDefinition');
|
|
34
|
+
if (meta?.label === undefined || meta.url === undefined)
|
|
35
|
+
continue;
|
|
36
|
+
const key = normalizeLinkLabel(meta.label);
|
|
37
|
+
if (entries.has(key))
|
|
38
|
+
continue; // first-wins
|
|
39
|
+
entries.set(key, meta.title !== undefined
|
|
40
|
+
? Object.freeze({ url: meta.url, title: meta.title })
|
|
41
|
+
: Object.freeze({ url: meta.url }));
|
|
42
|
+
}
|
|
43
|
+
if (node.children)
|
|
44
|
+
push(node.children);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowlist and builder for live-rendered inline HTML widgets. They adopt the generic
|
|
3
|
+
* `[data-inline-widget]` marker, so cursor, vertical-skip, and edge-select need no per-kind
|
|
4
|
+
* plumbing (`cursor/widget-offset.ts`).
|
|
5
|
+
*/
|
|
6
|
+
import type { InlineNode } from '../nodes';
|
|
7
|
+
/** Comments, PIs, declarations, and CDATA never match: they have no tag name. */
|
|
8
|
+
export declare function isLiveHtmlTag(slice: string): boolean;
|
|
9
|
+
/** The outer span is the shell the cursor machinery recognizes; the inner `<br>` breaks. */
|
|
10
|
+
export declare function buildLiveHtmlWidget(node: InlineNode): HTMLSpanElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Allowlist and builder for live-rendered inline HTML widgets. They adopt the generic
|
|
3
|
+
* `[data-inline-widget]` marker, so cursor, vertical-skip, and edge-select need no per-kind
|
|
4
|
+
* plumbing (`cursor/widget-offset.ts`).
|
|
5
|
+
*/
|
|
6
|
+
import { mintWidgetShell } from './inline-widgets';
|
|
7
|
+
/** A tag from GFM §6.11's disallowed-raw-HTML list must never be added here. */
|
|
8
|
+
const LIVE_HTML_TAGS = new Set(['br']);
|
|
9
|
+
const TAG_NAME_EXTRACT = /^<\/?([A-Za-z][A-Za-z0-9-]*)/;
|
|
10
|
+
/** Comments, PIs, declarations, and CDATA never match: they have no tag name. */
|
|
11
|
+
export function isLiveHtmlTag(slice) {
|
|
12
|
+
const m = TAG_NAME_EXTRACT.exec(slice);
|
|
13
|
+
if (!m)
|
|
14
|
+
return false;
|
|
15
|
+
return LIVE_HTML_TAGS.has(m[1].toLowerCase());
|
|
16
|
+
}
|
|
17
|
+
/** The outer span is the shell the cursor machinery recognizes; the inner `<br>` breaks. */
|
|
18
|
+
export function buildLiveHtmlWidget(node) {
|
|
19
|
+
const shell = mintWidgetShell('md-br-widget', node);
|
|
20
|
+
shell.appendChild(document.createElement('br'));
|
|
21
|
+
return shell;
|
|
22
|
+
}
|