@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,425 @@
|
|
|
1
|
+
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
2
|
+
import { toMarkdown } from "mdast-util-to-markdown";
|
|
3
|
+
import { gridTablesToMarkdown } from "@adobe/mdast-util-gridtables";
|
|
4
|
+
import { gridTablesFromMarkdown } from "./from-markdown";
|
|
5
|
+
import { Text } from "@codemirror/state";
|
|
6
|
+
import { gridTables } from "./syntax";
|
|
7
|
+
const EMPTY_CELL = {
|
|
8
|
+
type: "gtCell",
|
|
9
|
+
content: "",
|
|
10
|
+
colSpan: 1,
|
|
11
|
+
rowSpan: 1,
|
|
12
|
+
children: [],
|
|
13
|
+
align: null,
|
|
14
|
+
valign: null,
|
|
15
|
+
positions: [],
|
|
16
|
+
};
|
|
17
|
+
function arrayMove(arr, old_index, new_index, defaultValue) {
|
|
18
|
+
if (new_index >= arr.length) {
|
|
19
|
+
let k = new_index - arr.length + 1;
|
|
20
|
+
while (k--) {
|
|
21
|
+
arr.push(structuredClone(defaultValue));
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
|
|
25
|
+
return arr;
|
|
26
|
+
}
|
|
27
|
+
function createVirtualGrid(table, _doc) {
|
|
28
|
+
// Collect all rows from all sections
|
|
29
|
+
const allRows = [];
|
|
30
|
+
const rowMap = new Map();
|
|
31
|
+
const cellMap = new Map();
|
|
32
|
+
for (let i = 0; i < table.children.length; i++) {
|
|
33
|
+
const section = table.children[i];
|
|
34
|
+
for (let j = 0; j < section.children.length; j++) {
|
|
35
|
+
const row = section.children[j];
|
|
36
|
+
const rowType = { sectionIndex: i, section, row, rowIndex: j, cells: [] };
|
|
37
|
+
rowMap.set(row, rowType);
|
|
38
|
+
allRows.push(rowType);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
// Build a virtual grid to track cell occupancy
|
|
42
|
+
const virtualGrid = [];
|
|
43
|
+
// Initialize the virtual grid with enough space
|
|
44
|
+
const maxCols = Math.max(...allRows.map((row) => row.row.children.reduce((sum, cell) => sum + (cell.colSpan ?? 1), 0)));
|
|
45
|
+
for (let i = 0; i < allRows.length; i++) {
|
|
46
|
+
virtualGrid[i] = new Array(maxCols).fill(null);
|
|
47
|
+
}
|
|
48
|
+
// Fill the virtual grid
|
|
49
|
+
for (let rowIndex = 0; rowIndex < allRows.length; rowIndex++) {
|
|
50
|
+
const row = allRows[rowIndex];
|
|
51
|
+
let colIndex = 0;
|
|
52
|
+
for (let i = 0; i < row.row.children.length; i++) {
|
|
53
|
+
const cell = row.row.children[i];
|
|
54
|
+
const coords = [];
|
|
55
|
+
cell.rowSpan ||= 1;
|
|
56
|
+
cell.colSpan ||= 1;
|
|
57
|
+
// Find the next available column in this row
|
|
58
|
+
while (colIndex < maxCols && virtualGrid[rowIndex][colIndex] !== null) {
|
|
59
|
+
colIndex++;
|
|
60
|
+
}
|
|
61
|
+
if (colIndex >= maxCols) {
|
|
62
|
+
break; // No more space in this row
|
|
63
|
+
}
|
|
64
|
+
// Fill the virtual grid for this cell's span
|
|
65
|
+
for (let r = rowIndex; r < Math.min(rowIndex + (cell.rowSpan ?? 1), allRows.length); r++) {
|
|
66
|
+
for (let c = colIndex; c < Math.min(colIndex + (cell.colSpan ?? 1), maxCols); c++) {
|
|
67
|
+
const colType = { ...row, cell, coords, cellIndex: i, y: r, x: c };
|
|
68
|
+
virtualGrid[r][c] = colType;
|
|
69
|
+
if (!cellMap.has(cell)) {
|
|
70
|
+
cellMap.set(cell, colType);
|
|
71
|
+
row.cells.push(colType);
|
|
72
|
+
}
|
|
73
|
+
coords.push({ y: r, x: c });
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
colIndex += cell.colSpan ?? 1;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return { rows: allRows, grid: virtualGrid, maxCols, maxRows: allRows.length };
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Finds the cell at the given coordinates (x, y) in a grid table, taking into
|
|
83
|
+
* account colspan and rowspan.
|
|
84
|
+
*
|
|
85
|
+
* @param table - The grid table to search
|
|
86
|
+
* @param x - Column index (0-based)
|
|
87
|
+
* @param y - Row index (0-based)
|
|
88
|
+
* @returns The cell at the given position, or null if out of bounds
|
|
89
|
+
*/
|
|
90
|
+
function getCellAtPosition(grid, x, y) {
|
|
91
|
+
if (y < 0 || y >= grid.rows.length) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
// Return the cell at the requested position
|
|
95
|
+
if (x < 0 || x >= grid.maxCols || grid.grid[y][x] === null) {
|
|
96
|
+
return null;
|
|
97
|
+
}
|
|
98
|
+
return grid.grid[y][x];
|
|
99
|
+
}
|
|
100
|
+
function getCellAtOffset(grid, offset) {
|
|
101
|
+
for (let y = 0; y < grid.grid.length; y++) {
|
|
102
|
+
for (let x = 0; x < grid.grid[y].length; x++) {
|
|
103
|
+
const cell = grid.grid[y][x];
|
|
104
|
+
if (cell) {
|
|
105
|
+
if (cell.cell.positions.find((coord) => offset >= coord.from && offset <= coord.to)) {
|
|
106
|
+
return cell;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
export class GridTableNode {
|
|
114
|
+
/** @internal */
|
|
115
|
+
__mdastNode;
|
|
116
|
+
__grid;
|
|
117
|
+
doc = Text.of([""]);
|
|
118
|
+
/** @internal */
|
|
119
|
+
static clone(node) {
|
|
120
|
+
return new GridTableNode(structuredClone(node.__mdastNode));
|
|
121
|
+
}
|
|
122
|
+
static fromMarkdown(doc) {
|
|
123
|
+
const root = fromMarkdown(doc, {
|
|
124
|
+
extensions: [gridTables],
|
|
125
|
+
mdastExtensions: [gridTablesFromMarkdown()],
|
|
126
|
+
});
|
|
127
|
+
if (root.children[0]?.type === "gridTable") {
|
|
128
|
+
const node = new GridTableNode(root.children[0]);
|
|
129
|
+
node.doc = Text.of(doc.split("\n"));
|
|
130
|
+
return node;
|
|
131
|
+
}
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
static toMarkdown(node) {
|
|
135
|
+
return toMarkdown(node, {
|
|
136
|
+
handlers: {
|
|
137
|
+
text(node) {
|
|
138
|
+
return node.value;
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
extensions: [gridTablesToMarkdown()],
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
toMarkdown() {
|
|
145
|
+
return toMarkdown(this.__mdastNode, {
|
|
146
|
+
handlers: {
|
|
147
|
+
text(node) {
|
|
148
|
+
return node.value;
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
extensions: [gridTablesToMarkdown()],
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
rerender() {
|
|
155
|
+
const markdown = this.toMarkdown();
|
|
156
|
+
this.__mdastNode = GridTableNode.fromMarkdown(markdown).__mdastNode;
|
|
157
|
+
this.doc = Text.of(markdown.split("\n"));
|
|
158
|
+
this.__grid = createVirtualGrid(this.__mdastNode, this.doc);
|
|
159
|
+
return this;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Constructs a new {@link TableNode} with the specified MDAST table node as
|
|
163
|
+
* the object to edit. See
|
|
164
|
+
* {@link https://github.com/micromark/micromark-extension-gfm-table | micromark/micromark-extension-gfm-table}
|
|
165
|
+
* for more information on the MDAST table node.
|
|
166
|
+
*/
|
|
167
|
+
constructor(mdastNode) {
|
|
168
|
+
this.__mdastNode = mdastNode ?? { type: "gridTable", children: [] };
|
|
169
|
+
this.doc = Text.of(this.toMarkdown().split("\n"));
|
|
170
|
+
this.__grid = createVirtualGrid(this.__mdastNode, this.doc);
|
|
171
|
+
}
|
|
172
|
+
/** Returns the mdast node that this node is constructed from. */
|
|
173
|
+
getMdastNode() {
|
|
174
|
+
return this.__mdastNode;
|
|
175
|
+
}
|
|
176
|
+
/** @internal */
|
|
177
|
+
updateCellContents(x, y, children) {
|
|
178
|
+
if (typeof children === "string") {
|
|
179
|
+
const root = fromMarkdown(children, {
|
|
180
|
+
extensions: [gridTables],
|
|
181
|
+
mdastExtensions: [gridTablesFromMarkdown()],
|
|
182
|
+
});
|
|
183
|
+
this.updateCellContents(x, y, root.children);
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
const gridItem = getCellAtPosition(this.__grid, x, y);
|
|
187
|
+
if (!gridItem)
|
|
188
|
+
return;
|
|
189
|
+
const table = this.__mdastNode;
|
|
190
|
+
const section = table.children[gridItem.sectionIndex];
|
|
191
|
+
const row = section.children[gridItem.rowIndex];
|
|
192
|
+
const cells = row.children;
|
|
193
|
+
const cell = cells[gridItem.cellIndex];
|
|
194
|
+
const cellsClone = Array.from(cells);
|
|
195
|
+
const cellClone = { ...cell, children };
|
|
196
|
+
const rowClone = { ...row, children: cellsClone };
|
|
197
|
+
cellsClone[gridItem.cellIndex] = cellClone;
|
|
198
|
+
section.children[gridItem.rowIndex] = rowClone;
|
|
199
|
+
this.rerender();
|
|
200
|
+
}
|
|
201
|
+
insertColumnAt(colIndex) {
|
|
202
|
+
for (let rowIndex = 0; rowIndex < this.__grid.maxRows; rowIndex++) {
|
|
203
|
+
const row = this.__grid.rows[rowIndex];
|
|
204
|
+
const pos = getCellAtPosition(this.__grid, colIndex, rowIndex);
|
|
205
|
+
if (pos) {
|
|
206
|
+
if (pos.cell.colSpan > 1) {
|
|
207
|
+
pos.cell.colSpan += 1;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
pos.row.children.splice(pos.cellIndex, 0, {
|
|
211
|
+
...structuredClone(EMPTY_CELL),
|
|
212
|
+
rowSpan: pos.cell.rowSpan,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
else {
|
|
217
|
+
for (let i = this.__grid.maxCols - 1; i < colIndex; i++) {
|
|
218
|
+
row.row.children.push(structuredClone(EMPTY_CELL));
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
this.rerender();
|
|
223
|
+
}
|
|
224
|
+
deleteColumnAt(colIndex) {
|
|
225
|
+
for (let rowIndex = 0; rowIndex < this.__grid.maxRows; rowIndex++) {
|
|
226
|
+
const row = this.__grid.rows[rowIndex];
|
|
227
|
+
const pos = getCellAtPosition(this.__grid, colIndex, rowIndex);
|
|
228
|
+
if (pos) {
|
|
229
|
+
if (pos.cell.colSpan > 1) {
|
|
230
|
+
pos.cell.colSpan -= 1;
|
|
231
|
+
}
|
|
232
|
+
else {
|
|
233
|
+
pos.row.children.splice(pos.cellIndex, 1);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
else {
|
|
237
|
+
row.row.children.splice(colIndex);
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
this.rerender();
|
|
241
|
+
}
|
|
242
|
+
duplicateColumnAt(colIndex) {
|
|
243
|
+
for (let rowIndex = 0; rowIndex < this.__grid.maxRows; rowIndex++) {
|
|
244
|
+
const pos = getCellAtPosition(this.__grid, colIndex, rowIndex);
|
|
245
|
+
if (pos) {
|
|
246
|
+
pos.row.children.splice(pos.cellIndex, 0, structuredClone(pos.cell));
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
this.rerender();
|
|
250
|
+
}
|
|
251
|
+
moveColumn(colIndex, newIndex) {
|
|
252
|
+
for (let rowIndex = 0; rowIndex < this.__grid.maxRows; rowIndex++) {
|
|
253
|
+
const pos = getCellAtPosition(this.__grid, colIndex, rowIndex);
|
|
254
|
+
const newPos = getCellAtPosition(this.__grid, newIndex, rowIndex);
|
|
255
|
+
if (pos && newPos) {
|
|
256
|
+
arrayMove(pos.row.children, pos.cellIndex, newPos.cellIndex, EMPTY_CELL);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
this.rerender();
|
|
260
|
+
}
|
|
261
|
+
position(rowIndex, colIndex) {
|
|
262
|
+
const element = getCellAtPosition(this.__grid, colIndex ?? 0, rowIndex);
|
|
263
|
+
if (!element) {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
const cell = element.cell;
|
|
267
|
+
if (cell.position) {
|
|
268
|
+
const pos = structuredClone(cell.position);
|
|
269
|
+
pos.start.offset = 1 + pos.start.offset;
|
|
270
|
+
pos.end.offset = pos.end.offset - 1;
|
|
271
|
+
return pos;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
positions(rowIndex, colIndex) {
|
|
275
|
+
const cell = getCellAtPosition(this.__grid, colIndex ?? 0, rowIndex);
|
|
276
|
+
if (!cell) {
|
|
277
|
+
return [];
|
|
278
|
+
}
|
|
279
|
+
return cell.cell.positions;
|
|
280
|
+
}
|
|
281
|
+
coordsAt(position) {
|
|
282
|
+
const cell = getCellAtOffset(this.__grid, position);
|
|
283
|
+
if (!cell) {
|
|
284
|
+
return [-1, -1];
|
|
285
|
+
}
|
|
286
|
+
return [cell.x, cell.y];
|
|
287
|
+
}
|
|
288
|
+
cellAt(position, delta) {
|
|
289
|
+
let cell;
|
|
290
|
+
if (typeof position === "number") {
|
|
291
|
+
cell = getCellAtOffset(this.__grid, position);
|
|
292
|
+
}
|
|
293
|
+
else {
|
|
294
|
+
cell = getCellAtPosition(this.__grid, position.x, position.y);
|
|
295
|
+
}
|
|
296
|
+
return delta ? this.nextColumn(cell, delta) : cell;
|
|
297
|
+
}
|
|
298
|
+
nextColumn(cell, { x, y }) {
|
|
299
|
+
if (!cell || (x == 0 && y === 0)) {
|
|
300
|
+
return cell;
|
|
301
|
+
}
|
|
302
|
+
let next = getCellAtPosition(this.__grid, cell.x + x, cell.y + y);
|
|
303
|
+
while (next && next.cell === cell.cell) {
|
|
304
|
+
next = getCellAtPosition(this.__grid, next.x + x, next.y + y);
|
|
305
|
+
}
|
|
306
|
+
return next;
|
|
307
|
+
}
|
|
308
|
+
get lastCell() {
|
|
309
|
+
return getCellAtPosition(this.__grid, this.__grid.maxCols - 1, this.__grid.maxRows - 1);
|
|
310
|
+
}
|
|
311
|
+
duplicateRowAt(y) {
|
|
312
|
+
const cell = getCellAtPosition(this.__grid, 0, y);
|
|
313
|
+
if (!cell) {
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
const row = this.__grid.rows[cell.rowIndex];
|
|
317
|
+
const newRow = structuredClone(row.row);
|
|
318
|
+
cell.section.children.splice(cell.rowIndex, 0, newRow);
|
|
319
|
+
this.rerender();
|
|
320
|
+
}
|
|
321
|
+
getColCount() {
|
|
322
|
+
return this.__grid.maxCols;
|
|
323
|
+
}
|
|
324
|
+
getRowCount() {
|
|
325
|
+
return this.__grid.maxRows;
|
|
326
|
+
}
|
|
327
|
+
getRows(type) {
|
|
328
|
+
if (!type) {
|
|
329
|
+
return this.__grid.rows;
|
|
330
|
+
}
|
|
331
|
+
return this.__grid.rows.filter((it) => it.section.type === type);
|
|
332
|
+
}
|
|
333
|
+
get grid() {
|
|
334
|
+
return this.__grid.grid;
|
|
335
|
+
}
|
|
336
|
+
moveRow(oldIndex, newIndex) {
|
|
337
|
+
const cell = getCellAtPosition(this.__grid, 0, oldIndex);
|
|
338
|
+
const newCell = getCellAtPosition(this.__grid, 0, newIndex);
|
|
339
|
+
if (!cell || !newCell) {
|
|
340
|
+
return;
|
|
341
|
+
}
|
|
342
|
+
newCell.section.children.splice(newCell.rowIndex, 0, cell.section.children.splice(cell.rowIndex, 1)[0]);
|
|
343
|
+
this.rerender();
|
|
344
|
+
}
|
|
345
|
+
sort(colIndex, asc = true) {
|
|
346
|
+
const sections = this.__mdastNode.children.filter((section) => section.type === "gtBody");
|
|
347
|
+
const sortableSections = sections.length
|
|
348
|
+
? sections
|
|
349
|
+
: this.__mdastNode.children;
|
|
350
|
+
const direction = asc ? 1 : -1;
|
|
351
|
+
for (const section of sortableSections) {
|
|
352
|
+
section.children.sort((a, b) => {
|
|
353
|
+
const aValue = a.children[colIndex]?.content ?? "";
|
|
354
|
+
const bValue = b.children[colIndex]?.content ?? "";
|
|
355
|
+
return (aValue.localeCompare(bValue, undefined, {
|
|
356
|
+
numeric: true,
|
|
357
|
+
sensitivity: "base",
|
|
358
|
+
}) * direction);
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
this.rerender();
|
|
362
|
+
}
|
|
363
|
+
insertRowAt(y) {
|
|
364
|
+
let cell = null;
|
|
365
|
+
const newRow = {
|
|
366
|
+
type: "gtRow",
|
|
367
|
+
children: Array.from({ length: this.getColCount() }, () => structuredClone(EMPTY_CELL)),
|
|
368
|
+
};
|
|
369
|
+
const rows = [];
|
|
370
|
+
for (let i = y; i >= 0; i--) {
|
|
371
|
+
cell = getCellAtPosition(this.__grid, 0, i);
|
|
372
|
+
if (cell)
|
|
373
|
+
break;
|
|
374
|
+
rows.push(structuredClone(newRow));
|
|
375
|
+
}
|
|
376
|
+
if (!cell) {
|
|
377
|
+
return;
|
|
378
|
+
}
|
|
379
|
+
if (cell.y === y) {
|
|
380
|
+
cell.section.children.splice(cell.rowIndex, 0, structuredClone(newRow));
|
|
381
|
+
}
|
|
382
|
+
else {
|
|
383
|
+
cell.section.children.push(...rows);
|
|
384
|
+
}
|
|
385
|
+
this.rerender();
|
|
386
|
+
}
|
|
387
|
+
deleteRowAt(rowIndex) {
|
|
388
|
+
const cell = getCellAtPosition(this.__grid, 0, rowIndex);
|
|
389
|
+
if (!cell) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
cell.section.children.splice(cell.rowIndex, 1);
|
|
393
|
+
this.rerender();
|
|
394
|
+
}
|
|
395
|
+
addRowToBottom() {
|
|
396
|
+
this.insertRowAt(this.getRowCount());
|
|
397
|
+
this.rerender();
|
|
398
|
+
}
|
|
399
|
+
addColumnToRight() {
|
|
400
|
+
this.insertColumnAt(this.getColCount());
|
|
401
|
+
this.rerender();
|
|
402
|
+
}
|
|
403
|
+
setColumnAlign(coords, { align, valign, }) {
|
|
404
|
+
const cells = Array.isArray(coords) ? coords : [coords];
|
|
405
|
+
cells.forEach((pos) => {
|
|
406
|
+
const cell = getCellAtPosition(this.__grid, pos.x, pos.y);
|
|
407
|
+
if (!cell) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
cell.cell.valign = valign ?? cell.cell.valign;
|
|
411
|
+
cell.cell.align = align ?? cell.cell.align;
|
|
412
|
+
});
|
|
413
|
+
this.rerender();
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
/**
|
|
417
|
+
* Creates a {@link TableNode}. Use this instead of the constructor to follow the
|
|
418
|
+
* Lexical conventions.
|
|
419
|
+
*
|
|
420
|
+
* @param mdastNode - The mdast node to create the {@link TableNode} from.
|
|
421
|
+
* @group Table
|
|
422
|
+
*/
|
|
423
|
+
export function $createTableNode(mdastNode) {
|
|
424
|
+
return new GridTableNode(mdastNode);
|
|
425
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grid-table.test.d.ts","sourceRoot":"","sources":["../../src/tables/grid-table.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import { describe, expect, it } from "vitest";
|
|
2
|
+
import { GridTableNode } from "./grid-table";
|
|
3
|
+
function parseGridTable(markdown) {
|
|
4
|
+
const node = GridTableNode.fromMarkdown(markdown);
|
|
5
|
+
expect(node).not.toBeNull();
|
|
6
|
+
return node;
|
|
7
|
+
}
|
|
8
|
+
function reparseGridTable(node) {
|
|
9
|
+
return parseGridTable(node.toMarkdown());
|
|
10
|
+
}
|
|
11
|
+
function gridCellContent(node, rowIndex, colIndex) {
|
|
12
|
+
return node.grid[rowIndex]?.[colIndex]?.cell.content ?? "";
|
|
13
|
+
}
|
|
14
|
+
const sampleGridTable = [
|
|
15
|
+
"+----------------------+-------------------------+",
|
|
16
|
+
"| Feature | Behavior |",
|
|
17
|
+
"+======================+=========================+",
|
|
18
|
+
"| Row and column menus | Kebab dropdown actions |",
|
|
19
|
+
"+----------------------+-------------------------+",
|
|
20
|
+
"| Drag handles | Reorder rows/columns |",
|
|
21
|
+
"+----------------------+-------------------------+",
|
|
22
|
+
"| Source toggle | Edit raw Markdown |",
|
|
23
|
+
"+----------------------+-------------------------+",
|
|
24
|
+
].join("\n");
|
|
25
|
+
const adobeOverviewGridTable = [
|
|
26
|
+
"+-------------------+------+",
|
|
27
|
+
"| Table Headings | Here |",
|
|
28
|
+
"+--------+----------+------+",
|
|
29
|
+
"| Sub | Headings | Too |",
|
|
30
|
+
"+========+=================+",
|
|
31
|
+
"| cell | column spanning |",
|
|
32
|
+
"| spans +---------:+------+",
|
|
33
|
+
"| rows | normal | cell |",
|
|
34
|
+
"+---v----+:---------------:+",
|
|
35
|
+
"| | cells can be |",
|
|
36
|
+
"| | *formatted* |",
|
|
37
|
+
"| | **paragraphs** |",
|
|
38
|
+
"| | ``` |",
|
|
39
|
+
"| multi | and contain |",
|
|
40
|
+
"| line | blocks |",
|
|
41
|
+
"| cells | ``` |",
|
|
42
|
+
"+========+=========:+======+",
|
|
43
|
+
"| footer | cells | |",
|
|
44
|
+
"+--------+----------+------+",
|
|
45
|
+
].join("\n");
|
|
46
|
+
const horizontalAlignmentExamples = [
|
|
47
|
+
{ align: "justify", markdown: ["+>-----<+", "| A b C |", "+-------+"] },
|
|
48
|
+
{ align: "center", markdown: ["+:-----:+", "| ABC |", "+-------+"] },
|
|
49
|
+
{ align: "left", markdown: ["+:------+", "| ABC |", "+------+"] },
|
|
50
|
+
{ align: "right", markdown: ["+------:+", "| ABC |", "+------+"] },
|
|
51
|
+
];
|
|
52
|
+
const verticalAlignmentExamples = [
|
|
53
|
+
{
|
|
54
|
+
markdown: [
|
|
55
|
+
"+---^---+",
|
|
56
|
+
"| Larum |",
|
|
57
|
+
"| Ipsum |",
|
|
58
|
+
"| |",
|
|
59
|
+
"| |",
|
|
60
|
+
"+-------+",
|
|
61
|
+
],
|
|
62
|
+
valign: "top",
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
markdown: [
|
|
66
|
+
"+---x---+",
|
|
67
|
+
"| |",
|
|
68
|
+
"| Larum |",
|
|
69
|
+
"| Ipsum |",
|
|
70
|
+
"| |",
|
|
71
|
+
"+-------+",
|
|
72
|
+
],
|
|
73
|
+
valign: "middle",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
markdown: [
|
|
77
|
+
"+---v---+",
|
|
78
|
+
"| |",
|
|
79
|
+
"| |",
|
|
80
|
+
"| Larum |",
|
|
81
|
+
"| Ipsum |",
|
|
82
|
+
"+-------+",
|
|
83
|
+
],
|
|
84
|
+
valign: "bottom",
|
|
85
|
+
},
|
|
86
|
+
];
|
|
87
|
+
describe("GridTableNode", () => {
|
|
88
|
+
it("uses the Lapis grid table model", () => {
|
|
89
|
+
const node = GridTableNode.fromMarkdown([
|
|
90
|
+
"+---------+----------+",
|
|
91
|
+
"| Feature | Behavior |",
|
|
92
|
+
"+=========+==========+",
|
|
93
|
+
"| Handles | Actions |",
|
|
94
|
+
"+---------+----------+",
|
|
95
|
+
].join("\n"));
|
|
96
|
+
expect(node).not.toBeNull();
|
|
97
|
+
expect(node?.getRowCount()).toBe(2);
|
|
98
|
+
expect(node?.getColCount()).toBe(2);
|
|
99
|
+
expect(node?.toMarkdown()).toContain("Feature");
|
|
100
|
+
});
|
|
101
|
+
it("preserves table shape after inserting rows and columns", () => {
|
|
102
|
+
const node = parseGridTable(sampleGridTable);
|
|
103
|
+
node.insertRowAt(node.getRowCount());
|
|
104
|
+
node.insertColumnAt(node.getColCount());
|
|
105
|
+
const reparsed = reparseGridTable(node);
|
|
106
|
+
expect(reparsed.getRowCount()).toBe(5);
|
|
107
|
+
expect(reparsed.getColCount()).toBe(3);
|
|
108
|
+
expect(gridCellContent(reparsed, 0, 0)).toBe("Feature");
|
|
109
|
+
expect(gridCellContent(reparsed, 1, 1)).toBe("Kebab dropdown actions");
|
|
110
|
+
});
|
|
111
|
+
it("preserves table shape after moving rows and columns", () => {
|
|
112
|
+
const node = parseGridTable(sampleGridTable);
|
|
113
|
+
node.moveRow(2, 1);
|
|
114
|
+
node.moveColumn(1, 0);
|
|
115
|
+
const reparsed = reparseGridTable(node);
|
|
116
|
+
expect(reparsed.getRowCount()).toBe(4);
|
|
117
|
+
expect(reparsed.getColCount()).toBe(2);
|
|
118
|
+
expect(gridCellContent(reparsed, 0, 0)).toBe("Behavior");
|
|
119
|
+
expect(gridCellContent(reparsed, 1, 1)).toBe("Drag handles");
|
|
120
|
+
});
|
|
121
|
+
it("parses the Adobe grid-table overview example with merged rows and columns", () => {
|
|
122
|
+
const node = parseGridTable(adobeOverviewGridTable);
|
|
123
|
+
const cells = node
|
|
124
|
+
.getMdastNode()
|
|
125
|
+
.children.flatMap((section) => section.children.flatMap((row) => row.children));
|
|
126
|
+
expect(node.getColCount()).toBe(3);
|
|
127
|
+
expect(cells.some((cell) => cell.colSpan > 1)).toBe(true);
|
|
128
|
+
expect(cells.some((cell) => cell.rowSpan > 1)).toBe(true);
|
|
129
|
+
expect(cells.some((cell) => cell.content.includes("*formatted*"))).toBe(true);
|
|
130
|
+
expect(node.toMarkdown()).toContain("column spanning");
|
|
131
|
+
});
|
|
132
|
+
it.each(horizontalAlignmentExamples)("parses Adobe horizontal $align grid-table alignment", ({ align, markdown }) => {
|
|
133
|
+
const node = parseGridTable(markdown.join("\n"));
|
|
134
|
+
expect(node.grid[0]?.[0]?.cell.align).toBe(align);
|
|
135
|
+
});
|
|
136
|
+
it.each(verticalAlignmentExamples)("parses Adobe vertical $valign grid-table alignment", ({ valign, markdown }) => {
|
|
137
|
+
const node = parseGridTable(markdown.join("\n"));
|
|
138
|
+
expect(node.grid[0]?.[0]?.cell.valign).toBe(valign);
|
|
139
|
+
});
|
|
140
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from "./extension";
|
|
2
|
+
export * from "./pipe-table";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export * from "./widgets/grid-table-widget";
|
|
5
|
+
export * from "./widgets/pipe-table-widget";
|
|
6
|
+
export { GridTableNode, type ColType, type GridType, type RowType, } from "./grid-table";
|
|
7
|
+
export { $convertTableElement, TableNode } from "./table-node";
|
|
8
|
+
import EditorColumn from "./editor-column.svelte";
|
|
9
|
+
import EditorTable from "./editor-table.svelte";
|
|
10
|
+
import GridEditorColumn from "./grid-editor-column.svelte";
|
|
11
|
+
import GridEditorTable from "./grid-editor-table.svelte";
|
|
12
|
+
export { EditorColumn, EditorColumn as column, EditorTable, EditorTable as Table, GridEditorColumn, GridEditorColumn as GridColumn, GridEditorTable, GridEditorTable as GridTable, };
|
|
13
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tables/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,OAAO,EACL,aAAa,EACb,KAAK,OAAO,EACZ,KAAK,QAAQ,EACb,KAAK,OAAO,GACb,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,YAAY,MAAM,wBAAwB,CAAC;AAClD,OAAO,WAAW,MAAM,uBAAuB,CAAC;AAChD,OAAO,gBAAgB,MAAM,6BAA6B,CAAC;AAC3D,OAAO,eAAe,MAAM,4BAA4B,CAAC;AAEzD,OAAO,EACL,YAAY,EACZ,YAAY,IAAI,MAAM,EACtB,WAAW,EACX,WAAW,IAAI,KAAK,EACpB,gBAAgB,EAChB,gBAAgB,IAAI,UAAU,EAC9B,eAAe,EACf,eAAe,IAAI,SAAS,GAC7B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * from "./extension";
|
|
2
|
+
export * from "./pipe-table";
|
|
3
|
+
export * from "./types";
|
|
4
|
+
export * from "./widgets/grid-table-widget";
|
|
5
|
+
export * from "./widgets/pipe-table-widget";
|
|
6
|
+
export { GridTableNode, } from "./grid-table";
|
|
7
|
+
export { $convertTableElement, TableNode } from "./table-node";
|
|
8
|
+
import EditorColumn from "./editor-column.svelte";
|
|
9
|
+
import EditorTable from "./editor-table.svelte";
|
|
10
|
+
import GridEditorColumn from "./grid-editor-column.svelte";
|
|
11
|
+
import GridEditorTable from "./grid-editor-table.svelte";
|
|
12
|
+
export { EditorColumn, EditorColumn as column, EditorTable, EditorTable as Table, GridEditorColumn, GridEditorColumn as GridColumn, GridEditorTable, GridEditorTable as GridTable, };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../../src/tables/index.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-editor-extensions.d.ts","sourceRoot":"","sources":["../../src/tables/inline-editor-extensions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAMnD,wBAAgB,mCAAmC,IAAI,SAAS,EAAE,CAUjE"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { syntaxHighlighting } from "@codemirror/language";
|
|
2
|
+
import { EditorView, drawSelection } from "@codemirror/view";
|
|
3
|
+
import { history } from "@codemirror/commands";
|
|
4
|
+
import { miraClassHighlighter } from "@lapismd/mira/codemirror";
|
|
5
|
+
import { createMarkdownCodeMirrorExtensions } from "@lapismd/mira/codemirror";
|
|
6
|
+
export function createInlineTableMarkdownExtensions() {
|
|
7
|
+
return [
|
|
8
|
+
drawSelection(),
|
|
9
|
+
EditorView.lineWrapping,
|
|
10
|
+
history(),
|
|
11
|
+
EditorView.editable.of(true),
|
|
12
|
+
EditorView.editorAttributes.of({ class: "mod-inline" }),
|
|
13
|
+
syntaxHighlighting(miraClassHighlighter),
|
|
14
|
+
createMarkdownCodeMirrorExtensions(),
|
|
15
|
+
];
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inline-editor-extensions.test.d.ts","sourceRoot":"","sources":["../../src/tables/inline-editor-extensions.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { syntaxTree } from "@codemirror/language";
|
|
2
|
+
import { EditorState } from "@codemirror/state";
|
|
3
|
+
import { describe, expect, it } from "vitest";
|
|
4
|
+
import { createInlineTableMarkdownExtensions } from "./inline-editor-extensions";
|
|
5
|
+
describe("createInlineTableMarkdownExtensions", () => {
|
|
6
|
+
it("uses the shared Mira Markdown parser for rich table cell editing", () => {
|
|
7
|
+
const state = EditorState.create({
|
|
8
|
+
doc: [
|
|
9
|
+
"**bold** _italic_ `code` [[Project Plan|Plan]] ![[Diagram]] #mira/table",
|
|
10
|
+
"\\(x + 1\\)",
|
|
11
|
+
].join("\n"),
|
|
12
|
+
extensions: createInlineTableMarkdownExtensions(),
|
|
13
|
+
});
|
|
14
|
+
const tree = syntaxTree(state).toString();
|
|
15
|
+
expect(tree).toContain("StrongEmphasis");
|
|
16
|
+
expect(tree).toContain("Emphasis");
|
|
17
|
+
expect(tree).toContain("InlineCode");
|
|
18
|
+
expect(tree).toContain("WikiLink");
|
|
19
|
+
expect(tree).toContain("EmbedLink");
|
|
20
|
+
expect(tree).toContain("Tag");
|
|
21
|
+
expect(tree).toContain("InlineMathBracket");
|
|
22
|
+
});
|
|
23
|
+
});
|