@common-stack/core 7.0.4-alpha.6 → 8.0.2-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.
@@ -4,3 +4,4 @@ export * from './rollupRouteGenerated';
4
4
  export * from './routeJson';
5
5
  export * from './viteSettings';
6
6
  export * from './wrapperRouteOptions';
7
+ export * from './routeMobileAdditions';
@@ -14,7 +14,7 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
14
14
  * @name Path
15
15
  * @description The path of the route.
16
16
  */
17
- path?: string;
17
+ path: string;
18
18
  /**
19
19
  * @name Index Route
20
20
  * @description Indicates if this is an index route.
@@ -47,7 +47,7 @@ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
47
47
  * @description Dynamic import of the Dialog component for modal routes.
48
48
  */
49
49
  dialog?: () => Promise<{
50
- default: LazyExoticComponent<ComponentType<any>>;
50
+ default: LazyExoticComponent<ComponentType<any>> | ComponentType<any>;
51
51
  }>;
52
52
  /**
53
53
  * @name Nested Routes
@@ -1,9 +1,15 @@
1
1
  import { IRollupBuildGenerated } from './rollupRouteGenerated';
2
2
  import { IRouteModule } from './routeCompute';
3
+ /**
4
+ * @name IBaseRouteMap
5
+ * @description Base interface for route mapping that can be shared across platforms
6
+ */
7
+ export interface IBaseRouteMap<T = unknown, R = IRouteModule> {
8
+ [key: string]: R & T;
9
+ }
10
+ export type IRouteMap<T = unknown> = IBaseRouteMap<T, Omit<IRouteModule, 'path'> & Partial<Pick<IRouteModule, 'path'>>>;
3
11
  /**
4
12
  * @name IComputedRoutesArray
5
13
  * @description Represents an array of route objects, each containing dynamic keys mapped to route configurations. This is the `routes.json` file generated from rollup build
6
14
  */
7
- export type IComputedRoutesArray = Array<{
8
- [key: string]: IRouteModule & IRollupBuildGenerated;
9
- }>;
15
+ export type IComputedRoutesArray = Array<IRouteMap<IRollupBuildGenerated>>;
@@ -0,0 +1,50 @@
1
+ import { IRouteModule as IBaseRouteModule } from './routeCompute';
2
+ export interface IReactNavigationProps {
3
+ initialParams?: Record<string, any>;
4
+ initialRouteName?: string;
5
+ component?: React.ComponentType<any> | React.ReactNode;
6
+ unauthenticatedComponent?: React.ComponentType<any> | React.ReactNode;
7
+ options?: {
8
+ headerShown?: boolean;
9
+ headerTitle?: string;
10
+ tabBarLabel?: string;
11
+ tabBarIcon?: string | ((props: {
12
+ color: string;
13
+ }) => JSX.Element);
14
+ tabBarActiveTintColor?: string;
15
+ tabBarInactiveTintColor?: string;
16
+ drawerIcon?: string;
17
+ drawerStyle?: Record<string, any>;
18
+ gestureEnabled?: boolean;
19
+ swipeEnabled?: boolean;
20
+ title?: string;
21
+ };
22
+ screenOptions?: ((options: any) => Record<string, any>) | Record<string, any>;
23
+ drawerContent?: (props: any) => JSX.Element;
24
+ tabBar?: (props: any) => JSX.Element;
25
+ }
26
+ /**
27
+ * Interface extending IRouteModule with mobile-specific navigation properties
28
+ */
29
+ export interface IRouteMobileAdditions extends IBaseRouteModule {
30
+ /**
31
+ * @name Container
32
+ * @description Navigation container function (Stack, Drawer, or BottomTab navigator)
33
+ */
34
+ container?: any;
35
+ /**
36
+ * @name Route Name
37
+ * @description Name of the route for navigation
38
+ */
39
+ name?: string;
40
+ /**
41
+ * @name Navigation Props
42
+ * @description Extended props specific to mobile navigation
43
+ */
44
+ props?: IReactNavigationProps;
45
+ /**
46
+ * @name With Life Cycle Interaction
47
+ * @description Whether to enable life cycle interaction
48
+ */
49
+ withLifeCycleInteraction?: any;
50
+ }
@@ -132,7 +132,7 @@ export interface IGeneratedWrapperOptions {
132
132
  authorityConfig?: IAuthorityConfig;
133
133
  /**
134
134
  * @name _useFutureCommonPackage Configuration
135
- * @description Whether the package is using common package or not
135
+ * @description Whether the package is using `common` package or not
136
136
  * @default: false
137
137
  */
138
138
  _useFutureCommonPackage?: boolean;
package/lib/index.d.ts CHANGED
@@ -2,3 +2,4 @@ export * from './field-error';
2
2
  export * from './interfaces';
3
3
  export * from './constants';
4
4
  export * from './utils';
5
+ export * from './component';
package/lib/index.js CHANGED
@@ -1 +1 @@
1
- export{FieldError}from'./field-error.js';export{ClientTypes,CommonType,ElectronTypes,TaggedType}from'./constants/types.js';export{getEnvironment}from'./utils/getEnvironment.js';export{getGlobalVariable,setGlobalVariable}from'./utils/globalVariable.js';//# sourceMappingURL=index.js.map
1
+ export{FieldError}from'./field-error.js';export{ClientTypes,CommonType,ElectronTypes,TaggedType}from'./constants/types.js';export{getEnvironment}from'./utils/getEnvironment.js';export{getGlobalVariable,setGlobalVariable}from'./utils/globalVariable.js';export{IMenuPosition}from'./component/interfaces/menu.js';//# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/core",
3
- "version": "7.0.4-alpha.6",
3
+ "version": "8.0.2-alpha.0",
4
4
  "description": "Common core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -23,8 +23,8 @@
23
23
  "publishConfig": {
24
24
  "access": "public"
25
25
  },
26
- "gitHead": "b2d5f2840f3e0b00015d55715108e8a86e47ff4d",
27
26
  "typescript": {
28
27
  "definition": "lib/index.d.ts"
29
- }
28
+ },
29
+ "gitHead": "d45864ba7429065d7b67e573e909ecf762ffc150"
30
30
  }
@@ -1 +0,0 @@
1
- export{IMenuPosition}from'./component/interfaces/menu.js';//# sourceMappingURL=index.component.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.component.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}