@admin-layout/client 12.0.16-alpha.7 → 12.0.16-alpha.70

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 (81) hide show
  1. package/lib/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +1 -0
  2. package/lib/__tests__/ConfigurationModelWrapper.test.d.ts +2 -0
  3. package/lib/__tests__/ConfigurationModelWrapper.test.d.ts.map +1 -0
  4. package/lib/__tests__/SettingsConfigurationModel.test.d.ts.map +1 -0
  5. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts +3 -0
  6. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts.map +1 -0
  7. package/lib/colors/colorsList.js.map +1 -1
  8. package/lib/colors/presets/black.js.map +1 -1
  9. package/lib/colors/presets/white.js.map +1 -1
  10. package/lib/components/ApplicationErrorHandlerCommon.js.map +1 -1
  11. package/lib/components/ErrorBoundaryCommon.js.map +1 -1
  12. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts +65 -20
  13. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -1
  14. package/lib/components/UpdateSettings/UpdateSettings.server.js +198 -103
  15. package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
  16. package/lib/components/UpdateSettings/UpdateSettings.server.test.d.ts +2 -0
  17. package/lib/components/UpdateSettings/UpdateSettings.server.test.d.ts.map +1 -0
  18. package/lib/config/defaultSettings.d.ts +76 -1
  19. package/lib/config/defaultSettings.d.ts.map +1 -1
  20. package/lib/config/defaultSettings.js +2 -112
  21. package/lib/config/defaultSettings.js.map +1 -1
  22. package/lib/config/env-config.d.ts +3 -5
  23. package/lib/config/env-config.d.ts.map +1 -1
  24. package/lib/config/env-config.js +13 -20
  25. package/lib/config/env-config.js.map +1 -1
  26. package/lib/constants/constants.js.map +1 -1
  27. package/lib/constants/error.js.map +1 -1
  28. package/lib/constants/languages.js.map +1 -1
  29. package/lib/constants/layout.js.map +1 -1
  30. package/lib/graphql/link/error-link.js.map +1 -1
  31. package/lib/hooks/useLayoutSettings.d.ts +1 -0
  32. package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
  33. package/lib/hooks/useLayoutSettings.js +50 -9
  34. package/lib/hooks/useLayoutSettings.js.map +1 -1
  35. package/lib/hooks/useLayoutSettings.test.d.ts +2 -0
  36. package/lib/hooks/useLayoutSettings.test.d.ts.map +1 -0
  37. package/lib/index.js +1 -1
  38. package/lib/index.native.js +1 -1
  39. package/lib/interfaces/pure-settings.d.ts +8 -0
  40. package/lib/interfaces/pure-settings.d.ts.map +1 -1
  41. package/lib/interfaces/settings.d.ts +7 -6
  42. package/lib/interfaces/settings.d.ts.map +1 -1
  43. package/lib/interfaces/settings.js.map +1 -1
  44. package/lib/interfaces/typings.d.ts +1 -1
  45. package/lib/interfaces/typings.d.ts.map +1 -1
  46. package/lib/redux/actions/error-actions.js.map +1 -1
  47. package/lib/redux/reducers/error.js.map +1 -1
  48. package/lib/redux/reducers/settings.d.ts.map +1 -1
  49. package/lib/redux/reducers/settings.js +2 -2
  50. package/lib/redux/reducers/settings.js.map +1 -1
  51. package/lib/redux/selectors/index.js.map +1 -1
  52. package/lib/redux/store.js +1 -1
  53. package/lib/redux/store.js.map +1 -1
  54. package/lib/themes/systemFont/index.js.map +1 -1
  55. package/lib/themes/templates/createLayoutTheme.js.map +1 -1
  56. package/lib/themes/templates/darkLayoutTheme.js.map +1 -1
  57. package/lib/themes/templates/lightLayoutTheme.js.map +1 -1
  58. package/lib/utils/assignDefaults.d.ts +0 -1
  59. package/lib/utils/assignDefaults.d.ts.map +1 -1
  60. package/lib/utils/assignDefaults.test.d.ts +0 -1
  61. package/lib/utils/generateMenuLink.js.map +1 -1
  62. package/lib/utils/matchMenuKeys.js.map +1 -1
  63. package/lib/utils/menuUtils.js.map +1 -1
  64. package/lib/utils/parseEnvUiLayoutSettings.d.ts +6 -0
  65. package/lib/utils/parseEnvUiLayoutSettings.d.ts.map +1 -0
  66. package/lib/utils/parseEnvUiLayoutSettings.js +27 -0
  67. package/lib/utils/parseEnvUiLayoutSettings.js.map +1 -0
  68. package/lib/utils/parseEnvUiLayoutSettings.test.d.ts +2 -0
  69. package/lib/utils/parseEnvUiLayoutSettings.test.d.ts.map +1 -0
  70. package/lib/utils/seperatedMenus.js.map +1 -1
  71. package/lib/utils/settingsDifference.d.ts +1 -0
  72. package/lib/utils/settingsDifference.d.ts.map +1 -1
  73. package/lib/utils/settingsDifference.js +51 -110
  74. package/lib/utils/settingsDifference.js.map +1 -1
  75. package/package.json +8 -4
  76. package/lib/components/UpdateSettings/SettingsConfigurationModel.test.d.ts.map +0 -1
  77. package/lib/components/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +0 -1
  78. package/lib/utils/assignDefaults.js +0 -166
  79. package/lib/utils/assignDefaults.js.map +0 -1
  80. /package/lib/{components/__tests__ → __tests__}/ApplicationErrorHandlerCommon.test.d.ts +0 -0
  81. /package/lib/{components/UpdateSettings → __tests__}/SettingsConfigurationModel.test.d.ts +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAA,eAA6B,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"generateMenuLink.js","sources":["../../src/utils/generateMenuLink.ts"],"sourcesContent":[null],"names":[],"mappings":"AAwEA,SAAA,eAAa,EAAA,OAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"matchMenuKeys.js","sources":["../../src/utils/matchMenuKeys.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAEA;;;;;;;AAOG,MAAA,gBAAA,GAAA,CAAA,SAAA,EAAA,WAAA,KAAA;AAEH,IAAA,MAAA,SAAa,GAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"matchMenuKeys.js","sources":["../../src/utils/matchMenuKeys.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAEA;;;;;;;AAOG,MAAA,gBAAA,GAAA,CAAA,SAAA,EAAA,WAAA,KAAA;AAEH,IAAA,MAAA,SAAO,GAAM,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaG;AACH;AA2BA;AAeA,MAAA,uCAA+B;AAS/B,IAAO,MAAA,CAAA,KAAA,CAAA,kCAA2C,CAAA;AAWlD,IAAA,MAAA,cAAa,GAAA,mBAA0B,CAAA,QAAA,CAAA;AAevC,IAAA,QAAA;;;AAGG,QAAA,MAAA,EAAA,SAAA,EAAA,GAAA,IAAA;AACH,QAAA,IAAA,KAAA,CAAA,OAA2C,CAAA,SAAA,CAAA,IAAA,SAAA,EAAA,MAAI,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"menuUtils.js","sources":["../../src/utils/menuUtils.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAaG;AACH;AA2BA;AAeA,MAAA,uCAA+B;AAS/B,IAAA,MAAA,CAAA,KAAO,CAAA,kCAAgC,CAAA;AAWvC,IAAA,MAAA,cAAa,GAAA,mBAA0B,CAAA,QAAA,CAAA;AAevC,IAAA,QAAA;;;AAGG,QAAA,MAAA,EAAA,SAAA,EAAA,GAAA,IAAA;AACH,QAAA,IAAA,KAAA,CAAA,OAAgB,CAAA,SAAA,CAAA,IAAA,SAAA,EAA2B,MAAI,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Parse LAYOUT_SETTINGS from config (which may be a JSON string from env variable)
3
+ * This is the single place where we handle the parsing logic
4
+ */
5
+ export declare function parseEnvLayoutSettings(): Record<string, any>;
6
+ //# sourceMappingURL=parseEnvUiLayoutSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEnvUiLayoutSettings.d.ts","sourceRoot":"","sources":["../../src/utils/parseEnvUiLayoutSettings.ts"],"names":[],"mappings":"AACA;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAwB5D"}
@@ -0,0 +1,27 @@
1
+ import {config}from'../config/env-config.js';import'../config/defaultSettings.js';/**
2
+ * Parse LAYOUT_SETTINGS from config (which may be a JSON string from env variable)
3
+ * This is the single place where we handle the parsing logic
4
+ */
5
+ function parseEnvLayoutSettings() {
6
+ try {
7
+ if (!config.LAYOUT_SETTINGS) {
8
+ return {};
9
+ }
10
+ // If it's already an object (parsed by envalid json validator), return it
11
+ if (typeof config.LAYOUT_SETTINGS === 'object' && !Array.isArray(config.LAYOUT_SETTINGS)) {
12
+ return config.LAYOUT_SETTINGS;
13
+ }
14
+ // If it's a string, parse it (this happens when envalid uses str validator)
15
+ if (typeof config.LAYOUT_SETTINGS === 'string') {
16
+ const parsed = JSON.parse(config.LAYOUT_SETTINGS);
17
+ return parsed || {};
18
+ }
19
+ console.warn('⚠️ config.LAYOUT_SETTINGS is unexpected type:', typeof config.LAYOUT_SETTINGS);
20
+ return {};
21
+ }
22
+ catch (error) {
23
+ console.error('❌ Error parsing LAYOUT_SETTINGS:', error);
24
+ console.error('❌ Value was:', config.LAYOUT_SETTINGS);
25
+ return {};
26
+ }
27
+ }export{parseEnvLayoutSettings};//# sourceMappingURL=parseEnvUiLayoutSettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEnvUiLayoutSettings.js","sources":["../../src/utils/parseEnvUiLayoutSettings.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAIG;AACH;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=parseEnvUiLayoutSettings.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseEnvUiLayoutSettings.test.d.ts","sourceRoot":"","sources":["../../src/utils/parseEnvUiLayoutSettings.test.ts"],"names":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"seperatedMenus.js","sources":["../../src/utils/seperatedMenus.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAGY,uBAAkB,GAAG,CAAA,KAAA,KAAA;AAC7B,IAAA,IAAA,CAAA,KAAU,CAAC,OAAc,CAAA,KAAA,CAAA,EAAE;AAC3B,QAAA,OAAW,CAAC,GAAc,CAAA,kBAAG,EAAA,KAAA,CAAA;AAC7B;AACA;IACF,MAAA,UAAA,GAAA,KAAA,EAAA,MAAA,CAAA,CAAA,IAAA,KAAA,IAAA,CAAA,QAAA,KAAA,OAAA,CAAA,IAAA,EAAA;AAGF,IAAO,MAAA,WAAM,GAAiB,KAAA,EAAA,MAAA,CAAA,CAAA,IAAG,KAAO,IAAY,CAAA,QAAA,KAAO,QAAA;;;;;;;;;;;"}
1
+ {"version":3,"file":"seperatedMenus.js","sources":["../../src/utils/seperatedMenus.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AAGY,uBAAkB,GAAG,CAAA,KAAA,KAAA;AAC7B,IAAA,IAAA,CAAA,KAAU,CAAC,OAAE,CAAA,KAAA,CAAY,EAAE;AAC3B,QAAA,OAAW,CAAC,GAAE,CAAA,kBAAe,EAAA,KAAA,CAAA;AAC7B,IAAA;AACA;IACF,MAAA,UAAA,GAAA,KAAA,EAAA,MAAA,CAAA,CAAA,IAAA,KAAA,IAAA,CAAA,QAAA,KAAA,OAAA,CAAA,IAAA,EAAA;AAGF,IAAA,MAAA,WAAa,GAAA,KAAA,EAAA,MAAA,CAAiB,CAAA,IAAG,KAAO,IAAA,CAAA,QAAY,KAAE,QAAK;;;;;;;;;;;"}
@@ -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,QA8D3F,CAAC"}
@@ -1,4 +1,4 @@
1
- import {cloneDeep,get,isObject,isEqual,transform}from'lodash-es';/**
1
+ import {cloneDeep,isObject,isEqual,transform}from'lodash-es';/**
2
2
  * Gets the deep differences between two objects
3
3
  * Returns only the values that differ from obj2
4
4
  */
@@ -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
@@ -54,129 +63,61 @@ const getDifference = (obj1, obj2) => {
54
63
  // Return undefined if the resulting object is empty
55
64
  return Object.keys(result).length > 0 ? result : undefined;
56
65
  };
57
- /**
58
- * Special handler for route settings differences with improved nested comparison
59
- */
60
- const getRouteSettingsDifferences = (currentRouteSettings, defaultRouteSettings) => {
61
- const differences = {};
62
- // Get the default route template (typically from '/')
63
- const defaultRouteTemplate = defaultRouteSettings['/'] || Object.values(defaultRouteSettings)[0];
64
- if (!defaultRouteTemplate) {
65
- console.warn('No default route template found for comparison');
66
- return currentRouteSettings;
67
- }
68
- // Compare each route's settings
69
- Object.keys(currentRouteSettings).forEach((route) => {
70
- const currentRouteConfig = currentRouteSettings[route];
71
- // Use the specific route config if it exists, otherwise use the default template
72
- const defaultRouteConfig = defaultRouteSettings[route] || defaultRouteTemplate;
73
- // Compare each section separately (layout, regions, etc)
74
- const routeDiff = {};
75
- Object.keys(currentRouteConfig).forEach((section) => {
76
- if (section === 'layout' || section === 'regions') {
77
- const sectionDiff = {};
78
- // Compare desktop and mobile separately
79
- ['desktop', 'mobile'].forEach((device) => {
80
- if (!currentRouteConfig[section][device]) {
81
- return;
82
- }
83
- // For regions section with header/footer/background
84
- if (section === 'regions') {
85
- const regionsDiff = {};
86
- ['header', 'footer', 'background'].forEach((region) => {
87
- if (!currentRouteConfig[section][device][region]) {
88
- return;
89
- }
90
- // Get default path for comparison
91
- const defaultRegionPath = `${section}.${device}.${region}`;
92
- const defaultRegion = get(defaultRouteConfig, defaultRegionPath);
93
- if (defaultRegion) {
94
- const regionDiff = getDifference(currentRouteConfig[section][device][region], defaultRegion);
95
- if (regionDiff !== undefined &&
96
- (Array.isArray(regionDiff) || Object.keys(regionDiff).length > 0)) {
97
- regionsDiff[region] = regionDiff;
98
- }
99
- }
100
- });
101
- if (Object.keys(regionsDiff).length > 0) {
102
- sectionDiff[device] = regionsDiff;
103
- }
104
- }
105
- else {
106
- // For other sections (like layout)
107
- const defaultDevicePath = `${section}.${device}`;
108
- const defaultDevice = get(defaultRouteConfig, defaultDevicePath);
109
- if (defaultDevice) {
110
- const deviceDiff = getDifference(currentRouteConfig[section][device], defaultDevice);
111
- if (deviceDiff !== undefined && Object.keys(deviceDiff).length > 0) {
112
- sectionDiff[device] = deviceDiff;
113
- }
114
- }
115
- }
116
- });
117
- if (Object.keys(sectionDiff).length > 0) {
118
- routeDiff[section] = sectionDiff;
119
- }
120
- }
121
- else {
122
- const sectionDiff = getDifference(currentRouteConfig[section], defaultRouteConfig[section]);
123
- if (sectionDiff !== undefined && Object.keys(sectionDiff).length > 0) {
124
- routeDiff[section] = sectionDiff;
125
- }
126
- }
127
- });
128
- // Only include the route if there are actual differences
129
- if (Object.keys(routeDiff).length > 0) {
130
- differences[route] = routeDiff;
131
- }
132
- });
133
- return Object.keys(differences).length > 0 ? differences : undefined;
134
- };
135
66
  /**
136
67
  * Compares settings objects and saves only the differences
68
+ * @returns An object containing only the differences, or an empty object on error
137
69
  */
138
70
  const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) => {
139
71
  try {
140
72
  if (!currentSettings || !defaultSettings) {
141
73
  console.warn('Missing settings objects for comparison');
142
- return null;
74
+ return {};
143
75
  }
144
76
  // Make deep clones to avoid modifying the original objects
145
77
  const current = cloneDeep(currentSettings);
146
78
  const defaults = cloneDeep(defaultSettings);
147
- // Handle route settings separately
148
- const routeSettingsDiff = current.routeSettings
149
- ? getRouteSettingsDifferences(current.routeSettings, defaults?.routeSettings || {})
150
- : undefined;
151
- // Make a copy of settings without routeSettings to compare separately
152
- const currentWithoutRoutes = { ...current };
153
- const defaultWithoutRoutes = { ...defaults };
154
- delete currentWithoutRoutes.routeSettings;
155
- delete defaultWithoutRoutes.routeSettings;
156
- // Get differences for all other settings
157
- const otherSettingsDiff = getDifference(currentWithoutRoutes, defaultWithoutRoutes);
158
- // Combine the differences
159
- const diffSettings = {};
160
- // Add other settings differences if any exist and are not empty objects
161
- if (otherSettingsDiff && Object.keys(otherSettingsDiff).length > 0) {
162
- Object.assign(diffSettings, otherSettingsDiff);
163
- }
164
- // Add route settings differences if any exist
165
- if (routeSettingsDiff && Object.keys(routeSettingsDiff).length > 0) {
166
- diffSettings.routeSettings = routeSettingsDiff;
167
- }
168
- // If there are no differences at all, return early
169
- if (Object.keys(diffSettings).length === 0) {
170
- return {};
171
- }
79
+ // Extract overrides (bracket keys) from current settings
80
+ const overrides = {};
81
+ Object.keys(current).forEach((key) => {
82
+ if (key.startsWith('[') && key.endsWith(']')) {
83
+ overrides[key] = current[key];
84
+ }
85
+ });
86
+ // Get differences for non-override settings (base settings)
87
+ const currentBase = { ...current };
88
+ const defaultBase = { ...defaults };
89
+ // Remove all bracket keys from both objects
90
+ Object.keys(currentBase).forEach((key) => {
91
+ if (key.startsWith('[') && key.endsWith(']')) {
92
+ delete currentBase[key];
93
+ }
94
+ });
95
+ Object.keys(defaultBase).forEach((key) => {
96
+ if (key.startsWith('[') && key.endsWith(']')) {
97
+ delete defaultBase[key];
98
+ }
99
+ });
100
+ const baseSettingsDiff = getDifference(currentBase, defaultBase);
101
+ // Combine base settings differences with overrides
102
+ // const diffSettings: any = {};
103
+ // // Add base settings differences if any exist
104
+ // if (baseSettingsDiff && Object.keys(baseSettingsDiff).length > 0) {
105
+ // Object.assign(diffSettings, baseSettingsDiff);
106
+ // }
107
+ // console.log('diffSettings :', diffSettings);
108
+ // // Add all overrides (they are always different from defaults)
109
+ // Object.assign(diffSettings, overrides);
110
+ // // If there are no differences at all, return early
111
+ // if (Object.keys(diffSettings).length === 0) {
112
+ // return {};
113
+ // }
172
114
  // Remove empty objects from the diff
173
- // This helps prevent unnecessary properties in the payload
174
- const cleanDiffSettings = removeEmptyObjects(diffSettings);
115
+ const cleanDiffSettings = removeEmptyObjects(baseSettingsDiff);
175
116
  return cleanDiffSettings;
176
117
  }
177
118
  catch (error) {
178
119
  console.error('Error comparing settings differences:', error);
179
- return null;
120
+ return {};
180
121
  }
181
122
  };
182
123
  /**
@@ -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.7",
3
+ "version": "12.0.16-alpha.70",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -23,11 +23,15 @@
23
23
  "watch": "yarn build:lib:watch"
24
24
  },
25
25
  "dependencies": {
26
- "@common-stack/client-core": "7.1.1-alpha.32",
27
- "common": "12.0.16-alpha.7",
28
26
  "serialize-error": "^8.0.0"
29
27
  },
28
+ "devDependencies": {
29
+ "common": "12.0.16-alpha.70",
30
+ "rc-menu": "^9.16.1"
31
+ },
30
32
  "peerDependencies": {
33
+ "@adminide-stack/core": ">=12.0.4-alpha.247",
34
+ "@common-stack/client-core": ">=7.1.1-alpha.63",
31
35
  "envalid": "*",
32
36
  "history": "*",
33
37
  "lodash-es": "^4.17.21",
@@ -40,5 +44,5 @@
40
44
  "typescript": {
41
45
  "definition": "lib/index.d.ts"
42
46
  },
43
- "gitHead": "dc4d290fb02b1a5c8512168953772c8aeeec585b"
47
+ "gitHead": "a086ab5ea5213416f3c5e929bd68a74f2e89979e"
44
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":""}
@@ -1,166 +0,0 @@
1
- /**
2
- * Recursively assigns default values only for non-existent keys in target object,
3
- * based on source object structure. Does not modify any existing values in target.
4
- * @param target - The target object to assign defaults to
5
- * @param source - The source object containing the structure and default values
6
- */
7
- function assignDefaults(target, source) {
8
- // Special handling for routeSettings to ensure all routes have complete structure
9
- if (source?.routeSettings && target.routeSettings) {
10
- const rootRoute = source.routeSettings['/'];
11
- if (rootRoute) {
12
- Object.keys(target.routeSettings).forEach((route) => {
13
- const currentRoute = target.routeSettings[route];
14
- // Handle layout
15
- if (!currentRoute.layout) {
16
- currentRoute.layout = {
17
- desktop: { ...rootRoute.layout.desktop },
18
- mobile: { ...rootRoute.layout.mobile },
19
- };
20
- }
21
- else {
22
- if (!currentRoute.layout.desktop) {
23
- currentRoute.layout.desktop = { ...rootRoute.layout.desktop };
24
- }
25
- else {
26
- Object.keys(rootRoute.layout.desktop).forEach((key) => {
27
- if (!(key in currentRoute.layout.desktop)) {
28
- currentRoute.layout.desktop[key] = rootRoute.layout.desktop[key];
29
- }
30
- });
31
- }
32
- if (!currentRoute.layout.mobile) {
33
- currentRoute.layout.mobile = { ...rootRoute.layout.mobile };
34
- }
35
- else {
36
- Object.keys(rootRoute.layout.mobile).forEach((key) => {
37
- if (!(key in currentRoute.layout.mobile)) {
38
- currentRoute.layout.mobile[key] = rootRoute.layout.mobile[key];
39
- }
40
- });
41
- }
42
- }
43
- // Handle regions
44
- if (!currentRoute.regions) {
45
- currentRoute.regions = {
46
- desktop: {
47
- header: { ...rootRoute.regions.desktop.header },
48
- background: { ...rootRoute.regions.desktop.background },
49
- footer: { ...rootRoute.regions.desktop.footer },
50
- },
51
- mobile: {
52
- header: { ...rootRoute.regions.mobile.header },
53
- background: { ...rootRoute.regions.mobile.background },
54
- footer: { ...rootRoute.regions.mobile.footer },
55
- },
56
- };
57
- }
58
- else {
59
- // Handle desktop regions
60
- if (!currentRoute.regions.desktop) {
61
- currentRoute.regions.desktop = {
62
- header: { ...rootRoute.regions.desktop.header },
63
- background: { ...rootRoute.regions.desktop.background },
64
- footer: { ...rootRoute.regions.desktop.footer },
65
- };
66
- }
67
- else {
68
- // Handle desktop header
69
- if (!currentRoute.regions.desktop.header) {
70
- currentRoute.regions.desktop.header = { ...rootRoute.regions.desktop.header };
71
- }
72
- else {
73
- Object.keys(rootRoute.regions.desktop.header).forEach((key) => {
74
- if (!(key in currentRoute.regions.desktop.header)) {
75
- currentRoute.regions.desktop.header[key] = rootRoute.regions.desktop.header[key];
76
- }
77
- });
78
- }
79
- // Handle desktop background
80
- if (!currentRoute.regions.desktop.background) {
81
- currentRoute.regions.desktop.background = { ...rootRoute.regions.desktop.background };
82
- }
83
- else {
84
- Object.keys(rootRoute.regions.desktop.background).forEach((key) => {
85
- if (!(key in currentRoute.regions.desktop.background)) {
86
- currentRoute.regions.desktop.background[key] =
87
- rootRoute.regions.desktop.background[key];
88
- }
89
- });
90
- }
91
- // Handle desktop footer
92
- if (!currentRoute.regions.desktop.footer) {
93
- currentRoute.regions.desktop.footer = { ...rootRoute.regions.desktop.footer };
94
- }
95
- else {
96
- Object.keys(rootRoute.regions.desktop.footer).forEach((key) => {
97
- if (!(key in currentRoute.regions.desktop.footer)) {
98
- currentRoute.regions.desktop.footer[key] = rootRoute.regions.desktop.footer[key];
99
- }
100
- });
101
- }
102
- }
103
- // Handle mobile regions
104
- if (!currentRoute.regions.mobile) {
105
- currentRoute.regions.mobile = {
106
- header: { ...rootRoute.regions.mobile.header },
107
- background: { ...rootRoute.regions.mobile.background },
108
- footer: { ...rootRoute.regions.mobile.footer },
109
- };
110
- }
111
- else {
112
- // Handle mobile header
113
- if (!currentRoute.regions.mobile.header) {
114
- currentRoute.regions.mobile.header = { ...rootRoute.regions.mobile.header };
115
- }
116
- else {
117
- Object.keys(rootRoute.regions.mobile.header).forEach((key) => {
118
- if (!(key in currentRoute.regions.mobile.header)) {
119
- currentRoute.regions.mobile.header[key] = rootRoute.regions.mobile.header[key];
120
- }
121
- });
122
- }
123
- // Handle mobile background
124
- if (!currentRoute.regions.mobile.background) {
125
- currentRoute.regions.mobile.background = { ...rootRoute.regions.mobile.background };
126
- }
127
- else {
128
- Object.keys(rootRoute.regions.mobile.background).forEach((key) => {
129
- if (!(key in currentRoute.regions.mobile.background)) {
130
- currentRoute.regions.mobile.background[key] =
131
- rootRoute.regions.mobile.background[key];
132
- }
133
- });
134
- }
135
- // Handle mobile footer
136
- if (!currentRoute.regions.mobile.footer) {
137
- currentRoute.regions.mobile.footer = { ...rootRoute.regions.mobile.footer };
138
- }
139
- else {
140
- Object.keys(rootRoute.regions.mobile.footer).forEach((key) => {
141
- if (!(key in currentRoute.regions.mobile.footer)) {
142
- currentRoute.regions.mobile.footer[key] = rootRoute.regions.mobile.footer[key];
143
- }
144
- });
145
- }
146
- }
147
- }
148
- });
149
- }
150
- }
151
- Object.keys(source).forEach((key) => {
152
- if (!(key in target)) {
153
- // Only assign default if the key doesn't exist
154
- target[key] = source[key];
155
- }
156
- else if (typeof source[key] === 'object' &&
157
- source[key] !== null &&
158
- !Array.isArray(source[key]) &&
159
- typeof target[key] === 'object' &&
160
- target[key] !== null &&
161
- !Array.isArray(target[key])) {
162
- // Recursively assign for nested objects
163
- assignDefaults(target[key], source[key]);
164
- }
165
- });
166
- }export{assignDefaults};//# sourceMappingURL=assignDefaults.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"assignDefaults.js","sources":["../../src/utils/assignDefaults.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;AACI;AACH;AAED;;;;;AAKG,IAAA,IAAA,MAAA,EAAA,aAAA,IAAA,MAAA,CAAA,aAAA,EAAA;AACH,QAAgB,MAAA,SAAA,GAAA,MAAA,CAAA,aAAuB,CAAA,GAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}