@ndla/ui 36.0.1 → 37.0.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 (188) hide show
  1. package/es/Article/Article.js +7 -13
  2. package/es/Article/ArticleByline.js +79 -123
  3. package/es/Article/ArticleFootNotes.js +16 -11
  4. package/es/AudioPlayer/AudioPlayer.js +33 -35
  5. package/es/AudioPlayer/initAudioPlayers.js +6 -1
  6. package/es/BlogPost/BlogPost.js +4 -4
  7. package/es/CampaignBlock/CampaignBlock.js +77 -0
  8. package/es/CampaignBlock/index.js +9 -0
  9. package/es/ContactBlock/ContactBlock.js +63 -39
  10. package/es/Embed/AudioEmbed.js +44 -188
  11. package/es/Embed/BrightcoveEmbed.js +27 -123
  12. package/es/Embed/ConceptEmbed.js +53 -75
  13. package/es/Embed/EmbedErrorPlaceholder.js +41 -0
  14. package/es/Embed/ExternalEmbed.js +5 -12
  15. package/es/Embed/H5pEmbed.js +4 -14
  16. package/es/Embed/IframeEmbed.js +4 -4
  17. package/es/Embed/ImageEmbed.js +41 -153
  18. package/es/Embed/conceptComponents.js +62 -228
  19. package/es/Embed/types.js +1 -0
  20. package/es/KeyFigure/KeyFigure.js +57 -0
  21. package/es/{KeyPerformanceIndicator → KeyFigure}/index.js +1 -1
  22. package/es/LicenseByline/EmbedByline.js +115 -0
  23. package/es/LicenseByline/LicenseDescription.js +39 -0
  24. package/es/LicenseByline/LicenseLink.js +36 -0
  25. package/es/LicenseByline/index.js +1 -0
  26. package/es/List/OrderedList.js +48 -0
  27. package/es/List/UnOrderedList.js +36 -0
  28. package/es/List/index.js +10 -0
  29. package/es/Navigation/NavigationBox.js +41 -48
  30. package/es/Navigation/NavigationHeading.js +18 -29
  31. package/es/Notion/Notion.js +5 -5
  32. package/es/Resource/resourceComponents.js +12 -11
  33. package/es/Typography/Heading.js +38 -0
  34. package/es/Typography/index.js +9 -0
  35. package/es/all.css +1 -1
  36. package/es/index.js +4 -2
  37. package/es/locale/messages-en.js +13 -2
  38. package/es/locale/messages-nb.js +13 -2
  39. package/es/locale/messages-nn.js +13 -2
  40. package/es/locale/messages-se.js +13 -2
  41. package/es/locale/messages-sma.js +13 -2
  42. package/es/model/ContentType.js +7 -1
  43. package/lib/Article/Article.d.ts +1 -3
  44. package/lib/Article/Article.js +7 -13
  45. package/lib/Article/ArticleByline.d.ts +3 -5
  46. package/lib/Article/ArticleByline.js +83 -126
  47. package/lib/Article/ArticleFootNotes.js +16 -11
  48. package/lib/AudioPlayer/AudioPlayer.d.ts +1 -2
  49. package/lib/AudioPlayer/AudioPlayer.js +33 -36
  50. package/lib/AudioPlayer/initAudioPlayers.d.ts +1 -0
  51. package/lib/AudioPlayer/initAudioPlayers.js +9 -3
  52. package/lib/BlogPost/BlogPost.js +4 -4
  53. package/lib/CampaignBlock/CampaignBlock.d.ts +31 -0
  54. package/lib/CampaignBlock/CampaignBlock.js +82 -0
  55. package/lib/CampaignBlock/index.d.ts +8 -0
  56. package/lib/CampaignBlock/index.js +13 -0
  57. package/lib/ContactBlock/ContactBlock.js +63 -39
  58. package/lib/Embed/AudioEmbed.d.ts +3 -2
  59. package/lib/Embed/AudioEmbed.js +53 -192
  60. package/lib/Embed/BrightcoveEmbed.d.ts +3 -1
  61. package/lib/Embed/BrightcoveEmbed.js +27 -122
  62. package/lib/Embed/ConceptEmbed.d.ts +7 -2
  63. package/lib/Embed/ConceptEmbed.js +51 -73
  64. package/lib/Embed/EmbedErrorPlaceholder.d.ts +17 -0
  65. package/lib/Embed/EmbedErrorPlaceholder.js +48 -0
  66. package/lib/Embed/ExternalEmbed.js +5 -11
  67. package/lib/Embed/H5pEmbed.js +4 -13
  68. package/lib/Embed/IframeEmbed.d.ts +2 -2
  69. package/lib/Embed/IframeEmbed.js +4 -4
  70. package/lib/Embed/ImageEmbed.d.ts +3 -10
  71. package/lib/Embed/ImageEmbed.js +48 -161
  72. package/lib/Embed/conceptComponents.d.ts +4 -2
  73. package/lib/Embed/conceptComponents.js +67 -231
  74. package/lib/Embed/index.d.ts +1 -0
  75. package/lib/Embed/types.d.ts +14 -0
  76. package/lib/Embed/types.js +5 -0
  77. package/lib/KeyFigure/KeyFigure.d.ts +10 -0
  78. package/lib/KeyFigure/KeyFigure.js +62 -0
  79. package/lib/KeyFigure/index.d.ts +1 -0
  80. package/lib/KeyFigure/index.js +13 -0
  81. package/lib/LicenseByline/EmbedByline.d.ts +51 -0
  82. package/lib/LicenseByline/EmbedByline.js +120 -0
  83. package/lib/LicenseByline/LicenseDescription.d.ts +14 -0
  84. package/lib/LicenseByline/LicenseDescription.js +44 -0
  85. package/lib/LicenseByline/LicenseLink.d.ts +14 -0
  86. package/lib/LicenseByline/LicenseLink.js +44 -0
  87. package/lib/LicenseByline/index.d.ts +1 -0
  88. package/lib/LicenseByline/index.js +13 -0
  89. package/lib/List/OrderedList.d.ts +15 -0
  90. package/lib/List/OrderedList.js +56 -0
  91. package/lib/List/UnOrderedList.d.ts +10 -0
  92. package/lib/List/UnOrderedList.js +43 -0
  93. package/lib/List/index.d.ts +9 -0
  94. package/lib/List/index.js +20 -0
  95. package/lib/Navigation/NavigationBox.js +40 -47
  96. package/lib/Navigation/NavigationHeading.js +17 -28
  97. package/lib/Notion/Notion.js +5 -5
  98. package/lib/Resource/resourceComponents.js +12 -11
  99. package/lib/Typography/Heading.d.ts +26 -0
  100. package/lib/Typography/Heading.js +45 -0
  101. package/lib/Typography/index.d.ts +8 -0
  102. package/lib/Typography/index.js +13 -0
  103. package/lib/all.css +1 -1
  104. package/lib/index.d.ts +4 -1
  105. package/lib/index.js +23 -3
  106. package/lib/locale/messages-en.d.ts +11 -0
  107. package/lib/locale/messages-en.js +13 -2
  108. package/lib/locale/messages-nb.d.ts +11 -0
  109. package/lib/locale/messages-nb.js +13 -2
  110. package/lib/locale/messages-nn.d.ts +11 -0
  111. package/lib/locale/messages-nn.js +13 -2
  112. package/lib/locale/messages-se.d.ts +11 -0
  113. package/lib/locale/messages-se.js +13 -2
  114. package/lib/locale/messages-sma.d.ts +11 -0
  115. package/lib/locale/messages-sma.js +13 -2
  116. package/lib/model/ContentType.d.ts +1 -0
  117. package/lib/model/ContentType.js +9 -2
  118. package/package.json +15 -15
  119. package/src/Article/Article.tsx +1 -8
  120. package/src/Article/ArticleByline.tsx +78 -127
  121. package/src/Article/ArticleFootNotes.tsx +33 -10
  122. package/src/Article/component.article.scss +1 -52
  123. package/src/Article/component.footnotes.scss +2 -2
  124. package/src/Aside/component.aside.scss +3 -3
  125. package/src/AudioPlayer/AudioPlayer.tsx +11 -24
  126. package/src/AudioPlayer/initAudioPlayers.tsx +7 -2
  127. package/src/BlogPost/BlogPost.tsx +0 -4
  128. package/src/CampaignBlock/CampaignBlock.stories.tsx +63 -0
  129. package/src/CampaignBlock/CampaignBlock.tsx +99 -0
  130. package/src/CampaignBlock/index.ts +9 -0
  131. package/src/ContactBlock/ContactBlock.tsx +27 -19
  132. package/src/ContactBlock/Contactblock.stories.tsx +0 -1
  133. package/src/Dialog/component.dialog.scss +4 -5
  134. package/src/Embed/AudioEmbed.stories.tsx +5 -3
  135. package/src/Embed/AudioEmbed.tsx +45 -192
  136. package/src/Embed/BrightcoveEmbed.stories.tsx +5 -1
  137. package/src/Embed/BrightcoveEmbed.tsx +20 -95
  138. package/src/Embed/ConceptEmbed.stories.tsx +5 -0
  139. package/src/Embed/ConceptEmbed.tsx +43 -54
  140. package/src/Embed/EmbedErrorPlaceholder.tsx +59 -0
  141. package/src/Embed/ExternalEmbed.stories.tsx +86 -0
  142. package/src/Embed/ExternalEmbed.tsx +3 -8
  143. package/src/Embed/H5pEmbed.stories.tsx +92 -0
  144. package/src/Embed/H5pEmbed.tsx +2 -10
  145. package/src/Embed/IframeEmbed.stories.tsx +130 -0
  146. package/src/Embed/IframeEmbed.tsx +3 -3
  147. package/src/Embed/ImageEmbed.stories.tsx +3 -1
  148. package/src/Embed/ImageEmbed.tsx +21 -116
  149. package/src/Embed/conceptComponents.tsx +67 -257
  150. package/src/Embed/index.ts +1 -0
  151. package/src/Embed/types.ts +12 -0
  152. package/src/FactBox/component.factbox.scss +3 -3
  153. package/src/Figure/component.figure-license.scss +4 -4
  154. package/src/Figure/component.figure.scss +1 -1
  155. package/src/KeyFigure/KeyFigure.stories.tsx +36 -0
  156. package/src/{KeyPerformanceIndicator/KeyPerformanceIndicator.tsx → KeyFigure/KeyFigure.tsx} +9 -7
  157. package/src/{KeyPerformanceIndicator → KeyFigure}/index.ts +1 -1
  158. package/src/LicenseByline/EmbedByline.stories.tsx +83 -0
  159. package/src/LicenseByline/EmbedByline.tsx +165 -0
  160. package/src/LicenseByline/LicenseDescription.tsx +43 -0
  161. package/src/LicenseByline/LicenseLink.tsx +42 -0
  162. package/src/LicenseByline/index.tsx +1 -0
  163. package/src/List/OrderedList.tsx +115 -0
  164. package/src/List/UnOrderedList.tsx +49 -0
  165. package/src/List/index.ts +10 -0
  166. package/src/MediaList/component.medialist.scss +2 -2
  167. package/src/Navigation/NavigationBox.tsx +10 -14
  168. package/src/Navigation/NavigationHeading.tsx +15 -24
  169. package/src/Notion/Notion.tsx +1 -1
  170. package/src/RelatedArticleList/component.related-articles.scss +3 -13
  171. package/src/Resource/resourceComponents.tsx +4 -2
  172. package/src/Table/component.tables.scss +0 -46
  173. package/src/Translation/component.translation.scss +3 -5
  174. package/src/Typography/Heading.tsx +96 -0
  175. package/src/Typography/index.ts +9 -0
  176. package/src/index.ts +5 -1
  177. package/src/locale/messages-en.ts +11 -0
  178. package/src/locale/messages-nb.ts +11 -0
  179. package/src/locale/messages-nn.ts +11 -0
  180. package/src/locale/messages-se.ts +11 -0
  181. package/src/locale/messages-sma.ts +11 -0
  182. package/src/model/ContentType.ts +7 -0
  183. package/es/KeyPerformanceIndicator/KeyPerformanceIndicator.js +0 -57
  184. package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.d.ts +0 -8
  185. package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.js +0 -62
  186. package/lib/KeyPerformanceIndicator/index.d.ts +0 -1
  187. package/lib/KeyPerformanceIndicator/index.js +0 -13
  188. package/src/KeyPerformanceIndicator/KeyPerformanceIndicator.stories.tsx +0 -79
