@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
@@ -1,180 +1,131 @@
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 { getPossiblyRelativeUrl } from "../utils/relativeUrl.js";
2
+ import "react";
3
+ import { Text } from "@ndla/primitives";
4
+ import { styled } from "@ndla/styled-system/jsx";
9
5
  import parse from "html-react-parser";
10
6
  import { ArrowRightLine } from "@ndla/icons";
11
- import { Text } from "@ndla/primitives";
12
7
  import { SafeLinkButton } from "@ndla/safelink";
13
- import { styled } from "@ndla/styled-system/jsx";
14
- import { getPossiblyRelativeUrl } from "../utils/relativeUrl";
15
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
- const Wrapper = styled("div", {
17
- base: {
18
- width: "100%",
19
- height: "100%",
20
- containerType: "inline-size"
21
- }
22
- });
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+
10
+ //#region src/CampaignBlock/CampaignBlock.tsx
11
+ const Wrapper = styled("div", { base: {
12
+ width: "100%",
13
+ height: "100%",
14
+ containerType: "inline-size"
15
+ } });
23
16
  const Container = styled("div", {
24
- base: {
25
- display: "grid",
26
- gridTemplateColumns: "1fr",
27
- border: "1px solid",
28
- borderColor: "stroke.default",
29
- backgroundColor: "background.default",
30
- borderRadius: "xsmall",
31
- boxShadow: "full",
32
- overflow: "hidden"
33
- },
34
- variants: {
35
- imageSide: {
36
- left: {
37
- "@/tablet": {
38
- gridTemplateColumns: "minmax(230px, 455px) auto" //required for campaign block in myNdla
39
- },
40
- "@supports not (container-type: inline-size)": {
41
- tabletWide: {
42
- gridTemplateColumns: "minmax(230px, 455px) auto"
43
- }
44
- }
45
- },
46
- right: {
47
- "@/tablet": {
48
- gridTemplateColumns: "auto minmax(230px, 455px)" //required for campaign block in myNdla
49
- },
50
- "@supports not (container-type: inline-size)": {
51
- tabletWide: {
52
- gridTemplateColumns: "auto minmax(230px, 455px)"
53
- }
54
- }
55
- }
56
- },
57
- background: {
58
- neutral: {},
59
- brand1: {
60
- backgroundColor: "surface.brand.1"
61
- },
62
- brand3: {
63
- backgroundColor: "surface.brand.3"
64
- }
65
- }
66
- },
67
- defaultVariants: {
68
- imageSide: "left",
69
- background: "neutral"
70
- }
71
- });
72
- const StyledImg = styled("img", {
73
- base: {
74
- objectFit: "cover",
75
- width: "100%",
76
- height: "215px",
77
- "@/tablet": {
78
- height: "340px"
79
- },
80
- "@supports not (container-type: inline-size)": {
81
- tablet: {
82
- height: "265px"
83
- },
84
- tabletWide: {
85
- height: "340px"
86
- }
87
- },
88
- backgroundColor: "background.default"
89
- }
90
- });
91
- const ContentWrapper = styled("div", {
92
- base: {
93
- width: "100%",
94
- display: "flex",
95
- flexDirection: "column",
96
- gap: "medium",
97
- alignItems: "flex-start",
98
- justifyContent: "center",
99
- paddingBlock: "medium",
100
- paddingInline: "medium",
101
- position: "relative"
102
- }
17
+ base: {
18
+ display: "grid",
19
+ gridTemplateColumns: "1fr",
20
+ border: "1px solid",
21
+ borderColor: "stroke.default",
22
+ backgroundColor: "background.default",
23
+ borderRadius: "xsmall",
24
+ boxShadow: "full",
25
+ overflow: "hidden"
26
+ },
27
+ variants: {
28
+ imageSide: {
29
+ left: {
30
+ "@/tablet": { gridTemplateColumns: "minmax(230px, 455px) auto" },
31
+ "@supports not (container-type: inline-size)": { tabletWide: { gridTemplateColumns: "minmax(230px, 455px) auto" } }
32
+ },
33
+ right: {
34
+ "@/tablet": { gridTemplateColumns: "auto minmax(230px, 455px)" },
35
+ "@supports not (container-type: inline-size)": { tabletWide: { gridTemplateColumns: "auto minmax(230px, 455px)" } }
36
+ }
37
+ },
38
+ background: {
39
+ neutral: {},
40
+ brand1: { backgroundColor: "surface.brand.1" },
41
+ brand3: { backgroundColor: "surface.brand.3" }
42
+ }
43
+ },
44
+ defaultVariants: {
45
+ imageSide: "left",
46
+ background: "neutral"
47
+ }
103
48
  });
