@prosekit/extensions 0.7.22 → 0.7.24

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 (38) hide show
  1. package/dist/_tsup-dts-rollup.d.ts +38 -15
  2. package/dist/{chunk-4WHSS2ZE.js → chunk-6UYLCVBX.js} +2 -2
  3. package/dist/{chunk-LAQZC3ZM.js → chunk-BV3SHIMW.js} +1 -2
  4. package/dist/{chunk-RE23OQPF.js → chunk-D54VSLLS.js} +2 -2
  5. package/dist/{chunk-HHZL6V6B.js → chunk-HFAZX2J3.js} +27 -16
  6. package/dist/prosekit-extensions-autocomplete.js +13 -11
  7. package/dist/prosekit-extensions-blockquote.js +14 -6
  8. package/dist/prosekit-extensions-bold.js +15 -5
  9. package/dist/prosekit-extensions-code-block.js +22 -9
  10. package/dist/prosekit-extensions-code.js +15 -5
  11. package/dist/prosekit-extensions-commit.js +8 -5
  12. package/dist/prosekit-extensions-drop-cursor.d.ts +2 -2
  13. package/dist/prosekit-extensions-drop-cursor.js +3 -1
  14. package/dist/prosekit-extensions-enter-rule.js +1 -1
  15. package/dist/prosekit-extensions-file.d.ts +5 -5
  16. package/dist/prosekit-extensions-file.js +23 -25
  17. package/dist/prosekit-extensions-gap-cursor.js +3 -1
  18. package/dist/prosekit-extensions-heading.js +10 -7
  19. package/dist/prosekit-extensions-horizontal-rule.js +19 -6
  20. package/dist/prosekit-extensions-image.js +10 -3
  21. package/dist/prosekit-extensions-input-rule.js +1 -1
  22. package/dist/prosekit-extensions-italic.js +15 -5
  23. package/dist/prosekit-extensions-link.js +3 -3
  24. package/dist/prosekit-extensions-list.d.ts +1 -0
  25. package/dist/prosekit-extensions-list.js +83 -13
  26. package/dist/prosekit-extensions-loro.d.ts +4 -4
  27. package/dist/prosekit-extensions-loro.js +33 -13
  28. package/dist/prosekit-extensions-mark-rule.js +1 -1
  29. package/dist/prosekit-extensions-mod-click-prevention.js +8 -2
  30. package/dist/prosekit-extensions-placeholder.js +16 -7
  31. package/dist/prosekit-extensions-readonly.js +4 -1
  32. package/dist/prosekit-extensions-search.js +7 -4
  33. package/dist/prosekit-extensions-strike.js +3 -3
  34. package/dist/prosekit-extensions-table.d.ts +1 -1
  35. package/dist/prosekit-extensions-table.js +1 -1
  36. package/dist/prosekit-extensions-virtual-selection.js +8 -4
  37. package/dist/prosekit-extensions-yjs.js +14 -9
  38. package/package.json +16 -15
@@ -1,8 +1,8 @@
1
- export { defineFilePasteHandler_alias_1 as defineFilePasteHandler } from './_tsup-dts-rollup.js';
2
- export { FilePasteHandlerOptions_alias_1 as FilePasteHandlerOptions } from './_tsup-dts-rollup.js';
3
1
  export { defineFileDropHandler_alias_1 as defineFileDropHandler } from './_tsup-dts-rollup.js';
4
2
  export { FileDropHandlerOptions_alias_1 as FileDropHandlerOptions } from './_tsup-dts-rollup.js';
5
- export { UploadProgress_alias_1 as UploadProgress } from './_tsup-dts-rollup.js';
6
- export { UploaderOptions_alias_1 as UploaderOptions } from './_tsup-dts-rollup.js';
7
- export { Uploader_alias_1 as Uploader } from './_tsup-dts-rollup.js';
3
+ export { defineFilePasteHandler_alias_1 as defineFilePasteHandler } from './_tsup-dts-rollup.js';
4
+ export { FilePasteHandlerOptions_alias_1 as FilePasteHandlerOptions } from './_tsup-dts-rollup.js';
8
5
  export { UploadTask_alias_1 as UploadTask } from './_tsup-dts-rollup.js';
