@admin-layout/gluestack-ui-mobile 6.5.1-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 (199) hide show
  1. package/CHANGELOG.md +117 -0
  2. package/LICENSE +21 -0
  3. package/README.md +4 -0
  4. package/assets/logo.png +0 -0
  5. package/babel.config.js +26 -0
  6. package/jest-react-navigation-setup.js +14 -0
  7. package/jest.config.js +39 -0
  8. package/jest.env.js +2 -0
  9. package/lib/__tests__/prolayout-layout-feature.test.d.ts +1 -0
  10. package/lib/__tests__/prolayout-layout-feature.test.js +202 -0
  11. package/lib/__tests__/prolayout-layout-feature.test.js.map +1 -0
  12. package/lib/components/ApplicationErrorFillWrapper.d.ts +2 -0
  13. package/lib/components/ApplicationErrorFillWrapper.js +7 -0
  14. package/lib/components/ApplicationErrorFillWrapper.js.map +1 -0
  15. package/lib/components/ApplicationErrorHandler.d.ts +2 -0
  16. package/lib/components/ApplicationErrorHandler.js +24 -0
  17. package/lib/components/ApplicationErrorHandler.js.map +1 -0
  18. package/lib/components/ErrorBounday.d.ts +18 -0
  19. package/lib/components/ErrorBounday.js +22 -0
  20. package/lib/components/ErrorBounday.js.map +1 -0
  21. package/lib/components/Fallback.d.ts +6 -0
  22. package/lib/components/Fallback.js +53 -0
  23. package/lib/components/Fallback.js.map +1 -0
  24. package/lib/components/Layout/components/BasicLayout.d.ts +5 -0
  25. package/lib/components/Layout/components/BasicLayout.js +28 -0
  26. package/lib/components/Layout/components/BasicLayout.js.map +1 -0
  27. package/lib/components/Layout/components/BottomTabBar.d.ts +2 -0
  28. package/lib/components/Layout/components/BottomTabBar.js +90 -0
  29. package/lib/components/Layout/components/BottomTabBar.js.map +1 -0
  30. package/lib/components/Layout/components/Drawer.d.ts +2 -0
  31. package/lib/components/Layout/components/Drawer.js +253 -0
  32. package/lib/components/Layout/components/Drawer.js.map +1 -0
  33. package/lib/components/Layout/components/Header.d.ts +2 -0
  34. package/lib/components/Layout/components/Header.js +130 -0
  35. package/lib/components/Layout/components/Header.js.map +1 -0
  36. package/lib/components/Layout/components/Sample.d.ts +2 -0
  37. package/lib/components/Layout/components/Sample.js +7 -0
  38. package/lib/components/Layout/components/Sample.js.map +1 -0
  39. package/lib/components/Layout/components/SettingDrawer/LayoutButton.d.ts +3 -0
  40. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js +66 -0
  41. package/lib/components/Layout/components/SettingDrawer/LayoutButton.js.map +1 -0
  42. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.d.ts +2 -0
  43. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js +23 -0
  44. package/lib/components/Layout/components/SettingDrawer/SettingDrawer.js.map +1 -0
  45. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.d.ts +3 -0
  46. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js +24 -0
  47. package/lib/components/Layout/components/SettingDrawer/ThemeColorButton.js.map +1 -0
  48. package/lib/components/Layout/components/SettingDrawer/index.d.ts +1 -0
  49. package/lib/components/Layout/components/SettingDrawer/index.js +2 -0
  50. package/lib/components/Layout/components/SettingDrawer/index.js.map +1 -0
  51. package/lib/components/Layout/components/SideBar.d.ts +10 -0
  52. package/lib/components/Layout/components/SideBar.js +59 -0
  53. package/lib/components/Layout/components/SideBar.js.map +1 -0
  54. package/lib/components/Layout/components/defaultSettings.d.ts +4 -0
  55. package/lib/components/Layout/components/defaultSettings.js +16 -0
  56. package/lib/components/Layout/components/defaultSettings.js.map +1 -0
  57. package/lib/components/Layout/components/index.d.ts +4 -0
  58. package/lib/components/Layout/components/index.js +5 -0
  59. package/lib/components/Layout/components/index.js.map +1 -0
  60. package/lib/components/Layout/components/util.d.ts +1 -0
  61. package/lib/components/Layout/components/util.js +15 -0
  62. package/lib/components/Layout/components/util.js.map +1 -0
  63. package/lib/components/Layout/compute.d.ts +6 -0
  64. package/lib/components/Layout/compute.js +316 -0
  65. package/lib/components/Layout/compute.js.map +1 -0
  66. package/lib/components/Layout/compute.test.d.ts +6 -0
  67. package/lib/components/Layout/compute.test.js +120 -0
  68. package/lib/components/Layout/compute.test.js.map +1 -0
  69. package/lib/components/Layout/index.d.ts +4 -0
  70. package/lib/components/Layout/index.js +4 -0
  71. package/lib/components/Layout/index.js.map +1 -0
  72. package/lib/components/Layout/typings.d.ts +1 -0
  73. package/lib/components/Layout/typings.js +2 -0
  74. package/lib/components/Layout/typings.js.map +1 -0
  75. package/lib/components/NavigationComponent.d.ts +15 -0
  76. package/lib/components/NavigationComponent.js +120 -0
  77. package/lib/components/NavigationComponent.js.map +1 -0
  78. package/lib/components/PluginArea.d.ts +2 -0
  79. package/lib/components/PluginArea.js +8 -0
  80. package/lib/components/PluginArea.js.map +1 -0
  81. package/lib/components/ToastAlert.d.ts +12 -0
  82. package/lib/components/ToastAlert.js +17 -0
  83. package/lib/components/ToastAlert.js.map +1 -0
  84. package/lib/components/index.d.ts +9 -0
  85. package/lib/components/index.js +10 -0
  86. package/lib/components/index.js.map +1 -0
  87. package/lib/components/with-interactions-managed.d.ts +2 -0
  88. package/lib/components/with-interactions-managed.js +18 -0
  89. package/lib/components/with-interactions-managed.js.map +1 -0
  90. package/lib/config/config.d.ts +17 -0
  91. package/lib/config/config.js +18 -0
  92. package/lib/config/config.js.map +1 -0
  93. package/lib/config/index.d.ts +1 -0
  94. package/lib/config/index.js +2 -0
  95. package/lib/config/index.js.map +1 -0
  96. package/lib/constants/routes.d.ts +3 -0
  97. package/lib/constants/routes.js +5 -0
  98. package/lib/constants/routes.js.map +1 -0
  99. package/lib/containers/layout/BasicLayout.d.ts +7 -0
  100. package/lib/containers/layout/BasicLayout.js +36 -0
  101. package/lib/containers/layout/BasicLayout.js.map +1 -0
  102. package/lib/containers/layout/DrawerBottomNavigationConfig.d.ts +128 -0
  103. package/lib/containers/layout/DrawerBottomNavigationConfig.js +72 -0
  104. package/lib/containers/layout/DrawerBottomNavigationConfig.js.map +1 -0
  105. package/lib/containers/layout/DrawerConfig.d.ts +85 -0
  106. package/lib/containers/layout/DrawerConfig.js +48 -0
  107. package/lib/containers/layout/DrawerConfig.js.map +1 -0
  108. package/lib/containers/layout/Lifecycle.d.ts +13 -0
  109. package/lib/containers/layout/Lifecycle.js +18 -0
  110. package/lib/containers/layout/Lifecycle.js.map +1 -0
  111. package/lib/containers/layout/ProLayout.d.ts +5 -0
  112. package/lib/containers/layout/ProLayout.js +35 -0
  113. package/lib/containers/layout/ProLayout.js.map +1 -0
  114. package/lib/containers/layout/module.d.ts +5 -0
  115. package/lib/containers/layout/module.js +22 -0
  116. package/lib/containers/layout/module.js.map +1 -0
  117. package/lib/hooks/use-after-interactions.d.ts +6 -0
  118. package/lib/hooks/use-after-interactions.js +29 -0
  119. package/lib/hooks/use-after-interactions.js.map +1 -0
  120. package/lib/hooks/useIsReady.d.ts +2 -0
  121. package/lib/hooks/useIsReady.js +24 -0
  122. package/lib/hooks/useIsReady.js.map +1 -0
  123. package/lib/hooks/useLayoutSetting/index.d.ts +11 -0
  124. package/lib/hooks/useLayoutSetting/index.js +68 -0
  125. package/lib/hooks/useLayoutSetting/index.js.map +1 -0
  126. package/lib/index.d.ts +14 -0
  127. package/lib/index.js +26 -0
  128. package/lib/index.js.map +1 -0
  129. package/lib/interfaces/index.d.ts +1 -0
  130. package/lib/interfaces/index.js +2 -0
  131. package/lib/interfaces/index.js.map +1 -0
  132. package/lib/interfaces/settings.d.ts +4 -0
  133. package/lib/interfaces/settings.js +2 -0
  134. package/lib/interfaces/settings.js.map +1 -0
  135. package/lib/redux/settings.d.ts +80 -0
  136. package/lib/redux/settings.js +16 -0
  137. package/lib/redux/settings.js.map +1 -0
  138. package/lib/utils/ThemeColor.d.ts +8 -0
  139. package/lib/utils/ThemeColor.js +9 -0
  140. package/lib/utils/ThemeColor.js.map +1 -0
  141. package/lib/utils/routeConfigKeyReplace.d.ts +7 -0
  142. package/lib/utils/routeConfigKeyReplace.js +77 -0
  143. package/lib/utils/routeConfigKeyReplace.js.map +1 -0
  144. package/lib/utils/routeConfigKeyReplace.test.d.ts +1 -0
  145. package/lib/utils/routeConfigKeyReplace.test.js +102 -0
  146. package/lib/utils/routeConfigKeyReplace.test.js.map +1 -0
  147. package/package.json +40 -0
  148. package/src/__tests__/prolayout-layout-feature.test.tsx +207 -0
  149. package/src/components/ApplicationErrorFillWrapper.tsx +7 -0
  150. package/src/components/ApplicationErrorHandler.tsx +30 -0
  151. package/src/components/ErrorBounday.tsx +31 -0
  152. package/src/components/Fallback.tsx +65 -0
  153. package/src/components/Layout/README.md +11 -0
  154. package/src/components/Layout/components/BasicLayout.tsx +70 -0
  155. package/src/components/Layout/components/BottomTabBar.tsx +135 -0
  156. package/src/components/Layout/components/Drawer.tsx +412 -0
  157. package/src/components/Layout/components/Header.tsx +195 -0
  158. package/src/components/Layout/components/Sample.tsx +10 -0
  159. package/src/components/Layout/components/SettingDrawer/LayoutButton.tsx +102 -0
  160. package/src/components/Layout/components/SettingDrawer/SettingDrawer.tsx +60 -0
  161. package/src/components/Layout/components/SettingDrawer/ThemeColorButton.tsx +26 -0
  162. package/src/components/Layout/components/SettingDrawer/index.ts +1 -0
  163. package/src/components/Layout/components/SideBar.tsx +109 -0
  164. package/src/components/Layout/components/defaultSettings.ts +19 -0
  165. package/src/components/Layout/components/index.ts +4 -0
  166. package/src/components/Layout/components/util.ts +14 -0
  167. package/src/components/Layout/compute.test.tsx +129 -0
  168. package/src/components/Layout/compute.tsx +384 -0
  169. package/src/components/Layout/eslint.json +1 -0
  170. package/src/components/Layout/index.ts +5 -0
  171. package/src/components/Layout/typings.ts +1 -0
  172. package/src/components/NavigationComponent.tsx +154 -0
  173. package/src/components/PluginArea.tsx +11 -0
  174. package/src/components/ToastAlert.tsx +44 -0
  175. package/src/components/index.ts +9 -0
  176. package/src/components/with-interactions-managed.tsx +33 -0
  177. package/src/config/config.ts +17 -0
  178. package/src/config/index.ts +1 -0
  179. package/src/constants/routes.ts +3 -0
  180. package/src/containers/layout/BasicLayout.tsx +61 -0
  181. package/src/containers/layout/DrawerBottomNavigationConfig.tsx +85 -0
  182. package/src/containers/layout/DrawerConfig.tsx +59 -0
  183. package/src/containers/layout/Lifecycle.tsx +23 -0
  184. package/src/containers/layout/ProLayout.tsx +42 -0
  185. package/src/containers/layout/module.ts +24 -0
  186. package/src/hooks/use-after-interactions.ts +35 -0
  187. package/src/hooks/useIsReady.ts +31 -0
  188. package/src/hooks/useLayoutSetting/index.ts +99 -0
  189. package/src/index.ts +41 -0
  190. package/src/interfaces/index.ts +1 -0
  191. package/src/interfaces/settings.ts +5 -0
  192. package/src/redux/settings.ts +28 -0
  193. package/src/utils/ThemeColor.ts +9 -0
  194. package/src/utils/__snapshots__/routeConfigKeyReplace.test.ts.snap +117 -0
  195. package/src/utils/routeConfigKeyReplace.test.ts +114 -0
  196. package/src/utils/routeConfigKeyReplace.ts +74 -0
  197. package/tsconfig.json +37 -0
  198. package/types.d.ts +11 -0
  199. package/webpack.config.js +104 -0
