@tamagui/core 1.127.1 → 1.127.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.
@@ -1049,7 +1049,6 @@ var require_constants_native2 = __commonJS({
1049
1049
  alignItems: "stretch",
1050
1050
  flexDirection: "column",
1051
1051
  flexBasis: "auto",
1052
- // @ts-expect-error
1053
1052
  boxSizing: "border-box",
1054
1053
  position: process.env.TAMAGUI_POSITION_STATIC === "1" ? "static" : "relative",
1055
1054
  minHeight: 0,
@@ -5023,7 +5022,7 @@ var require_getSplitStyles_native = __commonJS({
5023
5022
  function isValidStyleKey(key, validStyles2, accept) {
5024
5023
  return key in validStyles2 ? !0 : accept && key in accept;
5025
5024
  }
5026
- var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, context, elementType, startedUnhydrated, debug) {
5025
+ var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, elementType, startedUnhydrated, debug) {
5027
5026
  var _loop = function(keyOg2) {
5028
5027
  var keyInit = keyOg2, valInit = props[keyInit];
5029
5028
  if (keyInit === "children") return viewProps[keyInit] = valInit, "continue";
@@ -5057,7 +5056,7 @@ var require_getSplitStyles_native = __commonJS({
5057
5056
  parts.length === 2 || parts.length === 3 && import_pseudoDescriptors.pseudoPriorities[parts[parts.length - 1]]
5058
5057
  ) {
5059
5058
  var name2 = parts[1];
5060
- context != null && context.groups.subscribe && !(context != null && context.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
5059
+ componentContext != null && componentContext.groups.subscribe && !(componentContext != null && componentContext.groups.state[name2]) && (keyInit = keyInit.replace("$group-", "$group-true-"));
5061
5060
  }
5062
5061
  }
5063
5062
  var isStyleProp = isValidStyleKeyInit || isMediaOrPseudo || isVariant && !noExpand;
@@ -5200,7 +5199,7 @@ var require_getSplitStyles_native = __commonJS({
5200
5199
  }
5201
5200
  } else if (!(themeName === mediaKeyShort || themeName.startsWith(mediaKeyShort))) return;
5202
5201
  } else if (isGroupMedia) {
5203
- var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = context == null ? void 0 : context.groups.state[groupName];
5202
+ var _componentState_group, groupInfo = (0, import_getGroupPropParts.getGroupPropParts)(mediaKeyShort), groupName = groupInfo.name, groupContext = componentContext == null ? void 0 : componentContext.groups.state[groupName];
5204
5203
  if (!groupContext)
5205
5204
  return;
5206
5205
  var groupPseudoKey = groupInfo.pseudo, groupMediaKey = groupInfo.media, componentGroupState = (_componentState_group = componentState.group) === null || _componentState_group === void 0 ? void 0 : _componentState_group[groupName];
@@ -5216,7 +5215,7 @@ var require_getSplitStyles_native = __commonJS({
5216
5215
  if (groupPseudoKey) {
5217
5216
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
5218
5217
  var componentGroupPseudoState = (componentGroupState || // fallback to context initially
5219
- context.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
5218
+ componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
5220
5219
  if (!isActive1) {
5221
5220
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
5222
5221
  return;
@@ -5244,7 +5243,9 @@ var require_getSplitStyles_native = __commonJS({
5244
5243
  }
5245
5244
  });
5246
5245
  };
5247
- conf = conf || (0, import_config.getConfig)(), import_constants2.isWeb && styleProps.isAnimated && conf.animations.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
5246
+ conf = conf || (0, import_config.getConfig)();
5247
+ var animationDriver = (componentContext == null ? void 0 : componentContext.animationDriver) || conf.animations;
5248
+ import_constants2.isWeb && styleProps.isAnimated && animationDriver.isReactNative && !styleProps.noNormalize && (styleProps.noNormalize = "values");
5248
5249
  var { shorthands } = conf, { isHOC, isText, isInput, variants, isReactNative, inlineProps, inlineWhenUnflattened, parentStaticConfig, acceptsClassName } = staticConfig, viewProps = {}, mediaState2 = styleProps.mediaState || import_useMedia.mediaState, usedKeys = {}, shouldDoClasses = acceptsClassName && import_constants2.isWeb && !styleProps.noClass, rulesToInsert = void 0, classNames = {}, pseudos = null, space = props.space, hasMedia = !1, dynamicThemeAccess, pseudoGroups, mediaGroups, className = props.className || "", mediaStylesSeen = 0, validStyles2 = staticConfig.validStyles || (staticConfig.isText || staticConfig.isInput ? import_helpers2.stylePropsText : import_helpers2.validStyles), styleState = {
5249
5250
  classNames,
5250
5251
  conf,
@@ -5256,7 +5257,7 @@ var require_getSplitStyles_native = __commonJS({
5256
5257
  theme,
5257
5258
  usedKeys,
5258
5259
  viewProps,
5259
- context,
5260
+ context: componentContext,
5260
5261
  debug
5261
5262
  };
5262
5263
  if (process.env.IS_STATIC === "is_static") {
@@ -5335,7 +5336,7 @@ var require_getSplitStyles_native = __commonJS({
5335
5336
  var style2 = styleState.style;
5336
5337
  if (0) {
5337
5338
  var _staticConfig_defaultProps, fontFamily, fontFamilyClassName, groupClassName, componentNameFinal, componentClassName, classList, finalClassName;
5338
- if (!(styleProps.isAnimated && !conf.animations.supportsCSSVars && isReactNative) && isReactNative) {
5339
+ if (!(styleProps.isAnimated && !animationDriver.supportsCSSVars && isReactNative) && isReactNative) {
5339
5340
  var cnStyles, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1;
5340
5341
  try {
5341
5342
  for (var _iterator1, _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = !0) var name;
@@ -6694,8 +6695,12 @@ var require_useComponentState_native = __commonJS({
6694
6695
  });
6695
6696
  },
6696
6697
  subscribe(cb) {
6697
- return listeners.add(cb), function() {
6698
- listeners.delete(cb);
6698
+ return listeners.add(cb), setStateShallow({
6699
+ hasDynGroupChildren: !0
6700
+ }), function() {
6701
+ listeners.delete(cb), listeners.size === 0 && setStateShallow({
6702
+ hasDynGroupChildren: !1
6703
+ });
6699
6704
  };
6700
6705
  }
6701
6706
  };
@@ -7110,7 +7115,7 @@ var require_createComponent_native = __commonJS({
7110
7115
  return stateRef.current.host = x;
7111
7116
  }, forwardedRef, import_setElementProps.setElementProps)), viewProps.ref = curStateRef.composedRef;
7112
7117
  var { pseudoGroups, mediaGroups } = splitStyles, unPress = function() {
7113
- return setStateShallow({
7118
+ setStateShallow({
7114
7119
  press: !1,
7115
7120
  pressIn: !1
7116
7121
  });
@@ -7176,7 +7181,7 @@ var require_createComponent_native = __commonJS({
7176
7181
  groupName,
7177
7182
  state
7178
7183
  ]);
7179
- var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle), events = shouldAttach ? {
7184
+ var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), hasDynamicGroupChildren = !!(groupName && state.hasDynGroupChildren), attachPress = !!(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(hasDynamicGroupChildren || runtimeHoverStyle), attachHover = import_constants2.isWeb && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(hasDynamicGroupChildren || runtimePressStyle), events = shouldAttach ? {
7180
7185
  onPressOut: attachPress ? function(e) {
7181
7186
  unPress(), onPressOut == null || onPressOut(e), onMouseUp == null || onMouseUp(e);
7182
7187
  } : void 0,
@@ -7191,7 +7196,7 @@ var require_createComponent_native = __commonJS({
7191
7196
  }
7192
7197
  },
7193
7198
  onPressIn: attachPress ? function(e) {
7194
- (runtimePressStyle || groupName) && setStateShallow({
7199
+ needsPressState && setStateShallow({
7195
7200
  press: !0,
7196
7201
  pressIn: !0
7197
7202
  }), onPressIn == null || onPressIn(e), onMouseDown == null || onMouseDown(e), import_constants2.isWeb && componentSetStates.add(setState);