@ndla/ui 56.0.121-alpha.0 → 56.0.122-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/useComponentTranslations.d.ts +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/locale/messages-en.d.ts +34 -0
- package/lib/locale/messages-nb.d.ts +34 -0
- package/lib/locale/messages-nn.d.ts +34 -0
- package/lib/locale/messages-se.d.ts +34 -0
- package/package.json +6 -5
- package/src/Article/ArticleByline.tsx +1 -1
- package/src/i18n/index.ts +1 -0
- package/src/i18n/useComponentTranslations.ts +36 -1
- package/src/index.ts +1 -0
- package/src/locale/messages-en.ts +34 -0
- package/src/locale/messages-nb.ts +34 -0
- package/src/locale/messages-nn.ts +34 -0
- package/src/locale/messages-se.ts +34 -0
- package/es/Article/Article.js +0 -199
- package/es/Article/ArticleByline.js +0 -182
- package/es/Article/ArticleFootNotes.js +0 -60
- package/es/Article/index.js +0 -11
- package/es/AudioPlayer/AudioPlayer.js +0 -218
- package/es/AudioPlayer/Controls.js +0 -332
- package/es/AudioPlayer/SpeechControl.js +0 -56
- package/es/AudioPlayer/index.js +0 -10
- package/es/Breadcrumb/Breadcrumb.js +0 -60
- package/es/Breadcrumb/BreadcrumbItem.js +0 -62
- package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
- package/es/Breadcrumb/index.js +0 -11
- package/es/CampaignBlock/CampaignBlock.js +0 -180
- package/es/CampaignBlock/index.js +0 -9
- package/es/CodeBlock/CodeBlock.js +0 -35
- package/es/CodeBlock/codeLanguageOptions.js +0 -84
- package/es/CodeBlock/index.js +0 -10
- package/es/Concept/Concept.js +0 -72
- package/es/ContactBlock/ContactBlock.js +0 -199
- package/es/ContactBlock/index.js +0 -9
- package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
- package/es/ContentTypeHero/ContentTypeHero.js +0 -50
- package/es/ContentTypeHero/index.js +0 -9
- package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
- package/es/CopyParagraphButton/index.js +0 -11
- package/es/Embed/AudioEmbed.js +0 -76
- package/es/Embed/BrightcoveEmbed.js +0 -133
- package/es/Embed/CodeEmbed.js +0 -79
- package/es/Embed/ConceptEmbed.js +0 -123
- package/es/Embed/ConceptInlineTriggerButton.js +0 -45
- package/es/Embed/ContentLinkEmbed.js +0 -51
- package/es/Embed/CopyrightEmbed.js +0 -33
- package/es/Embed/EmbedErrorPlaceholder.js +0 -58
- package/es/Embed/EmbedWrapper.js +0 -51
- package/es/Embed/ExternalEmbed.js +0 -74
- package/es/Embed/FootnoteEmbed.js +0 -44
- package/es/Embed/GlossEmbed.js +0 -80
- package/es/Embed/H5pEmbed.js +0 -61
- package/es/Embed/IframeEmbed.js +0 -93
- package/es/Embed/ImageEmbed.js +0 -238
- package/es/Embed/InlineTriggerButton.js +0 -37
- package/es/Embed/RelatedContentEmbed.js +0 -55
- package/es/Embed/UnknownEmbed.js +0 -31
- package/es/Embed/UuDisclaimerEmbed.js +0 -88
- package/es/Embed/index.js +0 -25
- package/es/Embed/types.js +0 -1
- package/es/ErrorMessage/ErrorMessage.js +0 -95
- package/es/ErrorMessage/index.js +0 -10
- package/es/FactBox/FactBox.js +0 -177
- package/es/FactBox/index.js +0 -10
- package/es/FileList/File.js +0 -101
- package/es/FileList/FileList.js +0 -47
- package/es/FileList/PdfFile.js +0 -50
- package/es/FileList/index.js +0 -11
- package/es/Gloss/Gloss.js +0 -175
- package/es/Gloss/GlossExample.js +0 -64
- package/es/Gloss/index.js +0 -10
- package/es/Grid/Grid.js +0 -94
- package/es/Grid/GridParallaxItem.js +0 -32
- package/es/Grid/index.js +0 -10
- package/es/KeyFigure/KeyFigure.js +0 -63
- package/es/KeyFigure/index.js +0 -9
- package/es/LicenseByline/EmbedByline.js +0 -212
- package/es/LicenseByline/LicenseLink.js +0 -56
- package/es/LicenseByline/index.js +0 -10
- package/es/LinkBlock/LinkBlock.js +0 -103
- package/es/LinkBlock/LinkBlockSection.js +0 -35
- package/es/LinkBlock/index.js +0 -10
- package/es/Pitch/Pitch.js +0 -83
- package/es/Pitch/index.js +0 -9
- package/es/RelatedArticleList/RelatedArticleList.js +0 -135
- package/es/RelatedArticleList/index.js +0 -11
- package/es/ResourceBox/ResourceBox.js +0 -99
- package/es/ResourceBox/index.js +0 -10
- package/es/TagSelector/TagSelector.js +0 -143
- package/es/ZendeskButton/ZendeskButton.js +0 -55
- package/es/i18n/formatNestedMessages.js +0 -25
- package/es/i18n/i18n.js +0 -35
- package/es/i18n/index.js +0 -11
- package/es/i18n/useComponentTranslations.js +0 -164
- package/es/index.js +0 -45
- package/es/locale/messages-en.js +0 -428
- package/es/locale/messages-nb.js +0 -428
- package/es/locale/messages-nn.js +0 -428
- package/es/locale/messages-se.js +0 -428
- package/es/model/ContentType.js +0 -68
- package/es/model/SubjectCategories.js +0 -12
- package/es/model/SubjectTypes.js +0 -11
- package/es/model/WordClass.js +0 -45
- package/es/model/index.js +0 -21
- package/es/types.js +0 -1
- package/es/utils/licenseAttributes.js +0 -18
- package/es/utils/relativeUrl.js +0 -37
- package/lib/Article/Article.js +0 -207
- package/lib/Article/ArticleByline.js +0 -189
- package/lib/Article/ArticleFootNotes.js +0 -67
- package/lib/Article/index.js +0 -68
- package/lib/AudioPlayer/AudioPlayer.js +0 -224
- package/lib/AudioPlayer/Controls.js +0 -338
- package/lib/AudioPlayer/SpeechControl.js +0 -62
- package/lib/AudioPlayer/index.js +0 -16
- package/lib/Breadcrumb/Breadcrumb.js +0 -67
- package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
- package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
- package/lib/Breadcrumb/index.js +0 -23
- package/lib/CampaignBlock/CampaignBlock.js +0 -187
- package/lib/CampaignBlock/index.js +0 -13
- package/lib/CodeBlock/CodeBlock.js +0 -41
- package/lib/CodeBlock/codeLanguageOptions.js +0 -90
- package/lib/CodeBlock/index.js +0 -20
- package/lib/Concept/Concept.js +0 -78
- package/lib/ContactBlock/ContactBlock.js +0 -206
- package/lib/ContactBlock/index.js +0 -18
- package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
- package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
- package/lib/ContentTypeHero/index.js +0 -12
- package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
- package/lib/CopyParagraphButton/index.js +0 -22
- package/lib/Embed/AudioEmbed.js +0 -84
- package/lib/Embed/BrightcoveEmbed.js +0 -142
- package/lib/Embed/CodeEmbed.js +0 -86
- package/lib/Embed/ConceptEmbed.js +0 -131
- package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
- package/lib/Embed/ContentLinkEmbed.js +0 -57
- package/lib/Embed/CopyrightEmbed.js +0 -39
- package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
- package/lib/Embed/EmbedWrapper.js +0 -57
- package/lib/Embed/ExternalEmbed.js +0 -81
- package/lib/Embed/FootnoteEmbed.js +0 -50
- package/lib/Embed/GlossEmbed.js +0 -88
- package/lib/Embed/H5pEmbed.js +0 -68
- package/lib/Embed/IframeEmbed.js +0 -100
- package/lib/Embed/ImageEmbed.js +0 -248
- package/lib/Embed/InlineTriggerButton.js +0 -43
- package/lib/Embed/RelatedContentEmbed.js +0 -61
- package/lib/Embed/UnknownEmbed.js +0 -37
- package/lib/Embed/UuDisclaimerEmbed.js +0 -94
- package/lib/Embed/index.js +0 -150
- package/lib/Embed/types.js +0 -5
- package/lib/ErrorMessage/ErrorMessage.js +0 -101
- package/lib/ErrorMessage/index.js +0 -16
- package/lib/FactBox/FactBox.js +0 -184
- package/lib/FactBox/index.js +0 -16
- package/lib/FileList/File.js +0 -108
- package/lib/FileList/FileList.js +0 -54
- package/lib/FileList/PdfFile.js +0 -57
- package/lib/FileList/index.js +0 -44
- package/lib/Gloss/Gloss.js +0 -181
- package/lib/Gloss/GlossExample.js +0 -70
- package/lib/Gloss/index.js +0 -20
- package/lib/Grid/Grid.js +0 -101
- package/lib/Grid/GridParallaxItem.js +0 -39
- package/lib/Grid/index.js +0 -19
- package/lib/KeyFigure/KeyFigure.js +0 -70
- package/lib/KeyFigure/index.js +0 -13
- package/lib/LicenseByline/EmbedByline.js +0 -220
- package/lib/LicenseByline/LicenseLink.js +0 -62
- package/lib/LicenseByline/index.js +0 -19
- package/lib/LinkBlock/LinkBlock.js +0 -110
- package/lib/LinkBlock/LinkBlockSection.js +0 -41
- package/lib/LinkBlock/index.js +0 -20
- package/lib/Pitch/Pitch.js +0 -91
- package/lib/Pitch/index.js +0 -12
- package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
- package/lib/RelatedArticleList/index.js +0 -21
- package/lib/ResourceBox/ResourceBox.js +0 -106
- package/lib/ResourceBox/index.js +0 -13
- package/lib/TagSelector/TagSelector.js +0 -150
- package/lib/ZendeskButton/ZendeskButton.js +0 -61
- package/lib/i18n/formatNestedMessages.js +0 -32
- package/lib/i18n/i18n.js +0 -41
- package/lib/i18n/index.js +0 -62
- package/lib/i18n/useComponentTranslations.js +0 -176
- package/lib/index.js +0 -593
- package/lib/locale/messages-en.js +0 -435
- package/lib/locale/messages-nb.js +0 -435
- package/lib/locale/messages-nn.js +0 -435
- package/lib/locale/messages-se.js +0 -435
- package/lib/model/ContentType.js +0 -74
- package/lib/model/SubjectCategories.js +0 -18
- package/lib/model/SubjectTypes.js +0 -17
- package/lib/model/WordClass.js +0 -51
- package/lib/model/index.js +0 -28
- package/lib/types.js +0 -5
- package/lib/utils/licenseAttributes.js +0 -25
- package/lib/utils/relativeUrl.js +0 -44
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
8
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2023-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
|
-
|
|
19
|
-
const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
20
|
-
base: {
|
|
21
|
-
display: "flex",
|
|
22
|
-
flexDirection: "column",
|
|
23
|
-
alignItems: "center",
|
|
24
|
-
justifyContent: "center",
|
|
25
|
-
gap: "xsmall",
|
|
26
|
-
"&:not(:has(> img))": {
|
|
27
|
-
paddingBlock: "xxlarge"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const StyledImage = (0, _jsx2.styled)("img", {
|
|
32
|
-
base: {
|
|
33
|
-
height: "surface.3xsmall",
|
|
34
|
-
width: "surface.3xsmall",
|
|
35
|
-
borderRadius: "xsmall"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const TitleWrapper = (0, _jsx2.styled)("div", {
|
|
39
|
-
base: {
|
|
40
|
-
textStyle: "heading.large",
|
|
41
|
-
textAlign: "center"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
const SubTitleWrapper = (0, _jsx2.styled)("div", {
|
|
45
|
-
base: {
|
|
46
|
-
textStyle: "title.medium",
|
|
47
|
-
textAlign: "center"
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
const KeyFigure = _ref => {
|
|
51
|
-
let {
|
|
52
|
-
image,
|
|
53
|
-
title,
|
|
54
|
-
subtitle
|
|
55
|
-
} = _ref;
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
57
|
-
"data-embed-type": "key-figure",
|
|
58
|
-
children: [!!image && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
|
|
59
|
-
src: `${image?.src}?width=150`,
|
|
60
|
-
width: 150,
|
|
61
|
-
height: 150,
|
|
62
|
-
alt: image?.alt
|
|
63
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(TitleWrapper, {
|
|
64
|
-
children: (0, _htmlReactParser.default)(title)
|
|
65
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(SubTitleWrapper, {
|
|
66
|
-
children: (0, _htmlReactParser.default)(subtitle)
|
|
67
|
-
})]
|
|
68
|
-
});
|
|
69
|
-
};
|
|
70
|
-
var _default = exports.default = KeyFigure;
|
package/lib/KeyFigure/index.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "KeyFigure", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _KeyFigure.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _KeyFigure = _interopRequireDefault(require("./KeyFigure"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,220 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LicenseContainerContent = exports.EmbedByline = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _reactI18next = require("react-i18next");
|
|
9
|
-
var _icons = require("@ndla/icons");
|
|
10
|
-
var _licenses = require("@ndla/licenses");
|
|
11
|
-
var _primitives = require("@ndla/primitives");
|
|
12
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
13
|
-
var _LicenseLink = require("./LicenseLink");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
/**
|
|
16
|
-
* Copyright (c) 2023-present, NDLA.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const BylineWrapper = (0, _jsx2.styled)("figcaption", {
|
|
24
|
-
base: {
|
|
25
|
-
display: "flex",
|
|
26
|
-
flexDirection: "column",
|
|
27
|
-
paddingBlock: "xsmall",
|
|
28
|
-
textStyle: "label.medium",
|
|
29
|
-
color: "text.subtle"
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const ErrorBylineWrapper = (0, _jsx2.styled)(BylineWrapper, {
|
|
33
|
-
base: {
|
|
34
|
-
border: "1px solid",
|
|
35
|
-
borderColor: "stroke.error",
|
|
36
|
-
borderRadius: "xsmall",
|
|
37
|
-
background: "surface.dangerSubtle",
|
|
38
|
-
paddingInline: "medium",
|
|
39
|
-
paddingBlock: "medium"
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
const StyledText = (0, _jsx2.styled)(_primitives.Text, {
|
|
43
|
-
base: {
|
|
44
|
-
fontStyle: "italic"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
48
|
-
base: {
|
|
49
|
-
display: "flex",
|
|
50
|
-
gap: "xsmall",
|
|
51
|
-
alignItems: "center",
|
|
52
|
-
textStyle: "label.medium"
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
const BaseDescription = (0, _jsx2.styled)("div", {
|
|
56
|
-
base: {
|
|
57
|
-
display: "inline-flex",
|
|
58
|
-
whiteSpace: "pre-wrap"
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
const EmbedByline = _ref => {
|
|
62
|
-
let {
|
|
63
|
-
type,
|
|
64
|
-
description,
|
|
65
|
-
children,
|
|
66
|
-
visibleAlt,
|
|
67
|
-
hideCopyright,
|
|
68
|
-
...props
|
|
69
|
-
} = _ref;
|
|
70
|
-
const {
|
|
71
|
-
t
|
|
72
|
-
} = (0, _reactI18next.useTranslation)();
|
|
73
|
-
if (props.error) {
|
|
74
|
-
const typeString = type === "h5p" ? "H5P" : t(`embed.type.${type}`).toLowerCase();
|
|
75
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ErrorBylineWrapper, {
|
|
76
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
77
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AlertLine, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(BaseDescription, {
|
|
78
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
79
|
-
children: t("embed.embedError", {
|
|
80
|
-
type: typeString
|
|
81
|
-
})
|
|
82
|
-
})
|
|
83
|
-
})]
|
|
84
|
-
})
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
const {
|
|
88
|
-
copyright
|
|
89
|
-
} = props;
|
|
90
|
-
const hideByline = hideCopyright && !description;
|
|
91
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
92
|
-
children: [!hideByline && /*#__PURE__*/(0, _jsxRuntime.jsx)(BylineWrapper, {
|
|
93
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
94
|
-
children: [!!hideCopyright && description, !hideCopyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(LicenseContainerContent, {
|
|
95
|
-
type: type,
|
|
96
|
-
copyright: copyright,
|
|
97
|
-
children: description
|
|
98
|
-
}), children]
|
|
99
|
-
})
|
|
100
|
-
}), visibleAlt ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, {
|
|
101
|
-
color: "text.subtle",
|
|
102
|
-
textStyle: "label.medium",
|
|
103
|
-
asChild: true,
|
|
104
|
-
consumeCss: true,
|
|
105
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
106
|
-
children: `Alt: ${visibleAlt}`
|
|
107
|
-
})
|
|
108
|
-
}) : null]
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
exports.EmbedByline = EmbedByline;
|
|
112
|
-
const StyledDescription = (0, _jsx2.styled)(BaseDescription, {
|
|
113
|
-
base: {
|
|
114
|
-
mobileWideDown: {
|
|
115
|
-
display: "grid",
|
|
116
|
-
gridTemplateColumns: "1fr auto",
|
|
117
|
-
alignItems: "center",
|
|
118
|
-
overflow: "hidden",
|
|
119
|
-
_open: {
|
|
120
|
-
display: "inline"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
const TextContent = (0, _jsx2.styled)("span", {
|
|
126
|
-
base: {
|
|
127
|
-
mobileWideDown: {
|
|
128
|
-
whiteSpace: "nowrap",
|
|
129
|
-
maxHeight: "large",
|
|
130
|
-
overflow: "hidden",
|
|
131
|
-
textOverflow: "ellipsis",
|
|
132
|
-
transitionProperty: "max-height",
|
|
133
|
-
transitionDuration: "slow",
|
|
134
|
-
transitionTimingFunction: "ease-in",
|
|
135
|
-
marginInlineEnd: "4xsmall",
|
|
136
|
-
_open: {
|
|
137
|
-
whiteSpace: "pre-wrap",
|
|
138
|
-
maxHeight: "none"
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const StyledButton = (0, _jsx2.styled)(_primitives.Button, {
|
|
144
|
-
base: {
|
|
145
|
-
mobileWide: {
|
|
146
|
-
display: "none"
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const LicenseDescription = _ref2 => {
|
|
151
|
-
let {
|
|
152
|
-
children,
|
|
153
|
-
isOpen,
|
|
154
|
-
setIsOpen
|
|
155
|
-
} = _ref2;
|
|
156
|
-
const open = isOpen ? {
|
|
157
|
-
"data-open": ""
|
|
158
|
-
} : {};
|
|
159
|
-
const {
|
|
160
|
-
t
|
|
161
|
-
} = (0, _reactI18next.useTranslation)();
|
|
162
|
-
const handleToggle = () => {
|
|
163
|
-
setIsOpen(!isOpen);
|
|
164
|
-
};
|
|
165
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(ContentWrapper, {
|
|
166
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledDescription, {
|
|
167
|
-
...open,
|
|
168
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(TextContent, {
|
|
169
|
-
...open,
|
|
170
|
-
children: children
|
|
171
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledButton, {
|
|
172
|
-
variant: "link",
|
|
173
|
-
size: "small",
|
|
174
|
-
onClick: handleToggle,
|
|
175
|
-
children: isOpen ? `${t("audio.readLessDescriptionLabel")}` : `${t("audio.readMoreDescriptionLabel")}`
|
|
176
|
-
})]
|
|
177
|
-
})
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
const LicenseContainerContent = _ref3 => {
|
|
181
|
-
let {
|
|
182
|
-
children,
|
|
183
|
-
copyright,
|
|
184
|
-
type
|
|
185
|
-
} = _ref3;
|
|
186
|
-
const {
|
|
187
|
-
t,
|
|
188
|
-
i18n
|
|
189
|
-
} = (0, _reactI18next.useTranslation)();
|
|
190
|
-
const license = copyright ? (0, _licenses.getLicenseByAbbreviation)(copyright.license?.license ?? "", i18n.language) : undefined;
|
|
191
|
-
const authors = (0, _licenses.getLicenseCredits)(copyright);
|
|
192
|
-
const captionAuthors = Object.values(authors).find(i => i.length > 0) ?? [];
|
|
193
|
-
const [isOpen, setIsOpen] = (0, _react.useState)(false);
|
|
194
|
-
const content = /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
195
|
-
children: [children, ` ${t(`embed.type.${type}`)}${captionAuthors.length ? ": " : ""}`, /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
196
|
-
children: captionAuthors.map(author => author.name).join(", ")
|
|
197
|
-
}), license ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
198
|
-
children: [" / ", /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseLink.LicenseLink, {
|
|
199
|
-
license: license,
|
|
200
|
-
hideLink: !isOpen && !!children
|
|
201
|
-
})]
|
|
202
|
-
}) : null]
|
|
203
|
-
});
|
|
204
|
-
if (children) {
|
|
205
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(LicenseDescription, {
|
|
206
|
-
isOpen: isOpen,
|
|
207
|
-
setIsOpen: setIsOpen,
|
|
208
|
-
children: content
|
|
209
|
-
});
|
|
210
|
-
}
|
|
211
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
212
|
-
textStyle: "label.medium",
|
|
213
|
-
asChild: true,
|
|
214
|
-
consumeCss: true,
|
|
215
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
216
|
-
children: content
|
|
217
|
-
})
|
|
218
|
-
});
|
|
219
|
-
};
|
|
220
|
-
exports.LicenseContainerContent = LicenseContainerContent;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.LicenseLink = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _safelink = require("@ndla/safelink");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2023-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
|
-
|
|
19
|
-
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
20
|
-
base: {
|
|
21
|
-
color: "text.link",
|
|
22
|
-
textDecoration: "underline",
|
|
23
|
-
whiteSpace: "nowrap",
|
|
24
|
-
_hover: {
|
|
25
|
-
textDecoration: "none"
|
|
26
|
-
},
|
|
27
|
-
_focusWithin: {
|
|
28
|
-
textDecoration: "none"
|
|
29
|
-
},
|
|
30
|
-
mobileWideDown: {
|
|
31
|
-
_disabled: {
|
|
32
|
-
display: "none"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
const LicenseLink = exports.LicenseLink = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
38
|
-
let {
|
|
39
|
-
license,
|
|
40
|
-
hideLink,
|
|
41
|
-
...rest
|
|
42
|
-
} = _ref;
|
|
43
|
-
const disabled = hideLink ? {
|
|
44
|
-
"data-disabled": ""
|
|
45
|
-
} : {};
|
|
46
|
-
if (license.abbreviation === "unknown") {
|
|
47
|
-
return null;
|
|
48
|
-
}
|
|
49
|
-
if (license.url?.length) {
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
|
|
51
|
-
to: license.url,
|
|
52
|
-
rel: "license",
|
|
53
|
-
...disabled,
|
|
54
|
-
...rest,
|
|
55
|
-
ref: ref,
|
|
56
|
-
children: license.abbreviation
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
60
|
-
children: license.abbreviation
|
|
61
|
-
});
|
|
62
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "EmbedByline", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _EmbedByline.EmbedByline;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "LicenseLink", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _LicenseLink.LicenseLink;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _EmbedByline = require("./EmbedByline");
|
|
19
|
-
var _LicenseLink = require("./LicenseLink");
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
var _icons = require("@ndla/icons");
|
|
10
|
-
var _primitives = require("@ndla/primitives");
|
|
11
|
-
var _safelink = require("@ndla/safelink");
|
|
12
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
13
|
-
var _relativeUrl = require("../utils/relativeUrl");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
/**
|
|
17
|
-
* Copyright (c) 2023-present, NDLA.
|
|
18
|
-
*
|
|
19
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
20
|
-
* LICENSE file in the root directory of this source tree.
|
|
21
|
-
*
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
const InfoWrapper = (0, _jsx2.styled)("div", {
|
|
25
|
-
base: {
|
|
26
|
-
display: "flex",
|
|
27
|
-
flexDirection: "column",
|
|
28
|
-
gap: "xsmall"
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
32
|
-
base: {
|
|
33
|
-
display: "flex",
|
|
34
|
-
justifyContent: "space-between",
|
|
35
|
-
alignItems: "center",
|
|
36
|
-
background: "surface.default",
|
|
37
|
-
padding: "medium",
|
|
38
|
-
border: "1px solid",
|
|
39
|
-
borderColor: "stroke.subtle",
|
|
40
|
-
borderRadius: "xsmall",
|
|
41
|
-
"& h3": {
|
|
42
|
-
textDecoration: "underline"
|
|
43
|
-
},
|
|
44
|
-
"& [data-forward]": {
|
|
45
|
-
transitionProperty: "width, height",
|
|
46
|
-
transitionTimingFunction: "ease-in-out",
|
|
47
|
-
transitionDuration: "fast"
|
|
48
|
-
},
|
|
49
|
-
_hover: {
|
|
50
|
-
"& h3": {
|
|
51
|
-
textDecoration: "none"
|
|
52
|
-
},
|
|
53
|
-
"& [data-forward]": {
|
|
54
|
-
width: "large",
|
|
55
|
-
height: "large"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
});
|
|
60
|
-
const StyledDateContainer = (0, _jsx2.styled)("div", {
|
|
61
|
-
base: {
|
|
62
|
-
display: "flex",
|
|
63
|
-
alignItems: "center",
|
|
64
|
-
gap: "xxsmall"
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
const StyledCalendarEd = (0, _jsx2.styled)(_icons.CalendarLine, {
|
|
68
|
-
base: {
|
|
69
|
-
color: "icon.strong"
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const LinkBlock = _ref => {
|
|
73
|
-
let {
|
|
74
|
-
title,
|
|
75
|
-
articleLanguage,
|
|
76
|
-
date,
|
|
77
|
-
url,
|
|
78
|
-
path
|
|
79
|
-
} = _ref;
|
|
80
|
-
const href = (0, _relativeUrl.getPossiblyRelativeUrl)(url, path);
|
|
81
|
-
const formattedDate = (0, _react.useMemo)(() => {
|
|
82
|
-
if (!date) return null;
|
|
83
|
-
return new Intl.DateTimeFormat(articleLanguage, {
|
|
84
|
-
timeZone: "CET",
|
|
85
|
-
day: "2-digit",
|
|
86
|
-
month: "long",
|
|
87
|
-
year: "numeric"
|
|
88
|
-
}).format(new Date(date));
|
|
89
|
-
}, [date, articleLanguage]);
|
|
90
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledSafeLink, {
|
|
91
|
-
to: href,
|
|
92
|
-
"data-embed-type": "link-block",
|
|
93
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(InfoWrapper, {
|
|
94
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
|
|
95
|
-
asChild: true,
|
|
96
|
-
consumeCss: true,
|
|
97
|
-
textStyle: "title.medium",
|
|
98
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("h3", {
|
|
99
|
-
"data-heading": true,
|
|
100
|
-
children: (0, _htmlReactParser.default)(title)
|
|
101
|
-
})
|
|
102
|
-
}), !!date && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledDateContainer, {
|
|
103
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCalendarEd, {}), formattedDate]
|
|
104
|
-
})]
|
|
105
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightLine, {
|
|
106
|
-
"data-forward": true
|
|
107
|
-
})]
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
var _default = exports.default = LinkBlock;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
-
/**
|
|
11
|
-
* Copyright (c) 2023-present, NDLA.
|
|
12
|
-
*
|
|
13
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const StyledList = (0, _jsx2.styled)("ul", {
|
|
19
|
-
base: {
|
|
20
|
-
display: "flex",
|
|
21
|
-
flexDirection: "column",
|
|
22
|
-
gap: "xsmall",
|
|
23
|
-
listStyle: "none"
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
const LinkBlockSection = _ref => {
|
|
27
|
-
let {
|
|
28
|
-
children,
|
|
29
|
-
...rest
|
|
30
|
-
} = _ref;
|
|
31
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
32
|
-
...rest,
|
|
33
|
-
"data-embed-type": "link-block-list",
|
|
34
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
|
|
35
|
-
children: _react.Children.map(children, child => /*#__PURE__*/(0, _jsxRuntime.jsx)("li", {
|
|
36
|
-
children: child
|
|
37
|
-
}))
|
|
38
|
-
})
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
var _default = exports.default = LinkBlockSection;
|
package/lib/LinkBlock/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "LinkBlock", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _LinkBlock.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "LinkBlockSection", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _LinkBlockSection.default;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _LinkBlock = _interopRequireDefault(require("./LinkBlock"));
|
|
19
|
-
var _LinkBlockSection = _interopRequireDefault(require("./LinkBlockSection"));
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/Pitch/Pitch.js
DELETED
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Pitch = void 0;
|
|
7
|
-
var _htmlReactParser = _interopRequireDefault(require("html-react-parser"));
|
|
8
|
-
var _primitives = require("@ndla/primitives");
|
|
9
|
-
var _safelink = require("@ndla/safelink");
|
|
10
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
-
var _patterns = require("@ndla/styled-system/patterns");
|
|
12
|
-
var _relativeUrl = require("../utils/relativeUrl");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
-
/**
|
|
16
|
-
* Copyright (c) 2024-present, NDLA.
|
|
17
|
-
*
|
|
18
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
19
|
-
* LICENSE file in the root directory of this source tree.
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
const StyledCardHeading = (0, _jsx2.styled)(_primitives.CardHeading, {
|
|
24
|
-
base: {
|
|
25
|
-
paddingBlockStart: "medium"
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
const StyledText = (0, _jsx2.styled)(_primitives.Text, {
|
|
29
|
-
base: {
|
|
30
|
-
paddingBlockEnd: "medium"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const StyledCardRoot = (0, _jsx2.styled)(_primitives.CardRoot, {
|
|
34
|
-
base: {
|
|
35
|
-
border: "0",
|
|
36
|
-
display: "flex",
|
|
37
|
-
flexDirection: "column",
|
|
38
|
-
gap: "small"
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const StyledCardImage = (0, _jsx2.styled)(_primitives.CardImage, {
|
|
42
|
-
base: {
|
|
43
|
-
aspectRatio: "16/9",
|
|
44
|
-
height: "unset"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const Pitch = _ref => {
|
|
48
|
-
let {
|
|
49
|
-
title,
|
|
50
|
-
url,
|
|
51
|
-
metaImage,
|
|
52
|
-
path,
|
|
53
|
-
description
|
|
54
|
-
} = _ref;
|
|
55
|
-
const href = (0, _relativeUrl.getPossiblyRelativeUrl)(url, path);
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCardRoot, {
|
|
57
|
-
variant: "subtle",
|
|
58
|
-
"data-embed-type": "pitch",
|
|
59
|
-
asChild: true,
|
|
60
|
-
consumeCss: true,
|
|
61
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
62
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCardHeading, {
|
|
63
|
-
textStyle: "heading.small",
|
|
64
|
-
asChild: true,
|
|
65
|
-
consumeCss: true,
|
|
66
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
67
|
-
to: href,
|
|
68
|
-
unstyled: true,
|
|
69
|
-
css: _patterns.linkOverlay.raw(),
|
|
70
|
-
children: (0, _htmlReactParser.default)(title)
|
|
71
|
-
})
|
|
72
|
-
}), !!description && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, {
|
|
73
|
-
textStyle: "body.xlarge",
|
|
74
|
-
asChild: true,
|
|
75
|
-
consumeCss: true,
|
|
76
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
77
|
-
children: (0, _htmlReactParser.default)(description)
|
|
78
|
-
})
|
|
79
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCardImage, {
|
|
80
|
-
variant: "rounded",
|
|
81
|
-
src: metaImage.url,
|
|
82
|
-
alt: metaImage.alt,
|
|
83
|
-
sizes: "480px",
|
|
84
|
-
fallbackWidth: 300,
|
|
85
|
-
width: 550,
|
|
86
|
-
height: 310
|
|
87
|
-
})]
|
|
88
|
-
})
|
|
89
|
-
});
|
|
90
|
-
};
|
|
91
|
-
exports.Pitch = Pitch;
|
package/lib/Pitch/index.js
DELETED