104
- const StyledText = styled(Text, {
105
- base: {
106
- tablet: {
107
- display: "block",
108
- overflow: "hidden",
109
- position: "relative",
110
- lineClamp: 4,
111
- boxOrient: "vertical"
112
- }
113
- }
114
- });
115
- const StyledSafeLinkButton = styled(SafeLinkButton, {
116
- base: {
117
- boxShadow: "full",
118
- border: "1px solid",
119
- borderColor: "stroke.default"
120
- }
121
- });
122
- const LinkButton = _ref => {
123
- let {
124
- url,
125
- children,
126
- path
127
- } = _ref;
128
- if (url) return /*#__PURE__*/_jsx(StyledSafeLinkButton, {
129
- to: getPossiblyRelativeUrl(url, path),
130
- variant: "secondary",
131
- rel: "noopener noreferrer",
132
- children: children
133
- });
134
- return children;
49
+ const StyledImg = styled("img", { base: {
50
+ objectFit: "cover",
51
+ width: "100%",
52
+ height: "215px",
53
+ "@/tablet": { height: "340px" },
54
+ "@supports not (container-type: inline-size)": {
55
+ tablet: { height: "265px" },
56
+ tabletWide: { height: "340px" }
57
+ },
58
+ backgroundColor: "background.default"
59
+ } });
60
+ const ContentWrapper = styled("div", { base: {
61
+ width: "100%",
62
+ display: "flex",
63
+ flexDirection: "column",
64
+ gap: "medium",
65
+ alignItems: "flex-start",
66
+ justifyContent: "center",
67
+ paddingBlock: "medium",
68
+ paddingInline: "medium",
69
+ position: "relative"
70
+ } });
71
+ const StyledText = styled(Text, { base: { tablet: {
72
+ display: "block",
73
+ overflow: "hidden",
74
+ position: "relative",
75
+ lineClamp: 4,
76
+ boxOrient: "vertical"
77
+ } } });
78
+ const StyledSafeLinkButton = styled(SafeLinkButton, { base: {
79
+ boxShadow: "full",
80
+ border: "1px solid",
81
+ borderColor: "stroke.default"
82
+ } });
83
+ const LinkButton = ({ url, children, path }) => {
84
+ if (url) return /* @__PURE__ */ jsx(StyledSafeLinkButton, {
85
+ to: getPossiblyRelativeUrl(url, path),
86
+ variant: "secondary",
87
+ rel: "noopener noreferrer",
88
+ children
89
+ });
90
+ return children;
135
91
  };
136
- const CampaignBlock = _ref2 => {
137
- let {
138
- title,
139
- image,
140
- imageSide = "left",
141
- description,
142
- headingLevel: InternalHeading = "h2",
143
- url,
144
- path,
145
- className,
146
- background
147
- } = _ref2;
148
- const imageComponent = image && /*#__PURE__*/_jsx(StyledImg, {
149
- src: `${image.src}?width=455`,
150
- height: 340,
151
- width: 455,
152
- alt: image.alt
153
- });
154
- return /*#__PURE__*/_jsx(Wrapper, {
155
- children: /*#__PURE__*/_jsxs(Container, {
156
- className: className,
157
- "data-embed-type": "campaign-block",
158
- imageSide: imageSide,
159
- background: background,
160
- children: [imageSide === "left" && imageComponent, /*#__PURE__*/_jsxs(ContentWrapper, {
161
- children: [/*#__PURE__*/_jsx(Text, {
162
- asChild: true,
163
- consumeCss: true,
164
- textStyle: "heading.small",
165
- children: /*#__PURE__*/_jsx(InternalHeading, {
166
- children: parse(title)
167
- })
168
- }), /*#__PURE__*/_jsx(StyledText, {
169
- textStyle: "body.xlarge",
170
- children: parse(description)
171
- }), !!url?.url && /*#__PURE__*/_jsxs(LinkButton, {
172
- url: url.url,
173
- path: path,
174
- children: [parse(url.text ?? ""), /*#__PURE__*/_jsx(ArrowRightLine, {})]
175
- })]
176
- }), imageSide !== "left" && imageComponent]
177
- })
178
- });
92
+ const CampaignBlock = ({ title, image, imageSide = "left", description, headingLevel: InternalHeading = "h2", url, path, className, background }) => {
93
+ const imageComponent = image && /* @__PURE__ */ jsx(StyledImg, {
94
+ src: `${image.src}?width=455`,
95
+ height: 340,
96
+ width: 455,
97
+ alt: image.alt
98
+ });
99
+ return /* @__PURE__ */ jsx(Wrapper, { children: /* @__PURE__ */ jsxs(Container, {
100
+ className,
101
+ "data-embed-type": "campaign-block",
102
+ imageSide,
103
+ background,
104
+ children: [
105
+ imageSide === "left" && imageComponent,
106
+ /* @__PURE__ */ jsxs(ContentWrapper, { children: [
107
+ /* @__PURE__ */ jsx(Text, {
108
+ asChild: true,
109
+ consumeCss: true,
110
+ textStyle: "heading.small",
111
+ children: /* @__PURE__ */ jsx(InternalHeading, { children: parse(title) })
112
+ }),
113
+ /* @__PURE__ */ jsx(StyledText, {
114
+ textStyle: "body.xlarge",
115
+ children: parse(description)
116
+ }),
117
+ !!url?.url && /* @__PURE__ */ jsxs(LinkButton, {
118
+ url: url.url,
119
+ path,
120
+ children: [parse(url.text ?? ""), /* @__PURE__ */ jsx(ArrowRightLine, {})]
121
+ })
122
+ ] }),
123
+ imageSide !== "left" && imageComponent
124
+ ]
125
+ }) });
179
126
  };
180
- export default CampaignBlock;
127
+ var CampaignBlock_default = CampaignBlock;
128
+
129
+ //#endregion
130
+ export { CampaignBlock_default };
131
+ //# sourceMappingURL=CampaignBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CampaignBlock.js","names":[],"sources":["../../src/CampaignBlock/CampaignBlock.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 parse from \"html-react-parser\";\nimport { type ReactNode } from \"react\";\nimport { ArrowRightLine } from \"@ndla/icons\";\nimport { Text } from \"@ndla/primitives\";\nimport { SafeLinkButton } from \"@ndla/safelink\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { CampaignBlockEmbedData } from \"@ndla/types-embed\";\nimport type { HeadingLevel } from \"../types\";\nimport { getPossiblyRelativeUrl } from \"../utils/relativeUrl\";\n\ninterface Image {\n src: string;\n alt: string;\n}\n\ninterface Props {\n title: string;\n description: string;\n headingLevel?: HeadingLevel;\n url: {\n url?: string;\n text?: string;\n };\n image?: Image;\n imageSide?: CampaignBlockEmbedData[\"imageSide\"];\n className?: string;\n path?: string;\n background?: CampaignBlockEmbedData[\"background\"];\n}\n\nconst Wrapper = styled(\"div\", {\n base: {\n width: \"100%\",\n height: \"100%\",\n containerType: \"inline-size\",\n },\n});\n\nconst Container = styled(\"div\", {\n base: {\n display: \"grid\",\n gridTemplateColumns: \"1fr\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n backgroundColor: \"background.default\",\n borderRadius: \"xsmall\",\n boxShadow: \"full\",\n overflow: \"hidden\",\n },\n variants: {\n imageSide: {\n left: {\n \"@/tablet\": {\n gridTemplateColumns: \"minmax(230px, 455px) auto\", //required for campaign block in myNdla\n },\n \"@supports not (container-type: inline-size)\": {\n tabletWide: {\n gridTemplateColumns: \"minmax(230px, 455px) auto\",\n },\n },\n },\n right: {\n \"@/tablet\": {\n gridTemplateColumns: \"auto minmax(230px, 455px)\", //required for campaign block in myNdla\n },\n \"@supports not (container-type: inline-size)\": {\n tabletWide: {\n gridTemplateColumns: \"auto minmax(230px, 455px)\",\n },\n },\n },\n },\n background: {\n neutral: {},\n brand1: {\n backgroundColor: \"surface.brand.1\",\n },\n brand3: {\n backgroundColor: \"surface.brand.3\",\n },\n },\n },\n defaultVariants: {\n imageSide: \"left\",\n background: \"neutral\",\n },\n});\n\nconst StyledImg = styled(\"img\", {\n base: {\n objectFit: \"cover\",\n width: \"100%\",\n height: \"215px\",\n \"@/tablet\": {\n height: \"340px\",\n },\n \"@supports not (container-type: inline-size)\": {\n tablet: {\n height: \"265px\",\n },\n tabletWide: {\n height: \"340px\",\n },\n },\n backgroundColor: \"background.default\",\n },\n});\n\nconst ContentWrapper = styled(\"div\", {\n base: {\n width: \"100%\",\n display: \"flex\",\n flexDirection: \"column\",\n gap: \"medium\",\n alignItems: \"flex-start\",\n justifyContent: \"center\",\n paddingBlock: \"medium\",\n paddingInline: \"medium\",\n position: \"relative\",\n },\n});\n\nconst StyledText = styled(Text, {\n base: {\n tablet: {\n display: \"block\",\n overflow: \"hidden\",\n position: \"relative\",\n lineClamp: 4,\n boxOrient: \"vertical\",\n },\n },\n});\n\ninterface LinkButtonProps {\n url?: string;\n path?: string;\n children: ReactNode;\n}\n\nconst StyledSafeLinkButton = styled(SafeLinkButton, {\n base: {\n boxShadow: \"full\",\n border: \"1px solid\",\n borderColor: \"stroke.default\",\n },\n});\n\nconst LinkButton = ({ url, children, path }: LinkButtonProps) => {\n if (url)\n return (\n <StyledSafeLinkButton to={getPossiblyRelativeUrl(url, path)} variant=\"secondary\" rel=\"noopener noreferrer\">\n {children}\n </StyledSafeLinkButton>\n );\n return children;\n};\n\nconst CampaignBlock = ({\n title,\n image,\n imageSide = \"left\",\n description,\n headingLevel: InternalHeading = \"h2\",\n url,\n path,\n className,\n background,\n}: Props) => {\n const imageComponent = image && <StyledImg src={`${image.src}?width=455`} height={340} width={455} alt={image.alt} />;\n\n return (\n <Wrapper>\n <Container className={className} data-embed-type=\"campaign-block\" imageSide={imageSide} background={background}>\n {imageSide === \"left\" && imageComponent}\n <ContentWrapper>\n <Text asChild consumeCss textStyle=\"heading.small\">\n <InternalHeading>{parse(title)}</InternalHeading>\n </Text>\n <StyledText textStyle=\"body.xlarge\">{parse(description)}</StyledText>\n {!!url?.url && (\n <LinkButton url={url.url} path={path}>\n {parse(url.text ?? \"\")}\n <ArrowRightLine />\n </LinkButton>\n )}\n </ContentWrapper>\n {imageSide !== \"left\" && imageComponent}\n </Container>\n </Wrapper>\n );\n};\n\nexport default CampaignBlock;\n"],"mappings":";;;;;;;;;;AAsCA,MAAM,UAAU,OAAO,OAAO,EAC5B,MAAM;CACJ,OAAO;CACP,QAAQ;CACR,eAAe;AAChB,EACF,EAAC;AAEF,MAAM,YAAY,OAAO,OAAO;CAC9B,MAAM;EACJ,SAAS;EACT,qBAAqB;EACrB,QAAQ;EACR,aAAa;EACb,iBAAiB;EACjB,cAAc;EACd,WAAW;EACX,UAAU;CACX;CACD,UAAU;EACR,WAAW;GACT,MAAM;IACJ,YAAY,EACV,qBAAqB,4BACtB;IACD,+CAA+C,EAC7C,YAAY,EACV,qBAAqB,4BACtB,EACF;GACF;GACD,OAAO;IACL,YAAY,EACV,qBAAqB,4BACtB;IACD,+CAA+C,EAC7C,YAAY,EACV,qBAAqB,4BACtB,EACF;GACF;EACF;EACD,YAAY;GACV,SAAS,CAAE;GACX,QAAQ,EACN,iBAAiB,kBAClB;GACD,QAAQ,EACN,iBAAiB,kBAClB;EACF;CACF;CACD,iBAAiB;EACf,WAAW;EACX,YAAY;CACb;AACF,EAAC;AAEF,MAAM,YAAY,OAAO,OAAO,EAC9B,MAAM;CACJ,WAAW;CACX,OAAO;CACP,QAAQ;CACR,YAAY,EACV,QAAQ,QACT;CACD,+CAA+C;EAC7C,QAAQ,EACN,QAAQ,QACT;EACD,YAAY,EACV,QAAQ,QACT;CACF;CACD,iBAAiB;AAClB,EACF,EAAC;AAEF,MAAM,iBAAiB,OAAO,OAAO,EACnC,MAAM;CACJ,OAAO;CACP,SAAS;CACT,eAAe;CACf,KAAK;CACL,YAAY;CACZ,gBAAgB;CAChB,cAAc;CACd,eAAe;CACf,UAAU;AACX,EACF,EAAC;AAEF,MAAM,aAAa,OAAO,MAAM,EAC9B,MAAM,EACJ,QAAQ;CACN,SAAS;CACT,UAAU;CACV,UAAU;CACV,WAAW;CACX,WAAW;AACZ,EACF,EACF,EAAC;AAQF,MAAM,uBAAuB,OAAO,gBAAgB,EAClD,MAAM;CACJ,WAAW;CACX,QAAQ;CACR,aAAa;AACd,EACF,EAAC;AAEF,MAAM,aAAa,CAAC,EAAE,KAAK,UAAU,MAAuB,KAAK;AAC/D,KAAI,IACF,wBACE,IAAC;EAAqB,IAAI,uBAAuB,KAAK,KAAK;EAAE,SAAQ;EAAY,KAAI;EAClF;GACoB;AAE3B,QAAO;AACR;AAED,MAAM,gBAAgB,CAAC,EACrB,OACA,OACA,YAAY,QACZ,aACA,cAAc,kBAAkB,MAChC,KACA,MACA,WACA,YACM,KAAK;CACX,MAAM,iBAAiB,yBAAS,IAAC;EAAU,MAAM,EAAE,MAAM,IAAI;EAAa,QAAQ;EAAK,OAAO;EAAK,KAAK,MAAM;GAAO;AAErH,wBACE,IAAC,qCACC,KAAC;EAAqB;EAAW,mBAAgB;EAA4B;EAAuB;;GACjG,cAAc,UAAU;mBACzB,KAAC;oBACC,IAAC;KAAK;KAAQ;KAAW,WAAU;+BACjC,IAAC,6BAAiB,MAAM,MAAM,GAAmB;MAC5C;oBACP,IAAC;KAAW,WAAU;eAAe,MAAM,YAAY;MAAc;MAClE,KAAK,uBACN,KAAC;KAAW,KAAK,IAAI;KAAW;gBAC7B,MAAM,IAAI,QAAQ,GAAG,kBACtB,IAAC,mBAAiB;MACP;OAEA;GAChB,cAAc,UAAU;;GACf,GACJ;AAEb;AAED,4BAAe"}
@@ -1,35 +1,25 @@
1
- /**
2
- * Copyright (c) 2020-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, useMemo } from "react";
10
- import { cx } from "@ndla/styled-system/css";
11
2
  import { styled } from "@ndla/styled-system/jsx";
12
- import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsx } from "react/jsx-runtime";
4
+ import { cx } from "@ndla/styled-system/css";
5
+
6
+ //#region src/CodeBlock/CodeBlock.tsx
13
7
  const Pre = styled("pre", {});
14
- export const Codeblock = /*#__PURE__*/forwardRef((_ref, ref) => {
15
- let {
16
- highlightedCode,
17
- format,
18
- className,
19
- ...props
20
- } = _ref;
21
- const codeWithLineNumbers = useMemo(() => {
22
- return highlightedCode.split("\n").map((line, i) => {
23
- return `<span class="linenumber">${i + 1}</span>${line}`;
24
- }).join("\n");
25
- }, [highlightedCode]);
26
- return /*#__PURE__*/_jsx(Pre, {
27
- className: cx("codeblock", `language-${format}`, className),
28
- ...props,
29
- dangerouslySetInnerHTML: {
30
- __html: codeWithLineNumbers
31
- },
32
- ref: ref
33
- });
8
+ const Codeblock = forwardRef(({ highlightedCode, format, className,...props }, ref) => {
9
+ const codeWithLineNumbers = useMemo(() => {
10
+ return highlightedCode.split("\n").map((line, i) => {
11
+ return `<span class="linenumber">${i + 1}</span>${line}`;
12
+ }).join("\n");
13
+ }, [highlightedCode]);
14
+ return /* @__PURE__ */ jsx(Pre, {
15
+ className: cx("codeblock", `language-${format}`, className),
16
+ ...props,
17
+ dangerouslySetInnerHTML: { __html: codeWithLineNumbers },
18
+ ref
19
+ });
34
20
  });
35
- export default Codeblock;
21
+ var CodeBlock_default = Codeblock;
22
+
23
+ //#endregion
24
+ export { CodeBlock_default };
25
+ //# sourceMappingURL=CodeBlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CodeBlock.js","names":[],"sources":["../../src/CodeBlock/CodeBlock.tsx"],"sourcesContent":["/**\n * Copyright (c) 2020-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 ComponentPropsWithRef, forwardRef, useMemo } from \"react\";\nimport { cx } from \"@ndla/styled-system/css\";\nimport { styled } from \"@ndla/styled-system/jsx\";\nimport type { JsxStyleProps } from \"@ndla/styled-system/types\";\n\ninterface Props extends JsxStyleProps, ComponentPropsWithRef<\"pre\"> {\n highlightedCode: string;\n format: string;\n}\n\nconst Pre = styled(\"pre\", {});\n\nexport const Codeblock = forwardRef<HTMLPreElement, Props>(({ highlightedCode, format, className, ...props }, ref) => {\n const codeWithLineNumbers = useMemo(() => {\n return highlightedCode\n .split(\"\\n\")\n .map((line, i) => {\n return `<span class=\"linenumber\">${i + 1}</span>${line}`;\n })\n .join(\"\\n\");\n }, [highlightedCode]);\n\n return (\n <Pre\n className={cx(\"codeblock\", `language-${format}`, className)}\n {...props}\n dangerouslySetInnerHTML={{ __html: codeWithLineNumbers }}\n ref={ref}\n />\n );\n});\n\nexport default Codeblock;\n"],"mappings":";;;;;;AAkBA,MAAM,MAAM,OAAO,OAAO,CAAE,EAAC;AAE7B,MAAa,YAAY,WAAkC,CAAC,EAAE,iBAAiB,QAAQ,UAAW,GAAG,OAAO,EAAE,QAAQ;CACpH,MAAM,sBAAsB,QAAQ,MAAM;AACxC,SAAO,gBACJ,MAAM,KAAK,CACX,IAAI,CAAC,MAAM,MAAM;AAChB,WAAQ,2BAA2B,IAAI,EAAE,SAAS,KAAK;EACxD,EAAC,CACD,KAAK,KAAK;CACd,GAAE,CAAC,eAAgB,EAAC;AAErB,wBACE,IAAC;EACC,WAAW,GAAG,cAAc,WAAW,OAAO,GAAG,UAAU;EAC3D,GAAI;EACJ,yBAAyB,EAAE,QAAQ,oBAAqB;EACnD;GACL;AAEL,EAAC;AAEF,wBAAe"}
@@ -1,84 +1,114 @@
1
+ //#region src/CodeBlock/codeLanguageOptions.ts
1
2
  /**
2
- * Copyright (c) 2019-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
- */
3
+ * Copyright (c) 2019-present, NDLA.
4
+ *
5
+ * This source code is licensed under the GPLv3 license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ const codeLanguageOptions = [
10
+ {
11
+ title: "Bash",
12
+ format: "bash"
13
+ },
14
+ {
15
+ title: "C",
16
+ format: "c"
17
+ },
18
+ {
19
+ title: "CSharp",
20
+ format: "csharp"
21
+ },
22
+ {
23
+ title: "CSS",
24
+ format: "css"
25
+ },
26
+ {
27
+ title: "Diff",
28
+ format: "diff"
29
+ },
30
+ {
31
+ title: "HTML",
32
+ format: "markup"
33
+ },
34
+ {
35
+ title: "Ini",
36
+ format: "ini"
37
+ },
38
+ {
39
+ title: "Java",
40
+ format: "java"
41
+ },
42
+ {
43
+ title: "Javascript",
44
+ format: "js"
45
+ },
46
+ {
47
+ title: "JSON",
48
+ format: "json"
49
+ },
50
+ {
51
+ title: "JSX",
52
+ format: "jsx"
53
+ },
54
+ {
55
+ title: "Kotlin",
56
+ format: "kotlin"
57
+ },
58
+ {
59
+ title: "LUA",
60
+ format: "lua"
61
+ },
62
+ {
63
+ title: "Markdown",
64
+ format: "markdown"
65
+ },
66
+ {
67
+ title: "Matlab",
68
+ format: "matlab"
69
+ },
70
+ {
71
+ title: "NSIS",
72
+ format: "nsis"
73
+ },
74
+ {
75
+ title: "PHP",
76
+ format: "php"
77
+ },
78
+ {
79
+ title: "Powershell",
80
+ format: "powershell"
81
+ },
82
+ {
83
+ title: "Python",
84
+ format: "python"
85
+ },
86
+ {
87
+ title: "Ruby",
88
+ format: "ruby"
89
+ },
90
+ {
91
+ title: "Rust",
92
+ format: "rust"
93
+ },
94
+ {
95
+ title: "SQL",
96
+ format: "sql"
97
+ },
98
+ {
99
+ title: "Text",
100
+ format: "text"
101
+ },
102
+ {
103
+ title: "VHDL",
104
+ format: "vhdl"
105
+ },
106
+ {
107
+ title: "XML",
108
+ format: "xml"
109
+ }
110
+ ];
8
111
 
9
- export const codeLanguageOptions = [{
10
- title: "Bash",
11
- format: "bash"
12
- }, {
13
- title: "C",
14
- format: "c"
15
- }, {
16
- title: "CSharp",
17
- format: "csharp"
18
- }, {
19
- title: "CSS",
20
- format: "css"
21
- }, {
22
- title: "Diff",
23
- format: "diff"
24
- }, {
25
- title: "HTML",
26
- format: "markup"
27
- }, {
28
- title: "Ini",
29
- format: "ini"
30
- }, {
31
- title: "Java",
32
- format: "java"
33
- }, {
34
- title: "Javascript",
35
- format: "js"
36
- }, {
37
- title: "JSON",
38
- format: "json"
39
- }, {
40
- title: "JSX",
41
- format: "jsx"
42
- }, {
43
- title: "Kotlin",
44
- format: "kotlin"
45
- }, {
46
- title: "LUA",
47
- format: "lua"
48
- }, {
49
- title: "Markdown",
50
- format: "markdown"
51
- }, {
52
- title: "Matlab",
53
- format: "matlab"
54
- }, {
55
- title: "NSIS",
56
- format: "nsis"
57
- }, {
58
- title: "PHP",
59
- format: "php"
60
- }, {
61
- title: "Powershell",
62
- format: "powershell"
63
- }, {
64
- title: "Python",
65
- format: "python"
66
- }, {
67
- title: "Ruby",
68
- format: "ruby"
69
- }, {
70
- title: "Rust",
71
- format: "rust"
72
- }, {
73
- title: "SQL",
74
- format: "sql"
75
- }, {
76
- title: "Text",
77
- format: "text"
78
- }, {
79
- title: "VHDL",
80
- format: "vhdl"
81
- }, {
82
- title: "XML",
83
- format: "xml"
84
- }];
112
+ //#endregion
113
+ export { codeLanguageOptions };
114
+ //# sourceMappingURL=codeLanguageOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"codeLanguageOptions.js","names":["codeLanguageOptions: Array<ICodeLangugeOption>"],"sources":["../../src/CodeBlock/codeLanguageOptions.ts"],"sourcesContent":["/**\n * Copyright (c) 2019-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\nexport const codeLanguageOptions: Array<ICodeLangugeOption> = [\n {\n title: \"Bash\",\n format: \"bash\",\n },\n {\n title: \"C\",\n format: \"c\",\n },\n {\n title: \"CSharp\",\n format: \"csharp\",\n },\n {\n title: \"CSS\",\n format: \"css\",\n },\n {\n title: \"Diff\",\n format: \"diff\",\n },\n {\n title: \"HTML\",\n format: \"markup\",\n },\n {\n title: \"Ini\",\n format: \"ini\",\n },\n {\n title: \"Java\",\n format: \"java\",\n },\n {\n title: \"Javascript\",\n format: \"js\",\n },\n {\n title: \"JSON\",\n format: \"json\",\n },\n {\n title: \"JSX\",\n format: \"jsx\",\n },\n {\n title: \"Kotlin\",\n format: \"kotlin\",\n },\n {\n title: \"LUA\",\n format: \"lua\",\n },\n {\n title: \"Markdown\",\n format: \"markdown\",\n },\n {\n title: \"Matlab\",\n format: \"matlab\",\n },\n {\n title: \"NSIS\",\n format: \"nsis\",\n },\n {\n title: \"PHP\",\n format: \"php\",\n },\n {\n title: \"Powershell\",\n format: \"powershell\",\n },\n {\n title: \"Python\",\n format: \"python\",\n },\n {\n title: \"Ruby\",\n format: \"ruby\",\n },\n {\n title: \"Rust\",\n format: \"rust\",\n },\n {\n title: \"SQL\",\n format: \"sql\",\n },\n {\n title: \"Text\",\n format: \"text\",\n },\n {\n title: \"VHDL\",\n format: \"vhdl\",\n },\n {\n title: \"XML\",\n format: \"xml\",\n },\n];\n\nexport interface ICodeLangugeOption {\n title: string;\n format: string;\n}\n"],"mappings":";;;;;;;;AAQA,MAAaA,sBAAiD;CAC5D;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;CACD;EACE,OAAO;EACP,QAAQ;CACT;AACF"}