@prosekit/basic 0.4.0 → 0.5.0

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,2 +1,68 @@
1
- export { defineBasicExtension } from './_tsup-dts-rollup.js';
2
- export { BasicExtension } from './_tsup-dts-rollup.js';
1
+ import { BaseCommandsExtension, BaseKeymapExtension, HistoryExtension, Union } from "@prosekit/core";
2
+ import { BlockquoteExtension } from "@prosekit/extensions/blockquote";
3
+ import { BoldExtension } from "@prosekit/extensions/bold";
4
+ import { CodeExtension } from "@prosekit/extensions/code";
5
+ import { CodeBlockExtension } from "@prosekit/extensions/code-block";
6
+ import { DocExtension } from "@prosekit/extensions/doc";
7
+ import { DropCursorExtension } from "@prosekit/extensions/drop-cursor";
8
+ import { GapCursorExtension } from "@prosekit/extensions/gap-cursor";
9
+ import { HardBreakExtension } from "@prosekit/extensions/hard-break";
10
+ import { HeadingExtension } from "@prosekit/extensions/heading";
11
+ import { HorizontalRuleExtension } from "@prosekit/extensions/horizontal-rule";
12
+ import { ImageExtension } from "@prosekit/extensions/image";
13
+ import { ItalicExtension } from "@prosekit/extensions/italic";
14
+ import { LinkExtension } from "@prosekit/extensions/link";
15
+ import { ListExtension } from "@prosekit/extensions/list";
16
+ import { ModClickPreventionExtension } from "@prosekit/extensions/mod-click-prevention";
17
+ import { ParagraphExtension } from "@prosekit/extensions/paragraph";
18
+ import { StrikeExtension } from "@prosekit/extensions/strike";
19
+ import { TableExtension } from "@prosekit/extensions/table";
20
+ import { TextExtension } from "@prosekit/extensions/text";
21
+ import { UnderlineExtension } from "@prosekit/extensions/underline";
22
+ import { VirtualSelectionExtension } from "@prosekit/extensions/virtual-selection";
23
+
24
+ //#region src/index.d.ts
25
+ /**
26
+ * @internal
27
+ */
28
+ /**
29
+ * @internal
30
+ */
31
+ type BasicExtension = Union<[DocExtension, TextExtension, ParagraphExtension, HeadingExtension, ListExtension, BlockquoteExtension, ImageExtension, HorizontalRuleExtension, HardBreakExtension, TableExtension, CodeBlockExtension, ItalicExtension, BoldExtension, UnderlineExtension, StrikeExtension, CodeExtension, LinkExtension, BaseKeymapExtension, BaseCommandsExtension, HistoryExtension, DropCursorExtension, GapCursorExtension, VirtualSelectionExtension, ModClickPreventionExtension]>;
32
+ /**
33
+ * Define a basic extension that includes some common functionality. You can
34
+ * copy this function and customize it to your needs.
35
+ *
36
+ * It's a combination of the following extension functions:
37
+ *
38
+ * - {@link defineDoc}
39
+ * - {@link defineText}
40
+ * - {@link defineParagraph}
41
+ * - {@link defineHeading}
42
+ * - {@link defineList}
43
+ * - {@link defineBlockquote}
44
+ * - {@link defineImage}
45
+ * - {@link defineHorizontalRule}
46
+ * - {@link defineHardBreak}
47
+ * - {@link defineTable}
48
+ * - {@link defineCodeBlock}
49
+ * - {@link defineItalic}
50
+ * - {@link defineBold}
51
+ * - {@link defineUnderline}
52
+ * - {@link defineStrike}
53
+ * - {@link defineCode}
54
+ * - {@link defineLink}
55
+ * - {@link defineBaseKeymap}
56
+ * - {@link defineBaseCommands}
57
+ * - {@link defineHistory}
58
+ * - {@link defineDropCursor}
59
+ * - {@link defineGapCursor}
60
+ * - {@link defineVirtualSelection}
61
+ * - {@link defineModClickPrevention}
62
+ *
63
+ * @public
64
+ */
65
+ declare function defineBasicExtension(): BasicExtension;
66
+
67
+ //#endregion
68
+ export { BasicExtension, defineBasicExtension };
@@ -1,100 +1,91 @@
1
- // src/index.ts
2
- import {
3
- defineBaseCommands,
4
- defineBaseKeymap,
5
- defineHistory,
6
- union
7
- } from "@prosekit/core";
8
- import {
9
- defineBlockquote
10
- } from "@prosekit/extensions/blockquote";
11
- import {
12
- defineBold
13
- } from "@prosekit/extensions/bold";
14
- import {
15
- defineCode
16
- } from "@prosekit/extensions/code";
17
- import {
18
- defineCodeBlock
19
- } from "@prosekit/extensions/code-block";
20
- import {
21
- defineDoc
22
- } from "@prosekit/extensions/doc";
23
- import {
24
- defineDropCursor
25
- } from "@prosekit/extensions/drop-cursor";
26
- import {
27
- defineGapCursor
28
- } from "@prosekit/extensions/gap-cursor";
29
- import {
30
- defineHeading
31
- } from "@prosekit/extensions/heading";
32
- import {
33
- defineHorizontalRule
34
- } from "@prosekit/extensions/horizontal-rule";
35
- import {
36
- defineImage
37
- } from "@prosekit/extensions/image";
38
- import {
39
- defineItalic
40
- } from "@prosekit/extensions/italic";
41
- import {
42
- defineLink
43
- } from "@prosekit/extensions/link";
44
- import {
45
- defineList
46
- } from "@prosekit/extensions/list";
47
- import {
48
- defineModClickPrevention
49
- } from "@prosekit/extensions/mod-click-prevention";
50
- import {
51
- defineParagraph
52
- } from "@prosekit/extensions/paragraph";
53
- import {
54
- defineStrike
55
- } from "@prosekit/extensions/strike";
56
- import {
57
- defineTable
58
- } from "@prosekit/extensions/table";
59
- import {
60
- defineText
61
- } from "@prosekit/extensions/text";
62
- import {
63
- defineUnderline
64
- } from "@prosekit/extensions/underline";
65
- import {
66
- defineVirtualSelection
67
- } from "@prosekit/extensions/virtual-selection";
1
+ import { defineBaseCommands, defineBaseKeymap, defineHistory, union } from "@prosekit/core";
2
+ import { defineBlockquote } from "@prosekit/extensions/blockquote";
3
+ import { defineBold } from "@prosekit/extensions/bold";
4
+ import { defineCode } from "@prosekit/extensions/code";
5
+ import { defineCodeBlock } from "@prosekit/extensions/code-block";
6
+ import { defineDoc } from "@prosekit/extensions/doc";
7
+ import { defineDropCursor } from "@prosekit/extensions/drop-cursor";
8
+ import { defineGapCursor } from "@prosekit/extensions/gap-cursor";
9
+ import { defineHardBreak } from "@prosekit/extensions/hard-break";
10
+ import { defineHeading } from "@prosekit/extensions/heading";
11
+ import { defineHorizontalRule } from "@prosekit/extensions/horizontal-rule";
12
+ import { defineImage } from "@prosekit/extensions/image";
13
+ import { defineItalic } from "@prosekit/extensions/italic";
14
+ import { defineLink } from "@prosekit/extensions/link";
15
+ import { defineList } from "@prosekit/extensions/list";
16
+ import { defineModClickPrevention } from "@prosekit/extensions/mod-click-prevention";
17
+ import { defineParagraph } from "@prosekit/extensions/paragraph";
18
+ import { defineStrike } from "@prosekit/extensions/strike";
19
+ import { defineTable } from "@prosekit/extensions/table";
20
+ import { defineText } from "@prosekit/extensions/text";
21
+ import { defineUnderline } from "@prosekit/extensions/underline";
22
+ import { defineVirtualSelection } from "@prosekit/extensions/virtual-selection";
23
+
24
+ //#region src/index.ts
25
+ /**
26
+ * Define a basic extension that includes some common functionality. You can
27
+ * copy this function and customize it to your needs.
28
+ *
29
+ * It's a combination of the following extension functions:
30
+ *
31
+ * - {@link defineDoc}
32
+ * - {@link defineText}
33
+ * - {@link defineParagraph}
34
+ * - {@link defineHeading}
35
+ * - {@link defineList}
36
+ * - {@link defineBlockquote}
37
+ * - {@link defineImage}
38
+ * - {@link defineHorizontalRule}
39
+ * - {@link defineHardBreak}
40
+ * - {@link defineTable}
41
+ * - {@link defineCodeBlock}
42
+ * - {@link defineItalic}
43
+ * - {@link defineBold}
44
+ * - {@link defineUnderline}
45
+ * - {@link defineStrike}
46
+ * - {@link defineCode}
47
+ * - {@link defineLink}
48
+ * - {@link defineBaseKeymap}
49
+ * - {@link defineBaseCommands}
50
+ * - {@link defineHistory}
51
+ * - {@link defineDropCursor}
52
+ * - {@link defineGapCursor}
53
+ * - {@link defineVirtualSelection}
54
+ * - {@link defineModClickPrevention}
55
+ *
56
+ * @public
57
+ */
68
58
  function defineBasicExtension() {
69
- return union(
70
- // Nodes
71
- defineDoc(),
72
- defineText(),
73
- defineParagraph(),
74
- defineHeading(),
75
- defineList(),
76
- defineBlockquote(),
77
- defineImage(),
78
- defineHorizontalRule(),
79
- defineTable(),
80
- defineCodeBlock(),
81
- // Marks
82
- defineItalic(),
83
- defineBold(),
84
- defineUnderline(),
85
- defineStrike(),
86
- defineCode(),
87
- defineLink(),
88
- // Others
89
- defineBaseKeymap(),
90
- defineBaseCommands(),
91
- defineHistory(),
92
- defineDropCursor(),
93
- defineGapCursor(),
94
- defineVirtualSelection(),
95
- defineModClickPrevention()
96
- );
59
+ return union(
60
+ // Nodes
61
+ defineDoc(),
62
+ defineText(),
63
+ defineParagraph(),
64
+ defineHeading(),
65
+ defineList(),
66
+ defineBlockquote(),
67
+ defineImage(),
68
+ defineHorizontalRule(),
69
+ defineHardBreak(),
70
+ defineTable(),
71
+ defineCodeBlock(),
72
+ // Marks
73
+ defineItalic(),
74
+ defineBold(),
75
+ defineUnderline(),
76
+ defineStrike(),
77
+ defineCode(),
78
+ defineLink(),
79
+ // Others
80
+ defineBaseKeymap(),
81
+ defineBaseCommands(),
82
+ defineHistory(),
83
+ defineDropCursor(),
84
+ defineGapCursor(),
85
+ defineVirtualSelection(),
86
+ defineModClickPrevention()
87
+ );
97
88
  }
