@mjhls/mjh-framework 1.0.861-dl-iframe-v1 → 1.0.861

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