@tamagui/core 1.129.12-1751358691172 → 1.129.12-1751386794649

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
@@ -5542,7 +5542,9 @@ var require_getSplitStyles_native = __commonJS({
5542
5542
  if (groupMediaKey) {
5543
5543
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
5544
5544
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
5545
- if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`), !isActive) {
5545
+ if (!mediaState1 && groupContext.layout && (isActive = (0, import_useMedia.mediaKeyMatch)(groupMediaKey, groupContext.layout)), process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP media ${groupMediaKey} active? ${isActive}`, {
5546
+ ...mediaState1
5547
+ }), !isActive) {
5546
5548
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
5547
5549
  return;
5548
5550
  }
@@ -5552,7 +5554,9 @@ var require_getSplitStyles_native = __commonJS({
5552
5554
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
5553
5555
  var componentGroupPseudoState = (componentGroupState || // fallback to context initially
5554
5556
  componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
5555
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
5557
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`, {
5558
+ ...componentGroupPseudoState
5559
+ }), !isActive1) {
5556
5560
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
5557
5561
  return;
5558
5562
  }
@@ -6017,23 +6021,20 @@ var require_index_native6 = __commonJS({
6017
6021
  });
6018
6022
  module2.exports = __toCommonJS2(index_exports2);
6019
6023
  var import_react3 = require("react");
6020
- function useCreateShallowSetState(setter, debugIn) {
6024
+ function useCreateShallowSetState(setter, debug) {
6021
6025
  return (0, import_react3.useCallback)(function(next) {
6022
6026
  setter(function(prev) {
6023
- return mergeIfNotShallowEqual(prev, next, debugIn);
6027
+ var update = mergeIfNotShallowEqual(prev, next);
6028
+ if (process.env.NODE_ENV === "development" && debug && update !== prev && (console.groupCollapsed("setStateShallow CHANGE", prev, "=>", update), console.trace(), console.groupEnd(), debug === "break")) debugger;
6029
+ return update;
6024
6030
  });
6025
6031
  }, [
6026
6032
  setter,
6027
- debugIn
6033
+ debug
6028
6034
  ]);
6029
6035
  }
6030
- function mergeIfNotShallowEqual(prev, next, debug) {
6031
- if (!prev || !next || isEqualShallow(prev, next)) return prev || next;
6032
- if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
6033
- prev,
6034
- next
6035
- }), debug === "break")) debugger;
6036
- return {
6036
+ function mergeIfNotShallowEqual(prev, next) {
6037
+ return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
6037
6038
  ...prev,
6038
6039
  ...next
6039
6040
  };
@@ -6206,7 +6207,7 @@ var require_useThemeState_native = __commonJS({
6206
6207
  var _keys_current, _props_needsUpdate, local = localStates.get(id), needsUpdate = isRoot || props.name === "light" || props.name === "dark" || props.name === null ? !0 : HasRenderedOnce.get(keys) ? !(keys == null || (_keys_current = keys.current) === null || _keys_current === void 0) && _keys_current.size ? !0 : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props) : !0, [rerender, next] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
6207
6208
  return PendingUpdate.delete(id), (!local || rerender) && (local = {
6208
6209
  ...next
6209
- }, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id} \u{1FA84} ${rerender}`, local.name, ">", next.name), console.info({
6210
+ }, localStates.set(id, local)), process.env.NODE_ENV === "development" && props.debug && props.debug !== "profile" && (console.groupCollapsed(` ${id} getSnapshot ${rerender}`, local.name, ">", next.name), console.info({
6210
6211
  props,
6211
6212
  propsKey,
6212
6213
  isRoot,
@@ -6241,7 +6242,7 @@ var require_useThemeState_native = __commonJS({
6241
6242
  themes || (themes = (0, import_config.getConfig)().themes);
6242
6243
  var name = !propsKey && (!lastState || !(lastState != null && lastState.isNew)) ? null : getNewThemeName(parentState == null ? void 0 : parentState.name, props, pendingUpdate === "force" ? !0 : !!needsUpdate), isSameAsParent = parentState && (!name || name === parentState.name), shouldRerender = !!(needsUpdate && (pendingUpdate || (lastState == null ? void 0 : lastState.name) !== (parentState == null ? void 0 : parentState.name)));
6243
6244
  if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
6244
- var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6245
+ var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6245
6246
  console.info(message);
6246
6247
  }
6247
6248
  if (isSameAsParent) return [
@@ -7136,7 +7137,7 @@ var require_useComponentState_native = __commonJS({
7136
7137
  ...states[0],
7137
7138
  [props.forceStyle]: !0
7138
7139
  } : states[0], setState = states[1];
7139
- stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
7140
+ stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
7140
7141
  var isAnimated = willBeAnimated;
7141
7142
  import_constants.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), state.disabled = disabled, setState(function(_) {
7142
7143
  return {
@@ -7180,26 +7181,6 @@ var require_useComponentState_native = __commonJS({
7180
7181
  }
7181
7182
  };
7182
7183
  }
7183
- if (!curStateRef.stateEmitter && hasAnimationProp) {
7184
- var listeners1 = /* @__PURE__ */ new Set();
7185
- curStateRef.stateEmitter = {
7186
- listeners: listeners1,
7187
- emit(state2) {
7188
- listeners1.forEach(function(l) {
7189
- return l(state2);
7190
- });
7191
- },
7192
- subscribe(cb) {
7193
- return listeners1.add(cb), setStateShallow({
7194
- hasDynGroupChildren: !0
7195
- }), function() {
7196
- listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
7197
- hasDynGroupChildren: !1
7198
- });
7199
- };
7200
- }
7201
- };
7202
- }
7203
7184
  return {
7204
7185
  startedUnhydrated,
7205
7186
  curStateRef,
@@ -7449,7 +7430,13 @@ var require_createComponent_native = __commonJS({
7449
7430
  }
7450
7431
  });
7451
7432
  module2.exports = __toCommonJS2(createComponent_exports);
7452
- var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
7433
+ var import_jsx_runtime2 = require("react/jsx-runtime"), import_compose_refs = require_index_native4(), import_constants = require_index_native2(), import_helpers2 = require_index_native3(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants2 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getShorthandValue = require_getShorthandValue_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set(), avoidReRenderKeys = /* @__PURE__ */ new Set([
7434
+ "hover",
7435
+ "press",
7436
+ "pressIn",
7437
+ "group",
7438
+ "media"
7439
+ ]);
7453
7440
  if (0) var cancelTouches;
7454
7441
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
7455
7442
  value: !1
@@ -7597,19 +7584,18 @@ var require_createComponent_native = __commonJS({
7597
7584
  if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
7598
7585
  var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
7599
7586
  setStateShallow = function(next) {
7600
- var avoidReRenderKeys = /* @__PURE__ */ new Set([
7601
- "hover",
7602
- "press",
7603
- "pressIn"
7604
- ]), canAvoidReRender = Object.keys(next).every(function(key3) {
7587
+ var canAvoidReRender = Object.keys(next).every(function(key3) {
7605
7588
  return avoidReRenderKeys.has(key3);
7606
7589
  });
7607
7590
  if (canAvoidReRender && styleListener) {
7608
- var updatedState = {
7591
+ var _curStateRef_group, _curStateRef_group1, updatedState = {
7609
7592
  ...state,
7610
7593
  ...next
7611
7594
  };
7612
- stateRef.current.nextComponentState = updatedState;
7595
+ (_curStateRef_group1 = curStateRef.group) === null || _curStateRef_group1 === void 0 || _curStateRef_group1.emit(groupName, {
7596
+ pseudo: updatedState,
7597
+ layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
7598
+ }), stateRef.current.nextComponentState = updatedState;
7613
7599
  var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7614
7600
  styleListener(nextStyles.style);
7615
7601
  } else ogSetStateShallow(next);
@@ -7707,7 +7693,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7707
7693
  console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`), console.warn(stateRef.current.host), console.warn(computed), console.groupEnd();
7708
7694
  }
7709
7695
  }), (0, import_constants.useIsomorphicLayoutEffect)(function() {
7710
- if (state.unmounted === !0 && hasEnterStyle) {
7696
+ if (stateRef.current.nextComponentState = void 0, state.unmounted === !0 && hasEnterStyle) {
7711
7697
  setStateShallow({
7712
7698
  unmounted: "should-enter"
7713
7699
  });