98
- export {
99
- defineBasicExtension
100
- };
89
+
90
+ //#endregion
91
+ export { defineBasicExtension };
package/dist/style.css CHANGED
@@ -1,58 +1,60 @@
1
- /* ../../node_modules/.pnpm/prosemirror-view@1.38.1/node_modules/prosemirror-view/style/prosemirror.css */
2
1
  .ProseMirror {
3
2
  position: relative;
4
3
  }
4
+
5
5
  .ProseMirror {
6
6
  word-wrap: break-word;
7
7
  white-space: pre-wrap;
8
8
  white-space: break-spaces;
9
9
  -webkit-font-variant-ligatures: none;
10
10
  font-variant-ligatures: none;
11
- font-feature-settings: "liga" 0;
11
+ font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
12
12
  }
13
+
13
14
  .ProseMirror pre {
14
15
  white-space: pre-wrap;
15
16
  }
17
+
16
18
  .ProseMirror li {
17
19
  position: relative;
18
20
  }
19
- .ProseMirror-hideselection *::selection {
20
- background: transparent;
21
- }
22
- .ProseMirror-hideselection *::-moz-selection {
23
- background: transparent;
24
- }
25
- .ProseMirror-hideselection {
26
- caret-color: transparent;
27
- }
28
- .ProseMirror [draggable][contenteditable=false] {
29
- user-select: text;
30
- }
21
+
22
+ .ProseMirror-hideselection *::selection { background: transparent; }
23
+ .ProseMirror-hideselection *::-moz-selection { background: transparent; }
24
+ .ProseMirror-hideselection { caret-color: transparent; }
25
+
26
+ /* See https://github.com/ProseMirror/prosemirror/issues/1421#issuecomment-1759320191 */
27
+ .ProseMirror [draggable][contenteditable=false] { user-select: text }
28
+
31
29
  .ProseMirror-selectednode {
32
30
  outline: 2px solid #8cf;
33
31
  }
