tamagui 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
@@ -6641,9 +6641,7 @@ var require_getSplitStyles_native = __commonJS({
6641
6641
  if (groupMediaKey) {
6642
6642
  mediaGroups || (mediaGroups = /* @__PURE__ */ new Set()), mediaGroups.add(groupMediaKey);
6643
6643
  var mediaState1 = componentGroupState == null ? void 0 : componentGroupState.media, isActive = mediaState1 == null ? void 0 : mediaState1[groupMediaKey];
6644
- 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}`, {
6645
- ...mediaState1
6646
- }), !isActive) {
6644
+ 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) {
6647
6645
  for (var pkey1 in mediaStyle1) applyDefaultStyle(pkey1, styleState);
6648
6646
  return;
6649
6647
  }
@@ -6653,9 +6651,7 @@ var require_getSplitStyles_native = __commonJS({
6653
6651
  pseudoGroups || (pseudoGroups = /* @__PURE__ */ new Set()), pseudoGroups.add(groupName);
6654
6652
  var componentGroupPseudoState = (componentGroupState || // fallback to context initially
6655
6653
  componentContext.groups.state[groupName]).pseudo, isActive1 = componentGroupPseudoState == null ? void 0 : componentGroupPseudoState[groupPseudoKey], priority1 = import_pseudoDescriptors.pseudoPriorities[groupPseudoKey];
6656
- if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`, {
6657
- ...componentGroupPseudoState
6658
- }), !isActive1) {
6654
+ if (process.env.NODE_ENV === "development" && debug === "verbose" && (0, import_log.log)(` \u{1F3D8}\uFE0F GROUP pseudo ${groupMediaKey} active? ${isActive1}, priority ${priority1}`), !isActive1) {
6659
6655
  for (var pkey2 in mediaStyle1) applyDefaultStyle(pkey2, styleState);
6660
6656
  return;
6661
6657
  }
@@ -7120,20 +7116,23 @@ var require_index_native13 = __commonJS({
7120
7116
  });
7121
7117
  module2.exports = __toCommonJS2(index_exports2);
7122
7118
  var import_react3 = require("react");
7123
- function useCreateShallowSetState(setter, debug) {
7119
+ function useCreateShallowSetState(setter, debugIn) {
7124
7120
  return (0, import_react3.useCallback)(function(next) {
7125
7121
  setter(function(prev) {
7126
- var update = mergeIfNotShallowEqual(prev, next);
7127
- if (process.env.NODE_ENV === "development" && debug && update !== prev && (console.groupCollapsed("setStateShallow CHANGE", prev, "=>", update), console.trace(), console.groupEnd(), debug === "break")) debugger;
7128
- return update;
7122
+ return mergeIfNotShallowEqual(prev, next, debugIn);
7129
7123
  });
7130
7124
  }, [
7131
7125
  setter,
7132
- debug
7126
+ debugIn
7133
7127
  ]);
7134
7128
  }
7135
- function mergeIfNotShallowEqual(prev, next) {
7136
- return !prev || !next || isEqualShallow(prev, next) ? prev || next : {
7129
+ function mergeIfNotShallowEqual(prev, next, debug) {
7130
+ if (!prev || !next || isEqualShallow(prev, next)) return prev || next;
7131
+ if (process.env.NODE_ENV === "development" && debug && (console.info("setStateShallow CHANGE", {
7132
+ prev,
7133
+ next
7134
+ }), debug === "break")) debugger;
7135
+ return {
7137
7136
  ...prev,
7138
7137
  ...next
7139
7138
  };
@@ -7306,7 +7305,7 @@ var require_useThemeState_native = __commonJS({
7306
7305
  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));
7307
7306
  return PendingUpdate.delete(id), (!local || rerender) && (local = {
7308
7307
  ...next
7309
- }, 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({
7308
+ }, 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({
7310
7309
  props,
7311
7310
  propsKey,
7312
7311
  isRoot,
@@ -7341,7 +7340,7 @@ var require_useThemeState_native = __commonJS({
7341
7340
  themes || (themes = (0, import_config.getConfig)().themes);
7342
7341
  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)));
7343
7342
  if (process.env.NODE_ENV === "development" && debug && debug !== "profile") {
7344
- var message = ` \xB7 useTheme(${id}) getNextState => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
7343
+ var message = ` \xB7 useTheme(${id}) => ${name} needsUpdate ${needsUpdate} shouldRerender ${shouldRerender}`;
7345
7344
  console.info(message);
7346
7345
  }
7347
7346
  if (isSameAsParent) return [
@@ -8236,7 +8235,7 @@ var require_useComponentState_native = __commonJS({
8236
8235
  ...states[0],
8237
8236
  [props.forceStyle]: !0
8238
8237
  } : states[0], setState = states[1];
8239
- stateRef.current.nextComponentState && Object.assign(state, stateRef.current.nextComponentState);
8238
+ stateRef.current.nextComponentState && (Object.assign(state, stateRef.current.nextComponentState), stateRef.current.nextComponentState = void 0);
8240
8239
  var isAnimated = willBeAnimated;
8241
8240
  import_constants4.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(_) {
8242
8241
  return {
@@ -8280,6 +8279,26 @@ var require_useComponentState_native = __commonJS({
8280
8279
  }
8281
8280
  };
8282
8281
  }
8282
+ if (!curStateRef.stateEmitter && hasAnimationProp) {
8283
+ var listeners1 = /* @__PURE__ */ new Set();
8284
+ curStateRef.stateEmitter = {
8285
+ listeners: listeners1,
8286
+ emit(state2) {
8287
+ listeners1.forEach(function(l) {
8288
+ return l(state2);
8289
+ });
8290
+ },
8291
+ subscribe(cb) {
8292
+ return listeners1.add(cb), setStateShallow({
8293
+ hasDynGroupChildren: !0
8294
+ }), function() {
8295
+ listeners1.delete(cb), listeners1.size === 0 && setStateShallow({
8296
+ hasDynGroupChildren: !1
8297
+ });
8298
+ };
8299
+ }
8300
+ };
8301
+ }
8283
8302
  return {
8284
8303
  startedUnhydrated,
8285
8304
  curStateRef,
@@ -8529,13 +8548,7 @@ var require_createComponent_native = __commonJS({
8529
8548
  }
8530
8549
  });
8531
8550
  module2.exports = __toCommonJS2(createComponent_exports);
8532
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = 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([
8533
- "hover",
8534
- "press",
8535
- "pressIn",
8536
- "group",
8537
- "media"
8538
- ]);
8551
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_helpers = require_index_native7(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = 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();
8539
8552
  if (0) var cancelTouches;
8540
8553
  var BaseText, BaseView, hasSetupBaseViews = !1, lastInteractionWasKeyboard = {
8541
8554
  value: !1
@@ -8683,18 +8696,19 @@ var require_createComponent_native = __commonJS({
8683
8696
  if (hasAnimationProp && animationDriver != null && animationDriver.avoidReRenders) {
8684
8697
  var styleListener = stateRef.current.useStyleListener, ogSetStateShallow = setStateShallow;
8685
8698
  setStateShallow = function(next) {
8686
- var canAvoidReRender = Object.keys(next).every(function(key3) {
8699
+ var avoidReRenderKeys = /* @__PURE__ */ new Set([
8700
+ "hover",
8701
+ "press",
8702
+ "pressIn"
8703
+ ]), canAvoidReRender = Object.keys(next).every(function(key3) {
8687
8704
  return avoidReRenderKeys.has(key3);
8688
8705
  });
8689
8706
  if (canAvoidReRender && styleListener) {
8690
- var _curStateRef_group, _curStateRef_group1, updatedState = {
8707
+ var updatedState = {
8691
8708
  ...state,
8692
8709
  ...next
8693
8710
  };
8694
- (_curStateRef_group1 = curStateRef.group) === null || _curStateRef_group1 === void 0 || _curStateRef_group1.emit(groupName, {
8695
- pseudo: updatedState,
8696
- layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
8697
- }), stateRef.current.nextComponentState = updatedState;
8711
+ stateRef.current.nextComponentState = updatedState;
8698
8712
  var nextStyles = (0, import_getSplitStyles.getSplitStyles)(props, staticConfig, theme, themeName, updatedState, styleProps, null, componentContext, elementType, startedUnhydrated, debugProp);
8699
8713
  styleListener(nextStyles.style);
8700
8714
  } else ogSetStateShallow(next);
@@ -8792,7 +8806,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8792
8806
  console.groupCollapsed(`Rendered > (opacity: ${computed.opacity})`), console.warn(stateRef.current.host), console.warn(computed), console.groupEnd();
8793
8807
  }
8794
8808
  }), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8795
- if (stateRef.current.nextComponentState = void 0, state.unmounted === !0 && hasEnterStyle) {
8809
+ if (state.unmounted === !0 && hasEnterStyle) {
8796
8810
  setStateShallow({
8797
8811
  unmounted: "should-enter"
8798
8812
  });