@tamagui/core 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
@@ -5791,7 +5791,7 @@ var require_getSplitStyles_native = __commonJS({
5791
5791
  for (var keyOg in props) _loop(keyOg);
5792
5792
  process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
5793
5793
  var avoidNormalize = styleProps.noNormalize === !1;
5794
- if (debug && console.warn("?", avoidNormalize, styleProps.noExpand, styleProps.noMergeStyle, styleState.style), !avoidNormalize) {
5794
+ if (!avoidNormalize) {
5795
5795
  if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), !styleProps.noExpand && !styleProps.noMergeStyle && import_constants.isWeb && (!isReactNative || !animationDriver.supportsCSS) && (0, import_getCSSStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
5796
5796
  var _styleState;
5797
5797
  (_styleState = styleState).style || (_styleState.style = {}), mergeFlatTransforms(styleState.style, styleState.flatTransforms);
@@ -7636,10 +7636,10 @@ var require_createComponent_native = __commonJS({
7636
7636
  componentName2
7637
7637
  ]);
7638
7638
  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;
7639
- hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders && (0, import_constants.useIsomorphicLayoutEffect)(function() {
7639
+ if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
7640
7640
  var pendingState = NextState.get(stateRef);
7641
- pendingState && (setStateShallow(pendingState), NextState.set(stateRef, void 0));
7642
- });
7641
+ pendingState && (NextState.set(stateRef, void 0), componentState.setStateShallow(pendingState));
7642
+ }
7643
7643
  var allGroupContexts = (0, import_react3.useMemo)(function() {
7644
7644
  var _stateRef_current_group;
7645
7645
  if (!groupName || props.passThrough) return groupContextParent;
@@ -7756,34 +7756,33 @@ var require_createComponent_native = __commonJS({
7756
7756
  }
7757
7757
  }
7758
7758
  if (splitStyles && (hasAnimationProp || groupName) && animationDriver != null && animationDriver.avoidReRenders) {
7759
- var useStyleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
7760
- componentContext.mediaEmit = function(next) {
7761
- NextMedia.set(stateRef, next), updateStyleListener();
7762
- };
7763
- var updateStyleListener = function() {
7759
+ var _componentContext, ogSetStateShallow = setStateShallow;
7760
+ stateRef.current.updateStyleListener = function() {
7764
7761
  var updatedState = NextState.get(stateRef) || state, mediaState22 = NextMedia.get(stateRef), { group, hasDynGroupChildren, unmounted, animation, ...childrenGroupState } = updatedState;
7765
7762
  groupContext && notifyGroupSubscribers(groupContext, stateRef.current.group || null, childrenGroupState);
7766
7763
  var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, mediaState22 ? {
7767
7764
  ...styleProps,
7768
7765
  mediaState: mediaState22
7769
- } : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp);
7766
+ } : styleProps, null, componentContext, allGroupContexts, elementType, startedUnhydrated, debugProp), useStyleListener = stateRef.current.useStyleListener;
7770
7767
  useStyleListener == null || useStyleListener((nextStyles == null ? void 0 : nextStyles.style) || {});
7771
- };
7772
- stateRef.current.setStateShallow = function(nextOrGetNext) {
7768
+ }, (_componentContext = componentContext).mediaEmit || (_componentContext.mediaEmit = function(next) {
7769
+ var _stateRef_current_updateStyleListener, _stateRef_current;
7770
+ NextMedia.set(stateRef, next), (_stateRef_current_updateStyleListener = (_stateRef_current = stateRef.current).updateStyleListener) === null || _stateRef_current_updateStyleListener === void 0 || _stateRef_current_updateStyleListener.call(_stateRef_current);
7771
+ }), stateRef.current.setStateShallow = function(nextOrGetNext) {
7773
7772
  var prev = NextState.get(stateRef) || state, next = typeof nextOrGetNext == "function" ? nextOrGetNext(prev) : nextOrGetNext;
7774
7773
  if (!(next === prev || (0, import_is_equal_shallow.isEqualShallow)(prev, next))) {
7775
7774
  var canAvoidReRender = Object.keys(next).every(function(key3) {
7776
7775
  return avoidReRenderKeys.has(key3);
7777
7776
  });
7778
7777
  if (canAvoidReRender) {
7779
- var updatedState = {
7778
+ var _stateRef_current_updateStyleListener, _stateRef_current, updatedState = {
7780
7779
  ...prev,
7781
7780
  ...next
7782
7781
  };
7783
7782
  NextState.set(stateRef, updatedState), process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && (console.groupCollapsed("[\u26A1\uFE0F] avoid setState", next, {
7784
7783
  updatedState,
7785
7784
  props
7786
- }), console.info(stateRef.current.host), console.groupEnd()), updateStyleListener();
7785
+ }), 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);
7787
7786
  } else process.env.NODE_ENV === "development" && debugProp && debugProp !== "profile" && console.info("[\u{1F40C}] re-render", {
7788
7787
  canAvoidReRender,
7789
7788
  next