@ndla/ui 6.1.3 → 6.2.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.
|
@@ -16,13 +16,16 @@ import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
|
16
16
|
var ConceptNotion = function ConceptNotion(_ref) {
|
|
17
17
|
var _concept$copyright$li, _concept$copyright, _concept$copyright$li2, _concept$subjectNames, _concept$visualElemen, _concept$visualElemen2;
|
|
18
18
|
|
|
19
|
-
var concept = _ref.concept
|
|
19
|
+
var concept = _ref.concept,
|
|
20
|
+
disableScripts = _ref.disableScripts;
|
|
20
21
|
var notionId = "notion-".concat(concept.id);
|
|
21
22
|
var figureId = "notion-figure-".concat(concept.id);
|
|
22
23
|
var visualElementId = "visual-element-".concat(concept.id);
|
|
23
24
|
useEffect(function () {
|
|
24
|
-
|
|
25
|
-
|
|
25
|
+
if (!disableScripts) {
|
|
26
|
+
initArticleScripts();
|
|
27
|
+
}
|
|
28
|
+
}, [disableScripts]);
|
|
26
29
|
return ___EmotionJSX(FigureNotion, {
|
|
27
30
|
id: figureId,
|
|
28
31
|
figureId: visualElementId,
|
|
@@ -20,6 +20,7 @@ export interface ConceptNotionType {
|
|
|
20
20
|
}
|
|
21
21
|
interface Props {
|
|
22
22
|
concept: ConceptNotionType;
|
|
23
|
+
disableScripts?: boolean;
|
|
23
24
|
}
|
|
24
|
-
declare const ConceptNotion: ({ concept }: Props) => JSX.Element;
|
|
25
|
+
declare const ConceptNotion: ({ concept, disableScripts }: Props) => JSX.Element;
|
|
25
26
|
export default ConceptNotion;
|
|
@@ -37,13 +37,16 @@ function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj;
|
|
|
37
37
|
var ConceptNotion = function ConceptNotion(_ref) {
|
|
38
38
|
var _concept$copyright$li, _concept$copyright, _concept$copyright$li2, _concept$subjectNames, _concept$visualElemen, _concept$visualElemen2;
|
|
39
39
|
|
|
40
|
-
var concept = _ref.concept
|
|
40
|
+
var concept = _ref.concept,
|
|
41
|
+
disableScripts = _ref.disableScripts;
|
|
41
42
|
var notionId = "notion-".concat(concept.id);
|
|
42
43
|
var figureId = "notion-figure-".concat(concept.id);
|
|
43
44
|
var visualElementId = "visual-element-".concat(concept.id);
|
|
44
45
|
(0, _react.useEffect)(function () {
|
|
45
|
-
|
|
46
|
-
|
|
46
|
+
if (!disableScripts) {
|
|
47
|
+
(0, _articleScripts.initArticleScripts)();
|
|
48
|
+
}
|
|
49
|
+
}, [disableScripts]);
|
|
47
50
|
return (0, _core.jsx)(_FigureNotion["default"], {
|
|
48
51
|
id: figureId,
|
|
49
52
|
figureId: visualElementId,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -81,5 +81,5 @@
|
|
|
81
81
|
"publishConfig": {
|
|
82
82
|
"access": "public"
|
|
83
83
|
},
|
|
84
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "69b0ff1d72d2650ffbe42383bc7416d14d774d91"
|
|
85
85
|
}
|
|
@@ -28,16 +28,19 @@ export interface ConceptNotionType {
|
|
|
28
28
|
}
|
|
29
29
|
interface Props {
|
|
30
30
|
concept: ConceptNotionType;
|
|
31
|
+
disableScripts?: boolean;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
const ConceptNotion = ({ concept }: Props) => {
|
|
34
|
+
const ConceptNotion = ({ concept, disableScripts }: Props) => {
|
|
34
35
|
const notionId = `notion-${concept.id}`;
|
|
35
36
|
const figureId = `notion-figure-${concept.id}`;
|
|
36
37
|
const visualElementId = `visual-element-${concept.id}`;
|
|
37
38
|
|
|
38
39
|
useEffect(() => {
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
if (!disableScripts) {
|
|
41
|
+
initArticleScripts();
|
|
42
|
+
}
|
|
43
|
+
}, [disableScripts]);
|
|
41
44
|
return (
|
|
42
45
|
<FigureNotion
|
|
43
46
|
id={figureId}
|