@admin-layout/tailwind-design-pro 12.0.16-alpha.54 → 12.0.16-alpha.56

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 (46) hide show
  1. package/lib/components/Layout/BasicLayout/index.js +2 -2
  2. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  3. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +2 -2
  4. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -1
  5. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  6. package/lib/components/Layout/TailwindLayout.js +39 -11
  7. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  8. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +1 -1
  9. package/lib/components/SettingDrawer/CheckBoxTheme.js +4 -20
  10. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
  11. package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -1
  12. package/lib/components/SettingDrawer/InvitationSettings.js +5 -16
  13. package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -1
  14. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
  15. package/lib/components/SettingDrawer/LayoutChange.js +11 -43
  16. package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
  17. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
  18. package/lib/components/SettingDrawer/NavigationsModes.js +8 -47
  19. package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
  20. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
  21. package/lib/components/SettingDrawer/RegionalSettings.js +29 -50
  22. package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
  23. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  24. package/lib/components/SettingDrawer/SettingDrawer.js +88 -99
  25. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  26. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
  27. package/lib/components/SettingDrawer/ThemeColor.js +3 -17
  28. package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
  29. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  30. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +15 -5
  31. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  32. package/lib/machines/settingsMachine.d.ts +7 -2
  33. package/lib/machines/settingsMachine.d.ts.map +1 -1
  34. package/lib/machines/settingsMachine.js +141 -122
  35. package/lib/machines/settingsMachine.js.map +1 -1
  36. package/lib/machines/settingsMachine.test.d.ts +2 -0
  37. package/lib/machines/settingsMachine.test.d.ts.map +1 -0
  38. package/lib/machines/types.d.ts +7 -8
  39. package/lib/machines/types.d.ts.map +1 -1
  40. package/lib/utils/configOverrides.js +1 -265
  41. package/lib/utils/configOverrides.js.map +1 -1
  42. package/lib/utils/settingsUtils.d.ts +13 -63
  43. package/lib/utils/settingsUtils.d.ts.map +1 -1
  44. package/lib/utils/settingsUtils.js +74 -0
  45. package/lib/utils/settingsUtils.js.map +1 -0
  46. package/package.json +5 -5
@@ -72,70 +72,6 @@
72
72
  * parseMultipleBracketIdentifiers("[/dashboard.mobile]") // Backward compatibility
73
73
  * // Returns: ['/dashboard', 'mobile']
74
74
  */
