tamagui 1.125.14 → 1.125.16

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.
@@ -6660,21 +6660,19 @@ var require_createShallowSetState_native = __commonJS({
6660
6660
  var import_react3 = require("react"), callImmediate = function(cb) {
6661
6661
  return cb();
6662
6662
  };
6663
- function createShallowSetState(setter, onlyAllow, transition, debugIn, callback) {
6663
+ function createShallowSetState(setter, onlyAllow, transition, debugIn) {
6664
6664
  return (0, import_react3.useCallback)(function(next) {
6665
6665
  var wrap = transition ? import_react3.startTransition : callImmediate;
6666
6666
  wrap(function() {
6667
6667
  setter(function(prev) {
6668
- var out = mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
6669
- return callback == null || callback(out), out;
6668
+ return mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
6670
6669
  });
6671
6670
  });
6672
6671
  }, [
6673
6672
  setter,
6674
6673
  onlyAllow ? onlyAllow.join("") : "",
6675
6674
  transition,
6676
- debugIn,
6677
- callback
6675
+ debugIn
6678
6676
  ]);
6679
6677
  }
6680
6678
  function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
@@ -6738,15 +6736,15 @@ var require_subscribeToContextGroup_native = __commonJS({
6738
6736
  }
6739
6737
  });
6740
6738
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6741
- var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
6739
+ var import_useMedia = require_useMedia_native(), import_createShallowSetState = require_createShallowSetState_native(), subscribeToContextGroup = function(param) {
6742
6740
  var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6743
6741
  if (pseudoGroups || mediaGroups) {
6744
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
6745
- pseudo: {},
6746
- media: {}
6747
- };
6742
+ var _componentContext_groups_subscribe, _componentContext_groups;
6748
6743
  return (_componentContext_groups = componentContext.groups) === null || _componentContext_groups === void 0 || (_componentContext_groups_subscribe = _componentContext_groups.subscribe) === null || _componentContext_groups_subscribe === void 0 ? void 0 : _componentContext_groups_subscribe.call(_componentContext_groups, function(name, param2) {
6749
- var { layout, pseudo } = param2;
6744
+ var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
6745
+ pseudo: {},
6746
+ media: {}
6747
+ };
6750
6748
  if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6751
6749
  else if (layout && mediaGroups) {
6752
6750
  var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
@@ -7657,7 +7655,7 @@ var require_useComponentState_native = __commonJS({
7657
7655
  });
7658
7656
  module2.exports = __toCommonJS2(useComponentState_exports);
7659
7657
  var import_constants4 = require_index_native6(), import_use_did_finish_ssr = require_index_native13(), import_react3 = require("react"), import_defaultComponentState = require_defaultComponentState_native(), import_createShallowSetState = require_createShallowSetState_native(), import_isObj = require_isObj_native(), import_log = require_log_native(), useComponentState = function(props, param, staticConfig, config) {
7660
- var { animationDriver, groups } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7658
+ var { animationDriver } = param, _animationDriver_usePresence, isHydrated = (0, import_use_did_finish_ssr.useDidFinishSSR)(), useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, stateRef = (0, import_react3.useRef)(void 0);
7661
7659
  stateRef.current || (stateRef.current = {});
7662
7660
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
7663
7661
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -7682,24 +7680,9 @@ var require_useComponentState_native = __commonJS({
7682
7680
  import_constants4.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
7683
7681
  ...state
7684
7682
  }));
7685
- var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
7686
- if (groupContextState && groupName) return function(state2) {
7687
- curStateRef.group.emit(groupName, {
7688
- pseudo: state2
7689
- });
7690
- var next = {
7691
- ...groupContextState[groupName],
7692
- ...state2
7693
- };
7694
- groupContextState[groupName] = next;
7695
- };
7696
- }, [
7697
- groupContextState,
7698
- curStateRef,
7699
- groupName
7700
- ]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
7683
+ var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
7701
7684
  "disabled"
7702
- ] : void 0, !1, props.debug, setStateWrapper);
7685
+ ] : void 0, !1, props.debug);
7703
7686
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
7704
7687
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
7705
7688
  (0, import_isObj.isObj)(custom) && Object.assign(props, custom);
@@ -8124,8 +8107,9 @@ var require_createComponent_native = __commonJS({
8124
8107
  (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`));
8125
8108
  }
8126
8109
  groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8127
- stateRef.current.group.emit(groupName, {
8128
- layout: e.nativeEvent.layout
8110
+ var layout = e.nativeEvent.layout;
8111
+ stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8112
+ layout
8129
8113
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8130
8114
  return {
8131
8115
  ...prev
@@ -8174,6 +8158,25 @@ var require_createComponent_native = __commonJS({
8174
8158
  mediaGroups ? Object.keys([
8175
8159
  ...mediaGroups
8176
8160
  ]).join("") : 0
8161
+ ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8162
+ var _curStateRef_group;
8163
+ if (groupName) {
8164
+ curStateRef.group.emit(groupName, {
8165
+ pseudo: state,
8166
+ layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
8167
+ });
8168
+ var groupContextState = componentContext == null ? void 0 : componentContext.groups;
8169
+ if (groupContextState) {
8170
+ var next = {
8171
+ ...groupContextState[groupName],
8172
+ ...state
8173
+ };
8174
+ groupContextState[groupName] = next;
8175
+ }
8176
+ }
8177
+ }, [
8178
+ groupName,
8179
+ state
8177
8180
  ]);
8178
8181
  var runtimePressStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.pressStyle), runtimeFocusStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusStyle), runtimeFocusVisibleStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.focusVisibleStyle), attachFocus = !!(runtimePressStyle || runtimeFocusStyle || runtimeFocusVisibleStyle || onFocus || onBlur || componentContext.setParentFocusState), attachPress = !!(groupName || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || pseudos != null && pseudos.focusVisibleStyle), runtimeHoverStyle = !disabled && noClass && (pseudos == null ? void 0 : pseudos.hoverStyle), needsHoverState = !!(groupName || runtimeHoverStyle || onHoverIn || onHoverOut), attachHover = import_constants4.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle), events = shouldAttach ? {
8179
8182
  onPressOut: attachPress ? function(e) {
@@ -8283,7 +8286,7 @@ var require_createComponent_native = __commonJS({
8283
8286
  }, [
8284
8287
  groupName
8285
8288
  ]);
8286
- if ((groupName || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8289
+ if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8287
8290
  ...componentContext,
8288
8291
  groups: subGroupContext,
8289
8292
  setParentFocusState: setStateShallow,