@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
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
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); }
|
|
2
|
-
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; }
|
|
3
|
-
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; }
|
|
4
|
-
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; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
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); }
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2017-present, NDLA.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
// N.B This component is used to render static markup serverside
|
|
16
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
17
|
-
|
|
18
|
-
import Dialog from '../Dialog';
|
|
19
|
-
import { classLicenses, FigureLicenseByline, FigureLicenseCta } from './FigureLicense';
|
|
20
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
22
|
-
export var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
|
|
23
|
-
var children = _ref.children,
|
|
24
|
-
messages = _ref.messages,
|
|
25
|
-
id = _ref.id,
|
|
26
|
-
authors = _ref.authors,
|
|
27
|
-
origin = _ref.origin,
|
|
28
|
-
title = _ref.title,
|
|
29
|
-
locale = _ref.locale,
|
|
30
|
-
license = _ref.license;
|
|
31
|
-
var headingLabelId = "heading-".concat(id);
|
|
32
|
-
return _jsx(Dialog, {
|
|
33
|
-
id: id,
|
|
34
|
-
labelledby: headingLabelId,
|
|
35
|
-
messages: messages,
|
|
36
|
-
children: _jsxs("div", _objectSpread(_objectSpread({}, classLicenses()), {}, {
|
|
37
|
-
children: [_jsx("h1", _objectSpread(_objectSpread({
|
|
38
|
-
id: headingLabelId
|
|
39
|
-
}, classLicenses('title')), {}, {
|
|
40
|
-
children: messages.rulesForUse
|
|
41
|
-
})), _jsx(FigureLicenseByline, {
|
|
42
|
-
license: license,
|
|
43
|
-
messages: messages,
|
|
44
|
-
locale: locale
|
|
45
|
-
}), _jsx(FigureLicenseCta, {
|
|
46
|
-
authors: authors,
|
|
47
|
-
title: title,
|
|
48
|
-
origin: origin,
|
|
49
|
-
messages: messages,
|
|
50
|
-
children: children
|
|
51
|
-
})]
|
|
52
|
-
}))
|
|
53
|
-
});
|
|
54
|
-
};
|
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
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."); }
|
|
4
|
-
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); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
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; }
|
|
8
|
-
/**
|
|
9
|
-
* Copyright (c) 2022-present, NDLA.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree. *
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { useEffect } from 'react';
|
|
16
|
-
//@ts-ignore
|
|
17
|
-
import { initArticleScripts } from '@ndla/article-scripts';
|
|
18
|
-
import { useTranslation } from 'react-i18next';
|
|
19
|
-
import { breakpoints, mq, spacing } from '@ndla/core';
|
|
20
|
-
import { parseMarkdown } from '@ndla/util';
|
|
21
|
-
import { getLicenseCredits } from '@ndla/licenses';
|
|
22
|
-
import Notion, { NotionDialogContent, NotionDialogText, NotionDialogLicenses } from '@ndla/notion';
|
|
23
|
-
import { Notion as UINotion } from '.';
|
|
24
|
-
import { NotionImage } from './NotionImage';
|
|
25
|
-
import NotionVisualElement from './NotionVisualElement';
|
|
26
|
-
import FigureNotion from './FigureNotion';
|
|
27
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
28
|
-
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
29
|
-
import { Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
30
|
-
var ImageWrapper = /*#__PURE__*/_styled("div", {
|
|
31
|
-
target: "ebdyuo10",
|
|
32
|
-
label: "ImageWrapper"
|
|
33
|
-
})("float:right;padding-left:", spacing.normal, ";position:relative;", mq.range({
|
|
34
|
-
until: breakpoints.tabletWide
|
|
35
|
-
}), "{width:100%;padding-left:0;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvbmNlcHROb3Rpb24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCK0IiLCJmaWxlIjoiQ29uY2VwdE5vdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFI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AnJ31cbiAgICAgIHR5cGU9XCJjb25jZXB0XCJcbiAgICAgIGhpZGVJY29uc0FuZEF1dGhvcnM9e2hpZGVJY29uc0FuZEF1dGhvcnN9XG4gICAgICBmaWd1cmVUeXBlPXtmaWd1cmVUeXBlfVxuICAgID5cbiAgICAgIDxVSU5vdGlvblxuICAgICAgICBpZD17bm90aW9uSWR9XG4gICAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgICB0ZXh0PXtjb25jZXB0LnRleHR9XG4gICAgICAgIGltYWdlRWxlbWVudD17XG4gICAgICAgICAgY29uY2VwdC52aXN1YWxFbGVtZW50Py5yZXNvdXJjZSA9PT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQuaW1hZ2UgPyAoXG4gICAgICAgICAgICA8SW1hZ2VXcmFwcGVyPlxuICAgICAgICAgICAgICA8Tm90aW9uXG4gICAgICAgICAgICAgICAgaWQ9e25vdGlvbklkfVxuICAgICAgICAgICAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgICAgICAgICAgIHN1YlRpdGxlPXt0KCdzZWFyY2hQYWdlLnJlc3VsdFR5cGUubm90aW9uc0hlYWRpbmcnKX1cbiAgICAgICAgICAgICAgICBoaWRlQmFzZWxpbmVJY29uXG4gICAgICAgICAgICAgICAgY29udGVudD17XG4gICAgICAgICAgICAgICAgICA8PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nQ29udGVudD5cbiAgICAgICAgICAgICAgICAgICAgICB7Y29uY2VwdC52aXN1YWxFbGVtZW50Py5yZXNvdXJjZSA9PT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQuaW1hZ2UgPyAoXG4gICAgICAgICAgICAgICAgICAgICAgICA8Tm90aW9uVmlzdWFsRWxlbWVudCB2aXN1YWxFbGVtZW50PXtjb25jZXB0LnZpc3VhbEVsZW1lbnR9IGlkPXtub3Rpb25JZH0gZmlndXJlSWQ9e2ZpZ3VyZUlkfSAvPlxuICAgICAgICAgICAgICAgICAgICAgICkgOiB1bmRlZmluZWR9XG4gICAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ1RleHQ+e3BhcnNlTWFya2Rvd24oY29uY2VwdC50ZXh0LCAnYm9keScpfTwvTm90aW9uRGlhbG9nVGV4dD5cbiAgICAgICAgICAgICAgICAgICAgPC9Ob3Rpb25EaWFsb2dDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nTGljZW5zZXNcbiAgICAgICAgICAgICAgICAgICAgICBhdXRob3JzPXthdXRob3JzfVxuICAgICAgICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2NvbmNlcHQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZT17Y29uY2VwdC5zb3VyY2V9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7Y29uY2VwdC52aXN1YWxFbGVtZW50LmltYWdlICYmIChcbiAgICAgICAgICAgICAgICAgIDxOb3Rpb25JbWFnZVxuICAgICAgICAgICAgICAgICAgICB0eXBlPXt0eXBlfVxuICAgICAgICAgICAgICAgICAgICBpZD17dmlzdWFsRWxlbWVudElkfVxuICAgICAgICAgICAgICAgICAgICBzcmM9e2NvbmNlcHQudmlzdWFsRWxlbWVudC5pbWFnZS5zcmN9XG4gICAgICAgICAgICAgICAgICAgIGFsdD17Y29uY2VwdC52aXN1YWxFbGVtZW50LmltYWdlLmFsdCA/PyAnJ31cbiAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgKX1cbiAgICAgICAgICAgICAgPC9Ob3Rpb24+XG4gICAgICAgICAgICA8L0ltYWdlV3JhcHBlcj5cbiAgICAgICAgICApIDogdW5kZWZpbmVkXG4gICAgICAgIH1cbiAgICAgICAgdmlzdWFsRWxlbWVudD17XG4gICAgICAgICAgY29uY2VwdC52aXN1YWxFbGVtZW50ICYmIGNvbmNlcHQudmlzdWFsRWxlbWVudC5yZXNvdXJjZSAhPT0gJ2ltYWdlJyAmJiBjb25jZXB0LnZpc3VhbEVsZW1lbnQudXJsID8gKFxuICAgICAgICAgICAgPEltYWdlV3JhcHBlcj5cbiAgICAgICAgICAgICAgPE5vdGlvblxuICAgICAgICAgICAgICAgIGlkPXtub3Rpb25JZH1cbiAgICAgICAgICAgICAgICB0aXRsZT17Y29uY2VwdC50aXRsZX1cbiAgICAgICAgICAgICAgICBoaWRlQmFzZWxpbmVJY29uXG4gICAgICAgICAgICAgICAgc3ViVGl0bGU9e3QoJ3NlYXJjaFBhZ2UucmVzdWx0VHlwZS5ub3Rpb25zSGVhZGluZycpfVxuICAgICAgICAgICAgICAgIGNvbnRlbnQ9e1xuICAgICAgICAgICAgICAgICAgPD5cbiAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ0NvbnRlbnQ+XG4gICAgICAgICAgICAgICAgICAgICAge2NvbmNlcHQudmlzdWFsRWxlbWVudCAmJlxuICAgICAgICAgICAgICAgICAgICAgIGNvbmNlcHQudmlzdWFsRWxlbWVudD8ucmVzb3VyY2UgIT09ICdpbWFnZScgJiZcbiAgICAgICAgICAgICAgICAgICAgICBjb25jZXB0LnZpc3VhbEVsZW1lbnQudXJsID8gKFxuICAgICAgICAgICAgICAgICAgICAgICAgPE5vdGlvblZpc3VhbEVsZW1lbnQgdmlzdWFsRWxlbWVudD17Y29uY2VwdC52aXN1YWxFbGVtZW50fSBpZD17bm90aW9uSWR9IGZpZ3VyZUlkPXtmaWd1cmVJZH0gLz5cbiAgICAgICAgICAgICAgICAgICAgICApIDogdW5kZWZpbmVkfVxuXG4gICAgICAgICAgICAgICAgICAgICAgPE5vdGlvbkRpYWxvZ1RleHQ+e3BhcnNlTWFya2Rvd24oY29uY2VwdC50ZXh0LCAnYm9keScpfTwvTm90aW9uRGlhbG9nVGV4dD5cbiAgICAgICAgICAgICAgICAgICAgPC9Ob3Rpb25EaWFsb2dDb250ZW50PlxuICAgICAgICAgICAgICAgICAgICA8Tm90aW9uRGlhbG9nTGljZW5zZXNcbiAgICAgICAgICAgICAgICAgICAgICBhdXRob3JzPXthdXRob3JzfVxuICAgICAgICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2NvbmNlcHQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZT17Y29uY2VwdC5zb3VyY2V9XG4gICAgICAgICAgICAgICAgICAgIC8+XG4gICAgICAgICAgICAgICAgICA8Lz5cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7Y29uY2VwdC5pbWFnZSAmJiAoXG4gICAgICAgICAgICAgICAgICA8Tm90aW9uSW1hZ2VcbiAgICAgICAgICAgICAgICAgICAgdHlwZT17dHlwZX1cbiAgICAgICAgICAgICAgICAgICAgaWQ9e3Zpc3VhbEVsZW1lbnRJZH1cbiAgICAgICAgICAgICAgICAgICAgc3JjPXtjb25jZXB0LmltYWdlPy5zcmN9XG4gICAgICAgICAgICAgICAgICAgIGFsdD17Y29uY2VwdC5pbWFnZT8uYWx0ID8/ICcnfVxuICAgICAgICAgICAgICAgICAgLz5cbiAgICAgICAgICAgICAgICApfVxuICAgICAgICAgICAgICA8L05vdGlvbj5cbiAgICAgICAgICAgIDwvSW1hZ2VXcmFwcGVyPlxuICAgICAgICAgICkgOiB1bmRlZmluZWRcbiAgICAgICAgfVxuICAgICAgPjwvVUlOb3Rpb24+XG4gICAgPC9GaWd1cmVOb3Rpb24+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb25jZXB0Tm90aW9uO1xuIl19 */"));
|
|
36
|
-
var ConceptNotion = function ConceptNotion(_ref) {
|
|
37
|
-
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;
|
|
38
|
-
var concept = _ref.concept,
|
|
39
|
-
disableScripts = _ref.disableScripts,
|
|
40
|
-
type = _ref.type,
|
|
41
|
-
hideIconsAndAuthors = _ref.hideIconsAndAuthors,
|
|
42
|
-
figureType = _ref.figureType;
|
|
43
|
-
var notionId = "notion-".concat(concept.id);
|
|
44
|
-
var figureId = "notion-figure-".concat(concept.id);
|
|
45
|
-
var visualElementId = "visual-element-".concat(concept.id);
|
|
46
|
-
var _useTranslation = useTranslation(),
|
|
47
|
-
t = _useTranslation.t;
|
|
48
|
-
var _getLicenseCredits = getLicenseCredits(concept.copyright),
|
|
49
|
-
creators = _getLicenseCredits.creators,
|
|
50
|
-
rightsholders = _getLicenseCredits.rightsholders,
|
|
51
|
-
processors = _getLicenseCredits.processors;
|
|
52
|
-
var authors = (creators.length || rightsholders.length ? [].concat(_toConsumableArray(creators), _toConsumableArray(rightsholders)) : _toConsumableArray(processors)).map(function (author) {
|
|
53
|
-
return author.name;
|
|
54
|
-
});
|
|
55
|
-
useEffect(function () {
|
|
56
|
-
if (!disableScripts) {
|
|
57
|
-
initArticleScripts();
|
|
58
|
-
}
|
|
59
|
-
}, [disableScripts]);
|
|
60
|
-
return _jsx(FigureNotion, {
|
|
61
|
-
resizeIframe: true,
|
|
62
|
-
id: figureId,
|
|
63
|
-
title: concept.title,
|
|
64
|
-
figureId: visualElementId,
|
|
65
|
-
copyright: concept.copyright,
|
|
66
|
-
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 : '',
|
|
67
|
-
type: "concept",
|
|
68
|
-
hideIconsAndAuthors: hideIconsAndAuthors,
|
|
69
|
-
figureType: figureType,
|
|
70
|
-
children: _jsx(UINotion, {
|
|
71
|
-
id: notionId,
|
|
72
|
-
title: concept.title,
|
|
73
|
-
text: concept.text,
|
|
74
|
-
imageElement: ((_concept$visualElemen = concept.visualElement) === null || _concept$visualElemen === void 0 ? void 0 : _concept$visualElemen.resource) === 'image' && concept.visualElement.image ? _jsx(ImageWrapper, {
|
|
75
|
-
children: _jsx(Notion, {
|
|
76
|
-
id: notionId,
|
|
77
|
-
title: concept.title,
|
|
78
|
-
subTitle: t('searchPage.resultType.notionsHeading'),
|
|
79
|
-
hideBaselineIcon: true,
|
|
80
|
-
content: _jsxs(_Fragment, {
|
|
81
|
-
children: [_jsxs(NotionDialogContent, {
|
|
82
|
-
children: [((_concept$visualElemen2 = concept.visualElement) === null || _concept$visualElemen2 === void 0 ? void 0 : _concept$visualElemen2.resource) === 'image' && concept.visualElement.image ? _jsx(NotionVisualElement, {
|
|
83
|
-
visualElement: concept.visualElement,
|
|
84
|
-
id: notionId,
|
|
85
|
-
figureId: figureId
|
|
86
|
-
}) : undefined, _jsx(NotionDialogText, {
|
|
87
|
-
children: parseMarkdown(concept.text, 'body')
|
|
88
|
-
})]
|
|
89
|
-
}), _jsx(NotionDialogLicenses, {
|
|
90
|
-
authors: authors,
|
|
91
|
-
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 : '',
|
|
92
|
-
source: concept.source
|
|
93
|
-
})]
|
|
94
|
-
}),
|
|
95
|
-
children: concept.visualElement.image && _jsx(NotionImage, {
|
|
96
|
-
type: type,
|
|
97
|
-
id: visualElementId,
|
|
98
|
-
src: concept.visualElement.image.src,
|
|
99
|
-
alt: (_concept$visualElemen3 = concept.visualElement.image.alt) !== null && _concept$visualElemen3 !== void 0 ? _concept$visualElemen3 : ''
|
|
100
|
-
})
|
|
101
|
-
})
|
|
102
|
-
}) : undefined,
|
|
103
|
-
visualElement: concept.visualElement && concept.visualElement.resource !== 'image' && concept.visualElement.url ? _jsx(ImageWrapper, {
|
|
104
|
-
children: _jsx(Notion, {
|
|
105
|
-
id: notionId,
|
|
106
|
-
title: concept.title,
|
|
107
|
-
hideBaselineIcon: true,
|
|
108
|
-
subTitle: t('searchPage.resultType.notionsHeading'),
|
|
109
|
-
content: _jsxs(_Fragment, {
|
|
110
|
-
children: [_jsxs(NotionDialogContent, {
|
|
111
|
-
children: [concept.visualElement && ((_concept$visualElemen4 = concept.visualElement) === null || _concept$visualElemen4 === void 0 ? void 0 : _concept$visualElemen4.resource) !== 'image' && concept.visualElement.url ? _jsx(NotionVisualElement, {
|
|
112
|
-
visualElement: concept.visualElement,
|
|
113
|
-
id: notionId,
|
|
114
|
-
figureId: figureId
|
|
115
|
-
}) : undefined, _jsx(NotionDialogText, {
|
|
116
|
-
children: parseMarkdown(concept.text, 'body')
|
|
117
|
-
})]
|
|
118
|
-
}), _jsx(NotionDialogLicenses, {
|
|
119
|
-
authors: authors,
|
|
120
|
-
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 : '',
|
|
121
|
-
source: concept.source
|
|
122
|
-
})]
|
|
123
|
-
}),
|
|
124
|
-
children: concept.image && _jsx(NotionImage, {
|
|
125
|
-
type: type,
|
|
126
|
-
id: visualElementId,
|
|
127
|
-
src: (_concept$image = concept.image) === null || _concept$image === void 0 ? void 0 : _concept$image.src,
|
|
128
|
-
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 : ''
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
}) : undefined
|
|
132
|
-
})
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
export default ConceptNotion;
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
3
|
-
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."); }
|
|
4
|
-
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); }
|
|
5
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
7
|
-
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; }
|
|
8
|
-
/**
|
|
9
|
-
* Copyright (c) 2022-present, NDLA.
|
|
10
|
-
*
|
|
11
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
12
|
-
* LICENSE file in the root directory of this source tree. *
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
import { colors, spacing } from '@ndla/core';
|
|
16
|
-
import { getGroupedContributorDescriptionList, getLicenseByAbbreviation, getLicenseCredits } from '@ndla/licenses';
|
|
17
|
-
import { useTranslation } from 'react-i18next';
|
|
18
|
-
import { Figure, FigureCaption, FigureLicenseDialog } from '../Figure';
|
|
19
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
20
|
-
import { Fragment as _Fragment } from "@emotion/react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "@emotion/react/jsx-runtime";
|
|
22
|
-
var BottomBorder = /*#__PURE__*/_styled("div", {
|
|
23
|
-
target: "e16vwpby0",
|
|
24
|
-
label: "BottomBorder"
|
|
25
|
-
})("margin-top:", spacing.normal, ";border-bottom:1px solid ", colors.brand.greyLight, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZ3VyZU5vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZStCIiwiZmlsZSI6IkZpZ3VyZU5vdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuICpcbiAqL1xuXG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBjb2xvcnMsIHNwYWNpbmcgfSBmcm9tICdAbmRsYS9jb3JlJztcbmltcG9ydCB7IGdldEdyb3VwZWRDb250cmlidXRvckRlc2NyaXB0aW9uTGlzdCwgZ2V0TGljZW5zZUJ5QWJicmV2aWF0aW9uLCBnZXRMaWNlbnNlQ3JlZGl0cyB9IGZyb20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lndXJlSWR9IHR5cGU9e2ZpZ3VyZVR5cGUgfHwgJ2Z1bGwtY29sdW1uJ30+XG4gICAgICB7KHsgdHlwZUNsYXNzIH0pID0+IChcbiAgICAgICAgPD5cbiAgICAgICAgICB7dHlwZW9mIGNoaWxkcmVuID09PSAnZnVuY3Rpb24nID8gY2hpbGRyZW4oeyB0eXBlQ2xhc3MgfSkgOiBjaGlsZHJlbn1cbiAgICAgICAgICB7Y29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8gKFxuICAgICAgICAgICAgPEZpZ3VyZUNhcHRpb25cbiAgICAgICAgICAgICAgaGlkZUZpZ2NhcHRpb249e2hpZGVGaWdDYXB0aW9ufVxuICAgICAgICAgICAgICBmaWd1cmVJZD17ZmlndXJlSWR9XG4gICAgICAgICAgICAgIGlkPXtpZH1cbiAgICAgICAgICAgICAgcmV1c2VMYWJlbD17dChgJHt0eXBlfS5yZXVzZWApfVxuICAgICAgICAgICAgICBhdXRob3JzPXthdXRob3JzfVxuICAgICAgICAgICAgICBsaWNlbnNlUmlnaHRzPXtsaWNlbnNlLnJpZ2h0c31cbiAgICAgICAgICAgICAgaGlkZUljb25zQW5kQXV0aG9ycz17aGlkZUljb25zQW5kQXV0aG9yc31cbiAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgPEZpZ3VyZUxpY2Vuc2VEaWFsb2dcbiAgICAgICAgICAgICAgICBpZD17aWR9XG4gICAgICAgICAgICAgICAgYXV0aG9ycz17Z3JvdXBlZEF1dGhvcnN9XG4gICAgICAgICAgICAgICAgbG9jYWxlPXtpMThuLmxhbmd1YWdlfVxuICAgICAgICAgICAgICAgIHRpdGxlPXt0aXRsZX1cbiAgICAgICAgICAgICAgICBvcmlnaW49e2NvcHlyaWdodD8ub3JpZ2lufVxuICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2xpY2Vuc2V9XG4gICAgICAgICAgICAgICAgbWVzc2FnZXM9e3tcbiAgICAgICAgICAgICAgICAgIGNsb3NlOiB0KCdjbG9zZScpLFxuICAgICAgICAgICAgICAgICAgcnVsZXNGb3JVc2U6IHQoYGxpY2Vuc2UuJHt0eXBlfS5ydWxlc2ApLFxuICAgICAgICAgICAgICAgICAgc291cmNlOiB0KCdzb3VyY2UnKSxcbiAgICAgICAgICAgICAgICAgIGxlYXJuQWJvdXRMaWNlbnNlczogdCgnbGljZW5zZS5sZWFybk1vcmUnKSxcbiAgICAgICAgICAgICAgICAgIHRpdGxlOiB0KCd0aXRsZScpLFxuICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7bGljZW5zZUJ1dHRvbnN9XG4gICAgICAgICAgICAgIDwvRmlndXJlTGljZW5zZURpYWxvZz5cbiAgICAgICAgICAgIDwvRmlndXJlQ2FwdGlvbj5cbiAgICAgICAgICApIDogKFxuICAgICAgICAgICAgPEJvdHRvbUJvcmRlciAvPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvPlxuICAgICAgKX1cbiAgICA8L0ZpZ3VyZT5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpZ3VyZU5vdGlvbjtcbiJdfQ== */"));
|
|
26
|
-
var FigureNotion = function FigureNotion(_ref) {
|
|
27
|
-
var resizeIframe = _ref.resizeIframe,
|
|
28
|
-
figureId = _ref.figureId,
|
|
29
|
-
_children = _ref.children,
|
|
30
|
-
id = _ref.id,
|
|
31
|
-
copyright = _ref.copyright,
|
|
32
|
-
licenseString = _ref.licenseString,
|
|
33
|
-
title = _ref.title,
|
|
34
|
-
type = _ref.type,
|
|
35
|
-
hideFigCaption = _ref.hideFigCaption,
|
|
36
|
-
hideIconsAndAuthors = _ref.hideIconsAndAuthors,
|
|
37
|
-
figureType = _ref.figureType,
|
|
38
|
-
licenseButtons = _ref.licenseButtons;
|
|
39
|
-
var _useTranslation = useTranslation(),
|
|
40
|
-
t = _useTranslation.t,
|
|
41
|
-
i18n = _useTranslation.i18n;
|
|
42
|
-
var license = getLicenseByAbbreviation(licenseString, i18n.language);
|
|
43
|
-
var licenseCredits = getLicenseCredits(copyright);
|
|
44
|
-
var creators = licenseCredits.creators,
|
|
45
|
-
rightsholders = licenseCredits.rightsholders,
|
|
46
|
-
processors = licenseCredits.processors;
|
|
47
|
-
var authors = creators.length || rightsholders.length ? [].concat(_toConsumableArray(creators), _toConsumableArray(rightsholders)) : _toConsumableArray(processors);
|
|
48
|
-
var groupedAuthors = getGroupedContributorDescriptionList(licenseCredits, i18n.language).map(function (item) {
|
|
49
|
-
return {
|
|
50
|
-
name: item.description,
|
|
51
|
-
type: item.label
|
|
52
|
-
};
|
|
53
|
-
});
|
|
54
|
-
return _jsx(Figure, {
|
|
55
|
-
resizeIframe: resizeIframe,
|
|
56
|
-
id: figureId,
|
|
57
|
-
type: figureType || 'full-column',
|
|
58
|
-
children: function children(_ref2) {
|
|
59
|
-
var _copyright$license;
|
|
60
|
-
var typeClass = _ref2.typeClass;
|
|
61
|
-
return _jsxs(_Fragment, {
|
|
62
|
-
children: [typeof _children === 'function' ? _children({
|
|
63
|
-
typeClass: typeClass
|
|
64
|
-
}) : _children, copyright !== null && copyright !== void 0 && (_copyright$license = copyright.license) !== null && _copyright$license !== void 0 && _copyright$license.license ? _jsx(FigureCaption, {
|
|
65
|
-
hideFigcaption: hideFigCaption,
|
|
66
|
-
figureId: figureId,
|
|
67
|
-
id: id,
|
|
68
|
-
reuseLabel: t("".concat(type, ".reuse")),
|
|
69
|
-
authors: authors,
|
|
70
|
-
licenseRights: license.rights,
|
|
71
|
-
hideIconsAndAuthors: hideIconsAndAuthors,
|
|
72
|
-
children: _jsx(FigureLicenseDialog, {
|
|
73
|
-
id: id,
|
|
74
|
-
authors: groupedAuthors,
|
|
75
|
-
locale: i18n.language,
|
|
76
|
-
title: title,
|
|
77
|
-
origin: copyright === null || copyright === void 0 ? void 0 : copyright.origin,
|
|
78
|
-
license: license,
|
|
79
|
-
messages: {
|
|
80
|
-
close: t('close'),
|
|
81
|
-
rulesForUse: t("license.".concat(type, ".rules")),
|
|
82
|
-
source: t('source'),
|
|
83
|
-
learnAboutLicenses: t('license.learnMore'),
|
|
84
|
-
title: t('title')
|
|
85
|
-
},
|
|
86
|
-
children: licenseButtons
|
|
87
|
-
})
|
|
88
|
-
}) : _jsx(BottomBorder, {})]
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
};
|
|
93
|
-
export default FigureNotion;
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
|
-
/**
|
|
4
|
-
* Copyright (c) 2022-present, NDLA.
|
|
5
|
-
*
|
|
6
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
7
|
-
* LICENSE file in the root directory of this source tree. *
|
|
8
|
-
*/
|
|
9
|
-
import { css } from '@emotion/react';
|
|
10
|
-
import FigureNotion from './FigureNotion';
|
|
11
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
12
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
13
|
-
name: "1xdnj1g-StyledIframe",
|
|
14
|
-
styles: "min-height:400px;label:StyledIframe;"
|
|
15
|
-
} : {
|
|
16
|
-
name: "1xdnj1g-StyledIframe",
|
|
17
|
-
styles: "min-height:400px;label:StyledIframe;",
|
|
18
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk5vdGlvblZpc3VhbEVsZW1lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWVXIiwiZmlsZSI6Ik5vdGlvblZpc3VhbEVsZW1lbnQudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMjItcHJ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AgICAgY29weXJpZ2h0PXt2aXN1YWxFbGVtZW50LmNvcHlyaWdodH1cbiAgICAgIGxpY2Vuc2VTdHJpbmc9e3Zpc3VhbEVsZW1lbnQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgbGljZW5zZUJ1dHRvbnM9e3Zpc3VhbEVsZW1lbnQubGljZW5zZUJ1dHRvbnN9XG4gICAgICB0eXBlPXt0eXBlfVxuICAgID5cbiAgICAgIHt2aXN1YWxFbGVtZW50LmltYWdlPy5zcmMgPyAoXG4gICAgICAgIDxpbWcgc3JjPXt2aXN1YWxFbGVtZW50LmltYWdlPy5zcmN9IGFsdD17dmlzdWFsRWxlbWVudC5pbWFnZS5hbHR9IC8+XG4gICAgICApIDogKFxuICAgICAgICA8U3R5bGVkSWZyYW1lIGFsbG93RnVsbFNjcmVlbiB0eXBlPXt0eXBlfSBzcmM9e3Zpc3VhbEVsZW1lbnQudXJsfSB0aXRsZT17dmlzdWFsRWxlbWVudC50aXRsZX0gLz5cbiAgICAgICl9XG4gICAgPC9GaWd1cmVOb3Rpb24+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBOb3Rpb25WaXN1YWxFbGVtZW50O1xuIl19 */",
|
|
19
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
20
|
-
};
|
|
21
|
-
var StyledIframe = /*#__PURE__*/_styled("iframe", {
|
|
22
|
-
target: "e1hql2mu0",
|
|
23
|
-
label: "StyledIframe"
|
|
24
|
-
})(function (props) {
|
|
25
|
-
return props.type === 'video' ? _ref : '';
|
|
26
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk5vdGlvblZpc3VhbEVsZW1lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQVlvRCIsImZpbGUiOiJOb3Rpb25WaXN1YWxFbGVt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4gICAgICBmaWd1cmVJZD17ZmlndXJlSWR9XG4gICAgICB0aXRsZT17dmlzdWFsRWxlbWVudC50aXRsZSA/PyAnJ31cbiAgICAgIGNvcHlyaWdodD17dmlzdWFsRWxlbWVudC5jb3B5cmlnaHR9XG4gICAgICBsaWNlbnNlU3RyaW5nPXt2aXN1YWxFbGVtZW50LmNvcHlyaWdodD8ubGljZW5zZT8ubGljZW5zZSA/PyAnJ31cbiAgICAgIGxpY2Vuc2VCdXR0b25zPXt2aXN1YWxFbGVtZW50LmxpY2Vuc2VCdXR0b25zfVxuICAgICAgdHlwZT17dHlwZX1cbiAgICA+XG4gICAgICB7dmlzdWFsRWxlbWVudC5pbWFnZT8uc3JjID8gKFxuICAgICAgICA8aW1nIHNyYz17dmlzdWFsRWxlbWVudC5pbWFnZT8uc3JjfSBhbHQ9e3Zpc3VhbEVsZW1lbnQuaW1hZ2UuYWx0fSAvPlxuICAgICAgKSA6IChcbiAgICAgICAgPFN0eWxlZElmcmFtZSBhbGxvd0Z1bGxTY3JlZW4gdHlwZT17dHlwZX0gc3JjPXt2aXN1YWxFbGVtZW50LnVybH0gdGl0bGU9e3Zpc3VhbEVsZW1lbnQudGl0bGV9IC8+XG4gICAgICApfVxuICAgIDwvRmlndXJlTm90aW9uPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgTm90aW9uVmlzdWFsRWxlbWVudDtcbiJdfQ== */"));
|
|
27
|
-
var supportedEmbedTypes = ['brightcove', 'h5p', 'iframe', 'external', 'image'];
|
|
28
|
-
var getType = function getType(resource) {
|
|
29
|
-
if (resource === 'brightcove') {
|
|
30
|
-
return 'video';
|
|
31
|
-
}
|
|
32
|
-
if (resource === 'image' || resource === 'h5p') {
|
|
33
|
-
return resource;
|
|
34
|
-
}
|
|
35
|
-
return 'other';
|
|
36
|
-
};
|
|
37
|
-
var NotionVisualElement = function NotionVisualElement(_ref2) {
|
|
38
|
-
var _visualElement$title, _visualElement$copyri, _visualElement$copyri2, _visualElement$copyri3, _visualElement$image, _visualElement$image2;
|
|
39
|
-
var visualElement = _ref2.visualElement,
|
|
40
|
-
id = _ref2.id,
|
|
41
|
-
figureId = _ref2.figureId;
|
|
42
|
-
if (!visualElement.resource || !supportedEmbedTypes.includes(visualElement.resource)) {
|
|
43
|
-
return _jsx("p", {
|
|
44
|
-
children: "Embed type is not supported!"
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
var type = getType(visualElement.resource);
|
|
48
|
-
return _jsx(FigureNotion, {
|
|
49
|
-
resizeIframe: true,
|
|
50
|
-
id: id,
|
|
51
|
-
figureId: figureId,
|
|
52
|
-
title: (_visualElement$title = visualElement.title) !== null && _visualElement$title !== void 0 ? _visualElement$title : '',
|
|
53
|
-
copyright: visualElement.copyright,
|
|
54
|
-
licenseString: (_visualElement$copyri = (_visualElement$copyri2 = visualElement.copyright) === null || _visualElement$copyri2 === void 0 ? void 0 : (_visualElement$copyri3 = _visualElement$copyri2.license) === null || _visualElement$copyri3 === void 0 ? void 0 : _visualElement$copyri3.license) !== null && _visualElement$copyri !== void 0 ? _visualElement$copyri : '',
|
|
55
|
-
licenseButtons: visualElement.licenseButtons,
|
|
56
|
-
type: type,
|
|
57
|
-
children: (_visualElement$image = visualElement.image) !== null && _visualElement$image !== void 0 && _visualElement$image.src ? _jsx("img", {
|
|
58
|
-
src: (_visualElement$image2 = visualElement.image) === null || _visualElement$image2 === void 0 ? void 0 : _visualElement$image2.src,
|
|
59
|
-
alt: visualElement.image.alt
|
|
60
|
-
}) : _jsx(StyledIframe, {
|
|
61
|
-
allowFullScreen: true,
|
|
62
|
-
type: type,
|
|
63
|
-
src: visualElement.url,
|
|
64
|
-
title: visualElement.title
|
|
65
|
-
})
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
export default NotionVisualElement;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2016-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
|
-
|
|
9
|
-
// N.B This helper is intended to be used in https://github.com/ndlano/article-converter. It is not a general soultion for using portals in SSR applications.
|
|
10
|
-
|
|
11
|
-
import ReactDOM from 'react-dom';
|
|
12
|
-
import { jsx as _jsx } from "@emotion/react/jsx-runtime";
|
|
13
|
-
function canUseDOM() {
|
|
14
|
-
return !!(typeof window !== 'undefined' && window.document && !window.document.hidden); // window.document.hidden === jsdom check
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export function createUniversalPortal(children, selector) {
|
|
18
|
-
if (!canUseDOM()) {
|
|
19
|
-
return _jsx("div", {
|
|
20
|
-
"data-react-universal-portal": true,
|
|
21
|
-
children: children
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
return /*#__PURE__*/ReactDOM.createPortal(children, document.querySelector(selector));
|
|
25
|
-
}
|
package/lib/Animation/Fade.d.ts
DELETED
|
@@ -1,17 +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
|
-
*/
|
|
8
|
-
import { ReactNode } from 'react';
|
|
9
|
-
interface Props {
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
delay?: number;
|
|
12
|
-
timeout?: number;
|
|
13
|
-
exitDelay?: number;
|
|
14
|
-
show: boolean;
|
|
15
|
-
}
|
|
16
|
-
declare const Fade: ({ show, delay, timeout, exitDelay, children }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
17
|
-
export default Fade;
|
package/lib/Animation/Fade.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _framerMotion = require("framer-motion");
|
|
9
|
-
var _uniqueId = _interopRequireDefault(require("lodash/uniqueId"));
|
|
10
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) 2022-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
|
-
|
|
20
|
-
var animations = function animations(duration, delayIn, delayOut) {
|
|
21
|
-
return {
|
|
22
|
-
open: {
|
|
23
|
-
opacity: 1,
|
|
24
|
-
transition: {
|
|
25
|
-
delay: delayIn / 1000,
|
|
26
|
-
ease: 'easeInOut',
|
|
27
|
-
duration: duration / 1000
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
closed: {
|
|
31
|
-
opacity: 0,
|
|
32
|
-
transition: {
|
|
33
|
-
delay: delayOut / 1000,
|
|
34
|
-
ease: 'easeInOut',
|
|
35
|
-
duration: duration / 1000
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
var defaultTimeout = 300;
|
|
41
|
-
var Fade = function Fade(_ref) {
|
|
42
|
-
var show = _ref.show,
|
|
43
|
-
_ref$delay = _ref.delay,
|
|
44
|
-
delay = _ref$delay === void 0 ? 0 : _ref$delay,
|
|
45
|
-
_ref$timeout = _ref.timeout,
|
|
46
|
-
timeout = _ref$timeout === void 0 ? defaultTimeout : _ref$timeout,
|
|
47
|
-
_ref$exitDelay = _ref.exitDelay,
|
|
48
|
-
exitDelay = _ref$exitDelay === void 0 ? 0 : _ref$exitDelay,
|
|
49
|
-
children = _ref.children;
|
|
50
|
-
var id = (0, _react.useMemo)(function () {
|
|
51
|
-
return (0, _uniqueId.default)();
|
|
52
|
-
}, []);
|
|
53
|
-
var variants = (0, _react.useMemo)(function () {
|
|
54
|
-
return animations(timeout, delay, exitDelay);
|
|
55
|
-
}, [timeout, delay, exitDelay]);
|
|
56
|
-
return (0, _jsxRuntime.jsx)(_framerMotion.LazyMotion, {
|
|
57
|
-
features: _framerMotion.domAnimation,
|
|
58
|
-
children: (0, _jsxRuntime.jsx)(_framerMotion.AnimatePresence, {
|
|
59
|
-
children: show && (0, _jsxRuntime.jsx)(_framerMotion.m.div, {
|
|
60
|
-
initial: "closed",
|
|
61
|
-
animate: "open",
|
|
62
|
-
exit: "closed",
|
|
63
|
-
variants: variants,
|
|
64
|
-
children: children
|
|
65
|
-
}, id)
|
|
66
|
-
})
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
var _default = Fade;
|
|
70
|
-
exports.default = _default;
|
package/lib/Animation/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Fade } from './Fade';
|
package/lib/Animation/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "Fade", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function get() {
|
|
9
|
-
return _Fade.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _Fade = _interopRequireDefault(require("./Fade"));
|
|
13
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2021-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 { Locale } from '../types';
|
|
9
|
-
export declare const truncateDescription: (el: HTMLElement, readMoreLabel: string | null) => void;
|
|
10
|
-
declare const initAudioPlayers: (locale: Locale) => void;
|
|
11
|
-
export default initAudioPlayers;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.truncateDescription = exports.default = void 0;
|
|
7
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
8
|
-
var _shave = _interopRequireDefault(require("shave"));
|
|
9
|
-
var _Controls = _interopRequireDefault(require("./Controls"));
|
|
10
|
-
var _SpeechControl = _interopRequireDefault(require("./SpeechControl"));
|
|
11
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
|
-
/**
|
|
14
|
-
* Copyright (c) 2021-present, NDLA.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
var truncateDescription = function truncateDescription(el, readMoreLabel) {
|
|
22
|
-
(0, _shave.default)(el, 90, {
|
|
23
|
-
character: "... <a href=\"#\" onclick=\"(function(e){e.preventDefault(); const parentNode = e.target.parentNode; parentNode.nextSibling.style.display = 'inline'; parentNode.remove();return false;})(arguments[0]);return false;\">".concat(readMoreLabel, "</a>")
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
exports.truncateDescription = truncateDescription;
|
|
27
|
-
var forEachElement = function forEachElement(selector, callback) {
|
|
28
|
-
var nodeList = document.querySelectorAll(selector);
|
|
29
|
-
for (var i = 0; i < nodeList.length; i += 1) {
|
|
30
|
-
callback(nodeList[i], i);
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
var initAudioPlayers = function initAudioPlayers(locale) {
|
|
34
|
-
forEachElement('[data-audio-player]', function (el) {
|
|
35
|
-
var src = el.getAttribute('data-src');
|
|
36
|
-
var title = el.getAttribute('data-title');
|
|
37
|
-
var speech = el.getAttribute('data-speech');
|
|
38
|
-
if (src && title) {
|
|
39
|
-
if (speech) {
|
|
40
|
-
// eslint-disable-next-line react/no-deprecated
|
|
41
|
-
_reactDom.default.hydrate((0, _jsxRuntime.jsx)(_SpeechControl.default, {
|
|
42
|
-
src: src,
|
|
43
|
-
title: title
|
|
44
|
-
}), el);
|
|
45
|
-
} else {
|
|
46
|
-
// eslint-disable-next-line react/no-deprecated
|
|
47
|
-
_reactDom.default.hydrate((0, _jsxRuntime.jsx)(_Controls.default, {
|
|
48
|
-
src: src,
|
|
49
|
-
title: title
|
|
50
|
-
}), el);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
forEachElement('[data-audio-player-description]', function (el) {
|
|
55
|
-
var readMoreLabel = el.getAttribute('data-read-more-text');
|
|
56
|
-
truncateDescription(el, readMoreLabel);
|
|
57
|
-
});
|
|
58
|
-
forEachElement('[data-audio-text-button-id]', function (el) {
|
|
59
|
-
var id = el.getAttribute('data-audio-text-button-id');
|
|
60
|
-
if (id) {
|
|
61
|
-
el.onclick = function () {
|
|
62
|
-
var _document, _document$getElementB;
|
|
63
|
-
return (_document = document) === null || _document === void 0 ? void 0 : (_document$getElementB = _document.getElementById(id)) === null || _document$getElementB === void 0 ? void 0 : _document$getElementB.toggleAttribute('hidden');
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
};
|
|
68
|
-
var _default = initAudioPlayers;
|
|
69
|
-
exports.default = _default;
|
package/lib/Dialog/Dialog.d.ts
DELETED
|
@@ -1,23 +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
|
-
interface Props {
|
|
10
|
-
id: string;
|
|
11
|
-
labelledby?: string;
|
|
12
|
-
label?: string;
|
|
13
|
-
hidden?: boolean;
|
|
14
|
-
children?: ReactNode;
|
|
15
|
-
messages?: {
|
|
16
|
-
close: string;
|
|
17
|
-
};
|
|
18
|
-
modifier?: string | string[];
|
|
19
|
-
disablePortal?: boolean;
|
|
20
|
-
onClose?: () => void;
|
|
21
|
-
}
|
|
22
|
-
export declare const Dialog: ({ children, messages, id, labelledby, label, modifier, disablePortal, hidden, onClose, ...rest }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
23
|
-
export {};
|