@ndla/ui 56.0.121-alpha.0 → 56.0.122-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (206) hide show
  1. package/lib/i18n/index.d.ts +1 -1
  2. package/lib/i18n/useComponentTranslations.d.ts +2 -1
  3. package/lib/index.d.ts +1 -1
  4. package/lib/locale/messages-en.d.ts +34 -0
  5. package/lib/locale/messages-nb.d.ts +34 -0
  6. package/lib/locale/messages-nn.d.ts +34 -0
  7. package/lib/locale/messages-se.d.ts +34 -0
  8. package/package.json +6 -5
  9. package/src/Article/ArticleByline.tsx +1 -1
  10. package/src/i18n/index.ts +1 -0
  11. package/src/i18n/useComponentTranslations.ts +36 -1
  12. package/src/index.ts +1 -0
  13. package/src/locale/messages-en.ts +34 -0
  14. package/src/locale/messages-nb.ts +34 -0
  15. package/src/locale/messages-nn.ts +34 -0
  16. package/src/locale/messages-se.ts +34 -0
  17. package/es/Article/Article.js +0 -199
  18. package/es/Article/ArticleByline.js +0 -182
  19. package/es/Article/ArticleFootNotes.js +0 -60
  20. package/es/Article/index.js +0 -11
  21. package/es/AudioPlayer/AudioPlayer.js +0 -218
  22. package/es/AudioPlayer/Controls.js +0 -332
  23. package/es/AudioPlayer/SpeechControl.js +0 -56
  24. package/es/AudioPlayer/index.js +0 -10
  25. package/es/Breadcrumb/Breadcrumb.js +0 -60
  26. package/es/Breadcrumb/BreadcrumbItem.js +0 -62
  27. package/es/Breadcrumb/HomeBreadcrumb.js +0 -77
  28. package/es/Breadcrumb/index.js +0 -11
  29. package/es/CampaignBlock/CampaignBlock.js +0 -180
  30. package/es/CampaignBlock/index.js +0 -9
  31. package/es/CodeBlock/CodeBlock.js +0 -35
  32. package/es/CodeBlock/codeLanguageOptions.js +0 -84
  33. package/es/CodeBlock/index.js +0 -10
  34. package/es/Concept/Concept.js +0 -72
  35. package/es/ContactBlock/ContactBlock.js +0 -199
  36. package/es/ContactBlock/index.js +0 -9
  37. package/es/ContentTypeBadge/ContentTypeBadge.js +0 -50
  38. package/es/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -32
  39. package/es/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -32
  40. package/es/ContentTypeHero/ContentTypeHero.js +0 -50
  41. package/es/ContentTypeHero/index.js +0 -9
  42. package/es/CopyParagraphButton/CopyParagraphButton.js +0 -83
  43. package/es/CopyParagraphButton/index.js +0 -11
  44. package/es/Embed/AudioEmbed.js +0 -76
  45. package/es/Embed/BrightcoveEmbed.js +0 -133
  46. package/es/Embed/CodeEmbed.js +0 -79
  47. package/es/Embed/ConceptEmbed.js +0 -123
  48. package/es/Embed/ConceptInlineTriggerButton.js +0 -45
  49. package/es/Embed/ContentLinkEmbed.js +0 -51
  50. package/es/Embed/CopyrightEmbed.js +0 -33
  51. package/es/Embed/EmbedErrorPlaceholder.js +0 -58
  52. package/es/Embed/EmbedWrapper.js +0 -51
  53. package/es/Embed/ExternalEmbed.js +0 -74
  54. package/es/Embed/FootnoteEmbed.js +0 -44
  55. package/es/Embed/GlossEmbed.js +0 -80
  56. package/es/Embed/H5pEmbed.js +0 -61
  57. package/es/Embed/IframeEmbed.js +0 -93
  58. package/es/Embed/ImageEmbed.js +0 -238
  59. package/es/Embed/InlineTriggerButton.js +0 -37
  60. package/es/Embed/RelatedContentEmbed.js +0 -55
  61. package/es/Embed/UnknownEmbed.js +0 -31
  62. package/es/Embed/UuDisclaimerEmbed.js +0 -88
  63. package/es/Embed/index.js +0 -25
  64. package/es/Embed/types.js +0 -1
  65. package/es/ErrorMessage/ErrorMessage.js +0 -95
  66. package/es/ErrorMessage/index.js +0 -10
  67. package/es/FactBox/FactBox.js +0 -177
  68. package/es/FactBox/index.js +0 -10
  69. package/es/FileList/File.js +0 -101
  70. package/es/FileList/FileList.js +0 -47
  71. package/es/FileList/PdfFile.js +0 -50
  72. package/es/FileList/index.js +0 -11
  73. package/es/Gloss/Gloss.js +0 -175
  74. package/es/Gloss/GlossExample.js +0 -64
  75. package/es/Gloss/index.js +0 -10
  76. package/es/Grid/Grid.js +0 -94
  77. package/es/Grid/GridParallaxItem.js +0 -32
  78. package/es/Grid/index.js +0 -10
  79. package/es/KeyFigure/KeyFigure.js +0 -63
  80. package/es/KeyFigure/index.js +0 -9
  81. package/es/LicenseByline/EmbedByline.js +0 -212
  82. package/es/LicenseByline/LicenseLink.js +0 -56
  83. package/es/LicenseByline/index.js +0 -10
  84. package/es/LinkBlock/LinkBlock.js +0 -103
  85. package/es/LinkBlock/LinkBlockSection.js +0 -35
  86. package/es/LinkBlock/index.js +0 -10
  87. package/es/Pitch/Pitch.js +0 -83
  88. package/es/Pitch/index.js +0 -9
  89. package/es/RelatedArticleList/RelatedArticleList.js +0 -135
  90. package/es/RelatedArticleList/index.js +0 -11
  91. package/es/ResourceBox/ResourceBox.js +0 -99
  92. package/es/ResourceBox/index.js +0 -10
  93. package/es/TagSelector/TagSelector.js +0 -143
  94. package/es/ZendeskButton/ZendeskButton.js +0 -55
  95. package/es/i18n/formatNestedMessages.js +0 -25
  96. package/es/i18n/i18n.js +0 -35
  97. package/es/i18n/index.js +0 -11
  98. package/es/i18n/useComponentTranslations.js +0 -164
  99. package/es/index.js +0 -45
  100. package/es/locale/messages-en.js +0 -428
  101. package/es/locale/messages-nb.js +0 -428
  102. package/es/locale/messages-nn.js +0 -428
  103. package/es/locale/messages-se.js +0 -428
  104. package/es/model/ContentType.js +0 -68
  105. package/es/model/SubjectCategories.js +0 -12
  106. package/es/model/SubjectTypes.js +0 -11
  107. package/es/model/WordClass.js +0 -45
  108. package/es/model/index.js +0 -21
  109. package/es/types.js +0 -1
  110. package/es/utils/licenseAttributes.js +0 -18
  111. package/es/utils/relativeUrl.js +0 -37
  112. package/lib/Article/Article.js +0 -207
  113. package/lib/Article/ArticleByline.js +0 -189
  114. package/lib/Article/ArticleFootNotes.js +0 -67
  115. package/lib/Article/index.js +0 -68
  116. package/lib/AudioPlayer/AudioPlayer.js +0 -224
  117. package/lib/AudioPlayer/Controls.js +0 -338
  118. package/lib/AudioPlayer/SpeechControl.js +0 -62
  119. package/lib/AudioPlayer/index.js +0 -16
  120. package/lib/Breadcrumb/Breadcrumb.js +0 -67
  121. package/lib/Breadcrumb/BreadcrumbItem.js +0 -68
  122. package/lib/Breadcrumb/HomeBreadcrumb.js +0 -84
  123. package/lib/Breadcrumb/index.js +0 -23
  124. package/lib/CampaignBlock/CampaignBlock.js +0 -187
  125. package/lib/CampaignBlock/index.js +0 -13
  126. package/lib/CodeBlock/CodeBlock.js +0 -41
  127. package/lib/CodeBlock/codeLanguageOptions.js +0 -90
  128. package/lib/CodeBlock/index.js +0 -20
  129. package/lib/Concept/Concept.js +0 -78
  130. package/lib/ContactBlock/ContactBlock.js +0 -206
  131. package/lib/ContactBlock/index.js +0 -18
  132. package/lib/ContentTypeBadge/ContentTypeBadge.js +0 -57
  133. package/lib/ContentTypeBlockQuote/ContentTypeBlockQuote.js +0 -38
  134. package/lib/ContentTypeFramedContent/ContentTypeFramedContent.js +0 -38
  135. package/lib/ContentTypeHero/ContentTypeHero.js +0 -57
  136. package/lib/ContentTypeHero/index.js +0 -12
  137. package/lib/CopyParagraphButton/CopyParagraphButton.js +0 -89
  138. package/lib/CopyParagraphButton/index.js +0 -22
  139. package/lib/Embed/AudioEmbed.js +0 -84
  140. package/lib/Embed/BrightcoveEmbed.js +0 -142
  141. package/lib/Embed/CodeEmbed.js +0 -86
  142. package/lib/Embed/ConceptEmbed.js +0 -131
  143. package/lib/Embed/ConceptInlineTriggerButton.js +0 -51
  144. package/lib/Embed/ContentLinkEmbed.js +0 -57
  145. package/lib/Embed/CopyrightEmbed.js +0 -39
  146. package/lib/Embed/EmbedErrorPlaceholder.js +0 -64
  147. package/lib/Embed/EmbedWrapper.js +0 -57
  148. package/lib/Embed/ExternalEmbed.js +0 -81
  149. package/lib/Embed/FootnoteEmbed.js +0 -50
  150. package/lib/Embed/GlossEmbed.js +0 -88
  151. package/lib/Embed/H5pEmbed.js +0 -68
  152. package/lib/Embed/IframeEmbed.js +0 -100
  153. package/lib/Embed/ImageEmbed.js +0 -248
  154. package/lib/Embed/InlineTriggerButton.js +0 -43
  155. package/lib/Embed/RelatedContentEmbed.js +0 -61
  156. package/lib/Embed/UnknownEmbed.js +0 -37
  157. package/lib/Embed/UuDisclaimerEmbed.js +0 -94
  158. package/lib/Embed/index.js +0 -150
  159. package/lib/Embed/types.js +0 -5
  160. package/lib/ErrorMessage/ErrorMessage.js +0 -101
  161. package/lib/ErrorMessage/index.js +0 -16
  162. package/lib/FactBox/FactBox.js +0 -184
  163. package/lib/FactBox/index.js +0 -16
  164. package/lib/FileList/File.js +0 -108
  165. package/lib/FileList/FileList.js +0 -54
  166. package/lib/FileList/PdfFile.js +0 -57
  167. package/lib/FileList/index.js +0 -44
  168. package/lib/Gloss/Gloss.js +0 -181
  169. package/lib/Gloss/GlossExample.js +0 -70
  170. package/lib/Gloss/index.js +0 -20
  171. package/lib/Grid/Grid.js +0 -101
  172. package/lib/Grid/GridParallaxItem.js +0 -39
  173. package/lib/Grid/index.js +0 -19
  174. package/lib/KeyFigure/KeyFigure.js +0 -70
  175. package/lib/KeyFigure/index.js +0 -13
  176. package/lib/LicenseByline/EmbedByline.js +0 -220
  177. package/lib/LicenseByline/LicenseLink.js +0 -62
  178. package/lib/LicenseByline/index.js +0 -19
  179. package/lib/LinkBlock/LinkBlock.js +0 -110
  180. package/lib/LinkBlock/LinkBlockSection.js +0 -41
  181. package/lib/LinkBlock/index.js +0 -20
  182. package/lib/Pitch/Pitch.js +0 -91
  183. package/lib/Pitch/index.js +0 -12
  184. package/lib/RelatedArticleList/RelatedArticleList.js +0 -143
  185. package/lib/RelatedArticleList/index.js +0 -21
  186. package/lib/ResourceBox/ResourceBox.js +0 -106
  187. package/lib/ResourceBox/index.js +0 -13
  188. package/lib/TagSelector/TagSelector.js +0 -150
  189. package/lib/ZendeskButton/ZendeskButton.js +0 -61
  190. package/lib/i18n/formatNestedMessages.js +0 -32
  191. package/lib/i18n/i18n.js +0 -41
  192. package/lib/i18n/index.js +0 -62
  193. package/lib/i18n/useComponentTranslations.js +0 -176
  194. package/lib/index.js +0 -593
  195. package/lib/locale/messages-en.js +0 -435
  196. package/lib/locale/messages-nb.js +0 -435
  197. package/lib/locale/messages-nn.js +0 -435
  198. package/lib/locale/messages-se.js +0 -435
  199. package/lib/model/ContentType.js +0 -74
  200. package/lib/model/SubjectCategories.js +0 -18
  201. package/lib/model/SubjectTypes.js +0 -17
  202. package/lib/model/WordClass.js +0 -51
  203. package/lib/model/index.js +0 -28
  204. package/lib/types.js +0 -5
  205. package/lib/utils/licenseAttributes.js +0 -25
  206. package/lib/utils/relativeUrl.js +0 -44
