@mjhls/mjh-framework 1.0.214 → 1.0.215

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 CHANGED
@@ -1,5 +1,5 @@
1
1
 
2
- # mjh-framework v. 1.0.214
2
+ # mjh-framework v. 1.0.215
3
3
 
4
4
 
5
5
 
package/dist/cjs/index.js CHANGED
@@ -14,7 +14,7 @@ require('react-bootstrap/Row');
14
14
  require('react-bootstrap/Col');
15
15
  require('react-bootstrap/Card');
16
16
  var visibilitySensor = require('./visibility-sensor-bea3105d.js');
17
- require('next/link');
17
+ var Link = _interopDefault(require('next/link'));
18
18
  var Router = require('next/router');
19
19
  var Router__default = _interopDefault(Router);
20
20
  require('./debounce-a963b136.js');
@@ -11618,7 +11618,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
11618
11618
  ),
11619
11619
  React__default.createElement(
11620
11620
  'p',
11621
- null,
11621
+ { className: 'top-article-summary' },
11622
11622
  entities.clean_html_1(topArticle.summary)
11623
11623
  )
11624
11624
  )
@@ -11763,7 +11763,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
11763
11763
  React__default.createElement(
11764
11764
  'style',
11765
11765
  { jsx: 'true' },
11766
- '\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
11766
+ '\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n .top-article-summary {\n display: none;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
11767
11767
  )
11768
11768
  );
11769
11769
  };
@@ -12107,6 +12107,499 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
12107
12107
  );
12108
12108
  };
12109
12109
 
