@prosekit/extensions 0.7.24 → 0.9.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.
Files changed (100) hide show
  1. package/dist/commit/style.css +2 -1
  2. package/dist/commit/style.js +0 -0
  3. package/dist/enter-rule-RdhEA900.js +96 -0
  4. package/dist/gap-cursor/style.css +8 -5
  5. package/dist/gap-cursor/style.js +0 -0
  6. package/dist/input-rule-Gji4N7Oe.js +93 -0
  7. package/dist/list/style.css +7 -7
  8. package/dist/list/style.js +0 -0
  9. package/dist/loro/style.css +21 -17
  10. package/dist/loro/style.js +0 -0
  11. package/dist/mark-rule-wEOcDt6i.js +160 -0
  12. package/dist/placeholder/style.css +5 -5
  13. package/dist/placeholder/style.js +0 -0
  14. package/dist/prosekit-extensions-autocomplete.d.ts +33 -3
  15. package/dist/prosekit-extensions-autocomplete.js +122 -174
  16. package/dist/prosekit-extensions-blockquote.d.ts +51 -8
  17. package/dist/prosekit-extensions-blockquote.js +64 -78
  18. package/dist/prosekit-extensions-bold.d.ts +61 -8
  19. package/dist/prosekit-extensions-bold.js +61 -73
  20. package/dist/prosekit-extensions-code-block.d.ts +172 -20
  21. package/dist/prosekit-extensions-code-block.js +201 -184
  22. package/dist/prosekit-extensions-code.d.ts +61 -8
  23. package/dist/prosekit-extensions-code.js +44 -55
  24. package/dist/prosekit-extensions-commit.d.ts +53 -4
  25. package/dist/prosekit-extensions-commit.js +142 -183
  26. package/dist/prosekit-extensions-doc.d.ts +22 -0
  27. package/dist/prosekit-extensions-doc.js +16 -0
  28. package/dist/prosekit-extensions-drop-cursor.d.ts +34 -3
  29. package/dist/prosekit-extensions-drop-cursor.js +14 -8
  30. package/dist/prosekit-extensions-enter-rule.d.ts +106 -5
  31. package/dist/prosekit-extensions-enter-rule.js +3 -8
  32. package/dist/prosekit-extensions-file.d.ts +126 -8
  33. package/dist/prosekit-extensions-file.js +111 -132
  34. package/dist/prosekit-extensions-gap-cursor.d.ts +29 -2
  35. package/dist/prosekit-extensions-gap-cursor.js +21 -9
  36. package/dist/prosekit-extensions-hard-break.d.ts +58 -0
  37. package/dist/prosekit-extensions-hard-break.js +58 -0
  38. package/dist/prosekit-extensions-heading.d.ts +69 -9
  39. package/dist/prosekit-extensions-heading.js +121 -95
  40. package/dist/prosekit-extensions-horizontal-rule.d.ts +41 -8
  41. package/dist/prosekit-extensions-horizontal-rule.js +53 -71
  42. package/dist/prosekit-extensions-image.d.ts +53 -7
  43. package/dist/prosekit-extensions-image.js +71 -62
  44. package/dist/prosekit-extensions-input-rule.d.ts +134 -6
  45. package/dist/prosekit-extensions-input-rule.js +3 -14
  46. package/dist/prosekit-extensions-italic.d.ts +61 -8
  47. package/dist/prosekit-extensions-italic.js +51 -63
  48. package/dist/prosekit-extensions-link.d.ts +65 -10
  49. package/dist/prosekit-extensions-link.js +95 -100
  50. package/dist/prosekit-extensions-list.d.ts +114 -17
  51. package/dist/prosekit-extensions-list.js +115 -158
  52. package/dist/prosekit-extensions-loro.d.ts +78 -11
  53. package/dist/prosekit-extensions-loro.js +49 -77
  54. package/dist/prosekit-extensions-mark-rule.d.ts +41 -2
  55. package/dist/prosekit-extensions-mark-rule.js +3 -6
  56. package/dist/prosekit-extensions-mention.d.ts +40 -4
  57. package/dist/prosekit-extensions-mention.js +52 -50
  58. package/dist/prosekit-extensions-mod-click-prevention.d.ts +20 -2
  59. package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
  60. package/dist/prosekit-extensions-paragraph.d.ts +65 -0
  61. package/dist/prosekit-extensions-paragraph.js +60 -0
  62. package/dist/prosekit-extensions-placeholder.d.ts +32 -2
  63. package/dist/prosekit-extensions-placeholder.js +39 -56
  64. package/dist/prosekit-extensions-readonly.d.ts +13 -1
  65. package/dist/prosekit-extensions-readonly.js +13 -14
  66. package/dist/prosekit-extensions-search.d.ts +77 -3
  67. package/dist/prosekit-extensions-search.js +48 -47
  68. package/dist/prosekit-extensions-strike.d.ts +50 -8
  69. package/dist/prosekit-extensions-strike.js +44 -49
  70. package/dist/prosekit-extensions-table.d.ts +237 -26
  71. package/dist/prosekit-extensions-table.js +3 -34
  72. package/dist/prosekit-extensions-text-align.d.ts +72 -8
  73. package/dist/prosekit-extensions-text-align.js +63 -44
  74. package/dist/prosekit-extensions-text.d.ts +22 -0
  75. package/dist/prosekit-extensions-text.js +15 -0
  76. package/dist/prosekit-extensions-underline.d.ts +46 -7
  77. package/dist/prosekit-extensions-underline.js +33 -37
  78. package/dist/prosekit-extensions-virtual-selection.d.ts +24 -2
  79. package/dist/prosekit-extensions-virtual-selection.js +49 -52
  80. package/dist/prosekit-extensions-yjs.d.ts +99 -14
  81. package/dist/prosekit-extensions-yjs.js +88 -131
  82. package/dist/prosekit-extensions.d.ts +1 -1
  83. package/dist/search/style.css +5 -5
  84. package/dist/search/style.js +0 -0
  85. package/dist/shiki-highlighter-chunk-Cd3WeOKL.d.ts +19 -0
  86. package/dist/shiki-highlighter-chunk.d.ts +2 -0
  87. package/dist/shiki-highlighter-chunk.js +34 -43
  88. package/dist/table/style.css +18 -17
  89. package/dist/table/style.js +0 -0
  90. package/dist/table-DnVliJ6E.js +287 -0
  91. package/dist/virtual-selection/style.css +2 -2
  92. package/dist/virtual-selection/style.js +0 -0
  93. package/dist/yjs/style.css +15 -17
  94. package/dist/yjs/style.js +0 -0
  95. package/package.json +103 -52
  96. package/dist/_tsup-dts-rollup.d.ts +0 -2500
  97. package/dist/chunk-6UYLCVBX.js +0 -185
  98. package/dist/chunk-BV3SHIMW.js +0 -98
  99. package/dist/chunk-D54VSLLS.js +0 -105
  100. package/dist/chunk-HFAZX2J3.js +0 -306
