@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,12 @@
|
|
|
1
|
+
import type { MiraColorMode } from "../extensions/index.js";
|
|
2
|
+
export type MiraAppearanceContext = {
|
|
3
|
+
readonly theme: string | undefined;
|
|
4
|
+
readonly colorMode: MiraColorMode;
|
|
5
|
+
};
|
|
6
|
+
export declare const miraAppearanceContextKey: unique symbol;
|
|
7
|
+
export declare function normalizeMiraTheme(theme: string | null | undefined): string | undefined;
|
|
8
|
+
export declare function resolveMiraThemeAttribute(theme: string | null | undefined, source?: Element | null): string | undefined;
|
|
9
|
+
export declare function miraColorModeAttribute(colorMode: MiraColorMode | undefined): Exclude<MiraColorMode, "inherit"> | undefined;
|
|
10
|
+
export declare function resolveMiraColorModeAttribute(colorMode: MiraColorMode | undefined, source?: Element | null): Exclude<MiraColorMode, "inherit"> | undefined;
|
|
11
|
+
export declare function miraColorModeClassName(colorMode: MiraColorMode | undefined): string | undefined;
|
|
12
|
+
//# sourceMappingURL=appearance-context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance-context.d.ts","sourceRoot":"","sources":["../../src/internal/appearance-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,wBAAwB,eAAoC,CAAC;AAE1E,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAC/B,MAAM,GAAG,SAAS,CAEpB;AAED,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAChC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GACtB,MAAM,GAAG,SAAS,CASpB;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,aAAa,GAAG,SAAS,GACnC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,SAAS,CAE/C;AAED,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,aAAa,GAAG,SAAS,EACpC,MAAM,CAAC,EAAE,OAAO,GAAG,IAAI,GACtB,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,GAAG,SAAS,CAU/C;AAED,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,aAAa,GAAG,SAAS,GACnC,MAAM,GAAG,SAAS,CAIpB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export const miraAppearanceContextKey = Symbol("mira-appearance-context");
|
|
2
|
+
export function normalizeMiraTheme(theme) {
|
|
3
|
+
return theme?.trim() ? theme : undefined;
|
|
4
|
+
}
|
|
5
|
+
export function resolveMiraThemeAttribute(theme, source) {
|
|
6
|
+
return (normalizeMiraTheme(theme) ??
|
|
7
|
+
normalizeMiraTheme(source
|
|
8
|
+
?.closest("[data-mira-theme]")
|
|
9
|
+
?.getAttribute("data-mira-theme")));
|
|
10
|
+
}
|
|
11
|
+
export function miraColorModeAttribute(colorMode) {
|
|
12
|
+
return colorMode && colorMode !== "inherit" ? colorMode : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function resolveMiraColorModeAttribute(colorMode, source) {
|
|
15
|
+
const explicit = miraColorModeAttribute(colorMode);
|
|
16
|
+
if (explicit)
|
|
17
|
+
return explicit;
|
|
18
|
+
const inherited = source
|
|
19
|
+
?.closest("[data-mira-color-mode]")
|
|
20
|
+
?.getAttribute("data-mira-color-mode");
|
|
21
|
+
return inherited === "system" || inherited === "dark" || inherited === "light"
|
|
22
|
+
? inherited
|
|
23
|
+
: undefined;
|
|
24
|
+
}
|
|
25
|
+
export function miraColorModeClassName(colorMode) {
|
|
26
|
+
if (colorMode === "dark")
|
|
27
|
+
return "dark theme-dark";
|
|
28
|
+
if (colorMode === "light")
|
|
29
|
+
return "light theme-light";
|
|
30
|
+
return undefined;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appearance-context.test.d.ts","sourceRoot":"","sources":["../../src/internal/appearance-context.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { miraColorModeAttribute, miraColorModeClassName, normalizeMiraTheme, resolveMiraColorModeAttribute, resolveMiraThemeAttribute, } from "./appearance-context";
|
|
3
|
+
describe("Mira appearance attributes", () => {
|
|
4
|
+
it("passes arbitrary theme token lists through unchanged", () => {
|
|
5
|
+
expect(normalizeMiraTheme("obsidian company-brand")).toBe("obsidian company-brand");
|
|
6
|
+
expect(normalizeMiraTheme(" mira custom ")).toBe(" mira custom ");
|
|
7
|
+
});
|
|
8
|
+
it("omits absent and whitespace-only themes", () => {
|
|
9
|
+
expect(normalizeMiraTheme(undefined)).toBeUndefined();
|
|
10
|
+
expect(normalizeMiraTheme("")).toBeUndefined();
|
|
11
|
+
expect(normalizeMiraTheme(" ")).toBeUndefined();
|
|
12
|
+
});
|
|
13
|
+
it("keeps color mode independent from palette selection", () => {
|
|
14
|
+
expect(miraColorModeAttribute("inherit")).toBeUndefined();
|
|
15
|
+
expect(miraColorModeAttribute("system")).toBe("system");
|
|
16
|
+
expect(miraColorModeClassName("dark")).toBe("dark theme-dark");
|
|
17
|
+
expect(miraColorModeClassName("light")).toBe("light theme-light");
|
|
18
|
+
expect(miraColorModeClassName("system")).toBeUndefined();
|
|
19
|
+
});
|
|
20
|
+
it("resolves an omitted appearance from the nearest themed host", () => {
|
|
21
|
+
const host = document.createElement("div");
|
|
22
|
+
const trigger = document.createElement("button");
|
|
23
|
+
host.dataset.miraTheme = "obsidian company-brand";
|
|
24
|
+
host.dataset.miraColorMode = "dark";
|
|
25
|
+
host.append(trigger);
|
|
26
|
+
expect(resolveMiraThemeAttribute(undefined, trigger)).toBe("obsidian company-brand");
|
|
27
|
+
expect(resolveMiraColorModeAttribute("inherit", trigger)).toBe("dark");
|
|
28
|
+
expect(resolveMiraThemeAttribute("mira", trigger)).toBe("mira");
|
|
29
|
+
expect(resolveMiraColorModeAttribute("light", trigger)).toBe("light");
|
|
30
|
+
});
|
|
31
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { autocompletion } from "@codemirror/autocomplete";
|
|
2
|
+
import { type Extension } from "@codemirror/state";
|
|
3
|
+
export { applyMarkdownTemplate, createMarkdownTemplate, createSlashCommandCompletionSource, createSlashCommandExtensions, createSlashSnippet, type MiraMarkdownTemplate, type MiraSlashCommand, type MiraSlashCommandContext, type MiraSlashCommandOptions, type MiraSlashCommandTriggerScope, type MiraSlashCommandUi, type MiraSlashSnippetOptions, type MiraTemplateSelection, type MiraTextRange, } from "./slash-commands";
|
|
4
|
+
export { createMiraSearchExtension, search, type MiraSearchConfig, } from "./search";
|
|
5
|
+
export { createSelectionToolbarExtension, defaultMiraSelectionToolbarActions, miraSelectionToolbarActionIds, type MiraSelectionToolbarActionId, type MiraSelectionToolbarConfig, type MiraSelectionToolbarPlacement, } from "./selection-toolbar";
|
|
6
|
+
import { type MiraSearchConfig } from "./search";
|
|
7
|
+
export type MiraCodeMirrorOptions = {
|
|
8
|
+
readonly?: boolean;
|
|
9
|
+
placeholder?: string;
|
|
10
|
+
ariaLabel?: string;
|
|
11
|
+
contentAttributes?: Record<string, string>;
|
|
12
|
+
lineWrapping?: boolean;
|
|
13
|
+
spellcheck?: boolean;
|
|
14
|
+
indentWithTabs?: boolean;
|
|
15
|
+
indentWidth?: number;
|
|
16
|
+
lineNumbers?: boolean;
|
|
17
|
+
autocomplete?: Exclude<Parameters<typeof autocompletion>[0], undefined> | false;
|
|
18
|
+
search?: Partial<MiraSearchConfig>;
|
|
19
|
+
};
|
|
20
|
+
export declare const miraClassHighlighter: import("@lezer/highlight").Highlighter;
|
|
21
|
+
export declare const miraEditorTheme: Extension;
|
|
22
|
+
export declare function gutterLineStyleSyncExtension(): Extension;
|
|
23
|
+
export declare function createBaseCodeMirrorExtensions(options?: MiraCodeMirrorOptions): Extension[];
|
|
24
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/base/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EAIf,MAAM,0BAA0B,CAAC;AAkBlC,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAmBhE,OAAO,EACL,qBAAqB,EACrB,sBAAsB,EACtB,kCAAkC,EAClC,4BAA4B,EAC5B,kBAAkB,EAClB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,EAC5B,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,qBAAqB,EAC1B,KAAK,aAAa,GACnB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,yBAAyB,EACzB,MAAM,EACN,KAAK,gBAAgB,GACtB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,+BAA+B,EAC/B,kCAAkC,EAClC,6BAA6B,EAC7B,KAAK,4BAA4B,EACjC,KAAK,0BAA0B,EAC/B,KAAK,6BAA6B,GACnC,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAA6B,KAAK,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAE5E,MAAM,MAAM,qBAAqB,GAAG;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EACT,OAAO,CAAC,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,GACxD,KAAK,CAAC;IACV,MAAM,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACpC,CAAC;AAEF,eAAO,MAAM,oBAAoB,wCAuC/B,CAAC;AAEH,eAAO,MAAM,eAAe,WAiN1B,CAAC;AAgOH,wBAAgB,4BAA4B,IAAI,SAAS,CAExD;AAED,wBAAgB,8BAA8B,CAC5C,OAAO,GAAE,qBAA0B,GAClC,SAAS,EAAE,CAoEb"}
|
|
@@ -0,0 +1,489 @@
|
|
|
1
|
+
import { autocompletion, closeBrackets, closeBracketsKeymap, completionKeymap, } from "@codemirror/autocomplete";
|
|
2
|
+
import { defaultKeymap, history, historyKeymap, indentLess, indentMore, } from "@codemirror/commands";
|
|
3
|
+
import { bracketMatching, codeFolding, foldKeymap, indentOnInput, indentUnit, syntaxHighlighting, } from "@codemirror/language";
|
|
4
|
+
import { lintKeymap } from "@codemirror/lint";
|
|
5
|
+
import { highlightSelectionMatches, searchKeymap } from "@codemirror/search";
|
|
6
|
+
import { EditorState } from "@codemirror/state";
|
|
7
|
+
import { crosshairCursor, drawSelection, dropCursor, EditorView, highlightActiveLine, highlightActiveLineGutter, highlightSpecialChars, keymap, lineNumbers, placeholder, rectangularSelection, ViewPlugin, } from "@codemirror/view";
|
|
8
|
+
import { tagHighlighter, tags } from "@lezer/highlight";
|
|
9
|
+
export { applyMarkdownTemplate, createMarkdownTemplate, createSlashCommandCompletionSource, createSlashCommandExtensions, createSlashSnippet, } from "./slash-commands";
|
|
10
|
+
export { createMiraSearchExtension, search, } from "./search";
|
|
11
|
+
export { createSelectionToolbarExtension, defaultMiraSelectionToolbarActions, miraSelectionToolbarActionIds, } from "./selection-toolbar";
|
|
12
|
+
import { createMiraSearchExtension } from "./search";
|
|
13
|
+
export const miraClassHighlighter = tagHighlighter([
|
|
14
|
+
{ tag: tags.link, class: "cm-link" },
|
|
15
|
+
{ tag: tags.heading, class: "cm-heading" },
|
|
16
|
+
{ tag: tags.emphasis, class: "cm-emphasis" },
|
|
17
|
+
{ tag: tags.strong, class: "cm-strong" },
|
|
18
|
+
{ tag: tags.keyword, class: "cm-keyword" },
|
|
19
|
+
{ tag: tags.atom, class: "cm-meta" },
|
|
20
|
+
{ tag: tags.bool, class: "cm-bool" },
|
|
21
|
+
{ tag: tags.url, class: "cm-url" },
|
|
22
|
+
{ tag: tags.labelName, class: "cm-label" },
|
|
23
|
+
{ tag: tags.inserted, class: "cm-inserted" },
|
|
24
|
+
{ tag: tags.deleted, class: "cm-deleted" },
|
|
25
|
+
{ tag: tags.literal, class: "cm-literal" },
|
|
26
|
+
{ tag: tags.string, class: "cm-string" },
|
|
27
|
+
{ tag: tags.attributeValue, class: "cm-string" },
|
|
28
|
+
{ tag: tags.number, class: "cm-number" },
|
|
29
|
+
{
|
|
30
|
+
tag: [tags.regexp, tags.escape, tags.special(tags.string)],
|
|
31
|
+
class: "cm-string-2",
|
|
32
|
+
},
|
|
33
|
+
{ tag: tags.variableName, class: "cm-variable" },
|
|
34
|
+
{ tag: tags.local(tags.variableName), class: "cm-local" },
|
|
35
|
+
{ tag: tags.definition(tags.variableName), class: "cm-definition" },
|
|
36
|
+
{ tag: tags.special(tags.variableName), class: "cm-variable-2" },
|
|
37
|
+
{ tag: tags.definition(tags.propertyName), class: "cm-definition" },
|
|
38
|
+
{ tag: tags.typeName, class: "cm-type" },
|
|
39
|
+
{ tag: tags.namespace, class: "cm-namespace" },
|
|
40
|
+
{ tag: tags.className, class: "cm-class" },
|
|
41
|
+
{ tag: tags.macroName, class: "cm-macro" },
|
|
42
|
+
{ tag: tags.propertyName, class: "cm-property" },
|
|
43
|
+
{ tag: tags.attributeName, class: "cm-attribute" },
|
|
44
|
+
{ tag: tags.operator, class: "cm-operator" },
|
|
45
|
+
{ tag: [tags.comment, tags.contentSeparator], class: "cm-comment" },
|
|
46
|
+
{ tag: tags.meta, class: "cm-meta" },
|
|
47
|
+
{ tag: tags.processingInstruction, class: "cm-meta" },
|
|
48
|
+
{ tag: tags.invalid, class: "cm-invalid" },
|
|
49
|
+
{ tag: tags.punctuation, class: "cm-punctuation" },
|
|
50
|
+
{ tag: tags.bracket, class: "cm-bracket" },
|
|
51
|
+
{ tag: tags.strikethrough, class: "cm-line-through" },
|
|
52
|
+
]);
|
|
53
|
+
export const miraEditorTheme = EditorView.theme({
|
|
54
|
+
"&": {
|
|
55
|
+
height: "100%",
|
|
56
|
+
color: "var(--mira-foreground)",
|
|
57
|
+
backgroundColor: "var(--mira-editor-background)",
|
|
58
|
+
fontSize: "var(--mira-font-size)",
|
|
59
|
+
},
|
|
60
|
+
".cm-scroller": {
|
|
61
|
+
fontFamily: "var(--font-sans, var(--mira-font-sans))",
|
|
62
|
+
lineHeight: "var(--mira-line-height)",
|
|
63
|
+
},
|
|
64
|
+
// Only the top-level scroller — nested `.mod-inline` editors (table cells,
|
|
65
|
+
// etc.) must not inherit file-margin padding or they become oversized.
|
|
66
|
+
"& > .cm-scroller": {
|
|
67
|
+
// Full-pane scroller (scrollbar on the edge) with a centered readable
|
|
68
|
+
// column — Lapis/Obsidian file-margins + file-line-width behavior.
|
|
69
|
+
paddingBlock: "var(--file-margins-y, var(--mira-editor-padding, 2rem))",
|
|
70
|
+
paddingInline: "max(var(--file-margins-x, var(--mira-editor-padding, 2rem)), calc((100% - var(--file-line-width, 700px)) / 2))",
|
|
71
|
+
scrollbarGutter: "stable",
|
|
72
|
+
},
|
|
73
|
+
".cm-line, .cm-gutterElement": {
|
|
74
|
+
"--cm-base-block-content-height": "var(--mira-line-height)",
|
|
75
|
+
"--cm-block-line-height": "var(--mira-line-height)",
|
|
76
|
+
"--cm-block-padding-top": "0",
|
|
77
|
+
},
|
|
78
|
+
".cm-line": {
|
|
79
|
+
lineHeight: "var(--cm-block-line-height)",
|
|
80
|
+
padding: "var(--cm-block-padding-top) 0 0",
|
|
81
|
+
},
|
|
82
|
+
// Keep min-height on the host content only so nested inline editors stay
|
|
83
|
+
// compact (table cells, chrome columns).
|
|
84
|
+
"& > .cm-scroller > .cm-content": {
|
|
85
|
+
minHeight: "100%",
|
|
86
|
+
padding: "0",
|
|
87
|
+
width: "100%",
|
|
88
|
+
},
|
|
89
|
+
".cm-gutters": {
|
|
90
|
+
backgroundColor: "var(--mira-editor-background)",
|
|
91
|
+
borderRight: "0",
|
|
92
|
+
color: "var(--mira-muted-foreground)",
|
|
93
|
+
fontSize: "0.85em",
|
|
94
|
+
lineHeight: "var(--cm-block-line-height)",
|
|
95
|
+
marginInlineEnd: "24px",
|
|
96
|
+
},
|
|
97
|
+
".cm-gutter.cm-lineNumbers": {
|
|
98
|
+
color: "var(--text-faint, var(--mira-muted-foreground))",
|
|
99
|
+
fontFamily: "var(--font-monospace, var(--mira-font-mono))",
|
|
100
|
+
fontVariantNumeric: "tabular-nums",
|
|
101
|
+
},
|
|
102
|
+
".cm-gutters .cm-lineNumbers .cm-gutterElement": {
|
|
103
|
+
alignItems: "start",
|
|
104
|
+
display: "inline-flex",
|
|
105
|
+
justifyContent: "end",
|
|
106
|
+
minWidth: "20px",
|
|
107
|
+
whiteSpace: "nowrap",
|
|
108
|
+
},
|
|
109
|
+
".cm-selectionBackground, &.cm-focused .cm-selectionBackground": {
|
|
110
|
+
backgroundColor: "var(--mira-selection)",
|
|
111
|
+
},
|
|
112
|
+
"&.cm-focused": {
|
|
113
|
+
outline: "none",
|
|
114
|
+
},
|
|
115
|
+
".cm-placeholder": {
|
|
116
|
+
color: "var(--mira-muted-foreground)",
|
|
117
|
+
},
|
|
118
|
+
".cm-heading": {
|
|
119
|
+
color: "var(--mira-syntax-heading)",
|
|
120
|
+
fontWeight: "650",
|
|
121
|
+
},
|
|
122
|
+
".cm-link, .cm-url, .cm-internal-link, .cm-wikilink, .cm-embed-link": {
|
|
123
|
+
color: "var(--mira-syntax-link)",
|
|
124
|
+
cursor: "pointer",
|
|
125
|
+
textDecoration: "underline",
|
|
126
|
+
textDecorationThickness: "1px",
|
|
127
|
+
textUnderlineOffset: "3px",
|
|
128
|
+
},
|
|
129
|
+
".cm-emphasis": {
|
|
130
|
+
fontStyle: "italic",
|
|
131
|
+
},
|
|
132
|
+
".cm-strong": {
|
|
133
|
+
fontWeight: "700",
|
|
134
|
+
},
|
|
135
|
+
".cm-line-through": {
|
|
136
|
+
textDecoration: "line-through",
|
|
137
|
+
},
|
|
138
|
+
".cm-comment, .cm-meta, .cm-hmd-frontmatter": {
|
|
139
|
+
color: "var(--mira-syntax-comment)",
|
|
140
|
+
},
|
|
141
|
+
".cm-keyword, .cm-bool, .cm-atom, .cm-literal": {
|
|
142
|
+
color: "var(--mira-syntax-keyword)",
|
|
143
|
+
},
|
|
144
|
+
".cm-string, .cm-string-2": {
|
|
145
|
+
color: "var(--mira-syntax-string)",
|
|
146
|
+
},
|
|
147
|
+
".cm-number": {
|
|
148
|
+
color: "var(--mira-syntax-number)",
|
|
149
|
+
},
|
|
150
|
+
".cm-variable, .cm-variable-2, .cm-local, .cm-definition, .cm-macro, .cm-namespace": {
|
|
151
|
+
color: "var(--mira-syntax-variable)",
|
|
152
|
+
},
|
|
153
|
+
".cm-property, .cm-attribute": {
|
|
154
|
+
color: "var(--mira-syntax-property)",
|
|
155
|
+
},
|
|
156
|
+
".cm-type, .cm-class": {
|
|
157
|
+
color: "var(--mira-syntax-type)",
|
|
158
|
+
},
|
|
159
|
+
".cm-operator, .cm-punctuation, .cm-bracket": {
|
|
160
|
+
color: "var(--mira-syntax-operator)",
|
|
161
|
+
},
|
|
162
|
+
".cm-label": {
|
|
163
|
+
color: "var(--mira-code-foreground)",
|
|
164
|
+
fontFamily: "var(--mira-font-mono)",
|
|
165
|
+
},
|
|
166
|
+
".cm-hashtag": {
|
|
167
|
+
backgroundColor: "var(--mira-tag-background)",
|
|
168
|
+
borderRadius: "999px",
|
|
169
|
+
color: "var(--mira-tag-foreground)",
|
|
170
|
+
fontWeight: "550",
|
|
171
|
+
padding: "0.05em 0.35em",
|
|
172
|
+
},
|
|
173
|
+
".cm-invalid": {
|
|
174
|
+
backgroundColor: "var(--mira-syntax-invalid-background)",
|
|
175
|
+
color: "var(--mira-syntax-invalid)",
|
|
176
|
+
},
|
|
177
|
+
/* shadcn-like popover chrome for CM tooltips / autocomplete */
|
|
178
|
+
".cm-tooltip": {
|
|
179
|
+
backgroundColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
180
|
+
border: "1px solid var(--border, var(--mira-border))",
|
|
181
|
+
borderRadius: "var(--radius-m, var(--mira-radius))",
|
|
182
|
+
boxShadow: "var(--mira-widget-shadow)",
|
|
183
|
+
color: "var(--popover-foreground, var(--mira-popover-foreground, var(--mira-foreground)))",
|
|
184
|
+
fontFamily: "var(--font-interface, var(--mira-font-sans, ui-sans-serif, system-ui, sans-serif))",
|
|
185
|
+
fontSize: "0.875rem",
|
|
186
|
+
lineHeight: "1.25rem",
|
|
187
|
+
zIndex: "1100",
|
|
188
|
+
},
|
|
189
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul": {
|
|
190
|
+
fontFamily: "inherit",
|
|
191
|
+
maxHeight: "min(18rem, 50vh)",
|
|
192
|
+
maxWidth: "min(28rem, 95vw)",
|
|
193
|
+
minWidth: "12rem",
|
|
194
|
+
padding: "0.25rem",
|
|
195
|
+
},
|
|
196
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul > li": {
|
|
197
|
+
borderRadius: "var(--radius-s, 4px)",
|
|
198
|
+
lineHeight: "1.4",
|
|
199
|
+
padding: "0.375rem 0.5rem",
|
|
200
|
+
},
|
|
201
|
+
".cm-tooltip.cm-tooltip-autocomplete > ul > completion-section": {
|
|
202
|
+
borderBottom: "1px solid var(--border, var(--mira-border))",
|
|
203
|
+
color: "var(--muted-foreground, var(--mira-muted-foreground))",
|
|
204
|
+
fontSize: "0.75rem",
|
|
205
|
+
fontWeight: "600",
|
|
206
|
+
letterSpacing: "0.02em",
|
|
207
|
+
opacity: "1",
|
|
208
|
+
padding: "0.375rem 0.5rem",
|
|
209
|
+
textTransform: "uppercase",
|
|
210
|
+
},
|
|
211
|
+
".cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
212
|
+
backgroundColor: "var(--accent, var(--background-modifier-hover, var(--mira-accent-soft)))",
|
|
213
|
+
color: "var(--accent-foreground, var(--mira-foreground))",
|
|
214
|
+
},
|
|
215
|
+
".cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
|
|
216
|
+
backgroundColor: "var(--muted, var(--mira-muted))",
|
|
217
|
+
color: "var(--muted-foreground, var(--mira-muted-foreground))",
|
|
218
|
+
},
|
|
219
|
+
".cm-completionLabel": {
|
|
220
|
+
color: "inherit",
|
|
221
|
+
},
|
|
222
|
+
".cm-completionDetail": {
|
|
223
|
+
color: "var(--muted-foreground, var(--mira-muted-foreground))",
|
|
224
|
+
fontSize: "0.75rem",
|
|
225
|
+
fontStyle: "normal",
|
|
226
|
+
marginLeft: "0.5rem",
|
|
227
|
+
},
|
|
228
|
+
".cm-completionMatchedText": {
|
|
229
|
+
color: "var(--mira-accent)",
|
|
230
|
+
fontWeight: "600",
|
|
231
|
+
textDecoration: "none",
|
|
232
|
+
},
|
|
233
|
+
".cm-tooltip.cm-completionInfo": {
|
|
234
|
+
backgroundColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
235
|
+
border: "1px solid var(--border, var(--mira-border))",
|
|
236
|
+
borderRadius: "var(--radius-m, var(--mira-radius))",
|
|
237
|
+
boxShadow: "var(--mira-widget-shadow)",
|
|
238
|
+
color: "var(--popover-foreground, var(--mira-popover-foreground, var(--mira-foreground)))",
|
|
239
|
+
fontFamily: "var(--font-interface, var(--mira-font-sans, ui-sans-serif, system-ui, sans-serif))",
|
|
240
|
+
fontSize: "0.8125rem",
|
|
241
|
+
padding: "0.5rem 0.75rem",
|
|
242
|
+
},
|
|
243
|
+
".cm-tooltip .cm-tooltip-arrow:after": {
|
|
244
|
+
borderBottomColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
245
|
+
borderTopColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
246
|
+
},
|
|
247
|
+
".cm-tooltip .cm-tooltip-arrow:before": {
|
|
248
|
+
borderBottomColor: "var(--border, var(--mira-border))",
|
|
249
|
+
borderTopColor: "var(--border, var(--mira-border))",
|
|
250
|
+
},
|
|
251
|
+
});
|
|
252
|
+
/**
|
|
253
|
+
* Active line is off by default. Set `--mira-active-line-background`
|
|
254
|
+
* (e.g. to `var(--mira-accent-soft)`) to restore highlighting. Must use
|
|
255
|
+
* baseTheme so `&light`/`&dark` can target CM's built-in rules; `.mira-codemirror`
|
|
256
|
+
* raises specificity so mount order cannot leave the stock blue highlight visible.
|
|
257
|
+
*/
|
|
258
|
+
const miraActiveLineBaseTheme = EditorView.baseTheme({
|
|
259
|
+
"&light.mira-codemirror .cm-activeLine": {
|
|
260
|
+
backgroundColor: "var(--mira-active-line-background, transparent)",
|
|
261
|
+
},
|
|
262
|
+
"&dark.mira-codemirror .cm-activeLine": {
|
|
263
|
+
backgroundColor: "var(--mira-active-line-background, transparent)",
|
|
264
|
+
},
|
|
265
|
+
"&light.mira-codemirror .cm-activeLineGutter": {
|
|
266
|
+
backgroundColor: "var(--mira-active-line-background, transparent)",
|
|
267
|
+
},
|
|
268
|
+
"&dark.mira-codemirror .cm-activeLineGutter": {
|
|
269
|
+
backgroundColor: "var(--mira-active-line-background, transparent)",
|
|
270
|
+
},
|
|
271
|
+
});
|
|
272
|
+
/** Overrides CM baseTheme light/dark completion selection colors. */
|
|
273
|
+
const miraAutocompleteBaseTheme = EditorView.baseTheme({
|
|
274
|
+
"&light .cm-tooltip": {
|
|
275
|
+
backgroundColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
276
|
+
border: "1px solid var(--border, var(--mira-border))",
|
|
277
|
+
color: "var(--popover-foreground, var(--mira-popover-foreground, var(--mira-foreground)))",
|
|
278
|
+
},
|
|
279
|
+
"&dark .cm-tooltip": {
|
|
280
|
+
backgroundColor: "var(--popover, var(--mira-popover, var(--mira-widget-background)))",
|
|
281
|
+
border: "1px solid var(--border, var(--mira-border))",
|
|
282
|
+
color: "var(--popover-foreground, var(--mira-popover-foreground, var(--mira-foreground)))",
|
|
283
|
+
},
|
|
284
|
+
"&light .cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
285
|
+
backgroundColor: "var(--accent, var(--background-modifier-hover, var(--mira-accent-soft)))",
|
|
286
|
+
color: "var(--accent-foreground, var(--mira-foreground))",
|
|
287
|
+
},
|
|
288
|
+
"&dark .cm-tooltip-autocomplete ul li[aria-selected]": {
|
|
289
|
+
backgroundColor: "var(--accent, var(--background-modifier-hover, var(--mira-accent-soft)))",
|
|
290
|
+
color: "var(--accent-foreground, var(--mira-foreground))",
|
|
291
|
+
},
|
|
292
|
+
"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
|
|
293
|
+
backgroundColor: "var(--muted, var(--mira-muted))",
|
|
294
|
+
color: "var(--muted-foreground, var(--mira-muted-foreground))",
|
|
295
|
+
},
|
|
296
|
+
"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]": {
|
|
297
|
+
backgroundColor: "var(--muted, var(--mira-muted))",
|
|
298
|
+
color: "var(--muted-foreground, var(--mira-muted-foreground))",
|
|
299
|
+
},
|
|
300
|
+
});
|
|
301
|
+
function collectVisibleLineStyles(view) {
|
|
302
|
+
return Array.from(view.dom.querySelectorAll(".cm-content .cm-line"), (line) => {
|
|
303
|
+
const style = getComputedStyle(line);
|
|
304
|
+
const rect = line.getBoundingClientRect();
|
|
305
|
+
return {
|
|
306
|
+
top: rect.top,
|
|
307
|
+
bottom: rect.bottom,
|
|
308
|
+
lineHeight: style.lineHeight,
|
|
309
|
+
paddingTop: style.paddingTop,
|
|
310
|
+
};
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
function collectGutterColumns(view) {
|
|
314
|
+
return Array.from(view.dom.querySelectorAll(".cm-gutters .cm-gutter"), (gutter) => Array.from(gutter.querySelectorAll(".cm-gutterElement"), (element) => {
|
|
315
|
+
const rect = element.getBoundingClientRect();
|
|
316
|
+
return {
|
|
317
|
+
element,
|
|
318
|
+
top: rect.top,
|
|
319
|
+
bottom: rect.bottom,
|
|
320
|
+
};
|
|
321
|
+
}));
|
|
322
|
+
}
|
|
323
|
+
function mutationMayAffectGutters(mutation) {
|
|
324
|
+
if (mutation.type === "attributes") {
|
|
325
|
+
return mutation.attributeName === "class";
|
|
326
|
+
}
|
|
327
|
+
return mutation.addedNodes.length > 0 || mutation.removedNodes.length > 0;
|
|
328
|
+
}
|
|
329
|
+
function findMatchingLineStyle(gutterElement, lineStyles) {
|
|
330
|
+
let bestMatch = null;
|
|
331
|
+
let bestDistance = Number.POSITIVE_INFINITY;
|
|
332
|
+
for (const lineStyle of lineStyles) {
|
|
333
|
+
const overlaps = gutterElement.top < lineStyle.bottom &&
|
|
334
|
+
gutterElement.bottom > lineStyle.top;
|
|
335
|
+
if (overlaps) {
|
|
336
|
+
return lineStyle;
|
|
337
|
+
}
|
|
338
|
+
const distance = Math.abs(gutterElement.top - lineStyle.top);
|
|
339
|
+
if (distance < bestDistance) {
|
|
340
|
+
bestDistance = distance;
|
|
341
|
+
bestMatch = lineStyle;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return bestMatch;
|
|
345
|
+
}
|
|
346
|
+
class GutterLineStyleSyncPlugin {
|
|
347
|
+
view;
|
|
348
|
+
mutationObserver;
|
|
349
|
+
resizeObserver;
|
|
350
|
+
syncScheduled = false;
|
|
351
|
+
constructor(view) {
|
|
352
|
+
this.view = view;
|
|
353
|
+
this.mutationObserver = new MutationObserver((mutations) => {
|
|
354
|
+
if (mutations.some(mutationMayAffectGutters)) {
|
|
355
|
+
this.scheduleSync();
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
this.mutationObserver.observe(this.view.dom, {
|
|
359
|
+
subtree: true,
|
|
360
|
+
childList: true,
|
|
361
|
+
attributes: true,
|
|
362
|
+
attributeFilter: ["class"],
|
|
363
|
+
});
|
|
364
|
+
this.resizeObserver = new ResizeObserver(() => {
|
|
365
|
+
this.scheduleSync();
|
|
366
|
+
});
|
|
367
|
+
this.resizeObserver.observe(this.view.dom);
|
|
368
|
+
this.resizeObserver.observe(this.view.contentDOM);
|
|
369
|
+
this.scheduleSync();
|
|
370
|
+
}
|
|
371
|
+
update(update) {
|
|
372
|
+
if (update.docChanged || update.viewportChanged || update.geometryChanged) {
|
|
373
|
+
this.scheduleSync();
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
destroy() {
|
|
377
|
+
this.mutationObserver.disconnect();
|
|
378
|
+
this.resizeObserver.disconnect();
|
|
379
|
+
}
|
|
380
|
+
scheduleSync() {
|
|
381
|
+
if (this.syncScheduled) {
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
this.syncScheduled = true;
|
|
385
|
+
this.view.requestMeasure({
|
|
386
|
+
read: (view) => ({
|
|
387
|
+
lineStyles: collectVisibleLineStyles(view),
|
|
388
|
+
gutterColumns: collectGutterColumns(view),
|
|
389
|
+
}),
|
|
390
|
+
write: ({ lineStyles, gutterColumns }) => {
|
|
391
|
+
this.syncScheduled = false;
|
|
392
|
+
this.applyLineStyles(lineStyles, gutterColumns);
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
applyLineStyles(lineStyles, gutterColumns) {
|
|
397
|
+
for (const gutterElements of gutterColumns) {
|
|
398
|
+
for (const gutterElement of gutterElements) {
|
|
399
|
+
const lineStyle = findMatchingLineStyle(gutterElement, lineStyles);
|
|
400
|
+
if (!lineStyle) {
|
|
401
|
+
gutterElement.element.style.removeProperty("line-height");
|
|
402
|
+
gutterElement.element.style.removeProperty("padding-top");
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
if (gutterElement.element.style.lineHeight !== lineStyle.lineHeight) {
|
|
406
|
+
gutterElement.element.style.lineHeight = lineStyle.lineHeight;
|
|
407
|
+
}
|
|
408
|
+
if (gutterElement.element.style.paddingTop !== lineStyle.paddingTop) {
|
|
409
|
+
gutterElement.element.style.paddingTop = lineStyle.paddingTop;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
export function gutterLineStyleSyncExtension() {
|
|
416
|
+
return ViewPlugin.fromClass(GutterLineStyleSyncPlugin);
|
|
417
|
+
}
|
|
418
|
+
export function createBaseCodeMirrorExtensions(options = {}) {
|
|
419
|
+
const indentWidth = normalizeIndentWidth(options.indentWidth);
|
|
420
|
+
const readonly = options.readonly ?? false;
|
|
421
|
+
const autocompleteConfig = options.autocomplete;
|
|
422
|
+
return [
|
|
423
|
+
miraEditorTheme,
|
|
424
|
+
miraActiveLineBaseTheme,
|
|
425
|
+
miraAutocompleteBaseTheme,
|
|
426
|
+
gutterLineStyleSyncExtension(),
|
|
427
|
+
...((options.lineNumbers ?? true) ? [lineNumbers()] : []),
|
|
428
|
+
highlightActiveLineGutter(),
|
|
429
|
+
highlightSpecialChars(),
|
|
430
|
+
history(),
|
|
431
|
+
drawSelection(),
|
|
432
|
+
dropCursor(),
|
|
433
|
+
EditorState.allowMultipleSelections.of(true),
|
|
434
|
+
EditorState.readOnly.of(readonly),
|
|
435
|
+
EditorView.editable.of(!readonly),
|
|
436
|
+
EditorView.contentAttributes.of({
|
|
437
|
+
"aria-label": options.ariaLabel ?? "Markdown editor",
|
|
438
|
+
spellcheck: String(options.spellcheck ?? true),
|
|
439
|
+
...options.contentAttributes,
|
|
440
|
+
}),
|
|
441
|
+
indentOnInput(),
|
|
442
|
+
syntaxHighlighting(miraClassHighlighter),
|
|
443
|
+
bracketMatching(),
|
|
444
|
+
closeBrackets(),
|
|
445
|
+
...(autocompleteConfig === false
|
|
446
|
+
? []
|
|
447
|
+
: [
|
|
448
|
+
autocompletion({
|
|
449
|
+
icons: false,
|
|
450
|
+
tooltipClass: () => "mira-cm-autocomplete",
|
|
451
|
+
...(autocompleteConfig ?? {}),
|
|
452
|
+
}),
|
|
453
|
+
]),
|
|
454
|
+
rectangularSelection(),
|
|
455
|
+
crosshairCursor(),
|
|
456
|
+
highlightActiveLine(),
|
|
457
|
+
highlightSelectionMatches(),
|
|
458
|
+
createMiraSearchExtension(options.search),
|
|
459
|
+
codeFolding(),
|
|
460
|
+
indentUnit.of(options.indentWithTabs === false ? " ".repeat(indentWidth) : "\t"),
|
|
461
|
+
EditorState.tabSize.of(indentWidth),
|
|
462
|
+
(options.lineWrapping ?? true) ? EditorView.lineWrapping : [],
|
|
463
|
+
options.placeholder ? placeholder(options.placeholder) : [],
|
|
464
|
+
EditorView.editorAttributes.of({
|
|
465
|
+
class: "mira-codemirror mod-cm6",
|
|
466
|
+
"data-mira-readonly": readonly ? "true" : "false",
|
|
467
|
+
}),
|
|
468
|
+
keymap.of([
|
|
469
|
+
...closeBracketsKeymap,
|
|
470
|
+
...defaultKeymap,
|
|
471
|
+
...searchKeymap,
|
|
472
|
+
...historyKeymap,
|
|
473
|
+
...foldKeymap,
|
|
474
|
+
...completionKeymap,
|
|
475
|
+
...lintKeymap,
|
|
476
|
+
{
|
|
477
|
+
key: "Tab",
|
|
478
|
+
run: indentMore,
|
|
479
|
+
shift: indentLess,
|
|
480
|
+
},
|
|
481
|
+
]),
|
|
482
|
+
];
|
|
483
|
+
}
|
|
484
|
+
function normalizeIndentWidth(width) {
|
|
485
|
+
if (typeof width !== "number" || !Number.isFinite(width)) {
|
|
486
|
+
return 2;
|
|
487
|
+
}
|
|
488
|
+
return Math.max(1, Math.floor(width));
|
|
489
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/base/index.test.ts"],"names":[],"mappings":""}
|