@admin-layout/client 12.2.4-alpha.0 → 12.2.4-alpha.12
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.
- package/lib/components/ApplicationErrorHandlerCommon.d.ts +1 -1
- package/lib/components/ApplicationErrorHandlerCommon.d.ts.map +1 -1
- package/lib/components/ApplicationErrorHandlerCommon.js +29 -15
- package/lib/components/ApplicationErrorHandlerCommon.js.map +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -1
- package/lib/components/UpdateSettings/UpdateSettings.server.js +32 -14
- package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
- package/lib/config/defaultSettings.d.ts +90 -0
- package/lib/config/defaultSettings.d.ts.map +1 -1
- package/lib/config/defaultSettings.js +91 -1
- package/lib/config/defaultSettings.js.map +1 -1
- package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
- package/lib/hooks/useLayoutSettings.js +34 -20
- package/lib/hooks/useLayoutSettings.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.native.js +1 -1
- package/lib/redux/actions/error-actions.js +1 -1
- package/lib/redux/hooks.js +1 -1
- package/lib/utils/componentSize.d.ts +1 -1
- package/lib/utils/index.d.ts +2 -0
- package/lib/utils/index.d.ts.map +1 -1
- package/lib/utils/menuUtils.d.ts +1 -1
- package/lib/utils/menuUtils.d.ts.map +1 -1
- package/lib/utils/menuUtils.js +3 -0
- package/lib/utils/menuUtils.js.map +1 -1
- package/lib/utils/settingsStorage.d.ts +53 -0
- package/lib/utils/settingsStorage.d.ts.map +1 -0
- package/lib/utils/settingsStorage.js +117 -0
- package/lib/utils/settingsStorage.js.map +1 -0
- package/lib/utils/storage.d.ts +9 -0
- package/lib/utils/storage.d.ts.map +1 -0
- package/lib/utils/storage.js +31 -0
- package/lib/utils/storage.js.map +1 -0
- package/package.json +3 -3
|
@@ -31,6 +31,6 @@ type IApplicationErrorSlotType = (props: {
|
|
|
31
31
|
* @param [RendererComponent] IRendererComponentType
|
|
32
32
|
* @returns ReactNode
|
|
33
33
|
*/
|
|
34
|
-
export declare
|
|
34
|
+
export declare function ApplicationErrorHandlerCommon(FallbackComponent: any, ApplicationErrorSlot?: IApplicationErrorSlotType, RendererComponent?: IRendererComponentType): ({ plugins, children }: ApplicationErrorHandlerCommonProps) => ReactElement;
|
|
35
35
|
export {};
|
|
36
36
|
//# sourceMappingURL=ApplicationErrorHandlerCommon.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationErrorHandlerCommon.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationErrorHandlerCommon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,kBAAkB,CAAC;AAI1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD;;;GAGG;AACH,UAAU,kCAAkC;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE;IACpC,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;IAC3C,YAAY,EAAE,qBAAqB,CAAA;CACpC,KAAK,YAAY,CAAC;AAEnB,KAAK,yBAAyB,GAAG,CAC/B,KAAK,EAAE;IACL,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,MAAM,EAAE,OAAO,CAAC;QAChB,iBAAiB,EAAE,qBAAqB,EAAE,CAAA;KAC3C,CAAA;CACF,KACE,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"ApplicationErrorHandlerCommon.d.ts","sourceRoot":"","sources":["../../src/components/ApplicationErrorHandlerCommon.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,kBAAkB,CAAC;AAI1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD;;;GAGG;AACH,UAAU,kCAAkC;IAC1C,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED,KAAK,sBAAsB,GAAG,CAAC,KAAK,EAAE;IACpC,iBAAiB,EAAE,qBAAqB,EAAE,CAAC;IAC3C,YAAY,EAAE,qBAAqB,CAAA;CACpC,KAAK,YAAY,CAAC;AAEnB,KAAK,yBAAyB,GAAG,CAC/B,KAAK,EAAE;IACL,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE;QACT,MAAM,EAAE,OAAO,CAAC;QAChB,iBAAiB,EAAE,qBAAqB,EAAE,CAAA;KAC3C,CAAA;CACF,KACE,YAAY,CAAC;AA6ClB;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAC3C,iBAAiB,KAAA,EACjB,oBAAoB,CAAC,EAAE,yBAAyB,EAChD,iBAAiB,CAAC,EAAE,sBAAsB,IAEO,uBAAuB,kCAAkC,KAAG,YAAY,CAqB1H"}
|
|
@@ -1,21 +1,11 @@
|
|
|
1
|
-
import React__default from'react';import {useSelector}from'react-redux';import'reflect-metadata';import {Slot}from'@common-stack/components-pro';import {APPLICATION_ERROR_SLOT_FILL}from'../constants/constants.js';import {backendErrorSelector}from'../redux/selectors/index.js'
|
|
2
|
-
|
|
3
|
-
* we import Slot from @common-stack/react-mobile. The default
|
|
4
|
-
* Slot under RenderApplicationErrorSlot works for browser
|
|
5
|
-
* both ant and chakra
|
|
6
|
-
*
|
|
7
|
-
* @param FallbackComponent ReactNode
|
|
8
|
-
* @param [ApplicationErrorSlot] IApplicationErrorSlotType
|
|
9
|
-
* @param [RendererComponent] IRendererComponentType
|
|
10
|
-
* @returns ReactNode
|
|
11
|
-
*/
|
|
12
|
-
const ApplicationErrorHandlerCommon = (FallbackComponent, ApplicationErrorSlot, RendererComponent) => ({ plugins, children }) => {
|
|
1
|
+
import React__default from'react';import {useSelector}from'react-redux';import'reflect-metadata';import {Slot}from'@common-stack/components-pro';import {APPLICATION_ERROR_SLOT_FILL}from'../constants/constants.js';import {backendErrorSelector}from'../redux/selectors/index.js';// Inner component that uses Redux hooks - only rendered when Redux is available
|
|
2
|
+
function ApplicationErrorHandlerInner({ FallbackComponent, ApplicationErrorSlot, RendererComponent, plugins, children, }) {
|
|
13
3
|
const applicationErrors = useSelector((state) => state?.applicationErrors);
|
|
14
4
|
const errors = applicationErrors?.filter((error) => !!plugins.find((plugin) => plugin.name === error?.pluginName));
|
|
15
5
|
const backendError = useSelector(backendErrorSelector);
|
|
16
|
-
|
|
6
|
+
function RenderApplicationErrorSlot(props) {
|
|
17
7
|
return !!ApplicationErrorSlot ? React__default.createElement(ApplicationErrorSlot, { ...props }) : React__default.createElement(Slot, { ...props });
|
|
18
|
-
}
|
|
8
|
+
}
|
|
19
9
|
if (!!RendererComponent) {
|
|
20
10
|
return React__default.createElement(RendererComponent, { applicationErrors: errors, backendError: backendError });
|
|
21
11
|
}
|
|
@@ -24,4 +14,28 @@ const ApplicationErrorHandlerCommon = (FallbackComponent, ApplicationErrorSlot,
|
|
|
24
14
|
!!errors?.length
|
|
25
15
|
? React__default.createElement(RenderApplicationErrorSlot, { name: APPLICATION_ERROR_SLOT_FILL, fillProps: { active: true, applicationErrors: errors } })
|
|
26
16
|
: children));
|
|
27
|
-
}
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* ApplicationErrorSlot is needed for mobile. Since for mobile
|
|
20
|
+
* we import Slot from @common-stack/react-mobile. The default
|
|
21
|
+
* Slot under RenderApplicationErrorSlot works for browser
|
|
22
|
+
* both ant and chakra
|
|
23
|
+
*
|
|
24
|
+
* @param FallbackComponent ReactNode
|
|
25
|
+
* @param [ApplicationErrorSlot] IApplicationErrorSlotType
|
|
26
|
+
* @param [RendererComponent] IRendererComponentType
|
|
27
|
+
* @returns ReactNode
|
|
28
|
+
*/
|
|
29
|
+
function ApplicationErrorHandlerCommon(FallbackComponent, ApplicationErrorSlot, RendererComponent) {
|
|
30
|
+
return function ApplicationErrorHandlerComponent({ plugins, children }) {
|
|
31
|
+
// Check if we're in SSR/build mode where Redux store might not be available
|
|
32
|
+
// In SPA mode, the server renders without providers, so we just render children
|
|
33
|
+
const isSSR = typeof window === 'undefined';
|
|
34
|
+
if (isSSR) {
|
|
35
|
+
// During SSR/build, just render children without Redux functionality
|
|
36
|
+
// The client-side hydration will provide the full functionality
|
|
37
|
+
return React__default.createElement(React__default.Fragment, null, children);
|
|
38
|
+
}
|
|
39
|
+
return (React__default.createElement(ApplicationErrorHandlerInner, { FallbackComponent: FallbackComponent, ApplicationErrorSlot: ApplicationErrorSlot, RendererComponent: RendererComponent, plugins: plugins, children: children }));
|
|
40
|
+
};
|
|
41
|
+
}export{ApplicationErrorHandlerCommon};//# sourceMappingURL=ApplicationErrorHandlerCommon.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationErrorHandlerCommon.js","sources":["../../src/components/ApplicationErrorHandlerCommon.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"oRAUG;AACH
|
|
1
|
+
{"version":3,"file":"ApplicationErrorHandlerCommon.js","sources":["../../src/components/ApplicationErrorHandlerCommon.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"oRAUG;AACH,SAAA,4BAAU,CAAA,EAAA,iBAAkC,EAAA,oBAAA,EAAA,iBAAA,EAAA,OAAA,EAAA,QAAA,GAAA,EAAA;AAC1C,IAAA,MAAA,iBAAsB,GAAE,WAAK,CAAA,CAAA,KAAA,KAAA,KAAA,EAAA,iBAAA,CAAA;IAC7B,MAAA,0BAAmB,EAAA,MAAA,CAAA,CAAA,KAAA,KAAA,CAAA,CAAA,OAAA,CAAA,IAAA,CAAA,CAAA,MAAA,KAAA,MAAA,CAAA,IAAA,KAAA,KAAA,EAAA,UAAA,CAAA,CAAA;AACpB,IAAA,MAAA,YAAA,GAAA,WAAA,CAAA,oBAAA,CAAA;AAED,IAAA,SAAK,0BAAiC,CAAA,KAAA,EAAA;QACpC,OAAA,CAAA,CAAA,oBAAmB,GAAAA,cAAqB,CAAE,aAAC,CAAA,oBAAA,EAAA,EAAA,GAAA,KAAA,EAAA,CAAA,GAAAA,cAAA,CAAA,aAAA,CAAA,IAAA,EAAA,EAAA,GAAA,KAAA,EAAA,CAAA;IAC3C;AACD,IAAA,uBAAkB,EAAA;AAEnB,QAAK,OAAAA,cAAA,CAAA,aACH,CAAA,iBAAO,EAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,YAAA,EAAA,YAAA,EAAA,CAAA;IACL;AACA,IAAA,QAAAA,cAAW,CAAA,aAAA,CAAAA,cAAA,CAAA,QAAA,EAAA,IAAA;QACT,CAAA,CAAA,eAAgBA,cAAA,CAAA,aAAA,CAAA,iBAAA,EAAA,EAAA,KAAA,EAAA,YAAA,EAAA,CAAA,GAAA,IAAA;QAChB,CAAA,CAAA,MAAA,EAAA;cACDA,cAAA,CAAA,aAAA,CAAA,0BAAA,EAAA,EAAA,IAAA,EAAA,2BAAA,EAAA,SAAA,EAAA,EAAA,MAAA,EAAA,IAAA,EAAA,iBAAA,EAAA,MAAA,EAAA,EAAA;AACF,sBACe,CAAA;AA6ClB;;;;;;;;;;AAUG;AACH;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAiBA;;;;;GAKG;AACH,eAAO,MAAM,cAAc,kCAMzB,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,kBAAkB,CAAC,EAAE,MAAM;;GAoG7F;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,wBAAsB,kBAAkB,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE;;;;CAAA;;;GA4HpE;AAED,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,GAAG,SAAS,CAQrE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {print}from'graphql';import {parseEnvLayoutSettings}from'../../utils/parseEnvUiLayoutSettings.js';import {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import {generateCdecodeUri,DEFAULT_CONTRIBUTION_TENANT_ID}from'@adminide-stack/core';/**
|
|
1
|
+
import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {print}from'graphql';import {parseEnvLayoutSettings}from'../../utils/parseEnvUiLayoutSettings.js';import {config}from'../../config/env-config.js';import {DEFAULT_SETTINGS}from'../../config/defaultSettings.js';import {generateCdecodeUri,DEFAULT_CONTRIBUTION_TENANT_ID}from'@adminide-stack/core';/**
|
|
2
2
|
* Cookie configuration for storing user settings
|
|
3
3
|
* - Max age: 30 days
|
|
4
4
|
* - Client-side accessible for dynamic UI updates
|
|
@@ -78,20 +78,25 @@ async function fetchPageSettingsWithFetch(request, overrideIdentifier) {
|
|
|
78
78
|
}),
|
|
79
79
|
});
|
|
80
80
|
if (!response.ok) {
|
|
81
|
-
console.
|
|
82
|
-
|
|
81
|
+
console.warn('⚠️ GraphQL fetch failed with status:', response.status, '- Backend may be down, using empty settings');
|
|
82
|
+
// Return empty data structure instead of throwing to allow layout to render
|
|
83
|
+
return { data: { pageSettings: { settings: null } } };
|
|
83
84
|
}
|
|
84
85
|
const result = await response.json();
|
|
85
86
|
if (result.errors) {
|
|
86
|
-
console.
|
|
87
|
-
|
|
87
|
+
console.warn('⚠️ GraphQL errors:', JSON.stringify(result.errors, null, 2), '- Backend may be down, using empty settings');
|
|
88
|
+
// Return empty data structure instead of throwing to allow layout to render
|
|
89
|
+
return { data: { pageSettings: { settings: null } } };
|
|
88
90
|
}
|
|
89
91
|
console.log('✅ Settings fetched successfully (from Redis-cached backend)');
|
|
90
92
|
return { data: result.data };
|
|
91
93
|
}
|
|
92
94
|
catch (error) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
+
// Log error but return empty data instead of throwing to allow layout to render
|
|
96
|
+
console.warn('⚠️ Failed to fetch settings (backend may be down):', error?.message || error);
|
|
97
|
+
console.warn('⚠️ Returning empty settings to allow layout to render');
|
|
98
|
+
// Return empty data structure instead of throwing
|
|
99
|
+
return { data: { pageSettings: { settings: null } } };
|
|
95
100
|
}
|
|
96
101
|
}
|
|
97
102
|
/**
|
|
@@ -137,12 +142,20 @@ async function settingsLoaderUtil({ request, context, params }) {
|
|
|
137
142
|
const deviceType = getDeviceType(userAgent);
|
|
138
143
|
// 2. Fetch settings from GraphQL backend with device-specific overrides
|
|
139
144
|
// Override identifier format: "[desktop]" or "[mobile]"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
let pageBackendSettings = null;
|
|
146
|
+
try {
|
|
147
|
+
const overrideIdentifier = `[${deviceType}]`;
|
|
148
|
+
const result = await fetchPageSettingsWithFetch(request, overrideIdentifier);
|
|
149
|
+
// console.log('ddRESULT=========>', JSON.stringify(result));
|
|
150
|
+
pageBackendSettings = result?.data?.pageSettings?.settings
|
|
151
|
+
? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
|
|
152
|
+
: null;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
// If fetchPageSettingsWithFetch still throws (shouldn't happen now, but defensive coding)
|
|
156
|
+
console.warn('⚠️ Error fetching page settings, using null:', error?.message || error);
|
|
157
|
+
pageBackendSettings = null;
|
|
158
|
+
}
|
|
146
159
|
// 3. Parse request payload (only available for POST/PUT requests in actions)
|
|
147
160
|
let requestPayload = {};
|
|
148
161
|
try {
|
|
@@ -196,7 +209,12 @@ async function settingsLoaderUtil({ request, context, params }) {
|
|
|
196
209
|
}
|
|
197
210
|
// 7. Merge all settings sources in priority order (later sources override earlier)
|
|
198
211
|
// Priority: GraphQL backend → Environment → Cookie + Request payload
|
|
199
|
-
|
|
212
|
+
// Use DEFAULT_SETTINGS as fallback when backend is down (null, undefined, or empty object)
|
|
213
|
+
const effectiveBackendSettings = !pageBackendSettings ||
|
|
214
|
+
(typeof pageBackendSettings === 'object' && Object.keys(pageBackendSettings).length === 0)
|
|
215
|
+
? DEFAULT_SETTINGS
|
|
216
|
+
: pageBackendSettings;
|
|
217
|
+
const fullSettings = merge({}, effectiveBackendSettings, envLayoutSettings, cookieUpdatedSettings);
|
|
200
218
|
// 8. Validate final merged settings - detect and remove numeric key corruption
|
|
201
219
|
const numericKeysAfterFinalMerge = Object.keys(fullSettings).filter((k) => /^\d+$/.test(k));
|
|
202
220
|
if (numericKeysAfterFinalMerge.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;AA0CG,IAAA,QAAA,EAAA,KAAA;AACH,IAAA,IAAA,EAAA,GAAA;;AAoGC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoCG,IAAA,MAAA,SAAA,GAAA;AACH,QAAA,WAAA,EAAA,QAAsB;;;;AAA+C;;;AA4HpE,QAAA,cAAA,EAAA,kBAAA;AAED,QAAA,eAAA,EAAgB,qCAAkC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -76,6 +76,96 @@ export declare const SHARED_VIEW_CONFIG: {
|
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
78
|
};
|
|
79
|
+
/**
|
|
80
|
+
* Comprehensive default settings to use when backend is down
|
|
81
|
+
* These ensure header, footer, and all UI components render properly
|
|
82
|
+
*/
|
|
83
|
+
export declare const DEFAULT_SETTINGS: {
|
|
84
|
+
readonly header: {
|
|
85
|
+
readonly showHeader: true;
|
|
86
|
+
readonly showMenu: false;
|
|
87
|
+
readonly menuHeaderRender: true;
|
|
88
|
+
readonly showLogo: true;
|
|
89
|
+
readonly showSearchSlot: true;
|
|
90
|
+
readonly showRightContent: true;
|
|
91
|
+
readonly showMenuToggle: true;
|
|
92
|
+
readonly showBackButton: true;
|
|
93
|
+
readonly showPageTitle: true;
|
|
94
|
+
readonly showActionButtons: true;
|
|
95
|
+
readonly position: "fixed";
|
|
96
|
+
readonly height: "64px";
|
|
97
|
+
readonly backgroundColor: "inherit";
|
|
98
|
+
readonly elevation: 2;
|
|
99
|
+
readonly searchBarRender: true;
|
|
100
|
+
readonly searchBarBehavior: SearchBarBehavior.PERMANENT;
|
|
101
|
+
readonly searchBarOverlay: true;
|
|
102
|
+
readonly scrollThreshold: 50;
|
|
103
|
+
};
|
|
104
|
+
readonly footer: {
|
|
105
|
+
readonly showFooter: true;
|
|
106
|
+
};
|
|
107
|
+
readonly loginThemeColor: "blue";
|
|
108
|
+
readonly loginFormPosition: "center";
|
|
109
|
+
readonly loginSocials: "{\"Google\":true,\"Apple\":true,\"Facebook\":true}";
|
|
110
|
+
readonly loginBackgroundImage: any;
|
|
111
|
+
readonly verifyFormLayout: "center";
|
|
112
|
+
readonly verifyFormImageUrl: "";
|
|
113
|
+
readonly verifyFormBackgroundStyle: "color";
|
|
114
|
+
readonly verifyFormVisibleFields: "[\"firstName\",\"lastName\",\"username\",\"companyName\",\"workEmail\",\"phoneNumber\",\"dateOfBirth\"]";
|
|
115
|
+
readonly verifyFormShowSkipButton: false;
|
|
116
|
+
readonly organization: {
|
|
117
|
+
readonly members: {
|
|
118
|
+
readonly invitations: {
|
|
119
|
+
readonly showEmailInvite: true;
|
|
120
|
+
readonly showSmsInvite: true;
|
|
121
|
+
readonly showQrCodeInvite: true;
|
|
122
|
+
readonly showInviteLink: true;
|
|
123
|
+
};
|
|
124
|
+
};
|
|
125
|
+
};
|
|
126
|
+
readonly logo: "https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg";
|
|
127
|
+
readonly themeType: "light";
|
|
128
|
+
readonly theme: "default";
|
|
129
|
+
readonly navTheme: "light";
|
|
130
|
+
readonly primaryColor: "#1890ff";
|
|
131
|
+
readonly colorPrimary: "#1677FF";
|
|
132
|
+
readonly secondaryColor: "#4A5568";
|
|
133
|
+
readonly layout: "mix";
|
|
134
|
+
readonly contentWidth: ContentWidth;
|
|
135
|
+
readonly fixedHeader: true;
|
|
136
|
+
readonly fixedSidebar: true;
|
|
137
|
+
readonly colorWeak: false;
|
|
138
|
+
readonly title: "CDMBase LLC";
|
|
139
|
+
readonly iconfontUrl: "";
|
|
140
|
+
readonly showSettingPanel: true;
|
|
141
|
+
readonly titleColor: "#2869E0";
|
|
142
|
+
readonly language: "en-US";
|
|
143
|
+
readonly fontFamily: "Poppins, sans-serif";
|
|
144
|
+
readonly titleFontWeight: "700";
|
|
145
|
+
readonly titleHeight: "30px";
|
|
146
|
+
readonly titleFontSize: "1.8rem";
|
|
147
|
+
readonly letterSpacings: "1px";
|
|
148
|
+
readonly navigationMode: NavigationMode;
|
|
149
|
+
readonly sideMenuType: SideMenuType;
|
|
150
|
+
readonly splitMenus: false;
|
|
151
|
+
readonly upperMenuDividerName: "Navigation";
|
|
152
|
+
readonly middleMenuDividerName: "Dashboard";
|
|
153
|
+
readonly lowerMenuDividerName: "Admin";
|
|
154
|
+
readonly background: {
|
|
155
|
+
readonly type: "video";
|
|
156
|
+
readonly color: "inherit";
|
|
157
|
+
readonly image: "";
|
|
158
|
+
readonly video: "https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view-orig.webm";
|
|
159
|
+
readonly videoThumbnail: "https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view.webp";
|
|
160
|
+
};
|
|
161
|
+
readonly components: readonly [];
|
|
162
|
+
readonly hiddenMenuKeys: readonly [];
|
|
163
|
+
readonly hiddenMenuCategories: readonly [];
|
|
164
|
+
readonly activeComponent: any;
|
|
165
|
+
readonly siderBgColor: "#000000";
|
|
166
|
+
readonly headerBgColor: "#000000";
|
|
167
|
+
readonly textColor: "#a19c9c";
|
|
168
|
+
};
|
|
79
169
|
export type ISettings = ProSettings & {
|
|
80
170
|
logo: string;
|
|
81
171
|
showSettingPanel: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSettings.d.ts","sourceRoot":"","sources":["../../src/config/defaultSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,eAAO,MAAM,cAAc;kBACE,YAAY;;;;CAIxC,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;CAiB1B,CAAC;AAEF,eAAO,MAAM,YAAY;;;;CAIf,CAAC;AAEX,eAAO,MAAM,SAAS,yIAaZ,CAAC;AAGX,eAAO,MAAM,kBAAk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OAAO,CAAC;oBACzB,iBAAiB,EAAE,iBAAiB,CAAC;oBACrC,gBAAgB,EAAE,OAAO,CAAC;oBAC1B,eAAe,EAAE,MAAM,CAAC;iBAC3B,CAAC;gBACF,UAAU,EAAE;oBACR,IAAI,EAAE,MAAM,CAAC;oBACb,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;oBACd,KAAK,EAAE,MAAM,CAAC;iBACjB,CAAC;gBACF,MAAM,EAAE;oBACJ,UAAU,EAAE,OAAO,CAAC;iBACvB,CAAC;aACL,CAAC;SACL,CAAC;KACL,CACJ,CAAC;IACF,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC,CAAC"}
|
|
@@ -67,4 +67,94 @@ const SHARED_VIEW_CONFIG = {
|
|
|
67
67
|
},
|
|
68
68
|
footer: { showFooter: true },
|
|
69
69
|
},
|
|
70
|
-
};
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* Comprehensive default settings to use when backend is down
|
|
73
|
+
* These ensure header, footer, and all UI components render properly
|
|
74
|
+
*/
|
|
75
|
+
const DEFAULT_SETTINGS = {
|
|
76
|
+
header: {
|
|
77
|
+
showHeader: true,
|
|
78
|
+
showMenu: false,
|
|
79
|
+
menuHeaderRender: true,
|
|
80
|
+
showLogo: true,
|
|
81
|
+
showSearchSlot: true,
|
|
82
|
+
showRightContent: true,
|
|
83
|
+
showMenuToggle: true,
|
|
84
|
+
showBackButton: true,
|
|
85
|
+
showPageTitle: true,
|
|
86
|
+
showActionButtons: true,
|
|
87
|
+
position: 'fixed',
|
|
88
|
+
height: '64px',
|
|
89
|
+
backgroundColor: 'inherit',
|
|
90
|
+
elevation: 2,
|
|
91
|
+
searchBarRender: true,
|
|
92
|
+
searchBarBehavior: SearchBarBehavior.PERMANENT,
|
|
93
|
+
searchBarOverlay: true,
|
|
94
|
+
scrollThreshold: 50,
|
|
95
|
+
},
|
|
96
|
+
footer: {
|
|
97
|
+
showFooter: true,
|
|
98
|
+
},
|
|
99
|
+
loginThemeColor: 'blue',
|
|
100
|
+
loginFormPosition: 'center',
|
|
101
|
+
loginSocials: '{"Google":true,"Apple":true,"Facebook":true}',
|
|
102
|
+
loginBackgroundImage: null,
|
|
103
|
+
verifyFormLayout: 'center',
|
|
104
|
+
verifyFormImageUrl: '',
|
|
105
|
+
verifyFormBackgroundStyle: 'color',
|
|
106
|
+
verifyFormVisibleFields: '["firstName","lastName","username","companyName","workEmail","phoneNumber","dateOfBirth"]',
|
|
107
|
+
verifyFormShowSkipButton: false,
|
|
108
|
+
organization: {
|
|
109
|
+
members: {
|
|
110
|
+
invitations: {
|
|
111
|
+
showEmailInvite: true,
|
|
112
|
+
showSmsInvite: true,
|
|
113
|
+
showQrCodeInvite: true,
|
|
114
|
+
showInviteLink: true,
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
logo: 'https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg',
|
|
119
|
+
themeType: 'light',
|
|
120
|
+
theme: 'default',
|
|
121
|
+
navTheme: 'light',
|
|
122
|
+
primaryColor: '#1890ff',
|
|
123
|
+
colorPrimary: '#1677FF',
|
|
124
|
+
secondaryColor: '#4A5568',
|
|
125
|
+
layout: 'mix',
|
|
126
|
+
contentWidth: 'Fluid',
|
|
127
|
+
fixedHeader: true,
|
|
128
|
+
fixedSidebar: true,
|
|
129
|
+
colorWeak: false,
|
|
130
|
+
title: 'CDMBase LLC',
|
|
131
|
+
iconfontUrl: '',
|
|
132
|
+
showSettingPanel: true,
|
|
133
|
+
titleColor: '#2869E0',
|
|
134
|
+
language: 'en-US',
|
|
135
|
+
fontFamily: 'Poppins, sans-serif',
|
|
136
|
+
titleFontWeight: '700',
|
|
137
|
+
titleHeight: '30px',
|
|
138
|
+
titleFontSize: '1.8rem',
|
|
139
|
+
letterSpacings: '1px',
|
|
140
|
+
navigationMode: 'topbar',
|
|
141
|
+
sideMenuType: 'perplexLayout',
|
|
142
|
+
splitMenus: false,
|
|
143
|
+
upperMenuDividerName: 'Navigation',
|
|
144
|
+
middleMenuDividerName: 'Dashboard',
|
|
145
|
+
lowerMenuDividerName: 'Admin',
|
|
146
|
+
background: {
|
|
147
|
+
type: 'video',
|
|
148
|
+
color: 'inherit',
|
|
149
|
+
image: '',
|
|
150
|
+
video: 'https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view-orig.webm',
|
|
151
|
+
videoThumbnail: 'https://d1tsi4dpgrrap2.cloudfront.net/_site/pubng-mountain-view.webp',
|
|
152
|
+
},
|
|
153
|
+
components: [],
|
|
154
|
+
hiddenMenuKeys: [],
|
|
155
|
+
hiddenMenuCategories: [],
|
|
156
|
+
activeComponent: null,
|
|
157
|
+
siderBgColor: '#000000',
|
|
158
|
+
headerBgColor: '#000000',
|
|
159
|
+
textColor: '#a19c9c',
|
|
160
|
+
};export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG};//# sourceMappingURL=defaultSettings.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACS,MAAA,cAAc;AAGvB,IAAA,qBAAa;qBACgB;;;;AAI3B,MAAA,cAAA,GAAA;AAEF,IAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;AAiBE,MAAA,YAAA,GAAA;AAEF,IAAA,MAAA,EAAA;;;;AAIW,MAAA,SAAA,GAAA;AAEX,IAAA,MAAA;AAgBA,IAAA,MAAA
|
|
1
|
+
{"version":3,"file":"defaultSettings.js","sources":["../../src/config/defaultSettings.ts"],"sourcesContent":[null],"names":[],"mappings":"0DACA;AACS,MAAA,cAAc;AAGvB,IAAA,qBAAa;qBACgB;;;;AAI3B,MAAA,cAAA,GAAA;AAEF,IAAA,QAAA,EAAA;;;;;;;;;;;;;;;;;AAiBE,MAAA,YAAA,GAAA;AAEF,IAAA,MAAA,EAAA;;;;AAIW,MAAA,SAAA,GAAA;AAEX,IAAA,MAAA;AAgBA,IAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwBE,UAAA,EAAA,IAAA;AAEF,QAAA,QAAA,EAAA,KAAA;;;AAGG,QAAA,cAAA,EAAA,IAAA;AACH,QAAA,gBAAa,EAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB;;
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAOA,wBAAgB,iBAAiB;;0BAuDV,GAAG,0BAA0B,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;EAuEtE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useParams}from'@remix-run/react';import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';function useLayoutSettings() {
|
|
1
|
+
import {useParams}from'@remix-run/react';import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {isSpaMode,settingsStorage}from'../utils/settingsStorage.js';function useLayoutSettings() {
|
|
2
2
|
const dispatch = useDispatch();
|
|
3
3
|
useSelector((state) => state.settings, shallowEqual);
|
|
4
4
|
// Filter out machine internal state - settings are now flat (no uilayout wrapper)
|
|
@@ -11,10 +11,16 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
11
11
|
return cleaned;
|
|
12
12
|
}, shallowEqual);
|
|
13
13
|
const { orgName: orgNameFromParams } = useSelector((state) => ({
|
|
14
|
-
orgName: state
|
|
14
|
+
orgName: state?.platform?.orgName ?? '',
|
|
15
15
|
}), shallowEqual);
|
|
16
16
|
const { orgName: orgNameFromUrl } = useParams();
|
|
17
17
|
const getSettings = useCallback(async () => {
|
|
18
|
+
// In SPA mode, get settings from localStorage
|
|
19
|
+
if (isSpaMode()) {
|
|
20
|
+
const localSettings = settingsStorage.get();
|
|
21
|
+
return localSettings || {};
|
|
22
|
+
}
|
|
23
|
+
// In SSR mode, fetch from server
|
|
18
24
|
try {
|
|
19
25
|
const response = await fetch('/resources/settings', {
|
|
20
26
|
method: 'GET',
|
|
@@ -34,7 +40,7 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
34
40
|
// Return default settings if there's an error
|
|
35
41
|
return {};
|
|
36
42
|
}
|
|
37
|
-
}, []);
|
|
43
|
+
}, [orgNameFromParams, orgNameFromUrl]);
|
|
38
44
|
const setSettings = useCallback(async (config, currentChangedSetting) => {
|
|
39
45
|
try {
|
|
40
46
|
// 1. Calculate payload first
|
|
@@ -54,22 +60,30 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
54
60
|
if (colorWeak !== undefined && settings.colorWeak !== colorWeak) {
|
|
55
61
|
updateColorWeak(!!colorWeak);
|
|
56
62
|
}
|
|
57
|
-
// 3.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
63
|
+
// 3. Persist settings based on mode (SPA vs SSR)
|
|
64
|
+
if (isSpaMode()) {
|
|
65
|
+
// SPA mode: Save to localStorage
|
|
66
|
+
settingsStorage.merge(currentChangedSetting);
|
|
67
|
+
console.log('[useLayoutSettings] Settings saved to localStorage (SPA mode)');
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
// SSR mode: Make API call to save via cookies
|
|
71
|
+
const response = await fetch('/resources/settings', {
|
|
72
|
+
method: 'POST',
|
|
73
|
+
headers: {
|
|
74
|
+
'Content-Type': 'application/json',
|
|
75
|
+
orgName: orgNameFromParams || orgNameFromUrl || '',
|
|
76
|
+
},
|
|
77
|
+
body: JSON.stringify({
|
|
78
|
+
config: currentChangedSetting,
|
|
79
|
+
deviceType: getClientDeviceType(),
|
|
80
|
+
}),
|
|
81
|
+
});
|
|
82
|
+
if (!response.ok) {
|
|
83
|
+
const errorText = await response.text();
|
|
84
|
+
console.error('Server error response:', errorText.substring(0, 500));
|
|
85
|
+
throw new Error('Failed to update settings');
|
|
86
|
+
}
|
|
73
87
|
}
|
|
74
88
|
// 4. update redux
|
|
75
89
|
let payloadToDispatch = currentChangedSetting;
|
|
@@ -86,7 +100,7 @@ import {useParams}from'@remix-run/react';import {useCallback}from'react';import
|
|
|
86
100
|
console.error('setSettings error:', error);
|
|
87
101
|
return null;
|
|
88
102
|
}
|
|
89
|
-
}, [dispatch, settings]);
|
|
103
|
+
}, [dispatch, settings, orgNameFromParams, orgNameFromUrl]);
|
|
90
104
|
return { settings, setSettings, getSettings };
|
|
91
105
|
}
|
|
92
106
|
function updateColorWeak(colorWeak) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutSettings.js","sources":[
|
|
1
|
+
{"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/lib/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';export{blue}from'./colors/presets/blue.js';export{brinkPink}from'./colors/presets/brinkPink.js';export{cyan}from'./colors/presets/cyan.js';export{green}from'./colors/presets/green.js';export{lime}from'./colors/presets/lime.js';export{orange}from'./colors/presets/orange.js';export{pink}from'./colors/presets/pink.js';export{purple}from'./colors/presets/purple.js';export{red}from'./colors/presets/red.js';export{skyBlue}from'./colors/presets/skyBlue.js';export{turquoise}from'./colors/presets/turquoise.js';export{yellow}from'./colors/presets/yellow.js';export{white}from'./colors/presets/white.js';export{black}from'./colors/presets/black.js';export{colorList,getThemeColors}from'./colors/colorsList.js';//# sourceMappingURL=index.js.map
|
|
1
|
+
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';export{useLayoutSettings}from'./hooks/useLayoutSettings.js';export{usePermissionAutoFetch,useSetting,useSettingsLoader}from'@adminide-stack/platform-client';export{ClientOnly}from'./hooks/Client-only.js';export{blue}from'./colors/presets/blue.js';export{brinkPink}from'./colors/presets/brinkPink.js';export{cyan}from'./colors/presets/cyan.js';export{green}from'./colors/presets/green.js';export{lime}from'./colors/presets/lime.js';export{orange}from'./colors/presets/orange.js';export{pink}from'./colors/presets/pink.js';export{purple}from'./colors/presets/purple.js';export{red}from'./colors/presets/red.js';export{skyBlue}from'./colors/presets/skyBlue.js';export{turquoise}from'./colors/presets/turquoise.js';export{yellow}from'./colors/presets/yellow.js';export{white}from'./colors/presets/white.js';export{black}from'./colors/presets/black.js';export{colorList,getThemeColors}from'./colors/colorsList.js';//# sourceMappingURL=index.js.map
|
package/lib/index.native.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';//# sourceMappingURL=index.native.js.map
|
|
1
|
+
export{SearchBarBehavior}from'./interfaces/settings.js';export{APPLICATION_ERROR_SLOT_FILL,CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'./constants/constants.js';export{BACKEND_ERROR,CLEAR_APPLICATION_ERRORS,DISMISS_APPLICATION_ERROR,LOG_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS}from'./constants/error.js';export{HEADER_SEARCHBAR_FILL,HEADER_SEARCH_BUTTON_FILL,RIGHT_CONTENT_FILL,SCROLL_END_FILL}from'./constants/layout.js';export{languages}from'./constants/languages.js';export{dismissApplicationError,restoreApplicationError,setApplicationError}from'./redux/actions/error-actions.js';export{applicationErrors,initialErrorsState}from'./redux/reducers/error.js';export{settingsReducer}from'./redux/reducers/settings.js';export{store}from'./redux/store.js';export{useAppDispatch,useAppSelector}from'./redux/hooks.js';export{getMenuSeparation}from'./utils/seperatedMenus.js';export{useComponentSize,useIsomorphicLayoutEffect}from'./utils/componentSize.js';export{matchParentRoute}from'./utils/parentRoute.js';export{addProLayoutParentKeys,filterRoutesWithLocale,menuDataRender,removeUnnecessaryProperties,setLocale,transformData}from'./utils/menuUtils.js';export{getMatchMenuKeys}from'./utils/matchMenuKeys.js';export{generateMenuPath}from'./utils/generateMenuLink.js';export{compareAndSaveSettingsDifferences}from'./utils/settingsDifference.js';export{safeLocalStorage}from'./utils/storage.js';export{getStorageMode,isSpaMode,settingsStorage}from'./utils/settingsStorage.js';export{ApplicationErrorHandlerCommon}from'./components/ApplicationErrorHandlerCommon.js';export{ErrorBoundaryCommon}from'./components/ErrorBoundaryCommon.js';export{ApplicationErrorFillWrapper}from'./components/ApplicationErrorFillWrapper.js';export{LayoutCookieProvider}from'./components/LayoutCookieProvider.js';export{ErrorLink,errorReduxLink}from'./graphql/link/error-link.js';export{systemFont}from'./themes/systemFont/index.js';export{borderRadius,colors,lightLayoutTheme,lightNavigationBarTheme,lightTabBarTheme,shadows,sizes,spacings,textVariants}from'./themes/templates/lightLayoutTheme.js';export{createLayoutTheme}from'./themes/templates/createLayoutTheme.js';export{darkColors,darkLayoutTheme,darkNavigationBarTheme,darkTabBarTheme}from'./themes/templates/darkLayoutTheme.js';export{config}from'./config/env-config.js';export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,DEFAULT_SETTINGS,SEARCH_TYPES,SHARED_VIEW_CONFIG}from'./config/defaultSettings.js';//# sourceMappingURL=index.native.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {DISMISS_APPLICATION_ERROR,RESTORE_APPLICATION_ERRORS,LOG_APPLICATION_ERROR}from'../../constants/error.js';const setApplicationError = (payload) => {
|
|
2
2
|
return ({
|
|
3
3
|
type: LOG_APPLICATION_ERROR,
|
|
4
4
|
payload,
|
package/lib/redux/hooks.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {useDispatch
|
|
1
|
+
import {useSelector,useDispatch}from'react-redux';/* eslint-disable @typescript-eslint/no-restricted-imports */
|
|
2
2
|
// Use throughout app instead of plain `useDispatch` and `useSelector`
|
|
3
3
|
// export const useAppDispatch = () => useDispatch<AppDispatch>();
|
|
4
4
|
const useAppDispatch = () => useDispatch();
|
|
@@ -3,6 +3,6 @@ export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
|
3
3
|
export declare const useComponentSize: () => {
|
|
4
4
|
width: any;
|
|
5
5
|
height: any;
|
|
6
|
-
ref: import("react").
|
|
6
|
+
ref: import("react").RefObject<any>;
|
|
7
7
|
};
|
|
8
8
|
//# sourceMappingURL=componentSize.d.ts.map
|
package/lib/utils/index.d.ts
CHANGED
package/lib/utils/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC"}
|
package/lib/utils/menuUtils.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export declare const menuDataRender: (menuList: IMenuData[], authorities: any, i
|
|
|
14
14
|
export declare function transformData(data: any): any;
|
|
15
15
|
export declare function setLocale(obj: any, parentName?: string): void;
|
|
16
16
|
export declare const addProLayoutParentKeys: (menuData?: any[], parentKeys?: string[]) => any[];
|
|
17
|
-
export declare const filterRoutesWithLocale: (routes: any) => any;
|
|
17
|
+
export declare const filterRoutesWithLocale: (routes: any) => any[];
|
|
18
18
|
/**
|
|
19
19
|
*
|
|
20
20
|
* included [ 'dialogPath']
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,EAAE,EAAE,gBAAW,EAAE,oBAAiB,KAAG,SAAS,EAuB/F,CAAC;AAMF,wBAAgB,aAAa,CAAC,IAAI,KAAA,OAcjC;AACD,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,UAAU,SAAK,QAO7C;AAED,eAAO,MAAM,sBAAsB,GAAI,WAAW,GAAG,EAAE,EAAE,aAAY,MAAM,EAAO,UASjF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAM,
|
|
1
|
+
{"version":3,"file":"menuUtils.d.ts","sourceRoot":"","sources":["../../src/utils/menuUtils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAChF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,cAAc,GAAI,UAAU,SAAS,EAAE,EAAE,gBAAW,EAAE,oBAAiB,KAAG,SAAS,EAuB/F,CAAC;AAMF,wBAAgB,aAAa,CAAC,IAAI,KAAA,OAcjC;AACD,wBAAgB,SAAS,CAAC,GAAG,KAAA,EAAE,UAAU,SAAK,QAO7C;AAED,eAAO,MAAM,sBAAsB,GAAI,WAAW,GAAG,EAAE,EAAE,aAAY,MAAM,EAAO,UASjF,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,WAAM,UAgB5C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,GAAG,KAAA,QAY9C"}
|
package/lib/utils/menuUtils.js
CHANGED
|
@@ -64,6 +64,9 @@ const addProLayoutParentKeys = (menuData, parentKeys = []) => {
|
|
|
64
64
|
});
|
|
65
65
|
};
|
|
66
66
|
const filterRoutesWithLocale = (routes) => {
|
|
67
|
+
if (!routes || !Array.isArray(routes)) {
|
|
68
|
+
return [];
|
|
69
|
+
}
|
|
67
70
|
return routes
|
|
68
71
|
.filter((item) => {
|
|
69
72
|
if (item.routes && item.routes.length > 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAcG;AACH;AA6BA;AAeA,MAAA,uCAA+B,EAAU,UAAK,GAAA,IAO7C,KAAA;AAED,IAAA,IAAA,UAAO,EAAA;AAWP,QAAA,MAAA,CAAO,KAAA,CAAM,kCAA0B,CAAA;
|
|
1
|
+
{"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;AAcG;AACH;AA6BA;AAeA,MAAA,uCAA+B,EAAU,UAAK,GAAA,IAO7C,KAAA;AAED,IAAA,IAAA,UAAO,EAAA;AAWP,QAAA,MAAA,CAAO,KAAA,CAAM,kCAA0B,CAAA;AAkBvC,IAAA;;;AAGG;AACH,SAAA,MAAA,CAAA,CAAA,IAAA,KAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Detect if the application is running in SPA mode (client-side only, no SSR)
|
|
3
|
+
*
|
|
4
|
+
* In SPA mode:
|
|
5
|
+
* - Server loaders are not available
|
|
6
|
+
* - Cookies cannot be set via server response
|
|
7
|
+
* - localStorage is the primary storage mechanism
|
|
8
|
+
*
|
|
9
|
+
* In SSR mode:
|
|
10
|
+
* - Server loaders are available
|
|
11
|
+
* - Cookies can be set via server response
|
|
12
|
+
* - Cookies are the primary storage mechanism (server can read them)
|
|
13
|
+
*
|
|
14
|
+
* @returns true if running in SPA mode, false if SSR mode
|
|
15
|
+
*/
|
|
16
|
+
export declare function isSpaMode(): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Get the current storage mode description for debugging
|
|
19
|
+
* @returns 'spa' | 'ssr'
|
|
20
|
+
*/
|
|
21
|
+
export declare function getStorageMode(): 'spa' | 'ssr';
|
|
22
|
+
/**
|
|
23
|
+
* Settings storage utility for persisting UI settings
|
|
24
|
+
* Uses localStorage for SPA mode persistence
|
|
25
|
+
*/
|
|
26
|
+
export declare const settingsStorage: {
|
|
27
|
+
/**
|
|
28
|
+
* Get settings deltas from localStorage
|
|
29
|
+
* @returns Parsed deltas or null
|
|
30
|
+
*/
|
|
31
|
+
get: () => any | null;
|
|
32
|
+
/**
|
|
33
|
+
* Save settings deltas to localStorage
|
|
34
|
+
* @param deltas - Deltas to store
|
|
35
|
+
*/
|
|
36
|
+
set: (deltas: any) => void;
|
|
37
|
+
/**
|
|
38
|
+
* Merge new deltas with existing deltas
|
|
39
|
+
* @param newDeltas - New deltas to merge
|
|
40
|
+
* @returns Merged deltas
|
|
41
|
+
*/
|
|
42
|
+
merge: (newDeltas: any) => any;
|
|
43
|
+
/**
|
|
44
|
+
* Clear all deltas from localStorage
|
|
45
|
+
*/
|
|
46
|
+
clear: () => void;
|
|
47
|
+
/**
|
|
48
|
+
* Check if localStorage is available
|
|
49
|
+
* @returns true if available
|
|
50
|
+
*/
|
|
51
|
+
isAvailable: () => boolean;
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=settingsStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsStorage.d.ts","sourceRoot":"","sources":["../../src/utils/settingsStorage.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,SAAS,IAAI,OAAO,CAUnC;AAED;;;GAGG;AACH,wBAAgB,cAAc,IAAI,KAAK,GAAG,KAAK,CAE9C;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe;IACxB;;;OAGG;eACM,GAAG,GAAG,IAAI;IAWnB;;;OAGG;kBACW,GAAG,KAAG,IAAI;IAUxB;;;;OAIG;uBACgB,GAAG,KAAG,GAAG;IAQ5B;;OAEG;iBACQ,IAAI;IAYf;;;OAGG;uBACc,OAAO;CAW3B,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {merge}from'lodash-es';import {safeLocalStorage}from'./storage.js';const STORAGE_KEY = 'ui-layout-settings';
|
|
2
|
+
/**
|
|
3
|
+
* Detect if the application is running in SPA mode (client-side only, no SSR)
|
|
4
|
+
*
|
|
5
|
+
* In SPA mode:
|
|
6
|
+
* - Server loaders are not available
|
|
7
|
+
* - Cookies cannot be set via server response
|
|
8
|
+
* - localStorage is the primary storage mechanism
|
|
9
|
+
*
|
|
10
|
+
* In SSR mode:
|
|
11
|
+
* - Server loaders are available
|
|
12
|
+
* - Cookies can be set via server response
|
|
13
|
+
* - Cookies are the primary storage mechanism (server can read them)
|
|
14
|
+
*
|
|
15
|
+
* @returns true if running in SPA mode, false if SSR mode
|
|
16
|
+
*/
|
|
17
|
+
function isSpaMode() {
|
|
18
|
+
// Server-side rendering - definitely not SPA mode
|
|
19
|
+
if (typeof window === 'undefined')
|
|
20
|
+
return false;
|
|
21
|
+
// Check Remix context for SPA mode flag
|
|
22
|
+
const remixContext = window.__remixContext;
|
|
23
|
+
if (remixContext?.isSpaMode === true)
|
|
24
|
+
return true;
|
|
25
|
+
// Fallback: If no remix context exists and we're in browser,
|
|
26
|
+
// assume SSR mode (conservative default)
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Get the current storage mode description for debugging
|
|
31
|
+
* @returns 'spa' | 'ssr'
|
|
32
|
+
*/
|
|
33
|
+
function getStorageMode() {
|
|
34
|
+
return isSpaMode() ? 'spa' : 'ssr';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Settings storage utility for persisting UI settings
|
|
38
|
+
* Uses localStorage for SPA mode persistence
|
|
39
|
+
*/
|
|
40
|
+
const settingsStorage = {
|
|
41
|
+
/**
|
|
42
|
+
* Get settings deltas from localStorage
|
|
43
|
+
* @returns Parsed deltas or null
|
|
44
|
+
*/
|
|
45
|
+
get: () => {
|
|
46
|
+
if (typeof window === 'undefined')
|
|
47
|
+
return null;
|
|
48
|
+
try {
|
|
49
|
+
const stored = safeLocalStorage.getItem(STORAGE_KEY);
|
|
50
|
+
return stored ? JSON.parse(stored) : null;
|
|
51
|
+
}
|
|
52
|
+
catch (error) {
|
|
53
|
+
console.warn('Failed to read settings from localStorage:', error);
|
|
54
|
+
return null;
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Save settings deltas to localStorage
|
|
59
|
+
* @param deltas - Deltas to store
|
|
60
|
+
*/
|
|
61
|
+
set: (deltas) => {
|
|
62
|
+
if (typeof window === 'undefined')
|
|
63
|
+
return;
|
|
64
|
+
try {
|
|
65
|
+
const serialized = JSON.stringify(deltas);
|
|
66
|
+
safeLocalStorage.setItem(STORAGE_KEY, serialized);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
console.warn('Failed to write settings to localStorage (may be full):', error);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
/**
|
|
73
|
+
* Merge new deltas with existing deltas
|
|
74
|
+
* @param newDeltas - New deltas to merge
|
|
75
|
+
* @returns Merged deltas
|
|
76
|
+
*/
|
|
77
|
+
merge: (newDeltas) => {
|
|
78
|
+
const existingDeltas = settingsStorage.get() || {};
|
|
79
|
+
// Deep merge for nested bracket notation
|
|
80
|
+
const mergedDeltas = merge({}, existingDeltas, newDeltas);
|
|
81
|
+
settingsStorage.set(mergedDeltas);
|
|
82
|
+
return mergedDeltas;
|
|
83
|
+
},
|
|
84
|
+
/**
|
|
85
|
+
* Clear all deltas from localStorage
|
|
86
|
+
*/
|
|
87
|
+
clear: () => {
|
|
88
|
+
if (typeof window === 'undefined')
|
|
89
|
+
return;
|
|
90
|
+
try {
|
|
91
|
+
safeLocalStorage.removeItem(STORAGE_KEY);
|
|
92
|
+
// Also clear legacy storage keys if any
|
|
93
|
+
safeLocalStorage.removeItem('ui-desktop-settings');
|
|
94
|
+
console.log('✅ Cleared localStorage settings');
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
console.warn('Failed to clear localStorage:', error);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* Check if localStorage is available
|
|
102
|
+
* @returns true if available
|
|
103
|
+
*/
|
|
104
|
+
isAvailable: () => {
|
|
105
|
+
if (typeof window === 'undefined')
|
|
106
|
+
return false;
|
|
107
|
+
try {
|
|
108
|
+
const testKey = '__storage_test__';
|
|
109
|
+
localStorage.setItem(testKey, 'test');
|
|
110
|
+
localStorage.removeItem(testKey);
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
return false;
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
};export{getStorageMode,isSpaMode,settingsStorage};//# sourceMappingURL=settingsStorage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsStorage.js","sources":["../../src/utils/settingsStorage.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;AAmBG;AACH;AAYA;;;AAGG;AACH,IAAA,IAAA,OAAA,MAAA,KAAgB,WAAA;AAIhB,QAAA,OAAA,KAAA;;;AAGG,IAAA,IAAA,YAAA,EAAA,SAAA,KAAA,IAAA;AACH,QAAA,OAAO;AACH;;;AAGG;AACM;AAWT;;;AAGG,SAAA,cAAA,GAAA;AACW,IAAA,OAAA,SAAA,UAAU,GAAA,KAAA;AAUxB;;;;AAIG;AACgB,MAAA,kBAAM;AAQzB;;AAEG;;AAaH,IAAA,GAAA,EAAA,MAAA;;;AAGG,QAAA,IAAA;wBACc,GAAA,gBAAO,CAAA,OAAA,CAAA,WAAA,CAAA;YAW1B,OAAA,MAAA,GAAA,IAAA,CAAA,KAAA,CAAA,MAAA,CAAA,GAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe localStorage wrapper for SSR compatibility
|
|
3
|
+
*/
|
|
4
|
+
export declare const safeLocalStorage: {
|
|
5
|
+
getItem: (key: string) => string | null;
|
|
6
|
+
setItem: (key: string, value: string) => void;
|
|
7
|
+
removeItem: (key: string) => void;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/utils/storage.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,eAAO,MAAM,gBAAgB;mBACV,MAAM,KAAG,MAAM,GAAG,IAAI;mBAQtB,MAAM,SAAS,MAAM,KAAG,IAAI;sBAMzB,MAAM,KAAG,IAAI;CAMlC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Safe localStorage wrapper for SSR compatibility
|
|
3
|
+
*/
|
|
4
|
+
const safeLocalStorage = {
|
|
5
|
+
getItem: (key) => {
|
|
6
|
+
if (typeof window === 'undefined')
|
|
7
|
+
return null;
|
|
8
|
+
try {
|
|
9
|
+
return localStorage.getItem(key);
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
setItem: (key, value) => {
|
|
16
|
+
if (typeof window === 'undefined')
|
|
17
|
+
return;
|
|
18
|
+
try {
|
|
19
|
+
localStorage.setItem(key, value);
|
|
20
|
+
}
|
|
21
|
+
catch { }
|
|
22
|
+
},
|
|
23
|
+
removeItem: (key) => {
|
|
24
|
+
if (typeof window === 'undefined')
|
|
25
|
+
return;
|
|
26
|
+
try {
|
|
27
|
+
localStorage.removeItem(key);
|
|
28
|
+
}
|
|
29
|
+
catch { }
|
|
30
|
+
},
|
|
31
|
+
};export{safeLocalStorage};//# sourceMappingURL=storage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.js","sources":["../../src/utils/storage.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;AAEG;AACH,MAAA,gBAAa,GAAA;sBACM;mBAQA,MAAM,KAAA,WAAe;AAMlB,YAAA,OAAA,IAAA;QAMpB,IAAA;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@admin-layout/client",
|
|
3
|
-
"version": "12.2.4-alpha.
|
|
3
|
+
"version": "12.2.4-alpha.12",
|
|
4
4
|
"description": "Sample client for higher packages to depend on",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "CDMBase LLC",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"serialize-error": "^8.0.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"common": "12.2.4-alpha.
|
|
29
|
+
"common": "12.2.4-alpha.7",
|
|
30
30
|
"rc-menu": "^9.16.1"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"typescript": {
|
|
45
45
|
"definition": "lib/index.d.ts"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "ebc266babcf79ef46a60363f21c68edf3d2dd1c0"
|
|
48
48
|
}
|