@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,222 @@
|
|
|
1
|
+
import { CompletionContext, } from "@codemirror/autocomplete";
|
|
2
|
+
import { EditorSelection, EditorState, } from "@codemirror/state";
|
|
3
|
+
import { EditorView } from "@codemirror/view";
|
|
4
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
5
|
+
import { convertHtmlToMarkdown, createMarkdownCompletionSources, createMarkdownInputHandlerExtensions, createMarkdownSmartPasteExtension, } from ".";
|
|
6
|
+
const files = [
|
|
7
|
+
{
|
|
8
|
+
extension: "md",
|
|
9
|
+
kind: "markdown",
|
|
10
|
+
name: "project.md",
|
|
11
|
+
path: "notes/project.md",
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
extension: "png",
|
|
15
|
+
kind: "image",
|
|
16
|
+
name: "diagram.png",
|
|
17
|
+
path: "assets/diagram.png",
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
const adapter = {
|
|
21
|
+
getHeadings(file) {
|
|
22
|
+
return file.path === "notes/project.md"
|
|
23
|
+
? [{ id: "next-steps", level: 2, text: "Next Steps" }]
|
|
24
|
+
: [];
|
|
25
|
+
},
|
|
26
|
+
listFiles: () => files,
|
|
27
|
+
resolveLink({ href }) {
|
|
28
|
+
const normalized = href.replace(/\.md$/i, "");
|
|
29
|
+
return (files.find((file) => file.path.replace(/\.md$/i, "") === normalized ||
|
|
30
|
+
file.name?.replace(/\.md$/i, "") === normalized ||
|
|
31
|
+
file.path.replace(/\.md$/i, "").endsWith(`/${normalized}`)) ?? null);
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
afterEach(() => {
|
|
35
|
+
document.body.replaceChildren();
|
|
36
|
+
});
|
|
37
|
+
describe("Markdown completions", () => {
|
|
38
|
+
it("formats file and embed targets through the portable adapter", async () => {
|
|
39
|
+
const sources = createMarkdownCompletionSources({
|
|
40
|
+
fileAdapter: adapter,
|
|
41
|
+
sourcePath: "notes/today.md",
|
|
42
|
+
});
|
|
43
|
+
const file = await firstResult(sources, "[[pro");
|
|
44
|
+
expect(file.options.map((option) => option.label)).toContain("project.md");
|
|
45
|
+
expect(applyCompletion("[[pro", file, "project.md")).toBe("[[project]]");
|
|
46
|
+
const embed = await firstResult(sources, "![[dia");
|
|
47
|
+
expect(embed.options.map((option) => option.label)).toContain("diagram.png");
|
|
48
|
+
expect(applyCompletion("![[dia", embed, "diagram.png")).toBe("![[diagram.png]]");
|
|
49
|
+
});
|
|
50
|
+
it("completes headings while preserving existing display text", async () => {
|
|
51
|
+
const sources = createMarkdownCompletionSources({
|
|
52
|
+
fileAdapter: adapter,
|
|
53
|
+
sourcePath: "notes/today.md",
|
|
54
|
+
});
|
|
55
|
+
const doc = "[[project#Ne|Alias]]";
|
|
56
|
+
const position = doc.indexOf("|");
|
|
57
|
+
const result = await firstResult(sources, doc, position);
|
|
58
|
+
expect(result.options.map((option) => option.label)).toContain("Next Steps");
|
|
59
|
+
expect(applyCompletion(doc, result, "Next Steps", position)).toBe("[[project#Next Steps|Alias]]");
|
|
60
|
+
});
|
|
61
|
+
it("resolves a unique basename from listFiles when resolveLink cannot", async () => {
|
|
62
|
+
const sources = createMarkdownCompletionSources({
|
|
63
|
+
fileAdapter: {
|
|
64
|
+
...adapter,
|
|
65
|
+
resolveLink: () => null,
|
|
66
|
+
},
|
|
67
|
+
sourcePath: "notes/today.md",
|
|
68
|
+
});
|
|
69
|
+
const result = await firstResult(sources, "[[project#Ne");
|
|
70
|
+
expect(applyCompletion("[[project#Ne", result, "Next Steps")).toBe("[[project#Next Steps]]");
|
|
71
|
+
});
|
|
72
|
+
it("completes display text without losing the selected target", async () => {
|
|
73
|
+
const sources = createMarkdownCompletionSources({
|
|
74
|
+
fileAdapter: adapter,
|
|
75
|
+
sourcePath: "notes/today.md",
|
|
76
|
+
});
|
|
77
|
+
const result = await firstResult(sources, "[[project|Shown");
|
|
78
|
+
expect(applyCompletion("[[project|Shown", result, "Shown")).toBe("[[project|Shown]]");
|
|
79
|
+
});
|
|
80
|
+
it("lets consumers replace the link formatter", async () => {
|
|
81
|
+
const formatLink = vi.fn((target) => `${target.embed ? "embed" : "link"}:${target.targetPath}`);
|
|
82
|
+
const sources = createMarkdownCompletionSources({
|
|
83
|
+
config: { formatLink },
|
|
84
|
+
fileAdapter: adapter,
|
|
85
|
+
sourcePath: "notes/today.md",
|
|
86
|
+
});
|
|
87
|
+
const result = await firstResult(sources, "[[pro");
|
|
88
|
+
expect(applyCompletion("[[pro", result, "project.md")).toBe("link:notes/project.md");
|
|
89
|
+
expect(formatLink).toHaveBeenCalled();
|
|
90
|
+
});
|
|
91
|
+
});
|
|
92
|
+
describe("Markdown input handlers", () => {
|
|
93
|
+
it("scaffolds code fences and frontmatter by default", () => {
|
|
94
|
+
expect(runInputHandler("``", "`")).toEqual({
|
|
95
|
+
doc: "```\n```",
|
|
96
|
+
selection: 3,
|
|
97
|
+
});
|
|
98
|
+
expect(runInputHandler("--", "-")).toEqual({
|
|
99
|
+
doc: "---\n\n---",
|
|
100
|
+
selection: 4,
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
it("keeps ellipsis substitution opt-in", () => {
|
|
104
|
+
expect(runInputHandler("..", ".")).toEqual({
|
|
105
|
+
doc: "..",
|
|
106
|
+
selection: 2,
|
|
107
|
+
});
|
|
108
|
+
expect(runInputHandler("..", ".", { ellipsis: true })).toEqual({
|
|
109
|
+
doc: "…",
|
|
110
|
+
selection: 1,
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
describe("Markdown smart paste", () => {
|
|
115
|
+
it("converts rich HTML to Markdown", async () => {
|
|
116
|
+
const markdown = await convertHtmlToMarkdown("<h2>Plan</h2><ul><li>First</li><li>Second</li></ul>");
|
|
117
|
+
expect(markdown).toContain("## Plan");
|
|
118
|
+
expect(markdown).toContain("* First");
|
|
119
|
+
expect(markdown).toContain("* Second");
|
|
120
|
+
});
|
|
121
|
+
it("wraps the current selection when a URL is pasted", () => {
|
|
122
|
+
const view = createView("Read Mira", 5, 9, [
|
|
123
|
+
createMarkdownSmartPasteExtension(),
|
|
124
|
+
]);
|
|
125
|
+
const event = pasteEvent({
|
|
126
|
+
"text/plain": "https://mira.example/docs",
|
|
127
|
+
});
|
|
128
|
+
view.contentDOM.dispatchEvent(event);
|
|
129
|
+
expect(event.defaultPrevented).toBe(true);
|
|
130
|
+
expect(view.state.doc.toString()).toBe("Read [Mira](https://mira.example/docs)");
|
|
131
|
+
view.destroy();
|
|
132
|
+
});
|
|
133
|
+
it("supports an application-supplied HTML converter", async () => {
|
|
134
|
+
const view = createView("", 0, 0, [
|
|
135
|
+
createMarkdownSmartPasteExtension({
|
|
136
|
+
convertHtml: async () => "**converted**",
|
|
137
|
+
}),
|
|
138
|
+
]);
|
|
139
|
+
const event = pasteEvent({
|
|
140
|
+
"text/html": "<strong>converted</strong>",
|
|
141
|
+
"text/plain": "converted",
|
|
142
|
+
});
|
|
143
|
+
view.contentDOM.dispatchEvent(event);
|
|
144
|
+
await vi.waitFor(() => expect(view.state.doc.toString()).toBe("**converted**"));
|
|
145
|
+
expect(event.defaultPrevented).toBe(true);
|
|
146
|
+
view.destroy();
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
async function firstResult(sources, doc, position = doc.length) {
|
|
150
|
+
const state = EditorState.create({ doc });
|
|
151
|
+
const context = new CompletionContext(state, position, true);
|
|
152
|
+
for (const source of sources) {
|
|
153
|
+
const result = await source(context);
|
|
154
|
+
if (result) {
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
throw new Error(`No completion matched ${doc}`);
|
|
159
|
+
}
|
|
160
|
+
function applyCompletion(doc, result, label, position = doc.length) {
|
|
161
|
+
const option = result.options.find((item) => item.label === label);
|
|
162
|
+
if (!option || typeof option.apply !== "function") {
|
|
163
|
+
throw new Error(`Missing completion ${label}`);
|
|
164
|
+
}
|
|
165
|
+
const state = EditorState.create({
|
|
166
|
+
doc,
|
|
167
|
+
selection: EditorSelection.cursor(position),
|
|
168
|
+
});
|
|
169
|
+
const view = mockView(state);
|
|
170
|
+
option.apply(view, option, result.from, result.to ?? position);
|
|
171
|
+
return view.state.doc.toString();
|
|
172
|
+
}
|
|
173
|
+
function runInputHandler(doc, text, config = {}) {
|
|
174
|
+
const state = EditorState.create({
|
|
175
|
+
doc,
|
|
176
|
+
selection: EditorSelection.cursor(doc.length),
|
|
177
|
+
extensions: createMarkdownInputHandlerExtensions(config),
|
|
178
|
+
});
|
|
179
|
+
const view = mockView(state);
|
|
180
|
+
const handled = state.facet(EditorView.inputHandler).some((handler) => handler(view, doc.length, doc.length, text, () => view.state.update({
|
|
181
|
+
changes: { from: doc.length, insert: text, to: doc.length },
|
|
182
|
+
})));
|
|
183
|
+
return {
|
|
184
|
+
doc: view.state.doc.toString(),
|
|
185
|
+
selection: handled ? view.state.selection.main.anchor : doc.length,
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
function mockView(initialState) {
|
|
189
|
+
let state = initialState;
|
|
190
|
+
return {
|
|
191
|
+
dispatch(spec) {
|
|
192
|
+
state = state.update(spec).state;
|
|
193
|
+
},
|
|
194
|
+
get state() {
|
|
195
|
+
return state;
|
|
196
|
+
},
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
function createView(doc, from, to, extensions) {
|
|
200
|
+
const parent = document.createElement("div");
|
|
201
|
+
document.body.append(parent);
|
|
202
|
+
return new EditorView({
|
|
203
|
+
parent,
|
|
204
|
+
state: EditorState.create({
|
|
205
|
+
doc,
|
|
206
|
+
extensions,
|
|
207
|
+
selection: EditorSelection.range(from, to),
|
|
208
|
+
}),
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
function pasteEvent(data) {
|
|
212
|
+
const event = new Event("paste", { bubbles: true, cancelable: true });
|
|
213
|
+
Object.defineProperty(event, "clipboardData", {
|
|
214
|
+
value: {
|
|
215
|
+
getData(type) {
|
|
216
|
+
return data[type] ?? "";
|
|
217
|
+
},
|
|
218
|
+
items: [],
|
|
219
|
+
},
|
|
220
|
+
});
|
|
221
|
+
return event;
|
|
222
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { CompletionSource } from "@codemirror/autocomplete";
|
|
2
|
+
import { type Extension } from "@codemirror/state";
|
|
3
|
+
import { type MiraFileAdapter, type MiraInternalLinkFormatTarget, type MiraMarkdownCompletionConfig } from "@lapismd/mira/extensions";
|
|
4
|
+
export type MiraMarkdownCompletionOptions = {
|
|
5
|
+
fileAdapter?: MiraFileAdapter;
|
|
6
|
+
sourcePath?: string;
|
|
7
|
+
config?: boolean | MiraMarkdownCompletionConfig;
|
|
8
|
+
};
|
|
9
|
+
export declare function createMarkdownCompletionExtensions(options?: MiraMarkdownCompletionOptions): Extension[];
|
|
10
|
+
export declare function createMarkdownCompletionSources(options?: MiraMarkdownCompletionOptions): CompletionSource[];
|
|
11
|
+
export declare function formatMiraInternalLink(target: MiraInternalLinkFormatTarget): string;
|
|
12
|
+
//# sourceMappingURL=completion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"completion.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/completion.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAIV,gBAAgB,EACjB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAClC,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,6BAA6B,GAAG;IAC1C,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,GAAG,4BAA4B,CAAC;CACjD,CAAC;AAoBF,wBAAgB,kCAAkC,CAChD,OAAO,GAAE,6BAAkC,GAC1C,SAAS,EAAE,CAUb;AAED,wBAAgB,+BAA+B,CAC7C,OAAO,GAAE,6BAAkC,GAC1C,gBAAgB,EAAE,CAGpB;AAED,wBAAgB,sBAAsB,CACpC,MAAM,EAAE,4BAA4B,GACnC,MAAM,CA0BR"}
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
import { EditorState } from "@codemirror/state";
|
|
2
|
+
import { parseMiraFileTarget, } from "@lapismd/mira/extensions";
|
|
3
|
+
export function createMarkdownCompletionExtensions(options = {}) {
|
|
4
|
+
const resolved = resolveCompletionOptions(options);
|
|
5
|
+
if (!resolved) {
|
|
6
|
+
return [];
|
|
7
|
+
}
|
|
8
|
+
const sources = createMarkdownCompletionSourcesFromResolved(resolved);
|
|
9
|
+
return sources.map((source) => EditorState.languageData.of(() => [{ autocomplete: source }]));
|
|
10
|
+
}
|
|
11
|
+
export function createMarkdownCompletionSources(options = {}) {
|
|
12
|
+
const resolved = resolveCompletionOptions(options);
|
|
13
|
+
return resolved ? createMarkdownCompletionSourcesFromResolved(resolved) : [];
|
|
14
|
+
}
|
|
15
|
+
export function formatMiraInternalLink(target) {
|
|
16
|
+
const normalizedPath = normalizePath(target.targetPath);
|
|
17
|
+
const file = target.file;
|
|
18
|
+
const extension = (file?.extension ??
|
|
19
|
+
normalizedPath.split("/").pop()?.split(".").pop() ??
|
|
20
|
+
"").toLowerCase();
|
|
21
|
+
const withoutMarkdownExtension = extension === "md" ? normalizedPath.replace(/\.md$/i, "") : normalizedPath;
|
|
22
|
+
const basename = withoutMarkdownExtension.split("/").pop() ?? "";
|
|
23
|
+
const basenameMatches = target.files.filter((candidate) => {
|
|
24
|
+
const candidatePath = normalizePath(candidate.path).replace(/\.md$/i, "");
|
|
25
|
+
return (candidatePath.split("/").pop() ?? "") === basename;
|
|
26
|
+
});
|
|
27
|
+
const sourceDirectory = dirname(normalizePath(target.sourcePath ?? ""));
|
|
28
|
+
const targetDirectory = dirname(normalizedPath);
|
|
29
|
+
const linkPath = normalizedPath === normalizePath(target.sourcePath ?? "")
|
|
30
|
+
? ""
|
|
31
|
+
: targetDirectory === sourceDirectory || basenameMatches.length === 1
|
|
32
|
+
? basename
|
|
33
|
+
: withoutMarkdownExtension;
|
|
34
|
+
const heading = target.heading ? `#${target.heading}` : "";
|
|
35
|
+
const alias = target.alias ? `|${target.alias}` : "";
|
|
36
|
+
return `${target.embed ? "!" : ""}[[${linkPath}${heading}${alias}]]`;
|
|
37
|
+
}
|
|
38
|
+
function createMarkdownCompletionSourcesFromResolved(options) {
|
|
39
|
+
const sources = [];
|
|
40
|
+
if (options.config.displayText) {
|
|
41
|
+
sources.push(displayTextCompletionSource(options));
|
|
42
|
+
}
|
|
43
|
+
if (options.config.headings) {
|
|
44
|
+
sources.push(headingCompletionSource(options));
|
|
45
|
+
}
|
|
46
|
+
if (options.config.embeds) {
|
|
47
|
+
sources.push(fileCompletionSource(options, true));
|
|
48
|
+
}
|
|
49
|
+
if (options.config.files) {
|
|
50
|
+
sources.push(fileCompletionSource(options, false));
|
|
51
|
+
}
|
|
52
|
+
return sources;
|
|
53
|
+
}
|
|
54
|
+
function resolveCompletionOptions(options) {
|
|
55
|
+
const adapter = options.fileAdapter;
|
|
56
|
+
if (options.config === false ||
|
|
57
|
+
(typeof options.config === "object" && options.config.enabled === false) ||
|
|
58
|
+
!adapter?.listFiles) {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
const config = typeof options.config === "object" ? options.config : {};
|
|
62
|
+
return {
|
|
63
|
+
adapter,
|
|
64
|
+
sourcePath: options.sourcePath,
|
|
65
|
+
config: {
|
|
66
|
+
displayText: config.displayText ?? true,
|
|
67
|
+
embeds: config.embeds ?? true,
|
|
68
|
+
files: config.files ?? true,
|
|
69
|
+
headings: config.headings ?? true,
|
|
70
|
+
includeMissing: config.includeMissing ?? true,
|
|
71
|
+
...config,
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
function fileCompletionSource(options, embed) {
|
|
76
|
+
return async (context) => {
|
|
77
|
+
const word = context.matchBefore(embed ? /!\[\[[^\]|#\r\n]*$/u : /(?<!!)\[\[[^\]|#\r\n]*$/u);
|
|
78
|
+
if (!word) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const query = word.text.slice(embed ? 3 : 2).trim();
|
|
82
|
+
const files = await options.adapter.listFiles();
|
|
83
|
+
const filter = embed
|
|
84
|
+
? options.config.embedFilter
|
|
85
|
+
: options.config.fileFilter;
|
|
86
|
+
const matches = files
|
|
87
|
+
.filter((file) => !filter || filter(file))
|
|
88
|
+
.filter((file) => matchesFileQuery(file, query))
|
|
89
|
+
.sort(compareFiles);
|
|
90
|
+
const completionOptions = matches.map((file) => ({
|
|
91
|
+
label: file.name ?? basename(file.path),
|
|
92
|
+
detail: dirname(file.path),
|
|
93
|
+
type: completionType(file, embed),
|
|
94
|
+
apply(view, _completion, from, to) {
|
|
95
|
+
replaceOpenWikiLink(view, from, to, formatLink(options, {
|
|
96
|
+
embed,
|
|
97
|
+
file,
|
|
98
|
+
files,
|
|
99
|
+
sourcePath: options.sourcePath,
|
|
100
|
+
targetPath: file.path,
|
|
101
|
+
}));
|
|
102
|
+
},
|
|
103
|
+
}));
|
|
104
|
+
if (query && options.config.includeMissing) {
|
|
105
|
+
completionOptions.push({
|
|
106
|
+
label: `Link to new note "${query}"`,
|
|
107
|
+
detail: "Missing target",
|
|
108
|
+
type: "text",
|
|
109
|
+
apply(view, _completion, from, to) {
|
|
110
|
+
replaceOpenWikiLink(view, from, to, formatLink(options, {
|
|
111
|
+
embed,
|
|
112
|
+
files,
|
|
113
|
+
sourcePath: options.sourcePath,
|
|
114
|
+
targetPath: query,
|
|
115
|
+
}));
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
return {
|
|
120
|
+
filter: false,
|
|
121
|
+
from: word.from,
|
|
122
|
+
options: completionOptions,
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function headingCompletionSource(options) {
|
|
127
|
+
return async (context) => {
|
|
128
|
+
const word = context.matchBefore(/!?\[\[[^\]|\r\n]*#[^\]|\r\n]*$/u);
|
|
129
|
+
if (!word) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
const embed = word.text.startsWith("!");
|
|
133
|
+
const target = parseWikiTarget(word.text.slice(embed ? 3 : 2));
|
|
134
|
+
if (target.heading === undefined) {
|
|
135
|
+
return null;
|
|
136
|
+
}
|
|
137
|
+
const files = await options.adapter.listFiles();
|
|
138
|
+
const file = await resolveCompletionFile(options.adapter, target.path, options.sourcePath, files);
|
|
139
|
+
const headings = file && options.adapter.getHeadings
|
|
140
|
+
? await options.adapter.getHeadings(file)
|
|
141
|
+
: [];
|
|
142
|
+
const query = target.heading.toLocaleLowerCase();
|
|
143
|
+
const suffix = lineSuffix(context, word.to);
|
|
144
|
+
const alias = aliasFromSuffix(suffix);
|
|
145
|
+
const completionOptions = headings
|
|
146
|
+
.filter((heading) => heading.text.toLocaleLowerCase().includes(query))
|
|
147
|
+
.map((heading) => ({
|
|
148
|
+
label: heading.text,
|
|
149
|
+
detail: `H${heading.level}`,
|
|
150
|
+
type: "property",
|
|
151
|
+
apply(view, _completion, from, to) {
|
|
152
|
+
replaceOpenWikiLink(view, from, to, formatLink(options, {
|
|
153
|
+
alias,
|
|
154
|
+
embed,
|
|
155
|
+
file: file ?? undefined,
|
|
156
|
+
files,
|
|
157
|
+
heading: heading.text,
|
|
158
|
+
sourcePath: options.sourcePath,
|
|
159
|
+
targetPath: file?.path ?? target.path,
|
|
160
|
+
}));
|
|
161
|
+
},
|
|
162
|
+
}));
|
|
163
|
+
if (completionOptions.length === 0) {
|
|
164
|
+
completionOptions.push({
|
|
165
|
+
label: target.heading.trim() || "Heading",
|
|
166
|
+
detail: "No matching heading",
|
|
167
|
+
type: "text",
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
filter: false,
|
|
172
|
+
from: word.from,
|
|
173
|
+
options: completionOptions,
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
function displayTextCompletionSource(options) {
|
|
178
|
+
return async (context) => {
|
|
179
|
+
const word = context.matchBefore(/!?\[\[[^\]\r\n]*\|[^\]\r\n]*$/u);
|
|
180
|
+
if (!word) {
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
const embed = word.text.startsWith("!");
|
|
184
|
+
const target = parseWikiTarget(word.text.slice(embed ? 3 : 2));
|
|
185
|
+
if (target.alias === undefined) {
|
|
186
|
+
return null;
|
|
187
|
+
}
|
|
188
|
+
const files = await options.adapter.listFiles();
|
|
189
|
+
const file = await resolveCompletionFile(options.adapter, target.path, options.sourcePath, files);
|
|
190
|
+
const label = embed &&
|
|
191
|
+
isImage(file, target.path) &&
|
|
192
|
+
/^\d+\s*(x\s*\d+)?$/i.test(target.alias)
|
|
193
|
+
? `Image size: ${target.alias.trim()} px`
|
|
194
|
+
: target.alias || "Display text";
|
|
195
|
+
return {
|
|
196
|
+
filter: false,
|
|
197
|
+
from: word.from,
|
|
198
|
+
options: [
|
|
199
|
+
{
|
|
200
|
+
label,
|
|
201
|
+
detail: target.path,
|
|
202
|
+
type: "text",
|
|
203
|
+
apply(view, _completion, from, to) {
|
|
204
|
+
replaceOpenWikiLink(view, from, to, formatLink(options, {
|
|
205
|
+
alias: target.alias || undefined,
|
|
206
|
+
embed,
|
|
207
|
+
file: file ?? undefined,
|
|
208
|
+
files,
|
|
209
|
+
heading: target.heading,
|
|
210
|
+
sourcePath: options.sourcePath,
|
|
211
|
+
targetPath: file?.path ?? target.path,
|
|
212
|
+
}));
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
function formatLink(options, target) {
|
|
220
|
+
return (options.config.formatLink ?? formatMiraInternalLink)(target);
|
|
221
|
+
}
|
|
222
|
+
function replaceOpenWikiLink(view, from, to, insert) {
|
|
223
|
+
const line = view.state.doc.lineAt(from);
|
|
224
|
+
const suffix = line.text.slice(to - line.from);
|
|
225
|
+
const marker = suffix.indexOf("]]");
|
|
226
|
+
view.dispatch({
|
|
227
|
+
changes: {
|
|
228
|
+
from,
|
|
229
|
+
insert,
|
|
230
|
+
to: marker === -1 ? to : to + marker + 2,
|
|
231
|
+
},
|
|
232
|
+
selection: { anchor: from + insert.length },
|
|
233
|
+
userEvent: "input.complete",
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
function lineSuffix(context, position) {
|
|
237
|
+
const line = context.state.doc.lineAt(position);
|
|
238
|
+
return context.state.doc.sliceString(position, line.to);
|
|
239
|
+
}
|
|
240
|
+
function aliasFromSuffix(suffix) {
|
|
241
|
+
const match = /^\|([^\]\r\n]*)]]/.exec(suffix);
|
|
242
|
+
return match?.[1] || undefined;
|
|
243
|
+
}
|
|
244
|
+
function parseWikiTarget(value) {
|
|
245
|
+
const [targetAndHeading = "", alias] = value.split("|", 2);
|
|
246
|
+
const hash = targetAndHeading.indexOf("#");
|
|
247
|
+
return {
|
|
248
|
+
path: hash === -1
|
|
249
|
+
? targetAndHeading.trim()
|
|
250
|
+
: targetAndHeading.slice(0, hash).trim(),
|
|
251
|
+
heading: hash === -1 ? undefined : targetAndHeading.slice(hash + 1).trim(),
|
|
252
|
+
alias,
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
async function resolveCompletionFile(adapter, path, sourcePath, files) {
|
|
256
|
+
if (!path && sourcePath) {
|
|
257
|
+
return (files.find((file) => normalizePath(file.path) === normalizePath(sourcePath)) ?? {
|
|
258
|
+
kind: "markdown",
|
|
259
|
+
path: sourcePath,
|
|
260
|
+
});
|
|
261
|
+
}
|
|
262
|
+
const resolved = await adapter.resolveLink(parseMiraFileTarget(path, sourcePath));
|
|
263
|
+
const normalizedTarget = normalizePath(path).replace(/\.md$/i, "");
|
|
264
|
+
const directMatch = files.find((file) => normalizePath(file.path).replace(/\.md$/i, "") === normalizedTarget);
|
|
265
|
+
const basenameMatches = files.filter((file) => basename(normalizePath(file.path).replace(/\.md$/i, "")) ===
|
|
266
|
+
basename(normalizedTarget));
|
|
267
|
+
return (resolved ??
|
|
268
|
+
directMatch ??
|
|
269
|
+
(basenameMatches.length === 1 ? basenameMatches[0] : null) ??
|
|
270
|
+
null);
|
|
271
|
+
}
|
|
272
|
+
function matchesFileQuery(file, query) {
|
|
273
|
+
const normalizedQuery = query.toLocaleLowerCase();
|
|
274
|
+
return (!normalizedQuery ||
|
|
275
|
+
file.path.toLocaleLowerCase().includes(normalizedQuery) ||
|
|
276
|
+
(file.name ?? "").toLocaleLowerCase().includes(normalizedQuery));
|
|
277
|
+
}
|
|
278
|
+
function compareFiles(left, right) {
|
|
279
|
+
return (left.name ?? left.path).localeCompare(right.name ?? right.path);
|
|
280
|
+
}
|
|
281
|
+
function completionType(file, embed) {
|
|
282
|
+
if (!embed) {
|
|
283
|
+
return "text";
|
|
284
|
+
}
|
|
285
|
+
return isImage(file, file.path) ? "image" : "text";
|
|
286
|
+
}
|
|
287
|
+
function isImage(file, path) {
|
|
288
|
+
return (file?.kind === "image" ||
|
|
289
|
+
/\.(?:avif|gif|jpe?g|png|svg|webp)$/i.test(file?.path ?? path));
|
|
290
|
+
}
|
|
291
|
+
function normalizePath(path) {
|
|
292
|
+
return path.replaceAll("\\", "/").replace(/^\.\/+/, "");
|
|
293
|
+
}
|
|
294
|
+
function dirname(path) {
|
|
295
|
+
const normalized = normalizePath(path);
|
|
296
|
+
const slash = normalized.lastIndexOf("/");
|
|
297
|
+
return slash === -1 ? "" : normalized.slice(0, slash);
|
|
298
|
+
}
|
|
299
|
+
function basename(path) {
|
|
300
|
+
const normalized = normalizePath(path);
|
|
301
|
+
return normalized.slice(normalized.lastIndexOf("/") + 1);
|
|
302
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directives.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/markdown/directives.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,cAAc,EACpB,MAAM,iBAAiB,CAAC;AAwNzB,eAAO,MAAM,iBAAiB,EAAE,cAoE/B,CAAC"}
|