@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
package/lib/src/marks/link.js
CHANGED
|
@@ -1,39 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.link = void 0;
|
|
1
|
+
//#region src/marks/link.ts
|
|
4
2
|
const httpRegex = /^[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b[-a-zA-Z0-9()@:%_+.~#?&/=]*$/;
|
|
5
3
|
/**
|
|
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
|
-
|
|
4
|
+
A link. Has `href` and `title` attributes. `title`
|
|
5
|
+
defaults to the empty string. Rendered and parsed as an `<a>`
|
|
6
|
+
element.
|
|
7
|
+
*/
|
|
8
|
+
const link = {
|
|
9
|
+
attrs: {
|
|
10
|
+
href: {},
|
|
11
|
+
title: { default: null }
|
|
12
|
+
},
|
|
13
|
+
inclusive: false,
|
|
14
|
+
parseDOM: [{
|
|
15
|
+
tag: "a[href]",
|
|
16
|
+
getAttrs(domNode) {
|
|
17
|
+
const dom = domNode;
|
|
18
|
+
return {
|
|
19
|
+
href: dom.getAttribute("href"),
|
|
20
|
+
title: dom.getAttribute("title")
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
}],
|
|
24
|
+
toDOM(node) {
|
|
25
|
+
const { href } = node.attrs;
|
|
26
|
+
let fixedHref = href;
|
|
27
|
+
if (href && !href.startsWith("mailto:") && !fixedHref.startsWith("http") && !fixedHref.startsWith("/")) {
|
|
28
|
+
if (httpRegex.test(href)) fixedHref = `https://${href}`;
|
|
29
|
+
}
|
|
30
|
+
return [
|
|
31
|
+
"a",
|
|
32
|
+
{
|
|
33
|
+
href: fixedHref,
|
|
34
|
+
target: "_blank",
|
|
35
|
+
class: "prosemirror-link",
|
|
36
|
+
rel: "noopener noreferrer nofollow"
|
|
37
|
+
},
|
|
38
|
+
0
|
|
39
|
+
];
|
|
40
|
+
}
|
|
39
41
|
};
|
|
42
|
+
//#endregion
|
|
43
|
+
export { link };
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MarkSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/marks/linked-highlight.d.ts
|
|
2
3
|
type Generator = {
|
|
3
|
-
|
|
4
|
+
generate: (typeId?: string) => string;
|
|
4
5
|
};
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
declare const makeLinkedHighlight: ({ sharedColorGenerator }: {
|
|
7
|
+
sharedColorGenerator?: Generator;
|
|
7
8
|
}) => MarkSpec;
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
declare const makeLinkedHighlightEntity: ({ sharedColorGenerator }: {
|
|
10
|
+
sharedColorGenerator?: Generator;
|
|
10
11
|
}) => MarkSpec;
|
|
11
|
-
|
|
12
|
+
//#endregion
|
|
13
|
+
export { makeLinkedHighlight, makeLinkedHighlightEntity };
|
|
@@ -1,57 +1,44 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.makeLinkedHighlightEntity = exports.makeLinkedHighlight = void 0;
|
|
4
|
-
const hyphenatePascal = (str) => str
|
|
5
|
-
.replace(/([a-z])([A-Z])/g, "$1-$2")
|
|
6
|
-
.replace(/([A-Z]{2})[a-z]/, "$1-")
|
|
7
|
-
.toLowerCase();
|
|
1
|
+
//#region src/marks/linked-highlight.ts
|
|
2
|
+
const hyphenatePascal = (str) => str.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/([A-Z]{2})[a-z]/, "$1-").toLowerCase();
|
|
8
3
|
const createMark = (markType, sharedColorGenerator) => {
|
|
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
|
-
.filter((key) => meta[key] !== false) // remove specials
|
|
42
|
-
.map((key) => [`data-${hyphenatePascal(key)}`, JSON.stringify(meta[key])])),
|
|
43
|
-
},
|
|
44
|
-
];
|
|
45
|
-
},
|
|
46
|
-
};
|
|
4
|
+
const markTag = `span.${markType}`;
|
|
5
|
+
const markClassName = `${markType}`;
|
|
6
|
+
const preserveBool = (attr) => attr === "true" ? true : attr === "false" ? false : attr;
|
|
7
|
+
return {
|
|
8
|
+
attrs: {
|
|
9
|
+
id: {},
|
|
10
|
+
meta: { default: {} }
|
|
11
|
+
},
|
|
12
|
+
inclusive: false,
|
|
13
|
+
parseDOM: [{
|
|
14
|
+
tag: markTag,
|
|
15
|
+
getAttrs: ({ dataset }) => {
|
|
16
|
+
return {
|
|
17
|
+
id: dataset.id || false,
|
|
18
|
+
meta: Object.keys(dataset).filter((key) => key !== "id" && dataset[key] !== "false").reduce((out, key) => ({
|
|
19
|
+
...out,
|
|
20
|
+
[key]: preserveBool(JSON.parse(dataset[key]))
|
|
21
|
+
}), { type: markType })
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
}],
|
|
25
|
+
toDOM: ({ attrs }) => {
|
|
26
|
+
const { id, meta } = attrs;
|
|
27
|
+
const color = sharedColorGenerator ? sharedColorGenerator.generate(attrs) : "#EEEEEE";
|
|
28
|
+
return [markTag, {
|
|
29
|
+
class: markClassName,
|
|
30
|
+
style: color ? `--${markType}-background-color:${color}` : ``,
|
|
31
|
+
"data-id": id,
|
|
32
|
+
...Object.fromEntries(Object.keys(meta).filter((key) => meta[key] !== false).map((key) => [`data-${hyphenatePascal(key)}`, JSON.stringify(meta[key])]))
|
|
33
|
+
}];
|
|
34
|
+
}
|
|
35
|
+
};
|
|
47
36
|
};
|
|
48
37
|
const makeLinkedHighlight = ({ sharedColorGenerator }) => {
|
|
49
|
-
|
|
50
|
-
return createMark("linkedhighlight", sharedColorGenerator);
|
|
38
|
+
return createMark("linkedhighlight", sharedColorGenerator);
|
|
51
39
|
};
|
|
52
|
-
exports.makeLinkedHighlight = makeLinkedHighlight;
|
|
53
40
|
const makeLinkedHighlightEntity = ({ sharedColorGenerator }) => {
|
|
54
|
-
|
|
55
|
-
return createMark("linkedhighlightentity", sharedColorGenerator);
|
|
41
|
+
return createMark("linkedhighlightentity", sharedColorGenerator);
|
|
56
42
|
};
|
|
57
|
-
|
|
43
|
+
//#endregion
|
|
44
|
+
export { makeLinkedHighlight, makeLinkedHighlightEntity };
|
package/lib/src/marks/strike.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
parseDOM: [{ tag: "strike" }, { style: "text-decoration=line-through" }],
|
|
6
|
-
toDOM: () => ["strike"],
|
|
1
|
+
//#region src/marks/strike.ts
|
|
2
|
+
const strike = {
|
|
3
|
+
parseDOM: [{ tag: "strike" }, { style: "text-decoration=line-through" }],
|
|
4
|
+
toDOM: () => ["strike"]
|
|
7
5
|
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { strike };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { MarkSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/marks/strong.d.ts
|
|
2
3
|
/**
|
|
3
4
|
A strong mark. Rendered as `<strong>`, parse rules also match
|
|
4
5
|
`<b>` and `font-weight: bold`.
|
|
5
6
|
*/
|
|
6
|
-
|
|
7
|
+
declare const strong: MarkSpec;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { strong };
|
package/lib/src/marks/strong.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.strong = void 0;
|
|
1
|
+
//#region src/marks/strong.ts
|
|
4
2
|
const strongDOM = ["strong", 0];
|
|
5
3
|
/**
|
|
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
|
-
|
|
4
|
+
A strong mark. Rendered as `<strong>`, parse rules also match
|
|
5
|
+
`<b>` and `font-weight: bold`.
|
|
6
|
+
*/
|
|
7
|
+
const strong = {
|
|
8
|
+
parseDOM: [
|
|
9
|
+
{ tag: "strong" },
|
|
10
|
+
{
|
|
11
|
+
tag: "b",
|
|
12
|
+
getAttrs: (dom) => {
|
|
13
|
+
return dom.style.fontWeight !== "normal" && null;
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
style: "font-weight=400",
|
|
18
|
+
clearMark: (m) => m.type.name === "strong"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
style: "font-weight",
|
|
22
|
+
getAttrs: (value) => {
|
|
23
|
+
return /^(bold(er)?|[5-9]\d{2,})$/.test(value) && null;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
toDOM() {
|
|
28
|
+
return strongDOM;
|
|
29
|
+
}
|
|
32
30
|
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { strong };
|
|
@@ -1,2 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { MarkSpec } from "prosemirror-model";
|
|
2
|
+
//#region src/marks/text-background-color.d.ts
|
|
3
|
+
declare enum ColorToken {
|
|
4
|
+
Yellow = "YELLOW",
|
|
5
|
+
Green = "GREEN",
|
|
6
|
+
Aquamarine = "AQUAMARINE",
|
|
7
|
+
Aqua = "AQUA",
|
|
8
|
+
Blue = "BLUE",
|
|
9
|
+
Purple = "PURPLE",
|
|
10
|
+
Pink = "PINK",
|
|
11
|
+
Red = "RED",
|
|
12
|
+
Grey = "GREY"
|
|
13
|
+
}
|
|
14
|
+
declare const textBackgroundColor: MarkSpec;
|
|
15
|
+
//#endregion
|
|
16
|
+
export { ColorToken, textBackgroundColor };
|
|
@@ -1,90 +1,72 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
ColorToken["Grey"] = "GREY";
|
|
15
|
-
})(ColorToken || (ColorToken = {}));
|
|
1
|
+
//#region src/marks/text-background-color.ts
|
|
2
|
+
let ColorToken = /* @__PURE__ */ function(ColorToken) {
|
|
3
|
+
ColorToken["Yellow"] = "YELLOW";
|
|
4
|
+
ColorToken["Green"] = "GREEN";
|
|
5
|
+
ColorToken["Aquamarine"] = "AQUAMARINE";
|
|
6
|
+
ColorToken["Aqua"] = "AQUA";
|
|
7
|
+
ColorToken["Blue"] = "BLUE";
|
|
8
|
+
ColorToken["Purple"] = "PURPLE";
|
|
9
|
+
ColorToken["Pink"] = "PINK";
|
|
10
|
+
ColorToken["Red"] = "RED";
|
|
11
|
+
ColorToken["Grey"] = "GREY";
|
|
12
|
+
return ColorToken;
|
|
13
|
+
}({});
|
|
16
14
|
const isColorToken = (text) => {
|
|
17
|
-
|
|
15
|
+
return Object.values(ColorToken).includes(text);
|
|
18
16
|
};
|
|
19
|
-
// Previously we used to store raw color value in the attribute
|
|
20
17
|
const persistedRawColorToColorTokenLookup = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
18
|
+
["HIGHLIGHT-SEARCH"]: "YELLOW",
|
|
19
|
+
["#f6f1a2"]: "YELLOW",
|
|
20
|
+
["#d2faad"]: "GREEN",
|
|
21
|
+
["#befccc"]: "AQUAMARINE",
|
|
22
|
+
["#bbf9f8"]: "AQUA",
|
|
23
|
+
["#e0f0fe"]: "BLUE",
|
|
24
|
+
["#f1ebfe"]: "PURPLE",
|
|
25
|
+
["#fce7fb"]: "PINK",
|
|
26
|
+
["#fce9e9"]: "RED",
|
|
27
|
+
["#e7e9eb"]: "GREY"
|
|
31
28
|
};
|
|
32
29
|
const validateColorToken = (color) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (isColorToken(color)) {
|
|
37
|
-
return color;
|
|
38
|
-
}
|
|
39
|
-
return persistedRawColorToColorTokenLookup[color] || undefined;
|
|
30
|
+
if (!color) return;
|
|
31
|
+
if (isColorToken(color)) return color;
|
|
32
|
+
return persistedRawColorToColorTokenLookup[color] || void 0;
|
|
40
33
|
};
|
|
41
34
|
const getClassName = (bgColorToken, fgColorToken) => {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
? `fg-on-bg-${fgColorToken.toLowerCase()}`
|
|
48
|
-
: `fg-${fgColorToken.toLowerCase()}`
|
|
49
|
-
: null,
|
|
50
|
-
]
|
|
51
|
-
.filter(Boolean)
|
|
52
|
-
.join(` `);
|
|
35
|
+
return [
|
|
36
|
+
`text-background-color`,
|
|
37
|
+
bgColorToken ? `bg-${bgColorToken.toLowerCase()}` : null,
|
|
38
|
+
fgColorToken ? bgColorToken ? `fg-on-bg-${fgColorToken.toLowerCase()}` : `fg-${fgColorToken.toLowerCase()}` : null
|
|
39
|
+
].filter(Boolean).join(` `);
|
|
53
40
|
};
|
|
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
|
-
|
|
83
|
-
"data-guid": node.attrs.guid,
|
|
84
|
-
"data-bg-color": bgColor || undefined,
|
|
85
|
-
"data-fg-color": fgColor || undefined,
|
|
86
|
-
class: getClassName(bgColorToken, fgColor),
|
|
87
|
-
},
|
|
88
|
-
];
|
|
89
|
-
},
|
|
41
|
+
const textBackgroundColor = {
|
|
42
|
+
attrs: {
|
|
43
|
+
guid: { default: "" },
|
|
44
|
+
color: { default: void 0 },
|
|
45
|
+
bgColor: { default: void 0 },
|
|
46
|
+
fgColor: { default: void 0 }
|
|
47
|
+
},
|
|
48
|
+
parseDOM: [{
|
|
49
|
+
tag: "span[data-text-background-color]",
|
|
50
|
+
getAttrs: (domNode) => {
|
|
51
|
+
const dom = domNode;
|
|
52
|
+
return {
|
|
53
|
+
bgColor: dom.getAttribute("data-bg-color") || dom.getAttribute("data-color") || void 0,
|
|
54
|
+
fgColor: dom.getAttribute("data-fg-color") || void 0
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}],
|
|
58
|
+
toDOM(node) {
|
|
59
|
+
const bgColor = node.attrs.bgColor || node.attrs.color;
|
|
60
|
+
const fgColor = node.attrs.fgColor;
|
|
61
|
+
const bgColorToken = validateColorToken(bgColor);
|
|
62
|
+
return ["span", {
|
|
63
|
+
"data-text-background-color": "true",
|
|
64
|
+
"data-guid": node.attrs.guid,
|
|
65
|
+
"data-bg-color": bgColor || void 0,
|
|
66
|
+
"data-fg-color": fgColor || void 0,
|
|
67
|
+
class: getClassName(bgColorToken, fgColor)
|
|
68
|
+
}];
|
|
69
|
+
}
|
|
90
70
|
};
|
|
71
|
+
//#endregion
|
|
72
|
+
export { ColorToken, textBackgroundColor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
parseDOM: [{ tag: "u" }, { style: "text-decoration=underline" }],
|
|
6
|
-
toDOM: () => ["u"],
|
|
1
|
+
//#region src/marks/underline.ts
|
|
2
|
+
const underline = {
|
|
3
|
+
parseDOM: [{ tag: "u" }, { style: "text-decoration=underline" }],
|
|
4
|
+
toDOM: () => ["u"]
|
|
7
5
|
};
|
|
6
|
+
//#endregion
|
|
7
|
+
export { underline };
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
icon: {
|
|
10
|
-
default: string;
|
|
11
|
-
};
|
|
1
|
+
import { EmojiOptions } from "./emoji.js";
|
|
2
|
+
//#region src/nodes/callout.d.ts
|
|
3
|
+
declare const DEFAULT_CALLOUT_ICON_TYPE = "icon";
|
|
4
|
+
declare const DEFAULT_CALLOUT_ICON = "exclamation-circle";
|
|
5
|
+
declare const makeCallout: ({ getEmoji }?: EmojiOptions) => {
|
|
6
|
+
attrs: {
|
|
7
|
+
color: {
|
|
8
|
+
default: string;
|
|
12
9
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
10
|
+
iconType: {
|
|
11
|
+
default: string;
|
|
12
|
+
};
|
|
13
|
+
icon: {
|
|
14
|
+
default: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
group: string;
|
|
18
|
+
content: string;
|
|
19
|
+
defining: true;
|
|
20
|
+
parseDOM: {
|
|
21
|
+
tag: string;
|
|
22
|
+
getAttrs(domNode: HTMLElement): {
|
|
23
|
+
color: string | null;
|
|
24
|
+
iconType: string | null;
|
|
25
|
+
icon: string | null;
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
toDOM(node: import("prosemirror-model").Node): [string, Record<string, string>, number];
|
|
30
29
|
};
|
|
30
|
+
//#endregion
|
|
31
|
+
export { DEFAULT_CALLOUT_ICON, DEFAULT_CALLOUT_ICON_TYPE, makeCallout };
|