@lifi/widget 1.28.3 → 1.29.0
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/AppDrawer.style.d.ts +1 -1
- package/AppProvider.js +2 -2
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/AppProvider.js +2 -2
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/cjs/components/AppContainer.d.ts +2 -2
- package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +5 -3
- package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +7 -5
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
- package/cjs/components/Header/Header.style.d.ts +3 -3
- package/cjs/components/Header/useHeaderActionStore.js +1 -1
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/Select.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SmallAvatar.d.ts +2 -2
- package/cjs/components/Step/CircularProgress.d.ts +0 -1
- package/cjs/components/Step/CircularProgress.style.d.ts +2 -2
- package/cjs/components/Step/StepList.d.ts +0 -1
- package/cjs/components/Step/StepProcess.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
- package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/cjs/components/Switch.js +1 -1
- package/cjs/components/Token/Token.style.d.ts +4 -4
- package/cjs/components/Token/Token.style.js +3 -1
- package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
- package/cjs/config/theme.js +22 -27
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useChains.js +2 -3
- package/cjs/hooks/useRouteExecution.js +5 -4
- package/cjs/hooks/useTools.js +2 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +1 -1
- package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
- package/cjs/providers/WalletProvider/WalletProvider.js +1 -1
- package/cjs/providers/WidgetProvider/WidgetProvider.js +3 -2
- package/cjs/stores/StoreProvider.d.ts +3 -0
- package/cjs/stores/StoreProvider.js +13 -0
- package/cjs/stores/chains/ChainOrderStore.d.ts +9 -0
- package/cjs/stores/chains/ChainOrderStore.js +44 -0
- package/cjs/stores/chains/createChainOrderStore.d.ts +4 -0
- package/cjs/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +4 -4
- package/cjs/stores/chains/index.d.ts +2 -1
- package/cjs/stores/chains/index.js +2 -1
- package/cjs/stores/chains/types.d.ts +2 -2
- package/cjs/stores/chains/useChainOrder.js +2 -2
- package/cjs/stores/index.d.ts +1 -0
- package/cjs/stores/index.js +1 -0
- package/cjs/stores/routes/RouteExecutionStore.d.ts +9 -0
- package/cjs/stores/routes/RouteExecutionStore.js +44 -0
- package/cjs/stores/routes/createRouteExecutionStore.d.ts +3 -0
- package/cjs/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +6 -4
- package/cjs/stores/routes/index.d.ts +1 -1
- package/cjs/stores/routes/index.js +1 -1
- package/cjs/stores/routes/types.d.ts +5 -5
- package/cjs/stores/routes/useExecutingRoutesIds.js +3 -3
- package/cjs/stores/routes/useRecommendedRouteStore.js +1 -1
- package/cjs/stores/routes/useSetExecutableRoute.js +2 -2
- package/cjs/stores/routes/useSwapHistory.js +3 -3
- package/cjs/stores/settings/SettingsStore.d.ts +11 -0
- package/cjs/stores/settings/SettingsStore.js +58 -0
- package/cjs/stores/settings/createSettingsStore.d.ts +5 -0
- package/cjs/stores/settings/{useSettingsStore.js → createSettingsStore.js} +4 -19
- package/cjs/stores/settings/index.d.ts +1 -1
- package/cjs/stores/settings/index.js +1 -1
- package/cjs/stores/settings/types.d.ts +4 -4
- package/cjs/stores/settings/useAppearance.js +2 -2
- package/cjs/stores/settings/useSendToWalletStore.js +1 -1
- package/cjs/stores/settings/useSettings.js +3 -3
- package/cjs/stores/types.d.ts +5 -0
- package/cjs/stores/types.js +2 -0
- package/cjs/types/widget.d.ts +1 -0
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +1 -1
- package/components/AppContainer.d.ts +2 -2
- package/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/components/Card/Card.d.ts +5 -3
- package/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/components/ChainSelect/ChainSelect.style.d.ts +7 -5
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +2 -2
- package/components/Header/Header.style.d.ts +3 -3
- package/components/Header/useHeaderActionStore.js +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/Select.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SmallAvatar.d.ts +2 -2
- package/components/Step/CircularProgress.d.ts +0 -1
- package/components/Step/CircularProgress.style.d.ts +2 -2
- package/components/Step/StepList.d.ts +0 -1
- package/components/Step/StepProcess.style.d.ts +1 -1
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRouteCard/SwapRouteCard.style.js +1 -1
- package/components/SwapRoutes/SwapRoutes.style.d.ts +6 -6
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/components/Switch.js +1 -1
- package/components/Token/Token.style.d.ts +4 -4
- package/components/Token/Token.style.js +4 -2
- package/components/TokenAvatar/TokenAvatar.style.d.ts +4 -4
- package/config/theme.js +22 -27
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useChains.js +3 -4
- package/hooks/useRouteExecution.js +6 -5
- package/hooks/useTools.js +3 -2
- package/package.json +13 -13
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -1
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/EnabledBridgesSelect.js +1 -1
- package/pages/SettingsPage/EnabledExchangesSelect.js +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +3 -3
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -4
- package/providers/WalletProvider/WalletProvider.js +1 -1
- package/providers/WidgetProvider/WidgetProvider.js +4 -3
- package/stores/StoreProvider.d.ts +3 -0
- package/stores/StoreProvider.js +9 -0
- package/stores/chains/ChainOrderStore.d.ts +9 -0
- package/stores/chains/ChainOrderStore.js +38 -0
- package/stores/chains/createChainOrderStore.d.ts +4 -0
- package/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +3 -4
- package/stores/chains/index.d.ts +2 -1
- package/stores/chains/index.js +2 -1
- package/stores/chains/types.d.ts +2 -2
- package/stores/chains/useChainOrder.js +2 -2
- package/stores/index.d.ts +1 -0
- package/stores/index.js +1 -0
- package/stores/routes/RouteExecutionStore.d.ts +9 -0
- package/stores/routes/RouteExecutionStore.js +38 -0
- package/stores/routes/createRouteExecutionStore.d.ts +3 -0
- package/stores/routes/{useRouteExecutionStore.js → createRouteExecutionStore.js} +5 -4
- package/stores/routes/index.d.ts +1 -1
- package/stores/routes/index.js +1 -1
- package/stores/routes/types.d.ts +5 -5
- package/stores/routes/useExecutingRoutesIds.js +2 -2
- package/stores/routes/useRecommendedRouteStore.js +1 -1
- package/stores/routes/useSetExecutableRoute.js +1 -1
- package/stores/routes/useSwapHistory.js +2 -2
- package/stores/settings/SettingsStore.d.ts +11 -0
- package/stores/settings/SettingsStore.js +51 -0
- package/stores/settings/createSettingsStore.d.ts +5 -0
- package/stores/settings/{useSettingsStore.js → createSettingsStore.js} +3 -18
- package/stores/settings/index.d.ts +1 -1
- package/stores/settings/index.js +1 -1
- package/stores/settings/types.d.ts +4 -4
- package/stores/settings/useAppearance.js +2 -2
- package/stores/settings/useSendToWalletStore.js +1 -1
- package/stores/settings/useSettings.js +2 -2
- package/stores/types.d.ts +5 -0
- package/stores/types.js +1 -0
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/cjs/stores/chains/useChainOrderStore.d.ts +0 -17
- package/cjs/stores/routes/useRouteExecutionStore.d.ts +0 -16
- package/cjs/stores/settings/useSettingsStore.d.ts +0 -44
- package/stores/chains/useChainOrderStore.d.ts +0 -17
- package/stores/routes/useRouteExecutionStore.d.ts +0 -16
- package/stores/settings/useSettingsStore.d.ts +0 -44
|
@@ -30,7 +30,7 @@ export declare const SmallAvatarSkeletonContainer: import("@emotion/styled").Sty
|
|
|
30
30
|
component?: import("react").ElementType<any> | undefined;
|
|
31
31
|
ref?: import("react").Ref<unknown> | undefined;
|
|
32
32
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
33
|
-
} &
|
|
33
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
34
34
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
35
|
-
},
|
|
35
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
36
36
|
export declare const SmallAvatarSkeleton: () => JSX.Element;
|
|
@@ -6,9 +6,9 @@ export declare const CircularIcon: import("@emotion/styled").StyledComponent<imp
|
|
|
6
6
|
component?: import("react").ElementType<any> | undefined;
|
|
7
7
|
ref?: import("react").Ref<unknown> | undefined;
|
|
8
8
|
sx?: import("@mui/material").SxProps<Theme> | undefined;
|
|
9
|
-
} &
|
|
9
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
10
10
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
11
|
-
},
|
|
11
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<Theme> & {
|
|
12
12
|
status: Status;
|
|
13
13
|
substatus?: Substatus | undefined;
|
|
14
14
|
}, {}, {}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const LinkButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "default" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -4,7 +4,7 @@ export declare const minInputFontSize = 14;
|
|
|
4
4
|
export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
5
5
|
children?: import("react").ReactNode;
|
|
6
6
|
classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
|
|
7
|
-
color?: "success" | "warning" | "error" | "
|
|
7
|
+
color?: "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
|
|
8
8
|
disabled?: boolean | undefined;
|
|
9
9
|
error?: boolean | undefined;
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const Button: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "success" | "warning" | "error" | "
|
|
5
|
+
color?: "inherit" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableElevation?: boolean | undefined;
|
|
8
8
|
disableFocusRipple?: boolean | undefined;
|
|
@@ -17,7 +17,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
|
|
|
17
17
|
export declare const IconButton: import("@emotion/styled").StyledComponent<{
|
|
18
18
|
children?: import("react").ReactNode;
|
|
19
19
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
20
|
-
color?: "inherit" | "default" | "success" | "warning" | "error" | "
|
|
20
|
+
color?: "inherit" | "default" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
|
|
21
21
|
disabled?: boolean | undefined;
|
|
22
22
|
disableFocusRipple?: boolean | undefined;
|
|
23
23
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -10,7 +10,7 @@ export const Label = styled(Typography, {
|
|
|
10
10
|
? theme.palette.secondary.main
|
|
11
11
|
: theme.palette.mode === 'light'
|
|
12
12
|
? theme.palette.grey[300]
|
|
13
|
-
: theme.palette.grey[
|
|
13
|
+
: theme.palette.grey[800],
|
|
14
14
|
borderRadius: theme.shape.borderRadiusSecondary,
|
|
15
15
|
color: active
|
|
16
16
|
? getContrastTextColor(theme, theme.palette.secondary.main)
|
|
@@ -4,17 +4,17 @@ export declare const CollapseContainer: import("@emotion/styled").StyledComponen
|
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
|
-
},
|
|
9
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
10
|
export declare const ScrollableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
11
11
|
children?: import("react").ReactNode;
|
|
12
12
|
component?: import("react").ElementType<any> | undefined;
|
|
13
13
|
ref?: import("react").Ref<unknown> | undefined;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
-
} &
|
|
15
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
16
16
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
17
|
-
},
|
|
17
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
18
|
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
19
19
|
children?: import("react").ReactNode;
|
|
20
20
|
classes?: Partial<import("@mui/material").ScopedCssBaselineClasses> | undefined;
|
|
@@ -28,9 +28,9 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
|
|
|
28
28
|
component?: import("react").ElementType<any> | undefined;
|
|
29
29
|
ref?: import("react").Ref<unknown> | undefined;
|
|
30
30
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
31
|
-
} &
|
|
31
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
32
32
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
33
|
-
},
|
|
33
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
34
34
|
export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
35
35
|
ref?: import("react").Ref<unknown> | undefined;
|
|
36
36
|
children?: import("react").ReactNode;
|
package/components/Switch.js
CHANGED
|
@@ -43,7 +43,7 @@ export const Switch = styled(MuiSwitch)(({ theme }) => ({
|
|
|
43
43
|
[`.${switchClasses.track}`]: {
|
|
44
44
|
borderRadius: 24 / 2,
|
|
45
45
|
backgroundColor: theme.palette.mode === 'light'
|
|
46
|
-
? theme.palette.grey[
|
|
46
|
+
? theme.palette.grey[300]
|
|
47
47
|
: theme.palette.grey[800],
|
|
48
48
|
opacity: 1,
|
|
49
49
|
transition: theme.transitions.create(['background-color'], {
|
|
@@ -4,9 +4,9 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
} &
|
|
7
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
|
-
},
|
|
9
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
@@ -30,6 +30,6 @@ export declare const TokenDivider: import("@emotion/styled").StyledComponent<imp
|
|
|
30
30
|
component?: import("react").ElementType<any> | undefined;
|
|
31
31
|
ref?: import("react").Ref<unknown> | undefined;
|
|
32
32
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
33
|
-
} &
|
|
33
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
34
34
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
35
|
-
},
|
|
35
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, Typography } from '@mui/material';
|
|
2
|
-
import { styled } from '@mui/material/styles';
|
|
2
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
3
3
|
export const TextSecondaryContainer = styled(Box, {
|
|
4
4
|
shouldForwardProp: (prop) => prop !== 'connected',
|
|
5
5
|
})(({ theme, connected }) => ({
|
|
@@ -24,7 +24,9 @@ export const TextSecondary = styled(Typography, {
|
|
|
24
24
|
fontSize: 12,
|
|
25
25
|
lineHeight: 1,
|
|
26
26
|
fontWeight: 500,
|
|
27
|
-
color: dot
|
|
27
|
+
color: dot
|
|
28
|
+
? alpha(theme.palette.text.secondary, 0.56)
|
|
29
|
+
: theme.palette.text.secondary,
|
|
28
30
|
marginTop: connected ? 0 : theme.spacing(0.5),
|
|
29
31
|
}));
|
|
30
32
|
export const TokenDivider = styled(Box)(({ theme }) => ({
|
|
@@ -5,14 +5,14 @@ export declare const AvatarDefault: import("@emotion/styled").StyledComponent<im
|
|
|
5
5
|
component?: import("react").ElementType<any> | undefined;
|
|
6
6
|
ref?: import("react").Ref<unknown> | undefined;
|
|
7
7
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
-
} &
|
|
8
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
9
9
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
10
|
-
},
|
|
10
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
11
|
export declare const AvatarDefaultContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
12
12
|
children?: import("react").ReactNode;
|
|
13
13
|
component?: import("react").ElementType<any> | undefined;
|
|
14
14
|
ref?: import("react").Ref<unknown> | undefined;
|
|
15
15
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
16
|
-
} &
|
|
16
|
+
} & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
17
17
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
18
|
-
},
|
|
18
|
+
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
package/config/theme.js
CHANGED
|
@@ -49,6 +49,9 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
49
49
|
const contrastButtonColor = getContrastRatio(common.white, primaryMainColor) >= 3
|
|
50
50
|
? common.white
|
|
51
51
|
: common.black;
|
|
52
|
+
const contrastTextButtonColor = getContrastRatio(common.white, alpha(primaryMainColor, 0.08)) >= 3
|
|
53
|
+
? common.white
|
|
54
|
+
: common.black;
|
|
52
55
|
return createMuiTheme({
|
|
53
56
|
typography: Object.assign({ fontFamily: 'Inter var, Inter, sans-serif' }, theme.typography),
|
|
54
57
|
palette: Object.assign(Object.assign(Object.assign(Object.assign({ mode }, palette), (mode === 'light' ? paletteLight : paletteDark)), theme.palette), { primary: {
|
|
@@ -80,14 +83,15 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
80
83
|
defaultProps: {
|
|
81
84
|
disableElevation: true,
|
|
82
85
|
},
|
|
83
|
-
styleOverrides:
|
|
86
|
+
styleOverrides: {
|
|
87
|
+
root: {
|
|
84
88
|
borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
|
|
85
89
|
textTransform: 'none',
|
|
86
90
|
fontSize: '1rem',
|
|
87
91
|
[`&.Mui-disabled, &.Mui-disabled:hover`]: {
|
|
88
92
|
color: mode === 'light'
|
|
89
|
-
?
|
|
90
|
-
:
|
|
93
|
+
? alpha(common.black, 0.56)
|
|
94
|
+
: alpha(common.white, 0.56),
|
|
91
95
|
cursor: 'not-allowed',
|
|
92
96
|
pointerEvents: 'auto',
|
|
93
97
|
},
|
|
@@ -103,39 +107,30 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
103
107
|
[`&.${loadingButtonClasses.root}.${loadingButtonClasses.loading}`]: {
|
|
104
108
|
color: 'transparent',
|
|
105
109
|
},
|
|
106
|
-
},
|
|
107
|
-
|
|
110
|
+
},
|
|
111
|
+
text: {
|
|
112
|
+
backgroundColor: mode === 'light'
|
|
113
|
+
? alpha(primaryMainColor, 0.08)
|
|
114
|
+
: alpha(primaryMainColor, 0.42),
|
|
108
115
|
'&:hover': {
|
|
109
|
-
backgroundColor:
|
|
116
|
+
backgroundColor: mode === 'light'
|
|
117
|
+
? alpha(primaryMainColor, 0.12)
|
|
118
|
+
: alpha(primaryMainColor, 0.56),
|
|
110
119
|
},
|
|
111
|
-
|
|
120
|
+
color: mode === 'light' ? primaryMainColor : contrastTextButtonColor,
|
|
121
|
+
},
|
|
122
|
+
contained: {
|
|
112
123
|
'&:hover': {
|
|
113
124
|
color: contrastButtonColor,
|
|
114
125
|
},
|
|
115
|
-
},
|
|
126
|
+
},
|
|
127
|
+
sizeMedium: {
|
|
116
128
|
padding: '10px 14px',
|
|
117
129
|
[`.${dialogActionsClasses.root} &`]: {
|
|
118
130
|
padding: '6px 12px',
|
|
119
131
|
},
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
outlined: {
|
|
123
|
-
color: primaryLightColor,
|
|
124
|
-
borderColor: primaryLightColor,
|
|
125
|
-
'&:hover': {
|
|
126
|
-
backgroundColor: alpha(primaryLightColor, 0.08),
|
|
127
|
-
borderColor: primaryLightColor,
|
|
128
|
-
},
|
|
129
|
-
},
|
|
130
|
-
text: {
|
|
131
|
-
backgroundColor: lighten(paletteDark.background.paper, 0.08),
|
|
132
|
-
color: common.white,
|
|
133
|
-
'&:hover': {
|
|
134
|
-
backgroundColor: lighten(paletteDark.background.paper, 0.12),
|
|
135
|
-
},
|
|
136
|
-
},
|
|
137
|
-
}
|
|
138
|
-
: {})),
|
|
132
|
+
},
|
|
133
|
+
},
|
|
139
134
|
},
|
|
140
135
|
MuiIconButton: {
|
|
141
136
|
styleOverrides: {
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.29.0";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.29.0';
|
package/hooks/useChains.js
CHANGED
|
@@ -10,18 +10,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { useQuery } from '@tanstack/react-query';
|
|
11
11
|
import { useCallback } from 'react';
|
|
12
12
|
import { useFormContext } from 'react-hook-form';
|
|
13
|
-
import { isItemAllowed, SwapFormKey, useLiFi, useWidgetConfig } from '../providers';
|
|
13
|
+
import { isItemAllowed, SwapFormKey, useLiFi, useWidgetConfig, } from '../providers';
|
|
14
14
|
import { useChainOrderStore } from '../stores';
|
|
15
15
|
export const useChains = () => {
|
|
16
16
|
const { disabledChains, chains } = useWidgetConfig();
|
|
17
17
|
const lifi = useLiFi();
|
|
18
18
|
const { getValues, setValue } = useFormContext();
|
|
19
|
+
const initializeChains = useChainOrderStore((state) => state.initializeChains);
|
|
19
20
|
const { data, isLoading } = useQuery(['chains'], () => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
21
|
const availableChains = yield lifi.getChains();
|
|
21
22
|
const filteredChains = availableChains.filter((chain) => isItemAllowed(chain.id, chains, disabledChains));
|
|
22
|
-
const chainOrder =
|
|
23
|
-
.getState()
|
|
24
|
-
.initializeChains(filteredChains.map((chain) => chain.id));
|
|
23
|
+
const chainOrder = initializeChains(filteredChains.map((chain) => chain.id));
|
|
25
24
|
const [fromChainValue, toChainValue] = getValues([
|
|
26
25
|
SwapFormKey.FromChain,
|
|
27
26
|
SwapFormKey.ToChain,
|
|
@@ -9,9 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
|
11
11
|
import { useCallback, useEffect, useRef } from 'react';
|
|
12
|
-
import shallow from 'zustand/shallow';
|
|
12
|
+
import { shallow } from 'zustand/shallow';
|
|
13
13
|
import { useLiFi, useWallet } from '../providers';
|
|
14
|
-
import { getUpdatedProcess, isRouteActive, isRouteDone, isRouteFailed, useRouteExecutionStore, } from '../stores';
|
|
14
|
+
import { getUpdatedProcess, isRouteActive, isRouteDone, isRouteFailed, useRouteExecutionStore, useRouteExecutionStoreContext, } from '../stores';
|
|
15
15
|
import { WidgetEvent } from '../types/events';
|
|
16
16
|
import { deepClone } from '../utils';
|
|
17
17
|
import { useWidgetEvents } from './useWidgetEvents';
|
|
@@ -21,10 +21,11 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
21
21
|
const { account, switchChain } = useWallet();
|
|
22
22
|
const resumedAfterMount = useRef(false);
|
|
23
23
|
const emitter = useWidgetEvents();
|
|
24
|
+
const routeExecutionStoreContext = useRouteExecutionStoreContext();
|
|
24
25
|
const routeExecution = useRouteExecutionStore((state) => state.routes[routeId]);
|
|
25
26
|
const [updateRoute, restartRoute, deleteRoute] = useRouteExecutionStore((state) => [state.updateRoute, state.restartRoute, state.deleteRoute], shallow);
|
|
26
27
|
const updateCallback = (updatedRoute) => {
|
|
27
|
-
const routeExecution =
|
|
28
|
+
const routeExecution = routeExecutionStoreContext.getState().routes[updatedRoute.id];
|
|
28
29
|
if (!routeExecution) {
|
|
29
30
|
return;
|
|
30
31
|
}
|
|
@@ -155,7 +156,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
155
156
|
useEffect(() => {
|
|
156
157
|
return () => {
|
|
157
158
|
var _a;
|
|
158
|
-
const route = (_a =
|
|
159
|
+
const route = (_a = routeExecutionStoreContext.getState().routes[routeId]) === null || _a === void 0 ? void 0 : _a.route;
|
|
159
160
|
if (!route || !isRouteActive(route)) {
|
|
160
161
|
return;
|
|
161
162
|
}
|
|
@@ -163,7 +164,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
163
164
|
console.log('Move route execution to background.', routeId);
|
|
164
165
|
resumedAfterMount.current = false;
|
|
165
166
|
};
|
|
166
|
-
}, [lifi, routeId]);
|
|
167
|
+
}, [lifi, routeExecutionStoreContext, routeId]);
|
|
167
168
|
return {
|
|
168
169
|
executeRoute,
|
|
169
170
|
restartRoute: restartRouteMutation,
|
package/hooks/useTools.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { useQuery } from '@tanstack/react-query';
|
|
2
2
|
import { useMemo } from 'react';
|
|
3
3
|
import { isItemAllowed, useLiFi, useWidgetConfig } from '../providers';
|
|
4
|
-
import {
|
|
4
|
+
import { useSettingsStoreContext } from '../stores';
|
|
5
5
|
export const useTools = () => {
|
|
6
6
|
const lifi = useLiFi();
|
|
7
7
|
const { bridges, exchanges } = useWidgetConfig();
|
|
8
|
+
const settingsStoreContext = useSettingsStoreContext();
|
|
8
9
|
const { data } = useQuery(['tools'], () => lifi.getTools(), {
|
|
9
10
|
onSuccess(data) {
|
|
10
|
-
const { initializeTools } =
|
|
11
|
+
const { initializeTools } = settingsStoreContext.getState();
|
|
11
12
|
initializeTools('Bridges', data.bridges
|
|
12
13
|
.filter((bridge) => isItemAllowed(bridge.key, bridges))
|
|
13
14
|
.map((bridge) => bridge.key));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -46,26 +46,26 @@
|
|
|
46
46
|
"@lifi/sdk": "^1.7.2",
|
|
47
47
|
"@lifi/wallet-management": "^1.2.4",
|
|
48
48
|
"@mui/icons-material": "^5.11.0",
|
|
49
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
50
|
-
"@mui/material": "^5.11.
|
|
51
|
-
"@sentry/integrations": "^7.
|
|
52
|
-
"@sentry/react": "^7.
|
|
53
|
-
"@sentry/tracing": "^7.
|
|
54
|
-
"@tanstack/react-query": "^4.
|
|
55
|
-
"@tanstack/react-virtual": "^3.0.0-beta.
|
|
49
|
+
"@mui/lab": "^5.0.0-alpha.116",
|
|
50
|
+
"@mui/material": "^5.11.5",
|
|
51
|
+
"@sentry/integrations": "^7.31.1",
|
|
52
|
+
"@sentry/react": "^7.31.1",
|
|
53
|
+
"@sentry/tracing": "^7.31.1",
|
|
54
|
+
"@tanstack/react-query": "^4.22.4",
|
|
55
|
+
"@tanstack/react-virtual": "^3.0.0-beta.39",
|
|
56
56
|
"big.js": "^6.2.1",
|
|
57
|
-
"i18next": "^22.4.
|
|
57
|
+
"i18next": "^22.4.9",
|
|
58
58
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
59
59
|
"microdiff": "^1.3.1",
|
|
60
60
|
"mitt": "^3.0.0",
|
|
61
61
|
"react": "^18.2.0",
|
|
62
62
|
"react-dom": "^18.2.0",
|
|
63
|
-
"react-hook-form": "^7.
|
|
64
|
-
"react-i18next": "^12.1.
|
|
65
|
-
"react-router-dom": "^6.
|
|
63
|
+
"react-hook-form": "^7.42.1",
|
|
64
|
+
"react-i18next": "^12.1.4",
|
|
65
|
+
"react-router-dom": "^6.7.0",
|
|
66
66
|
"react-timer-hook": "^3.0.5",
|
|
67
67
|
"uuid": "^9.0.0",
|
|
68
|
-
"zustand": "^4.2
|
|
68
|
+
"zustand": "^4.3.2"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"@types/react": "^18.0.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").ToggleButtonClasses> | undefined;
|
|
5
|
-
color?: "success" | "warning" | "error" | "
|
|
5
|
+
color?: "success" | "warning" | "error" | "info" | "primary" | "secondary" | "standard" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
3
|
import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import shallow from 'zustand/shallow';
|
|
5
|
+
import { shallow } from 'zustand/shallow';
|
|
6
6
|
import { Card, CardTitle } from '../../components/Card';
|
|
7
7
|
import { Select } from '../../components/Select';
|
|
8
8
|
import { useTools } from '../../hooks';
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { KeyboardArrowDown as KeyboardArrowDownIcon } from '@mui/icons-material';
|
|
3
3
|
import { Box, Checkbox, Chip, FormControl, MenuItem, Skeleton, } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import shallow from 'zustand/shallow';
|
|
5
|
+
import { shallow } from 'zustand/shallow';
|
|
6
6
|
import { Card, CardTitle } from '../../components/Card';
|
|
7
7
|
import { Select } from '../../components/Select';
|
|
8
8
|
import { useTools } from '../../hooks';
|