@mjhls/mjh-framework 1.0.311 → 1.0.312

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.311
2
+ # mjh-framework v. 1.0.312
3
3
 
4
4
  > Foundation Framework
5
5
 
package/dist/cjs/index.js CHANGED
@@ -16170,6 +16170,21 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
16170
16170
  }
16171
16171
  };
16172
16172
 
16173
+ var get_content_placement_url = function get_content_placement_url(cp) {
16174
+ var cp_url = '';
16175
+ if (cp.ancestor && typeof cp.ancestor === 'string') {
16176
+ cp_url += (cp_url === '' ? '' : '/') + cp.ancestor;
16177
+ }
16178
+
16179
+ if (!cp.ancestor && cp.parent && typeof cp.parent === 'string') {
16180
+ console.log('cp.parent:', cp.parent);
16181
+ cp_url += (cp_url === '' ? '' : '/') + cp.parent;
16182
+ }
16183
+
16184
+ cp_url += (cp_url === '' ? '' : '/') + cp.path;
16185
+ return cp_url;
16186
+ };
16187
+
16173
16188
  var Article = function Article(props) {
16174
16189
  var client = props.client,
16175
16190
  pageview = props.pageview,
@@ -16193,7 +16208,8 @@ var Article = function Article(props) {
16193
16208
  nationalPage = props.nationalPage,
16194
16209
  ISIContent = props.ISIContent,
16195
16210
  changeUrl = props.changeUrl,
16196
- shareOptions = props.shareOptions;
16211
+ shareOptions = props.shareOptions,
16212
+ cpModificationRequired = props.cpModificationRequired;
16197
16213
 
16198
16214
 
16199
16215
  var urlFor = function urlFor(source) {
@@ -16232,6 +16248,7 @@ var Article = function Article(props) {
16232
16248
  var shareSummary = summary;
16233
16249
  var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
16234
16250
  var siteName = props.website.title;
16251
+
16235
16252
  return React__default.createElement(
16236
16253
  React__default.Fragment,
16237
16254
  null,
@@ -16322,7 +16339,10 @@ var Article = function Article(props) {
16322
16339
  Dropdown.Menu,
16323
16340
  null,
16324
16341
  content_placement.length > 0 ? content_placement.map(function (cp, index) {
16325
- var href = '/' + cp.path;
16342
+ var cp_url = cpModificationRequired ? get_content_placement_url(cp) : cp.path;
16343
+ var href = '/' + cp_url;
16344
+ console.log('cp:', cp);
16345
+ console.log('href:', href);
16326
16346
  return React__default.createElement(
16327
16347
  Dropdown.Item,
16328
16348
  { key: index, href: href },
@@ -16382,7 +16402,9 @@ var ArticleQueue = function ArticleQueue(props) {
16382
16402
  _props$sponsoredTaxon = props.sponsoredTaxonomies,
16383
16403
  sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
16384
16404
  _props$maxListLength = props.maxListLength,
16385
- maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength;
16405
+ maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
16406
+ _props$cpModification = props.cpModificationRequired,
16407
+ cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
16386
16408
 
16387
16409
  var _useState = React.useState(''),
16388
16410
  _useState2 = slicedToArray._slicedToArray(_useState, 2),
@@ -16462,8 +16484,13 @@ var ArticleQueue = function ArticleQueue(props) {
16462
16484
  var content_placement_urls = [];
16463
16485
  if (content_placement && prevUrl && prevUrl.length) {
16464
16486
  content_placement.forEach(function (item) {
16465
- if (includes_1(prevUrl, item.path)) {
16466
- content_placement_urls.push(item.path);
16487
+ var path = item.path;
16488
+ if (cpModificationRequired) {
16489
+ path = get_content_placement_url(item);
16490
+ }
16491
+
16492
+ if (includes_1(prevUrl, path)) {
16493
+ content_placement_urls.push(path);
16467
16494
  }
16468
16495
  });
16469
16496
  }
@@ -16471,7 +16498,7 @@ var ArticleQueue = function ArticleQueue(props) {
16471
16498
  if (content_placement) {
16472
16499
  if (content_placement_urls.length === 0) {
16473
16500
  content_placement_urls = content_placement.map(function (item) {
16474
- return item.path;
16501
+ return cpModificationRequired ? get_content_placement_url(item) : item.path;
16475
16502
  });
16476
16503
  }
16477
16504
  } else {
@@ -16644,7 +16671,7 @@ var ArticleQueue = function ArticleQueue(props) {
16644
16671
  visibilitySensor.InfiniteScroll,
16645
16672
  { dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
16646
16673
  queueData.map(function (article, index) {
16647
- return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article }));
16674
+ return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16648
16675
  })
16649
16676
  );
16650
16677
  } else {
package/dist/esm/index.js CHANGED
@@ -16168,6 +16168,21 @@ var renderAuthor = function renderAuthor(authorName, authorURL, index, length) {
16168
16168
  }
16169
16169
  };
16170
16170
 
16171
+ var get_content_placement_url = function get_content_placement_url(cp) {
16172
+ var cp_url = '';
16173
+ if (cp.ancestor && typeof cp.ancestor === 'string') {
16174
+ cp_url += (cp_url === '' ? '' : '/') + cp.ancestor;
16175
+ }
16176
+
16177
+ if (!cp.ancestor && cp.parent && typeof cp.parent === 'string') {
16178
+ console.log('cp.parent:', cp.parent);
16179
+ cp_url += (cp_url === '' ? '' : '/') + cp.parent;
16180
+ }
16181
+
16182
+ cp_url += (cp_url === '' ? '' : '/') + cp.path;
16183
+ return cp_url;
16184
+ };
16185
+
16171
16186
  var Article = function Article(props) {
16172
16187
  var client = props.client,
16173
16188
  pageview = props.pageview,
@@ -16191,7 +16206,8 @@ var Article = function Article(props) {
16191
16206
  nationalPage = props.nationalPage,
16192
16207
  ISIContent = props.ISIContent,
16193
16208
  changeUrl = props.changeUrl,
16194
- shareOptions = props.shareOptions;
16209
+ shareOptions = props.shareOptions,
16210
+ cpModificationRequired = props.cpModificationRequired;
16195
16211
 
16196
16212
 
16197
16213
  var urlFor = function urlFor(source) {
@@ -16230,6 +16246,7 @@ var Article = function Article(props) {
16230
16246
  var shareSummary = summary;
16231
16247
  var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
16232
16248
  var siteName = props.website.title;
16249
+
16233
16250
  return React__default.createElement(
16234
16251
  React__default.Fragment,
16235
16252
  null,
@@ -16320,7 +16337,10 @@ var Article = function Article(props) {
16320
16337
  Dropdown.Menu,
16321
16338
  null,
16322
16339
  content_placement.length > 0 ? content_placement.map(function (cp, index) {
16323
- var href = '/' + cp.path;
16340
+ var cp_url = cpModificationRequired ? get_content_placement_url(cp) : cp.path;
16341
+ var href = '/' + cp_url;
16342
+ console.log('cp:', cp);
16343
+ console.log('href:', href);
16324
16344
  return React__default.createElement(
16325
16345
  Dropdown.Item,
16326
16346
  { key: index, href: href },
@@ -16380,7 +16400,9 @@ var ArticleQueue = function ArticleQueue(props) {
16380
16400
  _props$sponsoredTaxon = props.sponsoredTaxonomies,
16381
16401
  sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
16382
16402
  _props$maxListLength = props.maxListLength,
16383
- maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength;
16403
+ maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
16404
+ _props$cpModification = props.cpModificationRequired,
16405
+ cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
16384
16406
 
16385
16407
  var _useState = useState(''),
16386
16408
  _useState2 = _slicedToArray(_useState, 2),
@@ -16460,8 +16482,13 @@ var ArticleQueue = function ArticleQueue(props) {
16460
16482
  var content_placement_urls = [];
16461
16483
  if (content_placement && prevUrl && prevUrl.length) {
16462
16484
  content_placement.forEach(function (item) {
16463
- if (includes_1(prevUrl, item.path)) {
16464
- content_placement_urls.push(item.path);
16485
+ var path = item.path;
16486
+ if (cpModificationRequired) {
16487
+ path = get_content_placement_url(item);
16488
+ }
16489
+
16490
+ if (includes_1(prevUrl, path)) {
16491
+ content_placement_urls.push(path);
16465
16492
  }
16466
16493
  });
16467
16494
  }
@@ -16469,7 +16496,7 @@ var ArticleQueue = function ArticleQueue(props) {
16469
16496
  if (content_placement) {
16470
16497
  if (content_placement_urls.length === 0) {
16471
16498
  content_placement_urls = content_placement.map(function (item) {
16472
- return item.path;
16499
+ return cpModificationRequired ? get_content_placement_url(item) : item.path;
16473
16500
  });
16474
16501
  }
16475
16502
  } else {
@@ -16642,7 +16669,7 @@ var ArticleQueue = function ArticleQueue(props) {
16642
16669
  InfiniteScroll,
16643
16670
  { dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
16644
16671
  queueData.map(function (article, index) {
16645
- return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article }));
16672
+ return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
16646
16673
  })
16647
16674
  );
16648
16675
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mjhls/mjh-framework",
3
- "version": "1.0.311",
3
+ "version": "1.0.312",
4
4
  "description": "Foundation Framework",
5
5
  "author": "mjh-framework",
6
6
  "license": "MIT",