@ndla/ui 56.0.142-alpha.0 → 56.0.143-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 +2 -3
- package/dist/styles.css +5 -9
- package/es/Article/Article.mjs +10 -12
- package/es/Article/Article.mjs.map +1 -1
- package/es/Article/ArticleByline.mjs.map +1 -1
- package/es/Article/ArticleFootNotes.mjs.map +1 -1
- package/es/AudioPlayer/AudioPlayer.mjs +3 -3
- package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
- package/es/AudioPlayer/Controls.mjs +1 -1
- package/es/AudioPlayer/Controls.mjs.map +1 -1
- package/es/AudioPlayer/SpeechControl.mjs +1 -1
- package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
- package/es/Breadcrumb/Breadcrumb.mjs +2 -2
- package/es/Breadcrumb/Breadcrumb.mjs.map +1 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs +1 -1
- package/es/Breadcrumb/BreadcrumbItem.mjs.map +1 -1
- package/es/Breadcrumb/HomeBreadcrumb.mjs +2 -2
- package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
- package/es/CampaignBlock/CampaignBlock.mjs +1 -1
- package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
- package/es/CodeBlock/CodeBlock.mjs +1 -1
- package/es/CodeBlock/CodeBlock.mjs.map +1 -1
- package/es/CodeBlock/codeLanguageOptions.mjs.map +1 -1
- package/es/Concept/Concept.mjs +5 -5
- package/es/Concept/Concept.mjs.map +1 -1
- package/es/ContactBlock/ContactBlock.mjs.map +1 -1
- package/es/ContentTypeBadge/ContentTypeBadge.mjs.map +1 -1
- package/es/CopyParagraphButton/CopyParagraphButton.mjs +1 -1
- package/es/CopyParagraphButton/CopyParagraphButton.mjs.map +1 -1
- package/es/Embed/AudioEmbed.mjs +3 -3
- package/es/Embed/AudioEmbed.mjs.map +1 -1
- package/es/Embed/BrightcoveEmbed.mjs +2 -2
- package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
- package/es/Embed/CodeEmbed.mjs +3 -4
- package/es/Embed/CodeEmbed.mjs.map +1 -1
- package/es/Embed/ConceptEmbed.mjs +2 -2
- package/es/Embed/ConceptEmbed.mjs.map +1 -1
- package/es/Embed/ConceptInlineTriggerButton.mjs.map +1 -1
- package/es/Embed/ContentLinkEmbed.mjs +1 -1
- package/es/Embed/ContentLinkEmbed.mjs.map +1 -1
- package/es/Embed/CopyrightEmbed.mjs +1 -1
- package/es/Embed/CopyrightEmbed.mjs.map +1 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs +1 -1
- package/es/Embed/EmbedErrorPlaceholder.mjs.map +1 -1
- package/es/Embed/EmbedWrapper.mjs.map +1 -1
- package/es/Embed/ExternalEmbed.mjs +3 -3
- package/es/Embed/ExternalEmbed.mjs.map +1 -1
- package/es/Embed/FootnoteEmbed.mjs +1 -1
- package/es/Embed/FootnoteEmbed.mjs.map +1 -1
- package/es/Embed/GlossEmbed.mjs +2 -2
- package/es/Embed/GlossEmbed.mjs.map +1 -1
- package/es/Embed/H5pEmbed.mjs +2 -2
- package/es/Embed/H5pEmbed.mjs.map +1 -1
- package/es/Embed/IframeEmbed.mjs +3 -3
- package/es/Embed/IframeEmbed.mjs.map +1 -1
- package/es/Embed/ImageEmbed.mjs +2 -4
- package/es/Embed/ImageEmbed.mjs.map +1 -1
- package/es/Embed/InlineTriggerButton.mjs.map +1 -1
- package/es/Embed/RelatedContentEmbed.mjs +2 -3
- package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
- package/es/Embed/UnknownEmbed.mjs +1 -1
- package/es/Embed/UnknownEmbed.mjs.map +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs +1 -1
- package/es/Embed/UuDisclaimerEmbed.mjs.map +1 -1
- package/es/FactBox/FactBox.mjs +1 -1
- package/es/FactBox/FactBox.mjs.map +1 -1
- package/es/FileList/File.mjs +34 -30
- package/es/FileList/File.mjs.map +1 -1
- package/es/FileList/FileList.mjs.map +1 -1
- package/es/FileList/PdfFile.mjs.map +1 -1
- package/es/Gloss/Gloss.mjs +5 -7
- package/es/Gloss/Gloss.mjs.map +1 -1
- package/es/Gloss/GlossExample.mjs +1 -1
- package/es/Gloss/GlossExample.mjs.map +1 -1
- package/es/Grid/Grid.mjs.map +1 -1
- package/es/Grid/GridParallaxItem.mjs.map +1 -1
- package/es/KeyFigure/KeyFigure.mjs +1 -1
- package/es/KeyFigure/KeyFigure.mjs.map +1 -1
- package/es/LicenseByline/EmbedByline.mjs +1 -2
- package/es/LicenseByline/EmbedByline.mjs.map +1 -1
- package/es/LicenseByline/LicenseLink.mjs.map +1 -1
- package/es/LinkBlock/LinkBlock.mjs +1 -1
- package/es/LinkBlock/LinkBlock.mjs.map +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs +1 -1
- package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
- package/es/Pitch/Pitch.mjs.map +1 -1
- package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
- package/es/ResourceBox/ResourceBox.mjs +1 -1
- package/es/ResourceBox/ResourceBox.mjs.map +1 -1
- package/es/TagSelector/TagSelector.mjs.map +1 -1
- package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
- package/es/_virtual/rolldown_runtime.mjs +3 -1
- package/es/i18n/formatNestedMessages.mjs.map +1 -1
- package/es/i18n/useComponentTranslations.mjs +1 -2
- package/es/i18n/useComponentTranslations.mjs.map +1 -1
- package/es/index.mjs +34 -38
- package/es/locale/messages-en.mjs +2 -2
- package/es/locale/messages-en.mjs.map +1 -1
- package/es/locale/messages-nb.mjs +2 -2
- package/es/locale/messages-nb.mjs.map +1 -1
- package/es/locale/messages-nn.mjs +2 -2
- package/es/locale/messages-nn.mjs.map +1 -1
- package/es/locale/messages-se.mjs +2 -2
- package/es/locale/messages-se.mjs.map +1 -1
- package/es/model/ContentType.mjs.map +1 -1
- package/es/model/SubjectCategories.mjs +1 -2
- package/es/model/SubjectCategories.mjs.map +1 -1
- package/es/model/SubjectTypes.mjs +1 -2
- package/es/model/SubjectTypes.mjs.map +1 -1
- package/es/model/WordClass.mjs +1 -2
- package/es/model/WordClass.mjs.map +1 -1
- package/es/model/index.mjs +1 -1
- package/es/model/index.mjs.map +1 -1
- package/es/utils/licenseAttributes.mjs +1 -2
- package/es/utils/licenseAttributes.mjs.map +1 -1
- package/es/utils/relativeUrl.mjs.map +1 -1
- package/lib/Article/Article.js +24 -20
- package/lib/Article/Article.js.map +1 -1
- package/lib/Article/ArticleByline.js +18 -10
- package/lib/Article/ArticleByline.js.map +1 -1
- package/lib/Article/ArticleFootNotes.js +6 -3
- package/lib/Article/ArticleFootNotes.js.map +1 -1
- package/lib/AudioPlayer/AudioPlayer.js +17 -11
- package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
- package/lib/AudioPlayer/Controls.js +15 -8
- package/lib/AudioPlayer/Controls.js.map +1 -1
- package/lib/AudioPlayer/SpeechControl.js +11 -6
- package/lib/AudioPlayer/SpeechControl.js.map +1 -1
- package/lib/Breadcrumb/Breadcrumb.js +11 -7
- package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
- package/lib/Breadcrumb/BreadcrumbItem.js +11 -6
- package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
- package/lib/Breadcrumb/HomeBreadcrumb.js +11 -7
- package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
- package/lib/CampaignBlock/CampaignBlock.js +17 -10
- package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
- package/lib/CodeBlock/CodeBlock.js +9 -5
- package/lib/CodeBlock/CodeBlock.js.map +1 -1
- package/lib/CodeBlock/codeLanguageOptions.js.map +1 -1
- package/lib/Concept/Concept.js +19 -15
- package/lib/Concept/Concept.js.map +1 -1
- package/lib/ContactBlock/ContactBlock.js +10 -6
- package/lib/ContactBlock/ContactBlock.js.map +1 -1
- package/lib/ContentTypeBadge/ContentTypeBadge.js +28 -24
- package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -1
- package/lib/CopyParagraphButton/CopyParagraphButton.js +13 -7
- package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -1
- package/lib/Embed/AudioEmbed.js +16 -13
- package/lib/Embed/AudioEmbed.js.map +1 -1
- package/lib/Embed/BrightcoveEmbed.js +19 -13
- package/lib/Embed/BrightcoveEmbed.js.map +1 -1
- package/lib/Embed/CodeEmbed.js +19 -14
- package/lib/Embed/CodeEmbed.js.map +1 -1
- package/lib/Embed/ConceptEmbed.js +21 -15
- package/lib/Embed/ConceptEmbed.js.map +1 -1
- package/lib/Embed/ConceptInlineTriggerButton.js +4 -3
- package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -1
- package/lib/Embed/ContentLinkEmbed.js +7 -4
- package/lib/Embed/ContentLinkEmbed.js.map +1 -1
- package/lib/Embed/CopyrightEmbed.js +7 -5
- package/lib/Embed/CopyrightEmbed.js.map +1 -1
- package/lib/Embed/EmbedErrorPlaceholder.js +13 -8
- package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
- package/lib/Embed/EmbedWrapper.js +10 -5
- package/lib/Embed/EmbedWrapper.js.map +1 -1
- package/lib/Embed/ExternalEmbed.js +15 -10
- package/lib/Embed/ExternalEmbed.js.map +1 -1
- package/lib/Embed/FootnoteEmbed.js +7 -4
- package/lib/Embed/FootnoteEmbed.js.map +1 -1
- package/lib/Embed/GlossEmbed.js +17 -12
- package/lib/Embed/GlossEmbed.js.map +1 -1
- package/lib/Embed/H5pEmbed.js +11 -7
- package/lib/Embed/H5pEmbed.js.map +1 -1
- package/lib/Embed/IframeEmbed.js +15 -10
- package/lib/Embed/IframeEmbed.js.map +1 -1
- package/lib/Embed/ImageEmbed.js +21 -16
- package/lib/Embed/ImageEmbed.js.map +1 -1
- package/lib/Embed/InlineTriggerButton.js +8 -4
- package/lib/Embed/InlineTriggerButton.js.map +1 -1
- package/lib/Embed/RelatedContentEmbed.js +12 -11
- package/lib/Embed/RelatedContentEmbed.js.map +1 -1
- package/lib/Embed/UnknownEmbed.js +7 -4
- package/lib/Embed/UnknownEmbed.js.map +1 -1
- package/lib/Embed/UuDisclaimerEmbed.js +15 -8
- package/lib/Embed/UuDisclaimerEmbed.js.map +1 -1
- package/lib/FactBox/FactBox.js +13 -7
- package/lib/FactBox/FactBox.js.map +1 -1
- package/lib/FileList/File.js +51 -39
- package/lib/FileList/File.js.map +1 -1
- package/lib/FileList/FileList.js +8 -4
- package/lib/FileList/FileList.js.map +1 -1
- package/lib/FileList/PdfFile.js +6 -3
- package/lib/FileList/PdfFile.js.map +1 -1
- package/lib/Gloss/Gloss.js +23 -17
- package/lib/Gloss/Gloss.js.map +1 -1
- package/lib/Gloss/GlossExample.js +9 -5
- package/lib/Gloss/GlossExample.js.map +1 -1
- package/lib/Grid/Grid.js +6 -3
- package/lib/Grid/Grid.js.map +1 -1
- package/lib/Grid/GridParallaxItem.js +6 -3
- package/lib/Grid/GridParallaxItem.js.map +1 -1
- package/lib/KeyFigure/KeyFigure.js +7 -4
- package/lib/KeyFigure/KeyFigure.js.map +1 -1
- package/lib/LicenseByline/EmbedByline.js +17 -11
- package/lib/LicenseByline/EmbedByline.js.map +1 -1
- package/lib/LicenseByline/LicenseLink.js +8 -4
- package/lib/LicenseByline/LicenseLink.js.map +1 -1
- package/lib/LinkBlock/LinkBlock.js +17 -10
- package/lib/LinkBlock/LinkBlock.js.map +1 -1
- package/lib/LinkBlock/LinkBlockSection.js +7 -4
- package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
- package/lib/Pitch/Pitch.js +14 -8
- package/lib/Pitch/Pitch.js.map +1 -1
- package/lib/RelatedArticleList/RelatedArticleList.js +20 -12
- package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
- package/lib/ResourceBox/ResourceBox.js +14 -7
- package/lib/ResourceBox/ResourceBox.js.map +1 -1
- package/lib/TagSelector/TagSelector.js +12 -6
- package/lib/TagSelector/TagSelector.js.map +1 -1
- package/lib/ZendeskButton/ZendeskButton.js +6 -3
- package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
- package/lib/_virtual/rolldown_runtime.js +5 -13
- package/lib/i18n/formatNestedMessages.js.map +1 -1
- package/lib/i18n/useComponentTranslations.js +5 -4
- package/lib/i18n/useComponentTranslations.js.map +1 -1
- package/lib/index.d.ts +51 -30
- package/lib/index.js +145 -152
- package/lib/locale/messages-en.js +5 -4
- package/lib/locale/messages-en.js.map +1 -1
- package/lib/locale/messages-nb.js +5 -4
- package/lib/locale/messages-nb.js.map +1 -1
- package/lib/locale/messages-nn.js +5 -4
- package/lib/locale/messages-nn.js.map +1 -1
- package/lib/locale/messages-se.js +5 -4
- package/lib/locale/messages-se.js.map +1 -1
- package/lib/model/ContentType.js.map +1 -1
- package/lib/model/SubjectCategories.js +1 -2
- package/lib/model/SubjectCategories.js.map +1 -1
- package/lib/model/SubjectTypes.js +1 -2
- package/lib/model/SubjectTypes.js.map +1 -1
- package/lib/model/WordClass.js +1 -2
- package/lib/model/WordClass.js.map +1 -1
- package/lib/model/index.js +11 -11
- package/lib/model/index.js.map +1 -1
- package/lib/utils/licenseAttributes.js +3 -3
- package/lib/utils/licenseAttributes.js.map +1 -1
- package/lib/utils/relativeUrl.js.map +1 -1
- package/package.json +8 -8
- package/src/Article/Article.tsx +8 -4
- package/src/Concept/Concept.tsx +5 -1
- package/src/Embed/AudioEmbed.stories.tsx +1 -1
- package/src/Embed/AudioEmbed.tsx +2 -2
- package/src/Embed/BrightcoveEmbed.stories.tsx +1 -1
- package/src/Embed/BrightcoveEmbed.tsx +1 -1
- package/src/Embed/CodeEmbed.tsx +2 -2
- package/src/Embed/ConceptEmbed.stories.tsx +1 -1
- package/src/Embed/CopyrightEmbed.tsx +1 -1
- package/src/Embed/EmbedErrorPlaceholder.tsx +1 -2
- package/src/Embed/ExternalEmbed.stories.tsx +1 -1
- package/src/Embed/ExternalEmbed.tsx +1 -1
- package/src/Embed/FootnoteEmbed.stories.tsx +1 -1
- package/src/Embed/GlossEmbed.tsx +1 -1
- package/src/Embed/H5pEmbed.stories.tsx +1 -1
- package/src/Embed/IframeEmbed.stories.tsx +1 -1
- package/src/Embed/IframeEmbed.tsx +1 -1
- package/src/Embed/ImageEmbed.stories.tsx +2 -2
- package/src/Embed/ImageEmbed.tsx +1 -1
- package/src/Embed/RelatedContentEmbed.stories.tsx +2 -2
- package/src/Embed/UuDisclaimerEmbed.stories.tsx +3 -3
- package/src/FileList/File.tsx +18 -7
- package/src/LinkBlock/LinkBlock.stories.tsx +1 -1
- package/src/Pitch/Pitch.stories.tsx +2 -2
- package/src/index.ts +53 -61
- package/es/AudioPlayer/index.mjs +0 -8
- package/es/AudioPlayer/index.mjs.map +0 -1
- package/es/Breadcrumb/index.mjs +0 -9
- package/es/Breadcrumb/index.mjs.map +0 -1
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.mjs +0 -25
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.mjs.map +0 -1
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.mjs +0 -25
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.mjs.map +0 -1
- package/es/ContentTypeHero/ContentTypeHero.mjs +0 -39
- package/es/ContentTypeHero/ContentTypeHero.mjs.map +0 -1
- package/es/CopyParagraphButton/index.mjs +0 -8
- package/es/CopyParagraphButton/index.mjs.map +0 -1
- package/es/FactBox/index.mjs +0 -8
- package/es/FactBox/index.mjs.map +0 -1
- package/es/RelatedArticleList/index.mjs +0 -8
- package/es/RelatedArticleList/index.mjs.map +0 -1
- package/lib/Article/index.d.ts +0 -10
- package/lib/AudioPlayer/index.d.ts +0 -9
- package/lib/AudioPlayer/index.js +0 -8
- package/lib/AudioPlayer/index.js.map +0 -1
- package/lib/Breadcrumb/index.d.ts +0 -11
- package/lib/Breadcrumb/index.js +0 -9
- package/lib/Breadcrumb/index.js.map +0 -1
- package/lib/CampaignBlock/index.d.ts +0 -8
- package/lib/CodeBlock/index.d.ts +0 -9
- package/lib/ContactBlock/index.d.ts +0 -9
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.d.ts +0 -16
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -26
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +0 -1
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.d.ts +0 -16
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -26
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +0 -1
- package/lib/ContentTypeHero/ContentTypeHero.d.ts +0 -14
- package/lib/ContentTypeHero/ContentTypeHero.js +0 -40
- package/lib/ContentTypeHero/ContentTypeHero.js.map +0 -1
- package/lib/ContentTypeHero/index.d.ts +0 -9
- package/lib/CopyParagraphButton/index.d.ts +0 -10
- package/lib/CopyParagraphButton/index.js +0 -8
- package/lib/CopyParagraphButton/index.js.map +0 -1
- package/lib/Embed/index.d.ts +0 -27
- package/lib/FactBox/index.d.ts +0 -9
- package/lib/FactBox/index.js +0 -8
- package/lib/FactBox/index.js.map +0 -1
- package/lib/FileList/index.d.ts +0 -10
- package/lib/Gloss/index.d.ts +0 -9
- package/lib/Grid/index.d.ts +0 -10
- package/lib/KeyFigure/index.d.ts +0 -8
- package/lib/LicenseByline/index.d.ts +0 -9
- package/lib/LinkBlock/index.d.ts +0 -9
- package/lib/Pitch/index.d.ts +0 -8
- package/lib/RelatedArticleList/index.d.ts +0 -10
- package/lib/RelatedArticleList/index.js +0 -8
- package/lib/RelatedArticleList/index.js.map +0 -1
- package/lib/ResourceBox/index.d.ts +0 -9
- package/lib/i18n/index.d.ts +0 -9
- package/src/Article/index.ts +0 -20
- package/src/AudioPlayer/index.ts +0 -11
- package/src/Breadcrumb/index.ts +0 -15
- package/src/CampaignBlock/index.ts +0 -9
- package/src/CodeBlock/index.ts +0 -10
- package/src/ContactBlock/index.ts +0 -10
- package/src/ContentTypeBlockQuote/ContentTypeBlockQuote.tsx +0 -32
- package/src/ContentTypeFramedContent/ContentTypeFramedContent.tsx +0 -34
- package/src/ContentTypeHero/ContentTypeHero.stories.tsx +0 -75
- package/src/ContentTypeHero/ContentTypeHero.tsx +0 -56
- package/src/ContentTypeHero/index.ts +0 -10
- package/src/CopyParagraphButton/index.tsx +0 -12
- package/src/Embed/index.ts +0 -28
- package/src/FactBox/index.ts +0 -11
- package/src/FileList/index.ts +0 -11
- package/src/Gloss/index.tsx +0 -10
- package/src/Grid/index.ts +0 -12
- package/src/KeyFigure/index.ts +0 -9
- package/src/LicenseByline/index.tsx +0 -10
- package/src/LinkBlock/index.ts +0 -10
- package/src/Pitch/index.ts +0 -9
- package/src/RelatedArticleList/index.ts +0 -13
- package/src/ResourceBox/index.ts +0 -11
- package/src/i18n/index.ts +0 -19
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let __ndla_primitives = require("@ndla/primitives");
|
|
5
|
+
__ndla_primitives = require_rolldown_runtime.__toESM(__ndla_primitives);
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
5
8
|
|
|
6
9
|
//#region src/ZendeskButton/ZendeskButton.tsx
|
|
7
10
|
const ZendeskButton = (0, react.forwardRef)(({ locale, variant = "secondary", widgetKey, children,...rest }, ref) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.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 { forwardRef, useState } from \"react\";\nimport { Button, type ButtonProps } from \"@ndla/primitives\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ZendeskButton.js","names":["Button"],"sources":["../../src/ZendeskButton/ZendeskButton.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 { forwardRef, useState } from \"react\";\nimport { Button, type ButtonProps } from \"@ndla/primitives\";\n\n// TODO: Let's consider abandoning `disabled` on the button here. It should instead just open/close the widget based on its current state.\n\nexport interface ZendeskButtonProps extends ButtonProps {\n widgetKey: string;\n locale: string;\n}\n\ndeclare global {\n interface Window {\n zE: (modifier: string, action: string, callback?: (() => void) | string) => void;\n }\n}\n\nexport const ZendeskButton = forwardRef<HTMLButtonElement, ZendeskButtonProps>(\n ({ locale, variant = \"secondary\", widgetKey, children, ...rest }, ref) => {\n const [loading, setLoading] = useState(false);\n const handleClick = () => {\n if (window && !window.zE) {\n setLoading(true);\n // Asynchronously load zendesk scripts for better performance\n const script = document.createElement(\"script\");\n script.id = \"ze-snippet\";\n script.type = \"text/javascript\";\n script.async = true;\n script.onload = () => {\n if (window.zE) {\n window.zE(\"webWidget\", \"setLocale\", locale);\n window.zE(\"webWidget:on\", \"close\", () => {\n setLoading(false);\n });\n window.zE(\"webWidget\", \"open\");\n }\n };\n script.src = `https://static.zdassets.com/ekr/snippet.js?key=${widgetKey}`;\n document.body.appendChild(script);\n } else if (window?.zE) {\n window.zE(\"webWidget\", \"open\");\n }\n };\n\n return (\n <Button onClick={handleClick} variant={variant} id=\"zendeskButton\" disabled={loading} {...rest} ref={ref}>\n {children}\n </Button>\n );\n },\n);\n"],"mappings":";;;;;;;;;AAwBA,MAAa,uCACV,EAAE,QAAQ,UAAU,aAAa,WAAW,SAAU,GAAG,QAAQ,QAAQ;CACxE,MAAM,CAAC,SAAS,kCAAuB,MAAM;CAC7C,MAAM,oBAAoB;AACxB,MAAI,UAAU,CAAC,OAAO,IAAI;AACxB,cAAW,KAAK;GAEhB,MAAM,SAAS,SAAS,cAAc,SAAS;AAC/C,UAAO,KAAK;AACZ,UAAO,OAAO;AACd,UAAO,QAAQ;AACf,UAAO,eAAe;AACpB,QAAI,OAAO,IAAI;AACb,YAAO,GAAG,aAAa,aAAa,OAAO;AAC3C,YAAO,GAAG,gBAAgB,eAAe;AACvC,iBAAW,MAAM;OACjB;AACF,YAAO,GAAG,aAAa,OAAO;;;AAGlC,UAAO,MAAM,kDAAkD;AAC/D,YAAS,KAAK,YAAY,OAAO;aACxB,QAAQ,GACjB,QAAO,GAAG,aAAa,OAAO;;AAIlC,QACE,2CAACA;EAAO,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;GACM;EAGd"}
|
|
@@ -5,11 +5,13 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
5
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
6
|
var __getProtoOf = Object.getPrototypeOf;
|
|
7
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (
|
|
8
|
+
var __export = (all) => {
|
|
9
|
+
let target = {};
|
|
9
10
|
for (var name in all) __defProp(target, name, {
|
|
10
11
|
get: all[name],
|
|
11
12
|
enumerable: true
|
|
12
13
|
});
|
|
14
|
+
return target;
|
|
13
15
|
};
|
|
14
16
|
var __copyProps = (to, from, except, desc) => {
|
|
15
17
|
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
@@ -28,15 +30,5 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
30
|
|
|
29
31
|
//#endregion
|
|
30
32
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
get: function () {
|
|
34
|
-
return __export;
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
Object.defineProperty(exports, '__toESM', {
|
|
38
|
-
enumerable: true,
|
|
39
|
-
get: function () {
|
|
40
|
-
return __toESM;
|
|
41
|
-
}
|
|
42
|
-
});
|
|
33
|
+
exports.__export = __export;
|
|
34
|
+
exports.__toESM = __toESM;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formatNestedMessages.js","names":[
|
|
1
|
+
{"version":3,"file":"formatNestedMessages.js","names":[],"sources":["../../src/i18n/formatNestedMessages.ts"],"sourcesContent":["/**\n * Copyright (c) 2017-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\ninterface Phrases {\n [key: string]: string | Phrases;\n}\n\ninterface FormattedMessages {\n [key: string]: string;\n}\n\nexport const formatNestedMessages = (\n phrases: Phrases,\n formattedMessages: FormattedMessages = {},\n prefix: string = \"\",\n) => {\n const messages = formattedMessages;\n\n Object.keys(phrases).forEach((key) => {\n const value = phrases[key];\n if ({}.hasOwnProperty.call(phrases, key)) {\n const keyWithPrefix = prefix ? `${prefix}.${key}` : key;\n if (typeof value === \"object\") {\n formatNestedMessages(value, formattedMessages, keyWithPrefix);\n } else {\n messages[keyWithPrefix] = value;\n }\n }\n });\n\n return messages;\n};\n"],"mappings":";;AAgBA,MAAa,wBACX,SACA,oBAAuC,EAAE,EACzC,SAAiB,OACd;CACH,MAAM,WAAW;AAEjB,QAAO,KAAK,QAAQ,CAAC,SAAS,QAAQ;EACpC,MAAM,QAAQ,QAAQ;AACtB,MAAI,EAAE,CAAC,eAAe,KAAK,SAAS,IAAI,EAAE;GACxC,MAAM,gBAAgB,SAAS,GAAG,OAAO,GAAG,QAAQ;AACpD,OAAI,OAAO,UAAU,SACnB,sBAAqB,OAAO,mBAAmB,cAAc;OAE7D,UAAS,iBAAiB;;GAG9B;AAEF,QAAO"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.js');
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let react = require("react");
|
|
3
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
+
let react_i18next = require("react-i18next");
|
|
5
|
+
react_i18next = require_rolldown_runtime.__toESM(react_i18next);
|
|
4
6
|
|
|
5
7
|
//#region src/i18n/useComponentTranslations.ts
|
|
6
8
|
const useTagsInputTranslations = (translations) => {
|
|
@@ -45,8 +47,7 @@ const usePaginationTranslations = (translations) => {
|
|
|
45
47
|
prevTriggerLabel: t("prevTriggerLabel"),
|
|
46
48
|
nextTriggerLabel: t("nextTriggerLabel"),
|
|
47
49
|
itemLabel: (details) => {
|
|
48
|
-
|
|
49
|
-
return lastPage ? t("lastPage", { page: details.page }) : t("page", { page: details.page });
|
|
50
|
+
return details.totalPages > 1 && details.page === details.totalPages ? t("lastPage", { page: details.page }) : t("page", { page: details.page });
|
|
50
51
|
},
|
|
51
52
|
...translations
|
|
52
53
|
}), [translations, t]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useComponentTranslations.js","names":["translations?: Partial<TagsInputRootProps[\"translations\"]>","translations?: Partial<ComboboxRootProps<T>[\"translations\"]>","translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>","translations?: Partial<PaginationRootProps[\"translations\"]>","translations: DeepPartial<ImageSearchTranslations>","translations: DeepPartial<AudioSearchTranslations>","translations?: Partial<VideoTranslations>","translations?: Partial<DatePickerRootProps[\"translations\"]>"],"sources":["../../src/i18n/useComponentTranslations.ts"],"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 { useTranslation } from \"react-i18next\";\nimport type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\nimport { useMemo } from \"react\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyyy\" };\n },\n }),\n [t, translations],\n );\n};\n"],"mappings":";;;;;AAkBA,MAAa,2BAA2B,CACtCA,iBACuC;CACvC,MAAM,EAAE,GAAG,GAAG,kCAAe,eAAe,EAAE,WAAW,sBAAuB,EAAC;AAEjF,QAAO,mBACL,OAAO;EACL,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OAAO,UAAU,OAAO,EAAE;EAC1D,SAAS,EAAE,UAAU;EACrB,aAAa,CAAC,YAAY;AACxB,UAAO;IAAE,KAAK;IAAM,OAAO;IAAM,MAAM;GAAQ;EAChD;CACF,IACD,CAAC,GAAG,YAAa,EAClB;AACF"}
|
|
1
|
+
{"version":3,"file":"useComponentTranslations.js","names":[],"sources":["../../src/i18n/useComponentTranslations.ts"],"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 { useTranslation } from \"react-i18next\";\nimport type { CollectionItem } from \"@ark-ui/react\";\nimport type { ComboboxRootProps, PaginationRootProps, TagsInputRootProps, DatePickerRootProps } from \"@ndla/primitives\";\nimport { type TagSelectorRootProps } from \"../TagSelector/TagSelector\";\nimport { useMemo } from \"react\";\n\ntype DeepPartial<T> = {\n [K in keyof T]?: T[K] extends object ? DeepPartial<T[K]> : T[K];\n};\n\nexport const useTagsInputTranslations = (\n translations?: Partial<TagsInputRootProps[\"translations\"]>,\n): TagsInputRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.tagsInput\" });\n\n return useMemo(\n () => ({\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n deleteTagTriggerLabel: (tag) => t(\"deleteTagTriggerLabel\", { tag }),\n tagAdded: (tag) => t(\"tagAdded\", { tag }),\n tagsPasted: (tag) => t(\"tagsPasted\", { length: tag.length }),\n tagEdited: (tag) => t(\"tagEdited\", { tag }),\n tagUpdated: (tag) => t(\"tagUpdated\", { tag }),\n tagDeleted: (tag) => t(\"tagDeleted\", { tag }),\n tagSelected: (tag) => t(\"tagSelected\", { tag }),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useComboboxTranslations = <T extends CollectionItem>(\n translations?: Partial<ComboboxRootProps<T>[\"translations\"]>,\n): ComboboxRootProps<T>[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.combobox\" });\n\n return useMemo(\n () => ({\n triggerLabel: t(\"triggerLabel\"),\n clearTriggerLabel: t(\"clearTriggerLabel\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useTagSelectorTranslations = <T extends CollectionItem>(\n translations?: Partial<TagSelectorRootProps<T>[\"translations\"]>,\n): TagSelectorRootProps<T>[\"translations\"] => {\n const tagsInputTranslations = useTagsInputTranslations();\n const comboboxTranslations = useComboboxTranslations();\n\n return useMemo(\n () =>\n ({\n ...comboboxTranslations,\n ...tagsInputTranslations,\n ...translations,\n }) as TagSelectorRootProps<T>[\"translations\"],\n [comboboxTranslations, tagsInputTranslations, translations],\n );\n};\n\nexport const usePaginationTranslations = (\n translations?: Partial<PaginationRootProps[\"translations\"]>,\n): PaginationRootProps[\"translations\"] => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.pagination\" });\n\n return useMemo(\n () => ({\n rootLabel: t(\"rootLabel\"),\n prevTriggerLabel: t(\"prevTriggerLabel\"),\n nextTriggerLabel: t(\"nextTriggerLabel\"),\n itemLabel: (details) => {\n const lastPage = details.totalPages > 1 && details.page === details.totalPages;\n return lastPage ? t(\"lastPage\", { page: details.page }) : t(\"page\", { page: details.page });\n },\n ...translations,\n }),\n [translations, t],\n );\n};\n\n// TODO: Deduplicate this and place it somewhere smart. Maybe core?\ninterface AudioSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n useAudio: string;\n noResults: string;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\ninterface VideoTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n loadMoreVideos: string;\n noResults: string;\n is360Video: string;\n previewVideo: string;\n addVideo: string;\n close: string;\n}\ninterface PreviewTranslations {\n creatorsLabel: string;\n license: string;\n caption: string;\n altText: string;\n modelRelease: string;\n tags: string;\n close: string;\n checkboxLabel?: string;\n missingTitleFallback?: string;\n useImageTitle: string;\n}\n\ninterface ImageSearchTranslations {\n searchPlaceholder: string;\n searchButtonTitle: string;\n imagePreview: PreviewTranslations;\n paginationTranslations: PaginationRootProps[\"translations\"];\n}\n\nexport const useImageSearchTranslations = (\n translations: DeepPartial<ImageSearchTranslations> = {},\n): ImageSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.imageSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { imagePreview, paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n imagePreview: {\n creatorsLabel: t(\"imagePreview.creatorsLabel\"),\n license: t(\"imagePreview.license\"),\n caption: t(\"imagePreview.caption\"),\n altText: t(\"imagePreview.altText\"),\n modelRelease: t(\"imagePreview.modelRelease\"),\n tags: t(\"imagePreview.tags\"),\n close: t(\"close\"),\n checkboxLabel: t(\"imagePreview.checkboxLabel\"),\n useImageTitle: t(\"imagePreview.useImageTitle\"),\n ...imagePreview,\n },\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useAudioSearchTranslations = (\n translations: DeepPartial<AudioSearchTranslations> = {},\n): AudioSearchTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.audioSearch\" });\n const paginationTranslations = usePaginationTranslations();\n\n const { paginationTranslations: fallbackPaginationTranslations, ...remaining } = translations;\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n useAudio: t(\"useAudio\"),\n noResults: t(\"noResults\"),\n paginationTranslations: { ...paginationTranslations, ...fallbackPaginationTranslations },\n ...remaining,\n }),\n [t, paginationTranslations, fallbackPaginationTranslations, remaining],\n );\n};\n\nexport const useVideoSearchTranslations = (translations?: Partial<VideoTranslations>): VideoTranslations => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.videoSearch\" });\n\n return useMemo(\n () => ({\n searchPlaceholder: t(\"searchPlaceholder\"),\n searchButtonTitle: t(\"searchButtonTitle\"),\n loadMoreVideos: t(\"loadMoreVideos\"),\n noResults: t(\"noResults\"),\n is360Video: t(\"is360Video\"),\n previewVideo: t(\"previewVideo\"),\n addVideo: t(\"addVideo\"),\n close: t(\"close\"),\n ...translations,\n }),\n [t, translations],\n );\n};\n\nexport const useDatePickerTranslations = (\n translations?: Partial<DatePickerRootProps[\"translations\"]>,\n): NonNullable<DatePickerRootProps[\"translations\"]> => {\n const { t } = useTranslation(\"translation\", { keyPrefix: \"component.datePicker\" });\n\n return useMemo(\n () => ({\n dayCell: (state) => {\n if (state.unavailable) {\n return t(\"dayCell.unavailable\", { date: state.formattedDate });\n } else if (state.selected) {\n return t(\"dayCell.selected\", { date: state.formattedDate });\n } else return t(\"dayCell.select\", { date: state.formattedDate });\n },\n nextTrigger: (view) => t(`nextTrigger.${view}`),\n prevTrigger: (view) => t(`prevTrigger.${view}`),\n monthSelect: t(\"monthSelect\"),\n yearSelect: t(\"yearSelect\"),\n viewTrigger: (view) => t(`viewTrigger.${view}`),\n presetTrigger: (value) => {\n if (Array.isArray(value)) {\n return t(\"presetTrigger.range\", { start: value[0], end: value[1] });\n } else return t(\"presetTrigger.single\", { date: value });\n },\n clearTrigger: t(\"clearTrigger\"),\n trigger: (open) => t(`trigger.${open ? \"close\" : \"open\"}`),\n content: t(\"content\"),\n placeholder: (_locale) => {\n return { day: \"dd\", month: \"mm\", year: \"yyyy\" };\n },\n }),\n [t, translations],\n );\n};\n"],"mappings":";;;;;;;AAkBA,MAAa,4BACX,iBACuC;CACvC,MAAM,EAAE,wCAAqB,eAAe,EAAE,WAAW,uBAAuB,CAAC;AAEjF,kCACS;EACL,mBAAmB,EAAE,oBAAoB;EACzC,wBAAwB,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;EACnE,WAAW,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC;EACzC,aAAa,QA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,aAAa,CAClB;;AAGH,MAAa,6BACX,iBACqD;CACrD,MAAM,EAAE,wCAAqB,eAAe,EAAE,WAAW,wBAAwB,CAAC;AAElF,kCACS;EACL,UAAU,UAAU;AAClB,OAAI,MAAM,YACR,QAAO,EAAE,uBAAuB,EAAE,MAAM,MAAM,eAAe,CAAC;YACrD,MAAM,SACf,QAAO,EAAE,oBAAoB,EAAE,MAAM,MAAM,eAAe,CAAC;OACtD,QAAO,EAAE,kBAAkB,EAAE,MAAM,MAAM,eAAe,CAAC;;EAElE,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,aAAa,EAAE,cAAc;EAC7B,YAAY,EAAE,aAAa;EAC3B,cAAc,SAAS,EAAE,eAAe,OAAO;EAC/C,gBAAgB,UAAU;AACxB,OAAI,MAAM,QAAQ,MAAM,CACtB,QAAO,EAAE,uBAAuB;IAAE,OAAO,MAAM;IAAI,KAAK,MAAM;IAAI,CAAC;OAC9D,QAAO,EAAE,wBAAwB,EAAE,MAAM,OAAO,CAAC;;EAE1D,cAAc,EAAE,eAAe;EAC/B,UAAU,SAAS,EAAE,WAAW,OAAO,UAAU,SAAS;EAC1D,SAAS,EAAE,UAAU;EACrB,cAAc,YAAY;AACxB,UAAO;IAAE,KAAK;IAAM,OAAO;IAAM,MAAM;IAAQ;;EAElD,GACD,CAAC,GAAG,aAAa,CAClB"}
|
package/lib/index.d.ts
CHANGED
|
@@ -6,47 +6,68 @@
|
|
|
6
6
|
*
|
|
7
7
|
*/
|
|
8
8
|
export { Concept } from "./Concept/Concept";
|
|
9
|
-
export { ImageEmbed, getCrop, getFocalPoint
|
|
10
|
-
export
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
9
|
+
export { default as ImageEmbed, getCrop, getFocalPoint } from "./Embed/ImageEmbed";
|
|
10
|
+
export { InlineTriggerButton } from "./Embed/InlineTriggerButton";
|
|
11
|
+
export { default as AudioEmbed } from "./Embed/AudioEmbed";
|
|
12
|
+
export { default as H5pEmbed } from "./Embed/H5pEmbed";
|
|
13
|
+
export { default as ExternalEmbed } from "./Embed/ExternalEmbed";
|
|
14
|
+
export { default as IframeEmbed } from "./Embed/IframeEmbed";
|
|
15
|
+
export { default as FootnoteEmbed } from "./Embed/FootnoteEmbed";
|
|
16
|
+
export { default as BrightcoveEmbed } from "./Embed/BrightcoveEmbed";
|
|
17
|
+
export { default as ContentLinkEmbed } from "./Embed/ContentLinkEmbed";
|
|
18
|
+
export { default as RelatedContentEmbed } from "./Embed/RelatedContentEmbed";
|
|
19
|
+
export { ConceptEmbed, InlineConcept, BlockConcept } from "./Embed/ConceptEmbed";
|
|
20
|
+
export { default as UnknownEmbed } from "./Embed/UnknownEmbed";
|
|
21
|
+
export { default as UuDisclaimerEmbed } from "./Embed/UuDisclaimerEmbed";
|
|
22
|
+
export { default as CopyrightEmbed } from "./Embed/CopyrightEmbed";
|
|
23
|
+
export { default as CodeEmbed } from "./Embed/CodeEmbed";
|
|
24
|
+
export { ConceptInlineTriggerButton } from "./Embed/ConceptInlineTriggerButton";
|
|
25
|
+
export { EmbedWrapper } from "./Embed/EmbedWrapper";
|
|
26
|
+
export type { EmbedWrapperVariantProps, EmbedWrapperProps } from "./Embed/EmbedWrapper";
|
|
27
|
+
export type { HeartButtonType, CanonicalUrlFuncs, RenderContext } from "./Embed/types";
|
|
28
|
+
export { LicenseLink } from "./LicenseByline/LicenseLink";
|
|
29
|
+
export { EmbedByline } from "./LicenseByline/EmbedByline";
|
|
30
|
+
export { ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle, } from "./Article/Article";
|
|
31
|
+
export { ArticleByline, ArticleBylineAccordionItem } from "./Article/ArticleByline";
|
|
32
|
+
export { ArticleFootNotes } from "./Article/ArticleFootNotes";
|
|
13
33
|
export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
|
|
14
|
-
export {
|
|
15
|
-
export { FileListEmbed,
|
|
16
|
-
export {
|
|
17
|
-
export
|
|
18
|
-
export {
|
|
19
|
-
export { ResourceBox } from "./ResourceBox";
|
|
20
|
-
export { default as AudioPlayer } from "./AudioPlayer";
|
|
34
|
+
export { RelatedArticleList, RelatedArticle } from "./RelatedArticleList/RelatedArticleList";
|
|
35
|
+
export { FileListEmbed, FileListItem, FileListWrapper } from "./FileList/FileList";
|
|
36
|
+
export { File, FileListElement } from "./FileList/File";
|
|
37
|
+
export { PdfFile } from "./FileList/PdfFile";
|
|
38
|
+
export { default as FactBox } from "./FactBox/FactBox";
|
|
39
|
+
export { ResourceBox } from "./ResourceBox/ResourceBox";
|
|
40
|
+
export { default as AudioPlayer } from "./AudioPlayer/AudioPlayer";
|
|
21
41
|
export { default as constants } from "./model";
|
|
22
42
|
export { default as messagesNB } from "./locale/messages-nb";
|
|
23
43
|
export { default as messagesNN } from "./locale/messages-nn";
|
|
24
44
|
export { default as messagesEN } from "./locale/messages-en";
|
|
25
45
|
export { default as messagesSE } from "./locale/messages-se";
|
|
26
|
-
export { default as Breadcrumb
|
|
27
|
-
export
|
|
28
|
-
export {
|
|
46
|
+
export { default as Breadcrumb } from "./Breadcrumb/Breadcrumb";
|
|
47
|
+
export { default as HomeBreadcrumb } from "./Breadcrumb/HomeBreadcrumb";
|
|
48
|
+
export type { SimpleBreadcrumbItem, IndexedBreadcrumbItem } from "./Breadcrumb/BreadcrumbItem";
|
|
49
|
+
export { formatNestedMessages } from "./i18n/formatNestedMessages";
|
|
50
|
+
export { useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations, useDatePickerTranslations, } from "./i18n/useComponentTranslations";
|
|
29
51
|
export type { ContentTypeBadgeProps, StrictContentType, ContentType } from "./ContentTypeBadge/ContentTypeBadge";
|
|
30
52
|
export { ContentTypeBadge, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadge";
|
|
31
|
-
export {
|
|
32
|
-
export { type ContentTypeBlockQuoteVariant } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
|
|
33
|
-
export { ContentTypeFramedContent } from "./ContentTypeFramedContent/ContentTypeFramedContent";
|
|
34
|
-
export { type ContentTypeFramedContentVariant } from "./ContentTypeFramedContent/ContentTypeFramedContent";
|
|
35
|
-
export { default as CopyParagraphButton } from "./CopyParagraphButton";
|
|
53
|
+
export { default as CopyParagraphButton } from "./CopyParagraphButton/CopyParagraphButton";
|
|
36
54
|
export type { TagSelectorControlProps, TagSelectorInputProps, TagSelectorRootProps } from "./TagSelector/TagSelector";
|
|
37
55
|
export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTrigger, TagSelectorControl, TagSelectorClearTrigger, TagSelectorInputBase, TagSelectorInput, } from "./TagSelector/TagSelector";
|
|
38
|
-
export { Pitch } from "./Pitch";
|
|
39
|
-
export { KeyFigure } from "./KeyFigure";
|
|
40
|
-
export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
|
|
41
|
-
export type { ContactBlockBackground } from "./ContactBlock";
|
|
42
|
-
export
|
|
43
|
-
export {
|
|
44
|
-
export {
|
|
45
|
-
export type { GridType } from "./Grid";
|
|
46
|
-
export { Gloss
|
|
47
|
-
export {
|
|
56
|
+
export { Pitch } from "./Pitch/Pitch";
|
|
57
|
+
export { default as KeyFigure } from "./KeyFigure/KeyFigure";
|
|
58
|
+
export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock/ContactBlock";
|
|
59
|
+
export type { ContactBlockBackground } from "./ContactBlock/ContactBlock";
|
|
60
|
+
export { default as CampaignBlock } from "./CampaignBlock/CampaignBlock";
|
|
61
|
+
export { Grid } from "./Grid/Grid";
|
|
62
|
+
export { GridParallaxItem } from "./Grid/GridParallaxItem";
|
|
63
|
+
export type { GridProps as GridType } from "./Grid/Grid";
|
|
64
|
+
export { default as Gloss } from "./Gloss/Gloss";
|
|
65
|
+
export { default as GlossExample } from "./Gloss/GlossExample";
|
|
66
|
+
export { default as LinkBlock } from "./LinkBlock/LinkBlock";
|
|
67
|
+
export { default as LinkBlockSection } from "./LinkBlock/LinkBlockSection";
|
|
48
68
|
export type { Article as ArticleType, HeadingLevel } from "./types";
|
|
49
|
-
export { CodeBlock
|
|
69
|
+
export { default as CodeBlock } from "./CodeBlock/CodeBlock";
|
|
70
|
+
export { codeLanguageOptions } from "./CodeBlock/codeLanguageOptions";
|
|
50
71
|
export { ZendeskButton } from "./ZendeskButton/ZendeskButton";
|
|
51
72
|
export type { ZendeskButtonProps } from "./ZendeskButton/ZendeskButton";
|
|
52
73
|
export { licenseAttributes } from "./utils/licenseAttributes";
|
package/lib/index.js
CHANGED
|
@@ -1,153 +1,146 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const
|
|
28
|
-
const
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
47
|
-
const
|
|
48
|
-
const
|
|
49
|
-
const
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_Grid_GridParallaxItem = require('./Grid/GridParallaxItem.js');
|
|
59
|
-
const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_LinkBlock_LinkBlock = require('./LinkBlock/LinkBlock.js');
|
|
60
|
-
const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_LinkBlock_LinkBlockSection = require('./LinkBlock/LinkBlockSection.js');
|
|
61
|
-
const require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_ZendeskButton_ZendeskButton = require('./ZendeskButton/ZendeskButton.js');
|
|
1
|
+
const require_LicenseLink = require('./LicenseByline/LicenseLink.js');
|
|
2
|
+
const require_EmbedByline = require('./LicenseByline/EmbedByline.js');
|
|
3
|
+
const require_licenseAttributes = require('./utils/licenseAttributes.js');
|
|
4
|
+
const require_BrightcoveEmbed = require('./Embed/BrightcoveEmbed.js');
|
|
5
|
+
const require_ResourceBox = require('./ResourceBox/ResourceBox.js');
|
|
6
|
+
const require_ExternalEmbed = require('./Embed/ExternalEmbed.js');
|
|
7
|
+
const require_H5pEmbed = require('./Embed/H5pEmbed.js');
|
|
8
|
+
const require_IframeEmbed = require('./Embed/IframeEmbed.js');
|
|
9
|
+
const require_ImageEmbed = require('./Embed/ImageEmbed.js');
|
|
10
|
+
const require_Concept = require('./Concept/Concept.js');
|
|
11
|
+
const require_InlineTriggerButton = require('./Embed/InlineTriggerButton.js');
|
|
12
|
+
const require_AudioPlayer = require('./AudioPlayer/AudioPlayer.js');
|
|
13
|
+
const require_AudioEmbed = require('./Embed/AudioEmbed.js');
|
|
14
|
+
const require_FootnoteEmbed = require('./Embed/FootnoteEmbed.js');
|
|
15
|
+
const require_ContentLinkEmbed = require('./Embed/ContentLinkEmbed.js');
|
|
16
|
+
const require_ContentTypeBadge = require('./ContentTypeBadge/ContentTypeBadge.js');
|
|
17
|
+
const require_RelatedArticleList = require('./RelatedArticleList/RelatedArticleList.js');
|
|
18
|
+
const require_RelatedContentEmbed = require('./Embed/RelatedContentEmbed.js');
|
|
19
|
+
const require_ConceptInlineTriggerButton = require('./Embed/ConceptInlineTriggerButton.js');
|
|
20
|
+
const require_GlossExample = require('./Gloss/GlossExample.js');
|
|
21
|
+
const require_Gloss = require('./Gloss/Gloss.js');
|
|
22
|
+
const require_ConceptEmbed = require('./Embed/ConceptEmbed.js');
|
|
23
|
+
const require_UnknownEmbed = require('./Embed/UnknownEmbed.js');
|
|
24
|
+
const require_UuDisclaimerEmbed = require('./Embed/UuDisclaimerEmbed.js');
|
|
25
|
+
const require_CopyrightEmbed = require('./Embed/CopyrightEmbed.js');
|
|
26
|
+
const require_CodeBlock = require('./CodeBlock/CodeBlock.js');
|
|
27
|
+
const require_codeLanguageOptions = require('./CodeBlock/codeLanguageOptions.js');
|
|
28
|
+
const require_CodeEmbed = require('./Embed/CodeEmbed.js');
|
|
29
|
+
const require_EmbedWrapper = require('./Embed/EmbedWrapper.js');
|
|
30
|
+
const require_ArticleFootNotes = require('./Article/ArticleFootNotes.js');
|
|
31
|
+
const require_ArticleByline = require('./Article/ArticleByline.js');
|
|
32
|
+
const require_Article = require('./Article/Article.js');
|
|
33
|
+
const require_relativeUrl = require('./utils/relativeUrl.js');
|
|
34
|
+
const require_FileList = require('./FileList/FileList.js');
|
|
35
|
+
const require_File = require('./FileList/File.js');
|
|
36
|
+
const require_PdfFile = require('./FileList/PdfFile.js');
|
|
37
|
+
const require_FactBox = require('./FactBox/FactBox.js');
|
|
38
|
+
const require_index = require('./model/index.js');
|
|
39
|
+
const require_messages_nb = require('./locale/messages-nb.js');
|
|
40
|
+
const require_messages_nn = require('./locale/messages-nn.js');
|
|
41
|
+
const require_messages_en = require('./locale/messages-en.js');
|
|
42
|
+
const require_messages_se = require('./locale/messages-se.js');
|
|
43
|
+
const require_Breadcrumb = require('./Breadcrumb/Breadcrumb.js');
|
|
44
|
+
const require_HomeBreadcrumb = require('./Breadcrumb/HomeBreadcrumb.js');
|
|
45
|
+
const require_formatNestedMessages = require('./i18n/formatNestedMessages.js');
|
|
46
|
+
const require_TagSelector = require('./TagSelector/TagSelector.js');
|
|
47
|
+
const require_useComponentTranslations = require('./i18n/useComponentTranslations.js');
|
|
48
|
+
const require_CopyParagraphButton = require('./CopyParagraphButton/CopyParagraphButton.js');
|
|
49
|
+
const require_Pitch = require('./Pitch/Pitch.js');
|
|
50
|
+
const require_KeyFigure = require('./KeyFigure/KeyFigure.js');
|
|
51
|
+
const require_ContactBlock = require('./ContactBlock/ContactBlock.js');
|
|
52
|
+
const require_CampaignBlock = require('./CampaignBlock/CampaignBlock.js');
|
|
53
|
+
const require_Grid = require('./Grid/Grid.js');
|
|
54
|
+
const require_GridParallaxItem = require('./Grid/GridParallaxItem.js');
|
|
55
|
+
const require_LinkBlock = require('./LinkBlock/LinkBlock.js');
|
|
56
|
+
const require_LinkBlockSection = require('./LinkBlock/LinkBlockSection.js');
|
|
57
|
+
const require_ZendeskButton = require('./ZendeskButton/ZendeskButton.js');
|
|
62
58
|
|
|
63
|
-
exports.Article =
|
|
64
|
-
exports.ArticleByline =
|
|
65
|
-
exports.ArticleBylineAccordionItem =
|
|
66
|
-
exports.ArticleContent =
|
|
67
|
-
exports.ArticleFootNotes =
|
|
68
|
-
exports.ArticleFooter =
|
|
69
|
-
exports.ArticleHGroup =
|
|
70
|
-
exports.ArticleHeader =
|
|
71
|
-
exports.ArticleTitle =
|
|
72
|
-
exports.ArticleWrapper =
|
|
73
|
-
exports.AudioEmbed =
|
|
74
|
-
exports.AudioPlayer =
|
|
75
|
-
exports.BlockConcept =
|
|
76
|
-
exports.Breadcrumb =
|
|
77
|
-
exports.BrightcoveEmbed =
|
|
78
|
-
exports.CampaignBlock =
|
|
79
|
-
exports.CodeBlock =
|
|
80
|
-
exports.CodeEmbed =
|
|
81
|
-
exports.Concept =
|
|
82
|
-
exports.ConceptEmbed =
|
|
83
|
-
exports.ConceptInlineTriggerButton =
|
|
84
|
-
exports.ContactBlock =
|
|
85
|
-
exports.ContentLinkEmbed =
|
|
86
|
-
exports.ContentTypeBadge =
|
|
87
|
-
exports.
|
|
88
|
-
exports.
|
|
89
|
-
exports.
|
|
90
|
-
exports.
|
|
91
|
-
exports.
|
|
92
|
-
exports.
|
|
93
|
-
exports.
|
|
94
|
-
exports.
|
|
95
|
-
exports.
|
|
96
|
-
exports.
|
|
97
|
-
exports.
|
|
98
|
-
exports.
|
|
99
|
-
exports.
|
|
100
|
-
exports.
|
|
101
|
-
exports.
|
|
102
|
-
exports.
|
|
103
|
-
exports.
|
|
104
|
-
exports.
|
|
105
|
-
exports.
|
|
106
|
-
exports.
|
|
107
|
-
exports.
|
|
108
|
-
exports.
|
|
109
|
-
exports.
|
|
110
|
-
exports.
|
|
111
|
-
exports.
|
|
112
|
-
exports.
|
|
113
|
-
exports.
|
|
114
|
-
exports.
|
|
115
|
-
exports.
|
|
116
|
-
exports.
|
|
117
|
-
exports.
|
|
118
|
-
exports.
|
|
119
|
-
exports.
|
|
120
|
-
exports.
|
|
121
|
-
exports.
|
|
122
|
-
exports.
|
|
123
|
-
exports.
|
|
124
|
-
exports.
|
|
125
|
-
exports.
|
|
126
|
-
exports.
|
|
127
|
-
exports.
|
|
128
|
-
exports.
|
|
129
|
-
exports.
|
|
130
|
-
exports.
|
|
131
|
-
exports.
|
|
132
|
-
exports.
|
|
133
|
-
exports.
|
|
134
|
-
exports.
|
|
135
|
-
exports.
|
|
136
|
-
exports.
|
|
137
|
-
exports.
|
|
138
|
-
exports.
|
|
139
|
-
exports.
|
|
140
|
-
exports.
|
|
141
|
-
exports.
|
|
142
|
-
exports.
|
|
143
|
-
exports.
|
|
144
|
-
exports.
|
|
145
|
-
exports.
|
|
146
|
-
exports.
|
|
147
|
-
exports.
|
|
148
|
-
exports.
|
|
149
|
-
exports.
|
|
150
|
-
exports.
|
|
151
|
-
exports.useTagSelectorTranslations = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_i18n_useComponentTranslations.useTagSelectorTranslations;
|
|
152
|
-
exports.useTagsInputTranslations = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_i18n_useComponentTranslations.useTagsInputTranslations;
|
|
153
|
-
exports.useVideoSearchTranslations = require__Users_jec_code_ndla_frontend_packages_packages_ndla_ui_src_i18n_useComponentTranslations.useVideoSearchTranslations;
|
|
59
|
+
exports.Article = require_Article.Article;
|
|
60
|
+
exports.ArticleByline = require_ArticleByline.ArticleByline;
|
|
61
|
+
exports.ArticleBylineAccordionItem = require_ArticleByline.ArticleBylineAccordionItem;
|
|
62
|
+
exports.ArticleContent = require_Article.ArticleContent;
|
|
63
|
+
exports.ArticleFootNotes = require_ArticleFootNotes.ArticleFootNotes;
|
|
64
|
+
exports.ArticleFooter = require_Article.ArticleFooter;
|
|
65
|
+
exports.ArticleHGroup = require_Article.ArticleHGroup;
|
|
66
|
+
exports.ArticleHeader = require_Article.ArticleHeader;
|
|
67
|
+
exports.ArticleTitle = require_Article.ArticleTitle;
|
|
68
|
+
exports.ArticleWrapper = require_Article.ArticleWrapper;
|
|
69
|
+
exports.AudioEmbed = require_AudioEmbed.default;
|
|
70
|
+
exports.AudioPlayer = require_AudioPlayer.default;
|
|
71
|
+
exports.BlockConcept = require_ConceptEmbed.BlockConcept;
|
|
72
|
+
exports.Breadcrumb = require_Breadcrumb.default;
|
|
73
|
+
exports.BrightcoveEmbed = require_BrightcoveEmbed.default;
|
|
74
|
+
exports.CampaignBlock = require_CampaignBlock.default;
|
|
75
|
+
exports.CodeBlock = require_CodeBlock.default;
|
|
76
|
+
exports.CodeEmbed = require_CodeEmbed.default;
|
|
77
|
+
exports.Concept = require_Concept.Concept;
|
|
78
|
+
exports.ConceptEmbed = require_ConceptEmbed.ConceptEmbed;
|
|
79
|
+
exports.ConceptInlineTriggerButton = require_ConceptInlineTriggerButton.ConceptInlineTriggerButton;
|
|
80
|
+
exports.ContactBlock = require_ContactBlock.ContactBlock;
|
|
81
|
+
exports.ContentLinkEmbed = require_ContentLinkEmbed.default;
|
|
82
|
+
exports.ContentTypeBadge = require_ContentTypeBadge.ContentTypeBadge;
|
|
83
|
+
exports.CopyParagraphButton = require_CopyParagraphButton.default;
|
|
84
|
+
exports.CopyrightEmbed = require_CopyrightEmbed.default;
|
|
85
|
+
exports.EmbedByline = require_EmbedByline.EmbedByline;
|
|
86
|
+
exports.EmbedWrapper = require_EmbedWrapper.EmbedWrapper;
|
|
87
|
+
exports.ExternalEmbed = require_ExternalEmbed.default;
|
|
88
|
+
exports.FactBox = require_FactBox.default;
|
|
89
|
+
exports.File = require_File.File;
|
|
90
|
+
exports.FileListElement = require_File.FileListElement;
|
|
91
|
+
exports.FileListEmbed = require_FileList.FileListEmbed;
|
|
92
|
+
exports.FileListItem = require_FileList.FileListItem;
|
|
93
|
+
exports.FileListWrapper = require_FileList.FileListWrapper;
|
|
94
|
+
exports.FootnoteEmbed = require_FootnoteEmbed.default;
|
|
95
|
+
exports.Gloss = require_Gloss.default;
|
|
96
|
+
exports.GlossExample = require_GlossExample.default;
|
|
97
|
+
exports.Grid = require_Grid.Grid;
|
|
98
|
+
exports.GridParallaxItem = require_GridParallaxItem.GridParallaxItem;
|
|
99
|
+
exports.H5pEmbed = require_H5pEmbed.default;
|
|
100
|
+
exports.HomeBreadcrumb = require_HomeBreadcrumb.default;
|
|
101
|
+
exports.IframeEmbed = require_IframeEmbed.default;
|
|
102
|
+
exports.ImageEmbed = require_ImageEmbed.default;
|
|
103
|
+
exports.InlineConcept = require_ConceptEmbed.InlineConcept;
|
|
104
|
+
exports.InlineTriggerButton = require_InlineTriggerButton.InlineTriggerButton;
|
|
105
|
+
exports.KeyFigure = require_KeyFigure.default;
|
|
106
|
+
exports.LicenseLink = require_LicenseLink.LicenseLink;
|
|
107
|
+
exports.LinkBlock = require_LinkBlock.default;
|
|
108
|
+
exports.LinkBlockSection = require_LinkBlockSection.default;
|
|
109
|
+
exports.PdfFile = require_PdfFile.PdfFile;
|
|
110
|
+
exports.Pitch = require_Pitch.Pitch;
|
|
111
|
+
exports.RelatedArticle = require_RelatedArticleList.RelatedArticle;
|
|
112
|
+
exports.RelatedArticleList = require_RelatedArticleList.RelatedArticleList;
|
|
113
|
+
exports.RelatedContentEmbed = require_RelatedContentEmbed.default;
|
|
114
|
+
exports.ResourceBox = require_ResourceBox.ResourceBox;
|
|
115
|
+
exports.TagSelectorClearTrigger = require_TagSelector.TagSelectorClearTrigger;
|
|
116
|
+
exports.TagSelectorControl = require_TagSelector.TagSelectorControl;
|
|
117
|
+
exports.TagSelectorInput = require_TagSelector.TagSelectorInput;
|
|
118
|
+
exports.TagSelectorInputBase = require_TagSelector.TagSelectorInputBase;
|
|
119
|
+
exports.TagSelectorItemInput = require_TagSelector.TagSelectorItemInput;
|
|
120
|
+
exports.TagSelectorLabel = require_TagSelector.TagSelectorLabel;
|
|
121
|
+
exports.TagSelectorRoot = require_TagSelector.TagSelectorRoot;
|
|
122
|
+
exports.TagSelectorTrigger = require_TagSelector.TagSelectorTrigger;
|
|
123
|
+
exports.UnknownEmbed = require_UnknownEmbed.default;
|
|
124
|
+
exports.UuDisclaimerEmbed = require_UuDisclaimerEmbed.default;
|
|
125
|
+
exports.ZendeskButton = require_ZendeskButton.ZendeskButton;
|
|
126
|
+
exports.codeLanguageOptions = require_codeLanguageOptions.codeLanguageOptions;
|
|
127
|
+
exports.constants = require_index.default;
|
|
128
|
+
exports.contactBlockBackgrounds = require_ContactBlock.contactBlockBackgrounds;
|
|
129
|
+
exports.contentTypeToBadgeVariantMap = require_ContentTypeBadge.contentTypeToBadgeVariantMap;
|
|
130
|
+
exports.formatNestedMessages = require_formatNestedMessages.formatNestedMessages;
|
|
131
|
+
exports.getCrop = require_ImageEmbed.getCrop;
|
|
132
|
+
exports.getFocalPoint = require_ImageEmbed.getFocalPoint;
|
|
133
|
+
exports.getPossiblyRelativeUrl = require_relativeUrl.getPossiblyRelativeUrl;
|
|
134
|
+
exports.licenseAttributes = require_licenseAttributes.licenseAttributes;
|
|
135
|
+
exports.messagesEN = require_messages_en.default;
|
|
136
|
+
exports.messagesNB = require_messages_nb.default;
|
|
137
|
+
exports.messagesNN = require_messages_nn.default;
|
|
138
|
+
exports.messagesSE = require_messages_se.default;
|
|
139
|
+
exports.useAudioSearchTranslations = require_useComponentTranslations.useAudioSearchTranslations;
|
|
140
|
+
exports.useComboboxTranslations = require_useComponentTranslations.useComboboxTranslations;
|
|
141
|
+
exports.useDatePickerTranslations = require_useComponentTranslations.useDatePickerTranslations;
|
|
142
|
+
exports.useImageSearchTranslations = require_useComponentTranslations.useImageSearchTranslations;
|
|
143
|
+
exports.usePaginationTranslations = require_useComponentTranslations.usePaginationTranslations;
|
|
144
|
+
exports.useTagSelectorTranslations = require_useComponentTranslations.useTagSelectorTranslations;
|
|
145
|
+
exports.useTagsInputTranslations = require_useComponentTranslations.useTagsInputTranslations;
|
|
146
|
+
exports.useVideoSearchTranslations = require_useComponentTranslations.useVideoSearchTranslations;
|