@admin-layout/tailwind-design-pro 12.0.16-alpha.9 → 12.0.16-alpha.91

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 (260) hide show
  1. package/lib/cdm-locales/en/menu.json +2 -1
  2. package/lib/cdm-locales/es/menu.json +2 -1
  3. package/lib/cdm-locales/index.d.ts +2 -0
  4. package/lib/cdm-locales/index.d.ts.map +1 -0
  5. package/lib/cdm-locales/index.ts +1 -0
  6. package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
  7. package/lib/components/LanguageMenu/LanguageMenu.js +16 -20
  8. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  9. package/lib/components/Layout/BasicLayout/index.d.ts +6 -5
  10. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  11. package/lib/components/Layout/BasicLayout/index.js +220 -124
  12. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  13. package/lib/components/Layout/BasicLayout/utils.d.ts +2 -0
  14. package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
  15. package/lib/components/Layout/BasicLayout/utils.js +16 -13
  16. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  17. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  18. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +9 -14
  19. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  20. package/lib/components/Layout/GlobalHeader/Header.d.ts +0 -1
  21. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  22. package/lib/components/Layout/GlobalHeader/Header.js +38 -10
  23. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  24. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +0 -2
  25. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
  26. package/lib/components/Layout/GlobalHeader/MainHeader.js +54 -85
  27. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
  28. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +1 -1
  29. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  30. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
  31. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  32. package/lib/components/Layout/GlobalHeader/RightContent.js +73 -6
  33. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  34. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  35. package/lib/components/Layout/GlobalHeader/RightMenu.js +2 -4
  36. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  37. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
  38. package/lib/components/Layout/GlobalHeader/index.d.ts +0 -1
  39. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
  40. package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
  41. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  42. package/lib/components/Layout/ProTailwindLayout.js +69 -7
  43. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  44. package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
  45. package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
  46. package/lib/components/Layout/Sidebar/BottomMenu.js +330 -0
  47. package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
  48. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  49. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
  50. package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
  51. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
  52. package/lib/components/Layout/Sidebar/MainSidebar.js +246 -0
  53. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
  54. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
  55. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
  56. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +467 -0
  57. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
  58. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
  59. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
  60. package/lib/components/Layout/Sidebar/PerplexSidebar.js +279 -0
  61. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
  62. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
  63. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
  64. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +332 -0
  65. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
  66. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  67. package/lib/components/Layout/TailwindLayout.js +29 -10
  68. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  69. package/lib/components/Layout/getPageTitle.js.map +1 -1
  70. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
  71. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  72. package/lib/components/Layout/slot-fill/HeaderNotice.js +7 -0
  73. package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
  74. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
  75. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
  76. package/lib/components/Layout/slot-fill/Logo.d.ts +4 -0
  77. package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
  78. package/lib/components/Layout/slot-fill/Logo.js +7 -0
  79. package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
  80. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
  81. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +4 -0
  82. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
  83. package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
  84. package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
  85. package/lib/components/Layout/slot-fill/index.d.ts +2 -0
  86. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  87. package/lib/components/Layout/util.js +1 -1
  88. package/lib/components/Layout/util.js.map +1 -1
  89. package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -3
  90. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  91. package/lib/components/SettingDrawer/SettingDrawer.js +166 -416
  92. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  93. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +7 -0
  94. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
  95. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +30 -0
  96. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
  97. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +3 -0
  98. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
  99. package/lib/components/SettingDrawer/{CheckBoxTheme.js → components/CheckBoxTheme.js} +14 -5
  100. package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
  101. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +7 -0
  102. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
  103. package/lib/components/SettingDrawer/components/DeviceTabs.js +82 -0
  104. package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
  105. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +3 -0
  106. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
  107. package/lib/components/SettingDrawer/{InvitationSettings.js → components/InvitationSettings.js} +11 -7
  108. package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
  109. package/lib/components/SettingDrawer/components/LayoutChange.d.ts +3 -0
  110. package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
  111. package/lib/components/SettingDrawer/{LayoutChange.js → components/LayoutChange.js} +24 -17
  112. package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
  113. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +20 -0
  114. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
  115. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +119 -0
  116. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
  117. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +3 -0
  118. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
  119. package/lib/components/SettingDrawer/{NavigationsModes.js → components/NavigationsModes.js} +91 -40
  120. package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
  121. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +3 -0
  122. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
  123. package/lib/components/SettingDrawer/{RegionalSettings.js → components/RegionalSettings.js} +55 -178
  124. package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
  125. package/lib/components/SettingDrawer/components/SettingsActions.d.ts +12 -0
  126. package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
  127. package/lib/components/SettingDrawer/components/SettingsActions.js +69 -0
  128. package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
  129. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +4 -0
  130. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
  131. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +25 -0
  132. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
  133. package/lib/components/SettingDrawer/{Switch/index.d.ts → components/Switch.d.ts} +2 -2
  134. package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
  135. package/lib/components/SettingDrawer/{Switch/index.js → components/Switch.js} +1 -1
  136. package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
  137. package/lib/components/SettingDrawer/components/ThemeColor.d.ts +3 -0
  138. package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
  139. package/lib/components/SettingDrawer/{ThemeColor.js → components/ThemeColor.js} +16 -4
  140. package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
  141. package/lib/components/SettingDrawer/{ThemeSelector.d.ts → components/ThemeSelector.d.ts} +1 -1
  142. package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
  143. package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
  144. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +3 -0
  145. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
  146. package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
  147. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
  148. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
  149. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +119 -0
  150. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
  151. package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
  152. package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
  153. package/lib/components/SettingDrawer/utils/constants.js +77 -0
  154. package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
  155. package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
  156. package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
  157. package/lib/components/SettingDrawer/utils/helper.js +243 -0
  158. package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
  159. package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
  160. package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
  161. package/lib/components/SettingDrawer/utils/transformers.js +76 -0
  162. package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
  163. package/lib/components/SettingDrawer/{types.d.ts → utils/types.d.ts} +14 -0
  164. package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
  165. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +10 -5
  166. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  167. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
  168. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  169. package/lib/components/index.js +1 -1
  170. package/lib/components/typings.d.ts +20 -1
  171. package/lib/components/typings.d.ts.map +1 -1
  172. package/lib/compute.d.ts.map +1 -1
  173. package/lib/compute.js +10 -2
  174. package/lib/compute.js.map +1 -1
  175. package/lib/config/constants.js.map +1 -1
  176. package/lib/config/env-config.d.ts +3 -0
  177. package/lib/config/env-config.d.ts.map +1 -1
  178. package/lib/config/env-config.js +10 -0
  179. package/lib/config/env-config.js.map +1 -1
  180. package/lib/helpers/DynamicIcon.js.map +1 -1
  181. package/lib/hooks/useMediaQuery.js.map +1 -1
  182. package/lib/hooks/useScrollThreshold.js.map +1 -1
  183. package/lib/hooks/useTailwindTheme.js +82 -0
  184. package/lib/hooks/useTailwindTheme.js.map +1 -0
  185. package/lib/icons.d.ts +2 -0
  186. package/lib/icons.d.ts.map +1 -1
  187. package/lib/icons.js +4 -2
  188. package/lib/icons.js.map +1 -1
  189. package/lib/index.d.ts +1 -0
  190. package/lib/index.d.ts.map +1 -1
  191. package/lib/index.js +1 -1
  192. package/lib/index.js.map +1 -1
  193. package/lib/machines/selectors.d.ts +118 -0
  194. package/lib/machines/selectors.d.ts.map +1 -0
  195. package/lib/machines/settingsMachine.d.ts +25 -2
  196. package/lib/machines/settingsMachine.d.ts.map +1 -1
  197. package/lib/machines/settingsMachine.js +139 -168
  198. package/lib/machines/settingsMachine.js.map +1 -1
  199. package/lib/machines/settingsMachine.test.d.ts +2 -0
  200. package/lib/machines/settingsMachine.test.d.ts.map +1 -0
  201. package/lib/machines/types.d.ts +107 -9
  202. package/lib/machines/types.d.ts.map +1 -1
  203. package/lib/machines/types.js.map +1 -1
  204. package/lib/module.js.map +1 -1
  205. package/lib/redux/searchReducer.js.map +1 -1
  206. package/lib/routes.json +9 -1
  207. package/lib/tailwindConfig.js.map +1 -1
  208. package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
  209. package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
  210. package/lib/utils/configOverrides.d.ts +213 -0
  211. package/lib/utils/configOverrides.d.ts.map +1 -0
  212. package/lib/utils/configOverrides.js +91 -0
  213. package/lib/utils/configOverrides.js.map +1 -0
  214. package/lib/utils/isBrowser/index.js.map +1 -1
  215. package/lib/utils/settingsUtils.d.ts +20 -0
  216. package/lib/utils/settingsUtils.d.ts.map +1 -0
  217. package/lib/utils/settingsUtils.js +74 -0
  218. package/lib/utils/settingsUtils.js.map +1 -0
  219. package/lib/utils/utils/index.js.map +1 -1
  220. package/package.json +6 -6
  221. package/lib/components/Layout/GlobalHeader/Logo.d.ts +0 -4
  222. package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +0 -1
  223. package/lib/components/Layout/GlobalHeader/Logo.js +0 -141
  224. package/lib/components/Layout/GlobalHeader/Logo.js.map +0 -1
  225. package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
  226. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
  227. package/lib/components/Layout/Sidebar/Sidebar.js +0 -180
  228. package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
  229. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
  230. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
  231. package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -176
  232. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
  233. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -3
  234. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
  235. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
  236. package/lib/components/SettingDrawer/InvitationSettings.d.ts +0 -3
  237. package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +0 -1
  238. package/lib/components/SettingDrawer/InvitationSettings.js.map +0 -1
  239. package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -3
  240. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
  241. package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
  242. package/lib/components/SettingDrawer/NavigationsModes.d.ts +0 -3
  243. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +0 -1
  244. package/lib/components/SettingDrawer/NavigationsModes.js.map +0 -1
  245. package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -3
  246. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
  247. package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
  248. package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
  249. package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
  250. package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -3
  251. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
  252. package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
  253. package/lib/components/SettingDrawer/ThemeSelector.d.ts.map +0 -1
  254. package/lib/components/SettingDrawer/ThemeSelector.js.map +0 -1
  255. package/lib/components/SettingDrawer/WebFontsSelector.d.ts +0 -3
  256. package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +0 -1
  257. package/lib/components/SettingDrawer/WebFontsSelector.js.map +0 -1
  258. package/lib/components/SettingDrawer/types.d.ts.map +0 -1
  259. /package/lib/components/SettingDrawer/{ThemeSelector.js → components/ThemeSelector.js} +0 -0
  260. /package/lib/components/SettingDrawer/{WebFontsSelector.js → components/WebFontsSelector.js} +0 -0
