@admin-layout/gluestack-ui-mobile 7.3.8-alpha.8 → 8.5.3-alpha.0

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 (100) hide show
  1. package/CHANGELOG.md +1 -17
  2. package/lib/components/ApplicationErrorFillWrapper.js +1 -1
  3. package/lib/components/ApplicationErrorFillWrapper.js.map +1 -1
  4. package/lib/components/ApplicationErrorHandler.js +3 -3
  5. package/lib/components/ApplicationErrorHandler.js.map +1 -1
  6. package/lib/components/AuthWrapper.d.ts +1 -0
  7. package/lib/components/AuthWrapper.js +27 -0
  8. package/lib/components/AuthWrapper.js.map +1 -0
  9. package/lib/components/ErrorBounday.js.map +1 -1
  10. package/lib/components/Fallback.js +1 -2
  11. package/lib/components/Fallback.js.map +1 -1
  12. package/lib/components/Layout/components/BasicLayout.js +3 -1
  13. package/lib/components/Layout/components/BasicLayout.js.map +1 -1
  14. package/lib/components/Layout/components/BottomTabBar.d.ts +1 -0
  15. package/lib/components/Layout/components/BottomTabBar.js +11 -24
  16. package/lib/components/Layout/components/BottomTabBar.js.map +1 -1
  17. package/lib/components/Layout/components/Drawer.d.ts +1 -0
  18. package/lib/components/Layout/components/Drawer.js +101 -117
  19. package/lib/components/Layout/components/Drawer.js.map +1 -1
  20. package/lib/components/Layout/components/Header.d.ts +2 -1
  21. package/lib/components/Layout/components/Header.js +5 -4
  22. package/lib/components/Layout/components/Header.js.map +1 -1
  23. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js +26 -19
  24. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js.map +1 -1
  25. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js +5 -13
  26. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js.map +1 -1
  27. package/lib/components/Layout/components/SideBar.js +2 -2
  28. package/lib/components/Layout/components/SideBar.js.map +1 -1
  29. package/lib/components/Layout/components/util.js.map +1 -1
  30. package/lib/components/Layout/compute.js +51 -52
  31. package/lib/components/Layout/compute.js.map +1 -1
  32. package/lib/components/NavigationComponent.js +24 -31
  33. package/lib/components/NavigationComponent.js.map +1 -1
  34. package/lib/components/ToastAlert.js +1 -1
  35. package/lib/components/ToastAlert.js.map +1 -1
  36. package/lib/components/UnAuthenticatedComponent.d.ts +3 -0
  37. package/lib/components/UnAuthenticatedComponent.js +16 -0
  38. package/lib/components/UnAuthenticatedComponent.js.map +1 -0
  39. package/lib/components/index.d.ts +1 -0
  40. package/lib/components/index.js +1 -0
  41. package/lib/components/index.js.map +1 -1
  42. package/lib/components/with-interactions-lifecycle-managed.d.ts +4 -0
  43. package/lib/components/with-interactions-lifecycle-managed.js +50 -0
  44. package/lib/components/with-interactions-lifecycle-managed.js.map +1 -0
  45. package/lib/components/with-interactions-managed.js +2 -2
  46. package/lib/components/with-interactions-managed.js.map +1 -1
  47. package/lib/config/config.js +2 -2
  48. package/lib/config/config.js.map +1 -1
  49. package/lib/config/i18next.js +1 -2
  50. package/lib/config/i18next.js.map +1 -1
  51. package/lib/containers/layout/BasicLayout.d.ts +2 -2
  52. package/lib/containers/layout/BasicLayout.js +3 -3
  53. package/lib/containers/layout/BasicLayout.js.map +1 -1
  54. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +2 -2
  55. package/lib/containers/layout/DrawerBottomNavigationConfig.js +2 -2
  56. package/lib/containers/layout/DrawerBottomNavigationConfig.js.map +1 -1
  57. package/lib/containers/layout/DrawerConfig.d.ts +1 -1
  58. package/lib/containers/layout/DrawerConfig.js +1 -1
  59. package/lib/containers/layout/DrawerConfig.js.map +1 -1
  60. package/lib/containers/layout/Lifecycle.js +2 -14
  61. package/lib/containers/layout/Lifecycle.js.map +1 -1
  62. package/lib/containers/layout/ProLayout.js +4 -5
  63. package/lib/containers/layout/ProLayout.js.map +1 -1
  64. package/lib/hooks/use-after-interactions.d.ts +0 -1
  65. package/lib/hooks/use-after-interactions.js +1 -1
  66. package/lib/hooks/use-after-interactions.js.map +1 -1
  67. package/lib/hooks/useIsReady.js.map +1 -1
  68. package/lib/hooks/useLayoutSetting/index.js +16 -14
  69. package/lib/hooks/useLayoutSetting/index.js.map +1 -1
  70. package/lib/index.d.ts +3 -1
  71. package/lib/index.js +3 -1
  72. package/lib/index.js.map +1 -1
  73. package/lib/layout.json +153 -0
  74. package/lib/redux/settings.d.ts +8 -8
  75. package/lib/redux/settings.js +8 -2
  76. package/lib/redux/settings.js.map +1 -1
  77. package/lib/utils/generateAppNavigations.d.mts +43 -0
  78. package/lib/utils/generateAppNavigations.mjs +958 -0
  79. package/lib/utils/generateAppNavigations.mjs.map +1 -0
  80. package/lib/utils/getReplacedRouteConfig.d.ts +11 -0
  81. package/lib/utils/getReplacedRouteConfig.js +276 -0
  82. package/lib/utils/getReplacedRouteConfig.js.map +1 -0
  83. package/lib/utils/getReplacedRouteConfig.mjs +265 -0
  84. package/lib/utils/routeConfigKeyReplace.js +17 -19
  85. package/lib/utils/routeConfigKeyReplace.js.map +1 -1
  86. package/package.json +7 -5
  87. package/src/components/ApplicationErrorHandler.tsx +26 -21
  88. package/src/components/AuthWrapper.tsx +29 -0
  89. package/src/components/Layout/components/BottomTabBar.tsx +2 -0
  90. package/src/components/Layout/components/Drawer.tsx +4 -1
  91. package/src/components/Layout/components/Header.tsx +7 -3
  92. package/src/components/UnAuthenticatedComponent.tsx +38 -0
  93. package/src/components/index.ts +1 -0
  94. package/src/components/with-interactions-lifecycle-managed.tsx +105 -0
  95. package/src/index.ts +4 -1
  96. package/src/layout.json +153 -0
  97. package/src/utils/generateAppNavigations.mjs +990 -0
  98. package/src/utils/getReplacedRouteConfig.mjs_ok +317 -0
  99. package/src/utils/getReplacedRouteConfig.ts +330 -0
  100. package/tsconfig.json +4 -1
