@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
package/es/i18n/i18n.js
CHANGED
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import i18n from "i18next";
|
|
1
|
+
import { messages_en_default } from "../locale/messages-en.js";
|
|
2
|
+
import { messages_nb_default } from "../locale/messages-nb.js";
|
|
3
|
+
import { messages_nn_default } from "../locale/messages-nn.js";
|
|
4
|
+
import { messages_se_default } from "../locale/messages-se.js";
|
|
10
5
|
import { initReactI18next } from "react-i18next";
|
|
11
|
-
import
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
import i18n from "i18next";
|
|
7
|
+
|
|
8
|
+
//#region src/i18n/i18n.ts
|
|
9
|
+
const supportedTranslationLanguages = [
|
|
10
|
+
"nb",
|
|
11
|
+
"nn",
|
|
12
|
+
"en",
|
|
13
|
+
"se"
|
|
14
|
+
];
|
|
16
15
|
const i18nInstance = i18n.use(initReactI18next);
|
|
17
16
|
i18nInstance.init({
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
},
|
|
27
|
-
nb: {
|
|
28
|
-
translation: messagesNB
|
|
29
|
-
},
|
|
30
|
-
se: {
|
|
31
|
-
translation: messagesSE
|
|
32
|
-
}
|
|
33
|
-
}
|
|
17
|
+
fallbackLng: "nb",
|
|
18
|
+
supportedLngs: supportedTranslationLanguages,
|
|
19
|
+
resources: {
|
|
20
|
+
en: { translation: messages_en_default },
|
|
21
|
+
nn: { translation: messages_nn_default },
|
|
22
|
+
nb: { translation: messages_nb_default },
|
|
23
|
+
se: { translation: messages_se_default }
|
|
24
|
+
}
|
|
34
25
|
});
|
|
35
|
-
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
export { i18nInstance, supportedTranslationLanguages };
|
|
29
|
+
//# sourceMappingURL=i18n.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"i18n.js","names":["messagesEN","messagesNN","messagesNB","messagesSE"],"sources":["../../src/i18n/i18n.ts"],"sourcesContent":["/**\n * Copyright (c) 2021-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 i18n from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport messagesEN from \"../locale/messages-en\";\nimport messagesNB from \"../locale/messages-nb\";\nimport messagesNN from \"../locale/messages-nn\";\nimport messagesSE from \"../locale/messages-se\";\n\nexport const supportedTranslationLanguages = [\"nb\", \"nn\", \"en\", \"se\"] as const;\nconst i18nInstance = i18n.use(initReactI18next);\n\ni18nInstance.init({\n fallbackLng: \"nb\",\n supportedLngs: supportedTranslationLanguages,\n resources: {\n en: {\n translation: messagesEN,\n },\n nn: {\n translation: messagesNN,\n },\n nb: {\n translation: messagesNB,\n },\n se: {\n translation: messagesSE,\n },\n },\n});\n\nexport { i18nInstance };\n"],"mappings":";;;;;;;;AAeA,MAAa,gCAAgC;CAAC;CAAM;CAAM;CAAM;AAAK;AACrE,MAAM,eAAe,KAAK,IAAI,iBAAiB;AAE/C,aAAa,KAAK;CAChB,aAAa;CACb,eAAe;CACf,WAAW;EACT,IAAI,EACF,aAAaA,oBACd;EACD,IAAI,EACF,aAAaC,oBACd;EACD,IAAI,EACF,aAAaC,oBACd;EACD,IAAI,EACF,aAAaC,oBACd;CACF;AACF,EAAC"}
|
|
@@ -1,211 +1,155 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2024-present, NDLA.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { useTranslation } from "react-i18next";
|
|
10
1
|
import { useMemo } from "react";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}),
|
|
28
|
-
tagEdited: tag => t("tagEdited", {
|
|
29
|
-
tag
|
|
30
|
-
}),
|
|
31
|
-
tagUpdated: tag => t("tagUpdated", {
|
|
32
|
-
tag
|
|
33
|
-
}),
|
|
34
|
-
tagDeleted: tag => t("tagDeleted", {
|
|
35
|
-
tag
|
|
36
|
-
}),
|
|
37
|
-
tagSelected: tag => t("tagSelected", {
|
|
38
|
-
tag
|
|
39
|
-
}),
|
|
40
|
-
...translations
|
|
41
|
-
}), [t, translations]);
|
|
2
|
+
import { useTranslation } from "react-i18next";
|
|
3
|
+
|
|
4
|
+
//#region src/i18n/useComponentTranslations.ts
|
|
5
|
+
const useTagsInputTranslations = (translations) => {
|
|
6
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.tagsInput" });
|
|
7
|
+
return useMemo(() => ({
|
|
8
|
+
clearTriggerLabel: t("clearTriggerLabel"),
|
|
9
|
+
deleteTagTriggerLabel: (tag) => t("deleteTagTriggerLabel", { tag }),
|
|
10
|
+
tagAdded: (tag) => t("tagAdded", { tag }),
|
|
11
|
+
tagsPasted: (tag) => t("tagsPasted", { length: tag.length }),
|
|
12
|
+
tagEdited: (tag) => t("tagEdited", { tag }),
|
|
13
|
+
tagUpdated: (tag) => t("tagUpdated", { tag }),
|
|
14
|
+
tagDeleted: (tag) => t("tagDeleted", { tag }),
|
|
15
|
+
tagSelected: (tag) => t("tagSelected", { tag }),
|
|
16
|
+
...translations
|
|
17
|
+
}), [t, translations]);
|
|
42
18
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
triggerLabel: t("triggerLabel"),
|
|
51
|
-
clearTriggerLabel: t("clearTriggerLabel"),
|
|
52
|
-
...translations
|
|
53
|
-
}), [t, translations]);
|
|
19
|
+
const useComboboxTranslations = (translations) => {
|
|
20
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.combobox" });
|
|
21
|
+
return useMemo(() => ({
|
|
22
|
+
triggerLabel: t("triggerLabel"),
|
|
23
|
+
clearTriggerLabel: t("clearTriggerLabel"),
|
|
24
|
+
...translations
|
|
25
|
+
}), [t, translations]);
|
|
54
26
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
27
|
+
const useTagSelectorTranslations = (translations) => {
|
|
28
|
+
const tagsInputTranslations = useTagsInputTranslations();
|
|
29
|
+
const comboboxTranslations = useComboboxTranslations();
|
|
30
|
+
return useMemo(() => ({
|
|
31
|
+
...comboboxTranslations,
|
|
32
|
+
...tagsInputTranslations,
|
|
33
|
+
...translations
|
|
34
|
+
}), [
|
|
35
|
+
comboboxTranslations,
|
|
36
|
+
tagsInputTranslations,
|
|
37
|
+
translations
|
|
38
|
+
]);
|
|
63
39
|
};
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return lastPage ? t("lastPage", {
|
|
77
|
-
page: details.page
|
|
78
|
-
}) : t("page", {
|
|
79
|
-
page: details.page
|
|
80
|
-
});
|
|
81
|
-
},
|
|
82
|
-
...translations
|
|
83
|
-
}), [translations, t]);
|
|
40
|
+
const usePaginationTranslations = (translations) => {
|
|
41
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.pagination" });
|
|
42
|
+
return useMemo(() => ({
|
|
43
|
+
rootLabel: t("rootLabel"),
|
|
44
|
+
prevTriggerLabel: t("prevTriggerLabel"),
|
|
45
|
+
nextTriggerLabel: t("nextTriggerLabel"),
|
|
46
|
+
itemLabel: (details) => {
|
|
47
|
+
const lastPage = details.totalPages > 1 && details.page === details.totalPages;
|
|
48
|
+
return lastPage ? t("lastPage", { page: details.page }) : t("page", { page: details.page });
|
|
49
|
+
},
|
|
50
|
+
...translations
|
|
51
|
+
}), [translations, t]);
|
|
84
52
|
};
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
paginationTranslations: {
|
|
117
|
-
...paginationTranslations,
|
|
118
|
-
...fallbackPaginationTranslations
|
|
119
|
-
},
|
|
120
|
-
...remaining
|
|
121
|
-
}), [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining]);
|
|
53
|
+
const useImageSearchTranslations = (translations = {}) => {
|
|
54
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.imageSearch" });
|
|
55
|
+
const paginationTranslations = usePaginationTranslations();
|
|
56
|
+
const { imagePreview, paginationTranslations: fallbackPaginationTranslations,...remaining } = translations;
|
|
57
|
+
return useMemo(() => ({
|
|
58
|
+
searchPlaceholder: t("searchPlaceholder"),
|
|
59
|
+
searchButtonTitle: t("searchButtonTitle"),
|
|
60
|
+
imagePreview: {
|
|
61
|
+
creatorsLabel: t("imagePreview.creatorsLabel"),
|
|
62
|
+
license: t("imagePreview.license"),
|
|
63
|
+
caption: t("imagePreview.caption"),
|
|
64
|
+
altText: t("imagePreview.altText"),
|
|
65
|
+
modelRelease: t("imagePreview.modelRelease"),
|
|
66
|
+
tags: t("imagePreview.tags"),
|
|
67
|
+
close: t("close"),
|
|
68
|
+
checkboxLabel: t("imagePreview.checkboxLabel"),
|
|
69
|
+
useImageTitle: t("imagePreview.useImageTitle"),
|
|
70
|
+
...imagePreview
|
|
71
|
+
},
|
|
72
|
+
paginationTranslations: {
|
|
73
|
+
...paginationTranslations,
|
|
74
|
+
...fallbackPaginationTranslations
|
|
75
|
+
},
|
|
76
|
+
...remaining
|
|
77
|
+
}), [
|
|
78
|
+
t,
|
|
79
|
+
paginationTranslations,
|
|
80
|
+
imagePreview,
|
|
81
|
+
fallbackPaginationTranslations,
|
|
82
|
+
remaining
|
|
83
|
+
]);
|
|
122
84
|
};
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
},
|
|
144
|
-
...remaining
|
|
145
|
-
}), [t, paginationTranslations, fallbackPaginationTranslations, remaining]);
|
|
85
|
+
const useAudioSearchTranslations = (translations = {}) => {
|
|
86
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.audioSearch" });
|
|
87
|
+
const paginationTranslations = usePaginationTranslations();
|
|
88
|
+
const { paginationTranslations: fallbackPaginationTranslations,...remaining } = translations;
|
|
89
|
+
return useMemo(() => ({
|
|
90
|
+
searchPlaceholder: t("searchPlaceholder"),
|
|
91
|
+
searchButtonTitle: t("searchButtonTitle"),
|
|
92
|
+
useAudio: t("useAudio"),
|
|
93
|
+
noResults: t("noResults"),
|
|
94
|
+
paginationTranslations: {
|
|
95
|
+
...paginationTranslations,
|
|
96
|
+
...fallbackPaginationTranslations
|
|
97
|
+
},
|
|
98
|
+
...remaining
|
|
99
|
+
}), [
|
|
100
|
+
t,
|
|
101
|
+
paginationTranslations,
|
|
102
|
+
fallbackPaginationTranslations,
|
|
103
|
+
remaining
|
|
104
|
+
]);
|
|
146
105
|
};
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
addVideo: t("addVideo"),
|
|
161
|
-
close: t("close"),
|
|
162
|
-
...translations
|
|
163
|
-
}), [t, translations]);
|
|
106
|
+
const useVideoSearchTranslations = (translations) => {
|
|
107
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.videoSearch" });
|
|
108
|
+
return useMemo(() => ({
|
|
109
|
+
searchPlaceholder: t("searchPlaceholder"),
|
|
110
|
+
searchButtonTitle: t("searchButtonTitle"),
|
|
111
|
+
loadMoreVideos: t("loadMoreVideos"),
|
|
112
|
+
noResults: t("noResults"),
|
|
113
|
+
is360Video: t("is360Video"),
|
|
114
|
+
previewVideo: t("previewVideo"),
|
|
115
|
+
addVideo: t("addVideo"),
|
|
116
|
+
close: t("close"),
|
|
117
|
+
...translations
|
|
118
|
+
}), [t, translations]);
|
|
164
119
|
};
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
trigger: open => t(`trigger.${open ? "close" : "open"}`),
|
|
202
|
-
content: t("content"),
|
|
203
|
-
placeholder: _locale => {
|
|
204
|
-
return {
|
|
205
|
-
day: "dd",
|
|
206
|
-
month: "mm",
|
|
207
|
-
year: "yyyy"
|
|
208
|
-
};
|
|
209
|
-
}
|
|
210
|
-
}), [t, translations]);
|
|
211
|
-
};
|
|
120
|
+
const useDatePickerTranslations = (translations) => {
|
|
121
|
+
const { t } = useTranslation("translation", { keyPrefix: "component.datePicker" });
|
|
122
|
+
return useMemo(() => ({
|
|
123
|
+
dayCell: (state) => {
|
|
124
|
+
if (state.unavailable) return t("dayCell.unavailable", { date: state.formattedDate });
|
|
125
|
+
else if (state.selected) return t("dayCell.selected", { date: state.formattedDate });
|
|
126
|
+
else return t("dayCell.select", { date: state.formattedDate });
|
|
127
|
+
},
|
|
128
|
+
nextTrigger: (view) => t(`nextTrigger.${view}`),
|
|
129
|
+
prevTrigger: (view) => t(`prevTrigger.${view}`),
|
|
130
|
+
monthSelect: t("monthSelect"),
|
|
131
|
+
yearSelect: t("yearSelect"),
|
|
132
|
+
viewTrigger: (view) => t(`viewTrigger.${view}`),
|
|
133
|
+
presetTrigger: (value) => {
|
|
134
|
+
if (Array.isArray(value)) return t("presetTrigger.range", {
|
|
135
|
+
start: value[0],
|
|
136
|
+
end: value[1]
|
|
137
|
+
});
|
|
138
|
+
else return t("presetTrigger.single", { date: value });
|
|
139
|
+
},
|
|
140
|
+
clearTrigger: t("clearTrigger"),
|
|
141
|
+
trigger: (open) => t(`trigger.${open ? "close" : "open"}`),
|
|
142
|
+
content: t("content"),
|
|
143
|
+
placeholder: (_locale) => {
|
|
144
|
+
return {
|
|
145
|
+
day: "dd",
|
|
146
|
+
month: "mm",
|
|
147
|
+
year: "yyyy"
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
}), [t, translations]);
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
//#endregion
|
|
154
|
+
export { useAudioSearchTranslations, useComboboxTranslations, useDatePickerTranslations, useImageSearchTranslations, usePaginationTranslations, useTagSelectorTranslations, useTagsInputTranslations, useVideoSearchTranslations };
|
|
155
|
+
//# sourceMappingURL=useComponentTranslations.js.map
|
|
@@ -0,0 +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,eAAe,eAAe,EAAE,WAAW,sBAAuB,EAAC;AAEjF,QAAO,QACL,OAAO;EACL,mBAAmB,EAAE,oBAAoB;EACzC,uBAAuB,CAAC,QAAQ,EAAE,yBAAyB,EAAE,IAAK,EAAC;EACnE,UAAU,CAAC,QAAQ,EAAE,YAAY,EAAE,IAAK,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C,GAAG,YAAa,EAClB;AACF"}
|
package/es/index.js
CHANGED
|
@@ -1,45 +1,65 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { LicenseLink } from "./LicenseByline/LicenseLink.js";
|
|
2
|
+
import { EmbedByline } from "./LicenseByline/EmbedByline.js";
|
|
3
|
+
import { licenseAttributes } from "./utils/licenseAttributes.js";
|
|
4
|
+
import { ImageEmbed_default, getCrop, getFocalPoint } from "./Embed/ImageEmbed.js";
|
|
5
|
+
import { InlineTriggerButton } from "./Embed/InlineTriggerButton.js";
|
|
6
|
+
import { AudioPlayer_default } from "./AudioPlayer/index.js";
|
|
7
|
+
import { AudioEmbed_default } from "./Embed/AudioEmbed.js";
|
|
8
|
+
import { H5pEmbed_default } from "./Embed/H5pEmbed.js";
|
|
9
|
+
import { ResourceBox_default } from "./ResourceBox/ResourceBox.js";
|
|
10
|
+
import { ExternalEmbed_default } from "./Embed/ExternalEmbed.js";
|
|
11
|
+
import { IframeEmbed_default } from "./Embed/IframeEmbed.js";
|
|
12
|
+
import { FootnoteEmbed_default } from "./Embed/FootnoteEmbed.js";
|
|
13
|
+
import { BrightcoveEmbed_default } from "./Embed/BrightcoveEmbed.js";
|
|
14
|
+
import { ContentLinkEmbed_default } from "./Embed/ContentLinkEmbed.js";
|
|
15
|
+
import { ContentTypeBadge, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadge.js";
|
|
16
|
+
import { RelatedArticle } from "./RelatedArticleList/RelatedArticleList.js";
|
|
17
|
+
import { RelatedContentEmbed_default } from "./Embed/RelatedContentEmbed.js";
|
|
18
|
+
import { ConceptInlineTriggerButton } from "./Embed/ConceptInlineTriggerButton.js";
|
|
19
|
+
import { GlossExample_default } from "./Gloss/GlossExample.js";
|
|
20
|
+
import { Gloss_default } from "./Gloss/Gloss.js";
|
|
21
|
+
import { BlockConcept, ConceptEmbed, InlineConcept } from "./Embed/ConceptEmbed.js";
|
|
22
|
+
import { UnknownEmbed_default } from "./Embed/UnknownEmbed.js";
|
|
23
|
+
import { UuDisclaimerEmbed_default } from "./Embed/UuDisclaimerEmbed.js";
|
|
24
|
+
import { CopyrightEmbed_default } from "./Embed/CopyrightEmbed.js";
|
|
25
|
+
import { CodeBlock_default } from "./CodeBlock/CodeBlock.js";
|
|
26
|
+
import { codeLanguageOptions } from "./CodeBlock/codeLanguageOptions.js";
|
|
27
|
+
import { CodeEmbed_default } from "./Embed/CodeEmbed.js";
|
|
28
|
+
import { EmbedWrapper } from "./Embed/EmbedWrapper.js";
|
|
29
|
+
import { Concept } from "./Concept/Concept.js";
|
|
30
|
+
import { ArticleFootNotes } from "./Article/ArticleFootNotes.js";
|
|
31
|
+
import { ArticleByline, ArticleBylineAccordionItem } from "./Article/ArticleByline.js";
|
|
32
|
+
import { Article, ArticleContent, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper } from "./Article/Article.js";
|
|
33
|
+
import { model_default } from "./model/index.js";
|
|
34
|
+
import { messages_en_default } from "./locale/messages-en.js";
|
|
35
|
+
import { messages_nb_default } from "./locale/messages-nb.js";
|
|
36
|
+
import { messages_nn_default } from "./locale/messages-nn.js";
|
|
37
|
+
import { messages_se_default } from "./locale/messages-se.js";
|
|
38
|
+
import { i18nInstance } from "./i18n/i18n.js";
|
|
39
|
+
import { getPossiblyRelativeUrl } from "./utils/relativeUrl.js";
|
|
40
|
+
import { RelatedArticleList_default } from "./RelatedArticleList/index.js";
|
|
41
|
+
import { ErrorMessage_default } from "./ErrorMessage/index.js";
|
|
42
|
+
import { FileListEmbed, FileListItem, FileListWrapper } from "./FileList/FileList.js";
|
|
43
|
+
import { File, FileListElement } from "./FileList/File.js";
|
|
44
|
+
import { PdfFile } from "./FileList/PdfFile.js";
|
|
45
|
+
import { FactBox_default } from "./FactBox/index.js";
|
|
46
|
+
import { ContentTypeHero } from "./ContentTypeHero/ContentTypeHero.js";
|
|
47
|
+
import { HomeBreadcrumb_default } from "./Breadcrumb/HomeBreadcrumb.js";
|
|
48
|
+
import { Breadcrumb_default } from "./Breadcrumb/index.js";
|
|
49
|
+
import { formatNestedMessages } from "./i18n/formatNestedMessages.js";
|
|
50
|
+
import { TagSelectorClearTrigger, TagSelectorControl, TagSelectorInput, TagSelectorInputBase, TagSelectorItemInput, TagSelectorLabel, TagSelectorRoot, TagSelectorTrigger } from "./TagSelector/TagSelector.js";
|
|
51
|
+
import { useAudioSearchTranslations, useComboboxTranslations, useDatePickerTranslations, useImageSearchTranslations, usePaginationTranslations, useTagSelectorTranslations, useTagsInputTranslations, useVideoSearchTranslations } from "./i18n/useComponentTranslations.js";
|
|
52
|
+
import { ContentTypeBlockQuote } from "./ContentTypeBlockQuote/ContentTypeBlockQuote.js";
|
|
53
|
+
import { ContentTypeFramedContent } from "./ContentTypeFramedContent/ContentTypeFramedContent.js";
|
|
54
|
+
import { CopyParagraphButton_default } from "./CopyParagraphButton/index.js";
|
|
55
|
+
import { Pitch } from "./Pitch/Pitch.js";
|
|
56
|
+
import { KeyFigure_default } from "./KeyFigure/KeyFigure.js";
|
|
57
|
+
import { ContactBlock, contactBlockBackgrounds } from "./ContactBlock/ContactBlock.js";
|
|
58
|
+
import { CampaignBlock_default } from "./CampaignBlock/CampaignBlock.js";
|
|
59
|
+
import { Grid } from "./Grid/Grid.js";
|
|
60
|
+
import { GridParallaxItem } from "./Grid/GridParallaxItem.js";
|
|
61
|
+
import { LinkBlock_default } from "./LinkBlock/LinkBlock.js";
|
|
62
|
+
import { LinkBlockSection_default } from "./LinkBlock/LinkBlockSection.js";
|
|
63
|
+
import { ZendeskButton } from "./ZendeskButton/ZendeskButton.js";
|
|
8
64
|
|
|
9
|
-
|
|
10
|
-
// Move components to this file when they are migrated to typescript
|
|
11
|
-
|
|
12
|
-
export { Concept } from "./Concept/Concept";
|
|
13
|
-
export { ImageEmbed, getCrop, getFocalPoint, AudioEmbed, H5pEmbed, ExternalEmbed, IframeEmbed, FootnoteEmbed, BrightcoveEmbed, ContentLinkEmbed, RelatedContentEmbed, ConceptEmbed, UnknownEmbed, InlineConcept, BlockConcept, UuDisclaimerEmbed, CopyrightEmbed, CodeEmbed, InlineTriggerButton, ConceptInlineTriggerButton, EmbedWrapper } from "./Embed";
|
|
14
|
-
export { LicenseLink, EmbedByline } from "./LicenseByline";
|
|
15
|
-
export { ArticleByline, ArticleBylineAccordionItem, ArticleFootNotes, ArticleWrapper, Article, ArticleFooter, ArticleHeader, ArticleContent, ArticleHGroup, ArticleTitle } from "./Article";
|
|
16
|
-
export { getPossiblyRelativeUrl } from "./utils/relativeUrl";
|
|
17
|
-
export { default as RelatedArticleList, RelatedArticle } from "./RelatedArticleList";
|
|
18
|
-
export { default as ErrorMessage } from "./ErrorMessage";
|
|
19
|
-
export { FileListEmbed, File, PdfFile, FileListItem, FileListElement, FileListWrapper } from "./FileList";
|
|
20
|
-
export { default as FactBox } from "./FactBox";
|
|
21
|
-
export { ContentTypeHero } from "./ContentTypeHero";
|
|
22
|
-
export { ResourceBox } from "./ResourceBox";
|
|
23
|
-
export { default as AudioPlayer } from "./AudioPlayer";
|
|
24
|
-
export { default as constants } from "./model";
|
|
25
|
-
export { default as messagesNB } from "./locale/messages-nb";
|
|
26
|
-
export { default as messagesNN } from "./locale/messages-nn";
|
|
27
|
-
export { default as messagesEN } from "./locale/messages-en";
|
|
28
|
-
export { default as messagesSE } from "./locale/messages-se";
|
|
29
|
-
export { default as Breadcrumb, HomeBreadcrumb } from "./Breadcrumb";
|
|
30
|
-
export { i18nInstance, formatNestedMessages, useTagsInputTranslations, useTagSelectorTranslations, useComboboxTranslations, usePaginationTranslations, useAudioSearchTranslations, useImageSearchTranslations, useVideoSearchTranslations, useDatePickerTranslations } from "./i18n";
|
|
31
|
-
export { ContentTypeBadge, contentTypeToBadgeVariantMap } from "./ContentTypeBadge/ContentTypeBadge";
|
|
32
|
-
export { ContentTypeBlockQuote } from "./ContentTypeBlockQuote/ContentTypeBlockQuote";
|
|
33
|
-
export { ContentTypeFramedContent } from "./ContentTypeFramedContent/ContentTypeFramedContent";
|
|
34
|
-
export { default as CopyParagraphButton } from "./CopyParagraphButton";
|
|
35
|
-
export { TagSelectorRoot, TagSelectorLabel, TagSelectorItemInput, TagSelectorTrigger, TagSelectorControl, TagSelectorClearTrigger, TagSelectorInputBase, TagSelectorInput } from "./TagSelector/TagSelector";
|
|
36
|
-
export { Pitch } from "./Pitch";
|
|
37
|
-
export { KeyFigure } from "./KeyFigure";
|
|
38
|
-
export { ContactBlock, contactBlockBackgrounds } from "./ContactBlock";
|
|
39
|
-
export { CampaignBlock } from "./CampaignBlock";
|
|
40
|
-
export { Grid, GridParallaxItem } from "./Grid";
|
|
41
|
-
export { Gloss, GlossExample } from "./Gloss";
|
|
42
|
-
export { LinkBlock, LinkBlockSection } from "./LinkBlock";
|
|
43
|
-
export { CodeBlock, codeLanguageOptions } from "./CodeBlock";
|
|
44
|
-
export { ZendeskButton } from "./ZendeskButton/ZendeskButton";
|
|
45
|
-
export { licenseAttributes } from "./utils/licenseAttributes";
|
|
65
|
+
export { Article, ArticleByline, ArticleBylineAccordionItem, ArticleContent, ArticleFootNotes, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper, AudioEmbed_default as AudioEmbed, AudioPlayer_default as AudioPlayer, BlockConcept, Breadcrumb_default as Breadcrumb, BrightcoveEmbed_default as BrightcoveEmbed, CampaignBlock_default as CampaignBlock, CodeBlock_default as CodeBlock, CodeEmbed_default as CodeEmbed, Concept, ConceptEmbed, ConceptInlineTriggerButton, ContactBlock, ContentLinkEmbed_default as ContentLinkEmbed, ContentTypeBadge, ContentTypeBlockQuote, ContentTypeFramedContent, ContentTypeHero, CopyParagraphButton_default as CopyParagraphButton, CopyrightEmbed_default as CopyrightEmbed, EmbedByline, EmbedWrapper, ErrorMessage_default as ErrorMessage, ExternalEmbed_default as ExternalEmbed, FactBox_default as FactBox, File, FileListElement, FileListEmbed, FileListItem, FileListWrapper, FootnoteEmbed_default as FootnoteEmbed, Gloss_default as Gloss, GlossExample_default as GlossExample, Grid, GridParallaxItem, H5pEmbed_default as H5pEmbed, HomeBreadcrumb_default as HomeBreadcrumb, IframeEmbed_default as IframeEmbed, ImageEmbed_default as ImageEmbed, InlineConcept, InlineTriggerButton, KeyFigure_default as KeyFigure, LicenseLink, LinkBlock_default as LinkBlock, LinkBlockSection_default as LinkBlockSection, PdfFile, Pitch, RelatedArticle, RelatedArticleList_default as RelatedArticleList, RelatedContentEmbed_default as RelatedContentEmbed, ResourceBox_default as ResourceBox, TagSelectorClearTrigger, TagSelectorControl, TagSelectorInput, TagSelectorInputBase, TagSelectorItemInput, TagSelectorLabel, TagSelectorRoot, TagSelectorTrigger, UnknownEmbed_default as UnknownEmbed, UuDisclaimerEmbed_default as UuDisclaimerEmbed, ZendeskButton, codeLanguageOptions, model_default as constants, contactBlockBackgrounds, contentTypeToBadgeVariantMap, formatNestedMessages, getCrop, getFocalPoint, getPossiblyRelativeUrl, i18nInstance, licenseAttributes, messages_en_default as messagesEN, messages_nb_default as messagesNB, messages_nn_default as messagesNN, messages_se_default as messagesSE, useAudioSearchTranslations, useComboboxTranslations, useDatePickerTranslations, useImageSearchTranslations, usePaginationTranslations, useTagSelectorTranslations, useTagsInputTranslations, useVideoSearchTranslations };
|