@mjhls/mjh-framework 1.0.449 → 1.0.450
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/ArticleQueue.js +22 -24
- package/dist/cjs/View.js +23 -25
- package/dist/esm/ArticleQueue.js +22 -24
- package/dist/esm/View.js +23 -25
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/cjs/ArticleQueue.js
CHANGED
|
@@ -143,7 +143,7 @@ var Article = function Article(props) {
|
|
|
143
143
|
regionalPages = props.regionalPages,
|
|
144
144
|
nationalPage = props.nationalPage,
|
|
145
145
|
ISIContent = props.ISIContent,
|
|
146
|
-
|
|
146
|
+
onChangeArticle = props.onChangeArticle,
|
|
147
147
|
shareOptions = props.shareOptions,
|
|
148
148
|
cpModificationRequired = props.cpModificationRequired,
|
|
149
149
|
authorPrefix = props.authorPrefix,
|
|
@@ -455,7 +455,7 @@ var Article = function Article(props) {
|
|
|
455
455
|
id: 'article-' + title,
|
|
456
456
|
onChange: function onChange(visible) {
|
|
457
457
|
if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
|
|
458
|
-
|
|
458
|
+
onChangeArticle(url, visible, meta);
|
|
459
459
|
}
|
|
460
460
|
} },
|
|
461
461
|
React__default.createElement(
|
|
@@ -798,38 +798,36 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
798
798
|
document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
|
|
799
799
|
};
|
|
800
800
|
|
|
801
|
-
var
|
|
801
|
+
var onChangeArticle = function onChangeArticle(path, visibility, meta) {
|
|
802
802
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
803
803
|
var newPath = '/view/' + path;
|
|
804
|
+
|
|
805
|
+
// Change URL and do other changes
|
|
806
|
+
var doChanges = function doChanges() {
|
|
807
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
808
|
+
changeMeta(meta);
|
|
809
|
+
if (props.setCustomDimensions) {
|
|
810
|
+
var activeArticle = queueData.find(function (item) {
|
|
811
|
+
return item.url.current === path;
|
|
812
|
+
});
|
|
813
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
814
|
+
}
|
|
815
|
+
if (props.pageview) props.pageview(newPath);
|
|
816
|
+
refreshAD(path);
|
|
817
|
+
};
|
|
818
|
+
|
|
804
819
|
if (currentPath !== path) {
|
|
805
820
|
if (isScrollDown) {
|
|
806
821
|
if (visibility === 'top') {
|
|
807
|
-
|
|
808
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
809
|
-
changeMeta(meta);
|
|
810
|
-
if (props.pageview) {
|
|
811
|
-
props.pageview(newPath);
|
|
812
|
-
}
|
|
813
|
-
refreshAD(path);
|
|
822
|
+
doChanges();
|
|
814
823
|
}
|
|
815
824
|
} else {
|
|
816
825
|
if (visibility === 'bottom') {
|
|
817
|
-
|
|
818
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
819
|
-
changeMeta(meta);
|
|
820
|
-
if (props.pageview) {
|
|
821
|
-
props.pageview(newPath);
|
|
822
|
-
}
|
|
823
|
-
refreshAD(path);
|
|
826
|
+
doChanges();
|
|
824
827
|
}
|
|
825
828
|
}
|
|
826
829
|
if (visibility === 'small-top') {
|
|
827
|
-
|
|
828
|
-
changeMeta(meta);
|
|
829
|
-
if (props.pageview) {
|
|
830
|
-
props.pageview(newPath);
|
|
831
|
-
}
|
|
832
|
-
refreshAD(path);
|
|
830
|
+
doChanges();
|
|
833
831
|
}
|
|
834
832
|
}
|
|
835
833
|
};
|
|
@@ -847,7 +845,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
847
845
|
return React__default.createElement(Article, _extends._extends({
|
|
848
846
|
key: index
|
|
849
847
|
}, props, {
|
|
850
|
-
|
|
848
|
+
onChangeArticle: onChangeArticle,
|
|
851
849
|
authorPrfix: authorPrefix,
|
|
852
850
|
article: article,
|
|
853
851
|
cpModificationRequired: cpModificationRequired,
|
package/dist/cjs/View.js
CHANGED
|
@@ -264,7 +264,7 @@ var Article = function Article(props) {
|
|
|
264
264
|
shareOptions = props.shareOptions,
|
|
265
265
|
cpModificationRequired = props.cpModificationRequired,
|
|
266
266
|
authorPrefix = props.authorPrefix;
|
|
267
|
-
var
|
|
267
|
+
var onChangeArticle = props.onChangeArticle;
|
|
268
268
|
|
|
269
269
|
var _useState = React.useState(null),
|
|
270
270
|
_useState2 = slicedToArray._slicedToArray(_useState, 2),
|
|
@@ -600,7 +600,7 @@ var Article = function Article(props) {
|
|
|
600
600
|
shareVia: props.Settings.title
|
|
601
601
|
};
|
|
602
602
|
if (!props.infiniteScroll) {
|
|
603
|
-
|
|
603
|
+
onChangeArticle = function onChangeArticle() {
|
|
604
604
|
return null;
|
|
605
605
|
};
|
|
606
606
|
}
|
|
@@ -616,7 +616,7 @@ var Article = function Article(props) {
|
|
|
616
616
|
id: 'article-' + title,
|
|
617
617
|
onChange: function onChange(visible) {
|
|
618
618
|
if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
|
|
619
|
-
|
|
619
|
+
onChangeArticle(url, visible, meta);
|
|
620
620
|
}
|
|
621
621
|
} },
|
|
622
622
|
React__default.createElement(
|
|
@@ -963,38 +963,36 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
963
963
|
document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
|
|
964
964
|
};
|
|
965
965
|
|
|
966
|
-
var
|
|
966
|
+
var onChangeArticle = function onChangeArticle(path, visibility, meta) {
|
|
967
967
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
968
968
|
var newPath = '/view/' + path;
|
|
969
|
+
|
|
970
|
+
// Change URL and do other changes
|
|
971
|
+
var doChanges = function doChanges() {
|
|
972
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
973
|
+
changeMeta(meta);
|
|
974
|
+
if (props.setCustomDimensions) {
|
|
975
|
+
var activeArticle = queueData.find(function (item) {
|
|
976
|
+
return item.url.current === path;
|
|
977
|
+
});
|
|
978
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
979
|
+
}
|
|
980
|
+
if (props.pageview) props.pageview(newPath);
|
|
981
|
+
refreshAD(path);
|
|
982
|
+
};
|
|
983
|
+
|
|
969
984
|
if (currentPath !== path) {
|
|
970
985
|
if (isScrollDown) {
|
|
971
986
|
if (visibility === 'top') {
|
|
972
|
-
|
|
973
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
974
|
-
changeMeta(meta);
|
|
975
|
-
if (props.pageview) {
|
|
976
|
-
props.pageview(newPath);
|
|
977
|
-
}
|
|
978
|
-
refreshAD(path);
|
|
987
|
+
doChanges();
|
|
979
988
|
}
|
|
980
989
|
} else {
|
|
981
990
|
if (visibility === 'bottom') {
|
|
982
|
-
|
|
983
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
984
|
-
changeMeta(meta);
|
|
985
|
-
if (props.pageview) {
|
|
986
|
-
props.pageview(newPath);
|
|
987
|
-
}
|
|
988
|
-
refreshAD(path);
|
|
991
|
+
doChanges();
|
|
989
992
|
}
|
|
990
993
|
}
|
|
991
994
|
if (visibility === 'small-top') {
|
|
992
|
-
|
|
993
|
-
changeMeta(meta);
|
|
994
|
-
if (props.pageview) {
|
|
995
|
-
props.pageview(newPath);
|
|
996
|
-
}
|
|
997
|
-
refreshAD(path);
|
|
995
|
+
doChanges();
|
|
998
996
|
}
|
|
999
997
|
}
|
|
1000
998
|
};
|
|
@@ -1009,7 +1007,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1009
1007
|
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
1010
1008
|
article.contextualAD = Ads.getNativeContextualAD(getTargeting.getTargeting(props));
|
|
1011
1009
|
}
|
|
1012
|
-
return React__default.createElement(Article, _extends$1._extends({ key: index }, props, {
|
|
1010
|
+
return React__default.createElement(Article, _extends$1._extends({ key: index }, props, { onChangeArticle: onChangeArticle, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
|
|
1013
1011
|
})
|
|
1014
1012
|
);
|
|
1015
1013
|
};
|
package/dist/esm/ArticleQueue.js
CHANGED
|
@@ -138,7 +138,7 @@ var Article = function Article(props) {
|
|
|
138
138
|
regionalPages = props.regionalPages,
|
|
139
139
|
nationalPage = props.nationalPage,
|
|
140
140
|
ISIContent = props.ISIContent,
|
|
141
|
-
|
|
141
|
+
onChangeArticle = props.onChangeArticle,
|
|
142
142
|
shareOptions = props.shareOptions,
|
|
143
143
|
cpModificationRequired = props.cpModificationRequired,
|
|
144
144
|
authorPrefix = props.authorPrefix,
|
|
@@ -450,7 +450,7 @@ var Article = function Article(props) {
|
|
|
450
450
|
id: 'article-' + title,
|
|
451
451
|
onChange: function onChange(visible) {
|
|
452
452
|
if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
|
|
453
|
-
|
|
453
|
+
onChangeArticle(url, visible, meta);
|
|
454
454
|
}
|
|
455
455
|
} },
|
|
456
456
|
React__default.createElement(
|
|
@@ -793,38 +793,36 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
793
793
|
document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
|
|
794
794
|
};
|
|
795
795
|
|
|
796
|
-
var
|
|
796
|
+
var onChangeArticle = function onChangeArticle(path, visibility, meta) {
|
|
797
797
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
798
798
|
var newPath = '/view/' + path;
|
|
799
|
+
|
|
800
|
+
// Change URL and do other changes
|
|
801
|
+
var doChanges = function doChanges() {
|
|
802
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
803
|
+
changeMeta(meta);
|
|
804
|
+
if (props.setCustomDimensions) {
|
|
805
|
+
var activeArticle = queueData.find(function (item) {
|
|
806
|
+
return item.url.current === path;
|
|
807
|
+
});
|
|
808
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
809
|
+
}
|
|
810
|
+
if (props.pageview) props.pageview(newPath);
|
|
811
|
+
refreshAD(path);
|
|
812
|
+
};
|
|
813
|
+
|
|
799
814
|
if (currentPath !== path) {
|
|
800
815
|
if (isScrollDown) {
|
|
801
816
|
if (visibility === 'top') {
|
|
802
|
-
|
|
803
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
804
|
-
changeMeta(meta);
|
|
805
|
-
if (props.pageview) {
|
|
806
|
-
props.pageview(newPath);
|
|
807
|
-
}
|
|
808
|
-
refreshAD(path);
|
|
817
|
+
doChanges();
|
|
809
818
|
}
|
|
810
819
|
} else {
|
|
811
820
|
if (visibility === 'bottom') {
|
|
812
|
-
|
|
813
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
814
|
-
changeMeta(meta);
|
|
815
|
-
if (props.pageview) {
|
|
816
|
-
props.pageview(newPath);
|
|
817
|
-
}
|
|
818
|
-
refreshAD(path);
|
|
821
|
+
doChanges();
|
|
819
822
|
}
|
|
820
823
|
}
|
|
821
824
|
if (visibility === 'small-top') {
|
|
822
|
-
|
|
823
|
-
changeMeta(meta);
|
|
824
|
-
if (props.pageview) {
|
|
825
|
-
props.pageview(newPath);
|
|
826
|
-
}
|
|
827
|
-
refreshAD(path);
|
|
825
|
+
doChanges();
|
|
828
826
|
}
|
|
829
827
|
}
|
|
830
828
|
};
|
|
@@ -842,7 +840,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
842
840
|
return React__default.createElement(Article, _extends({
|
|
843
841
|
key: index
|
|
844
842
|
}, props, {
|
|
845
|
-
|
|
843
|
+
onChangeArticle: onChangeArticle,
|
|
846
844
|
authorPrfix: authorPrefix,
|
|
847
845
|
article: article,
|
|
848
846
|
cpModificationRequired: cpModificationRequired,
|
package/dist/esm/View.js
CHANGED
|
@@ -259,7 +259,7 @@ var Article = function Article(props) {
|
|
|
259
259
|
shareOptions = props.shareOptions,
|
|
260
260
|
cpModificationRequired = props.cpModificationRequired,
|
|
261
261
|
authorPrefix = props.authorPrefix;
|
|
262
|
-
var
|
|
262
|
+
var onChangeArticle = props.onChangeArticle;
|
|
263
263
|
|
|
264
264
|
var _useState = useState(null),
|
|
265
265
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -595,7 +595,7 @@ var Article = function Article(props) {
|
|
|
595
595
|
shareVia: props.Settings.title
|
|
596
596
|
};
|
|
597
597
|
if (!props.infiniteScroll) {
|
|
598
|
-
|
|
598
|
+
onChangeArticle = function onChangeArticle() {
|
|
599
599
|
return null;
|
|
600
600
|
};
|
|
601
601
|
}
|
|
@@ -611,7 +611,7 @@ var Article = function Article(props) {
|
|
|
611
611
|
id: 'article-' + title,
|
|
612
612
|
onChange: function onChange(visible) {
|
|
613
613
|
if (visible === 'top' || visible === 'bottom' || visible === 'small-top') {
|
|
614
|
-
|
|
614
|
+
onChangeArticle(url, visible, meta);
|
|
615
615
|
}
|
|
616
616
|
} },
|
|
617
617
|
React__default.createElement(
|
|
@@ -958,38 +958,36 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
958
958
|
document.querySelector('meta[name="twitter:description"]').setAttribute('content', meta.shareSummary);
|
|
959
959
|
};
|
|
960
960
|
|
|
961
|
-
var
|
|
961
|
+
var onChangeArticle = function onChangeArticle(path, visibility, meta) {
|
|
962
962
|
var currentPath = window && window.location && window.location.pathname ? window.location.pathname.replace('/view/', '') : '';
|
|
963
963
|
var newPath = '/view/' + path;
|
|
964
|
+
|
|
965
|
+
// Change URL and do other changes
|
|
966
|
+
var doChanges = function doChanges() {
|
|
967
|
+
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
968
|
+
changeMeta(meta);
|
|
969
|
+
if (props.setCustomDimensions) {
|
|
970
|
+
var activeArticle = queueData.find(function (item) {
|
|
971
|
+
return item.url.current === path;
|
|
972
|
+
});
|
|
973
|
+
props.setCustomDimensions(activeArticle, '200', prevUrl);
|
|
974
|
+
}
|
|
975
|
+
if (props.pageview) props.pageview(newPath);
|
|
976
|
+
refreshAD(path);
|
|
977
|
+
};
|
|
978
|
+
|
|
964
979
|
if (currentPath !== path) {
|
|
965
980
|
if (isScrollDown) {
|
|
966
981
|
if (visibility === 'top') {
|
|
967
|
-
|
|
968
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
969
|
-
changeMeta(meta);
|
|
970
|
-
if (props.pageview) {
|
|
971
|
-
props.pageview(newPath);
|
|
972
|
-
}
|
|
973
|
-
refreshAD(path);
|
|
982
|
+
doChanges();
|
|
974
983
|
}
|
|
975
984
|
} else {
|
|
976
985
|
if (visibility === 'bottom') {
|
|
977
|
-
|
|
978
|
-
window.history.pushState({ page: path }, meta.shareTitle, newPath);
|
|
979
|
-
changeMeta(meta);
|
|
980
|
-
if (props.pageview) {
|
|
981
|
-
props.pageview(newPath);
|
|
982
|
-
}
|
|
983
|
-
refreshAD(path);
|
|
986
|
+
doChanges();
|
|
984
987
|
}
|
|
985
988
|
}
|
|
986
989
|
if (visibility === 'small-top') {
|
|
987
|
-
|
|
988
|
-
changeMeta(meta);
|
|
989
|
-
if (props.pageview) {
|
|
990
|
-
props.pageview(newPath);
|
|
991
|
-
}
|
|
992
|
-
refreshAD(path);
|
|
990
|
+
doChanges();
|
|
993
991
|
}
|
|
994
992
|
}
|
|
995
993
|
};
|
|
@@ -1004,7 +1002,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
1004
1002
|
if (!checkSponseredArticle(article) && Ads.getNativeContextualAD) {
|
|
1005
1003
|
article.contextualAD = Ads.getNativeContextualAD(getTargeting(props));
|
|
1006
1004
|
}
|
|
1007
|
-
return React__default.createElement(Article, _extends({ key: index }, props, {
|
|
1005
|
+
return React__default.createElement(Article, _extends({ key: index }, props, { onChangeArticle: onChangeArticle, authorPrfix: authorPrefix, article: article, cpModificationRequired: cpModificationRequired }));
|
|
1008
1006
|
})
|
|
1009
1007
|
);
|
|
1010
1008
|
};
|