32
+
33
+ /* Make sure li selections wrap around markers */
34
+
34
35
  li.ProseMirror-selectednode {
35
36
  outline: none;
36
37
  }
38
+
37
39
  li.ProseMirror-selectednode:after {
38
40
  content: "";
39
41
  position: absolute;
40
42
  left: -32px;
41
- right: -2px;
42
- top: -2px;
43
- bottom: -2px;
43
+ right: -2px; top: -2px; bottom: -2px;
44
44
  border: 2px solid #8cf;
45
45
  pointer-events: none;
46
46
  }
47
+
48
+ /* Protect against generic img rules */
49
+
47
50
  img.ProseMirror-separator {
48
51
  display: inline !important;
49
52
  border: none !important;
50
53
  margin: 0 !important;
51
54
  }
52
55
 
53
- /* ../pm/src/view/style/prosemirror.css */
54
56
 
55
- /* ../../node_modules/.pnpm/prosemirror-flat-list@0.5.4/node_modules/prosemirror-flat-list/dist/style.css */
57
+ /* src/style.css */
56
58
  .prosemirror-flat-list {
57
59
  padding: 0;
58
60
  margin-top: 0;
@@ -79,9 +81,6 @@ img.ProseMirror-separator {
79
81
  .prosemirror-flat-list[data-list-kind=bullet] {
80
82
  list-style: disc;
81
83
  }
82
- .prosemirror-flat-list[data-list-kind=ordered] {
83
- counter-increment: prosemirror-flat-list-counter;
84
- }
85
84
  .prosemirror-flat-list[data-list-kind=ordered] > * {
86
85
  contain: style;
87
86
  }
@@ -91,6 +90,9 @@ img.ProseMirror-separator {
91
90
  font-variant-numeric: tabular-nums;
92
91
  content: counter(prosemirror-flat-list-counter, decimal) ". ";
93
92
  }
93
+ .prosemirror-flat-list[data-list-kind=ordered] {
94
+ counter-increment: prosemirror-flat-list-counter;
95
+ }
94
96
  .prosemirror-flat-list[data-list-kind=ordered]:first-child,
95
97
  :not(.prosemirror-flat-list[data-list-kind=ordered]) + .prosemirror-flat-list[data-list-kind=ordered] {
96
98
  counter-reset: prosemirror-flat-list-counter;
@@ -112,8 +114,8 @@ img.ProseMirror-separator {
112
114
  width: 1.5em;
113
115
  width: 1lh;
114
116
  }
115
- .prosemirror-flat-list[data-list-kind=task] > .list-marker,
116
- .prosemirror-flat-list[data-list-kind=task] > .list-marker * {
117
+ :is(.prosemirror-flat-list[data-list-kind=task] > .list-marker),
118
+ :is(.prosemirror-flat-list[data-list-kind=task] > .list-marker) * {
117
119
  cursor: pointer;
118
120
  }
119
121
  .prosemirror-flat-list[data-list-kind=toggle] > .list-marker {
@@ -140,97 +142,96 @@ img.ProseMirror-separator {
140
142
  display: none;
141
143
  }
142
144
 
143
- /* ../extensions/src/list/style.css */
144
145
 
145
- /* ../extensions/src/table/style.css */
146
146
  .ProseMirror .tableWrapper {
147
147
  overflow-x: auto;
148
148
  }
149
+
149
150
  .ProseMirror table {
150
151
  border-collapse: collapse;
151
152
  table-layout: fixed;
152
153
  width: 100%;
153
154
  overflow: hidden;
154
155
  }
155
- .ProseMirror td,
156
- .ProseMirror th {
157
- vertical-align: top;
156
+
157
+ .ProseMirror td, .ProseMirror th {
158
158
  box-sizing: border-box;
159
- position: relative;
159
+ vertical-align: top;
160
160
  border-width: 1px;
161
- padding-left: 0.75rem;
162
- padding-right: 0.75rem;
161
+ padding-left: .75rem;
162
+ padding-right: .75rem;
163
+ position: relative;
163
164
  }
165
+
164
166
  .ProseMirror .column-resize-handle {
167
+ z-index: 20;
168
+ pointer-events: none;
169
+ background-color: highlighttext;
170
+ width: 4px;
165
171
  position: absolute;
166
- right: -2px;
167
172
  top: 0;
168
173
  bottom: 0;
169
- width: 4px;
170
- z-index: 20;
171
- background-color: HighlightText;
172
- pointer-events: none;
174
+ right: -2px;
173
175
  }
176
+
174
177
  .ProseMirror.resize-cursor {
175
178
  cursor: ew-resize;
176
179
  cursor: col-resize;
177
180
  }
181
+
178
182
  .ProseMirror .selectedCell {
179
- --color:
180
- 210,
181
- 100%,
182
- 56%;
183
- background-color: hsla(var(--color), 20%);
183
+ --color: 210, 100%, 56%;
184
184
  border: 1px double hsl(var(--color));
185
+ background-color: hsla(var(--color), 20%);
185
186
  }
186
187
 
187
- /* ../extensions/src/placeholder/style.css */
188
- .prosekit-placeholder::before {
189
- position: absolute;
190
- opacity: 30%;
188
+ .prosekit-placeholder:before {
189
+ content: attr(data-placeholder);
190
+ opacity: .3;
191
191
  pointer-events: none;
192
192
  height: 0;
193
- content: attr(data-placeholder);
193
+ position: absolute;
194
194
  }
195
195
 
196
- /* ../extensions/src/virtual-selection/style.css */
197
196
  .prosekit-virtual-selection {
198
197
  background-color: #8888884d;
199
- box-shadow: 0 0 0 2px #8888884d;
200
198
  border-radius: 2px;
199
+ box-shadow: 0 0 0 2px #8888884d;
201
200
  }
202
201
 
203
- /* ../extensions/src/commit/style.css */
204
202
  .prosekit-commit-deletion {
205
203
  background-color: #e5534b80;
206
204
  text-decoration: line-through;
207
205
  }
206
+
208
207
  .prosekit-commit-addition {
209
208
  background-color: #53e54b80;
210
209
  }
211
210
 
212
- /* ../extensions/src/gap-cursor/style.css */
213
211
  .ProseMirror-gapcursor {
214
- display: none;
215
212
  pointer-events: none;
213
+ display: none;
216
214
  position: relative;
217
215
  }
216
+
218
217
  .ProseMirror-gapcursor:after {
219
218
  content: "";
219
+ border-top: 1px solid;
220
+ width: 20px;
221
+ animation: 1.1s steps(2, start) infinite ProseMirror-cursor-blink;
220
222
  display: block;
221
223
  position: absolute;
222
224
  top: -2px;
223
- width: 20px;
224
- border-top: 1px solid currentColor;
225
- animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite;
226
225
  }
226
+
227
227
  @keyframes ProseMirror-cursor-blink {
228
228
  to {
229
229
  visibility: hidden;
230
230
  }
231
231
  }
232
+
232
233
  .ProseMirror-focused .ProseMirror-gapcursor {
233
234
  display: block;
234
235
  }
235
236
 
236
- /* src/style.css */
237
+
package/dist/style.js ADDED
File without changes
@@ -1,156 +1,160 @@
1
- /* src/typography.css */
2
1
  div.ProseMirror {
3
- display: flex;
4
2
  flex-direction: column;
5
- }
6
- div.ProseMirror {
7
3
  line-height: 1.5;
4
+ display: flex;
8
5
  }
9
- div.ProseMirror p:first-child,
10
- div.ProseMirror h1:first-child,
11
- div.ProseMirror h2:first-child,
12
- div.ProseMirror h3:first-child,
13
- div.ProseMirror h4:first-child,
14
- div.ProseMirror h5:first-child,
15
- div.ProseMirror h6:first-child {
6
+
7
+ div.ProseMirror p:first-child, div.ProseMirror h1:first-child, div.ProseMirror h2:first-child, div.ProseMirror h3:first-child, div.ProseMirror h4:first-child, div.ProseMirror h5:first-child, div.ProseMirror h6:first-child {
16
8
  margin-top: 0;
17
9
  }
18
- div.ProseMirror p:last-child,
19
- div.ProseMirror h1:last-child,
20
- div.ProseMirror h2:last-child,
21
- div.ProseMirror h3:last-child,
22
- div.ProseMirror h4:last-child,
23
- div.ProseMirror h5:last-child,
24
- div.ProseMirror h6:last-child {
10
+
11
+ div.ProseMirror p:last-child, div.ProseMirror h1:last-child, div.ProseMirror h2:last-child, div.ProseMirror h3:last-child, div.ProseMirror h4:last-child, div.ProseMirror h5:last-child, div.ProseMirror h6:last-child {
25
12
  margin-bottom: 0;
26
13
  }
27
- div.ProseMirror h1,
28
- div.ProseMirror h2,
29
- div.ProseMirror h3,
30
- div.ProseMirror h4,
31
- div.ProseMirror h5,
32
- div.ProseMirror h6 {
33
- font-weight: 600;
34
- line-height: 1.25;
14
+
15
+ div.ProseMirror h1, div.ProseMirror h2, div.ProseMirror h3, div.ProseMirror h4, div.ProseMirror h5, div.ProseMirror h6 {
16
+ border-style: none;
35
17
  padding-top: 0;
36
18
  padding-bottom: 0;
37
- border-style: none;
19
+ font-weight: 600;
20
+ line-height: 1.25;
38
21
  }
22
+
39
23
  div.ProseMirror a {
40
- text-decoration: underline;
41
24
  font-weight: 500;
25
+ text-decoration: underline;
42
26
  }
43
- div.ProseMirror p,
44
- div.ProseMirror ul,
45
- div.ProseMirror ol,
46
- div.ProseMirror pre {
27
+
28
+ div.ProseMirror p, div.ProseMirror ul, div.ProseMirror ol, div.ProseMirror pre {
47
29
  margin: 0;
48
- padding: 0.5rem 0;
30
+ padding: .5rem 0;
49
31
  line-height: 1.5;
50
32
  }
33
+
51
34
  div.ProseMirror blockquote {
35
+ border-left: .25em solid #9996;
52
36
  padding-left: 1em;
53
- border-left: 0.25em solid hsl(0 0% 60% / 0.4);
54
37
  }
38
+
55
39
  div.ProseMirror h1 {
56
40
  margin: 1rem 0;
57
41
  font-size: 2.25em;
58
42
  }
43
+
59
44
  div.ProseMirror h2 {
60
- margin: 1.75em 0 0.5em;
45
+ margin: 1.75em 0 .5em;
61
46
  font-size: 1.75em;
62
47
  }
48
+
63
49
  div.ProseMirror h3 {
64
- margin: 1.5em 0 0.5em;
50
+ margin: 1.5em 0 .5em;
65
51
  font-size: 1.375em;
66
52
  }
53
+
67
54
  div.ProseMirror h4 {
68
55
  margin: 1em 0;
69
56
  font-size: 1.125em;
70
57
  }
58
+
71
59
  div.ProseMirror h5 {
72
- margin: 0.5em 0;
60
+ margin: .5em 0;
73
61
  }
62
+
74
63
  div.ProseMirror h6 {
75
- opacity: 0.8;
64
+ opacity: .8;
76
65
  }
77
- div.ProseMirror img,
78
- div.ProseMirror video {
79
- margin: 0;
66
+
67
+ div.ProseMirror img, div.ProseMirror video {
80
68
  width: min-content;
81
69
  max-width: 100%;
70
+ margin: 0;
82
71
  }
72
+
83
73
  div.ProseMirror code {
84
- font-size: 0.875em;
74
+ font-size: .875em;
85
75
  font-weight: 600;
86
76
  }
77
+
87
78
  div.ProseMirror pre {
88
- margin: 0.5rem 0;
89
- padding: 2rem 2rem;
90
- overflow-x: auto;
91
- border-radius: 0.375rem;
92
- border: 1px solid hsl(0 0% 50% / 0.2);
93
- color: var(--prosemirror-highlight, inherit);
94
79
  background-color: var(--prosemirror-highlight-bg, inherit);
80
+ color: var(--prosemirror-highlight, inherit);
81
+ border: 1px solid #80808033;
82
+ border-radius: .375rem;
83
+ margin: .5rem 0;
84
+ padding: 2rem;
85
+ overflow-x: auto;
95
86
  }
96
- div.ProseMirror pre,
97
- div.ProseMirror code {
87
+
88
+ div.ProseMirror pre, div.ProseMirror code {
98
89
  white-space: pre;
99
- word-spacing: normal;
100
90
  word-break: normal;
91
+ word-spacing: normal;
101
92
  word-wrap: normal;
102
- tab-size: 4;
103
93
  hyphens: none;
94
+ tab-size: 4;
104
95
  }
96
+
105
97
  div.ProseMirror pre code {
106
98
  font-weight: inherit;
107
99
  }
100
+
108
101
  div.ProseMirror hr {
109
- margin: 2em 0;
110
102
  border-width: 1px;
103
+ margin: 2em 0;
111
104
  }
105
+
112
106
  div.ProseMirror .prosekit-horizontal-rule {
113
- padding: 1em 0;
114
107
  margin: 1em 0;
108
+ padding: 1em 0;
115
109
  line-height: 1px;
116
110
  }
117
- :is(div.ProseMirror .prosekit-horizontal-rule) hr {
111
+
112
+ div.ProseMirror .prosekit-horizontal-rule hr {
118
113
  margin: 0;
119
114
  }
115
+
116
+ div.ProseMirror .tableWrapper {
117
+ margin-top: .5em;
118
+ margin-bottom: 1em;
119
+ }
120
+
120
121
  div.ProseMirror .prosemirror-flat-list {
121
122
  line-height: 1.5;
122
123
  }
123
- :is(div.ProseMirror .prosemirror-flat-list)::before,
124
- :is(div.ProseMirror .prosemirror-flat-list) > .list-marker {
125
- top: 0.5rem;
124
+
125
+ div.ProseMirror .prosemirror-flat-list:before, div.ProseMirror .prosemirror-flat-list > .list-marker {
126
+ top: .5rem;
126
127
  }
127
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h1)::before,
128
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h1) > .list-marker {
128
+
129
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h1):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h1) > .list-marker {
129
130
  top: 1em;
130
131
  }
131
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h2)::before,
132
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h2) > .list-marker {
133
- top: 0.6em;
132
+
133
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h2):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h2) > .list-marker {
134
+ top: .6em;
134
135
  }
135
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h3)::before,
136
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h3) > .list-marker {
137
- top: 0.25em;
136
+
137
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h3):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h3) > .list-marker {
138
+ top: .25em;
138
139
  }
139
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h4)::before,
140
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h4) > .list-marker {
140
+
141
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h4):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h4) > .list-marker {
141
142
  top: 0;
142
143
  }
143
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h5)::before,
144
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h5) > .list-marker {
145
- top: -0.1em;
144
+
145
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h5):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h5) > .list-marker {
146
+ top: -.1em;
146
147
  }
