@tamagui/sheet 1.88.1 → 1.88.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/cjs/Sheet.js +0 -11
- package/dist/cjs/SheetContext.js +0 -7
- package/dist/cjs/SheetController.js +0 -4
- package/dist/cjs/SheetImplementationCustom.js +4 -10
- package/dist/cjs/SheetImplementationCustom.js.map +1 -1
- package/dist/cjs/SheetScrollView.js +1 -5
- package/dist/cjs/SheetScrollView.js.map +1 -1
- package/dist/cjs/constants.js +0 -8
- package/dist/cjs/contexts.js +0 -5
- package/dist/cjs/createSheet.js +1 -6
- package/dist/cjs/createSheet.js.map +1 -1
- package/dist/cjs/helpers.js +0 -4
- package/dist/cjs/index.js +0 -9
- package/dist/cjs/nativeSheet.js +1 -7
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/useSheet.js +0 -4
- package/dist/cjs/useSheetController.js +2 -7
- package/dist/cjs/useSheetController.js.map +1 -1
- package/dist/cjs/useSheetOffscreenSize.js +0 -4
- package/dist/cjs/useSheetOpenState.js +2 -7
- package/dist/cjs/useSheetOpenState.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.js +0 -4
- package/dist/esm/Sheet.native.js +40 -16
- package/dist/esm/Sheet.native.js.map +1 -1
- package/dist/esm/SheetContext.native.js +29 -6
- package/dist/esm/SheetContext.native.js.map +1 -1
- package/dist/esm/SheetController.native.js +26 -8
- package/dist/esm/SheetController.native.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +69 -82
- package/dist/esm/SheetImplementationCustom.native.js.map +2 -2
- package/dist/esm/SheetScrollView.native.js +31 -14
- package/dist/esm/SheetScrollView.native.js.map +1 -1
- package/dist/esm/constants.native.js +29 -4
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/contexts.native.js +27 -5
- package/dist/esm/contexts.native.js.map +1 -1
- package/dist/esm/createSheet.native.js +62 -57
- package/dist/esm/createSheet.native.js.map +2 -2
- package/dist/esm/helpers.native.js +23 -2
- package/dist/esm/helpers.native.js.map +1 -1
- package/dist/esm/index.native.js +35 -9
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/nativeSheet.native.js +33 -16
- package/dist/esm/nativeSheet.native.js.map +1 -1
- package/dist/esm/types.native.js +14 -0
- package/dist/esm/types.native.js.map +2 -2
- package/dist/esm/useSheet.native.js +25 -4
- package/dist/esm/useSheet.native.js.map +1 -1
- package/dist/esm/useSheetController.native.js +28 -6
- package/dist/esm/useSheetController.native.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.native.js +23 -2
- package/dist/esm/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/esm/useSheetOpenState.native.js +29 -8
- package/dist/esm/useSheetOpenState.native.js.map +1 -1
- package/dist/esm/useSheetProviderProps.native.js +38 -12
- package/dist/esm/useSheetProviderProps.native.js.map +2 -2
- package/dist/jsx/Sheet.native.js +40 -16
- package/dist/jsx/Sheet.native.js.map +1 -1
- package/dist/jsx/SheetContext.native.js +29 -6
- package/dist/jsx/SheetContext.native.js.map +1 -1
- package/dist/jsx/SheetController.js +2 -1
- package/dist/jsx/SheetController.js.map +1 -1
- package/dist/jsx/SheetController.native.js +26 -7
- package/dist/jsx/SheetController.native.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.js +45 -37
- package/dist/jsx/SheetImplementationCustom.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.js +100 -107
- package/dist/jsx/SheetImplementationCustom.native.js.map +2 -2
- package/dist/jsx/SheetScrollView.js +19 -14
- package/dist/jsx/SheetScrollView.js.map +1 -1
- package/dist/jsx/SheetScrollView.native.js +44 -22
- package/dist/jsx/SheetScrollView.native.js.map +1 -1
- package/dist/jsx/constants.native.js +29 -4
- package/dist/jsx/constants.native.js.map +1 -1
- package/dist/jsx/contexts.native.js +27 -5
- package/dist/jsx/contexts.native.js.map +1 -1
- package/dist/jsx/createSheet.js +69 -54
- package/dist/jsx/createSheet.js.map +1 -1
- package/dist/jsx/createSheet.native.js +106 -87
- package/dist/jsx/createSheet.native.js.map +2 -2
- package/dist/jsx/helpers.native.js +23 -2
- package/dist/jsx/helpers.native.js.map +1 -1
- package/dist/jsx/index.native.js +35 -9
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/nativeSheet.js +15 -16
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.native.js +41 -26
- package/dist/jsx/nativeSheet.native.js.map +1 -1
- package/dist/jsx/types.native.js +14 -0
- package/dist/jsx/types.native.js.map +2 -2
- package/dist/jsx/useSheet.native.js +25 -4
- package/dist/jsx/useSheet.native.js.map +1 -1
- package/dist/jsx/useSheetController.native.js +27 -5
- package/dist/jsx/useSheetController.native.js.map +1 -1
- package/dist/jsx/useSheetOffscreenSize.native.js +23 -2
- package/dist/jsx/useSheetOffscreenSize.native.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +26 -6
- package/dist/jsx/useSheetOpenState.native.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.js +38 -12
- package/dist/jsx/useSheetProviderProps.native.js.map +2 -2
- package/package.json +16 -16
|
@@ -1,43 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
useRef,
|
|
23
|
-
useState
|
|
24
|
-
} from "react";
|
|
25
|
-
import {
|
|
26
|
-
Dimensions,
|
|
27
|
-
Keyboard,
|
|
28
|
-
PanResponder,
|
|
29
|
-
View
|
|
30
|
-
} from "react-native";
|
|
31
|
-
import { SHEET_HIDDEN_STYLESHEET } from "./constants";
|
|
32
|
-
import { ParentSheetContext, SheetInsideSheetContext } from "./contexts";
|
|
33
|
-
import { resisted } from "./helpers";
|
|
34
|
-
import { SheetProvider } from "./SheetContext";
|
|
35
|
-
import { useSheetOpenState } from "./useSheetOpenState";
|
|
36
|
-
import { useSheetProviderProps } from "./useSheetProviderProps";
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var SheetImplementationCustom_exports = {};
|
|
17
|
+
__export(SheetImplementationCustom_exports, {
|
|
18
|
+
SheetImplementationCustom: () => SheetImplementationCustom
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(SheetImplementationCustom_exports);
|
|
21
|
+
var import_adapt = require("@tamagui/adapt"), import_animate_presence = require("@tamagui/animate-presence"), import_compose_refs = require("@tamagui/compose-refs"), import_constants = require("@tamagui/constants"), import_core = require("@tamagui/core"), import_portal = require("@tamagui/portal"), import_use_keyboard_visible = require("@tamagui/use-keyboard-visible"), import_react = require("react"), import_react_native = require("react-native"), import_constants2 = require("./constants"), import_contexts = require("./contexts"), import_helpers = require("./helpers"), import_SheetContext = require("./SheetContext"), import_useSheetOpenState = require("./useSheetOpenState"), import_useSheetProviderProps = require("./useSheetProviderProps"), import_jsx_runtime = require("react/jsx-runtime");
|
|
37
22
|
let hiddenSize = 10000.1;
|
|
38
|
-
const SheetImplementationCustom = themeable(
|
|
39
|
-
forwardRef(function(props, forwardedRef) {
|
|
40
|
-
const parentSheet = useContext(ParentSheetContext), {
|
|
23
|
+
const SheetImplementationCustom = (0, import_core.themeable)(
|
|
24
|
+
(0, import_react.forwardRef)(function(props, forwardedRef) {
|
|
25
|
+
const parentSheet = (0, import_react.useContext)(import_contexts.ParentSheetContext), {
|
|
41
26
|
animation,
|
|
42
27
|
animationConfig: animationConfigProp,
|
|
43
28
|
modal = !1,
|
|
@@ -45,7 +30,7 @@ const SheetImplementationCustom = themeable(
|
|
|
45
30
|
moveOnKeyboardChange = !1,
|
|
46
31
|
unmountChildrenWhenHidden = !1,
|
|
47
32
|
portalProps
|
|
48
|
-
} = props, keyboardIsVisible = useKeyboardVisible(), state = useSheetOpenState(props), [overlayComponent, setOverlayComponent] = useState(null), providerProps = useSheetProviderProps(props, state, {
|
|
33
|
+
} = props, keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)(), state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = (0, import_react.useState)(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
49
34
|
onOverlayComponent: setOverlayComponent
|
|
50
35
|
}), {
|
|
51
36
|
frameSize,
|
|
@@ -59,38 +44,38 @@ const SheetImplementationCustom = themeable(
|
|
|
59
44
|
screenSize,
|
|
60
45
|
setMaxContentSize,
|
|
61
46
|
maxSnapPoint
|
|
62
|
-
} = providerProps, { open, controller, isHidden } = state, sheetRef = useRef(null), ref = useComposedRefs(forwardedRef, sheetRef), animationConfig = (() => {
|
|
47
|
+
} = providerProps, { open, controller, isHidden } = state, sheetRef = (0, import_react.useRef)(null), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef), animationConfig = (() => {
|
|
63
48
|
const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
|
|
64
49
|
return animationConfigProp ?? (animationProp ? {
|
|
65
|
-
...getConfig().animations.animations[animationProp],
|
|
50
|
+
...(0, import_core.getConfig)().animations.animations[animationProp],
|
|
66
51
|
...animationPropConfig
|
|
67
52
|
} : null);
|
|
68
|
-
})(), [isShowingInnerSheet, setIsShowingInnerSheet] = useState(!1), shouldHideParentSheet = !isWeb && modal && isShowingInnerSheet, parentSheetContext = useContext(SheetInsideSheetContext), onInnerSheet = useCallback((hasChild) => {
|
|
53
|
+
})(), [isShowingInnerSheet, setIsShowingInnerSheet] = (0, import_react.useState)(!1), shouldHideParentSheet = !import_constants.isWeb && modal && isShowingInnerSheet, parentSheetContext = (0, import_react.useContext)(import_contexts.SheetInsideSheetContext), onInnerSheet = (0, import_react.useCallback)((hasChild) => {
|
|
69
54
|
setIsShowingInnerSheet(hasChild);
|
|
70
|
-
}, []), positions = useMemo(
|
|
55
|
+
}, []), positions = (0, import_react.useMemo)(
|
|
71
56
|
() => snapPoints.map(
|
|
72
57
|
(point) => getYPositions(snapPointsMode, point, screenSize, frameSize)
|
|
73
58
|
),
|
|
74
59
|
[screenSize, frameSize, snapPoints, snapPointsMode]
|
|
75
|
-
), { animationDriver } = useConfiguration(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, AnimatedView = animationDriver.View ?? Stack;
|
|
76
|
-
useIsomorphicLayoutEffect(() => {
|
|
60
|
+
), { animationDriver } = (0, import_core.useConfiguration)(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, AnimatedView = animationDriver.View ?? import_core.Stack;
|
|
61
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
77
62
|
if (parentSheetContext && open)
|
|
78
63
|
return parentSheetContext(!0), () => {
|
|
79
64
|
parentSheetContext(!1);
|
|
80
65
|
};
|
|
81
66
|
}, [parentSheetContext, open]);
|
|
82
|
-
const nextParentContext = useMemo(
|
|
67
|
+
const nextParentContext = (0, import_react.useMemo)(
|
|
83
68
|
() => ({
|
|
84
69
|
zIndex
|
|
85
70
|
}),
|
|
86
71
|
[zIndex]
|
|
87
|
-
), animatedNumber = useAnimatedNumber(hiddenSize), at = useRef(hiddenSize);
|
|
72
|
+
), animatedNumber = useAnimatedNumber(hiddenSize), at = (0, import_react.useRef)(hiddenSize);
|
|
88
73
|
useAnimatedNumberReaction(
|
|
89
74
|
{
|
|
90
75
|
value: animatedNumber,
|
|
91
76
|
hostRef: sheetRef
|
|
92
77
|
},
|
|
93
|
-
useCallback(
|
|
78
|
+
(0, import_react.useCallback)(
|
|
94
79
|
(value) => {
|
|
95
80
|
at.current = value, scrollBridge.paneY = value;
|
|
96
81
|
},
|
|
@@ -100,7 +85,7 @@ const SheetImplementationCustom = themeable(
|
|
|
100
85
|
function stopSpring() {
|
|
101
86
|
animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
|
|
102
87
|
}
|
|
103
|
-
const hasntMeasured = at.current === hiddenSize, animateTo = useEvent((position2) => {
|
|
88
|
+
const hasntMeasured = at.current === hiddenSize, animateTo = (0, import_core.useEvent)((position2) => {
|
|
104
89
|
if (frameSize === 0)
|
|
105
90
|
return;
|
|
106
91
|
let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
|
|
@@ -119,15 +104,15 @@ const SheetImplementationCustom = themeable(
|
|
|
119
104
|
});
|
|
120
105
|
}
|
|
121
106
|
});
|
|
122
|
-
useIsomorphicLayoutEffect(() => {
|
|
107
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
123
108
|
screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
|
|
124
109
|
type: "timing",
|
|
125
110
|
duration: 0
|
|
126
111
|
});
|
|
127
|
-
}, [hasntMeasured, screenSize]), useIsomorphicLayoutEffect(() => {
|
|
112
|
+
}, [hasntMeasured, screenSize]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
128
113
|
!frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
|
|
129
114
|
}, [isHidden, frameSize, screenSize, open, position]);
|
|
130
|
-
const disableDrag = props.disableDrag ?? (controller == null ? void 0 : controller.disableDrag), themeName = useThemeName(), [isDragging, setIsDragging] = useState(!1), panResponder = useMemo(
|
|
115
|
+
const disableDrag = props.disableDrag ?? (controller == null ? void 0 : controller.disableDrag), themeName = (0, import_core.useThemeName)(), [isDragging, setIsDragging] = (0, import_react.useState)(!1), panResponder = (0, import_react.useMemo)(
|
|
131
116
|
() => {
|
|
132
117
|
if (disableDrag || !frameSize || isShowingInnerSheet)
|
|
133
118
|
return;
|
|
@@ -135,7 +120,7 @@ const SheetImplementationCustom = themeable(
|
|
|
135
120
|
scrollBridge.paneMinY = minY;
|
|
136
121
|
let startY = at.current;
|
|
137
122
|
function setPanning(val) {
|
|
138
|
-
setIsDragging(val), SHEET_HIDDEN_STYLESHEET && (val ? SHEET_HIDDEN_STYLESHEET.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : SHEET_HIDDEN_STYLESHEET.innerText = "");
|
|
123
|
+
setIsDragging(val), import_constants2.SHEET_HIDDEN_STYLESHEET && (val ? import_constants2.SHEET_HIDDEN_STYLESHEET.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : import_constants2.SHEET_HIDDEN_STYLESHEET.innerText = "");
|
|
139
124
|
}
|
|
140
125
|
const release = ({ vy, dragAt }) => {
|
|
141
126
|
isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
|
|
@@ -163,12 +148,12 @@ const SheetImplementationCustom = themeable(
|
|
|
163
148
|
return scrollBridge.drag = (dy) => {
|
|
164
149
|
isExternalDrag || (isExternalDrag = !0, grant());
|
|
165
150
|
const to = dy + startY;
|
|
166
|
-
animatedNumber.setValue(resisted(to, minY), { type: "direct" });
|
|
167
|
-
}, scrollBridge.release = release, PanResponder.create({
|
|
151
|
+
animatedNumber.setValue((0, import_helpers.resisted)(to, minY), { type: "direct" });
|
|
152
|
+
}, scrollBridge.release = release, import_react_native.PanResponder.create({
|
|
168
153
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
169
154
|
onPanResponderGrant: grant,
|
|
170
155
|
onPanResponderMove: (_e, { dy }) => {
|
|
171
|
-
const toFull = dy + startY, to = resisted(toFull, minY);
|
|
156
|
+
const toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
172
157
|
animatedNumber.setValue(to, { type: "direct" });
|
|
173
158
|
},
|
|
174
159
|
onPanResponderEnd: finish,
|
|
@@ -178,22 +163,22 @@ const SheetImplementationCustom = themeable(
|
|
|
178
163
|
},
|
|
179
164
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
180
165
|
[disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]
|
|
181
|
-
), handleAnimationViewLayout = useCallback(
|
|
166
|
+
), handleAnimationViewLayout = (0, import_react.useCallback)(
|
|
182
167
|
(e) => {
|
|
183
168
|
var _a;
|
|
184
169
|
const next = Math.min(
|
|
185
170
|
(_a = e.nativeEvent) == null ? void 0 : _a.layout.height,
|
|
186
|
-
Dimensions.get("window").height
|
|
171
|
+
import_react_native.Dimensions.get("window").height
|
|
187
172
|
);
|
|
188
173
|
next && setFrameSize(next);
|
|
189
174
|
},
|
|
190
175
|
[keyboardIsVisible]
|
|
191
|
-
), handleMaxContentViewLayout = useCallback(
|
|
176
|
+
), handleMaxContentViewLayout = (0, import_react.useCallback)(
|
|
192
177
|
(e) => {
|
|
193
178
|
var _a;
|
|
194
179
|
const next = Math.min(
|
|
195
180
|
(_a = e.nativeEvent) == null ? void 0 : _a.layout.height,
|
|
196
|
-
Dimensions.get("window").height
|
|
181
|
+
import_react_native.Dimensions.get("window").height
|
|
197
182
|
);
|
|
198
183
|
next && setMaxContentSize(next);
|
|
199
184
|
},
|
|
@@ -203,23 +188,23 @@ const SheetImplementationCustom = themeable(
|
|
|
203
188
|
return {
|
|
204
189
|
transform: [{ translateY: frameSize === 0 ? hiddenSize : val }]
|
|
205
190
|
};
|
|
206
|
-
}), sizeBeforeKeyboard = useRef(null);
|
|
207
|
-
useEffect(() => {
|
|
208
|
-
if (isWeb || !moveOnKeyboardChange)
|
|
191
|
+
}), sizeBeforeKeyboard = (0, import_react.useRef)(null);
|
|
192
|
+
(0, import_react.useEffect)(() => {
|
|
193
|
+
if (import_constants.isWeb || !moveOnKeyboardChange)
|
|
209
194
|
return;
|
|
210
|
-
const keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", (e) => {
|
|
195
|
+
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", (e) => {
|
|
211
196
|
sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = animatedNumber.getValue(), animatedNumber.setValue(
|
|
212
197
|
Math.max(animatedNumber.getValue() - e.endCoordinates.height, 0)
|
|
213
198
|
));
|
|
214
|
-
}), keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
199
|
+
}), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
215
200
|
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current), sizeBeforeKeyboard.current = null);
|
|
216
201
|
});
|
|
217
202
|
return () => {
|
|
218
203
|
keyboardDidHideListener.remove(), keyboardDidShowListener.remove();
|
|
219
204
|
};
|
|
220
205
|
}, [moveOnKeyboardChange]);
|
|
221
|
-
const [opacity, setOpacity] = useState(open ? 1 : 0);
|
|
222
|
-
open && opacity === 0 && setOpacity(1), useEffect(() => {
|
|
206
|
+
const [opacity, setOpacity] = (0, import_react.useState)(open ? 1 : 0);
|
|
207
|
+
open && opacity === 0 && setOpacity(1), (0, import_react.useEffect)(() => {
|
|
223
208
|
if (!open) {
|
|
224
209
|
const tm = setTimeout(() => {
|
|
225
210
|
setOpacity(0);
|
|
@@ -229,46 +214,53 @@ const SheetImplementationCustom = themeable(
|
|
|
229
214
|
};
|
|
230
215
|
}
|
|
231
216
|
}, [open]);
|
|
232
|
-
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}%` : maxSnapPoint, contents =
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
left: 0,
|
|
240
|
-
right: 0,
|
|
241
|
-
bottom: 0,
|
|
242
|
-
pointerEvents: "none"
|
|
243
|
-
}}
|
|
244
|
-
pointerEvents="none"
|
|
245
|
-
onLayout={handleMaxContentViewLayout}
|
|
246
|
-
/>}
|
|
247
|
-
<AnimatedView
|
|
248
|
-
ref={ref}
|
|
249
|
-
{...panResponder == null ? void 0 : panResponder.panHandlers}
|
|
250
|
-
onLayout={handleAnimationViewLayout}
|
|
251
|
-
pointerEvents={open && !shouldHideParentSheet ? "auto" : "none"}
|
|
252
|
-
{...!isDragging && {
|
|
253
|
-
// @ts-ignore for CSS driver this is necessary to attach the transition
|
|
254
|
-
animation
|
|
255
|
-
}}
|
|
256
|
-
style={[
|
|
257
|
-
{
|
|
217
|
+
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}%` : maxSnapPoint, contents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.ParentSheetContext.Provider, { value: nextParentContext, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_SheetContext.SheetProvider, { ...providerProps, children: [
|
|
218
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { enterExitVariant: "open", children: shouldHideParentSheet || !open ? null : overlayComponent }),
|
|
219
|
+
snapPointsMode !== "percent" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
220
|
+
import_react_native.View,
|
|
221
|
+
{
|
|
222
|
+
style: {
|
|
223
|
+
opacity: 0,
|
|
258
224
|
position: "absolute",
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
225
|
+
top: 0,
|
|
226
|
+
left: 0,
|
|
227
|
+
right: 0,
|
|
228
|
+
bottom: 0,
|
|
229
|
+
pointerEvents: "none"
|
|
230
|
+
},
|
|
231
|
+
pointerEvents: "none",
|
|
232
|
+
onLayout: handleMaxContentViewLayout
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
236
|
+
AnimatedView,
|
|
237
|
+
{
|
|
238
|
+
ref,
|
|
239
|
+
...panResponder == null ? void 0 : panResponder.panHandlers,
|
|
240
|
+
onLayout: handleAnimationViewLayout,
|
|
241
|
+
pointerEvents: open && !shouldHideParentSheet ? "auto" : "none",
|
|
242
|
+
...!isDragging && {
|
|
243
|
+
// @ts-ignore for CSS driver this is necessary to attach the transition
|
|
244
|
+
animation
|
|
264
245
|
},
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
246
|
+
style: [
|
|
247
|
+
{
|
|
248
|
+
position: "absolute",
|
|
249
|
+
zIndex,
|
|
250
|
+
width: "100%",
|
|
251
|
+
height: forcedContentHeight,
|
|
252
|
+
minHeight: forcedContentHeight,
|
|
253
|
+
opacity
|
|
254
|
+
},
|
|
255
|
+
animatedStyle
|
|
256
|
+
],
|
|
257
|
+
children: props.children
|
|
258
|
+
}
|
|
259
|
+
)
|
|
260
|
+
] }) }), adaptContext = (0, import_react.useContext)(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
269
261
|
if (modal) {
|
|
270
|
-
const modalContents =
|
|
271
|
-
return isWeb ? modalContents :
|
|
262
|
+
const modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, { zIndex, ...portalProps, children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_core.Theme, { forceClassName: !0, name: themeName, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_adapt.AdaptParentContext.Provider, { value: adaptContext, children: contents }) }) });
|
|
263
|
+
return import_constants.isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
272
264
|
}
|
|
273
265
|
return contents;
|
|
274
266
|
})
|
|
@@ -294,7 +286,8 @@ function getYPositions(mode, point, screenSize, frameSize) {
|
|
|
294
286
|
const pct = Math.min(100, Math.max(0, Number(point))) / 100;
|
|
295
287
|
return Number.isNaN(pct) ? (console.warn("Invalid snapPoint percentage"), 0) : Math.round(screenSize - pct * screenSize);
|
|
296
288
|
}
|
|
297
|
-
export
|
|
289
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
290
|
+
0 && (module.exports = {
|
|
298
291
|
SheetImplementationCustom
|
|
299
|
-
};
|
|
292
|
+
});
|
|
300
293
|
//# sourceMappingURL=SheetImplementationCustom.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetImplementationCustom.tsx"],
|
|
4
|
-
"mappings": "AAAA
|
|
5
|
-
"names": ["position", "state", "pct"]
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC,2BACnC,0BAAgC,sCAChC,sBAAgC,kCAChC,mBAAiD,+BACjD,cAQO,0BACP,gBAAuB,4BACvB,8BAAmC,0CACnC,eAQO,kBACP,sBASO,yBAEPA,oBAAwC,wBACxC,kBAA4D,uBAC5D,iBAAyB,sBACzB,sBAA8B,2BAE9B,2BAAkC,gCAClC,+BAAsC,oCAmX9B;AAjXR,IAAI,aAAa;AAEV,MAAM,gCAA4B;AAAA,MACvC,yBAA6B,SAAmC,OAAO,cAAc;AACnF,UAAM,kBAAc,yBAAW,kCAAkB,GAE3C;AAAA,MACJ;AAAA,MACA,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,SAAS,YAAY,SAAS;A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,KAAK,IAAI,YAAY,SAAS;AAEpD,QAAI,MAAM,SAAS,GAAG,GAAG;AACvB,YAAMC,OAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,OAAO,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC,IAAI;AACrE,aAAI,OAAO,MAAMA,IAAG,KAClB,QAAQ,KAAK,qCAAqC,GAC3C,KAEI,KAAK,MAAM,aAAaA,OAAM,UAAU;AAAA,IAEvD;AACA,mBAAQ,KAAK,iCAAiC,GACvC;AAAA,EACT;AAEA,MAAI,SAAS;AACX,WAAI,UAAU,IAAU,aACjB,aAAa,KAAK,IAAI,YAAY,SAAS;AAGpD,MAAI,SAAS,cAAc,OAAO,SAAU;AAC1C,WAAO,aAAa,KAAK,IAAI,YAAY,KAAK,IAAI,GAAG,KAAK,CAAC;AAG7D,QAAM,MAAM,KAAK,IAAI,KAAK,KAAK,IAAI,GAAG,OAAO,KAAK,CAAC,CAAC,IAAI;AACxD,SAAI,OAAO,MAAM,GAAG,KAClB,QAAQ,KAAK,8BAA8B,GACpC,KAGF,KAAK,MAAM,aAAa,MAAM,UAAU;AACjD;",
|
|
5
|
+
"names": ["import_constants", "position", "state", "pct"]
|
|
6
6
|
}
|
|
@@ -2,6 +2,7 @@ import { composeRefs } from "@tamagui/compose-refs";
|
|
|
2
2
|
import { ScrollView } from "@tamagui/scroll-view";
|
|
3
3
|
import { forwardRef, useMemo, useRef } from "react";
|
|
4
4
|
import { useSheetContext } from "./SheetContext";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
const SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = forwardRef(
|
|
6
7
|
({ __scopeSheet, children, onScroll, ...props }, ref) => {
|
|
7
8
|
const context = useSheetContext(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = useRef(null), state = useRef({
|
|
@@ -25,20 +26,24 @@ const SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = forwardRef(
|
|
|
25
26
|
vy
|
|
26
27
|
});
|
|
27
28
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
29
|
+
return /* @__PURE__ */ jsx(
|
|
30
|
+
ScrollView,
|
|
31
|
+
{
|
|
32
|
+
ref: composeRefs(scrollRef, ref),
|
|
33
|
+
flex: 1,
|
|
34
|
+
scrollEventThrottle: 8,
|
|
35
|
+
onScroll: (e) => {
|
|
36
|
+
const { y } = e.nativeEvent.contentOffset;
|
|
37
|
+
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll?.(e);
|
|
38
|
+
},
|
|
39
|
+
onStartShouldSetResponder: () => (scrollBridge.scrollStartY = -1, state.current.isDragging = !0, !0),
|
|
40
|
+
onMoveShouldSetResponder: () => !1,
|
|
41
|
+
onResponderRelease: release,
|
|
42
|
+
className: "_ovs-contain",
|
|
43
|
+
...props,
|
|
44
|
+
children: useMemo(() => children, [children])
|
|
45
|
+
}
|
|
46
|
+
);
|
|
42
47
|
}
|
|
43
48
|
);
|
|
44
49
|
export {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetScrollView.tsx"],
|
|
4
|
-
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,kBAAmC;AAC5C,SAAS,YAAY,SAAS,cAAc;AAG5C,SAAS,uBAAuB;
|
|
4
|
+
"mappings": "AAAA,SAAS,mBAAmB;AAE5B,SAAS,kBAAmC;AAC5C,SAAS,YAAY,SAAS,cAAc;AAG5C,SAAS,uBAAuB;AAgE1B;AAvDN,MAAM,yBAAyB,mBAElB,kBAAkB;AAAA,EAC7B,CACE,EAAE,cAAc,UAAU,UAAU,GAAG,M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
}
|
|
@@ -1,10 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var SheetScrollView_exports = {};
|
|
17
|
+
__export(SheetScrollView_exports, {
|
|
18
|
+
SheetScrollView: () => SheetScrollView
|
|
19
|
+
});
|
|
20
|
+
module.exports = __toCommonJS(SheetScrollView_exports);
|
|
21
|
+
var import_compose_refs = require("@tamagui/compose-refs"), import_scroll_view = require("@tamagui/scroll-view"), import_react = require("react"), import_SheetContext = require("./SheetContext"), import_jsx_runtime = require("react/jsx-runtime");
|
|
22
|
+
const SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = (0, import_react.forwardRef)(
|
|
6
23
|
({ __scopeSheet, children, onScroll, ...props }, ref) => {
|
|
7
|
-
const context = useSheetContext(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = useRef(null), state = useRef({
|
|
24
|
+
const context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = (0, import_react.useRef)(null), state = (0, import_react.useRef)({
|
|
8
25
|
lastPageY: 0,
|
|
9
26
|
dragAt: 0,
|
|
10
27
|
dys: [],
|
|
@@ -25,23 +42,28 @@ const SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = forwardRef(
|
|
|
25
42
|
vy
|
|
26
43
|
});
|
|
27
44
|
};
|
|
28
|
-
return
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_scroll_view.ScrollView,
|
|
47
|
+
{
|
|
48
|
+
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
49
|
+
flex: 1,
|
|
50
|
+
scrollEventThrottle: 8,
|
|
51
|
+
onScroll: (e) => {
|
|
52
|
+
const { y } = e.nativeEvent.contentOffset;
|
|
53
|
+
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
54
|
+
},
|
|
55
|
+
onStartShouldSetResponder: () => (scrollBridge.scrollStartY = -1, state.current.isDragging = !0, !0),
|
|
56
|
+
onMoveShouldSetResponder: () => !1,
|
|
57
|
+
onResponderRelease: release,
|
|
58
|
+
className: "_ovs-contain",
|
|
59
|
+
...props,
|
|
60
|
+
children: (0, import_react.useMemo)(() => children, [children])
|
|
61
|
+
}
|
|
62
|
+
);
|
|
42
63
|
}
|
|
43
64
|
);
|
|
44
|
-
export
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
45
67
|
SheetScrollView
|
|
46
|
-
};
|
|
68
|
+
});
|
|
47
69
|
//# sourceMappingURL=SheetScrollView.js.map
|
|
@@ -1,6 +1,6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AAa,IAAI,GACb,IAAI,MACN,aAAa,eAAe,KAI9B,6BAAW;AAAA,QASb;AAAA,QACA,2BAA2B,OACzB,aAAa,eAAe,IAC5B,MAAM,QAAQ,aAAa,IACpB;AAAA,QAGT,0BAA0B,MAAM;AAAA,QAmChC,oBAAoB;AAAA,QACpB,WAAU;AAAA,QACT,GAAG;AAAA,QAEH,oCAAQ,MAAM,UAAU,CAAC,QAAQ,CAAC;AAAA;AAAA,IACrC;AAAA,EAEJ;AACF;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,11 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var constants_exports = {};
|
|
17
|
+
__export(constants_exports, {
|
|
18
|
+
SHEET_HANDLE_NAME: () => SHEET_HANDLE_NAME,
|
|
19
|
+
SHEET_HIDDEN_STYLESHEET: () => SHEET_HIDDEN_STYLESHEET,
|
|
20
|
+
SHEET_NAME: () => SHEET_NAME,
|
|
21
|
+
SHEET_OVERLAY_NAME: () => SHEET_OVERLAY_NAME,
|
|
22
|
+
constants: () => constants
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(constants_exports);
|
|
25
|
+
var import_core = require("@tamagui/core");
|
|
26
|
+
const constants = {}, SHEET_NAME = "Sheet", SHEET_HANDLE_NAME = "SheetHandle", SHEET_OVERLAY_NAME = "SheetOverlay", SHEET_HIDDEN_STYLESHEET = import_core.isClient ? document.createElement("style") : null;
|
|
3
27
|
SHEET_HIDDEN_STYLESHEET && document.head.appendChild(SHEET_HIDDEN_STYLESHEET);
|
|
4
|
-
export
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
5
30
|
SHEET_HANDLE_NAME,
|
|
6
31
|
SHEET_HIDDEN_STYLESHEET,
|
|
7
32
|
SHEET_NAME,
|
|
8
33
|
SHEET_OVERLAY_NAME,
|
|
9
34
|
constants
|
|
10
|
-
};
|
|
35
|
+
});
|
|
11
36
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/constants.tsx"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAyB;AAElB,MAAM,YAAY,CAAC,GAEb,aAAa,SACb,oBAAoB,eACpB,qBAAqB,gBAErB,0BAA0B,uBAAW,SAAS,cAAc,OAAO,IAAI;AAChF,2BACF,SAAS,KAAK,YAAY,uBAAuB;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,9 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
+
var contexts_exports = {};
|
|
17
|
+
__export(contexts_exports, {
|
|
18
|
+
ParentSheetContext: () => ParentSheetContext,
|
|
19
|
+
SheetInsideSheetContext: () => SheetInsideSheetContext
|
|
20
|
+
});
|
|
21
|
+
module.exports = __toCommonJS(contexts_exports);
|
|
22
|
+
var import_react = require("react");
|
|
23
|
+
const ParentSheetContext = (0, import_react.createContext)({
|
|
3
24
|
zIndex: 1e5
|
|
4
|
-
}), SheetInsideSheetContext = createContext(null);
|
|
5
|
-
export
|
|
25
|
+
}), SheetInsideSheetContext = (0, import_react.createContext)(null);
|
|
26
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
27
|
+
0 && (module.exports = {
|
|
6
28
|
ParentSheetContext,
|
|
7
29
|
SheetInsideSheetContext
|
|
8
|
-
};
|
|
30
|
+
});
|
|
9
31
|
//# sourceMappingURL=contexts.js.map
|