@fibery/prosemirror-schema 4.21.0 → 4.23.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/lib/index.d.ts +10 -8
- package/lib/index.js +9 -26
- package/lib/src/attr-constraints.d.ts +15 -12
- package/lib/src/attr-constraints.js +128 -168
- package/lib/src/block-id-utils.d.ts +10 -7
- package/lib/src/block-id-utils.js +16 -39
- package/lib/src/create-schema.d.ts +16 -15
- package/lib/src/create-schema.js +204 -249
- package/lib/src/marks/code.d.ts +5 -2
- package/lib/src/marks/code.js +10 -10
- package/lib/src/marks/em.d.ts +5 -2
- package/lib/src/marks/em.js +19 -16
- package/lib/src/marks/hint-query.d.ts +5 -2
- package/lib/src/marks/hint-query.js +19 -22
- package/lib/src/marks/link.d.ts +5 -2
- package/lib/src/marks/link.js +40 -36
- package/lib/src/marks/linked-highlight.d.ts +9 -7
- package/lib/src/marks/linked-highlight.js +38 -51
- package/lib/src/marks/strike.d.ts +5 -2
- package/lib/src/marks/strike.js +6 -6
- package/lib/src/marks/strong.d.ts +5 -2
- package/lib/src/marks/strong.js +29 -29
- package/lib/src/marks/text-background-color.d.ts +16 -2
- package/lib/src/marks/text-background-color.js +63 -81
- package/lib/src/marks/underline.d.ts +5 -2
- package/lib/src/marks/underline.js +6 -6
- package/lib/src/nodes/callout.d.ts +29 -28
- package/lib/src/nodes/callout.js +58 -36
- package/lib/src/nodes/check-item.d.ts +13 -10
- package/lib/src/nodes/check-item.js +32 -33
- package/lib/src/nodes/check-list.d.ts +14 -11
- package/lib/src/nodes/check-list.js +23 -30
- package/lib/src/nodes/code-block.d.ts +5 -2
- package/lib/src/nodes/code-block.js +70 -101
- package/lib/src/nodes/column.d.ts +5 -2
- package/lib/src/nodes/column.js +28 -34
- package/lib/src/nodes/columns.d.ts +5 -2
- package/lib/src/nodes/columns.js +34 -36
- package/lib/src/nodes/emoji.d.ts +28 -26
- package/lib/src/nodes/emoji.js +38 -47
- package/lib/src/nodes/entity.d.ts +18 -16
- package/lib/src/nodes/entity.js +48 -49
- package/lib/src/nodes/fibery-view.d.ts +5 -2
- package/lib/src/nodes/fibery-view.js +38 -42
- package/lib/src/nodes/file.d.ts +37 -34
- package/lib/src/nodes/file.js +41 -40
- package/lib/src/nodes/heading.d.ts +6 -3
- package/lib/src/nodes/heading.js +57 -33
- package/lib/src/nodes/image-block.d.ts +5 -2
- package/lib/src/nodes/image-block.js +43 -42
- package/lib/src/nodes/important.d.ts +5 -2
- package/lib/src/nodes/important.js +14 -10
- package/lib/src/nodes/math-display.d.ts +5 -2
- package/lib/src/nodes/math-display.js +14 -15
- package/lib/src/nodes/math-inline.d.ts +5 -2
- package/lib/src/nodes/math-inline.js +14 -15
- package/lib/src/nodes/media.d.ts +6 -3
- package/lib/src/nodes/media.js +52 -68
- package/lib/src/nodes/mention.d.ts +12 -9
- package/lib/src/nodes/mention.js +36 -37
- package/lib/src/nodes/note.d.ts +5 -2
- package/lib/src/nodes/note.js +14 -10
- package/lib/src/nodes/paragraph.d.ts +5 -2
- package/lib/src/nodes/paragraph.js +32 -26
- package/lib/src/nodes/table-nodes.d.ts +5 -2
- package/lib/src/nodes/table-nodes.js +16 -20
- package/lib/src/nodes/types/inline-content.d.ts +10 -8
- package/lib/src/nodes/types/inline-content.js +0 -2
- package/lib/src/nodes/types/text.d.ts +7 -4
- package/lib/src/nodes/types/text.js +0 -2
- package/lib/src/nodes/video.d.ts +7 -4
- package/lib/src/nodes/video.js +49 -54
- package/lib/src/resizable-node-attrs.d.ts +29 -26
- package/lib/src/resizable-node-attrs.js +23 -34
- package/lib/src/transcription-node-attrs.d.ts +10 -7
- package/lib/src/transcription-node-attrs.js +8 -8
- package/lib/test-helpers/index.d.ts +7 -4
- package/lib/test-helpers/index.js +11 -15
- package/package.json +11 -4
|
@@ -1,43 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
1
|
+
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
+
//#region src/nodes/image-block.ts
|
|
3
|
+
const imageBlock = {
|
|
4
|
+
attrs: {
|
|
5
|
+
src: {},
|
|
6
|
+
alt: { default: null },
|
|
7
|
+
title: { default: null },
|
|
8
|
+
size: { default: null },
|
|
9
|
+
type: { default: null },
|
|
10
|
+
...createDefaultAttrs()
|
|
11
|
+
},
|
|
12
|
+
inline: false,
|
|
13
|
+
group: "block",
|
|
14
|
+
content: "inline*",
|
|
15
|
+
atom: true,
|
|
16
|
+
draggable: true,
|
|
17
|
+
parseDOM: [{
|
|
18
|
+
tag: "img[src]",
|
|
19
|
+
getAttrs(domNode) {
|
|
20
|
+
const dom = domNode;
|
|
21
|
+
return {
|
|
22
|
+
src: dom.getAttribute("src"),
|
|
23
|
+
title: dom.getAttribute("title"),
|
|
24
|
+
alt: dom.getAttribute("alt"),
|
|
25
|
+
...createParseDomAttrs(dom)
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
}],
|
|
29
|
+
toDOM(node) {
|
|
30
|
+
const { src, alt, title } = node.attrs;
|
|
31
|
+
return [
|
|
32
|
+
"div",
|
|
33
|
+
{},
|
|
34
|
+
["img", {
|
|
35
|
+
src,
|
|
36
|
+
alt,
|
|
37
|
+
title,
|
|
38
|
+
...createToDomAttrs(node.attrs)
|
|
39
|
+
}]
|
|
40
|
+
];
|
|
41
|
+
}
|
|
43
42
|
};
|
|
43
|
+
//#endregion
|
|
44
|
+
export { imageBlock };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//#region src/nodes/important.ts
|
|
2
|
+
const important = {
|
|
3
|
+
content: "inline*",
|
|
4
|
+
group: "block",
|
|
5
|
+
parseDOM: [{ tag: "div.fibery-important" }],
|
|
6
|
+
toDOM() {
|
|
7
|
+
return [
|
|
8
|
+
"div",
|
|
9
|
+
{ class: "fibery-important" },
|
|
10
|
+
["p", 0]
|
|
11
|
+
];
|
|
12
|
+
}
|
|
11
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { important };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tag: "math-display", // important!
|
|
14
|
-
},
|
|
15
|
-
],
|
|
1
|
+
//#region src/nodes/math-display.ts
|
|
2
|
+
const math_display = {
|
|
3
|
+
group: "block math",
|
|
4
|
+
content: "text*",
|
|
5
|
+
atom: true,
|
|
6
|
+
code: true,
|
|
7
|
+
toDOM: () => [
|
|
8
|
+
"math-display",
|
|
9
|
+
{ class: "math-node" },
|
|
10
|
+
0
|
|
11
|
+
],
|
|
12
|
+
parseDOM: [{ tag: "math-display" }]
|
|
16
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { math_display };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tag: "math-inline", // important!
|
|
14
|
-
},
|
|
15
|
-
],
|
|
1
|
+
//#region src/nodes/math-inline.ts
|
|
2
|
+
const math_inline = {
|
|
3
|
+
group: "inline math",
|
|
4
|
+
content: "text*",
|
|
5
|
+
inline: true,
|
|
6
|
+
atom: true,
|
|
7
|
+
toDOM: () => [
|
|
8
|
+
"math-inline",
|
|
9
|
+
{ class: "math-node" },
|
|
10
|
+
0
|
|
11
|
+
],
|
|
12
|
+
parseDOM: [{ tag: "math-inline" }]
|
|
16
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { math_inline };
|
package/lib/src/nodes/media.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { Node, NodeSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/nodes/media.d.ts
|
|
3
|
+
declare const makeMedia: ({ mediaToDom }: {
|
|
4
|
+
mediaToDom: ((node: Node) => HTMLElement) | null;
|
|
4
5
|
}) => NodeSpec;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { makeMedia };
|
package/lib/src/nodes/media.js
CHANGED
|
@@ -1,74 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.makeMedia = void 0;
|
|
4
|
-
const resizable_node_attrs_1 = require("../resizable-node-attrs");
|
|
1
|
+
import { createDefaultAttrs, createParseDomAttrs, createToDomAttrs } from "../resizable-node-attrs.js";
|
|
2
|
+
//#region src/nodes/media.ts
|
|
5
3
|
function toBoolean(attr) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
if (attr === "true") {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return Boolean(attr);
|
|
4
|
+
if (typeof attr === "boolean") return attr;
|
|
5
|
+
if (typeof attr === "string") {
|
|
6
|
+
if (attr === "false") return false;
|
|
7
|
+
if (attr === "true") return true;
|
|
8
|
+
}
|
|
9
|
+
return Boolean(attr);
|
|
18
10
|
}
|
|
19
11
|
function toNumberOrNull(value) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const parsed = parseFloat(value);
|
|
24
|
-
return isNaN(parsed) ? null : parsed;
|
|
12
|
+
if (!value) return null;
|
|
13
|
+
const parsed = parseFloat(value);
|
|
14
|
+
return isNaN(parsed) ? null : parsed;
|
|
25
15
|
}
|
|
26
16
|
const makeMedia = ({ mediaToDom }) => ({
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"data-dynamic-content": typeof dynamicContent === "boolean" ? String(dynamicContent) : "false",
|
|
67
|
-
"data-aspect-ratio": aspectRatio,
|
|
68
|
-
contenteditable: "false",
|
|
69
|
-
...(0, resizable_node_attrs_1.createToDomAttrs)(node),
|
|
70
|
-
};
|
|
71
|
-
return ["div", attrs, url];
|
|
72
|
-
},
|
|
17
|
+
inline: false,
|
|
18
|
+
attrs: {
|
|
19
|
+
url: {},
|
|
20
|
+
compatibleMode: { default: false },
|
|
21
|
+
dynamicContent: { default: true },
|
|
22
|
+
aspectRatio: { default: null },
|
|
23
|
+
...createDefaultAttrs()
|
|
24
|
+
},
|
|
25
|
+
group: "block",
|
|
26
|
+
draggable: true,
|
|
27
|
+
parseDOM: [{
|
|
28
|
+
tag: "div[data-url]",
|
|
29
|
+
getAttrs(dom) {
|
|
30
|
+
const htmlElement = dom;
|
|
31
|
+
return {
|
|
32
|
+
url: htmlElement.getAttribute("data-url"),
|
|
33
|
+
dynamicContent: htmlElement.getAttribute("data-dynamic-content") !== "false",
|
|
34
|
+
aspectRatio: toNumberOrNull(htmlElement.getAttribute("data-aspect-ratio")),
|
|
35
|
+
compatibleMode: toBoolean(htmlElement.getAttribute("data-compatible-mode")),
|
|
36
|
+
...createParseDomAttrs(htmlElement)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}],
|
|
40
|
+
toDOM(node) {
|
|
41
|
+
if (mediaToDom) return mediaToDom(node);
|
|
42
|
+
const { url, compatibleMode, dynamicContent, aspectRatio } = node.attrs;
|
|
43
|
+
return [
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
"data-url": url,
|
|
47
|
+
"data-compatible-mode": compatibleMode,
|
|
48
|
+
"data-dynamic-content": typeof dynamicContent === "boolean" ? String(dynamicContent) : "false",
|
|
49
|
+
"data-aspect-ratio": aspectRatio,
|
|
50
|
+
contenteditable: "false",
|
|
51
|
+
...createToDomAttrs(node)
|
|
52
|
+
},
|
|
53
|
+
url
|
|
54
|
+
];
|
|
55
|
+
}
|
|
73
56
|
});
|
|
74
|
-
|
|
57
|
+
//#endregion
|
|
58
|
+
export { makeMedia };
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { NodeSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/nodes/mention.d.ts
|
|
3
|
+
interface MentionAttributes {
|
|
4
|
+
id: string;
|
|
5
|
+
typeId: string;
|
|
6
|
+
name?: string;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
interface MentionDefinition {
|
|
9
|
+
type: "mention";
|
|
10
|
+
attrs: MentionAttributes;
|
|
10
11
|
}
|
|
11
|
-
|
|
12
|
+
declare const mention: NodeSpec;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { MentionAttributes, MentionDefinition, mention };
|
package/lib/src/nodes/mention.js
CHANGED
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
};
|
|
36
|
-
return ["span", attrs, name];
|
|
37
|
-
},
|
|
1
|
+
//#region src/nodes/mention.ts
|
|
2
|
+
const mention = {
|
|
3
|
+
inline: true,
|
|
4
|
+
group: "inline",
|
|
5
|
+
selectable: false,
|
|
6
|
+
attrs: {
|
|
7
|
+
id: { default: "" },
|
|
8
|
+
name: { default: "" },
|
|
9
|
+
typeId: { default: "" },
|
|
10
|
+
meta: { default: {} }
|
|
11
|
+
},
|
|
12
|
+
parseDOM: [{
|
|
13
|
+
tag: "span[data-mention-id]",
|
|
14
|
+
getAttrs: (domNode) => {
|
|
15
|
+
const dom = domNode;
|
|
16
|
+
return {
|
|
17
|
+
id: dom.getAttribute("data-mention-id"),
|
|
18
|
+
name: dom.textContent,
|
|
19
|
+
typeId: dom.getAttribute("data-mention-type-id")
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
}],
|
|
23
|
+
toDOM(node) {
|
|
24
|
+
const { id, typeId, name } = node.attrs;
|
|
25
|
+
return [
|
|
26
|
+
"span",
|
|
27
|
+
{
|
|
28
|
+
"data-mention-id": id,
|
|
29
|
+
"data-mention-type-id": typeId,
|
|
30
|
+
contenteditable: "false"
|
|
31
|
+
},
|
|
32
|
+
name
|
|
33
|
+
];
|
|
34
|
+
}
|
|
38
35
|
};
|
|
36
|
+
//#endregion
|
|
37
|
+
export { mention };
|
package/lib/src/nodes/note.d.ts
CHANGED
package/lib/src/nodes/note.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
//#region src/nodes/note.ts
|
|
2
|
+
const note = {
|
|
3
|
+
content: "inline*",
|
|
4
|
+
group: "block",
|
|
5
|
+
toDOM() {
|
|
6
|
+
return [
|
|
7
|
+
"div",
|
|
8
|
+
{ class: "fibery-note" },
|
|
9
|
+
["p", 0]
|
|
10
|
+
];
|
|
11
|
+
},
|
|
12
|
+
parseDOM: [{ tag: "div.fibery-note" }]
|
|
11
13
|
};
|
|
14
|
+
//#endregion
|
|
15
|
+
export { note };
|
|
@@ -1,27 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
import { v4 } from "uuid";
|
|
2
|
+
//#region src/nodes/paragraph.ts
|
|
3
|
+
const paragraph = {
|
|
4
|
+
content: "inline*",
|
|
5
|
+
group: "block",
|
|
6
|
+
attrs: {
|
|
7
|
+
id: { default: null },
|
|
8
|
+
guid: { default: "" }
|
|
9
|
+
},
|
|
10
|
+
parseDOM: [{
|
|
11
|
+
tag: "p",
|
|
12
|
+
getAttrs: (dom) => {
|
|
13
|
+
const id = dom.getAttribute("data-guid") || v4();
|
|
14
|
+
return {
|
|
15
|
+
id,
|
|
16
|
+
guid: id
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}],
|
|
20
|
+
toDOM(node) {
|
|
21
|
+
const id = node.attrs.id || node.attrs.guid;
|
|
22
|
+
return [
|
|
23
|
+
"p",
|
|
24
|
+
{
|
|
25
|
+
"data-id": id,
|
|
26
|
+
"data-guid": id
|
|
27
|
+
},
|
|
28
|
+
0
|
|
29
|
+
];
|
|
30
|
+
}
|
|
27
31
|
};
|
|
32
|
+
//#endregion
|
|
33
|
+
export { paragraph };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { NodeSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/nodes/table-nodes.d.ts
|
|
3
|
+
declare const tableNodes: Record<string, NodeSpec>;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { tableNodes };
|
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if (value) {
|
|
16
|
-
attrs.style = (attrs.style || "") + `background-color: ${value};`;
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
},
|
|
1
|
+
import { tableNodes as tableNodes$1 } from "prosemirror-tables";
|
|
2
|
+
//#region src/nodes/table-nodes.ts
|
|
3
|
+
const tableNodes = tableNodes$1({
|
|
4
|
+
tableGroup: "block",
|
|
5
|
+
cellContent: "block+",
|
|
6
|
+
cellAttributes: { background: {
|
|
7
|
+
default: null,
|
|
8
|
+
getFromDOM(dom) {
|
|
9
|
+
return dom.style.backgroundColor || null;
|
|
10
|
+
},
|
|
11
|
+
setDOMAttr(value, attrs) {
|
|
12
|
+
if (value) attrs.style = (attrs.style || "") + `background-color: ${value};`;
|
|
13
|
+
}
|
|
14
|
+
} }
|
|
21
15
|
});
|
|
16
|
+
//#endregion
|
|
17
|
+
export { tableNodes };
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import { EntityDefinition } from "../entity.js";
|
|
2
|
+
import { MentionDefinition } from "../mention.js";
|
|
3
|
+
import { TextDefinition } from "./text.js";
|
|
4
|
+
//#region src/nodes/types/inline-content.d.ts
|
|
4
5
|
interface MarksObject<T> {
|
|
5
|
-
|
|
6
|
+
marks?: Array<T>;
|
|
6
7
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
type InlineFormattedText = TextDefinition & MarksObject<unknown>;
|
|
9
|
+
type InlineAtomic = MentionDefinition | EntityDefinition | unknown;
|
|
10
|
+
type Inline = InlineFormattedText | InlineAtomic;
|
|
11
|
+
//#endregion
|
|
12
|
+
export { Inline, InlineAtomic, InlineFormattedText };
|