@admin-layout/client 11.0.4-alpha.4 → 11.2.1-alpha.1

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 (200) 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 +2 -0
  5. package/lib/__tests__/SettingsConfigurationModel.test.d.ts.map +1 -0
  6. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts +3 -0
  7. package/lib/__tests__/__fixtures__/defaultSettingsExample.d.ts.map +1 -0
  8. package/lib/{antd-themes/colors.d.ts → colors/colorsList.d.ts} +1 -1
  9. package/lib/colors/colorsList.d.ts.map +1 -0
  10. package/lib/{antd-themes/colors.js → colors/colorsList.js} +1 -1
  11. package/lib/colors/colorsList.js.map +1 -0
  12. package/lib/colors/index.d.ts +1 -0
  13. package/lib/colors/index.d.ts.map +1 -1
  14. package/lib/colors/presets/black.js.map +1 -1
  15. package/lib/colors/presets/brinkPink.js +11 -0
  16. package/lib/colors/presets/brinkPink.js.map +1 -0
  17. package/lib/colors/presets/cyan.js +11 -0
  18. package/lib/colors/presets/cyan.js.map +1 -0
  19. package/lib/colors/presets/lime.js +11 -0
  20. package/lib/colors/presets/lime.js.map +1 -0
  21. package/lib/colors/presets/pink.js +11 -0
  22. package/lib/colors/presets/pink.js.map +1 -0
  23. package/lib/colors/presets/purple.js +11 -0
  24. package/lib/colors/presets/purple.js.map +1 -0
  25. package/lib/colors/presets/skyBlue.js +11 -0
  26. package/lib/colors/presets/skyBlue.js.map +1 -0
  27. package/lib/colors/presets/turquoise.js +11 -0
  28. package/lib/colors/presets/turquoise.js.map +1 -0
  29. package/lib/colors/presets/white.js.map +1 -1
  30. package/lib/components/ApplicationErrorFillWrapper.d.ts +2 -1
  31. package/lib/components/ApplicationErrorFillWrapper.d.ts.map +1 -1
  32. package/lib/components/ApplicationErrorFillWrapper.js +2 -2
  33. package/lib/components/ApplicationErrorHandlerCommon.d.ts.map +1 -1
  34. package/lib/components/ApplicationErrorHandlerCommon.js +8 -6
  35. package/lib/components/ApplicationErrorHandlerCommon.js.map +1 -1
  36. package/lib/components/ErrorBoundaryCommon.d.ts +1 -1
  37. package/lib/components/ErrorBoundaryCommon.js +2 -2
  38. package/lib/components/ErrorBoundaryCommon.js.map +1 -1
  39. package/lib/components/LayoutCookieProvider.d.ts.map +1 -1
  40. package/lib/components/LayoutCookieProvider.js +16 -10
  41. package/lib/components/LayoutCookieProvider.js.map +1 -1
  42. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts +69 -0
  43. package/lib/components/UpdateSettings/UpdateSettings.server.d.ts.map +1 -0
  44. package/lib/components/UpdateSettings/UpdateSettings.server.js +218 -30
  45. package/lib/components/UpdateSettings/UpdateSettings.server.js.map +1 -1
  46. package/lib/components/UpdateSettings/UpdateSettings.server.test.d.ts +2 -0
  47. package/lib/components/UpdateSettings/UpdateSettings.server.test.d.ts.map +1 -0
  48. package/lib/config/defaultSettings.d.ts +184 -2
  49. package/lib/config/defaultSettings.d.ts.map +1 -1
  50. package/lib/config/defaultSettings.js +67 -32
  51. package/lib/config/defaultSettings.js.map +1 -1
  52. package/lib/config/env-config.d.ts +3 -5
  53. package/lib/config/env-config.d.ts.map +1 -1
  54. package/lib/config/env-config.js +13 -13
  55. package/lib/config/env-config.js.map +1 -1
  56. package/lib/constants/constants.js.map +1 -1
  57. package/lib/constants/error.js.map +1 -1
  58. package/lib/constants/languages.js.map +1 -1
  59. package/lib/constants/layout.js.map +1 -1
  60. package/lib/graphql/link/error-link.d.ts.map +1 -1
  61. package/lib/graphql/link/error-link.js.map +1 -1
  62. package/lib/hooks/Client-only.d.ts +28 -0
  63. package/lib/hooks/Client-only.d.ts.map +1 -0
  64. package/lib/hooks/Client-only.js +18 -0
  65. package/lib/hooks/Client-only.js.map +1 -0
  66. package/lib/hooks/hooks.d.ts +4 -0
  67. package/lib/hooks/hooks.d.ts.map +1 -0
  68. package/lib/hooks/index.d.ts +1 -0
  69. package/lib/hooks/index.d.ts.map +1 -1
  70. package/lib/hooks/use-hydrated.d.ts +19 -0
  71. package/lib/hooks/use-hydrated.d.ts.map +1 -0
  72. package/lib/hooks/use-hydrated.js +24 -0
  73. package/lib/hooks/use-hydrated.js.map +1 -0
  74. package/lib/hooks/useLayoutSettings.d.ts +3 -2
  75. package/lib/hooks/useLayoutSettings.d.ts.map +1 -1
  76. package/lib/hooks/useLayoutSettings.js +70 -44
  77. package/lib/hooks/useLayoutSettings.js.map +1 -1
  78. package/lib/hooks/useLayoutSettings.test.d.ts +2 -0
  79. package/lib/hooks/useLayoutSettings.test.d.ts.map +1 -0
  80. package/lib/index.d.ts +1 -1
  81. package/lib/index.d.ts.map +1 -1
  82. package/lib/index.js +1 -1
  83. package/lib/index.native.js +1 -1
  84. package/lib/interfaces/default-settings.d.ts +1 -0
  85. package/lib/interfaces/default-settings.d.ts.map +1 -1
  86. package/lib/interfaces/index.d.ts +2 -0
  87. package/lib/interfaces/index.d.ts.map +1 -1
  88. package/lib/interfaces/pure-settings.d.ts +17 -1
  89. package/lib/interfaces/pure-settings.d.ts.map +1 -1
  90. package/lib/interfaces/searchbar-settings.d.ts +61 -0
  91. package/lib/interfaces/searchbar-settings.d.ts.map +1 -0
  92. package/lib/interfaces/settings.d.ts +167 -0
  93. package/lib/interfaces/settings.d.ts.map +1 -0
  94. package/lib/interfaces/settings.js +5 -0
  95. package/lib/interfaces/settings.js.map +1 -0
  96. package/lib/interfaces/typings.d.ts +1 -1
  97. package/lib/interfaces/typings.d.ts.map +1 -1
  98. package/lib/redux/actions/error-actions.d.ts.map +1 -1
  99. package/lib/redux/actions/error-actions.js.map +1 -1
  100. package/lib/redux/reducers/error.js.map +1 -1
  101. package/lib/redux/reducers/settings.d.ts.map +1 -1
  102. package/lib/redux/reducers/settings.js +3 -10
  103. package/lib/redux/reducers/settings.js.map +1 -1
  104. package/lib/redux/selectors/index.js.map +1 -1
  105. package/lib/redux/store.js +1 -1
  106. package/lib/redux/store.js.map +1 -1
  107. package/lib/themes/systemFont/index.js.map +1 -1
  108. package/lib/themes/templates/createLayoutTheme.js.map +1 -1
  109. package/lib/themes/templates/darkLayoutTheme.js.map +1 -1
  110. package/lib/themes/templates/lightLayoutTheme.js.map +1 -1
  111. package/lib/utils/assignDefaults.d.ts +10 -0
  112. package/lib/utils/assignDefaults.d.ts.map +1 -0
  113. package/lib/utils/assignDefaults.test.d.ts +1 -0
  114. package/lib/utils/assignDefaults.test.d.ts.map +1 -0
  115. package/lib/utils/generateMenuLink.d.ts.map +1 -1
  116. package/lib/utils/generateMenuLink.js +13 -1
  117. package/lib/utils/generateMenuLink.js.map +1 -1
  118. package/lib/utils/generateMenuLink.test.d.ts +2 -0
  119. package/lib/utils/generateMenuLink.test.d.ts.map +1 -0
  120. package/lib/utils/index.d.ts +1 -1
  121. package/lib/utils/index.d.ts.map +1 -1
  122. package/lib/utils/matchMenuKeys.d.ts.map +1 -1
  123. package/lib/utils/matchMenuKeys.js.map +1 -1
  124. package/lib/utils/menuUtils.d.ts.map +1 -1
  125. package/lib/utils/menuUtils.js.map +1 -1
  126. package/lib/utils/parentRoute.d.ts.map +1 -1
  127. package/lib/utils/parseEnvUiLayoutSettings.d.ts +6 -0
  128. package/lib/utils/parseEnvUiLayoutSettings.d.ts.map +1 -0
  129. package/lib/utils/parseEnvUiLayoutSettings.js +27 -0
  130. package/lib/utils/parseEnvUiLayoutSettings.js.map +1 -0
  131. package/lib/utils/parseEnvUiLayoutSettings.test.d.ts +2 -0
  132. package/lib/utils/parseEnvUiLayoutSettings.test.d.ts.map +1 -0
  133. package/lib/utils/seperatedMenus.js.map +1 -1
  134. package/lib/utils/settingsDiff.test.d.ts +2 -0
  135. package/lib/utils/settingsDiff.test.d.ts.map +1 -0
  136. package/lib/utils/settingsDifference.d.ts +6 -0
  137. package/lib/utils/settingsDifference.d.ts.map +1 -0
  138. package/lib/utils/settingsDifference.js +148 -0
  139. package/lib/utils/settingsDifference.js.map +1 -0
  140. package/lib/utils/settingsDifference.test.d.ts +2 -0
  141. package/lib/utils/settingsDifference.test.d.ts.map +1 -0
  142. package/package.json +9 -4
  143. package/lib/antd-themes/ThemeProvider.d.ts +0 -10
  144. package/lib/antd-themes/ThemeProvider.d.ts.map +0 -1
  145. package/lib/antd-themes/ThemeProvider.js +0 -34
  146. package/lib/antd-themes/ThemeProvider.js.map +0 -1
  147. package/lib/antd-themes/airbnb-dark-theme.d.ts +0 -2
  148. package/lib/antd-themes/airbnb-dark-theme.d.ts.map +0 -1
  149. package/lib/antd-themes/airbnb-dark-theme.js +0 -168
  150. package/lib/antd-themes/airbnb-dark-theme.js.map +0 -1
  151. package/lib/antd-themes/airbnb-light-theme.d.ts +0 -230
  152. package/lib/antd-themes/airbnb-light-theme.d.ts.map +0 -1
  153. package/lib/antd-themes/airbnb-light-theme.js +0 -168
  154. package/lib/antd-themes/airbnb-light-theme.js.map +0 -1
  155. package/lib/antd-themes/colors.d.ts.map +0 -1
  156. package/lib/antd-themes/colors.js.map +0 -1
  157. package/lib/antd-themes/default-dark-theme.d.ts +0 -2
  158. package/lib/antd-themes/default-dark-theme.d.ts.map +0 -1
  159. package/lib/antd-themes/default-dark-theme.js +0 -136
  160. package/lib/antd-themes/default-dark-theme.js.map +0 -1
  161. package/lib/antd-themes/default-light-theme.d.ts +0 -199
  162. package/lib/antd-themes/default-light-theme.d.ts.map +0 -1
  163. package/lib/antd-themes/default-light-theme.js +0 -136
  164. package/lib/antd-themes/default-light-theme.js.map +0 -1
  165. package/lib/antd-themes/github-dark-theme.d.ts +0 -2
  166. package/lib/antd-themes/github-dark-theme.d.ts.map +0 -1
  167. package/lib/antd-themes/github-dark-theme.js +0 -168
  168. package/lib/antd-themes/github-dark-theme.js.map +0 -1
  169. package/lib/antd-themes/github-light-theme.d.ts +0 -230
  170. package/lib/antd-themes/github-light-theme.d.ts.map +0 -1
  171. package/lib/antd-themes/github-light-theme.js +0 -168
  172. package/lib/antd-themes/github-light-theme.js.map +0 -1
  173. package/lib/antd-themes/index.d.ts +0 -14
  174. package/lib/antd-themes/index.d.ts.map +0 -1
  175. package/lib/antd-themes/slack-dark-theme.d.ts +0 -2
  176. package/lib/antd-themes/slack-dark-theme.d.ts.map +0 -1
  177. package/lib/antd-themes/slack-dark-theme.js +0 -167
  178. package/lib/antd-themes/slack-dark-theme.js.map +0 -1
  179. package/lib/antd-themes/slack-light-theme.d.ts +0 -229
  180. package/lib/antd-themes/slack-light-theme.d.ts.map +0 -1
  181. package/lib/antd-themes/slack-light-theme.js +0 -167
  182. package/lib/antd-themes/slack-light-theme.js.map +0 -1
  183. package/lib/antd-themes/spotify-dark-theme.d.ts +0 -2
  184. package/lib/antd-themes/spotify-dark-theme.d.ts.map +0 -1
  185. package/lib/antd-themes/spotify-dark-theme.js +0 -168
  186. package/lib/antd-themes/spotify-dark-theme.js.map +0 -1
  187. package/lib/antd-themes/spotify-light-theme.d.ts +0 -230
  188. package/lib/antd-themes/spotify-light-theme.d.ts.map +0 -1
  189. package/lib/antd-themes/spotify-light-theme.js +0 -168
  190. package/lib/antd-themes/spotify-light-theme.js.map +0 -1
  191. package/lib/antd-themes/themeRegistry.d.ts +0 -2
  192. package/lib/antd-themes/themeRegistry.d.ts.map +0 -1
  193. package/lib/antd-themes/themeRegistry.js +0 -12
  194. package/lib/antd-themes/themeRegistry.js.map +0 -1
  195. package/lib/components/__tests__/ApplicationErrorHandlerCommon.test.d.ts.map +0 -1
  196. package/lib/utils/getAntdLocale.d.ts +0 -3
  197. package/lib/utils/getAntdLocale.d.ts.map +0 -1
  198. package/lib/utils/getAntdLocale.js +0 -18
  199. package/lib/utils/getAntdLocale.js.map +0 -1
  200. /package/lib/{components/__tests__ → __tests__}/ApplicationErrorHandlerCommon.test.d.ts +0 -0
