@tamagui/sheet 1.88.0 → 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,44 +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";
|
|
37
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
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");
|
|
38
22
|
let hiddenSize = 10000.1;
|
|
39
|
-
const SheetImplementationCustom = themeable(
|
|
40
|
-
forwardRef(function(props, forwardedRef) {
|
|
41
|
-
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), {
|
|
42
26
|
animation,
|
|
43
27
|
animationConfig: animationConfigProp,
|
|
44
28
|
modal = !1,
|
|
@@ -46,7 +30,7 @@ const SheetImplementationCustom = themeable(
|
|
|
46
30
|
moveOnKeyboardChange = !1,
|
|
47
31
|
unmountChildrenWhenHidden = !1,
|
|
48
32
|
portalProps
|
|
49
|
-
} = 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, {
|
|
50
34
|
onOverlayComponent: setOverlayComponent
|
|
51
35
|
}), {
|
|
52
36
|
frameSize,
|
|
@@ -60,38 +44,38 @@ const SheetImplementationCustom = themeable(
|
|
|
60
44
|
screenSize,
|
|
61
45
|
setMaxContentSize,
|
|
62
46
|
maxSnapPoint
|
|
63
|
-
} = 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 = (() => {
|
|
64
48
|
const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
|
|
65
49
|
return animationConfigProp ?? (animationProp ? {
|
|
66
|
-
...getConfig().animations.animations[animationProp],
|
|
50
|
+
...(0, import_core.getConfig)().animations.animations[animationProp],
|
|
67
51
|
...animationPropConfig
|
|
68
52
|
} : null);
|
|
69
|
-
})(), [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) => {
|
|
70
54
|
setIsShowingInnerSheet(hasChild);
|
|
71
|
-
}, []), positions = useMemo(
|
|
55
|
+
}, []), positions = (0, import_react.useMemo)(
|
|
72
56
|
() => snapPoints.map(
|
|
73
57
|
(point) => getYPositions(snapPointsMode, point, screenSize, frameSize)
|
|
74
58
|
),
|
|
75
59
|
[screenSize, frameSize, snapPoints, snapPointsMode]
|
|
76
|
-
), { animationDriver } = useConfiguration(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, AnimatedView = animationDriver.View ?? Stack;
|
|
77
|
-
useIsomorphicLayoutEffect(() => {
|
|
60
|
+
), { animationDriver } = (0, import_core.useConfiguration)(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, AnimatedView = animationDriver.View ?? import_core.Stack;
|
|
61
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
78
62
|
if (parentSheetContext && open)
|
|
79
63
|
return parentSheetContext(!0), () => {
|
|
80
64
|
parentSheetContext(!1);
|
|
81
65
|
};
|
|
82
66
|
}, [parentSheetContext, open]);
|
|
83
|
-
const nextParentContext = useMemo(
|
|
67
|
+
const nextParentContext = (0, import_react.useMemo)(
|
|
84
68
|
() => ({
|
|
85
69
|
zIndex
|
|
86
70
|
}),
|
|
87
71
|
[zIndex]
|
|
88
|
-
), animatedNumber = useAnimatedNumber(hiddenSize), at = useRef(hiddenSize);
|
|
72
|
+
), animatedNumber = useAnimatedNumber(hiddenSize), at = (0, import_react.useRef)(hiddenSize);
|
|
89
73
|
useAnimatedNumberReaction(
|
|
90
74
|
{
|
|
91
75
|
value: animatedNumber,
|
|
92
76
|
hostRef: sheetRef
|
|
93
77
|
},
|
|
94
|
-
useCallback(
|
|
78
|
+
(0, import_react.useCallback)(
|
|
95
79
|
(value) => {
|
|
96
80
|
at.current = value, scrollBridge.paneY = value;
|
|
97
81
|
},
|
|
@@ -101,7 +85,7 @@ const SheetImplementationCustom = themeable(
|
|
|
101
85
|
function stopSpring() {
|
|
102
86
|
animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
|
|
103
87
|
}
|
|
104
|
-
const hasntMeasured = at.current === hiddenSize, animateTo = useEvent((position2) => {
|
|
88
|
+
const hasntMeasured = at.current === hiddenSize, animateTo = (0, import_core.useEvent)((position2) => {
|
|
105
89
|
if (frameSize === 0)
|
|
106
90
|
return;
|
|
107
91
|
let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
|
|
@@ -120,15 +104,15 @@ const SheetImplementationCustom = themeable(
|
|
|
120
104
|
});
|
|
121
105
|
}
|
|
122
106
|
});
|
|
123
|
-
useIsomorphicLayoutEffect(() => {
|
|
107
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
124
108
|
screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
|
|
125
109
|
type: "timing",
|
|
126
110
|
duration: 0
|
|
127
111
|
});
|
|
128
|
-
}, [hasntMeasured, screenSize]), useIsomorphicLayoutEffect(() => {
|
|
112
|
+
}, [hasntMeasured, screenSize]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
129
113
|
!frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
|
|
130
114
|
}, [isHidden, frameSize, screenSize, open, position]);
|
|
131
|
-
const disableDrag = props.disableDrag ?? controller
|
|
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)(
|
|
132
116
|
() => {
|
|
133
117
|
if (disableDrag || !frameSize || isShowingInnerSheet)
|
|
134
118
|
return;
|
|
@@ -136,7 +120,7 @@ const SheetImplementationCustom = themeable(
|
|
|
136
120
|
scrollBridge.paneMinY = minY;
|
|
137
121
|
let startY = at.current;
|
|
138
122
|
function setPanning(val) {
|
|
139
|
-
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 = "");
|
|
140
124
|
}
|
|
141
125
|
const release = ({ vy, dragAt }) => {
|
|
142
126
|
isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
|
|
@@ -164,12 +148,12 @@ const SheetImplementationCustom = themeable(
|
|
|
164
148
|
return scrollBridge.drag = (dy) => {
|
|
165
149
|
isExternalDrag || (isExternalDrag = !0, grant());
|
|
166
150
|
const to = dy + startY;
|
|
167
|
-
animatedNumber.setValue(resisted(to, minY), { type: "direct" });
|
|
168
|
-
}, 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({
|
|
169
153
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
170
154
|
onPanResponderGrant: grant,
|
|
171
155
|
onPanResponderMove: (_e, { dy }) => {
|
|
172
|
-
const toFull = dy + startY, to = resisted(toFull, minY);
|
|
156
|
+
const toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
173
157
|
animatedNumber.setValue(to, { type: "direct" });
|
|
174
158
|
},
|
|
175
159
|
onPanResponderEnd: finish,
|
|
@@ -179,20 +163,22 @@ const SheetImplementationCustom = themeable(
|
|
|
179
163
|
},
|
|
180
164
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
181
165
|
[disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]
|
|
182
|
-
), handleAnimationViewLayout = useCallback(
|
|
166
|
+
), handleAnimationViewLayout = (0, import_react.useCallback)(
|
|
183
167
|
(e) => {
|
|
168
|
+
var _a;
|
|
184
169
|
const next = Math.min(
|
|
185
|
-
e.nativeEvent
|
|
186
|
-
Dimensions.get("window").height
|
|
170
|
+
(_a = e.nativeEvent) == null ? void 0 : _a.layout.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) => {
|
|
178
|
+
var _a;
|
|
193
179
|
const next = Math.min(
|
|
194
|
-
e.nativeEvent
|
|
195
|
-
Dimensions.get("window").height
|
|
180
|
+
(_a = e.nativeEvent) == null ? void 0 : _a.layout.height,
|
|
181
|
+
import_react_native.Dimensions.get("window").height
|
|
196
182
|
);
|
|
197
183
|
next && setMaxContentSize(next);
|
|
198
184
|
},
|
|
@@ -202,23 +188,23 @@ const SheetImplementationCustom = themeable(
|
|
|
202
188
|
return {
|
|
203
189
|
transform: [{ translateY: frameSize === 0 ? hiddenSize : val }]
|
|
204
190
|
};
|
|
205
|
-
}), sizeBeforeKeyboard = useRef(null);
|
|
206
|
-
useEffect(() => {
|
|
207
|
-
if (isWeb || !moveOnKeyboardChange)
|
|
191
|
+
}), sizeBeforeKeyboard = (0, import_react.useRef)(null);
|
|
192
|
+
(0, import_react.useEffect)(() => {
|
|
193
|
+
if (import_constants.isWeb || !moveOnKeyboardChange)
|
|
208
194
|
return;
|
|
209
|
-
const keyboardDidShowListener = Keyboard.addListener("keyboardDidShow", (e) => {
|
|
195
|
+
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", (e) => {
|
|
210
196
|
sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = animatedNumber.getValue(), animatedNumber.setValue(
|
|
211
197
|
Math.max(animatedNumber.getValue() - e.endCoordinates.height, 0)
|
|
212
198
|
));
|
|
213
|
-
}), keyboardDidHideListener = Keyboard.addListener("keyboardDidHide", () => {
|
|
199
|
+
}), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
214
200
|
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current), sizeBeforeKeyboard.current = null);
|
|
215
201
|
});
|
|
216
202
|
return () => {
|
|
217
203
|
keyboardDidHideListener.remove(), keyboardDidShowListener.remove();
|
|
218
204
|
};
|
|
219
205
|
}, [moveOnKeyboardChange]);
|
|
220
|
-
const [opacity, setOpacity] = useState(open ? 1 : 0);
|
|
221
|
-
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)(() => {
|
|
222
208
|
if (!open) {
|
|
223
209
|
const tm = setTimeout(() => {
|
|
224
210
|
setOpacity(0);
|
|
@@ -228,10 +214,10 @@ const SheetImplementationCustom = themeable(
|
|
|
228
214
|
};
|
|
229
215
|
}
|
|
230
216
|
}, [open]);
|
|
231
|
-
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}%` : maxSnapPoint, contents = /* @__PURE__ */ jsx(ParentSheetContext.Provider, { value: nextParentContext, children: /* @__PURE__ */ jsxs(SheetProvider, { ...providerProps, children: [
|
|
232
|
-
/* @__PURE__ */ jsx(AnimatePresence, { enterExitVariant: "open", children: shouldHideParentSheet || !open ? null : overlayComponent }),
|
|
233
|
-
snapPointsMode !== "percent" && /* @__PURE__ */ jsx(
|
|
234
|
-
View,
|
|
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,
|
|
235
221
|
{
|
|
236
222
|
style: {
|
|
237
223
|
opacity: 0,
|
|
@@ -246,11 +232,11 @@ const SheetImplementationCustom = themeable(
|
|
|
246
232
|
onLayout: handleMaxContentViewLayout
|
|
247
233
|
}
|
|
248
234
|
),
|
|
249
|
-
/* @__PURE__ */ jsx(
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
250
236
|
AnimatedView,
|
|
251
237
|
{
|
|
252
238
|
ref,
|
|
253
|
-
...panResponder
|
|
239
|
+
...panResponder == null ? void 0 : panResponder.panHandlers,
|
|
254
240
|
onLayout: handleAnimationViewLayout,
|
|
255
241
|
pointerEvents: open && !shouldHideParentSheet ? "auto" : "none",
|
|
256
242
|
...!isDragging && {
|
|
@@ -271,10 +257,10 @@ const SheetImplementationCustom = themeable(
|
|
|
271
257
|
children: props.children
|
|
272
258
|
}
|
|
273
259
|
)
|
|
274
|
-
] }) }), adaptContext = useContext(AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
260
|
+
] }) }), adaptContext = (0, import_react.useContext)(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
275
261
|
if (modal) {
|
|
276
|
-
const modalContents = /* @__PURE__ */ jsx(Portal, { zIndex, ...portalProps, children: shouldMountChildren && /* @__PURE__ */ jsx(Theme, { forceClassName: !0, name: themeName, children: /* @__PURE__ */ jsx(AdaptParentContext.Provider, { value: adaptContext, children: contents }) }) });
|
|
277
|
-
return isWeb ? modalContents : /* @__PURE__ */ jsx(SheetInsideSheetContext.Provider, { value: onInnerSheet, children: 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 });
|
|
278
264
|
}
|
|
279
265
|
return contents;
|
|
280
266
|
})
|
|
@@ -300,7 +286,8 @@ function getYPositions(mode, point, screenSize, frameSize) {
|
|
|
300
286
|
const pct = Math.min(100, Math.max(0, Number(point))) / 100;
|
|
301
287
|
return Number.isNaN(pct) ? (console.warn("Invalid snapPoint percentage"), 0) : Math.round(screenSize - pct * screenSize);
|
|
302
288
|
}
|
|
303
|
-
export
|
|
289
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
290
|
+
0 && (module.exports = {
|
|
304
291
|
SheetImplementationCustom
|
|
305
|
-
};
|
|
292
|
+
});
|
|
306
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;AAAA,MAC9B,uBAAuB;AAAA,MACvB,4BAA4B;AAAA,MAC5B;AAAA,IACF,IAAI,OAEE,wBAAoB,gDAAmB,GACvC,YAAQ,4CAAkB,KAAK,GAC/B,CAAC,kBAAkB,mBAAmB,QAAI,uBAAc,IAAI,GAC5D,oBAAgB,oDAAsB,OAAO,OAAO;AAAA,MACxD,oBAAoB;AAAA,IACtB,CAAC,GACK;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,IAAI,eACE,EAAE,MAAM,YAAY,SAAS,IAAI,O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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
|
}
|
|
@@ -1,11 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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)(
|
|
7
23
|
({ __scopeSheet, children, onScroll, ...props }, ref) => {
|
|
8
|
-
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)({
|
|
9
25
|
lastPageY: 0,
|
|
10
26
|
dragAt: 0,
|
|
11
27
|
dys: [],
|
|
@@ -26,27 +42,28 @@ const SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = forwardRef(
|
|
|
26
42
|
vy
|
|
27
43
|
});
|
|
28
44
|
};
|
|
29
|
-
return /* @__PURE__ */ jsx(
|
|
30
|
-
ScrollView,
|
|
45
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
46
|
+
import_scroll_view.ScrollView,
|
|
31
47
|
{
|
|
32
|
-
ref: composeRefs(scrollRef, ref),
|
|
48
|
+
ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
|
|
33
49
|
flex: 1,
|
|
34
50
|
scrollEventThrottle: 8,
|
|
35
51
|
onScroll: (e) => {
|
|
36
52
|
const { y } = e.nativeEvent.contentOffset;
|
|
37
|
-
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll
|
|
53
|
+
scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
|
|
38
54
|
},
|
|
39
55
|
onStartShouldSetResponder: () => (scrollBridge.scrollStartY = -1, state.current.isDragging = !0, !0),
|
|
40
56
|
onMoveShouldSetResponder: () => !1,
|
|
41
57
|
onResponderRelease: release,
|
|
42
58
|
className: "_ovs-contain",
|
|
43
59
|
...props,
|
|
44
|
-
children: useMemo(() => children, [children])
|
|
60
|
+
children: (0, import_react.useMemo)(() => children, [children])
|
|
45
61
|
}
|
|
46
62
|
);
|
|
47
63
|
}
|
|
48
64
|
);
|
|
49
|
-
export
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
50
67
|
SheetScrollView
|
|
51
|
-
};
|
|
68
|
+
});
|
|
52
69
|
//# sourceMappingURL=SheetScrollView.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetScrollView.tsx"],
|
|
4
|
-
"mappings": "AAAA
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,0BAA4B,kCAE5B,qBAA4C,iCAC5C,eAA4C,kBAG5C,sBAAgC,2BAgE1B;AAvDN,MAAM,yBAAyB,mBAElB,sBAAkB;AAAA,EAC7B,CACE,EAAE,cAAc,UAAU,UAAU,GAAG,MAAM,GAC7C,QACG;AACH,UAAM,cAAU,qCAAgB,wBAAwB,YAAY,GAC9D,EAAE,aAAa,IAAI,SAEnB,gBAAY,qBAA4B,IAAI,GAc5C,YAAQ,qBAAO;AAAA,MACnB,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,KAAK,CAAC;AAAA;AAAA,MACN,aAAa;AAAA,MACb,YAAY;AAAA,IACd,CAAC,GAEK,UAAU,MAAM;AACpB,UAAI,CAAC,MAAM,QAAQ;AACjB;AAEF,YAAM,QAAQ,aAAa,IAC3B,aAAa,eAAe,IAC5B,MAAM,QAAQ,cAAc;AAE5B,UAAI,KAAK;AACT,UAAI,MAAM,QAAQ,IAAI,QAAQ;AAC5B,cAAM,YAAY,MAAM,QAAQ,IAAI,MAAM,GAAG;AAG7C,cAFa,UAAU,SAAS,UAAU,OAAO,CAAC,GAAG,MAAM,IAAI,GAAG,CAAC,IAAI,KAClD,UAAU,SAClB;AAAA,MACf;AACA,YAAM,QAAQ,MAAM,CAAC,GACrB,aAAa,QAAQ;AAAA,QACnB,QAAQ,MAAM,QAAQ;AAAA,QACtB;AAAA,MACF,CAAC;AAAA,IACH;AAEA,WACE;AAAA,MAAC;AAAA;AAAA,QACC,SAAK,iCAAY,WAAkB,GAAG;AAAA,QACtC,MAAM;AAAA,QACN,qBAAqB;AAAA,QAErB,UAAU,CAAC,MAAM;AACf,gBAAM,EAAE,EAAE,IAAI,EAAE,YAAY;AAC5B,uBAAa,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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/contexts.ts"],
|
|
4
|
-
"mappings": "AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAA8B;AAEvB,MAAM,yBAAqB,4BAAc;AAAA,EAC9C,QAAQ;AACV,CAAC,GAEY,8BAA0B,4BAErC,IAAI;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|