@common-stack/core 6.0.2-alpha.1 → 6.0.6-alpha.104

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.
@@ -0,0 +1 @@
1
+ export * from './interfaces';
@@ -0,0 +1,12 @@
1
+ export declare enum IPermissionBehavior {
2
+ hide = 0,
3
+ showUnAuthorized = 1,
4
+ showAlternative = 2
5
+ }
6
+ export interface IAuthorityConfig {
7
+ behavior?: IPermissionBehavior;
8
+ requireAllPermissions?: boolean;
9
+ customCheck?: (permissions: any, configurations: any) => boolean;
10
+ visibilityCheck?: (visibility: any) => string;
11
+ visibilityConfigKey?: string;
12
+ }
@@ -0,0 +1,6 @@
1
+ export * from './menu';
2
+ export * from './routeCompute';
3
+ export * from './rollupRouteGenerated';
4
+ export * from './routeJson';
5
+ export * from './viteSettings';
6
+ export * from './wrapperRouteOptions';
@@ -0,0 +1,83 @@
1
+ export declare enum IMenuPosition {
2
+ Logo = "LOGO",
3
+ Upper = "UPPER",
4
+ Middle = "MIDDLE",
5
+ Lower = "LOWER",
6
+ Bottom = "BOTTOM"
7
+ }
8
+ export interface IMenuDataItem {
9
+ /**
10
+ * @name submenu
11
+ */
12
+ children?: IMenuDataItem[];
13
+ /**
14
+ * @name Hide child nodes in the menu
15
+ */
16
+ hideChildrenInMenu?: boolean;
17
+ /**
18
+ * @name hideSelf and children in menu
19
+ */
20
+ hideInMenu?: boolean;
21
+ /**
22
+ * @name Icon
23
+ * @description Icon settings for the route, including name and properties such as size.
24
+ */
25
+ icon?: string | {
26
+ name: string;
27
+ props?: Record<string, any>;
28
+ style?: Record<string, any>;
29
+ };
30
+ /**
31
+ * @name Internationalization key for custom menus
32
+ */
33
+ locale?: string | false;
34
+ /**
35
+ * @name The name of the menu
36
+ */
37
+ name?: string;
38
+ /**
39
+ * @name is used to calibrate the selected value, default is path
40
+ */
41
+ key?: string;
42
+ /**
43
+ * @name disable menu option
44
+ */
45
+ disabled?: boolean;
46
+ /**
47
+ * Disable menu tooltip menu option
48
+ */
49
+ disabledTooltip?: boolean;
50
+ /**
51
+ * @name path
52
+ */
53
+ path?: string;
54
+ /**
55
+ * @name custom parent node
56
+ * @description When this node is selected, the node of parentKeys is also selected
57
+ */
58
+ parentKeys?: string[];
59
+ /**
60
+ * @name hides itself and elevates child nodes to its level
61
+ */
62
+ flatMenu?: boolean;
63
+ /** @name Specify the external link opening mode, same as a tag */
64
+ target?: string;
65
+ /**
66
+ * @name position of the Menu
67
+ * @enum IMenuPosition
68
+ */
69
+ position?: IMenuPosition;
70
+ /**
71
+ * @name permissions to determine whether to render menu or not
72
+ */
73
+ authority?: string[];
74
+ /**
75
+ * @name priority of the menu to display in the order. Lower values shows first.
76
+ */
77
+ priority?: number;
78
+ /**
79
+ * The path displayed by the menuItem's tooltip
80
+ */
81
+ tooltip?: string;
82
+ [key: string]: any;
83
+ }
@@ -0,0 +1,8 @@
1
+ var IMenuPosition;
2
+ (function (IMenuPosition) {
3
+ IMenuPosition["Logo"] = "LOGO";
4
+ IMenuPosition["Upper"] = "UPPER";
5
+ IMenuPosition["Middle"] = "MIDDLE";
6
+ IMenuPosition["Lower"] = "LOWER";
7
+ IMenuPosition["Bottom"] = "BOTTOM";
8
+ })(IMenuPosition || (IMenuPosition = {}));export{IMenuPosition};//# sourceMappingURL=menu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"menu.js","sources":["../../../src/component/interfaces/menu.ts"],"sourcesContent":[null],"names":[],"mappings":"IAAY,cAMX;AAND,CAAA,UAAY,aAAa,EAAA;AACrB,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,aAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACrB,CAAC,EANW,aAAa,KAAb,aAAa,GAMxB,EAAA,CAAA,CAAA"}
@@ -0,0 +1,35 @@
1
+ export interface IRoutePageExportFlags {
2
+ hasLoader?: boolean;
3
+ hasAction?: boolean;
4
+ hasClientLoader?: boolean;
5
+ hasClientAction?: boolean;
6
+ hasComponent?: boolean;
7
+ hasErrorBoundary?: boolean;
8
+ /**
9
+ * @name Query Params Generator
10
+ * @description Indicates if the route uses a query parameters generator.
11
+ */
12
+ queryParamsGenerator?: boolean;
13
+ hasLinks?: boolean;
14
+ hasMeta?: boolean;
15
+ hasHydrateFallback?: boolean;
16
+ hasShouldRevalidate?: boolean;
17
+ hasHandle?: boolean;
18
+ hasHeaders?: boolean;
19
+ disableQueryGenerator?: boolean;
20
+ }
21
+ export interface ILoaderReturnInfo {
22
+ returnType?: 'json' | 'defer' | '';
23
+ hasOptions?: boolean;
24
+ keys?: string[];
25
+ }
26
+ export interface IRollupBuildGenerated extends IRoutePageExportFlags {
27
+ queries?: Record<string, string | object>;
28
+ componentPath?: string;
29
+ loaderReturnInfo?: ILoaderReturnInfo;
30
+ /**
31
+ * @name Dialog Path
32
+ * @description Path to the dialog component for modal routes.
33
+ */
34
+ dialogPath?: string;
35
+ }
@@ -0,0 +1,171 @@
1
+ import type { LoaderFunction, ActionFunction } from '@remix-run/router';
2
+ import type { FunctionComponent, LazyExoticComponent, ComponentType } from 'react';
3
+ import { IMenuDataItem } from './menu';
4
+ import { IGeneratedWrapperOptions } from './wrapperRouteOptions';
5
+ export interface IComponent extends FunctionComponent {
6
+ getInitialProps?: Function;
7
+ preload?: () => Promise<any>;
8
+ }
9
+ /**
10
+ * Interface defining the structure for route modules.
11
+ */
12
+ export interface IRouteModule extends IMenuDataItem, IGeneratedWrapperOptions {
13
+ /**
14
+ * @name Path
15
+ * @description The path of the route.
16
+ */
17
+ path?: string;
18
+ /**
19
+ * @name Index Route
20
+ * @description Indicates if this is an index route.
21
+ */
22
+ index?: boolean;
23
+ /**
24
+ * @name Exact Match
25
+ * @description Specifies exact matching for the route path.
26
+ */
27
+ exact?: boolean;
28
+ /**
29
+ * @name Redirect Path
30
+ * @description Path to redirect to.
31
+ */
32
+ redirect?: string;
33
+ /**
34
+ * @name Component
35
+ * @description Dynamic import of the Component to render for the route.
36
+ */
37
+ component?: () => Promise<{
38
+ default: ComponentType<any>;
39
+ }>;
40
+ /**
41
+ * @name Modal Route
42
+ * @description Indicates if the route should be displayed as a modal.
43
+ */
44
+ modal?: boolean;
45
+ /**
46
+ * @name Dialog
47
+ * @description Dynamic import of the Dialog component for modal routes.
48
+ */
49
+ dialog?: () => Promise<{
50
+ default: LazyExoticComponent<ComponentType<any>>;
51
+ }>;
52
+ /**
53
+ * @name Nested Routes
54
+ * @description Nested routes under the current route.
55
+ */
56
+ routes?: IRouteModule[];
57
+ /**
58
+ * @name Route Key
59
+ * @description Unique key for the route.
60
+ */
61
+ key?: string;
62
+ /**
63
+ * @name Strict Match
64
+ * @description Applies strict matching to trailing slashes.
65
+ */
66
+ strict?: boolean;
67
+ /**
68
+ * @name Case-Sensitive Route
69
+ * @description Indicates if the route is case-sensitive.
70
+ */
71
+ sensitive?: boolean;
72
+ /**
73
+ * @name Wrapper Components
74
+ * @description Wrapper components to wrap the route's component.
75
+ */
76
+ wrappers?: any[];
77
+ /**
78
+ * @name Data Loader
79
+ * @description Function to load data for the route.
80
+ */
81
+ loader?: LoaderFunction;
82
+ /**
83
+ * @name Action Handler
84
+ * @description Function to handle actions on the route.
85
+ */
86
+ action?: ActionFunction;
87
+ /**
88
+ * @name Authentication Requirement
89
+ * @description Indicates if authentication is required for the route.
90
+ */
91
+ auth?: boolean;
92
+ /**
93
+ * @name Props
94
+ * @description Extra properties for the route, including initial parameters and UI options.
95
+ */
96
+ props?: {
97
+ initialParams?: Record<string, any>;
98
+ options?: Record<string, any>;
99
+ };
100
+ /**
101
+ * @name Import Paths
102
+ * @description Additional import paths for route components based on user roles or other conditions.
103
+ */
104
+ importPaths?: Record<string, string> | Record<string, () => Promise<{
105
+ default: React.ComponentType<any>;
106
+ }>>;
107
+ /**
108
+ * @name Unauthenticated Component
109
+ * @description Component path or import for unauthenticated users.
110
+ */
111
+ unauthenticatedComponent?: string;
112
+ /**
113
+ * @name Options
114
+ * @description Additional options for the route, such as header settings and color configuration.
115
+ */
116
+ options?: {
117
+ headerShown?: boolean;
118
+ title?: string;
119
+ /**
120
+ * @name Description
121
+ * @description Description text for display in onboarding or account sections.
122
+ */
123
+ description?: string;
124
+ headerBackTitle?: string;
125
+ tabBarActiveTintColor?: string;
126
+ tabBarInactiveTintColor?: string;
127
+ tabBarLabel?: string;
128
+ priority?: number;
129
+ presentation?: string;
130
+ /**
131
+ * @name Next Step
132
+ * @description Key for the next step in a multi-step process, such as onboarding.
133
+ */
134
+ next?: string;
135
+ /**
136
+ * @name Previous Step
137
+ * @description Key for the previous step in a multi-step process, such as onboarding.
138
+ */
139
+ prev?: string;
140
+ };
141
+ /**
142
+ * @name Initial Parameters
143
+ * @description Initial parameters to pass into the route when loading.
144
+ */
145
+ initialParams?: Record<string, any>;
146
+ /**
147
+ * @name Title
148
+ * @description Title for display in UI sections like onboarding.
149
+ */
150
+ title?: string;
151
+ /**
152
+ * @name Description
153
+ * @description Description text for display in onboarding or account sections.
154
+ */
155
+ description?: string;
156
+ /**
157
+ * @name Next Step
158
+ * @description Key for the next step in a multi-step process, such as onboarding.
159
+ */
160
+ next?: string;
161
+ /**
162
+ * @name Previous Step
163
+ * @description Key for the previous step in a multi-step process, such as onboarding.
164
+ */
165
+ prev?: string;
166
+ /**
167
+ * @name Additional Properties
168
+ * @description Allows additional properties to be added as needed.
169
+ */
170
+ [k: string]: any;
171
+ }
@@ -0,0 +1,9 @@
1
+ import { IRollupBuildGenerated } from './rollupRouteGenerated';
2
+ import { IRouteModule } from './routeCompute';
3
+ /**
4
+ * @name IComputedRoutesArray
5
+ * @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
+ */
7
+ export type IComputedRoutesArray = Array<{
8
+ [key: string]: IRouteModule & IRollupBuildGenerated;
9
+ }>;
@@ -0,0 +1,39 @@
1
+ /**
2
+ *
3
+ *
4
+ * const settings: ISettings = {
5
+ * componentReplacement: {
6
+ * enabled: true,
7
+ * replacements: {
8
+ * '*': "path/to/globalReplacementComponent.js", // Global replacement component for all routes
9
+ * '/home': "path/to/homeReplacementComponent.js",
10
+ * '/about': "path/to/aboutReplacementComponent.js",
11
+ * '/contact': "path/to/contactReplacementComponent.js"
12
+ * },
13
+ * excludeRoutes: ['/contact', '/settings'] // Exclude these routes from replacement
14
+ * },
15
+ * // other settings
16
+ * };
17
+ */
18
+ export interface IViteSettings {
19
+ disableLoader?: boolean;
20
+ disableAction?: boolean;
21
+ disableClientLoader?: boolean;
22
+ disableErrorBoundary?: boolean;
23
+ disableLinks?: boolean;
24
+ disableMeta?: boolean;
25
+ disableHydrateFallback?: boolean;
26
+ disableShouldRevalidate?: boolean;
27
+ disableHandle?: boolean;
28
+ disableHeaders?: boolean;
29
+ disableClientAction?: boolean;
30
+ disableExtraProps?: boolean;
31
+ disableClientMiddlewares?: boolean;
32
+ componentReplacement?: {
33
+ enabled?: boolean;
34
+ replacements?: {
35
+ [routeKey: string]: string;
36
+ };
37
+ excludeRoutes?: string[];
38
+ };
39
+ }
@@ -0,0 +1,134 @@
1
+ import { IAuthorityConfig } from './authority';
2
+ import { IRollupBuildGenerated } from './rollupRouteGenerated';
3
+ import { IViteSettings } from './viteSettings';
4
+ export interface IWrapperConfigPaths {
5
+ configPermissionWrapper?: string;
6
+ authMiddlware?: string;
7
+ configurationMiddlewareExec?: string;
8
+ lifecycleMiddleware?: string;
9
+ middlewareExec?: string;
10
+ clientMiddlewareExec?: string;
11
+ withErrorHandlerUtil?: string;
12
+ }
13
+ export interface IWrapperBuildOptions {
14
+ suffix?: string;
15
+ requireAuth?: boolean;
16
+ authStrategy?: boolean | string | null;
17
+ settings?: IViteSettings;
18
+ paths?: IWrapperConfigPaths;
19
+ }
20
+ export interface IResourceParams {
21
+ /**
22
+ * @name Fragment
23
+ * @description Fragment of the resource path.
24
+ */
25
+ fragment?: string;
26
+ /**
27
+ * @name Query Parameters
28
+ * @description Query parameters for resource handling.
29
+ */
30
+ query?: Record<string, string>;
31
+ /**
32
+ * @name Configuration Key
33
+ * @description Configuration key for resource parameters.
34
+ */
35
+ configKey?: string;
36
+ /**
37
+ * @name Resource Path
38
+ * @description Path related to the resource.
39
+ */
40
+ path?: string;
41
+ isExternal: boolean;
42
+ organization?: string;
43
+ projectId?: string;
44
+ resourceType?: string;
45
+ resourceId?: string;
46
+ }
47
+ /**
48
+ * @name IMissingWrapperOptions
49
+ * @description Fields missing from IWrapperOptions that exist in IOptions.
50
+ */
51
+ export interface IGeneratedWrapperOptions {
52
+ /**
53
+ * @name Wrapper Component Paths
54
+ * @description Array of wrapper component paths for consistent layout.
55
+ */
56
+ wrapperPaths?: string[];
57
+ /**
58
+ * @name Middlewares
59
+ * @description Array of middleware functions for the route.
60
+ */
61
+ middlewares?: any[];
62
+ /**
63
+ * @name Client Middlewares
64
+ * @description Array of client-side middleware paths applied to the route.
65
+ */
66
+ clientMiddlewares?: string[];
67
+ /**
68
+ * @name Authority
69
+ * @description List of permissions required to access the route.
70
+ */
71
+ authority?: string[];
72
+ /**
73
+ * @name Additional Parameters
74
+ * @description Additional parameters for resource configuration.
75
+ */
76
+ extraParams?: {
77
+ /**
78
+ * @name Resource Parameters
79
+ * @description Parameters specific to resource handling.
80
+ */
81
+ resourceParams?: IResourceParams;
82
+ };
83
+ /**
84
+ * @name Configurations
85
+ * @description Configuration keys related to the route.
86
+ */
87
+ configurations?: string[];
88
+ /**
89
+ * @name Extra Permissions
90
+ * @description Additional permissions required for the UI.
91
+ */
92
+ extraPermissions?: string[];
93
+ /**
94
+ * @name Resource Endpoint
95
+ * @description Designates the route as a resource endpoint.
96
+ */
97
+ isResourceRoute?: boolean;
98
+ /**
99
+ * @name Extra Properties
100
+ * @description Additional properties for the route component.
101
+ */
102
+ extraProps?: any;
103
+ /**
104
+ * @name Server-Side Code
105
+ * @description Indicates if the route has server-side code.
106
+ */
107
+ hasServerCode?: boolean;
108
+ /**
109
+ * @name Component Path
110
+ * @description The file path to the route's component.
111
+ */
112
+ componentPath?: string;
113
+ /**
114
+ * @name Resource URI
115
+ * @description URI representing the resource associated with the route.
116
+ */
117
+ resourceUri?: string;
118
+ /**
119
+ * @name Extra Icons
120
+ * @description Additional icons for the route.
121
+ */
122
+ extraIcons?: any[];
123
+ /**
124
+ * @name Extra Links
125
+ * @description Additional links for the route.
126
+ */
127
+ extraLink?: any[];
128
+ /**
129
+ * @name Authority Configuration
130
+ * @description Configuration for authority and permission checks.
131
+ */
132
+ authorityConfig?: IAuthorityConfig;
133
+ }
134
+ export type IWrapperOptions = IWrapperBuildOptions & IRollupBuildGenerated & IGeneratedWrapperOptions;
@@ -0,0 +1 @@
1
+ export * from './component';
@@ -0,0 +1 @@
1
+ export{IMenuPosition}from'./component/interfaces/menu.js';//# sourceMappingURL=index.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.component.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@common-stack/core",
3
- "version": "6.0.2-alpha.1",
3
+ "version": "6.0.6-alpha.104",
4
4
  "description": "Common core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -26,5 +26,5 @@
26
26
  "typescript": {
27
27
  "definition": "lib/index.d.ts"
28
28
  },
29
- "gitHead": "c13fa6b22a45926ce70f69b5d1215bad58bf40bb"
29
+ "gitHead": "b0c1313acf4b328cbd1df20c9648b4415104ae81"
30
30
  }