@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,603 @@
|
|
|
1
|
+
import { syntaxTree } from "@codemirror/language";
|
|
2
|
+
import { EditorSelection, EditorState, Transaction, } from "@codemirror/state";
|
|
3
|
+
export const miraMarkdownActionIds = [
|
|
4
|
+
"heading",
|
|
5
|
+
"bold",
|
|
6
|
+
"italic",
|
|
7
|
+
"strikethrough",
|
|
8
|
+
"inlineCode",
|
|
9
|
+
"quote",
|
|
10
|
+
"bulletList",
|
|
11
|
+
"numberedList",
|
|
12
|
+
"taskList",
|
|
13
|
+
"link",
|
|
14
|
+
];
|
|
15
|
+
export function applyMiraMarkdownAction(view, action) {
|
|
16
|
+
if (view.state.facet(EditorState.readOnly)) {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
const edit = isInlineAction(action)
|
|
20
|
+
? createInlineEdit(view.state, action)
|
|
21
|
+
: createLineEdit(view.state, action);
|
|
22
|
+
if (!edit) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const scrollTop = view.scrollDOM.scrollTop;
|
|
26
|
+
const scrollLeft = view.scrollDOM.scrollLeft;
|
|
27
|
+
view.dispatch({
|
|
28
|
+
changes: edit.changes,
|
|
29
|
+
selection: edit.selection,
|
|
30
|
+
annotations: Transaction.userEvent.of("input.format"),
|
|
31
|
+
});
|
|
32
|
+
view.focus();
|
|
33
|
+
view.scrollDOM.scrollTop = scrollTop;
|
|
34
|
+
view.scrollDOM.scrollLeft = scrollLeft;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Report whether the current selection would be unwrapped by an inline
|
|
39
|
+
* Markdown action. Line actions do not expose a binary active state.
|
|
40
|
+
*/
|
|
41
|
+
export function isMiraMarkdownActionActive(state, action) {
|
|
42
|
+
if (!isInlineAction(action)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const selection = state.selection.main;
|
|
46
|
+
const existing = findExistingInlineRange(state, action, selection.from, selection.to);
|
|
47
|
+
return Boolean(existing && selectionMatchesInlineRange(action, selection, existing));
|
|
48
|
+
}
|
|
49
|
+
function isInlineAction(action) {
|
|
50
|
+
return (action === "bold" ||
|
|
51
|
+
action === "italic" ||
|
|
52
|
+
action === "strikethrough" ||
|
|
53
|
+
action === "inlineCode" ||
|
|
54
|
+
action === "link");
|
|
55
|
+
}
|
|
56
|
+
function createInlineEdit(state, action) {
|
|
57
|
+
const range = state.selection.main;
|
|
58
|
+
const existing = findExistingInlineRange(state, action, range.from, range.to);
|
|
59
|
+
if (existing && selectionMatchesInlineRange(action, range, existing)) {
|
|
60
|
+
return removeInlineRange(state, existing);
|
|
61
|
+
}
|
|
62
|
+
if (!range.empty) {
|
|
63
|
+
return wrapInlineRange(state, action, range.from, range.to);
|
|
64
|
+
}
|
|
65
|
+
const word = wordAtCaret(state, range.head);
|
|
66
|
+
if (word) {
|
|
67
|
+
return wrapInlineRange(state, action, word.from, word.to, range.head);
|
|
68
|
+
}
|
|
69
|
+
return insertEmptyInlineTemplate(state, action, range.head);
|
|
70
|
+
}
|
|
71
|
+
function selectionMatchesInlineRange(action, selection, existing) {
|
|
72
|
+
return (selection.empty ||
|
|
73
|
+
action === "link" ||
|
|
74
|
+
(selection.from === existing.from && selection.to === existing.to) ||
|
|
75
|
+
(selection.from === existing.contentFrom &&
|
|
76
|
+
selection.to === existing.contentTo));
|
|
77
|
+
}
|
|
78
|
+
function findExistingInlineRange(state, action, from, to) {
|
|
79
|
+
const syntaxRange = findSyntaxInlineRange(state, action, from, to);
|
|
80
|
+
if (syntaxRange) {
|
|
81
|
+
return syntaxRange;
|
|
82
|
+
}
|
|
83
|
+
if (action === "link") {
|
|
84
|
+
return findDelimitedLink(state.doc.toString(), from, to);
|
|
85
|
+
}
|
|
86
|
+
const delimiters = action === "bold"
|
|
87
|
+
? ["**", "__"]
|
|
88
|
+
: action === "italic"
|
|
89
|
+
? ["_", "*"]
|
|
90
|
+
: action === "strikethrough"
|
|
91
|
+
? ["~~"]
|
|
92
|
+
: ["`"];
|
|
93
|
+
return findDelimitedRange(state.doc.toString(), from, to, delimiters);
|
|
94
|
+
}
|
|
95
|
+
function findSyntaxInlineRange(state, action, from, to) {
|
|
96
|
+
const nodeNames = action === "bold"
|
|
97
|
+
? new Set(["StrongEmphasis"])
|
|
98
|
+
: action === "italic"
|
|
99
|
+
? new Set(["Emphasis"])
|
|
100
|
+
: action === "inlineCode"
|
|
101
|
+
? new Set(["InlineCode"])
|
|
102
|
+
: action === "link"
|
|
103
|
+
? new Set(["Link"])
|
|
104
|
+
: new Set();
|
|
105
|
+
if (nodeNames.size === 0) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const node = smallestContainingNode(state, nodeNames, from, to);
|
|
109
|
+
if (!node) {
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
return inlineRangeFromNode(state, action, node);
|
|
113
|
+
}
|
|
114
|
+
function smallestContainingNode(state, names, from, to) {
|
|
115
|
+
const tree = syntaxTree(state);
|
|
116
|
+
const positions = new Set([
|
|
117
|
+
Math.max(0, Math.min(state.doc.length, from)),
|
|
118
|
+
Math.max(0, Math.min(state.doc.length, to)),
|
|
119
|
+
Math.max(0, Math.min(state.doc.length, from - 1)),
|
|
120
|
+
]);
|
|
121
|
+
let best = null;
|
|
122
|
+
for (const position of positions) {
|
|
123
|
+
for (const bias of [-1, 1]) {
|
|
124
|
+
let node = tree.resolveInner(position, bias);
|
|
125
|
+
while (node) {
|
|
126
|
+
if (names.has(node.name) &&
|
|
127
|
+
node.from <= from &&
|
|
128
|
+
node.to >= to &&
|
|
129
|
+
(!best || node.to - node.from < best.to - best.from)) {
|
|
130
|
+
best = node;
|
|
131
|
+
}
|
|
132
|
+
node = node.parent;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return best;
|
|
137
|
+
}
|
|
138
|
+
function inlineRangeFromNode(state, action, node) {
|
|
139
|
+
const source = state.sliceDoc(node.from, node.to);
|
|
140
|
+
if (action === "link") {
|
|
141
|
+
const open = source.indexOf("[");
|
|
142
|
+
const close = source.indexOf("](", open + 1);
|
|
143
|
+
if (open !== 0 || close === -1 || !source.endsWith(")")) {
|
|
144
|
+
return null;
|
|
145
|
+
}
|
|
146
|
+
return {
|
|
147
|
+
from: node.from,
|
|
148
|
+
to: node.to,
|
|
149
|
+
contentFrom: node.from + 1,
|
|
150
|
+
contentTo: node.from + close,
|
|
151
|
+
content: source.slice(1, close),
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
const delimiter = delimiterFromSource(action, source);
|
|
155
|
+
if (!delimiter) {
|
|
156
|
+
return null;
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
from: node.from,
|
|
160
|
+
to: node.to,
|
|
161
|
+
contentFrom: node.from + delimiter.length,
|
|
162
|
+
contentTo: node.to - delimiter.length,
|
|
163
|
+
content: source.slice(delimiter.length, -delimiter.length),
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
function delimiterFromSource(action, source) {
|
|
167
|
+
if (action === "bold") {
|
|
168
|
+
return source.startsWith("**") && source.endsWith("**")
|
|
169
|
+
? "**"
|
|
170
|
+
: source.startsWith("__") && source.endsWith("__")
|
|
171
|
+
? "__"
|
|
172
|
+
: null;
|
|
173
|
+
}
|
|
174
|
+
if (action === "italic") {
|
|
175
|
+
return source.startsWith("_") && source.endsWith("_")
|
|
176
|
+
? "_"
|
|
177
|
+
: source.startsWith("*") && source.endsWith("*")
|
|
178
|
+
? "*"
|
|
179
|
+
: null;
|
|
180
|
+
}
|
|
181
|
+
if (action === "strikethrough") {
|
|
182
|
+
return source.startsWith("~~") && source.endsWith("~~") ? "~~" : null;
|
|
183
|
+
}
|
|
184
|
+
const opening = source.match(/^`+/u)?.[0];
|
|
185
|
+
return opening && source.endsWith(opening) ? opening : null;
|
|
186
|
+
}
|
|
187
|
+
function findDelimitedRange(markdown, from, to, delimiters) {
|
|
188
|
+
const lineStart = markdown.lastIndexOf("\n", Math.max(0, from - 1)) + 1;
|
|
189
|
+
const nextNewline = markdown.indexOf("\n", to);
|
|
190
|
+
const lineEnd = nextNewline === -1 ? markdown.length : nextNewline;
|
|
191
|
+
let best = null;
|
|
192
|
+
for (const delimiter of delimiters) {
|
|
193
|
+
let opening = markdown.lastIndexOf(delimiter, from);
|
|
194
|
+
while (opening >= lineStart) {
|
|
195
|
+
if (!isExactDelimiterRun(markdown, opening, delimiter)) {
|
|
196
|
+
opening = markdown.lastIndexOf(delimiter, opening - 1);
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
const contentFrom = opening + delimiter.length;
|
|
200
|
+
let closing = markdown.indexOf(delimiter, Math.max(contentFrom, to));
|
|
201
|
+
while (closing !== -1 &&
|
|
202
|
+
closing <= lineEnd &&
|
|
203
|
+
!isExactDelimiterRun(markdown, closing, delimiter)) {
|
|
204
|
+
closing = markdown.indexOf(delimiter, closing + delimiter.length);
|
|
205
|
+
}
|
|
206
|
+
if (closing !== -1 &&
|
|
207
|
+
closing <= lineEnd &&
|
|
208
|
+
contentFrom <= from &&
|
|
209
|
+
closing >= to) {
|
|
210
|
+
const candidate = {
|
|
211
|
+
from: opening,
|
|
212
|
+
to: closing + delimiter.length,
|
|
213
|
+
contentFrom,
|
|
214
|
+
contentTo: closing,
|
|
215
|
+
content: markdown.slice(contentFrom, closing),
|
|
216
|
+
};
|
|
217
|
+
if (!best || candidate.to - candidate.from < best.to - best.from) {
|
|
218
|
+
best = candidate;
|
|
219
|
+
}
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
opening = markdown.lastIndexOf(delimiter, opening - 1);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return best;
|
|
226
|
+
}
|
|
227
|
+
function isExactDelimiterRun(markdown, at, delimiter) {
|
|
228
|
+
const marker = delimiter[0];
|
|
229
|
+
return (marker !== undefined &&
|
|
230
|
+
markdown.slice(at, at + delimiter.length) === delimiter &&
|
|
231
|
+
markdown[at - 1] !== marker &&
|
|
232
|
+
markdown[at + delimiter.length] !== marker);
|
|
233
|
+
}
|
|
234
|
+
function findDelimitedLink(markdown, from, to) {
|
|
235
|
+
const lineStart = markdown.lastIndexOf("\n", Math.max(0, from - 1)) + 1;
|
|
236
|
+
const lineEndIndex = markdown.indexOf("\n", to);
|
|
237
|
+
const lineEnd = lineEndIndex === -1 ? markdown.length : lineEndIndex;
|
|
238
|
+
let opening = markdown.lastIndexOf("[", from);
|
|
239
|
+
while (opening >= lineStart) {
|
|
240
|
+
const labelEnd = markdown.indexOf("](", opening + 1);
|
|
241
|
+
const close = labelEnd === -1 ? -1 : markdown.indexOf(")", labelEnd + 2);
|
|
242
|
+
if (labelEnd !== -1 &&
|
|
243
|
+
close !== -1 &&
|
|
244
|
+
close < lineEnd &&
|
|
245
|
+
opening <= from &&
|
|
246
|
+
close + 1 >= to) {
|
|
247
|
+
return {
|
|
248
|
+
from: opening,
|
|
249
|
+
to: close + 1,
|
|
250
|
+
contentFrom: opening + 1,
|
|
251
|
+
contentTo: labelEnd,
|
|
252
|
+
content: markdown.slice(opening + 1, labelEnd),
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
opening = markdown.lastIndexOf("[", opening - 1);
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
function removeInlineRange(state, existing) {
|
|
260
|
+
const selection = state.selection.main;
|
|
261
|
+
const mapPosition = (position) => {
|
|
262
|
+
if (position <= existing.contentFrom) {
|
|
263
|
+
return existing.from;
|
|
264
|
+
}
|
|
265
|
+
if (position >= existing.contentTo) {
|
|
266
|
+
return existing.from + existing.content.length;
|
|
267
|
+
}
|
|
268
|
+
return existing.from + position - existing.contentFrom;
|
|
269
|
+
};
|
|
270
|
+
let anchor = mapPosition(selection.anchor);
|
|
271
|
+
let head = mapPosition(selection.head);
|
|
272
|
+
if (!selection.empty) {
|
|
273
|
+
const forward = selection.anchor <= selection.head;
|
|
274
|
+
anchor = forward ? existing.from : existing.from + existing.content.length;
|
|
275
|
+
head = forward ? existing.from + existing.content.length : existing.from;
|
|
276
|
+
}
|
|
277
|
+
return {
|
|
278
|
+
changes: {
|
|
279
|
+
from: existing.from,
|
|
280
|
+
to: existing.to,
|
|
281
|
+
insert: existing.content,
|
|
282
|
+
},
|
|
283
|
+
selection: EditorSelection.single(anchor, head),
|
|
284
|
+
};
|
|
285
|
+
}
|
|
286
|
+
function wordAtCaret(state, caret) {
|
|
287
|
+
if (caret < state.doc.length &&
|
|
288
|
+
/\s/u.test(state.sliceDoc(caret, caret + 1))) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
const direct = state.wordAt(caret);
|
|
292
|
+
if (direct && direct.from <= caret && direct.to >= caret) {
|
|
293
|
+
return direct;
|
|
294
|
+
}
|
|
295
|
+
if (caret > 0) {
|
|
296
|
+
const previous = state.wordAt(caret - 1);
|
|
297
|
+
if (previous && previous.to === caret) {
|
|
298
|
+
return previous;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
return null;
|
|
302
|
+
}
|
|
303
|
+
function wrapInlineRange(state, action, from, to, preservedCaret) {
|
|
304
|
+
const selected = state.sliceDoc(from, to);
|
|
305
|
+
if (action === "link") {
|
|
306
|
+
const label = selected || "label";
|
|
307
|
+
const target = "https://example.com";
|
|
308
|
+
const insert = `[${label}](${target})`;
|
|
309
|
+
const targetFrom = from + label.length + 3;
|
|
310
|
+
return {
|
|
311
|
+
changes: { from, to, insert },
|
|
312
|
+
selection: EditorSelection.single(targetFrom, targetFrom + target.length),
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
const delimiter = canonicalDelimiter(action, selected);
|
|
316
|
+
const insert = `${delimiter}${selected}${delimiter}`;
|
|
317
|
+
const selection = state.selection.main;
|
|
318
|
+
if (preservedCaret !== undefined) {
|
|
319
|
+
const caret = from + delimiter.length + preservedCaret - from;
|
|
320
|
+
return {
|
|
321
|
+
changes: { from, to, insert },
|
|
322
|
+
selection: EditorSelection.single(caret),
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
const forward = selection.anchor <= selection.head;
|
|
326
|
+
const innerFrom = from + delimiter.length;
|
|
327
|
+
const innerTo = innerFrom + selected.length;
|
|
328
|
+
return {
|
|
329
|
+
changes: { from, to, insert },
|
|
330
|
+
selection: EditorSelection.single(forward ? innerFrom : innerTo, forward ? innerTo : innerFrom),
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
function canonicalDelimiter(action, selected) {
|
|
334
|
+
if (action === "bold")
|
|
335
|
+
return "**";
|
|
336
|
+
if (action === "italic")
|
|
337
|
+
return "_";
|
|
338
|
+
if (action === "strikethrough")
|
|
339
|
+
return "~~";
|
|
340
|
+
let longestRun = 0;
|
|
341
|
+
for (const match of selected.matchAll(/`+/gu)) {
|
|
342
|
+
longestRun = Math.max(longestRun, match[0].length);
|
|
343
|
+
}
|
|
344
|
+
return "`".repeat(longestRun + 1);
|
|
345
|
+
}
|
|
346
|
+
function insertEmptyInlineTemplate(state, action, at) {
|
|
347
|
+
if (action === "link") {
|
|
348
|
+
const label = "label";
|
|
349
|
+
const target = "https://example.com";
|
|
350
|
+
const insert = `[${label}](${target})`;
|
|
351
|
+
const targetFrom = at + label.length + 3;
|
|
352
|
+
return {
|
|
353
|
+
changes: { from: at, insert },
|
|
354
|
+
selection: EditorSelection.single(targetFrom, targetFrom + target.length),
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
const delimiter = canonicalDelimiter(action, "");
|
|
358
|
+
return {
|
|
359
|
+
changes: { from: at, insert: `${delimiter}${delimiter}` },
|
|
360
|
+
selection: EditorSelection.single(at + delimiter.length),
|
|
361
|
+
};
|
|
362
|
+
}
|
|
363
|
+
function createLineEdit(state, action) {
|
|
364
|
+
if (action === "heading") {
|
|
365
|
+
return createHeadingEdit(state);
|
|
366
|
+
}
|
|
367
|
+
if (action === "quote") {
|
|
368
|
+
return createQuoteEdit(state);
|
|
369
|
+
}
|
|
370
|
+
return createListEdit(state, action);
|
|
371
|
+
}
|
|
372
|
+
function selectedLines(state) {
|
|
373
|
+
const selection = state.selection.main;
|
|
374
|
+
const start = state.doc.lineAt(selection.from);
|
|
375
|
+
let endOffset = selection.to;
|
|
376
|
+
if (!selection.empty &&
|
|
377
|
+
endOffset > 0 &&
|
|
378
|
+
state.doc.lineAt(endOffset).from === endOffset) {
|
|
379
|
+
endOffset -= 1;
|
|
380
|
+
}
|
|
381
|
+
const end = state.doc.lineAt(endOffset);
|
|
382
|
+
return Array.from({ length: end.number - start.number + 1 }, (_, index) => state.doc.line(start.number + index));
|
|
383
|
+
}
|
|
384
|
+
function mappedLineSelection(state, changes) {
|
|
385
|
+
const changeSet = state.changes(changes);
|
|
386
|
+
const selection = state.selection.main;
|
|
387
|
+
return EditorSelection.single(changeSet.mapPos(selection.anchor, 1), changeSet.mapPos(selection.head, 1));
|
|
388
|
+
}
|
|
389
|
+
function createHeadingEdit(state) {
|
|
390
|
+
const lines = selectedLines(state);
|
|
391
|
+
const collapsed = state.selection.main.empty;
|
|
392
|
+
const setextTitles = findSetextTitles(state, lines);
|
|
393
|
+
const eligible = lines.filter((line) => {
|
|
394
|
+
if (setextTitles.underlines.has(line.number))
|
|
395
|
+
return false;
|
|
396
|
+
const contentAt = headingContentPosition(line.text);
|
|
397
|
+
return collapsed || line.text.slice(contentAt).trim().length > 0;
|
|
398
|
+
});
|
|
399
|
+
if (eligible.length === 0)
|
|
400
|
+
return null;
|
|
401
|
+
const allHeadings = eligible.every((line) => {
|
|
402
|
+
const contentAt = headingContentPosition(line.text);
|
|
403
|
+
return Boolean(atxHeadingAt(line.text, contentAt) ||
|
|
404
|
+
setextTitles.titles.has(line.number));
|
|
405
|
+
});
|
|
406
|
+
const changes = [];
|
|
407
|
+
for (const line of eligible) {
|
|
408
|
+
const contentAt = headingContentPosition(line.text);
|
|
409
|
+
const atx = atxHeadingAt(line.text, contentAt);
|
|
410
|
+
const setext = setextTitles.titles.get(line.number);
|
|
411
|
+
if (allHeadings) {
|
|
412
|
+
if (atx) {
|
|
413
|
+
changes.push({ from: line.from + atx.from, to: line.from + atx.to });
|
|
414
|
+
const closing = closingAtxMarker(line.text, atx.to);
|
|
415
|
+
if (closing) {
|
|
416
|
+
changes.push({
|
|
417
|
+
from: line.from + closing.from,
|
|
418
|
+
to: line.from + closing.to,
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
if (setext) {
|
|
423
|
+
changes.push({ from: line.to, to: setext.underlineTo });
|
|
424
|
+
}
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
if (atx) {
|
|
428
|
+
changes.push({
|
|
429
|
+
from: line.from + atx.from,
|
|
430
|
+
to: line.from + atx.to,
|
|
431
|
+
insert: "# ",
|
|
432
|
+
});
|
|
433
|
+
const closing = closingAtxMarker(line.text, atx.to);
|
|
434
|
+
if (closing) {
|
|
435
|
+
changes.push({
|
|
436
|
+
from: line.from + closing.from,
|
|
437
|
+
to: line.from + closing.to,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
changes.push({ from: line.from + contentAt, insert: "# " });
|
|
443
|
+
}
|
|
444
|
+
if (setext) {
|
|
445
|
+
changes.push({ from: line.to, to: setext.underlineTo });
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
return {
|
|
449
|
+
changes,
|
|
450
|
+
selection: mappedLineSelection(state, changes),
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
function findSetextTitles(state, lines) {
|
|
454
|
+
const titles = new Map();
|
|
455
|
+
const underlines = new Set();
|
|
456
|
+
const selectedNumbers = new Set(lines.map((line) => line.number));
|
|
457
|
+
for (const line of lines) {
|
|
458
|
+
if (line.number >= state.doc.lines)
|
|
459
|
+
continue;
|
|
460
|
+
const next = state.doc.line(line.number + 1);
|
|
461
|
+
if (!/^\s*(?:=+|-+)\s*$/u.test(next.text) ||
|
|
462
|
+
line.text.trim().length === 0) {
|
|
463
|
+
continue;
|
|
464
|
+
}
|
|
465
|
+
titles.set(line.number, { underlineTo: next.to });
|
|
466
|
+
if (selectedNumbers.has(next.number))
|
|
467
|
+
underlines.add(next.number);
|
|
468
|
+
}
|
|
469
|
+
return { titles, underlines };
|
|
470
|
+
}
|
|
471
|
+
function atxHeadingAt(text, at) {
|
|
472
|
+
const match = text.slice(at).match(/^(#{1,6})(?:[\t ]+|$)/u);
|
|
473
|
+
return match ? { from: at, to: at + match[0].length } : null;
|
|
474
|
+
}
|
|
475
|
+
function closingAtxMarker(text, after) {
|
|
476
|
+
const suffix = text.slice(after).match(/[\t ]+#+[\t ]*$/u);
|
|
477
|
+
return suffix?.index === undefined
|
|
478
|
+
? null
|
|
479
|
+
: { from: after + suffix.index, to: text.length };
|
|
480
|
+
}
|
|
481
|
+
function createQuoteEdit(state) {
|
|
482
|
+
const lines = selectedLines(state);
|
|
483
|
+
const targets = lines.map((line) => {
|
|
484
|
+
const at = quotePosition(line.text);
|
|
485
|
+
return { line, at, marker: quoteMarkerAt(line.text, at) };
|
|
486
|
+
});
|
|
487
|
+
const allQuoted = targets.every(({ marker }) => marker !== null);
|
|
488
|
+
const changes = [];
|
|
489
|
+
for (const { line, at, marker } of targets) {
|
|
490
|
+
if (allQuoted && marker) {
|
|
491
|
+
changes.push({
|
|
492
|
+
from: line.from + marker.from,
|
|
493
|
+
to: line.from + marker.to,
|
|
494
|
+
});
|
|
495
|
+
}
|
|
496
|
+
else if (!allQuoted && !marker) {
|
|
497
|
+
const remainder = line.text.slice(at);
|
|
498
|
+
changes.push({
|
|
499
|
+
from: line.from + at,
|
|
500
|
+
insert: remainder.trim().length === 0 ? ">" : "> ",
|
|
501
|
+
});
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
return {
|
|
505
|
+
changes,
|
|
506
|
+
selection: mappedLineSelection(state, changes),
|
|
507
|
+
};
|
|
508
|
+
}
|
|
509
|
+
function createListEdit(state, target) {
|
|
510
|
+
const lines = selectedLines(state);
|
|
511
|
+
const collapsed = state.selection.main.empty;
|
|
512
|
+
const targets = lines
|
|
513
|
+
.map((line) => {
|
|
514
|
+
const at = listPosition(line.text);
|
|
515
|
+
const marker = listMarkerAt(line.text, at);
|
|
516
|
+
const meaningful = marker || line.text.slice(at).trim().length > 0 || collapsed;
|
|
517
|
+
return meaningful ? { line, at, marker } : null;
|
|
518
|
+
})
|
|
519
|
+
.filter((entry) => entry !== null);
|
|
520
|
+
if (targets.length === 0)
|
|
521
|
+
return null;
|
|
522
|
+
const allTarget = targets.every(({ marker }) => marker?.kind === target);
|
|
523
|
+
const changes = [];
|
|
524
|
+
const replacement = target === "bulletList"
|
|
525
|
+
? "- "
|
|
526
|
+
: target === "numberedList"
|
|
527
|
+
? "1. "
|
|
528
|
+
: "- [ ] ";
|
|
529
|
+
for (const { line, at, marker } of targets) {
|
|
530
|
+
if (allTarget && marker) {
|
|
531
|
+
changes.push({
|
|
532
|
+
from: line.from + marker.from,
|
|
533
|
+
to: line.from + marker.to,
|
|
534
|
+
});
|
|
535
|
+
}
|
|
536
|
+
else if (!allTarget && marker?.kind !== target) {
|
|
537
|
+
changes.push({
|
|
538
|
+
from: line.from + (marker?.from ?? at),
|
|
539
|
+
to: line.from + (marker?.to ?? at),
|
|
540
|
+
insert: replacement,
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
return {
|
|
545
|
+
changes,
|
|
546
|
+
selection: mappedLineSelection(state, changes),
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
function leadingWhitespaceEnd(text) {
|
|
550
|
+
return text.match(/^[\t ]*/u)?.[0].length ?? 0;
|
|
551
|
+
}
|
|
552
|
+
function quoteMarkerAt(text, at) {
|
|
553
|
+
if (text[at] !== ">")
|
|
554
|
+
return null;
|
|
555
|
+
const trailingSpace = text[at + 1] === " " || text[at + 1] === "\t" ? 1 : 0;
|
|
556
|
+
return { from: at, to: at + 1 + trailingSpace };
|
|
557
|
+
}
|
|
558
|
+
function listMarkerAt(text, at) {
|
|
559
|
+
const source = text.slice(at);
|
|
560
|
+
const task = source.match(/^[-+*][\t ]+\[[^\]\r\n]?\](?:[\t ]+|$)/u);
|
|
561
|
+
if (task)
|
|
562
|
+
return { kind: "taskList", from: at, to: at + task[0].length };
|
|
563
|
+
const bullet = source.match(/^[-+*](?:[\t ]+|$)/u);
|
|
564
|
+
if (bullet)
|
|
565
|
+
return { kind: "bulletList", from: at, to: at + bullet[0].length };
|
|
566
|
+
const numbered = source.match(/^\d+[.)](?:[\t ]+|$)/u);
|
|
567
|
+
return numbered
|
|
568
|
+
? { kind: "numberedList", from: at, to: at + numbered[0].length }
|
|
569
|
+
: null;
|
|
570
|
+
}
|
|
571
|
+
function consumeQuotes(text, start) {
|
|
572
|
+
let at = start;
|
|
573
|
+
while (true) {
|
|
574
|
+
const marker = quoteMarkerAt(text, at);
|
|
575
|
+
if (!marker)
|
|
576
|
+
return at;
|
|
577
|
+
at = marker.to;
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
function listPosition(text) {
|
|
581
|
+
return consumeQuotes(text, leadingWhitespaceEnd(text));
|
|
582
|
+
}
|
|
583
|
+
function quotePosition(text) {
|
|
584
|
+
const indent = leadingWhitespaceEnd(text);
|
|
585
|
+
const list = listMarkerAt(text, indent);
|
|
586
|
+
return list?.to ?? indent;
|
|
587
|
+
}
|
|
588
|
+
function headingContentPosition(text) {
|
|
589
|
+
let at = leadingWhitespaceEnd(text);
|
|
590
|
+
while (true) {
|
|
591
|
+
const nextQuote = quoteMarkerAt(text, at);
|
|
592
|
+
if (nextQuote) {
|
|
593
|
+
at = nextQuote.to;
|
|
594
|
+
continue;
|
|
595
|
+
}
|
|
596
|
+
const nextList = listMarkerAt(text, at);
|
|
597
|
+
if (nextList) {
|
|
598
|
+
at = nextList.to;
|
|
599
|
+
continue;
|
|
600
|
+
}
|
|
601
|
+
return at;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-actions.test.d.ts","sourceRoot":"","sources":["../../src/core/markdown-actions.test.ts"],"names":[],"mappings":""}
|