@ndla/ui 56.0.71-alpha.0 → 56.0.73-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/dist/panda.buildinfo.json +4 -15
- package/dist/styles.css +16 -57
- package/es/Article/Article.js +1 -2
- package/es/Article/ArticleByline.js +19 -30
- package/es/AudioPlayer/AudioPlayer.js +2 -2
- package/es/AudioPlayer/Controls.js +3 -1
- package/es/Concept/Concept.js +1 -1
- package/es/ContactBlock/ContactBlock.js +1 -1
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +4 -1
- package/es/ContentTypeHero/ContentTypeHero.js +6 -1
- package/es/Embed/RelatedContentEmbed.js +3 -3
- package/es/ErrorMessage/ErrorMessage.js +8 -8
- package/es/Gloss/Gloss.js +4 -4
- package/es/KeyFigure/KeyFigure.js +1 -1
- package/es/LicenseByline/EmbedByline.js +1 -1
- package/es/LinkBlock/LinkBlock.js +1 -1
- package/es/i18n/formatNestedMessages.js +0 -2
- package/es/index.js +0 -1
- package/es/locale/messages-en.js +6 -2
- package/es/locale/messages-nb.js +6 -2
- package/es/locale/messages-nn.js +6 -2
- package/es/locale/messages-se.js +6 -2
- package/es/locale/messages-sma.js +6 -2
- package/es/model/ContentType.js +9 -2
- package/lib/Article/Article.js +1 -2
- package/lib/Article/ArticleByline.d.ts +1 -3
- package/lib/Article/ArticleByline.js +18 -29
- package/lib/AudioPlayer/AudioPlayer.js +2 -2
- package/lib/AudioPlayer/Controls.js +3 -1
- package/lib/Concept/Concept.js +1 -1
- package/lib/ContactBlock/ContactBlock.js +1 -1
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +1 -1
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +4 -1
- package/lib/ContentTypeHero/ContentTypeHero.js +6 -1
- package/lib/Embed/RelatedContentEmbed.d.ts +1 -1
- package/lib/Embed/RelatedContentEmbed.js +2 -2
- package/lib/ErrorMessage/ErrorMessage.js +8 -8
- package/lib/Gloss/Gloss.js +4 -4
- package/lib/KeyFigure/KeyFigure.js +1 -1
- package/lib/LicenseByline/EmbedByline.js +1 -1
- package/lib/LinkBlock/LinkBlock.js +1 -1
- package/lib/TagSelector/TagSelector.d.ts +1 -1
- package/lib/i18n/formatNestedMessages.js +0 -2
- package/lib/index.d.ts +0 -1
- package/lib/index.js +0 -13
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +6 -2
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +6 -2
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +6 -2
- package/lib/locale/messages-se.d.ts +4 -0
- package/lib/locale/messages-se.js +6 -2
- package/lib/locale/messages-sma.d.ts +4 -0
- package/lib/locale/messages-sma.js +6 -2
- package/lib/model/ContentType.d.ts +5 -0
- package/lib/model/ContentType.js +10 -3
- package/lib/model/index.d.ts +2 -0
- package/package.json +8 -8
- package/src/Article/Article.tsx +1 -2
- package/src/Article/ArticleByline.stories.tsx +0 -3
- package/src/Article/ArticleByline.tsx +17 -32
- package/src/AudioPlayer/AudioPlayer.tsx +2 -2
- package/src/AudioPlayer/Controls.tsx +2 -0
- package/src/Concept/Concept.tsx +1 -1
- package/src/ContactBlock/ContactBlock.tsx +1 -1
- package/src/ContentTypeBadge/ContentTypeBadge.stories.tsx +3 -0
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +7 -1
- package/src/ContentTypeHero/ContentTypeHero.tsx +5 -0
- package/src/Embed/RelatedContentEmbed.tsx +2 -2
- package/src/ErrorMessage/ErrorMessage.stories.tsx +1 -1
- package/src/ErrorMessage/ErrorMessage.tsx +8 -8
- package/src/Gloss/Gloss.tsx +4 -4
- package/src/Grid/Grid.stories.tsx +3 -0
- package/src/KeyFigure/KeyFigure.tsx +1 -1
- package/src/LicenseByline/EmbedByline.tsx +2 -2
- package/src/LinkBlock/LinkBlock.tsx +1 -1
- package/src/TagSelector/TagSelector.tsx +1 -2
- package/src/i18n/formatNestedMessages.ts +0 -1
- package/src/index.ts +0 -2
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +4 -0
- package/src/locale/messages-nn.ts +4 -0
- package/src/locale/messages-se.ts +4 -0
- package/src/locale/messages-sma.ts +4 -0
- package/src/model/ContentType.ts +7 -0
- package/es/Layout/OneColumn.js +0 -43
- package/es/Layout/PageContainer.js +0 -32
- package/es/Layout/index.js +0 -10
- package/lib/Layout/OneColumn.d.ts +0 -11
- package/lib/Layout/OneColumn.js +0 -48
- package/lib/Layout/PageContainer.d.ts +0 -11
- package/lib/Layout/PageContainer.js +0 -37
- package/lib/Layout/index.d.ts +0 -9
- package/lib/Layout/index.js +0 -20
- package/src/Layout/OneColumn.tsx +0 -44
- package/src/Layout/PageContainer.tsx +0 -33
- package/src/Layout/index.ts +0 -10
package/es/model/ContentType.js
CHANGED
|
@@ -21,6 +21,9 @@ export const IMAGE = "image";
|
|
|
21
21
|
export const VIDEO = "video";
|
|
22
22
|
export const AUDIO = "audio";
|
|
23
23
|
export const PODCAST = "podcast";
|
|
24
|
+
export const GLOSS = "gloss";
|
|
25
|
+
export const PROGRAMME = "programme";
|
|
26
|
+
export const PODCAST_SERIES = "podcast-series";
|
|
24
27
|
export const contentTypes = {
|
|
25
28
|
SUBJECT_MATERIAL,
|
|
26
29
|
TASKS_AND_ACTIVITIES,
|
|
@@ -32,7 +35,9 @@ export const contentTypes = {
|
|
|
32
35
|
MULTIDISCIPLINARY,
|
|
33
36
|
CONCEPT,
|
|
34
37
|
EXTERNAL,
|
|
35
|
-
MISSING
|
|
38
|
+
MISSING,
|
|
39
|
+
PROGRAMME,
|
|
40
|
+
PODCAST_SERIES
|
|
36
41
|
};
|
|
37
42
|
export const RESOURCE_TYPE_LEARNING_PATH = "urn:resourcetype:learningPath";
|
|
38
43
|
export const RESOURCE_TYPE_SUBJECT_MATERIAL = "urn:resourcetype:subjectMaterial";
|
|
@@ -48,6 +53,7 @@ export const contentTypeMapping = {
|
|
|
48
53
|
[RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,
|
|
49
54
|
[RESOURCE_TYPE_CONCEPT]: CONCEPT,
|
|
50
55
|
[MULTIDISCIPLINARY]: MULTIDISCIPLINARY,
|
|
56
|
+
[TOPIC]: TOPIC,
|
|
51
57
|
default: SUBJECT_MATERIAL
|
|
52
58
|
};
|
|
53
59
|
export const resourceEmbedTypeMapping = {
|
|
@@ -55,5 +61,6 @@ export const resourceEmbedTypeMapping = {
|
|
|
55
61
|
video: "video",
|
|
56
62
|
concept: "concept",
|
|
57
63
|
audio: "audio",
|
|
58
|
-
podcast: "podcast"
|
|
64
|
+
podcast: "podcast",
|
|
65
|
+
gloss: "gloss"
|
|
59
66
|
};
|
package/lib/Article/Article.js
CHANGED
|
@@ -9,8 +9,8 @@ var _react2 = require("@ark-ui/react");
|
|
|
9
9
|
var _primitives = require("@ndla/primitives");
|
|
10
10
|
var _css = require("@ndla/styled-system/css");
|
|
11
11
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
12
|
-
var _ArticleByline = require("./ArticleByline");
|
|
13
12
|
var _ = require("..");
|
|
13
|
+
var _ArticleByline = require("./ArticleByline");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
/**
|
|
16
16
|
* Copyright (c) 2016-present, NDLA.
|
|
@@ -186,7 +186,6 @@ const Article = _ref3 => {
|
|
|
186
186
|
authors: authors,
|
|
187
187
|
suppliers: copyright?.rightsholders,
|
|
188
188
|
published: published,
|
|
189
|
-
license: copyright?.license?.license ?? "",
|
|
190
189
|
licenseBox: licenseBox
|
|
191
190
|
}), children]
|
|
192
191
|
})]
|
|
@@ -18,14 +18,12 @@ type Props = {
|
|
|
18
18
|
authors?: AuthorProps[];
|
|
19
19
|
suppliers?: SupplierProps[];
|
|
20
20
|
published?: string;
|
|
21
|
-
license?: string;
|
|
22
21
|
licenseBox?: ReactNode;
|
|
23
|
-
locale?: string;
|
|
24
22
|
footnotes?: FootNote[];
|
|
25
23
|
displayByline?: boolean;
|
|
26
24
|
bylineType?: "article" | "learningPath";
|
|
27
25
|
};
|
|
28
|
-
export declare const ArticleByline: ({ authors, suppliers, footnotes,
|
|
26
|
+
export declare const ArticleByline: ({ authors, suppliers, footnotes, licenseBox, published, displayByline, bylineType, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
29
27
|
interface ArticleBylineAccordionprops extends AccordionItemProps {
|
|
30
28
|
accordionTitle: ReactNode;
|
|
31
29
|
}
|
|
@@ -8,11 +8,9 @@ var _react = require("react");
|
|
|
8
8
|
var _reactI18next = require("react-i18next");
|
|
9
9
|
var _reactRouterDom = require("react-router-dom");
|
|
10
10
|
var _common = require("@ndla/icons/common");
|
|
11
|
-
var _licenses = require("@ndla/licenses");
|
|
12
11
|
var _primitives = require("@ndla/primitives");
|
|
13
12
|
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
14
13
|
var _ArticleFootNotes = require("./ArticleFootNotes");
|
|
15
|
-
var _LicenseLink = require("../LicenseByline/LicenseLink");
|
|
16
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
15
|
/**
|
|
18
16
|
* Copyright (c) 2020-present, NDLA.
|
|
@@ -34,12 +32,15 @@ const Wrapper = (0, _jsx2.styled)("div", {
|
|
|
34
32
|
const TextWrapper = (0, _jsx2.styled)("div", {
|
|
35
33
|
base: {
|
|
36
34
|
display: "flex",
|
|
37
|
-
flexDirection: "column
|
|
35
|
+
flexDirection: "column",
|
|
38
36
|
gap: "3xsmall",
|
|
39
37
|
width: "100%",
|
|
40
38
|
justifyContent: "space-between",
|
|
41
39
|
paddingBlock: "xsmall",
|
|
42
|
-
textStyle: "body.medium"
|
|
40
|
+
textStyle: "body.medium",
|
|
41
|
+
'& [data-contributors="false"]': {
|
|
42
|
+
marginInlineStart: "auto"
|
|
43
|
+
}
|
|
43
44
|
},
|
|
44
45
|
variants: {
|
|
45
46
|
learningpath: {
|
|
@@ -76,12 +77,6 @@ const getSuppliersText = (suppliers, t) => {
|
|
|
76
77
|
}
|
|
77
78
|
});
|
|
78
79
|
};
|
|
79
|
-
const LicenseWrapper = (0, _jsx2.styled)("div", {
|
|
80
|
-
base: {
|
|
81
|
-
display: "flex",
|
|
82
|
-
gap: "xsmall"
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
80
|
const StyledAccordionRoot = (0, _jsx2.styled)(_primitives.AccordionRoot, {
|
|
86
81
|
base: {
|
|
87
82
|
paddingBlockStart: "xxlarge"
|
|
@@ -94,10 +89,8 @@ const ArticleByline = _ref => {
|
|
|
94
89
|
authors = [],
|
|
95
90
|
suppliers = [],
|
|
96
91
|
footnotes,
|
|
97
|
-
license: licenseString,
|
|
98
92
|
licenseBox,
|
|
99
93
|
published,
|
|
100
|
-
locale,
|
|
101
94
|
displayByline = true,
|
|
102
95
|
bylineType = "article"
|
|
103
96
|
} = _ref;
|
|
@@ -125,27 +118,23 @@ const ArticleByline = _ref => {
|
|
|
125
118
|
window.addEventListener("hashchange", onHashChange);
|
|
126
119
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
127
120
|
}, [onHashChange]);
|
|
128
|
-
const license = licenseString && (0, _licenses.getLicenseByAbbreviation)(licenseString, locale);
|
|
129
121
|
const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
|
|
130
122
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
131
|
-
children: [displayByline && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextWrapper, {
|
|
123
|
+
children: [!!displayByline && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextWrapper, {
|
|
132
124
|
learningpath: bylineType === "learningPath",
|
|
133
|
-
children: [
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
escapeValue: false
|
|
145
|
-
}
|
|
146
|
-
})}. `, getSuppliersText(suppliers, t)]
|
|
147
|
-
})]
|
|
125
|
+
children: [!!showPrimaryContributors &&
|
|
126
|
+
/*#__PURE__*/
|
|
127
|
+
//eslint-disable-next-line react/no-unknown-property
|
|
128
|
+
(0, _jsxRuntime.jsxs)("span", {
|
|
129
|
+
property: "cc:attributionName",
|
|
130
|
+
children: [authors.length > 0 && `${t("article.authorsLabel", {
|
|
131
|
+
names: renderContributors(authors, t),
|
|
132
|
+
interpolation: {
|
|
133
|
+
escapeValue: false
|
|
134
|
+
}
|
|
135
|
+
})}. `, getSuppliersText(suppliers, t)]
|
|
148
136
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
137
|
+
"data-contributors": showPrimaryContributors,
|
|
149
138
|
children: [t(`${bylineType}.lastUpdated`), " ", published]
|
|
150
139
|
})]
|
|
151
140
|
}), (!!licenseBox || !!footnotes?.length) && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledAccordionRoot, {
|
|
@@ -171,7 +171,7 @@ const AudioPlayer = _ref => {
|
|
|
171
171
|
});
|
|
172
172
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(AudioPlayerWrapper, {
|
|
173
173
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(InfoWrapper, {
|
|
174
|
-
children: [img && /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageWrapper, {
|
|
174
|
+
children: [!!img && /*#__PURE__*/(0, _jsxRuntime.jsx)(ImageWrapper, {
|
|
175
175
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
176
176
|
src: img.url,
|
|
177
177
|
alt: img.alt
|
|
@@ -192,7 +192,7 @@ const AudioPlayer = _ref => {
|
|
|
192
192
|
})
|
|
193
193
|
})]
|
|
194
194
|
}), !!textVersion && !img && textVersionButton]
|
|
195
|
-
}), description && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Text, {
|
|
195
|
+
}), !!description && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Text, {
|
|
196
196
|
textStyle: "body.medium",
|
|
197
197
|
children: [showFullDescription || description.length < DESCRIPTION_MAX_LENGTH ? description : `${truncatedDescription}...`, description.length > DESCRIPTION_MAX_LENGTH && /*#__PURE__*/(0, _jsxRuntime.jsx)(ShowMoreButton, {
|
|
198
198
|
variant: "link",
|
|
@@ -79,7 +79,9 @@ const ProgressWrapper = (0, _jsx2.styled)("div", {
|
|
|
79
79
|
});
|
|
80
80
|
const StyledText = (0, _jsx2.styled)(_primitives.Text, {
|
|
81
81
|
base: {
|
|
82
|
-
minWidth: "xxlarge"
|
|
82
|
+
minWidth: "xxlarge",
|
|
83
|
+
flexShrink: "0",
|
|
84
|
+
textAlign: "center"
|
|
83
85
|
}
|
|
84
86
|
});
|
|
85
87
|
const VolumeButton = (0, _jsx2.styled)(_primitives.IconButton, {
|
package/lib/Concept/Concept.js
CHANGED
|
@@ -70,7 +70,7 @@ const Concept = exports.Concept = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref
|
|
|
70
70
|
embed: visualElement
|
|
71
71
|
}) : visualElement?.resource === "external" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Embed.ExternalEmbed, {
|
|
72
72
|
embed: visualElement
|
|
73
|
-
}) : null, copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.EmbedByline, {
|
|
73
|
+
}) : null, !!copyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.EmbedByline, {
|
|
74
74
|
copyright: copyright,
|
|
75
75
|
type: "concept"
|
|
76
76
|
})]
|
|
@@ -189,7 +189,7 @@ const ContactBlock = _ref => {
|
|
|
189
189
|
textStyle: "body.large",
|
|
190
190
|
children: description
|
|
191
191
|
})]
|
|
192
|
-
}), image && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
|
|
192
|
+
}), !!image && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
|
|
193
193
|
variant: backgroundColor,
|
|
194
194
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
|
|
195
195
|
alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
|
|
@@ -10,7 +10,7 @@ import * as contentTypes from "../model/ContentType";
|
|
|
10
10
|
export interface ContentTypeBadgeProps extends Omit<BadgeProps, "colorTheme"> {
|
|
11
11
|
contentType: ContentType | undefined;
|
|
12
12
|
}
|
|
13
|
-
export type StrictContentType = typeof contentTypes.SUBJECT_MATERIAL | typeof contentTypes.TASKS_AND_ACTIVITIES | typeof contentTypes.ASSESSMENT_RESOURCES | typeof contentTypes.SUBJECT | typeof contentTypes.SOURCE_MATERIAL | typeof contentTypes.LEARNING_PATH | typeof contentTypes.TOPIC | typeof contentTypes.MULTIDISCIPLINARY | typeof contentTypes.CONCEPT | typeof contentTypes.EXTERNAL | typeof contentTypes.IMAGE | typeof contentTypes.AUDIO | typeof contentTypes.VIDEO | typeof contentTypes.MISSING | typeof contentTypes.PODCAST;
|
|
13
|
+
export type StrictContentType = typeof contentTypes.SUBJECT_MATERIAL | typeof contentTypes.TASKS_AND_ACTIVITIES | typeof contentTypes.ASSESSMENT_RESOURCES | typeof contentTypes.SUBJECT | typeof contentTypes.SOURCE_MATERIAL | typeof contentTypes.LEARNING_PATH | typeof contentTypes.TOPIC | typeof contentTypes.MULTIDISCIPLINARY | typeof contentTypes.CONCEPT | typeof contentTypes.EXTERNAL | typeof contentTypes.IMAGE | typeof contentTypes.AUDIO | typeof contentTypes.VIDEO | typeof contentTypes.MISSING | typeof contentTypes.PODCAST | typeof contentTypes.GLOSS | typeof contentTypes.PROGRAMME | typeof contentTypes.PODCAST_SERIES;
|
|
14
14
|
export type ContentType = StrictContentType | (string & {});
|
|
15
15
|
export declare const contentTypeToBadgeVariantMap: Record<ContentType, BadgeVariant>;
|
|
16
16
|
export declare const ContentTypeBadge: import("react").ForwardRefExoticComponent<ContentTypeBadgeProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -34,7 +34,10 @@ const contentTypeToBadgeVariantMap = exports.contentTypeToBadgeVariantMap = {
|
|
|
34
34
|
[contentTypes.AUDIO]: "brand1",
|
|
35
35
|
[contentTypes.PODCAST]: "brand1",
|
|
36
36
|
[contentTypes.VIDEO]: "brand1",
|
|
37
|
-
[contentTypes.MISSING]: "neutral"
|
|
37
|
+
[contentTypes.MISSING]: "neutral",
|
|
38
|
+
[contentTypes.PODCAST_SERIES]: "brand1",
|
|
39
|
+
[contentTypes.GLOSS]: "brand1",
|
|
40
|
+
[contentTypes.PROGRAMME]: "neutral"
|
|
38
41
|
};
|
|
39
42
|
const ContentTypeBadge = exports.ContentTypeBadge = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
40
43
|
let {
|
|
@@ -35,7 +35,12 @@ const contentTypeToHeroMap = exports.contentTypeToHeroMap = {
|
|
|
35
35
|
[contentTypes.AUDIO]: "primary",
|
|
36
36
|
[contentTypes.PODCAST]: "primary",
|
|
37
37
|
[contentTypes.VIDEO]: "primary",
|
|
38
|
-
[contentTypes.MISSING]: "neutral"
|
|
38
|
+
[contentTypes.MISSING]: "neutral",
|
|
39
|
+
[contentTypes.GLOSS]: "brand1Moderate",
|
|
40
|
+
// this will never happen
|
|
41
|
+
[contentTypes.PROGRAMME]: "primary",
|
|
42
|
+
// this will never happen
|
|
43
|
+
[contentTypes.PODCAST_SERIES]: "primary"
|
|
39
44
|
};
|
|
40
45
|
const ContentTypeHero = exports.ContentTypeHero = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
|
|
41
46
|
let {
|
|
@@ -12,5 +12,5 @@ interface Props {
|
|
|
12
12
|
subject?: string;
|
|
13
13
|
ndlaFrontendDomain?: string;
|
|
14
14
|
}
|
|
15
|
-
declare const RelatedContentEmbed: ({ embed, isOembed, subject, ndlaFrontendDomain }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare const RelatedContentEmbed: ({ embed, isOembed, subject, ndlaFrontendDomain }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
16
|
export default RelatedContentEmbed;
|
|
@@ -27,7 +27,7 @@ const RelatedContentEmbed = _ref => {
|
|
|
27
27
|
t
|
|
28
28
|
} = (0, _reactI18next.useTranslation)();
|
|
29
29
|
if (embed.status === "error") {
|
|
30
|
-
return
|
|
30
|
+
return null;
|
|
31
31
|
}
|
|
32
32
|
const {
|
|
33
33
|
data,
|
|
@@ -55,6 +55,6 @@ const RelatedContentEmbed = _ref => {
|
|
|
55
55
|
linkInfo: `${t("related.linkInfo")} ${embedData.urlDomain}`
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
|
-
return
|
|
58
|
+
return null;
|
|
59
59
|
};
|
|
60
60
|
var _default = exports.default = RelatedContentEmbed;
|
|
@@ -65,31 +65,31 @@ const ErrorMessage = _ref => {
|
|
|
65
65
|
customElement
|
|
66
66
|
} = _ref;
|
|
67
67
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledErrorMessage, {
|
|
68
|
-
children: [illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
68
|
+
children: [!!illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
69
69
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
70
70
|
src: illustration.url,
|
|
71
71
|
alt: illustration.altText
|
|
72
72
|
})
|
|
73
|
-
}), illustrationElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
73
|
+
}), !!illustrationElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
74
74
|
children: illustrationElement
|
|
75
75
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
|
|
76
76
|
children: messages.title
|
|
77
|
-
}), messages.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
|
|
77
|
+
}), !!messages.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
|
|
78
78
|
children: messages.description
|
|
79
|
-
}), customElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomElementWrapper, {
|
|
79
|
+
}), !!customElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomElementWrapper, {
|
|
80
80
|
children: customElement
|
|
81
|
-
}), messages.linksTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
81
|
+
}), !!messages.linksTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
82
82
|
children: messages.linksTitle
|
|
83
|
-
}), messages.back && /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
83
|
+
}), !!messages.back && /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
84
84
|
to: `/#${encodeURI(messages.back)}`,
|
|
85
85
|
onClick: () => window.history.back(),
|
|
86
86
|
children: messages.back
|
|
87
|
-
}), messages.goToFrontPage && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
87
|
+
}), !!messages.goToFrontPage && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
88
88
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
89
89
|
to: "/",
|
|
90
90
|
children: messages.goToFrontPage
|
|
91
91
|
})
|
|
92
|
-
}), messages.logInFailed && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
92
|
+
}), !!messages.logInFailed && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
93
93
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
94
94
|
to: "/minndla",
|
|
95
95
|
children: messages.logInFailed
|
package/lib/Gloss/Gloss.js
CHANGED
|
@@ -113,7 +113,7 @@ const Gloss = _ref => {
|
|
|
113
113
|
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
114
114
|
children: glossData.gloss
|
|
115
115
|
})
|
|
116
|
-
}), glossData.transcriptions.traditional && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
116
|
+
}), !!glossData.transcriptions.traditional && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
117
117
|
textStyle: "label.medium",
|
|
118
118
|
asChild: true,
|
|
119
119
|
consumeCss: true,
|
|
@@ -122,7 +122,7 @@ const Gloss = _ref => {
|
|
|
122
122
|
lang: glossData.originalLanguage,
|
|
123
123
|
children: glossData.transcriptions.traditional
|
|
124
124
|
}, t("gloss.transcriptions.traditional"))
|
|
125
|
-
}), glossData.transcriptions.pinyin && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
125
|
+
}), !!glossData.transcriptions.pinyin && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
126
126
|
textStyle: "label.medium",
|
|
127
127
|
asChild: true,
|
|
128
128
|
consumeCss: true,
|
|
@@ -132,7 +132,7 @@ const Gloss = _ref => {
|
|
|
132
132
|
lang: glossData.originalLanguage,
|
|
133
133
|
children: glossData.transcriptions.pinyin
|
|
134
134
|
}, t("gloss.transcriptions.pinyin"))
|
|
135
|
-
}), glossData.wordClass && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
135
|
+
}), !!glossData.wordClass && /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
136
136
|
textStyle: "label.medium",
|
|
137
137
|
asChild: true,
|
|
138
138
|
consumeCss: true,
|
|
@@ -141,7 +141,7 @@ const Gloss = _ref => {
|
|
|
141
141
|
children: t(`wordClass.${glossData.wordClass}`).toLowerCase()
|
|
142
142
|
})
|
|
143
143
|
})]
|
|
144
|
-
}), audio?.src && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpeechControl.default, {
|
|
144
|
+
}), !!audio?.src && /*#__PURE__*/(0, _jsxRuntime.jsx)(_SpeechControl.default, {
|
|
145
145
|
src: audio.src,
|
|
146
146
|
title: audio.title,
|
|
147
147
|
type: "gloss"
|
|
@@ -55,7 +55,7 @@ const KeyFigure = _ref => {
|
|
|
55
55
|
} = _ref;
|
|
56
56
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
57
57
|
"data-embed-type": "key-figure",
|
|
58
|
-
children: [image && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
|
|
58
|
+
children: [!!image && /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
|
|
59
59
|
src: `${image?.src}?width=150`,
|
|
60
60
|
width: 150,
|
|
61
61
|
height: 150,
|
|
@@ -91,7 +91,7 @@ const EmbedByline = _ref => {
|
|
|
91
91
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
|
|
92
92
|
children: [!hideByline && /*#__PURE__*/(0, _jsxRuntime.jsx)(BylineWrapper, {
|
|
93
93
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
94
|
-
children: [hideCopyright && description, !hideCopyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(LicenseContainerContent, {
|
|
94
|
+
children: [!!hideCopyright && description, !hideCopyright && /*#__PURE__*/(0, _jsxRuntime.jsx)(LicenseContainerContent, {
|
|
95
95
|
type: type,
|
|
96
96
|
copyright: copyright,
|
|
97
97
|
children: description
|
|
@@ -100,7 +100,7 @@ const LinkBlock = _ref => {
|
|
|
100
100
|
"data-heading": true,
|
|
101
101
|
children: (0, _htmlReactParser.default)(title)
|
|
102
102
|
})
|
|
103
|
-
}), date && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledDateContainer, {
|
|
103
|
+
}), !!date && /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledDateContainer, {
|
|
104
104
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCalendarEd, {}), formattedDate]
|
|
105
105
|
})]
|
|
106
106
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.ArrowRightLine, {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
-
import type
|
|
8
|
+
import { type CollectionItem } from "@ark-ui/react";
|
|
9
9
|
import { ComboboxControlProps, ComboboxInputProps, ComboboxRootProps, TagsInputControlProps, TagsInputInputProps, TagsInputRootProps } from "@ndla/primitives";
|
|
10
10
|
export type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;
|
|
11
11
|
export declare const TagSelectorRoot: <T extends unknown>({ allowCustomValue, multiple, selectionBehavior, editable, addOnPaste, onValueChange, children, value, translations, ...rest }: TagSelectorRootProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -16,8 +16,6 @@ const formatNestedMessages = function (phrases) {
|
|
|
16
16
|
let formattedMessages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
17
17
|
let prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
18
18
|
const messages = formattedMessages;
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line
|
|
21
19
|
Object.keys(phrases).forEach(key => {
|
|
22
20
|
const value = phrases[key];
|
|
23
21
|
if ({}.hasOwnProperty.call(phrases, key)) {
|
package/lib/index.d.ts
CHANGED
|
@@ -29,7 +29,6 @@ export { default as messagesSMA } from "./locale/messages-sma";
|
|
|
29
29
|
export { default as Breadcrumb, HomeBreadcrumb } from "./Breadcrumb";
|
|
30
30
|
export type { SimpleBreadcrumbItem, IndexedBreadcrumbItem } from "./Breadcrumb";
|
|
31
31
|
export { i18nInstance, formatNestedMessages, useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations, } from "./i18n";
|
|
32
|
-
export { OneColumn, PageContainer } from "./Layout";
|
|
33
32
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, SourceMaterialBadge, ConceptBadge, } from "./ContentTypeBadge";
|
|
34
33
|
export type { ContentTypeBadgeProps, StrictContentType, ContentType } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
35
34
|
export { ContentTypeBadge as ContentTypeBadgeNew, contentTypeToBadgeVariantMap, } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
package/lib/index.js
CHANGED
|
@@ -363,18 +363,6 @@ Object.defineProperty(exports, "LinkBlockSection", {
|
|
|
363
363
|
return _LinkBlock.LinkBlockSection;
|
|
364
364
|
}
|
|
365
365
|
});
|
|
366
|
-
Object.defineProperty(exports, "OneColumn", {
|
|
367
|
-
enumerable: true,
|
|
368
|
-
get: function () {
|
|
369
|
-
return _Layout.OneColumn;
|
|
370
|
-
}
|
|
371
|
-
});
|
|
372
|
-
Object.defineProperty(exports, "PageContainer", {
|
|
373
|
-
enumerable: true,
|
|
374
|
-
get: function () {
|
|
375
|
-
return _Layout.PageContainer;
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
366
|
Object.defineProperty(exports, "PdfFile", {
|
|
379
367
|
enumerable: true,
|
|
380
368
|
get: function () {
|
|
@@ -654,7 +642,6 @@ var _messagesSe = _interopRequireDefault(require("./locale/messages-se"));
|
|
|
654
642
|
var _messagesSma = _interopRequireDefault(require("./locale/messages-sma"));
|
|
655
643
|
var _Breadcrumb = _interopRequireWildcard(require("./Breadcrumb"));
|
|
656
644
|
var _i18n = require("./i18n");
|
|
657
|
-
var _Layout = require("./Layout");
|
|
658
645
|
var _ContentTypeBadge = _interopRequireWildcard(require("./ContentTypeBadge"));
|
|
659
646
|
var _ContentTypeBadgeNew = require("./ContentTypeBadge/ContentTypeBadgeNew");
|
|
660
647
|
var _ContentTypeBlockQuote = require("./ContentTypeBlockQuote/ContentTypeBlockQuote");
|
|
@@ -536,6 +536,7 @@ declare const messages: {
|
|
|
536
536
|
blog: string;
|
|
537
537
|
tips: string;
|
|
538
538
|
vacancies: string;
|
|
539
|
+
contact: string;
|
|
539
540
|
};
|
|
540
541
|
otherLanguages: string;
|
|
541
542
|
};
|
|
@@ -560,6 +561,9 @@ declare const messages: {
|
|
|
560
561
|
video: string;
|
|
561
562
|
missing: string;
|
|
562
563
|
external: string;
|
|
564
|
+
gloss: string;
|
|
565
|
+
programme: string;
|
|
566
|
+
"podcast-series": string;
|
|
563
567
|
};
|
|
564
568
|
modal: {
|
|
565
569
|
closeModal: string;
|
|
@@ -552,7 +552,8 @@ const messages = {
|
|
|
552
552
|
aboutNdla: "About NDLA",
|
|
553
553
|
blog: "Blog",
|
|
554
554
|
tips: "Tips to students",
|
|
555
|
-
vacancies: "Vacancies"
|
|
555
|
+
vacancies: "Vacancies",
|
|
556
|
+
contact: "Contact us"
|
|
556
557
|
},
|
|
557
558
|
otherLanguages: "Other languages"
|
|
558
559
|
},
|
|
@@ -576,7 +577,10 @@ const messages = {
|
|
|
576
577
|
h5p: "H5P",
|
|
577
578
|
video: "Video",
|
|
578
579
|
missing: "Unknown",
|
|
579
|
-
external: "External"
|
|
580
|
+
external: "External",
|
|
581
|
+
gloss: "Gloss",
|
|
582
|
+
programme: "Programme",
|
|
583
|
+
"podcast-series": "Podcast series"
|
|
580
584
|
},
|
|
581
585
|
modal: {
|
|
582
586
|
closeModal: "Close"
|
|
@@ -536,6 +536,7 @@ declare const messages: {
|
|
|
536
536
|
blog: string;
|
|
537
537
|
tips: string;
|
|
538
538
|
vacancies: string;
|
|
539
|
+
contact: string;
|
|
539
540
|
};
|
|
540
541
|
otherLanguages: string;
|
|
541
542
|
};
|
|
@@ -560,6 +561,9 @@ declare const messages: {
|
|
|
560
561
|
video: string;
|
|
561
562
|
missing: string;
|
|
562
563
|
external: string;
|
|
564
|
+
gloss: string;
|
|
565
|
+
programme: string;
|
|
566
|
+
"podcast-series": string;
|
|
563
567
|
};
|
|
564
568
|
modal: {
|
|
565
569
|
closeModal: string;
|
|
@@ -552,7 +552,8 @@ const messages = {
|
|
|
552
552
|
aboutNdla: "About NDLA",
|
|
553
553
|
blog: "Fagblogg",
|
|
554
554
|
tips: "Tips til elever",
|
|
555
|
-
vacancies: "Ledige stillinger"
|
|
555
|
+
vacancies: "Ledige stillinger",
|
|
556
|
+
contact: "Kontakt oss"
|
|
556
557
|
},
|
|
557
558
|
otherLanguages: "Andre språk"
|
|
558
559
|
},
|
|
@@ -576,7 +577,10 @@ const messages = {
|
|
|
576
577
|
h5p: "H5P",
|
|
577
578
|
video: "Video",
|
|
578
579
|
missing: "Ukjent",
|
|
579
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
580
584
|
},
|
|
581
585
|
modal: {
|
|
582
586
|
closeModal: "Lukk"
|
|
@@ -536,6 +536,7 @@ declare const messages: {
|
|
|
536
536
|
blog: string;
|
|
537
537
|
tips: string;
|
|
538
538
|
vacancies: string;
|
|
539
|
+
contact: string;
|
|
539
540
|
};
|
|
540
541
|
otherLanguages: string;
|
|
541
542
|
};
|
|
@@ -560,6 +561,9 @@ declare const messages: {
|
|
|
560
561
|
video: string;
|
|
561
562
|
missing: string;
|
|
562
563
|
external: string;
|
|
564
|
+
gloss: string;
|
|
565
|
+
programme: string;
|
|
566
|
+
"podcast-series": string;
|
|
563
567
|
};
|
|
564
568
|
modal: {
|
|
565
569
|
closeModal: string;
|
|
@@ -552,7 +552,8 @@ const messages = {
|
|
|
552
552
|
aboutNdla: "About NDLA",
|
|
553
553
|
blog: "Fagblogg",
|
|
554
554
|
tips: "Tips til elevar",
|
|
555
|
-
vacancies: "Ledige stillingar"
|
|
555
|
+
vacancies: "Ledige stillingar",
|
|
556
|
+
contact: "Kontakt oss"
|
|
556
557
|
},
|
|
557
558
|
otherLanguages: "Andre språk"
|
|
558
559
|
},
|
|
@@ -576,7 +577,10 @@ const messages = {
|
|
|
576
577
|
h5p: "H5P",
|
|
577
578
|
video: "Video",
|
|
578
579
|
missing: "Ukjent",
|
|
579
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
580
584
|
},
|
|
581
585
|
modal: {
|
|
582
586
|
closeModal: "Lukk"
|
|
@@ -536,6 +536,7 @@ declare const messages: {
|
|
|
536
536
|
blog: string;
|
|
537
537
|
tips: string;
|
|
538
538
|
vacancies: string;
|
|
539
|
+
contact: string;
|
|
539
540
|
};
|
|
540
541
|
otherLanguages: string;
|
|
541
542
|
};
|
|
@@ -560,6 +561,9 @@ declare const messages: {
|
|
|
560
561
|
video: string;
|
|
561
562
|
missing: string;
|
|
562
563
|
external: string;
|
|
564
|
+
gloss: string;
|
|
565
|
+
programme: string;
|
|
566
|
+
"podcast-series": string;
|
|
563
567
|
};
|
|
564
568
|
modal: {
|
|
565
569
|
closeModal: string;
|
|
@@ -552,7 +552,8 @@ const messages = {
|
|
|
552
552
|
aboutNdla: "NDLA birra",
|
|
553
553
|
blog: "Fágablogga",
|
|
554
554
|
tips: "Cavgileapmi ohppiide",
|
|
555
|
-
vacancies: "Rabas virggit"
|
|
555
|
+
vacancies: "Rabas virggit",
|
|
556
|
+
contact: "Kontakt oss"
|
|
556
557
|
},
|
|
557
558
|
otherLanguages: "Andre språk"
|
|
558
559
|
},
|
|
@@ -576,7 +577,10 @@ const messages = {
|
|
|
576
577
|
h5p: "H5P",
|
|
577
578
|
video: "Video",
|
|
578
579
|
missing: "Ukjent",
|
|
579
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
580
584
|
},
|
|
581
585
|
modal: {
|
|
582
586
|
closeModal: "Govčča"
|
|
@@ -536,6 +536,7 @@ declare const messages: {
|
|
|
536
536
|
blog: string;
|
|
537
537
|
tips: string;
|
|
538
538
|
vacancies: string;
|
|
539
|
+
contact: string;
|
|
539
540
|
};
|
|
540
541
|
otherLanguages: string;
|
|
541
542
|
};
|
|
@@ -560,6 +561,9 @@ declare const messages: {
|
|
|
560
561
|
video: string;
|
|
561
562
|
missing: string;
|
|
562
563
|
external: string;
|
|
564
|
+
gloss: string;
|
|
565
|
+
programme: string;
|
|
566
|
+
"podcast-series": string;
|
|
563
567
|
};
|
|
564
568
|
modal: {
|
|
565
569
|
closeModal: string;
|