@ndla/ui 56.0.112-alpha.0 → 56.0.113-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/es/Article/ArticleByline.js +7 -3
- package/es/locale/messages-en.js +1 -0
- package/es/locale/messages-nb.js +1 -0
- package/es/locale/messages-nn.js +1 -0
- package/es/locale/messages-se.js +1 -0
- package/lib/Article/ArticleByline.d.ts +1 -1
- package/lib/Article/ArticleByline.js +7 -3
- package/lib/locale/messages-en.d.ts +1 -0
- package/lib/locale/messages-en.js +1 -0
- package/lib/locale/messages-nb.d.ts +1 -0
- package/lib/locale/messages-nb.js +1 -0
- package/lib/locale/messages-nn.d.ts +1 -0
- package/lib/locale/messages-nn.js +1 -0
- package/lib/locale/messages-se.d.ts +1 -0
- package/lib/locale/messages-se.js +1 -0
- package/package.json +2 -2
- package/src/Article/ArticleByline.tsx +9 -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
|
@@ -114,12 +114,16 @@ export const ArticleByline = _ref => {
|
|
|
114
114
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
115
115
|
}, [onHashChange]);
|
|
116
116
|
const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
|
|
117
|
-
const
|
|
117
|
+
const authorLabel = {
|
|
118
|
+
article: "article.authorsLabel",
|
|
119
|
+
learningPath: "article.authorsLabelLearningpath",
|
|
120
|
+
external: "article.authorsLabelExternal"
|
|
121
|
+
};
|
|
118
122
|
return /*#__PURE__*/_jsxs(Wrapper, {
|
|
119
123
|
children: [!!displayByline && /*#__PURE__*/_jsxs(TextWrapper, {
|
|
120
|
-
learningpath:
|
|
124
|
+
learningpath: bylineType === "learningPath",
|
|
121
125
|
children: [!!showPrimaryContributors && /*#__PURE__*/_jsxs("span", {
|
|
122
|
-
children: [authors.length > 0 && `${t(
|
|
126
|
+
children: [authors.length > 0 && `${t(authorLabel[bylineType], {
|
|
123
127
|
names: renderContributors(authors, t),
|
|
124
128
|
interpolation: {
|
|
125
129
|
escapeValue: false
|
package/es/locale/messages-en.js
CHANGED
|
@@ -43,6 +43,7 @@ const messages = {
|
|
|
43
43
|
copyPageLinkCopied: "Link copied",
|
|
44
44
|
copyHeaderLink: "Copy link to header",
|
|
45
45
|
conjunction: "and",
|
|
46
|
+
authorsLabelExternal: "This link is added by {{names}}",
|
|
46
47
|
supplierLabel: "Rightsholder: {{name}}",
|
|
47
48
|
multipleSuppliersLabel: "Rightsholders: {{names}}",
|
|
48
49
|
printPage: "Print text",
|
package/es/locale/messages-nb.js
CHANGED
|
@@ -43,6 +43,7 @@ const messages = {
|
|
|
43
43
|
copyPageLinkCopied: "Lenke kopiert",
|
|
44
44
|
copyHeaderLink: "Kopier lenke til overskriften",
|
|
45
45
|
conjunction: "og",
|
|
46
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
46
47
|
supplierLabel: "Rettighetshaver: {{name}}",
|
|
47
48
|
multipleSuppliersLabel: "Rettighetshavere: {{names}}",
|
|
48
49
|
printPage: "Skriv ut teksten",
|
package/es/locale/messages-nn.js
CHANGED
|
@@ -43,6 +43,7 @@ const messages = {
|
|
|
43
43
|
copyPageLinkCopied: "Lenke kopiert",
|
|
44
44
|
copyHeaderLink: "Kopier lenke til overskrifta",
|
|
45
45
|
conjunction: "og",
|
|
46
|
+
authorsLabelExternal: "Denne lenka er lagd til av {{names}}",
|
|
46
47
|
supplierLabel: "Rettshavar: {{name}}",
|
|
47
48
|
multipleSuppliersLabel: "Rettshavarar: {{names}}",
|
|
48
49
|
printPage: "Skriv ut teksten",
|
package/es/locale/messages-se.js
CHANGED
|
@@ -43,6 +43,7 @@ const messages = {
|
|
|
43
43
|
copyPageLinkCopied: "Liŋka máŋgejuvvon",
|
|
44
44
|
copyHeaderLink: "Máŋge liŋka bajilčállagii",
|
|
45
45
|
conjunction: "ja",
|
|
46
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
46
47
|
supplierLabel: "Vuoigatvuođaguoddi: {{name}}",
|
|
47
48
|
multipleSuppliersLabel: "Vuoigatvuođaguoddit: {{names}}",
|
|
48
49
|
printPage: "Čálit teavstta",
|
|
@@ -21,7 +21,7 @@ type Props = {
|
|
|
21
21
|
licenseBox?: ReactNode;
|
|
22
22
|
footnotes?: FootNote[];
|
|
23
23
|
displayByline?: boolean;
|
|
24
|
-
bylineType?: "article" | "learningPath";
|
|
24
|
+
bylineType?: "article" | "learningPath" | "external";
|
|
25
25
|
bylineSuffix?: ReactNode;
|
|
26
26
|
};
|
|
27
27
|
export declare const ArticleByline: ({ authors, suppliers, footnotes, licenseBox, published, displayByline, bylineType, bylineSuffix, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -120,12 +120,16 @@ const ArticleByline = _ref => {
|
|
|
120
120
|
return () => window.removeEventListener("hashchange", onHashChange);
|
|
121
121
|
}, [onHashChange]);
|
|
122
122
|
const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
|
|
123
|
-
const
|
|
123
|
+
const authorLabel = {
|
|
124
|
+
article: "article.authorsLabel",
|
|
125
|
+
learningPath: "article.authorsLabelLearningpath",
|
|
126
|
+
external: "article.authorsLabelExternal"
|
|
127
|
+
};
|
|
124
128
|
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(Wrapper, {
|
|
125
129
|
children: [!!displayByline && /*#__PURE__*/(0, _jsxRuntime.jsxs)(TextWrapper, {
|
|
126
|
-
learningpath:
|
|
130
|
+
learningpath: bylineType === "learningPath",
|
|
127
131
|
children: [!!showPrimaryContributors && /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
|
|
128
|
-
children: [authors.length > 0 && `${t(
|
|
132
|
+
children: [authors.length > 0 && `${t(authorLabel[bylineType], {
|
|
129
133
|
names: renderContributors(authors, t),
|
|
130
134
|
interpolation: {
|
|
131
135
|
escapeValue: false
|
|
@@ -50,6 +50,7 @@ const messages = {
|
|
|
50
50
|
copyPageLinkCopied: "Link copied",
|
|
51
51
|
copyHeaderLink: "Copy link to header",
|
|
52
52
|
conjunction: "and",
|
|
53
|
+
authorsLabelExternal: "This link is added by {{names}}",
|
|
53
54
|
supplierLabel: "Rightsholder: {{name}}",
|
|
54
55
|
multipleSuppliersLabel: "Rightsholders: {{names}}",
|
|
55
56
|
printPage: "Print text",
|
|
@@ -50,6 +50,7 @@ const messages = {
|
|
|
50
50
|
copyPageLinkCopied: "Lenke kopiert",
|
|
51
51
|
copyHeaderLink: "Kopier lenke til overskriften",
|
|
52
52
|
conjunction: "og",
|
|
53
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
53
54
|
supplierLabel: "Rettighetshaver: {{name}}",
|
|
54
55
|
multipleSuppliersLabel: "Rettighetshavere: {{names}}",
|
|
55
56
|
printPage: "Skriv ut teksten",
|
|
@@ -50,6 +50,7 @@ const messages = {
|
|
|
50
50
|
copyPageLinkCopied: "Lenke kopiert",
|
|
51
51
|
copyHeaderLink: "Kopier lenke til overskrifta",
|
|
52
52
|
conjunction: "og",
|
|
53
|
+
authorsLabelExternal: "Denne lenka er lagd til av {{names}}",
|
|
53
54
|
supplierLabel: "Rettshavar: {{name}}",
|
|
54
55
|
multipleSuppliersLabel: "Rettshavarar: {{names}}",
|
|
55
56
|
printPage: "Skriv ut teksten",
|
|
@@ -50,6 +50,7 @@ const messages = {
|
|
|
50
50
|
copyPageLinkCopied: "Liŋka máŋgejuvvon",
|
|
51
51
|
copyHeaderLink: "Máŋge liŋka bajilčállagii",
|
|
52
52
|
conjunction: "ja",
|
|
53
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
53
54
|
supplierLabel: "Vuoigatvuođaguoddi: {{name}}",
|
|
54
55
|
multipleSuppliersLabel: "Vuoigatvuođaguoddit: {{names}}",
|
|
55
56
|
printPage: "Čálit teavstta",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "56.0.
|
|
3
|
+
"version": "56.0.113-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "e8c865af1ed43005dd82d12f85a0704acd4ff4ae"
|
|
61
61
|
}
|
|
@@ -74,7 +74,7 @@ type Props = {
|
|
|
74
74
|
licenseBox?: ReactNode;
|
|
75
75
|
footnotes?: FootNote[];
|
|
76
76
|
displayByline?: boolean;
|
|
77
|
-
bylineType?: "article" | "learningPath";
|
|
77
|
+
bylineType?: "article" | "learningPath" | "external";
|
|
78
78
|
bylineSuffix?: ReactNode;
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -149,16 +149,21 @@ export const ArticleByline = ({
|
|
|
149
149
|
}, [onHashChange]);
|
|
150
150
|
|
|
151
151
|
const showPrimaryContributors = suppliers.length > 0 || authors.length > 0;
|
|
152
|
-
|
|
152
|
+
|
|
153
|
+
const authorLabel: Record<string, string> = {
|
|
154
|
+
article: "article.authorsLabel",
|
|
155
|
+
learningPath: "article.authorsLabelLearningpath",
|
|
156
|
+
external: "article.authorsLabelExternal",
|
|
157
|
+
};
|
|
153
158
|
|
|
154
159
|
return (
|
|
155
160
|
<Wrapper>
|
|
156
161
|
{!!displayByline && (
|
|
157
|
-
<TextWrapper learningpath={
|
|
162
|
+
<TextWrapper learningpath={bylineType === "learningPath"}>
|
|
158
163
|
{!!showPrimaryContributors && (
|
|
159
164
|
<span>
|
|
160
165
|
{authors.length > 0 &&
|
|
161
|
-
`${t(
|
|
166
|
+
`${t(authorLabel[bylineType], {
|
|
162
167
|
names: renderContributors(authors, t),
|
|
163
168
|
interpolation: { escapeValue: false },
|
|
164
169
|
})}. `}
|
|
@@ -41,6 +41,7 @@ const messages = {
|
|
|
41
41
|
copyPageLinkCopied: "Link copied",
|
|
42
42
|
copyHeaderLink: "Copy link to header",
|
|
43
43
|
conjunction: "and",
|
|
44
|
+
authorsLabelExternal: "This link is added by {{names}}",
|
|
44
45
|
supplierLabel: "Rightsholder: {{name}}",
|
|
45
46
|
multipleSuppliersLabel: "Rightsholders: {{names}}",
|
|
46
47
|
printPage: "Print text",
|
|
@@ -42,6 +42,7 @@ const messages = {
|
|
|
42
42
|
copyPageLinkCopied: "Lenke kopiert",
|
|
43
43
|
copyHeaderLink: "Kopier lenke til overskriften",
|
|
44
44
|
conjunction: "og",
|
|
45
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
45
46
|
supplierLabel: "Rettighetshaver: {{name}}",
|
|
46
47
|
multipleSuppliersLabel: "Rettighetshavere: {{names}}",
|
|
47
48
|
printPage: "Skriv ut teksten",
|
|
@@ -42,6 +42,7 @@ const messages = {
|
|
|
42
42
|
copyPageLinkCopied: "Lenke kopiert",
|
|
43
43
|
copyHeaderLink: "Kopier lenke til overskrifta",
|
|
44
44
|
conjunction: "og",
|
|
45
|
+
authorsLabelExternal: "Denne lenka er lagd til av {{names}}",
|
|
45
46
|
supplierLabel: "Rettshavar: {{name}}",
|
|
46
47
|
multipleSuppliersLabel: "Rettshavarar: {{names}}",
|
|
47
48
|
printPage: "Skriv ut teksten",
|
|
@@ -42,6 +42,7 @@ const messages = {
|
|
|
42
42
|
copyPageLinkCopied: "Liŋka máŋgejuvvon",
|
|
43
43
|
copyHeaderLink: "Máŋge liŋka bajilčállagii",
|
|
44
44
|
conjunction: "ja",
|
|
45
|
+
authorsLabelExternal: "Denne lenken er lagt til av {{names}}",
|
|
45
46
|
supplierLabel: "Vuoigatvuođaguoddi: {{name}}",
|
|
46
47
|
multipleSuppliersLabel: "Vuoigatvuođaguoddit: {{names}}",
|
|
47
48
|
printPage: "Čálit teavstta",
|