@lapismd/mira 0.0.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/CHANGELOG.md +7 -0
- package/LICENSE.md +4 -0
- package/README.md +52 -0
- package/dist/codemirror.d.ts +5 -0
- package/dist/codemirror.d.ts.map +1 -0
- package/dist/codemirror.js +4 -0
- package/dist/core/code-mirror.d.ts +29 -0
- package/dist/core/code-mirror.d.ts.map +1 -0
- package/dist/core/code-mirror.js +74 -0
- package/dist/core/code-mirror.test.d.ts +2 -0
- package/dist/core/code-mirror.test.d.ts.map +1 -0
- package/dist/core/code-mirror.test.js +68 -0
- package/dist/core/images.d.ts +30 -0
- package/dist/core/images.d.ts.map +1 -0
- package/dist/core/images.js +226 -0
- package/dist/core/images.test.d.ts +2 -0
- package/dist/core/images.test.d.ts.map +1 -0
- package/dist/core/images.test.js +109 -0
- package/dist/core/index.d.ts +69 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +138 -0
- package/dist/core/index.test.d.ts +2 -0
- package/dist/core/index.test.d.ts.map +1 -0
- package/dist/core/index.test.js +11 -0
- package/dist/core/markdown-actions.d.ts +11 -0
- package/dist/core/markdown-actions.d.ts.map +1 -0
- package/dist/core/markdown-actions.js +603 -0
- package/dist/core/markdown-actions.test.d.ts +2 -0
- package/dist/core/markdown-actions.test.d.ts.map +1 -0
- package/dist/core/markdown-actions.test.js +182 -0
- package/dist/extensions/doodle-dividers.d.ts +44 -0
- package/dist/extensions/doodle-dividers.d.ts.map +1 -0
- package/dist/extensions/doodle-dividers.js +909 -0
- package/dist/extensions/doodle-dividers.test.d.ts +2 -0
- package/dist/extensions/doodle-dividers.test.d.ts.map +1 -0
- package/dist/extensions/doodle-dividers.test.js +296 -0
- package/dist/extensions/index.d.ts +342 -0
- package/dist/extensions/index.d.ts.map +1 -0
- package/dist/extensions/index.js +279 -0
- package/dist/extensions/index.test.d.ts +2 -0
- package/dist/extensions/index.test.d.ts.map +1 -0
- package/dist/extensions/index.test.js +283 -0
- package/dist/extensions/selection-toolbar.d.ts +6 -0
- package/dist/extensions/selection-toolbar.d.ts.map +1 -0
- package/dist/extensions/selection-toolbar.js +14 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +5 -0
- package/dist/index.test.d.ts +2 -0
- package/dist/index.test.d.ts.map +1 -0
- package/dist/index.test.js +64 -0
- package/dist/internal/appearance-context.d.ts +12 -0
- package/dist/internal/appearance-context.d.ts.map +1 -0
- package/dist/internal/appearance-context.js +31 -0
- package/dist/internal/appearance-context.test.d.ts +2 -0
- package/dist/internal/appearance-context.test.d.ts.map +1 -0
- package/dist/internal/appearance-context.test.js +31 -0
- package/dist/internal/codemirror/base/index.d.ts +24 -0
- package/dist/internal/codemirror/base/index.d.ts.map +1 -0
- package/dist/internal/codemirror/base/index.js +489 -0
- package/dist/internal/codemirror/base/index.test.d.ts +2 -0
- package/dist/internal/codemirror/base/index.test.d.ts.map +1 -0
- package/dist/internal/codemirror/base/index.test.js +303 -0
- package/dist/internal/codemirror/base/search-panel.svelte +590 -0
- package/dist/internal/codemirror/base/search-panel.svelte.d.ts +8 -0
- package/dist/internal/codemirror/base/search-panel.svelte.d.ts.map +1 -0
- package/dist/internal/codemirror/base/search.d.ts +46 -0
- package/dist/internal/codemirror/base/search.d.ts.map +1 -0
- package/dist/internal/codemirror/base/search.js +58 -0
- package/dist/internal/codemirror/base/search.test.d.ts +2 -0
- package/dist/internal/codemirror/base/search.test.d.ts.map +1 -0
- package/dist/internal/codemirror/base/search.test.js +155 -0
- package/dist/internal/codemirror/base/selection-toolbar.d.ts +21 -0
- package/dist/internal/codemirror/base/selection-toolbar.d.ts.map +1 -0
- package/dist/internal/codemirror/base/selection-toolbar.js +306 -0
- package/dist/internal/codemirror/base/selection-toolbar.test.d.ts +2 -0
- package/dist/internal/codemirror/base/selection-toolbar.test.d.ts.map +1 -0
- package/dist/internal/codemirror/base/selection-toolbar.test.js +149 -0
- package/dist/internal/codemirror/base/slash-commands.d.ts +61 -0
- package/dist/internal/codemirror/base/slash-commands.d.ts.map +1 -0
- package/dist/internal/codemirror/base/slash-commands.js +463 -0
- package/dist/internal/codemirror/markdown/authoring.d.ts +9 -0
- package/dist/internal/codemirror/markdown/authoring.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/authoring.js +14 -0
- package/dist/internal/codemirror/markdown/authoring.test.d.ts +2 -0
- package/dist/internal/codemirror/markdown/authoring.test.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/authoring.test.js +222 -0
- package/dist/internal/codemirror/markdown/completion.d.ts +12 -0
- package/dist/internal/codemirror/markdown/completion.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/completion.js +302 -0
- package/dist/internal/codemirror/markdown/directives.d.ts +3 -0
- package/dist/internal/codemirror/markdown/directives.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/directives.js +154 -0
- package/dist/internal/codemirror/markdown/grid-table.d.ts +3 -0
- package/dist/internal/codemirror/markdown/grid-table.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/grid-table.js +129 -0
- package/dist/internal/codemirror/markdown/index.d.ts +16 -0
- package/dist/internal/codemirror/markdown/index.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/index.js +125 -0
- package/dist/internal/codemirror/markdown/index.test.d.ts +2 -0
- package/dist/internal/codemirror/markdown/index.test.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/index.test.js +158 -0
- package/dist/internal/codemirror/markdown/input-handlers.d.ts +4 -0
- package/dist/internal/codemirror/markdown/input-handlers.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/input-handlers.js +56 -0
- package/dist/internal/codemirror/markdown/lapis-inline.d.ts +11 -0
- package/dist/internal/codemirror/markdown/lapis-inline.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/lapis-inline.js +189 -0
- package/dist/internal/codemirror/markdown/latex.d.ts +5 -0
- package/dist/internal/codemirror/markdown/latex.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/latex.js +97 -0
- package/dist/internal/codemirror/markdown/list-after-lazy-quote.d.ts +10 -0
- package/dist/internal/codemirror/markdown/list-after-lazy-quote.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/list-after-lazy-quote.js +28 -0
- package/dist/internal/codemirror/markdown/paste.d.ts +5 -0
- package/dist/internal/codemirror/markdown/paste.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/paste.js +84 -0
- package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts +2 -0
- package/dist/internal/codemirror/markdown/showcase-fixture.test.d.ts.map +1 -0
- package/dist/internal/codemirror/markdown/showcase-fixture.test.js +50 -0
- package/dist/internal/codemirror/markdown/types.d.ts +6 -0
- package/dist/internal/codemirror/rich/block-controls.d.ts +4 -0
- package/dist/internal/codemirror/rich/block-controls.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-controls.js +1419 -0
- package/dist/internal/codemirror/rich/block-controls.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/block-controls.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-controls.test.js +401 -0
- package/dist/internal/codemirror/rich/block-ranges.d.ts +22 -0
- package/dist/internal/codemirror/rich/block-ranges.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-ranges.js +736 -0
- package/dist/internal/codemirror/rich/block-ranges.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/block-ranges.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-ranges.test.js +310 -0
- package/dist/internal/codemirror/rich/block-toolbar.d.ts +25 -0
- package/dist/internal/codemirror/rich/block-toolbar.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-toolbar.js +506 -0
- package/dist/internal/codemirror/rich/block-toolbar.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/block-toolbar.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/block-toolbar.test.js +178 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.d.ts +7 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.js +122 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/decorations/fold-indicators.test.js +8 -0
- package/dist/internal/codemirror/rich/decorations/heading-gutter.d.ts +3 -0
- package/dist/internal/codemirror/rich/decorations/heading-gutter.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/decorations/heading-gutter.js +43 -0
- package/dist/internal/codemirror/rich/index.d.ts +17 -0
- package/dist/internal/codemirror/rich/index.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/index.js +727 -0
- package/dist/internal/codemirror/rich/index.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/index.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/index.test.js +544 -0
- package/dist/internal/codemirror/rich/theme.d.ts +2 -0
- package/dist/internal/codemirror/rich/theme.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/theme.js +268 -0
- package/dist/internal/codemirror/rich/types.d.ts +22 -0
- package/dist/internal/codemirror/rich/types.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/types.js +1 -0
- package/dist/internal/codemirror/rich/utils/activation.d.ts +3 -0
- package/dist/internal/codemirror/rich/utils/activation.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/activation.js +27 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.d.ts +8 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.js +143 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/code-block-lines.test.js +82 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.d.ts +4 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.js +25 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/fenced-code.test.js +12 -0
- package/dist/internal/codemirror/rich/utils/headings.d.ts +5 -0
- package/dist/internal/codemirror/rich/utils/headings.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/headings.js +20 -0
- package/dist/internal/codemirror/rich/utils/headings.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/headings.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/headings.test.js +27 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.js +82 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/height-estimates.test.js +10 -0
- package/dist/internal/codemirror/rich/utils/images.d.ts +9 -0
- package/dist/internal/codemirror/rich/utils/images.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/images.js +103 -0
- package/dist/internal/codemirror/rich/utils/images.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/images.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/images.test.js +37 -0
- package/dist/internal/codemirror/rich/utils/indent.d.ts +38 -0
- package/dist/internal/codemirror/rich/utils/indent.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/indent.js +435 -0
- package/dist/internal/codemirror/rich/utils/indent.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/indent.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/indent.test.js +169 -0
- package/dist/internal/codemirror/rich/utils/inline-code.d.ts +7 -0
- package/dist/internal/codemirror/rich/utils/inline-code.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/inline-code.js +43 -0
- package/dist/internal/codemirror/rich/utils/inline-math.d.ts +6 -0
- package/dist/internal/codemirror/rich/utils/inline-math.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/inline-math.js +45 -0
- package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/inline-math.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/inline-math.test.js +15 -0
- package/dist/internal/codemirror/rich/utils/links.d.ts +6 -0
- package/dist/internal/codemirror/rich/utils/links.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/links.js +36 -0
- package/dist/internal/codemirror/rich/utils/links.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/links.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/links.test.js +28 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.d.ts +15 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.js +41 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/list-callouts.test.js +47 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.d.ts +18 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.js +419 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/measured-indent.test.js +102 -0
- package/dist/internal/codemirror/rich/utils/ranges.d.ts +13 -0
- package/dist/internal/codemirror/rich/utils/ranges.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/ranges.js +42 -0
- package/dist/internal/codemirror/rich/utils/ranges.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/ranges.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/ranges.test.js +22 -0
- package/dist/internal/codemirror/rich/utils/tasks.d.ts +11 -0
- package/dist/internal/codemirror/rich/utils/tasks.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/tasks.js +23 -0
- package/dist/internal/codemirror/rich/utils/tasks.test.d.ts +2 -0
- package/dist/internal/codemirror/rich/utils/tasks.test.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/utils/tasks.test.js +57 -0
- package/dist/internal/codemirror/rich/widgets/list-callout.d.ts +19 -0
- package/dist/internal/codemirror/rich/widgets/list-callout.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/widgets/list-callout.js +58 -0
- package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts +50 -0
- package/dist/internal/codemirror/rich/widgets/preview-widgets.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/widgets/preview-widgets.js +311 -0
- package/dist/internal/codemirror/rich/widgets/source-toggle.d.ts +4 -0
- package/dist/internal/codemirror/rich/widgets/source-toggle.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/widgets/source-toggle.js +47 -0
- package/dist/internal/codemirror/rich/widgets/task-checkbox.d.ts +14 -0
- package/dist/internal/codemirror/rich/widgets/task-checkbox.d.ts.map +1 -0
- package/dist/internal/codemirror/rich/widgets/task-checkbox.js +54 -0
- package/dist/internal/doodle-dividers.d.ts +62 -0
- package/dist/internal/doodle-dividers.d.ts.map +1 -0
- package/dist/internal/doodle-dividers.js +103 -0
- package/dist/internal/task-states.d.ts +73 -0
- package/dist/internal/task-states.d.ts.map +1 -0
- package/dist/internal/task-states.js +27 -0
- package/dist/internal/task-states.test.d.ts +2 -0
- package/dist/internal/task-states.test.d.ts.map +1 -0
- package/dist/internal/task-states.test.js +36 -0
- package/dist/mira-code-editor.css +222 -0
- package/dist/mira-code-editor.d.ts +40 -0
- package/dist/mira-code-editor.d.ts.map +1 -0
- package/dist/mira-code-editor.js +1 -0
- package/dist/mira-code-editor.svelte +181 -0
- package/dist/mira-code-editor.svelte.d.ts +17 -0
- package/dist/mira-code-editor.svelte.d.ts.map +1 -0
- package/dist/mira-code-editor.test.d.ts +2 -0
- package/dist/mira-code-editor.test.d.ts.map +1 -0
- package/dist/mira-code-editor.test.js +93 -0
- package/dist/mira.svelte +581 -0
- package/dist/mira.svelte.d.ts +23 -0
- package/dist/mira.svelte.d.ts.map +1 -0
- package/dist/mode-position.d.ts +18 -0
- package/dist/mode-position.d.ts.map +1 -0
- package/dist/mode-position.js +99 -0
- package/dist/mode-position.test.d.ts +2 -0
- package/dist/mode-position.test.d.ts.map +1 -0
- package/dist/mode-position.test.js +60 -0
- package/dist/preview/adobe-gridtables.d.ts +11 -0
- package/dist/preview/code-language.d.ts +2 -0
- package/dist/preview/code-language.d.ts.map +1 -0
- package/dist/preview/code-language.js +58 -0
- package/dist/preview/code-language.test.d.ts +2 -0
- package/dist/preview/code-language.test.d.ts.map +1 -0
- package/dist/preview/code-language.test.js +12 -0
- package/dist/preview/components/callout.svelte +123 -0
- package/dist/preview/components/callout.svelte.d.ts +17 -0
- package/dist/preview/components/callout.svelte.d.ts.map +1 -0
- package/dist/preview/components/checkbox.svelte +151 -0
- package/dist/preview/components/checkbox.svelte.d.ts +12 -0
- package/dist/preview/components/checkbox.svelte.d.ts.map +1 -0
- package/dist/preview/components/code.svelte +146 -0
- package/dist/preview/components/code.svelte.d.ts +12 -0
- package/dist/preview/components/code.svelte.d.ts.map +1 -0
- package/dist/preview/components/embed.svelte +236 -0
- package/dist/preview/components/embed.svelte.d.ts +14 -0
- package/dist/preview/components/embed.svelte.d.ts.map +1 -0
- package/dist/preview/components/embedded-markdown-preview.svelte +53 -0
- package/dist/preview/components/embedded-markdown-preview.svelte.d.ts +12 -0
- package/dist/preview/components/embedded-markdown-preview.svelte.d.ts.map +1 -0
- package/dist/preview/components/frontmatter-property-name-input.svelte +207 -0
- package/dist/preview/components/frontmatter-property-name-input.svelte.d.ts +14 -0
- package/dist/preview/components/frontmatter-property-name-input.svelte.d.ts.map +1 -0
- package/dist/preview/components/frontmatter-property-text-input.svelte +228 -0
- package/dist/preview/components/frontmatter-property-text-input.svelte.d.ts +13 -0
- package/dist/preview/components/frontmatter-property-text-input.svelte.d.ts.map +1 -0
- package/dist/preview/components/frontmatter-property-value-input.svelte +232 -0
- package/dist/preview/components/frontmatter-property-value-input.svelte.d.ts +13 -0
- package/dist/preview/components/frontmatter-property-value-input.svelte.d.ts.map +1 -0
- package/dist/preview/components/frontmatter-utils.d.ts +2 -0
- package/dist/preview/components/frontmatter-utils.d.ts.map +1 -0
- package/dist/preview/components/frontmatter-utils.js +1 -0
- package/dist/preview/components/frontmatter.svelte +857 -0
- package/dist/preview/components/frontmatter.svelte.d.ts +18 -0
- package/dist/preview/components/frontmatter.svelte.d.ts.map +1 -0
- package/dist/preview/components/icon.svelte +225 -0
- package/dist/preview/components/icon.svelte.d.ts +9 -0
- package/dist/preview/components/icon.svelte.d.ts.map +1 -0
- package/dist/preview/components/icon.test.d.ts +2 -0
- package/dist/preview/components/icon.test.d.ts.map +1 -0
- package/dist/preview/components/icon.test.js +20 -0
- package/dist/preview/components/image.svelte +266 -0
- package/dist/preview/components/image.svelte.d.ts +10 -0
- package/dist/preview/components/image.svelte.d.ts.map +1 -0
- package/dist/preview/components/link.svelte +382 -0
- package/dist/preview/components/link.svelte.d.ts +16 -0
- package/dist/preview/components/link.svelte.d.ts.map +1 -0
- package/dist/preview/components/list-callout-control.svelte +138 -0
- package/dist/preview/components/list-callout-control.svelte.d.ts +10 -0
- package/dist/preview/components/list-callout-control.svelte.d.ts.map +1 -0
- package/dist/preview/components/list-callout-marker.svelte +108 -0
- package/dist/preview/components/list-callout-marker.svelte.d.ts +15 -0
- package/dist/preview/components/list-callout-marker.svelte.d.ts.map +1 -0
- package/dist/preview/components/list-item.svelte +161 -0
- package/dist/preview/components/list-item.svelte.d.ts +11 -0
- package/dist/preview/components/list-item.svelte.d.ts.map +1 -0
- package/dist/preview/components/tag.svelte +18 -0
- package/dist/preview/components/tag.svelte.d.ts +10 -0
- package/dist/preview/components/tag.svelte.d.ts.map +1 -0
- package/dist/preview/components/task-checkbox-control.svelte +113 -0
- package/dist/preview/components/task-checkbox-control.svelte.d.ts +14 -0
- package/dist/preview/components/task-checkbox-control.svelte.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/behavior.d.ts +6 -0
- package/dist/preview/editable-markdown-preview/behavior.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/behavior.js +57 -0
- package/dist/preview/editable-markdown-preview/behavior.test.d.ts +2 -0
- package/dist/preview/editable-markdown-preview/behavior.test.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/behavior.test.js +36 -0
- package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte +386 -0
- package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte.d.ts +35 -0
- package/dist/preview/editable-markdown-preview/editable-markdown-surface.svelte.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/editor-surface.svelte +228 -0
- package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts +22 -0
- package/dist/preview/editable-markdown-preview/editor-surface.svelte.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.d.ts +36 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.js +109 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts +2 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.test.d.ts.map +1 -0
- package/dist/preview/editable-markdown-preview/serialized-writer.test.js +59 -0
- package/dist/preview/editable-markdown-preview.svelte +195 -0
- package/dist/preview/editable-markdown-preview.svelte.d.ts +37 -0
- package/dist/preview/editable-markdown-preview.svelte.d.ts.map +1 -0
- package/dist/preview/embed-target.d.ts +13 -0
- package/dist/preview/embed-target.d.ts.map +1 -0
- package/dist/preview/embed-target.js +133 -0
- package/dist/preview/embed-target.test.d.ts +2 -0
- package/dist/preview/embed-target.test.d.ts.map +1 -0
- package/dist/preview/embed-target.test.js +78 -0
- package/dist/preview/file-embed.svelte +56 -0
- package/dist/preview/file-embed.svelte.d.ts +32 -0
- package/dist/preview/file-embed.svelte.d.ts.map +1 -0
- package/dist/preview/frontmatter/controller.svelte.d.ts +58 -0
- package/dist/preview/frontmatter/controller.svelte.d.ts.map +1 -0
- package/dist/preview/frontmatter/controller.svelte.js +195 -0
- package/dist/preview/frontmatter/defaults.d.ts +3 -0
- package/dist/preview/frontmatter/defaults.d.ts.map +1 -0
- package/dist/preview/frontmatter/defaults.js +32 -0
- package/dist/preview/frontmatter/frontmatter.test.d.ts +2 -0
- package/dist/preview/frontmatter/frontmatter.test.d.ts.map +1 -0
- package/dist/preview/frontmatter/frontmatter.test.js +190 -0
- package/dist/preview/frontmatter/index.d.ts +12 -0
- package/dist/preview/frontmatter/index.d.ts.map +1 -0
- package/dist/preview/frontmatter/index.js +11 -0
- package/dist/preview/frontmatter/manager.d.ts +28 -0
- package/dist/preview/frontmatter/manager.d.ts.map +1 -0
- package/dist/preview/frontmatter/manager.js +46 -0
- package/dist/preview/frontmatter/parse.d.ts +4 -0
- package/dist/preview/frontmatter/parse.d.ts.map +1 -0
- package/dist/preview/frontmatter/parse.js +49 -0
- package/dist/preview/frontmatter/predicates.d.ts +3 -0
- package/dist/preview/frontmatter/predicates.d.ts.map +1 -0
- package/dist/preview/frontmatter/predicates.js +7 -0
- package/dist/preview/frontmatter/properties.d.ts +13 -0
- package/dist/preview/frontmatter/properties.d.ts.map +1 -0
- package/dist/preview/frontmatter/properties.js +250 -0
- package/dist/preview/frontmatter/serialize.d.ts +3 -0
- package/dist/preview/frontmatter/serialize.d.ts.map +1 -0
- package/dist/preview/frontmatter/serialize.js +10 -0
- package/dist/preview/frontmatter/suggestions.d.ts +11 -0
- package/dist/preview/frontmatter/suggestions.d.ts.map +1 -0
- package/dist/preview/frontmatter/suggestions.js +91 -0
- package/dist/preview/frontmatter/suggestions.test.d.ts +2 -0
- package/dist/preview/frontmatter/suggestions.test.d.ts.map +1 -0
- package/dist/preview/frontmatter/suggestions.test.js +45 -0
- package/dist/preview/frontmatter/types.d.ts +66 -0
- package/dist/preview/frontmatter/types.d.ts.map +1 -0
- package/dist/preview/frontmatter/types.js +27 -0
- package/dist/preview/frontmatter/values.d.ts +5 -0
- package/dist/preview/frontmatter/values.d.ts.map +1 -0
- package/dist/preview/frontmatter/values.js +96 -0
- package/dist/preview/frontmatter/widgets.d.ts +9 -0
- package/dist/preview/frontmatter/widgets.d.ts.map +1 -0
- package/dist/preview/frontmatter/widgets.js +104 -0
- package/dist/preview/index.d.ts +18 -0
- package/dist/preview/index.d.ts.map +1 -0
- package/dist/preview/index.js +15 -0
- package/dist/preview/markdown-embed.svelte +80 -0
- package/dist/preview/markdown-embed.svelte.d.ts +27 -0
- package/dist/preview/markdown-embed.svelte.d.ts.map +1 -0
- package/dist/preview/markdown-outline.svelte +256 -0
- package/dist/preview/markdown-outline.svelte.d.ts +15 -0
- package/dist/preview/markdown-outline.svelte.d.ts.map +1 -0
- package/dist/preview/markdown-preview.svelte +500 -0
- package/dist/preview/markdown-preview.svelte.d.ts +30 -0
- package/dist/preview/markdown-preview.svelte.d.ts.map +1 -0
- package/dist/preview/note-link.svelte +78 -0
- package/dist/preview/note-link.svelte.d.ts +25 -0
- package/dist/preview/note-link.svelte.d.ts.map +1 -0
- package/dist/preview/outline.d.ts +16 -0
- package/dist/preview/outline.d.ts.map +1 -0
- package/dist/preview/outline.js +54 -0
- package/dist/preview/outline.test.d.ts +2 -0
- package/dist/preview/outline.test.d.ts.map +1 -0
- package/dist/preview/outline.test.js +98 -0
- package/dist/preview/portable-surfaces.test.d.ts +2 -0
- package/dist/preview/portable-surfaces.test.d.ts.map +1 -0
- package/dist/preview/portable-surfaces.test.js +482 -0
- package/dist/preview/preview.test.d.ts +2 -0
- package/dist/preview/preview.test.d.ts.map +1 -0
- package/dist/preview/preview.test.js +124 -0
- package/dist/preview/rehype-code-context.d.ts +5 -0
- package/dist/preview/rehype-code-context.d.ts.map +1 -0
- package/dist/preview/rehype-code-context.js +17 -0
- package/dist/preview/rehype-highlight-lines.d.ts +9 -0
- package/dist/preview/rehype-highlight-lines.d.ts.map +1 -0
- package/dist/preview/rehype-highlight-lines.js +257 -0
- package/dist/preview/rehype-table-spans.d.ts +4 -0
- package/dist/preview/rehype-table-spans.d.ts.map +1 -0
- package/dist/preview/rehype-table-spans.js +120 -0
- package/dist/preview/remark/callouts.d.ts +4 -0
- package/dist/preview/remark/callouts.d.ts.map +1 -0
- package/dist/preview/remark/callouts.js +81 -0
- package/dist/preview/remark/callouts.test.d.ts +2 -0
- package/dist/preview/remark/callouts.test.d.ts.map +1 -0
- package/dist/preview/remark/callouts.test.js +23 -0
- package/dist/preview/remark/custom-checklists.d.ts +25 -0
- package/dist/preview/remark/custom-checklists.d.ts.map +1 -0
- package/dist/preview/remark/custom-checklists.js +204 -0
- package/dist/preview/remark/custom-checklists.test.d.ts +2 -0
- package/dist/preview/remark/custom-checklists.test.d.ts.map +1 -0
- package/dist/preview/remark/custom-checklists.test.js +51 -0
- package/dist/preview/remark/external-links.d.ts +4 -0
- package/dist/preview/remark/external-links.d.ts.map +1 -0
- package/dist/preview/remark/external-links.js +34 -0
- package/dist/preview/remark/hast.d.ts +6 -0
- package/dist/preview/remark/hast.d.ts.map +1 -0
- package/dist/preview/remark/hast.js +60 -0
- package/dist/preview/remark/headings.d.ts +8 -0
- package/dist/preview/remark/headings.d.ts.map +1 -0
- package/dist/preview/remark/headings.js +40 -0
- package/dist/preview/remark/links.test.d.ts +2 -0
- package/dist/preview/remark/links.test.d.ts.map +1 -0
- package/dist/preview/remark/links.test.js +62 -0
- package/dist/preview/remark/list-callouts.d.ts +14 -0
- package/dist/preview/remark/list-callouts.d.ts.map +1 -0
- package/dist/preview/remark/list-callouts.js +91 -0
- package/dist/preview/remark/multimarkdown-table.d.ts +11 -0
- package/dist/preview/remark/multimarkdown-table.d.ts.map +1 -0
- package/dist/preview/remark/multimarkdown-table.js +138 -0
- package/dist/preview/remark/parity.test.d.ts +2 -0
- package/dist/preview/remark/parity.test.d.ts.map +1 -0
- package/dist/preview/remark/parity.test.js +105 -0
- package/dist/preview/remark/pathlink.d.ts +4 -0
- package/dist/preview/remark/pathlink.d.ts.map +1 -0
- package/dist/preview/remark/pathlink.js +26 -0
- package/dist/preview/remark/tags.d.ts +4 -0
- package/dist/preview/remark/tags.d.ts.map +1 -0
- package/dist/preview/remark/tags.js +22 -0
- package/dist/preview/remark/utils.d.ts +12 -0
- package/dist/preview/remark/utils.d.ts.map +1 -0
- package/dist/preview/remark/utils.js +74 -0
- package/dist/preview/remark/wikilink.d.ts +4 -0
- package/dist/preview/remark/wikilink.d.ts.map +1 -0
- package/dist/preview/remark/wikilink.js +23 -0
- package/dist/preview/remark.d.ts +12 -0
- package/dist/preview/remark.d.ts.map +1 -0
- package/dist/preview/remark.js +11 -0
- package/dist/preview/renderer/context.svelte.d.ts +37 -0
- package/dist/preview/renderer/context.svelte.d.ts.map +1 -0
- package/dist/preview/renderer/context.svelte.js +47 -0
- package/dist/preview/renderer/markdown.svelte +109 -0
- package/dist/preview/renderer/markdown.svelte.d.ts +28 -0
- package/dist/preview/renderer/markdown.svelte.d.ts.map +1 -0
- package/dist/preview/renderer/renderer.svelte +122 -0
- package/dist/preview/renderer/renderer.svelte.d.ts +9 -0
- package/dist/preview/renderer/renderer.svelte.d.ts.map +1 -0
- package/dist/preview/renderer/types.d.ts +20 -0
- package/dist/preview/renderer/types.d.ts.map +1 -0
- package/dist/preview/renderer/types.js +1 -0
- package/dist/preview/renderer/utils.d.ts +9 -0
- package/dist/preview/renderer/utils.d.ts.map +1 -0
- package/dist/preview/renderer/utils.js +135 -0
- package/dist/preview/styles/blockquotes-footnotes.css +78 -0
- package/dist/preview/styles/callouts.css +171 -0
- package/dist/preview/styles/code-katex.css +213 -0
- package/dist/preview/styles/editor-shared.css +132 -0
- package/dist/preview/styles/frontmatter-collapsible.css +94 -0
- package/dist/preview/styles/frontmatter-properties.css +532 -0
- package/dist/preview/styles/frontmatter-properties.test.d.ts +2 -0
- package/dist/preview/styles/frontmatter-properties.test.d.ts.map +1 -0
- package/dist/preview/styles/frontmatter-properties.test.js +57 -0
- package/dist/preview/styles/headings.css +183 -0
- package/dist/preview/styles/images.css +177 -0
- package/dist/preview/styles/links-embeds-tags.css +275 -0
- package/dist/preview/styles/list-callouts.css +281 -0
- package/dist/preview/styles/lists-tasks.css +638 -0
- package/dist/preview/styles/live-preview.css +58 -0
- package/dist/preview/styles/mermaid-highlight.css +112 -0
- package/dist/preview/styles/outline.css +219 -0
- package/dist/preview/styles/reading-mode.css +151 -0
- package/dist/preview/styles/source-mode.css +498 -0
- package/dist/preview/styles/source-mode.test.d.ts +2 -0
- package/dist/preview/styles/source-mode.test.d.ts.map +1 -0
- package/dist/preview/styles/source-mode.test.js +13 -0
- package/dist/preview/styles/surfaces.css +56 -0
- package/dist/preview/styles/tables.css +550 -0
- package/dist/preview/styles/tokens.css +269 -0
- package/dist/preview/styles/utilities.css +700 -0
- package/dist/preview/styles.css +22 -0
- package/dist/preview/test-utils.d.ts +3 -0
- package/dist/preview/test-utils.d.ts.map +1 -0
- package/dist/preview/test-utils.js +15 -0
- package/dist/styles.css +139 -0
- package/dist/tables/adobe-gridtables.d.ts +6 -0
- package/dist/tables/editor-column.svelte +136 -0
- package/dist/tables/editor-column.svelte.d.ts +12 -0
- package/dist/tables/editor-column.svelte.d.ts.map +1 -0
- package/dist/tables/editor-table.svelte +967 -0
- package/dist/tables/editor-table.svelte.d.ts +12 -0
- package/dist/tables/editor-table.svelte.d.ts.map +1 -0
- package/dist/tables/extension.d.ts +19 -0
- package/dist/tables/extension.d.ts.map +1 -0
- package/dist/tables/extension.js +189 -0
- package/dist/tables/extension.test.d.ts +2 -0
- package/dist/tables/extension.test.d.ts.map +1 -0
- package/dist/tables/extension.test.js +100 -0
- package/dist/tables/from-markdown.d.ts +1 -0
- package/dist/tables/from-markdown.js +378 -0
- package/dist/tables/grid-editor-column.svelte +127 -0
- package/dist/tables/grid-editor-column.svelte.d.ts +10 -0
- package/dist/tables/grid-editor-column.svelte.d.ts.map +1 -0
- package/dist/tables/grid-editor-column.test.d.ts +2 -0
- package/dist/tables/grid-editor-column.test.d.ts.map +1 -0
- package/dist/tables/grid-editor-column.test.js +27 -0
- package/dist/tables/grid-editor-table.svelte +1260 -0
- package/dist/tables/grid-editor-table.svelte.d.ts +12 -0
- package/dist/tables/grid-editor-table.svelte.d.ts.map +1 -0
- package/dist/tables/grid-table-extension.d.ts +14 -0
- package/dist/tables/grid-table-extension.d.ts.map +1 -0
- package/dist/tables/grid-table-extension.js +183 -0
- package/dist/tables/grid-table.d.ts +141 -0
- package/dist/tables/grid-table.d.ts.map +1 -0
- package/dist/tables/grid-table.js +425 -0
- package/dist/tables/grid-table.test.d.ts +2 -0
- package/dist/tables/grid-table.test.d.ts.map +1 -0
- package/dist/tables/grid-table.test.js +140 -0
- package/dist/tables/index.d.ts +13 -0
- package/dist/tables/index.d.ts.map +1 -0
- package/dist/tables/index.js +12 -0
- package/dist/tables/index.test.d.ts +2 -0
- package/dist/tables/index.test.d.ts.map +1 -0
- package/dist/tables/index.test.js +7 -0
- package/dist/tables/inline-editor-extensions.d.ts +3 -0
- package/dist/tables/inline-editor-extensions.d.ts.map +1 -0
- package/dist/tables/inline-editor-extensions.js +16 -0
- package/dist/tables/inline-editor-extensions.test.d.ts +2 -0
- package/dist/tables/inline-editor-extensions.test.d.ts.map +1 -0
- package/dist/tables/inline-editor-extensions.test.js +23 -0
- package/dist/tables/markdown-table-column-head.svelte +103 -0
- package/dist/tables/markdown-table-column-head.svelte.d.ts +14 -0
- package/dist/tables/markdown-table-column-head.svelte.d.ts.map +1 -0
- package/dist/tables/markdown-table-data-cell.svelte +121 -0
- package/dist/tables/markdown-table-data-cell.svelte.d.ts +24 -0
- package/dist/tables/markdown-table-data-cell.svelte.d.ts.map +1 -0
- package/dist/tables/markdown-table-dnd.d.ts +6 -0
- package/dist/tables/markdown-table-dnd.d.ts.map +1 -0
- package/dist/tables/markdown-table-dnd.js +6 -0
- package/dist/tables/markdown-table-row-gutter-cell.svelte +161 -0
- package/dist/tables/markdown-table-row-gutter-cell.svelte.d.ts +15 -0
- package/dist/tables/markdown-table-row-gutter-cell.svelte.d.ts.map +1 -0
- package/dist/tables/menu-component.svelte +109 -0
- package/dist/tables/menu-component.svelte.d.ts +8 -0
- package/dist/tables/menu-component.svelte.d.ts.map +1 -0
- package/dist/tables/menu.d.ts +21 -0
- package/dist/tables/menu.d.ts.map +1 -0
- package/dist/tables/menu.js +41 -0
- package/dist/tables/pipe-table.d.ts +4 -0
- package/dist/tables/pipe-table.d.ts.map +1 -0
- package/dist/tables/pipe-table.js +62 -0
- package/dist/tables/pipe-table.test.d.ts +2 -0
- package/dist/tables/pipe-table.test.d.ts.map +1 -0
- package/dist/tables/pipe-table.test.js +13 -0
- package/dist/tables/syntax.d.ts +1 -0
- package/dist/tables/syntax.js +436 -0
- package/dist/tables/table-line-scroll-sync.d.ts +5 -0
- package/dist/tables/table-line-scroll-sync.d.ts.map +1 -0
- package/dist/tables/table-line-scroll-sync.js +123 -0
- package/dist/tables/table-node.d.ts +92 -0
- package/dist/tables/table-node.d.ts.map +1 -0
- package/dist/tables/table-node.js +514 -0
- package/dist/tables/table-node.test.d.ts +2 -0
- package/dist/tables/table-node.test.d.ts.map +1 -0
- package/dist/tables/table-node.test.js +167 -0
- package/dist/tables/types.d.ts +25 -0
- package/dist/tables/types.d.ts.map +1 -0
- package/dist/tables/types.js +8 -0
- package/dist/tables/utils.d.ts +4 -0
- package/dist/tables/utils.d.ts.map +1 -0
- package/dist/tables/utils.js +16 -0
- package/dist/tables/widgets/grid-table-widget.d.ts +3 -0
- package/dist/tables/widgets/grid-table-widget.d.ts.map +1 -0
- package/dist/tables/widgets/grid-table-widget.js +26 -0
- package/dist/tables/widgets/pipe-table-widget.d.ts +3 -0
- package/dist/tables/widgets/pipe-table-widget.d.ts.map +1 -0
- package/dist/tables/widgets/pipe-table-widget.js +25 -0
- package/dist/tables/widgets/source-button.d.ts +2 -0
- package/dist/tables/widgets/source-button.d.ts.map +1 -0
- package/dist/tables/widgets/source-button.js +20 -0
- package/dist/tables/widgets/source-button.test.d.ts +2 -0
- package/dist/tables/widgets/source-button.test.d.ts.map +1 -0
- package/dist/tables/widgets/source-button.test.js +11 -0
- package/dist/test-setup.d.ts +2 -0
- package/dist/test-setup.d.ts.map +1 -0
- package/dist/test-setup.js +31 -0
- package/dist/themes/_contract.css +88 -0
- package/dist/themes/_mira-palette.css +187 -0
- package/dist/themes/_obsidian-palette.css +183 -0
- package/dist/themes/mira.css +2 -0
- package/dist/themes/obsidian.css +2 -0
- package/dist/themes/theme-contract.test.d.ts +2 -0
- package/dist/themes/theme-contract.test.d.ts.map +1 -0
- package/dist/themes/theme-contract.test.js +88 -0
- package/dist/themes.css +3 -0
- package/dist/types.d.ts +55 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +1 -0
- package/dist/ui/appearance/index.d.ts +6 -0
- package/dist/ui/appearance/index.d.ts.map +1 -0
- package/dist/ui/appearance/index.js +9 -0
- package/dist/ui/button/button.shared.d.ts +59 -0
- package/dist/ui/button/button.shared.d.ts.map +1 -0
- package/dist/ui/button/button.shared.js +25 -0
- package/dist/ui/button/button.svelte +42 -0
- package/dist/ui/button/button.svelte.d.ts +5 -0
- package/dist/ui/button/button.svelte.d.ts.map +1 -0
- package/dist/ui/button/index.d.ts +4 -0
- package/dist/ui/button/index.d.ts.map +1 -0
- package/dist/ui/button/index.js +5 -0
- package/dist/ui/context-menu/context-menu-checkbox-item.svelte +40 -0
- package/dist/ui/context-menu/context-menu-checkbox-item.svelte.d.ts +10 -0
- package/dist/ui/context-menu/context-menu-checkbox-item.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-content.svelte +61 -0
- package/dist/ui/context-menu/context-menu-content.svelte.d.ts +8 -0
- package/dist/ui/context-menu/context-menu-content.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-group-heading.svelte +24 -0
- package/dist/ui/context-menu/context-menu-group-heading.svelte.d.ts +8 -0
- package/dist/ui/context-menu/context-menu-group-heading.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-group.svelte +12 -0
- package/dist/ui/context-menu/context-menu-group.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-group.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-item.svelte +27 -0
- package/dist/ui/context-menu/context-menu-item.svelte.d.ts +9 -0
- package/dist/ui/context-menu/context-menu-item.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-label.svelte +27 -0
- package/dist/ui/context-menu/context-menu-label.svelte.d.ts +9 -0
- package/dist/ui/context-menu/context-menu-label.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-radio-group.svelte +16 -0
- package/dist/ui/context-menu/context-menu-radio-group.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-radio-group.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-radio-item.svelte +33 -0
- package/dist/ui/context-menu/context-menu-radio-item.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-radio-item.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-root.svelte +17 -0
- package/dist/ui/context-menu/context-menu-root.svelte.d.ts +4 -0
- package/dist/ui/context-menu/context-menu-root.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-separator.svelte +17 -0
- package/dist/ui/context-menu/context-menu-separator.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-separator.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-shortcut.svelte +20 -0
- package/dist/ui/context-menu/context-menu-shortcut.svelte.d.ts +6 -0
- package/dist/ui/context-menu/context-menu-shortcut.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-sub-content.svelte +20 -0
- package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-sub-content.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte +29 -0
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts +9 -0
- package/dist/ui/context-menu/context-menu-sub-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/context-menu-trigger.svelte +29 -0
- package/dist/ui/context-menu/context-menu-trigger.svelte.d.ts +5 -0
- package/dist/ui/context-menu/context-menu-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/context-menu/index.d.ts +17 -0
- package/dist/ui/context-menu/index.d.ts.map +1 -0
- package/dist/ui/context-menu/index.js +19 -0
- package/dist/ui/dialog/dialog-close.svelte +8 -0
- package/dist/ui/dialog/dialog-close.svelte.d.ts +5 -0
- package/dist/ui/dialog/dialog-close.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-content.svelte +66 -0
- package/dist/ui/dialog/dialog-content.svelte.d.ts +12 -0
- package/dist/ui/dialog/dialog-content.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-description.svelte +17 -0
- package/dist/ui/dialog/dialog-description.svelte.d.ts +5 -0
- package/dist/ui/dialog/dialog-description.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-footer.svelte +23 -0
- package/dist/ui/dialog/dialog-footer.svelte.d.ts +6 -0
- package/dist/ui/dialog/dialog-footer.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-header.svelte +20 -0
- package/dist/ui/dialog/dialog-header.svelte.d.ts +6 -0
- package/dist/ui/dialog/dialog-header.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-overlay.svelte +21 -0
- package/dist/ui/dialog/dialog-overlay.svelte.d.ts +5 -0
- package/dist/ui/dialog/dialog-overlay.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-title.svelte +17 -0
- package/dist/ui/dialog/dialog-title.svelte.d.ts +5 -0
- package/dist/ui/dialog/dialog-title.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/dialog-trigger.svelte +8 -0
- package/dist/ui/dialog/dialog-trigger.svelte.d.ts +5 -0
- package/dist/ui/dialog/dialog-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/dialog/index.d.ts +12 -0
- package/dist/ui/dialog/index.d.ts.map +1 -0
- package/dist/ui/dialog/index.js +14 -0
- package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte +43 -0
- package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts +10 -0
- package/dist/ui/dropdown-menu/dropdown-menu-checkbox-item.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte +63 -0
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts +8 -0
- package/dist/ui/dropdown-menu/dropdown-menu-content.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte +22 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts +9 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group-heading.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group.svelte +14 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-group.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-item.svelte +27 -0
- package/dist/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts +9 -0
- package/dist/ui/dropdown-menu/dropdown-menu-item.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-label.svelte +24 -0
- package/dist/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts +9 -0
- package/dist/ui/dropdown-menu/dropdown-menu-label.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte +16 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-group.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte +33 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-radio-item.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-root.svelte +27 -0
- package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts +4 -0
- package/dist/ui/dropdown-menu/dropdown-menu-root.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte +17 -0
- package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-separator.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte +20 -0
- package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts +6 -0
- package/dist/ui/dropdown-menu/dropdown-menu-shortcut.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte +20 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-content.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte +29 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts +8 -0
- package/dist/ui/dropdown-menu/dropdown-menu-sub-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte +29 -0
- package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts +5 -0
- package/dist/ui/dropdown-menu/dropdown-menu-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/index.d.ts +17 -0
- package/dist/ui/dropdown-menu/index.d.ts.map +1 -0
- package/dist/ui/dropdown-menu/index.js +17 -0
- package/dist/ui/index.d.ts +13 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +12 -0
- package/dist/ui/index.test.d.ts +2 -0
- package/dist/ui/index.test.d.ts.map +1 -0
- package/dist/ui/index.test.js +7 -0
- package/dist/ui/internal/overlay-portal-context.d.ts +19 -0
- package/dist/ui/internal/overlay-portal-context.d.ts.map +1 -0
- package/dist/ui/internal/overlay-portal-context.js +39 -0
- package/dist/ui/popover/index.d.ts +7 -0
- package/dist/ui/popover/index.d.ts.map +1 -0
- package/dist/ui/popover/index.js +6 -0
- package/dist/ui/popover/popover-content.svelte +65 -0
- package/dist/ui/popover/popover-content.svelte.d.ts +8 -0
- package/dist/ui/popover/popover-content.svelte.d.ts.map +1 -0
- package/dist/ui/popover/popover-root.svelte +15 -0
- package/dist/ui/popover/popover-root.svelte.d.ts +4 -0
- package/dist/ui/popover/popover-root.svelte.d.ts.map +1 -0
- package/dist/ui/popover/popover-trigger.svelte +23 -0
- package/dist/ui/popover/popover-trigger.svelte.d.ts +5 -0
- package/dist/ui/popover/popover-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/scroll-area/index.d.ts +2 -0
- package/dist/ui/scroll-area/index.d.ts.map +1 -0
- package/dist/ui/scroll-area/index.js +1 -0
- package/dist/ui/scroll-area/scroll-area.svelte +14 -0
- package/dist/ui/scroll-area/scroll-area.svelte.d.ts +9 -0
- package/dist/ui/scroll-area/scroll-area.svelte.d.ts.map +1 -0
- package/dist/ui/separator/index.d.ts +2 -0
- package/dist/ui/separator/index.d.ts.map +1 -0
- package/dist/ui/separator/index.js +1 -0
- package/dist/ui/separator/separator.svelte +14 -0
- package/dist/ui/separator/separator.svelte.d.ts +8 -0
- package/dist/ui/separator/separator.svelte.d.ts.map +1 -0
- package/dist/ui/styles.css +760 -0
- package/dist/ui/styles.test.d.ts +2 -0
- package/dist/ui/styles.test.d.ts.map +1 -0
- package/dist/ui/styles.test.js +26 -0
- package/dist/ui/table/index.d.ts +10 -0
- package/dist/ui/table/index.d.ts.map +1 -0
- package/dist/ui/table/index.js +11 -0
- package/dist/ui/table/table-body.svelte +20 -0
- package/dist/ui/table/table-body.svelte.d.ts +6 -0
- package/dist/ui/table/table-body.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-caption.svelte +20 -0
- package/dist/ui/table/table-caption.svelte.d.ts +6 -0
- package/dist/ui/table/table-caption.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-cell.svelte +23 -0
- package/dist/ui/table/table-cell.svelte.d.ts +6 -0
- package/dist/ui/table/table-cell.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-footer.svelte +23 -0
- package/dist/ui/table/table-footer.svelte.d.ts +6 -0
- package/dist/ui/table/table-footer.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-head.svelte +23 -0
- package/dist/ui/table/table-head.svelte.d.ts +6 -0
- package/dist/ui/table/table-head.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-header.svelte +20 -0
- package/dist/ui/table/table-header.svelte.d.ts +6 -0
- package/dist/ui/table/table-header.svelte.d.ts.map +1 -0
- package/dist/ui/table/table-row.svelte +23 -0
- package/dist/ui/table/table-row.svelte.d.ts +6 -0
- package/dist/ui/table/table-row.svelte.d.ts.map +1 -0
- package/dist/ui/table/table.svelte +21 -0
- package/dist/ui/table/table.svelte.d.ts +9 -0
- package/dist/ui/table/table.svelte.d.ts.map +1 -0
- package/dist/ui/table-dnd/index.d.ts +4 -0
- package/dist/ui/table-dnd/index.d.ts.map +1 -0
- package/dist/ui/table-dnd/index.js +3 -0
- package/dist/ui/table-dnd/table-dnd-sensors.d.ts +3 -0
- package/dist/ui/table-dnd/table-dnd-sensors.d.ts.map +1 -0
- package/dist/ui/table-dnd/table-dnd-sensors.js +11 -0
- package/dist/ui/table-dnd/table-dnd-utils.d.ts +30 -0
- package/dist/ui/table-dnd/table-dnd-utils.d.ts.map +1 -0
- package/dist/ui/table-dnd/table-dnd-utils.js +77 -0
- package/dist/ui/table-dnd/table-dnd-utils.test.d.ts +2 -0
- package/dist/ui/table-dnd/table-dnd-utils.test.d.ts.map +1 -0
- package/dist/ui/table-dnd/table-dnd-utils.test.js +46 -0
- package/dist/ui/table-dnd/table-drag-grip.svelte +60 -0
- package/dist/ui/table-dnd/table-drag-grip.svelte.d.ts +17 -0
- package/dist/ui/table-dnd/table-drag-grip.svelte.d.ts.map +1 -0
- package/dist/ui/toggle-group/context.d.ts +7 -0
- package/dist/ui/toggle-group/context.d.ts.map +1 -0
- package/dist/ui/toggle-group/context.js +8 -0
- package/dist/ui/toggle-group/index.d.ts +3 -0
- package/dist/ui/toggle-group/index.d.ts.map +1 -0
- package/dist/ui/toggle-group/index.js +2 -0
- package/dist/ui/toggle-group/toggle-group-item.svelte +33 -0
- package/dist/ui/toggle-group/toggle-group-item.svelte.d.ts +11 -0
- package/dist/ui/toggle-group/toggle-group-item.svelte.d.ts.map +1 -0
- package/dist/ui/toggle-group/toggle-group.svelte +74 -0
- package/dist/ui/toggle-group/toggle-group.svelte.d.ts +12 -0
- package/dist/ui/toggle-group/toggle-group.svelte.d.ts.map +1 -0
- package/dist/ui/toolbar/index.d.ts +7 -0
- package/dist/ui/toolbar/index.d.ts.map +1 -0
- package/dist/ui/toolbar/index.js +6 -0
- package/dist/ui/toolbar/toolbar-button.svelte +17 -0
- package/dist/ui/toolbar/toolbar-button.svelte.d.ts +5 -0
- package/dist/ui/toolbar/toolbar-button.svelte.d.ts.map +1 -0
- package/dist/ui/toolbar/toolbar-group-item.svelte +17 -0
- package/dist/ui/toolbar/toolbar-group-item.svelte.d.ts +4 -0
- package/dist/ui/toolbar/toolbar-group-item.svelte.d.ts.map +1 -0
- package/dist/ui/toolbar/toolbar-group.svelte +19 -0
- package/dist/ui/toolbar/toolbar-group.svelte.d.ts +5 -0
- package/dist/ui/toolbar/toolbar-group.svelte.d.ts.map +1 -0
- package/dist/ui/toolbar/toolbar-link.svelte +17 -0
- package/dist/ui/toolbar/toolbar-link.svelte.d.ts +5 -0
- package/dist/ui/toolbar/toolbar-link.svelte.d.ts.map +1 -0
- package/dist/ui/toolbar/toolbar.svelte +21 -0
- package/dist/ui/toolbar/toolbar.svelte.d.ts +5 -0
- package/dist/ui/toolbar/toolbar.svelte.d.ts.map +1 -0
- package/dist/ui/tooltip/index.d.ts +8 -0
- package/dist/ui/tooltip/index.d.ts.map +1 -0
- package/dist/ui/tooltip/index.js +9 -0
- package/dist/ui/tooltip/tooltip-content.svelte +85 -0
- package/dist/ui/tooltip/tooltip-content.svelte.d.ts +9 -0
- package/dist/ui/tooltip/tooltip-content.svelte.d.ts.map +1 -0
- package/dist/ui/tooltip/tooltip-root.svelte +15 -0
- package/dist/ui/tooltip/tooltip-root.svelte.d.ts +5 -0
- package/dist/ui/tooltip/tooltip-root.svelte.d.ts.map +1 -0
- package/dist/ui/tooltip/tooltip-trigger.svelte +23 -0
- package/dist/ui/tooltip/tooltip-trigger.svelte.d.ts +5 -0
- package/dist/ui/tooltip/tooltip-trigger.svelte.d.ts.map +1 -0
- package/dist/ui/utils.d.ts +13 -0
- package/dist/ui/utils.d.ts.map +1 -0
- package/dist/ui/utils.js +5 -0
- package/package.json +171 -0
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { tags as highlightTags } from "@lezer/highlight";
|
|
2
|
+
import { BlockContext, } from "@lezer/markdown";
|
|
3
|
+
function createAttributeElements(context, text, start) {
|
|
4
|
+
if (!text) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const elements = [];
|
|
8
|
+
const attribute = /([A-Za-z_][\w-]*)(?:=(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g;
|
|
9
|
+
let match;
|
|
10
|
+
while ((match = attribute.exec(text)) !== null) {
|
|
11
|
+
const key = match[1] ?? "";
|
|
12
|
+
const value = match[2] ?? match[3] ?? match[4];
|
|
13
|
+
const nameStart = start + match.index;
|
|
14
|
+
elements.push(context.elt("DirectiveAttrName", nameStart, nameStart + key.length));
|
|
15
|
+
if (value !== undefined) {
|
|
16
|
+
const rawValue = match[0].slice(key.length + 1);
|
|
17
|
+
const valueStart = nameStart + key.length + 1;
|
|
18
|
+
elements.push(context.elt("DirectiveAttrValue", valueStart, valueStart + rawValue.length));
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return elements;
|
|
22
|
+
}
|
|
23
|
+
function parseDirectiveMetadata(context, source, start, markerLength, name, argsText, attrsText) {
|
|
24
|
+
const children = [
|
|
25
|
+
context.elt("DirectiveMark", start, start + markerLength),
|
|
26
|
+
];
|
|
27
|
+
const nameOffset = source.indexOf(name, markerLength);
|
|
28
|
+
const nameStart = start + Math.max(markerLength, nameOffset);
|
|
29
|
+
children.push(context.elt("DirectiveName", nameStart, nameStart + name.length));
|
|
30
|
+
if (argsText !== undefined) {
|
|
31
|
+
const bracketStart = source.indexOf("[", nameOffset + name.length);
|
|
32
|
+
const bracketEnd = source.indexOf("]", bracketStart + 1);
|
|
33
|
+
if (bracketStart !== -1 && bracketEnd !== -1) {
|
|
34
|
+
const rawArgs = source.slice(bracketStart + 1, bracketEnd);
|
|
35
|
+
const leadingWhitespace = rawArgs.length - rawArgs.trimStart().length;
|
|
36
|
+
const contentStart = start + bracketStart + 1 + leadingWhitespace;
|
|
37
|
+
const contentEnd = contentStart + argsText.trim().length;
|
|
38
|
+
const argsChildren = [
|
|
39
|
+
context.elt("DirectiveDelimiter", start + bracketStart, start + bracketStart + 1),
|
|
40
|
+
context.elt("DirectiveDelimiter", start + bracketEnd, start + bracketEnd + 1),
|
|
41
|
+
];
|
|
42
|
+
if (argsText.trim() && "parser" in context) {
|
|
43
|
+
argsChildren.push(...context.parser.parseInline(argsText.trim(), contentStart));
|
|
44
|
+
}
|
|
45
|
+
children.push(context.elt("DirectiveArgs", contentStart, contentEnd, argsChildren));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (attrsText !== undefined) {
|
|
49
|
+
const braceStart = source.indexOf("{", nameOffset + name.length);
|
|
50
|
+
if (braceStart !== -1) {
|
|
51
|
+
const rawAttrs = source.slice(braceStart + 1, source.indexOf("}", braceStart));
|
|
52
|
+
const leadingWhitespace = rawAttrs.length - rawAttrs.trimStart().length;
|
|
53
|
+
children.push(...createAttributeElements(context, attrsText.trim(), start + braceStart + 1 + leadingWhitespace));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
return children;
|
|
57
|
+
}
|
|
58
|
+
class LeafDirectiveParser {
|
|
59
|
+
nextLine() {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
finish(context, leaf) {
|
|
63
|
+
const match = /^\s*::([A-Za-z0-9_-]+)(?:\[\s*([^\]]*)\s*\])?(?:\{\s*([^}]*)\s*\})?/.exec(leaf.content);
|
|
64
|
+
if (!match) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
const [source, name = "", argsText, attrsText] = match;
|
|
68
|
+
const leadingWhitespace = source.length - source.trimStart().length;
|
|
69
|
+
const start = leaf.start + leadingWhitespace;
|
|
70
|
+
const trimmedSource = source.trimStart();
|
|
71
|
+
context.addLeafElement(leaf, context.elt("LeafDirective", leaf.start, leaf.start + leaf.content.length, parseDirectiveMetadata(context, trimmedSource, start, 2, name, argsText, attrsText)));
|
|
72
|
+
return true;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
function parseInlineDirective(context, next, position) {
|
|
76
|
+
if (next !== 58 /* : */) {
|
|
77
|
+
return -1;
|
|
78
|
+
}
|
|
79
|
+
const match = /^:([A-Za-z0-9_-]+)(?:\[\s*([^\]]*)\s*\])?(?:\{\s*([^}]*)\s*\})?/.exec(context.slice(position, context.end));
|
|
80
|
+
if (!match) {
|
|
81
|
+
return -1;
|
|
82
|
+
}
|
|
83
|
+
const [source, name = "", argsText, attrsText] = match;
|
|
84
|
+
return context.addElement(context.elt("InlineDirective", position, position + source.length, parseDirectiveMetadata(context, source, position, 1, name, argsText, attrsText)));
|
|
85
|
+
}
|
|
86
|
+
function parseContainerDirective(context, line) {
|
|
87
|
+
const match = /^(:{3,})\s*([A-Za-z0-9_-]+)(?:\[\s*([^\]]*)\s*\])?(?:\{\s*([^}]*)\s*\})?/.exec(line.text);
|
|
88
|
+
if (!match) {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
const [source, marker = ":::", name = "", argsText, attrsText] = match;
|
|
92
|
+
const start = context.lineStart + line.pos;
|
|
93
|
+
context.startComposite("ContainerDirective", line.pos, marker.length);
|
|
94
|
+
context.addElement(context.elt("ContainerDirective", start, start + line.text.length, parseDirectiveMetadata(context, source, start, marker.length, name, argsText, attrsText)));
|
|
95
|
+
context.nextLine();
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
export const GenericDirectives = {
|
|
99
|
+
defineNodes: [
|
|
100
|
+
{ name: "InlineDirective" },
|
|
101
|
+
{ name: "LeafDirective", block: true },
|
|
102
|
+
{
|
|
103
|
+
name: "ContainerDirective",
|
|
104
|
+
block: true,
|
|
105
|
+
composite(context, line, markerLength) {
|
|
106
|
+
const match = /^(:{3,})\s*$/.exec(line.text);
|
|
107
|
+
if (!match || (match[1]?.length ?? 0) < markerLength) {
|
|
108
|
+
return true;
|
|
109
|
+
}
|
|
110
|
+
const markerStart = context.lineStart + line.pos + match[0].indexOf(":");
|
|
111
|
+
const stack = context.stack;
|
|
112
|
+
const block = stack[line.depth];
|
|
113
|
+
if (block) {
|
|
114
|
+
block.end = context.lineStart + line.text.length;
|
|
115
|
+
}
|
|
116
|
+
context.addElement(context.elt("DirectiveMark", markerStart, markerStart + (match[1]?.length ?? markerLength)));
|
|
117
|
+
return false;
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{ name: "DirectiveMark", style: highlightTags.processingInstruction },
|
|
121
|
+
{ name: "DirectiveName", style: highlightTags.variableName },
|
|
122
|
+
{ name: "DirectiveArgs", style: highlightTags.content },
|
|
123
|
+
{ name: "DirectiveAttrName", style: highlightTags.attributeName },
|
|
124
|
+
{
|
|
125
|
+
name: "DirectiveAttrDelimiter",
|
|
126
|
+
style: highlightTags.processingInstruction,
|
|
127
|
+
},
|
|
128
|
+
{ name: "DirectiveDelimiter", style: highlightTags.processingInstruction },
|
|
129
|
+
{ name: "DirectiveAttrValue", style: highlightTags.attributeValue },
|
|
130
|
+
],
|
|
131
|
+
parseBlock: [
|
|
132
|
+
{
|
|
133
|
+
name: "ContainerDirective",
|
|
134
|
+
parse: parseContainerDirective,
|
|
135
|
+
before: "SetextHeading",
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
name: "LeafDirective",
|
|
139
|
+
leaf(_, leaf) {
|
|
140
|
+
return /^\s*::\s*([A-Za-z0-9_-]+)?\s*(?:\[\s*([^\]]*)\s*\])?\s*(?:\{\s*([^}]*)\s*\})?/.test(leaf.content)
|
|
141
|
+
? new LeafDirectiveParser()
|
|
142
|
+
: null;
|
|
143
|
+
},
|
|
144
|
+
before: "SetextHeading",
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
parseInline: [
|
|
148
|
+
{
|
|
149
|
+
name: "InlineDirective",
|
|
150
|
+
parse: parseInlineDirective,
|
|
151
|
+
before: "Link",
|
|
152
|
+
},
|
|
153
|
+
],
|
|
154
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-table.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/grid-table.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAMV,cAAc,EACf,MAAM,iBAAiB,CAAC;AA0JzB,eAAO,MAAM,SAAS,EAAE,cAkCvB,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { tags } from "@lezer/highlight";
|
|
2
|
+
function parseRow(context, line, startIndex = 0, elements, offset = 0) {
|
|
3
|
+
let count = 0;
|
|
4
|
+
let first = true;
|
|
5
|
+
let cellStart = -1;
|
|
6
|
+
let cellEnd = -1;
|
|
7
|
+
let escaped = false;
|
|
8
|
+
const parseCell = () => {
|
|
9
|
+
elements?.push(context.elt("GridTableCell", offset + cellStart, offset + cellEnd, context.parser.parseInline(line.slice(cellStart, cellEnd), offset + cellStart)));
|
|
10
|
+
};
|
|
11
|
+
for (let index = startIndex; index < line.length; index += 1) {
|
|
12
|
+
const next = line.charCodeAt(index);
|
|
13
|
+
if (next === 43) {
|
|
14
|
+
const rest = line.substring(index);
|
|
15
|
+
if (isHorizontalSeparator(rest)) {
|
|
16
|
+
elements?.push(context.elt("GridTableDivider", index + offset, index + offset + rest.length));
|
|
17
|
+
return count;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else if (next === 124 && !escaped) {
|
|
21
|
+
if (!first || cellStart > -1) {
|
|
22
|
+
count += 1;
|
|
23
|
+
}
|
|
24
|
+
first = false;
|
|
25
|
+
if (cellStart > -1) {
|
|
26
|
+
parseCell();
|
|
27
|
+
}
|
|
28
|
+
elements?.push(context.elt("GridTableDelimiter", index + offset, index + offset + 1));
|
|
29
|
+
cellStart = -1;
|
|
30
|
+
cellEnd = -1;
|
|
31
|
+
}
|
|
32
|
+
else if (escaped || (next !== 32 && next !== 9)) {
|
|
33
|
+
if (cellStart < 0) {
|
|
34
|
+
cellStart = index;
|
|
35
|
+
}
|
|
36
|
+
cellEnd = index + 1;
|
|
37
|
+
}
|
|
38
|
+
escaped = !escaped && next === 92;
|
|
39
|
+
}
|
|
40
|
+
if (cellStart > -1) {
|
|
41
|
+
count += 1;
|
|
42
|
+
parseCell();
|
|
43
|
+
}
|
|
44
|
+
return count;
|
|
45
|
+
}
|
|
46
|
+
class GridTableParser {
|
|
47
|
+
lines = [];
|
|
48
|
+
rows = [];
|
|
49
|
+
isComplete = false;
|
|
50
|
+
constructor(line) {
|
|
51
|
+
this.lines.push(line);
|
|
52
|
+
}
|
|
53
|
+
nextLine(context, line) {
|
|
54
|
+
const lineText = line.text.slice(line.pos);
|
|
55
|
+
this.lines.push(lineText);
|
|
56
|
+
const content = [];
|
|
57
|
+
if (isHorizontalSeparator(lineText)) {
|
|
58
|
+
content.push(context.elt("GridTableDelimiter", context.lineStart + line.pos, context.lineStart + line.text.length));
|
|
59
|
+
}
|
|
60
|
+
parseRow(context, lineText.trim(), line.pos, content, context.lineStart);
|
|
61
|
+
if (this.lines.length > 1) {
|
|
62
|
+
const trimmed = lineText.trim();
|
|
63
|
+
if (trimmed === "" ||
|
|
64
|
+
(!this.isGridTableLine(trimmed) && this.lines.length > 2)) {
|
|
65
|
+
this.isComplete = true;
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
this.rows.push(...content);
|
|
70
|
+
return false;
|
|
71
|
+
}
|
|
72
|
+
finish(context, leaf) {
|
|
73
|
+
context.addLeafElement(leaf, context.elt("GridTable", leaf.start, leaf.start + leaf.content.length, [
|
|
74
|
+
context.elt("GridTableDelimiter", leaf.start, leaf.start + this.lines[0].length),
|
|
75
|
+
...this.rows,
|
|
76
|
+
]));
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
isGridTableLine(line) {
|
|
80
|
+
const trimmed = line.trim();
|
|
81
|
+
if (!trimmed) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
if (isHorizontalSeparator(trimmed)) {
|
|
85
|
+
return true;
|
|
86
|
+
}
|
|
87
|
+
return (trimmed.includes("|") && (trimmed.startsWith("|") || /^\s*\|/.test(line)));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
const gridTableSeparatorPattern = /^(\+[:>]?[=-]+[vx^]?[=-]*[:<]?)+\+$/;
|
|
91
|
+
function hasGridTableMarker(value) {
|
|
92
|
+
return gridTableSeparatorPattern.test(value.trim());
|
|
93
|
+
}
|
|
94
|
+
function isHorizontalSeparator(line) {
|
|
95
|
+
return gridTableSeparatorPattern.test(line.trim());
|
|
96
|
+
}
|
|
97
|
+
export const GridTable = {
|
|
98
|
+
defineNodes: [
|
|
99
|
+
{ name: "GridTable", block: true },
|
|
100
|
+
{ name: "GridTableHeader", style: { "GridTableHeader/...": tags.heading } },
|
|
101
|
+
"GridTableRow",
|
|
102
|
+
{ name: "GridTableCell", style: tags.content },
|
|
103
|
+
{ name: "GridTableDivider", style: tags.processingInstruction },
|
|
104
|
+
{ name: "GridTableDelimiter", style: tags.processingInstruction },
|
|
105
|
+
],
|
|
106
|
+
parseBlock: [
|
|
107
|
+
{
|
|
108
|
+
name: "GridTable",
|
|
109
|
+
leaf(_, leaf) {
|
|
110
|
+
if (hasGridTableMarker(leaf.content)) {
|
|
111
|
+
return new GridTableParser(leaf.content);
|
|
112
|
+
}
|
|
113
|
+
return null;
|
|
114
|
+
},
|
|
115
|
+
endLeaf(_, line, leaf) {
|
|
116
|
+
const parser = leaf.parsers.find((candidate) => candidate instanceof GridTableParser);
|
|
117
|
+
if (!parser) {
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
if (parser.isComplete) {
|
|
121
|
+
return true;
|
|
122
|
+
}
|
|
123
|
+
const lineText = line.text.slice(line.pos).trim();
|
|
124
|
+
return lineText === "" || !parser.isGridTableLine(lineText);
|
|
125
|
+
},
|
|
126
|
+
before: "Table",
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { LanguageDescription } from "@codemirror/language";
|
|
2
|
+
import type { Extension } from "@codemirror/state";
|
|
3
|
+
export { createMarkdownAuthoringExtensions, type MiraMarkdownAuthoringOptions, } from "./authoring";
|
|
4
|
+
export { createMarkdownCompletionExtensions, createMarkdownCompletionSources, formatMiraInternalLink, type MiraMarkdownCompletionOptions, } from "./completion";
|
|
5
|
+
export { createMarkdownInputHandlerExtensions } from "./input-handlers";
|
|
6
|
+
export { convertHtmlToMarkdown, createMarkdownSmartPasteExtension, } from "./paste";
|
|
7
|
+
export { GenericDirectives } from "./directives";
|
|
8
|
+
export { EmbedLinkParser, PathLinkParser, TagParser, WikiLinkParser, } from "./lapis-inline";
|
|
9
|
+
export type MiraMarkdownCodeMirrorOptions = {
|
|
10
|
+
codeLanguages?: LanguageDescription[];
|
|
11
|
+
sourceMode?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare function createMiraMarkdownLanguage(codeLanguages?: LanguageDescription[]): Extension;
|
|
14
|
+
export declare function createMarkdownCodeMirrorExtensions(options?: MiraMarkdownCodeMirrorOptions): Extension[];
|
|
15
|
+
export declare function markdownSourceDecorations(): Extension;
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEhE,OAAO,KAAK,EAAE,SAAS,EAAS,MAAM,mBAAmB,CAAC;AAsB1D,OAAO,EACL,iCAAiC,EACjC,KAAK,4BAA4B,GAClC,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,kCAAkC,EAClC,+BAA+B,EAC/B,sBAAsB,EACtB,KAAK,6BAA6B,GACnC,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oCAAoC,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACL,qBAAqB,EACrB,iCAAiC,GAClC,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EACL,eAAe,EACf,cAAc,EACd,SAAS,EACT,cAAc,GACf,MAAM,gBAAgB,CAAC;AAExB,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACtC,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,wBAAgB,0BAA0B,CACxC,aAAa,GAAE,mBAAmB,EAAO,GACxC,SAAS,CAiBX;AAcD,wBAAgB,kCAAkC,CAChD,OAAO,GAAE,6BAAkC,GAC1C,SAAS,EAAE,CAUb;AAED,wBAAgB,yBAAyB,IAAI,SAAS,CAIrD"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { markdown } from "@codemirror/lang-markdown";
|
|
2
|
+
import { yamlFrontmatter } from "@codemirror/lang-yaml";
|
|
3
|
+
import { languages } from "@codemirror/language-data";
|
|
4
|
+
import { Decoration, EditorView, ViewPlugin, } from "@codemirror/view";
|
|
5
|
+
import { Table } from "@lezer/markdown";
|
|
6
|
+
import { getTaskMarkerRange } from "../rich/utils/tasks";
|
|
7
|
+
import { GenericDirectives } from "./directives";
|
|
8
|
+
import { GridTable } from "./grid-table";
|
|
9
|
+
import { ListAfterLazyBlockquote } from "./list-after-lazy-quote";
|
|
10
|
+
import { parseLatex } from "./latex";
|
|
11
|
+
import { EmbedLinkParser, PathLinkParser, TagParser, WikiLinkParser, } from "./lapis-inline";
|
|
12
|
+
export { createMarkdownAuthoringExtensions, } from "./authoring";
|
|
13
|
+
export { createMarkdownCompletionExtensions, createMarkdownCompletionSources, formatMiraInternalLink, } from "./completion";
|
|
14
|
+
export { createMarkdownInputHandlerExtensions } from "./input-handlers";
|
|
15
|
+
export { convertHtmlToMarkdown, createMarkdownSmartPasteExtension, } from "./paste";
|
|
16
|
+
export { GenericDirectives } from "./directives";
|
|
17
|
+
export { EmbedLinkParser, PathLinkParser, TagParser, WikiLinkParser, } from "./lapis-inline";
|
|
18
|
+
export function createMiraMarkdownLanguage(codeLanguages = []) {
|
|
19
|
+
return yamlFrontmatter({
|
|
20
|
+
content: markdown({
|
|
21
|
+
codeLanguages: [...languages, ...codeLanguages],
|
|
22
|
+
extensions: [
|
|
23
|
+
ListAfterLazyBlockquote,
|
|
24
|
+
Table,
|
|
25
|
+
GridTable,
|
|
26
|
+
GenericDirectives,
|
|
27
|
+
EmbedLinkParser,
|
|
28
|
+
WikiLinkParser,
|
|
29
|
+
PathLinkParser,
|
|
30
|
+
TagParser,
|
|
31
|
+
parseLatex(),
|
|
32
|
+
],
|
|
33
|
+
}),
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
const wikiLinkMark = Decoration.mark({
|
|
37
|
+
class: "cm-internal-link cm-wikilink",
|
|
38
|
+
});
|
|
39
|
+
const embedMark = Decoration.mark({
|
|
40
|
+
class: "cm-internal-link cm-embed-link",
|
|
41
|
+
});
|
|
42
|
+
const tagMark = Decoration.mark({ class: "cm-hashtag" });
|
|
43
|
+
const taskFormattingMark = Decoration.mark({
|
|
44
|
+
class: "cm-formatting cm-formatting-task",
|
|
45
|
+
});
|
|
46
|
+
const frontmatterMark = Decoration.line({ class: "cm-hmd-frontmatter" });
|
|
47
|
+
export function createMarkdownCodeMirrorExtensions(options = {}) {
|
|
48
|
+
return [
|
|
49
|
+
createMiraMarkdownLanguage(options.codeLanguages),
|
|
50
|
+
markdownSourceDecorations(),
|
|
51
|
+
EditorView.editorAttributes.of({
|
|
52
|
+
class: options.sourceMode
|
|
53
|
+
? "mira-markdown-source markdown-source-view"
|
|
54
|
+
: "mira-markdown-source",
|
|
55
|
+
}),
|
|
56
|
+
];
|
|
57
|
+
}
|
|
58
|
+
export function markdownSourceDecorations() {
|
|
59
|
+
return ViewPlugin.fromClass(MarkdownSourceDecorations, {
|
|
60
|
+
decorations: (value) => value.decorations,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
class MarkdownSourceDecorations {
|
|
64
|
+
view;
|
|
65
|
+
decorations;
|
|
66
|
+
constructor(view) {
|
|
67
|
+
this.view = view;
|
|
68
|
+
this.decorations = buildDecorations(view);
|
|
69
|
+
}
|
|
70
|
+
update(update) {
|
|
71
|
+
if (update.docChanged || update.viewportChanged) {
|
|
72
|
+
this.decorations = buildDecorations(update.view);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function buildDecorations(view) {
|
|
77
|
+
const ranges = [];
|
|
78
|
+
const frontmatter = getFrontmatterRange(view.state.doc.toString());
|
|
79
|
+
for (const visibleRange of view.visibleRanges) {
|
|
80
|
+
let line = view.state.doc.lineAt(visibleRange.from);
|
|
81
|
+
while (line.from <= visibleRange.to) {
|
|
82
|
+
if (frontmatter &&
|
|
83
|
+
line.from >= frontmatter.from &&
|
|
84
|
+
line.to <= frontmatter.to) {
|
|
85
|
+
ranges.push(frontmatterMark.range(line.from));
|
|
86
|
+
}
|
|
87
|
+
decorateInlineMarkdown(line.text, line.from, ranges);
|
|
88
|
+
if (line.to >= visibleRange.to || line.number >= view.state.doc.lines) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
line = view.state.doc.line(line.number + 1);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return Decoration.set(ranges, true);
|
|
95
|
+
}
|
|
96
|
+
function decorateInlineMarkdown(text, lineStart, ranges) {
|
|
97
|
+
const taskRange = getTaskMarkerRange(text, lineStart);
|
|
98
|
+
if (taskRange) {
|
|
99
|
+
ranges.push(taskFormattingMark.range(taskRange.checkboxStart, taskRange.checkboxEnd));
|
|
100
|
+
}
|
|
101
|
+
for (const match of text.matchAll(/!\[\[[^\]\n]+]]/g)) {
|
|
102
|
+
ranges.push(embedMark.range(lineStart + match.index, lineStart + match.index + match[0].length));
|
|
103
|
+
}
|
|
104
|
+
for (const match of text.matchAll(/(?<!!)\[\[[^\]\n]+]]/g)) {
|
|
105
|
+
ranges.push(wikiLinkMark.range(lineStart + match.index, lineStart + match.index + match[0].length));
|
|
106
|
+
}
|
|
107
|
+
for (const match of text.matchAll(/(^|[\s([{])#[\p{L}\p{N}_/-]+/gu)) {
|
|
108
|
+
const prefixLength = match[1]?.length ?? 0;
|
|
109
|
+
const from = lineStart + match.index + prefixLength;
|
|
110
|
+
ranges.push(tagMark.range(from, from + match[0].length - prefixLength));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
function getFrontmatterRange(doc) {
|
|
114
|
+
if (!doc.startsWith("---\n")) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
const end = doc.indexOf("\n---", 4);
|
|
118
|
+
if (end === -1) {
|
|
119
|
+
return null;
|
|
120
|
+
}
|
|
121
|
+
return {
|
|
122
|
+
from: 0,
|
|
123
|
+
to: end + 4,
|
|
124
|
+
};
|
|
125
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { syntaxTree } from "@codemirror/language";
|
|
3
|
+
import { EditorState } from "@codemirror/state";
|
|
4
|
+
import { EditorView } from "@codemirror/view";
|
|
5
|
+
import { createMarkdownCodeMirrorExtensions } from ".";
|
|
6
|
+
describe("createMarkdownCodeMirrorExtensions", () => {
|
|
7
|
+
it("returns markdown language and decoration extensions", () => {
|
|
8
|
+
expect(createMarkdownCodeMirrorExtensions()).toHaveLength(3);
|
|
9
|
+
});
|
|
10
|
+
it("parses Lapis-style grid tables", () => {
|
|
11
|
+
const state = EditorState.create({
|
|
12
|
+
doc: [
|
|
13
|
+
"+---------+----------+",
|
|
14
|
+
"| Feature | Behavior |",
|
|
15
|
+
"+=========+==========+",
|
|
16
|
+
"| Menus | Actions |",
|
|
17
|
+
"+---------+----------+",
|
|
18
|
+
].join("\n"),
|
|
19
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
20
|
+
});
|
|
21
|
+
expect(syntaxTree(state).toString()).toContain("GridTable");
|
|
22
|
+
});
|
|
23
|
+
it("starts a list after a lazy blockquote before parsing its indented quote", () => {
|
|
24
|
+
const state = EditorState.create({
|
|
25
|
+
doc: [
|
|
26
|
+
"- Unordered parent",
|
|
27
|
+
" > Quoted paragraph",
|
|
28
|
+
" > > Nested quote keeps a second quote guide.",
|
|
29
|
+
"3. Blockquote inside a list item:",
|
|
30
|
+
"",
|
|
31
|
+
" > Skip a line and indent the quote markers four spaces.",
|
|
32
|
+
" > The rendered blockquote stays attached to its first source line.",
|
|
33
|
+
].join("\n"),
|
|
34
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
35
|
+
});
|
|
36
|
+
const tree = syntaxTree(state).toString();
|
|
37
|
+
expect(tree).toContain("BulletList(ListItem(ListMark,Paragraph,Blockquote(QuoteMark,Paragraph,QuoteMark,Blockquote");
|
|
38
|
+
expect(tree).toContain("OrderedList(ListItem(ListMark,Paragraph,Blockquote(QuoteMark,Paragraph(QuoteMark))))");
|
|
39
|
+
expect(tree).not.toContain("CodeBlock");
|
|
40
|
+
});
|
|
41
|
+
it("marks quoted task delimiters for source-mode styling", async () => {
|
|
42
|
+
const parent = document.createElement("div");
|
|
43
|
+
document.body.append(parent);
|
|
44
|
+
const view = new EditorView({
|
|
45
|
+
doc: " > - [ ] Quoted checklist child",
|
|
46
|
+
extensions: createMarkdownCodeMirrorExtensions({ sourceMode: true }),
|
|
47
|
+
parent,
|
|
48
|
+
});
|
|
49
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
|
|
50
|
+
const delimiter = parent.querySelector(".cm-formatting-task");
|
|
51
|
+
expect(delimiter?.textContent).toBe("[ ]");
|
|
52
|
+
view.destroy();
|
|
53
|
+
parent.remove();
|
|
54
|
+
});
|
|
55
|
+
it.each([
|
|
56
|
+
["justify", ["+>-----<+", "| A b C |", "+-------+"]],
|
|
57
|
+
["center", ["+:-----:+", "| ABC |", "+-------+"]],
|
|
58
|
+
["left", ["+:------+", "| ABC |", "+------+"]],
|
|
59
|
+
["right", ["+------:+", "| ABC |", "+------+"]],
|
|
60
|
+
[
|
|
61
|
+
"top",
|
|
62
|
+
[
|
|
63
|
+
"+---^---+",
|
|
64
|
+
"| Larum |",
|
|
65
|
+
"| Ipsum |",
|
|
66
|
+
"| |",
|
|
67
|
+
"| |",
|
|
68
|
+
"+-------+",
|
|
69
|
+
],
|
|
70
|
+
],
|
|
71
|
+
[
|
|
72
|
+
"middle",
|
|
73
|
+
[
|
|
74
|
+
"+---x---+",
|
|
75
|
+
"| |",
|
|
76
|
+
"| Larum |",
|
|
77
|
+
"| Ipsum |",
|
|
78
|
+
"| |",
|
|
79
|
+
"+-------+",
|
|
80
|
+
],
|
|
81
|
+
],
|
|
82
|
+
[
|
|
83
|
+
"bottom",
|
|
84
|
+
[
|
|
85
|
+
"+---v---+",
|
|
86
|
+
"| |",
|
|
87
|
+
"| |",
|
|
88
|
+
"| Larum |",
|
|
89
|
+
"| Ipsum |",
|
|
90
|
+
"+-------+",
|
|
91
|
+
],
|
|
92
|
+
],
|
|
93
|
+
])("parses Adobe %s alignment grid table separators", (_, markdown) => {
|
|
94
|
+
const state = EditorState.create({
|
|
95
|
+
doc: markdown.join("\n"),
|
|
96
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
97
|
+
});
|
|
98
|
+
expect(syntaxTree(state).toString()).toContain("GridTable");
|
|
99
|
+
});
|
|
100
|
+
it("parses Lapis wikilink, embed, pathlink, and tag nodes", () => {
|
|
101
|
+
const state = EditorState.create({
|
|
102
|
+
doc: [
|
|
103
|
+
"[[Project Plan#Section|Plan]]",
|
|
104
|
+
"![[Architecture Diagram#Overview|Diagram]]",
|
|
105
|
+
"[Project](notes/Project Plan.md)",
|
|
106
|
+
"#mira/editor",
|
|
107
|
+
].join("\n"),
|
|
108
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
109
|
+
});
|
|
110
|
+
const tree = syntaxTree(state).toString();
|
|
111
|
+
expect(tree).toContain("WikiLink");
|
|
112
|
+
expect(tree).toContain("WikiLinkPath");
|
|
113
|
+
expect(tree).toContain("WikiLinkAnchor");
|
|
114
|
+
expect(tree).toContain("WikiLinkText");
|
|
115
|
+
expect(tree).toContain("EmbedLink");
|
|
116
|
+
expect(tree).toContain("EmbedLinkPath");
|
|
117
|
+
expect(tree).toContain("EmbedLinkAnchor");
|
|
118
|
+
expect(tree).toContain("EmbedLinkText");
|
|
119
|
+
expect(tree).toContain("PathLink");
|
|
120
|
+
expect(tree).toContain("PathLinkDestination");
|
|
121
|
+
expect(tree).toContain("Tag");
|
|
122
|
+
expect(tree).toContain("TagName");
|
|
123
|
+
});
|
|
124
|
+
it("parses single-backslash bracket math delimiters", () => {
|
|
125
|
+
const state = EditorState.create({
|
|
126
|
+
doc: ["inline \\(x + 1\\)", "\\[", "x + 1", "\\]"].join("\n"),
|
|
127
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
128
|
+
});
|
|
129
|
+
const tree = syntaxTree(state).toString();
|
|
130
|
+
expect(tree).toContain("InlineMathBracket");
|
|
131
|
+
expect(tree).toContain("BlockMathBracket");
|
|
132
|
+
});
|
|
133
|
+
it("parses container, leaf, and inline directives structurally", () => {
|
|
134
|
+
const state = EditorState.create({
|
|
135
|
+
doc: [
|
|
136
|
+
':::cell[Load data]{lang="ts"}',
|
|
137
|
+
"```ts",
|
|
138
|
+
"const value = 1;",
|
|
139
|
+
"```",
|
|
140
|
+
":::",
|
|
141
|
+
"",
|
|
142
|
+
"::badge[Stable]{tone=success}",
|
|
143
|
+
"",
|
|
144
|
+
'Use :abbr[HTML]{title="HyperText Markup Language"}.',
|
|
145
|
+
].join("\n"),
|
|
146
|
+
extensions: createMarkdownCodeMirrorExtensions(),
|
|
147
|
+
});
|
|
148
|
+
const tree = syntaxTree(state).toString();
|
|
149
|
+
expect(tree).toContain("ContainerDirective");
|
|
150
|
+
expect(tree).toContain("LeafDirective");
|
|
151
|
+
expect(tree).toContain("InlineDirective");
|
|
152
|
+
expect(tree).toContain("DirectiveName");
|
|
153
|
+
expect(tree).toContain("DirectiveArgs");
|
|
154
|
+
expect(tree).toContain("DirectiveAttrName");
|
|
155
|
+
expect(tree).toContain("DirectiveAttrValue");
|
|
156
|
+
expect(tree).toContain("FencedCode");
|
|
157
|
+
});
|
|
158
|
+
});
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Extension } from "@codemirror/state";
|
|
2
|
+
import type { MiraMarkdownInputHandlerConfig } from "@lapismd/mira/extensions";
|
|
3
|
+
export declare function createMarkdownInputHandlerExtensions(config?: boolean | MiraMarkdownInputHandlerConfig): Extension[];
|
|
4
|
+
//# sourceMappingURL=input-handlers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"input-handlers.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/input-handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,KAAK,EAAE,8BAA8B,EAAE,MAAM,0BAA0B,CAAC;AAE/E,wBAAgB,oCAAoC,CAClD,MAAM,GAAE,OAAO,GAAG,8BAAmC,GACpD,SAAS,EAAE,CAoEb"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { EditorView } from "@codemirror/view";
|
|
2
|
+
export function createMarkdownInputHandlerExtensions(config = {}) {
|
|
3
|
+
if (config === false ||
|
|
4
|
+
(typeof config === "object" && config.enabled === false)) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
const resolved = typeof config === "object"
|
|
8
|
+
? config
|
|
9
|
+
: {};
|
|
10
|
+
const codeFence = resolved.codeFence ?? true;
|
|
11
|
+
const frontmatter = resolved.frontmatter ?? true;
|
|
12
|
+
const ellipsis = resolved.ellipsis ?? false;
|
|
13
|
+
return [
|
|
14
|
+
EditorView.inputHandler.of((view, from, to, text) => {
|
|
15
|
+
const line = view.state.doc.lineAt(from);
|
|
16
|
+
if (codeFence && text === "`" && from === line.to && line.text === "``") {
|
|
17
|
+
view.dispatch({
|
|
18
|
+
changes: { from: line.from, insert: "```\n```", to },
|
|
19
|
+
selection: { anchor: line.from + 3 },
|
|
20
|
+
userEvent: "input.type",
|
|
21
|
+
});
|
|
22
|
+
return true;
|
|
23
|
+
}
|
|
24
|
+
if (frontmatter &&
|
|
25
|
+
((text === "-" && from === 2 && view.state.sliceDoc(0, 2) === "--") ||
|
|
26
|
+
(text === "-" && from === 1 && view.state.sliceDoc(0, 1) === "—"))) {
|
|
27
|
+
view.dispatch({
|
|
28
|
+
changes: { from: 0, insert: "---\n\n---", to },
|
|
29
|
+
selection: { anchor: 4 },
|
|
30
|
+
userEvent: "input.type",
|
|
31
|
+
});
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
if (ellipsis &&
|
|
35
|
+
text === "." &&
|
|
36
|
+
from >= 2 &&
|
|
37
|
+
view.state.sliceDoc(from - 2, from) === "..") {
|
|
38
|
+
view.dispatch({
|
|
39
|
+
changes: { from: from - 2, insert: "…", to },
|
|
40
|
+
selection: { anchor: from - 1 },
|
|
41
|
+
userEvent: "input.type",
|
|
42
|
+
});
|
|
43
|
+
return true;
|
|
44
|
+
}
|
|
45
|
+
if (ellipsis && text === "...") {
|
|
46
|
+
view.dispatch({
|
|
47
|
+
changes: { from, insert: "…", to },
|
|
48
|
+
selection: { anchor: from + 1 },
|
|
49
|
+
userEvent: "input.type",
|
|
50
|
+
});
|
|
51
|
+
return true;
|
|
52
|
+
}
|
|
53
|
+
return false;
|
|
54
|
+
}),
|
|
55
|
+
];
|
|
56
|
+
}
|