@prosekit/extensions 0.7.4 → 0.7.6

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.
@@ -15,6 +15,7 @@ import { Extension } from '@prosekit/core';
15
15
  import { ExtensionTyping } from '@prosekit/core';
16
16
  import { ExtractMarkActions } from '@prosekit/core';
17
17
  import { ExtractNodeActions } from '@prosekit/core';
18
+ import { GapCursor } from 'prosemirror-gapcursor';
18
19
  import { getSingletonHighlighter } from 'shiki/bundle/full';
19
20
  import type { Highlighter } from 'shiki';
20
21
  import { IndentListOptions } from 'prosemirror-flat-list';
@@ -436,6 +437,22 @@ export declare function defineDropCursor(options?: DropCursorOptions): Extension
436
437
  */
437
438
  export declare function defineEnterRule({ regex, handler, stop, }: EnterRuleOptions): Extension;
438
439
 
440
+ /**
441
+ * Capture clicks near and arrow-key-motion past places that don't have a
442
+ * normally selectable position nearby, and create a gap cursor selection for
443
+ * them. The cursor is drawn as an element with class `ProseMirror-gapcursor`.
444
+ *
445
+ * You can either include `prosekit/extensions/gap-cursor.css` or add your own
446
+ * styles to make it visible.
447
+ *
448
+ * See
449
+ * [prosemirror-gapcursor](https://github.com/ProseMirror/prosemirror-gapcursor)
450
+ * for more information.
451
+ *
452
+ * @public
453
+ */
454
+ export declare function defineGapCursor(): Extension<ExtensionTyping<any, any, any>>;
455
+
439
456
  /**
440
457
  * @public
441
458
  */
@@ -1234,6 +1251,8 @@ export declare type EnterRuleOptions = {
1234
1251
  */
1235
1252
  export declare const exitTable: Command;
1236
1253
 
1254
+ export { GapCursor }
1255
+
1237
1256
  export declare function getCheckRanges(transactions: readonly Transaction[], oldState: EditorState, newState: EditorState): Array<[number, number]>;
1238
1257
 
1239
1258
  export declare function getPluginState(state: EditorState): PredictionPluginState | undefined;
@@ -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.3/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;
@@ -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
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/extensions",
3
3
  "type": "module",
4
- "version": "0.7.4",
4
+ "version": "0.7.6",
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,20 +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.3",
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.7.4",
189
- "@prosekit/pm": "^0.1.6"
195
+ "prosemirror-tables": "^1.4.0",
196
+ "shiki": "^1.11.1",
197
+ "@prosekit/core": "^0.7.5",
198
+ "@prosekit/pm": "^0.1.7"
190
199
  },
191
200
  "devDependencies": {
192
- "@vitest/browser": "^2.0.3",
193
- "tsup": "^8.1.2",
194
- "type-fest": "^4.22.1",
201
+ "@vitest/browser": "^2.0.4",
202
+ "tsup": "^8.2.2",
203
+ "type-fest": "^4.23.0",
195
204
  "typescript": "^5.5.3",
196
- "vitest": "^2.0.3",
205
+ "vitest": "^2.0.4",
197
206
  "@prosekit/dev": "0.0.0"
198
207
  },
199
208
  "scripts": {
@@ -230,6 +239,9 @@
230
239
  "enter-rule": [
231
240
  "./dist/prosekit-extensions-enter-rule.d.ts"
232
241
  ],
242
+ "gap-cursor": [
243
+ "./dist/prosekit-extensions-gap-cursor.d.ts"
244
+ ],
233
245
  "heading": [
234
246
  "./dist/prosekit-extensions-heading.d.ts"
235
247
  ],