@prosekit/extensions 0.11.3 → 0.11.5
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/dist/commit/style.css +2 -0
- package/dist/commit/style.css.map +1 -0
- package/dist/commit/style.js +1 -0
- package/dist/{drop-indicator-B8P652g2.js → drop-indicator-D1eHOhSi.js} +6 -5
- package/dist/drop-indicator-D1eHOhSi.js.map +1 -0
- package/dist/enter-rule-RdhEA900.js +2 -1
- package/dist/enter-rule-RdhEA900.js.map +1 -0
- package/dist/gap-cursor/style.css +2 -0
- package/dist/gap-cursor/style.css.map +1 -0
- package/dist/gap-cursor/style.js +1 -0
- package/dist/{input-rule-Gji4N7Oe.js → input-rule-B17tpW4m.js} +3 -3
- package/dist/input-rule-B17tpW4m.js.map +1 -0
- package/dist/list/style.css +2 -0
- package/dist/list/style.css.map +1 -0
- package/dist/list/style.js +1 -0
- package/dist/loro/style.css +2 -0
- package/dist/loro/style.css.map +1 -0
- package/dist/loro/style.js +1 -0
- package/dist/{mark-rule-D7zaa32n.js → mark-rule-BCqIZMDu.js} +3 -3
- package/dist/mark-rule-BCqIZMDu.js.map +1 -0
- package/dist/{paste-rule-Cca3n5TA.js → paste-rule-DIEJKIje.js} +5 -15
- package/dist/paste-rule-DIEJKIje.js.map +1 -0
- package/dist/placeholder/style.css +2 -0
- package/dist/placeholder/style.css.map +1 -0
- package/dist/placeholder/style.js +1 -0
- package/dist/prosekit-extensions-autocomplete.d.ts +2 -1
- package/dist/prosekit-extensions-autocomplete.d.ts.map +1 -0
- package/dist/prosekit-extensions-autocomplete.js +2 -9
- package/dist/prosekit-extensions-autocomplete.js.map +1 -0
- package/dist/prosekit-extensions-blockquote.d.ts +2 -1
- package/dist/prosekit-extensions-blockquote.d.ts.map +1 -0
- package/dist/prosekit-extensions-blockquote.js +4 -4
- package/dist/prosekit-extensions-blockquote.js.map +1 -0
- package/dist/prosekit-extensions-bold.d.ts +2 -1
- package/dist/prosekit-extensions-bold.d.ts.map +1 -0
- package/dist/prosekit-extensions-bold.js +3 -2
- package/dist/prosekit-extensions-bold.js.map +1 -0
- package/dist/prosekit-extensions-code-block.d.ts +2 -1
- package/dist/prosekit-extensions-code-block.d.ts.map +1 -0
- package/dist/prosekit-extensions-code-block.js +5 -6
- package/dist/prosekit-extensions-code-block.js.map +1 -0
- package/dist/prosekit-extensions-code.d.ts +2 -1
- package/dist/prosekit-extensions-code.d.ts.map +1 -0
- package/dist/prosekit-extensions-code.js +3 -2
- package/dist/prosekit-extensions-code.js.map +1 -0
- package/dist/prosekit-extensions-commit.d.ts +2 -1
- package/dist/prosekit-extensions-commit.d.ts.map +1 -0
- package/dist/prosekit-extensions-commit.js +11 -13
- package/dist/prosekit-extensions-commit.js.map +1 -0
- package/dist/prosekit-extensions-doc.d.ts +2 -1
- package/dist/prosekit-extensions-doc.d.ts.map +1 -0
- package/dist/prosekit-extensions-doc.js +2 -1
- package/dist/prosekit-extensions-doc.js.map +1 -0
- package/dist/prosekit-extensions-drop-cursor.d.ts +2 -1
- package/dist/prosekit-extensions-drop-cursor.d.ts.map +1 -0
- package/dist/prosekit-extensions-drop-cursor.js +2 -1
- package/dist/prosekit-extensions-drop-cursor.js.map +1 -0
- package/dist/prosekit-extensions-drop-indicator.d.ts +2 -1
- package/dist/prosekit-extensions-drop-indicator.d.ts.map +1 -0
- package/dist/prosekit-extensions-drop-indicator.js +1 -1
- package/dist/prosekit-extensions-enter-rule.d.ts +2 -1
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -0
- package/dist/prosekit-extensions-file.d.ts +2 -1
- package/dist/prosekit-extensions-file.d.ts.map +1 -0
- package/dist/prosekit-extensions-file.js +4 -16
- package/dist/prosekit-extensions-file.js.map +1 -0
- package/dist/prosekit-extensions-gap-cursor.d.ts +2 -2
- package/dist/prosekit-extensions-gap-cursor.d.ts.map +1 -0
- package/dist/prosekit-extensions-gap-cursor.js +2 -1
- package/dist/prosekit-extensions-gap-cursor.js.map +1 -0
- package/dist/prosekit-extensions-hard-break.d.ts +2 -1
- package/dist/prosekit-extensions-hard-break.d.ts.map +1 -0
- package/dist/prosekit-extensions-hard-break.js +2 -1
- package/dist/prosekit-extensions-hard-break.js.map +1 -0
- package/dist/prosekit-extensions-heading.d.ts +2 -1
- package/dist/prosekit-extensions-heading.d.ts.map +1 -0
- package/dist/prosekit-extensions-heading.js +5 -6
- package/dist/prosekit-extensions-heading.js.map +1 -0
- package/dist/prosekit-extensions-horizontal-rule.d.ts +2 -1
- package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -0
- package/dist/prosekit-extensions-horizontal-rule.js +5 -6
- package/dist/prosekit-extensions-horizontal-rule.js.map +1 -0
- package/dist/prosekit-extensions-image.d.ts +2 -1
- package/dist/prosekit-extensions-image.d.ts.map +1 -0
- package/dist/prosekit-extensions-image.js +3 -3
- package/dist/prosekit-extensions-image.js.map +1 -0
- package/dist/prosekit-extensions-input-rule.d.ts +2 -1
- package/dist/prosekit-extensions-input-rule.d.ts.map +1 -0
- package/dist/prosekit-extensions-input-rule.js +1 -1
- package/dist/prosekit-extensions-italic.d.ts +2 -1
- package/dist/prosekit-extensions-italic.d.ts.map +1 -0
- package/dist/prosekit-extensions-italic.js +3 -2
- package/dist/prosekit-extensions-italic.js.map +1 -0
- package/dist/prosekit-extensions-link.d.ts +2 -1
- package/dist/prosekit-extensions-link.d.ts.map +1 -0
- package/dist/prosekit-extensions-link.js +6 -5
- package/dist/prosekit-extensions-link.js.map +1 -0
- package/dist/prosekit-extensions-list.d.ts +22 -21
- package/dist/prosekit-extensions-list.d.ts.map +1 -0
- package/dist/prosekit-extensions-list.js +6 -7
- package/dist/prosekit-extensions-list.js.map +1 -0
- package/dist/prosekit-extensions-loro.d.ts +14 -13
- package/dist/prosekit-extensions-loro.d.ts.map +1 -0
- package/dist/prosekit-extensions-loro.js +2 -1
- package/dist/prosekit-extensions-loro.js.map +1 -0
- package/dist/prosekit-extensions-mark-rule.d.ts +2 -1
- package/dist/prosekit-extensions-mark-rule.d.ts.map +1 -0
- package/dist/prosekit-extensions-mark-rule.js +1 -1
- package/dist/prosekit-extensions-mention.d.ts +2 -1
- package/dist/prosekit-extensions-mention.d.ts.map +1 -0
- package/dist/prosekit-extensions-mention.js +2 -1
- package/dist/prosekit-extensions-mention.js.map +1 -0
- package/dist/prosekit-extensions-mod-click-prevention.d.ts +2 -1
- package/dist/prosekit-extensions-mod-click-prevention.d.ts.map +1 -0
- package/dist/prosekit-extensions-mod-click-prevention.js +2 -1
- package/dist/prosekit-extensions-mod-click-prevention.js.map +1 -0
- package/dist/prosekit-extensions-paragraph.d.ts +2 -1
- package/dist/prosekit-extensions-paragraph.d.ts.map +1 -0
- package/dist/prosekit-extensions-paragraph.js +2 -1
- package/dist/prosekit-extensions-paragraph.js.map +1 -0
- package/dist/prosekit-extensions-paste-rule.d.ts +2 -1
- package/dist/prosekit-extensions-paste-rule.d.ts.map +1 -0
- package/dist/prosekit-extensions-paste-rule.js +1 -1
- package/dist/prosekit-extensions-placeholder.d.ts +2 -1
- package/dist/prosekit-extensions-placeholder.d.ts.map +1 -0
- package/dist/prosekit-extensions-placeholder.js +5 -4
- package/dist/prosekit-extensions-placeholder.js.map +1 -0
- package/dist/prosekit-extensions-readonly.d.ts +2 -1
- package/dist/prosekit-extensions-readonly.d.ts.map +1 -0
- package/dist/prosekit-extensions-readonly.js +2 -1
- package/dist/prosekit-extensions-readonly.js.map +1 -0
- package/dist/prosekit-extensions-search.d.ts +2 -1
- package/dist/prosekit-extensions-search.d.ts.map +1 -0
- package/dist/prosekit-extensions-search.js +3 -3
- package/dist/prosekit-extensions-search.js.map +1 -0
- package/dist/prosekit-extensions-strike.d.ts +2 -1
- package/dist/prosekit-extensions-strike.d.ts.map +1 -0
- package/dist/prosekit-extensions-strike.js +3 -2
- package/dist/prosekit-extensions-strike.js.map +1 -0
- package/dist/prosekit-extensions-table.d.ts +56 -114
- package/dist/prosekit-extensions-table.d.ts.map +1 -0
- package/dist/prosekit-extensions-table.js +3 -2
- package/dist/prosekit-extensions-text-align.d.ts +2 -1
- package/dist/prosekit-extensions-text-align.d.ts.map +1 -0
- package/dist/prosekit-extensions-text-align.js +2 -1
- package/dist/prosekit-extensions-text-align.js.map +1 -0
- package/dist/prosekit-extensions-text.d.ts +2 -1
- package/dist/prosekit-extensions-text.d.ts.map +1 -0
- package/dist/prosekit-extensions-text.js +2 -1
- package/dist/prosekit-extensions-text.js.map +1 -0
- package/dist/prosekit-extensions-underline.d.ts +2 -1
- package/dist/prosekit-extensions-underline.d.ts.map +1 -0
- package/dist/prosekit-extensions-underline.js +2 -1
- package/dist/prosekit-extensions-underline.js.map +1 -0
- package/dist/prosekit-extensions-virtual-selection.d.ts +2 -1
- package/dist/prosekit-extensions-virtual-selection.d.ts.map +1 -0
- package/dist/prosekit-extensions-virtual-selection.js +3 -3
- package/dist/prosekit-extensions-virtual-selection.js.map +1 -0
- package/dist/prosekit-extensions-yjs.d.ts +2 -1
- package/dist/prosekit-extensions-yjs.d.ts.map +1 -0
- package/dist/prosekit-extensions-yjs.js +2 -1
- package/dist/prosekit-extensions-yjs.js.map +1 -0
- package/dist/prosekit-extensions.d.ts +1 -1
- package/dist/prosekit-extensions.js +1 -0
- package/dist/search/style.css +2 -0
- package/dist/search/style.css.map +1 -0
- package/dist/search/style.js +1 -0
- package/dist/shiki-highlighter-chunk-DSPM0T27.d.ts +2 -1
- package/dist/shiki-highlighter-chunk-DSPM0T27.d.ts.map +1 -0
- package/dist/shiki-highlighter-chunk.js +3 -5
- package/dist/shiki-highlighter-chunk.js.map +1 -0
- package/dist/table/style.css +2 -0
- package/dist/table/style.css.map +1 -0
- package/dist/table/style.js +1 -0
- package/dist/table-Bi7WsMI3.js +297 -0
- package/dist/table-Bi7WsMI3.js.map +1 -0
- package/dist/virtual-selection/style.css +2 -0
- package/dist/virtual-selection/style.css.map +1 -0
- package/dist/virtual-selection/style.js +1 -0
- package/dist/yjs/style.css +2 -0
- package/dist/yjs/style.css.map +1 -0
- package/dist/yjs/style.js +1 -0
- package/package.json +10 -9
- package/src/autocomplete/autocomplete-helpers.ts +74 -0
- package/src/autocomplete/autocomplete-plugin.ts +186 -0
- package/src/autocomplete/autocomplete-rule.ts +117 -0
- package/src/autocomplete/autocomplete.spec.ts +132 -0
- package/src/autocomplete/autocomplete.ts +29 -0
- package/src/autocomplete/index.ts +9 -0
- package/src/blockquote/blockquote-commands.ts +32 -0
- package/src/blockquote/blockquote-input-rule.ts +14 -0
- package/src/blockquote/blockquote-keymap.spec.ts +45 -0
- package/src/blockquote/blockquote-keymap.ts +31 -0
- package/src/blockquote/blockquote-spec.ts +24 -0
- package/src/blockquote/blockquote.ts +34 -0
- package/src/blockquote/index.ts +14 -0
- package/src/bold/bold-commands.ts +23 -0
- package/src/bold/bold-input-rule.spec.ts +51 -0
- package/src/bold/bold-input-rule.ts +18 -0
- package/src/bold/bold-keymap.ts +14 -0
- package/src/bold/bold-spec.ts +53 -0
- package/src/bold/bold.ts +32 -0
- package/src/bold/index.ts +14 -0
- package/src/code/code-commands.ts +23 -0
- package/src/code/code-input-rule.ts +18 -0
- package/src/code/code-keymap.ts +14 -0
- package/src/code/code-spec.ts +28 -0
- package/src/code/code.ts +32 -0
- package/src/code/index.ts +14 -0
- package/src/code-block/code-block-commands.ts +44 -0
- package/src/code-block/code-block-highlight.ts +40 -0
- package/src/code-block/code-block-input-rule.ts +36 -0
- package/src/code-block/code-block-keymap.ts +61 -0
- package/src/code-block/code-block-shiki.ts +58 -0
- package/src/code-block/code-block-spec.spec.ts +164 -0
- package/src/code-block/code-block-spec.ts +71 -0
- package/src/code-block/code-block-types.ts +8 -0
- package/src/code-block/code-block.ts +46 -0
- package/src/code-block/index.ts +32 -0
- package/src/code-block/shiki-bundle.ts +8 -0
- package/src/code-block/shiki-highlighter-chunk.ts +84 -0
- package/src/code-block/shiki-highlighter.ts +22 -0
- package/src/code-block/shiki-parser.ts +36 -0
- package/src/commit/index.ts +330 -0
- package/src/commit/style.css +7 -0
- package/src/doc/index.ts +21 -0
- package/src/drop-cursor/drop-cursor.ts +46 -0
- package/src/drop-cursor/index.ts +5 -0
- package/src/drop-indicator/drop-indicator-facet.ts +84 -0
- package/src/drop-indicator/drop-indicator-plugin.ts +147 -0
- package/src/drop-indicator/drop-indicator.ts +37 -0
- package/src/drop-indicator/drop-target.ts +168 -0
- package/src/drop-indicator/index.ts +14 -0
- package/src/drop-indicator/types.ts +90 -0
- package/src/enter-rule/index.ts +241 -0
- package/src/file/file-drop-handler.ts +75 -0
- package/src/file/file-paste-handler.spec.ts +95 -0
- package/src/file/file-paste-handler.ts +59 -0
- package/src/file/file-upload.ts +119 -0
- package/src/file/helpers.ts +39 -0
- package/src/file/index.ts +16 -0
- package/src/gap-cursor/gap-cursor.ts +28 -0
- package/src/gap-cursor/index.ts +4 -0
- package/src/gap-cursor/style.css +25 -0
- package/src/hard-break/hard-break-commands.ts +31 -0
- package/src/hard-break/hard-break-keymap.spec.ts +45 -0
- package/src/hard-break/hard-break-keymap.ts +16 -0
- package/src/hard-break/hard-break-spec.ts +31 -0
- package/src/hard-break/hard-break.ts +32 -0
- package/src/hard-break/index.ts +13 -0
- package/src/heading/heading-commands.ts +37 -0
- package/src/heading/heading-input-rule.ts +22 -0
- package/src/heading/heading-keymap.spec.ts +53 -0
- package/src/heading/heading-keymap.ts +40 -0
- package/src/heading/heading-spec.ts +39 -0
- package/src/heading/heading-types.ts +3 -0
- package/src/heading/heading.ts +34 -0
- package/src/heading/index.ts +15 -0
- package/src/horizontal-rule/horizontal-rule-commands.spec.ts +61 -0
- package/src/horizontal-rule/horizontal-rule-commands.ts +37 -0
- package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +61 -0
- package/src/horizontal-rule/horizontal-rule-input-rule.ts +26 -0
- package/src/horizontal-rule/horizontal-rule-spec.ts +21 -0
- package/src/horizontal-rule/horizontal-rule.ts +29 -0
- package/src/horizontal-rule/index.ts +14 -0
- package/src/image/image-commands.ts +27 -0
- package/src/image/image-spec.ts +72 -0
- package/src/image/image.ts +25 -0
- package/src/image/index.ts +13 -0
- package/src/index.ts +1 -0
- package/src/input-rule/index.ts +237 -0
- package/src/italic/index.ts +14 -0
- package/src/italic/italic-commands.spec.ts +75 -0
- package/src/italic/italic-commands.ts +23 -0
- package/src/italic/italic-input-rule.spec.ts +25 -0
- package/src/italic/italic-input-rule.ts +18 -0
- package/src/italic/italic-keymap.ts +14 -0
- package/src/italic/italic-spec.ts +35 -0
- package/src/italic/italic.ts +34 -0
- package/src/link/index.spec.ts +88 -0
- package/src/link/index.ts +156 -0
- package/src/link/link-paste-rule.spec.ts +194 -0
- package/src/link/link-paste-rule.ts +22 -0
- package/src/link/link-regex.spec.ts +82 -0
- package/src/link/link-regex.ts +79 -0
- package/src/link/link-types.ts +8 -0
- package/src/list/index.ts +25 -0
- package/src/list/list-commands.ts +61 -0
- package/src/list/list-drop-indicator.ts +37 -0
- package/src/list/list-input-rules.ts +14 -0
- package/src/list/list-keymap.spec.ts +39 -0
- package/src/list/list-keymap.ts +48 -0
- package/src/list/list-plugins.ts +35 -0
- package/src/list/list-serializer.ts +38 -0
- package/src/list/list-spec.ts +60 -0
- package/src/list/list-types.spec.ts +10 -0
- package/src/list/list-types.ts +23 -0
- package/src/list/list.spec.ts +134 -0
- package/src/list/list.ts +38 -0
- package/src/list/style.css +128 -0
- package/src/loro/index.ts +17 -0
- package/src/loro/loro-commands.ts +27 -0
- package/src/loro/loro-cursor-plugin.ts +28 -0
- package/src/loro/loro-keymap.ts +23 -0
- package/src/loro/loro-sync-plugin.ts +14 -0
- package/src/loro/loro-undo-plugin.ts +12 -0
- package/src/loro/loro.ts +75 -0
- package/src/loro/style.css +33 -0
- package/src/mark-rule/apply.ts +129 -0
- package/src/mark-rule/index.ts +2 -0
- package/src/mark-rule/mark-rule.spec.ts +123 -0
- package/src/mark-rule/mark-rule.ts +48 -0
- package/src/mark-rule/range.ts +107 -0
- package/src/mark-rule/types.ts +30 -0
- package/src/mention/index.ts +90 -0
- package/src/mod-click-prevention/index.ts +35 -0
- package/src/paragraph/index.ts +7 -0
- package/src/paragraph/paragraph-commands.ts +29 -0
- package/src/paragraph/paragraph-keymap.ts +15 -0
- package/src/paragraph/paragraph-spec.ts +31 -0
- package/src/paragraph/paragraph.ts +37 -0
- package/src/paste-rule/index.ts +10 -0
- package/src/paste-rule/mark-paste-rule.spec.ts +112 -0
- package/src/paste-rule/mark-paste-rule.ts +194 -0
- package/src/paste-rule/paste-rule-plugin.ts +53 -0
- package/src/paste-rule/paste-rule.spec.ts +96 -0
- package/src/paste-rule/paste-rule.ts +60 -0
- package/src/paste-rule/split-text-by-regex.spec.ts +97 -0
- package/src/paste-rule/split-text-by-regex.ts +44 -0
- package/src/placeholder/index.ts +113 -0
- package/src/placeholder/style.css +7 -0
- package/src/readonly/index.ts +22 -0
- package/src/search/index.ts +140 -0
- package/src/search/style.css +13 -0
- package/src/strike/index.ts +101 -0
- package/src/table/index.ts +53 -0
- package/src/table/style.css +42 -0
- package/src/table/table-commands/delete-cell-selection.spec.ts +41 -0
- package/src/table/table-commands/delete-cell-selection.ts +1 -0
- package/src/table/table-commands/exit-table.spec.ts +45 -0
- package/src/table/table-commands/exit-table.ts +49 -0
- package/src/table/table-commands/insert-table.spec.ts +39 -0
- package/src/table/table-commands/insert-table.ts +80 -0
- package/src/table/table-commands/move-table-column.spec.ts +618 -0
- package/src/table/table-commands/move-table-column.ts +4 -0
- package/src/table/table-commands/move-table-row.spec.ts +380 -0
- package/src/table/table-commands/move-table-row.ts +4 -0
- package/src/table/table-commands/select-table-cell.spec.ts +34 -0
- package/src/table/table-commands/select-table-cell.ts +35 -0
- package/src/table/table-commands/select-table-column.spec.ts +33 -0
- package/src/table/table-commands/select-table-column.ts +39 -0
- package/src/table/table-commands/select-table-row.spec.ts +32 -0
- package/src/table/table-commands/select-table-row.ts +39 -0
- package/src/table/table-commands/select-table.spec.ts +36 -0
- package/src/table/table-commands/select-table.ts +50 -0
- package/src/table/table-commands.ts +110 -0
- package/src/table/table-drop-indicator.ts +40 -0
- package/src/table/table-plugins.ts +15 -0
- package/src/table/table-spec.spec.ts +113 -0
- package/src/table/table-spec.ts +109 -0
- package/src/table/table-utils.ts +16 -0
- package/src/table/table.ts +49 -0
- package/src/table/test-utils.ts +28 -0
- package/src/testing/clipboard.ts +58 -0
- package/src/testing/format-html.ts +5 -0
- package/src/testing/index.ts +161 -0
- package/src/testing/keyboard.ts +36 -0
- package/src/testing/markdown.ts +23 -0
- package/src/text/index.ts +24 -0
- package/src/text-align/index.ts +133 -0
- package/src/types/assert-type-equal.ts +8 -0
- package/src/underline/index.ts +83 -0
- package/src/virtual-selection/index.ts +100 -0
- package/src/virtual-selection/style.css +5 -0
- package/src/yjs/index.ts +22 -0
- package/src/yjs/style.css +31 -0
- package/src/yjs/yjs-commands.ts +27 -0
- package/src/yjs/yjs-cursor-plugin.ts +25 -0
- package/src/yjs/yjs-keymap.ts +23 -0
- package/src/yjs/yjs-sync-plugin.ts +23 -0
- package/src/yjs/yjs-undo-plugin.ts +87 -0
- package/src/yjs/yjs.ts +84 -0
- package/dist/table-C_qAMj5-.js +0 -734
|
@@ -1,110 +1,71 @@
|
|
|
1
|
-
import { Extension,
|
|
2
|
-
import { Command
|
|
3
|
-
import { Attrs
|
|
4
|
-
import { CellSelection } from "prosemirror-tables";
|
|
1
|
+
import { Extension, PlainExtension, Union } from "@prosekit/core";
|
|
2
|
+
import { Command } from "@prosekit/pm/state";
|
|
3
|
+
import { Attrs } from "@prosekit/pm/model";
|
|
4
|
+
import { CellSelection, MoveTableColumnOptions, MoveTableRowOptions, findTable, moveTableColumn, moveTableRow } from "prosemirror-tables";
|
|
5
5
|
|
|
6
|
-
//#region src/table/table-commands/
|
|
6
|
+
//#region src/table/table-commands/insert-table.d.ts
|
|
7
7
|
/**
|
|
8
|
-
* Options for {@link moveTableColumn}
|
|
9
|
-
*
|
|
10
8
|
* @public
|
|
11
9
|
*/
|
|
12
|
-
interface
|
|
10
|
+
interface InsertTableOptions {
|
|
13
11
|
/**
|
|
14
|
-
* The
|
|
12
|
+
* The number of rows in the table.
|
|
15
13
|
*/
|
|
16
|
-
|
|
14
|
+
row: number;
|
|
17
15
|
/**
|
|
18
|
-
* The
|
|
16
|
+
* The number of columns in the table.
|
|
19
17
|
*/
|
|
20
|
-
|
|
18
|
+
col: number;
|
|
21
19
|
/**
|
|
22
|
-
* Whether
|
|
20
|
+
* Whether the table has a header row.
|
|
23
21
|
*
|
|
24
|
-
* @default
|
|
25
|
-
*/
|
|
26
|
-
select?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Optional position to resolve table from. If not provided, uses the current selection.
|
|
22
|
+
* @default false
|
|
29
23
|
*/
|
|
30
|
-
|
|
24
|
+
header?: boolean;
|
|
31
25
|
}
|
|
32
26
|
/**
|
|
33
|
-
*
|
|
27
|
+
* Insert a table node with the given number of rows and columns, and optionally
|
|
28
|
+
* a header row.
|
|
29
|
+
*
|
|
30
|
+
* @param options
|
|
34
31
|
*
|
|
35
32
|
* @public
|
|
36
33
|
*/
|
|
37
|
-
declare function
|
|
34
|
+
declare function insertTable(options: InsertTableOptions): Command;
|
|
38
35
|
//#endregion
|
|
39
|
-
//#region src/table/table-commands/
|
|
36
|
+
//#region src/table/table-commands/select-table.d.ts
|
|
40
37
|
/**
|
|
41
|
-
* Options for {@link moveTableRow}
|
|
42
|
-
*
|
|
43
38
|
* @public
|
|
44
39
|
*/
|
|
45
|
-
interface
|
|
46
|
-
/**
|
|
47
|
-
* The source row index to move from.
|
|
48
|
-
*/
|
|
49
|
-
from: number;
|
|
50
|
-
/**
|
|
51
|
-
* The destination row index to move to.
|
|
52
|
-
*/
|
|
53
|
-
to: number;
|
|
54
|
-
/**
|
|
55
|
-
* Whether to select the moved row after the operation.
|
|
56
|
-
*
|
|
57
|
-
* @default true
|
|
58
|
-
*/
|
|
59
|
-
select?: boolean;
|
|
40
|
+
interface SelectTableOptions {
|
|
60
41
|
/**
|
|
61
|
-
*
|
|
42
|
+
* A hit position of the table to select from. By default, the selection
|
|
43
|
+
* anchor will be used.
|
|
62
44
|
*/
|
|
63
45
|
pos?: number;
|
|
64
46
|
}
|
|
65
47
|
/**
|
|
66
|
-
* Move a table row from index `origin` to index `target`.
|
|
67
|
-
*
|
|
68
48
|
* @public
|
|
69
49
|
*/
|
|
70
|
-
declare function
|
|
50
|
+
declare function selectTable(options?: SelectTableOptions): Command;
|
|
71
51
|
//#endregion
|
|
72
|
-
//#region src/table/table-commands.d.ts
|
|
52
|
+
//#region src/table/table-commands/select-table-cell.d.ts
|
|
73
53
|
/**
|
|
74
54
|
* @public
|
|
75
55
|
*/
|
|
76
|
-
interface
|
|
77
|
-
/**
|
|
78
|
-
* The number of rows in the table.
|
|
79
|
-
*/
|
|
80
|
-
row: number;
|
|
81
|
-
/**
|
|
82
|
-
* The number of columns in the table.
|
|
83
|
-
*/
|
|
84
|
-
col: number;
|
|
56
|
+
interface SelectTableCellOptions {
|
|
85
57
|
/**
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* @default false
|
|
58
|
+
* A hit position of the table cell to select from. By default, the selection
|
|
59
|
+
* anchor will be used.
|
|
89
60
|
*/
|
|
90
|
-
|
|
61
|
+
pos?: number;
|
|
91
62
|
}
|
|
92
63
|
/**
|
|
93
|
-
* Insert a table node with the given number of rows and columns, and optionally
|
|
94
|
-
* a header row.
|
|
95
|
-
*
|
|
96
|
-
* @param options
|
|
97
|
-
*
|
|
98
|
-
* @public
|
|
99
|
-
*/
|
|
100
|
-
declare function insertTable(options: InsertTableOptions): Command;
|
|
101
|
-
/**
|
|
102
|
-
* When the selection is in a table node, create a default block after the table
|
|
103
|
-
* table, and move the cursor there.
|
|
104
|
-
*
|
|
105
64
|
* @public
|
|
106
65
|
*/
|
|
107
|
-
declare
|
|
66
|
+
declare function selectTableCell(options?: SelectTableCellOptions): Command;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/table/table-commands/select-table-column.d.ts
|
|
108
69
|
/**
|
|
109
70
|
* @public
|
|
110
71
|
*/
|
|
@@ -124,6 +85,8 @@ interface SelectTableColumnOptions {
|
|
|
124
85
|
* @public
|
|
125
86
|
*/
|
|
126
87
|
declare function selectTableColumn(options?: SelectTableColumnOptions): Command;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/table/table-commands/select-table-row.d.ts
|
|
127
90
|
/**
|
|
128
91
|
* @public
|
|
129
92
|
*/
|
|
@@ -143,34 +106,8 @@ interface SelectTableRowOptions {
|
|
|
143
106
|
* @public
|
|
144
107
|
*/
|
|
145
108
|
declare function selectTableRow(options?: SelectTableRowOptions): Command;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
*/
|
|
149
|
-
interface SelectTableCellOptions {
|
|
150
|
-
/**
|
|
151
|
-
* A hit position of the table cell to select from. By default, the selection
|
|
152
|
-
* anchor will be used.
|
|
153
|
-
*/
|
|
154
|
-
pos?: number;
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* @public
|
|
158
|
-
*/
|
|
159
|
-
declare function selectTableCell(options?: SelectTableCellOptions): Command;
|
|
160
|
-
/**
|
|
161
|
-
* @public
|
|
162
|
-
*/
|
|
163
|
-
interface SelectTableOptions {
|
|
164
|
-
/**
|
|
165
|
-
* A hit position of the table to select from. By default, the selection
|
|
166
|
-
* anchor will be used.
|
|
167
|
-
*/
|
|
168
|
-
pos?: number;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* @public
|
|
172
|
-
*/
|
|
173
|
-
declare function selectTable(options?: SelectTableOptions): Command;
|
|
109
|
+
//#endregion
|
|
110
|
+
//#region src/table/table-commands.d.ts
|
|
174
111
|
/**
|
|
175
112
|
* @internal
|
|
176
113
|
*/
|
|
@@ -268,32 +205,37 @@ type TableExtension = Union<[TableSpecExtension, TableRowSpecExtension, TableCel
|
|
|
268
205
|
*/
|
|
269
206
|
declare function defineTable(): TableExtension;
|
|
270
207
|
//#endregion
|
|
271
|
-
//#region src/table/table-
|
|
208
|
+
//#region src/table/table-commands/exit-table.d.ts
|
|
272
209
|
/**
|
|
210
|
+
* When the selection is in a table node, create a default block after the table
|
|
211
|
+
* table, and move the cursor there.
|
|
212
|
+
*
|
|
273
213
|
* @public
|
|
274
214
|
*/
|
|
275
|
-
declare
|
|
215
|
+
declare const exitTable: Command;
|
|
276
216
|
//#endregion
|
|
277
|
-
//#region src/table/table-
|
|
217
|
+
//#region src/table/table-drop-indicator.d.ts
|
|
278
218
|
/**
|
|
279
|
-
*
|
|
219
|
+
* Hides the drop indicator when dragging a table column or row by using the
|
|
220
|
+
* table handle.
|
|
280
221
|
*
|
|
281
|
-
* @
|
|
222
|
+
* @internal
|
|
282
223
|
*/
|
|
283
|
-
declare function
|
|
224
|
+
declare function defineTableDropIndicator(): PlainExtension;
|
|
225
|
+
//#endregion
|
|
226
|
+
//#region src/table/table-plugins.d.ts
|
|
284
227
|
/**
|
|
285
|
-
*
|
|
286
|
-
*
|
|
287
|
-
* @internal
|
|
228
|
+
* @public
|
|
288
229
|
*/
|
|
289
|
-
declare function
|
|
230
|
+
declare function defineTablePlugins(): PlainExtension;
|
|
231
|
+
//#endregion
|
|
232
|
+
//#region src/table/table-utils.d.ts
|
|
290
233
|
/**
|
|
291
|
-
*
|
|
292
|
-
* anchor and head as hit points, or fallback to the selection's anchor and
|
|
293
|
-
* head.
|
|
234
|
+
* Checks if the given object is a `CellSelection` instance.
|
|
294
235
|
*
|
|
295
|
-
* @
|
|
236
|
+
* @public
|
|
296
237
|
*/
|
|
297
|
-
|
|
238
|
+
declare function isCellSelection(value: unknown): value is CellSelection;
|
|
298
239
|
//#endregion
|
|
299
|
-
export { type InsertTableOptions, type MoveTableColumnOptions, type MoveTableRowOptions, type SelectTableCellOptions, type SelectTableColumnOptions, type SelectTableOptions, type SelectTableRowOptions, type TableCellSpecExtension, type TableCommandsExtension, type TableExtension, type TableHeaderCellSpecExtension, type TableRowSpecExtension, type TableSpecExtension, defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
|
240
|
+
export { type InsertTableOptions, type MoveTableColumnOptions, type MoveTableRowOptions, type SelectTableCellOptions, type SelectTableColumnOptions, type SelectTableOptions, type SelectTableRowOptions, type TableCellSpecExtension, type TableCommandsExtension, type TableExtension, type TableHeaderCellSpecExtension, type TableRowSpecExtension, type TableSpecExtension, defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
|
241
|
+
//# sourceMappingURL=prosekit-extensions-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-table.d.ts","names":[],"sources":["../src/table/table-commands/insert-table.ts","../src/table/table-commands/select-table.ts","../src/table/table-commands/select-table-cell.ts","../src/table/table-commands/select-table-column.ts","../src/table/table-commands/select-table-row.ts","../src/table/table-commands.ts","../src/table/table-spec.ts","../src/table/table.ts","../src/table/table-commands/exit-table.ts","../src/table/table-drop-indicator.ts","../src/table/table-plugins.ts","../src/table/table-utils.ts"],"sourcesContent":[],"mappings":";;;;;;;;;UA8CiB,kBAAA;;AAAjB;AA2BA;EAA2B,GAAA,EAAA,MAAA;;;;;;;AC9D3B;AAWA;;QAAsC,CAAA,EAAA,OAAA;;;;;;ACdtC;AAWA;;;AAAmE,iBFsDnD,WAAA,CEtDmD,OAAA,EFsD9B,kBEtD8B,CAAA,EFsDT,OEtDS;;;;;;UDRlD,kBAAA;;ADmCjB;AA2BA;;KAAqC,CAAA,EAAA,MAAA;;;;;iBCnDrB,WAAA,WAAsB,qBAAqB;;;;;;UCd1C,sBAAA;;AFsCjB;AA2BA;;KAAqC,CAAA,EAAA,MAAA;;;;;iBEtDrB,eAAA,WAA0B,yBAAyB;;;;;;UCXlD,wBAAA;;AHsCjB;AA2BA;;QAAqC,CAAA,EAAA,MAAA;;;;;;AC9DrC;AAWA;;;AAA2D,iBEG3C,iBAAA,CFH2C,OAAA,CAAA,EEGf,wBFHe,CAAA,EEGY,OFHZ;;;;;;UGd1C,qBAAA;;AJsCjB;AA2BA;;QAAqC,CAAA,EAAA,MAAA;;;;;;AC9DrC;AAWA;;;AAA2D,iBGG3C,cAAA,CHH2C,OAAA,CAAA,EGGlB,qBHHkB,CAAA,EGGM,OHHN;;;;;;ADmDM,KKvBrD,sBAAA,GAAyB,SLuB4B,CAAA;;2BKrBtC;;IJzCV,WAAA,EAAA,CAAA,OAAkB,GI4CP,kBJ5CO,CAAA;IAWnB,eAAW,EAAA,CAAA,OAAA,GIkCK,sBJlCL,CAAA;IAAA,iBAAA,EAAA,CAAA,OAAA,GImCO,wBJnCP,CAAA;IAAW,cAAA,EAAA,CAAA,OAAA,GIoCP,qBJpCO,CAAA;IAAqB,oBAAA,EAAA,EAAA;IAAO,mBAAA,EAAA,EAAA;;;;ICdjD,iBAAA,EAAA,EAAsB;IAWvB,cAAe,EAAA,EAAA;IAAA,mBAAA,EAAA,EAAA;IAAW,eAAA,EAAA,EAAA;IAAyB,cAAA,EAAA,EAAA;IAAO,YAAA,EAAA,CAAA,OAAA,EGsD9C,mBHtD8C,CAAA;+BGuD3C;;;AFlE/B;AAiBA;;;;AAA8E,iBE0D9D,mBAAA,CAAA,CF1D8D,EE0DvC,sBF1DuC;;;;;;UGV7D,SAAA;EN+BA,OAAA,CAAA,EAAA,MAAA;EA2BD,OAAA,CAAA,EAAA,MAAW;EAAA,QAAA,CAAA,EAAA,MAAA,EAAA,GAAA,IAAA;;;;;KM3Cf,kBAAA,GAAqB;;ILnBhB,KAAA,EKqBN,KLrBM;EAWD,CAAA;CAAW,CAAA;;;;iBKuBX,eAAA,CAAA,GAAmB;;;AJrCnC;AAWgB,KIqCJ,qBAAA,GAAwB,SJrCL,CAAA;EAAA,KAAA,EAAA;IAAW,QAAA,EIuC5B,KJvC4B;;CAAgC,CAAA;;;;ACXzD,iBGyDD,kBAAA,CAAA,CHzDyB,EGyDH,qBHzDG;AAiBzC;;;AAAuE,KGmD3D,sBAAA,GAAyB,SHnDkC,CAAA;EAAO,KAAA,EAAA;eGqD/D;;;AFtEf;AAiBA;;AAAyC,iBE4DzB,mBAAA,CAAA,CF5DyB,EE4DF,sBF5DE;;;;KEuE7B,4BAAA,GAA+B;;ID9C/B,eAAA,ECgDS,SDhDa;EAAA,CAAA;;AAKN,iBC+CZ,yBAAA,CAAA,CD/CY,EC+CiB,4BD/CjB;;;;;;ALTX,KOrBL,cAAA,GAAiB,KPqBM,CAAA,COnB/B,kBP8CuB,EO7CvB,qBP6CuB,EO5CvB,sBP4CiC,EO3CjC,4BP2CsD,EO1CtD,sBP0C6D;;;AC9DjE;AAWgB,iBMgBA,WAAA,CAAA,CNhBW,EMgBI,cNhBJ;;;;;;;;ADwB3B;AA2BgB,cQ9DH,SR8Dc,EQ9DH,OR8DG;;;;;;;;AA3B3B;AA2BgB,iBS9DA,wBAAA,CAAA,CT8DW,ES9DiB,cT8DjB;;;;;;iBU7DX,kBAAA,CAAA,GAAsB;;;;;;;AVkCtC;AA2BgB,iBW5DA,eAAA,CX4DW,KAAA,EAAA,OAAA,CAAA,EAAA,KAAA,IW5D+B,aX4D/B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./drop-indicator-D1eHOhSi.js";
|
|
2
|
+
import { defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow } from "./table-Bi7WsMI3.js";
|
|
2
3
|
|
|
3
|
-
export { defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
|
4
|
+
export { defineTable, defineTableCellSpec, defineTableCommands, defineTableDropIndicator, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, moveTableColumn, moveTableRow, selectTable, selectTableCell, selectTableColumn, selectTableRow };
|
|
@@ -68,4 +68,5 @@ type TextAlignExtension<NodeName extends string> = Union<[TextAlignAttrsExtensio
|
|
|
68
68
|
*/
|
|
69
69
|
declare function defineTextAlign<NodeName extends string = string>(options: TextAlignOptions<NodeName>): TextAlignExtension<NodeName>;
|
|
70
70
|
//#endregion
|
|
71
|
-
export { TextAlignAttrsExtension, TextAlignCommandsExtension, TextAlignExtension, TextAlignOptions, defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
|
|
71
|
+
export { TextAlignAttrsExtension, TextAlignCommandsExtension, TextAlignExtension, TextAlignOptions, defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
|
|
72
|
+
//# sourceMappingURL=prosekit-extensions-text-align.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text-align.d.ts","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AAqCY,UArCK,gBAqCkB,CAAA,iBAAA,MAAA,GAAA,MAAA,CAAA,CAAA;EAAA;;;;AAiBnC;;;OAEE,EAhDO,QAgDP,EAAA;;;AAWF;AASA;AAWA;EAYY,OAAA,CAAA,EAAA,MAAA;;;;;AAA8C,KA9D9C,uBA8D8C,CAAA,iBAAA,MAAA,CAAA,GA9DK,SA8DL,CAAA;EAAK,KAAA,EAAA,QA7D9C,QAuEc,GAAA;IAAA,SAAA,EAAA,MAAA,GAAA,IAAA;EACH,CAAA;;;;;iBAxDZ,YAAA;;;;;;IAMZ;;;;KAOQ,0BAAA,GAA6B;;;;;;;;iBASzB,uBAAA,mBAEb;;;;iBASa,qBAAA,mBAAwC;;;;KAY5C,8CAA8C,OACvD,wBAAwB,WAAW;;;;;;;iBAStB,2DACL,iBAAiB,YACzB,mBAAmB"}
|
|
@@ -71,4 +71,5 @@ function defineTextAlign(options) {
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
//#endregion
|
|
74
|
-
export { defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
|
|
74
|
+
export { defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
|
|
75
|
+
//# sourceMappingURL=prosekit-extensions-text-align.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text-align.js","names":[],"sources":["../src/text-align/index.ts"],"sourcesContent":["import {\n defineCommands,\n defineKeymap,\n defineNodeAttr,\n setNodeAttrs,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Command } from '@prosekit/pm/state'\n\n/**\n * @public\n */\nexport interface TextAlignOptions<NodeName extends string = string> {\n /**\n * The names of node to add the attribute to.\n *\n * @example\n *\n * [\"paragraph\", \"heading\"]\n */\n types: NodeName[]\n\n /**\n * The default value for the attribute.\n *\n * @default \"left\"\n */\n default?: string\n}\n\nfunction defineTextAlignAttr<NodeName extends string>(\n type: NodeName,\n defaultValue: string | null,\n) {\n return defineNodeAttr<NodeName, 'textAlign', string | null>({\n type,\n attr: 'textAlign',\n default: defaultValue,\n splittable: true,\n toDOM: (value: any) => (value ? ['style', `text-align:${value};`] : null),\n parseDOM: (node: HTMLElement) => {\n return node.style.getPropertyValue('text-align') || null\n },\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignAttrsExtension<NodeName extends string> = Extension<{\n Nodes: { [K in NodeName]: { textAlign: string | null } }\n}>\n\n/**\n * @internal\n */\nfunction defineTextAlignAttrs<NodeName extends string>(\n types: NodeName[],\n defaultValue: string | null,\n): TextAlignAttrsExtension<NodeName> {\n return union(types.map((type) => defineTextAlignAttr(type, defaultValue)))\n}\n\n/**\n * @internal\n */\nexport function setTextAlign({\n types,\n value,\n}: {\n types: string[]\n value: string | null\n}): Command {\n return setNodeAttrs({ type: types, attrs: { textAlign: value } })\n}\n\n/**\n * @internal\n */\nexport type TextAlignCommandsExtension = Extension<{\n Commands: {\n setTextAlign: [value: string | null]\n }\n}>\n\n/**\n * @internal\n */\nexport function defineTextAlignCommands(\n types: string[],\n): TextAlignCommandsExtension {\n return defineCommands({\n setTextAlign: (value: string | null) => setTextAlign({ types, value }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineTextAlignKeymap(types: string[]): PlainExtension {\n return defineKeymap({\n 'mod-shift-l': setTextAlign({ types, value: 'left' }),\n 'mod-shift-e': setTextAlign({ types, value: 'center' }),\n 'mod-shift-r': setTextAlign({ types, value: 'right' }),\n 'mod-shift-j': setTextAlign({ types, value: 'justify' }),\n })\n}\n\n/**\n * @internal\n */\nexport type TextAlignExtension<NodeName extends string> = Union<\n [TextAlignAttrsExtension<NodeName>, TextAlignCommandsExtension]\n>\n\n/**\n * Adds a `textAlign` attribute to the specified nodes. This will be rendered as\n * a CSS `text-align` style.\n *\n * @public\n */\nexport function defineTextAlign<NodeName extends string = string>(\n options: TextAlignOptions<NodeName>,\n): TextAlignExtension<NodeName> {\n return union(\n defineTextAlignAttrs<NodeName>(options.types, options.default || 'left'),\n defineTextAlignKeymap(options.types),\n defineTextAlignCommands(options.types),\n )\n}\n"],"mappings":";;;AAiCA,SAAS,oBACP,MACA,cACA;AACA,QAAO,eAAqD;EAC1D;EACA,MAAM;EACN,SAAS;EACT,YAAY;EACZ,QAAQ,UAAgB,QAAQ,CAAC,SAAS,cAAc,MAAM,GAAG,GAAG;EACpE,WAAW,SAAsB;AAC/B,UAAO,KAAK,MAAM,iBAAiB,aAAa,IAAI;;EAEvD,CAAC;;;;;AAaJ,SAAS,qBACP,OACA,cACmC;AACnC,QAAO,MAAM,MAAM,KAAK,SAAS,oBAAoB,MAAM,aAAa,CAAC,CAAC;;;;;AAM5E,SAAgB,aAAa,EAC3B,OACA,SAIU;AACV,QAAO,aAAa;EAAE,MAAM;EAAO,OAAO,EAAE,WAAW,OAAO;EAAE,CAAC;;;;;AAenE,SAAgB,wBACd,OAC4B;AAC5B,QAAO,eAAe,EACpB,eAAe,UAAyB,aAAa;EAAE;EAAO;EAAO,CAAC,EACvE,CAAC;;;;;AAMJ,SAAgB,sBAAsB,OAAiC;AACrE,QAAO,aAAa;EAClB,eAAe,aAAa;GAAE;GAAO,OAAO;GAAQ,CAAC;EACrD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAU,CAAC;EACvD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAS,CAAC;EACtD,eAAe,aAAa;GAAE;GAAO,OAAO;GAAW,CAAC;EACzD,CAAC;;;;;;;;AAgBJ,SAAgB,gBACd,SAC8B;AAC9B,QAAO,MACL,qBAA+B,QAAQ,OAAO,QAAQ,WAAW,OAAO,EACxE,sBAAsB,QAAQ,MAAM,EACpC,wBAAwB,QAAQ,MAAM,CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text.d.ts","names":[],"sources":["../src/text/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AASA;AAAyB,KAAb,aAAA,GAAgB,SAAH,CAAA;OAEf,EAAA;IAFkB,IAAA,EAElB,KAFkB;EAAS,CAAA;AASrC,CAAA,CAAA;;;;iBAAgB,UAAA,CAAA,GAAc"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-text.js","names":[],"sources":["../src/text/index.ts"],"sourcesContent":["import {\n defineNodeSpec,\n type Extension,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type TextExtension = Extension<{\n Nodes: {\n text: Attrs\n }\n}>\n\n/**\n * @public\n */\nexport function defineText(): TextExtension {\n return defineNodeSpec({\n name: 'text',\n group: 'inline',\n })\n}\n"],"mappings":";;;;;;AAkBA,SAAgB,aAA4B;AAC1C,QAAO,eAAe;EACpB,MAAM;EACN,OAAO;EACR,CAAC"}
|
|
@@ -40,4 +40,5 @@ type UnderlineExtension = Union<[UnderlineSpecExtension, UnderlineCommandsExtens
|
|
|
40
40
|
*/
|
|
41
41
|
declare function defineUnderline(): UnderlineExtension;
|
|
42
42
|
//#endregion
|
|
43
|
-
export { UnderlineCommandsExtension, UnderlineExtension, UnderlineSpecExtension, defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
|
|
43
|
+
export { UnderlineCommandsExtension, UnderlineExtension, UnderlineSpecExtension, defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
|
|
44
|
+
//# sourceMappingURL=prosekit-extensions-underline.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-underline.d.ts","names":[],"sources":["../src/underline/index.ts"],"sourcesContent":[],"mappings":";;;;;;;AAeA;AAAkC,KAAtB,sBAAA,GAAyB,SAAH,CAAA;OAEnB,EAAA;IAFsB,SAAA,EAEtB,KAFsB;EAAS,CAAA;AAS9C,CAAA,CAAA;AAkBA;AASA;AASA;AASY,iBA7CI,mBAAA,CAAA,CA6Cc,EA7CS,sBA6CT;;;;AAAG,KA3BrB,0BAAA,GAA6B,SA2BR,CAAA;EAAK,QAAA,EAAA;IAOtB,eAAe,EAAA,EAAA;;;;;;iBAzBf,uBAAA,CAAA,GAA2B;;;;iBAS3B,qBAAA,CAAA,GAAyB;;;;KAS7B,kBAAA,GAAqB,OAC9B,wBAAwB;;;;iBAMX,eAAA,CAAA,GAAmB"}
|
|
@@ -38,4 +38,5 @@ function defineUnderline() {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
//#endregion
|
|
41
|
-
export { defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
|
|
41
|
+
export { defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
|
|
42
|
+
//# sourceMappingURL=prosekit-extensions-underline.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-underline.js","names":[],"sources":["../src/underline/index.ts"],"sourcesContent":["import {\n defineCommands,\n defineKeymap,\n defineMarkSpec,\n toggleMark,\n union,\n type Extension,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Attrs } from '@prosekit/pm/model'\n\n/**\n * @internal\n */\nexport type UnderlineSpecExtension = Extension<{\n Marks: {\n underline: Attrs\n }\n}>\n\n/**\n * @internal\n */\nexport function defineUnderlineSpec(): UnderlineSpecExtension {\n return defineMarkSpec({\n name: 'underline',\n parseDOM: [\n { tag: 'u' },\n { tag: 'underline' },\n { style: 'text-decoration=underline' },\n { style: 'text-decoration-line=underline' },\n ],\n toDOM() {\n return ['u', 0]\n },\n })\n}\n\n/**\n * @internal\n */\nexport type UnderlineCommandsExtension = Extension<{\n Commands: {\n toggleUnderline: []\n }\n}>\n\n/**\n * @internal\n */\nexport function defineUnderlineCommands(): UnderlineCommandsExtension {\n return defineCommands({\n toggleUnderline: () => toggleMark({ type: 'underline' }),\n })\n}\n\n/**\n * @internal\n */\nexport function defineUnderlineKeymap(): PlainExtension {\n return defineKeymap({\n 'Mod-u': toggleMark({ type: 'underline' }),\n })\n}\n\n/**\n * @internal\n */\nexport type UnderlineExtension = Union<\n [UnderlineSpecExtension, UnderlineCommandsExtension]\n>\n\n/**\n * @public\n */\nexport function defineUnderline(): UnderlineExtension {\n return union(\n defineUnderlineSpec(),\n defineUnderlineCommands(),\n defineUnderlineKeymap(),\n )\n}\n"],"mappings":";;;;;;AAwBA,SAAgB,sBAA8C;AAC5D,QAAO,eAAe;EACpB,MAAM;EACN,UAAU;GACR,EAAE,KAAK,KAAK;GACZ,EAAE,KAAK,aAAa;GACpB,EAAE,OAAO,6BAA6B;GACtC,EAAE,OAAO,kCAAkC;GAC5C;EACD,QAAQ;AACN,UAAO,CAAC,KAAK,EAAE;;EAElB,CAAC;;;;;AAeJ,SAAgB,0BAAsD;AACpE,QAAO,eAAe,EACpB,uBAAuB,WAAW,EAAE,MAAM,aAAa,CAAC,EACzD,CAAC;;;;;AAMJ,SAAgB,wBAAwC;AACtD,QAAO,aAAa,EAClB,SAAS,WAAW,EAAE,MAAM,aAAa,CAAC,EAC3C,CAAC;;;;;AAaJ,SAAgB,kBAAsC;AACpD,QAAO,MACL,qBAAqB,EACrB,yBAAyB,EACzB,uBAAuB,CACxB"}
|
|
@@ -18,4 +18,5 @@ type VirtualSelectionExtension = PlainExtension;
|
|
|
18
18
|
*/
|
|
19
19
|
declare function defineVirtualSelection(): VirtualSelectionExtension;
|
|
20
20
|
//#endregion
|
|
21
|
-
export { VirtualSelectionExtension, defineVirtualSelection };
|
|
21
|
+
export { VirtualSelectionExtension, defineVirtualSelection };
|
|
22
|
+
//# sourceMappingURL=prosekit-extensions-virtual-selection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-virtual-selection.d.ts","names":[],"sources":["../src/virtual-selection/index.ts"],"sourcesContent":[],"mappings":";;;;;;AAkBA;AAYgB,KAZJ,yBAAA,GAA4B,cAYE;;;;;;;;;;;iBAA1B,sBAAA,CAAA,GAA0B"}
|
|
@@ -41,8 +41,7 @@ const virtualSelectionPlugin = new ProseMirrorPlugin({
|
|
|
41
41
|
},
|
|
42
42
|
blur: (view) => {
|
|
43
43
|
const { dom, root } = view;
|
|
44
|
-
|
|
45
|
-
if (activeElement === dom) return;
|
|
44
|
+
if (root.activeElement === dom) return;
|
|
46
45
|
view.dispatch(setFocusMeta(view.state.tr, true));
|
|
47
46
|
}
|
|
48
47
|
},
|
|
@@ -55,4 +54,5 @@ const virtualSelectionPlugin = new ProseMirrorPlugin({
|
|
|
55
54
|
});
|
|
56
55
|
|
|
57
56
|
//#endregion
|
|
58
|
-
export { defineVirtualSelection };
|
|
57
|
+
export { defineVirtualSelection };
|
|
58
|
+
//# sourceMappingURL=prosekit-extensions-virtual-selection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-virtual-selection.js","names":[],"sources":["../src/virtual-selection/index.ts"],"sourcesContent":["import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n PluginKey,\n ProseMirrorPlugin,\n type EditorState,\n type Transaction,\n} from '@prosekit/pm/state'\nimport {\n Decoration,\n DecorationSet,\n} from '@prosekit/pm/view'\n\n/**\n * @internal\n */\nexport type VirtualSelectionExtension = PlainExtension\n\n/**\n * Shows a virtual selection when the editor is not focused. When the editor is\n * not focused, the selected inline content will be wrapped in a `<span>`\n * element with the class `prosekit-virtual-selection`.\n *\n * This is useful when you want to move the focus to an element outside the\n * editor, but still want to show the selection.\n *\n * @public\n */\nexport function defineVirtualSelection(): VirtualSelectionExtension {\n return definePlugin(virtualSelectionPlugin)\n}\n\n// Show the decoration when this is true.\ntype PluginState = boolean\n\nconst key = new PluginKey<PluginState>('prosekit-virtual-selection')\n\nfunction getFocusMeta(tr: Transaction): PluginState | undefined {\n return tr.getMeta(key) as PluginState | undefined\n}\n\nfunction setFocusMeta(tr: Transaction, value: PluginState) {\n return tr.setMeta(key, value)\n}\n\nfunction getFocusState(state: EditorState): PluginState | undefined {\n return key.getState(state)\n}\n\nconst virtualSelectionPlugin = new ProseMirrorPlugin<PluginState>({\n key,\n state: {\n init: () => false,\n apply: (tr, value) => {\n return getFocusMeta(tr) ?? value\n },\n },\n props: {\n handleDOMEvents: {\n focus: (view) => {\n view.dispatch(setFocusMeta(view.state.tr, false))\n },\n\n blur: (view) => {\n const { dom, root } = view\n const activeElement = root.activeElement\n\n // Don't show the decoration if the dom is blurred because the focus\n // moved outside the browser window.\n if (activeElement === dom) return\n\n view.dispatch(setFocusMeta(view.state.tr, true))\n },\n },\n decorations: (state) => {\n const { selection, doc } = state\n\n if (\n selection.empty\n || !getFocusState(state)\n // When `selection.visible` is false, it indicates that the selection is\n // rendered by the editor and it's not a native browser selection. An\n // example of this is `NodeSelection`. In this situation, since the\n // editor already shows the selection, we don't need to display a\n // virtual selection.\n || !selection.visible\n ) {\n return null\n }\n\n return DecorationSet.create(doc, [\n Decoration.inline(selection.from, selection.to, {\n class: 'prosekit-virtual-selection',\n }),\n ])\n },\n },\n})\n"],"mappings":";;;;;;;;;;;;;;;AA8BA,SAAgB,yBAAoD;AAClE,QAAO,aAAa,uBAAuB;;AAM7C,MAAM,MAAM,IAAI,UAAuB,6BAA6B;AAEpE,SAAS,aAAa,IAA0C;AAC9D,QAAO,GAAG,QAAQ,IAAI;;AAGxB,SAAS,aAAa,IAAiB,OAAoB;AACzD,QAAO,GAAG,QAAQ,KAAK,MAAM;;AAG/B,SAAS,cAAc,OAA6C;AAClE,QAAO,IAAI,SAAS,MAAM;;AAG5B,MAAM,yBAAyB,IAAI,kBAA+B;CAChE;CACA,OAAO;EACL,YAAY;EACZ,QAAQ,IAAI,UAAU;AACpB,UAAO,aAAa,GAAG,IAAI;;EAE9B;CACD,OAAO;EACL,iBAAiB;GACf,QAAQ,SAAS;AACf,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,MAAM,CAAC;;GAGnD,OAAO,SAAS;IACd,MAAM,EAAE,KAAK,SAAS;AAKtB,QAJsB,KAAK,kBAIL,IAAK;AAE3B,SAAK,SAAS,aAAa,KAAK,MAAM,IAAI,KAAK,CAAC;;GAEnD;EACD,cAAc,UAAU;GACtB,MAAM,EAAE,WAAW,QAAQ;AAE3B,OACE,UAAU,SACP,CAAC,cAAc,MAAM,IAMrB,CAAC,UAAU,QAEd,QAAO;AAGT,UAAO,cAAc,OAAO,KAAK,CAC/B,WAAW,OAAO,UAAU,MAAM,UAAU,IAAI,EAC9C,OAAO,8BACR,CAAC,CACH,CAAC;;EAEL;CACF,CAAC"}
|
|
@@ -86,4 +86,5 @@ declare function defineYjs(options: YjsOptions): YjsExtension;
|
|
|
86
86
|
//#region src/yjs/yjs-keymap.d.ts
|
|
87
87
|
declare function defineYjsKeymap(): PlainExtension;
|
|
88
88
|
//#endregion
|
|
89
|
-
export { type YjsCursorOptions, type YjsCursorPluginOptions, type YjsExtension, type YjsOptions, type YjsSyncOptions, type YjsSyncPluginOptions, type YjsUndoOptions, type YjsUndoPluginOptions, defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
|
|
89
|
+
export { type YjsCursorOptions, type YjsCursorPluginOptions, type YjsExtension, type YjsOptions, type YjsSyncOptions, type YjsSyncPluginOptions, type YjsUndoOptions, type YjsUndoPluginOptions, defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
|
|
90
|
+
//# sourceMappingURL=prosekit-extensions-yjs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-yjs.d.ts","names":[],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/yjs-sync-plugin.ts","../src/yjs/yjs-undo-plugin.ts","../src/yjs/yjs.ts","../src/yjs/yjs-keymap.ts"],"sourcesContent":[],"mappings":";;;;;;;;;KAiBY,oBAAA,GAAuB;;IAAvB,IAAA,EAAA,EAAA;IAOI,IAAA,EAAA,EAAA;;;iBAAA,iBAAA,CAAA,GAAqB;;;;;;AAPzB,KCNA,sBAAA,GAAyB,WDMF,CCLjC,UDK0C,CAAA,OCLxB,aDKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UCTC,gBAAA,SAAyB,sBDSe,CAAA;aCR5C;;iBAGG,qBAAA,UACL,mBACR;;;;;;ADJS,KENA,oBAAA,GAAuB,WFMA,CELjC,UFK0C,CAAA,OELxB,WFKwB,CAAA,CAAA,CAAA,CAAA,CAAA;AAO5B,UETC,cAAA,SAAuB,oBFSiB,CAAA;YER7C,CAAA,CAAE;;iBAGE,mBAAA,UAA6B,iBAAiB;;;;;;KC+ClD,oBAAA,GAAuB,YACjC,kBAAkB;AHlDR,UGqDK,cAAA,SAAuB,oBHrDI,CAAA,CAO5C;;;;ACbY,iBEyEI,mBAAA,CFzEkB,OAAA,EEyEW,cFzEX,CAAA,EEyE4B,cFzE5B;;;ADalB,UIIC,UAAA,CJJgB;;;;ECbrB,GAAA,EGqBL,CAAA,CAAE,GHrBG;EAAsB;;;WAAG,EG0BxB,SH1BwB;EAAW;AAIhD;;;UAA0C,CAAA,EG4B7B,CAAA,CAAE,WH5B2B;EAAsB;AAIhE;;MACW,CAAA,EG4BF,oBH5BE;;;;SGiCF;;AF1CT;;QACoB,CAAA,EE8CT,sBF9CS;;;;AAGpB;AAAgC,KEiDpB,YAAA,GAAe,KFjDK,CAAA,CEiDE,oBFjDF,EEiDwB,cFjDxB,CAAA,CAAA;;;;AAIhB,iBEkDA,SAAA,CFlDmB,OAAA,EEkDA,UFlDA,CAAA,EEkDa,YFlDb;;;iBGCnB,eAAA,CAAA,GAAmB"}
|
|
@@ -102,4 +102,5 @@ function defineYjs(options) {
|
|
|
102
102
|
}
|
|
103
103
|
|
|
104
104
|
//#endregion
|
|
105
|
-
export { defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
|
|
105
|
+
export { defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };
|
|
106
|
+
//# sourceMappingURL=prosekit-extensions-yjs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prosekit-extensions-yjs.js","names":["keymap: Keymap","yUndoPlugin","originalYUndoPlugin"],"sources":["../src/yjs/yjs-commands.ts","../src/yjs/yjs-cursor-plugin.ts","../src/yjs/yjs-keymap.ts","../src/yjs/yjs-sync-plugin.ts","../src/yjs/yjs-undo-plugin.ts","../src/yjs/yjs.ts"],"sourcesContent":["import {\n defineCommands,\n type Extension,\n} from '@prosekit/core'\nimport {\n redoCommand,\n undoCommand,\n} from 'y-prosemirror'\n\nconst commands = {\n undo: () => undoCommand,\n redo: () => redoCommand,\n} as const\n\n/**\n * @internal\n */\nexport type YjsCommandsExtension = Extension<{\n Commands: {\n undo: []\n redo: []\n }\n}>\n\nexport function defineYjsCommands(): YjsCommandsExtension {\n return defineCommands(commands)\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport type { Plugin } from '@prosekit/pm/state'\nimport { yCursorPlugin } from 'y-prosemirror'\nimport type { Awareness } from 'y-protocols/awareness'\n\n/**\n * Options for `y-prosemirror`'s `yCursorPlugin`.\n */\nexport type YjsCursorPluginOptions = NonNullable<\n Parameters<typeof yCursorPlugin>[1]\n>\n\nexport interface YjsCursorOptions extends YjsCursorPluginOptions {\n awareness: Awareness\n}\n\nexport function defineYjsCursorPlugin(\n options: YjsCursorOptions,\n): PlainExtension {\n const { awareness, ...rest } = options\n return definePlugin(yCursorPlugin(awareness, rest) as Plugin)\n}\n","import {\n defineKeymap,\n isApple,\n type Keymap,\n type PlainExtension,\n} from '@prosekit/core'\nimport {\n redoCommand,\n undoCommand,\n} from 'y-prosemirror'\n\nconst keymap: Keymap = {\n 'Mod-z': undoCommand,\n 'Shift-Mod-z': redoCommand,\n}\n\nif (!isApple) {\n keymap['Mod-y'] = redoCommand\n}\n\nexport function defineYjsKeymap(): PlainExtension {\n return defineKeymap(keymap)\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport type { Plugin } from '@prosekit/pm/state'\nimport { ySyncPlugin } from 'y-prosemirror'\nimport type * as Y from 'yjs'\n\n/**\n * Options for `y-prosemirror`'s `ySyncPlugin`.\n */\nexport type YjsSyncPluginOptions = NonNullable<\n Parameters<typeof ySyncPlugin>[1]\n>\n\nexport interface YjsSyncOptions extends YjsSyncPluginOptions {\n fragment: Y.XmlFragment\n}\n\nexport function defineYjsSyncPlugin(options: YjsSyncOptions): PlainExtension {\n const { fragment, ...rest } = options\n return definePlugin(ySyncPlugin(fragment, rest) as Plugin)\n}\n","import {\n definePlugin,\n type PlainExtension,\n} from '@prosekit/core'\nimport type { ProseMirrorPlugin } from '@prosekit/pm/state'\nimport type { EditorView } from '@prosekit/pm/view'\nimport {\n yUndoPlugin as originalYUndoPlugin,\n yUndoPluginKey,\n} from 'y-prosemirror'\nimport type { UndoManager as YjsUndoManager } from 'yjs'\n\ntype UndoManager = YjsUndoManager & { restore: () => void }\n\n/**\n * @see https://github.com/yjs/y-prosemirror/issues/114 and https://github.com/yjs/y-prosemirror/issues/102\n */\nfunction fixYUndoPlugin(yUndoPluginInstance: ProseMirrorPlugin) {\n const originalUndoPluginView = yUndoPluginInstance.spec.view\n yUndoPluginInstance.spec.view = (view: EditorView) => {\n const pluginState = yUndoPluginKey.getState(view.state)\n if (!pluginState) {\n return {}\n }\n\n const undoManager = pluginState.undoManager as UndoManager\n\n if (undoManager.restore) {\n undoManager.restore()\n undoManager.restore = () => {}\n }\n\n const viewRet = originalUndoPluginView\n ? originalUndoPluginView(view)\n : undefined\n\n return {\n destroy: () => {\n const hasUndoManSelf = undoManager.trackedOrigins.has(undoManager)\n\n const observers = undoManager._observers\n\n undoManager.restore = () => {\n if (hasUndoManSelf) {\n undoManager.trackedOrigins.add(undoManager)\n }\n\n undoManager.doc.on(\n 'afterTransaction',\n undoManager.afterTransactionHandler,\n )\n\n undoManager._observers = observers\n }\n\n if (viewRet?.destroy) {\n viewRet.destroy()\n }\n },\n }\n }\n}\n\n/**\n * Options for the `y-prosemirror`'s `yUndoPlugin`.\n */\nexport type YjsUndoPluginOptions = NonNullable<\n Parameters<typeof originalYUndoPlugin>[0]\n>\n\nexport interface YjsUndoOptions extends YjsUndoPluginOptions {}\n\n/**\n * @internal\n */\nfunction yUndoPlugin(options?: YjsUndoOptions) {\n const yUndoPluginInstance = originalYUndoPlugin(options)\n fixYUndoPlugin(yUndoPluginInstance)\n return yUndoPluginInstance\n}\n\n/**\n * @internal\n */\nexport function defineYjsUndoPlugin(options: YjsUndoOptions): PlainExtension {\n return definePlugin(yUndoPlugin(options))\n}\n","import {\n Priority,\n union,\n withPriority,\n type PlainExtension,\n type Union,\n} from '@prosekit/core'\nimport type { Awareness } from 'y-protocols/awareness'\nimport type * as Y from 'yjs'\n\nimport {\n defineYjsCommands,\n type YjsCommandsExtension,\n} from './yjs-commands'\nimport {\n defineYjsCursorPlugin,\n type YjsCursorPluginOptions,\n} from './yjs-cursor-plugin'\nimport { defineYjsKeymap } from './yjs-keymap'\nimport {\n defineYjsSyncPlugin,\n type YjsSyncPluginOptions,\n} from './yjs-sync-plugin'\nimport {\n defineYjsUndoPlugin,\n type YjsUndoPluginOptions,\n} from './yjs-undo-plugin'\n\nexport interface YjsOptions {\n /**\n * The Yjs instance handles the state of shared data.\n */\n doc: Y.Doc\n\n /**\n * The Awareness instance.\n */\n awareness: Awareness\n\n /**\n * The Yjs XmlFragment to use. If not provided,\n * `doc.getXmlFragment('prosemirror')` will be used.\n */\n fragment?: Y.XmlFragment\n\n /**\n * Options for `y-prosemirror`'s `ySyncPlugin`.\n */\n sync?: YjsSyncPluginOptions\n\n /**\n * Options for the `y-prosemirror`'s `yUndoPlugin`.\n */\n undo?: YjsUndoPluginOptions\n\n /**\n * Options for `y-prosemirror`'s `yCursorPlugin`.\n */\n cursor?: YjsCursorPluginOptions\n}\n\n/**\n * @internal\n */\nexport type YjsExtension = Union<[YjsCommandsExtension, PlainExtension]>\n\n/**\n * @public\n */\nexport function defineYjs(options: YjsOptions): YjsExtension {\n const { doc, awareness, sync, undo, cursor } = options\n const fragment = options.fragment ?? doc.getXmlFragment('prosemirror')\n\n return withPriority(\n union([\n defineYjsKeymap(),\n defineYjsCommands(),\n defineYjsCursorPlugin({ ...cursor, awareness }),\n defineYjsUndoPlugin({ ...undo }),\n defineYjsSyncPlugin({ ...sync, fragment }),\n ]),\n Priority.high,\n )\n}\n"],"mappings":";;;;AASA,MAAM,WAAW;CACf,YAAY;CACZ,YAAY;CACb;AAYD,SAAgB,oBAA0C;AACxD,QAAO,eAAe,SAAS;;;;;ACNjC,SAAgB,sBACd,SACgB;CAChB,MAAM,EAAE,UAAW,GAAG,SAAS;AAC/B,QAAO,aAAa,cAAc,WAAW,KAAK,CAAW;;;;;ACZ/D,MAAMA,SAAiB;CACrB,SAAS;CACT,eAAe;CAChB;AAED,IAAI,CAAC,QACH,QAAO,WAAW;AAGpB,SAAgB,kBAAkC;AAChD,QAAO,aAAa,OAAO;;;;;ACF7B,SAAgB,oBAAoB,SAAyC;CAC3E,MAAM,EAAE,SAAU,GAAG,SAAS;AAC9B,QAAO,aAAa,YAAY,UAAU,KAAK,CAAW;;;;;;;;ACJ5D,SAAS,eAAe,qBAAwC;CAC9D,MAAM,yBAAyB,oBAAoB,KAAK;AACxD,qBAAoB,KAAK,QAAQ,SAAqB;EACpD,MAAM,cAAc,eAAe,SAAS,KAAK,MAAM;AACvD,MAAI,CAAC,YACH,QAAO,EAAE;EAGX,MAAM,cAAc,YAAY;AAEhC,MAAI,YAAY,SAAS;AACvB,eAAY,SAAS;AACrB,eAAY,gBAAgB;;EAG9B,MAAM,UAAU,yBACZ,uBAAuB,KAAK,GAC5B;AAEJ,SAAO,EACL,eAAe;GACb,MAAM,iBAAiB,YAAY,eAAe,IAAI,YAAY;GAElE,MAAM,YAAY,YAAY;AAE9B,eAAY,gBAAgB;AAC1B,QAAI,eACF,aAAY,eAAe,IAAI,YAAY;AAG7C,gBAAY,IAAI,GACd,oBACA,YAAY,wBACb;AAED,gBAAY,aAAa;;AAG3B,OAAI,SAAS,QACX,SAAQ,SAAS;KAGtB;;;;;;AAgBL,SAASC,cAAY,SAA0B;CAC7C,MAAM,sBAAsBC,YAAoB,QAAQ;AACxD,gBAAe,oBAAoB;AACnC,QAAO;;;;;AAMT,SAAgB,oBAAoB,SAAyC;AAC3E,QAAO,aAAaD,cAAY,QAAQ,CAAC;;;;;;;;AChB3C,SAAgB,UAAU,SAAmC;CAC3D,MAAM,EAAE,KAAK,WAAW,MAAM,MAAM,WAAW;CAC/C,MAAM,WAAW,QAAQ,YAAY,IAAI,eAAe,cAAc;AAEtE,QAAO,aACL,MAAM;EACJ,iBAAiB;EACjB,mBAAmB;EACnB,sBAAsB;GAAE,GAAG;GAAQ;GAAW,CAAC;EAC/C,oBAAoB,EAAE,GAAG,MAAM,CAAC;EAChC,oBAAoB;GAAE,GAAG;GAAM;GAAU,CAAC;EAC3C,CAAC,EACF,SAAS,KACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/search/style.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.css","names":[],"sources":["../../src/search/style.css"],"sourcesContent":[".ProseMirror-search-match {\n border-radius: 2px;\n background-color: #ffff0054;\n box-shadow: 0 0 0 2px #ffff0054;\n}\n\n.ProseMirror.ProseMirror-focused .ProseMirror-active-search-match::selection,\n.ProseMirror:not(.ProseMirror-focused) .ProseMirror-active-search-match {\n border-radius: 2px;\n background-color: #ff6a0054;\n box-shadow: 0 0 0 2px #ff6a0054;\n scroll-margin: 8px;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist/search/style.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -15,4 +15,5 @@ type HighlighterResult = {
|
|
|
15
15
|
};
|
|
16
16
|
declare function createOrGetHighlighter(options: HighlighterOptions): HighlighterResult;
|
|
17
17
|
//#endregion
|
|
18
|
-
export { HighlighterOptions, HighlighterResult, ShikiHighlighterOptions, createOrGetHighlighter };
|
|
18
|
+
export { HighlighterOptions, HighlighterResult, ShikiHighlighterOptions, createOrGetHighlighter };
|
|
19
|
+
//# sourceMappingURL=shiki-highlighter-chunk-DSPM0T27.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki-highlighter-chunk-DSPM0T27.d.ts","names":[],"sources":["../src/code-block/shiki-highlighter-chunk.ts"],"sourcesContent":[],"mappings":";;;UAeiB,uBAAA,SAAgC,0BAA0B,iBAAiB;AAA3E,UAEA,kBAAA,SAA2B,IAFH,CAEQ,uBAFR,EAAA,OAAA,GAAA,QAAA,CAAA,CAAA;EAAA,MAAA,EAG/B,YAH+B,EAAA;OAAkC,EAAA,CAIjE,eAJiE,GAI/C,eAJ+C,CAAA,EAAA;;AAA1B,KAwCrC,iBAAA,GAxCqC;EAAyB,WAAA,EA0CzD,WA1CyD;EAEzD,OAAA,CAAA,EAAA,SAAA;CAAmB,GAAA;aAAa,CAAA,EAAA,SAAA;SACvC,EA4CG,OA5CH,CAAA,IAAA,CAAA;;AACkB,iBA8CZ,sBAAA,CA9CY,OAAA,EA+CjB,kBA/CiB,CAAA,EAgDzB,iBAhDyB"}
|
|
@@ -8,10 +8,7 @@ const loadedLangs = /* @__PURE__ */ new Set();
|
|
|
8
8
|
const loadedThemes = /* @__PURE__ */ new Set();
|
|
9
9
|
function ensureHighlighter({ ...options }) {
|
|
10
10
|
if (!highlighterPromise) {
|
|
11
|
-
if (!options.engine) {
|
|
12
|
-
const engine = createJavaScriptRegexEngine({ forgiving: true });
|
|
13
|
-
options.engine = engine;
|
|
14
|
-
}
|
|
11
|
+
if (!options.engine) options.engine = createJavaScriptRegexEngine({ forgiving: true });
|
|
15
12
|
highlighterPromise = createHighlighter(options).then((createdHighlighter) => {
|
|
16
13
|
highlighter = createdHighlighter;
|
|
17
14
|
});
|
|
@@ -42,4 +39,5 @@ function createOrGetHighlighter(options) {
|
|
|
42
39
|
}
|
|
43
40
|
|
|
44
41
|
//#endregion
|
|
45
|
-
export { createOrGetHighlighter };
|
|
42
|
+
export { createOrGetHighlighter };
|
|
43
|
+
//# sourceMappingURL=shiki-highlighter-chunk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shiki-highlighter-chunk.js","names":["highlighterPromise: Promise<void> | undefined","highlighter: Highlighter | undefined"],"sources":["../src/code-block/shiki-highlighter-chunk.ts"],"sourcesContent":["import type {\n BundledHighlighterOptions,\n BundledLanguage,\n BundledTheme,\n Highlighter,\n SpecialLanguage,\n} from 'shiki'\nimport { createHighlighter } from 'shiki/bundle/full'\nimport { createJavaScriptRegexEngine } from 'shiki/engine/javascript'\n\nlet highlighterPromise: Promise<void> | undefined\nlet highlighter: Highlighter | undefined\nconst loadedLangs = new Set<BundledLanguage | SpecialLanguage>()\nconst loadedThemes = new Set<BundledTheme>()\n\nexport interface ShikiHighlighterOptions extends BundledHighlighterOptions<BundledLanguage, BundledTheme> {}\n\nexport interface HighlighterOptions extends Omit<ShikiHighlighterOptions, 'langs' | 'themes'> {\n themes: BundledTheme[]\n langs: (BundledLanguage | SpecialLanguage)[]\n}\n\nfunction ensureHighlighter({\n ...options\n}: HighlighterOptions): Promise<void> {\n if (!highlighterPromise) {\n // If no engine is provided, use the JavaScript engine, which is\n // smaller than the WASM engine.\n if (!options.engine) {\n const engine = createJavaScriptRegexEngine({ forgiving: true })\n options.engine = engine\n }\n highlighterPromise = createHighlighter(options).then((createdHighlighter) => {\n highlighter = createdHighlighter\n })\n }\n return highlighterPromise\n}\n\nasync function loadLanguages(langs: (BundledLanguage | SpecialLanguage)[]) {\n for (const lang of langs) {\n if (!highlighter) break\n await highlighter.loadLanguage(lang)\n loadedLangs.add(lang)\n }\n}\n\nasync function loadThemes(themes: BundledTheme[]) {\n for (const theme of themes) {\n if (!highlighter) break\n await highlighter.loadTheme(theme)\n loadedThemes.add(theme)\n }\n}\n\nexport type HighlighterResult =\n | {\n highlighter: Highlighter\n promise?: undefined\n }\n | {\n highlighter?: undefined\n promise: Promise<void>\n }\n\nexport function createOrGetHighlighter(\n options: HighlighterOptions,\n): HighlighterResult {\n if (!highlighter) {\n return { promise: ensureHighlighter(options) }\n }\n\n const langs = options.langs.filter((lang) => !loadedLangs.has(lang))\n if (langs.length > 0) {\n return { promise: loadLanguages(langs) }\n }\n\n const themes = options.themes.filter((theme) => !loadedThemes.has(theme))\n if (themes.length > 0) {\n return { promise: loadThemes(themes) }\n }\n\n return { highlighter }\n}\n"],"mappings":";;;;AAUA,IAAIA;AACJ,IAAIC;AACJ,MAAM,8BAAc,IAAI,KAAwC;AAChE,MAAM,+BAAe,IAAI,KAAmB;AAS5C,SAAS,kBAAkB,EACzB,GAAG,WACiC;AACpC,KAAI,CAAC,oBAAoB;AAGvB,MAAI,CAAC,QAAQ,OAEX,SAAQ,SADO,4BAA4B,EAAE,WAAW,MAAM,CAAC;AAGjE,uBAAqB,kBAAkB,QAAQ,CAAC,MAAM,uBAAuB;AAC3E,iBAAc;IACd;;AAEJ,QAAO;;AAGT,eAAe,cAAc,OAA8C;AACzE,MAAK,MAAM,QAAQ,OAAO;AACxB,MAAI,CAAC,YAAa;AAClB,QAAM,YAAY,aAAa,KAAK;AACpC,cAAY,IAAI,KAAK;;;AAIzB,eAAe,WAAW,QAAwB;AAChD,MAAK,MAAM,SAAS,QAAQ;AAC1B,MAAI,CAAC,YAAa;AAClB,QAAM,YAAY,UAAU,MAAM;AAClC,eAAa,IAAI,MAAM;;;AAc3B,SAAgB,uBACd,SACmB;AACnB,KAAI,CAAC,YACH,QAAO,EAAE,SAAS,kBAAkB,QAAQ,EAAE;CAGhD,MAAM,QAAQ,QAAQ,MAAM,QAAQ,SAAS,CAAC,YAAY,IAAI,KAAK,CAAC;AACpE,KAAI,MAAM,SAAS,EACjB,QAAO,EAAE,SAAS,cAAc,MAAM,EAAE;CAG1C,MAAM,SAAS,QAAQ,OAAO,QAAQ,UAAU,CAAC,aAAa,IAAI,MAAM,CAAC;AACzE,KAAI,OAAO,SAAS,EAClB,QAAO,EAAE,SAAS,WAAW,OAAO,EAAE;AAGxC,QAAO,EAAE,aAAa"}
|
package/dist/table/style.css
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style.css","names":[],"sources":["../../src/table/style.css"],"sourcesContent":[".ProseMirror .tableWrapper {\n overflow-x: auto;\n}\n.ProseMirror table {\n width: 100%;\n overflow: hidden;\n border-collapse: collapse;\n table-layout: fixed;\n}\n.ProseMirror td,\n.ProseMirror th {\n box-sizing: border-box;\n position: relative;\n padding-right: 0.75rem;\n padding-left: 0.75rem;\n border-width: 1px;\n vertical-align: top;\n}\n\nprosekit-table-handle-drop-indicator {\n background-color: HighlightText;\n}\n\n.ProseMirror .column-resize-handle {\n z-index: 20;\n position: absolute;\n top: 0;\n right: -2px;\n bottom: 0;\n width: 4px;\n background-color: HighlightText;\n pointer-events: none;\n}\n.ProseMirror.resize-cursor {\n cursor: ew-resize;\n cursor: col-resize;\n}\n.ProseMirror .selectedCell {\n --color: 210, 100%, 56%;\n border: 1px double hsl(var(--color));\n background-color: hsla(var(--color), 20%);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist/table/style.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|