@admin-layout/tailwind-design-pro 10.1.1-alpha.9 → 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 (443) hide show
  1. package/README.md +376 -250
  2. package/lib/cdm-locales/en/menu.json +2 -1
  3. package/lib/cdm-locales/en/settings.json +6 -1
  4. package/lib/cdm-locales/es/menu.json +2 -1
  5. package/lib/cdm-locales/es/settings.json +6 -1
  6. package/lib/cdm-locales/index.d.ts +2 -0
  7. package/lib/cdm-locales/index.d.ts.map +1 -0
  8. package/lib/cdm-locales/index.ts +1 -0
  9. package/lib/components/LanguageMenu/LanguageMenu.d.ts +2 -1
  10. package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
  11. package/lib/components/LanguageMenu/LanguageMenu.js +40 -61
  12. package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
  13. package/lib/components/Layout/BasicLayout/index.d.ts +6 -5
  14. package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
  15. package/lib/components/Layout/BasicLayout/index.js +255 -175
  16. package/lib/components/Layout/BasicLayout/index.js.map +1 -1
  17. package/lib/components/Layout/BasicLayout/utils.d.ts +4 -2
  18. package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
  19. package/lib/components/Layout/BasicLayout/utils.js +80 -109
  20. package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
  21. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
  22. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +28 -38
  23. package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
  24. package/lib/components/Layout/GlobalFooter/Copyright.d.ts +2 -1
  25. package/lib/components/Layout/GlobalFooter/Copyright.d.ts.map +1 -1
  26. package/lib/components/Layout/GlobalFooter/Footer.d.ts +2 -1
  27. package/lib/components/Layout/GlobalFooter/Footer.d.ts.map +1 -1
  28. package/lib/components/Layout/GlobalHeader/Header.d.ts +0 -1
  29. package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
  30. package/lib/components/Layout/GlobalHeader/Header.js +82 -66
  31. package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
  32. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +0 -2
  33. package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
  34. package/lib/components/Layout/GlobalHeader/MainHeader.js +119 -162
  35. package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
  36. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
  37. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +26 -30
  38. package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
  39. package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
  40. package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
  41. package/lib/components/Layout/GlobalHeader/RightContent.js +82 -19
  42. package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
  43. package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
  44. package/lib/components/Layout/GlobalHeader/RightMenu.js +116 -158
  45. package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
  46. package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -1
  47. package/lib/components/Layout/GlobalHeader/SearchBar.js +36 -45
  48. package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
  49. package/lib/components/Layout/GlobalHeader/index.d.ts +0 -1
  50. package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
  51. package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
  52. package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
  53. package/lib/components/Layout/ProTailwindLayout.js +70 -9
  54. package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
  55. package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
  56. package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
  57. package/lib/components/Layout/Sidebar/BottomMenu.js +294 -0
  58. package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
  59. package/lib/components/Layout/Sidebar/Divider.d.ts +2 -1
  60. package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
  61. package/lib/components/Layout/Sidebar/Divider.js +26 -28
  62. package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
  63. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +1 -1
  64. package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -1
  65. package/lib/components/Layout/Sidebar/DynamicIcon.js +10 -11
  66. package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
  67. package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
  68. package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
  69. package/lib/components/Layout/Sidebar/MainSidebar.js +224 -0
  70. package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
  71. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
  72. package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
  73. package/lib/components/Layout/Sidebar/MainSidebarMenu.js +451 -0
  74. package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
  75. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
  76. package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
  77. package/lib/components/Layout/Sidebar/PerplexSidebar.js +254 -0
  78. package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
  79. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
  80. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
  81. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +318 -0
  82. package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
  83. package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
  84. package/lib/components/Layout/TailwindLayout.js +37 -20
  85. package/lib/components/Layout/TailwindLayout.js.map +1 -1
  86. package/lib/components/Layout/getPageTitle.js.map +1 -1
  87. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts +3 -2
  88. package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -1
  89. package/lib/components/Layout/slot-fill/AdditionalSettings.js +2 -2
  90. package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
  91. package/lib/components/Layout/slot-fill/Footer.d.ts +3 -2
  92. package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
  93. package/lib/components/Layout/slot-fill/Footer.js +2 -2
  94. package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
  95. package/lib/components/Layout/slot-fill/HeaderNotice.d.ts +3 -2
  96. package/lib/components/Layout/slot-fill/HeaderNotice.d.ts.map +1 -1
  97. package/lib/components/Layout/slot-fill/HeaderNotice.js +7 -0
  98. package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
  99. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +2 -1
  100. package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -1
  101. package/lib/components/Layout/slot-fill/HeaderSearchBar.js +2 -2
  102. package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
  103. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +2 -1
  104. package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -1
  105. package/lib/components/Layout/slot-fill/HeaderSearchButton.js +2 -2
  106. package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
  107. package/lib/components/Layout/slot-fill/Logo.d.ts +5 -0
  108. package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
  109. package/lib/components/Layout/slot-fill/Logo.js +7 -0
  110. package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
  111. package/lib/components/Layout/slot-fill/RightContent.d.ts +2 -1
  112. package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -1
  113. package/lib/components/Layout/slot-fill/RightContent.js +2 -2
  114. package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
  115. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +5 -0
  116. package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
  117. package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
  118. package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
  119. package/lib/components/Layout/slot-fill/index.d.ts +2 -0
  120. package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
  121. package/lib/components/Layout/util.js +1 -1
  122. package/lib/components/Layout/util.js.map +1 -1
  123. package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -2
  124. package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
  125. package/lib/components/SettingDrawer/SettingDrawer.js +190 -499
  126. package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
  127. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +8 -0
  128. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
  129. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +21 -0
  130. package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
  131. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +4 -0
  132. package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
  133. package/lib/components/SettingDrawer/components/CheckBoxTheme.js +119 -0
  134. package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
  135. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +8 -0
  136. package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
  137. package/lib/components/SettingDrawer/components/DeviceTabs.js +74 -0
  138. package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
  139. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +4 -0
  140. package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
  141. package/lib/components/SettingDrawer/components/InvitationSettings.js +72 -0
  142. package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
  143. package/lib/components/SettingDrawer/components/LayoutChange.d.ts +4 -0
  144. package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
  145. package/lib/components/SettingDrawer/components/LayoutChange.js +111 -0
  146. package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
  147. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +21 -0
  148. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
  149. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +106 -0
  150. package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
  151. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +4 -0
  152. package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
  153. package/lib/components/SettingDrawer/components/NavigationsModes.js +322 -0
  154. package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
  155. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +4 -0
  156. package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
  157. package/lib/components/SettingDrawer/components/RegionalSettings.js +519 -0
  158. package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
  159. package/lib/components/SettingDrawer/components/SettingsActions.d.ts +13 -0
  160. package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
  161. package/lib/components/SettingDrawer/components/SettingsActions.js +42 -0
  162. package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
  163. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +5 -0
  164. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
  165. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +22 -0
  166. package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
  167. package/lib/components/SettingDrawer/components/Switch.d.ts +4 -0
  168. package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
  169. package/lib/components/SettingDrawer/components/Switch.js +20 -0
  170. package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
  171. package/lib/components/SettingDrawer/components/ThemeColor.d.ts +4 -0
  172. package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
  173. package/lib/components/SettingDrawer/components/ThemeColor.js +45 -0
  174. package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
  175. package/lib/components/SettingDrawer/components/ThemeSelector.d.ts +4 -0
  176. package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
  177. package/lib/components/SettingDrawer/components/ThemeSelector.js +16 -0
  178. package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
  179. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +4 -0
  180. package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
  181. package/lib/components/SettingDrawer/components/WebFontsSelector.js +22 -0
  182. package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
  183. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
  184. package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
  185. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +115 -0
  186. package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
  187. package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
  188. package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
  189. package/lib/components/SettingDrawer/utils/constants.js +77 -0
  190. package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
  191. package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
  192. package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
  193. package/lib/components/SettingDrawer/utils/helper.js +154 -0
  194. package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
  195. package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
  196. package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
  197. package/lib/components/SettingDrawer/utils/transformers.js +73 -0
  198. package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
  199. package/lib/components/SettingDrawer/{types.d.ts → utils/types.d.ts} +14 -0
  200. package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
  201. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +13 -4
  202. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
  203. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
  204. package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
  205. package/lib/components/index.d.ts +0 -2
  206. package/lib/components/index.d.ts.map +1 -1
  207. package/lib/components/index.js +1 -1
  208. package/lib/components/typings.d.ts +20 -6
  209. package/lib/components/typings.d.ts.map +1 -1
  210. package/lib/compute.d.ts.map +1 -1
  211. package/lib/compute.js +10 -2
  212. package/lib/compute.js.map +1 -1
  213. package/lib/config/analytics-config.d.ts +59 -0
  214. package/lib/config/analytics-config.d.ts.map +1 -0
  215. package/lib/config/constants.js.map +1 -1
  216. package/lib/config/env-config.d.ts +6 -0
  217. package/lib/config/env-config.d.ts.map +1 -1
  218. package/lib/config/env-config.js +21 -1
  219. package/lib/config/env-config.js.map +1 -1
  220. package/lib/config/index.d.ts +3 -0
  221. package/lib/config/index.d.ts.map +1 -0
  222. package/lib/helpers/DynamicIcon.d.ts +1 -1
  223. package/lib/helpers/DynamicIcon.d.ts.map +1 -1
  224. package/lib/helpers/DynamicIcon.js +16 -17
  225. package/lib/helpers/DynamicIcon.js.map +1 -1
  226. package/lib/hooks/index.d.ts +0 -3
  227. package/lib/hooks/index.d.ts.map +1 -1
  228. package/lib/hooks/useMediaQuery.js.map +1 -1
  229. package/lib/hooks/useScrollThreshold.js.map +1 -1
  230. package/lib/hooks/useTailwindTheme.js.map +1 -1
  231. package/lib/icons.d.ts +2 -0
  232. package/lib/icons.d.ts.map +1 -1
  233. package/lib/icons.js +4 -2
  234. package/lib/icons.js.map +1 -1
  235. package/lib/index.d.ts +1 -1
  236. package/lib/index.d.ts.map +1 -1
  237. package/lib/index.js +1 -1
  238. package/lib/index.js.map +1 -1
  239. package/lib/machines/selectors.d.ts +118 -0
  240. package/lib/machines/selectors.d.ts.map +1 -0
  241. package/lib/machines/settingsMachine.d.ts +25 -2
  242. package/lib/machines/settingsMachine.d.ts.map +1 -1
  243. package/lib/machines/settingsMachine.js +133 -168
  244. package/lib/machines/settingsMachine.js.map +1 -1
  245. package/lib/machines/types.d.ts +107 -9
  246. package/lib/machines/types.d.ts.map +1 -1
  247. package/lib/machines/types.js.map +1 -1
  248. package/lib/module.js.map +1 -1
  249. package/lib/redux/searchReducer.d.ts +1 -1
  250. package/lib/redux/searchReducer.d.ts.map +1 -1
  251. package/lib/redux/searchReducer.js.map +1 -1
  252. package/lib/routes.json +9 -1
  253. package/lib/styles/index.css +602 -372
  254. package/lib/tailwindConfig.d.ts +85 -27
  255. package/lib/tailwindConfig.d.ts.map +1 -1
  256. package/lib/tailwindConfig.js +96 -18
  257. package/lib/tailwindConfig.js.map +1 -1
  258. package/lib/utils/__tests__/analytics-utils.test.d.ts +2 -0
  259. package/lib/utils/__tests__/analytics-utils.test.d.ts.map +1 -0
  260. package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
  261. package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
  262. package/lib/utils/__tests__/menu.test.d.ts +2 -0
  263. package/lib/utils/__tests__/menu.test.d.ts.map +1 -0
  264. package/lib/utils/__tests__/selectors.test.d.ts +2 -0
  265. package/lib/utils/__tests__/selectors.test.d.ts.map +1 -0
  266. package/lib/utils/__tests__/settingsMachine.test.d.ts +2 -0
  267. package/lib/utils/__tests__/settingsMachine.test.d.ts.map +1 -0
  268. package/lib/utils/__tests__/settingsUtils.test.d.ts +2 -0
  269. package/lib/utils/__tests__/settingsUtils.test.d.ts.map +1 -0
  270. package/lib/utils/analytics-utils.d.ts +43 -0
  271. package/lib/utils/analytics-utils.d.ts.map +1 -0
  272. package/lib/utils/analytics.d.ts +48 -0
  273. package/lib/utils/analytics.d.ts.map +1 -0
  274. package/lib/utils/configOverrides.d.ts +213 -0
  275. package/lib/utils/configOverrides.d.ts.map +1 -0
  276. package/lib/utils/configOverrides.js +91 -0
  277. package/lib/utils/configOverrides.js.map +1 -0
  278. package/lib/utils/isBrowser/index.js.map +1 -1
  279. package/lib/utils/settingsUtils.d.ts +20 -0
  280. package/lib/utils/settingsUtils.d.ts.map +1 -0
  281. package/lib/utils/settingsUtils.js +74 -0
  282. package/lib/utils/settingsUtils.js.map +1 -0
  283. package/lib/utils/utils/index.js.map +1 -1
  284. package/package.json +7 -15
  285. package/lib/components/Layout/GlobalHeader/Logo.d.ts +0 -4
  286. package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +0 -1
  287. package/lib/components/Layout/GlobalHeader/Logo.js +0 -141
  288. package/lib/components/Layout/GlobalHeader/Logo.js.map +0 -1
  289. package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
  290. package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
  291. package/lib/components/Layout/Sidebar/Sidebar.js +0 -186
  292. package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
  293. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
  294. package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
  295. package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -183
  296. package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
  297. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -3
  298. package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
  299. package/lib/components/SettingDrawer/CheckBoxTheme.js +0 -123
  300. package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
  301. package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -3
  302. package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
  303. package/lib/components/SettingDrawer/LayoutChange.js +0 -123
  304. package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
  305. package/lib/components/SettingDrawer/NavigationsModes.d.ts +0 -3
  306. package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +0 -1
  307. package/lib/components/SettingDrawer/NavigationsModes.js +0 -289
  308. package/lib/components/SettingDrawer/NavigationsModes.js.map +0 -1
  309. package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -3
  310. package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
  311. package/lib/components/SettingDrawer/RegionalSettings.js +0 -740
  312. package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
  313. package/lib/components/SettingDrawer/Switch/index.d.ts +0 -3
  314. package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
  315. package/lib/components/SettingDrawer/Switch/index.js +0 -22
  316. package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
  317. package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -3
  318. package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
  319. package/lib/components/SettingDrawer/ThemeColor.js +0 -35
  320. package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
  321. package/lib/components/SettingDrawer/ThemeSelector.d.ts +0 -3
  322. package/lib/components/SettingDrawer/ThemeSelector.d.ts.map +0 -1
  323. package/lib/components/SettingDrawer/ThemeSelector.js +0 -18
  324. package/lib/components/SettingDrawer/ThemeSelector.js.map +0 -1
  325. package/lib/components/SettingDrawer/WebFontsSelector.d.ts +0 -3
  326. package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +0 -1
  327. package/lib/components/SettingDrawer/WebFontsSelector.js +0 -24
  328. package/lib/components/SettingDrawer/WebFontsSelector.js.map +0 -1
  329. package/lib/components/SettingDrawer/types.d.ts.map +0 -1
  330. package/lib/components/ThemeProvider/ThemeProvider.d.ts +0 -8
  331. package/lib/components/ThemeProvider/ThemeProvider.d.ts.map +0 -1
  332. package/lib/components/ThemeProvider/ThemeProvider.js +0 -60
  333. package/lib/components/ThemeProvider/ThemeProvider.js.map +0 -1
  334. package/lib/components/ThemeProvider/ThemeToggle.d.ts +0 -7
  335. package/lib/components/ThemeProvider/ThemeToggle.d.ts.map +0 -1
  336. package/lib/components/ThemeProvider/ThemeToggle.js +0 -50
  337. package/lib/components/ThemeProvider/ThemeToggle.js.map +0 -1
  338. package/lib/components/ThemeProvider/index.d.ts +0 -4
  339. package/lib/components/ThemeProvider/index.d.ts.map +0 -1
  340. package/lib/components/ThemeProvider/themes/airbnb.d.ts +0 -3
  341. package/lib/components/ThemeProvider/themes/airbnb.d.ts.map +0 -1
  342. package/lib/components/ThemeProvider/themes/airbnb.js +0 -186
  343. package/lib/components/ThemeProvider/themes/airbnb.js.map +0 -1
  344. package/lib/components/ThemeProvider/themes/default.d.ts +0 -3
  345. package/lib/components/ThemeProvider/themes/default.d.ts.map +0 -1
  346. package/lib/components/ThemeProvider/themes/default.js +0 -183
  347. package/lib/components/ThemeProvider/themes/default.js.map +0 -1
  348. package/lib/components/ThemeProvider/themes/github.d.ts +0 -3
  349. package/lib/components/ThemeProvider/themes/github.d.ts.map +0 -1
  350. package/lib/components/ThemeProvider/themes/github.js +0 -190
  351. package/lib/components/ThemeProvider/themes/github.js.map +0 -1
  352. package/lib/components/ThemeProvider/themes/index.d.ts +0 -15
  353. package/lib/components/ThemeProvider/themes/index.d.ts.map +0 -1
  354. package/lib/components/ThemeProvider/themes/index.js +0 -7
  355. package/lib/components/ThemeProvider/themes/index.js.map +0 -1
  356. package/lib/components/ThemeProvider/themes/slack.d.ts +0 -3
  357. package/lib/components/ThemeProvider/themes/slack.d.ts.map +0 -1
  358. package/lib/components/ThemeProvider/themes/slack.js +0 -188
  359. package/lib/components/ThemeProvider/themes/slack.js.map +0 -1
  360. package/lib/components/ThemeProvider/themes/spotify.d.ts +0 -3
  361. package/lib/components/ThemeProvider/themes/spotify.d.ts.map +0 -1
  362. package/lib/components/ThemeProvider/themes/spotify.js +0 -189
  363. package/lib/components/ThemeProvider/themes/spotify.js.map +0 -1
  364. package/lib/components/ThemeProvider/types.d.ts +0 -112
  365. package/lib/components/ThemeProvider/types.d.ts.map +0 -1
  366. package/lib/components/UI/CardList.d.ts +0 -61
  367. package/lib/components/UI/CardList.d.ts.map +0 -1
  368. package/lib/components/UI/CardList.js +0 -43
  369. package/lib/components/UI/CardList.js.map +0 -1
  370. package/lib/components/UI/CategoriesTypeList.d.ts +0 -29
  371. package/lib/components/UI/CategoriesTypeList.d.ts.map +0 -1
  372. package/lib/components/UI/CategoriesTypeList.js +0 -140
  373. package/lib/components/UI/CategoriesTypeList.js.map +0 -1
  374. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +0 -83
  375. package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +0 -1
  376. package/lib/components/UI/LazyLoadingGoogleMarker.js +0 -107
  377. package/lib/components/UI/LazyLoadingGoogleMarker.js.map +0 -1
  378. package/lib/components/UI/Pagination.d.ts +0 -6
  379. package/lib/components/UI/Pagination.d.ts.map +0 -1
  380. package/lib/components/UI/Pagination.js +0 -59
  381. package/lib/components/UI/Pagination.js.map +0 -1
  382. package/lib/components/UI/ParamSearchResultContainer.d.ts +0 -99
  383. package/lib/components/UI/ParamSearchResultContainer.d.ts.map +0 -1
  384. package/lib/components/UI/ParamSearchResultContainer.js +0 -120
  385. package/lib/components/UI/ParamSearchResultContainer.js.map +0 -1
  386. package/lib/components/UI/PropertyCard.d.ts +0 -24
  387. package/lib/components/UI/PropertyCard.d.ts.map +0 -1
  388. package/lib/components/UI/PropertyCard.js +0 -375
  389. package/lib/components/UI/PropertyCard.js.map +0 -1
  390. package/lib/components/UI/PropertyCardOnMap.d.ts +0 -10
  391. package/lib/components/UI/PropertyCardOnMap.d.ts.map +0 -1
  392. package/lib/components/UI/PropertyCardOnMap.js +0 -108
  393. package/lib/components/UI/PropertyCardOnMap.js.map +0 -1
  394. package/lib/components/UI/VehicleCard/PricePopover.d.ts +0 -8
  395. package/lib/components/UI/VehicleCard/PricePopover.d.ts.map +0 -1
  396. package/lib/components/UI/VehicleCard/PricePopover.js +0 -98
  397. package/lib/components/UI/VehicleCard/PricePopover.js.map +0 -1
  398. package/lib/components/UI/VehicleCard/VehicleBadge.d.ts +0 -7
  399. package/lib/components/UI/VehicleCard/VehicleBadge.d.ts.map +0 -1
  400. package/lib/components/UI/VehicleCard/VehicleFeature.d.ts +0 -9
  401. package/lib/components/UI/VehicleCard/VehicleFeature.d.ts.map +0 -1
  402. package/lib/components/UI/VehicleCard/VehicleFeature.js +0 -23
  403. package/lib/components/UI/VehicleCard/VehicleFeature.js.map +0 -1
  404. package/lib/components/UI/VehicleCard/types.d.ts +0 -59
  405. package/lib/components/UI/VehicleCard/types.d.ts.map +0 -1
  406. package/lib/components/UI/VehicleCard.d.ts +0 -15
  407. package/lib/components/UI/VehicleCard.d.ts.map +0 -1
  408. package/lib/components/UI/VehicleCard.js +0 -166
  409. package/lib/components/UI/VehicleCard.js.map +0 -1
  410. package/lib/components/UI/VehicleCardList.d.ts +0 -14
  411. package/lib/components/UI/VehicleCardList.d.ts.map +0 -1
  412. package/lib/components/UI/VehicleCardList.js +0 -38
  413. package/lib/components/UI/VehicleCardList.js.map +0 -1
  414. package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +0 -90
  415. package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +0 -1
  416. package/lib/components/UI/icons/LocationIcon.d.ts +0 -7
  417. package/lib/components/UI/icons/LocationIcon.d.ts.map +0 -1
  418. package/lib/components/UI/icons/LocationIcon.js +0 -18
  419. package/lib/components/UI/icons/LocationIcon.js.map +0 -1
  420. package/lib/components/UI/icons/index.d.ts +0 -2
  421. package/lib/components/UI/icons/index.d.ts.map +0 -1
  422. package/lib/components/UI/index.d.ts +0 -10
  423. package/lib/components/UI/index.d.ts.map +0 -1
  424. package/lib/components/typings.js +0 -6
  425. package/lib/components/typings.js.map +0 -1
  426. package/lib/hooks/use-get-current-lat-long.d.ts +0 -18
  427. package/lib/hooks/use-get-current-lat-long.d.ts.map +0 -1
  428. package/lib/hooks/use-get-current-lat-long.js +0 -29
  429. package/lib/hooks/use-get-current-lat-long.js.map +0 -1
  430. package/lib/hooks/useWindowSize.d.ts +0 -6
  431. package/lib/hooks/useWindowSize.d.ts.map +0 -1
  432. package/lib/hooks/useWindowSize.js +0 -20
  433. package/lib/hooks/useWindowSize.js.map +0 -1
  434. package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +0 -6
  435. package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +0 -1
  436. package/lib/middlewares/bookingCarRentalMiddleware.d.ts +0 -6
  437. package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +0 -1
  438. package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +0 -7
  439. package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +0 -1
  440. package/lib/middlewares/datasourcesMiddleware.d.ts +0 -6
  441. package/lib/middlewares/datasourcesMiddleware.d.ts.map +0 -1
  442. package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +0 -7
  443. package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +0 -1
