@ndla/article-converter 10.0.75-alpha.0 → 10.0.76-alpha.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/es/plugins/embed/KeyFigureEmbedPlugin.js +1 -1
- package/es/plugins/h3Plugin.js +5 -9
- package/es/plugins/mathPlugin.js +1 -1
- package/lib/plugins/embed/KeyFigureEmbedPlugin.js +1 -1
- package/lib/plugins/h3Plugin.js +5 -9
- package/lib/plugins/mathPlugin.js +1 -1
- package/package.json +4 -4
- package/src/plugins/divPlugin.tsx +2 -2
- package/src/plugins/embed/KeyFigureEmbedPlugin.tsx +1 -1
- package/src/plugins/h3Plugin.tsx +0 -1
- package/src/plugins/mathPlugin.tsx +1 -1
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { attributesToProps } from "html-react-parser";
|
|
10
10
|
import { KeyFigure } from "@ndla/ui";
|
|
11
11
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
export const keyFigureEmbedPlugin =
|
|
12
|
+
export const keyFigureEmbedPlugin = element => {
|
|
13
13
|
const props = attributesToProps(element.attribs);
|
|
14
14
|
const data = JSON.parse(props["data-json"]);
|
|
15
15
|
const {
|
package/es/plugins/h3Plugin.js
CHANGED
|
@@ -10,13 +10,9 @@ import { attributesToProps, domToReact } from "html-react-parser";
|
|
|
10
10
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
11
11
|
export const h3Plugin = (node, converterOpts, opts) => {
|
|
12
12
|
const props = attributesToProps(node.attribs);
|
|
13
|
-
return (
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
lang: opts.articleLanguage,
|
|
19
|
-
children: domToReact(node.children, converterOpts)
|
|
20
|
-
})
|
|
21
|
-
);
|
|
13
|
+
return /*#__PURE__*/_jsx("h3", {
|
|
14
|
+
...props,
|
|
15
|
+
lang: opts.articleLanguage,
|
|
16
|
+
children: domToReact(node.children, converterOpts)
|
|
17
|
+
});
|
|
22
18
|
};
|
package/es/plugins/mathPlugin.js
CHANGED
|
@@ -15,7 +15,7 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
const keyFigureEmbedPlugin =
|
|
18
|
+
const keyFigureEmbedPlugin = element => {
|
|
19
19
|
const props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
const data = JSON.parse(props["data-json"]);
|
|
21
21
|
const {
|
package/lib/plugins/h3Plugin.js
CHANGED
|
@@ -16,14 +16,10 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
16
|
|
|
17
17
|
const h3Plugin = (node, converterOpts, opts) => {
|
|
18
18
|
const props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
19
|
-
return (
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
(0,
|
|
23
|
-
|
|
24
|
-
lang: opts.articleLanguage,
|
|
25
|
-
children: (0, _htmlReactParser.domToReact)(node.children, converterOpts)
|
|
26
|
-
})
|
|
27
|
-
);
|
|
19
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
20
|
+
...props,
|
|
21
|
+
lang: opts.articleLanguage,
|
|
22
|
+
children: (0, _htmlReactParser.domToReact)(node.children, converterOpts)
|
|
23
|
+
});
|
|
28
24
|
};
|
|
29
25
|
exports.h3Plugin = h3Plugin;
|
|
@@ -19,7 +19,7 @@ const mathPlugin = node => {
|
|
|
19
19
|
"data-math": mathContent,
|
|
20
20
|
...props
|
|
21
21
|
} = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
22
|
-
// @ts-
|
|
22
|
+
// @ts-expect-error - math is a valid tag
|
|
23
23
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)("math", {
|
|
24
24
|
...props,
|
|
25
25
|
dangerouslySetInnerHTML: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.76-alpha.0",
|
|
4
4
|
"description": "Transforms NDLA articles into extended html versions",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@ndla/types-embed": "^5.0.4-alpha.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/primitives": "^1.0.
|
|
35
|
-
"@ndla/ui": "^56.0.
|
|
34
|
+
"@ndla/primitives": "^1.0.57-alpha.0",
|
|
35
|
+
"@ndla/ui": "^56.0.73-alpha.0",
|
|
36
36
|
"html-react-parser": "^5.1.8"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "3f2d720f26b163be90b396f40f3c1fad746b3cf9"
|
|
49
49
|
}
|
|
@@ -36,7 +36,7 @@ export const divPlugin: PluginType = (node, opts, { contentType }) => {
|
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
38
|
<RelatedArticleList {...props}>
|
|
39
|
-
{/* @ts-
|
|
39
|
+
{/* @ts-expect-error - This works, the types just won't match entirely */}
|
|
40
40
|
{domToReact(node.children, opts)}
|
|
41
41
|
</RelatedArticleList>
|
|
42
42
|
);
|
|
@@ -68,7 +68,7 @@ export const divPlugin: PluginType = (node, opts, { contentType }) => {
|
|
|
68
68
|
const background = props["data-background"] as GridType["background"];
|
|
69
69
|
return (
|
|
70
70
|
<Grid border={border} columns={columns} background={background} {...props}>
|
|
71
|
-
{/* @ts-
|
|
71
|
+
{/* @ts-expect-error - This works, the types just won't match entirely */}
|
|
72
72
|
{domToReact(node.children, opts)}
|
|
73
73
|
</Grid>
|
|
74
74
|
);
|
|
@@ -11,7 +11,7 @@ import { KeyFigureMetaData } from "@ndla/types-embed";
|
|
|
11
11
|
import { KeyFigure } from "@ndla/ui";
|
|
12
12
|
import { PluginType } from "../types";
|
|
13
13
|
|
|
14
|
-
export const keyFigureEmbedPlugin: PluginType = (element
|
|
14
|
+
export const keyFigureEmbedPlugin: PluginType = (element) => {
|
|
15
15
|
const props = attributesToProps(element.attribs);
|
|
16
16
|
const data = JSON.parse(props["data-json"] as string) as KeyFigureMetaData;
|
|
17
17
|
const { title, subtitle, alt } = data.embedData;
|
package/src/plugins/h3Plugin.tsx
CHANGED
|
@@ -11,7 +11,6 @@ import { PluginType } from "./types";
|
|
|
11
11
|
export const h3Plugin: PluginType = (node, converterOpts, opts) => {
|
|
12
12
|
const props = attributesToProps(node.attribs);
|
|
13
13
|
return (
|
|
14
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
15
14
|
<h3 {...props} lang={opts.articleLanguage}>
|
|
16
15
|
{domToReact(node.children as DOMNode[], converterOpts)}
|
|
17
16
|
</h3>
|
|
@@ -10,6 +10,6 @@ import { attributesToProps } from "html-react-parser";
|
|
|
10
10
|
import { PluginType } from "./types";
|
|
11
11
|
export const mathPlugin: PluginType = (node) => {
|
|
12
12
|
const { "data-math": mathContent, ...props } = attributesToProps(node.attribs);
|
|
13
|
-
// @ts-
|
|
13
|
+
// @ts-expect-error - math is a valid tag
|
|
14
14
|
return <math {...props} dangerouslySetInnerHTML={{ __html: mathContent }} />;
|
|
15
15
|
};
|