@admin-layout/gluestack-ui-mobile 9.0.2-alpha.4 → 9.0.4-alpha.102

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +112 -0
  2. package/lib/components/AuthWrapper.d.ts +4 -1
  3. package/lib/components/AuthWrapper.js +6 -5
  4. package/lib/components/AuthWrapper.js.map +1 -1
  5. package/lib/components/Layout/components/Drawer.js +9 -9
  6. package/lib/components/Layout/components/Drawer.js.map +1 -1
  7. package/lib/components/Layout/components/Header.js +28 -15
  8. package/lib/components/Layout/components/Header.js.map +1 -1
  9. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js +14 -6
  10. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js.map +1 -1
  11. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.d.ts +1 -1
  12. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js +55 -15
  13. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js.map +1 -1
  14. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js +1 -1
  15. package/lib/components/NavigationComponent.js +11 -2
  16. package/lib/components/NavigationComponent.js.map +1 -1
  17. package/lib/components/WithConfiguration.d.ts +18 -0
  18. package/lib/components/WithConfiguration.js +42 -0
  19. package/lib/components/WithConfiguration.js.map +1 -0
  20. package/lib/components/WithPermission.d.ts +31 -0
  21. package/lib/components/WithPermission.js +53 -0
  22. package/lib/components/WithPermission.js.map +1 -0
  23. package/lib/components/WithPolicy.d.ts +13 -0
  24. package/lib/components/WithPolicy.js +18 -0
  25. package/lib/components/WithPolicy.js.map +1 -0
  26. package/lib/components/index.d.ts +5 -0
  27. package/lib/components/index.js +5 -0
  28. package/lib/components/index.js.map +1 -1
  29. package/lib/components/usePermissionAutoFetch.d.ts +75 -0
  30. package/lib/components/usePermissionAutoFetch.js +63 -0
  31. package/lib/components/usePermissionAutoFetch.js.map +1 -0
  32. package/lib/components/useSetting.d.ts +25 -0
  33. package/lib/components/useSetting.js +87 -0
  34. package/lib/components/useSetting.js.map +1 -0
  35. package/lib/components/with-interactions-lifecycle-managed.d.ts +3 -3
  36. package/lib/components/with-interactions-lifecycle-managed.js +23 -15
  37. package/lib/components/with-interactions-lifecycle-managed.js.map +1 -1
  38. package/lib/containers/layout/BasicLayout.d.ts +3 -3
  39. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +393 -88
  40. package/lib/containers/layout/DrawerConfig.d.ts +266 -60
  41. package/lib/containers/layout/module.js +2 -2
  42. package/lib/containers/layout/module.js.map +1 -1
  43. package/lib/redux/settings.d.ts +8 -8
  44. package/lib/utils/ThemeColor.js +11 -1
  45. package/lib/utils/ThemeColor.js.map +1 -1
  46. package/lib/utils/generateMobileNavigations.d.ts +4 -10
  47. package/lib/utils/generateMobileNavigations.js +720 -310
  48. package/lib/utils/generateMobileNavigations.js.map +1 -1
  49. package/package.json +7 -7
  50. package/src/components/AuthWrapper.tsx +30 -17
  51. package/src/components/Layout/components/Drawer.tsx +19 -20
  52. package/src/components/Layout/components/Header.tsx +154 -93
  53. package/src/components/Layout/components/SettingDrawer/LayoutButton.tsx +27 -13
  54. package/src/components/Layout/components/SettingDrawer/SettingDrawer.tsx +151 -48
  55. package/src/components/Layout/components/SettingDrawer/ThemeColorButton.tsx +2 -2
  56. package/src/components/NavigationComponent.tsx +9 -2
  57. package/src/components/WithConfiguration.tsx +74 -0
  58. package/src/components/WithPermission.tsx +81 -0
  59. package/src/components/WithPolicy.tsx +32 -0
  60. package/src/components/index.ts +6 -1
  61. package/src/components/usePermissionAutoFetch.tsx +78 -0
  62. package/src/components/useSetting.tsx +137 -0
  63. package/src/components/with-interactions-lifecycle-managed.tsx +62 -26
  64. package/src/containers/layout/module.ts +2 -2
  65. package/src/utils/ThemeColor.ts +11 -1
  66. package/src/utils/generateMobileNavigations.ts +780 -290
  67. package/lib/components/Layout/components/util.d.ts +0 -1
  68. package/lib/components/Layout/components/util.js +0 -15
  69. package/lib/components/Layout/components/util.js.map +0 -1
  70. package/src/components/Layout/components/util.ts +0 -14
