@ndla/ui 56.0.154-alpha.0 → 56.0.155-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 (244) hide show
  1. package/dist/panda.buildinfo.json +2 -0
  2. package/dist/styles.css +8 -0
  3. package/es/Article/Article.mjs +8 -1
  4. package/es/Article/Article.mjs.map +1 -1
  5. package/es/Article/ArticleByline.mjs +7 -0
  6. package/es/Article/ArticleByline.mjs.map +1 -1
  7. package/es/Article/ArticleFootNotes.mjs +7 -0
  8. package/es/Article/ArticleFootNotes.mjs.map +1 -1
  9. package/es/Article/BadgesContainer.mjs +7 -0
  10. package/es/Article/BadgesContainer.mjs.map +1 -1
  11. package/es/AudioPlayer/AudioPlayer.mjs +7 -0
  12. package/es/AudioPlayer/AudioPlayer.mjs.map +1 -1
  13. package/es/AudioPlayer/Controls.mjs +7 -0
  14. package/es/AudioPlayer/Controls.mjs.map +1 -1
  15. package/es/AudioPlayer/SpeechControl.mjs +7 -0
  16. package/es/AudioPlayer/SpeechControl.mjs.map +1 -1
  17. package/es/Breadcrumb/HomeBreadcrumb.mjs +7 -0
  18. package/es/Breadcrumb/HomeBreadcrumb.mjs.map +1 -1
  19. package/es/CampaignBlock/CampaignBlock.mjs +7 -0
  20. package/es/CampaignBlock/CampaignBlock.mjs.map +1 -1
  21. package/es/CodeBlock/CodeBlock.mjs +7 -0
  22. package/es/CodeBlock/CodeBlock.mjs.map +1 -1
  23. package/es/Concept/Concept.mjs +7 -0
  24. package/es/Concept/Concept.mjs.map +1 -1
  25. package/es/ContactBlock/ContactBlock.mjs +7 -0
  26. package/es/ContactBlock/ContactBlock.mjs.map +1 -1
  27. package/es/ContentTypeBadge/ContentTypeBadge.mjs +7 -0
  28. package/es/ContentTypeBadge/ContentTypeBadge.mjs.map +1 -1
  29. package/es/CopyParagraphButton/CopyParagraphButton.mjs +7 -0
  30. package/es/CopyParagraphButton/CopyParagraphButton.mjs.map +1 -1
  31. package/es/Embed/AudioEmbed.mjs +7 -0
  32. package/es/Embed/AudioEmbed.mjs.map +1 -1
  33. package/es/Embed/BrightcoveEmbed.mjs +7 -0
  34. package/es/Embed/BrightcoveEmbed.mjs.map +1 -1
  35. package/es/Embed/CodeEmbed.mjs +7 -0
  36. package/es/Embed/CodeEmbed.mjs.map +1 -1
  37. package/es/Embed/ConceptEmbed.mjs +7 -0
  38. package/es/Embed/ConceptEmbed.mjs.map +1 -1
  39. package/es/Embed/ConceptInlineTriggerButton.mjs +7 -0
  40. package/es/Embed/ConceptInlineTriggerButton.mjs.map +1 -1
  41. package/es/Embed/EmbedWrapper.mjs +7 -0
  42. package/es/Embed/EmbedWrapper.mjs.map +1 -1
  43. package/es/Embed/ExternalEmbed.mjs +7 -0
  44. package/es/Embed/ExternalEmbed.mjs.map +1 -1
  45. package/es/Embed/FootnoteEmbed.mjs +7 -0
  46. package/es/Embed/FootnoteEmbed.mjs.map +1 -1
  47. package/es/Embed/GlossEmbed.mjs +7 -0
  48. package/es/Embed/GlossEmbed.mjs.map +1 -1
  49. package/es/Embed/H5pEmbed.mjs +7 -0
  50. package/es/Embed/H5pEmbed.mjs.map +1 -1
  51. package/es/Embed/IframeEmbed.mjs +7 -0
  52. package/es/Embed/IframeEmbed.mjs.map +1 -1
  53. package/es/Embed/ImageEmbed.mjs +13 -6
  54. package/es/Embed/ImageEmbed.mjs.map +1 -1
  55. package/es/Embed/InlineTriggerButton.mjs +7 -0
  56. package/es/Embed/InlineTriggerButton.mjs.map +1 -1
  57. package/es/Embed/RelatedContentEmbed.mjs +9 -7
  58. package/es/Embed/RelatedContentEmbed.mjs.map +1 -1
  59. package/es/Embed/UnknownEmbed.mjs +7 -0
  60. package/es/Embed/UnknownEmbed.mjs.map +1 -1
  61. package/es/FactBox/FactBox.mjs +7 -0
  62. package/es/FactBox/FactBox.mjs.map +1 -1
  63. package/es/FileList/File.mjs +7 -0
  64. package/es/FileList/File.mjs.map +1 -1
  65. package/es/FileList/PdfFile.mjs +7 -0
  66. package/es/FileList/PdfFile.mjs.map +1 -1
  67. package/es/Gloss/Gloss.mjs +7 -0
  68. package/es/Gloss/Gloss.mjs.map +1 -1
  69. package/es/Gloss/GlossExample.mjs +7 -0
  70. package/es/Gloss/GlossExample.mjs.map +1 -1
  71. package/es/KeyFigure/KeyFigure.mjs +7 -0
  72. package/es/KeyFigure/KeyFigure.mjs.map +1 -1
  73. package/es/LicenseByline/EmbedByline.mjs +7 -0
  74. package/es/LicenseByline/EmbedByline.mjs.map +1 -1
  75. package/es/LicenseByline/LicenseLink.mjs +7 -0
  76. package/es/LicenseByline/LicenseLink.mjs.map +1 -1
  77. package/es/LinkBlock/LinkBlock.mjs +7 -0
  78. package/es/LinkBlock/LinkBlock.mjs.map +1 -1
  79. package/es/LinkBlock/LinkBlockSection.mjs +7 -0
  80. package/es/LinkBlock/LinkBlockSection.mjs.map +1 -1
  81. package/es/Pitch/Pitch.mjs +10 -2
  82. package/es/Pitch/Pitch.mjs.map +1 -1
  83. package/es/RelatedArticleList/RelatedArticleList.mjs +13 -8
  84. package/es/RelatedArticleList/RelatedArticleList.mjs.map +1 -1
  85. package/es/ResourceBox/ResourceBox.mjs +7 -0
  86. package/es/ResourceBox/ResourceBox.mjs.map +1 -1
  87. package/es/TagSelector/TagSelector.mjs +7 -0
  88. package/es/TagSelector/TagSelector.mjs.map +1 -1
  89. package/es/ZendeskButton/ZendeskButton.mjs +7 -0
  90. package/es/ZendeskButton/ZendeskButton.mjs.map +1 -1
  91. package/es/i18n/useComponentTranslations.mjs +7 -0
  92. package/es/i18n/useComponentTranslations.mjs.map +1 -1
  93. package/es/index.mjs +1 -1
  94. package/es/locale/messages-en.mjs +7 -0
  95. package/es/locale/messages-en.mjs.map +1 -1
  96. package/es/locale/messages-nb.mjs +7 -0
  97. package/es/locale/messages-nb.mjs.map +1 -1
  98. package/es/locale/messages-nn.mjs +7 -0
  99. package/es/locale/messages-nn.mjs.map +1 -1
  100. package/es/locale/messages-se.mjs +7 -0
  101. package/es/locale/messages-se.mjs.map +1 -1
  102. package/es/model/index.mjs +7 -0
  103. package/es/model/index.mjs.map +1 -1
  104. package/es/utils/licenseAttributes.mjs +7 -0
  105. package/es/utils/licenseAttributes.mjs.map +1 -1
  106. package/lib/Article/Article.js +8 -7
  107. package/lib/Article/Article.js.map +1 -1
  108. package/lib/Article/ArticleByline.js +7 -8
  109. package/lib/Article/ArticleByline.js.map +1 -1
  110. package/lib/Article/ArticleFootNotes.js +7 -3
  111. package/lib/Article/ArticleFootNotes.js.map +1 -1
  112. package/lib/Article/BadgesContainer.js +7 -1
  113. package/lib/Article/BadgesContainer.js.map +1 -1
  114. package/lib/AudioPlayer/AudioPlayer.js +7 -6
  115. package/lib/AudioPlayer/AudioPlayer.js.map +1 -1
  116. package/lib/AudioPlayer/Controls.js +7 -7
  117. package/lib/AudioPlayer/SpeechControl.js +7 -5
  118. package/lib/AudioPlayer/SpeechControl.js.map +1 -1
  119. package/lib/Breadcrumb/Breadcrumb.js +7 -4
  120. package/lib/Breadcrumb/Breadcrumb.js.map +1 -1
  121. package/lib/Breadcrumb/BreadcrumbItem.js +7 -3
  122. package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -1
  123. package/lib/Breadcrumb/HomeBreadcrumb.js +7 -4
  124. package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -1
  125. package/lib/CampaignBlock/CampaignBlock.js +7 -6
  126. package/lib/CampaignBlock/CampaignBlock.js.map +1 -1
  127. package/lib/CodeBlock/CodeBlock.js +7 -4
  128. package/lib/CodeBlock/CodeBlock.js.map +1 -1
  129. package/lib/Concept/Concept.d.ts +1 -1
  130. package/lib/Concept/Concept.js +7 -4
  131. package/lib/Concept/Concept.js.map +1 -1
  132. package/lib/ContactBlock/ContactBlock.d.ts +2 -2
  133. package/lib/ContactBlock/ContactBlock.js +7 -4
  134. package/lib/ContactBlock/ContactBlock.js.map +1 -1
  135. package/lib/ContentTypeBadge/ContentTypeBadge.js +7 -4
  136. package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -1
  137. package/lib/CopyParagraphButton/CopyParagraphButton.js +7 -6
  138. package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -1
  139. package/lib/Embed/AudioEmbed.js +7 -3
  140. package/lib/Embed/AudioEmbed.js.map +1 -1
  141. package/lib/Embed/BrightcoveEmbed.js +7 -5
  142. package/lib/Embed/BrightcoveEmbed.js.map +1 -1
  143. package/lib/Embed/CodeEmbed.js +7 -6
  144. package/lib/Embed/CodeEmbed.js.map +1 -1
  145. package/lib/Embed/ConceptEmbed.js +7 -5
  146. package/lib/Embed/ConceptEmbed.js.map +1 -1
  147. package/lib/Embed/ConceptInlineTriggerButton.js +7 -1
  148. package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -1
  149. package/lib/Embed/ContentLinkEmbed.js +0 -3
  150. package/lib/Embed/ContentLinkEmbed.js.map +1 -1
  151. package/lib/Embed/CopyrightEmbed.js +0 -2
  152. package/lib/Embed/CopyrightEmbed.js.map +1 -1
  153. package/lib/Embed/EmbedErrorPlaceholder.js +7 -5
  154. package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -1
  155. package/lib/Embed/EmbedWrapper.js +7 -5
  156. package/lib/Embed/EmbedWrapper.js.map +1 -1
  157. package/lib/Embed/ExternalEmbed.js +7 -5
  158. package/lib/Embed/ExternalEmbed.js.map +1 -1
  159. package/lib/Embed/FootnoteEmbed.js +7 -3
  160. package/lib/Embed/FootnoteEmbed.js.map +1 -1
  161. package/lib/Embed/GlossEmbed.js +7 -5
  162. package/lib/Embed/GlossEmbed.js.map +1 -1
  163. package/lib/Embed/H5pEmbed.js +7 -4
  164. package/lib/Embed/H5pEmbed.js.map +1 -1
  165. package/lib/Embed/IframeEmbed.js +7 -5
  166. package/lib/Embed/IframeEmbed.js.map +1 -1
  167. package/lib/Embed/ImageEmbed.js +13 -12
  168. package/lib/Embed/ImageEmbed.js.map +1 -1
  169. package/lib/Embed/InlineTriggerButton.js +7 -4
  170. package/lib/Embed/InlineTriggerButton.js.map +1 -1
  171. package/lib/Embed/RelatedContentEmbed.d.ts +1 -2
  172. package/lib/Embed/RelatedContentEmbed.js +9 -10
  173. package/lib/Embed/RelatedContentEmbed.js.map +1 -1
  174. package/lib/Embed/UnknownEmbed.js +7 -3
  175. package/lib/Embed/UnknownEmbed.js.map +1 -1
  176. package/lib/Embed/UuDisclaimerEmbed.js +7 -7
  177. package/lib/Embed/types.d.ts +2 -2
  178. package/lib/FactBox/FactBox.js +7 -5
  179. package/lib/FactBox/FactBox.js.map +1 -1
  180. package/lib/FileList/File.js +7 -8
  181. package/lib/FileList/File.js.map +1 -1
  182. package/lib/FileList/FileList.js +7 -4
  183. package/lib/FileList/FileList.js.map +1 -1
  184. package/lib/FileList/PdfFile.js +7 -3
  185. package/lib/FileList/PdfFile.js.map +1 -1
  186. package/lib/Gloss/Gloss.d.ts +2 -2
  187. package/lib/Gloss/Gloss.js +7 -7
  188. package/lib/Gloss/Gloss.js.map +1 -1
  189. package/lib/Gloss/GlossExample.d.ts +2 -2
  190. package/lib/Gloss/GlossExample.js +7 -4
  191. package/lib/Gloss/GlossExample.js.map +1 -1
  192. package/lib/Grid/Grid.js +7 -3
  193. package/lib/Grid/Grid.js.map +1 -1
  194. package/lib/Grid/GridParallaxItem.js +7 -3
  195. package/lib/Grid/GridParallaxItem.js.map +1 -1
  196. package/lib/KeyFigure/KeyFigure.js +7 -2
  197. package/lib/KeyFigure/KeyFigure.js.map +1 -1
  198. package/lib/LicenseByline/EmbedByline.d.ts +4 -4
  199. package/lib/LicenseByline/EmbedByline.js +7 -7
  200. package/lib/LicenseByline/EmbedByline.js.map +1 -1
  201. package/lib/LicenseByline/LicenseLink.js +7 -4
  202. package/lib/LicenseByline/LicenseLink.js.map +1 -1
  203. package/lib/LinkBlock/LinkBlock.js +7 -6
  204. package/lib/LinkBlock/LinkBlock.js.map +1 -1
  205. package/lib/LinkBlock/LinkBlockSection.js +7 -3
  206. package/lib/LinkBlock/LinkBlockSection.js.map +1 -1
  207. package/lib/Pitch/Pitch.js +10 -7
  208. package/lib/Pitch/Pitch.js.map +1 -1
  209. package/lib/RelatedArticleList/RelatedArticleList.d.ts +2 -3
  210. package/lib/RelatedArticleList/RelatedArticleList.js +13 -16
  211. package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -1
  212. package/lib/ResourceBox/ResourceBox.js +7 -6
  213. package/lib/ResourceBox/ResourceBox.js.map +1 -1
  214. package/lib/TagSelector/TagSelector.js +7 -6
  215. package/lib/TagSelector/TagSelector.js.map +1 -1
  216. package/lib/ZendeskButton/ZendeskButton.js +7 -3
  217. package/lib/ZendeskButton/ZendeskButton.js.map +1 -1
  218. package/lib/i18n/useComponentTranslations.js +7 -2
  219. package/lib/i18n/useComponentTranslations.js.map +1 -1
  220. package/lib/index.js +1 -1
  221. package/lib/locale/messages-en.js +7 -1
  222. package/lib/locale/messages-en.js.map +1 -1
  223. package/lib/locale/messages-nb.js +7 -1
  224. package/lib/locale/messages-nb.js.map +1 -1
  225. package/lib/locale/messages-nn.js +7 -1
  226. package/lib/locale/messages-nn.js.map +1 -1
  227. package/lib/locale/messages-se.js +7 -1
  228. package/lib/locale/messages-se.js.map +1 -1
  229. package/lib/model/index.js +7 -0
  230. package/lib/model/index.js.map +1 -1
  231. package/lib/utils/licenseAttributes.js +7 -1
  232. package/lib/utils/licenseAttributes.js.map +1 -1
  233. package/package.json +7 -7
  234. package/src/Concept/Concept.tsx +1 -1
  235. package/src/ContactBlock/ContactBlock.tsx +2 -2
  236. package/src/Embed/ImageEmbed.stories.tsx +2 -2
  237. package/src/Embed/ImageEmbed.tsx +6 -6
  238. package/src/Embed/RelatedContentEmbed.tsx +1 -9
  239. package/src/Embed/types.ts +2 -2
  240. package/src/Gloss/Gloss.tsx +4 -4
  241. package/src/Gloss/GlossExample.tsx +2 -2
  242. package/src/LicenseByline/EmbedByline.tsx +4 -4
  243. package/src/Pitch/Pitch.tsx +3 -2
  244. package/src/RelatedArticleList/RelatedArticleList.tsx +11 -28
