@ndla/ui 45.0.17 → 46.0.1
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/Article/ArticleByline.js +12 -10
- package/es/AudioPlayer/AudioPlayer.js +19 -19
- package/es/AudioPlayer/index.js +0 -2
- package/es/CampaignBlock/CampaignBlock.js +7 -7
- package/es/Embed/conceptComponents.js +15 -8
- package/es/Figure/Figure.js +11 -89
- package/es/Figure/index.js +1 -3
- package/es/FrontpageArticle/FrontpageArticle.js +4 -9
- package/es/Notion/index.js +1 -3
- package/es/all.css +1 -1
- package/es/index.js +3 -4
- package/lib/Article/Article.js +3 -3
- package/lib/Article/ArticleByline.d.ts +4 -3
- package/lib/Article/ArticleByline.js +12 -10
- package/lib/AudioPlayer/AudioPlayer.js +19 -19
- package/lib/AudioPlayer/index.d.ts +0 -2
- package/lib/AudioPlayer/index.js +0 -7
- package/lib/CampaignBlock/CampaignBlock.js +7 -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/FrontpageArticle/FrontpageArticle.js +4 -9
- 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/package.json +19 -23
- package/src/Article/Article.tsx +1 -1
- package/src/Article/ArticleByline.tsx +25 -21
- package/src/AudioPlayer/AudiPlayer.stories.tsx +88 -0
- package/src/AudioPlayer/AudioPlayer.tsx +3 -1
- package/src/AudioPlayer/index.ts +0 -2
- package/src/CampaignBlock/CampaignBlock.tsx +1 -1
- 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/FrontpageArticle/FrontpageArticle.tsx +1 -12
- package/src/Notion/index.ts +0 -4
- package/src/index.ts +3 -13
- 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,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,eyJ2ZXJzaW9uIjozLCJzb3VyY2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biAgcmV0dXJuIChcbiAgICA8RmlndXJlTm90aW9uXG4gICAgICByZXNpemVJZnJhbWVcbiAgICAgIGlkPXtmaWd1cmVJZH1cbiAgICAgIHRpdGxlPXtjb25jZXB0LnRpdGxlfVxuICAgICAgZmlndXJlSWQ9e3Zpc3VhbEVsZW1lbnRJZH1cbiAgICAgIGNvcHlyaWdodD17Y29uY2VwdC5jb3B5cmlnaHR9XG4gICAgICBsaWNlbnNlU3RyaW5nPXtjb25jZXB0LmNvcHlyaWdodD8ubGljZW5zZT8ubGljZW5zZSA/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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkZpZ3VyZU5vdGlvbi50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZStCIiwiZmlsZSI6IkZpZ3VyZU5vdGlvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMi1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW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EaWFsb2dcbiAgICAgICAgICAgICAgICBpZD17aWR9XG4gICAgICAgICAgICAgICAgYXV0aG9ycz17Z3JvdXBlZEF1dGhvcnN9XG4gICAgICAgICAgICAgICAgbG9jYWxlPXtpMThuLmxhbmd1YWdlfVxuICAgICAgICAgICAgICAgIHRpdGxlPXt0aXRsZX1cbiAgICAgICAgICAgICAgICBvcmlnaW49e2NvcHlyaWdodD8ub3JpZ2lufVxuICAgICAgICAgICAgICAgIGxpY2Vuc2U9e2xpY2Vuc2V9XG4gICAgICAgICAgICAgICAgbWVzc2FnZXM9e3tcbiAgICAgICAgICAgICAgICAgIGNsb3NlOiB0KCdjbG9zZScpLFxuICAgICAgICAgICAgICAgICAgcnVsZXNGb3JVc2U6IHQoYGxpY2Vuc2UuJHt0eXBlfS5ydWxlc2ApLFxuICAgICAgICAgICAgICAgICAgc291cmNlOiB0KCdzb3VyY2UnKSxcbiAgICAgICAgICAgICAgICAgIGxlYXJuQWJvdXRMaWNlbnNlczogdCgnbGljZW5zZS5sZWFybk1vcmUnKSxcbiAgICAgICAgICAgICAgICAgIHRpdGxlOiB0KCd0aXRsZScpLFxuICAgICAgICAgICAgICAgIH19XG4gICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICB7bGljZW5zZUJ1dHRvbnN9XG4gICAgICAgICAgICAgIDwvRmlndXJlTGljZW5zZURpYWxvZz5cbiAgICAgICAgICAgIDwvRmlndXJlQ2FwdGlvbj5cbiAgICAgICAgICApIDogKFxuICAgICAgICAgICAgPEJvdHRvbUJvcmRlciAvPlxuICAgICAgICAgICl9XG4gICAgICAgIDwvPlxuICAgICAgKX1cbiAgICA8L0ZpZ3VyZT5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEZpZ3VyZU5vdGlvbjtcbiJdfQ== */"));
|
|
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;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { ReactNode } from 'react';
|
|
2
|
-
import { Copyright } from '../types';
|
|
3
|
-
export type NotionVisualElementType = {
|
|
4
|
-
element?: ReactNode;
|
|
5
|
-
type?: 'video' | 'image' | 'h5p' | 'iframe';
|
|
6
|
-
resource?: string;
|
|
7
|
-
title?: string;
|
|
8
|
-
url?: string;
|
|
9
|
-
copyright?: Partial<Copyright>;
|
|
10
|
-
image?: {
|
|
11
|
-
src: string;
|
|
12
|
-
alt?: string;
|
|
13
|
-
};
|
|
14
|
-
licenseButtons?: ReactNode;
|
|
15
|
-
};
|
|
16
|
-
interface Props {
|
|
17
|
-
visualElement: NotionVisualElementType;
|
|
18
|
-
id: string;
|
|
19
|
-
figureId: string;
|
|
20
|
-
}
|
|
21
|
-
declare const NotionVisualElement: ({ visualElement, id, figureId }: Props) => import("@emotion/react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default NotionVisualElement;
|
|
@@ -1,75 +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 _react = require("@emotion/react");
|
|
9
|
-
var _FigureNotion = _interopRequireDefault(require("./FigureNotion"));
|
|
10
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
-
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)."; } /**
|
|
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
|
-
var _ref = process.env.NODE_ENV === "production" ? {
|
|
19
|
-
name: "1xdnj1g-StyledIframe",
|
|
20
|
-
styles: "min-height:400px;label:StyledIframe;"
|
|
21
|
-
} : {
|
|
22
|
-
name: "1xdnj1g-StyledIframe",
|
|
23
|
-
styles: "min-height:400px;label:StyledIframe;",
|
|
24
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIk5vdGlvblZpc3VhbEVsZW1lbnQudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJB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VcbiAgICAgIGlkPXtpZH1cbiAgICAgIGZpZ3VyZUlkPXtmaWd1cmVJZH1cbiAgICAgIHRpdGxlPXt2aXN1YWxFbGVtZW50LnRpdGxlID8/ICcnfVxuICAgICAgY29weXJpZ2h0PXt2aXN1YWxFbGVtZW50LmNvcHlyaWdodH1cbiAgICAgIGxpY2Vuc2VTdHJpbmc9e3Zpc3VhbEVsZW1lbnQuY29weXJpZ2h0Py5saWNlbnNlPy5saWNlbnNlID8/ICcnfVxuICAgICAgbGljZW5zZUJ1dHRvbnM9e3Zpc3VhbEVsZW1lbnQubGljZW5zZUJ1dHRvbnN9XG4gICAgICB0eXBlPXt0eXBlfVxuICAgID5cbiAgICAgIHt2aXN1YWxFbGVtZW50LmltYWdlPy5zcmMgPyAoXG4gICAgICAgIDxpbWcgc3JjPXt2aXN1YWxFbGVtZW50LmltYWdlPy5zcmN9IGFsdD17dmlzdWFsRWxlbWVudC5pbWFnZS5hbHR9IC8+XG4gICAgICApIDogKFxuICAgICAgICA8U3R5bGVkSWZyYW1lIGFsbG93RnVsbFNjcmVlbiB0eXBlPXt0eXBlfSBzcmM9e3Zpc3VhbEVsZW1lbnQudXJsfSB0aXRsZT17dmlzdWFsRWxlbWVudC50aXRsZX0gLz5cbiAgICAgICl9XG4gICAgPC9GaWd1cmVOb3Rpb24+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBOb3Rpb25WaXN1YWxFbGVtZW50O1xuIl19 */",
|
|
25
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
26
|
-
};
|
|
27
|
-
var StyledIframe = /*#__PURE__*/(0, _base.default)("iframe", {
|
|
28
|
-
target: "e1hql2mu0",
|
|
29
|
-
label: "StyledIframe"
|
|
30
|
-
})(function (props) {
|
|
31
|
-
return props.type === 'video' ? _ref : '';
|
|
32
|
-
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJz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KHZpc3VhbEVsZW1lbnQucmVzb3VyY2UpO1xuXG4gIHJldHVybiAoXG4gICAgPEZpZ3VyZU5vdGlvblxuICAgICAgcmVzaXplSWZyYW1lXG4gICAgICBpZD17aWR9XG4gICAgICBmaWd1cmVJZD17ZmlndXJlSWR9XG4gICAgICB0aXRsZT17dmlzdWFsRWxlbWVudC50aXRsZSA/PyAnJ31cbiAgICAgIGNvcHlyaWdodD17dmlzdWFsRWxlbWVudC5jb3B5cmlnaHR9XG4gICAgICBsaWNlbnNlU3RyaW5nPXt2aXN1YWxFbGVtZW50LmNvcHlyaWdodD8ubGljZW5zZT8ubGljZW5zZSA/PyAnJ31cbiAgICAgIGxpY2Vuc2VCdXR0b25zPXt2aXN1YWxFbGVtZW50LmxpY2Vuc2VCdXR0b25zfVxuICAgICAgdHlwZT17dHlwZX1cbiAgICA+XG4gICAgICB7dmlzdWFsRWxlbWVudC5pbWFnZT8uc3JjID8gKFxuICAgICAgICA8aW1nIHNyYz17dmlzdWFsRWxlbWVudC5pbWFnZT8uc3JjfSBhbHQ9e3Zpc3VhbEVsZW1lbnQuaW1hZ2UuYWx0fSAvPlxuICAgICAgKSA6IChcbiAgICAgICAgPFN0eWxlZElmcmFtZSBhbGxvd0Z1bGxTY3JlZW4gdHlwZT17dHlwZX0gc3JjPXt2aXN1YWxFbGVtZW50LnVybH0gdGl0bGU9e3Zpc3VhbEVsZW1lbnQudGl0bGV9IC8+XG4gICAgICApfVxuICAgIDwvRmlndXJlTm90aW9uPlxuICApO1xufTtcblxuZXhwb3J0IGRlZmF1bHQgTm90aW9uVmlzdWFsRWxlbWVudDtcbiJdfQ== */"));
|
|
33
|
-
var supportedEmbedTypes = ['brightcove', 'h5p', 'iframe', 'external', 'image'];
|
|
34
|
-
var getType = function getType(resource) {
|
|
35
|
-
if (resource === 'brightcove') {
|
|
36
|
-
return 'video';
|
|
37
|
-
}
|
|
38
|
-
if (resource === 'image' || resource === 'h5p') {
|
|
39
|
-
return resource;
|
|
40
|
-
}
|
|
41
|
-
return 'other';
|
|
42
|
-
};
|
|
43
|
-
var NotionVisualElement = function NotionVisualElement(_ref2) {
|
|
44
|
-
var _visualElement$title, _visualElement$copyri, _visualElement$copyri2, _visualElement$copyri3, _visualElement$image, _visualElement$image2;
|
|
45
|
-
var visualElement = _ref2.visualElement,
|
|
46
|
-
id = _ref2.id,
|
|
47
|
-
figureId = _ref2.figureId;
|
|
48
|
-
if (!visualElement.resource || !supportedEmbedTypes.includes(visualElement.resource)) {
|
|
49
|
-
return (0, _jsxRuntime.jsx)("p", {
|
|
50
|
-
children: "Embed type is not supported!"
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
var type = getType(visualElement.resource);
|
|
54
|
-
return (0, _jsxRuntime.jsx)(_FigureNotion.default, {
|
|
55
|
-
resizeIframe: true,
|
|
56
|
-
id: id,
|
|
57
|
-
figureId: figureId,
|
|
58
|
-
title: (_visualElement$title = visualElement.title) !== null && _visualElement$title !== void 0 ? _visualElement$title : '',
|
|
59
|
-
copyright: visualElement.copyright,
|
|
60
|
-
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 : '',
|
|
61
|
-
licenseButtons: visualElement.licenseButtons,
|
|
62
|
-
type: type,
|
|
63
|
-
children: (_visualElement$image = visualElement.image) !== null && _visualElement$image !== void 0 && _visualElement$image.src ? (0, _jsxRuntime.jsx)("img", {
|
|
64
|
-
src: (_visualElement$image2 = visualElement.image) === null || _visualElement$image2 === void 0 ? void 0 : _visualElement$image2.src,
|
|
65
|
-
alt: visualElement.image.alt
|
|
66
|
-
}) : (0, _jsxRuntime.jsx)(StyledIframe, {
|
|
67
|
-
allowFullScreen: true,
|
|
68
|
-
type: type,
|
|
69
|
-
src: visualElement.url,
|
|
70
|
-
title: visualElement.title
|
|
71
|
-
})
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
var _default = NotionVisualElement;
|
|
75
|
-
exports.default = _default;
|
|
@@ -1,9 +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
|
-
import { ReactNode } from 'react';
|
|
9
|
-
export declare function createUniversalPortal(children: ReactNode, selector: string): import("@emotion/react/jsx-runtime").JSX.Element;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createUniversalPortal = createUniversalPortal;
|
|
7
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
8
|
-
var _jsxRuntime = require("@emotion/react/jsx-runtime");
|
|
9
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
-
/**
|
|
11
|
-
* Copyright (c) 2016-present, NDLA.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
// 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.
|
|
19
|
-
|
|
20
|
-
function canUseDOM() {
|
|
21
|
-
return !!(typeof window !== 'undefined' && window.document && !window.document.hidden); // window.document.hidden === jsdom check
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
function createUniversalPortal(children, selector) {
|
|
25
|
-
if (!canUseDOM()) {
|
|
26
|
-
return (0, _jsxRuntime.jsx)("div", {
|
|
27
|
-
"data-react-universal-portal": true,
|
|
28
|
-
children: children
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return /*#__PURE__*/_reactDom.default.createPortal(children, document.querySelector(selector));
|
|
32
|
-
}
|
package/src/Animation/Fade.tsx
DELETED
|
@@ -1,46 +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
|
-
|
|
9
|
-
import { ReactNode, useMemo } from 'react';
|
|
10
|
-
import { AnimatePresence, LazyMotion, m, domAnimation } from 'framer-motion';
|
|
11
|
-
import uniqueId from 'lodash/uniqueId';
|
|
12
|
-
|
|
13
|
-
interface Props {
|
|
14
|
-
children: ReactNode;
|
|
15
|
-
delay?: number;
|
|
16
|
-
timeout?: number;
|
|
17
|
-
exitDelay?: number;
|
|
18
|
-
show: boolean;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const animations = (duration: number, delayIn: number, delayOut: number) => ({
|
|
22
|
-
open: { opacity: 1, transition: { delay: delayIn / 1000, ease: 'easeInOut', duration: duration / 1000 } },
|
|
23
|
-
closed: { opacity: 0, transition: { delay: delayOut / 1000, ease: 'easeInOut', duration: duration / 1000 } },
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
const defaultTimeout = 300;
|
|
27
|
-
|
|
28
|
-
const Fade = ({ show, delay = 0, timeout = defaultTimeout, exitDelay = 0, children }: Props) => {
|
|
29
|
-
const id = useMemo(() => uniqueId(), []);
|
|
30
|
-
|
|
31
|
-
const variants = useMemo(() => animations(timeout, delay, exitDelay), [timeout, delay, exitDelay]);
|
|
32
|
-
|
|
33
|
-
return (
|
|
34
|
-
<LazyMotion features={domAnimation}>
|
|
35
|
-
<AnimatePresence>
|
|
36
|
-
{show && (
|
|
37
|
-
<m.div key={id} initial="closed" animate="open" exit="closed" variants={variants}>
|
|
38
|
-
{children}
|
|
39
|
-
</m.div>
|
|
40
|
-
)}
|
|
41
|
-
</AnimatePresence>
|
|
42
|
-
</LazyMotion>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
export default Fade;
|
package/src/Animation/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as Fade } from './Fade';
|
|
@@ -1,57 +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
|
-
|
|
9
|
-
import ReactDOM from 'react-dom';
|
|
10
|
-
import shave from 'shave';
|
|
11
|
-
import Controls from './Controls';
|
|
12
|
-
import SpeechControl from './SpeechControl';
|
|
13
|
-
import { Locale } from '../types';
|
|
14
|
-
|
|
15
|
-
export const truncateDescription = (el: HTMLElement, readMoreLabel: string | null) => {
|
|
16
|
-
shave(el, 90, {
|
|
17
|
-
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;">${readMoreLabel}</a>`,
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
const forEachElement = (selector: string, callback: Function) => {
|
|
22
|
-
const nodeList = document.querySelectorAll(selector);
|
|
23
|
-
for (let i = 0; i < nodeList.length; i += 1) {
|
|
24
|
-
callback(nodeList[i], i);
|
|
25
|
-
}
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const initAudioPlayers = (locale: Locale) => {
|
|
29
|
-
forEachElement('[data-audio-player]', (el: HTMLElement) => {
|
|
30
|
-
const src = el.getAttribute('data-src');
|
|
31
|
-
const title = el.getAttribute('data-title');
|
|
32
|
-
const speech = el.getAttribute('data-speech');
|
|
33
|
-
if (src && title) {
|
|
34
|
-
if (speech) {
|
|
35
|
-
// eslint-disable-next-line react/no-deprecated
|
|
36
|
-
ReactDOM.hydrate(<SpeechControl src={src} title={title} />, el);
|
|
37
|
-
} else {
|
|
38
|
-
// eslint-disable-next-line react/no-deprecated
|
|
39
|
-
ReactDOM.hydrate(<Controls src={src} title={title} />, el);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
forEachElement('[data-audio-player-description]', (el: HTMLElement) => {
|
|
45
|
-
const readMoreLabel = el.getAttribute('data-read-more-text');
|
|
46
|
-
truncateDescription(el, readMoreLabel);
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
forEachElement('[data-audio-text-button-id]', (el: HTMLElement) => {
|
|
50
|
-
const id = el.getAttribute('data-audio-text-button-id');
|
|
51
|
-
if (id) {
|
|
52
|
-
el.onclick = () => document?.getElementById(id)?.toggleAttribute('hidden');
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
export default initAudioPlayers;
|