tamagui 1.132.1 → 1.132.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.
package/dist/native.js CHANGED
@@ -6894,7 +6894,7 @@ var require_getSplitStyles_native = __commonJS({
6894
6894
  for (var keyOg in props) _loop(keyOg);
6895
6895
  process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
6896
6896
  var avoidNormalize = styleProps.noNormalize === !1;
6897
- if (debug && console.warn("?", avoidNormalize, styleProps.noExpand, styleProps.noMergeStyle, styleState.style), !avoidNormalize) {
6897
+ if (!avoidNormalize) {
6898
6898
  if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants4.isWeb && (!isReactNative || !animationDriver.supportsCSS) && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
6899
6899
  var _styleState;
6900
6900
  (_styleState = styleState).style || (_styleState.style = {}), mergeFlatTransforms(styleState.style, styleState.flatTransforms);
@@ -8739,10 +8739,10 @@ var require_createComponent_native = __commonJS({
8739
8739
  componentName2
8740
8740
  ]);
8741
8741
  var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), groupContextParent = import_react3.default.useContext(import_GroupContext.GroupContext), animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, componentState = (0, import_useComponentState.useComponentState)(props, animationDriver, staticConfig, config), { disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, noClass, state, stateRef, supportsCSS, willBeAnimated, willBeAnimatedClient, startedUnhydrated } = componentState;
8742
- hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8742
+ if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
8743
8743
  var pendingState = NextState.get(stateRef);
8744
- pendingState && (setStateShallow(pendingState), NextState.set(stateRef, void 0));
8745
- });
8744
+ pendingState && (NextState.set(stateRef, void 0), componentState.setStateShallow(pendingState));
8745
+ }
8746
8746
  var allGroupContexts = (0, import_react3.useMemo)(function() {
8747
8747
  var _stateRef_current_group;
8748
8748
  if (!groupName || props.passThrough) return groupContextParent;
@@ -8859,34 +8859,33 @@ var require_createComponent_native = __commonJS({
8859
8859
  }
8860
8860
  }
8861
8861
  if (splitStyles && (hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
8862
- var useStyleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8863
- componentContext.mediaEmit = function(next) {
8864
- NextMedia.set(stateRef, next), updateStyleListener();
8865
- };
8866
- var updateStyleListener = function() {
8862
+ var _componentContext, ogSetStateShallow = setStateShallow;
8863
+ stateRef.current.updateStyleListener = function() {
8867
8864
  var updatedState = NextState.get(stateRef) || state, mediaState22 = NextMedia.get(stateRef), { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
8868
8865
  groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
8869
8866
  var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, mediaState22 ? {
8870
8867
  ...styleProps,
8871
8868
  mediaState: mediaState22
8872
- } : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
8869
+ } : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), useStyleListener = stateRef.current.useStyleListener;
8873
8870
  useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
8874
- };
8875
- stateRef.current.setStateShallow = function(nextOrGetNext) {
8871
+ }, (_componentContext = componentContext).mediaEmit || (_componentContext.mediaEmit = function(next) {
8872
+ var _stateRef_current_updateStyleListener, _stateRef_current;
8873
+ NextMedia.set(stateRef, next), (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
8874
+ }), stateRef.current.setStateShallow = function(nextOrGetNext) {
8876
8875
  var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
8877
8876
  if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
8878
8877
  var canAvoidReRender = Object.keys(next).every(function(key3) {
8879
8878
  return avoidReRenderKeys.has(key3);
8880
8879
  });
8881
8880
  if (canAvoidReRender) {
8882
- var updatedState = {
8881
+ var _stateRef_current_updateStyleListener, _stateRef_current, updatedState = {
8883
8882
  ...prev,
8884
8883
  ...next
8885
8884
  };
8886
8885
  NextState.set(stateRef, updatedState), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
8887
8886
  updatedState,
8888
8887
  props
8889
- }), console.info(stateRef.current.host), console.groupEnd()), updateStyleListener();
8888
+ }), console.info(stateRef.current.host), console.groupEnd()), (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
8890
8889
  } else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
8891
8890
  canAvoidReRender,
8892
8891
  next