@lifi/widget 1.20.2 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +2 -2
- package/App.js +5 -3
- package/AppDrawer.d.ts +3 -8
- package/AppProvider.d.ts +2 -5
- package/AppProvider.js +3 -1
- package/README.md +1 -6
- package/cjs/App.d.ts +2 -2
- package/cjs/App.js +5 -4
- package/cjs/AppDrawer.d.ts +3 -8
- package/cjs/AppProvider.d.ts +2 -5
- package/cjs/AppProvider.js +3 -1
- package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/i18n/{en/translation.json → en.json} +1 -0
- package/cjs/i18n/index.d.ts +2 -1
- package/cjs/i18n/index.js +14 -16
- package/cjs/index.d.ts +6 -3
- package/cjs/index.js +3 -2
- package/cjs/providers/SDKProvider/SDKProvider.js +1 -1
- package/cjs/types/widget.d.ts +6 -1
- package/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/i18n/{en/translation.json → en.json} +1 -0
- package/i18n/index.d.ts +2 -1
- package/i18n/index.js +14 -15
- package/index.d.ts +6 -3
- package/index.js +3 -2
- package/package.json +1 -1
- package/providers/SDKProvider/SDKProvider.js +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +6 -1
package/App.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
export declare const App: React.FC<
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
3
|
+
export declare const App: React.FC<WidgetProps>;
|
|
4
4
|
export declare const AppDefault: () => JSX.Element;
|
package/App.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { AppDrawer } from './AppDrawer';
|
|
2
4
|
import { AppProvider } from './AppProvider';
|
|
3
5
|
import { AppRoutes } from './AppRoutes';
|
|
4
6
|
import { AppContainer, AppExpandedContainer, FlexContainer, } from './components/AppContainer';
|
|
@@ -7,9 +9,9 @@ import { Initializer } from './components/Initializer';
|
|
|
7
9
|
import { PoweredBy } from './components/PoweredBy';
|
|
8
10
|
import { SwapRoutesExpanded } from './components/SwapRoutes';
|
|
9
11
|
import { useExpandableVariant } from './hooks';
|
|
10
|
-
export const App = ({ config }) => {
|
|
11
|
-
return (_jsx(AppProvider, Object.assign({ config: config }, { children: _jsx(AppDefault, {}) })));
|
|
12
|
-
};
|
|
12
|
+
export const App = forwardRef(({ elementRef, open, config }, ref) => {
|
|
13
|
+
return (config === null || config === void 0 ? void 0 : config.variant) !== 'drawer' ? (_jsx(AppProvider, Object.assign({ config: config }, { children: _jsx(AppDefault, {}) }))) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, config: config, open: open }));
|
|
14
|
+
});
|
|
13
15
|
export const AppDefault = () => {
|
|
14
16
|
const expandable = useExpandableVariant();
|
|
15
17
|
return (_jsxs(AppExpandedContainer, { children: [_jsxs(AppContainer, { children: [_jsx(Header, {}), _jsx(FlexContainer, Object.assign({ disableGutters: true }, { children: _jsx(AppRoutes, {}) })), _jsx(PoweredBy, {}), _jsx(Initializer, {})] }), expandable ? _jsx(SwapRoutesExpanded, {}) : null] }));
|
package/AppDrawer.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type { WidgetConfig } from './types';
|
|
4
|
-
export declare type WidgetDrawerProps = DrawerProps & {
|
|
5
|
-
elementRef?: RefObject<HTMLDivElement>;
|
|
6
|
-
config?: WidgetConfig;
|
|
7
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
8
3
|
export interface WidgetDrawer {
|
|
9
4
|
isOpen(): void;
|
|
10
5
|
toggleDrawer(): void;
|
|
11
6
|
openDrawer(): void;
|
|
12
7
|
closeDrawer(): void;
|
|
13
8
|
}
|
|
14
|
-
export declare const AppDrawer: import("react").ForwardRefExoticComponent<
|
|
9
|
+
export declare const AppDrawer: import("react").ForwardRefExoticComponent<WidgetProps & import("react").RefAttributes<WidgetDrawer>>;
|
package/AppProvider.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
config?: WidgetConfig;
|
|
5
|
-
}
|
|
6
|
-
export declare const AppProvider: React.FC<PropsWithChildren<AppProps>>;
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
3
|
+
export declare const AppProvider: React.FC<PropsWithChildren<WidgetProps>>;
|
|
7
4
|
export declare const AppRouter: React.FC<PropsWithChildren<{}>>;
|
package/AppProvider.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { QueryClientProvider } from '@tanstack/react-query';
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
|
+
import { I18nextProvider } from 'react-i18next';
|
|
4
5
|
import { MemoryRouter, useInRouterContext } from 'react-router-dom';
|
|
5
6
|
import { queryClient } from './config/queryClient';
|
|
7
|
+
import { i18n } from './i18n';
|
|
6
8
|
import { SDKProvider, SwapFormProvider, TelemetryProvider, ThemeProvider, WalletProvider, WidgetProvider, } from './providers';
|
|
7
9
|
const QueryProvider = QueryClientProvider;
|
|
8
10
|
export const AppProvider = ({ children, config, }) => {
|
|
9
|
-
return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(SwapFormProvider, { children: _jsx(ThemeProvider, { children: _jsx(WalletProvider, { children: _jsx(AppRouter, { children: children }) }) }) }) }) }) })) })));
|
|
11
|
+
return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(SwapFormProvider, { children: _jsx(ThemeProvider, { children: _jsx(WalletProvider, { children: _jsx(I18nextProvider, Object.assign({ i18n: i18n }, { children: _jsx(AppRouter, { children: children }) })) }) }) }) }) }) })) })));
|
|
10
12
|
};
|
|
11
13
|
export const AppRouter = ({ children }) => {
|
|
12
14
|
const inRouterContext = useInRouterContext();
|
package/README.md
CHANGED
|
@@ -62,13 +62,8 @@ export const WidgetPage = () => {
|
|
|
62
62
|
const widgetConfig: WidgetConfig = useMemo(() => {
|
|
63
63
|
return {
|
|
64
64
|
containerStyle: {
|
|
65
|
-
border:
|
|
66
|
-
window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
67
|
-
? 'rgb(66, 66, 66)'
|
|
68
|
-
: 'rgb(234, 234, 234)'
|
|
69
|
-
}`,
|
|
65
|
+
border: '1px solid rgb(234, 234, 234)',
|
|
70
66
|
borderRadius: '16px',
|
|
71
|
-
display: 'flex',
|
|
72
67
|
},
|
|
73
68
|
};
|
|
74
69
|
}, []);
|
package/cjs/App.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
3
|
-
export declare const App: React.FC<
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
3
|
+
export declare const App: React.FC<WidgetProps>;
|
|
4
4
|
export declare const AppDefault: () => JSX.Element;
|
package/cjs/App.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppDefault = exports.App = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const AppDrawer_1 = require("./AppDrawer");
|
|
5
7
|
const AppProvider_1 = require("./AppProvider");
|
|
6
8
|
const AppRoutes_1 = require("./AppRoutes");
|
|
7
9
|
const AppContainer_1 = require("./components/AppContainer");
|
|
@@ -10,10 +12,9 @@ const Initializer_1 = require("./components/Initializer");
|
|
|
10
12
|
const PoweredBy_1 = require("./components/PoweredBy");
|
|
11
13
|
const SwapRoutes_1 = require("./components/SwapRoutes");
|
|
12
14
|
const hooks_1 = require("./hooks");
|
|
13
|
-
|
|
14
|
-
return ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) })));
|
|
15
|
-
};
|
|
16
|
-
exports.App = App;
|
|
15
|
+
exports.App = (0, react_1.forwardRef)(({ elementRef, open, config }, ref) => {
|
|
16
|
+
return (config === null || config === void 0 ? void 0 : config.variant) !== 'drawer' ? ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) }))) : ((0, jsx_runtime_1.jsx)(AppDrawer_1.AppDrawer, { ref: ref, elementRef: elementRef, config: config, open: open }));
|
|
17
|
+
});
|
|
17
18
|
const AppDefault = () => {
|
|
18
19
|
const expandable = (0, hooks_1.useExpandableVariant)();
|
|
19
20
|
return ((0, jsx_runtime_1.jsxs)(AppContainer_1.AppExpandedContainer, { children: [(0, jsx_runtime_1.jsxs)(AppContainer_1.AppContainer, { children: [(0, jsx_runtime_1.jsx)(Header_1.Header, {}), (0, jsx_runtime_1.jsx)(AppContainer_1.FlexContainer, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(AppRoutes_1.AppRoutes, {}) })), (0, jsx_runtime_1.jsx)(PoweredBy_1.PoweredBy, {}), (0, jsx_runtime_1.jsx)(Initializer_1.Initializer, {})] }), expandable ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutesExpanded, {}) : null] }));
|
package/cjs/AppDrawer.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import type {
|
|
3
|
-
import type { WidgetConfig } from './types';
|
|
4
|
-
export declare type WidgetDrawerProps = DrawerProps & {
|
|
5
|
-
elementRef?: RefObject<HTMLDivElement>;
|
|
6
|
-
config?: WidgetConfig;
|
|
7
|
-
};
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
8
3
|
export interface WidgetDrawer {
|
|
9
4
|
isOpen(): void;
|
|
10
5
|
toggleDrawer(): void;
|
|
11
6
|
openDrawer(): void;
|
|
12
7
|
closeDrawer(): void;
|
|
13
8
|
}
|
|
14
|
-
export declare const AppDrawer: import("react").ForwardRefExoticComponent<
|
|
9
|
+
export declare const AppDrawer: import("react").ForwardRefExoticComponent<WidgetProps & import("react").RefAttributes<WidgetDrawer>>;
|
package/cjs/AppProvider.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { PropsWithChildren } from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export
|
|
4
|
-
config?: WidgetConfig;
|
|
5
|
-
}
|
|
6
|
-
export declare const AppProvider: React.FC<PropsWithChildren<AppProps>>;
|
|
2
|
+
import type { WidgetProps } from './types';
|
|
3
|
+
export declare const AppProvider: React.FC<PropsWithChildren<WidgetProps>>;
|
|
7
4
|
export declare const AppRouter: React.FC<PropsWithChildren<{}>>;
|
package/cjs/AppProvider.js
CHANGED
|
@@ -4,12 +4,14 @@ exports.AppRouter = exports.AppProvider = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const react_query_1 = require("@tanstack/react-query");
|
|
6
6
|
const react_1 = require("react");
|
|
7
|
+
const react_i18next_1 = require("react-i18next");
|
|
7
8
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
9
|
const queryClient_1 = require("./config/queryClient");
|
|
10
|
+
const i18n_1 = require("./i18n");
|
|
9
11
|
const providers_1 = require("./providers");
|
|
10
12
|
const QueryProvider = react_query_1.QueryClientProvider;
|
|
11
13
|
const AppProvider = ({ children, config, }) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.SwapFormProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) }) }) }) }) }) })) })));
|
|
14
|
+
return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.SwapFormProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(react_i18next_1.I18nextProvider, Object.assign({ i18n: i18n_1.i18n }, { children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) })) }) }) }) }) }) })) })));
|
|
13
15
|
};
|
|
14
16
|
exports.AppProvider = AppProvider;
|
|
15
17
|
const AppRouter = ({ children }) => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { BottomSheetBase, BottomSheetProps } from './types';
|
|
3
|
-
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "
|
|
3
|
+
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "components" | "elementRef" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "elevation" | "PaperProps" | "ModalProps" | "SlideProps"> & import("react").RefAttributes<BottomSheetBase>>;
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.21.0";
|
package/cjs/config/version.js
CHANGED
package/cjs/i18n/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const defaultNS = "translation";
|
|
|
2
2
|
export declare const resources: {
|
|
3
3
|
readonly en: {
|
|
4
4
|
readonly translation: {
|
|
5
|
+
language: string;
|
|
5
6
|
header: {
|
|
6
7
|
walletConnected: string;
|
|
7
8
|
connectWallet: string;
|
|
@@ -196,4 +197,4 @@ export declare const resources: {
|
|
|
196
197
|
};
|
|
197
198
|
};
|
|
198
199
|
};
|
|
199
|
-
export declare
|
|
200
|
+
export declare const i18n: import("i18next").i18n;
|
package/cjs/i18n/index.js
CHANGED
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.i18n = exports.resources = exports.defaultNS = void 0;
|
|
4
4
|
const i18next_1 = require("i18next");
|
|
5
|
-
const
|
|
6
|
-
const translation_json_1 = require("./en/translation.json");
|
|
5
|
+
const en_json_1 = require("./en.json");
|
|
7
6
|
exports.defaultNS = 'translation';
|
|
8
7
|
exports.resources = {
|
|
9
8
|
en: {
|
|
10
|
-
translation:
|
|
9
|
+
translation: en_json_1.default,
|
|
11
10
|
},
|
|
12
11
|
};
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
exports.configureReactI18next = configureReactI18next;
|
|
12
|
+
exports.i18n = i18next_1.default.createInstance({
|
|
13
|
+
lng: 'en',
|
|
14
|
+
fallbackLng: 'en',
|
|
15
|
+
lowerCaseLng: true,
|
|
16
|
+
interpolation: {
|
|
17
|
+
escapeValue: false,
|
|
18
|
+
},
|
|
19
|
+
resources: exports.resources,
|
|
20
|
+
},
|
|
21
|
+
// providing an empty callback here will automatically call init
|
|
22
|
+
() => { });
|
package/cjs/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './fonts/inter.css';
|
|
3
|
-
export type { WidgetDrawer
|
|
3
|
+
export type { WidgetDrawer } from './AppDrawer';
|
|
4
4
|
export { useWidgetEvents } from './hooks';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export declare const LiFiWidget: import("react").FC<import("./
|
|
7
|
-
|
|
6
|
+
export declare const LiFiWidget: import("react").FC<import("./types").WidgetProps>;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use configuration { variant: 'drawer' } instead
|
|
9
|
+
*/
|
|
10
|
+
export declare const LiFiWidgetDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetProps & import("react").RefAttributes<import("./AppDrawer").WidgetDrawer>>;
|
package/cjs/index.js
CHANGED
|
@@ -18,13 +18,14 @@ exports.LiFiWidgetDrawer = exports.LiFiWidget = exports.useWidgetEvents = void 0
|
|
|
18
18
|
const App_1 = require("./App");
|
|
19
19
|
const AppDrawer_1 = require("./AppDrawer");
|
|
20
20
|
require("./fonts/inter.css");
|
|
21
|
-
const i18n_1 = require("./i18n");
|
|
22
21
|
var hooks_1 = require("./hooks");
|
|
23
22
|
Object.defineProperty(exports, "useWidgetEvents", { enumerable: true, get: function () { return hooks_1.useWidgetEvents; } });
|
|
24
23
|
__exportStar(require("./types"), exports);
|
|
25
|
-
(0, i18n_1.configureReactI18next)();
|
|
26
24
|
// ClassNameGenerator.configure((componentName) =>
|
|
27
25
|
// componentName.replace('Mui', 'LiFi'),
|
|
28
26
|
// );
|
|
29
27
|
exports.LiFiWidget = App_1.App;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Use configuration { variant: 'drawer' } instead
|
|
30
|
+
*/
|
|
30
31
|
exports.LiFiWidgetDrawer = AppDrawer_1.AppDrawer;
|
|
@@ -12,7 +12,7 @@ exports.useLiFi = useLiFi;
|
|
|
12
12
|
const SDKProvider = ({ children, }) => {
|
|
13
13
|
const { sdkConfig, integrator } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
14
14
|
const value = (0, react_1.useMemo)(() => {
|
|
15
|
-
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign(
|
|
15
|
+
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
16
16
|
if (!lifi) {
|
|
17
17
|
lifi = new sdk_1.default(Object.assign({ disableVersionCheck: true }, config));
|
|
18
18
|
}
|
package/cjs/types/widget.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ChainKey, ConfigUpdate, Token } from '@lifi/sdk';
|
|
|
2
2
|
import type { PaletteMode, PaletteOptions, Shape } from '@mui/material';
|
|
3
3
|
import type { TypographyOptions } from '@mui/material/styles/createTypography';
|
|
4
4
|
import type { Signer } from 'ethers';
|
|
5
|
-
import type { CSSProperties } from 'react';
|
|
5
|
+
import type { CSSProperties, RefObject } from 'react';
|
|
6
6
|
export declare type WidgetVariant = 'default' | 'expandable' | 'drawer';
|
|
7
7
|
export declare type Appearance = PaletteMode | 'auto';
|
|
8
8
|
export declare type ThemeConfig = {
|
|
@@ -57,3 +57,8 @@ export interface WidgetConfig {
|
|
|
57
57
|
deny?: (Partial<Token> & Pick<Token, 'address' | 'chainId'>)[];
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
+
export declare type WidgetProps = {
|
|
61
|
+
elementRef?: RefObject<HTMLDivElement>;
|
|
62
|
+
config?: WidgetConfig;
|
|
63
|
+
open?: boolean;
|
|
64
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { BottomSheetBase, BottomSheetProps } from './types';
|
|
3
|
-
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "
|
|
3
|
+
export declare const BottomSheet: import("react").ForwardRefExoticComponent<Pick<BottomSheetProps, "className" | "style" | "classes" | "slot" | "title" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "hidden" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "translate" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "color" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "children" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "sx" | "key" | "transitionDuration" | "variant" | "open" | "anchor" | "components" | "elementRef" | "componentsProps" | "BackdropComponent" | "BackdropProps" | "closeAfterTransition" | "container" | "disableAutoFocus" | "disableEnforceFocus" | "disableEscapeKeyDown" | "disablePortal" | "disableRestoreFocus" | "disableScrollLock" | "hideBackdrop" | "keepMounted" | "onBackdropClick" | "onClose" | "elevation" | "PaperProps" | "ModalProps" | "SlideProps"> & import("react").RefAttributes<BottomSheetBase>>;
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.21.0";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.21.0';
|
package/i18n/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export declare const defaultNS = "translation";
|
|
|
2
2
|
export declare const resources: {
|
|
3
3
|
readonly en: {
|
|
4
4
|
readonly translation: {
|
|
5
|
+
language: string;
|
|
5
6
|
header: {
|
|
6
7
|
walletConnected: string;
|
|
7
8
|
connectWallet: string;
|
|
@@ -196,4 +197,4 @@ export declare const resources: {
|
|
|
196
197
|
};
|
|
197
198
|
};
|
|
198
199
|
};
|
|
199
|
-
export declare
|
|
200
|
+
export declare const i18n: import("i18next").i18n;
|
package/i18n/index.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import translation from './en/translation.json';
|
|
1
|
+
import i18next from 'i18next';
|
|
2
|
+
import en from './en.json';
|
|
4
3
|
export const defaultNS = 'translation';
|
|
5
4
|
export const resources = {
|
|
6
5
|
en: {
|
|
7
|
-
translation,
|
|
6
|
+
translation: en,
|
|
8
7
|
},
|
|
9
8
|
};
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
9
|
+
export const i18n = i18next.createInstance({
|
|
10
|
+
lng: 'en',
|
|
11
|
+
fallbackLng: 'en',
|
|
12
|
+
lowerCaseLng: true,
|
|
13
|
+
interpolation: {
|
|
14
|
+
escapeValue: false,
|
|
15
|
+
},
|
|
16
|
+
resources,
|
|
17
|
+
},
|
|
18
|
+
// providing an empty callback here will automatically call init
|
|
19
|
+
() => { });
|
package/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import './fonts/inter.css';
|
|
3
|
-
export type { WidgetDrawer
|
|
3
|
+
export type { WidgetDrawer } from './AppDrawer';
|
|
4
4
|
export { useWidgetEvents } from './hooks';
|
|
5
5
|
export * from './types';
|
|
6
|
-
export declare const LiFiWidget: import("react").FC<import("./
|
|
7
|
-
|
|
6
|
+
export declare const LiFiWidget: import("react").FC<import("./types").WidgetProps>;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use configuration { variant: 'drawer' } instead
|
|
9
|
+
*/
|
|
10
|
+
export declare const LiFiWidgetDrawer: import("react").ForwardRefExoticComponent<import("./types").WidgetProps & import("react").RefAttributes<import("./AppDrawer").WidgetDrawer>>;
|
package/index.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { App } from './App';
|
|
2
2
|
import { AppDrawer } from './AppDrawer';
|
|
3
3
|
import './fonts/inter.css';
|
|
4
|
-
import { configureReactI18next } from './i18n';
|
|
5
4
|
export { useWidgetEvents } from './hooks';
|
|
6
5
|
export * from './types';
|
|
7
|
-
configureReactI18next();
|
|
8
6
|
// ClassNameGenerator.configure((componentName) =>
|
|
9
7
|
// componentName.replace('Mui', 'LiFi'),
|
|
10
8
|
// );
|
|
11
9
|
export const LiFiWidget = App;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use configuration { variant: 'drawer' } instead
|
|
12
|
+
*/
|
|
12
13
|
export const LiFiWidgetDrawer = AppDrawer;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.21.0",
|
|
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",
|
|
@@ -8,7 +8,7 @@ export const useLiFi = () => useContext(SDKContext);
|
|
|
8
8
|
export const SDKProvider = ({ children, }) => {
|
|
9
9
|
const { sdkConfig, integrator } = useWidgetConfig();
|
|
10
10
|
const value = useMemo(() => {
|
|
11
|
-
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign(
|
|
11
|
+
const config = Object.assign(Object.assign({}, sdkConfig), { defaultRouteOptions: Object.assign({ integrator: integrator !== null && integrator !== void 0 ? integrator : window.location.hostname }, sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) });
|
|
12
12
|
if (!lifi) {
|
|
13
13
|
lifi = new LIFI(Object.assign({ disableVersionCheck: true }, config));
|
|
14
14
|
}
|