@prosekit/basic 0.3.17 → 0.3.19

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.
@@ -1,31 +1,52 @@
1
- import { AddMarkOptions } from '@prosekit/core';
2
- import { Attrs } from 'prosemirror-model';
3
- import { DedentListOptions } from 'prosemirror-flat-list';
1
+ import { BaseCommandsExtension } from '@prosekit/core';
2
+ import { BaseKeymapExtension } from '@prosekit/core';
3
+ import { BlockquoteExtension } from '@prosekit/extensions/blockquote';
4
+ import { BoldExtension } from '@prosekit/extensions/bold';
5
+ import { CodeExtension } from '@prosekit/extensions/code';
4
6
  import { config as default_alias_2 } from '@prosekit/dev/config-vitest';
5
- import { Extension } from '@prosekit/core';
6
- import { HeadingAttrs } from '@prosekit/extensions/heading';
7
- import { ImageAttrs } from '@prosekit/extensions/image';
8
- import { IndentListOptions } from 'prosemirror-flat-list';
9
- import { InsertNodeOptions } from '@prosekit/core';
10
- import { LinkAttrs } from '@prosekit/extensions/link';
11
- import { ListAttributes } from 'prosemirror-flat-list';
7
+ import { DocExtension } from '@prosekit/core';
8
+ import { DropCursorExtension } from '@prosekit/extensions/drop-cursor';
9
+ import { HeadingExtension } from '@prosekit/extensions/heading';
10
+ import { HistoryExtension } from '@prosekit/core';
11
+ import { ImageExtension } from '@prosekit/extensions/image';
12
+ import { ItalicExtension } from '@prosekit/extensions/italic';
13
+ import { LinkExtension } from '@prosekit/extensions/link';
14
+ import { ListExtension } from '@prosekit/extensions/list';
15
+ import { ModClickPreventionExtension } from '@prosekit/extensions/mod-click-prevention';
12
16
  import { Options } from 'tsup';
13
- import { RemoveMarkOptions } from '@prosekit/core';
14
- import { RemoveNodeOptions } from '@prosekit/core';
15
- import { SetBlockTypeOptions } from '@prosekit/core';
16
- import { SetNodeAttrsOptions } from '@prosekit/core';
17
- import { SimplifyDeeper } from '@prosekit/core';
18
- import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
19
- import { UnsetBlockTypeOptions } from '@prosekit/core';
20
- import { UnsetMarkOptions } from '@prosekit/core';
21
- import { UnwrapListOptions } from 'prosemirror-flat-list';
22
- import { WrapInListGetAttrs } from 'prosemirror-flat-list';
23
- import { WrapOptions } from '@prosekit/core';
17
+ import { ParagraphExtension } from '@prosekit/core';
18
+ import { StrikeExtension } from '@prosekit/extensions/strike';
19
+ import { TableExtension } from '@prosekit/extensions/table';
20
+ import { TextExtension } from '@prosekit/core';
21
+ import { UnderlineExtension } from '@prosekit/extensions/underline';
22
+ import { Union } from '@prosekit/core';
23
+ import { VirtualSelectionExtension } from '@prosekit/extensions/virtual-selection';
24
24
 
25
25
  /**
26
- * @public
26
+ * @internal
27
27
  */
28
- export declare type BasicExtension = ReturnType<typeof defineBasicExtension>;
28
+ export declare type BasicExtension = Union<[
29
+ DocExtension,
30
+ TextExtension,
31
+ HeadingExtension,
32
+ HistoryExtension,
33
+ ListExtension,
34
+ BlockquoteExtension,
35
+ BaseKeymapExtension,
36
+ BaseCommandsExtension,
37
+ ItalicExtension,
38
+ BoldExtension,
39
+ UnderlineExtension,
40
+ StrikeExtension,
41
+ CodeExtension,
42
+ LinkExtension,
43
+ ImageExtension,
44
+ ParagraphExtension,
45
+ DropCursorExtension,
46
+ VirtualSelectionExtension,
47
+ ModClickPreventionExtension,
48
+ TableExtension
49
+ ]>;
29
50
 
