@ndla/ui 56.0.123-alpha.0 → 56.0.124-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/es/Article/Article.js +122 -194
  2. package/es/Article/Article.js.map +1 -0
  3. package/es/Article/ArticleByline.js +121 -170
  4. package/es/Article/ArticleByline.js.map +1 -0
  5. package/es/Article/ArticleFootNotes.js +38 -58
  6. package/es/Article/ArticleFootNotes.js.map +1 -0
  7. package/es/AudioPlayer/AudioPlayer.js +151 -212
  8. package/es/AudioPlayer/AudioPlayer.js.map +1 -0
  9. package/es/AudioPlayer/Controls.js +246 -324
  10. package/es/AudioPlayer/Controls.js.map +1 -0
  11. package/es/AudioPlayer/SpeechControl.js +36 -52
  12. package/es/AudioPlayer/SpeechControl.js.map +1 -0
  13. package/es/AudioPlayer/index.js +7 -9
  14. package/es/AudioPlayer/index.js.map +1 -0
  15. package/es/Breadcrumb/Breadcrumb.js +42 -58
  16. package/es/Breadcrumb/Breadcrumb.js.map +1 -0
  17. package/es/Breadcrumb/BreadcrumbItem.js +33 -59
  18. package/es/Breadcrumb/BreadcrumbItem.js.map +1 -0
  19. package/es/Breadcrumb/HomeBreadcrumb.js +41 -74
  20. package/es/Breadcrumb/HomeBreadcrumb.js.map +1 -0
  21. package/es/Breadcrumb/index.js +8 -10
  22. package/es/Breadcrumb/index.js.map +1 -0
  23. package/es/CampaignBlock/CampaignBlock.js +124 -173
  24. package/es/CampaignBlock/CampaignBlock.js.map +1 -0
  25. package/es/CodeBlock/CodeBlock.js +21 -31
  26. package/es/CodeBlock/CodeBlock.js.map +1 -0
  27. package/es/CodeBlock/codeLanguageOptions.js +112 -82
  28. package/es/CodeBlock/codeLanguageOptions.js.map +1 -0
  29. package/es/Concept/Concept.js +46 -68
  30. package/es/Concept/Concept.js.map +1 -0
  31. package/es/ContactBlock/ContactBlock.js +137 -191
  32. package/es/ContactBlock/ContactBlock.js.map +1 -0
  33. package/es/ContentTypeBadge/ContentTypeBadge.js +38 -47
  34. package/es/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
  35. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +21 -28
  36. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
  37. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +21 -28
  38. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
  39. package/es/ContentTypeHero/ContentTypeHero.js +36 -47
  40. package/es/ContentTypeHero/ContentTypeHero.js.map +1 -0
  41. package/es/CopyParagraphButton/CopyParagraphButton.js +57 -78
  42. package/es/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
  43. package/es/CopyParagraphButton/index.js +7 -10
  44. package/es/CopyParagraphButton/index.js.map +1 -0
  45. package/es/Embed/AudioEmbed.js +49 -73
  46. package/es/Embed/AudioEmbed.js.map +1 -0
  47. package/es/Embed/BrightcoveEmbed.js +90 -127
  48. package/es/Embed/BrightcoveEmbed.js.map +1 -0
  49. package/es/Embed/CodeEmbed.js +55 -73
  50. package/es/Embed/CodeEmbed.js.map +1 -0
  51. package/es/Embed/ConceptEmbed.js +72 -117
  52. package/es/Embed/ConceptEmbed.js.map +1 -0
  53. package/es/Embed/ConceptInlineTriggerButton.js +39 -44
  54. package/es/Embed/ConceptInlineTriggerButton.js.map +1 -0
  55. package/es/Embed/ContentLinkEmbed.js +29 -49
  56. package/es/Embed/ContentLinkEmbed.js.map +1 -0
  57. package/es/Embed/CopyrightEmbed.js +21 -31
  58. package/es/Embed/CopyrightEmbed.js.map +1 -0
  59. package/es/Embed/EmbedErrorPlaceholder.js +40 -55
  60. package/es/Embed/EmbedErrorPlaceholder.js.map +1 -0
  61. package/es/Embed/EmbedWrapper.js +21 -46
  62. package/es/Embed/EmbedWrapper.js.map +1 -0
  63. package/es/Embed/ExternalEmbed.js +50 -70
  64. package/es/Embed/ExternalEmbed.js.map +1 -0
  65. package/es/Embed/FootnoteEmbed.js +25 -42
  66. package/es/Embed/FootnoteEmbed.js.map +1 -0
  67. package/es/Embed/GlossEmbed.js +49 -77
  68. package/es/Embed/GlossEmbed.js.map +1 -0
  69. package/es/Embed/H5pEmbed.js +35 -58
  70. package/es/Embed/H5pEmbed.js.map +1 -0
  71. package/es/Embed/IframeEmbed.js +65 -89
  72. package/es/Embed/IframeEmbed.js.map +1 -0
  73. package/es/Embed/ImageEmbed.js +167 -225
  74. package/es/Embed/ImageEmbed.js.map +1 -0
  75. package/es/Embed/InlineTriggerButton.js +20 -32
  76. package/es/Embed/InlineTriggerButton.js.map +1 -0
  77. package/es/Embed/RelatedContentEmbed.js +36 -53
  78. package/es/Embed/RelatedContentEmbed.js.map +1 -0
  79. package/es/Embed/UnknownEmbed.js +18 -29
  80. package/es/Embed/UnknownEmbed.js.map +1 -0
  81. package/es/Embed/UuDisclaimerEmbed.js +51 -85
  82. package/es/Embed/UuDisclaimerEmbed.js.map +1 -0
  83. package/es/ErrorMessage/ErrorMessage.js +51 -92
  84. package/es/ErrorMessage/ErrorMessage.js.map +1 -0
  85. package/es/ErrorMessage/index.js +7 -9
  86. package/es/ErrorMessage/index.js.map +1 -0
  87. package/es/FactBox/FactBox.js +114 -170
  88. package/es/FactBox/FactBox.js.map +1 -0
  89. package/es/FactBox/index.js +7 -9
  90. package/es/FactBox/index.js.map +1 -0
  91. package/es/FileList/File.js +70 -95
  92. package/es/FileList/File.js.map +1 -0
  93. package/es/FileList/FileList.js +31 -46
  94. package/es/FileList/FileList.js.map +1 -0
  95. package/es/FileList/PdfFile.js +27 -49
  96. package/es/FileList/PdfFile.js.map +1 -0
  97. package/es/Gloss/Gloss.js +133 -166
  98. package/es/Gloss/Gloss.js.map +1 -0
  99. package/es/Gloss/GlossExample.js +42 -60
  100. package/es/Gloss/GlossExample.js.map +1 -0
  101. package/es/Grid/Grid.js +63 -91
  102. package/es/Grid/Grid.js.map +1 -0
  103. package/es/Grid/GridParallaxItem.js +19 -30
  104. package/es/Grid/GridParallaxItem.js.map +1 -0
  105. package/es/KeyFigure/KeyFigure.js +44 -61
  106. package/es/KeyFigure/KeyFigure.js.map +1 -0
  107. package/es/LicenseByline/EmbedByline.js +126 -206
  108. package/es/LicenseByline/EmbedByline.js.map +1 -0
  109. package/es/LicenseByline/LicenseLink.js +28 -53
  110. package/es/LicenseByline/LicenseLink.js.map +1 -0
  111. package/es/LinkBlock/LinkBlock.js +70 -99
  112. package/es/LinkBlock/LinkBlock.js.map +1 -0
  113. package/es/LinkBlock/LinkBlockSection.js +20 -32
  114. package/es/LinkBlock/LinkBlockSection.js.map +1 -0
  115. package/es/Pitch/Pitch.js +59 -80
  116. package/es/Pitch/Pitch.js.map +1 -0
  117. package/es/RelatedArticleList/RelatedArticleList.js +91 -129
  118. package/es/RelatedArticleList/RelatedArticleList.js.map +1 -0
  119. package/es/RelatedArticleList/index.js +7 -10
  120. package/es/RelatedArticleList/index.js.map +1 -0
  121. package/es/ResourceBox/ResourceBox.js +71 -96
  122. package/es/ResourceBox/ResourceBox.js.map +1 -0
  123. package/es/TagSelector/TagSelector.js +93 -136
  124. package/es/TagSelector/TagSelector.js.map +1 -0
  125. package/es/ZendeskButton/ZendeskButton.js +38 -52
  126. package/es/ZendeskButton/ZendeskButton.js.map +1 -0
  127. package/es/_virtual/rolldown_runtime.js +11 -0
  128. package/es/i18n/formatNestedMessages.js +16 -24
  129. package/es/i18n/formatNestedMessages.js.map +1 -0
  130. package/es/i18n/i18n.js +25 -31
  131. package/es/i18n/i18n.js.map +1 -0
  132. package/es/i18n/useComponentTranslations.js +147 -203
  133. package/es/i18n/useComponentTranslations.js.map +1 -0
  134. package/es/index.js +64 -44
  135. package/es/locale/messages-en.js +435 -459
  136. package/es/locale/messages-en.js.map +1 -0
  137. package/es/locale/messages-nb.js +435 -459
  138. package/es/locale/messages-nb.js.map +1 -0
  139. package/es/locale/messages-nn.js +435 -459
  140. package/es/locale/messages-nn.js.map +1 -0
  141. package/es/locale/messages-se.js +435 -459
  142. package/es/locale/messages-se.js.map +1 -0
  143. package/es/model/ContentType.js +69 -65
  144. package/es/model/ContentType.js.map +1 -0
  145. package/es/model/SubjectCategories.js +23 -10
  146. package/es/model/SubjectCategories.js.map +1 -0
  147. package/es/model/SubjectTypes.js +21 -9
  148. package/es/model/SubjectTypes.js.map +1 -0
  149. package/es/model/WordClass.js +51 -43
  150. package/es/model/WordClass.js.map +1 -0
  151. package/es/model/index.js +16 -18
  152. package/es/model/index.js.map +1 -0
  153. package/es/utils/licenseAttributes.js +15 -17
  154. package/es/utils/licenseAttributes.js.map +1 -0
  155. package/es/utils/relativeUrl.js +21 -32
  156. package/es/utils/relativeUrl.js.map +1 -0
  157. package/lib/Article/Article.js +130 -203
  158. package/lib/Article/Article.js.map +1 -0
  159. package/lib/Article/ArticleByline.js +125 -179
  160. package/lib/Article/ArticleByline.js.map +1 -0
  161. package/lib/Article/ArticleFootNotes.js +39 -65
  162. package/lib/Article/ArticleFootNotes.js.map +1 -0
  163. package/lib/AudioPlayer/AudioPlayer.js +155 -221
  164. package/lib/AudioPlayer/AudioPlayer.js.map +1 -0
  165. package/lib/AudioPlayer/Controls.js +249 -332
  166. package/lib/AudioPlayer/Controls.js.map +1 -0
  167. package/lib/AudioPlayer/SpeechControl.js +39 -60
  168. package/lib/AudioPlayer/SpeechControl.js.map +1 -0
  169. package/lib/AudioPlayer/index.js +7 -15
  170. package/lib/AudioPlayer/index.js.map +1 -0
  171. package/lib/Breadcrumb/Breadcrumb.js +43 -65
  172. package/lib/Breadcrumb/Breadcrumb.js.map +1 -0
  173. package/lib/Breadcrumb/BreadcrumbItem.js +34 -65
  174. package/lib/Breadcrumb/BreadcrumbItem.js.map +1 -0
  175. package/lib/Breadcrumb/HomeBreadcrumb.js +43 -82
  176. package/lib/Breadcrumb/HomeBreadcrumb.js.map +1 -0
  177. package/lib/Breadcrumb/index.js +8 -22
  178. package/lib/Breadcrumb/index.js.map +1 -0
  179. package/lib/CampaignBlock/CampaignBlock.js +128 -183
  180. package/lib/CampaignBlock/CampaignBlock.js.map +1 -0
  181. package/lib/CodeBlock/CodeBlock.js +23 -38
  182. package/lib/CodeBlock/CodeBlock.js.map +1 -0
  183. package/lib/CodeBlock/codeLanguageOptions.js +112 -87
  184. package/lib/CodeBlock/codeLanguageOptions.js.map +1 -0
  185. package/lib/Concept/Concept.js +48 -75
  186. package/lib/Concept/Concept.js.map +1 -0
  187. package/lib/ContactBlock/ContactBlock.js +141 -200
  188. package/lib/ContactBlock/ContactBlock.js.map +1 -0
  189. package/lib/ContentTypeBadge/ContentTypeBadge.js +40 -54
  190. package/lib/ContentTypeBadge/ContentTypeBadge.js.map +1 -0
  191. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +23 -35
  192. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js.map +1 -0
  193. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +23 -35
  194. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js.map +1 -0
  195. package/lib/ContentTypeHero/ContentTypeHero.js +37 -54
  196. package/lib/ContentTypeHero/ContentTypeHero.js.map +1 -0
  197. package/lib/CopyParagraphButton/CopyParagraphButton.js +61 -87
  198. package/lib/CopyParagraphButton/CopyParagraphButton.js.map +1 -0
  199. package/lib/CopyParagraphButton/index.js +7 -21
  200. package/lib/CopyParagraphButton/index.js.map +1 -0
  201. package/lib/Embed/AudioEmbed.js +51 -82
  202. package/lib/Embed/AudioEmbed.js.map +1 -0
  203. package/lib/Embed/BrightcoveEmbed.js +93 -138
  204. package/lib/Embed/BrightcoveEmbed.js.map +1 -0
  205. package/lib/Embed/CodeEmbed.js +59 -83
  206. package/lib/Embed/CodeEmbed.js.map +1 -0
  207. package/lib/Embed/ConceptEmbed.js +77 -127
  208. package/lib/Embed/ConceptEmbed.js.map +1 -0
  209. package/lib/Embed/ConceptInlineTriggerButton.js +39 -49
  210. package/lib/Embed/ConceptInlineTriggerButton.js.map +1 -0
  211. package/lib/Embed/ContentLinkEmbed.js +30 -55
  212. package/lib/Embed/ContentLinkEmbed.js.map +1 -0
  213. package/lib/Embed/CopyrightEmbed.js +22 -37
  214. package/lib/Embed/CopyrightEmbed.js.map +1 -0
  215. package/lib/Embed/EmbedErrorPlaceholder.js +42 -62
  216. package/lib/Embed/EmbedErrorPlaceholder.js.map +1 -0
  217. package/lib/Embed/EmbedWrapper.js +24 -54
  218. package/lib/Embed/EmbedWrapper.js.map +1 -0
  219. package/lib/Embed/ExternalEmbed.js +53 -79
  220. package/lib/Embed/ExternalEmbed.js.map +1 -0
  221. package/lib/Embed/FootnoteEmbed.js +26 -48
  222. package/lib/Embed/FootnoteEmbed.js.map +1 -0
  223. package/lib/Embed/GlossEmbed.js +51 -86
  224. package/lib/Embed/GlossEmbed.js.map +1 -0
  225. package/lib/Embed/H5pEmbed.js +37 -66
  226. package/lib/Embed/H5pEmbed.js.map +1 -0
  227. package/lib/Embed/IframeEmbed.js +68 -98
  228. package/lib/Embed/IframeEmbed.js.map +1 -0
  229. package/lib/Embed/ImageEmbed.js +173 -238
  230. package/lib/Embed/ImageEmbed.js.map +1 -0
  231. package/lib/Embed/InlineTriggerButton.js +23 -40
  232. package/lib/Embed/InlineTriggerButton.js.map +1 -0
  233. package/lib/Embed/RelatedContentEmbed.js +37 -59
  234. package/lib/Embed/RelatedContentEmbed.js.map +1 -0
  235. package/lib/Embed/UnknownEmbed.js +19 -35
  236. package/lib/Embed/UnknownEmbed.js.map +1 -0
  237. package/lib/Embed/UuDisclaimerEmbed.js +53 -92
  238. package/lib/Embed/UuDisclaimerEmbed.js.map +1 -0
  239. package/lib/ErrorMessage/ErrorMessage.js +53 -99
  240. package/lib/ErrorMessage/ErrorMessage.js.map +1 -0
  241. package/lib/ErrorMessage/index.js +7 -15
  242. package/lib/ErrorMessage/index.js.map +1 -0
  243. package/lib/FactBox/FactBox.js +118 -180
  244. package/lib/FactBox/FactBox.js.map +1 -0
  245. package/lib/FactBox/index.js +7 -15
  246. package/lib/FactBox/index.js.map +1 -0
  247. package/lib/FileList/File.js +75 -105
  248. package/lib/FileList/File.js.map +1 -0
  249. package/lib/FileList/FileList.js +33 -52
  250. package/lib/FileList/FileList.js.map +1 -0
  251. package/lib/FileList/PdfFile.js +27 -55
  252. package/lib/FileList/PdfFile.js.map +1 -0
  253. package/lib/Gloss/Gloss.js +138 -176
  254. package/lib/Gloss/Gloss.js.map +1 -0
  255. package/lib/Gloss/GlossExample.js +45 -68
  256. package/lib/Gloss/GlossExample.js.map +1 -0
  257. package/lib/Grid/Grid.js +64 -98
  258. package/lib/Grid/Grid.js.map +1 -0
  259. package/lib/Grid/GridParallaxItem.js +19 -36
  260. package/lib/Grid/GridParallaxItem.js.map +1 -0
  261. package/lib/KeyFigure/KeyFigure.js +45 -68
  262. package/lib/KeyFigure/KeyFigure.js.map +1 -0
  263. package/lib/LicenseByline/EmbedByline.js +130 -216
  264. package/lib/LicenseByline/EmbedByline.js.map +1 -0
  265. package/lib/LicenseByline/LicenseLink.js +29 -59
  266. package/lib/LicenseByline/LicenseLink.js.map +1 -0
  267. package/lib/LinkBlock/LinkBlock.js +73 -108
  268. package/lib/LinkBlock/LinkBlock.js.map +1 -0
  269. package/lib/LinkBlock/LinkBlockSection.js +22 -39
  270. package/lib/LinkBlock/LinkBlockSection.js.map +1 -0
  271. package/lib/Pitch/Pitch.js +61 -89
  272. package/lib/Pitch/Pitch.js.map +1 -0
  273. package/lib/RelatedArticleList/RelatedArticleList.js +96 -140
  274. package/lib/RelatedArticleList/RelatedArticleList.js.map +1 -0
  275. package/lib/RelatedArticleList/index.js +7 -20
  276. package/lib/RelatedArticleList/index.js.map +1 -0
  277. package/lib/ResourceBox/ResourceBox.js +73 -104
  278. package/lib/ResourceBox/ResourceBox.js.map +1 -0
  279. package/lib/TagSelector/TagSelector.js +103 -145
  280. package/lib/TagSelector/TagSelector.js.map +1 -0
  281. package/lib/ZendeskButton/ZendeskButton.js +39 -58
  282. package/lib/ZendeskButton/ZendeskButton.js.map +1 -0
  283. package/lib/_virtual/rolldown_runtime.js +42 -0
  284. package/lib/i18n/formatNestedMessages.js +16 -30
  285. package/lib/i18n/formatNestedMessages.js.map +1 -0
  286. package/lib/i18n/i18n.js +28 -38
  287. package/lib/i18n/i18n.js.map +1 -0
  288. package/lib/i18n/useComponentTranslations.js +154 -215
  289. package/lib/i18n/useComponentTranslations.js.map +1 -0
  290. package/lib/index.js +156 -598
  291. package/lib/locale/messages-en.js +436 -466
  292. package/lib/locale/messages-en.js.map +1 -0
  293. package/lib/locale/messages-nb.js +436 -466
  294. package/lib/locale/messages-nb.js.map +1 -0
  295. package/lib/locale/messages-nn.js +436 -466
  296. package/lib/locale/messages-nn.js.map +1 -0
  297. package/lib/locale/messages-se.js +436 -466
  298. package/lib/locale/messages-se.js.map +1 -0
  299. package/lib/model/ContentType.js +90 -70
  300. package/lib/model/ContentType.js.map +1 -0
  301. package/lib/model/SubjectCategories.js +26 -14
  302. package/lib/model/SubjectCategories.js.map +1 -0
  303. package/lib/model/SubjectTypes.js +24 -13
  304. package/lib/model/SubjectTypes.js.map +1 -0
  305. package/lib/model/WordClass.js +55 -48
  306. package/lib/model/WordClass.js.map +1 -0
  307. package/lib/model/index.js +16 -25
  308. package/lib/model/index.js.map +1 -0
  309. package/lib/utils/licenseAttributes.js +14 -22
  310. package/lib/utils/licenseAttributes.js.map +1 -0
  311. package/lib/utils/relativeUrl.js +20 -38
  312. package/lib/utils/relativeUrl.js.map +1 -0
  313. package/package.json +12 -11
  314. package/es/Article/index.js +0 -11
  315. package/es/CampaignBlock/index.js +0 -9
  316. package/es/CodeBlock/index.js +0 -10
  317. package/es/ContactBlock/index.js +0 -9
  318. package/es/ContentTypeHero/index.js +0 -9
  319. package/es/Embed/index.js +0 -25
  320. package/es/Embed/types.js +0 -1
  321. package/es/FileList/index.js +0 -11
  322. package/es/Gloss/index.js +0 -10
  323. package/es/Grid/index.js +0 -10
  324. package/es/KeyFigure/index.js +0 -9
  325. package/es/LicenseByline/index.js +0 -10
  326. package/es/LinkBlock/index.js +0 -10
  327. package/es/Pitch/index.js +0 -9
  328. package/es/ResourceBox/index.js +0 -10
  329. package/es/i18n/index.js +0 -11
  330. package/es/types.js +0 -1
  331. package/lib/Article/index.js +0 -68
  332. package/lib/CampaignBlock/index.js +0 -13
  333. package/lib/CodeBlock/index.js +0 -20
  334. package/lib/ContactBlock/index.js +0 -18
  335. package/lib/ContentTypeHero/index.js +0 -12
  336. package/lib/Embed/index.js +0 -150
  337. package/lib/Embed/types.js +0 -5
  338. package/lib/FileList/index.js +0 -44
  339. package/lib/Gloss/index.js +0 -20
  340. package/lib/Grid/index.js +0 -19
  341. package/lib/KeyFigure/index.js +0 -13
  342. package/lib/LicenseByline/index.js +0 -19
  343. package/lib/LinkBlock/index.js +0 -20
  344. package/lib/Pitch/index.js +0 -12
  345. package/lib/ResourceBox/index.js +0 -13
  346. package/lib/i18n/index.js +0 -68
  347. package/lib/types.js +0 -5
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentTypeBlockQuote.js","names":[],"sources":["../../src/ContentTypeBlockQuote/ContentTypeBlockQuote.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 } from \"react\";\nimport { BlockQuote, type BlockQuoteProps, type BlockQuoteVariantProps } from \"@ndla/primitives\";\nimport type { ContentType } from \"../ContentTypeBadge/ContentTypeBadge\";\n\nexport type ContentTypeBlockQuoteVariant = \"colored\" | \"neutral\";\n\nconst contentTypeToVariantMapping = {\n \"subject-material\": \"brand1\",\n \"source-material\": \"brand1\",\n concept: \"brand1\",\n \"tasks-and-activities\": \"brand2\",\n \"assessment-resources\": \"brand2\",\n} as Record<ContentType, NonNullable<BlockQuoteVariantProps>[\"variant\"]>;\n\ninterface Props extends Omit<BlockQuoteProps, \"variant\"> {\n variant?: ContentTypeBlockQuoteVariant;\n contentType?: ContentType;\n}\n\nexport const ContentTypeBlockQuote = forwardRef<HTMLQuoteElement, Props>(({ variant, contentType, ...props }, ref) => {\n const color = contentType ? (contentTypeToVariantMapping[contentType] ?? \"brand1\") : \"brand1\";\n const variantColor = variant === \"colored\" ? color : undefined;\n return <BlockQuote {...props} variant={variantColor} ref={ref} />;\n});\n"],"mappings":";;;;;AAcA,MAAM,8BAA8B;CAClC,oBAAoB;CACpB,mBAAmB;CACnB,SAAS;CACT,wBAAwB;CACxB,wBAAwB;AACzB;AAOD,MAAa,wBAAwB,WAAoC,CAAC,EAAE,SAAS,YAAa,GAAG,OAAO,EAAE,QAAQ;CACpH,MAAM,QAAQ,cAAe,4BAA4B,gBAAgB,WAAY;CACrF,MAAM,eAAe,YAAY,YAAY;AAC7C,wBAAO,IAAC;EAAW,GAAI;EAAO,SAAS;EAAmB;GAAO;AAClE,EAAC"}
@@ -1,32 +1,25 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
1
  import { forwardRef } from "react";