147
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h6)::before,
148
- :is(div.ProseMirror .prosemirror-flat-list):has(> div.list-content > h6) > .list-marker {
149
- top: -0.1em;
148
+
149
+ div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h6):before, div.ProseMirror .prosemirror-flat-list:has( > div.list-content > h6) > .list-marker {
150
+ top: -.1em;
150
151
  }
152
+
151
153
  div.ProseMirror .ProseMirror-selectednode {
152
154
  z-index: calc(infinity);
153
155
  }
154
- div.ProseMirror div[data-node-view-root=true] {
156
+
157
+ div.ProseMirror div[data-node-view-root="true"] {
155
158
  display: contents;
156
159
  }
160
+
File without changes
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "@prosekit/basic",
3
3
  "type": "module",
4
- "version": "0.4.0",
4
+ "version": "0.5.0",
5
5
  "private": false,
6
+ "description": "A quick starter for ProseKit",
6
7
  "author": {
7
8
  "name": "ocavue",
8
9
  "email": "ocavue@gmail.com"
@@ -27,7 +28,6 @@
27
28
  "exports": {
28
29
  ".": {
29
30
  "types": "./dist/prosekit-basic.d.ts",
30
- "import": "./dist/prosekit-basic.js",
31
31
  "default": "./dist/prosekit-basic.js"
32
32
  },
33
33
  "./style.css": {
@@ -41,21 +41,30 @@
41
41
  "dist"
42
42
  ],
43
43
  "dependencies": {
44
- "@prosekit/core": "^0.8.0",
45
- "@prosekit/pm": "^0.1.9",
46
- "@prosekit/extensions": "^0.8.0"
44
+ "@prosekit/core": "^0.8.1",
45
+ "@prosekit/extensions": "^0.9.0",
46
+ "@prosekit/pm": "^0.1.10"
47
47
  },
48
48
  "devDependencies": {
49
- "postcss": "^8.5.3",
50
- "postcss-nesting": "^13.0.1",
51
- "tsup": "^8.4.0",
52
- "typescript": "~5.7.3",
53
- "vitest": "^3.0.9",
54
- "@prosekit/dev": "0.0.0"
49
+ "tsdown": "^0.11.1",
50
+ "typescript": "~5.8.3",
51
+ "vitest": "^3.1.3",
52
+ "@prosekit/config-vitest": "0.0.0",
53
+ "@prosekit/config-tsdown": "0.0.0"
54
+ },
55
+ "publishConfig": {
56
+ "dev": {}
57
+ },
58
+ "dev": {
59
+ "entry": {
60
+ "prosekit-basic": "./src/index.ts",
61
+ "style": "./src/style.css",
62
+ "typography": "./src/typography.css"
63
+ }
55
64
  },
56
65
  "scripts": {
57
66
  "build:tsc": "tsc -b tsconfig.json",
58
- "build:tsup": "tsup"
67
+ "build:tsdown": "tsdown"
59
68
  },
60
69
  "types": "./dist/prosekit-basic.d.ts",
61
70
  "typesVersions": {
@@ -1,89 +0,0 @@
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 { CodeBlockExtension } from '@prosekit/extensions/code-block';
6
- import { CodeExtension } from '@prosekit/extensions/code';
7
- import { DocExtension } from '@prosekit/extensions/doc';
8
- import { DropCursorExtension } from '@prosekit/extensions/drop-cursor';
9
- import { GapCursorExtension } from '@prosekit/extensions/gap-cursor';
10
- import { HeadingExtension } from '@prosekit/extensions/heading';
11
- import { HistoryExtension } from '@prosekit/core';
12
- import { HorizontalRuleExtension } from '@prosekit/extensions/horizontal-rule';
13
- import { ImageExtension } from '@prosekit/extensions/image';
14
- import { ItalicExtension } from '@prosekit/extensions/italic';
15
- import { LinkExtension } from '@prosekit/extensions/link';
16
- import { ListExtension } from '@prosekit/extensions/list';
17
- import { ModClickPreventionExtension } from '@prosekit/extensions/mod-click-prevention';
18
- import { ParagraphExtension } from '@prosekit/extensions/paragraph';
19
- import { StrikeExtension } from '@prosekit/extensions/strike';
20
- import { TableExtension } from '@prosekit/extensions/table';
21
- import { TextExtension } from '@prosekit/extensions/text';
22
- import { UnderlineExtension } from '@prosekit/extensions/underline';
23
- import { Union } from '@prosekit/core';
24
- import { VirtualSelectionExtension } from '@prosekit/extensions/virtual-selection';
25
-
26
- /**
27
- * @internal
28
- */
29
- export declare type BasicExtension = Union<[
30
- DocExtension,
31
- TextExtension,
32
- ParagraphExtension,
33
- HeadingExtension,
34
- ListExtension,
35
- BlockquoteExtension,
36
- ImageExtension,
37
- HorizontalRuleExtension,
38
- TableExtension,
39
- CodeBlockExtension,
40
- ItalicExtension,
41
- BoldExtension,
42
- UnderlineExtension,
43
- StrikeExtension,
44
- CodeExtension,
45
- LinkExtension,
46
- BaseKeymapExtension,
47
- BaseCommandsExtension,
48
- HistoryExtension,
49
- DropCursorExtension,
50
- GapCursorExtension,
51
- VirtualSelectionExtension,
52
- ModClickPreventionExtension
53
- ]>;
54
-
55
- /**
56
- * Define a basic extension that includes some common functionality. You can
57
- * copy this function and customize it to your needs.
58
- *
59
- * It's a combination of the following extension functions:
60
- *
61
- * - {@link defineDoc}
62
- * - {@link defineText}
63
- * - {@link defineParagraph}
64
- * - {@link defineHeading}
65
- * - {@link defineList}
66
- * - {@link defineBlockquote}
67
- * - {@link defineImage}
68
- * - {@link defineHorizontalRule}
69
- * - {@link defineTable}
70
- * - {@link defineCodeBlock}
71
- * - {@link defineItalic}
72
- * - {@link defineBold}
73
- * - {@link defineUnderline}
74
- * - {@link defineStrike}
75
- * - {@link defineCode}
76
- * - {@link defineLink}
77
- * - {@link defineBaseKeymap}
78
- * - {@link defineBaseCommands}
79
- * - {@link defineHistory}
80
- * - {@link defineDropCursor}
81
- * - {@link defineGapCursor}
82
- * - {@link defineVirtualSelection}
83
- * - {@link defineModClickPrevention}
84
- *
85
- * @public
86
- */
87
- export declare function defineBasicExtension(): BasicExtension;
88
-
89
- export { }