@prosekit/basic 0.3.13 → 0.3.15

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,19 +1,24 @@
1
- import { Attrs } from 'prosemirror-model';
1
+ import { AddMarkOptions } from '@prosekit/core';
2
2
  import { DedentListOptions } from 'prosemirror-flat-list';
3
3
  import { config as default_alias_2 } from '@prosekit/dev/config-vitest';
4
4
  import { Extension } from '@prosekit/core';
5
5
  import { HeadingAttrs } from '@prosekit/extensions/heading';
6
6
  import { ImageAttrs } from '@prosekit/extensions/image';
7
7
  import { IndentListOptions } from 'prosemirror-flat-list';
8
+ import { InsertNodeOptions } from '@prosekit/core';
8
9
  import { LinkAttrs } from '@prosekit/extensions/link';
9
10
  import { ListAttributes } from 'prosemirror-flat-list';
10
- import { MarkType } from 'prosemirror-model';
11
- import { Node as Node_2 } from 'prosemirror-model';
12
- import { NodeRange } from 'prosemirror-model';
13
- import { NodeType } from 'prosemirror-model';
14
11
  import { Options } from 'tsup';
12
+ import { RemoveMarkOptions } from '@prosekit/core';
13
+ import { RemoveNodeOptions } from '@prosekit/core';
14
+ import { SetBlockTypeOptions } from '@prosekit/core';
15
+ import { SetNodeAttrsOptions } from '@prosekit/core';
15
16
  import { ToggleCollapsedOptions } from 'prosemirror-flat-list';
17
+ import { UnsetBlockTypeOptions } from '@prosekit/core';
18
+ import { UnsetMarkOptions } from '@prosekit/core';
16
19
  import { UnwrapListOptions } from 'prosemirror-flat-list';
20
+ import { WrapInListGetAttrs } from 'prosemirror-flat-list';
21
+ import { WrapOptions } from '@prosekit/core';
17
22
 
18
23
  /**
19
24
  * @public
@@ -44,51 +49,18 @@ text: string;
44
49
  from?: number;
45
50
  to?: number;
46
51
  }];
47
- insertNode: [options: {
48
- node: Node_2;
49
- pos?: number;
50
- type?: undefined;
51
- attrs?: undefined;
52
- } | {
53
- node?: undefined;
54
- pos?: number;
55
- type: string;
56
- attrs?: Attrs;
57
- }];
58
- removeNode: [options: {
59
- type: string | NodeType;
60
- pos?: number;
61
- }];
62
- wrap: [{
63
- nodeType: NodeType;
64
- attrs?: Attrs | null;
65
- }];
66
- setBlockType: [options: {
67
- type: NodeType | string;
68
- attrs?: Attrs | null;
69
- from?: number;
70
- to?: number;
71
- }];
72
- setNodeAttrs: [options: {
73
- type: string | NodeType | string[] | NodeType[];
74
- attrs: Attrs;
75
- pos?: number;
76
- }];
52
+ insertNode: [options: InsertNodeOptions];
53
+ removeNode: [options: RemoveNodeOptions];
54
+ wrap: [WrapOptions];
55
+ setBlockType: [options: SetBlockTypeOptions];
56
+ setNodeAttrs: [options: SetNodeAttrsOptions];
77
57
  selectAll: [];
78
- addMark: [options: {
79
- type: string | MarkType;
80
- attrs?: Attrs | null;
81
- from?: number;
82
- to?: number;
83
- }];
84
- removeMark: [options: {
85
- type: string | MarkType;
86
- attrs?: Attrs | null;
87
- from?: number;
88
- to?: number;
89
- }];
90
- undo: [];
91
- redo: [];
58
+ addMark: [options: AddMarkOptions];
59
+ removeMark: [options: RemoveMarkOptions];
60
+ unsetBlockType: [options?: UnsetBlockTypeOptions | undefined];
61
+ unsetMark: [options?: UnsetMarkOptions | undefined];
62
+ readonly undo: [];
63
+ readonly redo: [];
92
64
  toggleBold: [];
93
65
  toggleCode: [];
94
66
  setHeading: [attrs?: HeadingAttrs | undefined];
@@ -107,7 +79,7 @@ splitList: [];
107
79
  toggleCollapsed: [(ToggleCollapsedOptions | undefined)?];
108
80
  toggleList: [attrs: ListAttributes];
109
81
  unwrapList: [options?: UnwrapListOptions | undefined];
110
- wrapInList: [getAttrs: ListAttributes | ((range: NodeRange) => ListAttributes | null)];
82
+ wrapInList: [getAttrs: WrapInListGetAttrs<ListAttributes>];
111
83
  insertList: [attrs?: ListAttributes | undefined];
112
84
  toggleStrike: [];
113
85
  insertTable: [{
package/dist/style.css CHANGED
@@ -37,7 +37,10 @@ li.ProseMirror-selectednode {
37
37
  li.ProseMirror-selectednode:after {
38
38
  content: "";
39
39
  position: absolute;
40
- inset: -2px -2px -2px -32px;
40
+ left: -32px;
41
+ right: -2px;
42
+ top: -2px;
43
+ bottom: -2px;
41
44
  border: 2px solid #8cf;
42
45
  pointer-events: none;
43
46
  }
@@ -49,10 +52,11 @@ img.ProseMirror-separator {
49
52
 
50
53
  /* ../pm/src/view/style/prosemirror.css */