@@ -0,0 +1,68 @@
1
+ import * as React from 'react';
2
+ import { useSelector, useDispatch } from 'react-redux';
3
+ import { CHANGE_SETTINGS_ACTION } from '@admin-layout/client';
4
+ import { appDrawerFeature, appBottomTabFeature, appDrawerBottomTabFeature, appHostBottomTabFeature, } from '../../components/Layout/compute';
5
+ import routeConfigKeyReplace from '../../utils/routeConfigKeyReplace';
6
+ const layoutSettings = process.APP_ENV && process.APP_ENV.LAYOUT_SETTINGS ? JSON.parse(process.APP_ENV.LAYOUT_SETTINGS) : null;
7
+ export function useLayoutSetting(props = null) {
8
+ var _a;
9
+ const dispatch = useDispatch();
10
+ const [settings, setAppSettings] = React.useState();
11
+ const defaultSettings = useSelector((state) => state.settings);
12
+ const [appLayout, setAppLayout] = React.useState(appDrawerFeature((_a = props === null || props === void 0 ? void 0 : props.drawerConfig) !== null && _a !== void 0 ? _a : null));
13
+ const [pathKey, setPathKey] = React.useState('//main_drawer/');
14
+ const [intialRouteName, setInitialRouteName] = React.useState('MainStack.Layout');
15
+ const [appLayoutFeatures, setAppLayoutFeatures] = React.useState(null);
16
+ React.useEffect(() => {
17
+ if (layoutSettings) {
18
+ const config = Object.assign(Object.assign({}, settings), layoutSettings);
19
+ setDefalutSettings(config);
20
+ setAppSettings(config);
21
+ }
22
+ else
23
+ setAppSettings(defaultSettings);
24
+ }, []);
25
+ React.useEffect(() => {
26
+ if (defaultSettings) {
27
+ setAppSettings(defaultSettings);
28
+ }
29
+ }, [defaultSettings]);
30
+ React.useEffect(() => {
31
+ if (settings) {
32
+ let AppLayout = (settings === null || settings === void 0 ? void 0 : settings.layout) == 'side'
33
+ ? appDrawerFeature(props)
34
+ : (settings === null || settings === void 0 ? void 0 : settings.layout) == 'bottom'
35
+ ? appBottomTabFeature(props)
36
+ : (settings === null || settings === void 0 ? void 0 : settings.layout) == 'host-bottom'
37
+ ? appHostBottomTabFeature(props)
38
+ : appDrawerBottomTabFeature(props);
39
+ setAppLayout(AppLayout);
40
+ let layoutTypeKey = (settings === null || settings === void 0 ? void 0 : settings.layout) == 'side'
41
+ ? '//main_drawer/'
42
+ : (settings === null || settings === void 0 ? void 0 : settings.layout) == 'bottom'
43
+ ? '//bottom_tab/'
44
+ : (settings === null || settings === void 0 ? void 0 : settings.layout) == 'host-bottom'
45
+ ? '//host_tab/'
46
+ : '//main_drawer/bottom_tab/';
47
+ setPathKey(layoutTypeKey);
48
+ let initialRouteName = (settings === null || settings === void 0 ? void 0 : settings.layout) == 'bottom'
49
+ ? 'MainStack.Layout'
50
+ : (settings === null || settings === void 0 ? void 0 : settings.layout) == 'host-bottom'
51
+ ? 'MainStack.Layout'
52
+ : 'MainStack.Layout';
53
+ setInitialRouteName(initialRouteName);
54
+ if (props === null || props === void 0 ? void 0 : props.appFeatures) {
55
+ const { appFeatures } = routeConfigKeyReplace(layoutTypeKey, props === null || props === void 0 ? void 0 : props.appFeatures, AppLayout, initialRouteName);
56
+ setAppLayoutFeatures(appFeatures);
57
+ }
58
+ }
59
+ }, [settings, props === null || props === void 0 ? void 0 : props.appFeatures]);
60
+ const setDefalutSettings = (config) => {
61
+ dispatch({
62
+ type: CHANGE_SETTINGS_ACTION,
63
+ payload: config,
64
+ });
65
+ };
66
+ return { appLayout, pathKey, intialRouteName, appLayoutFeatures };
67
+ }
68
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useLayoutSetting/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EACH,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAEzB,uBAAuB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,qBAAqB,MAAM,mCAAmC,CAAC;AAEtE,MAAM,cAAc,GAChB,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAQ5G,MAAM,UAAU,gBAAgB,CAAC,QAAQ,IAA0B;;IAC/D,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,CAAC,QAAQ,EAAE,cAAc,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAO,CAAC;IACzD,MAAM,eAAe,GAAG,WAAW,CAAM,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAQ,CAAC;IAC3E,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,gBAAgB,CAAC,MAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,YAAY,mCAAI,IAAI,CAAC,CAAC,CAAC;IAChG,MAAM,CAAC,OAAO,EAAE,UA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C;IAEF,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,CAAC;AACtE,CAAC"}
package/lib/index.d.ts ADDED
@@ -0,0 +1,14 @@
1
+ import { Feature } from '@common-stack/client-react';
2
+ import { useAfterInteractions } from './hooks/use-after-interactions';
3
+ import useIsReady from './hooks/useIsReady';
4
+ import routeConfigKeyReplace from './utils/routeConfigKeyReplace';
5
+ import LayoutFeature, { ProLayout, AppFeatures, AppLayout } from './containers/layout/module';
6
+ import { useLayoutSetting, LayoutSettingProps } from './hooks/useLayoutSetting';
7
+ export * from '@gluestack-ui/themed';
8
+ export * from '@gluestack-ui/config';
9
+ export * from '@gluestack-style/react';
10
+ export * from './containers/layout/Lifecycle';
11
+ export * from './components';
12
+ export { useLayoutSetting, LayoutSettingProps, routeConfigKeyReplace, LayoutFeature, ProLayout, AppFeatures, AppLayout, useAfterInteractions, useIsReady, };
13
+ declare const _default: Feature;
14
+ export default _default;
package/lib/index.js ADDED
@@ -0,0 +1,26 @@
1
+ /* eslint-disable import/no-extraneous-dependencies */
2
+ import { Feature } from '@common-stack/client-react';
3
+ import { applicationErrors, errorReduxLink } from '@admin-layout/client';
4
+ import { settingsReducer } from './redux/settings';
5
+ import { useAfterInteractions } from './hooks/use-after-interactions';
6
+ import useIsReady from './hooks/useIsReady';
7
+ import routeConfigKeyReplace from './utils/routeConfigKeyReplace';
8
+ //changed
9
+ import LayoutFeature, { ProLayout, AppFeatures, AppLayout } from './containers/layout/module';
10
+ import { useLayoutSetting } from './hooks/useLayoutSetting';
11
+ //...........................No change....///
12
+ export * from '@gluestack-ui/themed';
13
+ export * from '@gluestack-ui/config';
14
+ export * from '@gluestack-style/react';
15
+ export * from './containers/layout/Lifecycle';
16
+ //............................No change....///
17
+ //changed
18
+ export * from './components';
19
+ export { useLayoutSetting, routeConfigKeyReplace, LayoutFeature, ProLayout, AppFeatures, AppLayout, useAfterInteractions, useIsReady, };
20
+ export default new Feature({
21
+ reducer: { settings: settingsReducer, applicationErrors },
22
+ clientStateParams: {
23
+ preLinkFuncs: [errorReduxLink],
24
+ },
25
+ });
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sDAAsD;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACtE,OAAO,UAAU,MAAM,oBAAoB,CAAC;AAC5C,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAClE,SAAS;AACT,OAAO,aAAa,EAAE,EAAE,SAAS,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAAE,gBAAgB,EAAsB,MAAM,0BAA0B,CAAC;AAEhF,6CAA6C;AAC7C,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,8CAA8C;AAE9C,SAAS;AACT,cAAc,cAAc,CAAC;AAI7B,OAAO,EACH,gBAAgB,EAEhB,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,WAAW,EACX,SAAS,EACT,oBAAoB,EACpB,UAAU,GACb,CAAC;AAEF,eAAe,IAAI,OAAO,CAAC;IACvB,OAAO,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,iBAAiB,EAAE;IACzD,iBAAiB,EAAE;QACf,YAAY,EAAE,CAAC,cAAc,CAAC;KACjC;CACJ,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export * from './settings';
@@ -0,0 +1,2 @@
1
+ export * from './settings';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { ProSettings } from '@admin-layout/client';
2
+ export type DefaultSettings = Partial<ProSettings> & {
3
+ language?: string;
4
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/interfaces/settings.ts"],"names":[],"mappings":""}
@@ -0,0 +1,80 @@
1
+ import { DefaultSettings } from "../interfaces";
2
+ declare const settingsReducer: (state: {
3
+ logo: string;
4
+ navTheme: string;
5
+ primaryColor: string;
6
+ layout: string;
7
+ contentWidth: string;
8
+ fixedHeader: boolean;
9
+ fixSiderbar: boolean;
10
+ colorWeak: boolean;
11
+ title: string;
12
+ iconfontUrl: string;
13
+ language: string;
14
+ topLeftToggle: boolean;
15
+ topRightSettingToggle: boolean;
16
+ }, { type, payload }: {
17
+ type: string;
18
+ payload: DefaultSettings;
19
+ }) => {
20
+ logo: string;
21
+ navTheme: string;
22
+ primaryColor: string;
23
+ layout: string;
24
+ contentWidth: string;
25
+ fixedHeader: boolean;
26
+ fixSiderbar: boolean;
27
+ colorWeak: boolean;
28
+ title: string;
29
+ iconfontUrl: string;
30
+ language: string;
31
+ topLeftToggle: boolean;
32
+ topRightSettingToggle: boolean;
33
+ } | {
34
+ navTheme: string;
35
+ headerTheme?: import("@admin-layout/client").MenuTheme;
36
+ headerHeight?: number;
37
+ layout: string;
38
+ contentWidth: string;
39
+ fixedHeader: boolean;
40
+ fixSiderbar: boolean;
41
+ menu?: {
42
+ locale?: boolean;
43
+ defaultOpenAll?: boolean;
44
+ loading?: boolean;
45
+ };
46
+ title: string | false;
47
+ iconfontUrl: string;
48
+ colorPrimary?: string;
49
+ primaryColor: string;
50
+ colorWeak: boolean;
51
+ splitMenus?: boolean;
52
+ siderMenuType?: string;
53
+ showHeader?: any;
54
+ headerRender?: any;
55
+ showFooter?: any;
56
+ footerRender?: any;
57
+ searchBarRender?: any;
58
+ showMenu?: any;
59
+ menuRender?: any;
60
+ menuHeaderRender?: any;
61
+ language: string;
62
+ logo: string;
63
+ topLeftToggle: boolean;
64
+ topRightSettingToggle: boolean;
65
+ } | {
66
+ language: DefaultSettings;
67
+ logo: string;
68
+ navTheme: string;
69
+ primaryColor: string;
70
+ layout: string;
71
+ contentWidth: string;
72
+ fixedHeader: boolean;
73
+ fixSiderbar: boolean;
74
+ colorWeak: boolean;
75
+ title: string;
76
+ iconfontUrl: string;
77
+ topLeftToggle: boolean;
78
+ topRightSettingToggle: boolean;
79
+ };
80
+ export { settingsReducer };
@@ -0,0 +1,16 @@
1
+ /* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
+ /* eslint-disable no-case-declarations */
3
+ import { CHANGE_LANGUAGE, CHANGE_SETTINGS_ACTION } from "@admin-layout/client";
4
+ import { config } from "../config";
5
+ const settingsReducer = (state = config.LAYOUT_SETTINGS, { type, payload = {} }) => {
6
+ switch (type) {
7
+ case CHANGE_SETTINGS_ACTION:
8
+ return Object.assign(Object.assign({}, state), payload);
9
+ case CHANGE_LANGUAGE:
10
+ return Object.assign(Object.assign({}, state), { language: payload });
11
+ default:
12
+ return state;
13
+ }
14
+ };
15
+ export { settingsReducer };
16
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/redux/settings.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,yCAAyC;AACzC,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,MAAM,eAAe,GAAG,CACtB,KAAK,GAAG,MAAM,CAAC,eAAe,EAC9B,EAAE,IAAI,EAAE,OAAO,GAAG,EAAE,EAA8C,EAClE,EAAE;IACA,QAAQ,IAAI,EAAE;QACV,KAAK,sBAAsB;YACvB,uCACO,KAAK,GACL,OAAO,EACZ;QACN,KAAK,eAAe;YAChB,uCACO,KAAK,KACR,QAAQ,EAAE,OAAO,IACnB;QAEN;YACI,OAAO,KAAK,CAAC;KACpB;AACL,CAAC,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -0,0 +1,8 @@
1
+ export declare const COLOR: {
2
+ WHITE: string;
3
+ BLACK: string;
4
+ GREY: string;
5
+ LIGHT_GREY: string;
6
+ GREYISH_BLACK: string;
7
+ };
8
+ export declare const THEMECOLOR: string[];
@@ -0,0 +1,9 @@
1
+ export const COLOR = {
2
+ WHITE: 'white',
3
+ BLACK: 'black',
4
+ GREY: 'grey',
5
+ LIGHT_GREY: '#b1b1b1',
6
+ GREYISH_BLACK: '#1f1f1f',
7
+ };
8
+ export const THEMECOLOR = ['#1890ff', '#f5222d', '#fa541c', '#faad14', '#13c2c2', '#52c41a', '#2f54eb', '#722ed1'];
9
+ //# sourceMappingURL=ThemeColor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThemeColor.js","sourceRoot":"","sources":["../../src/utils/ThemeColor.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,MAAM;IACZ,UAAU,EAAE,SAAS;IACrB,aAAa,EAAE,SAAS;CAC3B,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Feature } from '@common-stack/client-react';
2
+ declare const routeConfigKeyReplace: (keyReplacedWith: any, features: any, appLayout?: any, intialRouteName?: any) => {
3
+ appFeatures: Feature;
4
+ appLayoutConfig: any;
5
+ appLayoutFeatures: any;
6
+ };
7
+ export default routeConfigKeyReplace;
@@ -0,0 +1,77 @@
1
+ import { Feature } from '@common-stack/client-react';
2
+ const routeConfigKeyReplace = (keyReplacedWith, features, appLayout = null, intialRouteName = 'MainStack.Layout') => {
3
+ var _a, _b, _c, _d, _e;
4
+ let appLayoutFeatures = Object.assign({}, features);
5
+ appLayoutFeatures.routeConfig = (_a = appLayoutFeatures === null || appLayoutFeatures === void 0 ? void 0 : appLayoutFeatures.routeConfig) === null || _a === void 0 ? void 0 : _a.map((obj) => {
6
+ let rObj = Object.assign({}, obj);
7
+ if (rObj.hasOwnProperty('/'))
8
+ rObj['/'].props.initialRouteName = intialRouteName;
9
+ let objectEntries = Object.entries(rObj).map(([key, val]) => {
10
+ var _a, _b, _c, _d, _e, _f, _g, _h;
11
+ let objVal = Object.assign({}, val);
12
+ let initialParams = (_b = (_a = objVal === null || objVal === void 0 ? void 0 : objVal.props) === null || _a === void 0 ? void 0 : _a.initialParams) !== null && _b !== void 0 ? _b : {};
13
+ if ((_c = objVal === null || objVal === void 0 ? void 0 : objVal.props) === null || _c === void 0 ? void 0 : _c.options) {
14
+ initialParams.menu_position = (_d = objVal === null || objVal === void 0 ? void 0 : objVal.menu_position) !== null && _d !== void 0 ? _d : 'bottom';
15
+ initialParams.priority = (_g = (_f = (_e = objVal === null || objVal === void 0 ? void 0 : objVal.props) === null || _e === void 0 ? void 0 : _e.options) === null || _f === void 0 ? void 0 : _f.priority) !== null && _g !== void 0 ? _g : 0;
16
+ initialParams.options = objVal.props.options ? JSON.stringify((_h = objVal === null || objVal === void 0 ? void 0 : objVal.props) === null || _h === void 0 ? void 0 : _h.options) : null;
17
+ objVal.props.initialParams = initialParams;
18
+ }
19
+ let objKey;
20
+ if (keyReplacedWith == '//host_tab/') {
21
+ objKey = key.startsWith('//:orgName/h/')
22
+ ? key.replace('//:orgName/h/', '//:orgName' + (keyReplacedWith === null || keyReplacedWith === void 0 ? void 0 : keyReplacedWith.replace('//', '/')))
23
+ : key.startsWith('//h/')
24
+ ? key.replace('//h/', keyReplacedWith)
25
+ : key.startsWith('//:orgName/l/') ? null
26
+ : key.startsWith('//l/') ? null
27
+ : key;
28
+ }
29
+ else {
30
+ objKey = key.startsWith('//:orgName/l/') ? key.replace('//:orgName/l/', '//:orgName' + (keyReplacedWith === null || keyReplacedWith === void 0 ? void 0 : keyReplacedWith.replace('//', '/')))
31
+ : key.startsWith('//l/') ? key.replace('//l/', keyReplacedWith)
32
+ : key.startsWith('//:orgName/h/') ? null
33
+ : key.startsWith('//h/') ? null
34
+ : key;
35
+ }
36
+ return [objKey, objVal];
37
+ });
38
+ return Object.fromEntries(objectEntries);
39
+ });
40
+ let appLayoutConfig = null;
41
+ if (appLayout) {
42
+ let layoutFeatures = [...features === null || features === void 0 ? void 0 : features.routeConfig];
43
+ //const intialRoutename = layoutFeatures?.map((obj:any)=>obj.hasOwnProperty('/') && obj['/'].props.initialRouteName)?.filter((obj:any)=>obj)[0]??'MainStack.MainDrawer';
44
+ const isOrgName = (_d = (_c = (_b = layoutFeatures === null || layoutFeatures === void 0 ? void 0 : layoutFeatures.map((obj) => {
45
+ return Object.entries(obj).map(([key, val]) => {
46
+ if (keyReplacedWith == '//host_tab/') {
47
+ if (key.startsWith('//:orgName/h/'))
48
+ return true;
49
+ else
50
+ return null;
51
+ }
52
+ else {
53
+ if (key.startsWith('//:orgName/l/'))
54
+ return true;
55
+ else
56
+ null;
57
+ }
58
+ });
59
+ })) === null || _b === void 0 ? void 0 : _b.flat(1)) === null || _c === void 0 ? void 0 : _c.filter((obj) => obj)) !== null && _d !== void 0 ? _d : [];
60
+ appLayoutConfig = Object.assign({}, appLayout);
61
+ appLayoutConfig.routeConfig = (_e = appLayoutConfig === null || appLayoutConfig === void 0 ? void 0 : appLayoutConfig.routeConfig) === null || _e === void 0 ? void 0 : _e.map((obj) => {
62
+ let rObj = Object.assign({}, obj);
63
+ //if (rObj.hasOwnProperty('/')) rObj['/'].props.initialRouteName = intialRoutename;
64
+ let objectEntries = Object.entries(rObj).map(([key, val]) => {
65
+ let objVal = Object.assign({}, val);
66
+ let objKey;
67
+ objKey = (isOrgName === null || isOrgName === void 0 ? void 0 : isOrgName.length) > 0 ? key.startsWith('//') ? key.replace('//', '//:orgName/') : key : key;
68
+ return [objKey, objVal];
69
+ });
70
+ return Object.fromEntries(objectEntries);
71
+ });
72
+ }
73
+ const appFeatures = new Feature(appLayoutConfig, appLayoutFeatures);
74
+ return { appFeatures, appLayoutConfig, appLayoutFeatures };
75
+ };
76
+ export default routeConfigKeyReplace;
77
+ //# sourceMappingURL=routeConfigKeyReplace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routeConfigKeyReplace.js","sourceRoot":"","sources":["../../src/utils/routeConfigKeyReplace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AACrD,MAAM,qBAAqB,GAAG,CAAC,eAAoB,EAAE,QAAa,EAAC,YAAU,IAAW,EAAC,kBAAgB,kBAAyB,EAAE,EAAE;;IAClI,IAAI,iBAAiB,qBAAQ,QAAQ,CAAE,CAAC;IACxC,iBAAiB,CAAC,WAAW,GAAG,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,WAAW,0CAAE,GAAG,CAAC,CAAC,GAAQ,EAAE,EAAE;QAC7E,IAAI,IAAI,qBAAa,GAAG,CAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC;YAAE,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,gBAAgB,GAAG,eAAe,CAAC;QACjF,IAAI,aAAa,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAM,EAAE,EAAE;;YAC7D,IAAI,MAAM,GAAQ,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;YACzC,IAAI,aAAa,GAAG,MAAA,MAAA,MAA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AO,EAAC,WAAW,EAAC,eAAe,EAAC,iBAAiB,EAAC,CAAC;AAC3D,CAAC,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,102 @@
1
+ import { Feature } from '@common-stack/client-react';
2
+ import { createStackNavigator } from '@react-navigation/stack';
3
+ import routeConfigKeyReplace from './routeConfigKeyReplace';
4
+ import { appBottomTabFeature, } from '../components/Layout/compute.test';
5
+ const MyComponent = () => { };
6
+ describe('route config key replace', () => {
7
+ const routerConfig = {
8
+ ['/']: {
9
+ exact: false,
10
+ container: createStackNavigator(),
11
+ name: 'MainStack',
12
+ props: {
13
+ initialRouteName: 'MainStack.MainBottomTab',
14
+ screenOptions: {
15
+ headerShown: false,
16
+ },
17
+ },
18
+ },
19
+ // ['//:orgName']: {
20
+ // exact: false,
21
+ // // container: createStackNavigator(),
22
+ // name: 'OrgNameStack',
23
+ // props: {
24
+ // initialRouteName: 'MainStack.OrgNameStack.MainDrawer',
25
+ // component: MyComponent,
26
+ // screenOptions: {
27
+ // headerShown: false,
28
+ // },
29
+ // },
30
+ // },
31
+ ['//sample']: {
32
+ name: 'Sample',
33
+ props: {
34
+ priority: 1,
35
+ initialParams: { orgName: 'test' },
36
+ component: MyComponent,
37
+ options: {
38
+ headerShown: true,
39
+ },
40
+ },
41
+ },
42
+ ['//:orgName/l/home']: {
43
+ name: 'Home',
44
+ props: {
45
+ priority: 1,
46
+ initialParams: { orgName: 'test' },
47
+ component: MyComponent,
48
+ options: {
49
+ headerShown: true,
50
+ tabBarLabel: 'Home',
51
+ headerTitle: 'Home',
52
+ // tabBarIcon: ({ color }) => <Ionicons name="home" size={24} color={color} />,
53
+ },
54
+ },
55
+ },
56
+ ['//:orgName/l/home/:about']: {
57
+ exact: false,
58
+ name: 'About',
59
+ props: {
60
+ priority: 2,
61
+ initialParams: {},
62
+ component: MyComponent,
63
+ options: {
64
+ headerShown: true,
65
+ tabBarLabel: 'About',
66
+ headerTitle: 'About',
67
+ },
68
+ },
69
+ },
70
+ ['//:orgName/l/account']: {
71
+ name: 'Account',
72
+ props: {
73
+ priority: 3,
74
+ initialParams: {},
75
+ component: MyComponent,
76
+ options: {
77
+ headerShown: true,
78
+ tabBarLabel: 'Account',
79
+ headerTitle: 'Account',
80
+ // tabBarIcon: ({ color }) => <Ionicons name="home" size={24} color={color} />,
81
+ },
82
+ },
83
+ },
84
+ };
85
+ it('getSortedNavigations with routeConfigKeyReplace ', () => {
86
+ //******************Layout Settings for test*************************/
87
+ // For layout 'side', keyReplaceWith='/main_drawer/',appLayout=appDrawerFeature()
88
+ // For layout 'mixSide', keyReplaceWith='/main_drawer/bottom_tab/',appLayout=appDrawerBottomTabFeature()
89
+ // For layout 'bottom', keyReplaceWith='/bottom_tab/',appLayout=appBottomTabFeature
90
+ // For layout 'host-bottom', keyReplaceWith='/host_tab/',appLayout=appHostBottomTabFeature
91
+ //*******************************************************************/
92
+ const routeConfigFeature = new Feature({ routeConfig: routerConfig });
93
+ let keyReplacedWith = '/bottom_tab/';
94
+ const appLayout = appBottomTabFeature;
95
+ const { appFeatures } = routeConfigKeyReplace(keyReplacedWith, routeConfigFeature, appLayout);
96
+ // const appFeatures = new Feature(appLayoutConfig, appLayoutFeatures);
97
+ const Render = appFeatures.getRoutes2('/', 'MainStack');
98
+ const configuredRoute = appFeatures.getConfiguredRoutes2('/');
99
+ expect(Render).toMatchSnapshot();
100
+ });
101
+ });
102
+ //# sourceMappingURL=routeConfigKeyReplace.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"routeConfigKeyReplace.test.js","sourceRoot":"","sources":["../../src/utils/routeConfigKeyReplace.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAmD,MAAM,4BAA4B,CAAC;AACtG,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAG/D,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAEH,mBAAmB,GAItB,MAAM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tB,OAAO,EAAE;oBACL,WAAW,EAAE,IAAI;oBACjB,WAAW,EAAE,OAAO;oBACpB,WAAW,EAAE,OAAO;iBACvB;aACJ;SACJ;QACD,CAAC,sBAAsB,CAAC,EAAE;YACtB,IAAI,EAAE,SAAS;YACf,KAAK,EAAE;gBACH,QAAQ,EAAE,CAAC;gBACX,aAAa,EAAE,EAAE;gBACjB,SAAS,EAAE,WAAW;gBACtB,OAAO,EAAE;oBACL,WAAW,EAAE,IAAI;oBACjB,WAAW,EAAE,SAAS;oBACtB,WAAW,EAAE,SAAS;oBACtB,+EAA+E;iBAClF;aACJ;SACJ;KACJ,CAAC;IAEF,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QACxD,sEAAsE;QACtE,iFAAiF;QACjF,wGAAwG;QACxG,mFAAmF;QACnF,0FAA0F;QAC1F,sEAAsE;QACtE,MAAM,kBAAkB,GAAG,IAAI,OAAO,CAAC,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC,CAAC;QAEtE,IAAI,eAAe,GAAG,cAAc,CAAC;QACrC,MAAM,SAAS,GAAG,mBAAmB,CAAC;QAEtC,MAAM,EAAC,WAAW,EAAC,GAAG,qBAAqB,CAAC,eAAe,EAAE,kBAAkB,EAAC,SAAS,CAAC,CAAC;QAC3F,uEAAuE;QACtE,MAAM,MAAM,GAAG,WAAW,CAAC,UAAU,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;QACzD,MAAM,eAAe,GAAG,WAAW,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;QAC9D,MAAM,CAAC,MAAM,CAAC,CAAC,eAAe,EAAE,CAAC;IACrC,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "@admin-layout/gluestack-ui-mobile",
3
+ "version": "6.5.1-alpha.0",
4
+ "description": "Glustack-ui for mobile component layout",
5
+ "main": "lib/index.js",
6
+ "scripts": {
7
+ "jest": "./node_modules/.bin/jest",
8
+ "test:debug": "npm test -- --runInBand",
9
+ "test:watch": "npm test -- --watch",
10
+ "prepublish": "npm run build",
11
+ "watch": "npm run build:lib:watch",
12
+ "build": "npm run build:clean && npm run build:lib",
13
+ "build:clean": "rimraf lib",
14
+ "build:lib": "tsc",
15
+ "build:lib:watch": "npm run build:lib -- --watch",
16
+ "test": "yarn tests && yarn lint",
17
+ "tests": "jest --updateSnapshot",
18
+ "tests:watch": "jest --watch"
19
+ },
20
+ "publishConfig": {
21
+ "access": "public"
22
+ },
23
+ "author": "CDMBase LLC",
24
+ "license": "ISC",
25
+ "dependencies": {
26
+ "@admin-layout/client": "6.5.1-alpha.0",
27
+ "@common-stack/remix-router-redux": "^4.0.1-alpha.1",
28
+ "@gluestack-style/react": "^1.0.53",
29
+ "@gluestack-ui/config": "^1.1.18",
30
+ "@gluestack-ui/themed": "^1.1.22",
31
+ "hoist-non-react-statics": "^3.3.2",
32
+ "react-native-svg": "^15.1.0",
33
+ "react-native-toast-message": "^2.1.5"
34
+ },
35
+ "typings": "lib/index.d.ts",
36
+ "typescript": {
37
+ "definition": "lib/index.d.ts"
38
+ },
39
+ "gitHead": "c71dd945a16165bda37320de7533b1b3d9d6a0b4"
40
+ }