@mjhls/mjh-framework 1.0.684-beta.1 → 1.0.684

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 (151) hide show
  1. package/dist/cjs/AD.js +1 -1
  2. package/dist/cjs/AD300x250.js +3 -3
  3. package/dist/cjs/AD300x250x600.js +3 -3
  4. package/dist/cjs/AD728x90.js +4 -4
  5. package/dist/cjs/ADFloatingFooter.js +2 -2
  6. package/dist/cjs/ADGutter.js +2 -2
  7. package/dist/cjs/ADSkyscraper.js +2 -2
  8. package/dist/cjs/ADSponsoredResources.js +2 -2
  9. package/dist/cjs/ADWebcast.js +2 -2
  10. package/dist/cjs/ADWelcome.js +2 -2
  11. package/dist/cjs/AdSlot.js +2 -2
  12. package/dist/cjs/AdSlotsProvider.js +1 -1
  13. package/dist/cjs/ArticleCarousel.js +1 -1
  14. package/dist/cjs/ArticleSeriesListing.js +4 -4
  15. package/dist/cjs/Auth.js +507 -256
  16. package/dist/cjs/{BlockContent-091a991f.js → BlockContent-88f69acd.js} +1 -1
  17. package/dist/cjs/BrowseVideosListing.js +1 -1
  18. package/dist/cjs/CMEDeck.js +5 -5
  19. package/dist/cjs/Column3.js +4 -4
  20. package/dist/cjs/ConferenceArticleCard.js +2 -2
  21. package/dist/cjs/DeckContent.js +7 -7
  22. package/dist/cjs/DeckQueue.js +6 -6
  23. package/dist/cjs/{Dfp-f6a18ed2.js → Dfp-b2bc3b97.js} +1 -1
  24. package/dist/cjs/EventsDeck.js +4 -4
  25. package/dist/cjs/ExternalResources.js +7 -7
  26. package/dist/cjs/Feature.js +3 -3
  27. package/dist/cjs/ForbesHero.js +2 -2
  28. package/dist/cjs/GridContent.js +10 -10
  29. package/dist/cjs/GridHero.js +2 -2
  30. package/dist/cjs/GroupDeck.js +1 -1
  31. package/dist/cjs/HamMagazine.js +4 -4
  32. package/dist/cjs/Hero.js +1 -1
  33. package/dist/cjs/HorizontalHero.js +2 -2
  34. package/dist/cjs/IssueContentDeck.js +2 -2
  35. package/dist/cjs/IssueDeck.js +2 -2
  36. package/dist/cjs/IssueLanding.js +7 -7
  37. package/dist/cjs/LeftNav.js +2 -2
  38. package/dist/cjs/MasterDeck.js +7 -7
  39. package/dist/cjs/NavMagazine.js +4 -4
  40. package/dist/cjs/NavNative.js +3 -3
  41. package/dist/cjs/OncliveHero.js +2 -2
  42. package/dist/cjs/OncliveLargeHero.js +2 -2
  43. package/dist/cjs/PartnerDetailListing.js +15 -1212
  44. package/dist/cjs/PublicationDeck.js +1 -1
  45. package/dist/cjs/QueueDeckExpanded.js +9 -9
  46. package/dist/cjs/RecentNews.js +2 -2
  47. package/dist/cjs/RelatedContent.js +2 -2
  48. package/dist/cjs/{SocialSearchComponent-9cd24578.js → SocialSearchComponent-6b5e5b47.js} +5 -5
  49. package/dist/cjs/TaxonomyCard.js +2 -2
  50. package/dist/cjs/TemplateNormal.js +3 -3
  51. package/dist/cjs/ThumbnailCard.js +1 -1
  52. package/dist/cjs/Ustream.js +2 -2
  53. package/dist/cjs/VerticalHero.js +2 -2
  54. package/dist/cjs/VideoSeriesCard.js +2 -2
  55. package/dist/cjs/VideoSeriesListing.js +3 -3
  56. package/dist/cjs/View.js +137 -532
  57. package/dist/cjs/YahooHero.js +2 -2
  58. package/dist/cjs/YoutubeGroup.js +1 -1
  59. package/dist/cjs/getQuery.js +2 -2
  60. package/dist/cjs/getRelatedArticle.js +5 -354
  61. package/dist/cjs/getSerializers.js +6 -6
  62. package/dist/cjs/{getTargeting-9af0ef69.js → getTargeting-fee8c429.js} +2 -2
  63. package/dist/cjs/getTargeting.js +1 -1
  64. package/dist/cjs/{index-fa8ed292.js → index-2d0a4911.js} +34 -27
  65. package/dist/cjs/{index-3294d3bc.js → index-5be2866f.js} +1 -1
  66. package/dist/cjs/{index-c49c3b5e.js → index-8c9e8ca7.js} +462 -450
  67. package/dist/cjs/{index-be0c82be.js → index-b5eb3ff8.js} +20 -19
  68. package/dist/cjs/{index.es-9110add6.js → index.es-ab3f2690.js} +3 -1
  69. package/dist/cjs/index.js +16 -15
  70. package/dist/cjs/{main-a4cb15bb.js → main-b6c96c8d.js} +67 -36
  71. package/dist/cjs/{moment-575fe24c.js → moment-66a6a284.js} +1 -1
  72. package/dist/cjs/timeDifferenceCalc.js +1 -1
  73. package/dist/cjs/urlFor.js +1 -1
  74. package/dist/esm/AD.js +1 -1
  75. package/dist/esm/AD300x250.js +3 -3
  76. package/dist/esm/AD300x250x600.js +3 -3
  77. package/dist/esm/AD728x90.js +4 -4
  78. package/dist/esm/ADFloatingFooter.js +2 -2
  79. package/dist/esm/ADGutter.js +2 -2
  80. package/dist/esm/ADSkyscraper.js +2 -2
  81. package/dist/esm/ADSponsoredResources.js +2 -2
  82. package/dist/esm/ADWebcast.js +2 -2
  83. package/dist/esm/ADWelcome.js +2 -2
  84. package/dist/esm/AdSlot.js +2 -2
  85. package/dist/esm/AdSlotsProvider.js +1 -1
  86. package/dist/esm/ArticleCarousel.js +1 -1
  87. package/dist/esm/ArticleSeriesListing.js +4 -4
  88. package/dist/esm/Auth.js +499 -248
  89. package/dist/esm/{BlockContent-e9b4ddcf.js → BlockContent-a614acdf.js} +1 -1
  90. package/dist/esm/BrowseVideosListing.js +1 -1
  91. package/dist/esm/CMEDeck.js +5 -5
  92. package/dist/esm/Column3.js +4 -4
  93. package/dist/esm/ConferenceArticleCard.js +2 -2
  94. package/dist/esm/DeckContent.js +7 -7
  95. package/dist/esm/DeckQueue.js +6 -6
  96. package/dist/esm/{Dfp-96b49def.js → Dfp-8a8fca18.js} +1 -1
  97. package/dist/esm/EventsDeck.js +4 -4
  98. package/dist/esm/ExternalResources.js +7 -7
  99. package/dist/esm/Feature.js +3 -3
  100. package/dist/esm/ForbesHero.js +2 -2
  101. package/dist/esm/GridContent.js +10 -10
  102. package/dist/esm/GridHero.js +2 -2
  103. package/dist/esm/GroupDeck.js +1 -1
  104. package/dist/esm/HamMagazine.js +4 -4
  105. package/dist/esm/Hero.js +1 -1
  106. package/dist/esm/HorizontalHero.js +2 -2
  107. package/dist/esm/IssueContentDeck.js +2 -2
  108. package/dist/esm/IssueDeck.js +2 -2
  109. package/dist/esm/IssueLanding.js +7 -7
  110. package/dist/esm/LeftNav.js +2 -2
  111. package/dist/esm/MasterDeck.js +7 -7
  112. package/dist/esm/NavMagazine.js +4 -4
  113. package/dist/esm/NavNative.js +3 -3
  114. package/dist/esm/OncliveHero.js +2 -2
  115. package/dist/esm/OncliveLargeHero.js +2 -2
  116. package/dist/esm/PartnerDetailListing.js +13 -1209
  117. package/dist/esm/PublicationDeck.js +1 -1
  118. package/dist/esm/QueueDeckExpanded.js +9 -9
  119. package/dist/esm/RecentNews.js +2 -2
  120. package/dist/esm/RelatedContent.js +2 -2
  121. package/dist/esm/{SocialSearchComponent-93233334.js → SocialSearchComponent-7f14e0f3.js} +5 -5
  122. package/dist/esm/TaxonomyCard.js +2 -2
  123. package/dist/esm/TemplateNormal.js +3 -3
  124. package/dist/esm/ThumbnailCard.js +1 -1
  125. package/dist/esm/Ustream.js +2 -2
  126. package/dist/esm/VerticalHero.js +2 -2
  127. package/dist/esm/VideoSeriesCard.js +2 -2
  128. package/dist/esm/VideoSeriesListing.js +3 -3
  129. package/dist/esm/View.js +117 -512
  130. package/dist/esm/YahooHero.js +2 -2
  131. package/dist/esm/YoutubeGroup.js +1 -1
  132. package/dist/esm/getQuery.js +2 -2
  133. package/dist/esm/getRelatedArticle.js +5 -354
  134. package/dist/esm/getSerializers.js +6 -6
  135. package/dist/esm/{index-73819142.js → index-51a80699.js} +20 -19
  136. package/dist/esm/{index-85783f24.js → index-5505d4f9.js} +462 -450
  137. package/dist/esm/{index-0e45a0b2.js → index-93ec3c59.js} +34 -27
  138. package/dist/esm/{index-ef6d5dcf.js → index-d2f90501.js} +1 -1
  139. package/dist/esm/{index.es-29c1cef5.js → index.es-938a3a58.js} +3 -1
  140. package/dist/esm/index.js +14 -13
  141. package/dist/esm/{main-5d1e4bd3.js → main-0465b2a0.js} +65 -34
  142. package/dist/esm/{moment-e2f9b20c.js → moment-12415288.js} +1 -1
  143. package/dist/esm/timeDifferenceCalc.js +1 -1
  144. package/dist/esm/urlFor.js +1 -1
  145. package/package.json +1 -1
  146. package/dist/cjs/index-bd6c9f56.js +0 -211
  147. package/dist/esm/index-db3bb315.js +0 -207
  148. /package/dist/cjs/{ADInfeed-f27bc4b5.js → ADInfeed-c676389b.js} +0 -0
  149. /package/dist/cjs/{ADlgInfeed-8decfd9e.js → ADlgInfeed-57d63c87.js} +0 -0
  150. /package/dist/esm/{ADInfeed-1e0ca5e0.js → ADInfeed-97b8cea7.js} +0 -0
  151. /package/dist/esm/{ADlgInfeed-979cf0d5.js → ADlgInfeed-3ab91c75.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
1
+ import './_commonjsHelpers-0c4b6f40.js';
2
2
  import './_to-object-ded78eb9.js';
3
3
  import './es6.string.iterator-9b2af4a5.js';
4
4
  import './_library-528f1934.js';
@@ -13,22 +13,22 @@ import './define-property-de3fc946.js';
13
13
  import './web.dom.iterable-8956f9a5.js';
14
14
  import './typeof-08f2c380.js';
15
15
  import './_is-array-49698029.js';
16
- import React__default, { Component, useRef, useState, useEffect } from 'react';
17
- import './index-0e45a0b2.js';
18
- import PropTypes from 'prop-types';
16
+ import React__default, { useRef, useState, useEffect } from 'react';
17
+ import './index-93ec3c59.js';
18
+ import 'prop-types';
19
19
  import 'react-bootstrap/Row';
20
20
  import 'react-bootstrap/Col';
21
21
  import 'react-bootstrap/Card';
22
- import { m as moment } from './moment-e2f9b20c.js';
22
+ import { m as moment } from './moment-12415288.js';
23
23
  import 'next/router';
24
24
  import './isSymbol-807e927e.js';
25
25
  import './debounce-1a993acf.js';
26
- import './index.es-29c1cef5.js';
26
+ import './index.es-938a3a58.js';
27
27
  import 'react-dom';
28
28
  import './visibility-sensor-0baa4eea.js';
29
- import { i as imageUrlBuilder } from './index-73819142.js';
29
+ import { i as imageUrlBuilder } from './index-51a80699.js';
30
30
  import './index-5f9f807a.js';
31
- import './main-5d1e4bd3.js';
31
+ import './main-0465b2a0.js';
32
32
  import './entities-7cc3bf45.js';
33
33
  import './stringify-008c8802.js';
34
34
  import { _ as _slicedToArray } from './slicedToArray-7021e5df.js';
@@ -36,19 +36,19 @@ import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './async
36
36
  import './_set-species-cede29f8.js';
37
37
  import './beam-681a9749.js';
38
38
  import './AdSlot.js';
39
- import './ADInfeed-1e0ca5e0.js';
39
+ import './ADInfeed-97b8cea7.js';
40
40
  import './lodash-17fdfebb.js';
41
- import './ADlgInfeed-979cf0d5.js';
41
+ import './ADlgInfeed-3ab91c75.js';
42
42
  import './getContentCategory-15dcc413.js';
43
43
  import './AuthorComponent-00f13201.js';
44
- import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
44
+ import { B as BlockContent } from './BlockContent-a614acdf.js';
45
45
  import { s as smoothscroll } from './smoothscroll-4b699764.js';
46
46
  import './GroupDeck.js';
47
47
  import 'react-bootstrap';
48
48
  import './timeDifferenceCalc.js';
49
49
  import QueueDeckExpanded from './QueueDeckExpanded.js';
50
50
  import 'react-bootstrap/Button';
51
- import { g as getSerializers } from './index-85783f24.js';
51
+ import { g as getSerializers } from './index-5505d4f9.js';
52
52
  import './util-7700fc59.js';
53
53
  import './brightcove-react-player-loader.es-83f53e4e.js';
54
54
  import 'react-bootstrap/Pagination';
@@ -58,1203 +58,7 @@ import Feature from './Feature.js';
58
58
  import 'react-bootstrap/Breadcrumb';
59
59
  import Breadcrumbs from './Breadcrumbs.js';
60
60
  import urlFor from './urlFor.js';
61
-
62
- function _classCallCheck(instance, Constructor) {
63
- if (!(instance instanceof Constructor)) {
64
- throw new TypeError("Cannot call a class as a function");
65
- }
66
- }
67
-
68
- function _defineProperties(target, props) {
69
- for (var i = 0; i < props.length; i++) {
70
- var descriptor = props[i];
71
- descriptor.enumerable = descriptor.enumerable || false;
72
- descriptor.configurable = true;
73
- if ("value" in descriptor) descriptor.writable = true;
74
- Object.defineProperty(target, descriptor.key, descriptor);
75
- }
76
- }
77
-
78
- function _createClass(Constructor, protoProps, staticProps) {
79
- if (protoProps) _defineProperties(Constructor.prototype, protoProps);
80
- if (staticProps) _defineProperties(Constructor, staticProps);
81
- return Constructor;
82
- }
83
-
84
- function _typeof2(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof2 = function _typeof2(obj) { return typeof obj; }; } else { _typeof2 = function _typeof2(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof2(obj); }
85
-
86
- function _typeof(obj) {
87
- if (typeof Symbol === "function" && _typeof2(Symbol.iterator) === "symbol") {
88
- _typeof = function _typeof(obj) {
89
- return _typeof2(obj);
90
- };
91
- } else {
92
- _typeof = function _typeof(obj) {
93
- return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : _typeof2(obj);
94
- };
95
- }
96
-
97
- return _typeof(obj);
98
- }
99
-
100
- function _assertThisInitialized(self) {
101
- if (self === void 0) {
102
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
103
- }
104
-
105
- return self;
106
- }
107
-
108
- function _possibleConstructorReturn(self, call) {
109
- if (call && (_typeof(call) === "object" || typeof call === "function")) {
110
- return call;
111
- }
112
-
113
- return _assertThisInitialized(self);
114
- }
115
-
116
- function _getPrototypeOf(o) {
117
- _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
118
- return o.__proto__ || Object.getPrototypeOf(o);
119
- };
120
- return _getPrototypeOf(o);
121
- }
122
-
123
- function _setPrototypeOf(o, p) {
124
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
125
- o.__proto__ = p;
126
- return o;
127
- };
128
-
129
- return _setPrototypeOf(o, p);
130
- }
131
-
132
- function _inherits(subClass, superClass) {
133
- if (typeof superClass !== "function" && superClass !== null) {
134
- throw new TypeError("Super expression must either be null or a function");
135
- }
136
-
137
- subClass.prototype = Object.create(superClass && superClass.prototype, {
138
- constructor: {
139
- value: subClass,
140
- writable: true,
141
- configurable: true
142
- }
143
- });
144
- if (superClass) _setPrototypeOf(subClass, superClass);
145
- }
146
-
147
- function _defineProperty(obj, key, value) {
148
- if (key in obj) {
149
- Object.defineProperty(obj, key, {
150
- value: value,
151
- enumerable: true,
152
- configurable: true,
153
- writable: true
154
- });
155
- } else {
156
- obj[key] = value;
157
- }
158
-
159
- return obj;
160
- }
161
-
162
- var isRequiredIf_1 = createCommonjsModule(function (module, exports) {
163
- Object.defineProperty(exports,'__esModule',{value:!0});var VALIDATOR_ARG_ERROR_MESSAGE='The typeValidator argument must be a function with the signature function(props, propName, componentName).',MESSAGE_ARG_ERROR_MESSAGE='The error message is optional, but must be a string if provided.',propIsRequired=function propIsRequired(a,b,c,d){if('boolean'==typeof a)return a;return 'function'==typeof a?a(b,c,d):!(!0!==!!a)&&!!a},propExists=function propExists(a,b){return Object.hasOwnProperty.call(a,b)},missingPropError=function missingPropError(a,b,c,d){return d?new Error(d):new Error('Required '+a[b]+' `'+b+'`'+(' was not specified in `'+c+'`.'))},guardAgainstInvalidArgTypes=function guardAgainstInvalidArgTypes(a,b){if('function'!=typeof a)throw new TypeError(VALIDATOR_ARG_ERROR_MESSAGE);if(!!b&&'string'!=typeof b)throw new TypeError(MESSAGE_ARG_ERROR_MESSAGE)},isRequiredIf=function isRequiredIf(a,b,c){return guardAgainstInvalidArgTypes(a,c),function(d,e,f){for(var _len=arguments.length,g=Array(3<_len?_len-3:0),_key=3;_key<_len;_key++)g[_key-3]=arguments[_key];return propIsRequired(b,d,e,f)?propExists(d,e)?a.apply(void 0,[d,e,f].concat(g)):missingPropError(d,e,f,c):a.apply(void 0,[d,e,f].concat(g));// Is not required, so just run typeValidator.
164
- }};exports.default=isRequiredIf;
165
-
166
-
167
- });
168
-
169
- var isRequiredIf = unwrapExports(isRequiredIf_1);
170
-
171
- var exenv = createCommonjsModule(function (module) {
172
- /*!
173
- Copyright (c) 2015 Jed Watson.
174
- Based on code that is Copyright 2013-2015, Facebook, Inc.
175
- All rights reserved.
176
- */
177
- /* global define */
178
-
179
- (function () {
180
-
181
- var canUseDOM = !!(
182
- typeof window !== 'undefined' &&
183
- window.document &&
184
- window.document.createElement
185
- );
186
-
187
- var ExecutionEnvironment = {
188
-
189
- canUseDOM: canUseDOM,
190
-
191
- canUseWorkers: typeof Worker !== 'undefined',
192
-
193
- canUseEventListeners:
194
- canUseDOM && !!(window.addEventListener || window.attachEvent),
195
-
196
- canUseViewport: canUseDOM && !!window.screen
197
-
198
- };
199
-
200
- if ( module.exports) {
201
- module.exports = ExecutionEnvironment;
202
- } else {
203
- window.ExecutionEnvironment = ExecutionEnvironment;
204
- }
205
-
206
- }());
207
- });
208
-
209
- var twitterWidgetJs = 'https://platform.twitter.com/widgets.js';
210
-
211
- var TwitterTimelineEmbed =
212
- /*#__PURE__*/
213
- function (_Component) {
214
- _inherits(TwitterTimelineEmbed, _Component);
215
-
216
- function TwitterTimelineEmbed(props) {
217
- var _this;
218
-
219
- _classCallCheck(this, TwitterTimelineEmbed);
220
-
221
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterTimelineEmbed).call(this, props));
222
- _this.state = {
223
- isLoading: true
224
- };
225
- return _this;
226
- }
227
-
228
- _createClass(TwitterTimelineEmbed, [{
229
- key: "buildChromeOptions",
230
- value: function buildChromeOptions(options) {
231
- options.chrome = '';
232
-
233
- if (this.props.noHeader) {
234
- options.chrome = options.chrome + ' noheader';
235
- }
236
-
237
- if (this.props.noFooter) {
238
- options.chrome = options.chrome + ' nofooter';
239
- }
240
-
241
- if (this.props.noBorders) {
242
- options.chrome = options.chrome + ' noborders';
243
- }
244
-
245
- if (this.props.noScrollbar) {
246
- options.chrome = options.chrome + ' noscrollbar';
247
- }
248
-
249
- if (this.props.transparent) {
250
- options.chrome = options.chrome + ' transparent';
251
- }
252
-
253
- return options;
254
- }
255
- }, {
256
- key: "buildOptions",
257
- value: function buildOptions() {
258
- var options = Object.assign({}, this.props.options);
259
-
260
- if (this.props.autoHeight) {
261
- options.height = this.refs.embedContainer.parentNode.offsetHeight;
262
- }
263
-
264
- options = Object.assign({}, options, {
265
- theme: this.props.theme,
266
- linkColor: this.props.linkColor,
267
- borderColor: this.props.borderColor,
268
- lang: this.props.lang
269
- });
270
- return options;
271
- }
272
- }, {
273
- key: "renderWidget",
274
- value: function renderWidget(options) {
275
- var _this2 = this;
276
-
277
- var onLoad = this.props.onLoad;
278
-
279
- if (!this.isMountCanceled) {
280
- window.twttr.widgets.createTimeline({
281
- sourceType: this.props.sourceType,
282
- screenName: this.props.screenName,
283
- userId: this.props.userId,
284
- ownerScreenName: this.props.ownerScreenName,
285
- slug: this.props.slug,
286
- id: this.props.id || this.props.widgetId,
287
- url: this.props.url
288
- }, this.refs.embedContainer, options).then(function (element) {
289
- _this2.setState({
290
- isLoading: false
291
- });
292
-
293
- if (onLoad) {
294
- onLoad(element);
295
- }
296
- });
297
- }
298
- }
299
- }, {
300
- key: "componentDidMount",
301
- value: function componentDidMount() {
302
- var _this3 = this;
303
-
304
- if (exenv.canUseDOM) {
305
- var script = require('scriptjs');
306
-
307
- script(twitterWidgetJs, 'twitter-embed', function () {
308
- if (!window.twttr) {
309
- console.error('Failure to load window.twttr in TwitterTimelineEmbed, aborting load.');
310
- return;
311
- }
312
-
313
- var options = _this3.buildOptions();
314
- /** Append chrome options */
315
-
316
-
317
- options = _this3.buildChromeOptions(options);
318
-
319
- _this3.renderWidget(options);
320
- });
321
- }
322
- }
323
- }, {
324
- key: "componentWillUnmount",
325
- value: function componentWillUnmount() {
326
- this.isMountCanceled = true;
327
- }
328
- }, {
329
- key: "render",
330
- value: function render() {
331
- var isLoading = this.state.isLoading;
332
- var placeholder = this.props.placeholder;
333
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
334
- ref: "embedContainer"
335
- }));
336
- }
337
- }]);
338
-
339
- return TwitterTimelineEmbed;
340
- }(Component);
341
-
342
- _defineProperty(TwitterTimelineEmbed, "propTypes", {
343
- /**
344
- * This can be either of profile, likes, list, collection, URL, widget
345
- */
346
- sourceType: PropTypes.oneOf(['profile', 'likes', 'list', 'collection', 'url', 'widget']).isRequired,
347
-
348
- /**
349
- * username of twitter handle as String
350
- */
351
- screenName: isRequiredIf(PropTypes.string, function (props) {
352
- return !props.hasOwnProperty('userId') && (props.sourceType === 'profile' || props.sourceType === 'likes');
353
- }),
354
-
355
- /**
356
- * UserId of twitter handle as number
357
- */
358
- userId: isRequiredIf(PropTypes.number, function (props) {
359
- return !props.hasOwnProperty('screenName') && (props.sourceType === 'profile' || props.sourceType === 'likes');
360
- }),
361
-
362
- /**
363
- * To show list, used along with slug
364
- */
365
- ownerScreenName: isRequiredIf(PropTypes.string, function (props) {
366
- return props.sourceType === 'list' && !props.hasOwnProperty('id');
367
- }),
368
-
369
- /**
370
- * To show list, used along with ownerScreenName
371
- */
372
- slug: isRequiredIf(PropTypes.string, function (props) {
373
- return props.sourceType === 'list' && !props.hasOwnProperty('id');
374
- }),
375
-
376
- /**
377
- * To show list, unique list id
378
- * Also used with collections, in that case its valid collection id
379
- */
380
- id: isRequiredIf(PropTypes.oneOfType([PropTypes.number, PropTypes.string]), function (props) {
381
- return props.sourceType === 'list' && !props.hasOwnProperty('ownerScreenName') && !props.hasOwnProperty('slug') || props.sourceType === 'collection';
382
- }),
383
-
384
- /**
385
- * To show twitter content with url.
386
- * Supported content includes profiles, likes, lists, and collections.
387
- */
388
- url: isRequiredIf(PropTypes.string, function (props) {
389
- return props.sourceType === 'url';
390
- }),
391
-
392
- /**
393
- * To show custom widget
394
- */
395
- widgetId: isRequiredIf(PropTypes.string, function (props) {
396
- return props.sourceType === 'widget';
397
- }),
398
-
399
- /**
400
- * Additional options to pass to twitter widget plugin
401
- */
402
- options: PropTypes.object,
403
-
404
- /**
405
- * Automatically fit into parent container height
406
- */
407
- autoHeight: PropTypes.bool,
408
-
409
- /**
410
- * With dark or light theme
411
- */
412
- theme: PropTypes.oneOf(['dark', 'light']),
413
-
414
- /**
415
- * With custom link colors. Note: Only Hex colors are supported.
416
- */
417
- linkColor: PropTypes.string,
418
-
419
- /**
420
- * With custom border colors. Note: Only Hex colors are supported.
421
- */
422
- borderColor: PropTypes.string,
423
-
424
- /**
425
- * Hide the header from timeline
426
- */
427
- noHeader: PropTypes.bool,
428
-
429
- /**
430
- * Hide the footer from timeline
431
- */
432
- noFooter: PropTypes.bool,
433
-
434
- /**
435
- * Hide the border from timeline
436
- */
437
- noBorders: PropTypes.bool,
438
-
439
- /**
440
- * Hide the scrollbars
441
- */
442
- noScrollbar: PropTypes.bool,
443
-
444
- /**
445
- * Enable Transparancy
446
- */
447
- transparent: PropTypes.bool,
448
-
449
- /**
450
- * Custom language code. Supported codes here: https://developer.twitter.com/en/docs/twitter-for-websites/twitter-for-websites-supported-languages/overview.html
451
- */
452
- lang: PropTypes.string,
453
-
454
- /**
455
- * Placeholder while tweet is loading
456
- */
457
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
458
-
459
- /**
460
- * Function to execute after load, return html element
461
- */
462
- onLoad: PropTypes.func
463
- });
464
-
465
- var TwitterShareButton =
466
- /*#__PURE__*/
467
- function (_Component) {
468
- _inherits(TwitterShareButton, _Component);
469
-
470
- function TwitterShareButton(props) {
471
- var _this;
472
-
473
- _classCallCheck(this, TwitterShareButton);
474
-
475
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterShareButton).call(this, props));
476
- _this.state = {
477
- isLoading: true
478
- };
479
- return _this;
480
- }
481
-
482
- _createClass(TwitterShareButton, [{
483
- key: "componentDidMount",
484
- value: function componentDidMount() {
485
- var _this2 = this;
486
-
487
- var onLoad = this.props.onLoad;
488
-
489
- if (exenv.canUseDOM) {
490
- var script = require('scriptjs');
491
-
492
- script(twitterWidgetJs, 'twitter-embed', function () {
493
- if (!window.twttr) {
494
- console.error('Failure to load window.twttr in TwitterShareButton, aborting load.');
495
- return;
496
- }
497
-
498
- if (!_this2.isMountCanceled) {
499
- window.twttr.widgets.createShareButton(_this2.props.url, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
500
- _this2.setState({
501
- isLoading: false
502
- });
503
-
504
- if (onLoad) {
505
- onLoad(element);
506
- }
507
- });
508
- }
509
- });
510
- }
511
- }
512
- }, {
513
- key: "componentWillUnmount",
514
- value: function componentWillUnmount() {
515
- this.isMountCanceled = true;
516
- }
517
- }, {
518
- key: "render",
519
- value: function render() {
520
- var isLoading = this.state.isLoading;
521
- var placeholder = this.props.placeholder;
522
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
523
- ref: "embedContainer"
524
- }));
525
- }
526
- }]);
527
-
528
- return TwitterShareButton;
529
- }(Component);
530
-
531
- _defineProperty(TwitterShareButton, "propTypes", {
532
- /**
533
- * Url for sharing
534
- */
535
- url: PropTypes.string.isRequired,
536
-
537
- /**
538
- * Additional options for overriding config. Details at : https://dev.twitter.com/web/tweet-button/parameters
539
- */
540
- options: PropTypes.object,
541
-
542
- /**
543
- * Placeholder while tweet is loading
544
- */
545
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
546
-
547
- /**
548
- * Function to execute after load, return html element
549
- */
550
- onLoad: PropTypes.func
551
- });
552
-
553
- var TwitterFollowButton =
554
- /*#__PURE__*/
555
- function (_Component) {
556
- _inherits(TwitterFollowButton, _Component);
557
-
558
- function TwitterFollowButton(props) {
559
- var _this;
560
-
561
- _classCallCheck(this, TwitterFollowButton);
562
-
563
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterFollowButton).call(this, props));
564
- _this.state = {
565
- isLoading: true
566
- };
567
- return _this;
568
- }
569
-
570
- _createClass(TwitterFollowButton, [{
571
- key: "componentDidMount",
572
- value: function componentDidMount() {
573
- var _this2 = this;
574
-
575
- var onLoad = this.props.onLoad;
576
-
577
- if (exenv.canUseDOM) {
578
- var script = require('scriptjs');
579
-
580
- script(twitterWidgetJs, 'twitter-embed', function () {
581
- if (!window.twttr) {
582
- console.error('Failure to load window.twttr in TwitterFollowButton, aborting load.');
583
- return;
584
- }
585
-
586
- if (!_this2.isMountCanceled) {
587
- window.twttr.widgets.createFollowButton(_this2.props.screenName, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
588
- _this2.setState({
589
- isLoading: false
590
- });
591
-
592
- if (onLoad) {
593
- onLoad(element);
594
- }
595
- });
596
- }
597
- });
598
- }
599
- }
600
- }, {
601
- key: "componentWillUnmount",
602
- value: function componentWillUnmount() {
603
- this.isMountCanceled = true;
604
- }
605
- }, {
606
- key: "render",
607
- value: function render() {
608
- var isLoading = this.state.isLoading;
609
- var placeholder = this.props.placeholder;
610
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
611
- ref: "embedContainer"
612
- }));
613
- }
614
- }]);
615
-
616
- return TwitterFollowButton;
617
- }(Component);
618
-
619
- _defineProperty(TwitterFollowButton, "propTypes", {
620
- /**
621
- * Username of twitter user which will be followed on click
622
- */
623
- screenName: PropTypes.string.isRequired,
624
-
625
- /**
626
- * Additional options to be added to the button
627
- */
628
- options: PropTypes.object,
629
-
630
- /**
631
- * Placeholder while tweet is loading
632
- */
633
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
634
-
635
- /**
636
- * Function to execute after load, return html element
637
- */
638
- onLoad: PropTypes.func
639
- });
640
-
641
- var TwitterHashtagButton =
642
- /*#__PURE__*/
643
- function (_Component) {
644
- _inherits(TwitterHashtagButton, _Component);
645
-
646
- function TwitterHashtagButton(props) {
647
- var _this;
648
-
649
- _classCallCheck(this, TwitterHashtagButton);
650
-
651
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterHashtagButton).call(this, props));
652
- _this.state = {
653
- isLoading: true
654
- };
655
- return _this;
656
- }
657
-
658
- _createClass(TwitterHashtagButton, [{
659
- key: "componentDidMount",
660
- value: function componentDidMount() {
661
- var _this2 = this;
662
-
663
- var onLoad = this.props.onLoad;
664
-
665
- if (exenv.canUseDOM) {
666
- var script = require('scriptjs');
667
-
668
- script(twitterWidgetJs, 'twitter-embed', function () {
669
- if (!window.twttr) {
670
- console.error('Failure to load window.twttr in TwitterHashtagButton, aborting load.');
671
- return;
672
- }
673
-
674
- if (!_this2.isMountCanceled) {
675
- window.twttr.widgets.createHashtagButton(_this2.props.tag, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
676
- _this2.setState({
677
- isLoading: false
678
- });
679
-
680
- if (onLoad) {
681
- onLoad(element);
682
- }
683
- });
684
- }
685
- });
686
- }
687
- }
688
- }, {
689
- key: "componentWillUnmount",
690
- value: function componentWillUnmount() {
691
- this.isMountCanceled = true;
692
- }
693
- }, {
694
- key: "render",
695
- value: function render() {
696
- var isLoading = this.state.isLoading;
697
- var placeholder = this.props.placeholder;
698
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
699
- ref: "embedContainer"
700
- }));
701
- }
702
- }]);
703
-
704
- return TwitterHashtagButton;
705
- }(Component);
706
-
707
- _defineProperty(TwitterHashtagButton, "propTypes", {
708
- /**
709
- * Tag name for hashtag button
710
- */
711
- tag: PropTypes.string.isRequired,
712
-
713
- /**
714
- * Additional options to be added to the button
715
- */
716
- options: PropTypes.object,
717
-
718
- /**
719
- * Placeholder while tweet is loading
720
- */
721
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
722
-
723
- /**
724
- * Function to execute after load, return html element
725
- */
726
- onLoad: PropTypes.func
727
- });
728
-
729
- var TwitterMentionButton =
730
- /*#__PURE__*/
731
- function (_Component) {
732
- _inherits(TwitterMentionButton, _Component);
733
-
734
- function TwitterMentionButton(props) {
735
- var _this;
736
-
737
- _classCallCheck(this, TwitterMentionButton);
738
-
739
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterMentionButton).call(this, props));
740
- _this.state = {
741
- isLoading: true
742
- };
743
- return _this;
744
- }
745
-
746
- _createClass(TwitterMentionButton, [{
747
- key: "componentDidMount",
748
- value: function componentDidMount() {
749
- var _this2 = this;
750
-
751
- var onLoad = this.props.onLoad;
752
-
753
- if (exenv.canUseDOM) {
754
- var script = require('scriptjs');
755
-
756
- script(twitterWidgetJs, 'twitter-embed', function () {
757
- if (!window.twttr) {
758
- console.error('Failure to load window.twttr in TwitterMentionButton, aborting load.');
759
- return;
760
- }
761
-
762
- if (!_this2.isMountCanceled) {
763
- window.twttr.widgets.createMentionButton(_this2.props.screenName, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
764
- _this2.setState({
765
- isLoading: false
766
- });
767
-
768
- if (onLoad) {
769
- onLoad(element);
770
- }
771
- });
772
- }
773
- });
774
- }
775
- }
776
- }, {
777
- key: "componentWillUnmount",
778
- value: function componentWillUnmount() {
779
- this.isMountCanceled = true;
780
- }
781
- }, {
782
- key: "render",
783
- value: function render() {
784
- var isLoading = this.state.isLoading;
785
- var placeholder = this.props.placeholder;
786
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
787
- ref: "embedContainer"
788
- }));
789
- }
790
- }]);
791
-
792
- return TwitterMentionButton;
793
- }(Component);
794
-
795
- _defineProperty(TwitterMentionButton, "propTypes", {
796
- /**
797
- * Username to which you will need to tweet
798
- */
799
- screenName: PropTypes.string.isRequired,
800
-
801
- /**
802
- * Additional options for overriding config.
803
- */
804
- options: PropTypes.object,
805
-
806
- /**
807
- * Placeholder while tweet is loading
808
- */
809
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
810
-
811
- /**
812
- * Function to execute after load, return html element
813
- */
814
- onLoad: PropTypes.func
815
- });
816
-
817
- var TwitterTweetEmbed =
818
- /*#__PURE__*/
819
- function (_Component) {
820
- _inherits(TwitterTweetEmbed, _Component);
821
-
822
- function TwitterTweetEmbed(props) {
823
- var _this;
824
-
825
- _classCallCheck(this, TwitterTweetEmbed);
826
-
827
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterTweetEmbed).call(this, props));
828
- _this.state = {
829
- isLoading: true
830
- };
831
- return _this;
832
- }
833
-
834
- _createClass(TwitterTweetEmbed, [{
835
- key: "renderWidget",
836
- value: function renderWidget() {
837
- var _this2 = this;
838
-
839
- var onLoad = this.props.onLoad;
840
-
841
- if (!window.twttr) {
842
- console.error('Failure to load window.twttr in TwitterTweetEmbed, aborting load.');
843
- return;
844
- }
845
-
846
- if (!this.isMountCanceled) {
847
- window.twttr.widgets.createTweet(this.props.tweetId, this.refs.embedContainer, this.props.options).then(function (element) {
848
- _this2.setState({
849
- isLoading: false
850
- });
851
-
852
- if (onLoad) {
853
- onLoad(element);
854
- }
855
- });
856
- }
857
- }
858
- }, {
859
- key: "componentDidMount",
860
- value: function componentDidMount() {
861
- var _this3 = this;
862
-
863
- if (exenv.canUseDOM) {
864
- var script = require('scriptjs');
865
-
866
- script(twitterWidgetJs, 'twitter-embed', function () {
867
- _this3.renderWidget();
868
- });
869
- }
870
- }
871
- }, {
872
- key: "componentWillUnmount",
873
- value: function componentWillUnmount() {
874
- this.isMountCanceled = true;
875
- }
876
- }, {
877
- key: "render",
878
- value: function render() {
879
- var isLoading = this.state.isLoading;
880
- var placeholder = this.props.placeholder;
881
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
882
- ref: "embedContainer"
883
- }));
884
- }
885
- }]);
886
-
887
- return TwitterTweetEmbed;
888
- }(Component);
889
-
890
- _defineProperty(TwitterTweetEmbed, "propTypes", {
891
- /**
892
- * Tweet id that needs to be shown
893
- */
894
- tweetId: PropTypes.string.isRequired,
895
-
896
- /**
897
- * Additional options to pass to twitter widget plugin
898
- */
899
- options: PropTypes.object,
900
-
901
- /**
902
- * Placeholder while tweet is loading
903
- */
904
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
905
-
906
- /**
907
- * Function to execute after load, return html element
908
- */
909
- onLoad: PropTypes.func
910
- });
911
-
912
- var TwitterMomentShare =
913
- /*#__PURE__*/
914
- function (_Component) {
915
- _inherits(TwitterMomentShare, _Component);
916
-
917
- function TwitterMomentShare(props) {
918
- var _this;
919
-
920
- _classCallCheck(this, TwitterMomentShare);
921
-
922
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterMomentShare).call(this, props));
923
- _this.state = {
924
- isLoading: true
925
- };
926
- return _this;
927
- }
928
-
929
- _createClass(TwitterMomentShare, [{
930
- key: "componentDidMount",
931
- value: function componentDidMount() {
932
- var _this2 = this;
933
-
934
- var onLoad = this.props.onLoad;
935
-
936
- if (exenv.canUseDOM) {
937
- var script = require('scriptjs');
938
-
939
- script(twitterWidgetJs, 'twitter-embed', function () {
940
- if (!window.twttr) {
941
- console.error('Failure to load window.twttr in TwitterMomentShare, aborting load.');
942
- return;
943
- }
944
-
945
- if (!_this2.isMountCanceled) {
946
- window.twttr.widgets.createMoment(_this2.props.momentId, _this2.refs.shareMoment, _this2.props.options).then(function (element) {
947
- _this2.setState({
948
- isLoading: false
949
- });
950
-
951
- if (onLoad) {
952
- onLoad(element);
953
- }
954
- });
955
- }
956
- });
957
- }
958
- }
959
- }, {
960
- key: "componentWillUnmount",
961
- value: function componentWillUnmount() {
962
- this.isMountCanceled = true;
963
- }
964
- }, {
965
- key: "render",
966
- value: function render() {
967
- var isLoading = this.state.isLoading;
968
- var placeholder = this.props.placeholder;
969
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
970
- ref: "shareMoment"
971
- }));
972
- }
973
- }]);
974
-
975
- return TwitterMomentShare;
976
- }(Component);
977
-
978
- _defineProperty(TwitterMomentShare, "propTypes", {
979
- /**
980
- * id of Twitter moment to show
981
- */
982
- momentId: PropTypes.string.isRequired,
983
-
984
- /**
985
- * Additional options for overriding config.
986
- */
987
- options: PropTypes.object,
988
-
989
- /**
990
- * Placeholder while tweet is loading
991
- */
992
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
993
-
994
- /**
995
- * Function to execute after load, return html element
996
- */
997
- onLoad: PropTypes.func
998
- });
999
-
1000
- var TwitterDMButton =
1001
- /*#__PURE__*/
1002
- function (_Component) {
1003
- _inherits(TwitterDMButton, _Component);
1004
-
1005
- function TwitterDMButton(props) {
1006
- var _this;
1007
-
1008
- _classCallCheck(this, TwitterDMButton);
1009
-
1010
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterDMButton).call(this, props));
1011
- _this.state = {
1012
- isLoading: true
1013
- };
1014
- return _this;
1015
- }
1016
-
1017
- _createClass(TwitterDMButton, [{
1018
- key: "componentDidMount",
1019
- value: function componentDidMount() {
1020
- var _this2 = this;
1021
-
1022
- var onLoad = this.props.onLoad;
1023
-
1024
- if (exenv.canUseDOM) {
1025
- var script = require('scriptjs');
1026
-
1027
- script(twitterWidgetJs, 'twitter-embed', function () {
1028
- if (!window.twttr) {
1029
- console.error('Failure to load window.twttr in TwitterDMButton, aborting load.');
1030
- return;
1031
- }
1032
-
1033
- if (!_this2.isMountCanceled) {
1034
- window.twttr.widgets.createDMButton(_this2.props.id, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
1035
- _this2.setState({
1036
- isLoading: false
1037
- });
1038
-
1039
- if (onLoad) {
1040
- onLoad(element);
1041
- }
1042
- });
1043
- }
1044
- });
1045
- }
1046
- }
1047
- }, {
1048
- key: "componentWillUnmount",
1049
- value: function componentWillUnmount() {
1050
- this.isMountCanceled = true;
1051
- }
1052
- }, {
1053
- key: "render",
1054
- value: function render() {
1055
- var isLoading = this.state.isLoading;
1056
- var placeholder = this.props.placeholder;
1057
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
1058
- ref: "embedContainer"
1059
- }));
1060
- }
1061
- }]);
1062
-
1063
- return TwitterDMButton;
1064
- }(Component);
1065
-
1066
- _defineProperty(TwitterDMButton, "propTypes", {
1067
- /**
1068
- * Twitter user id for DM button
1069
- */
1070
- id: PropTypes.number.isRequired,
1071
-
1072
- /**
1073
- * Additional options to be added to the button
1074
- */
1075
- options: PropTypes.object,
1076
-
1077
- /**
1078
- * Placeholder while tweet is loading
1079
- */
1080
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
1081
-
1082
- /**
1083
- * Function to execute after load, return html element
1084
- */
1085
- onLoad: PropTypes.func
1086
- });
1087
-
1088
- var TwitterVideoEmbed =
1089
- /*#__PURE__*/
1090
- function (_Component) {
1091
- _inherits(TwitterVideoEmbed, _Component);
1092
-
1093
- function TwitterVideoEmbed(props) {
1094
- var _this;
1095
-
1096
- _classCallCheck(this, TwitterVideoEmbed);
1097
-
1098
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterVideoEmbed).call(this, props));
1099
- _this.state = {
1100
- isLoading: true
1101
- };
1102
- return _this;
1103
- }
1104
-
1105
- _createClass(TwitterVideoEmbed, [{
1106
- key: "componentDidMount",
1107
- value: function componentDidMount() {
1108
- var _this2 = this;
1109
-
1110
- var onLoad = this.props.onLoad;
1111
-
1112
- if (exenv.canUseDOM) {
1113
- var script = require('scriptjs');
1114
-
1115
- script(twitterWidgetJs, 'twitter-embed', function () {
1116
- if (!window.twttr) {
1117
- console.error('Failure to load window.twttr in TwitterVideoEmbed, aborting load.');
1118
- return;
1119
- }
1120
-
1121
- if (!_this2.isMountCanceled) {
1122
- window.twttr.widgets.createVideo(_this2.props.id, _this2.refs.embedContainer).then(function (element) {
1123
- _this2.setState({
1124
- isLoading: false
1125
- });
1126
-
1127
- if (onLoad) {
1128
- onLoad(element);
1129
- }
1130
- });
1131
- }
1132
- });
1133
- }
1134
- }
1135
- }, {
1136
- key: "componentWillUnmount",
1137
- value: function componentWillUnmount() {
1138
- this.isMountCanceled = true;
1139
- }
1140
- }, {
1141
- key: "render",
1142
- value: function render() {
1143
- var isLoading = this.state.isLoading;
1144
- var placeholder = this.props.placeholder;
1145
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
1146
- ref: "embedContainer"
1147
- }));
1148
- }
1149
- }]);
1150
-
1151
- return TwitterVideoEmbed;
1152
- }(Component);
1153
-
1154
- _defineProperty(TwitterVideoEmbed, "propTypes", {
1155
- /**
1156
- * Id of video tweet.
1157
- */
1158
- id: PropTypes.string.isRequired,
1159
-
1160
- /**
1161
- * Placeholder while tweet is loading
1162
- */
1163
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
1164
-
1165
- /**
1166
- * Function to execute after load, return html element
1167
- */
1168
- onLoad: PropTypes.func
1169
- });
1170
-
1171
- var TwitterOnAirButton =
1172
- /*#__PURE__*/
1173
- function (_Component) {
1174
- _inherits(TwitterOnAirButton, _Component);
1175
-
1176
- function TwitterOnAirButton(props) {
1177
- var _this;
1178
-
1179
- _classCallCheck(this, TwitterOnAirButton);
1180
-
1181
- _this = _possibleConstructorReturn(this, _getPrototypeOf(TwitterOnAirButton).call(this, props));
1182
- _this.state = {
1183
- isLoading: true
1184
- };
1185
- return _this;
1186
- }
1187
-
1188
- _createClass(TwitterOnAirButton, [{
1189
- key: "componentDidMount",
1190
- value: function componentDidMount() {
1191
- var _this2 = this;
1192
-
1193
- var onLoad = this.props.onLoad;
1194
-
1195
- if (exenv.canUseDOM) {
1196
- var script = require('scriptjs');
1197
-
1198
- script(twitterWidgetJs, 'twitter-embed', function () {
1199
- if (!window.twttr) {
1200
- console.error('Failure to load window.twttr in TwitterOnAirButton, aborting load.');
1201
- return;
1202
- }
1203
-
1204
- if (!_this2.isMountCanceled) {
1205
- window.twttr.widgets.createPeriscopeOnAirButton(_this2.props.username, _this2.refs.embedContainer, _this2.props.options).then(function (element) {
1206
- _this2.setState({
1207
- isLoading: false
1208
- });
1209
-
1210
- if (onLoad) {
1211
- onLoad(element);
1212
- }
1213
- });
1214
- }
1215
- });
1216
- }
1217
- }
1218
- }, {
1219
- key: "componentWillUnmount",
1220
- value: function componentWillUnmount() {
1221
- this.isMountCanceled = true;
1222
- }
1223
- }, {
1224
- key: "render",
1225
- value: function render() {
1226
- var isLoading = this.state.isLoading;
1227
- var placeholder = this.props.placeholder;
1228
- return React__default.createElement(React__default.Fragment, null, isLoading && placeholder, React__default.createElement("div", {
1229
- ref: "embedContainer"
1230
- }));
1231
- }
1232
- }]);
1233
-
1234
- return TwitterOnAirButton;
1235
- }(Component);
1236
-
1237
- _defineProperty(TwitterOnAirButton, "propTypes", {
1238
- /**
1239
- * Username for which you require periscope on air button
1240
- */
1241
- username: PropTypes.string.isRequired,
1242
-
1243
- /**
1244
- * Additional options for overriding config.
1245
- */
1246
- options: PropTypes.object,
1247
-
1248
- /**
1249
- * Placeholder while tweet is loading
1250
- */
1251
- placeholder: PropTypes.oneOfType([PropTypes.string, PropTypes.element]),
1252
-
1253
- /**
1254
- * Function to execute after load, return html element
1255
- */
1256
- onLoad: PropTypes.func
1257
- });
61
+ import { TwitterTimelineEmbed } from 'react-twitter-embed';
1258
62
 
1259
63
  var ImageSlider = function ImageSlider(props) {
1260
64
  var innerSlider = useRef(null);