@@ -0,0 +1,148 @@
1
+ import {cloneDeep,isObject,isEqual,transform}from'lodash-es';/**
2
+ * Gets the deep differences between two objects
3
+ * Returns only the values that differ from obj2
4
+ */
5
+ const getDifference = (obj1, obj2) => {
6
+ // Create copies to avoid modifying the original objects
7
+ const source = cloneDeep(obj1);
8
+ const target = cloneDeep(obj2);
9
+ // If obj1 is undefined or null, return undefined to avoid adding to result
10
+ if (source === undefined || source === null) {
11
+ // Only include null/undefined if they differ from obj2
12
+ return source !== target ? source : undefined;
13
+ }
14
+ // If we're comparing different types, or if obj2 is null/undefined, return obj1
15
+ if (typeof source !== typeof target || target === undefined || target === null) {
16
+ return source;
17
+ }
18
+ // Handle non-object comparisons (primitives, functions, etc.)
19
+ // IMPORTANT: Check for string BEFORE isObject check, because strings are technically objects
20
+ if (typeof source === 'string' || typeof target === 'string') {
21
+ if (typeof source === 'string' && typeof target === 'string') {
22
+ // Case-insensitive string comparison
23
+ return source.toLowerCase() !== target.toLowerCase() ? source : undefined;
24
+ }
25
+ // If types differ, return the source value
26
+ return source;
27
+ }
28
+ if (!isObject(source) || !isObject(target)) {
29
+ return !isEqual(source, target) ? source : undefined;
30
+ }
31
+ // For arrays, do a simple equality check and return the full array if different
32
+ if (Array.isArray(source) && Array.isArray(target)) {
33
+ return !isEqual(source, target) ? source : undefined;
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
+ }
39
+ // For objects, do deep comparison
40
+ const result = transform(source, (result, value, key) => {
41
+ // Skip keys that are in source but have the exact same value in target
42
+ if (key in target && isEqual(value, target[key])) {
43
+ return;
44
+ }
45
+ // If the key doesn't exist in target, add it to the result
46
+ if (!(key in target)) {
47
+ result[key] = value;
48
+ return;
49
+ }
50
+ // For nested objects, recursively get differences
51
+ if (isObject(value) && isObject(target[key])) {
52
+ const nestedDiff = getDifference(value, target[key]);
53
+ if (nestedDiff !== undefined && (Array.isArray(nestedDiff) || Object.keys(nestedDiff).length > 0)) {
54
+ result[key] = nestedDiff;
55
+ }
56
+ return;
57
+ }
58
+ // For non-objects (primitives, etc.), only add if different
59
+ if (!isEqual(value, target[key])) {
60
+ result[key] = value;
61
+ }
62
+ });
63
+ // Return undefined if the resulting object is empty
64
+ return Object.keys(result).length > 0 ? result : undefined;
65
+ };
66
+ /**
67
+ * Compares settings objects and saves only the differences
68
+ * @returns An object containing only the differences, or an empty object on error
69
+ */
70
+ const compareAndSaveSettingsDifferences = (currentSettings, defaultSettings) => {
71
+ try {
72
+ if (!currentSettings || !defaultSettings) {
73
+ console.warn('Missing settings objects for comparison');
74
+ return {};
75
+ }
76
+ // Make deep clones to avoid modifying the original objects
77
+ const current = cloneDeep(currentSettings);
78
+ const defaults = cloneDeep(defaultSettings);
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
+ // }
114
+ // Remove empty objects from the diff
115
+ const cleanDiffSettings = removeEmptyObjects(baseSettingsDiff);
116
+ return cleanDiffSettings;
117
+ }
118
+ catch (error) {
119
+ console.error('Error comparing settings differences:', error);
120
+ return {};
121
+ }
122
+ };
123
+ /**
124
+ * Recursively removes empty objects from an object
125
+ * This helps clean up the diff payload
126
+ */
127
+ function removeEmptyObjects(obj) {
128
+ if (!isObject(obj) || Array.isArray(obj)) {
129
+ return obj;
130
+ }
131
+ const result = {};
132
+ let hasKeys = false;
133
+ Object.keys(obj).forEach((key) => {
134
+ const value = obj[key];
135
+ if (isObject(value) && !Array.isArray(value)) {
136
+ const cleanValue = removeEmptyObjects(value);
137
+ if (Object.keys(cleanValue).length > 0) {
138
+ result[key] = cleanValue;
139
+ hasKeys = true;
140
+ }
141
+ }
142
+ else if (value !== undefined) {
143
+ result[key] = value;
144
+ hasKeys = true;
145
+ }
146
+ });
147
+ return hasKeys ? result : {};
148
+ }export{compareAndSaveSettingsDifferences};//# sourceMappingURL=settingsDifference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsDifference.js","sources":["../../src/utils/settingsDifference.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAqLG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=settingsDifference.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settingsDifference.test.d.ts","sourceRoot":"","sources":["../../src/utils/settingsDifference.test.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@admin-layout/client",
3
- "version": "11.0.4-alpha.4",
3
+ "version": "11.2.1-alpha.1",
4
4
  "description": "Sample client for higher packages to depend on",
