@tamagui/core 1.129.12-1751388824960 → 1.129.12

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,9 +5542,7 @@ 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}`, {
5546
- ...mediaState1
5547
- }), !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}`), !isActive) {
5548
5546
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
5549
5547
  return;
5550
5548
  }
@@ -5554,9 +5552,7 @@ var require_getSplitStyles_native = __commonJS({
5554
5552
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
5555
5553
  var componentGroupPseudoState = (componentGroupState || // fallback to context initially
5556
5554
  componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
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) {
5555
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
5560
5556
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
5561
5557
  return;
5562
5558
  }
@@ -6021,20 +6017,23 @@ var require_index_native6 = __commonJS({
6021
6017
  });
6022
6018
  module2.exports = __toCommonJS2(index_exports2);
6023
6019
  var import_react3 = require("react");
6024
- function useCreateShallowSetState(setter, debug) {
6020
+ function useCreateShallowSetState(setter, debugIn) {
6025
6021
  return (0, import_react3.useCallback)(function(next) {
6026
6022
  setter(function(prev) {
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;
6023
+ return mergeIfNotShallowEqual(prev, next, debugIn);
6030
6024
  });
6031
6025
  }, [
6032
6026
  setter,
6033
- debug
6027
+ debugIn
6034
6028
  ]);
6035
6029
  }
6036
- function mergeIfNotShallowEqual(prev, next) {
6037
- return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
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 {
6038
6037
  ...prev,
6039
6038
  ...next
6040
6039
  };
@@ -6207,7 +6206,7 @@ var require_useThemeState_native = __commonJS({
6207
6206
  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));
6208
6207
  return PendingUpdate.delete(id), (!local || rerender) && (local = {
6209
6208
  ...next
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({
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({
6211
6210
  props,
6212
6211
  propsKey,
6213
6212
  isRoot,
@@ -6242,7 +6241,7 @@ var require_useThemeState_native = __commonJS({
6242
6241
  themes || (themes = (0, import_config.getConfig)().themes);
6243
6242
  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)));
6244
6243
  if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
6245
- var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6244
+ var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
6246
6245
  console.info(message);
6247
6246
  }
6248
6247
  if (isSameAsParent) return [
@@ -7137,7 +7136,7 @@ var require_useComponentState_native = __commonJS({
7137
7136
  ...states[0],
7138
7137
  [props.forceStyle]: !0
7139
7138
  } : states[0], setState = states[1];
7140
- stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
7139
+ stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
7141
7140
  var isAnimated = willBeAnimated;
7142
7141
  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(_) {
7143
7142
  return {
@@ -7181,6 +7180,26 @@ var require_useComponentState_native = __commonJS({
7181
7180
  }
7182
7181
  };
7183
7182
  }
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
+ }
7184
7203
  return {
7185
7204
  startedUnhydrated,
7186
7205
  curStateRef,
@@ -7430,13 +7449,7 @@ var require_createComponent_native = __commonJS({
7430
7449
  }
7431
7450
  });
7432
7451
  module2.exports = __toCommonJS2(createComponent_exports);
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
- ]);
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();
7440
7453
  if (0) var cancelTouches;
7441
7454
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
7442
7455
  value: !1
@@ -7584,18 +7597,19 @@ var require_createComponent_native = __commonJS({
7584
7597
  if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
7585
7598
  var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
7586
7599
  setStateShallow = function(next) {
7587
- var canAvoidReRender = Object.keys(next).every(function(key3) {
7600
+ var avoidReRenderKeys = /* @__PURE__ */ new Set([
7601
+ "hover",
7602
+ "press",
7603
+ "pressIn"
7604
+ ]), canAvoidReRender = Object.keys(next).every(function(key3) {
7588
7605
  return avoidReRenderKeys.has(key3);
7589
7606
  });
7590
7607
  if (canAvoidReRender && styleListener) {
7591
- var _curStateRef_group, _curStateRef_group1, updatedState = {
7608
+ var updatedState = {
7592
7609
  ...state,
7593
7610
  ...next
7594
7611
  };
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;
7612
+ stateRef.current.nextComponentState = updatedState;
7599
7613
  var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
7600
7614
  styleListener(nextStyles.style);
7601
7615
  } else ogSetStateShallow(next);
@@ -7693,7 +7707,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7693
7707
  console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`), console.warn(stateRef.current.host), console.warn(computed), console.groupEnd();
7694
7708
  }
7695
7709
  }), (0, import_constants.useIsomorphicLayoutEffect)(function() {
7696
- if (stateRef.current.nextComponentState = void 0, state.unmounted === !0 && hasEnterStyle) {
7710
+ if (state.unmounted === !0 && hasEnterStyle) {
7697
7711
  setStateShallow({
7698
7712
  unmounted: "should-enter"
7699
7713
  });