@kerebron/extension-basic-editor 0.4.8 → 0.4.9
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/esm/ExtensionBaseKeymap.js +1 -9
- package/esm/ExtensionBasicCodeEditor.js +2 -12
- package/esm/ExtensionBasicEditor.js +42 -55
- package/esm/ExtensionDropcursor.js +15 -67
- package/esm/ExtensionGapcursor.js +8 -25
- package/esm/ExtensionHistory.js +5 -18
- package/esm/ExtensionHtml.js +1 -9
- package/esm/ExtensionMediaUpload.js +3 -12
- package/esm/ExtensionSelection.js +1 -9
- package/esm/MarkBookmark.js +2 -15
- package/esm/MarkChange.js +2 -15
- package/esm/MarkCode.js +2 -15
- package/esm/MarkHighlight.js +1 -9
- package/esm/MarkItalic.js +2 -15
- package/esm/MarkLink.js +2 -15
- package/esm/MarkStrike.js +2 -15
- package/esm/MarkStrong.js +2 -15
- package/esm/MarkTextColor.js +1 -9
- package/esm/MarkUnderline.js +2 -15
- package/esm/NodeAside.js +2 -15
- package/esm/NodeBlockquote.js +2 -15
- package/esm/NodeBulletList.js +2 -15
- package/esm/NodeCodeBlock.js +1 -9
- package/esm/NodeDefinitionDesc.js +2 -15
- package/esm/NodeDefinitionList.js +2 -15
- package/esm/NodeDefinitionTerm.js +2 -15
- package/esm/NodeDocument.js +1 -9
- package/esm/NodeDocumentCode.js +1 -9
- package/esm/NodeFrontmatter.js +2 -15
- package/esm/NodeHardBreak.js +5 -23
- package/esm/NodeHeading.js +2 -15
- package/esm/NodeHorizontalRule.js +2 -15
- package/esm/NodeImage.js +2 -15
- package/esm/NodeListItem.js +2 -15
- package/esm/NodeMath.js +2 -15
- package/esm/NodeOrderedList.js +20 -38
- package/esm/NodeParagraph.js +2 -15
- package/esm/NodeTaskItem.js +4 -18
- package/esm/NodeTaskList.js +2 -15
- package/esm/NodeText.js +1 -9
- package/esm/NodeVideo.js +2 -15
- package/esm/remote-selection/ExtensionRemoteSelection.js +2 -15
- package/package.json +8 -5
|
@@ -38,15 +38,7 @@ const baseKeymap = mac
|
|
|
38
38
|
? macBaseKeymap
|
|
39
39
|
: pcBaseKeymap;
|
|
40
40
|
export class ExtensionBaseKeymap extends Extension {
|
|
41
|
-
|
|
42
|
-
super(...arguments);
|
|
43
|
-
Object.defineProperty(this, "name", {
|
|
44
|
-
enumerable: true,
|
|
45
|
-
configurable: true,
|
|
46
|
-
writable: true,
|
|
47
|
-
value: 'base-keymap'
|
|
48
|
-
});
|
|
49
|
-
}
|
|
41
|
+
name = 'base-keymap';
|
|
50
42
|
getKeyboardShortcuts() {
|
|
51
43
|
const shortcuts = {
|
|
52
44
|
'Enter': 'enter',
|
|
@@ -8,20 +8,10 @@ import { ExtensionHtml } from './ExtensionHtml.js';
|
|
|
8
8
|
import { NodeText } from './NodeText.js';
|
|
9
9
|
import { ExtensionRemoteSelection } from './remote-selection/ExtensionRemoteSelection.js';
|
|
10
10
|
export class ExtensionBasicCodeEditor extends Extension {
|
|
11
|
+
name = 'basic-code-editor';
|
|
12
|
+
requires;
|
|
11
13
|
constructor({ lang }) {
|
|
12
14
|
super();
|
|
13
|
-
Object.defineProperty(this, "name", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
writable: true,
|
|
17
|
-
value: 'basic-code-editor'
|
|
18
|
-
});
|
|
19
|
-
Object.defineProperty(this, "requires", {
|
|
20
|
-
enumerable: true,
|
|
21
|
-
configurable: true,
|
|
22
|
-
writable: true,
|
|
23
|
-
value: void 0
|
|
24
|
-
});
|
|
25
15
|
this.requires = [
|
|
26
16
|
new ExtensionBaseKeymap(),
|
|
27
17
|
new ExtensionDropcursor(),
|
|
@@ -37,59 +37,46 @@ import { NodeTaskList } from './NodeTaskList.js';
|
|
|
37
37
|
import { NodeTaskItem } from './NodeTaskItem.js';
|
|
38
38
|
import { ExtensionRemoteSelection } from './remote-selection/ExtensionRemoteSelection.js';
|
|
39
39
|
export class ExtensionBasicEditor extends Extension {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
new MarkLink(),
|
|
83
|
-
new MarkItalic(),
|
|
84
|
-
new MarkStrong(),
|
|
85
|
-
new MarkUnderline(),
|
|
86
|
-
new MarkStrike(),
|
|
87
|
-
new MarkCode(),
|
|
88
|
-
new MarkChange(),
|
|
89
|
-
new MarkBookmark(),
|
|
90
|
-
new MarkTextColor(),
|
|
91
|
-
new MarkHighlight(),
|
|
92
|
-
]
|
|
93
|
-
});
|
|
94
|
-
}
|
|
40
|
+
name = 'basic-editor';
|
|
41
|
+
requires = [
|
|
42
|
+
new ExtensionBaseKeymap(),
|
|
43
|
+
new ExtensionDropcursor(),
|
|
44
|
+
new ExtensionGapcursor(),
|
|
45
|
+
new ExtensionHtml(),
|
|
46
|
+
new ExtensionMediaUpload(),
|
|
47
|
+
new ExtensionRemoteSelection(),
|
|
48
|
+
new ExtensionSelection(),
|
|
49
|
+
new NodeDocument(),
|
|
50
|
+
new NodeText(),
|
|
51
|
+
new NodeParagraph(),
|
|
52
|
+
new NodeHardBreak(),
|
|
53
|
+
new NodeHorizontalRule(),
|
|
54
|
+
new NodeOrderedList(),
|
|
55
|
+
new NodeBulletList(),
|
|
56
|
+
new NodeListItem(),
|
|
57
|
+
new NodeTaskList(),
|
|
58
|
+
new NodeTaskItem(),
|
|
59
|
+
new NodeDefinitionList(),
|
|
60
|
+
new NodeDefinitionTerm(),
|
|
61
|
+
new NodeDefinitionDesc(),
|
|
62
|
+
new NodeTaskList(),
|
|
63
|
+
new NodeTaskItem(),
|
|
64
|
+
new NodeFrontmatter(),
|
|
65
|
+
new NodeImage(),
|
|
66
|
+
new NodeVideo(),
|
|
67
|
+
new NodeBlockquote(),
|
|
68
|
+
new NodeAside(),
|
|
69
|
+
new NodeHeading(),
|
|
70
|
+
new NodeMath(),
|
|
71
|
+
new MarkLink(),
|
|
72
|
+
new MarkItalic(),
|
|
73
|
+
new MarkStrong(),
|
|
74
|
+
new MarkUnderline(),
|
|
75
|
+
new MarkStrike(),
|
|
76
|
+
new MarkCode(),
|
|
77
|
+
new MarkChange(),
|
|
78
|
+
new MarkBookmark(),
|
|
79
|
+
new MarkTextColor(),
|
|
80
|
+
new MarkHighlight(),
|
|
81
|
+
];
|
|
95
82
|
}
|
|
@@ -17,55 +17,16 @@ export function dropCursor(options = {}) {
|
|
|
17
17
|
});
|
|
18
18
|
}
|
|
19
19
|
class DropCursorView {
|
|
20
|
+
editorView;
|
|
21
|
+
width;
|
|
22
|
+
color;
|
|
23
|
+
class;
|
|
24
|
+
cursorPos = null;
|
|
25
|
+
element = null;
|
|
26
|
+
timeout = -1;
|
|
27
|
+
handlers;
|
|
20
28
|
constructor(editorView, options) {
|
|
21
|
-
|
|
22
|
-
enumerable: true,
|
|
23
|
-
configurable: true,
|
|
24
|
-
writable: true,
|
|
25
|
-
value: editorView
|
|
26
|
-
});
|
|
27
|
-
Object.defineProperty(this, "width", {
|
|
28
|
-
enumerable: true,
|
|
29
|
-
configurable: true,
|
|
30
|
-
writable: true,
|
|
31
|
-
value: void 0
|
|
32
|
-
});
|
|
33
|
-
Object.defineProperty(this, "color", {
|
|
34
|
-
enumerable: true,
|
|
35
|
-
configurable: true,
|
|
36
|
-
writable: true,
|
|
37
|
-
value: void 0
|
|
38
|
-
});
|
|
39
|
-
Object.defineProperty(this, "class", {
|
|
40
|
-
enumerable: true,
|
|
41
|
-
configurable: true,
|
|
42
|
-
writable: true,
|
|
43
|
-
value: void 0
|
|
44
|
-
});
|
|
45
|
-
Object.defineProperty(this, "cursorPos", {
|
|
46
|
-
enumerable: true,
|
|
47
|
-
configurable: true,
|
|
48
|
-
writable: true,
|
|
49
|
-
value: null
|
|
50
|
-
});
|
|
51
|
-
Object.defineProperty(this, "element", {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
configurable: true,
|
|
54
|
-
writable: true,
|
|
55
|
-
value: null
|
|
56
|
-
});
|
|
57
|
-
Object.defineProperty(this, "timeout", {
|
|
58
|
-
enumerable: true,
|
|
59
|
-
configurable: true,
|
|
60
|
-
writable: true,
|
|
61
|
-
value: -1
|
|
62
|
-
});
|
|
63
|
-
Object.defineProperty(this, "handlers", {
|
|
64
|
-
enumerable: true,
|
|
65
|
-
configurable: true,
|
|
66
|
-
writable: true,
|
|
67
|
-
value: void 0
|
|
68
|
-
});
|
|
29
|
+
this.editorView = editorView;
|
|
69
30
|
this.width = options.width ?? 1;
|
|
70
31
|
this.color = options.color === false
|
|
71
32
|
? undefined
|
|
@@ -211,25 +172,12 @@ class DropCursorView {
|
|
|
211
172
|
}
|
|
212
173
|
}
|
|
213
174
|
export class ExtensionDropcursor extends Extension {
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
value: 'dropcursor'
|
|
221
|
-
});
|
|
222
|
-
Object.defineProperty(this, "options", {
|
|
223
|
-
enumerable: true,
|
|
224
|
-
configurable: true,
|
|
225
|
-
writable: true,
|
|
226
|
-
value: {
|
|
227
|
-
color: 'currentColor',
|
|
228
|
-
width: 1,
|
|
229
|
-
class: undefined,
|
|
230
|
-
}
|
|
231
|
-
});
|
|
232
|
-
}
|
|
175
|
+
name = 'dropcursor';
|
|
176
|
+
options = {
|
|
177
|
+
color: 'currentColor',
|
|
178
|
+
width: 1,
|
|
179
|
+
class: undefined,
|
|
180
|
+
};
|
|
233
181
|
getProseMirrorPlugins() {
|
|
234
182
|
return [
|
|
235
183
|
dropCursor(this.options),
|
|
@@ -91,13 +91,9 @@ export class GapCursor extends Selection {
|
|
|
91
91
|
}
|
|
92
92
|
Selection.jsonID('gapcursor', GapCursor);
|
|
93
93
|
class GapBookmark {
|
|
94
|
+
pos;
|
|
94
95
|
constructor(pos) {
|
|
95
|
-
|
|
96
|
-
enumerable: true,
|
|
97
|
-
configurable: true,
|
|
98
|
-
writable: true,
|
|
99
|
-
value: pos
|
|
100
|
-
});
|
|
96
|
+
this.pos = pos;
|
|
101
97
|
}
|
|
102
98
|
map(mapping) {
|
|
103
99
|
return new GapBookmark(mapping.map(this.pos));
|
|
@@ -239,25 +235,12 @@ function drawGapCursor(state) {
|
|
|
239
235
|
]);
|
|
240
236
|
}
|
|
241
237
|
export class ExtensionGapcursor extends Extension {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
value: 'gapcursor'
|
|
249
|
-
});
|
|
250
|
-
Object.defineProperty(this, "options", {
|
|
251
|
-
enumerable: true,
|
|
252
|
-
configurable: true,
|
|
253
|
-
writable: true,
|
|
254
|
-
value: {
|
|
255
|
-
color: 'currentColor',
|
|
256
|
-
width: 1,
|
|
257
|
-
class: undefined,
|
|
258
|
-
}
|
|
259
|
-
});
|
|
260
|
-
}
|
|
238
|
+
name = 'gapcursor';
|
|
239
|
+
options = {
|
|
240
|
+
color: 'currentColor',
|
|
241
|
+
width: 1,
|
|
242
|
+
class: undefined,
|
|
243
|
+
};
|
|
261
244
|
getProseMirrorPlugins() {
|
|
262
245
|
return [
|
|
263
246
|
gapCursor(),
|
package/esm/ExtensionHistory.js
CHANGED
|
@@ -27,24 +27,11 @@ export const undoInputRule = (state, dispatch) => {
|
|
|
27
27
|
return false;
|
|
28
28
|
};
|
|
29
29
|
export class ExtensionHistory extends Extension {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
writable: true,
|
|
36
|
-
value: 'history'
|
|
37
|
-
});
|
|
38
|
-
Object.defineProperty(this, "options", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
value: {
|
|
43
|
-
depth: 100,
|
|
44
|
-
newGroupDelay: 500,
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
}
|
|
30
|
+
name = 'history';
|
|
31
|
+
options = {
|
|
32
|
+
depth: 100,
|
|
33
|
+
newGroupDelay: 500,
|
|
34
|
+
};
|
|
48
35
|
getCommandFactories(editor) {
|
|
49
36
|
return {
|
|
50
37
|
'undo': () => undo,
|
package/esm/ExtensionHtml.js
CHANGED
|
@@ -81,15 +81,7 @@ export function createFragmentFromHTML(content, schema, options) {
|
|
|
81
81
|
.content;
|
|
82
82
|
}
|
|
83
83
|
export class ExtensionHtml extends Extension {
|
|
84
|
-
|
|
85
|
-
super(...arguments);
|
|
86
|
-
Object.defineProperty(this, "name", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
configurable: true,
|
|
89
|
-
writable: true,
|
|
90
|
-
value: 'html'
|
|
91
|
-
});
|
|
92
|
-
}
|
|
84
|
+
name = 'html';
|
|
93
85
|
getConverters(editor, schema) {
|
|
94
86
|
const config = this.config;
|
|
95
87
|
return {
|
|
@@ -155,20 +155,11 @@ function createMediaUploadPlugin(options = {}) {
|
|
|
155
155
|
}
|
|
156
156
|
/** Extension that adds media upload support via drag & drop and paste */
|
|
157
157
|
export class ExtensionMediaUpload extends Extension {
|
|
158
|
+
config;
|
|
159
|
+
name = 'mediaUpload';
|
|
158
160
|
constructor(config = {}) {
|
|
159
161
|
super(config);
|
|
160
|
-
|
|
161
|
-
enumerable: true,
|
|
162
|
-
configurable: true,
|
|
163
|
-
writable: true,
|
|
164
|
-
value: config
|
|
165
|
-
});
|
|
166
|
-
Object.defineProperty(this, "name", {
|
|
167
|
-
enumerable: true,
|
|
168
|
-
configurable: true,
|
|
169
|
-
writable: true,
|
|
170
|
-
value: 'mediaUpload'
|
|
171
|
-
});
|
|
162
|
+
this.config = config;
|
|
172
163
|
}
|
|
173
164
|
getProseMirrorPlugins() {
|
|
174
165
|
return [createMediaUploadPlugin(this.config)];
|
|
@@ -178,15 +178,7 @@ const selectText = (textStart, length, paraNum = 0) => {
|
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
export class ExtensionSelection extends Extension {
|
|
181
|
-
|
|
182
|
-
super(...arguments);
|
|
183
|
-
Object.defineProperty(this, "name", {
|
|
184
|
-
enumerable: true,
|
|
185
|
-
configurable: true,
|
|
186
|
-
writable: true,
|
|
187
|
-
value: 'selection'
|
|
188
|
-
});
|
|
189
|
-
}
|
|
181
|
+
name = 'selection';
|
|
190
182
|
extractSelection() {
|
|
191
183
|
const state = this.editor.state;
|
|
192
184
|
const { from, to } = state.selection;
|
package/esm/MarkBookmark.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkBookmark extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'bookmark'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'bookmark';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
attrs: {
|
package/esm/MarkChange.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkChange extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'change'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'change';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [],
|
package/esm/MarkCode.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkCode extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'code'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'code';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [{ tag: 'code' }],
|
package/esm/MarkHighlight.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
/** Mark for text highlight (background color) */
|
|
3
3
|
export class MarkHighlight extends Mark {
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'highlight'
|
|
11
|
-
});
|
|
12
|
-
}
|
|
4
|
+
name = 'highlight';
|
|
13
5
|
getMarkSpec() {
|
|
14
6
|
return {
|
|
15
7
|
attrs: {
|
package/esm/MarkItalic.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkItalic extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'em'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'em';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [
|
package/esm/MarkLink.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkLink extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'link'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'link';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
attrs: {
|
package/esm/MarkStrike.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkStrike extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'strike'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'strike';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [
|
package/esm/MarkStrong.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkStrong extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'strong'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'strong';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [
|
package/esm/MarkTextColor.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
/** Mark for text color (foreground color) */
|
|
3
3
|
export class MarkTextColor extends Mark {
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'textColor'
|
|
11
|
-
});
|
|
12
|
-
}
|
|
4
|
+
name = 'textColor';
|
|
13
5
|
getMarkSpec() {
|
|
14
6
|
return {
|
|
15
7
|
attrs: {
|
package/esm/MarkUnderline.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Mark } from '@kerebron/editor';
|
|
2
2
|
export class MarkUnderline extends Mark {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'underline'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'underline';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getMarkSpec() {
|
|
19
6
|
return {
|
|
20
7
|
parseDOM: [
|
package/esm/NodeAside.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeAside extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'aside'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'aside';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'block+',
|
package/esm/NodeBlockquote.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
import { wrappingInputRule, } from '@kerebron/editor/plugins/input-rules';
|
|
3
3
|
export class NodeBlockquote extends Node {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'blockquote'
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(this, "requires", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: ['doc']
|
|
17
|
-
});
|
|
18
|
-
}
|
|
4
|
+
name = 'blockquote';
|
|
5
|
+
requires = ['doc'];
|
|
19
6
|
getNodeSpec() {
|
|
20
7
|
return {
|
|
21
8
|
content: 'block+',
|
package/esm/NodeBulletList.js
CHANGED
|
@@ -1,21 +1,8 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
import { wrappingInputRule, } from '@kerebron/editor/plugins/input-rules';
|
|
3
3
|
export class NodeBulletList extends Node {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'bullet_list'
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(this, "requires", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: ['doc']
|
|
17
|
-
});
|
|
18
|
-
}
|
|
4
|
+
name = 'bullet_list';
|
|
5
|
+
requires = ['doc'];
|
|
19
6
|
getNodeSpec() {
|
|
20
7
|
return {
|
|
21
8
|
content: 'list_item+',
|
package/esm/NodeCodeBlock.js
CHANGED
|
@@ -1,15 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
import { textblockTypeInputRule, } from '@kerebron/editor/plugins/input-rules';
|
|
3
3
|
export class NodeCodeBlock extends Node {
|
|
4
|
-
|
|
5
|
-
super(...arguments);
|
|
6
|
-
Object.defineProperty(this, "name", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
configurable: true,
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'code_block'
|
|
11
|
-
});
|
|
12
|
-
}
|
|
4
|
+
name = 'code_block';
|
|
13
5
|
getNodeSpec() {
|
|
14
6
|
// const langs = this.config.languageWhitelist || LANGS;
|
|
15
7
|
return {
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeDefinitionDesc extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'dd'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['dl']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'dd';
|
|
4
|
+
requires = ['dl'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'inline*',
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeDefinitionList extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'dl'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'dl';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'dt+|dd+',
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeDefinitionTerm extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'dt'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['dl']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'dt';
|
|
4
|
+
requires = ['dl'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'inline*',
|
package/esm/NodeDocument.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeDocument extends Node {
|
|
3
|
-
|
|
4
|
-
super(...arguments);
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'doc'
|
|
10
|
-
});
|
|
11
|
-
}
|
|
3
|
+
name = 'doc';
|
|
12
4
|
getNodeSpec() {
|
|
13
5
|
return {
|
|
14
6
|
content: 'block+',
|
package/esm/NodeDocumentCode.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeDocumentCode extends Node {
|
|
3
|
-
|
|
4
|
-
super(...arguments);
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'doc_code'
|
|
10
|
-
});
|
|
11
|
-
}
|
|
3
|
+
name = 'doc_code';
|
|
12
4
|
getNodeSpec() {
|
|
13
5
|
return {
|
|
14
6
|
content: 'code_block',
|
package/esm/NodeFrontmatter.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeFrontmatter extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'frontmatter'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'frontmatter';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'inline*',
|
package/esm/NodeHardBreak.js
CHANGED
|
@@ -1,29 +1,11 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
import { firstCommand } from '@kerebron/editor/commands';
|
|
3
3
|
export class NodeHardBreak extends Node {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
writable: true,
|
|
10
|
-
value: 'br'
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(this, "requires", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
configurable: true,
|
|
15
|
-
writable: true,
|
|
16
|
-
value: ['doc']
|
|
17
|
-
});
|
|
18
|
-
Object.defineProperty(this, "options", {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
configurable: true,
|
|
21
|
-
writable: true,
|
|
22
|
-
value: {
|
|
23
|
-
keepMarks: true,
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
}
|
|
4
|
+
name = 'br';
|
|
5
|
+
requires = ['doc'];
|
|
6
|
+
options = {
|
|
7
|
+
keepMarks: true,
|
|
8
|
+
};
|
|
27
9
|
getNodeSpec() {
|
|
28
10
|
return {
|
|
29
11
|
inline: true,
|
package/esm/NodeHeading.js
CHANGED
|
@@ -2,21 +2,8 @@ import { Node } from '@kerebron/editor';
|
|
|
2
2
|
import { textblockTypeInputRule, } from '@kerebron/editor/plugins/input-rules';
|
|
3
3
|
const maxLevel = 6;
|
|
4
4
|
export class NodeHeading extends Node {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(this, "name", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
configurable: true,
|
|
10
|
-
writable: true,
|
|
11
|
-
value: 'heading'
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(this, "requires", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
writable: true,
|
|
17
|
-
value: ['doc']
|
|
18
|
-
});
|
|
19
|
-
}
|
|
5
|
+
name = 'heading';
|
|
6
|
+
requires = ['doc'];
|
|
20
7
|
getNodeSpec() {
|
|
21
8
|
return {
|
|
22
9
|
attrs: { level: { default: 1 } },
|
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeHorizontalRule extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'hr'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'hr';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
group: 'block',
|
package/esm/NodeImage.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeImage extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'image'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'image';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
inline: true,
|
package/esm/NodeListItem.js
CHANGED
|
@@ -170,21 +170,8 @@ export function sinkListItem(itemType) {
|
|
|
170
170
|
};
|
|
171
171
|
}
|
|
172
172
|
export class NodeListItem extends Node {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
Object.defineProperty(this, "name", {
|
|
176
|
-
enumerable: true,
|
|
177
|
-
configurable: true,
|
|
178
|
-
writable: true,
|
|
179
|
-
value: 'list_item'
|
|
180
|
-
});
|
|
181
|
-
Object.defineProperty(this, "requires", {
|
|
182
|
-
enumerable: true,
|
|
183
|
-
configurable: true,
|
|
184
|
-
writable: true,
|
|
185
|
-
value: ['doc']
|
|
186
|
-
});
|
|
187
|
-
}
|
|
173
|
+
name = 'list_item';
|
|
174
|
+
requires = ['doc'];
|
|
188
175
|
getNodeSpec() {
|
|
189
176
|
return {
|
|
190
177
|
content: 'paragraph block*',
|
package/esm/NodeMath.js
CHANGED
|
@@ -3,21 +3,8 @@ import { Node } from '@kerebron/editor';
|
|
|
3
3
|
// const latex = MathMLToLaTeX.convert(mathMl);
|
|
4
4
|
// https://mathlive.io/mathfield/
|
|
5
5
|
export class NodeMath extends Node {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
Object.defineProperty(this, "name", {
|
|
9
|
-
enumerable: true,
|
|
10
|
-
configurable: true,
|
|
11
|
-
writable: true,
|
|
12
|
-
value: 'math'
|
|
13
|
-
});
|
|
14
|
-
Object.defineProperty(this, "requires", {
|
|
15
|
-
enumerable: true,
|
|
16
|
-
configurable: true,
|
|
17
|
-
writable: true,
|
|
18
|
-
value: ['doc']
|
|
19
|
-
});
|
|
20
|
-
}
|
|
6
|
+
name = 'math';
|
|
7
|
+
requires = ['doc'];
|
|
21
8
|
getNodeSpec() {
|
|
22
9
|
return {
|
|
23
10
|
inline: true,
|
package/esm/NodeOrderedList.js
CHANGED
|
@@ -2,44 +2,26 @@ import { Node } from '@kerebron/editor';
|
|
|
2
2
|
import { getHtmlAttributes, setHtmlAttributes, } from '@kerebron/editor/utilities';
|
|
3
3
|
import { wrappingInputRule, } from '@kerebron/editor/plugins/input-rules';
|
|
4
4
|
export class NodeOrderedList extends Node {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
default: '1',
|
|
26
|
-
fromDom(element) {
|
|
27
|
-
return element.hasAttribute('type')
|
|
28
|
-
? element.getAttribute('type')
|
|
29
|
-
: '1';
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
start: {
|
|
33
|
-
default: 1,
|
|
34
|
-
fromDom(element) {
|
|
35
|
-
return element.hasAttribute('start')
|
|
36
|
-
? +element.getAttribute('start')
|
|
37
|
-
: 1;
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
}
|
|
5
|
+
name = 'ordered_list';
|
|
6
|
+
requires = ['doc'];
|
|
7
|
+
attributes = {
|
|
8
|
+
type: {
|
|
9
|
+
default: '1',
|
|
10
|
+
fromDom(element) {
|
|
11
|
+
return element.hasAttribute('type')
|
|
12
|
+
? element.getAttribute('type')
|
|
13
|
+
: '1';
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
start: {
|
|
17
|
+
default: 1,
|
|
18
|
+
fromDom(element) {
|
|
19
|
+
return element.hasAttribute('start')
|
|
20
|
+
? +element.getAttribute('start')
|
|
21
|
+
: 1;
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
};
|
|
43
25
|
getNodeSpec() {
|
|
44
26
|
return {
|
|
45
27
|
group: 'block',
|
package/esm/NodeParagraph.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeParagraph extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'paragraph'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'paragraph';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'inline*',
|
package/esm/NodeTaskItem.js
CHANGED
|
@@ -6,26 +6,12 @@ import { liftListItem, sinkListItem, splitListItem, } from './NodeListItem.js';
|
|
|
6
6
|
*/
|
|
7
7
|
export const inputRegex = /^\s*(\[([( |x])?\])\s$/;
|
|
8
8
|
export class NodeTaskItem extends Node {
|
|
9
|
+
config;
|
|
10
|
+
name = 'task_item';
|
|
11
|
+
requires = ['doc'];
|
|
9
12
|
constructor(config = {}) {
|
|
10
13
|
super(config);
|
|
11
|
-
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: config
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "name", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: 'task_item'
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "requires", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: ['doc']
|
|
28
|
-
});
|
|
14
|
+
this.config = config;
|
|
29
15
|
}
|
|
30
16
|
getNodeSpec() {
|
|
31
17
|
return {
|
package/esm/NodeTaskList.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeTaskList extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'task_list'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'task_list';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
content: 'list_item+',
|
package/esm/NodeText.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeText extends Node {
|
|
3
|
-
|
|
4
|
-
super(...arguments);
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'text'
|
|
10
|
-
});
|
|
11
|
-
}
|
|
3
|
+
name = 'text';
|
|
12
4
|
getNodeSpec() {
|
|
13
5
|
return {
|
|
14
6
|
group: 'inline',
|
package/esm/NodeVideo.js
CHANGED
|
@@ -1,20 +1,7 @@
|
|
|
1
1
|
import { Node } from '@kerebron/editor';
|
|
2
2
|
export class NodeVideo extends Node {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(this, "name", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
configurable: true,
|
|
8
|
-
writable: true,
|
|
9
|
-
value: 'video'
|
|
10
|
-
});
|
|
11
|
-
Object.defineProperty(this, "requires", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: ['doc']
|
|
16
|
-
});
|
|
17
|
-
}
|
|
3
|
+
name = 'video';
|
|
4
|
+
requires = ['doc'];
|
|
18
5
|
getNodeSpec() {
|
|
19
6
|
return {
|
|
20
7
|
attrs: {
|
|
@@ -2,21 +2,8 @@ import { Extension } from '@kerebron/editor';
|
|
|
2
2
|
import { remoteSelectionPlugin } from './remoteSelectionPlugin.js';
|
|
3
3
|
export { remoteSelectionPluginKey } from './remoteSelectionPlugin.js';
|
|
4
4
|
export class ExtensionRemoteSelection extends Extension {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(this, "name", {
|
|
8
|
-
enumerable: true,
|
|
9
|
-
configurable: true,
|
|
10
|
-
writable: true,
|
|
11
|
-
value: 'remote-selection'
|
|
12
|
-
});
|
|
13
|
-
Object.defineProperty(this, "remoteStates", {
|
|
14
|
-
enumerable: true,
|
|
15
|
-
configurable: true,
|
|
16
|
-
writable: true,
|
|
17
|
-
value: []
|
|
18
|
-
});
|
|
19
|
-
}
|
|
5
|
+
name = 'remote-selection';
|
|
6
|
+
remoteStates = [];
|
|
20
7
|
getProseMirrorPlugins() {
|
|
21
8
|
return [
|
|
22
9
|
remoteSelectionPlugin(this, this.editor),
|
package/package.json
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kerebron/extension-basic-editor",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"module": "./esm/ExtensionBasicEditor.js",
|
|
6
6
|
"exports": {
|
|
7
|
-
".": {
|
|
8
|
-
"import": "./esm/ExtensionBasicEditor.js"
|
|
9
|
-
},
|
|
10
7
|
"./ExtensionBasicEditor": {
|
|
11
8
|
"import": "./esm/ExtensionBasicEditor.js"
|
|
12
9
|
},
|
|
@@ -67,6 +64,12 @@
|
|
|
67
64
|
"./NodeListItem": {
|
|
68
65
|
"import": "./esm/NodeListItem.js"
|
|
69
66
|
},
|
|
67
|
+
"./NodeTaskList": {
|
|
68
|
+
"import": "./esm/NodeTaskList.js"
|
|
69
|
+
},
|
|
70
|
+
"./NodeTaskItem": {
|
|
71
|
+
"import": "./esm/NodeTaskItem.js"
|
|
72
|
+
},
|
|
70
73
|
"./NodeImage": {
|
|
71
74
|
"import": "./esm/NodeImage.js"
|
|
72
75
|
},
|
|
@@ -100,7 +103,7 @@
|
|
|
100
103
|
},
|
|
101
104
|
"scripts": {},
|
|
102
105
|
"dependencies": {
|
|
103
|
-
"@kerebron/editor": "0.4.
|
|
106
|
+
"@kerebron/editor": "0.4.9",
|
|
104
107
|
"prosemirror-history": "1.4.1",
|
|
105
108
|
"prosemirror-model": "1.25.3",
|
|
106
109
|
"prosemirror-state": "1.4.3",
|