10
2
  import { FramedContent } from "@ndla/primitives";
11
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+
5
+ //#region src/ContentTypeFramedContent/ContentTypeFramedContent.tsx
12
6
  const contentTypeToVariantMapping = {
13
- "subject-material": "brand1",
14
- "source-material": "brand1",
15
- concept: "brand1",
16
- "tasks-and-activities": "brand2",
17
- "assessment-resources": "brand2"
7
+ "subject-material": "brand1",
8
+ "source-material": "brand1",
9
+ concept: "brand1",
10
+ "tasks-and-activities": "brand2",
11
+ "assessment-resources": "brand2"
18
12
  };
19
- export const ContentTypeFramedContent = /*#__PURE__*/forwardRef((_ref, ref) => {
20
- let {
21
- variant = "neutral",
22
- contentType,
23
- ...props
24
- } = _ref;
25
- const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
26
- const variantColor = variant === "colored" ? color : undefined;
27
- return /*#__PURE__*/_jsx(FramedContent, {
28
- ...props,
29
- colorTheme: variantColor,
30
- ref: ref
31
- });
32
- });
13
+ const ContentTypeFramedContent = forwardRef(({ variant = "neutral", contentType,...props }, ref) => {
14
+ const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
15
+ const variantColor = variant === "colored" ? color : void 0;
16
+ return /* @__PURE__ */ jsx(FramedContent, {
17
+ ...props,
18
+ colorTheme: variantColor,
19
+ ref
20
+ });
21
+ });
22
+
23
+ //#endregion
24
+ export { ContentTypeFramedContent };
25
+ //# sourceMappingURL=ContentTypeFramedContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentTypeFramedContent.js","names":[],"sources":["../../src/ContentTypeFramedContent/ContentTypeFramedContent.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 } from \"react\";\nimport { FramedContent, type FramedContentProps, type FramedContentVariantProps } from \"@ndla/primitives\";\nimport type { ContentType } from \"..\";\n\nconst contentTypeToVariantMapping = {\n \"subject-material\": \"brand1\",\n \"source-material\": \"brand1\",\n concept: \"brand1\",\n \"tasks-and-activities\": \"brand2\",\n \"assessment-resources\": \"brand2\",\n} as Record<ContentType, NonNullable<FramedContentVariantProps>[\"colorTheme\"]>;\n\nexport type ContentTypeFramedContentVariant = \"colored\" | \"neutral\";\n\ninterface Props extends FramedContentProps {\n variant?: ContentTypeFramedContentVariant;\n contentType?: ContentType;\n}\n\nexport const ContentTypeFramedContent = forwardRef<HTMLDivElement, Props>(\n ({ variant = \"neutral\", contentType, ...props }, ref) => {\n const color = contentType ? (contentTypeToVariantMapping[contentType] ?? \"brand1\") : \"brand1\";\n const variantColor = variant === \"colored\" ? color : undefined;\n return <FramedContent {...props} colorTheme={variantColor} ref={ref} />;\n },\n);\n"],"mappings":";;;;;AAYA,MAAM,8BAA8B;CAClC,oBAAoB;CACpB,mBAAmB;CACnB,SAAS;CACT,wBAAwB;CACxB,wBAAwB;AACzB;AASD,MAAa,2BAA2B,WACtC,CAAC,EAAE,UAAU,WAAW,YAAa,GAAG,OAAO,EAAE,QAAQ;CACvD,MAAM,QAAQ,cAAe,4BAA4B,gBAAgB,WAAY;CACrF,MAAM,eAAe,YAAY,YAAY;AAC7C,wBAAO,IAAC;EAAc,GAAI;EAAO,YAAY;EAAmB;GAAO;AACxE,EACF"}
@@ -1,50 +1,39 @@
1
- /**
2
- * Copyright (c) 2024-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
1
+ import { ASSESSMENT_RESOURCES, AUDIO, CONCEPT, EXTERNAL, FRONTPAGE_ARTICLE, GLOSS, IMAGE, LEARNING_PATH, MISSING, MULTIDISCIPLINARY, PODCAST, PODCAST_SERIES, PROGRAMME, SOURCE_MATERIAL, SUBJECT, SUBJECT_MATERIAL, TASKS_AND_ACTIVITIES, TOPIC, VIDEO } from "../model/ContentType.js";
9
2
  import { forwardRef } from "react";
10
3
  import { Hero } from "@ndla/primitives";
11
- import * as contentTypes from "../model/ContentType";
12
- import { jsx as _jsx } from "react/jsx-runtime";
13
- export const contentTypeToHeroMap = {
14
- [contentTypes.SUBJECT_MATERIAL]: "primary",
15
- [contentTypes.TASKS_AND_ACTIVITIES]: "brand2Bold",
16
- [contentTypes.ASSESSMENT_RESOURCES]: "brand2",
17
- // This will never happen
18
- [contentTypes.SUBJECT]: "primary",
19
- [contentTypes.SOURCE_MATERIAL]: "brand1",
20
- // This will never happen
21
- [contentTypes.LEARNING_PATH]: "primary",
22
- [contentTypes.TOPIC]: "neutral",
23
- [contentTypes.MULTIDISCIPLINARY]: "primary",
24
- [contentTypes.CONCEPT]: "brand1Moderate",
25
- [contentTypes.EXTERNAL]: "primary",
26
- [contentTypes.IMAGE]: "primary",
27
- [contentTypes.AUDIO]: "primary",
28
- [contentTypes.PODCAST]: "primary",
29
- [contentTypes.VIDEO]: "primary",
30
- [contentTypes.MISSING]: "neutral",
31
- [contentTypes.GLOSS]: "brand1Moderate",
32
- // this will never happen
33
- [contentTypes.PROGRAMME]: "primary",
34
- // this will never happen
35
- [contentTypes.PODCAST_SERIES]: "primary",
36
- [contentTypes.FRONTPAGE_ARTICLE]: "primary"
4
+ import { jsx } from "react/jsx-runtime";
5
+
6
+ //#region src/ContentTypeHero/ContentTypeHero.tsx
7
+ const contentTypeToHeroMap = {
8
+ [SUBJECT_MATERIAL]: "primary",
9
+ [TASKS_AND_ACTIVITIES]: "brand2Bold",
10
+ [ASSESSMENT_RESOURCES]: "brand2",
11
+ [SUBJECT]: "primary",
12
+ [SOURCE_MATERIAL]: "brand1",
13
+ [LEARNING_PATH]: "primary",
14
+ [TOPIC]: "neutral",
15
+ [MULTIDISCIPLINARY]: "primary",
16
+ [CONCEPT]: "brand1Moderate",
17
+ [EXTERNAL]: "primary",
18
+ [IMAGE]: "primary",
19
+ [AUDIO]: "primary",
20
+ [PODCAST]: "primary",
21
+ [VIDEO]: "primary",
22
+ [MISSING]: "neutral",
23
+ [GLOSS]: "brand1Moderate",
24
+ [PROGRAMME]: "primary",
25
+ [PODCAST_SERIES]: "primary",
26
+ [FRONTPAGE_ARTICLE]: "primary"
37
27
  };
38
- export const ContentTypeHero = /*#__PURE__*/forwardRef((_ref, ref) => {
39
- let {
40
- contentType,
41
- children,
42
- ...props
43
- } = _ref;
44
- return /*#__PURE__*/_jsx(Hero, {
45
- variant: contentTypeToHeroMap[contentType ?? "missing"] ?? contentTypeToHeroMap["missing"],
46
- ...props,
47
- ref: ref,
48
- children: children
49
- });
50
- });
28
+ const ContentTypeHero = forwardRef(({ contentType, children,...props }, ref) => {
29
+ return /* @__PURE__ */ jsx(Hero, {
30
+ variant: contentTypeToHeroMap[contentType ?? "missing"] ?? contentTypeToHeroMap["missing"],
31
+ ...props,
32
+ ref,
33
+ children
34
+ });
35
+ });
36
+
37
+ //#endregion
38
+ export { ContentTypeHero };
39
+ //# sourceMappingURL=ContentTypeHero.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ContentTypeHero.js","names":["contentTypeToHeroMap: Record<ContentType, HeroVariant>"],"sources":["../../src/ContentTypeHero/ContentTypeHero.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 } from \"react\";\nimport { Hero, type HeroProps, type HeroVariant } from \"@ndla/primitives\";\nimport type { ContentType } from \"../ContentTypeBadge/ContentTypeBadge\";\nimport * as contentTypes from \"../model/ContentType\";\n\nexport const contentTypeToHeroMap: Record<ContentType, HeroVariant> = {\n [contentTypes.SUBJECT_MATERIAL]: \"primary\",\n [contentTypes.TASKS_AND_ACTIVITIES]: \"brand2Bold\",\n [contentTypes.ASSESSMENT_RESOURCES]: \"brand2\",\n // This will never happen\n [contentTypes.SUBJECT]: \"primary\",\n [contentTypes.SOURCE_MATERIAL]: \"brand1\",\n // This will never happen\n [contentTypes.LEARNING_PATH]: \"primary\",\n [contentTypes.TOPIC]: \"neutral\",\n [contentTypes.MULTIDISCIPLINARY]: \"primary\",\n [contentTypes.CONCEPT]: \"brand1Moderate\",\n [contentTypes.EXTERNAL]: \"primary\",\n [contentTypes.IMAGE]: \"primary\",\n [contentTypes.AUDIO]: \"primary\",\n [contentTypes.PODCAST]: \"primary\",\n [contentTypes.VIDEO]: \"primary\",\n [contentTypes.MISSING]: \"neutral\",\n [contentTypes.GLOSS]: \"brand1Moderate\",\n // this will never happen\n [contentTypes.PROGRAMME]: \"primary\",\n // this will never happen\n [contentTypes.PODCAST_SERIES]: \"primary\",\n [contentTypes.FRONTPAGE_ARTICLE]: \"primary\",\n};\n\nexport interface ContentTypeHeroProps extends HeroProps {\n contentType: ContentType | undefined;\n}\n\nexport const ContentTypeHero = forwardRef<HTMLDivElement, ContentTypeHeroProps>(\n ({ contentType, children, ...props }, ref) => {\n return (\n <Hero\n variant={contentTypeToHeroMap[contentType ?? \"missing\"] ?? contentTypeToHeroMap[\"missing\"]}\n {...props}\n ref={ref}\n >\n {children}\n </Hero>\n );\n },\n);\n"],"mappings":";;;;;;AAaA,MAAaA,uBAAyD;qBACnC;yBACI;yBACA;YAEb;oBACQ;kBAEF;UACR;sBACY;YACV;aACC;UACH;UACA;YACE;UACF;YACE;UACF;cAEI;mBAEK;sBACG;AACnC;AAMD,MAAa,kBAAkB,WAC7B,CAAC,EAAE,aAAa,SAAU,GAAG,OAAO,EAAE,QAAQ;AAC5C,wBACE,IAAC;EACC,SAAS,qBAAqB,eAAe,cAAc,qBAAqB;EAChF,GAAI;EACC;EAEJ;GACI;AAEV,EACF"}
@@ -1,83 +1,62 @@
1
- /**
2
- * Copyright (c) 2021-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
9
1
  import { useCallback, useEffect, useMemo, useState } from "react";
10
- import { useTranslation } from "react-i18next";
11
- import { LinkMedium } from "@ndla/icons";
12
2
  import { IconButton } from "@ndla/primitives";
13
3
  import { styled } from "@ndla/styled-system/jsx";
4
+ import { useTranslation } from "react-i18next";
5
+ import { LinkMedium } from "@ndla/icons";
6
+ import { jsx, jsxs } from "react/jsx-runtime";
14
7
  import { copyTextToClipboard } from "@ndla/util";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const ContainerDiv = styled("div", {
17
- base: {
18
- position: "relative",
19
- _hover: {
20
- "& [data-copy-button]": {
21
- opacity: "1",
22
- cursor: "pointer"
23
- }
24
- }
25
- }
26
- });
27
- const StyledIconButton = styled(IconButton, {
28
- base: {
29
- position: "absolute",
30
- left: "-xxlarge",
31
- top: "-4xsmall",
32
- opacity: "0",
33
- cursor: "pointer",
34
- "&:focus, &:focus-visible, &:active": {
35
- opacity: "1"
36
- }
37
- }
38
- });
39
- const CopyParagraphButton = _ref => {
40
- let {
41
- children,
42
- copyText,
43
- lang
44
- } = _ref;
45
- const [hasCopied, setHasCopied] = useState(false);
46
- const {
47
- t
48
- } = useTranslation();
49
- const sanitizedTitle = useMemo(() => encodeURIComponent(copyText.replace(/ /g, "-")), [copyText]);
50
- useEffect(() => {
51
- if (hasCopied) {
52
- setTimeout(() => setHasCopied(false), 3000);
53
- }
54
- }, [hasCopied]);
55
- const onCopyClick = useCallback(() => {
56
- setHasCopied(true);
57
- const {
58
- location
59
- } = window;
60
- const newHash = `#${sanitizedTitle}`;
61
- const port = location.port ? `:${location.port}` : "";
62
- const urlToCopy = `${location.protocol}//${location.hostname}${port}${location.pathname}${location.search}${newHash}`;
63
- copyTextToClipboard(urlToCopy);
64
- }, [sanitizedTitle]);
65
- const tooltip = hasCopied ? t("article.copyPageLinkCopied") : t("article.copyHeaderLink");
66
- return /*#__PURE__*/_jsxs(ContainerDiv, {
67
- "data-embed-type": "copy-heading",
68
- children: [/*#__PURE__*/_jsx(StyledIconButton, {
69
- variant: "clear",
70
- "data-copy-button": "",
71
- onClick: onCopyClick,
72
- title: tooltip,
73
- "aria-label": `${tooltip}: ${copyText}`,
74
- children: /*#__PURE__*/_jsx(LinkMedium, {})
75
- }), /*#__PURE__*/_jsx("h2", {
76
- id: sanitizedTitle,
77
- tabIndex: -1,
78
- lang: lang,
79
- children: children
80
- })]
81
- });
8
+
9
+ //#region src/CopyParagraphButton/CopyParagraphButton.tsx
10
+ const ContainerDiv = styled("div", { base: {
11
+ position: "relative",
12
+ _hover: { "& [data-copy-button]": {
13
+ opacity: "1",
14
+ cursor: "pointer"
15
+ } }
16
+ } });
17
+ const StyledIconButton = styled(IconButton, { base: {
18
+ position: "absolute",
19
+ left: "-xxlarge",
20
+ top: "-4xsmall",
21
+ opacity: "0",
22
+ cursor: "pointer",
23
+ "&:focus, &:focus-visible, &:active": { opacity: "1" }
24
+ } });
25
+ const CopyParagraphButton = ({ children, copyText, lang }) => {
26
+ const [hasCopied, setHasCopied] = useState(false);
27
+ const { t } = useTranslation();
28
+ const sanitizedTitle = useMemo(() => encodeURIComponent(copyText.replace(/ /g, "-")), [copyText]);
29
+ useEffect(() => {
30
+ if (hasCopied) setTimeout(() => setHasCopied(false), 3e3);
31
+ }, [hasCopied]);
32
+ const onCopyClick = useCallback(() => {
33
+ setHasCopied(true);
34
+ const { location } = window;
35
+ const newHash = `#${sanitizedTitle}`;
36
+ const port = location.port ? `:${location.port}` : "";
37
+ const urlToCopy = `${location.protocol}//${location.hostname}${port}${location.pathname}${location.search}${newHash}`;
38
+ copyTextToClipboard(urlToCopy);
39
+ }, [sanitizedTitle]);
40
+ const tooltip = hasCopied ? t("article.copyPageLinkCopied") : t("article.copyHeaderLink");
41
+ return /* @__PURE__ */ jsxs(ContainerDiv, {
42
+ "data-embed-type": "copy-heading",
43
+ children: [/* @__PURE__ */ jsx(StyledIconButton, {
44
+ variant: "clear",
45
+ "data-copy-button": "",
46
+ onClick: onCopyClick,
47
+ title: tooltip,
48
+ "aria-label": `${tooltip}: ${copyText}`,
49
+ children: /* @__PURE__ */ jsx(LinkMedium, {})
50
+ }), /* @__PURE__ */ jsx("h2", {
51
+ id: sanitizedTitle,
52
+ tabIndex: -1,
53
+ lang,
54
+ children
55
+ })]
56
+ });
82
57
  };