75
- function parseMultipleBracketIdentifiers(overrideKey) {
76
- const identifiers = [];
77
- // Match all bracket pairs: [something]
78
- const bracketMatches = overrideKey.match(/\[([^\]]+)\]/g);
79
- if (!bracketMatches) {
80
- return identifiers;
81
- }
82
- // If there's only one bracket, check if it contains a dot (old format)
83
- if (bracketMatches.length === 1) {
84
- const content = bracketMatches[0].slice(1, -1); // Remove brackets
85
- // Check if it's the old format with dot notation
86
- if (content.includes('.')) {
87
- const parts = content.split('.');
88
- // Handle [.device] pattern
89
- if (parts[0] === '' && parts[1]) {
90
- identifiers.push(parts[1]);
91
- }
92
- // Handle [route.device] pattern
93
- else {
94
- parts.forEach(part => {
95
- if (part) identifiers.push(part);
96
- });
97
- }
98
- } else {
99
- // Single identifier without dot
100
- identifiers.push(content);
101
- }
102
- } else {
103
- // Multiple brackets: extract content from each
104
- bracketMatches.forEach(match => {
105
- const content = match.slice(1, -1); // Remove brackets
106
- if (content) {
107
- identifiers.push(content);
108
- }
109
- });
110
- }
111
- return identifiers;
112
- }
113
- /**
114
- * Convert a dot-notation path to a nested object
115
- * @example
116
- * setNestedValue({}, 'uilayout.regions.header.showLogo', false)
117
- * // Returns: { uilayout: { regions: { header: { showLogo: false } } } }
118
- */
119
- function setNestedValue(obj, path, value) {
120
- const keys = path.split('.');
121
- const result = {
122
- ...obj
123
- };
124
- let current = result;
125
- for (let i = 0; i < keys.length - 1; i++) {
126
- const key = keys[i];
127
- if (!current[key] || typeof current[key] !== 'object') {
128
- current[key] = {};
129
- } else {
130
- current[key] = {
131
- ...current[key]
132
- };
133
- }
134
- current = current[key];
135
- }
136
- current[keys[keys.length - 1]] = value;
137
- return result;
138
- }
139
75
  /**
140
76
  * Get a value from a nested object using dot notation
141
77
  * @example
@@ -152,204 +88,4 @@ function getNestedValue(obj, path, defaultValue) {
152
88
  current = current[key];
153
89
  }
154
90
  return current !== undefined ? current : defaultValue;
155
- }
156
- /**
157
- * Build an override context key from context
158
- *
159
- * Format: [route][device] or [route] or [device]
160
- *
161
- * @example
162
- * buildOverrideKey({ route: '/dashboard', device: 'mobile' })
163
- * // Returns: "[/dashboard][mobile]"
164
- *
165
- * buildOverrideKey({ route: '/dashboard' })
166
- * // Returns: "[/dashboard]"
167
- *
168
- * buildOverrideKey({ device: 'mobile' })
169
- * // Returns: "[mobile]"
170
- */
171
- function buildOverrideKey(context) {
172
- const {
173
- route,
174
- device,
175
- ...rest
176
- } = context;
177
- // Handle route and device specifically - use multiple bracket format
178
- if (route && device) {
179
- return `[${route}][${device}]`;
180
- } else if (route) {
181
- return `[${route}]`;
182
- } else if (device) {
183
- return `[${device}]`;
184
- }
185
- // Fallback for other context keys (future extensibility)
186
- const parts = [];
187
- for (const [key, value] of Object.entries(rest)) {
188
- if (value !== undefined && value !== null) {
189
- parts.push(`${key}=${value}`);
190
- }
191
- }
192
- if (parts.length > 0) {
193
- return `[${parts.join(',')}]`;
194
- }
195
- return '';
196
- }
197
- /**
198
- * Parse an override key into its components
199
- * Supports both new multiple bracket format and legacy dot notation
200
- *
201
- * @example
202
- * parseOverrideKey("[/dashboard][mobile]") // New format
203
- * // Returns: { route: '/dashboard', device: 'mobile' }
204
- *
205
- * parseOverrideKey("[/dashboard.mobile]") // Legacy format
206
- * // Returns: { route: '/dashboard', device: 'mobile' }
207
- *
208
- * parseOverrideKey("[/dashboard]")
209
- * // Returns: { route: '/dashboard' }
210
- *
211
- * parseOverrideKey("[mobile]")
212
- * // Returns: { device: 'mobile' }
213
- *
214
- * parseOverrideKey("[.mobile]") // Legacy device-only format
215
- * // Returns: { device: 'mobile' }
216
- */
217
- function parseOverrideKey(overrideKey) {
218
- const context = {};
219
- // First try multiple bracket pattern: [/route][device]
220
- const multipleBracketMatch = overrideKey.match(/^(\[[^\]]+\])+$/);
221
- if (multipleBracketMatch) {
222
- const identifiers = parseMultipleBracketIdentifiers(overrideKey);
223
- identifiers.forEach(identifier => {
224
- if (identifier.startsWith('/')) {
225
- context.route = identifier;
226
- } else if (identifier === 'mobile' || identifier === 'desktop') {
227
- context.device = identifier;
228
- }
229
- });
230
- return context;
231
- }
232
- // Fallback to legacy single bracket pattern: [route.device] or [route] or [.device]
233
- const match = overrideKey.match(/^\[([^\]]+)\]$/);
234
- if (!match) {
235
- return context;
236
- }
237
- const content = match[1];
238
- // Check if it contains a dot
239
- if (content.includes('.')) {
240
- const parts = content.split('.');
241
- // Handle [.device] pattern
242
- if (parts[0] === '') {
243
- context.device = parts[1];
244
- }
245
- // Handle [route.device] pattern
246
- else {
247
- context.route = parts[0];
248
- if (parts[1]) {
249
- context.device = parts[1];
250
- }
251
- }
252
- } else {
253
- // Handle [route] pattern (no dot means route only)
254
- context.route = content;
255
- }
256
- return context;
257
- }
258
- /**
259
- * Get a configuration value with override support
260
- *
261
- * Priority:
262
- * 1. Most specific override (all context matches)
263
- * 2. Partial overrides (some context matches)
264
- * 3. Base configuration value
265
- * 4. Default value
266
- *
267
- * Works with nested storage where overrides are stored as:
268
- * { "[route=/dashboard][device=mobile]": { uilayout: { regions: { header: { showLogo: false } } } } }
269
- */
270
- function getConfigValue(settings, configKey, context, defaultValue) {
271
- // Build the context key
272
- const contextKey = buildOverrideKey(context);
273
- // Check for exact override in nested structure
274
- if (contextKey && settings?.[contextKey]) {
275
- const overrideValue = getNestedValue(settings[contextKey], `uilayout.${configKey}`);
276
- if (overrideValue !== undefined) {
277
- return overrideValue;
278
- }
279
- }
280
- // Check for partial overrides with priority:
281
- // 1. [route.device] (most specific)
282
- // 2. [route] (route only)
283
- // 3. [.device] (device only)
284
- if (settings) {
285
- const partialMatches = [];
286
- for (const key of Object.keys(settings)) {
287
- // Only check keys that look like context keys (start with '[')
288
- if (!key.startsWith('[')) continue;
289
- const parsed = parseOverrideKey(key);
290
- // Check if this override matches current context
291
- let matches = true;
292
- let specificity = 0;
293
- if (parsed.route !== undefined) {
294
- if (parsed.route === context.route) {
295
- specificity += 2; // Route match is worth 2 points
296
- } else {
297
- matches = false;
298
- }
299
- }
300
- if (parsed.device !== undefined) {
301
- if (parsed.device === context.device) {
302
- specificity += 1; // Device match is worth 1 point
303
- } else {
304
- matches = false;
305
- }
306
- }
307
- if (matches && specificity > 0) {
308
- partialMatches.push({
309
- key,
310
- specificity
311
- });
312
- }
313
- }
314
- // Use the most specific override
315
- if (partialMatches.length > 0) {
316
- const mostSpecific = partialMatches.reduce((a, b) => a.specificity > b.specificity ? a : b);
317
- const overrideValue = getNestedValue(settings[mostSpecific.key], `uilayout.${configKey}`);
318
- if (overrideValue !== undefined) {
319
- return overrideValue;
320
- }
321
- }
322
- }
323
- // Check base configuration
324
- const baseValue = getNestedValue(settings, `uilayout.${configKey}`);
325
- if (baseValue !== undefined) {
326
- return baseValue;
327
- }
328
- return defaultValue;
329
- }
330
- /**
331
- * Set a configuration value as an override
332
- *
333
- * Returns the context key and nested value structure.
334
- * The service layer will merge this into the settings object.
335
- *
336
- * @example
337
- * const result = setConfigOverride('regions.header.showLogo', false, { route: '/dashboard', device: 'mobile' });
338
- * // Returns: {
339
- * // contextKey: '[device=mobile][route=/dashboard]',
340
- * // path: 'uilayout.regions.header.showLogo',
341
- * // value: false,
342
- * // nestedValue: { uilayout: { regions: { header: { showLogo: false } } } }
343
- * // }
344
- */
345
- function setConfigOverride(configKey, value, context) {
346
- const contextKey = buildOverrideKey(context);
347
- const path = `uilayout.${configKey}`;
348
- const nestedValue = setNestedValue({}, path, value);
349
- return {
350
- contextKey,
351
- path,
352
- value,
353
- nestedValue
354
- };
355
- }export{buildOverrideKey,getConfigValue,getNestedValue,parseMultipleBracketIdentifiers,parseOverrideKey,setConfigOverride,setNestedValue};//# sourceMappingURL=configOverrides.js.map
91
+ }export{getNestedValue};//# sourceMappingURL=configOverrides.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configOverrides.js","sources":["../../src/utils/configOverrides.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DG;AAUH;;;;;;;;;;;;;AAaG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;QAC/D,WAAM,GAAW,EAAa;;QAG9B,cAAM,cAAiB,CAAA,qBAAkB,CAAA;MAEzC,CAAA,cAAK,EAAc;AACf,IAAA,OAAA;;;AAIJ,EAAA,IAAA,qBAAmB,KAAM,CAAA,EAAM;AAC3B,IAAA,MAAA,wBAAgB,CAAA,CAAA,CAAA,CAAc,KAAI,CAAA,CAAA,EAAK,EAAE,EAAE;;AAG3C,IAAA,IAAA,gBAAY,CAAA,GAAQ,CAAC,EAAA;YACjB,KAAA,GAAM,OAAQ,CAAA,KAAO,CAAC;;AAGtB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A;;;SAII,iBAAU,CAAA,SAAA,EAAA,KAAA,EAAA,OAAA,EAAA;QACV,UAAI,GAAA,gBAAA,CAAA,OAAA,CAAA;QACJ,IAAA,GAAK,CAAA,SAAA,EAAA,SAAA,CAAA,CAAA;QACL,WAAW,GAAA,cAAA,CAAA,EAAA,EAAA,IAAA,EAAA,KAAA,CAAA;SACb;AACN,IAAC,UAAA;AAED,IAAA,IAAA;;;AAGG,GAAA;AACH"}
1
+ {"version":3,"file":"configOverrides.js","sources":["../../src/utils/configOverrides.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DG;AAUH;;;;;;;;;;;;;AAaG;;AA6JA;AACH;;;AAII;AACI,SAAI,cAAgB,CAAA,GAAI,EAAA,IAAO,EAAA,YAAc,EAAA;AACzC,EAAA,MAAA,IAAA,GAAA,IAAO;aACV,GAAA,GAAA;AACD,EAAA,KAAA,MAAA,GAAO,IAAG,IAAA,EAAQ;IACtB,IAAC,OAAA,KAAA,IAAA,IAAA,OAAA,KAAA,SAAA,IAAA,OAAA,OAAA,KAAA,QAAA,EAAA;MAED,OAAO,YAAY;AACvB,IAAC;AAED,IAAA,OAAA,GAAA,OAAA,CAAA,GAAA,CAAA;;AAEG,EAAA,OAAA,OAAA,KAAA,SAAA,GAAA,OAAA,GAAA,YAAA;AACH"}
@@ -1,70 +1,20 @@
1
1
  /**
2
- * Utility functions for handling settings with the new uilayout structure
3
- * No more routeSettings, regions, or layout nested structures
4
- */
5
- export interface SettingsMergeResult {
6
- deviceSettings: any;
7
- layoutSettings: any;
8
- }
9
- /**
10
- * Helper function to get value from uilayout with route/device override support
11
- * @param path - Dot-notation path to the setting (e.g., 'header.showLogo')
12
- * @param settings - Main settings object
13
- * @param currentRoute - Current route path
14
- * @param deviceType - Device type (mobile/desktop)
15
- * @returns The setting value
16
- */
17
- export declare const getUILayoutValue: (path: string, settings: any, currentRoute: string, deviceType: string) => any;
18
- /**
19
- * Builds device settings from uilayout
20
- * @param settings - Main settings object
21
- * @param currentRoute - Current route path
22
- * @param deviceType - Device type (mobile/desktop)
23
- * @returns Device settings object
24
- */
25
- export declare const buildDeviceSettings: (settings: any, currentRoute: string, deviceType: string) => {
26
- header: any;
27
- background: any;
28
- footer: any;
29
- };
30
- /**
31
- * Builds layout settings from uilayout
32
- * @param settings - Main settings object
2
+ * Get a setting value based on applyToAllRoutes flag and current route/device context
3
+ * @param machineSettings - The settings object from XState machine
4
+ * @param settingName - The setting key to retrieve (e.g., 'fixedHeader', 'organization.members.invitations')
5
+ * @param applyToAllRoutes - Whether to use global or route-specific overrides
33
6
  * @param currentRoute - Current route path
34
- * @param deviceType - Device type (mobile/desktop)
35
- * @returns Layout settings object
7
+ * @param deviceType - Current device type ('desktop' or 'mobile')
8
+ * @param defaultValue - Default value if setting not found
9
+ * @returns The setting value from the appropriate scope
36
10
  */
37
- export declare const buildLayoutSettings: (settings: any, currentRoute: string, deviceType: string) => {
38
- contentWidth: any;
39
- navigationMode: any;
40
- sideMenuType: any;
41
- fixedHeader: any;
42
- fixedSidebar: any;
43
- splitMenus: any;
44
- upperMenuDividerName: any;
45
- middleMenuDividerName: any;
46
- lowerMenuDividerName: any;
47
- };
11
+ export declare const getSettingValue: (machineSettings: any, settingName: string, applyToAllRoutes: boolean, currentRoute: string, deviceType: "desktop" | "mobile", defaultValue?: any) => any;
48
12
  /**
49
- * Merges uiSettings overrides with uilayout settings
13
+ * Calculate the default value for applyToAllRoutes based on what overrides exist
14
+ * @param settings - The full settings object with ConfigurationModel
50
15
  * @param currentRoute - Current route path
51
- * @param deviceType - Device type (mobile/desktop)
52
- * @param settings - Main settings object
53
- * @param fallbackDeviceSettings - Fallback device settings (unused, for backward compatibility)
54
- * @param fallbackLayoutSettings - Fallback layout settings (unused, for backward compatibility)
55
- * @returns Merged device and layout settings
56
- */
57
- export declare const mergeSettingsWithUIOverrides: (currentRoute: string, deviceType: string, settings: any, fallbackDeviceSettings?: any, fallbackLayoutSettings?: any) => SettingsMergeResult;
58
- /**
59
- * @deprecated No longer using routeSettings structure. Use buildDeviceSettings/buildLayoutSettings instead.
60
- */
61
- export declare const getRouteSettings: (currentRoute: string, settings: any) => any;
62
- /**
63
- * @deprecated No longer using regions structure. Use buildDeviceSettings instead.
64
- */
65
- export declare const getDeviceSettingsFromRoute: (routeSettings: any, deviceType: string) => {};
66
- /**
67
- * @deprecated No longer using layout nested structure. Use buildLayoutSettings instead.
16
+ * @param deviceType - Current device type ('desktop' or 'mobile')
17
+ * @returns The default value for applyToAllRoutes
68
18
  */
69
- export declare const getLayoutSettingsFromRoute: (routeSettings: any, deviceType: string) => {};
19
+ export declare const getDefaultApplyToAllRoutes: (settings: any, currentRoute: string, deviceType: "desktop" | "mobile") => boolean;
70
20
  //# sourceMappingURL=settingsUtils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"settingsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/settingsUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,mBAAmB;IAChC,cAAc,EAAE,GAAG,CAAC;IACpB,cAAc,EAAE,GAAG,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,EAAE,UAAU,GAAG,EAAE,cAAc,MAAM,EAAE,YAAY,MAAM,QAYrG,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,GAAG,EAAE,cAAc,MAAM,EAAE,YAAY,MAAM;;;;CAM1F,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,UAAU,GAAG,EAAE,cAAc,MAAM,EAAE,YAAY,MAAM;;;;;;;;;;CAY1F,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,4BAA4B,GACrC,cAAc,MAAM,EACpB,YAAY,MAAM,EAClB,UAAU,GAAG,EACb,yBAAyB,GAAG,EAC5B,yBAAyB,GAAG,KAC7B,mBAKF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,cAAc,MAAM,EAAE,UAAU,GAAG,QAEnE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,eAAe,GAAG,EAAE,YAAY,MAAM,OAEhF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,GAAI,eAAe,GAAG,EAAE,YAAY,MAAM,OAEhF,CAAC"}
1
+ {"version":3,"file":"settingsUtils.d.ts","sourceRoot":"","sources":["../../src/utils/settingsUtils.ts"],"names":[],"mappings":"AAEA;;;;;;;;;GASG;AACH,eAAO,MAAM,eAAe,GACxB,iBAAiB,GAAG,EACpB,aAAa,MAAM,EACnB,kBAAkB,OAAO,EACzB,cAAc,MAAM,EACpB,YAAY,SAAS,GAAG,QAAQ,EAChC,eAAe,GAAG,QAwCrB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACnC,UAAU,GAAG,EACb,cAAc,MAAM,EACpB,YAAY,SAAS,GAAG,QAAQ,KACjC,OA2BF,CAAC"}
@@ -0,0 +1,74 @@
1
+ import {getNestedValue}from'./configOverrides.js';/**
2
+ * Get a setting value based on applyToAllRoutes flag and current route/device context
3
+ * @param machineSettings - The settings object from XState machine
4
+ * @param settingName - The setting key to retrieve (e.g., 'fixedHeader', 'organization.members.invitations')
5
+ * @param applyToAllRoutes - Whether to use global or route-specific overrides
6
+ * @param currentRoute - Current route path
7
+ * @param deviceType - Current device type ('desktop' or 'mobile')
8
+ * @param defaultValue - Default value if setting not found
9
+ * @returns The setting value from the appropriate scope
10
+ */
11
+ const getSettingValue = (machineSettings, settingName, applyToAllRoutes, currentRoute, deviceType, defaultValue) => {
12
+ if (!machineSettings) {
13
+ return defaultValue;
14
+ }
15
+ // Try to get from changedSettings first (most recent updates)
16
+ const changedSettings = machineSettings?.changedSettings || {};
17
+ const configModel = machineSettings?.configModel;
18
+ if (applyToAllRoutes) {
19
+ // Global mode: look for [device].settingName in changedSettings
20
+ const globalKey = `[${deviceType}].${settingName}`;
21
+ if (changedSettings[globalKey] !== undefined) {
22
+ return changedSettings[globalKey];
23
+ }
24
+ // Apply device-only override to get global settings
25
+ if (configModel) {
26
+ const deviceKey = `[${deviceType}]`;
27
+ const globalOverride = configModel.override(deviceKey);
28
+ const value = getNestedValue(globalOverride?.contents || configModel.contents, settingName);
29
+ if (value !== undefined) {
30
+ console.log(` → Returning from configModel override:`, value);
31
+ return value;
32
+ }
33
+ }
34
+ return defaultValue;
35
+ } else {
36
+ // Route-specific mode: look for [route][device].settingName in changedSettings
37
+ const routeKey = `[${currentRoute}][${deviceType}].${settingName}`;
38
+ if (changedSettings[routeKey] !== undefined) {
39
+ return changedSettings[routeKey];
40
+ }
41
+ // Fall back to context value (which has route-specific overrides already applied)
42
+ const value = getNestedValue(machineSettings, settingName);
43
+ return value !== undefined ? value : defaultValue;
44
+ }
45
+ };
46
+ /**
47
+ * Calculate the default value for applyToAllRoutes based on what overrides exist
48
+ * @param settings - The full settings object with ConfigurationModel
49
+ * @param currentRoute - Current route path
50
+ * @param deviceType - Current device type ('desktop' or 'mobile')
51
+ * @returns The default value for applyToAllRoutes
52
+ */
53
+ const getDefaultApplyToAllRoutes = (settings, currentRoute, deviceType) => {
54
+ const configModel = settings?.configModel;
55
+ if (!configModel) {
56
+ return false; // Default to route-specific if no configModel
57
+ }
58
+ const routeDeviceKey = `[${currentRoute}][${deviceType}]`;
59
+ const deviceKey = `[${deviceType}]`;
60
+ // Check if route-specific override exists by looking at the overrides array
61
+ const hasRouteOverride = configModel.overrides?.some(override => override.identifiers?.includes(routeDeviceKey));
62
+ // Check if global override exists by looking at the overrides array
63
+ const hasGlobalOverride = configModel.overrides?.some(override => override.identifiers?.includes(deviceKey));
64
+ // If route has its own override, use route-specific (applyToAllRoutes = false)
65
+ if (hasRouteOverride) {
66
+ return false;
67
+ }
68
+ // If no route override but global override exists, use global (applyToAllRoutes = true)
69
+ if (hasGlobalOverride) {
70
+ return true;
71
+ }
72
+ // No route or global override, default to route-specific (applyToAllRoutes = false)
73
+ return false;
74
+ };export{getDefaultApplyToAllRoutes,getSettingValue};//# sourceMappingURL=settingsUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsUtils.js","sources":["../../src/utils/settingsUtils.ts"],"sourcesContent":[null],"names":[],"mappings":"kDAEA;;;;;;;;;AASG;AACI,MAAM,eAAe,GAAG,CAC3B,eAAoB,EACpB,WAAmB,EACnB,gBAAyB,EACzB,YAAoB,EACpB,UAAgC,EAChC,YAAkB,KAClB;MACA,CAAA,eAAK,EAAe;AAChB,IAAA,OAAA;;;AAIJ,EAAA,MAAA,kBAAqB,eAAG,EAAe,eAAE,IAAe,EAAI;AAC5D,EAAA,MAAA,WAAM,GAAW,eAAG,EAAe;MAEnC,gBAAI,EAAgB;;AAEhB,IAAA,MAAA,aAAe,CAAA,EAAG,eAAc,WAAK,CAAA,CAAA;AAErC,IAAA,IAAA,yBAAoB,CAAA,KAAU,SAAK,EAAA;AAC/B,MAAA,OAAA,eAAO,CAAA,SAAgB,CAAA;;;QAI3B,WAAI,EAAA;AACA,MAAA,MAAA,SAAM,GAAA,CAAA,CAAA,EAAS,UAAO,CAAA,CAAA,CAAA;YACtB,cAAM,GAAA,WAAiB,CAAA,kBAAqB,CAAA;AAC5C,MAAA,MAAA,KAAA,GAAM,cAAQ,CAAA,wBAA+B,IAAA,WAAY,CAAA,QAAY,EAAA,WAAU,CAAA;AAC/E,MAAA,IAAA,KAAA,KAAI,SAAU,EAAA;AACV,QAAA,OAAA,CAAA,GAAA,CAAA,CAAA,iDAAsD;AACtD,QAAA,OAAA,KAAA;;;AAGR,IAAA,OAAA;SACH;;UACG,QAAA,GAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,EAAA,UAAA,CAAA,EAAA,EAAA,WAAA,CAAA,CAAA;QACA,wBAAqB,CAAA,KAAA,SAAiB,EAAA;AACtC,MAAA,sBAAoB,CAAA,QAAS,CAAA;AACzB,IAAA;;UAGJ,KAAA,GAAA,cAAA,CAAA,eAAA,EAAA,WAAA,CAAA;WACA,KAAM,cAAQ,GAAA,oBAA8B;;;AAGpD;AAEA;;;;;;AAMG,MAAA,0BAAA,GAAA,CAAA,QAAA,EAAA,YAAA,EAAA,UAAA,KAAA;AACH,EAAA,MAAO,WAAM,GAAA,QAAA,EAAA,WACT;AAIA,EAAA,IAAA,CAAA,WAAM,EAAA;IACN,OAAK,KAAA,CAAA;;QAEJ,cAAA,GAAA,CAAA,CAAA,EAAA,YAAA,CAAA,EAAA,EAAA,UAAA,CAAA,CAAA,CAAA;AAED,EAAA,MAAA,gBAAoB;AACpB;QAEA,gBAAA,GAAA,WAAA,CAAA,SAAA,EAAA,IAAA,CAAA,QAAA,IAAA,QAAA,CAAA,WAA4E,EAAA,QAAA,CAAA,cAAA,CAAA,CAAA;;QAG5E,iBAAA,GAAA,WAAA,CAAA,SAAA,EAAA,IAAA,CAAA,QAAA,IAAA,QAAoE,CAAA,WAAA,EAAA,QAAA,CAAA,SAAA,CAAA,CAAA;;MAGpE,gBAAA,EAAA;IACA,OAAI,KAAA;AACA,EAAA;;MAGJ,iBAAA,EAAA;IACA,OAAI,IAAA;AACA,EAAA;;SAGJ,KAAA;AACA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/tailwind-design-pro",
3
- "version": "12.0.16-alpha.54",
3
+ "version": "12.0.16-alpha.56",
4
4
  "description": "Sample core for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "@admin-layout/assets": "12.0.16-alpha.36",
25
- "@admin-layout/client": "12.0.16-alpha.54",
26
- "@admin-layout/tailwind-ui": "12.0.16-alpha.54",
25
+ "@admin-layout/client": "12.0.16-alpha.56",
26
+ "@admin-layout/tailwind-ui": "12.0.16-alpha.56",
27
27
  "react-favicon": "^0.0.23",
28
28
  "react-intl": "^6.1.1",
29
29
  "react-responsive": "^10.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@adminide-stack/extension-api": "^12.0.4-alpha.298",
32
+ "@adminide-stack/extension-api": "^12.0.4-alpha.311",
33
33
  "@tailwindcss/aspect-ratio": "^0.4.2",
34
34
  "@tailwindcss/forms": "^0.5.4",
35
35
  "@tailwindcss/typography": "^0.5.9",
@@ -53,5 +53,5 @@
53
53
  "typescript": {
54
54
  "definition": "lib/index.d.ts"
55
55
  },
56
- "gitHead": "a009e644fb9ee783d87c64481421affe38fb6fae"
56
+ "gitHead": "9d608c873fdf63cf3ffd982a8304ecbcad0b92f8"
57
57
  }