@ndla/ui 56.0.38-alpha.0 → 56.0.40-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 -0
- package/dist/styles.css +18 -0
- package/es/Article/Article.js +6 -2
- package/es/Embed/CopyrightEmbed.js +10 -1
- package/es/Embed/EmbedWrapper.js +24 -0
- package/es/Embed/UuDisclaimerEmbed.js +17 -14
- package/es/Embed/index.js +2 -1
- package/es/KeyFigure/KeyFigure.js +5 -1
- package/es/LicenseByline/EmbedByline.js +8 -4
- package/es/LicenseByline/LicenseLink.js +11 -1
- package/es/index.js +1 -1
- package/es/locale/messages-en.js +1 -7
- package/es/locale/messages-nb.js +1 -7
- package/es/locale/messages-nn.js +1 -7
- package/es/locale/messages-se.js +1 -7
- package/es/locale/messages-sma.js +1 -7
- package/lib/Article/Article.d.ts +4 -2
- package/lib/Article/Article.js +6 -2
- package/lib/Embed/CopyrightEmbed.js +10 -1
- package/lib/Embed/EmbedWrapper.d.ts +11 -0
- package/lib/Embed/EmbedWrapper.js +30 -0
- package/lib/Embed/UuDisclaimerEmbed.js +16 -13
- package/lib/Embed/index.d.ts +1 -0
- package/lib/Embed/index.js +7 -0
- package/lib/KeyFigure/KeyFigure.js +5 -1
- package/lib/LicenseByline/EmbedByline.js +8 -4
- package/lib/LicenseByline/LicenseLink.d.ts +2 -1
- package/lib/LicenseByline/LicenseLink.js +11 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +6 -0
- package/lib/locale/messages-en.d.ts +1 -7
- package/lib/locale/messages-en.js +1 -7
- package/lib/locale/messages-nb.d.ts +1 -7
- package/lib/locale/messages-nb.js +1 -7
- package/lib/locale/messages-nn.d.ts +1 -7
- package/lib/locale/messages-nn.js +1 -7
- package/lib/locale/messages-se.d.ts +1 -7
- package/lib/locale/messages-se.js +1 -7
- package/lib/locale/messages-sma.d.ts +1 -7
- package/lib/locale/messages-sma.js +1 -7
- package/package.json +6 -6
- package/src/Article/Article.tsx +6 -1
- package/src/Embed/CopyrightEmbed.tsx +8 -1
- package/src/Embed/EmbedWrapper.tsx +25 -0
- package/src/Embed/UuDisclaimerEmbed.tsx +10 -10
- package/src/Embed/index.ts +1 -0
- package/src/Grid/Grid.stories.tsx +15 -9
- package/src/KeyFigure/KeyFigure.tsx +5 -0
- package/src/LicenseByline/EmbedByline.tsx +11 -6
- package/src/LicenseByline/LicenseLink.tsx +9 -2
- package/src/index.ts +1 -0
- package/src/locale/messages-en.ts +2 -8
- package/src/locale/messages-nb.ts +2 -8
- package/src/locale/messages-nn.ts +2 -8
- package/src/locale/messages-se.ts +2 -8
- package/src/locale/messages-sma.ts +2 -8
|
@@ -247,6 +247,7 @@
|
|
|
247
247
|
"width]___[value:surface.xlarge",
|
|
248
248
|
"maxHeight]___[value:50vh",
|
|
249
249
|
"overflowY]___[value:auto",
|
|
250
|
+
"marginBlockEnd]___[value:xsmall",
|
|
250
251
|
"background]___[value:background.subtle",
|
|
251
252
|
"height]___[value:5xlarge]___[cond:& svg",
|
|
252
253
|
"width]___[value:5xlarge]___[cond:& svg",
|
|
@@ -296,6 +297,7 @@
|
|
|
296
297
|
"outlineColor]___[value:stroke.default]___[cond:_focusVisible<___>_after",
|
|
297
298
|
"outlineOffset]___[value:3px]___[cond:_focusVisible<___>_after",
|
|
298
299
|
"outlineStyle]___[value:solid]___[cond:_focusVisible<___>_after",
|
|
300
|
+
"paddingInlineStart]___[value:4xsmall",
|
|
299
301
|
"textAlign]___[value:center",
|
|
300
302
|
"color]___[value:text.strong]___[cond:& a",
|
|
301
303
|
"marginTop]___[value:0]___[cond:& h1",
|
|
@@ -374,6 +376,7 @@
|
|
|
374
376
|
"borderColor]___[value:surface.brand.2",
|
|
375
377
|
"top]___[value:var(--masthead-height, 0px)]___[cond:& > div",
|
|
376
378
|
"position]___[value:sticky]___[cond:& > div",
|
|
379
|
+
"paddingBlock]___[value:xxlarge]___[cond:&:not(:has(> img))",
|
|
377
380
|
"width]___[value:surface.3xsmall",
|
|
378
381
|
"textStyle]___[value:heading.large",
|
|
379
382
|
"textStyle]___[value:title.medium",
|
|
@@ -412,6 +415,7 @@
|
|
|
412
415
|
"color]___[value:text.link",
|
|
413
416
|
"whiteSpace]___[value:nowrap",
|
|
414
417
|
"textDecoration]___[value:none]___[cond:_focusWithin",
|
|
418
|
+
"display]___[value:none]___[cond:mobileWideDown<___>_disabled",
|
|
415
419
|
"textDecoration]___[value:underline]___[cond:& h3",
|
|
416
420
|
"transitionProperty]___[value:width, height]___[cond:& [data-forward]",
|
|
417
421
|
"transitionTimingFunction]___[value:ease-in-out]___[cond:& [data-forward]",
|
package/dist/styles.css
CHANGED
|
@@ -498,6 +498,10 @@
|
|
|
498
498
|
max-height: 50vh;
|
|
499
499
|
}
|
|
500
500
|
|
|
501
|
+
.mbe_xsmall {
|
|
502
|
+
margin-block-end: var(--spacing-xsmall);
|
|
503
|
+
}
|
|
504
|
+
|
|
501
505
|
.bg_background\.subtle {
|
|
502
506
|
background: var(--colors-background-subtle);
|
|
503
507
|
}
|
|
@@ -542,6 +546,10 @@
|
|
|
542
546
|
padding-inline: var(--spacing-4xsmall);
|
|
543
547
|
}
|
|
544
548
|
|
|
549
|
+
.ps_4xsmall {
|
|
550
|
+
padding-inline-start: var(--spacing-4xsmall);
|
|
551
|
+
}
|
|
552
|
+
|
|
545
553
|
.ta_center {
|
|
546
554
|
text-align: center;
|
|
547
555
|
}
|
|
@@ -1175,6 +1183,10 @@
|
|
|
1175
1183
|
position: sticky;
|
|
1176
1184
|
}
|
|
1177
1185
|
|
|
1186
|
+
.\[\&\:not\(\:has\(\>_img\)\)\]\:py_xxlarge:not(:has(> img)) {
|
|
1187
|
+
padding-block: var(--spacing-xxlarge);
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1178
1190
|
.after\:d_block\!::after {
|
|
1179
1191
|
display: block !important;
|
|
1180
1192
|
}
|
|
@@ -1763,6 +1775,12 @@
|
|
|
1763
1775
|
.mobileWideDown\:open\:max-h_none:is([open], [data-open], [data-state="open"]) {
|
|
1764
1776
|
max-height: none;
|
|
1765
1777
|
}
|
|
1778
|
+
}
|
|
1779
|
+
|
|
1780
|
+
@media screen and (max-width: 29.7475rem) {
|
|
1781
|
+
.mobileWideDown\:disabled\:d_none:is(:disabled, [disabled], [data-disabled], [aria-disabled='true']) {
|
|
1782
|
+
display: none;
|
|
1783
|
+
}
|
|
1766
1784
|
}
|
|
1767
1785
|
|
|
1768
1786
|
@media screen and (max-width: 19.9975rem) {
|
package/es/Article/Article.js
CHANGED
|
@@ -109,6 +109,7 @@ export const ArticleTitle = _ref2 => {
|
|
|
109
109
|
lang,
|
|
110
110
|
id,
|
|
111
111
|
introduction,
|
|
112
|
+
contentTypeLabel,
|
|
112
113
|
competenceGoals
|
|
113
114
|
} = _ref2;
|
|
114
115
|
return /*#__PURE__*/_jsxs(ArticleHeader, {
|
|
@@ -119,7 +120,8 @@ export const ArticleTitle = _ref2 => {
|
|
|
119
120
|
direction: "row",
|
|
120
121
|
gap: "small",
|
|
121
122
|
children: [!!contentType && /*#__PURE__*/_jsx(ContentTypeBadgeNew, {
|
|
122
|
-
contentType: contentType
|
|
123
|
+
contentType: contentType,
|
|
124
|
+
children: contentTypeLabel
|
|
123
125
|
}), heartButton]
|
|
124
126
|
}), /*#__PURE__*/_jsx(Heading, {
|
|
125
127
|
textStyle: "heading.medium",
|
|
@@ -146,6 +148,7 @@ export const Article = _ref3 => {
|
|
|
146
148
|
licenseBox,
|
|
147
149
|
children,
|
|
148
150
|
competenceGoals,
|
|
151
|
+
contentTypeLabel,
|
|
149
152
|
id,
|
|
150
153
|
heartButton,
|
|
151
154
|
lang
|
|
@@ -167,7 +170,8 @@ export const Article = _ref3 => {
|
|
|
167
170
|
title: title,
|
|
168
171
|
introduction: introduction,
|
|
169
172
|
competenceGoals: competenceGoals,
|
|
170
|
-
lang: lang
|
|
173
|
+
lang: lang,
|
|
174
|
+
contentTypeLabel: contentTypeLabel
|
|
171
175
|
}), /*#__PURE__*/_jsx(ArticleContent, {
|
|
172
176
|
children: content
|
|
173
177
|
}), /*#__PURE__*/_jsxs(ArticleFooter, {
|
|
@@ -6,8 +6,14 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
9
10
|
import { EmbedByline } from "../LicenseByline";
|
|
10
11
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
const StyledCopyrightContent = styled("div", {
|
|
13
|
+
base: {
|
|
14
|
+
marginBlockEnd: "xsmall"
|
|
15
|
+
}
|
|
16
|
+
});
|
|
11
17
|
const CopyrightEmbed = _ref => {
|
|
12
18
|
let {
|
|
13
19
|
embed,
|
|
@@ -15,7 +21,10 @@ const CopyrightEmbed = _ref => {
|
|
|
15
21
|
} = _ref;
|
|
16
22
|
return /*#__PURE__*/_jsxs("figure", {
|
|
17
23
|
"data-embed-type": "copyright",
|
|
18
|
-
children: [
|
|
24
|
+
children: [/*#__PURE__*/_jsx(StyledCopyrightContent, {
|
|
25
|
+
"data-copyright-content": "",
|
|
26
|
+
children: children
|
|
27
|
+
}), /*#__PURE__*/_jsx(EmbedByline, {
|
|
19
28
|
type: "copyright",
|
|
20
29
|
copyright: embed.embedData.copyright
|
|
21
30
|
})]
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import { forwardRef } from "react";
|
|
10
|
+
import { ark } from "@ark-ui/react";
|
|
11
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
const StyledEmbedWrapper = styled(ark.div, {
|
|
14
|
+
base: {
|
|
15
|
+
position: "relative"
|
|
16
|
+
}
|
|
17
|
+
}, {
|
|
18
|
+
baseComponent: true
|
|
19
|
+
});
|
|
20
|
+
export const EmbedWrapper = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(StyledEmbedWrapper, {
|
|
21
|
+
"data-embed-wrapper": "",
|
|
22
|
+
...props,
|
|
23
|
+
ref: ref
|
|
24
|
+
}));
|
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
9
|
import { InformationLine } from "@ndla/icons/common";
|
|
11
10
|
import { MessageBox } from "@ndla/primitives";
|
|
12
11
|
import { SafeLink } from "@ndla/safelink";
|
|
13
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
|
-
import { jsx as _jsx,
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
14
|
const StyledMessageBox = styled(MessageBox, {
|
|
16
15
|
base: {
|
|
17
16
|
display: "flex",
|
|
18
|
-
alignItems: "center"
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
marginBlockEnd: "xsmall"
|
|
19
19
|
}
|
|
20
20
|
});
|
|
21
21
|
const Disclaimer = styled("div", {
|
|
@@ -23,14 +23,16 @@ const Disclaimer = styled("div", {
|
|
|
23
23
|
textStyle: "body.medium"
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
+
const StyledSafeLink = styled(SafeLink, {
|
|
27
|
+
base: {
|
|
28
|
+
paddingInlineStart: "4xsmall"
|
|
29
|
+
}
|
|
30
|
+
});
|
|
26
31
|
const UuDisclaimerEmbed = _ref => {
|
|
27
32
|
let {
|
|
28
33
|
embed,
|
|
29
34
|
children
|
|
30
35
|
} = _ref;
|
|
31
|
-
const {
|
|
32
|
-
t
|
|
33
|
-
} = useTranslation();
|
|
34
36
|
if (embed.status === "error") {
|
|
35
37
|
return null;
|
|
36
38
|
}
|
|
@@ -38,13 +40,11 @@ const UuDisclaimerEmbed = _ref => {
|
|
|
38
40
|
embedData,
|
|
39
41
|
data
|
|
40
42
|
} = embed;
|
|
41
|
-
const disclaimerLink = data?.disclaimerLink ? /*#__PURE__*/
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
children: data.disclaimerLink.text
|
|
47
|
-
})]
|
|
43
|
+
const disclaimerLink = data?.disclaimerLink ? /*#__PURE__*/_jsx(StyledSafeLink, {
|
|
44
|
+
to: data.disclaimerLink.href,
|
|
45
|
+
target: "_blank",
|
|
46
|
+
rel: "noopener noreferrer",
|
|
47
|
+
children: data.disclaimerLink.text
|
|
48
48
|
}) : null;
|
|
49
49
|
return /*#__PURE__*/_jsxs("div", {
|
|
50
50
|
role: "region",
|
|
@@ -55,7 +55,10 @@ const UuDisclaimerEmbed = _ref => {
|
|
|
55
55
|
children: [/*#__PURE__*/_jsx(InformationLine, {}), /*#__PURE__*/_jsxs(Disclaimer, {
|
|
56
56
|
children: [embedData.disclaimer, disclaimerLink]
|
|
57
57
|
})]
|
|
58
|
-
}),
|
|
58
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
59
|
+
"data-uu-content": "",
|
|
60
|
+
children: children
|
|
61
|
+
})]
|
|
59
62
|
});
|
|
60
63
|
};
|
|
61
64
|
export default UuDisclaimerEmbed;
|
package/es/Embed/index.js
CHANGED
|
@@ -20,4 +20,5 @@ export { ConceptEmbed, InlineConcept, BlockConcept } from "./ConceptEmbed";
|
|
|
20
20
|
export { default as UnknownEmbed } from "./UnknownEmbed";
|
|
21
21
|
export { default as UuDisclaimerEmbed } from "./UuDisclaimerEmbed";
|
|
22
22
|
export { default as CopyrightEmbed } from "./CopyrightEmbed";
|
|
23
|
-
export { default as CodeEmbed } from "./CodeEmbed";
|
|
23
|
+
export { default as CodeEmbed } from "./CodeEmbed";
|
|
24
|
+
export { EmbedWrapper } from "./EmbedWrapper";
|
|
@@ -14,7 +14,11 @@ const ContentWrapper = styled("div", {
|
|
|
14
14
|
display: "flex",
|
|
15
15
|
flexDirection: "column",
|
|
16
16
|
alignItems: "center",
|
|
17
|
-
justifyContent: "center"
|
|
17
|
+
justifyContent: "center",
|
|
18
|
+
gap: "xsmall",
|
|
19
|
+
"&:not(:has(> img))": {
|
|
20
|
+
paddingBlock: "xxlarge"
|
|
21
|
+
}
|
|
18
22
|
}
|
|
19
23
|
});
|
|
20
24
|
const StyledImage = styled("img", {
|
|
@@ -19,7 +19,6 @@ const BylineWrapper = styled("figcaption", {
|
|
|
19
19
|
display: "flex",
|
|
20
20
|
flexDirection: "column",
|
|
21
21
|
paddingBlock: "xsmall",
|
|
22
|
-
background: "surface.default",
|
|
23
22
|
textStyle: "label.medium",
|
|
24
23
|
color: "text.subtle"
|
|
25
24
|
}
|
|
@@ -144,9 +143,10 @@ const StyledButton = styled(Button, {
|
|
|
144
143
|
});
|
|
145
144
|
const LicenseDescription = _ref2 => {
|
|
146
145
|
let {
|
|
147
|
-
children
|
|
146
|
+
children,
|
|
147
|
+
isOpen,
|
|
148
|
+
setIsOpen
|
|
148
149
|
} = _ref2;
|
|
149
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
150
150
|
const open = isOpen ? {
|
|
151
151
|
"data-open": ""
|
|
152
152
|
} : {};
|
|
@@ -184,18 +184,22 @@ export const LicenseContainerContent = _ref3 => {
|
|
|
184
184
|
const license = copyright ? getLicenseByAbbreviation(copyright.license?.license ?? "", i18n.language) : undefined;
|
|
185
185
|
const authors = getLicenseCredits(copyright);
|
|
186
186
|
const captionAuthors = Object.values(authors).find(i => i.length > 0) ?? [];
|
|
187
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
187
188
|
const content = /*#__PURE__*/_jsxs(_Fragment, {
|
|
188
189
|
children: [children, ` ${t(`embed.type.${type}`)}${captionAuthors.length ? ": " : ""}`, /*#__PURE__*/_jsx("span", {
|
|
189
190
|
property: "cc:attributionName",
|
|
190
191
|
children: captionAuthors.map(author => author.name).join(", ")
|
|
191
192
|
}), license ? /*#__PURE__*/_jsxs(_Fragment, {
|
|
192
193
|
children: [" / ", /*#__PURE__*/_jsx(LicenseLink, {
|
|
193
|
-
license: license
|
|
194
|
+
license: license,
|
|
195
|
+
hideLink: !isOpen && !!children
|
|
194
196
|
})]
|
|
195
197
|
}) : null]
|
|
196
198
|
});
|
|
197
199
|
if (children) {
|
|
198
200
|
return /*#__PURE__*/_jsx(LicenseDescription, {
|
|
201
|
+
isOpen: isOpen,
|
|
202
|
+
setIsOpen: setIsOpen,
|
|
199
203
|
children: content
|
|
200
204
|
});
|
|
201
205
|
}
|
|
@@ -19,13 +19,22 @@ const StyledSafeLink = styled(SafeLink, {
|
|
|
19
19
|
},
|
|
20
20
|
_focusWithin: {
|
|
21
21
|
textDecoration: "none"
|
|
22
|
+
},
|
|
23
|
+
mobileWideDown: {
|
|
24
|
+
_disabled: {
|
|
25
|
+
display: "none"
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
});
|
|
25
30
|
export const LicenseLink = _ref => {
|
|
26
31
|
let {
|
|
27
|
-
license
|
|
32
|
+
license,
|
|
33
|
+
hideLink
|
|
28
34
|
} = _ref;
|
|
35
|
+
const disabled = hideLink ? {
|
|
36
|
+
"data-disabled": ""
|
|
37
|
+
} : {};
|
|
29
38
|
if (license.abbreviation === "unknown") {
|
|
30
39
|
return null;
|
|
31
40
|
}
|
|
@@ -33,6 +42,7 @@ export const LicenseLink = _ref => {
|
|
|
33
42
|
return /*#__PURE__*/_jsx(StyledSafeLink, {
|
|
34
43
|
to: license.url,
|
|
35
44
|
rel: "license",
|
|
45
|
+
...disabled,
|
|
36
46
|
children: license.abbreviation
|
|
37
47
|
});
|
|
38
48
|
}
|
package/es/index.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// Move components to this file when they are migrated to typescript
|
|
11
11
|
|
|
12
12
|
export { Concept } from "./Concept/Concept";
|
|
13
|
-
export { ImageEmbed, getCrop, getFocalPoint, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, UnknownEmbed, InlineConcept, BlockConcept, UuDisclaimerEmbed, CopyrightEmbed, CodeEmbed, InlineTriggerButton } from "./Embed";
|
|
13
|
+
export { ImageEmbed, getCrop, getFocalPoint, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, UnknownEmbed, InlineConcept, BlockConcept, UuDisclaimerEmbed, CopyrightEmbed, CodeEmbed, InlineTriggerButton, EmbedWrapper } from "./Embed";
|
|
14
14
|
export { LicenseLink, EmbedByline } from "./LicenseByline";
|
|
15
15
|
export { ArticleByline, ArticleBylineAccordionItem, ArticleFootNotes, ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle } from "./Article";
|
|
16
16
|
export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
|
package/es/locale/messages-en.js
CHANGED
|
@@ -1218,10 +1218,7 @@ const messages = {
|
|
|
1218
1218
|
learningpathUnsupported: "Learning paths and multidisciplinary cases cannot be shown directly in a shared folder. You can open the learning path in a new tab by clicking the link in the navigation menu to the left.",
|
|
1219
1219
|
drawerButton: "Show folders and resources",
|
|
1220
1220
|
drawerTitle: "Folders and resources",
|
|
1221
|
-
description:
|
|
1222
|
-
all: "In this folder you find articles and tasks from NDLA. The articles have been collected and placed in order by a teacher.\n\nYou can use the menu to navigate through the articles.",
|
|
1223
|
-
info1: "In this folder you find articles and tasks from NDLA. The articles have been collected and placed in order by a teacher."
|
|
1224
|
-
},
|
|
1221
|
+
description: "In this folder you find articles and tasks from NDLA. The articles have been collected and placed in order by a teacher.",
|
|
1225
1222
|
willOpenInNewTab: "Opens in a new tab."
|
|
1226
1223
|
},
|
|
1227
1224
|
myPage: {
|
|
@@ -1407,9 +1404,6 @@ const messages = {
|
|
|
1407
1404
|
pinyin: "Pinyin"
|
|
1408
1405
|
}
|
|
1409
1406
|
},
|
|
1410
|
-
uuDisclaimer: {
|
|
1411
|
-
alternative: "You can find alternative content in the article"
|
|
1412
|
-
},
|
|
1413
1407
|
wordClass: {
|
|
1414
1408
|
[wordClass.wordClass.adjective]: "Adjective",
|
|
1415
1409
|
[wordClass.wordClass.adverb]: "Adverb",
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -1218,10 +1218,7 @@ const messages = {
|
|
|
1218
1218
|
learningpathUnsupported: "Læringsstier og tverrfaglige caser kan ikke vises direkte i delte mapper. Dersom du trykker på lenka i navigasjonsmenyen til venstre, vil stien åpnes i en ny fane.",
|
|
1219
1219
|
drawerButton: "Vis mapper og ressurser",
|
|
1220
1220
|
drawerTitle: "Mapper og ressurser",
|
|
1221
|
-
description:
|
|
1222
|
-
all: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.\n\nDu kan bla i artiklene ved å bruke menyen.",
|
|
1223
|
-
info1: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer."
|
|
1224
|
-
},
|
|
1221
|
+
description: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.",
|
|
1225
1222
|
willOpenInNewTab: "Åpnes i ny fane."
|
|
1226
1223
|
},
|
|
1227
1224
|
myPage: {
|
|
@@ -1407,9 +1404,6 @@ const messages = {
|
|
|
1407
1404
|
pinyin: "Pinyin"
|
|
1408
1405
|
}
|
|
1409
1406
|
},
|
|
1410
|
-
uuDisclaimer: {
|
|
1411
|
-
alternative: "Du kan finne alternativt innhold i artikkelen"
|
|
1412
|
-
},
|
|
1413
1407
|
wordClass: {
|
|
1414
1408
|
[wordClass.wordClass.adjective]: "Adjektiv",
|
|
1415
1409
|
[wordClass.wordClass.adverb]: "Adverb",
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -1218,10 +1218,7 @@ const messages = {
|
|
|
1218
1218
|
drawerButton: "Vis mapper og ressursar",
|
|
1219
1219
|
drawerTitle: "Mapper og ressursar",
|
|
1220
1220
|
learningpathUnsupported: "Læringsstiar og tverrfaglege caser kan ikkje visast direkte i delte mapper. Dersom du trykker på lenka i navigasjonsmenyen til venstre, blir stien opna i ei ny fane.",
|
|
1221
|
-
description:
|
|
1222
|
-
all: "I denne delte mappa finn du fagstoff og oppgåver frå NDLA. Artiklane er samla inn og sette i rekkefølge av ein lærar.\n\nDu kan bla i artiklane ved å bruke menyen.",
|
|
1223
|
-
info1: "I denne delte mappa finn du fagstoff og oppgåver frå NDLA. Artiklane er samla inn og sette i rekkefølge av ein lærar."
|
|
1224
|
-
},
|
|
1221
|
+
description: "I denne delte mappa finn du fagstoff og oppgåver frå NDLA. Artiklane er samla inn og sette i rekkefølge av ein lærar.",
|
|
1225
1222
|
willOpenInNewTab: "Blir opna i ny fane."
|
|
1226
1223
|
},
|
|
1227
1224
|
myPage: {
|
|
@@ -1407,9 +1404,6 @@ const messages = {
|
|
|
1407
1404
|
pinyin: "Pinyin"
|
|
1408
1405
|
}
|
|
1409
1406
|
},
|
|
1410
|
-
uuDisclaimer: {
|
|
1411
|
-
alternative: "Du kan finne alternativt innhald i artikkelen"
|
|
1412
|
-
},
|
|
1413
1407
|
wordClass: {
|
|
1414
1408
|
[wordClass.wordClass.adjective]: "Adjektiv",
|
|
1415
1409
|
[wordClass.wordClass.adverb]: "Adverb",
|
package/es/locale/messages-se.js
CHANGED
|
@@ -1218,10 +1218,7 @@ const messages = {
|
|
|
1218
1218
|
learningpathUnsupported: "Læringsstier og tverrfaglige caser kan ikke vises direkte i delte mapper. Dersom du trykker på lenka i navigasjonsmenyen til venstre, vil stien åpnes i en ny fane.",
|
|
1219
1219
|
drawerButton: "Vis mapper og ressurser",
|
|
1220
1220
|
drawerTitle: "Mapper og ressurser",
|
|
1221
|
-
description:
|
|
1222
|
-
all: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.\n\nDu kan bla i artiklene ved å bruke menyen.",
|
|
1223
|
-
info1: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer."
|
|
1224
|
-
},
|
|
1221
|
+
description: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.",
|
|
1225
1222
|
willOpenInNewTab: "Åpnes i ny fane."
|
|
1226
1223
|
},
|
|
1227
1224
|
myPage: {
|
|
@@ -1407,9 +1404,6 @@ const messages = {
|
|
|
1407
1404
|
pinyin: "Pinyin"
|
|
1408
1405
|
}
|
|
1409
1406
|
},
|
|
1410
|
-
uuDisclaimer: {
|
|
1411
|
-
alternative: "Du kan finne alternativt innhold i artikkelen"
|
|
1412
|
-
},
|
|
1413
1407
|
wordClass: {
|
|
1414
1408
|
[wordClass.wordClass.adjective]: "Adjektiivvat",
|
|
1415
1409
|
[wordClass.wordClass.adverb]: "Advearba",
|
|
@@ -1218,10 +1218,7 @@ const messages = {
|
|
|
1218
1218
|
learningpathUnsupported: "Læringsstier og tverrfaglige caser kan ikke vises direkte i delte mapper. Dersom du trykker på lenka i navigasjonsmenyen til venstre, vil stien åpnes i en ny fane.",
|
|
1219
1219
|
drawerButton: "Vis mapper og ressurser",
|
|
1220
1220
|
drawerTitle: "Mapper og ressurser",
|
|
1221
|
-
description:
|
|
1222
|
-
all: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.\n\nDu kan bla i artiklene ved å bruke menyen.",
|
|
1223
|
-
info1: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer."
|
|
1224
|
-
},
|
|
1221
|
+
description: "I denne delte mappa finner du fagstoff og oppgaver fra NDLA. Artiklene er samlet inn og satt i rekkefølge av en lærer.",
|
|
1225
1222
|
willOpenInNewTab: "Åpnes i ny fane."
|
|
1226
1223
|
},
|
|
1227
1224
|
myPage: {
|
|
@@ -1407,9 +1404,6 @@ const messages = {
|
|
|
1407
1404
|
pinyin: "Pinyin"
|
|
1408
1405
|
}
|
|
1409
1406
|
},
|
|
1410
|
-
uuDisclaimer: {
|
|
1411
|
-
alternative: "Du kan finne alternativt innhold i artikkelen"
|
|
1412
|
-
},
|
|
1413
1407
|
wordClass: {
|
|
1414
1408
|
[wordClass.wordClass.adjective]: "Adjektiv",
|
|
1415
1409
|
[wordClass.wordClass.adverb]: "Adverb",
|
package/lib/Article/Article.d.ts
CHANGED
|
@@ -28,22 +28,24 @@ export declare const ArticleFooter: import("@ndla/styled-system/types").StyledCo
|
|
|
28
28
|
interface ArticleTitleProps {
|
|
29
29
|
heartButton?: ReactNode;
|
|
30
30
|
contentType?: ContentType;
|
|
31
|
+
contentTypeLabel?: ReactNode;
|
|
31
32
|
competenceGoals?: ReactNode;
|
|
32
33
|
id: string;
|
|
33
34
|
lang?: string;
|
|
34
35
|
title?: ReactNode;
|
|
35
36
|
introduction?: ReactNode;
|
|
36
37
|
}
|
|
37
|
-
export declare const ArticleTitle: ({ contentType, heartButton, title, lang, id, introduction, competenceGoals, }: ArticleTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
export declare const ArticleTitle: ({ contentType, heartButton, title, lang, id, introduction, contentTypeLabel, competenceGoals, }: ArticleTitleProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
39
|
interface Props {
|
|
39
40
|
heartButton?: ReactNode;
|
|
40
41
|
article: ArticleType;
|
|
41
42
|
licenseBox?: ReactNode;
|
|
42
43
|
contentType?: ContentType;
|
|
44
|
+
contentTypeLabel?: ReactNode;
|
|
43
45
|
children?: ReactNode;
|
|
44
46
|
competenceGoals?: ReactNode;
|
|
45
47
|
id: string;
|
|
46
48
|
lang?: string;
|
|
47
49
|
}
|
|
48
|
-
export declare const Article: ({ article, contentType, licenseBox, children, competenceGoals, id, heartButton, lang, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
export declare const Article: ({ article, contentType, licenseBox, children, competenceGoals, contentTypeLabel, id, heartButton, lang, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
49
51
|
export {};
|
package/lib/Article/Article.js
CHANGED
|
@@ -115,6 +115,7 @@ const ArticleTitle = _ref2 => {
|
|
|
115
115
|
lang,
|
|
116
116
|
id,
|
|
117
117
|
introduction,
|
|
118
|
+
contentTypeLabel,
|
|
118
119
|
competenceGoals
|
|
119
120
|
} = _ref2;
|
|
120
121
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleHeader, {
|
|
@@ -125,7 +126,8 @@ const ArticleTitle = _ref2 => {
|
|
|
125
126
|
direction: "row",
|
|
126
127
|
gap: "small",
|
|
127
128
|
children: [!!contentType && /*#__PURE__*/(0, _jsxRuntime.jsx)(_.ContentTypeBadgeNew, {
|
|
128
|
-
contentType: contentType
|
|
129
|
+
contentType: contentType,
|
|
130
|
+
children: contentTypeLabel
|
|
129
131
|
}), heartButton]
|
|
130
132
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Heading, {
|
|
131
133
|
textStyle: "heading.medium",
|
|
@@ -153,6 +155,7 @@ const Article = _ref3 => {
|
|
|
153
155
|
licenseBox,
|
|
154
156
|
children,
|
|
155
157
|
competenceGoals,
|
|
158
|
+
contentTypeLabel,
|
|
156
159
|
id,
|
|
157
160
|
heartButton,
|
|
158
161
|
lang
|
|
@@ -174,7 +177,8 @@ const Article = _ref3 => {
|
|
|
174
177
|
title: title,
|
|
175
178
|
introduction: introduction,
|
|
176
179
|
competenceGoals: competenceGoals,
|
|
177
|
-
lang: lang
|
|
180
|
+
lang: lang,
|
|
181
|
+
contentTypeLabel: contentTypeLabel
|
|
178
182
|
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(ArticleContent, {
|
|
179
183
|
children: content
|
|
180
184
|
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(ArticleFooter, {
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
7
8
|
var _LicenseByline = require("../LicenseByline");
|
|
8
9
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
9
10
|
/**
|
|
@@ -14,6 +15,11 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
14
15
|
*
|
|
15
16
|
*/
|
|
16
17
|
|
|
18
|
+
const StyledCopyrightContent = (0, _jsx2.styled)("div", {
|
|
19
|
+
base: {
|
|
20
|
+
marginBlockEnd: "xsmall"
|
|
21
|
+
}
|
|
22
|
+
});
|
|
17
23
|
const CopyrightEmbed = _ref => {
|
|
18
24
|
let {
|
|
19
25
|
embed,
|
|
@@ -21,7 +27,10 @@ const CopyrightEmbed = _ref => {
|
|
|
21
27
|
} = _ref;
|
|
22
28
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("figure", {
|
|
23
29
|
"data-embed-type": "copyright",
|
|
24
|
-
children: [
|
|
30
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledCopyrightContent, {
|
|
31
|
+
"data-copyright-content": "",
|
|
32
|
+
children: children
|
|
33
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseByline.EmbedByline, {
|
|
25
34
|
type: "copyright",
|
|
26
35
|
copyright: embed.embedData.copyright
|
|
27
36
|
})]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2024-present, NDLA.
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*
|
|
7
|
+
*/
|
|
8
|
+
/// <reference types="react" />
|
|
9
|
+
export declare const EmbedWrapper: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
11
|
+
}, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.EmbedWrapper = void 0;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _react2 = require("@ark-ui/react");
|
|
9
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
/**
|
|
12
|
+
* Copyright (c) 2024-present, NDLA.
|
|
13
|
+
*
|
|
14
|
+
* This source code is licensed under the GPLv3 license found in the
|
|
15
|
+
* LICENSE file in the root directory of this source tree.
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
const StyledEmbedWrapper = (0, _jsx2.styled)(_react2.ark.div, {
|
|
20
|
+
base: {
|
|
21
|
+
position: "relative"
|
|
22
|
+
}
|
|
23
|
+
}, {
|
|
24
|
+
baseComponent: true
|
|
25
|
+
});
|
|
26
|
+
const EmbedWrapper = exports.EmbedWrapper = /*#__PURE__*/(0, _react.forwardRef)((props, ref) => /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledEmbedWrapper, {
|
|
27
|
+
"data-embed-wrapper": "",
|
|
28
|
+
...props,
|
|
29
|
+
ref: ref
|
|
30
|
+
}));
|
|
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _reactI18next = require("react-i18next");
|
|
8
7
|
var _common = require("@ndla/icons/common");
|
|
9
8
|
var _primitives = require("@ndla/primitives");
|
|
10
9
|
var _safelink = require("@ndla/safelink");
|
|
@@ -21,7 +20,8 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
21
20
|
const StyledMessageBox = (0, _jsx2.styled)(_primitives.MessageBox, {
|
|
22
21
|
base: {
|
|
23
22
|
display: "flex",
|
|
24
|
-
alignItems: "center"
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
marginBlockEnd: "xsmall"
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
const Disclaimer = (0, _jsx2.styled)("div", {
|
|
@@ -29,14 +29,16 @@ const Disclaimer = (0, _jsx2.styled)("div", {
|
|
|
29
29
|
textStyle: "body.medium"
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
+
const StyledSafeLink = (0, _jsx2.styled)(_safelink.SafeLink, {
|
|
33
|
+
base: {
|
|
34
|
+
paddingInlineStart: "4xsmall"
|
|
35
|
+
}
|
|
36
|
+
});
|
|
32
37
|
const UuDisclaimerEmbed = _ref => {
|
|
33
38
|
let {
|
|
34
39
|
embed,
|
|
35
40
|
children
|
|
36
41
|
} = _ref;
|
|
37
|
-
const {
|
|
38
|
-
t
|
|
39
|
-
} = (0, _reactI18next.useTranslation)();
|
|
40
42
|
if (embed.status === "error") {
|
|
41
43
|
return null;
|
|
42
44
|
}
|
|
@@ -44,13 +46,11 @@ const UuDisclaimerEmbed = _ref => {
|
|
|
44
46
|
embedData,
|
|
45
47
|
data
|
|
46
48
|
} = embed;
|
|
47
|
-
const disclaimerLink = data?.disclaimerLink ? /*#__PURE__*/(0, _jsxRuntime.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
children: data.disclaimerLink.text
|
|
53
|
-
})]
|
|
49
|
+
const disclaimerLink = data?.disclaimerLink ? /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledSafeLink, {
|
|
50
|
+
to: data.disclaimerLink.href,
|
|
51
|
+
target: "_blank",
|
|
52
|
+
rel: "noopener noreferrer",
|
|
53
|
+
children: data.disclaimerLink.text
|
|
54
54
|
}) : null;
|
|
55
55
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
56
56
|
role: "region",
|
|
@@ -61,7 +61,10 @@ const UuDisclaimerEmbed = _ref => {
|
|
|
61
61
|
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_common.InformationLine, {}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(Disclaimer, {
|
|
62
62
|
children: [embedData.disclaimer, disclaimerLink]
|
|
63
63
|
})]
|
|
64
|
-
}),
|
|
64
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
65
|
+
"data-uu-content": "",
|
|
66
|
+
children: children
|
|
67
|
+
})]
|
|
65
68
|
});
|
|
66
69
|
};
|
|
67
70
|
var _default = exports.default = UuDisclaimerEmbed;
|