@prosekit/extensions 0.0.0-next-20240715071354 → 0.0.0-next-20240724172520

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.
@@ -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
+ }
@@ -1,4 +1,4 @@
1
- /* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.2/node_modules/prosemirror-flat-list/dist/style.css */
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;
@@ -1,3 +1,5 @@
1
1
  export { defineBlockquoteSpec } from './_tsup-dts-rollup';
2
2
  export { defineBlockquoteInputRule } from './_tsup-dts-rollup';
3
3
  export { defineBlockquote } from './_tsup-dts-rollup';
4
+ export { BlockquoteSpecExtension } from './_tsup-dts-rollup';
5
+ export { BlockquoteExtension } from './_tsup-dts-rollup';
@@ -3,7 +3,10 @@ import {
3
3
  } from "./chunk-LVMTQOWG.js";
4
4
 
5
5
  // src/blockquote/index.ts
6
- import { defineNodeSpec, union } from "@prosekit/core";
6
+ import {
7
+ defineNodeSpec,
8
+ union
9
+ } from "@prosekit/core";
7
10
  function defineBlockquoteSpec() {
8
11
  return defineNodeSpec({
9
12
  name: "blockquote",
@@ -3,3 +3,6 @@ export { defineBoldCommands } from './_tsup-dts-rollup';
3
3
  export { defineBoldKeymap } from './_tsup-dts-rollup';
4
4
  export { defineBoldInputRule } from './_tsup-dts-rollup';
5
5
  export { defineBold } from './_tsup-dts-rollup';
6
+ export { BoldSpecExtension } from './_tsup-dts-rollup';
7
+ export { BoldCommandsExtension } from './_tsup-dts-rollup';
8
+ export { BoldExtension } from './_tsup-dts-rollup';
@@ -3,3 +3,6 @@ export { defineCodeCommands } from './_tsup-dts-rollup';
3
3
  export { defineCodeKeymap } from './_tsup-dts-rollup';
4
4
  export { defineCodeInputRule } from './_tsup-dts-rollup';
5
5
  export { defineCode } from './_tsup-dts-rollup';
6
+ export { CodeSpecExtension } from './_tsup-dts-rollup';
7
+ export { CodeCommandsExtension } from './_tsup-dts-rollup';
8
+ export { CodeExtension } from './_tsup-dts-rollup';
@@ -1,2 +1,3 @@
1
1
  export { defineDropCursor } from './_tsup-dts-rollup';
2
2
  export { DropCursorOptions } from './_tsup-dts-rollup';
3
+ export { DropCursorExtension } from './_tsup-dts-rollup';
@@ -0,0 +1,2 @@
1
+ export { defineGapCursor } from './_tsup-dts-rollup';
2
+ export { GapCursor } from './_tsup-dts-rollup';
@@ -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
+ };
@@ -1,6 +1,9 @@
1
1
  export { defineHeading } from './_tsup-dts-rollup';
2
+ export { HeadingExtension } from './_tsup-dts-rollup';
2
3
  export { defineHeadingCommands_alias_1 as defineHeadingCommands } from './_tsup-dts-rollup';
3
4
  export { defineHeadingInputRule } from './_tsup-dts-rollup';
4
5
  export { defineHeadingKeymap } from './_tsup-dts-rollup';
5
6
  export { defineHeadingSpec } from './_tsup-dts-rollup';
7
+ export { HeadingCommandsExtension_alias_1 as HeadingCommandsExtension } from './_tsup-dts-rollup';
8
+ export { HeadingSpecExtension } from './_tsup-dts-rollup';
6
9
  export { HeadingAttrs } from './_tsup-dts-rollup';
@@ -2,3 +2,6 @@ export { defineImageSpec } from './_tsup-dts-rollup';
2
2
  export { defineImageCommands } from './_tsup-dts-rollup';
3
3
  export { defineImage } from './_tsup-dts-rollup';
4
4
  export { ImageAttrs } from './_tsup-dts-rollup';
5
+ export { ImageSpecExtension } from './_tsup-dts-rollup';
6
+ export { ImageCommandsExtension } from './_tsup-dts-rollup';
7
+ export { ImageExtension } from './_tsup-dts-rollup';
@@ -3,3 +3,6 @@ export { defineItalicCommands } from './_tsup-dts-rollup';
3
3
  export { defineItalicKeymap } from './_tsup-dts-rollup';
4
4
  export { defineItalicInputRule } from './_tsup-dts-rollup';
5
5
  export { defineItalic } from './_tsup-dts-rollup';
6
+ export { ItalicSpecExtension } from './_tsup-dts-rollup';
7
+ export { ItalicCommandsExtension } from './_tsup-dts-rollup';
8
+ export { ItalicExtension } from './_tsup-dts-rollup';
@@ -5,3 +5,6 @@ export { defineLinkEnterRule } from './_tsup-dts-rollup';
5
5
  export { defineLinkMarkRule } from './_tsup-dts-rollup';
6
6
  export { defineLink } from './_tsup-dts-rollup';
7
7
  export { LinkAttrs } from './_tsup-dts-rollup';
8
+ export { LinkSpecExtension } from './_tsup-dts-rollup';
9
+ export { LinkCommandsExtension } from './_tsup-dts-rollup';
10
+ export { LinkExtension } from './_tsup-dts-rollup';
@@ -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,16 @@
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';
8
+ export { ListExtension } from './_tsup-dts-rollup';
12
9
  export { defineListCommands_alias_1 as defineListCommands } from './_tsup-dts-rollup';
10
+ export { defineListInputRules } from './_tsup-dts-rollup';
13
11
  export { defineListKeymap } from './_tsup-dts-rollup';
12
+ export { defineListPlugins } from './_tsup-dts-rollup';
13
+ export { defineListSpec } from './_tsup-dts-rollup';
14
+ export { ListAttrs } from './_tsup-dts-rollup';
15
+ export { ListCommandsExtension_alias_1 as ListCommandsExtension } from './_tsup-dts-rollup';
16
+ export { ListSpecExtension } 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";
@@ -36,13 +27,20 @@ function defineListCommands() {
36
27
  moveList,
37
28
  splitList,
38
29
  toggleCollapsed,
39
- toggleList,
40
30
  unwrapList,
31
+ toggleList,
41
32
  wrapInList,
42
33
  insertList
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-[": createDedentListCommand(),
69
- "Mod-]": createIndentListCommand()
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/index.ts
76
- import { ListDOMSerializer } from "prosemirror-flat-list";
77
- function defineListSpec() {
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
- function defineListInputRules() {
84
- return union(listInputRules.map(defineInputRule));
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 union([
97
+ return union2([
88
98
  defineListSpec(),
89
99
  defineListPlugins(),
90
100
  defineListKeymap(),
@@ -1 +1,2 @@
1
1
  export { defineModClickPrevention } from './_tsup-dts-rollup';
2
+ export { ModClickPreventionExtension } from './_tsup-dts-rollup';
@@ -3,3 +3,6 @@ export { defineStrikeCommands } from './_tsup-dts-rollup';
3
3
  export { defineStrikeKeymap } from './_tsup-dts-rollup';
4
4
  export { defineStrikeInputRule } from './_tsup-dts-rollup';
5
5
  export { defineStrike } from './_tsup-dts-rollup';
6
+ export { StrikeSpecExtension } from './_tsup-dts-rollup';
7
+ export { StrikeCommandsExtension } from './_tsup-dts-rollup';
8
+ export { StrikeExtension } from './_tsup-dts-rollup';
@@ -1,7 +1,13 @@
1
1
  export { defineTable } from './_tsup-dts-rollup';
2
+ export { TableExtension } from './_tsup-dts-rollup';
2
3
  export { defineTableCellSpec } from './_tsup-dts-rollup';
3
4
  export { defineTableCommands } from './_tsup-dts-rollup';
4
5
  export { defineTableHeaderCellSpec } from './_tsup-dts-rollup';
5
6
  export { defineTablePlugins } from './_tsup-dts-rollup';
6
7
  export { defineTableRowSpec } from './_tsup-dts-rollup';
7
8
  export { defineTableSpec } from './_tsup-dts-rollup';
9
+ export { TableCellSpecExtension } from './_tsup-dts-rollup';
10
+ export { TableCommandsExtension } from './_tsup-dts-rollup';
11
+ export { TableHeaderCellSpecExtension } from './_tsup-dts-rollup';
12
+ export { TableRowSpecExtension } from './_tsup-dts-rollup';
13
+ export { TableSpecExtension } from './_tsup-dts-rollup';
@@ -32,11 +32,7 @@ function createEmptyTable(schema, row, col, header) {
32
32
  ];
33
33
  return table.createAndFill(null, rows);
34
34
  }
35
- function insertTable({
36
- row,
37
- col,
38
- header
39
- }) {
35
+ function insertTable({ row, col, header }) {
40
36
  return (state, dispatch, view) => {
41
37
  const table = createEmptyTable(state.schema, row, col, header);
42
38
  return insertNode({ node: table })(state, dispatch, view);
@@ -90,12 +86,6 @@ function defineTablePlugins() {
90
86
 
91
87
  // src/table/table-spec.ts
92
88
  import { defineNodeSpec } from "@prosekit/core";
93
- import "prosemirror-tables";
94
- var cellAttrs = {
95
- colspan: { default: 1 },
96
- rowspan: { default: 1 },
97
- colwidth: { default: null }
98
- };
99
89
  var cellContent = "block+";
100
90
  function getCellAttrs(dom) {
101
91
  if (typeof dom === "string") {
@@ -148,6 +138,11 @@ function defineTableRowSpec() {
148
138
  }
149
139
  });
150
140
  }
141
+ var cellAttrs = {
142
+ colspan: { default: 1 },
143
+ rowspan: { default: 1 },
144
+ colwidth: { default: null }
145
+ };
151
146
  function defineTableCellSpec() {
152
147
  return defineNodeSpec({
153
148
  name: "tableCell",
@@ -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';
@@ -2,3 +2,6 @@ export { defineUnderlineSpec } from './_tsup-dts-rollup';
2
2
  export { defineUnderlineCommands } from './_tsup-dts-rollup';
3
3
  export { defineUnderlineKeymap } from './_tsup-dts-rollup';
4
4
  export { defineUnderline } from './_tsup-dts-rollup';
5
+ export { UnderlineSpecExtension } from './_tsup-dts-rollup';
6
+ export { UnderlineCommandsExtension } from './_tsup-dts-rollup';
7
+ export { UnderlineExtension } from './_tsup-dts-rollup';
@@ -3,8 +3,8 @@ import {
3
3
  defineCommands,
4
4
  defineKeymap,
5
5
  defineMarkSpec,
6
- union,
7
- toggleMark
6
+ toggleMark,
7
+ union
8
8
  } from "@prosekit/core";
9
9
  function defineUnderlineSpec() {
10
10
  return defineMarkSpec({
@@ -1 +1,2 @@
1
1
  export { defineVirtualSelection } from './_tsup-dts-rollup';
2
+ export { VirtualSelectionExtension } 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-20240715071354",
4
+ "version": "0.0.0-next-20240724172520",
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.2",
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.3.7",
187
- "shiki": "^1.10.3",
188
- "@prosekit/core": "^0.0.0-next-20240715071354",
189
- "@prosekit/pm": "^0.0.0-next-20240715071354"
195
+ "prosemirror-tables": "^1.4.0",
196
+ "shiki": "^1.11.1",
197
+ "@prosekit/core": "^0.0.0-next-20240724172520",
198
+ "@prosekit/pm": "^0.0.0-next-20240724172520"
190
199
  },
191
200
  "devDependencies": {
192
- "@vitest/browser": "^2.0.2",
193
- "tsup": "^8.1.0",
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.2",
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
  ],