@prosekit/extensions 0.14.1 → 0.15.0
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 +1 -3
- package/dist/{drop-indicator-DJq8pF92.js → drop-indicator.js} +2 -4
- package/dist/drop-indicator.js.map +1 -0
- package/dist/{file-upload-I9m1EJAM.js → file.js} +2 -6
- package/dist/file.js.map +1 -0
- package/dist/gap-cursor/style.css +5 -8
- package/dist/{file-upload-dr3IXUty.d.ts → index.d.ts} +1 -1
- package/dist/index.d.ts.map +1 -0
- package/dist/list/style.css +79 -110
- package/dist/loro/style.css +18 -21
- package/dist/{mark-rule-CUnXwBuy.js → mark-rule.js} +3 -6
- package/dist/mark-rule.js.map +1 -0
- package/dist/page/style.css +43 -0
- package/dist/{mark-paste-rule-n_2Ehmb5.js → paste-rule.js} +3 -7
- package/dist/paste-rule.js.map +1 -0
- package/dist/placeholder/style.css +4 -7
- package/dist/prosekit-extensions-autocomplete.d.ts +1 -1
- package/dist/prosekit-extensions-autocomplete.js +17 -21
- package/dist/prosekit-extensions-autocomplete.js.map +1 -1
- package/dist/prosekit-extensions-background-color.d.ts +1 -1
- package/dist/prosekit-extensions-background-color.js +1 -4
- package/dist/prosekit-extensions-background-color.js.map +1 -1
- package/dist/prosekit-extensions-blockquote.d.ts +13 -13
- package/dist/prosekit-extensions-blockquote.d.ts.map +1 -1
- package/dist/prosekit-extensions-blockquote.js +6 -10
- package/dist/prosekit-extensions-blockquote.js.map +1 -1
- package/dist/prosekit-extensions-bold.d.ts +12 -12
- package/dist/prosekit-extensions-bold.d.ts.map +1 -1
- package/dist/prosekit-extensions-bold.js +1 -6
- package/dist/prosekit-extensions-bold.js.map +1 -1
- package/dist/prosekit-extensions-code-block.d.ts +56 -37
- package/dist/prosekit-extensions-code-block.d.ts.map +1 -1
- package/dist/prosekit-extensions-code-block.js +73 -76
- package/dist/prosekit-extensions-code-block.js.map +1 -1
- package/dist/prosekit-extensions-code.d.ts +12 -12
- package/dist/prosekit-extensions-code.d.ts.map +1 -1
- package/dist/prosekit-extensions-code.js +1 -6
- package/dist/prosekit-extensions-code.js.map +1 -1
- package/dist/prosekit-extensions-commit.d.ts +1 -1
- package/dist/prosekit-extensions-commit.js +2 -3
- package/dist/prosekit-extensions-commit.js.map +1 -1
- package/dist/prosekit-extensions-doc.js +1 -2
- package/dist/prosekit-extensions-doc.js.map +1 -1
- package/dist/prosekit-extensions-drop-cursor.js +1 -2
- package/dist/prosekit-extensions-drop-cursor.js.map +1 -1
- package/dist/prosekit-extensions-drop-indicator.js +2 -3
- package/dist/prosekit-extensions-enter-rule.d.ts +2 -2
- package/dist/prosekit-extensions-enter-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-enter-rule.js +1 -2
- package/dist/prosekit-extensions-enter-rule.js.map +1 -1
- package/dist/prosekit-extensions-file.d.ts +2 -2
- package/dist/prosekit-extensions-file.js +2 -3
- package/dist/prosekit-extensions-gap-cursor.js +1 -2
- package/dist/prosekit-extensions-gap-cursor.js.map +1 -1
- package/dist/prosekit-extensions-hard-break.d.ts +7 -7
- package/dist/prosekit-extensions-hard-break.d.ts.map +1 -1
- package/dist/prosekit-extensions-hard-break.js +1 -5
- package/dist/prosekit-extensions-hard-break.js.map +1 -1
- package/dist/prosekit-extensions-heading.d.ts +15 -15
- package/dist/prosekit-extensions-heading.d.ts.map +1 -1
- package/dist/prosekit-extensions-heading.js +1 -6
- package/dist/prosekit-extensions-heading.js.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.d.ts +7 -7
- package/dist/prosekit-extensions-horizontal-rule.d.ts.map +1 -1
- package/dist/prosekit-extensions-horizontal-rule.js +12 -14
- package/dist/prosekit-extensions-horizontal-rule.js.map +1 -1
- package/dist/prosekit-extensions-image.d.ts +12 -13
- package/dist/prosekit-extensions-image.d.ts.map +1 -1
- package/dist/prosekit-extensions-image.js +10 -16
- package/dist/prosekit-extensions-image.js.map +1 -1
- package/dist/prosekit-extensions-input-rule.js +1 -2
- package/dist/prosekit-extensions-input-rule.js.map +1 -1
- package/dist/prosekit-extensions-italic.d.ts +12 -12
- package/dist/prosekit-extensions-italic.d.ts.map +1 -1
- package/dist/prosekit-extensions-italic.js +1 -6
- package/dist/prosekit-extensions-italic.js.map +1 -1
- package/dist/prosekit-extensions-link.js +3 -6
- package/dist/prosekit-extensions-link.js.map +1 -1
- package/dist/prosekit-extensions-list.d.ts +26 -26
- package/dist/prosekit-extensions-list.d.ts.map +1 -1
- package/dist/prosekit-extensions-list.js +26 -34
- package/dist/prosekit-extensions-list.js.map +1 -1
- package/dist/prosekit-extensions-loro.d.ts +16 -16
- package/dist/prosekit-extensions-loro.d.ts.map +1 -1
- package/dist/prosekit-extensions-loro.js +3 -9
- package/dist/prosekit-extensions-loro.js.map +1 -1
- package/dist/prosekit-extensions-mark-rule.js +2 -3
- package/dist/prosekit-extensions-math.d.ts +3 -3
- package/dist/prosekit-extensions-math.d.ts.map +1 -1
- package/dist/prosekit-extensions-math.js +5 -5
- package/dist/prosekit-extensions-math.js.map +1 -1
- package/dist/prosekit-extensions-mention.js +1 -2
- package/dist/prosekit-extensions-mention.js.map +1 -1
- package/dist/prosekit-extensions-mod-click-prevention.js +2 -3
- package/dist/prosekit-extensions-mod-click-prevention.js.map +1 -1
- package/dist/prosekit-extensions-page.d.ts +114 -0
- package/dist/prosekit-extensions-page.d.ts.map +1 -0
- package/dist/prosekit-extensions-page.js +324 -0
- package/dist/prosekit-extensions-page.js.map +1 -0
- package/dist/prosekit-extensions-paragraph.d.ts +7 -7
- package/dist/prosekit-extensions-paragraph.d.ts.map +1 -1
- package/dist/prosekit-extensions-paragraph.js +3 -7
- package/dist/prosekit-extensions-paragraph.js.map +1 -1
- package/dist/prosekit-extensions-paste-rule.js +2 -3
- package/dist/prosekit-extensions-placeholder.d.ts +1 -1
- package/dist/prosekit-extensions-placeholder.js +3 -4
- package/dist/prosekit-extensions-placeholder.js.map +1 -1
- package/dist/prosekit-extensions-readonly.js +2 -3
- package/dist/prosekit-extensions-readonly.js.map +1 -1
- package/dist/prosekit-extensions-search.js +1 -2
- package/dist/prosekit-extensions-search.js.map +1 -1
- package/dist/prosekit-extensions-strike.js +1 -2
- package/dist/prosekit-extensions-strike.js.map +1 -1
- package/dist/prosekit-extensions-table.d.ts +47 -47
- package/dist/prosekit-extensions-table.d.ts.map +1 -1
- package/dist/prosekit-extensions-table.js +2 -3
- package/dist/prosekit-extensions-text-align.d.ts +1 -1
- package/dist/prosekit-extensions-text-align.js +1 -2
- package/dist/prosekit-extensions-text-align.js.map +1 -1
- package/dist/prosekit-extensions-text-color.d.ts +1 -1
- package/dist/prosekit-extensions-text-color.js +1 -4
- package/dist/prosekit-extensions-text-color.js.map +1 -1
- package/dist/prosekit-extensions-text.js +1 -2
- package/dist/prosekit-extensions-text.js.map +1 -1
- package/dist/prosekit-extensions-underline.js +1 -2
- package/dist/prosekit-extensions-underline.js.map +1 -1
- package/dist/prosekit-extensions-virtual-selection.js +2 -3
- package/dist/prosekit-extensions-virtual-selection.js.map +1 -1
- package/dist/prosekit-extensions-yjs.d.ts +3 -3
- package/dist/prosekit-extensions-yjs.d.ts.map +1 -1
- package/dist/prosekit-extensions-yjs.js +3 -9
- package/dist/prosekit-extensions-yjs.js.map +1 -1
- package/dist/prosekit-extensions.js +1 -1
- package/dist/search/style.css +4 -8
- package/dist/shiki-highlighter-chunk.js +1 -2
- package/dist/shiki-highlighter-chunk.js.map +1 -1
- package/dist/table/style.css +16 -16
- package/dist/{table-UJVYsrB7.js → table.js} +29 -41
- package/dist/table.js.map +1 -0
- package/dist/virtual-selection/style.css +1 -4
- package/dist/yjs/style.css +14 -20
- package/package.json +30 -16
- package/src/autocomplete/autocomplete-helpers.ts +1 -1
- package/src/autocomplete/autocomplete-plugin.ts +2 -2
- package/src/autocomplete/autocomplete-rule.ts +1 -1
- package/src/autocomplete/autocomplete.spec.ts +4 -4
- package/src/autocomplete/autocomplete.ts +2 -2
- package/src/autocomplete/index.ts +2 -2
- package/src/background-color/background-color-commands.spec.ts +1 -1
- package/src/background-color/background-color-commands.ts +1 -1
- package/src/background-color/background-color-spec.spec.ts +1 -1
- package/src/background-color/background-color.ts +2 -2
- package/src/background-color/index.ts +3 -3
- package/src/blockquote/blockquote-input-rule.ts +1 -1
- package/src/blockquote/blockquote-keymap.spec.ts +1 -1
- package/src/blockquote/blockquote-keymap.ts +9 -7
- package/src/blockquote/blockquote.ts +4 -4
- package/src/blockquote/index.ts +5 -5
- package/src/bold/bold-input-rule.spec.ts +2 -2
- package/src/bold/bold-input-rule.ts +1 -1
- package/src/bold/bold.ts +4 -4
- package/src/bold/index.ts +5 -5
- package/src/code/code-input-rule.ts +1 -1
- package/src/code/code.ts +4 -4
- package/src/code/index.ts +5 -5
- package/src/code-block/code-block-commands.ts +1 -1
- package/src/code-block/code-block-highlight.ts +11 -1
- package/src/code-block/code-block-input-rule.ts +3 -3
- package/src/code-block/code-block-shiki.ts +13 -5
- package/src/code-block/code-block-spec.spec.ts +2 -2
- package/src/code-block/code-block-spec.ts +1 -1
- package/src/code-block/code-block.ts +4 -4
- package/src/code-block/index.ts +9 -9
- package/src/code-block/shiki-highlighter.ts +2 -2
- package/src/code-block/shiki-parser.ts +2 -2
- package/src/drop-cursor/index.ts +1 -1
- package/src/drop-indicator/drop-indicator.ts +1 -1
- package/src/drop-indicator/index.ts +1 -1
- package/src/enter-rule/index.ts +3 -3
- package/src/file/file-drop-handler.ts +1 -1
- package/src/file/file-paste-handler.spec.ts +3 -3
- package/src/file/file-paste-handler.ts +1 -1
- package/src/file/index.ts +3 -3
- package/src/gap-cursor/index.ts +1 -1
- package/src/hard-break/hard-break-keymap.spec.ts +2 -2
- package/src/hard-break/hard-break-keymap.ts +1 -1
- package/src/hard-break/hard-break.ts +3 -3
- package/src/hard-break/index.ts +4 -4
- package/src/heading/heading-commands.ts +1 -1
- package/src/heading/heading-input-rule.ts +2 -2
- package/src/heading/heading-keymap.spec.ts +1 -1
- package/src/heading/heading-spec.ts +1 -1
- package/src/heading/heading.ts +4 -4
- package/src/heading/index.ts +6 -6
- package/src/horizontal-rule/horizontal-rule-commands.spec.ts +1 -1
- package/src/horizontal-rule/horizontal-rule-commands.ts +14 -11
- package/src/horizontal-rule/horizontal-rule-input-rule.spec.ts +2 -2
- package/src/horizontal-rule/horizontal-rule-input-rule.ts +1 -1
- package/src/horizontal-rule/horizontal-rule.ts +3 -3
- package/src/horizontal-rule/index.ts +4 -4
- package/src/image/image-commands/insert-image.ts +1 -1
- package/src/image/image-commands/upload-image.spec.ts +4 -4
- package/src/image/image-commands/upload-image.ts +2 -2
- package/src/image/image-commands.ts +3 -3
- package/src/image/image-upload-handler.ts +2 -2
- package/src/image/image.ts +2 -2
- package/src/image/index.ts +6 -6
- package/src/italic/index.ts +5 -5
- package/src/italic/italic-commands.spec.ts +4 -4
- package/src/italic/italic-input-rule.spec.ts +2 -2
- package/src/italic/italic-input-rule.ts +1 -1
- package/src/italic/italic.ts +4 -4
- package/src/link/index.spec.ts +2 -2
- package/src/link/index.ts +6 -6
- package/src/link/link-paste-rule.spec.ts +2 -2
- package/src/link/link-paste-rule.ts +3 -3
- package/src/link/link-regex.spec.ts +1 -1
- package/src/list/index.ts +8 -8
- package/src/list/list-drop-indicator.ts +2 -2
- package/src/list/list-input-rules.ts +1 -1
- package/src/list/list-keymap.spec.ts +1 -1
- package/src/list/list-spec.ts +1 -1
- package/src/list/list-types.spec.ts +2 -2
- package/src/list/list.spec.ts +6 -6
- package/src/list/list.ts +7 -7
- package/src/loro/index.ts +6 -6
- package/src/loro/loro.ts +8 -7
- package/src/mark-rule/apply.ts +2 -2
- package/src/mark-rule/index.ts +2 -2
- package/src/mark-rule/mark-rule.spec.ts +4 -4
- package/src/mark-rule/mark-rule.ts +2 -2
- package/src/math/index.ts +4 -4
- package/src/math/math-block.ts +8 -1
- package/src/math/math-inline.ts +1 -1
- package/src/math/math.ts +3 -3
- package/src/page/index.ts +5 -0
- package/src/page/page-break-commands.spec.ts +61 -0
- package/src/page/page-break-commands.ts +41 -0
- package/src/page/page-break-keymap.ts +17 -0
- package/src/page/page-break-spec.ts +33 -0
- package/src/page/page-break.ts +23 -0
- package/src/page/page-element.ts +246 -0
- package/src/page/page-rendering.ts +164 -0
- package/src/page/style.css +43 -0
- package/src/paragraph/index.ts +7 -7
- package/src/paragraph/paragraph-keymap.ts +1 -1
- package/src/paragraph/paragraph.ts +6 -5
- package/src/paste-rule/index.ts +2 -2
- package/src/paste-rule/mark-paste-rule.spec.ts +8 -8
- package/src/paste-rule/mark-paste-rule.ts +2 -2
- package/src/paste-rule/paste-rule.spec.ts +2 -2
- package/src/paste-rule/paste-rule.ts +1 -1
- package/src/paste-rule/split-text-by-regex.spec.ts +1 -1
- package/src/placeholder/index.ts +1 -1
- package/src/strike/index.ts +1 -1
- package/src/table/index.ts +14 -14
- package/src/table/table-commands/delete-cell-selection.spec.ts +3 -3
- package/src/table/table-commands/exit-table.spec.ts +2 -2
- package/src/table/table-commands/insert-table.spec.ts +1 -1
- package/src/table/table-commands/move-table-column.spec.ts +2 -2
- package/src/table/table-commands/move-table-row.spec.ts +2 -2
- package/src/table/table-commands/select-table-cell.spec.ts +3 -3
- package/src/table/table-commands/select-table-cell.ts +1 -1
- package/src/table/table-commands/select-table-column.spec.ts +2 -2
- package/src/table/table-commands/select-table-column.ts +1 -1
- package/src/table/table-commands/select-table-row.spec.ts +2 -2
- package/src/table/table-commands/select-table-row.ts +1 -1
- package/src/table/table-commands/select-table.spec.ts +2 -2
- package/src/table/table-commands/select-table.ts +1 -1
- package/src/table/table-commands.ts +9 -9
- package/src/table/table-drop-indicator.ts +2 -2
- package/src/table/table-spec.spec.ts +4 -4
- package/src/table/table.ts +4 -4
- package/src/table/test-utils.ts +1 -1
- package/src/testing/index.ts +24 -24
- package/src/text-color/index.ts +3 -3
- package/src/text-color/text-color-commands.spec.ts +1 -1
- package/src/text-color/text-color-commands.ts +1 -1
- package/src/text-color/text-color-spec.spec.ts +1 -1
- package/src/text-color/text-color.ts +2 -2
- package/src/yjs/index.ts +7 -7
- package/src/yjs/yjs-cursor-plugin.ts +1 -1
- package/src/yjs/yjs-undo-plugin.ts +3 -2
- package/src/yjs/yjs.ts +9 -8
- package/dist/commit/style.css.map +0 -1
- package/dist/commit/style.js +0 -1
- package/dist/drop-indicator-DJq8pF92.js.map +0 -1
- package/dist/file-upload-I9m1EJAM.js.map +0 -1
- package/dist/file-upload-dr3IXUty.d.ts.map +0 -1
- package/dist/gap-cursor/style.css.map +0 -1
- package/dist/gap-cursor/style.js +0 -1
- package/dist/list/style.css.map +0 -1
- package/dist/list/style.js +0 -1
- package/dist/loro/style.css.map +0 -1
- package/dist/loro/style.js +0 -1
- package/dist/mark-paste-rule-n_2Ehmb5.js.map +0 -1
- package/dist/mark-rule-CUnXwBuy.js.map +0 -1
- package/dist/placeholder/style.css.map +0 -1
- package/dist/placeholder/style.js +0 -1
- package/dist/search/style.css.map +0 -1
- package/dist/search/style.js +0 -1
- package/dist/shiki-highlighter-chunk.d.ts +0 -19
- package/dist/shiki-highlighter-chunk.d.ts.map +0 -1
- package/dist/table/style.css.map +0 -1
- package/dist/table/style.js +0 -1
- package/dist/table-UJVYsrB7.js.map +0 -1
- package/dist/virtual-selection/style.css.map +0 -1
- package/dist/virtual-selection/style.js +0 -1
- package/dist/yjs/style.css.map +0 -1
- package/dist/yjs/style.js +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { Priority
|
|
1
|
+
import type { Priority } from '@prosekit/core'
|
|
2
|
+
import { union, withPriority, type Union } from '@prosekit/core'
|
|
2
3
|
|
|
3
|
-
import { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands'
|
|
4
|
-
import { defineParagraphKeymap } from './paragraph-keymap'
|
|
5
|
-
import { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec'
|
|
4
|
+
import { defineParagraphCommands, type ParagraphCommandsExtension } from './paragraph-commands.ts'
|
|
5
|
+
import { defineParagraphKeymap } from './paragraph-keymap.ts'
|
|
6
|
+
import { defineParagraphSpec, type ParagraphSpecExtension } from './paragraph-spec.ts'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* @internal
|
|
@@ -19,7 +20,7 @@ export type ParagraphExtension = Union<[ParagraphSpecExtension, ParagraphCommand
|
|
|
19
20
|
*/
|
|
20
21
|
export function defineParagraph(): ParagraphExtension {
|
|
21
22
|
return union(
|
|
22
|
-
withPriority(defineParagraphSpec(), Priority.highest),
|
|
23
|
+
withPriority(defineParagraphSpec(), 4 satisfies typeof Priority.highest),
|
|
23
24
|
defineParagraphCommands(),
|
|
24
25
|
defineParagraphKeymap(),
|
|
25
26
|
)
|
package/src/paste-rule/index.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineMarkPasteRule, type MarkPasteRuleOptions } from './mark-paste-rule'
|
|
2
|
-
export { definePasteRule, type PasteRuleHandler, type PasteRuleHandlerOptions, type PasteRuleOptions } from './paste-rule'
|
|
1
|
+
export { defineMarkPasteRule, type MarkPasteRuleOptions } from './mark-paste-rule.ts'
|
|
2
|
+
export { definePasteRule, type PasteRuleHandler, type PasteRuleHandlerOptions, type PasteRuleOptions } from './paste-rule.ts'
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { defineMarkSpec, union } from '@prosekit/core'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import { defineBold } from '../bold'
|
|
5
|
-
import { defineDoc } from '../doc'
|
|
6
|
-
import { defineParagraph } from '../paragraph'
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { defineText } from '../text'
|
|
4
|
+
import { defineBold } from '../bold/index.ts'
|
|
5
|
+
import { defineDoc } from '../doc/index.ts'
|
|
6
|
+
import { defineParagraph } from '../paragraph/index.ts'
|
|
7
|
+
import { pasteHTML, pasteText } from '../testing/clipboard.ts'
|
|
8
|
+
import { setupTestFromExtension } from '../testing/index.ts'
|
|
9
|
+
import { defineText } from '../text/index.ts'
|
|
10
10
|
|
|
11
|
-
import type { MarkPasteRuleOptions } from './mark-paste-rule'
|
|
12
|
-
import { defineMarkPasteRule } from './mark-paste-rule'
|
|
11
|
+
import type { MarkPasteRuleOptions } from './mark-paste-rule.ts'
|
|
12
|
+
import { defineMarkPasteRule } from './mark-paste-rule.ts'
|
|
13
13
|
|
|
14
14
|
function setup(options?: Partial<MarkPasteRuleOptions>) {
|
|
15
15
|
return setupTestFromExtension(union(
|
|
@@ -2,8 +2,8 @@ import { getMarkType, type PlainExtension } from '@prosekit/core'
|
|
|
2
2
|
import type { Attrs, MarkType, ProseMirrorNode } from '@prosekit/pm/model'
|
|
3
3
|
import { Fragment, Slice } from '@prosekit/pm/model'
|
|
4
4
|
|
|
5
|
-
import { definePasteRule } from './paste-rule'
|
|
6
|
-
import { splitTextByRegex } from './split-text-by-regex'
|
|
5
|
+
import { definePasteRule } from './paste-rule.ts'
|
|
6
|
+
import { splitTextByRegex } from './split-text-by-regex.ts'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* The options for {@link defineMarkPasteRule}.
|
|
@@ -3,9 +3,9 @@ import type { ProseMirrorNode } from '@prosekit/pm/model'
|
|
|
3
3
|
import { Fragment, Slice } from '@prosekit/pm/model'
|
|
4
4
|
import { describe, expect, it } from 'vitest'
|
|
5
5
|
|
|
6
|
-
import { defineTestExtension, setupTestFromExtension } from '../testing'
|
|
6
|
+
import { defineTestExtension, setupTestFromExtension } from '../testing/index.ts'
|
|
7
7
|
|
|
8
|
-
import { definePasteRule } from './paste-rule'
|
|
8
|
+
import { definePasteRule } from './paste-rule.ts'
|
|
9
9
|
|
|
10
10
|
function replaceTextInSlice(slice: Slice, from: string, to: string): Slice {
|
|
11
11
|
return new Slice(
|
|
@@ -2,7 +2,7 @@ import type { PlainExtension } from '@prosekit/core'
|
|
|
2
2
|
import type { Slice } from '@prosekit/pm/model'
|
|
3
3
|
import type { EditorView } from '@prosekit/pm/view'
|
|
4
4
|
|
|
5
|
-
import { definePasteRulePlugin } from './paste-rule-plugin'
|
|
5
|
+
import { definePasteRulePlugin } from './paste-rule-plugin.ts'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @public
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { splitTextByRegex } from './split-text-by-regex'
|
|
3
|
+
import { splitTextByRegex } from './split-text-by-regex.ts'
|
|
4
4
|
|
|
5
5
|
describe('splitTextByRegex', () => {
|
|
6
6
|
it('should return undefined when no matches are found', () => {
|
package/src/placeholder/index.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { ProseMirrorNode } from '@prosekit/pm/model'
|
|
|
3
3
|
import { Plugin, PluginKey, type EditorState } from '@prosekit/pm/state'
|
|
4
4
|
import { Decoration, DecorationSet } from '@prosekit/pm/view'
|
|
5
5
|
|
|
6
|
-
import { findTable } from '../table'
|
|
6
|
+
import { findTable } from '../table/index.ts'
|
|
7
7
|
|
|
8
8
|
export interface PlaceholderOptions {
|
|
9
9
|
/**
|
package/src/strike/index.ts
CHANGED
package/src/table/index.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export { defineTablePlugins } from './table-plugins'
|
|
1
|
+
export { defineTableCommands, type TableCommandsExtension } from './table-commands.ts'
|
|
2
|
+
export { exitTable } from './table-commands/exit-table.ts'
|
|
3
|
+
export { insertTable, type InsertTableOptions } from './table-commands/insert-table.ts'
|
|
4
|
+
export { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column.ts'
|
|
5
|
+
export { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row.ts'
|
|
6
|
+
export { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell.ts'
|
|
7
|
+
export { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column.ts'
|
|
8
|
+
export { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row.ts'
|
|
9
|
+
export { selectTable, type SelectTableOptions } from './table-commands/select-table.ts'
|
|
10
|
+
export { defineTableDropIndicator } from './table-drop-indicator.ts'
|
|
11
|
+
export { defineTablePlugins } from './table-plugins.ts'
|
|
13
12
|
export {
|
|
14
13
|
defineTableCellSpec,
|
|
15
14
|
defineTableHeaderCellSpec,
|
|
@@ -19,5 +18,6 @@ export {
|
|
|
19
18
|
type TableHeaderCellSpecExtension,
|
|
20
19
|
type TableRowSpecExtension,
|
|
21
20
|
type TableSpecExtension,
|
|
22
|
-
} from './table-spec'
|
|
23
|
-
export { findTable, isCellSelection } from './table-utils'
|
|
21
|
+
} from './table-spec.ts'
|
|
22
|
+
export { findTable, isCellSelection } from './table-utils.ts'
|
|
23
|
+
export { defineTable, type TableExtension } from './table.ts'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { isCellSelection } from '../table-utils'
|
|
5
|
-
import { setCellSelection } from '../test-utils'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { isCellSelection } from '../table-utils.ts'
|
|
5
|
+
import { setCellSelection } from '../test-utils.ts'
|
|
6
6
|
|
|
7
7
|
describe('deleteCellSelection', () => {
|
|
8
8
|
it('can clear the content in the selected table cells', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { inputText } from '../../testing/keyboard'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { inputText } from '../../testing/keyboard.ts'
|
|
5
5
|
|
|
6
6
|
describe('exitTable', () => {
|
|
7
7
|
it('can exist a table', async () => {
|
|
@@ -2,9 +2,9 @@ import type { Command } from '@prosekit/pm/state'
|
|
|
2
2
|
import { CellSelection } from 'prosemirror-tables'
|
|
3
3
|
import { describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
|
-
import { setupTest } from '../../testing'
|
|
5
|
+
import { setupTest } from '../../testing/index.ts'
|
|
6
6
|
|
|
7
|
-
import { moveTableColumn } from './move-table-column'
|
|
7
|
+
import { moveTableColumn } from './move-table-column.ts'
|
|
8
8
|
|
|
9
9
|
function setup() {
|
|
10
10
|
const { editor, n } = setupTest()
|
|
@@ -2,9 +2,9 @@ import type { Command } from '@prosekit/pm/state'
|
|
|
2
2
|
import { CellSelection } from 'prosemirror-tables'
|
|
3
3
|
import { describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
|
-
import { setupTest } from '../../testing'
|
|
5
|
+
import { setupTest } from '../../testing/index.ts'
|
|
6
6
|
|
|
7
|
-
import { moveTableRow } from './move-table-row'
|
|
7
|
+
import { moveTableRow } from './move-table-row.ts'
|
|
8
8
|
|
|
9
9
|
function setup() {
|
|
10
10
|
const { editor, n } = setupTest()
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { isCellSelection } from '../table-utils'
|
|
5
|
-
import { inspectSelectedCells } from '../test-utils'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { isCellSelection } from '../table-utils.ts'
|
|
5
|
+
import { inspectSelectedCells } from '../test-utils.ts'
|
|
6
6
|
|
|
7
7
|
describe('selectTableCell', () => {
|
|
8
8
|
it('can select a table cell', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { inspectSelectedCells } from '../test-utils'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { inspectSelectedCells } from '../test-utils.ts'
|
|
5
5
|
|
|
6
6
|
describe('selectTableColumn', () => {
|
|
7
7
|
it('can select the whole table column', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { inspectSelectedCells } from '../test-utils'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { inspectSelectedCells } from '../test-utils.ts'
|
|
5
5
|
|
|
6
6
|
describe('selectTableRow', () => {
|
|
7
7
|
it('can select the whole table row', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { describe, expect, it } from 'vitest'
|
|
2
2
|
|
|
3
|
-
import { setupTest } from '../../testing'
|
|
4
|
-
import { inspectSelectedCells } from '../test-utils'
|
|
3
|
+
import { setupTest } from '../../testing/index.ts'
|
|
4
|
+
import { inspectSelectedCells } from '../test-utils.ts'
|
|
5
5
|
|
|
6
6
|
describe('selectTable', () => {
|
|
7
7
|
it('can select the whole table', () => {
|
|
@@ -11,15 +11,15 @@ import {
|
|
|
11
11
|
splitCell,
|
|
12
12
|
} from 'prosemirror-tables'
|
|
13
13
|
|
|
14
|
-
import { deleteCellSelection } from './table-commands/delete-cell-selection'
|
|
15
|
-
import { exitTable } from './table-commands/exit-table'
|
|
16
|
-
import { insertTable, type InsertTableOptions } from './table-commands/insert-table'
|
|
17
|
-
import { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column'
|
|
18
|
-
import { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row'
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
14
|
+
import { deleteCellSelection } from './table-commands/delete-cell-selection.ts'
|
|
15
|
+
import { exitTable } from './table-commands/exit-table.ts'
|
|
16
|
+
import { insertTable, type InsertTableOptions } from './table-commands/insert-table.ts'
|
|
17
|
+
import { moveTableColumn, type MoveTableColumnOptions } from './table-commands/move-table-column.ts'
|
|
18
|
+
import { moveTableRow, type MoveTableRowOptions } from './table-commands/move-table-row.ts'
|
|
19
|
+
import { selectTableCell, type SelectTableCellOptions } from './table-commands/select-table-cell.ts'
|
|
20
|
+
import { selectTableColumn, type SelectTableColumnOptions } from './table-commands/select-table-column.ts'
|
|
21
|
+
import { selectTableRow, type SelectTableRowOptions } from './table-commands/select-table-row.ts'
|
|
22
|
+
import { selectTable, type SelectTableOptions } from './table-commands/select-table.ts'
|
|
23
23
|
|
|
24
24
|
/**
|
|
25
25
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PlainExtension } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import type { DragEventHandler } from '../drop-indicator'
|
|
4
|
-
import { defineDropIndicator } from '../drop-indicator'
|
|
3
|
+
import type { DragEventHandler } from '../drop-indicator/index.ts'
|
|
4
|
+
import { defineDropIndicator } from '../drop-indicator/index.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Hides the drop indicator when dragging a table column or row by using the
|
|
@@ -2,11 +2,11 @@ import { union } from '@prosekit/core'
|
|
|
2
2
|
import pick from 'just-pick'
|
|
3
3
|
import { describe, expect, it } from 'vitest'
|
|
4
4
|
|
|
5
|
-
import { defineDoc } from '../doc'
|
|
6
|
-
import { defineParagraph } from '../paragraph'
|
|
7
|
-
import { defineText } from '../text'
|
|
5
|
+
import { defineDoc } from '../doc/index.ts'
|
|
6
|
+
import { defineParagraph } from '../paragraph/index.ts'
|
|
7
|
+
import { defineText } from '../text/index.ts'
|
|
8
8
|
|
|
9
|
-
import { defineTableCellSpec, defineTableHeaderCellSpec, defineTableRowSpec, defineTableSpec } from './table-spec'
|
|
9
|
+
import { defineTableCellSpec, defineTableHeaderCellSpec, defineTableRowSpec, defineTableSpec } from './table-spec.ts'
|
|
10
10
|
|
|
11
11
|
describe('table spec', () => {
|
|
12
12
|
it('should be defined', () => {
|
package/src/table/table.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineTableCommands, type TableCommandsExtension } from './table-commands'
|
|
4
|
-
import { defineTableDropIndicator } from './table-drop-indicator'
|
|
5
|
-
import { defineTablePlugins } from './table-plugins'
|
|
3
|
+
import { defineTableCommands, type TableCommandsExtension } from './table-commands.ts'
|
|
4
|
+
import { defineTableDropIndicator } from './table-drop-indicator.ts'
|
|
5
|
+
import { defineTablePlugins } from './table-plugins.ts'
|
|
6
6
|
import {
|
|
7
7
|
defineTableCellSpec,
|
|
8
8
|
defineTableHeaderCellSpec,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
type TableHeaderCellSpecExtension,
|
|
13
13
|
type TableRowSpecExtension,
|
|
14
14
|
type TableSpecExtension,
|
|
15
|
-
} from './table-spec'
|
|
15
|
+
} from './table-spec.ts'
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* @internal
|
package/src/table/test-utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Command, Selection } from '@prosekit/pm/state'
|
|
2
2
|
import { CellSelection } from 'prosemirror-tables'
|
|
3
3
|
|
|
4
|
-
import { isCellSelection } from './table-utils'
|
|
4
|
+
import { isCellSelection } from './table-utils.ts'
|
|
5
5
|
|
|
6
6
|
// Helper to create a cell selection between two positions
|
|
7
7
|
export function setCellSelection(from: number, to: number): Command {
|
package/src/testing/index.ts
CHANGED
|
@@ -13,30 +13,30 @@ import {
|
|
|
13
13
|
import { createTestEditor, type TestEditor } from '@prosekit/core/test'
|
|
14
14
|
import { keyboard } from 'vitest-browser-commands/playwright'
|
|
15
15
|
|
|
16
|
-
import { defineBackgroundColor } from '../background-color'
|
|
17
|
-
import { defineBlockquote } from '../blockquote'
|
|
18
|
-
import { defineBold } from '../bold'
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { defineDoc } from '../doc'
|
|
22
|
-
import { defineHardBreak } from '../hard-break'
|
|
23
|
-
import { defineHeading } from '../heading'
|
|
24
|
-
import { defineHorizontalRule } from '../horizontal-rule'
|
|
25
|
-
import { defineImage } from '../image'
|
|
26
|
-
import { defineItalic } from '../italic'
|
|
27
|
-
import { defineLink } from '../link'
|
|
28
|
-
import { defineList, type ListAttrs } from '../list'
|
|
29
|
-
import { defineMath } from '../math'
|
|
30
|
-
import { defineParagraph } from '../paragraph'
|
|
31
|
-
import { defineStrike } from '../strike'
|
|
32
|
-
import { defineTable } from '../table'
|
|
33
|
-
import type { CellAttrs } from '../table/table-spec'
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import { defineUnderline } from '../underline'
|
|
37
|
-
|
|
38
|
-
import { readHtmlTextFromClipboard, readPlainTextFromClipboard } from './clipboard'
|
|
39
|
-
import { renderMathBlock, renderMathInline } from './katex'
|
|
16
|
+
import { defineBackgroundColor } from '../background-color/index.ts'
|
|
17
|
+
import { defineBlockquote } from '../blockquote/index.ts'
|
|
18
|
+
import { defineBold } from '../bold/index.ts'
|
|
19
|
+
import { defineCodeBlock } from '../code-block/index.ts'
|
|
20
|
+
import { defineCode } from '../code/index.ts'
|
|
21
|
+
import { defineDoc } from '../doc/index.ts'
|
|
22
|
+
import { defineHardBreak } from '../hard-break/index.ts'
|
|
23
|
+
import { defineHeading } from '../heading/index.ts'
|
|
24
|
+
import { defineHorizontalRule } from '../horizontal-rule/index.ts'
|
|
25
|
+
import { defineImage } from '../image/index.ts'
|
|
26
|
+
import { defineItalic } from '../italic/index.ts'
|
|
27
|
+
import { defineLink } from '../link/index.ts'
|
|
28
|
+
import { defineList, type ListAttrs } from '../list/index.ts'
|
|
29
|
+
import { defineMath } from '../math/index.ts'
|
|
30
|
+
import { defineParagraph } from '../paragraph/index.ts'
|
|
31
|
+
import { defineStrike } from '../strike/index.ts'
|
|
32
|
+
import { defineTable } from '../table/index.ts'
|
|
33
|
+
import type { CellAttrs } from '../table/table-spec.ts'
|
|
34
|
+
import { defineTextColor } from '../text-color/index.ts'
|
|
35
|
+
import { defineText } from '../text/index.ts'
|
|
36
|
+
import { defineUnderline } from '../underline/index.ts'
|
|
37
|
+
|
|
38
|
+
import { readHtmlTextFromClipboard, readPlainTextFromClipboard } from './clipboard.ts'
|
|
39
|
+
import { renderMathBlock, renderMathInline } from './katex.ts'
|
|
40
40
|
|
|
41
41
|
/**
|
|
42
42
|
* @internal
|
package/src/text-color/index.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
1
|
+
export { addTextColor, defineTextColorCommands, removeTextColor, type TextColorCommandsExtension } from './text-color-commands.ts'
|
|
2
|
+
export { defineTextColorSpec, type TextColorAttrs, type TextColorSpecExtension } from './text-color-spec.ts'
|
|
3
|
+
export { defineTextColor, type TextColorExtension } from './text-color.ts'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { addMark, defineCommands, removeMark, type Extension } from '@prosekit/core'
|
|
2
2
|
import type { Command } from '@prosekit/pm/state'
|
|
3
3
|
|
|
4
|
-
import type { TextColorAttrs } from './text-color-spec'
|
|
4
|
+
import type { TextColorAttrs } from './text-color-spec.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { formatHTML } from 'diffable-html-snapshot'
|
|
2
2
|
import { describe, expect, it } from 'vitest'
|
|
3
3
|
|
|
4
|
-
import { setupTest } from '../testing'
|
|
4
|
+
import { setupTest } from '../testing/index.ts'
|
|
5
5
|
|
|
6
6
|
describe('defineTextColorSpec', () => {
|
|
7
7
|
it('should render color as inline span with style attribute', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { union, type Union } from '@prosekit/core'
|
|
2
2
|
|
|
3
|
-
import { defineTextColorCommands, type TextColorCommandsExtension } from './text-color-commands'
|
|
4
|
-
import { defineTextColorSpec, type TextColorSpecExtension } from './text-color-spec'
|
|
3
|
+
import { defineTextColorCommands, type TextColorCommandsExtension } from './text-color-commands.ts'
|
|
4
|
+
import { defineTextColorSpec, type TextColorSpecExtension } from './text-color-spec.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @internal
|
package/src/yjs/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export
|
|
6
|
-
export type
|
|
7
|
-
export {
|
|
1
|
+
export { defineYjsCommands } from './yjs-commands.ts'
|
|
2
|
+
export { defineYjsCursorPlugin, type YjsCursorOptions, type YjsCursorPluginOptions } from './yjs-cursor-plugin.ts'
|
|
3
|
+
export { defineYjsKeymap } from './yjs-keymap.ts'
|
|
4
|
+
export { defineYjsSyncPlugin, type YjsSyncOptions, type YjsSyncPluginOptions } from './yjs-sync-plugin.ts'
|
|
5
|
+
export type { Awareness } from './yjs-types.ts'
|
|
6
|
+
export { defineYjsUndoPlugin, type YjsUndoOptions, type YjsUndoPluginOptions } from './yjs-undo-plugin.ts'
|
|
7
|
+
export { defineYjs, type YjsExtension, type YjsOptions } from './yjs.ts'
|
|
@@ -2,7 +2,7 @@ import { definePlugin, type PlainExtension } from '@prosekit/core'
|
|
|
2
2
|
import type { Plugin } from '@prosekit/pm/state'
|
|
3
3
|
import { yCursorPlugin } from 'y-prosemirror'
|
|
4
4
|
|
|
5
|
-
import type { Awareness } from './yjs-types'
|
|
5
|
+
import type { Awareness } from './yjs-types.ts'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Options for `y-prosemirror`'s `yCursorPlugin`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePlugin, type PlainExtension } from '@prosekit/core'
|
|
2
2
|
import type { ProseMirrorPlugin } from '@prosekit/pm/state'
|
|
3
3
|
import type { EditorView } from '@prosekit/pm/view'
|
|
4
|
-
import { yUndoPlugin as originalYUndoPlugin, yUndoPluginKey } from 'y-prosemirror'
|
|
4
|
+
import { yUndoPlugin as originalYUndoPlugin, yUndoPluginKey, type UndoPluginState } from 'y-prosemirror'
|
|
5
5
|
import type { UndoManager as YjsUndoManager } from 'yjs'
|
|
6
6
|
|
|
7
7
|
type UndoManager = YjsUndoManager & { restore: () => void }
|
|
@@ -12,7 +12,8 @@ type UndoManager = YjsUndoManager & { restore: () => void }
|
|
|
12
12
|
function fixYUndoPlugin(yUndoPluginInstance: ProseMirrorPlugin) {
|
|
13
13
|
const originalUndoPluginView = yUndoPluginInstance.spec.view
|
|
14
14
|
yUndoPluginInstance.spec.view = (view: EditorView) => {
|
|
15
|
-
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment -- The type definition in y-prosemirror is not correct. An explicit file extension should be added to this line: https://npmx.dev/package-code/y-prosemirror/v/1.3.7/dist%2Fsrc%2Fplugins%2Fkeys.d.ts#L13
|
|
16
|
+
const pluginState: UndoPluginState | undefined = yUndoPluginKey.getState(view.state)
|
|
16
17
|
if (!pluginState) {
|
|
17
18
|
return {}
|
|
18
19
|
}
|
package/src/yjs/yjs.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { Priority
|
|
1
|
+
import type { Priority } from '@prosekit/core'
|
|
2
|
+
import { union, withPriority, type PlainExtension, type Union } from '@prosekit/core'
|
|
2
3
|
import type * as Y from 'yjs'
|
|
3
4
|
|
|
4
|
-
import { defineYjsCommands, type YjsCommandsExtension } from './yjs-commands'
|
|
5
|
-
import { defineYjsCursorPlugin, type YjsCursorPluginOptions } from './yjs-cursor-plugin'
|
|
6
|
-
import { defineYjsKeymap } from './yjs-keymap'
|
|
7
|
-
import { defineYjsSyncPlugin, type YjsSyncPluginOptions } from './yjs-sync-plugin'
|
|
8
|
-
import type { Awareness } from './yjs-types'
|
|
9
|
-
import { defineYjsUndoPlugin, type YjsUndoPluginOptions } from './yjs-undo-plugin'
|
|
5
|
+
import { defineYjsCommands, type YjsCommandsExtension } from './yjs-commands.ts'
|
|
6
|
+
import { defineYjsCursorPlugin, type YjsCursorPluginOptions } from './yjs-cursor-plugin.ts'
|
|
7
|
+
import { defineYjsKeymap } from './yjs-keymap.ts'
|
|
8
|
+
import { defineYjsSyncPlugin, type YjsSyncPluginOptions } from './yjs-sync-plugin.ts'
|
|
9
|
+
import type { Awareness } from './yjs-types.ts'
|
|
10
|
+
import { defineYjsUndoPlugin, type YjsUndoPluginOptions } from './yjs-undo-plugin.ts'
|
|
10
11
|
|
|
11
12
|
export interface YjsOptions {
|
|
12
13
|
/**
|
|
@@ -61,6 +62,6 @@ export function defineYjs(options: YjsOptions): YjsExtension {
|
|
|
61
62
|
defineYjsUndoPlugin({ ...undo }),
|
|
62
63
|
defineYjsSyncPlugin({ ...sync, fragment }),
|
|
63
64
|
]),
|
|
64
|
-
Priority.high,
|
|
65
|
+
3 satisfies typeof Priority.high,
|
|
65
66
|
)
|
|
66
67
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"style.css","names":[],"sources":["../../src/commit/style.css"],"sourcesContent":[".prosekit-commit-deletion {\n background-color: #e5534b80;\n text-decoration: line-through;\n}\n.prosekit-commit-addition {\n background-color: #53e54b80;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA"}
|
package/dist/commit/style.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drop-indicator-DJq8pF92.js","names":[],"sources":["../src/drop-indicator/drop-indicator-facet.ts","../src/drop-indicator/drop-indicator.ts"],"sourcesContent":["import { isNotNullish } from '@ocavue/utils'\nimport { defineFacet, defineFacetPayload, pluginFacet, type PlainExtension, type PluginPayload } from '@prosekit/core'\nimport type { DragEventHandler, DropIndicatorPluginOptions, ShowHandler } from 'prosemirror-drop-indicator'\nimport { createDropIndicatorPlugin } from 'prosemirror-drop-indicator'\n\n/**\n * @internal\n */\nexport function defineDropIndicatorPayload(\n payload: DropIndicatorPluginOptions,\n): PlainExtension {\n return defineFacetPayload(dropIndicatorFacet, [payload]) as PlainExtension\n}\n\nconst dropIndicatorFacet = defineFacet<DropIndicatorPluginOptions, PluginPayload>({\n parent: pluginFacet,\n singleton: true,\n reducer: (payloads: DropIndicatorPluginOptions[]): PluginPayload => {\n const showHandlers = payloads.map(p => p.onShow).filter(isNotNullish)\n const hideHandlers = payloads.map(p => p.onHide).filter(isNotNullish)\n const dragHandlers = payloads.map(p => p.onDrag).filter(isNotNullish)\n\n const showHandler: ShowHandler = (options) => {\n for (const fn of showHandlers) {\n fn(options)\n }\n }\n\n const hideHandler: VoidFunction = () => {\n for (const fn of hideHandlers) {\n fn()\n }\n }\n\n const dragHandler: DragEventHandler = (options): boolean => {\n for (const fn of dragHandlers) {\n if (fn(options) === false) return false\n }\n return true\n }\n\n if (showHandlers.length === 0) {\n // No `onShow` event handler, so we don't need to create a plugin.\n return []\n }\n\n return createDropIndicatorPlugin({\n onDrag: dragHandler,\n onShow: showHandler,\n onHide: hideHandler,\n })\n },\n})\n","import type { PlainExtension } from '@prosekit/core'\nimport type { DropIndicatorPluginOptions } from 'prosemirror-drop-indicator'\n\nimport { defineDropIndicatorPayload } from './drop-indicator-facet'\n\n/**\n * @internal\n */\nexport type DropIndicatorExtension = PlainExtension\n\n/**\n * Defines an extension that controls the behavior of the drop indicator.\n *\n * This extension itself doesn't draw the drop indicator, but it provides the\n * necessary callbacks to do so. You probably don't want to use this extension\n * directly, but rather use the `<DropIndicator>` component.\n *\n * You can add this extension multiple times. If any extension has `onDrag`\n * callback defined, and it returns `false`, then the drop point will be\n * discarded.\n *\n * @public\n */\nexport function defineDropIndicator(\n options?: DropIndicatorOptions,\n): DropIndicatorExtension {\n return defineDropIndicatorPayload(options ?? {})\n}\n\n/**\n * Options for {@link defineDropIndicator}.\n *\n * @public\n */\nexport interface DropIndicatorOptions extends DropIndicatorPluginOptions {}\n"],"mappings":";;;;;;;;AAQA,SAAgB,2BACd,SACgB;AAChB,QAAO,mBAAmB,oBAAoB,CAAC,QAAQ,CAAC;;AAG1D,MAAM,qBAAqB,YAAuD;CAChF,QAAQ;CACR,WAAW;CACX,UAAU,aAA0D;EAClE,MAAM,eAAe,SAAS,KAAI,MAAK,EAAE,OAAO,CAAC,OAAO,aAAa;EACrE,MAAM,eAAe,SAAS,KAAI,MAAK,EAAE,OAAO,CAAC,OAAO,aAAa;EACrE,MAAM,eAAe,SAAS,KAAI,MAAK,EAAE,OAAO,CAAC,OAAO,aAAa;EAErE,MAAM,eAA4B,YAAY;AAC5C,QAAK,MAAM,MAAM,aACf,IAAG,QAAQ;;EAIf,MAAM,oBAAkC;AACtC,QAAK,MAAM,MAAM,aACf,KAAI;;EAIR,MAAM,eAAiC,YAAqB;AAC1D,QAAK,MAAM,MAAM,aACf,KAAI,GAAG,QAAQ,KAAK,MAAO,QAAO;AAEpC,UAAO;;AAGT,MAAI,aAAa,WAAW,EAE1B,QAAO,EAAE;AAGX,SAAO,0BAA0B;GAC/B,QAAQ;GACR,QAAQ;GACR,QAAQ;GACT,CAAC;;CAEL,CAAC;;;;;;;;;;;;;;;;;AC7BF,SAAgB,oBACd,SACwB;AACxB,QAAO,2BAA2B,WAAW,EAAE,CAAC"}
|