ywana-core8 0.1.61 → 0.1.62
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.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.js +18 -17
package/dist/index.modern.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import 'material-design-icons-iconfont/dist/material-design-icons.css';
|
2
|
-
import React, { useContext, useState, useEffect, useCallback, Fragment, useRef, useMemo
|
2
|
+
import React, { useContext, useState, useEffect, useCallback, Fragment, useRef, useMemo } from 'react';
|
3
3
|
import ResumableJS from 'resumablejs';
|
4
4
|
import RSwitch from 'react-switch';
|
5
5
|
import { Store, ReactNotifications } from 'react-notifications-component';
|
@@ -3715,11 +3715,11 @@ var SitePage = function SitePage(_ref8) {
|
|
3715
3715
|
var context = useContext(SiteContext);
|
3716
3716
|
var page = context.page;
|
3717
3717
|
var _useState12 = useState(page),
|
3718
|
-
|
3719
|
-
|
3720
|
-
var _useState13 = useState(
|
3721
|
-
|
3722
|
-
|
3718
|
+
displayedPage = _useState12[0],
|
3719
|
+
setDisplayedPage = _useState12[1];
|
3720
|
+
var _useState13 = useState(false),
|
3721
|
+
isExiting = _useState13[0],
|
3722
|
+
setIsExiting = _useState13[1];
|
3723
3723
|
useEffect(function () {
|
3724
3724
|
if (init) {
|
3725
3725
|
context["goto"](init);
|
@@ -3728,24 +3728,27 @@ var SitePage = function SitePage(_ref8) {
|
|
3728
3728
|
}
|
3729
3729
|
}, []);
|
3730
3730
|
useEffect(function () {
|
3731
|
-
if (page !==
|
3732
|
-
|
3733
|
-
|
3734
|
-
|
3735
|
-
|
3736
|
-
|
3737
|
-
|
3738
|
-
}, 300);
|
3731
|
+
if (page !== displayedPage) {
|
3732
|
+
setIsExiting(true);
|
3733
|
+
|
3734
|
+
// Esperamos a que la animación de salida termine
|
3735
|
+
var timeout = setTimeout(function () {
|
3736
|
+
setDisplayedPage(page);
|
3737
|
+
setIsExiting(false);
|
3739
3738
|
}, 300);
|
3740
|
-
|
3739
|
+
return function () {
|
3740
|
+
return clearTimeout(timeout);
|
3741
|
+
};
|
3741
3742
|
}
|
3742
3743
|
}, [page]);
|
3743
|
-
var
|
3744
|
-
|
3744
|
+
var allChildren = React.Children.toArray(children);
|
3745
|
+
var current = allChildren.find(function (child) {
|
3746
|
+
var _child$props;
|
3747
|
+
return ((_child$props = child.props) == null ? void 0 : _child$props.id) === displayedPage;
|
3745
3748
|
});
|
3746
3749
|
return /*#__PURE__*/React.createElement("main", {
|
3747
|
-
className: "site-page-container " +
|
3748
|
-
},
|
3750
|
+
className: "site-page-container " + (isExiting ? 'page-out' : 'page-in')
|
3751
|
+
}, current);
|
3749
3752
|
};
|
3750
3753
|
|
3751
3754
|
/**
|