@tap-payments/os-micro-frontend-shared 0.1.96-test.21 → 0.1.96-test.22
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.
|
@@ -4,7 +4,9 @@ import { motion } from 'framer-motion';
|
|
|
4
4
|
import { Resizable } from 're-resizable';
|
|
5
5
|
import { APP_WINDOW_Z_INDEX, FOOTER_HEIGHT, HEADER_HEIGHT } from '../../constants/index.js';
|
|
6
6
|
import { contentStyle, ContentWrapper, initalStyle, resizableMainStyle, AppContainerWrapper, AppContainerContainer } from './style';
|
|
7
|
+
import { useTheme } from '@mui/material';
|
|
7
8
|
function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragControls, onClick, options: { width, height, minHeight, minWidth, maxHeight, maxWidth, order, openOrder = 1 }, sandboxMode = false, }) {
|
|
9
|
+
const theme = useTheme();
|
|
8
10
|
const [isDrag, setIsDrag] = useState(true);
|
|
9
11
|
const modalRef = useRef(null);
|
|
10
12
|
const constraintsRef = useRef(null);
|
|
@@ -16,9 +18,9 @@ function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragC
|
|
|
16
18
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
17
19
|
setIsDrag(false);
|
|
18
20
|
};
|
|
19
|
-
const resizableStyle = useMemo(() => (Object.assign(Object.assign(Object.assign({}, resizableMainStyle), { maxWidth: width, borderRadius: !isMaximized ? 12 : '0 !important' }), (!isMaximized && {
|
|
21
|
+
const resizableStyle = useMemo(() => (Object.assign(Object.assign(Object.assign(Object.assign({}, resizableMainStyle), { maxWidth: width, borderRadius: !isMaximized ? 12 : '0 !important' }), (!isMaximized && {
|
|
20
22
|
top: 0,
|
|
21
|
-
}))), [isMaximized,
|
|
23
|
+
})), { background: sandboxMode ? theme.palette.common.lightOrange : theme.palette.background.transparent[0], backdropFilter: 'blur(32px)' })), [width, isMaximized, sandboxMode]);
|
|
22
24
|
useEffect(() => {
|
|
23
25
|
var _a;
|
|
24
26
|
(_a = resizableRef.current) === null || _a === void 0 ? void 0 : _a.updateSize({
|
|
@@ -32,7 +34,7 @@ function WindowWrapper({ children, id, onResize, isMaximized, isMinimized, dragC
|
|
|
32
34
|
left: 48 * (openOrder - 1),
|
|
33
35
|
})), animate: Object.assign(Object.assign({ width }, (isMaximized && {
|
|
34
36
|
width: '100vw',
|
|
35
|
-
})), { scale: Number(!isMinimized), top: isMaximized ? 0 : HEADER_HEIGHT + FOOTER_HEIGHT * (openOrder - 1), left: isMaximized ? 0 : 48 * (openOrder - 1) }), ref: modalRef, maximized: isMaximized, transition: { duration: isMaximized ? 0.3 : 0 }
|
|
37
|
+
})), { scale: Number(!isMinimized), top: isMaximized ? 0 : HEADER_HEIGHT + FOOTER_HEIGHT * (openOrder - 1), left: isMaximized ? 0 : 48 * (openOrder - 1) }), ref: modalRef, maximized: isMaximized, transition: { duration: isMaximized ? 0.3 : 0 } }, { children: _jsx(Resizable, Object.assign({ ref: (c) => {
|
|
36
38
|
resizableRef.current = c;
|
|
37
39
|
}, style: resizableStyle, minHeight: minHeight, minWidth: minWidth, maxHeight: maxHeight, maxWidth: maxWidth, onResizeStart: onResizeStart, onResizeStop: onResizeStop, onResize: (_, __, element) => {
|
|
38
40
|
onResize === null || onResize === void 0 ? void 0 : onResize(element);
|
|
@@ -265,7 +265,6 @@ export declare const ContentWrapper: import("@emotion/styled").StyledComponent<{
|
|
|
265
265
|
onTransitionEndCapture?: import("react").TransitionEventHandler<HTMLDivElement> | undefined;
|
|
266
266
|
} & import("framer-motion").MotionProps & import("react").RefAttributes<HTMLDivElement> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & {
|
|
267
267
|
maximized?: boolean | undefined;
|
|
268
|
-
sandboxMode?: boolean | undefined;
|
|
269
268
|
}, {}, {}>;
|
|
270
269
|
export declare const AppContainerWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material/styles").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
271
270
|
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
@@ -30,7 +30,7 @@ export const initalStyle = {
|
|
|
30
30
|
};
|
|
31
31
|
export const ContentWrapper = styled(motion.div, {
|
|
32
32
|
shouldForwardProp: (props) => props !== 'maximized',
|
|
33
|
-
})(({ maximized
|
|
33
|
+
})(({ maximized }) => (Object.assign({ overflow: 'hidden', display: 'flex', flexDirection: 'column', width: '100%', height: '100%', zIndex: 1, borderRadius: '12px' }, (maximized && {
|
|
34
34
|
transform: 'translate(0,0) !important',
|
|
35
35
|
}))));
|
|
36
36
|
export const AppContainerWrapper = styled(Box)(() => ({
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
3
|
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.96-test.
|
|
5
|
-
"testVersion":
|
|
4
|
+
"version": "0.1.96-test.22",
|
|
5
|
+
"testVersion": 22,
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "build/index.js",
|
|
8
8
|
"module": "build/index.js",
|