@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,92 @@
|
|
|
1
|
+
import type * as Mdast from "mdast";
|
|
2
|
+
type CoordinatesSubscription = (coords: [colIndex: number, rowIndex: number]) => void;
|
|
3
|
+
export type TableCellCoordinates = [rowIndex: number, colIndex: number];
|
|
4
|
+
export declare class TableNode {
|
|
5
|
+
/** @internal */
|
|
6
|
+
__mdastNode: Mdast.Table;
|
|
7
|
+
/** @internal */
|
|
8
|
+
__displayMdastNode: Mdast.Table;
|
|
9
|
+
/** @internal */
|
|
10
|
+
__hasSpans: boolean;
|
|
11
|
+
/** @internal */
|
|
12
|
+
focusEmitter: {
|
|
13
|
+
publish: (coords: [colIndex: number, rowIndex: number]) => void;
|
|
14
|
+
subscribe: (cb: CoordinatesSubscription) => void;
|
|
15
|
+
};
|
|
16
|
+
/** @internal */
|
|
17
|
+
static clone(node: TableNode): TableNode;
|
|
18
|
+
static fromMarkdown(doc: string): TableNode | null;
|
|
19
|
+
static toMarkdown(node: Mdast.Nodes): string;
|
|
20
|
+
toMarkdown(): string;
|
|
21
|
+
rerender(): this;
|
|
22
|
+
/**
|
|
23
|
+
* Constructs a new {@link TableNode} with the specified MDAST table node as
|
|
24
|
+
* the object to edit. See
|
|
25
|
+
* {@link https://github.com/micromark/micromark-extension-gfm-table | micromark/micromark-extension-gfm-table}
|
|
26
|
+
* for more information on the MDAST table node.
|
|
27
|
+
*/
|
|
28
|
+
constructor(mdastNode?: Mdast.Table, displayModel?: {
|
|
29
|
+
table: Mdast.Table;
|
|
30
|
+
hasSpans: boolean;
|
|
31
|
+
});
|
|
32
|
+
/** Returns the mdast node that this node is constructed from. */
|
|
33
|
+
getMdastNode(): Mdast.Table;
|
|
34
|
+
/** Returns the table shape used for display in live-preview widgets. */
|
|
35
|
+
getDisplayMdastNode(): Mdast.Table;
|
|
36
|
+
/** Returns whether the display table contains MultiMarkdown spans. */
|
|
37
|
+
hasSpans(): boolean;
|
|
38
|
+
/** Returns source-cell coordinates covered by a display row. */
|
|
39
|
+
getCellsInDisplayRow(rowIndex: number): TableCellCoordinates[];
|
|
40
|
+
/** Returns source-cell coordinates covered by a display column. */
|
|
41
|
+
getCellsInDisplayColumn(colIndex: number): TableCellCoordinates[];
|
|
42
|
+
/** Returns source-cell coordinates covered by a display rectangle. */
|
|
43
|
+
getCellsInDisplayRange(start: TableCellCoordinates, end: TableCellCoordinates): TableCellCoordinates[];
|
|
44
|
+
/** Returns the number of rows in the table. */
|
|
45
|
+
getRowCount(): number;
|
|
46
|
+
/** Returns the number of columns in the table. */
|
|
47
|
+
getColCount(): number;
|
|
48
|
+
/** @internal */
|
|
49
|
+
updateCellContents(colIndex: number, rowIndex: number, children: Mdast.PhrasingContent[] | string): void;
|
|
50
|
+
insertColumnAt(colIndex: number): void;
|
|
51
|
+
deleteColumnAt(colIndex: number): void;
|
|
52
|
+
duplicateColumnAt(colIndex: number): void;
|
|
53
|
+
moveColumn(colIndex: number, newIndex: number): void;
|
|
54
|
+
position(rowIndex: number, colIndex?: number): any;
|
|
55
|
+
coordsAt(position: number): number[] | undefined;
|
|
56
|
+
get lastCell(): number[];
|
|
57
|
+
duplicateRowAt(y: number): void;
|
|
58
|
+
moveRow(oldIndex: number, newIndex: number): void;
|
|
59
|
+
insertRowAt(y: number): void;
|
|
60
|
+
deleteRowAt(rowIndex: number): void;
|
|
61
|
+
transpose(): void;
|
|
62
|
+
sort(columnIndex: number, asc?: boolean): void;
|
|
63
|
+
addRowToBottom(): void;
|
|
64
|
+
addColumnToRight(): void;
|
|
65
|
+
setColumnAlign(colIndex: number, align: Mdast.AlignType): void;
|
|
66
|
+
/**
|
|
67
|
+
* Focuses the table cell at the specified coordinates. Pass `undefined` to
|
|
68
|
+
* remove the focus.
|
|
69
|
+
*/
|
|
70
|
+
select(coords?: [colIndex: number, rowIndex: number]): void;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Creates a {@link TableNode}. Use this instead of the constructor to follow the
|
|
74
|
+
* Lexical conventions.
|
|
75
|
+
*
|
|
76
|
+
* @param mdastNode - The mdast node to create the {@link TableNode} from.
|
|
77
|
+
* @group Table
|
|
78
|
+
*/
|
|
79
|
+
export declare function $createTableNode(mdastNode: Mdast.Table): TableNode;
|
|
80
|
+
/**
|
|
81
|
+
* Converts an HTML table element into a {@link TableNode}. This function is used
|
|
82
|
+
* to transform a DOM table element into a format that can be used by Lexical.
|
|
83
|
+
* It extracts the rows and cells from the table, converting them into
|
|
84
|
+
* MDAST-compatible nodes.
|
|
85
|
+
*
|
|
86
|
+
* @param element - The HTML table element to convert.
|
|
87
|
+
* @returns A {@link TableNode} containing the converted {@link TableNode}.
|
|
88
|
+
* @group Table
|
|
89
|
+
*/
|
|
90
|
+
export declare function $convertTableElement(element: HTMLElement): TableNode;
|
|
91
|
+
export {};
|
|
92
|
+
//# sourceMappingURL=table-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-node.d.ts","sourceRoot":"","sources":["../../src/tables/table-node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAWpC,KAAK,uBAAuB,GAAG,CAC7B,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,KACzC,IAAI,CAAC;AAEV,MAAM,MAAM,oBAAoB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;AAoPxE,qBAAa,SAAS;IACpB,gBAAgB;IAChB,WAAW,EAAE,KAAK,CAAC,KAAK,CAAC;IACzB,gBAAgB;IAChB,kBAAkB,EAAE,KAAK,CAAC,KAAK,CAAC;IAChC,gBAAgB;IAChB,UAAU,UAAS;IACnB,gBAAgB;IAChB,YAAY;0BAvPQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC;wBAGtC,uBAAuB;MAoPL;IAEpC,gBAAgB;IAChB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAOxC,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,MAAM;IAc/B,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,KAAK,CAAC,KAAK,GAAG,MAAM;IAM5C,UAAU;IAMV,QAAQ,IAAI,IAAI;IAQhB;;;;;OAKG;gBAED,SAAS,CAAC,EAAE,KAAK,CAAC,KAAK,EACvB,YAAY,CAAC,EAAE;QAAE,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE;IAO1D,iEAAiE;IACjE,YAAY,IAAI,KAAK,CAAC,KAAK;IAI3B,wEAAwE;IACxE,mBAAmB,IAAI,KAAK,CAAC,KAAK;IAIlC,sEAAsE;IACtE,QAAQ,IAAI,OAAO;IAInB,gEAAgE;IAChE,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,EAAE;IAO9D,mEAAmE;IACnE,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG,oBAAoB,EAAE;IAOjE,sEAAsE;IACtE,sBAAsB,CACpB,KAAK,EAAE,oBAAoB,EAC3B,GAAG,EAAE,oBAAoB,GACxB,oBAAoB,EAAE;IAoDzB,+CAA+C;IAC/C,WAAW,IAAI,MAAM;IAIrB,kDAAkD;IAClD,WAAW,IAAI,MAAM;IAIrB,gBAAgB;IAChB,kBAAkB,CAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,KAAK,CAAC,eAAe,EAAE,GAAG,MAAM,GACzC,IAAI;IAwBP,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAgBtC,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAYtC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAYzC,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAYpD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,GAAG;IAsBlD,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAwBzB,IAAI,QAAQ,aAEX;IAED,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAM/B,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAUjD,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI;IAW5B,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAInC,SAAS;IAaT,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,GAAG,GAAE,OAAc;IAe7C,cAAc,IAAI,IAAI;IAItB,gBAAgB,IAAI,IAAI;IAIxB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,SAAS;IAQvD;;;OAGG;IACH,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,CAAC,GAAG,IAAI;CAG5D;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,GAAG,SAAS,CAElE;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,CAuBpE"}
|
|
@@ -0,0 +1,514 @@
|
|
|
1
|
+
import { gfmTable } from "micromark-extension-gfm-table";
|
|
2
|
+
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
3
|
+
import { gfmTableFromMarkdown, gfmTableToMarkdown } from "mdast-util-gfm-table";
|
|
4
|
+
import { toMarkdown } from "mdast-util-to-markdown";
|
|
5
|
+
const EMPTY_CELL = {
|
|
6
|
+
type: "tableCell",
|
|
7
|
+
children: [],
|
|
8
|
+
};
|
|
9
|
+
function coordinatesEmitter() {
|
|
10
|
+
let subscription = () => { };
|
|
11
|
+
return {
|
|
12
|
+
publish: (coords) => {
|
|
13
|
+
subscription(coords);
|
|
14
|
+
},
|
|
15
|
+
subscribe: (cb) => {
|
|
16
|
+
subscription = cb;
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function arrayMove(arr, old_index, new_index, defaultValue) {
|
|
21
|
+
if (new_index >= arr.length) {
|
|
22
|
+
let k = new_index - arr.length + 1;
|
|
23
|
+
while (k--) {
|
|
24
|
+
arr.push(structuredClone(defaultValue));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
arr.splice(new_index, 0, arr.splice(old_index, 1)[0]);
|
|
28
|
+
return arr;
|
|
29
|
+
}
|
|
30
|
+
function processMultiMarkdownSpans(table) {
|
|
31
|
+
const rows = table.children;
|
|
32
|
+
const columnCount = Math.max(1, rows[0]?.children?.length ?? 1);
|
|
33
|
+
const grid = rows.map(() => []);
|
|
34
|
+
const cellSpans = new Map();
|
|
35
|
+
const cellCoordinates = new Map();
|
|
36
|
+
let hasSpans = false;
|
|
37
|
+
for (let rowIndex = 0; rowIndex < rows.length; rowIndex += 1) {
|
|
38
|
+
const originalCells = rows[rowIndex]?.children ?? [];
|
|
39
|
+
let colIndex = 0;
|
|
40
|
+
for (let cellIndex = 0; cellIndex < originalCells.length; cellIndex += 1) {
|
|
41
|
+
const cell = originalCells[cellIndex];
|
|
42
|
+
if (!cell) {
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
while (grid[rowIndex]?.[colIndex] !== undefined) {
|
|
46
|
+
colIndex += 1;
|
|
47
|
+
}
|
|
48
|
+
const cellText = tableCellText(cell);
|
|
49
|
+
if (cellText === "^") {
|
|
50
|
+
hasSpans = true;
|
|
51
|
+
extendRowspan(grid, cellSpans, rowIndex, colIndex);
|
|
52
|
+
colIndex += 1;
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const colspanInfo = getColspan(originalCells, cellIndex);
|
|
56
|
+
let { colspan } = colspanInfo;
|
|
57
|
+
const { nextCellIndex } = colspanInfo;
|
|
58
|
+
if (colIndex >= columnCount) {
|
|
59
|
+
cellIndex = nextCellIndex - 1;
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
colspan = Math.min(colspan, columnCount - colIndex);
|
|
63
|
+
if (colspan > 1) {
|
|
64
|
+
hasSpans = true;
|
|
65
|
+
}
|
|
66
|
+
grid[rowIndex][colIndex] = cell;
|
|
67
|
+
cellSpans.set(`${rowIndex},${colIndex}`, { rowspan: 1, colspan });
|
|
68
|
+
cellCoordinates.set(`${rowIndex},${colIndex}`, {
|
|
69
|
+
sourceRowIndex: rowIndex,
|
|
70
|
+
sourceColIndex: cellIndex,
|
|
71
|
+
displayColIndex: colIndex,
|
|
72
|
+
});
|
|
73
|
+
for (let offset = 1; offset < colspan; offset += 1) {
|
|
74
|
+
grid[rowIndex][colIndex + offset] = cell;
|
|
75
|
+
}
|
|
76
|
+
cellIndex = nextCellIndex - 1;
|
|
77
|
+
colIndex += colspan;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (!hasSpans) {
|
|
81
|
+
return { table, hasSpans: false };
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
hasSpans: true,
|
|
85
|
+
table: {
|
|
86
|
+
...table,
|
|
87
|
+
children: rows.map((row, rowIndex) => {
|
|
88
|
+
const seenCells = new Set();
|
|
89
|
+
const children = [];
|
|
90
|
+
for (let colIndex = 0; colIndex < columnCount; colIndex += 1) {
|
|
91
|
+
const cell = grid[rowIndex]?.[colIndex];
|
|
92
|
+
if (!cell || seenCells.has(cell)) {
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const spanInfo = cellSpans.get(`${rowIndex},${colIndex}`);
|
|
96
|
+
const sourceCoordinates = cellCoordinates.get(`${rowIndex},${colIndex}`);
|
|
97
|
+
if (!spanInfo || !sourceCoordinates) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
seenCells.add(cell);
|
|
101
|
+
children.push(withTableSpanProperties(cell, spanInfo, sourceCoordinates));
|
|
102
|
+
}
|
|
103
|
+
return { ...row, children };
|
|
104
|
+
}),
|
|
105
|
+
},
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
function extendRowspan(grid, cellSpans, rowIndex, colIndex) {
|
|
109
|
+
for (let checkRow = rowIndex - 1; checkRow >= 0; checkRow -= 1) {
|
|
110
|
+
const spanningCell = grid[checkRow]?.[colIndex];
|
|
111
|
+
if (!spanningCell) {
|
|
112
|
+
continue;
|
|
113
|
+
}
|
|
114
|
+
const spanInfo = cellSpans.get(`${checkRow},${colIndex}`);
|
|
115
|
+
if (spanInfo && checkRow + spanInfo.rowspan === rowIndex) {
|
|
116
|
+
spanInfo.rowspan += 1;
|
|
117
|
+
grid[rowIndex][colIndex] = spanningCell;
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
grid[rowIndex][colIndex] = null;
|
|
122
|
+
}
|
|
123
|
+
function withTableSpanProperties(cell, spanInfo, sourceCoordinates) {
|
|
124
|
+
const nextCell = {
|
|
125
|
+
...cell,
|
|
126
|
+
data: {
|
|
127
|
+
...(cell.data ?? {}),
|
|
128
|
+
hProperties: {
|
|
129
|
+
...(cell.data?.hProperties ??
|
|
130
|
+
{}),
|
|
131
|
+
...sourceCoordinates,
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
if (spanInfo.colspan > 1) {
|
|
136
|
+
nextCell.data.hProperties.colSpan = spanInfo.colspan;
|
|
137
|
+
}
|
|
138
|
+
if (spanInfo.rowspan > 1) {
|
|
139
|
+
nextCell.data.hProperties.rowSpan = spanInfo.rowspan;
|
|
140
|
+
}
|
|
141
|
+
return nextCell;
|
|
142
|
+
}
|
|
143
|
+
function tableCellText(cell) {
|
|
144
|
+
return TableNode.toMarkdown(cell).trim();
|
|
145
|
+
}
|
|
146
|
+
function getColspan(cells, cellIndex) {
|
|
147
|
+
let nextCellIndex = cellIndex + 1;
|
|
148
|
+
let markerCount = 0;
|
|
149
|
+
while (nextCellIndex < cells.length) {
|
|
150
|
+
const nextCell = cells[nextCellIndex];
|
|
151
|
+
if (!nextCell || tableCellText(nextCell) !== "") {
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
markerCount += 1;
|
|
155
|
+
nextCellIndex += 1;
|
|
156
|
+
}
|
|
157
|
+
if (markerCount === 0 || nextCellIndex >= cells.length) {
|
|
158
|
+
return { colspan: 1, nextCellIndex: cellIndex + 1 };
|
|
159
|
+
}
|
|
160
|
+
return { colspan: 1 + markerCount, nextCellIndex };
|
|
161
|
+
}
|
|
162
|
+
function normalizeGfmTableSeparators(markdown) {
|
|
163
|
+
const lines = markdown.split("\n");
|
|
164
|
+
if (lines.length < 2) {
|
|
165
|
+
return markdown;
|
|
166
|
+
}
|
|
167
|
+
lines[1] = lines[1].replace(/:?-+:?/g, (marker) => {
|
|
168
|
+
const leftAligned = marker.startsWith(":");
|
|
169
|
+
const rightAligned = marker.endsWith(":");
|
|
170
|
+
const dashCount = marker.replaceAll(":", "").length;
|
|
171
|
+
if (dashCount >= 3) {
|
|
172
|
+
return marker;
|
|
173
|
+
}
|
|
174
|
+
return `${leftAligned ? ":" : ""}---${rightAligned ? ":" : ""}`;
|
|
175
|
+
});
|
|
176
|
+
return lines.join("\n");
|
|
177
|
+
}
|
|
178
|
+
export class TableNode {
|
|
179
|
+
/** @internal */
|
|
180
|
+
__mdastNode;
|
|
181
|
+
/** @internal */
|
|
182
|
+
__displayMdastNode;
|
|
183
|
+
/** @internal */
|
|
184
|
+
__hasSpans = false;
|
|
185
|
+
/** @internal */
|
|
186
|
+
focusEmitter = coordinatesEmitter();
|
|
187
|
+
/** @internal */
|
|
188
|
+
static clone(node) {
|
|
189
|
+
return new TableNode(structuredClone(node.__mdastNode), {
|
|
190
|
+
table: structuredClone(node.__displayMdastNode),
|
|
191
|
+
hasSpans: node.__hasSpans,
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
static fromMarkdown(doc) {
|
|
195
|
+
const root = fromMarkdown(doc, {
|
|
196
|
+
extensions: [gfmTable()],
|
|
197
|
+
mdastExtensions: [gfmTableFromMarkdown()],
|
|
198
|
+
});
|
|
199
|
+
if (root.children[0]?.type === "table") {
|
|
200
|
+
return new TableNode(root.children[0], processMultiMarkdownSpans(root.children[0]));
|
|
201
|
+
}
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
static toMarkdown(node) {
|
|
205
|
+
return normalizeGfmTableSeparators(toMarkdown(node, { extensions: [gfmTableToMarkdown()] }));
|
|
206
|
+
}
|
|
207
|
+
toMarkdown() {
|
|
208
|
+
return normalizeGfmTableSeparators(toMarkdown(this.__mdastNode, { extensions: [gfmTableToMarkdown()] }));
|
|
209
|
+
}
|
|
210
|
+
rerender() {
|
|
211
|
+
const next = TableNode.fromMarkdown(this.toMarkdown());
|
|
212
|
+
this.__mdastNode = next.__mdastNode;
|
|
213
|
+
this.__displayMdastNode = next.__displayMdastNode;
|
|
214
|
+
this.__hasSpans = next.__hasSpans;
|
|
215
|
+
return this;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Constructs a new {@link TableNode} with the specified MDAST table node as
|
|
219
|
+
* the object to edit. See
|
|
220
|
+
* {@link https://github.com/micromark/micromark-extension-gfm-table | micromark/micromark-extension-gfm-table}
|
|
221
|
+
* for more information on the MDAST table node.
|
|
222
|
+
*/
|
|
223
|
+
constructor(mdastNode, displayModel) {
|
|
224
|
+
this.__mdastNode = mdastNode ?? { type: "table", children: [] };
|
|
225
|
+
this.__displayMdastNode = displayModel?.table ?? this.__mdastNode;
|
|
226
|
+
this.__hasSpans = displayModel?.hasSpans ?? false;
|
|
227
|
+
}
|
|
228
|
+
/** Returns the mdast node that this node is constructed from. */
|
|
229
|
+
getMdastNode() {
|
|
230
|
+
return this.__mdastNode;
|
|
231
|
+
}
|
|
232
|
+
/** Returns the table shape used for display in live-preview widgets. */
|
|
233
|
+
getDisplayMdastNode() {
|
|
234
|
+
return this.__displayMdastNode;
|
|
235
|
+
}
|
|
236
|
+
/** Returns whether the display table contains MultiMarkdown spans. */
|
|
237
|
+
hasSpans() {
|
|
238
|
+
return this.__hasSpans;
|
|
239
|
+
}
|
|
240
|
+
/** Returns source-cell coordinates covered by a display row. */
|
|
241
|
+
getCellsInDisplayRow(rowIndex) {
|
|
242
|
+
return this.getCellsInDisplayRange([rowIndex, 0], [rowIndex, this.getColCount() - 1]);
|
|
243
|
+
}
|
|
244
|
+
/** Returns source-cell coordinates covered by a display column. */
|
|
245
|
+
getCellsInDisplayColumn(colIndex) {
|
|
246
|
+
return this.getCellsInDisplayRange([0, colIndex], [this.getRowCount() - 1, colIndex]);
|
|
247
|
+
}
|
|
248
|
+
/** Returns source-cell coordinates covered by a display rectangle. */
|
|
249
|
+
getCellsInDisplayRange(start, end) {
|
|
250
|
+
const [row1, col1] = start;
|
|
251
|
+
const [row2, col2] = end;
|
|
252
|
+
const minRow = Math.min(row1, row2);
|
|
253
|
+
const maxRow = Math.max(row1, row2);
|
|
254
|
+
const minCol = Math.min(col1, col2);
|
|
255
|
+
const maxCol = Math.max(col1, col2);
|
|
256
|
+
const cells = [];
|
|
257
|
+
const seen = new Set();
|
|
258
|
+
this.__displayMdastNode.children.forEach((row, displayRowIndex) => {
|
|
259
|
+
row.children.forEach((cell, displayCellIndex) => {
|
|
260
|
+
const hProperties = (cell.data?.hProperties ?? {});
|
|
261
|
+
const sourceRowIndex = Number(hProperties.sourceRowIndex ?? displayRowIndex);
|
|
262
|
+
const sourceColIndex = Number(hProperties.sourceColIndex ?? displayCellIndex);
|
|
263
|
+
const displayColIndex = Number(hProperties.displayColIndex ?? displayCellIndex);
|
|
264
|
+
const rowSpan = Number(hProperties.rowSpan ?? 1);
|
|
265
|
+
const colSpan = Number(hProperties.colSpan ?? 1);
|
|
266
|
+
const cellStartRow = displayRowIndex;
|
|
267
|
+
const cellEndRow = displayRowIndex + rowSpan - 1;
|
|
268
|
+
const cellStartCol = displayColIndex;
|
|
269
|
+
const cellEndCol = displayColIndex + colSpan - 1;
|
|
270
|
+
const intersects = cellStartRow <= maxRow &&
|
|
271
|
+
cellEndRow >= minRow &&
|
|
272
|
+
cellStartCol <= maxCol &&
|
|
273
|
+
cellEndCol >= minCol;
|
|
274
|
+
if (!intersects) {
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
const key = `${sourceRowIndex},${sourceColIndex}`;
|
|
278
|
+
if (!seen.has(key)) {
|
|
279
|
+
seen.add(key);
|
|
280
|
+
cells.push([sourceRowIndex, sourceColIndex]);
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
});
|
|
284
|
+
return cells;
|
|
285
|
+
}
|
|
286
|
+
/** Returns the number of rows in the table. */
|
|
287
|
+
getRowCount() {
|
|
288
|
+
return this.__mdastNode.children.length;
|
|
289
|
+
}
|
|
290
|
+
/** Returns the number of columns in the table. */
|
|
291
|
+
getColCount() {
|
|
292
|
+
return this.__mdastNode.children[0]?.children.length || 0;
|
|
293
|
+
}
|
|
294
|
+
/** @internal */
|
|
295
|
+
updateCellContents(colIndex, rowIndex, children) {
|
|
296
|
+
if (typeof children === "string") {
|
|
297
|
+
const root = fromMarkdown(children, {
|
|
298
|
+
extensions: [gfmTable()],
|
|
299
|
+
mdastExtensions: [gfmTableFromMarkdown()],
|
|
300
|
+
});
|
|
301
|
+
this.updateCellContents(colIndex, rowIndex, root.children);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
const table = this.__mdastNode;
|
|
305
|
+
const row = table.children[rowIndex];
|
|
306
|
+
const cells = row.children;
|
|
307
|
+
const cell = cells[colIndex];
|
|
308
|
+
const cellsClone = Array.from(cells);
|
|
309
|
+
const cellClone = { ...cell, children };
|
|
310
|
+
const rowClone = { ...row, children: cellsClone };
|
|
311
|
+
cellsClone[colIndex] = cellClone;
|
|
312
|
+
table.children[rowIndex] = rowClone;
|
|
313
|
+
}
|
|
314
|
+
insertColumnAt(colIndex) {
|
|
315
|
+
const table = this.__mdastNode;
|
|
316
|
+
for (let rowIndex = 0; rowIndex < table.children.length; rowIndex++) {
|
|
317
|
+
const row = table.children[rowIndex];
|
|
318
|
+
const cells = row.children;
|
|
319
|
+
const cellsClone = Array.from(cells);
|
|
320
|
+
const rowClone = { ...row, children: cellsClone };
|
|
321
|
+
cellsClone.splice(colIndex, 0, structuredClone(EMPTY_CELL));
|
|
322
|
+
table.children[rowIndex] = rowClone;
|
|
323
|
+
}
|
|
324
|
+
if (table.align && table.align.length > 0) {
|
|
325
|
+
table.align.splice(colIndex, 0, null);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
deleteColumnAt(colIndex) {
|
|
329
|
+
const table = this.__mdastNode;
|
|
330
|
+
for (let rowIndex = 0; rowIndex < table.children.length; rowIndex++) {
|
|
331
|
+
const row = table.children[rowIndex];
|
|
332
|
+
const cells = row.children;
|
|
333
|
+
const cellsClone = Array.from(cells);
|
|
334
|
+
const rowClone = { ...row, children: cellsClone };
|
|
335
|
+
cellsClone.splice(colIndex, 1);
|
|
336
|
+
table.children[rowIndex] = rowClone;
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
duplicateColumnAt(colIndex) {
|
|
340
|
+
const table = this.__mdastNode;
|
|
341
|
+
for (let rowIndex = 0; rowIndex < table.children.length; rowIndex++) {
|
|
342
|
+
const row = table.children[rowIndex];
|
|
343
|
+
const cells = row.children;
|
|
344
|
+
const cellsClone = Array.from(cells);
|
|
345
|
+
const rowClone = { ...row, children: cellsClone };
|
|
346
|
+
cellsClone.splice(colIndex, 0, structuredClone(cellsClone[colIndex]));
|
|
347
|
+
table.children[rowIndex] = rowClone;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
moveColumn(colIndex, newIndex) {
|
|
351
|
+
const table = this.__mdastNode;
|
|
352
|
+
for (let rowIndex = 0; rowIndex < table.children.length; rowIndex++) {
|
|
353
|
+
const row = table.children[rowIndex];
|
|
354
|
+
const cells = row.children;
|
|
355
|
+
const cellsClone = Array.from(cells);
|
|
356
|
+
const rowClone = { ...row, children: cellsClone };
|
|
357
|
+
arrayMove(cellsClone, colIndex, newIndex, EMPTY_CELL);
|
|
358
|
+
table.children[rowIndex] = rowClone;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
position(rowIndex, colIndex) {
|
|
362
|
+
const row = this.__mdastNode.children[rowIndex];
|
|
363
|
+
if (!row) {
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
if (colIndex === undefined) {
|
|
367
|
+
return row.position;
|
|
368
|
+
}
|
|
369
|
+
const cell = row.children[colIndex];
|
|
370
|
+
if (cell.children.length > 0 && cell.children[0].position) {
|
|
371
|
+
return cell.children[0].position;
|
|
372
|
+
}
|
|
373
|
+
if (cell.position) {
|
|
374
|
+
const pos = cell.position;
|
|
375
|
+
pos.start.offset = 1 + pos.start.offset;
|
|
376
|
+
pos.end.offset = pos.end.offset - 1;
|
|
377
|
+
return pos;
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
coordsAt(position) {
|
|
381
|
+
const table = this.__mdastNode;
|
|
382
|
+
for (let rowIndex = 0; rowIndex < table.children.length; rowIndex++) {
|
|
383
|
+
const row = table.children[rowIndex];
|
|
384
|
+
const [x, y] = [
|
|
385
|
+
row.position?.start?.offset ?? -1,
|
|
386
|
+
row.position?.end?.offset ?? -1,
|
|
387
|
+
];
|
|
388
|
+
if (x !== -1 && position >= x && y !== -1 && position <= y) {
|
|
389
|
+
const cells = row.children;
|
|
390
|
+
for (let colIndex = 0; colIndex < cells.length; colIndex++) {
|
|
391
|
+
const cell = cells[colIndex];
|
|
392
|
+
const [x, y] = [
|
|
393
|
+
cell.position?.start?.offset ?? -1,
|
|
394
|
+
cell.position?.end?.offset ?? -1,
|
|
395
|
+
];
|
|
396
|
+
if (x !== -1 && position >= x && y !== -1 && position <= y) {
|
|
397
|
+
return [rowIndex, colIndex];
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
get lastCell() {
|
|
404
|
+
return [this.getRowCount() - 1, this.getColCount() - 1];
|
|
405
|
+
}
|
|
406
|
+
duplicateRowAt(y) {
|
|
407
|
+
const table = this.__mdastNode;
|
|
408
|
+
const newRow = structuredClone(table.children[y]);
|
|
409
|
+
table.children.splice(y, 0, newRow);
|
|
410
|
+
}
|
|
411
|
+
moveRow(oldIndex, newIndex) {
|
|
412
|
+
const newRow = {
|
|
413
|
+
type: "tableRow",
|
|
414
|
+
children: Array.from({ length: this.getColCount() }, () => structuredClone(EMPTY_CELL)),
|
|
415
|
+
};
|
|
416
|
+
arrayMove(this.__mdastNode.children, oldIndex, newIndex, newRow);
|
|
417
|
+
}
|
|
418
|
+
insertRowAt(y) {
|
|
419
|
+
const table = this.__mdastNode;
|
|
420
|
+
const newRow = {
|
|
421
|
+
type: "tableRow",
|
|
422
|
+
children: Array.from({ length: this.getColCount() }, () => structuredClone(EMPTY_CELL)),
|
|
423
|
+
};
|
|
424
|
+
table.children.splice(y, 0, newRow);
|
|
425
|
+
}
|
|
426
|
+
deleteRowAt(rowIndex) {
|
|
427
|
+
this.__mdastNode.children.splice(rowIndex, 1);
|
|
428
|
+
}
|
|
429
|
+
transpose() {
|
|
430
|
+
this.__mdastNode.children = this.__mdastNode.children[0].children.map((_, colIndex) => {
|
|
431
|
+
return {
|
|
432
|
+
type: "tableRow",
|
|
433
|
+
children: this.__mdastNode.children.map((row) => row.children[colIndex]),
|
|
434
|
+
};
|
|
435
|
+
});
|
|
436
|
+
}
|
|
437
|
+
sort(columnIndex, asc = true) {
|
|
438
|
+
if (!this.__mdastNode.children.length) {
|
|
439
|
+
return;
|
|
440
|
+
}
|
|
441
|
+
let children = this.__mdastNode.children.slice(1).sort((a, b) => {
|
|
442
|
+
const x = TableNode.toMarkdown(a.children[columnIndex]);
|
|
443
|
+
const y = TableNode.toMarkdown(b.children[columnIndex]);
|
|
444
|
+
return x.localeCompare(y);
|
|
445
|
+
});
|
|
446
|
+
if (!asc) {
|
|
447
|
+
children = children.reverse();
|
|
448
|
+
}
|
|
449
|
+
this.__mdastNode.children = [this.__mdastNode.children[0], ...children];
|
|
450
|
+
}
|
|
451
|
+
addRowToBottom() {
|
|
452
|
+
this.insertRowAt(this.getRowCount());
|
|
453
|
+
}
|
|
454
|
+
addColumnToRight() {
|
|
455
|
+
this.insertColumnAt(this.getColCount());
|
|
456
|
+
}
|
|
457
|
+
setColumnAlign(colIndex, align) {
|
|
458
|
+
const table = this.__mdastNode;
|
|
459
|
+
if (table.align == null) {
|
|
460
|
+
table.align = [];
|
|
461
|
+
}
|
|
462
|
+
table.align[colIndex] = align;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Focuses the table cell at the specified coordinates. Pass `undefined` to
|
|
466
|
+
* remove the focus.
|
|
467
|
+
*/
|
|
468
|
+
select(coords) {
|
|
469
|
+
this.focusEmitter.publish(coords ?? [0, 0]);
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
/**
|
|
473
|
+
* Creates a {@link TableNode}. Use this instead of the constructor to follow the
|
|
474
|
+
* Lexical conventions.
|
|
475
|
+
*
|
|
476
|
+
* @param mdastNode - The mdast node to create the {@link TableNode} from.
|
|
477
|
+
* @group Table
|
|
478
|
+
*/
|
|
479
|
+
export function $createTableNode(mdastNode) {
|
|
480
|
+
return new TableNode(mdastNode);
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* Converts an HTML table element into a {@link TableNode}. This function is used
|
|
484
|
+
* to transform a DOM table element into a format that can be used by Lexical.
|
|
485
|
+
* It extracts the rows and cells from the table, converting them into
|
|
486
|
+
* MDAST-compatible nodes.
|
|
487
|
+
*
|
|
488
|
+
* @param element - The HTML table element to convert.
|
|
489
|
+
* @returns A {@link TableNode} containing the converted {@link TableNode}.
|
|
490
|
+
* @group Table
|
|
491
|
+
*/
|
|
492
|
+
export function $convertTableElement(element) {
|
|
493
|
+
const rows = element.querySelectorAll("tr");
|
|
494
|
+
const children = Array.from(rows).map((row) => {
|
|
495
|
+
return {
|
|
496
|
+
type: "tableRow",
|
|
497
|
+
children: Array.from(row.querySelectorAll("td, th")).map((cell) => {
|
|
498
|
+
return {
|
|
499
|
+
type: "tableCell",
|
|
500
|
+
children: [
|
|
501
|
+
{
|
|
502
|
+
type: "text",
|
|
503
|
+
value: cell.textContent ?? "",
|
|
504
|
+
},
|
|
505
|
+
],
|
|
506
|
+
};
|
|
507
|
+
}),
|
|
508
|
+
};
|
|
509
|
+
});
|
|
510
|
+
return new TableNode({
|
|
511
|
+
type: "table",
|
|
512
|
+
children,
|
|
513
|
+
});
|
|
514
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"table-node.test.d.ts","sourceRoot":"","sources":["../../src/tables/table-node.test.ts"],"names":[],"mappings":""}
|