@ndla/ui 3.2.1-alpha.5 → 3.2.3
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/ArticleAuthorContent.js +1 -2
- package/es/Article/ArticleSideBar.js +42 -14
- package/es/AuthorInfo/AuthorInfo.js +1 -2
- package/es/BackgroundImage/BackgroundImage.js +5 -15
- package/es/ContentLoader/index.js +14 -27
- package/es/Dialog/Dialog.js +10 -28
- package/es/FactBox/FactBox.js +7 -11
- package/es/Figure/Figure.js +13 -41
- package/es/Figure/FigureExpandButton.js +2 -11
- package/es/Figure/FigureLicense.js +4 -24
- package/es/Figure/FigureLicenseDialog.js +2 -20
- package/es/FileList/File.js +0 -13
- package/es/FileList/FileList.js +0 -13
- package/es/Hero/Hero.js +0 -6
- package/es/Image/Image.js +4 -27
- package/es/Image/ImageLink.js +3 -12
- package/es/Image/LazyLoadImage.js +4 -13
- package/es/InfoBox/InfoBox.js +0 -4
- package/es/InfoWidget/InfoWidget.js +2 -21
- package/es/Logo/Logo.js +6 -22
- package/es/Logo/SvgLogo.js +4 -12
- package/es/Masthead/Masthead.js +12 -33
- package/es/NoContentBox/NoContentBox.js +2 -11
- package/es/Portrait/Portrait.js +0 -11
- package/es/RelatedArticleList/RelatedArticleList.js +4 -23
- package/es/ResourcesWrapper/ResourcesTitle.js +0 -4
- package/es/ResourcesWrapper/ResourcesTopicTitle.js +12 -25
- package/es/ResourcesWrapper/ResourcesWrapper.js +2 -11
- package/es/Topic/Topic.js +21 -22
- package/es/Translation/Translation.js +0 -5
- package/es/Translation/TranslationBox.js +7 -3
- package/es/Translation/TranslationLine.js +4 -15
- package/es/index-javascript.js +1 -19
- package/es/index.js +18 -0
- package/es/locale/messages-en.js +4 -0
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/lib/Article/ArticleSideBar.d.ts +2 -1
- package/lib/Article/ArticleSideBar.js +43 -14
- package/lib/BackgroundImage/BackgroundImage.d.ts +11 -0
- package/lib/BackgroundImage/BackgroundImage.js +5 -17
- package/lib/BackgroundImage/index.d.ts +2 -0
- package/lib/ContentLoader/index.d.ts +20 -0
- package/lib/ContentLoader/index.js +14 -28
- package/lib/Dialog/Dialog.d.ts +23 -0
- package/lib/Dialog/Dialog.js +9 -29
- package/lib/Dialog/index.d.ts +10 -0
- package/lib/FactBox/FactBox.d.ts +16 -0
- package/lib/FactBox/FactBox.js +5 -11
- package/lib/FactBox/index.d.ts +2 -0
- package/lib/Figure/Figure.d.ts +49 -0
- package/lib/Figure/Figure.js +11 -41
- package/lib/Figure/FigureExpandButton.d.ts +16 -0
- package/lib/Figure/FigureExpandButton.js +2 -13
- package/lib/Figure/FigureLicense.d.ts +33 -0
- package/lib/Figure/FigureLicense.js +5 -27
- package/lib/Figure/FigureLicenseDialog.d.ts +29 -0
- package/lib/Figure/FigureLicenseDialog.js +1 -22
- package/lib/Figure/index.d.ts +12 -0
- package/lib/FileList/File.d.ts +7 -0
- package/lib/FileList/File.js +0 -14
- package/lib/FileList/FileList.d.ts +17 -0
- package/lib/FileList/FileList.js +0 -14
- package/lib/FileList/index.d.ts +3 -0
- package/lib/Hero/Hero.d.ts +27 -0
- package/lib/Hero/Hero.js +0 -8
- package/lib/Hero/index.d.ts +9 -0
- package/lib/Image/Image.d.ts +34 -0
- package/lib/Image/Image.js +4 -28
- package/lib/Image/ImageLink.d.ts +18 -0
- package/lib/Image/ImageLink.js +3 -15
- package/lib/Image/LazyLoadImage.d.ts +17 -0
- package/lib/Image/LazyLoadImage.js +3 -13
- package/lib/Image/index.d.ts +12 -0
- package/lib/InfoBox/InfoBox.d.ts +6 -0
- package/lib/InfoBox/InfoBox.js +0 -5
- package/{src/InfoBox/index.js → lib/InfoBox/index.d.ts} +0 -0
- package/lib/InfoWidget/InfoWidget.d.ts +19 -0
- package/lib/InfoWidget/InfoWidget.js +2 -22
- package/lib/InfoWidget/index.d.ts +2 -0
- package/lib/Logo/Logo.d.ts +24 -0
- package/lib/Logo/Logo.js +6 -29
- package/lib/Logo/SvgLogo.d.ts +14 -0
- package/lib/Logo/SvgLogo.js +4 -13
- package/lib/Logo/index.d.ts +9 -0
- package/lib/Masthead/Masthead.d.ts +27 -0
- package/lib/Masthead/Masthead.js +10 -34
- package/lib/Masthead/index.d.ts +10 -0
- package/lib/NoContentBox/NoContentBox.d.ts +14 -0
- package/lib/NoContentBox/NoContentBox.js +1 -11
- package/lib/NoContentBox/index.d.ts +9 -0
- package/lib/Portrait/Portrait.d.ts +15 -0
- package/lib/Portrait/Portrait.js +0 -12
- package/lib/Portrait/index.d.ts +9 -0
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
- package/lib/RelatedArticleList/index.d.ts +10 -0
- package/lib/ResourcesWrapper/ResourcesTitle.d.ts +13 -0
- package/lib/ResourcesWrapper/ResourcesTitle.js +0 -5
- package/lib/ResourcesWrapper/ResourcesTopicTitle.d.ts +13 -0
- package/lib/ResourcesWrapper/ResourcesTopicTitle.js +11 -26
- package/lib/ResourcesWrapper/ResourcesWrapper.d.ts +18 -0
- package/lib/ResourcesWrapper/ResourcesWrapper.js +2 -12
- package/lib/ResourcesWrapper/index.d.ts +11 -0
- package/lib/Topic/Topic.d.ts +3 -2
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/Translation.d.ts +14 -0
- package/lib/Translation/Translation.js +0 -6
- package/lib/Translation/TranslationBox.d.ts +10 -0
- package/lib/Translation/TranslationBox.js +6 -2
- package/lib/Translation/TranslationLine.d.ts +16 -0
- package/lib/Translation/TranslationLine.js +4 -22
- package/{src/Translation/index.js → lib/Translation/index.d.ts} +0 -0
- package/lib/index-javascript.js +0 -250
- package/lib/index.d.ts +18 -0
- package/lib/index.js +286 -0
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +4 -0
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +5 -1
- package/lib/utils/createUniversalPortal.d.ts +9 -0
- package/package.json +6 -6
- package/src/Article/ArticleAuthorContent.tsx +0 -1
- package/src/Article/ArticleSideBar.tsx +31 -3
- 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/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{index.js → index.ts} +0 -0
- package/src/Figure/{Figure.js → Figure.tsx} +46 -53
- 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 +58 -0
- package/src/Hero/{index.js → index.ts} +2 -0
- package/src/Image/{Image.jsx → Image.tsx} +40 -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} +1 -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/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
- package/src/RelatedArticleList/{index.js → index.ts} +0 -0
- package/src/ResourcesWrapper/{ResourcesTitle.jsx → ResourcesTitle.tsx} +5 -7
- package/src/ResourcesWrapper/{ResourcesTopicTitle.jsx → ResourcesTopicTitle.tsx} +23 -22
- package/src/ResourcesWrapper/{ResourcesWrapper.jsx → ResourcesWrapper.tsx} +9 -14
- package/src/ResourcesWrapper/{index.js → index.ts} +0 -0
- package/src/Topic/Topic.tsx +3 -4
- 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/src/Translation/index.ts +3 -0
- package/src/index-javascript.js +0 -33
- package/src/index.ts +43 -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/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
- package/es/Image/shapes.js +0 -18
- package/lib/Image/shapes.js +0 -33
- 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
|
@@ -9,10 +9,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
9
9
|
*/
|
|
10
10
|
// N.B This component is used to render static markup serverside
|
|
11
11
|
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
12
|
-
import React from 'react';
|
|
13
|
-
|
|
12
|
+
import React from 'react'; //@ts-ignore
|
|
13
|
+
|
|
14
14
|
import Dialog from '../Dialog';
|
|
15
|
-
import { ContributorShape, LicenseShape } from '../shapes';
|
|
16
15
|
import { classLicenses, FigureLicenseByline, FigureLicenseCta } from './FigureLicense';
|
|
17
16
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
18
17
|
export var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
|
|
@@ -41,21 +40,4 @@ export var FigureLicenseDialog = function FigureLicenseDialog(_ref) {
|
|
|
41
40
|
origin: origin,
|
|
42
41
|
messages: messages
|
|
43
42
|
}, 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
43
|
};
|
package/es/FileList/File.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
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
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import BEMHelper from 'react-bem-helper';
|
|
6
5
|
import { Download } from '@ndla/icons/common';
|
|
7
6
|
import SafeLink from '@ndla/safelink';
|
|
@@ -46,16 +45,4 @@ var File = function File(_ref) {
|
|
|
46
45
|
}), formatLinks);
|
|
47
46
|
};
|
|
48
47
|
|
|
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
48
|
export default File;
|
package/es/FileList/FileList.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import BEMHelper from 'react-bem-helper';
|
|
4
3
|
import File from './File';
|
|
5
4
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
@@ -18,16 +17,4 @@ var FileList = function FileList(_ref) {
|
|
|
18
17
|
})));
|
|
19
18
|
};
|
|
20
19
|
|
|
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
20
|
export default FileList;
|
package/es/Hero/Hero.js
CHANGED
|
@@ -12,9 +12,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
15
|
import BEMHelper from 'react-bem-helper';
|
|
17
|
-
import { ContentTypeShape } from '../shapes';
|
|
18
16
|
import * as contentTypes from '../model/ContentType';
|
|
19
17
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
20
18
|
var classes = new BEMHelper({
|
|
@@ -26,10 +24,6 @@ export var Hero = function Hero(_ref) {
|
|
|
26
24
|
contentType = _ref.contentType;
|
|
27
25
|
return ___EmotionJSX("div", classes('', contentType), children || null);
|
|
28
26
|
};
|
|
29
|
-
Hero.propTypes = {
|
|
30
|
-
contentType: ContentTypeShape,
|
|
31
|
-
children: PropTypes.node
|
|
32
|
-
};
|
|
33
27
|
export var SubjectMaterialHero = function SubjectMaterialHero(props) {
|
|
34
28
|
return ___EmotionJSX(Hero, _extends({
|
|
35
29
|
contentType: contentTypes.SUBJECT_MATERIAL
|
package/es/Image/Image.js
CHANGED
|
@@ -17,7 +17,6 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
19
|
import defined from 'defined';
|
|
20
|
-
import PropTypes from 'prop-types';
|
|
21
20
|
import LazyLoadImage from './LazyLoadImage';
|
|
22
21
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
23
22
|
export var makeSrcQueryString = function makeSrcQueryString(width, crop, focalPoint) {
|
|
@@ -38,7 +37,7 @@ var getSrcSet = function getSrcSet(src, crop, focalPoint) {
|
|
|
38
37
|
};
|
|
39
38
|
|
|
40
39
|
var StyledImageWrapper = _styled("div", {
|
|
41
|
-
target: "
|
|
40
|
+
target: "ejtxxex0",
|
|
42
41
|
label: "StyledImageWrapper"
|
|
43
42
|
})(process.env.NODE_ENV === "production" ? {
|
|
44
43
|
name: "79elbk",
|
|
@@ -46,7 +45,7 @@ var StyledImageWrapper = _styled("div", {
|
|
|
46
45
|
} : {
|
|
47
46
|
name: "79elbk",
|
|
48
47
|
styles: "position:relative;",
|
|
49
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
48
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUF1Q3FDIiwiZmlsZSI6IkltYWdlLnRzeCIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogQ29weXJpZ2h0IChjKSAyMDE3LXByZXNlbnQsIE5ETEEuXG4gKlxuICogVGhpcyBzb3VyY2UgY29kZSBpcyBsaWNlbnNlZCB1bmRlciB0aGUgR1BMdjMgbGljZW5zZSBmb3VuZCBpbiB0aGVcbiAqIExJQ0VOU0UgZmlsZSBpbiB0aGUgcm9vdCBkaXJlY3Rvcnkgb2YgdGhpcyBzb3VyY2UgdHJlZS5cbiAqXG4gKi9cblxuaW1wb3J0IFJlYWN0LCB7IFJlYWN0Tm9kZSB9IGZyb20gJ3JlYWN0JztcbmltcG9ydCBkZWZpbmVkIGZyb20gJ2RlZmluZWQnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuaW1wb3J0IExhenlMb2FkSW1hZ2UgZnJvbSAnLi9MYXp5TG9hZEltYWdlJztcbmV4cG9ydCBpbnRlcmZhY2UgSW1hZ2VDcm9wIHtcbiAgc3RhcnRYOiBudW1iZXI7XG4gIHN0YXJ0WTogbnVtYmVyO1xuICBlbmRYOiBudW1iZXI7XG4gIGVuZFk6IG51bWJlcjtcbn1cblxuZXhwb3J0IGludGVyZmFjZSBJbWFnZUZvY2FsUG9pbnQge1xuICB4OiBudW1iZXI7XG4gIHk6IG51bWJlcjtcbn1c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
52
51
|
|
|
@@ -58,7 +57,8 @@ var Image = function Image(_ref) {
|
|
|
58
57
|
crop = _ref.crop,
|
|
59
58
|
focalPoint = _ref.focalPoint,
|
|
60
59
|
contentType = _ref.contentType,
|
|
61
|
-
sizes = _ref.sizes,
|
|
60
|
+
_ref$sizes = _ref.sizes,
|
|
61
|
+
sizes = _ref$sizes === void 0 ? '(min-width: 1024px) 1024px, 100vw' : _ref$sizes,
|
|
62
62
|
expandButton = _ref.expandButton,
|
|
63
63
|
rest = _objectWithoutProperties(_ref, ["alt", "src", "lazyLoad", "lazyLoadSrc", "crop", "focalPoint", "contentType", "sizes", "expandButton"]);
|
|
64
64
|
|
|
@@ -93,27 +93,4 @@ var Image = function Image(_ref) {
|
|
|
93
93
|
}, rest))), expandButton);
|
|
94
94
|
};
|
|
95
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
96
|
export default Image;
|
package/es/Image/ImageLink.js
CHANGED
|
@@ -16,13 +16,11 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
16
16
|
*
|
|
17
17
|
*/
|
|
18
18
|
import React from 'react';
|
|
19
|
-
import PropTypes from 'prop-types';
|
|
20
19
|
import { makeSrcQueryString } from './Image';
|
|
21
|
-
import { FocalPointShape, CropShape } from './shapes';
|
|
22
20
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
23
21
|
|
|
24
22
|
var StyledLink = _styled("a", {
|
|
25
|
-
target: "
|
|
23
|
+
target: "eo3pjlm0",
|
|
26
24
|
label: "StyledLink"
|
|
27
25
|
})(process.env.NODE_ENV === "production" ? {
|
|
28
26
|
name: "17viinn",
|
|
@@ -30,7 +28,7 @@ var StyledLink = _styled("a", {
|
|
|
30
28
|
} : {
|
|
31
29
|
name: "17viinn",
|
|
32
30
|
styles: "box-shadow:inset 0 0;",
|
|
33
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
31
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlTGluay50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYTJCIiwiZmlsZSI6IkltYWdlTGluay50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxOS1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbmltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBtYWtlU3JjUXVlcnlTdHJpbmcgfSBmcm9tICcuL0ltYWdlJztcbmltcG9ydCB7IEltYWdlQ3JvcCwgSW1hZ2VGb2NhbFBvaW50IH0gZnJvbSAnLic7XG5cbmNvbnN0IFN0eWxlZExpbmsgPSBzdHlsZWQuYWBcbiAgYm94LXNoYWRvdzogaW5zZXQgMCAwO1xuYDtcblxuaW50ZXJmYWNlIFByb3BzIHtcbiAgc3JjOiBzdHJpbmc7XG4gIGNoaWxkcmVuOiBSZWFjdE5vZGU7XG4gIHNpemVzPzogc3RyaW5nO1xuICBjcm9wPzogSW1hZ2VDcm9wO1xuICBmb2NhbFBvaW50PzogSW1hZ2VGb2NhbFBvaW50O1xufVxuXG5leHBvcnQgZnVuY3Rpb24gSW1hZ2VMaW5rKHsgc3JjLCBjcm9wLCBjaGlsZHJlbiwgLi4ucmVzdCB9OiBQcm9wcykge1xuICByZXR1cm4gKFxuICAgIDxTdHlsZWRMaW5rXG4gICAgICB0YXJnZXQ9XCJfYmxhbmtcIlxuICAgICAgaHJlZj17YCR7c3JjfT8ke21ha2VTcmNRdWVyeVN0cmluZyh1bmRlZmluZWQsIGNyb3ApfWB9XG4gICAgICByZWw9XCJub29wZW5lciBub3JlZmVycmVyXCJcbiAgICAgIHsuLi5yZXN0fT5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L1N0eWxlZExpbms+XG4gICk7XG59XG4iXX0= */",
|
|
34
32
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
35
33
|
});
|
|
36
34
|
|
|
@@ -45,11 +43,4 @@ export function ImageLink(_ref) {
|
|
|
45
43
|
href: "".concat(src, "?").concat(makeSrcQueryString(undefined, crop)),
|
|
46
44
|
rel: "noopener noreferrer"
|
|
47
45
|
}, 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
|
-
};
|
|
46
|
+
}
|
|
@@ -12,10 +12,9 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types'; // Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
|
|
16
|
-
|
|
17
15
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
18
16
|
|
|
17
|
+
// Lazyload image with lazysizes (https://github.com/aFarkas/lazysizes)
|
|
19
18
|
var LazyLoadImage = function LazyLoadImage(_ref) {
|
|
20
19
|
var alt = _ref.alt,
|
|
21
20
|
src = _ref.src,
|
|
@@ -24,14 +23,14 @@ var LazyLoadImage = function LazyLoadImage(_ref) {
|
|
|
24
23
|
sizes = _ref.sizes,
|
|
25
24
|
rest = _objectWithoutProperties(_ref, ["alt", "src", "srcSet", "lazyLoadSrc", "sizes"]);
|
|
26
25
|
|
|
27
|
-
return
|
|
26
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX("noscript", {
|
|
28
27
|
key: "noscript"
|
|
29
28
|
}, ___EmotionJSX("img", _extends({
|
|
30
29
|
alt: alt,
|
|
31
30
|
src: "".concat(src),
|
|
32
31
|
srcSet: srcSet,
|
|
33
32
|
sizes: sizes
|
|
34
|
-
}, rest))), ___EmotionJSX("img", _extends({
|
|
33
|
+
}, rest))), ",", ___EmotionJSX("img", _extends({
|
|
35
34
|
alt: alt,
|
|
36
35
|
key: "img",
|
|
37
36
|
style: {
|
|
@@ -42,15 +41,7 @@ var LazyLoadImage = function LazyLoadImage(_ref) {
|
|
|
42
41
|
"data-src": src,
|
|
43
42
|
"data-src-set": srcSet,
|
|
44
43
|
"data-sizes": sizes
|
|
45
|
-
}, rest))
|
|
44
|
+
}, rest)));
|
|
46
45
|
};
|
|
47
46
|
|
|
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
47
|
export default LazyLoadImage;
|
package/es/InfoBox/InfoBox.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
2
|
import BEMHelper from 'react-bem-helper';
|
|
4
3
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
5
4
|
var classes = BEMHelper('c-info-box');
|
|
@@ -9,7 +8,4 @@ var InfoBox = function InfoBox(_ref) {
|
|
|
9
8
|
return ___EmotionJSX("div", classes(), children);
|
|
10
9
|
};
|
|
11
10
|
|
|
12
|
-
InfoBox.propTypes = {
|
|
13
|
-
children: PropTypes.node.isRequired
|
|
14
|
-
};
|
|
15
11
|
export default InfoBox;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
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
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
-
import PropTypes from 'prop-types';
|
|
5
4
|
import BEMHelper from 'react-bem-helper';
|
|
6
5
|
import { Forward } from '@ndla/icons/common';
|
|
7
6
|
import SafeLink from '@ndla/safelink';
|
|
@@ -14,7 +13,8 @@ var InfoWidget = function InfoWidget(_ref) {
|
|
|
14
13
|
description = _ref.description,
|
|
15
14
|
mainLink = _ref.mainLink,
|
|
16
15
|
iconLinks = _ref.iconLinks,
|
|
17
|
-
center = _ref.center
|
|
16
|
+
_ref$center = _ref.center,
|
|
17
|
+
center = _ref$center === void 0 ? false : _ref$center;
|
|
18
18
|
return ___EmotionJSX("section", classes('', {
|
|
19
19
|
center: center
|
|
20
20
|
}), ___EmotionJSX(SectionHeading, {
|
|
@@ -54,23 +54,4 @@ var InfoWidget = function InfoWidget(_ref) {
|
|
|
54
54
|
}), mainLink.name)));
|
|
55
55
|
};
|
|
56
56
|
|
|
57
|
-
InfoWidget.propTypes = {
|
|
58
|
-
heading: PropTypes.string.isRequired,
|
|
59
|
-
description: PropTypes.string.isRequired,
|
|
60
|
-
mainLink: PropTypes.shape({
|
|
61
|
-
name: PropTypes.string.isRequired,
|
|
62
|
-
url: PropTypes.string,
|
|
63
|
-
href: PropTypes.string
|
|
64
|
-
}).isRequired,
|
|
65
|
-
iconLinks: PropTypes.arrayOf(PropTypes.shape({
|
|
66
|
-
name: PropTypes.string.isRequired,
|
|
67
|
-
url: PropTypes.string,
|
|
68
|
-
href: PropTypes.string,
|
|
69
|
-
icon: PropTypes.node.isRequired
|
|
70
|
-
})),
|
|
71
|
-
center: PropTypes.bool
|
|
72
|
-
};
|
|
73
|
-
InfoWidget.defaultProps = {
|
|
74
|
-
center: false
|
|
75
|
-
};
|
|
76
57
|
export default InfoWidget;
|
package/es/Logo/Logo.js
CHANGED
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
/* eslint-disable max-len */
|
|
10
|
-
import React
|
|
11
|
-
import PropTypes from 'prop-types';
|
|
10
|
+
import React from 'react';
|
|
12
11
|
import BEMHelper from 'react-bem-helper';
|
|
13
12
|
import SafeLink from '@ndla/safelink';
|
|
14
13
|
import SvgLogo from './SvgLogo';
|
|
@@ -18,11 +17,13 @@ export var logoClasses = new BEMHelper({
|
|
|
18
17
|
prefix: 'c-'
|
|
19
18
|
});
|
|
20
19
|
export var Logo = function Logo(_ref) {
|
|
21
|
-
var name = _ref.name,
|
|
20
|
+
var _ref$name = _ref.name,
|
|
21
|
+
name = _ref$name === void 0 ? true : _ref$name,
|
|
22
22
|
to = _ref.to,
|
|
23
23
|
cssModifier = _ref.cssModifier,
|
|
24
24
|
color = _ref.color,
|
|
25
|
-
large = _ref.large,
|
|
25
|
+
_ref$large = _ref.large,
|
|
26
|
+
large = _ref$large === void 0 ? false : _ref$large,
|
|
26
27
|
locale = _ref.locale,
|
|
27
28
|
label = _ref.label;
|
|
28
29
|
var modifiers = {
|
|
@@ -40,28 +41,11 @@ export var Logo = function Logo(_ref) {
|
|
|
40
41
|
name: name,
|
|
41
42
|
color: color,
|
|
42
43
|
locale: locale
|
|
43
|
-
})) : ___EmotionJSX(Fragment, null, ___EmotionJSX(SvgLogo, {
|
|
44
|
+
})) : ___EmotionJSX(React.Fragment, null, ___EmotionJSX(SvgLogo, {
|
|
44
45
|
name: name,
|
|
45
46
|
color: color,
|
|
46
47
|
locale: locale
|
|
47
48
|
}));
|
|
48
49
|
return ___EmotionJSX("div", logoClasses('', modifiers), logo);
|
|
49
50
|
};
|
|
50
|
-
Logo.propTypes = {
|
|
51
|
-
to: PropTypes.oneOfType([PropTypes.string, PropTypes.shape({
|
|
52
|
-
pathname: PropTypes.string.isRequired,
|
|
53
|
-
search: PropTypes.string,
|
|
54
|
-
hash: PropTypes.string
|
|
55
|
-
})]),
|
|
56
|
-
label: PropTypes.string.isRequired,
|
|
57
|
-
locale: PropTypes.string,
|
|
58
|
-
cssModifier: PropTypes.string,
|
|
59
|
-
large: PropTypes.bool,
|
|
60
|
-
name: PropTypes.bool,
|
|
61
|
-
color: PropTypes.string
|
|
62
|
-
};
|
|
63
|
-
Logo.defaultProps = {
|
|
64
|
-
name: true,
|
|
65
|
-
large: false
|
|
66
|
-
};
|
|
67
51
|
export default Logo;
|
package/es/Logo/SvgLogo.js
CHANGED
|
@@ -10,7 +10,6 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
10
10
|
|
|
11
11
|
/* eslint-disable max-len */
|
|
12
12
|
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import { logoClasses } from './Logo';
|
|
15
14
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
16
15
|
|
|
@@ -29,8 +28,10 @@ var LogoText = function LogoText(locale) {
|
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
export var SvgLogo = function SvgLogo(_ref) {
|
|
32
|
-
var name = _ref.name,
|
|
33
|
-
|
|
31
|
+
var _ref$name = _ref.name,
|
|
32
|
+
name = _ref$name === void 0 ? true : _ref$name,
|
|
33
|
+
_ref$color = _ref.color,
|
|
34
|
+
color = _ref$color === void 0 ? '#000000' : _ref$color,
|
|
34
35
|
locale = _ref.locale;
|
|
35
36
|
return ___EmotionJSX("svg", _extends({}, logoClasses('graphic'), {
|
|
36
37
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -50,13 +51,4 @@ export var SvgLogo = function SvgLogo(_ref) {
|
|
|
50
51
|
points: "18 51 18 118 0 118 0 33 101 33 101 118 83 118 83 51"
|
|
51
52
|
}), name && LogoText(locale));
|
|
52
53
|
};
|
|
53
|
-
SvgLogo.propTypes = {
|
|
54
|
-
name: PropTypes.bool,
|
|
55
|
-
color: PropTypes.string,
|
|
56
|
-
locale: PropTypes.string
|
|
57
|
-
};
|
|
58
|
-
SvgLogo.defaultProps = {
|
|
59
|
-
name: true,
|
|
60
|
-
color: '#000000'
|
|
61
|
-
};
|
|
62
54
|
export default SvgLogo;
|
package/es/Masthead/Masthead.js
CHANGED
|
@@ -9,8 +9,8 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
9
9
|
* LICENSE file in the root directory of this source tree.
|
|
10
10
|
*
|
|
11
11
|
*/
|
|
12
|
-
import React from 'react';
|
|
13
|
-
|
|
12
|
+
import React from 'react'; //@ts-ignore
|
|
13
|
+
|
|
14
14
|
import classNames from 'classnames';
|
|
15
15
|
import BEMHelper from 'react-bem-helper';
|
|
16
16
|
import { withTranslation } from 'react-i18next';
|
|
@@ -23,37 +23,27 @@ var classes = new BEMHelper({
|
|
|
23
23
|
export var MastheadItem = function MastheadItem(_ref) {
|
|
24
24
|
var children = _ref.children,
|
|
25
25
|
className = _ref.className,
|
|
26
|
-
left = _ref.left,
|
|
27
|
-
|
|
26
|
+
_ref$left = _ref.left,
|
|
27
|
+
left = _ref$left === void 0 ? false : _ref$left,
|
|
28
|
+
_ref$right = _ref.right,
|
|
29
|
+
right = _ref$right === void 0 ? false : _ref$right;
|
|
28
30
|
var itemClassNames = classNames(_defineProperty({}, classes('left').className, left), _defineProperty({}, classes('right').className, right), className);
|
|
29
31
|
return ___EmotionJSX("div", {
|
|
30
32
|
className: itemClassNames
|
|
31
33
|
}, children);
|
|
32
34
|
};
|
|
33
|
-
MastheadItem.propTypes = {
|
|
34
|
-
children: PropTypes.node,
|
|
35
|
-
className: PropTypes.string,
|
|
36
|
-
right: PropTypes.bool,
|
|
37
|
-
left: PropTypes.bool
|
|
38
|
-
};
|
|
39
|
-
MastheadItem.defaultProps = {
|
|
40
|
-
right: false,
|
|
41
|
-
left: false
|
|
42
|
-
};
|
|
43
35
|
|
|
44
36
|
var MastheadInfo = function MastheadInfo(_ref2) {
|
|
45
37
|
var children = _ref2.children;
|
|
46
38
|
return ___EmotionJSX("div", classes('info'), ___EmotionJSX("div", classes('info-content'), children));
|
|
47
39
|
};
|
|
48
40
|
|
|
49
|
-
MastheadInfo.propTypes = {
|
|
50
|
-
children: PropTypes.node.isRequired
|
|
51
|
-
};
|
|
52
41
|
export var Masthead = function Masthead(_ref3) {
|
|
53
42
|
var children = _ref3.children,
|
|
54
43
|
fixed = _ref3.fixed,
|
|
55
44
|
infoContent = _ref3.infoContent,
|
|
56
|
-
|
|
45
|
+
_ref3$showLoaderWhenN = _ref3.showLoaderWhenNeeded,
|
|
46
|
+
showLoaderWhenNeeded = _ref3$showLoaderWhenN === void 0 ? true : _ref3$showLoaderWhenN,
|
|
57
47
|
ndlaFilm = _ref3.ndlaFilm,
|
|
58
48
|
skipToMainContentId = _ref3.skipToMainContentId,
|
|
59
49
|
t = _ref3.t;
|
|
@@ -61,12 +51,12 @@ export var Masthead = function Masthead(_ref3) {
|
|
|
61
51
|
tabIndex: 0,
|
|
62
52
|
href: "#".concat(skipToMainContentId)
|
|
63
53
|
}, classes('skip-to-main-content')), t('masthead.skipToContent')), ___EmotionJSX("div", classes('placeholder', {
|
|
64
|
-
infoContent: infoContent
|
|
54
|
+
infoContent: !!infoContent
|
|
65
55
|
})), ___EmotionJSX("div", classes('', {
|
|
66
|
-
fixed: fixed,
|
|
67
|
-
infoContent: infoContent,
|
|
56
|
+
fixed: !!fixed,
|
|
57
|
+
infoContent: !!infoContent,
|
|
68
58
|
showLoaderWhenNeeded: showLoaderWhenNeeded,
|
|
69
|
-
ndlaFilm: ndlaFilm
|
|
59
|
+
ndlaFilm: !!ndlaFilm
|
|
70
60
|
}), infoContent && ___EmotionJSX(DisplayOnPageYOffset, {
|
|
71
61
|
yOffsetMin: 0,
|
|
72
62
|
yOffsetMax: 90
|
|
@@ -74,15 +64,4 @@ export var Masthead = function Masthead(_ref3) {
|
|
|
74
64
|
className: "u-1/1 ".concat(classes('content').className)
|
|
75
65
|
}, children)));
|
|
76
66
|
};
|
|
77
|
-
Masthead.propTypes = {
|
|
78
|
-
children: PropTypes.node,
|
|
79
|
-
fixed: PropTypes.bool,
|
|
80
|
-
showLoaderWhenNeeded: PropTypes.bool,
|
|
81
|
-
infoContent: PropTypes.node,
|
|
82
|
-
ndlaFilm: PropTypes.bool,
|
|
83
|
-
skipToMainContentId: PropTypes.string
|
|
84
|
-
};
|
|
85
|
-
Masthead.defaultProps = {
|
|
86
|
-
showLoaderWhenNeeded: true
|
|
87
|
-
};
|
|
88
67
|
export default withTranslation()(Masthead);
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import
|
|
10
|
-
|
|
9
|
+
import BEMHelper from 'react-bem-helper'; //@ts-ignore
|
|
10
|
+
|
|
11
11
|
import Button from '@ndla/button';
|
|
12
12
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
13
13
|
var classes = new BEMHelper({
|
|
@@ -23,13 +23,4 @@ export var NoContentBox = function NoContentBox(_ref) {
|
|
|
23
23
|
onClick: onClick
|
|
24
24
|
}, buttonText))));
|
|
25
25
|
};
|
|
26
|
-
NoContentBox.propTypes = {
|
|
27
|
-
onClick: PropTypes.func,
|
|
28
|
-
buttonText: PropTypes.string,
|
|
29
|
-
text: PropTypes.string.isRequired
|
|
30
|
-
};
|
|
31
|
-
NoContentBox.defaultProps = {
|
|
32
|
-
onClick: null,
|
|
33
|
-
buttonText: undefined
|
|
34
|
-
};
|
|
35
26
|
export default NoContentBox;
|
package/es/Portrait/Portrait.js
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
9
|
import BEMHelper from 'react-bem-helper';
|
|
11
10
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
12
11
|
var classes = new BEMHelper({
|
|
@@ -28,14 +27,4 @@ var Portrait = function Portrait(_ref) {
|
|
|
28
27
|
}));
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
Portrait.propTypes = {
|
|
32
|
-
src: PropTypes.string.isRequired,
|
|
33
|
-
alt: PropTypes.string.isRequired,
|
|
34
|
-
className: PropTypes.string,
|
|
35
|
-
modifier: PropTypes.oneOf(['small', 'large'])
|
|
36
|
-
};
|
|
37
|
-
Portrait.defaultProps = {
|
|
38
|
-
className: null,
|
|
39
|
-
modifier: null
|
|
40
|
-
};
|
|
41
30
|
export default Portrait;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
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
2
|
|
|
3
3
|
import React, { cloneElement } from 'react';
|
|
4
|
-
import
|
|
5
|
-
|
|
4
|
+
import BEMHelper from 'react-bem-helper'; //@ts-ignore
|
|
5
|
+
|
|
6
6
|
import Button from '@ndla/button';
|
|
7
7
|
import SafeLink from '@ndla/safelink';
|
|
8
8
|
import SectionHeading from '../SectionHeading';
|
|
@@ -28,29 +28,20 @@ export var RelatedArticle = function RelatedArticle(_ref) {
|
|
|
28
28
|
to: to
|
|
29
29
|
}, classes('link'), {
|
|
30
30
|
target: target,
|
|
31
|
-
rel: linkInfo ? 'noopener noreferrer' :
|
|
31
|
+
rel: linkInfo ? 'noopener noreferrer' : undefined
|
|
32
32
|
}), title))), ___EmotionJSX("p", _extends({}, classes('description'), {
|
|
33
33
|
dangerouslySetInnerHTML: {
|
|
34
34
|
__html: introduction
|
|
35
35
|
}
|
|
36
36
|
})), linkInfo && ___EmotionJSX("p", classes('link-info'), linkInfo));
|
|
37
37
|
};
|
|
38
|
-
RelatedArticle.propTypes = {
|
|
39
|
-
icon: PropTypes.node.isRequired,
|
|
40
|
-
title: PropTypes.string.isRequired,
|
|
41
|
-
modifier: PropTypes.string,
|
|
42
|
-
introduction: PropTypes.string.isRequired,
|
|
43
|
-
to: PropTypes.string.isRequired,
|
|
44
|
-
linkInfo: PropTypes.string,
|
|
45
|
-
target: PropTypes.string
|
|
46
|
-
};
|
|
47
38
|
|
|
48
39
|
var RelatedArticleList = function RelatedArticleList(_ref2) {
|
|
49
40
|
var messages = _ref2.messages,
|
|
50
41
|
children = _ref2.children,
|
|
51
42
|
articleCount = _ref2.articleCount,
|
|
52
43
|
dangerouslySetInnerHTML = _ref2.dangerouslySetInnerHTML;
|
|
53
|
-
var clonedChildren = !dangerouslySetInnerHTML ? React.Children.map(children, function (article, i) {
|
|
44
|
+
var clonedChildren = !dangerouslySetInnerHTML && children ? React.Children.map(children, function (article, i) {
|
|
54
45
|
return /*#__PURE__*/React.cloneElement(article, {
|
|
55
46
|
modifier: i >= 2 ? "".concat(article.props.modifier, " hidden") : article.props.modifier
|
|
56
47
|
});
|
|
@@ -68,14 +59,4 @@ var RelatedArticleList = function RelatedArticleList(_ref2) {
|
|
|
68
59
|
}, messages.showMore));
|
|
69
60
|
};
|
|
70
61
|
|
|
71
|
-
RelatedArticleList.propTypes = {
|
|
72
|
-
children: PropTypes.node,
|
|
73
|
-
messages: PropTypes.shape({
|
|
74
|
-
title: PropTypes.string.isRequired
|
|
75
|
-
}),
|
|
76
|
-
dangerouslySetInnerHTML: PropTypes.shape({
|
|
77
|
-
__html: PropTypes.string.isRequired
|
|
78
|
-
}),
|
|
79
|
-
articleCount: PropTypes.number
|
|
80
|
-
};
|
|
81
62
|
export default RelatedArticleList;
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
9
|
import { classes } from './ResourcesWrapper';
|
|
11
10
|
import { SubjectBadge } from '../ContentTypeBadge';
|
|
12
11
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
@@ -19,7 +18,4 @@ var ResourceTitle = function ResourceTitle(_ref) {
|
|
|
19
18
|
}), ___EmotionJSX("h1", classes('title'), children));
|
|
20
19
|
};
|
|
21
20
|
|
|
22
|
-
ResourceTitle.propTypes = {
|
|
23
|
-
children: PropTypes.node.isRequired
|
|
24
|
-
};
|
|
25
21
|
export default ResourceTitle;
|