@ndla/ui 36.0.2 → 37.0.1

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 (174) 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/ContentTypeBadge/ContentTypeBadge.js +27 -6
  7. package/es/Embed/AudioEmbed.js +44 -188
  8. package/es/Embed/BrightcoveEmbed.js +32 -127
  9. package/es/Embed/ConceptEmbed.js +53 -75
  10. package/es/Embed/EmbedErrorPlaceholder.js +41 -0
  11. package/es/Embed/ExternalEmbed.js +5 -12
  12. package/es/Embed/H5pEmbed.js +5 -15
  13. package/es/Embed/IframeEmbed.js +4 -4
  14. package/es/Embed/ImageEmbed.js +41 -153
  15. package/es/Embed/RelatedContentEmbed.js +3 -3
  16. package/es/Embed/conceptComponents.js +62 -228
  17. package/es/Embed/types.js +1 -0
  18. package/es/KeyFigure/KeyFigure.js +57 -0
  19. package/es/{KeyPerformanceIndicator → KeyFigure}/index.js +1 -1
  20. package/es/LicenseByline/EmbedByline.js +33 -8
  21. package/es/LicenseByline/LicenseDescription.js +16 -14
  22. package/es/List/OrderedList.js +48 -0
  23. package/es/List/UnOrderedList.js +36 -0
  24. package/es/List/index.js +10 -0
  25. package/es/Navigation/NavigationBox.js +41 -48
  26. package/es/Navigation/NavigationHeading.js +18 -29
  27. package/es/Notion/Notion.js +5 -5
  28. package/es/Resource/ListResource.js +9 -9
  29. package/es/Resource/resourceComponents.js +12 -11
  30. package/es/Typography/Heading.js +38 -0
  31. package/es/Typography/index.js +9 -0
  32. package/es/all.css +1 -1
  33. package/es/index.js +4 -2
  34. package/es/locale/messages-en.js +6 -2
  35. package/es/locale/messages-nb.js +6 -2
  36. package/es/locale/messages-nn.js +6 -2
  37. package/es/locale/messages-se.js +6 -2
  38. package/es/locale/messages-sma.js +6 -2
  39. package/es/model/ContentType.js +7 -1
  40. package/lib/Article/Article.d.ts +1 -3
  41. package/lib/Article/Article.js +7 -13
  42. package/lib/Article/ArticleByline.d.ts +3 -5
  43. package/lib/Article/ArticleByline.js +83 -126
  44. package/lib/Article/ArticleFootNotes.js +16 -11
  45. package/lib/AudioPlayer/AudioPlayer.d.ts +1 -2
  46. package/lib/AudioPlayer/AudioPlayer.js +33 -36
  47. package/lib/AudioPlayer/initAudioPlayers.d.ts +1 -0
  48. package/lib/AudioPlayer/initAudioPlayers.js +9 -3
  49. package/lib/ContentTypeBadge/ContentTypeBadge.js +27 -6
  50. package/lib/Embed/AudioEmbed.d.ts +3 -2
  51. package/lib/Embed/AudioEmbed.js +53 -192
  52. package/lib/Embed/BrightcoveEmbed.d.ts +3 -1
  53. package/lib/Embed/BrightcoveEmbed.js +32 -126
  54. package/lib/Embed/ConceptEmbed.d.ts +7 -2
  55. package/lib/Embed/ConceptEmbed.js +51 -73
  56. package/lib/Embed/EmbedErrorPlaceholder.d.ts +17 -0
  57. package/lib/Embed/EmbedErrorPlaceholder.js +48 -0
  58. package/lib/Embed/ExternalEmbed.js +5 -11
  59. package/lib/Embed/H5pEmbed.js +5 -14
  60. package/lib/Embed/IframeEmbed.d.ts +2 -2
  61. package/lib/Embed/IframeEmbed.js +4 -4
  62. package/lib/Embed/ImageEmbed.d.ts +3 -10
  63. package/lib/Embed/ImageEmbed.js +48 -161
  64. package/lib/Embed/RelatedContentEmbed.js +3 -3
  65. package/lib/Embed/conceptComponents.d.ts +4 -2
  66. package/lib/Embed/conceptComponents.js +67 -231
  67. package/lib/Embed/index.d.ts +1 -0
  68. package/lib/Embed/types.d.ts +14 -0
  69. package/lib/Embed/types.js +5 -0
  70. package/lib/KeyFigure/KeyFigure.d.ts +10 -0
  71. package/lib/KeyFigure/KeyFigure.js +62 -0
  72. package/lib/KeyFigure/index.d.ts +1 -0
  73. package/lib/KeyFigure/index.js +13 -0
  74. package/lib/LicenseByline/EmbedByline.d.ts +10 -2
  75. package/lib/LicenseByline/EmbedByline.js +32 -7
  76. package/lib/LicenseByline/LicenseDescription.d.ts +3 -1
  77. package/lib/LicenseByline/LicenseDescription.js +14 -13
  78. package/lib/List/OrderedList.d.ts +15 -0
  79. package/lib/List/OrderedList.js +56 -0
  80. package/lib/List/UnOrderedList.d.ts +10 -0
  81. package/lib/List/UnOrderedList.js +43 -0
  82. package/lib/List/index.d.ts +9 -0
  83. package/lib/List/index.js +20 -0
  84. package/lib/Navigation/NavigationBox.js +40 -47
  85. package/lib/Navigation/NavigationHeading.js +17 -28
  86. package/lib/Notion/Notion.js +5 -5
  87. package/lib/Resource/ListResource.js +8 -8
  88. package/lib/Resource/resourceComponents.js +12 -11
  89. package/lib/Typography/Heading.d.ts +26 -0
  90. package/lib/Typography/Heading.js +45 -0
  91. package/lib/Typography/index.d.ts +8 -0
  92. package/lib/Typography/index.js +13 -0
  93. package/lib/all.css +1 -1
  94. package/lib/index.d.ts +4 -1
  95. package/lib/index.js +23 -3
  96. package/lib/locale/messages-en.d.ts +4 -0
  97. package/lib/locale/messages-en.js +6 -2
  98. package/lib/locale/messages-nb.d.ts +4 -0
  99. package/lib/locale/messages-nb.js +6 -2
  100. package/lib/locale/messages-nn.d.ts +4 -0
  101. package/lib/locale/messages-nn.js +6 -2
  102. package/lib/locale/messages-se.d.ts +4 -0
  103. package/lib/locale/messages-se.js +6 -2
  104. package/lib/locale/messages-sma.d.ts +4 -0
  105. package/lib/locale/messages-sma.js +6 -2
  106. package/lib/model/ContentType.d.ts +1 -0
  107. package/lib/model/ContentType.js +9 -2
  108. package/package.json +15 -15
  109. package/src/Article/Article.tsx +1 -8
  110. package/src/Article/ArticleByline.tsx +78 -127
  111. package/src/Article/ArticleFootNotes.tsx +33 -10
  112. package/src/Article/component.article.scss +1 -52
  113. package/src/Article/component.footnotes.scss +2 -2
  114. package/src/Aside/component.aside.scss +3 -3
  115. package/src/AudioPlayer/AudioPlayer.tsx +11 -24
  116. package/src/AudioPlayer/initAudioPlayers.tsx +7 -2
  117. package/src/ContentTypeBadge/ContentTypeBadge.tsx +29 -6
  118. package/src/ContentTypeBadge/component.content-type-badge.scss +9 -3
  119. package/src/Dialog/component.dialog.scss +4 -5
  120. package/src/Embed/AudioEmbed.stories.tsx +5 -3
  121. package/src/Embed/AudioEmbed.tsx +45 -192
  122. package/src/Embed/BrightcoveEmbed.stories.tsx +5 -1
  123. package/src/Embed/BrightcoveEmbed.tsx +24 -98
  124. package/src/Embed/ConceptEmbed.stories.tsx +5 -0
  125. package/src/Embed/ConceptEmbed.tsx +43 -54
  126. package/src/Embed/EmbedErrorPlaceholder.tsx +59 -0
  127. package/src/Embed/ExternalEmbed.stories.tsx +86 -0
  128. package/src/Embed/ExternalEmbed.tsx +3 -8
  129. package/src/Embed/H5pEmbed.stories.tsx +92 -0
  130. package/src/Embed/H5pEmbed.tsx +3 -11
  131. package/src/Embed/IframeEmbed.stories.tsx +130 -0
  132. package/src/Embed/IframeEmbed.tsx +3 -3
  133. package/src/Embed/ImageEmbed.stories.tsx +3 -1
  134. package/src/Embed/ImageEmbed.tsx +21 -116
  135. package/src/Embed/RelatedContentEmbed.tsx +3 -1
  136. package/src/Embed/conceptComponents.tsx +67 -257
  137. package/src/Embed/index.ts +1 -0
  138. package/src/Embed/types.ts +12 -0
  139. package/src/FactBox/component.factbox.scss +3 -3
  140. package/src/Figure/component.figure-license.scss +4 -4
  141. package/src/Figure/component.figure.scss +1 -1
  142. package/src/KeyFigure/KeyFigure.stories.tsx +36 -0
  143. package/src/{KeyPerformanceIndicator/KeyPerformanceIndicator.tsx → KeyFigure/KeyFigure.tsx} +9 -7
  144. package/src/{KeyPerformanceIndicator → KeyFigure}/index.ts +1 -1
  145. package/src/LicenseByline/EmbedByline.stories.tsx +1 -0
  146. package/src/LicenseByline/EmbedByline.tsx +57 -9
  147. package/src/LicenseByline/LicenseDescription.tsx +9 -3
  148. package/src/List/OrderedList.tsx +115 -0
  149. package/src/List/UnOrderedList.tsx +49 -0
  150. package/src/List/index.ts +10 -0
  151. package/src/MediaList/component.medialist.scss +2 -2
  152. package/src/Navigation/NavigationBox.tsx +10 -14
  153. package/src/Navigation/NavigationHeading.tsx +15 -24
  154. package/src/Notion/Notion.tsx +1 -1
  155. package/src/RelatedArticleList/component.related-articles.scss +3 -13
  156. package/src/Resource/ListResource.tsx +6 -2
  157. package/src/Resource/resourceComponents.tsx +4 -2
  158. package/src/Table/component.tables.scss +0 -46
  159. package/src/Translation/component.translation.scss +3 -5
  160. package/src/Typography/Heading.tsx +96 -0
  161. package/src/Typography/index.ts +9 -0
  162. package/src/index.ts +5 -1
  163. package/src/locale/messages-en.ts +4 -0
  164. package/src/locale/messages-nb.ts +4 -0
  165. package/src/locale/messages-nn.ts +4 -0
  166. package/src/locale/messages-se.ts +4 -0
  167. package/src/locale/messages-sma.ts +4 -0
  168. package/src/model/ContentType.ts +7 -0
  169. package/es/KeyPerformanceIndicator/KeyPerformanceIndicator.js +0 -57
  170. package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.d.ts +0 -8
  171. package/lib/KeyPerformanceIndicator/KeyPerformanceIndicator.js +0 -62
  172. package/lib/KeyPerformanceIndicator/index.d.ts +0 -1
  173. package/lib/KeyPerformanceIndicator/index.js +0 -13
  174. 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,12 +269,15 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
