@admin-layout/tailwind-design-pro 12.0.16-alpha.6 → 12.0.16-alpha.61
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/README.md +30 -0
- 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 +20 -8
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +2 -1
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +121 -31
- 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/Account.d.ts +4 -0
- package/lib/components/Layout/GlobalFooter/Account.d.ts.map +1 -0
- package/lib/components/Layout/GlobalFooter/Account.js +147 -0
- package/lib/components/Layout/GlobalFooter/Account.js.map +1 -0
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +7 -12
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +32 -9
- 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 +32 -83
- 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/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/{Sidebar.js → MainSidebar.js} +37 -9
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +294 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +5 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +192 -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 +330 -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 +71 -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/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/util.js +1 -1
- package/lib/components/Layout/util.js.map +1 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +1 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js +13 -3
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.js +10 -6
- package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.js +23 -16
- package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
- package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts +20 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.js +120 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.js.map +1 -0
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.js +103 -15
- package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +54 -177
- package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +423 -62
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/Switch/index.js.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.js +15 -3
- package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
- package/lib/components/SettingDrawer/types.d.ts +12 -0
- package/lib/components/SettingDrawer/types.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +8 -5
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +278 -4
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/typings.d.ts +14 -6
- 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/analytics-config.js +9 -0
- package/lib/config/analytics-config.js.map +1 -0
- 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/index.d.ts +0 -3
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/useMediaQuery.js.map +1 -1
- package/lib/hooks/useScrollThreshold.js.map +1 -1
- package/lib/hooks/useTailwindTheme.js.map +1 -1
- 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 +217 -161
- 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 +106 -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 -16
- 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.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/UI/CardList.d.ts +0 -61
- package/lib/components/UI/CardList.d.ts.map +0 -1
- package/lib/components/UI/CardList.js +0 -43
- package/lib/components/UI/CardList.js.map +0 -1
- package/lib/components/UI/CategoriesTypeList.d.ts +0 -29
- package/lib/components/UI/CategoriesTypeList.d.ts.map +0 -1
- package/lib/components/UI/CategoriesTypeList.js +0 -139
- package/lib/components/UI/CategoriesTypeList.js.map +0 -1
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +0 -83
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +0 -1
- package/lib/components/UI/LazyLoadingGoogleMarker.js +0 -107
- package/lib/components/UI/LazyLoadingGoogleMarker.js.map +0 -1
- package/lib/components/UI/Pagination.d.ts +0 -6
- package/lib/components/UI/Pagination.d.ts.map +0 -1
- package/lib/components/UI/Pagination.js +0 -56
- package/lib/components/UI/Pagination.js.map +0 -1
- package/lib/components/UI/ParamSearchResultContainer.d.ts +0 -99
- package/lib/components/UI/ParamSearchResultContainer.d.ts.map +0 -1
- package/lib/components/UI/ParamSearchResultContainer.js +0 -120
- package/lib/components/UI/ParamSearchResultContainer.js.map +0 -1
- package/lib/components/UI/PropertyCard.d.ts +0 -24
- package/lib/components/UI/PropertyCard.d.ts.map +0 -1
- package/lib/components/UI/PropertyCard.js +0 -420
- package/lib/components/UI/PropertyCard.js.map +0 -1
- package/lib/components/UI/PropertyCardOnMap.d.ts +0 -10
- package/lib/components/UI/PropertyCardOnMap.d.ts.map +0 -1
- package/lib/components/UI/PropertyCardOnMap.js +0 -108
- package/lib/components/UI/PropertyCardOnMap.js.map +0 -1
- package/lib/components/UI/VehicleCard/PricePopover.d.ts +0 -8
- package/lib/components/UI/VehicleCard/PricePopover.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/PricePopover.js +0 -98
- package/lib/components/UI/VehicleCard/PricePopover.js.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts +0 -7
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts +0 -9
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleFeature.js +0 -22
- package/lib/components/UI/VehicleCard/VehicleFeature.js.map +0 -1
- package/lib/components/UI/VehicleCard/types.d.ts +0 -59
- package/lib/components/UI/VehicleCard/types.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard.d.ts +0 -15
- package/lib/components/UI/VehicleCard.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard.js +0 -166
- package/lib/components/UI/VehicleCard.js.map +0 -1
- package/lib/components/UI/VehicleCardList.d.ts +0 -14
- package/lib/components/UI/VehicleCardList.d.ts.map +0 -1
- package/lib/components/UI/VehicleCardList.js +0 -38
- package/lib/components/UI/VehicleCardList.js.map +0 -1
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +0 -90
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +0 -1
- package/lib/components/UI/icons/LocationIcon.d.ts +0 -7
- package/lib/components/UI/icons/LocationIcon.d.ts.map +0 -1
- package/lib/components/UI/icons/LocationIcon.js +0 -18
- package/lib/components/UI/icons/LocationIcon.js.map +0 -1
- package/lib/components/UI/icons/index.d.ts +0 -2
- package/lib/components/UI/icons/index.d.ts.map +0 -1
- package/lib/components/UI/index.d.ts +0 -10
- package/lib/components/UI/index.d.ts.map +0 -1
- package/lib/components/typings.js +0 -6
- package/lib/components/typings.js.map +0 -1
- package/lib/hooks/use-get-current-lat-long.d.ts +0 -18
- package/lib/hooks/use-get-current-lat-long.d.ts.map +0 -1
- package/lib/hooks/use-get-current-lat-long.js +0 -29
- package/lib/hooks/use-get-current-lat-long.js.map +0 -1
- package/lib/hooks/useWindowSize.d.ts +0 -6
- package/lib/hooks/useWindowSize.d.ts.map +0 -1
- package/lib/hooks/useWindowSize.js +0 -20
- package/lib/hooks/useWindowSize.js.map +0 -1
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +0 -6
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts +0 -6
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +0 -1
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +0 -7
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/datasourcesMiddleware.d.ts +0 -6
- package/lib/middlewares/datasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +0 -7
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +0 -1
|
@@ -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,set}from'lodash-es';import {createMachine,assign}from'xstate';import {ConfigurationModel}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,115 +27,231 @@ 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
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
activeComponent: null,
|
|
120
|
-
currentRoute: input?.settings?.currentRoute || '/',
|
|
121
|
-
routeSettings: {
|
|
122
|
-
'/': defaultRouteSettings
|
|
30
|
+
// Input settings are now flat: { logo: '...', theme: '...', [/route][device]: {...}, ... }
|
|
31
|
+
const rawSettings = input?.settings || {};
|
|
32
|
+
console.log('🔍 Context Init - Raw settings:', {
|
|
33
|
+
hasRawSettings: !!rawSettings,
|
|
34
|
+
rawSettingsKeys: rawSettings ? Object.keys(rawSettings).slice(0, 15) : []
|
|
35
|
+
});
|
|
36
|
+
// Settings are flat - no uilayout wrapper to handle
|
|
37
|
+
// Just separate base settings from bracket overrides
|
|
38
|
+
const cleanedSettings = rawSettings;
|
|
39
|
+
console.log('🔍 Context Init - Settings keys:', {
|
|
40
|
+
totalKeys: Object.keys(cleanedSettings).length,
|
|
41
|
+
bracketKeys: Object.keys(cleanedSettings).filter(k => k.startsWith('[') && k.endsWith(']'))
|
|
42
|
+
});
|
|
43
|
+
// Transform loader data into ConfigurationModel format
|
|
44
|
+
// Separate base settings from bracket overrides
|
|
45
|
+
const baseContents = {};
|
|
46
|
+
const overrides = [];
|
|
47
|
+
Object.keys(cleanedSettings).forEach(key => {
|
|
48
|
+
if (key.startsWith('[') && key.endsWith(']')) {
|
|
49
|
+
// This is a bracket override: [device] or [/route][device]
|
|
50
|
+
const overrideData = cleanedSettings[key];
|
|
51
|
+
overrides.push({
|
|
52
|
+
identifiers: [key],
|
|
53
|
+
contents: overrideData,
|
|
54
|
+
keys: Object.keys(overrideData)
|
|
55
|
+
});
|
|
56
|
+
} else {
|
|
57
|
+
// Base settings (flat, no wrapper)
|
|
58
|
+
baseContents[key] = cleanedSettings[key];
|
|
123
59
|
}
|
|
124
|
-
}
|
|
60
|
+
});
|
|
61
|
+
console.log('🔍 ConfigurationModel input:', {
|
|
62
|
+
baseKeys: Object.keys(baseContents),
|
|
63
|
+
overridesCount: overrides.length,
|
|
64
|
+
overrideIdentifiers: overrides.map(o => o.identifiers[0])
|
|
65
|
+
});
|
|
66
|
+
// ConfigurationModel handles ALL bracket patterns automatically
|
|
67
|
+
const configModel = new ConfigurationModel(baseContents, [], overrides);
|
|
68
|
+
// Get current route from input (passed from component) or default to '/'
|
|
69
|
+
const currentRoute = input?.currentRoute || '/';
|
|
70
|
+
const routePattern = input?.routePattern;
|
|
71
|
+
const deviceType = 'desktop'; // Default, will be updated by component
|
|
72
|
+
// Build override keys with fallback logic - use route pattern if available
|
|
73
|
+
const routeForBracket = routePattern || currentRoute;
|
|
74
|
+
const routeDeviceKey = `[${routeForBracket}][${deviceType}]`;
|
|
75
|
+
const deviceKey = `[${deviceType}]`;
|
|
76
|
+
// Apply overrides by chaining: base -> global -> route-specific
|
|
77
|
+
// First apply global override to base
|
|
78
|
+
const globalOverride = configModel.override(deviceKey);
|
|
79
|
+
// Then apply route-specific override on top of global
|
|
80
|
+
const routeOverride = globalOverride.override(routeDeviceKey);
|
|
81
|
+
// Extract final merged settings (already flat, no uilayout wrapper)
|
|
82
|
+
const mergedContents = routeOverride?.contents;
|
|
83
|
+
const effectiveSettings = mergedContents;
|
|
84
|
+
// Build PUBLIC settings (exposed to consumers)
|
|
85
|
+
// Build the UI settings object from all potential sources
|
|
86
|
+
const publicSettings = {
|
|
87
|
+
// Apply merged settings first
|
|
88
|
+
...effectiveSettings,
|
|
89
|
+
components: effectiveSettings.components || [],
|
|
90
|
+
hiddenMenuKeys: effectiveSettings.hiddenMenuKeys || [],
|
|
91
|
+
hiddenMenuCategories: effectiveSettings.hiddenMenuCategories || []
|
|
92
|
+
};
|
|
93
|
+
// Build INTERNAL state (machine only, never exposed)
|
|
94
|
+
const internalState = {
|
|
95
|
+
configModel,
|
|
96
|
+
deviceType,
|
|
97
|
+
currentRoute,
|
|
98
|
+
changedSettings: {},
|
|
99
|
+
routePattern: input?.routePattern
|
|
100
|
+
};
|
|
101
|
+
// Return context with EXPLICIT separation
|
|
102
|
+
const context = {
|
|
103
|
+
public: publicSettings,
|
|
104
|
+
internal: internalState
|
|
105
|
+
};
|
|
106
|
+
console.log('🔍 Context Init - Final structure:', {
|
|
107
|
+
hasPublic: !!context.public,
|
|
108
|
+
hasInternal: !!context.internal,
|
|
109
|
+
publicKeys: Object.keys(context.public).slice(0, 10),
|
|
110
|
+
internalKeys: Object.keys(context.internal)
|
|
111
|
+
});
|
|
112
|
+
return context;
|
|
125
113
|
},
|
|
126
114
|
states: {
|
|
127
115
|
idle: {
|
|
116
|
+
entry: ['updateReduxSettings'],
|
|
128
117
|
on: {
|
|
129
|
-
|
|
118
|
+
UISETTING_UPDATE: {
|
|
130
119
|
actions: [assign(({
|
|
131
120
|
context,
|
|
132
121
|
event
|
|
133
122
|
}) => {
|
|
134
123
|
if (!event.value) return context;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
//
|
|
139
|
-
if (event.value.navTheme !== undefined) {
|
|
140
|
-
newContext.navTheme = event.value.navTheme;
|
|
141
|
-
}
|
|
142
|
-
if (event.value.primaryColor !== undefined) {
|
|
143
|
-
newContext.primaryColor = event.value.primaryColor;
|
|
144
|
-
}
|
|
145
|
-
if (event.value.theme !== undefined) {
|
|
146
|
-
newContext.theme = event.value.theme;
|
|
147
|
-
}
|
|
148
|
-
// Add any new keys from event.value that don't exist in context
|
|
124
|
+
console.log('🔧 Machine UPDATE event:', event);
|
|
125
|
+
// Clone context to avoid mutations
|
|
126
|
+
const newContext = cloneDeep(context);
|
|
127
|
+
// Process each changed setting
|
|
149
128
|
Object.keys(event.value).forEach(key => {
|
|
150
|
-
|
|
129
|
+
const newValue = event.value[key];
|
|
130
|
+
console.log('🔧 Processing key:', key, 'value:', newValue);
|
|
131
|
+
// Update ConfigurationModel
|
|
132
|
+
newContext.internal.configModel.setValue(key, newValue);
|
|
133
|
+
// Track in changedSettings
|
|
134
|
+
newContext.internal.changedSettings[key] = newValue;
|
|
135
|
+
// If it's a bracket key, check if it applies to current context
|
|
136
|
+
if (key.startsWith('[')) {
|
|
137
|
+
const bracketPattern = key.match(/^(\[[^\]]+\])+/);
|
|
138
|
+
if (bracketPattern) {
|
|
139
|
+
const identifier = bracketPattern[0];
|
|
140
|
+
// Use route pattern if available, otherwise fall back to current route
|
|
141
|
+
const routeForBracket = newContext.internal.routePattern || newContext.internal.currentRoute;
|
|
142
|
+
const currentIdentifier = `[${routeForBracket}][${newContext.internal.deviceType}]`;
|
|
143
|
+
const deviceOnlyIdentifier = `[${newContext.internal.deviceType}]`;
|
|
144
|
+
// If this override applies to current route/device, update public settings
|
|
145
|
+
if (identifier === currentIdentifier || identifier === deviceOnlyIdentifier) {
|
|
146
|
+
const remainingKey = key.substring(identifier.length);
|
|
147
|
+
const path = remainingKey.startsWith('.') ? remainingKey.substring(1) : remainingKey;
|
|
148
|
+
set(newContext.public, path, newValue);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
// Regular setting - update public settings directly
|
|
153
|
+
set(newContext.public, key, newValue);
|
|
154
|
+
}
|
|
151
155
|
});
|
|
152
156
|
return newContext;
|
|
153
157
|
}), 'updateReduxSettings']
|
|
154
158
|
},
|
|
155
|
-
|
|
159
|
+
UISETTING_ROUTE_CHANGE: {
|
|
156
160
|
actions: [assign(({
|
|
157
161
|
context,
|
|
158
162
|
event
|
|
159
163
|
}) => {
|
|
160
|
-
const newContext = cloneDeep({
|
|
161
|
-
...context
|
|
162
|
-
});
|
|
163
164
|
const routePath = event.pathname || '/';
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
//
|
|
167
|
-
const
|
|
168
|
-
//
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
});
|
|
173
|
-
return newContext;
|
|
165
|
+
const routePattern = event.routePattern;
|
|
166
|
+
console.log('🔧 ROUTE_CHANGE to:', routePath, 'pattern:', routePattern);
|
|
167
|
+
// Clone context to avoid mutations
|
|
168
|
+
const newContext = cloneDeep(context);
|
|
169
|
+
// Update internal route and route pattern
|
|
170
|
+
newContext.internal.currentRoute = routePath;
|
|
171
|
+
if (routePattern) {
|
|
172
|
+
newContext.internal.routePattern = routePattern;
|
|
174
173
|
}
|
|
175
|
-
|
|
174
|
+
// Build override keys using route pattern if available
|
|
175
|
+
const routeForBracket = routePattern || routePath;
|
|
176
|
+
const routeDeviceKey = `[${routeForBracket}][${context.internal.deviceType}]`;
|
|
177
|
+
const deviceKey = `[${context.internal.deviceType}]`;
|
|
178
|
+
// Apply overrides by chaining: base -> device -> route+device
|
|
179
|
+
const globalOverride = context.internal.configModel.override(deviceKey);
|
|
180
|
+
const routeOverride = globalOverride.override(routeDeviceKey);
|
|
181
|
+
// Extract final merged settings
|
|
182
|
+
const mergedContents = routeOverride?.contents || context.internal.configModel.contents;
|
|
183
|
+
const effectiveSettings = mergedContents;
|
|
184
|
+
// Rebuild PUBLIC settings from scratch (no leakage from old route)
|
|
185
|
+
newContext.public = {
|
|
186
|
+
...effectiveSettings,
|
|
187
|
+
components: effectiveSettings.components || [],
|
|
188
|
+
hiddenMenuKeys: effectiveSettings.hiddenMenuKeys || [],
|
|
189
|
+
hiddenMenuCategories: effectiveSettings.hiddenMenuCategories || []
|
|
190
|
+
};
|
|
176
191
|
return newContext;
|
|
177
192
|
}), 'updateReduxSettings']
|
|
178
193
|
},
|
|
179
|
-
|
|
194
|
+
UISETTING_UPDATE_ROUTE_SETTINGS: {
|
|
180
195
|
actions: [assign(({
|
|
181
196
|
context,
|
|
182
197
|
event
|
|
183
198
|
}) => ({
|
|
184
|
-
...context
|
|
185
|
-
|
|
199
|
+
...context
|
|
200
|
+
// Route settings are now handled via uiSettings overrides
|
|
186
201
|
})), 'updateReduxSettings']
|
|
187
202
|
},
|
|
188
|
-
|
|
189
|
-
actions: [assign((
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
}
|
|
198
|
-
|
|
203
|
+
UISETTING_RESET: {
|
|
204
|
+
actions: [assign(({
|
|
205
|
+
context
|
|
206
|
+
}) => {
|
|
207
|
+
const newContext = cloneDeep(context);
|
|
208
|
+
// Reset public state
|
|
209
|
+
newContext.public.components = [];
|
|
210
|
+
newContext.public.activeComponent = undefined;
|
|
211
|
+
// Reset internal tracking
|
|
212
|
+
newContext.internal.changedSettings = {};
|
|
213
|
+
return newContext;
|
|
214
|
+
}), 'updateReduxSettings']
|
|
215
|
+
},
|
|
216
|
+
UISETTING_RESET_CHANGED_SETTINGS: {
|
|
217
|
+
actions: [assign(({
|
|
218
|
+
context
|
|
219
|
+
}) => {
|
|
220
|
+
const newContext = cloneDeep(context);
|
|
221
|
+
newContext.internal.changedSettings = {};
|
|
222
|
+
return newContext;
|
|
223
|
+
})]
|
|
224
|
+
},
|
|
225
|
+
UISETTING_UPDATE_DEVICE_TYPE: {
|
|
226
|
+
actions: [assign(({
|
|
227
|
+
context,
|
|
228
|
+
event
|
|
229
|
+
}) => {
|
|
230
|
+
const deviceType = event.deviceType || 'desktop';
|
|
231
|
+
console.log('🔧 UPDATE_DEVICE_TYPE to:', deviceType);
|
|
232
|
+
// Clone context to avoid mutations
|
|
233
|
+
const newContext = cloneDeep(context);
|
|
234
|
+
// Update internal device type
|
|
235
|
+
newContext.internal.deviceType = deviceType;
|
|
236
|
+
// Build override keys using route pattern if available
|
|
237
|
+
const routeForBracket = context.internal.routePattern || context.internal.currentRoute;
|
|
238
|
+
const routeDeviceKey = `[${routeForBracket}][${deviceType}]`;
|
|
239
|
+
const deviceKey = `[${deviceType}]`;
|
|
240
|
+
// Apply overrides by chaining: base -> device -> route+device
|
|
241
|
+
const globalOverride = context.internal.configModel.override(deviceKey);
|
|
242
|
+
const routeOverride = globalOverride.override(routeDeviceKey);
|
|
243
|
+
// Extract final merged settings
|
|
244
|
+
const mergedContents = routeOverride?.contents || context.internal.configModel.contents;
|
|
245
|
+
const effectiveSettings = mergedContents;
|
|
246
|
+
// Rebuild PUBLIC settings with new device overrides
|
|
247
|
+
newContext.public = {
|
|
248
|
+
...effectiveSettings,
|
|
249
|
+
components: effectiveSettings.components || [],
|
|
250
|
+
hiddenMenuKeys: effectiveSettings.hiddenMenuKeys || [],
|
|
251
|
+
hiddenMenuCategories: effectiveSettings.hiddenMenuCategories || []
|
|
252
|
+
};
|
|
253
|
+
return newContext;
|
|
254
|
+
}), 'updateReduxSettings']
|
|
199
255
|
}
|
|
200
256
|
// SAVE: {
|
|
201
257
|
// actions: ['updateReduxSettings'],
|
|
@@ -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":"sIAKA;;;;;;;;;;;;;;;;;;;;;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;;AAEH,GAAA,KAAA;AAEA;qBACI,GAAA,KAAiB,EAAC,QAAA,IAAW,EAAA;YAC7B,GAAA,CAAA,iCAAqC;AACxC,MAAA,cAAE,EAAA,CAAA,CAAA,WAAA;qBAEH,EAAA,WAAA,GAAA,MAAA,CAAA,IAAA,CAAA,WAAoD,CAAA,CAAA,KAAA,CAAA,CAAA,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A,IAAA,gBAAwB,CAAA,WAAgB,CAAA,QAAA;mCAE9D,GAAA,cAAA;AACA;6BACA,GAAA;kCAEA;sDACoB,IAAA,EAAA;AAChB,cAAA,cAAA,EAAA,iBAAG,CAAA,cAAiB,IAAA,EAAA;AACpB,cAAA,oBAAA,EAAA,iBAAY,CAAA,wBAAkC;AAC9C,aAAA;AACA,YAAA,OAAA,UAAA;mCACF;AAEF;AACJ;;AAEH;AACJ;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settingsMachine.test.d.ts","sourceRoot":"","sources":["../../src/machines/settingsMachine.test.ts"],"names":[],"mappings":"AAAA,OAAO,kBAAkB,CAAC"}
|
package/lib/machines/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type ThemeColor = 'blue' | 'indigo' | 'red' | 'orange' | 'yellow' | 'teal' | 'green' | 'blue' | 'purple';
|
|
2
2
|
export type NavigationMode = 'sidebar' | 'topbar' | 'mixed';
|
|
3
|
-
export type SideMenuType = 'expanded' | 'collapsed';
|
|
3
|
+
export type SideMenuType = 'expanded' | 'collapsed' | 'perplexLayout';
|
|
4
4
|
export type ContentWidth = 'fixed' | 'fluid';
|
|
5
5
|
export declare enum SearchBarBehavior {
|
|
6
6
|
PERMANENT = "permanent",
|
|
@@ -43,6 +43,58 @@ export type RouteSettings = {
|
|
|
43
43
|
lowerMenuDividerName?: string;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
header?: {
|
|
47
|
+
desktop?: {
|
|
48
|
+
showLogo?: boolean;
|
|
49
|
+
showSearchSlot?: boolean;
|
|
50
|
+
showRightContent?: boolean;
|
|
51
|
+
showMenuToggle?: boolean;
|
|
52
|
+
showBackButton?: boolean;
|
|
53
|
+
showPageTitle?: boolean;
|
|
54
|
+
showActionButtons?: boolean;
|
|
55
|
+
position?: 'fixed' | 'static';
|
|
56
|
+
height?: string;
|
|
57
|
+
elevation?: number;
|
|
58
|
+
showHeader?: boolean;
|
|
59
|
+
showMenu?: boolean;
|
|
60
|
+
menuHeaderRender?: boolean;
|
|
61
|
+
searchBarRender?: boolean;
|
|
62
|
+
searchBarBehavior?: SearchBarBehavior;
|
|
63
|
+
searchBarOverlay?: boolean;
|
|
64
|
+
scrollThreshold?: number;
|
|
65
|
+
};
|
|
66
|
+
mobile?: {
|
|
67
|
+
showLogo?: boolean;
|
|
68
|
+
showSearchSlot?: boolean;
|
|
69
|
+
showRightContent?: boolean;
|
|
70
|
+
showMenuToggle?: boolean;
|
|
71
|
+
showBackButton?: boolean;
|
|
72
|
+
showPageTitle?: boolean;
|
|
73
|
+
showActionButtons?: boolean;
|
|
74
|
+
position?: 'fixed' | 'static';
|
|
75
|
+
height?: string;
|
|
76
|
+
elevation?: number;
|
|
77
|
+
showHeader?: boolean;
|
|
78
|
+
showMenu?: boolean;
|
|
79
|
+
menuHeaderRender?: boolean;
|
|
80
|
+
searchBarRender?: boolean;
|
|
81
|
+
searchBarBehavior?: SearchBarBehavior;
|
|
82
|
+
searchBarOverlay?: boolean;
|
|
83
|
+
scrollThreshold?: number;
|
|
84
|
+
};
|
|
85
|
+
};
|
|
86
|
+
footer?: {
|
|
87
|
+
desktop?: {
|
|
88
|
+
showFooter?: boolean;
|
|
89
|
+
};
|
|
90
|
+
mobile?: {
|
|
91
|
+
showFooter?: boolean;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
background?: {
|
|
95
|
+
desktop?: BackgroundSettings;
|
|
96
|
+
mobile?: BackgroundSettings;
|
|
97
|
+
};
|
|
46
98
|
regions?: {
|
|
47
99
|
desktop?: {
|
|
48
100
|
background?: BackgroundSettings;
|
|
@@ -96,7 +148,11 @@ export type RouteSettings = {
|
|
|
96
148
|
};
|
|
97
149
|
};
|
|
98
150
|
};
|
|
99
|
-
|
|
151
|
+
/**
|
|
152
|
+
* UI Settings - User-facing settings that control the visual appearance and layout.
|
|
153
|
+
* This includes all visual/layout settings but excludes internal machine state.
|
|
154
|
+
*/
|
|
155
|
+
export interface UISettings {
|
|
100
156
|
navTheme: 'light' | 'dark' | 'realDark';
|
|
101
157
|
primaryColor: string;
|
|
102
158
|
secondaryColor: string;
|
|
@@ -111,6 +167,7 @@ export interface SettingsContext {
|
|
|
111
167
|
titleFontSize: string;
|
|
112
168
|
letterSpacings: string;
|
|
113
169
|
siderBgColor: string;
|
|
170
|
+
sideMenuType: SideMenuType;
|
|
114
171
|
headerBgColor: string;
|
|
115
172
|
textColor: string;
|
|
116
173
|
themeType: string;
|
|
@@ -125,11 +182,45 @@ export interface SettingsContext {
|
|
|
125
182
|
verifyFormShowSkipButton: boolean;
|
|
126
183
|
components: ComponentSettings[];
|
|
127
184
|
activeComponent?: string;
|
|
128
|
-
|
|
129
|
-
|
|
185
|
+
hiddenMenuKeys?: string[];
|
|
186
|
+
hiddenMenuCategories?: string[];
|
|
187
|
+
uiSettings?: {
|
|
188
|
+
uilayout?: {
|
|
189
|
+
layout?: any;
|
|
190
|
+
regions?: any;
|
|
191
|
+
};
|
|
192
|
+
overrides?: Record<string, any>;
|
|
193
|
+
};
|
|
194
|
+
overrides?: Record<string, any>;
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Machine-internal state used for XState machine logic only.
|
|
198
|
+
* These values are NEVER exposed to consumers or synced to Redux.
|
|
199
|
+
*
|
|
200
|
+
* IMPORTANT: This interface contains ONLY machine-internal state.
|
|
201
|
+
* NO user-facing settings should be added here.
|
|
202
|
+
*/
|
|
203
|
+
export interface MachineInternalState {
|
|
204
|
+
configModel: any;
|
|
205
|
+
deviceType: 'desktop' | 'mobile';
|
|
206
|
+
currentRoute: string;
|
|
207
|
+
changedSettings: Record<string, any>;
|
|
208
|
+
routePattern?: string;
|
|
130
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* Settings Context - Complete state with separated UI and internal concerns.
|
|
212
|
+
*/
|
|
213
|
+
export interface SettingsContext {
|
|
214
|
+
public: UISettings;
|
|
215
|
+
internal: MachineInternalState;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Legacy type for backward compatibility
|
|
219
|
+
* @deprecated Use UISettings instead
|
|
220
|
+
*/
|
|
221
|
+
export type SettingsContextLegacy = UISettings;
|
|
131
222
|
export type UpdateEvent = {
|
|
132
|
-
type: '
|
|
223
|
+
type: 'UISETTING_UPDATE';
|
|
133
224
|
value?: Partial<SettingsContext>;
|
|
134
225
|
};
|
|
135
226
|
export type ComponentEvent = {
|
|
@@ -146,7 +237,7 @@ export type ComponentEvent = {
|
|
|
146
237
|
type: 'CLEAR_COMPONENT_SELECTION';
|
|
147
238
|
};
|
|
148
239
|
export type MachineEvent = {
|
|
149
|
-
type: '
|
|
240
|
+
type: 'UISETTING_UPDATE';
|
|
150
241
|
value: Partial<SettingsContext>;
|
|
151
242
|
} | {
|
|
152
243
|
type: 'REGISTER_COMPONENT';
|
|
@@ -161,14 +252,20 @@ export type MachineEvent = {
|
|
|
161
252
|
} | {
|
|
162
253
|
type: 'CLEAR_COMPONENT_SELECTION';
|
|
163
254
|
} | {
|
|
164
|
-
type: '
|
|
255
|
+
type: 'UISETTING_RESET';
|
|
165
256
|
} | {
|
|
166
257
|
type: 'SAVE';
|
|
167
258
|
} | {
|
|
168
|
-
type: '
|
|
259
|
+
type: 'UISETTING_RESET_CHANGED_SETTINGS';
|
|
260
|
+
} | {
|
|
261
|
+
type: 'UISETTING_ROUTE_CHANGE';
|
|
169
262
|
pathname: string;
|
|
263
|
+
routePattern?: string;
|
|
170
264
|
} | {
|
|
171
|
-
type: '
|
|
265
|
+
type: 'UISETTING_UPDATE_ROUTE_SETTINGS';
|
|
172
266
|
settings: Record<string, Partial<SettingsContext>>;
|
|
267
|
+
} | {
|
|
268
|
+
type: 'UISETTING_UPDATE_DEVICE_TYPE';
|
|
269
|
+
deviceType: 'desktop' | 'mobile';
|
|
173
270
|
};
|
|
174
271
|
//# sourceMappingURL=types.d.ts.map
|