12110
+ var InscreenSensor = function (_React$Component) {
12111
+ _babelHelpers.inherits(InscreenSensor, _React$Component);
12112
+
12113
+ function InscreenSensor(props) {
12114
+ _babelHelpers.classCallCheck(this, InscreenSensor);
12115
+
12116
+ var _this = _babelHelpers.possibleConstructorReturn(this, (InscreenSensor.__proto__ || Object.getPrototypeOf(InscreenSensor)).call(this, props));
12117
+
12118
+ _this.scrollHandler = function () {
12119
+ // this.checkInside()
12120
+
12121
+ var visible = _this.checkInside();
12122
+ if (visible != _this.visible) {
12123
+ _this.visible = visible;
12124
+ _this.props.onChange(visible);
12125
+ }
12126
+ };
12127
+
12128
+ _this.checkInside = function () {
12129
+ var rect = _this.wraperRef.current.getBoundingClientRect();
12130
+ var _this$props$offSetTop = _this.props.offSetTop,
12131
+ offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
12132
+ var top = rect.top,
12133
+ height = rect.height;
12134
+
12135
+ var bottom = top + height;
12136
+ var viewHeight = window.innerHeight;
12137
+ if (bottom < offSetTop) {
12138
+ return false;
12139
+ } else if (top > offSetTop && bottom <= viewHeight) {
12140
+ return true;
12141
+ } else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
12142
+ return 'top';
12143
+ } else if (bottom <= viewHeight) {
12144
+ return 'bottom';
12145
+ } else {
12146
+ return false;
12147
+ }
12148
+ };
12149
+
12150
+ _this.wraperRef = React__default.createRef();
12151
+ _this.visible = false;
12152
+ return _this;
12153
+ }
12154
+
12155
+ _babelHelpers.createClass(InscreenSensor, [{
12156
+ key: 'componentDidMount',
12157
+ value: function componentDidMount() {
12158
+ this.visible = this.checkInside();
12159
+ this.props.onChange(this.visible);
12160
+ window.addEventListener('scroll', this.scrollHandler);
12161
+ }
12162
+ }, {
12163
+ key: 'componentWillUnmount',
12164
+ value: function componentWillUnmount() {
12165
+ window.removeEventListener('scroll', this.scrollHandler);
12166
+ }
12167
+ }, {
12168
+ key: 'render',
12169
+ value: function render() {
12170
+ var _props = this.props,
12171
+ _props$className = _props.className,
12172
+ className = _props$className === undefined ? '' : _props$className,
12173
+ _props$style = _props.style,
12174
+ style = _props$style === undefined ? {} : _props$style;
12175
+
12176
+ return React__default.createElement(
12177
+ 'div',
12178
+ { ref: this.wraperRef, className: className, style: style },
12179
+ this.props.children
12180
+ );
12181
+ }
12182
+ }]);
12183
+ return InscreenSensor;
12184
+ }(React__default.Component);
12185
+
12186
+ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
12187
+ if (authorName && authorURL) return React__default.createElement(
12188
+ Link,
12189
+ { href: '/authors/' + authorURL.current, key: index },
12190
+ React__default.createElement(
12191
+ 'a',
12192
+ null,
12193
+ authorName,
12194
+ length !== index + 1 && React__default.createElement('br', null)
12195
+ )
12196
+ );else if (authorName) {
12197
+ return React__default.createElement(
12198
+ 'span',
12199
+ { key: index },
12200
+ authorName,
12201
+ length !== index + 1 && React__default.createElement('br', null)
12202
+ );
12203
+ }
12204
+ };
12205
+
12206
+ var Article = function Article(props) {
12207
+ var client = props.client,
12208
+ pageview = props.pageview,
12209
+ videoAccountIDs = props.videoAccountIDs,
12210
+ _props$article = props.article,
12211
+ title = _props$article.title,
12212
+ passwordLock = _props$article.passwordLock,
12213
+ authorDetails = _props$article.authorDetails,
12214
+ published = _props$article.published,
12215
+ articleBody = _props$article.body,
12216
+ summary = _props$article.summary,
12217
+ thumbnail = _props$article.thumbnail,
12218
+ _props$article$url = _props$article.url;
12219
+ _props$article$url = _props$article$url === undefined ? {
12220
+ current: ''
12221
+ } : _props$article$url;
12222
+ var url = _props$article$url.current,
12223
+ changeUrl = props.changeUrl,
12224
+ isCutomPage = props.isCutomPage,
12225
+ shareOptions = props.shareOptions,
12226
+ renderIsiContent = props.renderIsiContent,
12227
+ urlFor = props.urlFor;
12228
+ var shareVia = shareOptions.shareVia,
12229
+ shareSubject = shareOptions.shareSubject,
12230
+ twitterSiteName = shareOptions.twitterSiteName,
12231
+ shareImageDefault = shareOptions.shareImageDefault;
12232
+
12233
+ var shareUrl = shareOptions.shareBaseUrl + props.url;
12234
+ var shareTitle = title;
12235
+ var shareSummary = summary;
12236
+ var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
12237
+
12238
+ var siteName = props.website.title;
12239
+ return React__default.createElement(
12240
+ InscreenSensor,
12241
+ {
12242
+ offSetTop: 45,
12243
+ onChange: function onChange(visible) {
12244
+ if (visible !== false) {
12245
+ changeUrl(url, visible);
12246
+ }
12247
+ } },
12248
+ React__default.createElement(
12249
+ 'div',
12250
+ null,
12251
+ React__default.createElement(
12252
+ Head,
12253
+ null,
12254
+ passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
12255
+ ),
12256
+ React__default.createElement(
12257
+ 'h1',
12258
+ { className: 'page-title' },
12259
+ title
12260
+ ),
12261
+ React__default.createElement(
12262
+ 'div',
12263
+ { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
12264
+ React__default.createElement(
12265
+ 'div',
12266
+ null,
12267
+ visibilitySensor.moment(published).format('LL')
12268
+ ),
12269
+ React__default.createElement(
12270
+ 'div',
12271
+ { className: 'mb-3' },
12272
+ authorDetails && authorDetails.map(function (authorDetail, index) {
12273
+ return React__default.createElement(
12274
+ 'div',
12275
+ { key: index },
12276
+ renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
12277
+ );
12278
+ })
12279
+ ),
12280
+ React__default.createElement(
12281
+ 'p',
12282
+ null,
12283
+ React__default.createElement(SocialShare$1, {
12284
+ shareUrl: shareUrl,
12285
+ shareTitle: shareTitle,
12286
+ shareVia: shareVia,
12287
+ shareSummary: shareSummary,
12288
+ shareSubject: shareSubject,
12289
+ shareImage: shareImage,
12290
+ size: 32,
12291
+ siteName: siteName,
12292
+ twitterSiteName: twitterSiteName
12293
+ })
12294
+ ),
12295
+ React__default.createElement(
12296
+ 'p',
12297
+ null,
12298
+ React__default.createElement(
12299
+ 'em',
12300
+ null,
12301
+ summary
12302
+ ),
12303
+ React__default.createElement('br', null),
12304
+ React__default.createElement('br', null)
12305
+ ),
12306
+ React__default.createElement(
12307
+ 'div',
12308
+ { className: 'block-content' },
12309
+ React__default.createElement(TaxonomyCard.BlockContent, _babelHelpers._extends({
12310
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
12311
+ blocks: articleBody,
12312
+ imageOptions: { w: 320, h: 240, fit: 'max' }
12313
+ }, client.config()))
12314
+ )
12315
+ ),
12316
+ renderIsiContent(props.article)
12317
+ )
12318
+ );
12319
+ };
12320
+
12321
+ var ArticleQueue = function (_React$Component) {
12322
+ _babelHelpers.inherits(ArticleQueue, _React$Component);
12323
+
12324
+ function ArticleQueue(props) {
12325
+ _babelHelpers.classCallCheck(this, ArticleQueue);
12326
+
12327
+ var _this = _babelHelpers.possibleConstructorReturn(this, (ArticleQueue.__proto__ || Object.getPrototypeOf(ArticleQueue)).call(this, props));
12328
+
12329
+ _initialiseProps.call(_this);
12330
+
12331
+ var _this$props$article$s = _this.props.article.seo;
12332
+ _this$props$article$s = _this$props$article$s === undefined ? {
12333
+ meta_description: null
12334
+ } : _this$props$article$s;
12335
+ var description = _this$props$article$s.meta_description;
12336
+
12337
+ var targeting = _this.getTargeting(_this.props.article);
12338
+ _this.state = {
12339
+ config: {
12340
+ navComponent: _this.props.website.navigation,
12341
+ navItems: _this.props.mainNavCache,
12342
+ columns: '3',
12343
+ leftItems: _this.props.subNavCache,
12344
+ rightItems: _this.props.Ads.getRightItems(targeting),
12345
+ horizontalAD: _this.props.Ads.getHorizontal(targeting),
12346
+ isLiveSite: _this.props.isLiveSite
12347
+ },
12348
+ title: _this.props.article.title,
12349
+ summary: description ? description : _this.props.article.summary,
12350
+ queueData: [_this.props.article],
12351
+ relatedArticles: [],
12352
+ keywords: []
12353
+ }, _this.preVscroll = 0;
12354
+ _this.isScrollDown = true;
12355
+
12356
+ return _this;
12357
+ }
12358
+
12359
+ _babelHelpers.createClass(ArticleQueue, [{
12360
+ key: 'componentDidMount',
12361
+ value: function componentDidMount() {
12362
+ window.addEventListener('scroll', this.scrollDirectionDetect);
12363
+ }
12364
+ }, {
12365
+ key: 'componentDidUpdate',
12366
+ value: function componentDidUpdate(prevProps) {
12367
+ if (prevProps.relatedArticles != this.props.relatedArticles) {
12368
+ var relatedArticles = this.props.relatedArticles;
12369
+
12370
+ var queueData = [].concat(_babelHelpers.toConsumableArray(this.state.queueData));
12371
+ if (prevProps.relatedArticles.length == 0) {
12372
+ queueData.push(relatedArticles.shift());
12373
+ this.setState({ queueData: queueData });
12374
+ }
12375
+ this.setState({ relatedArticles: relatedArticles });
12376
+ }
12377
+ }
12378
+ }, {
12379
+ key: 'componentWillUnmount',
12380
+ value: function componentWillUnmount() {
12381
+ window.removeEventListener('scroll', this.scrollDirectionDetect);
12382
+ }
12383
+ }, {
12384
+ key: 'render',
12385
+ value: function render() {
12386
+ var _this2 = this;
12387
+
12388
+ var _state = this.state,
12389
+ config = _state.config,
12390
+ _state$keywords = _state.keywords,
12391
+ keywords = _state$keywords === undefined ? [] : _state$keywords,
12392
+ queueData = _state.queueData,
12393
+ title = _state.title,
12394
+ summary = _state.summary;
12395
+ var _props = this.props,
12396
+ website = _props.website,
12397
+ shareOptions = _props.shareOptions;
12398
+
12399
+
12400
+ return React__default.createElement(
12401
+ TemplateNormal.TemplateNormal,
12402
+ { config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: true },
12403
+ React__default.createElement(
12404
+ visibilitySensor.InfiniteScroll,
12405
+ { dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
12406
+ queueData.map(function (article, index) {
12407
+ return React__default.createElement(Article, _babelHelpers._extends({
12408
+ key: index,
12409
+ urlFor: _this2.urlFor,
12410
+ isCutomPage: _this2.isCutomPage,
12411
+ renderIsiContent: _this2.renderIsiContent
12412
+ }, _this2.props, {
12413
+ shareOptions: shareOptions,
12414
+ changeUrl: _this2.changeUrl,
12415
+ article: article
12416
+ }));
12417
+ })
12418
+ )
12419
+ );
12420
+ }
12421
+ }]);
12422
+ return ArticleQueue;
12423
+ }(React__default.Component);
12424
+
12425
+ var _initialiseProps = function _initialiseProps() {
12426
+ var _this3 = this;
12427
+
12428
+ this.scrollDirectionDetect = function (e) {
12429
+ var window = e.currentTarget;
12430
+ var isScrollDown = _this3.isScrollDown;
12431
+
12432
+
12433
+ if (_this3.preVscroll > window.scrollY) {
12434
+ if (!isScrollDown) {
12435
+ _this3.isScrollDown = true;
12436
+ }
12437
+ } else if (_this3.preVscroll < window.scrollY) {
12438
+ if (isScrollDown) {
12439
+ _this3.isScrollDown = false;
12440
+ }
12441
+ }
12442
+ _this3.preVscroll = window.scrollY;
12443
+ };
12444
+
12445
+ this.loadmore = function () {
12446
+ var queueData = [].concat(_babelHelpers.toConsumableArray(_this3.state.queueData));
12447
+ var relatedArticles = [].concat(_babelHelpers.toConsumableArray(_this3.state.relatedArticles));
12448
+ if (relatedArticles.length > 0) {
12449
+ queueData.push(relatedArticles.shift());
12450
+ _this3.setState({ queueData: queueData, relatedArticles: relatedArticles });
12451
+ }
12452
+ };
12453
+
12454
+ this.isCutomPage = function (article) {
12455
+ var url = article.url.current;
12456
+ var _props2 = _this3.props,
12457
+ regionalPages = _props2.regionalPages,
12458
+ nationalPage = _props2.nationalPage;
12459
+
12460
+ return regionalPages.includes(url) || nationalPage === url;
12461
+ };
12462
+
12463
+ this.urlFor = function (source) {
12464
+ return index$1.imageUrlBuilder(_this3.props.client).image(source);
12465
+ };
12466
+
12467
+ this.getTargeting = function (article) {
12468
+ var _article$internalTag = article.internalTag,
12469
+ internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
12470
+ _article$userDefinedT = article.userDefinedTag,
12471
+ userDefinedTag = _article$userDefinedT === undefined ? [] : _article$userDefinedT,
12472
+ _article$SponsorshipT = article.SponsorshipTag,
12473
+ SponsorshipTag = _article$SponsorshipT === undefined ? [] : _article$SponsorshipT,
12474
+ _article$seoTag = article.seoTag,
12475
+ seoTag = _article$seoTag === undefined ? [] : _article$seoTag,
12476
+ _article$url = article.url;
12477
+ _article$url = _article$url === undefined ? {
12478
+ current: ''
12479
+ } : _article$url;
12480
+ var url = _article$url.current,
12481
+ _article$documentGrou = article.documentGroup;
12482
+ _article$documentGrou = _article$documentGrou === undefined ? {
12483
+ path: ''
12484
+ } : _article$documentGrou;
12485
+ var document_group = _article$documentGrou.path,
12486
+ content_placement = article.content_placement;
12487
+
12488
+ var context = url;
12489
+ var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
12490
+ if (!context && localHistory) {
12491
+ context = localHistory[localHistory.length - 1];
12492
+ }
12493
+ context = context && context.split('?')[0];
12494
+ context = context && context.split('&')[0];
12495
+ var content_placement_urls = [];
12496
+ if (content_placement) {
12497
+ if (content_placement.some(function (item) {
12498
+ return context === item.path;
12499
+ })) {
12500
+ content_placement_urls = [context];
12501
+ } else if (content_placement.some(function (item) {
12502
+ return context === '/' + item.path;
12503
+ })) {
12504
+ content_placement_urls = [context.slice(1)];
12505
+ } else {
12506
+ content_placement_urls = content_placement.map(function (item) {
12507
+ return item.path;
12508
+ });
12509
+ }
12510
+ }
12511
+ if (document_group.length > 0) {
12512
+ content_placement_urls = [];
12513
+ }
12514
+ var keywords = [].concat(_babelHelpers.toConsumableArray(internalTag), _babelHelpers.toConsumableArray(userDefinedTag), _babelHelpers.toConsumableArray(SponsorshipTag), _babelHelpers.toConsumableArray(seoTag));
12515
+ var targeting = {
12516
+ tags: keywords,
12517
+ document_group: [document_group],
12518
+ document_url: [url],
12519
+ content_placement: content_placement_urls
12520
+ };
12521
+ return targeting;
12522
+ };
12523
+
12524
+ this.checkSponseredArticle = function (article) {
12525
+ var _article$taxonomyMapp = article.taxonomyMapping,
12526
+ taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
12527
+
12528
+ if (_this3.props.checkSponsered) {
12529
+
12530
+ return taxonomyMapping.some(function (item) {
12531
+ return item._ref === 'ict_taxonomy_735_sponsoredresources';
12532
+ });
12533
+ } else {
12534
+ return false;
12535
+ }
12536
+ };
12537
+
12538
+ this.renderIsiContent = function (article) {
12539
+ var url = article.url.current;
12540
+ var _props3 = _this3.props,
12541
+ ISIContent = _props3.iSIContent,
12542
+ regionalPages = _props3.regionalPages,
12543
+ nationalPage = _props3.nationalPage;
12544
+
12545
+ if (regionalPages.includes(url)) {
12546
+ return React__default.createElement(ISIContent, null);
12547
+ } else if (nationalPage === url) {
12548
+ return React__default.createElement(ISIContent, { national: true });
12549
+ }
12550
+ return null;
12551
+ };
12552
+
12553
+ this.refreshAdd = function (path) {
12554
+ var article = _this3.state.queueData.find(function (item) {
12555
+ return item.url.current == path;
12556
+ });
12557
+ var title = article.title,
12558
+ summary = article.summary,
12559
+ _article$seo = article.seo;
12560
+ _article$seo = _article$seo === undefined ? {
12561
+ meta_description: null
12562
+ } : _article$seo;
12563
+ var description = _article$seo.meta_description;
12564
+
12565
+ var config = _babelHelpers._extends({}, _this3.state.config);
12566
+ var targeting = _this3.getTargeting(article);
12567
+ var rightItems = [];
12568
+
12569
+ if (_this3.checkSponseredArticle(article)) {
12570
+ rightItems = [];
12571
+ } else {
12572
+ rightItems = _this3.props.Ads.getRightItems(targeting);
12573
+ }
12574
+ var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12575
+ config.rightItems = rightItems;
12576
+ config.horizontalAD = horizontalAD;
12577
+ _this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
12578
+ index.lib_3.refresh();
12579
+ });
12580
+ };
12581
+
12582
+ this.changeUrl = function (path, visibility) {
12583
+ var isScrollDown = _this3.isScrollDown;
12584
+
12585
+ if (!isScrollDown) {
12586
+ if (visibility == 'top') {
12587
+ window.history.pushState({ page: path }, path, '/view/' + path);
12588
+ _this3.setState({ keywords: [1] });
12589
+ _this3.refreshAdd(path);
12590
+ // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12591
+ }
12592
+ } else {
12593
+ if (visibility == 'bottom') {
12594
+ window.history.pushState({ page: path }, path, '/view/' + path);
12595
+ _this3.setState({ keywords: [1] });
12596
+ _this3.refreshAdd(path);
12597
+ // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12598
+ }
12599
+ }
12600
+ };
12601
+ };
12602
+
12110
12603
  exports.DeckContent = DeckContent;
