@mjhls/mjh-framework 1.0.534 → 1.0.535

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