@ndla/article-converter 5.1.8 → 6.0.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/brightcoveEmbedPlugin.js +2 -1
- package/es/plugins/embed/imageEmbedPlugin.js +2 -1
- package/lib/plugins/embed/brightcoveEmbedPlugin.js +2 -1
- package/lib/plugins/embed/imageEmbedPlugin.js +2 -1
- package/lib/plugins/types.d.ts +2 -1
- package/package.json +4 -4
- package/src/plugins/embed/brightcoveEmbedPlugin.tsx +1 -1
- package/src/plugins/embed/imageEmbedPlugin.tsx +1 -0
- package/src/plugins/types.ts +2 -1
|
@@ -15,6 +15,7 @@ export var brightcoveEmbedPlugin = function brightcoveEmbedPlugin(element, _, op
|
|
|
15
15
|
var data = JSON.parse(props['data-json']);
|
|
16
16
|
return _jsx(BrightcoveEmbed, {
|
|
17
17
|
embed: data,
|
|
18
|
-
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton
|
|
18
|
+
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton,
|
|
19
|
+
renderContext: opts.renderContext
|
|
19
20
|
});
|
|
20
21
|
};
|
|
@@ -20,6 +20,7 @@ export var imageEmbedPlugin = function imageEmbedPlugin(element, _, opts) {
|
|
|
20
20
|
path: opts.path,
|
|
21
21
|
previewAlt: opts.previewAlt,
|
|
22
22
|
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton,
|
|
23
|
-
lang: opts.articleLanguage
|
|
23
|
+
lang: opts.articleLanguage,
|
|
24
|
+
renderContext: opts.renderContext
|
|
24
25
|
});
|
|
25
26
|
};
|
|
@@ -21,7 +21,8 @@ var brightcoveEmbedPlugin = function brightcoveEmbedPlugin(element, _, opts) {
|
|
|
21
21
|
var data = JSON.parse(props['data-json']);
|
|
22
22
|
return (0, _jsxRuntime.jsx)(_ui.BrightcoveEmbed, {
|
|
23
23
|
embed: data,
|
|
24
|
-
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton
|
|
24
|
+
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton,
|
|
25
|
+
renderContext: opts.renderContext
|
|
25
26
|
});
|
|
26
27
|
};
|
|
27
28
|
exports.brightcoveEmbedPlugin = brightcoveEmbedPlugin;
|
|
@@ -26,7 +26,8 @@ var imageEmbedPlugin = function imageEmbedPlugin(element, _, opts) {
|
|
|
26
26
|
path: opts.path,
|
|
27
27
|
previewAlt: opts.previewAlt,
|
|
28
28
|
heartButton: (_opts$components = opts.components) === null || _opts$components === void 0 ? void 0 : _opts$components.heartButton,
|
|
29
|
-
lang: opts.articleLanguage
|
|
29
|
+
lang: opts.articleLanguage,
|
|
30
|
+
renderContext: opts.renderContext
|
|
30
31
|
});
|
|
31
32
|
};
|
|
32
33
|
exports.imageEmbedPlugin = imageEmbedPlugin;
|
package/lib/plugins/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
/// <reference types="react" />
|
|
9
|
-
import { HeartButtonType } from '@ndla/ui';
|
|
9
|
+
import { HeartButtonType, RenderContext } from '@ndla/ui';
|
|
10
10
|
import { Element, HTMLReactParserOptions } from 'html-react-parser';
|
|
11
11
|
export interface DynamicComponents {
|
|
12
12
|
heartButton?: HeartButtonType;
|
|
@@ -19,5 +19,6 @@ export interface TransformOptions {
|
|
|
19
19
|
frontendDomain?: string;
|
|
20
20
|
components?: DynamicComponents;
|
|
21
21
|
articleLanguage?: string;
|
|
22
|
+
renderContext?: RenderContext;
|
|
22
23
|
}
|
|
23
24
|
export type PluginType = (element: Element, options: HTMLReactParserOptions, metaData: TransformOptions) => JSX.Element | undefined | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "Transforms NDLA articles into extended html versions",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"@ndla/types-embed": "^4.0.5"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ndla/code": "^5.0.
|
|
34
|
-
"@ndla/ui": "^49.0.
|
|
33
|
+
"@ndla/code": "^5.0.10",
|
|
34
|
+
"@ndla/ui": "^49.0.1",
|
|
35
35
|
"html-react-parser": "^4.2.2",
|
|
36
36
|
"lodash": "^4.17.20"
|
|
37
37
|
},
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "613a1b7bd697142fdcee7cca42c743f4c2431a40"
|
|
48
48
|
}
|
|
@@ -14,5 +14,5 @@ import { PluginType } from '../types';
|
|
|
14
14
|
export const brightcoveEmbedPlugin: PluginType = (element, _, opts) => {
|
|
15
15
|
const props = attributesToProps(element.attribs);
|
|
16
16
|
const data = JSON.parse(props['data-json']) as BrightcoveMetaData;
|
|
17
|
-
return <BrightcoveEmbed embed={data} heartButton={opts.components?.heartButton} />;
|
|
17
|
+
return <BrightcoveEmbed embed={data} heartButton={opts.components?.heartButton} renderContext={opts.renderContext} />;
|
|
18
18
|
};
|
package/src/plugins/types.ts
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { HeartButtonType } from '@ndla/ui';
|
|
9
|
+
import { HeartButtonType, RenderContext } from '@ndla/ui';
|
|
10
10
|
import { Element, HTMLReactParserOptions } from 'html-react-parser';
|
|
11
11
|
|
|
12
12
|
export interface DynamicComponents {
|
|
@@ -21,6 +21,7 @@ export interface TransformOptions {
|
|
|
21
21
|
frontendDomain?: string;
|
|
22
22
|
components?: DynamicComponents;
|
|
23
23
|
articleLanguage?: string;
|
|
24
|
+
renderContext?: RenderContext;
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export type PluginType = (
|