ywana-core8 0.1.58 → 0.1.60

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.
@@ -1,10 +1,9 @@
1
1
  import 'material-design-icons-iconfont/dist/material-design-icons.css';
2
- import React, { useContext, useState, useEffect, useCallback, Fragment, useRef, useMemo } from 'react';
2
+ import React, { useContext, useState, useEffect, useCallback, Fragment, useRef, useMemo, Children } from 'react';
3
3
  import ResumableJS from 'resumablejs';
4
4
  import RSwitch from 'react-switch';
5
5
  import { Store, ReactNotifications } from 'react-notifications-component';
6
6
  import 'react-notifications-component/dist/theme.css';
7
- import motion from 'framer-motion/dist/framer-motion.cjs';
8
7
  import moment$1 from 'moment';
9
8
  import { extendMoment } from 'moment-range';
10
9
  import 'moment/locale/es';
@@ -3357,6 +3356,7 @@ function useHashPage(defaultPage) {
3357
3356
  history = _useState2[0],
3358
3357
  setHistory = _useState2[1];
3359
3358
  var _useState3 = useState("left"),
3359
+ direction = _useState3[0],
3360
3360
  setDirection = _useState3[1];
3361
3361
  var isFirstLoad = useRef(true);
3362
3362
  useEffect(function () {
@@ -3404,13 +3404,11 @@ function useHashPage(defaultPage) {
3404
3404
  page: page,
3405
3405
  "goto": _goto,
3406
3406
  goBack: goBack,
3407
- history: history
3407
+ history: history,
3408
+ direction: direction
3408
3409
  };
3409
3410
  }
3410
3411
 
3411
- var AnimatePresence = motion.AnimatePresence,
3412
- MotionDiv = motion.motion;
3413
-
3414
3412
  /**
3415
3413
  * Site Provider
3416
3414
  */
@@ -3454,7 +3452,8 @@ var SiteProvider = function SiteProvider(_ref) {
3454
3452
  var _useHashPage = useHashPage(),
3455
3453
  page = _useHashPage.page,
3456
3454
  _goto = _useHashPage["goto"],
3457
- goBack = _useHashPage.goBack;
3455
+ goBack = _useHashPage.goBack,
3456
+ direction = _useHashPage.direction;
3458
3457
  var value = {
3459
3458
  lang: lang,
3460
3459
  setLang: setLang,
@@ -3492,6 +3491,7 @@ var SiteProvider = function SiteProvider(_ref) {
3492
3491
  page: page,
3493
3492
  "goto": _goto,
3494
3493
  goBack: goBack,
3494
+ direction: direction,
3495
3495
  dialog: dialog,
3496
3496
  openDialog: function openDialog(dialog) {
3497
3497
  setDialog(dialog);
@@ -3713,8 +3713,13 @@ var SitePage = function SitePage(_ref8) {
3713
3713
  var children = _ref8.children,
3714
3714
  init = _ref8.init;
3715
3715
  var context = useContext(SiteContext);
3716
- var page = context.page,
3717
- direction = context.direction;
3716
+ var page = context.page;
3717
+ var _useState12 = useState(page),
3718
+ renderedPage = _useState12[0],
3719
+ setRenderedPage = _useState12[1];
3720
+ var _useState13 = useState(''),
3721
+ transitionClass = _useState13[0],
3722
+ setTransitionClass = _useState13[1];
3718
3723
  useEffect(function () {
3719
3724
  if (init) {
3720
3725
  context["goto"](init);
@@ -3722,32 +3727,25 @@ var SitePage = function SitePage(_ref8) {
3722
3727
  context["goto"]("EMPTY");
3723
3728
  }
3724
3729
  }, []);
3725
- var currentPage = React.Children.toArray(children).filter(function (child) {
3726
- return child.props ? child.props.id === page : false;
3730
+ useEffect(function () {
3731
+ if (page !== renderedPage) {
3732
+ setTransitionClass("page-out-" + context.direction);
3733
+ setTimeout(function () {
3734
+ setTransitionClass("page-in-" + context.direction);
3735
+ setRenderedPage(page);
3736
+ setTimeout(function () {
3737
+ setTransitionClass('');
3738
+ }, 300);
3739
+ }, 300);
3740
+ setRenderedPage(page);
3741
+ }
3742
+ }, [page]);
3743
+ var currentPage = Children.toArray(children).filter(function (child) {
3744
+ return child.props ? child.props.id === renderedPage : false;
3727
3745
  });
3728
- var xOffset = direction === "left" ? 40 : -40;
3729
3746
  return /*#__PURE__*/React.createElement("main", {
3730
- className: "site-page-container"
3731
- }, /*#__PURE__*/React.createElement(AnimatePresence, {
3732
- exitBeforeEnter: true
3733
- }, currentPage && /*#__PURE__*/React.createElement(MotionDiv, {
3734
- key: page,
3735
- initial: {
3736
- opacity: 0,
3737
- x: xOffset
3738
- },
3739
- animate: {
3740
- opacity: 1,
3741
- x: 0
3742
- },
3743
- exit: {
3744
- opacity: 0,
3745
- x: -xOffset
3746
- },
3747
- transition: {
3748
- duration: 0.3
3749
- }
3750
- }, currentPage)));
3747
+ className: "site-page-container " + transitionClass
3748
+ }, currentPage);
3751
3749
  };
3752
3750
 
3753
3751
  /**
@@ -3933,10 +3931,10 @@ var PageLink = function PageLink(_ref) {
3933
3931
  _ref$style = _ref.style,
3934
3932
  style = _ref$style === void 0 ? {} : _ref$style;
3935
3933
  var _useContext = useContext(SiteContext),
3936
- _goto2 = _useContext["goto"];
3934
+ _goto = _useContext["goto"];
3937
3935
  var handleClick = function handleClick(e) {
3938
3936
  e.preventDefault();
3939
- _goto2(page);
3937
+ _goto(page);
3940
3938
  };
3941
3939
  return /*#__PURE__*/React.createElement("a", {
3942
3940
  href: "#" + page,
@@ -12844,5 +12842,5 @@ var isFunction = function isFunction(value) {
12844
12842
  return value && (Object.prototype.toString.call(value) === "[object Function]" || "function" === typeof value || value instanceof Function);
12845
12843
  };
12846
12844
 
12847
- export { Accordion, ActionButton, Avatar, Button, Calendar, ChangeUserPasswordAction, ChangeUserPasswordDialog, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, ForgetUserPasswordAction, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LOGIN_API, LOGIN_CONTEXT, LOGIN_DICTIONARY, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageLink, PageProvider, PasswordEditor, PasswordField, Planner, Planner2, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UnlockUserAction, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, validatePassword };
12845
+ export { Accordion, ActionButton, Avatar, Button, Calendar, ChangeUserPasswordAction, ChangeUserPasswordDialog, CheckBox, Chip, Chips, CircularProgress, CollectionAPI$1 as CollectionAPI, CollectionAPI as CollectionAPI2, CollectionContext$1 as CollectionContext, CollectionContext as CollectionContext2, CollectionEditor$2 as CollectionEditor, CollectionFilters$1 as CollectionFilters, CollectionPage$1 as CollectionPage, CollectionPage as CollectionPage2, CollectionTree, ColorField, Content, ContentEditor, ContentForm, ContentViewer, CreateContentDialog, DataTable, DateRange, Dialog, DropDown, DynamicForm, EditContentDialog, EmptyMessage, FORMATS$1 as FORMATS, FieldEditor, FileExplorer, FileExplorerView, FileGridItem, FilesGridView, FilesSearchBox, FilesTableView, FoldersTreeView, ForgetUserPasswordAction, Form, HTTPClient, Header, Icon, ImageViewer, Kanban, KanbanCard, KanbanColumn, KanbanHeader, KanbanSwimlane, LOGIN_API, LOGIN_CONTEXT, LOGIN_DICTIONARY, LinearProgress, List, ListEditor, LoginBox, Menu, MenuIcon, MenuItem, MenuSeparator, MonthCalendar, MultiSelector, Page, PageContext, PageLink, PageProvider, PasswordEditor, PasswordField, Planner, Planner2, Property, RadioButton, ResetPasswordBox, Section, Session, Site, SiteContext, SiteProvider, Stack, Switch, Switch2, TASK_STATES, TEXTFORMATS, TYPES$1 as TYPES, Tab, TabbedContentEditor, TabbedTablePage, TabbedView, TableEditor$2 as TableEditor, TablePage, TablePage2, Tabs, TaskContext, TaskContextProvider, TaskMonitor, TaskProgress, Text, TextArea, TextField, Thumbnail, ToggleButton, TokenField, Tooltip, Tree, TreeItem, TreeNode, TreededContentEditor, UnlockUserAction, UploadArea, UploadDialog, UploadFile$1 as UploadFile, UploadForm, UploadIcon, Uploader, View, Viewer, WaitScreen, Wizard, WizardContext, isEmpty, isFunction, useHashPage, validatePassword };
12848
12846
  //# sourceMappingURL=index.modern.js.map