@prosekit/basic 0.4.1 → 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.
- package/dist/prosekit-basic.d.ts +68 -2
- package/dist/prosekit-basic.js +89 -98
- package/dist/style.css +57 -56
- package/dist/style.js +0 -0
- package/dist/typography.css +76 -76
- package/dist/typography.js +0 -0
- package/package.json +21 -11
- package/dist/_tsup-dts-rollup.d.ts +0 -89
package/dist/prosekit-basic.d.ts
CHANGED
@@ -1,2 +1,68 @@
|
|
1
|
-
|
2
|
-
|
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 };
|
package/dist/prosekit-basic.js
CHANGED
@@ -1,100 +1,91 @@
|
|
1
|
-
|
2
|
-
import {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
} from "@prosekit/
|
8
|
-
import {
|
9
|
-
|
10
|
-
} from "@prosekit/extensions/
|
11
|
-
import {
|
12
|
-
|
13
|
-
} from "@prosekit/extensions/
|
14
|
-
import {
|
15
|
-
|
16
|
-
} from "@prosekit/extensions/
|
17
|
-
import {
|
18
|
-
|
19
|
-
} from "@prosekit/extensions/
|
20
|
-
import {
|
21
|
-
|
22
|
-
} from "@prosekit/extensions/
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
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
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
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
|
-
|
99
|
-
|
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
|
-
|
20
|
-
|
21
|
-
}
|
22
|
-
.ProseMirror-hideselection
|
23
|
-
|
24
|
-
|
25
|
-
.ProseMirror-
|
26
|
-
|
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
|
-
/*
|
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
|
-
|
156
|
-
.ProseMirror th {
|
157
|
-
vertical-align: top;
|
156
|
+
|
157
|
+
.ProseMirror td, .ProseMirror th {
|
158
158
|
box-sizing: border-box;
|
159
|
-
|
159
|
+
vertical-align: top;
|
160
160
|
border-width: 1px;
|
161
|
-
padding-left:
|
162
|
-
padding-right:
|
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
|
-
|
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
|
-
|
188
|
-
|
189
|
-
|
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
|
-
|
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
|
-
|
237
|
+
|
package/dist/style.js
ADDED
File without changes
|
package/dist/typography.css
CHANGED
@@ -1,160 +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
|
-
|
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
|
-
|
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
|
-
|
28
|
-
div.ProseMirror h2,
|
29
|
-
|
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
|
-
|
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
|
-
|
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:
|
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
|
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
|
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:
|
60
|
+
margin: .5em 0;
|
73
61
|
}
|
62
|
+
|
74
63
|
div.ProseMirror h6 {
|
75
|
-
opacity:
|
64
|
+
opacity: .8;
|
76
65
|
}
|
77
|
-
|
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:
|
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
|
-
|
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
|
-
|
111
|
+
|
112
|
+
div.ProseMirror .prosekit-horizontal-rule hr {
|
118
113
|
margin: 0;
|
119
114
|
}
|
115
|
+
|
120
116
|
div.ProseMirror .tableWrapper {
|
121
|
-
margin-top:
|
117
|
+
margin-top: .5em;
|
122
118
|
margin-bottom: 1em;
|
123
119
|
}
|
120
|
+
|
124
121
|
div.ProseMirror .prosemirror-flat-list {
|
125
122
|
line-height: 1.5;
|
126
123
|
}
|
127
|
-
|
128
|
-
:
|
129
|
-
top:
|
124
|
+
|
125
|
+
div.ProseMirror .prosemirror-flat-list:before, div.ProseMirror .prosemirror-flat-list > .list-marker {
|
126
|
+
top: .5rem;
|
130
127
|
}
|
131
|
-
|
132
|
-
:
|
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 {
|
133
130
|
top: 1em;
|
134
131
|
}
|
135
|
-
|
136
|
-
:
|
137
|
-
top:
|
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;
|
138
135
|
}
|
139
|
-
|
140
|
-
:
|
141
|
-
top:
|
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;
|
142
139
|
}
|
143
|
-
|
144
|
-
:
|
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 {
|
145
142
|
top: 0;
|
146
143
|
}
|
147
|
-
|
148
|
-
:
|
149
|
-
top:
|
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;
|
150
147
|
}
|
151
|
-
|
152
|
-
:
|
153
|
-
top:
|
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;
|
154
151
|
}
|
152
|
+
|
155
153
|
div.ProseMirror .ProseMirror-selectednode {
|
156
154
|
z-index: calc(infinity);
|
157
155
|
}
|
158
|
-
|
156
|
+
|
157
|
+
div.ProseMirror div[data-node-view-root="true"] {
|
159
158
|
display: contents;
|
160
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
|
+
"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"
|
@@ -40,21 +41,30 @@
|
|
40
41
|
"dist"
|
41
42
|
],
|
42
43
|
"dependencies": {
|
43
|
-
"@prosekit/core": "^0.8.
|
44
|
-
"@prosekit/extensions": "^0.
|
45
|
-
"@prosekit/pm": "^0.1.
|
44
|
+
"@prosekit/core": "^0.8.1",
|
45
|
+
"@prosekit/extensions": "^0.9.0",
|
46
|
+
"@prosekit/pm": "^0.1.10"
|
46
47
|
},
|
47
48
|
"devDependencies": {
|
48
|
-
"
|
49
|
-
"
|
50
|
-
"
|
51
|
-
"
|
52
|
-
"
|
53
|
-
|
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
|
+
}
|
54
64
|
},
|
55
65
|
"scripts": {
|
56
66
|
"build:tsc": "tsc -b tsconfig.json",
|
57
|
-
"build:
|
67
|
+
"build:tsdown": "tsdown"
|
58
68
|
},
|
59
69
|
"types": "./dist/prosekit-basic.d.ts",
|
60
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 { }
|