@@ -1,22 +1,26 @@
1
1
  import React from 'react';
2
- // import { Transition, Transitioning } from 'react-native-reanimated';
3
2
  import { Lifecycle } from '../containers/layout/Lifecycle';
4
3
  import Animated from 'react-native-reanimated';
5
4
  import { useAfterInteractions } from '../hooks/use-after-interactions';
6
5
  import { Spinner, Center } from '@gluestack-ui/themed';
7
6
  import { Platform } from 'react-native';
8
- const LoadingComponent = () => (
9
- // <SafeAreaView flex={1}>
10
- React.createElement(Center, { flex: 1, justifyContent: 'center', alignItems: 'center' }, React.createElement(Spinner, { color: '$blue500' }))
11
- // </SafeAreaView>
12
- );
7
+ import { isUserAuthenticated } from '@adminide-stack/user-auth0-client';
8
+ const LoadingComponent = () => (React.createElement(Center, { flex: 1, justifyContent: 'center', alignItems: 'center' }, React.createElement(Spinner, { color: '$blue500' })));
9
+ const LifecycleComponent = ({ children }) => {
10
+ const { authenticated } = isUserAuthenticated();
11
+ if (authenticated) {
12
+ return (React.createElement(Lifecycle, { renderWhenPhase: 3 /* LifecyclePhase.Restored */, loadingRenderer: LoadingComponent }, children));
13
+ }
14
+ else {
15
+ return React.createElement(React.Fragment, null, children);
16
+ }
17
+ };
13
18
  const IntractionComponent = ({ children, interationTime }) => {
14
19
  const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions();
15
20
  React.useEffect(() => {
16
21
  if (interationTime)
17
22
  setInteractionsTimeOut(interationTime);
18
23
  }, [interationTime]);
19
- console.log('interactionsComplete', interactionsComplete);
20
24
  return (React.createElement(React.Fragment, null, interactionsComplete ? ({ children }) : (React.createElement(Animated.View, { style: {
21
25
  flex: 1,
22
26
  opacity: opacity.value,
@@ -30,21 +34,25 @@ const IntractionWithLifeCycleComponent = ({ children, interationTime }) => {
30
34
  if (interationTime)
31
35
  setInteractionsTimeOut(interationTime);
32
36
  }, [interationTime]);
33
- console.log('interactionsComplete', interactionsComplete);
34
- return (React.createElement(React.Fragment, null, interactionsComplete ? (React.createElement(Lifecycle, { renderWhenPhase: 3 /* LifecyclePhase.Restored */, loadingRenderer: LoadingComponent }, children)) : (React.createElement(Animated.View, { style: {
37
+ return (React.createElement(React.Fragment, null, interactionsComplete ? (React.createElement(LifecycleComponent, null, children)) : (React.createElement(Animated.View, { style: {
35
38
  flex: 1,
36
39
  opacity: opacity.value,
37
40
  transform: [{ scale: opacity.value }],
38
41
  } },
39
42
  React.createElement(LoadingComponent, null)))));
40
43
  };
41
- export function withInteractionsManaged(component, interationTime) {
42
- return (React.createElement(React.Fragment, null, Platform.OS === 'ios' ? ({ component }) : (React.createElement(IntractionComponent, { interationTime: interationTime }, component))));
44
+ export function withInteractionsManaged(component, interationTime, permissionKeys = null) {
45
+ return (React.createElement(React.Fragment, null, Platform.OS === 'ios' ? (React.createElement(React.Fragment, null,
46
+ React.createElement(React.Fragment, null, component))) : (React.createElement(IntractionComponent, { interationTime: interationTime },
47
+ React.createElement(React.Fragment, null, component)))));
43
48
  }
44
- export function withLifeCycleInteractionsManaged(component, interationTime) {
45
- return (React.createElement(React.Fragment, null, Platform.OS === 'ios' ? (React.createElement(Lifecycle, { renderWhenPhase: 3 /* LifecyclePhase.Restored */, loadingRenderer: LoadingComponent }, component)) : (React.createElement(IntractionWithLifeCycleComponent, { interationTime: interationTime }, component))));
49
+ export function withLifeCycleInteractionsManaged(component, interationTime, permissionKeys = null) {
50
+ return (React.createElement(React.Fragment, null, Platform.OS === 'ios' ? (React.createElement(LifecycleComponent, null,
51
+ React.createElement(React.Fragment, null, component))) : (React.createElement(IntractionWithLifeCycleComponent, { interationTime: interationTime },
52
+ React.createElement(React.Fragment, null, component)))));
46
53
  }
47
- export function withLifeCycleManaged(component) {
48
- return (React.createElement(Lifecycle, { renderWhenPhase: 3 /* LifecyclePhase.Restored */, loadingRenderer: LoadingComponent }, component));
54
+ export function withLifeCycleManaged(component, permissionKeys = null) {
55
+ return (React.createElement(LifecycleComponent, null,
56
+ React.createElement(React.Fragment, null, component)));
49
57
  }
50
58
  //# sourceMappingURL=with-interactions-lifecycle-managed.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"with-interactions-lifecycle-managed.js","sourceRoot":"","sources":["../../src/components/with-interactions-lifecycle-managed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,QAAwC,MAAM,yBAAyB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAO,OAAO,EAAgB,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC;AAC3B,0BAA0B;AAC1B,oBAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,IAC1D,oBAAC,OAAO,IAAC,KAAK,EAAE,UAAU,GAAI,CAC1B;AACT,kBAAkB;CACrB,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,EAAE,QAAQ,EAAE,cAAc,EAAE,EAAE,EAAE;IACzD,MAAM,EAAE,oBAAoB,EAAE,OAAO,EAAE,sBAAsB,EAAE,GAAG,oBAAoB,EAAE,CAAC;IACzF,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACjB,IAAI,cAAc;YAAE,sBAAsB,CAAC,cAAc,CAAC,CAAC;IAC/D,CAAC,EAAE,CAAC,cAAc,CAAC,CAAC,CAAC;IACrB,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAE,oBAAoB,CAAC,CAAC;IAC1D,OAAO,CACH,0CACK,oBAAoB,CAAC,CAAC,CAAC,CACpB,EAAE,QAAQ,EAAE,CACf,CAAC,CAAC,CAAC,CACA,oBAAC,QAAQ,CAAC,I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AAS,CAAuB,CACzF,CACF,CACN,CAAC;AACN,CAAC;AAED,MAAM,UAAU,gCAAgC,CAAC,SAAc,EAAE,cAAuB;IACpF,OAAO,CACH,0CACK,QAAQ,CAAC,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,CACrB,oBAAC,SAAS,IAAC,eAAe,mCAA2B,eAAe,EAAE,gBAAgB,IACjF,SAAS,CACF,CACf,CAAC,CAAC,CAAC,CACA,oBAAC,gCAAgC,IAAC,cAAc,EAAE,cAAc,IAC3D,SAAS,CACqB,CACtC,CACF,CACN,CAAC;AACN,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,SAAc;IAC/C,OAAO,CACH,oBAAC,SAAS,IAAC,eAAe,mCAA2B,eAAe,EAAE,gBAAgB,IACjF,SAAS,CACF,CACf,CAAC;AACN,CAAC"}
1
+ {"version":3,"file":"with-interactions-lifecycle-managed.js","sourceRoot":"","sources":["../../src/components/with-interactions-lifecycle-managed.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,OAAO,QAAQ,MAAM,yBAAyB,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC,OAAO,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAExE,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,CAC3B,oBAAC,MAAM,IAAC,IAAI,EAAE,CAAC,EAAE,cAAc,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,IAC1D,oBAAC,OAAO,IAAC,KAAK,EAAE,UAAU,GAAI,CAC1B,CACZ,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAAsB,EAAE,EAAE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ent<React.FC<any>,
7
7
  [x: string]: any;
8
8
  [x: number]: any;
9
9
  [x: symbol]: any;
10
- context?: React.Context<import("react-redux").ReactReduxContextValue<any, UnknownAction>>;
11
- store?: import("redux").Store;
10
+ context?: React.Context<import("react-redux").ReactReduxContextValue<any, import("redux").UnknownAction>>;
11
+ store?: import("redux").Store<any, import("redux").UnknownAction, unknown>;
12
12
  } | {
13
13
  [x: string]: any;
14
14
  [x: number]: any;
15
15
  [x: symbol]: any;
16
- store?: import("redux").Store;
16
+ store?: import("redux").Store<any, import("redux").UnknownAction, unknown>;
17
17
  }>;
18
18
  export default _default;