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