@mjhls/mjh-framework 1.0.439 → 1.0.441
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/README.md +172 -172
- package/dist/cjs/{ADInfeed-494f5e6b.js → ADInfeed-ae1f348d.js} +12 -10
- package/dist/cjs/{ADlgInfeed-be0e0bde.js → ADlgInfeed-f4c4a1bf.js} +8 -7
- package/dist/cjs/{AdSlot-4d22aad4.js → AdSlot-257d8d4e.js} +256 -15
- package/dist/cjs/{AuthorComponent-4706f297.js → AuthorComponent-b44bb44e.js} +13 -12
- package/dist/cjs/DeckContent.js +91 -87
- package/dist/cjs/DeckQueue.js +82 -78
- package/dist/cjs/{Dfp-2399639f.js → Dfp-d7639f4c.js} +22 -20
- package/dist/cjs/{Figure-9e886c5b.js → Figure-cc919c38.js} +20 -19
- package/dist/cjs/{GridContent-068c0b1c.js → GridContent-db383f73.js} +162 -158
- package/dist/cjs/GridContent.js +14 -14
- package/dist/cjs/GroupDeck.js +39 -38
- package/dist/cjs/IssueContentDeck.js +65 -60
- package/dist/cjs/IssueDeck.js +69 -64
- package/dist/cjs/MasterDeck.js +60 -59
- package/dist/cjs/{Normal-62915103.js → Normal-430e8e61.js} +523 -512
- package/dist/cjs/PublicationDeck.js +64 -59
- package/dist/cjs/QueueDeckExpanded.js +99 -99
- package/dist/cjs/{TaxonomyCard-eb928f05.js → TaxonomyCard-fa09aac1.js} +77 -71
- package/dist/cjs/TaxonomyCard.js +4 -4
- package/dist/cjs/TemplateNormal.js +6 -6
- package/dist/cjs/ThumbnailCard.js +17 -15
- package/dist/cjs/{Ustream-6aebd935.js → Ustream-46288bdf.js} +17 -16
- package/dist/cjs/Ustream.js +1 -1
- package/dist/cjs/VideoSeriesListing.js +40 -39
- package/dist/cjs/YoutubeGroup.js +49 -48
- package/dist/cjs/{debounce-b088070c.js → debounce-420ff8a8.js} +16 -12
- package/dist/cjs/{get-5aa7468c.js → get-7a75c563.js} +1 -1
- package/dist/cjs/{index-fa0fb52c.js → index-8a3fb0bc.js} +13 -10
- package/dist/cjs/{index-b5eb3ff8.js → index-be0c82be.js} +19 -20
- package/dist/cjs/{index.es-ab3f2690.js → index.es-44c8e726.js} +9 -10
- package/dist/cjs/index.esm-340d3792.js +0 -3
- package/dist/cjs/index.js +1887 -1927
- package/dist/cjs/{inherits-e793003e.js → inherits-b4036c94.js} +4 -4
- package/dist/cjs/{main-bc4db521.js → main-d76cde9c.js} +52 -82
- package/dist/cjs/{react-social-icons-cd0d9d3b.js → react-social-icons-07939b41.js} +13 -11
- package/dist/cjs/{typeof-2747c582.js → typeof-0d86b91c.js} +1 -1
- package/dist/cjs/{visibility-sensor-0c45a583.js → visibility-sensor-a40ae0cd.js} +8 -6
- package/dist/esm/{ADInfeed-e5cefea5.js → ADInfeed-dff74bbe.js} +6 -6
- package/dist/esm/{ADlgInfeed-51a2801a.js → ADlgInfeed-7b29db85.js} +5 -5
- package/dist/esm/{AdSlot-78e48a2c.js → AdSlot-362a1c30.js} +246 -8
- package/dist/esm/{AuthorComponent-c9e46673.js → AuthorComponent-4f5f15ed.js} +10 -10
- package/dist/esm/DeckContent.js +62 -62
- package/dist/esm/DeckQueue.js +47 -47
- package/dist/esm/{Dfp-d5fe1252.js → Dfp-994cd0ab.js} +10 -10
- package/dist/esm/{Figure-cc1affbe.js → Figure-1c55ebf0.js} +17 -17
- package/dist/esm/{GridContent-90c0f8b5.js → GridContent-6b38c580.js} +112 -112
- package/dist/esm/GridContent.js +14 -14
- package/dist/esm/GroupDeck.js +34 -34
- package/dist/esm/IssueContentDeck.js +35 -35
- package/dist/esm/IssueDeck.js +34 -34
- package/dist/esm/MasterDeck.js +45 -45
- package/dist/esm/{Normal-6eba8168.js → Normal-6efd92da.js} +407 -407
- package/dist/esm/PublicationDeck.js +34 -34
- package/dist/esm/QueueDeckExpanded.js +92 -92
- package/dist/esm/{TaxonomyCard-b29aa7ac.js → TaxonomyCard-b22a742f.js} +37 -37
- package/dist/esm/TaxonomyCard.js +4 -4
- package/dist/esm/TemplateNormal.js +6 -6
- package/dist/esm/ThumbnailCard.js +13 -13
- package/dist/esm/{Ustream-914ce145.js → Ustream-c4f281a3.js} +14 -14
- package/dist/esm/Ustream.js +1 -1
- package/dist/esm/VideoSeriesListing.js +26 -26
- package/dist/esm/YoutubeGroup.js +37 -37
- package/dist/esm/{debounce-df468b0e.js → debounce-42a7f724.js} +9 -7
- package/dist/esm/{get-53653403.js → get-bc6cf9fb.js} +1 -1
- package/dist/esm/{index-51a80699.js → index-73819142.js} +19 -20
- package/dist/esm/{index-5f9f807a.js → index-c5fd0af5.js} +4 -4
- package/dist/esm/{index.es-938a3a58.js → index.es-27d0bae9.js} +6 -8
- package/dist/esm/index.js +1752 -1815
- package/dist/esm/{inherits-dfba24f5.js → inherits-bbec2f34.js} +1 -1
- package/dist/esm/{main-7d1b3c98.js → main-cf4930f0.js} +50 -81
- package/dist/esm/{react-social-icons-a7d5c5c7.js → react-social-icons-3822f1ce.js} +5 -5
- package/dist/esm/{typeof-e4b50250.js → typeof-09bf9211.js} +1 -1
- package/dist/esm/{visibility-sensor-0baa4eea.js → visibility-sensor-87d6b78c.js} +3 -3
- package/package.json +105 -103
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { u as unwrapExports, c as createCommonjsModule } from './_commonjsHelpers-0c4b6f40.js';
|
|
2
2
|
import { b as _core } from './_to-object-1b1f7766.js';
|
|
3
|
-
import
|
|
4
|
-
import { d as debounce_1, e as lib_2 } from './debounce-
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { d as debounce_1, e as lib_2 } from './debounce-42a7f724.js';
|
|
5
5
|
import PropTypes from 'prop-types';
|
|
6
|
-
import { a as main_16 } from './main-
|
|
6
|
+
import { a as main_16 } from './main-cf4930f0.js';
|
|
7
7
|
import { _ as _slicedToArray } from './slicedToArray-04e02710.js';
|
|
8
8
|
import { p as promise } from './promise-2592a80a.js';
|
|
9
9
|
|
|
@@ -1158,6 +1158,218 @@ var Beam = {
|
|
|
1158
1158
|
}
|
|
1159
1159
|
};
|
|
1160
1160
|
|
|
1161
|
+
require("babel-polyfill");
|
|
1162
|
+
|
|
1163
|
+
var Segment = {
|
|
1164
|
+
// onclive default
|
|
1165
|
+
init: function init() {
|
|
1166
|
+
var apiKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'BBbKMoOjmhsxPnbd2nO6osz3zq67DzuN';
|
|
1167
|
+
|
|
1168
|
+
if (typeof window === 'undefined') {
|
|
1169
|
+
throw new Error('window object is not defined');
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
var Analytics = require('@segment/analytics.js-core/build/analytics');
|
|
1173
|
+
var SegmentIntegration = require('@segment/analytics.js-integration-segmentio');
|
|
1174
|
+
|
|
1175
|
+
var analytics = new Analytics();
|
|
1176
|
+
analytics.use(SegmentIntegration);
|
|
1177
|
+
|
|
1178
|
+
var integrationSettings = {
|
|
1179
|
+
"Segment.io": {
|
|
1180
|
+
apiKey: apiKey,
|
|
1181
|
+
retryQueue: true,
|
|
1182
|
+
addBundledMetadata: true
|
|
1183
|
+
}
|
|
1184
|
+
};
|
|
1185
|
+
|
|
1186
|
+
analytics.initialize(integrationSettings);
|
|
1187
|
+
window.$segment = analytics;
|
|
1188
|
+
},
|
|
1189
|
+
getIDs: function getIDs() {
|
|
1190
|
+
var _this = this;
|
|
1191
|
+
|
|
1192
|
+
return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
1193
|
+
var res, json;
|
|
1194
|
+
return regenerator.wrap(function _callee$(_context) {
|
|
1195
|
+
while (1) {
|
|
1196
|
+
switch (_context.prev = _context.next) {
|
|
1197
|
+
case 0:
|
|
1198
|
+
_context.next = 2;
|
|
1199
|
+
return fetch('https://beam.mjhlifesciences.com/api/beam/id', {
|
|
1200
|
+
headers: {
|
|
1201
|
+
'Content-Type': 'application/json',
|
|
1202
|
+
Accept: 'application/json'
|
|
1203
|
+
},
|
|
1204
|
+
method: 'post',
|
|
1205
|
+
credentials: 'include'
|
|
1206
|
+
});
|
|
1207
|
+
|
|
1208
|
+
case 2:
|
|
1209
|
+
res = _context.sent;
|
|
1210
|
+
_context.next = 5;
|
|
1211
|
+
return res.json();
|
|
1212
|
+
|
|
1213
|
+
case 5:
|
|
1214
|
+
json = _context.sent;
|
|
1215
|
+
return _context.abrupt('return', json);
|
|
1216
|
+
|
|
1217
|
+
case 7:
|
|
1218
|
+
case 'end':
|
|
1219
|
+
return _context.stop();
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
}, _callee, _this);
|
|
1223
|
+
}))();
|
|
1224
|
+
},
|
|
1225
|
+
pageview: function pageview(domain) {
|
|
1226
|
+
var _this2 = this;
|
|
1227
|
+
|
|
1228
|
+
return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
1229
|
+
var segment, result, beam_id, session_id;
|
|
1230
|
+
return regenerator.wrap(function _callee2$(_context2) {
|
|
1231
|
+
while (1) {
|
|
1232
|
+
switch (_context2.prev = _context2.next) {
|
|
1233
|
+
case 0:
|
|
1234
|
+
segment = window.$segment;
|
|
1235
|
+
|
|
1236
|
+
if (segment) {
|
|
1237
|
+
_context2.next = 4;
|
|
1238
|
+
break;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
console.error('Segment not initialized', window);
|
|
1242
|
+
return _context2.abrupt('return');
|
|
1243
|
+
|
|
1244
|
+
case 4:
|
|
1245
|
+
_context2.next = 6;
|
|
1246
|
+
return _this2.getIDs();
|
|
1247
|
+
|
|
1248
|
+
case 6:
|
|
1249
|
+
result = _context2.sent;
|
|
1250
|
+
beam_id = result.beam_id ? result.beam_id : '';
|
|
1251
|
+
session_id = result.session_id ? result.session_id : '';
|
|
1252
|
+
|
|
1253
|
+
|
|
1254
|
+
segment.track('pageviews', {
|
|
1255
|
+
beamid: beam_id,
|
|
1256
|
+
sessionid: session_id,
|
|
1257
|
+
category: '',
|
|
1258
|
+
domain: domain
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
case 10:
|
|
1262
|
+
case 'end':
|
|
1263
|
+
return _context2.stop();
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
}, _callee2, _this2);
|
|
1267
|
+
}))();
|
|
1268
|
+
},
|
|
1269
|
+
adClicked: function adClicked(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
|
|
1270
|
+
var _this3 = this;
|
|
1271
|
+
|
|
1272
|
+
return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee3() {
|
|
1273
|
+
var segment, result, beam_id, session_id;
|
|
1274
|
+
return regenerator.wrap(function _callee3$(_context3) {
|
|
1275
|
+
while (1) {
|
|
1276
|
+
switch (_context3.prev = _context3.next) {
|
|
1277
|
+
case 0:
|
|
1278
|
+
segment = window.$segment;
|
|
1279
|
+
|
|
1280
|
+
if (segment) {
|
|
1281
|
+
_context3.next = 4;
|
|
1282
|
+
break;
|
|
1283
|
+
}
|
|
1284
|
+
|
|
1285
|
+
console.error('Segment not initialized');
|
|
1286
|
+
return _context3.abrupt('return');
|
|
1287
|
+
|
|
1288
|
+
case 4:
|
|
1289
|
+
_context3.next = 6;
|
|
1290
|
+
return _this3.getIDs();
|
|
1291
|
+
|
|
1292
|
+
case 6:
|
|
1293
|
+
result = _context3.sent;
|
|
1294
|
+
beam_id = result.beam_id ? result.beam_id : '';
|
|
1295
|
+
session_id = result.session_id ? result.session_id : '';
|
|
1296
|
+
|
|
1297
|
+
|
|
1298
|
+
segment.track('Ad Clicked', {
|
|
1299
|
+
beamid: beam_id,
|
|
1300
|
+
sessionid: session_id,
|
|
1301
|
+
advertiserid: advertiserid,
|
|
1302
|
+
campaignid: campaignid,
|
|
1303
|
+
creativeid: creativeid,
|
|
1304
|
+
itemid: itemid,
|
|
1305
|
+
size: size,
|
|
1306
|
+
isemptyline: isemptyline,
|
|
1307
|
+
sourceAgnosticCreativeId: sourceAgnosticCreativeId,
|
|
1308
|
+
sourceAgnosticlineId: sourceAgnosticlineId,
|
|
1309
|
+
domain: domain
|
|
1310
|
+
});
|
|
1311
|
+
|
|
1312
|
+
case 10:
|
|
1313
|
+
case 'end':
|
|
1314
|
+
return _context3.stop();
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}, _callee3, _this3);
|
|
1318
|
+
}))();
|
|
1319
|
+
},
|
|
1320
|
+
adViewed: function adViewed(domain, advertiserid, campaignid, creativeid, itemid, size, isemptyline, sourceAgnosticCreativeId, sourceAgnosticlineId) {
|
|
1321
|
+
var _this4 = this;
|
|
1322
|
+
|
|
1323
|
+
return _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee4() {
|
|
1324
|
+
var segment, result, beam_id, session_id;
|
|
1325
|
+
return regenerator.wrap(function _callee4$(_context4) {
|
|
1326
|
+
while (1) {
|
|
1327
|
+
switch (_context4.prev = _context4.next) {
|
|
1328
|
+
case 0:
|
|
1329
|
+
segment = window.$segment;
|
|
1330
|
+
|
|
1331
|
+
if (segment) {
|
|
1332
|
+
_context4.next = 4;
|
|
1333
|
+
break;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
console.error('Segment not initialized');
|
|
1337
|
+
return _context4.abrupt('return');
|
|
1338
|
+
|
|
1339
|
+
case 4:
|
|
1340
|
+
_context4.next = 6;
|
|
1341
|
+
return _this4.getIDs();
|
|
1342
|
+
|
|
1343
|
+
case 6:
|
|
1344
|
+
result = _context4.sent;
|
|
1345
|
+
beam_id = result.beam_id ? result.beam_id : '';
|
|
1346
|
+
session_id = result.session_id ? result.session_id : '';
|
|
1347
|
+
|
|
1348
|
+
|
|
1349
|
+
segment.track('Impression Viewed', {
|
|
1350
|
+
beamid: beam_id,
|
|
1351
|
+
sessionid: session_id,
|
|
1352
|
+
advertiserid: advertiserid,
|
|
1353
|
+
campaignid: campaignid,
|
|
1354
|
+
creativeid: creativeid,
|
|
1355
|
+
itemid: itemid,
|
|
1356
|
+
size: size,
|
|
1357
|
+
isemptyline: isemptyline,
|
|
1358
|
+
sourceAgnosticCreativeId: sourceAgnosticCreativeId,
|
|
1359
|
+
sourceAgnosticlineId: sourceAgnosticlineId,
|
|
1360
|
+
domain: domain
|
|
1361
|
+
});
|
|
1362
|
+
|
|
1363
|
+
case 10:
|
|
1364
|
+
case 'end':
|
|
1365
|
+
return _context4.stop();
|
|
1366
|
+
}
|
|
1367
|
+
}
|
|
1368
|
+
}, _callee4, _this4);
|
|
1369
|
+
}))();
|
|
1370
|
+
}
|
|
1371
|
+
};
|
|
1372
|
+
|
|
1161
1373
|
var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
1162
1374
|
var adUnit = _ref.adUnit,
|
|
1163
1375
|
sizeMapping = _ref.sizeMapping,
|
|
@@ -1195,15 +1407,24 @@ var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
|
1195
1407
|
}
|
|
1196
1408
|
}, 500);
|
|
1197
1409
|
|
|
1198
|
-
|
|
1410
|
+
var _useState7 = useState(null),
|
|
1411
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
1412
|
+
eventData = _useState8[0],
|
|
1413
|
+
setEventData = _useState8[1];
|
|
1414
|
+
|
|
1415
|
+
return React.createElement(
|
|
1199
1416
|
'div',
|
|
1200
1417
|
{ className: className, style: { textAlign: 'center' } },
|
|
1201
|
-
|
|
1418
|
+
React.createElement(lib_2, {
|
|
1202
1419
|
slotId: slotId,
|
|
1203
1420
|
sizes: sizes,
|
|
1204
1421
|
adUnit: adUnit,
|
|
1205
1422
|
sizeMapping: sizeMapping,
|
|
1206
1423
|
targetingArguments: targeting,
|
|
1424
|
+
onSlotIsViewable: function onSlotIsViewable(e) {
|
|
1425
|
+
Beam.report_beam_ad('Impression', main_16, eventData.cID, eventData.lID, eventData.campID, eventData.adSize, eventData.slot_id);
|
|
1426
|
+
Segment.adViewed(eventData.domain, eventData.advertiserId, eventData.campID, eventData.cID, eventData.lID, eventData.adSize, eventData.isEmpty, eventData.sourceAgnosticCreativeId, eventData.sourceAgnosticLineItemId);
|
|
1427
|
+
},
|
|
1207
1428
|
onSlotRender: function onSlotRender(eventData) {
|
|
1208
1429
|
if (eventData && eventData.slotId && eventData.slotId === slotId && checkIsAdFound) {
|
|
1209
1430
|
if (eventData.event && eventData.event.creativeId == null) {
|
|
@@ -1220,8 +1441,24 @@ var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
|
1220
1441
|
var campID = eventData.event.campaignId;
|
|
1221
1442
|
var adSize = eventData.event.size && eventData.event.size.length > 1 ? eventData.event.size[0] + 'x' + eventData.event.size[1] : '';
|
|
1222
1443
|
var slot_id = eventData.slotId ? eventData.slotId : '';
|
|
1223
|
-
|
|
1224
|
-
|
|
1444
|
+
var isEmpty = eventData.event.isEmpty;
|
|
1445
|
+
var sourceAgnosticCreativeId = eventData.event.sourceAgnosticCreativeId;
|
|
1446
|
+
var sourceAgnosticLineItemId = eventData.event.sourceAgnosticLineItemId;
|
|
1447
|
+
var advertiserId = eventData.event.advertiserId;
|
|
1448
|
+
var domain = typeof window !== 'undefined' && window.location ? window.location.hostname : '';
|
|
1449
|
+
|
|
1450
|
+
setEventData({
|
|
1451
|
+
cID: cID,
|
|
1452
|
+
lID: lID,
|
|
1453
|
+
campID: campID,
|
|
1454
|
+
adSize: adSize,
|
|
1455
|
+
slot_id: slot_id,
|
|
1456
|
+
isEmpty: isEmpty,
|
|
1457
|
+
sourceAgnosticCreativeId: sourceAgnosticCreativeId,
|
|
1458
|
+
sourceAgnosticLineItemId: sourceAgnosticLineItemId,
|
|
1459
|
+
advertiserId: advertiserId,
|
|
1460
|
+
domain: domain
|
|
1461
|
+
});
|
|
1225
1462
|
|
|
1226
1463
|
var slot_div = document.getElementById(eventData.slotId);
|
|
1227
1464
|
if (slot_div) {
|
|
@@ -1247,6 +1484,7 @@ var DFPAdSlot = function DFPAdSlot(_ref) {
|
|
|
1247
1484
|
if (hasFocus == 'yes' && document.hidden) {
|
|
1248
1485
|
slot_div.setAttribute('hasFocus', 'no');
|
|
1249
1486
|
Beam.report_beam_ad('Click', main_16, cID, lID, campID, adSize, slotId);
|
|
1487
|
+
Segment.adClicked(domain, advertiserId, campID, cID, lID, adSize, isEmpty, sourceAgnosticCreativeId, sourceAgnosticLineItemId);
|
|
1250
1488
|
}
|
|
1251
1489
|
});
|
|
1252
1490
|
} else {
|
|
@@ -1270,4 +1508,4 @@ DFPAdSlot.propTypes = {
|
|
|
1270
1508
|
sizes: PropTypes.array
|
|
1271
1509
|
};
|
|
1272
1510
|
|
|
1273
|
-
export { Beam as B, DFPAdSlot as D, _JSON$stringify as _, _asyncToGenerator as a, regenerator as r };
|
|
1511
|
+
export { Beam as B, DFPAdSlot as D, Segment as S, _JSON$stringify as _, _asyncToGenerator as a, regenerator as r };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React, { useEffect, useState, useRef } from 'react';
|
|
2
2
|
import { _ as _slicedToArray } from './slicedToArray-04e02710.js';
|
|
3
3
|
|
|
4
4
|
var AuthorComponent = function AuthorComponent(_ref) {
|
|
@@ -13,15 +13,15 @@ var AuthorComponent = function AuthorComponent(_ref) {
|
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
if (displayName && url && url.current) {
|
|
16
|
-
return
|
|
16
|
+
return React.createElement(
|
|
17
17
|
'span',
|
|
18
18
|
{ key: _id },
|
|
19
|
-
index === 0 &&
|
|
19
|
+
index === 0 && React.createElement(
|
|
20
20
|
'span',
|
|
21
21
|
{ className: 'pr-1' },
|
|
22
22
|
'By'
|
|
23
23
|
),
|
|
24
|
-
|
|
24
|
+
React.createElement(
|
|
25
25
|
'a',
|
|
26
26
|
{ href: '/authors/' + url.current, className: 'text-muted' },
|
|
27
27
|
displayName
|
|
@@ -29,15 +29,15 @@ var AuthorComponent = function AuthorComponent(_ref) {
|
|
|
29
29
|
length !== index + 1 && ', '
|
|
30
30
|
);
|
|
31
31
|
} else if (displayName) {
|
|
32
|
-
return
|
|
32
|
+
return React.createElement(
|
|
33
33
|
'span',
|
|
34
34
|
{ key: _id },
|
|
35
|
-
index === 0 &&
|
|
35
|
+
index === 0 && React.createElement(
|
|
36
36
|
'span',
|
|
37
37
|
{ className: 'pr-1' },
|
|
38
38
|
'By'
|
|
39
39
|
),
|
|
40
|
-
|
|
40
|
+
React.createElement(
|
|
41
41
|
'span',
|
|
42
42
|
{ className: 'text-muted' },
|
|
43
43
|
displayName,
|
|
@@ -70,16 +70,16 @@ var AuthorComponent = function AuthorComponent(_ref) {
|
|
|
70
70
|
var overlayRef = useRef(null);
|
|
71
71
|
var authorRef = useRef(null);
|
|
72
72
|
|
|
73
|
-
return
|
|
73
|
+
return React.createElement(
|
|
74
74
|
'div',
|
|
75
75
|
{ id: 'author-sec' + index, ref: authorRef },
|
|
76
|
-
hideContent &&
|
|
76
|
+
hideContent && React.createElement('div', { onClick: function onClick() {
|
|
77
77
|
return onOverlayClick();
|
|
78
78
|
}, ref: overlayRef, id: 'overlay-content' + index }),
|
|
79
79
|
authors.map(function (authorDetail, index) {
|
|
80
80
|
return renderAuthor(authorDetail, index, authors.length);
|
|
81
81
|
}),
|
|
82
|
-
|
|
82
|
+
React.createElement(
|
|
83
83
|
'style',
|
|
84
84
|
{ jsx: true },
|
|
85
85
|
'\n #author-sec' + index + ' {\n line-height: 25px;\n position: relative;\n height: auto;\n // max-height: 50px;\n }\n .hide-content {\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n #overlay-content' + index + ' {\n position: absolute;\n cursor: pointer;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 1000;\n }\n '
|
package/dist/esm/DeckContent.js
CHANGED
|
@@ -6,10 +6,10 @@ import './_iter-detect-7c281f0a.js';
|
|
|
6
6
|
import { _ as _toConsumableArray } from './toConsumableArray-c5e2fde8.js';
|
|
7
7
|
import './_object-pie-33c40e79.js';
|
|
8
8
|
import { _ as _extends } from './extends-92072fff.js';
|
|
9
|
-
import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _Object$getPrototypeOf, e as _createClass } from './inherits-
|
|
10
|
-
import './typeof-
|
|
11
|
-
import
|
|
12
|
-
import { d as debounce_1, l as lib_3 } from './debounce-
|
|
9
|
+
import { a as _inherits, b as _classCallCheck, c as _possibleConstructorReturn, d as _Object$getPrototypeOf, e as _createClass } from './inherits-bbec2f34.js';
|
|
10
|
+
import './typeof-09bf9211.js';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
import { d as debounce_1, l as lib_3 } from './debounce-42a7f724.js';
|
|
13
13
|
import 'prop-types';
|
|
14
14
|
import Container from 'react-bootstrap/Container';
|
|
15
15
|
import Row from 'react-bootstrap/Row';
|
|
@@ -17,17 +17,17 @@ import Col from 'react-bootstrap/Col';
|
|
|
17
17
|
import Card from 'react-bootstrap/Card';
|
|
18
18
|
import { m as moment } from './moment-12415288.js';
|
|
19
19
|
import { withRouter } from 'next/router';
|
|
20
|
-
import { I as InfiniteScroll } from './index.es-
|
|
20
|
+
import { I as InfiniteScroll } from './index.es-27d0bae9.js';
|
|
21
21
|
import 'react-dom';
|
|
22
|
-
import { V as VisibilitySensor } from './visibility-sensor-
|
|
23
|
-
import { i as imageUrlBuilder } from './index-
|
|
24
|
-
import { L as LazyLoad } from './index-
|
|
25
|
-
import { m as
|
|
22
|
+
import { V as VisibilitySensor } from './visibility-sensor-87d6b78c.js';
|
|
23
|
+
import { i as imageUrlBuilder } from './index-73819142.js';
|
|
24
|
+
import { L as LazyLoad } from './index-c5fd0af5.js';
|
|
25
|
+
import { m as main_36 } from './main-cf4930f0.js';
|
|
26
26
|
import { c as clean_html_1 } from './entities-7cc3bf45.js';
|
|
27
27
|
import './slicedToArray-04e02710.js';
|
|
28
|
-
import './AdSlot-
|
|
28
|
+
import './AdSlot-362a1c30.js';
|
|
29
29
|
import './promise-2592a80a.js';
|
|
30
|
-
import { A as ADInfeed } from './ADInfeed-
|
|
30
|
+
import { A as ADInfeed } from './ADInfeed-dff74bbe.js';
|
|
31
31
|
|
|
32
32
|
var DeckContent = function (_React$Component) {
|
|
33
33
|
_inherits(DeckContent, _React$Component);
|
|
@@ -168,14 +168,14 @@ var DeckContent = function (_React$Component) {
|
|
|
168
168
|
var newPath = pageNumber === 1 ? '' + path : path + '?page=' + pageNumber;
|
|
169
169
|
|
|
170
170
|
// please leave this for later debug purpose : Yong Jun.
|
|
171
|
-
/* console.log('page change reported', {
|
|
172
|
-
currentPage: currentPage,
|
|
173
|
-
pageNumber: pageNumber,
|
|
174
|
-
pathname: pathname,
|
|
175
|
-
path: path,
|
|
176
|
-
newPath: newPath,
|
|
177
|
-
firstPage: pageNumber === 1,
|
|
178
|
-
queryString: queryString
|
|
171
|
+
/* console.log('page change reported', {
|
|
172
|
+
currentPage: currentPage,
|
|
173
|
+
pageNumber: pageNumber,
|
|
174
|
+
pathname: pathname,
|
|
175
|
+
path: path,
|
|
176
|
+
newPath: newPath,
|
|
177
|
+
firstPage: pageNumber === 1,
|
|
178
|
+
queryString: queryString
|
|
179
179
|
}) */
|
|
180
180
|
|
|
181
181
|
if (pageview) {
|
|
@@ -195,35 +195,35 @@ var DeckContent = function (_React$Component) {
|
|
|
195
195
|
url = authorDetail.url;
|
|
196
196
|
|
|
197
197
|
if (displayName && url && url.current) {
|
|
198
|
-
return
|
|
198
|
+
return React.createElement(
|
|
199
199
|
'div',
|
|
200
200
|
{ key: _id },
|
|
201
|
-
index === 0 &&
|
|
201
|
+
index === 0 && React.createElement(
|
|
202
202
|
'span',
|
|
203
203
|
{ className: 'pr-1' },
|
|
204
204
|
'By'
|
|
205
205
|
),
|
|
206
|
-
|
|
206
|
+
React.createElement(
|
|
207
207
|
'a',
|
|
208
208
|
{ href: '/authors/${url.current}', className: 'text-muted' },
|
|
209
209
|
displayName,
|
|
210
|
-
length !== index + 1 &&
|
|
210
|
+
length !== index + 1 && React.createElement('br', null)
|
|
211
211
|
)
|
|
212
212
|
);
|
|
213
213
|
} else if (displayName) {
|
|
214
|
-
return
|
|
214
|
+
return React.createElement(
|
|
215
215
|
'div',
|
|
216
216
|
{ key: _id },
|
|
217
|
-
index === 0 &&
|
|
217
|
+
index === 0 && React.createElement(
|
|
218
218
|
'span',
|
|
219
219
|
{ className: 'pr-1' },
|
|
220
220
|
'By'
|
|
221
221
|
),
|
|
222
|
-
|
|
222
|
+
React.createElement(
|
|
223
223
|
'span',
|
|
224
224
|
{ className: 'text-muted' },
|
|
225
225
|
displayName,
|
|
226
|
-
length !== index + 1 &&
|
|
226
|
+
length !== index + 1 && React.createElement('br', null)
|
|
227
227
|
)
|
|
228
228
|
);
|
|
229
229
|
}
|
|
@@ -265,7 +265,7 @@ var DeckContent = function (_React$Component) {
|
|
|
265
265
|
articles = _this.state.data;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
-
return
|
|
268
|
+
return React.createElement(
|
|
269
269
|
Row,
|
|
270
270
|
null,
|
|
271
271
|
articles && articles.map(function (row, index) {
|
|
@@ -277,51 +277,51 @@ var DeckContent = function (_React$Component) {
|
|
|
277
277
|
lgVar = 6;
|
|
278
278
|
}
|
|
279
279
|
if (row._type === 'BrandInsight' && row.adUnit) {
|
|
280
|
-
return
|
|
280
|
+
return React.createElement(ADInfeed, { index: index, infeedAd: row });
|
|
281
281
|
} else {
|
|
282
282
|
var pageNumber = row.pageNumber || _this.state.page;
|
|
283
283
|
var contentCategoryName = row.contentCategory && row.contentCategory.name && _this.mapping[row.contentCategory.name] ? row.contentCategory.name : 'Articles';
|
|
284
|
-
return
|
|
285
|
-
|
|
284
|
+
return React.createElement(
|
|
285
|
+
React.Fragment,
|
|
286
286
|
{ key: itemCounter },
|
|
287
|
-
|
|
287
|
+
React.createElement(
|
|
288
288
|
VisibilitySensor,
|
|
289
289
|
{
|
|
290
290
|
onChange: function onChange(isVisible) {
|
|
291
291
|
isVisible && _this.changePageNumber(pageNumber);
|
|
292
292
|
} },
|
|
293
|
-
|
|
293
|
+
React.createElement(
|
|
294
294
|
Col,
|
|
295
295
|
{ md: 12, lg: lgVar, counter: itemCounter++, style: { display: 'flex', flex: '1 0 auto' } },
|
|
296
|
-
|
|
296
|
+
React.createElement(
|
|
297
297
|
Card,
|
|
298
298
|
{ className: 'content-card', style: { flexDirection: mode } },
|
|
299
|
-
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) &&
|
|
299
|
+
(row.thumbnail && row.thumbnail.asset || _this.props.defaultImage) && React.createElement(
|
|
300
300
|
'a',
|
|
301
301
|
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
302
|
-
|
|
302
|
+
React.createElement(
|
|
303
303
|
LazyLoad,
|
|
304
304
|
{ height: _this.props.imageHeight },
|
|
305
|
-
|
|
305
|
+
React.createElement(Card.Img, {
|
|
306
306
|
variant: 'top',
|
|
307
307
|
src: _this.renderCardImage(row, page),
|
|
308
308
|
alt: row.thumbnail && row.thumbnail.asset ? row.thumbnail.asset.originalFilename : ''
|
|
309
309
|
})
|
|
310
310
|
)
|
|
311
311
|
),
|
|
312
|
-
|
|
312
|
+
React.createElement(
|
|
313
313
|
Card.Body,
|
|
314
314
|
null,
|
|
315
|
-
|
|
315
|
+
React.createElement(
|
|
316
316
|
'a',
|
|
317
317
|
{ href: _this.mapping[contentCategoryName] + '/' + row.url.current },
|
|
318
|
-
|
|
318
|
+
React.createElement(
|
|
319
319
|
Card.Title,
|
|
320
320
|
null,
|
|
321
321
|
row.title
|
|
322
322
|
)
|
|
323
323
|
),
|
|
324
|
-
_this.props.showPublished && row.published &&
|
|
324
|
+
_this.props.showPublished && row.published && React.createElement(
|
|
325
325
|
Card.Subtitle,
|
|
326
326
|
null,
|
|
327
327
|
moment(row.published).format('MMMM DD, YYYY')
|
|
@@ -329,7 +329,7 @@ var DeckContent = function (_React$Component) {
|
|
|
329
329
|
_this.props.showAuthor && row.authorMapping && row.authorMapping.length > 0 && row.authorMapping.map(function (authorDetail, index) {
|
|
330
330
|
return _this.renderAuthor(authorDetail, index, row.authorMapping.length);
|
|
331
331
|
}),
|
|
332
|
-
|
|
332
|
+
React.createElement(
|
|
333
333
|
Card.Text,
|
|
334
334
|
null,
|
|
335
335
|
clean_html_1(row.summary)
|
|
@@ -338,7 +338,7 @@ var DeckContent = function (_React$Component) {
|
|
|
338
338
|
)
|
|
339
339
|
)
|
|
340
340
|
),
|
|
341
|
-
|
|
341
|
+
main_36 && _this.props.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && _this.renderMobileAd(index, numberOfItemsBeforeAd)
|
|
342
342
|
);
|
|
343
343
|
}
|
|
344
344
|
})
|
|
@@ -347,7 +347,7 @@ var DeckContent = function (_React$Component) {
|
|
|
347
347
|
var rightItems = _this.props.rightItems;
|
|
348
348
|
|
|
349
349
|
var i = ((index + 1) / numberOfItemsBeforeAd - 1) % rightItems.length;
|
|
350
|
-
return
|
|
350
|
+
return React.createElement(
|
|
351
351
|
Col,
|
|
352
352
|
{ md: 12, style: { display: 'flex', flex: '1 0 auto' } },
|
|
353
353
|
rightItems[i].component
|
|
@@ -355,15 +355,15 @@ var DeckContent = function (_React$Component) {
|
|
|
355
355
|
}, _this.renderManualPagination = function () {
|
|
356
356
|
var currentPage = _this.state.currentPage;
|
|
357
357
|
|
|
358
|
-
return
|
|
358
|
+
return React.createElement(
|
|
359
359
|
'div',
|
|
360
360
|
{ className: 'd-flex justify-content-between' },
|
|
361
|
-
currentPage && currentPage > 1 &&
|
|
361
|
+
currentPage && currentPage > 1 && React.createElement(
|
|
362
362
|
'a',
|
|
363
363
|
{ href: '?page=' + (currentPage - 1) },
|
|
364
364
|
'<< Previous'
|
|
365
365
|
),
|
|
366
|
-
|
|
366
|
+
React.createElement(
|
|
367
367
|
'a',
|
|
368
368
|
{ href: '?page=' + (currentPage + 1) },
|
|
369
369
|
'Next >>'
|
|
@@ -409,38 +409,38 @@ var DeckContent = function (_React$Component) {
|
|
|
409
409
|
brandInsight = _props.brandInsight;
|
|
410
410
|
|
|
411
411
|
|
|
412
|
-
return
|
|
412
|
+
return React.createElement(
|
|
413
413
|
'div',
|
|
414
414
|
{ className: 'contentDeck' },
|
|
415
|
-
autoScroll ?
|
|
416
|
-
|
|
415
|
+
autoScroll ? React.createElement(
|
|
416
|
+
React.Fragment,
|
|
417
417
|
null,
|
|
418
|
-
|
|
418
|
+
React.createElement(
|
|
419
419
|
InfiniteScroll,
|
|
420
420
|
{ dataLength: this.state.data.length, next: this.loadMore, hasMore: this.state.scrolling, scrollThreshold: 0.9 },
|
|
421
|
-
|
|
421
|
+
React.createElement(
|
|
422
422
|
Container,
|
|
423
423
|
null,
|
|
424
424
|
this.cardLoader(page, columns, variant, showBI, brandInsight)
|
|
425
425
|
)
|
|
426
426
|
),
|
|
427
|
-
|
|
427
|
+
React.createElement(
|
|
428
428
|
'noscript',
|
|
429
429
|
null,
|
|
430
430
|
this.renderManualPagination()
|
|
431
431
|
)
|
|
432
|
-
) :
|
|
433
|
-
|
|
432
|
+
) : React.createElement(
|
|
433
|
+
React.Fragment,
|
|
434
434
|
null,
|
|
435
|
-
|
|
435
|
+
React.createElement(
|
|
436
436
|
Container,
|
|
437
437
|
null,
|
|
438
438
|
this.cardLoader(page, columns, variant, showBI, brandInsight)
|
|
439
439
|
),
|
|
440
|
-
|
|
440
|
+
React.createElement(
|
|
441
441
|
'div',
|
|
442
442
|
{ style: { padding: '0px 10px' } },
|
|
443
|
-
this.state.scrolling ?
|
|
443
|
+
this.state.scrolling ? React.createElement(
|
|
444
444
|
'button',
|
|
445
445
|
{
|
|
446
446
|
style: { margin: 'auto', width: '100%' },
|
|
@@ -448,17 +448,17 @@ var DeckContent = function (_React$Component) {
|
|
|
448
448
|
_this2.loadMore();
|
|
449
449
|
} },
|
|
450
450
|
'Load More'
|
|
451
|
-
) :
|
|
451
|
+
) : React.createElement(
|
|
452
452
|
'p',
|
|
453
453
|
{ style: { textAlign: 'center' } },
|
|
454
|
-
|
|
454
|
+
React.createElement(
|
|
455
455
|
'b',
|
|
456
456
|
null,
|
|
457
457
|
'End of data'
|
|
458
458
|
)
|
|
459
459
|
)
|
|
460
460
|
),
|
|
461
|
-
|
|
461
|
+
React.createElement(
|
|
462
462
|
'noscript',
|
|
463
463
|
null,
|
|
464
464
|
this.renderManualPagination()
|
|
@@ -469,7 +469,7 @@ var DeckContent = function (_React$Component) {
|
|
|
469
469
|
}]);
|
|
470
470
|
|
|
471
471
|
return DeckContent;
|
|
472
|
-
}(
|
|
472
|
+
}(React.Component);
|
|
473
473
|
|
|
474
474
|
var ContentCard = withRouter(DeckContent);
|
|
475
475
|
|