@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,180 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2023-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import parse from "html-react-parser";
|
|
10
|
-
import { ArrowRightLine } from "@ndla/icons";
|
|
11
|
-
import { Text } from "@ndla/primitives";
|
|
12
|
-
import { SafeLinkButton } from "@ndla/safelink";
|
|
13
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
14
|
-
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
15
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
const Wrapper = styled("div", {
|
|
17
|
-
base: {
|
|
18
|
-
width: "100%",
|
|
19
|
-
height: "100%",
|
|
20
|
-
containerType: "inline-size"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const Container = styled("div", {
|
|
24
|
-
base: {
|
|
25
|
-
display: "grid",
|
|
26
|
-
gridTemplateColumns: "1fr",
|
|
27
|
-
border: "1px solid",
|
|
28
|
-
borderColor: "stroke.default",
|
|
29
|
-
backgroundColor: "background.default",
|
|
30
|
-
borderRadius: "xsmall",
|
|
31
|
-
boxShadow: "full",
|
|
32
|
-
overflow: "hidden"
|
|
33
|
-
},
|
|
34
|
-
variants: {
|
|
35
|
-
imageSide: {
|
|
36
|
-
left: {
|
|
37
|
-
"@/tablet": {
|
|
38
|
-
gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
|
|
39
|
-
},
|
|
40
|
-
"@supports not (container-type: inline-size)": {
|
|
41
|
-
tabletWide: {
|
|
42
|
-
gridTemplateColumns: "minmax(230px, 455px) auto"
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
right: {
|
|
47
|
-
"@/tablet": {
|
|
48
|
-
gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
|
|
49
|
-
},
|
|
50
|
-
"@supports not (container-type: inline-size)": {
|
|
51
|
-
tabletWide: {
|
|
52
|
-
gridTemplateColumns: "auto minmax(230px, 455px)"
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
background: {
|
|
58
|
-
neutral: {},
|
|
59
|
-
brand1: {
|
|
60
|
-
backgroundColor: "surface.brand.1"
|
|
61
|
-
},
|
|
62
|
-
brand3: {
|
|
63
|
-
backgroundColor: "surface.brand.3"
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
defaultVariants: {
|
|
68
|
-
imageSide: "left",
|
|
69
|
-
background: "neutral"
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
const StyledImg = styled("img", {
|
|
73
|
-
base: {
|
|
74
|
-
objectFit: "cover",
|
|
75
|
-
width: "100%",
|
|
76
|
-
height: "215px",
|
|
77
|
-
"@/tablet": {
|
|
78
|
-
height: "340px"
|
|
79
|
-
},
|
|
80
|
-
"@supports not (container-type: inline-size)": {
|
|
81
|
-
tablet: {
|
|
82
|
-
height: "265px"
|
|
83
|
-
},
|
|
84
|
-
tabletWide: {
|
|
85
|
-
height: "340px"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
backgroundColor: "background.default"
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
const ContentWrapper = styled("div", {
|
|
92
|
-
base: {
|
|
93
|
-
width: "100%",
|
|
94
|
-
display: "flex",
|
|
95
|
-
flexDirection: "column",
|
|
96
|
-
gap: "medium",
|
|
97
|
-
alignItems: "flex-start",
|
|
98
|
-
justifyContent: "center",
|
|
99
|
-
paddingBlock: "medium",
|
|
100
|
-
paddingInline: "medium",
|
|
101
|
-
position: "relative"
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
const StyledText = styled(Text, {
|
|
105
|
-
base: {
|
|
106
|
-
tablet: {
|
|
107
|
-
display: "block",
|
|
108
|
-
overflow: "hidden",
|
|
109
|
-
position: "relative",
|
|
110
|
-
lineClamp: 4,
|
|
111
|
-
boxOrient: "vertical"
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
const StyledSafeLinkButton = styled(SafeLinkButton, {
|
|
116
|
-
base: {
|
|
117
|
-
boxShadow: "full",
|
|
118
|
-
border: "1px solid",
|
|
119
|
-
borderColor: "stroke.default"
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
const LinkButton = _ref => {
|
|
123
|
-
let {
|
|
124
|
-
url,
|
|
125
|
-
children,
|
|
126
|
-
path
|
|
127
|
-
} = _ref;
|
|
128
|
-
if (url) return /*#__PURE__*/_jsx(StyledSafeLinkButton, {
|
|
129
|
-
to: getPossiblyRelativeUrl(url, path),
|
|
130
|
-
variant: "secondary",
|
|
131
|
-
rel: "noopener noreferrer",
|
|
132
|
-
children: children
|
|
133
|
-
});
|
|
134
|
-
return children;
|
|
135
|
-
};
|
|
136
|
-
const CampaignBlock = _ref2 => {
|
|
137
|
-
let {
|
|
138
|
-
title,
|
|
139
|
-
image,
|
|
140
|
-
imageSide = "left",
|
|
141
|
-
description,
|
|
142
|
-
headingLevel: InternalHeading = "h2",
|
|
143
|
-
url,
|
|
144
|
-
path,
|
|
145
|
-
className,
|
|
146
|
-
background
|
|
147
|
-
} = _ref2;
|
|
148
|
-
const imageComponent = image && /*#__PURE__*/_jsx(StyledImg, {
|
|
149
|
-
src: `${image.src}?width=455`,
|
|
150
|
-
height: 340,
|
|
151
|
-
width: 455,
|
|
152
|
-
alt: image.alt
|
|
153
|
-
});
|
|
154
|
-
return /*#__PURE__*/_jsx(Wrapper, {
|
|
155
|
-
children: /*#__PURE__*/_jsxs(Container, {
|
|
156
|
-
className: className,
|
|
157
|
-
"data-embed-type": "campaign-block",
|
|
158
|
-
imageSide: imageSide,
|
|
159
|
-
background: background,
|
|
160
|
-
children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
161
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
162
|
-
asChild: true,
|
|
163
|
-
consumeCss: true,
|
|
164
|
-
textStyle: "heading.small",
|
|
165
|
-
children: /*#__PURE__*/_jsx(InternalHeading, {
|
|
166
|
-
children: parse(title)
|
|
167
|
-
})
|
|
168
|
-
}), /*#__PURE__*/_jsx(StyledText, {
|
|
169
|
-
textStyle: "body.xlarge",
|
|
170
|
-
children: parse(description)
|
|
171
|
-
}), !!url?.url && /*#__PURE__*/_jsxs(LinkButton, {
|
|
172
|
-
url: url.url,
|
|
173
|
-
path: path,
|
|
174
|
-
children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
|
|
175
|
-
})]
|
|
176
|
-
}), imageSide !== "left" && imageComponent]
|
|
177
|
-
})
|
|
178
|
-
});
|
|
179
|
-
};
|
|
180
|
-
export default CampaignBlock;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { forwardRef, useMemo } from "react";
|
|
10
|
-
import { cx } from "@ndla/styled-system/css";
|
|
11
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
const Pre = styled("pre", {});
|
|
14
|
-
export const Codeblock = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
15
|
-
let {
|
|
16
|
-
highlightedCode,
|
|
17
|
-
format,
|
|
18
|
-
className,
|
|
19
|
-
...props
|
|
20
|
-
} = _ref;
|
|
21
|
-
const codeWithLineNumbers = useMemo(() => {
|
|
22
|
-
return highlightedCode.split("\n").map((line, i) => {
|
|
23
|
-
return `<span class="linenumber">${i + 1}</span>${line}`;
|
|
24
|
-
}).join("\n");
|
|
25
|
-
}, [highlightedCode]);
|
|
26
|
-
return /*#__PURE__*/_jsx(Pre, {
|
|
27
|
-
className: cx("codeblock", `language-${format}`, className),
|
|
28
|
-
...props,
|
|
29
|
-
dangerouslySetInnerHTML: {
|
|
30
|
-
__html: codeWithLineNumbers
|
|
31
|
-
},
|
|
32
|
-
ref: ref
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
export default Codeblock;
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2019-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export const codeLanguageOptions = [{
|
|
10
|
-
title: "Bash",
|
|
11
|
-
format: "bash"
|
|
12
|
-
}, {
|
|
13
|
-
title: "C",
|
|
14
|
-
format: "c"
|
|
15
|
-
}, {
|
|
16
|
-
title: "CSharp",
|
|
17
|
-
format: "csharp"
|
|
18
|
-
}, {
|
|
19
|
-
title: "CSS",
|
|
20
|
-
format: "css"
|
|
21
|
-
}, {
|
|
22
|
-
title: "Diff",
|
|
23
|
-
format: "diff"
|
|
24
|
-
}, {
|
|
25
|
-
title: "HTML",
|
|
26
|
-
format: "markup"
|
|
27
|
-
}, {
|
|
28
|
-
title: "Ini",
|
|
29
|
-
format: "ini"
|
|
30
|
-
}, {
|
|
31
|
-
title: "Java",
|
|
32
|
-
format: "java"
|
|
33
|
-
}, {
|
|
34
|
-
title: "Javascript",
|
|
35
|
-
format: "js"
|
|
36
|
-
}, {
|
|
37
|
-
title: "JSON",
|
|
38
|
-
format: "json"
|
|
39
|
-
}, {
|
|
40
|
-
title: "JSX",
|
|
41
|
-
format: "jsx"
|
|
42
|
-
}, {
|
|
43
|
-
title: "Kotlin",
|
|
44
|
-
format: "kotlin"
|
|
45
|
-
}, {
|
|
46
|
-
title: "LUA",
|
|
47
|
-
format: "lua"
|
|
48
|
-
}, {
|
|
49
|
-
title: "Markdown",
|
|
50
|
-
format: "markdown"
|
|
51
|
-
}, {
|
|
52
|
-
title: "Matlab",
|
|
53
|
-
format: "matlab"
|
|
54
|
-
}, {
|
|
55
|
-
title: "NSIS",
|
|
56
|
-
format: "nsis"
|
|
57
|
-
}, {
|
|
58
|
-
title: "PHP",
|
|
59
|
-
format: "php"
|
|
60
|
-
}, {
|
|
61
|
-
title: "Powershell",
|
|
62
|
-
format: "powershell"
|
|
63
|
-
}, {
|
|
64
|
-
title: "Python",
|
|
65
|
-
format: "python"
|
|
66
|
-
}, {
|
|
67
|
-
title: "Ruby",
|
|
68
|
-
format: "ruby"
|
|
69
|
-
}, {
|
|
70
|
-
title: "Rust",
|
|
71
|
-
format: "rust"
|
|
72
|
-
}, {
|
|
73
|
-
title: "SQL",
|
|
74
|
-
format: "sql"
|
|
75
|
-
}, {
|
|
76
|
-
title: "Text",
|
|
77
|
-
format: "text"
|
|
78
|
-
}, {
|
|
79
|
-
title: "VHDL",
|
|
80
|
-
format: "vhdl"
|
|
81
|
-
}, {
|
|
82
|
-
title: "XML",
|
|
83
|
-
format: "xml"
|
|
84
|
-
}];
|
package/es/CodeBlock/index.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export { default as CodeBlock } from "./CodeBlock";
|
|
10
|
-
export { codeLanguageOptions } from "./codeLanguageOptions";
|
package/es/Concept/Concept.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { forwardRef } from "react";
|
|
10
|
-
import { Figure } from "@ndla/primitives";
|
|
11
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import { BrightcoveEmbed, ExternalEmbed, H5pEmbed, IframeEmbed, ImageEmbed } from "../Embed";
|
|
13
|
-
import { EmbedByline } from "../LicenseByline/EmbedByline";
|
|
14
|
-
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
15
|
-
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
-
const StyledFigure = styled(Figure, {
|
|
17
|
-
base: {
|
|
18
|
-
display: "flex",
|
|
19
|
-
flexDirection: "column",
|
|
20
|
-
gap: "medium"
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
const ContentWrapper = styled("div", {
|
|
24
|
-
base: {
|
|
25
|
-
textStyle: "body.large",
|
|
26
|
-
display: "inline",
|
|
27
|
-
"& p": {
|
|
28
|
-
display: "inline"
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
33
|
-
let {
|
|
34
|
-
copyright,
|
|
35
|
-
visualElement,
|
|
36
|
-
lang,
|
|
37
|
-
children,
|
|
38
|
-
title,
|
|
39
|
-
source,
|
|
40
|
-
previewAlt,
|
|
41
|
-
...rest
|
|
42
|
-
} = _ref;
|
|
43
|
-
const licenseProps = licenseAttributes(copyright?.license?.license, lang, source);
|
|
44
|
-
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
45
|
-
ref: ref,
|
|
46
|
-
...rest,
|
|
47
|
-
...licenseProps,
|
|
48
|
-
children: [/*#__PURE__*/_jsxs(ContentWrapper, {
|
|
49
|
-
lang: lang,
|
|
50
|
-
children: [!!title && /*#__PURE__*/_jsxs(_Fragment, {
|
|
51
|
-
children: [/*#__PURE__*/_jsx("b", {
|
|
52
|
-
children: title
|
|
53
|
-
}), ` – `]
|
|
54
|
-
}), children]
|
|
55
|
-
}), visualElement?.resource === "image" ? /*#__PURE__*/_jsx(ImageEmbed, {
|
|
56
|
-
embed: visualElement,
|
|
57
|
-
lang: lang,
|
|
58
|
-
previewAlt: previewAlt
|
|
59
|
-
}) : visualElement?.resource === "brightcove" ? /*#__PURE__*/_jsx(BrightcoveEmbed, {
|
|
60
|
-
embed: visualElement
|
|
61
|
-
}) : visualElement?.resource === "h5p" ? /*#__PURE__*/_jsx(H5pEmbed, {
|
|
62
|
-
embed: visualElement
|
|
63
|
-
}) : visualElement?.resource === "iframe" ? /*#__PURE__*/_jsx(IframeEmbed, {
|
|
64
|
-
embed: visualElement
|
|
65
|
-
}) : visualElement?.resource === "external" ? /*#__PURE__*/_jsx(ExternalEmbed, {
|
|
66
|
-
embed: visualElement
|
|
67
|
-
}) : null, !!copyright && /*#__PURE__*/_jsx(EmbedByline, {
|
|
68
|
-
copyright: copyright,
|
|
69
|
-
type: "concept"
|
|
70
|
-
})]
|
|
71
|
-
});
|
|
72
|
-
});
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
|
-
import { Text } from "@ndla/primitives";
|
|
11
|
-
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
-
import { LicenseContainerContent } from "../LicenseByline/EmbedByline";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
const BackgroundVariant = {
|
|
15
|
-
strong: {
|
|
16
|
-
_before: {
|
|
17
|
-
backgroundColor: "surface.brand.3"
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
moderate: {
|
|
21
|
-
_before: {
|
|
22
|
-
backgroundColor: "surface.brand.3.moderate"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
subtle: {
|
|
26
|
-
_before: {
|
|
27
|
-
backgroundColor: "surface.brand.3.subtle"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
export const contactBlockBackgrounds = Object.keys(BackgroundVariant);
|
|
32
|
-
const StyledWrapper = styled("div", {
|
|
33
|
-
base: {
|
|
34
|
-
display: "flex",
|
|
35
|
-
minWidth: "surface.xxsmall",
|
|
36
|
-
padding: "medium",
|
|
37
|
-
alignItems: "center",
|
|
38
|
-
justifyContent: "space-between",
|
|
39
|
-
boxShadow: "full",
|
|
40
|
-
border: "1px solid",
|
|
41
|
-
gap: "medium",
|
|
42
|
-
position: "relative",
|
|
43
|
-
borderColor: "stroke.default",
|
|
44
|
-
borderRadius: "xsmall",
|
|
45
|
-
overflow: "hidden",
|
|
46
|
-
background: "surface.default",
|
|
47
|
-
flexDirection: "column-reverse",
|
|
48
|
-
tablet: {
|
|
49
|
-
alignItems: "unset",
|
|
50
|
-
flexDirection: "row"
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const EmailLink = styled("a", {
|
|
55
|
-
base: {
|
|
56
|
-
color: "text.default",
|
|
57
|
-
textDecoration: "underline",
|
|
58
|
-
_hover: {
|
|
59
|
-
textDecoration: "none"
|
|
60
|
-
},
|
|
61
|
-
_focusVisible: {
|
|
62
|
-
textDecoration: "none"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
const HeaderWrapper = styled("div", {
|
|
67
|
-
base: {
|
|
68
|
-
position: "relative",
|
|
69
|
-
display: "flex",
|
|
70
|
-
flexDirection: "column",
|
|
71
|
-
gap: "3xsmall",
|
|
72
|
-
zIndex: "base",
|
|
73
|
-
_before: {
|
|
74
|
-
content: '""',
|
|
75
|
-
position: "absolute",
|
|
76
|
-
top: "-60px",
|
|
77
|
-
left: "-50px",
|
|
78
|
-
right: "0",
|
|
79
|
-
bottom: "0",
|
|
80
|
-
height: "calc(100% + 50px)",
|
|
81
|
-
width: "surface.3xlarge",
|
|
82
|
-
transform: "rotate(-4deg)",
|
|
83
|
-
zIndex: "hide"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
variants: {
|
|
87
|
-
variant: BackgroundVariant,
|
|
88
|
-
imageExists: {
|
|
89
|
-
true: {
|
|
90
|
-
tabletDown: {
|
|
91
|
-
_before: {
|
|
92
|
-
display: "none"
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
});
|
|
99
|
-
const ImageWrapper = styled("div", {
|
|
100
|
-
base: {
|
|
101
|
-
display: "flex",
|
|
102
|
-
gap: "xxsmall",
|
|
103
|
-
alignItems: "flex-start",
|
|
104
|
-
justifyContent: "flex-start",
|
|
105
|
-
flexDirection: "column",
|
|
106
|
-
zIndex: "base",
|
|
107
|
-
tabletDown: {
|
|
108
|
-
_before: {
|
|
109
|
-
content: '""',
|
|
110
|
-
position: "absolute",
|
|
111
|
-
top: "-50px",
|
|
112
|
-
left: "-50px",
|
|
113
|
-
right: "0",
|
|
114
|
-
bottom: "0",
|
|
115
|
-
height: "surface.xxsmall",
|
|
116
|
-
width: "surface.3xlarge",
|
|
117
|
-
transform: "rotate(-4deg)",
|
|
118
|
-
zIndex: "hide"
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
variants: {
|
|
123
|
-
variant: BackgroundVariant
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
const StyledImage = styled("img", {
|
|
127
|
-
base: {
|
|
128
|
-
borderRadius: "xsmall",
|
|
129
|
-
width: "surface.xsmall",
|
|
130
|
-
height: "surface.xsmall",
|
|
131
|
-
objectFit: "cover"
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
const ContentWrapper = styled("div", {
|
|
135
|
-
base: {
|
|
136
|
-
display: "flex",
|
|
137
|
-
flexDirection: "column",
|
|
138
|
-
gap: "medium",
|
|
139
|
-
flex: "1",
|
|
140
|
-
width: "100%"
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const StyledDescription = styled(Text, {
|
|
144
|
-
base: {
|
|
145
|
-
fontFamily: "serif"
|
|
146
|
-
}
|
|
147
|
-
});
|
|
148
|
-
export const ContactBlock = _ref => {
|
|
149
|
-
let {
|
|
150
|
-
image,
|
|
151
|
-
jobTitle,
|
|
152
|
-
description,
|
|
153
|
-
name,
|
|
154
|
-
email,
|
|
155
|
-
embedAlt,
|
|
156
|
-
lang,
|
|
157
|
-
backgroundColor = "strong"
|
|
158
|
-
} = _ref;
|
|
159
|
-
const {
|
|
160
|
-
t
|
|
161
|
-
} = useTranslation();
|
|
162
|
-
return /*#__PURE__*/_jsxs(StyledWrapper, {
|
|
163
|
-
"data-embed-type": "contact-block",
|
|
164
|
-
children: [/*#__PURE__*/_jsxs(ContentWrapper, {
|
|
165
|
-
children: [/*#__PURE__*/_jsxs(HeaderWrapper, {
|
|
166
|
-
variant: backgroundColor,
|
|
167
|
-
imageExists: !!image,
|
|
168
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
169
|
-
lang: lang,
|
|
170
|
-
fontWeight: "bold",
|
|
171
|
-
textStyle: "heading.small",
|
|
172
|
-
children: name
|
|
173
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
174
|
-
lang: lang,
|
|
175
|
-
children: jobTitle
|
|
176
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
177
|
-
children: [`${t("email")}: `, /*#__PURE__*/_jsx(EmailLink, {
|
|
178
|
-
href: `mailto:${email}`,
|
|
179
|
-
children: email
|
|
180
|
-
})]
|
|
181
|
-
})]
|
|
182
|
-
}), /*#__PURE__*/_jsx(StyledDescription, {
|
|
183
|
-
textStyle: "body.large",
|
|
184
|
-
children: description
|
|
185
|
-
})]
|
|
186
|
-
}), !!image && /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
187
|
-
variant: backgroundColor,
|
|
188
|
-
children: [/*#__PURE__*/_jsx(StyledImage, {
|
|
189
|
-
alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
|
|
190
|
-
src: image.image.imageUrl,
|
|
191
|
-
width: 300,
|
|
192
|
-
height: 300
|
|
193
|
-
}), /*#__PURE__*/_jsx(LicenseContainerContent, {
|
|
194
|
-
type: "image",
|
|
195
|
-
copyright: image.copyright
|
|
196
|
-
})]
|
|
197
|
-
})]
|
|
198
|
-
});
|
|
199
|
-
};
|
package/es/ContactBlock/index.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { forwardRef } from "react";
|
|
10
|
-
import { useTranslation } from "react-i18next";
|
|
11
|
-
import { Badge } from "@ndla/primitives";
|
|
12
|
-
import * as contentTypes from "../model/ContentType";
|
|
13
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
14
|
-
export const contentTypeToBadgeVariantMap = {
|
|
15
|
-
[contentTypes.SUBJECT_MATERIAL]: "brand1",
|
|
16
|
-
[contentTypes.TASKS_AND_ACTIVITIES]: "brand2",
|
|
17
|
-
[contentTypes.ASSESSMENT_RESOURCES]: "brand2",
|
|
18
|
-
[contentTypes.SUBJECT]: "neutral",
|
|
19
|
-
[contentTypes.SOURCE_MATERIAL]: "brand1",
|
|
20
|
-
[contentTypes.LEARNING_PATH]: "brand3",
|
|
21
|
-
[contentTypes.TOPIC]: "neutral",
|
|
22
|
-
[contentTypes.MULTIDISCIPLINARY]: "neutral",
|
|
23
|
-
[contentTypes.CONCEPT]: "brand1",
|
|
24
|
-
[contentTypes.EXTERNAL]: "brand2",
|
|
25
|
-
[contentTypes.IMAGE]: "brand1",
|
|
26
|
-
[contentTypes.AUDIO]: "brand1",
|
|
27
|
-
[contentTypes.PODCAST]: "brand1",
|
|
28
|
-
[contentTypes.VIDEO]: "brand1",
|
|
29
|
-
[contentTypes.MISSING]: "neutral",
|
|
30
|
-
[contentTypes.PODCAST_SERIES]: "brand1",
|
|
31
|
-
[contentTypes.GLOSS]: "brand1",
|
|
32
|
-
[contentTypes.PROGRAMME]: "neutral",
|
|
33
|
-
[contentTypes.FRONTPAGE_ARTICLE]: "brand2"
|
|
34
|
-
};
|
|
35
|
-
export const ContentTypeBadge = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
36
|
-
let {
|
|
37
|
-
contentType,
|
|
38
|
-
children,
|
|
39
|
-
...props
|
|
40
|
-
} = _ref;
|
|
41
|
-
const {
|
|
42
|
-
t
|
|
43
|
-
} = useTranslation();
|
|
44
|
-
return /*#__PURE__*/_jsx(Badge, {
|
|
45
|
-
colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
|
|
46
|
-
...props,
|
|
47
|
-
ref: ref,
|
|
48
|
-
children: children ?? t(`contentTypes.${contentType}`)
|
|
49
|
-
});
|
|
50
|
-
});
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { forwardRef } from "react";
|
|
10
|
-
import { BlockQuote } from "@ndla/primitives";
|
|
11
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
|
-
const contentTypeToVariantMapping = {
|
|
13
|
-
"subject-material": "brand1",
|
|
14
|
-
"source-material": "brand1",
|
|
15
|
-
concept: "brand1",
|
|
16
|
-
"tasks-and-activities": "brand2",
|
|
17
|
-
"assessment-resources": "brand2"
|
|
18
|
-
};
|
|
19
|
-
export const ContentTypeBlockQuote = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
20
|
-
let {
|
|
21
|
-
variant,
|
|
22
|
-
contentType,
|
|
23
|
-
...props
|
|
24
|
-
} = _ref;
|
|
25
|
-
const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
|
|
26
|
-
const variantColor = variant === "colored" ? color : undefined;
|
|
27
|
-
return /*#__PURE__*/_jsx(BlockQuote, {
|
|
28
|
-
...props,
|
|
29
|
-
variant: variantColor,
|
|
30
|
-
ref: ref
|
|
31
|
-
});
|
|
32
|
-
});
|