@prosekit/extensions 0.8.0 → 0.9.1

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 +1 -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 +6 -3
  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 +13 -9
  10. package/dist/loro/style.js +0 -0
  11. package/dist/mark-rule-wEOcDt6i.js +160 -0
  12. package/dist/placeholder/style.css +3 -3
  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 +126 -174
  16. package/dist/prosekit-extensions-blockquote.d.ts +48 -8
  17. package/dist/prosekit-extensions-blockquote.js +64 -78
  18. package/dist/prosekit-extensions-bold.d.ts +54 -8
  19. package/dist/prosekit-extensions-bold.js +61 -73
  20. package/dist/prosekit-extensions-code-block.d.ts +159 -20
  21. package/dist/prosekit-extensions-code-block.js +201 -184
  22. package/dist/prosekit-extensions-code.d.ts +54 -8
  23. package/dist/prosekit-extensions-code.js +44 -56
  24. package/dist/prosekit-extensions-commit.d.ts +52 -4
  25. package/dist/prosekit-extensions-commit.js +140 -183
  26. package/dist/prosekit-extensions-doc.d.ts +19 -2
  27. package/dist/prosekit-extensions-doc.js +14 -12
  28. package/dist/prosekit-extensions-drop-cursor.d.ts +35 -3
  29. package/dist/prosekit-extensions-drop-cursor.js +14 -8
  30. package/dist/prosekit-extensions-enter-rule.d.ts +105 -5
  31. package/dist/prosekit-extensions-enter-rule.js +3 -8
  32. package/dist/prosekit-extensions-file.d.ts +129 -8
  33. package/dist/prosekit-extensions-file.js +124 -132
  34. package/dist/prosekit-extensions-gap-cursor.d.ts +26 -2
  35. package/dist/prosekit-extensions-gap-cursor.js +21 -9
  36. package/dist/prosekit-extensions-hard-break.d.ts +53 -0
  37. package/dist/prosekit-extensions-hard-break.js +58 -0
  38. package/dist/prosekit-extensions-heading.d.ts +63 -9
  39. package/dist/prosekit-extensions-heading.js +121 -95
  40. package/dist/prosekit-extensions-horizontal-rule.d.ts +38 -8
  41. package/dist/prosekit-extensions-horizontal-rule.js +53 -71
  42. package/dist/prosekit-extensions-image.d.ts +50 -7
  43. package/dist/prosekit-extensions-image.js +71 -62
  44. package/dist/prosekit-extensions-input-rule.d.ts +129 -6
  45. package/dist/prosekit-extensions-input-rule.js +3 -14
  46. package/dist/prosekit-extensions-italic.d.ts +54 -8
  47. package/dist/prosekit-extensions-italic.js +51 -63
  48. package/dist/prosekit-extensions-link.d.ts +62 -10
  49. package/dist/prosekit-extensions-link.js +95 -100
  50. package/dist/prosekit-extensions-list.d.ts +104 -17
  51. package/dist/prosekit-extensions-list.js +115 -158
  52. package/dist/prosekit-extensions-loro.d.ts +69 -11
  53. package/dist/prosekit-extensions-loro.js +49 -77
  54. package/dist/prosekit-extensions-mark-rule.d.ts +37 -2
  55. package/dist/prosekit-extensions-mark-rule.js +3 -6
  56. package/dist/prosekit-extensions-mention.d.ts +39 -4
  57. package/dist/prosekit-extensions-mention.js +52 -50
  58. package/dist/prosekit-extensions-mod-click-prevention.d.ts +17 -2
  59. package/dist/prosekit-extensions-mod-click-prevention.js +20 -16
  60. package/dist/prosekit-extensions-paragraph.d.ts +60 -7
  61. package/dist/prosekit-extensions-paragraph.js +46 -45
  62. package/dist/prosekit-extensions-placeholder.d.ts +33 -2
  63. package/dist/prosekit-extensions-placeholder.js +39 -56
  64. package/dist/prosekit-extensions-readonly.d.ts +10 -1
  65. package/dist/prosekit-extensions-readonly.js +13 -14
  66. package/dist/prosekit-extensions-search.d.ts +74 -3
  67. package/dist/prosekit-extensions-search.js +48 -47
  68. package/dist/prosekit-extensions-strike.d.ts +47 -8
  69. package/dist/prosekit-extensions-strike.js +44 -49
  70. package/dist/prosekit-extensions-table.d.ts +231 -26
  71. package/dist/prosekit-extensions-table.js +3 -34
  72. package/dist/prosekit-extensions-text-align.d.ts +71 -8
  73. package/dist/prosekit-extensions-text-align.js +63 -44
  74. package/dist/prosekit-extensions-text.d.ts +19 -2
  75. package/dist/prosekit-extensions-text.js +13 -11
  76. package/dist/prosekit-extensions-underline.d.ts +43 -7
  77. package/dist/prosekit-extensions-underline.js +33 -37
  78. package/dist/prosekit-extensions-virtual-selection.d.ts +21 -2
  79. package/dist/prosekit-extensions-virtual-selection.js +49 -52
  80. package/dist/prosekit-extensions-yjs.d.ts +90 -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 +4 -3
  84. package/dist/search/style.js +0 -0
  85. package/dist/shiki-highlighter-chunk-CZGvZlhf.d.ts +18 -0
  86. package/dist/shiki-highlighter-chunk.d.ts +2 -0
  87. package/dist/shiki-highlighter-chunk.js +32 -39
  88. package/dist/table/style.css +10 -13
  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 +9 -8
  94. package/dist/yjs/style.js +0 -0
  95. package/package.json +81 -54
  96. package/dist/_tsup-dts-rollup.d.ts +0 -2459
  97. package/dist/chunk-6UYLCVBX.js +0 -185
  98. package/dist/chunk-D54VSLLS.js +0 -105
  99. package/dist/chunk-I2UMHK3L.js +0 -99
  100. package/dist/chunk-QVFEYPQ6.js +0 -306
