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.
package/dist/native.js CHANGED
@@ -7028,21 +7028,19 @@ var require_createShallowSetState_native = __commonJS({
7028
7028
  var import_react3 = require("react"), callImmediate = function(cb) {
7029
7029
  return cb();
7030
7030
  };
7031
- function createShallowSetState(setter, onlyAllow, transition, debugIn, callback) {
7031
+ function createShallowSetState(setter, onlyAllow, transition, debugIn) {
7032
7032
  return (0, import_react3.useCallback)(function(next) {
7033
7033
  var wrap = transition ? import_react3.startTransition : callImmediate;
7034
7034
  wrap(function() {
7035
7035
  setter(function(prev) {
7036
- var out = mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
7037
- return callback == null || callback(out), out;
7036
+ return mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
7038
7037
  });
7039
7038
  });
7040
7039
  }, [
7041
7040
  setter,
7042
7041
  onlyAllow ? onlyAllow.join("") : "",
7043
7042
  transition,
7044
- debugIn,
7045
- callback
7043
+ debugIn
7046
7044
  ]);
7047
7045
  }
7048
7046
  function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
@@ -7111,15 +7109,15 @@ var require_subscribeToContextGroup_native = __commonJS({
7111
7109
  }
7112
7110
  });
7113
7111
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
7114
- var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
7112
+ var import_useMedia = require_useMedia_native(), import_createShallowSetState = require_createShallowSetState_native(), subscribeToContextGroup = function(param) {
7115
7113
  var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
7116
7114
  if (pseudoGroups || mediaGroups) {
7117
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
7118
- pseudo: {},
7119
- media: {}
7120
- };
7115
+ var _componentContext_groups_subscribe, _componentContext_groups;
7121
7116
  return process.env.NODE_ENV === "development" && !componentContext.groups && console.debug("No context group found"), (_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) {
7122
- var { layout, pseudo } = param2;
7117
+ var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
7118
+ pseudo: {},
7119
+ media: {}
7120
+ };
7123
7121
  if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
7124
7122
  else if (layout && mediaGroups) {
7125
7123
  var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
@@ -8071,7 +8069,7 @@ var require_useComponentState_native = __commonJS({
8071
8069
  });
8072
8070
  module2.exports = __toCommonJS2(useComponentState_exports);
8073
8071
  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) {
8074
- 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);
8072
+ 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);
8075
8073
  stateRef.current || (stateRef.current = {});
8076
8074
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
8077
8075
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -8096,24 +8094,9 @@ var require_useComponentState_native = __commonJS({
8096
8094
  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({
8097
8095
  ...state
8098
8096
  }));
8099
- var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
8100
- if (groupContextState && groupName) return function(state2) {
8101
- curStateRef.group.emit(groupName, {
8102
- pseudo: state2
8103
- });
8104
- var next = {
8105
- ...groupContextState[groupName],
8106
- ...state2
8107
- };
8108
- groupContextState[groupName] = next;
8109
- };
8110
- }, [
8111
- groupContextState,
8112
- curStateRef,
8113
- groupName
8114
- ]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
8097
+ var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
8115
8098
  "disabled"
8116
- ] : void 0, !1, props.debug, setStateWrapper);
8099
+ ] : void 0, !1, props.debug);
8117
8100
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
8118
8101
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
8119
8102
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
@@ -8624,8 +8607,9 @@ var require_createComponent_native = __commonJS({
8624
8607
  process.env.NODE_ENV === "development" && props.untilMeasured && !props.group && console.warn(`You set the untilMeasured prop without setting group. This doesn't work, be sure to set untilMeasured on the parent that sets group, not the children that use the $group- prop.
8625
8608
 
8626
8609
  If you meant to do this, you can disable this warning - either change untilMeasured and group at the same time, or do group={conditional ? 'name' : undefined}`), process.env.NODE_ENV === "development" && time2 && time2`destructure`, groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8627
- stateRef.current.group.emit(groupName, {
8628
- layout: e.nativeEvent.layout
8610
+ var layout = e.nativeEvent.layout;
8611
+ stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8612
+ layout
8629
8613
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8630
8614
  return {
8631
8615
  ...prev
@@ -8688,6 +8672,25 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8688
8672
  mediaGroups ? Object.keys([
8689
8673
  ...mediaGroups
8690
8674
  ]).join("") : 0
8675
+ ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
8676
+ var _curStateRef_group;
8677
+ if (groupName) {
8678
+ curStateRef.group.emit(groupName, {
8679
+ pseudo: state,
8680
+ layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
8681
+ });
8682
+ var groupContextState = componentContext == null ? void 0 : componentContext.groups;
8683
+ if (groupContextState) {
8684
+ var next = {
8685
+ ...groupContextState[groupName],
8686
+ ...state
8687
+ };
8688
+ groupContextState[groupName] = next;
8689
+ }
8690
+ }
8691
+ }, [
8692
+ groupName,
8693
+ state
8691
8694
  ]);
8692
8695
  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);
8693
8696
  process.env.NODE_ENV === "development" && time2 && time2`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
@@ -8817,7 +8820,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8817
8820
  }, [
8818
8821
  groupName
8819
8822
  ]);
8820
- if ((groupName || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8823
+ if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_ComponentContext.ComponentContext.Provider, {
8821
8824
  ...componentContext,
8822
8825
  groups: subGroupContext,
8823
8826
  setParentFocusState: setStateShallow,