@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,435 @@
|
|
|
1
|
+
import { ensureSyntaxTree, syntaxTree } from "@codemirror/language";
|
|
2
|
+
import {} from "@codemirror/state";
|
|
3
|
+
import { Decoration, EditorView, ViewPlugin, WidgetType, } from "@codemirror/view";
|
|
4
|
+
import { isFencedCodeLine } from "./code-block-lines";
|
|
5
|
+
import { sortRanges } from "./ranges";
|
|
6
|
+
const INDENT_UNIT = 4;
|
|
7
|
+
export function toMarkdownColumns(text) {
|
|
8
|
+
let columns = 0;
|
|
9
|
+
for (const char of text) {
|
|
10
|
+
if (char === "\t") {
|
|
11
|
+
columns += INDENT_UNIT - (columns % INDENT_UNIT || 0);
|
|
12
|
+
continue;
|
|
13
|
+
}
|
|
14
|
+
columns += 1;
|
|
15
|
+
}
|
|
16
|
+
return columns;
|
|
17
|
+
}
|
|
18
|
+
export function normalizeIndentText(text) {
|
|
19
|
+
let columns = 0;
|
|
20
|
+
let normalized = "";
|
|
21
|
+
for (const char of text) {
|
|
22
|
+
if (char === "\t") {
|
|
23
|
+
const tabWidth = INDENT_UNIT - (columns % INDENT_UNIT || 0);
|
|
24
|
+
normalized += " ".repeat(tabWidth);
|
|
25
|
+
columns += tabWidth;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
normalized += char;
|
|
29
|
+
columns += 1;
|
|
30
|
+
}
|
|
31
|
+
return normalized;
|
|
32
|
+
}
|
|
33
|
+
export function splitIndentSegments(indentText) {
|
|
34
|
+
const normalized = normalizeIndentText(indentText);
|
|
35
|
+
const segments = [];
|
|
36
|
+
for (let index = 0; index < normalized.length; index += INDENT_UNIT) {
|
|
37
|
+
const text = normalized.slice(index, index + INDENT_UNIT);
|
|
38
|
+
segments.push({ text, guide: text.length === INDENT_UNIT });
|
|
39
|
+
}
|
|
40
|
+
return segments;
|
|
41
|
+
}
|
|
42
|
+
export function getLineIndentInfo(lineText) {
|
|
43
|
+
const listMatch = lineText.match(/^(\s*)([-*+]|\d+[.)])\s+/);
|
|
44
|
+
if (listMatch) {
|
|
45
|
+
const indentText = listMatch[1] ?? "";
|
|
46
|
+
const columns = toMarkdownColumns(indentText);
|
|
47
|
+
return {
|
|
48
|
+
columns,
|
|
49
|
+
depth: Math.max(1, Math.floor(columns / INDENT_UNIT) + 1),
|
|
50
|
+
kind: /^\d/u.test(listMatch[2] ?? "") ? "ol" : "ul",
|
|
51
|
+
text: indentText,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
const plainMatch = lineText.match(/^(\s+)(?=\S)/);
|
|
55
|
+
if (!plainMatch) {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
const indentText = plainMatch[1] ?? "";
|
|
59
|
+
const columns = toMarkdownColumns(indentText);
|
|
60
|
+
if (columns < 1) {
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
columns,
|
|
65
|
+
depth: Math.max(1, Math.ceil(columns / INDENT_UNIT)),
|
|
66
|
+
kind: "plain",
|
|
67
|
+
text: indentText,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
export function selectionTouchesIndent(selectionFrom, selectionTo, indentFrom, indentTo) {
|
|
71
|
+
if (selectionFrom === selectionTo) {
|
|
72
|
+
return selectionFrom >= indentFrom && selectionFrom <= indentTo;
|
|
73
|
+
}
|
|
74
|
+
return selectionFrom < indentTo && selectionTo > indentFrom;
|
|
75
|
+
}
|
|
76
|
+
export function shouldRenderStyledUnorderedMarker(livePreview, cursorFrom, markerFrom) {
|
|
77
|
+
return (livePreview && cursorFrom !== markerFrom && cursorFrom !== markerFrom + 1);
|
|
78
|
+
}
|
|
79
|
+
export function getIndentLineLayout(lineText) {
|
|
80
|
+
const leading = lineText.match(/^\s*/u)?.[0] ?? "";
|
|
81
|
+
const quote = lineText.slice(leading.length).match(/^(?:>\s*)+/u)?.[0] ?? "";
|
|
82
|
+
const structuredOffset = leading.length + quote.length;
|
|
83
|
+
const list = lineText.slice(structuredOffset).match(/^([-*+]|\d+[.)])(\s+)/u);
|
|
84
|
+
if (list) {
|
|
85
|
+
const marker = `${list[1] ?? ""}${list[2] ?? ""}`;
|
|
86
|
+
const markerFrom = structuredOffset;
|
|
87
|
+
const markerTo = markerFrom + marker.length;
|
|
88
|
+
const task = lineText.slice(markerTo).match(/^(\[[^\]]\]\s+)/u)?.[0] ?? "";
|
|
89
|
+
const prefixTo = markerTo + task.length;
|
|
90
|
+
const indentColumns = toMarkdownColumns(leading);
|
|
91
|
+
const listKind = /^\d/u.test(list[1] ?? "") ? "ol" : "ul";
|
|
92
|
+
return {
|
|
93
|
+
contentFrom: prefixTo,
|
|
94
|
+
depth: Math.max(1, Math.floor(indentColumns / INDENT_UNIT) + 1),
|
|
95
|
+
fallbackColumns: toMarkdownColumns(lineText.slice(0, prefixTo)),
|
|
96
|
+
guideCount: Math.max(0, Math.floor(indentColumns / INDENT_UNIT)),
|
|
97
|
+
indentColumns,
|
|
98
|
+
indentText: leading,
|
|
99
|
+
kind: quote ? "quote-list" : listKind,
|
|
100
|
+
listKind,
|
|
101
|
+
markerFrom,
|
|
102
|
+
markerTo,
|
|
103
|
+
...(quote
|
|
104
|
+
? {
|
|
105
|
+
quoteFrom: leading.length,
|
|
106
|
+
quoteTo: structuredOffset,
|
|
107
|
+
}
|
|
108
|
+
: {}),
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (quote) {
|
|
112
|
+
const prefixTo = structuredOffset;
|
|
113
|
+
return {
|
|
114
|
+
contentFrom: prefixTo,
|
|
115
|
+
depth: 1,
|
|
116
|
+
fallbackColumns: toMarkdownColumns(lineText.slice(0, prefixTo)),
|
|
117
|
+
guideCount: Math.max(0, Math.floor(toMarkdownColumns(leading) / INDENT_UNIT)),
|
|
118
|
+
indentColumns: toMarkdownColumns(leading),
|
|
119
|
+
// Lapis list/plain-indent only replace leading whitespace; `>` stays
|
|
120
|
+
// visible until live-preview rich decorations style/hide it.
|
|
121
|
+
indentText: leading,
|
|
122
|
+
kind: "quote",
|
|
123
|
+
quoteFrom: leading.length,
|
|
124
|
+
quoteTo: prefixTo,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
const plain = getLineIndentInfo(lineText);
|
|
128
|
+
if (!plain || plain.kind !== "plain") {
|
|
129
|
+
return null;
|
|
130
|
+
}
|
|
131
|
+
return {
|
|
132
|
+
contentFrom: plain.text.length,
|
|
133
|
+
depth: plain.depth,
|
|
134
|
+
fallbackColumns: plain.columns,
|
|
135
|
+
guideCount: Math.max(0, Math.floor(plain.columns / INDENT_UNIT)),
|
|
136
|
+
indentColumns: plain.columns,
|
|
137
|
+
indentText: plain.text,
|
|
138
|
+
kind: "plain",
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function fallbackLength(columns, adjustment) {
|
|
142
|
+
if (columns <= 0 && !adjustment) {
|
|
143
|
+
return "";
|
|
144
|
+
}
|
|
145
|
+
return adjustment
|
|
146
|
+
? `calc(${Math.max(columns, 0)}ch + ${adjustment})`
|
|
147
|
+
: `${columns}ch`;
|
|
148
|
+
}
|
|
149
|
+
function unorderedMarkerAdjustment(markerColumns) {
|
|
150
|
+
return `var(--hmd-unordered-list-marker-slot-width, ${Math.max(markerColumns, 0)}ch) - ${Math.max(markerColumns, 0)}ch`;
|
|
151
|
+
}
|
|
152
|
+
function widgetFallbackLength(layout, adjustment) {
|
|
153
|
+
const segmentCount = splitIndentSegments(layout.indentText).length;
|
|
154
|
+
if (segmentCount === 0) {
|
|
155
|
+
return fallbackLength(layout.fallbackColumns, adjustment);
|
|
156
|
+
}
|
|
157
|
+
const parts = Array.from({ length: segmentCount }, () => "var(--list-indent)");
|
|
158
|
+
const suffixColumns = Math.max(layout.fallbackColumns - layout.indentColumns, 0);
|
|
159
|
+
if (suffixColumns > 0) {
|
|
160
|
+
parts.push(`${suffixColumns}ch`);
|
|
161
|
+
}
|
|
162
|
+
if (adjustment) {
|
|
163
|
+
parts.push(adjustment);
|
|
164
|
+
}
|
|
165
|
+
return parts.length === 1 ? parts[0] : `calc(${parts.join(" + ")})`;
|
|
166
|
+
}
|
|
167
|
+
function buildIndentStyle(layout, anchor, usesUnorderedMarkerSlot) {
|
|
168
|
+
const markerColumns = layout.markerFrom === undefined || layout.markerTo === undefined
|
|
169
|
+
? 0
|
|
170
|
+
: layout.markerTo - layout.markerFrom;
|
|
171
|
+
const listMarkerAdjustment = layout.listKind === "ul" && usesUnorderedMarkerSlot
|
|
172
|
+
? unorderedMarkerAdjustment(markerColumns)
|
|
173
|
+
: undefined;
|
|
174
|
+
const paddingFallback = fallbackLength(anchor?.fallbackPaddingColumns ?? layout.fallbackColumns, anchor?.fallbackPaddingAdjustment ?? listMarkerAdjustment);
|
|
175
|
+
const prefixFallback = fallbackLength(layout.fallbackColumns, listMarkerAdjustment);
|
|
176
|
+
const widgetPrefixFallback = widgetFallbackLength(layout, listMarkerAdjustment);
|
|
177
|
+
return [
|
|
178
|
+
layout.guideCount > 0 ? `--indent-guide-count: ${layout.guideCount};` : "",
|
|
179
|
+
anchor?.guideOffset || layout.listKind === "ul"
|
|
180
|
+
? `--hmd-indent-guide-offset: ${anchor?.guideOffset ?? "var(--hmd-unordered-list-marker-guide-offset, 0px)"};`
|
|
181
|
+
: "",
|
|
182
|
+
paddingFallback ? `--hmd-indent-padding-fallback: ${paddingFallback};` : "",
|
|
183
|
+
prefixFallback ? `--hmd-indent-prefix-fallback: ${prefixFallback};` : "",
|
|
184
|
+
widgetPrefixFallback
|
|
185
|
+
? `--hmd-indent-widget-prefix-fallback: ${widgetPrefixFallback};`
|
|
186
|
+
: "",
|
|
187
|
+
]
|
|
188
|
+
.filter(Boolean)
|
|
189
|
+
.join(" ");
|
|
190
|
+
}
|
|
191
|
+
class IndentGuideWidget extends WidgetType {
|
|
192
|
+
segments;
|
|
193
|
+
plain;
|
|
194
|
+
constructor(segments, plain) {
|
|
195
|
+
super();
|
|
196
|
+
this.segments = segments;
|
|
197
|
+
this.plain = plain;
|
|
198
|
+
}
|
|
199
|
+
eq(other) {
|
|
200
|
+
return (this.plain === other.plain &&
|
|
201
|
+
JSON.stringify(this.segments) === JSON.stringify(other.segments));
|
|
202
|
+
}
|
|
203
|
+
toDOM() {
|
|
204
|
+
const guideCount = this.segments.filter((segment) => segment.guide).length;
|
|
205
|
+
const root = document.createElement("span");
|
|
206
|
+
root.className = [
|
|
207
|
+
"cm-hmd-list-indent",
|
|
208
|
+
`cm-hmd-list-indent-${guideCount}`,
|
|
209
|
+
this.plain ? "cm-plain-indent-widget" : "",
|
|
210
|
+
]
|
|
211
|
+
.filter(Boolean)
|
|
212
|
+
.join(" ");
|
|
213
|
+
root.setAttribute("aria-hidden", "true");
|
|
214
|
+
for (const segment of this.segments) {
|
|
215
|
+
const indent = document.createElement("span");
|
|
216
|
+
indent.className = [
|
|
217
|
+
"cm-indent",
|
|
218
|
+
segment.guide ? "cm-indent-guide" : "cm-indent-spacer",
|
|
219
|
+
].join(" ");
|
|
220
|
+
indent.textContent = segment.text;
|
|
221
|
+
root.append(indent);
|
|
222
|
+
}
|
|
223
|
+
return root;
|
|
224
|
+
}
|
|
225
|
+
ignoreEvent() {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
export function indentGuideDecorations(options = {}) {
|
|
230
|
+
const livePreview = options.livePreview ?? true;
|
|
231
|
+
return ViewPlugin.fromClass(class {
|
|
232
|
+
decorations;
|
|
233
|
+
constructor(view) {
|
|
234
|
+
this.decorations = this.createDecorations(view);
|
|
235
|
+
}
|
|
236
|
+
update(update) {
|
|
237
|
+
if (update.docChanged ||
|
|
238
|
+
update.viewportChanged ||
|
|
239
|
+
update.selectionSet ||
|
|
240
|
+
update.focusChanged) {
|
|
241
|
+
this.decorations = this.createDecorations(update.view);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
createDecorations(view) {
|
|
245
|
+
const decorations = [];
|
|
246
|
+
const cursor = view.state.selection.main;
|
|
247
|
+
for (const { from, to } of view.visibleRanges) {
|
|
248
|
+
let line = view.state.doc.lineAt(from);
|
|
249
|
+
while (line.from <= to) {
|
|
250
|
+
const layout = getIndentLineLayout(line.text);
|
|
251
|
+
if (layout && isMarkdownIndentLine(view, line, layout)) {
|
|
252
|
+
// Pure quote chrome (`>`, blockquote border) is live-preview-only
|
|
253
|
+
// in Lapis (RichEditPlugin). Source keeps literal `>` text.
|
|
254
|
+
if (!livePreview && layout.kind === "quote") {
|
|
255
|
+
if (line.number >= view.state.doc.lines) {
|
|
256
|
+
break;
|
|
257
|
+
}
|
|
258
|
+
line = view.state.doc.line(line.number + 1);
|
|
259
|
+
continue;
|
|
260
|
+
}
|
|
261
|
+
const indentTo = line.from + layout.indentText.length;
|
|
262
|
+
const anchor = layout.kind === "plain"
|
|
263
|
+
? findPlainIndentAnchor(view, line, layout.indentColumns, livePreview)
|
|
264
|
+
: null;
|
|
265
|
+
const quoteChrome = livePreview &&
|
|
266
|
+
(layout.kind === "quote" || layout.kind === "quote-list");
|
|
267
|
+
decorations.push(Decoration.line({
|
|
268
|
+
attributes: {
|
|
269
|
+
"data-indent-prefix": layout.indentText,
|
|
270
|
+
"data-indent-fallback-columns": `${layout.fallbackColumns}`,
|
|
271
|
+
"data-indent-variant": layout.kind,
|
|
272
|
+
"data-line-from": `${line.from}`,
|
|
273
|
+
"data-list-depth": `${layout.depth}`,
|
|
274
|
+
...(layout.listKind
|
|
275
|
+
? { "data-list-kind": layout.listKind }
|
|
276
|
+
: {}),
|
|
277
|
+
...(anchor
|
|
278
|
+
? {
|
|
279
|
+
"data-indent-anchor-line-from": `${anchor.lineFrom}`,
|
|
280
|
+
}
|
|
281
|
+
: {}),
|
|
282
|
+
style: buildIndentStyle(layout, anchor, livePreview),
|
|
283
|
+
},
|
|
284
|
+
class: [
|
|
285
|
+
"indented-wrapped-line",
|
|
286
|
+
layout.kind === "plain" ? "cm-plain-indent-line" : "",
|
|
287
|
+
quoteChrome ? "cm-blockquote" : "",
|
|
288
|
+
layout.listKind || layout.kind === "plain"
|
|
289
|
+
? "HyperMD-list-line"
|
|
290
|
+
: "",
|
|
291
|
+
layout.listKind || layout.kind === "plain"
|
|
292
|
+
? `HyperMD-list-line-${layout.depth}`
|
|
293
|
+
: "",
|
|
294
|
+
!layout.listKind ? "cm-formatting" : "",
|
|
295
|
+
layout.kind === "plain" ? "cm-formatting-list" : "",
|
|
296
|
+
layout.kind === "plain" ? "cm-formatting-list-ul" : "",
|
|
297
|
+
layout.kind === "plain" ? `cm-list-${layout.depth}` : "",
|
|
298
|
+
]
|
|
299
|
+
.filter(Boolean)
|
|
300
|
+
.join(" "),
|
|
301
|
+
}).range(line.from));
|
|
302
|
+
if (layout.indentText.length > 0 &&
|
|
303
|
+
!selectionTouchesIndent(cursor.from, cursor.to, line.from, indentTo)) {
|
|
304
|
+
decorations.push(Decoration.replace({
|
|
305
|
+
widget: new IndentGuideWidget(splitIndentSegments(layout.indentText), layout.kind === "plain"),
|
|
306
|
+
}).range(line.from, indentTo));
|
|
307
|
+
}
|
|
308
|
+
if (layout.markerFrom !== undefined &&
|
|
309
|
+
layout.markerTo !== undefined) {
|
|
310
|
+
const markerFrom = line.from + layout.markerFrom;
|
|
311
|
+
const styledUnorderedMarker = layout.listKind === "ul" &&
|
|
312
|
+
shouldRenderStyledUnorderedMarker(livePreview, cursor.from, markerFrom);
|
|
313
|
+
decorations.push(Decoration.mark({
|
|
314
|
+
class: [
|
|
315
|
+
"cm-formatting",
|
|
316
|
+
"cm-formatting-list",
|
|
317
|
+
layout.listKind === "ol"
|
|
318
|
+
? "cm-formatting-list-ol"
|
|
319
|
+
: "cm-formatting-list-ul",
|
|
320
|
+
`cm-list-${layout.depth}`,
|
|
321
|
+
styledUnorderedMarker ? "cm-formatting-list-bullet" : "",
|
|
322
|
+
]
|
|
323
|
+
.filter(Boolean)
|
|
324
|
+
.join(" "),
|
|
325
|
+
}).range(markerFrom, line.from + layout.markerTo));
|
|
326
|
+
}
|
|
327
|
+
if (livePreview &&
|
|
328
|
+
layout.quoteFrom !== undefined &&
|
|
329
|
+
layout.quoteTo !== undefined) {
|
|
330
|
+
const quoteDepth = (line.text
|
|
331
|
+
.slice(layout.quoteFrom, layout.quoteTo)
|
|
332
|
+
.match(/>/gu) ?? []).length;
|
|
333
|
+
decorations.push(Decoration.mark({
|
|
334
|
+
class: [
|
|
335
|
+
"cm-formatting-quote",
|
|
336
|
+
`cm-formatting-quote-${quoteDepth}`,
|
|
337
|
+
"cm-quote",
|
|
338
|
+
`cm-quote-${quoteDepth}`,
|
|
339
|
+
quoteDepth > 1 ? "cm-blockquote-border" : "",
|
|
340
|
+
]
|
|
341
|
+
.filter(Boolean)
|
|
342
|
+
.join(" "),
|
|
343
|
+
}).range(line.from + layout.quoteFrom, line.from + layout.quoteTo));
|
|
344
|
+
}
|
|
345
|
+
if (layout.contentFrom < line.text.length) {
|
|
346
|
+
decorations.push(Decoration.mark({
|
|
347
|
+
class: `cm-list-${layout.depth}`,
|
|
348
|
+
}).range(line.from + layout.contentFrom, line.to));
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
if (line.number >= view.state.doc.lines) {
|
|
352
|
+
break;
|
|
353
|
+
}
|
|
354
|
+
line = view.state.doc.line(line.number + 1);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
return Decoration.set(sortRanges(decorations));
|
|
358
|
+
}
|
|
359
|
+
}, {
|
|
360
|
+
decorations: (plugin) => plugin.decorations,
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function isMarkdownIndentLine(view, line, layout) {
|
|
364
|
+
// Fenced code keeps literal leading whitespace + the shared 24px fence
|
|
365
|
+
// padding. Hanging-indent chrome here pulls lines left of that padding
|
|
366
|
+
// until the cursor sits on the indent and clears the replace widget.
|
|
367
|
+
if (isFencedCodeLine(view.state, line.number)) {
|
|
368
|
+
return false;
|
|
369
|
+
}
|
|
370
|
+
if (!layout.listKind && layout.kind !== "quote") {
|
|
371
|
+
return true;
|
|
372
|
+
}
|
|
373
|
+
let list = false;
|
|
374
|
+
let quote = false;
|
|
375
|
+
const tree = ensureSyntaxTree(view.state, line.to, 25) ?? syntaxTree(view.state);
|
|
376
|
+
tree.iterate({
|
|
377
|
+
from: line.from,
|
|
378
|
+
to: line.to,
|
|
379
|
+
enter(node) {
|
|
380
|
+
list ||= node.name === "ListMark";
|
|
381
|
+
quote ||= node.name === "QuoteMark";
|
|
382
|
+
},
|
|
383
|
+
});
|
|
384
|
+
return layout.listKind ? list : quote;
|
|
385
|
+
}
|
|
386
|
+
export function shouldAnchorPlainIndentToListItem(indentColumns, parentContentColumns) {
|
|
387
|
+
return indentColumns < parentContentColumns + INDENT_UNIT;
|
|
388
|
+
}
|
|
389
|
+
function getMarkerEnd(lineText, lineFrom, markerFrom, markerTo) {
|
|
390
|
+
const markerOffset = markerFrom - lineFrom;
|
|
391
|
+
const spaceOffset = lineText.indexOf(" ", markerOffset);
|
|
392
|
+
return spaceOffset === -1 ? markerTo : lineFrom + spaceOffset + 1;
|
|
393
|
+
}
|
|
394
|
+
function getListPrefixEndFromText(remainder, markerEnd) {
|
|
395
|
+
const task = remainder.match(/^(\[[^\]]\]\s+)/u)?.[0] ?? "";
|
|
396
|
+
return markerEnd + task.length;
|
|
397
|
+
}
|
|
398
|
+
function findPlainIndentAnchor(view, line, indentColumns, usesUnorderedMarkerSlot) {
|
|
399
|
+
const tree = ensureSyntaxTree(view.state, line.to, 25) ?? syntaxTree(view.state);
|
|
400
|
+
const node = tree.resolve(line.from, 1);
|
|
401
|
+
for (let current = node; current; current = current.parent) {
|
|
402
|
+
if (current.name !== "ListItem") {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
const list = current.parent;
|
|
406
|
+
if (!list || (list.name !== "BulletList" && list.name !== "OrderedList")) {
|
|
407
|
+
continue;
|
|
408
|
+
}
|
|
409
|
+
const listMark = current.getChild("ListMark");
|
|
410
|
+
if (!listMark) {
|
|
411
|
+
return null;
|
|
412
|
+
}
|
|
413
|
+
const anchorLine = view.state.doc.lineAt(listMark.from);
|
|
414
|
+
if (anchorLine.from === line.from) {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
const markerEnd = getMarkerEnd(anchorLine.text, anchorLine.from, listMark.from, listMark.to);
|
|
418
|
+
const prefixEnd = getListPrefixEndFromText(view.state.sliceDoc(markerEnd, anchorLine.to), markerEnd);
|
|
419
|
+
const fallbackPaddingColumns = toMarkdownColumns(view.state.sliceDoc(anchorLine.from, prefixEnd));
|
|
420
|
+
if (!shouldAnchorPlainIndentToListItem(indentColumns, fallbackPaddingColumns)) {
|
|
421
|
+
return null;
|
|
422
|
+
}
|
|
423
|
+
if (list.name === "BulletList" && usesUnorderedMarkerSlot) {
|
|
424
|
+
const markerColumns = toMarkdownColumns(view.state.sliceDoc(listMark.from, markerEnd));
|
|
425
|
+
return {
|
|
426
|
+
fallbackPaddingAdjustment: unorderedMarkerAdjustment(markerColumns),
|
|
427
|
+
fallbackPaddingColumns,
|
|
428
|
+
guideOffset: "var(--hmd-unordered-list-marker-guide-offset, 0px)",
|
|
429
|
+
lineFrom: anchorLine.from,
|
|
430
|
+
};
|
|
431
|
+
}
|
|
432
|
+
return { fallbackPaddingColumns, lineFrom: anchorLine.from };
|
|
433
|
+
}
|
|
434
|
+
return null;
|
|
435
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"indent.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/indent.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { EditorView } from "@codemirror/view";
|
|
3
|
+
import { createMarkdownCodeMirrorExtensions } from "../../markdown";
|
|
4
|
+
import { getIndentLineLayout, getLineIndentInfo, indentGuideDecorations, normalizeIndentText, selectionTouchesIndent, shouldRenderStyledUnorderedMarker, shouldAnchorPlainIndentToListItem, splitIndentSegments, toMarkdownColumns, } from "./indent";
|
|
5
|
+
describe("indent helpers", () => {
|
|
6
|
+
it("derives Lapis-style indentation metadata", () => {
|
|
7
|
+
expect(toMarkdownColumns("\t ")).toBe(6);
|
|
8
|
+
expect(normalizeIndentText("\t ")).toBe(" ");
|
|
9
|
+
expect(splitIndentSegments(" ")).toEqual([
|
|
10
|
+
{ text: " ", guide: true },
|
|
11
|
+
{ text: " ", guide: false },
|
|
12
|
+
]);
|
|
13
|
+
expect(getLineIndentInfo(" - nested")).toEqual({
|
|
14
|
+
columns: 4,
|
|
15
|
+
depth: 2,
|
|
16
|
+
kind: "ul",
|
|
17
|
+
text: " ",
|
|
18
|
+
});
|
|
19
|
+
expect(getLineIndentInfo(" continuation")).toEqual({
|
|
20
|
+
columns: 2,
|
|
21
|
+
depth: 1,
|
|
22
|
+
kind: "plain",
|
|
23
|
+
text: " ",
|
|
24
|
+
});
|
|
25
|
+
expect(selectionTouchesIndent(2, 2, 0, 4)).toBe(true);
|
|
26
|
+
expect(selectionTouchesIndent(5, 5, 0, 4)).toBe(false);
|
|
27
|
+
expect(shouldRenderStyledUnorderedMarker(true, 12, 10)).toBe(true);
|
|
28
|
+
expect(shouldRenderStyledUnorderedMarker(false, 12, 10)).toBe(false);
|
|
29
|
+
expect(shouldRenderStyledUnorderedMarker(true, 10, 10)).toBe(false);
|
|
30
|
+
expect(shouldRenderStyledUnorderedMarker(true, 11, 10)).toBe(false);
|
|
31
|
+
expect(shouldAnchorPlainIndentToListItem(2, 2)).toBe(true);
|
|
32
|
+
expect(shouldAnchorPlainIndentToListItem(8, 3)).toBe(false);
|
|
33
|
+
});
|
|
34
|
+
it("styles inactive dash and asterisk markers only in live preview", async () => {
|
|
35
|
+
const parent = document.createElement("div");
|
|
36
|
+
document.body.append(parent);
|
|
37
|
+
const view = new EditorView({
|
|
38
|
+
doc: ["# List markers", "", "- Dash item", "* Asterisk item"].join("\n"),
|
|
39
|
+
extensions: [
|
|
40
|
+
createMarkdownCodeMirrorExtensions(),
|
|
41
|
+
indentGuideDecorations({ livePreview: true }),
|
|
42
|
+
],
|
|
43
|
+
parent,
|
|
44
|
+
});
|
|
45
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
|
|
46
|
+
const markerFor = (snippet) => [...parent.querySelectorAll(".cm-line")]
|
|
47
|
+
.find((line) => (line.textContent || "").includes(snippet))
|
|
48
|
+
?.querySelector(".cm-formatting-list-ul");
|
|
49
|
+
expect(markerFor("Dash item")?.textContent).toBe("- ");
|
|
50
|
+
expect(markerFor("Dash item")?.classList).toContain("cm-formatting-list-bullet");
|
|
51
|
+
expect(markerFor("Asterisk item")?.textContent).toBe("* ");
|
|
52
|
+
expect(markerFor("Asterisk item")?.classList).toContain("cm-formatting-list-bullet");
|
|
53
|
+
view.dispatch({ selection: { anchor: view.state.doc.line(3).from } });
|
|
54
|
+
expect(markerFor("Dash item")?.classList).not.toContain("cm-formatting-list-bullet");
|
|
55
|
+
expect(markerFor("Asterisk item")?.classList).toContain("cm-formatting-list-bullet");
|
|
56
|
+
view.destroy();
|
|
57
|
+
parent.remove();
|
|
58
|
+
});
|
|
59
|
+
it("derives authored prefixes for top-level, quoted, and plain lines", () => {
|
|
60
|
+
expect(getIndentLineLayout("- wrapped item")).toMatchObject({
|
|
61
|
+
fallbackColumns: 2,
|
|
62
|
+
indentText: "",
|
|
63
|
+
kind: "ul",
|
|
64
|
+
listKind: "ul",
|
|
65
|
+
markerFrom: 0,
|
|
66
|
+
markerTo: 2,
|
|
67
|
+
});
|
|
68
|
+
expect(getIndentLineLayout("> 1. quoted item")).toMatchObject({
|
|
69
|
+
fallbackColumns: 5,
|
|
70
|
+
indentText: "",
|
|
71
|
+
kind: "quote-list",
|
|
72
|
+
listKind: "ol",
|
|
73
|
+
quoteFrom: 0,
|
|
74
|
+
quoteTo: 2,
|
|
75
|
+
});
|
|
76
|
+
expect(getIndentLineLayout("> quoted paragraph")).toMatchObject({
|
|
77
|
+
fallbackColumns: 2,
|
|
78
|
+
indentText: "",
|
|
79
|
+
kind: "quote",
|
|
80
|
+
quoteFrom: 0,
|
|
81
|
+
quoteTo: 2,
|
|
82
|
+
});
|
|
83
|
+
expect(getIndentLineLayout(" > indented quote")).toMatchObject({
|
|
84
|
+
fallbackColumns: 6,
|
|
85
|
+
indentText: " ",
|
|
86
|
+
kind: "quote",
|
|
87
|
+
quoteFrom: 4,
|
|
88
|
+
quoteTo: 6,
|
|
89
|
+
});
|
|
90
|
+
expect(getIndentLineLayout(" continuation")).toMatchObject({
|
|
91
|
+
fallbackColumns: 4,
|
|
92
|
+
indentText: " ",
|
|
93
|
+
kind: "plain",
|
|
94
|
+
});
|
|
95
|
+
});
|
|
96
|
+
it("does not apply hanging indent inside fenced code blocks", async () => {
|
|
97
|
+
const parent = document.createElement("div");
|
|
98
|
+
document.body.append(parent);
|
|
99
|
+
const view = new EditorView({
|
|
100
|
+
doc: [
|
|
101
|
+
"~~~mermaid",
|
|
102
|
+
" Source --> LivePreview",
|
|
103
|
+
" LivePreview --> Preview",
|
|
104
|
+
"~~~",
|
|
105
|
+
" outside continuation",
|
|
106
|
+
].join("\n"),
|
|
107
|
+
extensions: indentGuideDecorations({ livePreview: false }),
|
|
108
|
+
parent,
|
|
109
|
+
});
|
|
110
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
|
|
111
|
+
const fenceBody = [...parent.querySelectorAll(".cm-line")].filter((line) => (line.textContent || "").includes("Source --> LivePreview"));
|
|
112
|
+
expect(fenceBody.length).toBe(1);
|
|
113
|
+
expect(fenceBody[0]?.classList.contains("indented-wrapped-line")).toBe(false);
|
|
114
|
+
expect(fenceBody[0]?.querySelector(".cm-hmd-list-indent")).toBeNull();
|
|
115
|
+
const outside = [...parent.querySelectorAll(".cm-line")].find((line) => (line.textContent || "").includes("outside continuation"));
|
|
116
|
+
expect(outside?.classList.contains("indented-wrapped-line")).toBe(true);
|
|
117
|
+
view.destroy();
|
|
118
|
+
parent.remove();
|
|
119
|
+
});
|
|
120
|
+
it("anchors list continuations through syntax-tree ownership", async () => {
|
|
121
|
+
const parent = document.createElement("div");
|
|
122
|
+
document.body.append(parent);
|
|
123
|
+
const view = new EditorView({
|
|
124
|
+
doc: [
|
|
125
|
+
"- Bullet item",
|
|
126
|
+
" This single-space continuation",
|
|
127
|
+
" This two-space continuation",
|
|
128
|
+
"",
|
|
129
|
+
"2. Multiple paragraphs:",
|
|
130
|
+
" First ordered continuation",
|
|
131
|
+
"",
|
|
132
|
+
" Second ordered continuation",
|
|
133
|
+
"",
|
|
134
|
+
"4. Preformatted content:",
|
|
135
|
+
"",
|
|
136
|
+
" Eight-space preformatted content",
|
|
137
|
+
].join("\n"),
|
|
138
|
+
extensions: [
|
|
139
|
+
createMarkdownCodeMirrorExtensions(),
|
|
140
|
+
indentGuideDecorations({ livePreview: false }),
|
|
141
|
+
],
|
|
142
|
+
parent,
|
|
143
|
+
});
|
|
144
|
+
await new Promise((resolve) => requestAnimationFrame(() => resolve(null)));
|
|
145
|
+
const lineContaining = (snippet) => [...parent.querySelectorAll(".cm-line")].find((line) => (line.textContent || "").includes(snippet));
|
|
146
|
+
const bullet = lineContaining("Bullet item");
|
|
147
|
+
const ordered = lineContaining("Multiple paragraphs");
|
|
148
|
+
const single = lineContaining("single-space continuation");
|
|
149
|
+
const two = lineContaining("two-space continuation");
|
|
150
|
+
const first = lineContaining("First ordered continuation");
|
|
151
|
+
const second = lineContaining("Second ordered continuation");
|
|
152
|
+
const preformatted = lineContaining("Eight-space preformatted content");
|
|
153
|
+
expect(bullet?.dataset["indentAnchorLineFrom"]).toBeUndefined();
|
|
154
|
+
expect(bullet?.classList.contains("cm-formatting-list-ul")).toBe(false);
|
|
155
|
+
expect(bullet?.querySelector(".cm-formatting-list-ul")).not.toBeNull();
|
|
156
|
+
expect(single?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(1).from}`);
|
|
157
|
+
expect(two?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(1).from}`);
|
|
158
|
+
expect(two?.getAttribute("style")).toContain("--hmd-indent-widget-prefix-fallback: var(--list-indent)");
|
|
159
|
+
expect(two?.getAttribute("style")).toContain("--hmd-indent-padding-fallback: 2ch");
|
|
160
|
+
expect(first?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(5).from}`);
|
|
161
|
+
expect(second?.dataset["indentAnchorLineFrom"]).toBe(`${view.state.doc.line(5).from}`);
|
|
162
|
+
expect(ordered?.classList.contains("cm-formatting-list-ol")).toBe(false);
|
|
163
|
+
expect(preformatted?.dataset["indentAnchorLineFrom"]).toBeUndefined();
|
|
164
|
+
expect(preformatted?.querySelectorAll(".cm-indent-guide")).toHaveLength(2);
|
|
165
|
+
expect(preformatted?.getAttribute("style")).toContain("--hmd-indent-widget-prefix-fallback: calc(var(--list-indent) + var(--list-indent))");
|
|
166
|
+
view.destroy();
|
|
167
|
+
parent.remove();
|
|
168
|
+
});
|
|
169
|
+
});
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RangeBoundary } from "./ranges";
|
|
2
|
+
export declare function findInlineCodeRanges(text: string): RangeBoundary[];
|
|
3
|
+
export declare function countRun(text: string, start: number, character: string): number;
|
|
4
|
+
export declare function isPositionInsideRanges(position: number, ranges: RangeBoundary[]): boolean;
|
|
5
|
+
export declare function isEscaped(text: string, index: number): boolean;
|
|
6
|
+
export declare function isWhitespace(character: string): boolean;
|
|
7
|
+
//# sourceMappingURL=inline-code.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/inline-code.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAwBlE;AAED,wBAAgB,QAAQ,CACtB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,GAChB,MAAM,CAMR;AAED,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,aAAa,EAAE,GACtB,OAAO,CAET;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAQ9D;AAED,wBAAgB,YAAY,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAEvD"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export function findInlineCodeRanges(text) {
|
|
2
|
+
const ranges = [];
|
|
3
|
+
let index = 0;
|
|
4
|
+
while (index < text.length) {
|
|
5
|
+
if (text[index] !== "`" || isEscaped(text, index)) {
|
|
6
|
+
index += 1;
|
|
7
|
+
continue;
|
|
8
|
+
}
|
|
9
|
+
const tickCount = countRun(text, index, "`");
|
|
10
|
+
const closingIndex = text.indexOf("`".repeat(tickCount), index + tickCount);
|
|
11
|
+
if (closingIndex === -1) {
|
|
12
|
+
break;
|
|
13
|
+
}
|
|
14
|
+
ranges.push({
|
|
15
|
+
from: index,
|
|
16
|
+
to: closingIndex + tickCount,
|
|
17
|
+
});
|
|
18
|
+
index = closingIndex + tickCount;
|
|
19
|
+
}
|
|
20
|
+
return ranges;
|
|
21
|
+
}
|
|
22
|
+
export function countRun(text, start, character) {
|
|
23
|
+
let count = 0;
|
|
24
|
+
while (text[start + count] === character) {
|
|
25
|
+
count += 1;
|
|
26
|
+
}
|
|
27
|
+
return count;
|
|
28
|
+
}
|
|
29
|
+
export function isPositionInsideRanges(position, ranges) {
|
|
30
|
+
return ranges.some((range) => position >= range.from && position < range.to);
|
|
31
|
+
}
|
|
32
|
+
export function isEscaped(text, index) {
|
|
33
|
+
let backslashes = 0;
|
|
34
|
+
let cursor = index - 1;
|
|
35
|
+
while (cursor >= 0 && text[cursor] === "\\") {
|
|
36
|
+
backslashes += 1;
|
|
37
|
+
cursor -= 1;
|
|
38
|
+
}
|
|
39
|
+
return backslashes % 2 === 1;
|
|
40
|
+
}
|
|
41
|
+
export function isWhitespace(character) {
|
|
42
|
+
return character.length > 0 && /\s/u.test(character);
|
|
43
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-math.d.ts","sourceRoot":"","sources":["../../../../../src/internal/codemirror/rich/utils/inline-math.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAQ9C,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG;IAC5C,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe,EAAE,CAoDpE"}
|