30
51
  export declare namespace default_alias {
31
52
  let plugins: {
@@ -42,106 +63,6 @@ export { default_alias_2 }
42
63
  * copy this function and customize it to your needs.
43
64
  * @public
44
65
  */
45
- export declare function defineBasicExtension(): Extension< {
46
- Nodes: SimplifyDeeper< {
47
- paragraph: Attrs;
48
- doc: Attrs;
49
- text: Attrs;
50
- blockquote: {
51
- readonly [x: string]: any;
52
- };
53
- list: {
54
- kind?: "bullet" | "ordered" | "task" | "toggle";
55
- order?: number | null;
56
- checked?: boolean;
57
- collapsed?: boolean;
58
- };
59
- heading: {
60
- level: number;
61
- };
62
- image: {
63
- src: null;
64
- };
65
- table: {
66
- readonly [x: string]: any;
67
- };
68
- tableRow: {
69
- readonly [x: string]: any;
70
- };
71
- tableCell: {
72
- [x: string]: any;
73
- };
74
- tableHeaderCell: {
75
- [x: string]: any;
76
- };
77
- }>;
78
- Marks: SimplifyDeeper< {
79
- bold: {
80
- readonly [x: string]: any;
81
- };
82
- code: {
83
- readonly [x: string]: any;
84
- };
85
- italic: {
86
- readonly [x: string]: any;
87
- };
88
- link: {
89
- href: string;
90
- };
91
- strike: {
92
- readonly [x: string]: any;
93
- };
94
- underline: {
95
- readonly [x: string]: any;
96
- };
97
- }>;
98
- Commands: {
99
- insertText: [{
100
- text: string;
101
- from?: number;
102
- to?: number;
103
- }];
104
- insertNode: [options: InsertNodeOptions];
105
- removeNode: [options: RemoveNodeOptions];
106
- wrap: [WrapOptions];
107
- setBlockType: [options: SetBlockTypeOptions];
108
- setNodeAttrs: [options: SetNodeAttrsOptions];
109
- selectAll: [];
110
- addMark: [options: AddMarkOptions];
111
- removeMark: [options: RemoveMarkOptions];
112
- unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
113
- unsetMark: [options?: UnsetMarkOptions | undefined];
114
- readonly undo: [];
115
- readonly redo: [];
116
- toggleBold: [];
117
- toggleCode: [];
118
- setHeading: [attrs?: HeadingAttrs | undefined];
119
- insertHeading: [attrs?: HeadingAttrs | undefined];
120
- toggleHeading: [attrs?: HeadingAttrs | undefined];
121
- insertImage: [attrs?: ImageAttrs | undefined];
122
- toggleItalic: [];
123
- addLink: [attrs: LinkAttrs];
124
- removeLink: [];
125
- toggleLink: [attrs: LinkAttrs];
126
- expandLink: [];
127
- dedentList: [options?: DedentListOptions | undefined];
128
- indentList: [options?: IndentListOptions | undefined];
129
- moveList: [direction: "up" | "down"];
130
- splitList: [];
131
- toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
132
- toggleList: [attrs: ListAttributes];
133
- unwrapList: [options?: UnwrapListOptions | undefined];
134
- wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
135
- insertList: [attrs?: ListAttributes | undefined];
136
- toggleStrike: [];
137
- insertTable: [{
138
- row: number;
139
- col: number;
140
- header: boolean;
141
- }];
142
- exitTable: [];
143
- toggleUnderline: [];
144
- };
145
- }>;
66
+ export declare function defineBasicExtension(): BasicExtension;
146
67
 
147
68
  export { }
@@ -8,20 +8,32 @@ import {
8
8
  defineText,
9
9
  union
10
10
  } from "@prosekit/core";
11
- import { defineBlockquote } from "@prosekit/extensions/blockquote";
11
+ import {
12
+ defineBlockquote
13
+ } from "@prosekit/extensions/blockquote";
12
14
  import { defineBold } from "@prosekit/extensions/bold";
13
15
  import { defineCode } from "@prosekit/extensions/code";
14
- import { defineDropCursor } from "@prosekit/extensions/drop-cursor";
15
- import { defineHeading } from "@prosekit/extensions/heading";
16
+ import {
17
+ defineDropCursor
18
+ } from "@prosekit/extensions/drop-cursor";
19
+ import {
20
+ defineHeading
21
+ } from "@prosekit/extensions/heading";
16
22
  import { defineImage } from "@prosekit/extensions/image";
17
23
  import { defineItalic } from "@prosekit/extensions/italic";
18
24
  import { defineLink } from "@prosekit/extensions/link";
19
25
  import { defineList } from "@prosekit/extensions/list";
20
- import { defineModClickPrevention } from "@prosekit/extensions/mod-click-prevention";
26
+ import {
27
+ defineModClickPrevention
28
+ } from "@prosekit/extensions/mod-click-prevention";
21
29
  import { defineStrike } from "@prosekit/extensions/strike";
22
30
  import { defineTable } from "@prosekit/extensions/table";
23
- import { defineUnderline } from "@prosekit/extensions/underline";
24
- import { defineVirtualSelection } from "@prosekit/extensions/virtual-selection";
31
+ import {
32
+ defineUnderline
33
+ } from "@prosekit/extensions/underline";
34
+ import {
35
+ defineVirtualSelection
36
+ } from "@prosekit/extensions/virtual-selection";
25
37
  function defineBasicExtension() {
26
38
  return union([
27
39
  defineDoc(),
package/dist/style.css CHANGED
@@ -202,4 +202,28 @@ img.ProseMirror-separator {
202
202
  background-color: #53e54b80;
203
203
  }
204
204
 
205
+ /* ../extensions/src/gap-cursor/style.css */
206
+ .ProseMirror-gapcursor {
207
+ display: none;
208
+ pointer-events: none;
209
+ position: relative;
210
+ }
211
+ .ProseMirror-gapcursor:after {
212
+ content: "";
213
+ display: block;
214
+ position: absolute;
215
+ top: -2px;
216
+ width: 20px;
217
+ border-top: 1px solid currentColor;
218
+ animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
219
+ }
220
+ @keyframes ProseMirror-cursor-blink {
221
+ to {
222
+ visibility: hidden;
223
+ }
224
+ }
225
+ .ProseMirror-focused .ProseMirror-gapcursor {
226
+ display: block;
227
+ }
228
+
205
229
  /* src/style.css */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/basic",
3
3
  "type": "module",
4
- "version": "0.3.17",
4
+ "version": "0.3.19",
5
5
  "private": false,
6
6
  "author": {
7
7
  "name": "ocavue",
@@ -41,16 +41,16 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@prosekit/core": "^0.7.5",
45
- "@prosekit/extensions": "^0.7.5",
44
+ "@prosekit/core": "^0.7.6",
45
+ "@prosekit/extensions": "^0.7.7",
46
46
  "@prosekit/pm": "^0.1.7"
47
47
  },
48
48
  "devDependencies": {
49
49
  "postcss": "^8.4.39",
50
50
  "postcss-nesting": "^12.1.5",
51
- "tsup": "^8.1.2",
51
+ "tsup": "^8.2.2",
52
52
  "typescript": "^5.5.3",
53
- "vitest": "^2.0.3",
53
+ "vitest": "^2.0.4",
54
54
  "@prosekit/dev": "0.0.0"
55
55
  },
56
56
  "scripts": {