@tamagui/sheet 1.22.5 → 1.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/Sheet.js +3 -44
- package/dist/cjs/Sheet.js.map +1 -1
- package/dist/cjs/nativeSheet.js +15 -1
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/useSheetChildren.js +10 -6
- package/dist/cjs/useSheetChildren.js.map +1 -1
- package/dist/cjs/useSheetSnapPoints.js +77 -0
- package/dist/cjs/useSheetSnapPoints.js.map +6 -0
- package/dist/esm/Sheet.js +3 -44
- package/dist/esm/Sheet.js.map +1 -1
- package/dist/esm/Sheet.mjs +3 -44
- package/dist/esm/Sheet.mjs.map +1 -1
- package/dist/esm/nativeSheet.js +16 -2
- package/dist/esm/nativeSheet.js.map +1 -1
- package/dist/esm/nativeSheet.mjs +16 -2
- package/dist/esm/nativeSheet.mjs.map +1 -1
- package/dist/esm/useSheetChildren.js +10 -6
- package/dist/esm/useSheetChildren.js.map +1 -1
- package/dist/esm/useSheetChildren.mjs +10 -6
- package/dist/esm/useSheetChildren.mjs.map +1 -1
- package/dist/esm/useSheetSnapPoints.js +53 -0
- package/dist/esm/useSheetSnapPoints.js.map +6 -0
- package/dist/esm/useSheetSnapPoints.mjs +53 -0
- package/dist/esm/useSheetSnapPoints.mjs.map +6 -0
- package/dist/jsx/Sheet.js +3 -44
- package/dist/jsx/Sheet.js.map +1 -1
- package/dist/jsx/Sheet.mjs +3 -44
- package/dist/jsx/Sheet.mjs.map +1 -1
- package/dist/jsx/nativeSheet.js +17 -1
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.mjs +17 -1
- package/dist/jsx/nativeSheet.mjs.map +1 -1
- package/dist/jsx/useSheetChildren.js +10 -6
- package/dist/jsx/useSheetChildren.js.map +1 -1
- package/dist/jsx/useSheetChildren.mjs +10 -6
- package/dist/jsx/useSheetChildren.mjs.map +1 -1
- package/dist/jsx/useSheetSnapPoints.js +53 -0
- package/dist/jsx/useSheetSnapPoints.js.map +6 -0
- package/dist/jsx/useSheetSnapPoints.mjs +53 -0
- package/dist/jsx/useSheetSnapPoints.mjs.map +6 -0
- package/package.json +13 -13
- package/src/Sheet.tsx +5 -53
- package/src/nativeSheet.tsx +30 -3
- package/src/useSheetChildren.tsx +14 -10
- package/src/useSheetProviderProps.tsx +2 -0
- package/src/useSheetSnapPoints.tsx +60 -0
- package/types/Sheet.d.ts +16 -16
- package/types/Sheet.d.ts.map +1 -1
- package/types/nativeSheet.d.ts.map +1 -1
- package/types/useSheetChildren.d.ts +1 -9
- package/types/useSheetChildren.d.ts.map +1 -1
- package/types/useSheetProviderProps.d.ts +1 -0
- package/types/useSheetProviderProps.d.ts.map +1 -1
- package/types/useSheetSnapPoints.d.ts +7 -0
- package/types/useSheetSnapPoints.d.ts.map +1 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useSheetChildren.tsx"],
|
|
4
|
-
"mappings": "AAAA,OAAO,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,cAAmB;AAClD,MAAI,kBAA6C;AACjD,MAAI,mBAA8C;AAClD,MAAI,iBAA4C;AAGhD,QAAM,SAAS,QAAQ,cAAc,CAAC,UAAU;AAC9C,QAAI,eAAe,KAAK,GAAG;AACzB,YAAM,OAAO,MAAM,OAAO,cAAc,GAAG;AAC3C,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,4BAAkB;AAClB;AAAA,QACF,KAAK;AACH,2BAAiB;AACjB;AAAA,QACF,KAAK;AACH,6BAAmB;AACnB;AAAA,QACF;AACE,kBAAQ,KAAK,0CAA0C,KAAK;AAAA,MAChE;AAAA,IACF;AAAA,EACF,CAAC;AAED,
|
|
4
|
+
"mappings": "AAAA,OAAO,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,cAAmB;AAClD,MAAI,kBAA6C;AACjD,MAAI,mBAA8C;AAClD,MAAI,iBAA4C;AAGhD,QAAM,SAAS,QAAQ,cAAc,CAAC,UAAU;AAC9C,QAAI,eAAe,KAAK,GAAG;AACzB,YAAM,OAAO,MAAM,OAAO,cAAc,GAAG;AAC3C,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,4BAAkB;AAClB;AAAA,QACF,KAAK;AACH,2BAAiB;AACjB;AAAA,QACF,KAAK;AACH,6BAAmB;AACnB;AAAA,QACF;AACE,kBAAQ,KAAK,0CAA0C,KAAK;AAAA,MAChE;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,uBAA4B;AAEhC,MAAI,gBAAgB;AAClB,2BAAuB,MAAM,aAAa,gBAAgB;AAAA,MACxD,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -21,18 +21,22 @@ function useSheetChildren(childrenProp) {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
frameComponent,
|
|
28
|
-
bottomCoverComponent: frameComponent ? React.cloneElement(frameComponent, {
|
|
24
|
+
let bottomCoverComponent = null;
|
|
25
|
+
if (frameComponent) {
|
|
26
|
+
bottomCoverComponent = React.cloneElement(frameComponent, {
|
|
29
27
|
children: null,
|
|
30
28
|
position: "absolute",
|
|
31
29
|
bottom: -100,
|
|
32
30
|
height: 110,
|
|
33
31
|
left: 0,
|
|
34
32
|
right: 0
|
|
35
|
-
})
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
handleComponent,
|
|
37
|
+
overlayComponent,
|
|
38
|
+
frameComponent,
|
|
39
|
+
bottomCoverComponent
|
|
36
40
|
};
|
|
37
41
|
}
|
|
38
42
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/useSheetChildren.tsx"],
|
|
4
|
-
"mappings": "AAAA,OAAO,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,cAAmB;AAClD,MAAI,kBAA6C;AACjD,MAAI,mBAA8C;AAClD,MAAI,iBAA4C;AAGhD,QAAM,SAAS,QAAQ,cAAc,CAAC,UAAU;AAC9C,QAAI,eAAe,KAAK,GAAG;AACzB,YAAM,OAAO,MAAM,OAAO,cAAc,GAAG;AAC3C,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,4BAAkB;AAClB;AAAA,QACF,KAAK;AACH,2BAAiB;AACjB;AAAA,QACF,KAAK;AACH,6BAAmB;AACnB;AAAA,QACF;AACE,kBAAQ,KAAK,0CAA0C,KAAK;AAAA,MAChE;AAAA,IACF;AAAA,EACF,CAAC;AAED,
|
|
4
|
+
"mappings": "AAAA,OAAO,SAAS,sBAAsB;AAE/B,SAAS,iBAAiB,cAAmB;AAClD,MAAI,kBAA6C;AACjD,MAAI,mBAA8C;AAClD,MAAI,iBAA4C;AAGhD,QAAM,SAAS,QAAQ,cAAc,CAAC,UAAU;AAC9C,QAAI,eAAe,KAAK,GAAG;AACzB,YAAM,OAAO,MAAM,OAAO,cAAc,GAAG;AAC3C,cAAQ,MAAM;AAAA,QACZ,KAAK;AACH,4BAAkB;AAClB;AAAA,QACF,KAAK;AACH,2BAAiB;AACjB;AAAA,QACF,KAAK;AACH,6BAAmB;AACnB;AAAA,QACF;AACE,kBAAQ,KAAK,0CAA0C,KAAK;AAAA,MAChE;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,uBAA4B;AAEhC,MAAI,gBAAgB;AAClB,2BAAuB,MAAM,aAAa,gBAAgB;AAAA,MACxD,UAAU;AAAA,MACV,UAAU;AAAA,MACV,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
|
2
|
+
const useSheetSnapPoints = ({
|
|
3
|
+
position,
|
|
4
|
+
setPosition,
|
|
5
|
+
dismissOnSnapToBottom,
|
|
6
|
+
snapPoints,
|
|
7
|
+
setPositionImmediate,
|
|
8
|
+
open,
|
|
9
|
+
frameSize
|
|
10
|
+
}) => {
|
|
11
|
+
if (process.env.NODE_ENV === "development") {
|
|
12
|
+
if (snapPoints.some((p) => p < 0 || p > 100)) {
|
|
13
|
+
console.warn(
|
|
14
|
+
"\u26A0\uFE0F Invalid snapPoint given, snapPoints must be between 0 and 100, equal to percent height of frame"
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (open && dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
19
|
+
setPositionImmediate(0);
|
|
20
|
+
}
|
|
21
|
+
const shouldSetPositionOpen = open && position < 0;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (shouldSetPositionOpen) {
|
|
24
|
+
setPosition(0);
|
|
25
|
+
}
|
|
26
|
+
}, [setPosition, shouldSetPositionOpen]);
|
|
27
|
+
const maxSnapPoint = snapPoints.reduce((prev, cur) => Math.max(prev, cur));
|
|
28
|
+
const screenSize = frameSize / (maxSnapPoint / 100);
|
|
29
|
+
const positions = useMemo(
|
|
30
|
+
() => snapPoints.map((point) => getPercentSize(point, screenSize)),
|
|
31
|
+
[frameSize, snapPoints]
|
|
32
|
+
);
|
|
33
|
+
return {
|
|
34
|
+
positions,
|
|
35
|
+
maxSnapPoint,
|
|
36
|
+
screenSize
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
function getPercentSize(point, screenSize) {
|
|
40
|
+
if (!screenSize)
|
|
41
|
+
return 0;
|
|
42
|
+
if (point === void 0) {
|
|
43
|
+
console.warn("No snapPoint");
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
const pct = point / 100;
|
|
47
|
+
const next = Math.round(screenSize - pct * screenSize);
|
|
48
|
+
return next;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
useSheetSnapPoints
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=useSheetSnapPoints.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/useSheetSnapPoints.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,WAAW,eAAe;AAI5B,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,WAAW,KAAK,CAAC,MAAM,IAAI,KAAK,IAAI,GAAG,GAAG;AAC5C,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,MAAI,QAAQ,yBAAyB,aAAa,WAAW,SAAS,GAAG;AACvE,yBAAqB,CAAC;AAAA,EACxB;AAGA,QAAM,wBAAwB,QAAQ,WAAW;AACjD,YAAU,MAAM;AACd,QAAI,uBAAuB;AACzB,kBAAY,CAAC;AAAA,IACf;AAAA,EACF,GAAG,CAAC,aAAa,qBAAqB,CAAC;AAEvC,QAAM,eAAe,WAAW,OAAO,CAAC,MAAM,QAAQ,KAAK,IAAI,MAAM,GAAG,CAAC;AACzE,QAAM,aAAa,aAAa,eAAe;AAE/C,QAAM,YAAY;AAAA,IAChB,MAAM,WAAW,IAAI,CAAC,UAAU,eAAe,OAAO,UAAU,CAAC;AAAA,IACjE,CAAC,WAAW,UAAU;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,eAAe,OAAgB,YAAqB;AAC3D,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,UAAU,QAAW;AACvB,YAAQ,KAAK,cAAc;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,QAAQ;AACpB,QAAM,OAAO,KAAK,MAAM,aAAa,MAAM,UAAU;AAErD,SAAO;AACT;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { useEffect, useMemo } from "react";
|
|
2
|
+
const useSheetSnapPoints = ({
|
|
3
|
+
position,
|
|
4
|
+
setPosition,
|
|
5
|
+
dismissOnSnapToBottom,
|
|
6
|
+
snapPoints,
|
|
7
|
+
setPositionImmediate,
|
|
8
|
+
open,
|
|
9
|
+
frameSize
|
|
10
|
+
}) => {
|
|
11
|
+
if (process.env.NODE_ENV === "development") {
|
|
12
|
+
if (snapPoints.some((p) => p < 0 || p > 100)) {
|
|
13
|
+
console.warn(
|
|
14
|
+
"\u26A0\uFE0F Invalid snapPoint given, snapPoints must be between 0 and 100, equal to percent height of frame"
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (open && dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
19
|
+
setPositionImmediate(0);
|
|
20
|
+
}
|
|
21
|
+
const shouldSetPositionOpen = open && position < 0;
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
if (shouldSetPositionOpen) {
|
|
24
|
+
setPosition(0);
|
|
25
|
+
}
|
|
26
|
+
}, [setPosition, shouldSetPositionOpen]);
|
|
27
|
+
const maxSnapPoint = snapPoints.reduce((prev, cur) => Math.max(prev, cur));
|
|
28
|
+
const screenSize = frameSize / (maxSnapPoint / 100);
|
|
29
|
+
const positions = useMemo(
|
|
30
|
+
() => snapPoints.map((point) => getPercentSize(point, screenSize)),
|
|
31
|
+
[frameSize, snapPoints]
|
|
32
|
+
);
|
|
33
|
+
return {
|
|
34
|
+
positions,
|
|
35
|
+
maxSnapPoint,
|
|
36
|
+
screenSize
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
function getPercentSize(point, screenSize) {
|
|
40
|
+
if (!screenSize)
|
|
41
|
+
return 0;
|
|
42
|
+
if (point === void 0) {
|
|
43
|
+
console.warn("No snapPoint");
|
|
44
|
+
return 0;
|
|
45
|
+
}
|
|
46
|
+
const pct = point / 100;
|
|
47
|
+
const next = Math.round(screenSize - pct * screenSize);
|
|
48
|
+
return next;
|
|
49
|
+
}
|
|
50
|
+
export {
|
|
51
|
+
useSheetSnapPoints
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=useSheetSnapPoints.mjs.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/useSheetSnapPoints.tsx"],
|
|
4
|
+
"mappings": "AAAA,SAAS,WAAW,eAAe;AAI5B,MAAM,qBAAqB,CAAC;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,MAAI,QAAQ,IAAI,aAAa,eAAe;AAC1C,QAAI,WAAW,KAAK,CAAC,MAAM,IAAI,KAAK,IAAI,GAAG,GAAG;AAC5C,cAAQ;AAAA,QACN;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAGA,MAAI,QAAQ,yBAAyB,aAAa,WAAW,SAAS,GAAG;AACvE,yBAAqB,CAAC;AAAA,EACxB;AAGA,QAAM,wBAAwB,QAAQ,WAAW;AACjD,YAAU,MAAM;AACd,QAAI,uBAAuB;AACzB,kBAAY,CAAC;AAAA,IACf;AAAA,EACF,GAAG,CAAC,aAAa,qBAAqB,CAAC;AAEvC,QAAM,eAAe,WAAW,OAAO,CAAC,MAAM,QAAQ,KAAK,IAAI,MAAM,GAAG,CAAC;AACzE,QAAM,aAAa,aAAa,eAAe;AAE/C,QAAM,YAAY;AAAA,IAChB,MAAM,WAAW,IAAI,CAAC,UAAU,eAAe,OAAO,UAAU,CAAC;AAAA,IACjE,CAAC,WAAW,UAAU;AAAA,EACxB;AAEA,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AAEA,SAAS,eAAe,OAAgB,YAAqB;AAC3D,MAAI,CAAC;AAAY,WAAO;AACxB,MAAI,UAAU,QAAW;AACvB,YAAQ,KAAK,cAAc;AAC3B,WAAO;AAAA,EACT;AACA,QAAM,MAAM,QAAQ;AACpB,QAAM,OAAO,KAAK,MAAM,aAAa,MAAM,UAAU;AAErD,SAAO;AACT;",
|
|
5
|
+
"names": []
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tamagui/sheet",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.7",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"*.css"
|
|
6
6
|
],
|
|
@@ -30,24 +30,24 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@tamagui/animations-react-native": "1.22.
|
|
34
|
-
"@tamagui/compose-refs": "1.22.
|
|
35
|
-
"@tamagui/core": "1.22.
|
|
36
|
-
"@tamagui/create-context": "1.22.
|
|
37
|
-
"@tamagui/portal": "1.22.
|
|
38
|
-
"@tamagui/remove-scroll": "1.22.
|
|
39
|
-
"@tamagui/scroll-view": "1.22.
|
|
40
|
-
"@tamagui/stacks": "1.22.
|
|
41
|
-
"@tamagui/use-constant": "1.22.
|
|
42
|
-
"@tamagui/use-controllable-state": "1.22.
|
|
43
|
-
"@tamagui/use-keyboard-visible": "1.22.
|
|
33
|
+
"@tamagui/animations-react-native": "1.22.7",
|
|
34
|
+
"@tamagui/compose-refs": "1.22.7",
|
|
35
|
+
"@tamagui/core": "1.22.7",
|
|
36
|
+
"@tamagui/create-context": "1.22.7",
|
|
37
|
+
"@tamagui/portal": "1.22.7",
|
|
38
|
+
"@tamagui/remove-scroll": "1.22.7",
|
|
39
|
+
"@tamagui/scroll-view": "1.22.7",
|
|
40
|
+
"@tamagui/stacks": "1.22.7",
|
|
41
|
+
"@tamagui/use-constant": "1.22.7",
|
|
42
|
+
"@tamagui/use-controllable-state": "1.22.7",
|
|
43
|
+
"@tamagui/use-keyboard-visible": "1.22.7"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
|
46
46
|
"react": "*",
|
|
47
47
|
"react-native": "*"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@tamagui/build": "1.22.
|
|
50
|
+
"@tamagui/build": "1.22.7",
|
|
51
51
|
"react": "^18.2.0",
|
|
52
52
|
"react-native": "^0.71.7"
|
|
53
53
|
},
|
package/src/Sheet.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import { Portal } from '@tamagui/portal'
|
|
|
20
20
|
import { RemoveScroll } from '@tamagui/remove-scroll'
|
|
21
21
|
import { ThemeableStack, XStack, XStackProps, YStack, YStackProps } from '@tamagui/stacks'
|
|
22
22
|
import { useKeyboardVisible } from '@tamagui/use-keyboard-visible'
|
|
23
|
-
import
|
|
23
|
+
import {
|
|
24
24
|
FunctionComponent,
|
|
25
25
|
RefAttributes,
|
|
26
26
|
createContext,
|
|
@@ -51,6 +51,7 @@ import { useSheetChildren } from './useSheetChildren'
|
|
|
51
51
|
import { useSheetController } from './useSheetController'
|
|
52
52
|
import { useSheetOpenState } from './useSheetOpenState'
|
|
53
53
|
import { useSheetProviderProps } from './useSheetProviderProps'
|
|
54
|
+
import { useSheetSnapPoints } from './useSheetSnapPoints'
|
|
54
55
|
|
|
55
56
|
export { createSheetScope } from './SheetContext'
|
|
56
57
|
export * from './types'
|
|
@@ -260,7 +261,6 @@ const SheetImplementationCustom = themeable(
|
|
|
260
261
|
|
|
261
262
|
const {
|
|
262
263
|
animationConfig,
|
|
263
|
-
dismissOnSnapToBottom = false,
|
|
264
264
|
forceRemoveScrollEnabled = null,
|
|
265
265
|
disableDrag: disableDragProp,
|
|
266
266
|
modal = false,
|
|
@@ -271,31 +271,16 @@ const SheetImplementationCustom = themeable(
|
|
|
271
271
|
|
|
272
272
|
const state = useSheetOpenState(props)
|
|
273
273
|
const providerProps = useSheetProviderProps(props, state)
|
|
274
|
+
const { positions, maxSnapPoint, screenSize } = useSheetSnapPoints(providerProps)
|
|
274
275
|
|
|
275
|
-
const {
|
|
276
|
-
|
|
277
|
-
position,
|
|
278
|
-
contentRef,
|
|
279
|
-
setPosition,
|
|
280
|
-
setPositionImmediate,
|
|
281
|
-
scrollBridge,
|
|
282
|
-
frameSize,
|
|
283
|
-
setFrameSize,
|
|
284
|
-
} = providerProps
|
|
276
|
+
const { position, contentRef, setPosition, scrollBridge, frameSize, setFrameSize } =
|
|
277
|
+
providerProps
|
|
285
278
|
|
|
286
279
|
const { open, isHidden, controller } = state
|
|
287
280
|
|
|
288
281
|
const { frameComponent, handleComponent, bottomCoverComponent, overlayComponent } =
|
|
289
282
|
useSheetChildren(props.children)
|
|
290
283
|
|
|
291
|
-
if (process.env.NODE_ENV === 'development') {
|
|
292
|
-
if (snapPoints.some((p) => p < 0 || p > 100)) {
|
|
293
|
-
console.warn(
|
|
294
|
-
'⚠️ Invalid snapPoint given, snapPoints must be between 0 and 100, equal to percent height of frame'
|
|
295
|
-
)
|
|
296
|
-
}
|
|
297
|
-
}
|
|
298
|
-
|
|
299
284
|
const sheetRef = useRef<View>(null)
|
|
300
285
|
const ref = useComposedRefs(forwardedRef, sheetRef)
|
|
301
286
|
|
|
@@ -308,11 +293,6 @@ const SheetImplementationCustom = themeable(
|
|
|
308
293
|
const keyboardIsVisible = useKeyboardVisible()
|
|
309
294
|
const themeName = useThemeName()
|
|
310
295
|
|
|
311
|
-
// reset position to fully open on re-open after dismissOnSnapToBottom
|
|
312
|
-
if (open && dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
313
|
-
setPositionImmediate(0)
|
|
314
|
-
}
|
|
315
|
-
|
|
316
296
|
const { useAnimatedNumber, useAnimatedNumberReaction, useAnimatedNumberStyle } =
|
|
317
297
|
driver
|
|
318
298
|
|
|
@@ -341,22 +321,6 @@ const SheetImplementationCustom = themeable(
|
|
|
341
321
|
}
|
|
342
322
|
}
|
|
343
323
|
|
|
344
|
-
// open must set position
|
|
345
|
-
const shouldSetPositionOpen = open && position < 0
|
|
346
|
-
useEffect(() => {
|
|
347
|
-
if (shouldSetPositionOpen) {
|
|
348
|
-
setPosition(0)
|
|
349
|
-
}
|
|
350
|
-
}, [setPosition, shouldSetPositionOpen])
|
|
351
|
-
|
|
352
|
-
const maxSnapPoint = snapPoints.reduce((prev, cur) => Math.max(prev, cur))
|
|
353
|
-
const screenSize = frameSize / (maxSnapPoint / 100)
|
|
354
|
-
|
|
355
|
-
const positions = useMemo(
|
|
356
|
-
() => snapPoints.map((point) => getPercentSize(point, screenSize)),
|
|
357
|
-
[frameSize, snapPoints]
|
|
358
|
-
)
|
|
359
|
-
|
|
360
324
|
// we need to set this *after* fully closed to 0, to avoid it overlapping
|
|
361
325
|
// the page when resizing quickly on web for example
|
|
362
326
|
const [opacity, setOpacity] = useState(open ? 1 : 0)
|
|
@@ -668,18 +632,6 @@ export const ControlledSheet = Sheet as FunctionComponent<
|
|
|
668
632
|
|
|
669
633
|
/* -------------------------------------------------------------------------------------------------*/
|
|
670
634
|
|
|
671
|
-
function getPercentSize(point?: number, screenSize?: number) {
|
|
672
|
-
if (!screenSize) return 0
|
|
673
|
-
if (point === undefined) {
|
|
674
|
-
console.warn('No snapPoint')
|
|
675
|
-
return 0
|
|
676
|
-
}
|
|
677
|
-
const pct = point / 100
|
|
678
|
-
const next = Math.round(screenSize - pct * screenSize)
|
|
679
|
-
|
|
680
|
-
return next
|
|
681
|
-
}
|
|
682
|
-
|
|
683
635
|
function resisted(y: number, minY: number, maxOverflow = 25) {
|
|
684
636
|
if (y < minY) {
|
|
685
637
|
const past = minY - y
|
package/src/nativeSheet.tsx
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { YStack } from '@tamagui/stacks'
|
|
1
2
|
import { FunctionComponent, useEffect, useRef } from 'react'
|
|
2
3
|
|
|
3
4
|
import { SheetProvider } from './SheetContext'
|
|
@@ -6,6 +7,8 @@ import { useSheetChildren } from './useSheetChildren'
|
|
|
6
7
|
import { useSheetOpenState } from './useSheetOpenState'
|
|
7
8
|
import { useSheetProviderProps } from './useSheetProviderProps'
|
|
8
9
|
|
|
10
|
+
// import { useSheetSnapPoints } from './useSheetSnapPoints'
|
|
11
|
+
|
|
9
12
|
type SheetNativePlatforms = 'ios'
|
|
10
13
|
|
|
11
14
|
const nativeSheets: Record<SheetNativePlatforms, FunctionComponent<SheetProps> | null> = {
|
|
@@ -21,6 +24,8 @@ export function setupNativeSheet(platform: SheetNativePlatforms, Implementation:
|
|
|
21
24
|
nativeSheets[platform] = (props: SheetProps) => {
|
|
22
25
|
const state = useSheetOpenState(props)
|
|
23
26
|
const providerProps = useSheetProviderProps(props, state)
|
|
27
|
+
// const { position } = providerProps
|
|
28
|
+
// const { positions } = useSheetSnapPoints(providerProps)
|
|
24
29
|
const { frameComponent } = useSheetChildren(props.children)
|
|
25
30
|
|
|
26
31
|
const { open, setOpen } = state
|
|
@@ -32,10 +37,32 @@ export function setupNativeSheet(platform: SheetNativePlatforms, Implementation:
|
|
|
32
37
|
ref.current?.setVisibility(open)
|
|
33
38
|
}, [open])
|
|
34
39
|
|
|
40
|
+
// modalContentPreferredContentSize={{
|
|
41
|
+
// mode: 'percent',
|
|
42
|
+
// percentWidth: '100%',
|
|
43
|
+
// percentHeight:
|
|
44
|
+
// }}
|
|
45
|
+
|
|
35
46
|
return (
|
|
36
|
-
|
|
37
|
-
<SheetProvider {...providerProps}>
|
|
38
|
-
|
|
47
|
+
<>
|
|
48
|
+
<SheetProvider {...providerProps}>
|
|
49
|
+
<Implementation ref={ref} onModalDismiss={() => setOpen(false)}>
|
|
50
|
+
{frameComponent}
|
|
51
|
+
</Implementation>
|
|
52
|
+
|
|
53
|
+
{/* for some reason select triggers wont show on native if this isn't inside the actual tree not inside implementation... */}
|
|
54
|
+
{/* so just hiding it here for now... not great... */}
|
|
55
|
+
<YStack
|
|
56
|
+
position="absolute"
|
|
57
|
+
opacity={0}
|
|
58
|
+
pointerEvents="none"
|
|
59
|
+
width={0}
|
|
60
|
+
height={0}
|
|
61
|
+
>
|
|
62
|
+
{frameComponent}
|
|
63
|
+
</YStack>
|
|
64
|
+
</SheetProvider>
|
|
65
|
+
</>
|
|
39
66
|
)
|
|
40
67
|
}
|
|
41
68
|
}
|
package/src/useSheetChildren.tsx
CHANGED
|
@@ -25,19 +25,23 @@ export function useSheetChildren(childrenProp: any) {
|
|
|
25
25
|
}
|
|
26
26
|
})
|
|
27
27
|
|
|
28
|
+
let bottomCoverComponent: any = null
|
|
29
|
+
|
|
30
|
+
if (frameComponent) {
|
|
31
|
+
bottomCoverComponent = React.cloneElement(frameComponent, {
|
|
32
|
+
children: null,
|
|
33
|
+
position: 'absolute',
|
|
34
|
+
bottom: -100,
|
|
35
|
+
height: 110,
|
|
36
|
+
left: 0,
|
|
37
|
+
right: 0,
|
|
38
|
+
})
|
|
39
|
+
}
|
|
40
|
+
|
|
28
41
|
return {
|
|
29
42
|
handleComponent,
|
|
30
43
|
overlayComponent,
|
|
31
44
|
frameComponent,
|
|
32
|
-
bottomCoverComponent
|
|
33
|
-
? React.cloneElement(frameComponent, {
|
|
34
|
-
children: null,
|
|
35
|
-
position: 'absolute',
|
|
36
|
-
bottom: -100,
|
|
37
|
-
height: 110,
|
|
38
|
-
left: 0,
|
|
39
|
-
right: 0,
|
|
40
|
-
})
|
|
41
|
-
: null,
|
|
45
|
+
bottomCoverComponent,
|
|
42
46
|
}
|
|
43
47
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { useEffect, useMemo } from 'react'
|
|
2
|
+
|
|
3
|
+
import { SheetContextValue } from './useSheetProviderProps'
|
|
4
|
+
|
|
5
|
+
export const useSheetSnapPoints = ({
|
|
6
|
+
position,
|
|
7
|
+
setPosition,
|
|
8
|
+
dismissOnSnapToBottom,
|
|
9
|
+
snapPoints,
|
|
10
|
+
setPositionImmediate,
|
|
11
|
+
open,
|
|
12
|
+
frameSize,
|
|
13
|
+
}: SheetContextValue) => {
|
|
14
|
+
if (process.env.NODE_ENV === 'development') {
|
|
15
|
+
if (snapPoints.some((p) => p < 0 || p > 100)) {
|
|
16
|
+
console.warn(
|
|
17
|
+
'⚠️ Invalid snapPoint given, snapPoints must be between 0 and 100, equal to percent height of frame'
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// reset position to fully open on re-open after dismissOnSnapToBottom
|
|
23
|
+
if (open && dismissOnSnapToBottom && position === snapPoints.length - 1) {
|
|
24
|
+
setPositionImmediate(0)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
// open must set position
|
|
28
|
+
const shouldSetPositionOpen = open && position < 0
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (shouldSetPositionOpen) {
|
|
31
|
+
setPosition(0)
|
|
32
|
+
}
|
|
33
|
+
}, [setPosition, shouldSetPositionOpen])
|
|
34
|
+
|
|
35
|
+
const maxSnapPoint = snapPoints.reduce((prev, cur) => Math.max(prev, cur))
|
|
36
|
+
const screenSize = frameSize / (maxSnapPoint / 100)
|
|
37
|
+
|
|
38
|
+
const positions = useMemo(
|
|
39
|
+
() => snapPoints.map((point) => getPercentSize(point, screenSize)),
|
|
40
|
+
[frameSize, snapPoints]
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
positions,
|
|
45
|
+
maxSnapPoint,
|
|
46
|
+
screenSize,
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function getPercentSize(point?: number, screenSize?: number) {
|
|
51
|
+
if (!screenSize) return 0
|
|
52
|
+
if (point === undefined) {
|
|
53
|
+
console.warn('No snapPoint')
|
|
54
|
+
return 0
|
|
55
|
+
}
|
|
56
|
+
const pct = point / 100
|
|
57
|
+
const next = Math.round(screenSize - pct * screenSize)
|
|
58
|
+
|
|
59
|
+
return next
|
|
60
|
+
}
|
package/types/Sheet.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetProps } from '@tamagui/core';
|
|
2
2
|
import { XStackProps } from '@tamagui/stacks';
|
|
3
|
-
import
|
|
3
|
+
import { FunctionComponent, RefAttributes } from 'react';
|
|
4
4
|
import { View } from 'react-native';
|
|
5
5
|
import { SheetProps, SheetScopedProps } from './types';
|
|
6
6
|
export { createSheetScope } from './SheetContext';
|
|
@@ -133,7 +133,7 @@ export declare const SheetFrameFrame: import("@tamagui/core").TamaguiComponent<O
|
|
|
133
133
|
}, {
|
|
134
134
|
displayName: string | undefined;
|
|
135
135
|
}>;
|
|
136
|
-
export declare const SheetFrame:
|
|
136
|
+
export declare const SheetFrame: import("react").ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
137
137
|
readonly fullscreen?: boolean | undefined;
|
|
138
138
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
139
139
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
@@ -144,16 +144,16 @@ export declare const SheetFrame: React.ForwardRefExoticComponent<Omit<import("re
|
|
|
144
144
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
145
145
|
}>> & {
|
|
146
146
|
__scopeSheet?: import("@tamagui/create-context").Scope<any>;
|
|
147
|
-
} &
|
|
148
|
-
export declare const Sheet:
|
|
147
|
+
} & RefAttributes<unknown>>;
|
|
148
|
+
export declare const Sheet: import("react").ForwardRefExoticComponent<{
|
|
149
149
|
open?: boolean | undefined;
|
|
150
150
|
defaultOpen?: boolean | undefined;
|
|
151
|
-
onOpenChange?: (((open: boolean) => void) |
|
|
151
|
+
onOpenChange?: (((open: boolean) => void) | import("react").Dispatch<import("react").SetStateAction<boolean>>) | undefined;
|
|
152
152
|
position?: number | undefined;
|
|
153
153
|
defaultPosition?: number | undefined;
|
|
154
154
|
snapPoints?: number[] | undefined;
|
|
155
155
|
onPositionChange?: import("./types").PositionChangeHandler | undefined;
|
|
156
|
-
children?:
|
|
156
|
+
children?: import("react").ReactNode;
|
|
157
157
|
dismissOnOverlayPress?: boolean | undefined;
|
|
158
158
|
dismissOnSnapToBottom?: boolean | undefined;
|
|
159
159
|
forceRemoveScrollEnabled?: boolean | undefined;
|
|
@@ -168,9 +168,9 @@ export declare const Sheet: React.ForwardRefExoticComponent<{
|
|
|
168
168
|
moveOnKeyboardChange?: boolean | undefined;
|
|
169
169
|
} & {
|
|
170
170
|
__scopeSheet?: import("@tamagui/create-context").Scope<any>;
|
|
171
|
-
} &
|
|
171
|
+
} & RefAttributes<View>> & {
|
|
172
172
|
Handle: ({ __scopeSheet, ...props }: SheetScopedProps<XStackProps>) => JSX.Element;
|
|
173
|
-
Frame:
|
|
173
|
+
Frame: import("react").ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
174
174
|
readonly fullscreen?: boolean | undefined;
|
|
175
175
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
176
176
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
@@ -181,19 +181,19 @@ export declare const Sheet: React.ForwardRefExoticComponent<{
|
|
|
181
181
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
182
182
|
}>> & {
|
|
183
183
|
__scopeSheet?: import("@tamagui/create-context").Scope<any>;
|
|
184
|
-
} &
|
|
184
|
+
} & RefAttributes<unknown>>;
|
|
185
185
|
Overlay: ({ __scopeSheet, ...props }: SheetScopedProps<SheetOverlayProps>) => JSX.Element;
|
|
186
|
-
ScrollView:
|
|
186
|
+
ScrollView: import("react").ForwardRefExoticComponent<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
187
187
|
readonly fullscreen?: boolean | undefined;
|
|
188
188
|
} & import("@tamagui/core").MediaProps<Partial<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
189
189
|
readonly fullscreen?: boolean | undefined;
|
|
190
190
|
}>> & import("@tamagui/core").PseudoProps<Partial<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
191
191
|
readonly fullscreen?: boolean | undefined;
|
|
192
|
-
}>> &
|
|
192
|
+
}>> & RefAttributes<import("@tamagui/core").TamaguiElement>>;
|
|
193
193
|
};
|
|
194
|
-
export declare const ControlledSheet:
|
|
194
|
+
export declare const ControlledSheet: FunctionComponent<Omit<SheetProps, "open" | "onOpenChange"> & RefAttributes<View>> & {
|
|
195
195
|
Handle: ({ __scopeSheet, ...props }: SheetScopedProps<XStackProps>) => JSX.Element;
|
|
196
|
-
Frame:
|
|
196
|
+
Frame: import("react").ForwardRefExoticComponent<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
197
197
|
readonly fullscreen?: boolean | undefined;
|
|
198
198
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
199
199
|
} & import("@tamagui/core").MediaProps<Partial<Omit<import("react-native").ViewProps, "display" | "children" | "onLayout" | keyof import("react-native").GestureResponderHandlers> & import("@tamagui/core").ExtendBaseStackProps & import("@tamagui/core").TamaguiComponentPropsBase & import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase> & import("@tamagui/core").WithShorthands<import("@tamagui/core").WithThemeValues<import("@tamagui/core").StackStylePropsBase>> & import("@tamagui/core/types/reactNativeTypes").RNViewProps & Omit<{}, "elevation" | "fullscreen"> & {
|
|
@@ -204,14 +204,14 @@ export declare const ControlledSheet: React.FunctionComponent<Omit<SheetProps, "
|
|
|
204
204
|
readonly elevation?: import("@tamagui/core").SizeTokens | undefined;
|
|
205
205
|
}>> & {
|
|
206
206
|
__scopeSheet?: import("@tamagui/create-context").Scope<any>;
|
|
207
|
-
} &
|
|
207
|
+
} & RefAttributes<unknown>>;
|
|
208
208
|
Overlay: ({ __scopeSheet, ...props }: SheetScopedProps<SheetOverlayProps>) => JSX.Element;
|
|
209
|
-
ScrollView:
|
|
209
|
+
ScrollView: import("react").ForwardRefExoticComponent<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
210
210
|
readonly fullscreen?: boolean | undefined;
|
|
211
211
|
} & import("@tamagui/core").MediaProps<Partial<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
212
212
|
readonly fullscreen?: boolean | undefined;
|
|
213
213
|
}>> & import("@tamagui/core").PseudoProps<Partial<import("react-native").ScrollViewProps & Omit<import("@tamagui/core").StackProps, keyof import("react-native").ScrollViewProps> & Omit<{}, "fullscreen"> & {
|
|
214
214
|
readonly fullscreen?: boolean | undefined;
|
|
215
|
-
}>> &
|
|
215
|
+
}>> & RefAttributes<import("@tamagui/core").TamaguiElement>>;
|
|
216
216
|
};
|
|
217
217
|
//# sourceMappingURL=Sheet.d.ts.map
|
package/types/Sheet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../src/Sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAcT,MAAM,eAAe,CAAA;AAGtB,OAAO,EAA0B,WAAW,EAAuB,MAAM,iBAAiB,CAAA;AAE1F,OAAO,
|
|
1
|
+
{"version":3,"file":"Sheet.d.ts","sourceRoot":"","sources":["../src/Sheet.tsx"],"names":[],"mappings":"AAEA,OAAO,EACL,QAAQ,EAcT,MAAM,eAAe,CAAA;AAGtB,OAAO,EAA0B,WAAW,EAAuB,MAAM,iBAAiB,CAAA;AAE1F,OAAO,EACL,iBAAiB,EACjB,aAAa,EASd,MAAM,OAAO,CAAA;AACd,OAAO,EAOL,IAAI,EACL,MAAM,cAAc,CAAA;AAMrB,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAA;AAOtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AACjD,cAAc,SAAS,CAAA;AAMvB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;EAkC3B,CAAA;AAEF,eAAO,MAAM,WAAW,+BACO,iBAAiB,WAAW,CAAC,gBAe3D,CAAA;AAQD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2B5B,CAAA;AAEF,MAAM,MAAM,iBAAiB,GAAG,QAAQ,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAElE,eAAO,MAAM,YAAY,+BACM,iBAAiB,iBAAiB,CAAC,gBAiBjE,CAAA;AAWD,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;EAqB1B,CAAA;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;2BAQtB,CAAA;AAgBD,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;yCAlIa,iBAAiB,WAAW,CAAC;;;;;;;;;;;;;0CAuD7B,iBAAiB,iBAAiB,CAAC;;;;;;;;CAqGjE,CAAA;AAoXD,eAAO,MAAM,eAAe;yCAhhBG,iBAAiB,WAAW,CAAC;;;;;;;;;;;;;0CAuD7B,iBAAiB,iBAAiB,CAAC;;;;;;;;CA4d1C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nativeSheet.d.ts","sourceRoot":"","sources":["../src/nativeSheet.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"nativeSheet.d.ts","sourceRoot":"","sources":["../src/nativeSheet.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAA;AAG5D,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAOpC,KAAK,oBAAoB,GAAG,KAAK,CAAA;AAMjC,wBAAgB,cAAc,CAAC,QAAQ,EAAE,oBAAoB,wCAE5D;AAED,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,oBAAoB,EAAE,cAAc,EAAE,GAAG,QA+CnF"}
|
|
@@ -1,15 +1,7 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
export declare function useSheetChildren(childrenProp: any): {
|
|
3
2
|
handleComponent: null;
|
|
4
3
|
overlayComponent: null;
|
|
5
4
|
frameComponent: null;
|
|
6
|
-
bottomCoverComponent:
|
|
7
|
-
children: null;
|
|
8
|
-
position: string;
|
|
9
|
-
bottom: number;
|
|
10
|
-
height: number;
|
|
11
|
-
left: number;
|
|
12
|
-
right: number;
|
|
13
|
-
}, HTMLElement> | null;
|
|
5
|
+
bottomCoverComponent: any;
|
|
14
6
|
};
|
|
15
7
|
//# sourceMappingURL=useSheetChildren.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetChildren.d.ts","sourceRoot":"","sources":["../src/useSheetChildren.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useSheetChildren.d.ts","sourceRoot":"","sources":["../src/useSheetChildren.tsx"],"names":[],"mappings":"AAEA,wBAAgB,gBAAgB,CAAC,YAAY,EAAE,GAAG;;;;;EA4CjD"}
|
|
@@ -19,4 +19,5 @@ export declare function useSheetProviderProps(props: SheetProps, state: SheetOpe
|
|
|
19
19
|
setPositionImmediate: React.Dispatch<React.SetStateAction<number>>;
|
|
20
20
|
scrollBridge: ScrollBridge;
|
|
21
21
|
};
|
|
22
|
+
export type SheetContextValue = ReturnType<typeof useSheetProviderProps>;
|
|
22
23
|
//# sourceMappingURL=useSheetProviderProps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useSheetProviderProps.d.ts","sourceRoot":"","sources":["../src/useSheetProviderProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc;;;;;;;;;;;;;wBAuBnE,MAAM;;;EAuChB"}
|
|
1
|
+
{"version":3,"file":"useSheetProviderProps.d.ts","sourceRoot":"","sources":["../src/useSheetProviderProps.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAG9C,OAAO,KAAyC,MAAM,OAAO,CAAA;AAE7D,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,cAAc;;;;;;;;;;;;;wBAuBnE,MAAM;;;EAuChB;AAED,MAAM,MAAM,iBAAiB,GAAG,UAAU,CAAC,OAAO,qBAAqB,CAAC,CAAA"}
|