@mjhls/mjh-framework 1.0.588-hamMagazine-v4 → 1.0.589

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