@@ -1,55 +1,74 @@
1
- // src/text-align/index.ts
2
- import {
3
- defineCommands,
4
- defineKeymap,
5
- defineNodeAttr,
6
- setNodeAttrs,
7
- union
8
- } from "@prosekit/core";
1
+ import { defineCommands, defineKeymap, defineNodeAttr, setNodeAttrs, union } from "@prosekit/core";
2
+
3
+ //#region src/text-align/index.ts
9
4
  function defineTextAlignAttr(type, defaultValue) {
10
- return defineNodeAttr({
11
- type,
12
- attr: "textAlign",
13
- default: defaultValue,
14
- splittable: true,
15
- toDOM: (value) => value ? ["style", `text-align:${value};`] : null,
16
- parseDOM: (node) => {
17
- return node.style.getPropertyValue("text-align") || null;
18
- }
19
- });
5
+ return defineNodeAttr({
6
+ type,
7
+ attr: "textAlign",
8
+ default: defaultValue,
9
+ splittable: true,
10
+ toDOM: (value) => value ? ["style", `text-align:${value};`] : null,
11
+ parseDOM: (node) => {
12
+ return node.style.getPropertyValue("text-align") || null;
13
+ }
14
+ });
20
15
  }
16
+ /**
17
+ * @internal
18
+ */
21
19
  function defineTextAlignAttrs(types, defaultValue) {
22
- return union(types.map((type) => defineTextAlignAttr(type, defaultValue)));
20
+ return union(types.map((type) => defineTextAlignAttr(type, defaultValue)));
23
21
  }
