@mjhls/mjh-framework 1.0.956 → 1.0.957-test
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/EventsDeck.js +7 -3
- package/dist/cjs/View.js +26 -9
- package/dist/esm/EventsDeck.js +7 -3
- package/dist/esm/View.js +26 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# mjh-framework v. 1.0.
|
|
1
|
+
# mjh-framework v. 1.0.957
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/mjh-framework) [](https://standardjs.com)
|
|
4
4
|
|
package/dist/cjs/EventsDeck.js
CHANGED
|
@@ -63,7 +63,9 @@ var currentTime = index.momentTimezone().toISOString();
|
|
|
63
63
|
var itemsPerPage = 200;
|
|
64
64
|
|
|
65
65
|
var EventsDeck = function EventsDeck(_ref) {
|
|
66
|
-
var
|
|
66
|
+
var _ref$emptyMsg = _ref.emptyMsg,
|
|
67
|
+
emptyMsg = _ref$emptyMsg === undefined ? 'No events found' : _ref$emptyMsg,
|
|
68
|
+
rightItems = _ref.rightItems,
|
|
67
69
|
_ref$filter = _ref.filter,
|
|
68
70
|
filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter,
|
|
69
71
|
_ref$hardCodedEvents = _ref.hardCodedEvents,
|
|
@@ -616,7 +618,8 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
616
618
|
React__default['default'].createElement(
|
|
617
619
|
'div',
|
|
618
620
|
null,
|
|
619
|
-
|
|
621
|
+
emptyMsg,
|
|
622
|
+
' '
|
|
620
623
|
)
|
|
621
624
|
);
|
|
622
625
|
}
|
|
@@ -845,7 +848,8 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
845
848
|
React__default['default'].createElement(
|
|
846
849
|
'div',
|
|
847
850
|
null,
|
|
848
|
-
|
|
851
|
+
emptyMsg,
|
|
852
|
+
' '
|
|
849
853
|
)
|
|
850
854
|
);
|
|
851
855
|
}
|
package/dist/cjs/View.js
CHANGED
|
@@ -950,8 +950,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
950
950
|
_props$authorImgHeigh = props.authorImgHeight,
|
|
951
951
|
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
|
|
952
952
|
props.active;
|
|
953
|
-
var
|
|
954
|
-
_props$refreshFlag = props.refreshFlag,
|
|
953
|
+
var _props$refreshFlag = props.refreshFlag,
|
|
955
954
|
refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
|
|
956
955
|
disqusConfig = props.disqusConfig,
|
|
957
956
|
showDisqus = props.showDisqus,
|
|
@@ -1037,10 +1036,20 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1037
1036
|
articleBody = _useState10[0],
|
|
1038
1037
|
setArticleBody = _useState10[1];
|
|
1039
1038
|
|
|
1040
|
-
var _useState11 = React.useState(
|
|
1041
|
-
_useState12 = slicedToArray._slicedToArray(_useState11, 2)
|
|
1042
|
-
_useState12[0]
|
|
1043
|
-
|
|
1039
|
+
var _useState11 = React.useState(0),
|
|
1040
|
+
_useState12 = slicedToArray._slicedToArray(_useState11, 2),
|
|
1041
|
+
containerHeight = _useState12[0],
|
|
1042
|
+
setContainerHeight = _useState12[1];
|
|
1043
|
+
|
|
1044
|
+
var _useState13 = React.useState(true),
|
|
1045
|
+
_useState14 = slicedToArray._slicedToArray(_useState13, 2);
|
|
1046
|
+
_useState14[0];
|
|
1047
|
+
var setPreviewAd = _useState14[1];
|
|
1048
|
+
|
|
1049
|
+
var _useState15 = React.useState(props.index === 0),
|
|
1050
|
+
_useState16 = slicedToArray._slicedToArray(_useState15, 2),
|
|
1051
|
+
isFirstArticle = _useState16[0],
|
|
1052
|
+
setIsFirstArticle = _useState16[1];
|
|
1044
1053
|
|
|
1045
1054
|
React.useEffect(function () {
|
|
1046
1055
|
var path = window && window.location && window.location.search;
|
|
@@ -1048,6 +1057,7 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1048
1057
|
setPreviewAd(path.split('&').some(function (param) {
|
|
1049
1058
|
return param.includes('creativeId');
|
|
1050
1059
|
}));
|
|
1060
|
+
setContainerHeight(window.innerHeight);
|
|
1051
1061
|
}, []);
|
|
1052
1062
|
|
|
1053
1063
|
var isCutomPage = function isCutomPage(article) {
|
|
@@ -1549,9 +1559,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1549
1559
|
visibilitySensor.VisibilitySensor,
|
|
1550
1560
|
{
|
|
1551
1561
|
partialVisibility: true,
|
|
1552
|
-
offset: { bottom: triggerOffset, top: containerHeight },
|
|
1562
|
+
offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
|
|
1553
1563
|
onChange: function onChange(isVisible) {
|
|
1554
|
-
|
|
1564
|
+
console.log(isFirstArticle, 'first');
|
|
1565
|
+
if (isVisible && !isFirstArticle) {
|
|
1555
1566
|
var pageviewProperties = _extends._extends({}, targeting, {
|
|
1556
1567
|
category: article && article.category ? article.category.name : ''
|
|
1557
1568
|
});
|
|
@@ -1560,6 +1571,10 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1560
1571
|
return true;
|
|
1561
1572
|
});
|
|
1562
1573
|
}
|
|
1574
|
+
if (isFirstArticle) {
|
|
1575
|
+
|
|
1576
|
+
setIsFirstArticle(false);
|
|
1577
|
+
}
|
|
1563
1578
|
} },
|
|
1564
1579
|
React__default['default'].createElement(
|
|
1565
1580
|
'div',
|
|
@@ -1842,7 +1857,8 @@ var Article = React__default['default'].memo(React.forwardRef(function (props, r
|
|
|
1842
1857
|
return detail();
|
|
1843
1858
|
}
|
|
1844
1859
|
}), function (prevProps, nextProps) {
|
|
1845
|
-
|
|
1860
|
+
if (prevProps.article._id === nextProps.article._id) return true;
|
|
1861
|
+
return false;
|
|
1846
1862
|
});
|
|
1847
1863
|
|
|
1848
1864
|
var _this$1 = undefined;
|
|
@@ -2089,6 +2105,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
2089
2105
|
};
|
|
2090
2106
|
|
|
2091
2107
|
var onChangeArticle = function onChangeArticle(path, meta, pageviewProperties) {
|
|
2108
|
+
|
|
2092
2109
|
var newPath = '/view/' + path;
|
|
2093
2110
|
var activeArticle = queueData.find(function (item) {
|
|
2094
2111
|
return item.url.current === path;
|
package/dist/esm/EventsDeck.js
CHANGED
|
@@ -50,7 +50,9 @@ var currentTime = momentTimezone().toISOString();
|
|
|
50
50
|
var itemsPerPage = 200;
|
|
51
51
|
|
|
52
52
|
var EventsDeck = function EventsDeck(_ref) {
|
|
53
|
-
var
|
|
53
|
+
var _ref$emptyMsg = _ref.emptyMsg,
|
|
54
|
+
emptyMsg = _ref$emptyMsg === undefined ? 'No events found' : _ref$emptyMsg,
|
|
55
|
+
rightItems = _ref.rightItems,
|
|
54
56
|
_ref$filter = _ref.filter,
|
|
55
57
|
filter = _ref$filter === undefined ? 'start gt \'' + currentTime + '\' and status eq \'Active\'' : _ref$filter,
|
|
56
58
|
_ref$hardCodedEvents = _ref.hardCodedEvents,
|
|
@@ -603,7 +605,8 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
603
605
|
React__default.createElement(
|
|
604
606
|
'div',
|
|
605
607
|
null,
|
|
606
|
-
|
|
608
|
+
emptyMsg,
|
|
609
|
+
' '
|
|
607
610
|
)
|
|
608
611
|
);
|
|
609
612
|
}
|
|
@@ -832,7 +835,8 @@ var EventsDeck = function EventsDeck(_ref) {
|
|
|
832
835
|
React__default.createElement(
|
|
833
836
|
'div',
|
|
834
837
|
null,
|
|
835
|
-
|
|
838
|
+
emptyMsg,
|
|
839
|
+
' '
|
|
836
840
|
)
|
|
837
841
|
);
|
|
838
842
|
}
|
package/dist/esm/View.js
CHANGED
|
@@ -939,8 +939,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
939
939
|
_props$authorImgHeigh = props.authorImgHeight,
|
|
940
940
|
authorImgHeight = _props$authorImgHeigh === undefined ? 270 : _props$authorImgHeigh;
|
|
941
941
|
props.active;
|
|
942
|
-
var
|
|
943
|
-
_props$refreshFlag = props.refreshFlag,
|
|
942
|
+
var _props$refreshFlag = props.refreshFlag,
|
|
944
943
|
refreshFlag = _props$refreshFlag === undefined ? false : _props$refreshFlag,
|
|
945
944
|
disqusConfig = props.disqusConfig,
|
|
946
945
|
showDisqus = props.showDisqus,
|
|
@@ -1026,10 +1025,20 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1026
1025
|
articleBody = _useState10[0],
|
|
1027
1026
|
setArticleBody = _useState10[1];
|
|
1028
1027
|
|
|
1029
|
-
var _useState11 = useState(
|
|
1030
|
-
_useState12 = _slicedToArray(_useState11, 2)
|
|
1031
|
-
_useState12[0]
|
|
1032
|
-
|
|
1028
|
+
var _useState11 = useState(0),
|
|
1029
|
+
_useState12 = _slicedToArray(_useState11, 2),
|
|
1030
|
+
containerHeight = _useState12[0],
|
|
1031
|
+
setContainerHeight = _useState12[1];
|
|
1032
|
+
|
|
1033
|
+
var _useState13 = useState(true),
|
|
1034
|
+
_useState14 = _slicedToArray(_useState13, 2);
|
|
1035
|
+
_useState14[0];
|
|
1036
|
+
var setPreviewAd = _useState14[1];
|
|
1037
|
+
|
|
1038
|
+
var _useState15 = useState(props.index === 0),
|
|
1039
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
1040
|
+
isFirstArticle = _useState16[0],
|
|
1041
|
+
setIsFirstArticle = _useState16[1];
|
|
1033
1042
|
|
|
1034
1043
|
useEffect(function () {
|
|
1035
1044
|
var path = window && window.location && window.location.search;
|
|
@@ -1037,6 +1046,7 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1037
1046
|
setPreviewAd(path.split('&').some(function (param) {
|
|
1038
1047
|
return param.includes('creativeId');
|
|
1039
1048
|
}));
|
|
1049
|
+
setContainerHeight(window.innerHeight);
|
|
1040
1050
|
}, []);
|
|
1041
1051
|
|
|
1042
1052
|
var isCutomPage = function isCutomPage(article) {
|
|
@@ -1538,9 +1548,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1538
1548
|
VisibilitySensor,
|
|
1539
1549
|
{
|
|
1540
1550
|
partialVisibility: true,
|
|
1541
|
-
offset: { bottom: triggerOffset, top: containerHeight },
|
|
1551
|
+
offset: { bottom: triggerOffset, top: containerHeight && containerHeight },
|
|
1542
1552
|
onChange: function onChange(isVisible) {
|
|
1543
|
-
|
|
1553
|
+
console.log(isFirstArticle, 'first');
|
|
1554
|
+
if (isVisible && !isFirstArticle) {
|
|
1544
1555
|
var pageviewProperties = _extends({}, targeting, {
|
|
1545
1556
|
category: article && article.category ? article.category.name : ''
|
|
1546
1557
|
});
|
|
@@ -1549,6 +1560,10 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1549
1560
|
return true;
|
|
1550
1561
|
});
|
|
1551
1562
|
}
|
|
1563
|
+
if (isFirstArticle) {
|
|
1564
|
+
|
|
1565
|
+
setIsFirstArticle(false);
|
|
1566
|
+
}
|
|
1552
1567
|
} },
|
|
1553
1568
|
React__default.createElement(
|
|
1554
1569
|
'div',
|
|
@@ -1831,7 +1846,8 @@ var Article = React__default.memo(forwardRef(function (props, ref) {
|
|
|
1831
1846
|
return detail();
|
|
1832
1847
|
}
|
|
1833
1848
|
}), function (prevProps, nextProps) {
|
|
1834
|
-
|
|
1849
|
+
if (prevProps.article._id === nextProps.article._id) return true;
|
|
1850
|
+
return false;
|
|
1835
1851
|
});
|
|
1836
1852
|
|
|
1837
1853
|
var _this$1 = undefined;
|
|
@@ -2078,6 +2094,7 @@ var ArticleQueue = function ArticleQueue(props) {
|
|
|
2078
2094
|
};
|
|
2079
2095
|
|
|
2080
2096
|
var onChangeArticle = function onChangeArticle(path, meta, pageviewProperties) {
|
|
2097
|
+
|
|
2081
2098
|
var newPath = '/view/' + path;
|
|
2082
2099
|
var activeArticle = queueData.find(function (item) {
|
|
2083
2100
|
return item.url.current === path;
|