@ndla/article-converter 6.0.23 → 6.0.26
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/copyParagraphPlugin.js +1 -1
- package/es/plugins/ddPlugin.js +1 -1
- package/es/plugins/divPlugin.js +1 -1
- package/es/plugins/dtPlugin.js +1 -1
- package/es/plugins/embed/KeyFigureEmbedPlugin.js +1 -1
- package/es/plugins/embed/contactBlockEmbedPlugin.js +1 -1
- package/es/plugins/embed/imageEmbedPlugin.js +1 -1
- package/es/plugins/embed/index.js +11 -11
- package/es/plugins/embed/linkBlockEmbedPlugin.js +1 -1
- package/es/plugins/index.js +9 -9
- package/es/plugins/oembed/anchorPlugin.js +1 -1
- package/es/plugins/olPlugin.js +1 -1
- package/es/plugins/tablePlugin.js +1 -1
- package/es/plugins/ulPlugin.js +1 -1
- package/lib/plugins/copyParagraphPlugin.js +1 -1
- package/lib/plugins/ddPlugin.js +1 -1
- package/lib/plugins/divPlugin.js +1 -1
- package/lib/plugins/dtPlugin.js +1 -1
- package/lib/plugins/embed/KeyFigureEmbedPlugin.d.ts +7 -0
- package/lib/plugins/embed/KeyFigureEmbedPlugin.js +1 -1
- package/lib/plugins/embed/contactBlockEmbedPlugin.js +1 -1
- package/lib/plugins/embed/imageEmbedPlugin.js +1 -1
- package/lib/plugins/embed/index.js +11 -11
- package/lib/plugins/embed/linkBlockEmbedPlugin.js +1 -1
- package/lib/plugins/index.js +11 -11
- package/lib/plugins/oembed/anchorPlugin.js +1 -1
- package/lib/plugins/olPlugin.js +1 -1
- package/lib/plugins/tablePlugin.js +1 -1
- package/lib/plugins/types.d.ts +1 -1
- package/lib/plugins/ulPlugin.js +1 -1
- package/package.json +5 -5
- package/src/plugins/copyParagraphPlugin.tsx +1 -1
- package/src/plugins/ddPlugin.tsx +1 -1
- package/src/plugins/divPlugin.tsx +1 -1
- package/src/plugins/dtPlugin.tsx +1 -1
- package/src/plugins/embed/KeyFigureEmbedPlugin.tsx +1 -1
- package/src/plugins/embed/codeEmbedPlugin.tsx +1 -1
- package/src/plugins/embed/contactBlockEmbedPlugin.tsx +1 -1
- package/src/plugins/embed/imageEmbedPlugin.tsx +1 -1
- package/src/plugins/embed/index.ts +12 -12
- package/src/plugins/embed/linkBlockEmbedPlugin.tsx +1 -1
- package/src/plugins/index.ts +10 -10
- package/src/plugins/oembed/anchorPlugin.tsx +1 -1
- package/src/plugins/olPlugin.tsx +1 -1
- package/src/plugins/tablePlugin.tsx +1 -1
- package/src/plugins/types.ts +1 -1
- package/src/plugins/ulPlugin.tsx +1 -1
- package/src/transform.tsx +2 -2
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { CopyParagraphButton } from '@ndla/ui';
|
|
10
9
|
import { domToReact } from 'html-react-parser';
|
|
10
|
+
import { CopyParagraphButton } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const copyParagraphPlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const parent = node.parent;
|
package/es/plugins/ddPlugin.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { DefinitionDescription } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { DefinitionDescription } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const ddPlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
package/es/plugins/divPlugin.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import partition from 'lodash/partition';
|
|
10
9
|
import { domToReact, attributesToProps } from 'html-react-parser';
|
|
10
|
+
import partition from 'lodash/partition';
|
|
11
11
|
import { FileList, RelatedArticleList, Grid, GridParallaxItem } from '@ndla/ui';
|
|
12
12
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
13
|
import { Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
package/es/plugins/dtPlugin.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { DefinitionTerm } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { DefinitionTerm } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const dtPlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ContactBlock } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps } from 'html-react-parser';
|
|
10
|
+
import { ContactBlock } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const contactBlockEmbedPlugin = (element, _, opts) => {
|
|
13
13
|
const props = attributesToProps(element.attribs);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ImageEmbed } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps } from 'html-react-parser';
|
|
10
|
+
import { ImageEmbed } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const imageEmbedPlugin = (element, _, opts) => {
|
|
13
13
|
const props = attributesToProps(element.attribs);
|
|
@@ -7,23 +7,23 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { audioEmbedPlugin } from './audioEmbedPlugin';
|
|
10
|
-
import {
|
|
11
|
-
import { h5pEmbedPlugin } from './h5pEmbedPlugin';
|
|
12
|
-
import { iframeEmbedPlugin } from './iframeEmbedPlugin';
|
|
13
|
-
import { imageEmbedPlugin } from './imageEmbedPlugin';
|
|
14
|
-
import { footnoteEmbedPlugin } from './footnoteEmbedPlugin';
|
|
10
|
+
import { blogPostEmbedPlugin } from './blogPostEmbedPlugin';
|
|
15
11
|
import { brightcoveEmbedPlugin } from './brightcoveEmbedPlugin';
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
12
|
+
import { campaignBlockPlugin } from './campaignBlockPlugin';
|
|
13
|
+
import { codeEmbedPlugin } from './codeEmbedPlugin';
|
|
18
14
|
import { conceptEmbedPlugin } from './conceptEmbedPlugin';
|
|
19
15
|
import { conceptListEmbedPlugin } from './conceptListEmbedPlugin';
|
|
16
|
+
import { contactBlockEmbedPlugin } from './contactBlockEmbedPlugin';
|
|
17
|
+
import { contentLinkEmbedPlugin } from './contentLinkEmbedPlugin';
|
|
18
|
+
import { externalEmbedPlugin } from './externalEmbedPlugin';
|
|
20
19
|
import { fileEmbedPlugin } from './fileEmbedPlugin';
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
20
|
+
import { footnoteEmbedPlugin } from './footnoteEmbedPlugin';
|
|
21
|
+
import { h5pEmbedPlugin } from './h5pEmbedPlugin';
|
|
22
|
+
import { iframeEmbedPlugin } from './iframeEmbedPlugin';
|
|
23
|
+
import { imageEmbedPlugin } from './imageEmbedPlugin';
|
|
23
24
|
import { keyFigureEmbedPlugin } from './KeyFigureEmbedPlugin';
|
|
24
|
-
import { contactBlockEmbedPlugin } from './contactBlockEmbedPlugin';
|
|
25
|
-
import { campaignBlockPlugin } from './campaignBlockPlugin';
|
|
26
25
|
import { linkBlockPlugin } from './linkBlockEmbedPlugin';
|
|
26
|
+
import { relatedContentEmbedPlugin } from './relatedContentEmbedPlugin';
|
|
27
27
|
export const embedPlugins = {
|
|
28
28
|
image: imageEmbedPlugin,
|
|
29
29
|
audio: audioEmbedPlugin,
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { LinkBlock } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps } from 'html-react-parser';
|
|
10
|
+
import { LinkBlock } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const linkBlockPlugin = (element, _, opts) => {
|
|
13
13
|
const props = attributesToProps(element.attribs);
|
package/es/plugins/index.js
CHANGED
|
@@ -6,21 +6,21 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { anchorPlugin } from './anchorPlugin';
|
|
10
|
+
import { asidePlugin } from './asidePlugin';
|
|
9
11
|
import { copyParagraphPlugin } from './copyParagraphPlugin';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
12
|
+
import { ddPlugin } from './ddPlugin';
|
|
13
|
+
import { divPlugin } from './divPlugin';
|
|
14
|
+
import { dtPlugin } from './dtPlugin';
|
|
13
15
|
import { h3Plugin } from './h3Plugin';
|
|
14
16
|
import { mathPlugin } from './mathPlugin';
|
|
17
|
+
import { navPlugin } from './navPlugin';
|
|
15
18
|
import { anchorPlugin as oembedAnchorPlugin } from './oembed/anchorPlugin';
|
|
16
|
-
import {
|
|
19
|
+
import { olPlugin } from './olPlugin';
|
|
20
|
+
import { paragraphPlugin } from './paragraphPlugin';
|
|
21
|
+
import { spanPlugin } from './spanPlugin';
|
|
17
22
|
import { tablePlugin } from './tablePlugin';
|
|
18
|
-
import { asidePlugin } from './asidePlugin';
|
|
19
23
|
import { ulPlugin } from './ulPlugin';
|
|
20
|
-
import { ddPlugin } from './ddPlugin';
|
|
21
|
-
import { dtPlugin } from './dtPlugin';
|
|
22
|
-
import { navPlugin } from './navPlugin';
|
|
23
|
-
import { anchorPlugin } from './anchorPlugin';
|
|
24
24
|
export const basePlugins = {
|
|
25
25
|
h2: copyParagraphPlugin,
|
|
26
26
|
h3: h3Plugin,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
-
import { getPossiblyRelativeUrl } from '@ndla/ui';
|
|
11
10
|
import SafeLink from '@ndla/safelink';
|
|
11
|
+
import { getPossiblyRelativeUrl } from '@ndla/ui';
|
|
12
12
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
13
|
export const anchorPlugin = (node, options, _ref) => {
|
|
14
14
|
let {
|
package/es/plugins/olPlugin.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { OrderedList } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { OrderedList } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const olPlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Table } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { Table } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const tablePlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
package/es/plugins/ulPlugin.js
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { UnOrderedList } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { UnOrderedList } from '@ndla/ui';
|
|
11
11
|
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
12
|
export const ulPlugin = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.copyParagraphPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
package/lib/plugins/ddPlugin.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ddPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
package/lib/plugins/divPlugin.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.divPlugin = void 0;
|
|
7
|
-
var _partition = _interopRequireDefault(require("lodash/partition"));
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _partition = _interopRequireDefault(require("lodash/partition"));
|
|
9
9
|
var _ui = require("@ndla/ui");
|
|
10
10
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
package/lib/plugins/dtPlugin.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.dtPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -1,2 +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
|
+
*/
|
|
1
8
|
import { PluginType } from '../types';
|
|
2
9
|
export declare const keyFigureEmbedPlugin: PluginType;
|
|
@@ -7,7 +7,7 @@ exports.keyFigureEmbedPlugin = 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");
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
|
12
12
|
*
|
|
13
13
|
* This source code is licensed under the GPLv3 license found in the
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.contactBlockEmbedPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.imageEmbedPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.embedPlugins = void 0;
|
|
7
7
|
var _audioEmbedPlugin = require("./audioEmbedPlugin");
|
|
8
|
-
var
|
|
9
|
-
var _h5pEmbedPlugin = require("./h5pEmbedPlugin");
|
|
10
|
-
var _iframeEmbedPlugin = require("./iframeEmbedPlugin");
|
|
11
|
-
var _imageEmbedPlugin = require("./imageEmbedPlugin");
|
|
12
|
-
var _footnoteEmbedPlugin = require("./footnoteEmbedPlugin");
|
|
8
|
+
var _blogPostEmbedPlugin = require("./blogPostEmbedPlugin");
|
|
13
9
|
var _brightcoveEmbedPlugin = require("./brightcoveEmbedPlugin");
|
|
14
|
-
var
|
|
15
|
-
var
|
|
10
|
+
var _campaignBlockPlugin = require("./campaignBlockPlugin");
|
|
11
|
+
var _codeEmbedPlugin = require("./codeEmbedPlugin");
|
|
16
12
|
var _conceptEmbedPlugin = require("./conceptEmbedPlugin");
|
|
17
13
|
var _conceptListEmbedPlugin = require("./conceptListEmbedPlugin");
|
|
14
|
+
var _contactBlockEmbedPlugin = require("./contactBlockEmbedPlugin");
|
|
15
|
+
var _contentLinkEmbedPlugin = require("./contentLinkEmbedPlugin");
|
|
16
|
+
var _externalEmbedPlugin = require("./externalEmbedPlugin");
|
|
18
17
|
var _fileEmbedPlugin = require("./fileEmbedPlugin");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
18
|
+
var _footnoteEmbedPlugin = require("./footnoteEmbedPlugin");
|
|
19
|
+
var _h5pEmbedPlugin = require("./h5pEmbedPlugin");
|
|
20
|
+
var _iframeEmbedPlugin = require("./iframeEmbedPlugin");
|
|
21
|
+
var _imageEmbedPlugin = require("./imageEmbedPlugin");
|
|
21
22
|
var _KeyFigureEmbedPlugin = require("./KeyFigureEmbedPlugin");
|
|
22
|
-
var _contactBlockEmbedPlugin = require("./contactBlockEmbedPlugin");
|
|
23
|
-
var _campaignBlockPlugin = require("./campaignBlockPlugin");
|
|
24
23
|
var _linkBlockEmbedPlugin = require("./linkBlockEmbedPlugin");
|
|
24
|
+
var _relatedContentEmbedPlugin = require("./relatedContentEmbedPlugin");
|
|
25
25
|
/**
|
|
26
26
|
* Copyright (c) 2023-present, NDLA.
|
|
27
27
|
*
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.linkBlockPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
package/lib/plugins/index.js
CHANGED
|
@@ -4,21 +4,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.oembedPlugins = exports.basePlugins = void 0;
|
|
7
|
+
var _anchorPlugin = require("./anchorPlugin");
|
|
8
|
+
var _asidePlugin = require("./asidePlugin");
|
|
7
9
|
var _copyParagraphPlugin = require("./copyParagraphPlugin");
|
|
10
|
+
var _ddPlugin = require("./ddPlugin");
|
|
11
|
+
var _divPlugin = require("./divPlugin");
|
|
12
|
+
var _dtPlugin = require("./dtPlugin");
|
|
13
|
+
var _h3Plugin = require("./h3Plugin");
|
|
14
|
+
var _mathPlugin = require("./mathPlugin");
|
|
15
|
+
var _navPlugin = require("./navPlugin");
|
|
16
|
+
var _anchorPlugin2 = require("./oembed/anchorPlugin");
|
|
8
17
|
var _olPlugin = require("./olPlugin");
|
|
9
18
|
var _paragraphPlugin = require("./paragraphPlugin");
|
|
10
19
|
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
20
|
var _tablePlugin = require("./tablePlugin");
|
|
16
|
-
var _asidePlugin = require("./asidePlugin");
|
|
17
21
|
var _ulPlugin = require("./ulPlugin");
|
|
18
|
-
var _ddPlugin = require("./ddPlugin");
|
|
19
|
-
var _dtPlugin = require("./dtPlugin");
|
|
20
|
-
var _navPlugin = require("./navPlugin");
|
|
21
|
-
var _anchorPlugin2 = require("./anchorPlugin");
|
|
22
22
|
/**
|
|
23
23
|
* Copyright (c) 2023-present, NDLA.
|
|
24
24
|
*
|
|
@@ -41,9 +41,9 @@ const basePlugins = exports.basePlugins = {
|
|
|
41
41
|
dd: _ddPlugin.ddPlugin,
|
|
42
42
|
dt: _dtPlugin.dtPlugin,
|
|
43
43
|
nav: _navPlugin.navPlugin,
|
|
44
|
-
a:
|
|
44
|
+
a: _anchorPlugin.anchorPlugin
|
|
45
45
|
};
|
|
46
46
|
const oembedPlugins = exports.oembedPlugins = {
|
|
47
47
|
...basePlugins,
|
|
48
|
-
a:
|
|
48
|
+
a: _anchorPlugin2.anchorPlugin
|
|
49
49
|
};
|
|
@@ -5,8 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.anchorPlugin = void 0;
|
|
7
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
-
var _ui = require("@ndla/ui");
|
|
9
8
|
var _safelink = _interopRequireDefault(require("@ndla/safelink"));
|
|
9
|
+
var _ui = require("@ndla/ui");
|
|
10
10
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
12
|
/**
|
package/lib/plugins/olPlugin.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.olPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.tablePlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
package/lib/plugins/types.d.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
/// <reference types="react" />
|
|
9
|
-
import { HeartButtonType, RenderContext, CanonicalUrlFuncs } from '@ndla/ui';
|
|
10
9
|
import { Element, HTMLReactParserOptions } from 'html-react-parser';
|
|
10
|
+
import { HeartButtonType, RenderContext, CanonicalUrlFuncs } from '@ndla/ui';
|
|
11
11
|
export interface DynamicComponents {
|
|
12
12
|
heartButton?: HeartButtonType;
|
|
13
13
|
}
|
package/lib/plugins/ulPlugin.js
CHANGED
|
@@ -4,8 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ulPlugin = void 0;
|
|
7
|
-
var _ui = require("@ndla/ui");
|
|
8
7
|
var _htmlReactParser = require("html-react-parser");
|
|
8
|
+
var _ui = require("@ndla/ui");
|
|
9
9
|
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
10
|
/**
|
|
11
11
|
* Copyright (c) 2023-present, NDLA.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.26",
|
|
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": "^0.2.21",
|
|
31
|
-
"@ndla/types-embed": "^4.0.
|
|
31
|
+
"@ndla/types-embed": "^4.0.10"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/code": "^5.0.
|
|
35
|
-
"@ndla/ui": "^50.
|
|
34
|
+
"@ndla/code": "^5.0.21",
|
|
35
|
+
"@ndla/ui": "^50.4.1",
|
|
36
36
|
"html-react-parser": "^4.2.2",
|
|
37
37
|
"lodash": "^4.17.20"
|
|
38
38
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "e482b4679b927b5dea2d9f149a4a2fc51a907992"
|
|
52
52
|
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { CopyParagraphButton } from '@ndla/ui';
|
|
10
9
|
import { Element, domToReact } from 'html-react-parser';
|
|
10
|
+
import { CopyParagraphButton } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
export const copyParagraphPlugin: PluginType = (node, converterOpts, opts) => {
|
|
13
13
|
const parent = node.parent as Element | undefined;
|
package/src/plugins/ddPlugin.tsx
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { DefinitionDescription } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { DefinitionDescription } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
|
|
13
13
|
export const ddPlugin: PluginType = (node, converterOpts, opts) => {
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import partition from 'lodash/partition';
|
|
10
9
|
import { domToReact, attributesToProps, Element } from 'html-react-parser';
|
|
10
|
+
import partition from 'lodash/partition';
|
|
11
11
|
import { FileList, RelatedArticleList, Grid, GridType, GridParallaxItem } from '@ndla/ui';
|
|
12
12
|
import { PluginType } from './types';
|
|
13
13
|
|
package/src/plugins/dtPlugin.tsx
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { DefinitionTerm } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { DefinitionTerm } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
|
|
13
13
|
export const dtPlugin: PluginType = (node, converterOpts, opts) => {
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { attributesToProps } from 'html-react-parser';
|
|
10
|
-
import { CodeMetaData } from '@ndla/types-embed';
|
|
11
10
|
import { CodeEmbed } from '@ndla/code';
|
|
11
|
+
import { CodeMetaData } from '@ndla/types-embed';
|
|
12
12
|
import { PluginType } from '../types';
|
|
13
13
|
|
|
14
14
|
export const codeEmbedPlugin: PluginType = (element) => {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ContactBlock } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps } from 'html-react-parser';
|
|
11
10
|
import { ContactBlockMetaData } from '@ndla/types-embed';
|
|
11
|
+
import { ContactBlock } from '@ndla/ui';
|
|
12
12
|
import { PluginType } from '../types';
|
|
13
13
|
|
|
14
14
|
export const contactBlockEmbedPlugin: PluginType = (element, _, opts) => {
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { ImageEmbed } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, Element } from 'html-react-parser';
|
|
11
10
|
import { ImageMetaData } from '@ndla/types-embed';
|
|
11
|
+
import { ImageEmbed } from '@ndla/ui';
|
|
12
12
|
import { PluginType } from '../types';
|
|
13
13
|
|
|
14
14
|
export const imageEmbedPlugin: PluginType = (element, _, opts) => {
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { PluginType } from '../types';
|
|
10
9
|
import { audioEmbedPlugin } from './audioEmbedPlugin';
|
|
11
|
-
import {
|
|
12
|
-
import { h5pEmbedPlugin } from './h5pEmbedPlugin';
|
|
13
|
-
import { iframeEmbedPlugin } from './iframeEmbedPlugin';
|
|
14
|
-
import { imageEmbedPlugin } from './imageEmbedPlugin';
|
|
15
|
-
import { footnoteEmbedPlugin } from './footnoteEmbedPlugin';
|
|
10
|
+
import { blogPostEmbedPlugin } from './blogPostEmbedPlugin';
|
|
16
11
|
import { brightcoveEmbedPlugin } from './brightcoveEmbedPlugin';
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
12
|
+
import { campaignBlockPlugin } from './campaignBlockPlugin';
|
|
13
|
+
import { codeEmbedPlugin } from './codeEmbedPlugin';
|
|
19
14
|
import { conceptEmbedPlugin } from './conceptEmbedPlugin';
|
|
20
15
|
import { conceptListEmbedPlugin } from './conceptListEmbedPlugin';
|
|
16
|
+
import { contactBlockEmbedPlugin } from './contactBlockEmbedPlugin';
|
|
17
|
+
import { contentLinkEmbedPlugin } from './contentLinkEmbedPlugin';
|
|
18
|
+
import { externalEmbedPlugin } from './externalEmbedPlugin';
|
|
21
19
|
import { fileEmbedPlugin } from './fileEmbedPlugin';
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
20
|
+
import { footnoteEmbedPlugin } from './footnoteEmbedPlugin';
|
|
21
|
+
import { h5pEmbedPlugin } from './h5pEmbedPlugin';
|
|
22
|
+
import { iframeEmbedPlugin } from './iframeEmbedPlugin';
|
|
23
|
+
import { imageEmbedPlugin } from './imageEmbedPlugin';
|
|
24
24
|
import { keyFigureEmbedPlugin } from './KeyFigureEmbedPlugin';
|
|
25
|
-
import { contactBlockEmbedPlugin } from './contactBlockEmbedPlugin';
|
|
26
|
-
import { campaignBlockPlugin } from './campaignBlockPlugin';
|
|
27
25
|
import { linkBlockPlugin } from './linkBlockEmbedPlugin';
|
|
26
|
+
import { relatedContentEmbedPlugin } from './relatedContentEmbedPlugin';
|
|
27
|
+
import { PluginType } from '../types';
|
|
28
28
|
|
|
29
29
|
export const embedPlugins: Record<string, PluginType> = {
|
|
30
30
|
image: imageEmbedPlugin,
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { LinkBlock } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps } from 'html-react-parser';
|
|
11
10
|
import { LinkBlockMetaData } from '@ndla/types-embed';
|
|
11
|
+
import { LinkBlock } from '@ndla/ui';
|
|
12
12
|
import { PluginType } from '../types';
|
|
13
13
|
|
|
14
14
|
export const linkBlockPlugin: PluginType = (element, _, opts) => {
|
package/src/plugins/index.ts
CHANGED
|
@@ -6,22 +6,22 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { anchorPlugin } from './anchorPlugin';
|
|
10
|
+
import { asidePlugin } from './asidePlugin';
|
|
9
11
|
import { copyParagraphPlugin } from './copyParagraphPlugin';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import { spanPlugin } from './spanPlugin';
|
|
12
|
+
import { ddPlugin } from './ddPlugin';
|
|
13
|
+
import { divPlugin } from './divPlugin';
|
|
14
|
+
import { dtPlugin } from './dtPlugin';
|
|
14
15
|
import { h3Plugin } from './h3Plugin';
|
|
15
16
|
import { mathPlugin } from './mathPlugin';
|
|
17
|
+
import { navPlugin } from './navPlugin';
|
|
16
18
|
import { anchorPlugin as oembedAnchorPlugin } from './oembed/anchorPlugin';
|
|
17
|
-
import {
|
|
19
|
+
import { olPlugin } from './olPlugin';
|
|
20
|
+
import { paragraphPlugin } from './paragraphPlugin';
|
|
21
|
+
import { spanPlugin } from './spanPlugin';
|
|
18
22
|
import { tablePlugin } from './tablePlugin';
|
|
19
|
-
import {
|
|
23
|
+
import { PluginType } from './types';
|
|
20
24
|
import { ulPlugin } from './ulPlugin';
|
|
21
|
-
import { ddPlugin } from './ddPlugin';
|
|
22
|
-
import { dtPlugin } from './dtPlugin';
|
|
23
|
-
import { navPlugin } from './navPlugin';
|
|
24
|
-
import { anchorPlugin } from './anchorPlugin';
|
|
25
25
|
|
|
26
26
|
export const basePlugins: Record<string, PluginType> = {
|
|
27
27
|
h2: copyParagraphPlugin,
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
-
import { getPossiblyRelativeUrl } from '@ndla/ui';
|
|
11
10
|
import SafeLink from '@ndla/safelink';
|
|
11
|
+
import { getPossiblyRelativeUrl } from '@ndla/ui';
|
|
12
12
|
import { PluginType } from '../types';
|
|
13
13
|
|
|
14
14
|
export const anchorPlugin: PluginType = (node, options, { path }) => {
|
package/src/plugins/olPlugin.tsx
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { OrderedList } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { OrderedList } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
export const olPlugin: PluginType = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { Table } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { Table } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
export const tablePlugin: PluginType = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
package/src/plugins/types.ts
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { HeartButtonType, RenderContext, CanonicalUrlFuncs } from '@ndla/ui';
|
|
10
9
|
import { Element, HTMLReactParserOptions } from 'html-react-parser';
|
|
10
|
+
import { HeartButtonType, RenderContext, CanonicalUrlFuncs } from '@ndla/ui';
|
|
11
11
|
|
|
12
12
|
export interface DynamicComponents {
|
|
13
13
|
heartButton?: HeartButtonType;
|
package/src/plugins/ulPlugin.tsx
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { UnOrderedList } from '@ndla/ui';
|
|
10
9
|
import { attributesToProps, domToReact } from 'html-react-parser';
|
|
10
|
+
import { UnOrderedList } from '@ndla/ui';
|
|
11
11
|
import { PluginType } from './types';
|
|
12
12
|
export const ulPlugin: PluginType = (node, converterOpts, opts) => {
|
|
13
13
|
const props = attributesToProps(node.attribs);
|
package/src/transform.tsx
CHANGED
|
@@ -7,11 +7,11 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import parse, { HTMLReactParserOptions } from 'html-react-parser';
|
|
10
|
-
import { UnknownEmbed } from '@ndla/ui';
|
|
11
10
|
import { MetaData } from '@ndla/types-embed';
|
|
11
|
+
import { UnknownEmbed } from '@ndla/ui';
|
|
12
12
|
import { basePlugins, oembedPlugins } from './plugins';
|
|
13
|
-
import { TransformOptions } from './plugins/types';
|
|
14
13
|
import { embedPlugins } from './plugins/embed';
|
|
14
|
+
import { TransformOptions } from './plugins/types';
|
|
15
15
|
|
|
16
16
|
const transform = (content: string, opts: TransformOptions) => {
|
|
17
17
|
const plugins = opts?.isOembed ? oembedPlugins : basePlugins;
|