@@ -1,522 +1,213 @@
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 {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'../../hooks/use-get-current-lat-long.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 {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,parseSettingPath}from'./utils/helper.js';function SettingDrawer(props) {
266
2
  const {
267
- settings,
268
- onSettingChange,
269
- hideLoading,
270
- hideColors,
271
- publicPath,
272
- hideHintAlert,
273
- hideCopyButton,
274
3
  actor,
275
4
  colorList,
276
5
  navTheme,
277
6
  pathname,
278
- location
7
+ location,
8
+ fullMenuData,
9
+ routePattern
279
10
  } = props;
280
11
  const {
281
12
  CloseIcon,
282
- Settings5FillIcon,
283
- CopyIcon,
284
- CheckIcon
13
+ Settings5FillIcon
285
14
  } = icons;
286
- const [show, setShow] = useState(false);
15
+ // Refs
16
+ const btnRef = useRef();
17
+ // Hooks
287
18
  const {
288
19
  isMobile
289
20
  } = useMediaQuery();
290
- const [copied, setCopied] = useState(false);
291
- const [copiedModified, setCopiedModified] = useState(false);
292
21
  const {
293
22
  t
294
23
  } = 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
- console.log('--STATE--', settingState);
305
- /**
306
- * Modify settings
307
- * @param key
308
- * @param value
309
- */
310
- const handleSettingChange = (key, value) => {
311
- // If the key is a layout setting, update it in the device-specific path
312
- if (key.startsWith('layout.')) {
313
- const layoutKey = key.replace('layout.', '');
24
+ // State
25
+ const [show, setShow] = useState(false);
26
+ const [activeDeviceTab, setActiveDeviceTab] = useState(isMobile ? 'mobile' : 'desktop');
27
+ const [applyToAllRoutes, setApplyToAllRoutes] = useState(false);
28
+ // Selectors - guard actor so that useSelector isn't called with undefined/invalid actor
29
+ const settingState = actor ? useSelector(actor, state => state.context.public) : {};
30
+ const changedSettings = actor ? useSelector(actor, state => state.context.internal.changedSettings) : {};
31
+ // Custom hooks
32
+ const {
33
+ copied,
34
+ copiedModified,
35
+ handleCopySettings,
36
+ handleCopyModifiedSettings,
37
+ handleSaveSettings,
38
+ handleResetSettings
39
+ } = useSettingsOperations({
40
+ actor,
41
+ settingState,
42
+ changedSettings
43
+ });
44
+ // Computed values
45
+ const currentRoute = routePattern || location?.pathname || '/';
46
+ const deviceType = activeDeviceTab;
47
+ const currentPathname = isBrowser() ? window.location.pathname : pathname || '';
48
+ const themeList = useThemeList(settingState, location, routePattern);
49
+ // Derived state
50
+ const defaultApplyToAllRoutes = React.useMemo(() => {
51
+ return getDefaultApplyToAllRoutes(settingState, currentRoute, deviceType);
52
+ }, [settingState, currentRoute, deviceType]);
53
+ const settingsForComponents = settingState;
54
+ // Effects
55
+ useEffect(() => {
56
+ setApplyToAllRoutes(defaultApplyToAllRoutes);
57
+ }, [defaultApplyToAllRoutes]);
58
+ useEffect(() => {
59
+ setActiveDeviceTab(isMobile ? 'mobile' : 'desktop');
60
+ }, [isMobile]);
61
+ useEffect(() => {
62
+ if (actor) {
314
63
  actor.send({
315
- type: 'UPDATE',
316
- value: {
317
- [`routeSettings.${currentRoute}.layout.${deviceType}.${layoutKey}`]: value
318
- }
64
+ type: 'UISETTING_UPDATE_DEVICE_TYPE',
65
+ deviceType: activeDeviceTab
319
66
  });
320
- } else {
67
+ }
68
+ }, [activeDeviceTab, actor]);
69
+ // Helper func
70
+ function handleSettingChange(key, value) {
71
+ const isGlobalSetting = key === 'hiddenMenuKeys' || key === 'hiddenMenuCategories' || key === 'applyToAllRoutes' || key === 'fixedHeader' || key === 'fixedSidebar' || key === 'splitMenus' || key === 'upperMenuDividerName' || key === 'middleMenuDividerName' || key === 'lowerMenuDividerName';
72
+ if (isGlobalSetting) {
321
73
  actor.send({
322
- type: 'UPDATE',
74
+ type: 'UISETTING_UPDATE',
323
75
  value: {
324
76
  [key]: value
325
77
  }
326
78
  });
79
+ return;
327
80
  }
328
- };
329
- const handleCopySettings = async () => {
330
- if (!isBrowser()) return;
331
- try {
332
- const settings = JSON.stringify(settingState, null, 2);
333
- await navigator.clipboard.writeText(settings);
334
- setCopied(true);
335
- setTimeout(() => setCopied(false), 2000);
336
- } catch (err) {
337
- console.error('Failed to copy settings:', err);
338
- }
339
- };
340
- const handleCopyModifiedSettings = async () => {
341
- if (!isBrowser()) return;
342
- try {
343
- const modifiedSettings = compareAndSaveSettingsDifferences(settingState, defaultSettings);
344
- const settings = JSON.stringify(modifiedSettings, null, 2);
345
- await navigator.clipboard.writeText(settings);
346
- setCopiedModified(true);
347
- setTimeout(() => setCopiedModified(false), 2000);
348
- } catch (err) {
349
- console.error('Failed to copy modified settings:', err);
350
- }
351
- };
352
- useEffect(() => {
353
- // Only update if there's a meaningful difference
354
- if (JSON.stringify(settingState) !== JSON.stringify(settings)) {
355
- oldSetting = {
356
- ...defaultSettings,
357
- ...settings
358
- };
359
- if (isBrowser()) {
360
- // Compare settings with oldSetting to determine if initialization is needed
361
- if (JSON.stringify(settings) !== JSON.stringify(oldSetting)) {
362
- initState(settings, onSettingChange, props.publicPath);
363
- }
364
- }
365
- }
366
- }, [settings]); // Only depend on settings
367
- const currentPathname = isBrowser() ? window.location.pathname : pathname || '';
368
- return jsx(Fragment, {
369
- children: settings?.showSettingPanel && jsxs(Fragment, {
370
- children: [jsx("button", {
371
- ref: btnRef,
372
- onClick: () => setShow(!show),
373
- style: {
374
- backgroundColor: settings?.primaryColor,
375
- display: 'flex',
376
- alignItems: 'center',
377
- justifyContent: 'center'
378
- },
379
- className: `fixed top-24 right-0 z-50 border-none cursor-pointer transition duration-500 w-12 h-12 rounded-l-lg hover:bg-opacity-80 ${show ? 'mr-[20rem]' : 'mr-0'}`,
380
- children: !show ? jsx(Settings5FillIcon, {
381
- fontSize: '32px',
382
- className: "text-white"
383
- }) : jsx(CloseIcon, {
384
- className: "text-white",
385
- fontSize: '36px'
386
- })
387
- }), jsxs("div", {
388
- 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'),
389
- children: [jsxs("div", {
390
- className: "flex flex-row items-center",
391
- children: [jsx("p", {
392
- className: "text-2xl mb-0 text-black dark:text-white",
393
- children: t('setting')
394
- }), jsx("div", {
395
- className: "flex-grow"
396
- }), jsx("button", {
397
- onClick: () => setShow(false),
398
- className: "bg-transparent border-none rounded-lg w-10 h-10 cursor-pointer mb-2 hover:bg-gray-200 dark:hover:bg-[#2a2a2a]",
399
- children: jsx(CloseIcon, {
400
- fontSize: '36px'
401
- })
402
- })]
403
- }), jsxs("div", {
404
- className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
405
- children: [jsx("p", {
406
- className: "text-black dark:text-white",
407
- children: t('page_style_settings')
408
- }), jsx("div", {
409
- children: jsx(CheckBoxTheme, {
410
- list: themeList.themeList,
411
- changeSetting: handleSettingChange,
412
- settings: settingState,
413
- ...props
414
- })
415
- }), jsxs("div", {
416
- className: "mt-8",
417
- children: [jsx("p", {
418
- className: "text-black dark:text-white",
419
- children: t('Select Theme')
420
- }), jsx(ThemeSelector, {
421
- value: settingState.theme || 'default',
422
- onChange: value => handleSettingChange('theme', value),
423
- options: themeOptions
424
- })]
425
- }), jsxs("div", {
426
- className: "mt-8 dark:border-[#2a2b2a]",
427
- children: [jsx("p", {
428
- className: "mb-2 text-black dark:text-white",
429
- children: t('theme_color')
430
- }), jsx(ThemeColor, {
431
- color: colorList || themeList.colorList[navTheme === 'realDark' ? 'dark' : 'light'],
432
- changeSetting: handleSettingChange,
433
- settings: settingState
434
- })]
435
- }), jsxs("div", {
436
- className: "mt-8",
437
- children: [jsx("p", {
438
- className: "text-black dark:text-white",
439
- children: t('Font Family')
440
- }), jsx(WebFontsSelector, {
441
- value: settingState.fontFamily || 'Poppins, sans-serif',
442
- onChange: value => handleSettingChange('fontFamily', value),
443
- options: fontOptions
444
- })]
445
- })]
446
- }), jsxs("div", {
447
- className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
448
- children: [jsx(NavigationModes, {
449
- settings: settingState,
450
- changeSetting: handleSettingChange,
451
- ...props
452
- }), jsx("div", {
453
- className: "mt-8",
454
- children: jsx(LayoutChange, {
455
- settings: settingState,
456
- changeSetting: handleSettingChange,
457
- ...props
458
- })
459
- })]
460
- }), jsxs("div", {
461
- className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
462
- children: [jsx("p", {
463
- className: "mb-2 text-black dark:text-white",
464
- children: t('regional_rettings')
465
- }), jsx(RegionalSettings, {
466
- settings: settingState,
467
- changeSetting: handleSettingChange,
468
- ...props
469
- })]
470
- }), jsx("div", {
471
- className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
472
- children: jsx(AdditionalSettingsSlot, {
473
- settings: settingState,
474
- onSettingsChange: handleSettingChange,
475
- pathname: currentPathname
476
- })
477
- }), jsxs("div", {
478
- className: "bg-yellow-50 dark:bg-yellow-900 border border-yellow-200 dark:border-yellow-700 rounded-lg p-4 mt-4",
479
- children: [jsx("p", {
480
- className: "text-sm text-yellow-700 dark:text-yellow-200",
481
- children: "Setting panel shows in development environment only, please manually modify"
482
- }), jsxs("div", {
483
- className: "flex flex-wrap gap-2 mt-2",
484
- children: [jsx("button", {
485
- 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'),
486
- onClick: handleCopySettings,
487
- children: copied ? jsxs(Fragment, {
488
- children: [jsx(CheckIcon, {
489
- className: "w-4 h-4"
490
- }), jsx("span", {
491
- children: "Copied!"
492
- })]
493
- }) : jsxs(Fragment, {
494
- children: [jsx(CopyIcon, {
495
- className: "w-4 h-4"
496
- }), jsx("span", {
497
- children: "Copy All Settings"
498
- })]
499
- })
500
- }), jsx("button", {
501
- 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'),
502
- onClick: handleCopyModifiedSettings,
503
- children: copiedModified ? jsxs(Fragment, {
504
- children: [jsx(CheckIcon, {
505
- className: "w-4 h-4"
506
- }), jsx("span", {
507
- children: "Copied!"
508
- })]
509
- }) : jsxs(Fragment, {
510
- children: [jsx(CopyIcon, {
511
- className: "w-4 h-4"
512
- }), jsx("span", {
513
- children: "Copy Modified Settings"
514
- })]
515
- })
516
- })]
517
- })]
518
- })]
519
- })]
520
- })
521
- });
522
- };export{SettingDrawer};//# sourceMappingURL=SettingDrawer.js.map
81
+ const bracketKey = applyToAllRoutes ? `[${deviceType}]` : `[${currentRoute}][${deviceType}]`;
82
+ const settingObject = parseSettingPath(key, value);
83
+ const nestedValue = {
84
+ [bracketKey]: settingObject
85
+ };
86
+ actor.send({
87
+ type: 'UISETTING_UPDATE',
88
+ value: nestedValue
89
+ });
90
+ }
91
+ function getThemeValue() {
92
+ return getSettingValue(settingState, 'theme', applyToAllRoutes, currentRoute, deviceType, 'default');
93
+ }
94
+ function getFontFamilyValue() {
95
+ return getSettingValue(settingState, 'fontFamily', applyToAllRoutes, currentRoute, deviceType, 'Poppins, sans-serif');
96
+ }
97
+ return React.createElement(React.Fragment, null, settingState?.showSettingPanel && React.createElement(React.Fragment, null, React.createElement("button", {
98
+ ref: btnRef,
99
+ onClick: () => setShow(!show),
100
+ style: {
101
+ backgroundColor: settingState?.primaryColor,
102
+ display: 'flex',
103
+ alignItems: 'center',
104
+ justifyContent: 'center'
105
+ },
106
+ className: `fixed top-24 right-0 z-50 border-none cursor-pointer transition duration-500 w-12 h-12 rounded-l-lg hover:bg-opacity-80 ${show ? 'mr-[20rem]' : 'mr-0'}`
107
+ }, !show ? React.createElement(Settings5FillIcon, {
108
+ fontSize: '32px',
109
+ className: "text-white"
110
+ }) : React.createElement(CloseIcon, {
111
+ className: "text-white",
112
+ fontSize: '36px'
113
+ })), React.createElement("div", {
114
+ 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')
115
+ }, React.createElement(SettingsDrawerHeader, {
116
+ onClose: () => setShow(false)
117
+ }), React.createElement("div", {
118
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]"
119
+ }, React.createElement(MenuVisibilitySettings, {
120
+ fullMenuData: fullMenuData,
121
+ settings: settingState,
122
+ changeSetting: handleSettingChange
123
+ }), React.createElement(ApplyToAllRoutesToggle, {
124
+ checked: applyToAllRoutes,
125
+ onChange: setApplyToAllRoutes
126
+ }), React.createElement(DeviceTabs, {
127
+ activeTab: activeDeviceTab,
128
+ onTabChange: setActiveDeviceTab
129
+ })), React.createElement("div", {
130
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]"
131
+ }, React.createElement("p", {
132
+ className: "text-black dark:text-white"
133
+ }, t('page_style_settings')), React.createElement("div", null, React.createElement(CheckBoxTheme, {
134
+ list: themeList.themeList,
135
+ changeSetting: handleSettingChange,
136
+ settings: settingsForComponents,
137
+ location: location,
138
+ applyToAllRoutes: applyToAllRoutes
139
+ })), React.createElement("div", {
140
+ className: "mt-8"
141
+ }, React.createElement("p", {
142
+ className: "text-black dark:text-white"
143
+ }, t('Select Theme')), React.createElement(ThemeSelector, {
144
+ value: getThemeValue(),
145
+ onChange: value => handleSettingChange('theme', value),
146
+ options: THEME_OPTIONS
147
+ })), React.createElement("div", {
148
+ className: "mt-8 dark:border-[#2a2b2a]"
149
+ }, React.createElement("p", {
150
+ className: "mb-2 text-black dark:text-white"
151
+ }, t('theme_color')), React.createElement(ThemeColor, {
152
+ color: colorList || themeList.colorList[navTheme === 'realDark' ? 'dark' : 'light'],
153
+ changeSetting: handleSettingChange,
154
+ settings: settingsForComponents,
155
+ location: location,
156
+ routePattern: routePattern,
157
+ applyToAllRoutes: applyToAllRoutes
158
+ })), React.createElement("div", {
159
+ className: "mt-8"
160
+ }, React.createElement("p", {
161
+ className: "text-black dark:text-white"
162
+ }, t('Font Family')), React.createElement(WebFontsSelector, {
163
+ value: getFontFamilyValue(),
164
+ onChange: value => handleSettingChange('fontFamily', value),
165
+ options: FONT_OPTIONS
166
+ }))), React.createElement("div", {
167
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]"
168
+ }, React.createElement(NavigationModes, {
169
+ settings: settingsForComponents,
170
+ changeSetting: handleSettingChange,
171
+ applyToAllRoutes: applyToAllRoutes,
172
+ location: location,
173
+ routePattern: routePattern
174
+ }), React.createElement("div", {
175
+ className: "mt-8"
176
+ }, React.createElement(LayoutChange, {
177
+ settings: settingsForComponents,
178
+ changeSetting: handleSettingChange,
179
+ applyToAllRoutes: applyToAllRoutes,
180
+ location: location,
181
+ routePattern: routePattern
182
+ })), React.createElement("div", {
183
+ className: "mt-8"
184
+ }, React.createElement(InvitationSettings, {
185
+ settings: settingsForComponents,
186
+ changeSetting: handleSettingChange,
187
+ location: location,
188
+ routePattern: routePattern,
189
+ applyToAllRoutes: applyToAllRoutes
190
+ }))), React.createElement("div", {
191
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]"
192
+ }, React.createElement(RegionalSettings, {
193
+ settings: settingsForComponents,
194
+ changeSetting: handleSettingChange,
195
+ applyToAllRoutes: applyToAllRoutes,
196
+ location: location,
197
+ routePattern: routePattern
198
+ })), React.createElement("div", {
199
+ className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]"
200
+ }, React.createElement(AdditionalSettingsSlot, {
201
+ settings: settingsForComponents,
202
+ onSettingsChange: handleSettingChange,
203
+ pathname: currentPathname
204
+ })), React.createElement(SettingsActions, {
205
+ hasChanges: changedSettings && Object.keys(changedSettings).length > 0,
206
+ copied: copied,
207
+ copiedModified: copiedModified,
208
+ onSave: handleSaveSettings,
209
+ onCopyAll: handleCopySettings,
210
+ onCopyModified: handleCopyModifiedSettings,
211
+ onReset: handleResetSettings
212
+ }))));
213
+ }export{SettingDrawer};//# sourceMappingURL=SettingDrawer.js.map