@ndla/ui 4.3.0 → 5.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 (177) hide show
  1. package/README.md +11 -11
  2. package/es/Article/Article.js +3 -7
  3. package/es/Article/ArticleByline.js +4 -4
  4. package/es/Article/ArticleNotions.js +37 -92
  5. package/es/ContentTypeBadge/ContentTypeBadge.js +10 -1
  6. package/es/FactBox/FactBox.js +36 -11
  7. package/es/Filter/FilterButtons.js +18 -17
  8. package/es/Filter/FilterCarousel.js +198 -0
  9. package/es/Masthead/Masthead.js +24 -2
  10. package/es/Notion/ConceptNotion.js +57 -0
  11. package/es/Notion/FigureNotion.js +82 -0
  12. package/es/Notion/Notion.js +122 -48
  13. package/es/Notion/NotionImage.js +47 -0
  14. package/es/Notion/NotionVisualElement.js +38 -0
  15. package/es/Notion/index.js +2 -1
  16. package/es/SearchTypeResult/ActiveFilterContent.js +17 -2
  17. package/es/SearchTypeResult/ActiveFilters.js +64 -50
  18. package/es/SearchTypeResult/PopupFilter.js +28 -125
  19. package/es/SearchTypeResult/ResultNavigation.js +41 -14
  20. package/es/SearchTypeResult/SearchFieldHeader.js +20 -41
  21. package/es/SearchTypeResult/SearchFilterContent.js +61 -0
  22. package/es/SearchTypeResult/SearchHeader.js +51 -28
  23. package/es/SearchTypeResult/SearchItem.js +64 -190
  24. package/es/SearchTypeResult/SearchItemList.js +132 -0
  25. package/es/SearchTypeResult/SearchItems.js +17 -13
  26. package/es/SearchTypeResult/SearchNotionItem.js +13 -13
  27. package/es/SearchTypeResult/SearchNotionsResult.js +16 -21
  28. package/es/SearchTypeResult/SearchTypeHeader.js +43 -26
  29. package/es/SearchTypeResult/SearchTypeResult.js +7 -5
  30. package/es/SearchTypeResult/SearchViewType.js +93 -0
  31. package/es/SearchTypeResult/components/ItemContexts.js +125 -0
  32. package/es/SearchTypeResult/components/ItemResourceHeader.js +87 -0
  33. package/es/SearchTypeResult/components/ItemTopicHeader.js +56 -0
  34. package/es/SearchTypeResult/components/SubjectFilters.js +177 -0
  35. package/es/SearchTypeResult/index.js +2 -1
  36. package/es/all.css +1 -1
  37. package/es/index-javascript.js +1 -2
  38. package/es/index.js +3 -2
  39. package/es/locale/messages-en.js +21 -6
  40. package/es/locale/messages-nb.js +21 -6
  41. package/es/locale/messages-nn.js +22 -7
  42. package/es/model/ContentType.js +2 -1
  43. package/es/shapes.js +1 -1
  44. package/lib/Article/Article.d.ts +4 -5
  45. package/lib/Article/Article.js +3 -7
  46. package/lib/Article/ArticleByline.js +4 -4
  47. package/lib/Article/ArticleNotions.d.ts +3 -8
  48. package/lib/Article/ArticleNotions.js +41 -90
  49. package/lib/ContentTypeBadge/ContentTypeBadge.d.ts +1 -0
  50. package/lib/ContentTypeBadge/ContentTypeBadge.js +14 -2
  51. package/lib/FactBox/FactBox.js +41 -8
  52. package/lib/Filter/FilterButtons.d.ts +3 -10
  53. package/lib/Filter/FilterButtons.js +19 -17
  54. package/lib/Filter/FilterCarousel.d.ts +13 -0
  55. package/lib/Filter/FilterCarousel.js +207 -0
  56. package/lib/Masthead/Masthead.js +30 -2
  57. package/lib/Notion/ConceptNotion.d.ts +25 -0
  58. package/lib/Notion/ConceptNotion.js +79 -0
  59. package/lib/Notion/FigureNotion.d.ts +23 -0
  60. package/lib/Notion/FigureNotion.js +97 -0
  61. package/lib/Notion/Notion.d.ts +24 -11
  62. package/lib/Notion/Notion.js +120 -48
  63. package/lib/Notion/NotionImage.d.ts +15 -0
  64. package/lib/Notion/NotionImage.js +63 -0
  65. package/lib/Notion/NotionVisualElement.d.ts +22 -0
  66. package/lib/Notion/NotionVisualElement.js +51 -0
  67. package/lib/Notion/index.d.ts +1 -0
  68. package/lib/Notion/index.js +8 -0
  69. package/lib/SearchTypeResult/ActiveFilterContent.js +16 -9
  70. package/lib/SearchTypeResult/ActiveFilters.d.ts +2 -1
  71. package/lib/SearchTypeResult/ActiveFilters.js +65 -50
  72. package/lib/SearchTypeResult/PopupFilter.d.ts +13 -19
  73. package/lib/SearchTypeResult/PopupFilter.js +27 -123
  74. package/lib/SearchTypeResult/ResultNavigation.d.ts +2 -2
  75. package/lib/SearchTypeResult/ResultNavigation.js +38 -14
  76. package/lib/SearchTypeResult/SearchFieldHeader.d.ts +3 -8
  77. package/lib/SearchTypeResult/SearchFieldHeader.js +18 -39
  78. package/lib/SearchTypeResult/SearchFilterContent.d.ts +16 -0
  79. package/lib/SearchTypeResult/SearchFilterContent.js +67 -0
  80. package/lib/SearchTypeResult/SearchHeader.d.ts +3 -7
  81. package/lib/SearchTypeResult/SearchHeader.js +59 -30
  82. package/lib/SearchTypeResult/SearchItem.d.ts +8 -12
  83. package/lib/SearchTypeResult/SearchItem.js +64 -187
  84. package/lib/SearchTypeResult/SearchItemList.d.ts +10 -0
  85. package/lib/SearchTypeResult/SearchItemList.js +139 -0
  86. package/lib/SearchTypeResult/SearchItems.d.ts +4 -3
  87. package/lib/SearchTypeResult/SearchItems.js +18 -13
  88. package/lib/SearchTypeResult/SearchNotionItem.js +13 -13
  89. package/lib/SearchTypeResult/SearchNotionsResult.d.ts +2 -4
  90. package/lib/SearchTypeResult/SearchNotionsResult.js +23 -23
  91. package/lib/SearchTypeResult/SearchTypeHeader.d.ts +2 -2
  92. package/lib/SearchTypeResult/SearchTypeHeader.js +40 -25
  93. package/lib/SearchTypeResult/SearchTypeResult.d.ts +7 -6
  94. package/lib/SearchTypeResult/SearchTypeResult.js +7 -5
  95. package/lib/SearchTypeResult/SearchViewType.d.ts +13 -0
  96. package/lib/SearchTypeResult/SearchViewType.js +99 -0
  97. package/lib/SearchTypeResult/components/ItemContexts.d.ts +19 -0
  98. package/lib/SearchTypeResult/components/ItemContexts.js +134 -0
  99. package/lib/SearchTypeResult/components/ItemResourceHeader.d.ts +16 -0
  100. package/lib/SearchTypeResult/components/ItemResourceHeader.js +98 -0
  101. package/lib/SearchTypeResult/components/ItemTopicHeader.d.ts +17 -0
  102. package/lib/SearchTypeResult/components/ItemTopicHeader.js +67 -0
  103. package/lib/SearchTypeResult/components/SubjectFilters.d.ts +32 -0
  104. package/lib/SearchTypeResult/components/SubjectFilters.js +192 -0
  105. package/lib/SearchTypeResult/index.d.ts +2 -1
  106. package/lib/SearchTypeResult/index.js +8 -0
  107. package/lib/all.css +1 -1
  108. package/lib/index-javascript.js +0 -20
  109. package/lib/index.d.ts +2 -1
  110. package/lib/index.js +24 -1
  111. package/lib/locale/messages-en.d.ts +16 -1
  112. package/lib/locale/messages-en.js +21 -6
  113. package/lib/locale/messages-nb.d.ts +15 -0
  114. package/lib/locale/messages-nb.js +21 -6
  115. package/lib/locale/messages-nn.d.ts +16 -1
  116. package/lib/locale/messages-nn.js +22 -7
  117. package/lib/model/ContentType.d.ts +1 -0
  118. package/lib/model/ContentType.js +4 -2
  119. package/lib/shapes.js +1 -1
  120. package/lib/types.d.ts +1 -0
  121. package/package.json +14 -15
  122. package/src/Article/Article.tsx +8 -15
  123. package/src/Article/ArticleByline.tsx +1 -1
  124. package/src/Article/ArticleNotions.tsx +13 -33
  125. package/src/ContentTypeBadge/ContentTypeBadge.tsx +8 -0
  126. package/src/ContentTypeBadge/component.content-type-badge.scss +5 -0
  127. package/src/FactBox/FactBox.tsx +22 -15
  128. package/src/Figure/component.figure.scss +1 -1
  129. package/src/Filter/FilterButtons.tsx +14 -15
  130. package/src/Filter/FilterCarousel.tsx +166 -0
  131. package/src/Masthead/Masthead.tsx +42 -18
  132. package/src/Notion/ConceptNotion.tsx +80 -0
  133. package/src/Notion/FigureNotion.tsx +86 -0
  134. package/src/Notion/Notion.tsx +205 -75
  135. package/src/Notion/NotionImage.tsx +51 -0
  136. package/src/Notion/NotionVisualElement.tsx +50 -0
  137. package/src/Notion/index.ts +1 -0
  138. package/src/SearchTypeResult/ActiveFilterContent.tsx +7 -2
  139. package/src/SearchTypeResult/ActiveFilters.tsx +72 -38
  140. package/src/SearchTypeResult/PopupFilter.tsx +73 -146
  141. package/src/SearchTypeResult/ResultNavigation.tsx +54 -16
  142. package/src/SearchTypeResult/SearchFieldHeader.tsx +15 -40
  143. package/src/SearchTypeResult/SearchFilterContent.tsx +63 -0
  144. package/src/SearchTypeResult/SearchHeader.tsx +31 -31
  145. package/src/SearchTypeResult/SearchItem.tsx +145 -233
  146. package/src/SearchTypeResult/SearchItemList.tsx +167 -0
  147. package/src/SearchTypeResult/SearchItems.tsx +26 -19
  148. package/src/SearchTypeResult/SearchNotionItem.tsx +5 -12
  149. package/src/SearchTypeResult/SearchNotionsResult.tsx +29 -22
  150. package/src/SearchTypeResult/SearchTypeHeader.tsx +51 -33
  151. package/src/SearchTypeResult/SearchTypeResult.tsx +13 -12
  152. package/src/SearchTypeResult/SearchViewType.tsx +109 -0
  153. package/src/SearchTypeResult/components/ItemContexts.tsx +138 -0
  154. package/src/SearchTypeResult/components/ItemResourceHeader.tsx +133 -0
  155. package/src/SearchTypeResult/components/ItemTopicHeader.tsx +95 -0
  156. package/src/SearchTypeResult/components/SubjectFilters.tsx +152 -0
  157. package/src/SearchTypeResult/index.ts +9 -1
  158. package/src/index-javascript.js +0 -2
  159. package/src/index.ts +3 -0
  160. package/src/locale/messages-en.ts +19 -4
  161. package/src/locale/messages-nb.ts +19 -4
  162. package/src/locale/messages-nn.ts +20 -5
  163. package/src/model/ContentType.ts +1 -0
  164. package/src/shapes.js +1 -0
  165. package/src/types.ts +1 -0
  166. package/es/Embedded/Facebook.js +0 -19
  167. package/es/Embedded/FacebookPage.js +0 -22
  168. package/es/Embedded/Twitter.js +0 -121
  169. package/es/Embedded/index.js +0 -3
  170. package/lib/Embedded/Facebook.js +0 -32
  171. package/lib/Embedded/FacebookPage.js +0 -35
  172. package/lib/Embedded/Twitter.js +0 -132
  173. package/lib/Embedded/index.js +0 -31
  174. package/src/Embedded/Facebook.jsx +0 -17
  175. package/src/Embedded/FacebookPage.jsx +0 -24
  176. package/src/Embedded/Twitter.jsx +0 -71
  177. package/src/Embedded/index.js +0 -3
