@mjhls/mjh-framework 1.0.311 → 1.0.313
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 +1 -1
- package/dist/cjs/index.js +31 -8
- package/dist/esm/index.js +31 -8
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -16170,6 +16170,20 @@ 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
|
+
cp_url += (cp_url === '' ? '' : '/') + cp.parent;
|
|
16181
|
+
}
|
|
16182
|
+
|
|
16183
|
+
cp_url += (cp_url === '' ? '' : '/') + cp.path;
|
|
16184
|
+
return cp_url;
|
|
16185
|
+
};
|
|
16186
|
+
|
|
16173
16187
|
var Article = function Article(props) {
|
|
16174
16188
|
var client = props.client,
|
|
16175
16189
|
pageview = props.pageview,
|
|
@@ -16193,7 +16207,8 @@ var Article = function Article(props) {
|
|
|
16193
16207
|
nationalPage = props.nationalPage,
|
|
16194
16208
|
ISIContent = props.ISIContent,
|
|
16195
16209
|
changeUrl = props.changeUrl,
|
|
16196
|
-
shareOptions = props.shareOptions
|
|
16210
|
+
shareOptions = props.shareOptions,
|
|
16211
|
+
cpModificationRequired = props.cpModificationRequired;
|
|
16197
16212
|
|
|
16198
16213
|
|
|
16199
16214
|
var urlFor = function urlFor(source) {
|
|
@@ -16232,6 +16247,7 @@ var Article = function Article(props) {
|
|
|
16232
16247
|
var shareSummary = summary;
|
|
16233
16248
|
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
16234
16249
|
var siteName = props.website.title;
|
|
16250
|
+
|
|
16235
16251
|
return React__default.createElement(
|
|
16236
16252
|
React__default.Fragment,
|
|
16237
16253
|
null,
|
|
@@ -16322,7 +16338,8 @@ var Article = function Article(props) {
|
|
|
16322
16338
|
Dropdown.Menu,
|
|
16323
16339
|
null,
|
|
16324
16340
|
content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
16325
|
-
var
|
|
16341
|
+
var cp_url = cpModificationRequired ? get_content_placement_url(cp) : cp.path;
|
|
16342
|
+
var href = '/' + cp_url;
|
|
16326
16343
|
return React__default.createElement(
|
|
16327
16344
|
Dropdown.Item,
|
|
16328
16345
|
{ key: index, href: href },
|
|
@@ -16382,7 +16399,9 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16382
16399
|
_props$sponsoredTaxon = props.sponsoredTaxonomies,
|
|
16383
16400
|
sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
|
|
16384
16401
|
_props$maxListLength = props.maxListLength,
|
|
16385
|
-
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength
|
|
16402
|
+
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
|
|
16403
|
+
_props$cpModification = props.cpModificationRequired,
|
|
16404
|
+
cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
|
|
16386
16405
|
|
|
16387
16406
|
var _useState = React.useState(''),
|
|
16388
16407
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
@@ -16415,7 +16434,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16415
16434
|
body.some(function (children) {
|
|
16416
16435
|
children.children && children.children.some(function (item) {
|
|
16417
16436
|
if (item.text && String(item.text).trim().length > 0 && desc == '') {
|
|
16418
|
-
console.log(String(item.text));
|
|
16419
16437
|
desc = String(item.text);
|
|
16420
16438
|
return true;
|
|
16421
16439
|
}
|
|
@@ -16462,8 +16480,13 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16462
16480
|
var content_placement_urls = [];
|
|
16463
16481
|
if (content_placement && prevUrl && prevUrl.length) {
|
|
16464
16482
|
content_placement.forEach(function (item) {
|
|
16465
|
-
|
|
16466
|
-
|
|
16483
|
+
var path = item.path;
|
|
16484
|
+
if (cpModificationRequired) {
|
|
16485
|
+
path = get_content_placement_url(item);
|
|
16486
|
+
}
|
|
16487
|
+
|
|
16488
|
+
if (includes_1(prevUrl, path)) {
|
|
16489
|
+
content_placement_urls.push(path);
|
|
16467
16490
|
}
|
|
16468
16491
|
});
|
|
16469
16492
|
}
|
|
@@ -16471,7 +16494,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16471
16494
|
if (content_placement) {
|
|
16472
16495
|
if (content_placement_urls.length === 0) {
|
|
16473
16496
|
content_placement_urls = content_placement.map(function (item) {
|
|
16474
|
-
return item.path;
|
|
16497
|
+
return cpModificationRequired ? get_content_placement_url(item) : item.path;
|
|
16475
16498
|
});
|
|
16476
16499
|
}
|
|
16477
16500
|
} else {
|
|
@@ -16644,7 +16667,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16644
16667
|
visibilitySensor.InfiniteScroll,
|
|
16645
16668
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
|
|
16646
16669
|
queueData.map(function (article, index) {
|
|
16647
|
-
return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article }));
|
|
16670
|
+
return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
|
|
16648
16671
|
})
|
|
16649
16672
|
);
|
|
16650
16673
|
} else {
|
package/dist/esm/index.js
CHANGED
|
@@ -16168,6 +16168,20 @@ 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
|
+
cp_url += (cp_url === '' ? '' : '/') + cp.parent;
|
|
16179
|
+
}
|
|
16180
|
+
|
|
16181
|
+
cp_url += (cp_url === '' ? '' : '/') + cp.path;
|
|
16182
|
+
return cp_url;
|
|
16183
|
+
};
|
|
16184
|
+
|
|
16171
16185
|
var Article = function Article(props) {
|
|
16172
16186
|
var client = props.client,
|
|
16173
16187
|
pageview = props.pageview,
|
|
@@ -16191,7 +16205,8 @@ var Article = function Article(props) {
|
|
|
16191
16205
|
nationalPage = props.nationalPage,
|
|
16192
16206
|
ISIContent = props.ISIContent,
|
|
16193
16207
|
changeUrl = props.changeUrl,
|
|
16194
|
-
shareOptions = props.shareOptions
|
|
16208
|
+
shareOptions = props.shareOptions,
|
|
16209
|
+
cpModificationRequired = props.cpModificationRequired;
|
|
16195
16210
|
|
|
16196
16211
|
|
|
16197
16212
|
var urlFor = function urlFor(source) {
|
|
@@ -16230,6 +16245,7 @@ var Article = function Article(props) {
|
|
|
16230
16245
|
var shareSummary = summary;
|
|
16231
16246
|
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
16232
16247
|
var siteName = props.website.title;
|
|
16248
|
+
|
|
16233
16249
|
return React__default.createElement(
|
|
16234
16250
|
React__default.Fragment,
|
|
16235
16251
|
null,
|
|
@@ -16320,7 +16336,8 @@ var Article = function Article(props) {
|
|
|
16320
16336
|
Dropdown.Menu,
|
|
16321
16337
|
null,
|
|
16322
16338
|
content_placement.length > 0 ? content_placement.map(function (cp, index) {
|
|
16323
|
-
var
|
|
16339
|
+
var cp_url = cpModificationRequired ? get_content_placement_url(cp) : cp.path;
|
|
16340
|
+
var href = '/' + cp_url;
|
|
16324
16341
|
return React__default.createElement(
|
|
16325
16342
|
Dropdown.Item,
|
|
16326
16343
|
{ key: index, href: href },
|
|
@@ -16380,7 +16397,9 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16380
16397
|
_props$sponsoredTaxon = props.sponsoredTaxonomies,
|
|
16381
16398
|
sponsoredTaxonomies = _props$sponsoredTaxon === undefined ? [] : _props$sponsoredTaxon,
|
|
16382
16399
|
_props$maxListLength = props.maxListLength,
|
|
16383
|
-
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength
|
|
16400
|
+
maxListLength = _props$maxListLength === undefined ? 10 : _props$maxListLength,
|
|
16401
|
+
_props$cpModification = props.cpModificationRequired,
|
|
16402
|
+
cpModificationRequired = _props$cpModification === undefined ? false : _props$cpModification;
|
|
16384
16403
|
|
|
16385
16404
|
var _useState = useState(''),
|
|
16386
16405
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -16413,7 +16432,6 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16413
16432
|
body.some(function (children) {
|
|
16414
16433
|
children.children && children.children.some(function (item) {
|
|
16415
16434
|
if (item.text && String(item.text).trim().length > 0 && desc == '') {
|
|
16416
|
-
console.log(String(item.text));
|
|
16417
16435
|
desc = String(item.text);
|
|
16418
16436
|
return true;
|
|
16419
16437
|
}
|
|
@@ -16460,8 +16478,13 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16460
16478
|
var content_placement_urls = [];
|
|
16461
16479
|
if (content_placement && prevUrl && prevUrl.length) {
|
|
16462
16480
|
content_placement.forEach(function (item) {
|
|
16463
|
-
|
|
16464
|
-
|
|
16481
|
+
var path = item.path;
|
|
16482
|
+
if (cpModificationRequired) {
|
|
16483
|
+
path = get_content_placement_url(item);
|
|
16484
|
+
}
|
|
16485
|
+
|
|
16486
|
+
if (includes_1(prevUrl, path)) {
|
|
16487
|
+
content_placement_urls.push(path);
|
|
16465
16488
|
}
|
|
16466
16489
|
});
|
|
16467
16490
|
}
|
|
@@ -16469,7 +16492,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16469
16492
|
if (content_placement) {
|
|
16470
16493
|
if (content_placement_urls.length === 0) {
|
|
16471
16494
|
content_placement_urls = content_placement.map(function (item) {
|
|
16472
|
-
return item.path;
|
|
16495
|
+
return cpModificationRequired ? get_content_placement_url(item) : item.path;
|
|
16473
16496
|
});
|
|
16474
16497
|
}
|
|
16475
16498
|
} else {
|
|
@@ -16642,7 +16665,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16642
16665
|
InfiniteScroll,
|
|
16643
16666
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
|
|
16644
16667
|
queueData.map(function (article, index) {
|
|
16645
|
-
return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article }));
|
|
16668
|
+
return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
|
|
16646
16669
|
})
|
|
16647
16670
|
);
|
|
16648
16671
|
} else {
|