@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.
Files changed (206) hide show
  1. package/lib/i18n/index.d.ts +1 -1
  2. package/lib/i18n/useComponentTranslations.d.ts +2 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/locale/messages-en.d.ts +34 -0
  5. package/lib/locale/messages-nb.d.ts +34 -0
  6. package/lib/locale/messages-nn.d.ts +34 -0
  7. package/lib/locale/messages-se.d.ts +34 -0
  8. package/package.json +6 -5
  9. package/src/Article/ArticleByline.tsx +1 -1
  10. package/src/i18n/index.ts +1 -0
  11. package/src/i18n/useComponentTranslations.ts +36 -1
  12. package/src/index.ts +1 -0
  13. package/src/locale/messages-en.ts +34 -0
  14. package/src/locale/messages-nb.ts +34 -0
  15. package/src/locale/messages-nn.ts +34 -0
  16. package/src/locale/messages-se.ts +34 -0
  17. package/es/Article/Article.js +0 -199
  18. package/es/Article/ArticleByline.js +0 -182
  19. package/es/Article/ArticleFootNotes.js +0 -60
  20. package/es/Article/index.js +0 -11
  21. package/es/AudioPlayer/AudioPlayer.js +0 -218
  22. package/es/AudioPlayer/Controls.js +0 -332
  23. package/es/AudioPlayer/SpeechControl.js +0 -56
  24. package/es/AudioPlayer/index.js +0 -10
  25. package/es/Breadcrumb/Breadcrumb.js +0 -60
  26. package/es/Breadcrumb/BreadcrumbItem.js +0 -62
  27. package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
  28. package/es/Breadcrumb/index.js +0 -11
  29. package/es/CampaignBlock/CampaignBlock.js +0 -180
  30. package/es/CampaignBlock/index.js +0 -9
  31. package/es/CodeBlock/CodeBlock.js +0 -35
  32. package/es/CodeBlock/codeLanguageOptions.js +0 -84
  33. package/es/CodeBlock/index.js +0 -10
  34. package/es/Concept/Concept.js +0 -72
  35. package/es/ContactBlock/ContactBlock.js +0 -199
  36. package/es/ContactBlock/index.js +0 -9
  37. package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
  38. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
  39. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
  40. package/es/ContentTypeHero/ContentTypeHero.js +0 -50
  41. package/es/ContentTypeHero/index.js +0 -9
  42. package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
  43. package/es/CopyParagraphButton/index.js +0 -11
  44. package/es/Embed/AudioEmbed.js +0 -76
  45. package/es/Embed/BrightcoveEmbed.js +0 -133
  46. package/es/Embed/CodeEmbed.js +0 -79
  47. package/es/Embed/ConceptEmbed.js +0 -123
  48. package/es/Embed/ConceptInlineTriggerButton.js +0 -45
  49. package/es/Embed/ContentLinkEmbed.js +0 -51
  50. package/es/Embed/CopyrightEmbed.js +0 -33
  51. package/es/Embed/EmbedErrorPlaceholder.js +0 -58
  52. package/es/Embed/EmbedWrapper.js +0 -51
  53. package/es/Embed/ExternalEmbed.js +0 -74
  54. package/es/Embed/FootnoteEmbed.js +0 -44
  55. package/es/Embed/GlossEmbed.js +0 -80
  56. package/es/Embed/H5pEmbed.js +0 -61
  57. package/es/Embed/IframeEmbed.js +0 -93
  58. package/es/Embed/ImageEmbed.js +0 -238
  59. package/es/Embed/InlineTriggerButton.js +0 -37
  60. package/es/Embed/RelatedContentEmbed.js +0 -55
  61. package/es/Embed/UnknownEmbed.js +0 -31
  62. package/es/Embed/UuDisclaimerEmbed.js +0 -88
  63. package/es/Embed/index.js +0 -25
  64. package/es/Embed/types.js +0 -1
  65. package/es/ErrorMessage/ErrorMessage.js +0 -95
  66. package/es/ErrorMessage/index.js +0 -10
  67. package/es/FactBox/FactBox.js +0 -177
  68. package/es/FactBox/index.js +0 -10
  69. package/es/FileList/File.js +0 -101
  70. package/es/FileList/FileList.js +0 -47
  71. package/es/FileList/PdfFile.js +0 -50
  72. package/es/FileList/index.js +0 -11
  73. package/es/Gloss/Gloss.js +0 -175
  74. package/es/Gloss/GlossExample.js +0 -64
  75. package/es/Gloss/index.js +0 -10
  76. package/es/Grid/Grid.js +0 -94
  77. package/es/Grid/GridParallaxItem.js +0 -32
  78. package/es/Grid/index.js +0 -10
  79. package/es/KeyFigure/KeyFigure.js +0 -63
  80. package/es/KeyFigure/index.js +0 -9
  81. package/es/LicenseByline/EmbedByline.js +0 -212
  82. package/es/LicenseByline/LicenseLink.js +0 -56
  83. package/es/LicenseByline/index.js +0 -10
  84. package/es/LinkBlock/LinkBlock.js +0 -103
  85. package/es/LinkBlock/LinkBlockSection.js +0 -35
  86. package/es/LinkBlock/index.js +0 -10
  87. package/es/Pitch/Pitch.js +0 -83
  88. package/es/Pitch/index.js +0 -9
  89. package/es/RelatedArticleList/RelatedArticleList.js +0 -135
  90. package/es/RelatedArticleList/index.js +0 -11
  91. package/es/ResourceBox/ResourceBox.js +0 -99
  92. package/es/ResourceBox/index.js +0 -10
  93. package/es/TagSelector/TagSelector.js +0 -143
  94. package/es/ZendeskButton/ZendeskButton.js +0 -55
  95. package/es/i18n/formatNestedMessages.js +0 -25
  96. package/es/i18n/i18n.js +0 -35
  97. package/es/i18n/index.js +0 -11
  98. package/es/i18n/useComponentTranslations.js +0 -164
  99. package/es/index.js +0 -45
  100. package/es/locale/messages-en.js +0 -428
  101. package/es/locale/messages-nb.js +0 -428
  102. package/es/locale/messages-nn.js +0 -428
  103. package/es/locale/messages-se.js +0 -428
  104. package/es/model/ContentType.js +0 -68
  105. package/es/model/SubjectCategories.js +0 -12
  106. package/es/model/SubjectTypes.js +0 -11
  107. package/es/model/WordClass.js +0 -45
  108. package/es/model/index.js +0 -21
  109. package/es/types.js +0 -1
  110. package/es/utils/licenseAttributes.js +0 -18
  111. package/es/utils/relativeUrl.js +0 -37
  112. package/lib/Article/Article.js +0 -207
  113. package/lib/Article/ArticleByline.js +0 -189
  114. package/lib/Article/ArticleFootNotes.js +0 -67
  115. package/lib/Article/index.js +0 -68
  116. package/lib/AudioPlayer/AudioPlayer.js +0 -224
  117. package/lib/AudioPlayer/Controls.js +0 -338
  118. package/lib/AudioPlayer/SpeechControl.js +0 -62
  119. package/lib/AudioPlayer/index.js +0 -16
  120. package/lib/Breadcrumb/Breadcrumb.js +0 -67
  121. package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
  122. package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
  123. package/lib/Breadcrumb/index.js +0 -23
  124. package/lib/CampaignBlock/CampaignBlock.js +0 -187
  125. package/lib/CampaignBlock/index.js +0 -13
  126. package/lib/CodeBlock/CodeBlock.js +0 -41
  127. package/lib/CodeBlock/codeLanguageOptions.js +0 -90
  128. package/lib/CodeBlock/index.js +0 -20
  129. package/lib/Concept/Concept.js +0 -78
  130. package/lib/ContactBlock/ContactBlock.js +0 -206
  131. package/lib/ContactBlock/index.js +0 -18
  132. package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
  133. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
  134. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
  135. package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
  136. package/lib/ContentTypeHero/index.js +0 -12
  137. package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
  138. package/lib/CopyParagraphButton/index.js +0 -22
  139. package/lib/Embed/AudioEmbed.js +0 -84
  140. package/lib/Embed/BrightcoveEmbed.js +0 -142
  141. package/lib/Embed/CodeEmbed.js +0 -86
  142. package/lib/Embed/ConceptEmbed.js +0 -131
  143. package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
  144. package/lib/Embed/ContentLinkEmbed.js +0 -57
  145. package/lib/Embed/CopyrightEmbed.js +0 -39
  146. package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
  147. package/lib/Embed/EmbedWrapper.js +0 -57
  148. package/lib/Embed/ExternalEmbed.js +0 -81
  149. package/lib/Embed/FootnoteEmbed.js +0 -50
  150. package/lib/Embed/GlossEmbed.js +0 -88
  151. package/lib/Embed/H5pEmbed.js +0 -68
  152. package/lib/Embed/IframeEmbed.js +0 -100
  153. package/lib/Embed/ImageEmbed.js +0 -248
  154. package/lib/Embed/InlineTriggerButton.js +0 -43
  155. package/lib/Embed/RelatedContentEmbed.js +0 -61
  156. package/lib/Embed/UnknownEmbed.js +0 -37
  157. package/lib/Embed/UuDisclaimerEmbed.js +0 -94
  158. package/lib/Embed/index.js +0 -150
  159. package/lib/Embed/types.js +0 -5
  160. package/lib/ErrorMessage/ErrorMessage.js +0 -101
  161. package/lib/ErrorMessage/index.js +0 -16
  162. package/lib/FactBox/FactBox.js +0 -184
  163. package/lib/FactBox/index.js +0 -16
  164. package/lib/FileList/File.js +0 -108
  165. package/lib/FileList/FileList.js +0 -54
  166. package/lib/FileList/PdfFile.js +0 -57
  167. package/lib/FileList/index.js +0 -44
  168. package/lib/Gloss/Gloss.js +0 -181
  169. package/lib/Gloss/GlossExample.js +0 -70
  170. package/lib/Gloss/index.js +0 -20
  171. package/lib/Grid/Grid.js +0 -101
  172. package/lib/Grid/GridParallaxItem.js +0 -39
  173. package/lib/Grid/index.js +0 -19
  174. package/lib/KeyFigure/KeyFigure.js +0 -70
  175. package/lib/KeyFigure/index.js +0 -13
  176. package/lib/LicenseByline/EmbedByline.js +0 -220
  177. package/lib/LicenseByline/LicenseLink.js +0 -62
  178. package/lib/LicenseByline/index.js +0 -19
  179. package/lib/LinkBlock/LinkBlock.js +0 -110
  180. package/lib/LinkBlock/LinkBlockSection.js +0 -41
  181. package/lib/LinkBlock/index.js +0 -20
  182. package/lib/Pitch/Pitch.js +0 -91
  183. package/lib/Pitch/index.js +0 -12
  184. package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
  185. package/lib/RelatedArticleList/index.js +0 -21
  186. package/lib/ResourceBox/ResourceBox.js +0 -106
  187. package/lib/ResourceBox/index.js +0 -13
  188. package/lib/TagSelector/TagSelector.js +0 -150
  189. package/lib/ZendeskButton/ZendeskButton.js +0 -61
  190. package/lib/i18n/formatNestedMessages.js +0 -32
  191. package/lib/i18n/i18n.js +0 -41
  192. package/lib/i18n/index.js +0 -62
  193. package/lib/i18n/useComponentTranslations.js +0 -176
  194. package/lib/index.js +0 -593
  195. package/lib/locale/messages-en.js +0 -435
  196. package/lib/locale/messages-nb.js +0 -435
  197. package/lib/locale/messages-nn.js +0 -435
  198. package/lib/locale/messages-se.js +0 -435
  199. package/lib/model/ContentType.js +0 -74
  200. package/lib/model/SubjectCategories.js +0 -18
  201. package/lib/model/SubjectTypes.js +0 -17
  202. package/lib/model/WordClass.js +0 -51
  203. package/lib/model/index.js +0 -28
  204. package/lib/types.js +0 -5
  205. package/lib/utils/licenseAttributes.js +0 -25
  206. 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;