@ndla/article-converter 1.0.1 → 1.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/README.md +32 -0
- package/es/plugins/{AsidePlugin.js → asidePlugin.js} +1 -1
- package/es/plugins/{CopyParagraphPlugin.js → copyParagraphPlugin.js} +1 -1
- package/es/plugins/{DivPlugin.js → divPlugin.js} +1 -1
- package/es/plugins/embed/{AudioEmbedPlugin.js → audioEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{BrightcoveEmbedPlugin.js → brightcoveEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{CodeEmbedPlugin.js → codeEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{ConceptEmbedPlugin.js → conceptEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{ConceptListEmbedPlugin.js → conceptListEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{ContentLinkEmbedPlugin.js → contentLinkEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{ExternalEmbedPlugin.js → externalEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{FileEmbedPlugin.js → fileEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{FootnoteEmbedPlugin.js → footnoteEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{H5pEmbedPlugin.js → h5pEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{IframeEmbedPlugin.js → iframeEmbedPlugin.js} +1 -1
- package/es/plugins/embed/{ImageEmbedPlugin.js → imageEmbedPlugin.js} +1 -1
- package/es/plugins/embed/index.js +26 -26
- package/es/plugins/embed/{RelatedContentEmbedPlugin.js → relatedContentEmbedPlugin.js} +1 -1
- package/es/plugins/{H3Plugin.js → h3Plugin.js} +1 -1
- package/es/plugins/index.js +22 -20
- package/es/plugins/{MathPlugin.js → mathPlugin.js} +1 -1
- package/es/plugins/oembed/{AnchorPlugin.js → anchorPlugin.js} +1 -1
- package/es/plugins/{OLPlugin.js → olPlugin.js} +1 -1
- package/es/plugins/{ParagraphPlugin.js → paragraphPlugin.js} +1 -1
- package/es/plugins/{SpanPlugin.js → spanPlugin.js} +1 -1
- package/es/plugins/{TablePlugin.js → tablePlugin.js} +1 -1
- package/es/plugins/{ULPlugin.js → ulPlugin.js} +1 -1
- package/lib/plugins/{AsidePlugin.d.ts → asidePlugin.d.ts} +1 -1
- package/lib/plugins/{AsidePlugin.js → asidePlugin.js} +3 -3
- package/lib/plugins/{CopyParagraphPlugin.d.ts → copyParagraphPlugin.d.ts} +1 -1
- package/lib/plugins/{CopyParagraphPlugin.js → copyParagraphPlugin.js} +3 -3
- package/lib/plugins/{DivPlugin.d.ts → divPlugin.d.ts} +1 -1
- package/lib/plugins/{DivPlugin.js → divPlugin.js} +3 -3
- package/lib/plugins/embed/{AudioEmbedPlugin.d.ts → audioEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{AudioEmbedPlugin.js → audioEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{BrightcoveEmbedPlugin.d.ts → brightcoveEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{BrightcoveEmbedPlugin.js → brightcoveEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{FileEmbedPlugin.d.ts → codeEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{CodeEmbedPlugin.js → codeEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{ConceptEmbedPlugin.d.ts → conceptEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{ConceptEmbedPlugin.js → conceptEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/conceptListEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{ConceptListEmbedPlugin.js → conceptListEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/contentLinkEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{ContentLinkEmbedPlugin.js → contentLinkEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{ExternalEmbedPlugin.d.ts → externalEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{ExternalEmbedPlugin.js → externalEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{CodeEmbedPlugin.d.ts → fileEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{FileEmbedPlugin.js → fileEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/footnoteEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{FootnoteEmbedPlugin.js → footnoteEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/{H5pEmbedPlugin.d.ts → h5pEmbedPlugin.d.ts} +1 -1
- package/lib/plugins/embed/{H5pEmbedPlugin.js → h5pEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/iframeEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{IframeEmbedPlugin.js → iframeEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/imageEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{ImageEmbedPlugin.js → imageEmbedPlugin.js} +3 -3
- package/lib/plugins/embed/index.js +26 -26
- package/lib/plugins/embed/relatedContentEmbedPlugin.d.ts +9 -0
- package/lib/plugins/embed/{RelatedContentEmbedPlugin.js → relatedContentEmbedPlugin.js} +3 -3
- package/lib/plugins/{OLPlugin.d.ts → h3Plugin.d.ts} +1 -1
- package/lib/plugins/{H3Plugin.js → h3Plugin.js} +3 -3
- package/lib/plugins/index.js +22 -20
- package/lib/plugins/{MathPlugin.d.ts → mathPlugin.d.ts} +1 -1
- package/lib/plugins/{MathPlugin.js → mathPlugin.js} +3 -3
- package/lib/plugins/oembed/{AnchorPlugin.d.ts → anchorPlugin.d.ts} +1 -1
- package/lib/plugins/oembed/{AnchorPlugin.js → anchorPlugin.js} +3 -3
- package/lib/plugins/{ULPlugin.d.ts → olPlugin.d.ts} +1 -1
- package/lib/plugins/{OLPlugin.js → olPlugin.js} +3 -3
- package/lib/plugins/paragraphPlugin.d.ts +9 -0
- package/lib/plugins/{ParagraphPlugin.js → paragraphPlugin.js} +3 -3
- package/lib/plugins/spanPlugin.d.ts +9 -0
- package/lib/plugins/{SpanPlugin.js → spanPlugin.js} +3 -3
- package/lib/plugins/tablePlugin.d.ts +9 -0
- package/lib/plugins/{TablePlugin.js → tablePlugin.js} +3 -3
- package/lib/plugins/{H3Plugin.d.ts → ulPlugin.d.ts} +1 -1
- package/lib/plugins/{ULPlugin.js → ulPlugin.js} +3 -3
- package/package.json +5 -5
- package/src/plugins/{AsidePlugin.tsx → asidePlugin.tsx} +1 -1
- package/src/plugins/{CopyParagraphPlugin.tsx → copyParagraphPlugin.tsx} +1 -1
- package/src/plugins/{DivPlugin.tsx → divPlugin.tsx} +1 -1
- package/src/plugins/embed/{AudioEmbedPlugin.tsx → audioEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{BrightcoveEmbedPlugin.tsx → brightcoveEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{CodeEmbedPlugin.tsx → codeEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{ConceptEmbedPlugin.tsx → conceptEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{ConceptListEmbedPlugin.tsx → conceptListEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{ContentLinkEmbedPlugin.tsx → contentLinkEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{ExternalEmbedPlugin.tsx → externalEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{FileEmbedPlugin.tsx → fileEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{FootnoteEmbedPlugin.tsx → footnoteEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{H5pEmbedPlugin.tsx → h5pEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{IframeEmbedPlugin.tsx → iframeEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/{ImageEmbedPlugin.tsx → imageEmbedPlugin.tsx} +1 -1
- package/src/plugins/embed/index.ts +26 -26
- package/src/plugins/embed/{RelatedContentEmbedPlugin.tsx → relatedContentEmbedPlugin.tsx} +1 -1
- package/src/plugins/{H3Plugin.tsx → h3Plugin.tsx} +1 -1
- package/src/plugins/index.ts +22 -20
- package/src/plugins/{MathPlugin.tsx → mathPlugin.tsx} +1 -1
- package/src/plugins/oembed/{AnchorPlugin.tsx → anchorPlugin.tsx} +1 -1
- package/src/plugins/{OLPlugin.tsx → olPlugin.tsx} +1 -1
- package/src/plugins/{ParagraphPlugin.tsx → paragraphPlugin.tsx} +1 -1
- package/src/plugins/{SpanPlugin.tsx → spanPlugin.tsx} +1 -1
- package/src/plugins/{TablePlugin.tsx → tablePlugin.tsx} +1 -1
- package/src/plugins/{ULPlugin.tsx → ulPlugin.tsx} +1 -1
- package/lib/plugins/ParagraphPlugin.d.ts +0 -9
- package/lib/plugins/SpanPlugin.d.ts +0 -9
- package/lib/plugins/TablePlugin.d.ts +0 -9
- package/lib/plugins/embed/ConceptListEmbedPlugin.d.ts +0 -9
- package/lib/plugins/embed/ContentLinkEmbedPlugin.d.ts +0 -9
- package/lib/plugins/embed/FootnoteEmbedPlugin.d.ts +0 -9
- package/lib/plugins/embed/IframeEmbedPlugin.d.ts +0 -9
- package/lib/plugins/embed/ImageEmbedPlugin.d.ts +0 -9
- package/lib/plugins/embed/RelatedContentEmbedPlugin.d.ts +0 -9
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.conceptListEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,11 +15,11 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var conceptListEmbedPlugin = function conceptListEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.ConceptListEmbed, {
|
|
22
22
|
embed: data
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.conceptListEmbedPlugin = conceptListEmbedPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 contentLinkEmbedPlugin: PluginType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.contentLinkEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,7 +15,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var contentLinkEmbedPlugin = function contentLinkEmbedPlugin(element, _, _ref) {
|
|
19
19
|
var isOembed = _ref.isOembed;
|
|
20
20
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
21
21
|
var data = JSON.parse(props['data-json']);
|
|
@@ -24,4 +24,4 @@ var ContentLinkEmbedPlugin = function ContentLinkEmbedPlugin(element, _, _ref) {
|
|
|
24
24
|
isOembed: isOembed
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.contentLinkEmbedPlugin = contentLinkEmbedPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.externalEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,11 +15,11 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var externalEmbedPlugin = function externalEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.ExternalEmbed, {
|
|
22
22
|
embed: data
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.externalEmbedPlugin = externalEmbedPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.fileEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,7 +15,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var fileEmbedPlugin = function fileEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
var _data$embedData = data.embedData,
|
|
@@ -37,4 +37,4 @@ var FileEmbedPlugin = function FileEmbedPlugin(element) {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
|
-
exports.
|
|
40
|
+
exports.fileEmbedPlugin = fileEmbedPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 footnoteEmbedPlugin: PluginType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.footnoteEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,11 +15,11 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var footnoteEmbedPlugin = function footnoteEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.FootnoteEmbed, {
|
|
22
22
|
embed: data
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.footnoteEmbedPlugin = footnoteEmbedPlugin;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.h5pEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,11 +15,11 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var h5pEmbedPlugin = function h5pEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.H5pEmbed, {
|
|
22
22
|
embed: data
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.h5pEmbedPlugin = h5pEmbedPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 iframeEmbedPlugin: PluginType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.iframeEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,11 +15,11 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var iframeEmbedPlugin = function iframeEmbedPlugin(element) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.IframeEmbed, {
|
|
22
22
|
embed: data
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.iframeEmbedPlugin = iframeEmbedPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 imageEmbedPlugin: PluginType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.imageEmbedPlugin = void 0;
|
|
7
7
|
var _ui = require("@ndla/ui");
|
|
8
8
|
var _htmlReactParser = require("html-react-parser");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,7 +15,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var imageEmbedPlugin = function imageEmbedPlugin(element, _, opts) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.ImageEmbed, {
|
|
@@ -24,4 +24,4 @@ var ImageEmbedPlugin = function ImageEmbedPlugin(element, _, opts) {
|
|
|
24
24
|
previewAlt: opts.previewAlt
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.imageEmbedPlugin = imageEmbedPlugin;
|
|
@@ -4,19 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.embedPlugins = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
17
|
-
var
|
|
18
|
-
var
|
|
19
|
-
var
|
|
7
|
+
var _audioEmbedPlugin = require("./audioEmbedPlugin");
|
|
8
|
+
var _externalEmbedPlugin = require("./externalEmbedPlugin");
|
|
9
|
+
var _h5pEmbedPlugin = require("./h5pEmbedPlugin");
|
|
10
|
+
var _iframeEmbedPlugin = require("./iframeEmbedPlugin");
|
|
11
|
+
var _imageEmbedPlugin = require("./imageEmbedPlugin");
|
|
12
|
+
var _footnoteEmbedPlugin = require("./footnoteEmbedPlugin");
|
|
13
|
+
var _brightcoveEmbedPlugin = require("./brightcoveEmbedPlugin");
|
|
14
|
+
var _relatedContentEmbedPlugin = require("./relatedContentEmbedPlugin");
|
|
15
|
+
var _contentLinkEmbedPlugin = require("./contentLinkEmbedPlugin");
|
|
16
|
+
var _conceptEmbedPlugin = require("./conceptEmbedPlugin");
|
|
17
|
+
var _conceptListEmbedPlugin = require("./conceptListEmbedPlugin");
|
|
18
|
+
var _fileEmbedPlugin = require("./fileEmbedPlugin");
|
|
19
|
+
var _codeEmbedPlugin = require("./codeEmbedPlugin");
|
|
20
20
|
/**
|
|
21
21
|
* Copyright (c) 2023-present, NDLA.
|
|
22
22
|
*
|
|
@@ -26,18 +26,18 @@ var _CodeEmbedPlugin = require("./CodeEmbedPlugin");
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
var embedPlugins = {
|
|
29
|
-
image:
|
|
30
|
-
audio:
|
|
31
|
-
h5p:
|
|
32
|
-
'code-block':
|
|
33
|
-
external:
|
|
34
|
-
iframe:
|
|
35
|
-
footnote:
|
|
36
|
-
brightcove:
|
|
37
|
-
'related-content':
|
|
38
|
-
'content-link':
|
|
39
|
-
concept:
|
|
40
|
-
'concept-list':
|
|
41
|
-
file:
|
|
29
|
+
image: _imageEmbedPlugin.imageEmbedPlugin,
|
|
30
|
+
audio: _audioEmbedPlugin.audioEmbedPlugin,
|
|
31
|
+
h5p: _h5pEmbedPlugin.h5pEmbedPlugin,
|
|
32
|
+
'code-block': _codeEmbedPlugin.codeEmbedPlugin,
|
|
33
|
+
external: _externalEmbedPlugin.externalEmbedPlugin,
|
|
34
|
+
iframe: _iframeEmbedPlugin.iframeEmbedPlugin,
|
|
35
|
+
footnote: _footnoteEmbedPlugin.footnoteEmbedPlugin,
|
|
36
|
+
brightcove: _brightcoveEmbedPlugin.brightcoveEmbedPlugin,
|
|
37
|
+
'related-content': _relatedContentEmbedPlugin.relatedContentEmbedPlugin,
|
|
38
|
+
'content-link': _contentLinkEmbedPlugin.contentLinkEmbedPlugin,
|
|
39
|
+
concept: _conceptEmbedPlugin.conceptEmbedPlugin,
|
|
40
|
+
'concept-list': _conceptListEmbedPlugin.conceptListEmbedPlugin,
|
|
41
|
+
file: _fileEmbedPlugin.fileEmbedPlugin
|
|
42
42
|
};
|
|
43
43
|
exports.embedPlugins = embedPlugins;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 relatedContentEmbedPlugin: PluginType;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.relatedContentEmbedPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
@@ -15,7 +15,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var relatedContentEmbedPlugin = function relatedContentEmbedPlugin(element, _, opts) {
|
|
19
19
|
var props = (0, _htmlReactParser.attributesToProps)(element.attribs);
|
|
20
20
|
var data = JSON.parse(props['data-json']);
|
|
21
21
|
return (0, _jsxRuntime.jsx)(_ui.RelatedContentEmbed, {
|
|
@@ -24,4 +24,4 @@ var RelatedContentEmbedPlugin = function RelatedContentEmbedPlugin(element, _, o
|
|
|
24
24
|
ndlaFrontendDomain: opts.frontendDomain
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.relatedContentEmbedPlugin = relatedContentEmbedPlugin;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.h3Plugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
var
|
|
12
|
+
var h3Plugin = function h3Plugin(node, opts) {
|
|
13
13
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
14
14
|
return (
|
|
15
15
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
@@ -19,4 +19,4 @@ var H3Plugin = function H3Plugin(node, opts) {
|
|
|
19
19
|
}))
|
|
20
20
|
);
|
|
21
21
|
};
|
|
22
|
-
exports.
|
|
22
|
+
exports.h3Plugin = h3Plugin;
|
package/lib/plugins/index.js
CHANGED
|
@@ -4,32 +4,34 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.oembedPlugins = exports.basePlugins = void 0;
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
15
|
-
var
|
|
16
|
-
var
|
|
7
|
+
var _copyParagraphPlugin = require("./copyParagraphPlugin");
|
|
8
|
+
var _olPlugin = require("./olPlugin");
|
|
9
|
+
var _paragraphPlugin = require("./paragraphPlugin");
|
|
10
|
+
var _spanPlugin = require("./spanPlugin");
|
|
11
|
+
var _h3Plugin = require("./h3Plugin");
|
|
12
|
+
var _mathPlugin = require("./mathPlugin");
|
|
13
|
+
var _anchorPlugin = require("./oembed/anchorPlugin");
|
|
14
|
+
var _divPlugin = require("./divPlugin");
|
|
15
|
+
var _tablePlugin = require("./tablePlugin");
|
|
16
|
+
var _asidePlugin = require("./asidePlugin");
|
|
17
|
+
var _ulPlugin = require("./ulPlugin");
|
|
17
18
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
19
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
20
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
21
|
var basePlugins = {
|
|
21
|
-
h2:
|
|
22
|
-
h3:
|
|
23
|
-
ol:
|
|
24
|
-
p:
|
|
25
|
-
span:
|
|
26
|
-
math:
|
|
27
|
-
div:
|
|
28
|
-
table:
|
|
29
|
-
aside:
|
|
22
|
+
h2: _copyParagraphPlugin.copyParagraphPlugin,
|
|
23
|
+
h3: _h3Plugin.h3Plugin,
|
|
24
|
+
ol: _olPlugin.olPlugin,
|
|
25
|
+
p: _paragraphPlugin.paragraphPlugin,
|
|
26
|
+
span: _spanPlugin.spanPlugin,
|
|
27
|
+
math: _mathPlugin.mathPlugin,
|
|
28
|
+
div: _divPlugin.divPlugin,
|
|
29
|
+
table: _tablePlugin.tablePlugin,
|
|
30
|
+
aside: _asidePlugin.asidePlugin,
|
|
31
|
+
ul: _ulPlugin.ulPlugin
|
|
30
32
|
};
|
|
31
33
|
exports.basePlugins = basePlugins;
|
|
32
34
|
var oembedPlugins = _objectSpread(_objectSpread({}, basePlugins), {}, {
|
|
33
|
-
a:
|
|
35
|
+
a: _anchorPlugin.anchorPlugin
|
|
34
36
|
});
|
|
35
37
|
exports.oembedPlugins = oembedPlugins;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.mathPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
/**
|
|
@@ -14,7 +14,7 @@ var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
|
14
14
|
*
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
|
-
var
|
|
17
|
+
var mathPlugin = function mathPlugin(node) {
|
|
18
18
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
19
19
|
return (0, _jsxRuntime.jsx)("span", {
|
|
20
20
|
dangerouslySetInnerHTML: {
|
|
@@ -22,4 +22,4 @@ var MathPlugin = function MathPlugin(node) {
|
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
-
exports.
|
|
25
|
+
exports.mathPlugin = mathPlugin;
|
|
@@ -3,17 +3,17 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.anchorPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
var
|
|
12
|
+
var anchorPlugin = function anchorPlugin(node, options) {
|
|
13
13
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
14
14
|
return (0, _jsxRuntime.jsx)("a", _objectSpread(_objectSpread({}, props), {}, {
|
|
15
15
|
target: "_blank",
|
|
16
16
|
children: (0, _htmlReactParser.domToReact)(node.children, options)
|
|
17
17
|
}));
|
|
18
18
|
};
|
|
19
|
-
exports.
|
|
19
|
+
exports.anchorPlugin = anchorPlugin;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.olPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
var
|
|
12
|
+
var olPlugin = function olPlugin(node, opts) {
|
|
13
13
|
var _node$attribs$class;
|
|
14
14
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
15
15
|
var letterClass = node.attribs['data-type'] === 'letters' ? 'ol-list--roman' : false;
|
|
@@ -24,4 +24,4 @@ var OLPlugin = function OLPlugin(node, opts) {
|
|
|
24
24
|
children: (0, _htmlReactParser.domToReact)(node.children, opts)
|
|
25
25
|
}));
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.olPlugin = olPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 paragraphPlugin: PluginType;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.paragraphPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
var
|
|
12
|
+
var paragraphPlugin = function paragraphPlugin(node, opts) {
|
|
13
13
|
if (node.attribs['data-align'] === 'center') {
|
|
14
14
|
var _node$attribs$class;
|
|
15
15
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
@@ -24,4 +24,4 @@ var ParagraphPlugin = function ParagraphPlugin(node, opts) {
|
|
|
24
24
|
}
|
|
25
25
|
return null;
|
|
26
26
|
};
|
|
27
|
-
exports.
|
|
27
|
+
exports.paragraphPlugin = paragraphPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.spanPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
8
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
9
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
10
10
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
11
11
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
-
var
|
|
12
|
+
var spanPlugin = function spanPlugin(node, opts) {
|
|
13
13
|
if (node.attribs['data-size'] === 'large') {
|
|
14
14
|
var _node$attribs$class;
|
|
15
15
|
var props = (0, _htmlReactParser.attributesToProps)(node.attribs);
|
|
@@ -21,4 +21,4 @@ var SpanPlugin = function SpanPlugin(node, opts) {
|
|
|
21
21
|
}
|
|
22
22
|
return null;
|
|
23
23
|
};
|
|
24
|
-
exports.
|
|
24
|
+
exports.spanPlugin = spanPlugin;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 tablePlugin: PluginType;
|