@ndla/ui 3.2.1-alpha.14 → 3.2.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/AuthorInfo/AuthorInfo.js +1 -2
- package/lib/BackgroundImage/BackgroundImage.d.ts +11 -0
- package/{es/BackgroundImage/index.js → lib/BackgroundImage/index.d.ts} +1 -1
- package/lib/ContentLoader/index.d.ts +20 -0
- package/lib/Dialog/Dialog.d.ts +23 -0
- package/{es/Dialog/index.js → lib/Dialog/index.d.ts} +1 -1
- package/lib/Figure/Figure.d.ts +50 -0
- package/lib/Figure/FigureExpandButton.d.ts +16 -0
- package/lib/Figure/FigureLicense.d.ts +33 -0
- package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
- package/{es/Figure/index.js → lib/Figure/index.d.ts} +1 -1
- package/lib/FileList/File.d.ts +7 -0
- package/lib/FileList/FileList.d.ts +17 -0
- package/{es/FileList/index.js → lib/FileList/index.d.ts} +1 -1
- package/lib/Hero/Hero.d.ts +26 -0
- package/{es/Hero/index.js → lib/Hero/index.d.ts} +1 -1
- package/lib/Image/Image.d.ts +25 -0
- package/lib/Image/ImageLink.d.ts +18 -0
- package/lib/Image/LazyLoadImage.d.ts +17 -0
- package/{es/Image/index.js → lib/Image/index.d.ts} +1 -1
- package/lib/InfoBox/InfoBox.d.ts +6 -0
- package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
- package/lib/InfoWidget/InfoWidget.d.ts +19 -0
- package/{es/InfoWidget/index.js → lib/InfoWidget/index.d.ts} +1 -1
- package/lib/Logo/Logo.d.ts +24 -0
- package/lib/Logo/SvgLogo.d.ts +14 -0
- package/{es/Logo/index.js → lib/Logo/index.d.ts} +1 -1
- package/lib/Masthead/Masthead.d.ts +27 -0
- package/{es/Masthead/index.js → lib/Masthead/index.d.ts} +1 -1
- package/lib/NoContentBox/NoContentBox.d.ts +14 -0
- package/{es/NoContentBox/index.js → lib/NoContentBox/index.d.ts} +1 -1
- package/lib/Portrait/Portrait.d.ts +15 -0
- package/{es/Portrait/index.js → lib/Portrait/index.d.ts} +1 -1
- package/lib/Topic/Topic.d.ts +3 -2
- package/lib/Translation/Translation.d.ts +14 -0
- package/lib/Translation/TranslationBox.d.ts +10 -0
- package/lib/Translation/TranslationLine.d.ts +16 -0
- package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
- package/lib/index.d.ts +14 -0
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/types.d.ts +10 -0
- package/package.json +6 -6
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/AuthorInfo/AuthorInfo.tsx +0 -1
- package/src/BackgroundImage/BackgroundImage.tsx +32 -0
- package/src/BackgroundImage/{index.js → index.ts} +0 -0
- package/src/ContentLoader/{index.js → index.tsx} +20 -30
- package/src/Dialog/{Dialog.jsx → Dialog.tsx} +20 -32
- package/src/Dialog/{index.js → index.ts} +0 -0
- package/src/Figure/{Figure.js → Figure.tsx} +44 -54
- package/src/Figure/{FigureExpandButton.js → FigureExpandButton.tsx} +8 -9
- package/src/Figure/{FigureLicense.js → FigureLicense.tsx} +32 -30
- package/src/Figure/{FigureLicenseDialog.js → FigureLicenseDialog.tsx} +22 -22
- package/src/Figure/{index.js → index.ts} +0 -0
- package/src/FileList/{File.jsx → File.tsx} +8 -18
- package/src/FileList/FileList.tsx +36 -0
- package/src/FileList/{index.js → index.ts} +0 -0
- package/src/Hero/Hero.tsx +56 -0
- package/src/Hero/{index.js → index.ts} +0 -0
- package/src/Image/{Image.jsx → Image.tsx} +30 -30
- package/src/Image/{ImageLink.js → ImageLink.tsx} +11 -12
- package/src/Image/LazyLoadImage.tsx +40 -0
- package/src/Image/__tests__/__snapshots__/Image-test.jsx.snap +4 -3
- package/src/Image/{index.js → index.ts} +0 -0
- package/src/InfoBox/InfoBox.tsx +11 -0
- package/src/InfoBox/index.ts +1 -0
- package/src/InfoWidget/{InfoWidget.jsx → InfoWidget.tsx} +19 -26
- package/src/InfoWidget/{index.js → index.ts} +0 -0
- package/src/Logo/{Logo.jsx → Logo.tsx} +21 -28
- package/src/Logo/{SvgLogo.jsx → SvgLogo.tsx} +8 -14
- package/src/Logo/{index.js → index.ts} +0 -0
- package/src/Masthead/{Masthead.jsx → Masthead.tsx} +33 -35
- package/src/Masthead/{index.js → index.ts} +0 -0
- package/src/NoContentBox/{NoContentBox.jsx → NoContentBox.tsx} +7 -13
- package/src/NoContentBox/{index.js → index.ts} +0 -0
- package/src/Portrait/{Portrait.jsx → Portrait.tsx} +8 -14
- package/src/Portrait/{index.js → index.ts} +0 -0
- package/src/Topic/Topic.tsx +3 -2
- package/src/Translation/{Translation.jsx → Translation.tsx} +7 -8
- package/src/Translation/TranslationBox.tsx +20 -0
- package/src/Translation/{TranslationLine.jsx → TranslationLine.tsx} +11 -18
- package/{es/Translation/index.js → src/Translation/index.ts} +1 -1
- package/src/index-javascript.js +0 -29
- package/src/index.ts +35 -0
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +5 -1
- package/src/locale/messages-nn.ts +5 -1
- package/src/types.ts +12 -0
- package/es/BackgroundImage/BackgroundImage.js +0 -37
- package/es/ContentLoader/index.js +0 -96
- package/es/Dialog/Dialog.js +0 -82
- package/es/Figure/Figure.js +0 -125
- package/es/Figure/FigureExpandButton.js +0 -37
- package/es/Figure/FigureLicense.js +0 -74
- package/es/Figure/FigureLicenseDialog.js +0 -61
- package/es/FileList/File.js +0 -61
- package/es/FileList/FileList.js +0 -33
- package/es/Hero/Hero.js +0 -70
- package/es/Image/Image.js +0 -119
- package/es/Image/ImageLink.js +0 -55
- package/es/Image/LazyLoadImage.js +0 -56
- package/es/Image/shapes.js +0 -18
- package/es/InfoBox/InfoBox.js +0 -15
- package/es/InfoBox/index.js +0 -1
- package/es/InfoWidget/InfoWidget.js +0 -76
- package/es/Logo/Logo.js +0 -67
- package/es/Logo/SvgLogo.js +0 -62
- package/es/Masthead/Masthead.js +0 -88
- package/es/NoContentBox/NoContentBox.js +0 -35
- package/es/Portrait/Portrait.js +0 -41
- package/es/Translation/Translation.js +0 -27
- package/es/Translation/TranslationBox.js +0 -13
- package/es/Translation/TranslationLine.js +0 -48
- package/lib/BackgroundImage/BackgroundImage.js +0 -52
- package/lib/BackgroundImage/index.js +0 -13
- package/lib/ContentLoader/index.js +0 -102
- package/lib/Dialog/Dialog.js +0 -90
- package/lib/Dialog/index.js +0 -24
- package/lib/Figure/Figure.js +0 -139
- package/lib/Figure/FigureExpandButton.js +0 -52
- package/lib/Figure/FigureLicense.js +0 -88
- package/lib/Figure/FigureLicenseDialog.js +0 -69
- package/lib/Figure/index.js +0 -49
- package/lib/FileList/File.js +0 -77
- package/lib/FileList/FileList.js +0 -48
- package/lib/FileList/index.js +0 -21
- package/lib/Hero/Hero.js +0 -108
- package/lib/Hero/index.js +0 -55
- package/lib/Image/Image.js +0 -129
- package/lib/Image/ImageLink.js +0 -62
- package/lib/Image/LazyLoadImage.js +0 -61
- package/lib/Image/index.js +0 -38
- package/lib/Image/shapes.js +0 -33
- package/lib/InfoBox/InfoBox.js +0 -29
- package/lib/InfoBox/index.js +0 -15
- package/lib/InfoWidget/InfoWidget.js +0 -93
- package/lib/InfoWidget/index.js +0 -13
- package/lib/Logo/Logo.js +0 -93
- package/lib/Logo/SvgLogo.js +0 -68
- package/lib/Logo/index.js +0 -20
- package/lib/Masthead/Masthead.js +0 -106
- package/lib/Masthead/index.js +0 -30
- package/lib/NoContentBox/NoContentBox.js +0 -53
- package/lib/NoContentBox/index.js +0 -20
- package/lib/Portrait/Portrait.js +0 -55
- package/lib/Portrait/index.js +0 -20
- package/lib/Translation/Translation.js +0 -41
- package/lib/Translation/TranslationBox.js +0 -25
- package/lib/Translation/TranslationLine.js +0 -60
- package/lib/Translation/index.js +0 -31
- package/src/BackgroundImage/BackgroundImage.jsx +0 -39
- package/src/FileList/FileList.jsx +0 -36
- package/src/Hero/Hero.jsx +0 -38
- package/src/Image/LazyLoadImage.jsx +0 -39
- package/src/Image/shapes.js +0 -21
- package/src/InfoBox/InfoBox.jsx +0 -13
- package/src/Translation/TranslationBox.jsx +0 -12
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-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 React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
|
-
import { ArrowCollapse } from '@ndla/icons/common';
|
|
11
|
-
import { ExpandTwoArrows } from '@ndla/icons/action';
|
|
12
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
13
|
-
export function FigureExpandButton(_ref) {
|
|
14
|
-
var children = _ref.children,
|
|
15
|
-
messages = _ref.messages,
|
|
16
|
-
typeClass = _ref.typeClass;
|
|
17
|
-
return ___EmotionJSX("button", {
|
|
18
|
-
className: "c-figure__fullscreen-btn",
|
|
19
|
-
type: "button",
|
|
20
|
-
"data-figure-button": true,
|
|
21
|
-
"data-classtype": typeClass,
|
|
22
|
-
"data-aria": messages.zoomImageButtonLabel,
|
|
23
|
-
"data-ariaexpanded": messages.zoomOutImageButtonLabel,
|
|
24
|
-
"aria-label": messages.zoomImageButtonLabel
|
|
25
|
-
}, ___EmotionJSX(ArrowCollapse, {
|
|
26
|
-
className: "expanded-icon"
|
|
27
|
-
}), ___EmotionJSX(ExpandTwoArrows, {
|
|
28
|
-
className: "contracted-icon"
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
FigureExpandButton.propTypes = {
|
|
32
|
-
messages: PropTypes.shape({
|
|
33
|
-
zoomImageButtonLabel: PropTypes.string.isRequired,
|
|
34
|
-
zoomOutImageButtonLabel: PropTypes.string.isRequired
|
|
35
|
-
}),
|
|
36
|
-
typeClass: PropTypes.string.isRequired
|
|
37
|
-
};
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Copyright (c) 2018-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
|
-
*/
|
|
10
|
-
// N.B This component is used to render static markup serverside
|
|
11
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
|
-
import BEMHelper from 'react-bem-helper';
|
|
15
|
-
import { uuid } from '@ndla/util';
|
|
16
|
-
import { LicenseDescription } from '@ndla/licenses';
|
|
17
|
-
import { ContributorShape, LicenseShape } from '../shapes';
|
|
18
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
19
|
-
export var classLicenses = new BEMHelper({
|
|
20
|
-
name: 'figure-license',
|
|
21
|
-
prefix: 'c-'
|
|
22
|
-
});
|
|
23
|
-
export var FigureLicenseCta = function FigureLicenseCta(_ref) {
|
|
24
|
-
var children = _ref.children,
|
|
25
|
-
messages = _ref.messages,
|
|
26
|
-
authors = _ref.authors,
|
|
27
|
-
origin = _ref.origin,
|
|
28
|
-
title = _ref.title;
|
|
29
|
-
return ___EmotionJSX("div", classLicenses('cta-wrapper'), ___EmotionJSX("ul", classLicenses('list'), title && ___EmotionJSX("li", classLicenses('item'), "".concat(messages.title, ": ").concat(title)), authors.map(function (author) {
|
|
30
|
-
return ___EmotionJSX("li", _extends({
|
|
31
|
-
key: uuid()
|
|
32
|
-
}, classLicenses('item')), "".concat(author.type, ": ").concat(author.name));
|
|
33
|
-
}), origin && ___EmotionJSX("li", classLicenses('item'), messages.source, ":", ' ', origin.startsWith('http') ? ___EmotionJSX("a", {
|
|
34
|
-
href: origin,
|
|
35
|
-
target: "_blank",
|
|
36
|
-
rel: "noopener noreferrer"
|
|
37
|
-
}, origin) : origin)), ___EmotionJSX("div", classLicenses('cta-block'), children));
|
|
38
|
-
};
|
|
39
|
-
FigureLicenseCta.propTypes = {
|
|
40
|
-
children: PropTypes.node,
|
|
41
|
-
origin: PropTypes.string,
|
|
42
|
-
authors: PropTypes.arrayOf(ContributorShape),
|
|
43
|
-
messages: PropTypes.shape({
|
|
44
|
-
source: PropTypes.string.isRequired,
|
|
45
|
-
title: PropTypes.string.isRequired
|
|
46
|
-
}).isRequired,
|
|
47
|
-
title: PropTypes.string
|
|
48
|
-
};
|
|
49
|
-
export var FigureLicenseByline = function FigureLicenseByline(_ref2) {
|
|
50
|
-
var messages = _ref2.messages,
|
|
51
|
-
license = _ref2.license,
|
|
52
|
-
locale = _ref2.locale;
|
|
53
|
-
return [___EmotionJSX(LicenseDescription, {
|
|
54
|
-
key: "byline",
|
|
55
|
-
highlightCC: true,
|
|
56
|
-
locale: locale,
|
|
57
|
-
messages: messages,
|
|
58
|
-
licenseRights: license.rights
|
|
59
|
-
}), ___EmotionJSX("a", _extends({
|
|
60
|
-
key: "link"
|
|
61
|
-
}, classLicenses('link'), {
|
|
62
|
-
target: "_blank",
|
|
63
|
-
rel: "noopener noreferrer",
|
|
64
|
-
href: license.url
|
|
65
|
-
}), license.linkText)];
|
|
66
|
-
};
|
|
67
|
-
FigureLicenseByline.propTypes = {
|
|
68
|
-
messages: PropTypes.shape({
|
|
69
|
-
modelPremission: PropTypes.string,
|
|
70
|
-
learnAboutLicenses: PropTypes.string.isRequired
|
|
71
|
-
}).isRequired,
|
|
72
|
-
license: LicenseShape.isRequired,
|
|
73
|
-
locale: PropTypes.string.isRequired
|
|
74
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Copyright (c) 2017-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
|
-
*/
|
|
10
|
-
// N.B This component is used to render static markup serverside
|
|
11
|
-
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
12
|
-
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
|
-
import Dialog from '../Dialog';
|
|
15
|
-
import { ContributorShape, LicenseShape } from '../shapes';
|
|
16
|
-
import { classLicenses, FigureLicenseByline, FigureLicenseCta } from './FigureLicense';
|
|
17
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
18
|
-
export var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
|
|
19
|
-
var children = _ref.children,
|
|
20
|
-
messages = _ref.messages,
|
|
21
|
-
id = _ref.id,
|
|
22
|
-
authors = _ref.authors,
|
|
23
|
-
origin = _ref.origin,
|
|
24
|
-
title = _ref.title,
|
|
25
|
-
locale = _ref.locale,
|
|
26
|
-
license = _ref.license;
|
|
27
|
-
var headingLabelId = "heading-".concat(id);
|
|
28
|
-
return ___EmotionJSX(Dialog, {
|
|
29
|
-
id: id,
|
|
30
|
-
labelledby: headingLabelId,
|
|
31
|
-
messages: messages
|
|
32
|
-
}, ___EmotionJSX("div", classLicenses(), ___EmotionJSX("h3", _extends({
|
|
33
|
-
id: headingLabelId
|
|
34
|
-
}, classLicenses('title')), messages.rulesForUse), ___EmotionJSX(FigureLicenseByline, {
|
|
35
|
-
license: license,
|
|
36
|
-
messages: messages,
|
|
37
|
-
locale: locale
|
|
38
|
-
}), ___EmotionJSX(FigureLicenseCta, {
|
|
39
|
-
authors: authors,
|
|
40
|
-
title: title,
|
|
41
|
-
origin: origin,
|
|
42
|
-
messages: messages
|
|
43
|
-
}, children)));
|
|
44
|
-
};
|
|
45
|
-
FigureLicenseDialog.propTypes = {
|
|
46
|
-
id: PropTypes.string.isRequired,
|
|
47
|
-
children: PropTypes.node,
|
|
48
|
-
origin: PropTypes.string,
|
|
49
|
-
authors: PropTypes.arrayOf(ContributorShape),
|
|
50
|
-
messages: PropTypes.shape({
|
|
51
|
-
modelPremission: PropTypes.string,
|
|
52
|
-
close: PropTypes.string.isRequired,
|
|
53
|
-
rulesForUse: PropTypes.string.isRequired,
|
|
54
|
-
source: PropTypes.string.isRequired,
|
|
55
|
-
learnAboutLicenses: PropTypes.string.isRequired,
|
|
56
|
-
title: PropTypes.string.isRequired
|
|
57
|
-
}).isRequired,
|
|
58
|
-
title: PropTypes.string,
|
|
59
|
-
license: LicenseShape.isRequired,
|
|
60
|
-
locale: PropTypes.string.isRequired
|
|
61
|
-
};
|
package/es/FileList/File.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
|
-
import BEMHelper from 'react-bem-helper';
|
|
6
|
-
import { Download } from '@ndla/icons/common';
|
|
7
|
-
import SafeLink from '@ndla/safelink';
|
|
8
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
9
|
-
var classes = BEMHelper('c-file-list');
|
|
10
|
-
|
|
11
|
-
var renderFormat = function renderFormat(format, title, isPrimary, id, isDeadLink) {
|
|
12
|
-
var titleWithFormat = "".concat(title, " (").concat(format.fileType.toUpperCase(), ")");
|
|
13
|
-
var formatId = "".concat(id, "_").concat(format.fileType);
|
|
14
|
-
|
|
15
|
-
if (isDeadLink) {
|
|
16
|
-
return ___EmotionJSX("span", {
|
|
17
|
-
key: format.url
|
|
18
|
-
}, ___EmotionJSX(Download, null), ___EmotionJSX("span", null, isPrimary ? titleWithFormat : "(".concat(format.fileType.toUpperCase(), ")")), ___EmotionJSX("span", _extends({}, classes('tooltip'), {
|
|
19
|
-
"aria-hidden": true,
|
|
20
|
-
role: "tooltip",
|
|
21
|
-
id: formatId
|
|
22
|
-
}), ___EmotionJSX("span", classes('tooltip-text'), format.tooltip)));
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return ___EmotionJSX(SafeLink, _extends({}, classes('link'), {
|
|
26
|
-
key: format.url,
|
|
27
|
-
to: format.url,
|
|
28
|
-
target: "_blank",
|
|
29
|
-
"aria-label": titleWithFormat,
|
|
30
|
-
"aria-describedby": formatId
|
|
31
|
-
}), ___EmotionJSX(Download, null), ___EmotionJSX("span", classes('link-text'), ___EmotionJSX("span", null, isPrimary ? titleWithFormat : "(".concat(format.fileType.toUpperCase(), ")"))), ___EmotionJSX("span", _extends({}, classes('tooltip'), {
|
|
32
|
-
"aria-hidden": true,
|
|
33
|
-
role: "tooltip",
|
|
34
|
-
id: formatId
|
|
35
|
-
}), ___EmotionJSX("span", classes('tooltip-text'), format.tooltip)));
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
var File = function File(_ref) {
|
|
39
|
-
var file = _ref.file,
|
|
40
|
-
id = _ref.id;
|
|
41
|
-
var formatLinks = file.formats.map(function (format, index) {
|
|
42
|
-
return renderFormat(format, file.title, index === 0, id, !file.fileExists);
|
|
43
|
-
});
|
|
44
|
-
return ___EmotionJSX("li", _extends({}, classes('item'), {
|
|
45
|
-
key: file.title
|
|
46
|
-
}), formatLinks);
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
File.propTypes = {
|
|
50
|
-
id: PropTypes.string.isRequired,
|
|
51
|
-
file: PropTypes.shape({
|
|
52
|
-
fileExists: PropTypes.bool,
|
|
53
|
-
title: PropTypes.string.isRequired,
|
|
54
|
-
formats: PropTypes.arrayOf(PropTypes.shape({
|
|
55
|
-
url: PropTypes.string.isRequired,
|
|
56
|
-
fileType: PropTypes.string.isRequired,
|
|
57
|
-
tooltip: PropTypes.string.isRequired
|
|
58
|
-
})).isRequired
|
|
59
|
-
})
|
|
60
|
-
};
|
|
61
|
-
export default File;
|
package/es/FileList/FileList.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import BEMHelper from 'react-bem-helper';
|
|
4
|
-
import File from './File';
|
|
5
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
6
|
-
var classes = BEMHelper('c-file-list');
|
|
7
|
-
|
|
8
|
-
var FileList = function FileList(_ref) {
|
|
9
|
-
var files = _ref.files,
|
|
10
|
-
heading = _ref.heading,
|
|
11
|
-
id = _ref.id;
|
|
12
|
-
return ___EmotionJSX("section", classes(), ___EmotionJSX("h1", classes('heading'), heading), ___EmotionJSX("ul", classes('files'), files.map(function (file) {
|
|
13
|
-
return ___EmotionJSX(File, {
|
|
14
|
-
key: "file-".concat(id, "-").concat(file.title),
|
|
15
|
-
file: file,
|
|
16
|
-
id: id
|
|
17
|
-
});
|
|
18
|
-
})));
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
FileList.propTypes = {
|
|
22
|
-
id: PropTypes.string.isRequired,
|
|
23
|
-
heading: PropTypes.string.isRequired,
|
|
24
|
-
files: PropTypes.arrayOf(PropTypes.shape({
|
|
25
|
-
title: PropTypes.string.isRequired,
|
|
26
|
-
formats: PropTypes.arrayOf(PropTypes.shape({
|
|
27
|
-
url: PropTypes.string.isRequired,
|
|
28
|
-
fileType: PropTypes.string.isRequired,
|
|
29
|
-
tooltip: PropTypes.string.isRequired
|
|
30
|
-
})).isRequired
|
|
31
|
-
})).isRequired
|
|
32
|
-
};
|
|
33
|
-
export default FileList;
|
package/es/Hero/Hero.js
DELETED
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
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; }
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2016-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
|
-
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
|
-
import BEMHelper from 'react-bem-helper';
|
|
17
|
-
import { ContentTypeShape } from '../shapes';
|
|
18
|
-
import * as contentTypes from '../model/ContentType';
|
|
19
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
20
|
-
var classes = new BEMHelper({
|
|
21
|
-
name: 'hero',
|
|
22
|
-
prefix: 'c-'
|
|
23
|
-
});
|
|
24
|
-
export var Hero = function Hero(_ref) {
|
|
25
|
-
var children = _ref.children,
|
|
26
|
-
contentType = _ref.contentType;
|
|
27
|
-
return ___EmotionJSX("div", classes('', contentType), children || null);
|
|
28
|
-
};
|
|
29
|
-
Hero.propTypes = {
|
|
30
|
-
contentType: ContentTypeShape,
|
|
31
|
-
children: PropTypes.node
|
|
32
|
-
};
|
|
33
|
-
export var SubjectMaterialHero = function SubjectMaterialHero(props) {
|
|
34
|
-
return ___EmotionJSX(Hero, _extends({
|
|
35
|
-
contentType: contentTypes.SUBJECT_MATERIAL
|
|
36
|
-
}, props));
|
|
37
|
-
};
|
|
38
|
-
export var TasksAndActivitiesHero = function TasksAndActivitiesHero(props) {
|
|
39
|
-
return ___EmotionJSX(Hero, _extends({
|
|
40
|
-
contentType: contentTypes.TASKS_AND_ACTIVITIES
|
|
41
|
-
}, props));
|
|
42
|
-
};
|
|
43
|
-
export var AssessmentResourcesHero = function AssessmentResourcesHero(props) {
|
|
44
|
-
return ___EmotionJSX(Hero, _extends({
|
|
45
|
-
contentType: contentTypes.ASSESSMENT_RESOURCES
|
|
46
|
-
}, props));
|
|
47
|
-
};
|
|
48
|
-
export var SubjectHero = function SubjectHero(props) {
|
|
49
|
-
return ___EmotionJSX(Hero, _extends({
|
|
50
|
-
contentType: contentTypes.SUBJECT
|
|
51
|
-
}, props));
|
|
52
|
-
};
|
|
53
|
-
export var ExternalLearningResourcesHero = function ExternalLearningResourcesHero(props) {
|
|
54
|
-
return ___EmotionJSX(Hero, _extends({
|
|
55
|
-
contentType: contentTypes.EXTERNAL_LEARNING_RESOURCES
|
|
56
|
-
}, props));
|
|
57
|
-
};
|
|
58
|
-
export var SourceMaterialHero = function SourceMaterialHero(props) {
|
|
59
|
-
return ___EmotionJSX(Hero, _extends({
|
|
60
|
-
contentType: contentTypes.SOURCE_MATERIAL
|
|
61
|
-
}, props));
|
|
62
|
-
};
|
|
63
|
-
export var NdlaFilmHero = function NdlaFilmHero(_ref2) {
|
|
64
|
-
var hasImage = _ref2.hasImage,
|
|
65
|
-
rest = _objectWithoutProperties(_ref2, ["hasImage"]);
|
|
66
|
-
|
|
67
|
-
return ___EmotionJSX(Hero, _extends({}, rest, {
|
|
68
|
-
contentType: hasImage ? 'ndla-film has-image' : 'ndla-film'
|
|
69
|
-
}));
|
|
70
|
-
};
|
package/es/Image/Image.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled-base";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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)."; }
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2017-present, NDLA.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import defined from 'defined';
|
|
20
|
-
import PropTypes from 'prop-types';
|
|
21
|
-
import LazyLoadImage from './LazyLoadImage';
|
|
22
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
23
|
-
export var makeSrcQueryString = function makeSrcQueryString(width, crop, focalPoint) {
|
|
24
|
-
var widthParams = width && "width=".concat(width);
|
|
25
|
-
var cropParams = crop && "cropStartX=".concat(crop.startX, "&cropEndX=").concat(crop.endX, "&cropStartY=").concat(crop.startY, "&cropEndY=").concat(crop.endY);
|
|
26
|
-
var focalPointParams = focalPoint && "focalX=".concat(focalPoint.x, "&focalY=").concat(focalPoint.y);
|
|
27
|
-
var params = [widthParams, cropParams, focalPointParams].filter(function (p) {
|
|
28
|
-
return p;
|
|
29
|
-
}).join('&');
|
|
30
|
-
return params;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
var getSrcSet = function getSrcSet(src, crop, focalPoint) {
|
|
34
|
-
var widths = [2720, 2080, 1760, 1440, 1120, 1000, 960, 800, 640, 480, 320, 240, 180];
|
|
35
|
-
return widths.map(function (width) {
|
|
36
|
-
return "".concat(src, "?").concat(makeSrcQueryString(width, crop, focalPoint), " ").concat(width, "w");
|
|
37
|
-
}).join(', ');
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
var StyledImageWrapper = _styled("div", {
|
|
41
|
-
target: "e1jwn5tq0",
|
|
42
|
-
label: "StyledImageWrapper"
|
|
43
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
44
|
-
name: "79elbk",
|
|
45
|
-
styles: "position:relative;"
|
|
46
|
-
} : {
|
|
47
|
-
name: "79elbk",
|
|
48
|
-
styles: "position:relative;",
|
|
49
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlLmpzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QnFDIiwiZmlsZSI6IkltYWdlLmpzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDE3LXByZ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cbiAgbGF6eUxvYWQ6IFByb3BUeXBlcy5ib29sLFxuICBsYXp5TG9hZFNyYzogUHJvcFR5cGVzLnN0cmluZyxcbiAgY3JvcDogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICBzdGFydFg6IFByb3BUeXBlcy5udW1iZXIuaXNSZXF1aXJlZCxcbiAgICBzdGFydFk6IFByb3BUeXBlcy5udW1iZXIuaXNSZXF1aXJlZCxcbiAgICBlbmRYOiBQcm9wVHlwZXMubnVtYmVyLmlzUmVxdWlyZWQsXG4gICAgZW5kWTogUHJvcFR5cGVzLm51bWJlci5pc1JlcXVpcmVkLFxuICB9KSxcbiAgZm9jYWxQb2ludDogUHJvcFR5cGVzLnNoYXBlKHtcbiAgICB4OiBQcm9wVHlwZXMubnVtYmVyLmlzUmVxdWlyZWQsXG4gICAgeTogUHJvcFR5cGVzLm51bWJlci5pc1JlcXVpcmVkLFxuICB9KSxcbn07XG5cbkltYWdlLmRlZmF1bHRQcm9wcyA9IHtcbiAgc2l6ZXM6ICcobWluLXdpZHRoOiAxMDI0cHgpIDEwMjRweCwgMTAwdncnLFxufTtcblxuZXhwb3J0IGRlZmF1bHQgSW1hZ2U7XG4iXX0= */",
|
|
50
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
var Image = function Image(_ref) {
|
|
54
|
-
var alt = _ref.alt,
|
|
55
|
-
src = _ref.src,
|
|
56
|
-
lazyLoad = _ref.lazyLoad,
|
|
57
|
-
lazyLoadSrc = _ref.lazyLoadSrc,
|
|
58
|
-
crop = _ref.crop,
|
|
59
|
-
focalPoint = _ref.focalPoint,
|
|
60
|
-
contentType = _ref.contentType,
|
|
61
|
-
sizes = _ref.sizes,
|
|
62
|
-
expandButton = _ref.expandButton,
|
|
63
|
-
rest = _objectWithoutProperties(_ref, ["alt", "src", "lazyLoad", "lazyLoadSrc", "crop", "focalPoint", "contentType", "sizes", "expandButton"]);
|
|
64
|
-
|
|
65
|
-
var srcSet = defined(rest.srcSet, getSrcSet(src, crop, focalPoint));
|
|
66
|
-
var fallbackWidth = defined(rest.fallbackWidth, 1024);
|
|
67
|
-
var queryString = makeSrcQueryString(fallbackWidth, crop, focalPoint);
|
|
68
|
-
|
|
69
|
-
if (contentType && contentType === 'image/gif') {
|
|
70
|
-
return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX("img", _extends({
|
|
71
|
-
alt: alt,
|
|
72
|
-
src: "".concat(src)
|
|
73
|
-
}, rest)));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (lazyLoad) {
|
|
77
|
-
return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX(LazyLoadImage, {
|
|
78
|
-
alt: alt,
|
|
79
|
-
src: "".concat(src, "?").concat(queryString),
|
|
80
|
-
srcSet: srcSet,
|
|
81
|
-
sizes: sizes,
|
|
82
|
-
lazyLoadSrc: lazyLoadSrc
|
|
83
|
-
}));
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return ___EmotionJSX(StyledImageWrapper, null, ___EmotionJSX("picture", null, ___EmotionJSX("source", {
|
|
87
|
-
type: contentType,
|
|
88
|
-
srcSet: srcSet,
|
|
89
|
-
sizes: sizes
|
|
90
|
-
}), ___EmotionJSX("img", _extends({
|
|
91
|
-
alt: alt,
|
|
92
|
-
src: "".concat(src, "?").concat(queryString)
|
|
93
|
-
}, rest))), expandButton);
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
Image.propTypes = {
|
|
97
|
-
alt: PropTypes.string.isRequired,
|
|
98
|
-
src: PropTypes.string.isRequired,
|
|
99
|
-
sizes: PropTypes.string,
|
|
100
|
-
fallbackWidth: PropTypes.number,
|
|
101
|
-
contentType: PropTypes.string,
|
|
102
|
-
srcSet: PropTypes.string,
|
|
103
|
-
lazyLoad: PropTypes.bool,
|
|
104
|
-
lazyLoadSrc: PropTypes.string,
|
|
105
|
-
crop: PropTypes.shape({
|
|
106
|
-
startX: PropTypes.number.isRequired,
|
|
107
|
-
startY: PropTypes.number.isRequired,
|
|
108
|
-
endX: PropTypes.number.isRequired,
|
|
109
|
-
endY: PropTypes.number.isRequired
|
|
110
|
-
}),
|
|
111
|
-
focalPoint: PropTypes.shape({
|
|
112
|
-
x: PropTypes.number.isRequired,
|
|
113
|
-
y: PropTypes.number.isRequired
|
|
114
|
-
})
|
|
115
|
-
};
|
|
116
|
-
Image.defaultProps = {
|
|
117
|
-
sizes: '(min-width: 1024px) 1024px, 100vw'
|
|
118
|
-
};
|
|
119
|
-
export default Image;
|
package/es/Image/ImageLink.js
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import _styled from "@emotion/styled-base";
|
|
2
|
-
|
|
3
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
7
|
-
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; }
|
|
8
|
-
|
|
9
|
-
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)."; }
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2019-present, NDLA.
|
|
13
|
-
*
|
|
14
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
15
|
-
* LICENSE file in the root directory of this source tree.
|
|
16
|
-
*
|
|
17
|
-
*/
|
|
18
|
-
import React from 'react';
|
|
19
|
-
import PropTypes from 'prop-types';
|
|
20
|
-
import { makeSrcQueryString } from './Image';
|
|
21
|
-
import { FocalPointShape, CropShape } from './shapes';
|
|
22
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
23
|
-
|
|
24
|
-
var StyledLink = _styled("a", {
|
|
25
|
-
target: "envije90",
|
|
26
|
-
label: "StyledLink"
|
|
27
|
-
})(process.env.NODE_ENV === "production" ? {
|
|
28
|
-
name: "17viinn",
|
|
29
|
-
styles: "box-shadow:inset 0 0;"
|
|
30
|
-
} : {
|
|
31
|
-
name: "17viinn",
|
|
32
|
-
styles: "box-shadow:inset 0 0;",
|
|
33
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlTGluay5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFjMkIiLCJmaWxlIjoiSW1hZ2VMaW5rLmpzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBDb3B5cmlnaHQgKGMpIDIwMTktcHJlc2VudCwgTkRMQS5cbiAqXG4gKiBUaGlzIHNvdXJjZSBjb2RlIGlzIGxpY2Vuc2VkIHVuZGVyIHRoZSBHUEx2MyBsaWNlbnNlIGZvdW5kIGluIHRoZVxuICogTElDRU5TRSBmaWxlIGluIHRoZSByb290IGRpcmVjdG9yeSBvZiB0aGlzIHNvdXJjZSB0cmVlLlxuICpcbiAqL1xuXG5pbXBvcnQgUmVhY3QgZnJvbSAncmVhY3QnO1xuaW1wb3J0IFByb3BUeXBlcyBmcm9tICdwcm9wLXR5cGVzJztcbmltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJztcbmltcG9ydCB7IG1ha2VTcmNRdWVyeVN0cmluZyB9IGZyb20gJy4vSW1hZ2UnO1xuaW1wb3J0IHsgRm9jYWxQb2ludFNoYXBlLCBDcm9wU2hhcGUgfSBmcm9tICcuL3NoYXBlcyc7XG5cbmNvbnN0IFN0eWxlZExpbmsgPSBzdHlsZWQuYWBcbiAgYm94LXNoYWRvdzogaW5zZXQgMCAwO1xuYDtcblxuZXhwb3J0IGZ1bmN0aW9uIEltYWdlTGluayh7IHNyYywgY3JvcCwgY2hpbGRyZW4sIC4uLnJlc3QgfSkge1xuICByZXR1cm4gKFxuICAgIDxTdHlsZWRMaW5rXG4gICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgaHJlZj17YCR7c3JjfT8ke21ha2VTcmNRdWVyeVN0cmluZyh1bmRlZmluZWQsIGNyb3ApfWB9XG4gICAgICByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCJcbiAgICAgIHsuLi5yZXN0fT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L1N0eWxlZExpbms+XG4gICk7XG59XG5cbkltYWdlTGluay5wcm9wVHlwZXMgPSB7XG4gIHNyYzogUHJvcFR5cGVzLnN0cmluZy5pc1JlcXVpcmVkLFxuICBjaGlsZHJlbjogUHJvcFR5cGVzLm5vZGUuaXNSZXF1aXJlZCxcbiAgc2l6ZXM6IFByb3BUeXBlcy5zdHJpbmcsXG4gIGNyb3A6IENyb3BTaGFwZSxcbiAgZm9jYWxQb2ludDogRm9jYWxQb2ludFNoYXBlLFxufTtcbiJdfQ== */",
|
|
34
|
-
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
export function ImageLink(_ref) {
|
|
38
|
-
var src = _ref.src,
|
|
39
|
-
crop = _ref.crop,
|
|
40
|
-
children = _ref.children,
|
|
41
|
-
rest = _objectWithoutProperties(_ref, ["src", "crop", "children"]);
|
|
42
|
-
|
|
43
|
-
return ___EmotionJSX(StyledLink, _extends({
|
|
44
|
-
target: "_blank",
|
|
45
|
-
href: "".concat(src, "?").concat(makeSrcQueryString(undefined, crop)),
|
|
46
|
-
rel: "noopener noreferrer"
|
|
47
|
-
}, rest), children);
|
|
48
|
-
}
|
|
49
|
-
ImageLink.propTypes = {
|
|
50
|
-
src: PropTypes.string.isRequired,
|
|
51
|
-
children: PropTypes.node.isRequired,
|
|
52
|
-
sizes: PropTypes.string,
|
|
53
|
-
crop: CropShape,
|
|
54
|
-
focalPoint: FocalPointShape
|
|
55
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
-
|
|
3
|
-
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; }
|
|
4
|
-
|
|
5
|
-
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; }
|
|
6
|
-
|
|
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
|
-
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types'; // Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
|
|
16
|
-
|
|
17
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
18
|
-
|
|
19
|
-
var LazyLoadImage = function LazyLoadImage(_ref) {
|
|
20
|
-
var alt = _ref.alt,
|
|
21
|
-
src = _ref.src,
|
|
22
|
-
srcSet = _ref.srcSet,
|
|
23
|
-
lazyLoadSrc = _ref.lazyLoadSrc,
|
|
24
|
-
sizes = _ref.sizes,
|
|
25
|
-
rest = _objectWithoutProperties(_ref, ["alt", "src", "srcSet", "lazyLoadSrc", "sizes"]);
|
|
26
|
-
|
|
27
|
-
return [___EmotionJSX("noscript", {
|
|
28
|
-
key: "noscript"
|
|
29
|
-
}, ___EmotionJSX("img", _extends({
|
|
30
|
-
alt: alt,
|
|
31
|
-
src: "".concat(src),
|
|
32
|
-
srcSet: srcSet,
|
|
33
|
-
sizes: sizes
|
|
34
|
-
}, rest))), ___EmotionJSX("img", _extends({
|
|
35
|
-
alt: alt,
|
|
36
|
-
key: "img",
|
|
37
|
-
style: {
|
|
38
|
-
width: '100%'
|
|
39
|
-
},
|
|
40
|
-
className: "lazyload",
|
|
41
|
-
src: lazyLoadSrc,
|
|
42
|
-
"data-src": src,
|
|
43
|
-
"data-src-set": srcSet,
|
|
44
|
-
"data-sizes": sizes
|
|
45
|
-
}, rest))];
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
LazyLoadImage.propTypes = {
|
|
49
|
-
alt: PropTypes.string.isRequired,
|
|
50
|
-
src: PropTypes.string.isRequired,
|
|
51
|
-
sizes: PropTypes.string,
|
|
52
|
-
contentType: PropTypes.string,
|
|
53
|
-
srcSet: PropTypes.string,
|
|
54
|
-
lazyLoadSrc: PropTypes.string.isRequired
|
|
55
|
-
};
|
|
56
|
-
export default LazyLoadImage;
|
package/es/Image/shapes.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-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 PropTypes from 'prop-types';
|
|
9
|
-
export var CropShape = PropTypes.shape({
|
|
10
|
-
startX: PropTypes.number.isRequired,
|
|
11
|
-
startY: PropTypes.number.isRequired,
|
|
12
|
-
endX: PropTypes.number.isRequired,
|
|
13
|
-
endY: PropTypes.number.isRequired
|
|
14
|
-
});
|
|
15
|
-
export var FocalPointShape = PropTypes.shape({
|
|
16
|
-
x: PropTypes.number.isRequired,
|
|
17
|
-
y: PropTypes.number.isRequired
|
|
18
|
-
});
|
package/es/InfoBox/InfoBox.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import BEMHelper from 'react-bem-helper';
|
|
4
|
-
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
5
|
-
var classes = BEMHelper('c-info-box');
|
|
6
|
-
|
|
7
|
-
var InfoBox = function InfoBox(_ref) {
|
|
8
|
-
var children = _ref.children;
|
|
9
|
-
return ___EmotionJSX("div", classes(), children);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
InfoBox.propTypes = {
|
|
13
|
-
children: PropTypes.node.isRequired
|
|
14
|
-
};
|
|
15
|
-
export default InfoBox;
|
package/es/InfoBox/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as InfoBox } from './InfoBox';
|