@ndla/ui 56.0.123-alpha.0 → 56.0.124-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/Article/Article.js +122 -194
- package/es/Article/Article.js.map +1 -0
- package/es/Article/ArticleByline.js +121 -170
- package/es/Article/ArticleByline.js.map +1 -0
- package/es/Article/ArticleFootNotes.js +38 -58
- package/es/Article/ArticleFootNotes.js.map +1 -0
- package/es/AudioPlayer/AudioPlayer.js +151 -212
- package/es/AudioPlayer/AudioPlayer.js.map +1 -0
- package/es/AudioPlayer/Controls.js +246 -324
- package/es/AudioPlayer/Controls.js.map +1 -0
- package/es/AudioPlayer/SpeechControl.js +36 -52
- package/es/AudioPlayer/SpeechControl.js.map +1 -0
- package/es/AudioPlayer/index.js +7 -9
- package/es/AudioPlayer/index.js.map +1 -0
- package/es/Breadcrumb/Breadcrumb.js +42 -58
- package/es/Breadcrumb/Breadcrumb.js.map +1 -0
- package/es/Breadcrumb/BreadcrumbItem.js +33 -59
- package/es/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/es/Breadcrumb/HomeBreadcrumb.js +41 -74
- package/es/Breadcrumb/HomeBreadcrumb.js.map +1 -0
- package/es/Breadcrumb/index.js +8 -10
- package/es/Breadcrumb/index.js.map +1 -0
- package/es/CampaignBlock/CampaignBlock.js +124 -173
- package/es/CampaignBlock/CampaignBlock.js.map +1 -0
- package/es/CodeBlock/CodeBlock.js +21 -31
- package/es/CodeBlock/CodeBlock.js.map +1 -0
- package/es/CodeBlock/codeLanguageOptions.js +112 -82
- package/es/CodeBlock/codeLanguageOptions.js.map +1 -0
- package/es/Concept/Concept.js +46 -68
- package/es/Concept/Concept.js.map +1 -0
- package/es/ContactBlock/ContactBlock.js +137 -191
- package/es/ContactBlock/ContactBlock.js.map +1 -0
- package/es/ContentTypeBadge/ContentTypeBadge.js +38 -47
- package/es/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +21 -28
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +21 -28
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
- package/es/ContentTypeHero/ContentTypeHero.js +36 -47
- package/es/ContentTypeHero/ContentTypeHero.js.map +1 -0
- package/es/CopyParagraphButton/CopyParagraphButton.js +57 -78
- package/es/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
- package/es/CopyParagraphButton/index.js +7 -10
- package/es/CopyParagraphButton/index.js.map +1 -0
- package/es/Embed/AudioEmbed.js +49 -73
- package/es/Embed/AudioEmbed.js.map +1 -0
- package/es/Embed/BrightcoveEmbed.js +90 -127
- package/es/Embed/BrightcoveEmbed.js.map +1 -0
- package/es/Embed/CodeEmbed.js +55 -73
- package/es/Embed/CodeEmbed.js.map +1 -0
- package/es/Embed/ConceptEmbed.js +72 -117
- package/es/Embed/ConceptEmbed.js.map +1 -0
- package/es/Embed/ConceptInlineTriggerButton.js +39 -44
- package/es/Embed/ConceptInlineTriggerButton.js.map +1 -0
- package/es/Embed/ContentLinkEmbed.js +29 -49
- package/es/Embed/ContentLinkEmbed.js.map +1 -0
- package/es/Embed/CopyrightEmbed.js +21 -31
- package/es/Embed/CopyrightEmbed.js.map +1 -0
- package/es/Embed/EmbedErrorPlaceholder.js +40 -55
- package/es/Embed/EmbedErrorPlaceholder.js.map +1 -0
- package/es/Embed/EmbedWrapper.js +21 -46
- package/es/Embed/EmbedWrapper.js.map +1 -0
- package/es/Embed/ExternalEmbed.js +50 -70
- package/es/Embed/ExternalEmbed.js.map +1 -0
- package/es/Embed/FootnoteEmbed.js +25 -42
- package/es/Embed/FootnoteEmbed.js.map +1 -0
- package/es/Embed/GlossEmbed.js +49 -77
- package/es/Embed/GlossEmbed.js.map +1 -0
- package/es/Embed/H5pEmbed.js +35 -58
- package/es/Embed/H5pEmbed.js.map +1 -0
- package/es/Embed/IframeEmbed.js +65 -89
- package/es/Embed/IframeEmbed.js.map +1 -0
- package/es/Embed/ImageEmbed.js +167 -225
- package/es/Embed/ImageEmbed.js.map +1 -0
- package/es/Embed/InlineTriggerButton.js +20 -32
- package/es/Embed/InlineTriggerButton.js.map +1 -0
- package/es/Embed/RelatedContentEmbed.js +36 -53
- package/es/Embed/RelatedContentEmbed.js.map +1 -0
- package/es/Embed/UnknownEmbed.js +18 -29
- package/es/Embed/UnknownEmbed.js.map +1 -0
- package/es/Embed/UuDisclaimerEmbed.js +51 -85
- package/es/Embed/UuDisclaimerEmbed.js.map +1 -0
- package/es/ErrorMessage/ErrorMessage.js +51 -92
- package/es/ErrorMessage/ErrorMessage.js.map +1 -0
- package/es/ErrorMessage/index.js +7 -9
- package/es/ErrorMessage/index.js.map +1 -0
- package/es/FactBox/FactBox.js +114 -170
- package/es/FactBox/FactBox.js.map +1 -0
- package/es/FactBox/index.js +7 -9
- package/es/FactBox/index.js.map +1 -0
- package/es/FileList/File.js +70 -95
- package/es/FileList/File.js.map +1 -0
- package/es/FileList/FileList.js +31 -46
- package/es/FileList/FileList.js.map +1 -0
- package/es/FileList/PdfFile.js +27 -49
- package/es/FileList/PdfFile.js.map +1 -0
- package/es/Gloss/Gloss.js +133 -166
- package/es/Gloss/Gloss.js.map +1 -0
- package/es/Gloss/GlossExample.js +42 -60
- package/es/Gloss/GlossExample.js.map +1 -0
- package/es/Grid/Grid.js +63 -91
- package/es/Grid/Grid.js.map +1 -0
- package/es/Grid/GridParallaxItem.js +19 -30
- package/es/Grid/GridParallaxItem.js.map +1 -0
- package/es/KeyFigure/KeyFigure.js +44 -61
- package/es/KeyFigure/KeyFigure.js.map +1 -0
- package/es/LicenseByline/EmbedByline.js +126 -206
- package/es/LicenseByline/EmbedByline.js.map +1 -0
- package/es/LicenseByline/LicenseLink.js +28 -53
- package/es/LicenseByline/LicenseLink.js.map +1 -0
- package/es/LinkBlock/LinkBlock.js +70 -99
- package/es/LinkBlock/LinkBlock.js.map +1 -0
- package/es/LinkBlock/LinkBlockSection.js +20 -32
- package/es/LinkBlock/LinkBlockSection.js.map +1 -0
- package/es/Pitch/Pitch.js +59 -80
- package/es/Pitch/Pitch.js.map +1 -0
- package/es/RelatedArticleList/RelatedArticleList.js +91 -129
- package/es/RelatedArticleList/RelatedArticleList.js.map +1 -0
- package/es/RelatedArticleList/index.js +7 -10
- package/es/RelatedArticleList/index.js.map +1 -0
- package/es/ResourceBox/ResourceBox.js +71 -96
- package/es/ResourceBox/ResourceBox.js.map +1 -0
- package/es/TagSelector/TagSelector.js +93 -136
- package/es/TagSelector/TagSelector.js.map +1 -0
- package/es/ZendeskButton/ZendeskButton.js +38 -52
- package/es/ZendeskButton/ZendeskButton.js.map +1 -0
- package/es/_virtual/rolldown_runtime.js +11 -0
- package/es/i18n/formatNestedMessages.js +16 -24
- package/es/i18n/formatNestedMessages.js.map +1 -0
- package/es/i18n/i18n.js +25 -31
- package/es/i18n/i18n.js.map +1 -0
- package/es/i18n/useComponentTranslations.js +147 -203
- package/es/i18n/useComponentTranslations.js.map +1 -0
- package/es/index.js +64 -44
- package/es/locale/messages-en.js +435 -459
- package/es/locale/messages-en.js.map +1 -0
- package/es/locale/messages-nb.js +435 -459
- package/es/locale/messages-nb.js.map +1 -0
- package/es/locale/messages-nn.js +435 -459
- package/es/locale/messages-nn.js.map +1 -0
- package/es/locale/messages-se.js +435 -459
- package/es/locale/messages-se.js.map +1 -0
- package/es/model/ContentType.js +69 -65
- package/es/model/ContentType.js.map +1 -0
- package/es/model/SubjectCategories.js +23 -10
- package/es/model/SubjectCategories.js.map +1 -0
- package/es/model/SubjectTypes.js +21 -9
- package/es/model/SubjectTypes.js.map +1 -0
- package/es/model/WordClass.js +51 -43
- package/es/model/WordClass.js.map +1 -0
- package/es/model/index.js +16 -18
- package/es/model/index.js.map +1 -0
- package/es/utils/licenseAttributes.js +15 -17
- package/es/utils/licenseAttributes.js.map +1 -0
- package/es/utils/relativeUrl.js +21 -32
- package/es/utils/relativeUrl.js.map +1 -0
- package/lib/Article/Article.js +130 -203
- package/lib/Article/Article.js.map +1 -0
- package/lib/Article/ArticleByline.js +125 -179
- package/lib/Article/ArticleByline.js.map +1 -0
- package/lib/Article/ArticleFootNotes.js +39 -65
- package/lib/Article/ArticleFootNotes.js.map +1 -0
- package/lib/AudioPlayer/AudioPlayer.js +155 -221
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -0
- package/lib/AudioPlayer/Controls.js +249 -332
- package/lib/AudioPlayer/Controls.js.map +1 -0
- package/lib/AudioPlayer/SpeechControl.js +39 -60
- package/lib/AudioPlayer/SpeechControl.js.map +1 -0
- package/lib/AudioPlayer/index.js +7 -15
- package/lib/AudioPlayer/index.js.map +1 -0
- package/lib/Breadcrumb/Breadcrumb.js +43 -65
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -0
- package/lib/Breadcrumb/BreadcrumbItem.js +34 -65
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -0
- package/lib/Breadcrumb/HomeBreadcrumb.js +43 -82
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -0
- package/lib/Breadcrumb/index.js +8 -22
- package/lib/Breadcrumb/index.js.map +1 -0
- package/lib/CampaignBlock/CampaignBlock.js +128 -183
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -0
- package/lib/CodeBlock/CodeBlock.js +23 -38
- package/lib/CodeBlock/CodeBlock.js.map +1 -0
- package/lib/CodeBlock/codeLanguageOptions.js +112 -87
- package/lib/CodeBlock/codeLanguageOptions.js.map +1 -0
- package/lib/Concept/Concept.js +48 -75
- package/lib/Concept/Concept.js.map +1 -0
- package/lib/ContactBlock/ContactBlock.js +141 -200
- package/lib/ContactBlock/ContactBlock.js.map +1 -0
- package/lib/ContentTypeBadge/ContentTypeBadge.js +40 -54
- package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +23 -35
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +23 -35
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
- package/lib/ContentTypeHero/ContentTypeHero.js +37 -54
- package/lib/ContentTypeHero/ContentTypeHero.js.map +1 -0
- package/lib/CopyParagraphButton/CopyParagraphButton.js +61 -87
- package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
- package/lib/CopyParagraphButton/index.js +7 -21
- package/lib/CopyParagraphButton/index.js.map +1 -0
- package/lib/Embed/AudioEmbed.js +51 -82
- package/lib/Embed/AudioEmbed.js.map +1 -0
- package/lib/Embed/BrightcoveEmbed.js +93 -138
- package/lib/Embed/BrightcoveEmbed.js.map +1 -0
- package/lib/Embed/CodeEmbed.js +59 -83
- package/lib/Embed/CodeEmbed.js.map +1 -0
- package/lib/Embed/ConceptEmbed.js +77 -127
- package/lib/Embed/ConceptEmbed.js.map +1 -0
- package/lib/Embed/ConceptInlineTriggerButton.js +39 -49
- package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -0
- package/lib/Embed/ContentLinkEmbed.js +30 -55
- package/lib/Embed/ContentLinkEmbed.js.map +1 -0
- package/lib/Embed/CopyrightEmbed.js +22 -37
- package/lib/Embed/CopyrightEmbed.js.map +1 -0
- package/lib/Embed/EmbedErrorPlaceholder.js +42 -62
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -0
- package/lib/Embed/EmbedWrapper.js +24 -54
- package/lib/Embed/EmbedWrapper.js.map +1 -0
- package/lib/Embed/ExternalEmbed.js +53 -79
- package/lib/Embed/ExternalEmbed.js.map +1 -0
- package/lib/Embed/FootnoteEmbed.js +26 -48
- package/lib/Embed/FootnoteEmbed.js.map +1 -0
- package/lib/Embed/GlossEmbed.js +51 -86
- package/lib/Embed/GlossEmbed.js.map +1 -0
- package/lib/Embed/H5pEmbed.js +37 -66
- package/lib/Embed/H5pEmbed.js.map +1 -0
- package/lib/Embed/IframeEmbed.js +68 -98
- package/lib/Embed/IframeEmbed.js.map +1 -0
- package/lib/Embed/ImageEmbed.js +173 -238
- package/lib/Embed/ImageEmbed.js.map +1 -0
- package/lib/Embed/InlineTriggerButton.js +23 -40
- package/lib/Embed/InlineTriggerButton.js.map +1 -0
- package/lib/Embed/RelatedContentEmbed.js +37 -59
- package/lib/Embed/RelatedContentEmbed.js.map +1 -0
- package/lib/Embed/UnknownEmbed.js +19 -35
- package/lib/Embed/UnknownEmbed.js.map +1 -0
- package/lib/Embed/UuDisclaimerEmbed.js +53 -92
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -0
- package/lib/ErrorMessage/ErrorMessage.js +53 -99
- package/lib/ErrorMessage/ErrorMessage.js.map +1 -0
- package/lib/ErrorMessage/index.js +7 -15
- package/lib/ErrorMessage/index.js.map +1 -0
- package/lib/FactBox/FactBox.js +118 -180
- package/lib/FactBox/FactBox.js.map +1 -0
- package/lib/FactBox/index.js +7 -15
- package/lib/FactBox/index.js.map +1 -0
- package/lib/FileList/File.js +75 -105
- package/lib/FileList/File.js.map +1 -0
- package/lib/FileList/FileList.js +33 -52
- package/lib/FileList/FileList.js.map +1 -0
- package/lib/FileList/PdfFile.js +27 -55
- package/lib/FileList/PdfFile.js.map +1 -0
- package/lib/Gloss/Gloss.js +138 -176
- package/lib/Gloss/Gloss.js.map +1 -0
- package/lib/Gloss/GlossExample.js +45 -68
- package/lib/Gloss/GlossExample.js.map +1 -0
- package/lib/Grid/Grid.js +64 -98
- package/lib/Grid/Grid.js.map +1 -0
- package/lib/Grid/GridParallaxItem.js +19 -36
- package/lib/Grid/GridParallaxItem.js.map +1 -0
- package/lib/KeyFigure/KeyFigure.js +45 -68
- package/lib/KeyFigure/KeyFigure.js.map +1 -0
- package/lib/LicenseByline/EmbedByline.js +130 -216
- package/lib/LicenseByline/EmbedByline.js.map +1 -0
- package/lib/LicenseByline/LicenseLink.js +29 -59
- package/lib/LicenseByline/LicenseLink.js.map +1 -0
- package/lib/LinkBlock/LinkBlock.js +73 -108
- package/lib/LinkBlock/LinkBlock.js.map +1 -0
- package/lib/LinkBlock/LinkBlockSection.js +22 -39
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -0
- package/lib/Pitch/Pitch.js +61 -89
- package/lib/Pitch/Pitch.js.map +1 -0
- package/lib/RelatedArticleList/RelatedArticleList.js +96 -140
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -0
- package/lib/RelatedArticleList/index.js +7 -20
- package/lib/RelatedArticleList/index.js.map +1 -0
- package/lib/ResourceBox/ResourceBox.js +73 -104
- package/lib/ResourceBox/ResourceBox.js.map +1 -0
- package/lib/TagSelector/TagSelector.js +103 -145
- package/lib/TagSelector/TagSelector.js.map +1 -0
- package/lib/ZendeskButton/ZendeskButton.js +39 -58
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -0
- package/lib/_virtual/rolldown_runtime.js +42 -0
- package/lib/i18n/formatNestedMessages.js +16 -30
- package/lib/i18n/formatNestedMessages.js.map +1 -0
- package/lib/i18n/i18n.js +28 -38
- package/lib/i18n/i18n.js.map +1 -0
- package/lib/i18n/useComponentTranslations.js +154 -215
- package/lib/i18n/useComponentTranslations.js.map +1 -0
- package/lib/index.js +156 -598
- package/lib/locale/messages-en.js +436 -466
- package/lib/locale/messages-en.js.map +1 -0
- package/lib/locale/messages-nb.js +436 -466
- package/lib/locale/messages-nb.js.map +1 -0
- package/lib/locale/messages-nn.js +436 -466
- package/lib/locale/messages-nn.js.map +1 -0
- package/lib/locale/messages-se.js +436 -466
- package/lib/locale/messages-se.js.map +1 -0
- package/lib/model/ContentType.js +90 -70
- package/lib/model/ContentType.js.map +1 -0
- package/lib/model/SubjectCategories.js +26 -14
- package/lib/model/SubjectCategories.js.map +1 -0
- package/lib/model/SubjectTypes.js +24 -13
- package/lib/model/SubjectTypes.js.map +1 -0
- package/lib/model/WordClass.js +55 -48
- package/lib/model/WordClass.js.map +1 -0
- package/lib/model/index.js +16 -25
- package/lib/model/index.js.map +1 -0
- package/lib/utils/licenseAttributes.js +14 -22
- package/lib/utils/licenseAttributes.js.map +1 -0
- package/lib/utils/relativeUrl.js +20 -38
- package/lib/utils/relativeUrl.js.map +1 -0
- package/package.json +12 -11
- package/es/Article/index.js +0 -11
- package/es/CampaignBlock/index.js +0 -9
- package/es/CodeBlock/index.js +0 -10
- package/es/ContactBlock/index.js +0 -9
- package/es/ContentTypeHero/index.js +0 -9
- package/es/Embed/index.js +0 -25
- package/es/Embed/types.js +0 -1
- package/es/FileList/index.js +0 -11
- package/es/Gloss/index.js +0 -10
- package/es/Grid/index.js +0 -10
- package/es/KeyFigure/index.js +0 -9
- package/es/LicenseByline/index.js +0 -10
- package/es/LinkBlock/index.js +0 -10
- package/es/Pitch/index.js +0 -9
- package/es/ResourceBox/index.js +0 -10
- package/es/i18n/index.js +0 -11
- package/es/types.js +0 -1
- package/lib/Article/index.js +0 -68
- package/lib/CampaignBlock/index.js +0 -13
- package/lib/CodeBlock/index.js +0 -20
- package/lib/ContactBlock/index.js +0 -18
- package/lib/ContentTypeHero/index.js +0 -12
- package/lib/Embed/index.js +0 -150
- package/lib/Embed/types.js +0 -5
- package/lib/FileList/index.js +0 -44
- package/lib/Gloss/index.js +0 -20
- package/lib/Grid/index.js +0 -19
- package/lib/KeyFigure/index.js +0 -13
- package/lib/LicenseByline/index.js +0 -19
- package/lib/LinkBlock/index.js +0 -20
- package/lib/Pitch/index.js +0 -12
- package/lib/ResourceBox/index.js +0 -13
- package/lib/i18n/index.js +0 -68
- package/lib/types.js +0 -5
|
@@ -1,37 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
3
|
+
const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
|
|
4
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
2
5
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
14
|
-
* LICENSE file in the root directory of this source tree.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
const UnknownEmbed = _ref => {
|
|
19
|
-
let {
|
|
20
|
-
embed
|
|
21
|
-
} = _ref;
|
|
22
|
-
const {
|
|
23
|
-
t
|
|
24
|
-
} = (0, _reactI18next.useTranslation)();
|
|
25
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
|
|
26
|
-
color: "text.error",
|
|
27
|
-
asChild: true,
|
|
28
|
-
consumeCss: true,
|
|
29
|
-
"data-embed-type": "unknown",
|
|
30
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
|
|
31
|
-
children: t("embed.unsupported", {
|
|
32
|
-
type: embed.resource
|
|
33
|
-
})
|
|
34
|
-
})
|
|
35
|
-
});
|
|
6
|
+
//#region src/Embed/UnknownEmbed.tsx
|
|
7
|
+
const UnknownEmbed = ({ embed }) => {
|
|
8
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
9
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.Text, {
|
|
10
|
+
color: "text.error",
|
|
11
|
+
asChild: true,
|
|
12
|
+
consumeCss: true,
|
|
13
|
+
"data-embed-type": "unknown",
|
|
14
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("embed.unsupported", { type: embed.resource }) })
|
|
15
|
+
});
|
|
36
16
|
};
|
|
37
|
-
var
|
|
17
|
+
var UnknownEmbed_default = UnknownEmbed;
|
|
18
|
+
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.UnknownEmbed_default = UnknownEmbed_default;
|
|
21
|
+
//# sourceMappingURL=UnknownEmbed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnknownEmbed.js","names":["Text"],"sources":["../../src/Embed/UnknownEmbed.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { useTranslation } from \"react-i18next\";\nimport { Text } from \"@ndla/primitives\";\nimport type { MetaData } from \"@ndla/types-embed\";\n\ninterface Props {\n embed: MetaData<any, any>;\n}\n\nconst UnknownEmbed = ({ embed }: Props) => {\n const { t } = useTranslation();\n return (\n <Text color=\"text.error\" asChild consumeCss data-embed-type=\"unknown\">\n <span>{t(\"embed.unsupported\", { type: embed.resource })}</span>\n </Text>\n );\n};\n\nexport default UnknownEmbed;\n"],"mappings":";;;;;;AAgBA,MAAM,eAAe,CAAC,EAAE,OAAc,KAAK;CACzC,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,wBACE,2BAACA;EAAK,OAAM;EAAa;EAAQ;EAAW,mBAAgB;4BAC1D,2BAAC,oBAAM,EAAE,qBAAqB,EAAE,MAAM,MAAM,SAAU,EAAC,GAAQ;GAC1D;AAEV;AAED,2BAAe"}
|
|
@@ -1,94 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const react = require_rolldown_runtime.__toESM(require("react"));
|
|
3
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
4
|
+
const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
|
|
5
|
+
const react_i18next = require_rolldown_runtime.__toESM(require("react-i18next"));
|
|
6
|
+
const __ndla_icons = require_rolldown_runtime.__toESM(require("@ndla/icons"));
|
|
7
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
8
|
+
const __ark_ui_react = require_rolldown_runtime.__toESM(require("@ark-ui/react"));
|
|
2
9
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
maxHeight: "50vh",
|
|
44
|
-
overflowY: "auto"
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
const UuDisclaimerEmbed = _ref => {
|
|
48
|
-
let {
|
|
49
|
-
embed,
|
|
50
|
-
transformedDisclaimer,
|
|
51
|
-
children
|
|
52
|
-
} = _ref;
|
|
53
|
-
const {
|
|
54
|
-
t
|
|
55
|
-
} = (0, _reactI18next.useTranslation)();
|
|
56
|
-
if (embed.status === "error") {
|
|
57
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DisclaimerWrapper, {
|
|
58
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledErrorWarningFill, {
|
|
59
|
-
"aria-label": t("embed.embedError", {
|
|
60
|
-
type: t("embed.type.disclaimer")
|
|
61
|
-
}),
|
|
62
|
-
title: t("embed.embedError", {
|
|
63
|
-
type: t("embed.type.disclaimer")
|
|
64
|
-
})
|
|
65
|
-
}), children]
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(DisclaimerWrapper, {
|
|
69
|
-
role: "region",
|
|
70
|
-
"data-embed-type": "uu-disclaimer",
|
|
71
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.PopoverRoot, {
|
|
72
|
-
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.PopoverTrigger, {
|
|
73
|
-
asChild: true,
|
|
74
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
|
|
75
|
-
size: "small",
|
|
76
|
-
variant: "secondary",
|
|
77
|
-
"aria-label": t("uuDisclaimer.title"),
|
|
78
|
-
title: t("uuDisclaimer.title"),
|
|
79
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.AccessibilityFill, {})
|
|
80
|
-
})
|
|
81
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_react.Portal, {
|
|
82
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledPopoverContent, {
|
|
83
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
84
|
-
children: transformedDisclaimer
|
|
85
|
-
})
|
|
86
|
-
})
|
|
87
|
-
})]
|
|
88
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
|
|
89
|
-
"data-uu-content": "",
|
|
90
|
-
children: children
|
|
91
|
-
})]
|
|
92
|
-
});
|
|
10
|
+
//#region src/Embed/UuDisclaimerEmbed.tsx
|
|
11
|
+
const DisclaimerWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
flexDirection: "column",
|
|
14
|
+
gap: "3xsmall",
|
|
15
|
+
clear: "both"
|
|
16
|
+
} });
|
|
17
|
+
const StyledIconButton = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.IconButton, { base: { alignSelf: "flex-end" } });
|
|
18
|
+
const StyledErrorWarningFill = (0, __ndla_styled_system_jsx.styled)(__ndla_icons.ErrorWarningFill, { base: {
|
|
19
|
+
alignSelf: "flex-end",
|
|
20
|
+
fill: "icon.subtle"
|
|
21
|
+
} });
|
|
22
|
+
const StyledPopoverContent = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.PopoverContent, { base: {
|
|
23
|
+
width: "surface.xlarge",
|
|
24
|
+
maxHeight: "50vh",
|
|
25
|
+
overflowY: "auto"
|
|
26
|
+
} });
|
|
27
|
+
const UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }) => {
|
|
28
|
+
const { t } = (0, react_i18next.useTranslation)();
|
|
29
|
+
if (embed.status === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DisclaimerWrapper, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledErrorWarningFill, {
|
|
30
|
+
"aria-label": t("embed.embedError", { type: t("embed.type.disclaimer") }),
|
|
31
|
+
title: t("embed.embedError", { type: t("embed.type.disclaimer") })
|
|
32
|
+
}), children] });
|
|
33
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(DisclaimerWrapper, {
|
|
34
|
+
role: "region",
|
|
35
|
+
"data-embed-type": "uu-disclaimer",
|
|
36
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__ndla_primitives.PopoverRoot, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_primitives.PopoverTrigger, {
|
|
37
|
+
asChild: true,
|
|
38
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledIconButton, {
|
|
39
|
+
size: "small",
|
|
40
|
+
variant: "secondary",
|
|
41
|
+
"aria-label": t("uuDisclaimer.title"),
|
|
42
|
+
title: t("uuDisclaimer.title"),
|
|
43
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_icons.AccessibilityFill, {})
|
|
44
|
+
})
|
|
45
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ark_ui_react.Portal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(StyledPopoverContent, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: transformedDisclaimer }) }) })] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
46
|
+
"data-uu-content": "",
|
|
47
|
+
children
|
|
48
|
+
})]
|
|
49
|
+
});
|
|
93
50
|
};
|
|
94
|
-
var
|
|
51
|
+
var UuDisclaimerEmbed_default = UuDisclaimerEmbed;
|
|
52
|
+
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.UuDisclaimerEmbed_default = UuDisclaimerEmbed_default;
|
|
55
|
+
//# sourceMappingURL=UuDisclaimerEmbed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UuDisclaimerEmbed.js","names":["IconButton","ErrorWarningFill","PopoverContent","PopoverRoot","PopoverTrigger","AccessibilityFill","Portal"],"sources":["../../src/Embed/UuDisclaimerEmbed.tsx"],"sourcesContent":["/**\n * Copyright (c) 2024-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { Portal } from \"@ark-ui/react\";\nimport { AccessibilityFill, ErrorWarningFill } from \"@ndla/icons\";\nimport { IconButton, PopoverContent, PopoverRoot, PopoverTrigger } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { UuDisclaimerMetaData } from \"@ndla/types-embed\";\n\ninterface Props {\n embed: UuDisclaimerMetaData;\n transformedDisclaimer: ReactNode;\n children?: ReactNode;\n}\n\nconst DisclaimerWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"3xsmall\",\n clear: \"both\",\n },\n});\n\nconst StyledIconButton = styled(IconButton, {\n base: {\n alignSelf: \"flex-end\",\n },\n});\n\nconst StyledErrorWarningFill = styled(ErrorWarningFill, {\n base: {\n alignSelf: \"flex-end\",\n fill: \"icon.subtle\",\n },\n});\n\nconst StyledPopoverContent = styled(PopoverContent, {\n base: {\n width: \"surface.xlarge\",\n maxHeight: \"50vh\",\n overflowY: \"auto\",\n },\n});\n\nconst UuDisclaimerEmbed = ({ embed, transformedDisclaimer, children }: Props) => {\n const { t } = useTranslation();\n if (embed.status === \"error\") {\n return (\n <DisclaimerWrapper>\n <StyledErrorWarningFill\n aria-label={t(\"embed.embedError\", { type: t(\"embed.type.disclaimer\") })}\n title={t(\"embed.embedError\", { type: t(\"embed.type.disclaimer\") })}\n />\n {children}\n </DisclaimerWrapper>\n );\n }\n\n return (\n <DisclaimerWrapper role=\"region\" data-embed-type=\"uu-disclaimer\">\n <PopoverRoot>\n <PopoverTrigger asChild>\n <StyledIconButton\n size=\"small\"\n variant=\"secondary\"\n aria-label={t(\"uuDisclaimer.title\")}\n title={t(\"uuDisclaimer.title\")}\n >\n <AccessibilityFill />\n </StyledIconButton>\n </PopoverTrigger>\n <Portal>\n <StyledPopoverContent>\n <div>{transformedDisclaimer}</div>\n </StyledPopoverContent>\n </Portal>\n </PopoverRoot>\n <div data-uu-content=\"\">{children}</div>\n </DisclaimerWrapper>\n );\n};\n\nexport default UuDisclaimerEmbed;\n"],"mappings":";;;;;;;;;;AAsBA,MAAM,oBAAoB,qCAAO,OAAO,EACtC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,KAAK;CACL,OAAO;AACR,EACF,EAAC;AAEF,MAAM,mBAAmB,qCAAOA,8BAAY,EAC1C,MAAM,EACJ,WAAW,WACZ,EACF,EAAC;AAEF,MAAM,yBAAyB,qCAAOC,+BAAkB,EACtD,MAAM;CACJ,WAAW;CACX,MAAM;AACP,EACF,EAAC;AAEF,MAAM,uBAAuB,qCAAOC,kCAAgB,EAClD,MAAM;CACJ,OAAO;CACP,WAAW;CACX,WAAW;AACZ,EACF,EAAC;AAEF,MAAM,oBAAoB,CAAC,EAAE,OAAO,uBAAuB,UAAiB,KAAK;CAC/E,MAAM,EAAE,GAAG,GAAG,mCAAgB;AAC9B,KAAI,MAAM,WAAW,QACnB,wBACE,4BAAC,gDACC,2BAAC;EACC,cAAY,EAAE,oBAAoB,EAAE,MAAM,EAAE,wBAAwB,CAAE,EAAC;EACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,EAAE,wBAAwB,CAAE,EAAC;GAClE,EACD,YACiB;AAIxB,wBACE,4BAAC;EAAkB,MAAK;EAAS,mBAAgB;6BAC/C,4BAACC,4DACC,2BAACC;GAAe;6BACd,2BAAC;IACC,MAAK;IACL,SAAQ;IACR,cAAY,EAAE,qBAAqB;IACnC,OAAO,EAAE,qBAAqB;8BAE9B,2BAACC,mCAAoB;KACJ;IACJ,kBACjB,2BAACC,mDACC,2BAAC,kDACC,2BAAC,mBAAK,wBAA4B,GACb,GAChB,IACG,kBACd,2BAAC;GAAI,mBAAgB;GAAI;IAAe;GACtB;AAEvB;AAED,gCAAe"}
|
|
@@ -1,101 +1,55 @@
|
|
|
1
|
-
|
|
1
|
+
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
+
const react = require_rolldown_runtime.__toESM(require("react"));
|
|
3
|
+
const __ndla_primitives = require_rolldown_runtime.__toESM(require("@ndla/primitives"));
|
|
4
|
+
const __ndla_styled_system_jsx = require_rolldown_runtime.__toESM(require("@ndla/styled-system/jsx"));
|
|
5
|
+
const __ndla_safelink = require_rolldown_runtime.__toESM(require("@ndla/safelink"));
|
|
6
|
+
const react_jsx_runtime = require_rolldown_runtime.__toESM(require("react/jsx-runtime"));
|
|
2
7
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
8
|
+
//#region src/ErrorMessage/ErrorMessage.tsx
|
|
9
|
+
const StyledErrorMessage = (0, __ndla_styled_system_jsx.styled)("article", { base: {
|
|
10
|
+
textAlign: "center",
|
|
11
|
+
"& a": { color: "text.strong" },
|
|
12
|
+
"& h1": { marginTop: "0" }
|
|
13
|
+
} });
|
|
14
|
+
const IllustrationWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: {
|
|
15
|
+
display: "flex",
|
|
16
|
+
justifyContent: "center",
|
|
17
|
+
marginBottom: "medium",
|
|
18
|
+
tablet: { marginTop: "xxlarge" }
|
|
19
|
+
} });
|
|
20
|
+
const Description = (0, __ndla_styled_system_jsx.styled)(__ndla_primitives.Text, { base: {
|
|
21
|
+
marginBottom: "medium",
|
|
22
|
+
tablet: { marginBottom: "xxlarge" }
|
|
23
|
+
} });
|
|
24
|
+
const CustomElementWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginBlock: "xxlarge" } });
|
|
25
|
+
const MessageWrapper = (0, __ndla_styled_system_jsx.styled)("div", { base: { marginTop: "3xsmall" } });
|
|
26
|
+
const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(StyledErrorMessage, { children: [
|
|
27
|
+
!!illustration && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
|
|
28
|
+
src: illustration.url,
|
|
29
|
+
alt: illustration.altText
|
|
30
|
+
}) }),
|
|
31
|
+
!!illustrationElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IllustrationWrapper, { children: illustrationElement }),
|
|
32
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h1", { children: messages.title }),
|
|
33
|
+
!!messages.description && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Description, { children: messages.description }),
|
|
34
|
+
!!customElement && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomElementWrapper, { children: customElement }),
|
|
35
|
+
!!messages.linksTitle && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", { children: messages.linksTitle }),
|
|
36
|
+
!!messages.back && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
|
|
37
|
+
to: `/#${encodeURI(messages.back)}`,
|
|
38
|
+
onClick: () => window.history.back(),
|
|
39
|
+
children: messages.back
|
|
40
|
+
}),
|
|
41
|
+
!!messages.goToFrontPage && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
|
|
42
|
+
to: "/",
|
|
43
|
+
children: messages.goToFrontPage
|
|
44
|
+
}) }),
|
|
45
|
+
!!messages.logInFailed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MessageWrapper, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__ndla_safelink.SafeLink, {
|
|
46
|
+
to: "/minndla",
|
|
47
|
+
children: messages.logInFailed
|
|
48
|
+
}) }),
|
|
49
|
+
children
|
|
50
|
+
] });
|
|
51
|
+
var ErrorMessage_default = ErrorMessage;
|
|
18
52
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
textAlign: "center",
|
|
23
|
-
"& a": {
|
|
24
|
-
color: "text.strong"
|
|
25
|
-
},
|
|
26
|
-
"& h1": {
|
|
27
|
-
marginTop: "0"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
const IllustrationWrapper = (0, _jsx2.styled)("div", {
|
|
32
|
-
base: {
|
|
33
|
-
display: "flex",
|
|
34
|
-
justifyContent: "center",
|
|
35
|
-
marginBottom: "medium",
|
|
36
|
-
tablet: {
|
|
37
|
-
marginTop: "xxlarge"
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
const Description = (0, _jsx2.styled)(_primitives.Text, {
|
|
42
|
-
base: {
|
|
43
|
-
marginBottom: "medium",
|
|
44
|
-
tablet: {
|
|
45
|
-
marginBottom: "xxlarge"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
});
|
|
49
|
-
const CustomElementWrapper = (0, _jsx2.styled)("div", {
|
|
50
|
-
base: {
|
|
51
|
-
marginBlock: "xxlarge"
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
const MessageWrapper = (0, _jsx2.styled)("div", {
|
|
55
|
-
base: {
|
|
56
|
-
marginTop: "3xsmall"
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
const ErrorMessage = _ref => {
|
|
60
|
-
let {
|
|
61
|
-
children,
|
|
62
|
-
messages,
|
|
63
|
-
illustration,
|
|
64
|
-
illustrationElement,
|
|
65
|
-
customElement
|
|
66
|
-
} = _ref;
|
|
67
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledErrorMessage, {
|
|
68
|
-
children: [!!illustration && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
69
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)("img", {
|
|
70
|
-
src: illustration.url,
|
|
71
|
-
alt: illustration.altText
|
|
72
|
-
})
|
|
73
|
-
}), !!illustrationElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(IllustrationWrapper, {
|
|
74
|
-
children: illustrationElement
|
|
75
|
-
}), /*#__PURE__*/(0, _jsxRuntime.jsx)("h1", {
|
|
76
|
-
children: messages.title
|
|
77
|
-
}), !!messages.description && /*#__PURE__*/(0, _jsxRuntime.jsx)(Description, {
|
|
78
|
-
children: messages.description
|
|
79
|
-
}), !!customElement && /*#__PURE__*/(0, _jsxRuntime.jsx)(CustomElementWrapper, {
|
|
80
|
-
children: customElement
|
|
81
|
-
}), !!messages.linksTitle && /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
|
|
82
|
-
children: messages.linksTitle
|
|
83
|
-
}), !!messages.back && /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
84
|
-
to: `/#${encodeURI(messages.back)}`,
|
|
85
|
-
onClick: () => window.history.back(),
|
|
86
|
-
children: messages.back
|
|
87
|
-
}), !!messages.goToFrontPage && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
88
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
89
|
-
to: "/",
|
|
90
|
-
children: messages.goToFrontPage
|
|
91
|
-
})
|
|
92
|
-
}), !!messages.logInFailed && /*#__PURE__*/(0, _jsxRuntime.jsx)(MessageWrapper, {
|
|
93
|
-
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_safelink.SafeLink, {
|
|
94
|
-
to: "/minndla",
|
|
95
|
-
children: messages.logInFailed
|
|
96
|
-
})
|
|
97
|
-
}), children]
|
|
98
|
-
});
|
|
99
|
-
};
|
|
100
|
-
exports.ErrorMessage = ErrorMessage;
|
|
101
|
-
var _default = exports.default = ErrorMessage;
|
|
53
|
+
//#endregion
|
|
54
|
+
exports.ErrorMessage_default = ErrorMessage_default;
|
|
55
|
+
//# sourceMappingURL=ErrorMessage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ErrorMessage.js","names":["Text","SafeLink"],"sources":["../../src/ErrorMessage/ErrorMessage.tsx"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode } from \"react\";\nimport { Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\n// TODO: This has not been redesignet yet. This is just a rewrite of the previous design in panda\n\nconst StyledErrorMessage = styled(\"article\", {\n base: {\n textAlign: \"center\",\n \"& a\": {\n color: \"text.strong\",\n },\n \"& h1\": {\n marginTop: \"0\",\n },\n },\n});\n\nconst IllustrationWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n justifyContent: \"center\",\n marginBottom: \"medium\",\n tablet: {\n marginTop: \"xxlarge\",\n },\n },\n});\n\nconst Description = styled(Text, {\n base: {\n marginBottom: \"medium\",\n tablet: {\n marginBottom: \"xxlarge\",\n },\n },\n});\n\nconst CustomElementWrapper = styled(\"div\", {\n base: {\n marginBlock: \"xxlarge\",\n },\n});\n\nconst MessageWrapper = styled(\"div\", {\n base: {\n marginTop: \"3xsmall\",\n },\n});\n\ninterface Props {\n messages: {\n title: string;\n description?: string;\n linksTitle?: string;\n back?: string;\n goToFrontPage?: string;\n logInFailed?: string;\n };\n illustration?: {\n url: string;\n altText: string;\n };\n illustrationElement?: ReactNode;\n customElement?: ReactNode;\n children?: ReactNode;\n}\nexport const ErrorMessage = ({ children, messages, illustration, illustrationElement, customElement }: Props) => (\n <StyledErrorMessage>\n {!!illustration && (\n <IllustrationWrapper>\n <img src={illustration.url} alt={illustration.altText} />\n </IllustrationWrapper>\n )}\n {!!illustrationElement && <IllustrationWrapper>{illustrationElement}</IllustrationWrapper>}\n <h1>{messages.title}</h1>\n {!!messages.description && <Description>{messages.description}</Description>}\n {!!customElement && <CustomElementWrapper>{customElement}</CustomElementWrapper>}\n {!!messages.linksTitle && <h2>{messages.linksTitle}</h2>}\n {!!messages.back && (\n <SafeLink to={`/#${encodeURI(messages.back)}`} onClick={() => window.history.back()}>\n {messages.back}\n </SafeLink>\n )}\n {!!messages.goToFrontPage && (\n <MessageWrapper>\n <SafeLink to=\"/\">{messages.goToFrontPage}</SafeLink>\n </MessageWrapper>\n )}\n {!!messages.logInFailed && (\n <MessageWrapper>\n <SafeLink to=\"/minndla\">{messages.logInFailed}</SafeLink>\n </MessageWrapper>\n )}\n {children}\n </StyledErrorMessage>\n);\n\nexport default ErrorMessage;\n"],"mappings":";;;;;;;;AAeA,MAAM,qBAAqB,qCAAO,WAAW,EAC3C,MAAM;CACJ,WAAW;CACX,OAAO,EACL,OAAO,cACR;CACD,QAAQ,EACN,WAAW,IACZ;AACF,EACF,EAAC;AAEF,MAAM,sBAAsB,qCAAO,OAAO,EACxC,MAAM;CACJ,SAAS;CACT,gBAAgB;CAChB,cAAc;CACd,QAAQ,EACN,WAAW,UACZ;AACF,EACF,EAAC;AAEF,MAAM,cAAc,qCAAOA,wBAAM,EAC/B,MAAM;CACJ,cAAc;CACd,QAAQ,EACN,cAAc,UACf;AACF,EACF,EAAC;AAEF,MAAM,uBAAuB,qCAAO,OAAO,EACzC,MAAM,EACJ,aAAa,UACd,EACF,EAAC;AAEF,MAAM,iBAAiB,qCAAO,OAAO,EACnC,MAAM,EACJ,WAAW,UACZ,EACF,EAAC;AAmBF,MAAa,eAAe,CAAC,EAAE,UAAU,UAAU,cAAc,qBAAqB,eAAsB,qBAC1G,4BAAC;GACI,gCACD,2BAAC,iDACC,2BAAC;EAAI,KAAK,aAAa;EAAK,KAAK,aAAa;GAAW,GACrC;GAErB,uCAAuB,2BAAC,iCAAqB,sBAA0C;iBAC1F,2BAAC,kBAAI,SAAS,QAAW;GACtB,SAAS,+BAAe,2BAAC,yBAAa,SAAS,cAA0B;GACzE,iCAAiB,2BAAC,kCAAsB,gBAAqC;GAC7E,SAAS,8BAAc,2BAAC,kBAAI,SAAS,aAAgB;GACrD,SAAS,wBACV,2BAACC;EAAS,KAAK,IAAI,UAAU,SAAS,KAAK,CAAC;EAAG,SAAS,MAAM,OAAO,QAAQ,MAAM;YAChF,SAAS;GACD;GAEV,SAAS,iCACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAK,SAAS;GAAyB,GACrC;GAEhB,SAAS,+BACV,2BAAC,4CACC,2BAACA;EAAS,IAAG;YAAY,SAAS;GAAuB,GAC1C;CAElB;IACkB;AAGvB,2BAAe"}
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
const require_ErrorMessage = require('./ErrorMessage.js');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Copyright (c) 2019-present, NDLA.
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
var _default = exports.default = _ErrorMessage.default;
|
|
3
|
+
//#region src/ErrorMessage/index.ts
|
|
4
|
+
var ErrorMessage_default$1 = require_ErrorMessage.ErrorMessage_default;
|
|
5
|
+
|
|
6
|
+
//#endregion
|
|
7
|
+
exports.ErrorMessage_default = ErrorMessage_default$1;
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["ErrorMessage"],"sources":["../../src/ErrorMessage/index.ts"],"sourcesContent":["/**\n * Copyright (c) 2019-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport ErrorMessage from \"./ErrorMessage\";\n\nexport default ErrorMessage;\n"],"mappings":";;;AAUA,6BAAeA"}
|