83
- export default CopyParagraphButton;
58
+ var CopyParagraphButton_default = CopyParagraphButton;
59
+
60
+ //#endregion
61
+ export { CopyParagraphButton_default };
62
+ //# sourceMappingURL=CopyParagraphButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CopyParagraphButton.js","names":[],"sources":["../../src/CopyParagraphButton/CopyParagraphButton.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport { type ReactNode, useCallback, useEffect, useMemo, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { LinkMedium } from \"@ndla/icons\";\nimport { IconButton } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport { copyTextToClipboard } from \"@ndla/util\";\n\nconst ContainerDiv = styled(\"div\", {\n base: {\n position: \"relative\",\n _hover: {\n \"& [data-copy-button]\": {\n opacity: \"1\",\n cursor: \"pointer\",\n },\n },\n },\n});\n\nconst StyledIconButton = styled(IconButton, {\n base: {\n position: \"absolute\",\n left: \"-xxlarge\",\n top: \"-4xsmall\",\n opacity: \"0\",\n cursor: \"pointer\",\n \"&:focus, &:focus-visible, &:active\": {\n opacity: \"1\",\n },\n },\n});\n\ninterface Props {\n // What to render within the h2\n children: ReactNode;\n copyText: string;\n lang?: string;\n}\nconst CopyParagraphButton = ({ children, copyText, lang }: Props) => {\n const [hasCopied, setHasCopied] = useState(false);\n const { t } = useTranslation();\n const sanitizedTitle = useMemo(() => encodeURIComponent(copyText.replace(/ /g, \"-\")), [copyText]);\n\n useEffect(() => {\n if (hasCopied) {\n setTimeout(() => setHasCopied(false), 3000);\n }\n }, [hasCopied]);\n\n const onCopyClick = useCallback(() => {\n setHasCopied(true);\n const { location } = window;\n const newHash = `#${sanitizedTitle}`;\n const port = location.port ? `:${location.port}` : \"\";\n const urlToCopy = `${location.protocol}//${location.hostname}${port}${location.pathname}${location.search}${newHash}`;\n\n copyTextToClipboard(urlToCopy);\n }, [sanitizedTitle]);\n\n const tooltip = hasCopied ? t(\"article.copyPageLinkCopied\") : t(\"article.copyHeaderLink\");\n return (\n <ContainerDiv data-embed-type=\"copy-heading\">\n <StyledIconButton\n variant=\"clear\"\n data-copy-button=\"\"\n onClick={onCopyClick}\n title={tooltip}\n aria-label={`${tooltip}: ${copyText}`}\n >\n <LinkMedium />\n </StyledIconButton>\n <h2 id={sanitizedTitle} tabIndex={-1} lang={lang}>\n {children}\n </h2>\n </ContainerDiv>\n );\n};\n\nexport default CopyParagraphButton;\n"],"mappings":";;;;;;;;;AAeA,MAAM,eAAe,OAAO,OAAO,EACjC,MAAM;CACJ,UAAU;CACV,QAAQ,EACN,wBAAwB;EACtB,SAAS;EACT,QAAQ;CACT,EACF;AACF,EACF,EAAC;AAEF,MAAM,mBAAmB,OAAO,YAAY,EAC1C,MAAM;CACJ,UAAU;CACV,MAAM;CACN,KAAK;CACL,SAAS;CACT,QAAQ;CACR,sCAAsC,EACpC,SAAS,IACV;AACF,EACF,EAAC;AAQF,MAAM,sBAAsB,CAAC,EAAE,UAAU,UAAU,MAAa,KAAK;CACnE,MAAM,CAAC,WAAW,aAAa,GAAG,SAAS,MAAM;CACjD,MAAM,EAAE,GAAG,GAAG,gBAAgB;CAC9B,MAAM,iBAAiB,QAAQ,MAAM,mBAAmB,SAAS,QAAQ,MAAM,IAAI,CAAC,EAAE,CAAC,QAAS,EAAC;AAEjG,WAAU,MAAM;AACd,MAAI,UACF,YAAW,MAAM,aAAa,MAAM,EAAE,IAAK;CAE9C,GAAE,CAAC,SAAU,EAAC;CAEf,MAAM,cAAc,YAAY,MAAM;AACpC,eAAa,KAAK;EAClB,MAAM,EAAE,UAAU,GAAG;EACrB,MAAM,WAAW,GAAG,eAAe;EACnC,MAAM,OAAO,SAAS,QAAQ,GAAG,SAAS,KAAK,IAAI;EACnD,MAAM,aAAa,EAAE,SAAS,SAAS,IAAI,SAAS,SAAS,EAAE,KAAK,EAAE,SAAS,SAAS,EAAE,SAAS,OAAO,EAAE,QAAQ;AAEpH,sBAAoB,UAAU;CAC/B,GAAE,CAAC,cAAe,EAAC;CAEpB,MAAM,UAAU,YAAY,EAAE,6BAA6B,GAAG,EAAE,yBAAyB;AACzF,wBACE,KAAC;EAAa,mBAAgB;6BAC5B,IAAC;GACC,SAAQ;GACR,oBAAiB;GACjB,SAAS;GACT,OAAO;GACP,eAAa,EAAE,QAAQ,IAAI,SAAS;6BAEpC,IAAC,eAAa;IACG,kBACnB,IAAC;GAAG,IAAI;GAAgB,UAAU;GAAU;GACzC;IACE;GACQ;AAElB;AAED,kCAAe"}
@@ -1,11 +1,8 @@
1
- /**
2
- * Copyright (c) 2021-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
1
+ import { CopyParagraphButton_default } from "./CopyParagraphButton.js";
8
2
 
9
- import CopyParagraphButton from "./CopyParagraphButton";
10
- export { CopyParagraphButton };
11
- export default CopyParagraphButton;
3
+ //#region src/CopyParagraphButton/index.tsx
4
+ var CopyParagraphButton_default$1 = CopyParagraphButton_default;
5
+
6
+ //#endregion
7
+ export { CopyParagraphButton_default$1 as CopyParagraphButton_default };
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["CopyParagraphButton"],"sources":["../../src/CopyParagraphButton/index.tsx"],"sourcesContent":["/**\n * Copyright (c) 2021-present, NDLA.\n *\n * This source code is licensed under the GPLv3 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\nimport CopyParagraphButton from \"./CopyParagraphButton\";\n\nexport { CopyParagraphButton };\nexport default CopyParagraphButton;\n"],"mappings":";;;AAWA,oCAAeA"}
@@ -1,76 +1,52 @@
1
- /**
2
- * Copyright (c) 2023-present, NDLA.
3
- *
4
- * This source code is licensed under the GPLv3 license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
-
1
+ import { EmbedByline } from "../LicenseByline/EmbedByline.js";
2
+ import { EmbedErrorPlaceholder_default } from "./EmbedErrorPlaceholder.js";
3
+ import { licenseAttributes } from "../utils/licenseAttributes.js";
4
+ import { AudioPlayer_default } from "../AudioPlayer/index.js";
9
5
  import { Figure } from "@ndla/primitives";
10
6
  import { styled } from "@ndla/styled-system/jsx";
11
- import EmbedErrorPlaceholder from "./EmbedErrorPlaceholder";
12
- import AudioPlayer from "../AudioPlayer";
13
- import { EmbedByline } from "../LicenseByline";
14
- import { licenseAttributes } from "../utils/licenseAttributes";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const StyledFigure = styled(Figure, {
17
- base: {
18
- clear: "both"
19
- }
20
- });
21
- export const getFirstNonEmptyLicenseCredits = authors => Object.values(authors).find(i => i.length > 0) ?? [];
22
- const AudioEmbed = _ref => {
23
- let {
24
- embed,
25
- lang
26
- } = _ref;
27
- const type = embed.embedData.type === "standard" ? "audio" : "podcast";
28
- if (embed.status === "error") {
29
- return /*#__PURE__*/_jsx(EmbedErrorPlaceholder, {
30
- type: type
31
- });
32
- }
33
- const {
34
- data,
35
- embedData
36
- } = embed;
37
- if (embedData.type === "minimal") {
38
- return /*#__PURE__*/_jsx(AudioPlayer, {
39
- speech: true,
40
- src: data.audioFile.url,
41
- title: data.title.title
42
- });
43
- }
44
- const subtitle = data.series ? {
45
- title: data.series.title.title,
46
- url: `/podkast/${data.series.id}`
47
- } : undefined;
48
- const coverPhoto = data.podcastMeta?.coverPhoto;
49
- const img = coverPhoto && {
50
- url: coverPhoto.url,
51
- alt: coverPhoto.altText
52
- };
53
- const licenseProps = licenseAttributes(data.copyright.license.license, lang, embedData.url);
54
- return /*#__PURE__*/_jsxs(StyledFigure, {
55
- lang: lang,
56
- "data-embed-type": type,
57
- ...licenseProps,
58
- children: [/*#__PURE__*/_jsx(AudioPlayer, {
59
- description: data.podcastMeta?.introduction ?? "",
60
- img: img,
61
- src: data.audioFile.url,
62
- textVersion: data.manuscript?.manuscript.length ? /*#__PURE__*/_jsx("div", {
63
- dangerouslySetInnerHTML: {
64
- __html: data.manuscript.manuscript
65
- }
66
- }) : undefined,
67
- title: data.title.title,
68
- subtitle: subtitle
69
- }), /*#__PURE__*/_jsx(EmbedByline, {
70
- error: false,
71
- type: data.audioType === "standard" ? "audio" : "podcast",
72
- copyright: embed.data.copyright
73
- })]
74
- });
7
+ import { jsx, jsxs } from "react/jsx-runtime";
8
+
9
+ //#region src/Embed/AudioEmbed.tsx
10
+ const StyledFigure = styled(Figure, { base: { clear: "both" } });
11
+ const AudioEmbed = ({ embed, lang }) => {
12
+ const type = embed.embedData.type === "standard" ? "audio" : "podcast";
13
+ if (embed.status === "error") return /* @__PURE__ */ jsx(EmbedErrorPlaceholder_default, { type });
14
+ const { data, embedData } = embed;
15
+ if (embedData.type === "minimal") return /* @__PURE__ */ jsx(AudioPlayer_default, {
16
+ speech: true,
17
+ src: data.audioFile.url,
18
+ title: data.title.title
19
+ });
20
+ const subtitle = data.series ? {
21
+ title: data.series.title.title,
22
+ url: `/podkast/${data.series.id}`
23
+ } : void 0;
24
+ const coverPhoto = data.podcastMeta?.coverPhoto;
25
+ const img = coverPhoto && {
26
+ url: coverPhoto.url,
27
+ alt: coverPhoto.altText
28
+ };
29
+ const licenseProps = licenseAttributes(data.copyright.license.license, lang, embedData.url);
30
+ return /* @__PURE__ */ jsxs(StyledFigure, {
31
+ lang,
32
+ "data-embed-type": type,
33
+ ...licenseProps,
34
+ children: [/* @__PURE__ */ jsx(AudioPlayer_default, {
35
+ description: data.podcastMeta?.introduction ?? "",
36
+ img,
37
+ src: data.audioFile.url,
38
+ textVersion: data.manuscript?.manuscript.length ? /* @__PURE__ */ jsx("div", { dangerouslySetInnerHTML: { __html: data.manuscript.manuscript } }) : void 0,
39
+ title: data.title.title,
40
+ subtitle
41
+ }), /* @__PURE__ */ jsx(EmbedByline, {
42
+ error: false,
43
+ type: data.audioType === "standard" ? "audio" : "podcast",
44
+ copyright: embed.data.copyright
45
+ })]
46
+ });
75
47
  };
