@mjhls/mjh-framework 1.0.665 → 1.0.666-ad-update-v3

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