12111
12604
  exports.AD = GridContent.AD;
12112
12605
  exports.GridContent = GridContent.GridContent;
@@ -12145,6 +12638,7 @@ exports.AccordionPanel = AccordionPanel;
12145
12638
  exports.AdSlotsProvider = AdSlotsProvider;
12146
12639
  exports.AlphabeticList = AlphabeticList;
12147
12640
  exports.ArticleDetailDropdown = ArticleDetailDropdown;
12641
+ exports.ArticleQueue = ArticleQueue;
12148
12642
  exports.Breadcrumbs = Breadcrumbs$1;
12149
12643
  exports.ConferenceArticleCard = ConferenceArticleCard;
12150
12644
  exports.Feature = Feature;
package/dist/esm/index.js CHANGED
@@ -6,8 +6,8 @@ import 'react-bootstrap/Container';
6
6
  import 'react-bootstrap/Row';
7
7
  import 'react-bootstrap/Col';
8
8
  import 'react-bootstrap/Card';
9
- import { m as moment } from './visibility-sensor-675d3fa1.js';
10
- import 'next/link';
9
+ import { m as moment, I as InfiniteScroll } from './visibility-sensor-675d3fa1.js';
10
+ import Link from 'next/link';
11
11
  import Router, { useRouter } from 'next/router';
