@admin-layout/client 12.0.16-alpha.43 → 12.0.16-alpha.45

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 (36) hide show
  1. package/lib/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +1 -0
  2. package/lib/__tests__/SettingsConfigurationModel.test.d.ts.map +1 -0
  3. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts +3 -0
  4. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts.map +1 -0
  5. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts +4 -12
  6. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -1
  7. package/lib/components/UpdateSettings/UpdateSettings.server.js +93 -129
  8. package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
  9. package/lib/config/defaultSettings.d.ts +75 -1
  10. package/lib/config/defaultSettings.d.ts.map +1 -1
  11. package/lib/config/defaultSettings.js +1 -111
  12. package/lib/config/defaultSettings.js.map +1 -1
  13. package/lib/config/env-config.d.ts +1 -3
  14. package/lib/config/env-config.d.ts.map +1 -1
  15. package/lib/config/env-config.js +7 -17
  16. package/lib/config/env-config.js.map +1 -1
  17. package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
  18. package/lib/hooks/useLayoutSettings.js +19 -6
  19. package/lib/hooks/useLayoutSettings.js.map +1 -1
  20. package/lib/index.js +1 -1
  21. package/lib/index.native.js +1 -1
  22. package/lib/redux/reducers/settings.d.ts.map +1 -1
  23. package/lib/redux/reducers/settings.js +2 -2
  24. package/lib/redux/reducers/settings.js.map +1 -1
  25. package/lib/redux/store.js +1 -1
  26. package/lib/utils/index.d.ts +1 -0
  27. package/lib/utils/index.d.ts.map +1 -1
  28. package/lib/utils/settingsDifference.d.ts +1 -0
  29. package/lib/utils/settingsDifference.d.ts.map +1 -1
  30. package/lib/utils/settingsDifference.js +15 -4
  31. package/lib/utils/settingsDifference.js.map +1 -1
  32. package/package.json +4 -3
  33. package/lib/components/UpdateSettings/SettingsConfigurationModel.test.d.ts.map +0 -1
  34. package/lib/components/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +0 -1
  35. /package/lib/{components/__tests__ → __tests__}/ApplicationErrorHandlerCommon.test.d.ts +0 -0
  36. /package/lib/{components/UpdateSettings → __tests__}/SettingsConfigurationModel.test.d.ts +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApplicationErrorHandlerCommon.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/ApplicationErrorHandlerCommon.test.tsx"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsConfigurationModel.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/SettingsConfigurationModel.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { ISettings } from '../../config/defaultSettings';
2
+ export declare const defaultSettings: ISettings;
3
+ //# sourceMappingURL=defaultSettingsExample.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaultSettingsExample.d.ts","sourceRoot":"","sources":["../../../src/__tests__/__fixtures__/defaultSettingsExample.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAA+D,MAAM,8BAA8B,CAAC;AAEtH,eAAO,MAAM,eAAe,EAAE,SA+G7B,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import { IAppLoadContext } from '@common-stack/client-core';
2
2
  import { IResourceParams } from '@common-stack/core';
3
3
  import { ProSettings } from '../../interfaces';
