@ndla/ui 3.2.1 → 3.2.2
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/ArticleAuthorContent.js +1 -2
- package/es/BackgroundImage/BackgroundImage.js +27 -0
- package/es/BackgroundImage/index.js +2 -0
- package/es/ContentLoader/index.js +83 -0
- package/es/Dialog/Dialog.js +64 -0
- package/es/Dialog/index.js +10 -0
- package/es/FactBox/FactBox.js +7 -11
- package/es/Figure/Figure.js +93 -0
- package/es/Figure/FigureExpandButton.js +28 -0
- package/es/Figure/FigureLicense.js +54 -0
- package/es/Figure/FigureLicenseDialog.js +43 -0
- package/es/Figure/index.js +12 -0
- package/es/FileList/File.js +48 -0
- package/es/FileList/FileList.js +20 -0
- package/es/FileList/index.js +3 -0
- package/es/Hero/Hero.js +64 -0
- package/es/Hero/index.js +8 -0
- package/es/Image/Image.js +96 -0
- package/es/Image/ImageLink.js +46 -0
- package/es/Image/LazyLoadImage.js +47 -0
- package/es/Image/index.js +11 -0
- package/es/InfoBox/InfoBox.js +11 -0
- package/es/InfoBox/index.js +1 -0
- package/es/InfoWidget/InfoWidget.js +57 -0
- package/es/InfoWidget/index.js +2 -0
- package/es/Logo/Logo.js +51 -0
- package/es/Logo/SvgLogo.js +54 -0
- package/es/Logo/index.js +9 -0
- package/es/Masthead/Masthead.js +67 -0
- package/es/Masthead/index.js +10 -0
- package/es/NoContentBox/NoContentBox.js +26 -0
- package/es/NoContentBox/index.js +9 -0
- package/es/Portrait/Portrait.js +30 -0
- package/es/Portrait/index.js +9 -0
- package/es/RelatedArticleList/RelatedArticleList.js +4 -23
- package/es/Topic/Topic.js +20 -20
- package/es/Translation/Translation.js +22 -0
- package/es/Translation/TranslationBox.js +17 -0
- package/es/Translation/TranslationLine.js +37 -0
- package/es/Translation/index.js +3 -0
- package/es/index-javascript.js +1 -18
- package/es/index.js +17 -0
- package/es/locale/messages-en.js +4 -0
- package/es/locale/messages-nb.js +5 -1
- package/es/locale/messages-nn.js +5 -1
- package/lib/BackgroundImage/BackgroundImage.js +40 -0
- package/lib/BackgroundImage/index.js +13 -0
- package/lib/ContentLoader/index.js +88 -0
- package/lib/Dialog/Dialog.d.ts +1 -1
- package/lib/Dialog/Dialog.js +70 -0
- package/lib/Dialog/index.js +24 -0
- package/lib/FactBox/FactBox.d.ts +16 -0
- package/lib/FactBox/FactBox.js +5 -11
- package/lib/FactBox/index.d.ts +2 -0
- package/lib/Figure/Figure.js +105 -0
- package/lib/Figure/FigureExpandButton.js +41 -0
- package/lib/Figure/FigureLicense.js +66 -0
- package/lib/Figure/FigureLicenseDialog.js +48 -0
- package/lib/Figure/index.js +49 -0
- package/lib/FileList/File.js +63 -0
- package/lib/FileList/FileList.js +34 -0
- package/lib/FileList/index.js +21 -0
- package/lib/Hero/Hero.js +100 -0
- package/lib/Hero/index.js +55 -0
- package/lib/Image/Image.js +105 -0
- package/lib/Image/ImageLink.js +50 -0
- package/lib/Image/LazyLoadImage.js +51 -0
- package/lib/Image/index.js +38 -0
- package/lib/InfoBox/InfoBox.js +24 -0
- package/lib/InfoBox/index.js +15 -0
- package/lib/InfoWidget/InfoWidget.js +73 -0
- package/lib/InfoWidget/index.js +13 -0
- package/lib/Logo/Logo.js +70 -0
- package/lib/Logo/SvgLogo.js +59 -0
- package/lib/Logo/index.js +20 -0
- package/lib/Masthead/Masthead.js +82 -0
- package/lib/Masthead/index.js +30 -0
- package/lib/NoContentBox/NoContentBox.js +43 -0
- package/lib/NoContentBox/index.js +20 -0
- package/lib/Portrait/Portrait.js +43 -0
- package/lib/Portrait/index.js +20 -0
- package/lib/RelatedArticleList/RelatedArticleList.d.ts +25 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +2 -23
- package/lib/RelatedArticleList/index.d.ts +10 -0
- package/lib/Topic/Topic.js +20 -20
- package/lib/Translation/Translation.js +35 -0
- package/lib/Translation/TranslationBox.js +29 -0
- package/lib/Translation/TranslationLine.js +42 -0
- package/lib/Translation/index.js +31 -0
- package/lib/index-javascript.js +0 -230
- package/lib/index.d.ts +3 -0
- package/lib/index.js +263 -0
- package/lib/locale/messages-en.js +4 -0
- package/lib/locale/messages-nb.js +5 -1
- package/lib/locale/messages-nn.js +5 -1
- package/lib/utils/createUniversalPortal.d.ts +9 -0
- package/package.json +4 -4
- package/src/FactBox/{FactBox.jsx → FactBox.tsx} +12 -14
- package/src/FactBox/{index.js → index.ts} +0 -0
- package/src/RelatedArticleList/{RelatedArticleList.jsx → RelatedArticleList.tsx} +43 -30
- package/src/RelatedArticleList/{index.js → index.ts} +0 -0
- package/src/index-javascript.js +0 -3
- package/src/index.ts +6 -0
- package/src/utils/{createUniversalPortal.jsx → createUniversalPortal.tsx} +3 -3
package/lib/index.js
CHANGED
|
@@ -15,10 +15,23 @@ var _exportNames = {
|
|
|
15
15
|
ArticleHeaderWrapper: true,
|
|
16
16
|
ArticleSideBar: true,
|
|
17
17
|
Article: true,
|
|
18
|
+
createUniversalPortal: true,
|
|
19
|
+
NoContentBox: true,
|
|
20
|
+
Masthead: true,
|
|
21
|
+
MastheadItem: true,
|
|
22
|
+
Portrait: true,
|
|
23
|
+
ContentLoader: true,
|
|
24
|
+
RelatedArticleList: true,
|
|
25
|
+
RelatedArticle: true,
|
|
18
26
|
ErrorResourceAccessDenied: true,
|
|
19
27
|
ErrorMessage: true,
|
|
28
|
+
FileList: true,
|
|
29
|
+
File: true,
|
|
20
30
|
BlogPost: true,
|
|
21
31
|
BlogPostWrapper: true,
|
|
32
|
+
Logo: true,
|
|
33
|
+
InfoBox: true,
|
|
34
|
+
InfoWidget: true,
|
|
22
35
|
FrontpageInfo: true,
|
|
23
36
|
FrontpageFilm: true,
|
|
24
37
|
FrontpageToolbox: true,
|
|
@@ -27,10 +40,26 @@ var _exportNames = {
|
|
|
27
40
|
FrontpageSubjectIllustration: true,
|
|
28
41
|
FrontpageSearch: true,
|
|
29
42
|
FrontpageProgramMenu: true,
|
|
43
|
+
FactBox: true,
|
|
44
|
+
Image: true,
|
|
45
|
+
ImageLink: true,
|
|
46
|
+
makeSrcQueryString: true,
|
|
47
|
+
SubjectMaterialHero: true,
|
|
48
|
+
TasksAndActivitiesHero: true,
|
|
49
|
+
AssessmentResourcesHero: true,
|
|
50
|
+
SubjectHero: true,
|
|
51
|
+
ExternalLearningResourcesHero: true,
|
|
52
|
+
SourceMaterialHero: true,
|
|
53
|
+
Hero: true,
|
|
54
|
+
NdlaFilmHero: true,
|
|
30
55
|
Footer: true,
|
|
31
56
|
EditorName: true,
|
|
32
57
|
FooterText: true,
|
|
33
58
|
FooterAuth: true,
|
|
59
|
+
Figure: true,
|
|
60
|
+
FigureCaption: true,
|
|
61
|
+
FigureLicenseDialog: true,
|
|
62
|
+
FigureExpandButton: true,
|
|
34
63
|
LanguageSelector: true,
|
|
35
64
|
LearningPathWrapper: true,
|
|
36
65
|
LearningPathContent: true,
|
|
@@ -42,6 +71,10 @@ var _exportNames = {
|
|
|
42
71
|
LearningPathLastStepNavigation: true,
|
|
43
72
|
LearningPathMobileStepInfo: true,
|
|
44
73
|
LearningPathMobileHeader: true,
|
|
74
|
+
Translation: true,
|
|
75
|
+
TranslationLine: true,
|
|
76
|
+
TranslationBox: true,
|
|
77
|
+
Spinner: true,
|
|
45
78
|
SearchResultSleeve: true,
|
|
46
79
|
ContentTypeResult: true,
|
|
47
80
|
SearchFieldForm: true,
|
|
@@ -160,6 +193,54 @@ Object.defineProperty(exports, "Article", {
|
|
|
160
193
|
return _Article["default"];
|
|
161
194
|
}
|
|
162
195
|
});
|
|
196
|
+
Object.defineProperty(exports, "createUniversalPortal", {
|
|
197
|
+
enumerable: true,
|
|
198
|
+
get: function get() {
|
|
199
|
+
return _createUniversalPortal.createUniversalPortal;
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "NoContentBox", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function get() {
|
|
205
|
+
return _NoContentBox["default"];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
Object.defineProperty(exports, "Masthead", {
|
|
209
|
+
enumerable: true,
|
|
210
|
+
get: function get() {
|
|
211
|
+
return _Masthead["default"];
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(exports, "MastheadItem", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function get() {
|
|
217
|
+
return _Masthead.MastheadItem;
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
Object.defineProperty(exports, "Portrait", {
|
|
221
|
+
enumerable: true,
|
|
222
|
+
get: function get() {
|
|
223
|
+
return _Portrait["default"];
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
Object.defineProperty(exports, "ContentLoader", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: function get() {
|
|
229
|
+
return _ContentLoader["default"];
|
|
230
|
+
}
|
|
231
|
+
});
|
|
232
|
+
Object.defineProperty(exports, "RelatedArticleList", {
|
|
233
|
+
enumerable: true,
|
|
234
|
+
get: function get() {
|
|
235
|
+
return _RelatedArticleList["default"];
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(exports, "RelatedArticle", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
get: function get() {
|
|
241
|
+
return _RelatedArticleList.RelatedArticle;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
163
244
|
Object.defineProperty(exports, "ErrorResourceAccessDenied", {
|
|
164
245
|
enumerable: true,
|
|
165
246
|
get: function get() {
|
|
@@ -172,6 +253,18 @@ Object.defineProperty(exports, "ErrorMessage", {
|
|
|
172
253
|
return _ErrorMessage["default"];
|
|
173
254
|
}
|
|
174
255
|
});
|
|
256
|
+
Object.defineProperty(exports, "FileList", {
|
|
257
|
+
enumerable: true,
|
|
258
|
+
get: function get() {
|
|
259
|
+
return _FileList["default"];
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
Object.defineProperty(exports, "File", {
|
|
263
|
+
enumerable: true,
|
|
264
|
+
get: function get() {
|
|
265
|
+
return _FileList.File;
|
|
266
|
+
}
|
|
267
|
+
});
|
|
175
268
|
Object.defineProperty(exports, "BlogPost", {
|
|
176
269
|
enumerable: true,
|
|
177
270
|
get: function get() {
|
|
@@ -184,6 +277,24 @@ Object.defineProperty(exports, "BlogPostWrapper", {
|
|
|
184
277
|
return _BlogPosts.BlogPostWrapper;
|
|
185
278
|
}
|
|
186
279
|
});
|
|
280
|
+
Object.defineProperty(exports, "Logo", {
|
|
281
|
+
enumerable: true,
|
|
282
|
+
get: function get() {
|
|
283
|
+
return _Logo["default"];
|
|
284
|
+
}
|
|
285
|
+
});
|
|
286
|
+
Object.defineProperty(exports, "InfoBox", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
get: function get() {
|
|
289
|
+
return _InfoBox.InfoBox;
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
Object.defineProperty(exports, "InfoWidget", {
|
|
293
|
+
enumerable: true,
|
|
294
|
+
get: function get() {
|
|
295
|
+
return _InfoWidget["default"];
|
|
296
|
+
}
|
|
297
|
+
});
|
|
187
298
|
Object.defineProperty(exports, "FrontpageInfo", {
|
|
188
299
|
enumerable: true,
|
|
189
300
|
get: function get() {
|
|
@@ -232,6 +343,78 @@ Object.defineProperty(exports, "FrontpageProgramMenu", {
|
|
|
232
343
|
return _Frontpage.FrontpageProgramMenu;
|
|
233
344
|
}
|
|
234
345
|
});
|
|
346
|
+
Object.defineProperty(exports, "FactBox", {
|
|
347
|
+
enumerable: true,
|
|
348
|
+
get: function get() {
|
|
349
|
+
return _FactBox["default"];
|
|
350
|
+
}
|
|
351
|
+
});
|
|
352
|
+
Object.defineProperty(exports, "Image", {
|
|
353
|
+
enumerable: true,
|
|
354
|
+
get: function get() {
|
|
355
|
+
return _Image["default"];
|
|
356
|
+
}
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(exports, "ImageLink", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function get() {
|
|
361
|
+
return _Image.ImageLink;
|
|
362
|
+
}
|
|
363
|
+
});
|
|
364
|
+
Object.defineProperty(exports, "makeSrcQueryString", {
|
|
365
|
+
enumerable: true,
|
|
366
|
+
get: function get() {
|
|
367
|
+
return _Image.makeSrcQueryString;
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
Object.defineProperty(exports, "SubjectMaterialHero", {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
get: function get() {
|
|
373
|
+
return _Hero.SubjectMaterialHero;
|
|
374
|
+
}
|
|
375
|
+
});
|
|
376
|
+
Object.defineProperty(exports, "TasksAndActivitiesHero", {
|
|
377
|
+
enumerable: true,
|
|
378
|
+
get: function get() {
|
|
379
|
+
return _Hero.TasksAndActivitiesHero;
|
|
380
|
+
}
|
|
381
|
+
});
|
|
382
|
+
Object.defineProperty(exports, "AssessmentResourcesHero", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function get() {
|
|
385
|
+
return _Hero.AssessmentResourcesHero;
|
|
386
|
+
}
|
|
387
|
+
});
|
|
388
|
+
Object.defineProperty(exports, "SubjectHero", {
|
|
389
|
+
enumerable: true,
|
|
390
|
+
get: function get() {
|
|
391
|
+
return _Hero.SubjectHero;
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
Object.defineProperty(exports, "ExternalLearningResourcesHero", {
|
|
395
|
+
enumerable: true,
|
|
396
|
+
get: function get() {
|
|
397
|
+
return _Hero.ExternalLearningResourcesHero;
|
|
398
|
+
}
|
|
399
|
+
});
|
|
400
|
+
Object.defineProperty(exports, "SourceMaterialHero", {
|
|
401
|
+
enumerable: true,
|
|
402
|
+
get: function get() {
|
|
403
|
+
return _Hero.SourceMaterialHero;
|
|
404
|
+
}
|
|
405
|
+
});
|
|
406
|
+
Object.defineProperty(exports, "Hero", {
|
|
407
|
+
enumerable: true,
|
|
408
|
+
get: function get() {
|
|
409
|
+
return _Hero.Hero;
|
|
410
|
+
}
|
|
411
|
+
});
|
|
412
|
+
Object.defineProperty(exports, "NdlaFilmHero", {
|
|
413
|
+
enumerable: true,
|
|
414
|
+
get: function get() {
|
|
415
|
+
return _Hero.NdlaFilmHero;
|
|
416
|
+
}
|
|
417
|
+
});
|
|
235
418
|
Object.defineProperty(exports, "Footer", {
|
|
236
419
|
enumerable: true,
|
|
237
420
|
get: function get() {
|
|
@@ -256,6 +439,30 @@ Object.defineProperty(exports, "FooterAuth", {
|
|
|
256
439
|
return _Footer.FooterAuth;
|
|
257
440
|
}
|
|
258
441
|
});
|
|
442
|
+
Object.defineProperty(exports, "Figure", {
|
|
443
|
+
enumerable: true,
|
|
444
|
+
get: function get() {
|
|
445
|
+
return _Figure.Figure;
|
|
446
|
+
}
|
|
447
|
+
});
|
|
448
|
+
Object.defineProperty(exports, "FigureCaption", {
|
|
449
|
+
enumerable: true,
|
|
450
|
+
get: function get() {
|
|
451
|
+
return _Figure.FigureCaption;
|
|
452
|
+
}
|
|
453
|
+
});
|
|
454
|
+
Object.defineProperty(exports, "FigureLicenseDialog", {
|
|
455
|
+
enumerable: true,
|
|
456
|
+
get: function get() {
|
|
457
|
+
return _Figure.FigureLicenseDialog;
|
|
458
|
+
}
|
|
459
|
+
});
|
|
460
|
+
Object.defineProperty(exports, "FigureExpandButton", {
|
|
461
|
+
enumerable: true,
|
|
462
|
+
get: function get() {
|
|
463
|
+
return _Figure.FigureExpandButton;
|
|
464
|
+
}
|
|
465
|
+
});
|
|
259
466
|
Object.defineProperty(exports, "LanguageSelector", {
|
|
260
467
|
enumerable: true,
|
|
261
468
|
get: function get() {
|
|
@@ -322,6 +529,30 @@ Object.defineProperty(exports, "LearningPathMobileHeader", {
|
|
|
322
529
|
return _LearningPaths.LearningPathMobileHeader;
|
|
323
530
|
}
|
|
324
531
|
});
|
|
532
|
+
Object.defineProperty(exports, "Translation", {
|
|
533
|
+
enumerable: true,
|
|
534
|
+
get: function get() {
|
|
535
|
+
return _Translation.Translation;
|
|
536
|
+
}
|
|
537
|
+
});
|
|
538
|
+
Object.defineProperty(exports, "TranslationLine", {
|
|
539
|
+
enumerable: true,
|
|
540
|
+
get: function get() {
|
|
541
|
+
return _Translation.TranslationLine;
|
|
542
|
+
}
|
|
543
|
+
});
|
|
544
|
+
Object.defineProperty(exports, "TranslationBox", {
|
|
545
|
+
enumerable: true,
|
|
546
|
+
get: function get() {
|
|
547
|
+
return _Translation.TranslationBox;
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
Object.defineProperty(exports, "Spinner", {
|
|
551
|
+
enumerable: true,
|
|
552
|
+
get: function get() {
|
|
553
|
+
return _Spinner["default"];
|
|
554
|
+
}
|
|
555
|
+
});
|
|
325
556
|
Object.defineProperty(exports, "SearchResultSleeve", {
|
|
326
557
|
enumerable: true,
|
|
327
558
|
get: function get() {
|
|
@@ -716,18 +947,50 @@ Object.keys(_indexJavascript).forEach(function (key) {
|
|
|
716
947
|
|
|
717
948
|
var _Article = _interopRequireWildcard(require("./Article"));
|
|
718
949
|
|
|
950
|
+
var _createUniversalPortal = require("./utils/createUniversalPortal");
|
|
951
|
+
|
|
952
|
+
var _NoContentBox = _interopRequireDefault(require("./NoContentBox"));
|
|
953
|
+
|
|
954
|
+
var _Masthead = _interopRequireWildcard(require("./Masthead"));
|
|
955
|
+
|
|
956
|
+
var _Portrait = _interopRequireDefault(require("./Portrait"));
|
|
957
|
+
|
|
958
|
+
var _ContentLoader = _interopRequireDefault(require("./ContentLoader"));
|
|
959
|
+
|
|
960
|
+
var _RelatedArticleList = _interopRequireWildcard(require("./RelatedArticleList"));
|
|
961
|
+
|
|
719
962
|
var _ErrorMessage = _interopRequireWildcard(require("./ErrorMessage"));
|
|
720
963
|
|
|
964
|
+
var _FileList = _interopRequireWildcard(require("./FileList"));
|
|
965
|
+
|
|
721
966
|
var _BlogPosts = require("./BlogPosts");
|
|
722
967
|
|
|
968
|
+
var _Logo = _interopRequireDefault(require("./Logo"));
|
|
969
|
+
|
|
970
|
+
var _InfoBox = require("./InfoBox");
|
|
971
|
+
|
|
972
|
+
var _InfoWidget = _interopRequireDefault(require("./InfoWidget"));
|
|
973
|
+
|
|
723
974
|
var _Frontpage = require("./Frontpage");
|
|
724
975
|
|
|
976
|
+
var _FactBox = _interopRequireDefault(require("./FactBox"));
|
|
977
|
+
|
|
978
|
+
var _Image = _interopRequireWildcard(require("./Image"));
|
|
979
|
+
|
|
980
|
+
var _Hero = require("./Hero");
|
|
981
|
+
|
|
725
982
|
var _Footer = require("./Footer");
|
|
726
983
|
|
|
984
|
+
var _Figure = require("./Figure");
|
|
985
|
+
|
|
727
986
|
var _LanguageSelector = require("./LanguageSelector");
|
|
728
987
|
|
|
729
988
|
var _LearningPaths = require("./LearningPaths");
|
|
730
989
|
|
|
990
|
+
var _Translation = require("./Translation");
|
|
991
|
+
|
|
992
|
+
var _Spinner = _interopRequireDefault(require("./Spinner"));
|
|
993
|
+
|
|
731
994
|
var _SearchResultSleeve = _interopRequireDefault(require("./Search/SearchResultSleeve"));
|
|
732
995
|
|
|
733
996
|
var _ContentTypeResult = _interopRequireDefault(require("./Search/ContentTypeResult"));
|
|
@@ -779,6 +779,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
779
779
|
reuse: 'Use video',
|
|
780
780
|
error: 'Sorry, an error occurred while loading the video or metadata about the video.'
|
|
781
781
|
},
|
|
782
|
+
other: {
|
|
783
|
+
download: 'Download content',
|
|
784
|
+
reuse: 'Use content'
|
|
785
|
+
},
|
|
782
786
|
concept: {
|
|
783
787
|
showDescription: 'Show concept description',
|
|
784
788
|
error: {
|
|
@@ -515,7 +515,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
515
515
|
es: 'Spansk',
|
|
516
516
|
zh: 'Kinesisk',
|
|
517
517
|
unknown: 'Ukjent',
|
|
518
|
-
prefixChangeLanguage: 'Velg
|
|
518
|
+
prefixChangeLanguage: 'Velg språk'
|
|
519
519
|
},
|
|
520
520
|
changeLanguage: {
|
|
521
521
|
nb: 'Endre språk til bokmål',
|
|
@@ -779,6 +779,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
779
779
|
reuse: 'Bruk video',
|
|
780
780
|
error: 'Beklager, en feil oppstod ved lasting av videoen eller metadata om videoen.'
|
|
781
781
|
},
|
|
782
|
+
other: {
|
|
783
|
+
download: 'Last ned innhold',
|
|
784
|
+
reuse: 'Bruk innhold'
|
|
785
|
+
},
|
|
782
786
|
concept: {
|
|
783
787
|
showDescription: 'Vis beskrivelsen av forklaringen.',
|
|
784
788
|
error: {
|
|
@@ -515,7 +515,7 @@ var messages = _objectSpread(_objectSpread({
|
|
|
515
515
|
es: 'Spansk',
|
|
516
516
|
zh: 'Kinesisk',
|
|
517
517
|
unknown: 'Ukjent',
|
|
518
|
-
prefixChangeLanguage: 'Vel
|
|
518
|
+
prefixChangeLanguage: 'Vel språk'
|
|
519
519
|
},
|
|
520
520
|
changeLanguage: {
|
|
521
521
|
nb: 'Endre språk til bokmål',
|
|
@@ -779,6 +779,10 @@ var messages = _objectSpread(_objectSpread({
|
|
|
779
779
|
reuse: 'Bruk video',
|
|
780
780
|
error: 'Orsak, ein feil oppstod ved lasting av videoen eller metadata om videoen.'
|
|
781
781
|
},
|
|
782
|
+
other: {
|
|
783
|
+
download: 'Last ned innhald',
|
|
784
|
+
reuse: 'Bruk innhald'
|
|
785
|
+
},
|
|
782
786
|
concept: {
|
|
783
787
|
showDescription: 'Vis skildring av forklaringa',
|
|
784
788
|
error: {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2016-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
|
+
import { ReactNode } from 'react';
|
|
9
|
+
export declare function createUniversalPortal(children: ReactNode, selector: string): JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.2",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,13 +31,13 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/button": "^1.1.
|
|
34
|
+
"@ndla/button": "^1.1.1",
|
|
35
35
|
"@ndla/carousel": "^1.0.6",
|
|
36
36
|
"@ndla/core": "^0.7.2",
|
|
37
37
|
"@ndla/hooks": "^1.0.6",
|
|
38
38
|
"@ndla/icons": "^1.3.1",
|
|
39
39
|
"@ndla/licenses": "^1.0.7",
|
|
40
|
-
"@ndla/modal": "^1.1.
|
|
40
|
+
"@ndla/modal": "^1.1.13",
|
|
41
41
|
"@ndla/safelink": "^1.0.5",
|
|
42
42
|
"@ndla/switch": "^0.0.32",
|
|
43
43
|
"@ndla/tabs": "^1.0.9",
|
|
@@ -92,5 +92,5 @@
|
|
|
92
92
|
"publishConfig": {
|
|
93
93
|
"access": "public"
|
|
94
94
|
},
|
|
95
|
-
"gitHead": "
|
|
95
|
+
"gitHead": "259407ea66af1f37f0942caf1b63a4ea14336e0a"
|
|
96
96
|
}
|
|
@@ -6,15 +6,15 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import React from 'react';
|
|
10
|
-
import PropTypes from 'prop-types';
|
|
9
|
+
import React, { ReactNode, MouseEvent } from 'react';
|
|
11
10
|
import BEMHelper from 'react-bem-helper';
|
|
11
|
+
//@ts-ignore
|
|
12
12
|
import Button from '@ndla/button';
|
|
13
13
|
|
|
14
|
-
const toggleFactBox = (event) => {
|
|
15
|
-
const button = event.
|
|
16
|
-
const aside = button
|
|
17
|
-
aside
|
|
14
|
+
const toggleFactBox = (event: MouseEvent<HTMLButtonElement>) => {
|
|
15
|
+
const button = event.currentTarget;
|
|
16
|
+
const aside = button?.previousSibling?.parentElement;
|
|
17
|
+
aside?.classList?.toggle('expanded');
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
const classes = new BEMHelper({
|
|
@@ -22,7 +22,12 @@ const classes = new BEMHelper({
|
|
|
22
22
|
prefix: 'c-',
|
|
23
23
|
});
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
interface Props {
|
|
26
|
+
dangerouslySetInnerHTML?: { __html: string };
|
|
27
|
+
children?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const FactBox = ({ children, dangerouslySetInnerHTML }: Props) => (
|
|
26
31
|
<aside {...classes()}>
|
|
27
32
|
<div {...classes('content')} dangerouslySetInnerHTML={dangerouslySetInnerHTML}>
|
|
28
33
|
{children}
|
|
@@ -31,11 +36,4 @@ const FactBox = ({ children, dangerouslySetInnerHTML }) => (
|
|
|
31
36
|
</aside>
|
|
32
37
|
);
|
|
33
38
|
|
|
34
|
-
FactBox.propTypes = {
|
|
35
|
-
dangerouslySetInnerHTML: PropTypes.shape({
|
|
36
|
-
__html: PropTypes.string.isRequired,
|
|
37
|
-
}),
|
|
38
|
-
children: PropTypes.node,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
39
|
export default FactBox;
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { cloneElement } from 'react';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
1
|
+
import React, { cloneElement, ReactElement } from 'react';
|
|
3
2
|
import BEMHelper from 'react-bem-helper';
|
|
3
|
+
//@ts-ignore
|
|
4
4
|
import Button from '@ndla/button';
|
|
5
5
|
import SafeLink from '@ndla/safelink';
|
|
6
6
|
import SectionHeading from '../SectionHeading';
|
|
@@ -10,14 +10,32 @@ const classes = new BEMHelper({
|
|
|
10
10
|
prefix: 'c-',
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
interface RelatedArticleProps {
|
|
14
|
+
icon: ReactElement;
|
|
15
|
+
title: string;
|
|
16
|
+
modifier?: string;
|
|
17
|
+
introduction: string;
|
|
18
|
+
to: string;
|
|
19
|
+
linkInfo?: string;
|
|
20
|
+
target?: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const RelatedArticle = ({
|
|
24
|
+
title,
|
|
25
|
+
introduction,
|
|
26
|
+
icon,
|
|
27
|
+
modifier,
|
|
28
|
+
to,
|
|
29
|
+
linkInfo = '',
|
|
30
|
+
target = '',
|
|
31
|
+
}: RelatedArticleProps) => {
|
|
14
32
|
const iconWithClass = cloneElement(icon, { className: 'c-icon--medium' });
|
|
15
33
|
return (
|
|
16
34
|
<article {...classes('item', modifier)}>
|
|
17
35
|
<h1 {...classes('title')}>
|
|
18
36
|
{iconWithClass}
|
|
19
37
|
<span {...classes('link-wrapper')}>
|
|
20
|
-
<SafeLink to={to} {...classes('link')} target={target} rel={linkInfo ? 'noopener noreferrer' :
|
|
38
|
+
<SafeLink to={to} {...classes('link')} target={target} rel={linkInfo ? 'noopener noreferrer' : undefined}>
|
|
21
39
|
{title}
|
|
22
40
|
</SafeLink>
|
|
23
41
|
</span>
|
|
@@ -28,24 +46,27 @@ export const RelatedArticle = ({ title, introduction, icon, modifier, to, linkIn
|
|
|
28
46
|
);
|
|
29
47
|
};
|
|
30
48
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
interface Props {
|
|
50
|
+
messages: {
|
|
51
|
+
title: string;
|
|
52
|
+
showMore: string;
|
|
53
|
+
showLess: string;
|
|
54
|
+
};
|
|
55
|
+
children?: ReactElement;
|
|
56
|
+
dangerouslySetInnerHTML?: {
|
|
57
|
+
__html: string;
|
|
58
|
+
};
|
|
59
|
+
articleCount?: number;
|
|
60
|
+
}
|
|
61
|
+
const RelatedArticleList = ({ messages, children, articleCount, dangerouslySetInnerHTML }: Props) => {
|
|
62
|
+
const clonedChildren =
|
|
63
|
+
!dangerouslySetInnerHTML && children
|
|
64
|
+
? React.Children.map(children, (article, i) =>
|
|
65
|
+
React.cloneElement(article, {
|
|
66
|
+
modifier: i >= 2 ? `${article.props.modifier} hidden` : article.props.modifier,
|
|
67
|
+
}),
|
|
68
|
+
)
|
|
69
|
+
: null;
|
|
49
70
|
const childrenCount = articleCount || React.Children.count(children);
|
|
50
71
|
|
|
51
72
|
return (
|
|
@@ -67,12 +88,4 @@ const RelatedArticleList = ({ messages, children, articleCount, dangerouslySetIn
|
|
|
67
88
|
);
|
|
68
89
|
};
|
|
69
90
|
|
|
70
|
-
RelatedArticleList.propTypes = {
|
|
71
|
-
children: PropTypes.node,
|
|
72
|
-
messages: PropTypes.shape({ title: PropTypes.string.isRequired }),
|
|
73
|
-
dangerouslySetInnerHTML: PropTypes.shape({
|
|
74
|
-
__html: PropTypes.string.isRequired,
|
|
75
|
-
}),
|
|
76
|
-
articleCount: PropTypes.number,
|
|
77
|
-
};
|
|
78
91
|
export default RelatedArticleList;
|
|
File without changes
|
package/src/index-javascript.js
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
|
|
9
9
|
export { default as Table } from './Table';
|
|
10
10
|
export { FilterList, FilterListPhone, FilterButtons } from './Filter';
|
|
11
|
-
export { default as FactBox } from './FactBox';
|
|
12
11
|
|
|
13
12
|
export {
|
|
14
13
|
SearchOverlay,
|
|
@@ -35,10 +34,8 @@ export {
|
|
|
35
34
|
ExternalLearningResourcesBadge,
|
|
36
35
|
SourceMaterialBadge,
|
|
37
36
|
} from './ContentTypeBadge';
|
|
38
|
-
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
39
37
|
export { default as TopicIntroductionList } from './TopicIntroductionList';
|
|
40
38
|
export { default as TopicMenu, TopicMenuButton } from './TopicMenu';
|
|
41
|
-
export { default as RelatedArticleList, RelatedArticle } from './RelatedArticleList';
|
|
42
39
|
export {
|
|
43
40
|
default as CompetenceGoals,
|
|
44
41
|
CompetenceGoalList,
|
package/src/index.ts
CHANGED
|
@@ -24,6 +24,8 @@ export {
|
|
|
24
24
|
default as Article,
|
|
25
25
|
} from './Article';
|
|
26
26
|
|
|
27
|
+
export { createUniversalPortal } from './utils/createUniversalPortal';
|
|
28
|
+
|
|
27
29
|
export { default as NoContentBox } from './NoContentBox';
|
|
28
30
|
|
|
29
31
|
export { default as Masthead, MastheadItem } from './Masthead';
|
|
@@ -32,6 +34,8 @@ export { default as Portrait } from './Portrait';
|
|
|
32
34
|
|
|
33
35
|
export { default as ContentLoader } from './ContentLoader';
|
|
34
36
|
|
|
37
|
+
export { default as RelatedArticleList, RelatedArticle } from './RelatedArticleList';
|
|
38
|
+
|
|
35
39
|
export { ErrorResourceAccessDenied, default as ErrorMessage } from './ErrorMessage';
|
|
36
40
|
|
|
37
41
|
export { default as FileList, File } from './FileList';
|
|
@@ -55,6 +59,8 @@ export {
|
|
|
55
59
|
FrontpageProgramMenu,
|
|
56
60
|
} from './Frontpage';
|
|
57
61
|
|
|
62
|
+
export { default as FactBox } from './FactBox';
|
|
63
|
+
|
|
58
64
|
export { default as Image, ImageLink } from './Image';
|
|
59
65
|
export { makeSrcQueryString } from './Image';
|
|
60
66
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
// N.B This helper is intended to be used in https://github.com/ndlano/article-converter. It is not a general soultion for using portals in SSR applications.
|
|
10
10
|
|
|
11
|
-
import React from 'react';
|
|
11
|
+
import React, { ReactNode } from 'react';
|
|
12
12
|
import ReactDOM from 'react-dom';
|
|
13
13
|
|
|
14
14
|
function canUseDOM() {
|
|
@@ -20,9 +20,9 @@ function canUseDOM() {
|
|
|
20
20
|
); // window.document.hidden === jsdom check
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
export function createUniversalPortal(children, selector) {
|
|
23
|
+
export function createUniversalPortal(children: ReactNode, selector: string) {
|
|
24
24
|
if (!canUseDOM()) {
|
|
25
25
|
return <div data-react-universal-portal>{children}</div>;
|
|
26
26
|
}
|
|
27
|
-
return ReactDOM.createPortal(children, document.querySelector(selector));
|
|
27
|
+
return ReactDOM.createPortal(children, document.querySelector(selector) as Element);
|
|
28
28
|
}
|