@ndla/ui 45.0.16 → 46.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/Article/Article.js +3 -3
- package/es/AudioPlayer/index.js +0 -2
- package/es/Embed/conceptComponents.js +15 -8
- package/es/Figure/Figure.js +11 -89
- package/es/Figure/index.js +1 -3
- package/es/Notion/index.js +1 -3
- package/es/all.css +1 -1
- package/es/index.js +3 -4
- package/es/locale/messages-en.js +7 -2
- package/es/locale/messages-nb.js +7 -2
- package/es/locale/messages-nn.js +7 -2
- package/es/locale/messages-se.js +7 -2
- package/es/locale/messages-sma.js +7 -2
- package/lib/Article/Article.js +3 -3
- package/lib/AudioPlayer/index.d.ts +0 -2
- package/lib/AudioPlayer/index.js +0 -7
- package/lib/Embed/conceptComponents.js +17 -10
- package/lib/Figure/Figure.d.ts +0 -38
- package/lib/Figure/Figure.js +20 -96
- package/lib/Figure/index.d.ts +1 -3
- package/lib/Figure/index.js +2 -17
- package/lib/Notion/index.d.ts +0 -4
- package/lib/Notion/index.js +0 -14
- package/lib/all.css +1 -1
- package/lib/index.d.ts +3 -5
- package/lib/index.js +1 -32
- package/lib/locale/messages-en.d.ts +5 -0
- package/lib/locale/messages-en.js +7 -2
- package/lib/locale/messages-nb.d.ts +5 -0
- package/lib/locale/messages-nb.js +7 -2
- package/lib/locale/messages-nn.d.ts +5 -0
- package/lib/locale/messages-nn.js +7 -2
- package/lib/locale/messages-se.d.ts +5 -0
- package/lib/locale/messages-se.js +7 -2
- package/lib/locale/messages-sma.d.ts +5 -0
- package/lib/locale/messages-sma.js +7 -2
- package/package.json +18 -22
- package/src/Article/Article.tsx +1 -1
- package/src/AudioPlayer/AudiPlayer.stories.tsx +88 -0
- package/src/AudioPlayer/index.ts +0 -2
- package/src/Embed/IframeEmbed.stories.tsx +15 -0
- package/src/Embed/ImageEmbed.stories.tsx +169 -2
- package/src/Embed/RelatedContentEmbed.stories.tsx +438 -0
- package/src/Embed/conceptComponents.tsx +13 -1
- package/src/Figure/Figure.tsx +1 -120
- package/src/Figure/index.ts +1 -3
- package/src/Notion/index.ts +0 -4
- package/src/index.ts +3 -13
- package/src/locale/messages-en.ts +7 -2
- package/src/locale/messages-nb.ts +7 -2
- package/src/locale/messages-nn.ts +7 -2
- package/src/locale/messages-se.ts +7 -2
- package/src/locale/messages-sma.ts +7 -2
- package/src/main.scss +0 -1
- package/es/Animation/Fade.js +0 -62
- package/es/Animation/index.js +0 -1
- package/es/AudioPlayer/initAudioPlayers.js +0 -60
- package/es/Dialog/Dialog.js +0 -70
- package/es/Dialog/index.js +0 -11
- package/es/Figure/FigureLicense.js +0 -72
- package/es/Figure/FigureLicenseDialog.js +0 -54
- package/es/Notion/ConceptNotion.js +0 -135
- package/es/Notion/FigureNotion.js +0 -93
- package/es/Notion/NotionVisualElement.js +0 -68
- package/es/utils/createUniversalPortal.js +0 -25
- package/lib/Animation/Fade.d.ts +0 -17
- package/lib/Animation/Fade.js +0 -70
- package/lib/Animation/index.d.ts +0 -1
- package/lib/Animation/index.js +0 -13
- package/lib/AudioPlayer/initAudioPlayers.d.ts +0 -11
- package/lib/AudioPlayer/initAudioPlayers.js +0 -69
- package/lib/Dialog/Dialog.d.ts +0 -23
- package/lib/Dialog/Dialog.js +0 -75
- package/lib/Dialog/index.d.ts +0 -10
- package/lib/Dialog/index.js +0 -22
- package/lib/Figure/FigureLicense.d.ts +0 -33
- package/lib/Figure/FigureLicense.js +0 -76
- package/lib/Figure/FigureLicenseDialog.d.ts +0 -29
- package/lib/Figure/FigureLicenseDialog.js +0 -57
- package/lib/Notion/ConceptNotion.d.ts +0 -24
- package/lib/Notion/ConceptNotion.js +0 -141
- package/lib/Notion/FigureNotion.d.ts +0 -27
- package/lib/Notion/FigureNotion.js +0 -97
- package/lib/Notion/NotionVisualElement.d.ts +0 -22
- package/lib/Notion/NotionVisualElement.js +0 -75
- package/lib/utils/createUniversalPortal.d.ts +0 -9
- package/lib/utils/createUniversalPortal.js +0 -32
- package/src/Animation/Fade.tsx +0 -46
- package/src/Animation/index.ts +0 -1
- package/src/AudioPlayer/initAudioPlayers.tsx +0 -57
- package/src/Dialog/Dialog.tsx +0 -80
- package/src/Dialog/component.dialog.scss +0 -144
- package/src/Dialog/index.ts +0 -13
- package/src/Figure/FigureLicense.tsx +0 -75
- package/src/Figure/FigureLicenseDialog.tsx +0 -51
- package/src/Notion/ConceptNotion.tsx +0 -170
- package/src/Notion/FigureNotion.tsx +0 -104
- package/src/Notion/NotionVisualElement.tsx +0 -80
- package/src/utils/createUniversalPortal.tsx +0 -23
package/lib/Dialog/Dialog.js
DELETED
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.Dialog = void 0;
|
|
8
|
-
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
9
|
-
var _createUniversalPortal = require("../utils/createUniversalPortal");
|
|
10
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
|
-
var _excluded = ["children", "messages", "id", "labelledby", "label", "modifier", "disablePortal", "hidden", "onClose"];
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) 2017-present, NDLA.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
// N.B These component is used to render static markup serverside
|
|
20
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
21
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
22
|
-
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; }
|
|
23
|
-
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; }
|
|
24
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
25
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
26
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
27
|
-
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
28
|
-
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
29
|
-
var classes = new _reactBemHelper.default({
|
|
30
|
-
name: 'dialog',
|
|
31
|
-
prefix: 'c-'
|
|
32
|
-
});
|
|
33
|
-
var Dialog = function Dialog(_ref) {
|
|
34
|
-
var children = _ref.children,
|
|
35
|
-
_ref$messages = _ref.messages,
|
|
36
|
-
messages = _ref$messages === void 0 ? {
|
|
37
|
-
close: 'Lukk'
|
|
38
|
-
} : _ref$messages,
|
|
39
|
-
id = _ref.id,
|
|
40
|
-
labelledby = _ref.labelledby,
|
|
41
|
-
label = _ref.label,
|
|
42
|
-
modifier = _ref.modifier,
|
|
43
|
-
_ref$disablePortal = _ref.disablePortal,
|
|
44
|
-
disablePortal = _ref$disablePortal === void 0 ? false : _ref$disablePortal,
|
|
45
|
-
_ref$hidden = _ref.hidden,
|
|
46
|
-
hidden = _ref$hidden === void 0 ? true : _ref$hidden,
|
|
47
|
-
onClose = _ref.onClose,
|
|
48
|
-
rest = _objectWithoutProperties(_ref, _excluded);
|
|
49
|
-
var content = (0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread(_objectSpread({}, classes('', modifier)), {}, {
|
|
50
|
-
"data-dialog-id": id,
|
|
51
|
-
role: "dialog",
|
|
52
|
-
"aria-hidden": hidden,
|
|
53
|
-
"aria-labelledby": labelledby,
|
|
54
|
-
"aria-label": label
|
|
55
|
-
}, rest), {}, {
|
|
56
|
-
children: [(0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, classes('content')), {}, {
|
|
57
|
-
children: [(0, _jsxRuntime.jsx)("button", _objectSpread(_objectSpread({}, classes('close')), {}, {
|
|
58
|
-
type: "button",
|
|
59
|
-
onClick: function onClick() {
|
|
60
|
-
if (onClose) {
|
|
61
|
-
onClose();
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
children: messages.close
|
|
65
|
-
})), children]
|
|
66
|
-
})), (0, _jsxRuntime.jsx)("div", {
|
|
67
|
-
className: "o-backdrop"
|
|
68
|
-
})]
|
|
69
|
-
}));
|
|
70
|
-
if (disablePortal) {
|
|
71
|
-
return content;
|
|
72
|
-
}
|
|
73
|
-
return (0, _createUniversalPortal.createUniversalPortal)(content, 'body');
|
|
74
|
-
};
|
|
75
|
-
exports.Dialog = Dialog;
|
package/lib/Dialog/index.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-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 { Dialog } from './Dialog';
|
|
9
|
-
export { Dialog };
|
|
10
|
-
export default Dialog;
|
package/lib/Dialog/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Dialog", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Dialog.Dialog;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports.default = void 0;
|
|
13
|
-
var _Dialog = require("./Dialog");
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) 2017-present, NDLA.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
var _default = _Dialog.Dialog;
|
|
22
|
-
exports.default = _default;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2018-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 { ReactNode } from 'react';
|
|
9
|
-
import BEMHelper from 'react-bem-helper';
|
|
10
|
-
import { FigureLicense } from './Figure';
|
|
11
|
-
import { Contributor } from '../types';
|
|
12
|
-
export declare const classLicenses: BEMHelper<BEMHelper.ReturnObject>;
|
|
13
|
-
interface FigureLicenseCtaProps {
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
origin?: string;
|
|
16
|
-
authors?: Contributor[];
|
|
17
|
-
messages: {
|
|
18
|
-
source: string;
|
|
19
|
-
title: string;
|
|
20
|
-
};
|
|
21
|
-
title?: string;
|
|
22
|
-
}
|
|
23
|
-
export declare const FigureLicenseCta: ({ children, messages, authors, origin, title }: FigureLicenseCtaProps) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
-
interface Props {
|
|
25
|
-
messages: {
|
|
26
|
-
modelPremission?: string;
|
|
27
|
-
learnAboutLicenses: string;
|
|
28
|
-
};
|
|
29
|
-
license: FigureLicense;
|
|
30
|
-
locale: string;
|
|
31
|
-
}
|
|
32
|
-
export declare const FigureLicenseByline: ({ messages, license, locale }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
33
|
-
export {};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.classLicenses = exports.FigureLicenseCta = exports.FigureLicenseByline = void 0;
|
|
7
|
-
var _reactBemHelper = _interopRequireDefault(require("react-bem-helper"));
|
|
8
|
-
var _util = require("@ndla/util");
|
|
9
|
-
var _notion = require("@ndla/notion");
|
|
10
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
13
|
-
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; }
|
|
14
|
-
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; }
|
|
15
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
17
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
18
|
-
* Copyright (c) 2018-present, NDLA.
|
|
19
|
-
*
|
|
20
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
21
|
-
* LICENSE file in the root directory of this source tree.
|
|
22
|
-
*
|
|
23
|
-
*/ // N.B This component is used to render static markup serverside
|
|
24
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
25
|
-
var classLicenses = new _reactBemHelper.default({
|
|
26
|
-
name: 'figure-license',
|
|
27
|
-
prefix: 'c-'
|
|
28
|
-
});
|
|
29
|
-
exports.classLicenses = classLicenses;
|
|
30
|
-
var FigureLicenseCta = function FigureLicenseCta(_ref) {
|
|
31
|
-
var children = _ref.children,
|
|
32
|
-
messages = _ref.messages,
|
|
33
|
-
authors = _ref.authors,
|
|
34
|
-
origin = _ref.origin,
|
|
35
|
-
title = _ref.title;
|
|
36
|
-
return (0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, classLicenses('cta-wrapper')), {}, {
|
|
37
|
-
children: [(0, _jsxRuntime.jsxs)("ul", _objectSpread(_objectSpread({}, classLicenses('list')), {}, {
|
|
38
|
-
children: [title && (0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, classLicenses('item')), {}, {
|
|
39
|
-
children: "".concat(messages.title, ": ").concat(title)
|
|
40
|
-
})), authors === null || authors === void 0 ? void 0 : authors.map(function (author) {
|
|
41
|
-
return (0, _jsxRuntime.jsx)("li", _objectSpread(_objectSpread({}, classLicenses('item')), {}, {
|
|
42
|
-
children: "".concat(author.type, ": ").concat(author.name)
|
|
43
|
-
}), (0, _util.uuid)());
|
|
44
|
-
}), origin && (0, _jsxRuntime.jsxs)("li", _objectSpread(_objectSpread({}, classLicenses('item')), {}, {
|
|
45
|
-
children: [messages.source, ":", ' ', origin.startsWith('http') ? (0, _jsxRuntime.jsx)("a", {
|
|
46
|
-
href: origin,
|
|
47
|
-
target: "_blank",
|
|
48
|
-
rel: "noopener noreferrer",
|
|
49
|
-
children: origin
|
|
50
|
-
}) : origin]
|
|
51
|
-
}))]
|
|
52
|
-
})), (0, _jsxRuntime.jsx)("div", _objectSpread(_objectSpread({}, classLicenses('cta-block')), {}, {
|
|
53
|
-
children: children
|
|
54
|
-
}))]
|
|
55
|
-
}));
|
|
56
|
-
};
|
|
57
|
-
exports.FigureLicenseCta = FigureLicenseCta;
|
|
58
|
-
var FigureLicenseByline = function FigureLicenseByline(_ref2) {
|
|
59
|
-
var messages = _ref2.messages,
|
|
60
|
-
license = _ref2.license,
|
|
61
|
-
locale = _ref2.locale;
|
|
62
|
-
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
63
|
-
children: [(0, _jsxRuntime.jsx)(_notion.LicenseDescription, {
|
|
64
|
-
highlightCC: true,
|
|
65
|
-
locale: locale,
|
|
66
|
-
messages: messages,
|
|
67
|
-
licenseRights: license.rights
|
|
68
|
-
}, "byline"), (0, _jsxRuntime.jsx)("a", _objectSpread(_objectSpread({}, classLicenses('link')), {}, {
|
|
69
|
-
target: "_blank",
|
|
70
|
-
rel: "noopener noreferrer",
|
|
71
|
-
href: license.url,
|
|
72
|
-
children: license.linkText
|
|
73
|
-
}), "link")]
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
exports.FigureLicenseByline = FigureLicenseByline;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2017-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 { ReactNode } from 'react';
|
|
9
|
-
import { FigureLicense } from './Figure';
|
|
10
|
-
import { Contributor } from '../types';
|
|
11
|
-
export declare const FigureLicenseDialog: ({ children, messages, id, authors, origin, title, locale, license }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
12
|
-
interface Props {
|
|
13
|
-
id: string;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
origin?: string;
|
|
16
|
-
authors?: Contributor[];
|
|
17
|
-
messages: {
|
|
18
|
-
modelPremission?: string;
|
|
19
|
-
close: string;
|
|
20
|
-
rulesForUse: string;
|
|
21
|
-
source: string;
|
|
22
|
-
learnAboutLicenses: string;
|
|
23
|
-
title: string;
|
|
24
|
-
};
|
|
25
|
-
title?: string;
|
|
26
|
-
license: FigureLicense;
|
|
27
|
-
locale: string;
|
|
28
|
-
}
|
|
29
|
-
export {};
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FigureLicenseDialog = void 0;
|
|
7
|
-
var _Dialog = _interopRequireDefault(require("../Dialog"));
|
|
8
|
-
var _FigureLicense = require("./FigureLicense");
|
|
9
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
12
|
-
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; }
|
|
13
|
-
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; }
|
|
14
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
15
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
16
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
17
|
-
* Copyright (c) 2017-present, NDLA.
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
20
|
-
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*
|
|
22
|
-
*/ // N.B This component is used to render static markup serverside
|
|
23
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
24
|
-
var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
|
|
25
|
-
var children = _ref.children,
|
|
26
|
-
messages = _ref.messages,
|
|
27
|
-
id = _ref.id,
|
|
28
|
-
authors = _ref.authors,
|
|
29
|
-
origin = _ref.origin,
|
|
30
|
-
title = _ref.title,
|
|
31
|
-
locale = _ref.locale,
|
|
32
|
-
license = _ref.license;
|
|
33
|
-
var headingLabelId = "heading-".concat(id);
|
|
34
|
-
return (0, _jsxRuntime.jsx)(_Dialog.default, {
|
|
35
|
-
id: id,
|
|
36
|
-
labelledby: headingLabelId,
|
|
37
|
-
messages: messages,
|
|
38
|
-
children: (0, _jsxRuntime.jsxs)("div", _objectSpread(_objectSpread({}, (0, _FigureLicense.classLicenses)()), {}, {
|
|
39
|
-
children: [(0, _jsxRuntime.jsx)("h1", _objectSpread(_objectSpread({
|
|
40
|
-
id: headingLabelId
|
|
41
|
-
}, (0, _FigureLicense.classLicenses)('title')), {}, {
|
|
42
|
-
children: messages.rulesForUse
|
|
43
|
-
})), (0, _jsxRuntime.jsx)(_FigureLicense.FigureLicenseByline, {
|
|
44
|
-
license: license,
|
|
45
|
-
messages: messages,
|
|
46
|
-
locale: locale
|
|
47
|
-
}), (0, _jsxRuntime.jsx)(_FigureLicense.FigureLicenseCta, {
|
|
48
|
-
authors: authors,
|
|
49
|
-
title: title,
|
|
50
|
-
origin: origin,
|
|
51
|
-
messages: messages,
|
|
52
|
-
children: children
|
|
53
|
-
})]
|
|
54
|
-
}))
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
exports.FigureLicenseDialog = FigureLicenseDialog;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { NotionVisualElementType } from './NotionVisualElement';
|
|
2
|
-
import { Copyright } from '../types';
|
|
3
|
-
import { FigureType } from '../Figure';
|
|
4
|
-
export interface ConceptNotionType {
|
|
5
|
-
id: number;
|
|
6
|
-
copyright?: Partial<Copyright>;
|
|
7
|
-
title: string;
|
|
8
|
-
text: string;
|
|
9
|
-
visualElement?: NotionVisualElementType;
|
|
10
|
-
source?: string;
|
|
11
|
-
image?: {
|
|
12
|
-
src: string;
|
|
13
|
-
alt: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
interface Props {
|
|
17
|
-
type?: 'image' | 'video' | 'h5p' | 'iframe' | 'external';
|
|
18
|
-
concept: ConceptNotionType;
|
|
19
|
-
disableScripts?: boolean;
|
|
20
|
-
hideIconsAndAuthors?: boolean;
|
|
21
|
-
figureType?: FigureType;
|
|
22
|
-
}
|
|
23
|
-
declare const ConceptNotion: ({ concept, disableScripts, type, hideIconsAndAuthors, figureType }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
24
|
-
export default ConceptNotion;
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
var _react = require("react");
|
|
10
|
-
var _articleScripts = require("@ndla/article-scripts");
|
|
11
|
-
var _reactI18next = require("react-i18next");
|
|
12
|
-
var _core = require("@ndla/core");
|
|
13
|
-
var _util = require("@ndla/util");
|
|
14
|
-
var _licenses = require("@ndla/licenses");
|
|
15
|
-
var _notion = _interopRequireWildcard(require("@ndla/notion"));
|
|
16
|
-
var _ = require(".");
|
|
17
|
-
var _NotionImage = require("./NotionImage");
|
|
18
|
-
var _NotionVisualElement = _interopRequireDefault(require("./NotionVisualElement"));
|
|
19
|
-
var _FigureNotion = _interopRequireDefault(require("./FigureNotion"));
|
|
20
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
21
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
22
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
23
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
24
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
25
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
26
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
27
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
28
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
29
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
|
|
30
|
-
* Copyright (c) 2022-present, NDLA.
|
|
31
|
-
*
|
|
32
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
33
|
-
* LICENSE file in the root directory of this source tree. *
|
|
34
|
-
*/ //@ts-ignore
|
|
35
|
-
var ImageWrapper = /*#__PURE__*/(0, _base.default)("div", {
|
|
36
|
-
target: "ebdyuo10",
|
|
37
|
-
label: "ImageWrapper"
|
|
38
|
-
})("float:right;padding-left:", _core.spacing.normal, ";position:relative;", _core.mq.range({
|
|
39
|
-
until: _core.breakpoints.tabletWide
|
|
40
|
-
}), "{width:100%;padding-left:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbmNlcHROb3Rpb24udHN4Il0sIm5hbWVzIj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gICByZXNpemVJZnJhbWVcbiAgICAgIGlkPXtmaWd1cmVJZH1cbiAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgZmlndXJlSWQ9e3Zpc3VhbEVsZW1lbnRJZH1cbiAgICAgIGNvcHlyaWdodD17Y29uY2VwdC5jb3B5cmlnaHR9XG4gICAgICBsaWNlbnNlU3RyaW5nPXtjb25jZXB0LmNvcHlyaWdodD8ubGljZW5zZT8ubGljZW5zZSA/PyAnJ31cbiAgICAgIHR5cGU9XCJjb25jZXB0XCJcbiAgICAgIGhpZGVJY29uc0FuZEF1dGhvcnM9e2hpZGVJY29uc0FuZEF1dGhvcnN9XG4gICAgICBmaWd1cmVUeXBlPXtmaWd1cmVUeXBlfVxuICAgID5cbiAgICAgIDxVSU5vdGlvblxuICAgICAgICBpZD17bm90aW9uSWR9XG4gICAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgICB0ZXh0PXtjb25jZXB0LnRleHR9XG4gICAgICAgIGltYWdlRWxlbWVudD17XG4gICAgICAgICAgY29uY2VwdC52aXN1YWxFbGVtZW50Py5yZXNvdXJjZSA9PT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQuaW1hZ2UgPyAoXG4gICAgICAgICAgICA8SW1hZ2VXcmFwcGVyPlxuICAgICAgICAgICAgICA8Tm90aW9uXG4gICAgICAgICAgICAgICAgaWQ9e25vdGlvbklkfVxuICAgICAgICAgICAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgICAgICAgICAgIHN1YlRpdGxlPXt0KCdzZWFyY2hQYWdlLnJlc3VsdFR5cGUubm90aW9uc0hlYWRpbmcnKX1cbiAgICAgICAgICAgICAgICBoaWRlQmFzZWxpbmVJY29uXG4gICAgICAgICAgICAgICAgY29udGVudD17XG4gICAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nQ29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICB7Y29uY2VwdC52aXN1YWxFbGVtZW50Py5yZXNvdXJjZSA9PT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQuaW1hZ2UgPyAoXG4gICAgICAgICAgICAgICAgICAgICAgICA8Tm90aW9uVmlzdWFsRWxlbWVudCB2aXN1YWxFbGVtZW50PXtjb25jZXB0LnZpc3VhbEVsZW1lbnR9IGlkPXtub3Rpb25JZH0gZmlndXJlSWQ9e2ZpZ3VyZUlkfSAvPlxuICAgICAgICAgICAgICAgICAgICAgICkgOiB1bmRlZmluZWR9XG4gICAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ1RleHQ+e3BhcnNlTWFya2Rvd24oY29uY2VwdC50ZXh0LCAnYm9keScpfTwvTm90aW9uRGlhbG9nVGV4dD5cbiAgICAgICAgICAgICAgICAgICAgPC9Ob3Rpb25EaWFsb2dDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nTGljZW5zZXNcbiAgICAgICAgICAgICAgICAgICAgICBhdXRob3JzPXthdXRob3JzfVxuICAgICAgICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2NvbmNlcHQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZT17Y29uY2VwdC5zb3VyY2V9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7Y29uY2VwdC52aXN1YWxFbGVtZW50LmltYWdlICYmIChcbiAgICAgICAgICAgICAgICAgIDxOb3Rpb25JbWFnZVxuICAgICAgICAgICAgICAgICAgICB0eXBlPXt0eXBlfVxuICAgICAgICAgICAgICAgICAgICBpZD17dmlzdWFsRWxlbWVudElkfVxuICAgICAgICAgICAgICAgICAgICBzcmM9e2NvbmNlcHQudmlzdWFsRWxlbWVudC5pbWFnZS5zcmN9XG4gICAgICAgICAgICAgICAgICAgIGFsdD17Y29uY2VwdC52aXN1YWxFbGVtZW50LmltYWdlLmFsdCA/PyAnJ31cbiAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgPC9Ob3Rpb24+XG4gICAgICAgICAgICA8L0ltYWdlV3JhcHBlcj5cbiAgICAgICAgICApIDogdW5kZWZpbmVkXG4gICAgICAgIH1cbiAgICAgICAgdmlzdWFsRWxlbWVudD17XG4gICAgICAgICAgY29uY2VwdC52aXN1YWxFbGVtZW50ICYmIGNvbmNlcHQudmlzdWFsRWxlbWVudC5yZXNvdXJjZSAhPT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQudXJsID8gKFxuICAgICAgICAgICAgPEltYWdlV3JhcHBlcj5cbiAgICAgICAgICAgICAgPE5vdGlvblxuICAgICAgICAgICAgICAgIGlkPXtub3Rpb25JZH1cbiAgICAgICAgICAgICAgICB0aXRsZT17Y29uY2VwdC50aXRsZX1cbiAgICAgICAgICAgICAgICBoaWRlQmFzZWxpbmVJY29uXG4gICAgICAgICAgICAgICAgc3ViVGl0bGU9e3QoJ3NlYXJjaFBhZ2UucmVzdWx0VHlwZS5ub3Rpb25zSGVhZGluZycpfVxuICAgICAgICAgICAgICAgIGNvbnRlbnQ9e1xuICAgICAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ0NvbnRlbnQ+XG4gICAgICAgICAgICAgICAgICAgICAge2NvbmNlcHQudmlzdWFsRWxlbWVudCAmJlxuICAgICAgICAgICAgICAgICAgICAgIGNvbmNlcHQudmlzdWFsRWxlbWVudD8ucmVzb3VyY2UgIT09ICdpbWFnZScgJiZcbiAgICAgICAgICAgICAgICAgICAgICBjb25jZXB0LnZpc3VhbEVsZW1lbnQudXJsID8gKFxuICAgICAgICAgICAgICAgICAgICAgICAgPE5vdGlvblZpc3VhbEVsZW1lbnQgdmlzdWFsRWxlbWVudD17Y29uY2VwdC52aXN1YWxFbGVtZW50fSBpZD17bm90aW9uSWR9IGZpZ3VyZUlkPXtmaWd1cmVJZH0gLz5cbiAgICAgICAgICAgICAgICAgICAgICApIDogdW5kZWZpbmVkfVxuXG4gICAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ1RleHQ+e3BhcnNlTWFya2Rvd24oY29uY2VwdC50ZXh0LCAnYm9keScpfTwvTm90aW9uRGlhbG9nVGV4dD5cbiAgICAgICAgICAgICAgICAgICAgPC9Ob3Rpb25EaWFsb2dDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nTGljZW5zZXNcbiAgICAgICAgICAgICAgICAgICAgICBhdXRob3JzPXthdXRob3JzfVxuICAgICAgICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2NvbmNlcHQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZT17Y29uY2VwdC5zb3VyY2V9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7Y29uY2VwdC5pbWFnZSAmJiAoXG4gICAgICAgICAgICAgICAgICA8Tm90aW9uSW1hZ2VcbiAgICAgICAgICAgICAgICAgICAgdHlwZT17dHlwZX1cbiAgICAgICAgICAgICAgICAgICAgaWQ9e3Zpc3VhbEVsZW1lbnRJZH1cbiAgICAgICAgICAgICAgICAgICAgc3JjPXtjb25jZXB0LmltYWdlPy5zcmN9XG4gICAgICAgICAgICAgICAgICAgIGFsdD17Y29uY2VwdC5pbWFnZT8uYWx0ID8/ICcnfVxuICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICA8L05vdGlvbj5cbiAgICAgICAgICAgIDwvSW1hZ2VXcmFwcGVyPlxuICAgICAgICAgICkgOiB1bmRlZmluZWRcbiAgICAgICAgfVxuICAgICAgPjwvVUlOb3Rpb24+XG4gICAgPC9GaWd1cmVOb3Rpb24+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb25jZXB0Tm90aW9uO1xuIl19 */"));
|
|
41
|
-
var ConceptNotion = function ConceptNotion(_ref) {
|
|
42
|
-
var _concept$copyright$li, _concept$copyright, _concept$copyright$li2, _concept$visualElemen, _concept$visualElemen2, _concept$copyright$li3, _concept$copyright2, _concept$copyright2$l, _concept$visualElemen3, _concept$visualElemen4, _concept$copyright$li4, _concept$copyright3, _concept$copyright3$l, _concept$image, _concept$image$alt, _concept$image2;
|
|
43
|
-
var concept = _ref.concept,
|
|
44
|
-
disableScripts = _ref.disableScripts,
|
|
45
|
-
type = _ref.type,
|
|
46
|
-
hideIconsAndAuthors = _ref.hideIconsAndAuthors,
|
|
47
|
-
figureType = _ref.figureType;
|
|
48
|
-
var notionId = "notion-".concat(concept.id);
|
|
49
|
-
var figureId = "notion-figure-".concat(concept.id);
|
|
50
|
-
var visualElementId = "visual-element-".concat(concept.id);
|
|
51
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
52
|
-
t = _useTranslation.t;
|
|
53
|
-
var _getLicenseCredits = (0, _licenses.getLicenseCredits)(concept.copyright),
|
|
54
|
-
creators = _getLicenseCredits.creators,
|
|
55
|
-
rightsholders = _getLicenseCredits.rightsholders,
|
|
56
|
-
processors = _getLicenseCredits.processors;
|
|
57
|
-
var authors = (creators.length || rightsholders.length ? [].concat(_toConsumableArray(creators), _toConsumableArray(rightsholders)) : _toConsumableArray(processors)).map(function (author) {
|
|
58
|
-
return author.name;
|
|
59
|
-
});
|
|
60
|
-
(0, _react.useEffect)(function () {
|
|
61
|
-
if (!disableScripts) {
|
|
62
|
-
(0, _articleScripts.initArticleScripts)();
|
|
63
|
-
}
|
|
64
|
-
}, [disableScripts]);
|
|
65
|
-
return (0, _jsxRuntime.jsx)(_FigureNotion.default, {
|
|
66
|
-
resizeIframe: true,
|
|
67
|
-
id: figureId,
|
|
68
|
-
title: concept.title,
|
|
69
|
-
figureId: visualElementId,
|
|
70
|
-
copyright: concept.copyright,
|
|
71
|
-
licenseString: (_concept$copyright$li = (_concept$copyright = concept.copyright) === null || _concept$copyright === void 0 ? void 0 : (_concept$copyright$li2 = _concept$copyright.license) === null || _concept$copyright$li2 === void 0 ? void 0 : _concept$copyright$li2.license) !== null && _concept$copyright$li !== void 0 ? _concept$copyright$li : '',
|
|
72
|
-
type: "concept",
|
|
73
|
-
hideIconsAndAuthors: hideIconsAndAuthors,
|
|
74
|
-
figureType: figureType,
|
|
75
|
-
children: (0, _jsxRuntime.jsx)(_.Notion, {
|
|
76
|
-
id: notionId,
|
|
77
|
-
title: concept.title,
|
|
78
|
-
text: concept.text,
|
|
79
|
-
imageElement: ((_concept$visualElemen = concept.visualElement) === null || _concept$visualElemen === void 0 ? void 0 : _concept$visualElemen.resource) === 'image' && concept.visualElement.image ? (0, _jsxRuntime.jsx)(ImageWrapper, {
|
|
80
|
-
children: (0, _jsxRuntime.jsx)(_notion.default, {
|
|
81
|
-
id: notionId,
|
|
82
|
-
title: concept.title,
|
|
83
|
-
subTitle: t('searchPage.resultType.notionsHeading'),
|
|
84
|
-
hideBaselineIcon: true,
|
|
85
|
-
content: (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
86
|
-
children: [(0, _jsxRuntime.jsxs)(_notion.NotionDialogContent, {
|
|
87
|
-
children: [((_concept$visualElemen2 = concept.visualElement) === null || _concept$visualElemen2 === void 0 ? void 0 : _concept$visualElemen2.resource) === 'image' && concept.visualElement.image ? (0, _jsxRuntime.jsx)(_NotionVisualElement.default, {
|
|
88
|
-
visualElement: concept.visualElement,
|
|
89
|
-
id: notionId,
|
|
90
|
-
figureId: figureId
|
|
91
|
-
}) : undefined, (0, _jsxRuntime.jsx)(_notion.NotionDialogText, {
|
|
92
|
-
children: (0, _util.parseMarkdown)(concept.text, 'body')
|
|
93
|
-
})]
|
|
94
|
-
}), (0, _jsxRuntime.jsx)(_notion.NotionDialogLicenses, {
|
|
95
|
-
authors: authors,
|
|
96
|
-
license: (_concept$copyright$li3 = (_concept$copyright2 = concept.copyright) === null || _concept$copyright2 === void 0 ? void 0 : (_concept$copyright2$l = _concept$copyright2.license) === null || _concept$copyright2$l === void 0 ? void 0 : _concept$copyright2$l.license) !== null && _concept$copyright$li3 !== void 0 ? _concept$copyright$li3 : '',
|
|
97
|
-
source: concept.source
|
|
98
|
-
})]
|
|
99
|
-
}),
|
|
100
|
-
children: concept.visualElement.image && (0, _jsxRuntime.jsx)(_NotionImage.NotionImage, {
|
|
101
|
-
type: type,
|
|
102
|
-
id: visualElementId,
|
|
103
|
-
src: concept.visualElement.image.src,
|
|
104
|
-
alt: (_concept$visualElemen3 = concept.visualElement.image.alt) !== null && _concept$visualElemen3 !== void 0 ? _concept$visualElemen3 : ''
|
|
105
|
-
})
|
|
106
|
-
})
|
|
107
|
-
}) : undefined,
|
|
108
|
-
visualElement: concept.visualElement && concept.visualElement.resource !== 'image' && concept.visualElement.url ? (0, _jsxRuntime.jsx)(ImageWrapper, {
|
|
109
|
-
children: (0, _jsxRuntime.jsx)(_notion.default, {
|
|
110
|
-
id: notionId,
|
|
111
|
-
title: concept.title,
|
|
112
|
-
hideBaselineIcon: true,
|
|
113
|
-
subTitle: t('searchPage.resultType.notionsHeading'),
|
|
114
|
-
content: (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
115
|
-
children: [(0, _jsxRuntime.jsxs)(_notion.NotionDialogContent, {
|
|
116
|
-
children: [concept.visualElement && ((_concept$visualElemen4 = concept.visualElement) === null || _concept$visualElemen4 === void 0 ? void 0 : _concept$visualElemen4.resource) !== 'image' && concept.visualElement.url ? (0, _jsxRuntime.jsx)(_NotionVisualElement.default, {
|
|
117
|
-
visualElement: concept.visualElement,
|
|
118
|
-
id: notionId,
|
|
119
|
-
figureId: figureId
|
|
120
|
-
}) : undefined, (0, _jsxRuntime.jsx)(_notion.NotionDialogText, {
|
|
121
|
-
children: (0, _util.parseMarkdown)(concept.text, 'body')
|
|
122
|
-
})]
|
|
123
|
-
}), (0, _jsxRuntime.jsx)(_notion.NotionDialogLicenses, {
|
|
124
|
-
authors: authors,
|
|
125
|
-
license: (_concept$copyright$li4 = (_concept$copyright3 = concept.copyright) === null || _concept$copyright3 === void 0 ? void 0 : (_concept$copyright3$l = _concept$copyright3.license) === null || _concept$copyright3$l === void 0 ? void 0 : _concept$copyright3$l.license) !== null && _concept$copyright$li4 !== void 0 ? _concept$copyright$li4 : '',
|
|
126
|
-
source: concept.source
|
|
127
|
-
})]
|
|
128
|
-
}),
|
|
129
|
-
children: concept.image && (0, _jsxRuntime.jsx)(_NotionImage.NotionImage, {
|
|
130
|
-
type: type,
|
|
131
|
-
id: visualElementId,
|
|
132
|
-
src: (_concept$image = concept.image) === null || _concept$image === void 0 ? void 0 : _concept$image.src,
|
|
133
|
-
alt: (_concept$image$alt = (_concept$image2 = concept.image) === null || _concept$image2 === void 0 ? void 0 : _concept$image2.alt) !== null && _concept$image$alt !== void 0 ? _concept$image$alt : ''
|
|
134
|
-
})
|
|
135
|
-
})
|
|
136
|
-
}) : undefined
|
|
137
|
-
})
|
|
138
|
-
});
|
|
139
|
-
};
|
|
140
|
-
var _default = ConceptNotion;
|
|
141
|
-
exports.default = _default;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2022-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
|
-
import { ReactNode } from 'react';
|
|
8
|
-
import { FigureType } from '../Figure';
|
|
9
|
-
import { Copyright } from '../types';
|
|
10
|
-
interface Props {
|
|
11
|
-
resizeIframe?: boolean;
|
|
12
|
-
figureId: string;
|
|
13
|
-
children: ReactNode | ((params: {
|
|
14
|
-
typeClass: string;
|
|
15
|
-
}) => ReactNode);
|
|
16
|
-
id: string;
|
|
17
|
-
title: string;
|
|
18
|
-
copyright?: Partial<Copyright>;
|
|
19
|
-
licenseString: string;
|
|
20
|
-
type: 'video' | 'h5p' | 'image' | 'concept' | 'other';
|
|
21
|
-
hideFigCaption?: boolean;
|
|
22
|
-
hideIconsAndAuthors?: boolean;
|
|
23
|
-
figureType?: FigureType;
|
|
24
|
-
licenseButtons?: ReactNode;
|
|
25
|
-
}
|
|
26
|
-
declare const FigureNotion: ({ resizeIframe, figureId, children, id, copyright, licenseString, title, type, hideFigCaption, hideIconsAndAuthors, figureType, licenseButtons, }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
27
|
-
export default FigureNotion;
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
|
-
var _core = require("@ndla/core");
|
|
9
|
-
var _licenses = require("@ndla/licenses");
|
|
10
|
-
var _reactI18next = require("react-i18next");
|
|
11
|
-
var _Figure = require("../Figure");
|
|
12
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
15
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
17
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
18
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
19
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } /**
|
|
20
|
-
* Copyright (c) 2022-present, NDLA.
|
|
21
|
-
*
|
|
22
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
23
|
-
* LICENSE file in the root directory of this source tree. *
|
|
24
|
-
*/
|
|
25
|
-
var BottomBorder = /*#__PURE__*/(0, _base.default)("div", {
|
|
26
|
-
target: "e16vwpby0",
|
|
27
|
-
label: "BottomBorder"
|
|
28
|
-
})("margin-top:", _core.spacing.normal, ";border-bottom:1px solid ", _core.colors.brand.greyLight, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZ3VyZU5vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZStCIiwiZmlsZSI6IkZpZ3VyZU5vdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJv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ICAgICAgICAgICAgYXV0aG9ycz17Z3JvdXBlZEF1dGhvcnN9XG4gICAgICAgICAgICAgICAgbG9jYWxlPXtpMThuLmxhbmd1YWdlfVxuICAgICAgICAgICAgICAgIHRpdGxlPXt0aXRsZX1cbiAgICAgICAgICAgICAgICBvcmlnaW49e2NvcHlyaWdodD8ub3JpZ2lufVxuICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2xpY2Vuc2V9XG4gICAgICAgICAgICAgICAgbWVzc2FnZXM9e3tcbiAgICAgICAgICAgICAgICAgIGNsb3NlOiB0KCdjbG9zZScpLFxuICAgICAgICAgICAgICAgICAgcnVsZXNGb3JVc2U6IHQoYGxpY2Vuc2UuJHt0eXBlfS5ydWxlc2ApLFxuICAgICAgICAgICAgICAgICAgc291cmNlOiB0KCdzb3VyY2UnKSxcbiAgICAgICAgICAgICAgICAgIGxlYXJuQWJvdXRMaWNlbnNlczogdCgnbGljZW5zZS5sZWFybk1vcmUnKSxcbiAgICAgICAgICAgICAgICAgIHRpdGxlOiB0KCd0aXRsZScpLFxuICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7bGljZW5zZUJ1dHRvbnN9XG4gICAgICAgICAgICAgIDwvRmlndXJlTGljZW5zZURpYWxvZz5cbiAgICAgICAgICAgIDwvRmlndXJlQ2FwdGlvbj5cbiAgICAgICAgICApIDogKFxuICAgICAgICAgICAgPEJvdHRvbUJvcmRlciAvPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvPlxuICAgICAgKX1cbiAgICA8L0ZpZ3VyZT5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpZ3VyZU5vdGlvbjtcbiJdfQ== */"));
|
|
29
|
-
var FigureNotion = function FigureNotion(_ref) {
|
|
30
|
-
var resizeIframe = _ref.resizeIframe,
|
|
31
|
-
figureId = _ref.figureId,
|
|
32
|
-
_children = _ref.children,
|
|
33
|
-
id = _ref.id,
|
|
34
|
-
copyright = _ref.copyright,
|
|
35
|
-
licenseString = _ref.licenseString,
|
|
36
|
-
title = _ref.title,
|
|
37
|
-
type = _ref.type,
|
|
38
|
-
hideFigCaption = _ref.hideFigCaption,
|
|
39
|
-
hideIconsAndAuthors = _ref.hideIconsAndAuthors,
|
|
40
|
-
figureType = _ref.figureType,
|
|
41
|
-
licenseButtons = _ref.licenseButtons;
|
|
42
|
-
var _useTranslation = (0, _reactI18next.useTranslation)(),
|
|
43
|
-
t = _useTranslation.t,
|
|
44
|
-
i18n = _useTranslation.i18n;
|
|
45
|
-
var license = (0, _licenses.getLicenseByAbbreviation)(licenseString, i18n.language);
|
|
46
|
-
var licenseCredits = (0, _licenses.getLicenseCredits)(copyright);
|
|
47
|
-
var creators = licenseCredits.creators,
|
|
48
|
-
rightsholders = licenseCredits.rightsholders,
|
|
49
|
-
processors = licenseCredits.processors;
|
|
50
|
-
var authors = creators.length || rightsholders.length ? [].concat(_toConsumableArray(creators), _toConsumableArray(rightsholders)) : _toConsumableArray(processors);
|
|
51
|
-
var groupedAuthors = (0, _licenses.getGroupedContributorDescriptionList)(licenseCredits, i18n.language).map(function (item) {
|
|
52
|
-
return {
|
|
53
|
-
name: item.description,
|
|
54
|
-
type: item.label
|
|
55
|
-
};
|
|
56
|
-
});
|
|
57
|
-
return (0, _jsxRuntime.jsx)(_Figure.Figure, {
|
|
58
|
-
resizeIframe: resizeIframe,
|
|
59
|
-
id: figureId,
|
|
60
|
-
type: figureType || 'full-column',
|
|
61
|
-
children: function children(_ref2) {
|
|
62
|
-
var _copyright$license;
|
|
63
|
-
var typeClass = _ref2.typeClass;
|
|
64
|
-
return (0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
65
|
-
children: [typeof _children === 'function' ? _children({
|
|
66
|
-
typeClass: typeClass
|
|
67
|
-
}) : _children, copyright !== null && copyright !== void 0 && (_copyright$license = copyright.license) !== null && _copyright$license !== void 0 && _copyright$license.license ? (0, _jsxRuntime.jsx)(_Figure.FigureCaption, {
|
|
68
|
-
hideFigcaption: hideFigCaption,
|
|
69
|
-
figureId: figureId,
|
|
70
|
-
id: id,
|
|
71
|
-
reuseLabel: t("".concat(type, ".reuse")),
|
|
72
|
-
authors: authors,
|
|
73
|
-
licenseRights: license.rights,
|
|
74
|
-
hideIconsAndAuthors: hideIconsAndAuthors,
|
|
75
|
-
children: (0, _jsxRuntime.jsx)(_Figure.FigureLicenseDialog, {
|
|
76
|
-
id: id,
|
|
77
|
-
authors: groupedAuthors,
|
|
78
|
-
locale: i18n.language,
|
|
79
|
-
title: title,
|
|
80
|
-
origin: copyright === null || copyright === void 0 ? void 0 : copyright.origin,
|
|
81
|
-
license: license,
|
|
82
|
-
messages: {
|
|
83
|
-
close: t('close'),
|
|
84
|
-
rulesForUse: t("license.".concat(type, ".rules")),
|
|
85
|
-
source: t('source'),
|
|
86
|
-
learnAboutLicenses: t('license.learnMore'),
|
|
87
|
-
title: t('title')
|
|
88
|
-
},
|
|
89
|
-
children: licenseButtons
|
|
90
|
-
})
|
|
91
|
-
}) : (0, _jsxRuntime.jsx)(BottomBorder, {})]
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
|
-
});
|
|
95
|
-
};
|
|
96
|
-
var _default = FigureNotion;
|
|
97
|
-
exports.default = _default;
|