272
273
  type: {
273
274
  image: string;
274
275
  video: string;
275
276
  audio: string;
276
277
  podcast: string;
277
278
  concept: string;
279
+ h5p: string;
280
+ external: string;
278
281
  };
279
282
  };
280
283
  common: {
@@ -1236,6 +1239,7 @@ declare const messages: {
1236
1239
  close: string;
1237
1240
  };
1238
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1239
1243
  };
1240
1244
  h5p: {
1241
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',
@@ -1257,12 +1258,15 @@ var messages = _objectSpread(_objectSpread({
1257
1258
  conceptListError: 'Failed to show concept list',
1258
1259
  linkError: 'Failed to show link.',
1259
1260
  unsupported: "Embed {{type}} not supported.",
1261
+ embedError: "An error occurred while loading the {{type}}. Try reloading the page.",
1260
1262
  type: {
1261
1263
  image: 'Image',
1262
1264
  video: 'Video',
1263
1265
  audio: 'Audio',
1264
1266
  podcast: 'Podcast',
1265
- concept: 'Concept'
1267
+ concept: 'Concept',
1268
+ h5p: 'H5P',
1269
+ external: 'External resource'
1266
1270
  }
1267
1271
  }
1268
1272
  });
@@ -269,12 +269,15 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
272
273
  type: {
273
274
  image: string;
274
275
  video: string;
275
276
  audio: string;
276
277
  podcast: string;
277
278
  concept: string;
279
+ h5p: string;
280
+ external: string;
278
281
  };
279
282
  };