5
5
  "license": "ISC",
6
6
  "author": "CDMBase LLC",
@@ -19,14 +19,19 @@
19
19
  "test": "cross-env ENV_FILE=../../config/test/test.env jest",
20
20
  "test:debug": "npm test -- --runInBand",
21
21
  "test:watch": "npm test -- --watch",
22
+ "vitest": "cross-env ENV_FILE=../../config/test/test.env vitest",
22
23
  "watch": "yarn build:lib:watch"
23
24
  },
24
25
  "dependencies": {
25
- "@common-stack/client-core": "8.0.2-alpha.0",
26
- "common": "11.0.4-alpha.4",
27
26
  "serialize-error": "^8.0.0"
28
27
  },
28
+ "devDependencies": {
29
+ "common": "11.2.1-alpha.1",
30
+ "rc-menu": "^9.16.1"
31
+ },
29
32
  "peerDependencies": {
33
+ "@adminide-stack/core": ">=12.0.4-alpha.247",
34
+ "@common-stack/client-core": ">=7.1.1-alpha.63",
30
35
  "envalid": "*",
31
36
  "history": "*",
32
37
  "lodash-es": "^4.17.21",
@@ -39,5 +44,5 @@
39
44
  "typescript": {
40
45
  "definition": "lib/index.d.ts"
41
46
  },
42
- "gitHead": "eff06b5e432bf05a97fdd61eb30af62ad219b617"
47
+ "gitHead": "07c2534a0ba6f7955e1a718f54aa5e26b78cbacc"
43
48
  }
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import { ISettings } from '../config/defaultSettings';
3
- interface ThemeProviderProps {
4
- settings: ISettings;
5
- children: React.ReactNode;
6
- }
7
- export declare const getTheme: any;
8
- export declare const ThemeProvider: React.FC<ThemeProviderProps>;
9
- export {};
10
- //# sourceMappingURL=ThemeProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeProvider.d.ts","sourceRoot":"","sources":["../../src/antd-themes/ThemeProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,UAAU,kBAAkB;IACxB,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,eAAO,MAAM,QAAQ,EAAE,GAQtB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAgCtD,CAAC"}
@@ -1,34 +0,0 @@
1
- import {jsx}from'react/jsx-runtime';import {ConfigProvider}from'antd';import {themeRegistry}from'./themeRegistry.js';const getTheme = (themeType, themeName) => {
2
- const key = `${themeName}${themeType === 'realDark' ? 'Dark' : 'Light'}Theme`;
3
- if (key in themeRegistry) {
4
- return themeRegistry[key];
5
- }
6
- else {
7
- return themeRegistry?.defaultLightTheme;
8
- }
9
- };
10
- const ThemeProvider = ({ settings, children }) => {
11
- const { theme, themeType } = settings;
12
- const selectedTheme = getTheme(themeType, theme);
13
- const applyScopedStyles = (components) => {
14
- selectedTheme?.scopes?.forEach((scope) => {
15
- scope.scope.forEach((componentName) => {
16
- if (!components[componentName]) {
17
- components[componentName] = {};
18
- }
19
- Object.assign(components[componentName], scope.settings);
20
- });
21
- });
22
- return components;
23
- };
24
- return (jsx(ConfigProvider, { theme: {
25
- algorithm: selectedTheme?.algorithm,
26
- token: selectedTheme?.token,
27
- components: {
28
- ...applyScopedStyles(selectedTheme?.components || {}),
29
- Layout: {
30
- siderBg: settings?.themeType == 'dark' ? `${settings?.siderBgColor} !important` : null,
31
- },
32
- },
33
- }, children: children }));
34
- };export{ThemeProvider,getTheme};//# sourceMappingURL=ThemeProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ThemeProvider.js","sources":["../../src/antd-themes/ThemeProvider.tsx"],"sourcesContent":[null],"names":[],"mappings":"qHAMY,MAAA,WAAY,CAAA,SAAA,EAAA,SAAA,KAAA;AACpB,IAAA,MAAA,GAAU,GAAA,CAAA,EAAK,SAAC,CAAS,EAAC,SAAA,KAAA,UAAA,GAAA,MAAA,GAAA,OAAA,CAAA,KAAA,CAAA;AAC7B,IAAA,IAAA,GAAA,IAAA,aAAA,EAAA;AAED,QAAA,OAAO,aAAM,CAAQ,GAAE,CAAA;AAUvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,2 +0,0 @@
1
- export declare const airbnbDarkTheme: any;
2
- //# sourceMappingURL=airbnb-dark-theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"airbnb-dark-theme.d.ts","sourceRoot":"","sources":["../../src/antd-themes/airbnb-dark-theme.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,EAAE,GAsK7B,CAAC"}
@@ -1,168 +0,0 @@
1
- import {theme}from'antd';const { defaultAlgorithm, darkAlgorithm } = theme;
2
- const airbnbDarkTheme = {
3
- algorithm: darkAlgorithm,
4
- token: {
5
- colorPrimary: '#FF385C',
6
- colorBgContainer: '#121212',
7
- colorText: '#E0E0E0',
8
- colorTextSecondary: '#A0A0A0',
9
- fontFamily: 'Circular, -apple-system, BlinkMacSystemFont, Roboto, Helvetica Neue, sans-serif',
10
- borderRadius: 8,
11
- colorLink: '#00A699',
12
- colorLinkHover: '#00C2B3',
13
- colorLinkActive: '#00C2B3',
14
- },
15
- components: {
16
- Button: {
17
- // colorPrimary: '#FF385C',
18
- algorithm: true,
19
- borderRadius: 8,
20
- controlHeight: 48,
21
- controlHeightLG: 56,
22
- controlHeightSM: 40,
23
- paddingContentHorizontal: 24,
24
- },
25
- Menu: {
26
- itemBg: 'transparent',
27
- itemColor: '#E0E0E0',
28
- itemHoverColor: '#FF385C',
29
- itemSelectedColor: '#FF385C',
30
- itemSelectedBg: '#2C2C2C',
31
- itemHoverBg: '#2C2C2C',
32
- activeBarWidth: 0,
33
- activeBarHeight: 2,
34
- activeBarBorderWidth: 0,
35
- colorActiveBarColor: '#FF385C',
36
- },
37
- Typography: {
38
- fontSizeHeading1: 44,
39
- fontSizeHeading2: 32,
40
- fontSizeHeading3: 24,
41
- fontSizeHeading4: 20,
42
- fontSizeHeading5: 16,
43
- },
44
- Form: {
45
- labelColor: '#E0E0E0',
46
- colorError: '#FF5A5F',
47
- colorWarning: '#FFB400',
48
- colorSuccess: '#00A699',
49
- },
50
- Input: {
51
- controlHeight: 48,
52
- controlHeightLG: 56,
53
- controlHeightSM: 40,
54
- paddingHorizontal: 16,
55
- borderRadius: 8,
56
- },
57
- },
58
- scopes: [
59
- {
60
- scope: ['Button'],
61
- settings: {
62
- default: {
63
- background: '#2C2C2C',
64
- foreground: '#E0E0E0',
65
- border: '#4A4A4A',
66
- },
67
- primary: {
68
- background: '#FF385C',
69
- foreground: '#FFFFFF',
70
- border: '#FF385C',
71
- },
72
- hover: {
73
- background: '#E31C5F',
74
- foreground: '#FFFFFF',
75
- border: '#E31C5F',
76
- },
77
- active: {
78
- background: '#D70466',
79
- foreground: '#FFFFFF',
80
- border: '#D70466',
81
- },
82
- disabled: {
83
- background: '#2C2C2C',
84
- foreground: '#6E6E6E',
85
- border: '#4A4A4A',
86
- },
87
- },
88
- },
89
- {
90
- scope: ['Input'],
91
- settings: {
92
- default: {
93
- background: '#2C2C2C',
94
- foreground: '#E0E0E0',
95
- border: '#4A4A4A',
96
- },
97
- focus: {
98
- border: '#00A699',
99
- boxShadow: '0 0 0 1px #00A699',
100
- },
101
- hover: {
102
- border: '#A0A0A0',
103
- },
104
- disabled: {
105
- background: '#1E1E1E',
106
- foreground: '#6E6E6E',
107
- border: '#4A4A4A',
108
- },
109
- },
110
- },
111
- {
112
- scope: ['Menu'],
113
- settings: {
114
- background: '#121212',
115
- item: {
116
- default: {
117
- background: 'transparent',
118
- foreground: '#E0E0E0',
119
- },
120
- hover: {
121
- background: '#2C2C2C',
122
- foreground: '#E0E0E0',
123
- },
124
- active: {
125
- background: '#2C2C2C',
126
- foreground: '#FF385C',
127
- },
128
- },
129
- },
130
- },
131
- {
132
- scope: ['Table'],
133
- settings: {
134
- header: {
135
- background: '#2C2C2C',
136
- foreground: '#E0E0E0',
137
- },
138
- row: {
139
- odd: {
140
- background: '#121212',
141
- },
142
- even: {
143
- background: '#1E1E1E',
144
- },
145
- hover: {
146
- background: '#2C2C2C',
147
- },
148
- },
149
- },
150
- },
151
- {
152
- scope: ['Typography'],
153
- settings: {
154
- heading: {
155
- 1: { fontSize: 32, fontWeight: 800 },
156
- 2: { fontSize: 24, fontWeight: 600 },
157
- 3: { fontSize: 20, fontWeight: 600 },
158
- 4: { fontSize: 18, fontWeight: 600 },
159
- 5: { fontSize: 16, fontWeight: 600 },
160
- },
161
- text: {
162
- default: { fontSize: 16, fontWeight: 400 },
163
- secondary: { fontSize: 14, fontWeight: 400, foreground: '#A0A0A0' },
164
- },
165
- },
166
- },
167
- ],
168
- };export{airbnbDarkTheme};//# sourceMappingURL=airbnb-dark-theme.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"airbnb-dark-theme.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,230 +0,0 @@
1
- export declare const airbnbLightTheme: {
2
- algorithm: typeof import("antd/es/theme/themes/default").default;
3
- token: {
4
- colorPrimary: string;
5
- colorBgContainer: string;
6
- colorText: string;
7
- colorTextSecondary: string;
8
- fontFamily: string;
9
- borderRadius: number;
10
- colorLink: string;
11
- colorLinkHover: string;
12
- colorLinkActive: string;
13
- };
14
- components: {
15
- Button: {
16
- algorithm: boolean;
17
- borderRadius: number;
18
- controlHeight: number;
19
- controlHeightLG: number;
20
- controlHeightSM: number;
21
- paddingContentHorizontal: number;
22
- };
23
- Menu: {
24
- itemBg: string;
25
- itemColor: string;
26
- itemHoverColor: string;
27
- itemSelectedColor: string;
28
- itemSelectedBg: string;
29
- itemHoverBg: string;
30
- activeBarWidth: number;
31
- activeBarHeight: number;
32
- activeBarBorderWidth: number;
33
- colorActiveBarColor: string;
34
- };
35
- Typography: {
36
- fontSizeHeading1: number;
37
- fontSizeHeading2: number;
38
- fontSizeHeading3: number;
39
- fontSizeHeading4: number;
40
- fontSizeHeading5: number;
41
- };
42
- Form: {
43
- labelColor: string;
44
- colorError: string;
45
- colorWarning: string;
46
- colorSuccess: string;
47
- };
48
- Input: {
49
- controlHeight: number;
50
- controlHeightLG: number;
51
- controlHeightSM: number;
52
- paddingHorizontal: number;
53
- borderRadius: number;
54
- };
55
- };
56
- scopes: ({
57
- scope: string[];
58
- settings: {
59
- default: {
60
- background: string;
61
- foreground: string;
62
- border: string;
63
- };
64
- primary: {
65
- background: string;
66
- foreground: string;
67
- border: string;
68
- };
69
- hover: {
70
- background: string;
71
- foreground: string;
72
- border: string;
73
- };
74
- active: {
75
- background: string;
76
- foreground: string;
77
- border: string;
78
- };
79
- disabled: {
80
- background: string;
81
- foreground: string;
82
- border: string;
83
- };
84
- focus?: undefined;
85
- background?: undefined;
86
- item?: undefined;
87
- header?: undefined;
88
- row?: undefined;
89
- heading?: undefined;
90
- text?: undefined;
91
- };
92
- } | {
93
- scope: string[];
94
- settings: {
95
- default: {
96
- background: string;
97
- foreground: string;
98
- border: string;
99
- };
100
- focus: {
101
- border: string;
102
- boxShadow: string;
103
- };
104
- hover: {
105
- border: string;
106
- background?: undefined;
107
- foreground?: undefined;
108
- };
109
- disabled: {
110
- background: string;
111
- foreground: string;
112
- border: string;
113
- };
114
- primary?: undefined;
115
- active?: undefined;
116
- background?: undefined;
117
- item?: undefined;
118
- header?: undefined;
119
- row?: undefined;
120
- heading?: undefined;
121
- text?: undefined;
122
- };
123
- } | {
124
- scope: string[];
125
- settings: {
126
- background: string;
127
- item: {
128
- default: {
129
- background: string;
130
- foreground: string;
131
- };
132
- hover: {
133
- background: string;
134
- foreground: string;
135
- };
136
- active: {
137
- background: string;
138
- foreground: string;
139
- };
140
- };
141
- default?: undefined;
142
- primary?: undefined;
143
- hover?: undefined;
144
- active?: undefined;
145
- disabled?: undefined;
146
- focus?: undefined;
147
- header?: undefined;
148
- row?: undefined;
149
- heading?: undefined;
150
- text?: undefined;
151
- };
152
- } | {
153
- scope: string[];
154
- settings: {
155
- header: {
156
- background: string;
157
- foreground: string;
158
- };
159
- row: {
160
- odd: {
161
- background: string;
162
- };
163
- even: {
164
- background: string;
165
- };
166
- hover: {
167
- background: string;
168
- };
169
- };
170
- default?: undefined;
171
- primary?: undefined;
172
- hover?: undefined;
173
- active?: undefined;
174
- disabled?: undefined;
175
- focus?: undefined;
176
- background?: undefined;
177
- item?: undefined;
178
- heading?: undefined;
179
- text?: undefined;
180
- };
181
- } | {
182
- scope: string[];
183
- settings: {
184
- heading: {
185
- 1: {
186
- fontSize: number;
187
- fontWeight: number;
188
- };
189
- 2: {
190
- fontSize: number;
191
- fontWeight: number;
192
- };
193
- 3: {
194
- fontSize: number;
195
- fontWeight: number;
196
- };
197
- 4: {
198
- fontSize: number;
199
- fontWeight: number;
200
- };
201
- 5: {
202
- fontSize: number;
203
- fontWeight: number;
204
- };
205
- };
206
- text: {
207
- default: {
208
- fontSize: number;
209
- fontWeight: number;
210
- };
211
- secondary: {
212
- fontSize: number;
213
- fontWeight: number;
214
- foreground: string;
215
- };
216
- };
217
- default?: undefined;
218
- primary?: undefined;
219
- hover?: undefined;
220
- active?: undefined;
221
- disabled?: undefined;
222
- focus?: undefined;
223
- background?: undefined;
224
- item?: undefined;
225
- header?: undefined;
226
- row?: undefined;
227
- };
228
- })[];
229
- };
230
- //# sourceMappingURL=airbnb-light-theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"airbnb-light-theme.d.ts","sourceRoot":"","sources":["../../src/antd-themes/airbnb-light-theme.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsK5B,CAAC"}