@mjhls/mjh-framework 1.0.604 → 1.0.605

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