@mjhls/mjh-framework 1.0.859-beta.2 → 1.0.859-beta.4
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/AlgoliaSearch.js +1 -1
- package/dist/cjs/ArticleProgramLandingPage.js +6 -6
- package/dist/cjs/ArticleSeriesLandingPage.js +4 -4
- package/dist/cjs/ArticleSeriesListing.js +1 -1
- package/dist/cjs/DeckContent.js +1 -1
- package/dist/cjs/DeckQueue.js +1 -1
- package/dist/cjs/ExternalResources.js +2 -2
- package/dist/cjs/GridContent.js +1 -1
- package/dist/cjs/HorizontalArticleListing.js +2 -2
- package/dist/cjs/IssueLanding.js +2 -2
- package/dist/cjs/MasterDeck.js +1 -1
- package/dist/cjs/MediaSeriesLanding.js +7 -7
- package/dist/cjs/PartnerDetailListing.js +2739 -17
- package/dist/cjs/TaxonomyDescription.js +2 -2
- package/dist/cjs/VideoProgramLandingPage.js +5 -5
- package/dist/cjs/VideoSeriesLandingPage.js +4 -4
- package/dist/cjs/VideoSeriesListing.js +1 -1
- package/dist/cjs/View.js +21 -24
- package/dist/cjs/faundadb.js +15 -15
- package/dist/cjs/getRootDocGroup.js +3 -3
- package/dist/cjs/getSerializers.js +2 -2
- package/dist/cjs/{index-998ad42c.js → index-d79b659e.js} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/{inherits-452ff02c.js → inherits-1f5a1c72.js} +2 -2
- package/dist/esm/PartnerDetailListing.js +2748 -26
- package/dist/esm/View.js +19 -22
- package/package.json +2 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as createCommonjsModule, u as unwrapExports } from './_commonjsHelpers-0c4b6f40.js';
|
|
1
|
+
import { c as createCommonjsModule, u as unwrapExports, a as commonjsGlobal } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
2
|
import './_to-object-a4107da3.js';
|
|
3
3
|
import './es6.string.iterator-c990c18c.js';
|
|
4
4
|
import './_library-528f1934.js';
|
|
@@ -13,7 +13,7 @@ import './define-property-8af5f002.js';
|
|
|
13
13
|
import './web.dom.iterable-4439f05a.js';
|
|
14
14
|
import './typeof-6435ba1c.js';
|
|
15
15
|
import './_is-array-58e95429.js';
|
|
16
|
-
import React__default, { Component, useRef, useState, useEffect } from 'react';
|
|
16
|
+
import React__default, { Component, createContext, forwardRef, PureComponent, useRef, useState, useEffect } from 'react';
|
|
17
17
|
import './events-6c3a7a63.js';
|
|
18
18
|
import './index-41a678ea.js';
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
@@ -35,7 +35,7 @@ import './main-e4a934b2.js';
|
|
|
35
35
|
import './entities-7cc3bf45.js';
|
|
36
36
|
import { _ as _slicedToArray } from './slicedToArray-641f241f.js';
|
|
37
37
|
import './stringify-4330ccdc.js';
|
|
38
|
-
import { a as _asyncToGenerator, r as regenerator, _ as _Promise } from './asyncToGenerator-fc1c2e29.js';
|
|
38
|
+
import { a as _asyncToGenerator$1, r as regenerator, _ as _Promise } from './asyncToGenerator-fc1c2e29.js';
|
|
39
39
|
import './Segment.js';
|
|
40
40
|
import './Beam.js';
|
|
41
41
|
import './AdSlot.js';
|
|
@@ -46,6 +46,7 @@ import './getContentCategory-15dcc413.js';
|
|
|
46
46
|
import './AuthorComponent-34b16174.js';
|
|
47
47
|
import 'react-bootstrap/Button';
|
|
48
48
|
import { B as BlockContent } from './BlockContent-e9b4ddcf.js';
|
|
49
|
+
import { r as reactSocialIcons_1 } from './react-social-icons-a7d5c5c7.js';
|
|
49
50
|
import './index-c7e2ac95.js';
|
|
50
51
|
import { s as smoothscroll } from './smoothscroll-0cd4c7a6.js';
|
|
51
52
|
import './GroupDeck.js';
|
|
@@ -66,7 +67,7 @@ import 'react-bootstrap/Figure';
|
|
|
66
67
|
import 'react-bootstrap/OverlayTrigger';
|
|
67
68
|
import 'react-bootstrap/Tooltip';
|
|
68
69
|
import 'react-bootstrap/Popover';
|
|
69
|
-
import { _ as _defineProperty, b as _inherits, c as _classCallCheck, d as _possibleConstructorReturn, e as _getPrototypeOf, g as _createClass } from './inherits-77d5e4fc.js';
|
|
70
|
+
import { _ as _defineProperty$1, b as _inherits, c as _classCallCheck, d as _possibleConstructorReturn, e as _getPrototypeOf, g as _createClass } from './inherits-77d5e4fc.js';
|
|
70
71
|
import 'react-bootstrap/Carousel';
|
|
71
72
|
import Feature from './Feature.js';
|
|
72
73
|
import 'react-bootstrap/Breadcrumb';
|
|
@@ -252,7 +253,7 @@ function (_Component) {
|
|
|
252
253
|
return TwitterTimelineEmbed;
|
|
253
254
|
}(Component);
|
|
254
255
|
|
|
255
|
-
_defineProperty(TwitterTimelineEmbed, "propTypes", {
|
|
256
|
+
_defineProperty$1(TwitterTimelineEmbed, "propTypes", {
|
|
256
257
|
/**
|
|
257
258
|
* This can be either of profile, likes, list, collection, URL, widget
|
|
258
259
|
*/
|
|
@@ -441,7 +442,7 @@ function (_Component) {
|
|
|
441
442
|
return TwitterShareButton;
|
|
442
443
|
}(Component);
|
|
443
444
|
|
|
444
|
-
_defineProperty(TwitterShareButton, "propTypes", {
|
|
445
|
+
_defineProperty$1(TwitterShareButton, "propTypes", {
|
|
445
446
|
/**
|
|
446
447
|
* Url for sharing
|
|
447
448
|
*/
|
|
@@ -529,7 +530,7 @@ function (_Component) {
|
|
|
529
530
|
return TwitterFollowButton;
|
|
530
531
|
}(Component);
|
|
531
532
|
|
|
532
|
-
_defineProperty(TwitterFollowButton, "propTypes", {
|
|
533
|
+
_defineProperty$1(TwitterFollowButton, "propTypes", {
|
|
533
534
|
/**
|
|
534
535
|
* Username of twitter user which will be followed on click
|
|
535
536
|
*/
|
|
@@ -617,7 +618,7 @@ function (_Component) {
|
|
|
617
618
|
return TwitterHashtagButton;
|
|
618
619
|
}(Component);
|
|
619
620
|
|
|
620
|
-
_defineProperty(TwitterHashtagButton, "propTypes", {
|
|
621
|
+
_defineProperty$1(TwitterHashtagButton, "propTypes", {
|
|
621
622
|
/**
|
|
622
623
|
* Tag name for hashtag button
|
|
623
624
|
*/
|
|
@@ -705,7 +706,7 @@ function (_Component) {
|
|
|
705
706
|
return TwitterMentionButton;
|
|
706
707
|
}(Component);
|
|
707
708
|
|
|
708
|
-
_defineProperty(TwitterMentionButton, "propTypes", {
|
|
709
|
+
_defineProperty$1(TwitterMentionButton, "propTypes", {
|
|
709
710
|
/**
|
|
710
711
|
* Username to which you will need to tweet
|
|
711
712
|
*/
|
|
@@ -800,7 +801,7 @@ function (_Component) {
|
|
|
800
801
|
return TwitterTweetEmbed;
|
|
801
802
|
}(Component);
|
|
802
803
|
|
|
803
|
-
_defineProperty(TwitterTweetEmbed, "propTypes", {
|
|
804
|
+
_defineProperty$1(TwitterTweetEmbed, "propTypes", {
|
|
804
805
|
/**
|
|
805
806
|
* Tweet id that needs to be shown
|
|
806
807
|
*/
|
|
@@ -888,7 +889,7 @@ function (_Component) {
|
|
|
888
889
|
return TwitterMomentShare;
|
|
889
890
|
}(Component);
|
|
890
891
|
|
|
891
|
-
_defineProperty(TwitterMomentShare, "propTypes", {
|
|
892
|
+
_defineProperty$1(TwitterMomentShare, "propTypes", {
|
|
892
893
|
/**
|
|
893
894
|
* id of Twitter moment to show
|
|
894
895
|
*/
|
|
@@ -976,7 +977,7 @@ function (_Component) {
|
|
|
976
977
|
return TwitterDMButton;
|
|
977
978
|
}(Component);
|
|
978
979
|
|
|
979
|
-
_defineProperty(TwitterDMButton, "propTypes", {
|
|
980
|
+
_defineProperty$1(TwitterDMButton, "propTypes", {
|
|
980
981
|
/**
|
|
981
982
|
* Twitter user id for DM button
|
|
982
983
|
*/
|
|
@@ -1064,7 +1065,7 @@ function (_Component) {
|
|
|
1064
1065
|
return TwitterVideoEmbed;
|
|
1065
1066
|
}(Component);
|
|
1066
1067
|
|
|
1067
|
-
_defineProperty(TwitterVideoEmbed, "propTypes", {
|
|
1068
|
+
_defineProperty$1(TwitterVideoEmbed, "propTypes", {
|
|
1068
1069
|
/**
|
|
1069
1070
|
* Id of video tweet.
|
|
1070
1071
|
*/
|
|
@@ -1147,7 +1148,7 @@ function (_Component) {
|
|
|
1147
1148
|
return TwitterOnAirButton;
|
|
1148
1149
|
}(Component);
|
|
1149
1150
|
|
|
1150
|
-
_defineProperty(TwitterOnAirButton, "propTypes", {
|
|
1151
|
+
_defineProperty$1(TwitterOnAirButton, "propTypes", {
|
|
1151
1152
|
/**
|
|
1152
1153
|
* Username for which you require periscope on air button
|
|
1153
1154
|
*/
|
|
@@ -1169,6 +1170,2710 @@ _defineProperty(TwitterOnAirButton, "propTypes", {
|
|
|
1169
1170
|
onLoad: PropTypes.func
|
|
1170
1171
|
});
|
|
1171
1172
|
|
|
1173
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
1174
|
+
try {
|
|
1175
|
+
var info = gen[key](arg);
|
|
1176
|
+
var value = info.value;
|
|
1177
|
+
} catch (error) {
|
|
1178
|
+
reject(error);
|
|
1179
|
+
return;
|
|
1180
|
+
}
|
|
1181
|
+
|
|
1182
|
+
if (info.done) {
|
|
1183
|
+
resolve(value);
|
|
1184
|
+
} else {
|
|
1185
|
+
Promise.resolve(value).then(_next, _throw);
|
|
1186
|
+
}
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
function _asyncToGenerator(fn) {
|
|
1190
|
+
return function () {
|
|
1191
|
+
var self = this,
|
|
1192
|
+
args = arguments;
|
|
1193
|
+
return new Promise(function (resolve, reject) {
|
|
1194
|
+
var gen = fn.apply(self, args);
|
|
1195
|
+
|
|
1196
|
+
function _next(value) {
|
|
1197
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
function _throw(err) {
|
|
1201
|
+
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
_next(undefined);
|
|
1205
|
+
});
|
|
1206
|
+
};
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
var asyncToGenerator = _asyncToGenerator;
|
|
1210
|
+
|
|
1211
|
+
function _defineProperty(obj, key, value) {
|
|
1212
|
+
if (key in obj) {
|
|
1213
|
+
Object.defineProperty(obj, key, {
|
|
1214
|
+
value: value,
|
|
1215
|
+
enumerable: true,
|
|
1216
|
+
configurable: true,
|
|
1217
|
+
writable: true
|
|
1218
|
+
});
|
|
1219
|
+
} else {
|
|
1220
|
+
obj[key] = value;
|
|
1221
|
+
}
|
|
1222
|
+
|
|
1223
|
+
return obj;
|
|
1224
|
+
}
|
|
1225
|
+
|
|
1226
|
+
var defineProperty = _defineProperty;
|
|
1227
|
+
|
|
1228
|
+
var canUseDOM = !!(
|
|
1229
|
+
typeof window !== 'undefined' &&
|
|
1230
|
+
window.document &&
|
|
1231
|
+
window.document.createElement
|
|
1232
|
+
);
|
|
1233
|
+
|
|
1234
|
+
var canUseDom = canUseDOM;
|
|
1235
|
+
|
|
1236
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
1237
|
+
if (source == null) return {};
|
|
1238
|
+
var target = {};
|
|
1239
|
+
var sourceKeys = Object.keys(source);
|
|
1240
|
+
var key, i;
|
|
1241
|
+
|
|
1242
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
1243
|
+
key = sourceKeys[i];
|
|
1244
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1245
|
+
target[key] = source[key];
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
return target;
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
var objectWithoutPropertiesLoose = _objectWithoutPropertiesLoose;
|
|
1252
|
+
|
|
1253
|
+
function _objectWithoutProperties(source, excluded) {
|
|
1254
|
+
if (source == null) return {};
|
|
1255
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
1256
|
+
var key, i;
|
|
1257
|
+
|
|
1258
|
+
if (Object.getOwnPropertySymbols) {
|
|
1259
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
1260
|
+
|
|
1261
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
1262
|
+
key = sourceSymbolKeys[i];
|
|
1263
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
1264
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
1265
|
+
target[key] = source[key];
|
|
1266
|
+
}
|
|
1267
|
+
}
|
|
1268
|
+
|
|
1269
|
+
return target;
|
|
1270
|
+
}
|
|
1271
|
+
|
|
1272
|
+
var objectWithoutProperties = _objectWithoutProperties;
|
|
1273
|
+
|
|
1274
|
+
var LoginStatus = {
|
|
1275
|
+
CONNECTED: 'connected',
|
|
1276
|
+
AUTHORIZATION_EXPIRED: 'authorization_expired',
|
|
1277
|
+
NOT_AUTHORIZED: 'not_authorized',
|
|
1278
|
+
UNKNOWN: 'unknown'
|
|
1279
|
+
};
|
|
1280
|
+
|
|
1281
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
1282
|
+
|
|
1283
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
1284
|
+
const Method = {
|
|
1285
|
+
GET: 'get',
|
|
1286
|
+
POST: 'post',
|
|
1287
|
+
DELETE: 'delete'
|
|
1288
|
+
};
|
|
1289
|
+
class Facebook {
|
|
1290
|
+
constructor(options = {}) {
|
|
1291
|
+
this.options = _objectSpread({
|
|
1292
|
+
domain: 'connect.facebook.net',
|
|
1293
|
+
version: 'v3.2',
|
|
1294
|
+
cookie: false,
|
|
1295
|
+
status: false,
|
|
1296
|
+
xfbml: false,
|
|
1297
|
+
language: 'en_US',
|
|
1298
|
+
frictionlessRequests: false,
|
|
1299
|
+
debug: false,
|
|
1300
|
+
chatSupport: false
|
|
1301
|
+
}, options);
|
|
1302
|
+
|
|
1303
|
+
if (!this.options.appId) {
|
|
1304
|
+
throw new Error('You need to set appId');
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
if (!this.options.wait) {
|
|
1308
|
+
this.init();
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
getAppId() {
|
|
1313
|
+
return this.options.appId;
|
|
1314
|
+
}
|
|
1315
|
+
|
|
1316
|
+
init() {
|
|
1317
|
+
var _this = this;
|
|
1318
|
+
|
|
1319
|
+
return asyncToGenerator(function* () {
|
|
1320
|
+
if (_this.loadingPromise) {
|
|
1321
|
+
return _this.loadingPromise;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
_this.loadingPromise = new Promise(resolve => {
|
|
1325
|
+
const _this$options = _this.options,
|
|
1326
|
+
{
|
|
1327
|
+
domain,
|
|
1328
|
+
language,
|
|
1329
|
+
debug,
|
|
1330
|
+
chatSupport
|
|
1331
|
+
} = _this$options,
|
|
1332
|
+
restOptions = objectWithoutProperties(_this$options, ["domain", "language", "debug", "chatSupport"]);
|
|
1333
|
+
|
|
1334
|
+
window.fbAsyncInit = () => {
|
|
1335
|
+
window.FB.init({
|
|
1336
|
+
appId: restOptions.appId,
|
|
1337
|
+
version: restOptions.version,
|
|
1338
|
+
cookie: restOptions.cookie,
|
|
1339
|
+
status: restOptions.status,
|
|
1340
|
+
xfbml: restOptions.xfbml,
|
|
1341
|
+
frictionlessRequests: _this.frictionlessRequests
|
|
1342
|
+
});
|
|
1343
|
+
resolve(window.FB);
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
if (window.document.getElementById('facebook-jssdk')) {
|
|
1347
|
+
return resolve(window.FB);
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
const js = window.document.createElement('script');
|
|
1351
|
+
js.id = 'facebook-jssdk';
|
|
1352
|
+
js.async = true;
|
|
1353
|
+
js.defer = true;
|
|
1354
|
+
js.src = `https://${domain}/${language}/sdk${chatSupport ? '/xfbml.customerchat' : ''}${debug ? '/debug' : ''}.js`;
|
|
1355
|
+
window.document.body.appendChild(js);
|
|
1356
|
+
});
|
|
1357
|
+
return _this.loadingPromise;
|
|
1358
|
+
})();
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
process(method, before = [], after = []) {
|
|
1362
|
+
var _this2 = this;
|
|
1363
|
+
|
|
1364
|
+
return asyncToGenerator(function* () {
|
|
1365
|
+
const fb = yield _this2.init();
|
|
1366
|
+
return new Promise((resolve, reject) => {
|
|
1367
|
+
fb[method](...before, response => {
|
|
1368
|
+
if (!response) {
|
|
1369
|
+
if (method === 'ui') return;
|
|
1370
|
+
reject(new Error('Response is undefined'));
|
|
1371
|
+
} else if (response.error) {
|
|
1372
|
+
const {
|
|
1373
|
+
code,
|
|
1374
|
+
type,
|
|
1375
|
+
message
|
|
1376
|
+
} = response.error;
|
|
1377
|
+
const error = new Error(message);
|
|
1378
|
+
error.code = code;
|
|
1379
|
+
error.type = type;
|
|
1380
|
+
reject(error);
|
|
1381
|
+
} else {
|
|
1382
|
+
resolve(response);
|
|
1383
|
+
}
|
|
1384
|
+
}, ...after);
|
|
1385
|
+
});
|
|
1386
|
+
})();
|
|
1387
|
+
}
|
|
1388
|
+
|
|
1389
|
+
ui(options) {
|
|
1390
|
+
var _this3 = this;
|
|
1391
|
+
|
|
1392
|
+
return asyncToGenerator(function* () {
|
|
1393
|
+
return _this3.process('ui', [options]);
|
|
1394
|
+
})();
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
api(path, method = Method.GET, params = {}) {
|
|
1398
|
+
var _this4 = this;
|
|
1399
|
+
|
|
1400
|
+
return asyncToGenerator(function* () {
|
|
1401
|
+
return _this4.process('api', [path, method, params]);
|
|
1402
|
+
})();
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
login(opts = null) {
|
|
1406
|
+
var _this5 = this;
|
|
1407
|
+
|
|
1408
|
+
return asyncToGenerator(function* () {
|
|
1409
|
+
return _this5.process('login', [], [opts]);
|
|
1410
|
+
})();
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
logout() {
|
|
1414
|
+
var _this6 = this;
|
|
1415
|
+
|
|
1416
|
+
return asyncToGenerator(function* () {
|
|
1417
|
+
return _this6.process('logout');
|
|
1418
|
+
})();
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
getLoginStatus() {
|
|
1422
|
+
var _this7 = this;
|
|
1423
|
+
|
|
1424
|
+
return asyncToGenerator(function* () {
|
|
1425
|
+
return _this7.process('getLoginStatus');
|
|
1426
|
+
})();
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
getAuthResponse() {
|
|
1430
|
+
var _this8 = this;
|
|
1431
|
+
|
|
1432
|
+
return asyncToGenerator(function* () {
|
|
1433
|
+
return _this8.process('getAuthResponse');
|
|
1434
|
+
})();
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
getTokenDetail(loginResponse) {
|
|
1438
|
+
var _this9 = this;
|
|
1439
|
+
|
|
1440
|
+
return asyncToGenerator(function* () {
|
|
1441
|
+
if (loginResponse.status === LoginStatus.CONNECTED && loginResponse.authResponse) {
|
|
1442
|
+
return loginResponse.authResponse;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
const response = yield _this9.getLoginStatus();
|
|
1446
|
+
|
|
1447
|
+
if (response.status === LoginStatus.CONNECTED && response.authResponse) {
|
|
1448
|
+
return response.authResponse;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
throw new Error('Token is undefined');
|
|
1452
|
+
})();
|
|
1453
|
+
}
|
|
1454
|
+
|
|
1455
|
+
getProfile(params) {
|
|
1456
|
+
var _this10 = this;
|
|
1457
|
+
|
|
1458
|
+
return asyncToGenerator(function* () {
|
|
1459
|
+
return _this10.api('/me', Method.GET, params);
|
|
1460
|
+
})();
|
|
1461
|
+
}
|
|
1462
|
+
|
|
1463
|
+
getTokenDetailWithProfile(params, response) {
|
|
1464
|
+
var _this11 = this;
|
|
1465
|
+
|
|
1466
|
+
return asyncToGenerator(function* () {
|
|
1467
|
+
const tokenDetail = yield _this11.getTokenDetail(response);
|
|
1468
|
+
const profile = yield _this11.getProfile(params);
|
|
1469
|
+
return {
|
|
1470
|
+
profile,
|
|
1471
|
+
tokenDetail
|
|
1472
|
+
};
|
|
1473
|
+
})();
|
|
1474
|
+
}
|
|
1475
|
+
|
|
1476
|
+
getToken() {
|
|
1477
|
+
var _this12 = this;
|
|
1478
|
+
|
|
1479
|
+
return asyncToGenerator(function* () {
|
|
1480
|
+
const authResponse = yield _this12.getTokenDetail();
|
|
1481
|
+
return authResponse.accessToken;
|
|
1482
|
+
})();
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
getUserId() {
|
|
1486
|
+
var _this13 = this;
|
|
1487
|
+
|
|
1488
|
+
return asyncToGenerator(function* () {
|
|
1489
|
+
const authResponse = yield _this13.getTokenDetail();
|
|
1490
|
+
return authResponse.userID;
|
|
1491
|
+
})();
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
sendInvite(to, options) {
|
|
1495
|
+
var _this14 = this;
|
|
1496
|
+
|
|
1497
|
+
return asyncToGenerator(function* () {
|
|
1498
|
+
return _this14.ui(_objectSpread({
|
|
1499
|
+
to,
|
|
1500
|
+
method: 'apprequests'
|
|
1501
|
+
}, options));
|
|
1502
|
+
})();
|
|
1503
|
+
}
|
|
1504
|
+
|
|
1505
|
+
postAction(ogNamespace, ogAction, ogObject, ogObjectUrl, noFeedStory) {
|
|
1506
|
+
var _this15 = this;
|
|
1507
|
+
|
|
1508
|
+
return asyncToGenerator(function* () {
|
|
1509
|
+
let url = `/me/${ogNamespace}:${ogAction}?${ogObject}=${encodeURIComponent(ogObjectUrl)}`;
|
|
1510
|
+
|
|
1511
|
+
if (noFeedStory === true) {
|
|
1512
|
+
url += '&no_feed_story=true';
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
return _this15.api(url, Method.POST);
|
|
1516
|
+
})();
|
|
1517
|
+
}
|
|
1518
|
+
|
|
1519
|
+
getPermissions() {
|
|
1520
|
+
var _this16 = this;
|
|
1521
|
+
|
|
1522
|
+
return asyncToGenerator(function* () {
|
|
1523
|
+
const response = yield _this16.api('/me/permissions');
|
|
1524
|
+
return response.data;
|
|
1525
|
+
})();
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
hasPermissions(permissions) {
|
|
1529
|
+
var _this17 = this;
|
|
1530
|
+
|
|
1531
|
+
return asyncToGenerator(function* () {
|
|
1532
|
+
const usersPermissions = yield _this17.getPermissions();
|
|
1533
|
+
const findedPermissions = permissions.filter(p => {
|
|
1534
|
+
const currentPermission = usersPermissions.find(row => {
|
|
1535
|
+
const {
|
|
1536
|
+
permission,
|
|
1537
|
+
status
|
|
1538
|
+
} = row;
|
|
1539
|
+
return status === 'granted' && permission === p;
|
|
1540
|
+
});
|
|
1541
|
+
return !!currentPermission;
|
|
1542
|
+
});
|
|
1543
|
+
return findedPermissions.length === permissions.length;
|
|
1544
|
+
})();
|
|
1545
|
+
}
|
|
1546
|
+
|
|
1547
|
+
subscribe(eventName, callback) {
|
|
1548
|
+
var _this18 = this;
|
|
1549
|
+
|
|
1550
|
+
return asyncToGenerator(function* () {
|
|
1551
|
+
const fb = yield _this18.init();
|
|
1552
|
+
fb.Event.subscribe(eventName, callback);
|
|
1553
|
+
})();
|
|
1554
|
+
}
|
|
1555
|
+
|
|
1556
|
+
unsubscribe(eventName, callback) {
|
|
1557
|
+
var _this19 = this;
|
|
1558
|
+
|
|
1559
|
+
return asyncToGenerator(function* () {
|
|
1560
|
+
const fb = yield _this19.init();
|
|
1561
|
+
fb.Event.unsubscribe(eventName, callback);
|
|
1562
|
+
})();
|
|
1563
|
+
}
|
|
1564
|
+
|
|
1565
|
+
parse(parentNode) {
|
|
1566
|
+
var _this20 = this;
|
|
1567
|
+
|
|
1568
|
+
return asyncToGenerator(function* () {
|
|
1569
|
+
const fb = yield _this20.init();
|
|
1570
|
+
|
|
1571
|
+
if (typeof parentNode === 'undefined') {
|
|
1572
|
+
fb.XFBML.parse();
|
|
1573
|
+
} else {
|
|
1574
|
+
fb.XFBML.parse(parentNode);
|
|
1575
|
+
}
|
|
1576
|
+
})();
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
getRequests() {
|
|
1580
|
+
var _this21 = this;
|
|
1581
|
+
|
|
1582
|
+
return asyncToGenerator(function* () {
|
|
1583
|
+
return _this21.api('/me/apprequests');
|
|
1584
|
+
})();
|
|
1585
|
+
}
|
|
1586
|
+
|
|
1587
|
+
removeRequest(requestID) {
|
|
1588
|
+
var _this22 = this;
|
|
1589
|
+
|
|
1590
|
+
return asyncToGenerator(function* () {
|
|
1591
|
+
return _this22.api(requestID, Method.DELETE);
|
|
1592
|
+
})();
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
setAutoGrow() {
|
|
1596
|
+
var _this23 = this;
|
|
1597
|
+
|
|
1598
|
+
return asyncToGenerator(function* () {
|
|
1599
|
+
const fb = yield _this23.init();
|
|
1600
|
+
fb.Canvas.setAutoGrow();
|
|
1601
|
+
})();
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
paySimple(product, quantity = 1) {
|
|
1605
|
+
var _this24 = this;
|
|
1606
|
+
|
|
1607
|
+
return asyncToGenerator(function* () {
|
|
1608
|
+
return _this24.ui({
|
|
1609
|
+
method: 'pay',
|
|
1610
|
+
action: 'purchaseitem',
|
|
1611
|
+
product,
|
|
1612
|
+
quantity
|
|
1613
|
+
});
|
|
1614
|
+
})();
|
|
1615
|
+
}
|
|
1616
|
+
|
|
1617
|
+
pay(product, options) {
|
|
1618
|
+
var _this25 = this;
|
|
1619
|
+
|
|
1620
|
+
return asyncToGenerator(function* () {
|
|
1621
|
+
return _this25.ui(_objectSpread({
|
|
1622
|
+
method: 'pay',
|
|
1623
|
+
action: 'purchaseitem',
|
|
1624
|
+
product
|
|
1625
|
+
}, options));
|
|
1626
|
+
})();
|
|
1627
|
+
}
|
|
1628
|
+
|
|
1629
|
+
}
|
|
1630
|
+
/*
|
|
1631
|
+
sendToFriends: function(options, callback) {
|
|
1632
|
+
if(!options) {
|
|
1633
|
+
options = {};
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
options.method = 'send';
|
|
1637
|
+
|
|
1638
|
+
this.afterLoad(function(err, fbApi) {
|
|
1639
|
+
if(err) {
|
|
1640
|
+
return callback(err);
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
FB.ui(options, function(response) {
|
|
1644
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1645
|
+
});
|
|
1646
|
+
});
|
|
1647
|
+
},
|
|
1648
|
+
|
|
1649
|
+
sendMessage: function(message, name, caption, description, url, imgUrl, callback) {
|
|
1650
|
+
this.afterLoad(function(err, fbApi) {
|
|
1651
|
+
if(err) {
|
|
1652
|
+
return callback(err);
|
|
1653
|
+
}
|
|
1654
|
+
|
|
1655
|
+
FB.ui({
|
|
1656
|
+
method: 'stream.publish',
|
|
1657
|
+
message: message,
|
|
1658
|
+
attachment: {
|
|
1659
|
+
name: name,
|
|
1660
|
+
caption: caption,
|
|
1661
|
+
description: description,
|
|
1662
|
+
href: url,
|
|
1663
|
+
media:[{
|
|
1664
|
+
type: 'image',
|
|
1665
|
+
src: imgUrl,
|
|
1666
|
+
href: url
|
|
1667
|
+
}]
|
|
1668
|
+
},
|
|
1669
|
+
action_links: [{
|
|
1670
|
+
text: 'Code',
|
|
1671
|
+
href: url
|
|
1672
|
+
}],
|
|
1673
|
+
user_prompt_message: message
|
|
1674
|
+
},
|
|
1675
|
+
function(response) {
|
|
1676
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1677
|
+
});
|
|
1678
|
+
});
|
|
1679
|
+
},
|
|
1680
|
+
|
|
1681
|
+
sendInviteForm: function(options, callback) {
|
|
1682
|
+
if(typeof options === 'function') {
|
|
1683
|
+
callback = options;
|
|
1684
|
+
options = {};
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
this.afterLoad(function(err, fbApi) {
|
|
1688
|
+
if(err) {
|
|
1689
|
+
return callback(err);
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
options.method = options.method || 'apprequests';
|
|
1693
|
+
|
|
1694
|
+
|
|
1695
|
+
FB.ui(options, function(response) {
|
|
1696
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1697
|
+
});
|
|
1698
|
+
});
|
|
1699
|
+
},
|
|
1700
|
+
|
|
1701
|
+
checkPageLike: function(pageID, callback) {
|
|
1702
|
+
this.afterLoad(function(err, fbApi) {
|
|
1703
|
+
if(err) {
|
|
1704
|
+
return callback(err);
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
fbApi.getUserID(function(err, userID) {
|
|
1708
|
+
if(err) {
|
|
1709
|
+
return callback(err);
|
|
1710
|
+
}
|
|
1711
|
+
|
|
1712
|
+
var fqlQuery = `SELECT uid FROM page_fan WHERE page_id = ${pageID} and uid = ${userID}`;
|
|
1713
|
+
var query = FB.Data.query(fqlQuery);
|
|
1714
|
+
|
|
1715
|
+
query.wait(function(rows) {
|
|
1716
|
+
if (rows.length === 1 && rows[0].uid === userID) {
|
|
1717
|
+
callback(null, true, query);
|
|
1718
|
+
}
|
|
1719
|
+
else {
|
|
1720
|
+
callback(null, false, query);
|
|
1721
|
+
}
|
|
1722
|
+
});
|
|
1723
|
+
});
|
|
1724
|
+
});
|
|
1725
|
+
},
|
|
1726
|
+
|
|
1727
|
+
sendMessageToFriend: function (friendID, link, callback) {
|
|
1728
|
+
this.afterLoad(function(err, fbApi) {
|
|
1729
|
+
if(err) {
|
|
1730
|
+
return callback(err);
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
FB.ui({
|
|
1734
|
+
to: friendID,
|
|
1735
|
+
method: 'send',
|
|
1736
|
+
link: link
|
|
1737
|
+
}, function(response) {
|
|
1738
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1739
|
+
});
|
|
1740
|
+
});
|
|
1741
|
+
},
|
|
1742
|
+
|
|
1743
|
+
_prepareUsers: function(data) {
|
|
1744
|
+
var users=[];
|
|
1745
|
+
|
|
1746
|
+
for(var index in data) {
|
|
1747
|
+
var userData=data[index];
|
|
1748
|
+
|
|
1749
|
+
var user = {
|
|
1750
|
+
provider_uid: 'facebook'+'_'+userData.uid,
|
|
1751
|
+
provider: 'facebook',
|
|
1752
|
+
id: userData.uid,
|
|
1753
|
+
name: userData.name,
|
|
1754
|
+
first_name: userData.first_name,
|
|
1755
|
+
last_name: userData.last_name,
|
|
1756
|
+
status: (userData.status!==null) ? userData.status : null,
|
|
1757
|
+
image: '//graph.facebook.com/'+userData.uid+'/picture?'
|
|
1758
|
+
};
|
|
1759
|
+
|
|
1760
|
+
users.push(user);
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1763
|
+
return users;
|
|
1764
|
+
},
|
|
1765
|
+
|
|
1766
|
+
getUserList: function(callback) {
|
|
1767
|
+
this.afterLoad(function(err, fbApi) {
|
|
1768
|
+
if(err) {
|
|
1769
|
+
return callback(err);
|
|
1770
|
+
}
|
|
1771
|
+
|
|
1772
|
+
FB.api('fql', {
|
|
1773
|
+
q: `
|
|
1774
|
+
SELECT uid, name, first_name, last_name, online_presence, status
|
|
1775
|
+
FROM user
|
|
1776
|
+
WHERE uid IN
|
|
1777
|
+
( SELECT uid2 FROM friend WHERE uid1 = me()) ORDER BY name
|
|
1778
|
+
`,
|
|
1779
|
+
}, function (response)
|
|
1780
|
+
{
|
|
1781
|
+
var users = fbApi._prepareUsers(response.data);
|
|
1782
|
+
callback(null, users, response);
|
|
1783
|
+
});
|
|
1784
|
+
});
|
|
1785
|
+
},
|
|
1786
|
+
|
|
1787
|
+
postFeed: function(options, callback) {
|
|
1788
|
+
this.afterLoad(function(err, fbApi) {
|
|
1789
|
+
if(err) {
|
|
1790
|
+
return callback(err);
|
|
1791
|
+
}
|
|
1792
|
+
|
|
1793
|
+
options.method='feed';
|
|
1794
|
+
|
|
1795
|
+
FB.ui(options, function(response) {
|
|
1796
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1797
|
+
});
|
|
1798
|
+
});
|
|
1799
|
+
},
|
|
1800
|
+
|
|
1801
|
+
//need publish_stream
|
|
1802
|
+
createAlbum: function(name, description, callback) {
|
|
1803
|
+
this.afterLoad(function(err, fbApi) {
|
|
1804
|
+
if(err) {
|
|
1805
|
+
return callback(err);
|
|
1806
|
+
}
|
|
1807
|
+
|
|
1808
|
+
FB.api('/me/albums', 'post', {
|
|
1809
|
+
name: name,
|
|
1810
|
+
description: description
|
|
1811
|
+
},function(response) {
|
|
1812
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1813
|
+
});
|
|
1814
|
+
});
|
|
1815
|
+
},
|
|
1816
|
+
|
|
1817
|
+
//need publish_stream
|
|
1818
|
+
addImageToAlbum: function(albumID, imageURL, message, callback) {
|
|
1819
|
+
this.afterLoad(function(err, fbApi) {
|
|
1820
|
+
if(err) {
|
|
1821
|
+
return callback(err);
|
|
1822
|
+
}
|
|
1823
|
+
|
|
1824
|
+
FB.api('/'+albumID+'/photos', 'post', {
|
|
1825
|
+
message: message,
|
|
1826
|
+
url: imageURL
|
|
1827
|
+
}, function(response) {
|
|
1828
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1829
|
+
});
|
|
1830
|
+
});
|
|
1831
|
+
},
|
|
1832
|
+
|
|
1833
|
+
//'user_photos'
|
|
1834
|
+
getAlbums: function(callback) {
|
|
1835
|
+
this.afterLoad(function(err, fbApi) {
|
|
1836
|
+
if(err) {
|
|
1837
|
+
return callback(err);
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
FB.api('/me/albums', function(response) {
|
|
1841
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1842
|
+
});
|
|
1843
|
+
});
|
|
1844
|
+
},
|
|
1845
|
+
|
|
1846
|
+
//'user_photos'
|
|
1847
|
+
getAlbumPhotos: function(albumID, callback) {
|
|
1848
|
+
this.afterLoad(function(err, fbApi) {
|
|
1849
|
+
if(err) {
|
|
1850
|
+
return callback(err);
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
FB.api('/'+albumID+'/photos', function(response) {
|
|
1854
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1855
|
+
});
|
|
1856
|
+
});
|
|
1857
|
+
},
|
|
1858
|
+
|
|
1859
|
+
//'user_photos'
|
|
1860
|
+
getAlbumCoverPicture: function(albumID, callback) {
|
|
1861
|
+
this.afterLoad(function(err, fbApi) {
|
|
1862
|
+
if(err) {
|
|
1863
|
+
return callback(err);
|
|
1864
|
+
}
|
|
1865
|
+
|
|
1866
|
+
FB.api('/'+albumID+'/picture', function(response) {
|
|
1867
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1868
|
+
});
|
|
1869
|
+
});
|
|
1870
|
+
},
|
|
1871
|
+
|
|
1872
|
+
//'publish_stream'
|
|
1873
|
+
postPhoto: function(photoUrl, message, callback) {
|
|
1874
|
+
this.afterLoad(function(err, fbApi) {
|
|
1875
|
+
if(err) {
|
|
1876
|
+
return callback(err);
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
FB.api('/me/photos', 'post', {
|
|
1880
|
+
message: message,
|
|
1881
|
+
url: photoUrl
|
|
1882
|
+
},function(response) {
|
|
1883
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1884
|
+
});
|
|
1885
|
+
});
|
|
1886
|
+
},
|
|
1887
|
+
|
|
1888
|
+
getPageInfo: function(callback) {
|
|
1889
|
+
this.afterLoad(function(err, fbApi) {
|
|
1890
|
+
if(err) {
|
|
1891
|
+
return callback(err);
|
|
1892
|
+
}
|
|
1893
|
+
|
|
1894
|
+
FB.Canvas.getPageInfo(function(response) {
|
|
1895
|
+
fbApi._callCallbackByResponse(callback, response);
|
|
1896
|
+
});
|
|
1897
|
+
});
|
|
1898
|
+
}
|
|
1899
|
+
*/
|
|
1900
|
+
|
|
1901
|
+
var FacebookContext = createContext();
|
|
1902
|
+
|
|
1903
|
+
let api = null;
|
|
1904
|
+
class Facebook$1 extends Component {
|
|
1905
|
+
constructor(...args) {
|
|
1906
|
+
var _this;
|
|
1907
|
+
|
|
1908
|
+
super(...args);
|
|
1909
|
+
_this = this;
|
|
1910
|
+
|
|
1911
|
+
defineProperty(this, "state", {
|
|
1912
|
+
isReady: false
|
|
1913
|
+
});
|
|
1914
|
+
|
|
1915
|
+
defineProperty(this, "handleInit",
|
|
1916
|
+
/*#__PURE__*/
|
|
1917
|
+
asyncToGenerator(function* () {
|
|
1918
|
+
// do not run if SSR
|
|
1919
|
+
if (!canUseDom) {
|
|
1920
|
+
throw new Error('You can not use Facebook without DOM');
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
const {
|
|
1924
|
+
isReady
|
|
1925
|
+
} = _this.state;
|
|
1926
|
+
|
|
1927
|
+
if (isReady) {
|
|
1928
|
+
return api;
|
|
1929
|
+
}
|
|
1930
|
+
|
|
1931
|
+
if (!api) {
|
|
1932
|
+
const {
|
|
1933
|
+
domain,
|
|
1934
|
+
version,
|
|
1935
|
+
appId,
|
|
1936
|
+
cookie,
|
|
1937
|
+
status,
|
|
1938
|
+
xfbml,
|
|
1939
|
+
language,
|
|
1940
|
+
frictionlessRequests,
|
|
1941
|
+
wait,
|
|
1942
|
+
debug,
|
|
1943
|
+
chatSupport
|
|
1944
|
+
} = _this.props;
|
|
1945
|
+
api = new Facebook({
|
|
1946
|
+
domain,
|
|
1947
|
+
appId,
|
|
1948
|
+
version,
|
|
1949
|
+
cookie,
|
|
1950
|
+
status,
|
|
1951
|
+
xfbml,
|
|
1952
|
+
language,
|
|
1953
|
+
frictionlessRequests,
|
|
1954
|
+
wait,
|
|
1955
|
+
debug,
|
|
1956
|
+
chatSupport
|
|
1957
|
+
});
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
yield api.init();
|
|
1961
|
+
|
|
1962
|
+
if (!_this.state.isReady) {
|
|
1963
|
+
_this.setState({
|
|
1964
|
+
isReady: true
|
|
1965
|
+
});
|
|
1966
|
+
}
|
|
1967
|
+
|
|
1968
|
+
return api;
|
|
1969
|
+
}));
|
|
1970
|
+
}
|
|
1971
|
+
|
|
1972
|
+
componentDidMount() {
|
|
1973
|
+
const {
|
|
1974
|
+
wait
|
|
1975
|
+
} = this.props;
|
|
1976
|
+
|
|
1977
|
+
if (!wait) {
|
|
1978
|
+
this.handleInit();
|
|
1979
|
+
}
|
|
1980
|
+
}
|
|
1981
|
+
|
|
1982
|
+
render() {
|
|
1983
|
+
const {
|
|
1984
|
+
children
|
|
1985
|
+
} = this.props;
|
|
1986
|
+
const {
|
|
1987
|
+
isReady,
|
|
1988
|
+
error
|
|
1989
|
+
} = this.state;
|
|
1990
|
+
const {
|
|
1991
|
+
handleInit
|
|
1992
|
+
} = this;
|
|
1993
|
+
const value = {
|
|
1994
|
+
isReady,
|
|
1995
|
+
error,
|
|
1996
|
+
handleInit,
|
|
1997
|
+
api
|
|
1998
|
+
};
|
|
1999
|
+
return React__default.createElement(FacebookContext.Provider, {
|
|
2000
|
+
value: value
|
|
2001
|
+
}, children);
|
|
2002
|
+
}
|
|
2003
|
+
|
|
2004
|
+
}
|
|
2005
|
+
|
|
2006
|
+
defineProperty(Facebook$1, "defaultProps", {
|
|
2007
|
+
version: 'v3.1',
|
|
2008
|
+
cookie: false,
|
|
2009
|
+
status: false,
|
|
2010
|
+
xfbml: false,
|
|
2011
|
+
language: 'en_US',
|
|
2012
|
+
frictionlessRequests: false,
|
|
2013
|
+
domain: 'connect.facebook.net',
|
|
2014
|
+
children: undefined,
|
|
2015
|
+
wait: false,
|
|
2016
|
+
debug: false,
|
|
2017
|
+
chatSupport: false
|
|
2018
|
+
});
|
|
2019
|
+
|
|
2020
|
+
var _extends_1 = createCommonjsModule(function (module) {
|
|
2021
|
+
function _extends() {
|
|
2022
|
+
module.exports = _extends = Object.assign || function (target) {
|
|
2023
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2024
|
+
var source = arguments[i];
|
|
2025
|
+
|
|
2026
|
+
for (var key in source) {
|
|
2027
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2028
|
+
target[key] = source[key];
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
|
|
2033
|
+
return target;
|
|
2034
|
+
};
|
|
2035
|
+
|
|
2036
|
+
return _extends.apply(this, arguments);
|
|
2037
|
+
}
|
|
2038
|
+
|
|
2039
|
+
module.exports = _extends;
|
|
2040
|
+
});
|
|
2041
|
+
|
|
2042
|
+
class Initialize extends Component {
|
|
2043
|
+
componentDidMount() {
|
|
2044
|
+
this.$isMounted = true;
|
|
2045
|
+
this.prepare();
|
|
2046
|
+
}
|
|
2047
|
+
|
|
2048
|
+
componentWillUnmount() {
|
|
2049
|
+
this.$isMounted = false;
|
|
2050
|
+
}
|
|
2051
|
+
|
|
2052
|
+
prepare() {
|
|
2053
|
+
var _this = this;
|
|
2054
|
+
|
|
2055
|
+
return asyncToGenerator(function* () {
|
|
2056
|
+
const {
|
|
2057
|
+
onReady,
|
|
2058
|
+
handleInit
|
|
2059
|
+
} = _this.props;
|
|
2060
|
+
const api = yield handleInit();
|
|
2061
|
+
|
|
2062
|
+
if (onReady && _this.$isMounted) {
|
|
2063
|
+
onReady(api);
|
|
2064
|
+
}
|
|
2065
|
+
})();
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
render() {
|
|
2069
|
+
const {
|
|
2070
|
+
children,
|
|
2071
|
+
isReady,
|
|
2072
|
+
api
|
|
2073
|
+
} = this.props;
|
|
2074
|
+
const childrenProps = {
|
|
2075
|
+
isReady,
|
|
2076
|
+
api
|
|
2077
|
+
};
|
|
2078
|
+
|
|
2079
|
+
if (typeof children === 'function') {
|
|
2080
|
+
return children(childrenProps);
|
|
2081
|
+
}
|
|
2082
|
+
|
|
2083
|
+
return children;
|
|
2084
|
+
}
|
|
2085
|
+
|
|
2086
|
+
}
|
|
2087
|
+
|
|
2088
|
+
defineProperty(Initialize, "defaultProps", {
|
|
2089
|
+
onReady: undefined,
|
|
2090
|
+
api: undefined
|
|
2091
|
+
});
|
|
2092
|
+
|
|
2093
|
+
var Initialize$1 = forwardRef((props, ref) => React__default.createElement(FacebookContext.Consumer, null, ({
|
|
2094
|
+
handleInit,
|
|
2095
|
+
isReady,
|
|
2096
|
+
api
|
|
2097
|
+
}) => React__default.createElement(Initialize, _extends_1({}, props, {
|
|
2098
|
+
handleInit: handleInit,
|
|
2099
|
+
isReady: isReady,
|
|
2100
|
+
api: api,
|
|
2101
|
+
ref: ref
|
|
2102
|
+
}))));
|
|
2103
|
+
|
|
2104
|
+
class Parser extends Component {
|
|
2105
|
+
constructor(...args) {
|
|
2106
|
+
super(...args);
|
|
2107
|
+
|
|
2108
|
+
defineProperty(this, "state", {});
|
|
2109
|
+
|
|
2110
|
+
defineProperty(this, "handleReady", api => {
|
|
2111
|
+
this.setState({
|
|
2112
|
+
api
|
|
2113
|
+
}, this.handleParse);
|
|
2114
|
+
});
|
|
2115
|
+
|
|
2116
|
+
defineProperty(this, "handleContainer", container => {
|
|
2117
|
+
this.setState({
|
|
2118
|
+
container
|
|
2119
|
+
}, this.handleParse);
|
|
2120
|
+
});
|
|
2121
|
+
|
|
2122
|
+
defineProperty(this, "handleParse", () => {
|
|
2123
|
+
const {
|
|
2124
|
+
api,
|
|
2125
|
+
container
|
|
2126
|
+
} = this.state;
|
|
2127
|
+
|
|
2128
|
+
if (!api || !container) {
|
|
2129
|
+
return;
|
|
2130
|
+
}
|
|
2131
|
+
|
|
2132
|
+
api.parse(container);
|
|
2133
|
+
});
|
|
2134
|
+
}
|
|
2135
|
+
|
|
2136
|
+
render() {
|
|
2137
|
+
const {
|
|
2138
|
+
className,
|
|
2139
|
+
children
|
|
2140
|
+
} = this.props;
|
|
2141
|
+
return React__default.createElement("div", {
|
|
2142
|
+
className: className,
|
|
2143
|
+
ref: this.handleContainer
|
|
2144
|
+
}, React__default.createElement(Initialize$1, {
|
|
2145
|
+
onReady: this.handleReady
|
|
2146
|
+
}, children({
|
|
2147
|
+
handleParse: this.handleParse
|
|
2148
|
+
})));
|
|
2149
|
+
}
|
|
2150
|
+
|
|
2151
|
+
}
|
|
2152
|
+
|
|
2153
|
+
defineProperty(Parser, "defaultProps", {
|
|
2154
|
+
className: undefined
|
|
2155
|
+
});
|
|
2156
|
+
|
|
2157
|
+
function getCurrentHref() {
|
|
2158
|
+
if (!canUseDom) {
|
|
2159
|
+
return 'https://www.facebook.com';
|
|
2160
|
+
}
|
|
2161
|
+
|
|
2162
|
+
return window.location.href;
|
|
2163
|
+
}
|
|
2164
|
+
|
|
2165
|
+
class Like extends PureComponent {
|
|
2166
|
+
componentDidUpdate() {
|
|
2167
|
+
const {
|
|
2168
|
+
handleParse
|
|
2169
|
+
} = this.props;
|
|
2170
|
+
handleParse();
|
|
2171
|
+
}
|
|
2172
|
+
|
|
2173
|
+
render() {
|
|
2174
|
+
const {
|
|
2175
|
+
href = getCurrentHref(),
|
|
2176
|
+
layout,
|
|
2177
|
+
colorScheme,
|
|
2178
|
+
action,
|
|
2179
|
+
showFaces,
|
|
2180
|
+
share,
|
|
2181
|
+
children,
|
|
2182
|
+
width,
|
|
2183
|
+
size,
|
|
2184
|
+
kidDirectedSite,
|
|
2185
|
+
referral
|
|
2186
|
+
} = this.props;
|
|
2187
|
+
return React__default.createElement("div", {
|
|
2188
|
+
className: "fb-like",
|
|
2189
|
+
"data-ref": referral,
|
|
2190
|
+
"data-href": href,
|
|
2191
|
+
"data-layout": layout,
|
|
2192
|
+
"data-colorscheme": colorScheme,
|
|
2193
|
+
"data-action": action,
|
|
2194
|
+
"data-show-faces": showFaces,
|
|
2195
|
+
"data-share": share,
|
|
2196
|
+
"data-width": width,
|
|
2197
|
+
"data-size": size,
|
|
2198
|
+
"data-kid-directed-site": kidDirectedSite
|
|
2199
|
+
}, children);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2202
|
+
}
|
|
2203
|
+
|
|
2204
|
+
defineProperty(Like, "defaultProps", {
|
|
2205
|
+
layout: undefined,
|
|
2206
|
+
showFaces: undefined,
|
|
2207
|
+
colorScheme: undefined,
|
|
2208
|
+
action: undefined,
|
|
2209
|
+
share: undefined,
|
|
2210
|
+
size: undefined,
|
|
2211
|
+
kidDirectedSite: undefined,
|
|
2212
|
+
children: undefined,
|
|
2213
|
+
href: undefined,
|
|
2214
|
+
referral: undefined,
|
|
2215
|
+
width: undefined
|
|
2216
|
+
});
|
|
2217
|
+
|
|
2218
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2219
|
+
handleParse
|
|
2220
|
+
}) => React__default.createElement(Like, _extends_1({}, props, {
|
|
2221
|
+
handleParse: handleParse,
|
|
2222
|
+
ref: ref
|
|
2223
|
+
}))));
|
|
2224
|
+
|
|
2225
|
+
function clearUndefinedProperties(obj) {
|
|
2226
|
+
if (!obj) {
|
|
2227
|
+
return obj;
|
|
2228
|
+
}
|
|
2229
|
+
|
|
2230
|
+
const newObj = {};
|
|
2231
|
+
Object.keys(obj).forEach(propertyName => {
|
|
2232
|
+
const value = obj[propertyName];
|
|
2233
|
+
|
|
2234
|
+
if (value !== undefined) {
|
|
2235
|
+
newObj[propertyName] = value;
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
return newObj;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
class Process extends Component {
|
|
2242
|
+
constructor(...args) {
|
|
2243
|
+
var _this;
|
|
2244
|
+
|
|
2245
|
+
super(...args);
|
|
2246
|
+
_this = this;
|
|
2247
|
+
|
|
2248
|
+
defineProperty(this, "state", {
|
|
2249
|
+
api: undefined
|
|
2250
|
+
});
|
|
2251
|
+
|
|
2252
|
+
defineProperty(this, "handleProcess",
|
|
2253
|
+
/*#__PURE__*/
|
|
2254
|
+
function () {
|
|
2255
|
+
var _ref = asyncToGenerator(function* (fn, handleSuccess = () => {}) {
|
|
2256
|
+
_this.setState({
|
|
2257
|
+
data: undefined,
|
|
2258
|
+
error: undefined,
|
|
2259
|
+
loading: true
|
|
2260
|
+
});
|
|
2261
|
+
|
|
2262
|
+
try {
|
|
2263
|
+
const {
|
|
2264
|
+
api
|
|
2265
|
+
} = _this.state;
|
|
2266
|
+
|
|
2267
|
+
if (!api) {
|
|
2268
|
+
throw new Error('Facebook is not initialized. Wait for isReady');
|
|
2269
|
+
}
|
|
2270
|
+
|
|
2271
|
+
const data = yield fn(api);
|
|
2272
|
+
|
|
2273
|
+
_this.setState({
|
|
2274
|
+
data,
|
|
2275
|
+
loading: false
|
|
2276
|
+
}, handleSuccess);
|
|
2277
|
+
|
|
2278
|
+
return data;
|
|
2279
|
+
} catch (error) {
|
|
2280
|
+
_this.setState({
|
|
2281
|
+
error,
|
|
2282
|
+
loading: false
|
|
2283
|
+
});
|
|
2284
|
+
|
|
2285
|
+
throw error;
|
|
2286
|
+
}
|
|
2287
|
+
});
|
|
2288
|
+
|
|
2289
|
+
return function (_x) {
|
|
2290
|
+
return _ref.apply(this, arguments);
|
|
2291
|
+
};
|
|
2292
|
+
}());
|
|
2293
|
+
|
|
2294
|
+
defineProperty(this, "handleReady", api => {
|
|
2295
|
+
this.setState({
|
|
2296
|
+
api
|
|
2297
|
+
});
|
|
2298
|
+
});
|
|
2299
|
+
}
|
|
2300
|
+
|
|
2301
|
+
render() {
|
|
2302
|
+
const {
|
|
2303
|
+
children
|
|
2304
|
+
} = this.props;
|
|
2305
|
+
const {
|
|
2306
|
+
api,
|
|
2307
|
+
loading,
|
|
2308
|
+
data,
|
|
2309
|
+
error
|
|
2310
|
+
} = this.state;
|
|
2311
|
+
return React__default.createElement(Initialize$1, {
|
|
2312
|
+
onReady: this.handleReady
|
|
2313
|
+
}, children({
|
|
2314
|
+
loading: !api || loading,
|
|
2315
|
+
handleProcess: this.handleProcess,
|
|
2316
|
+
data,
|
|
2317
|
+
error
|
|
2318
|
+
}));
|
|
2319
|
+
}
|
|
2320
|
+
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
class Send extends Component {
|
|
2324
|
+
constructor(...args) {
|
|
2325
|
+
var _this;
|
|
2326
|
+
|
|
2327
|
+
super(...args);
|
|
2328
|
+
_this = this;
|
|
2329
|
+
|
|
2330
|
+
defineProperty(this, "handleClick",
|
|
2331
|
+
/*#__PURE__*/
|
|
2332
|
+
function () {
|
|
2333
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2334
|
+
evn.preventDefault();
|
|
2335
|
+
const {
|
|
2336
|
+
handleProcess
|
|
2337
|
+
} = _this.props;
|
|
2338
|
+
return handleProcess(
|
|
2339
|
+
/*#__PURE__*/
|
|
2340
|
+
function () {
|
|
2341
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2342
|
+
const {
|
|
2343
|
+
link = getCurrentHref(),
|
|
2344
|
+
display,
|
|
2345
|
+
appId = api.getAppId(),
|
|
2346
|
+
to,
|
|
2347
|
+
redirectURI
|
|
2348
|
+
} = _this.props;
|
|
2349
|
+
return api.ui(clearUndefinedProperties({
|
|
2350
|
+
method: 'send',
|
|
2351
|
+
link,
|
|
2352
|
+
display,
|
|
2353
|
+
app_id: appId,
|
|
2354
|
+
to,
|
|
2355
|
+
redirect_uri: redirectURI
|
|
2356
|
+
}));
|
|
2357
|
+
});
|
|
2358
|
+
|
|
2359
|
+
return function (_x2) {
|
|
2360
|
+
return _ref2.apply(this, arguments);
|
|
2361
|
+
};
|
|
2362
|
+
}());
|
|
2363
|
+
});
|
|
2364
|
+
|
|
2365
|
+
return function (_x) {
|
|
2366
|
+
return _ref.apply(this, arguments);
|
|
2367
|
+
};
|
|
2368
|
+
}());
|
|
2369
|
+
}
|
|
2370
|
+
|
|
2371
|
+
render() {
|
|
2372
|
+
const {
|
|
2373
|
+
children,
|
|
2374
|
+
loading
|
|
2375
|
+
} = this.props;
|
|
2376
|
+
return children({
|
|
2377
|
+
loading,
|
|
2378
|
+
handleClick: this.handleClick
|
|
2379
|
+
});
|
|
2380
|
+
}
|
|
2381
|
+
|
|
2382
|
+
}
|
|
2383
|
+
|
|
2384
|
+
defineProperty(Send, "defaultProps", {
|
|
2385
|
+
to: undefined,
|
|
2386
|
+
display: undefined,
|
|
2387
|
+
appId: undefined,
|
|
2388
|
+
redirectURI: undefined
|
|
2389
|
+
});
|
|
2390
|
+
|
|
2391
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2392
|
+
loading,
|
|
2393
|
+
handleProcess
|
|
2394
|
+
}) => React__default.createElement(Send, _extends_1({}, props, {
|
|
2395
|
+
loading: loading,
|
|
2396
|
+
handleProcess: handleProcess,
|
|
2397
|
+
ref: ref
|
|
2398
|
+
}))));
|
|
2399
|
+
|
|
2400
|
+
class Share extends Component {
|
|
2401
|
+
constructor(...args) {
|
|
2402
|
+
var _this;
|
|
2403
|
+
|
|
2404
|
+
super(...args);
|
|
2405
|
+
_this = this;
|
|
2406
|
+
|
|
2407
|
+
defineProperty(this, "handleClick",
|
|
2408
|
+
/*#__PURE__*/
|
|
2409
|
+
function () {
|
|
2410
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2411
|
+
evn.preventDefault();
|
|
2412
|
+
const {
|
|
2413
|
+
handleProcess
|
|
2414
|
+
} = _this.props;
|
|
2415
|
+
return handleProcess(
|
|
2416
|
+
/*#__PURE__*/
|
|
2417
|
+
function () {
|
|
2418
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2419
|
+
const {
|
|
2420
|
+
href = getCurrentHref(),
|
|
2421
|
+
display,
|
|
2422
|
+
appId = api.getAppId(),
|
|
2423
|
+
hashtag,
|
|
2424
|
+
redirectURI,
|
|
2425
|
+
quote,
|
|
2426
|
+
mobileIframe
|
|
2427
|
+
} = _this.props;
|
|
2428
|
+
return api.ui(clearUndefinedProperties({
|
|
2429
|
+
method: 'share',
|
|
2430
|
+
href,
|
|
2431
|
+
display,
|
|
2432
|
+
app_id: appId,
|
|
2433
|
+
hashtag,
|
|
2434
|
+
redirect_uri: redirectURI,
|
|
2435
|
+
quote,
|
|
2436
|
+
mobile_iframe: mobileIframe
|
|
2437
|
+
}));
|
|
2438
|
+
});
|
|
2439
|
+
|
|
2440
|
+
return function (_x2) {
|
|
2441
|
+
return _ref2.apply(this, arguments);
|
|
2442
|
+
};
|
|
2443
|
+
}());
|
|
2444
|
+
});
|
|
2445
|
+
|
|
2446
|
+
return function (_x) {
|
|
2447
|
+
return _ref.apply(this, arguments);
|
|
2448
|
+
};
|
|
2449
|
+
}());
|
|
2450
|
+
}
|
|
2451
|
+
|
|
2452
|
+
render() {
|
|
2453
|
+
const {
|
|
2454
|
+
children,
|
|
2455
|
+
loading,
|
|
2456
|
+
error,
|
|
2457
|
+
data
|
|
2458
|
+
} = this.props;
|
|
2459
|
+
return children({
|
|
2460
|
+
loading,
|
|
2461
|
+
handleClick: this.handleClick,
|
|
2462
|
+
error,
|
|
2463
|
+
data
|
|
2464
|
+
});
|
|
2465
|
+
}
|
|
2466
|
+
|
|
2467
|
+
}
|
|
2468
|
+
|
|
2469
|
+
defineProperty(Share, "defaultProps", {
|
|
2470
|
+
href: undefined,
|
|
2471
|
+
hashtag: undefined,
|
|
2472
|
+
quote: undefined,
|
|
2473
|
+
mobileIframe: undefined,
|
|
2474
|
+
display: undefined,
|
|
2475
|
+
appId: undefined,
|
|
2476
|
+
redirectURI: undefined
|
|
2477
|
+
});
|
|
2478
|
+
|
|
2479
|
+
var Share$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2480
|
+
loading,
|
|
2481
|
+
handleProcess,
|
|
2482
|
+
data,
|
|
2483
|
+
error
|
|
2484
|
+
}) => React__default.createElement(Share, _extends_1({}, props, {
|
|
2485
|
+
loading: loading,
|
|
2486
|
+
handleProcess: handleProcess,
|
|
2487
|
+
data: data,
|
|
2488
|
+
error: error,
|
|
2489
|
+
ref: ref
|
|
2490
|
+
}))));
|
|
2491
|
+
|
|
2492
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2493
|
+
|
|
2494
|
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2495
|
+
function ShareButton(props) {
|
|
2496
|
+
const {
|
|
2497
|
+
className,
|
|
2498
|
+
children
|
|
2499
|
+
} = props,
|
|
2500
|
+
rest = objectWithoutProperties(props, ["className", "children"]);
|
|
2501
|
+
|
|
2502
|
+
return React__default.createElement(Share$1, rest, ({
|
|
2503
|
+
loading,
|
|
2504
|
+
handleClick
|
|
2505
|
+
}) => React__default.createElement("button", {
|
|
2506
|
+
type: "button",
|
|
2507
|
+
disabled: loading,
|
|
2508
|
+
className: className,
|
|
2509
|
+
onClick: handleClick
|
|
2510
|
+
}, children));
|
|
2511
|
+
}
|
|
2512
|
+
ShareButton.defaultProps = _objectSpread$1({}, Share$1.defaultProps, {
|
|
2513
|
+
className: undefined
|
|
2514
|
+
});
|
|
2515
|
+
|
|
2516
|
+
class Page extends PureComponent {
|
|
2517
|
+
componentDidUpdate() {
|
|
2518
|
+
const {
|
|
2519
|
+
handleParse
|
|
2520
|
+
} = this.props;
|
|
2521
|
+
handleParse();
|
|
2522
|
+
}
|
|
2523
|
+
|
|
2524
|
+
render() {
|
|
2525
|
+
const {
|
|
2526
|
+
style,
|
|
2527
|
+
href = getCurrentHref(),
|
|
2528
|
+
tabs,
|
|
2529
|
+
hideCover,
|
|
2530
|
+
width,
|
|
2531
|
+
height,
|
|
2532
|
+
showFacepile,
|
|
2533
|
+
hideCTA,
|
|
2534
|
+
smallHeader,
|
|
2535
|
+
adaptContainerWidth,
|
|
2536
|
+
children
|
|
2537
|
+
} = this.props;
|
|
2538
|
+
return React__default.createElement("div", {
|
|
2539
|
+
className: "fb-page",
|
|
2540
|
+
style: style,
|
|
2541
|
+
"data-tabs": tabs,
|
|
2542
|
+
"data-hide-cover": hideCover,
|
|
2543
|
+
"data-show-facepile": showFacepile,
|
|
2544
|
+
"data-hide-cta": hideCTA,
|
|
2545
|
+
"data-href": href,
|
|
2546
|
+
"data-small-header": smallHeader,
|
|
2547
|
+
"data-adapt-container-width": adaptContainerWidth,
|
|
2548
|
+
"data-height": height,
|
|
2549
|
+
"data-width": width
|
|
2550
|
+
}, children);
|
|
2551
|
+
}
|
|
2552
|
+
|
|
2553
|
+
}
|
|
2554
|
+
|
|
2555
|
+
defineProperty(Page, "defaultProps", {
|
|
2556
|
+
width: undefined,
|
|
2557
|
+
height: undefined,
|
|
2558
|
+
tabs: undefined,
|
|
2559
|
+
hideCover: undefined,
|
|
2560
|
+
showFacepile: undefined,
|
|
2561
|
+
hideCTA: undefined,
|
|
2562
|
+
smallHeader: undefined,
|
|
2563
|
+
adaptContainerWidth: undefined,
|
|
2564
|
+
children: undefined,
|
|
2565
|
+
style: undefined,
|
|
2566
|
+
href: undefined
|
|
2567
|
+
});
|
|
2568
|
+
|
|
2569
|
+
var Page$1 = forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
2570
|
+
handleParse
|
|
2571
|
+
}) => React__default.createElement(Page, _extends_1({}, props, {
|
|
2572
|
+
handleParse: handleParse,
|
|
2573
|
+
ref: ref
|
|
2574
|
+
}))));
|
|
2575
|
+
|
|
2576
|
+
// 3.0 fields without app review https://developers.facebook.com/docs/facebook-login/permissions/?locale=en_US#reference-default
|
|
2577
|
+
var Fields = ['id', 'first_name', 'last_name', 'middle_name', 'name', 'name_format', 'picture', 'short_name', 'email'];
|
|
2578
|
+
|
|
2579
|
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
2580
|
+
|
|
2581
|
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
2582
|
+
|
|
2583
|
+
class Login extends Component {
|
|
2584
|
+
constructor(...args) {
|
|
2585
|
+
var _this;
|
|
2586
|
+
|
|
2587
|
+
super(...args);
|
|
2588
|
+
_this = this;
|
|
2589
|
+
|
|
2590
|
+
defineProperty(this, "handleClick",
|
|
2591
|
+
/*#__PURE__*/
|
|
2592
|
+
function () {
|
|
2593
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
2594
|
+
evn.preventDefault();
|
|
2595
|
+
const {
|
|
2596
|
+
handleProcess,
|
|
2597
|
+
onCompleted,
|
|
2598
|
+
onError,
|
|
2599
|
+
onSuccess
|
|
2600
|
+
} = _this.props;
|
|
2601
|
+
|
|
2602
|
+
try {
|
|
2603
|
+
yield handleProcess(
|
|
2604
|
+
/*#__PURE__*/
|
|
2605
|
+
function () {
|
|
2606
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
2607
|
+
const {
|
|
2608
|
+
scope,
|
|
2609
|
+
fields,
|
|
2610
|
+
returnScopes,
|
|
2611
|
+
rerequest,
|
|
2612
|
+
reauthorize,
|
|
2613
|
+
eventKey
|
|
2614
|
+
} = _this.props;
|
|
2615
|
+
const loginQpts = {
|
|
2616
|
+
scope
|
|
2617
|
+
};
|
|
2618
|
+
const authType = [];
|
|
2619
|
+
|
|
2620
|
+
if (returnScopes) {
|
|
2621
|
+
loginQpts.return_scopes = true;
|
|
2622
|
+
}
|
|
2623
|
+
|
|
2624
|
+
if (rerequest) {
|
|
2625
|
+
authType.push('rerequest');
|
|
2626
|
+
}
|
|
2627
|
+
|
|
2628
|
+
if (reauthorize) {
|
|
2629
|
+
authType.push('reauthenticate');
|
|
2630
|
+
}
|
|
2631
|
+
|
|
2632
|
+
if (authType.length) {
|
|
2633
|
+
loginQpts.auth_type = authType.join(',');
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
const loginResponse = yield api.login(loginQpts);
|
|
2637
|
+
|
|
2638
|
+
if (loginResponse.status !== 'connected') {
|
|
2639
|
+
throw new Error('Unauthorized user');
|
|
2640
|
+
}
|
|
2641
|
+
|
|
2642
|
+
const data = yield api.getTokenDetailWithProfile({
|
|
2643
|
+
fields
|
|
2644
|
+
}, loginResponse);
|
|
2645
|
+
|
|
2646
|
+
if (onCompleted) {
|
|
2647
|
+
yield onCompleted(_objectSpread$2({}, data, {
|
|
2648
|
+
eventKey
|
|
2649
|
+
}));
|
|
2650
|
+
}
|
|
2651
|
+
|
|
2652
|
+
return data;
|
|
2653
|
+
});
|
|
2654
|
+
|
|
2655
|
+
return function (_x2) {
|
|
2656
|
+
return _ref2.apply(this, arguments);
|
|
2657
|
+
};
|
|
2658
|
+
}(), onSuccess);
|
|
2659
|
+
} catch (error) {
|
|
2660
|
+
if (onError) {
|
|
2661
|
+
onError(error);
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
});
|
|
2665
|
+
|
|
2666
|
+
return function (_x) {
|
|
2667
|
+
return _ref.apply(this, arguments);
|
|
2668
|
+
};
|
|
2669
|
+
}());
|
|
2670
|
+
}
|
|
2671
|
+
|
|
2672
|
+
render() {
|
|
2673
|
+
const {
|
|
2674
|
+
children,
|
|
2675
|
+
loading,
|
|
2676
|
+
error,
|
|
2677
|
+
data
|
|
2678
|
+
} = this.props;
|
|
2679
|
+
return children({
|
|
2680
|
+
loading,
|
|
2681
|
+
handleClick: this.handleClick,
|
|
2682
|
+
error,
|
|
2683
|
+
data
|
|
2684
|
+
});
|
|
2685
|
+
}
|
|
2686
|
+
|
|
2687
|
+
}
|
|
2688
|
+
|
|
2689
|
+
defineProperty(Login, "defaultProps", {
|
|
2690
|
+
scope: '',
|
|
2691
|
+
fields: Fields,
|
|
2692
|
+
returnScopes: false,
|
|
2693
|
+
rerequest: false,
|
|
2694
|
+
reauthorize: false,
|
|
2695
|
+
onCompleted: undefined,
|
|
2696
|
+
onError: undefined,
|
|
2697
|
+
eventKey: undefined
|
|
2698
|
+
});
|
|
2699
|
+
|
|
2700
|
+
var Login$1 = forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
2701
|
+
loading,
|
|
2702
|
+
handleProcess,
|
|
2703
|
+
data,
|
|
2704
|
+
error
|
|
2705
|
+
}) => React__default.createElement(Login, _extends_1({}, props, {
|
|
2706
|
+
loading: loading,
|
|
2707
|
+
handleProcess: handleProcess,
|
|
2708
|
+
data: data,
|
|
2709
|
+
error: error,
|
|
2710
|
+
ref: ref
|
|
2711
|
+
}))));
|
|
2712
|
+
|
|
2713
|
+
var spin = createCommonjsModule(function (module) {
|
|
2714
|
+
(function (root, factory) {
|
|
2715
|
+
|
|
2716
|
+
/* CommonJS */
|
|
2717
|
+
if ( module.exports) module.exports = factory();
|
|
2718
|
+
|
|
2719
|
+
/* AMD module */
|
|
2720
|
+
else root.Spinner = factory();
|
|
2721
|
+
}(commonjsGlobal, function () {
|
|
2722
|
+
|
|
2723
|
+
var prefixes = ['webkit', 'Moz', 'ms', 'O'] /* Vendor prefixes */
|
|
2724
|
+
, animations = {} /* Animation rules keyed by their name */
|
|
2725
|
+
, useCssAnimations /* Whether to use CSS animations or setTimeout */
|
|
2726
|
+
, sheet; /* A stylesheet to hold the @keyframe or VML rules. */
|
|
2727
|
+
|
|
2728
|
+
/**
|
|
2729
|
+
* Utility function to create elements. If no tag name is given,
|
|
2730
|
+
* a DIV is created. Optionally properties can be passed.
|
|
2731
|
+
*/
|
|
2732
|
+
function createEl (tag, prop) {
|
|
2733
|
+
var el = document.createElement(tag || 'div')
|
|
2734
|
+
, n;
|
|
2735
|
+
|
|
2736
|
+
for (n in prop) el[n] = prop[n];
|
|
2737
|
+
return el
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2740
|
+
/**
|
|
2741
|
+
* Appends children and returns the parent.
|
|
2742
|
+
*/
|
|
2743
|
+
function ins (parent /* child1, child2, ...*/) {
|
|
2744
|
+
for (var i = 1, n = arguments.length; i < n; i++) {
|
|
2745
|
+
parent.appendChild(arguments[i]);
|
|
2746
|
+
}
|
|
2747
|
+
|
|
2748
|
+
return parent
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2751
|
+
/**
|
|
2752
|
+
* Creates an opacity keyframe animation rule and returns its name.
|
|
2753
|
+
* Since most mobile Webkits have timing issues with animation-delay,
|
|
2754
|
+
* we create separate rules for each line/segment.
|
|
2755
|
+
*/
|
|
2756
|
+
function addAnimation (alpha, trail, i, lines) {
|
|
2757
|
+
var name = ['opacity', trail, ~~(alpha * 100), i, lines].join('-')
|
|
2758
|
+
, start = 0.01 + i/lines * 100
|
|
2759
|
+
, z = Math.max(1 - (1-alpha) / trail * (100-start), alpha)
|
|
2760
|
+
, prefix = useCssAnimations.substring(0, useCssAnimations.indexOf('Animation')).toLowerCase()
|
|
2761
|
+
, pre = prefix && '-' + prefix + '-' || '';
|
|
2762
|
+
|
|
2763
|
+
if (!animations[name]) {
|
|
2764
|
+
sheet.insertRule(
|
|
2765
|
+
'@' + pre + 'keyframes ' + name + '{' +
|
|
2766
|
+
'0%{opacity:' + z + '}' +
|
|
2767
|
+
start + '%{opacity:' + alpha + '}' +
|
|
2768
|
+
(start+0.01) + '%{opacity:1}' +
|
|
2769
|
+
(start+trail) % 100 + '%{opacity:' + alpha + '}' +
|
|
2770
|
+
'100%{opacity:' + z + '}' +
|
|
2771
|
+
'}', sheet.cssRules.length);
|
|
2772
|
+
|
|
2773
|
+
animations[name] = 1;
|
|
2774
|
+
}
|
|
2775
|
+
|
|
2776
|
+
return name
|
|
2777
|
+
}
|
|
2778
|
+
|
|
2779
|
+
/**
|
|
2780
|
+
* Tries various vendor prefixes and returns the first supported property.
|
|
2781
|
+
*/
|
|
2782
|
+
function vendor (el, prop) {
|
|
2783
|
+
var s = el.style
|
|
2784
|
+
, pp
|
|
2785
|
+
, i;
|
|
2786
|
+
|
|
2787
|
+
prop = prop.charAt(0).toUpperCase() + prop.slice(1);
|
|
2788
|
+
if (s[prop] !== undefined) return prop
|
|
2789
|
+
for (i = 0; i < prefixes.length; i++) {
|
|
2790
|
+
pp = prefixes[i]+prop;
|
|
2791
|
+
if (s[pp] !== undefined) return pp
|
|
2792
|
+
}
|
|
2793
|
+
}
|
|
2794
|
+
|
|
2795
|
+
/**
|
|
2796
|
+
* Sets multiple style properties at once.
|
|
2797
|
+
*/
|
|
2798
|
+
function css (el, prop) {
|
|
2799
|
+
for (var n in prop) {
|
|
2800
|
+
el.style[vendor(el, n) || n] = prop[n];
|
|
2801
|
+
}
|
|
2802
|
+
|
|
2803
|
+
return el
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* Fills in default values.
|
|
2808
|
+
*/
|
|
2809
|
+
function merge (obj) {
|
|
2810
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
2811
|
+
var def = arguments[i];
|
|
2812
|
+
for (var n in def) {
|
|
2813
|
+
if (obj[n] === undefined) obj[n] = def[n];
|
|
2814
|
+
}
|
|
2815
|
+
}
|
|
2816
|
+
return obj
|
|
2817
|
+
}
|
|
2818
|
+
|
|
2819
|
+
/**
|
|
2820
|
+
* Returns the line color from the given string or array.
|
|
2821
|
+
*/
|
|
2822
|
+
function getColor (color, idx) {
|
|
2823
|
+
return typeof color == 'string' ? color : color[idx % color.length]
|
|
2824
|
+
}
|
|
2825
|
+
|
|
2826
|
+
// Built-in defaults
|
|
2827
|
+
|
|
2828
|
+
var defaults = {
|
|
2829
|
+
lines: 12 // The number of lines to draw
|
|
2830
|
+
, length: 7 // The length of each line
|
|
2831
|
+
, width: 5 // The line thickness
|
|
2832
|
+
, radius: 10 // The radius of the inner circle
|
|
2833
|
+
, scale: 1.0 // Scales overall size of the spinner
|
|
2834
|
+
, corners: 1 // Roundness (0..1)
|
|
2835
|
+
, color: '#000' // #rgb or #rrggbb
|
|
2836
|
+
, opacity: 1/4 // Opacity of the lines
|
|
2837
|
+
, rotate: 0 // Rotation offset
|
|
2838
|
+
, direction: 1 // 1: clockwise, -1: counterclockwise
|
|
2839
|
+
, speed: 1 // Rounds per second
|
|
2840
|
+
, trail: 100 // Afterglow percentage
|
|
2841
|
+
, fps: 20 // Frames per second when using setTimeout()
|
|
2842
|
+
, zIndex: 2e9 // Use a high z-index by default
|
|
2843
|
+
, className: 'spinner' // CSS class to assign to the element
|
|
2844
|
+
, top: '50%' // center vertically
|
|
2845
|
+
, left: '50%' // center horizontally
|
|
2846
|
+
, shadow: false // Whether to render a shadow
|
|
2847
|
+
, hwaccel: false // Whether to use hardware acceleration (might be buggy)
|
|
2848
|
+
, position: 'absolute' // Element positioning
|
|
2849
|
+
};
|
|
2850
|
+
|
|
2851
|
+
/** The constructor */
|
|
2852
|
+
function Spinner (o) {
|
|
2853
|
+
this.opts = merge(o || {}, Spinner.defaults, defaults);
|
|
2854
|
+
}
|
|
2855
|
+
|
|
2856
|
+
// Global defaults that override the built-ins:
|
|
2857
|
+
Spinner.defaults = {};
|
|
2858
|
+
|
|
2859
|
+
merge(Spinner.prototype, {
|
|
2860
|
+
/**
|
|
2861
|
+
* Adds the spinner to the given target element. If this instance is already
|
|
2862
|
+
* spinning, it is automatically removed from its previous target b calling
|
|
2863
|
+
* stop() internally.
|
|
2864
|
+
*/
|
|
2865
|
+
spin: function (target) {
|
|
2866
|
+
this.stop();
|
|
2867
|
+
|
|
2868
|
+
var self = this
|
|
2869
|
+
, o = self.opts
|
|
2870
|
+
, el = self.el = createEl(null, {className: o.className});
|
|
2871
|
+
|
|
2872
|
+
css(el, {
|
|
2873
|
+
position: o.position
|
|
2874
|
+
, width: 0
|
|
2875
|
+
, zIndex: o.zIndex
|
|
2876
|
+
, left: o.left
|
|
2877
|
+
, top: o.top
|
|
2878
|
+
});
|
|
2879
|
+
|
|
2880
|
+
if (target) {
|
|
2881
|
+
target.insertBefore(el, target.firstChild || null);
|
|
2882
|
+
}
|
|
2883
|
+
|
|
2884
|
+
el.setAttribute('role', 'progressbar');
|
|
2885
|
+
self.lines(el, self.opts);
|
|
2886
|
+
|
|
2887
|
+
if (!useCssAnimations) {
|
|
2888
|
+
// No CSS animation support, use setTimeout() instead
|
|
2889
|
+
var i = 0
|
|
2890
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2891
|
+
, alpha
|
|
2892
|
+
, fps = o.fps
|
|
2893
|
+
, f = fps / o.speed
|
|
2894
|
+
, ostep = (1 - o.opacity) / (f * o.trail / 100)
|
|
2895
|
+
, astep = f / o.lines
|
|
2896
|
+
|
|
2897
|
+
;(function anim () {
|
|
2898
|
+
i++;
|
|
2899
|
+
for (var j = 0; j < o.lines; j++) {
|
|
2900
|
+
alpha = Math.max(1 - (i + (o.lines - j) * astep) % f * ostep, o.opacity);
|
|
2901
|
+
|
|
2902
|
+
self.opacity(el, j * o.direction + start, alpha, o);
|
|
2903
|
+
}
|
|
2904
|
+
self.timeout = self.el && setTimeout(anim, ~~(1000 / fps));
|
|
2905
|
+
})();
|
|
2906
|
+
}
|
|
2907
|
+
return self
|
|
2908
|
+
}
|
|
2909
|
+
|
|
2910
|
+
/**
|
|
2911
|
+
* Stops and removes the Spinner.
|
|
2912
|
+
*/
|
|
2913
|
+
, stop: function () {
|
|
2914
|
+
var el = this.el;
|
|
2915
|
+
if (el) {
|
|
2916
|
+
clearTimeout(this.timeout);
|
|
2917
|
+
if (el.parentNode) el.parentNode.removeChild(el);
|
|
2918
|
+
this.el = undefined;
|
|
2919
|
+
}
|
|
2920
|
+
return this
|
|
2921
|
+
}
|
|
2922
|
+
|
|
2923
|
+
/**
|
|
2924
|
+
* Internal method that draws the individual lines. Will be overwritten
|
|
2925
|
+
* in VML fallback mode below.
|
|
2926
|
+
*/
|
|
2927
|
+
, lines: function (el, o) {
|
|
2928
|
+
var i = 0
|
|
2929
|
+
, start = (o.lines - 1) * (1 - o.direction) / 2
|
|
2930
|
+
, seg;
|
|
2931
|
+
|
|
2932
|
+
function fill (color, shadow) {
|
|
2933
|
+
return css(createEl(), {
|
|
2934
|
+
position: 'absolute'
|
|
2935
|
+
, width: o.scale * (o.length + o.width) + 'px'
|
|
2936
|
+
, height: o.scale * o.width + 'px'
|
|
2937
|
+
, background: color
|
|
2938
|
+
, boxShadow: shadow
|
|
2939
|
+
, transformOrigin: 'left'
|
|
2940
|
+
, transform: 'rotate(' + ~~(360/o.lines*i + o.rotate) + 'deg) translate(' + o.scale*o.radius + 'px' + ',0)'
|
|
2941
|
+
, borderRadius: (o.corners * o.scale * o.width >> 1) + 'px'
|
|
2942
|
+
})
|
|
2943
|
+
}
|
|
2944
|
+
|
|
2945
|
+
for (; i < o.lines; i++) {
|
|
2946
|
+
seg = css(createEl(), {
|
|
2947
|
+
position: 'absolute'
|
|
2948
|
+
, top: 1 + ~(o.scale * o.width / 2) + 'px'
|
|
2949
|
+
, transform: o.hwaccel ? 'translate3d(0,0,0)' : ''
|
|
2950
|
+
, opacity: o.opacity
|
|
2951
|
+
, animation: useCssAnimations && addAnimation(o.opacity, o.trail, start + i * o.direction, o.lines) + ' ' + 1 / o.speed + 's linear infinite'
|
|
2952
|
+
});
|
|
2953
|
+
|
|
2954
|
+
if (o.shadow) ins(seg, css(fill('#000', '0 0 4px #000'), {top: '2px'}));
|
|
2955
|
+
ins(el, ins(seg, fill(getColor(o.color, i), '0 0 1px rgba(0,0,0,.1)')));
|
|
2956
|
+
}
|
|
2957
|
+
return el
|
|
2958
|
+
}
|
|
2959
|
+
|
|
2960
|
+
/**
|
|
2961
|
+
* Internal method that adjusts the opacity of a single line.
|
|
2962
|
+
* Will be overwritten in VML fallback mode below.
|
|
2963
|
+
*/
|
|
2964
|
+
, opacity: function (el, i, val) {
|
|
2965
|
+
if (i < el.childNodes.length) el.childNodes[i].style.opacity = val;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
});
|
|
2969
|
+
|
|
2970
|
+
|
|
2971
|
+
function initVML () {
|
|
2972
|
+
|
|
2973
|
+
/* Utility function to create a VML tag */
|
|
2974
|
+
function vml (tag, attr) {
|
|
2975
|
+
return createEl('<' + tag + ' xmlns="urn:schemas-microsoft.com:vml" class="spin-vml">', attr)
|
|
2976
|
+
}
|
|
2977
|
+
|
|
2978
|
+
// No CSS transforms but VML support, add a CSS rule for VML elements:
|
|
2979
|
+
sheet.addRule('.spin-vml', 'behavior:url(#default#VML)');
|
|
2980
|
+
|
|
2981
|
+
Spinner.prototype.lines = function (el, o) {
|
|
2982
|
+
var r = o.scale * (o.length + o.width)
|
|
2983
|
+
, s = o.scale * 2 * r;
|
|
2984
|
+
|
|
2985
|
+
function grp () {
|
|
2986
|
+
return css(
|
|
2987
|
+
vml('group', {
|
|
2988
|
+
coordsize: s + ' ' + s
|
|
2989
|
+
, coordorigin: -r + ' ' + -r
|
|
2990
|
+
})
|
|
2991
|
+
, { width: s, height: s }
|
|
2992
|
+
)
|
|
2993
|
+
}
|
|
2994
|
+
|
|
2995
|
+
var margin = -(o.width + o.length) * o.scale * 2 + 'px'
|
|
2996
|
+
, g = css(grp(), {position: 'absolute', top: margin, left: margin})
|
|
2997
|
+
, i;
|
|
2998
|
+
|
|
2999
|
+
function seg (i, dx, filter) {
|
|
3000
|
+
ins(
|
|
3001
|
+
g
|
|
3002
|
+
, ins(
|
|
3003
|
+
css(grp(), {rotation: 360 / o.lines * i + 'deg', left: ~~dx})
|
|
3004
|
+
, ins(
|
|
3005
|
+
css(
|
|
3006
|
+
vml('roundrect', {arcsize: o.corners})
|
|
3007
|
+
, { width: r
|
|
3008
|
+
, height: o.scale * o.width
|
|
3009
|
+
, left: o.scale * o.radius
|
|
3010
|
+
, top: -o.scale * o.width >> 1
|
|
3011
|
+
, filter: filter
|
|
3012
|
+
}
|
|
3013
|
+
)
|
|
3014
|
+
, vml('fill', {color: getColor(o.color, i), opacity: o.opacity})
|
|
3015
|
+
, vml('stroke', {opacity: 0}) // transparent stroke to fix color bleeding upon opacity change
|
|
3016
|
+
)
|
|
3017
|
+
)
|
|
3018
|
+
);
|
|
3019
|
+
}
|
|
3020
|
+
|
|
3021
|
+
if (o.shadow)
|
|
3022
|
+
for (i = 1; i <= o.lines; i++) {
|
|
3023
|
+
seg(i, -2, 'progid:DXImageTransform.Microsoft.Blur(pixelradius=2,makeshadow=1,shadowopacity=.3)');
|
|
3024
|
+
}
|
|
3025
|
+
|
|
3026
|
+
for (i = 1; i <= o.lines; i++) seg(i);
|
|
3027
|
+
return ins(el, g)
|
|
3028
|
+
};
|
|
3029
|
+
|
|
3030
|
+
Spinner.prototype.opacity = function (el, i, val, o) {
|
|
3031
|
+
var c = el.firstChild;
|
|
3032
|
+
o = o.shadow && o.lines || 0;
|
|
3033
|
+
if (c && i + o < c.childNodes.length) {
|
|
3034
|
+
c = c.childNodes[i + o]; c = c && c.firstChild; c = c && c.firstChild;
|
|
3035
|
+
if (c) c.opacity = val;
|
|
3036
|
+
}
|
|
3037
|
+
};
|
|
3038
|
+
}
|
|
3039
|
+
|
|
3040
|
+
if (typeof document !== 'undefined') {
|
|
3041
|
+
sheet = (function () {
|
|
3042
|
+
var el = createEl('style', {type : 'text/css'});
|
|
3043
|
+
ins(document.getElementsByTagName('head')[0], el);
|
|
3044
|
+
return el.sheet || el.styleSheet
|
|
3045
|
+
}());
|
|
3046
|
+
|
|
3047
|
+
var probe = css(createEl('group'), {behavior: 'url(#default#VML)'});
|
|
3048
|
+
|
|
3049
|
+
if (!vendor(probe, 'transform') && probe.adj) initVML();
|
|
3050
|
+
else useCssAnimations = vendor(probe, 'animation');
|
|
3051
|
+
}
|
|
3052
|
+
|
|
3053
|
+
return Spinner
|
|
3054
|
+
|
|
3055
|
+
}));
|
|
3056
|
+
});
|
|
3057
|
+
|
|
3058
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
3059
|
+
|
|
3060
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3061
|
+
value: true
|
|
3062
|
+
});
|
|
3063
|
+
|
|
3064
|
+
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
|
|
3065
|
+
|
|
3066
|
+
|
|
3067
|
+
|
|
3068
|
+
var _react2 = _interopRequireDefault(React__default);
|
|
3069
|
+
|
|
3070
|
+
|
|
3071
|
+
|
|
3072
|
+
var _propTypes2 = _interopRequireDefault(PropTypes);
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
|
|
3076
|
+
var _spin2 = _interopRequireDefault(spin);
|
|
3077
|
+
|
|
3078
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
3079
|
+
|
|
3080
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3081
|
+
|
|
3082
|
+
function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }
|
|
3083
|
+
|
|
3084
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }
|
|
3085
|
+
|
|
3086
|
+
var Spinner = function (_Component) {
|
|
3087
|
+
_inherits(Spinner, _Component);
|
|
3088
|
+
|
|
3089
|
+
function Spinner() {
|
|
3090
|
+
_classCallCheck(this, Spinner);
|
|
3091
|
+
|
|
3092
|
+
return _possibleConstructorReturn(this, (Spinner.__proto__ || Object.getPrototypeOf(Spinner)).apply(this, arguments));
|
|
3093
|
+
}
|
|
3094
|
+
|
|
3095
|
+
_createClass(Spinner, [{
|
|
3096
|
+
key: 'componentDidMount',
|
|
3097
|
+
value: function componentDidMount() {
|
|
3098
|
+
this.updateSpinner();
|
|
3099
|
+
}
|
|
3100
|
+
}, {
|
|
3101
|
+
key: 'componentDidUpdate',
|
|
3102
|
+
value: function componentDidUpdate() {
|
|
3103
|
+
this.updateSpinner();
|
|
3104
|
+
}
|
|
3105
|
+
}, {
|
|
3106
|
+
key: 'componentWillUnmount',
|
|
3107
|
+
value: function componentWillUnmount() {
|
|
3108
|
+
if (this.spinner) {
|
|
3109
|
+
this.spinner.stop();
|
|
3110
|
+
this.spinner = null;
|
|
3111
|
+
}
|
|
3112
|
+
}
|
|
3113
|
+
}, {
|
|
3114
|
+
key: 'updateSpinner',
|
|
3115
|
+
value: function updateSpinner() {
|
|
3116
|
+
var loaded = this.props.loaded;
|
|
3117
|
+
|
|
3118
|
+
if (!loaded && !this.spinner) {
|
|
3119
|
+
this.spinner = new _spin2.default(this.props.config);
|
|
3120
|
+
this.spinner.spin(this.refs.loader);
|
|
3121
|
+
} else if (loaded && this.spinner) {
|
|
3122
|
+
this.spinner.stop();
|
|
3123
|
+
this.spinner = null;
|
|
3124
|
+
}
|
|
3125
|
+
}
|
|
3126
|
+
}, {
|
|
3127
|
+
key: 'render',
|
|
3128
|
+
value: function render() {
|
|
3129
|
+
var _props = this.props,
|
|
3130
|
+
loaded = _props.loaded,
|
|
3131
|
+
className = _props.className;
|
|
3132
|
+
|
|
3133
|
+
|
|
3134
|
+
if (loaded) {
|
|
3135
|
+
return this.props.children ? React__default.Children.only(this.props.children) : null;
|
|
3136
|
+
}
|
|
3137
|
+
|
|
3138
|
+
return _react2.default.createElement('div', { className: className, ref: 'loader' });
|
|
3139
|
+
}
|
|
3140
|
+
}]);
|
|
3141
|
+
|
|
3142
|
+
return Spinner;
|
|
3143
|
+
}(React__default.Component);
|
|
3144
|
+
|
|
3145
|
+
Spinner.propTypes = {
|
|
3146
|
+
className: _propTypes2.default.string,
|
|
3147
|
+
config: _propTypes2.default.object.isRequired,
|
|
3148
|
+
loaded: _propTypes2.default.bool.isRequired,
|
|
3149
|
+
children: _propTypes2.default.node
|
|
3150
|
+
};
|
|
3151
|
+
Spinner.defaultProps = {
|
|
3152
|
+
config: {},
|
|
3153
|
+
loaded: false,
|
|
3154
|
+
className: 'loader'
|
|
3155
|
+
};
|
|
3156
|
+
exports.default = Spinner;
|
|
3157
|
+
});
|
|
3158
|
+
|
|
3159
|
+
var Spinner = unwrapExports(dist);
|
|
3160
|
+
|
|
3161
|
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
3162
|
+
|
|
3163
|
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(source, true).forEach(function (key) { defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(source).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
3164
|
+
function LoginButton(props) {
|
|
3165
|
+
const {
|
|
3166
|
+
children,
|
|
3167
|
+
className,
|
|
3168
|
+
spinner,
|
|
3169
|
+
spinnerConfig
|
|
3170
|
+
} = props,
|
|
3171
|
+
rest = objectWithoutProperties(props, ["children", "className", "spinner", "spinnerConfig"]);
|
|
3172
|
+
|
|
3173
|
+
return React__default.createElement(Login$1, rest, ({
|
|
3174
|
+
loading,
|
|
3175
|
+
handleClick
|
|
3176
|
+
}) => React__default.createElement("button", {
|
|
3177
|
+
type: "button",
|
|
3178
|
+
className: className,
|
|
3179
|
+
onClick: handleClick,
|
|
3180
|
+
disabled: loading
|
|
3181
|
+
}, children, spinner && loading && React__default.createElement(Spinner, {
|
|
3182
|
+
config: spinnerConfig
|
|
3183
|
+
})));
|
|
3184
|
+
}
|
|
3185
|
+
LoginButton.defaultProps = _objectSpread$3({}, Login$1.defaultProps, {
|
|
3186
|
+
className: undefined,
|
|
3187
|
+
spinnerConfig: {},
|
|
3188
|
+
spinner: true
|
|
3189
|
+
});
|
|
3190
|
+
|
|
3191
|
+
class EmbeddedPost extends PureComponent {
|
|
3192
|
+
componentDidUpdate() {
|
|
3193
|
+
const {
|
|
3194
|
+
handleParse
|
|
3195
|
+
} = this.props;
|
|
3196
|
+
handleParse();
|
|
3197
|
+
}
|
|
3198
|
+
|
|
3199
|
+
render() {
|
|
3200
|
+
const {
|
|
3201
|
+
href,
|
|
3202
|
+
width,
|
|
3203
|
+
showText,
|
|
3204
|
+
children
|
|
3205
|
+
} = this.props;
|
|
3206
|
+
return React__default.createElement("div", {
|
|
3207
|
+
className: "fb-post",
|
|
3208
|
+
"data-href": href,
|
|
3209
|
+
"data-width": width,
|
|
3210
|
+
"data-show-text": showText
|
|
3211
|
+
}, children);
|
|
3212
|
+
}
|
|
3213
|
+
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
defineProperty(EmbeddedPost, "defaultProps", {
|
|
3217
|
+
width: undefined,
|
|
3218
|
+
showText: undefined,
|
|
3219
|
+
children: undefined
|
|
3220
|
+
});
|
|
3221
|
+
|
|
3222
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3223
|
+
handleParse
|
|
3224
|
+
}) => React__default.createElement(EmbeddedPost, _extends_1({}, props, {
|
|
3225
|
+
handleParse: handleParse,
|
|
3226
|
+
ref: ref
|
|
3227
|
+
}))));
|
|
3228
|
+
|
|
3229
|
+
class EmbeddedVideo extends PureComponent {
|
|
3230
|
+
componentDidUpdate() {
|
|
3231
|
+
const {
|
|
3232
|
+
handleParse
|
|
3233
|
+
} = this.props;
|
|
3234
|
+
handleParse();
|
|
3235
|
+
}
|
|
3236
|
+
|
|
3237
|
+
render() {
|
|
3238
|
+
const {
|
|
3239
|
+
href,
|
|
3240
|
+
width,
|
|
3241
|
+
showText,
|
|
3242
|
+
allowFullScreen,
|
|
3243
|
+
autoPlay,
|
|
3244
|
+
showCaptions,
|
|
3245
|
+
children
|
|
3246
|
+
} = this.props;
|
|
3247
|
+
return React__default.createElement("div", {
|
|
3248
|
+
className: "fb-video",
|
|
3249
|
+
"data-href": href,
|
|
3250
|
+
"data-width": width,
|
|
3251
|
+
"data-show-text": showText,
|
|
3252
|
+
"data-show-captions": showCaptions,
|
|
3253
|
+
"data-autoplay": autoPlay,
|
|
3254
|
+
"data-allowfullscreen": allowFullScreen
|
|
3255
|
+
}, children);
|
|
3256
|
+
}
|
|
3257
|
+
|
|
3258
|
+
}
|
|
3259
|
+
|
|
3260
|
+
defineProperty(EmbeddedVideo, "defaultProps", {
|
|
3261
|
+
width: undefined,
|
|
3262
|
+
showText: undefined,
|
|
3263
|
+
allowFullScreen: undefined,
|
|
3264
|
+
autoPlay: undefined,
|
|
3265
|
+
showCaptions: undefined,
|
|
3266
|
+
children: undefined
|
|
3267
|
+
});
|
|
3268
|
+
|
|
3269
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3270
|
+
handleParse
|
|
3271
|
+
}) => React__default.createElement(EmbeddedVideo, _extends_1({}, props, {
|
|
3272
|
+
handleParse: handleParse,
|
|
3273
|
+
ref: ref
|
|
3274
|
+
}))));
|
|
3275
|
+
|
|
3276
|
+
class Comments extends PureComponent {
|
|
3277
|
+
componentDidUpdate() {
|
|
3278
|
+
const {
|
|
3279
|
+
handleParse
|
|
3280
|
+
} = this.props;
|
|
3281
|
+
handleParse();
|
|
3282
|
+
}
|
|
3283
|
+
|
|
3284
|
+
render() {
|
|
3285
|
+
const {
|
|
3286
|
+
colorScheme,
|
|
3287
|
+
href = getCurrentHref(),
|
|
3288
|
+
numPosts,
|
|
3289
|
+
orderBy,
|
|
3290
|
+
width,
|
|
3291
|
+
children,
|
|
3292
|
+
mobile
|
|
3293
|
+
} = this.props;
|
|
3294
|
+
return React__default.createElement("div", {
|
|
3295
|
+
className: "fb-comments",
|
|
3296
|
+
"data-colorscheme": colorScheme,
|
|
3297
|
+
"data-numposts": numPosts,
|
|
3298
|
+
"data-href": href,
|
|
3299
|
+
"data-order-by": orderBy,
|
|
3300
|
+
"data-width": width,
|
|
3301
|
+
"data-skin": colorScheme,
|
|
3302
|
+
"data-mobile": mobile
|
|
3303
|
+
}, children);
|
|
3304
|
+
}
|
|
3305
|
+
|
|
3306
|
+
}
|
|
3307
|
+
|
|
3308
|
+
defineProperty(Comments, "defaultProps", {
|
|
3309
|
+
href: undefined,
|
|
3310
|
+
numPosts: undefined,
|
|
3311
|
+
orderBy: undefined,
|
|
3312
|
+
width: undefined,
|
|
3313
|
+
colorScheme: undefined,
|
|
3314
|
+
children: undefined,
|
|
3315
|
+
mobile: undefined
|
|
3316
|
+
});
|
|
3317
|
+
|
|
3318
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3319
|
+
handleParse
|
|
3320
|
+
}) => React__default.createElement(Comments, _extends_1({}, props, {
|
|
3321
|
+
handleParse: handleParse,
|
|
3322
|
+
ref: ref
|
|
3323
|
+
}))));
|
|
3324
|
+
|
|
3325
|
+
class CommentsCount extends PureComponent {
|
|
3326
|
+
componentDidUpdate() {
|
|
3327
|
+
const {
|
|
3328
|
+
handleParse
|
|
3329
|
+
} = this.props;
|
|
3330
|
+
handleParse();
|
|
3331
|
+
}
|
|
3332
|
+
|
|
3333
|
+
render() {
|
|
3334
|
+
const {
|
|
3335
|
+
href = getCurrentHref(),
|
|
3336
|
+
children
|
|
3337
|
+
} = this.props;
|
|
3338
|
+
return React__default.createElement("span", {
|
|
3339
|
+
className: "fb-comments-count",
|
|
3340
|
+
"data-href": href
|
|
3341
|
+
}, children);
|
|
3342
|
+
}
|
|
3343
|
+
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3346
|
+
defineProperty(CommentsCount, "defaultProps", {
|
|
3347
|
+
href: undefined,
|
|
3348
|
+
children: undefined
|
|
3349
|
+
});
|
|
3350
|
+
|
|
3351
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3352
|
+
handleParse
|
|
3353
|
+
}) => React__default.createElement(CommentsCount, _extends_1({}, props, {
|
|
3354
|
+
handleParse: handleParse,
|
|
3355
|
+
ref: ref
|
|
3356
|
+
}))));
|
|
3357
|
+
|
|
3358
|
+
class Feed extends Component {
|
|
3359
|
+
constructor(...args) {
|
|
3360
|
+
var _this;
|
|
3361
|
+
|
|
3362
|
+
super(...args);
|
|
3363
|
+
_this = this;
|
|
3364
|
+
|
|
3365
|
+
defineProperty(this, "handleClick",
|
|
3366
|
+
/*#__PURE__*/
|
|
3367
|
+
function () {
|
|
3368
|
+
var _ref = asyncToGenerator(function* (evn) {
|
|
3369
|
+
evn.preventDefault();
|
|
3370
|
+
const {
|
|
3371
|
+
handleProcess
|
|
3372
|
+
} = _this.props;
|
|
3373
|
+
return handleProcess(
|
|
3374
|
+
/*#__PURE__*/
|
|
3375
|
+
function () {
|
|
3376
|
+
var _ref2 = asyncToGenerator(function* (api) {
|
|
3377
|
+
const {
|
|
3378
|
+
link = getCurrentHref(),
|
|
3379
|
+
display,
|
|
3380
|
+
appId = api.getAppId(),
|
|
3381
|
+
redirectURI,
|
|
3382
|
+
from,
|
|
3383
|
+
to,
|
|
3384
|
+
picture,
|
|
3385
|
+
source,
|
|
3386
|
+
name,
|
|
3387
|
+
caption,
|
|
3388
|
+
description,
|
|
3389
|
+
dataRef
|
|
3390
|
+
} = _this.props;
|
|
3391
|
+
return api.ui(clearUndefinedProperties({
|
|
3392
|
+
method: 'feed',
|
|
3393
|
+
link,
|
|
3394
|
+
display,
|
|
3395
|
+
app_id: appId,
|
|
3396
|
+
redirect_uri: redirectURI,
|
|
3397
|
+
from,
|
|
3398
|
+
to,
|
|
3399
|
+
picture,
|
|
3400
|
+
source,
|
|
3401
|
+
name,
|
|
3402
|
+
caption,
|
|
3403
|
+
description,
|
|
3404
|
+
ref: dataRef
|
|
3405
|
+
}));
|
|
3406
|
+
});
|
|
3407
|
+
|
|
3408
|
+
return function (_x2) {
|
|
3409
|
+
return _ref2.apply(this, arguments);
|
|
3410
|
+
};
|
|
3411
|
+
}());
|
|
3412
|
+
});
|
|
3413
|
+
|
|
3414
|
+
return function (_x) {
|
|
3415
|
+
return _ref.apply(this, arguments);
|
|
3416
|
+
};
|
|
3417
|
+
}());
|
|
3418
|
+
}
|
|
3419
|
+
|
|
3420
|
+
render() {
|
|
3421
|
+
const {
|
|
3422
|
+
children,
|
|
3423
|
+
loading,
|
|
3424
|
+
error,
|
|
3425
|
+
data
|
|
3426
|
+
} = this.props;
|
|
3427
|
+
return children({
|
|
3428
|
+
loading,
|
|
3429
|
+
handleClick: this.handleClick,
|
|
3430
|
+
error,
|
|
3431
|
+
data
|
|
3432
|
+
});
|
|
3433
|
+
}
|
|
3434
|
+
|
|
3435
|
+
}
|
|
3436
|
+
|
|
3437
|
+
defineProperty(Feed, "defaultProps", {
|
|
3438
|
+
link: undefined,
|
|
3439
|
+
display: undefined,
|
|
3440
|
+
appId: undefined,
|
|
3441
|
+
redirectURI: undefined,
|
|
3442
|
+
from: undefined,
|
|
3443
|
+
to: undefined,
|
|
3444
|
+
source: undefined,
|
|
3445
|
+
picture: undefined,
|
|
3446
|
+
name: undefined,
|
|
3447
|
+
caption: undefined,
|
|
3448
|
+
description: undefined,
|
|
3449
|
+
dataRef: undefined
|
|
3450
|
+
});
|
|
3451
|
+
|
|
3452
|
+
forwardRef((props, ref) => React__default.createElement(Process, null, ({
|
|
3453
|
+
loading,
|
|
3454
|
+
handleProcess,
|
|
3455
|
+
error,
|
|
3456
|
+
data
|
|
3457
|
+
}) => React__default.createElement(Feed, _extends_1({}, props, {
|
|
3458
|
+
loading: loading,
|
|
3459
|
+
handleProcess: handleProcess,
|
|
3460
|
+
data: data,
|
|
3461
|
+
error: error,
|
|
3462
|
+
ref: ref
|
|
3463
|
+
}))));
|
|
3464
|
+
|
|
3465
|
+
class Group extends PureComponent {
|
|
3466
|
+
componentDidUpdate() {
|
|
3467
|
+
const {
|
|
3468
|
+
handleParse
|
|
3469
|
+
} = this.props;
|
|
3470
|
+
handleParse();
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3473
|
+
render() {
|
|
3474
|
+
const {
|
|
3475
|
+
style,
|
|
3476
|
+
href = getCurrentHref(),
|
|
3477
|
+
width,
|
|
3478
|
+
showSocialContext,
|
|
3479
|
+
showMetaData,
|
|
3480
|
+
children,
|
|
3481
|
+
skin
|
|
3482
|
+
} = this.props;
|
|
3483
|
+
return React__default.createElement("div", {
|
|
3484
|
+
className: "fb-group",
|
|
3485
|
+
style: style,
|
|
3486
|
+
"data-href": href,
|
|
3487
|
+
"data-width": width,
|
|
3488
|
+
"data-show-social-context": showSocialContext,
|
|
3489
|
+
"data-show-metadata": showMetaData,
|
|
3490
|
+
"data-skin": skin
|
|
3491
|
+
}, children);
|
|
3492
|
+
}
|
|
3493
|
+
|
|
3494
|
+
}
|
|
3495
|
+
|
|
3496
|
+
defineProperty(Group, "defaultProps", {
|
|
3497
|
+
showSocialContext: undefined,
|
|
3498
|
+
showMetaData: undefined,
|
|
3499
|
+
width: undefined,
|
|
3500
|
+
children: undefined,
|
|
3501
|
+
style: undefined,
|
|
3502
|
+
href: undefined,
|
|
3503
|
+
skin: undefined
|
|
3504
|
+
});
|
|
3505
|
+
|
|
3506
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3507
|
+
handleParse
|
|
3508
|
+
}) => React__default.createElement(Group, _extends_1({}, props, {
|
|
3509
|
+
handleParse: handleParse,
|
|
3510
|
+
ref: ref
|
|
3511
|
+
}))));
|
|
3512
|
+
|
|
3513
|
+
class LoginStatus$1 extends Component {
|
|
3514
|
+
constructor(..._args) {
|
|
3515
|
+
var _this;
|
|
3516
|
+
|
|
3517
|
+
super(..._args);
|
|
3518
|
+
_this = this;
|
|
3519
|
+
|
|
3520
|
+
defineProperty(this, "state", {});
|
|
3521
|
+
|
|
3522
|
+
defineProperty(this, "handleReady",
|
|
3523
|
+
/*#__PURE__*/
|
|
3524
|
+
function () {
|
|
3525
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3526
|
+
const {
|
|
3527
|
+
event
|
|
3528
|
+
} = _this.props;
|
|
3529
|
+
|
|
3530
|
+
_this.setState({
|
|
3531
|
+
api
|
|
3532
|
+
});
|
|
3533
|
+
|
|
3534
|
+
yield api.subscribe(event, _this.handleChange);
|
|
3535
|
+
});
|
|
3536
|
+
|
|
3537
|
+
return function (_x) {
|
|
3538
|
+
return _ref.apply(this, arguments);
|
|
3539
|
+
};
|
|
3540
|
+
}());
|
|
3541
|
+
|
|
3542
|
+
defineProperty(this, "handleChange", (...args) => {
|
|
3543
|
+
const {
|
|
3544
|
+
onChange
|
|
3545
|
+
} = this.props;
|
|
3546
|
+
|
|
3547
|
+
if (onChange) {
|
|
3548
|
+
onChange(...args);
|
|
3549
|
+
}
|
|
3550
|
+
});
|
|
3551
|
+
}
|
|
3552
|
+
|
|
3553
|
+
componentWillUnmount() {
|
|
3554
|
+
const {
|
|
3555
|
+
state: {
|
|
3556
|
+
api
|
|
3557
|
+
},
|
|
3558
|
+
props: {
|
|
3559
|
+
event
|
|
3560
|
+
}
|
|
3561
|
+
} = this;
|
|
3562
|
+
|
|
3563
|
+
if (api) {
|
|
3564
|
+
api.unsubscribe(event, this.handleChange);
|
|
3565
|
+
}
|
|
3566
|
+
}
|
|
3567
|
+
|
|
3568
|
+
render() {
|
|
3569
|
+
const {
|
|
3570
|
+
children
|
|
3571
|
+
} = this.props;
|
|
3572
|
+
return React__default.createElement(Initialize$1, {
|
|
3573
|
+
onReady: this.handleReady
|
|
3574
|
+
}, children);
|
|
3575
|
+
}
|
|
3576
|
+
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
defineProperty(LoginStatus$1, "defaultProps", {
|
|
3580
|
+
onChange: undefined
|
|
3581
|
+
});
|
|
3582
|
+
|
|
3583
|
+
class Profile extends Component {
|
|
3584
|
+
constructor(...args) {
|
|
3585
|
+
var _this;
|
|
3586
|
+
|
|
3587
|
+
super(...args);
|
|
3588
|
+
_this = this;
|
|
3589
|
+
|
|
3590
|
+
defineProperty(this, "state", {
|
|
3591
|
+
loading: true
|
|
3592
|
+
});
|
|
3593
|
+
|
|
3594
|
+
defineProperty(this, "handleReady",
|
|
3595
|
+
/*#__PURE__*/
|
|
3596
|
+
function () {
|
|
3597
|
+
var _ref = asyncToGenerator(function* (api) {
|
|
3598
|
+
_this.api = api;
|
|
3599
|
+
|
|
3600
|
+
_this.updateProfile();
|
|
3601
|
+
});
|
|
3602
|
+
|
|
3603
|
+
return function (_x) {
|
|
3604
|
+
return _ref.apply(this, arguments);
|
|
3605
|
+
};
|
|
3606
|
+
}());
|
|
3607
|
+
|
|
3608
|
+
defineProperty(this, "handleStatusChange", () => {
|
|
3609
|
+
this.updateProfile();
|
|
3610
|
+
});
|
|
3611
|
+
}
|
|
3612
|
+
|
|
3613
|
+
updateProfile() {
|
|
3614
|
+
var _this2 = this;
|
|
3615
|
+
|
|
3616
|
+
return asyncToGenerator(function* () {
|
|
3617
|
+
const {
|
|
3618
|
+
api,
|
|
3619
|
+
props: {
|
|
3620
|
+
fields
|
|
3621
|
+
}
|
|
3622
|
+
} = _this2;
|
|
3623
|
+
|
|
3624
|
+
if (!api) {
|
|
3625
|
+
return;
|
|
3626
|
+
}
|
|
3627
|
+
|
|
3628
|
+
try {
|
|
3629
|
+
const response = yield api.getLoginStatus();
|
|
3630
|
+
|
|
3631
|
+
if (response.status !== LoginStatus.CONNECTED) {
|
|
3632
|
+
_this2.setState({
|
|
3633
|
+
profile: undefined,
|
|
3634
|
+
loading: false,
|
|
3635
|
+
error: undefined
|
|
3636
|
+
});
|
|
3637
|
+
|
|
3638
|
+
return;
|
|
3639
|
+
}
|
|
3640
|
+
|
|
3641
|
+
const profile = yield api.getProfile({
|
|
3642
|
+
fields
|
|
3643
|
+
});
|
|
3644
|
+
|
|
3645
|
+
_this2.setState({
|
|
3646
|
+
profile,
|
|
3647
|
+
loading: false,
|
|
3648
|
+
error: undefined
|
|
3649
|
+
});
|
|
3650
|
+
} catch (error) {
|
|
3651
|
+
_this2.setState({
|
|
3652
|
+
profile: undefined,
|
|
3653
|
+
loading: false,
|
|
3654
|
+
error
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
})();
|
|
3658
|
+
}
|
|
3659
|
+
|
|
3660
|
+
render() {
|
|
3661
|
+
const {
|
|
3662
|
+
children
|
|
3663
|
+
} = this.props;
|
|
3664
|
+
const {
|
|
3665
|
+
profile,
|
|
3666
|
+
loading,
|
|
3667
|
+
error
|
|
3668
|
+
} = this.state;
|
|
3669
|
+
return React__default.createElement(Initialize$1, {
|
|
3670
|
+
onReady: this.handleReady
|
|
3671
|
+
}, React__default.createElement(LoginStatus$1, {
|
|
3672
|
+
event: "auth.statusChange",
|
|
3673
|
+
onChange: this.handleStatusChange
|
|
3674
|
+
}, children({
|
|
3675
|
+
profile,
|
|
3676
|
+
loading,
|
|
3677
|
+
error
|
|
3678
|
+
})));
|
|
3679
|
+
}
|
|
3680
|
+
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
defineProperty(Profile, "defaultProps", {
|
|
3684
|
+
fields: Fields
|
|
3685
|
+
});
|
|
3686
|
+
|
|
3687
|
+
class CustomChat extends PureComponent {
|
|
3688
|
+
componentDidUpdate() {
|
|
3689
|
+
const {
|
|
3690
|
+
handleParse
|
|
3691
|
+
} = this.props;
|
|
3692
|
+
handleParse();
|
|
3693
|
+
}
|
|
3694
|
+
|
|
3695
|
+
render() {
|
|
3696
|
+
const {
|
|
3697
|
+
children,
|
|
3698
|
+
pageId,
|
|
3699
|
+
themeColor,
|
|
3700
|
+
loggedInGreeting,
|
|
3701
|
+
loggedOutGreeting,
|
|
3702
|
+
dataRef,
|
|
3703
|
+
greetingDialogDisplay,
|
|
3704
|
+
greetingDialogDelay
|
|
3705
|
+
} = this.props;
|
|
3706
|
+
return React__default.createElement("div", {
|
|
3707
|
+
className: "fb-customerchat",
|
|
3708
|
+
page_id: pageId,
|
|
3709
|
+
theme_color: themeColor,
|
|
3710
|
+
logged_in_greeting: loggedInGreeting,
|
|
3711
|
+
logged_out_greeting: loggedOutGreeting,
|
|
3712
|
+
greeting_dialog_display: greetingDialogDisplay,
|
|
3713
|
+
greeting_dialog_delay: greetingDialogDelay,
|
|
3714
|
+
"data-ref": dataRef
|
|
3715
|
+
}, children);
|
|
3716
|
+
}
|
|
3717
|
+
|
|
3718
|
+
}
|
|
3719
|
+
|
|
3720
|
+
defineProperty(CustomChat, "defaultProps", {
|
|
3721
|
+
children: undefined,
|
|
3722
|
+
themeColor: undefined,
|
|
3723
|
+
loggedInGreeting: undefined,
|
|
3724
|
+
loggedOutGreeting: undefined,
|
|
3725
|
+
dataRef: undefined,
|
|
3726
|
+
greetingDialogDisplay: undefined,
|
|
3727
|
+
greetingDialogDelay: undefined
|
|
3728
|
+
});
|
|
3729
|
+
|
|
3730
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3731
|
+
handleParse
|
|
3732
|
+
}) => React__default.createElement(CustomChat, _extends_1({}, props, {
|
|
3733
|
+
handleParse: handleParse,
|
|
3734
|
+
ref: ref
|
|
3735
|
+
}))));
|
|
3736
|
+
|
|
3737
|
+
class MessageUs extends PureComponent {
|
|
3738
|
+
componentDidUpdate() {
|
|
3739
|
+
const {
|
|
3740
|
+
handleParse
|
|
3741
|
+
} = this.props;
|
|
3742
|
+
handleParse();
|
|
3743
|
+
}
|
|
3744
|
+
|
|
3745
|
+
render() {
|
|
3746
|
+
const {
|
|
3747
|
+
color,
|
|
3748
|
+
messengerAppId,
|
|
3749
|
+
pageId,
|
|
3750
|
+
children,
|
|
3751
|
+
size
|
|
3752
|
+
} = this.props;
|
|
3753
|
+
return React__default.createElement("div", {
|
|
3754
|
+
className: "fb-messengermessageus",
|
|
3755
|
+
messenger_app_id: messengerAppId,
|
|
3756
|
+
page_id: pageId,
|
|
3757
|
+
"data-color": color,
|
|
3758
|
+
"data-size": size
|
|
3759
|
+
}, children);
|
|
3760
|
+
}
|
|
3761
|
+
|
|
3762
|
+
}
|
|
3763
|
+
|
|
3764
|
+
defineProperty(MessageUs, "defaultProps", {
|
|
3765
|
+
color: undefined,
|
|
3766
|
+
size: undefined,
|
|
3767
|
+
children: undefined
|
|
3768
|
+
});
|
|
3769
|
+
|
|
3770
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3771
|
+
handleParse
|
|
3772
|
+
}) => React__default.createElement(MessageUs, _extends_1({}, props, {
|
|
3773
|
+
handleParse: handleParse,
|
|
3774
|
+
ref: ref
|
|
3775
|
+
}))));
|
|
3776
|
+
|
|
3777
|
+
class MessengerCheckbox extends PureComponent {
|
|
3778
|
+
componentDidUpdate() {
|
|
3779
|
+
const {
|
|
3780
|
+
handleParse
|
|
3781
|
+
} = this.props;
|
|
3782
|
+
handleParse();
|
|
3783
|
+
}
|
|
3784
|
+
|
|
3785
|
+
render() {
|
|
3786
|
+
const {
|
|
3787
|
+
origin,
|
|
3788
|
+
prechecked,
|
|
3789
|
+
allowLogin,
|
|
3790
|
+
userRef,
|
|
3791
|
+
messengerAppId,
|
|
3792
|
+
pageId,
|
|
3793
|
+
children,
|
|
3794
|
+
size,
|
|
3795
|
+
centerAlign,
|
|
3796
|
+
skin
|
|
3797
|
+
} = this.props;
|
|
3798
|
+
return React__default.createElement("div", {
|
|
3799
|
+
className: "fb-messenger-checkbox",
|
|
3800
|
+
messenger_app_id: messengerAppId,
|
|
3801
|
+
page_id: pageId,
|
|
3802
|
+
size: size,
|
|
3803
|
+
origin: origin,
|
|
3804
|
+
user_ref: userRef,
|
|
3805
|
+
prechecked: prechecked,
|
|
3806
|
+
allow_login: allowLogin,
|
|
3807
|
+
skin: skin,
|
|
3808
|
+
center_align: centerAlign
|
|
3809
|
+
}, children);
|
|
3810
|
+
}
|
|
3811
|
+
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3814
|
+
defineProperty(MessengerCheckbox, "defaultProps", {
|
|
3815
|
+
size: undefined,
|
|
3816
|
+
allowLogin: undefined,
|
|
3817
|
+
prechecked: undefined,
|
|
3818
|
+
userRef: undefined,
|
|
3819
|
+
children: undefined,
|
|
3820
|
+
origin: undefined,
|
|
3821
|
+
skin: undefined,
|
|
3822
|
+
centerAlign: undefined
|
|
3823
|
+
});
|
|
3824
|
+
|
|
3825
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3826
|
+
handleParse
|
|
3827
|
+
}) => React__default.createElement(MessengerCheckbox, _extends_1({}, props, {
|
|
3828
|
+
handleParse: handleParse,
|
|
3829
|
+
ref: ref
|
|
3830
|
+
}))));
|
|
3831
|
+
|
|
3832
|
+
// import MessengerColor from './constants/MessengerColor';
|
|
3833
|
+
|
|
3834
|
+
class SendToMessenger extends PureComponent {
|
|
3835
|
+
componentDidUpdate() {
|
|
3836
|
+
const {
|
|
3837
|
+
handleParse
|
|
3838
|
+
} = this.props;
|
|
3839
|
+
handleParse();
|
|
3840
|
+
}
|
|
3841
|
+
|
|
3842
|
+
render() {
|
|
3843
|
+
const {
|
|
3844
|
+
color,
|
|
3845
|
+
messengerAppId,
|
|
3846
|
+
pageId,
|
|
3847
|
+
children,
|
|
3848
|
+
dataRef,
|
|
3849
|
+
size
|
|
3850
|
+
} = this.props;
|
|
3851
|
+
return React__default.createElement("div", {
|
|
3852
|
+
className: "fb-send-to-messenger",
|
|
3853
|
+
messenger_app_id: messengerAppId,
|
|
3854
|
+
page_id: pageId,
|
|
3855
|
+
"data-color": color,
|
|
3856
|
+
"data-size": size,
|
|
3857
|
+
"data-ref": dataRef
|
|
3858
|
+
}, children);
|
|
3859
|
+
}
|
|
3860
|
+
|
|
3861
|
+
}
|
|
3862
|
+
|
|
3863
|
+
defineProperty(SendToMessenger, "defaultProps", {
|
|
3864
|
+
color: undefined,
|
|
3865
|
+
size: undefined,
|
|
3866
|
+
dataRef: undefined,
|
|
3867
|
+
children: undefined
|
|
3868
|
+
});
|
|
3869
|
+
|
|
3870
|
+
forwardRef((props, ref) => React__default.createElement(Parser, null, ({
|
|
3871
|
+
handleParse
|
|
3872
|
+
}) => React__default.createElement(SendToMessenger, _extends_1({}, props, {
|
|
3873
|
+
handleParse: handleParse,
|
|
3874
|
+
ref: ref
|
|
3875
|
+
}))));
|
|
3876
|
+
|
|
1172
3877
|
var ImageSlider = function ImageSlider(props) {
|
|
1173
3878
|
var innerSlider = useRef(null);
|
|
1174
3879
|
var tile = useRef(null);
|
|
@@ -1397,10 +4102,27 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
1397
4102
|
{ jsx: 'true' },
|
|
1398
4103
|
'\n @media screen and (max-width: 768px) {\n .partners-logo {\n width: 100%;\n min-width: 100%;\n }\n .partner-logo-wrap {\n flex-wrap: wrap;\n }\n .block-content-partners {\n padding-left: 0 !important;\n }\n }\n '
|
|
1399
4104
|
),
|
|
1400
|
-
partnerDetails.description && React__default.createElement(
|
|
4105
|
+
(partnerDetails.description || partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook) && React__default.createElement(
|
|
1401
4106
|
'div',
|
|
1402
4107
|
{ className: 'block-content-partners my-4', style: { maxWidth: '100%', paddingLeft: '2rem', flex: '1 1 auto' } },
|
|
1403
|
-
React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config()))
|
|
4108
|
+
partnerDetails.description && React__default.createElement(BlockContent, _extends({ serializers: getSerializers(client), blocks: partnerDetails.description, imageOptions: { w: 320, h: 240, fit: 'max' } }, client.config())),
|
|
4109
|
+
(partnerDetails.linkedin || partnerDetails.twitter && partnerDetails.facebook) && React__default.createElement(
|
|
4110
|
+
'div',
|
|
4111
|
+
null,
|
|
4112
|
+
React__default.createElement(
|
|
4113
|
+
'p',
|
|
4114
|
+
{ 'class': 'd-inline-block font-weight-bold' },
|
|
4115
|
+
'Connect with us:'
|
|
4116
|
+
),
|
|
4117
|
+
' ',
|
|
4118
|
+
partnerDetails.linkedin && React__default.createElement(reactSocialIcons_1, {
|
|
4119
|
+
url: '' + partnerDetails.linkedin + (partnerDetails.linkedin.slice(-1) === '/' ? '' : '/') + 'posts/?feedView=all',
|
|
4120
|
+
target: '_blank',
|
|
4121
|
+
rel: 'noopener noreferrer',
|
|
4122
|
+
style: { height: 30, width: 30 }
|
|
4123
|
+
}),
|
|
4124
|
+
partnerDetails.twitter && partnerDetails.facebook && React__default.createElement(reactSocialIcons_1, { url: partnerDetails.facebook, target: '_blank', rel: 'noopener noreferrer', style: { height: 30, width: 30, marginLeft: '0.25rem' } })
|
|
4125
|
+
)
|
|
1404
4126
|
)
|
|
1405
4127
|
),
|
|
1406
4128
|
partnerDetails.affiliates && partnerDetails.affiliates[0] && partnerDetails.affiliates[0].slides && React__default.createElement(
|
|
@@ -1418,13 +4140,13 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
1418
4140
|
{ className: ' mb-5' },
|
|
1419
4141
|
React__default.createElement(Feature, { dataset: features, client: client })
|
|
1420
4142
|
),
|
|
1421
|
-
partnerDetails.twitter && React__default.createElement(
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
React__default.createElement(
|
|
1425
|
-
|
|
1426
|
-
{
|
|
1427
|
-
React__default.createElement(
|
|
4143
|
+
(partnerDetails.twitter || partnerDetails.facebook) && React__default.createElement(
|
|
4144
|
+
'div',
|
|
4145
|
+
{ className: 'mb-5', style: { width: '100%', maxWidth: '100%', textAlign: 'center', padding: '15px', border: '2px solid #aaa', borderRadius: '15px' } },
|
|
4146
|
+
partnerDetails.twitter ? React__default.createElement(TwitterTimelineEmbed, { sourceType: 'url', url: partnerDetails.twitter, options: { height: 400 } }) : partnerDetails.facebook && React__default.createElement(
|
|
4147
|
+
Facebook$1,
|
|
4148
|
+
{ appId: ' ' },
|
|
4149
|
+
React__default.createElement(Page$1, { href: partnerDetails.facebook, tabs: 'timeline', width: '500', height: '500' })
|
|
1428
4150
|
)
|
|
1429
4151
|
),
|
|
1430
4152
|
React__default.createElement(
|
|
@@ -1464,7 +4186,7 @@ var PartnerDetails = function PartnerDetails(_ref) {
|
|
|
1464
4186
|
};
|
|
1465
4187
|
|
|
1466
4188
|
PartnerDetails.returnGetInitialProps = function () {
|
|
1467
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
4189
|
+
var _ref2 = _asyncToGenerator$1( /*#__PURE__*/regenerator.mark(function _callee(identifier, partnerPageUrl, partnerDocumentGroupID, params, currentPage, client) {
|
|
1468
4190
|
var category = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : false;
|
|
1469
4191
|
|
|
1470
4192
|
var today, featureQuery, partnerQuery, taxonomyQuery, _ref3, _ref4, features, partnerDetails, taxonomyDetails, articlesQuery, articles;
|
|
@@ -1475,14 +4197,14 @@ PartnerDetails.returnGetInitialProps = function () {
|
|
|
1475
4197
|
case 0:
|
|
1476
4198
|
today = moment().utc().format();
|
|
1477
4199
|
featureQuery = '*[_type == \'feature\' && is_active == true && feature_url == \'/' + partnerPageUrl + '/' + (category ? category + '/' : null) + identifier + '\'] | order(_updatedAt asc)[0..5]{\n ...,\n \'feature_img\' : feature_img.asset->url\n }';
|
|
1478
|
-
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
4200
|
+
partnerQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && identifier.current == \'' + identifier + '\'] | order(name asc) [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n }';
|
|
1479
4201
|
|
|
1480
4202
|
|
|
1481
4203
|
if (category) {
|
|
1482
4204
|
//if partners page has a sub category such as onclive
|
|
1483
4205
|
//e.g. /sap-partner/[category]/[partner]
|
|
1484
4206
|
|
|
1485
|
-
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
4207
|
+
partnerQuery = '*[_type == \'documentGroup\' && !(_id in path("drafts.**")) && identifier.current == \'' + category + '\' && references(\'' + partnerDocumentGroupID + '\')] [0] {\n ...,\n \'partner\': *[_type == \'documentGroup\' && identifier.current == \'' + identifier + '\' && references(^._id)] [0] {\n description,\n name,\n identifier,\n thumbnail,\n twitter,\n facebook,\n linkedin,\n "affiliates": description[_type==\'slideshows\']{\n ...,\n slides->{...}\n }\n \n }\n }';
|
|
1486
4208
|
}
|
|
1487
4209
|
|
|
1488
4210
|
taxonomyQuery = '*[_type == \'documentGroup\' \n && !(_id in path("drafts.**"))\n && references(\'' + partnerDocumentGroupID + '\')\n && isShow != false\n && identifier.current == \'' + identifier + '\'] [0] {\n \'id\': _id,\n \'title\': name\n }';
|