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.
package/dist/native.js CHANGED
@@ -7028,22 +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) {
7032
- var debug = !0;
7031
+ function createShallowSetState(setter, onlyAllow, transition, debugIn) {
7033
7032
  return (0, import_react3.useCallback)(function(next) {
7034
7033
  var wrap = transition ? import_react3.startTransition : callImmediate;
7035
7034
  wrap(function() {
7036
7035
  setter(function(prev) {
7037
- var out = mergeIfNotShallowEqual(prev, next, onlyAllow, debug);
7038
- return callback == null || callback(out), out;
7036
+ return mergeIfNotShallowEqual(prev, next, onlyAllow, debugIn);
7039
7037
  });
7040
7038
  });
7041
7039
  }, [
7042
7040
  setter,
7043
7041
  onlyAllow ? onlyAllow.join("") : "",
7044
7042
  transition,
7045
- debug,
7046
- callback
7043
+ debugIn
7047
7044
  ]);
7048
7045
  }
7049
7046
  function mergeIfNotShallowEqual(prev, next, onlyAllow, debug) {
@@ -7112,15 +7109,15 @@ var require_subscribeToContextGroup_native = __commonJS({
7112
7109
  }
7113
7110
  });
7114
7111
  module2.exports = __toCommonJS2(subscribeToContextGroup_exports);
7115
- 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) {
7116
7113
  var { setStateShallow, pseudoGroups, mediaGroups, componentContext, state } = param;
7117
7114
  if (pseudoGroups || mediaGroups) {
7118
- var _componentContext_groups_subscribe, _componentContext_groups, current = {
7119
- pseudo: {},
7120
- media: {}
7121
- };
7115
+ var _componentContext_groups_subscribe, _componentContext_groups;
7122
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) {
7123
- 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
+ };
7124
7121
  if (pseudo && pseudoGroups != null && pseudoGroups.has(String(name))) Object.assign(current.pseudo, pseudo), persist();
7125
7122
  else if (layout && mediaGroups) {
7126
7123
  var mediaState3 = (0, import_useMedia.getMediaState)(mediaGroups, layout), next = (0, import_createShallowSetState.mergeIfNotShallowEqual)(current.media, mediaState3);
@@ -8072,7 +8069,7 @@ var require_useComponentState_native = __commonJS({
8072
8069
  });
8073
8070
  module2.exports = __toCommonJS2(useComponentState_exports);
8074
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) {
8075
- 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);
8076
8073
  stateRef.current || (stateRef.current = {});
8077
8074
  var hasAnimationProp = !!("animation" in props || props.style && hasAnimatedStyleValue(props.style)), supportsCSSVars = animationDriver == null ? void 0 : animationDriver.supportsCSSVars, curStateRef = stateRef.current, willBeAnimatedClient = function() {
8078
8075
  var next = !!(hasAnimationProp && !staticConfig.isHOC && useAnimations);
@@ -8097,24 +8094,9 @@ var require_useComponentState_native = __commonJS({
8097
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({
8098
8095
  ...state
8099
8096
  }));
8100
- var groupName = props.group, groupContextState = groups == null ? void 0 : groups.state, setStateWrapper = (0, import_react3.useMemo)(function() {
8101
- if (groupContextState && groupName) return function(state2) {
8102
- curStateRef.group.emit(groupName, {
8103
- pseudo: state2
8104
- });
8105
- var next = {
8106
- ...groupContextState[groupName],
8107
- ...state2
8108
- };
8109
- groupContextState[groupName] = next;
8110
- };
8111
- }, [
8112
- groupContextState,
8113
- curStateRef,
8114
- groupName
8115
- ]), setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
8097
+ var groupName = props.group, setStateShallow = (0, import_createShallowSetState.createShallowSetState)(setState, disabled ? [
8116
8098
  "disabled"
8117
- ] : void 0, !1, props.debug, setStateWrapper);
8099
+ ] : void 0, !1, props.debug);
8118
8100
  if (presenceState && isAnimated && isHydrated && staticConfig.variants) {
8119
8101
  process.env.NODE_ENV === "development" && props.debug === "verbose" && console.warn(`has presenceState ${JSON.stringify(presenceState)}`);
8120
8102
  var { enterVariant, exitVariant, enterExitVariant, custom } = presenceState;
@@ -8625,8 +8607,9 @@ var require_createComponent_native = __commonJS({
8625
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.
8626
8608
 
8627
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) {
8628
- stateRef.current.group.emit(groupName, {
8629
- layout: e.nativeEvent.layout
8610
+ var layout = e.nativeEvent.layout;
8611
+ stateRef.current.group.layout = layout, stateRef.current.group.emit(groupName, {
8612
+ layout
8630
8613
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
8631
8614
  return {
8632
8615
  ...prev
@@ -8689,6 +8672,25 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8689
8672
  mediaGroups ? Object.keys([
8690
8673
  ...mediaGroups
8691
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
8692
8694
  ]);
8693
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);
8694
8696
  process.env.NODE_ENV === "development" && time2 && time2`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
@@ -8818,7 +8820,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8818
8820
  }, [
8819
8821
  groupName
8820
8822
  ]);
8821
- 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, {
8822
8824
  ...componentContext,
8823
8825
  groups: subGroupContext,
8824
8826
  setParentFocusState: setStateShallow,
@@ -9571,7 +9573,7 @@ var require_createFont_native = __commonJS({
9571
9573
  ];
9572
9574
  }));
9573
9575
  }, createFont2 = function(font) {
9574
- var sizeKeys = Object.keys(font.size), processedFont = Object.fromEntries(Object.entries(font).map(function(param) {
9576
+ var sizeKeys = Object.keys(font.size || {}), processedFont = Object.fromEntries(Object.entries(font).map(function(param) {
9575
9577
  var [key, section] = param;
9576
9578
  return [
9577
9579
  key,
@@ -29089,7 +29091,7 @@ var require_Slider_native = __commonJS({
29089
29091
  defaultVariants: {
29090
29092
  unstyled: process.env.TAMAGUI_HEADLESS === "1"
29091
29093
  }
29092
- }), SliderThumb = /* @__PURE__ */ React4.memo(SliderThumbFrame.styleable(function(props, forwardedRef) {
29094
+ }), SliderThumb = SliderThumbFrame.styleable(function(props, forwardedRef) {
29093
29095
  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() {
29094
29096
  var estimatedSize = (0, import_core12.getVariableValue)(getThumbSize(sizeIn).width);
29095
29097
  return estimatedSize;
@@ -29156,7 +29158,11 @@ var require_Slider_native = __commonJS({
29156
29158
  context.valueIndexToChangeRef.current = index;
29157
29159
  })
29158
29160
  });
29159
- })), SliderComponent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
29161
+ }, {
29162
+ staticConfig: {
29163
+ memo: !0
29164
+ }
29165
+ }), SliderComponent = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
29160
29166
  var { name, min: min2 = 0, max: max2 = 100, step = 1, orientation = "horizontal", disabled = !1, minStepsBetweenThumbs = 0, defaultValue = [
29161
29167
  min2
29162
29168
  ], value, onValueChange = function() {