@ndla/article-converter 1.0.31 → 1.0.32
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.
|
@@ -15,8 +15,9 @@ export var fileEmbedPlugin = function fileEmbedPlugin(element) {
|
|
|
15
15
|
var _data$embedData = data.embedData,
|
|
16
16
|
type = _data$embedData.type,
|
|
17
17
|
title = _data$embedData.title,
|
|
18
|
-
url = _data$embedData.url
|
|
19
|
-
|
|
18
|
+
url = _data$embedData.url,
|
|
19
|
+
display = _data$embedData.display;
|
|
20
|
+
if (type === 'pdf' && display === 'block') {
|
|
20
21
|
return _jsx(PdfFile, {
|
|
21
22
|
title: title,
|
|
22
23
|
url: url
|
|
@@ -21,8 +21,9 @@ var fileEmbedPlugin = function fileEmbedPlugin(element) {
|
|
|
21
21
|
var _data$embedData = data.embedData,
|
|
22
22
|
type = _data$embedData.type,
|
|
23
23
|
title = _data$embedData.title,
|
|
24
|
-
url = _data$embedData.url
|
|
25
|
-
|
|
24
|
+
url = _data$embedData.url,
|
|
25
|
+
display = _data$embedData.display;
|
|
26
|
+
if (type === 'pdf' && display === 'block') {
|
|
26
27
|
return (0, _jsxRuntime.jsx)(_ui.PdfFile, {
|
|
27
28
|
title: title,
|
|
28
29
|
url: url
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/article-converter",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.32",
|
|
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-embed": "^1.0.
|
|
30
|
+
"@ndla/types-embed": "^1.0.11"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@ndla/code": "^2.1.
|
|
34
|
-
"@ndla/ui": "^35.0.
|
|
33
|
+
"@ndla/code": "^2.1.39",
|
|
34
|
+
"@ndla/ui": "^35.0.26",
|
|
35
35
|
"html-react-parser": "^3.0.8",
|
|
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": "6f3dfa2bfca0ab9841849a6852bd680f23a3dcb0"
|
|
48
48
|
}
|
|
@@ -14,8 +14,8 @@ import { PluginType } from '../types';
|
|
|
14
14
|
export const fileEmbedPlugin: PluginType = (element) => {
|
|
15
15
|
const props = attributesToProps(element.attribs);
|
|
16
16
|
const data = JSON.parse(props['data-json']) as FileMetaData;
|
|
17
|
-
const { type, title, url } = data.embedData;
|
|
18
|
-
if (type === 'pdf') {
|
|
17
|
+
const { type, title, url, display } = data.embedData;
|
|
18
|
+
if (type === 'pdf' && display === 'block') {
|
|
19
19
|
return <PdfFile title={title} url={url} />;
|
|
20
20
|
} else {
|
|
21
21
|
return (
|