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