tamagui 1.88.21 → 1.88.22
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/native.js +9 -5
- package/dist/native.js.map +1 -1
- package/dist/test.native.js +9 -5
- package/dist/test.native.js.map +1 -1
- package/package.json +54 -54
package/dist/native.js
CHANGED
|
@@ -9843,7 +9843,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
9843
9843
|
module2.exports = __toCommonJS2(useSheetProviderProps_exports);
|
|
9844
9844
|
var import_core12 = require_index_native16(), import_use_constant = require_index_native2(), import_use_controllable_state = require_index_native9(), import_react2 = __toESM2(require("react"));
|
|
9845
9845
|
function useSheetProviderProps(props, state, options = {}) {
|
|
9846
|
-
let contentRef = import_react2.default.useRef(null), [frameSize, setFrameSize] = (0, import_react2.useState)(0), [maxContentSize, setMaxContentSize] = (0, import_react2.useState)(0), snapPointsMode = props.snapPointsMode ?? "percent", snapPointsProp = props.snapPoints ?? (snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"]), hasFit = snapPointsProp[0] === "fit", snapPoints = (0, import_react2.useMemo)(
|
|
9846
|
+
let handleRef = import_react2.default.useRef(null), contentRef = import_react2.default.useRef(null), [frameSize, setFrameSize] = (0, import_react2.useState)(0), [maxContentSize, setMaxContentSize] = (0, import_react2.useState)(0), snapPointsMode = props.snapPointsMode ?? "percent", snapPointsProp = props.snapPoints ?? (snapPointsMode === "percent" ? [80] : snapPointsMode === "constant" ? [256] : ["fit"]), hasFit = snapPointsProp[0] === "fit", snapPoints = (0, import_react2.useMemo)(
|
|
9847
9847
|
() => props.dismissOnSnapToBottom ? [...snapPointsProp, 0] : snapPointsProp,
|
|
9848
9848
|
[JSON.stringify(snapPointsProp), props.dismissOnSnapToBottom]
|
|
9849
9849
|
), [position_, setPositionImmediate] = (0, import_use_controllable_state.useControllableState)({
|
|
@@ -9909,6 +9909,7 @@ var require_useSheetProviderProps_native = __commonJS({
|
|
|
9909
9909
|
setOpen: state.setOpen,
|
|
9910
9910
|
hidden: !!state.isHidden,
|
|
9911
9911
|
contentRef,
|
|
9912
|
+
handleRef,
|
|
9912
9913
|
frameSize,
|
|
9913
9914
|
setFrameSize,
|
|
9914
9915
|
dismissOnOverlayPress: props.dismissOnOverlayPress ?? !0,
|
|
@@ -10213,7 +10214,9 @@ var require_SheetImplementationCustom_native = __commonJS({
|
|
|
10213
10214
|
vy: state2.vy,
|
|
10214
10215
|
dragAt: state2.dy
|
|
10215
10216
|
});
|
|
10216
|
-
}, previouslyScrolling = !1, onMoveShouldSet = (
|
|
10217
|
+
}, previouslyScrolling = !1, onMoveShouldSet = (e, { dy }) => {
|
|
10218
|
+
if (e.target === providerProps.handleRef.current)
|
|
10219
|
+
return !0;
|
|
10217
10220
|
let isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
|
|
10218
10221
|
return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !import_constants4.isWeb ? !1 : Math.abs(dy) > 5;
|
|
10219
10222
|
}, grant = () => {
|
|
@@ -10533,12 +10536,13 @@ var require_createSheet_native = __commonJS({
|
|
|
10533
10536
|
require("react/jsx-runtime")
|
|
10534
10537
|
);
|
|
10535
10538
|
function createSheet({ Handle, Frame, Overlay }) {
|
|
10536
|
-
let SheetHandle = Handle.
|
|
10537
|
-
({ __scopeSheet, ...props }) => {
|
|
10538
|
-
let context = (0, import_SheetContext.useSheetContext)(import_constants22.SHEET_HANDLE_NAME, __scopeSheet);
|
|
10539
|
+
let SheetHandle = Handle.styleable(
|
|
10540
|
+
({ __scopeSheet, ...props }, forwardedRef) => {
|
|
10541
|
+
let context = (0, import_SheetContext.useSheetContext)(import_constants22.SHEET_HANDLE_NAME, __scopeSheet), composedRef = (0, import_compose_refs.useComposedRefs)(context.handleRef, forwardedRef);
|
|
10539
10542
|
return context.onlyShowFrame ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
10540
10543
|
Handle,
|
|
10541
10544
|
{
|
|
10545
|
+
ref: composedRef,
|
|
10542
10546
|
onPress: () => {
|
|
10543
10547
|
let max2 = context.snapPoints.length + (context.dismissOnSnapToBottom ? -1 : 0), nextPos = (context.position + 1) % max2;
|
|
10544
10548
|
context.setPosition(nextPos);
|