24
- function setTextAlign({
25
- types,
26
- value
27
- }) {
28
- return setNodeAttrs({ type: types, attrs: { textAlign: value } });
22
+ /**
23
+ * @internal
24
+ */
25
+ function setTextAlign({ types, value }) {
26
+ return setNodeAttrs({
27
+ type: types,
28
+ attrs: { textAlign: value }
29
+ });
29
30
  }
31
+ /**
32
+ * @internal
33
+ */
30
34
  function defineTextAlignCommands(types) {
31
- return defineCommands({
32
- setTextAlign: (value) => setTextAlign({ types, value })
33
- });
35
+ return defineCommands({ setTextAlign: (value) => setTextAlign({
36
+ types,
37
+ value
38
+ }) });
34
39
  }
40
+ /**
41
+ * @internal
42
+ */
35
43
  function defineTextAlignKeymap(types) {
36
- return defineKeymap({
37
- "mod-shift-l": setTextAlign({ types, value: "left" }),
38
- "mod-shift-e": setTextAlign({ types, value: "center" }),
39
- "mod-shift-r": setTextAlign({ types, value: "right" }),
40
- "mod-shift-j": setTextAlign({ types, value: "justify" })
41
- });
44
+ return defineKeymap({
45
+ "mod-shift-l": setTextAlign({
46
+ types,
47
+ value: "left"
48
+ }),
49
+ "mod-shift-e": setTextAlign({
50
+ types,
51
+ value: "center"
52
+ }),
53
+ "mod-shift-r": setTextAlign({
54
+ types,
55
+ value: "right"
56
+ }),
57
+ "mod-shift-j": setTextAlign({
58
+ types,
59
+ value: "justify"
60
+ })
61
+ });
42
62
  }
63
+ /**
64
+ * Adds a `textAlign` attribute to the specified nodes. This will be rendered as
65
+ * a CSS `text-align` style.
66
+ *
67
+ * @public
68
+ */
43
69
  function defineTextAlign(options) {
44
- return union(
45
- defineTextAlignAttrs(options.types, options.default || "left"),
46
- defineTextAlignKeymap(options.types),
47
- defineTextAlignCommands(options.types)
48
- );
70
+ return union(defineTextAlignAttrs(options.types, options.default || "left"), defineTextAlignKeymap(options.types), defineTextAlignCommands(options.types));
49
71
  }
50
- export {
51
- defineTextAlign,
52
- defineTextAlignCommands,
53
- defineTextAlignKeymap,
54
- setTextAlign
55
- };
72
+
73
+ //#endregion
74
+ export { defineTextAlign, defineTextAlignCommands, defineTextAlignKeymap, setTextAlign };
@@ -0,0 +1,22 @@
1
+ import { Extension } from "@prosekit/core";
2
+ import { Attrs } from "@prosekit/pm/model";
3
+
4
+ //#region src/text/index.d.ts
5
+ /**
6
+ * @internal
7
+ */
8
+ /**
9
+ * @internal
10
+ */
11
+ type TextExtension = Extension<{
12
+ Nodes: {
13
+ text: Attrs;
14
+ };
15
+ }>;
16
+ /**
17
+ * @public
18
+ */
19
+ declare function defineText(): TextExtension;
20
+
21
+ //#endregion
22
+ export { TextExtension, defineText };
@@ -0,0 +1,15 @@
1
+ import { defineNodeSpec } from "@prosekit/core";
2
+
3
+ //#region src/text/index.ts
4
+ /**
5
+ * @public
6
+ */
7
+ function defineText() {
8
+ return defineNodeSpec({
9
+ name: "text",
10
+ group: "inline"
11
+ });
12
+ }
13
+
14
+ //#endregion
15
+ export { defineText };
@@ -1,7 +1,46 @@
1
- export { defineUnderlineSpec } from './_tsup-dts-rollup.js';
2
- export { defineUnderlineCommands } from './_tsup-dts-rollup.js';
3
- export { defineUnderlineKeymap } from './_tsup-dts-rollup.js';
4
- export { defineUnderline } from './_tsup-dts-rollup.js';
5
- export { UnderlineSpecExtension } from './_tsup-dts-rollup.js';
6
- export { UnderlineCommandsExtension } from './_tsup-dts-rollup.js';
7
- export { UnderlineExtension } from './_tsup-dts-rollup.js';
1
+ import { Extension, PlainExtension, Union } from "@prosekit/core";
2
+ import { Attrs } from "@prosekit/pm/model";
3
+
4
+ //#region src/underline/index.d.ts
5
+ /**
6
+ * @internal
7
+ */
8
+ /**
9
+ * @internal
10
+ */
11
+ type UnderlineSpecExtension = Extension<{
12
+ Marks: {
13
+ underline: Attrs;
14
+ };
15
+ }>;
16
+ /**
17
+ * @internal
18
+ */
19
+ declare function defineUnderlineSpec(): UnderlineSpecExtension;
20
+ /**
21
+ * @internal
22
+ */
23
+ type UnderlineCommandsExtension = Extension<{
24
+ Commands: {
25
+ toggleUnderline: [];
26
+ };
27
+ }>;
28
+ /**
29
+ * @internal
30
+ */
31
+ declare function defineUnderlineCommands(): UnderlineCommandsExtension;
32
+ /**
33
+ * @internal
34
+ */
35
+ declare function defineUnderlineKeymap(): PlainExtension;
36
+ /**
37
+ * @internal
38
+ */
39
+ type UnderlineExtension = Union<[UnderlineSpecExtension, UnderlineCommandsExtension]>;
40
+ /**
41
+ * @public
42
+ */
43
+ declare function defineUnderline(): UnderlineExtension;
44
+
45
+ //#endregion
46
+ export { UnderlineCommandsExtension, UnderlineExtension, UnderlineSpecExtension, defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
@@ -1,45 +1,41 @@
1
- // src/underline/index.ts
2
- import {
3
- defineCommands,
4
- defineKeymap,
5
- defineMarkSpec,
6
- toggleMark,
7
- union
8
- } from "@prosekit/core";
1
+ import { defineCommands, defineKeymap, defineMarkSpec, toggleMark, union } from "@prosekit/core";
2
+
3
+ //#region src/underline/index.ts
4
+ /**
5
+ * @internal
6
+ */
9
7
  function defineUnderlineSpec() {
10
- return defineMarkSpec({
11
- name: "underline",
12
- parseDOM: [
13
- { tag: "u" },
14
- { tag: "underline" },
15
- { style: "text-decoration=underline" },
16
- { style: "text-decoration-line=underline" }
17
- ],
18
- toDOM() {
19
- return ["u", 0];
20
- }
21
- });
8
+ return defineMarkSpec({
9
+ name: "underline",
10
+ parseDOM: [
11
+ { tag: "u" },
12
+ { tag: "underline" },
13
+ { style: "text-decoration=underline" },
14
+ { style: "text-decoration-line=underline" }
15
+ ],
16
+ toDOM() {
17
+ return ["u", 0];
18
+ }
19
+ });
22
20
  }
21
+ /**
22
+ * @internal
23
+ */
23
24
  function defineUnderlineCommands() {
24
- return defineCommands({
25
- toggleUnderline: () => toggleMark({ type: "underline" })
26
- });
25
+ return defineCommands({ toggleUnderline: () => toggleMark({ type: "underline" }) });
27
26
  }
27
+ /**
28
+ * @internal
29
+ */
28
30
  function defineUnderlineKeymap() {
29
- return defineKeymap({
30
- "Mod-u": toggleMark({ type: "underline" })
31
- });
31
+ return defineKeymap({ "Mod-u": toggleMark({ type: "underline" }) });
32
32
  }
33
+ /**
34
+ * @public
35
+ */
33
36
  function defineUnderline() {
34
- return union(
35
- defineUnderlineSpec(),
36
- defineUnderlineCommands(),
37
- defineUnderlineKeymap()
38
- );
37
+ return union(defineUnderlineSpec(), defineUnderlineCommands(), defineUnderlineKeymap());
39
38
  }
40
- export {
41
- defineUnderline,
42
- defineUnderlineCommands,
43
- defineUnderlineKeymap,
44
- defineUnderlineSpec
45
- };
39
+
40
+ //#endregion
41
+ export { defineUnderline, defineUnderlineCommands, defineUnderlineKeymap, defineUnderlineSpec };
@@ -1,2 +1,24 @@
1
- export { defineVirtualSelection } from './_tsup-dts-rollup.js';
2
- export { VirtualSelectionExtension } from './_tsup-dts-rollup.js';
1
+ import { PlainExtension } from "@prosekit/core";
2
+
3
+ //#region src/virtual-selection/index.d.ts
4
+ /**
5
+ * @internal
6
+ */
7
+ /**
8
+ * @internal
9
+ */
10
+ type VirtualSelectionExtension = PlainExtension;
11
+ /**
12
+ * Shows a virtual selection when the editor is not focused. When the editor is
13
+ * not focused, the selected inline content will be wrapped in a `<span>`
14
+ * element with the class `prosekit-virtual-selection`.
15
+ *
16
+ * This is useful when you want to move the focus to an element outside the
17
+ * editor, but still want to show the selection.
18
+ *
19
+ * @public
20
+ */
21
+ declare function defineVirtualSelection(): VirtualSelectionExtension;
22
+
23
+ //#endregion
24
+ export { VirtualSelectionExtension, defineVirtualSelection };
@@ -1,61 +1,58 @@
1
- // src/virtual-selection/index.ts
2
- import {
3
- definePlugin
4
- } from "@prosekit/core";
5
- import {
6
- PluginKey,
7
- ProseMirrorPlugin
8
- } from "@prosekit/pm/state";
9
- import {
10
- Decoration,
11
- DecorationSet
12
- } from "@prosekit/pm/view";
1
+ import { definePlugin } from "@prosekit/core";
2
+ import { PluginKey, ProseMirrorPlugin } from "@prosekit/pm/state";
3
+ import { Decoration, DecorationSet } from "@prosekit/pm/view";
4
+
5
+ //#region src/virtual-selection/index.ts
6
+ /**
7
+ * Shows a virtual selection when the editor is not focused. When the editor is
8
+ * not focused, the selected inline content will be wrapped in a `<span>`
9
+ * element with the class `prosekit-virtual-selection`.
10
+ *
11
+ * This is useful when you want to move the focus to an element outside the
12
+ * editor, but still want to show the selection.
13
+ *
14
+ * @public
15
+ */
13
16
  function defineVirtualSelection() {
14
- return definePlugin(virtualSelectionPlugin);
17
+ return definePlugin(virtualSelectionPlugin);
15
18
  }
16
- var key = new PluginKey("prosekit-virtual-selection");
19
+ const key = new PluginKey("prosekit-virtual-selection");
17
20
  function getFocusMeta(tr) {
18
- return tr.getMeta(key);
21
+ return tr.getMeta(key);
19
22
  }
20
23
  function setFocusMeta(tr, value) {
21
- return tr.setMeta(key, value);
24
+ return tr.setMeta(key, value);
22
25
  }
23
26
  function getFocusState(state) {
24
- return key.getState(state);
27
+ return key.getState(state);
25
28
  }
26
- var virtualSelectionPlugin = new ProseMirrorPlugin({
27
- key,
28
- state: {
29
- init: () => false,
30
- apply: (tr, value) => {
31
- return getFocusMeta(tr) ?? value;
32
- }
33
- },
34
- props: {
35
- handleDOMEvents: {
36
- focus: (view) => {
37
- view.dispatch(setFocusMeta(view.state.tr, false));
38
- },
39
- blur: (view) => {
40
- const { dom, root } = view;
41
- const activeElement = root.activeElement;
42
- if (activeElement === dom) return;
43
- view.dispatch(setFocusMeta(view.state.tr, true));
44
- }
45
- },
46
- decorations: (state) => {
47
- const { selection, doc } = state;
48
- if (selection.empty || !getFocusState(state)) {
49
- return null;
50
- }
51
- return DecorationSet.create(doc, [
52
- Decoration.inline(selection.from, selection.to, {
53
- class: "prosekit-virtual-selection"
54
- })
55
- ]);
56
- }
57
- }
29
+ const virtualSelectionPlugin = new ProseMirrorPlugin({
30
+ key,
31
+ state: {
32
+ init: () => false,
33
+ apply: (tr, value) => {
34
+ return getFocusMeta(tr) ?? value;
35
+ }
36
+ },
37
+ props: {
38
+ handleDOMEvents: {
39
+ focus: (view) => {
40
+ view.dispatch(setFocusMeta(view.state.tr, false));
41
+ },
42
+ blur: (view) => {
43
+ const { dom, root } = view;
44
+ const activeElement = root.activeElement;
45
+ if (activeElement === dom) return;
46
+ view.dispatch(setFocusMeta(view.state.tr, true));
47
+ }
48
+ },
49
+ decorations: (state) => {
50
+ const { selection, doc } = state;
51
+ if (selection.empty || !getFocusState(state)) return null;
52
+ return DecorationSet.create(doc, [Decoration.inline(selection.from, selection.to, { class: "prosekit-virtual-selection" })]);
53
+ }
54
+ }
58
55
  });
59
- export {
60
- defineVirtualSelection
61
- };
56
+
57
+ //#endregion
58
+ export { defineVirtualSelection };
@@ -1,14 +1,99 @@
1
- export { defineYjs } from './_tsup-dts-rollup.js';
2
- export { YjsExtension } from './_tsup-dts-rollup.js';
3
- export { YjsOptions } from './_tsup-dts-rollup.js';
4
- export { defineYjsCommands } from './_tsup-dts-rollup.js';
5
- export { defineYjsCursorPlugin } from './_tsup-dts-rollup.js';
6
- export { YjsCursorOptions } from './_tsup-dts-rollup.js';
7
- export { YjsCursorPluginOptions } from './_tsup-dts-rollup.js';
8
- export { defineYjsKeymap } from './_tsup-dts-rollup.js';
9
- export { defineYjsSyncPlugin } from './_tsup-dts-rollup.js';
10
- export { YjsSyncOptions } from './_tsup-dts-rollup.js';
11
- export { YjsSyncPluginOptions } from './_tsup-dts-rollup.js';
12
- export { defineYjsUndoPlugin } from './_tsup-dts-rollup.js';
13
- export { YjsUndoOptions } from './_tsup-dts-rollup.js';
14
- export { YjsUndoPluginOptions } from './_tsup-dts-rollup.js';
1
+ import { Extension, PlainExtension, Union } from "@prosekit/core";
2
+ import { yCursorPlugin, ySyncPlugin, yUndoPlugin } from "y-prosemirror";
3
+ import { Awareness } from "y-protocols/awareness";
4
+ import * as Y$1 from "yjs";
5
+ import * as Y from "yjs";
6
+
7
+ //#region src/yjs/yjs-commands.d.ts
8
+ /**
9
+ * @internal
10
+ */
11
+ /**
12
+ * @internal
13
+ */
14
+ type YjsCommandsExtension = Extension<{
15
+ Commands: {
16
+ undo: [];
17
+ redo: [];
18
+ };
19
+ }>;
20
+ declare function defineYjsCommands(): YjsCommandsExtension;
21
+
22
+ //#endregion
23
+ //#region src/yjs/yjs-cursor-plugin.d.ts
24
+ /**
25
+ * Options for `y-prosemirror`'s `yCursorPlugin`.
26
+ */
27
+ type YjsCursorPluginOptions = NonNullable<Parameters<typeof yCursorPlugin>[1]>;
28
+ interface YjsCursorOptions extends YjsCursorPluginOptions {
29
+ awareness: Awareness;
30
+ }
31
+ declare function defineYjsCursorPlugin(options: YjsCursorOptions): PlainExtension;
32
+
33
+ //#endregion
34
+ //#region src/yjs/yjs-sync-plugin.d.ts
35
+ /**
36
+ * Options for `y-prosemirror`'s `ySyncPlugin`.
37
+ */
38
+ type YjsSyncPluginOptions = NonNullable<Parameters<typeof ySyncPlugin>[1]>;
39
+ interface YjsSyncOptions extends YjsSyncPluginOptions {
40
+ fragment: Y$1.XmlFragment;
41
+ }
42
+ declare function defineYjsSyncPlugin(options: YjsSyncOptions): PlainExtension;
43
+
44
+ //#endregion
45
+ //#region src/yjs/yjs-undo-plugin.d.ts
46
+ /**
47
+ * Options for the `y-prosemirror`'s `yUndoPlugin`.
48
+ */
49
+ type YjsUndoPluginOptions = NonNullable<Parameters<typeof yUndoPlugin>[0]>;
50
+ interface YjsUndoOptions extends YjsUndoPluginOptions {}
51
+ /**
52
+ * @internal
53
+ */
54
+ declare function defineYjsUndoPlugin(options: YjsUndoOptions): PlainExtension;
55
+
56
+ //#endregion
57
+ //#region src/yjs/yjs.d.ts
58
+ interface YjsOptions {
59
+ /**
60
+ * The Yjs instance handles the state of shared data.
61
+ */
62
+ doc: Y.Doc;
63
+ /**
64
+ * The Awareness instance.
65
+ */
66
+ awareness: Awareness;
67
+ /**
68
+ * The Yjs XmlFragment to use. If not provided,
69
+ * `doc.getXmlFragment('prosemirror')` will be used.
70
+ */
71
+ fragment?: Y.XmlFragment;
72
+ /**
73
+ * Options for `y-prosemirror`'s `ySyncPlugin`.
74
+ */
75
+ sync?: YjsSyncPluginOptions;
76
+ /**
77
+ * Options for the `y-prosemirror`'s `yUndoPlugin`.
78
+ */
79
+ undo?: YjsUndoPluginOptions;
80
+ /**
81
+ * Options for `y-prosemirror`'s `yCursorPlugin`.
82
+ */
83
+ cursor?: YjsCursorPluginOptions;
84
+ }
85
+ /**
86
+ * @internal
87
+ */
88
+ type YjsExtension = Union<[YjsCommandsExtension, PlainExtension]>;
89
+ /**
90
+ * @public
91
+ */
92
+ declare function defineYjs(options: YjsOptions): YjsExtension;
93
+
94
+ //#endregion
95
+ //#region src/yjs/yjs-keymap.d.ts
96
+ declare function defineYjsKeymap(): PlainExtension;
97
+
98
+ //#endregion
99
+ export { YjsCursorOptions, YjsCursorPluginOptions, YjsExtension, YjsOptions, YjsSyncOptions, YjsSyncPluginOptions, YjsUndoOptions, YjsUndoPluginOptions, defineYjs, defineYjsCommands, defineYjsCursorPlugin, defineYjsKeymap, defineYjsSyncPlugin, defineYjsUndoPlugin };