package/lib/index.d.ts CHANGED
@@ -96,6 +96,9 @@ export { TreeStructure } from './TreeStructure';
96
96
  export type { TreeStructureProps } from './TreeStructure';
97
97
  export { SearchField, SearchResultList, SearchResultItem, ActiveFilters, ToggleSearchButton } from './Search';
98
98
  export { default as LetterFilter } from './LetterFilter';
99
+ export { OrderedList, UnOrderedList } from './List';
99
100
  export { BlogPostV2 } from './BlogPost';
100
- export { KeyPerformanceIndicator } from './KeyPerformanceIndicator';
101
+ export { KeyFigure } from './KeyFigure';
101
102
  export { default as ContactBlock } from './ContactBlock';
103
+ export type { HeartButtonType } from './Embed';
104
+ export { CampaignBlock } from './CampaignBlock';
package/lib/index.js CHANGED
@@ -178,6 +178,12 @@ Object.defineProperty(exports, "BrightcoveEmbed", {
178
178
  return _Embed.BrightcoveEmbed;
179
179
  }
180
180
  });
181
+ Object.defineProperty(exports, "CampaignBlock", {
182
+ enumerable: true,
183
+ get: function get() {
184
+ return _CampaignBlock.CampaignBlock;
185
+ }
186
+ });
181
187
  Object.defineProperty(exports, "CompetenceGoalTab", {
182
188
  enumerable: true,
183
189
  get: function get() {
@@ -592,10 +598,10 @@ Object.defineProperty(exports, "InfoWidget", {
592
598
  return _InfoWidget["default"];
593
599
  }
594
600
  });
595
- Object.defineProperty(exports, "KeyPerformanceIndicator", {
601
+ Object.defineProperty(exports, "KeyFigure", {
596
602
  enumerable: true,
597
603
  get: function get() {
598
- return _KeyPerformanceIndicator.KeyPerformanceIndicator;
604
+ return _KeyFigure.KeyFigure;
599
605
  }
600
606
  });
601
607
  Object.defineProperty(exports, "LanguageSelector", {
@@ -832,6 +838,12 @@ Object.defineProperty(exports, "OneColumn", {
832
838
  return _Layout.OneColumn;
833
839
  }
834
840
  });
841
+ Object.defineProperty(exports, "OrderedList", {
842
+ enumerable: true,
843
+ get: function get() {
844
+ return _List.OrderedList;
845
+ }
846
+ });
835
847
  Object.defineProperty(exports, "PageContainer", {
836
848
  enumerable: true,
837
849
  get: function get() {
@@ -1174,6 +1186,12 @@ Object.defineProperty(exports, "TreeStructure", {
1174
1186
  return _TreeStructure.TreeStructure;
1175
1187
  }
1176
1188
  });
1189
+ Object.defineProperty(exports, "UnOrderedList", {
1190
+ enumerable: true,
1191
+ get: function get() {
1192
+ return _List.UnOrderedList;
1193
+ }
1194
+ });
1177
1195
  Object.defineProperty(exports, "UnknownEmbed", {
1178
1196
  enumerable: true,
1179
1197
  get: function get() {
@@ -1354,9 +1372,11 @@ var _InfoBlock = require("./InfoBlock");
1354
1372
  var _TreeStructure = require("./TreeStructure");
1355
1373
  var _Search = require("./Search");
1356
1374
  var _LetterFilter = _interopRequireDefault(require("./LetterFilter"));
1375
+ var _List = require("./List");
1357
1376
  var _BlogPost = require("./BlogPost");
1358
- var _KeyPerformanceIndicator = require("./KeyPerformanceIndicator");
1377
+ var _KeyFigure = require("./KeyFigure");
1359
1378
  var _ContactBlock = _interopRequireDefault(require("./ContactBlock"));
1379
+ var _CampaignBlock = require("./CampaignBlock");
1360
1380
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
1361
1381
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
1362
1382
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -269,6 +269,16 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
273
+ type: {
274
+ image: string;
275
+ video: string;
276
+ audio: string;
277
+ podcast: string;
278
+ concept: string;
279
+ h5p: string;
280
+ external: string;
281
+ };
272
282
  };
273
283
  common: {
274
284
  subject: string;
@@ -1229,6 +1239,7 @@ declare const messages: {
1229
1239
  close: string;
1230
1240
  };
1231
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1232
1243
  };
1233
1244
  h5p: {
1234
1245
  reuse: string;
@@ -967,7 +967,8 @@ var messages = _objectSpread(_objectSpread({
967
967
  heading: 'Text version',
968
968
  close: 'Close text version'
969
969
  },
970
- readMoreDescriptionLabel: 'show more'
970
+ readMoreDescriptionLabel: 'show more',
971
+ readLessDescriptionLabel: 'show less'
971
972
  },
972
973
  h5p: {
973
974
  reuse: 'Use H5P',
@@ -1256,7 +1257,17 @@ var messages = _objectSpread(_objectSpread({
1256
1257
  embed: {
1257
1258
  conceptListError: 'Failed to show concept list',
1258
1259
  linkError: 'Failed to show link.',
1259
- unsupported: "Embed {{type}} not supported."
1260
+ unsupported: "Embed {{type}} not supported.",
1261
+ embedError: "An error occurred while loading the {{type}}. Try reloading the page.",
1262
+ type: {
1263
+ image: 'Image',
1264
+ video: 'Video',
1265
+ audio: 'Audio',
1266
+ podcast: 'Podcast',
1267
+ concept: 'Concept',
1268
+ h5p: 'H5P',
1269
+ external: 'External resource'
1270
+ }
1260
1271
  }
1261
1272
  });
1262
1273
  var _default = messages;
@@ -269,6 +269,16 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
273
+ type: {
274
+ image: string;
275
+ video: string;
276
+ audio: string;
277
+ podcast: string;
278
+ concept: string;
279
+ h5p: string;
280
+ external: string;
281
+ };
272
282
  };
273
283
  common: {
274
284
  subject: string;
@@ -1229,6 +1239,7 @@ declare const messages: {
1229
1239
  close: string;
1230
1240
  };
1231
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1232
1243
  };
1233
1244
  h5p: {
1234
1245
  reuse: string;
@@ -967,7 +967,8 @@ var messages = _objectSpread(_objectSpread({
967
967
  heading: 'Tekstversjon',
968
968
  close: 'Lukk tekstversjon'
969
969
  },
970
- readMoreDescriptionLabel: 'vis mer'
970
+ readMoreDescriptionLabel: 'vis mer',
971
+ readLessDescriptionLabel: 'vis mindre'
971
972
  },
972
973
  h5p: {
973
974
  reuse: 'Bruk H5P',
@@ -1256,7 +1257,17 @@ var messages = _objectSpread(_objectSpread({
1256
1257
  embed: {
1257
1258
  conceptListError: 'Klarte ikke å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikke å vise lenke.',
1259
- unsupported: "Embed {{type}} er ikke st\xF8ttet."
1260
+ unsupported: "Embed {{type}} er ikke st\xF8ttet.",
1261
+ embedError: "Beklager, en feil oppstod ved lasting av {{type}}. Pr\xF8v \xE5 laste inn siden p\xE5 nytt.",
1262
+ type: {
1263
+ image: 'Bilde',
1264
+ video: 'Video',
1265
+ audio: 'Lyd',
1266
+ podcast: 'Podkast',
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1270
+ }
1260
1271
  }
1261
1272
  });
1262
1273
  var _default = messages;
@@ -269,6 +269,16 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
273
+ type: {
274
+ image: string;
275
+ video: string;
276
+ audio: string;
277
+ podcast: string;
278
+ concept: string;
279
+ h5p: string;
280
+ external: string;
281
+ };
272
282
  };
273
283
  common: {
274
284
  subject: string;
@@ -1229,6 +1239,7 @@ declare const messages: {
1229
1239
  close: string;
1230
1240
  };
1231
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1232
1243
  };
1233
1244
  h5p: {
1234
1245
  reuse: string;
@@ -967,7 +967,8 @@ var messages = _objectSpread(_objectSpread({
967
967
  heading: 'Tekstversjon',
968
968
  close: 'Lukk tekstversjon'
969
969
  },
970
- readMoreDescriptionLabel: 'vis meir'
970
+ readMoreDescriptionLabel: 'vis meir',
971
+ readLessDescriptionLabel: 'vis mindre'
971
972
  },
972
973
  h5p: {
973
974
  reuse: 'Bruk H5P',
@@ -1256,7 +1257,17 @@ var messages = _objectSpread(_objectSpread({
1256
1257
  embed: {
1257
1258
  conceptListError: 'Klarte ikkje å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikkje å vise lenke.',
1259
- unsupported: "Embed {{type}} er ikkje st\xF8tta."
1260
+ unsupported: "Embed {{type}} er ikkje st\xF8tta.",
1261
+ embedError: "Orsak, ein feil oppstod ved lasting av {{type}}. Pr\xF8v \xE5 laste inn sida p\xE5 nytt.",
1262
+ type: {
1263
+ image: 'Bilde',
1264
+ video: 'Video',
1265
+ audio: 'Lyd',
1266
+ podcast: 'Podkast',
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1270
+ }
1260
1271
  }
1261
1272
  });
1262
1273
  var _default = messages;
@@ -269,6 +269,16 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
273
+ type: {
274
+ image: string;
275
+ video: string;
276
+ audio: string;
277
+ podcast: string;
278
+ concept: string;
279
+ h5p: string;
280
+ external: string;
281
+ };
272
282
  };
273
283
  common: {
274
284
  subject: string;
@@ -1229,6 +1239,7 @@ declare const messages: {
1229
1239
  close: string;
1230
1240
  };
1231
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1232
1243
  };
1233
1244
  h5p: {
1234
1245
  reuse: string;
@@ -967,7 +967,8 @@ var messages = _objectSpread(_objectSpread({
967
967
  heading: 'Teakstavearšuvdna',
968
968
  close: 'Govčča teakstavearšuvnna'
969
969
  },
970
- readMoreDescriptionLabel: 'Čájet eanet'
970
+ readMoreDescriptionLabel: 'Čájet eanet',
971
+ readLessDescriptionLabel: 'vis mindre'
971
972
  },
972
973
  h5p: {
973
974
  reuse: 'Geavat H5P',
@@ -1256,7 +1257,17 @@ var messages = _objectSpread(_objectSpread({
1256
1257
  embed: {
1257
1258
  conceptListError: 'Ii sáhttán čájehit čilgehuslisttu',
1258
1259
  linkError: 'Ii sáhttán čájehit liŋkka.',
1259
- unsupported: "Embed {{type}} ii dorjojuvvo."
1260
+ unsupported: "Embed {{type}} ii dorjojuvvo.",
1261
+ embedError: "Orsak, ein feil oppstod ved lasting av {{type}}. Pr\xF8v \xE5 laste inn sida p\xE5 nytt.",
1262
+ type: {
1263
+ image: 'Bilde',
1264
+ video: 'Video',
1265
+ audio: 'Lyd',
1266
+ podcast: 'Podkast',
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1270
+ }
1260
1271
  }
1261
1272
  });
1262
1273
  var _default = messages;
@@ -269,6 +269,16 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
273
+ type: {
274
+ image: string;
275
+ video: string;
276
+ audio: string;
277
+ podcast: string;
278
+ concept: string;
279
+ h5p: string;
280
+ external: string;
281
+ };
272
282
  };
273
283
  common: {
274
284
  subject: string;
@@ -1229,6 +1239,7 @@ declare const messages: {
1229
1239
  close: string;
1230
1240
  };
1231
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1232
1243
  };
1233
1244
  h5p: {
1234
1245
  reuse: string;
@@ -967,7 +967,8 @@ var messages = _objectSpread(_objectSpread({
967
967
  heading: 'Teeksteversjovne',
968
968
  close: 'Dahph teeksteversjovnem'
969
969
  },
970
- readMoreDescriptionLabel: 'vis mer'
970
+ readMoreDescriptionLabel: 'vis mer',
971
+ readLessDescriptionLabel: 'vis mindre'
971
972
  },
972
973
  h5p: {
973
974
  reuse: 'Bruk H5P',
@@ -1256,7 +1257,17 @@ var messages = _objectSpread(_objectSpread({
1256
1257
  embed: {
1257
1258
  conceptListError: 'Klarte ikkje å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikkje å vise lenke.',
1259
- unsupported: "Embed {{type}} er ikkje st\xF8tta."
1260
+ unsupported: "Embed {{type}} er ikkje st\xF8tta.",
1261
+ embedError: "Orsak, ein feil oppstod ved lasting av {{type}}. Pr\xF8v \xE5 laste inn sida p\xE5 nytt.",
1262
+ type: {
1263
+ image: 'Bilde',
1264
+ video: 'Video',
1265
+ audio: 'Lyd',
1266
+ podcast: 'Podkast',
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1270
+ }
1260
1271
  }
1261
1272
  });
1262
1273
  var _default = messages;
@@ -33,3 +33,4 @@ export declare const RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = "urn:resourcety
33
33
  export declare const RESOURCE_TYPE_SOURCE_MATERIAL = "urn:resourcetype:SourceMaterial";
34
34
  export declare const ListOfContentTypes: string[];
35
35
  export declare const contentTypeMapping: Record<string, string>;
36
+ export declare const resourceTypeMapping: Record<string, string>;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.contentTypes = exports.contentTypeMapping = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.MULTIDISCIPLINARY_TOPIC = exports.ListOfContentTypes = exports.LEARNING_PATH = exports.EXTERNAL_LEARNING_RESOURCES = exports.ASSESSMENT_RESOURCES = void 0;
6
+ exports.resourceTypeMapping = exports.contentTypes = exports.contentTypeMapping = exports.TOPIC = exports.TASKS_AND_ACTIVITIES = exports.SUBJECT_MATERIAL = exports.SUBJECT = exports.SOURCE_MATERIAL = exports.RESOURCE_TYPE_TASKS_AND_ACTIVITIES = exports.RESOURCE_TYPE_SUBJECT_MATERIAL = exports.RESOURCE_TYPE_SOURCE_MATERIAL = exports.RESOURCE_TYPE_LEARNING_PATH = exports.RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES = exports.RESOURCE_TYPE_ASSESSMENT_RESOURCES = exports.MULTIDISCIPLINARY_TOPIC = exports.ListOfContentTypes = exports.LEARNING_PATH = exports.EXTERNAL_LEARNING_RESOURCES = exports.ASSESSMENT_RESOURCES = void 0;
7
7
  var _contentTypeMapping;
8
8
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
9
9
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -62,4 +62,11 @@ exports.RESOURCE_TYPE_SOURCE_MATERIAL = RESOURCE_TYPE_SOURCE_MATERIAL;
62
62
  var ListOfContentTypes = ['SUBJECT_MATERIAL', 'TASKS_AND_ACTIVITIES', 'ASSESSMENT_RESOURCES', 'SUBJECT', 'EXTERNAL_LEARNING_RESOURCES', 'SOURCE_MATERIAL', 'LEARNING_PATH', 'TOPIC', 'MULTIDISIPLINARY_TOPIC'];
63
63
  exports.ListOfContentTypes = ListOfContentTypes;
64
64
  var contentTypeMapping = (_contentTypeMapping = {}, _defineProperty(_contentTypeMapping, RESOURCE_TYPE_LEARNING_PATH, LEARNING_PATH), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_SUBJECT_MATERIAL, SUBJECT_MATERIAL), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_TASKS_AND_ACTIVITIES, TASKS_AND_ACTIVITIES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_ASSESSMENT_RESOURCES, ASSESSMENT_RESOURCES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_EXTERNAL_LEARNING_RESOURCES, EXTERNAL_LEARNING_RESOURCES), _defineProperty(_contentTypeMapping, RESOURCE_TYPE_SOURCE_MATERIAL, SOURCE_MATERIAL), _defineProperty(_contentTypeMapping, "default", SUBJECT_MATERIAL), _contentTypeMapping);
65
- exports.contentTypeMapping = contentTypeMapping;
65
+ exports.contentTypeMapping = contentTypeMapping;
66
+ var resourceTypeMapping = {
67
+ image: 'image',
68
+ video: 'video',
69
+ concept: 'concept',
70
+ audio: 'audio'
71
+ };
72
+ exports.resourceTypeMapping = resourceTypeMapping;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ndla/ui",
3
- "version": "36.0.1",
3
+ "version": "37.0.0",
4
4
  "description": "UI component library for NDLA.",
5
5
  "license": "GPL-3.0",
6
6
  "main": "lib/index.js",
@@ -31,22 +31,22 @@
31
31
  "types"
32
32
  ],
33
33
  "dependencies": {
34
+ "@ndla/accordion": "^2.2.0",
34
35
  "@ndla/article-scripts": "^3.0.17",
35
- "@ndla/button": "^10.0.13",
36
- "@ndla/carousel": "^3.0.14",
37
- "@ndla/core": "^3.1.3",
38
- "@ndla/forms": "^4.2.22",
36
+ "@ndla/button": "^10.1.0",
37
+ "@ndla/carousel": "^3.1.0",
38
+ "@ndla/core": "^4.0.0",
39
+ "@ndla/forms": "^4.3.0",
39
40
  "@ndla/hooks": "^2.0.4",
40
- "@ndla/icons": "^2.2.13",
41
+ "@ndla/icons": "^2.3.0",
41
42
  "@ndla/licenses": "^7.0.4",
42
- "@ndla/modal": "^2.2.17",
43
- "@ndla/notion": "^4.2.19",
44
- "@ndla/safelink": "^4.0.23",
45
- "@ndla/switch": "^1.0.9",
46
- "@ndla/tabs": "^2.1.20",
47
- "@ndla/tooltip": "^4.0.21",
43
+ "@ndla/modal": "^2.3.0",
44
+ "@ndla/notion": "^4.3.0",
45
+ "@ndla/safelink": "^4.1.0",
46
+ "@ndla/switch": "^1.1.0",
47
+ "@ndla/tabs": "^2.2.0",
48
+ "@ndla/tooltip": "^4.1.0",
48
49
  "@ndla/util": "^3.1.12",
49
- "@radix-ui/react-accordion": "1.1.0",
50
50
  "@radix-ui/react-dropdown-menu": "2.0.2",
51
51
  "@radix-ui/react-popover": "^1.0.3",
52
52
  "@reach/menu-button": "^0.16.2",
@@ -75,7 +75,7 @@
75
75
  "devDependencies": {
76
76
  "@babel/plugin-proposal-optional-chaining": "^7.11.0",
77
77
  "@ndla/types-backend": "^0.2.5",
78
- "@ndla/types-embed": "^1.1.1",
78
+ "@ndla/types-embed": "^2.0.0",
79
79
  "@types/reach__dialog": "^0.1.0",
80
80
  "css-loader": "^6.7.3",
81
81
  "mini-css-extract-plugin": "^2.7.5",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "e614b60f6395582cd70ba813ebbb874d0ee56343"
89
+ "gitHead": "3961942d13c313b37bba92395f6a430ed31dc954"
90
90
  }
@@ -16,7 +16,6 @@ import { useIntersectionObserver } from '@ndla/hooks';
16
16
  import { resizeObserver } from '@ndla/util';
17
17
  import { spacing, spacingUnit, mq, breakpoints } from '@ndla/core';
18
18
  import { Article as ArticleType, Locale } from '../types';
19
- import ArticleFootNotes from './ArticleFootNotes';
20
19
  import ArticleContent from './ArticleContent';
21
20
  import ArticleByline from './ArticleByline';
22
21
  import LayoutItem from '../Layout';
@@ -126,14 +125,12 @@ type Props = {
126
125
  contentTransformed?: boolean;
127
126
  locale: Locale;
128
127
  messageBoxLinks?: [];
129
- copyText?: string;
130
128
  competenceGoals?:
131
129
  | ((inp: { Dialog: ComponentType; dialogProps: { isOpen: boolean; onClose: () => void } }) => ReactNode)
132
130
  | ReactNode
133
131
  | null;
134
132
  id: string;
135
133
  renderMarkdown: (text: string) => string;
136
- printUrl?: string;
137
134
  notions?: { list: ConceptNotionType[]; related: NotionRelatedContent[] };
138
135
  accessMessage?: string;
139
136
  };
@@ -165,11 +162,9 @@ export const Article = ({
165
162
  id,
166
163
  locale,
167
164
  notions,
168
- printUrl,
169
165
  renderMarkdown,
170
166
  accessMessage,
171
167
  heartButton,
172
- copyText,
173
168
  contentTransformed,
174
169
  }: Props) => {
175
170
  const articleRef = useRef<HTMLDivElement>(null);
@@ -241,15 +236,13 @@ export const Article = ({
241
236
  </LayoutItem>
242
237
 
243
238
  <LayoutItem layout="center">
244
- {footNotes && footNotes.length > 0 && <ArticleFootNotes footNotes={footNotes} />}
245
239
  <ArticleByline
246
- copySourceReference={copyText}
240
+ footnotes={footNotes}
247
241
  authors={authors}
248
242
  suppliers={rightsholders}
249
243
  published={published}
250
244
  license={licenseObj?.license ?? ''}
251
245
  licenseBox={licenseBox}
252
- printUrl={printUrl}
253
246
  />
254
247
  </LayoutItem>
255
248
  <LayoutItem layout="extend">{children}</LayoutItem>