@tamagui/core 1.116.8 → 1.116.9

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
@@ -3754,7 +3754,7 @@ If this is intended and you are using Tamagui without any themes, you can disabl
3754
3754
  }
3755
3755
  function getIsInversed(manager) {
3756
3756
  for (var isInversed = !1, cur = manager; cur; ) {
3757
- if (!cur.parentManager) return !1;
3757
+ if (!cur.parentManager) return isInversed;
3758
3758
  cur.parentManager.state.scheme !== cur.state.scheme && (isInversed = !isInversed), cur = cur.parentManager;
3759
3759
  }
3760
3760
  return !1;
@@ -7144,7 +7144,7 @@ var require_getSplitStyles_native = __commonJS({
7144
7144
  viewProps[key] = val;
7145
7145
  }
7146
7146
  }, keyInit = keyOg, valInit = props[keyInit];
7147
- if (accept) {
7147
+ if (process.env.NODE_ENV === "development" && debug === "profile" && time`prop-${keyInit}`, accept) {
7148
7148
  var accepted = accept[keyInit];
7149
7149
  if ((accepted === "style" || accepted === "textStyle") && valInit && typeof valInit == "object") {
7150
7150
  viewProps[keyInit] = getSubStyle(styleState, keyInit, valInit, styleProps.noClass);
@@ -7250,6 +7250,7 @@ current`, {
7250
7250
  }
7251
7251
  }
7252
7252
  }
7253
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-propsend`;
7253
7254
  var avoidNormalize = styleProps.noNormalize === !1;
7254
7255
  if (!avoidNormalize) {
7255
7256
  if (styleState.style && ((0, import_expandStyles.fixStyles)(styleState.style), import_constants2.isWeb && !isReactNative && (0, import_getStylesAtomic.styleToCSS)(styleState.style)), styleState.flatTransforms) {
@@ -7313,6 +7314,7 @@ current`, {
7313
7314
  }
7314
7315
  process.env.NODE_ENV === "development" && debug && debug !== "profile" && (0, import_log.log)(`Found fontFamily native: ${style1.fontFamily}`, faceInfo);
7315
7316
  }
7317
+ process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-pre-result`;
7316
7318
  var result = {
7317
7319
  space,
7318
7320
  hasMedia,
@@ -7360,7 +7362,7 @@ current`, {
7360
7362
  }
7361
7363
  console.groupEnd();
7362
7364
  }
7363
- return result;
7365
+ return process.env.NODE_ENV === "development" && debug === "profile" && time`split-styles-done`, result;
7364
7366
  };
7365
7367
  function mergeClassName(transforms, classNames, key, val) {
7366
7368
  var isMediaOrPseudo = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : !1, isInsertingNow = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : !1;
@@ -8372,7 +8374,7 @@ var require_createComponent_native = __commonJS({
8372
8374
  }
8373
8375
  });
8374
8376
  module2.exports = __toCommonJS2(createComponent_exports);
8375
- var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8377
+ var import_jsx_runtime = require("react/jsx-runtime"), import_compose_refs = require_index_native5(), import_constants2 = require_index_native3(), import_helpers = require_index_native4(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_constants22 = require_constants_native2(), import_isDevTools = require_isDevTools_native(), import_ComponentContext = require_ComponentContext_native(), import_createVariable = require_createVariable_native(), import_defaultComponentState = require_defaultComponentState_native(), import_getSplitStyles = require_getSplitStyles_native(), import_log = require_log_native(), import_mergeProps = require_mergeProps_native(), import_setElementProps = require_setElementProps_native(), import_subscribeToContextGroup = require_subscribeToContextGroup_native(), import_themeable = require_themeable_native(), import_wrapStyleTags = require_wrapStyleTags_native(), import_useComponentState = require_useComponentState_native(), import_useMedia = require_useMedia_native(), import_useTheme = require_useTheme_native(), import_setupHooks = require_setupHooks_native(), import_Slot = require_Slot_native(), import_Theme = require_Theme_native(), import_ThemeDebug = require_ThemeDebug_native(), tamaguiConfig, time2, debugKeyListeners, startVisualizer, componentSetStates = /* @__PURE__ */ new Set();
8376
8378
  typeof document < "u" && (cancelTouches = function() {
8377
8379
  componentSetStates.forEach(function(setState) {
8378
8380
  return setState(function(prev) {
@@ -8450,7 +8452,7 @@ var require_createComponent_native = __commonJS({
8450
8452
  }
8451
8453
  var componentContext = import_react3.default.useContext(import_ComponentContext.ComponentContext), styledContextProps, overriddenContextProps, contextValue, { context, isReactNative } = staticConfig;
8452
8454
  if (context && (contextValue = import_react3.default.useContext(context), contextValue)) {
8453
- process.env.NODE_ENV === "development" && (propsIn.debug || defaultProps != null && defaultProps.debug) && (0, import_log.log)(" \u{1F447} contextValue", contextValue);
8455
+ process.env.NODE_ENV === "development" && (defaultProps == null ? void 0 : defaultProps.debug) === "verbose" && (0, import_log.log)(" \u{1F447} contextValue", contextValue);
8454
8456
  for (var key in context.props) {
8455
8457
  var propVal = propsIn[key];
8456
8458
  if (propVal === void 0) {
@@ -8483,15 +8485,15 @@ var require_createComponent_native = __commonJS({
8483
8485
  componentName2
8484
8486
  ]), !1)
8485
8487
  var timer;
8486
- process.env.NODE_ENV === "development" && time && time`start (ignore)`, process.env.NODE_ENV === "development" && time && time`did-finish-ssr`, process.env.NODE_ENV === "development" && time && time`stateref`;
8488
+ process.env.NODE_ENV === "development" && time2 && time2`start (ignore)`;
8487
8489
  var animationDriver = componentContext.animationDriver, useAnimations = animationDriver == null ? void 0 : animationDriver.useAnimations, { curStateRef, disabled, groupName, hasAnimationProp, hasEnterStyle, isAnimated, isExiting, isHydrated, presence, presenceState, setState, setStateShallow, noClass, state, stateRef, supportsCSSVars, willBeAnimated, willBeAnimatedClient } = (0, import_useComponentState.useComponentState)(props, componentContext, staticConfig, config);
8488
- process.env.NODE_ENV === "development" && time && time`use-state`;
8490
+ process.env.NODE_ENV === "development" && time2 && time2`use-state`;
8489
8491
  var hasTextAncestor = !!(import_constants2.isWeb && isText && componentContext.inText);
8490
- process.env.NODE_ENV === "development" && time && time`use-context`;
8492
+ process.env.NODE_ENV === "development" && time2 && time2`use-context`;
8491
8493
  var isTaggable = !Component || typeof Component == "string", tagProp = props.tag, element = import_constants2.isWeb && isTaggable && tagProp || Component, BaseTextComponent = BaseText || element || "span", BaseViewComponent = BaseView || element || (hasTextAncestor ? "span" : "div"), elementType = isText ? BaseTextComponent : BaseViewComponent;
8492
8494
  animationDriver && isAnimated && (elementType = animationDriver[isText ? "Text" : "View"] || elementType);
8493
8495
  var disableThemeProp = !1, disableTheme = disableThemeProp || isHOC;
8494
- process.env.NODE_ENV === "development" && time && time`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
8496
+ process.env.NODE_ENV === "development" && time2 && time2`theme-props`, props.themeShallow && (curStateRef.themeShallow = !0);
8495
8497
  var themeStateProps = {
8496
8498
  componentName: componentName2,
8497
8499
  disable: disableTheme,
@@ -8528,13 +8530,13 @@ var require_createComponent_native = __commonJS({
8528
8530
  }), console.groupEnd();
8529
8531
  }
8530
8532
  }
8531
- process.env.NODE_ENV === "development" && time && time`pre-theme-media`;
8533
+ process.env.NODE_ENV === "development" && time2 && time2`pre-theme-media`;
8532
8534
  var [themeState, theme] = (0, import_useTheme.useThemeWithState)(themeStateProps);
8533
8535
  elementType = Component || elementType;
8534
8536
  var isStringElement = typeof elementType == "string";
8535
- process.env.NODE_ENV === "development" && time && time`theme`;
8537
+ process.env.NODE_ENV === "development" && time2 && time2`theme`;
8536
8538
  var mediaState2 = (0, import_useMedia.useMedia)(componentContext, debugProp);
8537
- (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time && time`media`;
8539
+ (0, import_createVariable.setDidGetVariableValue)(!1), process.env.NODE_ENV === "development" && time2 && time2`media`;
8538
8540
  var resolveValues = (
8539
8541
  // if HOC + mounted + has animation prop, resolve as value so it passes non-variable to child
8540
8542
  isAnimated && !supportsCSSVars || isHOC && state.unmounted == !1 && hasAnimationProp ? "value" : "auto"
@@ -8546,12 +8548,14 @@ var require_createComponent_native = __commonJS({
8546
8548
  isAnimated,
8547
8549
  willBeAnimated,
8548
8550
  styledContextProps
8549
- }, splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "", state, styleProps, null, componentContext, elementType, debugProp);
8550
- if (props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
8551
+ }, themeName = (themeState == null || (_themeState_state = themeState.state) === null || _themeState_state === void 0 ? void 0 : _themeState_state.name) || "";
8552
+ process.env.NODE_ENV === "development" && time2 && time2`split-styles-prepare`;
8553
+ var splitStyles = (0, import_getSplitStyles.useSplitStyles)(props, staticConfig, theme, themeName, state, styleProps, null, componentContext, elementType, debugProp);
8554
+ if (process.env.NODE_ENV === "development" && time2 && time2`split-styles`, props.group && props.untilMeasured === "hide" && !curStateRef.hasMeasured) {
8551
8555
  var _splitStyles;
8552
8556
  (_splitStyles = splitStyles).style || (_splitStyles.style = {}), splitStyles.style.opacity = 0;
8553
8557
  }
8554
- process.env.NODE_ENV === "development" && time && time`split-styles`, curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8558
+ curStateRef.isListeningToTheme = splitStyles.dynamicThemeAccess;
8555
8559
  var hasRuntimeMediaKeys = splitStyles.hasMedia && splitStyles.hasMedia !== !0, shouldListenForMedia = (0, import_createVariable.didGetVariableValue)() || hasRuntimeMediaKeys || noClass && splitStyles.hasMedia === !0, mediaListeningKeys = hasRuntimeMediaKeys ? splitStyles.hasMedia : null;
8556
8560
  process.env.NODE_ENV === "development" && debugProp === "verbose" && console.info("useMedia() createComponent", shouldListenForMedia, mediaListeningKeys), (0, import_useMedia.setMediaShouldUpdate)(stateRef, shouldListenForMedia, mediaListeningKeys);
8557
8561
  var { viewProps: viewPropsIn, pseudos, style: splitStylesStyle, classNames, space } = splitStyles, propsWithAnimation = props, {
@@ -8597,11 +8601,11 @@ var require_createComponent_native = __commonJS({
8597
8601
  staticConfig,
8598
8602
  stateRef
8599
8603
  });
8600
- (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`)), process.env.NODE_ENV === "development" && time && time`animations`;
8604
+ (isAnimated || supportsCSSVars) && animations && (animationStyles = animations.style, viewProps.style = animationStyles, animations.className && (viewProps.className = `${state.unmounted === "should-enter" ? "t_unmounted " : ""}${viewProps.className || ""} ${animations.className}`)), process.env.NODE_ENV === "development" && time2 && time2`animations`;
8601
8605
  }
8602
8606
  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.
8603
8607
 
8604
- 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" && time && time`destructure`, groupName && (nonTamaguiProps.onLayout = (0, import_helpers.composeEventHandlers)(nonTamaguiProps.onLayout, function(e) {
8608
+ 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) {
8605
8609
  stateRef.current.group.emit(groupName, {
8606
8610
  layout: e.nativeEvent.layout
8607
8611
  }), !stateRef.current.hasMeasured && props.untilMeasured === "hide" && setState(function(prev) {
@@ -8614,7 +8618,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8614
8618
  }, forwardedRef, import_setElementProps.setElementProps)), viewProps.ref = curStateRef.composedRef, process.env.NODE_ENV === "development" && !isReactNative && !isText && import_constants2.isWeb && !isHOC && import_react3.default.Children.toArray(props.children).forEach(function(item) {
8615
8619
  typeof item == "string" && item !== `
8616
8620
  ` && console.error(`Unexpected text node: ${item}. A text node cannot be a child of a <View>.`);
8617
- }), process.env.NODE_ENV === "development" && time && time`events-hooks`;
8621
+ }), process.env.NODE_ENV === "development" && time2 && time2`events-hooks`;
8618
8622
  var { pseudoGroups, mediaGroups } = splitStyles, unPress = function() {
8619
8623
  return setStateShallow({
8620
8624
  press: !1,
@@ -8671,7 +8675,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8671
8675
  ]).join("") : 0
8672
8676
  ]);
8673
8677
  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), 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);
8674
- process.env.NODE_ENV === "development" && time && time`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
8678
+ process.env.NODE_ENV === "development" && time2 && time2`events-setup`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("\u{1FAA9} events()", {
8675
8679
  runtimeFocusStyle,
8676
8680
  runtimePressStyle,
8677
8681
  runtimeHoverStyle,
@@ -8743,13 +8747,13 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8743
8747
  minPressDuration: 0
8744
8748
  });
8745
8749
  }
8746
- process.env.NODE_ENV === "development" && time && time`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", {
8750
+ process.env.NODE_ENV === "development" && time2 && time2`events`, process.env.NODE_ENV === "development" && debugProp === "verbose" && (0, import_log.log)("events", {
8747
8751
  events,
8748
8752
  attachHover,
8749
8753
  attachPress
8750
8754
  }), (_hooks_useEvents = import_setupHooks.hooks.useEvents) === null || _hooks_useEvents === void 0 || _hooks_useEvents.call(import_setupHooks.hooks, viewProps, events, splitStyles, setStateShallow, staticConfig);
8751
8755
  var direction = props.spaceDirection || "both";
8752
- process.env.NODE_ENV === "development" && time && time`hooks`;
8756
+ process.env.NODE_ENV === "development" && time2 && time2`hooks`;
8753
8757
  var content = !children || asChild ? children : spacedChildren({
8754
8758
  separator,
8755
8759
  children,
@@ -8763,13 +8767,13 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8763
8767
  onPress,
8764
8768
  onLongPress
8765
8769
  });
8766
- process.env.NODE_ENV === "development" && time && time`spaced-as-child`;
8770
+ process.env.NODE_ENV === "development" && time2 && time2`spaced-as-child`;
8767
8771
  var useChildrenResult;
8768
8772
  import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps, events, staticConfig)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
8769
8773
  var ResetPresence = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence;
8770
8774
  ResetPresence && willBeAnimated && (hasEnterStyle || presenceState) && content && typeof content != "string" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResetPresence, {
8771
8775
  children: content
8772
- })), process.env.NODE_ENV === "development" && time && time`create-element`;
8776
+ })), process.env.NODE_ENV === "development" && time2 && time2`create-element`;
8773
8777
  var groupState = curStateRef.group, subGroupContext = import_react3.default.useMemo(function() {
8774
8778
  var _splitStyles_style, _splitStyles_style1;
8775
8779
  if (!(!groupState || !groupName)) return groupState.listeners.clear(), {
@@ -8797,7 +8801,7 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8797
8801
  ...componentContext,
8798
8802
  groups: subGroupContext,
8799
8803
  children: content
8800
- })), process.env.NODE_ENV === "development" && time && time`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time && time`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
8804
+ })), process.env.NODE_ENV === "development" && time2 && time2`group-context`, content = disableTheme ? content : (0, import_Theme.getThemedChildren)(themeState, content, themeStateProps, !1, stateRef), process.env.NODE_ENV === "development" && time2 && time2`themed-children`, process.env.NODE_ENV === "development" && props.debug === "visualize" && (content = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_ThemeDebug.ThemeDebug, {
8801
8805
  themeState,
8802
8806
  themeProps: props,
8803
8807
  children: content
@@ -8862,8 +8866,8 @@ If you meant to do this, you can disable this warning - either change untilMeasu
8862
8866
  }
8863
8867
  if (debugProp === "break") debugger;
8864
8868
  }
8865
- return process.env.NODE_ENV === "development" && time && (time`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function() {
8866
- delete globalThis.willPrint, time.print(), time = null;
8869
+ return process.env.NODE_ENV === "development" && time2 && (time2`rest`, globalThis.willPrint || (globalThis.willPrint = !0, setTimeout(function() {
8870
+ delete globalThis.willPrint, time2.print(), time2 = null;
8867
8871
  }, 50))), content;
8868
8872
  });
8869
8873
  staticConfig.componentName && (component.displayName = staticConfig.componentName);