diff --git a/package.json b/package.json index 02604c780..e788df7f4 100644 --- a/package.json +++ b/package.json @@ -29,12 +29,12 @@ "@types/big.js": "^6.1.6", "@types/eslint": "^8.37.0", "@types/events": "^3.0.0", - "@types/node": "^18.16.2", + "@types/node": "^18.16.3", "@types/react": "^18.2.0", "@types/react-dom": "^18.2.1", "@types/uuid": "^9.0.1", - "@typescript-eslint/eslint-plugin": "^5.59.1", - "@typescript-eslint/parser": "^5.59.1", + "@typescript-eslint/eslint-plugin": "^5.59.2", + "@typescript-eslint/parser": "^5.59.2", "cpy-cli": "^4.2.0", "eslint": "^8.39.0", "eslint-config-prettier": "^8.8.0", @@ -46,7 +46,6 @@ "eslint-plugin-react": "^7.32.2", "eslint-plugin-react-hooks": "^4.6.0", "lerna": "^6.6.1", - "nx": "^15.9.3", "prettier": "^2.8.8", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/packages/widget-embedded/package.json b/packages/widget-embedded/package.json index f89202463..f1e2e4e37 100644 --- a/packages/widget-embedded/package.json +++ b/packages/widget-embedded/package.json @@ -28,8 +28,8 @@ "@lifi/wallet-management": "^2.0.0-beta.4", "@lifi/widget": "^2.0.0-beta.5", "@mui/icons-material": "^5.11.16", - "@mui/lab": "^5.0.0-alpha.128", - "@mui/material": "^5.12.2", + "@mui/lab": "^5.0.0-alpha.129", + "@mui/material": "^5.12.3", "@opensea/seaport-js": "^1.2.0", "@tanstack/react-query": "^4.29.5", "bignumber.js": "^9.1.1", @@ -37,7 +37,7 @@ "events": "^3.3.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.10.0", + "react-router-dom": "^6.11.0", "web3": "^1.9.0" }, "devDependencies": { @@ -45,10 +45,10 @@ "@vitejs/plugin-react": "^4.0.0", "buffer": "^6.0.3", "esbuild": "^0.17.18", - "rollup": "^3.21.0", + "rollup": "^3.21.3", "rollup-plugin-polyfill-node": "^0.12.0", "typescript": "^5.0.4", - "vite": "^4.3.3", + "vite": "^4.3.4", "web-vitals": "^3.3.1" }, "eslintConfig": { diff --git a/packages/widget-playground/package.json b/packages/widget-playground/package.json index 7d1bfd9c2..f0ed29edf 100644 --- a/packages/widget-playground/package.json +++ b/packages/widget-playground/package.json @@ -27,20 +27,20 @@ "@lifi/wallet-management": "^2.0.0-beta.4", "@lifi/widget": "^2.0.0-beta.5", "@mui/icons-material": "^5.11.16", - "@mui/lab": "^5.0.0-alpha.128", - "@mui/material": "^5.12.2", + "@mui/lab": "^5.0.0-alpha.129", + "@mui/material": "^5.12.3", "ethers": "^5.7.2", "events": "^3.3.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.10.0" + "react-router-dom": "^6.11.0" }, "devDependencies": { "@esbuild-plugins/node-globals-polyfill": "^0.2.3", "@vitejs/plugin-react": "^4.0.0", "rollup-plugin-polyfill-node": "^0.12.0", "typescript": "^5.0.4", - "vite": "^4.3.3", + "vite": "^4.3.4", "web-vitals": "^3.3.1" }, "eslintConfig": { diff --git a/packages/widget-playground/src/App.tsx b/packages/widget-playground/src/App.tsx index 79f408e40..84d5efe08 100644 --- a/packages/widget-playground/src/App.tsx +++ b/packages/widget-playground/src/App.tsx @@ -1,5 +1,5 @@ import type { StaticToken } from '@lifi/sdk'; -import type { WidgetVariant } from '@lifi/widget'; +import type { WidgetSubvariant, WidgetVariant } from '@lifi/widget'; import { LiFiWidget } from '@lifi/widget'; import { Box, @@ -25,6 +25,7 @@ import { WalletButtons } from './components/WalletButtons'; import { WidgetEvents } from './components/WidgetEvents'; import { METAMASK_WALLET, + WidgetSubvariants, WidgetVariants, widgetBaseConfig, widgetConfig, @@ -44,6 +45,7 @@ export const App = () => { const [variant, setVariant] = useState( searchParams.drawer ? 'drawer' : 'expandable', ); + const [subvariant, setSubvariant] = useState('default'); const [fontFamily, setFontFamily] = useState('Inter var, Inter, sans-serif'); const [borderRadius, setBorderRadius] = useState(12); const [borderRadiusSecondary, setBorderRadiusSecondary] = useState(8); @@ -106,6 +108,7 @@ export const App = () => { components: widgetConfig.theme?.components, }, variant, + subvariant, })); }, [ borderRadius, @@ -115,6 +118,7 @@ export const App = () => { prefersDarkMode, primary, secondary, + subvariant, systemColor, variant, ]); @@ -220,6 +224,24 @@ export const App = () => { + + + Widget subvariant + + + ( return ( - - {drawerOpen ? : } - - + {!widgetConfig.hiddenUI?.includes(HiddenUI.DrawerButton) ? ( + + {drawerOpen ? ( + + ) : ( + + )} + + + ) : null} > = ({ }) => { return ( - + diff --git a/packages/widget/src/components/ChainSelect/useChainSelect.ts b/packages/widget/src/components/ChainSelect/useChainSelect.ts index 28b6628bc..dd15815a4 100644 --- a/packages/widget/src/components/ChainSelect/useChainSelect.ts +++ b/packages/widget/src/components/ChainSelect/useChainSelect.ts @@ -1,6 +1,6 @@ import type { EVMChain } from '@lifi/sdk'; import { useController, useFormContext } from 'react-hook-form'; -import { useChains } from '../../hooks'; +import { useChains, useSwapOnly } from '../../hooks'; import type { SwapFormType } from '../../providers'; import { SwapFormKey, SwapFormKeyHelper } from '../../providers'; import { useChainOrder } from '../../stores'; @@ -13,6 +13,7 @@ export const useChainSelect = (formType: SwapFormType) => { const { setValue } = useFormContext(); const { chains, isLoading } = useChains(); const [chainOrder, setChainOrder] = useChainOrder(); + const swapOnly = useSwapOnly(); const getChains = () => { if (!chains) { @@ -28,6 +29,11 @@ export const useChainSelect = (formType: SwapFormType) => { const setCurrentChain = (chainId: number) => { onChange(chainId); onBlur(); + if (swapOnly) { + setValue(SwapFormKeyHelper.getChainKey('to'), chainId, { + shouldTouch: true, + }); + } setValue(SwapFormKeyHelper.getTokenKey(formType), ''); setValue(SwapFormKeyHelper.getAmountKey(formType), ''); setValue(SwapFormKey.TokenSearchFilter, ''); diff --git a/packages/widget/src/components/Header/Header.style.ts b/packages/widget/src/components/Header/Header.style.ts index 0c4b59343..dd39dd076 100644 --- a/packages/widget/src/components/Header/Header.style.ts +++ b/packages/widget/src/components/Header/Header.style.ts @@ -43,4 +43,7 @@ export const WalletButton = styled(Button)(({ theme }) => ({ [`.${buttonClasses.endIcon} > *:nth-of-type(1)`]: { fontSize: '24px', }, + [`.${buttonClasses.startIcon} > *:nth-of-type(1)`]: { + fontSize: '24px', + }, })); diff --git a/packages/widget/src/components/Header/Header.tsx b/packages/widget/src/components/Header/Header.tsx index f9cd9b682..07eecc68c 100644 --- a/packages/widget/src/components/Header/Header.tsx +++ b/packages/widget/src/components/Header/Header.tsx @@ -2,7 +2,7 @@ import type { FC, PropsWithChildren } from 'react'; import { useLocation } from 'react-router-dom'; import { useDefaultElementId } from '../../hooks'; import { useWidgetConfig } from '../../providers'; -import { createElementId, ElementId, stickyHeaderRoutes } from '../../utils'; +import { ElementId, createElementId, stickyHeaderRoutes } from '../../utils'; import { Container } from './Header.style'; import { NavigationHeader } from './NavigationHeader'; import { WalletHeader } from './WalletHeader'; @@ -21,10 +21,10 @@ export const HeaderContainer: FC> = ({ children }) => { }; export const Header: FC = () => { - const { walletManagement } = useWidgetConfig(); + const { walletManagement, subvariant } = useWidgetConfig(); return ( - {!walletManagement ? : null} + {!walletManagement && subvariant !== 'split' ? : null} ); diff --git a/packages/widget/src/components/Header/NavigationHeader.tsx b/packages/widget/src/components/Header/NavigationHeader.tsx index f8fa281a4..bd5641b76 100644 --- a/packages/widget/src/components/Header/NavigationHeader.tsx +++ b/packages/widget/src/components/Header/NavigationHeader.tsx @@ -13,11 +13,13 @@ import { navigationRoutesValues, } from '../../utils'; import { HeaderAppBar } from './Header.style'; +import { NavigationTabs } from './NavigationTabs'; +import { WalletMenuButton } from './WalletHeader'; import { useHeaderActionStore } from './useHeaderActionStore'; export const NavigationHeader: React.FC = () => { const { t } = useTranslation(); - const { variant, hiddenUI } = useWidgetConfig(); + const { variant, subvariant, hiddenUI, walletManagement } = useWidgetConfig(); const { navigate, navigateBack } = useNavigateBack(); const { account } = useWallet(); const { element } = useHeaderActionStore(); @@ -29,6 +31,8 @@ export const NavigationHeader: React.FC = () => { const path = cleanedPathname.substring(cleanedPathname.lastIndexOf('/') + 1); const hasPath = navigationRoutesValues.includes(path); + const splitSubvariant = subvariant === 'split' && !hasPath; + const handleHeaderTitle = () => { switch (path) { case navigationRoutes.selectWallet: @@ -83,53 +87,68 @@ export const NavigationHeader: React.FC = () => { }; return ( - - {backButtonRoutes.includes(path) ? ( - - - - ) : null} - - {handleHeaderTitle()} - - - - {account.isActive && !hiddenUI?.includes(HiddenUI.History) ? ( - + <> + + {backButtonRoutes.includes(path) ? ( + + + + ) : null} + {splitSubvariant ? ( + + {!hiddenUI?.includes(HiddenUI.WalletMenu) ? ( + + ) : null} + + ) : ( + + {handleHeaderTitle()} + + )} + + + {account.isActive && !hiddenUI?.includes(HiddenUI.History) ? ( + + navigate(navigationRoutes.swapHistory)} + > + + + + ) : null} + navigate(navigationRoutes.swapHistory)} + onClick={() => navigate(navigationRoutes.settings)} + sx={{ + marginRight: -1.25, + }} > - + - ) : null} - - navigate(navigationRoutes.settings)} - sx={{ - marginRight: -1.25, - }} - > - - - - - } - /> - } /> - - + + } + /> + } /> + + + {splitSubvariant ? : null} + ); }; diff --git a/packages/widget/src/components/Header/NavigationTabs.style.tsx b/packages/widget/src/components/Header/NavigationTabs.style.tsx new file mode 100644 index 000000000..5e3f12aa9 --- /dev/null +++ b/packages/widget/src/components/Header/NavigationTabs.style.tsx @@ -0,0 +1,65 @@ +import type { TabProps } from '@mui/material'; +import { Tab, Tabs, tabClasses, tabsClasses } from '@mui/material'; +import { alpha, styled } from '@mui/material/styles'; + +export const NavbarTabs = styled(Tabs)(({ theme }) => ({ + backgroundColor: + theme.palette.mode === 'dark' + ? theme.palette.common.white + : alpha(theme.palette.common.black, 0.04), + borderRadius: theme.shape.borderRadius, + padding: theme.spacing(0.5), + flex: 1, + display: 'flex', + alignItems: 'center', + height: 56, + [`.${tabsClasses.flexContainer}`]: { + alignItems: 'center', + }, + [`.${tabsClasses.scroller}`]: { + overflow: 'initial !important', + }, + [`.${tabsClasses.indicator}`]: { + position: 'absolute', + top: '50%', + transform: 'translateY(-50%)', + height: 48, + backgroundColor: + theme.palette.mode === 'dark' + ? theme.palette.common.black + : theme.palette.common.white, + borderRadius: theme.shape.borderRadiusSecondary, + boxShadow: `0px 2px 4px ${alpha(theme.palette.common.black, 0.04)}`, + }, +})); + +export const NavbarTab = styled(Tab, { + shouldForwardProp: (prop) => prop !== 'isDarkMode', +})(({ theme }) => ({ + zIndex: 1, + display: 'flex', + flex: 1, + justifyContent: 'center', + alignItems: 'center', + flexDirection: 'row', + textTransform: 'none', + height: 48, + minHeight: 48, + fontSize: '1rem', + fontWeight: 700, + color: + theme.palette.mode === 'dark' + ? theme.palette.common.white + : theme.palette.common.black, + textDecoration: 'none', + [`&.${tabClasses.selected}`]: { + color: + theme.palette.mode === 'dark' + ? theme.palette.common.white + : theme.palette.common.black, + backgroundColor: 'transparent', + }, + [`.${tabClasses.iconWrapper}`]: { + margin: theme.spacing(0, 1, 0, 0), + }, +})); diff --git a/packages/widget/src/components/Header/NavigationTabs.tsx b/packages/widget/src/components/Header/NavigationTabs.tsx new file mode 100644 index 000000000..d1265444e --- /dev/null +++ b/packages/widget/src/components/Header/NavigationTabs.tsx @@ -0,0 +1,35 @@ +import { useFormContext } from 'react-hook-form'; +import { useTranslation } from 'react-i18next'; +import { SwapFormKey } from '../../providers'; +import { useSplitSubvariantStore } from '../../stores'; +import { HeaderAppBar } from './Header.style'; +import { NavbarTab, NavbarTabs } from './NavigationTabs.style'; + +export const NavigationTabs = () => { + const { t } = useTranslation(); + const [state, setState] = useSplitSubvariantStore((state) => [ + state.state, + state.setState, + ]); + const { setValue } = useFormContext(); + const handleChange = (_: React.SyntheticEvent, value: number) => { + setValue(SwapFormKey.FromAmount, ''); + setValue(SwapFormKey.FromToken, ''); + setValue(SwapFormKey.ToToken, ''); + setState(value === 0 ? 'swap' : 'bridge'); + }; + + return ( + + + + + + + ); +}; diff --git a/packages/widget/src/components/Header/WalletHeader.tsx b/packages/widget/src/components/Header/WalletHeader.tsx index a29debd89..6df181c2f 100644 --- a/packages/widget/src/components/Header/WalletHeader.tsx +++ b/packages/widget/src/components/Header/WalletHeader.tsx @@ -14,22 +14,26 @@ import { HeaderAppBar, WalletButton } from './Header.style'; import { WalletMenu } from './WalletMenu'; export const WalletHeader: React.FC = () => { - const { account } = useWallet(); return ( - {account.isActive ? : } + ); }; +export const WalletMenuButton: React.FC = () => { + const { account } = useWallet(); + return account.isActive ? : ; +}; + const ConnectButton = () => { const { t } = useTranslation(); const { pathname } = useLocation(); - const config = useWidgetConfig(); + const { walletManagement, subvariant } = useWidgetConfig(); const { connect: connectWallet } = useWallet(); const navigate = useNavigate(); const connect = async () => { - if (config.walletManagement) { + if (walletManagement) { await connectWallet(); return; } @@ -37,12 +41,14 @@ const ConnectButton = () => { }; return ( } + endIcon={subvariant !== 'split' ? : undefined} + startIcon={subvariant === 'split' ? : undefined} onClick={ !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined } sx={{ - marginRight: -1.25, + marginRight: subvariant === 'split' ? 0 : -1.25, + marginLeft: subvariant === 'split' ? -1.25 : 0, }} > {t(`button.connectWallet`)} @@ -52,6 +58,7 @@ const ConnectButton = () => { const ConnectedButton = () => { const { t } = useTranslation(); + const { subvariant } = useWidgetConfig(); const { account, disconnect } = useWallet(); const walletAddress = shortenWalletAddress(account.address); const { chain } = useChain(account.chainId); @@ -89,7 +96,8 @@ const ConnectedButton = () => { } sx={{ - marginRight: -1.25, + marginRight: subvariant === 'split' ? 0 : -1.25, + marginLeft: subvariant === 'split' ? -1 : 0, }} onClick={handleClick} > diff --git a/packages/widget/src/components/Header/useHeaderActionStore.ts b/packages/widget/src/components/Header/useHeaderActionStore.ts index a64e47844..78ec7d22d 100644 --- a/packages/widget/src/components/Header/useHeaderActionStore.ts +++ b/packages/widget/src/components/Header/useHeaderActionStore.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import { create } from 'zustand'; import type { HeaderActionStore } from './types'; diff --git a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx index ad6a51fe1..c0612571c 100644 --- a/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx +++ b/packages/widget/src/components/SelectTokenButton/SelectTokenButton.tsx @@ -2,7 +2,7 @@ import { Skeleton } from '@mui/material'; import { useWatch } from 'react-hook-form'; import { useTranslation } from 'react-i18next'; import { useNavigate } from 'react-router-dom'; -import { useChain, useToken } from '../../hooks'; +import { useChain, useSwapOnly, useToken } from '../../hooks'; import type { SwapFormTypeProps } from '../../providers'; import { SwapFormKeyHelper, useWidgetConfig } from '../../providers'; import { navigationRoutes } from '../../utils'; @@ -18,6 +18,7 @@ export const SelectTokenButton: React.FC< const { t } = useTranslation(); const navigate = useNavigate(); const { disabledUI, variant } = useWidgetConfig(); + const swapOnly = useSwapOnly(); const tokenKey = SwapFormKeyHelper.getTokenKey(formType); const [chainId, tokenAddress] = useWatch({ name: [SwapFormKeyHelper.getChainKey(formType), tokenKey], @@ -39,8 +40,10 @@ export const SelectTokenButton: React.FC< const onClick = !disabledUI?.includes(tokenKey) ? handleClick : undefined; const defaultPlaceholder = formType === 'to' && variant === 'refuel' - ? t(`header.selectChain`) - : t(`swap.selectChainAndToken`); + ? t('swap.selectChain') + : formType === 'to' && swapOnly + ? t('swap.selectToken') + : t('swap.selectChainAndToken'); const cardTitle = formType === 'from' && variant === 'nft' ? t(`header.payWith`) diff --git a/packages/widget/src/hooks/index.ts b/packages/widget/src/hooks/index.ts index 3e227f8db..6d8b1257a 100644 --- a/packages/widget/src/hooks/index.ts +++ b/packages/widget/src/hooks/index.ts @@ -15,12 +15,13 @@ export * from './useNavigateBack'; export * from './useProcessMessage'; export * from './useRouteExecution'; export * from './useScrollableContainer'; +export * from './useSwapOnly'; export * from './useSwapRoutes'; export * from './useToken'; export * from './useTokenAddressBalance'; export * from './useTokenBalance'; export * from './useTokenBalances'; -export * from './useTokens'; export * from './useTokenSearch'; +export * from './useTokens'; export * from './useTools'; export * from './useWidgetEvents'; diff --git a/packages/widget/src/hooks/useContentHeight.ts b/packages/widget/src/hooks/useContentHeight.ts index 0e002181a..4fc4c7406 100644 --- a/packages/widget/src/hooks/useContentHeight.ts +++ b/packages/widget/src/hooks/useContentHeight.ts @@ -1,16 +1,16 @@ import type { MutableRefObject } from 'react'; import { useLayoutEffect, useState } from 'react'; -import { createElementId, ElementId } from '../utils'; +import { ElementId, createElementId } from '../utils'; import { useDefaultElementId } from './useDefaultElementId'; import { getScrollableContainer } from './useScrollableContainer'; const getContentHeight = (elementId: string) => { - const headerElement = document.getElementById( - createElementId(ElementId.Header, elementId), - ); const containerElement = document.getElementById( createElementId(ElementId.ScrollableContainer, elementId), ); + const headerElement = document.getElementById( + createElementId(ElementId.Header, elementId), + ); if (!containerElement || !headerElement) { console.warn( `Can't find ${ElementId.ScrollableContainer} or ${ElementId.Header} id.`, @@ -24,13 +24,9 @@ const getContentHeight = (elementId: string) => { export const useContentHeight = () => { const elementId = useDefaultElementId(); - const [contentHeight, setContentHeight] = useState(() => - getContentHeight(elementId), - ); + const [contentHeight, setContentHeight] = useState(0); useLayoutEffect(() => { - if (!contentHeight) { - setContentHeight(getContentHeight(elementId)); - } + setContentHeight(getContentHeight(elementId)); // eslint-disable-next-line react-hooks/exhaustive-deps }, []); return contentHeight; diff --git a/packages/widget/src/hooks/useInitializer.ts b/packages/widget/src/hooks/useInitializer.ts index ba8200343..cbfb55b66 100644 --- a/packages/widget/src/hooks/useInitializer.ts +++ b/packages/widget/src/hooks/useInitializer.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import { checkPackageUpdates } from '@lifi/sdk'; import { useEffect } from 'react'; import { name, version } from '../config/version'; diff --git a/packages/widget/src/hooks/useSwapOnly.ts b/packages/widget/src/hooks/useSwapOnly.ts new file mode 100644 index 000000000..685432f6f --- /dev/null +++ b/packages/widget/src/hooks/useSwapOnly.ts @@ -0,0 +1,6 @@ +import { useSplitSubvariantStore } from '../stores'; + +export const useSwapOnly = () => { + const state = useSplitSubvariantStore((state) => state.state); + return state === 'swap'; +}; diff --git a/packages/widget/src/hooks/useSwapRoutes.ts b/packages/widget/src/hooks/useSwapRoutes.ts index a377c21a4..9ff76abfa 100644 --- a/packages/widget/src/hooks/useSwapRoutes.ts +++ b/packages/widget/src/hooks/useSwapRoutes.ts @@ -8,6 +8,7 @@ import { v4 as uuidv4 } from 'uuid'; import { useDebouncedWatch, useGasRefuel, useToken } from '.'; import { SwapFormKey, useLiFi, useWallet, useWidgetConfig } from '../providers'; import { useSettings } from '../stores'; +import { useSwapOnly } from './useSwapOnly'; const refetchTime = 60_000; @@ -24,6 +25,7 @@ export const useSwapRoutes = ({ const { variant, sdkConfig, insurance, contractTool } = useWidgetConfig(); const { account, provider } = useWallet(); const queryClient = useQueryClient(); + const swapOnly = useSwapOnly(); const { slippage, enabledBridges, @@ -97,7 +99,7 @@ export const useSwapRoutes = ({ toContractCallData, toContractGasLimit, slippage, - enabledBridges, + swapOnly ? [] : enabledBridges, enabledExchanges, routePriority, variant, diff --git a/packages/widget/src/hooks/useTools.ts b/packages/widget/src/hooks/useTools.ts index 516c36bd2..546adcf36 100644 --- a/packages/widget/src/hooks/useTools.ts +++ b/packages/widget/src/hooks/useTools.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import type { ToolsResponse } from '@lifi/sdk'; import { useQuery } from '@tanstack/react-query'; import { isItemAllowed, useLiFi, useWidgetConfig } from '../providers'; diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index 39d01bb2a..311bf3f32 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -176,9 +176,9 @@ "rateChange": "Rate change", "receiving": "Receiving", "refuelStepDetails": "Get gas via {{tool}}", - "selectChain": "Chain", + "selectChain": "Select chain", "selectChainAndToken": "Select chain and token", - "selectToken": "Token", + "selectToken": "Select token", "sendToAddress": "Send to {{address}}", "sendToWallet": "Send to a different wallet", "sentToAddress": "Sent to {{address}}", diff --git a/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx b/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx index 17faedc4d..ec0bdc024 100644 --- a/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx +++ b/packages/widget/src/pages/SelectTokenPage/SelectTokenPage.tsx @@ -7,6 +7,7 @@ import { useContentHeight, useNavigateBack, useScrollableOverflowHidden, + useSwapOnly, } from '../../hooks'; import type { SwapFormTypeProps } from '../../providers'; import { SearchTokenInput } from './SearchTokenInput'; @@ -19,6 +20,7 @@ export const SelectTokenPage: FC = ({ formType }) => { const headerRef = useRef(null); const contentHeight = useContentHeight(); const [tokenListHeight, setTokenListHeight] = useState(0); + const swapOnly = useSwapOnly(); useLayoutEffect(() => { setTokenListHeight( @@ -29,11 +31,13 @@ export const SelectTokenPage: FC = ({ formType }) => { ); }, [contentHeight]); + const hideChainSelect = swapOnly && formType === 'to'; + return ( - - + {!hideChainSelect ? : null} + diff --git a/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx b/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx index d3b7a07cd..843aa28f2 100644 --- a/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx +++ b/packages/widget/src/providers/SwapFormProvider/FormUpdater.tsx @@ -43,6 +43,7 @@ export const FormUpdater: React.FC<{ ); if (!fromChain && !isFromChainTouched && !isFromTokenTouched) { + resetField(SwapFormKey.FromChain, { defaultValue: account.chainId }); setValue(SwapFormKey.FromChain, account.chainId); setValue(SwapFormKey.FromToken, ''); if (isFromAmountTouched) { @@ -50,6 +51,7 @@ export const FormUpdater: React.FC<{ } } if (!toChain && !isToChainTouched && !isToTokenTouched) { + resetField(SwapFormKey.ToChain, { defaultValue: account.chainId }); setValue(SwapFormKey.ToChain, account.chainId); setValue(SwapFormKey.ToToken, ''); } @@ -60,6 +62,7 @@ export const FormUpdater: React.FC<{ fromChain, getFieldState, getValues, + resetField, setValue, toChain, ]); diff --git a/packages/widget/src/stores/StoreProvider.tsx b/packages/widget/src/stores/StoreProvider.tsx index f1b6fe562..c53fa5006 100644 --- a/packages/widget/src/stores/StoreProvider.tsx +++ b/packages/widget/src/stores/StoreProvider.tsx @@ -1,13 +1,19 @@ import type { PropsWithChildren } from 'react'; +import type { WidgetConfigProps } from '../types'; import { RouteExecutionStoreProvider } from './routes'; -import type { PersistStoreProviderProps } from './types'; +import { SplitSubvariantStoreProvider } from './settings'; -export const StoreProvider: React.FC< - PropsWithChildren -> = ({ children, namePrefix }) => { +export const StoreProvider: React.FC> = ({ + children, + config, +}) => { return ( - - {children} - + + + {children} + + ); }; diff --git a/packages/widget/src/stores/chains/useChainOrderStore.ts b/packages/widget/src/stores/chains/useChainOrderStore.ts index 7ef801262..6ab1364af 100644 --- a/packages/widget/src/stores/chains/useChainOrderStore.ts +++ b/packages/widget/src/stores/chains/useChainOrderStore.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import type { StateCreator } from 'zustand'; import { create } from 'zustand'; import { persist } from 'zustand/middleware'; diff --git a/packages/widget/src/stores/routes/RouteExecutionStore.tsx b/packages/widget/src/stores/routes/RouteExecutionStore.tsx index 9da4b087f..cee6b021f 100644 --- a/packages/widget/src/stores/routes/RouteExecutionStore.tsx +++ b/packages/widget/src/stores/routes/RouteExecutionStore.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import { createContext, useContext, useRef } from 'react'; import type { StoreApi, UseBoundStore } from 'zustand'; import type { PersistStoreProviderProps } from '../types'; diff --git a/packages/widget/src/stores/settings/index.ts b/packages/widget/src/stores/settings/index.ts index 6704ed0ce..25337ecbb 100644 --- a/packages/widget/src/stores/settings/index.ts +++ b/packages/widget/src/stores/settings/index.ts @@ -3,3 +3,4 @@ export * from './useAppearance'; export * from './useSendToWalletStore'; export * from './useSettings'; export * from './useSettingsStore'; +export * from './useSplitSubvariantStore'; diff --git a/packages/widget/src/stores/settings/types.ts b/packages/widget/src/stores/settings/types.ts index 1c5161628..b28ea604b 100644 --- a/packages/widget/src/stores/settings/types.ts +++ b/packages/widget/src/stores/settings/types.ts @@ -1,4 +1,6 @@ import type { Order } from '@lifi/sdk'; +import type { PropsWithChildren } from 'react'; +import type { StoreApi, UseBoundStore } from 'zustand'; import type { Appearance, WidgetConfig } from '../../types'; export type ValueSetter = ( @@ -52,3 +54,19 @@ export interface SendToWalletStore extends SendToWalletState { toggleSendToWallet(): void; setSendToWallet(value: boolean): void; } + +export interface SplitSubvariantState { + state?: 'swap' | 'bridge'; + setState(state: 'swap' | 'bridge'): void; +} + +export type SplitSubvariantStore = UseBoundStore< + StoreApi +>; + +export interface SplitSubvariantProps { + state?: 'swap' | 'bridge'; +} + +export type SplitSubvariantProviderProps = + PropsWithChildren; diff --git a/packages/widget/src/stores/settings/useSettingsStore.ts b/packages/widget/src/stores/settings/useSettingsStore.ts index 4ef1a472d..813e29189 100644 --- a/packages/widget/src/stores/settings/useSettingsStore.ts +++ b/packages/widget/src/stores/settings/useSettingsStore.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-underscore-dangle */ import type { StateCreator } from 'zustand'; import { create } from 'zustand'; import { persist } from 'zustand/middleware'; diff --git a/packages/widget/src/stores/settings/useSplitSubvariantStore.tsx b/packages/widget/src/stores/settings/useSplitSubvariantStore.tsx new file mode 100644 index 000000000..1f9f0b8a4 --- /dev/null +++ b/packages/widget/src/stores/settings/useSplitSubvariantStore.tsx @@ -0,0 +1,67 @@ +import { createContext, useContext, useRef } from 'react'; +import { create } from 'zustand'; +import type { + SplitSubvariantProps, + SplitSubvariantProviderProps, + SplitSubvariantState, + SplitSubvariantStore, +} from './types'; + +export const SplitSubvariantStoreContext = + createContext(null); + +const shouldRecreateStore = ( + store: SplitSubvariantStore, + props: SplitSubvariantProps, +) => { + const { state } = store.getState(); + return (!state && props.state) || (state && !props.state); +}; + +export function SplitSubvariantStoreProvider({ + children, + ...props +}: SplitSubvariantProviderProps) { + const storeRef = useRef(); + if (!storeRef.current || shouldRecreateStore(storeRef.current, props)) { + storeRef.current = createSplitSubvariantStore(props); + } + return ( + + {children} + + ); +} + +export function useSplitSubvariantStore( + selector: (state: SplitSubvariantState) => T, + equalityFn?: (left: T, right: T) => boolean, +): T { + const useStore = useContext(SplitSubvariantStoreContext); + if (!useStore) { + throw new Error( + `You forgot to wrap your component in <${SplitSubvariantStoreProvider.name}>.`, + ); + } + return useStore(selector, equalityFn); +} + +export function useSplitSubvariantStoreContext() { + const useStore = useContext(SplitSubvariantStoreContext); + if (!useStore) { + throw new Error( + `You forgot to wrap your component in <${SplitSubvariantStoreProvider.name}>.`, + ); + } + return useStore; +} + +export const createSplitSubvariantStore = ({ state }: SplitSubvariantProps) => + create((set) => ({ + state, + setState(state) { + set(() => ({ + state, + })); + }, + })); diff --git a/packages/widget/src/types/widget.ts b/packages/widget/src/types/widget.ts index 9cec6e7e0..b6922e303 100644 --- a/packages/widget/src/types/widget.ts +++ b/packages/widget/src/types/widget.ts @@ -25,6 +25,8 @@ export type WidgetVariant = | 'refuel' | 'nft'; +export type WidgetSubvariant = 'default' | 'split'; + export enum DisabledUI { FromAmount = 'fromAmount', FromToken = 'fromToken', @@ -35,12 +37,12 @@ export type DisabledUIType = `${DisabledUI}`; export enum HiddenUI { Appearance = 'appearance', - // FromAmount = 'fromAmount', + DrawerButton = 'drawerButton', + History = 'history', Language = 'language', PoweredBy = 'poweredBy', ToAddress = 'toAddress', - History = 'history', - // ToToken = 'toToken', + WalletMenu = 'walletMenu', } export type HiddenUIType = `${HiddenUI}`; @@ -120,6 +122,7 @@ export interface WidgetConfig { insurance?: boolean; variant?: WidgetVariant; + subvariant?: WidgetSubvariant; appearance?: Appearance; theme?: ThemeConfig; diff --git a/yarn.lock b/yarn.lock index dd43cf0ae..fb4cd654d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1574,19 +1574,6 @@ __metadata: languageName: node linkType: hard -"@emotion/cache@npm:^11.10.7": - version: 11.10.7 - resolution: "@emotion/cache@npm:11.10.7" - dependencies: - "@emotion/memoize": ^0.8.0 - "@emotion/sheet": ^1.2.1 - "@emotion/utils": ^1.2.0 - "@emotion/weak-memoize": ^0.3.0 - stylis: 4.1.3 - checksum: 6b1efed2dffc93dac419409d91f6d57a200d858ec5ffa4b7c30080fdbd93db431ff86bb779c5b8830b8373f3c5dd754d9beb386604ed2667c7d55608ff653dfc - languageName: node - linkType: hard - "@emotion/cache@npm:^11.10.8": version: 11.10.8 resolution: "@emotion/cache@npm:11.10.8" @@ -2826,8 +2813,8 @@ __metadata: "@lifi/wallet-management": ^2.0.0-beta.4 "@lifi/widget": ^2.0.0-beta.5 "@mui/icons-material": ^5.11.16 - "@mui/lab": ^5.0.0-alpha.128 - "@mui/material": ^5.12.2 + "@mui/lab": ^5.0.0-alpha.129 + "@mui/material": ^5.12.3 "@opensea/seaport-js": ^1.2.0 "@tanstack/react-query": ^4.29.5 "@vitejs/plugin-react": ^4.0.0 @@ -2838,11 +2825,11 @@ __metadata: events: ^3.3.0 react: ^18.2.0 react-dom: ^18.2.0 - react-router-dom: ^6.10.0 - rollup: ^3.21.0 + react-router-dom: ^6.11.0 + rollup: ^3.21.3 rollup-plugin-polyfill-node: ^0.12.0 typescript: ^5.0.4 - vite: ^4.3.3 + vite: ^4.3.4 web-vitals: ^3.3.1 web3: ^1.9.0 languageName: unknown @@ -2857,17 +2844,17 @@ __metadata: "@lifi/wallet-management": ^2.0.0-beta.4 "@lifi/widget": ^2.0.0-beta.5 "@mui/icons-material": ^5.11.16 - "@mui/lab": ^5.0.0-alpha.128 - "@mui/material": ^5.12.2 + "@mui/lab": ^5.0.0-alpha.129 + "@mui/material": ^5.12.3 "@vitejs/plugin-react": ^4.0.0 ethers: ^5.7.2 events: ^3.3.0 react: ^18.2.0 react-dom: ^18.2.0 - react-router-dom: ^6.10.0 + react-router-dom: ^6.11.0 rollup-plugin-polyfill-node: ^0.12.0 typescript: ^5.0.4 - vite: ^4.3.3 + vite: ^4.3.4 web-vitals: ^3.3.1 languageName: unknown linkType: soft @@ -2885,8 +2872,8 @@ __metadata: "@lifi/sdk": ^2.0.0-beta.11 "@lifi/wallet-management": ^2.0.0-beta.4 "@mui/icons-material": ^5.11.16 - "@mui/lab": ^5.0.0-alpha.128 - "@mui/material": ^5.12.2 + "@mui/lab": ^5.0.0-alpha.129 + "@mui/material": ^5.12.3 "@tanstack/react-query": ^4.29.5 "@tanstack/react-virtual": ^3.0.0-beta.54 big.js: ^6.2.1 @@ -2900,7 +2887,7 @@ __metadata: react-hook-form: ^7.43.9 react-i18next: ^12.2.2 react-intersection-observer: ^9.4.3 - react-router-dom: ^6.10.0 + react-router-dom: ^6.11.0 react-timer-hook: ^3.0.5 typescript: ^5.0.4 uuid: ^9.0.0 @@ -2934,14 +2921,14 @@ __metadata: languageName: node linkType: hard -"@mui/base@npm:5.0.0-alpha.127": - version: 5.0.0-alpha.127 - resolution: "@mui/base@npm:5.0.0-alpha.127" +"@mui/base@npm:5.0.0-alpha.128": + version: 5.0.0-alpha.128 + resolution: "@mui/base@npm:5.0.0-alpha.128" dependencies: "@babel/runtime": ^7.21.0 "@emotion/is-prop-valid": ^1.2.0 "@mui/types": ^7.2.4 - "@mui/utils": ^5.12.0 + "@mui/utils": ^5.12.3 "@popperjs/core": ^2.11.7 clsx: ^1.2.1 prop-types: ^15.8.1 @@ -2953,14 +2940,14 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 330baeef1fdaa513707f295e07a3436af24d0831a18109ed877f76b86cf1f392309833d33a2c7ca250db79fdf53f5e88c2618f876f50dbbbf9323bbf08e367e7 + checksum: 882a68a1e305a4e42ce904f307436ff07786f2213241b7c972912c9737a9ca23e1a0e62d374debed40050c4dd698baa26c849b814d3b1649e8d6d825de1e26ef languageName: node linkType: hard -"@mui/core-downloads-tracker@npm:^5.12.2": - version: 5.12.2 - resolution: "@mui/core-downloads-tracker@npm:5.12.2" - checksum: d748bdc56df6fdfe6712550a94263cf094c53ddcb70f6a8f633caf23927edf5ac88b1f888429d895fe2a5045b27eb7aa9826ccee5b917e31973667d604ed87fe +"@mui/core-downloads-tracker@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/core-downloads-tracker@npm:5.12.3" + checksum: ad9c9e4f03a3c09e3a2d68d48c1a2c336b844878ee0ed3ca0062668ed065ad9616251802cf3329e748ba059d82861dc5631a231073397d6c659fe9dcca952b5c languageName: node linkType: hard @@ -2980,15 +2967,15 @@ __metadata: languageName: node linkType: hard -"@mui/lab@npm:^5.0.0-alpha.128": - version: 5.0.0-alpha.128 - resolution: "@mui/lab@npm:5.0.0-alpha.128" +"@mui/lab@npm:^5.0.0-alpha.129": + version: 5.0.0-alpha.129 + resolution: "@mui/lab@npm:5.0.0-alpha.129" dependencies: "@babel/runtime": ^7.21.0 - "@mui/base": 5.0.0-alpha.127 - "@mui/system": ^5.12.1 + "@mui/base": 5.0.0-alpha.128 + "@mui/system": ^5.12.3 "@mui/types": ^7.2.4 - "@mui/utils": ^5.12.0 + "@mui/utils": ^5.12.3 clsx: ^1.2.1 prop-types: ^15.8.1 react-is: ^18.2.0 @@ -3006,20 +2993,20 @@ __metadata: optional: true "@types/react": optional: true - checksum: dc7f4d53c5ffbdf11c7018a65cd0fad82fe0d956c5f1569a693636110b837321bd42a2ac46cbde918b47262ed1566019fffc3ce5e8a32ed18eaa2185112d7eb9 + checksum: 0ea3d173b10aaf9123a2e976d6496a7a49ee8914ff42855605e09dcbdbb8ddcde4ba60d8b20275faeb593069edd12622aa26baedaa7d5326171a8cd4abd76a2c languageName: node linkType: hard -"@mui/material@npm:^5.12.2": - version: 5.12.2 - resolution: "@mui/material@npm:5.12.2" +"@mui/material@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/material@npm:5.12.3" dependencies: "@babel/runtime": ^7.21.0 - "@mui/base": 5.0.0-alpha.127 - "@mui/core-downloads-tracker": ^5.12.2 - "@mui/system": ^5.12.1 + "@mui/base": 5.0.0-alpha.128 + "@mui/core-downloads-tracker": ^5.12.3 + "@mui/system": ^5.12.3 "@mui/types": ^7.2.4 - "@mui/utils": ^5.12.0 + "@mui/utils": ^5.12.3 "@types/react-transition-group": ^4.4.5 clsx: ^1.2.1 csstype: ^3.1.2 @@ -3039,16 +3026,16 @@ __metadata: optional: true "@types/react": optional: true - checksum: a3464dfbcc496164967e134d6f1d40e060ee02fc2ddb5fcf648ca85580efdbd5eff5aab6a73486d0a7f329f7299127b52501a13993bb131cbd4e310c7f2e633f + checksum: ccd42e4f8cf04ce00d0078b85bb0a4c96822a1ed327138c591efc00bfe07d7b6299a88b4c86d0a185e28d4816458b6651e46d58ae6966e8af2d45d39b919be52 languageName: node linkType: hard -"@mui/private-theming@npm:^5.12.0": - version: 5.12.0 - resolution: "@mui/private-theming@npm:5.12.0" +"@mui/private-theming@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/private-theming@npm:5.12.3" dependencies: "@babel/runtime": ^7.21.0 - "@mui/utils": ^5.12.0 + "@mui/utils": ^5.12.3 prop-types: ^15.8.1 peerDependencies: "@types/react": ^17.0.0 || ^18.0.0 @@ -3056,16 +3043,16 @@ __metadata: peerDependenciesMeta: "@types/react": optional: true - checksum: 761bc7a57e1643c2c4c327886882fa5efc7bacae1c6fffe6be4197f49d337261c916a883d96996445efcdedc0672251725c1e5b264b6250d6c9527fd0cafcc62 + checksum: 4607951eff066085a42172254755433788aafcfdcc58f93589a821939b56f9f943f16d30edc99610f439b8e265c5182608de711ec15ca6268a4c7000ad37a1dc languageName: node linkType: hard -"@mui/styled-engine@npm:^5.12.0": - version: 5.12.0 - resolution: "@mui/styled-engine@npm:5.12.0" +"@mui/styled-engine@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/styled-engine@npm:5.12.3" dependencies: "@babel/runtime": ^7.21.0 - "@emotion/cache": ^11.10.7 + "@emotion/cache": ^11.10.8 csstype: ^3.1.2 prop-types: ^15.8.1 peerDependencies: @@ -3077,19 +3064,19 @@ __metadata: optional: true "@emotion/styled": optional: true - checksum: 4a415473cf62aa05012f667dd2e9b1dc2fb175be5b0c4d0b8df541e2dac3d7db410e920e0d5910c8e2b8996a4fb51f74d79483e2878a9b5c0d334498f5537d74 + checksum: bd96f276013fa1578b54426d70896203928927fdaf158ad7645e6cb43c42c8a535307451666cea7e04d69ad44d33ab3ab8a0d24eff32c0c364f8b5e82281fe69 languageName: node linkType: hard -"@mui/system@npm:^5.12.1": - version: 5.12.1 - resolution: "@mui/system@npm:5.12.1" +"@mui/system@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/system@npm:5.12.3" dependencies: "@babel/runtime": ^7.21.0 - "@mui/private-theming": ^5.12.0 - "@mui/styled-engine": ^5.12.0 + "@mui/private-theming": ^5.12.3 + "@mui/styled-engine": ^5.12.3 "@mui/types": ^7.2.4 - "@mui/utils": ^5.12.0 + "@mui/utils": ^5.12.3 clsx: ^1.2.1 csstype: ^3.1.2 prop-types: ^15.8.1 @@ -3105,7 +3092,7 @@ __metadata: optional: true "@types/react": optional: true - checksum: b951959bf5e5af581319354c044f441d97849ff120cfec111d2ed5e7fa05efd63721acff96f48093b8e2bdeb5ccbe35c48613fb925be2b58c596447d10dbed3e + checksum: c2f0e55e8ff5a55f75ecc829a4c5877c9cafa834c106856318053459f1bf8f794b9e84d258b932507d4c35c76a32d3622e3fa49005e6754503d173b491e6a594 languageName: node linkType: hard @@ -3121,9 +3108,9 @@ __metadata: languageName: node linkType: hard -"@mui/utils@npm:^5.12.0": - version: 5.12.0 - resolution: "@mui/utils@npm:5.12.0" +"@mui/utils@npm:^5.12.3": + version: 5.12.3 + resolution: "@mui/utils@npm:5.12.3" dependencies: "@babel/runtime": ^7.21.0 "@types/prop-types": ^15.7.5 @@ -3132,7 +3119,7 @@ __metadata: react-is: ^18.2.0 peerDependencies: react: ^17.0.0 || ^18.0.0 - checksum: 87b2c7468803b083f50af28d7c215c45291e73fef16570848b596d0f1cde1fc613c20e8951f431217b31451de254744abd50eda5013dedec4982420b5bf1c6b6 + checksum: bec2d8e173805e2a7446aa4fa7a3119d96a62787b685dbf59908f337daec922fa74a54bc60038cf1269621aebb7b61e7a52caa4ac4daa0140c5e290adce20160 languageName: node linkType: hard @@ -3451,15 +3438,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/cli@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/cli@npm:15.9.3" - dependencies: - nx: 15.9.3 - checksum: 7e311876825a04878baba44b73de6beb49398344fccf9de16ab0a6370e3f75eb9a469665a8b9ec3989e6f48a944f42b06dab53f851fd60e15e90385dbdf209c9 - languageName: node - linkType: hard - "@nrwl/devkit@npm:>=15.5.2 < 16": version: 15.9.2 resolution: "@nrwl/devkit@npm:15.9.2" @@ -3482,13 +3460,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-darwin-arm64@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-darwin-arm64@npm:15.9.3" - conditions: os=darwin & cpu=arm64 - languageName: node - linkType: hard - "@nrwl/nx-darwin-x64@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-darwin-x64@npm:15.9.2" @@ -3496,13 +3467,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-darwin-x64@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-darwin-x64@npm:15.9.3" - conditions: os=darwin & cpu=x64 - languageName: node - linkType: hard - "@nrwl/nx-linux-arm-gnueabihf@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-linux-arm-gnueabihf@npm:15.9.2" @@ -3510,13 +3474,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-linux-arm-gnueabihf@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-linux-arm-gnueabihf@npm:15.9.3" - conditions: os=linux & cpu=arm - languageName: node - linkType: hard - "@nrwl/nx-linux-arm64-gnu@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-linux-arm64-gnu@npm:15.9.2" @@ -3524,13 +3481,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-linux-arm64-gnu@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-linux-arm64-gnu@npm:15.9.3" - conditions: os=linux & cpu=arm64 & libc=glibc - languageName: node - linkType: hard - "@nrwl/nx-linux-arm64-musl@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-linux-arm64-musl@npm:15.9.2" @@ -3538,13 +3488,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-linux-arm64-musl@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-linux-arm64-musl@npm:15.9.3" - conditions: os=linux & cpu=arm64 & libc=musl - languageName: node - linkType: hard - "@nrwl/nx-linux-x64-gnu@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-linux-x64-gnu@npm:15.9.2" @@ -3552,13 +3495,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-linux-x64-gnu@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-linux-x64-gnu@npm:15.9.3" - conditions: os=linux & cpu=x64 & libc=glibc - languageName: node - linkType: hard - "@nrwl/nx-linux-x64-musl@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-linux-x64-musl@npm:15.9.2" @@ -3566,13 +3502,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-linux-x64-musl@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-linux-x64-musl@npm:15.9.3" - conditions: os=linux & cpu=x64 & libc=musl - languageName: node - linkType: hard - "@nrwl/nx-win32-arm64-msvc@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-win32-arm64-msvc@npm:15.9.2" @@ -3580,13 +3509,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-win32-arm64-msvc@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-win32-arm64-msvc@npm:15.9.3" - conditions: os=win32 & cpu=arm64 - languageName: node - linkType: hard - "@nrwl/nx-win32-x64-msvc@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/nx-win32-x64-msvc@npm:15.9.2" @@ -3594,13 +3516,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/nx-win32-x64-msvc@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/nx-win32-x64-msvc@npm:15.9.3" - conditions: os=win32 & cpu=x64 - languageName: node - linkType: hard - "@nrwl/tao@npm:15.9.2": version: 15.9.2 resolution: "@nrwl/tao@npm:15.9.2" @@ -3612,17 +3527,6 @@ __metadata: languageName: node linkType: hard -"@nrwl/tao@npm:15.9.3": - version: 15.9.3 - resolution: "@nrwl/tao@npm:15.9.3" - dependencies: - nx: 15.9.3 - bin: - tao: index.js - checksum: 35f1d12f70849b506b1845b120b96da03bab779de1a77de5dc74d331f037b97ec280486943c38854bb4f1480b1862f057d3f827f514f5dafeb865be950c9839a - languageName: node - linkType: hard - "@octokit/auth-token@npm:^3.0.0": version: 3.0.3 resolution: "@octokit/auth-token@npm:3.0.3" @@ -3829,10 +3733,10 @@ __metadata: languageName: node linkType: hard -"@remix-run/router@npm:1.5.0": - version: 1.5.0 - resolution: "@remix-run/router@npm:1.5.0" - checksum: 9c510c174af1553edd1f039ba16e7e3d34e04d53b3bac18814660e31cd0c48297ea4291ff86d0736b560123ebc63ecb62fa525829181d16a8dad15270d6672d7 +"@remix-run/router@npm:1.6.0": + version: 1.6.0 + resolution: "@remix-run/router@npm:1.6.0" + checksum: 9f08f20500b2fc9d689c06c3c25504baf2ece861a9f4d0c49ba043ef4040a96b85c15a57a1c11377e64bf78b727ce8fb58b300345642efb05a75d49e4b638344 languageName: node linkType: hard @@ -4257,10 +4161,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^18.16.2": - version: 18.16.2 - resolution: "@types/node@npm:18.16.2" - checksum: 7ad66d23b3b93885a9f879bff98e0196790ad35589b47a3d81b52db969ad17ee298082020296df5166c2d72d3cd6a4b9ab34d254483637d967944a4b3e6febdb +"@types/node@npm:^18.16.3": + version: 18.16.3 + resolution: "@types/node@npm:18.16.3" + checksum: 816b39d45b05ebdc6f362b630970df3f6d82f71d418a2555353522f4eeeb078fa201de5299f02c09a09faa975e43b2745fe19c263d44069f87ddf37d6c37b717 languageName: node linkType: hard @@ -4456,14 +4360,14 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:^5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/eslint-plugin@npm:5.59.1" +"@typescript-eslint/eslint-plugin@npm:^5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/eslint-plugin@npm:5.59.2" dependencies: "@eslint-community/regexpp": ^4.4.0 - "@typescript-eslint/scope-manager": 5.59.1 - "@typescript-eslint/type-utils": 5.59.1 - "@typescript-eslint/utils": 5.59.1 + "@typescript-eslint/scope-manager": 5.59.2 + "@typescript-eslint/type-utils": 5.59.2 + "@typescript-eslint/utils": 5.59.2 debug: ^4.3.4 grapheme-splitter: ^1.0.4 ignore: ^5.2.0 @@ -4476,7 +4380,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 9ada3ae721594ddd8101a6093e6383bc95e4dcb19b3929210dee5480637786473a9eba2e69e61e560fa592965f4fd02aeb98ddfda91b00b448ae01c5d77431d6 + checksum: 1045883173a36a069b56e906ed7e5b4106e1efc2ed0969a1718683aef58fd39e5dfa17774b8782c3ced0529a4edd6dedfcb54348a14525f191a6816e6f3b90dc languageName: node linkType: hard @@ -4508,20 +4412,20 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/parser@npm:^5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/parser@npm:5.59.1" +"@typescript-eslint/parser@npm:^5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/parser@npm:5.59.2" dependencies: - "@typescript-eslint/scope-manager": 5.59.1 - "@typescript-eslint/types": 5.59.1 - "@typescript-eslint/typescript-estree": 5.59.1 + "@typescript-eslint/scope-manager": 5.59.2 + "@typescript-eslint/types": 5.59.2 + "@typescript-eslint/typescript-estree": 5.59.2 debug: ^4.3.4 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 peerDependenciesMeta: typescript: optional: true - checksum: d324d32a69e06ab12aacb72cd3e2a8eb8ade6c2a4d4e6bb013941588a675e818a8ebd973bef1cd818da6a76eb00908bf66d84ef214c3f015dfcb40f8067a335e + checksum: 0d3f992c49e062ff509606fb72846abaa66602d93ca15bc6498c345c55effa28c8d523b829cd180d901eaf04bca3d93a165d56a387ce109333d60d67b09b5638 languageName: node linkType: hard @@ -4535,13 +4439,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/scope-manager@npm:5.59.1" +"@typescript-eslint/scope-manager@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/scope-manager@npm:5.59.2" dependencies: - "@typescript-eslint/types": 5.59.1 - "@typescript-eslint/visitor-keys": 5.59.1 - checksum: ae7758181d0f18d1ad20abf95164553fa98c20410968d538ac7abd430ec59f69e30d4da16ad968d029feced1ed49abc65daf6685c996eb4529d798e8320204ff + "@typescript-eslint/types": 5.59.2 + "@typescript-eslint/visitor-keys": 5.59.2 + checksum: e7adce27890ebaadd0fb36a35639c9a97d2965973643aef4b4b0dcfabb03181c82235d7171e718b002dd398e52fefd67816eb34912ddbc2bb738b47755bd502a languageName: node linkType: hard @@ -4562,12 +4466,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/type-utils@npm:5.59.1" +"@typescript-eslint/type-utils@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/type-utils@npm:5.59.2" dependencies: - "@typescript-eslint/typescript-estree": 5.59.1 - "@typescript-eslint/utils": 5.59.1 + "@typescript-eslint/typescript-estree": 5.59.2 + "@typescript-eslint/utils": 5.59.2 debug: ^4.3.4 tsutils: ^3.21.0 peerDependencies: @@ -4575,7 +4479,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: ff46cc049995bb6505a6170550a9e658c42cd5699a95e1976822318fef2963381223505f797051fc727938ace66d4a7dc072a4b4cadbbdf91d2fda1a16c05c98 + checksum: d9dc037509a97b11a3c7f758f0f6e985cf5b4909fab860018a75b1550711ce9ff07bf5b67d4197ba7a0a831fec7255851b1e6a773a69030fc8ea7ec649859f52 languageName: node linkType: hard @@ -4586,10 +4490,10 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/types@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/types@npm:5.59.1" - checksum: 40ea7ccf59c4951797d3761e53c866a5979e07fbdabef9dc07d3a3f625a99d4318d5329ae8e628cdfdc0bb9bb6e6d8dfb740f33c7bf318e63fa0a863b9ae85c7 +"@typescript-eslint/types@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/types@npm:5.59.2" + checksum: 5a91cfbcaa8c7e92ad91f67abd0ce43ae562fdbdd8c32aa968731bf7c200d13a0415e87fc032bd48f7e5b7d3ed1447cb14449ef2592c269ca311974b15ce0af2 languageName: node linkType: hard @@ -4611,12 +4515,12 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/typescript-estree@npm:5.59.1" +"@typescript-eslint/typescript-estree@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/typescript-estree@npm:5.59.2" dependencies: - "@typescript-eslint/types": 5.59.1 - "@typescript-eslint/visitor-keys": 5.59.1 + "@typescript-eslint/types": 5.59.2 + "@typescript-eslint/visitor-keys": 5.59.2 debug: ^4.3.4 globby: ^11.1.0 is-glob: ^4.0.3 @@ -4625,7 +4529,7 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: e33081937225f38e717ac2f9e90c4a8c6b71b701923eea3e03be76d8c466f0d3c6a4ec1d65c9fc1da4f1989416d386305353c5b53aa736d3af9503061001e3eb + checksum: e8bb8817fe53f826f54e4ca584e48a6700dae25e0cc20ab7db38e7e5308987c5759408b39a4e494d4d6dcd7b4bca9f9c507fae987213380dc1c98607cb0a60b1 languageName: node linkType: hard @@ -4647,21 +4551,21 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/utils@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/utils@npm:5.59.1" +"@typescript-eslint/utils@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/utils@npm:5.59.2" dependencies: "@eslint-community/eslint-utils": ^4.2.0 "@types/json-schema": ^7.0.9 "@types/semver": ^7.3.12 - "@typescript-eslint/scope-manager": 5.59.1 - "@typescript-eslint/types": 5.59.1 - "@typescript-eslint/typescript-estree": 5.59.1 + "@typescript-eslint/scope-manager": 5.59.2 + "@typescript-eslint/types": 5.59.2 + "@typescript-eslint/typescript-estree": 5.59.2 eslint-scope: ^5.1.1 semver: ^7.3.7 peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - checksum: ca32c90efa57e937ebf812221e070c0604ca99f900fbca60578b42d40c923d5a94fd9503cf5918ecd75b687b68a1be562f7c6593a329bc40b880c95036a021c0 + checksum: 483c35a592a36a5973204ce4cd11d52935c097b414d7edac2ecd15dba460b8c540b793ffc232c0f8580fef0624eb7704156ce33c66bd09a76769ed019bddd1d1 languageName: node linkType: hard @@ -4675,13 +4579,13 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:5.59.1": - version: 5.59.1 - resolution: "@typescript-eslint/visitor-keys@npm:5.59.1" +"@typescript-eslint/visitor-keys@npm:5.59.2": + version: 5.59.2 + resolution: "@typescript-eslint/visitor-keys@npm:5.59.2" dependencies: - "@typescript-eslint/types": 5.59.1 + "@typescript-eslint/types": 5.59.2 eslint-visitor-keys: ^3.3.0 - checksum: f98e399147310cad67de718a8a6336f053d46753bade380c89ddac3dd49512555c3f613636b255ce0b5e2b004654d1c167eb5e53fc8085148b637a5afc20cdd8 + checksum: 3057a017bca03b4ec3bee442044f2bc2f77a4af0d83ea9bf7c6cb2a12811126d93d9d300d89ef8078d981e478c6cc38693c51a2ae4b10a717796bba880eff924 languageName: node linkType: hard @@ -12659,87 +12563,6 @@ __metadata: languageName: node linkType: hard -"nx@npm:15.9.3, nx@npm:^15.9.3": - version: 15.9.3 - resolution: "nx@npm:15.9.3" - dependencies: - "@nrwl/cli": 15.9.3 - "@nrwl/nx-darwin-arm64": 15.9.3 - "@nrwl/nx-darwin-x64": 15.9.3 - "@nrwl/nx-linux-arm-gnueabihf": 15.9.3 - "@nrwl/nx-linux-arm64-gnu": 15.9.3 - "@nrwl/nx-linux-arm64-musl": 15.9.3 - "@nrwl/nx-linux-x64-gnu": 15.9.3 - "@nrwl/nx-linux-x64-musl": 15.9.3 - "@nrwl/nx-win32-arm64-msvc": 15.9.3 - "@nrwl/nx-win32-x64-msvc": 15.9.3 - "@nrwl/tao": 15.9.3 - "@parcel/watcher": 2.0.4 - "@yarnpkg/lockfile": ^1.1.0 - "@yarnpkg/parsers": ^3.0.0-rc.18 - "@zkochan/js-yaml": 0.0.6 - axios: ^1.0.0 - chalk: ^4.1.0 - cli-cursor: 3.1.0 - cli-spinners: 2.6.1 - cliui: ^7.0.2 - dotenv: ~10.0.0 - enquirer: ~2.3.6 - fast-glob: 3.2.7 - figures: 3.2.0 - flat: ^5.0.2 - fs-extra: ^11.1.0 - glob: 7.1.4 - ignore: ^5.0.4 - js-yaml: 4.1.0 - jsonc-parser: 3.2.0 - lines-and-columns: ~2.0.3 - minimatch: 3.0.5 - npm-run-path: ^4.0.1 - open: ^8.4.0 - semver: 7.3.4 - string-width: ^4.2.3 - strong-log-transformer: ^2.1.0 - tar-stream: ~2.2.0 - tmp: ~0.2.1 - tsconfig-paths: ^4.1.2 - tslib: ^2.3.0 - v8-compile-cache: 2.3.0 - yargs: ^17.6.2 - yargs-parser: 21.1.1 - peerDependencies: - "@swc-node/register": ^1.4.2 - "@swc/core": ^1.2.173 - dependenciesMeta: - "@nrwl/nx-darwin-arm64": - optional: true - "@nrwl/nx-darwin-x64": - optional: true - "@nrwl/nx-linux-arm-gnueabihf": - optional: true - "@nrwl/nx-linux-arm64-gnu": - optional: true - "@nrwl/nx-linux-arm64-musl": - optional: true - "@nrwl/nx-linux-x64-gnu": - optional: true - "@nrwl/nx-linux-x64-musl": - optional: true - "@nrwl/nx-win32-arm64-msvc": - optional: true - "@nrwl/nx-win32-x64-msvc": - optional: true - peerDependenciesMeta: - "@swc-node/register": - optional: true - "@swc/core": - optional: true - bin: - nx: bin/nx.js - checksum: 40cec2df497786d590694910633f79c6651c363e5944fac601c62f8511d4ed78aa586b69975abdf7ecf1305f80f47e8b680777652cbfe080e757ab5f5d0d403f - languageName: node - linkType: hard - "oauth-sign@npm:~0.9.0": version: 0.9.0 resolution: "oauth-sign@npm:0.9.0" @@ -13853,27 +13676,27 @@ __metadata: languageName: node linkType: hard -"react-router-dom@npm:^6.10.0": - version: 6.10.0 - resolution: "react-router-dom@npm:6.10.0" +"react-router-dom@npm:^6.11.0": + version: 6.11.0 + resolution: "react-router-dom@npm:6.11.0" dependencies: - "@remix-run/router": 1.5.0 - react-router: 6.10.0 + "@remix-run/router": 1.6.0 + react-router: 6.11.0 peerDependencies: react: ">=16.8" react-dom: ">=16.8" - checksum: d048d8cc66e5aec782bd675097d6bf0e5f867f3f0539bff9acdc4a314b5e0e34093944762960ca0977a54c6255272edd262231242b18c4e260d68df6b5288464 + checksum: 85c9e302de8f5730bd63fc1f0f712ca0645b7ec843828f43b60712b0a38105d101c7412487eeb35cc25d940cc026e8832e6492eba9772d26779e2856f18e7923 languageName: node linkType: hard -"react-router@npm:6.10.0": - version: 6.10.0 - resolution: "react-router@npm:6.10.0" +"react-router@npm:6.11.0": + version: 6.11.0 + resolution: "react-router@npm:6.11.0" dependencies: - "@remix-run/router": 1.5.0 + "@remix-run/router": 1.6.0 peerDependencies: react: ">=16.8" - checksum: c9fce46147c04257d7d6fa1f5bbfac96c5fdd0b15f26918bd12b2e5fe9143977c5a4452272f9b85795a22e29ec105a60d0bbe036118efc52b383d163cd8829ab + checksum: c27d64b074da711d59a94d7b64fe82360da8a49077a5e8326c27e9fb48a7650080f73b5ba3b94d0b11f2d7e315255fabc3bad818cd26d1cec3a52220ad9d64cd languageName: node linkType: hard @@ -14432,6 +14255,20 @@ __metadata: languageName: node linkType: hard +"rollup@npm:^3.21.3": + version: 3.21.3 + resolution: "rollup@npm:3.21.3" + dependencies: + fsevents: ~2.3.2 + dependenciesMeta: + fsevents: + optional: true + bin: + rollup: dist/bin/rollup + checksum: 430c0c66f1480586ccea77b190524efb6a3af3da5308c7bc77eca3160c3f387c9a56ebb3eef5bfb24f683764bdfdd3dafdea175d215e4b875bbde752619bec12 + languageName: node + linkType: hard + "root-workspace-0b6124@workspace:.": version: 0.0.0-use.local resolution: "root-workspace-0b6124@workspace:." @@ -14443,12 +14280,12 @@ __metadata: "@types/big.js": ^6.1.6 "@types/eslint": ^8.37.0 "@types/events": ^3.0.0 - "@types/node": ^18.16.2 + "@types/node": ^18.16.3 "@types/react": ^18.2.0 "@types/react-dom": ^18.2.1 "@types/uuid": ^9.0.1 - "@typescript-eslint/eslint-plugin": ^5.59.1 - "@typescript-eslint/parser": ^5.59.1 + "@typescript-eslint/eslint-plugin": ^5.59.2 + "@typescript-eslint/parser": ^5.59.2 cpy-cli: ^4.2.0 eslint: ^8.39.0 eslint-config-prettier: ^8.8.0 @@ -14460,7 +14297,6 @@ __metadata: eslint-plugin-react: ^7.32.2 eslint-plugin-react-hooks: ^4.6.0 lerna: ^6.6.1 - nx: ^15.9.3 prettier: ^2.8.8 react: ^18.2.0 react-dom: ^18.2.0 @@ -15278,13 +15114,6 @@ __metadata: languageName: node linkType: hard -"stylis@npm:4.1.3": - version: 4.1.3 - resolution: "stylis@npm:4.1.3" - checksum: d04dbffcb9bf2c5ca8d8dc09534203c75df3bf711d33973ea22038a99cc475412a350b661ebd99cbc01daa50d7eedcf0d130d121800eb7318759a197023442a6 - languageName: node - linkType: hard - "stylis@npm:4.1.4": version: 4.1.4 resolution: "stylis@npm:4.1.4" @@ -16128,9 +15957,9 @@ __metadata: languageName: node linkType: hard -"vite@npm:^4.3.3": - version: 4.3.3 - resolution: "vite@npm:4.3.3" +"vite@npm:^4.3.4": + version: 4.3.4 + resolution: "vite@npm:4.3.4" dependencies: esbuild: ^0.17.5 fsevents: ~2.3.2 @@ -16161,7 +15990,7 @@ __metadata: optional: true bin: vite: bin/vite.js - checksum: 99970cb1fed3330458e60f8341ec73c4260c82d815e51c95295321ab496e4c8cb447bc942daf4d94f78bbc8b2bed36cbc237f43fdc1cede19250fac737e5a0fc + checksum: 90ce3923ef3e9a491851fb34effece43858d0ba915db17ea6ad0eb649bd77d81c69a71aafc55a6fbd11e4134b1a79eb7e2e3553f055d390d32ca0ff7c645acf6 languageName: node linkType: hard