@@ -0,0 +1,287 @@
1
+ import { defaultBlockAt, defineCommands, defineNodeSpec, definePlugin, findParentNode, getNodeType, insertNode, union } from "@prosekit/core";
2
+ import { TextSelection } from "@prosekit/pm/state";
3
+ import { CellSelection, TableMap, addColumnAfter, addColumnBefore, addRowAfter, addRowBefore, cellAround, cellNear, columnResizing, deleteCellSelection, deleteColumn, deleteRow, deleteTable, inSameTable, mergeCells, splitCell, tableEditing, tableNodes } from "prosemirror-tables";
4
+
5
+ //#region src/table/table-utils.ts
6
+ /**
7
+ * Checks if the given object is a `CellSelection` instance.
8
+ *
9
+ * @public
10
+ */
11
+ function isCellSelection(value) {
12
+ return value instanceof CellSelection;
13
+ }
14
+ /**
15
+ * Find the closest table node.
16
+ *
17
+ * @internal
18
+ */
19
+ function findTable($pos) {
20
+ return findParentNode((node) => node.type.spec.tableRole === "table", $pos);
21
+ }
22
+ /**
23
+ * Try to find the anchor and head cell in the same table by using the given
24
+ * anchor and head as hit points, or fallback to the selection's anchor and
25
+ * head.
26
+ *
27
+ * @internal
28
+ */
29
+ function findCellRange(selection, anchorHit, headHit) {
30
+ if (anchorHit == null && headHit == null && isCellSelection(selection)) return [selection.$anchorCell, selection.$headCell];
31
+ const anchor = anchorHit ?? headHit ?? selection.anchor;
32
+ const head = headHit ?? anchorHit ?? selection.head;
33
+ const doc = selection.$head.doc;
34
+ const $anchorCell = findCellPos(doc, anchor);
35
+ const $headCell = findCellPos(doc, head);
36
+ if ($anchorCell && $headCell && inSameTable($anchorCell, $headCell)) return [$anchorCell, $headCell];
37
+ }
38
+ /**
39
+ * Try to find a resolved pos of a cell by using the given pos as a hit point.
40
+ *
41
+ * @internal
42
+ */
43
+ function findCellPos(doc, pos) {
44
+ const $pos = doc.resolve(pos);
45
+ return cellAround($pos) || cellNear($pos);
46
+ }
47
+
48
+ //#endregion
49
+ //#region src/table/table-commands.ts
50
+ function createEmptyTable(schema, row, col, header) {
51
+ const tableType = getNodeType(schema, "table");
52
+ const tableRowType = getNodeType(schema, "tableRow");
53
+ const tableCellType = getNodeType(schema, "tableCell");
54
+ const tableHeaderCellType = getNodeType(schema, "tableHeaderCell");
55
+ if (header) {
56
+ const headerCell = tableHeaderCellType.createAndFill();
57
+ const headerCells = repeat(headerCell, col);
58
+ const headerRow = tableRowType.createAndFill(null, headerCells);
59
+ const bodyCell = tableCellType.createAndFill();
60
+ const bodyCells = repeat(bodyCell, col);
61
+ const bodyRow = tableRowType.createAndFill(null, bodyCells);
62
+ const bodyRows = repeat(bodyRow, row - 1);
63
+ return tableType.createAndFill(null, [headerRow, ...bodyRows]);
64
+ } else {
65
+ const bodyCell = tableCellType.createAndFill();
66
+ const bodyCells = repeat(bodyCell, col);
67
+ const bodyRow = tableRowType.createAndFill(null, bodyCells);
68
+ const bodyRows = repeat(bodyRow, row);
69
+ return tableType.createAndFill(null, bodyRows);
70
+ }
71
+ }
72
+ function repeat(node, length) {
73
+ return Array(length).fill(node);
74
+ }
75
+ /**
76
+ * Insert a table node with the given number of rows and columns, and optionally
77
+ * a header row.
78
+ *
79
+ * @param options
80
+ *
81
+ * @public
82
+ */
83
+ function insertTable(options) {
84
+ return (state, dispatch, view) => {
85
+ const { row, col, header = false } = options;
86
+ const table = createEmptyTable(state.schema, row, col, header);
87
+ return insertNode({ node: table })(state, dispatch, view);
88
+ };
89
+ }
90
+ /**
91
+ * When the selection is in a table node, create a default block after the table
92
+ * table, and move the cursor there.
93
+ *
94
+ * @public
95
+ */
96
+ const exitTable = (state, dispatch) => {
97
+ const { $head, $anchor } = state.selection;
98
+ if (!$head.sameParent($anchor)) return false;
99
+ let tableStart = -1;
100
+ let tableDepth = -1;
101
+ for (let depth = $head.depth; depth >= 0; depth--) {
102
+ const node$1 = $head.node(depth);
103
+ if (node$1.type.spec.tableRole === "table") {
104
+ tableStart = $head.before(depth);
105
+ tableDepth = depth;
106
+ }
107
+ }
108
+ if (tableStart < 0 || tableDepth <= 0) return false;
109
+ const above = $head.node(tableDepth - 1);
110
+ const after = $head.indexAfter(tableDepth - 1);
111
+ const type = defaultBlockAt(above.contentMatchAt(after));
112
+ const node = type?.createAndFill();
113
+ if (!type || !node || !above.canReplaceWith(after, after, type)) return false;
114
+ if (dispatch) {
115
+ const pos = $head.after(tableDepth);
116
+ const tr = state.tr.replaceWith(pos, pos, node);
117
+ tr.setSelection(TextSelection.near(tr.doc.resolve(pos), 1));
118
+ dispatch(tr.scrollIntoView());
119
+ }
120
+ return true;
121
+ };
122
+ /**
123
+ * @public
124
+ */
125
+ function selectTableColumn(options) {
126
+ return (state, dispatch) => {
127
+ const range = findCellRange(state.selection, options?.anchor, options?.head);
128
+ if (!range) return false;
129
+ if (dispatch) {
130
+ const [$anchorCell, $headCell] = range;
131
+ const selection = CellSelection.colSelection($anchorCell, $headCell);
132
+ dispatch(state.tr.setSelection(selection));
133
+ }
134
+ return true;
135
+ };
136
+ }
137
+ /**
138
+ * @public
139
+ */
140
+ function selectTableRow(options) {
141
+ return (state, dispatch) => {
142
+ const range = findCellRange(state.selection, options?.anchor, options?.head);
143
+ if (!range) return false;
144
+ if (dispatch) {
145
+ const [$anchorCell, $headCell] = range;
146
+ const selection = CellSelection.rowSelection($anchorCell, $headCell);
147
+ dispatch(state.tr.setSelection(selection));
148
+ }
149
+ return true;
150
+ };
151
+ }
152
+ /**
153
+ * @public
154
+ */
155
+ function selectTableCell(options) {
156
+ return (state, dispatch) => {
157
+ const $cellPos = findCellPos(state.doc, options?.pos ?? state.selection.anchor);
158
+ if (!$cellPos) return false;
159
+ if (dispatch) {
160
+ const selection = new CellSelection($cellPos);
161
+ dispatch(state.tr.setSelection(selection));
162
+ }
163
+ return true;
164
+ };
165
+ }
166
+ /**
167
+ * @public
168
+ */
169
+ function selectTable(options) {
170
+ return (state, dispatch) => {
171
+ const $pos = options?.pos ? state.doc.resolve(options.pos) : state.selection.$anchor;
172
+ const table = findTable($pos);
173
+ if (!table) return false;
174
+ const map = TableMap.get(table.node);
175
+ if (map.map.length === 0) return false;
176
+ if (dispatch) {
177
+ let tr = state.tr;
178
+ const firstCellPosInTable = map.map[0];
179
+ const lastCellPosInTable = map.map[map.map.length - 1];
180
+ const firstCellPos = table.pos + firstCellPosInTable + 1;
181
+ const lastCellPos = table.pos + lastCellPosInTable + 1;
182
+ const $firstCellPos = tr.doc.resolve(firstCellPos);
183
+ const $lastCellPos = tr.doc.resolve(lastCellPos);
184
+ const selection = new CellSelection($firstCellPos, $lastCellPos);
185
+ tr = tr.setSelection(selection);
186
+ dispatch?.(tr);
187
+ }
188
+ return true;
189
+ };
190
+ }
191
+ /**
192
+ * Adds commands for working with `table` nodes.
193
+ *
194
+ * @public
195
+ */
196
+ function defineTableCommands() {
197
+ return defineCommands({
198
+ insertTable,
199
+ exitTable: () => exitTable,
200
+ selectTable,
201
+ selectTableCell,
202
+ selectTableColumn,
203
+ selectTableRow,
204
+ addTableColumnBefore: () => addColumnBefore,
205
+ addTableColumnAfter: () => addColumnAfter,
206
+ addTableRowAbove: () => addRowBefore,
207
+ addTableRowBelow: () => addRowAfter,
208
+ deleteTable: () => deleteTable,
209
+ deleteTableColumn: () => deleteColumn,
210
+ deleteTableRow: () => deleteRow,
211
+ deleteCellSelection: () => deleteCellSelection,
212
+ mergeTableCells: () => mergeCells,
213
+ splitTableCell: () => splitCell
214
+ });
215
+ }
216
+
217
+ //#endregion
218
+ //#region src/table/table-plugins.ts
219
+ /**
220
+ * @public
221
+ */
222
+ function defineTablePlugins() {
223
+ return definePlugin([tableEditing(), columnResizing()]);
224
+ }
225
+
226
+ //#endregion
227
+ //#region src/table/table-spec.ts
228
+ const cellContent = "block+";
229
+ const cellAttrs = {
230
+ colspan: { default: 1 },
231
+ rowspan: { default: 1 },
232
+ colwidth: { default: null }
233
+ };
234
+ const specs = tableNodes({
235
+ tableGroup: "block",
236
+ cellContent,
237
+ cellAttributes: {}
238
+ });
239
+ /**
240
+ * @internal
241
+ */
242
+ function defineTableSpec() {
243
+ return defineNodeSpec({
244
+ ...specs["table"],
245
+ content: "tableRow+",
246
+ name: "table"
247
+ });
248
+ }
249
+ /**
250
+ * @internal
251
+ */
252
+ function defineTableRowSpec() {
253
+ return defineNodeSpec({
254
+ ...specs["table_row"],
255
+ content: "(tableCell | tableHeaderCell)*",
256
+ name: "tableRow"
257
+ });
258
+ }
259
+ /**
260
+ * @internal
261
+ */
262
+ function defineTableCellSpec() {
263
+ return defineNodeSpec({
264
+ ...specs["table_cell"],
265
+ name: "tableCell",
266
+ attrs: cellAttrs
267
+ });
268
+ }
269
+ function defineTableHeaderCellSpec() {
270
+ return defineNodeSpec({
271
+ ...specs["table_header"],
272
+ name: "tableHeaderCell",
273
+ attrs: cellAttrs
274
+ });
275
+ }
276
+
277
+ //#endregion
278
+ //#region src/table/table.ts
279
+ /**
280
+ * @public
281
+ */
282
+ function defineTable() {
283
+ return union(defineTableSpec(), defineTableRowSpec(), defineTableCellSpec(), defineTableHeaderCellSpec(), defineTablePlugins(), defineTableCommands());
284
+ }
285
+
286
+ //#endregion
287
+ export { defineTable, defineTableCellSpec, defineTableCommands, defineTableHeaderCellSpec, defineTablePlugins, defineTableRowSpec, defineTableSpec, exitTable, findTable, insertTable, isCellSelection, selectTable, selectTableCell, selectTableColumn, selectTableRow };
@@ -1,6 +1,6 @@
1
- /* src/virtual-selection/style.css */
2
1
  .prosekit-virtual-selection {
2
+ border-radius: 2px;
3
3
  background-color: #8888884d;
4
4
  box-shadow: 0 0 0 2px #8888884d;
5
- border-radius: 2px;
6
5
  }