@@ -0,0 +1,105 @@
1
+ import React, { ComponentType } from 'react';
2
+ // import { Transition, Transitioning } from 'react-native-reanimated';
3
+ import { Lifecycle } from '../containers/layout/Lifecycle';
4
+ import { LifecyclePhase } from '@workbench-stack/core';
5
+ import Animated, { useSharedValue, withTiming } from 'react-native-reanimated';
6
+ import { useAfterInteractions } from '../hooks/use-after-interactions';
7
+ import { Box, Spinner, SafeAreaView, Center } from '@gluestack-ui/themed';
8
+ import hoistNonReactStatics from 'hoist-non-react-statics';
9
+ import { Platform } from 'react-native';
10
+
11
+ const LoadingComponent = () => (
12
+ // <SafeAreaView flex={1}>
13
+ <Center flex={1} justifyContent={'center'} alignItems={'center'}>
14
+ {<Spinner color={'$blue500'} />}
15
+ </Center>
16
+ // </SafeAreaView>
17
+ );
18
+
19
+ const IntractionComponent = ({ children, interationTime }) => {
20
+ const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions();
21
+ React.useEffect(() => {
22
+ if (interationTime) setInteractionsTimeOut(interationTime);
23
+ }, [interationTime]);
24
+ console.log('interactionsComplete', interactionsComplete);
25
+ return (
26
+ <>
27
+ {interactionsComplete ? (
28
+ { children }
29
+ ) : (
30
+ <Animated.View
31
+ style={{
32
+ flex: 1,
33
+ opacity: opacity.value,
34
+ transform: [{ scale: opacity.value }],
35
+ }}
36
+ >
37
+ <LoadingComponent />
38
+ </Animated.View>
39
+ )}
40
+ </>
41
+ );
42
+ };
43
+
44
+ const IntractionWithLifeCycleComponent = ({ children, interationTime }) => {
45
+ const { interactionsComplete, opacity, setInteractionsTimeOut } = useAfterInteractions();
46
+ React.useEffect(() => {
47
+ if (interationTime) setInteractionsTimeOut(interationTime);
48
+ }, [interationTime]);
49
+ console.log('interactionsComplete', interactionsComplete);
50
+ return (
51
+ <>
52
+ {interactionsComplete ? (
53
+ <Lifecycle renderWhenPhase={LifecyclePhase.Restored} loadingRenderer={LoadingComponent}>
54
+ {children}
55
+ </Lifecycle>
56
+ ) : (
57
+ <Animated.View
58
+ style={{
59
+ flex: 1,
60
+ opacity: opacity.value,
61
+ transform: [{ scale: opacity.value }],
62
+ }}
63
+ >
64
+ <LoadingComponent />
65
+ </Animated.View>
66
+ )}
67
+ </>
68
+ );
69
+ };
70
+
71
+ export function withInteractionsManaged(component: any, interationTime?: number) {
72
+ return (
73
+ <>
74
+ {Platform.OS === 'ios' ? (
75
+ { component }
76
+ ) : (
77
+ <IntractionComponent interationTime={interationTime}>{component}</IntractionComponent>
78
+ )}
79
+ </>
80
+ );
81
+ }
82
+
83
+ export function withLifeCycleInteractionsManaged(component: any, interationTime?: number) {
84
+ return (
85
+ <>
86
+ {Platform.OS === 'ios' ? (
87
+ <Lifecycle renderWhenPhase={LifecyclePhase.Restored} loadingRenderer={LoadingComponent}>
88
+ {component}
89
+ </Lifecycle>
90
+ ) : (
91
+ <IntractionWithLifeCycleComponent interationTime={interationTime}>
92
+ {component}
93
+ </IntractionWithLifeCycleComponent>
94
+ )}
95
+ </>
96
+ );
97
+ }
98
+
99
+ export function withLifeCycleManaged(component: any) {
100
+ return (
101
+ <Lifecycle renderWhenPhase={LifecyclePhase.Restored} loadingRenderer={LoadingComponent}>
102
+ {component}
103
+ </Lifecycle>
104
+ );
105
+ }
package/src/index.ts CHANGED
@@ -5,11 +5,12 @@ import { settingsReducer } from './redux/settings';
5
5
  import { useAfterInteractions } from './hooks/use-after-interactions';