12
12
  import './debounce-dc0c02e5.js';
13
13
  import 'react-dom';
@@ -15,7 +15,7 @@ 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 } from './_babelHelpers-67c05996.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-67c05996.js';
19
19
  export { default as DeckContent } from './DeckContent.js';
20
20
  import './get-b074314b.js';
21
21
  import { A as AD } from './GridContent-214acb61.js';
@@ -39,7 +39,7 @@ export { default as PublicationDeck } from './PublicationDeck.js';
39
39
  export { default as IssueDeck } from './IssueDeck.js';
40
40
  import 'react-bootstrap/Badge';
41
41
  export { default as IssueContentDeck } from './IssueContentDeck.js';
42
- import { D as DFPAdSlot, M as MdPictureAsPdf } from './Normal-be430fa9.js';
42
+ import { D as DFPAdSlot, M as MdPictureAsPdf, T as TemplateNormal } from './Normal-be430fa9.js';
43
43
  export { A as AD728x90, D as AdSlot, 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-be430fa9.js';
44
44
  import 'react-bootstrap/ListGroup';
45
45
  import Head from 'next/head';
@@ -11616,7 +11616,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
11616
11616
  ),
11617
11617
  React__default.createElement(
11618
11618
  'p',
11619
- null,
11619
+ { className: 'top-article-summary' },
11620
11620
  clean_html_1(topArticle.summary)
11621
11621
  )
