@mjhls/mjh-framework 1.0.217 → 1.0.219

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.217
2
+ # mjh-framework v. 1.0.219
3
3
 
4
4
 
5
5
 
@@ -201,7 +201,7 @@ var MasterDeck = function (_React$Component) {
201
201
  onChange: function onChange(isVisible) {
202
202
  isVisible && _this.changePageNumber(pageNumber);
203
203
  } },
204
- React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: defaultImage })
204
+ React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage })
205
205
  ),
206
206
  main.main_36 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
207
207
  'div',
package/dist/cjs/index.js CHANGED
@@ -11404,7 +11404,7 @@ var fbsHero = function fbsHero(props) {
11404
11404
  React__default.createElement(
11405
11405
  'style',
11406
11406
  { jsx: 'true' },
11407
- '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n height: auto;\n max-height: 375px;\n object-fit: cover;\n }\n \n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525 !important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: contain;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n '
11407
+ '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n\n max-height: 300px;\n min-height: 275px;\n object-fit: cover;\n height: 112.5px;\n }\n\n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525 !important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: contain;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n '
11408
11408
  )
11409
11409
  );
11410
11410
  };
@@ -12326,13 +12326,17 @@ var ArticleQueue = function (_React$Component) {
12326
12326
 
12327
12327
  _initialiseProps.call(_this);
12328
12328
 
12329
- var _this$props$article$s = _this.props.article.seo;
12329
+ var _this$props$article = _this.props.article,
12330
+ summary = _this$props$article.summary,
12331
+ _this$props$article$s = _this$props$article.seo;
12330
12332
  _this$props$article$s = _this$props$article$s === undefined ? {
12331
12333
  meta_description: null
12332
12334
  } : _this$props$article$s;
12333
12335
  var description = _this$props$article$s.meta_description;
12334
12336
 
12335
12337
  var targeting = _this.getTargeting(_this.props.article);
12338
+ var metaDescription = description ? description : summary ? summary : _this.getFirstLine(_this.props.article);
12339
+
12336
12340
  _this.state = {
12337
12341
  config: {
12338
12342
  navComponent: _this.props.website.navigation,
@@ -12344,7 +12348,7 @@ var ArticleQueue = function (_React$Component) {
12344
12348
  isLiveSite: _this.props.isLiveSite
12345
12349
  },
12346
12350
  title: _this.props.article.title,
12347
- summary: description ? description : _this.props.article.summary,
12351
+ summary: metaDescription,
12348
12352
  queueData: [_this.props.article],
12349
12353
  relatedArticles: [],
12350
12354
  keywords: []
@@ -12378,6 +12382,8 @@ var ArticleQueue = function (_React$Component) {
12378
12382
  value: function componentWillUnmount() {
12379
12383
  window.removeEventListener('scroll', this.scrollDirectionDetect);
12380
12384
  }
12385
+ // To return the 1st Line of text in the article body
12386
+
12381
12387
  }, {
12382
12388
  key: 'render',
12383
12389
  value: function render() {
@@ -12385,11 +12391,11 @@ var ArticleQueue = function (_React$Component) {
12385
12391
 
12386
12392
  var _state = this.state,
12387
12393
  config = _state.config,
12388
- _state$keywords = _state.keywords,
12389
- keywords = _state$keywords === undefined ? [] : _state$keywords,
12390
12394
  queueData = _state.queueData,
12391
12395
  title = _state.title,
12392
- summary = _state.summary;
12396
+ summary = _state.summary,
12397
+ _state$keywords = _state.keywords,
12398
+ keywords = _state$keywords === undefined ? [] : _state$keywords;
12393
12399
  var _props = this.props,
12394
12400
  website = _props.website,
12395
12401
  shareOptions = _props.shareOptions;
@@ -12548,18 +12554,47 @@ var _initialiseProps = function _initialiseProps() {
12548
12554
  return null;
12549
12555
  };
12550
12556
 
12557
+ this.getFirstLine = function (article) {
12558
+ var _article$body = article.body,
12559
+ body = _article$body === undefined ? [] : _article$body;
12560
+
12561
+ var desc = '';
12562
+ body.some(function (children) {
12563
+ children.children && children.children.some(function (item) {
12564
+ if (item.text && String(item.text).trim().length > 0 && desc == '') {
12565
+ console.log(String(item.text));
12566
+ desc = String(item.text);
12567
+ return true;
12568
+ }
12569
+ });
12570
+ if (desc !== '') {
12571
+ return true;
12572
+ }
12573
+ });
12574
+ return desc;
12575
+ };
12576
+
12551
12577
  this.refreshAdd = function (path) {
12552
12578
  var article = _this3.state.queueData.find(function (item) {
12553
12579
  return item.url.current == path;
12554
12580
  });
12555
12581
  var title = article.title,
12556
12582
  summary = article.summary,
12583
+ _article$internalTag2 = article.internalTag,
12584
+ internalTag = _article$internalTag2 === undefined ? [] : _article$internalTag2,
12585
+ _article$userDefinedT2 = article.userDefinedTag,
12586
+ userDefinedTag = _article$userDefinedT2 === undefined ? [] : _article$userDefinedT2,
12587
+ _article$SponsorshipT2 = article.SponsorshipTag,
12588
+ SponsorshipTag = _article$SponsorshipT2 === undefined ? [] : _article$SponsorshipT2,
12589
+ _article$seoTag2 = article.seoTag,
12590
+ seoTag = _article$seoTag2 === undefined ? [] : _article$seoTag2,
12557
12591
  _article$seo = article.seo;
12558
12592
  _article$seo = _article$seo === undefined ? {
12559
12593
  meta_description: null
12560
12594
  } : _article$seo;
12561
12595
  var description = _article$seo.meta_description;
12562
12596
 
12597
+ var keywords = [].concat(_babelHelpers.toConsumableArray(internalTag), _babelHelpers.toConsumableArray(userDefinedTag), _babelHelpers.toConsumableArray(SponsorshipTag), _babelHelpers.toConsumableArray(seoTag));
12563
12598
  var config = _babelHelpers._extends({}, _this3.state.config);
12564
12599
  var targeting = _this3.getTargeting(article);
12565
12600
  var rightItems = [];
@@ -12572,7 +12607,8 @@ var _initialiseProps = function _initialiseProps() {
12572
12607
  var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12573
12608
  config.rightItems = rightItems;
12574
12609
  config.horizontalAD = horizontalAD;
12575
- _this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
12610
+ var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
12611
+ _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
12576
12612
  index.lib_3.refresh();
12577
12613
  });
12578
12614
  };
@@ -12580,19 +12616,26 @@ var _initialiseProps = function _initialiseProps() {
12580
12616
  this.changeUrl = function (path, visibility) {
12581
12617
  var isScrollDown = _this3.isScrollDown;
12582
12618
 
12619
+ var newPath = '/view/' + path;
12583
12620
  if (!isScrollDown) {
12584
12621
  if (visibility == 'top') {
12585
- window.history.pushState({ page: path }, path, '/view/' + path);
12586
- _this3.setState({ keywords: [1] });
12622
+ // Router.push('/view/[url]', newPath, {shallow:true})
12623
+ window.history.pushState({ page: path }, path, newPath);
12624
+ if (_this3.props.pageview) {
12625
+ _this3.props.pageview(newPath);
12626
+ }
12627
+
12587
12628
  _this3.refreshAdd(path);
12588
- // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12589
12629
  }
12590
12630
  } else {
12591
12631
  if (visibility == 'bottom') {
12592
- window.history.pushState({ page: path }, path, '/view/' + path);
12593
- _this3.setState({ keywords: [1] });
12632
+ // Router.push('/view/[url]', newPath, {shallow:true})
12633
+ window.history.pushState({ page: path }, path, newPath);
12634
+ if (_this3.props.pageview) {
12635
+ _this3.props.pageview(newPath);
12636
+ }
12637
+
12594
12638
  _this3.refreshAdd(path);
12595
- // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12596
12639
  }
12597
12640
  }
12598
12641
  };
@@ -195,7 +195,7 @@ var MasterDeck = function (_React$Component) {
195
195
  onChange: function onChange(isVisible) {
196
196
  isVisible && _this.changePageNumber(pageNumber);
197
197
  } },
198
- React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: defaultImage })
198
+ React__default.createElement(_this2.Deck, { data: row, variant: variant, index: index, client: _this.props.client, defaultImage: _this.defaultImage })
199
199
  ),
200
200
  main_36 && _this.rightItems && (index + 1) % numberOfItemsBeforeAd === 0 && React__default.createElement(
201
201
  'div',
package/dist/esm/index.js CHANGED
@@ -11402,7 +11402,7 @@ var fbsHero = function fbsHero(props) {
11402
11402
  React__default.createElement(
11403
11403
  'style',
11404
11404
  { jsx: 'true' },
11405
- '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n height: auto;\n max-height: 375px;\n object-fit: cover;\n }\n \n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525 !important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: contain;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n '
11405
+ '\n .article-hero {\n margin-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n padding-bottom: 0.5rem;\n }\n .fbs-top-article {\n width: 100%;\n margin-bottom: 1rem;\n padding-bottom: 1rem;\n border-bottom: 1px solid #ddd;\n }\n .fbs-top-article img {\n width: 100%;\n\n max-height: 300px;\n min-height: 275px;\n object-fit: cover;\n height: 112.5px;\n }\n\n .fbs-top-article--body {\n }\n .fbs-top-article--body h1 {\n color: #252525 !important;\n font-size: 1.6rem;\n font-weight: bold;\n text-align: center;\n margin-top: 1rem;\n }\n .fbs-top-article--body p {\n text-align: center;\n margin-bottom: 0;\n color: #252525;\n }\n .fbs-top-article--body p:first-of-type {\n font-size: 0.9rem;\n }\n .fbs-sub-article-container {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n padding-top: 1.75rem;\n margin-left: -1rem;\n margin-rigth: -1rem;\n }\n .fbs-sub-article {\n width: calc(50% - 2rem);\n min-width: 350px;\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n margin: 0 1rem 1.75rem;\n }\n .fbs-sub-article img {\n margin-right: 1rem;\n width: 100px;\n max-height: 100px;\n object-fit: contain;\n }\n .fbs-sub-article p {\n margin-bottom: 0;\n font-size: 0.8rem;\n color: #252525;\n }\n .fbs-sub-article .fbs-sub-article--title {\n font-weight: bold;\n font-size: 1rem;\n color: #252525;\n }\n '
11406
11406
  )
11407
11407
  );
11408
11408
  };
@@ -12324,13 +12324,17 @@ var ArticleQueue = function (_React$Component) {
12324
12324
 
12325
12325
  _initialiseProps.call(_this);
12326
12326
 
12327
- var _this$props$article$s = _this.props.article.seo;
12327
+ var _this$props$article = _this.props.article,
12328
+ summary = _this$props$article.summary,
12329
+ _this$props$article$s = _this$props$article.seo;
12328
12330
  _this$props$article$s = _this$props$article$s === undefined ? {
12329
12331
  meta_description: null
12330
12332
  } : _this$props$article$s;
12331
12333
  var description = _this$props$article$s.meta_description;
12332
12334
 
12333
12335
  var targeting = _this.getTargeting(_this.props.article);
12336
+ var metaDescription = description ? description : summary ? summary : _this.getFirstLine(_this.props.article);
12337
+
12334
12338
  _this.state = {
12335
12339
  config: {
12336
12340
  navComponent: _this.props.website.navigation,
@@ -12342,7 +12346,7 @@ var ArticleQueue = function (_React$Component) {
12342
12346
  isLiveSite: _this.props.isLiveSite
12343
12347
  },
12344
12348
  title: _this.props.article.title,
12345
- summary: description ? description : _this.props.article.summary,
12349
+ summary: metaDescription,
12346
12350
  queueData: [_this.props.article],
12347
12351
  relatedArticles: [],
12348
12352
  keywords: []
@@ -12376,6 +12380,8 @@ var ArticleQueue = function (_React$Component) {
12376
12380
  value: function componentWillUnmount() {
12377
12381
  window.removeEventListener('scroll', this.scrollDirectionDetect);
12378
12382
  }
12383
+ // To return the 1st Line of text in the article body
12384
+
12379
12385
  }, {
12380
12386
  key: 'render',
12381
12387
  value: function render() {
@@ -12383,11 +12389,11 @@ var ArticleQueue = function (_React$Component) {
12383
12389
 
12384
12390
  var _state = this.state,
12385
12391
  config = _state.config,
12386
- _state$keywords = _state.keywords,
12387
- keywords = _state$keywords === undefined ? [] : _state$keywords,
12388
12392
  queueData = _state.queueData,
12389
12393
  title = _state.title,
12390
- summary = _state.summary;
12394
+ summary = _state.summary,
12395
+ _state$keywords = _state.keywords,
12396
+ keywords = _state$keywords === undefined ? [] : _state$keywords;
12391
12397
  var _props = this.props,
12392
12398
  website = _props.website,
12393
12399
  shareOptions = _props.shareOptions;
@@ -12546,18 +12552,47 @@ var _initialiseProps = function _initialiseProps() {
12546
12552
  return null;
12547
12553
  };
12548
12554
 
12555
+ this.getFirstLine = function (article) {
12556
+ var _article$body = article.body,
12557
+ body = _article$body === undefined ? [] : _article$body;
12558
+
12559
+ var desc = '';
12560
+ body.some(function (children) {
12561
+ children.children && children.children.some(function (item) {
12562
+ if (item.text && String(item.text).trim().length > 0 && desc == '') {
12563
+ console.log(String(item.text));
12564
+ desc = String(item.text);
12565
+ return true;
12566
+ }
12567
+ });
12568
+ if (desc !== '') {
12569
+ return true;
12570
+ }
12571
+ });
12572
+ return desc;
12573
+ };
12574
+
12549
12575
  this.refreshAdd = function (path) {
12550
12576
  var article = _this3.state.queueData.find(function (item) {
12551
12577
  return item.url.current == path;
12552
12578
  });
12553
12579
  var title = article.title,
12554
12580
  summary = article.summary,
12581
+ _article$internalTag2 = article.internalTag,
12582
+ internalTag = _article$internalTag2 === undefined ? [] : _article$internalTag2,
12583
+ _article$userDefinedT2 = article.userDefinedTag,
12584
+ userDefinedTag = _article$userDefinedT2 === undefined ? [] : _article$userDefinedT2,
12585
+ _article$SponsorshipT2 = article.SponsorshipTag,
12586
+ SponsorshipTag = _article$SponsorshipT2 === undefined ? [] : _article$SponsorshipT2,
12587
+ _article$seoTag2 = article.seoTag,
12588
+ seoTag = _article$seoTag2 === undefined ? [] : _article$seoTag2,
12555
12589
  _article$seo = article.seo;
12556
12590
  _article$seo = _article$seo === undefined ? {
12557
12591
  meta_description: null
12558
12592
  } : _article$seo;
12559
12593
  var description = _article$seo.meta_description;
12560
12594
 
12595
+ var keywords = [].concat(toConsumableArray(internalTag), toConsumableArray(userDefinedTag), toConsumableArray(SponsorshipTag), toConsumableArray(seoTag));
12561
12596
  var config = _extends$2({}, _this3.state.config);
12562
12597
  var targeting = _this3.getTargeting(article);
12563
12598
  var rightItems = [];
@@ -12570,7 +12605,8 @@ var _initialiseProps = function _initialiseProps() {
12570
12605
  var horizontalAD = _this3.props.Ads.getHorizontal(targeting);
12571
12606
  config.rightItems = rightItems;
12572
12607
  config.horizontalAD = horizontalAD;
12573
- _this3.setState({ config: config, title: title, summary: description ? description : summary }, function () {
12608
+ var metaDescription = description ? description : summary ? summary : _this3.getFirstLine(article);
12609
+ _this3.setState({ config: config, title: title, summary: metaDescription }, function () {
12574
12610
  lib_3.refresh();
12575
12611
  });
12576
12612
  };
@@ -12578,19 +12614,26 @@ var _initialiseProps = function _initialiseProps() {
12578
12614
  this.changeUrl = function (path, visibility) {
12579
12615
  var isScrollDown = _this3.isScrollDown;
12580
12616
 
12617
+ var newPath = '/view/' + path;
12581
12618
  if (!isScrollDown) {
12582
12619
  if (visibility == 'top') {
12583
- window.history.pushState({ page: path }, path, '/view/' + path);
12584
- _this3.setState({ keywords: [1] });
12620
+ // Router.push('/view/[url]', newPath, {shallow:true})
12621
+ window.history.pushState({ page: path }, path, newPath);
12622
+ if (_this3.props.pageview) {
12623
+ _this3.props.pageview(newPath);
12624
+ }
12625
+
12585
12626
  _this3.refreshAdd(path);
12586
- // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12587
12627
  }
12588
12628
  } else {
12589
12629
  if (visibility == 'bottom') {
12590
- window.history.pushState({ page: path }, path, '/view/' + path);
12591
- _this3.setState({ keywords: [1] });
12630
+ // Router.push('/view/[url]', newPath, {shallow:true})
12631
+ window.history.pushState({ page: path }, path, newPath);
12632
+ if (_this3.props.pageview) {
12633
+ _this3.props.pageview(newPath);
12634
+ }
12635
+
12592
12636
  _this3.refreshAdd(path);
12593
- // Router.push('/view/[url]', `/view/${path}`, {shallow:true})
12594
12637
  }
12595
12638
  }
12596
12639
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.217",
3
+ "version": "1.0.219",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",