@lifi/widget 2.10.0 → 2.10.2

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.
@@ -14,9 +14,15 @@ const ProgressToNextUpdate_1 = require("../ProgressToNextUpdate");
14
14
  const RouteCard_1 = require("../RouteCard");
15
15
  const RoutesExpanded_style_1 = require("./RoutesExpanded.style");
16
16
  const timeout = { enter: 225, exit: 225, appear: 0 };
17
+ const routes = [
18
+ {
19
+ path: '/',
20
+ element: true,
21
+ },
22
+ ];
17
23
  const RoutesExpanded = () => {
18
- const element = (0, react_router_dom_1.useMatch)('/');
19
- return ((0, jsx_runtime_1.jsx)(RoutesExpanded_style_1.CollapseContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: timeout, in: !!element, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(material_1.Grow, { timeout: timeout, in: !!element, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(exports.RoutesExpandedElement, {}) }) }) }) }));
24
+ const match = (0, react_router_dom_1.useRoutes)(routes);
25
+ return ((0, jsx_runtime_1.jsx)(RoutesExpanded_style_1.CollapseContainer, { children: (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: timeout, in: !!match, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(material_1.Grow, { timeout: timeout, in: !!match, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(exports.RoutesExpandedElement, {}) }) }) }) }));
20
26
  };
21
27
  exports.RoutesExpanded = RoutesExpanded;
22
28
  const RoutesExpandedElement = () => {
@@ -26,7 +32,6 @@ const RoutesExpandedElement = () => {
26
32
  const { subvariant, containerStyle } = (0, providers_1.useWidgetConfig)();
27
33
  const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
28
34
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useRoutes)();
29
- const currentRoute = routes?.[0];
30
35
  const handleRouteClick = (route) => {
31
36
  if (isValid && !isValidating) {
32
37
  setExecutableRoute(route);
@@ -35,6 +40,7 @@ const RoutesExpandedElement = () => {
35
40
  });
36
41
  }
37
42
  };
43
+ const currentRoute = routes?.[0];
38
44
  const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched);
39
45
  const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded;
