tamagui 1.125.26 → 1.125.27

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 CHANGED
@@ -7787,9 +7787,6 @@ var require_Theme_native = __commonJS({
7787
7787
  if (import_constants4.isWeb) {
7788
7788
  var { className, style } = getThemeClassNameAndStyle(themeState, props, isRoot);
7789
7789
  if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7790
- ...process.env.NODE_ENV === "development" && {
7791
- "data-theme-id": themeState.id
7792
- },
7793
7790
  className: `${className} _dsp_contents is_Theme`,
7794
7791
  style,
7795
7792
  children
@@ -13331,7 +13328,12 @@ var require_getBaseViews_native = __commonJS({
13331
13328
  module2.exports = __toCommonJS2(getBaseViews_native_exports);
13332
13329
  function getBaseViews() {
13333
13330
  var native = require("react-native"), View2, TextAncestor;
13334
- return process.env.NODE_ENV !== "test" && (View2 = require("react-native/Libraries/Components/View/ViewNativeComponent").default, TextAncestor = require("react-native/Libraries/Text/TextAncestor")), View2 || (View2 = native.View || native.default.View), {
13331
+ if (process.env.NODE_ENV !== "test") {
13332
+ View2 = require("react-native/Libraries/Components/View/ViewNativeComponent").default;
13333
+ var TextAncestorModule = require("react-native/Libraries/Text/TextAncestor"), _TextAncestorModule_default;
13334
+ TextAncestor = (_TextAncestorModule_default = TextAncestorModule.default) !== null && _TextAncestorModule_default !== void 0 ? _TextAncestorModule_default : TextAncestor;
13335
+ }
13336
+ return View2 || (View2 = native.View || native.default.View), {
13335
13337
  View: View2,
13336
13338
  Text: native.Text || native.default.Text,
13337
13339
  StyleSheet: native.StyleSheet || native.default.StyleSheet,
@@ -16560,12 +16562,14 @@ var require_Portal_native = __commonJS({
16560
16562
  module2.exports = __toCommonJS2(Portal_native_exports);
16561
16563
  var import_jsx_runtime6 = require("react/jsx-runtime"), import_stacks3 = require_index_native22(), import_z_index_stack2 = require_index_native27(), React4 = __toESM2(require("react")), import_react_native4 = require("react-native"), import_constants4 = require_constants_native3(), import_GorhomPortalItem = require_GorhomPortalItem_native(), import_helpers = require_helpers_native(), createPortal = function() {
16562
16564
  if (import_constants4.IS_FABRIC) try {
16563
- return require("react-native/Libraries/Renderer/shims/ReactFabric").createPortal;
16565
+ var _ReactFabricShimModule_default, ReactFabricShimModule = require("react-native/Libraries/Renderer/shims/ReactFabric"), _ReactFabricShimModule_default_createPortal;
16566
+ return (_ReactFabricShimModule_default_createPortal = (_ReactFabricShimModule_default = ReactFabricShimModule.default) === null || _ReactFabricShimModule_default === void 0 ? void 0 : _ReactFabricShimModule_default.createPortal) !== null && _ReactFabricShimModule_default_createPortal !== void 0 ? _ReactFabricShimModule_default_createPortal : ReactFabricShimModule.createPortal;
16564
16567
  } catch (err) {
16565
16568
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
16566
16569
  }
16567
16570
  try {
16568
- return require("react-native/Libraries/Renderer/shims/ReactNative").createPortal;
16571
+ var _ReactNativeShimModule_default, ReactNativeShimModule = require("react-native/Libraries/Renderer/shims/ReactNative").createPortal, _ReactNativeShimModule_default_createPortal;
16572
+ return (_ReactNativeShimModule_default_createPortal = (_ReactNativeShimModule_default = ReactNativeShimModule.default) === null || _ReactNativeShimModule_default === void 0 ? void 0 : _ReactNativeShimModule_default.createPortal) !== null && _ReactNativeShimModule_default_createPortal !== void 0 ? _ReactNativeShimModule_default_createPortal : ReactNativeShimModule.createPortal;
16569
16573
  } catch (err) {
16570
16574
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
16571
16575
  }
@@ -17962,6 +17966,8 @@ var require_nativeSheet_native = __commonJS({
17962
17966
  }
17963
17967
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
17964
17968
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
17969
+ scrollEnabled: !0,
17970
+ setHasScrollView: emptyFn,
17965
17971
  ...providerProps,
17966
17972
  onlyShowFrame: !0,
17967
17973
  children: [
@@ -17994,6 +18000,8 @@ var require_nativeSheet_native = __commonJS({
17994
18000
  });
17995
18001
  });
17996
18002
  }
18003
+ var emptyFn = function() {
18004
+ };
17997
18005
  }
17998
18006
  });
17999
18007
 
@@ -18106,11 +18114,9 @@ var require_helpers_native2 = __commonJS({
18106
18114
  module2.exports = __toCommonJS2(helpers_exports);
18107
18115
  function resisted(y, minY) {
18108
18116
  var maxOverflow = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 25;
18109
- if (y < minY) {
18110
- var past = minY - y, pctPast = Math.min(maxOverflow, past) / maxOverflow, diminishBy = 1.1 - Math.pow(0.15, pctPast), extra = -diminishBy * maxOverflow;
18111
- return minY + extra;
18112
- }
18113
- return y;
18117
+ if (y >= minY) return y;
18118
+ var pastBoundary = minY - y, resistedDistance = Math.sqrt(pastBoundary) * 2;
18119
+ return minY - resistedDistance;
18114
18120
  }
18115
18121
  }
18116
18122
  });
@@ -18209,7 +18215,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18209
18215
  };
18210
18216
  }, [
18211
18217
  zIndex
18212
- ]), isMounted = (0, import_core12.useDidFinishSSR)(), startPosition = isMounted && screenSize ? screenSize : hiddenSize, animatedNumber = useAnimatedNumber(startPosition), at = import_react3.default.useRef(startPosition), hasntMeasured = at.current === hiddenSize, [disableAnimation, setDisableAnimation] = (0, import_react3.useState)(hasntMeasured);
18218
+ ]), isMounted = (0, import_core12.useDidFinishSSR)(), startPosition = isMounted && screenSize ? screenSize : hiddenSize, animatedNumber = useAnimatedNumber(startPosition), at = import_react3.default.useRef(startPosition), hasntMeasured = at.current === hiddenSize, [disableAnimation, setDisableAnimation] = (0, import_react3.useState)(hasntMeasured), hasScrollView = import_react3.default.useRef(!1);
18213
18219
  useAnimatedNumberReaction({
18214
18220
  value: animatedNumber,
18215
18221
  hostRef: sheetRef
@@ -18252,7 +18258,9 @@ var require_SheetImplementationCustom_native = __commonJS({
18252
18258
  open,
18253
18259
  position
18254
18260
  ]);
18255
- var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), panResponder = import_react3.default.useMemo(function() {
18261
+ var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), scrollEnabled = (0, import_react3.useRef)(!0), setScrollEnabled = import_react3.default.useCallback(function(val) {
18262
+ scrollEnabled.current = val;
18263
+ }, []), panResponder = import_react3.default.useMemo(function() {
18256
18264
  if (disableDrag || !frameSize || isShowingInnerSheet) return;
18257
18265
  var minY = positions[0];
18258
18266
  scrollBridge.paneMinY = minY;
@@ -18267,7 +18275,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18267
18275
  var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
18268
18276
  curDist < dist && (dist = curDist, closestPoint = i);
18269
18277
  }
18270
- setPosition(closestPoint), animateTo(closestPoint);
18278
+ setPosition(closestPoint), animateTo(closestPoint), setScrollEnabled(closestPoint === 0 && dragAt <= 0);
18271
18279
  }, finish = function(_e, state2) {
18272
18280
  release({
18273
18281
  vy: state2.vy,
@@ -18275,11 +18283,11 @@ var require_SheetImplementationCustom_native = __commonJS({
18275
18283
  });
18276
18284
  }, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
18277
18285
  var { dy } = param;
18278
- if (e.target === providerProps.handleRef.current) return !0;
18286
+ if (e.target === providerProps.handleRef.current || !scrollEnabled.current || !hasScrollView.current) return !0;
18279
18287
  var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
18280
- return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && !isScrolled && isDraggingUp && !import_constants4.isWeb ? !1 : Math.abs(dy) > 5;
18288
+ return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && scrollEnabled.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
18281
18289
  }, grant = function() {
18282
- setPanning(!0), stopSpring(), startY = at.current;
18290
+ setScrollEnabled(!1), setPanning(!0), stopSpring(), startY = at.current;
18283
18291
  }, isExternalDrag = !1;
18284
18292
  return scrollBridge.drag = function(dy) {
18285
18293
  isExternalDrag || (isExternalDrag = !0, grant());
@@ -18360,10 +18368,14 @@ var require_SheetImplementationCustom_native = __commonJS({
18360
18368
  }, [
18361
18369
  open
18362
18370
  ]);
18363
- var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants4.isWeb ? "dvh" : "%"}` : maxSnapPoint, contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_contexts.ParentSheetContext.Provider, {
18371
+ var forcedContentHeight = hasFit ? void 0 : snapPointsMode === "percent" ? `${maxSnapPoint}${import_constants4.isWeb ? "dvh" : "%"}` : maxSnapPoint, setHasScrollView = import_react3.default.useCallback(function(val) {
18372
+ hasScrollView.current = val;
18373
+ }, []), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_contexts.ParentSheetContext.Provider, {
18364
18374
  value: nextParentContext,
18365
18375
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
18366
18376
  ...providerProps,
18377
+ scrollEnabled: scrollEnabled.current,
18378
+ setHasScrollView,
18367
18379
  children: [
18368
18380
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
18369
18381
  custom: {
@@ -18620,14 +18632,20 @@ var require_SheetScrollView_native = __commonJS({
18620
18632
  });
18621
18633
  module2.exports = __toCommonJS2(SheetScrollView_exports);
18622
18634
  var import_jsx_runtime6 = require("react/jsx-runtime"), import_react3 = __toESM2(require("react")), import_compose_refs = require_index_native11(), import_scroll_view = require_index_native35(), import_SheetContext = require_SheetContext_native(), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react3.default.forwardRef(function(param, ref) {
18623
- var { __scopeSheet, children, onScroll, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge } = context, scrollRef = import_react3.default.useRef(null), state = import_react3.default.useRef({
18635
+ var { __scopeSheet, children, onScroll, scrollEnabled, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge, scrollEnabled: scrollEnabled_, setHasScrollView } = context, scrollRef = import_react3.default.useRef(null), state = import_react3.default.useRef({
18624
18636
  lastPageY: 0,
18625
18637
  dragAt: 0,
18626
18638
  dys: [],
18627
18639
  // store a few recent dys to get velocity on release
18628
18640
  isScrolling: !1,
18629
18641
  isDragging: !1
18630
- }), release = function() {
18642
+ });
18643
+ (0, import_react3.useEffect)(function() {
18644
+ return setHasScrollView(!0), function() {
18645
+ setHasScrollView(!1);
18646
+ };
18647
+ }, []);
18648
+ var release = function() {
18631
18649
  if (state.current.isDragging) {
18632
18650
  state.current.isDragging = !1, scrollBridge.scrollStartY = -1, state.current.isScrolling = !1;
18633
18651
  var vy = 0;
@@ -18642,14 +18660,17 @@ var require_SheetScrollView_native = __commonJS({
18642
18660
  vy
18643
18661
  });
18644
18662
  }
18645
- };
18663
+ }, scrollable = scrollEnabled ?? scrollEnabled_;
18646
18664
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
18647
18665
  ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
18648
18666
  flex: 1,
18649
18667
  scrollEventThrottle: 8,
18650
18668
  onResponderRelease: release,
18651
18669
  className: "_ovs-contain",
18652
- // scrollEnabled={scrollEnabled}
18670
+ scrollEnabled: scrollable,
18671
+ // {...(Platform.OS === 'android' && {
18672
+ // pointerEvents: scrollable ? undefined : 'none',
18673
+ // })}
18653
18674
  onScroll: function(e) {
18654
18675
  var { y } = e.nativeEvent.contentOffset;
18655
18676
  scrollBridge.y = y, y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
@@ -18661,11 +18682,11 @@ var require_SheetScrollView_native = __commonJS({
18661
18682
  // renderScrollComponent={Sheet.ScrollView}
18662
18683
  // ```
18663
18684
  onStartShouldSetResponder: function() {
18664
- return scrollBridge.scrollStartY = -1, state.current.isDragging = !0, !0;
18685
+ return scrollBridge.scrollStartY = -1, state.current.isDragging = !0, scrollable;
18665
18686
  },
18666
18687
  // setting to false while onResponderMove is disabled
18667
18688
  onMoveShouldSetResponder: function() {
18668
- return !1;
18689
+ return scrollable;
18669
18690
  },
18670
18691
  // somehow disabling works better, regression, no more nice drag continue scroll
18671
18692
  // onResponderMove={(e) => {
@@ -23087,9 +23108,7 @@ var require_Group_native = __commonJS({
23087
23108
  disable: disablePassBorderRadius
23088
23109
  }), _$props = {
23089
23110
  disabled,
23090
- ...(0, import_core12.isTamaguiElement)(child) ? radiusStyles : {
23091
- style: radiusStyles
23092
- }
23111
+ ...radiusStyles
23093
23112
  };
23094
23113
  return cloneElementWithPropOrder(child, _$props);
23095
23114
  }), indexedChildren = (0, import_useIndexedChildren.useIndexedChildren)((0, import_core12.spacedChildren)({
@@ -23132,15 +23151,10 @@ var require_Group_native = __commonJS({
23132
23151
  });
23133
23152
  }
23134
23153
  var GroupItem = /* @__PURE__ */ import_react3.default.forwardRef(function(props, _ref) {
23135
- var _children_props, { __scopeGroup, children, forcePlacement } = props, groupItemProps = useGroupItem({
23154
+ var { __scopeGroup, children, forcePlacement } = props, groupItemProps = useGroupItem({
23136
23155
  disabled: /* @__PURE__ */ import_react3.default.isValidElement(children) ? children.props.disabled : void 0
23137
23156
  }, forcePlacement, __scopeGroup);
23138
- return !/* @__PURE__ */ import_react3.default.isValidElement(children) || children.type === import_react3.default.Fragment ? children : (0, import_core12.isTamaguiElement)(children) ? /* @__PURE__ */ import_react3.default.cloneElement(children, groupItemProps) : /* @__PURE__ */ import_react3.default.cloneElement(children, {
23139
- style: {
23140
- ...(_children_props = children.props) === null || _children_props === void 0 ? void 0 : _children_props.style,
23141
- ...groupItemProps
23142
- }
23143
- });
23157
+ return !/* @__PURE__ */ import_react3.default.isValidElement(children) || children.type === import_react3.default.Fragment ? children : /* @__PURE__ */ import_react3.default.cloneElement(children, groupItemProps);
23144
23158
  }), useGroupItem = function(childrenProps, forcePlacement, __scopeGroup) {
23145
23159
  var treeIndex = (0, import_useIndexedChildren.useIndex)(), context = useGroupContext("GroupItem", __scopeGroup);
23146
23160
  if (import_react3.default.useEffect(function() {
@@ -23186,11 +23200,13 @@ var require_Group_native = __commonJS({
23186
23200
  borderBottomRightRadius: isLast && disable !== "bottom" && disable !== "end" ? radius : 0
23187
23201
  };
23188
23202
  }, cloneElementWithPropOrder = function(child, props) {
23189
- var next = (0, import_core12.mergeProps)(child.props, props, (0, import_core12.getConfig)().shorthands);
23190
23203
  return /* @__PURE__ */ import_react3.default.cloneElement({
23191
23204
  ...child,
23192
23205
  props: null
23193
- }, next);
23206
+ }, {
23207
+ ...child.props,
23208
+ ...props
23209
+ });
23194
23210
  };
23195
23211
  }
23196
23212
  });