@ndla/ui 55.0.15-alpha.0 → 55.0.17-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 +125 -29
- package/dist/styles.css +453 -103
- package/es/Article/Article.js +101 -162
- package/es/Article/ArticleByline.js +89 -56
- package/es/Article/ArticleFootNotes.js +35 -23
- package/es/Article/ArticleParagraph.js +2 -2
- package/es/Article/index.js +3 -5
- package/es/AudioPlayer/AudioPlayer.js +20 -20
- package/es/AudioPlayer/Controls.js +45 -45
- package/es/AudioPlayer/SpeechControl.js +8 -8
- package/es/BlogPost/BlogPost.js +6 -6
- package/es/Breadcrumb/Breadcrumb.js +19 -29
- package/es/Breadcrumb/BreadcrumbItem.js +20 -49
- package/es/Breadcrumb/HomeBreadcrumb.js +36 -82
- package/es/CampaignBlock/CampaignBlock.js +12 -12
- package/es/CodeBlock/CodeBlock.js +2 -2
- package/es/Concept/Concept.js +11 -11
- package/es/ContactBlock/ContactBlock.js +170 -185
- package/es/ContactBlock/index.js +3 -3
- package/es/ContentLoader/index.js +12 -12
- package/es/ContentPlaceholder/ContentPlaceholder.js +3 -3
- package/es/ContentTypeBadge/ContentTypeBadge.js +81 -80
- package/es/ContentTypeBadge/ContentTypeBadgeNew.js +3 -2
- package/es/ContentTypeHero/ContentTypeHero.js +50 -0
- package/es/{Logo → ContentTypeHero}/index.js +2 -3
- package/es/CopyParagraphButton/CopyParagraphButton.js +13 -12
- package/es/Embed/AudioEmbed.js +7 -7
- package/es/Embed/BrightcoveEmbed.js +8 -8
- package/es/Embed/CodeEmbed.js +6 -6
- package/es/Embed/ConceptEmbed.js +13 -13
- package/es/Embed/ConceptListEmbed.js +9 -9
- package/es/Embed/ContentLinkEmbed.js +6 -6
- package/es/Embed/CopyrightEmbed.js +3 -3
- package/es/Embed/EmbedErrorPlaceholder.js +5 -5
- package/es/Embed/ExternalEmbed.js +5 -5
- package/es/Embed/FootnoteEmbed.js +5 -5
- package/es/Embed/GlossEmbed.js +11 -11
- package/es/Embed/H5pEmbed.js +5 -5
- package/es/Embed/IframeEmbed.js +6 -6
- package/es/Embed/ImageEmbed.js +10 -10
- package/es/Embed/InlineTriggerButton.js +2 -2
- package/es/Embed/RelatedContentEmbed.js +5 -5
- package/es/Embed/UnknownEmbed.js +3 -3
- package/es/Embed/UuDisclaimerEmbed.js +6 -6
- package/es/ErrorMessage/ErrorMessage.js +14 -14
- package/es/ErrorMessage/ErrorResourceAccessDenied.js +6 -6
- package/es/FactBox/FactBox.js +5 -5
- package/es/FileList/File.js +3 -3
- package/es/FileList/FileList.js +6 -6
- package/es/FileList/Format.js +6 -6
- package/es/FileList/PdfFile.js +5 -5
- package/es/FrontpageArticle/FrontpageArticle.js +7 -8
- package/es/Gloss/Gloss.js +23 -23
- package/es/Gloss/GlossExample.js +9 -9
- package/es/Grid/Grid.js +4 -4
- package/es/KeyFigure/KeyFigure.js +5 -5
- package/es/Layout/LayoutItem.js +25 -37
- package/es/Layout/OneColumn.js +33 -31
- package/es/Layout/PageContainer.js +21 -30
- package/es/LicenseByline/EmbedByline.js +21 -21
- package/es/LicenseByline/LicenseLink.js +3 -3
- package/es/LinkBlock/LinkBlock.js +8 -8
- package/es/LinkBlock/LinkBlockSection.js +4 -4
- package/es/Messages/MessageBox.js +11 -11
- package/es/Messages/index.js +1 -2
- package/es/ProgrammeCard/ProgrammeCard.js +5 -5
- package/es/RelatedArticleList/RelatedArticleList.js +15 -15
- package/es/ResourceBox/ResourceBox.js +9 -9
- package/es/SnackBar/DefaultSnackbar.js +5 -5
- package/es/SnackBar/SnackbarProvider.js +7 -7
- package/es/TagSelector/TagSelector.js +17 -17
- package/es/TreeStructure/AddFolderButton.js +4 -4
- package/es/TreeStructure/ComboboxButton.js +7 -7
- package/es/TreeStructure/FolderItem.js +13 -13
- package/es/TreeStructure/FolderItems.js +6 -6
- package/es/TreeStructure/TreeStructure.js +9 -9
- package/es/ZendeskButton/ZendeskButton.js +2 -2
- package/es/i18n/index.js +1 -1
- package/es/index.js +5 -12
- package/es/locale/messages-en.js +1 -1
- package/es/locale/messages-nb.js +1 -1
- package/es/locale/messages-nn.js +1 -1
- package/es/locale/messages-se.js +1 -1
- package/es/locale/messages-sma.js +1 -1
- package/es/model/ContentType.js +3 -1
- package/es/styles.css +453 -103
- package/lib/Article/Article.d.ts +9 -30
- package/lib/Article/Article.js +104 -164
- package/lib/Article/ArticleByline.d.ts +1 -3
- package/lib/Article/ArticleByline.js +89 -56
- package/lib/Article/ArticleFootNotes.js +35 -24
- package/lib/Article/ArticleParagraph.js +2 -2
- package/lib/Article/index.d.ts +2 -5
- package/lib/Article/index.js +18 -24
- package/lib/AudioPlayer/AudioPlayer.js +20 -20
- package/lib/AudioPlayer/Controls.js +45 -45
- package/lib/AudioPlayer/SpeechControl.js +8 -8
- package/lib/BlogPost/BlogPost.js +6 -6
- package/lib/Breadcrumb/Breadcrumb.js +21 -29
- package/lib/Breadcrumb/BreadcrumbItem.js +22 -50
- package/lib/Breadcrumb/HomeBreadcrumb.d.ts +1 -2
- package/lib/Breadcrumb/HomeBreadcrumb.js +38 -82
- package/lib/CampaignBlock/CampaignBlock.js +12 -12
- package/lib/CodeBlock/CodeBlock.js +2 -2
- package/lib/Concept/Concept.js +11 -11
- package/lib/ContactBlock/ContactBlock.d.ts +6 -7
- package/lib/ContactBlock/ContactBlock.js +173 -184
- package/lib/ContactBlock/index.d.ts +3 -3
- package/lib/ContactBlock/index.js +13 -11
- package/lib/ContentLoader/index.js +12 -12
- package/lib/ContentPlaceholder/ContentPlaceholder.js +3 -3
- package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +11 -12
- package/lib/ContentTypeBadge/ContentTypeBadge.js +83 -80
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.d.ts +1 -2
- package/lib/ContentTypeBadge/ContentTypeBadgeNew.js +3 -2
- package/lib/ContentTypeHero/ContentTypeHero.d.ts +15 -0
- package/lib/ContentTypeHero/ContentTypeHero.js +57 -0
- package/lib/ContentTypeHero/index.d.ts +9 -0
- package/lib/ContentTypeHero/index.js +12 -0
- package/lib/CopyParagraphButton/CopyParagraphButton.js +13 -12
- package/lib/Embed/AudioEmbed.js +7 -7
- package/lib/Embed/BrightcoveEmbed.js +8 -8
- package/lib/Embed/CodeEmbed.js +6 -6
- package/lib/Embed/ConceptEmbed.js +13 -13
- package/lib/Embed/ConceptListEmbed.js +9 -9
- package/lib/Embed/ContentLinkEmbed.js +6 -6
- package/lib/Embed/CopyrightEmbed.js +3 -3
- package/lib/Embed/EmbedErrorPlaceholder.js +5 -5
- package/lib/Embed/ExternalEmbed.js +5 -5
- package/lib/Embed/FootnoteEmbed.js +5 -5
- package/lib/Embed/GlossEmbed.js +11 -11
- package/lib/Embed/H5pEmbed.js +5 -5
- package/lib/Embed/IframeEmbed.js +6 -6
- package/lib/Embed/ImageEmbed.js +10 -10
- package/lib/Embed/InlineTriggerButton.js +2 -2
- package/lib/Embed/RelatedContentEmbed.js +5 -5
- package/lib/Embed/UnknownEmbed.js +3 -3
- package/lib/Embed/UuDisclaimerEmbed.js +6 -6
- package/lib/ErrorMessage/ErrorMessage.js +14 -14
- package/lib/ErrorMessage/ErrorResourceAccessDenied.js +6 -6
- package/lib/FactBox/FactBox.js +5 -5
- package/lib/FileList/File.js +3 -3
- package/lib/FileList/FileList.js +6 -6
- package/lib/FileList/Format.js +6 -6
- package/lib/FileList/PdfFile.js +5 -5
- package/lib/FrontpageArticle/FrontpageArticle.js +7 -8
- package/lib/Gloss/Gloss.js +23 -23
- package/lib/Gloss/GlossExample.js +9 -9
- package/lib/Grid/Grid.js +4 -4
- package/lib/KeyFigure/KeyFigure.js +5 -5
- package/lib/Layout/LayoutItem.d.ts +3 -7
- package/lib/Layout/LayoutItem.js +27 -38
- package/lib/Layout/OneColumn.d.ts +3 -6
- package/lib/Layout/OneColumn.js +36 -33
- package/lib/Layout/PageContainer.d.ts +3 -6
- package/lib/Layout/PageContainer.js +24 -32
- package/lib/LicenseByline/EmbedByline.js +21 -21
- package/lib/LicenseByline/LicenseLink.js +3 -3
- package/lib/LinkBlock/LinkBlock.js +8 -8
- package/lib/LinkBlock/LinkBlockSection.js +4 -4
- package/lib/Messages/MessageBox.js +11 -11
- package/lib/Messages/index.d.ts +1 -2
- package/lib/Messages/index.js +0 -7
- package/lib/ProgrammeCard/ProgrammeCard.js +5 -5
- package/lib/RelatedArticleList/RelatedArticleList.js +15 -15
- package/lib/ResourceBox/ResourceBox.js +9 -9
- package/lib/SnackBar/DefaultSnackbar.js +5 -5
- package/lib/SnackBar/SnackbarProvider.js +7 -7
- package/lib/TagSelector/TagSelector.js +17 -17
- package/lib/TreeStructure/AddFolderButton.js +4 -4
- package/lib/TreeStructure/ComboboxButton.js +7 -7
- package/lib/TreeStructure/FolderItem.js +13 -13
- package/lib/TreeStructure/FolderItems.js +6 -6
- package/lib/TreeStructure/TreeStructure.js +9 -9
- package/lib/ZendeskButton/ZendeskButton.js +2 -2
- package/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/index.js +6 -0
- package/lib/index.d.ts +8 -15
- package/lib/index.js +30 -139
- package/lib/locale/messages-en.js +1 -1
- package/lib/locale/messages-nb.js +1 -1
- package/lib/locale/messages-nn.js +1 -1
- package/lib/locale/messages-se.js +1 -1
- package/lib/locale/messages-sma.js +1 -1
- package/lib/model/ContentType.d.ts +1 -0
- package/lib/model/ContentType.js +4 -2
- package/lib/styles.css +453 -103
- package/package.json +10 -11
- package/src/Article/Article.tsx +101 -229
- package/src/Article/ArticleByline.tsx +82 -69
- package/src/Article/ArticleFootNotes.tsx +32 -36
- package/src/Article/index.ts +3 -7
- package/src/Breadcrumb/Breadcrumb.tsx +20 -18
- package/src/Breadcrumb/BreadcrumbItem.tsx +36 -59
- package/src/Breadcrumb/HomeBreadcrumb.stories.tsx +0 -12
- package/src/Breadcrumb/HomeBreadcrumb.tsx +33 -46
- package/src/ContactBlock/{Contactblock.stories.tsx → ContactBlock.stories.tsx} +3 -4
- package/src/ContactBlock/ContactBlock.tsx +165 -199
- package/src/ContactBlock/index.ts +3 -3
- package/src/ContentTypeBadge/ContentTypeBadge.tsx +77 -77
- package/src/ContentTypeBadge/ContentTypeBadgeNew.tsx +3 -1
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +76 -0
- package/src/ContentTypeHero/ContentTypeHero.tsx +55 -0
- package/src/ContentTypeHero/index.ts +10 -0
- package/src/CopyParagraphButton/CopyParagraphButton.tsx +10 -3
- package/src/Embed/AudioEmbed.stories.tsx +6 -8
- package/src/Embed/BrightcoveEmbed.stories.tsx +6 -8
- package/src/Embed/ConceptEmbed.stories.tsx +6 -8
- package/src/Embed/ExternalEmbed.stories.tsx +5 -5
- package/src/Embed/H5pEmbed.stories.tsx +6 -8
- package/src/Embed/IframeEmbed.stories.tsx +6 -8
- package/src/Embed/ImageEmbed.stories.tsx +6 -8
- package/src/Embed/RelatedContentEmbed.stories.tsx +6 -8
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +6 -8
- package/src/FrontpageArticle/FrontpageArticle.tsx +1 -1
- package/src/Layout/LayoutItem.tsx +25 -41
- package/src/Layout/OneColumn.tsx +33 -33
- package/src/Layout/PageContainer.tsx +22 -24
- package/src/Messages/index.ts +1 -2
- package/src/i18n/index.ts +1 -0
- package/src/index.ts +11 -35
- package/src/locale/messages-en.ts +1 -1
- package/src/locale/messages-nb.ts +1 -1
- package/src/locale/messages-nn.ts +1 -1
- package/src/locale/messages-se.ts +1 -1
- package/src/locale/messages-sma.ts +1 -1
- package/src/model/ContentType.ts +2 -0
- package/es/Article/ArticleHeaderWrapper.js +0 -33
- package/es/CreatedBy/CreatedBy.js +0 -73
- package/es/CreatedBy/index.js +0 -10
- package/es/Hero/Hero.js +0 -68
- package/es/Hero/HeroContent.js +0 -16
- package/es/Hero/index.js +0 -10
- package/es/LanguageSelector/LanguageSelector.js +0 -87
- package/es/LanguageSelector/index.js +0 -10
- package/es/Logo/Logo.js +0 -52
- package/es/Logo/SvgLogo.js +0 -54
- package/es/Messages/MessageBanner.js +0 -72
- package/es/Search/ActiveFilterContent.js +0 -40
- package/es/Search/ActiveFilters.js +0 -112
- package/es/Search/ContentTypeResult.js +0 -151
- package/es/Search/ContentTypeResultStyles.js +0 -51
- package/es/Search/IsPathToHighlight.js +0 -12
- package/es/Search/LoadingWrapper.js +0 -31
- package/es/Search/SearchField.js +0 -110
- package/es/Search/SearchFieldForm.js +0 -33
- package/es/Search/SearchResult.js +0 -185
- package/es/Search/SearchResultSleeve.js +0 -229
- package/es/Search/index.js +0 -12
- package/lib/Article/ArticleHeaderWrapper.d.ts +0 -14
- package/lib/Article/ArticleHeaderWrapper.js +0 -40
- package/lib/CreatedBy/CreatedBy.d.ts +0 -15
- package/lib/CreatedBy/CreatedBy.js +0 -78
- package/lib/CreatedBy/index.d.ts +0 -9
- package/lib/CreatedBy/index.js +0 -16
- package/lib/Hero/Hero.d.ts +0 -25
- package/lib/Hero/Hero.js +0 -83
- package/lib/Hero/HeroContent.d.ts +0 -12
- package/lib/Hero/HeroContent.js +0 -23
- package/lib/Hero/index.d.ts +0 -10
- package/lib/Hero/index.js +0 -61
- package/lib/LanguageSelector/LanguageSelector.d.ts +0 -15
- package/lib/LanguageSelector/LanguageSelector.js +0 -92
- package/lib/LanguageSelector/index.d.ts +0 -9
- package/lib/LanguageSelector/index.js +0 -13
- package/lib/Logo/Logo.d.ts +0 -20
- package/lib/Logo/Logo.js +0 -58
- package/lib/Logo/SvgLogo.d.ts +0 -14
- package/lib/Logo/SvgLogo.js +0 -62
- package/lib/Logo/index.d.ts +0 -9
- package/lib/Logo/index.js +0 -16
- package/lib/Messages/MessageBanner.d.ts +0 -16
- package/lib/Messages/MessageBanner.js +0 -77
- package/lib/Search/ActiveFilterContent.d.ts +0 -23
- package/lib/Search/ActiveFilterContent.js +0 -47
- package/lib/Search/ActiveFilters.d.ts +0 -19
- package/lib/Search/ActiveFilters.js +0 -119
- package/lib/Search/ContentTypeResult.d.ts +0 -29
- package/lib/Search/ContentTypeResult.js +0 -159
- package/lib/Search/ContentTypeResultStyles.d.ts +0 -45
- package/lib/Search/ContentTypeResultStyles.js +0 -58
- package/lib/Search/IsPathToHighlight.d.ts +0 -8
- package/lib/Search/IsPathToHighlight.js +0 -19
- package/lib/Search/LoadingWrapper.d.ts +0 -12
- package/lib/Search/LoadingWrapper.js +0 -38
- package/lib/Search/SearchField.d.ts +0 -25
- package/lib/Search/SearchField.js +0 -117
- package/lib/Search/SearchFieldForm.d.ts +0 -15
- package/lib/Search/SearchFieldForm.js +0 -41
- package/lib/Search/SearchResult.d.ts +0 -43
- package/lib/Search/SearchResult.js +0 -194
- package/lib/Search/SearchResultSleeve.d.ts +0 -25
- package/lib/Search/SearchResultSleeve.js +0 -237
- package/lib/Search/index.d.ts +0 -11
- package/lib/Search/index.js +0 -33
- package/src/Article/ArticleHeaderWrapper.tsx +0 -38
- package/src/CreatedBy/CreatedBy.stories.tsx +0 -36
- package/src/CreatedBy/CreatedBy.tsx +0 -63
- package/src/CreatedBy/index.ts +0 -11
- package/src/Hero/Hero.stories.tsx +0 -35
- package/src/Hero/Hero.tsx +0 -129
- package/src/Hero/HeroContent.tsx +0 -43
- package/src/Hero/index.ts +0 -21
- package/src/LanguageSelector/LanguageSelector.stories.tsx +0 -44
- package/src/LanguageSelector/LanguageSelector.tsx +0 -101
- package/src/LanguageSelector/index.ts +0 -11
- package/src/Logo/Logo.stories.tsx +0 -47
- package/src/Logo/Logo.tsx +0 -47
- package/src/Logo/SvgLogo.tsx +0 -48
- package/src/Logo/index.ts +0 -11
- package/src/Messages/MessageBanner.stories.tsx +0 -31
- package/src/Messages/MessageBanner.tsx +0 -67
- package/src/Search/ActiveFilterContent.tsx +0 -64
- package/src/Search/ActiveFilters.tsx +0 -145
- package/src/Search/ContentTypeResult.tsx +0 -190
- package/src/Search/ContentTypeResultStyles.tsx +0 -172
- package/src/Search/IsPathToHighlight.ts +0 -12
- package/src/Search/LoadingWrapper.tsx +0 -44
- package/src/Search/SearchField.tsx +0 -175
- package/src/Search/SearchFieldForm.tsx +0 -64
- package/src/Search/SearchResult.tsx +0 -368
- package/src/Search/SearchResultSleeve.tsx +0 -367
- package/src/Search/__tests__/Highlight-test.ts +0 -66
- package/src/Search/index.ts +0 -14
package/es/Embed/AudioEmbed.js
CHANGED
|
@@ -10,7 +10,7 @@ import { Figure } from "@ndla/primitives";
|
|
|
10
10
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
11
11
|
import AudioPlayer from "../AudioPlayer";
|
|
12
12
|
import { EmbedByline } from "../LicenseByline";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
export const getFirstNonEmptyLicenseCredits = authors => Object.values(authors).find(i => i.length > 0) ?? [];
|
|
15
15
|
const AudioEmbed = _ref => {
|
|
16
16
|
let {
|
|
@@ -18,7 +18,7 @@ const AudioEmbed = _ref => {
|
|
|
18
18
|
lang
|
|
19
19
|
} = _ref;
|
|
20
20
|
if (embed.status === "error") {
|
|
21
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
21
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
22
22
|
type: embed.embedData.type === "standard" ? "audio" : "podcast"
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -27,7 +27,7 @@ const AudioEmbed = _ref => {
|
|
|
27
27
|
embedData
|
|
28
28
|
} = embed;
|
|
29
29
|
if (embedData.type === "minimal") {
|
|
30
|
-
return _jsx(AudioPlayer, {
|
|
30
|
+
return /*#__PURE__*/_jsx(AudioPlayer, {
|
|
31
31
|
speech: true,
|
|
32
32
|
src: data.audioFile.url,
|
|
33
33
|
title: data.title.title
|
|
@@ -42,20 +42,20 @@ const AudioEmbed = _ref => {
|
|
|
42
42
|
url: coverPhoto.url,
|
|
43
43
|
alt: coverPhoto.altText
|
|
44
44
|
};
|
|
45
|
-
return _jsxs(Figure, {
|
|
45
|
+
return /*#__PURE__*/_jsxs(Figure, {
|
|
46
46
|
lang: lang,
|
|
47
|
-
children: [_jsx(AudioPlayer, {
|
|
47
|
+
children: [/*#__PURE__*/_jsx(AudioPlayer, {
|
|
48
48
|
description: data.podcastMeta?.introduction ?? "",
|
|
49
49
|
img: img,
|
|
50
50
|
src: data.audioFile.url,
|
|
51
|
-
textVersion: data.manuscript?.manuscript.length ? _jsx("span", {
|
|
51
|
+
textVersion: data.manuscript?.manuscript.length ? /*#__PURE__*/_jsx("span", {
|
|
52
52
|
dangerouslySetInnerHTML: {
|
|
53
53
|
__html: data.manuscript.manuscript
|
|
54
54
|
}
|
|
55
55
|
}) : undefined,
|
|
56
56
|
title: data.title.title,
|
|
57
57
|
subtitle: subtitle
|
|
58
|
-
}), _jsx(EmbedByline, {
|
|
58
|
+
}), /*#__PURE__*/_jsx(EmbedByline, {
|
|
59
59
|
error: false,
|
|
60
60
|
type: data.audioType === "standard" ? "audio" : "podcast",
|
|
61
61
|
copyright: embed.data.copyright
|
|
@@ -13,7 +13,7 @@ import { Button, Figure } from "@ndla/primitives";
|
|
|
13
13
|
import { styled } from "@ndla/styled-system/jsx";
|
|
14
14
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
15
15
|
import { EmbedByline } from "../LicenseByline";
|
|
16
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
16
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
17
17
|
const LinkedVideoButton = styled(Button, {
|
|
18
18
|
base: {
|
|
19
19
|
marginInlineStart: "xsmall"
|
|
@@ -77,9 +77,9 @@ const BrightcoveEmbed = _ref => {
|
|
|
77
77
|
}
|
|
78
78
|
}, []);
|
|
79
79
|
if (embed.status === "error") {
|
|
80
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
80
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
81
81
|
type: "video",
|
|
82
|
-
children: _jsx(BrightcoveIframe, {
|
|
82
|
+
children: /*#__PURE__*/_jsx(BrightcoveIframe, {
|
|
83
83
|
ref: iframeRef,
|
|
84
84
|
title: embedData.alt ?? fallbackTitle,
|
|
85
85
|
"aria-label": embedData.alt ?? fallbackTitle,
|
|
@@ -98,10 +98,10 @@ const BrightcoveEmbed = _ref => {
|
|
|
98
98
|
...embedData,
|
|
99
99
|
videoid: linkedVideoId
|
|
100
100
|
}, data.sources) : undefined;
|
|
101
|
-
return _jsxs(Figure, {
|
|
102
|
-
children: [_jsx("div", {
|
|
101
|
+
return /*#__PURE__*/_jsxs(Figure, {
|
|
102
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
103
103
|
className: "brightcove-video",
|
|
104
|
-
children: _jsx(BrightcoveIframe, {
|
|
104
|
+
children: /*#__PURE__*/_jsx(BrightcoveIframe, {
|
|
105
105
|
ref: iframeRef,
|
|
106
106
|
className: "original",
|
|
107
107
|
title: embedData.alt ?? data.name ?? fallbackTitle,
|
|
@@ -110,11 +110,11 @@ const BrightcoveEmbed = _ref => {
|
|
|
110
110
|
...(alternativeVideoProps && !showOriginalVideo ? alternativeVideoProps : originalVideoProps),
|
|
111
111
|
allowFullScreen: true
|
|
112
112
|
})
|
|
113
|
-
}), _jsx(EmbedByline, {
|
|
113
|
+
}), /*#__PURE__*/_jsx(EmbedByline, {
|
|
114
114
|
type: "video",
|
|
115
115
|
copyright: data.copyright,
|
|
116
116
|
description: parsedDescription,
|
|
117
|
-
children: !!linkedVideoId && _jsx(LinkedVideoButton, {
|
|
117
|
+
children: !!linkedVideoId && /*#__PURE__*/_jsx(LinkedVideoButton, {
|
|
118
118
|
size: "small",
|
|
119
119
|
variant: "secondary",
|
|
120
120
|
onClick: () => setShowOriginalVideo(p => !p),
|
package/es/Embed/CodeEmbed.js
CHANGED
|
@@ -16,7 +16,7 @@ import { copyTextToClipboard } from "@ndla/util";
|
|
|
16
16
|
import { CodeBlock, codeLanguageOptions } from "../CodeBlock";
|
|
17
17
|
|
|
18
18
|
// TODO: We need an error state for this
|
|
19
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
19
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
20
|
const StyledFigCaption = styled("figcaption", {
|
|
21
21
|
base: {
|
|
22
22
|
textStyle: "label.large",
|
|
@@ -55,19 +55,19 @@ const CodeEmbed = _ref => {
|
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
57
|
}, [isCopied]);
|
|
58
|
-
return _jsxs(StyledFigure, {
|
|
59
|
-
children: [_jsx(StyledFigCaption, {
|
|
58
|
+
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
59
|
+
children: [/*#__PURE__*/_jsx(StyledFigCaption, {
|
|
60
60
|
children: embed.embedData.title || getTitleFromFormat(embed.embedData.codeFormat)
|
|
61
|
-
}), _jsx(CodeBlock, {
|
|
61
|
+
}), /*#__PURE__*/_jsx(CodeBlock, {
|
|
62
62
|
highlightedCode: embed.status === "success" ? embed.data.highlightedCode : "",
|
|
63
63
|
format: embed.embedData.codeFormat
|
|
64
|
-
}), _jsxs(Button, {
|
|
64
|
+
}), /*#__PURE__*/_jsxs(Button, {
|
|
65
65
|
variant: "secondary",
|
|
66
66
|
onClick: () => {
|
|
67
67
|
copyTextToClipboard(embed.status === "success" ? embed.data.decodedContent : "");
|
|
68
68
|
setIsCopied(true);
|
|
69
69
|
},
|
|
70
|
-
children: [isCopied ? _jsx(Done, {}) : _jsx(Copy, {}), isCopied ? t("codeBlock.copiedCode") : t("codeBlock.copyCode")]
|
|
70
|
+
children: [isCopied ? /*#__PURE__*/_jsx(Done, {}) : /*#__PURE__*/_jsx(Copy, {}), isCopied ? t("codeBlock.copiedCode") : t("codeBlock.copyCode")]
|
|
71
71
|
})]
|
|
72
72
|
});
|
|
73
73
|
};
|
package/es/Embed/ConceptEmbed.js
CHANGED
|
@@ -14,7 +14,7 @@ import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
|
14
14
|
import { GlossEmbed } from "./GlossEmbed";
|
|
15
15
|
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
16
16
|
import { Concept } from "../Concept/Concept";
|
|
17
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
17
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
18
18
|
const StyledPopoverContent = styled(PopoverContent, {
|
|
19
19
|
base: {
|
|
20
20
|
width: "surface.xlarge"
|
|
@@ -31,12 +31,12 @@ export const ConceptEmbed = _ref => {
|
|
|
31
31
|
return parse(embed.data.concept.content.htmlContent);
|
|
32
32
|
}, [embed]);
|
|
33
33
|
if (embed.status === "error" && embed.embedData.type === "inline") {
|
|
34
|
-
return _jsx("span", {
|
|
34
|
+
return /*#__PURE__*/_jsx("span", {
|
|
35
35
|
children: embed.embedData.linkText
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (embed.status === "error") {
|
|
39
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
39
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
40
40
|
type: "gloss"
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -47,12 +47,12 @@ export const ConceptEmbed = _ref => {
|
|
|
47
47
|
|
|
48
48
|
// TODO: Consider whether we should do this in article-converter instead.
|
|
49
49
|
if (embed.data.concept.glossData) {
|
|
50
|
-
return _jsx(GlossEmbed, {
|
|
50
|
+
return /*#__PURE__*/_jsx(GlossEmbed, {
|
|
51
51
|
embed: embed
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
if (embed.embedData.type === "inline") {
|
|
55
|
-
return _jsx(InlineConcept, {
|
|
55
|
+
return /*#__PURE__*/_jsx(InlineConcept, {
|
|
56
56
|
linkText: embed.embedData.linkText,
|
|
57
57
|
copyright: concept.copyright,
|
|
58
58
|
visualElement: visualElement,
|
|
@@ -61,7 +61,7 @@ export const ConceptEmbed = _ref => {
|
|
|
61
61
|
children: parsedContent
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
|
-
return _jsx(BlockConcept, {
|
|
64
|
+
return /*#__PURE__*/_jsx(BlockConcept, {
|
|
65
65
|
copyright: concept.copyright,
|
|
66
66
|
visualElement: visualElement,
|
|
67
67
|
lang: lang,
|
|
@@ -83,17 +83,17 @@ export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
83
83
|
title,
|
|
84
84
|
...rest
|
|
85
85
|
} = _ref2;
|
|
86
|
-
return _jsxs(PopoverRoot, {
|
|
87
|
-
children: [_jsx(PopoverTrigger, {
|
|
86
|
+
return /*#__PURE__*/_jsxs(PopoverRoot, {
|
|
87
|
+
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
88
88
|
asChild: true,
|
|
89
|
-
children: _jsx(InlineTriggerButton, {
|
|
89
|
+
children: /*#__PURE__*/_jsx(InlineTriggerButton, {
|
|
90
90
|
...rest,
|
|
91
91
|
ref: ref,
|
|
92
92
|
children: linkText
|
|
93
93
|
})
|
|
94
|
-
}), _jsx(StyledPopoverContent, {
|
|
95
|
-
children: _jsx(Figure, {
|
|
96
|
-
children: _jsx(Concept, {
|
|
94
|
+
}), /*#__PURE__*/_jsx(StyledPopoverContent, {
|
|
95
|
+
children: /*#__PURE__*/_jsx(Figure, {
|
|
96
|
+
children: /*#__PURE__*/_jsx(Concept, {
|
|
97
97
|
copyright: copyright,
|
|
98
98
|
visualElement: visualElement,
|
|
99
99
|
lang: lang,
|
|
@@ -104,7 +104,7 @@ export const InlineConcept = /*#__PURE__*/forwardRef((_ref2, ref) => {
|
|
|
104
104
|
})]
|
|
105
105
|
});
|
|
106
106
|
});
|
|
107
|
-
export const BlockConcept = /*#__PURE__*/forwardRef((props, ref) => _jsx(Concept, {
|
|
107
|
+
export const BlockConcept = /*#__PURE__*/forwardRef((props, ref) => /*#__PURE__*/_jsx(Concept, {
|
|
108
108
|
...props,
|
|
109
109
|
ref: ref
|
|
110
110
|
}));
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from "react-i18next";
|
|
|
10
10
|
import { Figure } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
12
|
import { BlockConcept } from "./ConceptEmbed";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
// TODO: Find out if we're actually still going to use this.
|
|
15
15
|
// If we are, we need to re-add some margin between the list items. We should also probably parse the concept content to HTML, like we do in ConceptEmbed.
|
|
16
16
|
|
|
@@ -35,7 +35,7 @@ const ConceptListEmbed = _ref => {
|
|
|
35
35
|
t
|
|
36
36
|
} = useTranslation();
|
|
37
37
|
if (embed.status === "error") {
|
|
38
|
-
return _jsx(StyledSpan, {
|
|
38
|
+
return /*#__PURE__*/_jsx(StyledSpan, {
|
|
39
39
|
children: t("embed.conceptListError")
|
|
40
40
|
});
|
|
41
41
|
}
|
|
@@ -43,21 +43,21 @@ const ConceptListEmbed = _ref => {
|
|
|
43
43
|
embedData,
|
|
44
44
|
data
|
|
45
45
|
} = embed;
|
|
46
|
-
return _jsx("div", {
|
|
47
|
-
children: _jsxs(Figure, {
|
|
48
|
-
children: [embedData.title && _jsx("h2", {
|
|
46
|
+
return /*#__PURE__*/_jsx("div", {
|
|
47
|
+
children: /*#__PURE__*/_jsxs(Figure, {
|
|
48
|
+
children: [embedData.title && /*#__PURE__*/_jsx("h2", {
|
|
49
49
|
lang: lang,
|
|
50
50
|
children: embedData.title
|
|
51
|
-
}), _jsx(ConceptList, {
|
|
52
|
-
children: _jsx("ul", {
|
|
51
|
+
}), /*#__PURE__*/_jsx(ConceptList, {
|
|
52
|
+
children: /*#__PURE__*/_jsx("ul", {
|
|
53
53
|
lang: lang,
|
|
54
54
|
children: data.concepts.map(_ref2 => {
|
|
55
55
|
let {
|
|
56
56
|
concept,
|
|
57
57
|
visualElement
|
|
58
58
|
} = _ref2;
|
|
59
|
-
return _jsx("li", {
|
|
60
|
-
children: _jsx(BlockConcept, {
|
|
59
|
+
return /*#__PURE__*/_jsx("li", {
|
|
60
|
+
children: /*#__PURE__*/_jsx(BlockConcept, {
|
|
61
61
|
title: concept.title.title,
|
|
62
62
|
content: concept.content.content,
|
|
63
63
|
copyright: concept.copyright,
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { Text } from "@ndla/primitives";
|
|
11
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
11
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
12
|
const ContentLinkEmbed = _ref => {
|
|
13
13
|
let {
|
|
14
14
|
embed,
|
|
@@ -19,12 +19,12 @@ const ContentLinkEmbed = _ref => {
|
|
|
19
19
|
t
|
|
20
20
|
} = useTranslation();
|
|
21
21
|
if (embed.status === "error") {
|
|
22
|
-
return _jsx(Text, {
|
|
22
|
+
return /*#__PURE__*/_jsx(Text, {
|
|
23
23
|
color: "text.error",
|
|
24
24
|
asChild: true,
|
|
25
25
|
consumeCss: true,
|
|
26
|
-
children: _jsxs("span", {
|
|
27
|
-
children: [_jsx("span", {
|
|
26
|
+
children: /*#__PURE__*/_jsxs("span", {
|
|
27
|
+
children: [/*#__PURE__*/_jsx("span", {
|
|
28
28
|
children: `${t("embed.linkError")}: `
|
|
29
29
|
}), children]
|
|
30
30
|
})
|
|
@@ -35,14 +35,14 @@ const ContentLinkEmbed = _ref => {
|
|
|
35
35
|
data
|
|
36
36
|
} = embed;
|
|
37
37
|
if (embedData.openIn === "new-context" || isOembed) {
|
|
38
|
-
return _jsx("a", {
|
|
38
|
+
return /*#__PURE__*/_jsx("a", {
|
|
39
39
|
href: data.path,
|
|
40
40
|
target: "_blank",
|
|
41
41
|
rel: "noopener noreferrer",
|
|
42
42
|
children: children
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
return _jsx("a", {
|
|
45
|
+
return /*#__PURE__*/_jsx("a", {
|
|
46
46
|
href: data.path,
|
|
47
47
|
children: children
|
|
48
48
|
});
|
|
@@ -7,14 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
9
|
import { EmbedByline } from "../LicenseByline";
|
|
10
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
10
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
const CopyrightEmbed = _ref => {
|
|
12
12
|
let {
|
|
13
13
|
embed,
|
|
14
14
|
children
|
|
15
15
|
} = _ref;
|
|
16
|
-
return _jsxs("figure", {
|
|
17
|
-
children: [children, _jsx(EmbedByline, {
|
|
16
|
+
return /*#__PURE__*/_jsxs("figure", {
|
|
17
|
+
children: [children, /*#__PURE__*/_jsx(EmbedByline, {
|
|
18
18
|
type: "copyright",
|
|
19
19
|
copyright: embed.embedData.copyright
|
|
20
20
|
})]
|
|
@@ -10,7 +10,7 @@ import { WarningOutline } from "@ndla/icons/common";
|
|
|
10
10
|
import { Figure } from "@ndla/primitives";
|
|
11
11
|
import { styled } from "@ndla/styled-system/jsx";
|
|
12
12
|
import { EmbedByline } from "../LicenseByline";
|
|
13
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
13
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
const ErrorPlaceholder = styled("div", {
|
|
15
15
|
base: {
|
|
16
16
|
display: "flex",
|
|
@@ -42,13 +42,13 @@ const EmbedErrorPlaceholder = _ref => {
|
|
|
42
42
|
figureType,
|
|
43
43
|
float
|
|
44
44
|
} = _ref;
|
|
45
|
-
return _jsxs(StyledFigure, {
|
|
45
|
+
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
46
46
|
size: figureType,
|
|
47
47
|
float: float,
|
|
48
|
-
children: [children ?? _jsx(ErrorPlaceholder, {
|
|
48
|
+
children: [children ?? /*#__PURE__*/_jsx(ErrorPlaceholder, {
|
|
49
49
|
"data-embed-type": type,
|
|
50
|
-
children: _jsx(WarningOutline, {})
|
|
51
|
-
}), _jsx(EmbedByline, {
|
|
50
|
+
children: /*#__PURE__*/_jsx(WarningOutline, {})
|
|
51
|
+
}), /*#__PURE__*/_jsx(EmbedByline, {
|
|
52
52
|
error: true,
|
|
53
53
|
type: type
|
|
54
54
|
})]
|
|
@@ -12,7 +12,7 @@ import { Figure } from "@ndla/primitives";
|
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
14
14
|
import { ResourceBox } from "../ResourceBox";
|
|
15
|
-
import { jsx as _jsx } from "
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
const StyledFigure = styled(Figure, {
|
|
17
17
|
base: {
|
|
18
18
|
"& iframe": {
|
|
@@ -39,7 +39,7 @@ const ExternalEmbed = _ref => {
|
|
|
39
39
|
}
|
|
40
40
|
}, []);
|
|
41
41
|
if (embed.status === "error") {
|
|
42
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
42
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
43
43
|
type: "external"
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -52,8 +52,8 @@ const ExternalEmbed = _ref => {
|
|
|
52
52
|
src: data.iframeImage?.image.imageUrl ?? "",
|
|
53
53
|
alt: embedData.alt !== undefined ? embedData.alt : data.iframeImage?.alttext?.alttext ?? ""
|
|
54
54
|
};
|
|
55
|
-
return _jsx(Figure, {
|
|
56
|
-
children: _jsx(ResourceBox, {
|
|
55
|
+
return /*#__PURE__*/_jsx(Figure, {
|
|
56
|
+
children: /*#__PURE__*/_jsx(ResourceBox, {
|
|
57
57
|
image: image,
|
|
58
58
|
title: embedData.title ?? "",
|
|
59
59
|
url: embedData.url,
|
|
@@ -62,7 +62,7 @@ const ExternalEmbed = _ref => {
|
|
|
62
62
|
})
|
|
63
63
|
});
|
|
64
64
|
}
|
|
65
|
-
return _jsx(StyledFigure, {
|
|
65
|
+
return /*#__PURE__*/_jsx(StyledFigure, {
|
|
66
66
|
ref: figRef,
|
|
67
67
|
dangerouslySetInnerHTML: {
|
|
68
68
|
__html: data.oembed.html ?? ""
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
|
-
import { jsx as _jsx } from "
|
|
11
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
12
12
|
const StyledSup = styled("sup", {
|
|
13
13
|
base: {
|
|
14
14
|
"& a": {
|
|
@@ -25,14 +25,14 @@ const FootnoteEmbed = _ref => {
|
|
|
25
25
|
t
|
|
26
26
|
} = useTranslation();
|
|
27
27
|
if (embed.status === "error") {
|
|
28
|
-
return _jsx("div", {
|
|
28
|
+
return /*#__PURE__*/_jsx("div", {
|
|
29
29
|
children: t("error")
|
|
30
30
|
});
|
|
31
31
|
}
|
|
32
|
-
return _jsx("span", {
|
|
32
|
+
return /*#__PURE__*/_jsx("span", {
|
|
33
33
|
id: `ref${embed.data.entryNum}`,
|
|
34
|
-
children: _jsx(StyledSup, {
|
|
35
|
-
children: _jsx("a", {
|
|
34
|
+
children: /*#__PURE__*/_jsx(StyledSup, {
|
|
35
|
+
children: /*#__PURE__*/_jsx("a", {
|
|
36
36
|
href: `#note${embed.data.entryNum}`,
|
|
37
37
|
target: "_self",
|
|
38
38
|
children: `[${embed.data.entryNum}]`
|
package/es/Embed/GlossEmbed.js
CHANGED
|
@@ -11,7 +11,7 @@ import { styled } from "@ndla/styled-system/jsx";
|
|
|
11
11
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
12
12
|
import { InlineTriggerButton } from "./InlineTriggerButton";
|
|
13
13
|
import { Gloss } from "../Gloss";
|
|
14
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
14
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
15
15
|
const StyledPopoverContent = styled(PopoverContent, {
|
|
16
16
|
base: {
|
|
17
17
|
width: "surface.xlarge"
|
|
@@ -22,12 +22,12 @@ export const GlossEmbed = _ref => {
|
|
|
22
22
|
embed
|
|
23
23
|
} = _ref;
|
|
24
24
|
if (embed.status === "error" && embed.embedData.type === "inline") {
|
|
25
|
-
return _jsx("span", {
|
|
25
|
+
return /*#__PURE__*/_jsx("span", {
|
|
26
26
|
children: embed.embedData.linkText
|
|
27
27
|
});
|
|
28
28
|
}
|
|
29
29
|
if (embed.status === "error" || !embed.data.concept.glossData) {
|
|
30
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
30
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
31
31
|
type: "gloss"
|
|
32
32
|
});
|
|
33
33
|
}
|
|
@@ -40,15 +40,15 @@ export const GlossEmbed = _ref => {
|
|
|
40
40
|
title: visualElement.data.title.title
|
|
41
41
|
} : undefined;
|
|
42
42
|
if (embed.embedData.type === "inline") {
|
|
43
|
-
return _jsxs(PopoverRoot, {
|
|
44
|
-
children: [_jsx(PopoverTrigger, {
|
|
43
|
+
return /*#__PURE__*/_jsxs(PopoverRoot, {
|
|
44
|
+
children: [/*#__PURE__*/_jsx(PopoverTrigger, {
|
|
45
45
|
asChild: true,
|
|
46
|
-
children: _jsx(InlineTriggerButton, {
|
|
46
|
+
children: /*#__PURE__*/_jsx(InlineTriggerButton, {
|
|
47
47
|
children: embed.embedData.linkText
|
|
48
48
|
})
|
|
49
|
-
}), _jsx(StyledPopoverContent, {
|
|
50
|
-
children: _jsx(Figure, {
|
|
51
|
-
children: _jsx(Gloss, {
|
|
49
|
+
}), /*#__PURE__*/_jsx(StyledPopoverContent, {
|
|
50
|
+
children: /*#__PURE__*/_jsx(Figure, {
|
|
51
|
+
children: /*#__PURE__*/_jsx(Gloss, {
|
|
52
52
|
glossData: concept.glossData,
|
|
53
53
|
title: concept.title,
|
|
54
54
|
audio: audio
|
|
@@ -57,8 +57,8 @@ export const GlossEmbed = _ref => {
|
|
|
57
57
|
})]
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
|
-
return _jsx(Figure, {
|
|
61
|
-
children: _jsx(Gloss, {
|
|
60
|
+
return /*#__PURE__*/_jsx(Figure, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(Gloss, {
|
|
62
62
|
glossData: concept.glossData,
|
|
63
63
|
title: concept.title,
|
|
64
64
|
audio: audio,
|
package/es/Embed/H5pEmbed.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { Figure } from "@ndla/primitives";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
11
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
12
|
-
import { jsx as _jsx } from "
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const StyledFigure = styled(Figure, {
|
|
14
14
|
base: {
|
|
15
15
|
"& iframe": {
|
|
@@ -31,19 +31,19 @@ const H5pEmbed = _ref => {
|
|
|
31
31
|
embed
|
|
32
32
|
} = _ref;
|
|
33
33
|
if (embed.status === "error") {
|
|
34
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
34
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
35
35
|
type: "h5p"
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
if (embed.data.oembed) {
|
|
39
|
-
return _jsx(FigureOembed, {
|
|
39
|
+
return /*#__PURE__*/_jsx(FigureOembed, {
|
|
40
40
|
dangerouslySetInnerHTML: {
|
|
41
41
|
__html: embed.data.oembed.html ?? ""
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
-
return _jsx(StyledFigure, {
|
|
46
|
-
children: _jsx("iframe", {
|
|
45
|
+
return /*#__PURE__*/_jsx(StyledFigure, {
|
|
46
|
+
children: /*#__PURE__*/_jsx("iframe", {
|
|
47
47
|
title: embed.embedData.url,
|
|
48
48
|
"aria-label": embed.embedData.url,
|
|
49
49
|
src: embed.embedData.url
|
package/es/Embed/IframeEmbed.js
CHANGED
|
@@ -12,7 +12,7 @@ import { Figure } from "@ndla/primitives";
|
|
|
12
12
|
import { styled } from "@ndla/styled-system/jsx";
|
|
13
13
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
14
14
|
import { ResourceBox } from "../ResourceBox";
|
|
15
|
-
import { jsx as _jsx } from "
|
|
15
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
16
16
|
const StyledIframe = styled("iframe", {
|
|
17
17
|
base: {
|
|
18
18
|
width: "100%"
|
|
@@ -36,7 +36,7 @@ const IframeEmbed = _ref => {
|
|
|
36
36
|
}
|
|
37
37
|
}, []);
|
|
38
38
|
if (embed.status === "error") {
|
|
39
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
39
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
40
40
|
type: "external"
|
|
41
41
|
});
|
|
42
42
|
}
|
|
@@ -51,8 +51,8 @@ const IframeEmbed = _ref => {
|
|
|
51
51
|
src: iframeImage?.image.imageUrl ?? "",
|
|
52
52
|
alt: alt ?? ""
|
|
53
53
|
};
|
|
54
|
-
return _jsx(Figure, {
|
|
55
|
-
children: _jsx(ResourceBox, {
|
|
54
|
+
return /*#__PURE__*/_jsx(Figure, {
|
|
55
|
+
children: /*#__PURE__*/_jsx(ResourceBox, {
|
|
56
56
|
image: image,
|
|
57
57
|
title: embedData.title ?? "",
|
|
58
58
|
url: embedData.url,
|
|
@@ -70,8 +70,8 @@ const IframeEmbed = _ref => {
|
|
|
70
70
|
const strippedWidth = typeof width === "number" ? width : width?.replace(/\s*px/, "");
|
|
71
71
|
const strippedHeight = typeof height === "number" ? height : height?.replace(/\s*px/, "");
|
|
72
72
|
const urlOrTitle = title || url;
|
|
73
|
-
return _jsx(Figure, {
|
|
74
|
-
children: _jsx(StyledIframe, {
|
|
73
|
+
return /*#__PURE__*/_jsx(Figure, {
|
|
74
|
+
children: /*#__PURE__*/_jsx(StyledIframe, {
|
|
75
75
|
ref: iframeRef,
|
|
76
76
|
title: urlOrTitle,
|
|
77
77
|
"aria-label": urlOrTitle,
|
package/es/Embed/ImageEmbed.js
CHANGED
|
@@ -15,7 +15,7 @@ import { Figure, Image } from "@ndla/primitives";
|
|
|
15
15
|
import { styled } from "@ndla/styled-system/jsx";
|
|
16
16
|
import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
|
|
17
17
|
import { EmbedByline } from "../LicenseByline";
|
|
18
|
-
import { jsx as _jsx, jsxs as _jsxs } from "
|
|
18
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
19
19
|
export const getLicenseCredits = copyright => {
|
|
20
20
|
return {
|
|
21
21
|
creators: copyright?.creators ?? [],
|
|
@@ -208,7 +208,7 @@ const ImageEmbed = _ref => {
|
|
|
208
208
|
}
|
|
209
209
|
}, [embed, renderContext]);
|
|
210
210
|
if (embed.status === "error") {
|
|
211
|
-
return _jsx(EmbedErrorPlaceholder, {
|
|
211
|
+
return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
|
|
212
212
|
type: "image",
|
|
213
213
|
figureType: figureProps?.size,
|
|
214
214
|
float: figureProps?.float
|
|
@@ -227,13 +227,13 @@ const ImageEmbed = _ref => {
|
|
|
227
227
|
};
|
|
228
228
|
|
|
229
229
|
// TODO: Check how this works with `children`. Will only be important for ED
|
|
230
|
-
return _jsxs(StyledFigure, {
|
|
230
|
+
return /*#__PURE__*/_jsxs(StyledFigure, {
|
|
231
231
|
float: figureProps?.float,
|
|
232
232
|
size: imageSizes ? "full" : figureProps?.size ?? "medium",
|
|
233
|
-
children: [children, _jsxs(ImageWrapper, {
|
|
233
|
+
children: [children, /*#__PURE__*/_jsxs(ImageWrapper, {
|
|
234
234
|
border: embedData.border === "true",
|
|
235
235
|
expandable: !!figureProps?.float,
|
|
236
|
-
children: [_jsx(Image, {
|
|
236
|
+
children: [/*#__PURE__*/_jsx(Image, {
|
|
237
237
|
focalPoint: focalPoint,
|
|
238
238
|
contentType: data.image.contentType,
|
|
239
239
|
crop: crop,
|
|
@@ -242,18 +242,18 @@ const ImageEmbed = _ref => {
|
|
|
242
242
|
src: data.image.imageUrl,
|
|
243
243
|
lang: lang,
|
|
244
244
|
onClick: figureProps?.float ? toggleImageSize : undefined
|
|
245
|
-
}), !!embedData.align && _jsx(ExpandButton, {
|
|
245
|
+
}), !!embedData.align && /*#__PURE__*/_jsx(ExpandButton, {
|
|
246
246
|
"aria-label": t(`license.images.itemImage.zoom${imageSizes ? "Out" : ""}ImageButtonLabel`),
|
|
247
247
|
onClick: toggleImageSize,
|
|
248
248
|
"data-expanded": !!imageSizes,
|
|
249
|
-
children: _jsx(Plus, {})
|
|
250
|
-
}), (embedData.size?.endsWith("-hide-byline") || embedData.hideByline === "true") && _jsx(BylineButton, {
|
|
249
|
+
children: /*#__PURE__*/_jsx(Plus, {})
|
|
250
|
+
}), (embedData.size?.endsWith("-hide-byline") || embedData.hideByline === "true") && /*#__PURE__*/_jsx(BylineButton, {
|
|
251
251
|
"data-byline-button": "",
|
|
252
252
|
"aria-label": t(`license.images.itemImage.${isBylineHidden ? "expandByline" : "minimizeByline"}`),
|
|
253
253
|
onClick: () => setIsBylineHidden(p => !p),
|
|
254
|
-
children: isBylineHidden ? _jsx(ChevronDown, {}) : _jsx(ChevronUp, {})
|
|
254
|
+
children: isBylineHidden ? /*#__PURE__*/_jsx(ChevronDown, {}) : /*#__PURE__*/_jsx(ChevronUp, {})
|
|
255
255
|
})]
|
|
256
|
-
}), isBylineHidden ? null : _jsx(EmbedByline, {
|
|
256
|
+
}), isBylineHidden ? null : /*#__PURE__*/_jsx(EmbedByline, {
|
|
257
257
|
type: "image",
|
|
258
258
|
copyright: data.copyright,
|
|
259
259
|
description: parsedDescription,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import { forwardRef, useCallback, useRef } from "react";
|
|
10
10
|
import { styled } from "@ndla/styled-system/jsx";
|
|
11
11
|
import { composeRefs } from "@ndla/util";
|
|
12
|
-
import { jsx as _jsx } from "
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
const StyledSpan = styled("span", {
|
|
14
14
|
base: {
|
|
15
15
|
position: "relative",
|
|
@@ -59,7 +59,7 @@ export const InlineTriggerButton = /*#__PURE__*/forwardRef((_ref, ref) => {
|
|
|
59
59
|
spanRef.current?.click();
|
|
60
60
|
}
|
|
61
61
|
}, []);
|
|
62
|
-
return _jsx(StyledSpan, {
|
|
62
|
+
return /*#__PURE__*/_jsx(StyledSpan, {
|
|
63
63
|
ref: composeRefs(spanRef, ref),
|
|
64
64
|
onKeyUp: onKeyboardEvent,
|
|
65
65
|
onClick: onClick,
|