11622
11622
  )
@@ -11761,7 +11761,7 @@ var OncliveLargeHero = function OncliveLargeHero(props) {
11761
11761
  React__default.createElement(
11762
11762
  'style',
11763
11763
  { jsx: 'true' },
11764
- '\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
11764
+ '\n .article-hero-container {\n margin: 0 -0.8rem;\n }\n @media screen and (min-width: 1400px) {\n .article-hero-container {\n display: flex;\n flex-direction: row;\n }\n }\n .top-article {\n // width: 50%;\n margin: 0 1rem;\n height: 100%;\n display: block;\n }\n .top-article figure {\n width: 100%;\n height: 60%;\n }\n .top-article figure img {\n width: 100%;\n height: 100%;\n object-fit: cover;\n }\n .top-article--body h1 {\n font-size: 1.4rem;\n color: black !important;\n font-weight: bold;\n }\n // .sub-articles-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n .sub-article {\n margin: 0 1rem 1rem;\n display: flex;\n flex-direction: row;\n }\n .sub-article figure {\n width: 125px;\n }\n .sub-article figure img {\n width: 125px;\n height: auto;\n object-fit: cover;\n }\n .sub-article--body {\n padding-left: 1rem;\n font-size: 0.9rem;\n }\n .sub-article--body h2 {\n font-size: 1rem;\n font-weight: bold;\n }\n @media screen and (max-width: 1368px) {\n .article-hero-container {\n flex-direction: column;\n }\n .top-article {\n // width: unset;\n flex: 1 1 auto;\n }\n .sub-articles-container {\n width: 100%;\n margin-top: 1rem;\n min-width: 280px;\n }\n }\n @media screen and (max-width: 1399px) and (min-width: 992px) {\n .top-article {\n // width: 50%;\n flex: 1 1 auto;\n margin-bottom: 1rem;\n }\n .middle-group {\n display: none;\n }\n .middle-single {\n display: block !important;\n margin-top: 0 !important;\n }\n .top-article figure img {\n max-height: 180px !important;\n }\n .top-article-summary {\n display: none;\n }\n }\n // @media only screen and (min-width) {\n // .sub-outer-container {\n // width: 50%;\n // flex: 1 1 auto;\n // min-width: 350px;\n // }\n // }\n .middle-single {\n display: none;\n }\n .top-outer {\n display: flex;\n }\n '
11765
11765
  )
11766
11766
  );
11767
11767
  };
@@ -12105,4 +12105,497 @@ var ConferenceArticleCard = function ConferenceArticleCard(props) {
12105
12105
  );
12106
12106
  };
12107
12107
 