51
54
 
52
- /* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.1/node_modules/prosemirror-flat-list/dist/style.css */
55
+ /* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.2/node_modules/prosemirror-flat-list/dist/style.css */
53
56
  .prosemirror-flat-list {
54
57
  padding: 0;
55
58
  margin-top: 0;
59
+ margin-bottom: 0;
56
60
  margin-left: 32px;
57
61
  margin-bottom: 0;
58
62
  position: relative;
@@ -65,7 +69,10 @@ img.ProseMirror-separator {
65
69
  .prosemirror-flat-list.ProseMirror-selectednode:after {
66
70
  content: "";
67
71
  position: absolute;
68
- inset: -2px -2px -2px -32px;
72
+ left: -32px;
73
+ right: -2px;
74
+ top: -2px;
75
+ bottom: -2px;
69
76
  border: 2px solid #8cf;
70
77
  pointer-events: none;
71
78
  }
@@ -78,7 +85,7 @@ img.ProseMirror-separator {
78
85
  .prosemirror-flat-list[data-list-kind=ordered] > * {
79
86
  contain: style;
80
87
  }
81
- .prosemirror-flat-list[data-list-kind=ordered]:before {
88
+ .prosemirror-flat-list[data-list-kind=ordered]::before {
82
89
  position: absolute;
83
90
  right: 100%;
84
91
  font-variant-numeric: tabular-nums;
@@ -116,10 +123,10 @@ img.ProseMirror-separator {
116
123
  width: 1.5em;
117
124
  width: 1lh;
118
125
  }
119
- .prosemirror-flat-list[data-list-kind=toggle] > .list-marker:before {
126
+ .prosemirror-flat-list[data-list-kind=toggle] > .list-marker::before {
120
127
  content: "\23f7";
121
128
  }
122
- .prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable][data-list-collapsed] > .list-marker:before {
129
+ .prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable][data-list-collapsed] > .list-marker::before {
123
130
  content: "\23f5";
124
131
  }
125
132
  .prosemirror-flat-list[data-list-kind=toggle][data-list-collapsable] > .list-marker {
@@ -171,7 +178,7 @@ img.ProseMirror-separator {
171
178
  }
172
179
 
173
180
  /* ../extensions/src/placeholder/style.css */
174
- .prosekit-placeholder:before {
181
+ .prosekit-placeholder::before {
175
182
  position: absolute;
176
183
  opacity: 30%;
177
184
  pointer-events: none;
@@ -42,23 +42,23 @@ div.ProseMirror ul,
42
42
  div.ProseMirror ol,
43
43
  div.ProseMirror pre {
44
44
  margin: 0;
45
- padding: .5rem 0;
45
+ padding: 0.5rem 0;
46
46
  line-height: 1.5;
47
47
  }
48
48
  div.ProseMirror blockquote {
49
49
  padding-left: 1em;
50
- border-left: .25em solid hsla(0, 0%, 60%, .4);
50
+ border-left: 0.25em solid hsla(0, 0%, 60%, 0.4);
51
51
  }
52
52
  div.ProseMirror h1 {
53
53
  margin: 1rem 0;
54
54
  font-size: 2.25em;
55
55
  }
56
56
  div.ProseMirror h2 {
57
- margin: 1.75em 0 .5em;
57
+ margin: 1.75em 0 0.5em;
58
58
  font-size: 1.75em;
59
59
  }
60
60
  div.ProseMirror h3 {
61
- margin: 1.5em 0 .5em;
61
+ margin: 1.5em 0 0.5em;
62
62
  font-size: 1.375em;
63
63
  }
64
64
  div.ProseMirror h4 {
@@ -66,26 +66,26 @@ div.ProseMirror h4 {
66
66
  font-size: 1.125em;
67
67
  }
68
68
  div.ProseMirror h5 {
69
- margin: .5em 0;
69
+ margin: 0.5em 0;
70
70
  }
71
71
  div.ProseMirror h6 {
72
- opacity: .8;
72
+ opacity: 0.8;
73
73
  }
74
74
  div.ProseMirror img,
75
75
  div.ProseMirror video {
76
- margin: .4em 0;
76
+ margin: 0.4em 0;
77
77
  width: min-content;
78
78
  max-width: 100%;
79
79
  }
80
80
  div.ProseMirror code {
81
- font-size: .875em;
81
+ font-size: 0.875em;
82
82
  font-weight: 600;
83
83
  }
84
84
  div.ProseMirror pre {
85
- margin: .5rem 0;
86
- padding: 2rem;
85
+ margin: 0.5rem 0;
86
+ padding: 2rem 2rem;
87
87
  overflow-x: auto;
88
- border-radius: .375rem;
88
+ border-radius: 0.375rem;
89
89
  }
90
90
  div.ProseMirror pre,
91
91
  div.ProseMirror code {
@@ -105,33 +105,33 @@ div.ProseMirror hr {
105
105
  div.ProseMirror .prosemirror-flat-list {
106
106
  line-height: 1.5;
107
107
  }
108
- div.ProseMirror .prosemirror-flat-list:before,
108
+ div.ProseMirror .prosemirror-flat-list::before,
109
109
  div.ProseMirror .prosemirror-flat-list > .list-marker {
110
- top: .5rem;
110
+ top: 0.5rem;
111
111
  }
112
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h1):before,
112
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h1)::before,
113
113
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h1) > .list-marker {
114
114
  top: 1em;
115
115
  }
116
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h2):before,
116
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h2)::before,
117
117
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h2) > .list-marker {
118
- top: .6em;
118
+ top: 0.6em;
119
119
  }
120
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h3):before,
120
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h3)::before,
121
121
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h3) > .list-marker {
122
- top: .25em;
122
+ top: 0.25em;
123
123
  }
124
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h4):before,
124
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h4)::before,
125
125
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h4) > .list-marker {
126
126
  top: 0;
127
127
  }