280
283
  common: {
@@ -1236,6 +1239,7 @@ declare const messages: {
1236
1239
  close: string;
1237
1240
  };
1238
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1239
1243
  };
1240
1244
  h5p: {
1241
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',
@@ -1257,12 +1258,15 @@ var messages = _objectSpread(_objectSpread({
1257
1258
  conceptListError: 'Klarte ikke å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikke å vise lenke.',
1259
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.",
1260
1262
  type: {
1261
1263
  image: 'Bilde',
1262
1264
  video: 'Video',
1263
1265
  audio: 'Lyd',
1264
1266
  podcast: 'Podkast',
1265
- concept: 'Forklaring'
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1266
1270
  }
1267
1271
  }
1268
1272
  });
@@ -269,12 +269,15 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
272
273
  type: {
273
274
  image: string;
274
275
  video: string;
275
276
  audio: string;
276
277
  podcast: string;
277
278
  concept: string;
279
+ h5p: string;
280
+ external: string;
278
281
  };
279
282
  };
280
283
  common: {
@@ -1236,6 +1239,7 @@ declare const messages: {
1236
1239
  close: string;
1237
1240
  };
1238
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1239
1243
  };
1240
1244
  h5p: {
1241
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',
@@ -1257,12 +1258,15 @@ var messages = _objectSpread(_objectSpread({
1257
1258
  conceptListError: 'Klarte ikkje å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikkje å vise lenke.',
1259
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.",
1260
1262
  type: {
1261
1263
  image: 'Bilde',
1262
1264
  video: 'Video',
1263
1265
  audio: 'Lyd',
1264
1266
  podcast: 'Podkast',
1265
- concept: 'Forklaring'
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1266
1270
  }
1267
1271
  }
1268
1272
  });
@@ -269,12 +269,15 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
272
273
  type: {
273
274
  image: string;
274
275
  video: string;
275
276
  audio: string;
276
277
  podcast: string;
277
278
  concept: string;
279
+ h5p: string;
280
+ external: string;
278
281
  };
279
282
  };
