@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,138 @@
|
|
|
1
|
+
import { visit } from "unist-util-visit";
|
|
2
|
+
export const remarkMultimarkdownTable = (options = {}) => {
|
|
3
|
+
const spanOptions = {
|
|
4
|
+
colspanMarkers: options.colspanMarkers ?? ["", "|"],
|
|
5
|
+
rowspanMarker: options.rowspanMarker ?? "^",
|
|
6
|
+
trimWhitespace: options.trimWhitespace ?? true,
|
|
7
|
+
};
|
|
8
|
+
return (tree) => {
|
|
9
|
+
visit(tree, "table", (node) => {
|
|
10
|
+
if (!node.children || node.children.length < 2) {
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
node.children = processTableSpans(node.children, spanOptions);
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
function processTableSpans(rows, options) {
|
|
18
|
+
const grid = rows.map(() => []);
|
|
19
|
+
const cellSpans = new Map();
|
|
20
|
+
const columnCount = Math.max(1, rows[0]?.children?.length ?? 1);
|
|
21
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
22
|
+
const originalCells = rows[rowIndex]?.children ?? [];
|
|
23
|
+
let colIndex = 0;
|
|
24
|
+
for (let cellIndex = 0; cellIndex < originalCells.length; cellIndex += 1) {
|
|
25
|
+
const cell = originalCells[cellIndex];
|
|
26
|
+
if (!cell) {
|
|
27
|
+
continue;
|
|
28
|
+
}
|
|
29
|
+
while (grid[rowIndex]?.[colIndex] !== undefined) {
|
|
30
|
+
colIndex += 1;
|
|
31
|
+
}
|
|
32
|
+
const cellText = tableCellText(cell, options.trimWhitespace);
|
|
33
|
+
if (cellText === options.rowspanMarker) {
|
|
34
|
+
extendRowspan(grid, cellSpans, rowIndex, colIndex);
|
|
35
|
+
colIndex += 1;
|
|
36
|
+
continue;
|
|
37
|
+
}
|
|
38
|
+
const colspanInfo = getColspan(originalCells, cellIndex, options);
|
|
39
|
+
let { colspan } = colspanInfo;
|
|
40
|
+
const { nextCellIndex } = colspanInfo;
|
|
41
|
+
if (colIndex >= columnCount) {
|
|
42
|
+
cellIndex = nextCellIndex - 1;
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
colspan = Math.min(colspan, columnCount - colIndex);
|
|
46
|
+
grid[rowIndex][colIndex] = cell;
|
|
47
|
+
cellSpans.set(`${rowIndex},${colIndex}`, { rowspan: 1, colspan });
|
|
48
|
+
for (let offset = 1; offset < colspan; offset += 1) {
|
|
49
|
+
grid[rowIndex][colIndex + offset] = cell;
|
|
50
|
+
}
|
|
51
|
+
cellIndex = nextCellIndex - 1;
|
|
52
|
+
colIndex += colspan;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
return rows.map((row, rowIndex) => {
|
|
56
|
+
const seenCells = new Set();
|
|
57
|
+
const children = [];
|
|
58
|
+
for (let colIndex = 0; colIndex < columnCount; colIndex += 1) {
|
|
59
|
+
const cell = grid[rowIndex]?.[colIndex];
|
|
60
|
+
if (!cell || seenCells.has(cell)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
seenCells.add(cell);
|
|
64
|
+
const spanInfo = cellSpans.get(`${rowIndex},${colIndex}`);
|
|
65
|
+
if (!spanInfo) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
const nextCell = {
|
|
69
|
+
...cell,
|
|
70
|
+
data: {
|
|
71
|
+
...(cell.data ?? {}),
|
|
72
|
+
hProperties: {
|
|
73
|
+
...(cell.data?.hProperties ?? {}),
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
if (spanInfo.colspan > 1) {
|
|
78
|
+
nextCell.data.hProperties.colSpan = spanInfo.colspan;
|
|
79
|
+
}
|
|
80
|
+
if (spanInfo.rowspan > 1) {
|
|
81
|
+
nextCell.data.hProperties.rowSpan = spanInfo.rowspan;
|
|
82
|
+
}
|
|
83
|
+
children.push(nextCell);
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
...row,
|
|
87
|
+
children,
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function extendRowspan(grid, cellSpans, rowIndex, colIndex) {
|
|
92
|
+
for (let checkRow = rowIndex - 1; checkRow >= 0; checkRow -= 1) {
|
|
93
|
+
const spanningCell = grid[checkRow]?.[colIndex];
|
|
94
|
+
if (!spanningCell) {
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
const spanInfo = cellSpans.get(`${checkRow},${colIndex}`);
|
|
98
|
+
if (spanInfo && checkRow + spanInfo.rowspan === rowIndex) {
|
|
99
|
+
spanInfo.rowspan += 1;
|
|
100
|
+
grid[rowIndex][colIndex] = spanningCell;
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
grid[rowIndex][colIndex] = null;
|
|
105
|
+
}
|
|
106
|
+
function tableCellText(cell, trimWhitespace) {
|
|
107
|
+
const text = nodeText(cell);
|
|
108
|
+
return trimWhitespace ? text.trim() : text;
|
|
109
|
+
}
|
|
110
|
+
function getColspan(cells, cellIndex, options) {
|
|
111
|
+
let nextCellIndex = cellIndex + 1;
|
|
112
|
+
let markerCount = 0;
|
|
113
|
+
while (nextCellIndex < cells.length) {
|
|
114
|
+
const nextCell = cells[nextCellIndex];
|
|
115
|
+
if (!nextCell ||
|
|
116
|
+
!options.colspanMarkers.includes(tableCellText(nextCell, options.trimWhitespace))) {
|
|
117
|
+
break;
|
|
118
|
+
}
|
|
119
|
+
markerCount += 1;
|
|
120
|
+
nextCellIndex += 1;
|
|
121
|
+
}
|
|
122
|
+
if (markerCount === 0 || nextCellIndex >= cells.length) {
|
|
123
|
+
return { colspan: 1, nextCellIndex: cellIndex + 1 };
|
|
124
|
+
}
|
|
125
|
+
return { colspan: 1 + markerCount, nextCellIndex };
|
|
126
|
+
}
|
|
127
|
+
function nodeText(node) {
|
|
128
|
+
if (!node || typeof node !== "object") {
|
|
129
|
+
return "";
|
|
130
|
+
}
|
|
131
|
+
if ("value" in node && typeof node.value === "string") {
|
|
132
|
+
return node.value;
|
|
133
|
+
}
|
|
134
|
+
if ("children" in node && Array.isArray(node.children)) {
|
|
135
|
+
return node.children.map((child) => nodeText(child)).join("");
|
|
136
|
+
}
|
|
137
|
+
return "";
|
|
138
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parity.test.d.ts","sourceRoot":"","sources":["../../../src/preview/remark/parity.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import remarkGfm from "remark-gfm";
|
|
3
|
+
import { createParser } from "../renderer/utils";
|
|
4
|
+
import { findElement } from "../test-utils";
|
|
5
|
+
import { rehypeHighlightLines } from "../rehype-highlight-lines";
|
|
6
|
+
import { rehypeTableSpans } from "../rehype-table-spans";
|
|
7
|
+
import { remarkHeadings } from "./headings";
|
|
8
|
+
import { remarkListCallouts } from "./list-callouts";
|
|
9
|
+
import { remarkMultimarkdownTable } from "./multimarkdown-table";
|
|
10
|
+
describe("Lapis preview parity plugins", () => {
|
|
11
|
+
it("adds Lapis heading classes and data-heading text", () => {
|
|
12
|
+
const parser = createParser([remarkHeadings]);
|
|
13
|
+
const ast = parser("## Portable **heading**");
|
|
14
|
+
const heading = findElement(ast, "h2");
|
|
15
|
+
expect(heading?.properties?.class).toBe("cm-header cm-header-2");
|
|
16
|
+
expect(heading?.properties?.["data-heading"]).toBe("Portable heading");
|
|
17
|
+
});
|
|
18
|
+
it("adds highlighted code line wrappers from fence metadata", () => {
|
|
19
|
+
const parser = createParser([], [rehypeHighlightLines]);
|
|
20
|
+
const ast = parser(["```ts {2}", "const a = 1;", "const b = 2;", "```"].join("\n"));
|
|
21
|
+
const code = findElement(ast, "code");
|
|
22
|
+
const lines = findElements(code, "span").filter((element) => String(element.properties?.class ?? "").includes("code-line"));
|
|
23
|
+
expect(lines).toHaveLength(2);
|
|
24
|
+
expect(lines[1]?.properties?.class).toContain("highlighted-code-line");
|
|
25
|
+
});
|
|
26
|
+
it("adds Lapis MultiMarkdown colspan and rowspan properties", () => {
|
|
27
|
+
const parser = createParser([remarkGfm, remarkMultimarkdownTable], [rehypeTableSpans]);
|
|
28
|
+
const ast = parser([
|
|
29
|
+
"| Package | Role | Status |",
|
|
30
|
+
"| --- | --- | --- |",
|
|
31
|
+
"| combined package | | ready |",
|
|
32
|
+
"| @lapismd/mira/core | editor controller | ready |",
|
|
33
|
+
"| ^ | rendered markdown | ready |",
|
|
34
|
+
].join("\n"));
|
|
35
|
+
const bodyRows = directElementChildren(findElement(ast, "tbody"), "tr");
|
|
36
|
+
const cells = findElements(findElement(ast, "tbody"), "td");
|
|
37
|
+
const cellWithColspan = cells.find((cell) => cell.properties?.colspan === 2);
|
|
38
|
+
const cellWithRowspan = cells.find((cell) => cell.properties?.rowspan === 2);
|
|
39
|
+
expect(bodyRows.map((row) => directElementChildren(row, "td").length)).toEqual([2, 3, 2]);
|
|
40
|
+
expect(cellWithColspan).toBeDefined();
|
|
41
|
+
expect(cellWithRowspan).toBeDefined();
|
|
42
|
+
});
|
|
43
|
+
it("does not treat trailing empty MultiMarkdown cells as colspans", () => {
|
|
44
|
+
const parser = createParser([remarkGfm, remarkMultimarkdownTable], [rehypeTableSpans]);
|
|
45
|
+
const ast = parser([
|
|
46
|
+
"| Package | Role | Status | |",
|
|
47
|
+
"| --- | --- | --- | --- |",
|
|
48
|
+
"| @lapismd/mira/core | editor controller | ready | |",
|
|
49
|
+
].join("\n"));
|
|
50
|
+
const headerCells = directElementChildren(findElement(ast, "thead"), "tr").flatMap((row) => directElementChildren(row, "th"));
|
|
51
|
+
const bodyCells = findElements(findElement(ast, "tbody"), "td");
|
|
52
|
+
expect(headerCells).toHaveLength(4);
|
|
53
|
+
expect(bodyCells).toHaveLength(4);
|
|
54
|
+
expect(headerCells[2]?.properties?.colspan).toBeUndefined();
|
|
55
|
+
expect(bodyCells[2]?.properties?.colspan).toBeUndefined();
|
|
56
|
+
});
|
|
57
|
+
it("renders Lapis default list callout markers", () => {
|
|
58
|
+
const parser = createParser([remarkGfm, remarkListCallouts]);
|
|
59
|
+
const ast = parser("- & Highlighted item\n- ? Question item");
|
|
60
|
+
const items = findElements(ast, "li");
|
|
61
|
+
const markers = findElements(ast, "span").filter((element) => String(element.properties?.class ?? "").includes("lc-list-marker"));
|
|
62
|
+
expect(items[0]?.properties?.class).toContain("lc-list-callout");
|
|
63
|
+
expect(items[0]?.properties?.["data-callout"]).toBe("&");
|
|
64
|
+
expect(items[1]?.properties?.["data-callout"]).toBe("?");
|
|
65
|
+
expect(markers.map((marker) => marker.properties?.["data-callout-char"])).toEqual(["&", "?"]);
|
|
66
|
+
expect(markers[0]?.properties?.["data-offset"]).toBe(2);
|
|
67
|
+
expect(markers[0]?.properties?.["data-offset-end"]).toBe(3);
|
|
68
|
+
});
|
|
69
|
+
it("renders an injected list callout catalog and can disable defaults", () => {
|
|
70
|
+
const parser = createParser([
|
|
71
|
+
remarkGfm,
|
|
72
|
+
[
|
|
73
|
+
remarkListCallouts,
|
|
74
|
+
{
|
|
75
|
+
callouts: [
|
|
76
|
+
{ char: "&", enabled: false },
|
|
77
|
+
{ char: "^", color: "80, 70, 220", icon: "bookmark" },
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
]);
|
|
82
|
+
const ast = parser("- & Plain item\n- ^ Custom item");
|
|
83
|
+
const items = findElements(ast, "li");
|
|
84
|
+
const marker = findElements(ast, "span").find((element) => element.properties?.["data-list-callout-marker"] === "true");
|
|
85
|
+
expect(String(items[0]?.properties?.class ?? "")).not.toContain("lc-list-callout");
|
|
86
|
+
expect(items[1]?.properties?.["data-callout"]).toBe("^");
|
|
87
|
+
expect(items[1]?.properties?.style).toContain("80, 70, 220");
|
|
88
|
+
expect(marker?.properties?.["data-callout-icon"]).toBe("bookmark");
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
function findElements(node, tagName) {
|
|
92
|
+
const results = [];
|
|
93
|
+
if (node.type === "element" && node.tagName === tagName) {
|
|
94
|
+
results.push(node);
|
|
95
|
+
}
|
|
96
|
+
for (const child of node.children ?? []) {
|
|
97
|
+
if (child.type === "element") {
|
|
98
|
+
results.push(...findElements(child, tagName));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
return results;
|
|
102
|
+
}
|
|
103
|
+
function directElementChildren(node, tagName) {
|
|
104
|
+
return (node.children ?? []).filter((child) => child.type === "element" && child.tagName === tagName);
|
|
105
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pathlink.d.ts","sourceRoot":"","sources":["../../../src/preview/remark/pathlink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAOtC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CA0B5C,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { isImplicitLocalPathDestination, splitTextNodes, } from "./utils";
|
|
2
|
+
export const remarkPathLinks = () => {
|
|
3
|
+
return (tree) => splitTextNodes(tree, /(?<!\[)\[(?!\[)([^\]\n]+)](?/g, (match) => {
|
|
4
|
+
const id = match[1] ?? "";
|
|
5
|
+
if (!isImplicitLocalPathDestination(id)) {
|
|
6
|
+
return {
|
|
7
|
+
type: "text",
|
|
8
|
+
value: match[0] ?? "",
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
type: "pathlink",
|
|
13
|
+
value: id,
|
|
14
|
+
data: {
|
|
15
|
+
hName: "pathlink",
|
|
16
|
+
hProperties: {
|
|
17
|
+
href: id,
|
|
18
|
+
id,
|
|
19
|
+
label: id,
|
|
20
|
+
text: id,
|
|
21
|
+
},
|
|
22
|
+
hChildren: [{ type: "text", value: id }],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
});
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tags.d.ts","sourceRoot":"","sources":["../../../src/preview/remark/tags.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAQ,MAAM,OAAO,CAAC;AACxC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAsBvC,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { splitTextNodes } from "./utils";
|
|
2
|
+
export const remarkTags = () => {
|
|
3
|
+
return (tree) => splitTextNodes(tree, /(^|[\s([{])#([\p{L}\p{N}_/-]+)/gu, (match) => {
|
|
4
|
+
const prefix = match[1] ?? "";
|
|
5
|
+
const value = `#${match[2]}`;
|
|
6
|
+
const tag = {
|
|
7
|
+
type: "tag",
|
|
8
|
+
value,
|
|
9
|
+
data: {
|
|
10
|
+
hName: "tag",
|
|
11
|
+
hProperties: { value },
|
|
12
|
+
hChildren: [{ type: "text", value }],
|
|
13
|
+
},
|
|
14
|
+
};
|
|
15
|
+
return prefix
|
|
16
|
+
? [
|
|
17
|
+
{ type: "text", value: prefix },
|
|
18
|
+
tag,
|
|
19
|
+
]
|
|
20
|
+
: tag;
|
|
21
|
+
});
|
|
22
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Root, Text } from "mdast";
|
|
2
|
+
export type MarkdownInlineNode = Text & {
|
|
3
|
+
data?: Record<string, unknown>;
|
|
4
|
+
};
|
|
5
|
+
export declare function hasRawSpace(value: string): boolean;
|
|
6
|
+
export declare function isUrlLikeDestination(value: string): boolean;
|
|
7
|
+
export declare function isExternalMarkdownDestination(value: string): boolean;
|
|
8
|
+
export declare function isImageDataUri(value: string): boolean;
|
|
9
|
+
export declare function isLocalPathDestination(value: string): boolean;
|
|
10
|
+
export declare function isImplicitLocalPathDestination(value: string): boolean;
|
|
11
|
+
export declare function splitTextNodes(tree: Root, regexp: RegExp, createNode: (match: RegExpMatchArray) => MarkdownInlineNode | MarkdownInlineNode[]): void;
|
|
12
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/preview/remark/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAOxC,MAAM,MAAM,kBAAkB,GAAG,IAAI,GAAG;IACtC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAChC,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAElD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE3D;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CASpE;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIrD;AAED,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAc7D;AAED,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAWrE;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,CACV,KAAK,EAAE,gBAAgB,KACpB,kBAAkB,GAAG,kBAAkB,EAAE,GAC7C,IAAI,CAkCN"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { visit } from "unist-util-visit";
|
|
2
|
+
export function hasRawSpace(value) {
|
|
3
|
+
return value.includes(" ");
|
|
4
|
+
}
|
|
5
|
+
export function isUrlLikeDestination(value) {
|
|
6
|
+
return /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(value);
|
|
7
|
+
}
|
|
8
|
+
export function isExternalMarkdownDestination(value) {
|
|
9
|
+
const text = value.trim();
|
|
10
|
+
return (/^((https?|ftps?|ssh):)?\/\//i.test(text) ||
|
|
11
|
+
/^<((https?|ftps?|ssh):)?\/\//i.test(text) ||
|
|
12
|
+
/^(mailto|tel):/i.test(text) ||
|
|
13
|
+
/^<(mailto|tel):/i.test(text));
|
|
14
|
+
}
|
|
15
|
+
export function isImageDataUri(value) {
|
|
16
|
+
return /^data:image\/(?:png|jpe?g|gif|webp|avif);base64,[a-z0-9+/=\s]+$/i.test(value.trim());
|
|
17
|
+
}
|
|
18
|
+
export function isLocalPathDestination(value) {
|
|
19
|
+
if (!hasRawSpace(value)) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
if (value.trim() !== value || value.length === 0) {
|
|
23
|
+
return false;
|
|
24
|
+
}
|
|
25
|
+
if (/[\n\r\t<>|]/.test(value)) {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
if (value.includes("#") || value.includes("?")) {
|
|
29
|
+
return false;
|
|
30
|
+
}
|
|
31
|
+
return !isUrlLikeDestination(value);
|
|
32
|
+
}
|
|
33
|
+
export function isImplicitLocalPathDestination(value) {
|
|
34
|
+
if (value.trim() !== value || value.length === 0) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
if (/[\n\r\t<>|]/.test(value) || value.includes("[") || value.includes("]")) {
|
|
38
|
+
return false;
|
|
39
|
+
}
|
|
40
|
+
if (value.includes("#") || value.includes("?")) {
|
|
41
|
+
return false;
|
|
42
|
+
}
|
|
43
|
+
return !isUrlLikeDestination(value);
|
|
44
|
+
}
|
|
45
|
+
export function splitTextNodes(tree, regexp, createNode) {
|
|
46
|
+
visit(tree, "text", (node, index, parent) => {
|
|
47
|
+
if (index === undefined || !parent?.children) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
const replacements = [];
|
|
51
|
+
let lastIndex = 0;
|
|
52
|
+
for (const match of node.value.matchAll(regexp)) {
|
|
53
|
+
const matchIndex = match.index ?? 0;
|
|
54
|
+
if (matchIndex > lastIndex) {
|
|
55
|
+
replacements.push({
|
|
56
|
+
type: "text",
|
|
57
|
+
value: node.value.slice(lastIndex, matchIndex),
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
replacements.push(...[createNode(match)].flat());
|
|
61
|
+
lastIndex = matchIndex + match[0].length;
|
|
62
|
+
}
|
|
63
|
+
if (!replacements.length) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
if (lastIndex < node.value.length) {
|
|
67
|
+
replacements.push({
|
|
68
|
+
type: "text",
|
|
69
|
+
value: node.value.slice(lastIndex),
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
parent.children.splice(index, 1, ...replacements);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wikilink.d.ts","sourceRoot":"","sources":["../../../src/preview/remark/wikilink.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,EAAE,EAAE,IAAI,CAuB5C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { splitTextNodes } from "./utils";
|
|
2
|
+
export const remarkWikiLinks = () => {
|
|
3
|
+
return (tree) => splitTextNodes(tree, /(!?)\[\[([^\]\n]+)]]/g, (match) => {
|
|
4
|
+
const isEmbed = match[1] === "!";
|
|
5
|
+
const [target = "", ...details] = (match[2] ?? "").split("|");
|
|
6
|
+
const alias = details.join("|") || undefined;
|
|
7
|
+
const label = alias || target;
|
|
8
|
+
return {
|
|
9
|
+
type: isEmbed ? "embed" : "wikilink",
|
|
10
|
+
value: target,
|
|
11
|
+
data: {
|
|
12
|
+
hName: isEmbed ? "embed" : "wikilink",
|
|
13
|
+
hProperties: {
|
|
14
|
+
href: target,
|
|
15
|
+
id: target,
|
|
16
|
+
label,
|
|
17
|
+
text: label,
|
|
18
|
+
},
|
|
19
|
+
hChildren: isEmbed ? [] : [{ type: "text", value: label }],
|
|
20
|
+
},
|
|
21
|
+
};
|
|
22
|
+
});
|
|
23
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./remark/callouts";
|
|
2
|
+
export * from "./remark/custom-checklists";
|
|
3
|
+
export * from "./remark/external-links";
|
|
4
|
+
export * from "./remark/hast";
|
|
5
|
+
export * from "./remark/headings";
|
|
6
|
+
export * from "./remark/list-callouts";
|
|
7
|
+
export * from "./remark/multimarkdown-table";
|
|
8
|
+
export * from "./remark/pathlink";
|
|
9
|
+
export * from "./remark/tags";
|
|
10
|
+
export * from "./remark/utils";
|
|
11
|
+
export * from "./remark/wikilink";
|
|
12
|
+
//# sourceMappingURL=remark.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remark.d.ts","sourceRoot":"","sources":["../../src/preview/remark.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./remark/callouts";
|
|
2
|
+
export * from "./remark/custom-checklists";
|
|
3
|
+
export * from "./remark/external-links";
|
|
4
|
+
export * from "./remark/hast";
|
|
5
|
+
export * from "./remark/headings";
|
|
6
|
+
export * from "./remark/list-callouts";
|
|
7
|
+
export * from "./remark/multimarkdown-table";
|
|
8
|
+
export * from "./remark/pathlink";
|
|
9
|
+
export * from "./remark/tags";
|
|
10
|
+
export * from "./remark/utils";
|
|
11
|
+
export * from "./remark/wikilink";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { MiraAssetResolver, MiraExtension, MiraFileAdapter, MiraLinkResolver, MiraRendererComponents, MiraResolvedListCallout } from "@lapismd/mira/extensions";
|
|
2
|
+
import type { HastNode, MarkdownChangeHandler, MarkdownPostProcess } from "./types";
|
|
3
|
+
import type { FrontmatterConfig } from "../components/frontmatter-utils";
|
|
4
|
+
import type { Pluggable } from "unified";
|
|
5
|
+
import type { Options as RemarkRehypeOptions } from "remark-rehype";
|
|
6
|
+
export type MarkdownContext = {
|
|
7
|
+
markdown: string;
|
|
8
|
+
sourcePath?: string;
|
|
9
|
+
extensions: MiraExtension[];
|
|
10
|
+
remarkPlugins: Pluggable[];
|
|
11
|
+
rehypePlugins: Pluggable[];
|
|
12
|
+
remarkRehypeOptions: RemarkRehypeOptions;
|
|
13
|
+
components: MiraRendererComponents;
|
|
14
|
+
linkResolver?: MiraLinkResolver;
|
|
15
|
+
assetResolver?: MiraAssetResolver;
|
|
16
|
+
fileAdapter?: MiraFileAdapter;
|
|
17
|
+
listCallouts: MiraResolvedListCallout[];
|
|
18
|
+
postProcess: MarkdownPostProcess;
|
|
19
|
+
onChange?: MarkdownChangeHandler;
|
|
20
|
+
onFrontmatterChange?: (nextYaml: string, nextValue: string) => void;
|
|
21
|
+
frontmatterOpen: boolean;
|
|
22
|
+
frontmatterConfig?: FrontmatterConfig;
|
|
23
|
+
dialog: boolean;
|
|
24
|
+
};
|
|
25
|
+
export type AstNodeContext = {
|
|
26
|
+
node: HastNode;
|
|
27
|
+
parent: HastNode | null;
|
|
28
|
+
};
|
|
29
|
+
export declare function setMarkdownContext(context: MarkdownContext): MarkdownContext;
|
|
30
|
+
export declare function useMarkdownContext(): MarkdownContext;
|
|
31
|
+
export declare function tryUseMarkdownContext(): MarkdownContext | null;
|
|
32
|
+
export declare const useMarkdown: typeof useMarkdownContext;
|
|
33
|
+
export declare function setAstNodeContext(context: AstNodeContext): AstNodeContext;
|
|
34
|
+
export declare function useAstNodeContext(): AstNodeContext;
|
|
35
|
+
export declare const useAstNode: typeof useAstNodeContext;
|
|
36
|
+
export declare function getNodeRenderKey(node: HastNode, markdown: string, index: number): string;
|
|
37
|
+
//# sourceMappingURL=context.svelte.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.svelte.d.ts","sourceRoot":"","sources":["../../../src/preview/renderer/context.svelte.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EACV,QAAQ,EACR,qBAAqB,EACrB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAKpE,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,aAAa,EAAE,CAAC;IAC5B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,aAAa,EAAE,SAAS,EAAE,CAAC;IAC3B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,UAAU,EAAE,sBAAsB,CAAC;IACnC,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,aAAa,CAAC,EAAE,iBAAiB,CAAC;IAClC,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,YAAY,EAAE,uBAAuB,EAAE,CAAC;IACxC,WAAW,EAAE,mBAAmB,CAAC;IACjC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IACjC,mBAAmB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,eAAe,EAAE,OAAO,CAAC;IACzB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,QAAQ,CAAC;IACf,MAAM,EAAE,QAAQ,GAAG,IAAI,CAAC;CACzB,CAAC;AAEF,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,eAAe,GAAG,eAAe,CAG5E;AAED,wBAAgB,kBAAkB,IAAI,eAAe,CAEpD;AAED,wBAAgB,qBAAqB,IAAI,eAAe,GAAG,IAAI,CAE9D;AAED,eAAO,MAAM,WAAW,2BAAqB,CAAC;AAE9C,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,cAAc,GAAG,cAAc,CAGzE;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAElD;AAED,eAAO,MAAM,UAAU,0BAAoB,CAAC;AAE5C,wBAAgB,gBAAgB,CAC9B,IAAI,EAAE,QAAQ,EACd,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,MAAM,CA8BR"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { getContext, setContext } from "svelte";
|
|
2
|
+
const MARKDOWN_CONTEXT = Symbol("mira-markdown-context");
|
|
3
|
+
const AST_NODE_CONTEXT = Symbol("mira-ast-node-context");
|
|
4
|
+
export function setMarkdownContext(context) {
|
|
5
|
+
setContext(MARKDOWN_CONTEXT, context);
|
|
6
|
+
return context;
|
|
7
|
+
}
|
|
8
|
+
export function useMarkdownContext() {
|
|
9
|
+
return getContext(MARKDOWN_CONTEXT);
|
|
10
|
+
}
|
|
11
|
+
export function tryUseMarkdownContext() {
|
|
12
|
+
return getContext(MARKDOWN_CONTEXT) ?? null;
|
|
13
|
+
}
|
|
14
|
+
export const useMarkdown = useMarkdownContext;
|
|
15
|
+
export function setAstNodeContext(context) {
|
|
16
|
+
setContext(AST_NODE_CONTEXT, context);
|
|
17
|
+
return context;
|
|
18
|
+
}
|
|
19
|
+
export function useAstNodeContext() {
|
|
20
|
+
return getContext(AST_NODE_CONTEXT);
|
|
21
|
+
}
|
|
22
|
+
export const useAstNode = useAstNodeContext;
|
|
23
|
+
export function getNodeRenderKey(node, markdown, index) {
|
|
24
|
+
const typedNode = node;
|
|
25
|
+
const startOffset = typedNode.position?.start?.offset ?? typedNode.position?.start?.line;
|
|
26
|
+
const endOffset = typedNode.position?.end?.offset;
|
|
27
|
+
const excerpt = typeof startOffset === "number"
|
|
28
|
+
? markdown.slice(startOffset, typeof endOffset === "number"
|
|
29
|
+
? Math.min(endOffset, startOffset + 96)
|
|
30
|
+
: startOffset + 48)
|
|
31
|
+
: (typedNode.value?.slice(0, 48) ?? "");
|
|
32
|
+
return [
|
|
33
|
+
typedNode.type,
|
|
34
|
+
typedNode.tagName ?? "",
|
|
35
|
+
startOffset ?? index,
|
|
36
|
+
endOffset ?? "",
|
|
37
|
+
hashString(excerpt),
|
|
38
|
+
index,
|
|
39
|
+
].join(":");
|
|
40
|
+
}
|
|
41
|
+
function hashString(value) {
|
|
42
|
+
let hash = 5381;
|
|
43
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
44
|
+
hash = (hash * 33) ^ value.charCodeAt(index);
|
|
45
|
+
}
|
|
46
|
+
return (hash >>> 0).toString(36);
|
|
47
|
+
}
|