@ndla/ui 3.2.1-alpha.3 → 3.2.2
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/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 +9 -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/Topic/Topic.js +20 -20
- 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 -18
- package/es/index.js +17 -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/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 +50 -0
- package/lib/Figure/Figure.js +7 -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 +26 -0
- package/lib/Hero/Hero.js +0 -8
- package/lib/Hero/index.d.ts +8 -0
- package/lib/Image/Image.d.ts +25 -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 +11 -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/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 -230
- package/lib/index.d.ts +17 -0
- package/lib/index.js +263 -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/types.d.ts +10 -0
- package/lib/utils/createUniversalPortal.d.ts +9 -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/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{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/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
- package/src/RelatedArticleList/{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/src/Translation/index.ts +3 -0
- package/src/index-javascript.js +0 -32
- package/src/index.ts +41 -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/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
|
@@ -12,8 +12,7 @@ import BEMHelper from 'react-bem-helper';
|
|
|
12
12
|
import { useTranslation } from 'react-i18next'; // @ts-ignore
|
|
13
13
|
|
|
14
14
|
import Button from '@ndla/button';
|
|
15
|
-
import SafeLink from '@ndla/safelink';
|
|
16
|
-
|
|
15
|
+
import SafeLink from '@ndla/safelink';
|
|
17
16
|
import Portrait from '../Portrait';
|
|
18
17
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
19
18
|
var classes = new BEMHelper({
|
|
@@ -10,8 +10,7 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import PropTypes from 'prop-types';
|
|
12
12
|
import BEMHelper from 'react-bem-helper';
|
|
13
|
-
import SafeLink from '@ndla/safelink';
|
|
14
|
-
|
|
13
|
+
import SafeLink from '@ndla/safelink';
|
|
15
14
|
import Portrait from '../Portrait';
|
|
16
15
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
17
16
|
var classes = new BEMHelper({
|
|
@@ -1,16 +1,17 @@
|
|
|
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
|
-
import { breakpoints } from '@ndla/util';
|
|
7
5
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
8
6
|
var classes = BEMHelper('c-background-image');
|
|
9
7
|
|
|
10
8
|
var BackgroundImage = function BackgroundImage(_ref) {
|
|
11
9
|
var images = _ref.images,
|
|
12
|
-
showOverlay = _ref.showOverlay
|
|
13
|
-
|
|
10
|
+
_ref$showOverlay = _ref.showOverlay,
|
|
11
|
+
showOverlay = _ref$showOverlay === void 0 ? false : _ref$showOverlay;
|
|
12
|
+
return ___EmotionJSX("div", classes('', {
|
|
13
|
+
showOverlay: showOverlay
|
|
14
|
+
}), images && images.map(function (image) {
|
|
14
15
|
return image.types.map(function (type) {
|
|
15
16
|
return ___EmotionJSX("div", _extends({
|
|
16
17
|
key: "".concat(image.url).concat(type)
|
|
@@ -23,15 +24,4 @@ var BackgroundImage = function BackgroundImage(_ref) {
|
|
|
23
24
|
}));
|
|
24
25
|
};
|
|
25
26
|
|
|
26
|
-
BackgroundImage.propTypes = {
|
|
27
|
-
showOverlay: PropTypes.bool,
|
|
28
|
-
className: PropTypes.string,
|
|
29
|
-
images: PropTypes.arrayOf(PropTypes.shape({
|
|
30
|
-
url: PropTypes.string.isRequired,
|
|
31
|
-
types: PropTypes.arrayOf(PropTypes.oneOf(Object.keys(breakpoints))).isRequired
|
|
32
|
-
})).isRequired
|
|
33
|
-
};
|
|
34
|
-
BackgroundImage.defaultProps = {
|
|
35
|
-
showOverlay: false
|
|
36
|
-
};
|
|
37
27
|
export default BackgroundImage;
|
|
@@ -12,19 +12,25 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
12
12
|
*
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
-
import PropTypes from 'prop-types';
|
|
16
15
|
import { uuid } from '@ndla/util';
|
|
17
16
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
18
17
|
|
|
19
18
|
var ContentLoader = function ContentLoader(_ref) {
|
|
20
19
|
var children = _ref.children,
|
|
21
|
-
width = _ref.width,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
_ref$width = _ref.width,
|
|
21
|
+
width = _ref$width === void 0 ? 400 : _ref$width,
|
|
22
|
+
_ref$height = _ref.height,
|
|
23
|
+
height = _ref$height === void 0 ? 130 : _ref$height,
|
|
24
|
+
_ref$preserveAspectRa = _ref.preserveAspectRatio,
|
|
25
|
+
preserveAspectRatio = _ref$preserveAspectRa === void 0 ? 'xMidYMid meet' : _ref$preserveAspectRa,
|
|
26
|
+
_ref$className = _ref.className,
|
|
27
|
+
className = _ref$className === void 0 ? '' : _ref$className,
|
|
28
|
+
_ref$primaryColor = _ref.primaryColor,
|
|
29
|
+
primaryColor = _ref$primaryColor === void 0 ? '#f0f0f0' : _ref$primaryColor,
|
|
30
|
+
_ref$secondaryColor = _ref.secondaryColor,
|
|
31
|
+
secondaryColor = _ref$secondaryColor === void 0 ? '#e0e0e0' : _ref$secondaryColor,
|
|
32
|
+
_ref$speed = _ref.speed,
|
|
33
|
+
speed = _ref$speed === void 0 ? 2 : _ref$speed,
|
|
28
34
|
rest = _objectWithoutProperties(_ref, ["children", "width", "height", "preserveAspectRatio", "className", "primaryColor", "secondaryColor", "speed"]);
|
|
29
35
|
|
|
30
36
|
var idClip = uuid();
|
|
@@ -74,23 +80,4 @@ var ContentLoader = function ContentLoader(_ref) {
|
|
|
74
80
|
})))));
|
|
75
81
|
};
|
|
76
82
|
|
|
77
|
-
ContentLoader.propTypes = {
|
|
78
|
-
children: PropTypes.node,
|
|
79
|
-
speed: PropTypes.number,
|
|
80
|
-
width: PropTypes.number,
|
|
81
|
-
height: PropTypes.number,
|
|
82
|
-
primaryColor: PropTypes.string,
|
|
83
|
-
secondaryColor: PropTypes.string,
|
|
84
|
-
preserveAspectRatio: PropTypes.string,
|
|
85
|
-
className: PropTypes.string
|
|
86
|
-
};
|
|
87
|
-
ContentLoader.defaultProps = {
|
|
88
|
-
speed: 2,
|
|
89
|
-
width: 400,
|
|
90
|
-
height: 130,
|
|
91
|
-
primaryColor: '#f0f0f0',
|
|
92
|
-
secondaryColor: '#e0e0e0',
|
|
93
|
-
preserveAspectRatio: 'xMidYMid meet',
|
|
94
|
-
className: ''
|
|
95
|
-
};
|
|
96
83
|
export default ContentLoader;
|
package/es/Dialog/Dialog.js
CHANGED
|
@@ -14,8 +14,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
14
14
|
// N.B These component is used to render static markup serverside
|
|
15
15
|
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import
|
|
18
|
-
|
|
17
|
+
import BEMHelper from 'react-bem-helper'; //@ts-ignore
|
|
18
|
+
|
|
19
19
|
import { createUniversalPortal } from '../utils/createUniversalPortal';
|
|
20
20
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
21
21
|
var classes = new BEMHelper({
|
|
@@ -24,13 +24,18 @@ var classes = new BEMHelper({
|
|
|
24
24
|
});
|
|
25
25
|
export var Dialog = function Dialog(_ref) {
|
|
26
26
|
var children = _ref.children,
|
|
27
|
-
messages = _ref.messages,
|
|
27
|
+
_ref$messages = _ref.messages,
|
|
28
|
+
messages = _ref$messages === void 0 ? {
|
|
29
|
+
close: 'Lukk'
|
|
30
|
+
} : _ref$messages,
|
|
28
31
|
id = _ref.id,
|
|
29
32
|
labelledby = _ref.labelledby,
|
|
30
33
|
label = _ref.label,
|
|
31
34
|
modifier = _ref.modifier,
|
|
32
|
-
disablePortal = _ref.disablePortal,
|
|
33
|
-
|
|
35
|
+
_ref$disablePortal = _ref.disablePortal,
|
|
36
|
+
disablePortal = _ref$disablePortal === void 0 ? false : _ref$disablePortal,
|
|
37
|
+
_ref$hidden = _ref.hidden,
|
|
38
|
+
hidden = _ref$hidden === void 0 ? true : _ref$hidden,
|
|
34
39
|
onClose = _ref.onClose,
|
|
35
40
|
rest = _objectWithoutProperties(_ref, ["children", "messages", "id", "labelledby", "label", "modifier", "disablePortal", "hidden", "onClose"]);
|
|
36
41
|
|
|
@@ -56,27 +61,4 @@ export var Dialog = function Dialog(_ref) {
|
|
|
56
61
|
}
|
|
57
62
|
|
|
58
63
|
return createUniversalPortal(content, 'body');
|
|
59
|
-
};
|
|
60
|
-
Dialog.propTypes = {
|
|
61
|
-
id: PropTypes.string.isRequired,
|
|
62
|
-
labelledby: PropTypes.string,
|
|
63
|
-
label: PropTypes.string,
|
|
64
|
-
hidden: PropTypes.bool,
|
|
65
|
-
children: PropTypes.node,
|
|
66
|
-
messages: PropTypes.shape({
|
|
67
|
-
close: PropTypes.string.isRequired
|
|
68
|
-
}),
|
|
69
|
-
modifier: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
|
|
70
|
-
disablePortal: PropTypes.bool,
|
|
71
|
-
onClose: PropTypes.func
|
|
72
|
-
};
|
|
73
|
-
Dialog.defaultProps = {
|
|
74
|
-
disablePortal: false,
|
|
75
|
-
labelledby: null,
|
|
76
|
-
label: null,
|
|
77
|
-
hidden: true,
|
|
78
|
-
onClose: null,
|
|
79
|
-
messages: {
|
|
80
|
-
close: 'Lukk'
|
|
81
|
-
}
|
|
82
64
|
};
|
package/es/FactBox/FactBox.js
CHANGED
|
@@ -8,15 +8,17 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import
|
|
12
|
-
|
|
11
|
+
import BEMHelper from 'react-bem-helper'; //@ts-ignore
|
|
12
|
+
|
|
13
13
|
import Button from '@ndla/button';
|
|
14
14
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
15
15
|
|
|
16
16
|
var toggleFactBox = function toggleFactBox(event) {
|
|
17
|
-
var
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var _button$previousSibli, _aside$classList;
|
|
18
|
+
|
|
19
|
+
var button = event.currentTarget;
|
|
20
|
+
var aside = button === null || button === void 0 ? void 0 : (_button$previousSibli = button.previousSibling) === null || _button$previousSibli === void 0 ? void 0 : _button$previousSibli.parentElement;
|
|
21
|
+
aside === null || aside === void 0 ? void 0 : (_aside$classList = aside.classList) === null || _aside$classList === void 0 ? void 0 : _aside$classList.toggle('expanded');
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
var classes = new BEMHelper({
|
|
@@ -34,10 +36,4 @@ var FactBox = function FactBox(_ref) {
|
|
|
34
36
|
})));
|
|
35
37
|
};
|
|
36
38
|
|
|
37
|
-
FactBox.propTypes = {
|
|
38
|
-
dangerouslySetInnerHTML: PropTypes.shape({
|
|
39
|
-
__html: PropTypes.string.isRequired
|
|
40
|
-
}),
|
|
41
|
-
children: PropTypes.node
|
|
42
|
-
};
|
|
43
39
|
export default FactBox;
|
package/es/Figure/Figure.js
CHANGED
|
@@ -14,13 +14,13 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
14
14
|
// N.B These component is used to render static markup serverside
|
|
15
15
|
// Any interactivty is added by scripts located in the ndla-article-scripts package
|
|
16
16
|
import React from 'react';
|
|
17
|
-
import PropTypes from 'prop-types';
|
|
18
17
|
import BEMHelper from 'react-bem-helper';
|
|
19
18
|
import { isFunction, parseMarkdown } from '@ndla/util';
|
|
20
19
|
import { useTranslation } from 'react-i18next';
|
|
21
20
|
import { Link as LinkIcon } from '@ndla/icons/common';
|
|
22
21
|
import { LicenseByline } from '@ndla/licenses';
|
|
23
|
-
import SafeLink from '@ndla/safelink';
|
|
22
|
+
import SafeLink from '@ndla/safelink'; //@ts-ignore
|
|
23
|
+
|
|
24
24
|
import Button from '@ndla/button';
|
|
25
25
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
26
26
|
var classes = new BEMHelper({
|
|
@@ -43,11 +43,11 @@ export var FigureCaption = function FigureCaption(_ref) {
|
|
|
43
43
|
var _useTranslation = useTranslation(),
|
|
44
44
|
t = _useTranslation.t;
|
|
45
45
|
|
|
46
|
-
return ___EmotionJSX("figcaption", classes('caption', hideFigcaption
|
|
46
|
+
return ___EmotionJSX("figcaption", classes('caption', hideFigcaption ? 'hidden-caption' : undefined), caption ? ___EmotionJSX("div", classes('info'), parseMarkdown(caption)) : null, ___EmotionJSX("footer", classes('byline'), ___EmotionJSX("div", classes('byline-licenselist'), ___EmotionJSX(LicenseByline, {
|
|
47
47
|
licenseRights: licenseRights,
|
|
48
48
|
locale: locale,
|
|
49
49
|
marginRight: true
|
|
50
|
-
}, ___EmotionJSX("div", classes('byline-author-buttons'), ___EmotionJSX("span", classes('byline-authors'), authors.map(function (author) {
|
|
50
|
+
}, ___EmotionJSX("div", classes('byline-author-buttons'), ___EmotionJSX("span", classes('byline-authors'), authors === null || authors === void 0 ? void 0 : authors.map(function (author) {
|
|
51
51
|
return author.name;
|
|
52
52
|
}).join(', ')), ___EmotionJSX("div", null, ___EmotionJSX(Button, {
|
|
53
53
|
borderShape: "rounded",
|
|
@@ -68,37 +68,15 @@ export var FigureCaption = function FigureCaption(_ref) {
|
|
|
68
68
|
}, t('figure.button.original')))), children)), link && ___EmotionJSX("div", classes('link-wrapper'), ___EmotionJSX(SafeLink, _extends({
|
|
69
69
|
to: link.url
|
|
70
70
|
}, classes('link'), {
|
|
71
|
-
target: link.external ? '_blank' :
|
|
72
|
-
rel: link.external ? 'noopener noreferrer' :
|
|
71
|
+
target: link.external ? '_blank' : undefined,
|
|
72
|
+
rel: link.external ? 'noopener noreferrer' : undefined
|
|
73
73
|
}), ___EmotionJSX("span", classes('link-text'), link.text), ___EmotionJSX(LinkIcon, null)), link.description && ___EmotionJSX("p", classes('link-description'), link.description)))));
|
|
74
74
|
};
|
|
75
|
-
FigureCaption.propTypes = {
|
|
76
|
-
figureId: PropTypes.string.isRequired,
|
|
77
|
-
id: PropTypes.string.isRequired,
|
|
78
|
-
caption: PropTypes.string,
|
|
79
|
-
reuseLabel: PropTypes.string.isRequired,
|
|
80
|
-
licenseRights: PropTypes.arrayOf(PropTypes.string).isRequired,
|
|
81
|
-
children: PropTypes.node,
|
|
82
|
-
authors: PropTypes.arrayOf(PropTypes.shape({
|
|
83
|
-
name: PropTypes.string.isRequired
|
|
84
|
-
})),
|
|
85
|
-
link: PropTypes.shape({
|
|
86
|
-
url: PropTypes.string.isRequired,
|
|
87
|
-
text: PropTypes.string.isRequired,
|
|
88
|
-
description: PropTypes.string,
|
|
89
|
-
external: PropTypes.bool
|
|
90
|
-
}),
|
|
91
|
-
locale: PropTypes.string,
|
|
92
|
-
hideFigcaption: PropTypes.bool,
|
|
93
|
-
hasLinkedVideo: PropTypes.bool
|
|
94
|
-
};
|
|
95
|
-
FigureCaption.defaultProps = {
|
|
96
|
-
link: null
|
|
97
|
-
};
|
|
98
75
|
|
|
99
76
|
var Figure = function Figure(_ref2) {
|
|
100
77
|
var children = _ref2.children,
|
|
101
|
-
type = _ref2.type,
|
|
78
|
+
_ref2$type = _ref2.type,
|
|
79
|
+
type = _ref2$type === void 0 ? 'full' : _ref2$type,
|
|
102
80
|
resizeIframe = _ref2.resizeIframe,
|
|
103
81
|
rest = _objectWithoutProperties(_ref2, ["children", "type", "resizeIframe"]);
|
|
104
82
|
|
|
@@ -106,20 +84,10 @@ var Figure = function Figure(_ref2) {
|
|
|
106
84
|
return ___EmotionJSX("figure", _extends({
|
|
107
85
|
"data-sizetype": type
|
|
108
86
|
}, classes('', {
|
|
109
|
-
resize: resizeIframe
|
|
87
|
+
resize: !!resizeIframe
|
|
110
88
|
}, typeClass), rest), isFunction(children) ? children({
|
|
111
89
|
typeClass: typeClass
|
|
112
90
|
}) : children);
|
|
113
91
|
};
|
|
114
92
|
|
|
115
|
-
Figure.propTypes = {
|
|
116
|
-
id: PropTypes.string.isRequired,
|
|
117
|
-
children: PropTypes.oneOfType([PropTypes.node.isRequired, PropTypes.func.isRequired]).isRequired,
|
|
118
|
-
type: PropTypes.oneOf(['full', 'full-column', 'left', 'small-left', 'right', 'small-right', 'xsmall-right', 'xsmall-left']),
|
|
119
|
-
resizeIframe: PropTypes.bool,
|
|
120
|
-
noFigcaption: PropTypes.bool
|
|
121
|
-
};
|
|
122
|
-
Figure.defaultProps = {
|
|
123
|
-
type: 'full'
|
|
124
|
-
};
|
|
125
93
|
export default Figure;
|
|
@@ -6,13 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
import PropTypes from 'prop-types';
|
|
10
9
|
import { ArrowCollapse } from '@ndla/icons/common';
|
|
11
10
|
import { ExpandTwoArrows } from '@ndla/icons/action';
|
|
12
11
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
13
12
|
export function FigureExpandButton(_ref) {
|
|
14
|
-
var
|
|
15
|
-
messages = _ref.messages,
|
|
13
|
+
var messages = _ref.messages,
|
|
16
14
|
typeClass = _ref.typeClass;
|
|
17
15
|
return ___EmotionJSX("button", {
|
|
18
16
|
className: "c-figure__fullscreen-btn",
|
|
@@ -27,11 +25,4 @@ export function FigureExpandButton(_ref) {
|
|
|
27
25
|
}), ___EmotionJSX(ExpandTwoArrows, {
|
|
28
26
|
className: "contracted-icon"
|
|
29
27
|
}));
|
|
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
|
-
};
|
|
28
|
+
}
|
|
@@ -10,11 +10,9 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
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
12
|
import React from 'react';
|
|
13
|
-
import PropTypes from 'prop-types';
|
|
14
13
|
import BEMHelper from 'react-bem-helper';
|
|
15
14
|
import { uuid } from '@ndla/util';
|
|
16
15
|
import { LicenseDescription } from '@ndla/licenses';
|
|
17
|
-
import { ContributorShape, LicenseShape } from '../shapes';
|
|
18
16
|
import { jsx as ___EmotionJSX } from "@emotion/core";
|
|
19
17
|
export var classLicenses = new BEMHelper({
|
|
20
18
|
name: 'figure-license',
|
|
@@ -26,7 +24,7 @@ export var FigureLicenseCta = function FigureLicenseCta(_ref) {
|
|
|
26
24
|
authors = _ref.authors,
|
|
27
25
|
origin = _ref.origin,
|
|
28
26
|
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) {
|
|
27
|
+
return ___EmotionJSX("div", classLicenses('cta-wrapper'), ___EmotionJSX("ul", classLicenses('list'), title && ___EmotionJSX("li", classLicenses('item'), "".concat(messages.title, ": ").concat(title)), authors === null || authors === void 0 ? void 0 : authors.map(function (author) {
|
|
30
28
|
return ___EmotionJSX("li", _extends({
|
|
31
29
|
key: uuid()
|
|
32
30
|
}, classLicenses('item')), "".concat(author.type, ": ").concat(author.name));
|
|
@@ -36,39 +34,21 @@ export var FigureLicenseCta = function FigureLicenseCta(_ref) {
|
|
|
36
34
|
rel: "noopener noreferrer"
|
|
37
35
|
}, origin) : origin)), ___EmotionJSX("div", classLicenses('cta-block'), children));
|
|
38
36
|
};
|
|
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
37
|
export var FigureLicenseByline = function FigureLicenseByline(_ref2) {
|
|
50
38
|
var messages = _ref2.messages,
|
|
51
39
|
license = _ref2.license,
|
|
52
40
|
locale = _ref2.locale;
|
|
53
|
-
return
|
|
41
|
+
return ___EmotionJSX(React.Fragment, null, ___EmotionJSX(LicenseDescription, {
|
|
54
42
|
key: "byline",
|
|
55
43
|
highlightCC: true,
|
|
56
44
|
locale: locale,
|
|
57
45
|
messages: messages,
|
|
58
46
|
licenseRights: license.rights
|
|
59
|
-
}), ___EmotionJSX("a", _extends({
|
|
47
|
+
}), ",", ___EmotionJSX("a", _extends({
|
|
60
48
|
key: "link"
|
|
61
49
|
}, classLicenses('link'), {
|
|
62
50
|
target: "_blank",
|
|
63
51
|
rel: "noopener noreferrer",
|
|
64
52
|
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
|
|
53
|
+
}), license.linkText));
|
|
74
54
|
};
|
|
@@ -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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlLnRzeCJdLCJuYW1lcyI6W10sIm1h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XtzaXplc31cbiAgICAgICAgICBsYXp5TG9hZFNyYz17bGF6eUxvYWRTcmN9XG4gICAgICAgIC8+XG4gICAgICA8L1N0eWxlZEltYWdlV3JhcHBlcj5cbiAgICApO1xuICB9XG5cbiAgcmV0dXJuIChcbiAgICA8U3R5bGVkSW1hZ2VXcmFwcGVyPlxuICAgICAgPHBpY3R1cmU+XG4gICAgICAgIDxzb3VyY2UgdHlwZT17Y29udGVudFR5cGV9IHNyY1NldD17c3JjU2V0fSBzaXplcz17c2l6ZXN9IC8+XG4gICAgICAgIDxpbWcgYWx0PXthbHR9IHNyYz17YCR7c3JjfT8ke3F1ZXJ5U3RyaW5nfWB9IHsuLi5yZXN0fSAvPlxuICAgICAgPC9waWN0dXJlPlxuICAgICAge2V4cGFuZEJ1dHRvbn1cbiAgICA8L1N0eWxlZEltYWdlV3JhcHBlcj5cbiAgKTtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IEltYWdlO1xuIl19 */",
|
|
50
49
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
51
50
|
});
|
|
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,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkltYWdlTGluay50c3giXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBYTJCIiwiZmlsZSI6IkltYWdlTGluay50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAxOS1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbmltcG9ydCBSZWFjdCwgeyBSZWFjdE5vZGUgfSBmcm9tICdyZWFjdCc7XG5pbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCc7XG5pbXBvcnQgeyBtYWtlU3JjUXVlcnlTdHJpbmcgfSBmcm9tICcuL0ltYWdlJztcbmltcG9ydCB7IEltYWdlQ3JvcCwgSW1hZ2VGb2NhbFBvaW50IH0gZnJvbSAnLi4vdHlwZXMnO1xuXG5jb25zdCBTdHlsZWRMaW5rID0gc3R5bGVkLmFgXG4gIGJveC1zaGFkb3c6IGluc2V0IDAgMDtcbmA7XG5cbmludGVyZmFjZSBQcm9wcyB7XG4gIHNyYzogc3RyaW5nO1xuICBjaGlsZHJlbjogUmVhY3ROb2RlO1xuICBzaXplcz86IHN0cmluZztcbiAgY3JvcD86IEltYWdlQ3JvcDtcbiAgZm9jYWxQb2ludD86IEltYWdlRm9jYWxQb2ludDtcbn1cblxuZXhwb3J0IGZ1bmN0aW9uIEltYWdlTGluayh7IHNyYywgY3JvcCwgY2hpbGRyZW4sIC4uLnJlc3QgfTogUHJvcHMpIHtcbiAgcmV0dXJuIChcbiAgICA8U3R5bGVkTGlua1xuICAgICAgdGFyZ2V0PVwiX2JsYW5rXCJcbiAgICAgIGhyZWY9e2Ake3NyY30/JHttYWtlU3JjUXVlcnlTdHJpbmcodW5kZWZpbmVkLCBjcm9wKX1gfVxuICAgICAgcmVsPVwibm9vcGVuZXIgbm9yZWZlcnJlclwiXG4gICAgICB7Li4ucmVzdH0+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9TdHlsZWRMaW5rPlxuICApO1xufVxuIl19 */",
|
|
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
|
+
}
|