@lifi/widget 2.2.5 → 2.2.7

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.
Files changed (44) hide show
  1. package/AppDrawer.style.d.ts +12 -2
  2. package/cjs/AppDrawer.style.d.ts +12 -2
  3. package/cjs/components/Card/Card.d.ts +1 -3
  4. package/cjs/components/Card/CardLabel.d.ts +12 -2
  5. package/cjs/components/Card/CardTitle.d.ts +12 -2
  6. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +1 -3
  7. package/cjs/components/Header/Header.style.d.ts +8 -1
  8. package/cjs/components/Header/NavigationTabs.style.d.ts +1 -3
  9. package/cjs/components/RouteCard/RouteCard.style.d.ts +12 -2
  10. package/cjs/components/Step/StepList.js +5 -3
  11. package/cjs/components/Token/Token.style.d.ts +12 -2
  12. package/cjs/config/version.d.ts +1 -1
  13. package/cjs/config/version.js +1 -1
  14. package/cjs/stores/StoreProvider.js +2 -1
  15. package/cjs/stores/chains/ChainOrderStore.d.ts +9 -0
  16. package/cjs/stores/chains/ChainOrderStore.js +31 -0
  17. package/cjs/stores/chains/createChainOrderStore.d.ts +4 -0
  18. package/cjs/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +4 -3
  19. package/cjs/stores/chains/index.d.ts +2 -1
  20. package/cjs/stores/chains/index.js +2 -1
  21. package/cjs/stores/chains/useChainOrder.js +2 -2
  22. package/components/Card/Card.d.ts +1 -3
  23. package/components/Card/CardLabel.d.ts +12 -2
  24. package/components/Card/CardTitle.d.ts +12 -2
  25. package/components/ChainSelect/ChainSelect.style.d.ts +1 -3
  26. package/components/Header/Header.style.d.ts +8 -1
  27. package/components/Header/NavigationTabs.style.d.ts +1 -3
  28. package/components/RouteCard/RouteCard.style.d.ts +12 -2
  29. package/components/Step/StepList.js +5 -3
  30. package/components/Token/Token.style.d.ts +12 -2
  31. package/config/version.d.ts +1 -1
  32. package/config/version.js +1 -1
  33. package/package.json +4 -4
  34. package/stores/StoreProvider.js +2 -1
  35. package/stores/chains/ChainOrderStore.d.ts +9 -0
  36. package/stores/chains/ChainOrderStore.js +25 -0
  37. package/stores/chains/createChainOrderStore.d.ts +4 -0
  38. package/stores/chains/{useChainOrderStore.js → createChainOrderStore.js} +2 -2
  39. package/stores/chains/index.d.ts +2 -1
  40. package/stores/chains/index.js +2 -1
  41. package/stores/chains/useChainOrder.js +1 -1
  42. package/tsconfig.cjs.tsbuildinfo +1 -1
  43. package/cjs/stores/chains/useChainOrderStore.d.ts +0 -3
  44. package/stores/chains/useChainOrderStore.d.ts +0 -3
@@ -1,4 +1,14 @@
1
1
  /// <reference types="react" />
2
- export declare const IconTypography: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
2
+ export declare const IconTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
3
+ align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
4
+ children?: import("react").ReactNode;
5
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
6
+ gutterBottom?: boolean | undefined;
7
+ noWrap?: boolean | undefined;
8
+ paragraph?: boolean | undefined;
9
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
+ variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
11
+ variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
3
13
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
4
- }, "className" | "style" | "classes" | "p" | "color" | "children" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
14
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -10,9 +10,11 @@ export const getStepList = (route, subvariant) => route?.steps.map((step, index,
10
10
  const toToken = index === lastIndex
11
11
  ? {
12
12
  ...(step.execution?.toToken ?? step.action?.toToken),
13
- amount: step.execution?.toAmount ?? subvariant === 'nft'
14
- ? route.toAmount
15
- : step.estimate.toAmount,
13
+ amount: step.execution?.toAmount
14
+ ? step.execution.toAmount
15
+ : subvariant === 'nft'
16
+ ? route.toAmount
17
+ : step.estimate.toAmount,
16
18
  }
17
19
  : undefined;
18
20
  const toAddress = index === lastIndex && route.fromAddress !== route.toAddress
@@ -9,9 +9,19 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
9
9
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
10
  connected?: boolean | undefined;
11
11
  }, {}, {}>;
12
- export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
12
+ export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
13
+ align?: "center" | "left" | "right" | "inherit" | "justify" | undefined;
14
+ children?: import("react").ReactNode;
15
+ classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
16
+ gutterBottom?: boolean | undefined;
17
+ noWrap?: boolean | undefined;
18
+ paragraph?: boolean | undefined;
19
+ sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
20
+ variant?: import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides> | undefined;
21
+ variantMapping?: Partial<Record<import("@mui/types").OverridableStringUnion<"inherit" | import("@mui/material").TypographyVariant, import("@mui/material").TypographyPropsVariantOverrides>, string>> | undefined;
22
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
13
23
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
14
- }, "className" | "style" | "classes" | "p" | "color" | "children" | "sx" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint" | "variant" | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
24
+ }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
15
25
  connected?: boolean | undefined;
16
26
  dot?: boolean | undefined;
17
27
  }, {}, {}>;
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "2.2.5";
2
+ export declare const version = "2.2.7";
package/config/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget';
2
- export const version = '2.2.5';
2
+ export const version = '2.2.7';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lifi/widget",
3
- "version": "2.2.5",
3
+ "version": "2.2.7",
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,14 +44,14 @@
44
44
  "@ethersproject/experimental": "^5.7.0",
