@lifi/widget 2.2.3 → 2.2.5
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.js +4 -1
- package/cjs/App.js +4 -1
- package/cjs/components/AppContainer.js +1 -1
- package/cjs/components/Header/Header.style.js +1 -1
- package/cjs/components/Routes/RoutesExpanded.style.js +1 -1
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/utils/elements.d.ts +4 -2
- package/cjs/utils/elements.js +4 -2
- package/components/AppContainer.js +2 -2
- package/components/Header/Header.style.js +1 -1
- package/components/Routes/RoutesExpanded.style.js +2 -2
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/package.json +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/utils/elements.d.ts +4 -2
- package/utils/elements.js +4 -2
package/App.js
CHANGED
|
@@ -9,11 +9,14 @@ import { Initializer } from './components/Initializer';
|
|
|
9
9
|
import { PoweredBy } from './components/PoweredBy';
|
|
10
10
|
import { RoutesExpanded } from './components/Routes';
|
|
11
11
|
import { useExpandableVariant } from './hooks';
|
|
12
|
+
import { useWidgetConfig } from './providers';
|
|
13
|
+
import { ElementId, createElementId } from './utils';
|
|
12
14
|
export const App = forwardRef(({ elementRef, open, integrator, ...other }, ref) => {
|
|
13
15
|
const config = useMemo(() => ({ integrator, ...other, ...other.config }), [integrator, other]);
|
|
14
16
|
return config?.variant !== 'drawer' ? (_jsx(AppProvider, { config: config, children: _jsx(AppDefault, {}) })) : (_jsx(AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
|
|
15
17
|
});
|
|
16
18
|
export const AppDefault = () => {
|
|
19
|
+
const { elementId } = useWidgetConfig();
|
|
17
20
|
const expandable = useExpandableVariant();
|
|
18
|
-
return (_jsxs(AppExpandedContainer, { children: [_jsxs(AppContainer, { children: [_jsx(Header, {}), _jsx(FlexContainer, { disableGutters: true, children: _jsx(AppRoutes, {}) }), _jsx(PoweredBy, {}), _jsx(Initializer, {})] }), expandable ? _jsx(RoutesExpanded, {}) : null] }));
|
|
21
|
+
return (_jsxs(AppExpandedContainer, { id: createElementId(ElementId.AppExpandedContainer, elementId), children: [_jsxs(AppContainer, { children: [_jsx(Header, {}), _jsx(FlexContainer, { disableGutters: true, children: _jsx(AppRoutes, {}) }), _jsx(PoweredBy, {}), _jsx(Initializer, {})] }), expandable ? _jsx(RoutesExpanded, {}) : null] }));
|
|
19
22
|
};
|
package/cjs/App.js
CHANGED
|
@@ -12,12 +12,15 @@ const Initializer_1 = require("./components/Initializer");
|
|
|
12
12
|
const PoweredBy_1 = require("./components/PoweredBy");
|
|
13
13
|
const Routes_1 = require("./components/Routes");
|
|
14
14
|
const hooks_1 = require("./hooks");
|
|
15
|
+
const providers_1 = require("./providers");
|
|
16
|
+
const utils_1 = require("./utils");
|
|
15
17
|
exports.App = (0, react_1.forwardRef)(({ elementRef, open, integrator, ...other }, ref) => {
|
|
16
18
|
const config = (0, react_1.useMemo)(() => ({ integrator, ...other, ...other.config }), [integrator, other]);
|
|
17
19
|
return config?.variant !== 'drawer' ? ((0, jsx_runtime_1.jsx)(AppProvider_1.AppProvider, { config: config, children: (0, jsx_runtime_1.jsx)(exports.AppDefault, {}) })) : ((0, jsx_runtime_1.jsx)(AppDrawer_1.AppDrawer, { ref: ref, elementRef: elementRef, integrator: integrator, config: config, open: open }));
|
|
18
20
|
});
|
|
19
21
|
const AppDefault = () => {
|
|
22
|
+
const { elementId } = (0, providers_1.useWidgetConfig)();
|
|
20
23
|
const expandable = (0, hooks_1.useExpandableVariant)();
|
|
21
|
-
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, { 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)(Routes_1.RoutesExpanded, {}) : null] }));
|
|
24
|
+
return ((0, jsx_runtime_1.jsxs)(AppContainer_1.AppExpandedContainer, { id: (0, utils_1.createElementId)(utils_1.ElementId.AppExpandedContainer, elementId), 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, { 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)(Routes_1.RoutesExpanded, {}) : null] }));
|
|
22
25
|
};
|
|
23
26
|
exports.AppDefault = AppDefault;
|
|
@@ -51,6 +51,6 @@ exports.FlexContainer = (0, styles_1.styled)(material_1.Container)({
|
|
|
51
51
|
const AppContainer = ({ children }) => {
|
|
52
52
|
// const ref = useRef<HTMLDivElement>(null);
|
|
53
53
|
const { containerStyle, variant, elementId } = (0, providers_1.useWidgetConfig)();
|
|
54
|
-
return ((0, jsx_runtime_1.jsx)(RelativeContainer, { sx: containerStyle, variant: variant, children: (0, jsx_runtime_1.jsx)(CssBaselineContainer, { id: (0, utils_1.createElementId)(utils_1.ElementId.ScrollableContainer, elementId), variant: variant, enableColorScheme: true, children: (0, jsx_runtime_1.jsx)(exports.FlexContainer, { disableGutters: true, children: children }) }) }));
|
|
54
|
+
return ((0, jsx_runtime_1.jsx)(RelativeContainer, { sx: containerStyle, variant: variant, id: (0, utils_1.createElementId)(utils_1.ElementId.RelativeContainer, elementId), children: (0, jsx_runtime_1.jsx)(CssBaselineContainer, { id: (0, utils_1.createElementId)(utils_1.ElementId.ScrollableContainer, elementId), variant: variant, enableColorScheme: true, children: (0, jsx_runtime_1.jsx)(exports.FlexContainer, { disableGutters: true, children: children }) }) }));
|
|
55
55
|
};
|
|
56
56
|
exports.AppContainer = AppContainer;
|
|
@@ -20,7 +20,7 @@ exports.HeaderAppBar = (0, styles_1.styled)(material_1.AppBar)(({ theme }) => ({
|
|
|
20
20
|
exports.Container = (0, styles_1.styled)(material_1.Box, {
|
|
21
21
|
shouldForwardProp: (prop) => prop !== 'sticky',
|
|
22
22
|
})(({ theme, sticky }) => ({
|
|
23
|
-
backgroundColor:
|
|
23
|
+
backgroundColor: theme.palette.background.default,
|
|
24
24
|
backdropFilter: 'blur(12px)',
|
|
25
25
|
position: sticky ? 'sticky' : 'relative',
|
|
26
26
|
top: 0,
|
|
@@ -26,7 +26,7 @@ exports.Container = (0, styles_1.styled)(material_1.ScopedCssBaseline)(({ theme
|
|
|
26
26
|
flexDirection: 'column',
|
|
27
27
|
}));
|
|
28
28
|
exports.Header = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
29
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: theme.palette.background.default,
|
|
30
30
|
backdropFilter: 'blur(12px)',
|
|
31
31
|
display: 'flex',
|
|
32
32
|
justifyContent: 'space-between',
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.2.
|
|
2
|
+
export declare const version = "2.2.5";
|
package/cjs/config/version.js
CHANGED
package/cjs/utils/elements.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export declare enum ElementId {
|
|
2
|
-
|
|
3
|
-
Header = "widget-header"
|
|
2
|
+
AppExpandedContainer = "widget-app-expanded-container",
|
|
3
|
+
Header = "widget-header",
|
|
4
|
+
RelativeContainer = "widget-relative-container",
|
|
5
|
+
ScrollableContainer = "widget-scrollable-container"
|
|
4
6
|
}
|
|
5
7
|
export declare const createElementId: (ElementId: ElementId, elementId: string) => string;
|
package/cjs/utils/elements.js
CHANGED
|
@@ -3,8 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.createElementId = exports.ElementId = void 0;
|
|
4
4
|
var ElementId;
|
|
5
5
|
(function (ElementId) {
|
|
6
|
-
ElementId["
|
|
6
|
+
ElementId["AppExpandedContainer"] = "widget-app-expanded-container";
|
|
7
7
|
ElementId["Header"] = "widget-header";
|
|
8
|
+
ElementId["RelativeContainer"] = "widget-relative-container";
|
|
9
|
+
ElementId["ScrollableContainer"] = "widget-scrollable-container";
|
|
8
10
|
})(ElementId || (exports.ElementId = ElementId = {}));
|
|
9
|
-
const createElementId = (ElementId, elementId) => `${ElementId}-${elementId}
|
|
11
|
+
const createElementId = (ElementId, elementId) => elementId ? `${ElementId}-${elementId}` : ElementId;
|
|
10
12
|
exports.createElementId = createElementId;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box, Container, ScopedCssBaseline } from '@mui/material';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import { useWidgetConfig } from '../providers';
|
|
5
|
-
import {
|
|
5
|
+
import { ElementId, createElementId } from '../utils';
|
|
6
6
|
export const maxHeight = 680;
|
|
7
7
|
export const AppExpandedContainer = styled(Box, {
|
|
8
8
|
shouldForwardProp: (prop) => prop !== 'variant',
|
|
@@ -48,5 +48,5 @@ export const FlexContainer = styled(Container)({
|
|
|
48
48
|
export const AppContainer = ({ children }) => {
|
|
49
49
|
// const ref = useRef<HTMLDivElement>(null);
|
|
50
50
|
const { containerStyle, variant, elementId } = useWidgetConfig();
|
|
51
|
-
return (_jsx(RelativeContainer, { sx: containerStyle, variant: variant, children: _jsx(CssBaselineContainer, { id: createElementId(ElementId.ScrollableContainer, elementId), variant: variant, enableColorScheme: true, children: _jsx(FlexContainer, { disableGutters: true, children: children }) }) }));
|
|
51
|
+
return (_jsx(RelativeContainer, { sx: containerStyle, variant: variant, id: createElementId(ElementId.RelativeContainer, elementId), children: _jsx(CssBaselineContainer, { id: createElementId(ElementId.ScrollableContainer, elementId), variant: variant, enableColorScheme: true, children: _jsx(FlexContainer, { disableGutters: true, children: children }) }) }));
|
|
52
52
|
};
|
|
@@ -17,7 +17,7 @@ export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
|
|
|
17
17
|
export const Container = styled(Box, {
|
|
18
18
|
shouldForwardProp: (prop) => prop !== 'sticky',
|
|
19
19
|
})(({ theme, sticky }) => ({
|
|
20
|
-
backgroundColor:
|
|
20
|
+
backgroundColor: theme.palette.background.default,
|
|
21
21
|
backdropFilter: 'blur(12px)',
|
|
22
22
|
position: sticky ? 'sticky' : 'relative',
|
|
23
23
|
top: 0,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Box, ScopedCssBaseline } from '@mui/material';
|
|
2
|
-
import {
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { maxHeight } from '../AppContainer';
|
|
4
4
|
export const CollapseContainer = styled(Box)(({ theme }) => ({
|
|
5
5
|
height: maxHeight,
|
|
@@ -23,7 +23,7 @@ export const Container = styled(ScopedCssBaseline)(({ theme }) => ({
|
|
|
23
23
|
flexDirection: 'column',
|
|
24
24
|
}));
|
|
25
25
|
export const Header = styled(Box)(({ theme }) => ({
|
|
26
|
-
backgroundColor:
|
|
26
|
+
backgroundColor: theme.palette.background.default,
|
|
27
27
|
backdropFilter: 'blur(12px)',
|
|
28
28
|
display: 'flex',
|
|
29
29
|
justifyContent: 'space-between',
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.2.
|
|
2
|
+
export declare const version = "2.2.5";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '2.2.
|
|
2
|
+
export const version = '2.2.5';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.5",
|
|
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",
|