ywana-core8 0.1.61 → 0.1.63
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/dist/index.cjs +21 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +4 -16
- package/dist/index.css.map +1 -1
- package/dist/index.modern.js +22 -19
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +21 -18
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/site/site.css +4 -16
- package/src/site/site.js +18 -17
package/dist/index.cjs
CHANGED
@@ -3724,11 +3724,11 @@ var SitePage = function SitePage(_ref8) {
|
|
3724
3724
|
var context = React.useContext(SiteContext);
|
3725
3725
|
var page = context.page;
|
3726
3726
|
var _useState12 = React.useState(page),
|
3727
|
-
|
3728
|
-
|
3729
|
-
var _useState13 = React.useState(
|
3730
|
-
|
3731
|
-
|
3727
|
+
displayedPage = _useState12[0],
|
3728
|
+
setDisplayedPage = _useState12[1];
|
3729
|
+
var _useState13 = React.useState(false),
|
3730
|
+
isExiting = _useState13[0],
|
3731
|
+
setIsExiting = _useState13[1];
|
3732
3732
|
React.useEffect(function () {
|
3733
3733
|
if (init) {
|
3734
3734
|
context["goto"](init);
|
@@ -3737,24 +3737,27 @@ var SitePage = function SitePage(_ref8) {
|
|
3737
3737
|
}
|
3738
3738
|
}, []);
|
3739
3739
|
React.useEffect(function () {
|
3740
|
-
if (page !==
|
3741
|
-
|
3742
|
-
|
3743
|
-
|
3744
|
-
|
3745
|
-
|
3746
|
-
|
3747
|
-
}, 300);
|
3740
|
+
if (page !== displayedPage) {
|
3741
|
+
setIsExiting(true);
|
3742
|
+
|
3743
|
+
// Esperamos a que la animación de salida termine
|
3744
|
+
var timeout = setTimeout(function () {
|
3745
|
+
setDisplayedPage(page);
|
3746
|
+
setIsExiting(false);
|
3748
3747
|
}, 300);
|
3749
|
-
|
3748
|
+
return function () {
|
3749
|
+
return clearTimeout(timeout);
|
3750
|
+
};
|
3750
3751
|
}
|
3751
3752
|
}, [page]);
|
3752
|
-
var
|
3753
|
-
|
3753
|
+
var allChildren = React__default["default"].Children.toArray(children);
|
3754
|
+
var current = allChildren.find(function (child) {
|
3755
|
+
var _child$props;
|
3756
|
+
return ((_child$props = child.props) == null ? void 0 : _child$props.id) === displayedPage;
|
3754
3757
|
});
|
3755
3758
|
return /*#__PURE__*/React__default["default"].createElement("main", {
|
3756
|
-
className: "site-page-container " +
|
3757
|
-
},
|
3759
|
+
className: "site-page-container " + (isExiting ? 'page-out' : 'page-in')
|
3760
|
+
}, current);
|
3758
3761
|
};
|
3759
3762
|
|
3760
3763
|
/**
|