@mjhls/mjh-framework 1.0.688 → 1.0.689-segment

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