@ndla/ui 56.0.72-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 +4 -1
- package/es/locale/messages-nb.js +4 -1
- package/es/locale/messages-nn.js +4 -1
- package/es/locale/messages-se.js +4 -1
- package/es/locale/messages-sma.js +4 -1
- package/es/model/ContentType.js +1 -0
- 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 +3 -0
- package/lib/locale/messages-en.js +4 -1
- package/lib/locale/messages-nb.d.ts +3 -0
- package/lib/locale/messages-nb.js +4 -1
- package/lib/locale/messages-nn.d.ts +3 -0
- package/lib/locale/messages-nn.js +4 -1
- package/lib/locale/messages-se.d.ts +3 -0
- package/lib/locale/messages-se.js +4 -1
- package/lib/locale/messages-sma.d.ts +3 -0
- package/lib/locale/messages-sma.js +4 -1
- package/lib/model/ContentType.js +1 -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 +3 -0
- package/src/locale/messages-nb.ts +3 -0
- package/src/locale/messages-nn.ts +3 -0
- package/src/locale/messages-se.ts +3 -0
- package/src/locale/messages-sma.ts +3 -0
- package/src/model/ContentType.ts +1 -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
|
@@ -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");
|
|
@@ -577,7 +577,10 @@ const messages = {
|
|
|
577
577
|
h5p: "H5P",
|
|
578
578
|
video: "Video",
|
|
579
579
|
missing: "Unknown",
|
|
580
|
-
external: "External"
|
|
580
|
+
external: "External",
|
|
581
|
+
gloss: "Gloss",
|
|
582
|
+
programme: "Programme",
|
|
583
|
+
"podcast-series": "Podcast series"
|
|
581
584
|
},
|
|
582
585
|
modal: {
|
|
583
586
|
closeModal: "Close"
|
|
@@ -577,7 +577,10 @@ const messages = {
|
|
|
577
577
|
h5p: "H5P",
|
|
578
578
|
video: "Video",
|
|
579
579
|
missing: "Ukjent",
|
|
580
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
581
584
|
},
|
|
582
585
|
modal: {
|
|
583
586
|
closeModal: "Lukk"
|
|
@@ -577,7 +577,10 @@ const messages = {
|
|
|
577
577
|
h5p: "H5P",
|
|
578
578
|
video: "Video",
|
|
579
579
|
missing: "Ukjent",
|
|
580
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
581
584
|
},
|
|
582
585
|
modal: {
|
|
583
586
|
closeModal: "Lukk"
|
|
@@ -577,7 +577,10 @@ const messages = {
|
|
|
577
577
|
h5p: "H5P",
|
|
578
578
|
video: "Video",
|
|
579
579
|
missing: "Ukjent",
|
|
580
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
581
584
|
},
|
|
582
585
|
modal: {
|
|
583
586
|
closeModal: "Govčča"
|
|
@@ -577,7 +577,10 @@ const messages = {
|
|
|
577
577
|
h5p: "H5P",
|
|
578
578
|
video: "Video",
|
|
579
579
|
missing: "Ukjent",
|
|
580
|
-
external: "Ekstern"
|
|
580
|
+
external: "Ekstern",
|
|
581
|
+
gloss: "Glose",
|
|
582
|
+
programme: "Programfag",
|
|
583
|
+
"podcast-series": "Podkast-serie"
|
|
581
584
|
},
|
|
582
585
|
modal: {
|
|
583
586
|
closeModal: "Dahph"
|
package/lib/model/ContentType.js
CHANGED
|
@@ -59,6 +59,7 @@ const contentTypeMapping = exports.contentTypeMapping = {
|
|
|
59
59
|
[RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,
|
|
60
60
|
[RESOURCE_TYPE_CONCEPT]: CONCEPT,
|
|
61
61
|
[MULTIDISCIPLINARY]: MULTIDISCIPLINARY,
|
|
62
|
+
[TOPIC]: TOPIC,
|
|
62
63
|
default: SUBJECT_MATERIAL
|
|
63
64
|
};
|
|
64
65
|
const resourceEmbedTypeMapping = exports.resourceEmbedTypeMapping = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.73-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@ndla/core": "^5.0.2",
|
|
36
|
-
"@ndla/icons": "^8.0.
|
|
37
|
-
"@ndla/licenses": "^8.0.
|
|
38
|
-
"@ndla/primitives": "^1.0.
|
|
39
|
-
"@ndla/safelink": "^7.0.
|
|
36
|
+
"@ndla/icons": "^8.0.44-alpha.0",
|
|
37
|
+
"@ndla/licenses": "^8.0.4-alpha.0",
|
|
38
|
+
"@ndla/primitives": "^1.0.57-alpha.0",
|
|
39
|
+
"@ndla/safelink": "^7.0.58-alpha.0",
|
|
40
40
|
"@ndla/styled-system": "^0.0.27",
|
|
41
|
-
"@ndla/util": "^5.0.
|
|
41
|
+
"@ndla/util": "^5.0.1-alpha.0",
|
|
42
42
|
"html-react-parser": "^5.1.8",
|
|
43
43
|
"i18next-browser-languagedetector": "^7.1.0"
|
|
44
44
|
},
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"react-router-dom": "> 6.0.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@ndla/preset-panda": "^0.0.
|
|
53
|
+
"@ndla/preset-panda": "^0.0.45",
|
|
54
54
|
"@ndla/types-backend": "^0.2.86",
|
|
55
55
|
"@ndla/types-embed": "^5.0.4-alpha.0",
|
|
56
56
|
"@pandacss/dev": "^0.46.0"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "3f2d720f26b163be90b396f40f3c1fad746b3cf9"
|
|
62
62
|
}
|
package/src/Article/Article.tsx
CHANGED
|
@@ -12,8 +12,8 @@ import { Heading, Text } from "@ndla/primitives";
|
|
|
12
12
|
import { cx } from "@ndla/styled-system/css";
|
|
13
13
|
import { Stack, styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import { JsxStyleProps } from "@ndla/styled-system/types";
|
|
15
|
-
import { ArticleByline } from "./ArticleByline";
|
|
16
15
|
import { ContentTypeBadgeNew } from "..";
|
|
16
|
+
import { ArticleByline } from "./ArticleByline";
|
|
17
17
|
import { ContentType } from "../ContentTypeBadge/ContentTypeBadgeNew";
|
|
18
18
|
import { Article as ArticleType } from "../types";
|
|
19
19
|
|
|
@@ -200,7 +200,6 @@ export const Article = ({
|
|
|
200
200
|
authors={authors}
|
|
201
201
|
suppliers={copyright?.rightsholders}
|
|
202
202
|
published={published}
|
|
203
|
-
license={copyright?.license?.license ?? ""}
|
|
204
203
|
licenseBox={licenseBox}
|
|
205
204
|
/>
|
|
206
205
|
{children}
|
|
@@ -23,7 +23,6 @@ export default {
|
|
|
23
23
|
args: {
|
|
24
24
|
authors: [{ name: "Frida Forfatter" }, { name: "Fred Forfatter" }],
|
|
25
25
|
published: "21.06.2018",
|
|
26
|
-
license: "CC BY-SA",
|
|
27
26
|
},
|
|
28
27
|
} as Meta<typeof ArticleByline>;
|
|
29
28
|
|
|
@@ -36,7 +35,6 @@ ArticleBylineStory.storyName = "ArticleByline";
|
|
|
36
35
|
export const SeveralAuthors: StoryObj<typeof ArticleByline> = {
|
|
37
36
|
args: {
|
|
38
37
|
published: "21.06.2018",
|
|
39
|
-
license: "CC BY-SA",
|
|
40
38
|
authors: [{ name: "Frida Forfatter" }, { name: "Ida Illustratør" }, { name: "Fred Forfatter" }],
|
|
41
39
|
},
|
|
42
40
|
};
|
|
@@ -44,7 +42,6 @@ export const SeveralAuthors: StoryObj<typeof ArticleByline> = {
|
|
|
44
42
|
export const WithoutCreators: StoryObj<typeof ArticleByline> = {
|
|
45
43
|
args: {
|
|
46
44
|
published: "21.06.2018",
|
|
47
|
-
license: "CC BY-SA",
|
|
48
45
|
authors: [],
|
|
49
46
|
},
|
|
50
47
|
};
|