@mjhls/mjh-framework 1.0.320 → 1.0.322

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.320
2
+ # mjh-framework v. 1.0.322
3
3
 
4
4
  > Foundation Framework
5
5
 
@@ -1860,7 +1860,8 @@ var TemplateNormal = function TemplateNormal(props) {
1860
1860
  filterParams = props.filterParams,
1861
1861
  filters = props.filters,
1862
1862
  defaultFilter = props.defaultFilter,
1863
- showRightAd = props.showRightAd;
1863
+ showRightAd = props.showRightAd,
1864
+ sponsoredFlag = props.sponsoredFlag;
1864
1865
 
1865
1866
 
1866
1867
  var navigation = function navigation() {
@@ -1933,10 +1934,14 @@ var TemplateNormal = function TemplateNormal(props) {
1933
1934
  null,
1934
1935
  React__default.createElement(Header$1, { title: title ? title + ' | ' + website.title : '' + website.title, isLiveSite: config.isLiveSite, keyword: keywords, description: description }),
1935
1936
  navigation(),
1936
- horizontalAD && horizontalAD.networkID && horizontalAD.adUnit && React__default.createElement(
1937
- Container,
1937
+ sponsoredFlag ? React__default.createElement('div', { style: { height: '50px' } }) : React__default.createElement(
1938
+ React__default.Fragment,
1938
1939
  null,
1939
- React__default.createElement(AD728x90, { networkID: horizontalAD.networkID, adUnit: horizontalAD.adUnit, targeting: adTargeting })
1940
+ horizontalAD && horizontalAD.networkID && horizontalAD.adUnit && React__default.createElement(
1941
+ Container,
1942
+ null,
1943
+ React__default.createElement(AD728x90, { networkID: horizontalAD.networkID, adUnit: horizontalAD.adUnit, targeting: adTargeting })
1944
+ )
1940
1945
  ),
1941
1946
  React__default.createElement(
1942
1947
  Container,
@@ -1030,7 +1030,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
1030
1030
  Row,
1031
1031
  null,
1032
1032
  React__default.createElement(
1033
- Col,
1033
+ 'div',
1034
1034
  null,
1035
1035
  row.url ? React__default.createElement(
1036
1036
  'a',
@@ -1047,7 +1047,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
1047
1047
  )
1048
1048
  ),
1049
1049
  React__default.createElement(
1050
- Col,
1050
+ 'div',
1051
1051
  null,
1052
1052
  (address && address.length || companyDetails && companyDetails.length) && React__default.createElement(
1053
1053
  'div',
@@ -12,7 +12,7 @@ require('react-bootstrap/Card');
12
12
  require('react-dom');
13
13
  require('./index-b5eb3ff8.js');
14
14
  require('./index-fa0fb52c.js');
15
- var TaxonomyCard = require('./TaxonomyCard-22b72261.js');
15
+ var TaxonomyCard = require('./TaxonomyCard-d8eed035.js');
16
16
  require('./react-social-icons-cd0d9d3b.js');
17
17
 
18
18
 
@@ -20,7 +20,7 @@ require('./react-social-icons-cd0d9d3b.js');
20
20
  require('react-bootstrap');
21
21
  require('./index.esm-340d3792.js');
22
22
  require('react-bootstrap/Button');
23
- var TemplateNormal = require('./Normal-972b1cc8.js');
23
+ var TemplateNormal = require('./Normal-ead4243d.js');
24
24
  require('react-bootstrap/ListGroup');
25
25
  require('next/head');
26
26
  require('react-bootstrap/Nav');
package/dist/cjs/index.js CHANGED
@@ -38,7 +38,7 @@ var GridContent = require('./GridContent-98e9ab78.js');
38
38
  var DeckQueue = require('./DeckQueue.js');
39
39
  require('react-bootstrap/Media');
40
40
  var ThumbnailCard = require('./ThumbnailCard.js');
41
- var TaxonomyCard = require('./TaxonomyCard-22b72261.js');
41
+ var TaxonomyCard = require('./TaxonomyCard-d8eed035.js');
42
42
  require('./react-social-icons-cd0d9d3b.js');
43
43
  var GroupDeck = require('./GroupDeck.js');
44
44
  var YoutubeGroup = require('./YoutubeGroup-24ec8af9.js');
@@ -53,7 +53,7 @@ var IssueDeck = require('./IssueDeck.js');
53
53
  require('react-bootstrap/Badge');
54
54
  var IssueContentDeck = require('./IssueContentDeck.js');
55
55
  var Spinner = _interopDefault(require('react-bootstrap/Spinner'));
56
- var TemplateNormal = require('./Normal-972b1cc8.js');
56
+ var TemplateNormal = require('./Normal-ead4243d.js');
57
57
  require('react-bootstrap/ListGroup');
58
58
  var Head = _interopDefault(require('next/head'));
59
59
  var Accordion = _interopDefault(require('react-bootstrap/Accordion'));
@@ -16286,6 +16286,59 @@ var Article = function Article(props) {
16286
16286
  var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
16287
16287
  var siteName = props.website.title;
16288
16288
 
16289
+ //Native Ads
16290
+ var findIndex = function findIndex(arr) {
16291
+ var indexes = [];
16292
+ var _iteratorNormalCompletion = true;
16293
+ var _didIteratorError = false;
16294
+ var _iteratorError = undefined;
16295
+
16296
+ try {
16297
+ for (var _iterator = slicedToArray._getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
16298
+ var ele = _step.value;
16299
+
16300
+ if (ele['_type'] === 'block' && ele.children.some(function (child) {
16301
+ return child.text.trim().length > 0;
16302
+ }) && ele['listItem'] != 'bullet' && ele['style'] === 'normal') {
16303
+ indexes.push(arr.indexOf(ele));
16304
+ }
16305
+ }
16306
+ } catch (err) {
16307
+ _didIteratorError = true;
16308
+ _iteratorError = err;
16309
+ } finally {
16310
+ try {
16311
+ if (!_iteratorNormalCompletion && _iterator.return) {
16312
+ _iterator.return();
16313
+ }
16314
+ } finally {
16315
+ if (_didIteratorError) {
16316
+ throw _iteratorError;
16317
+ }
16318
+ }
16319
+ }
16320
+
16321
+ return indexes;
16322
+ };
16323
+
16324
+ var insert = function insert(arr, index, newElement) {
16325
+ return [].concat(toConsumableArray._toConsumableArray(arr.slice(0, index)), [newElement], toConsumableArray._toConsumableArray(arr.slice(index)));
16326
+ };
16327
+ var newBody = [];
16328
+ if (props.article.contextualAD) {
16329
+ var indexes = findIndex(articleBody);
16330
+
16331
+ if (indexes.length >= 2 && articleBody.length > 3) {
16332
+ var setIndex = indexes[1];
16333
+ newBody = insert(articleBody, setIndex + 1, props.article.contextualAD);
16334
+ } else {
16335
+ newBody = articleBody;
16336
+ }
16337
+ } else {
16338
+ newBody = articleBody;
16339
+ }
16340
+ //End Native Ads
16341
+
16289
16342
  return React__default.createElement(
16290
16343
  React__default.Fragment,
16291
16344
  null,
@@ -16347,7 +16400,39 @@ var Article = function Article(props) {
16347
16400
  { key: index },
16348
16401
  renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
16349
16402
  );
16350
- })
16403
+ }),
16404
+ issue && React__default.createElement(
16405
+ 'div',
16406
+ null,
16407
+ React__default.createElement(
16408
+ 'div',
16409
+ null,
16410
+ issue.articleSource && React__default.createElement(
16411
+ 'p',
16412
+ null,
16413
+ 'Source: ' + issue.articleSource
16414
+ )
16415
+ ),
16416
+ React__default.createElement(
16417
+ 'div',
16418
+ { className: 'volume-issue' },
16419
+ React__default.createElement(
16420
+ 'p',
16421
+ null,
16422
+ issue.issueNumber && React__default.createElement(
16423
+ 'span',
16424
+ null,
16425
+ 'Issue ' + issue.issueNumber,
16426
+ ','
16427
+ ),
16428
+ issue.volume && React__default.createElement(
16429
+ 'span',
16430
+ null,
16431
+ 'Volume ' + issue.volume
16432
+ )
16433
+ )
16434
+ )
16435
+ )
16351
16436
  ),
16352
16437
  React__default.createElement(
16353
16438
  'p',
@@ -16397,12 +16482,21 @@ var Article = function Article(props) {
16397
16482
  React__default.createElement('br', null),
16398
16483
  React__default.createElement('br', null)
16399
16484
  ),
16485
+ main.main_39 && props.article.Ads.map(function (ad, index) {
16486
+ if (index == 0) {
16487
+ return React__default.createElement(
16488
+ 'div',
16489
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto', marginTop: '-1rem', marginBottom: '1rem' } },
16490
+ ad.component
16491
+ );
16492
+ }
16493
+ }),
16400
16494
  React__default.createElement(
16401
16495
  'div',
16402
16496
  { className: 'block-content' },
16403
16497
  React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
16404
16498
  serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
16405
- blocks: articleBody,
16499
+ blocks: newBody,
16406
16500
  imageOptions: { w: 320, h: 240, fit: 'max' }
16407
16501
  }, client.config())),
16408
16502
  issue && issue.url && React__default.createElement(
@@ -16417,13 +16511,14 @@ var Article = function Article(props) {
16417
16511
  renderIsiContent(props.article)
16418
16512
  )
16419
16513
  ),
16420
- main.main_39 && React__default.createElement('hr', { className: 'add-seperater' }),
16421
16514
  main.main_39 && props.article.Ads.map(function (ad, index) {
16422
- return React__default.createElement(
16423
- 'div',
16424
- { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
16425
- ad.component
16426
- );
16515
+ if (index > 0) {
16516
+ return React__default.createElement(
16517
+ 'div',
16518
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
16519
+ ad.component
16520
+ );
16521
+ }
16427
16522
  }),
16428
16523
  React__default.createElement('hr', { className: 'article-seperater' })
16429
16524
  );
@@ -16564,7 +16659,7 @@ var ArticleQueue = function ArticleQueue(props) {
16564
16659
  horizontalAD: {},
16565
16660
  isLiveSite: isLiveSite
16566
16661
  };
16567
- props.article.Ads = [];
16662
+ props.article.Ads = Ads.getRightItems(targeting);
16568
16663
 
16569
16664
  var _useState9 = React.useState(config),
16570
16665
  _useState10 = slicedToArray._slicedToArray(_useState9, 2),
@@ -16705,6 +16800,9 @@ var ArticleQueue = function ArticleQueue(props) {
16705
16800
  visibilitySensor.InfiniteScroll,
16706
16801
  { dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
16707
16802
  queueData.map(function (article, index) {
16803
+ if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
16804
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
16805
+ }
16708
16806
  return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16709
16807
  })
16710
16808
  );
@@ -1855,7 +1855,8 @@ var TemplateNormal = function TemplateNormal(props) {
1855
1855
  filterParams = props.filterParams,
1856
1856
  filters = props.filters,
1857
1857
  defaultFilter = props.defaultFilter,
1858
- showRightAd = props.showRightAd;
1858
+ showRightAd = props.showRightAd,
1859
+ sponsoredFlag = props.sponsoredFlag;
1859
1860
 
1860
1861
 
1861
1862
  var navigation = function navigation() {
@@ -1928,10 +1929,14 @@ var TemplateNormal = function TemplateNormal(props) {
1928
1929
  null,
1929
1930
  React__default.createElement(Header$1, { title: title ? title + ' | ' + website.title : '' + website.title, isLiveSite: config.isLiveSite, keyword: keywords, description: description }),
1930
1931
  navigation(),
1931
- horizontalAD && horizontalAD.networkID && horizontalAD.adUnit && React__default.createElement(
1932
- Container,
1932
+ sponsoredFlag ? React__default.createElement('div', { style: { height: '50px' } }) : React__default.createElement(
1933
+ React__default.Fragment,
1933
1934
  null,
1934
- React__default.createElement(AD728x90, { networkID: horizontalAD.networkID, adUnit: horizontalAD.adUnit, targeting: adTargeting })
1935
+ horizontalAD && horizontalAD.networkID && horizontalAD.adUnit && React__default.createElement(
1936
+ Container,
1937
+ null,
1938
+ React__default.createElement(AD728x90, { networkID: horizontalAD.networkID, adUnit: horizontalAD.adUnit, targeting: adTargeting })
1939
+ )
1935
1940
  ),
1936
1941
  React__default.createElement(
1937
1942
  Container,
@@ -1025,7 +1025,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
1025
1025
  Row,
1026
1026
  null,
1027
1027
  React__default.createElement(
1028
- Col,
1028
+ 'div',
1029
1029
  null,
1030
1030
  row.url ? React__default.createElement(
1031
1031
  'a',
@@ -1042,7 +1042,7 @@ var TaxonomyCard = function TaxonomyCard(props) {
1042
1042
  )
1043
1043
  ),
1044
1044
  React__default.createElement(
1045
- Col,
1045
+ 'div',
1046
1046
  null,
1047
1047
  (address && address.length || companyDetails && companyDetails.length) && React__default.createElement(
1048
1048
  'div',
@@ -10,5 +10,5 @@ import 'react-bootstrap/Card';
10
10
  import 'react-dom';
11
11
  import './index-51a80699.js';
12
12
  import './index-5f9f807a.js';
13
- export { T as default } from './TaxonomyCard-7e9aae2d.js';
13
+ export { T as default } from './TaxonomyCard-35127639.js';
14
14
  import './react-social-icons-a7d5c5c7.js';
@@ -18,7 +18,7 @@ import './react-social-icons-a7d5c5c7.js';
18
18
  import 'react-bootstrap';
19
19
  import './index.esm-536609db.js';
20
20
  import 'react-bootstrap/Button';
21
- export { T as default } from './Normal-ed829d1e.js';
21
+ export { T as default } from './Normal-252dd706.js';
22
22
  import 'react-bootstrap/ListGroup';
23
23
  import 'next/head';
24
24
  import 'react-bootstrap/Nav';
package/dist/esm/index.js CHANGED
@@ -31,8 +31,8 @@ export { A as AD, G as GridContent } from './GridContent-dd8fe8d1.js';
31
31
  export { default as DeckQueue } from './DeckQueue.js';
32
32
  import 'react-bootstrap/Media';
33
33
  export { default as ThumbnailCard } from './ThumbnailCard.js';
34
- import { B as BlockContent } from './TaxonomyCard-7e9aae2d.js';
35
- export { T as TaxonomyCard } from './TaxonomyCard-7e9aae2d.js';
34
+ import { B as BlockContent } from './TaxonomyCard-35127639.js';
35
+ export { T as TaxonomyCard } from './TaxonomyCard-35127639.js';
36
36
  import './react-social-icons-a7d5c5c7.js';
37
37
  import GroupDeck from './GroupDeck.js';
38
38
  export { default as GroupDeck } from './GroupDeck.js';
@@ -49,8 +49,8 @@ export { default as IssueDeck } from './IssueDeck.js';
49
49
  import 'react-bootstrap/Badge';
50
50
  export { default as IssueContentDeck } from './IssueContentDeck.js';
51
51
  import Spinner from 'react-bootstrap/Spinner';
52
- import { M as MdPictureAsPdf } from './Normal-ed829d1e.js';
53
- 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-ed829d1e.js';
52
+ import { M as MdPictureAsPdf } from './Normal-252dd706.js';
53
+ 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-252dd706.js';
54
54
  import 'react-bootstrap/ListGroup';
55
55
  import Head from 'next/head';
56
56
  import Accordion from 'react-bootstrap/Accordion';
@@ -16284,6 +16284,59 @@ var Article = function Article(props) {
16284
16284
  var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
16285
16285
  var siteName = props.website.title;
16286
16286
 
16287
+ //Native Ads
16288
+ var findIndex = function findIndex(arr) {
16289
+ var indexes = [];
16290
+ var _iteratorNormalCompletion = true;
16291
+ var _didIteratorError = false;
16292
+ var _iteratorError = undefined;
16293
+
16294
+ try {
16295
+ for (var _iterator = _getIterator(arr), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
16296
+ var ele = _step.value;
16297
+
16298
+ if (ele['_type'] === 'block' && ele.children.some(function (child) {
16299
+ return child.text.trim().length > 0;
16300
+ }) && ele['listItem'] != 'bullet' && ele['style'] === 'normal') {
16301
+ indexes.push(arr.indexOf(ele));
16302
+ }
16303
+ }
16304
+ } catch (err) {
16305
+ _didIteratorError = true;
16306
+ _iteratorError = err;
16307
+ } finally {
16308
+ try {
16309
+ if (!_iteratorNormalCompletion && _iterator.return) {
16310
+ _iterator.return();
16311
+ }
16312
+ } finally {
16313
+ if (_didIteratorError) {
16314
+ throw _iteratorError;
16315
+ }
16316
+ }
16317
+ }
16318
+
16319
+ return indexes;
16320
+ };
16321
+
16322
+ var insert = function insert(arr, index, newElement) {
16323
+ return [].concat(_toConsumableArray(arr.slice(0, index)), [newElement], _toConsumableArray(arr.slice(index)));
16324
+ };
16325
+ var newBody = [];
16326
+ if (props.article.contextualAD) {
16327
+ var indexes = findIndex(articleBody);
16328
+
16329
+ if (indexes.length >= 2 && articleBody.length > 3) {
16330
+ var setIndex = indexes[1];
16331
+ newBody = insert(articleBody, setIndex + 1, props.article.contextualAD);
16332
+ } else {
16333
+ newBody = articleBody;
16334
+ }
16335
+ } else {
16336
+ newBody = articleBody;
16337
+ }
16338
+ //End Native Ads
16339
+
16287
16340
  return React__default.createElement(
16288
16341
  React__default.Fragment,
16289
16342
  null,
@@ -16345,7 +16398,39 @@ var Article = function Article(props) {
16345
16398
  { key: index },
16346
16399
  renderAuthor(authorDetail.displayName, authorDetail.url, index, authorDetails.length)
16347
16400
  );
16348
- })
16401
+ }),
16402
+ issue && React__default.createElement(
16403
+ 'div',
16404
+ null,
16405
+ React__default.createElement(
16406
+ 'div',
16407
+ null,
16408
+ issue.articleSource && React__default.createElement(
16409
+ 'p',
16410
+ null,
16411
+ 'Source: ' + issue.articleSource
16412
+ )
16413
+ ),
16414
+ React__default.createElement(
16415
+ 'div',
16416
+ { className: 'volume-issue' },
16417
+ React__default.createElement(
16418
+ 'p',
16419
+ null,
16420
+ issue.issueNumber && React__default.createElement(
16421
+ 'span',
16422
+ null,
16423
+ 'Issue ' + issue.issueNumber,
16424
+ ','
16425
+ ),
16426
+ issue.volume && React__default.createElement(
16427
+ 'span',
16428
+ null,
16429
+ 'Volume ' + issue.volume
16430
+ )
16431
+ )
16432
+ )
16433
+ )
16349
16434
  ),
16350
16435
  React__default.createElement(
16351
16436
  'p',
@@ -16395,12 +16480,21 @@ var Article = function Article(props) {
16395
16480
  React__default.createElement('br', null),
16396
16481
  React__default.createElement('br', null)
16397
16482
  ),
16483
+ main_39 && props.article.Ads.map(function (ad, index) {
16484
+ if (index == 0) {
16485
+ return React__default.createElement(
16486
+ 'div',
16487
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto', marginTop: '-1rem', marginBottom: '1rem' } },
16488
+ ad.component
16489
+ );
16490
+ }
16491
+ }),
16398
16492
  React__default.createElement(
16399
16493
  'div',
16400
16494
  { className: 'block-content' },
16401
16495
  React__default.createElement(BlockContent, _extends$2({
16402
16496
  serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
16403
- blocks: articleBody,
16497
+ blocks: newBody,
16404
16498
  imageOptions: { w: 320, h: 240, fit: 'max' }
16405
16499
  }, client.config())),
16406
16500
  issue && issue.url && React__default.createElement(
@@ -16415,13 +16509,14 @@ var Article = function Article(props) {
16415
16509
  renderIsiContent(props.article)
16416
16510
  )
16417
16511
  ),
16418
- main_39 && React__default.createElement('hr', { className: 'add-seperater' }),
16419
16512
  main_39 && props.article.Ads.map(function (ad, index) {
16420
- return React__default.createElement(
16421
- 'div',
16422
- { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
16423
- ad.component
16424
- );
16513
+ if (index > 0) {
16514
+ return React__default.createElement(
16515
+ 'div',
16516
+ { key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
16517
+ ad.component
16518
+ );
16519
+ }
16425
16520
  }),
16426
16521
  React__default.createElement('hr', { className: 'article-seperater' })
16427
16522
  );
@@ -16562,7 +16657,7 @@ var ArticleQueue = function ArticleQueue(props) {
16562
16657
  horizontalAD: {},
16563
16658
  isLiveSite: isLiveSite
16564
16659
  };
16565
- props.article.Ads = [];
16660
+ props.article.Ads = Ads.getRightItems(targeting);
16566
16661
 
16567
16662
  var _useState9 = useState(config),
16568
16663
  _useState10 = _slicedToArray(_useState9, 2),
@@ -16703,6 +16798,9 @@ var ArticleQueue = function ArticleQueue(props) {
16703
16798
  InfiniteScroll,
16704
16799
  { dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
16705
16800
  queueData.map(function (article, index) {
16801
+ if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
16802
+ article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
16803
+ }
16706
16804
  return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16707
16805
  })
16708
16806
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.320",
3
+ "version": "1.0.322",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",