@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,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _reactI18next = require("react-i18next");
|
|
8
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
9
|
-
var _BreadcrumbItem = _interopRequireDefault(require("./BreadcrumbItem"));
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) 2016-present, NDLA.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
const StyledList = (0, _jsx2.styled)("ol", {
|
|
21
|
-
base: {
|
|
22
|
-
display: "flex",
|
|
23
|
-
flexWrap: "wrap",
|
|
24
|
-
alignItems: "center",
|
|
25
|
-
listStyle: "none",
|
|
26
|
-
gap: "xxsmall",
|
|
27
|
-
mobileDown: {
|
|
28
|
-
alignItems: "flex-start",
|
|
29
|
-
justifyContent: "center",
|
|
30
|
-
flexDirection: "column"
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
const Breadcrumb = _ref => {
|
|
35
|
-
let {
|
|
36
|
-
items,
|
|
37
|
-
renderItem,
|
|
38
|
-
renderSeparator,
|
|
39
|
-
collapseFirst,
|
|
40
|
-
collapseLast = true
|
|
41
|
-
} = _ref;
|
|
42
|
-
const {
|
|
43
|
-
t
|
|
44
|
-
} = (0, _reactI18next.useTranslation)();
|
|
45
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("nav", {
|
|
46
|
-
"aria-label": t("breadcrumb.breadcrumb"),
|
|
47
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledList, {
|
|
48
|
-
children: items.map((item, index) => /*#__PURE__*/(0, _jsxRuntime.jsx)(_BreadcrumbItem.default, {
|
|
49
|
-
renderItem: renderItem,
|
|
50
|
-
renderSeparator: renderSeparator,
|
|
51
|
-
ref: element => {
|
|
52
|
-
if (element === null || !collapseFirst && index === 0 || !collapseLast && index === items.length - 1) {
|
|
53
|
-
if (element) {
|
|
54
|
-
element.setMaxWidth("none");
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
totalCount: items.length,
|
|
59
|
-
item: {
|
|
60
|
-
...item,
|
|
61
|
-
index
|
|
62
|
-
}
|
|
63
|
-
}, typeof item.to === "string" ? item.to : item.to.pathname))
|
|
64
|
-
})
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
var _default = exports.default = Breadcrumb;
|
|
@@ -1,68 +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 _icons = require("@ndla/icons");
|
|
9
|
-
var _safelink = require("@ndla/safelink");
|
|
10
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
/**
|
|
13
|
-
* Copyright (c) 2016-present, NDLA.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
const StyledListItem = (0, _jsx2.styled)("li", {
|
|
21
|
-
base: {
|
|
22
|
-
display: "flex",
|
|
23
|
-
color: "inherit",
|
|
24
|
-
gap: "3xsmall",
|
|
25
|
-
alignItems: "flex-end",
|
|
26
|
-
tabletDown: {
|
|
27
|
-
display: "block"
|
|
28
|
-
},
|
|
29
|
-
"& a": {
|
|
30
|
-
_visited: {
|
|
31
|
-
color: "inherit"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
const BreadcrumbItem = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
37
|
-
let {
|
|
38
|
-
renderItem,
|
|
39
|
-
renderSeparator,
|
|
40
|
-
item,
|
|
41
|
-
totalCount
|
|
42
|
-
} = _ref;
|
|
43
|
-
const liRef = (0, _react.useRef)(null);
|
|
44
|
-
(0, _react.useImperativeHandle)(ref, () => ({
|
|
45
|
-
setMaxWidth: maxWidth => {
|
|
46
|
-
liRef.current.children[0].style.maxWidth = maxWidth;
|
|
47
|
-
}
|
|
48
|
-
}));
|
|
49
|
-
const {
|
|
50
|
-
to,
|
|
51
|
-
name,
|
|
52
|
-
index
|
|
53
|
-
} = item;
|
|
54
|
-
const isLast = index === totalCount - 1;
|
|
55
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledListItem, {
|
|
56
|
-
ref: liRef,
|
|
57
|
-
"aria-current": isLast ? "page" : undefined,
|
|
58
|
-
children: [renderItem ? renderItem(item, totalCount) : isLast ? /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
59
|
-
children: name
|
|
60
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
61
|
-
to: to,
|
|
62
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
63
|
-
children: name
|
|
64
|
-
})
|
|
65
|
-
}), renderSeparator ? renderSeparator(item, totalCount) : !isLast && /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightShortLine, {})]
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
var _default = exports.default = BreadcrumbItem;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _icons = require("@ndla/icons");
|
|
8
|
-
var _safelink = require("@ndla/safelink");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
|
|
11
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
|
-
/**
|
|
14
|
-
* Copyright (c) 2022-present, NDLA.
|
|
15
|
-
*
|
|
16
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
17
|
-
* LICENSE file in the root directory of this source tree.
|
|
18
|
-
*
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
22
|
-
base: {
|
|
23
|
-
color: "inherit",
|
|
24
|
-
textDecoration: "underline",
|
|
25
|
-
_hover: {
|
|
26
|
-
textDecoration: "none"
|
|
27
|
-
},
|
|
28
|
-
_focusVisible: {
|
|
29
|
-
textDecoration: "none"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
const StyledArrowRight = (0, _jsx2.styled)(_icons.ArrowRightShortLine, {
|
|
34
|
-
base: {
|
|
35
|
-
tabletDown: {
|
|
36
|
-
display: "none"
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
const IconSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
41
|
-
base: {
|
|
42
|
-
color: "inherit"
|
|
43
|
-
}
|
|
44
|
-
});
|
|
45
|
-
const HomeBreadcrumb = _ref => {
|
|
46
|
-
let {
|
|
47
|
-
items
|
|
48
|
-
} = _ref;
|
|
49
|
-
const renderItem = (item, totalCount) => {
|
|
50
|
-
if (item.index === totalCount - 1) {
|
|
51
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
52
|
-
children: item.name
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
if (item.index === 0 && typeof item.name === "string") {
|
|
56
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(IconSafeLink, {
|
|
57
|
-
"aria-label": item.name,
|
|
58
|
-
to: item.to,
|
|
59
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.HomeLine, {
|
|
60
|
-
title: item.name
|
|
61
|
-
})
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
|
|
65
|
-
to: item.to,
|
|
66
|
-
children: item.name
|
|
67
|
-
});
|
|
68
|
-
};
|
|
69
|
-
const renderSeparator = (item, totalCount) => {
|
|
70
|
-
if (item.index === totalCount - 1) {
|
|
71
|
-
return null;
|
|
72
|
-
}
|
|
73
|
-
if (item.index === 0) {
|
|
74
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledArrowRight, {});
|
|
75
|
-
}
|
|
76
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightShortLine, {});
|
|
77
|
-
};
|
|
78
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Breadcrumb.default, {
|
|
79
|
-
items: items,
|
|
80
|
-
renderItem: renderItem,
|
|
81
|
-
renderSeparator: renderSeparator
|
|
82
|
-
});
|
|
83
|
-
};
|
|
84
|
-
var _default = exports.default = HomeBreadcrumb;
|
package/lib/Breadcrumb/index.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "HomeBreadcrumb", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _HomeBreadcrumb.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
exports.default = void 0;
|
|
13
|
-
var _Breadcrumb = _interopRequireDefault(require("./Breadcrumb"));
|
|
14
|
-
var _HomeBreadcrumb = _interopRequireDefault(require("./HomeBreadcrumb"));
|
|
15
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
16
|
-
/**
|
|
17
|
-
* Copyright (c) 2016-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
|
-
var _default = exports.default = _Breadcrumb.default;
|
|
@@ -1,187 +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 _icons = require("@ndla/icons");
|
|
9
|
-
var _primitives = require("@ndla/primitives");
|
|
10
|
-
var _safelink = require("@ndla/safelink");
|
|
11
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
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) 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 Wrapper = (0, _jsx2.styled)("div", {
|
|
24
|
-
base: {
|
|
25
|
-
width: "100%",
|
|
26
|
-
height: "100%",
|
|
27
|
-
containerType: "inline-size"
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
const Container = (0, _jsx2.styled)("div", {
|
|
31
|
-
base: {
|
|
32
|
-
display: "grid",
|
|
33
|
-
gridTemplateColumns: "1fr",
|
|
34
|
-
border: "1px solid",
|
|
35
|
-
borderColor: "stroke.default",
|
|
36
|
-
backgroundColor: "background.default",
|
|
37
|
-
borderRadius: "xsmall",
|
|
38
|
-
boxShadow: "full",
|
|
39
|
-
overflow: "hidden"
|
|
40
|
-
},
|
|
41
|
-
variants: {
|
|
42
|
-
imageSide: {
|
|
43
|
-
left: {
|
|
44
|
-
"@/tablet": {
|
|
45
|
-
gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
|
|
46
|
-
},
|
|
47
|
-
"@supports not (container-type: inline-size)": {
|
|
48
|
-
tabletWide: {
|
|
49
|
-
gridTemplateColumns: "minmax(230px, 455px) auto"
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
},
|
|
53
|
-
right: {
|
|
54
|
-
"@/tablet": {
|
|
55
|
-
gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
|
|
56
|
-
},
|
|
57
|
-
"@supports not (container-type: inline-size)": {
|
|
58
|
-
tabletWide: {
|
|
59
|
-
gridTemplateColumns: "auto minmax(230px, 455px)"
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
background: {
|
|
65
|
-
neutral: {},
|
|
66
|
-
brand1: {
|
|
67
|
-
backgroundColor: "surface.brand.1"
|
|
68
|
-
},
|
|
69
|
-
brand3: {
|
|
70
|
-
backgroundColor: "surface.brand.3"
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
},
|
|
74
|
-
defaultVariants: {
|
|
75
|
-
imageSide: "left",
|
|
76
|
-
background: "neutral"
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
|
-
const StyledImg = (0, _jsx2.styled)("img", {
|
|
80
|
-
base: {
|
|
81
|
-
objectFit: "cover",
|
|
82
|
-
width: "100%",
|
|
83
|
-
height: "215px",
|
|
84
|
-
"@/tablet": {
|
|
85
|
-
height: "340px"
|
|
86
|
-
},
|
|
87
|
-
"@supports not (container-type: inline-size)": {
|
|
88
|
-
tablet: {
|
|
89
|
-
height: "265px"
|
|
90
|
-
},
|
|
91
|
-
tabletWide: {
|
|
92
|
-
height: "340px"
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
backgroundColor: "background.default"
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
99
|
-
base: {
|
|
100
|
-
width: "100%",
|
|
101
|
-
display: "flex",
|
|
102
|
-
flexDirection: "column",
|
|
103
|
-
gap: "medium",
|
|
104
|
-
alignItems: "flex-start",
|
|
105
|
-
justifyContent: "center",
|
|
106
|
-
paddingBlock: "medium",
|
|
107
|
-
paddingInline: "medium",
|
|
108
|
-
position: "relative"
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
const StyledText = (0, _jsx2.styled)(_primitives.Text, {
|
|
112
|
-
base: {
|
|
113
|
-
tablet: {
|
|
114
|
-
display: "block",
|
|
115
|
-
overflow: "hidden",
|
|
116
|
-
position: "relative",
|
|
117
|
-
lineClamp: 4,
|
|
118
|
-
boxOrient: "vertical"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
const StyledSafeLinkButton = (0, _jsx2.styled)(_safelink.SafeLinkButton, {
|
|
123
|
-
base: {
|
|
124
|
-
boxShadow: "full",
|
|
125
|
-
border: "1px solid",
|
|
126
|
-
borderColor: "stroke.default"
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
const LinkButton = _ref => {
|
|
130
|
-
let {
|
|
131
|
-
url,
|
|
132
|
-
children,
|
|
133
|
-
path
|
|
134
|
-
} = _ref;
|
|
135
|
-
if (url) return /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLinkButton, {
|
|
136
|
-
to: (0, _relativeUrl.getPossiblyRelativeUrl)(url, path),
|
|
137
|
-
variant: "secondary",
|
|
138
|
-
rel: "noopener noreferrer",
|
|
139
|
-
children: children
|
|
140
|
-
});
|
|
141
|
-
return children;
|
|
142
|
-
};
|
|
143
|
-
const CampaignBlock = _ref2 => {
|
|
144
|
-
let {
|
|
145
|
-
title,
|
|
146
|
-
image,
|
|
147
|
-
imageSide = "left",
|
|
148
|
-
description,
|
|
149
|
-
headingLevel: InternalHeading = "h2",
|
|
150
|
-
url,
|
|
151
|
-
path,
|
|
152
|
-
className,
|
|
153
|
-
background
|
|
154
|
-
} = _ref2;
|
|
155
|
-
const imageComponent = image && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImg, {
|
|
156
|
-
src: `${image.src}?width=455`,
|
|
157
|
-
height: 340,
|
|
158
|
-
width: 455,
|
|
159
|
-
alt: image.alt
|
|
160
|
-
});
|
|
161
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Wrapper, {
|
|
162
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
163
|
-
className: className,
|
|
164
|
-
"data-embed-type": "campaign-block",
|
|
165
|
-
imageSide: imageSide,
|
|
166
|
-
background: background,
|
|
167
|
-
children: [imageSide === "left" && imageComponent, /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
168
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
169
|
-
asChild: true,
|
|
170
|
-
consumeCss: true,
|
|
171
|
-
textStyle: "heading.small",
|
|
172
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalHeading, {
|
|
173
|
-
children: (0, _htmlReactParser.default)(title)
|
|
174
|
-
})
|
|
175
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledText, {
|
|
176
|
-
textStyle: "body.xlarge",
|
|
177
|
-
children: (0, _htmlReactParser.default)(description)
|
|
178
|
-
}), !!url?.url && /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinkButton, {
|
|
179
|
-
url: url.url,
|
|
180
|
-
path: path,
|
|
181
|
-
children: [(0, _htmlReactParser.default)(url.text ?? ""), /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.ArrowRightLine, {})]
|
|
182
|
-
})]
|
|
183
|
-
}), imageSide !== "left" && imageComponent]
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
};
|
|
187
|
-
var _default = exports.default = CampaignBlock;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "CampaignBlock", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CampaignBlock.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
var _CampaignBlock = _interopRequireDefault(require("./CampaignBlock"));
|
|
13
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.Codeblock = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _css = require("@ndla/styled-system/css");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
-
/**
|
|
12
|
-
* Copyright (c) 2020-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 Pre = (0, _jsx2.styled)("pre", {});
|
|
20
|
-
const Codeblock = exports.Codeblock = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
21
|
-
let {
|
|
22
|
-
highlightedCode,
|
|
23
|
-
format,
|
|
24
|
-
className,
|
|
25
|
-
...props
|
|
26
|
-
} = _ref;
|
|
27
|
-
const codeWithLineNumbers = (0, _react.useMemo)(() => {
|
|
28
|
-
return highlightedCode.split("\n").map((line, i) => {
|
|
29
|
-
return `<span class="linenumber">${i + 1}</span>${line}`;
|
|
30
|
-
}).join("\n");
|
|
31
|
-
}, [highlightedCode]);
|
|
32
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(Pre, {
|
|
33
|
-
className: (0, _css.cx)("codeblock", `language-${format}`, className),
|
|
34
|
-
...props,
|
|
35
|
-
dangerouslySetInnerHTML: {
|
|
36
|
-
__html: codeWithLineNumbers
|
|
37
|
-
},
|
|
38
|
-
ref: ref
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
var _default = exports.default = Codeblock;
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.codeLanguageOptions = void 0;
|
|
7
|
-
/**
|
|
8
|
-
* Copyright (c) 2019-present, NDLA.
|
|
9
|
-
*
|
|
10
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
11
|
-
* LICENSE file in the root directory of this source tree.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
const codeLanguageOptions = exports.codeLanguageOptions = [{
|
|
16
|
-
title: "Bash",
|
|
17
|
-
format: "bash"
|
|
18
|
-
}, {
|
|
19
|
-
title: "C",
|
|
20
|
-
format: "c"
|
|
21
|
-
}, {
|
|
22
|
-
title: "CSharp",
|
|
23
|
-
format: "csharp"
|
|
24
|
-
}, {
|
|
25
|
-
title: "CSS",
|
|
26
|
-
format: "css"
|
|
27
|
-
}, {
|
|
28
|
-
title: "Diff",
|
|
29
|
-
format: "diff"
|
|
30
|
-
}, {
|
|
31
|
-
title: "HTML",
|
|
32
|
-
format: "markup"
|
|
33
|
-
}, {
|
|
34
|
-
title: "Ini",
|
|
35
|
-
format: "ini"
|
|
36
|
-
}, {
|
|
37
|
-
title: "Java",
|
|
38
|
-
format: "java"
|
|
39
|
-
}, {
|
|
40
|
-
title: "Javascript",
|
|
41
|
-
format: "js"
|
|
42
|
-
}, {
|
|
43
|
-
title: "JSON",
|
|
44
|
-
format: "json"
|
|
45
|
-
}, {
|
|
46
|
-
title: "JSX",
|
|
47
|
-
format: "jsx"
|
|
48
|
-
}, {
|
|
49
|
-
title: "Kotlin",
|
|
50
|
-
format: "kotlin"
|
|
51
|
-
}, {
|
|
52
|
-
title: "LUA",
|
|
53
|
-
format: "lua"
|
|
54
|
-
}, {
|
|
55
|
-
title: "Markdown",
|
|
56
|
-
format: "markdown"
|
|
57
|
-
}, {
|
|
58
|
-
title: "Matlab",
|
|
59
|
-
format: "matlab"
|
|
60
|
-
}, {
|
|
61
|
-
title: "NSIS",
|
|
62
|
-
format: "nsis"
|
|
63
|
-
}, {
|
|
64
|
-
title: "PHP",
|
|
65
|
-
format: "php"
|
|
66
|
-
}, {
|
|
67
|
-
title: "Powershell",
|
|
68
|
-
format: "powershell"
|
|
69
|
-
}, {
|
|
70
|
-
title: "Python",
|
|
71
|
-
format: "python"
|
|
72
|
-
}, {
|
|
73
|
-
title: "Ruby",
|
|
74
|
-
format: "ruby"
|
|
75
|
-
}, {
|
|
76
|
-
title: "Rust",
|
|
77
|
-
format: "rust"
|
|
78
|
-
}, {
|
|
79
|
-
title: "SQL",
|
|
80
|
-
format: "sql"
|
|
81
|
-
}, {
|
|
82
|
-
title: "Text",
|
|
83
|
-
format: "text"
|
|
84
|
-
}, {
|
|
85
|
-
title: "VHDL",
|
|
86
|
-
format: "vhdl"
|
|
87
|
-
}, {
|
|
88
|
-
title: "XML",
|
|
89
|
-
format: "xml"
|
|
90
|
-
}];
|
package/lib/CodeBlock/index.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "CodeBlock", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function () {
|
|
9
|
-
return _CodeBlock.default;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
Object.defineProperty(exports, "codeLanguageOptions", {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _codeLanguageOptions.codeLanguageOptions;
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
var _CodeBlock = _interopRequireDefault(require("./CodeBlock"));
|
|
19
|
-
var _codeLanguageOptions = require("./codeLanguageOptions");
|
|
20
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
package/lib/Concept/Concept.js
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.Concept = void 0;
|
|
7
|
-
var _react = require("react");
|
|
8
|
-
var _primitives = require("@ndla/primitives");
|
|
9
|
-
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
-
var _Embed = require("../Embed");
|
|
11
|
-
var _EmbedByline = require("../LicenseByline/EmbedByline");
|
|
12
|
-
var _licenseAttributes = require("../utils/licenseAttributes");
|
|
13
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
/**
|
|
15
|
-
* Copyright (c) 2024-present, NDLA.
|
|
16
|
-
*
|
|
17
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
18
|
-
* LICENSE file in the root directory of this source tree.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
const StyledFigure = (0, _jsx2.styled)(_primitives.Figure, {
|
|
23
|
-
base: {
|
|
24
|
-
display: "flex",
|
|
25
|
-
flexDirection: "column",
|
|
26
|
-
gap: "medium"
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
const ContentWrapper = (0, _jsx2.styled)("div", {
|
|
30
|
-
base: {
|
|
31
|
-
textStyle: "body.large",
|
|
32
|
-
display: "inline",
|
|
33
|
-
"& p": {
|
|
34
|
-
display: "inline"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
const Concept = exports.Concept = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
39
|
-
let {
|
|
40
|
-
copyright,
|
|
41
|
-
visualElement,
|
|
42
|
-
lang,
|
|
43
|
-
children,
|
|
44
|
-
title,
|
|
45
|
-
source,
|
|
46
|
-
previewAlt,
|
|
47
|
-
...rest
|
|
48
|
-
} = _ref;
|
|
49
|
-
const licenseProps = (0, _licenseAttributes.licenseAttributes)(copyright?.license?.license, lang, source);
|
|
50
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
|
|
51
|
-
ref: ref,
|
|
52
|
-
...rest,
|
|
53
|
-
...licenseProps,
|
|
54
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
55
|
-
lang: lang,
|
|
56
|
-
children: [!!title && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
57
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)("b", {
|
|
58
|
-
children: title
|
|
59
|
-
}), ` – `]
|
|
60
|
-
}), children]
|
|
61
|
-
}), visualElement?.resource === "image" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ImageEmbed, {
|
|
62
|
-
embed: visualElement,
|
|
63
|
-
lang: lang,
|
|
64
|
-
previewAlt: previewAlt
|
|
65
|
-
}) : visualElement?.resource === "brightcove" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.BrightcoveEmbed, {
|
|
66
|
-
embed: visualElement
|
|
67
|
-
}) : visualElement?.resource === "h5p" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.H5pEmbed, {
|
|
68
|
-
embed: visualElement
|
|
69
|
-
}) : visualElement?.resource === "iframe" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.IframeEmbed, {
|
|
70
|
-
embed: visualElement
|
|
71
|
-
}) : visualElement?.resource === "external" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ExternalEmbed, {
|
|
72
|
-
embed: visualElement
|
|
73
|
-
}) : null, !!copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.EmbedByline, {
|
|
74
|
-
copyright: copyright,
|
|
75
|
-
type: "concept"
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
});
|