@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,268 @@
|
|
|
1
|
+
import { EditorView } from "@codemirror/view";
|
|
2
|
+
export const miraRichEditorTheme = EditorView.theme({
|
|
3
|
+
".cm-foldGutter": {
|
|
4
|
+
display: "none",
|
|
5
|
+
},
|
|
6
|
+
".cm-line": {
|
|
7
|
+
position: "relative",
|
|
8
|
+
},
|
|
9
|
+
".cm-hmd-list-indent": {
|
|
10
|
+
display: "inline-flex",
|
|
11
|
+
whiteSpace: "pre",
|
|
12
|
+
},
|
|
13
|
+
".cm-indent": {
|
|
14
|
+
display: "inline-block",
|
|
15
|
+
position: "relative",
|
|
16
|
+
whiteSpace: "pre",
|
|
17
|
+
},
|
|
18
|
+
".cm-indent-guide::before": {
|
|
19
|
+
borderInlineStart: "var(--markdown-indentation-guide-width, var(--indentation-guide-width, 1px)) solid var(--markdown-indentation-guide-color, var(--indentation-guide-color, var(--mira-border)))",
|
|
20
|
+
content: "''",
|
|
21
|
+
insetBlock: "0",
|
|
22
|
+
insetInlineStart: "calc(50% - var(--markdown-indentation-guide-width, var(--indentation-guide-width, 1px)) / 2)",
|
|
23
|
+
pointerEvents: "none",
|
|
24
|
+
position: "absolute",
|
|
25
|
+
},
|
|
26
|
+
".cm-indent-guide.is-active::before": {
|
|
27
|
+
borderInlineStartColor: "var(--markdown-indentation-guide-color-active, var(--indentation-guide-color-active, var(--mira-border-strong)))",
|
|
28
|
+
borderInlineStartWidth: "var(--markdown-indentation-guide-width-active, var(--indentation-guide-width-active, 1px))",
|
|
29
|
+
},
|
|
30
|
+
".cm-plain-indent-widget": {
|
|
31
|
+
display: "inline-flex",
|
|
32
|
+
},
|
|
33
|
+
".mira-fold-indicator": {
|
|
34
|
+
alignItems: "center",
|
|
35
|
+
display: "inline-flex",
|
|
36
|
+
height: "1rem",
|
|
37
|
+
justifyContent: "center",
|
|
38
|
+
marginInlineEnd: "0.15rem",
|
|
39
|
+
marginInlineStart: "-1.15rem",
|
|
40
|
+
position: "relative",
|
|
41
|
+
verticalAlign: "-0.1rem",
|
|
42
|
+
width: "1rem",
|
|
43
|
+
},
|
|
44
|
+
".mira-fold-indicator__button": {
|
|
45
|
+
alignItems: "center",
|
|
46
|
+
background: "transparent",
|
|
47
|
+
border: "0",
|
|
48
|
+
borderRadius: "4px",
|
|
49
|
+
color: "var(--mira-muted-foreground)",
|
|
50
|
+
cursor: "pointer",
|
|
51
|
+
display: "inline-flex",
|
|
52
|
+
height: "1rem",
|
|
53
|
+
justifyContent: "center",
|
|
54
|
+
padding: "0",
|
|
55
|
+
width: "1rem",
|
|
56
|
+
},
|
|
57
|
+
".mira-fold-indicator__button:hover": {
|
|
58
|
+
background: "var(--mira-accent-soft)",
|
|
59
|
+
color: "var(--mira-foreground)",
|
|
60
|
+
},
|
|
61
|
+
".mira-fold-indicator__icon": {
|
|
62
|
+
display: "block",
|
|
63
|
+
height: "0.875rem",
|
|
64
|
+
transform: "rotate(0deg)",
|
|
65
|
+
transition: "transform 120ms ease",
|
|
66
|
+
width: "0.875rem",
|
|
67
|
+
},
|
|
68
|
+
".mira-fold-indicator__button[data-folded='true'] .mira-fold-indicator__icon": {
|
|
69
|
+
transform: "rotate(-90deg)",
|
|
70
|
+
},
|
|
71
|
+
// Collapse hidden marks only in live preview (Lapis richEditor scope).
|
|
72
|
+
"&.cm-live-preview .cm-formatting-hidden": {
|
|
73
|
+
color: "transparent",
|
|
74
|
+
display: "inline-block",
|
|
75
|
+
height: "0",
|
|
76
|
+
lineHeight: "0",
|
|
77
|
+
overflow: "hidden",
|
|
78
|
+
width: "0",
|
|
79
|
+
},
|
|
80
|
+
// Only hide the host editor caret — nested `.mod-inline` table cell
|
|
81
|
+
// editors live under the same scroller and must keep their cursor layer.
|
|
82
|
+
"&.mira-live-preview-hide-cursor > .cm-scroller > .cm-cursorLayer": {
|
|
83
|
+
visibility: "hidden",
|
|
84
|
+
},
|
|
85
|
+
".mira-rich-widget": {
|
|
86
|
+
background: "var(--mira-widget-background, transparent)",
|
|
87
|
+
boxSizing: "border-box",
|
|
88
|
+
color: "var(--mira-foreground)",
|
|
89
|
+
margin: "0",
|
|
90
|
+
overflow: "visible",
|
|
91
|
+
position: "relative",
|
|
92
|
+
},
|
|
93
|
+
".mira-rich-widget--block": {
|
|
94
|
+
cursor: "default",
|
|
95
|
+
maxWidth: "100%",
|
|
96
|
+
overflowWrap: "normal",
|
|
97
|
+
whiteSpace: "normal",
|
|
98
|
+
width: "100%",
|
|
99
|
+
wordBreak: "normal",
|
|
100
|
+
},
|
|
101
|
+
".mira-rich-widget__source-toggle": {
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
background: "var(--mira-popover)",
|
|
104
|
+
border: "1px solid var(--mira-border)",
|
|
105
|
+
borderRadius: "4px",
|
|
106
|
+
boxShadow: "var(--mira-widget-shadow)",
|
|
107
|
+
color: "var(--mira-muted-foreground)",
|
|
108
|
+
cursor: "pointer",
|
|
109
|
+
display: "inline-flex",
|
|
110
|
+
height: "1.5rem",
|
|
111
|
+
insetBlockStart: "0.25rem",
|
|
112
|
+
insetInlineEnd: "0.25rem",
|
|
113
|
+
justifyContent: "center",
|
|
114
|
+
lineHeight: "1",
|
|
115
|
+
opacity: "0",
|
|
116
|
+
padding: "0",
|
|
117
|
+
position: "absolute",
|
|
118
|
+
transition: "opacity 120ms ease, color 120ms ease",
|
|
119
|
+
width: "1.5rem",
|
|
120
|
+
zIndex: "10",
|
|
121
|
+
},
|
|
122
|
+
".mira-rich-widget__source-icon": {
|
|
123
|
+
height: "0.95rem",
|
|
124
|
+
width: "0.95rem",
|
|
125
|
+
},
|
|
126
|
+
".mira-rich-widget:hover .mira-rich-widget__source-toggle, .mira-rich-widget:focus-within .mira-rich-widget__source-toggle": {
|
|
127
|
+
opacity: "1",
|
|
128
|
+
},
|
|
129
|
+
".mira-rich-widget__source-toggle:hover": {
|
|
130
|
+
background: "var(--mira-accent-soft)",
|
|
131
|
+
color: "var(--mira-foreground)",
|
|
132
|
+
},
|
|
133
|
+
".mira-table-widget-shell": {
|
|
134
|
+
display: "inline-block",
|
|
135
|
+
maxWidth: "100%",
|
|
136
|
+
position: "relative",
|
|
137
|
+
},
|
|
138
|
+
".mira-table-widget__source-toggle": {
|
|
139
|
+
alignItems: "center",
|
|
140
|
+
background: "var(--mira-popover)",
|
|
141
|
+
border: "1px solid var(--mira-border)",
|
|
142
|
+
borderRadius: "4px",
|
|
143
|
+
boxShadow: "var(--mira-widget-shadow)",
|
|
144
|
+
color: "var(--mira-muted-foreground)",
|
|
145
|
+
cursor: "pointer",
|
|
146
|
+
display: "inline-flex",
|
|
147
|
+
height: "1.5rem",
|
|
148
|
+
insetBlockStart: "0.25rem",
|
|
149
|
+
insetInlineEnd: "0.25rem",
|
|
150
|
+
justifyContent: "center",
|
|
151
|
+
lineHeight: "1",
|
|
152
|
+
opacity: "0",
|
|
153
|
+
padding: "0",
|
|
154
|
+
position: "absolute",
|
|
155
|
+
transition: "opacity 120ms ease, color 120ms ease",
|
|
156
|
+
width: "1.5rem",
|
|
157
|
+
zIndex: "10",
|
|
158
|
+
},
|
|
159
|
+
".mira-table-widget-shell:hover .mira-table-widget__source-toggle, .mira-table-widget-shell:focus-within .mira-table-widget__source-toggle": {
|
|
160
|
+
opacity: "1",
|
|
161
|
+
},
|
|
162
|
+
".mira-table-widget__source-toggle svg": {
|
|
163
|
+
height: "0.95rem",
|
|
164
|
+
width: "0.95rem",
|
|
165
|
+
},
|
|
166
|
+
".mira-table-widget__source-toggle:hover": {
|
|
167
|
+
background: "var(--mira-accent-soft)",
|
|
168
|
+
color: "var(--mira-foreground)",
|
|
169
|
+
},
|
|
170
|
+
".mira-rich-widget .mira-markdown-preview": {
|
|
171
|
+
background: "transparent",
|
|
172
|
+
height: "auto",
|
|
173
|
+
margin: "0",
|
|
174
|
+
overflow: "visible",
|
|
175
|
+
padding: "0.1rem 0",
|
|
176
|
+
},
|
|
177
|
+
".mira-rich-widget .markdown-rendered, .mira-rich-widget .markdown-rendered > *": {
|
|
178
|
+
marginBlockEnd: "0",
|
|
179
|
+
marginBlockStart: "0",
|
|
180
|
+
},
|
|
181
|
+
".mira-rich-widget--table": {
|
|
182
|
+
borderColor: "transparent",
|
|
183
|
+
minHeight: "0 !important",
|
|
184
|
+
},
|
|
185
|
+
".mira-rich-widget--table:hover": {
|
|
186
|
+
borderColor: "transparent",
|
|
187
|
+
},
|
|
188
|
+
".cm-header": {
|
|
189
|
+
fontFamily: "var(--mira-font-sans)",
|
|
190
|
+
lineHeight: "var(--cm-block-line-height)",
|
|
191
|
+
},
|
|
192
|
+
".cm-header-1": {
|
|
193
|
+
"--cm-block-line-height": "var(--mira-h1-line-height, 1.2)",
|
|
194
|
+
color: "var(--mira-h1-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
195
|
+
fontFamily: "var(--mira-h1-font, var(--mira-font-sans))",
|
|
196
|
+
fontSize: "var(--mira-h1-size, 1.802em)",
|
|
197
|
+
fontStyle: "var(--mira-h1-style, normal)",
|
|
198
|
+
fontVariant: "var(--mira-h1-variant, normal)",
|
|
199
|
+
fontWeight: "var(--mira-h1-weight, 700)",
|
|
200
|
+
},
|
|
201
|
+
".cm-header-2": {
|
|
202
|
+
"--cm-block-line-height": "var(--mira-h2-line-height, 1.2)",
|
|
203
|
+
color: "var(--mira-h2-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
204
|
+
fontFamily: "var(--mira-h2-font, var(--mira-font-sans))",
|
|
205
|
+
fontSize: "var(--mira-h2-size, 1.602em)",
|
|
206
|
+
fontStyle: "var(--mira-h2-style, normal)",
|
|
207
|
+
fontVariant: "var(--mira-h2-variant, normal)",
|
|
208
|
+
fontWeight: "var(--mira-h2-weight, 600)",
|
|
209
|
+
},
|
|
210
|
+
".cm-header-3": {
|
|
211
|
+
"--cm-block-line-height": "var(--mira-h3-line-height, 1.3)",
|
|
212
|
+
color: "var(--mira-h3-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
213
|
+
fontFamily: "var(--mira-h3-font, var(--mira-font-sans))",
|
|
214
|
+
fontSize: "var(--mira-h3-size, 1.424em)",
|
|
215
|
+
fontStyle: "var(--mira-h3-style, normal)",
|
|
216
|
+
fontVariant: "var(--mira-h3-variant, normal)",
|
|
217
|
+
fontWeight: "var(--mira-h3-weight, 600)",
|
|
218
|
+
},
|
|
219
|
+
".cm-header-4": {
|
|
220
|
+
"--cm-block-line-height": "var(--mira-h4-line-height, 1.4)",
|
|
221
|
+
color: "var(--mira-h4-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
222
|
+
fontFamily: "var(--mira-h4-font, var(--mira-font-sans))",
|
|
223
|
+
fontSize: "var(--mira-h4-size, 1.266em)",
|
|
224
|
+
fontStyle: "var(--mira-h4-style, normal)",
|
|
225
|
+
fontVariant: "var(--mira-h4-variant, normal)",
|
|
226
|
+
fontWeight: "var(--mira-h4-weight, 600)",
|
|
227
|
+
},
|
|
228
|
+
".cm-header-5": {
|
|
229
|
+
"--cm-block-line-height": "var(--mira-h5-line-height, 1.5)",
|
|
230
|
+
color: "var(--mira-h5-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
231
|
+
fontFamily: "var(--mira-h5-font, var(--mira-font-sans))",
|
|
232
|
+
fontSize: "var(--mira-h5-size, 1.125em)",
|
|
233
|
+
fontStyle: "var(--mira-h5-style, normal)",
|
|
234
|
+
fontVariant: "var(--mira-h5-variant, normal)",
|
|
235
|
+
fontWeight: "var(--mira-h5-weight, 600)",
|
|
236
|
+
},
|
|
237
|
+
".cm-header-6": {
|
|
238
|
+
"--cm-block-line-height": "var(--mira-h6-line-height, 1.5)",
|
|
239
|
+
color: "var(--mira-h6-color, var(--mira-heading-color, var(--mira-foreground)))",
|
|
240
|
+
fontFamily: "var(--mira-h6-font, var(--mira-font-sans))",
|
|
241
|
+
fontSize: "var(--mira-h6-size, 1em)",
|
|
242
|
+
fontStyle: "var(--mira-h6-style, normal)",
|
|
243
|
+
fontVariant: "var(--mira-h6-variant, normal)",
|
|
244
|
+
fontWeight: "var(--mira-h6-weight, 600)",
|
|
245
|
+
},
|
|
246
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader": {
|
|
247
|
+
display: "inline-flex",
|
|
248
|
+
alignItems: "center",
|
|
249
|
+
},
|
|
250
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-1": {
|
|
251
|
+
"--cm-block-line-height": "var(--mira-h1-line-height, 1.2)",
|
|
252
|
+
},
|
|
253
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-2": {
|
|
254
|
+
"--cm-block-line-height": "var(--mira-h2-line-height, 1.2)",
|
|
255
|
+
},
|
|
256
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-3": {
|
|
257
|
+
"--cm-block-line-height": "var(--mira-h3-line-height, 1.3)",
|
|
258
|
+
},
|
|
259
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-4": {
|
|
260
|
+
"--cm-block-line-height": "var(--mira-h4-line-height, 1.4)",
|
|
261
|
+
},
|
|
262
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-5": {
|
|
263
|
+
"--cm-block-line-height": "var(--mira-h5-line-height, 1.5)",
|
|
264
|
+
},
|
|
265
|
+
".cm-gutters .cm-gutterElement.cm-gutterHeader-6": {
|
|
266
|
+
"--cm-block-line-height": "var(--mira-h6-line-height, 1.5)",
|
|
267
|
+
},
|
|
268
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { MiraAssetResolver, MiraExtension, MiraFileAdapter, MiraListCallout, MiraLinkResolver, MiraBlockAction, MiraBlockControlsOptions } from "@lapismd/mira/extensions";
|
|
2
|
+
import type { EditorView } from "@codemirror/view";
|
|
3
|
+
export type MiraRichEditorOptions = {
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
livePreview?: boolean;
|
|
6
|
+
readonly?: boolean;
|
|
7
|
+
blockControls?: boolean | MiraBlockControlsOptions;
|
|
8
|
+
blockActions?: MiraBlockAction[];
|
|
9
|
+
indentGuides?: boolean;
|
|
10
|
+
extensions?: MiraExtension[];
|
|
11
|
+
sourcePath?: string;
|
|
12
|
+
linkResolver?: MiraLinkResolver;
|
|
13
|
+
assetResolver?: MiraAssetResolver;
|
|
14
|
+
fileAdapter?: MiraFileAdapter;
|
|
15
|
+
frontmatterOpen?: boolean;
|
|
16
|
+
frontmatterConfig?: unknown;
|
|
17
|
+
listCallouts?: MiraListCallout[];
|
|
18
|
+
onChange?: (replacement: string, from: number, to: number, nextValue: string) => void;
|
|
19
|
+
onFrontmatterChange?: (nextYaml: string, nextValue: string) => void;
|
|
20
|
+
insertImage?: (view: EditorView) => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/internal/codemirror/rich/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,wBAAwB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,OAAO,GAAG,wBAAwB,CAAC;IACnD,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,UAAU,CAAC,EAAE,aAAa,EAAE,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;IACjC,QAAQ,CAAC,EAAE,CACT,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,SAAS,EAAE,MAAM,KACd,IAAI,CAAC;IACV,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;CAC1C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activation.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/activation.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,4BAA4B,QAc7B,CAAC;AAEb,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAcxE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const PREVIEW_INTERACTIVE_SELECTOR = [
|
|
2
|
+
"button",
|
|
3
|
+
"input",
|
|
4
|
+
"select",
|
|
5
|
+
"textarea",
|
|
6
|
+
"summary",
|
|
7
|
+
"details",
|
|
8
|
+
"audio",
|
|
9
|
+
"video",
|
|
10
|
+
"[contenteditable='true']",
|
|
11
|
+
"[role='button']",
|
|
12
|
+
"[role='checkbox']",
|
|
13
|
+
"[role='textbox']",
|
|
14
|
+
"[data-editable-markdown-ignore-click]",
|
|
15
|
+
].join(", ");
|
|
16
|
+
export function shouldActivateEditablePreview(event) {
|
|
17
|
+
if (event.defaultPrevented ||
|
|
18
|
+
event.button !== 0 ||
|
|
19
|
+
event.metaKey ||
|
|
20
|
+
event.ctrlKey ||
|
|
21
|
+
event.shiftKey ||
|
|
22
|
+
event.altKey) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
const target = event.target instanceof Element ? event.target : null;
|
|
26
|
+
return !target?.closest(PREVIEW_INTERACTIVE_SELECTOR);
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { syntaxTree } from "@codemirror/language";
|
|
2
|
+
import { type EditorState, type Extension } from "@codemirror/state";
|
|
3
|
+
import { type DecorationSet } from "@codemirror/view";
|
|
4
|
+
/** True for opening, body, and closing lines of a fenced code block. */
|
|
5
|
+
export declare function isFencedCodeLine(state: EditorState, lineNumber: number): boolean;
|
|
6
|
+
export declare function buildCodeBlockLineDecorations(state: EditorState, tree?: ReturnType<typeof syntaxTree>): DecorationSet;
|
|
7
|
+
export declare function codeBlockLineDecorations(): Extension;
|
|
8
|
+
//# sourceMappingURL=code-block-lines.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-lines.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/code-block-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,SAAS,EAEf,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,aAAa,EAKnB,MAAM,kBAAkB,CAAC;AA2E1B,wEAAwE;AACxE,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,WAAW,EAClB,UAAU,EAAE,MAAM,GACjB,OAAO,CAsBT;AAED,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,WAAW,EAClB,IAAI,GAAE,UAAU,CAAC,OAAO,UAAU,CAAqB,GACtD,aAAa,CAkEf;AAED,wBAAgB,wBAAwB,IAAI,SAAS,CAqBpD"}
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { syntaxTree } from "@codemirror/language";
|
|
2
|
+
import {} from "@codemirror/state";
|
|
3
|
+
import { Decoration, ViewPlugin, } from "@codemirror/view";
|
|
4
|
+
import { sortRanges } from "./ranges";
|
|
5
|
+
/**
|
|
6
|
+
* Fence chrome shared by source + live-preview (Lapis HyperMD classes plus
|
|
7
|
+
* `cm-formatting-code` / start / end). Widgets stay live-preview-only; these
|
|
8
|
+
* line classes keep background + rounded first/last lines with visible markers.
|
|
9
|
+
*/
|
|
10
|
+
function codeLineClasses(options) {
|
|
11
|
+
const classes = [
|
|
12
|
+
"HyperMD-codeblock",
|
|
13
|
+
"HyperMD-codeblock-bg",
|
|
14
|
+
"cm-formatting-code",
|
|
15
|
+
];
|
|
16
|
+
if (options.language === "text") {
|
|
17
|
+
classes.push("cm-formatting-code-language-text");
|
|
18
|
+
}
|
|
19
|
+
if (options.isStart) {
|
|
20
|
+
classes.push("cm-formatting-code-start");
|
|
21
|
+
}
|
|
22
|
+
if (options.isEnd) {
|
|
23
|
+
classes.push("cm-formatting-code-end");
|
|
24
|
+
}
|
|
25
|
+
return classes.join(" ");
|
|
26
|
+
}
|
|
27
|
+
function indentedCodeLineClasses(options) {
|
|
28
|
+
return [
|
|
29
|
+
"HyperMD-codeblock",
|
|
30
|
+
"HyperMD-codeblock-bg",
|
|
31
|
+
"cm-indented-codeblock",
|
|
32
|
+
options.isStart ? "cm-indented-codeblock-start" : "",
|
|
33
|
+
options.isEnd ? "cm-indented-codeblock-end" : "",
|
|
34
|
+
]
|
|
35
|
+
.filter(Boolean)
|
|
36
|
+
.join(" ");
|
|
37
|
+
}
|
|
38
|
+
function readOpeningFence(lineText) {
|
|
39
|
+
const opening = lineText.match(/^\s*(`{3,}|~{3,})\s*([^\s`]*)/u);
|
|
40
|
+
if (!opening?.[1]) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
character: opening[1][0],
|
|
45
|
+
language: (opening[2] ?? "").toLocaleLowerCase(),
|
|
46
|
+
length: opening[1].length,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function isClosingFence(lineText, active) {
|
|
50
|
+
const closing = lineText.match(/^\s*(`{3,}|~{3,})\s*$/u)?.[1];
|
|
51
|
+
return Boolean(closing &&
|
|
52
|
+
closing[0] === active.character &&
|
|
53
|
+
closing.length >= active.length);
|
|
54
|
+
}
|
|
55
|
+
/** True for opening, body, and closing lines of a fenced code block. */
|
|
56
|
+
export function isFencedCodeLine(state, lineNumber) {
|
|
57
|
+
let active;
|
|
58
|
+
for (let number = 1; number <= lineNumber; number += 1) {
|
|
59
|
+
const line = state.doc.line(number);
|
|
60
|
+
const wasActive = Boolean(active);
|
|
61
|
+
if (!active) {
|
|
62
|
+
const opening = readOpeningFence(line.text);
|
|
63
|
+
if (!opening) {
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
active = { ...opening, startNumber: number };
|
|
67
|
+
}
|
|
68
|
+
if (number === lineNumber) {
|
|
69
|
+
return true;
|
|
70
|
+
}
|
|
71
|
+
if (wasActive && isClosingFence(line.text, active)) {
|
|
72
|
+
active = undefined;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return false;
|
|
76
|
+
}
|
|
77
|
+
export function buildCodeBlockLineDecorations(state, tree = syntaxTree(state)) {
|
|
78
|
+
const decorations = [];
|
|
79
|
+
let active;
|
|
80
|
+
for (let number = 1; number <= state.doc.lines; number += 1) {
|
|
81
|
+
const line = state.doc.line(number);
|
|
82
|
+
const wasActive = Boolean(active);
|
|
83
|
+
if (!active) {
|
|
84
|
+
const opening = readOpeningFence(line.text);
|
|
85
|
+
if (!opening) {
|
|
86
|
+
continue;
|
|
87
|
+
}
|
|
88
|
+
active = { ...opening, startNumber: number };
|
|
89
|
+
}
|
|
90
|
+
const isClosing = wasActive && isClosingFence(line.text, active);
|
|
91
|
+
decorations.push(Decoration.line({
|
|
92
|
+
class: codeLineClasses({
|
|
93
|
+
language: active.language,
|
|
94
|
+
isStart: number === active.startNumber,
|
|
95
|
+
isEnd: isClosing,
|
|
96
|
+
}),
|
|
97
|
+
}).range(line.from));
|
|
98
|
+
if (isClosing) {
|
|
99
|
+
active = undefined;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
const decoratedIndentedLines = new Set();
|
|
103
|
+
tree.iterate({
|
|
104
|
+
from: 0,
|
|
105
|
+
to: state.doc.length,
|
|
106
|
+
enter(node) {
|
|
107
|
+
if (node.name !== "CodeBlock" || node.from >= node.to) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
const start = state.doc.lineAt(node.from);
|
|
111
|
+
const end = state.doc.lineAt(Math.max(node.from, node.to - 1));
|
|
112
|
+
for (let lineNumber = start.number; lineNumber <= end.number; lineNumber += 1) {
|
|
113
|
+
if (decoratedIndentedLines.has(lineNumber)) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
decoratedIndentedLines.add(lineNumber);
|
|
117
|
+
const line = state.doc.line(lineNumber);
|
|
118
|
+
decorations.push(Decoration.line({
|
|
119
|
+
class: indentedCodeLineClasses({
|
|
120
|
+
isStart: lineNumber === start.number,
|
|
121
|
+
isEnd: lineNumber === end.number,
|
|
122
|
+
}),
|
|
123
|
+
}).range(line.from));
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
return Decoration.set(sortRanges(decorations));
|
|
128
|
+
}
|
|
129
|
+
export function codeBlockLineDecorations() {
|
|
130
|
+
return ViewPlugin.fromClass(class {
|
|
131
|
+
decorations;
|
|
132
|
+
constructor(view) {
|
|
133
|
+
this.decorations = buildCodeBlockLineDecorations(view.state);
|
|
134
|
+
}
|
|
135
|
+
update(update) {
|
|
136
|
+
if (update.docChanged ||
|
|
137
|
+
update.viewportChanged ||
|
|
138
|
+
syntaxTree(update.startState) !== syntaxTree(update.state)) {
|
|
139
|
+
this.decorations = buildCodeBlockLineDecorations(update.state);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
}, { decorations: (plugin) => plugin.decorations });
|
|
143
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-block-lines.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/code-block-lines.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ensureSyntaxTree } from "@codemirror/language";
|
|
2
|
+
import { markdown } from "@codemirror/lang-markdown";
|
|
3
|
+
import { EditorState } from "@codemirror/state";
|
|
4
|
+
import { describe, expect, it } from "vitest";
|
|
5
|
+
import { buildCodeBlockLineDecorations, isFencedCodeLine, } from "./code-block-lines";
|
|
6
|
+
function lineClasses(source) {
|
|
7
|
+
const state = EditorState.create({
|
|
8
|
+
doc: source,
|
|
9
|
+
});
|
|
10
|
+
const classes = [];
|
|
11
|
+
buildCodeBlockLineDecorations(state).between(0, state.doc.length, (_from, _to, decoration) => {
|
|
12
|
+
if (decoration.spec.class) {
|
|
13
|
+
classes.push(decoration.spec.class);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
return classes;
|
|
17
|
+
}
|
|
18
|
+
describe("code block line decorations", () => {
|
|
19
|
+
it("marks every explicit text-fence line for source no-wrap geometry", () => {
|
|
20
|
+
const classes = lineClasses(["```text", "A very long text diagram line", "```"].join("\n"));
|
|
21
|
+
expect(classes).toHaveLength(3);
|
|
22
|
+
expect(classes).toEqual([
|
|
23
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code cm-formatting-code-language-text cm-formatting-code-start",
|
|
24
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code cm-formatting-code-language-text",
|
|
25
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code cm-formatting-code-language-text cm-formatting-code-end",
|
|
26
|
+
]);
|
|
27
|
+
});
|
|
28
|
+
it("keeps other fenced languages with code chrome and start/end radius hooks", () => {
|
|
29
|
+
const classes = lineClasses("```mermaid\nflowchart LR\n```");
|
|
30
|
+
expect(classes).toEqual([
|
|
31
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code cm-formatting-code-start",
|
|
32
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code",
|
|
33
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-formatting-code cm-formatting-code-end",
|
|
34
|
+
]);
|
|
35
|
+
});
|
|
36
|
+
it("detects fenced body lines for indent suppression", () => {
|
|
37
|
+
const state = EditorState.create({
|
|
38
|
+
doc: ["~~~mermaid", " Source --> LivePreview", "~~~", " outside"].join("\n"),
|
|
39
|
+
});
|
|
40
|
+
expect(isFencedCodeLine(state, 1)).toBe(true);
|
|
41
|
+
expect(isFencedCodeLine(state, 2)).toBe(true);
|
|
42
|
+
expect(isFencedCodeLine(state, 3)).toBe(true);
|
|
43
|
+
expect(isFencedCodeLine(state, 4)).toBe(false);
|
|
44
|
+
});
|
|
45
|
+
it("marks an indented code block as one continuous block", () => {
|
|
46
|
+
const source = [
|
|
47
|
+
"4. Preformatted text in a list item:",
|
|
48
|
+
"",
|
|
49
|
+
" First preformatted line",
|
|
50
|
+
" Second preformatted line",
|
|
51
|
+
].join("\n");
|
|
52
|
+
const state = EditorState.create({
|
|
53
|
+
doc: source,
|
|
54
|
+
extensions: [markdown()],
|
|
55
|
+
});
|
|
56
|
+
const classes = lineClassesWithState(state);
|
|
57
|
+
expect(classes).toEqual([
|
|
58
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-indented-codeblock cm-indented-codeblock-start",
|
|
59
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-indented-codeblock cm-indented-codeblock-end",
|
|
60
|
+
]);
|
|
61
|
+
});
|
|
62
|
+
it("gives a one-line indented code block both edge hooks", () => {
|
|
63
|
+
const state = EditorState.create({
|
|
64
|
+
doc: " one line of preformatted code",
|
|
65
|
+
extensions: [markdown()],
|
|
66
|
+
});
|
|
67
|
+
expect(lineClassesWithState(state)).toEqual([
|
|
68
|
+
"HyperMD-codeblock HyperMD-codeblock-bg cm-indented-codeblock cm-indented-codeblock-start cm-indented-codeblock-end",
|
|
69
|
+
]);
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
function lineClassesWithState(state) {
|
|
73
|
+
const classes = [];
|
|
74
|
+
const tree = ensureSyntaxTree(state, state.doc.length, 100);
|
|
75
|
+
expect(tree).not.toBeNull();
|
|
76
|
+
buildCodeBlockLineDecorations(state, tree).between(0, state.doc.length, (_from, _to, decoration) => {
|
|
77
|
+
if (decoration.spec.class) {
|
|
78
|
+
classes.push(decoration.spec.class);
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
return classes;
|
|
82
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fenced-code.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/fenced-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAG9D;AAED,wBAAgB,wBAAwB,CACtC,QAAQ,EAAE,MAAM,GACf,aAAa,GAAG,IAAI,CAsBtB"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export function getFencedCodeLanguage(markdown) {
|
|
2
|
+
const match = markdown.match(/^(```|~~~)\s*([^\s`]*)/);
|
|
3
|
+
return match?.[2]?.trim() ?? "";
|
|
4
|
+
}
|
|
5
|
+
export function getFencedCodeWidgetRange(markdown) {
|
|
6
|
+
const opening = markdown.match(/^(```|~~~)[^\n]*(?:\n|$)/);
|
|
7
|
+
if (!opening) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
const fence = opening[1] ?? "";
|
|
11
|
+
if (!fence) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
const closingIndex = markdown.lastIndexOf(`\n${fence}`);
|
|
15
|
+
if (closingIndex <= 0) {
|
|
16
|
+
return {
|
|
17
|
+
from: 0,
|
|
18
|
+
to: markdown.length,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
from: 0,
|
|
23
|
+
to: closingIndex + fence.length + 1,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fenced-code.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/fenced-code.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { getFencedCodeLanguage, getFencedCodeWidgetRange } from "./fenced-code";
|
|
3
|
+
describe("fenced code helpers", () => {
|
|
4
|
+
it("detects fenced code language and replacement range", () => {
|
|
5
|
+
const markdown = "```mermaid\ngraph TD\n A --> B\n```\n";
|
|
6
|
+
expect(getFencedCodeLanguage(markdown)).toBe("mermaid");
|
|
7
|
+
expect(getFencedCodeWidgetRange(markdown)).toEqual({
|
|
8
|
+
from: 0,
|
|
9
|
+
to: markdown.trimEnd().length,
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
});
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { EditorState } from "@codemirror/state";
|
|
2
|
+
import type { RangeBoundary } from "./ranges";
|
|
3
|
+
export declare function getAtxHeadingMarkerRange(text: string, lineStart: number): RangeBoundary | null;
|
|
4
|
+
export declare function selectionTouchesLine(state: EditorState, lineStart: number, lineEnd: number): boolean;
|
|
5
|
+
//# sourceMappingURL=headings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"headings.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/headings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,MAAM,GAChB,aAAa,GAAG,IAAI,CAYtB;AAED,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,WAAW,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,GACd,OAAO,CAQT"}
|