76
- export default AudioEmbed;
48
+ var AudioEmbed_default = AudioEmbed;
49
+
50
+ //#endregion
51
+ export { AudioEmbed_default };
52
+ //# sourceMappingURL=AudioEmbed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioEmbed.js","names":["EmbedErrorPlaceholder","AudioPlayer"],"sources":["../../src/Embed/AudioEmbed.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 { Figure } from \"@ndla/primitives\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { AudioMetaData } from \"@ndla/types-embed\";\nimport EmbedErrorPlaceholder from \"./EmbedErrorPlaceholder\";\nimport type { Author } from \"./ImageEmbed\";\nimport AudioPlayer from \"../AudioPlayer\";\nimport { EmbedByline } from \"../LicenseByline\";\nimport { licenseAttributes } from \"../utils/licenseAttributes\";\n\nconst StyledFigure = styled(Figure, {\n base: {\n clear: \"both\",\n },\n});\n\ninterface Props {\n embed: AudioMetaData;\n lang?: string;\n}\n\nexport const getFirstNonEmptyLicenseCredits = (authors: {\n creators: Author[];\n rightsholders: Author[];\n processors: Author[];\n}) => Object.values(authors).find((i) => i.length > 0) ?? [];\n\nconst AudioEmbed = ({ embed, lang }: Props) => {\n const type = embed.embedData.type === \"standard\" ? \"audio\" : \"podcast\";\n if (embed.status === \"error\") {\n return <EmbedErrorPlaceholder type={type} />;\n }\n\n const { data, embedData } = embed;\n\n if (embedData.type === \"minimal\") {\n return <AudioPlayer speech src={data.audioFile.url} title={data.title.title} />;\n }\n\n const subtitle = data.series ? { title: data.series.title.title, url: `/podkast/${data.series.id}` } : undefined;\n\n const coverPhoto = data.podcastMeta?.coverPhoto;\n\n const img = coverPhoto && { url: coverPhoto.url, alt: coverPhoto.altText };\n\n const licenseProps = licenseAttributes(data.copyright.license.license, lang, embedData.url);\n\n return (\n <StyledFigure lang={lang} data-embed-type={type} {...licenseProps}>\n <AudioPlayer\n description={data.podcastMeta?.introduction ?? \"\"}\n img={img}\n src={data.audioFile.url}\n textVersion={\n data.manuscript?.manuscript.length ? (\n <div dangerouslySetInnerHTML={{ __html: data.manuscript.manuscript }} />\n ) : undefined\n }\n title={data.title.title}\n subtitle={subtitle}\n />\n <EmbedByline\n error={false}\n type={data.audioType === \"standard\" ? \"audio\" : \"podcast\"}\n copyright={embed.data.copyright}\n />\n </StyledFigure>\n );\n};\n\nexport default AudioEmbed;\n"],"mappings":";;;;;;;;;AAiBA,MAAM,eAAe,OAAO,QAAQ,EAClC,MAAM,EACJ,OAAO,OACR,EACF,EAAC;AAaF,MAAM,aAAa,CAAC,EAAE,OAAO,MAAa,KAAK;CAC7C,MAAM,OAAO,MAAM,UAAU,SAAS,aAAa,UAAU;AAC7D,KAAI,MAAM,WAAW,QACnB,wBAAO,IAACA,iCAA4B,OAAQ;CAG9C,MAAM,EAAE,MAAM,WAAW,GAAG;AAE5B,KAAI,UAAU,SAAS,UACrB,wBAAO,IAACC;EAAY;EAAO,KAAK,KAAK,UAAU;EAAK,OAAO,KAAK,MAAM;GAAS;CAGjF,MAAM,WAAW,KAAK,SAAS;EAAE,OAAO,KAAK,OAAO,MAAM;EAAO,MAAM,WAAW,KAAK,OAAO,GAAG;CAAG;CAEpG,MAAM,aAAa,KAAK,aAAa;CAErC,MAAM,MAAM,cAAc;EAAE,KAAK,WAAW;EAAK,KAAK,WAAW;CAAS;CAE1E,MAAM,eAAe,kBAAkB,KAAK,UAAU,QAAQ,SAAS,MAAM,UAAU,IAAI;AAE3F,wBACE,KAAC;EAAmB;EAAM,mBAAiB;EAAM,GAAI;6BACnD,IAACA;GACC,aAAa,KAAK,aAAa,gBAAgB;GAC1C;GACL,KAAK,KAAK,UAAU;GACpB,aACE,KAAK,YAAY,WAAW,yBAC1B,IAAC,SAAI,yBAAyB,EAAE,QAAQ,KAAK,WAAW,WAAY,IAAI;GAG5E,OAAO,KAAK,MAAM;GACR;IACV,kBACF,IAAC;GACC,OAAO;GACP,MAAM,KAAK,cAAc,aAAa,UAAU;GAChD,WAAW,MAAM,KAAK;IACtB;GACW;AAElB;AAED,yBAAe"}