@lifi/widget 3.24.3 → 3.25.0-beta.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/dist/esm/AppDefault.js +3 -3
- package/dist/esm/AppDefault.js.map +1 -1
- package/dist/esm/AppDrawer.style.d.ts +1 -1
- package/dist/esm/AppProvider.js +2 -2
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.style.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +1 -1
- package/dist/esm/components/AppContainer.js +6 -13
- package/dist/esm/components/AppContainer.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js +1 -1
- package/dist/esm/components/Avatar/Avatar.style.js.map +1 -1
- package/dist/esm/components/ButtonTertiary.d.ts +1 -1
- package/dist/esm/components/Card/CardButton.style.js +1 -1
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/Card/CardHeader.js +1 -1
- package/dist/esm/components/Card/CardHeader.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Card/CardLabel.js +1 -1
- package/dist/esm/components/Card/CardLabel.js.map +1 -1
- package/dist/esm/components/Card/CardTitle.js +1 -1
- package/dist/esm/components/Card/CardTitle.js.map +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js +1 -1
- package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
- package/dist/esm/components/ChainSelect/useChainSelect.js +13 -2
- package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/dist/esm/components/Chains/ChainList.d.ts +13 -0
- package/dist/esm/components/Chains/ChainList.js +17 -0
- package/dist/esm/components/Chains/ChainList.js.map +1 -0
- package/dist/esm/components/Chains/ChainList.style.d.ts +14 -0
- package/dist/esm/components/Chains/ChainList.style.js +38 -0
- package/dist/esm/components/Chains/ChainList.style.js.map +1 -0
- package/dist/esm/components/Chains/ChainListItem.d.ts +11 -0
- package/dist/esm/components/Chains/ChainListItem.js +11 -0
- package/dist/esm/components/Chains/ChainListItem.js.map +1 -0
- package/dist/esm/components/Chains/ChainSearchInput.d.ts +10 -0
- package/dist/esm/components/Chains/ChainSearchInput.js +19 -0
- package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.d.ts +7 -0
- package/dist/esm/components/Chains/ChainsExpanded.js +11 -0
- package/dist/esm/components/Chains/ChainsExpanded.js.map +1 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.d.ts +6 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js +16 -0
- package/dist/esm/components/Chains/ChainsExpanded.style.js.map +1 -0
- package/dist/esm/components/Chains/SelectChainContent.d.ts +9 -0
- package/dist/esm/components/Chains/SelectChainContent.js +60 -0
- package/dist/esm/components/Chains/SelectChainContent.js.map +1 -0
- package/dist/esm/components/Chains/VirtualizedChainList.d.ts +11 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js +40 -0
- package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -0
- package/dist/esm/components/Expansion/Expansion.d.ts +1 -0
- package/dist/esm/components/Expansion/Expansion.js +41 -0
- package/dist/esm/components/Expansion/Expansion.js.map +1 -0
- package/dist/esm/components/Expansion/ExpansionTransition.d.ts +9 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js +45 -0
- package/dist/esm/components/Expansion/ExpansionTransition.js.map +1 -0
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/Header.style.d.ts +1 -1
- package/dist/esm/components/Header/Header.style.js +0 -1
- package/dist/esm/components/Header/Header.style.js.map +1 -1
- package/dist/esm/components/Header/NavigationHeader.js +2 -2
- package/dist/esm/components/Header/NavigationHeader.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.style.d.ts +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js +1 -1
- package/dist/esm/components/Header/SettingsButton.style.js.map +1 -1
- package/dist/esm/components/ListItem/ListItem.js +1 -1
- package/dist/esm/components/ListItem/ListItem.js.map +1 -1
- package/dist/esm/components/ListItemButton.js +13 -1
- package/dist/esm/components/ListItemButton.js.map +1 -1
- package/dist/esm/components/ListItemText.js +1 -1
- package/dist/esm/components/ListItemText.js.map +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js +1 -1
- package/dist/esm/components/ProgressToNextUpdate.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +4 -4
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +5 -5
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js +1 -0
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
- package/dist/esm/components/RouteCard/getMatchingLabels.js +5 -3
- package/dist/esm/components/RouteCard/getMatchingLabels.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +1 -1
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Routes/RoutesContent.d.ts +14 -0
- package/dist/esm/components/Routes/RoutesContent.js +55 -0
- package/dist/esm/components/Routes/RoutesContent.js.map +1 -0
- package/dist/esm/components/Routes/RoutesExpanded.d.ts +7 -2
- package/dist/esm/components/Routes/RoutesExpanded.js +12 -70
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.style.d.ts +1 -3
- package/dist/esm/components/Routes/RoutesExpanded.style.js +4 -16
- package/dist/esm/components/Routes/RoutesExpanded.style.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.d.ts +5 -2
- package/dist/esm/components/Search/SearchInput.js +7 -3
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.style.d.ts +4 -1
- package/dist/esm/components/Search/SearchInput.style.js +25 -3
- package/dist/esm/components/Search/SearchInput.style.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.style.js +2 -1
- package/dist/esm/components/Search/SearchNotFound.style.js.map +1 -1
- package/dist/esm/components/Select.js +1 -1
- package/dist/esm/components/Select.js.map +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js +1 -1
- package/dist/esm/components/SelectTokenButton/SelectTokenButton.style.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +2 -7
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.d.ts +2 -2
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js +0 -1
- package/dist/esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js +1 -1
- package/dist/esm/components/Step/CircularProgress.style.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +3 -3
- package/dist/esm/components/StepActions/StepActions.style.js +1 -1
- package/dist/esm/components/StepActions/StepActions.style.js.map +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js +1 -1
- package/dist/esm/components/TextFitter/TextFitter.js.map +1 -1
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/Token/Token.style.js +1 -1
- package/dist/esm/components/Token/Token.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js +1 -1
- package/dist/esm/components/TokenList/TokenDetailsSheetContent.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.js +3 -3
- package/dist/esm/components/TokenList/TokenList.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -1
- package/dist/esm/components/TokenList/TokenList.style.js +6 -1
- package/dist/esm/components/TokenList/TokenList.style.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js +16 -7
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/VirtualizedTokenList.js +13 -7
- package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +3 -0
- package/dist/esm/components/TokenRate/TokenRate.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js +1 -1
- package/dist/esm/components/TokenRate/TokenRate.style.js.map +1 -1
- package/dist/esm/components/TransactionDetails.js +7 -9
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/time.js +1 -1
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.js +3 -2
- package/dist/esm/hooks/useAvailableChains.js.map +1 -1
- package/dist/esm/hooks/useChains.js +4 -4
- package/dist/esm/hooks/useChains.js.map +1 -1
- package/dist/esm/hooks/useExpansionRoutes.d.ts +2 -0
- package/dist/esm/hooks/useExpansionRoutes.js +26 -0
- package/dist/esm/hooks/useExpansionRoutes.js.map +1 -0
- package/dist/esm/hooks/useHasChainExpansion.d.ts +2 -0
- package/dist/esm/hooks/useHasChainExpansion.js +16 -0
- package/dist/esm/hooks/useHasChainExpansion.js.map +1 -0
- package/dist/esm/hooks/useIsBatchingSupported.js +4 -1
- package/dist/esm/hooks/useIsBatchingSupported.js.map +1 -1
- package/dist/esm/hooks/useListHeight.js +1 -1
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRouteExecution.js +3 -3
- package/dist/esm/hooks/useRouteExecution.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +6 -3
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressReset.js +10 -2
- package/dist/esm/hooks/useToAddressReset.js.map +1 -1
- package/dist/esm/hooks/useTokenBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +1 -0
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +6 -4
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.js +5 -3
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/hooks/useTools.js +5 -3
- package/dist/esm/hooks/useTools.js.map +1 -1
- package/dist/esm/hooks/useTransactionDetails.js.map +1 -1
- package/dist/esm/hooks/useWidgetEvents.js.map +1 -1
- package/dist/esm/i18n/bn.json +2 -1
- package/dist/esm/i18n/de.json +2 -1
- package/dist/esm/i18n/en.json +2 -1
- package/dist/esm/i18n/es.json +2 -1
- package/dist/esm/i18n/fr.json +2 -1
- package/dist/esm/i18n/hi.json +1 -0
- package/dist/esm/i18n/id.json +2 -1
- package/dist/esm/i18n/it.json +2 -1
- package/dist/esm/i18n/ja.json +2 -1
- package/dist/esm/i18n/ko.json +2 -1
- package/dist/esm/i18n/pl.json +350 -0
- package/dist/esm/i18n/pt.json +2 -1
- package/dist/esm/i18n/th.json +2 -1
- package/dist/esm/i18n/tr.json +2 -1
- package/dist/esm/i18n/uk.json +14 -13
- package/dist/esm/i18n/vi.json +2 -1
- package/dist/esm/i18n/zh.json +2 -1
- package/dist/esm/index.d.ts +8 -8
- package/dist/esm/index.js +8 -8
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js +7 -33
- package/dist/esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +1 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +20 -11
- package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.d.ts +2 -2
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCard.style.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +1 -3
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js +8 -5
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.js +2 -2
- package/dist/esm/pages/TransactionPage/RouteTracker.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +4 -4
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/I18nProvider.js +8 -4
- package/dist/esm/providers/I18nProvider/I18nProvider.js.map +1 -1
- package/dist/esm/providers/QueryClientProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js +1 -1
- package/dist/esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiBaseProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/useExternalWalletProvider.js +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.js +5 -3
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/form/FormStore.js +1 -1
- package/dist/esm/stores/form/FormStore.js.map +1 -1
- package/dist/esm/stores/form/FormUpdater.js +21 -5
- package/dist/esm/stores/form/FormUpdater.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/dist/esm/stores/form/useFormRef.js.map +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/createRouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/types/widget.d.ts +25 -6
- package/dist/esm/types/widget.js +6 -0
- package/dist/esm/types/widget.js.map +1 -1
- package/dist/esm/utils/deepEqual.js +2 -2
- package/dist/esm/utils/deepEqual.js.map +1 -1
- package/dist/esm/utils/item.d.ts +5 -15
- package/dist/esm/utils/item.js +23 -19
- package/dist/esm/utils/item.js.map +1 -1
- package/dist/esm/utils/widgetSize.d.ts +3 -0
- package/dist/esm/utils/widgetSize.js +11 -0
- package/dist/esm/utils/widgetSize.js.map +1 -0
- package/package.json +7 -6
- package/package.json.tmp +12 -6
- package/src/AppDefault.tsx +3 -3
- package/src/AppProvider.tsx +2 -2
- package/src/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
- package/src/components/AmountInput/AmountInput.style.tsx +1 -1
- package/src/components/AppContainer.tsx +6 -14
- package/src/components/Avatar/Avatar.style.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +1 -1
- package/src/components/Card/CardHeader.tsx +1 -1
- package/src/components/Card/CardLabel.tsx +1 -1
- package/src/components/Card/CardTitle.tsx +1 -1
- package/src/components/ChainSelect/ChainSelect.tsx +1 -1
- package/src/components/ChainSelect/useChainSelect.ts +37 -23
- package/src/components/Chains/ChainList.style.tsx +59 -0
- package/src/components/Chains/ChainList.tsx +86 -0
- package/src/components/Chains/ChainListItem.tsx +52 -0
- package/src/components/Chains/ChainSearchInput.tsx +52 -0
- package/src/components/Chains/ChainsExpanded.style.tsx +21 -0
- package/src/components/Chains/ChainsExpanded.tsx +28 -0
- package/src/components/Chains/SelectChainContent.tsx +116 -0
- package/src/components/Chains/VirtualizedChainList.tsx +84 -0
- package/src/components/Expansion/Expansion.tsx +62 -0
- package/src/components/Expansion/ExpansionTransition.tsx +76 -0
- package/src/components/Header/Header.style.ts +0 -1
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/NavigationHeader.tsx +2 -2
- package/src/components/Header/SettingsButton.style.tsx +1 -1
- package/src/components/ListItem/ListItem.tsx +1 -1
- package/src/components/ListItemButton.tsx +17 -1
- package/src/components/ListItemText.tsx +1 -1
- package/src/components/ProgressToNextUpdate.tsx +1 -1
- package/src/components/RouteCard/RouteCard.tsx +4 -4
- package/src/components/RouteCard/RouteCardEssentials.tsx +5 -5
- package/src/components/RouteCard/RouteNotFoundCard.tsx +1 -0
- package/src/components/RouteCard/getMatchingLabels.ts +11 -3
- package/src/components/Routes/Routes.tsx +1 -1
- package/src/components/Routes/RoutesContent.tsx +137 -0
- package/src/components/Routes/RoutesExpanded.style.ts +4 -18
- package/src/components/Routes/RoutesExpanded.tsx +33 -158
- package/src/components/Search/SearchInput.style.tsx +36 -3
- package/src/components/Search/SearchInput.tsx +31 -5
- package/src/components/Search/SearchNotFound.style.tsx +2 -1
- package/src/components/Select.tsx +1 -1
- package/src/components/SelectTokenButton/SelectTokenButton.style.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +2 -3
- package/src/components/Skeleton/WidgetSkeleton.style.tsx +0 -1
- package/src/components/Step/CircularProgress.style.tsx +1 -1
- package/src/components/StepActions/StepActions.style.tsx +1 -1
- package/src/components/StepActions/StepActions.tsx +3 -3
- package/src/components/TextFitter/TextFitter.tsx +1 -1
- package/src/components/Token/Token.style.tsx +1 -1
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenDetailsSheet.tsx +1 -0
- package/src/components/TokenList/TokenDetailsSheetContent.style.tsx +1 -1
- package/src/components/TokenList/TokenDetailsSheetContent.tsx +1 -1
- package/src/components/TokenList/TokenList.style.tsx +11 -1
- package/src/components/TokenList/TokenList.tsx +6 -2
- package/src/components/TokenList/TokenListItem.tsx +53 -37
- package/src/components/TokenList/VirtualizedTokenList.tsx +17 -5
- package/src/components/TokenList/types.ts +3 -0
- package/src/components/TokenRate/TokenRate.style.ts +1 -1
- package/src/components/TokenRate/TokenRate.tsx +1 -1
- package/src/components/TransactionDetails.tsx +9 -9
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +1 -1
- package/src/hooks/timer/useTimer.ts +1 -1
- package/src/hooks/useAvailableChains.ts +8 -2
- package/src/hooks/useChains.ts +10 -4
- package/src/hooks/useExpansionRoutes.ts +29 -0
- package/src/hooks/useHasChainExpansion.ts +19 -0
- package/src/hooks/useIsBatchingSupported.ts +5 -2
- package/src/hooks/useListHeight.ts +1 -1
- package/src/hooks/useRouteExecution.ts +3 -3
- package/src/hooks/useRoutes.ts +8 -2
- package/src/hooks/useToAddressReset.ts +32 -21
- package/src/hooks/useTokenBalance.ts +1 -1
- package/src/hooks/useTokenBalances.ts +1 -0
- package/src/hooks/useTokenSearch.ts +23 -6
- package/src/hooks/useTokens.ts +16 -6
- package/src/hooks/useTools.ts +12 -4
- package/src/hooks/useTransactionDetails.ts +1 -1
- package/src/hooks/useWidgetEvents.ts +1 -0
- package/src/i18n/bn.json +2 -1
- package/src/i18n/de.json +2 -1
- package/src/i18n/en.json +2 -1
- package/src/i18n/es.json +2 -1
- package/src/i18n/fr.json +2 -1
- package/src/i18n/hi.json +1 -0
- package/src/i18n/id.json +2 -1
- package/src/i18n/it.json +2 -1
- package/src/i18n/ja.json +2 -1
- package/src/i18n/ko.json +2 -1
- package/src/i18n/pl.json +350 -0
- package/src/i18n/pt.json +2 -1
- package/src/i18n/th.json +2 -1
- package/src/i18n/tr.json +2 -1
- package/src/i18n/uk.json +14 -13
- package/src/i18n/vi.json +2 -1
- package/src/i18n/zh.json +2 -1
- package/src/index.ts +8 -8
- package/src/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/src/pages/SelectChainPage/SelectChainPage.tsx +18 -71
- package/src/pages/SelectEnabledToolsPage.tsx +1 -1
- package/src/pages/SelectTokenPage/SearchTokenInput.tsx +2 -0
- package/src/pages/SelectTokenPage/SelectTokenPage.tsx +44 -22
- package/src/pages/SendToWallet/BookmarksPage.tsx +1 -1
- package/src/pages/SendToWallet/SendToWalletPage.style.tsx +3 -3
- package/src/pages/SettingsPage/SettingsCard/SettingCard.style.tsx +1 -1
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +1 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +1 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryPage.tsx +12 -7
- package/src/pages/TransactionPage/RouteTracker.tsx +2 -2
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +4 -4
- package/src/providers/I18nProvider/I18nProvider.tsx +10 -4
- package/src/providers/QueryClientProvider.tsx +1 -1
- package/src/providers/WalletProvider/SDKProviders.tsx +1 -1
- package/src/providers/WalletProvider/SuiBaseProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/providers/WalletProvider/useExternalWalletProvider.ts +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +8 -3
- package/src/stores/form/FormStore.tsx +1 -1
- package/src/stores/form/FormUpdater.tsx +40 -6
- package/src/stores/form/URLSearchParamsBuilder.tsx +1 -1
- package/src/stores/form/useFormRef.ts +50 -54
- package/src/stores/routes/createRouteExecutionStore.ts +1 -1
- package/src/stores/settings/useSettingsStore.ts +1 -0
- package/src/types/widget.ts +29 -6
- package/src/utils/deepEqual.ts +2 -2
- package/src/utils/item.ts +46 -40
- package/src/utils/widgetSize.ts +17 -0
|
@@ -10,9 +10,13 @@ export type WidgetVariant = 'compact' | 'wide' | 'drawer';
|
|
|
10
10
|
export type WidgetSubvariant = 'default' | 'split' | 'custom' | 'refuel';
|
|
11
11
|
export type SplitSubvariant = 'bridge' | 'swap';
|
|
12
12
|
export type CustomSubvariant = 'checkout' | 'deposit';
|
|
13
|
+
export type WideSubvariant = {
|
|
14
|
+
enableChainSidebar?: boolean;
|
|
15
|
+
};
|
|
13
16
|
export interface SubvariantOptions {
|
|
14
17
|
split?: SplitSubvariant;
|
|
15
18
|
custom?: CustomSubvariant;
|
|
19
|
+
wide?: WideSubvariant;
|
|
16
20
|
}
|
|
17
21
|
export type Appearance = PaletteMode | 'system';
|
|
18
22
|
export interface NavigationProps {
|
|
@@ -74,6 +78,7 @@ export declare enum RequiredUI {
|
|
|
74
78
|
export type RequiredUIType = `${RequiredUI}`;
|
|
75
79
|
export type DefaultUI = {
|
|
76
80
|
transactionDetailsExpanded?: boolean;
|
|
81
|
+
navigationHeaderTitleNoWrap?: boolean;
|
|
77
82
|
};
|
|
78
83
|
export interface WidgetWalletConfig {
|
|
79
84
|
onConnect?(args?: WalletMenuOpenArgs): void;
|
|
@@ -152,18 +157,27 @@ export interface AllowDeny<T> {
|
|
|
152
157
|
allow?: T[];
|
|
153
158
|
deny?: T[];
|
|
154
159
|
}
|
|
160
|
+
export type AllowDenySetItem = string | number;
|
|
161
|
+
export interface AllowDenySet {
|
|
162
|
+
allow?: Set<AllowDenySetItem>;
|
|
163
|
+
deny?: Set<AllowDenySetItem>;
|
|
164
|
+
}
|
|
165
|
+
export type AllowDenySets = {
|
|
166
|
+
from?: AllowDenySet;
|
|
167
|
+
to?: AllowDenySet;
|
|
168
|
+
} & AllowDenySet;
|
|
169
|
+
export type AllowDenyItems<T> = {
|
|
170
|
+
from?: AllowDeny<T>;
|
|
171
|
+
to?: AllowDeny<T>;
|
|
172
|
+
} & AllowDeny<T>;
|
|
155
173
|
export type WidgetChains = {
|
|
156
|
-
from?: AllowDeny<number>;
|
|
157
|
-
to?: AllowDeny<number>;
|
|
158
174
|
types?: AllowDeny<ChainType>;
|
|
159
|
-
} &
|
|
175
|
+
} & AllowDenyItems<number>;
|
|
160
176
|
export type WidgetTokens = {
|
|
161
177
|
featured?: StaticToken[];
|
|
162
178
|
include?: Token[];
|
|
163
179
|
popular?: StaticToken[];
|
|
164
|
-
|
|
165
|
-
to?: AllowDeny<BaseToken>;
|
|
166
|
-
} & AllowDeny<BaseToken>;
|
|
180
|
+
} & AllowDenyItems<BaseToken>;
|
|
167
181
|
export type WidgetLanguages = {
|
|
168
182
|
default?: LanguageKey;
|
|
169
183
|
} & AllowDeny<LanguageKey>;
|
|
@@ -268,3 +282,8 @@ export interface WidgetDrawerProps extends WidgetConfigPartialProps {
|
|
|
268
282
|
*/
|
|
269
283
|
onClose?(): void;
|
|
270
284
|
}
|
|
285
|
+
export declare enum ExpansionType {
|
|
286
|
+
Routes = "routes",
|
|
287
|
+
FromChain = "fromChain",
|
|
288
|
+
ToChain = "toChain"
|
|
289
|
+
}
|
package/dist/esm/types/widget.js
CHANGED
|
@@ -27,4 +27,10 @@ export var RequiredUI;
|
|
|
27
27
|
RequiredUI["ToAddress"] = "toAddress";
|
|
28
28
|
RequiredUI["AccountDeployedMessage"] = "accountDeployedMessage";
|
|
29
29
|
})(RequiredUI || (RequiredUI = {}));
|
|
30
|
+
export var ExpansionType;
|
|
31
|
+
(function (ExpansionType) {
|
|
32
|
+
ExpansionType["Routes"] = "routes";
|
|
33
|
+
ExpansionType["FromChain"] = "fromChain";
|
|
34
|
+
ExpansionType["ToChain"] = "toChain";
|
|
35
|
+
})(ExpansionType || (ExpansionType = {}));
|
|
30
36
|
//# sourceMappingURL=widget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/types/widget.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"widget.js","sourceRoot":"","sources":["../../../src/types/widget.ts"],"names":[],"mappings":"AAyFA,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,uCAAyB,CAAA;IACzB,qCAAuB,CAAA;IACvB,qCAAuB,CAAA;IACvB,iCAAmB,CAAA;AACrB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAGD,MAAM,CAAN,IAAY,QAeX;AAfD,WAAY,QAAQ;IAClB,qCAAyB,CAAA;IACzB,mDAAuC,CAAA;IACvC,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;IACrB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA;IACvB,+BAAmB,CAAA;IACnB,qCAAyB,CAAA;IACzB,2DAA+C,CAAA;IAC/C,uDAA2C,CAAA;IAC3C,2DAA+C,CAAA;IAC/C,uCAA2B,CAAA;IAC3B,+CAAmC,CAAA;IACnC,uEAA2D,CAAA;AAC7D,CAAC,EAfW,QAAQ,KAAR,QAAQ,QAenB;AAGD,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,qCAAuB,CAAA;IACvB,+DAAiD,CAAA;AACnD,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AA0QD,MAAM,CAAN,IAAY,aAIX;AAJD,WAAY,aAAa;IACvB,kCAAiB,CAAA;IACjB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;AACrB,CAAC,EAJW,aAAa,KAAb,aAAa,QAIxB"}
|
|
@@ -33,7 +33,7 @@ export function deepEqual(a, b) {
|
|
|
33
33
|
return false;
|
|
34
34
|
}
|
|
35
35
|
for (i = length; i-- !== 0;) {
|
|
36
|
-
if (!Object.
|
|
36
|
+
if (!Object.hasOwn(b, keys[i])) {
|
|
37
37
|
return false;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -46,7 +46,7 @@ export function deepEqual(a, b) {
|
|
|
46
46
|
return true;
|
|
47
47
|
}
|
|
48
48
|
// true if both NaN, false otherwise
|
|
49
|
-
// biome-ignore lint/suspicious/noSelfCompare:
|
|
49
|
+
// biome-ignore lint/suspicious/noSelfCompare: allowed in typescript
|
|
50
50
|
return a !== a && b !== b;
|
|
51
51
|
}
|
|
52
52
|
//# sourceMappingURL=deepEqual.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,MAAM,UAAU,SAAS,CAAC,CAAM,EAAE,CAAM;IACtC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC7D,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,MAAc,CAAA;QAClB,IAAI,CAAS,CAAA;QAEb,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;YACjB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAA;YACd,CAAC;YACD,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,GAAI,CAAC;gBAC7B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC3B,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAC3C,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;QACpC,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC7C,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAA;QACtC,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACpB,IAAI,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YACrC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,GAAI,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"deepEqual.js","sourceRoot":"","sources":["../../../src/utils/deepEqual.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,MAAM,UAAU,SAAS,CAAC,CAAM,EAAE,CAAM;IACtC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACZ,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;QAC7D,IAAI,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC;YACpC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,IAAI,MAAc,CAAA;QAClB,IAAI,CAAS,CAAA;QAEb,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAA;YACjB,IAAI,MAAM,KAAK,CAAC,CAAC,MAAM,EAAE,CAAC;gBACxB,OAAO,KAAK,CAAA;YACd,CAAC;YACD,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,GAAI,CAAC;gBAC7B,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;oBAC3B,OAAO,KAAK,CAAA;gBACd,CAAC;YACH,CAAC;YACD,OAAO,IAAI,CAAA;QACb,CAAC;QAED,IAAI,CAAC,CAAC,OAAO,KAAK,MAAM,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YAC3C,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAA;QACpC,CAAC;QACD,IAAI,CAAC,CAAC,QAAQ,KAAK,MAAM,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;YAC7C,OAAO,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAA;QACtC,CAAC;QAED,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;QAC3B,MAAM,GAAG,IAAI,CAAC,MAAM,CAAA;QACpB,IAAI,MAAM,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;YACrC,OAAO,KAAK,CAAA;QACd,CAAC;QAED,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,GAAI,CAAC;YAC7B,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAE,CAAC,EAAE,CAAC;gBAChC,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QAED,KAAK,CAAC,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,CAAC,GAAI,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YAEnB,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;gBACtC,OAAO,KAAK,CAAA;YACd,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,oCAAoC;IACpC,oEAAoE;IACpE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC3B,CAAC"}
|
package/dist/esm/utils/item.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
import type { BaseToken } from '@lifi/sdk';
|
|
2
1
|
import type { FormType } from '../stores/form/types.js';
|
|
3
|
-
import type { AllowDeny,
|
|
4
|
-
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const
|
|
7
|
-
export declare const
|
|
8
|
-
allow: BaseToken[];
|
|
9
|
-
deny: BaseToken[];
|
|
10
|
-
featured?: import("@lifi/sdk").StaticToken[];
|
|
11
|
-
include?: import("@lifi/sdk").Token[];
|
|
12
|
-
popular?: import("@lifi/sdk").StaticToken[];
|
|
13
|
-
from?: AllowDeny<BaseToken>;
|
|
14
|
-
to?: AllowDeny<BaseToken>;
|
|
15
|
-
} | undefined;
|
|
16
|
-
export {};
|
|
2
|
+
import type { AllowDeny, AllowDenyItems, AllowDenySet, AllowDenySetItem, AllowDenySets } from '../types/widget.js';
|
|
3
|
+
export declare const isItemAllowed: <T>(item: T, items: AllowDeny<T> | undefined) => boolean;
|
|
4
|
+
export declare const isItemAllowedForSets: <T>(item: T, items: AllowDenySet | undefined, getKey?: (item: T) => AllowDenySetItem) => boolean;
|
|
5
|
+
export declare const getConfigItemSets: <T>(items: AllowDenyItems<T> | undefined, getSet: (items: T[]) => Set<AllowDenySetItem>, formType?: FormType) => AllowDenySets | undefined;
|
|
6
|
+
export declare const isFormItemAllowed: <T>(item: T, configTokens: AllowDenySets | undefined, formType?: FormType, getKey?: (item: T) => AllowDenySetItem) => boolean;
|
package/dist/esm/utils/item.js
CHANGED
|
@@ -1,32 +1,36 @@
|
|
|
1
|
-
|
|
1
|
+
// Use for a single item check
|
|
2
|
+
export const isItemAllowed = (item, items) => {
|
|
2
3
|
if (items?.allow?.length) {
|
|
3
|
-
return
|
|
4
|
+
return items.allow.includes(item);
|
|
4
5
|
}
|
|
5
|
-
return !
|
|
6
|
+
return !items?.deny?.includes(item);
|
|
6
7
|
};
|
|
7
|
-
|
|
8
|
-
export const
|
|
9
|
-
|
|
10
|
-
(
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
// Use for a O(1) set lookup of multiple items check
|
|
9
|
+
export const isItemAllowedForSets = (item, items, getKey) => {
|
|
10
|
+
if (items?.allow?.size) {
|
|
11
|
+
return items.allow.has(getKey?.(item) ?? item);
|
|
12
|
+
}
|
|
13
|
+
return !items?.deny?.has(getKey?.(item) ?? item);
|
|
13
14
|
};
|
|
14
|
-
export const
|
|
15
|
-
if (!
|
|
16
|
-
return
|
|
15
|
+
export const getConfigItemSets = (items, getSet, formType) => {
|
|
16
|
+
if (!items) {
|
|
17
|
+
return undefined;
|
|
17
18
|
}
|
|
18
19
|
return {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
deny: configTokens.deny?.filter((t) => t.chainId === chainId) ?? [],
|
|
20
|
+
allow: getSet(items.allow ?? []),
|
|
21
|
+
deny: getSet(items.deny ?? []),
|
|
22
22
|
...(formType && {
|
|
23
23
|
[formType]: {
|
|
24
|
-
allow:
|
|
25
|
-
|
|
26
|
-
deny: configTokens[formType]?.deny?.filter((t) => t.chainId === chainId) ??
|
|
27
|
-
[],
|
|
24
|
+
allow: getSet(items[formType]?.allow ?? []),
|
|
25
|
+
deny: getSet(items[formType]?.deny ?? []),
|
|
28
26
|
},
|
|
29
27
|
}),
|
|
30
28
|
};
|
|
31
29
|
};
|
|
30
|
+
export const isFormItemAllowed = (item, configTokens, formType, getKey) => {
|
|
31
|
+
return (isItemAllowedForSets(item, configTokens, getKey) &&
|
|
32
|
+
(formType
|
|
33
|
+
? isItemAllowedForSets(item, configTokens?.[formType], getKey)
|
|
34
|
+
: true));
|
|
35
|
+
};
|
|
32
36
|
//# sourceMappingURL=item.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../src/utils/item.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"item.js","sourceRoot":"","sources":["../../../src/utils/item.ts"],"names":[],"mappings":"AASA,8BAA8B;AAC9B,MAAM,CAAC,MAAM,aAAa,GAAG,CAC3B,IAAO,EACP,KAA+B,EACtB,EAAE;IACX,IAAI,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACzB,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAED,oDAAoD;AACpD,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAClC,IAAO,EACP,KAA+B,EAC/B,MAAsC,EAC7B,EAAE;IACX,IAAI,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;QACvB,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAK,IAAyB,CAAC,CAAA;IACtE,CAAC;IACD,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,IAAK,IAAyB,CAAC,CAAA;AACxE,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAoC,EACpC,MAA6C,EAC7C,QAAmB,EACQ,EAAE;IAC7B,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,SAAS,CAAA;IAClB,CAAC;IACD,OAAO;QACL,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,EAAE,CAAC;QAChC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;QAC9B,GAAG,CAAC,QAAQ,IAAI;YACd,CAAC,QAAQ,CAAC,EAAE;gBACV,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,IAAI,EAAE,CAAC;gBAC3C,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE,IAAI,IAAI,EAAE,CAAC;aAC1C;SACF,CAAC;KACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAO,EACP,YAAuC,EACvC,QAAmB,EACnB,MAAsC,EACtC,EAAE;IACF,OAAO,CACL,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,MAAM,CAAC;QAChD,CAAC,QAAQ;YACP,CAAC,CAAC,oBAAoB,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;YAC9D,CAAC,CAAC,IAAI,CAAC,CACV,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { defaultMaxHeight } from '../config/constants';
|
|
2
|
+
export const getWidgetMaxHeight = (theme) => {
|
|
3
|
+
if (theme?.container?.maxHeight) {
|
|
4
|
+
return theme?.container?.maxHeight;
|
|
5
|
+
}
|
|
6
|
+
if (theme?.container?.height && theme?.container?.height !== 'fit-content') {
|
|
7
|
+
return theme?.container?.height;
|
|
8
|
+
}
|
|
9
|
+
return defaultMaxHeight;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=widgetSize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widgetSize.js","sourceRoot":"","sources":["../../../src/utils/widgetSize.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAGtD,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAsC,EACrB,EAAE;IACnB,IAAI,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;QAChC,OAAO,KAAK,EAAE,SAAS,EAAE,SAAS,CAAA;IACpC,CAAC;IAED,IAAI,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,aAAa,EAAE,CAAC;QAC3E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,CAAA;IACjC,CAAC;IAED,OAAO,gBAAgB,CAAA;AACzB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0-beta.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
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"lifi"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@bigmi/client": "^0.4.
|
|
34
|
-
"@bigmi/core": "^0.4.
|
|
33
|
+
"@bigmi/client": "^0.4.2",
|
|
34
|
+
"@bigmi/core": "^0.4.2",
|
|
35
35
|
"@emotion/react": "^11.14.0",
|
|
36
36
|
"@emotion/styled": "^11.14.1",
|
|
37
|
-
"@lifi/sdk": "^3.
|
|
37
|
+
"@lifi/sdk": "^3.8.1",
|
|
38
38
|
"@mui/icons-material": "^7.2.0",
|
|
39
39
|
"@mui/material": "^7.2.0",
|
|
40
40
|
"@mui/system": "^7.2.0",
|
|
@@ -49,9 +49,10 @@
|
|
|
49
49
|
"react-i18next": "^15.6.0",
|
|
50
50
|
"react-intersection-observer": "^9.16.0",
|
|
51
51
|
"react-router-dom": "^6.30.0",
|
|
52
|
-
"
|
|
52
|
+
"react-transition-group": "^4.4.5",
|
|
53
|
+
"viem": "^2.32.0",
|
|
53
54
|
"zustand": "^5.0.6",
|
|
54
|
-
"@lifi/wallet-management": "^3.
|
|
55
|
+
"@lifi/wallet-management": "^3.13.0-beta.1"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
58
|
"@bigmi/react": ">=0.4.0",
|
package/package.json.tmp
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.25.0-beta.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
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"lifi"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@bigmi/client": "^0.4.
|
|
53
|
-
"@bigmi/core": "^0.4.
|
|
52
|
+
"@bigmi/client": "^0.4.2",
|
|
53
|
+
"@bigmi/core": "^0.4.2",
|
|
54
54
|
"@emotion/react": "^11.14.0",
|
|
55
55
|
"@emotion/styled": "^11.14.1",
|
|
56
|
-
"@lifi/sdk": "^3.
|
|
56
|
+
"@lifi/sdk": "^3.8.1",
|
|
57
57
|
"@lifi/wallet-management": "workspace:^",
|
|
58
58
|
"@mui/icons-material": "^7.2.0",
|
|
59
59
|
"@mui/material": "^7.2.0",
|
|
@@ -69,10 +69,12 @@
|
|
|
69
69
|
"react-i18next": "^15.6.0",
|
|
70
70
|
"react-intersection-observer": "^9.16.0",
|
|
71
71
|
"react-router-dom": "^6.30.0",
|
|
72
|
-
"
|
|
72
|
+
"react-transition-group": "^4.4.5",
|
|
73
|
+
"viem": "^2.32.0",
|
|
73
74
|
"zustand": "^5.0.6"
|
|
74
75
|
},
|
|
75
76
|
"devDependencies": {
|
|
77
|
+
"@types/react-transition-group": "^4.4.12",
|
|
76
78
|
"cpy-cli": "^5.0.0",
|
|
77
79
|
"madge": "^8.0.0",
|
|
78
80
|
"react": "^19.1.0",
|
|
@@ -89,5 +91,9 @@
|
|
|
89
91
|
"react-dom": ">=18",
|
|
90
92
|
"wagmi": ">=2.14.0"
|
|
91
93
|
},
|
|
92
|
-
"files": [
|
|
94
|
+
"files": [
|
|
95
|
+
"dist/**",
|
|
96
|
+
"src/**",
|
|
97
|
+
"!tsconfig.json"
|
|
98
|
+
]
|
|
93
99
|
}
|
package/src/AppDefault.tsx
CHANGED
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
AppExpandedContainer,
|
|
6
6
|
FlexContainer,
|
|
7
7
|
} from './components/AppContainer.js'
|
|
8
|
+
import { Expansion } from './components/Expansion/Expansion.js'
|
|
8
9
|
import { Header } from './components/Header/Header.js'
|
|
9
10
|
import { Initializer } from './components/Initializer.js'
|
|
10
|
-
import { RoutesExpanded } from './components/Routes/RoutesExpanded.js'
|
|
11
11
|
import { useWideVariant } from './hooks/useWideVariant.js'
|
|
12
12
|
import { useWidgetConfig } from './providers/WidgetProvider/WidgetProvider.js'
|
|
13
|
-
import {
|
|
13
|
+
import { createElementId, ElementId } from './utils/elements.js'
|
|
14
14
|
|
|
15
15
|
export const AppDefault = () => {
|
|
16
16
|
const { elementId } = useWidgetConfig()
|
|
@@ -27,7 +27,7 @@ export const AppDefault = () => {
|
|
|
27
27
|
</FlexContainer>
|
|
28
28
|
<Initializer />
|
|
29
29
|
</AppContainer>
|
|
30
|
-
{wideVariant
|
|
30
|
+
{wideVariant && <Expansion />}
|
|
31
31
|
</AppExpandedContainer>
|
|
32
32
|
)
|
|
33
33
|
}
|
package/src/AppProvider.tsx
CHANGED
|
@@ -11,11 +11,11 @@ import { QueryClientProvider } from './providers/QueryClientProvider.js'
|
|
|
11
11
|
import { ThemeProvider } from './providers/ThemeProvider/ThemeProvider.js'
|
|
12
12
|
import { WalletProvider } from './providers/WalletProvider/WalletProvider.js'
|
|
13
13
|
import {
|
|
14
|
-
WidgetProvider,
|
|
15
14
|
useWidgetConfig,
|
|
15
|
+
WidgetProvider,
|
|
16
16
|
} from './providers/WidgetProvider/WidgetProvider.js'
|
|
17
|
-
import { StoreProvider } from './stores/StoreProvider.js'
|
|
18
17
|
import { URLSearchParamsBuilder } from './stores/form/URLSearchParamsBuilder.js'
|
|
18
|
+
import { StoreProvider } from './stores/StoreProvider.js'
|
|
19
19
|
import type { WidgetConfigProps } from './types/widget.js'
|
|
20
20
|
|
|
21
21
|
export const AppProvider: React.FC<PropsWithChildren<WidgetConfigProps>> = ({
|
|
@@ -4,7 +4,8 @@ import { defaultMaxHeight } from '../config/constants.js'
|
|
|
4
4
|
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
5
5
|
import { useHeaderHeight } from '../stores/header/useHeaderStore.js'
|
|
6
6
|
import type { WidgetVariant } from '../types/widget.js'
|
|
7
|
-
import {
|
|
7
|
+
import { createElementId, ElementId } from '../utils/elements.js'
|
|
8
|
+
import { getWidgetMaxHeight } from '../utils/widgetSize.js'
|
|
8
9
|
|
|
9
10
|
// NOTE: the setting of the height in AppExpandedContainer, RelativeContainer and CssBaselineContainer can
|
|
10
11
|
// be done dynamically by values in the config - namely the config.theme.container values display, maxHeight and height
|
|
@@ -45,9 +46,7 @@ export const RelativeContainer = styled(Box, {
|
|
|
45
46
|
const maxHeight =
|
|
46
47
|
theme.container?.height === 'fit-content'
|
|
47
48
|
? 'none'
|
|
48
|
-
: theme
|
|
49
|
-
theme.container?.height ||
|
|
50
|
-
defaultMaxHeight
|
|
49
|
+
: getWidgetMaxHeight(theme)
|
|
51
50
|
return {
|
|
52
51
|
position: 'relative',
|
|
53
52
|
boxSizing: 'content-box',
|
|
@@ -57,12 +56,12 @@ export const RelativeContainer = styled(Box, {
|
|
|
57
56
|
background: theme.vars.palette.background.default,
|
|
58
57
|
overflow: 'auto',
|
|
59
58
|
flex: 1,
|
|
60
|
-
zIndex: 0,
|
|
61
59
|
...theme.container,
|
|
62
60
|
maxHeight:
|
|
63
61
|
theme.container?.display === 'flex' && !theme.container?.height
|
|
64
62
|
? '100%'
|
|
65
63
|
: maxHeight,
|
|
64
|
+
zIndex: 1, // NB: higher than of expansion containers
|
|
66
65
|
variants: [
|
|
67
66
|
{
|
|
68
67
|
props: {
|
|
@@ -91,9 +90,7 @@ const CssBaselineContainer = styled(ScopedCssBaseline, {
|
|
|
91
90
|
const maxHeight =
|
|
92
91
|
theme.container?.height === 'fit-content'
|
|
93
92
|
? 'none'
|
|
94
|
-
: theme
|
|
95
|
-
theme.container?.height ||
|
|
96
|
-
defaultMaxHeight
|
|
93
|
+
: getWidgetMaxHeight(theme)
|
|
97
94
|
return {
|
|
98
95
|
display: 'flex',
|
|
99
96
|
flex: 1,
|
|
@@ -116,12 +113,7 @@ const CssBaselineContainer = styled(ScopedCssBaseline, {
|
|
|
116
113
|
defaultMaxHeight,
|
|
117
114
|
},
|
|
118
115
|
'&:has(.long-list)': {
|
|
119
|
-
maxHeight:
|
|
120
|
-
theme.container?.maxHeight ||
|
|
121
|
-
(theme.container?.height !== 'fit-content'
|
|
122
|
-
? theme.container?.height
|
|
123
|
-
: undefined) ||
|
|
124
|
-
defaultMaxHeight,
|
|
116
|
+
maxHeight: getWidgetMaxHeight(theme),
|
|
125
117
|
},
|
|
126
118
|
}
|
|
127
119
|
})
|
|
@@ -71,7 +71,7 @@ export const ChainSelect = ({ formType }: FormTypeProps) => {
|
|
|
71
71
|
component="button"
|
|
72
72
|
onClick={() => setCurrentChain(chain.id)}
|
|
73
73
|
type={chainId === chain.id ? 'selected' : 'default'}
|
|
74
|
-
selectionColor="
|
|
74
|
+
selectionColor="secondary"
|
|
75
75
|
>
|
|
76
76
|
<Avatar
|
|
77
77
|
src={chain.logoURI}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { EVMChain } from '@lifi/sdk'
|
|
2
|
+
import { useCallback } from 'react'
|
|
2
3
|
import { useChains } from '../../hooks/useChains.js'
|
|
3
4
|
import { useSwapOnly } from '../../hooks/useSwapOnly.js'
|
|
4
5
|
import { useToAddressReset } from '../../hooks/useToAddressReset.js'
|
|
@@ -42,30 +43,43 @@ export const useChainSelect = (formType: FormType) => {
|
|
|
42
43
|
return selectedChains
|
|
43
44
|
}
|
|
44
45
|
|
|
45
|
-
const setCurrentChain = (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
const setCurrentChain = useCallback(
|
|
47
|
+
(chainId: number) => {
|
|
48
|
+
onChange(chainId)
|
|
49
|
+
if (swapOnly) {
|
|
50
|
+
setFieldValue(FormKeyHelper.getChainKey('to'), chainId, {
|
|
51
|
+
isTouched: true,
|
|
52
|
+
})
|
|
53
|
+
}
|
|
54
|
+
const tokenKey = FormKeyHelper.getTokenKey(formType)
|
|
55
|
+
if (!disabledUI?.includes(tokenKey as DisabledUI)) {
|
|
56
|
+
setFieldValue(tokenKey, '')
|
|
57
|
+
}
|
|
58
|
+
const amountKey = FormKeyHelper.getAmountKey(formType)
|
|
59
|
+
if (!disabledUI?.includes(amountKey as DisabledUI)) {
|
|
60
|
+
setFieldValue(amountKey, '')
|
|
61
|
+
}
|
|
62
|
+
setFieldValue('tokenSearchFilter', '')
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
64
|
+
const [toChainId] = getFieldValues('toChain')
|
|
65
|
+
const toChain = getChainById(toChainId)
|
|
66
|
+
if (toChain) {
|
|
67
|
+
tryResetToAddress(toChain)
|
|
68
|
+
}
|
|
69
|
+
setChainOrder(chainId, formType)
|
|
70
|
+
},
|
|
71
|
+
[
|
|
72
|
+
onChange,
|
|
73
|
+
swapOnly,
|
|
74
|
+
setFieldValue,
|
|
75
|
+
disabledUI,
|
|
76
|
+
formType,
|
|
77
|
+
getChainById,
|
|
78
|
+
tryResetToAddress,
|
|
79
|
+
setChainOrder,
|
|
80
|
+
getFieldValues,
|
|
81
|
+
]
|
|
82
|
+
)
|
|
69
83
|
|
|
70
84
|
return {
|
|
71
85
|
chainOrder,
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ListItem as ListItemBase,
|
|
3
|
+
listItemTextClasses,
|
|
4
|
+
Avatar as MuiAvatar,
|
|
5
|
+
List as MuiList,
|
|
6
|
+
ListItemAvatar as MuiListItemAvatar,
|
|
7
|
+
ListItemText as MuiListItemText,
|
|
8
|
+
styled,
|
|
9
|
+
} from '@mui/material'
|
|
10
|
+
import { ListItemButton as ListItemButtonBase } from '../ListItem/ListItemButton.js'
|
|
11
|
+
|
|
12
|
+
export const Avatar = styled(MuiAvatar)<{
|
|
13
|
+
size?: 'small' | 'medium'
|
|
14
|
+
}>(({ size = 'medium' }) => ({
|
|
15
|
+
width: size === 'small' ? 32 : 40,
|
|
16
|
+
height: size === 'small' ? 32 : 40,
|
|
17
|
+
}))
|
|
18
|
+
|
|
19
|
+
export const ListItemAvatar = styled(MuiListItemAvatar)<{
|
|
20
|
+
size?: 'small' | 'medium'
|
|
21
|
+
}>(({ size = 'medium' }) => ({
|
|
22
|
+
minWidth: size === 'small' ? 44 : 56,
|
|
23
|
+
}))
|
|
24
|
+
|
|
25
|
+
export const ListItemText = styled(MuiListItemText)<{
|
|
26
|
+
size?: 'small' | 'medium'
|
|
27
|
+
}>(({ size = 'medium' }) => ({
|
|
28
|
+
[`.${listItemTextClasses.primary}`]: {
|
|
29
|
+
fontWeight: 500,
|
|
30
|
+
fontSize: size === 'small' ? '1rem' : '1.125rem',
|
|
31
|
+
},
|
|
32
|
+
}))
|
|
33
|
+
|
|
34
|
+
export const ListItemButton = styled(ListItemButtonBase)<{
|
|
35
|
+
size?: 'small' | 'medium'
|
|
36
|
+
}>(({ size = 'medium', theme }) => {
|
|
37
|
+
return {
|
|
38
|
+
borderRadius: theme.vars.shape.borderRadius,
|
|
39
|
+
paddingLeft: size === 'small' ? theme.spacing(1) : theme.spacing(1.5),
|
|
40
|
+
height: size === 'small' ? 44 : 56,
|
|
41
|
+
}
|
|
42
|
+
})
|
|
43
|
+
|
|
44
|
+
export const List = styled(MuiList)(({ theme }) => ({
|
|
45
|
+
display: 'flex',
|
|
46
|
+
flexDirection: 'column',
|
|
47
|
+
gap: theme.spacing(0.5),
|
|
48
|
+
padding: 0,
|
|
49
|
+
marginLeft: theme.spacing(1.5),
|
|
50
|
+
marginRight: theme.spacing(1.5),
|
|
51
|
+
marginBottom: theme.spacing(1.5),
|
|
52
|
+
cursor: 'pointer',
|
|
53
|
+
}))
|
|
54
|
+
|
|
55
|
+
export const ListItem = styled(ListItemBase)(() => ({
|
|
56
|
+
position: 'absolute',
|
|
57
|
+
top: 0,
|
|
58
|
+
left: 0,
|
|
59
|
+
}))
|