6
+ export { Uploader_alias_1 as Uploader } from './_tsup-dts-rollup.js';
7
+ export { UploaderOptions_alias_1 as UploaderOptions } from './_tsup-dts-rollup.js';
8
+ export { UploadProgress_alias_1 as UploadProgress } from './_tsup-dts-rollup.js';
@@ -1,4 +1,4 @@
1
- // src/file/file-paste-handler.ts
1
+ // src/file/file-drop-handler.ts
2
2
  import {
3
3
  defineFacet,
4
4
  defineFacetPayload,
@@ -26,56 +26,54 @@ function handleEvent(view, event, handlers, getFiles3) {
26
26
  return handled;
27
27
  }
28
28
 
29
- // src/file/file-paste-handler.ts
30
- function defineFilePasteHandler(handler) {
29
+ // src/file/file-drop-handler.ts
30
+ function defineFileDropHandler(handler) {
31
31
  return defineFacetPayload(facet, [handler]);
32
32
  }
33
33
  function getFiles(event) {
34
- var _a, _b;
35
- return Array.from((_b = (_a = event.clipboardData) == null ? void 0 : _a.files) != null ? _b : []);
34
+ return Array.from(event.dataTransfer?.files ?? []);
36
35
  }
37
36
  var facet = defineFacet({
38
37
  parent: editorEventFacet,
39
38
  singleton: true,
40
39
  reducer: (handlers) => {
41
- const pasteHandler = (view, event) => {
42
- return handleEvent(view, event, handlers, getFiles);
40
+ const dropHandler = (view, event) => {
41
+ const position = view.posAtCoords({ left: event.x, top: event.y });
42
+ if (!position) {
43
+ return false;
44
+ }
45
+ const pos = position.inside > 0 ? position.inside : position.pos;
46
+ return handleEvent(
47
+ view,
48
+ event,
49
+ handlers.map((handler) => (options) => handler({ ...options, pos })),
50
+ getFiles
51
+ );
43
52
  };
44
- return ["paste", pasteHandler];
53
+ return ["drop", dropHandler];
45
54
  }
46
55
  });
47
56
 
48
- // src/file/file-drop-handler.ts
57
+ // src/file/file-paste-handler.ts
49
58
  import {
50
59
  defineFacet as defineFacet2,
51
60
  defineFacetPayload as defineFacetPayload2,
52
61
  editorEventFacet as editorEventFacet2
53
62
  } from "@prosekit/core";
54
- function defineFileDropHandler(handler) {
63
+ function defineFilePasteHandler(handler) {
55
64
  return defineFacetPayload2(facet2, [handler]);
56
65
  }
57
66
  function getFiles2(event) {
58
- var _a, _b;
59
- return Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);
67
+ return Array.from(event.clipboardData?.files ?? []);
60
68
  }
61
69
  var facet2 = defineFacet2({
62
70
  parent: editorEventFacet2,
63
71
  singleton: true,
64
72
  reducer: (handlers) => {
65
- const dropHandler = (view, event) => {
66
- const position = view.posAtCoords({ left: event.x, top: event.y });
67
- if (!position) {
68
- return false;
69
- }
70
- const pos = position.inside > 0 ? position.inside : position.pos;
71
- return handleEvent(
72
- view,
73
- event,
74
- handlers.map((handler) => (options) => handler({ ...options, pos })),
75
- getFiles2
76
- );
73
+ const pasteHandler = (view, event) => {
74
+ return handleEvent(view, event, handlers, getFiles2);
77
75
  };
78
- return ["drop", dropHandler];
76
+ return ["paste", pasteHandler];
79
77
  }
80
78
  });
81
79
 
@@ -1,5 +1,7 @@
1
1
  // src/gap-cursor/gap-cursor.ts
2
- import { definePlugin } from "@prosekit/core";
2
+ import {
3
+ definePlugin
4
+ } from "@prosekit/core";
3
5
  import { gapCursor } from "prosemirror-gapcursor";
4
6
  import { GapCursor } from "prosemirror-gapcursor";
5
7
  function defineGapCursor() {
@@ -1,9 +1,11 @@
1
1
  import {
2
2
  defineTextBlockInputRule
3
- } from "./chunk-LAQZC3ZM.js";
3
+ } from "./chunk-BV3SHIMW.js";
4
4
 
5
5
  // src/heading/heading.ts
6
- import { union } from "@prosekit/core";
6
+ import {
7
+ union
8
+ } from "@prosekit/core";
7
9
 
8
10
  // src/heading/heading-commands.ts
9
11
  import {
@@ -32,8 +34,7 @@ function defineHeadingInputRule() {
32
34
  regex: /^(#{1,6})\s$/,
33
35
  type: "heading",
34
36
  attrs: (match) => {
35
- var _a, _b;
36
- const level = (_b = (_a = match[1]) == null ? void 0 : _a.length) != null ? _b : 1;
37
+ const level = match[1]?.length ?? 1;
37
38
  return { level };
38
39
  }
39
40
  });
@@ -52,7 +53,7 @@ function toggleHeadingKeybinding(level) {
52
53
  }
53
54
  var backspaceUnsetHeading = (state, dispatch, view) => {
54
55
  const $pos = isAtBlockStart(state, view);
55
- if (($pos == null ? void 0 : $pos.parent.type.name) === "heading") {
56
+ if ($pos?.parent.type.name === "heading") {
56
57
  return unsetBlockType()(state, dispatch, view);
57
58
  }
58
59
  return false;
@@ -65,12 +66,14 @@ function defineHeadingKeymap() {
65
66
  "mod-4": toggleHeadingKeybinding(4),
66
67
  "mod-5": toggleHeadingKeybinding(5),
67
68
  "mod-6": toggleHeadingKeybinding(6),
68
- Backspace: backspaceUnsetHeading
69
+ "Backspace": backspaceUnsetHeading
69
70
  });
70
71
  }
71
72
 
72
73
  // src/heading/heading-spec.ts
73
- import { defineNodeSpec } from "@prosekit/core";
74
+ import {
75
+ defineNodeSpec
76
+ } from "@prosekit/core";
74
77
  function defineHeadingSpec() {
75
78
  return defineNodeSpec({
76
79
  name: "heading",
@@ -1,13 +1,21 @@
1
1
  import {
2
2
  defineInputRule
3
- } from "./chunk-LAQZC3ZM.js";
3
+ } from "./chunk-BV3SHIMW.js";
4
4
 
5
5
  // src/horizontal-rule/horizontal-rule.ts
6
- import { union as union2 } from "@prosekit/core";
6
+ import {
7
+ union as union2
8
+ } from "@prosekit/core";
7
9
 
8
10
  // src/horizontal-rule/horizontal-rule-commands.ts
9
- import { defineCommands, getNodeType } from "@prosekit/core";
10
- import { Fragment, Slice } from "@prosekit/pm/model";
11
+ import {
12
+ defineCommands,
13
+ getNodeType
14
+ } from "@prosekit/core";
15
+ import {
16
+ Fragment,
17
+ Slice
18
+ } from "@prosekit/pm/model";
11
19
  import "@prosekit/pm/state";
12
20
  function insertHorizontalRule() {
13
21
  return (state, dispatch) => {
@@ -26,7 +34,10 @@ function defineHorizontalRuleCommands() {
26
34
  }
27
35
 
28
36
  // src/horizontal-rule/horizontal-rule-input-rule.ts
29
- import { getNodeType as getNodeType2, union } from "@prosekit/core";
37
+ import {
38
+ getNodeType as getNodeType2,
39
+ union
40
+ } from "@prosekit/core";
30
41
  import { InputRule } from "@prosekit/pm/inputrules";
31
42
  function defineHorizontalRuleInputRule() {
32
43
  return union(
@@ -44,7 +55,9 @@ function defineHorizontalRuleInputRule() {
44
55
  }
45
56
 
46
57
  // src/horizontal-rule/horizontal-rule-spec.ts
47
- import { defineNodeSpec } from "@prosekit/core";
58
+ import {
59
+ defineNodeSpec
60
+ } from "@prosekit/core";
48
61
  function defineHorizontalRuleSpec() {
49
62
  return defineNodeSpec({
50
63
  name: "horizontalRule",
@@ -1,8 +1,13 @@
1
1
  // src/image/image.ts
2
- import { union } from "@prosekit/core";
2
+ import {
3
+ union
4
+ } from "@prosekit/core";
3
5
 
4
6
  // src/image/image-commands.ts
5
- import { defineCommands, insertNode } from "@prosekit/core";
7
+ import {
8
+ defineCommands,
9
+ insertNode
10
+ } from "@prosekit/core";
6
11
  function defineImageCommands() {
7
12
  return defineCommands({
8
13
  insertImage: (attrs) => {
@@ -12,7 +17,9 @@ function defineImageCommands() {
12
17
  }
13
18
 
14
19
  // src/image/image-spec.ts
15
- import { defineNodeSpec } from "@prosekit/core";
20
+ import {
21
+ defineNodeSpec
22
+ } from "@prosekit/core";
16
23
  function defineImageSpec() {
17
24
  return defineNodeSpec({
18
25
  name: "image",
@@ -4,7 +4,7 @@ import {
4
4
  defineMarkInputRule,
5
5
  defineTextBlockInputRule,
6
6
  defineWrappingInputRule
7
- } from "./chunk-LAQZC3ZM.js";
7
+ } from "./chunk-BV3SHIMW.js";
8
8
  export {
9
9
  createMarkInputRule,
10
10
  defineInputRule,
@@ -1,12 +1,17 @@
1
1
  import {
2
2
  defineMarkInputRule
3
- } from "./chunk-LAQZC3ZM.js";
3
+ } from "./chunk-BV3SHIMW.js";
4
4
 
5
5
  // src/italic/italic.ts
6
- import { union } from "@prosekit/core";
6
+ import {
7
+ union
8
+ } from "@prosekit/core";
7
9
 
8
10
  // src/italic/italic-commands.ts
9
- import { defineCommands, toggleMark } from "@prosekit/core";
11
+ import {
12
+ defineCommands,
13
+ toggleMark
14
+ } from "@prosekit/core";
10
15
  function defineItalicCommands() {
11
16
  return defineCommands({
12
17
  toggleItalic: () => toggleMark({ type: "italic" })
@@ -23,7 +28,10 @@ function defineItalicInputRule() {
23
28
  }
24
29
 
25
30
  // src/italic/italic-keymap.ts
26
- import { defineKeymap, toggleMark as toggleMark2 } from "@prosekit/core";
31
+ import {
32
+ defineKeymap,
33
+ toggleMark as toggleMark2
34
+ } from "@prosekit/core";
27
35
  function defineItalicKeymap() {
28
36
  return defineKeymap({
29
37
  "Mod-i": toggleMark2({ type: "italic" })
@@ -31,7 +39,9 @@ function defineItalicKeymap() {
31
39
  }
32
40
 
33
41
  // src/italic/italic-spec.ts
34
- import { defineMarkSpec } from "@prosekit/core";
42
+ import {
43
+ defineMarkSpec
44
+ } from "@prosekit/core";
35
45
  function defineItalicSpec() {
36
46
  return defineMarkSpec({
37
47
  name: "italic",
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  defineMarkRule
3
- } from "./chunk-4WHSS2ZE.js";
3
+ } from "./chunk-6UYLCVBX.js";
4
4
  import {
5
5
  defineEnterRule
6
- } from "./chunk-RE23OQPF.js";
6
+ } from "./chunk-D54VSLLS.js";
7
7
  import {
8
8
  defineInputRule
9
- } from "./chunk-LAQZC3ZM.js";
9
+ } from "./chunk-BV3SHIMW.js";
10
10
 
11
11
  // src/link/index.ts
12
12
  import {
@@ -11,6 +11,7 @@ export { ListCommandsExtension } from './_tsup-dts-rollup.js';
11
11
  export { defineListInputRules } from './_tsup-dts-rollup.js';
12
12
  export { defineListKeymap } from './_tsup-dts-rollup.js';
13
13
  export { defineListPlugins } from './_tsup-dts-rollup.js';
14
+ export { defineListSerializer } from './_tsup-dts-rollup.js';
14
15
  export { defineListSpec } from './_tsup-dts-rollup.js';
15
16
  export { ListSpecExtension } from './_tsup-dts-rollup.js';
16
17
  export { ListAttrs } from './_tsup-dts-rollup.js';
@@ -1,15 +1,20 @@
1
1
  import {
2
2
  defineInputRule
3
- } from "./chunk-LAQZC3ZM.js";
3
+ } from "./chunk-BV3SHIMW.js";
4
4
 
5
5
  // src/list/index.ts
6
6
  import { ListDOMSerializer as ListDOMSerializer2 } from "prosemirror-flat-list";
7
7
 
8
8
  // src/list/list.ts
9
- import { union as union2 } from "@prosekit/core";
9
+ import {
10
+ union as union2
11
+ } from "@prosekit/core";
10
12
 
11
13
  // src/list/list-commands.ts
12
- import { defineCommands, insertNode } from "@prosekit/core";
14
+ import {
15
+ defineCommands,
16
+ insertNode
17
+ } from "@prosekit/core";
13
18
  import {
14
19
  createDedentListCommand as dedentList,
15
20
  createIndentListCommand as indentList,
@@ -38,7 +43,9 @@ function defineListCommands() {
38
43
  }
39
44
 
40
45
  // src/list/list-input-rules.ts
41
- import { union } from "@prosekit/core";
46
+ import {
47
+ union
48
+ } from "@prosekit/core";
42
49
  import { listInputRules } from "prosemirror-flat-list";
43
50
  function defineListInputRules() {
44
51
  return union(listInputRules.map(defineInputRule));
@@ -46,7 +53,10 @@ function defineListInputRules() {
46
53
 
47
54
  // src/list/list-keymap.ts
48
55
  import { defineKeymap } from "@prosekit/core";
49
- import { chainCommands, deleteSelection } from "@prosekit/pm/commands";
56
+ import {
57
+ chainCommands,
58
+ deleteSelection
59
+ } from "@prosekit/pm/commands";
50
60
  import {
51
61
  createDedentListCommand,
52
62
  createIndentListCommand,
@@ -65,12 +75,12 @@ var backspaceCommand = chainCommands(
65
75
  var dedentListCommand = createDedentListCommand();
66
76
  var indentListCommand = createIndentListCommand();
67
77
  var listKeymap = {
68
- Enter: enterCommand,
69
- Backspace: backspaceCommand,
70
- Delete: deleteCommand,
78
+ "Enter": enterCommand,
79
+ "Backspace": backspaceCommand,
80
+ "Delete": deleteCommand,
71
81
  "Mod-]": indentListCommand,
72
82
  "Mod-[": dedentListCommand,
73
- Tab: indentListCommand,
83
+ "Tab": indentListCommand,
74
84
  "Shift-Tab": dedentListCommand
75
85
  };
76
86
  function defineListKeymap() {
@@ -79,13 +89,71 @@ function defineListKeymap() {
79
89
 
80
90
  // src/list/list-plugins.ts
81
91
  import { definePlugin } from "@prosekit/core";
82
- import { createListPlugins } from "prosemirror-flat-list";
92
+ import { Plugin } from "@prosekit/pm/state";
93
+ import {
94
+ createListEventPlugin,
95
+ createListRenderingPlugin,
96
+ createSafariInputMethodWorkaroundPlugin,
97
+ unwrapListSlice
98
+ } from "prosemirror-flat-list";
99
+ function createListClipboardPlugin() {
100
+ return new Plugin({
101
+ props: {
102
+ transformCopied: unwrapListSlice
103
+ }
104
+ });
105
+ }
106
+ function createListPlugins() {
107
+ return [
108
+ createListEventPlugin(),
109
+ createListRenderingPlugin(),
110
+ createListClipboardPlugin(),
111
+ createSafariInputMethodWorkaroundPlugin()
112
+ ];
113
+ }
83
114
  function defineListPlugins() {
84
- return definePlugin(({ schema }) => createListPlugins({ schema }));
115
+ return definePlugin(createListPlugins);
116
+ }
117
+
118
+ // src/list/list-serializer.ts
119
+ import {
120
+ defineClipboardSerializer,
121
+ isElement
122
+ } from "@prosekit/core";
123
+ import {
124
+ joinListElements,
125
+ listToDOM
126
+ } from "prosemirror-flat-list";
127
+ function defineListSerializer() {
128
+ return defineClipboardSerializer({
129
+ serializeFragmentWrapper: (fn) => {
130
+ return (...args) => {
131
+ const dom = fn(...args);
132
+ return joinListElements(dom);
133
+ };
134
+ },
135
+ serializeNodeWrapper: (fn) => {
136
+ return (...args) => {
137
+ const dom = fn(...args);
138
+ return isElement(dom) ? joinListElements(dom) : dom;
139
+ };
140
+ },
141
+ nodesFromSchemaWrapper: (fn) => {
142
+ return (...args) => {
143
+ const nodes = fn(...args);
144
+ return {
145
+ ...nodes,
146
+ list: (node) => listToDOM({ node, nativeList: true, getMarkers: () => null })
147
+ };
148
+ };
149
+ }
150
+ });
85
151
  }
86
152
 
87
153
  // src/list/list-spec.ts
88
- import { defineNodeSpec } from "@prosekit/core";
154
+ import {
155
+ defineNodeSpec
156
+ } from "@prosekit/core";
89
157
  import { createListSpec } from "prosemirror-flat-list";
90
158
  function defineListSpec() {
91
159
  return defineNodeSpec({
@@ -102,7 +170,8 @@ function defineList() {
102
170
  defineListPlugins(),
103
171
  defineListKeymap(),
104
172
  defineListInputRules(),
105
- defineListCommands()
173
+ defineListCommands(),
174
+ defineListSerializer()
106
175
  );
107
176
  }
108
177
  export {
@@ -112,5 +181,6 @@ export {
112
181
  defineListInputRules,
113
182
  defineListKeymap,
114
183
  defineListPlugins,
184
+ defineListSerializer,
115
185
  defineListSpec
116
186
  };
@@ -1,11 +1,11 @@
1
1
  export { LoroSyncPluginProps } from './_tsup-dts-rollup.js';
2
2
  export { LoroUndoPluginProps } from './_tsup-dts-rollup.js';
3
+ export { defineLoro } from './_tsup-dts-rollup.js';
4
+ export { LoroExtension } from './_tsup-dts-rollup.js';
5
+ export { LoroOptions } from './_tsup-dts-rollup.js';
3
6
  export { defineLoroCommands } from './_tsup-dts-rollup.js';
4
- export { LoroCursorOptions } from './_tsup-dts-rollup.js';
5
7
  export { defineLoroCursorPlugin } from './_tsup-dts-rollup.js';
8
+ export { LoroCursorOptions } from './_tsup-dts-rollup.js';
6
9
  export { defineLoroKeymap } from './_tsup-dts-rollup.js';
7
10
  export { defineLoroSyncPlugin } from './_tsup-dts-rollup.js';
8
11
  export { defineLoroUndoPlugin } from './_tsup-dts-rollup.js';
9
- export { defineLoro } from './_tsup-dts-rollup.js';
10
- export { LoroExtension } from './_tsup-dts-rollup.js';
11
- export { LoroOptions } from './_tsup-dts-rollup.js';
@@ -1,6 +1,18 @@
1
+ // src/loro/loro.ts
2
+ import {
3
+ Priority,
4
+ union,
5
+ withPriority
6
+ } from "@prosekit/core";
7
+
1
8
  // src/loro/loro-commands.ts
2
- import { defineCommands } from "@prosekit/core";
3
- import { redo, undo } from "loro-prosemirror";
9
+ import {
10
+ defineCommands
11
+ } from "@prosekit/core";
12
+ import {
13
+ redo,
14
+ undo
15
+ } from "loro-prosemirror";
4
16
  var commands = {
5
17
  undo: () => undo,
6
18
  redo: () => redo
@@ -10,8 +22,12 @@ function defineLoroCommands() {
10
22
  }
11
23
 
12
24
  // src/loro/loro-cursor-plugin.ts
13
- import { definePlugin } from "@prosekit/core";
14
- import { LoroCursorPlugin } from "loro-prosemirror";
25
+ import {
26
+ definePlugin
27
+ } from "@prosekit/core";
28
+ import {
29
+ LoroCursorPlugin
30
+ } from "loro-prosemirror";
15
31
  function defineLoroCursorPlugin(options) {
16
32
  const { awareness, ...rest } = options;
17
33
  return definePlugin(LoroCursorPlugin(awareness, rest));
@@ -22,7 +38,10 @@ import {
22
38
  defineKeymap,
23
39
  isApple
24
40
  } from "@prosekit/core";
25
- import { redo as redo2, undo as undo2 } from "loro-prosemirror";
41
+ import {
42
+ redo as redo2,
43
+ undo as undo2
44
+ } from "loro-prosemirror";
26
45
  var keymap = {
27
46
  "Mod-z": undo2,
28
47
  "Shift-Mod-z": redo2
@@ -35,25 +54,26 @@ function defineLoroKeymap() {
35
54
  }
36
55
 
37
56
  // src/loro/loro-sync-plugin.ts
38
- import { definePlugin as definePlugin2 } from "@prosekit/core";
39
- import { LoroSyncPlugin } from "loro-prosemirror";
57
+ import {
58
+ definePlugin as definePlugin2
59
+ } from "@prosekit/core";
60
+ import {
61
+ LoroSyncPlugin
62
+ } from "loro-prosemirror";
40
63
  function defineLoroSyncPlugin(options) {
41
64
  return definePlugin2(LoroSyncPlugin(options));
42
65
  }
43
66
 
44
67
  // src/loro/loro-undo-plugin.ts
45
68
  import { definePlugin as definePlugin3 } from "@prosekit/core";
46
- import { LoroUndoPlugin } from "loro-prosemirror";
69
+ import {
70
+ LoroUndoPlugin
71
+ } from "loro-prosemirror";
47
72
  function defineLoroUndoPlugin(options) {
48
73
  return definePlugin3(LoroUndoPlugin(options));
49
74
  }
50
75
 
51
76
  // src/loro/loro.ts
52
- import {
53
- Priority,
54
- union,
55
- withPriority
56
- } from "@prosekit/core";
57
77
  function defineLoro(options) {
58
78
  const { doc, awareness, sync, undo: undo3, cursor } = options;
59
79
  return withPriority(
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  defineMarkRule
3
- } from "./chunk-4WHSS2ZE.js";
3
+ } from "./chunk-6UYLCVBX.js";
4
4
  export {
5
5
  defineMarkRule
6
6
  };
@@ -1,6 +1,12 @@
1
1
  // src/mod-click-prevention/index.ts
2
- import { definePlugin, isApple } from "@prosekit/core";
3
- import { Plugin, PluginKey } from "@prosekit/pm/state";
2
+ import {
3
+ definePlugin,
4
+ isApple
5
+ } from "@prosekit/core";
6
+ import {
7
+ Plugin,
8
+ PluginKey
9
+ } from "@prosekit/pm/state";
4
10
  function defineModClickPrevention() {
5
11
  return definePlugin(new Plugin({ key, props: { handleClick } }));
6
12
  }
@@ -1,11 +1,21 @@
1
1
  import {
2
2
  findTable
3
- } from "./chunk-HHZL6V6B.js";
3
+ } from "./chunk-HFAZX2J3.js";
4
4
 
5
5
  // src/placeholder/index.ts
6
- import { definePlugin, isInCodeBlock, maybeRun } from "@prosekit/core";
7
- import { Plugin, PluginKey } from "@prosekit/pm/state";
8
- import { Decoration, DecorationSet } from "@prosekit/pm/view";
6
+ import {
7
+ definePlugin,
8
+ isInCodeBlock,
9
+ maybeRun
10
+ } from "@prosekit/core";
11
+ import {
12
+ Plugin,
13
+ PluginKey
14
+ } from "@prosekit/pm/state";
15
+ import {
16
+ Decoration,
17
+ DecorationSet
18
+ } from "@prosekit/pm/view";
9
19
  function definePlaceholder(options) {
10
20
  return definePlugin(createPlaceholderPlugin(options));
11
21
  }
@@ -38,8 +48,7 @@ function docStrategy(state) {
38
48
  return isDocEmpty(state.doc) && defaultStrategy(state);
39
49
  }
40
50
  function isDocEmpty(doc) {
41
- var _a;
42
- return doc.childCount <= 1 && !((_a = doc.firstChild) == null ? void 0 : _a.content.size);
51
+ return doc.childCount <= 1 && !doc.firstChild?.content.size;
43
52
  }
44
53
  function createPlaceholderDecoration(state, placeholderText) {
45
54
  if (!placeholderText) return null;
@@ -50,7 +59,7 @@ function createPlaceholderDecoration(state, placeholderText) {
50
59
  if (node.content.size > 0) return null;
51
60
  const before = $pos.before();
52
61
  return Decoration.node(before, before + node.nodeSize, {
53
- class: "prosekit-placeholder",
62
+ "class": "prosekit-placeholder",
54
63
  "data-placeholder": placeholderText
55
64
  });
56
65
  }
@@ -1,6 +1,9 @@
1
1
  // src/readonly/index.ts
2
2
  import { definePlugin } from "@prosekit/core";
3
- import { PluginKey, ProseMirrorPlugin } from "@prosekit/pm/state";
3
+ import {
4
+ PluginKey,
5
+ ProseMirrorPlugin
6
+ } from "@prosekit/pm/state";
4
7
  function defineReadonly() {
5
8
  return definePlugin(plugin);
6
9
  }
@@ -1,7 +1,9 @@
1
1
  // src/search/index.ts
2
- import { defineCommands, definePlugin } from "@prosekit/core";
3
2
  import {
4
- SearchQuery,
3
+ defineCommands,
4
+ definePlugin
5
+ } from "@prosekit/core";
6
+ import {
5
7
  findNext,
6
8
  findNextNoWrap,
7
9
  findPrev,
@@ -10,7 +12,8 @@ import {
10
12
  replaceCurrent,
11
13
  replaceNext,
12
14
  replaceNextNoWrap,
13
- search
15
+ search,
16
+ SearchQuery
14
17
  } from "prosemirror-search";
15
18
  function defineSearchQuery(options) {
16
19
  const query = new SearchQuery(options);
@@ -19,7 +22,7 @@ function defineSearchQuery(options) {
19
22
  function scrollActiveIntoView(view) {
20
23
  if (view.isDestroyed) return;
21
24
  const active = view.dom.querySelector(".ProseMirror-active-search-match");
22
- active == null ? void 0 : active.scrollIntoView({
25
+ active?.scrollIntoView({
23
26
  block: "nearest",
24
27
  inline: "nearest",
25
28
  behavior: "smooth"