@ndla/ui 56.0.121-alpha.0 → 56.0.122-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/lib/i18n/index.d.ts +1 -1
- package/lib/i18n/useComponentTranslations.d.ts +2 -1
- package/lib/index.d.ts +1 -1
- package/lib/locale/messages-en.d.ts +34 -0
- package/lib/locale/messages-nb.d.ts +34 -0
- package/lib/locale/messages-nn.d.ts +34 -0
- package/lib/locale/messages-se.d.ts +34 -0
- package/package.json +6 -5
- package/src/Article/ArticleByline.tsx +1 -1
- package/src/i18n/index.ts +1 -0
- package/src/i18n/useComponentTranslations.ts +36 -1
- package/src/index.ts +1 -0
- package/src/locale/messages-en.ts +34 -0
- package/src/locale/messages-nb.ts +34 -0
- package/src/locale/messages-nn.ts +34 -0
- package/src/locale/messages-se.ts +34 -0
- package/es/Article/Article.js +0 -199
- package/es/Article/ArticleByline.js +0 -182
- package/es/Article/ArticleFootNotes.js +0 -60
- package/es/Article/index.js +0 -11
- package/es/AudioPlayer/AudioPlayer.js +0 -218
- package/es/AudioPlayer/Controls.js +0 -332
- package/es/AudioPlayer/SpeechControl.js +0 -56
- package/es/AudioPlayer/index.js +0 -10
- package/es/Breadcrumb/Breadcrumb.js +0 -60
- package/es/Breadcrumb/BreadcrumbItem.js +0 -62
- package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
- package/es/Breadcrumb/index.js +0 -11
- package/es/CampaignBlock/CampaignBlock.js +0 -180
- package/es/CampaignBlock/index.js +0 -9
- package/es/CodeBlock/CodeBlock.js +0 -35
- package/es/CodeBlock/codeLanguageOptions.js +0 -84
- package/es/CodeBlock/index.js +0 -10
- package/es/Concept/Concept.js +0 -72
- package/es/ContactBlock/ContactBlock.js +0 -199
- package/es/ContactBlock/index.js +0 -9
- package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
- package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
- package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
- package/es/ContentTypeHero/ContentTypeHero.js +0 -50
- package/es/ContentTypeHero/index.js +0 -9
- package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
- package/es/CopyParagraphButton/index.js +0 -11
- package/es/Embed/AudioEmbed.js +0 -76
- package/es/Embed/BrightcoveEmbed.js +0 -133
- package/es/Embed/CodeEmbed.js +0 -79
- package/es/Embed/ConceptEmbed.js +0 -123
- package/es/Embed/ConceptInlineTriggerButton.js +0 -45
- package/es/Embed/ContentLinkEmbed.js +0 -51
- package/es/Embed/CopyrightEmbed.js +0 -33
- package/es/Embed/EmbedErrorPlaceholder.js +0 -58
- package/es/Embed/EmbedWrapper.js +0 -51
- package/es/Embed/ExternalEmbed.js +0 -74
- package/es/Embed/FootnoteEmbed.js +0 -44
- package/es/Embed/GlossEmbed.js +0 -80
- package/es/Embed/H5pEmbed.js +0 -61
- package/es/Embed/IframeEmbed.js +0 -93
- package/es/Embed/ImageEmbed.js +0 -238
- package/es/Embed/InlineTriggerButton.js +0 -37
- package/es/Embed/RelatedContentEmbed.js +0 -55
- package/es/Embed/UnknownEmbed.js +0 -31
- package/es/Embed/UuDisclaimerEmbed.js +0 -88
- package/es/Embed/index.js +0 -25
- package/es/Embed/types.js +0 -1
- package/es/ErrorMessage/ErrorMessage.js +0 -95
- package/es/ErrorMessage/index.js +0 -10
- package/es/FactBox/FactBox.js +0 -177
- package/es/FactBox/index.js +0 -10
- package/es/FileList/File.js +0 -101
- package/es/FileList/FileList.js +0 -47
- package/es/FileList/PdfFile.js +0 -50
- package/es/FileList/index.js +0 -11
- package/es/Gloss/Gloss.js +0 -175
- package/es/Gloss/GlossExample.js +0 -64
- package/es/Gloss/index.js +0 -10
- package/es/Grid/Grid.js +0 -94
- package/es/Grid/GridParallaxItem.js +0 -32
- package/es/Grid/index.js +0 -10
- package/es/KeyFigure/KeyFigure.js +0 -63
- package/es/KeyFigure/index.js +0 -9
- package/es/LicenseByline/EmbedByline.js +0 -212
- package/es/LicenseByline/LicenseLink.js +0 -56
- package/es/LicenseByline/index.js +0 -10
- package/es/LinkBlock/LinkBlock.js +0 -103
- package/es/LinkBlock/LinkBlockSection.js +0 -35
- package/es/LinkBlock/index.js +0 -10
- package/es/Pitch/Pitch.js +0 -83
- package/es/Pitch/index.js +0 -9
- package/es/RelatedArticleList/RelatedArticleList.js +0 -135
- package/es/RelatedArticleList/index.js +0 -11
- package/es/ResourceBox/ResourceBox.js +0 -99
- package/es/ResourceBox/index.js +0 -10
- package/es/TagSelector/TagSelector.js +0 -143
- package/es/ZendeskButton/ZendeskButton.js +0 -55
- package/es/i18n/formatNestedMessages.js +0 -25
- package/es/i18n/i18n.js +0 -35
- package/es/i18n/index.js +0 -11
- package/es/i18n/useComponentTranslations.js +0 -164
- package/es/index.js +0 -45
- package/es/locale/messages-en.js +0 -428
- package/es/locale/messages-nb.js +0 -428
- package/es/locale/messages-nn.js +0 -428
- package/es/locale/messages-se.js +0 -428
- package/es/model/ContentType.js +0 -68
- package/es/model/SubjectCategories.js +0 -12
- package/es/model/SubjectTypes.js +0 -11
- package/es/model/WordClass.js +0 -45
- package/es/model/index.js +0 -21
- package/es/types.js +0 -1
- package/es/utils/licenseAttributes.js +0 -18
- package/es/utils/relativeUrl.js +0 -37
- package/lib/Article/Article.js +0 -207
- package/lib/Article/ArticleByline.js +0 -189
- package/lib/Article/ArticleFootNotes.js +0 -67
- package/lib/Article/index.js +0 -68
- package/lib/AudioPlayer/AudioPlayer.js +0 -224
- package/lib/AudioPlayer/Controls.js +0 -338
- package/lib/AudioPlayer/SpeechControl.js +0 -62
- package/lib/AudioPlayer/index.js +0 -16
- package/lib/Breadcrumb/Breadcrumb.js +0 -67
- package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
- package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
- package/lib/Breadcrumb/index.js +0 -23
- package/lib/CampaignBlock/CampaignBlock.js +0 -187
- package/lib/CampaignBlock/index.js +0 -13
- package/lib/CodeBlock/CodeBlock.js +0 -41
- package/lib/CodeBlock/codeLanguageOptions.js +0 -90
- package/lib/CodeBlock/index.js +0 -20
- package/lib/Concept/Concept.js +0 -78
- package/lib/ContactBlock/ContactBlock.js +0 -206
- package/lib/ContactBlock/index.js +0 -18
- package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
- package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
- package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
- package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
- package/lib/ContentTypeHero/index.js +0 -12
- package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
- package/lib/CopyParagraphButton/index.js +0 -22
- package/lib/Embed/AudioEmbed.js +0 -84
- package/lib/Embed/BrightcoveEmbed.js +0 -142
- package/lib/Embed/CodeEmbed.js +0 -86
- package/lib/Embed/ConceptEmbed.js +0 -131
- package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
- package/lib/Embed/ContentLinkEmbed.js +0 -57
- package/lib/Embed/CopyrightEmbed.js +0 -39
- package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
- package/lib/Embed/EmbedWrapper.js +0 -57
- package/lib/Embed/ExternalEmbed.js +0 -81
- package/lib/Embed/FootnoteEmbed.js +0 -50
- package/lib/Embed/GlossEmbed.js +0 -88
- package/lib/Embed/H5pEmbed.js +0 -68
- package/lib/Embed/IframeEmbed.js +0 -100
- package/lib/Embed/ImageEmbed.js +0 -248
- package/lib/Embed/InlineTriggerButton.js +0 -43
- package/lib/Embed/RelatedContentEmbed.js +0 -61
- package/lib/Embed/UnknownEmbed.js +0 -37
- package/lib/Embed/UuDisclaimerEmbed.js +0 -94
- package/lib/Embed/index.js +0 -150
- package/lib/Embed/types.js +0 -5
- package/lib/ErrorMessage/ErrorMessage.js +0 -101
- package/lib/ErrorMessage/index.js +0 -16
- package/lib/FactBox/FactBox.js +0 -184
- package/lib/FactBox/index.js +0 -16
- package/lib/FileList/File.js +0 -108
- package/lib/FileList/FileList.js +0 -54
- package/lib/FileList/PdfFile.js +0 -57
- package/lib/FileList/index.js +0 -44
- package/lib/Gloss/Gloss.js +0 -181
- package/lib/Gloss/GlossExample.js +0 -70
- package/lib/Gloss/index.js +0 -20
- package/lib/Grid/Grid.js +0 -101
- package/lib/Grid/GridParallaxItem.js +0 -39
- package/lib/Grid/index.js +0 -19
- package/lib/KeyFigure/KeyFigure.js +0 -70
- package/lib/KeyFigure/index.js +0 -13
- package/lib/LicenseByline/EmbedByline.js +0 -220
- package/lib/LicenseByline/LicenseLink.js +0 -62
- package/lib/LicenseByline/index.js +0 -19
- package/lib/LinkBlock/LinkBlock.js +0 -110
- package/lib/LinkBlock/LinkBlockSection.js +0 -41
- package/lib/LinkBlock/index.js +0 -20
- package/lib/Pitch/Pitch.js +0 -91
- package/lib/Pitch/index.js +0 -12
- package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
- package/lib/RelatedArticleList/index.js +0 -21
- package/lib/ResourceBox/ResourceBox.js +0 -106
- package/lib/ResourceBox/index.js +0 -13
- package/lib/TagSelector/TagSelector.js +0 -150
- package/lib/ZendeskButton/ZendeskButton.js +0 -61
- package/lib/i18n/formatNestedMessages.js +0 -32
- package/lib/i18n/i18n.js +0 -41
- package/lib/i18n/index.js +0 -62
- package/lib/i18n/useComponentTranslations.js +0 -176
- package/lib/index.js +0 -593
- package/lib/locale/messages-en.js +0 -435
- package/lib/locale/messages-nb.js +0 -435
- package/lib/locale/messages-nn.js +0 -435
- package/lib/locale/messages-se.js +0 -435
- package/lib/model/ContentType.js +0 -74
- package/lib/model/SubjectCategories.js +0 -18
- package/lib/model/SubjectTypes.js +0 -17
- package/lib/model/WordClass.js +0 -51
- package/lib/model/index.js +0 -28
- package/lib/types.js +0 -5
- package/lib/utils/licenseAttributes.js +0 -25
- package/lib/utils/relativeUrl.js +0 -44
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.useVideoSearchTranslations = exports.useTagsInputTranslations = exports.useTagSelectorTranslations = exports.usePaginationTranslations = exports.useImageSearchTranslations = exports.useComboboxTranslations = exports.useAudioSearchTranslations = void 0;
|
|
7
|
-
var _reactI18next = require("react-i18next");
|
|
8
|
-
var _react = require("react");
|
|
9
|
-
/**
|
|
10
|
-
* Copyright (c) 2024-present, NDLA.
|
|
11
|
-
*
|
|
12
|
-
* This source code is licensed under the GPLv3 license found in the
|
|
13
|
-
* LICENSE file in the root directory of this source tree.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
|
|
17
|
-
const useTagsInputTranslations = translations => {
|
|
18
|
-
const {
|
|
19
|
-
t
|
|
20
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
21
|
-
keyPrefix: "component.tagsInput"
|
|
22
|
-
});
|
|
23
|
-
return (0, _react.useMemo)(() => ({
|
|
24
|
-
clearTriggerLabel: t("clearTriggerLabel"),
|
|
25
|
-
deleteTagTriggerLabel: tag => t("deleteTagTriggerLabel", {
|
|
26
|
-
tag
|
|
27
|
-
}),
|
|
28
|
-
tagAdded: tag => t("tagAdded", {
|
|
29
|
-
tag
|
|
30
|
-
}),
|
|
31
|
-
tagsPasted: tag => t("tagsPasted", {
|
|
32
|
-
length: tag.length
|
|
33
|
-
}),
|
|
34
|
-
tagEdited: tag => t("tagEdited", {
|
|
35
|
-
tag
|
|
36
|
-
}),
|
|
37
|
-
tagUpdated: tag => t("tagUpdated", {
|
|
38
|
-
tag
|
|
39
|
-
}),
|
|
40
|
-
tagDeleted: tag => t("tagDeleted", {
|
|
41
|
-
tag
|
|
42
|
-
}),
|
|
43
|
-
tagSelected: tag => t("tagSelected", {
|
|
44
|
-
tag
|
|
45
|
-
}),
|
|
46
|
-
...translations
|
|
47
|
-
}), [t, translations]);
|
|
48
|
-
};
|
|
49
|
-
exports.useTagsInputTranslations = useTagsInputTranslations;
|
|
50
|
-
const useComboboxTranslations = translations => {
|
|
51
|
-
const {
|
|
52
|
-
t
|
|
53
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
54
|
-
keyPrefix: "component.combobox"
|
|
55
|
-
});
|
|
56
|
-
return (0, _react.useMemo)(() => ({
|
|
57
|
-
triggerLabel: t("triggerLabel"),
|
|
58
|
-
clearTriggerLabel: t("clearTriggerLabel"),
|
|
59
|
-
...translations
|
|
60
|
-
}), [t, translations]);
|
|
61
|
-
};
|
|
62
|
-
exports.useComboboxTranslations = useComboboxTranslations;
|
|
63
|
-
const useTagSelectorTranslations = translations => {
|
|
64
|
-
const tagsInputTranslations = useTagsInputTranslations();
|
|
65
|
-
const comboboxTranslations = useComboboxTranslations();
|
|
66
|
-
return (0, _react.useMemo)(() => ({
|
|
67
|
-
...comboboxTranslations,
|
|
68
|
-
...tagsInputTranslations,
|
|
69
|
-
...translations
|
|
70
|
-
}), [comboboxTranslations, tagsInputTranslations, translations]);
|
|
71
|
-
};
|
|
72
|
-
exports.useTagSelectorTranslations = useTagSelectorTranslations;
|
|
73
|
-
const usePaginationTranslations = translations => {
|
|
74
|
-
const {
|
|
75
|
-
t
|
|
76
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
77
|
-
keyPrefix: "component.pagination"
|
|
78
|
-
});
|
|
79
|
-
return (0, _react.useMemo)(() => ({
|
|
80
|
-
rootLabel: t("rootLabel"),
|
|
81
|
-
prevTriggerLabel: t("prevTriggerLabel"),
|
|
82
|
-
nextTriggerLabel: t("nextTriggerLabel"),
|
|
83
|
-
itemLabel: details => {
|
|
84
|
-
const lastPage = details.totalPages > 1 && details.page === details.totalPages;
|
|
85
|
-
return lastPage ? t("lastPage", {
|
|
86
|
-
page: details.page
|
|
87
|
-
}) : t("page", {
|
|
88
|
-
page: details.page
|
|
89
|
-
});
|
|
90
|
-
},
|
|
91
|
-
...translations
|
|
92
|
-
}), [translations, t]);
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
// TODO: Deduplicate this and place it somewhere smart. Maybe core?
|
|
96
|
-
exports.usePaginationTranslations = usePaginationTranslations;
|
|
97
|
-
const useImageSearchTranslations = function () {
|
|
98
|
-
let translations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
99
|
-
const {
|
|
100
|
-
t
|
|
101
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
102
|
-
keyPrefix: "component.imageSearch"
|
|
103
|
-
});
|
|
104
|
-
const paginationTranslations = usePaginationTranslations();
|
|
105
|
-
const {
|
|
106
|
-
imagePreview,
|
|
107
|
-
paginationTranslations: fallbackPaginationTranslations,
|
|
108
|
-
...remaining
|
|
109
|
-
} = translations;
|
|
110
|
-
return (0, _react.useMemo)(() => ({
|
|
111
|
-
searchPlaceholder: t("searchPlaceholder"),
|
|
112
|
-
searchButtonTitle: t("searchButtonTitle"),
|
|
113
|
-
imagePreview: {
|
|
114
|
-
creatorsLabel: t("imagePreview.creatorsLabel"),
|
|
115
|
-
license: t("imagePreview.license"),
|
|
116
|
-
caption: t("imagePreview.caption"),
|
|
117
|
-
altText: t("imagePreview.altText"),
|
|
118
|
-
modelRelease: t("imagePreview.modelRelease"),
|
|
119
|
-
tags: t("imagePreview.tags"),
|
|
120
|
-
close: t("close"),
|
|
121
|
-
checkboxLabel: t("imagePreview.checkboxLabel"),
|
|
122
|
-
useImageTitle: t("imagePreview.useImageTitle"),
|
|
123
|
-
...imagePreview
|
|
124
|
-
},
|
|
125
|
-
paginationTranslations: {
|
|
126
|
-
...paginationTranslations,
|
|
127
|
-
...fallbackPaginationTranslations
|
|
128
|
-
},
|
|
129
|
-
...remaining
|
|
130
|
-
}), [t, paginationTranslations, imagePreview, fallbackPaginationTranslations, remaining]);
|
|
131
|
-
};
|
|
132
|
-
exports.useImageSearchTranslations = useImageSearchTranslations;
|
|
133
|
-
const useAudioSearchTranslations = function () {
|
|
134
|
-
let translations = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
135
|
-
const {
|
|
136
|
-
t
|
|
137
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
138
|
-
keyPrefix: "component.audioSearch"
|
|
139
|
-
});
|
|
140
|
-
const paginationTranslations = usePaginationTranslations();
|
|
141
|
-
const {
|
|
142
|
-
paginationTranslations: fallbackPaginationTranslations,
|
|
143
|
-
...remaining
|
|
144
|
-
} = translations;
|
|
145
|
-
return (0, _react.useMemo)(() => ({
|
|
146
|
-
searchPlaceholder: t("searchPlaceholder"),
|
|
147
|
-
searchButtonTitle: t("searchButtonTitle"),
|
|
148
|
-
useAudio: t("useAudio"),
|
|
149
|
-
noResults: t("noResults"),
|
|
150
|
-
paginationTranslations: {
|
|
151
|
-
...paginationTranslations,
|
|
152
|
-
...fallbackPaginationTranslations
|
|
153
|
-
},
|
|
154
|
-
...remaining
|
|
155
|
-
}), [t, paginationTranslations, fallbackPaginationTranslations, remaining]);
|
|
156
|
-
};
|
|
157
|
-
exports.useAudioSearchTranslations = useAudioSearchTranslations;
|
|
158
|
-
const useVideoSearchTranslations = translations => {
|
|
159
|
-
const {
|
|
160
|
-
t
|
|
161
|
-
} = (0, _reactI18next.useTranslation)("translation", {
|
|
162
|
-
keyPrefix: "component.videoSearch"
|
|
163
|
-
});
|
|
164
|
-
return (0, _react.useMemo)(() => ({
|
|
165
|
-
searchPlaceholder: t("searchPlaceholder"),
|
|
166
|
-
searchButtonTitle: t("searchButtonTitle"),
|
|
167
|
-
loadMoreVideos: t("loadMoreVideos"),
|
|
168
|
-
noResults: t("noResults"),
|
|
169
|
-
is360Video: t("is360Video"),
|
|
170
|
-
previewVideo: t("previewVideo"),
|
|
171
|
-
addVideo: t("addVideo"),
|
|
172
|
-
close: t("close"),
|
|
173
|
-
...translations
|
|
174
|
-
}), [t, translations]);
|
|
175
|
-
};
|
|
176
|
-
exports.useVideoSearchTranslations = useVideoSearchTranslations;
|