128
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h5):before,
128
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h5)::before,
129
129
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h5) > .list-marker {
130
- top: -.1em;
130
+ top: -0.1em;
131
131
  }
132
- div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h6):before,
132
+ div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h6)::before,
133
133
  div.ProseMirror .prosemirror-flat-list:has(> div.list-content > h6) > .list-marker {
134
- top: -.1em;
134
+ top: -0.1em;
135
135
  }
136
136
  div.ProseMirror .ProseMirror-selectednode {
137
137
  z-index: calc(infinity);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@prosekit/basic",
3
3
  "type": "module",
4
- "version": "0.3.13",
4
+ "version": "0.3.15",
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.1",
45
- "@prosekit/pm": "^0.1.5",
46
- "@prosekit/extensions": "^0.7.1"
44
+ "@prosekit/core": "^0.7.3",
45
+ "@prosekit/extensions": "^0.7.3",
46
+ "@prosekit/pm": "^0.1.6"
47
47
  },
48
48
  "devDependencies": {
49
49
  "postcss": "^8.4.39",
50
50
  "postcss-nesting": "^12.1.5",
51
51
  "tsup": "^8.1.0",
52
52
  "typescript": "^5.5.3",
53
- "vitest": "^2.0.0-beta.13",
53
+ "vitest": "^2.0.2",
54
54
  "@prosekit/dev": "0.0.0"
55
55
  },
56
56
  "scripts": {