@@ -116,6 +116,7 @@ const messages = {
116
116
  useFilter: 'Bruk filter',
117
117
  closeFilter: 'Lukk filter',
118
118
  removeFilter: 'Fjern filter {{filterName}}',
119
+ additionalSubjectFilters: '+ {{count}} fag',
119
120
  coreRelevance: 'Kjernestoff',
120
121
  supplementaryRelevance: 'Tilleggsstoff',
121
122
  resourceTypeFilter: {
@@ -124,20 +125,25 @@ const messages = {
124
125
  },
125
126
  },
126
127
  resultType: {
127
- showing: 'Viser {{fromCount}} til {{toCount}} av {{totalCount}}',
128
+ showing: 'Viser {{count}} av {{totalCount}} {{contentType}}',
129
+ showingAll: 'Viser alle',
128
130
  showMore: 'Vis mer',
129
131
  showAll: 'Vis alle',
132
+ toTopOfPage: 'Til toppen',
130
133
  toSubjectPageLabel: 'Gå til fagsiden',
131
134
  all: 'Alle',
132
- hits: '{{count}} Treff',
133
- showingSearchPhrase: 'Viser resultater for',
135
+ allContentTypes: 'Alle innholdstyper',
136
+ hits: '{{count}} treff',
137
+ showingSearchPhrase: 'Viser treff for',
134
138
  showingCompetenceGoalSearchPhrase: 'Viser resultater for kompetansemål {text}',
135
- searchPhraseSuggestion: 'Søk i stedet for',
139
+ searchPhraseSuggestion: 'Søk heller',
136
140
  notionLabels: 'Brukes i',
137
141
  notionsHeading: 'Begrepsforklaring',
138
142
  notionsRemove: 'Fjern',
139
143
  showVideo: 'Se video',
140
144
  showNotion: 'Se forklaring',
145
+ gridView: 'Gallerivisning',
146
+ listView: 'Listevisning',
141
147
  },
142
148
  contextModal: {
143
149
  button: '+ {{count}} flere steder',
@@ -546,6 +552,7 @@ const messages = {
546
552
  'source-material': 'Kildemateriale',
547
553
  'assessment-resources': 'Vurderingsressurs',
548
554
  topic: 'Emne',
555
+ 'multidisciplinary-topic': 'Tverrfaglig case',
549
556
  },
550
557
  modal: {
551
558
  closeModal: 'Lukk',
@@ -832,6 +839,9 @@ const messages = {
832
839
  },
833
840
  readMoreDescriptionLabel: 'vis mer',
834
841
  },
842
+ h5p: {
843
+ reuse: 'Bruk H5P',
844
+ },
835
845
  video: {
836
846
  download: 'Last ned video',
837
847
  reuse: 'Bruk video',
@@ -843,6 +853,7 @@ const messages = {
843
853
  },
844
854
  concept: {
845
855
  showDescription: 'Vis beskrivelsen av forklaringen.',
856
+ reuse: 'Bruk forklaring',
846
857
  error: {
847
858
  title: 'En feil oppstod',
848
859
  content: 'Kunne ikke laste beskrivelsen av forklaringen.',
@@ -893,6 +904,10 @@ const messages = {
893
904
  open: 'Åpne meny',
894
905
  close: 'Lukk meny',
895
906
  },
907
+ factbox: {
908
+ open: 'Åpne faktaboks',
909
+ close: 'Lukk faktaboks',
910
+ },
896
911
  };
897
912
 
898
913
  export default messages;
@@ -48,7 +48,7 @@ const messages = {
48
48
  subjectCategories: {
49
49
  [subjectCategories.ACTIVE_SUBJECTS]: 'Aktive',
50
50
  [subjectCategories.ARCHIVE_SUBJECTS]: 'Utgåtte',
51
- [subjectCategories.BETA_SUBJECTS]: 'Komande',
51
+ [subjectCategories.BETA_SUBJECTS]: 'Kommande',
52
52
  [subjectCategories.COMMON_SUBJECTS]: 'Fellesfag',
53
53
  [subjectCategories.PROGRAMME_SUBJECTS]: 'Programfag SF',
54
54
  [subjectCategories.SPECIALIZED_SUBJECTS]: 'Yrkesfag',
@@ -116,6 +116,7 @@ const messages = {
116
116
  useFilter: 'Bruk filter',
117
117
  removeFilter: 'Fjern filter {{filterName}}',
118
118
  closeFilter: 'Lukk filter',
119
+ additionalSubjectFilters: '+ {{count}} fag',
119
120
  coreRelevance: 'Kjernestoff',
120
121
  supplementaryRelevance: 'Tilleggsstoff',
121
122
  resourceTypeFilter: {
@@ -124,20 +125,25 @@ const messages = {
124
125
  },
125
126
  },
126
127
  resultType: {
127
- showing: 'Viser {{fromCount}} til {{toCount}} av {{totalCount}}',
128
+ showing: 'Viser {{count}} av {{totalCount}} {{contentType}}',
129
+ showingAll: 'Viser alle',
128
130
  showMore: 'Vis meir',
129
131
  showAll: 'Vis alle',
132
+ toTopOfPage: 'Til toppen',
130
133
  toSubjectPageLabel: 'Gå til fagsida',
131
134
  all: 'Alle',
132
- hits: '{{count}} Treff',
133
- showingSearchPhrase: 'Viser resultat for',
135
+ allContentTypes: 'Alle innhaldstyper',
136
+ hits: '{{count}} treff',
137
+ showingSearchPhrase: 'Viser treff for',
138
+ searchPhraseSuggestion: 'Søk heller',
134
139
  showingCompetenceGoalSearchPhrase: 'Viser resultat for kompetansemål {text}',
135
- searchPhraseSuggestion: 'Søk i staden for',
136
140
  notionLabels: 'Brukes i',
137
141
  notionsHeading: 'Begrepsforklaring',
138
142
  notionsRemove: 'Fjern',
139
143
  showVideo: 'Sjå video',
140
144
  showNotion: 'Sjå forklaring',
145
+ gridView: 'Gallerivisning',
146
+ listView: 'Listevisning',
141
147
  },
142
148
  contextModal: {
143
149
  button: '+ {{count}} fleire stader',
@@ -547,6 +553,7 @@ const messages = {
547
553
  'source-material': 'Kjeldemateriale',
548
554
  'assessment-resources': 'Vurderingsressurs',
549
555
  topic: 'Emne',
556
+ 'multidisciplinary-topic': 'Tverrfagleg case',
550
557
  },
551
558
  modal: {
552
559
  closeModal: 'Lukk',
@@ -833,6 +840,9 @@ const messages = {
833
840
  },
834
841
  readMoreDescriptionLabel: 'vis meir',
835
842
  },
843
+ h5p: {
844
+ reuse: 'Bruk H5P',
845
+ },
836
846
  video: {
837
847
  download: 'Last ned video',
838
848
  reuse: 'Bruk video',
@@ -844,6 +854,7 @@ const messages = {
844
854
  },
845
855
  concept: {
846
856
  showDescription: 'Vis skildring av forklaringa',
857
+ reuse: 'Bruk forklaring',
847
858
  error: {
848
859
  title: 'Ein feil oppstod',
849
860
  content: 'Kunne ikkje laste skildringa av forklaringa.',
@@ -894,6 +905,10 @@ const messages = {
894
905
  open: 'Åpne meny',
895
906
  close: 'Lukk meny',
896
907
  },
908
+ factbox: {
909
+ open: 'Åpne faktaboks',
910
+ close: 'Lukk faktaboks',
911
+ },
897
912
  };
898
913
 
899
914
  export default messages;
@@ -14,3 +14,4 @@ export const EXTERNAL_LEARNING_RESOURCES = 'external-learning-resources';
14
14
  export const SOURCE_MATERIAL = 'source-material';
15
15
  export const LEARNING_PATH = 'learning-path';
16
16
  export const TOPIC = 'topic';
17
+ export const MULTIDISCIPLINARY_TOPIC = 'multidisciplinary-topic';
package/src/shapes.js CHANGED
@@ -78,6 +78,7 @@ export const ContentTypeShape = PropTypes.oneOf([
78
78
  contentTypes.SOURCE_MATERIAL,
79
79
  contentTypes.LEARNING_PATH,
80
80
  contentTypes.TOPIC,
81
+ contentTypes.MULTIDISCIPLINARY_TOPIC,
81
82
  'beta',
82
83
  'ndla-film',
83
84
  'ndla-film has-image',
package/src/types.ts CHANGED
@@ -52,6 +52,7 @@ export interface Copyright {
52
52
  creators: Array<Contributor>;
53
53
  rightsholders: Array<Contributor>;
54
54
  processors: Array<Contributor>;
55
+ origin?: string;
55
56
  }
56
57
 
57
58
  export interface FootNote {
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FacebookProvider, EmbeddedPost } from 'react-facebook';
4
- import { jsx as ___EmotionJSX } from "@emotion/core";
5
-
6
- var EmbeddedFacebook = function EmbeddedFacebook(props) {
7
- return ___EmotionJSX("div", null, ___EmotionJSX(FacebookProvider, {
8
- appId: "155745961798881"
9
- }, ___EmotionJSX(EmbeddedPost, {
10
- href: props.href,
11
- className: "fb-embedded",
12
- width: ""
13
- })));
14
- };
15
-
16
- EmbeddedFacebook.propTypes = {
17
- href: PropTypes.string.isRequired
18
- };
19
- export default EmbeddedFacebook;
@@ -1,22 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FacebookProvider, Page } from 'react-facebook';
4
- import { jsx as ___EmotionJSX } from "@emotion/core";
5
-
6
- var EmbeddedFacebookPage = function EmbeddedFacebookPage(props) {
7
- return ___EmotionJSX("div", null, ___EmotionJSX(FacebookProvider, {
8
- appId: "155745961798881"
9
- }, ___EmotionJSX(Page, {
10
- href: props.href,
11
- height: props.height || 500,
12
- tabs: "timeline",
13
- className: "fb-embedded",
14
- adaptContainerWidth: true
15
- })));
16
- };
17
-
18
- EmbeddedFacebookPage.propTypes = {
19
- href: PropTypes.string.isRequired,
20
- height: PropTypes.number
21
- };
22
- export default EmbeddedFacebookPage;
@@ -1,121 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
2
-
3
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
-
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
6
-
7
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
8
-
9
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
10
-
11
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
12
-
13
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
14
-
15
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
16
-
17
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
18
-
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
20
-
21
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
22
-
23
- import { Component, createElement } from 'react';
24
- import PropTypes from 'prop-types';
25
-
26
- var EmbeddedTwitter = /*#__PURE__*/function (_Component) {
27
- _inherits(EmbeddedTwitter, _Component);
28
-
29
- var _super = _createSuper(EmbeddedTwitter);
30
-
31
- _createClass(EmbeddedTwitter, null, [{
32
- key: "removeChildren",
33
- value: function removeChildren(node) {
34
- if (node) {
35
- while (node.firstChild) {
36
- node.removeChild(node.firstChild);
37
- }
38
- }
39
- }
40
- }]);
41
-
42
- function EmbeddedTwitter(props) {
43
- var _this;
44
-
45
- _classCallCheck(this, EmbeddedTwitter);
46
-
47
- _this = _super.call(this, props);
48
- _this.loadWidget = _this.loadWidget.bind(_assertThisInitialized(_this));
49
- return _this;
50
- }
51
-
52
- _createClass(EmbeddedTwitter, [{
53
- key: "componentDidMount",
54
- value: function componentDidMount() {
55
- if (window.twttr) {
56
- this.loadWidget();
57
- }
58
- }
59
- }, {
60
- key: "shouldComponentUpdate",
61
- value: function shouldComponentUpdate(nextProps) {
62
- return this.props.screenName !== nextProps.screenName;
63
- }
64
- }, {
65
- key: "componentDidUpdate",
66
- value: function componentDidUpdate() {
67
- if (window.twttr) {
68
- this.loadWidget();
69
- }
70
- }
71
- }, {
72
- key: "componentWillUnmount",
73
- value: function componentWillUnmount() {
74
- EmbeddedTwitter.removeChildren(this.widgetWrapper);
75
- }
76
- }, {
77
- key: "loadWidget",
78
- value: function loadWidget() {
79
- var _this2 = this;
80
-
81
- window.twttr.ready(function (tw) {
82
- // Delete existing
83
- EmbeddedTwitter.removeChildren(_this2.widgetWrapper);
84
- var _this2$props = _this2.props,
85
- screenName = _this2$props.screenName,
86
- tweetLimit = _this2$props.tweetLimit; // Create widget
87
-
88
- tw.widgets.createTimeline({
89
- sourceType: 'profile',
90
- screenName: screenName
91
- }, _this2.widgetWrapper, {
92
- tweetLimit: tweetLimit,
93
- chrome: 'noheader nofooter noborders',
94
- borderColor: '#e8e3e3'
95
- });
96
- });
97
- }
98
- }, {
99
- key: "render",
100
- value: function render() {
101
- var _this3 = this;
102
-
103
- return /*#__PURE__*/createElement('div', {
104
- ref: function ref(c) {
105
- _this3.widgetWrapper = c;
106
- }
107
- });
108
- }
109
- }]);
110
-
111
- return EmbeddedTwitter;
112
- }(Component);
113
-
114
- EmbeddedTwitter.propTypes = {
115
- screenName: PropTypes.string.isRequired,
116
- tweetLimit: PropTypes.number
117
- };
118
- EmbeddedTwitter.defaultProps = {
119
- tweetLimit: 10
120
- };
121
- export default EmbeddedTwitter;
@@ -1,3 +0,0 @@
1
- export { default as EmbeddedTwitter } from './Twitter';
2
- export { default as EmbeddedFacebook } from './Facebook';
3
- export { default as EmbeddedFacebookPage } from './FacebookPage';
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _reactFacebook = require("react-facebook");
13
-
14
- var _core = require("@emotion/core");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
- var EmbeddedFacebook = function EmbeddedFacebook(props) {
19
- return (0, _core.jsx)("div", null, (0, _core.jsx)(_reactFacebook.FacebookProvider, {
20
- appId: "155745961798881"
21
- }, (0, _core.jsx)(_reactFacebook.EmbeddedPost, {
22
- href: props.href,
23
- className: "fb-embedded",
24
- width: ""
25
- })));
26
- };
27
-
28
- EmbeddedFacebook.propTypes = {
29
- href: _propTypes["default"].string.isRequired
30
- };
31
- var _default = EmbeddedFacebook;
32
- exports["default"] = _default;
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = _interopRequireDefault(require("react"));
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- var _reactFacebook = require("react-facebook");
13
-
14
- var _core = require("@emotion/core");
15
-
16
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
17
-
18
- var EmbeddedFacebookPage = function EmbeddedFacebookPage(props) {
19
- return (0, _core.jsx)("div", null, (0, _core.jsx)(_reactFacebook.FacebookProvider, {
20
- appId: "155745961798881"
21
- }, (0, _core.jsx)(_reactFacebook.Page, {
22
- href: props.href,
23
- height: props.height || 500,
24
- tabs: "timeline",
25
- className: "fb-embedded",
26
- adaptContainerWidth: true
27
- })));
28
- };
29
-
30
- EmbeddedFacebookPage.propTypes = {
31
- href: _propTypes["default"].string.isRequired,
32
- height: _propTypes["default"].number
33
- };
34
- var _default = EmbeddedFacebookPage;
35
- exports["default"] = _default;
@@ -1,132 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = void 0;
7
-
8
- var _react = require("react");
9
-
10
- var _propTypes = _interopRequireDefault(require("prop-types"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
13
-
14
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
15
-
16
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
17
-
18
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
19
-
20
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
21
-
22
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
23
-
24
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
25
-
26
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
27
-
28
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
29
-
30
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
31
-
32
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
33
-
34
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
35
-
36
- var EmbeddedTwitter = /*#__PURE__*/function (_Component) {
37
- _inherits(EmbeddedTwitter, _Component);
38
-
39
- var _super = _createSuper(EmbeddedTwitter);
40
-
41
- _createClass(EmbeddedTwitter, null, [{
42
- key: "removeChildren",
43
- value: function removeChildren(node) {
44
- if (node) {
45
- while (node.firstChild) {
46
- node.removeChild(node.firstChild);
47
- }
48
- }
49
- }
50
- }]);
51
-
52
- function EmbeddedTwitter(props) {
53
- var _this;
54
-
55
- _classCallCheck(this, EmbeddedTwitter);
56
-
57
- _this = _super.call(this, props);
58
- _this.loadWidget = _this.loadWidget.bind(_assertThisInitialized(_this));
59
- return _this;
60
- }
61
-
62
- _createClass(EmbeddedTwitter, [{
63
- key: "componentDidMount",
64
- value: function componentDidMount() {
65
- if (window.twttr) {
66
- this.loadWidget();
67
- }
68
- }
69
- }, {
70
- key: "shouldComponentUpdate",
71
- value: function shouldComponentUpdate(nextProps) {
72
- return this.props.screenName !== nextProps.screenName;
73
- }
74
- }, {
75
- key: "componentDidUpdate",
76
- value: function componentDidUpdate() {
77
- if (window.twttr) {
78
- this.loadWidget();
79
- }
80
- }
81
- }, {
82
- key: "componentWillUnmount",
83
- value: function componentWillUnmount() {
84
- EmbeddedTwitter.removeChildren(this.widgetWrapper);
85
- }
86
- }, {
87
- key: "loadWidget",
88
- value: function loadWidget() {
89
- var _this2 = this;
90
-
91
- window.twttr.ready(function (tw) {
92
- // Delete existing
93
- EmbeddedTwitter.removeChildren(_this2.widgetWrapper);
94
- var _this2$props = _this2.props,
95
- screenName = _this2$props.screenName,
96
- tweetLimit = _this2$props.tweetLimit; // Create widget
97
-
98
- tw.widgets.createTimeline({
99
- sourceType: 'profile',
100
- screenName: screenName
101
- }, _this2.widgetWrapper, {
102
- tweetLimit: tweetLimit,
103
- chrome: 'noheader nofooter noborders',
104
- borderColor: '#e8e3e3'
105
- });
106
- });
107
- }
108
- }, {
109
- key: "render",
110
- value: function render() {
111
- var _this3 = this;
112
-
113
- return /*#__PURE__*/(0, _react.createElement)('div', {
114
- ref: function ref(c) {
115
- _this3.widgetWrapper = c;
116
- }
117
- });
118
- }
119
- }]);
120
-
121
- return EmbeddedTwitter;
122
- }(_react.Component);
123
-
124
- EmbeddedTwitter.propTypes = {
125
- screenName: _propTypes["default"].string.isRequired,
126
- tweetLimit: _propTypes["default"].number
127
- };
128
- EmbeddedTwitter.defaultProps = {
129
- tweetLimit: 10
130
- };
131
- var _default = EmbeddedTwitter;
132
- exports["default"] = _default;
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "EmbeddedTwitter", {
7
- enumerable: true,
8
- get: function get() {
9
- return _Twitter["default"];
10
- }
11
- });
12
- Object.defineProperty(exports, "EmbeddedFacebook", {
13
- enumerable: true,
14
- get: function get() {
15
- return _Facebook["default"];
16
- }
17
- });
18
- Object.defineProperty(exports, "EmbeddedFacebookPage", {
19
- enumerable: true,
20
- get: function get() {
21
- return _FacebookPage["default"];
22
- }
23
- });
24
-
25
- var _Twitter = _interopRequireDefault(require("./Twitter"));
26
-
27
- var _Facebook = _interopRequireDefault(require("./Facebook"));
28
-
29
- var _FacebookPage = _interopRequireDefault(require("./FacebookPage"));
30
-
31
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FacebookProvider, EmbeddedPost } from 'react-facebook';
4
-
5
- const EmbeddedFacebook = (props) => (
6
- <div>
7
- <FacebookProvider appId="155745961798881">
8
- <EmbeddedPost href={props.href} className="fb-embedded" width="" />
9
- </FacebookProvider>
10
- </div>
11
- );
12
-
13
- EmbeddedFacebook.propTypes = {
14
- href: PropTypes.string.isRequired,
15
- };
16
-
17
- export default EmbeddedFacebook;
@@ -1,24 +0,0 @@
1
- import React from 'react';
2
- import PropTypes from 'prop-types';
3
- import { FacebookProvider, Page } from 'react-facebook';
4
-
5
- const EmbeddedFacebookPage = (props) => (
6
- <div>
7
- <FacebookProvider appId="155745961798881">
8
- <Page
9
- href={props.href}
10
- height={props.height || 500}
11
- tabs="timeline"
12
- className="fb-embedded"
13
- adaptContainerWidth={true}
14
- />
15
- </FacebookProvider>
16
- </div>
17
- );
18
-
19
- EmbeddedFacebookPage.propTypes = {
20
- href: PropTypes.string.isRequired,
21
- height: PropTypes.number,
22
- };
23
-
24
- export default EmbeddedFacebookPage;