@mjhls/mjh-framework 1.0.225 → 1.0.227
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 +1 -1
- package/dist/cjs/{AdSlot-d87cef08.js → AdSlot-1c1700a3.js} +1 -1
- package/dist/cjs/DeckContent.js +2 -2
- package/dist/cjs/DeckQueue.js +1 -1
- package/dist/cjs/{Dfp-c4f1f12a.js → Dfp-b6d403f8.js} +1 -1
- package/dist/cjs/{GridContent-1575c8db.js → GridContent-e45cb4c7.js} +35 -9
- package/dist/cjs/GridContent.js +3 -3
- package/dist/cjs/MasterDeck.js +1 -1
- package/dist/cjs/{Normal-11ae4373.js → Normal-c3488266.js} +32 -3
- package/dist/cjs/QueueDeckExpanded.js +19 -5
- package/dist/cjs/{TaxonomyCard-d97685e2.js → TaxonomyCard-0d4ec68b.js} +1 -1
- package/dist/cjs/TaxonomyCard.js +2 -2
- package/dist/cjs/TemplateNormal.js +3 -3
- package/dist/cjs/{Ustream-0d3dd953.js → Ustream-5f595d09.js} +1 -1
- package/dist/cjs/Ustream.js +2 -2
- package/dist/cjs/VideoSeriesListing.js +1 -1
- package/dist/cjs/{_babelHelpers-f321c258.js → _babelHelpers-4a69caad.js} +30 -0
- package/dist/cjs/index.js +81 -68
- package/dist/esm/{AdSlot-b67f8534.js → AdSlot-748bc6ff.js} +1 -1
- package/dist/esm/DeckContent.js +2 -2
- package/dist/esm/DeckQueue.js +1 -1
- package/dist/esm/{Dfp-6731ac01.js → Dfp-ad9b4fbe.js} +1 -1
- package/dist/esm/{GridContent-e5cdc9da.js → GridContent-036fbe57.js} +35 -9
- package/dist/esm/GridContent.js +3 -3
- package/dist/esm/MasterDeck.js +1 -1
- package/dist/esm/{Normal-8e0aa5e8.js → Normal-088cf5cf.js} +32 -3
- package/dist/esm/QueueDeckExpanded.js +19 -5
- package/dist/esm/{TaxonomyCard-f9c93953.js → TaxonomyCard-92f9e327.js} +1 -1
- package/dist/esm/TaxonomyCard.js +2 -2
- package/dist/esm/TemplateNormal.js +3 -3
- package/dist/esm/{Ustream-6bb45fe7.js → Ustream-2bfb1813.js} +1 -1
- package/dist/esm/Ustream.js +2 -2
- package/dist/esm/VideoSeriesListing.js +1 -1
- package/dist/esm/{_babelHelpers-67c05996.js → _babelHelpers-c212c59c.js} +30 -1
- package/dist/esm/index.js +85 -72
- package/package.json +1 -1
|
@@ -1,3 +1,32 @@
|
|
|
1
|
+
var asyncToGenerator = function (fn) {
|
|
2
|
+
return function () {
|
|
3
|
+
var gen = fn.apply(this, arguments);
|
|
4
|
+
return new Promise(function (resolve, reject) {
|
|
5
|
+
function step(key, arg) {
|
|
6
|
+
try {
|
|
7
|
+
var info = gen[key](arg);
|
|
8
|
+
var value = info.value;
|
|
9
|
+
} catch (error) {
|
|
10
|
+
reject(error);
|
|
11
|
+
return;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
if (info.done) {
|
|
15
|
+
resolve(value);
|
|
16
|
+
} else {
|
|
17
|
+
return Promise.resolve(value).then(function (value) {
|
|
18
|
+
step("next", value);
|
|
19
|
+
}, function (err) {
|
|
20
|
+
step("throw", err);
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return step("next");
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
1
30
|
var classCallCheck = function (instance, Constructor) {
|
|
2
31
|
if (!(instance instanceof Constructor)) {
|
|
3
32
|
throw new TypeError("Cannot call a class as a function");
|
|
@@ -108,4 +137,4 @@ var toConsumableArray = function (arr) {
|
|
|
108
137
|
}
|
|
109
138
|
};
|
|
110
139
|
|
|
111
|
-
export { _extends as _, classCallCheck as a, createClass as c, inherits as i, possibleConstructorReturn as p, slicedToArray as s, toConsumableArray as t };
|
|
140
|
+
export { _extends as _, classCallCheck as a, asyncToGenerator as b, createClass as c, inherits as i, possibleConstructorReturn as p, slicedToArray as s, toConsumableArray as t };
|
package/dist/esm/index.js
CHANGED
|
@@ -15,17 +15,17 @@ import { i as imageUrlBuilder } from './index-ca4ff5cb.js';
|
|
|
15
15
|
import './index-3c1ee9ab.js';
|
|
16
16
|
import { m as main_35, a as main_36 } from './main-dea495b7.js';
|
|
17
17
|
import { h as html_decode_1, c as clean_html_1 } from './entities-e85d3a4a.js';
|
|
18
|
-
import { s as slicedToArray, _ as _extends$2, t as toConsumableArray, i as inherits$2, c as createClass, a as classCallCheck, p as possibleConstructorReturn } from './_babelHelpers-
|
|
19
|
-
import { D as DFPAdSlot } from './AdSlot-
|
|
20
|
-
export { D as AdSlot } from './AdSlot-
|
|
18
|
+
import { s as slicedToArray, _ as _extends$2, t as toConsumableArray, i as inherits$2, c as createClass, a as classCallCheck, p as possibleConstructorReturn, b as asyncToGenerator } from './_babelHelpers-c212c59c.js';
|
|
19
|
+
import { D as DFPAdSlot } from './AdSlot-748bc6ff.js';
|
|
20
|
+
export { D as AdSlot } from './AdSlot-748bc6ff.js';
|
|
21
21
|
export { default as DeckContent } from './DeckContent.js';
|
|
22
22
|
import './get-b074314b.js';
|
|
23
|
-
export { A as AD, G as GridContent } from './GridContent-
|
|
23
|
+
export { A as AD, G as GridContent } from './GridContent-036fbe57.js';
|
|
24
24
|
export { default as DeckQueue } from './DeckQueue.js';
|
|
25
25
|
import 'react-bootstrap/Media';
|
|
26
26
|
export { default as ThumbnailCard } from './ThumbnailCard.js';
|
|
27
|
-
import { B as BlockContent } from './TaxonomyCard-
|
|
28
|
-
export { T as TaxonomyCard } from './TaxonomyCard-
|
|
27
|
+
import { B as BlockContent } from './TaxonomyCard-92f9e327.js';
|
|
28
|
+
export { T as TaxonomyCard } from './TaxonomyCard-92f9e327.js';
|
|
29
29
|
import GroupDeck from './GroupDeck.js';
|
|
30
30
|
export { default as GroupDeck } from './GroupDeck.js';
|
|
31
31
|
import { g as getYoutubeId } from './YoutubeGroup-1368335c.js';
|
|
@@ -40,8 +40,8 @@ export { default as PublicationDeck } from './PublicationDeck.js';
|
|
|
40
40
|
export { default as IssueDeck } from './IssueDeck.js';
|
|
41
41
|
import 'react-bootstrap/Badge';
|
|
42
42
|
export { default as IssueContentDeck } from './IssueContentDeck.js';
|
|
43
|
-
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-
|
|
44
|
-
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-
|
|
43
|
+
import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-088cf5cf.js';
|
|
44
|
+
export { A as AD728x90, C as Column1, a as Column2, b as Column3, f as HamMagazine, H as Header, L as LeftNav, e as NavDvm, c as NavMagazine, N as NavNative, d as NavNormal, P as PageFilter, S as Search, g as SideFooter, T as TemplateNormal } from './Normal-088cf5cf.js';
|
|
45
45
|
import 'react-bootstrap/ListGroup';
|
|
46
46
|
import Head from 'next/head';
|
|
47
47
|
import Accordion from 'react-bootstrap/Accordion';
|
|
@@ -57,8 +57,8 @@ import Carousel$1 from 'react-bootstrap/Carousel';
|
|
|
57
57
|
import Breadcrumb from 'react-bootstrap/Breadcrumb';
|
|
58
58
|
import DropdownButton from 'react-bootstrap/DropdownButton';
|
|
59
59
|
import Dropdown from 'react-bootstrap/Dropdown';
|
|
60
|
-
import { F as FaLongArrowAltRight } from './Ustream-
|
|
61
|
-
export { U as Ustream } from './Ustream-
|
|
60
|
+
import { F as FaLongArrowAltRight } from './Ustream-2bfb1813.js';
|
|
61
|
+
export { U as Ustream } from './Ustream-2bfb1813.js';
|
|
62
62
|
|
|
63
63
|
var AccordionPanel = function AccordionPanel(props) {
|
|
64
64
|
var accordionClassName = props.accordionClassName,
|
|
@@ -12364,8 +12364,9 @@ var ArticleQueue = function (_React$Component) {
|
|
|
12364
12364
|
title: _this.props.article.title,
|
|
12365
12365
|
summary: metaDescription,
|
|
12366
12366
|
queueData: [article],
|
|
12367
|
-
|
|
12368
|
-
|
|
12367
|
+
keywords: [],
|
|
12368
|
+
maxListLength: 10,
|
|
12369
|
+
loading: false
|
|
12369
12370
|
}, _this.preVscroll = 0;
|
|
12370
12371
|
_this.isScrollDown = true;
|
|
12371
12372
|
|
|
@@ -12377,25 +12378,6 @@ var ArticleQueue = function (_React$Component) {
|
|
|
12377
12378
|
value: function componentDidMount() {
|
|
12378
12379
|
window.addEventListener('scroll', this.scrollDirectionDetect);
|
|
12379
12380
|
}
|
|
12380
|
-
}, {
|
|
12381
|
-
key: 'componentDidUpdate',
|
|
12382
|
-
value: function componentDidUpdate(prevProps) {
|
|
12383
|
-
var _this2 = this;
|
|
12384
|
-
|
|
12385
|
-
if (prevProps.relatedArticles != this.props.relatedArticles) {
|
|
12386
|
-
var relatedArticles = this.props.relatedArticles.map(function (article) {
|
|
12387
|
-
var targeting = _this2.getTargeting(_this2.props.article);
|
|
12388
|
-
var Ads = _this2.props.Ads.getRightItems(targeting);
|
|
12389
|
-
return _extends$2({}, article, { Ads: Ads });
|
|
12390
|
-
});
|
|
12391
|
-
var queueData = [].concat(toConsumableArray(this.state.queueData));
|
|
12392
|
-
if (prevProps.relatedArticles.length == 0) {
|
|
12393
|
-
queueData.push(relatedArticles.shift());
|
|
12394
|
-
this.setState({ queueData: queueData });
|
|
12395
|
-
}
|
|
12396
|
-
this.setState({ relatedArticles: relatedArticles });
|
|
12397
|
-
}
|
|
12398
|
-
}
|
|
12399
12381
|
}, {
|
|
12400
12382
|
key: 'componentWillUnmount',
|
|
12401
12383
|
value: function componentWillUnmount() {
|
|
@@ -12406,7 +12388,7 @@ var ArticleQueue = function (_React$Component) {
|
|
|
12406
12388
|
}, {
|
|
12407
12389
|
key: 'render',
|
|
12408
12390
|
value: function render() {
|
|
12409
|
-
var
|
|
12391
|
+
var _this2 = this;
|
|
12410
12392
|
|
|
12411
12393
|
var _state = this.state,
|
|
12412
12394
|
config = _state.config,
|
|
@@ -12429,12 +12411,12 @@ var ArticleQueue = function (_React$Component) {
|
|
|
12429
12411
|
queueData.map(function (article, index) {
|
|
12430
12412
|
return React__default.createElement(Article, _extends$2({
|
|
12431
12413
|
key: index,
|
|
12432
|
-
urlFor:
|
|
12433
|
-
isCutomPage:
|
|
12434
|
-
renderIsiContent:
|
|
12435
|
-
},
|
|
12414
|
+
urlFor: _this2.urlFor,
|
|
12415
|
+
isCutomPage: _this2.isCutomPage,
|
|
12416
|
+
renderIsiContent: _this2.renderIsiContent
|
|
12417
|
+
}, _this2.props, {
|
|
12436
12418
|
shareOptions: shareOptions,
|
|
12437
|
-
changeUrl:
|
|
12419
|
+
changeUrl: _this2.changeUrl,
|
|
12438
12420
|
article: article
|
|
12439
12421
|
}));
|
|
12440
12422
|
})
|
|
@@ -12446,37 +12428,68 @@ var ArticleQueue = function (_React$Component) {
|
|
|
12446
12428
|
}(React__default.Component);
|
|
12447
12429
|
|
|
12448
12430
|
var _initialiseProps = function _initialiseProps() {
|
|
12449
|
-
var
|
|
12431
|
+
var _this3 = this;
|
|
12450
12432
|
|
|
12451
12433
|
this.scrollDirectionDetect = function (e) {
|
|
12452
12434
|
var window = e.currentTarget;
|
|
12453
|
-
var isScrollDown =
|
|
12435
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12454
12436
|
|
|
12455
12437
|
|
|
12456
|
-
if (
|
|
12438
|
+
if (_this3.preVscroll > window.scrollY) {
|
|
12457
12439
|
if (!isScrollDown) {
|
|
12458
|
-
|
|
12440
|
+
_this3.isScrollDown = true;
|
|
12459
12441
|
}
|
|
12460
|
-
} else if (
|
|
12442
|
+
} else if (_this3.preVscroll < window.scrollY) {
|
|
12461
12443
|
if (isScrollDown) {
|
|
12462
|
-
|
|
12444
|
+
_this3.isScrollDown = false;
|
|
12463
12445
|
}
|
|
12464
12446
|
}
|
|
12465
|
-
|
|
12447
|
+
_this3.preVscroll = window.scrollY;
|
|
12466
12448
|
};
|
|
12467
12449
|
|
|
12468
|
-
this.loadmore = function () {
|
|
12469
|
-
var queueData
|
|
12470
|
-
|
|
12471
|
-
|
|
12472
|
-
|
|
12473
|
-
|
|
12474
|
-
|
|
12475
|
-
|
|
12450
|
+
this.loadmore = asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee() {
|
|
12451
|
+
var maxListLength, queueData, query, params, article, targeting;
|
|
12452
|
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
12453
|
+
while (1) {
|
|
12454
|
+
switch (_context.prev = _context.next) {
|
|
12455
|
+
case 0:
|
|
12456
|
+
maxListLength = _this3.props.maxListLength ? _this3.props.maxListLength : _this3.state.maxListLength;
|
|
12457
|
+
queueData = [].concat(toConsumableArray(_this3.state.queueData));
|
|
12458
|
+
query = _this3.props.relatedArticleQuery;
|
|
12459
|
+
params = _this3.props.params;
|
|
12460
|
+
|
|
12461
|
+
if (!(queueData.length < maxListLength)) {
|
|
12462
|
+
_context.next = 10;
|
|
12463
|
+
break;
|
|
12464
|
+
}
|
|
12465
|
+
|
|
12466
|
+
params.index = queueData.length - 1;
|
|
12467
|
+
|
|
12468
|
+
_context.next = 8;
|
|
12469
|
+
return _this3.props.client.fetch(query, params);
|
|
12470
|
+
|
|
12471
|
+
case 8:
|
|
12472
|
+
article = _context.sent;
|
|
12473
|
+
|
|
12474
|
+
if (article) {
|
|
12475
|
+
targeting = _this3.getTargeting(article);
|
|
12476
|
+
|
|
12477
|
+
article.Ads = _this3.props.Ads.getRightItems(targeting);
|
|
12478
|
+
queueData.push(article);
|
|
12479
|
+
_this3.setState({ queueData: queueData });
|
|
12480
|
+
}
|
|
12481
|
+
|
|
12482
|
+
case 10:
|
|
12483
|
+
case 'end':
|
|
12484
|
+
return _context.stop();
|
|
12485
|
+
}
|
|
12486
|
+
}
|
|
12487
|
+
}, _callee, _this3);
|
|
12488
|
+
}));
|
|
12476
12489
|
|
|
12477
12490
|
this.isCutomPage = function (article) {
|
|
12478
12491
|
var url = article.url.current;
|
|
12479
|
-
var _props2 =
|
|
12492
|
+
var _props2 = _this3.props,
|
|
12480
12493
|
regionalPages = _props2.regionalPages,
|
|
12481
12494
|
nationalPage = _props2.nationalPage;
|
|
12482
12495
|
|
|
@@ -12484,7 +12497,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12484
12497
|
};
|
|
12485
12498
|
|
|
12486
12499
|
this.urlFor = function (source) {
|
|
12487
|
-
return imageUrlBuilder(
|
|
12500
|
+
return imageUrlBuilder(_this3.props.client).image(source);
|
|
12488
12501
|
};
|
|
12489
12502
|
|
|
12490
12503
|
this.getTargeting = function (article) {
|
|
@@ -12509,7 +12522,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12509
12522
|
content_placement = article.content_placement;
|
|
12510
12523
|
|
|
12511
12524
|
var context = url;
|
|
12512
|
-
var localHistory =
|
|
12525
|
+
var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
|
|
12513
12526
|
if (!context && localHistory) {
|
|
12514
12527
|
context = localHistory[localHistory.length - 1];
|
|
12515
12528
|
}
|
|
@@ -12548,7 +12561,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12548
12561
|
var _article$taxonomyMapp = article.taxonomyMapping,
|
|
12549
12562
|
taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
|
|
12550
12563
|
|
|
12551
|
-
if (
|
|
12564
|
+
if (_this3.props.checkSponsered) {
|
|
12552
12565
|
|
|
12553
12566
|
return taxonomyMapping.some(function (item) {
|
|
12554
12567
|
return item._ref === 'ict_taxonomy_735_sponsoredresources';
|
|
@@ -12560,7 +12573,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12560
12573
|
|
|
12561
12574
|
this.renderIsiContent = function (article) {
|
|
12562
12575
|
var url = article.url.current;
|
|
12563
|
-
var _props3 =
|
|
12576
|
+
var _props3 = _this3.props,
|
|
12564
12577
|
ISIContent = _props3.iSIContent,
|
|
12565
12578
|
regionalPages = _props3.regionalPages,
|
|
12566
12579
|
nationalPage = _props3.nationalPage;
|
|
@@ -12594,7 +12607,7 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12594
12607
|
};
|
|
12595
12608
|
|
|
12596
12609
|
this.refreshAdd = function (path) {
|
|
12597
|
-
var article =
|
|
12610
|
+
var article = _this3.state.queueData.find(function (item) {
|
|
12598
12611
|
return item.url.current == path;
|
|
12599
12612
|
});
|
|
12600
12613
|
var title = article.title,
|
|
@@ -12614,20 +12627,20 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12614
12627
|
var description = _article$seo.meta_description;
|
|
12615
12628
|
|
|
12616
12629
|
var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
|
|
12617
|
-
var config = _extends$2({},
|
|
12618
|
-
var targeting =
|
|
12630
|
+
var config = _extends$2({}, _this3.state.config);
|
|
12631
|
+
var targeting = _this3.getTargeting(article);
|
|
12619
12632
|
var rightItems = [];
|
|
12620
12633
|
|
|
12621
|
-
if (
|
|
12634
|
+
if (_this3.checkSponseredArticle(article)) {
|
|
12622
12635
|
rightItems = [];
|
|
12623
12636
|
} else {
|
|
12624
|
-
rightItems =
|
|
12637
|
+
rightItems = _this3.props.Ads.getRightItems(targeting);
|
|
12625
12638
|
}
|
|
12626
|
-
var horizontalAD =
|
|
12639
|
+
var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
|
|
12627
12640
|
config.rightItems = rightItems;
|
|
12628
12641
|
config.horizontalAD = horizontalAD;
|
|
12629
|
-
var metaDescription = description ? description : summary ? summary :
|
|
12630
|
-
|
|
12642
|
+
var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
|
|
12643
|
+
_this3.setState({ config: config, title: title, summary: metaDescription }, function () {
|
|
12631
12644
|
if (!main_36) {
|
|
12632
12645
|
lib_3.refresh();
|
|
12633
12646
|
}
|
|
@@ -12635,28 +12648,28 @@ var _initialiseProps = function _initialiseProps() {
|
|
|
12635
12648
|
};
|
|
12636
12649
|
|
|
12637
12650
|
this.changeUrl = function (path, visibility) {
|
|
12638
|
-
var isScrollDown =
|
|
12651
|
+
var isScrollDown = _this3.isScrollDown;
|
|
12639
12652
|
|
|
12640
12653
|
var newPath = '/view/' + path;
|
|
12641
12654
|
if (!isScrollDown) {
|
|
12642
12655
|
if (visibility == 'top') {
|
|
12643
12656
|
// Router.push('/view/[url]', newPath, {shallow:true})
|
|
12644
12657
|
window.history.pushState({ page: path }, path, newPath);
|
|
12645
|
-
if (
|
|
12646
|
-
|
|
12658
|
+
if (_this3.props.pageview) {
|
|
12659
|
+
_this3.props.pageview(newPath);
|
|
12647
12660
|
}
|
|
12648
12661
|
|
|
12649
|
-
|
|
12662
|
+
_this3.refreshAdd(path);
|
|
12650
12663
|
}
|
|
12651
12664
|
} else {
|
|
12652
12665
|
if (visibility == 'bottom') {
|
|
12653
12666
|
// Router.push('/view/[url]', newPath, {shallow:true})
|
|
12654
12667
|
window.history.pushState({ page: path }, path, newPath);
|
|
12655
|
-
if (
|
|
12656
|
-
|
|
12668
|
+
if (_this3.props.pageview) {
|
|
12669
|
+
_this3.props.pageview(newPath);
|
|
12657
12670
|
}
|
|
12658
12671
|
|
|
12659
|
-
|
|
12672
|
+
_this3.refreshAdd(path);
|
|
12660
12673
|
}
|
|
12661
12674
|
}
|
|
12662
12675
|
};
|