tamagui 1.125.13 → 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.
@@ -6660,22 +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) {
6664
- var debug = !0;
6663
+ function createShallowSetState(setter, onlyAllow, transition, debugIn) {
6665
6664
  return (0, import_react3.useCallback)(function(next) {
6666
6665
  var wrap = transition ? import_react3.startTransition : callImmediate;
6667
6666
  wrap(function() {
6668
6667
  setter(function(prev) {
6669
- var out = mergeIfNotShallowEqual(prev, next, onlyAllow, debug);
6670
- return callback == null || callback(out), out;
6668
+ return mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
6671
6669
  });
6672
6670
  });
6673
6671
  }, [
6674
6672
  setter,
6675
6673
  onlyAllow ? onlyAllow.join("") : "",
6676
6674
  transition,
6677
- debug,
6678
- callback
6675
+ debugIn
6679
6676
  ]);
6680
6677
  }
6681
6678
  function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
@@ -6739,15 +6736,15 @@ var require_subscribeToContextGroup_native = __commonJS({
6739
6736
  }
6740
6737
  });
6741
6738
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
6742
- 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) {
6743
6740
  var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
6744
6741
  if (pseudoGroups || mediaGroups) {
6745
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
6746
- pseudo: {},
6747
- media: {}
6748
- };
6742
+ var _componentContext_groups_subscribe, _componentContext_groups;
6749
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) {
6750
- 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
+ };
6751
6748
  if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
6752
6749
  else if (layout && mediaGroups) {
6753
6750
  var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
@@ -7658,7 +7655,7 @@ var require_useComponentState_native = __commonJS({
7658
7655
  });
7659
7656
  module2.exports = __toCommonJS2(useComponentState_exports);
7660
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) {
7661
- 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);
7662
7659
  stateRef.current || (stateRef.current = {});
7663
7660
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
7664
7661
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -7683,24 +7680,9 @@ var require_useComponentState_native = __commonJS({
7683
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({
7684
7681
  ...state
7685
7682
  }));
7686
- var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
7687
- if (groupContextState && groupName) return function(state2) {
7688
- curStateRef.group.emit(groupName, {
7689
- pseudo: state2
7690
- });
7691
- var next = {
7692
- ...groupContextState[groupName],
7693
- ...state2
7694
- };
7695
- groupContextState[groupName] = next;
7696
- };
7697
- }, [
7698
- groupContextState,
7699
- curStateRef,
7700
- groupName
7701
- ]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
7683
+ var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
7702
7684
  "disabled"
7703
- ] : void 0, !1, props.debug, setStateWrapper);
7685
+ ] : void 0, !1, props.debug);
7704
7686
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
7705
7687
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
7706
7688
  (0, import_isObj.isObj)(custom) && Object.assign(props, custom);
@@ -8125,8 +8107,9 @@ var require_createComponent_native = __commonJS({
8125
8107
  (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`));
8126
8108
  }
8127
8109
  groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8128
- stateRef.current.group.emit(groupName, {
8129
- layout: e.nativeEvent.layout
8110
+ var layout = e.nativeEvent.layout;
8111
+ stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8112
+ layout
8130
8113
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8131
8114
  return {
8132
8115
  ...prev
@@ -8175,6 +8158,25 @@ var require_createComponent_native = __commonJS({
8175
8158
  mediaGroups ? Object.keys([
8176
8159
  ...mediaGroups
8177
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
8178
8180
  ]);
8179
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 ? {
8180
8182
  onPressOut: attachPress ? function(e) {
@@ -8284,7 +8286,7 @@ var require_createComponent_native = __commonJS({
8284
8286
  }, [
8285
8287
  groupName
8286
8288
  ]);
8287
- 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, {
8288
8290
  ...componentContext,
8289
8291
  groups: subGroupContext,
8290
8292
  setParentFocusState: setStateShallow,
@@ -8998,7 +9000,7 @@ var require_createFont_native = __commonJS({
8998
9000
  ];
8999
9001
  }));
9000
9002
  }, createFont2 = function(font) {
9001
- var sizeKeys = Object.keys(font.size), processedFont = Object.fromEntries(Object.entries(font).map(function(param) {
9003
+ var sizeKeys = Object.keys(font.size || {}), processedFont = Object.fromEntries(Object.entries(font).map(function(param) {
9002
9004
  var [key, section] = param;
9003
9005
  return [
9004
9006
  key,
@@ -28394,7 +28396,7 @@ var require_Slider_native = __commonJS({
28394
28396
  defaultVariants: {
28395
28397
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
28396
28398
  }
28397
- }), SliderThumb = /* @__PURE__ */ React4.memo(SliderThumbFrame.styleable(function(props, forwardedRef) {
28399
+ }), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
28398
28400
  var { __scopeSlider, index, size: sizeProp, ...thumbProps } = props, context = (0, import_constants22.useSliderContext)(THUMB_NAME, __scopeSlider), orientation = (0, import_constants22.useSliderOrientationContext)(THUMB_NAME, __scopeSlider), [thumb, setThumb] = React4.useState(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, setThumb), value = context.values[index], percent = value === void 0 ? 0 : (0, import_helpers3.convertValueToPercentage)(value, context.min, context.max), label = (0, import_helpers3.getLabel)(index, context.values.length), _ref, sizeIn = (_ref = sizeProp ?? context.size) !== null && _ref !== void 0 ? _ref : "$true", [size4, setSize] = React4.useState(function() {
28399
28401
  var estimatedSize = (0, import_core12.getVariableValue)(getThumbSize(sizeIn).width);
28400
28402
  return estimatedSize;
@@ -28461,7 +28463,11 @@ var require_Slider_native = __commonJS({
28461
28463
  context.valueIndexToChangeRef.current = index;
28462
28464
  })
28463
28465
  });
28464
- })), SliderComponent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
28466
+ }, {
28467
+ staticConfig: {
28468
+ memo: !0
28469
+ }
28470
+ }), SliderComponent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
28465
28471
  var { name, min: min2 = 0, max: max2 = 100, step = 1, orientation = "horizontal", disabled = !1, minStepsBetweenThumbs = 0, defaultValue = [
28466
28472
  min2
28467
28473
  ], value, onValueChange = function() {