@ndla/article-converter 8.0.0 → 8.0.2
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/index.js +0 -2
- package/lib/extractEmbedMeta.js +1 -1
- package/lib/index.js +1 -1
- package/lib/plugins/index.js +0 -2
- package/lib/transform.js +1 -1
- package/package.json +5 -5
- package/src/plugins/index.ts +0 -2
- package/es/plugins/spanPlugin.js +0 -23
- package/lib/plugins/spanPlugin.d.ts +0 -9
- package/lib/plugins/spanPlugin.js +0 -30
- package/src/plugins/spanPlugin.tsx +0 -22
package/es/plugins/index.js
CHANGED
|
@@ -18,7 +18,6 @@ import { navPlugin } from "./navPlugin";
|
|
|
18
18
|
import { anchorPlugin as oembedAnchorPlugin } from "./oembed/anchorPlugin";
|
|
19
19
|
import { olPlugin } from "./olPlugin";
|
|
20
20
|
import { paragraphPlugin } from "./paragraphPlugin";
|
|
21
|
-
import { spanPlugin } from "./spanPlugin";
|
|
22
21
|
import { tablePlugin } from "./tablePlugin";
|
|
23
22
|
import { ulPlugin } from "./ulPlugin";
|
|
24
23
|
export const basePlugins = {
|
|
@@ -26,7 +25,6 @@ export const basePlugins = {
|
|
|
26
25
|
h3: h3Plugin,
|
|
27
26
|
ol: olPlugin,
|
|
28
27
|
p: paragraphPlugin,
|
|
29
|
-
span: spanPlugin,
|
|
30
28
|
math: mathPlugin,
|
|
31
29
|
div: divPlugin,
|
|
32
30
|
table: tablePlugin,
|
package/lib/extractEmbedMeta.js
CHANGED
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.extractEmbedMetas = exports.default = void 0;
|
|
7
7
|
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
8
|
-
function _interopRequireDefault(
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
9
|
/**
|
|
10
10
|
* Copyright (c) 2023-present, NDLA.
|
|
11
11
|
*
|
package/lib/index.js
CHANGED
|
@@ -25,4 +25,4 @@ var _transform = _interopRequireDefault(require("./transform"));
|
|
|
25
25
|
var _extractEmbedMeta = _interopRequireWildcard(require("./extractEmbedMeta"));
|
|
26
26
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
27
27
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
28
|
-
function _interopRequireDefault(
|
|
28
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/plugins/index.js
CHANGED
|
@@ -16,7 +16,6 @@ var _navPlugin = require("./navPlugin");
|
|
|
16
16
|
var _anchorPlugin2 = require("./oembed/anchorPlugin");
|
|
17
17
|
var _olPlugin = require("./olPlugin");
|
|
18
18
|
var _paragraphPlugin = require("./paragraphPlugin");
|
|
19
|
-
var _spanPlugin = require("./spanPlugin");
|
|
20
19
|
var _tablePlugin = require("./tablePlugin");
|
|
21
20
|
var _ulPlugin = require("./ulPlugin");
|
|
22
21
|
/**
|
|
@@ -32,7 +31,6 @@ const basePlugins = exports.basePlugins = {
|
|
|
32
31
|
h3: _h3Plugin.h3Plugin,
|
|
33
32
|
ol: _olPlugin.olPlugin,
|
|
34
33
|
p: _paragraphPlugin.paragraphPlugin,
|
|
35
|
-
span: _spanPlugin.spanPlugin,
|
|
36
34
|
math: _mathPlugin.mathPlugin,
|
|
37
35
|
div: _divPlugin.divPlugin,
|
|
38
36
|
table: _tablePlugin.tablePlugin,
|
package/lib/transform.js
CHANGED
|
@@ -9,7 +9,7 @@ var _ui = require("@ndla/ui");
|
|
|
9
9
|
var _plugins = require("./plugins");
|
|
10
10
|
var _embed = require("./plugins/embed");
|
|
11
11
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(
|
|
12
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
13
|
/**
|
|
14
14
|
* Copyright (c) 2023-present, NDLA.
|
|
15
15
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "8.0.
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"description": "Transforms NDLA articles into extended html versions",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
"src"
|
|
28
28
|
],
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@ndla/types-backend": "^0.2.
|
|
31
|
-
"@ndla/types-embed": "^4.1.
|
|
30
|
+
"@ndla/types-backend": "^0.2.82",
|
|
31
|
+
"@ndla/types-embed": "^4.1.7"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/ui": "^
|
|
34
|
+
"@ndla/ui": "^54.0.0",
|
|
35
35
|
"html-react-parser": "^5.1.8"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"publishConfig": {
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "c778ba48c327f14eaae3e2da21ed24b183719167"
|
|
50
50
|
}
|
package/src/plugins/index.ts
CHANGED
|
@@ -18,7 +18,6 @@ import { navPlugin } from "./navPlugin";
|
|
|
18
18
|
import { anchorPlugin as oembedAnchorPlugin } from "./oembed/anchorPlugin";
|
|
19
19
|
import { olPlugin } from "./olPlugin";
|
|
20
20
|
import { paragraphPlugin } from "./paragraphPlugin";
|
|
21
|
-
import { spanPlugin } from "./spanPlugin";
|
|
22
21
|
import { tablePlugin } from "./tablePlugin";
|
|
23
22
|
import { PluginType } from "./types";
|
|
24
23
|
import { ulPlugin } from "./ulPlugin";
|
|
@@ -28,7 +27,6 @@ export const basePlugins: Record<string, PluginType> = {
|
|
|
28
27
|
h3: h3Plugin,
|
|
29
28
|
ol: olPlugin,
|
|
30
29
|
p: paragraphPlugin,
|
|
31
|
-
span: spanPlugin,
|
|
32
30
|
math: mathPlugin,
|
|
33
31
|
div: divPlugin,
|
|
34
32
|
table: tablePlugin,
|
package/es/plugins/spanPlugin.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 { attributesToProps, domToReact } from "html-react-parser";
|
|
10
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
11
|
-
export const spanPlugin = (node, opts) => {
|
|
12
|
-
if (node.attribs["data-size"] === "large") {
|
|
13
|
-
var _node$attribs$class;
|
|
14
|
-
const props = attributesToProps(node.attribs);
|
|
15
|
-
return _jsx("span", {
|
|
16
|
-
...props,
|
|
17
|
-
"data-size": undefined,
|
|
18
|
-
className: "".concat((_node$attribs$class = node.attribs.class) !== null && _node$attribs$class !== void 0 ? _node$attribs$class : "", " u-large-body-text"),
|
|
19
|
-
children: domToReact(node.children, opts)
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
return null;
|
|
23
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 { PluginType } from "./types";
|
|
9
|
-
export declare const spanPlugin: PluginType;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.spanPlugin = void 0;
|
|
7
|
-
var _htmlReactParser = require("html-react-parser");
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
/**
|
|
10
|
-
* Copyright (c) 2023-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 spanPlugin = (node, opts) => {
|
|
18
|
-
if (node.attribs["data-size"] === "large") {
|
|
19
|
-
var _node$attribs$class;
|
|
20
|
-
const props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
21
|
-
return (0, _jsxRuntime.jsx)("span", {
|
|
22
|
-
...props,
|
|
23
|
-
"data-size": undefined,
|
|
24
|
-
className: "".concat((_node$attribs$class = node.attribs.class) !== null && _node$attribs$class !== void 0 ? _node$attribs$class : "", " u-large-body-text"),
|
|
25
|
-
children: (0, _htmlReactParser.domToReact)(node.children, opts)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
return null;
|
|
29
|
-
};
|
|
30
|
-
exports.spanPlugin = spanPlugin;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-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 { DOMNode, attributesToProps, domToReact } from "html-react-parser";
|
|
10
|
-
import { PluginType } from "./types";
|
|
11
|
-
export const spanPlugin: PluginType = (node, opts) => {
|
|
12
|
-
if (node.attribs["data-size"] === "large") {
|
|
13
|
-
const props = attributesToProps(node.attribs);
|
|
14
|
-
return (
|
|
15
|
-
<span {...props} data-size={undefined} className={`${node.attribs.class ?? ""} u-large-body-text`}>
|
|
16
|
-
{domToReact(node.children as DOMNode[], opts)}
|
|
17
|
-
</span>
|
|
18
|
-
);
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return null;
|
|
22
|
-
};
|