40
46
  return ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: timeout.enter, in: expanded, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(material_1.Grow, { timeout: timeout.enter, in: expanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(RoutesExpanded_style_1.Container, { sx: containerStyle, enableColorScheme: true, children: (0, jsx_runtime_1.jsxs)(RoutesExpanded_style_1.ScrollableContainer, { children: [(0, jsx_runtime_1.jsxs)(RoutesExpanded_style_1.Header, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: "700", flex: 1, noWrap: true, children: subvariant === 'nft'
@@ -22,7 +22,7 @@ const TokenList = ({ formType, height, onClick, }) => {
22
22
  let filteredTokens = (tokensWithBalance ??
23
23
  chainTokens ??
24
24
  []);
25
- const searchFilter = tokenSearchFilter?.toUpperCase() ?? '';
25
+ const searchFilter = tokenSearchFilter?.replaceAll('$', '')?.toUpperCase() ?? '';
26
26
  filteredTokens = tokenSearchFilter
27
27
  ? filteredTokens.filter((token) => token.name.toUpperCase().includes(searchFilter) ||
28
28
  token.symbol.toUpperCase().includes(searchFilter) ||
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.10.0";
2
+ export declare const version = "2.10.2";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '2.10.0';
5
+ exports.version = '2.10.2';
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Collapse, Grow, Stack, Typography } from '@mui/material';
3
3
  import { useFormState } from 'react-hook-form';
4
4
  import { useTranslation } from 'react-i18next';
5
- import { useMatch, useNavigate } from 'react-router-dom';
5
+ import { useRoutes as useDOMRoutes, useNavigate } from 'react-router-dom';
6
6
  import { useRoutes } from '../../hooks';
7
7
  import { useWidgetConfig } from '../../providers';
8
8
  import { useSetExecutableRoute } from '../../stores';
@@ -11,9 +11,15 @@ import { ProgressToNextUpdate } from '../ProgressToNextUpdate';
11
11
  import { RouteCard, RouteCardSkeleton, RouteNotFoundCard } from '../RouteCard';
12
12
  import { CollapseContainer, Container, Header, ScrollableContainer, } from './RoutesExpanded.style';
13
13
  const timeout = { enter: 225, exit: 225, appear: 0 };
14
+ const routes = [
15
+ {
16
+ path: '/',
17
+ element: true,
18
+ },
19
+ ];
14
20
  export const RoutesExpanded = () => {
15
- const element = useMatch('/');
16
- return (_jsx(CollapseContainer, { children: _jsx(Collapse, { timeout: timeout, in: !!element, orientation: "horizontal", children: _jsx(Grow, { timeout: timeout, in: !!element, mountOnEnter: true, unmountOnExit: true, children: _jsx("div", { children: _jsx(RoutesExpandedElement, {}) }) }) }) }));
21
+ const match = useDOMRoutes(routes);
22
+ return (_jsx(CollapseContainer, { children: _jsx(Collapse, { timeout: timeout, in: !!match, orientation: "horizontal", children: _jsx(Grow, { timeout: timeout, in: !!match, mountOnEnter: true, unmountOnExit: true, children: _jsx("div", { children: _jsx(RoutesExpandedElement, {}) }) }) }) }));
17
23
  };
18
24
  export const RoutesExpandedElement = () => {
19
25
  const { t } = useTranslation();
@@ -22,7 +28,6 @@ export const RoutesExpandedElement = () => {
22
28
  const { subvariant, containerStyle } = useWidgetConfig();
23
29
  const { isValid, isValidating } = useFormState();
24
30
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = useRoutes();
25
- const currentRoute = routes?.[0];
26
31
  const handleRouteClick = (route) => {
27
32
  if (isValid && !isValidating) {
28
33
  setExecutableRoute(route);
@@ -31,6 +36,7 @@ export const RoutesExpandedElement = () => {
31
36
  });
32
37
  }
33
38
  };
39
+ const currentRoute = routes?.[0];
34
40
  const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched);
35
41
  const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded;
36
42
  return (_jsx(Collapse, { timeout: timeout.enter, in: expanded, orientation: "horizontal", children: _jsx(Grow, { timeout: timeout.enter, in: expanded, mountOnEnter: true, unmountOnExit: true, children: _jsx(Container, { sx: containerStyle, enableColorScheme: true, children: _jsxs(ScrollableContainer, { children: [_jsxs(Header, { children: [_jsx(Typography, { fontSize: 18, fontWeight: "700", flex: 1, noWrap: true, children: subvariant === 'nft'
@@ -19,7 +19,7 @@ export const TokenList = ({ formType, height, onClick, }) => {
19
19
  let filteredTokens = (tokensWithBalance ??
20
20
  chainTokens ??
21
21
  []);
22
- const searchFilter = tokenSearchFilter?.toUpperCase() ?? '';
22
+ const searchFilter = tokenSearchFilter?.replaceAll('$', '')?.toUpperCase() ?? '';
23
23
  filteredTokens = tokenSearchFilter
24
24
  ? filteredTokens.filter((token) => token.name.toUpperCase().includes(searchFilter) ||
25
25
  token.symbol.toUpperCase().includes(searchFilter) ||
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.10.0";
2
+ export declare const version = "2.10.2";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '2.10.0';
2
+ export const version = '2.10.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "2.10.0",
3
+ "version": "2.10.2",
4
4
  "description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
5
5
  "main": "./cjs/index.js",
6
6
  "module": "./index.js",
@@ -44,7 +44,7 @@
44
44
  "@ethersproject/experimental": "^5.7.0",
45
45
  "@ethersproject/providers": "^5.7.2",
46
46
  "@lifi/sdk": "^2.5.0",
47
- "@lifi/wallet-management": "^2.6.0",
47
+ "@lifi/wallet-management": "^2.6.1",
48
48
  "@mui/icons-material": "^5.14.14",
49
49
  "@mui/lab": "^5.0.0-alpha.149",
50
50
  "@mui/material": "^5.14.14",