4
+ export declare const settingsCookie: import("@remix-run/server-runtime").Cookie;
5
+ export declare function fetchPageSettingsWithFetch(request: Request, graphqlUrl?: string): Promise<{
6
+ data: any;
7
+ }>;
4
8
  export declare function settingsLoaderUtil({ request, context, params, }: {
5
9
  request: Request;
6
10
  context?: IAppLoadContext;
@@ -9,16 +13,4 @@ export declare function settingsLoaderUtil({ request, context, params, }: {
9
13
  settings: ProSettings;
10
14
  setCookie: string;
11
15
  }>;
12
- export declare const action: ({ request, context, params, }: {
13
- request: Request;
14
- context?: IAppLoadContext;
15
- params?: IResourceParams;
16
- }) => Promise<import("@remix-run/server-runtime").TypedResponse<any>>;
17
- export declare const loader: ({ request, context, params, }: {
18
- request: Request;
19
- context?: IAppLoadContext;
20
- params?: IResourceParams;
21
- }) => Promise<import("@remix-run/server-runtime").TypedResponse<{
22
- settings: any;
23
- }>>;
24
16
  //# sourceMappingURL=UpdateSettings.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAerD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAoD/C,wBAAsB,kBAAkB,CAAC,EACrC,OAAO,EACP,OAAO,EACP,MAAM,GACT,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,OAAO,CAAC;IACR,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC,CA2CD;AAED,eAAO,MAAM,MAAM,GAAU,+BAI1B;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B,oEAgEA,CAAC;AAEF,eAAO,MAAM,MAAM,GAAU,+BAI1B;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B;;GAiCA,CAAC"}
1
+ {"version":3,"file":"UpdateSettings.server.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAcrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,eAAO,MAAM,cAAc,4CAMzB,CAAC;AAGH,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM;;GAqErF;AAED,wBAAsB,kBAAkB,CAAC,EACrC,OAAO,EACP,OAAO,EACP,MAAM,GACT,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;CAC5B,GAAG,OAAO,CAAC;IACR,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC,CAsFD"}
@@ -1,68 +1,118 @@
1
- import {createCookie,json}from'@remix-run/node';import {ConfigCollectionName,ConfigFragmentName,ConfigurationSchemaId}from'common';import {GetPageSettingsDocument}from'common/graphql';import {merge}from'lodash-es';import {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import'react';import'@cdm-logger/client';import {compareAndSaveSettingsDifferences}from'../../utils/settingsDifference.js';import {assignDefaults}from'../../utils/assignDefaults.js';import {generateCdecodeUri,DEFAULT_TENANT_ID}from'@adminide-stack/core';// NOTE: We are temporarily using `defaultSettings`. This will be removed once `defaultSettings` is updated in the all packages.
2
- const settingsCookie = createCookie('settings', {
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 {config}from'../../config/env-config.js';import'../../config/defaultSettings.js';import'react';import'@cdm-logger/client';import {compareAndSaveSettingsDifferences}from'../../utils/settingsDifference.js';import {assignDefaults}from'../../utils/assignDefaults.js';import {generateCdecodeUri,DEFAULT_TENANT_ID}from'@adminide-stack/core';const settingsCookie = createCookie('settings', {
3
2
  maxAge: 60 * 60 * 24 * 30, // 1 month
4
3
  httpOnly: false, // Allow client-side access
5
4
  sameSite: 'lax',
6
5
  path: '/', // Ensure cookie is available for all paths
7
6
  domain: config.isProd ? config.APP_DOMAIN : undefined,
8
7
  });
9
- // Helper to fetch page settings from Apollo
10
- async function fetchPageSettings(apolloClient) {
8
+ // Direct fetch-based implementation for fetching page settings
9
+ async function fetchPageSettingsWithFetch(request, graphqlUrl) {
10
+ const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
11
+ resourceType: ConfigCollectionName.Applications,
12
+ resourceId: config.APPLICATION_ID,
13
+ idField: 'appId',
14
+ }, {}, ConfigFragmentName.UiSettings);
15
+ const url = graphqlUrl || process.env.GRAPHQL_URL || 'http://localhost:8080/graphql';
16
+ // Convert GraphQL DocumentNode to string
17
+ const query = print(GetPageSettingsDocument);
18
+ const variables = {
19
+ resourceUri: resource,
20
+ options: {
21
+ schemaId: ConfigurationSchemaId.UiLayout,
22
+ target: 2 /* ConfigurationTarget.APPLICATION */,
23
+ },
24
+ };
25
+ console.log('🔍 Fetching settings with direct fetch to:', url);
26
+ console.log('🔍 Query variables:', JSON.stringify(variables, null, 2));
27
+ // Forward cookies from the incoming request
28
+ const headers = {
29
+ 'Content-Type': 'application/json',
30
+ };
31
+ const cookieHeader = request.headers.get('Cookie');
32
+ if (cookieHeader) {
33
+ headers['Cookie'] = cookieHeader;
34
+ console.log('🍪 Forwarding cookies to GraphQL backend');
35
+ }
36
+ else {
37
+ console.log('⚠️ No cookies found in request');
38
+ }
11
39
  try {
12
- // Generate the same resource URI as SettingDrawer.tsx
13
- const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
14
- resourceType: ConfigCollectionName.Applications,
15
- resourceId: config.APPLICATION_ID,
16
- idField: 'appId',
17
- }, {}, ConfigFragmentName.UiSettings);
18
- return await apolloClient.query({
19
- query: GetPageSettingsDocument,
20
- context: {
21
- headers: {
22
- 'Content-Type': 'application/json',
23
- },
24
- },
25
- variables: {
26
- resourceUri: resource,
27
- options: {
28
- schemaId: ConfigurationSchemaId.UiLayout,
29
- target: 2 /* ConfigurationTarget.APPLICATION */,
30
- },
31
- },
40
+ const response = await fetch(url, {
41
+ method: 'POST',
42
+ headers,
43
+ body: JSON.stringify({
44
+ query,
45
+ variables,
46
+ }),
32
47
  });
48
+ if (!response.ok) {
49
+ console.error('❌ GraphQL fetch failed with status:', response.status);
50
+ throw new Error(`GraphQL request failed: ${response.status} ${response.statusText}`);
51
+ }
52
+ const result = await response.json();
53
+ if (result.errors) {
54
+ console.error('❌ GraphQL errors:', JSON.stringify(result.errors, null, 2));
55
+ throw new Error(`GraphQL errors: ${JSON.stringify(result.errors)}`);
56
+ }
57
+ console.log('✅ Settings fetched successfully with fetch');
58
+ return { data: result.data };
33
59
  }
34
60
  catch (error) {
35
- console.warn('Failed to fetch page settings from GraphQL:', error);
36
- // Return null to indicate failure, which will cause fallback to default settings
37
- return null;
61
+ console.error('Failed to fetch settings with fetch:', error);
62
+ throw error;
38
63
  }
39
64
  }
40
65
  async function settingsLoaderUtil({ request, context, params, }) {
41
66
  const cookieHeader = request.headers.get('Cookie');
42
- let settings;
43
- const { apolloClient } = context;
44
- const result = await fetchPageSettings(apolloClient);
45
- console.log('RESULT', JSON.stringify(result));
67
+ // Fetch settings from backend using direct fetch
68
+ console.log('📡 Using direct fetch to get settings');
69
+ const result = await fetchPageSettingsWithFetch(request);
46
70
  const pageSettings = result?.data?.pageSettings?.settings
47
71
  ? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
48
72
  : null;
49
- let pageDefaultSettings = pageSettings?.uilayout || pageSettings || {};
50
- // TEMPORARY: Manually add hiddenMenuKeys to defaults until GraphQL schema is updated
73
+ // Extract uilayout settings if available
74
+ const uilayout = pageSettings?.uilayout;
75
+ const hasUilayoutData = uilayout && typeof uilayout === 'object' && Object.keys(uilayout).length > 0;
76
+ let pageDefaultSettings = hasUilayoutData ? uilayout : pageSettings || {};
77
+ // Add required keys that might not be in backend
51
78
  pageDefaultSettings = {
52
79
  ...pageDefaultSettings,
53
80
  hiddenMenuKeys: [],
54
81
  hiddenMenuCategories: [],
55
82
  };
83
+ // Fallback to config.LAYOUT_SETTINGS if backend returns empty
84
+ const settingsKeys = Object.keys(pageDefaultSettings);
85
+ const hasOnlyDefaultKeys = settingsKeys.length === 2 &&
86
+ settingsKeys.includes('hiddenMenuKeys') &&
87
+ settingsKeys.includes('hiddenMenuCategories');
88
+ if (hasOnlyDefaultKeys && config.LAYOUT_SETTINGS) {
89
+ const fallbackSettings = typeof config.LAYOUT_SETTINGS === 'string'
90
+ ? JSON.parse(config.LAYOUT_SETTINGS)
91
+ : { ...config.LAYOUT_SETTINGS };
92
+ pageDefaultSettings = {
93
+ ...fallbackSettings,
94
+ hiddenMenuKeys: [],
95
+ hiddenMenuCategories: [],
96
+ };
97
+ }
98
+ // Parse cookie settings
99
+ let settings;
56
100
  try {
57
101
  settings = await settingsCookie.parse(cookieHeader);
58
- console.log('Parsed cookie settings:', settings);
102
+ // Remove any invalid numeric string keys from cookie
103
+ if (settings && typeof settings === 'object') {
104
+ Object.keys(settings).forEach((key) => {
105
+ if (/^\d+$/.test(key)) {
106
+ delete settings[key];
107
+ }
108
+ });
109
+ }
59
110
  assignDefaults(settings, pageDefaultSettings);
60
111
  }
61
112
  catch (error) {
62
- console.error('Error parsing settings cookie:', error);
63
113
  settings = null;
64
114
  }
65
- // If no settings in cookie, generate default settings
115
+ // Generate default settings if no cookie exists
66
116
  if (!settings) {
67
117
  const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS);
68
118
  assignDefaults(fullSettings, pageDefaultSettings);
@@ -71,100 +121,14 @@ async function settingsLoaderUtil({ request, context, params, }) {
71
121
  const cookie = await settingsCookie.serialize(diffSettings);
72
122
  return { settings: fullSettings, setCookie: cookie };
73
123
  }
74
- // Merge defaults first, then overlay cookie settings to ensure persistence overrides
124
+ // Merge settings: backend defaults + config + cookie overrides
75
125
  const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS, settings);
126
+ // Remove any numeric keys that might have appeared during merge
127
+ const numericKeysAfterMerge = Object.keys(fullSettings).filter((k) => /^\d+$/.test(k));
128
+ numericKeysAfterMerge.forEach((key) => {
129
+ delete fullSettings[key];
130
+ });
76
131
  // Refresh the cookie to keep it active
77
132
  const cookie = await settingsCookie.serialize(settings);
78
133
  return { settings: fullSettings, setCookie: cookie };
79
- }
80
- const action = async ({ request, context, params, }) => {
81
- try {
82
- // 1. Fetch default settings from GraphQL (or fallback to local defaults)
83
- const { apolloClient } = context;
84
- const result = await fetchPageSettings(apolloClient);
85
- const pageSettings = result?.data?.pageSettings?.settings
86
- ? JSON.parse(JSON.stringify(result.data.pageSettings.settings))
87
- : null;
88
- let pageDefaultSettings = pageSettings?.uilayout || pageSettings || {};
89
- // 2 TEMPORARY: Manually add hiddenMenuKeys to defaults until GraphQL schema is updated
90
- pageDefaultSettings = {
91
- ...pageDefaultSettings,
92
- hiddenMenuKeys: [],
93
- hiddenMenuCategories: [],
94
- };
95
- // 3. Parse the incoming settings update from the client (usually only changed keys)
96
- const jsonData = await request.json();
97
- const payload = jsonData?.config || {};
98
- // 4. Fill in any missing default keys in the payload (does not overwrite user values)
99
- assignDefaults(payload, pageDefaultSettings);
100
- // 5. Parse existing settings from the cookie (if present)
101
- const cookieHeader = request.headers.get('Cookie');
102
- let existingSettings;
103
- let mergedSettings;
104
- try {
105
- existingSettings = await settingsCookie.parse(cookieHeader);
106
- // 6. Merge existing settings with the new payload from the client
107
- mergedSettings = merge({}, existingSettings, payload);
108
- // 7. Ensure merged settings have all default keys (again, does not overwrite user values)
109
- assignDefaults(mergedSettings, pageDefaultSettings);
110
- }
111
- catch (error) {
112
- // If cookie parsing fails, fall back to just the payload
113
- console.error('Error parsing settings cookie in action:', error);
114
- existingSettings = null;
115
- }
116
- // 8. Build the final settings object: defaults → config.LAYOUT_SETTINGS → merged user settings
117
- const fullSettings = merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS, mergedSettings);
118
- // TEMPORARY FIX: Manually override hiddenMenuKeys with payload value
119
- // This ensures payload array replaces the prev array values
120
- if (payload.hiddenMenuKeys !== undefined) {
121
- fullSettings.hiddenMenuKeys = [...payload.hiddenMenuKeys];
122
- }
123
- // 9. Store only the differences from the defaults in the cookie (to minimize cookie size)
124
- const diffSettings = await compareAndSaveSettingsDifferences(fullSettings, pageDefaultSettings);
125
- // 10. Serialize the diff settings into a cookie string
126
- const newCookie = await settingsCookie.serialize(diffSettings);
127
- // 11. Return the full settings as JSON, and set the new cookie in the response headers
128
- return json(fullSettings, {
129
- headers: {
130
- 'Set-Cookie': newCookie,
131
- },
132
- });
133
- }
134
- catch (error) {
135
- // If anything fails, log the error and return a 500 error response
136
- console.error('Error in action:', error);
137
- return json({ error: 'Failed to update settings' }, { status: 500 });
138
- }
139
- };
140
- const loader = async ({ request, context, params, }) => {
141
- try {
142
- const { settings, setCookie } = await settingsLoaderUtil({ request, context, params });
143
- // Always include headers, but only set cookie if provided
144
- const headers = {};
145
- if (setCookie) {
146
- headers['Set-Cookie'] = setCookie;
147
- }
148
- return json({ settings }, { headers });
149
- }
150
- catch (error) {
151
- console.error('Error in settings loader:', error);
152
- // Fall back to default settings
153
- const { apolloClient } = context;
154
- const result = await fetchPageSettings(apolloClient);
155
- console.log('result', result);
156
- const pageSettings = result?.data?.pageSettings?.settings
157
- ? JSON.parse(JSON.stringify(result.data.pageSettings.settings))
158
- : null;
159
- let pageDefaultSettings = pageSettings?.uilayout || pageSettings || {};
160
- // TEMPORARY: Manually add hiddenMenuKeys to defaults until GraphQL schema is updated
161
- pageDefaultSettings = {
162
- ...pageDefaultSettings,
163
- hiddenMenuKeys: [], // Array format for menu visibility
164
- hiddenMenuCategories: [], // Array format for category visibility
165
- };
166
- return json({
167
- settings: merge({}, pageDefaultSettings, config.LAYOUT_SETTINGS),
168
- });
169
- }
170
- };export{action,loader,settingsLoaderUtil};//# sourceMappingURL=UpdateSettings.server.js.map
134
+ }export{fetchPageSettingsWithFetch,settingsCookie,settingsLoaderUtil};//# sourceMappingURL=UpdateSettings.server.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":";MA8EI,iBAAkB,YAAA,CAAA,UAAA,EAAA;AACrB,IA2CA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,EAAA,GAAA,EAAA;AAED,IAAA,QAAA,EAAA,KAAO;IAKH,QAAO;IACP,IAAA,EAAA,GAAQ;IACR,MAAM,EAAC,MAAE,CAAA,MAAA,GAAe,MAAC,CAAA,UAAA,GAAA,SAAA;AAC5B,CAAA,CAAA;AAkED;gCAKqB,CAAA,YAAA,EAAA;IACjB,IAAA;;AAEH,QAAA,MAAA,QAAA,GAAA,kBAAA,CAAA,iBAAA,EAAA;;YAiCC,UAAA,EAAA,MAAA,CAAA,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"UpdateSettings.server.js","sources":["../../../src/components/UpdateSettings/UpdateSettings.server.ts"],"sourcesContent":[null],"names":[],"mappings":"mkBA0GY,MAAA,cAAE,GAAgB,YAAA,CAAA,UAAA,EAAA;IAC1B,MAAM,EAAC,EAAE,GAAA,EAAA,GAAA,EAAA,GAAA,EAAgB;AAC5B,IAAG,QAAQ,EAAA,KAAA;IACR,QAAQ,EAAE;IACV,IAAA,EAAA,GAAS;AACZ,IAsFA,MAAA,EAAA,MAAA,CAAA,MAAA,GAAA,MAAA,CAAA,UAAA,GAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,6 +1,81 @@
1
1
  import { ProSettings, SearchbarSettings } from '../interfaces';
2
2
  import { NavigationMode, SideMenuType, SearchBarBehavior } from '../interfaces/settings';
3
3
  import { ContentWidth } from '../interfaces/pure-settings';
4
+ export declare const DEFAULT_LAYOUT: {
5
+ contentWidth: ContentWidth;
6
+ fixedHeader: boolean;
7
+ fixedSidebar: boolean;
8
+ splitMenus: boolean;
9
+ };
10
+ export declare const DEFAULT_HEADER: {
11
+ showLogo: boolean;
12
+ showRightContent: boolean;
13
+ showMenuToggle: boolean;
14
+ showBackButton: boolean;
15
+ showPageTitle: boolean;
16
+ showActionButtons: boolean;
17
+ position: "fixed";
18
+ backgroundColor: string;
19
+ elevation: number;
20
+ showHeader: boolean;
21
+ showMenu: boolean;
22
+ menuHeaderRender: boolean;
23
+ searchBarRender: boolean;
24
+ searchBarBehavior: SearchBarBehavior;
25
+ searchBarOverlay: boolean;
26
+ scrollThreshold: number;
27
+ };
28
+ export declare const SEARCH_TYPES: {
29
+ readonly HOTELS: "HOTELS";
30
+ readonly FLIGHTS: "FLIGHTS";
31
+ readonly CARS: "CARS";
32
+ };
33
+ export declare const AMENITIES: readonly ["WiFi", "Pool", "Parking", "Air Conditioning", "Kitchen", "Washer", "Dryer", "TV", "Gym", "Elevator", "Hot Tub", "Breakfast"];
34
+ export declare const SHARED_VIEW_CONFIG: {
35
+ layout: {
36
+ navigationMode: NavigationMode;
37
+ sideMenuType: SideMenuType;
38
+ upperMenuDividerName: string;
39
+ middleMenuDividerName: string;
40
+ lowerMenuDividerName: string;
41
+ contentWidth: ContentWidth;
42
+ fixedHeader: boolean;
43
+ fixedSidebar: boolean;
44
+ splitMenus: boolean;
45
+ };
46
+ regions: {
47
+ header: {
48
+ showSearchSlot: boolean;
49
+ height: string;
50
+ showLogo: boolean;
51
+ showRightContent: boolean;
52
+ showMenuToggle: boolean;
53
+ showBackButton: boolean;
54
+ showPageTitle: boolean;
55
+ showActionButtons: boolean;
56
+ position: "fixed";
57
+ backgroundColor: string;
58
+ elevation: number;
59
+ showHeader: boolean;
60
+ showMenu: boolean;
61
+ menuHeaderRender: boolean;
62
+ searchBarRender: boolean;
63
+ searchBarBehavior: SearchBarBehavior;
64
+ searchBarOverlay: boolean;
65
+ scrollThreshold: number;
66
+ };
67
+ background: {
68
+ type: string;
69
+ color: string;
70
+ image: string;
71
+ video: string;
72
+ videoThumbnail: string;
73
+ };
74
+ footer: {
75
+ showFooter: boolean;
76
+ };
77
+ };
78
+ };
4
79
  export type ISettings = ProSettings & {
5
80
  logo: string;
6
81
  showSettingPanel: boolean;
@@ -123,5 +198,4 @@ export type ISettings = ProSettings & {
123
198
  components: any[];
124
199
  activeComponent: string | null;
125
200
  };
126
- export declare const defaultSettings: ISettings;
127
201
  //# sourceMappingURL=defaultSettings.d.ts.map
@@ -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;AA6E3D,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB,EAAE,OAAO,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,aA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
- };
71
- const defaultSettings = {
72
- logo: 'https://cdmbase.s3.ca-central-1.amazonaws.com/favicon-new-128.svg',
73
- themeType: 'light',
74
- theme: 'default',
75
- primaryColor: '#1890ff',
76
- colorPrimary: '#1677FF',
77
- secondaryColor: '#4A5568',
78
- layout: 'mix',
79
- contentWidth: DEFAULT_LAYOUT.contentWidth,
80
- fixedHeader: DEFAULT_LAYOUT.fixedHeader,
81
- fixSiderbar: DEFAULT_LAYOUT.fixedSidebar,
82
- colorWeak: false,
83
- title: 'CDMBase LLC',
84
- iconfontUrl: '',
85
- showSettingPanel: true,
86
- titleColor: '#2869E0',
87
- language: 'en-US',
88
- fontFamily: 'Poppins, sans-serif',
89
- titleFontWeight: '700',
90
- titleHeight: '30px',
91
- titleFontSize: '1.8rem',
92
- letterSpacings: '1px',
93
- headerTheme: undefined,
94
- loginThemeColor: 'blue',
95
- loginFormPosition: 'center',
96
- loginSocials: '{"Google":true,"Apple":true,"Facebook":true}',
97
- loginBackgroundImage: null,
98
- verifyFormLayout: 'center',
99
- verifyFormImageUrl: '',
100
- verifyFormBackgroundStyle: 'color',
101
- verifyFormVisibleFields: '["firstName","lastName","username","companyName","workEmail","phoneNumber","dateOfBirth"]',
102
- verifyFormShowSkipButton: false,
103
- sideMenuType: 'expanded',
104
- currentRoute: '/',
105
- routeSettings: {
106
- '/': {
107
- layout: {
108
- desktop: SHARED_VIEW_CONFIG.layout,
109
- mobile: SHARED_VIEW_CONFIG.layout,
110
- },
111
- regions: {
112
- desktop: SHARED_VIEW_CONFIG.regions,
113
- mobile: SHARED_VIEW_CONFIG.regions,
114
- },
115
- },
116
- },
117
- components: [],
118
- activeComponent: null,
119
- searchbarSettings: {
120
- enabledSearchBars: {
121
- [SEARCH_TYPES.HOTELS]: true,
122
- [SEARCH_TYPES.FLIGHTS]: true,
123
- [SEARCH_TYPES.CARS]: true,
124
- },
125
- fieldsConfig: {
126
- [SEARCH_TYPES.HOTELS]: {
127
- location: true,
128
- dates: true,
129
- guests: true,
130
- },
131
- [SEARCH_TYPES.FLIGHTS]: {
132
- fromLocation: true,
133
- toLocation: true,
134
- dates: true,
135
- returnFlight: true,
136
- },
137
- [SEARCH_TYPES.CARS]: {
138
- pickupLocation: true,
139
- dropoffLocation: true,
140
- dates: true,
141
- },
142
- },
143
- datePickerConfig: {
144
- [SEARCH_TYPES.HOTELS]: {
145
- enableSingleDayMode: true,
146
- enableTimeSelection: true,
147
- defaultToSingleDay: false,
148
- },
149
- [SEARCH_TYPES.FLIGHTS]: {
150
- enableSingleDayMode: false,
151
- enableTimeSelection: false,
152
- defaultToSingleDay: false,
153
- },
154
- [SEARCH_TYPES.CARS]: {
155
- enableSingleDayMode: false,
156
- enableTimeSelection: true,
157
- defaultToSingleDay: false,
158
- },
159
- },
160
- advanceFilterConfig: {
161
- enabled: true,
162
- fields: {
163
- distance: true,
164
- price: true,
165
- petsAllowed: true,
166
- instantBooking: true,
167
- amenities: true,
168
- datasources: true,
169
- },
170
- amenitiesList: AMENITIES.map((name) => ({ name })),
171
- },
172
- showTypeSelector: true,
173
- isSettingsPanelOpen: false,
174
- showTravelPlanner: false,
175
- showAIAgent: true,
176
- },
177
- siderBgColor: '#000000',
178
- headerBgColor: '#000000',
179
- textColor: '#a19c9c',
180
- };export{defaultSettings};//# sourceMappingURL=defaultSettings.js.map
70
+ };export{AMENITIES,DEFAULT_HEADER,DEFAULT_LAYOUT,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;AACA,MAAA,cAAS,GAAc;AA6EvB,IAAA,YAAY,EAAA,OAAY;IACpB,aAAa,IAAA;IACb,YAAA,EAAA,IAAkB;IAClB,UAAA,EAAA;;MAEA,cAAgB,GAAC;IACjB,QAAA,EAAU;IACV,gBAAe;IACf,oBAAoB;IACpB,cAAa;IACb,aAAA,EAAc;IAC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ACd,EAAA,kBAAc,CAAA,OAAA;;;AAGlB,KAAA;;mBAEE,EAAA,IAAA;qBACJ,EAAA;yBACJ,EAAA;AACL,YACH,CAAA,YAAA,CAAA,MAAA,GAAA,IAAA;YACF,CAAA,YAAkB,CAAA,OAAA,GAAA,IAAA;AAClB,YAAA,CAAA,YAAiB,CAAA,IAAS,GAAA,IAAK;SACjC;AAEF,QAAA,YAAO,EAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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,9 +1,7 @@
1
1
  import { DefaultSettings } from '../interfaces';
2
- declare const preConfig: Readonly<{
2
+ export declare const config: Readonly<{
3
3
  LAYOUT_SETTINGS: DefaultSettings;
4
4
  APP_DOMAIN: string;
5
5
  APPLICATION_ID: string;
6
6
  } & import("envalid").CleanedEnvAccessors>;
7
- declare let config: typeof preConfig;
8
- export { config };
9
7
  //# sourceMappingURL=env-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAMhD,QAAA,MAAM,SAAS;;;;0CASb,CAAC;AACH,QAAA,IAAI,MAAM,EAAS,OAAO,SAAS,CAAC;AAepC,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"env-config.d.ts","sourceRoot":"","sources":["../../src/config/env-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAoBhD,eAAO,MAAM,MAAM;;;;0CAAY,CAAC"}
@@ -1,7 +1,11 @@
1
- import {cleanEnv,str,json}from'envalid';import {getEnvironment}from'@common-stack/core';import {defaultSettings}from'./defaultSettings.js';import {merge}from'lodash-es';const env = getEnvironment();
1
+ import {cleanEnv,str,json}from'envalid';import {getEnvironment}from'@common-stack/core';const env = getEnvironment();
2
2
  const preConfig = cleanEnv(env, {
3
3
  LAYOUT_SETTINGS: json({
4
- default: JSON.stringify({}),
4
+ default: JSON.stringify({
5
+ // Empty defaults - all settings come from backend GraphQL query
6
+ hiddenMenuKeys: [],
7
+ hiddenMenuCategories: [],
8
+ }),
5
9
  }),
6
10
  APP_DOMAIN: str({ default: 'cdebase.dev' }),
7
11
  APPLICATION_ID: str({
@@ -9,18 +13,4 @@ const preConfig = cleanEnv(env, {
9
13
  desc: 'Matches the Application ID exist already',
10
14
  }),
11
15
  });
12
- let config = {};
13
- // Parse the LAYOUT_SETTINGS if it exists in the environment
14
- if (env.LAYOUT_SETTINGS) {
15
- try {
16
- const parsedLayoutSettings = JSON.parse(env.LAYOUT_SETTINGS);
17
- config = { ...preConfig, LAYOUT_SETTINGS: merge({}, defaultSettings, parsedLayoutSettings) };
18
- }
19
- catch (error) {
20
- console.error('Error parsing LAYOUT_SETTINGS:', error);
21
- config = preConfig;
22
- }
23
- }
24
- else {
25
- config = preConfig;
26
- }export{config};//# sourceMappingURL=env-config.js.map
16
+ const config = preConfig;export{config};//# sourceMappingURL=env-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"env-config.js","sources":["../../src/config/env-config.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAkBA,IAAA,eAAU,EAAS,IAAA,CAAA;AAenB,QAAO,OAAQ,EAAE,IAAC,CAAA,SAAA,CAAA,EAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"env-config.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAoCP,GAAG;;CA+CzB,CAAC"}
1
+ {"version":3,"file":"useLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/hooks/useLayoutSettings.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,iBAAiB;;0BAoCP,GAAG;;CAgEzB,CAAC"}
@@ -1,4 +1,4 @@
1
- import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {merge}from'lodash-es';import {useParams}from'@remix-run/react';import {defaultSettings}from'../config/defaultSettings.js';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {compareAndSaveSettingsDifferences}from'../utils/settingsDifference.js';const updateColorWeak = (colorWeak) => {
1
+ import {useCallback}from'react';import {useDispatch,useSelector,shallowEqual}from'react-redux';import {merge}from'lodash-es';import {useParams}from'@remix-run/react';import {CHANGE_SETTINGS_ACTION}from'../constants/constants.js';import {compareAndSaveSettingsDifferences}from'../utils/settingsDifference.js';const updateColorWeak = (colorWeak) => {
2
2
  // @sri to avoid breaking during SSR, split into to checks
3
3
  if (typeof window !== 'undefined') {
4
4
  const root = document.getElementById('root');
@@ -26,13 +26,13 @@ const useLayoutSettings = () => {
26
26
  if (!response.ok) {
27
27
  throw new Error('Failed to fetch settings');
28
28
  }
29
- const diffSettings = await response.json();
30
- return diffSettings.settings;
29
+ const pageUiSettings = await response.json();
30
+ return pageUiSettings.settings;
31
31
  }
32
32
  catch (error) {
33
33
  console.error(error);
34
34
  // Return default settings if there's an error
35
- return defaultSettings;
35
+ return {};
36
36
  }
37
37
  }, []);
38
38
  const setSettings = useCallback(async (config) => {
@@ -45,7 +45,7 @@ const useLayoutSettings = () => {
45
45
  }
46
46
  }
47
47
  updateColorWeak(!!colorWeak);
48
- const cleanDiffSettings = compareAndSaveSettingsDifferences(config, defaultSettings);
48
+ const cleanDiffSettings = compareAndSaveSettingsDifferences(config, settings);
49
49
  const response = await fetch('/resources/settings', {
50
50
  method: 'POST',
51
51
  headers: {
@@ -54,11 +54,24 @@ const useLayoutSettings = () => {
54
54
  },
55
55
  body: JSON.stringify({ config: cleanDiffSettings }),
56
56
  });
57
+ // Check content type before parsing
58
+ const contentType = response.headers.get('content-type');
59
+ console.log('Response content-type:', contentType);
57
60
  if (!response.ok) {
61
+ const errorText = await response.text();
62
+ console.error('Server error response:', errorText.substring(0, 500));
58
63
  throw new Error('Failed to update settings');
59
64
  }
65
+ // If response is HTML instead of JSON, log it and throw error
66
+ if (!contentType || !contentType.includes('application/json')) {
67
+ const text = await response.text();
68
+ console.error('❌ Server returned non-JSON response (HTML error page):');
69
+ console.error('Content-Type:', contentType);
70
+ console.error('Response preview:', text.substring(0, 500));
71
+ throw new Error('Server crashed - returned HTML instead of JSON. Check server terminal for errors.');
72
+ }
60
73
  const result = await response.json();
61
- const pageDefaultSettings = result || defaultSettings;
74
+ const pageDefaultSettings = result;
62
75
  // Merge the full config with default settings before updating the store
63
76
  const mergedSettings = merge({}, pageDefaultSettings, config);
64
77
  dispatch({
@@ -1 +1 @@
1
- {"version":3,"file":"useLayoutSettings.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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{defaultSettings}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{assignDefaults}from'./utils/assignDefaults.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 +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{defaultSettings}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{assignDefaults}from'./utils/assignDefaults.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 +1 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAanD,QAAA,MAAM,eAAe,GACjB,OAAO,GAAgC,EACvC,mBAAwB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,QAyBrE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../../src/redux/reducers/settings.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAanD,QAAA,MAAM,eAAe,GACjB,OAAO,GAAmB,EAC1B,mBAAwB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,eAAe,CAAA;CAAE,QAyBrE,CAAC;AAEF,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,4 +1,4 @@
1
- import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {defaultSettings}from'../../config/defaultSettings.js';import {merge,cloneDeep}from'lodash-es';/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
1
+ import {CHANGE_LANGUAGE,CHANGE_SETTINGS_ACTION}from'../../constants/constants.js';import {merge,cloneDeep}from'lodash-es';/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
2
2
  /* eslint-disable no-case-declarations */
3
3
  // Note: We customize reducer part as AntPro uses inbuild way.
4
4
  const updateColorWeak = (colorWeak) => {
@@ -10,7 +10,7 @@ const updateColorWeak = (colorWeak) => {
10
10
  }
11
11
  }
12
12
  };
13
- const settingsReducer = (state = merge({}, defaultSettings), { type, payload = {} }) => {
13
+ const settingsReducer = (state = merge({}, {}), { type, payload = {} }) => {
14
14
  switch (type) {
15
15
  case CHANGE_SETTINGS_ACTION:
16
16
  const { colorWeak, contentWidth } = payload;
@@ -1 +1 @@
1
- {"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"wLAKA;AAaA;AA6BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"settings.js","sources":["../../../src/redux/reducers/settings.ts"],"sourcesContent":[null],"names":[],"mappings":"0HAGA;AAaA;AAEsE;AA2BtE,MAAA,eAAS,GAAe,CAAA,SAAG,KAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,4 +1,4 @@
1
- import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'../config/defaultSettings.js';import'lodash-es';// Combine the reducers into an object
1
+ import {combineReducers,configureStore}from'@reduxjs/toolkit';import {applicationErrors}from'./reducers/error.js';import'lodash-es';// Combine the reducers into an object
2
2
  const rootReducer = combineReducers({
3
3
  applicationErrors: applicationErrors, // Adding applicationErrors reducer
4
4
  });
@@ -5,4 +5,5 @@ export * from './menuUtils';
5
5
  export * from './matchMenuKeys';
6
6
  export * from './generateMenuLink';
7
7
  export * from './settingsDifference';
8
+ export * from './assignDefaults';
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -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,kBAAkB,CAAC"}
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * Compares settings objects and saves only the differences
3
+ * @returns An object containing only the differences, or an empty object on error
3
4
  */
4
5
  export declare const compareAndSaveSettingsDifferences: (currentSettings: any, defaultSettings: any) => any;
5
6
  //# sourceMappingURL=settingsDifference.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settingsDifference.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.ts"],"names":[],"mappings":"AAuKA;;GAEG;AACH,eAAO,MAAM,iCAAiC,GAAI,iBAAiB,GAAG,EAAE,iBAAiB,GAAG,QAoD3F,CAAC"}
1
+ {"version":3,"file":"settingsDifference.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.ts"],"names":[],"mappings":"AAkLA;;;GAGG;AACH,eAAO,MAAM,iCAAiC,GAAI,iBAAiB,GAAG,EAAE,iBAAiB,GAAG,QAqD3F,CAAC"}
@@ -16,17 +16,26 @@ const getDifference = (obj1, obj2) => {
16
16
  return source;
17
17
  }
18
18
  // Handle non-object comparisons (primitives, functions, etc.)
19
- if (!isObject(source) || !isObject(target)) {
20
- // Case-insensitive string comparison
19
+ // IMPORTANT: Check for string BEFORE isObject check, because strings are technically objects
20
+ if (typeof source === 'string' || typeof target === 'string') {
21
21
  if (typeof source === 'string' && typeof target === 'string') {
22
+ // Case-insensitive string comparison
22
23
  return source.toLowerCase() !== target.toLowerCase() ? source : undefined;
23
24
  }
25
+ // If types differ, return the source value
26
+ return source;
27
+ }
28
+ if (!isObject(source) || !isObject(target)) {
24
29
  return !isEqual(source, target) ? source : undefined;
25
30
  }
26
31
  // For arrays, do a simple equality check and return the full array if different
27
32
  if (Array.isArray(source) && Array.isArray(target)) {
28
33
  return !isEqual(source, target) ? source : undefined;
29
34
  }
35
+ // Prevent string from being treated as an object with numeric keys
36
+ if (Array.isArray(source) !== Array.isArray(target)) {
37
+ return source;
38
+ }
30
39
  // For objects, do deep comparison
31
40
  const result = transform(source, (result, value, key) => {
32
41
  // Skip keys that are in source but have the exact same value in target
@@ -134,12 +143,13 @@ const getRouteSettingsDifferences = (currentRouteSettings, defaultRouteSettings)
134
143
  };
135
144
  /**
136
145
  * Compares settings objects and saves only the differences
146
+ * @returns An object containing only the differences, or an empty object on error
137
147
  */
138
148
  const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) => {
139
149
  try {
140
150
  if (!currentSettings || !defaultSettings) {
141
151
  console.warn('Missing settings objects for comparison');
142
- return null;
152
+ return {};
143
153
  }
144
154
  // Make deep clones to avoid modifying the original objects
145
155
  const current = cloneDeep(currentSettings);
@@ -176,7 +186,8 @@ const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) =>
176
186
  }
177
187
  catch (error) {
178
188
  console.error('Error comparing settings differences:', error);
179
- return null;
189
+ // Return empty object instead of null to avoid downstream errors
190
+ return {};
180
191
  }
181
192
  };
182
193
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";AAyKG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAqLG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "12.0.16-alpha.43",
3
+ "version": "12.0.16-alpha.45",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -26,7 +26,8 @@
26
26
  "serialize-error": "^8.0.0"
27
27
  },
28
28
  "devDependencies": {
29
- "common": "12.0.16-alpha.42"
29
+ "common": "12.0.16-alpha.44",
30
+ "rc-menu": "^9.16.1"
30
31
  },
31
32
  "peerDependencies": {
32
33
  "@adminide-stack/core": ">=12.0.4-alpha.247",
@@ -43,5 +44,5 @@
43
44
  "typescript": {
44
45
  "definition": "lib/index.d.ts"
45
46
  },
46
- "gitHead": "84e6a9959c75a5315455290b9bd5024b3b1b9216"
47
+ "gitHead": "3a607a791be415119ea17a70367ba32204068214"
47
48
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"SettingsConfigurationModel.test.d.ts","sourceRoot":"","sources":["../../../src/components/UpdateSettings/SettingsConfigurationModel.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ApplicationErrorHandlerCommon.test.d.ts","sourceRoot":"","sources":["../../../src/components/__tests__/ApplicationErrorHandlerCommon.test.tsx"],"names":[],"mappings":""}