@openleaf-editor/core 0.1.0-beta.0 → 0.1.0-beta.2
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/autolink.d.ts +12 -0
- package/dist/autolink.d.ts.map +1 -0
- package/dist/autolink.js +98 -0
- package/dist/autolink.js.map +1 -0
- package/dist/commands.d.ts +109 -1
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +639 -10
- package/dist/commands.js.map +1 -1
- package/dist/css.d.ts +176 -0
- package/dist/css.d.ts.map +1 -0
- package/dist/css.js +517 -0
- package/dist/css.js.map +1 -0
- package/dist/embed.d.ts +52 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/embed.js +116 -0
- package/dist/embed.js.map +1 -0
- package/dist/extensions.d.ts.map +1 -1
- package/dist/extensions.js +104 -4
- package/dist/extensions.js.map +1 -1
- package/dist/formats.d.ts +44 -0
- package/dist/formats.d.ts.map +1 -0
- package/dist/formats.js +111 -0
- package/dist/formats.js.map +1 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/dist/keymap.d.ts.map +1 -1
- package/dist/keymap.js +15 -3
- package/dist/keymap.js.map +1 -1
- package/dist/noneditable.d.ts +14 -0
- package/dist/noneditable.d.ts.map +1 -0
- package/dist/noneditable.js +93 -0
- package/dist/noneditable.js.map +1 -0
- package/dist/preserve.d.ts +53 -0
- package/dist/preserve.d.ts.map +1 -1
- package/dist/preserve.js +133 -4
- package/dist/preserve.js.map +1 -1
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +331 -61
- package/dist/schema.js.map +1 -1
- package/dist/structure.d.ts +44 -0
- package/dist/structure.d.ts.map +1 -0
- package/dist/structure.js +379 -0
- package/dist/structure.js.map +1 -0
- package/dist/tables.d.ts +13 -0
- package/dist/tables.d.ts.map +1 -1
- package/dist/tables.js +224 -19
- package/dist/tables.js.map +1 -1
- package/dist/tokens.d.ts +28 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +68 -0
- package/dist/tokens.js.map +1 -0
- package/dist/visual-aids.d.ts +10 -0
- package/dist/visual-aids.d.ts.map +1 -0
- package/dist/visual-aids.js +61 -0
- package/dist/visual-aids.js.map +1 -0
- package/package.json +3 -2
package/dist/schema.js
CHANGED
|
@@ -8,9 +8,138 @@
|
|
|
8
8
|
* there rather than at the package boundary.
|
|
9
9
|
*/
|
|
10
10
|
import { Schema } from 'prosemirror-model';
|
|
11
|
-
import {
|
|
11
|
+
import { applyStyleAttribute, indentCss, indentLevels, isFullyModelledStyle, parseDeclarations, safeAlign, safeColor, safeDir, safeFontFamily, safeFontSize, safeLang, safeLineHeight, safeListStyle, serializeDeclarations } from './css.js';
|
|
12
|
+
import { serializationTarget, unknownBlock, unknownInline } from './preserve.js';
|
|
13
|
+
import { audio, details, figcaption, figure, iframe, imageDomAttrs, imageParseAttrs, named_anchor, page_break, summary, video, } from './structure.js';
|
|
12
14
|
import { table, table_cell, table_header, table_row } from './tables.js';
|
|
15
|
+
import { safeId } from './tokens.js';
|
|
13
16
|
import { isSafeUrl } from './url.js';
|
|
17
|
+
/**
|
|
18
|
+
* Read the attributes every text block shares: direction and alignment.
|
|
19
|
+
*
|
|
20
|
+
* Alignment is read from `text-align` first and the legacy `align` attribute
|
|
21
|
+
* second, because content that carries both was almost always produced by an
|
|
22
|
+
* editor that wrote the modern form and left the old one behind. Reading the
|
|
23
|
+
* legacy attribute at all is the point: `<p align="center">` is what fifteen
|
|
24
|
+
* years of CMS content looks like, and a schema that only understands the
|
|
25
|
+
* declaration silently centres nothing.
|
|
26
|
+
*/
|
|
27
|
+
function textBlockAttrs(el) {
|
|
28
|
+
const dir = safeDir(el.getAttribute('dir'));
|
|
29
|
+
const declarations = parseDeclarations(el.getAttribute('style'));
|
|
30
|
+
return {
|
|
31
|
+
dir,
|
|
32
|
+
align: safeAlign(declarations.get('text-align') ?? el.getAttribute('align'), dir),
|
|
33
|
+
lineHeight: safeLineHeight(declarations.get('line-height') ?? null),
|
|
34
|
+
indent: readIndent(declarations),
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function readIndent(declarations) {
|
|
38
|
+
for (const property of [
|
|
39
|
+
'padding-inline-start',
|
|
40
|
+
'margin-inline-start',
|
|
41
|
+
'padding-left',
|
|
42
|
+
'margin-left',
|
|
43
|
+
]) {
|
|
44
|
+
const steps = indentLevels(declarations.get(property));
|
|
45
|
+
if (steps !== null)
|
|
46
|
+
return steps;
|
|
47
|
+
}
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
function headingAttrs(el, level) {
|
|
51
|
+
return { level, id: safeId(el.getAttribute('id')), ...textBlockAttrs(el) };
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Write them back.
|
|
55
|
+
*
|
|
56
|
+
* Alignment, line height and indent go out as a single `style` attribute in a
|
|
57
|
+
* stable order, never as the legacy `align` attribute, so stored content
|
|
58
|
+
* converges on the form that is still valid HTML. The `align` attribute the
|
|
59
|
+
* value may have been read from is dropped from the carried residue by
|
|
60
|
+
* extensions.ts.
|
|
61
|
+
*/
|
|
62
|
+
function textBlockDOMAttrs(attrs) {
|
|
63
|
+
const out = {};
|
|
64
|
+
const dir = attrs['dir'];
|
|
65
|
+
if (dir !== null)
|
|
66
|
+
out['dir'] = dir;
|
|
67
|
+
const id = attrs['id'];
|
|
68
|
+
if (id)
|
|
69
|
+
out['id'] = id;
|
|
70
|
+
const declarations = new Map();
|
|
71
|
+
const align = attrs['align'];
|
|
72
|
+
if (align !== null)
|
|
73
|
+
declarations.set('text-align', align);
|
|
74
|
+
const lineHeight = attrs['lineHeight'];
|
|
75
|
+
if (lineHeight !== null)
|
|
76
|
+
declarations.set('line-height', lineHeight);
|
|
77
|
+
const indent = attrs['indent'];
|
|
78
|
+
if (indent !== null && indent > 0)
|
|
79
|
+
declarations.set('padding-inline-start', indentCss(indent));
|
|
80
|
+
const style = serializeDeclarations(declarations);
|
|
81
|
+
if (style !== null)
|
|
82
|
+
out['style'] = style;
|
|
83
|
+
return out;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* An element carrying these attributes, with `style` applied directly.
|
|
87
|
+
*
|
|
88
|
+
* Returned instead of a `['p', attrs, 0]` spec ONLY when there is CSS to write,
|
|
89
|
+
* because the serializer would otherwise put the declaration through the CSSOM
|
|
90
|
+
* and rewrite it. See applyStyleAttribute for why that matters. Everything with
|
|
91
|
+
* no style stays on the plain spec path, which is both cheaper and less code to
|
|
92
|
+
* be wrong about.
|
|
93
|
+
*/
|
|
94
|
+
function elementWithStyle(tag, attrs) {
|
|
95
|
+
const el = serializationTarget().createElement(tag);
|
|
96
|
+
for (const [name, value] of Object.entries(attrs)) {
|
|
97
|
+
if (name === 'style')
|
|
98
|
+
applyStyleAttribute(el, value);
|
|
99
|
+
else
|
|
100
|
+
el.setAttribute(name, value);
|
|
101
|
+
}
|
|
102
|
+
return { dom: el, contentDOM: el };
|
|
103
|
+
}
|
|
104
|
+
/** `toDOM` for a text block: a spec array normally, an element when it has CSS. */
|
|
105
|
+
function textBlockToDOM(tag, attrs) {
|
|
106
|
+
const domAttrs = textBlockDOMAttrs(attrs);
|
|
107
|
+
if (domAttrs['style'] !== undefined)
|
|
108
|
+
return elementWithStyle(tag, domAttrs);
|
|
109
|
+
return Object.keys(domAttrs).length > 0 ? [tag, domAttrs, 0] : [tag, 0];
|
|
110
|
+
}
|
|
111
|
+
function listAttrs(el, ordered) {
|
|
112
|
+
const declarations = parseDeclarations(el.getAttribute('style'));
|
|
113
|
+
const fromStyle = safeListStyle(declarations.get('list-style-type') ?? null);
|
|
114
|
+
const fromType = safeListStyle(el.getAttribute('type'));
|
|
115
|
+
const listStyle = fromStyle ?? fromType;
|
|
116
|
+
if (!ordered)
|
|
117
|
+
return { listStyle };
|
|
118
|
+
const start = el.getAttribute('start');
|
|
119
|
+
return { start: start ? Number(start) : 1, listStyle };
|
|
120
|
+
}
|
|
121
|
+
function listToDOM(tag, attrs) {
|
|
122
|
+
const out = {};
|
|
123
|
+
if (tag === 'ol') {
|
|
124
|
+
const start = attrs['start'];
|
|
125
|
+
if (start !== 1)
|
|
126
|
+
out['start'] = String(start);
|
|
127
|
+
}
|
|
128
|
+
const listStyle = attrs['listStyle'];
|
|
129
|
+
if (listStyle !== null)
|
|
130
|
+
out['style'] = `list-style-type:${listStyle}`;
|
|
131
|
+
if (out['style'] !== undefined) {
|
|
132
|
+
const el = serializationTarget().createElement(tag);
|
|
133
|
+
for (const [name, value] of Object.entries(out)) {
|
|
134
|
+
if (name === 'style')
|
|
135
|
+
applyStyleAttribute(el, value);
|
|
136
|
+
else
|
|
137
|
+
el.setAttribute(name, value);
|
|
138
|
+
}
|
|
139
|
+
return { dom: el, contentDOM: el };
|
|
140
|
+
}
|
|
141
|
+
return Object.keys(out).length > 0 ? [tag, out, 0] : [tag, 0];
|
|
142
|
+
}
|
|
14
143
|
/** The base node specs. Extensions are appended to these. */
|
|
15
144
|
export const coreNodes = {
|
|
16
145
|
doc: { content: 'block+' },
|
|
@@ -19,34 +148,40 @@ export const coreNodes = {
|
|
|
19
148
|
// silently breaks Arabic, Hebrew and Persian content, so it is a
|
|
20
149
|
// first-class schema attribute rather than something the preservation
|
|
21
150
|
// layer has to rescue.
|
|
22
|
-
|
|
151
|
+
//
|
|
152
|
+
// `align` is styling, and is modelled anyway. Left to the preservation
|
|
153
|
+
// layer it survives as opaque residue -- faithful, but invisible to the
|
|
154
|
+
// toolbar, so an author cannot see that a paragraph is centred or change
|
|
155
|
+
// it. A formatting control the editor cannot express is a feature request
|
|
156
|
+
// the schema is answering.
|
|
157
|
+
attrs: {
|
|
158
|
+
dir: { default: null },
|
|
159
|
+
align: { default: null },
|
|
160
|
+
lineHeight: { default: null },
|
|
161
|
+
indent: { default: null },
|
|
162
|
+
},
|
|
23
163
|
content: 'inline*',
|
|
24
164
|
group: 'block',
|
|
25
|
-
parseDOM: [
|
|
26
|
-
|
|
27
|
-
tag: 'p',
|
|
28
|
-
getAttrs: (dom) => ({ dir: dom.getAttribute('dir') }),
|
|
29
|
-
},
|
|
30
|
-
],
|
|
31
|
-
toDOM(node) {
|
|
32
|
-
const dir = node.attrs['dir'];
|
|
33
|
-
return dir ? ['p', { dir }, 0] : ['p', 0];
|
|
34
|
-
},
|
|
165
|
+
parseDOM: [{ tag: 'p', getAttrs: (dom) => textBlockAttrs(dom) }],
|
|
166
|
+
toDOM: (node) => textBlockToDOM('p', node.attrs),
|
|
35
167
|
},
|
|
36
168
|
heading: {
|
|
37
|
-
attrs: {
|
|
169
|
+
attrs: {
|
|
170
|
+
level: { default: 1 },
|
|
171
|
+
dir: { default: null },
|
|
172
|
+
align: { default: null },
|
|
173
|
+
lineHeight: { default: null },
|
|
174
|
+
indent: { default: null },
|
|
175
|
+
id: { default: null },
|
|
176
|
+
},
|
|
38
177
|
content: 'inline*',
|
|
39
178
|
group: 'block',
|
|
40
179
|
defining: true,
|
|
41
180
|
parseDOM: [1, 2, 3, 4, 5, 6].map((level) => ({
|
|
42
181
|
tag: `h${level}`,
|
|
43
|
-
getAttrs: (dom) => (
|
|
182
|
+
getAttrs: (dom) => headingAttrs(dom, level),
|
|
44
183
|
})),
|
|
45
|
-
toDOM(node) {
|
|
46
|
-
const tag = `h${node.attrs['level']}`;
|
|
47
|
-
const dir = node.attrs['dir'];
|
|
48
|
-
return dir ? [tag, { dir }, 0] : [tag, 0];
|
|
49
|
-
},
|
|
184
|
+
toDOM: (node) => textBlockToDOM(`h${node.attrs['level']}`, node.attrs),
|
|
50
185
|
},
|
|
51
186
|
blockquote: {
|
|
52
187
|
content: 'block+',
|
|
@@ -91,32 +226,37 @@ export const coreNodes = {
|
|
|
91
226
|
},
|
|
92
227
|
horizontal_rule: {
|
|
93
228
|
group: 'block',
|
|
94
|
-
parseDOM: [
|
|
229
|
+
parseDOM: [
|
|
230
|
+
{
|
|
231
|
+
tag: 'hr',
|
|
232
|
+
getAttrs: (dom) => (dom.classList.contains('ol-pagebreak') ? false : null),
|
|
233
|
+
},
|
|
234
|
+
],
|
|
95
235
|
toDOM: () => ['hr'],
|
|
96
236
|
},
|
|
97
237
|
bullet_list: {
|
|
238
|
+
attrs: { listStyle: { default: null } },
|
|
98
239
|
content: 'list_item+',
|
|
99
240
|
group: 'block',
|
|
100
|
-
parseDOM: [
|
|
101
|
-
|
|
241
|
+
parseDOM: [
|
|
242
|
+
{
|
|
243
|
+
tag: 'ul',
|
|
244
|
+
getAttrs: (dom) => listAttrs(dom, false),
|
|
245
|
+
},
|
|
246
|
+
],
|
|
247
|
+
toDOM: (node) => listToDOM('ul', node.attrs),
|
|
102
248
|
},
|
|
103
249
|
ordered_list: {
|
|
104
|
-
attrs: { start: { default: 1 } },
|
|
250
|
+
attrs: { start: { default: 1 }, listStyle: { default: null } },
|
|
105
251
|
content: 'list_item+',
|
|
106
252
|
group: 'block',
|
|
107
253
|
parseDOM: [
|
|
108
254
|
{
|
|
109
255
|
tag: 'ol',
|
|
110
|
-
getAttrs(dom)
|
|
111
|
-
const start = dom.getAttribute('start');
|
|
112
|
-
return { start: start ? Number(start) : 1 };
|
|
113
|
-
},
|
|
256
|
+
getAttrs: (dom) => listAttrs(dom, true),
|
|
114
257
|
},
|
|
115
258
|
],
|
|
116
|
-
toDOM(node)
|
|
117
|
-
const start = node.attrs['start'];
|
|
118
|
-
return start === 1 ? ['ol', 0] : ['ol', { start: String(start) }, 0];
|
|
119
|
-
},
|
|
259
|
+
toDOM: (node) => listToDOM('ol', node.attrs),
|
|
120
260
|
},
|
|
121
261
|
list_item: {
|
|
122
262
|
content: 'paragraph block*',
|
|
@@ -134,41 +274,16 @@ export const coreNodes = {
|
|
|
134
274
|
title: { default: null },
|
|
135
275
|
width: { default: null },
|
|
136
276
|
height: { default: null },
|
|
277
|
+
align: { default: null },
|
|
278
|
+
className: { default: null },
|
|
137
279
|
},
|
|
138
280
|
parseDOM: [
|
|
139
281
|
{
|
|
140
282
|
tag: 'img[src]',
|
|
141
|
-
getAttrs(dom)
|
|
142
|
-
const el = dom;
|
|
143
|
-
// Returning false declines the rule, so an image with a
|
|
144
|
-
// `javascript:` src is dropped rather than carried through.
|
|
145
|
-
if (!isSafeUrl(el.getAttribute('src')))
|
|
146
|
-
return false;
|
|
147
|
-
return {
|
|
148
|
-
src: el.getAttribute('src'),
|
|
149
|
-
// An absent alt and alt="" mean different things to a screen
|
|
150
|
-
// reader: "undescribed" versus "decorative". Never conflate them.
|
|
151
|
-
alt: el.getAttribute('alt'),
|
|
152
|
-
title: el.getAttribute('title'),
|
|
153
|
-
width: el.getAttribute('width'),
|
|
154
|
-
height: el.getAttribute('height'),
|
|
155
|
-
};
|
|
156
|
-
},
|
|
283
|
+
getAttrs: (dom) => imageParseAttrs(dom),
|
|
157
284
|
},
|
|
158
285
|
],
|
|
159
|
-
toDOM(node)
|
|
160
|
-
const { src, alt, title, width, height } = node.attrs;
|
|
161
|
-
const attrs = { src: src };
|
|
162
|
-
if (alt !== null)
|
|
163
|
-
attrs['alt'] = alt;
|
|
164
|
-
if (title !== null)
|
|
165
|
-
attrs['title'] = title;
|
|
166
|
-
if (width !== null)
|
|
167
|
-
attrs['width'] = width;
|
|
168
|
-
if (height !== null)
|
|
169
|
-
attrs['height'] = height;
|
|
170
|
-
return ['img', attrs];
|
|
171
|
-
},
|
|
286
|
+
toDOM: (node) => ['img', imageDomAttrs(node.attrs)],
|
|
172
287
|
},
|
|
173
288
|
hard_break: {
|
|
174
289
|
inline: true,
|
|
@@ -187,6 +302,17 @@ export const coreNodes = {
|
|
|
187
302
|
table_row,
|
|
188
303
|
table_cell,
|
|
189
304
|
table_header,
|
|
305
|
+
// Media and structure: in the base schema so stored documents stay editable.
|
|
306
|
+
// The insert dialogs, character map and resize handles are the opt-in plugin.
|
|
307
|
+
video,
|
|
308
|
+
audio,
|
|
309
|
+
iframe,
|
|
310
|
+
details,
|
|
311
|
+
summary,
|
|
312
|
+
figure,
|
|
313
|
+
figcaption,
|
|
314
|
+
page_break,
|
|
315
|
+
named_anchor,
|
|
190
316
|
unknown_block: unknownBlock,
|
|
191
317
|
unknown_inline: unknownInline,
|
|
192
318
|
};
|
|
@@ -217,12 +343,153 @@ export const coreMarks = {
|
|
|
217
343
|
parseDOM: [{ tag: 'code' }],
|
|
218
344
|
toDOM: () => ['code', 0],
|
|
219
345
|
},
|
|
346
|
+
/*
|
|
347
|
+
* Colour, as two marks rather than one.
|
|
348
|
+
*
|
|
349
|
+
* Foreground and background are independent: an author highlights a run of
|
|
350
|
+
* text yellow and then makes it red, and a single mark holding both attributes
|
|
351
|
+
* would have the second command overwrite the first's value with a default.
|
|
352
|
+
* Two marks compose the way the toolbar's two controls do.
|
|
353
|
+
*
|
|
354
|
+
* Both are parsed through a `style` rule, not a tag rule, and that choice is
|
|
355
|
+
* load-bearing. ProseMirror applies style rules to whatever element carries
|
|
356
|
+
* the declaration, so `<span style="color:red">`, `<p style="color:red">` and
|
|
357
|
+
* a `<div>` wrapper all yield the same mark -- whereas a `span[style]` tag rule
|
|
358
|
+
* would claim the span, drop it, and quietly lose any other declaration on it.
|
|
359
|
+
*
|
|
360
|
+
* The value is normalized by `safeColor`, which folds `rgb(255, 0, 0)` back to
|
|
361
|
+
* `#ff0000`. That is not cosmetic: ProseMirror reads style rules through the
|
|
362
|
+
* CSSOM, which returns the functional form for an authored hex colour, so
|
|
363
|
+
* without the fold every hex colour in an archive would be rewritten longer on
|
|
364
|
+
* the first save.
|
|
365
|
+
*/
|
|
366
|
+
text_color: {
|
|
367
|
+
attrs: { color: {} },
|
|
368
|
+
parseDOM: [
|
|
369
|
+
{
|
|
370
|
+
style: 'color',
|
|
371
|
+
getAttrs(value) {
|
|
372
|
+
const color = safeColor(value);
|
|
373
|
+
return color ? { color } : false;
|
|
374
|
+
},
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
// `<font color="red">` is what a decade of CMS content looks like, and
|
|
378
|
+
// it is one of the few legacy tags that maps onto a modern mark with
|
|
379
|
+
// nothing left over.
|
|
380
|
+
tag: 'font[color]',
|
|
381
|
+
getAttrs(dom) {
|
|
382
|
+
const el = dom;
|
|
383
|
+
// Only when colour is the whole story. `<font face="Arial" size="2">`
|
|
384
|
+
// carries information this mark cannot hold, so it belongs to the
|
|
385
|
+
// preservation layer instead -- claiming it here would drop the rest.
|
|
386
|
+
if (el.attributes.length > 1)
|
|
387
|
+
return false;
|
|
388
|
+
const color = safeColor(el.getAttribute('color'));
|
|
389
|
+
return color ? { color } : false;
|
|
390
|
+
},
|
|
391
|
+
},
|
|
392
|
+
],
|
|
393
|
+
toDOM: (mark) => elementWithStyle('span', { style: `color:${mark.attrs['color']}` }),
|
|
394
|
+
},
|
|
395
|
+
background_color: {
|
|
396
|
+
attrs: { color: {} },
|
|
397
|
+
parseDOM: [
|
|
398
|
+
{
|
|
399
|
+
// Restricted to span so a cell's own background is not also read as a
|
|
400
|
+
// highlight mark on every character inside it. The CSSOM still expands
|
|
401
|
+
// the `background` shorthand on the element, so Word's
|
|
402
|
+
// `style="background:yellow"` arrives here without a second rule.
|
|
403
|
+
tag: 'span',
|
|
404
|
+
getAttrs(dom) {
|
|
405
|
+
const el = dom;
|
|
406
|
+
const fromAttr = parseDeclarations(el.getAttribute('style')).get('background-color');
|
|
407
|
+
const color = safeColor(el.style.backgroundColor) ?? safeColor(fromAttr);
|
|
408
|
+
return color ? { color } : false;
|
|
409
|
+
},
|
|
410
|
+
},
|
|
411
|
+
],
|
|
412
|
+
toDOM: (mark) => elementWithStyle('span', { style: `background-color:${mark.attrs['color']}` }),
|
|
413
|
+
},
|
|
414
|
+
font_family: {
|
|
415
|
+
attrs: { family: {} },
|
|
416
|
+
parseDOM: [
|
|
417
|
+
{
|
|
418
|
+
style: 'font-family',
|
|
419
|
+
getAttrs(value) {
|
|
420
|
+
const family = safeFontFamily(value);
|
|
421
|
+
return family ? { family } : false;
|
|
422
|
+
},
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
tag: 'font[face]',
|
|
426
|
+
getAttrs(dom) {
|
|
427
|
+
const el = dom;
|
|
428
|
+
// Colour-only `<font>` is a different mark. Face plus anything else
|
|
429
|
+
// this mark cannot hold stays with the preservation layer.
|
|
430
|
+
if (el.attributes.length > 1)
|
|
431
|
+
return false;
|
|
432
|
+
const family = safeFontFamily(el.getAttribute('face'));
|
|
433
|
+
return family ? { family } : false;
|
|
434
|
+
},
|
|
435
|
+
},
|
|
436
|
+
],
|
|
437
|
+
toDOM: (mark) => elementWithStyle('span', { style: `font-family:${mark.attrs['family']}` }),
|
|
438
|
+
},
|
|
439
|
+
font_size: {
|
|
440
|
+
attrs: { size: {} },
|
|
441
|
+
parseDOM: [
|
|
442
|
+
{
|
|
443
|
+
style: 'font-size',
|
|
444
|
+
getAttrs(value) {
|
|
445
|
+
const size = safeFontSize(value);
|
|
446
|
+
return size ? { size } : false;
|
|
447
|
+
},
|
|
448
|
+
},
|
|
449
|
+
],
|
|
450
|
+
toDOM: (mark) => elementWithStyle('span', { style: `font-size:${mark.attrs['size']}` }),
|
|
451
|
+
},
|
|
452
|
+
subscript: {
|
|
453
|
+
excludes: 'superscript',
|
|
454
|
+
parseDOM: [{ tag: 'sub' }, { style: 'vertical-align=sub' }],
|
|
455
|
+
toDOM: () => ['sub', 0],
|
|
456
|
+
},
|
|
457
|
+
superscript: {
|
|
458
|
+
excludes: 'subscript',
|
|
459
|
+
parseDOM: [{ tag: 'sup' }, { style: 'vertical-align=super' }],
|
|
460
|
+
toDOM: () => ['sup', 0],
|
|
461
|
+
},
|
|
462
|
+
language: {
|
|
463
|
+
attrs: { lang: {} },
|
|
464
|
+
inclusive: false,
|
|
465
|
+
parseDOM: [
|
|
466
|
+
{
|
|
467
|
+
tag: 'span[lang]',
|
|
468
|
+
getAttrs(dom) {
|
|
469
|
+
const el = dom;
|
|
470
|
+
const lang = safeLang(el.getAttribute('lang'));
|
|
471
|
+
if (!lang)
|
|
472
|
+
return false;
|
|
473
|
+
for (const attr of Array.from(el.attributes)) {
|
|
474
|
+
if (attr.name === 'lang')
|
|
475
|
+
continue;
|
|
476
|
+
if (attr.name === 'style' && isFullyModelledStyle(attr.value))
|
|
477
|
+
continue;
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
return { lang };
|
|
481
|
+
},
|
|
482
|
+
},
|
|
483
|
+
],
|
|
484
|
+
toDOM: (mark) => ['span', { lang: mark.attrs['lang'] }, 0],
|
|
485
|
+
},
|
|
220
486
|
link: {
|
|
221
487
|
attrs: {
|
|
222
488
|
href: {},
|
|
223
489
|
title: { default: null },
|
|
224
490
|
target: { default: null },
|
|
225
491
|
rel: { default: null },
|
|
492
|
+
id: { default: null },
|
|
226
493
|
},
|
|
227
494
|
inclusive: false,
|
|
228
495
|
parseDOM: [
|
|
@@ -240,12 +507,13 @@ export const coreMarks = {
|
|
|
240
507
|
title: el.getAttribute('title'),
|
|
241
508
|
target: el.getAttribute('target'),
|
|
242
509
|
rel: el.getAttribute('rel'),
|
|
510
|
+
id: safeId(el.getAttribute('id')),
|
|
243
511
|
};
|
|
244
512
|
},
|
|
245
513
|
},
|
|
246
514
|
],
|
|
247
515
|
toDOM(node) {
|
|
248
|
-
const { href, title, target, rel } = node.attrs;
|
|
516
|
+
const { href, title, target, rel, id } = node.attrs;
|
|
249
517
|
const attrs = { href: href };
|
|
250
518
|
if (title !== null)
|
|
251
519
|
attrs['title'] = title;
|
|
@@ -253,6 +521,8 @@ export const coreMarks = {
|
|
|
253
521
|
attrs['target'] = target;
|
|
254
522
|
if (rel !== null)
|
|
255
523
|
attrs['rel'] = rel;
|
|
524
|
+
if (id !== null)
|
|
525
|
+
attrs['id'] = id;
|
|
256
526
|
return ['a', attrs, 0];
|
|
257
527
|
},
|
|
258
528
|
},
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,MAAM,E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E,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAA"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structural nodes that belong in the base schema for the same reason tables
|
|
3
|
+
* do: without them, stored `<details>`, `<figure>` and a page break become
|
|
4
|
+
* opaque preserved atoms -- faithful, and uneditable.
|
|
5
|
+
*
|
|
6
|
+
* The editing chrome (dialogs, character map, resize handles) lives in
|
|
7
|
+
* `@openleaf-editor/plugins-insert`. What is here is the storage format.
|
|
8
|
+
*/
|
|
9
|
+
import type { Attrs, NodeSpec } from 'prosemirror-model';
|
|
10
|
+
/**
|
|
11
|
+
* `<video>` and `<audio>`. `controls` defaults to on: an inserted player
|
|
12
|
+
* without controls is a rectangle that cannot be played from the keyboard,
|
|
13
|
+
* and authors rarely go back to add them.
|
|
14
|
+
*/
|
|
15
|
+
export declare const video: NodeSpec;
|
|
16
|
+
export declare const audio: NodeSpec;
|
|
17
|
+
/**
|
|
18
|
+
* An allowlisted embed. Unsafe iframes are ignored by a sibling parse rule in
|
|
19
|
+
* preserve.ts rather than preserved: an iframe is a nested page, not an
|
|
20
|
+
* author's callout div.
|
|
21
|
+
*/
|
|
22
|
+
export declare const iframe: NodeSpec;
|
|
23
|
+
export declare const details: NodeSpec;
|
|
24
|
+
export declare const summary: NodeSpec;
|
|
25
|
+
/**
|
|
26
|
+
* A captioned image. Figures that contain anything other than an image and an
|
|
27
|
+
* optional caption are left to the preservation layer: claiming them here
|
|
28
|
+
* would flatten a complex figure into a shape it cannot round-trip.
|
|
29
|
+
*/
|
|
30
|
+
export declare const figure: NodeSpec;
|
|
31
|
+
export declare const figcaption: NodeSpec;
|
|
32
|
+
export declare const page_break: NodeSpec;
|
|
33
|
+
/**
|
|
34
|
+
* An empty named destination: `<a id="section"></a>`.
|
|
35
|
+
*
|
|
36
|
+
* A link with both `href` and `id` is a mark, not this node. This exists for
|
|
37
|
+
* the jump target that has no text of its own, which is what TinyMCE's
|
|
38
|
+
* anchor plugin inserts and what a decade of CMS content already contains.
|
|
39
|
+
*/
|
|
40
|
+
export declare const named_anchor: NodeSpec;
|
|
41
|
+
/** Image attributes shared by parse and commands. */
|
|
42
|
+
export declare function imageParseAttrs(el: Element): Record<string, unknown> | false;
|
|
43
|
+
export declare function imageDomAttrs(attrs: Attrs): Record<string, string>;
|
|
44
|
+
//# sourceMappingURL=structure.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"structure.d.ts","sourceRoot":"","sources":["../src/structure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAiB,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAqGvE;;;;GAIG;AACH,eAAO,MAAM,KAAK,EAAE,QAyCnB,CAAA;AAED,eAAO,MAAM,KAAK,EAAE,QAgCnB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,QAyCpB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,QAerB,CAAA;AAED,eAAO,MAAM,OAAO,EAAE,QAKrB,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,QAgBpB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,QAMxB,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,QAUxB,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,EAAE,QAmB1B,CAAA;AAED,qDAAqD;AACrD,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,KAAK,CAY5E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAclE"}
|