@tamagui/sheet 1.112.1 → 1.112.3
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/SheetImplementationCustom.js +247 -249
- package/dist/cjs/SheetImplementationCustom.js.map +2 -2
- package/dist/cjs/SheetImplementationCustom.native.js +3 -3
- package/dist/cjs/SheetImplementationCustom.native.js.map +2 -2
- package/dist/cjs/constants.js +1 -4
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +1 -4
- package/dist/cjs/constants.native.js.map +2 -2
- package/dist/esm/SheetImplementationCustom.js +253 -252
- package/dist/esm/SheetImplementationCustom.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.mjs +8 -8
- package/dist/esm/SheetImplementationCustom.mjs.map +1 -1
- package/dist/esm/SheetImplementationCustom.native.js +7 -7
- package/dist/esm/SheetImplementationCustom.native.js.map +1 -1
- package/dist/esm/constants.js +1 -4
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/constants.mjs +2 -5
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js +2 -5
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.js +253 -252
- package/dist/jsx/SheetImplementationCustom.js.map +1 -1
- package/dist/jsx/SheetImplementationCustom.mjs +8 -8
- package/dist/jsx/SheetImplementationCustom.mjs.map +1 -1
- package/dist/jsx/SheetImplementationCustom.native.js +6 -7
- package/dist/jsx/SheetImplementationCustom.native.js.map +2 -2
- package/dist/jsx/constants.js +1 -4
- package/dist/jsx/constants.js.map +1 -1
- package/dist/jsx/constants.mjs +2 -5
- package/dist/jsx/constants.mjs.map +1 -1
- package/dist/jsx/constants.native.js +1 -4
- package/dist/jsx/constants.native.js.map +2 -2
- package/package.json +16 -16
- package/src/SheetImplementationCustom.tsx +442 -433
- package/src/constants.tsx +0 -9
- package/src/createSheet.tsx +1 -1
- package/types/SheetImplementationCustom.d.ts +2 -2
- package/types/SheetImplementationCustom.d.ts.map +1 -1
- package/types/constants.d.ts +0 -1
- package/types/constants.d.ts.map +1 -1
|
@@ -25,268 +25,266 @@ __export(SheetImplementationCustom_exports, {
|
|
|
25
25
|
SheetImplementationCustom: () => SheetImplementationCustom
|
|
26
26
|
});
|
|
27
27
|
module.exports = __toCommonJS(SheetImplementationCustom_exports);
|
|
28
|
-
var
|
|
29
|
-
let hiddenSize = 10000.1;
|
|
30
|
-
const SheetImplementationCustom =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
() =>
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
28
|
+
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 = __toESM(require("react")), import_react_native = require("react-native-web"), 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");
|
|
29
|
+
let hiddenSize = 10000.1, sheetHiddenStyleSheet = null;
|
|
30
|
+
const SheetImplementationCustom = import_react.default.forwardRef(
|
|
31
|
+
function(props, forwardedRef) {
|
|
32
|
+
const parentSheet = import_react.default.useContext(import_contexts.ParentSheetContext), {
|
|
33
|
+
animation,
|
|
34
|
+
animationConfig: animationConfigProp,
|
|
35
|
+
modal = !1,
|
|
36
|
+
zIndex = parentSheet.zIndex + 1,
|
|
37
|
+
moveOnKeyboardChange = !1,
|
|
38
|
+
unmountChildrenWhenHidden = !1,
|
|
39
|
+
portalProps,
|
|
40
|
+
containerComponent: ContainerComponent = import_react.default.Fragment
|
|
41
|
+
} = props, keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)(), state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = import_react.default.useState(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
42
|
+
onOverlayComponent: setOverlayComponent
|
|
43
|
+
}), {
|
|
44
|
+
frameSize,
|
|
45
|
+
setFrameSize,
|
|
46
|
+
snapPoints,
|
|
47
|
+
snapPointsMode,
|
|
48
|
+
hasFit,
|
|
49
|
+
position,
|
|
50
|
+
setPosition,
|
|
51
|
+
scrollBridge,
|
|
52
|
+
screenSize,
|
|
53
|
+
setMaxContentSize,
|
|
54
|
+
maxSnapPoint
|
|
55
|
+
} = providerProps, { open, controller, isHidden } = state, sheetRef = import_react.default.useRef(null), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef), animationConfig = (() => {
|
|
56
|
+
const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
|
|
57
|
+
return animationConfigProp ?? (animationProp ? {
|
|
58
|
+
...(0, import_core.getConfig)().animations.animations[animationProp],
|
|
59
|
+
...animationPropConfig
|
|
60
|
+
} : null);
|
|
61
|
+
})(), [isShowingInnerSheet, setIsShowingInnerSheet] = import_react.default.useState(!1), shouldHideParentSheet = !import_constants.isWeb && modal && isShowingInnerSheet, parentSheetContext = import_react.default.useContext(import_contexts.SheetInsideSheetContext), onInnerSheet = import_react.default.useCallback((hasChild) => {
|
|
62
|
+
setIsShowingInnerSheet(hasChild);
|
|
63
|
+
}, []), positions = import_react.default.useMemo(
|
|
64
|
+
() => snapPoints.map(
|
|
65
|
+
(point) => getYPositions(snapPointsMode, point, screenSize, frameSize)
|
|
66
|
+
),
|
|
67
|
+
[screenSize, frameSize, snapPoints, snapPointsMode]
|
|
68
|
+
), { animationDriver } = (0, import_core.useConfiguration)(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver, AnimatedView = animationDriver.View ?? import_core.Stack;
|
|
69
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
70
|
+
if (parentSheetContext && open)
|
|
71
|
+
return parentSheetContext(!0), () => {
|
|
72
|
+
parentSheetContext(!1);
|
|
73
|
+
};
|
|
74
|
+
}, [parentSheetContext, open]);
|
|
75
|
+
const nextParentContext = import_react.default.useMemo(
|
|
76
|
+
() => ({
|
|
77
|
+
zIndex
|
|
78
|
+
}),
|
|
79
|
+
[zIndex]
|
|
80
|
+
), animatedNumber = useAnimatedNumber(hiddenSize), at = import_react.default.useRef(hiddenSize);
|
|
81
|
+
useAnimatedNumberReaction(
|
|
82
|
+
{
|
|
83
|
+
value: animatedNumber,
|
|
84
|
+
hostRef: sheetRef
|
|
85
|
+
},
|
|
86
|
+
import_react.default.useCallback(
|
|
87
|
+
(value) => {
|
|
88
|
+
at.current = value, scrollBridge.paneY = value;
|
|
86
89
|
},
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}));
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
animatedNumber.setValue(toValue, {
|
|
118
|
-
type: "spring",
|
|
119
|
-
...animationConfig
|
|
120
|
-
});
|
|
90
|
+
[animationDriver]
|
|
91
|
+
)
|
|
92
|
+
);
|
|
93
|
+
function stopSpring() {
|
|
94
|
+
animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
|
|
95
|
+
}
|
|
96
|
+
const hasntMeasured = at.current === hiddenSize, animateTo = (0, import_core.useEvent)((position2) => {
|
|
97
|
+
if (frameSize === 0) return;
|
|
98
|
+
let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
|
|
99
|
+
if (at.current !== toValue) {
|
|
100
|
+
if (at.current = toValue, stopSpring(), hasntMeasured || isHidden) {
|
|
101
|
+
animatedNumber.setValue(
|
|
102
|
+
screenSize,
|
|
103
|
+
{
|
|
104
|
+
type: "timing",
|
|
105
|
+
duration: 0
|
|
106
|
+
},
|
|
107
|
+
() => {
|
|
108
|
+
isHidden || (toValue = positions[position2], at.current = toValue, animatedNumber.setValue(toValue, {
|
|
109
|
+
type: "spring",
|
|
110
|
+
...animationConfig
|
|
111
|
+
}));
|
|
112
|
+
}
|
|
113
|
+
);
|
|
114
|
+
return;
|
|
121
115
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
type: "timing",
|
|
126
|
-
duration: 0
|
|
116
|
+
animatedNumber.setValue(toValue, {
|
|
117
|
+
type: "spring",
|
|
118
|
+
...animationConfig
|
|
127
119
|
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
(0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
123
|
+
screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
|
|
124
|
+
type: "timing",
|
|
125
|
+
duration: 0
|
|
126
|
+
});
|
|
127
|
+
}, [hasntMeasured, screenSize]), (0, import_constants.useIsomorphicLayoutEffect)(() => {
|
|
128
|
+
!frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
|
|
129
|
+
}, [isHidden, frameSize, screenSize, open, position]);
|
|
130
|
+
const disableDrag = props.disableDrag ?? controller?.disableDrag, themeName = (0, import_core.useThemeName)(), [isDragging, setIsDragging] = import_react.default.useState(!1), panResponder = import_react.default.useMemo(() => {
|
|
131
|
+
if (disableDrag || !frameSize || isShowingInnerSheet) return;
|
|
132
|
+
const minY = positions[0];
|
|
133
|
+
scrollBridge.paneMinY = minY;
|
|
134
|
+
let startY = at.current;
|
|
135
|
+
function setPanning(val) {
|
|
136
|
+
setIsDragging(val), import_constants.isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
|
|
137
|
+
}
|
|
138
|
+
const release = ({ vy, dragAt }) => {
|
|
139
|
+
isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
|
|
140
|
+
const end = dragAt + startY + frameSize * vy * 0.2;
|
|
141
|
+
let closestPoint = 0, dist = Number.POSITIVE_INFINITY;
|
|
142
|
+
for (let i = 0; i < positions.length; i++) {
|
|
143
|
+
const position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
144
|
+
curDist < dist && (dist = curDist, closestPoint = i);
|
|
138
145
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
145
|
-
curDist < dist && (dist = curDist, closestPoint = i);
|
|
146
|
-
}
|
|
147
|
-
setPosition(closestPoint), animateTo(closestPoint);
|
|
148
|
-
}, finish = (_e, state2) => {
|
|
149
|
-
release({
|
|
150
|
-
vy: state2.vy,
|
|
151
|
-
dragAt: state2.dy
|
|
152
|
-
});
|
|
153
|
-
};
|
|
154
|
-
let previouslyScrolling = !1;
|
|
155
|
-
const onMoveShouldSet = (e, { dy }) => {
|
|
156
|
-
if (e.target === providerProps.handleRef.current)
|
|
157
|
-
return !0;
|
|
158
|
-
const isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
159
|
-
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !import_constants.isWeb ? !1 : Math.abs(dy) > 5;
|
|
160
|
-
}, grant = () => {
|
|
161
|
-
setPanning(!0), stopSpring(), startY = at.current;
|
|
162
|
-
};
|
|
163
|
-
let isExternalDrag = !1;
|
|
164
|
-
return scrollBridge.drag = (dy) => {
|
|
165
|
-
isExternalDrag || (isExternalDrag = !0, grant());
|
|
166
|
-
const to = dy + startY;
|
|
167
|
-
animatedNumber.setValue((0, import_helpers.resisted)(to, minY), { type: "direct" });
|
|
168
|
-
}, scrollBridge.release = release, import_react_native.PanResponder.create({
|
|
169
|
-
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
170
|
-
onPanResponderGrant: grant,
|
|
171
|
-
onPanResponderMove: (_e, { dy }) => {
|
|
172
|
-
const toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
173
|
-
animatedNumber.setValue(to, { type: "direct" });
|
|
174
|
-
},
|
|
175
|
-
onPanResponderEnd: finish,
|
|
176
|
-
onPanResponderTerminate: finish,
|
|
177
|
-
onPanResponderRelease: finish
|
|
146
|
+
setPosition(closestPoint), animateTo(closestPoint);
|
|
147
|
+
}, finish = (_e, state2) => {
|
|
148
|
+
release({
|
|
149
|
+
vy: state2.vy,
|
|
150
|
+
dragAt: state2.dy
|
|
178
151
|
});
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
152
|
+
};
|
|
153
|
+
let previouslyScrolling = !1;
|
|
154
|
+
const onMoveShouldSet = (e, { dy }) => {
|
|
155
|
+
if (e.target === providerProps.handleRef.current)
|
|
156
|
+
return !0;
|
|
157
|
+
const isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
158
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !import_constants.isWeb ? !1 : Math.abs(dy) > 5;
|
|
159
|
+
}, grant = () => {
|
|
160
|
+
setPanning(!0), stopSpring(), startY = at.current;
|
|
161
|
+
};
|
|
162
|
+
let isExternalDrag = !1;
|
|
163
|
+
return scrollBridge.drag = (dy) => {
|
|
164
|
+
isExternalDrag || (isExternalDrag = !0, grant());
|
|
165
|
+
const to = dy + startY;
|
|
166
|
+
animatedNumber.setValue((0, import_helpers.resisted)(to, minY), { type: "direct" });
|
|
167
|
+
}, scrollBridge.release = release, import_react_native.PanResponder.create({
|
|
168
|
+
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
169
|
+
onPanResponderGrant: grant,
|
|
170
|
+
onPanResponderMove: (_e, { dy }) => {
|
|
171
|
+
const toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
172
|
+
animatedNumber.setValue(to, { type: "direct" });
|
|
186
173
|
},
|
|
187
|
-
|
|
188
|
-
|
|
174
|
+
onPanResponderEnd: finish,
|
|
175
|
+
onPanResponderTerminate: finish,
|
|
176
|
+
onPanResponderRelease: finish
|
|
177
|
+
});
|
|
178
|
+
}, [disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]), handleAnimationViewLayout = import_react.default.useCallback(
|
|
179
|
+
(e) => {
|
|
180
|
+
const next = Math.min(
|
|
181
|
+
e.nativeEvent?.layout.height,
|
|
182
|
+
import_react_native.Dimensions.get("screen").height
|
|
183
|
+
);
|
|
184
|
+
next && setFrameSize(next);
|
|
185
|
+
},
|
|
186
|
+
[keyboardIsVisible]
|
|
187
|
+
), handleMaxContentViewLayout = import_react.default.useCallback(
|
|
188
|
+
(e) => {
|
|
189
|
+
const next = Math.min(
|
|
190
|
+
e.nativeEvent?.layout.height,
|
|
191
|
+
import_react_native.Dimensions.get("screen").height
|
|
192
|
+
);
|
|
193
|
+
next && setMaxContentSize(next);
|
|
194
|
+
},
|
|
195
|
+
[keyboardIsVisible]
|
|
196
|
+
), animatedStyle = useAnimatedNumberStyle(animatedNumber, (val) => {
|
|
197
|
+
"worklet";
|
|
198
|
+
return {
|
|
199
|
+
transform: [{ translateY: frameSize === 0 ? hiddenSize : val }]
|
|
200
|
+
};
|
|
201
|
+
}), sizeBeforeKeyboard = import_react.default.useRef(null);
|
|
202
|
+
import_react.default.useEffect(() => {
|
|
203
|
+
if (import_constants.isWeb || !moveOnKeyboardChange) return;
|
|
204
|
+
const keyboardShowListener = import_react_native.Keyboard.addListener(
|
|
205
|
+
import_constants.currentPlatform === "ios" ? "keyboardWillShow" : "keyboardDidShow",
|
|
189
206
|
(e) => {
|
|
190
|
-
|
|
191
|
-
e.
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
));
|
|
215
|
-
}
|
|
216
|
-
), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
217
|
-
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current, {
|
|
218
|
-
type: "timing",
|
|
219
|
-
duration: 250
|
|
220
|
-
}), sizeBeforeKeyboard.current = null);
|
|
221
|
-
});
|
|
207
|
+
sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = isHidden || position === -1 ? screenSize : positions[position], animatedNumber.setValue(
|
|
208
|
+
Math.max(sizeBeforeKeyboard.current - e.endCoordinates.height, 0),
|
|
209
|
+
{
|
|
210
|
+
type: "timing",
|
|
211
|
+
duration: 250
|
|
212
|
+
}
|
|
213
|
+
));
|
|
214
|
+
}
|
|
215
|
+
), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
216
|
+
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current, {
|
|
217
|
+
type: "timing",
|
|
218
|
+
duration: 250
|
|
219
|
+
}), sizeBeforeKeyboard.current = null);
|
|
220
|
+
});
|
|
221
|
+
return () => {
|
|
222
|
+
keyboardDidHideListener.remove(), keyboardShowListener.remove();
|
|
223
|
+
};
|
|
224
|
+
}, [moveOnKeyboardChange, positions, position, isHidden]);
|
|
225
|
+
const [opacity, setOpacity] = import_react.default.useState(open ? 1 : 0);
|
|
226
|
+
open && opacity === 0 && setOpacity(1), import_react.default.useEffect(() => {
|
|
227
|
+
if (!open) {
|
|
228
|
+
const tm = setTimeout(() => {
|
|
229
|
+
setOpacity(0);
|
|
230
|
+
}, 400);
|
|
222
231
|
return () => {
|
|
223
|
-
|
|
232
|
+
clearTimeout(tm);
|
|
224
233
|
};
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
234
|
+
}
|
|
235
|
+
}, [open]);
|
|
236
|
+
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants.isWeb ? "dvh" : "%"}` : 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: [
|
|
237
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { custom: { open }, children: shouldHideParentSheet || !open ? null : overlayComponent }),
|
|
238
|
+
snapPointsMode !== "percent" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
239
|
+
import_react_native.View,
|
|
240
|
+
{
|
|
241
|
+
style: {
|
|
242
|
+
opacity: 0,
|
|
243
|
+
position: "absolute",
|
|
244
|
+
top: 0,
|
|
245
|
+
left: 0,
|
|
246
|
+
right: 0,
|
|
247
|
+
bottom: 0,
|
|
248
|
+
pointerEvents: "none"
|
|
249
|
+
},
|
|
250
|
+
onLayout: handleMaxContentViewLayout
|
|
235
251
|
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
252
|
+
),
|
|
253
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
254
|
+
AnimatedView,
|
|
255
|
+
{
|
|
256
|
+
ref,
|
|
257
|
+
...panResponder?.panHandlers,
|
|
258
|
+
onLayout: handleAnimationViewLayout,
|
|
259
|
+
...!isDragging && {
|
|
260
|
+
// @ts-ignore for CSS driver this is necessary to attach the transition
|
|
261
|
+
animation
|
|
262
|
+
},
|
|
263
|
+
disableClassName: !0,
|
|
264
|
+
style: [
|
|
265
|
+
{
|
|
244
266
|
position: "absolute",
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
),
|
|
254
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
255
|
-
AnimatedView,
|
|
256
|
-
{
|
|
257
|
-
ref,
|
|
258
|
-
...panResponder?.panHandlers,
|
|
259
|
-
onLayout: handleAnimationViewLayout,
|
|
260
|
-
...!isDragging && {
|
|
261
|
-
// @ts-ignore for CSS driver this is necessary to attach the transition
|
|
262
|
-
animation
|
|
267
|
+
zIndex,
|
|
268
|
+
width: "100%",
|
|
269
|
+
height: forcedContentHeight,
|
|
270
|
+
minHeight: forcedContentHeight,
|
|
271
|
+
opacity,
|
|
272
|
+
...(shouldHideParentSheet || !open) && {
|
|
273
|
+
pointerEvents: "none"
|
|
274
|
+
}
|
|
263
275
|
},
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
...(shouldHideParentSheet || !open) && {
|
|
274
|
-
pointerEvents: "none"
|
|
275
|
-
}
|
|
276
|
-
},
|
|
277
|
-
animatedStyle
|
|
278
|
-
],
|
|
279
|
-
children: props.children
|
|
280
|
-
}
|
|
281
|
-
)
|
|
282
|
-
] }) }), adaptContext = import_react.default.useContext(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
283
|
-
if (modal) {
|
|
284
|
-
const modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, { zIndex, ...portalProps, children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContainerComponent, { children: /* @__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 }) }) }) });
|
|
285
|
-
return import_constants.isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
286
|
-
}
|
|
287
|
-
return contents;
|
|
276
|
+
animatedStyle
|
|
277
|
+
],
|
|
278
|
+
children: props.children
|
|
279
|
+
}
|
|
280
|
+
)
|
|
281
|
+
] }) }), adaptContext = import_react.default.useContext(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
282
|
+
if (modal) {
|
|
283
|
+
const modalContents = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_portal.Portal, { zIndex, ...portalProps, children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ContainerComponent, { children: /* @__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 }) }) }) });
|
|
284
|
+
return import_constants.isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
288
285
|
}
|
|
289
|
-
|
|
286
|
+
return contents;
|
|
287
|
+
}
|
|
290
288
|
);
|
|
291
289
|
function getYPositions(mode, point, screenSize, frameSize) {
|
|
292
290
|
if (!screenSize || !frameSize) return 0;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetImplementationCustom.tsx"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC,2BACnC,0BAAgC,sCAChC,sBAAgC,kCAChC,mBAKO,+BACP,cAOO,0BACP,gBAAuB,4BACvB,8BAAmC,0CACnC,eAAkB,2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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": ["React", "position", "state", "pct"]
|
|
6
6
|
}
|
|
@@ -26,7 +26,7 @@ __export(SheetImplementationCustom_exports, {
|
|
|
26
26
|
SheetImplementationCustom: () => SheetImplementationCustom
|
|
27
27
|
});
|
|
28
28
|
module.exports = __toCommonJS(SheetImplementationCustom_exports);
|
|
29
|
-
var import_jsx_runtime = require("react/jsx-runtime"),
|
|
29
|
+
var import_jsx_runtime = require("react/jsx-runtime"), 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 = __toESM(require("react")), import_react_native = require("react-native"), import_contexts = require("./contexts"), import_helpers = require("./helpers"), import_SheetContext = require("./SheetContext"), import_useSheetOpenState = require("./useSheetOpenState"), import_useSheetProviderProps = require("./useSheetProviderProps"), hiddenSize = 10000.1, sheetHiddenStyleSheet = null, SheetImplementationCustom = /* @__PURE__ */ import_react.default.forwardRef(function(props, forwardedRef) {
|
|
30
30
|
var parentSheet = import_react.default.useContext(import_contexts.ParentSheetContext), { animation, animationConfig: animationConfigProp, modal = !1, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = !1, unmountChildrenWhenHidden = !1, portalProps, containerComponent: ContainerComponent = import_react.default.Fragment } = props, keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)(), state = (0, import_useSheetOpenState.useSheetOpenState)(props), [overlayComponent, setOverlayComponent] = import_react.default.useState(null), providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
31
31
|
onOverlayComponent: setOverlayComponent
|
|
32
32
|
}), { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps, { open, controller, isHidden } = state, sheetRef = import_react.default.useRef(null), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef), animationConfig = function() {
|
|
@@ -122,7 +122,7 @@ var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(re
|
|
|
122
122
|
scrollBridge.paneMinY = minY;
|
|
123
123
|
var startY = at.current;
|
|
124
124
|
function setPanning(val) {
|
|
125
|
-
setIsDragging(val),
|
|
125
|
+
setIsDragging(val), import_constants.isClient && (sheetHiddenStyleSheet || (sheetHiddenStyleSheet = document.createElement("style"), typeof document.head < "u" && document.head.appendChild(sheetHiddenStyleSheet)), val ? sheetHiddenStyleSheet.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : sheetHiddenStyleSheet.innerText = "");
|
|
126
126
|
}
|
|
127
127
|
var release = function(param) {
|
|
128
128
|
var { vy, dragAt } = param;
|
|
@@ -302,7 +302,7 @@ var import_jsx_runtime = require("react/jsx-runtime"), import_react = __toESM(re
|
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
return contents;
|
|
305
|
-
})
|
|
305
|
+
});
|
|
306
306
|
function getYPositions(mode, point, screenSize, frameSize) {
|
|
307
307
|
if (!screenSize || !frameSize) return 0;
|
|
308
308
|
if (mode === "mixed") {
|