@quadrats/react 0.6.3 → 0.6.4
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/footnote/index.cjs.js
CHANGED
|
@@ -50,12 +50,12 @@ function useFootnotes(editor) {
|
|
|
50
50
|
|
|
51
51
|
function deepSearchFootnoteFromNodes(nodes) {
|
|
52
52
|
const result = nodes.flatMap((element) => {
|
|
53
|
-
var _a, _b
|
|
53
|
+
var _a, _b;
|
|
54
54
|
const curNode = core.Node.isNode(element)
|
|
55
55
|
&& element.type === footnote.FOOTNOTE_TYPE ? element : null;
|
|
56
|
-
const child = core.Node.isNodeList(
|
|
57
|
-
? deepSearchFootnoteFromNodes((
|
|
58
|
-
return (
|
|
56
|
+
const child = core.Node.isNodeList(element === null || element === void 0 ? void 0 : element.children)
|
|
57
|
+
? deepSearchFootnoteFromNodes((_a = element === null || element === void 0 ? void 0 : element.children) !== null && _a !== void 0 ? _a : []) : null;
|
|
58
|
+
return (_b = curNode !== null && curNode !== void 0 ? curNode : child) !== null && _b !== void 0 ? _b : [];
|
|
59
59
|
});
|
|
60
60
|
return result;
|
|
61
61
|
}
|
|
@@ -3,12 +3,12 @@ import { FOOTNOTE_TYPE } from '@quadrats/common/footnote';
|
|
|
3
3
|
|
|
4
4
|
function deepSearchFootnoteFromNodes(nodes) {
|
|
5
5
|
const result = nodes.flatMap((element) => {
|
|
6
|
-
var _a, _b
|
|
6
|
+
var _a, _b;
|
|
7
7
|
const curNode = Node.isNode(element)
|
|
8
8
|
&& element.type === FOOTNOTE_TYPE ? element : null;
|
|
9
|
-
const child = Node.isNodeList(
|
|
10
|
-
? deepSearchFootnoteFromNodes((
|
|
11
|
-
return (
|
|
9
|
+
const child = Node.isNodeList(element === null || element === void 0 ? void 0 : element.children)
|
|
10
|
+
? deepSearchFootnoteFromNodes((_a = element === null || element === void 0 ? void 0 : element.children) !== null && _a !== void 0 ? _a : []) : null;
|
|
11
|
+
return (_b = curNode !== null && curNode !== void 0 ? curNode : child) !== null && _b !== void 0 ? _b : [];
|
|
12
12
|
});
|
|
13
13
|
return result;
|
|
14
14
|
}
|
|
@@ -23,12 +23,12 @@ function createJsxSerializeImage(options = {}) {
|
|
|
23
23
|
{
|
|
24
24
|
type: image.type || IMAGE_TYPES.image,
|
|
25
25
|
render: (props) => {
|
|
26
|
-
var _a
|
|
26
|
+
var _a;
|
|
27
27
|
const { children } = props;
|
|
28
28
|
const element = props.element;
|
|
29
29
|
const figure = getFirstAncestor(element, node => node.type === figureType);
|
|
30
30
|
const caption = (_a = figure === null || figure === void 0 ? void 0 : figure.children) === null || _a === void 0 ? void 0 : _a[1];
|
|
31
|
-
return renderImage(Object.assign(Object.assign({}, getImageElementCommonProps(element, hostingResolvers)), { caption: (
|
|
31
|
+
return renderImage(Object.assign(Object.assign({}, getImageElementCommonProps(element, hostingResolvers)), { caption: (caption === null || caption === void 0 ? void 0 : caption.type) === captionType ? getMergedNodeTexts(caption) : '', children,
|
|
32
32
|
element }));
|
|
33
33
|
},
|
|
34
34
|
},
|
|
@@ -37,12 +37,12 @@ function createJsxSerializeImage(options = {}) {
|
|
|
37
37
|
{
|
|
38
38
|
type: image$1.type || image.IMAGE_TYPES.image,
|
|
39
39
|
render: (props) => {
|
|
40
|
-
var _a
|
|
40
|
+
var _a;
|
|
41
41
|
const { children } = props;
|
|
42
42
|
const element = props.element;
|
|
43
43
|
const figure = serializers.getFirstAncestor(element, node => node.type === figureType);
|
|
44
44
|
const caption = (_a = figure === null || figure === void 0 ? void 0 : figure.children) === null || _a === void 0 ? void 0 : _a[1];
|
|
45
|
-
return renderImage(Object.assign(Object.assign({}, image.getImageElementCommonProps(element, hostingResolvers)), { caption: (
|
|
45
|
+
return renderImage(Object.assign(Object.assign({}, image.getImageElementCommonProps(element, hostingResolvers)), { caption: (caption === null || caption === void 0 ? void 0 : caption.type) === captionType ? serializers.getMergedNodeTexts(caption) : '', children,
|
|
46
46
|
element }));
|
|
47
47
|
},
|
|
48
48
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quadrats/react",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"author": "Rytass",
|
|
6
6
|
"homepage": "https://github.com/Quadrats/quadrats#readme",
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
"url": "https://github.com/Quadrats/quadrats/issues"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@quadrats/common": "^0.6.
|
|
24
|
-
"@quadrats/core": "^0.6.
|
|
23
|
+
"@quadrats/common": "^0.6.4",
|
|
24
|
+
"@quadrats/core": "^0.6.4",
|
|
25
25
|
"@quadrats/icons": "^0.6.0",
|
|
26
26
|
"@quadrats/locales": "^0.6.0",
|
|
27
27
|
"@quadrats/theme": "^0.6.0",
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
"clsx": "^1.1.1",
|
|
32
32
|
"is-hotkey": "^0.2.0",
|
|
33
33
|
"react-transition-group": "^4.4.2",
|
|
34
|
-
"slate-react": "^0.
|
|
34
|
+
"slate-react": "^0.75.0",
|
|
35
35
|
"tslib": "^2.3.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"react": "^
|
|
39
|
-
"react-dom": "^
|
|
38
|
+
"react": "^17.0.2",
|
|
39
|
+
"react-dom": "^17.0.2"
|
|
40
40
|
},
|
|
41
41
|
"main": "./index.cjs.js",
|
|
42
42
|
"module": "./index.js",
|