@ndla/ui 56.0.9-alpha.0 → 56.0.10-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 +7 -1
- package/dist/styles.css +28 -4
- package/es/CampaignBlock/CampaignBlock.js +27 -32
- package/es/CopyParagraphButton/CopyParagraphButton.js +26 -19
- package/es/Embed/RelatedContentEmbed.js +1 -4
- package/es/LinkBlock/LinkBlock.js +5 -6
- package/es/ResourceBox/ResourceBox.js +2 -2
- package/es/index.js +0 -2
- package/es/locale/messages-en.js +5 -1
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/es/locale/messages-se.js +5 -1
- package/es/locale/messages-sma.js +5 -1
- package/es/styles.css +28 -4
- package/lib/CampaignBlock/CampaignBlock.js +27 -32
- package/lib/CopyParagraphButton/CopyParagraphButton.js +28 -20
- package/lib/Embed/RelatedContentEmbed.js +1 -5
- package/lib/LinkBlock/LinkBlock.js +5 -6
- package/lib/ResourceBox/ResourceBox.js +2 -2
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -26
- package/lib/locale/messages-en.d.ts +4 -0
- package/lib/locale/messages-en.js +5 -1
- package/lib/locale/messages-nb.d.ts +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.d.ts +4 -0
- package/lib/locale/messages-nn.js +5 -1
- package/lib/locale/messages-se.d.ts +4 -0
- package/lib/locale/messages-se.js +5 -1
- package/lib/locale/messages-sma.d.ts +4 -0
- package/lib/locale/messages-sma.js +5 -1
- package/lib/styles.css +28 -4
- package/package.json +12 -17
- package/src/CampaignBlock/CampaignBlock.tsx +1 -2
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +33 -35
- package/src/Embed/RelatedContentEmbed.tsx +1 -7
- package/src/LinkBlock/LinkBlock.tsx +5 -4
- package/src/ResourceBox/ResourceBox.tsx +2 -2
- package/src/index.ts +0 -7
- package/src/locale/messages-en.ts +4 -0
- package/src/locale/messages-nb.ts +4 -0
- package/src/locale/messages-nn.ts +4 -0
- package/src/locale/messages-se.ts +4 -0
- package/src/locale/messages-sma.ts +4 -0
- package/es/ContentPlaceholder/ContentPlaceholder.js +0 -38
- package/es/ContentPlaceholder/index.js +0 -10
- package/es/FrontpageArticle/FrontpageArticle.js +0 -70
- package/es/FrontpageArticle/index.js +0 -11
- package/lib/ContentPlaceholder/ContentPlaceholder.d.ts +0 -9
- package/lib/ContentPlaceholder/ContentPlaceholder.js +0 -43
- package/lib/ContentPlaceholder/index.d.ts +0 -9
- package/lib/ContentPlaceholder/index.js +0 -16
- package/lib/FrontpageArticle/FrontpageArticle.d.ts +0 -20
- package/lib/FrontpageArticle/FrontpageArticle.js +0 -78
- package/lib/FrontpageArticle/index.d.ts +0 -10
- package/lib/FrontpageArticle/index.js +0 -29
- package/src/ContentPlaceholder/ContentPlaceholder.tsx +0 -67
- package/src/ContentPlaceholder/index.ts +0 -11
- package/src/FrontpageArticle/FrontpageArticle.tsx +0 -87
- package/src/FrontpageArticle/index.ts +0 -13
|
@@ -224,6 +224,13 @@
|
|
|
224
224
|
"border]___[value:2px solid",
|
|
225
225
|
"borderColor]___[value:var(--icon-color)",
|
|
226
226
|
"backgroundColor]___[value:var(--background-color)",
|
|
227
|
+
"opacity]___[value:1]___[cond:_hover<___>& [data-copy-button]",
|
|
228
|
+
"cursor]___[value:pointer]___[cond:_hover<___>& [data-copy-button]",
|
|
229
|
+
"left]___[value:-xxlarge",
|
|
230
|
+
"top]___[value:-4xsmall",
|
|
231
|
+
"opacity]___[value:0",
|
|
232
|
+
"cursor]___[value:pointer",
|
|
233
|
+
"opacity]___[value:1]___[cond:&:focus, &:focus-visible, &:active",
|
|
227
234
|
"marginInlineStart]___[value:xsmall",
|
|
228
235
|
"height]___[value:auto",
|
|
229
236
|
"textStyle]___[value:label.large",
|
|
@@ -245,7 +252,6 @@
|
|
|
245
252
|
"borderBottom]___[value:0",
|
|
246
253
|
"borderBottomLeftRadius]___[value:0",
|
|
247
254
|
"borderBottomRightRadius]___[value:0",
|
|
248
|
-
"cursor]___[value:pointer",
|
|
249
255
|
"background]___[value:background.default]___[cond:_hover<___>& [data-byline-button]",
|
|
250
256
|
"transform]___[value:scale(1.2)]___[cond:_hover<___>& button[data-expanded]",
|
|
251
257
|
"transform]___[value:rotate(-45deg)]___[cond:& button[data-expanded='true']<___>& svg",
|
package/dist/styles.css
CHANGED
|
@@ -426,6 +426,14 @@
|
|
|
426
426
|
border: 2px solid;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
.op_0 {
|
|
430
|
+
opacity: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.cursor_pointer {
|
|
434
|
+
cursor: pointer;
|
|
435
|
+
}
|
|
436
|
+
|
|
429
437
|
.ms_xsmall {
|
|
430
438
|
margin-inline-start: var(--spacing-xsmall);
|
|
431
439
|
}
|
|
@@ -446,10 +454,6 @@
|
|
|
446
454
|
border-bottom: 0;
|
|
447
455
|
}
|
|
448
456
|
|
|
449
|
-
.cursor_pointer {
|
|
450
|
-
cursor: pointer;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
457
|
.bg_background\.default\/20 {
|
|
454
458
|
--mix-background: color-mix(in srgb, var(--colors-background-default) 20%, transparent);
|
|
455
459
|
background: var(--mix-background, var(--colors-background-default));
|
|
@@ -710,6 +714,14 @@
|
|
|
710
714
|
background-color: var(--background-color);
|
|
711
715
|
}
|
|
712
716
|
|
|
717
|
+
.left_-xxlarge {
|
|
718
|
+
left: calc(var(--spacing-xxlarge) * -1);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.top_-4xsmall {
|
|
722
|
+
top: calc(var(--spacing-4xsmall) * -1);
|
|
723
|
+
}
|
|
724
|
+
|
|
713
725
|
.fw_bold {
|
|
714
726
|
font-weight: var(--font-weights-bold);
|
|
715
727
|
}
|
|
@@ -1294,6 +1306,10 @@
|
|
|
1294
1306
|
text-decoration: none;
|
|
1295
1307
|
}
|
|
1296
1308
|
|
|
1309
|
+
.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:focus,.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:focus-visible,.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:active {
|
|
1310
|
+
opacity: 1;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1297
1313
|
.focusVisible\:ring_none:is(:focus-visible, [data-focus-visible]) {
|
|
1298
1314
|
outline: 2px solid transparent;
|
|
1299
1315
|
outline-offset: 2px;
|
|
@@ -1391,6 +1407,14 @@
|
|
|
1391
1407
|
outline-style: solid;
|
|
1392
1408
|
}
|
|
1393
1409
|
|
|
1410
|
+
.hover\:\[\&_\[data-copy-button\]\]\:op_1:is(:hover, [data-hover]) [data-copy-button] {
|
|
1411
|
+
opacity: 1;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.hover\:\[\&_\[data-copy-button\]\]\:cursor_pointer:is(:hover, [data-hover]) [data-copy-button] {
|
|
1415
|
+
cursor: pointer;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1394
1418
|
.hover\:\[\&_\[data-byline-button\]\]\:bg_background\.default:is(:hover, [data-hover]) [data-byline-button] {
|
|
1395
1419
|
background: var(--colors-background-default);
|
|
1396
1420
|
}
|
|
@@ -97,38 +97,33 @@ const CampaignBlock = _ref2 => {
|
|
|
97
97
|
alt: image.alt
|
|
98
98
|
});
|
|
99
99
|
const HeaderComponent = url?.url ? LinkText : Text;
|
|
100
|
-
return (
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
_jsxs(
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
children: /*#__PURE__*/_jsx(
|
|
112
|
-
|
|
113
|
-
consumeCss: true,
|
|
114
|
-
textStyle: "heading.small",
|
|
115
|
-
children: /*#__PURE__*/_jsx(InternalHeading, {
|
|
116
|
-
children: parse(title)
|
|
117
|
-
})
|
|
100
|
+
return /*#__PURE__*/_jsxs(Container, {
|
|
101
|
+
className: className,
|
|
102
|
+
"data-embed-type": "campaign-block",
|
|
103
|
+
children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
104
|
+
children: [/*#__PURE__*/_jsx(MaybeLinkText, {
|
|
105
|
+
url: url?.url,
|
|
106
|
+
path: path,
|
|
107
|
+
children: /*#__PURE__*/_jsx(HeaderComponent, {
|
|
108
|
+
asChild: true,
|
|
109
|
+
consumeCss: true,
|
|
110
|
+
textStyle: "heading.small",
|
|
111
|
+
children: /*#__PURE__*/_jsx(InternalHeading, {
|
|
112
|
+
children: parse(title)
|
|
118
113
|
})
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
})
|
|
129
|
-
})
|
|
130
|
-
})
|
|
131
|
-
})
|
|
132
|
-
);
|
|
114
|
+
})
|
|
115
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
116
|
+
textStyle: "body.large",
|
|
117
|
+
children: parse(description)
|
|
118
|
+
}), !!url?.url && /*#__PURE__*/_jsx(MaybeLinkText, {
|
|
119
|
+
url: url.url,
|
|
120
|
+
path: path,
|
|
121
|
+
children: /*#__PURE__*/_jsxs(LinkText, {
|
|
122
|
+
textStyle: "body.medium",
|
|
123
|
+
children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
|
|
124
|
+
})
|
|
125
|
+
})]
|
|
126
|
+
}), imageSide !== "left" && imageComponent]
|
|
127
|
+
});
|
|
133
128
|
};
|
|
134
129
|
export default CampaignBlock;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _styled from "@emotion/styled/base";
|
|
2
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
3
1
|
/**
|
|
4
2
|
* Copyright (c) 2021-present, NDLA.
|
|
5
3
|
*
|
|
@@ -10,26 +8,34 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
10
8
|
|
|
11
9
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
12
10
|
import { useTranslation } from "react-i18next";
|
|
13
|
-
import { colors, stackOrder } from "@ndla/core";
|
|
14
11
|
import { LinkMedium } from "@ndla/icons/editor";
|
|
12
|
+
import { IconButton } from "@ndla/primitives";
|
|
13
|
+
import { styled } from "@ndla/styled-system/jsx";
|
|
15
14
|
import { copyTextToClipboard } from "@ndla/util";
|
|
16
15
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
|
-
const ContainerDiv =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
16
|
+
const ContainerDiv = styled("div", {
|
|
17
|
+
base: {
|
|
18
|
+
position: "relative",
|
|
19
|
+
_hover: {
|
|
20
|
+
"& [data-copy-button]": {
|
|
21
|
+
opacity: "1",
|
|
22
|
+
cursor: "pointer"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
const StyledIconButton = styled(IconButton, {
|
|
28
|
+
base: {
|
|
29
|
+
position: "absolute",
|
|
30
|
+
left: "-xxlarge",
|
|
31
|
+
top: "-4xsmall",
|
|
32
|
+
opacity: "0",
|
|
33
|
+
cursor: "pointer",
|
|
34
|
+
"&:focus, &:focus-visible, &:active": {
|
|
35
|
+
opacity: "1"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
28
38
|
});
|
|
29
|
-
const IconButton = /*#__PURE__*/_styled("button", {
|
|
30
|
-
target: "e18czas70",
|
|
31
|
-
label: "IconButton"
|
|
32
|
-
})("position:absolute;left:-3em;top:0.1em;background:none;border:0;z-index:", stackOrder.offsetSingle, ";transition:0.2s;opacity:0;color:", colors.brand.grey, ";& svg{width:30px;height:30px;}&:focus,&:focus-visible,&:active{cursor:pointer;opacity:1;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvcHlQYXJhZ3JhcGhCdXR0b24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCZ0MiLCJmaWxlIjoiQ29weVBhcmFncmFwaEJ1dHRvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMS1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbmltcG9ydCB7IFJlYWN0Tm9kZSwgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlTWVtbywgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IHVzZVRyYW5zbGF0aW9uIH0gZnJvbSBcInJlYWN0LWkxOG5leHRcIjtcbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgY29sb3JzLCBzdGFja09yZGVyIH0gZnJvbSBcIkBuZGxhL2NvcmVcIjtcbmltcG9ydCB7IExpbmtNZWRpdW0gfSBmcm9tIFwiQG5kbGEvaWNvbnMvZWRpdG9yXCI7XG5pbXBvcnQgeyBjb3B5VGV4dFRvQ2xpcGJvYXJkIH0gZnJvbSBcIkB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kaW5nXCI+XG4gICAgICA8SWNvbkJ1dHRvbiBkYXRhLWNvcHktYnV0dG9uPVwiXCIgb25DbGljaz17b25Db3B5Q2xpY2t9IHRpdGxlPXt0b29sdGlwfSBhcmlhLWxhYmVsPXtgJHt0b29sdGlwfTogJHtjb3B5VGV4dH1gfT5cbiAgICAgICAgPExpbmtNZWRpdW0gLz5cbiAgICAgIDwvSWNvbkJ1dHRvbj5cbiAgICAgIDxoMiBpZD17c2FuaXRpemVkVGl0bGV9IHRhYkluZGV4PXstMX0gbGFuZz17bGFuZ30+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvaDI+XG4gICAgPC9Db250YWluZXJEaXY+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb3B5UGFyYWdyYXBoQnV0dG9uO1xuIl19 */"));
|
|
33
39
|
const CopyParagraphButton = _ref => {
|
|
34
40
|
let {
|
|
35
41
|
children,
|
|
@@ -59,7 +65,8 @@ const CopyParagraphButton = _ref => {
|
|
|
59
65
|
const tooltip = hasCopied ? t("article.copyPageLinkCopied") : t("article.copyHeaderLink");
|
|
60
66
|
return /*#__PURE__*/_jsxs(ContainerDiv, {
|
|
61
67
|
"data-embed-type": "copy-heading",
|
|
62
|
-
children: [/*#__PURE__*/_jsx(
|
|
68
|
+
children: [/*#__PURE__*/_jsx(StyledIconButton, {
|
|
69
|
+
variant: "clear",
|
|
63
70
|
"data-copy-button": "",
|
|
64
71
|
onClick: onCopyClick,
|
|
65
72
|
title: tooltip,
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import punycode from "punycode/";
|
|
10
9
|
import { useTranslation } from "react-i18next";
|
|
11
10
|
import { contentTypeMapping } from "../model/ContentType";
|
|
12
11
|
import { RelatedArticle } from "../RelatedArticleList/RelatedArticleList";
|
|
@@ -47,9 +46,7 @@ const RelatedContentEmbed = _ref => {
|
|
|
47
46
|
to: embedData.url,
|
|
48
47
|
target: "_blank",
|
|
49
48
|
type: "external",
|
|
50
|
-
linkInfo: `${t("related.linkInfo")} ${
|
|
51
|
-
// Get domain name only from url
|
|
52
|
-
punycode.toUnicode(embedData.url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n]+)/im)?.[1] || embedData.url)}`
|
|
49
|
+
linkInfo: `${t("related.linkInfo")} ${embedData.urlDomain}`
|
|
53
50
|
});
|
|
54
51
|
}
|
|
55
52
|
return /*#__PURE__*/_jsx(_Fragment, {});
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { format } from "date-fns";
|
|
10
|
-
import { enGB, nb, nn } from "date-fns/locale";
|
|
11
9
|
import parse from "html-react-parser";
|
|
12
10
|
import { useMemo } from "react";
|
|
13
11
|
import { ArrowRightLine } from "@ndla/icons/common";
|
|
@@ -76,10 +74,11 @@ const LinkBlock = _ref => {
|
|
|
76
74
|
const href = getPossiblyRelativeUrl(url, path);
|
|
77
75
|
const formattedDate = useMemo(() => {
|
|
78
76
|
if (!date) return null;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
return new Intl.DateTimeFormat(articleLanguage, {
|
|
78
|
+
day: "2-digit",
|
|
79
|
+
month: "long",
|
|
80
|
+
year: "numeric"
|
|
81
|
+
}).format(new Date(date));
|
|
83
82
|
}, [date, articleLanguage]);
|
|
84
83
|
return /*#__PURE__*/_jsxs(StyledSafeLink, {
|
|
85
84
|
to: href,
|
|
@@ -6,11 +6,11 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
import { breakpoints } from "@ndla/core";
|
|
9
10
|
import { ShareBoxLine } from "@ndla/icons/common";
|
|
10
11
|
import { Heading, Image, Text } from "@ndla/primitives";
|
|
11
12
|
import { SafeLinkButton } from "@ndla/safelink";
|
|
12
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
|
-
import { token } from "@ndla/styled-system/tokens";
|
|
14
14
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const Container = styled("div", {
|
|
16
16
|
base: {
|
|
@@ -73,7 +73,7 @@ export const ResourceBox = _ref => {
|
|
|
73
73
|
children: [/*#__PURE__*/_jsx(StyledImage, {
|
|
74
74
|
src: image.src,
|
|
75
75
|
alt: image.alt,
|
|
76
|
-
sizes: `(min-width: ${
|
|
76
|
+
sizes: `(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`
|
|
77
77
|
}), /*#__PURE__*/_jsxs(ContentWrapper, {
|
|
78
78
|
children: [/*#__PURE__*/_jsx(Heading, {
|
|
79
79
|
textStyle: "label.large",
|
package/es/index.js
CHANGED
|
@@ -33,7 +33,6 @@ export { default as LayoutItem, OneColumn, PageContainer } from "./Layout";
|
|
|
33
33
|
export { default as ContentTypeBadge, SubjectMaterialBadge, TasksAndActivitiesBadge, AssessmentResourcesBadge, LearningPathBadge, SubjectBadge, SourceMaterialBadge, ConceptBadge } from "./ContentTypeBadge";
|
|
34
34
|
export { ContentTypeBadge as ContentTypeBadgeNew, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadgeNew";
|
|
35
35
|
export { default as CopyParagraphButton } from "./CopyParagraphButton";
|
|
36
|
-
export { default as ContentPlaceholder } from "./ContentPlaceholder";
|
|
37
36
|
export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTrigger, TagSelectorControl, TagSelectorClearTrigger, TagSelectorInputBase, TagSelectorInput } from "./TagSelector/TagSelector";
|
|
38
37
|
export { TreeStructure } from "./TreeStructure";
|
|
39
38
|
export { BlogPostV2 } from "./BlogPost";
|
|
@@ -42,7 +41,6 @@ export { KeyFigure } from "./KeyFigure";
|
|
|
42
41
|
export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
|
|
43
42
|
export { CampaignBlock } from "./CampaignBlock";
|
|
44
43
|
export { Grid, GridParallaxItem } from "./Grid";
|
|
45
|
-
export { default as FrontpageArticle, FRONTPAGE_ARTICLE_MAX_WIDTH, WIDE_FRONTPAGE_ARTICLE_MAX_WIDTH } from "./FrontpageArticle";
|
|
46
44
|
export { Gloss, GlossExample } from "./Gloss";
|
|
47
45
|
export { LinkBlock, LinkBlockSection } from "./LinkBlock";
|
|
48
46
|
export { CodeBlock, codeLanguageOptions } from "./CodeBlock";
|
package/es/locale/messages-en.js
CHANGED
|
@@ -1095,7 +1095,11 @@ const messages = {
|
|
|
1095
1095
|
markAll: "Mark all as read",
|
|
1096
1096
|
subscribe: "You will now be notified of new replies to this topic",
|
|
1097
1097
|
unsubscribe: "You have turned off notification of new replies to this topic",
|
|
1098
|
-
commentedOn: "commented on the post <i>{{title}}</i>"
|
|
1098
|
+
commentedOn: "commented on the post <i>{{title}}</i>",
|
|
1099
|
+
button: {
|
|
1100
|
+
show: "View notifications",
|
|
1101
|
+
showNew: "View {{count}} new notifications"
|
|
1102
|
+
}
|
|
1099
1103
|
},
|
|
1100
1104
|
topicsBy: "Topics by",
|
|
1101
1105
|
admin: {
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -1095,7 +1095,11 @@ const messages = {
|
|
|
1095
1095
|
markAll: "Merk alle som lest",
|
|
1096
1096
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
1097
1097
|
unsubscribe: "Du har skrudd av varsling om nye svar på dette innlegget",
|
|
1098
|
-
commentedOn: "svarte på innlegget <i>{{title}}</i>"
|
|
1098
|
+
commentedOn: "svarte på innlegget <i>{{title}}</i>",
|
|
1099
|
+
button: {
|
|
1100
|
+
show: "Vis varslinger",
|
|
1101
|
+
showNew: "Vis {{count}} nye varslinger"
|
|
1102
|
+
}
|
|
1099
1103
|
},
|
|
1100
1104
|
topicsBy: "Innlegg av",
|
|
1101
1105
|
admin: {
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -1095,7 +1095,11 @@ const messages = {
|
|
|
1095
1095
|
markAll: "Merk alle som lest",
|
|
1096
1096
|
subscribe: "Du får no varsling om nye svar på dette innlegget",
|
|
1097
1097
|
unsubscribe: "Du har skrudd av varsling om nye svar på dette innlegget",
|
|
1098
|
-
commentedOn: "svarte på innlegget <i>{{title}}</i>"
|
|
1098
|
+
commentedOn: "svarte på innlegget <i>{{title}}</i>",
|
|
1099
|
+
button: {
|
|
1100
|
+
show: "Vis varsler",
|
|
1101
|
+
showNew: "Vis {{count}} nye varsler"
|
|
1102
|
+
}
|
|
1099
1103
|
},
|
|
1100
1104
|
topicsBy: "Innlegg av",
|
|
1101
1105
|
admin: {
|
package/es/locale/messages-se.js
CHANGED
|
@@ -1095,7 +1095,11 @@ const messages = {
|
|
|
1095
1095
|
markAll: "Merk alle som lest",
|
|
1096
1096
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
1097
1097
|
unsubscribe: "Du har skrudd av varsling om nye svar på dette innlegget",
|
|
1098
|
-
commentedOn: "svarte på innlegget <i>{{title}}</i>"
|
|
1098
|
+
commentedOn: "svarte på innlegget <i>{{title}}</i>",
|
|
1099
|
+
button: {
|
|
1100
|
+
show: "Vis varslinger",
|
|
1101
|
+
showNew: "Vis {{count}} nye varslinger"
|
|
1102
|
+
}
|
|
1099
1103
|
},
|
|
1100
1104
|
topicsBy: "Innlegg av",
|
|
1101
1105
|
admin: {
|
|
@@ -1095,7 +1095,11 @@ const messages = {
|
|
|
1095
1095
|
markAll: "Merk alle som lest",
|
|
1096
1096
|
subscribe: "Du får nå varsling om nye svar på dette innlegget",
|
|
1097
1097
|
unsubscribe: "Du har skrudd av varsling om nye svar på dette innlegget",
|
|
1098
|
-
commentedOn: "svarte på innlegget <i>{{title}}</i>"
|
|
1098
|
+
commentedOn: "svarte på innlegget <i>{{title}}</i>",
|
|
1099
|
+
button: {
|
|
1100
|
+
show: "Vis varslinger",
|
|
1101
|
+
showNew: "Vis {{count}} nye varslinger"
|
|
1102
|
+
}
|
|
1099
1103
|
},
|
|
1100
1104
|
topicsBy: "Innlegg av",
|
|
1101
1105
|
admin: {
|
package/es/styles.css
CHANGED
|
@@ -426,6 +426,14 @@
|
|
|
426
426
|
border: 2px solid;
|
|
427
427
|
}
|
|
428
428
|
|
|
429
|
+
.op_0 {
|
|
430
|
+
opacity: 0;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
.cursor_pointer {
|
|
434
|
+
cursor: pointer;
|
|
435
|
+
}
|
|
436
|
+
|
|
429
437
|
.ms_xsmall {
|
|
430
438
|
margin-inline-start: var(--spacing-xsmall);
|
|
431
439
|
}
|
|
@@ -446,10 +454,6 @@
|
|
|
446
454
|
border-bottom: 0;
|
|
447
455
|
}
|
|
448
456
|
|
|
449
|
-
.cursor_pointer {
|
|
450
|
-
cursor: pointer;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
457
|
.bg_background\.default\/20 {
|
|
454
458
|
--mix-background: color-mix(in srgb, var(--colors-background-default) 20%, transparent);
|
|
455
459
|
background: var(--mix-background, var(--colors-background-default));
|
|
@@ -710,6 +714,14 @@
|
|
|
710
714
|
background-color: var(--background-color);
|
|
711
715
|
}
|
|
712
716
|
|
|
717
|
+
.left_-xxlarge {
|
|
718
|
+
left: calc(var(--spacing-xxlarge) * -1);
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
.top_-4xsmall {
|
|
722
|
+
top: calc(var(--spacing-4xsmall) * -1);
|
|
723
|
+
}
|
|
724
|
+
|
|
713
725
|
.fw_bold {
|
|
714
726
|
font-weight: var(--font-weights-bold);
|
|
715
727
|
}
|
|
@@ -1294,6 +1306,10 @@
|
|
|
1294
1306
|
text-decoration: none;
|
|
1295
1307
|
}
|
|
1296
1308
|
|
|
1309
|
+
.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:focus,.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:focus-visible,.\[\&\:focus\,_\&\:focus-visible\,_\&\:active\]\:op_1:active {
|
|
1310
|
+
opacity: 1;
|
|
1311
|
+
}
|
|
1312
|
+
|
|
1297
1313
|
.focusVisible\:ring_none:is(:focus-visible, [data-focus-visible]) {
|
|
1298
1314
|
outline: 2px solid transparent;
|
|
1299
1315
|
outline-offset: 2px;
|
|
@@ -1391,6 +1407,14 @@
|
|
|
1391
1407
|
outline-style: solid;
|
|
1392
1408
|
}
|
|
1393
1409
|
|
|
1410
|
+
.hover\:\[\&_\[data-copy-button\]\]\:op_1:is(:hover, [data-hover]) [data-copy-button] {
|
|
1411
|
+
opacity: 1;
|
|
1412
|
+
}
|
|
1413
|
+
|
|
1414
|
+
.hover\:\[\&_\[data-copy-button\]\]\:cursor_pointer:is(:hover, [data-hover]) [data-copy-button] {
|
|
1415
|
+
cursor: pointer;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1394
1418
|
.hover\:\[\&_\[data-byline-button\]\]\:bg_background\.default:is(:hover, [data-hover]) [data-byline-button] {
|
|
1395
1419
|
background: var(--colors-background-default);
|
|
1396
1420
|
}
|
|
@@ -104,38 +104,33 @@ const CampaignBlock = _ref2 => {
|
|
|
104
104
|
alt: image.alt
|
|
105
105
|
});
|
|
106
106
|
const HeaderComponent = url?.url ? LinkText : _primitives.Text;
|
|
107
|
-
return (
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
(0, _jsxRuntime.jsxs)(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
119
|
-
|
|
120
|
-
consumeCss: true,
|
|
121
|
-
textStyle: "heading.small",
|
|
122
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalHeading, {
|
|
123
|
-
children: (0, _htmlReactParser.default)(title)
|
|
124
|
-
})
|
|
107
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Container, {
|
|
108
|
+
className: className,
|
|
109
|
+
"data-embed-type": "campaign-block",
|
|
110
|
+
children: [imageSide === "left" && imageComponent, /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
|
|
111
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(MaybeLinkText, {
|
|
112
|
+
url: url?.url,
|
|
113
|
+
path: path,
|
|
114
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(HeaderComponent, {
|
|
115
|
+
asChild: true,
|
|
116
|
+
consumeCss: true,
|
|
117
|
+
textStyle: "heading.small",
|
|
118
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(InternalHeading, {
|
|
119
|
+
children: (0, _htmlReactParser.default)(title)
|
|
125
120
|
})
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
})
|
|
136
|
-
})
|
|
137
|
-
})
|
|
138
|
-
})
|
|
139
|
-
);
|
|
121
|
+
})
|
|
122
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
123
|
+
textStyle: "body.large",
|
|
124
|
+
children: (0, _htmlReactParser.default)(description)
|
|
125
|
+
}), !!url?.url && /*#__PURE__*/(0, _jsxRuntime.jsx)(MaybeLinkText, {
|
|
126
|
+
url: url.url,
|
|
127
|
+
path: path,
|
|
128
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(LinkText, {
|
|
129
|
+
textStyle: "body.medium",
|
|
130
|
+
children: [(0, _htmlReactParser.default)(url.text ?? ""), /*#__PURE__*/(0, _jsxRuntime.jsx)(_common.ArrowRightLine, {})]
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
}), imageSide !== "left" && imageComponent]
|
|
134
|
+
});
|
|
140
135
|
};
|
|
141
136
|
var _default = exports.default = CampaignBlock;
|
|
@@ -4,37 +4,44 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
8
7
|
var _react = require("react");
|
|
9
8
|
var _reactI18next = require("react-i18next");
|
|
10
|
-
var _core = require("@ndla/core");
|
|
11
9
|
var _editor = require("@ndla/icons/editor");
|
|
10
|
+
var _primitives = require("@ndla/primitives");
|
|
11
|
+
var _jsx2 = require("@ndla/styled-system/jsx");
|
|
12
12
|
var _util = require("@ndla/util");
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
|
-
|
|
15
|
-
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; } /**
|
|
14
|
+
/**
|
|
16
15
|
* Copyright (c) 2021-present, NDLA.
|
|
17
16
|
*
|
|
18
17
|
* This source code is licensed under the GPLv3 license found in the
|
|
19
18
|
* LICENSE file in the root directory of this source tree.
|
|
20
19
|
*
|
|
21
20
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
|
|
22
|
+
const ContainerDiv = (0, _jsx2.styled)("div", {
|
|
23
|
+
base: {
|
|
24
|
+
position: "relative",
|
|
25
|
+
_hover: {
|
|
26
|
+
"& [data-copy-button]": {
|
|
27
|
+
opacity: "1",
|
|
28
|
+
cursor: "pointer"
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const StyledIconButton = (0, _jsx2.styled)(_primitives.IconButton, {
|
|
34
|
+
base: {
|
|
35
|
+
position: "absolute",
|
|
36
|
+
left: "-xxlarge",
|
|
37
|
+
top: "-4xsmall",
|
|
38
|
+
opacity: "0",
|
|
39
|
+
cursor: "pointer",
|
|
40
|
+
"&:focus, &:focus-visible, &:active": {
|
|
41
|
+
opacity: "1"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
33
44
|
});
|
|
34
|
-
const IconButton = /*#__PURE__*/(0, _base.default)("button", {
|
|
35
|
-
target: "e18czas70",
|
|
36
|
-
label: "IconButton"
|
|
37
|
-
})("position:absolute;left:-3em;top:0.1em;background:none;border:0;z-index:", _core.stackOrder.offsetSingle, ";transition:0.2s;opacity:0;color:", _core.colors.brand.grey, ";& svg{width:30px;height:30px;}&:focus,&:focus-visible,&:active{cursor:pointer;opacity:1;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIkNvcHlQYXJhZ3JhcGhCdXR0b24udHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQXdCZ0MiLCJmaWxlIjoiQ29weVBhcmFncmFwaEJ1dHRvbi50c3giLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIENvcHlyaWdodCAoYykgMjAyMS1wcmVzZW50LCBORExBLlxuICpcbiAqIFRoaXMgc291cmNlIGNvZGUgaXMgbGljZW5zZWQgdW5kZXIgdGhlIEdQTHYzIGxpY2Vuc2UgZm91bmQgaW4gdGhlXG4gKiBMSUNFTlNFIGZpbGUgaW4gdGhlIHJvb3QgZGlyZWN0b3J5IG9mIHRoaXMgc291cmNlIHRyZWUuXG4gKlxuICovXG5cbmltcG9ydCB7IFJlYWN0Tm9kZSwgdXNlQ2FsbGJhY2ssIHVzZUVmZmVjdCwgdXNlTWVtbywgdXNlU3RhdGUgfSBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IHVzZVRyYW5zbGF0aW9uIH0gZnJvbSBcInJlYWN0LWkxOG5leHRcIjtcbmltcG9ydCBzdHlsZWQgZnJvbSBcIkBlbW90aW9uL3N0eWxlZFwiO1xuaW1wb3J0IHsgY29sb3JzLCBzdGFja09yZGVyIH0gZnJvbSBcIkBuZGxhL2Nv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dlTGlua0NvcGllZFwiKSA6IHQoXCJhcnRpY2xlLmNvcHlIZWFkZXJMaW5rXCIpO1xuICByZXR1cm4gKFxuICAgIDxDb250YWluZXJEaXYgZGF0YS1lbWJlZC10eXBlPVwiY29weS1oZWFkaW5nXCI+XG4gICAgICA8SWNvbkJ1dHRvbiBkYXRhLWNvcHktYnV0dG9uPVwiXCIgb25DbGljaz17b25Db3B5Q2xpY2t9IHRpdGxlPXt0b29sdGlwfSBhcmlhLWxhYmVsPXtgJHt0b29sdGlwfTogJHtjb3B5VGV4dH1gfT5cbiAgICAgICAgPExpbmtNZWRpdW0gLz5cbiAgICAgIDwvSWNvbkJ1dHRvbj5cbiAgICAgIDxoMiBpZD17c2FuaXRpemVkVGl0bGV9IHRhYkluZGV4PXstMX0gbGFuZz17bGFuZ30+XG4gICAgICAgIHtjaGlsZHJlbn1cbiAgICAgIDwvaDI+XG4gICAgPC9Db250YWluZXJEaXY+XG4gICk7XG59O1xuXG5leHBvcnQgZGVmYXVsdCBDb3B5UGFyYWdyYXBoQnV0dG9uO1xuIl19 */"));
|
|
38
45
|
const CopyParagraphButton = _ref => {
|
|
39
46
|
let {
|
|
40
47
|
children,
|
|
@@ -64,7 +71,8 @@ const CopyParagraphButton = _ref => {
|
|
|
64
71
|
const tooltip = hasCopied ? t("article.copyPageLinkCopied") : t("article.copyHeaderLink");
|
|
65
72
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContainerDiv, {
|
|
66
73
|
"data-embed-type": "copy-heading",
|
|
67
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(
|
|
74
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
|
|
75
|
+
variant: "clear",
|
|
68
76
|
"data-copy-button": "",
|
|
69
77
|
onClick: onCopyClick,
|
|
70
78
|
title: tooltip,
|
|
@@ -4,12 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var _punycode = _interopRequireDefault(require("punycode/"));
|
|
8
7
|
var _reactI18next = require("react-i18next");
|
|
9
8
|
var _ContentType = require("../model/ContentType");
|
|
10
9
|
var _RelatedArticleList = require("../RelatedArticleList/RelatedArticleList");
|
|
11
10
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
11
|
/**
|
|
14
12
|
* Copyright (c) 2023-present, NDLA.
|
|
15
13
|
*
|
|
@@ -54,9 +52,7 @@ const RelatedContentEmbed = _ref => {
|
|
|
54
52
|
to: embedData.url,
|
|
55
53
|
target: "_blank",
|
|
56
54
|
type: "external",
|
|
57
|
-
linkInfo: `${t("related.linkInfo")} ${
|
|
58
|
-
// Get domain name only from url
|
|
59
|
-
_punycode.default.toUnicode(embedData.url.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n]+)/im)?.[1] || embedData.url)}`
|
|
55
|
+
linkInfo: `${t("related.linkInfo")} ${embedData.urlDomain}`
|
|
60
56
|
});
|
|
61
57
|
}
|
|
62
58
|
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_jsxRuntime.Fragment, {});
|