@admin-layout/client 12.0.16-alpha.44 → 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.
@@ -4,8 +4,5 @@ const black = {
4
4
  base300: '#2b2f3b',
5
5
  base400: '#181a21',
6
6
  base: '#20232c',
7
- base600: '#000',
8
- base700: '#FFF',
9
- base800: '#000',
10
7
  base900: '#FFF'
11
8
  };export{black};//# sourceMappingURL=black.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"black.js","sources":["../../../src/colors/presets/black.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;;;;"}
1
+ {"version":3,"file":"black.js","sources":["../../../src/colors/presets/black.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;"}
@@ -4,8 +4,5 @@ const white = {
4
4
  base300: '#C3C3C3',
5
5
  base400: '#F7F7F7', // #F2F2F2
6
6
  base: '#FFF',
7
- base600: '#000',
8
- base700: '#FFF',
9
- base800: '#FFF',
10
7
  base900: '#000'
11
8
  };export{white};//# sourceMappingURL=white.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"white.js","sources":["../../../src/colors/presets/white.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;;;;"}
1
+ {"version":3,"file":"white.js","sources":["../../../src/colors/presets/white.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAS,MAAA,KAAO,GAAA;AAEhB,IAAA,OAAA,EAAA,MAAO;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CAsChG"}
1
+ {"version":3,"file":"LayoutCookieProvider.d.ts","sourceRoot":"","sources":["../../src/components/LayoutCookieProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAA6C,MAAM,OAAO,CAAC;AAIlE,UAAU,yBAAyB;IAC/B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EAAE,QAAQ,EAAE,EAAE,yBAAyB,GAAG,KAAK,CAAC,YAAY,CA2BhG"}
@@ -3,19 +3,9 @@ import {jsx,Fragment}from'react/jsx-runtime';import {useRouteLoaderData}from'@re
3
3
  const settings = routeData?.settings?.settings || routeData?.settings;
4
4
  const dispatch = useDispatch();
5
5
  const hasDispatched = useRef(false);
6
- // Debug logging
7
- if (typeof window !== 'undefined') {
8
- console.log('🎨 LayoutCookieProvider - Client Side:', {
9
- hasRouteData: !!routeData,
10
- hasSettings: !!settings,
11
- settingsKeys: settings ? Object.keys(settings).slice(0, 10) : 'null',
12
- settingsData: settings, // Full settings object
13
- });
14
- }
15
6
  // Handle both server and client side
16
7
  useEffect(() => {
17
8
  if (settings && !hasDispatched.current) {
18
- console.log('🎨 LayoutCookieProvider - Dispatching settings to Redux');
19
9
  dispatch({
20
10
  type: CHANGE_SETTINGS_ACTION,
21
11
  payload: settings,
@@ -1 +1 @@
1
- {"version":3,"file":"LayoutCookieProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"LayoutCookieProvider.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,18 +1,14 @@
1
1
  import { IAppLoadContext } from '@common-stack/client-core';
2
2
  import { IResourceParams } from '@common-stack/core';
3
- import { IGetPageSettingsQuery } from 'common';
4
- import type { ApolloClient } from '@apollo/client';
5
3
  import { ProSettings } from '../../interfaces';
6
4
  export declare const settingsCookie: import("@remix-run/server-runtime").Cookie;
7
- export declare function fetchPageSettings(apolloClient: ApolloClient<any>): Promise<import("@apollo/client").InteropApolloQueryResult<IGetPageSettingsQuery>>;
8
5
  export declare function fetchPageSettingsWithFetch(request: Request, graphqlUrl?: string): Promise<{
9
6
  data: any;
10
7
  }>;
11
- export declare function settingsLoaderUtil({ request, context, params, useFetch, }: {
8
+ export declare function settingsLoaderUtil({ request, context, params, }: {
12
9
  request: Request;
13
10
  context?: IAppLoadContext;
14
11
  params?: IResourceParams;
15
- useFetch?: boolean;
16
12
  }): Promise<{
17
13
  settings: ProSettings;
18
14
  setCookie: string;
@@ -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,EAKH,qBAAqB,EAExB,MAAM,QAAQ,CAAC;AAGhB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGnD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAK/C,eAAO,MAAM,cAAc,4CAMzB,CAAC;AAGH,wBAAsB,iBAAiB,CAAC,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,qFAyBtE;AAGD,wBAAsB,0BAA0B,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,CAAC,EAAE,MAAM;;GAqErF;AAED,wBAAsB,kBAAkB,CAAC,EACrC,OAAO,EACP,OAAO,EACP,MAAM,EACN,QAAe,GAClB,EAAE;IACC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,GAAG,OAAO,CAAC;IACR,QAAQ,EAAE,WAAW,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC,CA6FD"}
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"}
@@ -5,27 +5,7 @@ import {createCookie}from'@remix-run/node';import {ConfigCollectionName,ConfigFr
5
5
  path: '/', // Ensure cookie is available for all paths
6
6
  domain: config.isProd ? config.APP_DOMAIN : undefined,
7
7
  });
8
- // Helper to fetch page settings from Apollo
9
- async function fetchPageSettings(apolloClient) {
10
- const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
11
- resourceType: ConfigCollectionName.Applications,
12
- resourceId: config.APPLICATION_ID,
13
- idField: 'appId',
14
- }, {}, ConfigFragmentName.UiSettings);
15
- const result = await apolloClient.query({
16
- query: GetPageSettingsDocument,
17
- variables: {
18
- resourceUri: resource,
19
- options: {
20
- schemaId: ConfigurationSchemaId.UiLayout,
21
- target: 2 /* ConfigurationTarget.APPLICATION */,
22
- },
23
- },
24
- fetchPolicy: 'no-cache', // Bypass cache completely - always fetch fresh from server
25
- });
26
- return result;
27
- }
28
- // Alternative: Direct fetch-based implementation (for testing/comparison)
8
+ // Direct fetch-based implementation for fetching page settings
29
9
  async function fetchPageSettingsWithFetch(request, graphqlUrl) {
30
10
  const resource = generateCdecodeUri(DEFAULT_TENANT_ID, {
31
11
  resourceType: ConfigCollectionName.Applications,
@@ -82,20 +62,11 @@ async function fetchPageSettingsWithFetch(request, graphqlUrl) {
82
62
  throw error;
83
63
  }
84
64
  }
85
- async function settingsLoaderUtil({ request, context, params, useFetch = true, // Set to true to test fetch-based approach
86
- }) {
65
+ async function settingsLoaderUtil({ request, context, params, }) {
87
66
  const cookieHeader = request.headers.get('Cookie');
88
- const { apolloClient } = context;
89
- // Fetch settings from backend - choose method based on flag
90
- let result;
91
- if (useFetch) {
92
- console.log('📡 Using direct fetch to get settings');
93
- result = await fetchPageSettingsWithFetch(request);
94
- }
95
- else {
96
- console.log('🚀 Using Apollo Client to get settings');
97
- result = await fetchPageSettings(apolloClient);
98
- }
67
+ // Fetch settings from backend using direct fetch
68
+ console.log('📡 Using direct fetch to get settings');
69
+ const result = await fetchPageSettingsWithFetch(request);
99
70
  const pageSettings = result?.data?.pageSettings?.settings
100
71
  ? JSON.parse(JSON.stringify(result?.data?.pageSettings?.settings))
101
72
  : null;
@@ -160,4 +131,4 @@ async function settingsLoaderUtil({ request, context, params, useFetch = true, /
160
131
  // Refresh the cookie to keep it active
161
132
  const cookie = await settingsCookie.serialize(settings);
162
133
  return { settings: fullSettings, setCookie: cookie };
163
- }export{fetchPageSettings,fetchPageSettingsWithFetch,settingsCookie,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":"mkBA+HC,MAAA,cAAA,GAAA,YAAA,CAAA,UAAA,EAAA;AAED,IAAA,MAAA,EAAA,EAAA,GAAA,EAAA,GAAA,EAAsB,GAAA,EAAA;IAMlB,QAAO;IACP,QAAQ,EAAE,KAAA;IACV,IAAA,EAAM,GAAG;IACT,MAAA,EAAQ,MAAG,CAAA,MAAQ,GAAA,MAAA,CAAA,UAAA,GAAA,SAAA;AACtB,CAAA;;AAEG,eAAkB,iBAAA,CAAA,YAAA,EAAA;AACrB,IA6FA,MAAA,QAAA,GAAA,kBAAA,CAAA,iBAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
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,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.44",
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",
@@ -44,5 +44,5 @@
44
44
  "typescript": {
45
45
  "definition": "lib/index.d.ts"
46
46
  },
47
- "gitHead": "81709761b697730903123a9d1d79d2d907a3edc5"
47
+ "gitHead": "3a607a791be415119ea17a70367ba32204068214"
48
48
  }