12108
- export { AD300x250, AD300x250x600, ADFooter, AccordionPanel, AdSlotsProvider, AlphabeticList, ArticleDetailDropdown, Breadcrumbs$1 as Breadcrumbs, ConferenceArticleCard, Feature, fbsHero as ForbesHero, Hero, HorizontalHero, OncliveHero, OncliveLargeHero, PdfDownload, RelatedContent, RelatedTopicsDropdown, SetCookie, SocialShare$1 as SocialShare, VerticalHero, YahooHero, getSerializers };
12108
+ var InscreenSensor = function (_React$Component) {
12109
+ inherits$2(InscreenSensor, _React$Component);
12110
+
12111
+ function InscreenSensor(props) {
12112
+ classCallCheck(this, InscreenSensor);
12113
+
12114
+ var _this = possibleConstructorReturn(this, (InscreenSensor.__proto__ || Object.getPrototypeOf(InscreenSensor)).call(this, props));
12115
+
12116
+ _this.scrollHandler = function () {
12117
+ // this.checkInside()
12118
+
12119
+ var visible = _this.checkInside();
12120
+ if (visible != _this.visible) {
12121
+ _this.visible = visible;
12122
+ _this.props.onChange(visible);
12123
+ }
12124
+ };
12125
+
12126
+ _this.checkInside = function () {
12127
+ var rect = _this.wraperRef.current.getBoundingClientRect();
12128
+ var _this$props$offSetTop = _this.props.offSetTop,
12129
+ offSetTop = _this$props$offSetTop === undefined ? 0 : _this$props$offSetTop;
12130
+ var top = rect.top,
12131
+ height = rect.height;
12132
+
12133
+ var bottom = top + height;
12134
+ var viewHeight = window.innerHeight;
12135
+ if (bottom < offSetTop) {
12136
+ return false;
12137
+ } else if (top > offSetTop && bottom <= viewHeight) {
12138
+ return true;
12139
+ } else if (top > offSetTop && top <= viewHeight && bottom > viewHeight) {
12140
+ return 'top';
12141
+ } else if (bottom <= viewHeight) {
12142
+ return 'bottom';
12143
+ } else {
12144
+ return false;
12145
+ }
12146
+ };
12147
+
12148
+ _this.wraperRef = React__default.createRef();
12149
+ _this.visible = false;
12150
+ return _this;
12151
+ }
12152
+
12153
+ createClass(InscreenSensor, [{
12154
+ key: 'componentDidMount',
12155
+ value: function componentDidMount() {
12156
+ this.visible = this.checkInside();
12157
+ this.props.onChange(this.visible);
12158
+ window.addEventListener('scroll', this.scrollHandler);
12159
+ }
12160
+ }, {
12161
+ key: 'componentWillUnmount',
12162
+ value: function componentWillUnmount() {
12163
+ window.removeEventListener('scroll', this.scrollHandler);
12164
+ }
12165
+ }, {
12166
+ key: 'render',
12167
+ value: function render() {
12168
+ var _props = this.props,
12169
+ _props$className = _props.className,
12170
+ className = _props$className === undefined ? '' : _props$className,
12171
+ _props$style = _props.style,
12172
+ style = _props$style === undefined ? {} : _props$style;
12173
+
12174
+ return React__default.createElement(
12175
+ 'div',
12176
+ { ref: this.wraperRef, className: className, style: style },
12177
+ this.props.children
12178
+ );
12179
+ }
12180
+ }]);
12181
+ return InscreenSensor;
12182
+ }(React__default.Component);
12183
+
12184
+ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
12185
+ if (authorName && authorURL) return React__default.createElement(
12186
+ Link,
12187
+ { href: '/authors/' + authorURL.current, key: index },
12188
+ React__default.createElement(
12189
+ 'a',
12190
+ null,
12191
+ authorName,
12192
+ length !== index + 1 && React__default.createElement('br', null)
12193
+ )
12194
+ );else if (authorName) {
12195
+ return React__default.createElement(
12196
+ 'span',
12197
+ { key: index },
12198
+ authorName,
12199
+ length !== index + 1 && React__default.createElement('br', null)
12200
+ );
12201
+ }
12202
+ };
12203
+
12204
+ var Article = function Article(props) {
12205
+ var client = props.client,
12206
+ pageview = props.pageview,
12207
+ videoAccountIDs = props.videoAccountIDs,
12208
+ _props$article = props.article,
12209
+ title = _props$article.title,
12210
+ passwordLock = _props$article.passwordLock,
12211
+ authorDetails = _props$article.authorDetails,
12212
+ published = _props$article.published,
12213
+ articleBody = _props$article.body,
12214
+ summary = _props$article.summary,
12215
+ thumbnail = _props$article.thumbnail,
12216
+ _props$article$url = _props$article.url;
12217
+ _props$article$url = _props$article$url === undefined ? {
12218
+ current: ''
12219
+ } : _props$article$url;
12220
+ var url = _props$article$url.current,
12221
+ changeUrl = props.changeUrl,
12222
+ isCutomPage = props.isCutomPage,
12223
+ shareOptions = props.shareOptions,
12224
+ renderIsiContent = props.renderIsiContent,
12225
+ urlFor = props.urlFor;
12226
+ var shareVia = shareOptions.shareVia,
12227
+ shareSubject = shareOptions.shareSubject,
12228
+ twitterSiteName = shareOptions.twitterSiteName,
12229
+ shareImageDefault = shareOptions.shareImageDefault;
12230
+
12231
+ var shareUrl = shareOptions.shareBaseUrl + props.url;
12232
+ var shareTitle = title;
12233
+ var shareSummary = summary;
12234
+ var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
12235
+
12236
+ var siteName = props.website.title;
12237
+ return React__default.createElement(
12238
+ InscreenSensor,
12239
+ {
12240
+ offSetTop: 45,
12241
+ onChange: function onChange(visible) {
12242
+ if (visible !== false) {
12243
+ changeUrl(url, visible);
12244
+ }
12245
+ } },
12246
+ React__default.createElement(
12247
+ 'div',
12248
+ null,
12249
+ React__default.createElement(
12250
+ Head,
12251
+ null,
12252
+ passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
12253
+ ),
12254
+ React__default.createElement(
12255
+ 'h1',
12256
+ { className: 'page-title' },
12257
+ title
12258
+ ),
12259
+ React__default.createElement(
12260
+ 'div',
12261
+ { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
12262
+ React__default.createElement(
12263
+ 'div',
12264
+ null,
12265
+ moment(published).format('LL')
12266
+ ),
12267
+ React__default.createElement(
12268
+ 'div',
12269
+ { className: 'mb-3' },
12270
+ authorDetails && authorDetails.map(function (authorDetail, index) {
12271
+ return React__default.createElement(
12272
+ 'div',
12273
+ { key: index },
12274
+ renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
12275
+ );
12276
+ })
12277
+ ),
12278
+ React__default.createElement(
12279
+ 'p',
12280
+ null,
12281
+ React__default.createElement(SocialShare$1, {
12282
+ shareUrl: shareUrl,
12283
+ shareTitle: shareTitle,
12284
+ shareVia: shareVia,
12285
+ shareSummary: shareSummary,
12286
+ shareSubject: shareSubject,
12287
+ shareImage: shareImage,
12288
+ size: 32,
12289
+ siteName: siteName,
12290
+ twitterSiteName: twitterSiteName
12291
+ })
12292
+ ),
12293
+ React__default.createElement(
12294
+ 'p',
12295
+ null,
12296
+ React__default.createElement(
12297
+ 'em',
12298
+ null,
12299
+ summary
12300
+ ),
12301
+ React__default.createElement('br', null),
12302
+ React__default.createElement('br', null)
12303
+ ),
12304
+ React__default.createElement(
12305
+ 'div',
12306
+ { className: 'block-content' },
12307
+ React__default.createElement(BlockContent, _extends$2({
12308
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
12309
+ blocks: articleBody,
12310
+ imageOptions: { w: 320, h: 240, fit: 'max' }
12311
+ }, client.config()))
12312
+ )
12313
+ ),
12314
+ renderIsiContent(props.article)
12315
+ )
12316
+ );
12317
+ };
12318
+
12319
+ var ArticleQueue = function (_React$Component) {
12320
+ inherits$2(ArticleQueue, _React$Component);
12321
+
12322
+ function ArticleQueue(props) {
12323
+ classCallCheck(this, ArticleQueue);
12324
+
12325
+ var _this = possibleConstructorReturn(this, (ArticleQueue.__proto__ || Object.getPrototypeOf(ArticleQueue)).call(this, props));
12326
+
12327
+ _initialiseProps.call(_this);
12328
+
12329
+ var _this$props$article$s = _this.props.article.seo;
12330
+ _this$props$article$s = _this$props$article$s === undefined ? {
12331
+ meta_description: null
12332
+ } : _this$props$article$s;
12333
+ var description = _this$props$article$s.meta_description;
12334
+
12335
+ var targeting = _this.getTargeting(_this.props.article);
12336
+ _this.state = {
12337
+ config: {
12338
+ navComponent: _this.props.website.navigation,
12339
+ navItems: _this.props.mainNavCache,
12340
+ columns: '3',
12341
+ leftItems: _this.props.subNavCache,
12342
+ rightItems: _this.props.Ads.getRightItems(targeting),
12343
+ horizontalAD: _this.props.Ads.getHorizontal(targeting),
12344
+ isLiveSite: _this.props.isLiveSite
12345
+ },
12346
+ title: _this.props.article.title,
12347
+ summary: description ? description : _this.props.article.summary,
12348
+ queueData: [_this.props.article],
12349
+ relatedArticles: [],
12350
+ keywords: []
12351
+ }, _this.preVscroll = 0;
12352
+ _this.isScrollDown = true;
12353
+
12354
+ return _this;
12355
+ }
12356
+
12357
+ createClass(ArticleQueue, [{
12358
+ key: 'componentDidMount',
12359
+ value: function componentDidMount() {
12360
+ window.addEventListener('scroll', this.scrollDirectionDetect);
12361
+ }
12362
+ }, {
12363
+ key: 'componentDidUpdate',
12364
+ value: function componentDidUpdate(prevProps) {
12365
+ if (prevProps.relatedArticles != this.props.relatedArticles) {
12366
+ var relatedArticles = this.props.relatedArticles;
12367
+
12368
+ var queueData = [].concat(toConsumableArray(this.state.queueData));
12369
+ if (prevProps.relatedArticles.length == 0) {
12370
+ queueData.push(relatedArticles.shift());
12371
+ this.setState({ queueData: queueData });
12372
+ }
12373
+ this.setState({ relatedArticles: relatedArticles });
12374
+ }
12375
+ }
12376
+ }, {
12377
+ key: 'componentWillUnmount',
12378
+ value: function componentWillUnmount() {
12379
+ window.removeEventListener('scroll', this.scrollDirectionDetect);
12380
+ }
12381
+ }, {
12382
+ key: 'render',
12383
+ value: function render() {
12384
+ var _this2 = this;
12385
+
12386
+ var _state = this.state,
12387
+ config = _state.config,
12388
+ _state$keywords = _state.keywords,
12389
+ keywords = _state$keywords === undefined ? [] : _state$keywords,
12390
+ queueData = _state.queueData,
12391
+ title = _state.title,
12392
+ summary = _state.summary;
12393
+ var _props = this.props,
12394
+ website = _props.website,
12395
+ shareOptions = _props.shareOptions;
12396
+
12397
+
12398
+ return React__default.createElement(
12399
+ TemplateNormal,
12400
+ { config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: true },
12401
+ React__default.createElement(
12402
+ InfiniteScroll,
12403
+ { dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
12404
+ queueData.map(function (article, index) {
12405
+ return React__default.createElement(Article, _extends$2({
12406
+ key: index,
12407
+ urlFor: _this2.urlFor,
12408
+ isCutomPage: _this2.isCutomPage,
12409
+ renderIsiContent: _this2.renderIsiContent
12410
+ }, _this2.props, {
12411
+ shareOptions: shareOptions,
12412
+ changeUrl: _this2.changeUrl,
12413
+ article: article
12414
+ }));
12415
+ })
12416
+ )
12417
+ );
12418
+ }
12419
+ }]);
12420
+ return ArticleQueue;
12421
+ }(React__default.Component);
12422
+
12423
+ var _initialiseProps = function _initialiseProps() {
12424
+ var _this3 = this;
12425
+
12426
+ this.scrollDirectionDetect = function (e) {
12427
+ var window = e.currentTarget;
12428
+ var isScrollDown = _this3.isScrollDown;
12429
+
12430
+
12431
+ if (_this3.preVscroll > window.scrollY) {
12432
+ if (!isScrollDown) {
12433
+ _this3.isScrollDown = true;
12434
+ }
12435
+ } else if (_this3.preVscroll < window.scrollY) {
12436
+ if (isScrollDown) {
12437
+ _this3.isScrollDown = false;
12438
+ }
12439
+ }
12440
+ _this3.preVscroll = window.scrollY;
12441
+ };
12442
+
12443
+ this.loadmore = function () {
12444
+ var queueData = [].concat(toConsumableArray(_this3.state.queueData));
12445
+ var relatedArticles = [].concat(toConsumableArray(_this3.state.relatedArticles));
12446
+ if (relatedArticles.length > 0) {
12447
+ queueData.push(relatedArticles.shift());
12448
+ _this3.setState({ queueData: queueData, relatedArticles: relatedArticles });
12449
+ }
12450
+ };
12451
+
12452
+ this.isCutomPage = function (article) {
12453
+ var url = article.url.current;
12454
+ var _props2 = _this3.props,
12455
+ regionalPages = _props2.regionalPages,
12456
+ nationalPage = _props2.nationalPage;
12457
+
12458
+ return regionalPages.includes(url) || nationalPage === url;
12459
+ };
12460
+
12461
+ this.urlFor = function (source) {
12462
+ return imageUrlBuilder(_this3.props.client).image(source);
12463
+ };
12464
+
12465
+ this.getTargeting = function (article) {
12466
+ var _article$internalTag = article.internalTag,
12467
+ internalTag = _article$internalTag === undefined ? [] : _article$internalTag,
12468
+ _article$userDefinedT = article.userDefinedTag,
12469
+ userDefinedTag = _article$userDefinedT === undefined ? [] : _article$userDefinedT,
12470
+ _article$SponsorshipT = article.SponsorshipTag,
12471
+ SponsorshipTag = _article$SponsorshipT === undefined ? [] : _article$SponsorshipT,
12472
+ _article$seoTag = article.seoTag,
12473
+ seoTag = _article$seoTag === undefined ? [] : _article$seoTag,
12474
+ _article$url = article.url;
12475
+ _article$url = _article$url === undefined ? {
12476
+ current: ''
12477
+ } : _article$url;
12478
+ var url = _article$url.current,
12479
+ _article$documentGrou = article.documentGroup;
12480
+ _article$documentGrou = _article$documentGrou === undefined ? {
12481
+ path: ''
12482
+ } : _article$documentGrou;
12483
+ var document_group = _article$documentGrou.path,
12484
+ content_placement = article.content_placement;
12485
+
12486
+ var context = url;
12487
+ var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
12488
+ if (!context && localHistory) {
12489
+ context = localHistory[localHistory.length - 1];
12490
+ }
12491
+ context = context && context.split('?')[0];
12492
+ context = context && context.split('&')[0];
12493
+ var content_placement_urls = [];
12494
+ if (content_placement) {
12495
+ if (content_placement.some(function (item) {
12496
+ return context === item.path;
12497
+ })) {
12498
+ content_placement_urls = [context];
12499
+ } else if (content_placement.some(function (item) {
12500
+ return context === '/' + item.path;
12501
+ })) {
12502
+ content_placement_urls = [context.slice(1)];
12503
+ } else {
12504
+ content_placement_urls = content_placement.map(function (item) {
12505
+ return item.path;
12506
+ });
12507
+ }
12508
+ }
12509
+ if (document_group.length > 0) {
12510
+ content_placement_urls = [];
12511
+ }
12512
+ var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
12513
+ var targeting = {
12514
+ tags: keywords,
12515
+ document_group: [document_group],
12516
+ document_url: [url],
12517
+ content_placement: content_placement_urls
12518
+ };
12519
+ return targeting;
12520
+ };
12521
+
12522
+ this.checkSponseredArticle = function (article) {
12523
+ var _article$taxonomyMapp = article.taxonomyMapping,
12524
+ taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
12525
+
12526
+ if (_this3.props.checkSponsered) {
12527
+
12528
+ return taxonomyMapping.some(function (item) {
12529
+ return item._ref === 'ict_taxonomy_735_sponsoredresources';
12530
+ });
12531
+ } else {
12532
+ return false;
12533
+ }
12534
+ };
12535
+
12536
+ this.renderIsiContent = function (article) {
12537
+ var url = article.url.current;
12538
+ var _props3 = _this3.props,
12539
+ ISIContent = _props3.iSIContent,
12540
+ regionalPages = _props3.regionalPages,
12541
+ nationalPage = _props3.nationalPage;
12542
+
12543
+ if (regionalPages.includes(url)) {
12544
+ return React__default.createElement(ISIContent, null);
12545
+ } else if (nationalPage === url) {
12546
+ return React__default.createElement(ISIContent, { national: true });
12547
+ }
12548
+ return null;
12549
+ };
12550
+
12551
+ this.refreshAdd = function (path) {
12552
+ var article = _this3.state.queueData.find(function (item) {
12553
+ return item.url.current == path;
12554
+ });
12555
+ var title = article.title,
12556
+ summary = article.summary,
12557
+ _article$seo = article.seo;
12558
+ _article$seo = _article$seo === undefined ? {
12559
+ meta_description: null
12560
+ } : _article$seo;
12561
+ var description = _article$seo.meta_description;
12562
+
12563
+ var config = _extends$2({}, _this3.state.config);
12564
+ var targeting = _this3.getTargeting(article);
12565
+ var rightItems = [];
12566
+
12567
+ if (_this3.checkSponseredArticle(article)) {
12568
+ rightItems = [];
12569
+ } else {
12570
+ rightItems = _this3.props.Ads.getRightItems(targeting);
12571
+ }
12572
+ var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12573
+ config.rightItems = rightItems;
12574
+ config.horizontalAD = horizontalAD;
12575
+ _this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
12576
+ lib_3.refresh();
12577
+ });
12578
+ };
12579
+
12580
+ this.changeUrl = function (path, visibility) {
12581
+ var isScrollDown = _this3.isScrollDown;
12582
+
12583
+ if (!isScrollDown) {
12584
+ if (visibility == 'top') {
12585
+ window.history.pushState({ page: path }, path, '/view/' + path);
12586
+ _this3.setState({ keywords: [1] });
12587
+ _this3.refreshAdd(path);
12588
+ // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12589
+ }
12590
+ } else {
12591
+ if (visibility == 'bottom') {
12592
+ window.history.pushState({ page: path }, path, '/view/' + path);
12593
+ _this3.setState({ keywords: [1] });
12594
+ _this3.refreshAdd(path);
12595
+ // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12596
+ }
12597
+ }
12598
+ };
12599
+ };
12600
+
12601
+ export { AD300x250, AD300x250x600, ADFooter, AccordionPanel, AdSlotsProvider, AlphabeticList, ArticleDetailDropdown, ArticleQueue, Breadcrumbs$1 as Breadcrumbs, ConferenceArticleCard, Feature, fbsHero as ForbesHero, Hero, HorizontalHero, OncliveHero, OncliveLargeHero, PdfDownload, RelatedContent, RelatedTopicsDropdown, SetCookie, SocialShare$1 as SocialShare, VerticalHero, YahooHero, getSerializers };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.214",
3
+ "version": "1.0.215",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",