@lifi/widget 1.1.1 → 1.2.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/App.js +2 -1
- package/AppDrawer.d.ts +1 -1
- package/AppProvider.d.ts +1 -1
- package/AppProvider.js +7 -2
- package/components/Header/Header.js +1 -1
- package/components/Header/NavigationHeader.js +5 -3
- package/components/Header/WalletHeader.js +1 -1
- package/components/Initializer.d.ts +2 -0
- package/components/Initializer.js +5 -0
- package/components/StepToken.js +1 -1
- package/components/SwapButton/SwapButton.js +5 -2
- package/components/SwapInProgress/SwapInProgress.js +1 -1
- package/components/SwapRoutes/SwapRoutes.js +2 -1
- package/components/TextFitter/TextFitter.js +9 -5
- package/fonts/Inter-Black.woff +0 -0
- package/fonts/Inter-Black.woff2 +0 -0
- package/fonts/Inter-BlackItalic.woff +0 -0
- package/fonts/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraLight.woff +0 -0
- package/fonts/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Light.woff +0 -0
- package/fonts/Inter-Light.woff2 +0 -0
- package/fonts/Inter-LightItalic.woff +0 -0
- package/fonts/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-MediumItalic.woff +0 -0
- package/fonts/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter-Thin.woff +0 -0
- package/fonts/Inter-Thin.woff2 +0 -0
- package/fonts/Inter-ThinItalic.woff +0 -0
- package/fonts/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter-italic.var.woff2 +0 -0
- package/fonts/Inter-roman.var.woff2 +0 -0
- package/fonts/Inter.var.woff2 +0 -0
- package/fonts/inter.css +200 -0
- package/hooks/index.d.ts +1 -3
- package/hooks/index.js +1 -3
- package/hooks/useContentHeight.js +18 -10
- package/hooks/useHasSufficientBalance.js +1 -1
- package/hooks/useInitializer.d.ts +1 -0
- package/hooks/useInitializer.js +5 -0
- package/hooks/{useRouteExecution/useRouteExecution.d.ts → useRouteExecution.d.ts} +1 -1
- package/hooks/{useRouteExecution/useRouteExecution.js → useRouteExecution.js} +5 -5
- package/hooks/useSwapRoutes.js +9 -7
- package/hooks/useTools.d.ts +1 -0
- package/hooks/useTools.js +14 -0
- package/i18n/en/translation.json +134 -136
- package/i18n/index.d.ts +0 -2
- package/icons/LiFiFullLogo.svg +10 -0
- package/icons/LiFiLogo.svg +5 -0
- package/package.json +7 -6
- package/pages/SelectTokenPage/ChainSelect.js +1 -1
- package/pages/SettingsPage/AdvancedPreferences.js +5 -4
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +1 -1
- package/pages/SettingsPage/EnabledBridgesSelect.js +11 -6
- package/pages/SettingsPage/EnabledExchangesSelect.js +10 -6
- package/pages/SettingsPage/GasPriceSelect.js +4 -4
- package/pages/SettingsPage/RoutePrioritySelect.js +4 -4
- package/pages/SettingsPage/SlippageInput.js +7 -10
- package/pages/SwapPage/ExecutionItem.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.d.ts +1 -1
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +1 -1
- package/pages/SwapPage/StepItem.js +1 -1
- package/pages/SwapPage/StepTimer.js +3 -2
- package/pages/SwapRoutesPage/SwapRoutesPage.js +2 -1
- package/providers/SwapFormProvider/SwapFormProvider.d.ts +0 -3
- package/providers/SwapFormProvider/SwapFormProvider.js +0 -3
- package/providers/SwapFormProvider/types.d.ts +0 -19
- package/providers/SwapFormProvider/types.js +0 -9
- package/providers/ThemeProvider/ThemeProvider.js +1 -1
- package/providers/WidgetProvider/WidgetProvider.js +3 -5
- package/providers/WidgetProvider/types.d.ts +3 -3
- package/stores/index.d.ts +2 -0
- package/stores/index.js +2 -0
- package/stores/route/index.d.ts +5 -0
- package/stores/route/index.js +5 -0
- package/{hooks/useRouteExecution → stores/route}/types.d.ts +0 -0
- package/{hooks/useRouteExecution → stores/route}/types.js +0 -0
- package/stores/route/useCurrentRoute.d.ts +2 -0
- package/stores/route/useCurrentRoute.js +5 -0
- package/stores/route/useExecutingRoutes.d.ts +1 -0
- package/stores/route/useExecutingRoutes.js +4 -0
- package/{hooks/useRouteExecution → stores/route}/useRouteStore.d.ts +3 -5
- package/{hooks/useRouteExecution → stores/route}/useRouteStore.js +16 -26
- package/stores/route/useSetExecutableRoute.d.ts +1 -0
- package/stores/route/useSetExecutableRoute.js +4 -0
- package/stores/settings/index.d.ts +5 -0
- package/stores/settings/index.js +5 -0
- package/stores/settings/types.d.ts +23 -0
- package/stores/settings/types.js +1 -0
- package/stores/settings/useAppearance.d.ts +2 -0
- package/stores/settings/useAppearance.js +7 -0
- package/stores/settings/useSetSettings.d.ts +5 -0
- package/stores/settings/useSetSettings.js +5 -0
- package/stores/settings/useSettings.d.ts +2 -0
- package/stores/settings/useSettings.js +8 -0
- package/stores/settings/useSettingsStore.d.ts +25 -0
- package/stores/settings/useSettingsStore.js +84 -0
- package/types/widget.d.ts +31 -23
- package/utils/format.d.ts +1 -1
- package/utils/format.js +1 -1
- package/utils/routes.d.ts +1 -0
- package/utils/routes.js +7 -6
- package/hooks/useBridges.d.ts +0 -1
- package/hooks/useBridges.js +0 -12
- package/hooks/useExchanges.d.ts +0 -1
- package/hooks/useExchanges.js +0 -12
- package/hooks/useRouteExecution/index.d.ts +0 -3
- package/hooks/useRouteExecution/index.js +0 -3
- package/hooks/useSettings/index.d.ts +0 -2
- package/hooks/useSettings/index.js +0 -2
- package/hooks/useSettings/types.d.ts +0 -5
- package/hooks/useSettings/types.js +0 -1
- package/hooks/useSettings/useSettingsStore.d.ts +0 -13
- package/hooks/useSettings/useSettingsStore.js +0 -22
- package/i18n/react-i18next.d.ts +0 -9
- package/pages/MainPage/SendToRecipientForm.d.ts +0 -2
- package/pages/MainPage/SendToRecipientForm.js +0 -20
- package/react-app-env.d.ts +0 -1
package/hooks/useBridges.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useQuery } from 'react-query';
|
|
3
|
-
import { LiFi } from '../lifi';
|
|
4
|
-
export const useBridges = () => {
|
|
5
|
-
const { data } = useQuery(['bridges'], ({ signal }) => LiFi.getPossibilities({ include: ['bridges'] }, { signal }));
|
|
6
|
-
const bridges = useMemo(() => {
|
|
7
|
-
var _a;
|
|
8
|
-
const bridges = (_a = data === null || data === void 0 ? void 0 : data.bridges) === null || _a === void 0 ? void 0 : _a.map((bridge) => bridge.tool).map((bridegTool) => bridegTool.split('-')[0]);
|
|
9
|
-
return Array.from(new Set(bridges));
|
|
10
|
-
}, [data === null || data === void 0 ? void 0 : data.bridges]);
|
|
11
|
-
return bridges;
|
|
12
|
-
};
|
package/hooks/useExchanges.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const useExchanges: () => string[];
|
package/hooks/useExchanges.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { useMemo } from 'react';
|
|
2
|
-
import { useQuery } from 'react-query';
|
|
3
|
-
import { LiFi } from '../lifi';
|
|
4
|
-
export const useExchanges = () => {
|
|
5
|
-
const { data } = useQuery(['exchanges'], ({ signal }) => LiFi.getPossibilities({ include: ['exchanges'] }, { signal }));
|
|
6
|
-
const exchanges = useMemo(() => {
|
|
7
|
-
var _a;
|
|
8
|
-
const exchanges = (_a = data === null || data === void 0 ? void 0 : data.exchanges) === null || _a === void 0 ? void 0 : _a.map((exchange) => exchange.tool).map((exchangeTool) => exchangeTool.split('-')[0]);
|
|
9
|
-
return Array.from(new Set(exchanges));
|
|
10
|
-
}, [data === null || data === void 0 ? void 0 : data.exchanges]);
|
|
11
|
-
return exchanges;
|
|
12
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Appearance } from '../../types';
|
|
2
|
-
import { SettingsStore } from './types';
|
|
3
|
-
export declare const useSettingsStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<SettingsStore>, "persist"> & {
|
|
4
|
-
persist: {
|
|
5
|
-
setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SettingsStore, Partial<SettingsStore>>>) => void;
|
|
6
|
-
clearStorage: () => void;
|
|
7
|
-
rehydrate: () => Promise<void>;
|
|
8
|
-
hasHydrated: () => boolean;
|
|
9
|
-
onHydrate: (fn: (state: SettingsStore) => void) => () => void;
|
|
10
|
-
onFinishHydration: (fn: (state: SettingsStore) => void) => () => void;
|
|
11
|
-
};
|
|
12
|
-
}>;
|
|
13
|
-
export declare const useAppearance: () => [Appearance, (appearance: Appearance) => void];
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import produce from 'immer';
|
|
2
|
-
import create from 'zustand';
|
|
3
|
-
import { persist } from 'zustand/middleware';
|
|
4
|
-
import shallow from 'zustand/shallow';
|
|
5
|
-
export const useSettingsStore = create()(persist((set) => ({
|
|
6
|
-
appearance: 'auto',
|
|
7
|
-
setAppearance: (appearance) => set(produce((state) => {
|
|
8
|
-
state.appearance = appearance;
|
|
9
|
-
})),
|
|
10
|
-
}), {
|
|
11
|
-
name: 'li.fi-widget-settings',
|
|
12
|
-
version: 1,
|
|
13
|
-
migrate: (persistedState, version) => {
|
|
14
|
-
if (version === 0 && persistedState.appearance === 'system') {
|
|
15
|
-
persistedState.appearance = 'auto';
|
|
16
|
-
}
|
|
17
|
-
return persistedState;
|
|
18
|
-
},
|
|
19
|
-
}));
|
|
20
|
-
export const useAppearance = () => {
|
|
21
|
-
return useSettingsStore((state) => [state.appearance, state.setAppearance], shallow);
|
|
22
|
-
};
|
package/i18n/react-i18next.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { HelpOutline as HelpOutlineIcon } from '@mui/icons-material';
|
|
3
|
-
import { Box, Checkbox, FormControl, FormControlLabel, Typography, } from '@mui/material';
|
|
4
|
-
import { useFormContext, useWatch } from 'react-hook-form';
|
|
5
|
-
import { useTranslation } from 'react-i18next';
|
|
6
|
-
import { Input } from '../../components/Input';
|
|
7
|
-
import { Switch } from '../../components/Switch';
|
|
8
|
-
import { SwapFormKey } from '../../providers/SwapFormProvider';
|
|
9
|
-
export const SendToRecipientForm = () => {
|
|
10
|
-
const { t } = useTranslation();
|
|
11
|
-
const { register } = useFormContext();
|
|
12
|
-
const sendToRecipientChecked = useWatch({
|
|
13
|
-
name: SwapFormKey.IsSendToRecipient,
|
|
14
|
-
});
|
|
15
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Box, Object.assign({ mb: 2, sx: {
|
|
16
|
-
display: 'flex',
|
|
17
|
-
justifyContent: 'space-between',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
} }, { children: [_jsxs(Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: [_jsx(HelpOutlineIcon, { sx: { color: 'grey.500' } }), _jsx(Typography, Object.assign({ lineHeight: "normal", variant: "subtitle1", color: "text.primary", ml: 1 }, { children: t(`swap.sendToRecipient`) }))] })), _jsx(Switch, Object.assign({}, register(SwapFormKey.IsSendToRecipient)))] })), sendToRecipientChecked ? (_jsxs(_Fragment, { children: [_jsx(FormControl, Object.assign({ variant: "standard", fullWidth: true }, { children: _jsx(Input, { size: "small", placeholder: t(`swap.recipientsAddress`, { chain: 'ETH' }), required: true, inputProps: Object.assign({}, register(SwapFormKey.RecipientsAddress)) }) })), _jsx(Box, Object.assign({ mt: 0.5, mb: 1 }, { children: _jsx(FormControlLabel, { control: _jsx(Checkbox, Object.assign({ required: true }, register(SwapFormKey.IsAddressConfirmed))), label: t(`swap.addressConfirmation`), componentsProps: { typography: { variant: 'body2' } } }) }))] })) : null] }));
|
|
20
|
-
};
|
package/react-app-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="react-scripts" />
|