6
+
File without changes
@@ -1,31 +1,32 @@
1
- /* src/yjs/style.css */
2
1
  .ProseMirror .ProseMirror-yjs-cursor {
3
2
  position: absolute;
3
+ height: 1em;
4
4
  border-left: black;
5
- border-left-style: solid;
6
5
  border-left-width: 2px;
6
+ border-left-style: solid;
7
7
  border-color: orange;
8
- height: 1em;
9
8
  word-break: normal;
10
9
  pointer-events: none;
11
10
  }
11
+
12
12
  .ProseMirror .ProseMirror-yjs-cursor > div {
13
13
  position: relative;
14
14
  top: -1.05em;
15
- font-size: 13px;
15
+ padding-right: 2px;
16
+ padding-left: 2px;
16
17
  background-color: rgb(250, 129, 0);
17
- font-family: serif;
18
+ color: white;
18
19
  font-style: normal;
19
20
  font-weight: normal;
21
+ font-size: 13px;
20
22
  line-height: normal;
23
+ font-family: serif;
21
24
  -webkit-user-select: none;
22
25
  -moz-user-select: none;
23
26
  -ms-user-select: none;
24
27
  user-select: none;
25
- color: white;
26
- padding-left: 2px;
27
- padding-right: 2px;
28
28
  }