45
45
  "@ethersproject/providers": "^5.7.2",
46
46
  "@lifi/sdk": "^2.2.1",
47
- "@lifi/wallet-management": "^2.2.3",
47
+ "@lifi/wallet-management": "^2.2.4",
48
48
  "@mui/icons-material": "^5.14.1",
49
49
  "@mui/lab": "^5.0.0-alpha.137",
50
- "@mui/material": "^5.14.1",
50
+ "@mui/material": "^5.14.2",
51
51
  "@tanstack/react-query": "^4.32.0",
52
52
  "@tanstack/react-virtual": "^3.0.0-beta.54",
53
53
  "big.js": "^6.2.1",
54
- "i18next": "^23.2.11",
54
+ "i18next": "^23.3.0",
55
55
  "i18next-browser-languagedetector": "^7.1.0",
56
56
  "microdiff": "^1.3.2",
57
57
  "mitt": "^3.0.1",
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ChainOrderStoreProvider } from './chains';
2
3
  import { HeaderStoreProvider } from './header';
3
4
  import { RouteExecutionStoreProvider } from './routes';
4
5
  import { SplitSubvariantStoreProvider } from './settings';
5
6
  export const StoreProvider = ({ children, config, }) => {
6
- return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split' ? 'swap' : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }));
7
+ return (_jsx(SplitSubvariantStoreProvider, { state: config.subvariant === 'split' ? 'swap' : undefined, children: _jsx(HeaderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(ChainOrderStoreProvider, { namePrefix: config?.keyPrefix, children: _jsx(RouteExecutionStoreProvider, { namePrefix: config?.keyPrefix, children: children }) }) }) }));
7
8
  };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import type { StoreApi, UseBoundStore } from 'zustand';
3
+ import type { PersistStoreProviderProps } from '../types';
4
+ import type { ChainOrderState } from './types';
5
+ export type ChainOrderStore = UseBoundStore<StoreApi<ChainOrderState>>;
6
+ export declare const ChainOrderStoreContext: import("react").Context<ChainOrderStore | null>;
7
+ export declare function ChainOrderStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function useChainOrderStore<T>(selector: (state: ChainOrderState) => T, equalityFn?: (left: T, right: T) => boolean): T;
9
+ export declare function useChainOrderStoreContext(): ChainOrderStore;
@@ -0,0 +1,25 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useRef } from 'react';
3
+ import { createChainOrderStore } from './createChainOrderStore';
4
+ export const ChainOrderStoreContext = createContext(null);
5
+ export function ChainOrderStoreProvider({ children, ...props }) {
6
+ const storeRef = useRef();
7
+ if (!storeRef.current) {
8
+ storeRef.current = createChainOrderStore(props);
9
+ }
10
+ return (_jsx(ChainOrderStoreContext.Provider, { value: storeRef.current, children: children }));
11
+ }
12
+ export function useChainOrderStore(selector, equalityFn) {
13
+ const useStore = useContext(ChainOrderStoreContext);
14
+ if (!useStore) {
15
+ throw new Error(`You forgot to wrap your component in <${ChainOrderStoreProvider.name}>.`);
16
+ }
17
+ return useStore(selector, equalityFn);
18
+ }
19
+ export function useChainOrderStoreContext() {
20
+ const useStore = useContext(ChainOrderStoreContext);
21
+ if (!useStore) {
22
+ throw new Error(`You forgot to wrap your component in <${ChainOrderStoreProvider.name}>.`);
23
+ }
24
+ return useStore;
25
+ }
@@ -0,0 +1,4 @@
1
+ import type { PersistStoreProps } from '../types';
2
+ import type { ChainOrderState } from './types';
3
+ export declare const maxChainToOrder = 9;
4
+ export declare const createChainOrderStore: ({ namePrefix }: PersistStoreProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<ChainOrderState>>;
@@ -1,7 +1,7 @@
1
1
  import { create } from 'zustand';
2
2
  import { persist } from 'zustand/middleware';
3
3
  export const maxChainToOrder = 9;
4
- export const useChainOrderStore = create(persist((set, get) => ({
4
+ export const createChainOrderStore = ({ namePrefix }) => create(persist((set, get) => ({
5
5
  chainOrder: [],
6
6
  availableChains: [],
7
7
  initializeChains: (chainIds) => {
@@ -43,7 +43,7 @@ export const useChainOrderStore = create(persist((set, get) => ({
43
43
  });
44
44
  },
45
45
  }), {
46
- name: `li.fi-widget-chains-order`,
46
+ name: `${namePrefix || 'li.fi'}-widget-chains-order`,
47
47
  version: 0,
48
48
  partialize: (state) => ({ chainOrder: state.chainOrder }),
49
49
  }));
@@ -1,3 +1,4 @@
1
+ export * from './ChainOrderStore';
2
+ export * from './createChainOrderStore';
1
3
  export * from './types';
2
4
  export * from './useChainOrder';
3
- export * from './useChainOrderStore';
@@ -1,3 +1,4 @@
1
+ export * from './ChainOrderStore';
2
+ export * from './createChainOrderStore';
1
3
  export * from './types';
2
4
  export * from './useChainOrder';
3
- export * from './useChainOrderStore';
@@ -1,5 +1,5 @@
1
1
  import { shallow } from 'zustand/shallow';
2
- import { useChainOrderStore } from '.';
2
+ import { useChainOrderStore } from './ChainOrderStore';
3
3
  export const useChainOrder = () => {
4
4
  return useChainOrderStore((state) => [state.chainOrder, state.setChain], shallow);
5
5
  };