@kadoui/react 2.1.1 → 2.1.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.
- package/dist/react-components/DrawerSheet/DrawerSheet.d.ts +2 -0
- package/dist/react-components/DrawerSheet/DrawerSheet.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/DrawerSheet.js +1 -0
- package/dist/react-components/DrawerSheet/browser.d.ts +8 -0
- package/dist/react-components/DrawerSheet/browser.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/browser.js +27 -0
- package/dist/react-components/DrawerSheet/constants.d.ts +12 -0
- package/dist/react-components/DrawerSheet/constants.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/constants.js +11 -0
- package/dist/react-components/DrawerSheet/context.d.ts +38 -0
- package/dist/react-components/DrawerSheet/context.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/context.js +39 -0
- package/dist/react-components/DrawerSheet/helpers.d.ts +17 -0
- package/dist/react-components/DrawerSheet/helpers.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/helpers.js +97 -0
- package/dist/react-components/DrawerSheet/index.d.ts +147 -0
- package/dist/react-components/DrawerSheet/index.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/index.js +803 -0
- package/dist/react-components/DrawerSheet/types.d.ts +7 -0
- package/dist/react-components/DrawerSheet/types.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/types.js +1 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.d.ts +14 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-composed-refs.js +30 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.d.ts +9 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-controllable-state.js +41 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.d.ts +19 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-position-fixed.js +109 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.d.ts +18 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-prevent-scroll.js +237 -0
- package/dist/react-components/DrawerSheet/use-scale-background.d.ts +2 -0
- package/dist/react-components/DrawerSheet/use-scale-background.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-scale-background.js +50 -0
- package/dist/react-components/DrawerSheet/use-snap-points.d.ts +32 -0
- package/dist/react-components/DrawerSheet/use-snap-points.d.ts.map +1 -0
- package/dist/react-components/DrawerSheet/use-snap-points.js +200 -0
- package/dist/react-components/drawer-sheet/DrawerSheet.d.ts +23 -0
- package/dist/react-components/drawer-sheet/DrawerSheet.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheet.js +22 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBackdrop.js +13 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetBody.js +165 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContent.js +16 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetContext.js +2 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHandlebar.js +5 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetHeader.js +5 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetPortal.js +13 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.d.ts +15 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetProvider.js +75 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetRoot.js +130 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.d.ts +3 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetToggle.js +11 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.d.ts +4 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/DrawerSheetViewport.js +5 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.d.ts +30 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.d.ts.map +1 -0
- package/dist/react-components/drawer-sheet/drawerSheetTypes.js +1 -0
- package/dist/react-exports.d.ts +1 -0
- package/dist/react-exports.d.ts.map +1 -1
- package/dist/react-exports.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;AAClE,MAAM,WAAW,SAAS;IACxB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,WAAW,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
type PossibleRef<T> = React.Ref<T> | undefined;
|
|
3
|
+
/**
|
|
4
|
+
* A utility to compose multiple refs together
|
|
5
|
+
* Accepts callback refs and RefObject(s)
|
|
6
|
+
*/
|
|
7
|
+
declare function composeRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
|
|
8
|
+
/**
|
|
9
|
+
* A custom hook that composes multiple refs
|
|
10
|
+
* Accepts callback refs and RefObject(s)
|
|
11
|
+
*/
|
|
12
|
+
declare function useComposedRefs<T>(...refs: PossibleRef<T>[]): (node: T) => void;
|
|
13
|
+
export { composeRefs, useComposedRefs };
|
|
14
|
+
//# sourceMappingURL=use-composed-refs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-composed-refs.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-composed-refs.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,KAAK,WAAW,CAAC,CAAC,IAAI,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC;AAc/C;;;GAGG;AACH,iBAAS,WAAW,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,IACvC,MAAM,CAAC,UAChB;AAED;;;GAGG;AACH,iBAAS,eAAe,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,qBAGpD;AAED,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// This code comes from https://github.com/radix-ui/primitives/tree/main/packages/react/compose-refs
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Set a given ref to a given value
|
|
5
|
+
* This utility takes care of different types of refs: callback refs and RefObject(s)
|
|
6
|
+
*/
|
|
7
|
+
function setRef(ref, value) {
|
|
8
|
+
if (typeof ref === 'function') {
|
|
9
|
+
ref(value);
|
|
10
|
+
}
|
|
11
|
+
else if (ref !== null && ref !== undefined) {
|
|
12
|
+
ref.current = value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* A utility to compose multiple refs together
|
|
17
|
+
* Accepts callback refs and RefObject(s)
|
|
18
|
+
*/
|
|
19
|
+
function composeRefs(...refs) {
|
|
20
|
+
return (node) => refs.forEach((ref) => setRef(ref, node));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A custom hook that composes multiple refs
|
|
24
|
+
* Accepts callback refs and RefObject(s)
|
|
25
|
+
*/
|
|
26
|
+
function useComposedRefs(...refs) {
|
|
27
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
28
|
+
return React.useCallback(composeRefs(...refs), refs);
|
|
29
|
+
}
|
|
30
|
+
export { composeRefs, useComposedRefs };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type UseControllableStateParams<T> = {
|
|
3
|
+
prop?: T | undefined;
|
|
4
|
+
defaultProp?: T | undefined;
|
|
5
|
+
onChange?: (state: T) => void;
|
|
6
|
+
};
|
|
7
|
+
export declare function useControllableState<T>({ prop, defaultProp, onChange }: UseControllableStateParams<T>): readonly [T | undefined, React.Dispatch<React.SetStateAction<T | undefined>>];
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=use-controllable-state.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-controllable-state.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-controllable-state.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,0BAA0B,CAAC,CAAC,IAAI;IACnC,IAAI,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IACrB,WAAW,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;CAC/B,CAAC;AA8BF,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,QAAmB,EAAE,EAAE,0BAA0B,CAAC,CAAC,CAAC,iFAoBhH"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// This code comes from https://github.com/radix-ui/primitives/blob/main/packages/react/use-controllable-state/src/useControllableState.tsx
|
|
2
|
+
import React from 'react';
|
|
3
|
+
function useCallbackRef(callback) {
|
|
4
|
+
const callbackRef = React.useRef(callback);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
callbackRef.current = callback;
|
|
7
|
+
});
|
|
8
|
+
// https://github.com/facebook/react/issues/19240
|
|
9
|
+
return React.useMemo(() => ((...args) => callbackRef.current?.(...args)), []);
|
|
10
|
+
}
|
|
11
|
+
function useUncontrolledState({ defaultProp, onChange }) {
|
|
12
|
+
const uncontrolledState = React.useState(defaultProp);
|
|
13
|
+
const [value] = uncontrolledState;
|
|
14
|
+
const prevValueRef = React.useRef(value);
|
|
15
|
+
const handleChange = useCallbackRef(onChange);
|
|
16
|
+
React.useEffect(() => {
|
|
17
|
+
if (prevValueRef.current !== value) {
|
|
18
|
+
handleChange(value);
|
|
19
|
+
prevValueRef.current = value;
|
|
20
|
+
}
|
|
21
|
+
}, [value, prevValueRef, handleChange]);
|
|
22
|
+
return uncontrolledState;
|
|
23
|
+
}
|
|
24
|
+
export function useControllableState({ prop, defaultProp, onChange = () => { } }) {
|
|
25
|
+
const [uncontrolledProp, setUncontrolledProp] = useUncontrolledState({ defaultProp, onChange });
|
|
26
|
+
const isControlled = prop !== undefined;
|
|
27
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
28
|
+
const handleChange = useCallbackRef(onChange);
|
|
29
|
+
const setValue = React.useCallback((nextValue) => {
|
|
30
|
+
if (isControlled) {
|
|
31
|
+
const setter = nextValue;
|
|
32
|
+
const value = typeof nextValue === 'function' ? setter(prop) : nextValue;
|
|
33
|
+
if (value !== prop)
|
|
34
|
+
handleChange(value);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
setUncontrolledProp(nextValue);
|
|
38
|
+
}
|
|
39
|
+
}, [isControlled, prop, setUncontrolledProp, handleChange]);
|
|
40
|
+
return [value, setValue];
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This hook is necessary to prevent buggy behavior on iOS devices (need to test on Android).
|
|
3
|
+
* I won't get into too much detail about what bugs it solves, but so far I've found that setting the body to `position: fixed` is the most reliable way to prevent those bugs.
|
|
4
|
+
* Issues that this hook solves:
|
|
5
|
+
* https://github.com/emilkowalski/vaul/issues/435
|
|
6
|
+
* https://github.com/emilkowalski/vaul/issues/433
|
|
7
|
+
* And more that I discovered, but were just not reported.
|
|
8
|
+
*/
|
|
9
|
+
export declare function usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles, }: {
|
|
10
|
+
isOpen: boolean;
|
|
11
|
+
modal: boolean;
|
|
12
|
+
nested: boolean;
|
|
13
|
+
hasBeenOpened: boolean;
|
|
14
|
+
preventScrollRestoration: boolean;
|
|
15
|
+
noBodyStyles: boolean;
|
|
16
|
+
}): {
|
|
17
|
+
restorePositionSetting: () => void;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=use-position-fixed.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-position-fixed.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-position-fixed.ts"],"names":[],"mappings":"AAKA;;;;;;;GAOG;AAEH,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,KAAK,EACL,MAAM,EACN,aAAa,EACb,wBAAwB,EACxB,YAAY,GACb,EAAE;IACD,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,OAAO,CAAC;IACvB,wBAAwB,EAAE,OAAO,CAAC;IAClC,YAAY,EAAE,OAAO,CAAC;CACvB;;EAoHA"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { isSafari } from './browser';
|
|
3
|
+
let previousBodyPosition = null;
|
|
4
|
+
/**
|
|
5
|
+
* This hook is necessary to prevent buggy behavior on iOS devices (need to test on Android).
|
|
6
|
+
* I won't get into too much detail about what bugs it solves, but so far I've found that setting the body to `position: fixed` is the most reliable way to prevent those bugs.
|
|
7
|
+
* Issues that this hook solves:
|
|
8
|
+
* https://github.com/emilkowalski/vaul/issues/435
|
|
9
|
+
* https://github.com/emilkowalski/vaul/issues/433
|
|
10
|
+
* And more that I discovered, but were just not reported.
|
|
11
|
+
*/
|
|
12
|
+
export function usePositionFixed({ isOpen, modal, nested, hasBeenOpened, preventScrollRestoration, noBodyStyles, }) {
|
|
13
|
+
const [activeUrl, setActiveUrl] = React.useState(() => (typeof window !== 'undefined' ? window.location.href : ''));
|
|
14
|
+
const scrollPos = React.useRef(0);
|
|
15
|
+
const setPositionFixed = React.useCallback(() => {
|
|
16
|
+
// All browsers on iOS will return true here.
|
|
17
|
+
if (!isSafari())
|
|
18
|
+
return;
|
|
19
|
+
// If previousBodyPosition is already set, don't set it again.
|
|
20
|
+
if (previousBodyPosition === null && isOpen && !noBodyStyles) {
|
|
21
|
+
previousBodyPosition = {
|
|
22
|
+
position: document.body.style.position,
|
|
23
|
+
top: document.body.style.top,
|
|
24
|
+
left: document.body.style.left,
|
|
25
|
+
height: document.body.style.height,
|
|
26
|
+
right: 'unset',
|
|
27
|
+
};
|
|
28
|
+
// Update the dom inside an animation frame
|
|
29
|
+
const { scrollX, innerHeight } = window;
|
|
30
|
+
document.body.style.setProperty('position', 'fixed', 'important');
|
|
31
|
+
Object.assign(document.body.style, {
|
|
32
|
+
top: `${-scrollPos.current}px`,
|
|
33
|
+
left: `${-scrollX}px`,
|
|
34
|
+
right: '0px',
|
|
35
|
+
height: 'auto',
|
|
36
|
+
});
|
|
37
|
+
window.setTimeout(() => window.requestAnimationFrame(() => {
|
|
38
|
+
// Attempt to check if the bottom bar appeared due to the position change
|
|
39
|
+
const bottomBarHeight = innerHeight - window.innerHeight;
|
|
40
|
+
if (bottomBarHeight && scrollPos.current >= innerHeight) {
|
|
41
|
+
// Move the content further up so that the bottom bar doesn't hide it
|
|
42
|
+
document.body.style.top = `${-(scrollPos.current + bottomBarHeight)}px`;
|
|
43
|
+
}
|
|
44
|
+
}), 300);
|
|
45
|
+
}
|
|
46
|
+
}, [isOpen]);
|
|
47
|
+
const restorePositionSetting = React.useCallback(() => {
|
|
48
|
+
// All browsers on iOS will return true here.
|
|
49
|
+
if (!isSafari())
|
|
50
|
+
return;
|
|
51
|
+
if (previousBodyPosition !== null && !noBodyStyles) {
|
|
52
|
+
// Convert the position from "px" to Int
|
|
53
|
+
const y = -parseInt(document.body.style.top, 10);
|
|
54
|
+
const x = -parseInt(document.body.style.left, 10);
|
|
55
|
+
// Restore styles
|
|
56
|
+
Object.assign(document.body.style, previousBodyPosition);
|
|
57
|
+
window.requestAnimationFrame(() => {
|
|
58
|
+
if (preventScrollRestoration && activeUrl !== window.location.href) {
|
|
59
|
+
setActiveUrl(window.location.href);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
window.scrollTo(x, y);
|
|
63
|
+
});
|
|
64
|
+
previousBodyPosition = null;
|
|
65
|
+
}
|
|
66
|
+
}, [activeUrl]);
|
|
67
|
+
React.useEffect(() => {
|
|
68
|
+
function onScroll() {
|
|
69
|
+
scrollPos.current = window.scrollY;
|
|
70
|
+
}
|
|
71
|
+
onScroll();
|
|
72
|
+
window.addEventListener('scroll', onScroll);
|
|
73
|
+
return () => {
|
|
74
|
+
window.removeEventListener('scroll', onScroll);
|
|
75
|
+
};
|
|
76
|
+
}, []);
|
|
77
|
+
React.useEffect(() => {
|
|
78
|
+
if (!modal)
|
|
79
|
+
return;
|
|
80
|
+
return () => {
|
|
81
|
+
if (typeof document === 'undefined')
|
|
82
|
+
return;
|
|
83
|
+
// Another drawer is opened, safe to ignore the execution
|
|
84
|
+
const hasDrawerOpened = !!document.querySelector('[data-drawer-sheet]');
|
|
85
|
+
if (hasDrawerOpened)
|
|
86
|
+
return;
|
|
87
|
+
restorePositionSetting();
|
|
88
|
+
};
|
|
89
|
+
}, [modal, restorePositionSetting]);
|
|
90
|
+
React.useEffect(() => {
|
|
91
|
+
if (nested || !hasBeenOpened)
|
|
92
|
+
return;
|
|
93
|
+
// This is needed to force Safari toolbar to show **before** the drawer starts animating to prevent a gnarly shift from happening
|
|
94
|
+
if (isOpen) {
|
|
95
|
+
// avoid for standalone mode (PWA)
|
|
96
|
+
const isStandalone = window.matchMedia('(display-mode: standalone)').matches;
|
|
97
|
+
!isStandalone && setPositionFixed();
|
|
98
|
+
if (!modal) {
|
|
99
|
+
window.setTimeout(() => {
|
|
100
|
+
restorePositionSetting();
|
|
101
|
+
}, 500);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
restorePositionSetting();
|
|
106
|
+
}
|
|
107
|
+
}, [isOpen, hasBeenOpened, activeUrl, modal, nested, setPositionFixed, restorePositionSetting]);
|
|
108
|
+
return { restorePositionSetting };
|
|
109
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { useLayoutEffect } from 'react';
|
|
2
|
+
export declare const useIsomorphicLayoutEffect: typeof useLayoutEffect;
|
|
3
|
+
interface PreventScrollOptions {
|
|
4
|
+
/** Whether the scroll lock is disabled. */
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
focusCallback?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare function isScrollable(node: Element): boolean;
|
|
9
|
+
export declare function getScrollParent(node: Element): Element;
|
|
10
|
+
/**
|
|
11
|
+
* Prevents scrolling on the document body on mount, and
|
|
12
|
+
* restores it on unmount. Also ensures that content does not
|
|
13
|
+
* shift due to the scrollbars disappearing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function usePreventScroll(options?: PreventScrollOptions): void;
|
|
16
|
+
export declare function isInput(target: Element): boolean;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=use-prevent-scroll.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-prevent-scroll.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-prevent-scroll.ts"],"names":[],"mappings":"AAEA,OAAO,EAAa,eAAe,EAAE,MAAM,OAAO,CAAC;AAKnD,eAAO,MAAM,yBAAyB,wBAA8D,CAAC;AAErG,UAAU,oBAAoB;IAC5B,2CAA2C;IAC3C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;CAC5B;AAeD,wBAAgB,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAGnD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAUtD;AAmBD;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,oBAAyB,QAsBlE;AA4MD,wBAAgB,OAAO,CAAC,MAAM,EAAE,OAAO,WAMtC"}
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// This code comes from https://github.com/adobe/react-spectrum/blob/main/packages/%40react-aria/overlays/src/usePreventScroll.ts
|
|
2
|
+
import { useEffect, useLayoutEffect } from 'react';
|
|
3
|
+
import { isIOS } from './browser';
|
|
4
|
+
const KEYBOARD_BUFFER = 24;
|
|
5
|
+
export const useIsomorphicLayoutEffect = typeof window !== 'undefined' ? useLayoutEffect : useEffect;
|
|
6
|
+
function chain(...callbacks) {
|
|
7
|
+
return (...args) => {
|
|
8
|
+
for (let callback of callbacks) {
|
|
9
|
+
if (typeof callback === 'function') {
|
|
10
|
+
callback(...args);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
// @ts-ignore
|
|
16
|
+
const visualViewport = typeof document !== 'undefined' && window.visualViewport;
|
|
17
|
+
export function isScrollable(node) {
|
|
18
|
+
let style = window.getComputedStyle(node);
|
|
19
|
+
return /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY);
|
|
20
|
+
}
|
|
21
|
+
export function getScrollParent(node) {
|
|
22
|
+
if (isScrollable(node)) {
|
|
23
|
+
node = node.parentElement;
|
|
24
|
+
}
|
|
25
|
+
while (node && !isScrollable(node)) {
|
|
26
|
+
node = node.parentElement;
|
|
27
|
+
}
|
|
28
|
+
return node || document.scrollingElement || document.documentElement;
|
|
29
|
+
}
|
|
30
|
+
// HTML input types that do not cause the software keyboard to appear.
|
|
31
|
+
const nonTextInputTypes = new Set([
|
|
32
|
+
'checkbox',
|
|
33
|
+
'radio',
|
|
34
|
+
'range',
|
|
35
|
+
'color',
|
|
36
|
+
'file',
|
|
37
|
+
'image',
|
|
38
|
+
'button',
|
|
39
|
+
'submit',
|
|
40
|
+
'reset',
|
|
41
|
+
]);
|
|
42
|
+
// The number of active usePreventScroll calls. Used to determine whether to revert back to the original page style/scroll position
|
|
43
|
+
let preventScrollCount = 0;
|
|
44
|
+
let restore;
|
|
45
|
+
/**
|
|
46
|
+
* Prevents scrolling on the document body on mount, and
|
|
47
|
+
* restores it on unmount. Also ensures that content does not
|
|
48
|
+
* shift due to the scrollbars disappearing.
|
|
49
|
+
*/
|
|
50
|
+
export function usePreventScroll(options = {}) {
|
|
51
|
+
let { isDisabled } = options;
|
|
52
|
+
useIsomorphicLayoutEffect(() => {
|
|
53
|
+
if (isDisabled) {
|
|
54
|
+
return;
|
|
55
|
+
}
|
|
56
|
+
preventScrollCount++;
|
|
57
|
+
if (preventScrollCount === 1) {
|
|
58
|
+
if (isIOS()) {
|
|
59
|
+
restore = preventScrollMobileSafari();
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return () => {
|
|
63
|
+
preventScrollCount--;
|
|
64
|
+
if (preventScrollCount === 0) {
|
|
65
|
+
restore?.();
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
}, [isDisabled]);
|
|
69
|
+
}
|
|
70
|
+
// Mobile Safari is a whole different beast. Even with overflow: hidden,
|
|
71
|
+
// it still scrolls the page in many situations:
|
|
72
|
+
//
|
|
73
|
+
// 1. When the bottom toolbar and address bar are collapsed, page scrolling is always allowed.
|
|
74
|
+
// 2. When the keyboard is visible, the viewport does not resize. Instead, the keyboard covers part of
|
|
75
|
+
// it, so it becomes scrollable.
|
|
76
|
+
// 3. When tapping on an input, the page always scrolls so that the input is centered in the visual viewport.
|
|
77
|
+
// This may cause even fixed position elements to scroll off the screen.
|
|
78
|
+
// 4. When using the next/previous buttons in the keyboard to navigate between inputs, the whole page always
|
|
79
|
+
// scrolls, even if the input is inside a nested scrollable element that could be scrolled instead.
|
|
80
|
+
//
|
|
81
|
+
// In order to work around these cases, and prevent scrolling without jankiness, we do a few things:
|
|
82
|
+
//
|
|
83
|
+
// 1. Prevent default on `touchmove` events that are not in a scrollable element. This prevents touch scrolling
|
|
84
|
+
// on the window.
|
|
85
|
+
// 2. Prevent default on `touchmove` events inside a scrollable element when the scroll position is at the
|
|
86
|
+
// top or bottom. This avoids the whole page scrolling instead, but does prevent overscrolling.
|
|
87
|
+
// 3. Prevent default on `touchend` events on input elements and handle focusing the element ourselves.
|
|
88
|
+
// 4. When focusing an input, apply a transform to trick Safari into thinking the input is at the top
|
|
89
|
+
// of the page, which prevents it from scrolling the page. After the input is focused, scroll the element
|
|
90
|
+
// into view ourselves, without scrolling the whole page.
|
|
91
|
+
// 5. Offset the body by the scroll position using a negative margin and scroll to the top. This should appear the
|
|
92
|
+
// same visually, but makes the actual scroll position always zero. This is required to make all of the
|
|
93
|
+
// above work or Safari will still try to scroll the page when focusing an input.
|
|
94
|
+
// 6. As a last resort, handle window scroll events, and scroll back to the top. This can happen when attempting
|
|
95
|
+
// to navigate to an input with the next/previous buttons that's outside a modal.
|
|
96
|
+
function preventScrollMobileSafari() {
|
|
97
|
+
let scrollable;
|
|
98
|
+
let lastY = 0;
|
|
99
|
+
let onTouchStart = (e) => {
|
|
100
|
+
// Store the nearest scrollable parent element from the element that the user touched.
|
|
101
|
+
scrollable = getScrollParent(e.target);
|
|
102
|
+
if (scrollable === document.documentElement && scrollable === document.body) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
lastY = e.changedTouches[0].pageY;
|
|
106
|
+
};
|
|
107
|
+
let onTouchMove = (e) => {
|
|
108
|
+
// Prevent scrolling the window.
|
|
109
|
+
if (!scrollable || scrollable === document.documentElement || scrollable === document.body) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
// Prevent scrolling up when at the top and scrolling down when at the bottom
|
|
114
|
+
// of a nested scrollable area, otherwise mobile Safari will start scrolling
|
|
115
|
+
// the window instead. Unfortunately, this disables bounce scrolling when at
|
|
116
|
+
// the top but it's the best we can do.
|
|
117
|
+
let y = e.changedTouches[0].pageY;
|
|
118
|
+
let scrollTop = scrollable.scrollTop;
|
|
119
|
+
let bottom = scrollable.scrollHeight - scrollable.clientHeight;
|
|
120
|
+
if (bottom === 0) {
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
if ((scrollTop <= 0 && y > lastY) || (scrollTop >= bottom && y < lastY)) {
|
|
124
|
+
e.preventDefault();
|
|
125
|
+
}
|
|
126
|
+
lastY = y;
|
|
127
|
+
};
|
|
128
|
+
let onTouchEnd = (e) => {
|
|
129
|
+
let target = e.target;
|
|
130
|
+
// Apply this change if we're not already focused on the target element
|
|
131
|
+
if (isInput(target) && target !== document.activeElement) {
|
|
132
|
+
e.preventDefault();
|
|
133
|
+
// Apply a transform to trick Safari into thinking the input is at the top of the page
|
|
134
|
+
// so it doesn't try to scroll it into view. When tapping on an input, this needs to
|
|
135
|
+
// be done before the "focus" event, so we have to focus the element ourselves.
|
|
136
|
+
target.style.transform = 'translateY(-2000px)';
|
|
137
|
+
target.focus();
|
|
138
|
+
requestAnimationFrame(() => {
|
|
139
|
+
target.style.transform = '';
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
let onFocus = (e) => {
|
|
144
|
+
let target = e.target;
|
|
145
|
+
if (isInput(target)) {
|
|
146
|
+
// Transform also needs to be applied in the focus event in cases where focus moves
|
|
147
|
+
// other than tapping on an input directly, e.g. the next/previous buttons in the
|
|
148
|
+
// software keyboard. In these cases, it seems applying the transform in the focus event
|
|
149
|
+
// is good enough, whereas when tapping an input, it must be done before the focus event. 🤷♂️
|
|
150
|
+
target.style.transform = 'translateY(-2000px)';
|
|
151
|
+
requestAnimationFrame(() => {
|
|
152
|
+
target.style.transform = '';
|
|
153
|
+
// This will have prevented the browser from scrolling the focused element into view,
|
|
154
|
+
// so we need to do this ourselves in a way that doesn't cause the whole page to scroll.
|
|
155
|
+
if (visualViewport) {
|
|
156
|
+
if (visualViewport.height < window.innerHeight) {
|
|
157
|
+
// If the keyboard is already visible, do this after one additional frame
|
|
158
|
+
// to wait for the transform to be removed.
|
|
159
|
+
requestAnimationFrame(() => {
|
|
160
|
+
scrollIntoView(target);
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
else {
|
|
164
|
+
// Otherwise, wait for the visual viewport to resize before scrolling so we can
|
|
165
|
+
// measure the correct position to scroll to.
|
|
166
|
+
visualViewport.addEventListener('resize', () => scrollIntoView(target), { once: true });
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
let onWindowScroll = () => {
|
|
173
|
+
// Last resort. If the window scrolled, scroll it back to the top.
|
|
174
|
+
// It should always be at the top because the body will have a negative margin (see below).
|
|
175
|
+
window.scrollTo(0, 0);
|
|
176
|
+
};
|
|
177
|
+
// Record the original scroll position so we can restore it.
|
|
178
|
+
// Then apply a negative margin to the body to offset it by the scroll position. This will
|
|
179
|
+
// enable us to scroll the window to the top, which is required for the rest of this to work.
|
|
180
|
+
let scrollX = window.pageXOffset;
|
|
181
|
+
let scrollY = window.pageYOffset;
|
|
182
|
+
let restoreStyles = chain(setStyle(document.documentElement, 'paddingRight', `${window.innerWidth - document.documentElement.clientWidth}px`));
|
|
183
|
+
// Scroll to the top. The negative margin on the body will make this appear the same.
|
|
184
|
+
window.scrollTo(0, 0);
|
|
185
|
+
let removeEvents = chain(addEvent(document, 'touchstart', onTouchStart, { passive: false, capture: true }), addEvent(document, 'touchmove', onTouchMove, { passive: false, capture: true }), addEvent(document, 'touchend', onTouchEnd, { passive: false, capture: true }), addEvent(document, 'focus', onFocus, true), addEvent(window, 'scroll', onWindowScroll));
|
|
186
|
+
return () => {
|
|
187
|
+
// Restore styles and scroll the page back to where it was.
|
|
188
|
+
restoreStyles();
|
|
189
|
+
removeEvents();
|
|
190
|
+
window.scrollTo(scrollX, scrollY);
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
// Sets a CSS property on an element, and returns a function to revert it to the previous value.
|
|
194
|
+
function setStyle(element, style, value) {
|
|
195
|
+
// https://github.com/microsoft/TypeScript/issues/17827#issuecomment-391663310
|
|
196
|
+
// @ts-ignore
|
|
197
|
+
let cur = element.style[style];
|
|
198
|
+
// @ts-ignore
|
|
199
|
+
element.style[style] = value;
|
|
200
|
+
return () => {
|
|
201
|
+
// @ts-ignore
|
|
202
|
+
element.style[style] = cur;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
// Adds an event listener to an element, and returns a function to remove it.
|
|
206
|
+
function addEvent(target, event, handler, options) {
|
|
207
|
+
// @ts-ignore
|
|
208
|
+
target.addEventListener(event, handler, options);
|
|
209
|
+
return () => {
|
|
210
|
+
// @ts-ignore
|
|
211
|
+
target.removeEventListener(event, handler, options);
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function scrollIntoView(target) {
|
|
215
|
+
let root = document.scrollingElement || document.documentElement;
|
|
216
|
+
while (target && target !== root) {
|
|
217
|
+
// Find the parent scrollable element and adjust the scroll position if the target is not already in view.
|
|
218
|
+
let scrollable = getScrollParent(target);
|
|
219
|
+
if (scrollable !== document.documentElement && scrollable !== document.body && scrollable !== target) {
|
|
220
|
+
let scrollableTop = scrollable.getBoundingClientRect().top;
|
|
221
|
+
let targetTop = target.getBoundingClientRect().top;
|
|
222
|
+
let targetBottom = target.getBoundingClientRect().bottom;
|
|
223
|
+
// Buffer is needed for some edge cases
|
|
224
|
+
const keyboardHeight = scrollable.getBoundingClientRect().bottom + KEYBOARD_BUFFER;
|
|
225
|
+
if (targetBottom > keyboardHeight) {
|
|
226
|
+
scrollable.scrollTop += targetTop - scrollableTop;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
// @ts-ignore
|
|
230
|
+
target = scrollable.parentElement;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
export function isInput(target) {
|
|
234
|
+
return ((target instanceof HTMLInputElement && !nonTextInputTypes.has(target.type)) ||
|
|
235
|
+
target instanceof HTMLTextAreaElement ||
|
|
236
|
+
(target instanceof HTMLElement && target.isContentEditable));
|
|
237
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-scale-background.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-scale-background.ts"],"names":[],"mappings":"AAOA,wBAAgB,kBAAkB,SAmDjC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { useDrawerContext } from './context';
|
|
3
|
+
import { assignStyle, chain, isVertical } from './helpers';
|
|
4
|
+
import { BORDER_RADIUS, TRANSITIONS, WINDOW_TOP_OFFSET } from './constants';
|
|
5
|
+
const noop = () => () => { };
|
|
6
|
+
export function useScaleBackground() {
|
|
7
|
+
const { direction, isOpen, shouldScaleBackground, setBackgroundColorOnScale, noBodyStyles } = useDrawerContext();
|
|
8
|
+
const timeoutIdRef = React.useRef(null);
|
|
9
|
+
const initialBackgroundColor = useMemo(() => document.body.style.backgroundColor, []);
|
|
10
|
+
function getScale() {
|
|
11
|
+
return (window.innerWidth - WINDOW_TOP_OFFSET) / window.innerWidth;
|
|
12
|
+
}
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (isOpen && shouldScaleBackground) {
|
|
15
|
+
if (timeoutIdRef.current)
|
|
16
|
+
clearTimeout(timeoutIdRef.current);
|
|
17
|
+
const wrapper = document.querySelector('[data-drawer-sheet-wrapper]');
|
|
18
|
+
if (!wrapper)
|
|
19
|
+
return;
|
|
20
|
+
chain(setBackgroundColorOnScale && !noBodyStyles ? assignStyle(document.body, { background: 'black' }) : noop, assignStyle(wrapper, {
|
|
21
|
+
transformOrigin: isVertical(direction) ? 'top' : 'left',
|
|
22
|
+
transitionProperty: 'transform, border-radius',
|
|
23
|
+
transitionDuration: `${TRANSITIONS.DURATION}s`,
|
|
24
|
+
transitionTimingFunction: `cubic-bezier(${TRANSITIONS.EASE.join(',')})`,
|
|
25
|
+
}));
|
|
26
|
+
const wrapperStylesCleanup = assignStyle(wrapper, {
|
|
27
|
+
borderRadius: `${BORDER_RADIUS}px`,
|
|
28
|
+
overflow: 'hidden',
|
|
29
|
+
...(isVertical(direction)
|
|
30
|
+
? {
|
|
31
|
+
transform: `scale(${getScale()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,
|
|
32
|
+
}
|
|
33
|
+
: {
|
|
34
|
+
transform: `scale(${getScale()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,
|
|
35
|
+
}),
|
|
36
|
+
});
|
|
37
|
+
return () => {
|
|
38
|
+
wrapperStylesCleanup();
|
|
39
|
+
timeoutIdRef.current = window.setTimeout(() => {
|
|
40
|
+
if (initialBackgroundColor) {
|
|
41
|
+
document.body.style.background = initialBackgroundColor;
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
document.body.style.removeProperty('background');
|
|
45
|
+
}
|
|
46
|
+
}, TRANSITIONS.DURATION * 1000);
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}, [isOpen, shouldScaleBackground, initialBackgroundColor]);
|
|
50
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DrawerDirection } from './types';
|
|
3
|
+
export declare function useSnapPoints({ activeSnapPointProp, setActiveSnapPointProp, snapPoints, drawerRef, overlayRef, fadeFromIndex, onSnapPointChange, direction, container, snapToSequentialPoint, }: {
|
|
4
|
+
activeSnapPointProp?: number | string | null;
|
|
5
|
+
setActiveSnapPointProp?(snapPoint: number | null | string): void;
|
|
6
|
+
snapPoints?: (number | string)[];
|
|
7
|
+
fadeFromIndex?: number;
|
|
8
|
+
drawerRef: React.RefObject<HTMLDivElement | null>;
|
|
9
|
+
overlayRef: React.RefObject<HTMLDivElement | null>;
|
|
10
|
+
onSnapPointChange(activeSnapPointIndex: number): void;
|
|
11
|
+
direction?: DrawerDirection;
|
|
12
|
+
container?: HTMLElement | null | undefined;
|
|
13
|
+
snapToSequentialPoint?: boolean;
|
|
14
|
+
}): {
|
|
15
|
+
isLastSnapPoint: true | null;
|
|
16
|
+
activeSnapPoint: string | number | null | undefined;
|
|
17
|
+
shouldFade: boolean;
|
|
18
|
+
getPercentageDragged: (absDraggedDistance: number, isDraggingDown: boolean) => number | null;
|
|
19
|
+
setActiveSnapPoint: React.Dispatch<React.SetStateAction<string | number | null | undefined>>;
|
|
20
|
+
activeSnapPointIndex: number | null;
|
|
21
|
+
onRelease: ({ draggedDistance, closeDrawer, velocity, dismissible, }: {
|
|
22
|
+
draggedDistance: number;
|
|
23
|
+
closeDrawer: () => void;
|
|
24
|
+
velocity: number;
|
|
25
|
+
dismissible: boolean;
|
|
26
|
+
}) => void;
|
|
27
|
+
onDrag: ({ draggedDistance }: {
|
|
28
|
+
draggedDistance: number;
|
|
29
|
+
}) => void;
|
|
30
|
+
snapPointsOffset: number[];
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=use-snap-points.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-snap-points.d.ts","sourceRoot":"","sources":["../../../src/react-components/DrawerSheet/use-snap-points.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE1C,wBAAgB,aAAa,CAAC,EAC5B,mBAAmB,EACnB,sBAAsB,EACtB,UAAU,EACV,SAAS,EACT,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,SAAoB,EACpB,SAAS,EACT,qBAAqB,GACtB,EAAE;IACD,mBAAmB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7C,sBAAsB,CAAC,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;IACjE,UAAU,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;IACjC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAClD,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IACnD,iBAAiB,CAAC,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtD,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,CAAC;IAC3C,qBAAqB,CAAC,EAAE,OAAO,CAAC;CACjC;;;;+CA0NmD,MAAM,kBAAkB,OAAO;;;0EAnF9E;QACD,eAAe,EAAE,MAAM,CAAC;QACxB,WAAW,EAAE,MAAM,IAAI,CAAC;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,OAAO,CAAC;KACtB;kCA0DoC;QAAE,eAAe,EAAE,MAAM,CAAA;KAAE;;EAgEjE"}
|