@@ -1,206 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.contactBlockBackgrounds = exports.ContactBlock = void 0;
7
- var _reactI18next = require("react-i18next");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsx2 = require("@ndla/styled-system/jsx");
10
- var _EmbedByline = require("../LicenseByline/EmbedByline");
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- /**
13
- * Copyright (c) 2024-present, NDLA.
14
- *
15
- * This source code is licensed under the GPLv3 license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- *
18
- */
19
-
20
- const BackgroundVariant = {
21
- strong: {
22
- _before: {
23
- backgroundColor: "surface.brand.3"
24
- }
25
- },
26
- moderate: {
27
- _before: {
28
- backgroundColor: "surface.brand.3.moderate"
29
- }
30
- },
31
- subtle: {
32
- _before: {
33
- backgroundColor: "surface.brand.3.subtle"
34
- }
35
- }
36
- };
37
- const contactBlockBackgrounds = exports.contactBlockBackgrounds = Object.keys(BackgroundVariant);
38
- const StyledWrapper = (0, _jsx2.styled)("div", {
39
- base: {
40
- display: "flex",
41
- minWidth: "surface.xxsmall",
42
- padding: "medium",
43
- alignItems: "center",
44
- justifyContent: "space-between",
45
- boxShadow: "full",
46
- border: "1px solid",
47
- gap: "medium",
48
- position: "relative",
49
- borderColor: "stroke.default",
50
- borderRadius: "xsmall",
51
- overflow: "hidden",
52
- background: "surface.default",
53
- flexDirection: "column-reverse",
54
- tablet: {
55
- alignItems: "unset",
56
- flexDirection: "row"
57
- }
58
- }
59
- });
60
- const EmailLink = (0, _jsx2.styled)("a", {
61
- base: {
62
- color: "text.default",
63
- textDecoration: "underline",
64
- _hover: {
65
- textDecoration: "none"
66
- },
67
- _focusVisible: {
68
- textDecoration: "none"
69
- }
70
- }
71
- });
72
- const HeaderWrapper = (0, _jsx2.styled)("div", {
73
- base: {
74
- position: "relative",
75
- display: "flex",
76
- flexDirection: "column",
77
- gap: "3xsmall",
78
- zIndex: "base",
79
- _before: {
80
- content: '""',
81
- position: "absolute",
82
- top: "-60px",
83
- left: "-50px",
84
- right: "0",
85
- bottom: "0",
86
- height: "calc(100% + 50px)",
87
- width: "surface.3xlarge",
88
- transform: "rotate(-4deg)",
89
- zIndex: "hide"
90
- }
91
- },
92
- variants: {
93
- variant: BackgroundVariant,
94
- imageExists: {
95
- true: {
96
- tabletDown: {
97
- _before: {
98
- display: "none"
99
- }
100
- }
101
- }
102
- }
103
- }
104
- });
105
- const ImageWrapper = (0, _jsx2.styled)("div", {
106
- base: {
107
- display: "flex",
108
- gap: "xxsmall",
109
- alignItems: "flex-start",
110
- justifyContent: "flex-start",
111
- flexDirection: "column",
112
- zIndex: "base",
113
- tabletDown: {
114
- _before: {
115
- content: '""',
116
- position: "absolute",
117
- top: "-50px",
118
- left: "-50px",
119
- right: "0",
120
- bottom: "0",
121
- height: "surface.xxsmall",
122
- width: "surface.3xlarge",
123
- transform: "rotate(-4deg)",
124
- zIndex: "hide"
125
- }
126
- }
127
- },
128
- variants: {
129
- variant: BackgroundVariant
130
- }
131
- });
132
- const StyledImage = (0, _jsx2.styled)("img", {
133
- base: {
134
- borderRadius: "xsmall",
135
- width: "surface.xsmall",
136
- height: "surface.xsmall",
137
- objectFit: "cover"
138
- }
139
- });
140
- const ContentWrapper = (0, _jsx2.styled)("div", {
141
- base: {
142
- display: "flex",
143
- flexDirection: "column",
144
- gap: "medium",
145
- flex: "1",
146
- width: "100%"
147
- }
148
- });
149
- const StyledDescription = (0, _jsx2.styled)(_primitives.Text, {
150
- base: {
151
- fontFamily: "serif"
152
- }
153
- });
154
- const ContactBlock = _ref => {
155
- let {
156
- image,
157
- jobTitle,
158
- description,
159
- name,
160
- email,
161
- embedAlt,
162
- lang,
163
- backgroundColor = "strong"
164
- } = _ref;
165
- const {
166
- t
167
- } = (0, _reactI18next.useTranslation)();
168
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledWrapper, {
169
- "data-embed-type": "contact-block",
170
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(ContentWrapper, {
171
- children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(HeaderWrapper, {
172
- variant: backgroundColor,
173
- imageExists: !!image,
174
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
175
- lang: lang,
176
- fontWeight: "bold",
177
- textStyle: "heading.small",
178
- children: name
179
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Text, {
180
- lang: lang,
181
- children: jobTitle
182
- }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_primitives.Text, {
183
- children: [`${t("email")}: `, /*#__PURE__*/(0, _jsxRuntime.jsx)(EmailLink, {
184
- href: `mailto:${email}`,
185
- children: email
186
- })]
187
- })]
188
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(StyledDescription, {
189
- textStyle: "body.large",
190
- children: description
191
- })]
192
- }), !!image && /*#__PURE__*/(0, _jsxRuntime.jsxs)(ImageWrapper, {
193
- variant: backgroundColor,
194
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledImage, {
195
- alt: embedAlt !== undefined ? embedAlt : image.alttext.alttext,
196
- src: image.image.imageUrl,
197
- width: 300,
198
- height: 300
199
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedByline.LicenseContainerContent, {
200
- type: "image",
201
- copyright: image.copyright
202
- })]
203
- })]
204
- });
205
- };
206
- exports.ContactBlock = ContactBlock;
@@ -1,18 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ContactBlock", {
7
- enumerable: true,
8
- get: function () {
9
- return _ContactBlock.ContactBlock;
10
- }
11
- });
12
- Object.defineProperty(exports, "contactBlockBackgrounds", {
13
- enumerable: true,
14
- get: function () {
15
- return _ContactBlock.contactBlockBackgrounds;
16
- }
17
- });
18
- var _ContactBlock = require("./ContactBlock");
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.contentTypeToBadgeVariantMap = exports.ContentTypeBadge = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _primitives = require("@ndla/primitives");
10
- var contentTypes = _interopRequireWildcard(require("../model/ContentType"));
11
- var _jsxRuntime = require("react/jsx-runtime");
12
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
- /**
14
- * Copyright (c) 2024-present, NDLA.
15
- *
16
- * This source code is licensed under the GPLv3 license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- *
19
- */
20
-
21
- const contentTypeToBadgeVariantMap = exports.contentTypeToBadgeVariantMap = {
22
- [contentTypes.SUBJECT_MATERIAL]: "brand1",
23
- [contentTypes.TASKS_AND_ACTIVITIES]: "brand2",
24
- [contentTypes.ASSESSMENT_RESOURCES]: "brand2",
25
- [contentTypes.SUBJECT]: "neutral",
26
- [contentTypes.SOURCE_MATERIAL]: "brand1",
27
- [contentTypes.LEARNING_PATH]: "brand3",
28
- [contentTypes.TOPIC]: "neutral",
29
- [contentTypes.MULTIDISCIPLINARY]: "neutral",
30
- [contentTypes.CONCEPT]: "brand1",
31
- [contentTypes.EXTERNAL]: "brand2",
32
- [contentTypes.IMAGE]: "brand1",
33
- [contentTypes.AUDIO]: "brand1",
34
- [contentTypes.PODCAST]: "brand1",
35
- [contentTypes.VIDEO]: "brand1",
36
- [contentTypes.MISSING]: "neutral",
37
- [contentTypes.PODCAST_SERIES]: "brand1",
38
- [contentTypes.GLOSS]: "brand1",
39
- [contentTypes.PROGRAMME]: "neutral",
40
- [contentTypes.FRONTPAGE_ARTICLE]: "brand2"
41
- };
42
- const ContentTypeBadge = exports.ContentTypeBadge = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
43
- let {
44
- contentType,
45
- children,
46
- ...props
47
- } = _ref;
48
- const {
49
- t
50
- } = (0, _reactI18next.useTranslation)();
51
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Badge, {
52
- colorTheme: contentTypeToBadgeVariantMap[contentType ?? "missing"] ?? contentTypeToBadgeVariantMap["missing"],
53
- ...props,
54
- ref: ref,
55
- children: children ?? t(`contentTypes.${contentType}`)
56
- });
57
- });
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ContentTypeBlockQuote = void 0;
7
- var _react = require("react");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsxRuntime = require("react/jsx-runtime");
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
- */
17
-
18
- const contentTypeToVariantMapping = {
19
- "subject-material": "brand1",
20
- "source-material": "brand1",
21
- concept: "brand1",
22
- "tasks-and-activities": "brand2",
23
- "assessment-resources": "brand2"
24
- };
25
- const ContentTypeBlockQuote = exports.ContentTypeBlockQuote = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
26
- let {
27
- variant,
28
- contentType,
29
- ...props
30
- } = _ref;
31
- const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
32
- const variantColor = variant === "colored" ? color : undefined;
33
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.BlockQuote, {
34
- ...props,
35
- variant: variantColor,
36
- ref: ref
37
- });
38
- });
@@ -1,38 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ContentTypeFramedContent = void 0;
7
- var _react = require("react");
8
- var _primitives = require("@ndla/primitives");
9
- var _jsxRuntime = require("react/jsx-runtime");
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
- */
17
-
18
- const contentTypeToVariantMapping = {
19
- "subject-material": "brand1",
20
- "source-material": "brand1",
21
- concept: "brand1",
22
- "tasks-and-activities": "brand2",
23
- "assessment-resources": "brand2"
24
- };
25
- const ContentTypeFramedContent = exports.ContentTypeFramedContent = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
26
- let {
27
- variant = "neutral",
28
- contentType,
29
- ...props
30
- } = _ref;
31
- const color = contentType ? contentTypeToVariantMapping[contentType] ?? "brand1" : "brand1";
32
- const variantColor = variant === "colored" ? color : undefined;
33
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.FramedContent, {
34
- ...props,
35
- colorTheme: variantColor,
36
- ref: ref
37
- });
38
- });
@@ -1,57 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.contentTypeToHeroMap = exports.ContentTypeHero = void 0;
7
- var _react = require("react");
8
- var _primitives = require("@ndla/primitives");
9
- var contentTypes = _interopRequireWildcard(require("../model/ContentType"));
10
- var _jsxRuntime = require("react/jsx-runtime");
11
- function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
- /**
13
- * Copyright (c) 2024-present, NDLA.
14
- *
15
- * This source code is licensed under the GPLv3 license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- *
18
- */
19
-
20
- const contentTypeToHeroMap = exports.contentTypeToHeroMap = {
21
- [contentTypes.SUBJECT_MATERIAL]: "primary",
22
- [contentTypes.TASKS_AND_ACTIVITIES]: "brand2Bold",
23
- [contentTypes.ASSESSMENT_RESOURCES]: "brand2",
24
- // This will never happen
25
- [contentTypes.SUBJECT]: "primary",
26
- [contentTypes.SOURCE_MATERIAL]: "brand1",
27
- // This will never happen
28
- [contentTypes.LEARNING_PATH]: "primary",
29
- [contentTypes.TOPIC]: "neutral",
30
- [contentTypes.MULTIDISCIPLINARY]: "primary",
31
- [contentTypes.CONCEPT]: "brand1Moderate",
32
- [contentTypes.EXTERNAL]: "primary",
33
- [contentTypes.IMAGE]: "primary",
34
- [contentTypes.AUDIO]: "primary",
35
- [contentTypes.PODCAST]: "primary",
36
- [contentTypes.VIDEO]: "primary",
37
- [contentTypes.MISSING]: "neutral",
38
- [contentTypes.GLOSS]: "brand1Moderate",
39
- // this will never happen
40
- [contentTypes.PROGRAMME]: "primary",
41
- // this will never happen
42
- [contentTypes.PODCAST_SERIES]: "primary",
43
- [contentTypes.FRONTPAGE_ARTICLE]: "primary"
44
- };
45
- const ContentTypeHero = exports.ContentTypeHero = /*#__PURE__*/(0, _react.forwardRef)((_ref, ref) => {
46
- let {
47
- contentType,
48
- children,
49
- ...props
50
- } = _ref;
51
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_primitives.Hero, {
52
- variant: contentTypeToHeroMap[contentType ?? "missing"] ?? contentTypeToHeroMap["missing"],
53
- ...props,
54
- ref: ref,
55
- children: children
56
- });
57
- });
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "ContentTypeHero", {
7
- enumerable: true,
8
- get: function () {
9
- return _ContentTypeHero.ContentTypeHero;
10
- }
11
- });
12
- var _ContentTypeHero = require("./ContentTypeHero");
@@ -1,89 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
- var _react = require("react");
8
- var _reactI18next = require("react-i18next");
9
- var _icons = require("@ndla/icons");
10
- var _primitives = require("@ndla/primitives");
11
- var _jsx2 = require("@ndla/styled-system/jsx");
12
- var _util = require("@ndla/util");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- /**
15
- * Copyright (c) 2021-present, NDLA.
16
- *
17
- * This source code is licensed under the GPLv3 license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- *
20
- */
21
-
22
- const ContainerDiv = (0, _jsx2.styled)("div", {
23
- base: {
24
- position: "relative",
25
- _hover: {
26
- "& [data-copy-button]": {
27
- opacity: "1",
28
- cursor: "pointer"
29
- }
30
- }
31
- }
32
- });
33
- const StyledIconButton = (0, _jsx2.styled)(_primitives.IconButton, {
34
- base: {
35
- position: "absolute",
36
- left: "-xxlarge",
37
- top: "-4xsmall",
38
- opacity: "0",
39
- cursor: "pointer",
40
- "&:focus, &:focus-visible, &:active": {
41
- opacity: "1"
42
- }
43
- }
44
- });
45
- const CopyParagraphButton = _ref => {
46
- let {
47
- children,
48
- copyText,
49
- lang
50
- } = _ref;
51
- const [hasCopied, setHasCopied] = (0, _react.useState)(false);
52
- const {
53
- t
54
- } = (0, _reactI18next.useTranslation)();
55
- const sanitizedTitle = (0, _react.useMemo)(() => encodeURIComponent(copyText.replace(/ /g, "-")), [copyText]);
56
- (0, _react.useEffect)(() => {
57
- if (hasCopied) {
58
- setTimeout(() => setHasCopied(false), 3000);
59
- }
60
- }, [hasCopied]);
61
- const onCopyClick = (0, _react.useCallback)(() => {
62
- setHasCopied(true);
63
- const {
64
- location
65
- } = window;
66
- const newHash = `#${sanitizedTitle}`;
67
- const port = location.port ? `:${location.port}` : "";
68
- const urlToCopy = `${location.protocol}//${location.hostname}${port}${location.pathname}${location.search}${newHash}`;
69
- (0, _util.copyTextToClipboard)(urlToCopy);
70
- }, [sanitizedTitle]);
71
- const tooltip = hasCopied ? t("article.copyPageLinkCopied") : t("article.copyHeaderLink");
72
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(ContainerDiv, {
73
- "data-embed-type": "copy-heading",
74
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(StyledIconButton, {
75
- variant: "clear",
76
- "data-copy-button": "",
77
- onClick: onCopyClick,
78
- title: tooltip,
79
- "aria-label": `${tooltip}: ${copyText}`,
80
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_icons.LinkMedium, {})
81
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)("h2", {
82
- id: sanitizedTitle,
83
- tabIndex: -1,
84
- lang: lang,
85
- children: children
86
- })]
87
- });
88
- };
89
- var _default = exports.default = CopyParagraphButton;
@@ -1,22 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "CopyParagraphButton", {
7
- enumerable: true,
8
- get: function () {
9
- return _CopyParagraphButton.default;
10
- }
11
- });
12
- exports.default = void 0;
13
- var _CopyParagraphButton = _interopRequireDefault(require("./CopyParagraphButton"));
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- /**
16
- * Copyright (c) 2021-present, NDLA.
17
- *
18
- * This source code is licensed under the GPLv3 license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- *
21
- */
22
- var _default = exports.default = _CopyParagraphButton.default;
@@ -1,84 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getFirstNonEmptyLicenseCredits = exports.default = void 0;
7
- var _primitives = require("@ndla/primitives");
8
- var _jsx2 = require("@ndla/styled-system/jsx");
9
- var _EmbedErrorPlaceholder = _interopRequireDefault(require("./EmbedErrorPlaceholder"));
10
- var _AudioPlayer = _interopRequireDefault(require("../AudioPlayer"));
11
- var _LicenseByline = require("../LicenseByline");
12
- var _licenseAttributes = require("../utils/licenseAttributes");
13
- var _jsxRuntime = require("react/jsx-runtime");
14
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
15
- /**
16
- * Copyright (c) 2023-present, NDLA.
17
- *
18
- * This source code is licensed under the GPLv3 license found in the
19
- * LICENSE file in the root directory of this source tree.
20
- *
21
- */
22
-
23
- const StyledFigure = (0, _jsx2.styled)(_primitives.Figure, {
24
- base: {
25
- clear: "both"
26
- }
27
- });
28
- const getFirstNonEmptyLicenseCredits = authors => Object.values(authors).find(i => i.length > 0) ?? [];
29
- exports.getFirstNonEmptyLicenseCredits = getFirstNonEmptyLicenseCredits;
30
- const AudioEmbed = _ref => {
31
- let {
32
- embed,
33
- lang
34
- } = _ref;
35
- const type = embed.embedData.type === "standard" ? "audio" : "podcast";
36
- if (embed.status === "error") {
37
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_EmbedErrorPlaceholder.default, {
38
- type: type
39
- });
40
- }
41
- const {
42
- data,
43
- embedData
44
- } = embed;
45
- if (embedData.type === "minimal") {
46
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_AudioPlayer.default, {
47
- speech: true,
48
- src: data.audioFile.url,
49
- title: data.title.title
50
- });
51
- }
52
- const subtitle = data.series ? {
53
- title: data.series.title.title,
54
- url: `/podkast/${data.series.id}`
55
- } : undefined;
56
- const coverPhoto = data.podcastMeta?.coverPhoto;
57
- const img = coverPhoto && {
58
- url: coverPhoto.url,
59
- alt: coverPhoto.altText
60
- };
61
- const licenseProps = (0, _licenseAttributes.licenseAttributes)(data.copyright.license.license, lang, embedData.url);
62
- return /*#__PURE__*/(0, _jsxRuntime.jsxs)(StyledFigure, {
63
- lang: lang,
64
- "data-embed-type": type,
65
- ...licenseProps,
66
- children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_AudioPlayer.default, {
67
- description: data.podcastMeta?.introduction ?? "",
68
- img: img,
69
- src: data.audioFile.url,
70
- textVersion: data.manuscript?.manuscript.length ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
71
- dangerouslySetInnerHTML: {
72
- __html: data.manuscript.manuscript
73
- }
74
- }) : undefined,
75
- title: data.title.title,
76
- subtitle: subtitle
77
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_LicenseByline.EmbedByline, {
78
- error: false,
79
- type: data.audioType === "standard" ? "audio" : "podcast",
80
- copyright: embed.data.copyright
81
- })]
82
- });
83
- };
84
- var _default = exports.default = AudioEmbed;