280
283
  common: {
@@ -1236,6 +1239,7 @@ declare const messages: {
1236
1239
  close: string;
1237
1240
  };
1238
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1239
1243
  };
1240
1244
  h5p: {
1241
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',
@@ -1257,12 +1258,15 @@ var messages = _objectSpread(_objectSpread({
1257
1258
  conceptListError: 'Ii sáhttán čájehit čilgehuslisttu',
1258
1259
  linkError: 'Ii sáhttán čájehit liŋkka.',
1259
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.",
1260
1262
  type: {
1261
1263
  image: 'Bilde',
1262
1264
  video: 'Video',
1263
1265
  audio: 'Lyd',
1264
1266
  podcast: 'Podkast',
1265
- concept: 'Forklaring'
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1266
1270
  }
1267
1271
  }
1268
1272
  });
@@ -269,12 +269,15 @@ declare const messages: {
269
269
  conceptListError: string;
270
270
  linkError: string;
271
271
  unsupported: string;
272
+ embedError: string;
272
273
  type: {
273
274
  image: string;
274
275
  video: string;
275
276
  audio: string;
276
277
  podcast: string;
277
278
  concept: string;
279
+ h5p: string;
280
+ external: string;
278
281
  };
279
282
  };
280
283
  common: {
@@ -1236,6 +1239,7 @@ declare const messages: {
1236
1239
  close: string;
1237
1240
  };
1238
1241
  readMoreDescriptionLabel: string;
1242
+ readLessDescriptionLabel: string;
1239
1243
  };
1240
1244
  h5p: {
1241
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',
@@ -1257,12 +1258,15 @@ var messages = _objectSpread(_objectSpread({
1257
1258
  conceptListError: 'Klarte ikkje å vise forklaringsliste',
1258
1259
  linkError: 'Klarte ikkje å vise lenke.',
1259
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.",
1260
1262
  type: {
1261
1263
  image: 'Bilde',
1262
1264
  video: 'Video',
1263
1265
  audio: 'Lyd',
1264
1266
  podcast: 'Podkast',
1265
- concept: 'Forklaring'
1267
+ concept: 'Forklaring',
1268
+ h5p: 'H5P',
1269
+ external: 'Ekstern ressurs'
1266
1270
  }
1267
1271
  }
1268
1272
  });
@@ -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.2",
3
+ "version": "37.0.1",
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.1",
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": "486edbc7b92bc8fc182669cec1c259438215e3cc"
89
+ "gitHead": "38258e7be60bc71be478fe407775f43bfa505d7b"
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>