@ndla/ui 56.0.18-alpha.0 → 56.0.19-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 +10 -8
- package/dist/styles.css +35 -29
- package/es/Article/Article.js +3 -3
- package/es/Article/ArticleByline.js +5 -4
- package/es/Article/index.js +1 -2
- package/es/AudioPlayer/AudioPlayer.js +1 -1
- package/es/CampaignBlock/CampaignBlock.js +25 -13
- package/es/Concept/Concept.js +4 -0
- package/es/ContactBlock/ContactBlock.js +0 -1
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +0 -3
- package/es/ContentTypeHero/ContentTypeHero.js +2 -8
- package/es/Embed/AudioEmbed.js +3 -0
- package/es/Embed/BrightcoveEmbed.js +5 -1
- package/es/Embed/ConceptEmbed.js +19 -10
- package/es/Embed/ConceptListEmbed.js +2 -1
- package/es/Embed/ImageEmbed.js +3 -0
- package/es/Embed/index.js +1 -0
- package/es/FileList/FileList.js +5 -1
- package/es/FileList/PdfFile.js +6 -1
- package/es/FileList/index.js +1 -1
- package/es/Grid/Grid.js +0 -1
- package/es/LicenseByline/EmbedByline.js +4 -1
- package/es/TreeStructure/TreeStructure.js +0 -2
- package/es/i18n/index.js +1 -1
- package/es/i18n/useComponentTranslations.js +61 -0
- package/es/index.js +7 -5
- package/es/locale/messages-en.js +23 -1
- package/es/locale/messages-nb.js +23 -1
- package/es/locale/messages-nn.js +71 -49
- package/es/locale/messages-se.js +23 -1
- package/es/locale/messages-sma.js +23 -1
- package/es/styles.css +35 -29
- package/es/utils/licenseAttributes.js +18 -0
- package/lib/Article/Article.js +3 -3
- package/lib/Article/ArticleByline.js +5 -4
- package/lib/Article/index.d.ts +0 -1
- package/lib/Article/index.js +1 -8
- package/lib/AudioPlayer/AudioPlayer.js +1 -1
- package/lib/CampaignBlock/CampaignBlock.js +25 -13
- package/lib/Concept/Concept.d.ts +1 -0
- package/lib/Concept/Concept.js +4 -0
- package/lib/ContactBlock/ContactBlock.js +0 -1
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +0 -3
- package/lib/ContentTypeHero/ContentTypeHero.js +2 -7
- package/lib/Embed/AudioEmbed.js +3 -0
- package/lib/Embed/BrightcoveEmbed.d.ts +2 -1
- package/lib/Embed/BrightcoveEmbed.js +5 -1
- package/lib/Embed/ConceptEmbed.d.ts +1 -0
- package/lib/Embed/ConceptEmbed.js +19 -10
- package/lib/Embed/ConceptListEmbed.js +2 -1
- package/lib/Embed/ImageEmbed.js +3 -0
- package/lib/Embed/index.d.ts +1 -0
- package/lib/Embed/index.js +7 -0
- package/lib/FileList/FileList.d.ts +3 -1
- package/lib/FileList/FileList.js +5 -1
- package/lib/FileList/PdfFile.js +6 -1
- package/lib/FileList/index.d.ts +1 -1
- package/lib/FileList/index.js +6 -0
- package/lib/Grid/Grid.js +0 -1
- package/lib/LicenseByline/EmbedByline.js +4 -1
- package/lib/TreeStructure/TreeStructure.js +0 -2
- package/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/index.js +12 -0
- package/lib/i18n/useComponentTranslations.d.ts +31 -0
- package/lib/i18n/useComponentTranslations.js +64 -2
- package/lib/index.d.ts +6 -4
- package/lib/index.js +38 -6
- package/lib/locale/messages-en.d.ts +22 -0
- package/lib/locale/messages-en.js +23 -1
- package/lib/locale/messages-nb.d.ts +22 -0
- package/lib/locale/messages-nb.js +23 -1
- package/lib/locale/messages-nn.d.ts +22 -0
- package/lib/locale/messages-nn.js +71 -49
- package/lib/locale/messages-se.d.ts +22 -0
- package/lib/locale/messages-se.js +23 -1
- package/lib/locale/messages-sma.d.ts +22 -0
- package/lib/locale/messages-sma.js +23 -1
- package/lib/styles.css +35 -29
- package/lib/utils/licenseAttributes.d.ts +16 -0
- package/lib/utils/licenseAttributes.js +25 -0
- package/package.json +8 -8
- package/src/Article/Article.tsx +7 -6
- package/src/Article/ArticleByline.tsx +2 -3
- package/src/Article/index.ts +0 -2
- package/src/AudioPlayer/AudioPlayer.tsx +5 -3
- package/src/CampaignBlock/CampaignBlock.tsx +23 -12
- package/src/Concept/Concept.tsx +6 -2
- package/src/ContactBlock/ContactBlock.tsx +0 -1
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +0 -3
- package/src/ContentTypeHero/ContentTypeHero.tsx +2 -7
- package/src/Embed/AudioEmbed.tsx +4 -1
- package/src/Embed/BrightcoveEmbed.tsx +6 -3
- package/src/Embed/ConceptEmbed.tsx +17 -10
- package/src/Embed/ConceptListEmbed.tsx +1 -0
- package/src/Embed/ImageEmbed.tsx +4 -0
- package/src/Embed/index.ts +1 -0
- package/src/FileList/FileList.tsx +16 -10
- package/src/FileList/PdfFile.tsx +8 -2
- package/src/FileList/index.ts +1 -1
- package/src/Grid/Grid.tsx +0 -1
- package/src/LicenseByline/EmbedByline.tsx +2 -1
- package/src/TreeStructure/TreeStructure.tsx +0 -1
- package/src/i18n/index.ts +2 -0
- package/src/i18n/useComponentTranslations.ts +78 -0
- package/src/index.ts +8 -2
- package/src/locale/messages-en.ts +24 -1
- package/src/locale/messages-nb.ts +24 -1
- package/src/locale/messages-nn.ts +72 -49
- package/src/locale/messages-se.ts +24 -1
- package/src/locale/messages-sma.ts +24 -1
- package/src/utils/licenseAttributes.ts +23 -0
- package/es/Article/ArticleParagraph.js +0 -23
- package/lib/Article/ArticleParagraph.d.ts +0 -13
- package/lib/Article/ArticleParagraph.js +0 -30
- package/src/Article/ArticleParagraph.tsx +0 -27
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
"background]___[value:background.default",
|
|
6
6
|
"display]___[value:flex",
|
|
7
7
|
"flexDirection]___[value:column",
|
|
8
|
-
"gap]___[value:xxlarge",
|
|
9
8
|
"color]___[value:text.default",
|
|
10
9
|
"alignItems]___[value:center",
|
|
11
10
|
"width]___[value:100%",
|
|
@@ -19,6 +18,7 @@
|
|
|
19
18
|
"overflowWrap]___[value:anywhere]___[cond:& h1",
|
|
20
19
|
"gap]___[value:medium",
|
|
21
20
|
"paddingBlockStart]___[value:xxlarge",
|
|
21
|
+
"gap]___[value:xxlarge",
|
|
22
22
|
"paddingBlockEnd]___[value:5xlarge]___[cond:& > :is(:last-child)",
|
|
23
23
|
"minHeight]___[value:xxlarge",
|
|
24
24
|
"marginBlockStart]___[value:medium",
|
|
@@ -33,8 +33,6 @@
|
|
|
33
33
|
"flexDirection]___[value:row]___[cond:tabletWide",
|
|
34
34
|
"gap]___[value:xsmall",
|
|
35
35
|
"listStyle]___[value:none",
|
|
36
|
-
"textAlign]___[value:center]___[cond:&[data-align=\"center\"]",
|
|
37
|
-
"direction]___[value:rtl]___[cond:&:has(span[dir=\"rtl\"])",
|
|
38
36
|
"border]___[value:1px solid",
|
|
39
37
|
"borderColor]___[value:stroke.default",
|
|
40
38
|
"borderRadius]___[value:xsmall",
|
|
@@ -122,11 +120,15 @@
|
|
|
122
120
|
"textDecoration]___[value:none]___[cond:_hover",
|
|
123
121
|
"textDecoration]___[value:none]___[cond:_focusVisible",
|
|
124
122
|
"display]___[value:none]___[cond:tabletDown",
|
|
123
|
+
"display]___[value:grid",
|
|
124
|
+
"gridTemplateColumns]___[value:1fr",
|
|
125
|
+
"gridTemplateColumns]___[value:minmax(230px, 455px) auto]___[cond:tabletWide",
|
|
126
|
+
"gridTemplateColumns]___[value:auto minmax(230px, 455px)]___[cond:tabletWide",
|
|
125
127
|
"fontWeight]___[value:bold",
|
|
126
|
-
"alignSelf]___[value:center",
|
|
127
128
|
"height]___[value:215px",
|
|
128
|
-
"height]___[value:
|
|
129
|
-
"
|
|
129
|
+
"height]___[value:265px]___[cond:tablet",
|
|
130
|
+
"height]___[value:340px]___[cond:tabletWide",
|
|
131
|
+
"minWidth]___[value:270px",
|
|
130
132
|
"display]___[value:block]___[cond:tabletWide",
|
|
131
133
|
"overflow]___[value:hidden]___[cond:tabletWide",
|
|
132
134
|
"position]___[value:relative]___[cond:tabletWide",
|
|
@@ -234,6 +236,8 @@
|
|
|
234
236
|
"textStyle]___[value:label.large",
|
|
235
237
|
"marginBlockStart]___[value:xsmall]___[cond:& > *:not(:where(:first-child))",
|
|
236
238
|
"width]___[value:surface.xlarge",
|
|
239
|
+
"maxHeight]___[value:50vh",
|
|
240
|
+
"overflowY]___[value:auto",
|
|
237
241
|
"display]___[value:block]___[cond:& li",
|
|
238
242
|
"color]___[value:text.error",
|
|
239
243
|
"backgroundColor]___[value:surface.disabled",
|
|
@@ -348,11 +352,9 @@
|
|
|
348
352
|
"borderColor]___[value:stroke.default]___[cond:_first",
|
|
349
353
|
"fontWeight]___[value:bold]___[cond:_first<___>& p",
|
|
350
354
|
"fontStyle]___[value:italic",
|
|
351
|
-
"display]___[value:grid",
|
|
352
355
|
"gridRowGap]___[value:large",
|
|
353
356
|
"gridColumnGap]___[value:medium",
|
|
354
357
|
"backgroundColor]___[value:background.subtle",
|
|
355
|
-
"maxWidth]___[value:surface.4xlarge",
|
|
356
358
|
"gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))",
|
|
357
359
|
"gridTemplateColumns]___[value:repeat(1, minmax(0, 1fr))]___[cond:tabletDown",
|
|
358
360
|
"gridTemplateColumns]___[value:repeat(2, minmax(0, 1fr))]___[cond:tabletToDesktop",
|
package/dist/styles.css
CHANGED
|
@@ -93,10 +93,6 @@
|
|
|
93
93
|
display: flex;
|
|
94
94
|
}
|
|
95
95
|
|
|
96
|
-
.gap_xxlarge {
|
|
97
|
-
gap: var(--spacing-xxlarge);
|
|
98
|
-
}
|
|
99
|
-
|
|
100
96
|
.c_text\.default {
|
|
101
97
|
color: var(--colors-text-default);
|
|
102
98
|
}
|
|
@@ -121,6 +117,10 @@
|
|
|
121
117
|
padding-block-start: var(--spacing-xxlarge);
|
|
122
118
|
}
|
|
123
119
|
|
|
120
|
+
.gap_xxlarge {
|
|
121
|
+
gap: var(--spacing-xxlarge);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
124
|
.min-h_xxlarge {
|
|
125
125
|
min-height: var(--sizes-xxlarge);
|
|
126
126
|
}
|
|
@@ -326,10 +326,18 @@
|
|
|
326
326
|
text-decoration: underline;
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
+
.d_grid {
|
|
330
|
+
display: grid;
|
|
331
|
+
}
|
|
332
|
+
|
|
329
333
|
.h_215px {
|
|
330
334
|
height: 215px;
|
|
331
335
|
}
|
|
332
336
|
|
|
337
|
+
.min-w_270px {
|
|
338
|
+
min-width: 270px;
|
|
339
|
+
}
|
|
340
|
+
|
|
333
341
|
.bd-l_4px_solid {
|
|
334
342
|
border-left: 4px solid;
|
|
335
343
|
}
|
|
@@ -438,6 +446,10 @@
|
|
|
438
446
|
width: var(--sizes-surface-xlarge);
|
|
439
447
|
}
|
|
440
448
|
|
|
449
|
+
.max-h_50vh {
|
|
450
|
+
max-height: 50vh;
|
|
451
|
+
}
|
|
452
|
+
|
|
441
453
|
.c_text\.error {
|
|
442
454
|
color: var(--colors-text-error);
|
|
443
455
|
}
|
|
@@ -539,14 +551,6 @@
|
|
|
539
551
|
margin-block-start: var(--spacing-3xsmall);
|
|
540
552
|
}
|
|
541
553
|
|
|
542
|
-
.d_grid {
|
|
543
|
-
display: grid;
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
.max-w_surface\.4xlarge {
|
|
547
|
-
max-width: var(--sizes-surface-4xlarge);
|
|
548
|
-
}
|
|
549
|
-
|
|
550
554
|
.w_surface\.3xsmall {
|
|
551
555
|
width: var(--sizes-surface-3xsmall);
|
|
552
556
|
}
|
|
@@ -678,12 +682,12 @@
|
|
|
678
682
|
align-items: flex-end;
|
|
679
683
|
}
|
|
680
684
|
|
|
681
|
-
.
|
|
682
|
-
|
|
685
|
+
.grid-tc_1fr {
|
|
686
|
+
grid-template-columns: 1fr;
|
|
683
687
|
}
|
|
684
688
|
|
|
685
|
-
.
|
|
686
|
-
|
|
689
|
+
.fw_bold {
|
|
690
|
+
font-weight: var(--font-weights-bold);
|
|
687
691
|
}
|
|
688
692
|
|
|
689
693
|
.bd-l-c_stroke\.default {
|
|
@@ -722,6 +726,10 @@
|
|
|
722
726
|
top: calc(var(--spacing-4xsmall) * -1);
|
|
723
727
|
}
|
|
724
728
|
|
|
729
|
+
.ov-y_auto {
|
|
730
|
+
overflow-y: auto;
|
|
731
|
+
}
|
|
732
|
+
|
|
725
733
|
.bg-c_surface\.disabled {
|
|
726
734
|
background-color: var(--colors-surface-disabled);
|
|
727
735
|
}
|
|
@@ -900,14 +908,6 @@
|
|
|
900
908
|
padding-block-end: var(--spacing-5xlarge);
|
|
901
909
|
}
|
|
902
910
|
|
|
903
|
-
.\[\&\[data-align\=\"center\"\]\]\:ta_center[data-align="center"] {
|
|
904
|
-
text-align: center;
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.\[\&\:has\(span\[dir\=\"rtl\"\]\)\]\:direction_rtl:has(span[dir="rtl"]) {
|
|
908
|
-
direction: rtl;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
911
|
.\[\&_img\]\:w_100\% img {
|
|
912
912
|
width: 100%;
|
|
913
913
|
}
|
|
@@ -1448,9 +1448,6 @@
|
|
|
1448
1448
|
}
|
|
1449
1449
|
|
|
1450
1450
|
@media screen and (min-width: 29.75rem) {
|
|
1451
|
-
.mobileWide\:h_340px {
|
|
1452
|
-
height: 340px;
|
|
1453
|
-
}
|
|
1454
1451
|
.mobileWide\:d_none {
|
|
1455
1452
|
display: none;
|
|
1456
1453
|
}
|
|
@@ -1465,6 +1462,9 @@
|
|
|
1465
1462
|
@media screen and (min-width: 37.5625rem) {
|
|
1466
1463
|
.tablet\:px_medium {
|
|
1467
1464
|
padding-inline: var(--spacing-medium);
|
|
1465
|
+
}
|
|
1466
|
+
.tablet\:h_265px {
|
|
1467
|
+
height: 265px;
|
|
1468
1468
|
}
|
|
1469
1469
|
.tablet\:h_26px {
|
|
1470
1470
|
height: 26px;
|
|
@@ -1544,8 +1544,8 @@
|
|
|
1544
1544
|
.tabletWide\:max-w_532px {
|
|
1545
1545
|
max-width: 532px;
|
|
1546
1546
|
}
|
|
1547
|
-
.tabletWide\:
|
|
1548
|
-
|
|
1547
|
+
.tabletWide\:h_340px {
|
|
1548
|
+
height: 340px;
|
|
1549
1549
|
}
|
|
1550
1550
|
.tabletWide\:d_block {
|
|
1551
1551
|
display: block;
|
|
@@ -1570,6 +1570,12 @@
|
|
|
1570
1570
|
}
|
|
1571
1571
|
.tabletWide\:jc_space-between {
|
|
1572
1572
|
justify-content: space-between;
|
|
1573
|
+
}
|
|
1574
|
+
.tabletWide\:grid-tc_minmax\(230px\,_455px\)_auto {
|
|
1575
|
+
grid-template-columns: minmax(230px, 455px) auto;
|
|
1576
|
+
}
|
|
1577
|
+
.tabletWide\:grid-tc_auto_minmax\(230px\,_455px\) {
|
|
1578
|
+
grid-template-columns: auto minmax(230px, 455px);
|
|
1573
1579
|
}
|
|
1574
1580
|
}
|
|
1575
1581
|
|
package/es/Article/Article.js
CHANGED
|
@@ -33,7 +33,6 @@ const StyledArticleWrapper = styled(ark.article, {
|
|
|
33
33
|
background: "background.default",
|
|
34
34
|
display: "flex",
|
|
35
35
|
flexDirection: "column",
|
|
36
|
-
gap: "xxlarge",
|
|
37
36
|
color: "text.default",
|
|
38
37
|
alignItems: "center",
|
|
39
38
|
width: "100%",
|
|
@@ -112,7 +111,7 @@ export const ArticleTitle = _ref2 => {
|
|
|
112
111
|
} = _ref2;
|
|
113
112
|
return /*#__PURE__*/_jsxs(ArticleHeader, {
|
|
114
113
|
children: [/*#__PURE__*/_jsxs(ArticleHGroup, {
|
|
115
|
-
children: [/*#__PURE__*/_jsxs(StyledStack, {
|
|
114
|
+
children: [(!!contentType || !!heartButton) && /*#__PURE__*/_jsxs(StyledStack, {
|
|
116
115
|
justify: "space-between",
|
|
117
116
|
align: "center",
|
|
118
117
|
direction: "row",
|
|
@@ -121,9 +120,10 @@ export const ArticleTitle = _ref2 => {
|
|
|
121
120
|
contentType: contentType
|
|
122
121
|
}), heartButton]
|
|
123
122
|
}), /*#__PURE__*/_jsx(Heading, {
|
|
124
|
-
textStyle: "heading.
|
|
123
|
+
textStyle: "heading.medium",
|
|
125
124
|
id: id,
|
|
126
125
|
lang: lang,
|
|
126
|
+
property: "dct:title",
|
|
127
127
|
children: title
|
|
128
128
|
})]
|
|
129
129
|
}), !!introduction && /*#__PURE__*/_jsx(Text, {
|
|
@@ -25,9 +25,6 @@ const Wrapper = styled("div", {
|
|
|
25
25
|
borderColor: "stroke.subtle"
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
// TODO: This is designed with 24px of inline padding. If you do this, most bylines will break into two lines.
|
|
30
|
-
// Should reconsider.
|
|
31
28
|
const TextWrapper = styled("div", {
|
|
32
29
|
base: {
|
|
33
30
|
display: "flex",
|
|
@@ -130,7 +127,11 @@ export const ArticleByline = _ref => {
|
|
|
130
127
|
children: [/*#__PURE__*/_jsxs(LicenseWrapper, {
|
|
131
128
|
children: [license && /*#__PURE__*/_jsx(LicenseLink, {
|
|
132
129
|
license: license
|
|
133
|
-
}), showPrimaryContributors &&
|
|
130
|
+
}), showPrimaryContributors &&
|
|
131
|
+
/*#__PURE__*/
|
|
132
|
+
//eslint-disable-next-line react/no-unknown-property
|
|
133
|
+
_jsxs("span", {
|
|
134
|
+
property: "cc:attributionName",
|
|
134
135
|
children: [authors.length > 0 && `${t("article.authorsLabel", {
|
|
135
136
|
names: renderContributors(authors, t),
|
|
136
137
|
interpolation: {
|
package/es/Article/index.js
CHANGED
|
@@ -8,5 +8,4 @@
|
|
|
8
8
|
|
|
9
9
|
export { Article, ArticleWrapper, ArticleHeader, ArticleFooter, ArticleTitle, ArticleHGroup, ArticleContent } from "./Article";
|
|
10
10
|
export { ArticleByline, ArticleBylineAccordionItem } from "./ArticleByline";
|
|
11
|
-
export { ArticleFootNotes } from "./ArticleFootNotes";
|
|
12
|
-
export { ArticleParagraph } from "./ArticleParagraph";
|
|
11
|
+
export { ArticleFootNotes } from "./ArticleFootNotes";
|
|
@@ -174,7 +174,7 @@ const AudioPlayer = _ref => {
|
|
|
174
174
|
}), !!textVersion && !img && textVersionButton]
|
|
175
175
|
}), description && /*#__PURE__*/_jsxs(Text, {
|
|
176
176
|
textStyle: "body.medium",
|
|
177
|
-
children: [showFullDescription || description.length < DESCRIPTION_MAX_LENGTH ? description : `${truncatedDescription}...`, /*#__PURE__*/_jsx(Button, {
|
|
177
|
+
children: [showFullDescription || description.length < DESCRIPTION_MAX_LENGTH ? description : `${truncatedDescription}...`, description.length > DESCRIPTION_MAX_LENGTH && /*#__PURE__*/_jsx(Button, {
|
|
178
178
|
variant: "link",
|
|
179
179
|
onClick: () => setShowFullDescription(p => !p),
|
|
180
180
|
children: t(`audio.${showFullDescription ? "readLessDescriptionLabel" : "readMoreDescriptionLabel"}`)
|
|
@@ -15,20 +15,32 @@ import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
16
16
|
const Container = styled("div", {
|
|
17
17
|
base: {
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
display: "grid",
|
|
19
|
+
gridTemplateColumns: "1fr",
|
|
20
20
|
gap: "medium",
|
|
21
|
-
flexDirection: "column",
|
|
22
21
|
border: "1px solid",
|
|
23
22
|
borderColor: "stroke.default",
|
|
24
23
|
backgroundColor: "background.default",
|
|
25
24
|
borderRadius: "xsmall",
|
|
26
25
|
boxShadow: "full",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
26
|
+
overflow: "hidden"
|
|
27
|
+
},
|
|
28
|
+
variants: {
|
|
29
|
+
imageSide: {
|
|
30
|
+
left: {
|
|
31
|
+
tabletWide: {
|
|
32
|
+
gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
right: {
|
|
36
|
+
tabletWide: {
|
|
37
|
+
gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
|
|
38
|
+
}
|
|
39
|
+
}
|
|
31
40
|
}
|
|
41
|
+
},
|
|
42
|
+
defaultVariants: {
|
|
43
|
+
imageSide: "left"
|
|
32
44
|
}
|
|
33
45
|
});
|
|
34
46
|
const LinkText = styled(Text, {
|
|
@@ -54,29 +66,28 @@ const LinkHeader = styled(Text, {
|
|
|
54
66
|
});
|
|
55
67
|
const StyledImg = styled("img", {
|
|
56
68
|
base: {
|
|
57
|
-
alignSelf: "center",
|
|
58
69
|
objectFit: "cover",
|
|
59
70
|
width: "100%",
|
|
60
71
|
height: "215px",
|
|
61
|
-
|
|
62
|
-
height: "
|
|
72
|
+
tablet: {
|
|
73
|
+
height: "265px"
|
|
63
74
|
},
|
|
64
75
|
tabletWide: {
|
|
65
|
-
|
|
76
|
+
height: "340px"
|
|
66
77
|
}
|
|
67
78
|
}
|
|
68
79
|
});
|
|
69
80
|
const ContentWrapper = styled("div", {
|
|
70
81
|
base: {
|
|
71
82
|
width: "100%",
|
|
72
|
-
position: "relative",
|
|
73
83
|
display: "flex",
|
|
74
84
|
flexDirection: "column",
|
|
75
85
|
gap: "medium",
|
|
76
86
|
alignItems: "flex-start",
|
|
77
87
|
justifyContent: "center",
|
|
78
88
|
paddingBlock: "medium",
|
|
79
|
-
paddingInline: "medium"
|
|
89
|
+
paddingInline: "medium",
|
|
90
|
+
minWidth: "270px" //required for campaign block in myNdla
|
|
80
91
|
}
|
|
81
92
|
});
|
|
82
93
|
const StyledText = styled(Text, {
|
|
@@ -128,6 +139,7 @@ const CampaignBlock = _ref2 => {
|
|
|
128
139
|
return /*#__PURE__*/_jsxs(Container, {
|
|
129
140
|
className: className,
|
|
130
141
|
"data-embed-type": "campaign-block",
|
|
142
|
+
imageSide: imageSide,
|
|
131
143
|
children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
132
144
|
children: [/*#__PURE__*/_jsx(MaybeLinkText, {
|
|
133
145
|
url: url?.url,
|
package/es/Concept/Concept.js
CHANGED
|
@@ -11,6 +11,7 @@ import { Figure } from "@ndla/primitives";
|
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
12
|
import { BrightcoveEmbed, ExternalEmbed, H5pEmbed, IframeEmbed, ImageEmbed } from "../Embed";
|
|
13
13
|
import { EmbedByline } from "../LicenseByline/EmbedByline";
|
|
14
|
+
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
14
15
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
16
|
const StyledFigure = styled(Figure, {
|
|
16
17
|
base: {
|
|
@@ -38,11 +39,14 @@ export const Concept = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
38
39
|
lang,
|
|
39
40
|
children,
|
|
40
41
|
title,
|
|
42
|
+
source,
|
|
41
43
|
...rest
|
|
42
44
|
} = _ref;
|
|
45
|
+
const licenseProps = licenseAttributes(copyright?.license?.license, lang, source);
|
|
43
46
|
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
44
47
|
ref: ref,
|
|
45
48
|
...rest,
|
|
49
|
+
...licenseProps,
|
|
46
50
|
children: [/*#__PURE__*/_jsxs(ContentWrapper, {
|
|
47
51
|
lang: lang,
|
|
48
52
|
children: [!!title && /*#__PURE__*/_jsxs(_Fragment, {
|
|
@@ -19,12 +19,9 @@ export const contentTypeToBadgeVariantMap = {
|
|
|
19
19
|
[contentTypes.SOURCE_MATERIAL]: "brand1",
|
|
20
20
|
[contentTypes.LEARNING_PATH]: "brand3",
|
|
21
21
|
[contentTypes.TOPIC]: "neutral",
|
|
22
|
-
// TODO: Verify this color
|
|
23
22
|
[contentTypes.MULTIDISCIPLINARY]: "neutral",
|
|
24
23
|
[contentTypes.CONCEPT]: "brand1",
|
|
25
|
-
// TODO: Verify this color
|
|
26
24
|
[contentTypes.EXTERNAL]: "brand2",
|
|
27
|
-
// TODO: Verify resourceEmbedTypeMapping colors
|
|
28
25
|
[contentTypes.IMAGE]: "brand1",
|
|
29
26
|
[contentTypes.AUDIO]: "brand1",
|
|
30
27
|
[contentTypes.PODCAST]: "brand1",
|
|
@@ -9,25 +9,19 @@
|
|
|
9
9
|
import { forwardRef } from "react";
|
|
10
10
|
import { Hero } from "@ndla/primitives";
|
|
11
11
|
import * as contentTypes from "../model/ContentType";
|
|
12
|
-
|
|
13
|
-
// TODO: Figure out what to do with frontpage articles. If anything...
|
|
14
|
-
// Also, verify all of these colors.
|
|
15
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
13
|
export const contentTypeToHeroMap = {
|
|
17
14
|
[contentTypes.SUBJECT_MATERIAL]: "primary",
|
|
18
|
-
[contentTypes.TASKS_AND_ACTIVITIES]: "
|
|
15
|
+
[contentTypes.TASKS_AND_ACTIVITIES]: "brand2Bold",
|
|
19
16
|
[contentTypes.ASSESSMENT_RESOURCES]: "brand2",
|
|
20
17
|
// This will never happen
|
|
21
18
|
[contentTypes.SUBJECT]: "primary",
|
|
22
19
|
[contentTypes.SOURCE_MATERIAL]: "brand1",
|
|
23
20
|
// This will never happen
|
|
24
21
|
[contentTypes.LEARNING_PATH]: "primary",
|
|
25
|
-
// TODO: This needs a color
|
|
26
22
|
[contentTypes.TOPIC]: "neutral",
|
|
27
|
-
|
|
28
|
-
[contentTypes.MULTIDISCIPLINARY]: "brand4",
|
|
23
|
+
[contentTypes.MULTIDISCIPLINARY]: "primary",
|
|
29
24
|
[contentTypes.CONCEPT]: "brand1Subtle",
|
|
30
|
-
// TODO: No clue what this'll be. Maybe unused?
|
|
31
25
|
[contentTypes.EXTERNAL]: "primary",
|
|
32
26
|
[contentTypes.IMAGE]: "primary",
|
|
33
27
|
[contentTypes.AUDIO]: "primary",
|
package/es/Embed/AudioEmbed.js
CHANGED
|
@@ -10,6 +10,7 @@ import { Figure } from "@ndla/primitives";
|
|
|
10
10
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
11
11
|
import AudioPlayer from "../AudioPlayer";
|
|
12
12
|
import { EmbedByline } from "../LicenseByline";
|
|
13
|
+
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
13
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
15
|
export const getFirstNonEmptyLicenseCredits = authors => Object.values(authors).find(i => i.length > 0) ?? [];
|
|
15
16
|
const AudioEmbed = _ref => {
|
|
@@ -43,9 +44,11 @@ const AudioEmbed = _ref => {
|
|
|
43
44
|
url: coverPhoto.url,
|
|
44
45
|
alt: coverPhoto.altText
|
|
45
46
|
};
|
|
47
|
+
const licenseProps = licenseAttributes(data.copyright.license.license, lang, embedData.url);
|
|
46
48
|
return /*#__PURE__*/_jsxs(Figure, {
|
|
47
49
|
lang: lang,
|
|
48
50
|
"data-embed-type": type,
|
|
51
|
+
...licenseProps,
|
|
49
52
|
children: [/*#__PURE__*/_jsx(AudioPlayer, {
|
|
50
53
|
description: data.podcastMeta?.introduction ?? "",
|
|
51
54
|
img: img,
|
|
@@ -13,6 +13,7 @@ import { Button, Figure } from "@ndla/primitives";
|
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
15
15
|
import { EmbedByline } from "../LicenseByline";
|
|
16
|
+
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
16
17
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
18
|
const LinkedVideoButton = styled(Button, {
|
|
18
19
|
base: {
|
|
@@ -49,7 +50,8 @@ const getIframeProps = (data, sources) => {
|
|
|
49
50
|
const BrightcoveEmbed = _ref => {
|
|
50
51
|
let {
|
|
51
52
|
embed,
|
|
52
|
-
renderContext = "article"
|
|
53
|
+
renderContext = "article",
|
|
54
|
+
lang
|
|
53
55
|
} = _ref;
|
|
54
56
|
const [showOriginalVideo, setShowOriginalVideo] = useState(true);
|
|
55
57
|
const {
|
|
@@ -98,8 +100,10 @@ const BrightcoveEmbed = _ref => {
|
|
|
98
100
|
...embedData,
|
|
99
101
|
videoid: linkedVideoId
|
|
100
102
|
}, data.sources) : undefined;
|
|
103
|
+
const licenseProps = licenseAttributes(data?.copyright?.license.license, lang, embedData.pageUrl);
|
|
101
104
|
return /*#__PURE__*/_jsxs(Figure, {
|
|
102
105
|
"data-embed-type": "brightcove",
|
|
106
|
+
...licenseProps,
|
|
103
107
|
children: [/*#__PURE__*/_jsx("div", {
|
|
104
108
|
className: "brightcove-video",
|
|
105
109
|
children: /*#__PURE__*/_jsx(BrightcoveIframe, {
|
package/es/Embed/ConceptEmbed.js
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import parse from "html-react-parser";
|
|
10
10
|
import { forwardRef, useMemo } from "react";
|
|
11
|
+
import { Portal } from "@ark-ui/react";
|
|
11
12
|
import { PopoverContent, PopoverRoot, PopoverTrigger } from "@ndla/primitives";
|
|
12
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
14
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
@@ -17,7 +18,9 @@ import { Concept } from "../Concept/Concept";
|
|
|
17
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
19
|
const StyledPopoverContent = styled(PopoverContent, {
|
|
19
20
|
base: {
|
|
20
|
-
width: "surface.xlarge"
|
|
21
|
+
width: "surface.xlarge",
|
|
22
|
+
maxHeight: "50vh",
|
|
23
|
+
overflowY: "auto"
|
|
21
24
|
}
|
|
22
25
|
});
|
|
23
26
|
export const ConceptEmbed = _ref => {
|
|
@@ -58,6 +61,7 @@ export const ConceptEmbed = _ref => {
|
|
|
58
61
|
visualElement: visualElement,
|
|
59
62
|
lang: lang,
|
|
60
63
|
title: concept.title.title,
|
|
64
|
+
source: concept.source,
|
|
61
65
|
children: parsedContent
|
|
62
66
|
});
|
|
63
67
|
}
|
|
@@ -66,6 +70,7 @@ export const ConceptEmbed = _ref => {
|
|
|
66
70
|
visualElement: visualElement,
|
|
67
71
|
lang: lang,
|
|
68
72
|
title: renderContext === "embed" ? undefined : concept.title.title,
|
|
73
|
+
source: concept.source,
|
|
69
74
|
children: parsedContent
|
|
70
75
|
});
|
|
71
76
|
};
|
|
@@ -77,23 +82,27 @@ export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
77
82
|
lang,
|
|
78
83
|
children,
|
|
79
84
|
title,
|
|
85
|
+
source,
|
|
80
86
|
...rest
|
|
81
87
|
} = _ref2;
|
|
82
88
|
return /*#__PURE__*/_jsxs(PopoverRoot, {
|
|
83
89
|
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
84
90
|
asChild: true,
|
|
91
|
+
ref: ref,
|
|
92
|
+
...rest,
|
|
85
93
|
children: /*#__PURE__*/_jsx(InlineTriggerButton, {
|
|
86
|
-
...rest,
|
|
87
|
-
ref: ref,
|
|
88
94
|
children: linkText
|
|
89
95
|
})
|
|
90
|
-
}), /*#__PURE__*/_jsx(
|
|
91
|
-
children: /*#__PURE__*/_jsx(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
96
|
+
}), /*#__PURE__*/_jsx(Portal, {
|
|
97
|
+
children: /*#__PURE__*/_jsx(StyledPopoverContent, {
|
|
98
|
+
children: /*#__PURE__*/_jsx(Concept, {
|
|
99
|
+
copyright: copyright,
|
|
100
|
+
visualElement: visualElement,
|
|
101
|
+
lang: lang,
|
|
102
|
+
title: title,
|
|
103
|
+
source: source,
|
|
104
|
+
children: children
|
|
105
|
+
})
|
|
97
106
|
})
|
|
98
107
|
})]
|
|
99
108
|
});
|
package/es/Embed/ImageEmbed.js
CHANGED
|
@@ -15,6 +15,7 @@ import { Figure, Image } from "@ndla/primitives";
|
|
|
15
15
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
17
17
|
import { EmbedByline } from "../LicenseByline";
|
|
18
|
+
import { licenseAttributes } from "../utils/licenseAttributes";
|
|
18
19
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
20
|
export const getLicenseCredits = copyright => {
|
|
20
21
|
return {
|
|
@@ -223,12 +224,14 @@ const ImageEmbed = _ref => {
|
|
|
223
224
|
const toggleImageSize = () => {
|
|
224
225
|
setImageSizes(sizes => !sizes ? expandedSizes : undefined);
|
|
225
226
|
};
|
|
227
|
+
const licenseProps = licenseAttributes(data.copyright.license.license, lang, embedData.url);
|
|
226
228
|
|
|
227
229
|
// TODO: Check how this works with `children`. Will only be important for ED
|
|
228
230
|
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
229
231
|
float: figureProps?.float,
|
|
230
232
|
size: imageSizes ? "full" : figureProps?.size ?? "medium",
|
|
231
233
|
"data-embed-type": "image",
|
|
234
|
+
...licenseProps,
|
|
232
235
|
children: [children, /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
233
236
|
border: embedData.border === "true",
|
|
234
237
|
expandable: !!figureProps?.float,
|
package/es/Embed/index.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
export { default as ImageEmbed, getCrop, getFocalPoint } from "./ImageEmbed";
|
|
10
|
+
export { InlineTriggerButton } from "./InlineTriggerButton";
|
|
10
11
|
export { default as AudioEmbed } from "./AudioEmbed";
|
|
11
12
|
export { default as H5pEmbed } from "./H5pEmbed";
|
|
12
13
|
export { default as ExternalEmbed } from "./ExternalEmbed";
|
package/es/FileList/FileList.js
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
+
import { ark } from "@ark-ui/react";
|
|
10
11
|
import { Heading } from "@ndla/primitives";
|
|
11
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -17,8 +18,9 @@ export const FileListWrapper = styled("div", {
|
|
|
17
18
|
gap: "xsmall"
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
export const FileListItem = styled(
|
|
21
|
+
export const FileListItem = styled(ark.li, {
|
|
21
22
|
base: {
|
|
23
|
+
listStyle: "none",
|
|
22
24
|
background: "surface.infoSubtle",
|
|
23
25
|
borderBlockEnd: "1px solid",
|
|
24
26
|
borderColor: "stroke.default",
|
|
@@ -28,6 +30,8 @@ export const FileListItem = styled("li", {
|
|
|
28
30
|
backgroundColor: "surface.infoSubtle.hover"
|
|
29
31
|
}
|
|
30
32
|
}
|
|
33
|
+
}, {
|
|
34
|
+
baseComponent: true
|
|
31
35
|
});
|
|
32
36
|
export const FileListEmbed = _ref => {
|
|
33
37
|
let {
|
package/es/FileList/PdfFile.js
CHANGED
|
@@ -14,6 +14,11 @@ const StyledIframe = styled("iframe", {
|
|
|
14
14
|
width: "100%"
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
|
+
const StyledListElement = styled("li", {
|
|
18
|
+
base: {
|
|
19
|
+
listStyle: "none"
|
|
20
|
+
}
|
|
21
|
+
});
|
|
17
22
|
const StyledFigure = styled(Figure, {
|
|
18
23
|
base: {
|
|
19
24
|
display: "flex",
|
|
@@ -26,7 +31,7 @@ export const PdfFile = _ref => {
|
|
|
26
31
|
title,
|
|
27
32
|
url
|
|
28
33
|
} = _ref;
|
|
29
|
-
return /*#__PURE__*/_jsx(
|
|
34
|
+
return /*#__PURE__*/_jsx(StyledListElement, {
|
|
30
35
|
children: /*#__PURE__*/_jsxs(StyledFigure, {
|
|
31
36
|
children: [/*#__PURE__*/_jsx(Heading, {
|
|
32
37
|
asChild: true,
|
package/es/FileList/index.js
CHANGED
package/es/Grid/Grid.js
CHANGED