@@ -1,270 +1,5 @@
1
- import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {useSelector}from'@xstate/react';import {useTranslation}from'react-i18next';import isBrowser from'../../utils/isBrowser/index.js';import {parse}from'qs';import clsx from'clsx';import {defaultSettings,compareAndSaveSettingsDifferences}from'@admin-layout/client';import ThemeColor from'./ThemeColor.js';import CheckBoxTheme from'./CheckBoxTheme.js';import LayoutChange from'./LayoutChange.js';import RegionalSettings from'./RegionalSettings.js';import InvitationSettings from'./InvitationSettings.js';import {ThemeSelector}from'./ThemeSelector.js';import NavigationModes from'./NavigationsModes.js';import {icons}from'../../icons.js';import'@common-stack/components-pro';import {AdditionalSettingsSlot}from'../Layout/slot-fill/AdditionalSettings.js';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';import {WebFontsSelector}from'./WebFontsSelector.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../hooks/useMediaQuery.js';let oldSetting = {};
2
- const updateTheme = (dark, color, publicPath = '/theme') => {
3
- // ssr
4
- if (typeof window === 'undefined' || !window.umi_plugin_ant_themeVar) {
5
- return;
6
- }
7
- const href = dark ? `${publicPath}/dark` : `${publicPath}/`;
8
- // If it is DARK, and is color = daybreak, there is no need to splice
9
- let colorFileName = dark && color ? `-${encodeURIComponent(color)}` : encodeURIComponent(color || '');
10
- if (color === 'daybreak' && dark) {
11
- colorFileName = '';
12
- }
13
- const dom = document.getElementById('theme-style');
14
- // If these two are empty
15
- if (!href && !colorFileName) {
16
- if (dom) {
17
- dom.remove();
18
- localStorage.removeItem('site-theme');
19
- }
20
- return;
21
- }
22
- const url = `${href}${colorFileName || ''}.css`;
23
- if (dom) {
24
- dom.onload = () => {
25
- window.setTimeout(() => {});
26
- };
27
- dom.href = url;
28
- } else {
29
- const style = document.createElement('link');
30
- style.type = 'text/css';
31
- style.rel = 'stylesheet';
32
- style.id = 'theme-style';
33
- style.onload = () => {
34
- window.setTimeout(() => {});
35
- };
36
- style.href = url;
37
- if (document.body.append) {
38
- document.body.append(style);
39
- } else {
40
- document.body.appendChild(style);
41
- }
42
- }
43
- // localStorage.setItem('site-theme', dark ? 'dark' : 'light');
44
- };
45
- const initState = (settings, onSettingChange, publicPath) => {
46
- if (!isBrowser()) {
47
- return;
48
- }
49
- let loadedStyle = false;
50
- if (window.location.search) {
51
- const params = parse(window.location.search.replace('?', ''));
52
- const replaceSetting = {};
53
- Object.keys(params).forEach(key => {
54
- if (defaultSettings[key] || defaultSettings[key] === undefined) {
55
- replaceSetting[key] = params[key];
56
- if (key.includes('Render')) {
57
- replaceSetting[key] = params[key] === 'false' ? false : undefined;
58
- }
59
- }
60
- });
61
- if (onSettingChange) {
62
- onSettingChange({
63
- ...settings,
64
- ...replaceSetting
65
- });
66
- }
67
- // Set the topic in the URL and load it once.
68
- if (oldSetting.navTheme !== params.navTheme && params.navTheme) {
69
- updateTheme(settings.navTheme === 'realDark', params.primaryColor, publicPath);
70
- loadedStyle = true;
71
- }
72
- }
73
- if (loadedStyle) {
74
- return;
75
- }
76
- // If there is no topic in the URL, and no load in the URL is loaded.
77
- if (defaultSettings.navTheme !== settings.navTheme && settings.navTheme) {
78
- updateTheme(settings.navTheme === 'realDark', settings.primaryColor, publicPath);
79
- }
80
- };
81
- const getThemeList = (settings, location) => {
82
- const {
83
- t
84
- } = useTranslation('settings');
85
- const {
86
- isMobile
87
- } = useMediaQuery();
88
- const currentRoute = location?.pathname || '/';
89
- const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
90
- const deviceType = isMobile ? 'mobile' : 'desktop';
91
- const deviceLayout = routeSettings?.layout?.[deviceType] || {};
92
- let list = [];
93
- const defaultList = [
94
- //@sri following are needed otherwise we need make above plugin to work
95
- {
96
- key: 'dust',
97
- fileName: 'dust.css',
98
- modifyVars: {
99
- '@primary-color': '#F5222D'
100
- }
101
- }, {
102
- key: 'volcano',
103
- fileName: 'volcano.css',
104
- modifyVars: {
105
- '@primary-color': '#FA541C'
106
- }
107
- }, {
108
- key: 'sunset',
109
- fileName: 'sunset.css',
110
- modifyVars: {
111
- '@primary-color': '#FAAD14'
112
- }
113
- }, {
114
- key: 'cyan',
115
- fileName: 'cyan.css',
116
- modifyVars: {
117
- '@primary-color': '#13C2C2'
118
- }
119
- }, {
120
- key: 'green',
121
- fileName: 'green.css',
122
- modifyVars: {
123
- '@primary-color': '#52C41A'
124
- }
125
- }, {
126
- key: 'geekblue',
127
- fileName: 'geekblue.css',
128
- modifyVars: {
129
- '@primary-color': '#2F54EB'
130
- }
131
- }, {
132
- key: 'purple',
133
- fileName: 'purple.css',
134
- modifyVars: {
135
- '@primary-color': '#722ED1'
136
- }
137
- }];
138
- // ssr
139
- if (typeof window === 'undefined') {
140
- list = defaultList;
141
- } else {
142
- list = window.umi_plugin_ant_themeVar || defaultList;
143
- }
144
- const themeList = [{
145
- key: 'light',
146
- title: t('light')
147
- }];
148
- const darkColorList = [{
149
- key: 'daybreak',
150
- color: '#1890ff',
151
- theme: 'dark'
152
- }];
153
- const lightColorList = [{
154
- key: 'daybreak',
155
- color: '#1890ff',
156
- theme: 'dark'
157
- }];
158
- if (deviceLayout.navigationMode !== 'mixed') {
159
- themeList.push({
160
- key: 'dark',
161
- title: t('dark')
162
- });
163
- }
164
- if (list.find(item => item.theme === 'dark')) {
165
- themeList.push({
166
- key: 'realDark',
167
- title: t('dark')
168
- });
169
- }
170
- // insert theme color List
171
- list.forEach(item => {
172
- const color = (item.modifyVars || {})['@primary-color'];
173
- if (item.theme === 'dark' && color) {
174
- darkColorList.push({
175
- color,
176
- ...item
177
- });
178
- }
179
- if (!item.theme || item.theme === 'light') {
180
- lightColorList.push({
181
- color,
182
- ...item
183
- });
184
- }
185
- });
186
- return {
187
- colorList: {
188
- dark: darkColorList,
189
- light: lightColorList
190
- },
191
- themeList
192
- };
193
- };
194
- const themeOptions = [{
195
- key: 'default',
196
- title: 'Default'
197
- }, {
198
- key: 'github',
199
- title: 'Github Theme'
200
- }, {
201
- key: 'slack',
202
- title: 'Slack Theme'
203
- }, {
204
- key: 'airbnb',
205
- title: 'Airbnb Theme'
206
- }, {
207
- key: 'spotify',
208
- title: 'Spotify Theme'
209
- }];
210
- const fontOptions = [{
211
- key: 'Poppins, sans-serif',
212
- title: 'Poppins'
213
- }, {
214
- key: 'Roboto, sans-serif',
215
- title: 'Roboto'
216
- }, {
217
- key: 'Open Sans, sans-serif',
218
- title: 'Open Sans'
219
- }, {
220
- key: 'Montserrat, sans-serif',
221
- title: 'Montserrat'
222
- }, {
223
- key: 'Lato, sans-serif',
224
- title: 'Lato'
225
- }, {
226
- key: 'Nunito, sans-serif',
227
- title: 'Nunito'
228
- }, {
229
- key: 'Ubuntu, sans-serif',
230
- title: 'Ubuntu'
231
- }, {
232
- key: 'Inter, sans-serif',
233
- title: 'Inter'
234
- }, {
235
- key: 'Arial, sans-serif',
236
- title: 'Arial'
237
- }, {
238
- key: 'Helvetica, sans-serif',
239
- title: 'Helvetica'
240
- }, {
241
- key: 'Tahoma, sans-serif',
242
- title: 'Tahoma'
243
- }, {
244
- key: 'Trebuchet MS, sans-serif',
245
- title: 'Trebuchet MS'
246
- }, {
247
- key: 'Georgia, serif',
248
- title: 'Georgia'
249
- }, {
250
- key: 'Bookman, serif',
251
- title: 'Bookman'
252
- }, {
253
- key: 'Geneva, sans-serif',
254
- title: 'Geneva'
255
- }, {
256
- key: 'Lucida Console, monospace',
257
- title: 'Lucida Console'
258
- }, {
259
- key: 'Courier New, monospace',
260
- title: 'Courier New'
261
- }, {
262
- key: 'Lucida Sans, sans-serif',
263
- title: 'Lucida Sans'
264
- }];
265
- const SettingDrawer = props => {
1
+ import {jsx,Fragment,jsxs}from'react/jsx-runtime';import {useSelector}from'@xstate/react';import clsx from'clsx';import*as React from'react';import {useRef,useState,useEffect}from'react';import {useTranslation}from'react-i18next';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../hooks/useMediaQuery.js';import {icons}from'../../icons.js';import isBrowser from'../../utils/isBrowser/index.js';import {getDefaultApplyToAllRoutes,getSettingValue}from'../../utils/settingsUtils.js';import'@common-stack/components-pro';import {AdditionalSettingsSlot}from'../Layout/slot-fill/AdditionalSettings.js';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';import {ApplyToAllRoutesToggle}from'./components/ApplyToAllRoutesToggle.js';import {CheckBoxTheme}from'./components/CheckBoxTheme.js';import {DeviceTabs}from'./components/DeviceTabs.js';import {InvitationSettings}from'./components/InvitationSettings.js';import {LayoutChange}from'./components/LayoutChange.js';import {MenuVisibilitySettings}from'./components/MenuVisibilitySettings.js';import {NavigationModes}from'./components/NavigationsModes.js';import {RegionalSettings}from'./components/RegionalSettings.js';import {SettingsActions}from'./components/SettingsActions.js';import {SettingsDrawerHeader}from'./components/SettingsDrawerHeader.js';import {ThemeColor}from'./components/ThemeColor.js';import {ThemeSelector}from'./components/ThemeSelector.js';import {WebFontsSelector}from'./components/WebFontsSelector.js';import {useSettingsOperations}from'./hooks/useSettingsOperations.js';import {THEME_OPTIONS,FONT_OPTIONS}from'./utils/constants.js';import {useThemeList,initState,parseSettingPath}from'./utils/helper.js';function SettingDrawer(props) {
266
2
  const {
267
- settings,
268
3
  onSettingChange,
269
4
  hideLoading,
270
5
  hideColors,
@@ -275,102 +10,140 @@ const SettingDrawer = props => {
275
10
  colorList,
276
11
  navTheme,
277
12
  pathname,
278
- location
13
+ location,
14
+ fullMenuData,
15
+ routePattern
279
16
  } = props;
280
17
  const {
281
18
  CloseIcon,
282
- Settings5FillIcon,
283
- CopyIcon,
284
- CheckIcon
19
+ Settings5FillIcon
285
20
  } = icons;
286
- const [show, setShow] = useState(false);
21
+ // Refs
22
+ const hasInitializedRef = useRef(false);
23
+ const btnRef = useRef();
24
+ const prevSettingsRef = useRef();
25
+ // Hooks
287
26
  const {
288
27
  isMobile
289
28
  } = useMediaQuery();
290
- const [copied, setCopied] = useState(false);
291
- const [copiedModified, setCopiedModified] = useState(false);
292
29
  const {
293
30
  t
294
31
  } = useTranslation('settings');
295
- const state = useSelector(actor, state => state);
296
- const btnRef = useRef();
297
- const settingState = state?.context;
298
- const currentRoute = location?.pathname || '/';
299
- // const routeSettings =
300
- // settingState?.routeSettings?.[currentRoute] || settingState?.routeSettings?.['/'] || settingState;
301
- const deviceType = isMobile ? 'mobile' : 'desktop';
302
- // const deviceLayout = routeSettings?.layout?.[deviceType] || {};
303
- const themeList = getThemeList(settingState, location);
304
- /**
305
- * Modify settings
306
- * @param key
307
- * @param value
308
- */
309
- const handleSettingChange = (key, value) => {
310
- // If the key is a layout setting, update it in the device-specific path
311
- if (key.startsWith('layout.')) {
312
- const layoutKey = key.replace('layout.', '');
32
+ // State
33
+ const [show, setShow] = useState(false);
34
+ const [activeDeviceTab, setActiveDeviceTab] = useState(isMobile ? 'mobile' : 'desktop');
35
+ const [applyToAllRoutes, setApplyToAllRoutes] = useState(false);
36
+ // Selectors - guard actor so that useSelector isn't called with undefined/invalid actor
37
+ const settingState = actor ? useSelector(actor, state => state.context.public) : {};
38
+ const changedSettings = actor ? useSelector(actor, state => state.context.internal.changedSettings) : {};
39
+ // Custom hooks
40
+ const {
41
+ copied,
42
+ copiedModified,
43
+ handleCopySettings,
44
+ handleCopyModifiedSettings,
45
+ handleSaveSettings,
46
+ handleResetSettings
47
+ } = useSettingsOperations({
48
+ actor,
49
+ settingState,
50
+ changedSettings
51
+ });
52
+ // Computed values
53
+ const currentRoute = routePattern || location?.pathname || '/';
54
+ const deviceType = activeDeviceTab;
55
+ const currentPathname = isBrowser() ? window.location.pathname : pathname || '';
56
+ const themeList = useThemeList(settingState, location, routePattern);
57
+ // Derived state
58
+ const defaultApplyToAllRoutes = React.useMemo(() => {
59
+ return getDefaultApplyToAllRoutes(settingState, currentRoute, deviceType);
60
+ }, [settingState, currentRoute, deviceType]);
61
+ const settingsForComponents = settingState;
62
+ // Effects
63
+ useEffect(() => {
64
+ setApplyToAllRoutes(defaultApplyToAllRoutes);
65
+ }, [defaultApplyToAllRoutes]);
66
+ useEffect(() => {
67
+ const prevSettings = prevSettingsRef.current;
68
+ const currentSettings = settingState;
69
+ if (prevSettings) {
70
+ const prevString = JSON.stringify(prevSettings);
71
+ const currentString = JSON.stringify(currentSettings);
72
+ const hasChanged = prevString !== currentString;
73
+ if (hasChanged) {
74
+ console.log('🔍 What changed in PUBLIC settings:', {
75
+ changedKeys: Object.keys(currentSettings).filter(key => {
76
+ const prevValue = JSON.stringify(prevSettings[key]);
77
+ const currentValue = JSON.stringify(currentSettings[key]);
78
+ return prevValue !== currentValue;
79
+ })
80
+ });
81
+ }
82
+ }
83
+ prevSettingsRef.current = JSON.parse(JSON.stringify(currentSettings));
84
+ }, [settingState]);
85
+ useEffect(() => {
86
+ if (isBrowser()) {
87
+ const hasUrlParams = !!window.location.search;
88
+ const shouldInit = !hasInitializedRef.current || hasUrlParams;
89
+ if (shouldInit) {
90
+ console.log('🔥 Calling initState:', {
91
+ reason: !hasInitializedRef.current ? 'first mount' : 'has URL params'
92
+ });
93
+ initState(settingState, onSettingChange, props.publicPath, undefined);
94
+ hasInitializedRef.current = true;
95
+ } else {
96
+ console.log('⏭️ Skipping initState - already initialized and no URL params');
97
+ }
98
+ }
99
+ }, [settingState, props.publicPath]);
100
+ useEffect(() => {
101
+ setActiveDeviceTab(isMobile ? 'mobile' : 'desktop');
102
+ }, [isMobile]);
103
+ useEffect(() => {
104
+ if (actor) {
313
105
  actor.send({
314
- type: 'UPDATE',
315
- value: {
316
- [`routeSettings.${currentRoute}.layout.${deviceType}.${layoutKey}`]: value
317
- }
106
+ type: 'UISETTING_UPDATE_DEVICE_TYPE',
107
+ deviceType: activeDeviceTab
108
+ });
109
+ }
110
+ }, [activeDeviceTab, actor]);
111
+ // Helper functions
112
+ function handleSettingChange(key, value) {
113
+ const isGlobalSetting = key === 'hiddenMenuKeys' || key === 'hiddenMenuCategories' || key === 'applyToAllRoutes' || key === 'fixedHeader' || key === 'fixedSidebar' || key === 'splitMenus' || key === 'upperMenuDividerName' || key === 'middleMenuDividerName' || key === 'lowerMenuDividerName';
114
+ if (isGlobalSetting) {
115
+ console.log('🌐 Sending GLOBAL setting to actor:', {
116
+ key,
117
+ value
318
118
  });
319
- } else {
320
119
  actor.send({
321
- type: 'UPDATE',
120
+ type: 'UISETTING_UPDATE',
322
121
  value: {
323
122
  [key]: value
324
123
  }
325
124
  });
125
+ return;
326
126
  }
327
- };
328
- const handleCopySettings = async () => {
329
- if (!isBrowser()) return;
330
- try {
331
- const settings = JSON.stringify(settingState, null, 2);
332
- await navigator.clipboard.writeText(settings);
333
- setCopied(true);
334
- setTimeout(() => setCopied(false), 2000);
335
- } catch (err) {
336
- console.error('Failed to copy settings:', err);
337
- }
338
- };
339
- const handleCopyModifiedSettings = async () => {
340
- if (!isBrowser()) return;
341
- try {
342
- const modifiedSettings = compareAndSaveSettingsDifferences(settingState, defaultSettings);
343
- const settings = JSON.stringify(modifiedSettings, null, 2);
344
- await navigator.clipboard.writeText(settings);
345
- setCopiedModified(true);
346
- setTimeout(() => setCopiedModified(false), 2000);
347
- } catch (err) {
348
- console.error('Failed to copy modified settings:', err);
349
- }
350
- };
351
- useEffect(() => {
352
- // Only update if there's a meaningful difference
353
- if (JSON.stringify(settingState) !== JSON.stringify(settings)) {
354
- oldSetting = {
355
- ...defaultSettings,
356
- ...settings
357
- };
358
- if (isBrowser()) {
359
- // Compare settings with oldSetting to determine if initialization is needed
360
- if (JSON.stringify(settings) !== JSON.stringify(oldSetting)) {
361
- initState(settings, onSettingChange, props.publicPath);
362
- }
363
- }
364
- }
365
- }, [settings]); // Only depend on settings
366
- const currentPathname = isBrowser() ? window.location.pathname : pathname || '';
127
+ const bracketKey = applyToAllRoutes ? `[${deviceType}]` : `[${currentRoute}][${deviceType}]`;
128
+ const settingObject = parseSettingPath(key, value);
129
+ const nestedValue = {
130
+ [bracketKey]: settingObject
131
+ };
132
+ console.log('0️⃣ handleSettingChange with value: ', nestedValue);
133
+ actor.send({
134
+ type: 'UISETTING_UPDATE',
135
+ value: nestedValue
136
+ });
137
+ }
138
+ const getThemeValue = () => getSettingValue(settingState, 'theme', applyToAllRoutes, currentRoute, deviceType, 'default');
139
+ const getFontFamilyValue = () => getSettingValue(settingState, 'fontFamily', applyToAllRoutes, currentRoute, deviceType, 'Poppins, sans-serif');
367
140
  return jsx(Fragment, {
368
- children: settings?.showSettingPanel && jsxs(Fragment, {
141
+ children: settingState?.showSettingPanel && jsxs(Fragment, {
369
142
  children: [jsx("button", {
370
143
  ref: btnRef,
371
144
  onClick: () => setShow(!show),
372
145
  style: {
373
- backgroundColor: settings?.primaryColor,
146
+ backgroundColor: settingState?.primaryColor,
374
147
  display: 'flex',
375
148
  alignItems: 'center',
376
149
  justifyContent: 'center'
@@ -385,19 +158,20 @@ const SettingDrawer = props => {
385
158
  })
386
159
  }), jsxs("div", {
387
160
  className: clsx('fixed right-0 top-0 w-[20rem] transition-all duration-500 overflow-hidden overflow-y-auto z-50 p-4 min-h-full max-h-full', 'bg-white dark:bg-[#1f1f1f]', show ? 'opacity-100 visible' : 'w-0 opacity-0 invisible', 'shadow-lg'),
388
- children: [jsxs("div", {
389
- className: "flex flex-row items-center",
390
- children: [jsx("p", {
391
- className: "text-2xl mb-0 text-black dark:text-white",
392
- children: t('setting')
393
- }), jsx("div", {
394
- className: "flex-grow"
395
- }), jsx("button", {
396
- onClick: () => setShow(false),
397
- className: "bg-transparent border-none rounded-lg w-10 h-10 cursor-pointer mb-2 hover:bg-gray-200 dark:hover:bg-[#2a2a2a]",
398
- children: jsx(CloseIcon, {
399
- fontSize: '36px'
400
- })
161
+ children: [jsx(SettingsDrawerHeader, {
162
+ onClose: () => setShow(false)
163
+ }), jsxs("div", {
164
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
165
+ children: [jsx(MenuVisibilitySettings, {
166
+ fullMenuData: fullMenuData,
167
+ settings: settingState,
168
+ changeSetting: handleSettingChange
169
+ }), jsx(ApplyToAllRoutesToggle, {
170
+ checked: applyToAllRoutes,
171
+ onChange: setApplyToAllRoutes
172
+ }), jsx(DeviceTabs, {
173
+ activeTab: activeDeviceTab,
174
+ onTabChange: setActiveDeviceTab
401
175
  })]
402
176
  }), jsxs("div", {
403
177
  className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
@@ -408,8 +182,9 @@ const SettingDrawer = props => {
408
182
  children: jsx(CheckBoxTheme, {
409
183
  list: themeList.themeList,
410
184
  changeSetting: handleSettingChange,
411
- settings: settingState,
412
- ...props
185
+ settings: settingsForComponents,
186
+ location: location,
187
+ applyToAllRoutes: applyToAllRoutes
413
188
  })
414
189
  }), jsxs("div", {
415
190
  className: "mt-8",
@@ -417,9 +192,9 @@ const SettingDrawer = props => {
417
192
  className: "text-black dark:text-white",
418
193
  children: t('Select Theme')
419
194
  }), jsx(ThemeSelector, {
420
- value: settingState.theme || 'default',
195
+ value: getThemeValue(),
421
196
  onChange: value => handleSettingChange('theme', value),
422
- options: themeOptions
197
+ options: THEME_OPTIONS
423
198
  })]
424
199
  }), jsxs("div", {
425
200
  className: "mt-8 dark:border-[#2a2b2a]",
@@ -429,7 +204,10 @@ const SettingDrawer = props => {
429
204
  }), jsx(ThemeColor, {
430
205
  color: colorList || themeList.colorList[navTheme === 'realDark' ? 'dark' : 'light'],
431
206
  changeSetting: handleSettingChange,
432
- settings: settingState
207
+ settings: settingsForComponents,
208
+ location: location,
209
+ routePattern: routePattern,
210
+ applyToAllRoutes: applyToAllRoutes
433
211
  })]
434
212
  }), jsxs("div", {
435
213
  className: "mt-8",
@@ -437,92 +215,64 @@ const SettingDrawer = props => {
437
215
  className: "text-black dark:text-white",
438
216
  children: t('Font Family')
439
217
  }), jsx(WebFontsSelector, {
440
- value: settingState.fontFamily || 'Poppins, sans-serif',
218
+ value: getFontFamilyValue(),
441
219
  onChange: value => handleSettingChange('fontFamily', value),
442
- options: fontOptions
220
+ options: FONT_OPTIONS
443
221
  })]
444
222
  })]
445
223
  }), jsxs("div", {
446
224
  className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
447
225
  children: [jsx(NavigationModes, {
448
- settings: settingState,
226
+ settings: settingsForComponents,
449
227
  changeSetting: handleSettingChange,
450
- ...props
228
+ applyToAllRoutes: applyToAllRoutes,
229
+ location: location,
230
+ routePattern: routePattern
451
231
  }), jsx("div", {
452
232
  className: "mt-8",
453
233
  children: jsx(LayoutChange, {
454
- settings: settingState,
234
+ settings: settingsForComponents,
455
235
  changeSetting: handleSettingChange,
456
- ...props
236
+ applyToAllRoutes: applyToAllRoutes,
237
+ location: location,
238
+ routePattern: routePattern
457
239
  })
458
240
  }), jsx("div", {
459
241
  className: "mt-8",
460
242
  children: jsx(InvitationSettings, {
461
- settings: settingState,
243
+ settings: settingsForComponents,
462
244
  changeSetting: handleSettingChange,
463
- location: location
245
+ location: location,
246
+ routePattern: routePattern,
247
+ applyToAllRoutes: applyToAllRoutes
464
248
  })
465
249
  })]
466
- }), jsxs("div", {
250
+ }), jsx("div", {
467
251
  className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
468
- children: [jsx("p", {
469
- className: "mb-2 text-black dark:text-white",
470
- children: t('regional_rettings')
471
- }), jsx(RegionalSettings, {
472
- settings: settingState,
252
+ children: jsx(RegionalSettings, {
253
+ settings: settingsForComponents,
473
254
  changeSetting: handleSettingChange,
474
- ...props
475
- })]
255
+ applyToAllRoutes: applyToAllRoutes,
256
+ location: location,
257
+ routePattern: routePattern
258
+ })
476
259
  }), jsx("div", {
477
260
  className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
478
261
  children: jsx(AdditionalSettingsSlot, {
479
- settings: settingState,
262
+ settings: settingsForComponents,
480
263
  onSettingsChange: handleSettingChange,
481
264
  pathname: currentPathname
482
265
  })
483
- }), jsxs("div", {
484
- className: "bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-lg p-4 mt-4",
485
- children: [jsx("p", {
486
- className: "text-sm text-yellow-700 dark:text-yellow-200",
487
- children: "Setting panel shows in development environment only, please manually modify"
488
- }), jsxs("div", {
489
- className: "flex flex-wrap gap-2 mt-2",
490
- children: [jsx("button", {
491
- className: clsx('flex-1 min-w-[140px] sm:flex-none sm:w-auto px-4 py-2 rounded-lg border text-sm font-medium shadow-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2', copied ? 'border-green-300 text-green-700 bg-green-50 dark:border-green-600 dark:text-green-200 dark:bg-green-900' : 'border-yellow-300 text-yellow-700 bg-yellow-50 hover:bg-yellow-100 active:bg-yellow-200 dark:border-yellow-600 dark:text-yellow-200 dark:bg-yellow-900/50 dark:hover:bg-yellow-900'),
492
- onClick: handleCopySettings,
493
- children: copied ? jsxs(Fragment, {
494
- children: [jsx(CheckIcon, {
495
- className: "w-4 h-4"
496
- }), jsx("span", {
497
- children: "Copied!"
498
- })]
499
- }) : jsxs(Fragment, {
500
- children: [jsx(CopyIcon, {
501
- className: "w-4 h-4"
502
- }), jsx("span", {
503
- children: "Copy All Settings"
504
- })]
505
- })
506
- }), jsx("button", {
507
- className: clsx('flex-1 min-w-[140px] sm:flex-none sm:w-auto px-4 py-2 rounded-lg border text-sm font-medium shadow-sm transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2', copiedModified ? 'border-green-300 text-green-700 bg-green-50 dark:border-green-600 dark:text-green-200 dark:bg-green-900' : 'border-blue-300 text-blue-700 bg-blue-50 hover:bg-blue-100 active:bg-blue-200 dark:border-blue-600 dark:text-blue-200 dark:bg-blue-900/50 dark:hover:bg-blue-900'),
508
- onClick: handleCopyModifiedSettings,
509
- children: copiedModified ? jsxs(Fragment, {
510
- children: [jsx(CheckIcon, {
511
- className: "w-4 h-4"
512
- }), jsx("span", {
513
- children: "Copied!"
514
- })]
515
- }) : jsxs(Fragment, {
516
- children: [jsx(CopyIcon, {
517
- className: "w-4 h-4"
518
- }), jsx("span", {
519
- children: "Copy Modified Settings"
520
- })]
521
- })
522
- })]
523
- })]
266
+ }), jsx(SettingsActions, {
267
+ hasChanges: changedSettings && Object.keys(changedSettings).length > 0,
268
+ copied: copied,
269
+ copiedModified: copiedModified,
270
+ onSave: handleSaveSettings,
271
+ onCopyAll: handleCopySettings,
272
+ onCopyModified: handleCopyModifiedSettings,
273
+ onReset: handleResetSettings
524
274
  })]
525
275
  })]
526
276
  })
527
277
  });
528
- };export{SettingDrawer};//# sourceMappingURL=SettingDrawer.js.map
278
+ }export{SettingDrawer};//# sourceMappingURL=SettingDrawer.js.map