29
29
  .ProseMirror > .ProseMirror-yjs-cursor:first-child {
30
30
  margin-top: 16px;
31
31
  }
32
+
File without changes
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@prosekit/extensions",
3
3
  "type": "module",
4
- "version": "0.8.0",
4
+ "version": "0.9.1",
5
5
  "private": false,
6
+ "description": "A collection of common extensions for ProseKit",
6
7
  "author": {
7
8
  "name": "ocavue",
8
9
  "email": "ocavue@gmail.com"
@@ -27,37 +28,30 @@
27
28
  "exports": {
28
29
  ".": {
29
30
  "types": "./dist/prosekit-extensions.d.ts",
30
- "import": "./dist/prosekit-extensions.js",
31
31
  "default": "./dist/prosekit-extensions.js"
32
32
  },
33
33
  "./autocomplete": {
34
34
  "types": "./dist/prosekit-extensions-autocomplete.d.ts",
35
- "import": "./dist/prosekit-extensions-autocomplete.js",
36
35
  "default": "./dist/prosekit-extensions-autocomplete.js"
37
36
  },
38
37
  "./blockquote": {
39
38
  "types": "./dist/prosekit-extensions-blockquote.d.ts",
40
- "import": "./dist/prosekit-extensions-blockquote.js",
41
39
  "default": "./dist/prosekit-extensions-blockquote.js"
42
40
  },
43
41
  "./bold": {
44
42
  "types": "./dist/prosekit-extensions-bold.d.ts",
45
- "import": "./dist/prosekit-extensions-bold.js",
46
43
  "default": "./dist/prosekit-extensions-bold.js"
47
44
  },
48
45
  "./code": {
49
46
  "types": "./dist/prosekit-extensions-code.d.ts",
50
- "import": "./dist/prosekit-extensions-code.js",
51
47
  "default": "./dist/prosekit-extensions-code.js"
52
48
  },
53
49
  "./code-block": {
54
50
  "types": "./dist/prosekit-extensions-code-block.d.ts",
55
- "import": "./dist/prosekit-extensions-code-block.js",
56
51
  "default": "./dist/prosekit-extensions-code-block.js"
57
52
  },
58
53
  "./commit": {
59
54
  "types": "./dist/prosekit-extensions-commit.d.ts",
60
- "import": "./dist/prosekit-extensions-commit.js",
61
55
  "default": "./dist/prosekit-extensions-commit.js"
62
56
  },
63
57
  "./commit/style.css": {
@@ -65,65 +59,57 @@
65
59
  },
66
60
  "./doc": {
67
61
  "types": "./dist/prosekit-extensions-doc.d.ts",
68
- "import": "./dist/prosekit-extensions-doc.js",
69
62
  "default": "./dist/prosekit-extensions-doc.js"
70
63
  },
71
64
  "./drop-cursor": {
72
65
  "types": "./dist/prosekit-extensions-drop-cursor.d.ts",
73
- "import": "./dist/prosekit-extensions-drop-cursor.js",
74
66
  "default": "./dist/prosekit-extensions-drop-cursor.js"
75
67
  },
76
68
  "./enter-rule": {
77
69
  "types": "./dist/prosekit-extensions-enter-rule.d.ts",
78
- "import": "./dist/prosekit-extensions-enter-rule.js",
79
70
  "default": "./dist/prosekit-extensions-enter-rule.js"
80
71
  },
81
72
  "./file": {
82
73
  "types": "./dist/prosekit-extensions-file.d.ts",
83
- "import": "./dist/prosekit-extensions-file.js",
84
74
  "default": "./dist/prosekit-extensions-file.js"
85
75
  },
86
76
  "./gap-cursor": {
87
77
  "types": "./dist/prosekit-extensions-gap-cursor.d.ts",
88
- "import": "./dist/prosekit-extensions-gap-cursor.js",
89
78
  "default": "./dist/prosekit-extensions-gap-cursor.js"
90
79
  },
91
80
  "./gap-cursor/style.css": {
92
81
  "default": "./dist/gap-cursor/style.css"
93
82
  },
83
+ "./hard-break": {
84
+ "types": "./dist/prosekit-extensions-hard-break.d.ts",
85
+ "default": "./dist/prosekit-extensions-hard-break.js"
86
+ },
94
87
  "./heading": {
95
88
  "types": "./dist/prosekit-extensions-heading.d.ts",
96
- "import": "./dist/prosekit-extensions-heading.js",
97
89
  "default": "./dist/prosekit-extensions-heading.js"
98
90
  },
99
91
  "./horizontal-rule": {
100
92
  "types": "./dist/prosekit-extensions-horizontal-rule.d.ts",
101
- "import": "./dist/prosekit-extensions-horizontal-rule.js",
102
93
  "default": "./dist/prosekit-extensions-horizontal-rule.js"
103
94
  },
104
95
  "./image": {
105
96
  "types": "./dist/prosekit-extensions-image.d.ts",
106
- "import": "./dist/prosekit-extensions-image.js",
107
97
  "default": "./dist/prosekit-extensions-image.js"
108
98
  },
109
99
  "./input-rule": {
110
100
  "types": "./dist/prosekit-extensions-input-rule.d.ts",
111
- "import": "./dist/prosekit-extensions-input-rule.js",
112
101
  "default": "./dist/prosekit-extensions-input-rule.js"
113
102
  },
114
103
  "./italic": {
115
104
  "types": "./dist/prosekit-extensions-italic.d.ts",
116
- "import": "./dist/prosekit-extensions-italic.js",
117
105
  "default": "./dist/prosekit-extensions-italic.js"
118
106
  },
119
107
  "./link": {
120
108
  "types": "./dist/prosekit-extensions-link.d.ts",
121
- "import": "./dist/prosekit-extensions-link.js",
122
109
  "default": "./dist/prosekit-extensions-link.js"
123
110
  },
124
111
  "./list": {
125
112
  "types": "./dist/prosekit-extensions-list.d.ts",
126
- "import": "./dist/prosekit-extensions-list.js",
127
113
  "default": "./dist/prosekit-extensions-list.js"
128
114
  },
129
115
  "./list/style.css": {
@@ -131,7 +117,6 @@
131
117
  },
132
118
  "./loro": {
133
119
  "types": "./dist/prosekit-extensions-loro.d.ts",
134
- "import": "./dist/prosekit-extensions-loro.js",
135
120
  "default": "./dist/prosekit-extensions-loro.js"
136
121
  },
137
122
  "./loro/style.css": {
@@ -139,27 +124,22 @@
139
124
  },
140
125
  "./mark-rule": {
141
126
  "types": "./dist/prosekit-extensions-mark-rule.d.ts",
142
- "import": "./dist/prosekit-extensions-mark-rule.js",
143
127
  "default": "./dist/prosekit-extensions-mark-rule.js"
144
128
  },
145
129
  "./mention": {
146
130
  "types": "./dist/prosekit-extensions-mention.d.ts",
147
- "import": "./dist/prosekit-extensions-mention.js",
148
131
  "default": "./dist/prosekit-extensions-mention.js"
149
132
  },
150
133
  "./mod-click-prevention": {
151
134
  "types": "./dist/prosekit-extensions-mod-click-prevention.d.ts",
152
- "import": "./dist/prosekit-extensions-mod-click-prevention.js",
153
135
  "default": "./dist/prosekit-extensions-mod-click-prevention.js"
154
136
  },
155
137
  "./paragraph": {
156
138
  "types": "./dist/prosekit-extensions-paragraph.d.ts",
157
- "import": "./dist/prosekit-extensions-paragraph.js",
158
139
  "default": "./dist/prosekit-extensions-paragraph.js"
159
140
  },
160
141
  "./placeholder": {
161
142
  "types": "./dist/prosekit-extensions-placeholder.d.ts",
162
- "import": "./dist/prosekit-extensions-placeholder.js",
163
143
  "default": "./dist/prosekit-extensions-placeholder.js"
164
144
  },
165
145
  "./placeholder/style.css": {
@@ -167,12 +147,10 @@
167
147
  },
168
148
  "./readonly": {
169
149
  "types": "./dist/prosekit-extensions-readonly.d.ts",
170
- "import": "./dist/prosekit-extensions-readonly.js",
171
150
  "default": "./dist/prosekit-extensions-readonly.js"
172
151
  },
173
152
  "./search": {
174
153
  "types": "./dist/prosekit-extensions-search.d.ts",
175
- "import": "./dist/prosekit-extensions-search.js",
176
154
  "default": "./dist/prosekit-extensions-search.js"
177
155
  },
178
156
  "./search/style.css": {
@@ -180,12 +158,10 @@
180
158
  },
181
159
  "./strike": {
182
160
  "types": "./dist/prosekit-extensions-strike.d.ts",
183
- "import": "./dist/prosekit-extensions-strike.js",
184
161
  "default": "./dist/prosekit-extensions-strike.js"
185
162
  },
186
163
  "./table": {
187
164
  "types": "./dist/prosekit-extensions-table.d.ts",
188
- "import": "./dist/prosekit-extensions-table.js",
189
165
  "default": "./dist/prosekit-extensions-table.js"
190
166
  },
191
167
  "./table/style.css": {
@@ -193,22 +169,18 @@
193
169
  },
194
170
  "./text": {
195
171
  "types": "./dist/prosekit-extensions-text.d.ts",
196
- "import": "./dist/prosekit-extensions-text.js",
197
172
  "default": "./dist/prosekit-extensions-text.js"
198
173
  },
199
174
  "./text-align": {
200
175
  "types": "./dist/prosekit-extensions-text-align.d.ts",
201
- "import": "./dist/prosekit-extensions-text-align.js",
202
176
  "default": "./dist/prosekit-extensions-text-align.js"
203
177
  },
204
178
  "./underline": {
205
179
  "types": "./dist/prosekit-extensions-underline.d.ts",
206
- "import": "./dist/prosekit-extensions-underline.js",
207
180
  "default": "./dist/prosekit-extensions-underline.js"
208
181
  },
209
182
  "./virtual-selection": {
210
183
  "types": "./dist/prosekit-extensions-virtual-selection.d.ts",
211
- "import": "./dist/prosekit-extensions-virtual-selection.js",
212
184
  "default": "./dist/prosekit-extensions-virtual-selection.js"
213
185
  },
214
186
  "./virtual-selection/style.css": {
@@ -216,7 +188,6 @@
216
188
  },
217
189
  "./yjs": {
218
190
  "types": "./dist/prosekit-extensions-yjs.d.ts",
219
- "import": "./dist/prosekit-extensions-yjs.js",
220
191
  "default": "./dist/prosekit-extensions-yjs.js"
221
192
  },
222
193
  "./yjs/style.css": {
@@ -227,16 +198,17 @@
227
198
  "dist"
228
199
  ],
229
200
  "dependencies": {
230
- "prosemirror-changeset": "^2.2.1",
231
- "prosemirror-dropcursor": "^1.8.1",
232
- "prosemirror-flat-list": "^0.5.4",
201
+ "@ocavue/utils": "^0.4.0",
202
+ "prosemirror-changeset": "^2.3.1",
203
+ "prosemirror-dropcursor": "^1.8.2",
204
+ "prosemirror-flat-list": "^0.5.5",
233
205
  "prosemirror-gapcursor": "^1.3.2",
234
206
  "prosemirror-highlight": "^0.13.0",
235
- "prosemirror-search": "^1.0.0",
236
- "prosemirror-tables": "^1.6.4",
237
- "shiki": "^3.2.1",
238
- "@prosekit/core": "^0.8.0",
239
- "@prosekit/pm": "^0.1.9"
207
+ "prosemirror-search": "^1.1.0",
208
+ "prosemirror-tables": "^1.7.1",
209
+ "shiki": "^3.4.2",
210
+ "@prosekit/core": "^0.8.1",
211
+ "@prosekit/pm": "^0.1.10"
240
212
  },
241
213
  "peerDependencies": {
242
214
  "loro-crdt": ">= 0.16.7",
@@ -259,23 +231,75 @@
259
231
  }
260
232
  },
261
233
  "devDependencies": {
262
- "@vitest/browser": "^3.0.9",
234
+ "@vitest/browser": "^3.1.4",
263
235
  "just-pick": "^4.2.0",
264
- "loro-crdt": "^1.4.6",
265
- "loro-prosemirror": "^0.2.1",
236
+ "loro-crdt": "^1.5.7",
237
+ "loro-prosemirror": "^0.2.3",
266
238
  "prettier": "^3.5.3",
267
- "tsup": "^8.4.0",
268
- "type-fest": "^4.37.0",
269
- "typescript": "~5.7.3",
270
- "vitest": "^3.0.9",
271
- "y-prosemirror": "^1.2.17",
239
+ "tsdown": "^0.12.4",
240
+ "type-fest": "^4.41.0",
241
+ "typescript": "~5.8.3",
242
+ "vitest": "^3.1.4",
243
+ "y-prosemirror": "^1.3.5",
272
244
  "y-protocols": "^1.0.6",
273
- "yjs": "^13.6.24",
274
- "@prosekit/dev": "0.0.0"
245
+ "yjs": "^13.6.27",
246
+ "@prosekit/config-tsdown": "0.0.0",
247
+ "@prosekit/config-vitest": "0.0.0"
248
+ },
249
+ "publishConfig": {
250
+ "dev": {}
251
+ },
252
+ "dev": {
253
+ "entry": {
254
+ "prosekit-extensions": "./src/index.ts",
255
+ "prosekit-extensions-autocomplete": "./src/autocomplete/index.ts",
256
+ "prosekit-extensions-blockquote": "./src/blockquote/index.ts",
257
+ "prosekit-extensions-bold": "./src/bold/index.ts",
258
+ "prosekit-extensions-code": "./src/code/index.ts",
259
+ "prosekit-extensions-code-block": "./src/code-block/index.ts",
260
+ "prosekit-extensions-commit": "./src/commit/index.ts",
261
+ "commit/style": "./src/commit/style.css",
262
+ "prosekit-extensions-doc": "./src/doc/index.ts",
263
+ "prosekit-extensions-drop-cursor": "./src/drop-cursor/index.ts",
264
+ "prosekit-extensions-enter-rule": "./src/enter-rule/index.ts",
265
+ "prosekit-extensions-file": "./src/file/index.ts",
266
+ "prosekit-extensions-gap-cursor": "./src/gap-cursor/index.ts",
267
+ "gap-cursor/style": "./src/gap-cursor/style.css",
268
+ "prosekit-extensions-hard-break": "./src/hard-break/index.ts",
269
+ "prosekit-extensions-heading": "./src/heading/index.ts",
270
+ "prosekit-extensions-horizontal-rule": "./src/horizontal-rule/index.ts",
271
+ "prosekit-extensions-image": "./src/image/index.ts",
272
+ "prosekit-extensions-input-rule": "./src/input-rule/index.ts",
273
+ "prosekit-extensions-italic": "./src/italic/index.ts",
274
+ "prosekit-extensions-link": "./src/link/index.ts",
275
+ "prosekit-extensions-list": "./src/list/index.ts",
276
+ "list/style": "./src/list/style.css",
277
+ "prosekit-extensions-loro": "./src/loro/index.ts",
278
+ "loro/style": "./src/loro/style.css",
279
+ "prosekit-extensions-mark-rule": "./src/mark-rule/index.ts",
280
+ "prosekit-extensions-mention": "./src/mention/index.ts",
281
+ "prosekit-extensions-mod-click-prevention": "./src/mod-click-prevention/index.ts",
282
+ "prosekit-extensions-paragraph": "./src/paragraph/index.ts",
283
+ "prosekit-extensions-placeholder": "./src/placeholder/index.ts",
284
+ "placeholder/style": "./src/placeholder/style.css",
285
+ "prosekit-extensions-readonly": "./src/readonly/index.ts",
286
+ "prosekit-extensions-search": "./src/search/index.ts",
287
+ "search/style": "./src/search/style.css",
288
+ "prosekit-extensions-strike": "./src/strike/index.ts",
289
+ "prosekit-extensions-table": "./src/table/index.ts",
290
+ "table/style": "./src/table/style.css",
291
+ "prosekit-extensions-text": "./src/text/index.ts",
292
+ "prosekit-extensions-text-align": "./src/text-align/index.ts",
293
+ "prosekit-extensions-underline": "./src/underline/index.ts",
294
+ "prosekit-extensions-virtual-selection": "./src/virtual-selection/index.ts",
295
+ "virtual-selection/style": "./src/virtual-selection/style.css",
296
+ "prosekit-extensions-yjs": "./src/yjs/index.ts",
297
+ "yjs/style": "./src/yjs/style.css"
298
+ }
275
299
  },
276
300
  "scripts": {
277
301
  "build:tsc": "tsc -b tsconfig.json",
278
- "build:tsup": "tsup"
302
+ "build:tsdown": "tsdown"
279
303
  },
280
304
  "types": "./dist/prosekit-extensions.d.ts",
281
305
  "typesVersions": {
@@ -316,6 +340,9 @@
316
340
  "gap-cursor": [
317
341
  "./dist/prosekit-extensions-gap-cursor.d.ts"
318
342
  ],
343
+ "hard-break": [
344
+ "./dist/prosekit-extensions-hard-break.d.ts"
345
+ ],
319
346
  "heading": [
320
347
  "./dist/prosekit-extensions-heading.d.ts"
321
348
  ],