@ndla/article-converter 10.0.118-alpha.0 → 10.0.120-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/index.js +3 -1
- package/es/plugins/embed/symbolEmbedPlugin.js +15 -0
- package/lib/plugins/embed/index.js +3 -1
- package/lib/plugins/embed/symbolEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/symbolEmbedPlugin.js +22 -0
- package/package.json +4 -4
- package/src/plugins/embed/index.ts +2 -0
- package/src/plugins/embed/symbolEmbedPlugin.tsx +14 -0
|
@@ -24,6 +24,7 @@ import { keyFigureEmbedPlugin } from "./KeyFigureEmbedPlugin";
|
|
|
24
24
|
import { linkBlockPlugin } from "./linkBlockEmbedPlugin";
|
|
25
25
|
import { pitchEmbedPlugin } from "./pitchEmbedPlugin";
|
|
26
26
|
import { relatedContentEmbedPlugin } from "./relatedContentEmbedPlugin";
|
|
27
|
+
import { symbolEmbedPlugin } from "./symbolEmbedPlugin";
|
|
27
28
|
import { uuDisclaimerEmbedPlugin } from "./uuDisclaimerEmbedPlugin";
|
|
28
29
|
export const embedPlugins = {
|
|
29
30
|
image: imageEmbedPlugin,
|
|
@@ -44,5 +45,6 @@ export const embedPlugins = {
|
|
|
44
45
|
"campaign-block": campaignBlockPlugin,
|
|
45
46
|
"link-block": linkBlockPlugin,
|
|
46
47
|
"uu-disclaimer": uuDisclaimerEmbedPlugin,
|
|
47
|
-
copyright: copyrightEmbedPlugin
|
|
48
|
+
copyright: copyrightEmbedPlugin,
|
|
49
|
+
symbol: symbolEmbedPlugin
|
|
48
50
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { domToReact } from "html-react-parser";
|
|
10
|
+
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
11
|
+
export const symbolEmbedPlugin = (element, _, __) => {
|
|
12
|
+
return /*#__PURE__*/_jsx(_Fragment, {
|
|
13
|
+
children: domToReact(element.children)
|
|
14
|
+
});
|
|
15
|
+
};
|
|
@@ -22,6 +22,7 @@ var _KeyFigureEmbedPlugin = require("./KeyFigureEmbedPlugin");
|
|
|
22
22
|
var _linkBlockEmbedPlugin = require("./linkBlockEmbedPlugin");
|
|
23
23
|
var _pitchEmbedPlugin = require("./pitchEmbedPlugin");
|
|
24
24
|
var _relatedContentEmbedPlugin = require("./relatedContentEmbedPlugin");
|
|
25
|
+
var _symbolEmbedPlugin = require("./symbolEmbedPlugin");
|
|
25
26
|
var _uuDisclaimerEmbedPlugin = require("./uuDisclaimerEmbedPlugin");
|
|
26
27
|
/**
|
|
27
28
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -50,5 +51,6 @@ const embedPlugins = exports.embedPlugins = {
|
|
|
50
51
|
"campaign-block": _campaignBlockPlugin.campaignBlockPlugin,
|
|
51
52
|
"link-block": _linkBlockEmbedPlugin.linkBlockPlugin,
|
|
52
53
|
"uu-disclaimer": _uuDisclaimerEmbedPlugin.uuDisclaimerEmbedPlugin,
|
|
53
|
-
copyright: _copyrightEmbedPlugin.copyrightEmbedPlugin
|
|
54
|
+
copyright: _copyrightEmbedPlugin.copyrightEmbedPlugin,
|
|
55
|
+
symbol: _symbolEmbedPlugin.symbolEmbedPlugin
|
|
54
56
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
import { type PluginType } from "../types";
|
|
9
|
+
export declare const symbolEmbedPlugin: PluginType;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.symbolEmbedPlugin = void 0;
|
|
7
|
+
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
|
+
/**
|
|
10
|
+
* Copyright (c) 2025-present, NDLA.
|
|
11
|
+
*
|
|
12
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
13
|
+
* LICENSE file in the root directory of this source tree.
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
const symbolEmbedPlugin = (element, _, __) => {
|
|
18
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {
|
|
19
|
+
children: (0, _htmlReactParser.domToReact)(element.children)
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
exports.symbolEmbedPlugin = symbolEmbedPlugin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "10.0.
|
|
3
|
+
"version": "10.0.120-alpha.0",
|
|
4
4
|
"description": "Transforms NDLA articles into extended html versions",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
],
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@ndla/types-backend": "^1.0.39",
|
|
31
|
-
"@ndla/types-embed": "^5.0.
|
|
31
|
+
"@ndla/types-embed": "^5.0.13-alpha.0"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@ndla/primitives": "^1.0.85-alpha.0",
|
|
35
|
-
"@ndla/ui": "^56.0.
|
|
35
|
+
"@ndla/ui": "^56.0.117-alpha.0",
|
|
36
36
|
"html-react-parser": "^5.1.19"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"publishConfig": {
|
|
46
46
|
"access": "public"
|
|
47
47
|
},
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "ea8791f44ff1565342345578dc4dd189dac0e6a9"
|
|
49
49
|
}
|
|
@@ -24,6 +24,7 @@ import { keyFigureEmbedPlugin } from "./KeyFigureEmbedPlugin";
|
|
|
24
24
|
import { linkBlockPlugin } from "./linkBlockEmbedPlugin";
|
|
25
25
|
import { pitchEmbedPlugin } from "./pitchEmbedPlugin";
|
|
26
26
|
import { relatedContentEmbedPlugin } from "./relatedContentEmbedPlugin";
|
|
27
|
+
import { symbolEmbedPlugin } from "./symbolEmbedPlugin";
|
|
27
28
|
import { uuDisclaimerEmbedPlugin } from "./uuDisclaimerEmbedPlugin";
|
|
28
29
|
import { type PluginType } from "../types";
|
|
29
30
|
|
|
@@ -47,4 +48,5 @@ export const embedPlugins: Record<string, PluginType> = {
|
|
|
47
48
|
"link-block": linkBlockPlugin,
|
|
48
49
|
"uu-disclaimer": uuDisclaimerEmbedPlugin,
|
|
49
50
|
copyright: copyrightEmbedPlugin,
|
|
51
|
+
symbol: symbolEmbedPlugin,
|
|
50
52
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { type DOMNode, domToReact } from "html-react-parser";
|
|
10
|
+
import { type PluginType } from "../types";
|
|
11
|
+
|
|
12
|
+
export const symbolEmbedPlugin: PluginType = (element, _, __) => {
|
|
13
|
+
return <>{domToReact(element.children as DOMNode[])}</>;
|
|
14
|
+
};
|