@mjhls/mjh-framework 1.0.220 → 1.0.222

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/index.js CHANGED
@@ -16,10 +16,11 @@ 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
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
+ import { D as DFPAdSlot } from './AdSlot-b67f8534.js';
20
+ export { D as AdSlot } from './AdSlot-b67f8534.js';
19
21
  export { default as DeckContent } from './DeckContent.js';
20
22
  import './get-b074314b.js';
21
- import { A as AD } from './GridContent-214acb61.js';
22
- export { A as AD, G as GridContent } from './GridContent-214acb61.js';
23
+ export { A as AD, G as GridContent } from './GridContent-e5cdc9da.js';
23
24
  export { default as DeckQueue } from './DeckQueue.js';
24
25
  import 'react-bootstrap/Media';
25
26
  export { default as ThumbnailCard } from './ThumbnailCard.js';
@@ -39,8 +40,8 @@ export { default as PublicationDeck } from './PublicationDeck.js';
39
40
  export { default as IssueDeck } from './IssueDeck.js';
40
41
  import 'react-bootstrap/Badge';
41
42
  export { default as IssueContentDeck } from './IssueContentDeck.js';
42
- import { D as DFPAdSlot, M as MdPictureAsPdf, T as TemplateNormal } from './Normal-be430fa9.js';
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';
43
+ import { M as MdPictureAsPdf, T as TemplateNormal } from './Normal-4f059950.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-4f059950.js';
44
45
  import 'react-bootstrap/ListGroup';
45
46
  import Head from 'next/head';
46
47
  import Accordion from 'react-bootstrap/Accordion';
@@ -10184,13 +10185,13 @@ var Poll = function Poll(_ref) {
10184
10185
  return React__default.createElement(
10185
10186
  'div',
10186
10187
  { key: choice._key },
10187
- React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
10188
- return setSelectedChoice(e.target.value);
10189
- } }),
10190
10188
  React__default.createElement(
10191
10189
  'label',
10192
10190
  { className: 'pl-2' },
10193
- choice.choiceText
10191
+ React__default.createElement('input', { type: 'radio', id: 'male', name: choice._type, value: choice._key, onChange: function onChange(e) {
10192
+ return setSelectedChoice(e.target.value);
10193
+ } }),
10194
+ ' ' + choice.choiceText
10194
10195
  )
10195
10196
  );
10196
10197
  }),
@@ -10489,7 +10490,7 @@ var NativeAd = function NativeAd(props) {
10489
10490
  return React__default.createElement(
10490
10491
  'div',
10491
10492
  { className: 'native-ad-wrapper', style: { textAlign: 'center' } },
10492
- React__default.createElement(AD, { networkID: networkID, adUnit: adUnit, slotId: slotId, targeting: targeting, className: className, sizes: sizes, sizeMapping: sizeMapping })
10493
+ React__default.createElement(DFPAdSlot, { networkID: networkID, adUnit: adUnit, slotId: slotId, targeting: targeting, className: className, sizes: sizes, sizeMapping: sizeMapping })
10493
10494
  );
10494
10495
  };
10495
10496
 
