@mjhls/mjh-framework 1.0.626-search-css-fix → 1.0.626

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