@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
package/lib/icons.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../src/icons.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;CAgBjB,CAAC"}
|
package/lib/icons.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {FaSearch}from'@react-icons/all-files/fa/FaSearch.js';import {IoMenu}from'@react-icons/all-files/io5/IoMenu.js';import'@react-icons/all-files/ai/AiOutlineDash.js';import {FaChevronDown}from'@react-icons/all-files/fa/FaChevronDown.js';import {FaChevronUp}from'@react-icons/all-files/fa/FaChevronUp.js';import {FaChevronRight}from'@react-icons/all-files/fa/FaChevronRight.js';import {FaChevronLeft}from'@react-icons/all-files/fa/FaChevronLeft.js';import {MdClose}from'@react-icons/all-files/md/MdClose.js';import {RiSettings5Fill}from'@react-icons/all-files/ri/RiSettings5Fill.js';import {IoMdCopy}from'@react-icons/all-files/io/IoMdCopy.js';import {FaCheck}from'@react-icons/all-files/fa/FaCheck.js';import'@react-icons/all-files/io5/IoChevronBackCircleOutline.js';import'@react-icons/all-files/io5/IoChevronForwardCircleOutline.js';const icons = {
|
|
1
|
+
import {FaSearch}from'@react-icons/all-files/fa/FaSearch.js';import {IoMenu}from'@react-icons/all-files/io5/IoMenu.js';import'@react-icons/all-files/ai/AiOutlineDash.js';import {FaChevronDown}from'@react-icons/all-files/fa/FaChevronDown.js';import {FaChevronUp}from'@react-icons/all-files/fa/FaChevronUp.js';import {FaChevronRight}from'@react-icons/all-files/fa/FaChevronRight.js';import {FaChevronLeft}from'@react-icons/all-files/fa/FaChevronLeft.js';import {MdClose}from'@react-icons/all-files/md/MdClose.js';import {RiSettings5Fill}from'@react-icons/all-files/ri/RiSettings5Fill.js';import {IoMdCopy}from'@react-icons/all-files/io/IoMdCopy.js';import {FaCheck}from'@react-icons/all-files/fa/FaCheck.js';import'@react-icons/all-files/io5/IoChevronBackCircleOutline.js';import'@react-icons/all-files/io5/IoChevronForwardCircleOutline.js';import {RiPushpinLine}from'@react-icons/all-files/ri/RiPushpinLine.js';import {RiPushpinFill}from'@react-icons/all-files/ri/RiPushpinFill.js';const icons = {
|
|
2
2
|
SearchIcon: FaSearch,
|
|
3
3
|
ChevronDownIcon: FaChevronDown,
|
|
4
4
|
ChevronRightIcon: FaChevronRight,
|
|
@@ -8,5 +8,7 @@ import {FaSearch}from'@react-icons/all-files/fa/FaSearch.js';import {IoMenu}from
|
|
|
8
8
|
CopyIcon: IoMdCopy,
|
|
9
9
|
CheckIcon: FaCheck,
|
|
10
10
|
ChevronUpIcon: FaChevronUp,
|
|
11
|
-
ChevronLeftIcon: FaChevronLeft
|
|
11
|
+
ChevronLeftIcon: FaChevronLeft,
|
|
12
|
+
PushpinLineIcon: RiPushpinLine,
|
|
13
|
+
PushpinFillIcon: RiPushpinFill
|
|
12
14
|
};export{icons};//# sourceMappingURL=icons.js.map
|
package/lib/icons.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icons.js","sources":["../src/icons.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icons.js","sources":["../src/icons.ts"],"sourcesContent":[null],"names":[],"mappings":"q9BAgBO,MAAM,KAAK,GAAG;sBACjB;gCACA;kCACA;kBACA;oBAEA;oCACA;oBACA;oBACA;4BAGA;gCACA;gCACA;;"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;;AAExB,wBAAqC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,cAAc,kBAAkB,CAAC;AACjC,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;;AAExB,wBAAqC"}
|
package/lib/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {Feature}from'@common-stack/client-react';import settings from'./module.js';export{themeConfig}from'./tailwindConfig.js';export{SEARCH_ACTIONS,clearSearch,searchReducer,setSearchError,setSearchQuery,setSearchResult}from'./redux/searchReducer.js';// eslint-disable-next-line import/no-extraneous-dependencies
|
|
1
|
+
import {Feature}from'@common-stack/client-react';import settings from'./module.js';export{themeConfig}from'./tailwindConfig.js';export{SEARCH_ACTIONS,clearSearch,searchReducer,setSearchError,setSearchQuery,setSearchResult}from'./redux/searchReducer.js';export{useTailwindTheme}from'./hooks/useTailwindTheme.js';export{useMediaQuery}from'./hooks/useMediaQuery.js';// eslint-disable-next-line import/no-extraneous-dependencies
|
|
2
2
|
var index = new Feature(settings);export{index as default};//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":[null],"names":[],"mappings":"2WAAA;AAOA,YAAe,IAAI,OAAO,CAAC,QAAQ,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { UISettings } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* XSTATE SELECTORS
|
|
4
|
+
*
|
|
5
|
+
* These selector functions provide STABLE references to state values,
|
|
6
|
+
* preventing unnecessary re-renders and eliminating infinite loop possibilities.
|
|
7
|
+
*
|
|
8
|
+
* IMPORTANT RULES:
|
|
9
|
+
* 1. Components should ONLY use these selectors to access state
|
|
10
|
+
* 2. NEVER access state.context directly
|
|
11
|
+
* 3. Selectors only return PUBLIC settings - internal state is never exposed
|
|
12
|
+
* 4. XState's useSelector hook memoizes these, ensuring stable references
|
|
13
|
+
*
|
|
14
|
+
* WHY THIS WORKS:
|
|
15
|
+
* - Even if context.internal.configModel changes (new reference),
|
|
16
|
+
* context.public remains stable (same values = same reference after JSON comparison)
|
|
17
|
+
* - useSelector only triggers re-render if the RETURNED value changes
|
|
18
|
+
* - No manual filtering needed - separation is built into the structure
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Select all UI settings (excludes internal machine state)
|
|
22
|
+
*
|
|
23
|
+
* This is the primary selector for getting user-facing settings.
|
|
24
|
+
* XState's useSelector will automatically memoize this, so it only
|
|
25
|
+
* re-renders when the UI settings actually change.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* const settings = useSelector(actor, selectPublicSettings);
|
|
29
|
+
*/
|
|
30
|
+
export declare const selectPublicSettings: (state: any) => UISettings;
|
|
31
|
+
/**
|
|
32
|
+
* Select only changed settings (for save button state).
|
|
33
|
+
* Use this to check if there are unsaved changes.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* const changedSettings = useSelector(actor, selectChangedSettings);
|
|
37
|
+
* const hasChanges = Object.keys(changedSettings).length > 0;
|
|
38
|
+
*/
|
|
39
|
+
export declare const selectChangedSettings: (state: any) => Record<string, any>;
|
|
40
|
+
/**
|
|
41
|
+
* Select current device type (desktop/mobile).
|
|
42
|
+
* Use this to check which device mode is active.
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* const deviceType = useSelector(actor, selectDeviceType);
|
|
46
|
+
*/
|
|
47
|
+
export declare const selectDeviceType: (state: any) => "desktop" | "mobile";
|
|
48
|
+
/**
|
|
49
|
+
* Select current route path.
|
|
50
|
+
* Use this to check which route is active.
|
|
51
|
+
*
|
|
52
|
+
* @example
|
|
53
|
+
* const currentRoute = useSelector(actor, selectCurrentRoute);
|
|
54
|
+
*/
|
|
55
|
+
export declare const selectCurrentRoute: (state: any) => string;
|
|
56
|
+
/**
|
|
57
|
+
* Select a specific setting by key.
|
|
58
|
+
* Returns a selector function that extracts a specific setting value.
|
|
59
|
+
*
|
|
60
|
+
* @example
|
|
61
|
+
* const navTheme = useSelector(actor, selectSetting('navTheme'));
|
|
62
|
+
* const primaryColor = useSelector(actor, selectSetting('primaryColor'));
|
|
63
|
+
*/
|
|
64
|
+
export declare const selectSetting: (key: keyof UISettings) => (state: any) => any;
|
|
65
|
+
/**
|
|
66
|
+
* Select navigation theme specifically.
|
|
67
|
+
* Commonly used setting, provided as convenience.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* const navTheme = useSelector(actor, selectNavTheme);
|
|
71
|
+
*/
|
|
72
|
+
export declare const selectNavTheme: (state: any) => "light" | "dark" | "realDark";
|
|
73
|
+
/**
|
|
74
|
+
* Select primary color specifically.
|
|
75
|
+
* Commonly used setting, provided as convenience.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* const primaryColor = useSelector(actor, selectPrimaryColor);
|
|
79
|
+
*/
|
|
80
|
+
export declare const selectPrimaryColor: (state: any) => string;
|
|
81
|
+
/**
|
|
82
|
+
* Select whether settings panel should be shown.
|
|
83
|
+
* Use this to control settings drawer visibility.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* const showSettingPanel = useSelector(actor, selectShowSettingPanel);
|
|
87
|
+
*/
|
|
88
|
+
export declare const selectShowSettingPanel: (state: any) => boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Select menu visibility settings.
|
|
91
|
+
* Returns both hiddenMenuKeys and hiddenMenuCategories.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* const { hiddenMenuKeys, hiddenMenuCategories } = useSelector(actor, selectMenuVisibility);
|
|
95
|
+
*/
|
|
96
|
+
export declare const selectMenuVisibility: (state: any) => {
|
|
97
|
+
hiddenMenuKeys: string[];
|
|
98
|
+
hiddenMenuCategories: string[];
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Check if there are unsaved changes.
|
|
102
|
+
* Use this for save button disabled state.
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* const hasUnsavedChanges = useSelector(actor, selectHasUnsavedChanges);
|
|
106
|
+
*/
|
|
107
|
+
export declare const selectHasUnsavedChanges: (state: any) => boolean;
|
|
108
|
+
/**
|
|
109
|
+
* COMPARISON HELPER
|
|
110
|
+
*
|
|
111
|
+
* Use this to compare settings between renders without triggering infinite loops.
|
|
112
|
+
* This performs a deep comparison of UI settings only.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* const settingsChanged = !areUISettingsEqual(prevSettings, currentSettings);
|
|
116
|
+
*/
|
|
117
|
+
export declare const areUISettingsEqual: (a: UISettings, b: UISettings) => boolean;
|
|
118
|
+
//# sourceMappingURL=selectors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectors.d.ts","sourceRoot":"","sources":["../../src/machines/selectors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,UAAU,EAAwB,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PLETELY REFACTORED
|
|
4
|
+
*
|
|
5
|
+
* DESIGN PHILOSOPHY:
|
|
6
|
+
* This machine has been completely rewritten to eliminate any possibility of infinite loops
|
|
7
|
+
* by enforcing a strict separation between:
|
|
8
|
+
* 1. PUBLIC STATE: User-facing settings (stable, exposed to consumers)
|
|
9
|
+
* 2. INTERNAL STATE: Machine logic state (may have reference changes, never exposed)
|
|
10
|
+
*
|
|
11
|
+
* ARCHITECTURE:
|
|
12
|
+
* - Context is split into `public` and `internal` namespaces
|
|
13
|
+
* - Components ONLY access `context.public` via selectors
|
|
14
|
+
* - NO filtering is needed - separation is built into the structure
|
|
15
|
+
* - ConfigurationModel reference changes are isolated to `context.internal`
|
|
16
|
+
* - Redux receives ONLY `context.public` - no manual filtering required
|
|
17
|
+
*
|
|
18
|
+
* WHY THIS WORKS:
|
|
19
|
+
* - Reference changes in `context.internal.configModel` don't affect `context.public`
|
|
20
|
+
* - Components using selectors get stable references to `context.public`
|
|
21
|
+
* - No manual filtering means no chance of accidentally exposing internal state
|
|
22
|
+
* - Type system enforces the separation at compile time
|
|
23
|
+
*/
|
|
2
24
|
export declare const settingsMachine: import("xstate").StateMachine<SettingsContext, MachineEvent, Record<string, import("xstate").AnyActorRef>, import("xstate").ProvidedActor, import("xstate").ParameterizedObject, import("xstate").ParameterizedObject, string, import("xstate").StateValue, string, {
|
|
3
|
-
settings:
|
|
4
|
-
|
|
25
|
+
settings: any;
|
|
26
|
+
currentRoute?: string;
|
|
27
|
+
routePattern?: string;
|
|
5
28
|
}, {}, import("xstate").EventObject, import("xstate").MetaObject, any>;
|
|
6
29
|
//# sourceMappingURL=settingsMachine.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsMachine.d.ts","sourceRoot":"","sources":["../../src/machines/settingsMachine.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settingsMachine.d.ts","sourceRoot":"","sources":["../../src/machines/settingsMachine.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,eAAe,EAAoC,MAAM,SAAS,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,eAAO,MAAM,eAAe;cAMN,GAAG;mBACE,MAAM;mBACN,MAAM;sEAkL/B,CAAC"}
|
|
@@ -1,85 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
showSearchSlot: true,
|
|
24
|
-
showRightContent: true,
|
|
25
|
-
showMenuToggle: true,
|
|
26
|
-
showBackButton: true,
|
|
27
|
-
showPageTitle: true,
|
|
28
|
-
showActionButtons: true,
|
|
29
|
-
position: 'fixed',
|
|
30
|
-
height: '64px',
|
|
31
|
-
elevation: 2,
|
|
32
|
-
showHeader: true,
|
|
33
|
-
showMenu: true,
|
|
34
|
-
menuHeaderRender: true,
|
|
35
|
-
searchBarRender: true,
|
|
36
|
-
searchBarBehavior: SearchBarBehavior.PERMANENT,
|
|
37
|
-
searchBarOverlay: true,
|
|
38
|
-
scrollThreshold: 50
|
|
39
|
-
};
|
|
40
|
-
// Shared view configuration similar to client's defaultSettings
|
|
41
|
-
const SHARED_VIEW_CONFIG = {
|
|
42
|
-
layout: DEFAULT_LAYOUT,
|
|
43
|
-
regions: {
|
|
44
|
-
header: DEFAULT_HEADER,
|
|
45
|
-
footer: {
|
|
46
|
-
showFooter: true
|
|
47
|
-
},
|
|
48
|
-
background: DEFAULT_BACKGROUND
|
|
49
|
-
}
|
|
50
|
-
};
|
|
51
|
-
const defaultRouteSettings = {
|
|
52
|
-
layout: {
|
|
53
|
-
desktop: SHARED_VIEW_CONFIG.layout,
|
|
54
|
-
mobile: SHARED_VIEW_CONFIG.layout
|
|
55
|
-
},
|
|
56
|
-
regions: {
|
|
57
|
-
desktop: {
|
|
58
|
-
header: SHARED_VIEW_CONFIG.regions.header,
|
|
59
|
-
footer: SHARED_VIEW_CONFIG.regions.footer,
|
|
60
|
-
background: SHARED_VIEW_CONFIG.regions.background
|
|
61
|
-
},
|
|
62
|
-
mobile: {
|
|
63
|
-
header: SHARED_VIEW_CONFIG.regions.header,
|
|
64
|
-
footer: SHARED_VIEW_CONFIG.regions.footer,
|
|
65
|
-
background: SHARED_VIEW_CONFIG.regions.background
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
};
|
|
69
|
-
// Helper function to deep merge objects
|
|
70
|
-
const deepMerge = (target, source) => {
|
|
71
|
-
const result = {
|
|
72
|
-
...target
|
|
73
|
-
};
|
|
74
|
-
for (const key in source) {
|
|
75
|
-
if (source[key] instanceof Object && key in target) {
|
|
76
|
-
result[key] = deepMerge(target[key], source[key]);
|
|
77
|
-
} else {
|
|
78
|
-
result[key] = source[key];
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return result;
|
|
82
|
-
};
|
|
1
|
+
import {cloneDeep,merge}from'lodash-es';import {createMachine,assign}from'xstate';import {extractConfigurationWithModel}from'@adminide-stack/core';/**
|
|
2
|
+
* SETTINGS MACHINE - COMPLETELY REFACTORED
|
|
3
|
+
*
|
|
4
|
+
* DESIGN PHILOSOPHY:
|
|
5
|
+
* This machine has been completely rewritten to eliminate any possibility of infinite loops
|
|
6
|
+
* by enforcing a strict separation between:
|
|
7
|
+
* 1. PUBLIC STATE: User-facing settings (stable, exposed to consumers)
|
|
8
|
+
* 2. INTERNAL STATE: Machine logic state (may have reference changes, never exposed)
|
|
9
|
+
*
|
|
10
|
+
* ARCHITECTURE:
|
|
11
|
+
* - Context is split into `public` and `internal` namespaces
|
|
12
|
+
* - Components ONLY access `context.public` via selectors
|
|
13
|
+
* - NO filtering is needed - separation is built into the structure
|
|
14
|
+
* - ConfigurationModel reference changes are isolated to `context.internal`
|
|
15
|
+
* - Redux receives ONLY `context.public` - no manual filtering required
|
|
16
|
+
*
|
|
17
|
+
* WHY THIS WORKS:
|
|
18
|
+
* - Reference changes in `context.internal.configModel` don't affect `context.public`
|
|
19
|
+
* - Components using selectors get stable references to `context.public`
|
|
20
|
+
* - No manual filtering means no chance of accidentally exposing internal state
|
|
21
|
+
* - Type system enforces the separation at compile time
|
|
22
|
+
*/
|
|
83
23
|
const settingsMachine = createMachine({
|
|
84
24
|
id: 'settings',
|
|
85
25
|
types: {},
|
|
@@ -87,119 +27,150 @@ const settingsMachine = createMachine({
|
|
|
87
27
|
context: ({
|
|
88
28
|
input
|
|
89
29
|
}) => {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
verifyFormVisibleFields: defaultSettings.verifyFormVisibleFields,
|
|
117
|
-
verifyFormShowSkipButton: defaultSettings.verifyFormShowSkipButton,
|
|
118
|
-
components: [],
|
|
119
|
-
activeComponent: null,
|
|
120
|
-
currentRoute: input?.settings?.currentRoute || '/',
|
|
121
|
-
routeSettings: {
|
|
122
|
-
'/': defaultRouteSettings
|
|
123
|
-
}
|
|
124
|
-
}, input?.settings);
|
|
30
|
+
const rawSettings = input?.settings || {};
|
|
31
|
+
// ConfigurationModel handles ALL bracket patterns automatically
|
|
32
|
+
const {
|
|
33
|
+
model: configModel
|
|
34
|
+
} = extractConfigurationWithModel(rawSettings);
|
|
35
|
+
const deviceType = 'desktop';
|
|
36
|
+
const routePattern = input?.routePattern || input?.currentRoute || '/';
|
|
37
|
+
// Apply overrides by chaining: base -> device -> route+device
|
|
38
|
+
const deviceOverride = configModel.override([routePattern, deviceType], {
|
|
39
|
+
strict: true
|
|
40
|
+
});
|
|
41
|
+
const effectiveSettings = deviceOverride.getValue('');
|
|
42
|
+
// Build INTERNAL state (machine only, never exposed)
|
|
43
|
+
const internalState = {
|
|
44
|
+
configModel,
|
|
45
|
+
deviceType,
|
|
46
|
+
currentRoute: input?.currentRoute || '/',
|
|
47
|
+
routePattern: input?.routePattern,
|
|
48
|
+
changedSettings: {},
|
|
49
|
+
currentChangedSetting: {}
|
|
50
|
+
};
|
|
51
|
+
const context = {
|
|
52
|
+
public: effectiveSettings,
|
|
53
|
+
internal: internalState
|
|
54
|
+
};
|
|
55
|
+
return context;
|
|
125
56
|
},
|
|
126
57
|
states: {
|
|
127
58
|
idle: {
|
|
59
|
+
entry: ['updateReduxSettings'],
|
|
128
60
|
on: {
|
|
129
|
-
|
|
61
|
+
UISETTING_UPDATE: {
|
|
130
62
|
actions: [assign(({
|
|
131
63
|
context,
|
|
132
64
|
event
|
|
133
65
|
}) => {
|
|
134
66
|
if (!event.value) return context;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
//
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
67
|
+
console.log('1️⃣ UISETTING_UPDATE state trigger:', event);
|
|
68
|
+
// Clone context to avoid mutations
|
|
69
|
+
const newContext = cloneDeep(context);
|
|
70
|
+
// 1. Extract the configuration model from the new value
|
|
71
|
+
const {
|
|
72
|
+
model: updateModel
|
|
73
|
+
} = extractConfigurationWithModel(event.value);
|
|
74
|
+
// 2. Merge the new settings into existing config
|
|
75
|
+
newContext.internal.configModel = newContext.internal.configModel.merge(updateModel);
|
|
76
|
+
// 3. Track what changed (for saving to cookie later & save button)
|
|
77
|
+
newContext.internal.currentChangedSetting = event.value;
|
|
78
|
+
newContext.internal.changedSettings = merge({}, newContext.internal.changedSettings, event.value);
|
|
79
|
+
// 4. Reapply settings for current route
|
|
80
|
+
const routePattern = newContext.internal.routePattern || newContext.internal.currentRoute;
|
|
81
|
+
const deviceOverride = newContext.internal.configModel.override([routePattern, newContext.internal.deviceType], {
|
|
82
|
+
strict: true
|
|
151
83
|
});
|
|
84
|
+
// 5. Update the public settings that components see
|
|
85
|
+
newContext.public = deviceOverride.getValue('');
|
|
152
86
|
return newContext;
|
|
153
87
|
}), 'updateReduxSettings']
|
|
154
88
|
},
|
|
155
|
-
|
|
89
|
+
UISETTING_ROUTE_CHANGE: {
|
|
156
90
|
actions: [assign(({
|
|
157
91
|
context,
|
|
158
92
|
event
|
|
159
93
|
}) => {
|
|
160
|
-
const newContext = cloneDeep({
|
|
161
|
-
...context
|
|
162
|
-
});
|
|
163
94
|
const routePath = event.pathname || '/';
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
//
|
|
167
|
-
const
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
173
|
-
return newContext;
|
|
95
|
+
const routePattern = event.routePattern;
|
|
96
|
+
console.log('🔧 ROUTE_CHANGE to:', routePattern);
|
|
97
|
+
// Clone context to avoid mutations
|
|
98
|
+
const newContext = cloneDeep(context);
|
|
99
|
+
// Update internal route and route pattern
|
|
100
|
+
newContext.internal.currentRoute = routePath;
|
|
101
|
+
if (routePattern) {
|
|
102
|
+
newContext.internal.routePattern = routePattern;
|
|
174
103
|
}
|
|
175
|
-
|
|
104
|
+
// Build override keys using route pattern if available
|
|
105
|
+
const routeForBracket = routePattern || routePath;
|
|
106
|
+
const routeDeviceKey = [routeForBracket, context.internal.deviceType];
|
|
107
|
+
// Apply overrides by chaining: base -> device -> route+device
|
|
108
|
+
const deviceOverride = context.internal.configModel.override(routeDeviceKey, {
|
|
109
|
+
strict: true
|
|
110
|
+
});
|
|
111
|
+
// Extract final merged settings
|
|
112
|
+
const effectiveSettings = deviceOverride.getValue('');
|
|
113
|
+
// Rebuild PUBLIC settings from scratch (no leakage from old route)
|
|
114
|
+
newContext.public = effectiveSettings;
|
|
176
115
|
return newContext;
|
|
177
|
-
})
|
|
116
|
+
})
|
|
117
|
+
// 'updateReduxSettings',
|
|
118
|
+
]
|
|
178
119
|
},
|
|
179
|
-
|
|
120
|
+
UISETTING_UPDATE_ROUTE_SETTINGS: {
|
|
180
121
|
actions: [assign(({
|
|
181
|
-
context
|
|
182
|
-
event
|
|
122
|
+
context
|
|
183
123
|
}) => ({
|
|
184
|
-
...context
|
|
185
|
-
|
|
124
|
+
...context
|
|
125
|
+
// Route settings are now handled via uiSettings overrides
|
|
186
126
|
})), 'updateReduxSettings']
|
|
187
127
|
},
|
|
188
|
-
|
|
189
|
-
actions: [assign((
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
128
|
+
UISETTING_RESET: {
|
|
129
|
+
actions: [assign(({
|
|
130
|
+
context
|
|
131
|
+
}) => {
|
|
132
|
+
console.log('1️⃣ UISETTING_RESET state trigger');
|
|
133
|
+
const newContext = cloneDeep(context);
|
|
134
|
+
// Reset public state
|
|
135
|
+
newContext.public.components = [];
|
|
136
|
+
newContext.public.activeComponent = undefined;
|
|
137
|
+
// Reset internal tracking
|
|
138
|
+
newContext.internal.changedSettings = {};
|
|
139
|
+
return newContext;
|
|
140
|
+
}), 'updateReduxSettings']
|
|
141
|
+
},
|
|
142
|
+
UISETTING_RESET_CHANGED_SETTINGS: {
|
|
143
|
+
actions: [assign(({
|
|
144
|
+
context
|
|
145
|
+
}) => {
|
|
146
|
+
console.log('1️⃣ UISETTING_RESET_CHANGED_SETTINGS state trigger');
|
|
147
|
+
const newContext = cloneDeep(context);
|
|
148
|
+
newContext.internal.changedSettings = {};
|
|
149
|
+
return newContext;
|
|
150
|
+
})]
|
|
151
|
+
},
|
|
152
|
+
UISETTING_UPDATE_DEVICE_TYPE: {
|
|
153
|
+
actions: [assign(({
|
|
154
|
+
context,
|
|
155
|
+
event
|
|
156
|
+
}) => {
|
|
157
|
+
console.log('1️⃣ UISETTING_UPDATE_DEVICE_TYPE state trigger: ', event);
|
|
158
|
+
const deviceType = event.deviceType || 'desktop';
|
|
159
|
+
if (context.internal.deviceType === deviceType) {
|
|
160
|
+
console.log('Device type unchanged');
|
|
161
|
+
return context;
|
|
197
162
|
}
|
|
198
|
-
|
|
163
|
+
const newContext = cloneDeep(context);
|
|
164
|
+
newContext.internal.deviceType = deviceType;
|
|
165
|
+
// Recalculate settings for new device
|
|
166
|
+
const routeForBracket = context.internal.routePattern || context.internal.currentRoute;
|
|
167
|
+
const routeOverride = context.internal.configModel.override([routeForBracket, deviceType], {
|
|
168
|
+
strict: true
|
|
169
|
+
});
|
|
170
|
+
newContext.public = routeOverride.getValue('');
|
|
171
|
+
return newContext;
|
|
172
|
+
}), 'updateReduxSettings']
|
|
199
173
|
}
|
|
200
|
-
// SAVE: {
|
|
201
|
-
// actions: ['updateReduxSettings'],
|
|
202
|
-
// },
|
|
203
174
|
}
|
|
204
175
|
}
|
|
205
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settingsMachine.js","sources":["../../src/machines/settingsMachine.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"settingsMachine.js","sources":["../../src/machines/settingsMachine.ts"],"sourcesContent":[null],"names":[],"mappings":"mJAKA;;;;;;;;;;;;;;;;;;;;;AAqBG;AAEI,MAAM,eAAe,GAAG,aAAa,CAAC;AACzC,EAAA,EAAA,EAAE,UAAE;AACJ,EAAA,KAAA,EAAK,EAAE;AASP,EAAA,OAAA,EAAO,MAAE;AACT,EAAA,OAAA,EAAO;AACH,IAAA;QAEA;UACA,WAAa,GAAE,KAAA,EAAA,QAAgB,IAAA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