@@ -7,10 +7,18 @@ import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import { linkOverlay } from "@ndla/styled-system/patterns";
8
8
 
9
9
  //#region src/Pitch/Pitch.tsx
10
+ /**
11
+ * Copyright (c) 2024-present, NDLA.
12
+ *
13
+ * This source code is licensed under the GPLv3 license found in the
14
+ * LICENSE file in the root directory of this source tree.
15
+ *
16
+ */
10
17
  const StyledCardHeading = styled(CardHeading, { base: { paddingBlockStart: "medium" } });
11
18
  const StyledText = styled(Text, { base: { paddingBlockEnd: "medium" } });
12
19
  const StyledCardRoot = styled(CardRoot, { base: {
13
- border: "0",
20
+ outline: "0px",
21
+ boxShadow: "none",
14
22
  display: "flex",
15
23
  flexDirection: "column",
16
24
  gap: "small"
@@ -22,7 +30,7 @@ const StyledCardImage = styled(CardImage, { base: {
22
30
  const Pitch = ({ title, url, metaImage, path, description }) => {
23
31
  const href = getPossiblyRelativeUrl(url, path);
24
32
  return /* @__PURE__ */ jsx(StyledCardRoot, {
25
- variant: "subtle",
33
+ nonInteractive: true,
26
34
  "data-embed-type": "pitch",
27
35
  asChild: true,
28
36
  consumeCss: true,
@@ -1 +1 @@
1
- {"version":3,"file":"Pitch.mjs","names":[],"sources":["../../src/Pitch/Pitch.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 parse from \"html-react-parser\";\nimport { CardHeading, CardImage, CardRoot, Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { getPossiblyRelativeUrl } from \"../utils/relativeUrl\";\n\nexport interface Props {\n title: string;\n url: string;\n description?: string;\n metaImage: {\n url: string;\n alt: string;\n };\n path?: string;\n}\n\nconst StyledCardHeading = styled(CardHeading, {\n base: {\n paddingBlockStart: \"medium\",\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n paddingBlockEnd: \"medium\",\n },\n});\n\nconst StyledCardRoot = styled(CardRoot, {\n base: {\n border: \"0\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"small\",\n },\n});\n\nconst StyledCardImage = styled(CardImage, {\n base: {\n aspectRatio: \"16/9\",\n height: \"unset\",\n },\n});\n\nexport const Pitch = ({ title, url, metaImage, path, description }: Props) => {\n const href = getPossiblyRelativeUrl(url, path);\n\n return (\n <StyledCardRoot variant=\"subtle\" data-embed-type=\"pitch\" asChild consumeCss>\n <div>\n <StyledCardHeading textStyle=\"heading.small\" asChild consumeCss>\n <SafeLink to={href} unstyled css={linkOverlay.raw()}>\n {parse(title)}\n </SafeLink>\n </StyledCardHeading>\n {!!description && (\n <StyledText textStyle=\"body.xlarge\" asChild consumeCss>\n <div>{parse(description)}</div>\n </StyledText>\n )}\n <StyledCardImage\n variant=\"rounded\"\n src={metaImage.url}\n alt={metaImage.alt}\n sizes=\"480px\"\n fallbackWidth={300}\n width={550}\n height={310}\n />\n </div>\n </StyledCardRoot>\n );\n};\n"],"mappings":";;;;;;;;;AA0BA,MAAM,oBAAoB,OAAO,aAAa,EAC5C,MAAM,EACJ,mBAAmB,UACpB,EACF,CAAC;AAEF,MAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,EACJ,iBAAiB,UAClB,EACF,CAAC;AAEF,MAAM,iBAAiB,OAAO,UAAU,EACtC,MAAM;CACJ,QAAQ;CACR,SAAS;CACT,eAAe;CACf,KAAK;CACN,EACF,CAAC;AAEF,MAAM,kBAAkB,OAAO,WAAW,EACxC,MAAM;CACJ,aAAa;CACb,QAAQ;CACT,EACF,CAAC;AAEF,MAAa,SAAS,EAAE,OAAO,KAAK,WAAW,MAAM,kBAAyB;CAC5E,MAAM,OAAO,uBAAuB,KAAK,KAAK;AAE9C,QACE,oBAAC;EAAe,SAAQ;EAAS,mBAAgB;EAAQ;EAAQ;YAC/D,qBAAC;GACC,oBAAC;IAAkB,WAAU;IAAgB;IAAQ;cACnD,oBAAC;KAAS,IAAI;KAAM;KAAS,KAAK,YAAY,KAAK;eAChD,MAAM,MAAM;MACJ;KACO;GACnB,CAAC,CAAC,eACD,oBAAC;IAAW,WAAU;IAAc;IAAQ;cAC1C,oBAAC,mBAAK,MAAM,YAAY,GAAO;KACpB;GAEf,oBAAC;IACC,SAAQ;IACR,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAM;IACN,eAAe;IACf,OAAO;IACP,QAAQ;KACR;MACE;GACS"}
1
+ {"version":3,"file":"Pitch.mjs","names":[],"sources":["../../src/Pitch/Pitch.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 parse from \"html-react-parser\";\nimport { CardHeading, CardImage, CardRoot, Text } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { getPossiblyRelativeUrl } from \"../utils/relativeUrl\";\n\nexport interface Props {\n title: string;\n url: string;\n description?: string;\n metaImage: {\n url: string;\n alt: string;\n };\n path?: string;\n}\n\nconst StyledCardHeading = styled(CardHeading, {\n base: {\n paddingBlockStart: \"medium\",\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n paddingBlockEnd: \"medium\",\n },\n});\n\nconst StyledCardRoot = styled(CardRoot, {\n base: {\n outline: \"0px\",\n boxShadow: \"none\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"small\",\n },\n});\n\nconst StyledCardImage = styled(CardImage, {\n base: {\n aspectRatio: \"16/9\",\n height: \"unset\",\n },\n});\n\nexport const Pitch = ({ title, url, metaImage, path, description }: Props) => {\n const href = getPossiblyRelativeUrl(url, path);\n\n return (\n <StyledCardRoot nonInteractive data-embed-type=\"pitch\" asChild consumeCss>\n <div>\n <StyledCardHeading textStyle=\"heading.small\" asChild consumeCss>\n <SafeLink to={href} unstyled css={linkOverlay.raw()}>\n {parse(title)}\n </SafeLink>\n </StyledCardHeading>\n {!!description && (\n <StyledText textStyle=\"body.xlarge\" asChild consumeCss>\n <div>{parse(description)}</div>\n </StyledText>\n )}\n <StyledCardImage\n variant=\"rounded\"\n src={metaImage.url}\n alt={metaImage.alt}\n sizes=\"480px\"\n fallbackWidth={300}\n width={550}\n height={310}\n />\n </div>\n </StyledCardRoot>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,oBAAoB,OAAO,aAAa,EAC5C,MAAM,EACJ,mBAAmB,UACpB,EACF,CAAC;AAEF,MAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,EACJ,iBAAiB,UAClB,EACF,CAAC;AAEF,MAAM,iBAAiB,OAAO,UAAU,EACtC,MAAM;CACJ,SAAS;CACT,WAAW;CACX,SAAS;CACT,eAAe;CACf,KAAK;CACN,EACF,CAAC;AAEF,MAAM,kBAAkB,OAAO,WAAW,EACxC,MAAM;CACJ,aAAa;CACb,QAAQ;CACT,EACF,CAAC;AAEF,MAAa,SAAS,EAAE,OAAO,KAAK,WAAW,MAAM,kBAAyB;CAC5E,MAAM,OAAO,uBAAuB,KAAK,KAAK;AAE9C,QACE,oBAAC;EAAe;EAAe,mBAAgB;EAAQ;EAAQ;YAC7D,qBAAC;GACC,oBAAC;IAAkB,WAAU;IAAgB;IAAQ;cACnD,oBAAC;KAAS,IAAI;KAAM;KAAS,KAAK,YAAY,KAAK;eAChD,MAAM,MAAM;MACJ;KACO;GACnB,CAAC,CAAC,eACD,oBAAC;IAAW,WAAU;IAAc;IAAQ;cAC1C,oBAAC,mBAAK,MAAM,YAAY,GAAO;KACpB;GAEf,oBAAC;IACC,SAAQ;IACR,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAM;IACN,eAAe;IACf,OAAO;IACP,QAAQ;KACR;MACE;GACS"}
@@ -1,4 +1,3 @@
1
- import { BadgesContainer } from "../Article/BadgesContainer.mjs";
2
1
  import { Children, useMemo, useState } from "react";
3
2
  import { Button, CardContent, CardHeading, CardRoot, Heading, Text } from "@ndla/primitives";
4
3
  import { styled } from "@ndla/styled-system/jsx";
@@ -9,28 +8,34 @@ import { jsx, jsxs } from "react/jsx-runtime";
9
8
  import { linkOverlay } from "@ndla/styled-system/patterns";
10
9
 
11
10
  //#region src/RelatedArticleList/RelatedArticleList.tsx
11
+ /**
12
+ * Copyright (c) 2023-present, NDLA.
13
+ *
14
+ * This source code is licensed under the GPLv3 license found in the
15
+ * LICENSE file in the root directory of this source tree.
16
+ *
17
+ */
12
18
  const StyledSpan = styled("span", { base: {
13
19
  display: "flex",
20
+ alignItems: "center",
14
21
  gap: "3xsmall"
15
22
  } });
16
- const RelatedArticle = ({ title, introduction, to, badges, linkInfo = "", target = "" }) => {
23
+ const RelatedArticle = ({ title, introduction, to, linkInfo = "", target = "" }) => {
17
24
  return /* @__PURE__ */ jsx(CardRoot, {
18
25
  "data-embed-type": "related-article",
19
26
  children: /* @__PURE__ */ jsxs(CardContent, { children: [
20
- !!badges && /* @__PURE__ */ jsx(BadgesContainer, { children: badges }),
21
27
  /* @__PURE__ */ jsx(CardHeading, {
22
28
  asChild: true,
23
29
  consumeCss: true,
24
- children: /* @__PURE__ */ jsx("span", { children: /* @__PURE__ */ jsx(SafeLink, {
25
- unstyled: true,
30
+ css: linkOverlay.raw(),
31
+ children: /* @__PURE__ */ jsx(SafeLink, {
26
32
  to,
27
33
  target,
28
34
  rel: linkInfo ? "noopener noreferrer" : void 0,
29
- css: linkOverlay.raw(),
30
35
  children: /* @__PURE__ */ jsxs(StyledSpan, { children: [title, target === "_blank" && /* @__PURE__ */ jsx(ExternalLinkLine, {})] })
31
- }) })
36
+ })
32
37
  }),
33
- /* @__PURE__ */ jsx(Text, { dangerouslySetInnerHTML: { __html: introduction } }),
38
+ !!introduction && /* @__PURE__ */ jsx(Text, { dangerouslySetInnerHTML: { __html: introduction } }),
34
39
  /* @__PURE__ */ jsx(Text, {
35
40
  color: "text.subtle",
36
41
  textStyle: "label.small",
@@ -1 +1 @@
1
- {"version":3,"file":"RelatedArticleList.mjs","names":[],"sources":["../../src/RelatedArticleList/RelatedArticleList.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport { BadgesContainer } from \"../Article/BadgesContainer\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction: string;\n to: string;\n linkInfo?: string;\n target?: string;\n badges?: ReactNode;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({\n title,\n introduction,\n to,\n badges,\n linkInfo = \"\",\n target = \"\",\n}: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n {!!badges && <BadgesContainer>{badges}</BadgesContainer>}\n <CardHeading asChild consumeCss>\n <span>\n <SafeLink\n unstyled\n to={to}\n target={target}\n rel={linkInfo ? \"noopener noreferrer\" : undefined}\n css={linkOverlay.raw()}\n >\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </span>\n </CardHeading>\n <Text dangerouslySetInnerHTML={{ __html: introduction }} />\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show${expanded ? \"Less\" : \"More\"}`)}\n </StyledButton>\n ) : null}\n </StyledSection>\n );\n};\n"],"mappings":";;;;;;;;;;;AA2BA,MAAM,aAAa,OAAO,QAAQ,EAChC,MAAM;CACJ,SAAS;CACT,KAAK;CACN,EACF,CAAC;AAEF,MAAa,k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AAC;EAAY;EAAU;EAAS,CACjC;AAED,QACE,qBAAC;EAAc,GAAI;EAAM,mBAAgB;;GACvC,qBAAC,6BACC,oBAAC;IAAQ;IAAQ;IAAW,WAAU;IAAc,YAAW;cAC7D,oBAAC,4BAAgB,EAAE,gBAAgB,GAAkB;KAC7C,EACT,kBACc;GACjB,oBAAC,6BAAiB,iBAAiC;GAClD,aAAa,IACZ,oBAAC;IAAa,SAAQ;IAAY,eAAe,aAAa,MAAM,CAAC,EAAE;cACpE,EAAE,eAAe,WAAW,SAAS,SAAS;KAClC,GACb;;GACU"}
1
+ {"version":3,"file":"RelatedArticleList.mjs","names":[],"sources":["../../src/RelatedArticleList/RelatedArticleList.tsx"],"sourcesContent":["/**\n * Copyright (c) 2023-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { Children, type ComponentPropsWithoutRef, type ReactElement, type ReactNode, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { ExternalLinkLine } from \"@ndla/icons\";\nimport { CardContent, CardHeading, CardRoot, Text, Heading, Button } from \"@ndla/primitives\";\nimport { SafeLink } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { linkOverlay } from \"@ndla/styled-system/patterns\";\nimport type { HeadingLevel } from \"../types\";\n\ninterface RelatedArticleProps {\n title: string;\n introduction?: string;\n to: string;\n linkInfo?: string;\n target?: string;\n}\n\nconst StyledSpan = styled(\"span\", {\n base: {\n display: \"flex\",\n alignItems: \"center\",\n gap: \"3xsmall\",\n },\n});\n\nexport const RelatedArticle = ({ title, introduction, to, linkInfo = \"\", target = \"\" }: RelatedArticleProps) => {\n return (\n <CardRoot data-embed-type=\"related-article\">\n <CardContent>\n <CardHeading asChild consumeCss css={linkOverlay.raw()}>\n <SafeLink to={to} target={target} rel={linkInfo ? \"noopener noreferrer\" : undefined}>\n <StyledSpan>\n {title}\n {target === \"_blank\" && <ExternalLinkLine />}\n </StyledSpan>\n </SafeLink>\n </CardHeading>\n {!!introduction && <Text dangerouslySetInnerHTML={{ __html: introduction }} />}\n <Text color=\"text.subtle\" textStyle=\"label.small\">\n {linkInfo}\n </Text>\n </CardContent>\n </CardRoot>\n );\n};\n\nconst HeadingWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n width: \"100%\",\n justifyContent: \"space-between\",\n alignItems: \"center\",\n alignSelf: \"flex-start\",\n },\n});\n\nconst ArticlesWrapper = styled(\"div\", {\n base: {\n display: \"grid\",\n width: \"100%\",\n gridTemplateColumns: \"repeat(2, 1fr)\",\n gap: \"medium\",\n tabletDown: {\n gridTemplateColumns: \"1fr\",\n },\n },\n});\n\nconst StyledSection = styled(\"section\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"center\",\n gap: \"medium\",\n clear: \"both\",\n },\n});\n\nconst StyledButton = styled(Button, {\n base: {\n marginBlockStart: \"xsmall\",\n },\n});\n\ninterface Props extends ComponentPropsWithoutRef<\"section\"> {\n children?: ReactElement[];\n articleCount?: number;\n headingLevel?: HeadingLevel;\n headingButtons?: ReactNode;\n}\n\nexport const RelatedArticleList = ({\n children = [],\n articleCount,\n headingLevel: HeadingElement = \"h2\",\n headingButtons,\n ...rest\n}: Props) => {\n const [expanded, setExpanded] = useState(false);\n const { t } = useTranslation();\n const childCount = useMemo(() => articleCount ?? Children.count(children), [children, articleCount]);\n const childrenToShow = useMemo(\n () => (childCount > 2 && !expanded ? children?.slice(0, 2) : children),\n [childCount, children, expanded],\n );\n\n return (\n <StyledSection {...rest} data-embed-type=\"related-content-list\">\n <HeadingWrapper>\n <Heading asChild consumeCss textStyle=\"title.large\" fontWeight=\"bold\">\n <HeadingElement>{t(\"related.title\")}</HeadingElement>\n </Heading>\n {headingButtons}\n </HeadingWrapper>\n <ArticlesWrapper>{childrenToShow}</ArticlesWrapper>\n {childCount > 2 ? (\n <StyledButton variant=\"secondary\" onClick={() => setExpanded((p) => !p)}>\n {t(`related.show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M,aAAa,cAAc,gBAAgB,SAAS,MAAM,SAAS,EAAE,CAAC,UAAU,aAAa,CAAC;CACpG,MAAM,iBAAiB,cACd,aAAa,KAAK,CAAC,WAAW,UAAU,MAAM,GAAG,EAAE,GAAG,UAC7D;EAAC;EAAY;EAAU;EAAS,CACjC;AAED,QACE,qBAAC;EAAc,GAAI;EAAM,mBAAgB;;GACvC,qBAAC,6BACC,oBAAC;IAAQ;IAAQ;IAAW,WAAU;IAAc,YAAW;cAC7D,oBAAC,4BAAgB,EAAE,gBAAgB,GAAkB;KAC7C,EACT,kBACc;GACjB,oBAAC,6BAAiB,iBAAiC;GAClD,aAAa,IACZ,oBAAC;IAAa,SAAQ;IAAY,eAAe,aAAa,MAAM,CAAC,EAAE;cACpE,EAAE,eAAe,WAAW,SAAS,SAAS;KAClC,GACb;;GACU"}
@@ -6,6 +6,13 @@ import { jsx, jsxs } from "react/jsx-runtime";
6
6
  import { breakpoints } from "@ndla/core";
7
7
 
8
8
  //#region src/ResourceBox/ResourceBox.tsx
9
+ /**
10
+ * Copyright (c) 2022-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
+ */
9
16
  const Container = styled("div", { base: {
10
17
  display: "flex",
11
18
  padding: "medium",
@@ -1 +1 @@
1
- {"version":3,"file":"ResourceBox.mjs","names":[],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-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 { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n"],"mappings":";;;;;;;;AAcA,MAAM,YAAY,OAAO,OAAO,EAC9B,MAAM;CACJ,SAAS;CACT,SAAS;CACT,cAAc;CACd,QAAQ;CACR,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,gBAAgB,EACd,SAAS,UACV;CACD,YAAY;EACV,eAAe;EACf,KAAK;EACL,SAAS;EACV;CACF,EACF,CAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,MAAM;CACN,YAAY,EACV,SAAS,UACV;CACF,EACF,CAAC;AAEF,MAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ,WAAW;CACX,cAAc;CACd,OAAO;CACP,aAAa;CACb,YAAY;EACV,OAAO;EACP,cAAc;EACf;CACF,EACF,CAAC;AAEF,MAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,EACJ,MAAM,KACP,EACF,CAAC;AAeF,MAAa,eAAe,EAAE,OAAO,OAAO,SAAS,KAAK,iBAAwB;AAChF,QACE,qBAAC,wBACE,QACC,oBAAC;EACC,KAAK,MAAM;EACX,KAAK,MAAM;EACX,OAAO,eAAe,YAAY,QAAQ,uBAAuB,YAAY,OAAO;EACpF,SAAQ;GACR,GACA,MACJ,qBAAC;EACC,oBAAC;GAAQ,WAAU;GAAc,YAAW;GAAO;GAAQ;aACzD,oBAAC,kBAAI,QAAW;IACR;EACV,oBAAC;GAAW,WAAU;aAAe;IAAqB;EAC1D,qBAAC;GAAe,IAAI;GAAK,QAAO;GAAS,SAAQ;cAC9C,YACD,oBAAC,iBAAe;IACD;KACF,IACP"}
1
+ {"version":3,"file":"ResourceBox.mjs","names":[],"sources":["../../src/ResourceBox/ResourceBox.tsx"],"sourcesContent":["/**\n * Copyright (c) 2022-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 { breakpoints } from \"@ndla/core\";\nimport { ShareBoxLine } from \"@ndla/icons\";\nimport { Heading, Image, Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\n\nconst Container = styled(\"div\", {\n base: {\n display: \"flex\",\n padding: \"medium\",\n borderRadius: \"xsmall\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n boxShadow: \"full\",\n marginBlockEnd: \"medium\",\n gap: \"medium\",\n tabletWideDown: {\n padding: \"xsmall\",\n },\n tabletDown: {\n flexDirection: \"column\",\n gap: \"0\",\n padding: \"0\",\n },\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n display: \"flex\",\n flexDirection: \"column\",\n alignItems: \"flex-start\",\n gap: \"xsmall\",\n flex: \"1\",\n tabletDown: {\n padding: \"xsmall\",\n },\n },\n});\n\nconst StyledImage = styled(Image, {\n base: {\n objectFit: \"cover\",\n borderRadius: \"xsmall\",\n width: \"fit-content\",\n aspectRatio: \"1/1\",\n tabletDown: {\n width: \"100%\",\n borderRadius: \"0\",\n },\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n flex: \"1\",\n },\n});\n\ninterface ImageMeta {\n src: string | undefined;\n alt: string;\n}\n\ninterface Props {\n image?: ImageMeta;\n title: string;\n caption: string;\n url: string;\n buttonText: string;\n}\n\nexport const ResourceBox = ({ image, title, caption, url, buttonText }: Props) => {\n return (\n <Container>\n {image ? (\n <StyledImage\n src={image.src}\n alt={image.alt}\n sizes={`(min-width: ${breakpoints.desktop}) 150px, (max-width: ${breakpoints.tablet} ) 400px, 200px`}\n variant=\"rounded\"\n />\n ) : null}\n <ContentWrapper>\n <Heading textStyle=\"label.large\" fontWeight=\"bold\" asChild consumeCss>\n <h3>{title}</h3>\n </Heading>\n <StyledText textStyle=\"body.medium\">{caption}</StyledText>\n <SafeLinkButton to={url} target=\"_blank\" variant=\"secondary\">\n {buttonText}\n <ShareBoxLine />\n </SafeLinkButton>\n </ContentWrapper>\n </Container>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;AAcA,MAAM,YAAY,OAAO,OAAO,EAC9B,MAAM;CACJ,SAAS;CACT,SAAS;CACT,cAAc;CACd,QAAQ;CACR,aAAa;CACb,WAAW;CACX,gBAAgB;CAChB,KAAK;CACL,gBAAgB,EACd,SAAS,UACV;CACD,YAAY;EACV,eAAe;EACf,KAAK;EACL,SAAS;EACV;CACF,EACF,CAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM;CACJ,SAAS;CACT,eAAe;CACf,YAAY;CACZ,KAAK;CACL,MAAM;CACN,YAAY,EACV,SAAS,UACV;CACF,EACF,CAAC;AAEF,MAAM,cAAc,OAAO,OAAO,EAChC,MAAM;CACJ,WAAW;CACX,cAAc;CACd,OAAO;CACP,aAAa;CACb,YAAY;EACV,OAAO;EACP,cAAc;EACf;CACF,EACF,CAAC;AAEF,MAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,EACJ,MAAM,KACP,EACF,CAAC;AAeF,MAAa,eAAe,EAAE,OAAO,OAAO,SAAS,KAAK,iBAAwB;AAChF,QACE,qBAAC,wBACE,QACC,oBAAC;EACC,KAAK,MAAM;EACX,KAAK,MAAM;EACX,OAAO,eAAe,YAAY,QAAQ,uBAAuB,YAAY,OAAO;EACpF,SAAQ;GACR,GACA,MACJ,qBAAC;EACC,oBAAC;GAAQ,WAAU;GAAc,YAAW;GAAO;GAAQ;aACzD,oBAAC,kBAAI,QAAW;IACR;EACV,oBAAC;GAAW,WAAU;aAAe;IAAqB;EAC1D,qBAAC;GAAe,IAAI;GAAK,QAAO;GAAS,SAAQ;cAC9C,YACD,oBAAC,iBAAe;IACD;KACF,IACP"}
@@ -6,6 +6,13 @@ import { contains } from "@ndla/util";
6
6
  import { useComboboxContext, useTagsInputContext } from "@ark-ui/react";
7
7
 
8
8
  //#region src/TagSelector/TagSelector.tsx
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
+ */
9
16
  const TagSelectorRoot = ({ allowCustomValue = true, multiple = true, selectionBehavior = "clear", editable, addOnPaste = false, onValueChange, children, value, translations,...rest }) => {
10
17
  const ids = {
11
18
  root: useId(),
@@ -1 +1 @@
1
- {"version":3,"file":"TagSelector.mjs","names":[],"sources":["../../src/TagSelector/TagSelector.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, useEffect, useId, useRef } from \"react\";\nimport { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":";;;;;;;;AAqCA,MAAa,mBAA6C,EACxD,mBAAmB,MACnB,WAAW,MACX,oBAAoB,SACpB,UACA,aAAa,OACb,eACA,UACA,OACA,aACA,GAAG,WAC0B;CAC7B,MAAM,MAAM;EACV,MAAM,OAAO;EACb,OAAO,OAAO;EACd,SAAS,OAAO;EACjB;CAED,MAAM,aAAa,OAAmC,OAAU;AAEhE,iBAAgB;AACd,MAAI,CAAC,WAAW,QACd,YAAW,UAAU,SAAS,eAAe,IAAI,QAAQ;IAE1D,CAAC,IAAI,QAAQ,CAAC;AAEjB,QACE,oBAAC;EACM;EACL;EACkB;EACR;EACS;EACJ;EACD;EACd,uBAAuB,UAAU;AAC/B,OAAI,SAAS,WAAW,SAAS,MAAM,OAAO,cAAc,OAAO,CACjE,OAAM,gBAAgB;;EAGnB;EACP,GAAI;YAEJ,oBAAC;GACM;GACE;GACG;GACK;GACH;GACE;GAEb;IACwB;GACd;;AAInB,MAAM,2BAA2B,YAAgD,OAAO,QAAQ;CAC9F,MAAM,cAAc,oBAAoB;AACxC,QACE,oBAAC;EACM;EACL,qBAAqB,YAAY,YAAY,cAAc,QAAQ,WAAW;EAC9E,GAAI;GACJ;EAEJ;AAIF,MAAa,mBAAmB;AAEhC,MAAa,uBAAuB;AAEpC,MAAa,qBAAqB;AAElC,MAAa,qBAAqB,YAAqD,EAAE,SAAU,GAAG,SAAS,QAAQ;AACrH,QACE,oBAAC;EAAqB;EAAK;YACzB,oBAAC;GAAiB,GAAI;GAAQ;IAA4B;GAC1C;EAEpB;AAEF,MAAa,0BAA0B;AAKvC,MAAa,uBAAuB,YACjC,EAAE,SAAU,GAAG,SAAS,QAAQ;CAC/B,MAAM,UAAU,qBAAqB;AAErC,QACE,oBAAC;EAAmB;EAAK;YACvB,oBAAC;GACC,YAAY,UAAU;AACpB,QAAI,MAAM,QAAQ,QAChB,SAAQ,SAAS,QAAQ,WAAW;;GAGxC,GAAI;GAEH;IACc;GACH;EAGrB;AAED,MAAa,mBAAmB,YAAqD,EAAE,SAAU,GAAG,SAAS,QAAQ;CACnH,MAAM,UAAU,qBAAqB;AAErC,QACE,8CACG,QAAQ,MAAM,KAAK,OAAO,UACzB,qBAAC;EAAqB;EAAc;aAClC,qBAAC,mCACC,oBAAC,+BAAmB,QAA0B,EAC9C,oBAAC,wCACC,oBAAC,cAAY,GACc,IACR,EACvB,oBAAC,uBAAqB;IAPwB,MAQhC,CAChB,EACF,oBAAC;EAAmB;EAAK;YACvB,oBAAC;GACC,YAAY,UAAU;AACpB,QAAI,MAAM,QAAQ,QAChB,SAAQ,SAAS,QAAQ,WAAW;;GAGxC,GAAI;GAEH;IACc;GACH,IACf;EAEL"}
1
+ {"version":3,"file":"TagSelector.mjs","names":[],"sources":["../../src/TagSelector/TagSelector.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, useEffect, useId, useRef } from \"react\";\nimport { type CollectionItem, useTagsInputContext, useComboboxContext } from \"@ark-ui/react\";\nimport { CloseLine } from \"@ndla/icons\";\nimport {\n ComboboxClearTrigger,\n ComboboxControl,\n type ComboboxControlProps,\n ComboboxInput,\n type ComboboxInputProps,\n ComboboxLabel,\n ComboboxRoot,\n type ComboboxRootProps,\n ComboboxTrigger,\n TagsInputControl,\n type TagsInputControlProps,\n TagsInputInput,\n type TagsInputInputProps,\n TagsInputItem,\n TagsInputItemDeleteTrigger,\n TagsInputItemPreview,\n TagsInputItemText,\n TagsInputRoot,\n type TagsInputRootProps,\n TagsInputItemInput,\n} from \"@ndla/primitives\";\nimport { contains } from \"@ndla/util\";\n\nexport type TagSelectorRootProps<T extends CollectionItem> = ComboboxRootProps<T> & TagsInputRootProps;\n\nexport const TagSelectorRoot = <T extends CollectionItem>({\n allowCustomValue = true,\n multiple = true,\n selectionBehavior = \"clear\",\n editable,\n addOnPaste = false,\n onValueChange,\n children,\n value,\n translations,\n ...rest\n}: TagSelectorRootProps<T>) => {\n const ids = {\n root: useId(),\n input: useId(),\n control: useId(),\n };\n\n const controlRef = useRef<HTMLDivElement | undefined>(undefined);\n\n useEffect(() => {\n if (!controlRef.current) {\n controlRef.current = document.getElementById(ids.control) as HTMLDivElement | undefined;\n }\n }, [ids.control]);\n\n return (\n <ComboboxRoot\n ids={ids}\n asChild\n allowCustomValue={allowCustomValue}\n multiple={multiple}\n selectionBehavior={selectionBehavior}\n onValueChange={onValueChange}\n translations={translations}\n onPointerDownOutside={(event) => {\n if (contains(controlRef.current, event.detail.originalEvent.target)) {\n event.preventDefault();\n }\n }}\n value={value}\n {...rest}\n >\n <TagSelectorTagsInputRoot\n ids={ids}\n value={value}\n editable={editable}\n onValueChange={onValueChange}\n addOnPaste={addOnPaste}\n translations={translations}\n >\n {children}\n </TagSelectorTagsInputRoot>\n </ComboboxRoot>\n );\n};\n\nconst TagSelectorTagsInputRoot = forwardRef<HTMLDivElement, TagsInputRootProps>((props, ref) => {\n const comboboxApi = useComboboxContext();\n return (\n <TagsInputRoot\n ref={ref}\n onInputValueChange={(details) => comboboxApi.setInputValue(details.inputValue)}\n {...props}\n />\n );\n});\n\nexport type TagSelectorControlProps = ComboboxControlProps & TagsInputControlProps;\n\nexport const TagSelectorLabel = ComboboxLabel;\n\nexport const TagSelectorItemInput = TagsInputItemInput;\n\nexport const TagSelectorTrigger = ComboboxTrigger;\n\nexport const TagSelectorControl = forwardRef<HTMLDivElement, TagSelectorControlProps>(({ children, ...props }, ref) => {\n return (\n <ComboboxControl ref={ref} asChild>\n <TagsInputControl {...props}>{children}</TagsInputControl>\n </ComboboxControl>\n );\n});\n\nexport const TagSelectorClearTrigger = ComboboxClearTrigger;\n\nexport type TagSelectorInputProps = ComboboxInputProps & TagsInputInputProps;\n\n// If you need to modify the TagsInputItem, you can use this.\nexport const TagSelectorInputBase = forwardRef<HTMLInputElement, TagSelectorInputProps>(\n ({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n );\n },\n);\n\nexport const TagSelectorInput = forwardRef<HTMLInputElement, TagSelectorInputProps>(({ children, ...props }, ref) => {\n const tagsApi = useTagsInputContext();\n\n return (\n <>\n {tagsApi.value.map((value, index) => (\n <TagsInputItem index={index} value={value} key={value}>\n <TagsInputItemPreview>\n <TagsInputItemText>{value}</TagsInputItemText>\n <TagsInputItemDeleteTrigger>\n <CloseLine />\n </TagsInputItemDeleteTrigger>\n </TagsInputItemPreview>\n <TagsInputItemInput />\n </TagsInputItem>\n ))}\n <ComboboxInput ref={ref} asChild>\n <TagsInputInput\n onKeyDown={(event) => {\n if (event.key === \"Enter\") {\n tagsApi.addValue(tagsApi.inputValue);\n }\n }}\n {...props}\n >\n {children}\n </TagsInputInput>\n </ComboboxInput>\n </>\n );\n});\n"],"mappings":";;;;;;;;;;;;;;;AAqCA,MAAa,mBAA6C,EACxD,mBAAmB,MACnB,WAAW,MACX,oBAAoB,SACpB,UACA,aAAa,OACb,eACA,UACA,OACA,aACA,GAAG,WAC0B;CAC7B,MAAM,MAAM;EACV,MAAM,OAAO;EACb,OAAO,OAAO;EACd,SAAS,OAAO;EACjB;CAED,MAAM,aAAa,OAAmC,OAAU;AAEhE,iBAAgB;AACd,MAAI,CAAC,WAAW,QACd,YAAW,UAAU,SAAS,eAAe,IAAI,QAAQ;IAE1D,CAAC,IAAI,QAAQ,CAAC;AAEjB,QACE,oBAAC;EACM;EACL;EACkB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C,GAAI;GAEH;IACc;GACH,IACf;EAEL"}
@@ -3,6 +3,13 @@ import { Button } from "@ndla/primitives";
3
3
  import { jsx } from "react/jsx-runtime";
4
4
 
5
5
  //#region src/ZendeskButton/ZendeskButton.tsx
6
+ /**
7
+ * Copyright (c) 2024-present, NDLA.
8
+ *
9
+ * This source code is licensed under the GPLv3 license found in the
10
+ * LICENSE file in the root directory of this source tree.
11
+ *
12
+ */
6
13
  const ZendeskButton = forwardRef(({ locale, variant = "secondary", widgetKey, children,...rest }, ref) => {
7
14
  const [loading, setLoading] = useState(false);
8
15
  const handleClick = () => {
@@ -1 +1 @@
1
- {"version":3,"file":"ZendeskButton.mjs","names":[],"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,gBAAgB,YAC1B,EAAE,QAAQ,UAAU,aAAa,WAAW,SAAU,GAAG,QAAQ,QAAQ;CACxE,MAAM,CAAC,SAAS,cAAc,SAAS,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,oBAAC;EAAO,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;GACM;EAGd"}
1
+ {"version":3,"file":"ZendeskButton.mjs","names":[],"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,gBAAgB,YAC1B,EAAE,QAAQ,UAAU,aAAa,WAAW,SAAU,GAAG,QAAQ,QAAQ;CACxE,MAAM,CAAC,SAAS,cAAc,SAAS,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,oBAAC;EAAO,SAAS;EAAsB;EAAS,IAAG;EAAgB,UAAU;EAAS,GAAI;EAAW;EAClG;GACM;EAGd"}
@@ -2,6 +2,13 @@ import { useMemo } from "react";
2
2
  import { useTranslation } from "react-i18next";
3
3
 
4
4
  //#region src/i18n/useComponentTranslations.ts
5
+ /**
6
+ * Copyright (c) 2024-present, NDLA.
7
+ *
8
+ * This source code is licensed under the GPLv3 license found in the
9
+ * LICENSE file in the root directory of this source tree.
10
+ *
11
+ */
5
12
  const useTagsInputTranslations = (translations) => {
6
13
  const { t } = useTranslation("translation", { keyPrefix: "component.tagsInput" });
7
14
  return useMemo(() => ({
@@ -1 +1 @@
1
- {"version":3,"file":"useComponentTranslations.mjs","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,MAAM,eAAe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;EACL,mBAAmB,EAAE,oBAAoB;EACzC,mBAAmB,EAAE,oBAAoB;EACzC,gBAAgB,EAAE,iBAAiB;EACnC,WAAW,EAAE,YAAY;EACzB,YAAY,EAAE,aAAa;EAC3B,cAAc,EAAE,eAAe;EAC/B,UAAU,EAAE,WAAW;EACvB,OAAO,EAAE,QAAQ;EACjB,GAAG;EACJ,GACD,CAAC,GAAG,aAAa,CAClB;;AAGH,MAAa,6BACX,iBACqD;CACrD,MAAM,EAAE,MAAM,eAAe,eAAe,EAAE,WAAW,wBAAwB,CAAC;AAElF,QAAO,eACE;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"}
1
+ {"version":3,"file":"useComponentTranslations.mjs","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,MAAM,eAAe,eAAe,EAAE,WAAW,uBAAuB,CAAC;AAEjF,QAAO,eACE;EACL,mBAAmB,EAAE,oBAAoB;EACzC,wBAAwB,QAAQ,EAAE,yBAAyB,EAAE,KAAK,CAAC;EACnE,WAAW,QAAQ,EAAE,YAAY,EAAE,KAAK,CAAC;EACzC,aAAa,QAAQ,EAAE,cAAc,EAAE,QAAQ,IAAI,QAAQ,CAAC;EAC5D,YAAY,QAAQ,EAAE,aAAa,EAAE,KAAK,CAAC;EAC3C,aAAa,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;EAC7C,aAAa,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;EAC7C,cAAc,QAAQ,EAAE,eAAe,EAAE,KAAK,CAAC;EAC/C,GAAG;EAC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,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/es/index.mjs CHANGED
@@ -13,7 +13,6 @@ import { AudioPlayer } from "./AudioPlayer/AudioPlayer.mjs";
13
13
  import { AudioEmbed } from "./Embed/AudioEmbed.mjs";
14
14
  import { FootnoteEmbed } from "./Embed/FootnoteEmbed.mjs";
15
15
  import { ContentLinkEmbed } from "./Embed/ContentLinkEmbed.mjs";
16
- import { BadgesContainer } from "./Article/BadgesContainer.mjs";
17
16
  import { RelatedArticle, RelatedArticleList } from "./RelatedArticleList/RelatedArticleList.mjs";
18
17
  import { RelatedContentEmbed } from "./Embed/RelatedContentEmbed.mjs";
19
18
  import { ConceptInlineTriggerButton } from "./Embed/ConceptInlineTriggerButton.mjs";
@@ -29,6 +28,7 @@ import { CodeEmbed } from "./Embed/CodeEmbed.mjs";
29
28
  import { EmbedWrapper } from "./Embed/EmbedWrapper.mjs";
30
29
  import { ArticleFootNotes } from "./Article/ArticleFootNotes.mjs";
31
30
  import { ArticleByline, ArticleBylineAccordionItem } from "./Article/ArticleByline.mjs";
31
+ import { BadgesContainer } from "./Article/BadgesContainer.mjs";
32
32
  import { Article, ArticleContent, ArticleFooter, ArticleHGroup, ArticleHeader, ArticleTitle, ArticleWrapper } from "./Article/Article.mjs";
33
33
  import { getPossiblyRelativeUrl } from "./utils/relativeUrl.mjs";
34
34
  import { FileListEmbed, FileListItem, FileListWrapper } from "./FileList/FileList.mjs";
@@ -4,6 +4,13 @@ import { wordClass } from "../model/WordClass.mjs";
4
4
  import { contributorTypes } from "@ndla/licenses";
5
5
 
6
6
  //#region src/locale/messages-en.ts
7
+ /**
8
+ * Copyright (c) 2018-present, NDLA.
9
+ *
10
+ * This source code is licensed under the GPLv3 license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ *
13
+ */
7
14
  const messages = {
8
15
  ...Object.entries(contributorTypes).reduce((acc, curr) => {
9
16
  acc[curr[0]] = curr[1].en;
@@ -1 +1 @@
1
- {"version":3,"file":"messages-en.mjs","names":[],"sources":["../../src/locale/messages-en.ts"],"sourcesContent":["/**\n * Copyright (c) 2018-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 { contributorTypes } from \"@ndla/licenses\";\nimport { subjectCategories } from \"../model/SubjectCategories\";\nimport { subjectTypes } from \"../model/SubjectTypes\";\nimport { wordClass } from \"../model/WordClass\";\n\nconst messages = {\n ...Object.entries(contributorTypes).reduce<Record<string, string>>((acc, curr) => {\n acc[curr[0]] = curr[1].en;\n return acc;\n }, {}),\n askNDLA: \"Ask NDLA\",\n subjectCategories: {\n [subjectCategories.ACTIVE_SUBJECTS]: \"Active\",\n [subjectCategories.ARCHIVE_SUBJECTS]: \"Expired\",\n [subjectCategories.BETA_SUBJECTS]: \"Revised\",\n [subjectCategories.OTHER]: \"Other resources\",\n [subjectTypes.RESOURCE_COLLECTION]: \"Resource collections\",\n },\n subjectTypes: {\n [subjectTypes.ARCHIVE_SUBJECT]: \"Archive subject\",\n [subjectTypes.BETA_SUBJECT]: \"Beta subject\",\n [subjectTypes.RESOURCE_COLLECTION]: \"Resource collection\",\n [subjectTypes.SUBJECT]: \"Subject\",\n },\n meta: {\n description: \"Norwegian Digital Learning Arena, Open Educational Resources for upper secondary education.\",\n keywords: \"open educational resources,teaching,learning\",\n },\n logo: {\n altText: \"The Norwegian Digital Learning Arena\",\n },\n article: {\n lastUpdated: \"Last revised date\",\n useContent: \"Cite or reuse?\",\n authorsLabel_article: \"Written by\",\n authorsLabel_learningPath: \"Made by\",\n authorsLabel_external: \"This link is added by\",\n copyPageLinkCopied: \"Link copied\",\n copyHeaderLink: \"Copy link to header\",\n conjunction: \"and\",\n supplierLabel_one: \"Rightsholder:\",\n supplierLabel_other: \"Rightsholders:\",\n printPage: \"Print text\",\n access: {\n onlyTeacher: \"This resource is accessible only to teachers who are logged in with Feide.\",\n },\n footnotes: \"Footnotes\",\n },\n external: {\n lastUpdated: \"Last revised date\",\n },\n learningPath: {\n copiedFrom: \"This is a remix of a different learning path\",\n lastUpdated: \"Last revised date\",\n },\n license: {\n tabs: {\n text: \"Text\",\n images: \"Images\",\n audio: \"Audio\",\n video: \"Video\",\n h5p: \"H5P\",\n files: \"Files\",\n embedlink: \"Embedded link\",\n concept: \"Concepts\",\n gloss: \"Glosses\",\n podcast: \"Podcast\",\n other: \"Other content\",\n },\n embedlink: {\n heading: \"How to show the article in other content\",\n description: \"This url shows the article without menu and footer\",\n copyTitle: \"Copy link\",\n hasCopiedTitle: \"Link copied\",\n },\n image: {\n rules: \"Rules for use of image:\",\n },\n images: {\n heading: \"How to reuse images\",\n description: \"Remember to copy the text to be attached to the image where you use it.\",\n rules: \"Rules for use of image\",\n itemImage: {\n ariaLabel: \"Open image in new window\",\n zoomImageButtonLabel: \"Expand image\",\n zoomOutImageButtonLabel: \"Shrink image\",\n expandByline: \"Show byline\",\n minimizeByline: \"Hide byline\",\n },\n licenseText: \"This image has the license\",\n restrictedUseText: \"This image has\",\n },\n text: {\n heading: \"How to reuse the text\",\n description: \"Remember to refer to the source when reusing text.\",\n rules: \"Rules for use of text\",\n published: \"Published\",\n licenseText: \"This text has the license\",\n restrictedUseText: \"This text has\",\n },\n audio: {\n heading: \"How to reuse audio files\",\n description: \"Remember to copy the text to be attached to the audio where you use it.\",\n rules: \"Rules for use of audio file\",\n licenseText: \"This audio file has the license\",\n restrictedUseText: \"This audio file has\",\n },\n podcast: {\n heading: \"How to reuse podcasts\",\n description: \"Remember to copy the text to be attached to the podcast where you use it.\",\n rules: \"Rules for use of podcast\",\n licenseText: \"This podcast has the license\",\n restrictedUseText: \"This podcast has\",\n },\n video: {\n heading: \"How to reuse videos\",\n description: \"Remember to copy the text to be attached to the video where you use it.\",\n rules: \"Rules for use of video files\",\n itemImage: {\n ariaLabel: \"Open video in new window\",\n },\n licenseText: \"This video has the license\",\n restrictedUseText: \"This video has\",\n },\n other: {\n heading: \"How to reuse other content\",\n description: \"You will find guidelines for use of other content in the asset\",\n itemImage: {\n ariaLabel: \"Open in new window\",\n },\n },\n h5p: {\n heading: \"How to reuse H5P content\",\n description: \"You will find guidelines for use of H5P content in the asset\",\n rules: \"Rules for use of H5P\",\n licenseText: \"This interactive task (H5P) is licensed\",\n restrictedUseText: \"This interactive task (H5P) has\",\n },\n concept: {\n heading: \"How to reuse concept content\",\n description: \"Remember that built-in content might have a different license than the explanation text\",\n rules: \"Rules for use of concept\",\n embedlink: {\n heading: \"How to show the concept in other content\",\n description: \"This url shows the concept without menu and footer\",\n copyTitle: \"Copy embed link\",\n hasCopiedTitle: \"Embed link copied\",\n },\n licenseText: \"This concept has the license\",\n restrictedUseText: \"This concept has\",\n },\n gloss: {\n heading: \"How to reuse gloss content\",\n description: \"Remember that built-in content might have a different license than the gloss text\",\n rules: \"Rules for use of gloss\",\n showOrHideExamples: \"Show or hide examples\",\n embedlink: {\n heading: \"How to show the gloss in other content\",\n description: \"This url shows the gloss without menu and footer\",\n copyTitle: \"Copy embed link\",\n hasCopiedTitle: \"Embed link copied\",\n },\n licenseText: \"This gloss has the license\",\n restrictedUseText: \"This gloss has\",\n },\n files: {\n heading: \"How to reuse files\",\n description: \"Remember to copy the text to be attached to the file where you use it.\",\n rules: \"Rules for use of file\",\n itemImage: {\n ariaLabel: \"Open video in new window\",\n },\n },\n copyTitle: \"Copy source reference\",\n embed: \"Embed\",\n embedCopied: \"Copied embed code!\",\n copyText: {\n now: \"now\",\n podcast: \"podcast\",\n by: \"by\",\n internet: \"[Internet]. \",\n noTitle: \"No title\",\n downloadedFrom: \"Downloaded from: \",\n readDate: \"Read: \",\n },\n hasCopiedTitle: \"Copied!\",\n download: \"Download\",\n openLink: \"Open in new tab\",\n processed: \"The content has been processed\",\n },\n errorMessage: {\n title: \"Oops, something went wrong\",\n description: \"Sorry, an error occurred.\",\n back: \"Go back\",\n goToFrontPage: \"Go to frontpage\",\n },\n figure: {\n button: {\n alternative: \"Switch to visually interpreted video\",\n original: \"Switch to original video\",\n },\n },\n contentTypes: {\n all: \"All\",\n article: \"Article\",\n subject: \"Subject\",\n \"topic-article\": \"Topic article\",\n learningpath: \"Learning path\",\n \"learning-path\": \"Learning path\",\n \"subject-material\": \"Subject material\",\n \"tasks-and-activities\": \"Task and activities\",\n \"source-material\": \"Source material\",\n \"assessment-resources\": \"Assessment resource\",\n topic: \"Topic\",\n multidisciplinary: \"Multidisciplinary case\",\n image: \"Image\",\n concept: \"Concept\",\n audio: \"Audio\",\n podcast: \"Podcast\",\n h5p: \"H5P\",\n video: \"Video\",\n missing: \"Unknown\",\n external: \"External\",\n gloss: \"Gloss\",\n programme: \"Programme\",\n \"podcast-series\": \"Podcast series\",\n \"frontpage-article\": \"About NDLA article\",\n },\n languages: {\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n en: \"English\",\n fr: \"French\",\n de: \"German\",\n se: \"Northern Sami\",\n sma: \"Southern Sami\",\n es: \"Spanish\",\n zh: \"Chinese\",\n ukr: \"Ukranian\",\n unknown: \"Unknown\",\n prefixChangeLanguage: \"Choose language\",\n },\n breadcrumb: {\n toFrontpage: \"NDLA frontpage\",\n breadcrumb: \"Breadcrumb\",\n },\n codeBlock: {\n copiedCode: \"Copied code\",\n copyCode: \"Copy code\",\n },\n cancel: \"Cancel\",\n close: \"Close\",\n loading: \"Loading\",\n title: \"Title\",\n save: \"Save\",\n email: \"Email\",\n finished: \"Finished\",\n audio: {\n play: \"Play\",\n pause: \"Pause\",\n progressBar: \"Progress bar\",\n valueText: \"{{start}} of {{end}}\",\n controls: {\n forward15sec: \"Forward 15 seconds\",\n rewind15sec: \"Rewind 15 seconds\",\n selectSpeed: \"Choose speed\",\n adjustVolume: \"Adjust volume\",\n },\n textVersion: {\n heading: \"Text version\",\n close: \"Close text version\",\n },\n readMoreDescriptionLabel: \"Show more\",\n readLessDescriptionLabel: \"Show less\",\n },\n source: \"Source\",\n related: {\n title: \"Related content\",\n linkInfo: \"Web page at\",\n showMore: \"Show more related content\",\n showLess: \"Show less\",\n },\n download: \"Download file: \",\n factbox: {\n open: \"Open fact box\",\n close: \"Close fact box\",\n },\n embed: {\n linkError: \"Failed to show link.\",\n unsupported: `Embed {{type}} not supported.`,\n embedError: `An error occurred while loading the {{type}}. Try reloading the page.`,\n type: {\n image: \"Image\",\n video: \"Video\",\n audio: \"Audio\",\n podcast: \"Podcast\",\n concept: \"Concept\",\n h5p: \"H5P\",\n external: \"External resource\",\n gloss: \"Gloss\",\n copyright: \"Text\",\n code: \"Code block\",\n disclaimer: \"Accessibility warning\",\n },\n },\n uuDisclaimer: { title: \"Accessibility\" },\n gloss: {\n examples: \"Examples\",\n showExamples: \"Show examples\",\n wordClass: \"Word class\",\n play: \"Play gloss\",\n transcriptions: {\n traditional: \"Traditional spelling\",\n pinyin: \"Pinyin\",\n },\n },\n wordClass: {\n [wordClass.adjective]: \"Adjective\",\n [wordClass.adverb]: \"Adverb\",\n [wordClass.properNoun]: \"Proper Noun\",\n [wordClass.auxiliary]: \"Auxiliary\",\n [wordClass.complement]: \"Complement\",\n [wordClass.conjunction]: \"Conjunction\",\n [wordClass.coverb]: \"Coverb\",\n [wordClass.determiner]: \"Determiner\",\n [wordClass.interjection]: \"Interjection\",\n [wordClass.quantifier]: \"Quantifier\",\n [wordClass.marker]: \"Marker\",\n [wordClass.modalVerb]: \"Modal Verb\",\n [wordClass.measureWord]: \"Measure Word\",\n [wordClass.noun]: \"Noun\",\n [wordClass[\"noun-zh\"]]: \"Noun\",\n [wordClass.nounPhrase]: \"Noun Phrase\",\n [wordClass.onomatopoeia]: \"Onomatopoeia\",\n [wordClass.particle]: \"Particle\",\n [wordClass.demonstrative]: \"Demonstrative\",\n [wordClass.personalPronoun]: \"Personal Pronoun\",\n [wordClass.preposition]: \"Preposition\",\n [wordClass.pronoun]: \"Pronoun\",\n [wordClass.questionWord]: \"Question Word\",\n [wordClass.locationWord]: \"Location Word\",\n [wordClass.suffix]: \"Suffix\",\n [wordClass.numeral]: \"Numeral\",\n [wordClass.timeWord]: \"Time word\",\n [wordClass.timeExpression]: \"Time Expression\",\n [wordClass.stativeVerb]: \"Stative Verb\",\n [wordClass.subordinatingConjunction]: \"Subordinating Conjunction\",\n [wordClass.exclamationWord]: \"Exclamation Word\",\n [wordClass.expression]: \"Expression\",\n [wordClass.verb]: \"Verb\",\n [wordClass.verbComplement]: \"Verb-Complement\",\n [wordClass.verbObject]: \"Verb-Object\",\n },\n login: \"Log in\",\n component: {\n tagsInput: {\n clearTriggerLabel: \"Clear all tags\",\n deleteTagTriggerLabel: \"Remove tag {{tag}}\",\n tagAdded: \"Added tag {{tag}}\",\n tagsPasted: \"Pasted {{length}} tags\",\n tagEdited: \"Edited tag {{tag}}. Press enter to save, or escape to cancel.\",\n tagUpdated: \"Tag updated to {{tag}}\",\n tagDeleted: \"Tag {{tag}} deleted\",\n tagSelected: \"Tag {{tag}} selected. Press enter to edit. Press backspace or delete to delete.\",\n },\n combobox: {\n triggerLabel: \"Show suggestions\",\n clearTriggerLabel: \"Clear selection\",\n },\n pagination: {\n rootLabel: \"Pagination\",\n prevTriggerLabel: \"Previous page\",\n nextTriggerLabel: \"Next page\",\n lastPage: \"Last page, page {{page}}\",\n page: \"Page {{page}}\",\n },\n imageSearch: {\n searchPlaceholder: \"Search images\",\n searchButtonTitle: \"Search\",\n imagePreview: {\n creatorsLabel: \"Image\",\n license: \"License\",\n caption: \"Caption\",\n altText: \"Alt-text\",\n modelRelease: \"Model released\",\n tags: \"Tags\",\n checkboxLabel: \"Set as meta image\",\n close: \"Close\",\n useImageTitle: \"Use image\",\n },\n },\n audioSearch: {\n searchPlaceholder: \"Search in audio files\",\n searchButtonTitle: \"Search\",\n useAudio: \"Chose audio\",\n noResults: \"No audio files found\",\n },\n videoSearch: {\n searchPlaceholder: \"Search videos\",\n searchButtonTitle: \"Search\",\n loadMoreVideos: \"Load more videos\",\n noResults: \"No videos found\",\n addVideo: \"Use video\",\n previewVideo: \"Preview\",\n is360Video: \"VR video\",\n close: \"Lukk\",\n },\n datePicker: {\n dayCell: {\n unavailable: \"Unavailable date. {{date}}\",\n selected: \"Selected date. {{date}}\",\n select: \"Select date. {{date}}\",\n },\n nextTrigger: {\n day: \"Go to next month\",\n month: \"Go to next year\",\n year: \"Go to next decade\",\n },\n prevTrigger: {\n day: \"Go to previous month\",\n month: \"Go to previous year\",\n year: \"Go to previous decade\",\n },\n monthSelect: \"Select month\",\n yearSelect: \"Select year\",\n viewTrigger: {\n day: \"Switch to day view\",\n month: \"Switch to month view\",\n year: \"Switch to year view\",\n },\n presetTrigger: {\n single: \"Select {{date}}\",\n range: \"Select from {{start}} to {{end}}\",\n },\n clearTrigger: \"Clear selected dates\",\n trigger: {\n open: \"Open date picker\",\n close: \"Close date picker\",\n },\n content: \"Calendar\",\n },\n },\n richTextEditor: {\n tooltip: {\n bold: \"Bold ({{shortcut}})\",\n code: \"Code ({{shortcut}})\",\n sub: \"Subscript ({{shortcut}})\",\n sup: \"Superscript ({{shortcut}})\",\n underlined: \"Underlined ({{shortcut}})\",\n italic: \"Italic ({{shortcut}})\",\n \"numbered-list\": \"Numbered list ({{shortcut}})\",\n \"letter-list\": \"Alphabetical list ({{shortcut}})\",\n \"bulleted-list\": \"Bulleted list ({{shortcut}})\",\n heading: \"Heading {{level}} ({{shortcut}})\",\n paragraph: \"Paragraph ({{shortcut}})\",\n section: \"Section ({{shortcut}})\",\n link: \"Link ({{shortcut}})\",\n },\n },\n};\n\nexport default messages;\n"],"mappings":";;;;;;AAaA,MAAM,WAAW;CACf,GAAG,OAAO,QAAQ,iBAAiB,CAAC,QAAgC,KAAK,SAAS;AAChF,MAAI,KAAK,MAAM,KAAK,GAAG;AACvB,SAAO;IACN,EAAE,CAAC;CACN,SAAS;CACT,mBAAmB;GAChB,kBAAkB,kBAAkB;GACpC,kBAAkB,mBAAmB;GACrC,kBAAkB,gBAAgB;GAClC,kBAAkB,QAAQ;GAC1B,aAAa,sBAAsB;EACrC;CACD,cAAc;GACX,aAAa,kBAAkB;GAC/B,aAAa,eAAe;GAC5B,aAAa,sBAAsB;GACnC,aAAa,UAAU;EACzB;CACD,MAAM;EACJ,aAAa;EACb,UAAU;EACX;CACD,MAAM,EACJ,SAAS,wCACV;CACD,SAAS;EACP,aAAa;EACb,YAAY;EACZ,sBAAsB;EACtB,2BAA2B;EAC3B,uBAAuB;EACvB,oBAAoB;EACpB,gBAAgB;EAChB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,WAAW;EACX,QAAQ,EACN,aAAa,8EACd;EACD,WAAW;EACZ;CACD,UAAU,EACR,aAAa,qBACd;CACD,cAAc;EACZ,YAAY;EACZ,aAAa;EACd;CACD,SAAS;EACP,MAAM;GACJ,MAAM;GACN,QAAQ;GACR,OAAO;GACP,OAAO;GACP,KAAK;GACL,OAAO;GACP,WAAW;GACX,SAAS;GACT,OAAO;GACP,SAAS;GACT,OAAO;GACR;EACD,WAAW;GACT,SAAS;GACT,aAAa;GACb,WAAW;GACX,gBAAgB;GACjB;EACD,OAAO,EACL,OAAO,2BACR;EACD,QAAQ;GACN,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;IACT,WAAW;IACX,sBAAsB;IACtB,yBAAyB;IACzB,cAAc;IACd,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,MAAM;GACJ,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;GACX,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,SAAS;GACP,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW,EACT,WAAW,4BACZ;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,WAAW,EACT,WAAW,sBACZ;GACF;EACD,KAAK;GACH,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,SAAS;GACP,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;IACT,SAAS;IACT,aAAa;IACb,WAAW;IACX,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,oBAAoB;GACpB,WAAW;IACT,SAAS;IACT,aAAa;IACb,WAAW;IACX,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW,EACT,WAAW,4BACZ;GACF;EACD,WAAW;EACX,OAAO;EACP,aAAa;EACb,UAAU;GACR,KAAK;GACL,SAAS;GACT,IAAI;GACJ,UAAU;GACV,SAAS;GACT,gBAAgB;GAChB,UAAU;GACX;EACD,gBAAgB;EAChB,UAAU;EACV,UAAU;EACV,WAAW;EACZ;CACD,cAAc;EACZ,OAAO;EACP,aAAa;EACb,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GACZ;EACD,aAAa;GACX,mBAAmB;GACnB,mBAAmB;GACnB,gBAAgB;GAChB,WAAW;GACX,UAAU;GACV,cAAc;GACd,YAAY;GACZ,OAAO;GACR;EACD,YAAY;GACV,SAAS;IACP,aAAa;IACb,UAAU;IACV,QAAQ;IACT;GACD,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,aAAa;GACb,YAAY;GACZ,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,eAAe;IACb,QAAQ;IACR,OAAO;IACR;GACD,cAAc;GACd,SAAS;IACP,MAAM;IACN,OAAO;IACR;GACD,SAAS;GACV;EACF;CACD,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,MAAM;EACN,KAAK;EACL,KAAK;EACL,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,eAAe;EACf,iBAAiB;EACjB,SAAS;EACT,WAAW;EACX,SAAS;EACT,MAAM;EACP,EACF;CACF;AAED,0BAAe"}
1
+ {"version":3,"file":"messages-en.mjs","names":[],"sources":["../../src/locale/messages-en.ts"],"sourcesContent":["/**\n * Copyright (c) 2018-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 { contributorTypes } from \"@ndla/licenses\";\nimport { subjectCategories } from \"../model/SubjectCategories\";\nimport { subjectTypes } from \"../model/SubjectTypes\";\nimport { wordClass } from \"../model/WordClass\";\n\nconst messages = {\n ...Object.entries(contributorTypes).reduce<Record<string, string>>((acc, curr) => {\n acc[curr[0]] = curr[1].en;\n return acc;\n }, {}),\n askNDLA: \"Ask NDLA\",\n subjectCategories: {\n [subjectCategories.ACTIVE_SUBJECTS]: \"Active\",\n [subjectCategories.ARCHIVE_SUBJECTS]: \"Expired\",\n [subjectCategories.BETA_SUBJECTS]: \"Revised\",\n [subjectCategories.OTHER]: \"Other resources\",\n [subjectTypes.RESOURCE_COLLECTION]: \"Resource collections\",\n },\n subjectTypes: {\n [subjectTypes.ARCHIVE_SUBJECT]: \"Archive subject\",\n [subjectTypes.BETA_SUBJECT]: \"Beta subject\",\n [subjectTypes.RESOURCE_COLLECTION]: \"Resource collection\",\n [subjectTypes.SUBJECT]: \"Subject\",\n },\n meta: {\n description: \"Norwegian Digital Learning Arena, Open Educational Resources for upper secondary education.\",\n keywords: \"open educational resources,teaching,learning\",\n },\n logo: {\n altText: \"The Norwegian Digital Learning Arena\",\n },\n article: {\n lastUpdated: \"Last revised date\",\n useContent: \"Cite or reuse?\",\n authorsLabel_article: \"Written by\",\n authorsLabel_learningPath: \"Made by\",\n authorsLabel_external: \"This link is added by\",\n copyPageLinkCopied: \"Link copied\",\n copyHeaderLink: \"Copy link to header\",\n conjunction: \"and\",\n supplierLabel_one: \"Rightsholder:\",\n supplierLabel_other: \"Rightsholders:\",\n printPage: \"Print text\",\n access: {\n onlyTeacher: \"This resource is accessible only to teachers who are logged in with Feide.\",\n },\n footnotes: \"Footnotes\",\n },\n external: {\n lastUpdated: \"Last revised date\",\n },\n learningPath: {\n copiedFrom: \"This is a remix of a different learning path\",\n lastUpdated: \"Last revised date\",\n },\n license: {\n tabs: {\n text: \"Text\",\n images: \"Images\",\n audio: \"Audio\",\n video: \"Video\",\n h5p: \"H5P\",\n files: \"Files\",\n embedlink: \"Embedded link\",\n concept: \"Concepts\",\n gloss: \"Glosses\",\n podcast: \"Podcast\",\n other: \"Other content\",\n },\n embedlink: {\n heading: \"How to show the article in other content\",\n description: \"This url shows the article without menu and footer\",\n copyTitle: \"Copy link\",\n hasCopiedTitle: \"Link copied\",\n },\n image: {\n rules: \"Rules for use of image:\",\n },\n images: {\n heading: \"How to reuse images\",\n description: \"Remember to copy the text to be attached to the image where you use it.\",\n rules: \"Rules for use of image\",\n itemImage: {\n ariaLabel: \"Open image in new window\",\n zoomImageButtonLabel: \"Expand image\",\n zoomOutImageButtonLabel: \"Shrink image\",\n expandByline: \"Show byline\",\n minimizeByline: \"Hide byline\",\n },\n licenseText: \"This image has the license\",\n restrictedUseText: \"This image has\",\n },\n text: {\n heading: \"How to reuse the text\",\n description: \"Remember to refer to the source when reusing text.\",\n rules: \"Rules for use of text\",\n published: \"Published\",\n licenseText: \"This text has the license\",\n restrictedUseText: \"This text has\",\n },\n audio: {\n heading: \"How to reuse audio files\",\n description: \"Remember to copy the text to be attached to the audio where you use it.\",\n rules: \"Rules for use of audio file\",\n licenseText: \"This audio file has the license\",\n restrictedUseText: \"This audio file has\",\n },\n podcast: {\n heading: \"How to reuse podcasts\",\n description: \"Remember to copy the text to be attached to the podcast where you use it.\",\n rules: \"Rules for use of podcast\",\n licenseText: \"This podcast has the license\",\n restrictedUseText: \"This podcast has\",\n },\n video: {\n heading: \"How to reuse videos\",\n description: \"Remember to copy the text to be attached to the video where you use it.\",\n rules: \"Rules for use of video files\",\n itemImage: {\n ariaLabel: \"Open video in new window\",\n },\n licenseText: \"This video has the license\",\n restrictedUseText: \"This video has\",\n },\n other: {\n heading: \"How to reuse other content\",\n description: \"You will find guidelines for use of other content in the asset\",\n itemImage: {\n ariaLabel: \"Open in new window\",\n },\n },\n h5p: {\n heading: \"How to reuse H5P content\",\n description: \"You will find guidelines for use of H5P content in the asset\",\n rules: \"Rules for use of H5P\",\n licenseText: \"This interactive task (H5P) is licensed\",\n restrictedUseText: \"This interactive task (H5P) has\",\n },\n concept: {\n heading: \"How to reuse concept content\",\n description: \"Remember that built-in content might have a different license than the explanation text\",\n rules: \"Rules for use of concept\",\n embedlink: {\n heading: \"How to show the concept in other content\",\n description: \"This url shows the concept without menu and footer\",\n copyTitle: \"Copy embed link\",\n hasCopiedTitle: \"Embed link copied\",\n },\n licenseText: \"This concept has the license\",\n restrictedUseText: \"This concept has\",\n },\n gloss: {\n heading: \"How to reuse gloss content\",\n description: \"Remember that built-in content might have a different license than the gloss text\",\n rules: \"Rules for use of gloss\",\n showOrHideExamples: \"Show or hide examples\",\n embedlink: {\n heading: \"How to show the gloss in other content\",\n description: \"This url shows the gloss without menu and footer\",\n copyTitle: \"Copy embed link\",\n hasCopiedTitle: \"Embed link copied\",\n },\n licenseText: \"This gloss has the license\",\n restrictedUseText: \"This gloss has\",\n },\n files: {\n heading: \"How to reuse files\",\n description: \"Remember to copy the text to be attached to the file where you use it.\",\n rules: \"Rules for use of file\",\n itemImage: {\n ariaLabel: \"Open video in new window\",\n },\n },\n copyTitle: \"Copy source reference\",\n embed: \"Embed\",\n embedCopied: \"Copied embed code!\",\n copyText: {\n now: \"now\",\n podcast: \"podcast\",\n by: \"by\",\n internet: \"[Internet]. \",\n noTitle: \"No title\",\n downloadedFrom: \"Downloaded from: \",\n readDate: \"Read: \",\n },\n hasCopiedTitle: \"Copied!\",\n download: \"Download\",\n openLink: \"Open in new tab\",\n processed: \"The content has been processed\",\n },\n errorMessage: {\n title: \"Oops, something went wrong\",\n description: \"Sorry, an error occurred.\",\n back: \"Go back\",\n goToFrontPage: \"Go to frontpage\",\n },\n figure: {\n button: {\n alternative: \"Switch to visually interpreted video\",\n original: \"Switch to original video\",\n },\n },\n contentTypes: {\n all: \"All\",\n article: \"Article\",\n subject: \"Subject\",\n \"topic-article\": \"Topic article\",\n learningpath: \"Learning path\",\n \"learning-path\": \"Learning path\",\n \"subject-material\": \"Subject material\",\n \"tasks-and-activities\": \"Task and activities\",\n \"source-material\": \"Source material\",\n \"assessment-resources\": \"Assessment resource\",\n topic: \"Topic\",\n multidisciplinary: \"Multidisciplinary case\",\n image: \"Image\",\n concept: \"Concept\",\n audio: \"Audio\",\n podcast: \"Podcast\",\n h5p: \"H5P\",\n video: \"Video\",\n missing: \"Unknown\",\n external: \"External\",\n gloss: \"Gloss\",\n programme: \"Programme\",\n \"podcast-series\": \"Podcast series\",\n \"frontpage-article\": \"About NDLA article\",\n },\n languages: {\n nb: \"Norwegian Bokmål\",\n nn: \"Norwegian Nynorsk\",\n en: \"English\",\n fr: \"French\",\n de: \"German\",\n se: \"Northern Sami\",\n sma: \"Southern Sami\",\n es: \"Spanish\",\n zh: \"Chinese\",\n ukr: \"Ukranian\",\n unknown: \"Unknown\",\n prefixChangeLanguage: \"Choose language\",\n },\n breadcrumb: {\n toFrontpage: \"NDLA frontpage\",\n breadcrumb: \"Breadcrumb\",\n },\n codeBlock: {\n copiedCode: \"Copied code\",\n copyCode: \"Copy code\",\n },\n cancel: \"Cancel\",\n close: \"Close\",\n loading: \"Loading\",\n title: \"Title\",\n save: \"Save\",\n email: \"Email\",\n finished: \"Finished\",\n audio: {\n play: \"Play\",\n pause: \"Pause\",\n progressBar: \"Progress bar\",\n valueText: \"{{start}} of {{end}}\",\n controls: {\n forward15sec: \"Forward 15 seconds\",\n rewind15sec: \"Rewind 15 seconds\",\n selectSpeed: \"Choose speed\",\n adjustVolume: \"Adjust volume\",\n },\n textVersion: {\n heading: \"Text version\",\n close: \"Close text version\",\n },\n readMoreDescriptionLabel: \"Show more\",\n readLessDescriptionLabel: \"Show less\",\n },\n source: \"Source\",\n related: {\n title: \"Related content\",\n linkInfo: \"Web page at\",\n showMore: \"Show more related content\",\n showLess: \"Show less\",\n },\n download: \"Download file: \",\n factbox: {\n open: \"Open fact box\",\n close: \"Close fact box\",\n },\n embed: {\n linkError: \"Failed to show link.\",\n unsupported: `Embed {{type}} not supported.`,\n embedError: `An error occurred while loading the {{type}}. Try reloading the page.`,\n type: {\n image: \"Image\",\n video: \"Video\",\n audio: \"Audio\",\n podcast: \"Podcast\",\n concept: \"Concept\",\n h5p: \"H5P\",\n external: \"External resource\",\n gloss: \"Gloss\",\n copyright: \"Text\",\n code: \"Code block\",\n disclaimer: \"Accessibility warning\",\n },\n },\n uuDisclaimer: { title: \"Accessibility\" },\n gloss: {\n examples: \"Examples\",\n showExamples: \"Show examples\",\n wordClass: \"Word class\",\n play: \"Play gloss\",\n transcriptions: {\n traditional: \"Traditional spelling\",\n pinyin: \"Pinyin\",\n },\n },\n wordClass: {\n [wordClass.adjective]: \"Adjective\",\n [wordClass.adverb]: \"Adverb\",\n [wordClass.properNoun]: \"Proper Noun\",\n [wordClass.auxiliary]: \"Auxiliary\",\n [wordClass.complement]: \"Complement\",\n [wordClass.conjunction]: \"Conjunction\",\n [wordClass.coverb]: \"Coverb\",\n [wordClass.determiner]: \"Determiner\",\n [wordClass.interjection]: \"Interjection\",\n [wordClass.quantifier]: \"Quantifier\",\n [wordClass.marker]: \"Marker\",\n [wordClass.modalVerb]: \"Modal Verb\",\n [wordClass.measureWord]: \"Measure Word\",\n [wordClass.noun]: \"Noun\",\n [wordClass[\"noun-zh\"]]: \"Noun\",\n [wordClass.nounPhrase]: \"Noun Phrase\",\n [wordClass.onomatopoeia]: \"Onomatopoeia\",\n [wordClass.particle]: \"Particle\",\n [wordClass.demonstrative]: \"Demonstrative\",\n [wordClass.personalPronoun]: \"Personal Pronoun\",\n [wordClass.preposition]: \"Preposition\",\n [wordClass.pronoun]: \"Pronoun\",\n [wordClass.questionWord]: \"Question Word\",\n [wordClass.locationWord]: \"Location Word\",\n [wordClass.suffix]: \"Suffix\",\n [wordClass.numeral]: \"Numeral\",\n [wordClass.timeWord]: \"Time word\",\n [wordClass.timeExpression]: \"Time Expression\",\n [wordClass.stativeVerb]: \"Stative Verb\",\n [wordClass.subordinatingConjunction]: \"Subordinating Conjunction\",\n [wordClass.exclamationWord]: \"Exclamation Word\",\n [wordClass.expression]: \"Expression\",\n [wordClass.verb]: \"Verb\",\n [wordClass.verbComplement]: \"Verb-Complement\",\n [wordClass.verbObject]: \"Verb-Object\",\n },\n login: \"Log in\",\n component: {\n tagsInput: {\n clearTriggerLabel: \"Clear all tags\",\n deleteTagTriggerLabel: \"Remove tag {{tag}}\",\n tagAdded: \"Added tag {{tag}}\",\n tagsPasted: \"Pasted {{length}} tags\",\n tagEdited: \"Edited tag {{tag}}. Press enter to save, or escape to cancel.\",\n tagUpdated: \"Tag updated to {{tag}}\",\n tagDeleted: \"Tag {{tag}} deleted\",\n tagSelected: \"Tag {{tag}} selected. Press enter to edit. Press backspace or delete to delete.\",\n },\n combobox: {\n triggerLabel: \"Show suggestions\",\n clearTriggerLabel: \"Clear selection\",\n },\n pagination: {\n rootLabel: \"Pagination\",\n prevTriggerLabel: \"Previous page\",\n nextTriggerLabel: \"Next page\",\n lastPage: \"Last page, page {{page}}\",\n page: \"Page {{page}}\",\n },\n imageSearch: {\n searchPlaceholder: \"Search images\",\n searchButtonTitle: \"Search\",\n imagePreview: {\n creatorsLabel: \"Image\",\n license: \"License\",\n caption: \"Caption\",\n altText: \"Alt-text\",\n modelRelease: \"Model released\",\n tags: \"Tags\",\n checkboxLabel: \"Set as meta image\",\n close: \"Close\",\n useImageTitle: \"Use image\",\n },\n },\n audioSearch: {\n searchPlaceholder: \"Search in audio files\",\n searchButtonTitle: \"Search\",\n useAudio: \"Chose audio\",\n noResults: \"No audio files found\",\n },\n videoSearch: {\n searchPlaceholder: \"Search videos\",\n searchButtonTitle: \"Search\",\n loadMoreVideos: \"Load more videos\",\n noResults: \"No videos found\",\n addVideo: \"Use video\",\n previewVideo: \"Preview\",\n is360Video: \"VR video\",\n close: \"Lukk\",\n },\n datePicker: {\n dayCell: {\n unavailable: \"Unavailable date. {{date}}\",\n selected: \"Selected date. {{date}}\",\n select: \"Select date. {{date}}\",\n },\n nextTrigger: {\n day: \"Go to next month\",\n month: \"Go to next year\",\n year: \"Go to next decade\",\n },\n prevTrigger: {\n day: \"Go to previous month\",\n month: \"Go to previous year\",\n year: \"Go to previous decade\",\n },\n monthSelect: \"Select month\",\n yearSelect: \"Select year\",\n viewTrigger: {\n day: \"Switch to day view\",\n month: \"Switch to month view\",\n year: \"Switch to year view\",\n },\n presetTrigger: {\n single: \"Select {{date}}\",\n range: \"Select from {{start}} to {{end}}\",\n },\n clearTrigger: \"Clear selected dates\",\n trigger: {\n open: \"Open date picker\",\n close: \"Close date picker\",\n },\n content: \"Calendar\",\n },\n },\n richTextEditor: {\n tooltip: {\n bold: \"Bold ({{shortcut}})\",\n code: \"Code ({{shortcut}})\",\n sub: \"Subscript ({{shortcut}})\",\n sup: \"Superscript ({{shortcut}})\",\n underlined: \"Underlined ({{shortcut}})\",\n italic: \"Italic ({{shortcut}})\",\n \"numbered-list\": \"Numbered list ({{shortcut}})\",\n \"letter-list\": \"Alphabetical list ({{shortcut}})\",\n \"bulleted-list\": \"Bulleted list ({{shortcut}})\",\n heading: \"Heading {{level}} ({{shortcut}})\",\n paragraph: \"Paragraph ({{shortcut}})\",\n section: \"Section ({{shortcut}})\",\n link: \"Link ({{shortcut}})\",\n },\n },\n};\n\nexport default messages;\n"],"mappings":";;;;;;;;;;;;;AAaA,MAAM,WAAW;CACf,GAAG,OAAO,QAAQ,iBAAiB,CAAC,QAAgC,KAAK,SAAS;AAChF,MAAI,KAAK,MAAM,KAAK,GAAG;AACvB,SAAO;IACN,EAAE,CAAC;CACN,SAAS;CACT,mBAAmB;GAChB,kBAAkB,kBAAkB;GACpC,kBAAkB,mBAAmB;GACrC,kBAAkB,gBAAgB;GAClC,kBAAkB,QAAQ;GAC1B,aAAa,sBAAsB;EACrC;CACD,cAAc;GACX,aAAa,kBAAkB;GAC/B,aAAa,eAAe;GAC5B,aAAa,sBAAsB;GACnC,aAAa,UAAU;EACzB;CACD,MAAM;EACJ,aAAa;EACb,UAAU;EACX;CACD,MAAM,EACJ,SAAS,wCACV;CACD,SAAS;EACP,aAAa;EACb,YAAY;EACZ,sBAAsB;EACtB,2BAA2B;EAC3B,uBAAuB;EACvB,oBAAoB;EACpB,gBAAgB;EAChB,aAAa;EACb,mBAAmB;EACnB,qBAAqB;EACrB,WAAW;EACX,QAAQ,EACN,aAAa,8EACd;EACD,WAAW;EACZ;CACD,UAAU,EACR,aAAa,qBACd;CACD,cAAc;EACZ,YAAY;EACZ,aAAa;EACd;CACD,SAAS;EACP,MAAM;GACJ,MAAM;GACN,QAAQ;GACR,OAAO;GACP,OAAO;GACP,KAAK;GACL,OAAO;GACP,WAAW;GACX,SAAS;GACT,OAAO;GACP,SAAS;GACT,OAAO;GACR;EACD,WAAW;GACT,SAAS;GACT,aAAa;GACb,WAAW;GACX,gBAAgB;GACjB;EACD,OAAO,EACL,OAAO,2BACR;EACD,QAAQ;GACN,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;IACT,WAAW;IACX,sBAAsB;IACtB,yBAAyB;IACzB,cAAc;IACd,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,MAAM;GACJ,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;GACX,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,SAAS;GACP,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW,EACT,WAAW,4BACZ;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,WAAW,EACT,WAAW,sBACZ;GACF;EACD,KAAK;GACH,SAAS;GACT,aAAa;GACb,OAAO;GACP,aAAa;GACb,mBAAmB;GACpB;EACD,SAAS;GACP,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW;IACT,SAAS;IACT,aAAa;IACb,WAAW;IACX,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,oBAAoB;GACpB,WAAW;IACT,SAAS;IACT,aAAa;IACb,WAAW;IACX,gBAAgB;IACjB;GACD,aAAa;GACb,mBAAmB;GACpB;EACD,OAAO;GACL,SAAS;GACT,aAAa;GACb,OAAO;GACP,WAAW,EACT,WAAW,4BACZ;GACF;EACD,WAAW;EACX,OAAO;EACP,aAAa;EACb,UAAU;GACR,KAAK;GACL,SAAS;GACT,IAAI;GACJ,UAAU;GACV,SAAS;GACT,gBAAgB;GAChB,UAAU;GACX;EACD,gBAAgB;EAChB,UAAU;EACV,U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ACD,aAAa;GACX,mBAAmB;GACnB,mBAAmB;GACnB,UAAU;GACV,WAAW;GACZ;EACD,aAAa;GACX,mBAAmB;GACnB,mBAAmB;GACnB,gBAAgB;GAChB,WAAW;GACX,UAAU;GACV,cAAc;GACd,YAAY;GACZ,OAAO;GACR;EACD,YAAY;GACV,SAAS;IACP,aAAa;IACb,UAAU;IACV,QAAQ;IACT;GACD,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,aAAa;GACb,YAAY;GACZ,aAAa;IACX,KAAK;IACL,OAAO;IACP,MAAM;IACP;GACD,eAAe;IACb,QAAQ;IACR,OAAO;IACR;GACD,cAAc;GACd,SAAS;IACP,MAAM;IACN,OAAO;IACR;GACD,SAAS;GACV;EACF;CACD,gBAAgB,EACd,SAAS;EACP,MAAM;EACN,MAAM;EACN,KAAK;EACL,KAAK;EACL,YAAY;EACZ,QAAQ;EACR,iBAAiB;EACjB,eAAe;EACf,iBAAiB;EACjB,SAAS;EACT,WAAW;EACX,SAAS;EACT,MAAM;EACP,EACF;CACF;AAED,0BAAe"}
@@ -4,6 +4,13 @@ import { wordClass } from "../model/WordClass.mjs";
4
4
  import { contributorTypes } from "@ndla/licenses";
5
5
 
6
6
  //#region src/locale/messages-nb.ts
7
+ /**
8
+ * Copyright (c) 2018-present, NDLA.
9
+ *
10
+ * This source code is licensed under the GPLv3 license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ *
13
+ */
7
14
  const messages = {
8
15
  ...Object.entries(contributorTypes).reduce((acc, curr) => {
9
16
  acc[curr[0]] = curr[1].nb;