@prosekit/extensions 0.7.22 → 0.7.23
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/{chunk-4WHSS2ZE.js → chunk-6UYLCVBX.js} +2 -2
- package/dist/{chunk-HHZL6V6B.js → chunk-KNFGQ3MV.js} +19 -6
- package/dist/prosekit-extensions-autocomplete.js +7 -2
- package/dist/prosekit-extensions-blockquote.js +12 -4
- package/dist/prosekit-extensions-bold.js +14 -4
- package/dist/prosekit-extensions-code-block.js +21 -8
- package/dist/prosekit-extensions-code.js +14 -4
- package/dist/prosekit-extensions-commit.js +8 -5
- package/dist/prosekit-extensions-drop-cursor.d.ts +2 -2
- package/dist/prosekit-extensions-drop-cursor.js +3 -1
- package/dist/prosekit-extensions-enter-rule.js +1 -1
- package/dist/prosekit-extensions-file.d.ts +5 -5
- package/dist/prosekit-extensions-file.js +23 -23
- package/dist/prosekit-extensions-gap-cursor.js +3 -1
- package/dist/prosekit-extensions-heading.js +7 -3
- package/dist/prosekit-extensions-horizontal-rule.js +18 -5
- package/dist/prosekit-extensions-image.js +10 -3
- package/dist/prosekit-extensions-italic.js +14 -4
- package/dist/prosekit-extensions-link.js +2 -2
- package/dist/prosekit-extensions-list.js +21 -9
- package/dist/prosekit-extensions-loro.d.ts +4 -4
- package/dist/prosekit-extensions-loro.js +33 -13
- package/dist/prosekit-extensions-mark-rule.js +1 -1
- package/dist/prosekit-extensions-mod-click-prevention.js +8 -2
- package/dist/prosekit-extensions-placeholder.js +15 -5
- package/dist/prosekit-extensions-readonly.js +4 -1
- package/dist/prosekit-extensions-search.js +6 -3
- package/dist/prosekit-extensions-strike.js +2 -2
- package/dist/prosekit-extensions-table.d.ts +1 -1
- package/dist/prosekit-extensions-table.js +1 -1
- package/dist/prosekit-extensions-virtual-selection.js +7 -2
- package/dist/prosekit-extensions-yjs.js +12 -6
- package/package.json +10 -10
- package/dist/{chunk-RE23OQPF.js → chunk-TWEOBBYZ.js} +1 -1
@@ -1,5 +1,7 @@
|
|
1
1
|
// src/table/table.ts
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
union
|
4
|
+
} from "@prosekit/core";
|
3
5
|
|
4
6
|
// src/table/table-commands.ts
|
5
7
|
import {
|
@@ -8,7 +10,9 @@ import {
|
|
8
10
|
getNodeType,
|
9
11
|
insertNode
|
10
12
|
} from "@prosekit/core";
|
11
|
-
import {
|
13
|
+
import {
|
14
|
+
TextSelection
|
15
|
+
} from "@prosekit/pm/state";
|
12
16
|
import {
|
13
17
|
addColumnAfter,
|
14
18
|
addColumnBefore,
|
@@ -25,7 +29,9 @@ import {
|
|
25
29
|
} from "prosemirror-tables";
|
26
30
|
|
27
31
|
// src/table/table-utils.ts
|
28
|
-
import {
|
32
|
+
import {
|
33
|
+
findParentNode
|
34
|
+
} from "@prosekit/core";
|
29
35
|
import {
|
30
36
|
cellAround,
|
31
37
|
cellNear,
|
@@ -215,14 +221,21 @@ function defineTableCommands() {
|
|
215
221
|
}
|
216
222
|
|
217
223
|
// src/table/table-plugins.ts
|
218
|
-
import {
|
219
|
-
|
224
|
+
import {
|
225
|
+
definePlugin
|
226
|
+
} from "@prosekit/core";
|
227
|
+
import {
|
228
|
+
columnResizing,
|
229
|
+
tableEditing
|
230
|
+
} from "prosemirror-tables";
|
220
231
|
function defineTablePlugins() {
|
221
232
|
return definePlugin([tableEditing(), columnResizing()]);
|
222
233
|
}
|
223
234
|
|
224
235
|
// src/table/table-spec.ts
|
225
|
-
import {
|
236
|
+
import {
|
237
|
+
defineNodeSpec
|
238
|
+
} from "@prosekit/core";
|
226
239
|
import { tableNodes } from "prosemirror-tables";
|
227
240
|
var cellContent = "block+";
|
228
241
|
var cellAttrs = {
|
@@ -7,8 +7,13 @@ import {
|
|
7
7
|
|
8
8
|
// src/autocomplete/autocomplete-plugin.ts
|
9
9
|
import { OBJECT_REPLACEMENT_CHARACTER } from "@prosekit/core";
|
10
|
-
import {
|
11
|
-
|
10
|
+
import {
|
11
|
+
Plugin
|
12
|
+
} from "@prosekit/pm/state";
|
13
|
+
import {
|
14
|
+
Decoration,
|
15
|
+
DecorationSet
|
16
|
+
} from "@prosekit/pm/view";
|
12
17
|
|
13
18
|
// src/autocomplete/autocomplete-helpers.ts
|
14
19
|
import {
|
@@ -3,7 +3,9 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/blockquote/blockquote.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/blockquote/blockquote-commands.ts
|
9
11
|
import {
|
@@ -35,7 +37,11 @@ function defineBlockquoteInputRule() {
|
|
35
37
|
}
|
36
38
|
|
37
39
|
// src/blockquote/blockquote-keymap.ts
|
38
|
-
import {
|
40
|
+
import {
|
41
|
+
defineKeymap,
|
42
|
+
isAtBlockStart,
|
43
|
+
toggleWrap as toggleWrap2
|
44
|
+
} from "@prosekit/core";
|
39
45
|
import { joinBackward } from "@prosekit/pm/commands";
|
40
46
|
function toggleBlockquoteKeybinding() {
|
41
47
|
return toggleWrap2({ type: "blockquote" });
|
@@ -52,12 +58,14 @@ function backspaceUnsetBlockquote() {
|
|
52
58
|
function defineBlockquoteKeymap() {
|
53
59
|
return defineKeymap({
|
54
60
|
"mod-shift-b": toggleBlockquoteKeybinding(),
|
55
|
-
Backspace: backspaceUnsetBlockquote()
|
61
|
+
"Backspace": backspaceUnsetBlockquote()
|
56
62
|
});
|
57
63
|
}
|
58
64
|
|
59
65
|
// src/blockquote/blockquote-spec.ts
|
60
|
-
import {
|
66
|
+
import {
|
67
|
+
defineNodeSpec
|
68
|
+
} from "@prosekit/core";
|
61
69
|
function defineBlockquoteSpec() {
|
62
70
|
return defineNodeSpec({
|
63
71
|
name: "blockquote",
|
@@ -3,10 +3,15 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/bold/bold.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/bold/bold-commands.ts
|
9
|
-
import {
|
11
|
+
import {
|
12
|
+
defineCommands,
|
13
|
+
toggleMark
|
14
|
+
} from "@prosekit/core";
|
10
15
|
function defineBoldCommands() {
|
11
16
|
return defineCommands({
|
12
17
|
toggleBold: () => toggleMark({ type: "bold" })
|
@@ -23,7 +28,10 @@ function defineBoldInputRule() {
|
|
23
28
|
}
|
24
29
|
|
25
30
|
// src/bold/bold-keymap.ts
|
26
|
-
import {
|
31
|
+
import {
|
32
|
+
defineKeymap,
|
33
|
+
toggleMark as toggleMark2
|
34
|
+
} from "@prosekit/core";
|
27
35
|
function defineBoldKeymap() {
|
28
36
|
return defineKeymap({
|
29
37
|
"Mod-b": toggleMark2({ type: "bold" })
|
@@ -31,7 +39,9 @@ function defineBoldKeymap() {
|
|
31
39
|
}
|
32
40
|
|
33
41
|
// src/bold/bold-spec.ts
|
34
|
-
import {
|
42
|
+
import {
|
43
|
+
defineMarkSpec
|
44
|
+
} from "@prosekit/core";
|
35
45
|
function defineBoldSpec() {
|
36
46
|
return defineMarkSpec({
|
37
47
|
name: "bold",
|
@@ -1,12 +1,14 @@
|
|
1
1
|
import {
|
2
2
|
defineTextBlockEnterRule
|
3
|
-
} from "./chunk-
|
3
|
+
} from "./chunk-TWEOBBYZ.js";
|
4
4
|
import {
|
5
5
|
defineTextBlockInputRule
|
6
6
|
} from "./chunk-LAQZC3ZM.js";
|
7
7
|
|
8
8
|
// src/code-block/code-block.ts
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
union
|
11
|
+
} from "@prosekit/core";
|
10
12
|
|
11
13
|
// src/code-block/code-block-commands.ts
|
12
14
|
import {
|
@@ -53,8 +55,13 @@ function getAttrs(match) {
|
|
53
55
|
}
|
54
56
|
|
55
57
|
// src/code-block/code-block-keymap.ts
|
56
|
-
import {
|
57
|
-
|
58
|
+
import {
|
59
|
+
defaultBlockAt,
|
60
|
+
defineKeymap
|
61
|
+
} from "@prosekit/core";
|
62
|
+
import {
|
63
|
+
TextSelection
|
64
|
+
} from "@prosekit/pm/state";
|
58
65
|
function defineCodeBlockKeymap() {
|
59
66
|
return defineKeymap({
|
60
67
|
Enter: existCodeBlock
|
@@ -90,7 +97,9 @@ var existCodeBlock = (state, dispatch) => {
|
|
90
97
|
};
|
91
98
|
|
92
99
|
// src/code-block/code-block-spec.ts
|
93
|
-
import {
|
100
|
+
import {
|
101
|
+
defineNodeSpec
|
102
|
+
} from "@prosekit/core";
|
94
103
|
function defineCodeBlockSpec() {
|
95
104
|
return defineNodeSpec({
|
96
105
|
name: "codeBlock",
|
@@ -128,13 +137,17 @@ function defineCodeBlock() {
|
|
128
137
|
}
|
129
138
|
|
130
139
|
// src/code-block/code-block-highlight.ts
|
131
|
-
import {
|
132
|
-
|
140
|
+
import {
|
141
|
+
definePlugin
|
142
|
+
} from "@prosekit/core";
|
143
|
+
import {
|
144
|
+
createHighlightPlugin
|
145
|
+
} from "prosemirror-highlight";
|
133
146
|
function defineCodeBlockHighlight({
|
134
147
|
parser
|
135
148
|
}) {
|
136
149
|
return definePlugin(
|
137
|
-
createHighlightPlugin({ parser
|
150
|
+
createHighlightPlugin({ parser })
|
138
151
|
);
|
139
152
|
}
|
140
153
|
|
@@ -3,10 +3,15 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/code/code.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/code/code-commands.ts
|
9
|
-
import {
|
11
|
+
import {
|
12
|
+
defineCommands,
|
13
|
+
toggleMark
|
14
|
+
} from "@prosekit/core";
|
10
15
|
function defineCodeCommands() {
|
11
16
|
return defineCommands({
|
12
17
|
toggleCode: () => toggleMark({ type: "code" })
|
@@ -23,7 +28,10 @@ function defineCodeInputRule() {
|
|
23
28
|
}
|
24
29
|
|
25
30
|
// src/code/code-keymap.ts
|
26
|
-
import {
|
31
|
+
import {
|
32
|
+
defineKeymap,
|
33
|
+
toggleMark as toggleMark2
|
34
|
+
} from "@prosekit/core";
|
27
35
|
function defineCodeKeymap() {
|
28
36
|
return defineKeymap({
|
29
37
|
"Mod-e": toggleMark2({ type: "code" })
|
@@ -31,7 +39,9 @@ function defineCodeKeymap() {
|
|
31
39
|
}
|
32
40
|
|
33
41
|
// src/code/code-spec.ts
|
34
|
-
import {
|
42
|
+
import {
|
43
|
+
defineMarkSpec
|
44
|
+
} from "@prosekit/core";
|
35
45
|
function defineCodeSpec() {
|
36
46
|
return defineMarkSpec({
|
37
47
|
name: "code",
|
@@ -16,8 +16,13 @@ import {
|
|
16
16
|
ProseMirrorPlugin
|
17
17
|
} from "@prosekit/pm/state";
|
18
18
|
import { Step } from "@prosekit/pm/transform";
|
19
|
-
import {
|
20
|
-
|
19
|
+
import {
|
20
|
+
Decoration,
|
21
|
+
DecorationSet
|
22
|
+
} from "@prosekit/pm/view";
|
23
|
+
import {
|
24
|
+
ChangeSet
|
25
|
+
} from "prosemirror-changeset";
|
21
26
|
function getChanges(doc, parent, steps) {
|
22
27
|
const initSet = ChangeSet.create(parent);
|
23
28
|
const currSet = initSet.addSteps(
|
@@ -108,9 +113,7 @@ function decorateChange(prev, change) {
|
|
108
113
|
}
|
109
114
|
function decorateCommit(doc, parent, steps) {
|
110
115
|
const changes = getChanges(doc, parent, steps);
|
111
|
-
const decorations = changes.flatMap(
|
112
|
-
(change) => decorateChange(parent, change)
|
113
|
-
);
|
116
|
+
const decorations = changes.flatMap((change) => decorateChange(parent, change));
|
114
117
|
return DecorationSet.create(doc, decorations);
|
115
118
|
}
|
116
119
|
function defineCommitDecoration(commit) {
|
@@ -1,3 +1,3 @@
|
|
1
|
-
export { DropCursorOptions_alias_1 as DropCursorOptions } from './_tsup-dts-rollup.js';
|
2
|
-
export { DropCursorExtension_alias_1 as DropCursorExtension } from './_tsup-dts-rollup.js';
|
3
1
|
export { defineDropCursor_alias_1 as defineDropCursor } from './_tsup-dts-rollup.js';
|
2
|
+
export { DropCursorExtension_alias_1 as DropCursorExtension } from './_tsup-dts-rollup.js';
|
3
|
+
export { DropCursorOptions_alias_1 as DropCursorOptions } from './_tsup-dts-rollup.js';
|
@@ -1,5 +1,7 @@
|
|
1
1
|
// src/drop-cursor/drop-cursor.ts
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
definePlugin
|
4
|
+
} from "@prosekit/core";
|
3
5
|
import { dropCursor } from "prosemirror-dropcursor";
|
4
6
|
function defineDropCursor(options) {
|
5
7
|
return definePlugin(() => dropCursor(options));
|
@@ -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 {
|
6
|
-
export {
|
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-
|
1
|
+
// src/file/file-drop-handler.ts
|
2
2
|
import {
|
3
3
|
defineFacet,
|
4
4
|
defineFacetPayload,
|
@@ -26,56 +26,56 @@ function handleEvent(view, event, handlers, getFiles3) {
|
|
26
26
|
return handled;
|
27
27
|
}
|
28
28
|
|
29
|
-
// src/file/file-
|
30
|
-
function
|
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
34
|
var _a, _b;
|
35
|
-
return Array.from((_b = (_a = event.
|
35
|
+
return Array.from((_b = (_a = event.dataTransfer) == null ? void 0 : _a.files) != null ? _b : []);
|
36
36
|
}
|
37
37
|
var facet = defineFacet({
|
38
38
|
parent: editorEventFacet,
|
39
39
|
singleton: true,
|
40
40
|
reducer: (handlers) => {
|
41
|
-
const
|
42
|
-
|
41
|
+
const dropHandler = (view, event) => {
|
42
|
+
const position = view.posAtCoords({ left: event.x, top: event.y });
|
43
|
+
if (!position) {
|
44
|
+
return false;
|
45
|
+
}
|
46
|
+
const pos = position.inside > 0 ? position.inside : position.pos;
|
47
|
+
return handleEvent(
|
48
|
+
view,
|
49
|
+
event,
|
50
|
+
handlers.map((handler) => (options) => handler({ ...options, pos })),
|
51
|
+
getFiles
|
52
|
+
);
|
43
53
|
};
|
44
|
-
return ["
|
54
|
+
return ["drop", dropHandler];
|
45
55
|
}
|
46
56
|
});
|
47
57
|
|
48
|
-
// src/file/file-
|
58
|
+
// src/file/file-paste-handler.ts
|
49
59
|
import {
|
50
60
|
defineFacet as defineFacet2,
|
51
61
|
defineFacetPayload as defineFacetPayload2,
|
52
62
|
editorEventFacet as editorEventFacet2
|
53
63
|
} from "@prosekit/core";
|
54
|
-
function
|
64
|
+
function defineFilePasteHandler(handler) {
|
55
65
|
return defineFacetPayload2(facet2, [handler]);
|
56
66
|
}
|
57
67
|
function getFiles2(event) {
|
58
68
|
var _a, _b;
|
59
|
-
return Array.from((_b = (_a = event.
|
69
|
+
return Array.from((_b = (_a = event.clipboardData) == null ? void 0 : _a.files) != null ? _b : []);
|
60
70
|
}
|
61
71
|
var facet2 = defineFacet2({
|
62
72
|
parent: editorEventFacet2,
|
63
73
|
singleton: true,
|
64
74
|
reducer: (handlers) => {
|
65
|
-
const
|
66
|
-
|
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
|
-
);
|
75
|
+
const pasteHandler = (view, event) => {
|
76
|
+
return handleEvent(view, event, handlers, getFiles2);
|
77
77
|
};
|
78
|
-
return ["
|
78
|
+
return ["paste", pasteHandler];
|
79
79
|
}
|
80
80
|
});
|
81
81
|
|
@@ -1,5 +1,7 @@
|
|
1
1
|
// src/gap-cursor/gap-cursor.ts
|
2
|
-
import {
|
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() {
|
@@ -3,7 +3,9 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/heading/heading.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/heading/heading-commands.ts
|
9
11
|
import {
|
@@ -65,12 +67,14 @@ function defineHeadingKeymap() {
|
|
65
67
|
"mod-4": toggleHeadingKeybinding(4),
|
66
68
|
"mod-5": toggleHeadingKeybinding(5),
|
67
69
|
"mod-6": toggleHeadingKeybinding(6),
|
68
|
-
Backspace: backspaceUnsetHeading
|
70
|
+
"Backspace": backspaceUnsetHeading
|
69
71
|
});
|
70
72
|
}
|
71
73
|
|
72
74
|
// src/heading/heading-spec.ts
|
73
|
-
import {
|
75
|
+
import {
|
76
|
+
defineNodeSpec
|
77
|
+
} from "@prosekit/core";
|
74
78
|
function defineHeadingSpec() {
|
75
79
|
return defineNodeSpec({
|
76
80
|
name: "heading",
|
@@ -3,11 +3,19 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/horizontal-rule/horizontal-rule.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union as union2
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/horizontal-rule/horizontal-rule-commands.ts
|
9
|
-
import {
|
10
|
-
|
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 {
|
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 {
|
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 {
|
2
|
+
import {
|
3
|
+
union
|
4
|
+
} from "@prosekit/core";
|
3
5
|
|
4
6
|
// src/image/image-commands.ts
|
5
|
-
import {
|
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 {
|
20
|
+
import {
|
21
|
+
defineNodeSpec
|
22
|
+
} from "@prosekit/core";
|
16
23
|
function defineImageSpec() {
|
17
24
|
return defineNodeSpec({
|
18
25
|
name: "image",
|
@@ -3,10 +3,15 @@ import {
|
|
3
3
|
} from "./chunk-LAQZC3ZM.js";
|
4
4
|
|
5
5
|
// src/italic/italic.ts
|
6
|
-
import {
|
6
|
+
import {
|
7
|
+
union
|
8
|
+
} from "@prosekit/core";
|
7
9
|
|
8
10
|
// src/italic/italic-commands.ts
|
9
|
-
import {
|
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 {
|
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 {
|
42
|
+
import {
|
43
|
+
defineMarkSpec
|
44
|
+
} from "@prosekit/core";
|
35
45
|
function defineItalicSpec() {
|
36
46
|
return defineMarkSpec({
|
37
47
|
name: "italic",
|
@@ -6,10 +6,15 @@ import {
|
|
6
6
|
import { ListDOMSerializer as ListDOMSerializer2 } from "prosemirror-flat-list";
|
7
7
|
|
8
8
|
// src/list/list.ts
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
union as union2
|
11
|
+
} from "@prosekit/core";
|
10
12
|
|
11
13
|
// src/list/list-commands.ts
|
12
|
-
import {
|
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 {
|
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 {
|
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() {
|
@@ -85,7 +95,9 @@ function defineListPlugins() {
|
|
85
95
|
}
|
86
96
|
|
87
97
|
// src/list/list-spec.ts
|
88
|
-
import {
|
98
|
+
import {
|
99
|
+
defineNodeSpec
|
100
|
+
} from "@prosekit/core";
|
89
101
|
import { createListSpec } from "prosemirror-flat-list";
|
90
102
|
function defineListSpec() {
|
91
103
|
return defineNodeSpec({
|
@@ -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 {
|
3
|
-
|
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 {
|
14
|
-
|
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 {
|
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 {
|
39
|
-
|
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 {
|
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,12 @@
|
|
1
1
|
// src/mod-click-prevention/index.ts
|
2
|
-
import {
|
3
|
-
|
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-
|
3
|
+
} from "./chunk-KNFGQ3MV.js";
|
4
4
|
|
5
5
|
// src/placeholder/index.ts
|
6
|
-
import {
|
7
|
-
|
8
|
-
|
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
|
}
|
@@ -50,7 +60,7 @@ function createPlaceholderDecoration(state, placeholderText) {
|
|
50
60
|
if (node.content.size > 0) return null;
|
51
61
|
const before = $pos.before();
|
52
62
|
return Decoration.node(before, before + node.nodeSize, {
|
53
|
-
class: "prosekit-placeholder",
|
63
|
+
"class": "prosekit-placeholder",
|
54
64
|
"data-placeholder": placeholderText
|
55
65
|
});
|
56
66
|
}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
// src/readonly/index.ts
|
2
2
|
import { definePlugin } from "@prosekit/core";
|
3
|
-
import {
|
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
|
-
|
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);
|
@@ -4,12 +4,12 @@ import {
|
|
4
4
|
|
5
5
|
// src/strike/index.ts
|
6
6
|
import {
|
7
|
+
canUseRegexLookbehind,
|
7
8
|
defineCommands,
|
8
9
|
defineKeymap,
|
9
10
|
defineMarkSpec,
|
10
|
-
union,
|
11
11
|
toggleMark,
|
12
|
-
|
12
|
+
union
|
13
13
|
} from "@prosekit/core";
|
14
14
|
function defineStrikeSpec() {
|
15
15
|
return defineMarkSpec({
|
@@ -22,5 +22,5 @@ export { TableCellSpecExtension } from './_tsup-dts-rollup.js';
|
|
22
22
|
export { TableHeaderCellSpecExtension } from './_tsup-dts-rollup.js';
|
23
23
|
export { TableRowSpecExtension } from './_tsup-dts-rollup.js';
|
24
24
|
export { TableSpecExtension } from './_tsup-dts-rollup.js';
|
25
|
-
export { isCellSelection } from './_tsup-dts-rollup.js';
|
26
25
|
export { findTable } from './_tsup-dts-rollup.js';
|
26
|
+
export { isCellSelection } from './_tsup-dts-rollup.js';
|
@@ -1,10 +1,15 @@
|
|
1
1
|
// src/virtual-selection/index.ts
|
2
|
-
import {
|
2
|
+
import {
|
3
|
+
definePlugin
|
4
|
+
} from "@prosekit/core";
|
3
5
|
import {
|
4
6
|
PluginKey,
|
5
7
|
ProseMirrorPlugin
|
6
8
|
} from "@prosekit/pm/state";
|
7
|
-
import {
|
9
|
+
import {
|
10
|
+
Decoration,
|
11
|
+
DecorationSet
|
12
|
+
} from "@prosekit/pm/view";
|
8
13
|
function defineVirtualSelection() {
|
9
14
|
return definePlugin(virtualSelectionPlugin);
|
10
15
|
}
|
@@ -6,15 +6,17 @@ import {
|
|
6
6
|
} from "@prosekit/core";
|
7
7
|
|
8
8
|
// src/yjs/yjs-commands.ts
|
9
|
-
import {
|
9
|
+
import {
|
10
|
+
defineCommands
|
11
|
+
} from "@prosekit/core";
|
10
12
|
|
11
13
|
// src/yjs/yjs-undo-plugin.ts
|
12
14
|
import { definePlugin } from "@prosekit/core";
|
13
15
|
import {
|
14
|
-
|
15
|
-
yUndoPlugin as originalYUndoPlugin,
|
16
|
+
redo as yRedo,
|
16
17
|
undo as yUndo,
|
17
|
-
|
18
|
+
yUndoPlugin as originalYUndoPlugin,
|
19
|
+
yUndoPluginKey
|
18
20
|
} from "y-prosemirror";
|
19
21
|
function fixYUndoPlugin(yUndoPluginInstance) {
|
20
22
|
const originalUndoPluginView = yUndoPluginInstance.spec.view;
|
@@ -86,7 +88,9 @@ function defineYjsCommands() {
|
|
86
88
|
}
|
87
89
|
|
88
90
|
// src/yjs/yjs-cursor-plugin.ts
|
89
|
-
import {
|
91
|
+
import {
|
92
|
+
definePlugin as definePlugin2
|
93
|
+
} from "@prosekit/core";
|
90
94
|
import { yCursorPlugin } from "y-prosemirror";
|
91
95
|
function defineYjsCursorPlugin(options) {
|
92
96
|
const { awareness, ...rest } = options;
|
@@ -110,7 +114,9 @@ function defineYjsKeymap() {
|
|
110
114
|
}
|
111
115
|
|
112
116
|
// src/yjs/yjs-sync-plugin.ts
|
113
|
-
import {
|
117
|
+
import {
|
118
|
+
definePlugin as definePlugin3
|
119
|
+
} from "@prosekit/core";
|
114
120
|
import { ySyncPlugin } from "y-prosemirror";
|
115
121
|
function defineYjsSyncPlugin(options) {
|
116
122
|
const { fragment, ...rest } = options;
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/extensions",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.7.
|
4
|
+
"version": "0.7.23",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -216,11 +216,11 @@
|
|
216
216
|
"prosemirror-dropcursor": "^1.8.1",
|
217
217
|
"prosemirror-flat-list": "^0.5.4",
|
218
218
|
"prosemirror-gapcursor": "^1.3.2",
|
219
|
-
"prosemirror-highlight": "^0.
|
219
|
+
"prosemirror-highlight": "^0.11.0",
|
220
220
|
"prosemirror-search": "^1.0.0",
|
221
221
|
"prosemirror-tables": "^1.6.1",
|
222
|
-
"shiki": "^1.24.
|
223
|
-
"@prosekit/core": "^0.7.
|
222
|
+
"shiki": "^1.24.2",
|
223
|
+
"@prosekit/core": "^0.7.14",
|
224
224
|
"@prosekit/pm": "^0.1.9"
|
225
225
|
},
|
226
226
|
"peerDependencies": {
|
@@ -244,15 +244,15 @@
|
|
244
244
|
}
|
245
245
|
},
|
246
246
|
"devDependencies": {
|
247
|
-
"@vitest/browser": "^2.1.
|
247
|
+
"@vitest/browser": "^2.1.8",
|
248
248
|
"just-pick": "^4.2.0",
|
249
|
-
"loro-crdt": "^1.
|
249
|
+
"loro-crdt": "^1.2.2",
|
250
250
|
"loro-prosemirror": "^0.2.0",
|
251
251
|
"tsup": "^8.3.5",
|
252
|
-
"type-fest": "^4.
|
253
|
-
"typescript": "
|
254
|
-
"vitest": "^2.1.
|
255
|
-
"y-prosemirror": "^1.2.
|
252
|
+
"type-fest": "^4.30.2",
|
253
|
+
"typescript": "~5.6.3",
|
254
|
+
"vitest": "^2.1.8",
|
255
|
+
"y-prosemirror": "^1.2.15",
|
256
256
|
"y-protocols": "^1.0.6",
|
257
257
|
"yjs": "^13.6.20",
|
258
258
|
"@prosekit/dev": "0.0.0"
|
@@ -1,11 +1,11 @@
|
|
1
1
|
// src/enter-rule/index.ts
|
2
2
|
import {
|
3
|
-
OBJECT_REPLACEMENT_CHARACTER,
|
4
3
|
defineFacet,
|
5
4
|
defineFacetPayload,
|
6
5
|
getNodeType,
|
7
6
|
isTextSelection,
|
8
7
|
maybeRun,
|
8
|
+
OBJECT_REPLACEMENT_CHARACTER,
|
9
9
|
pluginFacet
|
10
10
|
} from "@prosekit/core";
|
11
11
|
import { keydownHandler } from "@prosekit/pm/keymap";
|