@fibery/prosemirror-schema 4.3.0 → 4.4.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/src/nodes/emoji.d.ts
CHANGED
package/lib/src/nodes/emoji.js
CHANGED
|
@@ -20,7 +20,7 @@ const makeEmoji = ({ getEmoji } = defaultOptions) => ({
|
|
|
20
20
|
leafText: (node) => {
|
|
21
21
|
const { code } = node.attrs;
|
|
22
22
|
const emoji = getEmoji(code);
|
|
23
|
-
return emoji
|
|
23
|
+
return emoji ? emoji.native || `:${emoji.shortNames[0]}:` : code;
|
|
24
24
|
},
|
|
25
25
|
parseDOM: [
|
|
26
26
|
{
|
|
@@ -40,9 +40,7 @@ const makeEmoji = ({ getEmoji } = defaultOptions) => ({
|
|
|
40
40
|
[codeAttr]: code,
|
|
41
41
|
};
|
|
42
42
|
const emoji = getEmoji(code);
|
|
43
|
-
|
|
44
|
-
// TODO: handle Twemoji and custom emojis
|
|
45
|
-
return ["span", attrs, text];
|
|
43
|
+
return ["span", attrs, emoji ? emoji.native || `:${emoji.shortNames[0]}:` : code];
|
|
46
44
|
},
|
|
47
45
|
});
|
|
48
46
|
exports.makeEmoji = makeEmoji;
|
package/lib/src/nodes/media.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.makeMedia = void 0;
|
|
4
|
+
const resizable_node_attrs_1 = require("../resizable-node-attrs");
|
|
4
5
|
const makeMedia = ({ mediaToDom }) => ({
|
|
5
6
|
inline: false,
|
|
6
7
|
attrs: {
|
|
7
8
|
url: {},
|
|
9
|
+
...(0, resizable_node_attrs_1.createDefaultAttrs)(),
|
|
8
10
|
},
|
|
9
11
|
group: "block",
|
|
10
12
|
draggable: true,
|
|
@@ -14,6 +16,7 @@ const makeMedia = ({ mediaToDom }) => ({
|
|
|
14
16
|
getAttrs(dom) {
|
|
15
17
|
return {
|
|
16
18
|
url: dom.getAttribute("data-url"),
|
|
19
|
+
...(0, resizable_node_attrs_1.createParseDomAttrs)(dom),
|
|
17
20
|
};
|
|
18
21
|
},
|
|
19
22
|
},
|
|
@@ -26,6 +29,7 @@ const makeMedia = ({ mediaToDom }) => ({
|
|
|
26
29
|
const attrs = {
|
|
27
30
|
"data-url": url,
|
|
28
31
|
contenteditable: "false",
|
|
32
|
+
...(0, resizable_node_attrs_1.createToDomAttrs)(node),
|
|
29
33
|
};
|
|
30
34
|
return ["div", attrs, url];
|
|
31
35
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fibery/prosemirror-schema",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"description": "Fibery prosemirror schema",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/uuid": "8.3.3",
|
|
36
36
|
"jest": "27.5.1",
|
|
37
|
+
"@types/jest": "27.0.1",
|
|
37
38
|
"jest-junit": "13.0.0",
|
|
38
39
|
"prosemirror-model": "1.18.2",
|
|
39
40
|
"prosemirror-schema-list": "1.2.2",
|