@tamagui/core 1.95.0 → 1.95.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.
@@ -8353,15 +8353,15 @@ var require_createComponent_native = __commonJS({
8353
8353
  Unspaced: function() {
8354
8354
  return Unspaced;
8355
8355
  },
8356
+ componentSetStates: function() {
8357
+ return componentSetStates;
8358
+ },
8356
8359
  createComponent: function() {
8357
8360
  return createComponent;
8358
8361
  },
8359
8362
  isDisabled: function() {
8360
8363
  return isDisabled;
8361
8364
  },
8362
- mouseUps: function() {
8363
- return mouseUps;
8364
- },
8365
8365
  spacedChildren: function() {
8366
8366
  return spacedChildren;
8367
8367
  },
@@ -8488,11 +8488,16 @@ var require_createComponent_native = __commonJS({
8488
8488
  return _array_like_to_array(o, minLen);
8489
8489
  }
8490
8490
  }
8491
- var mouseUps = /* @__PURE__ */ new Set();
8491
+ var componentSetStates = /* @__PURE__ */ new Set();
8492
8492
  (typeof document > "u" ? "undefined" : _type_of(document)) < "u" && (cancelTouches = function() {
8493
- mouseUps.forEach(function(x) {
8494
- return x();
8495
- }), mouseUps.clear();
8493
+ componentSetStates.forEach(function(setState) {
8494
+ return setState(function(prev) {
8495
+ return prev.press || prev.pressIn ? _object_spread_props(_object_spread2({}, prev), {
8496
+ press: !1,
8497
+ pressIn: !1
8498
+ }) : prev;
8499
+ });
8500
+ }), componentSetStates.clear();
8496
8501
  }, addEventListener("mouseup", cancelTouches), addEventListener("touchend", cancelTouches), addEventListener("touchcancel", cancelTouches));
8497
8502
  var cancelTouches, useComponentState = function(props, param, staticConfig, config) {
8498
8503
  var animationDriver = param.animationDriver, groups = param.groups, _animationDriver_usePresence, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)({}), hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
@@ -8709,14 +8714,12 @@ var require_createComponent_native = __commonJS({
8709
8714
  })), viewProps = ((_hooks_usePropsTransform = import_setupHooks.hooks.usePropsTransform) === null || _hooks_usePropsTransform === void 0 ? void 0 : _hooks_usePropsTransform.call(import_setupHooks.hooks, elementType, nonTamaguiProps, stateRef, curStateRef.willHydrate)) || nonTamaguiProps, curStateRef.composedRef || (curStateRef.composedRef = (0, import_compose_refs.composeRefs)(function(x) {
8710
8715
  return stateRef.current.host = x;
8711
8716
  }, forwardedRef)), viewProps.ref = curStateRef.composedRef;
8712
- var pseudoGroups = splitStyles.pseudoGroups, mediaGroups = splitStyles.mediaGroups;
8713
- curStateRef.unPress || (curStateRef.unPress = function() {
8717
+ var pseudoGroups = splitStyles.pseudoGroups, mediaGroups = splitStyles.mediaGroups, unPress = function() {
8714
8718
  return setStateShallow({
8715
8719
  press: !1,
8716
8720
  pressIn: !1
8717
8721
  });
8718
- });
8719
- var unPress = curStateRef.unPress;
8722
+ };
8720
8723
  (0, import_react3.useEffect)(function() {
8721
8724
  if (!disabled) {
8722
8725
  if (state.unmounted) {
@@ -8734,7 +8737,7 @@ var require_createComponent_native = __commonJS({
8734
8737
  pseudoGroups
8735
8738
  });
8736
8739
  return function() {
8737
- dispose == null || dispose(), mouseUps.delete(unPress);
8740
+ dispose == null || dispose(), componentSetStates.delete(setState);
8738
8741
  };
8739
8742
  }
8740
8743
  }, [
@@ -8753,14 +8756,14 @@ var require_createComponent_native = __commonJS({
8753
8756
  },
8754
8757
  onMouseLeave: function(e) {
8755
8758
  var next = {};
8756
- mouseUps.add(unPress), needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
8759
+ needsHoverState && (next.hover = !1), needsPressState && state.pressIn && (next.press = !1, next.pressIn = !1), setStateShallow(next), onHoverOut == null || onHoverOut(e), onMouseLeave == null || onMouseLeave(e);
8757
8760
  }
8758
8761
  }), {
8759
8762
  onPressIn: attachPress ? function(e) {
8760
8763
  (runtimePressStyle || groupName) && setStateShallow({
8761
8764
  press: !0,
8762
8765
  pressIn: !0
8763
- }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && mouseUps.add(unPress);
8766
+ }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants.isWeb && componentSetStates.add(setState);
8764
8767
  } : void 0,
8765
8768
  onPress: attachPress ? function(e) {
8766
8769
  unPress(), import_constants.isWeb && (onClick == null || onClick(e)), onPress == null || onPress(e);