@zango-core/crm-framework 0.2.2 → 1.0.10

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,62 @@
1
+ import n from "react";
2
+ import { N as o, L as r, T as u, C as s, a as l } from "./index.framework-CmcZiUOr.js";
3
+ const i = {
4
+ crud: {
5
+ component: s,
6
+ includeBasePath: !0,
7
+ // standalone:true,
8
+ propsBuilder: ({ matchedRoutePath: e }) => ({})
9
+ },
10
+ training: {
11
+ component: u,
12
+ includeBasePath: !0,
13
+ propsBuilder: ({ matchedRoutePath: e }) => ({})
14
+ },
15
+ login: {
16
+ component: r,
17
+ includeBasePath: !0,
18
+ // Login needs basePath for sub-routes
19
+ standalone: !0,
20
+ // Render without layout (no sidebar/topbar)
21
+ propsBuilder: ({ matchedRoutePath: e }) => ({})
22
+ },
23
+ // profile360: {
24
+ // component: Profile360,
25
+ // propsBuilder: ({ apiConfig }) => ({
26
+ // apiConfig: {
27
+ // baseUrl: apiConfig.apiUrl,
28
+ // headers: apiConfig.headers
29
+ // }
30
+ // })
31
+ // },
32
+ custom: {
33
+ component: null,
34
+ includeBasePath: !1,
35
+ // Explicitly disable basePath for custom pages
36
+ handler: ({ customPages: e, customPagePath: t, location: d }) => {
37
+ const a = e[t];
38
+ return a ? n.createElement(a) : n.createElement(l, { componentName: t });
39
+ }
40
+ },
41
+ 404: {
42
+ component: o,
43
+ standalone: !0,
44
+ includeBasePath: !1,
45
+ // Explicitly disable basePath for 404
46
+ propsBuilder: () => ({})
47
+ },
48
+ // Default configuration for unknown page types
49
+ default: {
50
+ component: o,
51
+ includeBasePath: !1,
52
+ // Explicitly disable for unknown types
53
+ standalone: !0,
54
+ propsBuilder: ({ pageType: e }) => ({
55
+ message: `Unknown page type: ${e}`
56
+ })
57
+ }
58
+ };
59
+ export {
60
+ i as default
61
+ };
62
+ //# sourceMappingURL=PageTypeRegistry-DCEjBIBb.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageTypeRegistry-DCEjBIBb.js","sources":["../src/framework/routing/PageTypeRegistry.ts"],"sourcesContent":["import React from 'react';\nimport CrudPage from '../pages/CrudPage';\nimport TrainingPage from '../pages/TrainingPage';\n// import Profile360 from 'profile360';\n// import 'profile360/dist/index.css';\nimport CustomPageLoader from '../components/CustomPageLoader';\nimport NotFoundPage from '../pages/NotFoundPage';\nimport LoginPage from '../pages/LoginPage';\n\ninterface PageTypeConfig {\n component?: React.ComponentType<any> | null;\n includeBasePath?: boolean;\n standalone?: boolean;\n propsBuilder?: (params: any) => any;\n handler?: (params: any) => React.ReactElement;\n}\n\ninterface PageTypeRegistry {\n [key: string]: PageTypeConfig;\n}\n\n/**\n * Page Type Registry - Centralized configuration for all page types\n * \n * Each page type can have:\n * - component: The React component to render\n * - includeBasePath: Whether to pass basePath prop (defaults to true)\n * - propsBuilder: Function to build additional props\n * - handler: Custom rendering function (overrides component)\n */\nconst pageTypeRegistry: PageTypeRegistry = {\n crud: {\n component: CrudPage,\n includeBasePath: true,\n // standalone:true,\n propsBuilder: ({ matchedRoutePath }) => ({}),\n },\n\n training: {\n component: TrainingPage,\n includeBasePath: true,\n propsBuilder: ({ matchedRoutePath }) => ({}),\n },\n\n login: {\n component: LoginPage,\n includeBasePath: true, // Login needs basePath for sub-routes\n standalone: true, // Render without layout (no sidebar/topbar)\n propsBuilder: ({ matchedRoutePath }) => ({}),\n },\n\n // profile360: {\n // component: Profile360,\n // propsBuilder: ({ apiConfig }) => ({\n // apiConfig: {\n // baseUrl: apiConfig.apiUrl,\n // headers: apiConfig.headers\n // }\n // })\n // },\n\n custom: {\n component: null,\n includeBasePath: false, // Explicitly disable basePath for custom pages\n handler: ({ customPages, customPagePath, location }: any) => {\n const CustomComponent = customPages[customPagePath];\n if (CustomComponent) {\n return React.createElement(CustomComponent);\n }\n // Fallback to CustomPageLoader with component name from route config\n return React.createElement(CustomPageLoader, { componentName: customPagePath });\n },\n },\n\n 404: {\n component: NotFoundPage,\n standalone: true,\n includeBasePath: false, // Explicitly disable basePath for 404\n propsBuilder: () => ({}),\n },\n\n // Default configuration for unknown page types\n default: {\n component: NotFoundPage,\n includeBasePath: false, // Explicitly disable for unknown types\n standalone: true,\n propsBuilder: ({ pageType }) => ({\n message: `Unknown page type: ${pageType}`,\n }),\n },\n};\n\nexport default pageTypeRegistry;"],"names":["pageTypeRegistry","CrudPage","matchedRoutePath","TrainingPage","LoginPage","customPages","customPagePath","location","CustomComponent","React","CustomPageLoader","NotFoundPage","pageType"],"mappings":";;AA8BA,MAAMA,IAAqC;AAAA,EACzC,MAAM;AAAA,IACJ,WAAWC;AAAA,IACX,iBAAiB;AAAA;AAAA,IAEjB,cAAc,CAAC,EAAE,kBAAAC,EAAA,OAAwB,CAAA;AAAA,EAAC;AAAA,EAG5C,UAAU;AAAA,IACR,WAAWC;AAAA,IACX,iBAAiB;AAAA,IACjB,cAAc,CAAC,EAAE,kBAAAD,EAAA,OAAwB,CAAA;AAAA,EAAC;AAAA,EAG5C,OAAO;AAAA,IACL,WAAWE;AAAA,IACX,iBAAiB;AAAA;AAAA,IACjB,YAAY;AAAA;AAAA,IACZ,cAAc,CAAC,EAAE,kBAAAF,EAAA,OAAwB,CAAA;AAAA,EAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAa5C,QAAQ;AAAA,IACN,WAAW;AAAA,IACX,iBAAiB;AAAA;AAAA,IACjB,SAAS,CAAC,EAAE,aAAAG,GAAa,gBAAAC,GAAgB,UAAAC,QAAoB;AAC3D,YAAMC,IAAkBH,EAAYC,CAAc;AAClD,aAAIE,IACKC,EAAM,cAAcD,CAAe,IAGrCC,EAAM,cAAcC,GAAkB,EAAE,eAAeJ,GAAgB;AAAA,IAChF;AAAA,EAAA;AAAA,EAGF,KAAK;AAAA,IACH,WAAWK;AAAA,IACX,YAAY;AAAA,IACZ,iBAAiB;AAAA;AAAA,IACjB,cAAc,OAAO,CAAA;AAAA,EAAC;AAAA;AAAA,EAIxB,SAAS;AAAA,IACP,WAAWA;AAAA,IACX,iBAAiB;AAAA;AAAA,IACjB,YAAY;AAAA,IACZ,cAAc,CAAC,EAAE,UAAAC,SAAgB;AAAA,MAC/B,SAAS,sBAAsBA,CAAQ;AAAA,IAAA;AAAA,EACzC;AAEJ;"}