@ndla/ui 56.0.34-alpha.0 → 56.0.36-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 +8 -20
- package/dist/styles.css +20 -64
- package/es/CampaignBlock/CampaignBlock.js +36 -47
- package/es/Embed/CodeEmbed.js +6 -2
- package/es/Embed/ConceptEmbed.js +1 -0
- package/es/Embed/EmbedErrorPlaceholder.js +8 -9
- package/es/Layout/index.js +1 -3
- package/es/index.js +1 -2
- package/es/locale/messages-en.js +2 -1
- package/es/locale/messages-nb.js +2 -1
- package/es/locale/messages-nn.js +2 -1
- package/es/locale/messages-se.js +2 -1
- package/es/locale/messages-sma.js +2 -1
- package/lib/CampaignBlock/CampaignBlock.d.ts +4 -2
- package/lib/CampaignBlock/CampaignBlock.js +35 -46
- package/lib/Embed/CodeEmbed.js +7 -2
- package/lib/Embed/ConceptEmbed.js +1 -0
- package/lib/Embed/EmbedErrorPlaceholder.js +7 -8
- package/lib/Layout/index.d.ts +0 -2
- package/lib/Layout/index.js +1 -11
- package/lib/LicenseByline/EmbedByline.d.ts +1 -1
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -14
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +2 -1
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +2 -1
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +2 -1
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +2 -1
- package/lib/locale/messages-sma.d.ts +1 -0
- package/lib/locale/messages-sma.js +2 -1
- package/package.json +6 -6
- package/src/CampaignBlock/CampaignBlock.tsx +43 -44
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +3 -4
- package/src/Embed/AudioEmbed.stories.tsx +3 -3
- package/src/Embed/BrightcoveEmbed.stories.tsx +3 -3
- package/src/Embed/CodeEmbed.tsx +5 -2
- package/src/Embed/ConceptEmbed.stories.tsx +3 -3
- package/src/Embed/ConceptEmbed.tsx +1 -0
- package/src/Embed/EmbedErrorPlaceholder.tsx +8 -9
- package/src/Embed/ExternalEmbed.stories.tsx +3 -3
- package/src/Embed/H5pEmbed.stories.tsx +3 -3
- package/src/Embed/IframeEmbed.stories.tsx +3 -3
- package/src/Embed/ImageEmbed.stories.tsx +3 -4
- package/src/Embed/RelatedContentEmbed.stories.tsx +3 -3
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +3 -4
- package/src/Grid/Grid.stories.tsx +4 -3
- package/src/Layout/index.ts +0 -4
- package/src/LicenseByline/EmbedByline.tsx +1 -1
- package/src/index.ts +1 -4
- package/src/locale/messages-en.ts +1 -0
- package/src/locale/messages-nb.ts +1 -0
- package/src/locale/messages-nn.ts +1 -0
- package/src/locale/messages-se.ts +1 -0
- package/src/locale/messages-sma.ts +1 -0
- package/es/Layout/LayoutItem.js +0 -35
- package/es/TreeStructure/TreeStructure.js +0 -318
- package/es/TreeStructure/helperFunctions.js +0 -29
- package/es/TreeStructure/index.js +0 -9
- package/es/TreeStructure/types.js +0 -1
- package/lib/Layout/LayoutItem.d.ts +0 -11
- package/lib/Layout/LayoutItem.js +0 -40
- package/lib/TreeStructure/TreeStructure.d.ts +0 -22
- package/lib/TreeStructure/TreeStructure.js +0 -325
- package/lib/TreeStructure/helperFunctions.d.ts +0 -9
- package/lib/TreeStructure/helperFunctions.js +0 -36
- package/lib/TreeStructure/index.d.ts +0 -9
- package/lib/TreeStructure/index.js +0 -12
- package/lib/TreeStructure/types.d.ts +0 -15
- package/lib/TreeStructure/types.js +0 -5
- package/src/Layout/LayoutItem.tsx +0 -36
- package/src/TreeStructure/TreeStructure.stories.tsx +0 -282
- package/src/TreeStructure/TreeStructure.tsx +0 -354
- package/src/TreeStructure/helperFunctions.ts +0 -18
- package/src/TreeStructure/index.ts +0 -10
- package/src/TreeStructure/types.ts +0 -22
|
@@ -131,7 +131,8 @@
|
|
|
131
131
|
"gridTemplateColumns]___[value:minmax(230px, 455px) auto]___[cond:@supports not (container-type: inline-size)<___>tabletWide",
|
|
132
132
|
"gridTemplateColumns]___[value:auto minmax(230px, 455px)]___[cond:@/tablet",
|
|
133
133
|
"gridTemplateColumns]___[value:auto minmax(230px, 455px)]___[cond:@supports not (container-type: inline-size)<___>tabletWide",
|
|
134
|
-
"
|
|
134
|
+
"backgroundColor]___[value:surface.brand.1",
|
|
135
|
+
"backgroundColor]___[value:surface.brand.3",
|
|
135
136
|
"height]___[value:215px",
|
|
136
137
|
"height]___[value:340px]___[cond:@/tablet",
|
|
137
138
|
"height]___[value:265px]___[cond:@supports not (container-type: inline-size)<___>tablet",
|
|
@@ -241,15 +242,15 @@
|
|
|
241
242
|
"marginInlineStart]___[value:xsmall",
|
|
242
243
|
"height]___[value:auto",
|
|
243
244
|
"textStyle]___[value:label.large",
|
|
245
|
+
"fontWeight]___[value:bold",
|
|
244
246
|
"marginBlockStart]___[value:xsmall]___[cond:& > *:not(:where(:first-child))",
|
|
245
247
|
"width]___[value:surface.xlarge",
|
|
246
248
|
"maxHeight]___[value:50vh",
|
|
247
249
|
"overflowY]___[value:auto",
|
|
248
|
-
"
|
|
249
|
-
"
|
|
250
|
-
"
|
|
251
|
-
"
|
|
252
|
-
"height]___[value:surface.3xsmall]___[cond:&[data-embed-type='audio']",
|
|
250
|
+
"background]___[value:background.subtle",
|
|
251
|
+
"height]___[value:5xlarge]___[cond:& svg",
|
|
252
|
+
"width]___[value:5xlarge]___[cond:& svg",
|
|
253
|
+
"fill]___[value:stroke.default]___[cond:& svg",
|
|
253
254
|
"marginBlockStart]___[value:3xsmall]___[cond:& > *:not(:first-child)",
|
|
254
255
|
"height]___[value:auto]___[cond:& iframe",
|
|
255
256
|
"width]___[value:100%]___[cond:& iframe",
|
|
@@ -376,14 +377,6 @@
|
|
|
376
377
|
"width]___[value:surface.3xsmall",
|
|
377
378
|
"textStyle]___[value:heading.large",
|
|
378
379
|
"textStyle]___[value:title.medium",
|
|
379
|
-
"position]___[value:relative!",
|
|
380
|
-
"width]___[value:83.333%",
|
|
381
|
-
"right]___[value:auto !important",
|
|
382
|
-
"left]___[value:8.333%",
|
|
383
|
-
"position]___[value:relative!]___[cond:tablet",
|
|
384
|
-
"width]___[value:83.333%]___[cond:tablet",
|
|
385
|
-
"right]___[value:auto!]___[cond:tablet",
|
|
386
|
-
"left]___[value:8.333%]___[cond:tablet",
|
|
387
380
|
"marginLeft]___[value:auto",
|
|
388
381
|
"marginRight]___[value:auto",
|
|
389
382
|
"paddingLeft]___[value:18px",
|
|
@@ -438,12 +431,7 @@
|
|
|
438
431
|
"padding]___[value:xsmall]___[cond:tabletDown",
|
|
439
432
|
"aspectRatio]___[value:1/1",
|
|
440
433
|
"width]___[value:100%]___[cond:tabletDown",
|
|
441
|
-
"borderRadius]___[value:0]___[cond:tabletDown"
|
|
442
|
-
"overflow]___[value:hidden]___[cond:& span",
|
|
443
|
-
"textOverflow]___[value:ellipsis]___[cond:& span",
|
|
444
|
-
"maxHeight]___[value:inherit",
|
|
445
|
-
"overflow]___[value:auto",
|
|
446
|
-
"gap]___[value:10px"
|
|
434
|
+
"borderRadius]___[value:0]___[cond:tabletDown"
|
|
447
435
|
],
|
|
448
436
|
"recipes": {}
|
|
449
437
|
}
|
package/dist/styles.css
CHANGED
|
@@ -498,6 +498,10 @@
|
|
|
498
498
|
max-height: 50vh;
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
+
.bg_background\.subtle {
|
|
502
|
+
background: var(--colors-background-subtle);
|
|
503
|
+
}
|
|
504
|
+
|
|
501
505
|
.z_docked {
|
|
502
506
|
z-index: var(--z-index-docked);
|
|
503
507
|
}
|
|
@@ -590,14 +594,6 @@
|
|
|
590
594
|
width: var(--sizes-surface-3xsmall);
|
|
591
595
|
}
|
|
592
596
|
|
|
593
|
-
.pos_relative\! {
|
|
594
|
-
position: relative !important;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
.w_83\.333\% {
|
|
598
|
-
width: 83.333%;
|
|
599
|
-
}
|
|
600
|
-
|
|
601
597
|
.max-w_1150px {
|
|
602
598
|
max-width: 1150px;
|
|
603
599
|
}
|
|
@@ -646,18 +642,6 @@
|
|
|
646
642
|
aspect-ratio: 1/1;
|
|
647
643
|
}
|
|
648
644
|
|
|
649
|
-
.max-h_inherit {
|
|
650
|
-
max-height: inherit;
|
|
651
|
-
}
|
|
652
|
-
|
|
653
|
-
.ov_auto {
|
|
654
|
-
overflow: auto;
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
.gap_10px {
|
|
658
|
-
gap: 10px;
|
|
659
|
-
}
|
|
660
|
-
|
|
661
645
|
.flex-d_column {
|
|
662
646
|
flex-direction: column;
|
|
663
647
|
}
|
|
@@ -725,8 +709,12 @@
|
|
|
725
709
|
grid-template-columns: 1fr;
|
|
726
710
|
}
|
|
727
711
|
|
|
728
|
-
.
|
|
729
|
-
|
|
712
|
+
.bg-c_surface\.brand\.1 {
|
|
713
|
+
background-color: var(--colors-surface-brand-1);
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
.bg-c_surface\.brand\.3 {
|
|
717
|
+
background-color: var(--colors-surface-brand-3);
|
|
730
718
|
}
|
|
731
719
|
|
|
732
720
|
.bd-l-c_stroke\.default {
|
|
@@ -765,12 +753,12 @@
|
|
|
765
753
|
top: calc(var(--spacing-4xsmall) * -1);
|
|
766
754
|
}
|
|
767
755
|
|
|
768
|
-
.
|
|
769
|
-
|
|
756
|
+
.fw_bold {
|
|
757
|
+
font-weight: var(--font-weights-bold);
|
|
770
758
|
}
|
|
771
759
|
|
|
772
|
-
.
|
|
773
|
-
|
|
760
|
+
.ov-y_auto {
|
|
761
|
+
overflow-y: auto;
|
|
774
762
|
}
|
|
775
763
|
|
|
776
764
|
.top_xsmall {
|
|
@@ -887,14 +875,6 @@
|
|
|
887
875
|
border-color: var(--colors-surface-brand-2);
|
|
888
876
|
}
|
|
889
877
|
|
|
890
|
-
.right_auto\! {
|
|
891
|
-
right: auto !important;
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
.left_8\.333\% {
|
|
895
|
-
left: 8.333%;
|
|
896
|
-
}
|
|
897
|
-
|
|
898
878
|
.ml_auto {
|
|
899
879
|
margin-left: auto;
|
|
900
880
|
}
|
|
@@ -1087,20 +1067,16 @@
|
|
|
1087
1067
|
margin-block-start: var(--spacing-xsmall);
|
|
1088
1068
|
}
|
|
1089
1069
|
|
|
1090
|
-
.\[\&_svg\]\:
|
|
1091
|
-
|
|
1070
|
+
.\[\&_svg\]\:h_5xlarge svg {
|
|
1071
|
+
height: var(--sizes-5xlarge);
|
|
1092
1072
|
}
|
|
1093
1073
|
|
|
1094
|
-
.\[\&_svg\]\:
|
|
1095
|
-
|
|
1074
|
+
.\[\&_svg\]\:w_5xlarge svg {
|
|
1075
|
+
width: var(--sizes-5xlarge);
|
|
1096
1076
|
}
|
|
1097
1077
|
|
|
1098
|
-
.\[\&_svg\]\:
|
|
1099
|
-
|
|
1100
|
-
}
|
|
1101
|
-
|
|
1102
|
-
.\[\&\[data-embed-type\=\'audio\'\]\]\:h_surface\.3xsmall[data-embed-type='audio'] {
|
|
1103
|
-
height: var(--sizes-surface-3xsmall);
|
|
1078
|
+
.\[\&_svg\]\:fill_stroke\.default svg {
|
|
1079
|
+
fill: var(--colors-stroke-default);
|
|
1104
1080
|
}
|
|
1105
1081
|
|
|
1106
1082
|
.\[\&_\>_\*\:not\(\:first-child\)\]\:mbs_3xsmall > *:not(:first-child) {
|
|
@@ -1211,14 +1187,6 @@
|
|
|
1211
1187
|
text-decoration: underline;
|
|
1212
1188
|
}
|
|
1213
1189
|
|
|
1214
|
-
.\[\&_span\]\:ov_hidden span {
|
|
1215
|
-
overflow: hidden;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
.\[\&_span\]\:tov_ellipsis span {
|
|
1219
|
-
text-overflow: ellipsis;
|
|
1220
|
-
}
|
|
1221
|
-
|
|
1222
1190
|
.after\:content_0::after {
|
|
1223
1191
|
content: 0;
|
|
1224
1192
|
}
|
|
@@ -1551,12 +1519,6 @@
|
|
|
1551
1519
|
}
|
|
1552
1520
|
.tablet\:w_26px {
|
|
1553
1521
|
width: 26px;
|
|
1554
|
-
}
|
|
1555
|
-
.tablet\:pos_relative\! {
|
|
1556
|
-
position: relative !important;
|
|
1557
|
-
}
|
|
1558
|
-
.tablet\:w_83\.333\% {
|
|
1559
|
-
width: 83.333%;
|
|
1560
1522
|
}
|
|
1561
1523
|
.tablet\:ai_unset {
|
|
1562
1524
|
align-items: unset;
|
|
@@ -1569,12 +1531,6 @@
|
|
|
1569
1531
|
}
|
|
1570
1532
|
.tablet\:mb_xxlarge {
|
|
1571
1533
|
margin-bottom: var(--spacing-xxlarge);
|
|
1572
|
-
}
|
|
1573
|
-
.tablet\:right_auto\! {
|
|
1574
|
-
right: auto !important;
|
|
1575
|
-
}
|
|
1576
|
-
.tablet\:left_8\.333\% {
|
|
1577
|
-
left: 8.333%;
|
|
1578
1534
|
}
|
|
1579
1535
|
.tablet\:bg-c_\#f8f8f8 {
|
|
1580
1536
|
background-color: #f8f8f8;
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import parse from "html-react-parser";
|
|
10
10
|
import { ArrowRightLine } from "@ndla/icons/common";
|
|
11
11
|
import { Text } from "@ndla/primitives";
|
|
12
|
-
import {
|
|
12
|
+
import { SafeLinkButton } from "@ndla/safelink";
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
|
|
15
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -24,7 +24,6 @@ const Container = styled("div", {
|
|
|
24
24
|
base: {
|
|
25
25
|
display: "grid",
|
|
26
26
|
gridTemplateColumns: "1fr",
|
|
27
|
-
gap: "medium",
|
|
28
27
|
border: "1px solid",
|
|
29
28
|
borderColor: "stroke.default",
|
|
30
29
|
backgroundColor: "background.default",
|
|
@@ -54,31 +53,20 @@ const Container = styled("div", {
|
|
|
54
53
|
}
|
|
55
54
|
}
|
|
56
55
|
}
|
|
56
|
+
},
|
|
57
|
+
background: {
|
|
58
|
+
neutral: {},
|
|
59
|
+
brand1: {
|
|
60
|
+
backgroundColor: "surface.brand.1"
|
|
61
|
+
},
|
|
62
|
+
brand3: {
|
|
63
|
+
backgroundColor: "surface.brand.3"
|
|
64
|
+
}
|
|
57
65
|
}
|
|
58
66
|
},
|
|
59
67
|
defaultVariants: {
|
|
60
|
-
imageSide: "left"
|
|
61
|
-
|
|
62
|
-
});
|
|
63
|
-
const LinkText = styled(Text, {
|
|
64
|
-
base: {
|
|
65
|
-
display: "flex",
|
|
66
|
-
gap: "xxsmall",
|
|
67
|
-
textDecoration: "underline",
|
|
68
|
-
_hover: {
|
|
69
|
-
textDecoration: "none"
|
|
70
|
-
},
|
|
71
|
-
paddingBlock: "xsmall",
|
|
72
|
-
fontWeight: "bold"
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
const LinkHeader = styled(Text, {
|
|
76
|
-
base: {
|
|
77
|
-
display: "flex",
|
|
78
|
-
textDecoration: "underline",
|
|
79
|
-
_hover: {
|
|
80
|
-
textDecoration: "none"
|
|
81
|
-
}
|
|
68
|
+
imageSide: "left",
|
|
69
|
+
background: "neutral"
|
|
82
70
|
}
|
|
83
71
|
});
|
|
84
72
|
const StyledImg = styled("img", {
|
|
@@ -96,7 +84,8 @@ const StyledImg = styled("img", {
|
|
|
96
84
|
tabletWide: {
|
|
97
85
|
height: "340px"
|
|
98
86
|
}
|
|
99
|
-
}
|
|
87
|
+
},
|
|
88
|
+
backgroundColor: "background.default"
|
|
100
89
|
}
|
|
101
90
|
});
|
|
102
91
|
const ContentWrapper = styled("div", {
|
|
@@ -108,7 +97,8 @@ const ContentWrapper = styled("div", {
|
|
|
108
97
|
alignItems: "flex-start",
|
|
109
98
|
justifyContent: "center",
|
|
110
99
|
paddingBlock: "medium",
|
|
111
|
-
paddingInline: "medium"
|
|
100
|
+
paddingInline: "medium",
|
|
101
|
+
position: "relative"
|
|
112
102
|
}
|
|
113
103
|
});
|
|
114
104
|
const StyledText = styled(Text, {
|
|
@@ -122,19 +112,24 @@ const StyledText = styled(Text, {
|
|
|
122
112
|
}
|
|
123
113
|
}
|
|
124
114
|
});
|
|
125
|
-
const
|
|
115
|
+
const StyledSafeLinkButton = styled(SafeLinkButton, {
|
|
126
116
|
base: {
|
|
127
|
-
|
|
117
|
+
boxShadow: "full",
|
|
118
|
+
border: "1px solid",
|
|
119
|
+
borderColor: "stroke.default"
|
|
128
120
|
}
|
|
129
121
|
});
|
|
130
|
-
const
|
|
122
|
+
const LinkButton = _ref => {
|
|
131
123
|
let {
|
|
132
124
|
url,
|
|
133
125
|
children,
|
|
134
126
|
path
|
|
135
127
|
} = _ref;
|
|
136
|
-
if (url) return /*#__PURE__*/_jsx(
|
|
128
|
+
if (url) return /*#__PURE__*/_jsx(StyledSafeLinkButton, {
|
|
137
129
|
to: getPossiblyRelativeUrl(url, path),
|
|
130
|
+
target: "_blank",
|
|
131
|
+
variant: "secondary",
|
|
132
|
+
rel: "noopener noreferrer",
|
|
138
133
|
children: children
|
|
139
134
|
});
|
|
140
135
|
return children;
|
|
@@ -148,7 +143,8 @@ const CampaignBlock = _ref2 => {
|
|
|
148
143
|
headingLevel: InternalHeading = "h2",
|
|
149
144
|
url,
|
|
150
145
|
path,
|
|
151
|
-
className
|
|
146
|
+
className,
|
|
147
|
+
background
|
|
152
148
|
} = _ref2;
|
|
153
149
|
const imageComponent = image && /*#__PURE__*/_jsx(StyledImg, {
|
|
154
150
|
src: `${image.src}?width=455`,
|
|
@@ -156,34 +152,27 @@ const CampaignBlock = _ref2 => {
|
|
|
156
152
|
width: 455,
|
|
157
153
|
alt: image.alt
|
|
158
154
|
});
|
|
159
|
-
const HeaderComponent = url?.url ? LinkHeader : Text;
|
|
160
155
|
return /*#__PURE__*/_jsx(Wrapper, {
|
|
161
156
|
children: /*#__PURE__*/_jsxs(Container, {
|
|
162
157
|
className: className,
|
|
163
158
|
"data-embed-type": "campaign-block",
|
|
164
159
|
imageSide: imageSide,
|
|
160
|
+
background: background,
|
|
165
161
|
children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
166
|
-
children: [/*#__PURE__*/_jsx(
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
textStyle: "heading.small",
|
|
173
|
-
children: /*#__PURE__*/_jsx(InternalHeading, {
|
|
174
|
-
children: parse(title)
|
|
175
|
-
})
|
|
162
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
163
|
+
asChild: true,
|
|
164
|
+
consumeCss: true,
|
|
165
|
+
textStyle: "heading.small",
|
|
166
|
+
children: /*#__PURE__*/_jsx(InternalHeading, {
|
|
167
|
+
children: parse(title)
|
|
176
168
|
})
|
|
177
169
|
}), /*#__PURE__*/_jsx(StyledText, {
|
|
178
170
|
textStyle: "body.xlarge",
|
|
179
171
|
children: parse(description)
|
|
180
|
-
}), !!url?.url && /*#__PURE__*/
|
|
172
|
+
}), !!url?.url && /*#__PURE__*/_jsxs(LinkButton, {
|
|
181
173
|
url: url.url,
|
|
182
174
|
path: path,
|
|
183
|
-
children: /*#__PURE__*/
|
|
184
|
-
textStyle: "body.medium",
|
|
185
|
-
children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
|
|
186
|
-
})
|
|
175
|
+
children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
|
|
187
176
|
})]
|
|
188
177
|
}), imageSide !== "left" && imageComponent]
|
|
189
178
|
})
|
package/es/Embed/CodeEmbed.js
CHANGED
|
@@ -13,9 +13,8 @@ import { CheckLine } from "@ndla/icons/editor";
|
|
|
13
13
|
import { Button, Figure } from "@ndla/primitives";
|
|
14
14
|
import { styled } from "@ndla/styled-system/jsx";
|
|
15
15
|
import { copyTextToClipboard } from "@ndla/util";
|
|
16
|
+
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
16
17
|
import { CodeBlock, codeLanguageOptions } from "../CodeBlock";
|
|
17
|
-
|
|
18
|
-
// TODO: We need an error state for this
|
|
19
18
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
19
|
const StyledFigCaption = styled("figcaption", {
|
|
21
20
|
base: {
|
|
@@ -55,6 +54,11 @@ const CodeEmbed = _ref => {
|
|
|
55
54
|
};
|
|
56
55
|
}
|
|
57
56
|
}, [isCopied]);
|
|
57
|
+
if (embed.status === "error") {
|
|
58
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
59
|
+
type: "code"
|
|
60
|
+
});
|
|
61
|
+
}
|
|
58
62
|
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
59
63
|
"data-embed-type": "code-block",
|
|
60
64
|
children: [/*#__PURE__*/_jsx(StyledFigCaption, {
|
package/es/Embed/ConceptEmbed.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { Report } from "@ndla/icons/common";
|
|
10
10
|
import { Figure } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
12
|
import { EmbedByline } from "../LicenseByline";
|
|
@@ -16,16 +16,15 @@ const ErrorPlaceholder = styled("div", {
|
|
|
16
16
|
display: "flex",
|
|
17
17
|
alignItems: "center",
|
|
18
18
|
justifyContent: "center",
|
|
19
|
-
|
|
19
|
+
background: "background.subtle",
|
|
20
20
|
height: "surface.xsmall",
|
|
21
|
+
border: "1px solid",
|
|
22
|
+
borderColor: "stroke.default",
|
|
21
23
|
borderRadius: "xsmall",
|
|
22
24
|
"& svg": {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
"&[data-embed-type='audio']": {
|
|
28
|
-
height: "surface.3xsmall"
|
|
25
|
+
height: "5xlarge",
|
|
26
|
+
width: "5xlarge",
|
|
27
|
+
fill: "stroke.default"
|
|
29
28
|
}
|
|
30
29
|
}
|
|
31
30
|
});
|
|
@@ -49,7 +48,7 @@ const EmbedErrorPlaceholder = _ref => {
|
|
|
49
48
|
"data-embed-type": type,
|
|
50
49
|
children: [children ?? /*#__PURE__*/_jsx(ErrorPlaceholder, {
|
|
51
50
|
"data-embed-type": type,
|
|
52
|
-
children: /*#__PURE__*/_jsx(
|
|
51
|
+
children: /*#__PURE__*/_jsx(Report, {})
|
|
53
52
|
}), /*#__PURE__*/_jsx(EmbedByline, {
|
|
54
53
|
error: true,
|
|
55
54
|
type: type
|
package/es/Layout/index.js
CHANGED
package/es/index.js
CHANGED
|
@@ -30,12 +30,11 @@ 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 {
|
|
33
|
+
export { OneColumn, PageContainer } from "./Layout";
|
|
34
34
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, SourceMaterialBadge, ConceptBadge } from "./ContentTypeBadge";
|
|
35
35
|
export { ContentTypeBadge as ContentTypeBadgeNew, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
36
36
|
export { default as CopyParagraphButton } from "./CopyParagraphButton";
|
|
37
37
|
export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTrigger, TagSelectorControl, TagSelectorClearTrigger, TagSelectorInputBase, TagSelectorInput } from "./TagSelector/TagSelector";
|
|
38
|
-
export { TreeStructure } from "./TreeStructure";
|
|
39
38
|
export { BlogPostV2 } from "./BlogPost";
|
|
40
39
|
export { KeyFigure } from "./KeyFigure";
|
|
41
40
|
export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
|
package/es/locale/messages-en.js
CHANGED
package/es/locale/messages-nb.js
CHANGED
package/es/locale/messages-nn.js
CHANGED
package/es/locale/messages-se.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
|
+
import { CampaignBlockEmbedData } from "@ndla/types-embed";
|
|
8
9
|
import { HeadingLevel } from "../types";
|
|
9
10
|
interface Image {
|
|
10
11
|
src: string;
|
|
@@ -19,9 +20,10 @@ interface Props {
|
|
|
19
20
|
text?: string;
|
|
20
21
|
};
|
|
21
22
|
image?: Image;
|
|
22
|
-
imageSide?: "
|
|
23
|
+
imageSide?: CampaignBlockEmbedData["imageSide"];
|
|
23
24
|
className?: string;
|
|
24
25
|
path?: string;
|
|
26
|
+
background?: CampaignBlockEmbedData["background"];
|
|
25
27
|
}
|
|
26
|
-
declare const CampaignBlock: ({ title, image, imageSide, description, headingLevel: InternalHeading, url, path, className, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
declare const CampaignBlock: ({ title, image, imageSide, description, headingLevel: InternalHeading, url, path, className, background, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
27
29
|
export default CampaignBlock;
|