@ndla/ui 54.0.5 → 55.0.0-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/ContactBlock/ContactBlock.js +14 -15
- package/es/Embed/AudioEmbed.js +1 -32
- package/es/Embed/BrightcoveEmbed.js +6 -10
- package/es/Embed/ConceptEmbed.js +8 -33
- package/es/Embed/ImageEmbed.js +36 -79
- package/es/Embed/UuDisclaimerEmbed.js +4 -12
- package/es/Embed/conceptComponents.js +28 -29
- package/es/LicenseByline/EmbedByline.js +44 -61
- package/es/LicenseByline/LicenseDescription.js +44 -8
- package/es/LicenseByline/LicenseLink.js +7 -11
- package/es/Messages/MessageBox.js +6 -6
- package/es/index.js +1 -2
- package/es/locale/messages-en.js +35 -22
- package/es/locale/messages-nb.js +35 -22
- package/es/locale/messages-nn.js +34 -21
- package/es/locale/messages-se.js +36 -23
- package/es/locale/messages-sma.js +35 -22
- package/lib/ContactBlock/ContactBlock.js +14 -15
- package/lib/Embed/AudioEmbed.d.ts +1 -3
- package/lib/Embed/AudioEmbed.js +1 -32
- package/lib/Embed/BrightcoveEmbed.d.ts +2 -3
- package/lib/Embed/BrightcoveEmbed.js +6 -10
- package/lib/Embed/ConceptEmbed.d.ts +4 -9
- package/lib/Embed/ConceptEmbed.js +8 -33
- package/lib/Embed/ImageEmbed.d.ts +2 -5
- package/lib/Embed/ImageEmbed.js +34 -79
- package/lib/Embed/UuDisclaimerEmbed.js +3 -11
- package/lib/Embed/conceptComponents.d.ts +0 -3
- package/lib/Embed/conceptComponents.js +28 -29
- package/lib/LicenseByline/EmbedByline.d.ts +7 -6
- package/lib/LicenseByline/EmbedByline.js +46 -60
- package/lib/LicenseByline/LicenseDescription.d.ts +3 -2
- package/lib/LicenseByline/LicenseDescription.js +43 -7
- package/lib/LicenseByline/LicenseLink.d.ts +3 -4
- package/lib/LicenseByline/LicenseLink.js +6 -10
- package/lib/Messages/MessageBox.js +6 -6
- package/lib/index.d.ts +1 -3
- package/lib/index.js +6 -37
- package/lib/locale/messages-en.d.ts +18 -5
- package/lib/locale/messages-en.js +35 -22
- package/lib/locale/messages-nb.d.ts +18 -5
- package/lib/locale/messages-nb.js +35 -22
- package/lib/locale/messages-nn.d.ts +18 -5
- package/lib/locale/messages-nn.js +34 -21
- package/lib/locale/messages-se.d.ts +18 -5
- package/lib/locale/messages-se.js +36 -23
- package/lib/locale/messages-sma.d.ts +18 -5
- package/lib/locale/messages-sma.js +35 -22
- package/package.json +9 -10
- package/src/ContactBlock/ContactBlock.tsx +1 -1
- package/src/Embed/AudioEmbed.stories.tsx +0 -5
- package/src/Embed/AudioEmbed.tsx +3 -40
- package/src/Embed/BrightcoveEmbed.stories.tsx +0 -4
- package/src/Embed/BrightcoveEmbed.tsx +2 -5
- package/src/Embed/ConceptEmbed.stories.tsx +0 -5
- package/src/Embed/ConceptEmbed.tsx +4 -26
- package/src/Embed/ImageEmbed.stories.tsx +0 -12
- package/src/Embed/ImageEmbed.tsx +33 -89
- package/src/Embed/UuDisclaimerEmbed.tsx +2 -1
- package/src/Embed/conceptComponents.tsx +14 -12
- package/src/LicenseByline/EmbedByline.stories.tsx +1 -26
- package/src/LicenseByline/EmbedByline.tsx +50 -82
- package/src/LicenseByline/LicenseDescription.tsx +65 -8
- package/src/LicenseByline/LicenseLink.tsx +6 -12
- package/src/Messages/MessageBox.tsx +1 -0
- package/src/index.ts +1 -12
- package/src/locale/messages-en.ts +30 -17
- package/src/locale/messages-nb.ts +30 -17
- package/src/locale/messages-nn.ts +30 -17
- package/src/locale/messages-se.ts +31 -18
- package/src/locale/messages-sma.ts +30 -17
- package/es/MediaList/MediaList.js +0 -215
- package/es/MediaList/index.js +0 -8
- package/lib/MediaList/MediaList.d.ts +0 -49
- package/lib/MediaList/MediaList.js +0 -227
- package/lib/MediaList/index.d.ts +0 -9
- package/lib/MediaList/index.js +0 -42
- package/src/MediaList/MediaList.tsx +0 -285
- package/src/MediaList/index.ts +0 -17
|
@@ -363,6 +363,7 @@ declare const messages: {
|
|
|
363
363
|
readDate: string;
|
|
364
364
|
};
|
|
365
365
|
download: string;
|
|
366
|
+
openLink: string;
|
|
366
367
|
tabs: {
|
|
367
368
|
text: string;
|
|
368
369
|
images: string;
|
|
@@ -396,24 +397,30 @@ declare const messages: {
|
|
|
396
397
|
expandByline: string;
|
|
397
398
|
minimizeByline: string;
|
|
398
399
|
};
|
|
399
|
-
|
|
400
|
-
|
|
400
|
+
licenseText: string;
|
|
401
|
+
restrictedUseText: string;
|
|
401
402
|
};
|
|
402
403
|
text: {
|
|
403
404
|
heading: string;
|
|
404
405
|
description: string;
|
|
405
406
|
rules: string;
|
|
406
407
|
published: string;
|
|
408
|
+
licenseText: string;
|
|
409
|
+
restrictedUseText: string;
|
|
407
410
|
};
|
|
408
411
|
audio: {
|
|
409
412
|
heading: string;
|
|
410
413
|
description: string;
|
|
411
414
|
rules: string;
|
|
415
|
+
licenseText: string;
|
|
416
|
+
restrictedUseText: string;
|
|
412
417
|
};
|
|
413
418
|
podcast: {
|
|
414
419
|
heading: string;
|
|
415
420
|
description: string;
|
|
416
421
|
rules: string;
|
|
422
|
+
licenseText: string;
|
|
423
|
+
restrictedUseText: string;
|
|
417
424
|
};
|
|
418
425
|
video: {
|
|
419
426
|
heading: string;
|
|
@@ -422,6 +429,8 @@ declare const messages: {
|
|
|
422
429
|
itemImage: {
|
|
423
430
|
ariaLabel: string;
|
|
424
431
|
};
|
|
432
|
+
licenseText: string;
|
|
433
|
+
restrictedUseText: string;
|
|
425
434
|
};
|
|
426
435
|
other: {
|
|
427
436
|
heading: string;
|
|
@@ -434,24 +443,26 @@ declare const messages: {
|
|
|
434
443
|
heading: string;
|
|
435
444
|
description: string;
|
|
436
445
|
rules: string;
|
|
446
|
+
licenseText: string;
|
|
447
|
+
restrictedUseText: string;
|
|
437
448
|
};
|
|
438
449
|
concept: {
|
|
439
450
|
heading: string;
|
|
440
451
|
description: string;
|
|
441
452
|
rules: string;
|
|
442
|
-
title: string;
|
|
443
453
|
embedlink: {
|
|
444
454
|
heading: string;
|
|
445
455
|
description: string;
|
|
446
456
|
copyTitle: string;
|
|
447
457
|
hasCopiedTitle: string;
|
|
448
458
|
};
|
|
459
|
+
licenseText: string;
|
|
460
|
+
restrictedUseText: string;
|
|
449
461
|
};
|
|
450
462
|
gloss: {
|
|
451
463
|
heading: string;
|
|
452
464
|
description: string;
|
|
453
465
|
rules: string;
|
|
454
|
-
title: string;
|
|
455
466
|
showOrHideExamples: string;
|
|
456
467
|
embedlink: {
|
|
457
468
|
heading: string;
|
|
@@ -459,6 +470,8 @@ declare const messages: {
|
|
|
459
470
|
copyTitle: string;
|
|
460
471
|
hasCopiedTitle: string;
|
|
461
472
|
};
|
|
473
|
+
licenseText: string;
|
|
474
|
+
restrictedUseText: string;
|
|
462
475
|
};
|
|
463
476
|
files: {
|
|
464
477
|
heading: string;
|
|
@@ -473,7 +486,6 @@ declare const messages: {
|
|
|
473
486
|
published: string;
|
|
474
487
|
processed: string;
|
|
475
488
|
rightsholder: string;
|
|
476
|
-
source: string;
|
|
477
489
|
info: string;
|
|
478
490
|
};
|
|
479
491
|
errorMessage: {
|
|
@@ -1045,6 +1057,7 @@ declare const messages: {
|
|
|
1045
1057
|
deleted: string;
|
|
1046
1058
|
upvote: string;
|
|
1047
1059
|
removeUpvote: string;
|
|
1060
|
+
reply: string;
|
|
1048
1061
|
};
|
|
1049
1062
|
flag: {
|
|
1050
1063
|
title: string;
|
|
@@ -296,7 +296,7 @@ const messages = {
|
|
|
296
296
|
lastUpdated: "Minngemes orrestamme",
|
|
297
297
|
edition: "Låhkoe",
|
|
298
298
|
publisher: "Bæjhkoehtæjja",
|
|
299
|
-
useContent: "
|
|
299
|
+
useContent: "Sijhtidh jallh mubpesth nåhtadidh?",
|
|
300
300
|
closeLabel: "Dahph",
|
|
301
301
|
additionalLabel: "Lissie-aamhtesh",
|
|
302
302
|
urlContributionsLabel: "Vuartesjh maam {{name}} dorjeme",
|
|
@@ -314,7 +314,7 @@ const messages = {
|
|
|
314
314
|
cite: "Nuhtjh sisvegem",
|
|
315
315
|
notionsPrompt: "Datne baakoetjïertide maahtah?",
|
|
316
316
|
citeNotion: "Nuhtjh buerkiestimmiem",
|
|
317
|
-
printPage: "Tjaelieh",
|
|
317
|
+
printPage: "Tjaelieh teekstem",
|
|
318
318
|
access: {
|
|
319
319
|
onlyTeacher: "Daate vierhtie ajve dïllesisnie lohkehtæjjide mah tjaangeme Feidine."
|
|
320
320
|
},
|
|
@@ -367,7 +367,7 @@ const messages = {
|
|
|
367
367
|
learnMore: "Lïerh vielie ræhpas lisensi bïjre",
|
|
368
368
|
copyTitle: "Gaaltije",
|
|
369
369
|
copy: "Kopier",
|
|
370
|
-
hasCopiedTitle: "
|
|
370
|
+
hasCopiedTitle: "Maahta gaaltijevuesiehtimmiem",
|
|
371
371
|
embed: "Bïejh sïjse",
|
|
372
372
|
embedCopied: "Kopijem sïjsebïejemekodeste vaalteme!",
|
|
373
373
|
copyText: {
|
|
@@ -380,6 +380,7 @@ const messages = {
|
|
|
380
380
|
readDate: "Lohkeme: "
|
|
381
381
|
},
|
|
382
382
|
download: "Veedtjh",
|
|
383
|
+
openLink: "Rïhpesth aktene orre kaarhtesne",
|
|
383
384
|
tabs: {
|
|
384
385
|
text: "Teekste",
|
|
385
386
|
images: "Guvvieh",
|
|
@@ -405,7 +406,7 @@ const messages = {
|
|
|
405
406
|
images: {
|
|
406
407
|
heading: "Slik gjenbruker du bilder",
|
|
407
408
|
description: "Mujhtieh kopijem vaeltedh teeksteste maam edtjh guvvien baalte bïejedh desnie gusnie dam nuhtjh.",
|
|
408
|
-
rules: "Njoelkedassh guvvie-åtnoen bïjre
|
|
409
|
+
rules: "Njoelkedassh guvvie-åtnoen bïjre",
|
|
409
410
|
itemImage: {
|
|
410
411
|
ariaLabel: "Rïhpesth guvviem orre klaasesne",
|
|
411
412
|
zoomImageButtonLabel: "Stueredh guvviem",
|
|
@@ -413,32 +414,40 @@ const messages = {
|
|
|
413
414
|
expandByline: "Vuesehth bylinem",
|
|
414
415
|
minimizeByline: "Tjïekh bylinen"
|
|
415
416
|
},
|
|
416
|
-
|
|
417
|
-
|
|
417
|
+
licenseText: "Daate guvvie lisensem åtna",
|
|
418
|
+
restrictedUseText: "Daate guvvie"
|
|
418
419
|
},
|
|
419
420
|
text: {
|
|
420
421
|
heading: "Slik gjenbruker du teksten",
|
|
421
422
|
description: "Mujhtieh gaaltijasse vuesiehtidh gosse teekstem orresistie nuhtjh.",
|
|
422
|
-
rules: "Njoelkedassh teekste-åtnoen bïjre
|
|
423
|
-
published: "Bæjkoehtimmiedaatoe"
|
|
423
|
+
rules: "Njoelkedassh teekste-åtnoen bïjre",
|
|
424
|
+
published: "Bæjkoehtimmiedaatoe",
|
|
425
|
+
licenseText: "Daate teekste lisensem åtna",
|
|
426
|
+
restrictedUseText: "Daate teekste"
|
|
424
427
|
},
|
|
425
428
|
audio: {
|
|
426
429
|
heading: "Slik gjenbruker du lydfiler",
|
|
427
430
|
description: "Mujhtieh kopijem vaeltedh teeksteste mij edtja tjoejen baalte bïejesovvedh desnie gusnie tjoejem nuhtjh.",
|
|
428
|
-
rules: "Njoelkedassh tjoejefijlen åtnoen bïjre
|
|
431
|
+
rules: "Njoelkedassh tjoejefijlen åtnoen bïjre",
|
|
432
|
+
licenseText: "Daate tjoejefijle lisensem åtna",
|
|
433
|
+
restrictedUseText: "Daate tjoejefijle"
|
|
429
434
|
},
|
|
430
435
|
podcast: {
|
|
431
436
|
heading: "Slik gjenbruker du podkaster",
|
|
432
437
|
description: "Husk å kopiere teksten som skal legges ved podkasten der du bruker den.",
|
|
433
|
-
rules: "Regler for bruk av podkasten
|
|
438
|
+
rules: "Regler for bruk av podkasten",
|
|
439
|
+
licenseText: "Daate podkastem lisensine åtna",
|
|
440
|
+
restrictedUseText: "Daate podkastem"
|
|
434
441
|
},
|
|
435
442
|
video: {
|
|
436
443
|
heading: "Slik gjenbruker du videoer",
|
|
437
444
|
description: "Mujhtieh kopijem vaeltedh teeksteste mij edtja videjoven baalte bïejesovvedh desnie gusnie videjovem nuhtjh.",
|
|
438
|
-
rules: "Njoelkedassh videjove-åtnoen bïjre
|
|
445
|
+
rules: "Njoelkedassh videjove-åtnoen bïjre",
|
|
439
446
|
itemImage: {
|
|
440
447
|
ariaLabel: "Rïhpesth videjovem orre klaassese"
|
|
441
|
-
}
|
|
448
|
+
},
|
|
449
|
+
licenseText: "Daate videoe lisensem åtna",
|
|
450
|
+
restrictedUseText: "Daate videoe"
|
|
442
451
|
},
|
|
443
452
|
other: {
|
|
444
453
|
heading: "Slik gjenbruker du annet innhold",
|
|
@@ -450,37 +459,41 @@ const messages = {
|
|
|
450
459
|
h5p: {
|
|
451
460
|
heading: "Slik gjenbruker du H5P-innhold",
|
|
452
461
|
description: "Datne njoelkedasside sisvegeåtnoen bïjre gaavnh H5P-biehkesne",
|
|
453
|
-
rules: "Njoelkedassh H5P-åtnoen bïjre
|
|
462
|
+
rules: "Njoelkedassh H5P-åtnoen bïjre",
|
|
463
|
+
licenseText: "Daate interaktijve laavenjasse (H5P) lisensem åtna",
|
|
464
|
+
restrictedUseText: "Daate interaktijve laavenjasse (H5P)"
|
|
454
465
|
},
|
|
455
466
|
concept: {
|
|
456
467
|
heading: "Slik gjenbruker du forklaringer",
|
|
457
468
|
description: "Husk at innebygd innhald i ei forklaring kan ha ein anna lisens enn sjølve forklaringsteksten",
|
|
458
|
-
rules: "Njoelkedassh guktie buerkiestimmiem nuhtjh
|
|
459
|
-
title: "Tihtele",
|
|
469
|
+
rules: "Njoelkedassh guktie buerkiestimmiem nuhtjh",
|
|
460
470
|
embedlink: {
|
|
461
471
|
heading: "Slik viser du forklaringen i annet innhold",
|
|
462
472
|
description: "Denne lenken viser forklaringen uten kontekst (meny og bunntekst)",
|
|
463
473
|
copyTitle: "Kopier innbyggingslenke",
|
|
464
474
|
hasCopiedTitle: "Innbyggingslenke kopiert"
|
|
465
|
-
}
|
|
475
|
+
},
|
|
476
|
+
licenseText: "Daate buerkiestimmie lissietjaalegem",
|
|
477
|
+
restrictedUseText: "Daate buerkiestimmie"
|
|
466
478
|
},
|
|
467
479
|
gloss: {
|
|
468
480
|
heading: "Naemhtie gïelem ikth vielie nåhtadidh",
|
|
469
481
|
description: "Mujhtieh sisvege aktene raajesisnie maahta jeatjah lisensem utnedh enn jïjtjehke raajesisnie",
|
|
470
|
-
rules: "Njoelkedassh guktie diejvesem nåhtadidh
|
|
471
|
-
title: "Tihtele",
|
|
482
|
+
rules: "Njoelkedassh guktie diejvesem nåhtadidh",
|
|
472
483
|
showOrHideExamples: "Vuesiehtimmieh vuesiehtidh jallh vöörhkedh",
|
|
473
484
|
embedlink: {
|
|
474
485
|
heading: "Naemhtie gïelem jeatjah sisvegisnie vuesehte",
|
|
475
486
|
description: "Daate lïenghke vuesehte tjoejh konteksten namhtah (meny jïh nueliekapihtele)",
|
|
476
487
|
copyTitle: "Kopijerh svaalhtesem sïjse loggedh",
|
|
477
488
|
hasCopiedTitle: "Bigkeme svaalhtese kopijeradamme"
|
|
478
|
-
}
|
|
489
|
+
},
|
|
490
|
+
licenseText: "Daate gïele lisensem åtna",
|
|
491
|
+
restrictedUseText: "Daate gïele nænnoes"
|
|
479
492
|
},
|
|
480
493
|
files: {
|
|
481
494
|
heading: "Slik gjenbruker du filer",
|
|
482
495
|
description: "Mujhtieh kopijem vaeltedh teeksteste mij edtja fijlen baalte bïejesovvedh desnie gusnie dam nuhtjh.",
|
|
483
|
-
rules: "Njoelkedassh fijle-åtnoen bïjre
|
|
496
|
+
rules: "Njoelkedassh fijle-åtnoen bïjre",
|
|
484
497
|
itemImage: {
|
|
485
498
|
ariaLabel: "Åpne i nytt vindu"
|
|
486
499
|
}
|
|
@@ -490,7 +503,6 @@ const messages = {
|
|
|
490
503
|
published: "Publiseringsdato",
|
|
491
504
|
processed: "Innhaldet har vorte omarbeidd",
|
|
492
505
|
rightsholder: "Rettighetshaver",
|
|
493
|
-
source: "Gaaltije",
|
|
494
506
|
info: "Lisensinformasjon"
|
|
495
507
|
},
|
|
496
508
|
errorMessage: {
|
|
@@ -1061,7 +1073,8 @@ const messages = {
|
|
|
1061
1073
|
fetchMore: "Hent flere svar",
|
|
1062
1074
|
deleted: "Dette innlegget er slettet av forfatteren.",
|
|
1063
1075
|
upvote: "Stem opp",
|
|
1064
|
-
removeUpvote: "Fjern stemme"
|
|
1076
|
+
removeUpvote: "Fjern stemme",
|
|
1077
|
+
reply: "Skriv et svar til {{ name }}"
|
|
1065
1078
|
},
|
|
1066
1079
|
flag: {
|
|
1067
1080
|
title: "Rapporter innlegg / kommentar",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ndla/ui",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "55.0.0-alpha.0",
|
|
4
4
|
"description": "UI component library for NDLA.",
|
|
5
5
|
"license": "GPL-3.0",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -31,17 +31,16 @@
|
|
|
31
31
|
"types"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@ndla/accordion": "^4.0.
|
|
35
|
-
"@ndla/button": "^13.0.
|
|
34
|
+
"@ndla/accordion": "^4.0.6",
|
|
35
|
+
"@ndla/button": "^13.0.6",
|
|
36
36
|
"@ndla/core": "^5.0.1",
|
|
37
37
|
"@ndla/dropdown-menu": "^1.0.38",
|
|
38
|
-
"@ndla/forms": "^8.0.
|
|
38
|
+
"@ndla/forms": "^8.0.6",
|
|
39
39
|
"@ndla/hooks": "^2.1.7",
|
|
40
|
-
"@ndla/icons": "^
|
|
41
|
-
"@ndla/licenses": "^
|
|
42
|
-
"@ndla/modal": "^6.0.
|
|
43
|
-
"@ndla/
|
|
44
|
-
"@ndla/safelink": "^5.1.8",
|
|
40
|
+
"@ndla/icons": "^7.0.0-alpha.0",
|
|
41
|
+
"@ndla/licenses": "^8.0.0-alpha.0",
|
|
42
|
+
"@ndla/modal": "^6.0.5",
|
|
43
|
+
"@ndla/safelink": "^5.1.9",
|
|
45
44
|
"@ndla/tooltip": "^8.0.1",
|
|
46
45
|
"@ndla/typography": "^0.4.22",
|
|
47
46
|
"@ndla/util": "^4.0.4",
|
|
@@ -77,5 +76,5 @@
|
|
|
77
76
|
"publishConfig": {
|
|
78
77
|
"access": "public"
|
|
79
78
|
},
|
|
80
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "4110ea1c6d36be95a99f4c1b47f8cf3b5c4ccb8b"
|
|
81
80
|
}
|
|
@@ -187,7 +187,7 @@ const ContactBlock = ({
|
|
|
187
187
|
</LinkWrapper>
|
|
188
188
|
<span>
|
|
189
189
|
{`${t("embed.type.image")}: ${authors.map((author) => `${author?.name}`).join(", ")} `}
|
|
190
|
-
{!!license && <LicenseLink license={license}
|
|
190
|
+
{!!license && <LicenseLink license={license} />}
|
|
191
191
|
</span>
|
|
192
192
|
</>
|
|
193
193
|
) : (
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
10
|
import { AudioEmbedData, AudioMeta } from "@ndla/types-embed";
|
|
11
11
|
import AudioEmbed from "./AudioEmbed";
|
|
12
|
-
import StoryFavoriteButton from "../../../../stories/StoryFavoriteButton";
|
|
13
12
|
import { ArticleWrapper } from "../Article";
|
|
14
13
|
import LayoutItem, { OneColumn } from "../Layout";
|
|
15
14
|
|
|
@@ -205,7 +204,6 @@ export default meta;
|
|
|
205
204
|
|
|
206
205
|
export const AudioEmbedStory: StoryObj<typeof AudioEmbed> = {
|
|
207
206
|
args: {
|
|
208
|
-
heartButton: StoryFavoriteButton,
|
|
209
207
|
embed: {
|
|
210
208
|
resource: "audio",
|
|
211
209
|
status: "success",
|
|
@@ -217,7 +215,6 @@ export const AudioEmbedStory: StoryObj<typeof AudioEmbed> = {
|
|
|
217
215
|
|
|
218
216
|
export const AudioEmbedFailed: StoryObj<typeof AudioEmbed> = {
|
|
219
217
|
args: {
|
|
220
|
-
heartButton: StoryFavoriteButton,
|
|
221
218
|
embed: {
|
|
222
219
|
resource: "audio",
|
|
223
220
|
status: "error",
|
|
@@ -228,7 +225,6 @@ export const AudioEmbedFailed: StoryObj<typeof AudioEmbed> = {
|
|
|
228
225
|
|
|
229
226
|
export const Podcast: StoryObj<typeof AudioEmbed> = {
|
|
230
227
|
args: {
|
|
231
|
-
heartButton: StoryFavoriteButton,
|
|
232
228
|
embed: {
|
|
233
229
|
resource: "audio",
|
|
234
230
|
status: "success",
|
|
@@ -240,7 +236,6 @@ export const Podcast: StoryObj<typeof AudioEmbed> = {
|
|
|
240
236
|
|
|
241
237
|
export const PodcastFailed: StoryObj<typeof AudioEmbed> = {
|
|
242
238
|
args: {
|
|
243
|
-
heartButton: StoryFavoriteButton,
|
|
244
239
|
embed: {
|
|
245
240
|
resource: "audio",
|
|
246
241
|
status: "error",
|
package/src/Embed/AudioEmbed.tsx
CHANGED
|
@@ -6,18 +6,15 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import { AudioMetaData, ImageMetaData } from "@ndla/types-embed";
|
|
9
|
+
import { AudioMetaData } from "@ndla/types-embed";
|
|
11
10
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
12
11
|
import { Author } from "./ImageEmbed";
|
|
13
|
-
import { HeartButtonType } from "./types";
|
|
14
12
|
import AudioPlayer from "../AudioPlayer";
|
|
15
13
|
import { Figure } from "../Figure";
|
|
16
14
|
import { EmbedByline } from "../LicenseByline";
|
|
17
15
|
|
|
18
16
|
interface Props {
|
|
19
17
|
embed: AudioMetaData;
|
|
20
|
-
heartButton?: HeartButtonType;
|
|
21
18
|
lang?: string;
|
|
22
19
|
}
|
|
23
20
|
|
|
@@ -27,21 +24,7 @@ export const getFirstNonEmptyLicenseCredits = (authors: {
|
|
|
27
24
|
processors: Author[];
|
|
28
25
|
}) => Object.values(authors).find((i) => i.length > 0) ?? [];
|
|
29
26
|
|
|
30
|
-
const
|
|
31
|
-
imageMeta: Extract<AudioMetaData, { status: "success" }>,
|
|
32
|
-
): Extract<ImageMetaData, { status: "success" }> => ({
|
|
33
|
-
resource: "image",
|
|
34
|
-
status: "success",
|
|
35
|
-
// We check that this exists where the function is used.
|
|
36
|
-
data: imageMeta.data.imageMeta!,
|
|
37
|
-
embedData: {
|
|
38
|
-
resource: "image",
|
|
39
|
-
resourceId: imageMeta.data.imageMeta?.id?.toString() || "",
|
|
40
|
-
alt: imageMeta.data.imageMeta?.alttext.alttext ?? "",
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
const AudioEmbed = ({ embed, heartButton: HeartButton, lang }: Props) => {
|
|
27
|
+
const AudioEmbed = ({ embed, lang }: Props) => {
|
|
45
28
|
if (embed.status === "error") {
|
|
46
29
|
return <EmbedErrorPlaceholder type={embed.embedData.type === "standard" ? "audio" : "podcast"} />;
|
|
47
30
|
}
|
|
@@ -75,28 +58,8 @@ const AudioEmbed = ({ embed, heartButton: HeartButton, lang }: Props) => {
|
|
|
75
58
|
<EmbedByline
|
|
76
59
|
error={false}
|
|
77
60
|
type={data.audioType === "standard" ? "audio" : "podcast"}
|
|
78
|
-
topRounded={false}
|
|
79
|
-
bottomRounded={!data.imageMeta}
|
|
80
61
|
copyright={embed.data.copyright}
|
|
81
|
-
|
|
82
|
-
{HeartButton && embed.data.copyright.license.license.toLowerCase() !== COPYRIGHTED && (
|
|
83
|
-
<HeartButton embed={embed} />
|
|
84
|
-
)}
|
|
85
|
-
</EmbedByline>
|
|
86
|
-
{data.imageMeta && (
|
|
87
|
-
<EmbedByline
|
|
88
|
-
error={false}
|
|
89
|
-
first={false}
|
|
90
|
-
type="image"
|
|
91
|
-
topRounded={false}
|
|
92
|
-
bottomRounded
|
|
93
|
-
copyright={data.imageMeta.copyright}
|
|
94
|
-
>
|
|
95
|
-
{HeartButton && data.imageMeta.copyright.license.license.toLowerCase() !== COPYRIGHTED && (
|
|
96
|
-
<HeartButton embed={imageMetaToMockEmbed(embed)} />
|
|
97
|
-
)}
|
|
98
|
-
</EmbedByline>
|
|
99
|
-
)}
|
|
62
|
+
/>
|
|
100
63
|
</Figure>
|
|
101
64
|
);
|
|
102
65
|
};
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
10
|
import { BrightcoveData, BrightcoveEmbedData, BrightcoveMetaData } from "@ndla/types-embed";
|
|
11
11
|
import BrightcoveEmbed from "./BrightcoveEmbed";
|
|
12
|
-
import StoryFavoriteButton from "../../../../stories/StoryFavoriteButton";
|
|
13
12
|
import { ArticleWrapper } from "../Article";
|
|
14
13
|
import LayoutItem, { OneColumn } from "../Layout";
|
|
15
14
|
|
|
@@ -178,7 +177,6 @@ export default meta;
|
|
|
178
177
|
|
|
179
178
|
export const BrightcoveEmbedStory: StoryObj<typeof BrightcoveEmbed> = {
|
|
180
179
|
args: {
|
|
181
|
-
heartButton: StoryFavoriteButton,
|
|
182
180
|
embed: {
|
|
183
181
|
resource: "brightcove",
|
|
184
182
|
status: "success",
|
|
@@ -190,14 +188,12 @@ export const BrightcoveEmbedStory: StoryObj<typeof BrightcoveEmbed> = {
|
|
|
190
188
|
|
|
191
189
|
export const VisuallyInterpreted: StoryObj<typeof BrightcoveEmbed> = {
|
|
192
190
|
args: {
|
|
193
|
-
heartButton: StoryFavoriteButton,
|
|
194
191
|
embed: visuallyInterpretedEmbedMetaData,
|
|
195
192
|
},
|
|
196
193
|
};
|
|
197
194
|
|
|
198
195
|
export const BrightcoveFailed: StoryObj<typeof BrightcoveEmbed> = {
|
|
199
196
|
args: {
|
|
200
|
-
heartButton: StoryFavoriteButton,
|
|
201
197
|
embed: {
|
|
202
198
|
resource: "brightcove",
|
|
203
199
|
status: "error",
|
|
@@ -12,17 +12,15 @@ import { useTranslation } from "react-i18next";
|
|
|
12
12
|
import styled from "@emotion/styled";
|
|
13
13
|
import { ButtonV2 } from "@ndla/button";
|
|
14
14
|
import { spacing } from "@ndla/core";
|
|
15
|
-
import { COPYRIGHTED } from "@ndla/licenses";
|
|
16
15
|
import { BrightcoveEmbedData, BrightcoveMetaData, BrightcoveVideoSource } from "@ndla/types-embed";
|
|
17
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
18
|
-
import {
|
|
17
|
+
import { RenderContext } from "./types";
|
|
19
18
|
import { Figure } from "../Figure";
|
|
20
19
|
import { EmbedByline } from "../LicenseByline";
|
|
21
20
|
|
|
22
21
|
interface Props {
|
|
23
22
|
embed: BrightcoveMetaData;
|
|
24
23
|
isConcept?: boolean;
|
|
25
|
-
heartButton?: HeartButtonType;
|
|
26
24
|
renderContext?: RenderContext;
|
|
27
25
|
}
|
|
28
26
|
|
|
@@ -54,7 +52,7 @@ const getIframeProps = (data: BrightcoveEmbedData, sources: BrightcoveVideoSourc
|
|
|
54
52
|
width: source?.width ?? "640",
|
|
55
53
|
};
|
|
56
54
|
};
|
|
57
|
-
const BrightcoveEmbed = ({ embed, isConcept,
|
|
55
|
+
const BrightcoveEmbed = ({ embed, isConcept, renderContext = "article" }: Props) => {
|
|
58
56
|
const [showOriginalVideo, setShowOriginalVideo] = useState(true);
|
|
59
57
|
const { t } = useTranslation();
|
|
60
58
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
@@ -124,7 +122,6 @@ const BrightcoveEmbed = ({ embed, isConcept, heartButton: HeartButton, renderCon
|
|
|
124
122
|
{t(`figure.button.${!showOriginalVideo ? "original" : "alternative"}`)}
|
|
125
123
|
</LinkedVideoButton>
|
|
126
124
|
)}
|
|
127
|
-
{HeartButton && data.copyright?.license.license.toLowerCase() !== COPYRIGHTED && <HeartButton embed={embed} />}
|
|
128
125
|
</EmbedByline>
|
|
129
126
|
</Figure>
|
|
130
127
|
);
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
import { Meta, StoryObj } from "@storybook/react";
|
|
10
10
|
import { ConceptData, ConceptEmbedData } from "@ndla/types-embed";
|
|
11
11
|
import ConceptEmbed from "./ConceptEmbed";
|
|
12
|
-
import StoryFavoriteButton from "../../../../stories/StoryFavoriteButton";
|
|
13
12
|
import { ArticleWrapper } from "../Article";
|
|
14
13
|
import LayoutItem, { OneColumn } from "../Layout";
|
|
15
14
|
|
|
@@ -250,7 +249,6 @@ export default meta;
|
|
|
250
249
|
|
|
251
250
|
export const Block: StoryObj<typeof ConceptEmbed> = {
|
|
252
251
|
args: {
|
|
253
|
-
heartButton: StoryFavoriteButton,
|
|
254
252
|
embed: {
|
|
255
253
|
resource: "concept",
|
|
256
254
|
status: "success",
|
|
@@ -272,7 +270,6 @@ export const GlossBlock: StoryObj<typeof ConceptEmbed> = {
|
|
|
272
270
|
|
|
273
271
|
export const BlockFailed: StoryObj<typeof ConceptEmbed> = {
|
|
274
272
|
args: {
|
|
275
|
-
heartButton: StoryFavoriteButton,
|
|
276
273
|
embed: {
|
|
277
274
|
resource: "concept",
|
|
278
275
|
status: "error",
|
|
@@ -283,7 +280,6 @@ export const BlockFailed: StoryObj<typeof ConceptEmbed> = {
|
|
|
283
280
|
|
|
284
281
|
export const Inline: StoryObj<typeof ConceptEmbed> = {
|
|
285
282
|
args: {
|
|
286
|
-
heartButton: StoryFavoriteButton,
|
|
287
283
|
embed: {
|
|
288
284
|
resource: "concept",
|
|
289
285
|
status: "success",
|
|
@@ -306,7 +302,6 @@ export const GlossInline: StoryObj<typeof ConceptEmbed> = {
|
|
|
306
302
|
|
|
307
303
|
export const InlineFailed: StoryObj<typeof ConceptEmbed> = {
|
|
308
304
|
args: {
|
|
309
|
-
heartButton: StoryFavoriteButton,
|
|
310
305
|
embed: {
|
|
311
306
|
resource: "concept",
|
|
312
307
|
status: "error",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import parse from "html-react-parser";
|
|
10
|
-
import {
|
|
10
|
+
import { ReactNode, forwardRef, useCallback, useMemo, useRef, useState } from "react";
|
|
11
11
|
import { isMobile } from "react-device-detect";
|
|
12
12
|
import { useTranslation } from "react-i18next";
|
|
13
13
|
import styled from "@emotion/styled";
|
|
@@ -15,12 +15,11 @@ import { Root, Trigger, Content, Anchor, Close, Portal } from "@radix-ui/react-p
|
|
|
15
15
|
import { IconButtonV2 } from "@ndla/button";
|
|
16
16
|
import { breakpoints, colors, mq, spacing, stackOrder } from "@ndla/core";
|
|
17
17
|
import { Cross } from "@ndla/icons/action";
|
|
18
|
-
import { COPYRIGHTED } from "@ndla/licenses";
|
|
19
18
|
import { Tooltip } from "@ndla/tooltip";
|
|
20
19
|
import { ConceptMetaData } from "@ndla/types-embed";
|
|
21
20
|
import { ConceptNotionV2, ConceptNotionData, ConceptType } from "./conceptComponents";
|
|
22
21
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
23
|
-
import {
|
|
22
|
+
import { RenderContext } from "./types";
|
|
24
23
|
import { Figure } from "../Figure";
|
|
25
24
|
import { Gloss } from "../Gloss";
|
|
26
25
|
import { EmbedByline } from "../LicenseByline";
|
|
@@ -71,7 +70,6 @@ const ImageWrapper = styled.div`
|
|
|
71
70
|
interface Props {
|
|
72
71
|
embed: ConceptMetaData;
|
|
73
72
|
fullWidth?: boolean;
|
|
74
|
-
heartButton?: HeartButtonType;
|
|
75
73
|
lang?: string;
|
|
76
74
|
renderContext?: RenderContext;
|
|
77
75
|
}
|
|
@@ -95,7 +93,7 @@ const StyledButton = styled.button`
|
|
|
95
93
|
}
|
|
96
94
|
`;
|
|
97
95
|
|
|
98
|
-
export const ConceptEmbed = ({ embed, fullWidth,
|
|
96
|
+
export const ConceptEmbed = ({ embed, fullWidth, lang, renderContext }: Props) => {
|
|
99
97
|
const parsedContent = useMemo(() => {
|
|
100
98
|
if (embed.status === "error" || !embed.data.concept.content) return undefined;
|
|
101
99
|
return parse(embed.data.concept.content.htmlContent);
|
|
@@ -121,8 +119,6 @@ export const ConceptEmbed = ({ embed, fullWidth, heartButton: HeartButton, lang,
|
|
|
121
119
|
copyright={concept.copyright}
|
|
122
120
|
source={concept.source}
|
|
123
121
|
visualElement={visualElement}
|
|
124
|
-
heartButton={HeartButton}
|
|
125
|
-
conceptHeartButton={HeartButton && <HeartButton embed={embed} />}
|
|
126
122
|
conceptType={concept.conceptType}
|
|
127
123
|
glossData={concept.glossData}
|
|
128
124
|
lang={lang}
|
|
@@ -141,8 +137,6 @@ export const ConceptEmbed = ({ embed, fullWidth, heartButton: HeartButton, lang,
|
|
|
141
137
|
source={concept.source}
|
|
142
138
|
visualElement={visualElement}
|
|
143
139
|
linkText={embed.embedData.linkText}
|
|
144
|
-
heartButton={HeartButton}
|
|
145
|
-
conceptHeartButton={HeartButton && <HeartButton embed={embed} />}
|
|
146
140
|
conceptType={concept.conceptType}
|
|
147
141
|
glossData={concept.glossData}
|
|
148
142
|
lang={lang}
|
|
@@ -158,8 +152,6 @@ export const ConceptEmbed = ({ embed, fullWidth, heartButton: HeartButton, lang,
|
|
|
158
152
|
copyright={concept.copyright}
|
|
159
153
|
source={concept.source}
|
|
160
154
|
visualElement={visualElement}
|
|
161
|
-
heartButton={HeartButton}
|
|
162
|
-
conceptHeartButton={HeartButton && <HeartButton embed={embed} />}
|
|
163
155
|
conceptType={concept.conceptType}
|
|
164
156
|
glossData={concept.glossData}
|
|
165
157
|
lang={lang}
|
|
@@ -172,9 +164,7 @@ export const ConceptEmbed = ({ embed, fullWidth, heartButton: HeartButton, lang,
|
|
|
172
164
|
|
|
173
165
|
interface InlineConceptProps extends ConceptNotionData {
|
|
174
166
|
linkText: ReactNode;
|
|
175
|
-
heartButton?: HeartButtonType;
|
|
176
167
|
headerButtons?: ReactNode;
|
|
177
|
-
conceptHeartButton?: ReactNode;
|
|
178
168
|
exampleIds?: string;
|
|
179
169
|
exampleLangs?: string;
|
|
180
170
|
setSelection?: (e: MouseEvent) => void;
|
|
@@ -231,8 +221,6 @@ export const InlineConcept = forwardRef<HTMLSpanElement, InlineConceptProps>(
|
|
|
231
221
|
source,
|
|
232
222
|
visualElement,
|
|
233
223
|
linkText,
|
|
234
|
-
heartButton,
|
|
235
|
-
conceptHeartButton,
|
|
236
224
|
glossData,
|
|
237
225
|
conceptType,
|
|
238
226
|
headerButtons,
|
|
@@ -296,9 +284,7 @@ export const InlineConcept = forwardRef<HTMLSpanElement, InlineConceptProps>(
|
|
|
296
284
|
source={source}
|
|
297
285
|
visualElement={visualElement}
|
|
298
286
|
inPopover
|
|
299
|
-
heartButton={heartButton}
|
|
300
287
|
headerButtons={headerButtons}
|
|
301
|
-
conceptHeartButton={conceptHeartButton}
|
|
302
288
|
lang={lang}
|
|
303
289
|
closeButton={
|
|
304
290
|
<Close asChild>
|
|
@@ -322,8 +308,6 @@ export const InlineConcept = forwardRef<HTMLSpanElement, InlineConceptProps>(
|
|
|
322
308
|
|
|
323
309
|
interface ConceptProps extends ConceptNotionData {
|
|
324
310
|
fullWidth?: boolean;
|
|
325
|
-
heartButton?: HeartButtonType;
|
|
326
|
-
conceptHeartButton?: ReactElement;
|
|
327
311
|
exampleIds?: string;
|
|
328
312
|
exampleLangs?: string;
|
|
329
313
|
}
|
|
@@ -336,8 +320,6 @@ export const BlockConcept = ({
|
|
|
336
320
|
source,
|
|
337
321
|
visualElement,
|
|
338
322
|
fullWidth,
|
|
339
|
-
heartButton,
|
|
340
|
-
conceptHeartButton,
|
|
341
323
|
glossData,
|
|
342
324
|
conceptType,
|
|
343
325
|
lang,
|
|
@@ -417,8 +399,6 @@ export const BlockConcept = ({
|
|
|
417
399
|
copyright={copyright}
|
|
418
400
|
source={source}
|
|
419
401
|
visualElement={visualElement}
|
|
420
|
-
heartButton={heartButton}
|
|
421
|
-
conceptHeartButton={conceptHeartButton}
|
|
422
402
|
inPopover
|
|
423
403
|
lang={lang}
|
|
424
404
|
closeButton={
|
|
@@ -455,9 +435,7 @@ export const BlockConcept = ({
|
|
|
455
435
|
/>
|
|
456
436
|
)}
|
|
457
437
|
{copyright && conceptType === "concept" && (
|
|
458
|
-
<EmbedByline copyright={copyright}
|
|
459
|
-
{copyright.license?.license.toLowerCase() !== COPYRIGHTED && conceptHeartButton}
|
|
460
|
-
</EmbedByline>
|
|
438
|
+
<EmbedByline copyright={copyright} type={conceptType as ConceptType} />
|
|
461
439
|
)}
|
|
462
440
|
</Figure>
|
|
463
441
|
</Root>
|