@prosekit/extensions 0.0.0-next-20240715071354 → 0.0.0-next-20240724155246
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/_tsup-dts-rollup.d.ts +825 -206
- package/dist/gap-cursor/style.css +23 -0
- package/dist/list/style.css +1 -1
- package/dist/prosekit-extensions-gap-cursor.d.ts +2 -0
- package/dist/prosekit-extensions-gap-cursor.js +11 -0
- package/dist/prosekit-extensions-link.js +3 -3
- package/dist/prosekit-extensions-list.d.ts +4 -4
- package/dist/prosekit-extensions-list.js +30 -20
- package/dist/prosekit-extensions-table.js +0 -1
- package/dist/prosekit-extensions-text-align.d.ts +1 -0
- package/package.json +22 -9
@@ -0,0 +1,23 @@
|
|
1
|
+
/* src/gap-cursor/style.css */
|
2
|
+
.ProseMirror-gapcursor {
|
3
|
+
display: none;
|
4
|
+
pointer-events: none;
|
5
|
+
position: relative;
|
6
|
+
}
|
7
|
+
.ProseMirror-gapcursor:after {
|
8
|
+
content: "";
|
9
|
+
display: block;
|
10
|
+
position: absolute;
|
11
|
+
top: -2px;
|
12
|
+
width: 20px;
|
13
|
+
border-top: 1px solid currentColor;
|
14
|
+
animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
|
15
|
+
}
|
16
|
+
@keyframes ProseMirror-cursor-blink {
|
17
|
+
to {
|
18
|
+
visibility: hidden;
|
19
|
+
}
|
20
|
+
}
|
21
|
+
.ProseMirror-focused .ProseMirror-gapcursor {
|
22
|
+
display: block;
|
23
|
+
}
|
package/dist/list/style.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
/* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.
|
1
|
+
/* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.4/node_modules/prosemirror-flat-list/dist/style.css */
|
2
2
|
.prosemirror-flat-list {
|
3
3
|
padding: 0;
|
4
4
|
margin-top: 0;
|
@@ -0,0 +1,11 @@
|
|
1
|
+
// src/gap-cursor/index.ts
|
2
|
+
import { definePlugin } from "@prosekit/core";
|
3
|
+
import { gapCursor } from "prosemirror-gapcursor";
|
4
|
+
import { GapCursor } from "prosemirror-gapcursor";
|
5
|
+
function defineGapCursor() {
|
6
|
+
return definePlugin(() => gapCursor());
|
7
|
+
}
|
8
|
+
export {
|
9
|
+
GapCursor,
|
10
|
+
defineGapCursor
|
11
|
+
};
|
@@ -41,6 +41,9 @@ function defineLinkSpec() {
|
|
41
41
|
return defineMarkSpec({
|
42
42
|
name: "link",
|
43
43
|
inclusive: false,
|
44
|
+
attrs: {
|
45
|
+
href: {}
|
46
|
+
},
|
44
47
|
parseDOM: [
|
45
48
|
{
|
46
49
|
tag: "a[href]",
|
@@ -51,9 +54,6 @@ function defineLinkSpec() {
|
|
51
54
|
}
|
52
55
|
}
|
53
56
|
],
|
54
|
-
attrs: {
|
55
|
-
href: {}
|
56
|
-
},
|
57
57
|
toDOM(node) {
|
58
58
|
const { href } = node.attrs;
|
59
59
|
return ["a", { href }, 0];
|
@@ -1,13 +1,13 @@
|
|
1
|
-
export { defineListSpec } from './_tsup-dts-rollup';
|
2
|
-
export { defineListPlugins } from './_tsup-dts-rollup';
|
3
|
-
export { defineListInputRules } from './_tsup-dts-rollup';
|
4
1
|
export { defineList } from './_tsup-dts-rollup';
|
5
2
|
export { ListDOMSerializer } from './_tsup-dts-rollup';
|
6
3
|
export { DedentListOptions } from './_tsup-dts-rollup';
|
7
4
|
export { IndentListOptions } from './_tsup-dts-rollup';
|
8
|
-
export { ListAttributes } from './_tsup-dts-rollup';
|
9
5
|
export { ToggleCollapsedOptions } from './_tsup-dts-rollup';
|
10
6
|
export { UnwrapListOptions } from './_tsup-dts-rollup';
|
11
7
|
export { WrapInListGetAttrs } from './_tsup-dts-rollup';
|
12
8
|
export { defineListCommands_alias_1 as defineListCommands } from './_tsup-dts-rollup';
|
9
|
+
export { defineListInputRules } from './_tsup-dts-rollup';
|
13
10
|
export { defineListKeymap } from './_tsup-dts-rollup';
|
11
|
+
export { defineListPlugins } from './_tsup-dts-rollup';
|
12
|
+
export { defineListSpec } from './_tsup-dts-rollup';
|
13
|
+
export { ListAttrs } from './_tsup-dts-rollup';
|
@@ -3,16 +3,7 @@ import {
|
|
3
3
|
} from "./chunk-LVMTQOWG.js";
|
4
4
|
|
5
5
|
// src/list/index.ts
|
6
|
-
import {
|
7
|
-
defineNodeSpec,
|
8
|
-
definePlugin,
|
9
|
-
union
|
10
|
-
} from "@prosekit/core";
|
11
|
-
import {
|
12
|
-
createListPlugins,
|
13
|
-
createListSpec,
|
14
|
-
listInputRules
|
15
|
-
} from "prosemirror-flat-list";
|
6
|
+
import { union as union2 } from "@prosekit/core";
|
16
7
|
|
17
8
|
// src/list/commands.ts
|
18
9
|
import { defineCommands, insertNode } from "@prosekit/core";
|
@@ -43,6 +34,13 @@ function defineListCommands() {
|
|
43
34
|
});
|
44
35
|
}
|
45
36
|
|
37
|
+
// src/list/input-rules.ts
|
38
|
+
import { union } from "@prosekit/core";
|
39
|
+
import { listInputRules } from "prosemirror-flat-list";
|
40
|
+
function defineListInputRules() {
|
41
|
+
return union(listInputRules.map(defineInputRule));
|
42
|
+
}
|
43
|
+
|
46
44
|
// src/list/keymap.ts
|
47
45
|
import { defineKeymap } from "@prosekit/core";
|
48
46
|
import { chainCommands, deleteSelection } from "@prosekit/pm/commands";
|
@@ -61,30 +59,42 @@ var backspaceCommand = chainCommands(
|
|
61
59
|
joinListUp,
|
62
60
|
joinCollapsedListBackward
|
63
61
|
);
|
62
|
+
var dedentListCommand = createDedentListCommand();
|
63
|
+
var indentListCommand = createIndentListCommand();
|
64
64
|
var listKeymap = {
|
65
65
|
Enter: enterCommand,
|
66
66
|
Backspace: backspaceCommand,
|
67
67
|
Delete: deleteCommand,
|
68
|
-
"Mod-
|
69
|
-
"Mod-
|
68
|
+
"Mod-]": indentListCommand,
|
69
|
+
"Mod-[": dedentListCommand,
|
70
|
+
Tab: indentListCommand,
|
71
|
+
"Shift-Tab": dedentListCommand
|
70
72
|
};
|
71
73
|
function defineListKeymap() {
|
72
74
|
return defineKeymap(listKeymap);
|
73
75
|
}
|
74
76
|
|
75
|
-
// src/list/
|
76
|
-
import {
|
77
|
-
|
78
|
-
return defineNodeSpec({ ...createListSpec(), name: "list" });
|
79
|
-
}
|
77
|
+
// src/list/plugins.ts
|
78
|
+
import { definePlugin } from "@prosekit/core";
|
79
|
+
import { createListPlugins } from "prosemirror-flat-list";
|
80
80
|
function defineListPlugins() {
|
81
81
|
return definePlugin(({ schema }) => createListPlugins({ schema }));
|
82
82
|
}
|
83
|
-
|
84
|
-
|
83
|
+
|
84
|
+
// src/list/spec.ts
|
85
|
+
import { defineNodeSpec } from "@prosekit/core";
|
86
|
+
import { createListSpec } from "prosemirror-flat-list";
|
87
|
+
function defineListSpec() {
|
88
|
+
return defineNodeSpec({
|
89
|
+
...createListSpec(),
|
90
|
+
name: "list"
|
91
|
+
});
|
85
92
|
}
|
93
|
+
|
94
|
+
// src/list/index.ts
|
95
|
+
import { ListDOMSerializer } from "prosemirror-flat-list";
|
86
96
|
function defineList() {
|
87
|
-
return
|
97
|
+
return union2([
|
88
98
|
defineListSpec(),
|
89
99
|
defineListPlugins(),
|
90
100
|
defineListKeymap(),
|
@@ -3,3 +3,4 @@ export { defineTextAlignCommands } from './_tsup-dts-rollup';
|
|
3
3
|
export { defineTextAlignKeymap } from './_tsup-dts-rollup';
|
4
4
|
export { defineTextAlign } from './_tsup-dts-rollup';
|
5
5
|
export { TextAlignOptions } from './_tsup-dts-rollup';
|
6
|
+
export { TextAlignCommandTyping } from './_tsup-dts-rollup';
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosekit/extensions",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.0.0-next-
|
4
|
+
"version": "0.0.0-next-20240724155246",
|
5
5
|
"private": false,
|
6
6
|
"author": {
|
7
7
|
"name": "ocavue",
|
@@ -73,6 +73,14 @@
|
|
73
73
|
"import": "./dist/prosekit-extensions-enter-rule.js",
|
74
74
|
"default": "./dist/prosekit-extensions-enter-rule.js"
|
75
75
|
},
|
76
|
+
"./gap-cursor": {
|
77
|
+
"types": "./dist/prosekit-extensions-gap-cursor.d.ts",
|
78
|
+
"import": "./dist/prosekit-extensions-gap-cursor.js",
|
79
|
+
"default": "./dist/prosekit-extensions-gap-cursor.js"
|
80
|
+
},
|
81
|
+
"./gap-cursor/style.css": {
|
82
|
+
"default": "./dist/gap-cursor/style.css"
|
83
|
+
},
|
76
84
|
"./heading": {
|
77
85
|
"types": "./dist/prosekit-extensions-heading.d.ts",
|
78
86
|
"import": "./dist/prosekit-extensions-heading.js",
|
@@ -180,19 +188,21 @@
|
|
180
188
|
"dependencies": {
|
181
189
|
"prosemirror-changeset": "^2.2.1",
|
182
190
|
"prosemirror-dropcursor": "^1.8.1",
|
183
|
-
"prosemirror-flat-list": "^0.5.
|
191
|
+
"prosemirror-flat-list": "^0.5.4",
|
192
|
+
"prosemirror-gapcursor": "^1.3.2",
|
184
193
|
"prosemirror-highlight": "^0.8.0",
|
185
194
|
"prosemirror-search": "^1.0.0",
|
186
|
-
"prosemirror-tables": "^1.
|
187
|
-
"shiki": "^1.
|
188
|
-
"@prosekit/
|
189
|
-
"@prosekit/
|
195
|
+
"prosemirror-tables": "^1.4.0",
|
196
|
+
"shiki": "^1.11.1",
|
197
|
+
"@prosekit/pm": "^0.0.0-next-20240724155246",
|
198
|
+
"@prosekit/core": "^0.0.0-next-20240724155246"
|
190
199
|
},
|
191
200
|
"devDependencies": {
|
192
|
-
"@vitest/browser": "^2.0.
|
193
|
-
"tsup": "^8.
|
201
|
+
"@vitest/browser": "^2.0.4",
|
202
|
+
"tsup": "^8.2.2",
|
203
|
+
"type-fest": "^4.23.0",
|
194
204
|
"typescript": "^5.5.3",
|
195
|
-
"vitest": "^2.0.
|
205
|
+
"vitest": "^2.0.4",
|
196
206
|
"@prosekit/dev": "0.0.0"
|
197
207
|
},
|
198
208
|
"scripts": {
|
@@ -229,6 +239,9 @@
|
|
229
239
|
"enter-rule": [
|
230
240
|
"./dist/prosekit-extensions-enter-rule.d.ts"
|
231
241
|
],
|
242
|
+
"gap-cursor": [
|
243
|
+
"./dist/prosekit-extensions-gap-cursor.d.ts"
|
244
|
+
],
|
232
245
|
"heading": [
|
233
246
|
"./dist/prosekit-extensions-heading.d.ts"
|
234
247
|
],
|