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