@tamagui/core 1.125.14 → 1.125.15

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
@@ -5929,21 +5929,19 @@ var require_createShallowSetState_native = __commonJS({
5929
5929
  var import_react3 = require("react"), callImmediate = function(cb) {
5930
5930
  return cb();
5931
5931
  };
5932
- function createShallowSetState(setter, onlyAllow, transition, debugIn, callback) {
5932
+ function createShallowSetState(setter, onlyAllow, transition, debugIn) {
5933
5933
  return (0, import_react3.useCallback)(function(next) {
5934
5934
  var wrap = transition ? import_react3.startTransition : callImmediate;
5935
5935
  wrap(function() {
5936
5936
  setter(function(prev) {
5937
- var out = mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
5938
- return callback == null || callback(out), out;
5937
+ return mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
5939
5938
  });
5940
5939
  });
5941
5940
  }, [
5942
5941
  setter,
5943
5942
  onlyAllow ? onlyAllow.join("") : "",
5944
5943
  transition,
5945
- debugIn,
5946
- callback
5944
+ debugIn
5947
5945
  ]);
5948
5946
  }
5949
5947
  function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
@@ -6012,15 +6010,15 @@ var require_subscribeToContextGroup_native = __commonJS({
6012
6010
  }
6013
6011
  });
6014
6012
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6015
- var import_createShallowSetState = require_createShallowSetState_native(), import_useMedia = require_useMedia_native(), subscribeToContextGroup = function(param) {
6013
+ var import_useMedia = require_useMedia_native(), import_createShallowSetState = require_createShallowSetState_native(), subscribeToContextGroup = function(param) {
6016
6014
  var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6017
6015
  if (pseudoGroups || mediaGroups) {
6018
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
6019
- pseudo: {},
6020
- media: {}
6021
- };
6016
+ var _componentContext_groups_subscribe, _componentContext_groups;
6022
6017
  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) {
6023
- var { layout, pseudo } = param2;
6018
+ var { layout, pseudo } = param2, _state_group, current = ((_state_group = state.group) === null || _state_group === void 0 ? void 0 : _state_group[name]) || {
6019
+ pseudo: {},
6020
+ media: {}
6021
+ };
6024
6022
  if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6025
6023
  else if (layout && mediaGroups) {
6026
6024
  var mediaState2 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState2);
@@ -6972,7 +6970,7 @@ var require_useComponentState_native = __commonJS({
6972
6970
  });
6973
6971
  module2.exports = __toCommonJS2(useComponentState_exports);
6974
6972
  var import_constants2 = require_index_native2(), import_use_did_finish_ssr = require_index_native6(), 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) {
6975
- 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);
6973
+ 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);
6976
6974
  stateRef.current || (stateRef.current = {});
6977
6975
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
6978
6976
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -6997,24 +6995,9 @@ var require_useComponentState_native = __commonJS({
6997
6995
  import_constants2.isWeb && hasAnimationThatNeedsHydrate && !staticConfig.isHOC && !isHydrated && (isAnimated = !1, curStateRef.willHydrate = !0), disabled !== state.disabled && (state.disabled = disabled, disabled && Object.assign(state, import_defaultComponentState.defaultComponentStateMounted), setState({
6998
6996
  ...state
6999
6997
  }));
7000
- var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
7001
- if (groupContextState && groupName) return function(state2) {
7002
- curStateRef.group.emit(groupName, {
7003
- pseudo: state2
7004
- });
7005
- var next = {
7006
- ...groupContextState[groupName],
7007
- ...state2
7008
- };
7009
- groupContextState[groupName] = next;
7010
- };
7011
- }, [
7012
- groupContextState,
7013
- curStateRef,
7014
- groupName
7015
- ]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
6998
+ var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
7016
6999
  "disabled"
7017
- ] : void 0, !1, props.debug, setStateWrapper);
7000
+ ] : void 0, !1, props.debug);
7018
7001
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
7019
7002
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
7020
7003
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
@@ -7525,8 +7508,9 @@ var require_createComponent_native = __commonJS({
7525
7508
  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.
7526
7509
 
7527
7510
  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_helpers2.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
7528
- stateRef.current.group.emit(groupName, {
7529
- layout: e.nativeEvent.layout
7511
+ var layout = e.nativeEvent.layout;
7512
+ stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
7513
+ layout
7530
7514
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
7531
7515
  return {
7532
7516
  ...prev
@@ -7589,6 +7573,25 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7589
7573
  mediaGroups ? Object.keys([
7590
7574
  ...mediaGroups
7591
7575
  ]).join("") : 0
7576
+ ]), (0, import_constants2.useIsomorphicLayoutEffect)(function() {
7577
+ var _curStateRef_group;
7578
+ if (groupName) {
7579
+ curStateRef.group.emit(groupName, {
7580
+ pseudo: state,
7581
+ layout: (_curStateRef_group = curStateRef.group) === null || _curStateRef_group === void 0 ? void 0 : _curStateRef_group.layout
7582
+ });
7583
+ var groupContextState = componentContext == null ? void 0 : componentContext.groups;
7584
+ if (groupContextState) {
7585
+ var next = {
7586
+ ...groupContextState[groupName],
7587
+ ...state
7588
+ };
7589
+ groupContextState[groupName] = next;
7590
+ }
7591
+ }
7592
+ }, [
7593
+ groupName,
7594
+ state
7592
7595
  ]);
7593
7596
  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_constants2.isWeb && !!(groupName || needsHoverState || onMouseEnter || onMouseLeave), shouldAttach = !disabled && !props.asChild && !!(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle), needsPressState = !!(groupName || runtimePressStyle);
7594
7597
  process.env.NODE_ENV === "development" && time2 && time2`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
@@ -7718,7 +7721,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
7718
7721
  }, [
7719
7722
  groupName
7720
7723
  ]);
7721
- if ((groupName || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
7724
+ if (("group" in props || propsIn.focusWithinStyle) && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ComponentContext.ComponentContext.Provider, {
7722
7725
  ...componentContext,
7723
7726
  groups: subGroupContext,
7724
7727
  setParentFocusState: setStateShallow,