@mjhls/mjh-framework 1.0.319 → 1.0.321
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 +74 -10
- package/dist/esm/index.js +74 -10
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -14092,8 +14092,6 @@ var AlphabeticList = function AlphabeticList(_ref) {
|
|
|
14092
14092
|
'div',
|
|
14093
14093
|
{ className: 'd-flex flex-wrap mb-3' },
|
|
14094
14094
|
alphabet.map(function (letter, i) {
|
|
14095
|
-
console.log('letter:', letter);
|
|
14096
|
-
console.log('dataList', dataList[letter]);
|
|
14097
14095
|
if (dataList[letter]) {
|
|
14098
14096
|
return React__default.createElement(
|
|
14099
14097
|
'a',
|
|
@@ -16288,6 +16286,59 @@ var Article = function Article(props) {
|
|
|
16288
16286
|
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
16289
16287
|
var siteName = props.website.title;
|
|
16290
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
|
+
|
|
16291
16342
|
return React__default.createElement(
|
|
16292
16343
|
React__default.Fragment,
|
|
16293
16344
|
null,
|
|
@@ -16399,12 +16450,21 @@ var Article = function Article(props) {
|
|
|
16399
16450
|
React__default.createElement('br', null),
|
|
16400
16451
|
React__default.createElement('br', null)
|
|
16401
16452
|
),
|
|
16453
|
+
main.main_39 && props.article.Ads.map(function (ad, index) {
|
|
16454
|
+
if (index == 0) {
|
|
16455
|
+
return React__default.createElement(
|
|
16456
|
+
'div',
|
|
16457
|
+
{ key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto', marginTop: '-1rem', marginBottom: '1rem' } },
|
|
16458
|
+
ad.component
|
|
16459
|
+
);
|
|
16460
|
+
}
|
|
16461
|
+
}),
|
|
16402
16462
|
React__default.createElement(
|
|
16403
16463
|
'div',
|
|
16404
16464
|
{ className: 'block-content' },
|
|
16405
16465
|
React__default.createElement(TaxonomyCard.BlockContent, _extends$2._extends({
|
|
16406
16466
|
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
|
|
16407
|
-
blocks:
|
|
16467
|
+
blocks: newBody,
|
|
16408
16468
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
16409
16469
|
}, client.config())),
|
|
16410
16470
|
issue && issue.url && React__default.createElement(
|
|
@@ -16419,13 +16479,14 @@ var Article = function Article(props) {
|
|
|
16419
16479
|
renderIsiContent(props.article)
|
|
16420
16480
|
)
|
|
16421
16481
|
),
|
|
16422
|
-
main.main_39 && React__default.createElement('hr', { className: 'add-seperater' }),
|
|
16423
16482
|
main.main_39 && props.article.Ads.map(function (ad, index) {
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16427
|
-
|
|
16428
|
-
|
|
16483
|
+
if (index > 0) {
|
|
16484
|
+
return React__default.createElement(
|
|
16485
|
+
'div',
|
|
16486
|
+
{ key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
|
|
16487
|
+
ad.component
|
|
16488
|
+
);
|
|
16489
|
+
}
|
|
16429
16490
|
}),
|
|
16430
16491
|
React__default.createElement('hr', { className: 'article-seperater' })
|
|
16431
16492
|
);
|
|
@@ -16566,7 +16627,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16566
16627
|
horizontalAD: {},
|
|
16567
16628
|
isLiveSite: isLiveSite
|
|
16568
16629
|
};
|
|
16569
|
-
props.article.Ads =
|
|
16630
|
+
props.article.Ads = Ads.getRightItems(targeting);
|
|
16570
16631
|
|
|
16571
16632
|
var _useState9 = React.useState(config),
|
|
16572
16633
|
_useState10 = slicedToArray._slicedToArray(_useState9, 2),
|
|
@@ -16707,6 +16768,9 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16707
16768
|
visibilitySensor.InfiniteScroll,
|
|
16708
16769
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
|
|
16709
16770
|
queueData.map(function (article, index) {
|
|
16771
|
+
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
16772
|
+
article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
|
|
16773
|
+
}
|
|
16710
16774
|
return React__default.createElement(Article, _extends$2._extends({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
|
|
16711
16775
|
})
|
|
16712
16776
|
);
|
package/dist/esm/index.js
CHANGED
|
@@ -14090,8 +14090,6 @@ var AlphabeticList = function AlphabeticList(_ref) {
|
|
|
14090
14090
|
'div',
|
|
14091
14091
|
{ className: 'd-flex flex-wrap mb-3' },
|
|
14092
14092
|
alphabet.map(function (letter, i) {
|
|
14093
|
-
console.log('letter:', letter);
|
|
14094
|
-
console.log('dataList', dataList[letter]);
|
|
14095
14093
|
if (dataList[letter]) {
|
|
14096
14094
|
return React__default.createElement(
|
|
14097
14095
|
'a',
|
|
@@ -16286,6 +16284,59 @@ var Article = function Article(props) {
|
|
|
16286
16284
|
var shareImage = thumbnail && thumbnail.asset ? urlFor(thumbnail.asset).url() : shareImageDefault;
|
|
16287
16285
|
var siteName = props.website.title;
|
|
16288
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
|
+
|
|
16289
16340
|
return React__default.createElement(
|
|
16290
16341
|
React__default.Fragment,
|
|
16291
16342
|
null,
|
|
@@ -16397,12 +16448,21 @@ var Article = function Article(props) {
|
|
|
16397
16448
|
React__default.createElement('br', null),
|
|
16398
16449
|
React__default.createElement('br', null)
|
|
16399
16450
|
),
|
|
16451
|
+
main_39 && props.article.Ads.map(function (ad, index) {
|
|
16452
|
+
if (index == 0) {
|
|
16453
|
+
return React__default.createElement(
|
|
16454
|
+
'div',
|
|
16455
|
+
{ key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto', marginTop: '-1rem', marginBottom: '1rem' } },
|
|
16456
|
+
ad.component
|
|
16457
|
+
);
|
|
16458
|
+
}
|
|
16459
|
+
}),
|
|
16400
16460
|
React__default.createElement(
|
|
16401
16461
|
'div',
|
|
16402
16462
|
{ className: 'block-content' },
|
|
16403
16463
|
React__default.createElement(BlockContent, _extends$2({
|
|
16404
16464
|
serializers: getSerializers(client, pageview, videoAccountIDs, function () {}, true),
|
|
16405
|
-
blocks:
|
|
16465
|
+
blocks: newBody,
|
|
16406
16466
|
imageOptions: { w: 320, h: 240, fit: 'max' }
|
|
16407
16467
|
}, client.config())),
|
|
16408
16468
|
issue && issue.url && React__default.createElement(
|
|
@@ -16417,13 +16477,14 @@ var Article = function Article(props) {
|
|
|
16417
16477
|
renderIsiContent(props.article)
|
|
16418
16478
|
)
|
|
16419
16479
|
),
|
|
16420
|
-
main_39 && React__default.createElement('hr', { className: 'add-seperater' }),
|
|
16421
16480
|
main_39 && props.article.Ads.map(function (ad, index) {
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
|
|
16426
|
-
|
|
16481
|
+
if (index > 0) {
|
|
16482
|
+
return React__default.createElement(
|
|
16483
|
+
'div',
|
|
16484
|
+
{ key: index, id: 'addid-' + index, style: { display: 'flex', flex: '1 0 auto' } },
|
|
16485
|
+
ad.component
|
|
16486
|
+
);
|
|
16487
|
+
}
|
|
16427
16488
|
}),
|
|
16428
16489
|
React__default.createElement('hr', { className: 'article-seperater' })
|
|
16429
16490
|
);
|
|
@@ -16564,7 +16625,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16564
16625
|
horizontalAD: {},
|
|
16565
16626
|
isLiveSite: isLiveSite
|
|
16566
16627
|
};
|
|
16567
|
-
props.article.Ads =
|
|
16628
|
+
props.article.Ads = Ads.getRightItems(targeting);
|
|
16568
16629
|
|
|
16569
16630
|
var _useState9 = useState(config),
|
|
16570
16631
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
@@ -16705,6 +16766,9 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
16705
16766
|
InfiniteScroll,
|
|
16706
16767
|
{ dataLength: queueData.length, next: loadmore, scrollThreshold: 0.8, hasMore: true },
|
|
16707
16768
|
queueData.map(function (article, index) {
|
|
16769
|
+
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
16770
|
+
article.contextualAD = Ads.getNativeContextualAD(getTargeting(article));
|
|
16771
|
+
}
|
|
16708
16772
|
return React__default.createElement(Article, _extends$2({ key: index }, props, { changeUrl: changeUrl, article: article, cpModificationRequired: cpModificationRequired }));
|
|
16709
16773
|
})
|
|
16710
16774
|
);
|