@tamagui/sheet 1.61.3 → 1.62.1
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 +16 -30
- package/dist/cjs/Sheet.js.map +1 -1
- package/dist/cjs/Sheet.native.js +119 -0
- package/dist/cjs/Sheet.native.js.map +6 -0
- package/dist/cjs/SheetContext.js +7 -13
- package/dist/cjs/SheetContext.js.map +1 -1
- package/dist/cjs/SheetContext.native.js +36 -0
- package/dist/cjs/SheetContext.native.js.map +6 -0
- package/dist/cjs/SheetController.js +7 -15
- package/dist/cjs/SheetController.js.map +1 -1
- package/dist/cjs/SheetController.native.js +42 -0
- package/dist/cjs/SheetController.native.js.map +6 -0
- package/dist/cjs/SheetImplementationCustom.js +99 -240
- package/dist/cjs/SheetImplementationCustom.js.map +2 -2
- package/dist/cjs/SheetImplementationCustom.native.js +281 -0
- package/dist/cjs/SheetImplementationCustom.native.js.map +6 -0
- package/dist/cjs/SheetScrollView.js +18 -44
- package/dist/cjs/SheetScrollView.js.map +1 -1
- package/dist/cjs/SheetScrollView.native.js +69 -0
- package/dist/cjs/SheetScrollView.native.js.map +6 -0
- package/dist/cjs/constants.js +7 -17
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js +36 -0
- package/dist/cjs/constants.native.js.map +6 -0
- package/dist/cjs/contexts.js +6 -11
- package/dist/cjs/contexts.js.map +1 -1
- package/dist/cjs/contexts.native.js +31 -0
- package/dist/cjs/contexts.native.js.map +6 -0
- package/dist/cjs/createSheet.js +42 -90
- package/dist/cjs/createSheet.js.map +2 -2
- package/dist/cjs/createSheet.native.js +146 -0
- package/dist/cjs/createSheet.native.js.map +6 -0
- package/dist/cjs/helpers.js +6 -13
- package/dist/cjs/helpers.js.map +1 -1
- package/dist/cjs/helpers.native.js +32 -0
- package/dist/cjs/helpers.native.js.map +6 -0
- package/dist/cjs/index.js +6 -11
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +36 -0
- package/dist/cjs/index.native.js.map +6 -0
- package/dist/cjs/nativeSheet.js +25 -42
- package/dist/cjs/nativeSheet.js.map +1 -1
- package/dist/cjs/nativeSheet.native.js +55 -0
- package/dist/cjs/nativeSheet.native.js.map +6 -0
- package/dist/cjs/types.js +3 -6
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/types.native.js +15 -0
- package/dist/cjs/types.native.js.map +6 -0
- package/dist/cjs/useSheet.js +5 -9
- package/dist/cjs/useSheet.js.map +1 -1
- package/dist/cjs/useSheet.native.js +27 -0
- package/dist/cjs/useSheet.native.js.map +6 -0
- package/dist/cjs/useSheetController.js +8 -15
- package/dist/cjs/useSheetController.js.map +1 -1
- package/dist/cjs/useSheetController.native.js +39 -0
- package/dist/cjs/useSheetController.native.js.map +6 -0
- package/dist/cjs/useSheetOffscreenSize.js +13 -30
- package/dist/cjs/useSheetOffscreenSize.js.map +2 -2
- package/dist/cjs/useSheetOffscreenSize.native.js +48 -0
- package/dist/cjs/useSheetOffscreenSize.native.js.map +6 -0
- package/dist/cjs/useSheetOpenState.js +12 -21
- package/dist/cjs/useSheetOpenState.js.map +1 -1
- package/dist/cjs/useSheetOpenState.native.js +43 -0
- package/dist/cjs/useSheetOpenState.native.js.map +6 -0
- package/dist/cjs/useSheetProviderProps.js +44 -96
- package/dist/cjs/useSheetProviderProps.js.map +1 -1
- package/dist/cjs/useSheetProviderProps.native.js +116 -0
- package/dist/cjs/useSheetProviderProps.native.js.map +6 -0
- package/dist/esm/Sheet.js +9 -14
- package/dist/esm/Sheet.js.map +1 -1
- package/dist/esm/SheetContext.js +1 -2
- package/dist/esm/SheetContext.js.map +1 -1
- package/dist/esm/SheetController.js +2 -3
- package/dist/esm/SheetController.js.map +1 -1
- package/dist/esm/SheetImplementationCustom.js +95 -217
- package/dist/esm/SheetImplementationCustom.js.map +2 -2
- package/dist/esm/SheetScrollView.js +13 -31
- package/dist/esm/SheetScrollView.js.map +1 -1
- package/dist/esm/constants.js +2 -8
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/contexts.js +1 -2
- package/dist/esm/contexts.js.map +1 -1
- package/dist/esm/createSheet.js +38 -70
- package/dist/esm/createSheet.js.map +2 -2
- package/dist/esm/helpers.js +1 -4
- package/dist/esm/helpers.js.map +1 -1
- package/dist/esm/nativeSheet.js +20 -27
- package/dist/esm/nativeSheet.js.map +1 -1
- package/dist/esm/useSheetController.js +3 -6
- package/dist/esm/useSheetController.js.map +1 -1
- package/dist/esm/useSheetOffscreenSize.js +8 -21
- package/dist/esm/useSheetOffscreenSize.js.map +2 -2
- package/dist/esm/useSheetOpenState.js +6 -10
- package/dist/esm/useSheetOpenState.js.map +1 -1
- package/dist/esm/useSheetProviderProps.js +36 -79
- package/dist/esm/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/Sheet.js +9 -14
- package/dist/jsx/Sheet.js.map +1 -1
- package/dist/jsx/Sheet.native.js +95 -0
- package/dist/jsx/Sheet.native.js.map +6 -0
- package/dist/jsx/SheetContext.js +1 -2
- package/dist/jsx/SheetContext.js.map +1 -1
- package/dist/jsx/SheetContext.native.js +13 -0
- package/dist/jsx/SheetContext.native.js.map +6 -0
- package/dist/jsx/SheetController.js +1 -2
- package/dist/jsx/SheetController.js.map +1 -1
- package/dist/jsx/SheetController.native.js +23 -0
- package/dist/jsx/SheetController.native.js.map +6 -0
- package/dist/jsx/SheetImplementationCustom.js +90 -210
- package/dist/jsx/SheetImplementationCustom.js.map +2 -2
- package/dist/jsx/SheetImplementationCustom.native.js +288 -0
- package/dist/jsx/SheetImplementationCustom.native.js.map +6 -0
- package/dist/jsx/SheetScrollView.js +12 -30
- package/dist/jsx/SheetScrollView.js.map +1 -1
- package/dist/jsx/SheetScrollView.native.js +47 -0
- package/dist/jsx/SheetScrollView.native.js.map +6 -0
- package/dist/jsx/constants.js +2 -8
- package/dist/jsx/constants.js.map +1 -1
- package/dist/jsx/constants.native.js +11 -0
- package/dist/jsx/constants.native.js.map +6 -0
- package/dist/jsx/contexts.js +1 -2
- package/dist/jsx/contexts.js.map +1 -1
- package/dist/jsx/contexts.native.js +9 -0
- package/dist/jsx/contexts.native.js.map +6 -0
- package/dist/jsx/createSheet.js +30 -61
- package/dist/jsx/createSheet.js.map +2 -2
- package/dist/jsx/createSheet.native.js +128 -0
- package/dist/jsx/createSheet.native.js.map +6 -0
- package/dist/jsx/helpers.js +1 -4
- package/dist/jsx/helpers.js.map +1 -1
- package/dist/jsx/helpers.native.js +11 -0
- package/dist/jsx/helpers.native.js.map +6 -0
- package/dist/jsx/index.native.js +10 -0
- package/dist/jsx/index.native.js.map +6 -0
- package/dist/jsx/nativeSheet.js +21 -27
- package/dist/jsx/nativeSheet.js.map +1 -1
- package/dist/jsx/nativeSheet.native.js +40 -0
- package/dist/jsx/nativeSheet.native.js.map +6 -0
- package/dist/jsx/types.native.js +1 -0
- package/dist/jsx/types.native.js.map +6 -0
- package/dist/jsx/useSheet.native.js +6 -0
- package/dist/jsx/useSheet.native.js.map +6 -0
- package/dist/jsx/useSheetController.js +2 -5
- package/dist/jsx/useSheetController.js.map +1 -1
- package/dist/jsx/useSheetController.native.js +17 -0
- package/dist/jsx/useSheetController.native.js.map +6 -0
- package/dist/jsx/useSheetOffscreenSize.js +8 -21
- package/dist/jsx/useSheetOffscreenSize.js.map +2 -2
- package/dist/jsx/useSheetOffscreenSize.native.js +27 -0
- package/dist/jsx/useSheetOffscreenSize.native.js.map +6 -0
- package/dist/jsx/useSheetOpenState.js +5 -8
- package/dist/jsx/useSheetOpenState.js.map +1 -1
- package/dist/jsx/useSheetOpenState.native.js +23 -0
- package/dist/jsx/useSheetOpenState.native.js.map +6 -0
- package/dist/jsx/useSheetProviderProps.js +36 -79
- package/dist/jsx/useSheetProviderProps.js.map +1 -1
- package/dist/jsx/useSheetProviderProps.native.js +90 -0
- package/dist/jsx/useSheetProviderProps.native.js.map +6 -0
- package/package.json +14 -14
- package/src/SheetImplementationCustom.tsx +21 -3
- package/src/createSheet.tsx +21 -3
- package/types/Sheet.d.ts +2 -0
- package/types/Sheet.d.ts.map +1 -1
- package/types/SheetImplementationCustom.d.ts.map +1 -1
- package/types/createSheet.d.ts +22 -0
- package/types/createSheet.d.ts.map +1 -1
|
@@ -1,60 +1,37 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
5
|
var __export = (target, all) => {
|
|
7
6
|
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable:
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
10
|
for (let key of __getOwnPropNames(from))
|
|
13
|
-
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
12
|
return to;
|
|
17
13
|
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value:
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
19
15
|
var SheetImplementationCustom_exports = {};
|
|
20
16
|
__export(SheetImplementationCustom_exports, {
|
|
21
17
|
SheetImplementationCustom: () => SheetImplementationCustom
|
|
22
18
|
});
|
|
23
19
|
module.exports = __toCommonJS(SheetImplementationCustom_exports);
|
|
24
|
-
var import_jsx_runtime = require("react/jsx-runtime");
|
|
25
|
-
var import_adapt = require("@tamagui/adapt");
|
|
26
|
-
var import_animate_presence = require("@tamagui/animate-presence");
|
|
27
|
-
var import_compose_refs = require("@tamagui/compose-refs");
|
|
28
|
-
var import_core = require("@tamagui/core");
|
|
29
|
-
var import_portal = require("@tamagui/portal");
|
|
30
|
-
var import_use_keyboard_visible = require("@tamagui/use-keyboard-visible");
|
|
31
|
-
var import_react = require("react");
|
|
32
|
-
var import_react_native = require("react-native");
|
|
33
|
-
var import_constants = require("./constants");
|
|
34
|
-
var import_contexts = require("./contexts");
|
|
35
|
-
var import_helpers = require("./helpers");
|
|
36
|
-
var import_SheetContext = require("./SheetContext");
|
|
37
|
-
var import_useSheetOpenState = require("./useSheetOpenState");
|
|
38
|
-
var import_useSheetProviderProps = require("./useSheetProviderProps");
|
|
20
|
+
var import_adapt = require("@tamagui/adapt"), import_animate_presence = require("@tamagui/animate-presence"), import_compose_refs = require("@tamagui/compose-refs"), 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_constants = 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");
|
|
39
21
|
let hiddenSize = 10000.1;
|
|
40
22
|
const SheetImplementationCustom = (0, import_core.themeable)(
|
|
41
|
-
(0, import_react.forwardRef)(function
|
|
42
|
-
const parentSheet = (0, import_react.useContext)(import_contexts.ParentSheetContext)
|
|
43
|
-
|
|
44
|
-
animationConfig,
|
|
45
|
-
modal =
|
|
23
|
+
(0, import_react.forwardRef)(function(props, forwardedRef) {
|
|
24
|
+
const parentSheet = (0, import_react.useContext)(import_contexts.ParentSheetContext), {
|
|
25
|
+
animation,
|
|
26
|
+
animationConfig: animationConfigProp,
|
|
27
|
+
modal = !1,
|
|
46
28
|
zIndex = parentSheet.zIndex + 1,
|
|
47
|
-
moveOnKeyboardChange =
|
|
48
|
-
unmountChildrenWhenHidden =
|
|
29
|
+
moveOnKeyboardChange = !1,
|
|
30
|
+
unmountChildrenWhenHidden = !1,
|
|
49
31
|
portalProps
|
|
50
|
-
} = props
|
|
51
|
-
const keyboardIsVisible = (0, import_use_keyboard_visible.useKeyboardVisible)();
|
|
52
|
-
const state = (0, import_useSheetOpenState.useSheetOpenState)(props);
|
|
53
|
-
const [overlayComponent, setOverlayComponent] = (0, import_react.useState)(null);
|
|
54
|
-
const providerProps = (0, import_useSheetProviderProps.useSheetProviderProps)(props, state, {
|
|
32
|
+
} = 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, {
|
|
55
33
|
onOverlayComponent: setOverlayComponent
|
|
56
|
-
})
|
|
57
|
-
const {
|
|
34
|
+
}), {
|
|
58
35
|
frameSize,
|
|
59
36
|
setFrameSize,
|
|
60
37
|
snapPoints,
|
|
@@ -66,183 +43,113 @@ const SheetImplementationCustom = (0, import_core.themeable)(
|
|
|
66
43
|
screenSize,
|
|
67
44
|
setMaxContentSize,
|
|
68
45
|
maxSnapPoint
|
|
69
|
-
} = providerProps
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const onInnerSheet = (0, import_react.useCallback)((hasChild) => {
|
|
46
|
+
} = providerProps, { open, controller, isHidden } = state, sheetRef = (0, import_react.useRef)(null), ref = (0, import_compose_refs.useComposedRefs)(forwardedRef, sheetRef), animationConfig = (() => {
|
|
47
|
+
const [animationProp, animationPropConfig] = animation ? Array.isArray(animation) ? animation : [animation] : [];
|
|
48
|
+
return animationConfigProp ?? (animationProp ? {
|
|
49
|
+
...(0, import_core.getConfig)().animations.animations[animationProp],
|
|
50
|
+
...animationPropConfig
|
|
51
|
+
} : null);
|
|
52
|
+
})(), [isShowingInnerSheet, setIsShowingInnerSheet] = (0, import_react.useState)(!1), shouldHideParentSheet = !import_core.isWeb && modal && isShowingInnerSheet, parentSheetContext = (0, import_react.useContext)(import_contexts.SheetInsideSheetContext), onInnerSheet = (0, import_react.useCallback)((hasChild) => {
|
|
77
53
|
setIsShowingInnerSheet(hasChild);
|
|
78
|
-
}, [])
|
|
79
|
-
const positions = (0, import_react.useMemo)(
|
|
54
|
+
}, []), positions = (0, import_react.useMemo)(
|
|
80
55
|
() => snapPoints.map(
|
|
81
56
|
(point) => getYPositions(snapPointsMode, point, screenSize, frameSize)
|
|
82
57
|
),
|
|
83
58
|
[screenSize, frameSize, snapPoints, snapPointsMode]
|
|
84
|
-
);
|
|
85
|
-
const driver = (0, import_core.useAnimationDriver)();
|
|
86
|
-
const { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = driver;
|
|
87
|
-
const AnimatedView = driver.View;
|
|
59
|
+
), driver = (0, import_core.useAnimationDriver)(), { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = driver, AnimatedView = driver.View;
|
|
88
60
|
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
89
|
-
if (
|
|
90
|
-
return
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
parentSheetContext(false);
|
|
94
|
-
};
|
|
61
|
+
if (parentSheetContext && open)
|
|
62
|
+
return parentSheetContext(!0), () => {
|
|
63
|
+
parentSheetContext(!1);
|
|
64
|
+
};
|
|
95
65
|
}, [parentSheetContext, open]);
|
|
96
66
|
const nextParentContext = (0, import_react.useMemo)(
|
|
97
67
|
() => ({
|
|
98
68
|
zIndex
|
|
99
69
|
}),
|
|
100
70
|
[zIndex]
|
|
101
|
-
);
|
|
102
|
-
const animatedNumber = useAnimatedNumber(hiddenSize);
|
|
103
|
-
const at = (0, import_react.useRef)(hiddenSize);
|
|
71
|
+
), animatedNumber = useAnimatedNumber(hiddenSize), at = (0, import_react.useRef)(hiddenSize);
|
|
104
72
|
useAnimatedNumberReaction(
|
|
105
73
|
{
|
|
106
74
|
value: animatedNumber,
|
|
107
75
|
hostRef: sheetRef
|
|
108
76
|
},
|
|
109
77
|
(0, import_react.useCallback)((value) => {
|
|
110
|
-
|
|
111
|
-
return;
|
|
112
|
-
at.current = value;
|
|
113
|
-
scrollBridge.paneY = value;
|
|
78
|
+
driver.isReactNative && (at.current = value, scrollBridge.paneY = value);
|
|
114
79
|
}, [])
|
|
115
80
|
);
|
|
116
81
|
function stopSpring() {
|
|
117
|
-
animatedNumber.stop();
|
|
118
|
-
if (scrollBridge.onFinishAnimate) {
|
|
119
|
-
scrollBridge.onFinishAnimate();
|
|
120
|
-
scrollBridge.onFinishAnimate = void 0;
|
|
121
|
-
}
|
|
82
|
+
animatedNumber.stop(), scrollBridge.onFinishAnimate && (scrollBridge.onFinishAnimate(), scrollBridge.onFinishAnimate = void 0);
|
|
122
83
|
}
|
|
123
|
-
const hasntMeasured = at.current === hiddenSize
|
|
124
|
-
const animateTo = (0, import_core.useEvent)((position2) => {
|
|
84
|
+
const hasntMeasured = at.current === hiddenSize, animateTo = (0, import_core.useEvent)((position2) => {
|
|
125
85
|
if (frameSize === 0)
|
|
126
86
|
return;
|
|
127
87
|
let toValue = isHidden || position2 === -1 ? screenSize : positions[position2];
|
|
128
|
-
if (at.current
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
});
|
|
137
|
-
if (isHidden) {
|
|
138
|
-
return;
|
|
88
|
+
if (at.current !== toValue) {
|
|
89
|
+
if (at.current = toValue, stopSpring(), hasntMeasured || isHidden) {
|
|
90
|
+
if (animatedNumber.setValue(screenSize, {
|
|
91
|
+
type: "timing",
|
|
92
|
+
duration: 0
|
|
93
|
+
}), isHidden)
|
|
94
|
+
return;
|
|
95
|
+
toValue = positions[position2], at.current = toValue;
|
|
139
96
|
}
|
|
140
|
-
toValue
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
animatedNumber.setValue(toValue, {
|
|
144
|
-
type: "spring",
|
|
145
|
-
...animationConfig
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
149
|
-
if (screenSize && hasntMeasured) {
|
|
150
|
-
animatedNumber.setValue(screenSize, {
|
|
151
|
-
type: "timing",
|
|
152
|
-
duration: 0
|
|
97
|
+
animatedNumber.setValue(toValue, {
|
|
98
|
+
type: "spring",
|
|
99
|
+
...animationConfig
|
|
153
100
|
});
|
|
154
101
|
}
|
|
155
|
-
}
|
|
102
|
+
});
|
|
156
103
|
(0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
104
|
+
screenSize && hasntMeasured && animatedNumber.setValue(screenSize, {
|
|
105
|
+
type: "timing",
|
|
106
|
+
duration: 0
|
|
107
|
+
});
|
|
108
|
+
}, [hasntMeasured, screenSize]), (0, import_core.useIsomorphicLayoutEffect)(() => {
|
|
109
|
+
!frameSize || !screenSize || isHidden || hasntMeasured && !open || animateTo(position);
|
|
161
110
|
}, [isHidden, frameSize, screenSize, open, position]);
|
|
162
|
-
const disableDrag = props.disableDrag ??
|
|
163
|
-
const themeName = (0, import_core.useThemeName)();
|
|
164
|
-
const panResponder = (0, import_react.useMemo)(
|
|
111
|
+
const disableDrag = props.disableDrag ?? controller?.disableDrag, themeName = (0, import_core.useThemeName)(), panResponder = (0, import_react.useMemo)(
|
|
165
112
|
() => {
|
|
166
|
-
if (disableDrag)
|
|
167
|
-
return;
|
|
168
|
-
if (!frameSize)
|
|
169
|
-
return;
|
|
170
|
-
if (isShowingInnerSheet)
|
|
113
|
+
if (disableDrag || !frameSize || isShowingInnerSheet)
|
|
171
114
|
return;
|
|
172
115
|
const minY = positions[0];
|
|
173
116
|
scrollBridge.paneMinY = minY;
|
|
174
117
|
let startY = at.current;
|
|
175
118
|
function makeUnselectable(val) {
|
|
176
|
-
|
|
177
|
-
return;
|
|
178
|
-
if (!val) {
|
|
179
|
-
import_constants.SHEET_HIDDEN_STYLESHEET.innerText = "";
|
|
180
|
-
} else {
|
|
181
|
-
import_constants.SHEET_HIDDEN_STYLESHEET.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }";
|
|
182
|
-
}
|
|
119
|
+
import_constants.SHEET_HIDDEN_STYLESHEET && (val ? import_constants.SHEET_HIDDEN_STYLESHEET.innerText = ":root * { user-select: none !important; -webkit-user-select: none !important; }" : import_constants.SHEET_HIDDEN_STYLESHEET.innerText = "");
|
|
183
120
|
}
|
|
184
121
|
const release = ({ vy, dragAt }) => {
|
|
185
|
-
isExternalDrag =
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
const at2 = dragAt + startY;
|
|
189
|
-
const end = at2 + frameSize * vy * 0.2;
|
|
190
|
-
let closestPoint = 0;
|
|
191
|
-
let dist = Infinity;
|
|
122
|
+
isExternalDrag = !1, previouslyScrolling = !1, makeUnselectable(!1);
|
|
123
|
+
const end = dragAt + startY + frameSize * vy * 0.2;
|
|
124
|
+
let closestPoint = 0, dist = 1 / 0;
|
|
192
125
|
for (let i = 0; i < positions.length; i++) {
|
|
193
|
-
const position2 = positions[i];
|
|
194
|
-
|
|
195
|
-
if (curDist < dist) {
|
|
196
|
-
dist = curDist;
|
|
197
|
-
closestPoint = i;
|
|
198
|
-
}
|
|
126
|
+
const position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
|
|
127
|
+
curDist < dist && (dist = curDist, closestPoint = i);
|
|
199
128
|
}
|
|
200
|
-
setPosition(closestPoint);
|
|
201
|
-
|
|
202
|
-
};
|
|
203
|
-
const finish = (_e, state2) => {
|
|
129
|
+
setPosition(closestPoint), animateTo(closestPoint);
|
|
130
|
+
}, finish = (_e, state2) => {
|
|
204
131
|
release({
|
|
205
132
|
vy: state2.vy,
|
|
206
133
|
dragAt: state2.dy
|
|
207
134
|
});
|
|
208
135
|
};
|
|
209
|
-
let previouslyScrolling =
|
|
136
|
+
let previouslyScrolling = !1;
|
|
210
137
|
const onMoveShouldSet = (_e, { dy }) => {
|
|
211
|
-
const isScrolled = scrollBridge.y !== 0;
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
previouslyScrolling = true;
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
if (isNearTop) {
|
|
219
|
-
if (!isScrolled && isDraggingUp) {
|
|
220
|
-
return false;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return Math.abs(dy) > 5;
|
|
224
|
-
};
|
|
225
|
-
const grant = () => {
|
|
226
|
-
makeUnselectable(true);
|
|
227
|
-
stopSpring();
|
|
228
|
-
startY = at.current;
|
|
138
|
+
const isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
139
|
+
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp ? !1 : Math.abs(dy) > 5;
|
|
140
|
+
}, grant = () => {
|
|
141
|
+
makeUnselectable(!0), stopSpring(), startY = at.current;
|
|
229
142
|
};
|
|
230
|
-
let isExternalDrag =
|
|
231
|
-
scrollBridge.drag = (dy) => {
|
|
232
|
-
|
|
233
|
-
isExternalDrag = true;
|
|
234
|
-
grant();
|
|
235
|
-
}
|
|
143
|
+
let isExternalDrag = !1;
|
|
144
|
+
return scrollBridge.drag = (dy) => {
|
|
145
|
+
isExternalDrag || (isExternalDrag = !0, grant());
|
|
236
146
|
const to = dy + startY;
|
|
237
147
|
animatedNumber.setValue((0, import_helpers.resisted)(to, minY), { type: "direct" });
|
|
238
|
-
}
|
|
239
|
-
scrollBridge.release = release;
|
|
240
|
-
return import_react_native.PanResponder.create({
|
|
148
|
+
}, scrollBridge.release = release, import_react_native.PanResponder.create({
|
|
241
149
|
onMoveShouldSetPanResponder: onMoveShouldSet,
|
|
242
150
|
onPanResponderGrant: grant,
|
|
243
151
|
onPanResponderMove: (_e, { dy }) => {
|
|
244
|
-
const toFull = dy + startY;
|
|
245
|
-
const to = (0, import_helpers.resisted)(toFull, minY);
|
|
152
|
+
const toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
|
|
246
153
|
animatedNumber.setValue(to, { type: "direct" });
|
|
247
154
|
},
|
|
248
155
|
onPanResponderEnd: finish,
|
|
@@ -252,68 +159,43 @@ const SheetImplementationCustom = (0, import_core.themeable)(
|
|
|
252
159
|
},
|
|
253
160
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
254
161
|
[disableDrag, isShowingInnerSheet, animateTo, frameSize, positions, setPosition]
|
|
255
|
-
)
|
|
256
|
-
const handleAnimationViewLayout = (0, import_react.useCallback)(
|
|
162
|
+
), handleAnimationViewLayout = (0, import_react.useCallback)(
|
|
257
163
|
(e) => {
|
|
258
164
|
const next = (() => {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
if (import_core.isWeb && import_core.isTouchable && !open) {
|
|
262
|
-
_ += 100;
|
|
263
|
-
}
|
|
264
|
-
return _;
|
|
165
|
+
let _ = e.nativeEvent?.layout.height;
|
|
166
|
+
return import_core.isWeb && import_core.isTouchable && !open && (_ += 100), _;
|
|
265
167
|
})();
|
|
266
|
-
|
|
267
|
-
return;
|
|
268
|
-
setFrameSize(next);
|
|
168
|
+
next && setFrameSize(next);
|
|
269
169
|
},
|
|
270
170
|
[keyboardIsVisible]
|
|
271
|
-
)
|
|
272
|
-
const handleMaxContentViewLayout = (0, import_react.useCallback)(
|
|
171
|
+
), handleMaxContentViewLayout = (0, import_react.useCallback)(
|
|
273
172
|
(e) => {
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
if (!next)
|
|
277
|
-
return;
|
|
278
|
-
setMaxContentSize(next);
|
|
173
|
+
const next = e.nativeEvent?.layout.height;
|
|
174
|
+
next && setMaxContentSize(next);
|
|
279
175
|
},
|
|
280
176
|
[keyboardIsVisible]
|
|
281
|
-
)
|
|
282
|
-
const animatedStyle = useAnimatedNumberStyle(animatedNumber, (val) => {
|
|
177
|
+
), animatedStyle = useAnimatedNumberStyle(animatedNumber, (val) => {
|
|
283
178
|
"worklet";
|
|
284
|
-
const translateY = frameSize === 0 ? hiddenSize : val;
|
|
285
179
|
return {
|
|
286
|
-
transform: [{ translateY }]
|
|
180
|
+
transform: [{ translateY: frameSize === 0 ? hiddenSize : val }]
|
|
287
181
|
};
|
|
288
|
-
});
|
|
289
|
-
const sizeBeforeKeyboard = (0, import_react.useRef)(null);
|
|
182
|
+
}), sizeBeforeKeyboard = (0, import_react.useRef)(null);
|
|
290
183
|
(0, import_react.useEffect)(() => {
|
|
291
184
|
if (import_core.isWeb || !moveOnKeyboardChange)
|
|
292
185
|
return;
|
|
293
186
|
const keyboardDidShowListener = import_react_native.Keyboard.addListener("keyboardDidShow", (e) => {
|
|
294
|
-
|
|
295
|
-
return;
|
|
296
|
-
sizeBeforeKeyboard.current = animatedNumber.getValue();
|
|
297
|
-
animatedNumber.setValue(
|
|
187
|
+
sizeBeforeKeyboard.current === null && (sizeBeforeKeyboard.current = animatedNumber.getValue(), animatedNumber.setValue(
|
|
298
188
|
Math.max(animatedNumber.getValue() - e.endCoordinates.height, 0)
|
|
299
|
-
);
|
|
300
|
-
})
|
|
301
|
-
|
|
302
|
-
if (sizeBeforeKeyboard.current === null)
|
|
303
|
-
return;
|
|
304
|
-
animatedNumber.setValue(sizeBeforeKeyboard.current);
|
|
305
|
-
sizeBeforeKeyboard.current = null;
|
|
189
|
+
));
|
|
190
|
+
}), keyboardDidHideListener = import_react_native.Keyboard.addListener("keyboardDidHide", () => {
|
|
191
|
+
sizeBeforeKeyboard.current !== null && (animatedNumber.setValue(sizeBeforeKeyboard.current), sizeBeforeKeyboard.current = null);
|
|
306
192
|
});
|
|
307
193
|
return () => {
|
|
308
|
-
keyboardDidHideListener.remove();
|
|
309
|
-
keyboardDidShowListener.remove();
|
|
194
|
+
keyboardDidHideListener.remove(), keyboardDidShowListener.remove();
|
|
310
195
|
};
|
|
311
196
|
}, [moveOnKeyboardChange]);
|
|
312
197
|
const [opacity, setOpacity] = (0, import_react.useState)(open ? 1 : 0);
|
|
313
|
-
|
|
314
|
-
setOpacity(1);
|
|
315
|
-
}
|
|
316
|
-
(0, import_react.useEffect)(() => {
|
|
198
|
+
open && opacity === 0 && setOpacity(1), (0, import_react.useEffect)(() => {
|
|
317
199
|
if (!open) {
|
|
318
200
|
const tm = setTimeout(() => {
|
|
319
201
|
setOpacity(0);
|
|
@@ -323,8 +205,7 @@ const SheetImplementationCustom = (0, import_core.themeable)(
|
|
|
323
205
|
};
|
|
324
206
|
}
|
|
325
207
|
}, [open]);
|
|
326
|
-
const forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}%` : maxSnapPoint
|
|
327
|
-
const 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: [
|
|
208
|
+
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: [
|
|
328
209
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_animate_presence.AnimatePresence, { enterExitVariant: "open", children: shouldHideParentSheet || !open ? null : overlayComponent }),
|
|
329
210
|
snapPointsMode !== "percent" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
330
211
|
import_react_native.View,
|
|
@@ -346,10 +227,9 @@ const SheetImplementationCustom = (0, import_core.themeable)(
|
|
|
346
227
|
AnimatedView,
|
|
347
228
|
{
|
|
348
229
|
ref,
|
|
349
|
-
...panResponder
|
|
230
|
+
...panResponder?.panHandlers,
|
|
350
231
|
onLayout: handleAnimationViewLayout,
|
|
351
232
|
pointerEvents: open && !shouldHideParentSheet ? "auto" : "none",
|
|
352
|
-
animation: props.animation,
|
|
353
233
|
style: [
|
|
354
234
|
{
|
|
355
235
|
position: "absolute",
|
|
@@ -364,15 +244,10 @@ const SheetImplementationCustom = (0, import_core.themeable)(
|
|
|
364
244
|
children: props.children
|
|
365
245
|
}
|
|
366
246
|
)
|
|
367
|
-
] }) });
|
|
368
|
-
const adaptContext = (0, import_react.useContext)(import_adapt.AdaptParentContext);
|
|
369
|
-
const shouldMountChildren = Boolean(opacity || !unmountChildrenWhenHidden);
|
|
247
|
+
] }) }), adaptContext = (0, import_react.useContext)(import_adapt.AdaptParentContext), shouldMountChildren = !!(opacity || !unmountChildrenWhenHidden);
|
|
370
248
|
if (modal) {
|
|
371
|
-
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:
|
|
372
|
-
|
|
373
|
-
return modalContents;
|
|
374
|
-
}
|
|
375
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
249
|
+
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 }) }) });
|
|
250
|
+
return import_core.isWeb ? modalContents : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_contexts.SheetInsideSheetContext.Provider, { value: onInnerSheet, children: modalContents });
|
|
376
251
|
}
|
|
377
252
|
return contents;
|
|
378
253
|
})
|
|
@@ -381,38 +256,22 @@ function getYPositions(mode, point, screenSize, frameSize) {
|
|
|
381
256
|
if (!screenSize || !frameSize)
|
|
382
257
|
return 0;
|
|
383
258
|
if (mode === "mixed") {
|
|
384
|
-
if (typeof point
|
|
259
|
+
if (typeof point == "number")
|
|
385
260
|
return screenSize - Math.min(screenSize, Math.max(0, point));
|
|
386
|
-
|
|
387
|
-
if (point === "fit") {
|
|
261
|
+
if (point === "fit")
|
|
388
262
|
return screenSize - frameSize;
|
|
389
|
-
}
|
|
390
263
|
if (point.endsWith("%")) {
|
|
391
264
|
const pct2 = Math.min(100, Math.max(0, Number(point.slice(0, -1)))) / 100;
|
|
392
|
-
|
|
393
|
-
console.warn("Invalid snapPoint percentage string");
|
|
394
|
-
return 0;
|
|
395
|
-
}
|
|
396
|
-
const next = Math.round(screenSize - pct2 * screenSize);
|
|
397
|
-
return next;
|
|
265
|
+
return Number.isNaN(pct2) ? (console.warn("Invalid snapPoint percentage string"), 0) : Math.round(screenSize - pct2 * screenSize);
|
|
398
266
|
}
|
|
399
|
-
console.warn("Invalid snapPoint unknown value");
|
|
400
|
-
return 0;
|
|
401
|
-
}
|
|
402
|
-
if (mode === "fit") {
|
|
403
|
-
if (point === 0)
|
|
404
|
-
return screenSize;
|
|
405
|
-
return screenSize - Math.min(screenSize, frameSize);
|
|
267
|
+
return console.warn("Invalid snapPoint unknown value"), 0;
|
|
406
268
|
}
|
|
407
|
-
if (mode === "
|
|
269
|
+
if (mode === "fit")
|
|
270
|
+
return point === 0 ? screenSize : screenSize - Math.min(screenSize, frameSize);
|
|
271
|
+
if (mode === "constant" && typeof point == "number")
|
|
408
272
|
return screenSize - Math.min(screenSize, Math.max(0, point));
|
|
409
|
-
}
|
|
410
273
|
const pct = Math.min(100, Math.max(0, Number(point))) / 100;
|
|
411
|
-
|
|
412
|
-
console.warn("Invalid snapPoint percentage");
|
|
413
|
-
return 0;
|
|
414
|
-
}
|
|
415
|
-
return Math.round(screenSize - pct * screenSize);
|
|
274
|
+
return Number.isNaN(pct) ? (console.warn("Invalid snapPoint percentage"), 0) : Math.round(screenSize - pct * screenSize);
|
|
416
275
|
}
|
|
417
276
|
// Annotate the CommonJS export names for ESM import in node:
|
|
418
277
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/SheetImplementationCustom.tsx"],
|
|
4
|
-
"mappings": "
|
|
5
|
-
"names": ["
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAmC,2BACnC,0BAAgC,sCAChC,sBAAgC,kCAChC,cAUO,0BACP,gBAAuB,4BACvB,8BAAmC,0CACnC,eAQO,kBACP,sBAQO,yBAEP,mBAAwC,wBACxC,kBAA4D,uBAC5D,iBAAyB,sBACzB,sBAA8B,2BAE9B,2BAAkC,gCAClC,+BAAsC,oCA8W9B;AA5WR,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,Y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