@@ -12233,84 +12234,97 @@ var Article = function Article(props) {
12233
12234
 
12234
12235
  var siteName = props.website.title;
12235
12236
  return React__default.createElement(
12236
- InscreenSensor,
12237
- {
12238
- offSetTop: 45,
12239
- onChange: function onChange(visible) {
12240
- if (visible !== false) {
12241
- changeUrl(url, visible);
12242
- }
12243
- } },
12237
+ React__default.Fragment,
12238
+ null,
12244
12239
  React__default.createElement(
12245
- 'div',
12246
- null,
12247
- React__default.createElement(
12248
- Head,
12249
- null,
12250
- passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
12251
- ),
12252
- React__default.createElement(
12253
- 'h1',
12254
- { className: 'page-title' },
12255
- title
12256
- ),
12240
+ InscreenSensor,
12241
+ {
12242
+ offSetTop: 45,
12243
+ onChange: function onChange(visible) {
12244
+ if (visible !== false) {
12245
+ changeUrl(url, visible);
12246
+ }
12247
+ } },
12257
12248
  React__default.createElement(
12258
12249
  'div',
12259
- { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
12250
+ null,
12260
12251
  React__default.createElement(
12261
- 'div',
12252
+ Head,
12262
12253
  null,
12263
- moment(published).format('LL')
12254
+ passwordLock && React__default.createElement('meta', { name: 'robots', content: 'noindex, nofollow' })
12264
12255
  ),
12265
12256
  React__default.createElement(
12266
- 'div',
12267
- { className: 'mb-3' },
12268
- authorDetails && authorDetails.map(function (authorDetail, index) {
12269
- return React__default.createElement(
12270
- 'div',
12271
- { key: index },
12272
- renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
12273
- );
12274
- })
12257
+ 'h1',
12258
+ { className: 'page-title' },
12259
+ title
12275
12260
  ),
12276
12261
  React__default.createElement(
12277
- 'p',
12278
- null,
12279
- React__default.createElement(SocialShare$1, {
12280
- shareUrl: shareUrl,
12281
- shareTitle: shareTitle,
12282
- shareVia: shareVia,
12283
- shareSummary: shareSummary,
12284
- shareSubject: shareSubject,
12285
- shareImage: shareImage,
12286
- size: 32,
12287
- siteName: siteName,
12288
- twitterSiteName: twitterSiteName
12289
- })
12290
- ),
12291
- React__default.createElement(
12292
- 'p',
12293
- null,
12262
+ 'div',
12263
+ { className: 'video-detail', style: { marginBottom: isCutomPage(props.article) ? '150px' : 0 } },
12294
12264
  React__default.createElement(
12295
- 'em',
12265
+ 'div',
12296
12266
  null,
12297
- summary
12267
+ moment(published).format('LL')
12298
12268
  ),
12299
- React__default.createElement('br', null),
12300
- React__default.createElement('br', null)
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(BlockContent, _extends$2({
12310
+ serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
12311
+ blocks: articleBody,
12312
+ imageOptions: { w: 320, h: 240, fit: 'max' }
12313
+ }, client.config()))
12314
+ )
12301
12315
  ),
12302
- React__default.createElement(
12303
- 'div',
12304
- { className: 'block-content' },
12305
- React__default.createElement(BlockContent, _extends$2({
12306
- serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
12307
- blocks: articleBody,
12308
- imageOptions: { w: 320, h: 240, fit: 'max' }
12309
- }, client.config()))
12310
- )
12311
- ),
12312
- renderIsiContent(props.article)
12313
- )
12316
+ renderIsiContent(props.article)
12317
+ )
12318
+ ),
12319
+ sMobileOnly && React__default.createElement('hr', { className: 'add-seperater' }),
12320
+ main_36 && props.article.Ads.map(function (ad, index) {
12321
+ return React__default.createElement(
12322
+ 'div',
12323
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
12324
+ ad.component
12325
+ );
12326
+ }),
12327
+ React__default.createElement('hr', { className: 'article-seperater' })
12314
12328
  );
12315
12329
  };
12316
12330
 