6
6
  import useIsReady from './hooks/useIsReady';
7
7
  import routeConfigKeyReplace from './utils/routeConfigKeyReplace';
8
+ import {getReplacedRouteConfig} from './utils/getReplacedRouteConfig'
8
9
  import LayoutFeature, { ProLayout, AppFeatures, AppLayout } from './containers/layout/module';
9
10
  import { useLayoutSetting, LayoutSettingProps } from './hooks/useLayoutSetting';
10
11
  import i18next from './config/i18next';
11
12
  import * as reactI18Next from 'react-i18next';
12
-
13
+ import layoutRouteConfig from './layout.json';
13
14
 
14
15
  export * from './components';
15
16
  export * from './containers/layout/Lifecycle';
@@ -25,6 +26,8 @@ export {
25
26
  useLayoutSetting,
26
27
  LayoutSettingProps,
27
28
  routeConfigKeyReplace,
29
+ getReplacedRouteConfig,
30
+ layoutRouteConfig,
28
31
  LayoutFeature,
29
32
  ProLayout,
30
33
  AppFeatures,
@@ -0,0 +1,153 @@
1
+ {
2
+ "side":{
3
+ "/":{
4
+ "key":"/",
5
+ "position": "MIDDLE",
6
+ "exact": false,
7
+ "container": {},
8
+ "name": "MainStack",
9
+ "props": {
10
+ "initialRouteName": "MainStack.Layout",
11
+ "screenOptions": {
12
+ "headerShown": false
13
+ }
14
+ },
15
+ "path": "/",
16
+ "_pathPrefix": ""
17
+ },
18
+ "/main_drawer":{
19
+ "key":"main_drawer",
20
+ "position": "MIDDLE",
21
+ "exact": false,
22
+ "container": {},
23
+ "name":"Layout",
24
+ "props":{
25
+ "initialRouteName":"MainStack.Layout.Home",
26
+ "screenOptions":{
27
+ "headerShown":true,
28
+ "swipeEnabled":true
29
+ }
30
+ },
31
+ "path":"/main_drawer",
32
+ "_pathPrefix": "/"
33
+ }
34
+ },
35
+ "bottom":{
36
+ "/":{
37
+ "key":"/",
38
+ "position": "MIDDLE",
39
+ "exact": false,
40
+ "container": {},
41
+ "name": "MainStack",
42
+ "props": {
43
+ "initialRouteName": "MainStack.Layout",
44
+ "screenOptions": {
45
+ "headerShown": false
46
+ }
47
+ },
48
+ "path": "/",
49
+ "_pathPrefix": ""
50
+ },
51
+ "/bottom_tab":{
52
+ "key":"bottom_tab",
53
+ "position": "MIDDLE",
54
+ "exact": false,
55
+ "container": {},
56
+ "name":"Layout",
57
+ "props":{
58
+ "initialRouteName":"MainStack.Layout.Home",
59
+ "screenOptions":{
60
+ "headerShown": true,
61
+ "title": "Home",
62
+ "headerTitle": "Home"
63
+ }
64
+ },
65
+ "path":"/bottom_tab",
66
+ "_pathPrefix": "/"
67
+ }
68
+ },
69
+ "host-bottom":{
70
+ "/":{
71
+ "key":"/",
72
+ "position": "MIDDLE",
73
+ "exact": false,
74
+ "container": {},
75
+ "name": "MainStack",
76
+ "props": {
77
+ "initialRouteName": "MainStack.Layout",
78
+ "screenOptions": {
79
+ "headerShown": false
80
+ }
81
+ },
82
+ "path": "/",
83
+ "_pathPrefix": ""
84
+ },
85
+ "/host_tab":{
86
+ "key":"host_tab",
87
+ "position": "MIDDLE",
88
+ "exact": false,
89
+ "container": {},
90
+ "name":"Layout",
91
+ "props":{
92
+ "initialRouteName":"MainStack.Layout.Home",
93
+ "screenOptions":{
94
+ "headerShown": true,
95
+ "title": "Home",
96
+ "headerTitle": "Home"
97
+ }
98
+ },
99
+ "path":"/host_tab",
100
+ "_pathPrefix": "/"
101
+ }
102
+ },
103
+ "mixSide":{
104
+ "/":{
105
+ "key":"/",
106
+ "position": "MIDDLE",
107
+ "exact": false,
108
+ "container": {},
109
+ "name": "MainStack",
110
+ "props": {
111
+ "initialRouteName": "MainStack.Layout",
112
+ "screenOptions": {
113
+ "headerShown": false
114
+ }
115
+ },
116
+ "path": "/",
117
+ "_pathPrefix": ""
118
+ },
119
+ "/main_drawer":{
120
+ "key":"main_drawer",
121
+ "position": "MIDDLE",
122
+ "exact": false,
123
+ "container": {},
124
+ "name":"Layout",
125
+ "props":{
126
+ "initialRouteName":"MainStack.Layout",
127
+ "screenOptions":{
128
+ "headerShown":true,
129
+ "swipeEnabled":true
130
+ }
131
+ },
132
+ "path":"/main_drawer",
133
+ "_pathPrefix": "/"
134
+ },
135
+ "/main_drawer/bottom_tab":{
136
+ "key":"bottom_tab",
137
+ "position": "MIDDLE",
138
+ "exact": false,
139
+ "container": {},
140
+ "name":"MainBottomTab",
141
+ "props":{
142
+ "initialRouteName":"MainStack.Layout.Home",
143
+ "screenOptions":{
144
+ "headerShown": false,
145
+ "title": "Home",
146
+ "headerTitle": "Home"
147
+ }
148
+ },
149
+ "path":"/bottom_tab",
150
+ "_pathPrefix": "/"
151
+ }
152
+ }
153
+ }