@lifi/widget 2.5.1 → 2.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AppDrawer.style.d.ts +1 -1
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/components/BaseTransactionButton/BaseTransactionButton.d.ts +3 -0
- package/cjs/components/{DefaultTransactionButton/DefaultTransactionButton.js → BaseTransactionButton/BaseTransactionButton.js} +3 -3
- package/cjs/components/BaseTransactionButton/index.d.ts +2 -0
- package/cjs/components/{DefaultTransactionButton → BaseTransactionButton}/index.js +3 -3
- package/cjs/components/{DefaultTransactionButton → BaseTransactionButton}/types.d.ts +1 -1
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/Card/CardTitle.d.ts +1 -1
- package/cjs/components/RouteCard/RouteCard.style.d.ts +1 -1
- package/cjs/components/Step/CircularProgress.style.js +33 -31
- package/cjs/components/Token/Token.style.d.ts +1 -1
- package/cjs/config/theme.js +9 -9
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useNavigateBack.js +2 -0
- package/cjs/i18n/de.json +2 -1
- package/cjs/i18n/fr.json +2 -1
- package/cjs/i18n/zh.json +2 -1
- package/cjs/pages/MainPage/ReviewButton.js +2 -2
- package/cjs/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/cjs/pages/TransactionPage/TransactionPage.js +7 -0
- package/cjs/pages/TransactionPage/types.d.ts +2 -2
- package/cjs/types/events.d.ts +3 -1
- package/cjs/types/events.js +1 -0
- package/components/BaseTransactionButton/BaseTransactionButton.d.ts +3 -0
- package/components/{DefaultTransactionButton/DefaultTransactionButton.js → BaseTransactionButton/BaseTransactionButton.js} +1 -1
- package/components/BaseTransactionButton/index.d.ts +2 -0
- package/components/BaseTransactionButton/index.js +2 -0
- package/components/{DefaultTransactionButton → BaseTransactionButton}/types.d.ts +1 -1
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/RouteCard/RouteCard.style.d.ts +1 -1
- package/components/Step/CircularProgress.style.js +33 -31
- package/components/Token/Token.style.d.ts +1 -1
- package/config/theme.js +10 -10
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useNavigateBack.js +2 -0
- package/i18n/de.json +2 -1
- package/i18n/fr.json +2 -1
- package/i18n/zh.json +2 -1
- package/package.json +9 -9
- package/pages/MainPage/ReviewButton.js +2 -2
- package/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/pages/TransactionPage/TransactionPage.js +7 -0
- package/pages/TransactionPage/types.d.ts +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +3 -1
- package/types/events.js +1 -0
- package/cjs/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +0 -3
- package/cjs/components/DefaultTransactionButton/index.d.ts +0 -2
- package/components/DefaultTransactionButton/DefaultTransactionButton.d.ts +0 -3
- package/components/DefaultTransactionButton/index.d.ts +0 -2
- package/components/DefaultTransactionButton/index.js +0 -2
- /package/cjs/components/{DefaultTransactionButton → BaseTransactionButton}/types.js +0 -0
- /package/components/{DefaultTransactionButton → BaseTransactionButton}/types.js +0 -0
|
@@ -6,7 +6,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
8
8
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
9
|
-
}, "className" | "style" | "classes" | "children" | "sx" | "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" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
9
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "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" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "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" | "marginBlock" | "marginInline" | "overflow" | "padding" | "paddingBlock" | "paddingInline" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
dot?: boolean | undefined;
|
|
12
12
|
}, {}, {}>;
|
package/config/theme.js
CHANGED
|
@@ -2,7 +2,7 @@ import { loadingButtonClasses } from '@mui/lab/LoadingButton';
|
|
|
2
2
|
import { touchRippleClasses } from '@mui/material/ButtonBase';
|
|
3
3
|
import { dialogActionsClasses } from '@mui/material/DialogActions';
|
|
4
4
|
import { common } from '@mui/material/colors';
|
|
5
|
-
import { alpha, createTheme as createMuiTheme, darken, getContrastRatio, keyframes, lighten, } from '@mui/material/styles';
|
|
5
|
+
import { alpha, createTheme as createMuiTheme, css, darken, getContrastRatio, keyframes, lighten, } from '@mui/material/styles';
|
|
6
6
|
const palette = {
|
|
7
7
|
primary: {
|
|
8
8
|
main: '#3F49E1',
|
|
@@ -117,15 +117,15 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
117
117
|
},
|
|
118
118
|
MuiButtonBase: {
|
|
119
119
|
styleOverrides: {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
120
|
+
// This `css()` function invokes keyframes. `styled-components` only supports keyframes
|
|
121
|
+
// in string templates. Do not convert these styles in JS object as it will break.
|
|
122
|
+
root: css `
|
|
123
|
+
&
|
|
124
|
+
.${touchRippleClasses.ripple}.${touchRippleClasses.rippleVisible} {
|
|
125
|
+
opacity: 0.1;
|
|
126
|
+
animation-name: ${enterKeyframe};
|
|
127
|
+
}
|
|
128
|
+
`,
|
|
129
129
|
},
|
|
130
130
|
},
|
|
131
131
|
MuiButton: {
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.
|
|
2
|
+
export declare const version = "2.6.1";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '2.
|
|
2
|
+
export const version = '2.6.1';
|
package/hooks/useNavigateBack.js
CHANGED
|
@@ -3,7 +3,9 @@ import { useNavigate } from 'react-router-dom';
|
|
|
3
3
|
export const useNavigateBack = () => {
|
|
4
4
|
const navigate = useNavigate();
|
|
5
5
|
const navigateBack = useCallback(() => {
|
|
6
|
+
// TODO: find a better router with nested memory routers support
|
|
6
7
|
// https://github.com/remix-run/react-router/pull/9112
|
|
8
|
+
// https://github.com/remix-run/react-router/discussions/9601
|
|
7
9
|
//
|
|
8
10
|
// if (window.history.length > 2) {
|
|
9
11
|
navigate(-1);
|
package/i18n/de.json
CHANGED
|
@@ -255,7 +255,8 @@
|
|
|
255
255
|
},
|
|
256
256
|
"routePriority": "Routenpriorität",
|
|
257
257
|
"showDestinationWallet": "Ziel Wallet anzeigen",
|
|
258
|
-
"slippage": "Slippage"
|
|
258
|
+
"slippage": "Slippage",
|
|
259
|
+
"resetSettings": "Sie verwenden benutzerdefinierte Einstellungen, die die Anzahl der verfügbaren Routen begrenzen."
|
|
259
260
|
},
|
|
260
261
|
"wallet": {
|
|
261
262
|
"extensionNotFound": "Bitte stellen Sie sicher, dass nur die Browsererweiterung {{name}} aktiv ist, bevor Sie dieses Wallet auswählen."
|
package/i18n/fr.json
CHANGED
|
@@ -255,7 +255,8 @@
|
|
|
255
255
|
},
|
|
256
256
|
"routePriority": "Priorité de l'itinéraire",
|
|
257
257
|
"showDestinationWallet": "Afficher le portefeuille de destination",
|
|
258
|
-
"slippage": "Effet de glissement"
|
|
258
|
+
"slippage": "Effet de glissement",
|
|
259
|
+
"resetSettings": "Vous utilisez des paramètres personnalisés limitant le nombre de routes disponibles."
|
|
259
260
|
},
|
|
260
261
|
"wallet": {
|
|
261
262
|
"extensionNotFound": "Veuillez vous assurer que seule l'extension de navigateur {{name}} est active avant de choisir ce portefeuille."
|
package/i18n/zh.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.1",
|
|
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",
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@ethersproject/address": "^5.7.0",
|
|
44
44
|
"@ethersproject/experimental": "^5.7.0",
|
|
45
45
|
"@ethersproject/providers": "^5.7.2",
|
|
46
|
-
"@lifi/sdk": "^2.4.
|
|
47
|
-
"@lifi/wallet-management": "^2.3.
|
|
48
|
-
"@mui/icons-material": "^5.14.
|
|
49
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
50
|
-
"@mui/material": "^5.14.
|
|
51
|
-
"@tanstack/react-query": "^4.
|
|
52
|
-
"@tanstack/react-virtual": "^3.0.0-beta.
|
|
46
|
+
"@lifi/sdk": "^2.4.3",
|
|
47
|
+
"@lifi/wallet-management": "^2.3.7",
|
|
48
|
+
"@mui/icons-material": "^5.14.13",
|
|
49
|
+
"@mui/lab": "^5.0.0-alpha.148",
|
|
50
|
+
"@mui/material": "^5.14.13",
|
|
51
|
+
"@tanstack/react-query": "^4.36.1",
|
|
52
|
+
"@tanstack/react-virtual": "^3.0.0-beta.65",
|
|
53
53
|
"big.js": "^6.2.1",
|
|
54
54
|
"i18next": "^23.5.1",
|
|
55
55
|
"i18next-browser-languagedetector": "^7.1.0",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"react-router-dom": "^6.16.0",
|
|
64
64
|
"react-timer-hook": "^3.0.7",
|
|
65
65
|
"uuid": "^9.0.1",
|
|
66
|
-
"zustand": "^4.4.
|
|
66
|
+
"zustand": "^4.4.3"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@types/react": "^18.0.0",
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useFormState } from 'react-hook-form';
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { useNavigate } from 'react-router-dom';
|
|
5
|
-
import {
|
|
5
|
+
import { BaseTransactionButton } from '../../components/BaseTransactionButton';
|
|
6
6
|
import { useRoutes } from '../../hooks';
|
|
7
7
|
import { useWidgetConfig } from '../../providers';
|
|
8
8
|
import { useSetExecutableRoute, useSplitSubvariantStore } from '../../stores';
|
|
@@ -54,5 +54,5 @@ export const ReviewButton = () => {
|
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
};
|
|
57
|
-
return (_jsx(
|
|
57
|
+
return (_jsx(BaseTransactionButton, { text: getButtonText(), onClick: handleClick, disabled: currentRoute && (isValidating || !isValid) }));
|
|
58
58
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { BaseTransactionButton } from '../../components/BaseTransactionButton';
|
|
3
3
|
import { useFromTokenSufficiency, useGasSufficiency, useRoutes, } from '../../hooks';
|
|
4
4
|
import { useWidgetConfig } from '../../providers';
|
|
5
5
|
import { useRouteExecutionStore } from '../../stores';
|
|
@@ -9,7 +9,7 @@ export const StartTransactionButton = ({ onClick, route, text, loading, }) => {
|
|
|
9
9
|
const { insufficientGas, isInitialLoading: isGasSufficiencyLoading } = useGasSufficiency(route);
|
|
10
10
|
const { insufficientFromToken, isInitialLoading: isFromTokenSufficiencyLoading, } = useFromTokenSufficiency(route);
|
|
11
11
|
const shouldDisableButton = !isMultisigSigner && (insufficientFromToken || !!insufficientGas?.length);
|
|
12
|
-
return (_jsx(
|
|
12
|
+
return (_jsx(BaseTransactionButton, { onClick: onClick, text: text, disabled: shouldDisableButton, loading: isFromTokenSufficiencyLoading || isGasSufficiencyLoading || loading }));
|
|
13
13
|
};
|
|
14
14
|
export const StartInsurableTransactionButton = ({ onClick, text, route, loading, disabled, insurableRouteId }) => {
|
|
15
15
|
const routeExecution = useRouteExecutionStore((state) => state.routes[insurableRouteId]);
|
|
@@ -49,6 +49,13 @@ export const TransactionPage = () => {
|
|
|
49
49
|
: t(`header.${transactionType.toLowerCase()}`));
|
|
50
50
|
}
|
|
51
51
|
}, [headerStoreContext, route, status, subvariant, t]);
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (status === RouteExecutionStatus.Idle) {
|
|
54
|
+
emitter.emit(WidgetEvent.ReviewTransactionPageEntered, route);
|
|
55
|
+
}
|
|
56
|
+
// We want to emit event only when the page is mounted
|
|
57
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
58
|
+
}, []);
|
|
52
59
|
if (!route) {
|
|
53
60
|
return null;
|
|
54
61
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk';
|
|
2
|
-
import type {
|
|
3
|
-
export interface StartTransactionButtonProps extends
|
|
2
|
+
import type { BaseTransactionButtonProps } from '../../components/BaseTransactionButton';
|
|
3
|
+
export interface StartTransactionButtonProps extends BaseTransactionButtonProps {
|
|
4
4
|
route?: Route;
|
|
5
5
|
insurableRouteId: string;
|
|
6
6
|
}
|