@@ -12334,6 +12348,8 @@ var ArticleQueue = function (_React$Component) {
12334
12348
 
12335
12349
  var targeting = _this.getTargeting(_this.props.article);
12336
12350
  var metaDescription = description ? description : summary ? summary : _this.getFirstLine(_this.props.article);
12351
+ var article = _this.props.article;
12352
+ article.Ads = _this.props.Ads.getRightItems(targeting);
12337
12353
 
12338
12354
  _this.state = {
12339
12355
  config: {
@@ -12347,7 +12363,7 @@ var ArticleQueue = function (_React$Component) {
12347
12363
  },
12348
12364
  title: _this.props.article.title,
12349
12365
  summary: metaDescription,
12350
- queueData: [_this.props.article],
12366
+ queueData: [article],
12351
12367
  relatedArticles: [],
12352
12368
  keywords: []
12353
12369
  }, _this.preVscroll = 0;
@@ -12364,9 +12380,14 @@ var ArticleQueue = function (_React$Component) {
12364
12380
  }, {
12365
12381
  key: 'componentDidUpdate',
12366
12382
  value: function componentDidUpdate(prevProps) {
12367
- if (prevProps.relatedArticles != this.props.relatedArticles) {
12368
- var relatedArticles = this.props.relatedArticles;
12383
+ var _this2 = this;
12369
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
+ });
12370
12391
  var queueData = [].concat(toConsumableArray(this.state.queueData));
12371
12392
  if (prevProps.relatedArticles.length == 0) {
12372
12393
  queueData.push(relatedArticles.shift());
@@ -12385,7 +12406,7 @@ var ArticleQueue = function (_React$Component) {
12385
12406
  }, {
12386
12407
  key: 'render',
12387
12408
  value: function render() {
12388
- var _this2 = this;
12409
+ var _this3 = this;
12389
12410
 
12390
12411
  var _state = this.state,
12391
12412
  config = _state.config,
@@ -12401,19 +12422,19 @@ var ArticleQueue = function (_React$Component) {
12401
12422
 
12402
12423
  return React__default.createElement(
12403
12424
  TemplateNormal,
12404
- { config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: true },
12425
+ { config: config, website: website, keywords: keywords, description: summary, title: title, showRightAd: !main_36 },
12405
12426
  React__default.createElement(
12406
12427
  InfiniteScroll,
12407
12428
  { dataLength: queueData.length, next: this.loadmore, scrollThreshold: '200px', hasMore: true },
12408
12429
  queueData.map(function (article, index) {
12409
12430
  return React__default.createElement(Article, _extends$2({
12410
12431
  key: index,
12411
- urlFor: _this2.urlFor,
12412
- isCutomPage: _this2.isCutomPage,
12413
- renderIsiContent: _this2.renderIsiContent
12414
- }, _this2.props, {
12432
+ urlFor: _this3.urlFor,
12433
+ isCutomPage: _this3.isCutomPage,
12434
+ renderIsiContent: _this3.renderIsiContent
12435
+ }, _this3.props, {
12415
12436
  shareOptions: shareOptions,
12416
- changeUrl: _this2.changeUrl,
12437
+ changeUrl: _this3.changeUrl,
12417
12438
  article: article
12418
12439
  }));
12419
12440
  })
@@ -12425,37 +12446,37 @@ var ArticleQueue = function (_React$Component) {
12425
12446
  }(React__default.Component);
12426
12447
 
12427
12448
  var _initialiseProps = function _initialiseProps() {
12428
- var _this3 = this;
12449
+ var _this4 = this;
12429
12450
 
12430
12451
  this.scrollDirectionDetect = function (e) {
12431
12452
  var window = e.currentTarget;
12432
- var isScrollDown = _this3.isScrollDown;
12453
+ var isScrollDown = _this4.isScrollDown;
12433
12454
 
12434
12455
 
12435
- if (_this3.preVscroll > window.scrollY) {
12456
+ if (_this4.preVscroll > window.scrollY) {
12436
12457
  if (!isScrollDown) {
12437
- _this3.isScrollDown = true;
12458
+ _this4.isScrollDown = true;
12438
12459
  }
12439
- } else if (_this3.preVscroll < window.scrollY) {
12460
+ } else if (_this4.preVscroll < window.scrollY) {
12440
12461
  if (isScrollDown) {
12441
- _this3.isScrollDown = false;
12462
+ _this4.isScrollDown = false;
12442
12463
  }
12443
12464
  }
12444
- _this3.preVscroll = window.scrollY;
12465
+ _this4.preVscroll = window.scrollY;
12445
12466
  };
12446
12467
 
12447
12468
  this.loadmore = function () {
12448
- var queueData = [].concat(toConsumableArray(_this3.state.queueData));
12449
- var relatedArticles = [].concat(toConsumableArray(_this3.state.relatedArticles));
12469
+ var queueData = [].concat(toConsumableArray(_this4.state.queueData));
12470
+ var relatedArticles = [].concat(toConsumableArray(_this4.state.relatedArticles));
12450
12471
  if (relatedArticles.length > 0) {
12451
12472
  queueData.push(relatedArticles.shift());
12452
- _this3.setState({ queueData: queueData, relatedArticles: relatedArticles });
12473
+ _this4.setState({ queueData: queueData, relatedArticles: relatedArticles });
12453
12474
  }
12454
12475
  };
12455
12476
 
12456
12477
  this.isCutomPage = function (article) {
12457
12478
  var url = article.url.current;
12458
- var _props2 = _this3.props,
12479
+ var _props2 = _this4.props,
12459
12480
  regionalPages = _props2.regionalPages,
12460
12481
  nationalPage = _props2.nationalPage;
12461
12482
 
@@ -12463,7 +12484,7 @@ var _initialiseProps = function _initialiseProps() {
12463
12484
  };
12464
12485
 
12465
12486
  this.urlFor = function (source) {
12466
- return imageUrlBuilder(_this3.props.client).image(source);
12487
+ return imageUrlBuilder(_this4.props.client).image(source);
12467
12488
  };
12468
12489
 
12469
12490
  this.getTargeting = function (article) {
@@ -12488,7 +12509,7 @@ var _initialiseProps = function _initialiseProps() {
12488
12509
  content_placement = article.content_placement;
12489
12510
 
12490
12511
  var context = url;
12491
- var localHistory = _this3.props.historyCookie ? JSON.parse(_this3.props.historyCookie) : [];
12512
+ var localHistory = _this4.props.historyCookie ? JSON.parse(_this4.props.historyCookie) : [];
12492
12513
  if (!context && localHistory) {
12493
12514
  context = localHistory[localHistory.length - 1];
12494
12515
  }
@@ -12527,7 +12548,7 @@ var _initialiseProps = function _initialiseProps() {
12527
12548
  var _article$taxonomyMapp = article.taxonomyMapping,
12528
12549
  taxonomyMapping = _article$taxonomyMapp === undefined ? [] : _article$taxonomyMapp;
12529
12550
 
12530
- if (_this3.props.checkSponsered) {
12551
+ if (_this4.props.checkSponsered) {
12531
12552
 
12532
12553
  return taxonomyMapping.some(function (item) {
12533
12554
  return item._ref === 'ict_taxonomy_735_sponsoredresources';
@@ -12539,7 +12560,7 @@ var _initialiseProps = function _initialiseProps() {
12539
12560
 
12540
12561
  this.renderIsiContent = function (article) {
12541
12562
  var url = article.url.current;
12542
- var _props3 = _this3.props,
12563
+ var _props3 = _this4.props,
12543
12564
  ISIContent = _props3.iSIContent,
12544
12565
  regionalPages = _props3.regionalPages,
12545
12566
  nationalPage = _props3.nationalPage;
@@ -12573,7 +12594,7 @@ var _initialiseProps = function _initialiseProps() {
12573
12594
  };
12574
12595
 
12575
12596
  this.refreshAdd = function (path) {
12576
- var article = _this3.state.queueData.find(function (item) {
12597
+ var article = _this4.state.queueData.find(function (item) {
12577
12598
  return item.url.current == path;
12578
12599
  });
12579
12600
  var title = article.title,
@@ -12593,47 +12614,47 @@ var _initialiseProps = function _initialiseProps() {
12593
12614
  var description = _article$seo.meta_description;
12594
12615
 
12595
12616
  var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
12596
- var config = _extends$2({}, _this3.state.config);
12597
- var targeting = _this3.getTargeting(article);
12617
+ var config = _extends$2({}, _this4.state.config);
12618
+ var targeting = _this4.getTargeting(article);
12598
12619
  var rightItems = [];
12599
12620
 
12600
- if (_this3.checkSponseredArticle(article)) {
12621
+ if (_this4.checkSponseredArticle(article)) {
12601
12622
  rightItems = [];
12602
12623
  } else {
12603
- rightItems = _this3.props.Ads.getRightItems(targeting);
12624
+ rightItems = _this4.props.Ads.getRightItems(targeting);
12604
12625
  }
12605
- var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12626
+ var horizontalAD = _this4.props.Ads.getHorizontal(targeting);
12606
12627
  config.rightItems = rightItems;
12607
12628
  config.horizontalAD = horizontalAD;
12608
- var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
12609
- _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
12629
+ var metaDescription = description ? description : summary ? summary : _this4.getFirstLine(article);
12630
+ _this4.setState({ config: config, title: title, summary: metaDescription }, function () {
12610
12631
  lib_3.refresh();
12611
12632
  });
12612
12633
  };
12613
12634
 
12614
12635
  this.changeUrl = function (path, visibility) {
12615
- var isScrollDown = _this3.isScrollDown;
12636
+ var isScrollDown = _this4.isScrollDown;
12616
12637
 
12617
12638
  var newPath = '/view/' + path;
12618
12639
  if (!isScrollDown) {
12619
12640
  if (visibility == 'top') {
12620
12641
  // Router.push('/view/[url]', newPath, {shallow:true})
12621
12642
  window.history.pushState({ page: path }, path, newPath);
12622
- if (_this3.props.pageview) {
12623
- _this3.props.pageview(newPath);
12643
+ if (_this4.props.pageview) {
12644
+ _this4.props.pageview(newPath);
12624
12645
  }
12625
12646
 
12626
- _this3.refreshAdd(path);
12647
+ _this4.refreshAdd(path);
12627
12648
  }
12628
12649
  } else {
12629
12650
  if (visibility == 'bottom') {
12630
12651
  // Router.push('/view/[url]', newPath, {shallow:true})
12631
12652
  window.history.pushState({ page: path }, path, newPath);
12632
- if (_this3.props.pageview) {
12633
- _this3.props.pageview(newPath);
12653
+ if (_this4.props.pageview) {
12654
+ _this4.props.pageview(newPath);
12634
12655
  }
12635
12656
 
12636
- _this3.refreshAdd(path);
12657
+ _this4.refreshAdd(path);
12637
12658
  }
12638
12659
  }
12639
12660
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.220",
3
+ "version": "1.0.222",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",
@@ -57,7 +57,7 @@
57
57
  "gh-pages": "^1.2.0",
58
58
  "lodash": "^4.17.15",
59
59
  "moment": "^2.24.0",
60
- "next": "^9.1.5",
60
+ "next": "^9.2.0",
61
61
  "react": "^16.12.0",
62
62
  "react-bootstrap": "^1.0.0-beta.16",
63
63
  "react-device-detect": "^1.11.14",