@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.
- package/lib/cdm-locales/en/menu.json +2 -1
- package/lib/cdm-locales/es/menu.json +2 -1
- package/lib/cdm-locales/index.d.ts +2 -0
- package/lib/cdm-locales/index.d.ts.map +1 -0
- package/lib/cdm-locales/index.ts +1 -0
- package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
- package/lib/components/LanguageMenu/LanguageMenu.js +16 -20
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +6 -5
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +220 -124
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.d.ts +2 -0
- package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +16 -13
- package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +9 -14
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +0 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +38 -10
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +0 -2
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.js +54 -85
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js +73 -6
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.js +2 -4
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/index.d.ts +0 -1
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +69 -7
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js +330 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebar.js +246 -0
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +467 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +279 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +332 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +29 -10
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderNotice.js +7 -0
- package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
- package/lib/components/Layout/slot-fill/Logo.d.ts +4 -0
- package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/Logo.js +7 -0
- package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +4 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
- package/lib/components/Layout/slot-fill/index.d.ts +2 -0
- package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
- package/lib/components/Layout/util.js +1 -1
- package/lib/components/Layout/util.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -3
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +166 -416
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +7 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +30 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +3 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{CheckBoxTheme.js → components/CheckBoxTheme.js} +14 -5
- package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +7 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js +82 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{InvitationSettings.js → components/InvitationSettings.js} +11 -7
- package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts +3 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{LayoutChange.js → components/LayoutChange.js} +24 -17
- package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +20 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +119 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +3 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{NavigationsModes.js → components/NavigationsModes.js} +91 -40
- package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{RegionalSettings.js → components/RegionalSettings.js} +55 -178
- package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts +12 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js +69 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +4 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +25 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
- package/lib/components/SettingDrawer/{Switch/index.d.ts → components/Switch.d.ts} +2 -2
- package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{Switch/index.js → components/Switch.js} +1 -1
- package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts +3 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{ThemeColor.js → components/ThemeColor.js} +16 -4
- package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
- package/lib/components/SettingDrawer/{ThemeSelector.d.ts → components/ThemeSelector.d.ts} +1 -1
- package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +119 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.js +77 -0
- package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.js +243 -0
- package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.js +76 -0
- package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
- package/lib/components/SettingDrawer/{types.d.ts → utils/types.d.ts} +14 -0
- package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +10 -5
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/typings.d.ts +20 -1
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +10 -2
- package/lib/compute.js.map +1 -1
- package/lib/config/constants.js.map +1 -1
- package/lib/config/env-config.d.ts +3 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +10 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/helpers/DynamicIcon.js.map +1 -1
- package/lib/hooks/useMediaQuery.js.map +1 -1
- package/lib/hooks/useScrollThreshold.js.map +1 -1
- package/lib/hooks/useTailwindTheme.js +82 -0
- package/lib/hooks/useTailwindTheme.js.map +1 -0
- package/lib/icons.d.ts +2 -0
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +4 -2
- package/lib/icons.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/machines/selectors.d.ts +118 -0
- package/lib/machines/selectors.d.ts.map +1 -0
- package/lib/machines/settingsMachine.d.ts +25 -2
- package/lib/machines/settingsMachine.d.ts.map +1 -1
- package/lib/machines/settingsMachine.js +139 -168
- package/lib/machines/settingsMachine.js.map +1 -1
- package/lib/machines/settingsMachine.test.d.ts +2 -0
- package/lib/machines/settingsMachine.test.d.ts.map +1 -0
- package/lib/machines/types.d.ts +107 -9
- package/lib/machines/types.d.ts.map +1 -1
- package/lib/machines/types.js.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/redux/searchReducer.js.map +1 -1
- package/lib/routes.json +9 -1
- package/lib/tailwindConfig.js.map +1 -1
- package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
- package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
- package/lib/utils/configOverrides.d.ts +213 -0
- package/lib/utils/configOverrides.d.ts.map +1 -0
- package/lib/utils/configOverrides.js +91 -0
- package/lib/utils/configOverrides.js.map +1 -0
- package/lib/utils/isBrowser/index.js.map +1 -1
- package/lib/utils/settingsUtils.d.ts +20 -0
- package/lib/utils/settingsUtils.d.ts.map +1 -0
- package/lib/utils/settingsUtils.js +74 -0
- package/lib/utils/settingsUtils.js.map +1 -0
- package/lib/utils/utils/index.js.map +1 -1
- package/package.json +6 -6
- package/lib/components/Layout/GlobalHeader/Logo.d.ts +0 -4
- package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +0 -1
- package/lib/components/Layout/GlobalHeader/Logo.js +0 -141
- package/lib/components/Layout/GlobalHeader/Logo.js.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +0 -180
- package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -176
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -3
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts +0 -3
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +0 -1
- package/lib/components/SettingDrawer/InvitationSettings.js.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -3
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +0 -3
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +0 -1
- package/lib/components/SettingDrawer/NavigationsModes.js.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -3
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -3
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
- package/lib/components/SettingDrawer/ThemeSelector.d.ts.map +0 -1
- package/lib/components/SettingDrawer/ThemeSelector.js.map +0 -1
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts +0 -3
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +0 -1
- package/lib/components/SettingDrawer/WebFontsSelector.js.map +0 -1
- package/lib/components/SettingDrawer/types.d.ts.map +0 -1
- /package/lib/components/SettingDrawer/{ThemeSelector.js → components/ThemeSelector.js} +0 -0
- /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,
|
|
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
|
-
|
|
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
|
-
|
|
296
|
-
const
|
|
297
|
-
const
|
|
298
|
-
const
|
|
299
|
-
//
|
|
300
|
-
|
|
301
|
-
const
|
|
302
|
-
//
|
|
303
|
-
const
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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: '
|
|
315
|
-
|
|
316
|
-
|
|
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: '
|
|
120
|
+
type: 'UISETTING_UPDATE',
|
|
322
121
|
value: {
|
|
323
122
|
[key]: value
|
|
324
123
|
}
|
|
325
124
|
});
|
|
125
|
+
return;
|
|
326
126
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
const
|
|
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:
|
|
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:
|
|
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: [
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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:
|
|
412
|
-
|
|
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:
|
|
195
|
+
value: getThemeValue(),
|
|
421
196
|
onChange: value => handleSettingChange('theme', value),
|
|
422
|
-
options:
|
|
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:
|
|
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:
|
|
218
|
+
value: getFontFamilyValue(),
|
|
441
219
|
onChange: value => handleSettingChange('fontFamily', value),
|
|
442
|
-
options:
|
|
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:
|
|
226
|
+
settings: settingsForComponents,
|
|
449
227
|
changeSetting: handleSettingChange,
|
|
450
|
-
|
|
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:
|
|
234
|
+
settings: settingsForComponents,
|
|
455
235
|
changeSetting: handleSettingChange,
|
|
456
|
-
|
|
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:
|
|
243
|
+
settings: settingsForComponents,
|
|
462
244
|
changeSetting: handleSettingChange,
|
|
463
|
-
location: location
|
|
245
|
+
location: location,
|
|
246
|
+
routePattern: routePattern,
|
|
247
|
+
applyToAllRoutes: applyToAllRoutes
|
|
464
248
|
})
|
|
465
249
|
})]
|
|
466
|
-
}),
|
|
250
|
+
}), jsx("div", {
|
|
467
251
|
className: "mt-8 pb-8 border-b border-black dark:border-[#2a2b2a]",
|
|
468
|
-
children:
|
|
469
|
-
|
|
470
|
-
children: t('regional_rettings')
|
|
471
|
-
}), jsx(RegionalSettings, {
|
|
472
|
-
settings: settingState,
|
|
252
|
+
children: jsx(RegionalSettings, {
|
|
253
|
+
settings: settingsForComponents,
|
|
473
254
|
changeSetting: handleSettingChange,
|
|
474
|
-
|
|
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:
|
|
262
|
+
settings: settingsForComponents,
|
|
480
263
|
onSettingsChange: handleSettingChange,
|
|
481
264
|
pathname: currentPathname
|
|
482
265
|
})
|
|
483
|
-
}),
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
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
|
-
}
|
|
278
|
+
}export{SettingDrawer};//# sourceMappingURL=SettingDrawer.js.map
|