@mjhls/mjh-framework 1.0.651 → 1.0.652

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