@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
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"paddingBlockStart]___[value:xsmall",
|
|
27
27
|
"borderTop]___[value:1px solid",
|
|
28
28
|
"borderColor]___[value:stroke.subtle",
|
|
29
|
-
"flexDirection]___[value:column-reverse",
|
|
30
29
|
"gap]___[value:3xsmall",
|
|
31
30
|
"justifyContent]___[value:space-between",
|
|
32
31
|
"paddingBlock]___[value:xsmall",
|
|
33
32
|
"textStyle]___[value:body.medium",
|
|
33
|
+
"marginInlineStart]___[value:auto]___[cond:& [data-contributors=\"false\"]",
|
|
34
34
|
"flexDirection]___[value:row]___[cond:tabletWide",
|
|
35
35
|
"gap]___[value:xsmall",
|
|
36
36
|
"listStyle]___[value:none",
|
|
@@ -86,6 +86,8 @@
|
|
|
86
86
|
"gridArea]___[value:track",
|
|
87
87
|
"paddingInline]___[value:xsmall]___[cond:mobileDown",
|
|
88
88
|
"minWidth]___[value:xxlarge",
|
|
89
|
+
"flexShrink]___[value:0",
|
|
90
|
+
"textAlign]___[value:center",
|
|
89
91
|
"gridArea]___[value:volume",
|
|
90
92
|
"paddingBlock]___[value:auto",
|
|
91
93
|
"paddingInline]___[value:auto",
|
|
@@ -137,6 +139,7 @@
|
|
|
137
139
|
"minWidth]___[value:surface.xxsmall",
|
|
138
140
|
"padding]___[value:medium",
|
|
139
141
|
"background]___[value:surface.default",
|
|
142
|
+
"flexDirection]___[value:column-reverse",
|
|
140
143
|
"alignItems]___[value:unset]___[cond:tablet",
|
|
141
144
|
"flexDirection]___[value:row]___[cond:tablet",
|
|
142
145
|
"zIndex]___[value:base",
|
|
@@ -261,7 +264,6 @@
|
|
|
261
264
|
"color]___[value:text.link",
|
|
262
265
|
"whiteSpace]___[value:nowrap",
|
|
263
266
|
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
264
|
-
"textAlign]___[value:center",
|
|
265
267
|
"color]___[value:text.strong]___[cond:& a",
|
|
266
268
|
"marginTop]___[value:0]___[cond:& h1",
|
|
267
269
|
"marginBottom]___[value:medium",
|
|
@@ -343,19 +345,6 @@
|
|
|
343
345
|
"width]___[value:surface.3xsmall",
|
|
344
346
|
"textStyle]___[value:heading.large",
|
|
345
347
|
"textStyle]___[value:title.medium",
|
|
346
|
-
"marginLeft]___[value:auto",
|
|
347
|
-
"marginRight]___[value:auto",
|
|
348
|
-
"paddingLeft]___[value:18px",
|
|
349
|
-
"paddingRight]___[value:18px",
|
|
350
|
-
"paddingLeft]___[value:medium]___[cond:mobileWide",
|
|
351
|
-
"paddingRight]___[value:medium]___[cond:mobileWide",
|
|
352
|
-
"content]___[value:\"\"!]___[cond:_after",
|
|
353
|
-
"display]___[value:block!]___[cond:_after",
|
|
354
|
-
"clear]___[value:both!]___[cond:_after",
|
|
355
|
-
"maxWidth]___[value:1150px",
|
|
356
|
-
"maxWidth]___[value:1024px",
|
|
357
|
-
"minHeight]___[value:100vh",
|
|
358
|
-
"backgroundColor]___[value:#f8f8f8]___[cond:tablet",
|
|
359
348
|
"textStyle]___[value:label.medium",
|
|
360
349
|
"color]___[value:text.subtle",
|
|
361
350
|
"borderColor]___[value:stroke.error",
|
package/dist/styles.css
CHANGED
|
@@ -281,6 +281,10 @@
|
|
|
281
281
|
min-width: var(--sizes-xxlarge);
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
+
.ta_center {
|
|
285
|
+
text-align: center;
|
|
286
|
+
}
|
|
287
|
+
|
|
284
288
|
.grid-area_volume {
|
|
285
289
|
grid-area: volume;
|
|
286
290
|
}
|
|
@@ -525,10 +529,6 @@
|
|
|
525
529
|
white-space: nowrap;
|
|
526
530
|
}
|
|
527
531
|
|
|
528
|
-
.ta_center {
|
|
529
|
-
text-align: center;
|
|
530
|
-
}
|
|
531
|
-
|
|
532
532
|
.my_xxlarge {
|
|
533
533
|
margin-block: var(--spacing-xxlarge);
|
|
534
534
|
}
|
|
@@ -569,18 +569,6 @@
|
|
|
569
569
|
width: var(--sizes-surface-3xsmall);
|
|
570
570
|
}
|
|
571
571
|
|
|
572
|
-
.max-w_1150px {
|
|
573
|
-
max-width: 1150px;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
.max-w_1024px {
|
|
577
|
-
max-width: 1024px;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
.min-h_100vh {
|
|
581
|
-
min-height: 100vh;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
572
|
.c_text\.subtle {
|
|
585
573
|
color: var(--colors-text-subtle);
|
|
586
574
|
}
|
|
@@ -641,10 +629,6 @@
|
|
|
641
629
|
border-color: var(--colors-stroke-subtle);
|
|
642
630
|
}
|
|
643
631
|
|
|
644
|
-
.flex-d_column-reverse {
|
|
645
|
-
flex-direction: column-reverse;
|
|
646
|
-
}
|
|
647
|
-
|
|
648
632
|
.jc_space-between {
|
|
649
633
|
justify-content: space-between;
|
|
650
634
|
}
|
|
@@ -661,6 +645,10 @@
|
|
|
661
645
|
justify-content: center;
|
|
662
646
|
}
|
|
663
647
|
|
|
648
|
+
.flex-sh_0 {
|
|
649
|
+
flex-shrink: 0;
|
|
650
|
+
}
|
|
651
|
+
|
|
664
652
|
.flex-wrap_wrap {
|
|
665
653
|
flex-wrap: wrap;
|
|
666
654
|
}
|
|
@@ -685,6 +673,10 @@
|
|
|
685
673
|
background-color: var(--colors-surface-brand-3);
|
|
686
674
|
}
|
|
687
675
|
|
|
676
|
+
.flex-d_column-reverse {
|
|
677
|
+
flex-direction: column-reverse;
|
|
678
|
+
}
|
|
679
|
+
|
|
688
680
|
.jc_flex-start {
|
|
689
681
|
justify-content: flex-start;
|
|
690
682
|
}
|
|
@@ -831,22 +823,6 @@
|
|
|
831
823
|
border-color: var(--colors-surface-brand-2);
|
|
832
824
|
}
|
|
833
825
|
|
|
834
|
-
.ml_auto {
|
|
835
|
-
margin-left: auto;
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
.mr_auto {
|
|
839
|
-
margin-right: auto;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
.pl_18px {
|
|
843
|
-
padding-left: 18px;
|
|
844
|
-
}
|
|
845
|
-
|
|
846
|
-
.pr_18px {
|
|
847
|
-
padding-right: 18px;
|
|
848
|
-
}
|
|
849
|
-
|
|
850
826
|
.bd-c_stroke\.error {
|
|
851
827
|
border-color: var(--colors-stroke-error);
|
|
852
828
|
}
|
|
@@ -875,6 +851,10 @@
|
|
|
875
851
|
padding-block-end: var(--spacing-5xlarge);
|
|
876
852
|
}
|
|
877
853
|
|
|
854
|
+
.\[\&_\[data-contributors\=\"false\"\]\]\:ms_auto [data-contributors="false"] {
|
|
855
|
+
margin-inline-start: auto;
|
|
856
|
+
}
|
|
857
|
+
|
|
878
858
|
.\[\&_img\]\:w_100\% img {
|
|
879
859
|
width: 100%;
|
|
880
860
|
}
|
|
@@ -1071,14 +1051,6 @@
|
|
|
1071
1051
|
padding-block: var(--spacing-xxlarge);
|
|
1072
1052
|
}
|
|
1073
1053
|
|
|
1074
|
-
.after\:d_block\!::after {
|
|
1075
|
-
display: block !important;
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
.after\:clear_both\!::after {
|
|
1079
|
-
clear: both !important;
|
|
1080
|
-
}
|
|
1081
|
-
|
|
1082
1054
|
.\[\&_h3\]\:td_underline h3 {
|
|
1083
1055
|
text-decoration: underline;
|
|
1084
1056
|
}
|
|
@@ -1174,10 +1146,6 @@
|
|
|
1174
1146
|
top: var(--masthead-height, 0px);
|
|
1175
1147
|
}
|
|
1176
1148
|
|
|
1177
|
-
.after\:content_\"\"\!::after {
|
|
1178
|
-
content: "" !important;
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
1149
|
.\[\&_\[data-forward\]\]\:trs-prop_width\,_height [data-forward] {
|
|
1182
1150
|
--transition-prop: width, height;
|
|
1183
1151
|
transition-property: width, height;
|
|
@@ -1347,12 +1315,6 @@
|
|
|
1347
1315
|
@media screen and (min-width: 29.75rem) {
|
|
1348
1316
|
.mobileWide\:d_none {
|
|
1349
1317
|
display: none;
|
|
1350
|
-
}
|
|
1351
|
-
.mobileWide\:pl_medium {
|
|
1352
|
-
padding-left: var(--spacing-medium);
|
|
1353
|
-
}
|
|
1354
|
-
.mobileWide\:pr_medium {
|
|
1355
|
-
padding-right: var(--spacing-medium);
|
|
1356
1318
|
}
|
|
1357
1319
|
}
|
|
1358
1320
|
|
|
@@ -1407,9 +1369,6 @@
|
|
|
1407
1369
|
}
|
|
1408
1370
|
.tablet\:mb_xxlarge {
|
|
1409
1371
|
margin-bottom: var(--spacing-xxlarge);
|
|
1410
|
-
}
|
|
1411
|
-
.tablet\:bg-c_\#f8f8f8 {
|
|
1412
|
-
background-color: #f8f8f8;
|
|
1413
1372
|
}
|
|
1414
1373
|
.\[\&\[data-has-image\=\'true\'\]\]\:tablet\:py_xsmall[data-has-image='true'] {
|
|
1415
1374
|
padding-block: var(--spacing-xsmall);
|
package/es/Article/Article.js
CHANGED
|
@@ -11,8 +11,8 @@ import { ark } from "@ark-ui/react";
|
|
|
11
11
|
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
|
-
import { ArticleByline } from "./ArticleByline";
|
|
15
14
|
import { ContentTypeBadgeNew } from "..";
|
|
15
|
+
import { ArticleByline } from "./ArticleByline";
|
|
16
16
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const StyledArticleContent = styled(ark.section, {}, {
|
|
18
18
|
baseComponent: true
|
|
@@ -179,7 +179,6 @@ export const Article = _ref3 => {
|
|
|
179
179
|
authors: authors,
|
|
180
180
|
suppliers: copyright?.rightsholders,
|
|
181
181
|
published: published,
|
|
182
|
-
license: copyright?.license?.license ?? "",
|
|
183
182
|
licenseBox: licenseBox
|
|
184
183
|
}), children]
|
|
185
184
|
})]
|
|
@@ -10,12 +10,10 @@ import { forwardRef, useCallback, useEffect, useState } from "react";
|
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
11
|
import { useLocation } from "react-router-dom";
|
|
12
12
|
import { ArrowDownShortLine } from "@ndla/icons/common";
|
|
13
|
-
import { getLicenseByAbbreviation } from "@ndla/licenses";
|
|
14
13
|
import { AccordionItem, AccordionItemContent, AccordionItemIndicator, AccordionItemTrigger, AccordionRoot, Heading } from "@ndla/primitives";
|
|
15
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
15
|
import { ArticleFootNotes } from "./ArticleFootNotes";
|
|
17
|
-
import {
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
19
17
|
const Wrapper = styled("div", {
|
|
20
18
|
base: {
|
|
21
19
|
// TODO: Figure out if we want to remove this margin. It's only here to add some gap between the article content and the byline.
|
|
@@ -28,12 +26,15 @@ const Wrapper = styled("div", {
|
|
|
28
26
|
const TextWrapper = styled("div", {
|
|
29
27
|
base: {
|
|
30
28
|
display: "flex",
|
|
31
|
-
flexDirection: "column
|
|
29
|
+
flexDirection: "column",
|
|
32
30
|
gap: "3xsmall",
|
|
33
31
|
width: "100%",
|
|
34
32
|
justifyContent: "space-between",
|
|
35
33
|
paddingBlock: "xsmall",
|
|
36
|
-
textStyle: "body.medium"
|
|
34
|
+
textStyle: "body.medium",
|
|
35
|
+
'& [data-contributors="false"]': {
|
|
36
|
+
marginInlineStart: "auto"
|
|
37
|
+
}
|
|
37
38
|
},
|
|
38
39
|
variants: {
|
|
39
40
|
learningpath: {
|
|
@@ -70,12 +71,6 @@ const getSuppliersText = (suppliers, t) => {
|
|
|
70
71
|
}
|
|
71
72
|
});
|
|
72
73
|
};
|
|
73
|
-
const LicenseWrapper = styled("div", {
|
|
74
|
-
base: {
|
|
75
|
-
display: "flex",
|
|
76
|
-
gap: "xsmall"
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
74
|
const StyledAccordionRoot = styled(AccordionRoot, {
|
|
80
75
|
base: {
|
|
81
76
|
paddingBlockStart: "xxlarge"
|
|
@@ -88,10 +83,8 @@ export const ArticleByline = _ref => {
|
|
|
88
83
|
authors = [],
|
|
89
84
|
suppliers = [],
|
|
90
85
|
footnotes,
|
|
91
|
-
license: licenseString,
|
|
92
86
|
licenseBox,
|
|
93
87
|
published,
|
|
94
|
-
locale,
|
|
95
88
|
displayByline = true,
|
|
96
89
|
bylineType = "article"
|
|
97
90
|
} = _ref;
|
|
@@ -119,27 +112,23 @@ export const ArticleByline = _ref => {
|
|
|
119
112
|
window.addEventListener("hashchange", onHashChange);
|
|
120
113
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
121
114
|
}, [onHashChange]);
|
|
122
|
-
const license = licenseString && getLicenseByAbbreviation(licenseString, locale);
|
|
123
115
|
const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
|
|
124
116
|
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
125
|
-
children: [displayByline && /*#__PURE__*/_jsxs(TextWrapper, {
|
|
117
|
+
children: [!!displayByline && /*#__PURE__*/_jsxs(TextWrapper, {
|
|
126
118
|
learningpath: bylineType === "learningPath",
|
|
127
|
-
children: [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
escapeValue: false
|
|
139
|
-
}
|
|
140
|
-
})}. `, getSuppliersText(suppliers, t)]
|
|
141
|
-
})]
|
|
119
|
+
children: [!!showPrimaryContributors &&
|
|
120
|
+
/*#__PURE__*/
|
|
121
|
+
//eslint-disable-next-line react/no-unknown-property
|
|
122
|
+
_jsxs("span", {
|
|
123
|
+
property: "cc:attributionName",
|
|
124
|
+
children: [authors.length > 0 && `${t("article.authorsLabel", {
|
|
125
|
+
names: renderContributors(authors, t),
|
|
126
|
+
interpolation: {
|
|
127
|
+
escapeValue: false
|
|
128
|
+
}
|
|
129
|
+
})}. `, getSuppliersText(suppliers, t)]
|
|
142
130
|
}), /*#__PURE__*/_jsxs("div", {
|
|
131
|
+
"data-contributors": showPrimaryContributors,
|
|
143
132
|
children: [t(`${bylineType}.lastUpdated`), " ", published]
|
|
144
133
|
})]
|
|
145
134
|
}), (!!licenseBox || !!footnotes?.length) && /*#__PURE__*/_jsxs(StyledAccordionRoot, {
|
|
@@ -165,7 +165,7 @@ const AudioPlayer = _ref => {
|
|
|
165
165
|
});
|
|
166
166
|
return /*#__PURE__*/_jsxs(AudioPlayerWrapper, {
|
|
167
167
|
children: [/*#__PURE__*/_jsxs(InfoWrapper, {
|
|
168
|
-
children: [img && /*#__PURE__*/_jsx(ImageWrapper, {
|
|
168
|
+
children: [!!img && /*#__PURE__*/_jsx(ImageWrapper, {
|
|
169
169
|
children: /*#__PURE__*/_jsx("img", {
|
|
170
170
|
src: img.url,
|
|
171
171
|
alt: img.alt
|
|
@@ -186,7 +186,7 @@ const AudioPlayer = _ref => {
|
|
|
186
186
|
})
|
|
187
187
|
})]
|
|
188
188
|
}), !!textVersion && !img && textVersionButton]
|
|
189
|
-
}), description && /*#__PURE__*/_jsxs(Text, {
|
|
189
|
+
}), !!description && /*#__PURE__*/_jsxs(Text, {
|
|
190
190
|
textStyle: "body.medium",
|
|
191
191
|
children: [showFullDescription || description.length < DESCRIPTION_MAX_LENGTH ? description : `${truncatedDescription}...`, description.length > DESCRIPTION_MAX_LENGTH && /*#__PURE__*/_jsx(ShowMoreButton, {
|
|
192
192
|
variant: "link",
|
package/es/Concept/Concept.js
CHANGED
|
@@ -64,7 +64,7 @@ export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
64
64
|
embed: visualElement
|
|
65
65
|
}) : visualElement?.resource === "external" ? /*#__PURE__*/_jsx(ExternalEmbed, {
|
|
66
66
|
embed: visualElement
|
|
67
|
-
}) : null, copyright && /*#__PURE__*/_jsx(EmbedByline, {
|
|
67
|
+
}) : null, !!copyright && /*#__PURE__*/_jsx(EmbedByline, {
|
|
68
68
|
copyright: copyright,
|
|
69
69
|
type: "concept"
|
|
70
70
|
})]
|
|
@@ -183,7 +183,7 @@ export const ContactBlock = _ref => {
|
|
|
183
183
|
textStyle: "body.large",
|
|
184
184
|
children: description
|
|
185
185
|
})]
|
|
186
|
-
}), image && /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
186
|
+
}), !!image && /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
187
187
|
variant: backgroundColor,
|
|
188
188
|
children: [/*#__PURE__*/_jsx(StyledImage, {
|
|
189
189
|
alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
|
|
@@ -26,7 +26,10 @@ export const contentTypeToBadgeVariantMap = {
|
|
|
26
26
|
[contentTypes.AUDIO]: "brand1",
|
|
27
27
|
[contentTypes.PODCAST]: "brand1",
|
|
28
28
|
[contentTypes.VIDEO]: "brand1",
|
|
29
|
-
[contentTypes.MISSING]: "neutral"
|
|
29
|
+
[contentTypes.MISSING]: "neutral",
|
|
30
|
+
[contentTypes.PODCAST_SERIES]: "brand1",
|
|
31
|
+
[contentTypes.GLOSS]: "brand1",
|
|
32
|
+
[contentTypes.PROGRAMME]: "neutral"
|
|
30
33
|
};
|
|
31
34
|
export const ContentTypeBadge = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
32
35
|
let {
|
|
@@ -27,7 +27,12 @@ export const contentTypeToHeroMap = {
|
|
|
27
27
|
[contentTypes.AUDIO]: "primary",
|
|
28
28
|
[contentTypes.PODCAST]: "primary",
|
|
29
29
|
[contentTypes.VIDEO]: "primary",
|
|
30
|
-
[contentTypes.MISSING]: "neutral"
|
|
30
|
+
[contentTypes.MISSING]: "neutral",
|
|
31
|
+
[contentTypes.GLOSS]: "brand1Moderate",
|
|
32
|
+
// this will never happen
|
|
33
|
+
[contentTypes.PROGRAMME]: "primary",
|
|
34
|
+
// this will never happen
|
|
35
|
+
[contentTypes.PODCAST_SERIES]: "primary"
|
|
31
36
|
};
|
|
32
37
|
export const ContentTypeHero = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
33
38
|
let {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { contentTypeMapping } from "../model/ContentType";
|
|
11
11
|
import { RelatedArticle } from "../RelatedArticleList/RelatedArticleList";
|
|
12
|
-
import {
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const RelatedContentEmbed = _ref => {
|
|
14
14
|
let {
|
|
15
15
|
embed,
|
|
@@ -21,7 +21,7 @@ const RelatedContentEmbed = _ref => {
|
|
|
21
21
|
t
|
|
22
22
|
} = useTranslation();
|
|
23
23
|
if (embed.status === "error") {
|
|
24
|
-
return
|
|
24
|
+
return null;
|
|
25
25
|
}
|
|
26
26
|
const {
|
|
27
27
|
data,
|
|
@@ -49,6 +49,6 @@ const RelatedContentEmbed = _ref => {
|
|
|
49
49
|
linkInfo: `${t("related.linkInfo")} ${embedData.urlDomain}`
|
|
50
50
|
});
|
|
51
51
|
}
|
|
52
|
-
return
|
|
52
|
+
return null;
|
|
53
53
|
};
|
|
54
54
|
export default RelatedContentEmbed;
|
|
@@ -60,31 +60,31 @@ export const ErrorMessage = _ref => {
|
|
|
60
60
|
customElement
|
|
61
61
|
} = _ref;
|
|
62
62
|
return /*#__PURE__*/_jsxs(StyledErrorMessage, {
|
|
63
|
-
children: [illustration && /*#__PURE__*/_jsx(IllustrationWrapper, {
|
|
63
|
+
children: [!!illustration && /*#__PURE__*/_jsx(IllustrationWrapper, {
|
|
64
64
|
children: /*#__PURE__*/_jsx("img", {
|
|
65
65
|
src: illustration.url,
|
|
66
66
|
alt: illustration.altText
|
|
67
67
|
})
|
|
68
|
-
}), illustrationElement && /*#__PURE__*/_jsx(IllustrationWrapper, {
|
|
68
|
+
}), !!illustrationElement && /*#__PURE__*/_jsx(IllustrationWrapper, {
|
|
69
69
|
children: illustrationElement
|
|
70
70
|
}), /*#__PURE__*/_jsx("h1", {
|
|
71
71
|
children: messages.title
|
|
72
|
-
}), messages.description && /*#__PURE__*/_jsx(Description, {
|
|
72
|
+
}), !!messages.description && /*#__PURE__*/_jsx(Description, {
|
|
73
73
|
children: messages.description
|
|
74
|
-
}), customElement && /*#__PURE__*/_jsx(CustomElementWrapper, {
|
|
74
|
+
}), !!customElement && /*#__PURE__*/_jsx(CustomElementWrapper, {
|
|
75
75
|
children: customElement
|
|
76
|
-
}), messages.linksTitle && /*#__PURE__*/_jsx("h2", {
|
|
76
|
+
}), !!messages.linksTitle && /*#__PURE__*/_jsx("h2", {
|
|
77
77
|
children: messages.linksTitle
|
|
78
|
-
}), messages.back && /*#__PURE__*/_jsx(SafeLink, {
|
|
78
|
+
}), !!messages.back && /*#__PURE__*/_jsx(SafeLink, {
|
|
79
79
|
to: `/#${encodeURI(messages.back)}`,
|
|
80
80
|
onClick: () => window.history.back(),
|
|
81
81
|
children: messages.back
|
|
82
|
-
}), messages.goToFrontPage && /*#__PURE__*/_jsx(MessageWrapper, {
|
|
82
|
+
}), !!messages.goToFrontPage && /*#__PURE__*/_jsx(MessageWrapper, {
|
|
83
83
|
children: /*#__PURE__*/_jsx(SafeLink, {
|
|
84
84
|
to: "/",
|
|
85
85
|
children: messages.goToFrontPage
|
|
86
86
|
})
|
|
87
|
-
}), messages.logInFailed && /*#__PURE__*/_jsx(MessageWrapper, {
|
|
87
|
+
}), !!messages.logInFailed && /*#__PURE__*/_jsx(MessageWrapper, {
|
|
88
88
|
children: /*#__PURE__*/_jsx(SafeLink, {
|
|
89
89
|
to: "/minndla",
|
|
90
90
|
children: messages.logInFailed
|
package/es/Gloss/Gloss.js
CHANGED
|
@@ -107,7 +107,7 @@ const Gloss = _ref => {
|
|
|
107
107
|
children: /*#__PURE__*/_jsx("span", {
|
|
108
108
|
children: glossData.gloss
|
|
109
109
|
})
|
|
110
|
-
}), glossData.transcriptions.traditional && /*#__PURE__*/_jsx(Text, {
|
|
110
|
+
}), !!glossData.transcriptions.traditional && /*#__PURE__*/_jsx(Text, {
|
|
111
111
|
textStyle: "label.medium",
|
|
112
112
|
asChild: true,
|
|
113
113
|
consumeCss: true,
|
|
@@ -116,7 +116,7 @@ const Gloss = _ref => {
|
|
|
116
116
|
lang: glossData.originalLanguage,
|
|
117
117
|
children: glossData.transcriptions.traditional
|
|
118
118
|
}, t("gloss.transcriptions.traditional"))
|
|
119
|
-
}), glossData.transcriptions.pinyin && /*#__PURE__*/_jsx(Text, {
|
|
119
|
+
}), !!glossData.transcriptions.pinyin && /*#__PURE__*/_jsx(Text, {
|
|
120
120
|
textStyle: "label.medium",
|
|
121
121
|
asChild: true,
|
|
122
122
|
consumeCss: true,
|
|
@@ -126,7 +126,7 @@ const Gloss = _ref => {
|
|
|
126
126
|
lang: glossData.originalLanguage,
|
|
127
127
|
children: glossData.transcriptions.pinyin
|
|
128
128
|
}, t("gloss.transcriptions.pinyin"))
|
|
129
|
-
}), glossData.wordClass && /*#__PURE__*/_jsx(Text, {
|
|
129
|
+
}), !!glossData.wordClass && /*#__PURE__*/_jsx(Text, {
|
|
130
130
|
textStyle: "label.medium",
|
|
131
131
|
asChild: true,
|
|
132
132
|
consumeCss: true,
|
|
@@ -135,7 +135,7 @@ const Gloss = _ref => {
|
|
|
135
135
|
children: t(`wordClass.${glossData.wordClass}`).toLowerCase()
|
|
136
136
|
})
|
|
137
137
|
})]
|
|
138
|
-
}), audio?.src && /*#__PURE__*/_jsx(SpeechControl, {
|
|
138
|
+
}), !!audio?.src && /*#__PURE__*/_jsx(SpeechControl, {
|
|
139
139
|
src: audio.src,
|
|
140
140
|
title: audio.title,
|
|
141
141
|
type: "gloss"
|
|
@@ -48,7 +48,7 @@ const KeyFigure = _ref => {
|
|
|
48
48
|
} = _ref;
|
|
49
49
|
return /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
50
50
|
"data-embed-type": "key-figure",
|
|
51
|
-
children: [image && /*#__PURE__*/_jsx(StyledImage, {
|
|
51
|
+
children: [!!image && /*#__PURE__*/_jsx(StyledImage, {
|
|
52
52
|
src: `${image?.src}?width=150`,
|
|
53
53
|
width: 150,
|
|
54
54
|
height: 150,
|
|
@@ -85,7 +85,7 @@ export const EmbedByline = _ref => {
|
|
|
85
85
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
86
86
|
children: [!hideByline && /*#__PURE__*/_jsx(BylineWrapper, {
|
|
87
87
|
children: /*#__PURE__*/_jsxs("div", {
|
|
88
|
-
children: [hideCopyright && description, !hideCopyright && /*#__PURE__*/_jsx(LicenseContainerContent, {
|
|
88
|
+
children: [!!hideCopyright && description, !hideCopyright && /*#__PURE__*/_jsx(LicenseContainerContent, {
|
|
89
89
|
type: type,
|
|
90
90
|
copyright: copyright,
|
|
91
91
|
children: description
|
|
@@ -93,7 +93,7 @@ const LinkBlock = _ref => {
|
|
|
93
93
|
"data-heading": true,
|
|
94
94
|
children: parse(title)
|
|
95
95
|
})
|
|
96
|
-
}), date && /*#__PURE__*/_jsxs(StyledDateContainer, {
|
|
96
|
+
}), !!date && /*#__PURE__*/_jsxs(StyledDateContainer, {
|
|
97
97
|
children: [/*#__PURE__*/_jsx(StyledCalendarEd, {}), formattedDate]
|
|
98
98
|
})]
|
|
99
99
|
}), /*#__PURE__*/_jsx(ArrowRightLine, {
|
|
@@ -10,8 +10,6 @@ export const formatNestedMessages = function (phrases) {
|
|
|
10
10
|
let formattedMessages = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
11
11
|
let prefix = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
|
12
12
|
const messages = formattedMessages;
|
|
13
|
-
|
|
14
|
-
// eslint-disable-next-line
|
|
15
13
|
Object.keys(phrases).forEach(key => {
|
|
16
14
|
const value = phrases[key];
|
|
17
15
|
if ({}.hasOwnProperty.call(phrases, key)) {
|
package/es/index.js
CHANGED
|
@@ -30,7 +30,6 @@ export { default as messagesSE } from "./locale/messages-se";
|
|
|
30
30
|
export { default as messagesSMA } from "./locale/messages-sma";
|
|
31
31
|
export { default as Breadcrumb, HomeBreadcrumb } from "./Breadcrumb";
|
|
32
32
|
export { i18nInstance, formatNestedMessages, useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations } from "./i18n";
|
|
33
|
-
export { OneColumn, PageContainer } from "./Layout";
|
|
34
33
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, SourceMaterialBadge, ConceptBadge } from "./ContentTypeBadge";
|
|
35
34
|
export { ContentTypeBadge as ContentTypeBadgeNew, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
36
35
|
export { ContentTypeBlockQuote } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
|
package/es/locale/messages-en.js
CHANGED
|
@@ -570,7 +570,10 @@ const messages = {
|
|
|
570
570
|
h5p: "H5P",
|
|
571
571
|
video: "Video",
|
|
572
572
|
missing: "Unknown",
|
|
573
|
-
external: "External"
|
|
573
|
+
external: "External",
|
|
574
|
+
gloss: "Gloss",
|
|
575
|
+
programme: "Programme",
|
|
576
|
+
"podcast-series": "Podcast series"
|
|
574
577
|
},
|
|
575
578
|
modal: {
|
|
576
579
|
closeModal: "Close"
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -570,7 +570,10 @@ const messages = {
|
|
|
570
570
|
h5p: "H5P",
|
|
571
571
|
video: "Video",
|
|
572
572
|
missing: "Ukjent",
|
|
573
|
-
external: "Ekstern"
|
|
573
|
+
external: "Ekstern",
|
|
574
|
+
gloss: "Glose",
|
|
575
|
+
programme: "Programfag",
|
|
576
|
+
"podcast-series": "Podkast-serie"
|
|
574
577
|
},
|
|
575
578
|
modal: {
|
|
576
579
|
closeModal: "Lukk"
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -570,7 +570,10 @@ const messages = {
|
|
|
570
570
|
h5p: "H5P",
|
|
571
571
|
video: "Video",
|
|
572
572
|
missing: "Ukjent",
|
|
573
|
-
external: "Ekstern"
|
|
573
|
+
external: "Ekstern",
|
|
574
|
+
gloss: "Glose",
|
|
575
|
+
programme: "Programfag",
|
|
576
|
+
"podcast-series": "Podkast-serie"
|
|
574
577
|
},
|
|
575
578
|
modal: {
|
|
576
579
|
closeModal: "Lukk"
|
package/es/locale/messages-se.js
CHANGED
|
@@ -570,7 +570,10 @@ const messages = {
|
|
|
570
570
|
h5p: "H5P",
|
|
571
571
|
video: "Video",
|
|
572
572
|
missing: "Ukjent",
|
|
573
|
-
external: "Ekstern"
|
|
573
|
+
external: "Ekstern",
|
|
574
|
+
gloss: "Glose",
|
|
575
|
+
programme: "Programfag",
|
|
576
|
+
"podcast-series": "Podkast-serie"
|
|
574
577
|
},
|
|
575
578
|
modal: {
|
|
576
579
|
closeModal: "Govčča"
|
|
@@ -570,7 +570,10 @@ const messages = {
|
|
|
570
570
|
h5p: "H5P",
|
|
571
571
|
video: "Video",
|
|
572
572
|
missing: "Ukjent",
|
|
573
|
-
external: "Ekstern"
|
|
573
|
+
external: "Ekstern",
|
|
574
|
+
gloss: "Glose",
|
|
575
|
+
programme: "Programfag",
|
|
576
|
+
"podcast-series": "Podkast-serie"
|
|
574
577
|
},
|
|
575
578
|
modal: {
|
|
576
579
|
closeModal: "Dahph"
|
package/es/model/ContentType.js
CHANGED
|
@@ -53,6 +53,7 @@ export const contentTypeMapping = {
|
|
|
53
53
|
[RESOURCE_TYPE_SOURCE_MATERIAL]: SOURCE_MATERIAL,
|
|
54
54
|
[RESOURCE_TYPE_CONCEPT]: CONCEPT,
|
|
55
55
|
[MULTIDISCIPLINARY]: MULTIDISCIPLINARY,
|
|
56
|
+
[TOPIC]: TOPIC,
|
|
56
57
|
default: SUBJECT_MATERIAL
|
|
57
58
|
};
|
|
58
59
|
export const resourceEmbedTypeMapping = {
|
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
|
}
|