@tamagui/core 3.0.0-beta.1604.1 → 3.0.0-beta.1670.1

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.cjs CHANGED
@@ -11416,8 +11416,8 @@ function getEventPointerId(e) {
11416
11416
  var pointerId = (_ref6 = (_ref5 = (_ref4 = (_ref3 = (_ref2 = (_ref1 = (_ref = (_e_pointerId = e === null || e === void 0 ? void 0 : e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : e === null || e === void 0 ? void 0 : (_e_pointer = e.pointer) === null || _e_pointer === void 0 ? void 0 : _e_pointer.id) !== null && _ref !== void 0 ? _ref : e === null || e === void 0 ? void 0 : (_e_event = e.event) === null || _e_event === void 0 ? void 0 : _e_event.pointerId) !== null && _ref1 !== void 0 ? _ref1 : e === null || e === void 0 ? void 0 : (_e_event1 = e.event) === null || _e_event1 === void 0 ? void 0 : (_e_event_pointer = _e_event1.pointer) === null || _e_event_pointer === void 0 ? void 0 : _e_event_pointer.id) !== null && _ref2 !== void 0 ? _ref2 : e === null || e === void 0 ? void 0 : (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.pointerId) !== null && _ref3 !== void 0 ? _ref3 : e === null || e === void 0 ? void 0 : (_e_nativeEvent1 = e.nativeEvent) === null || _e_nativeEvent1 === void 0 ? void 0 : _e_nativeEvent1.id) !== null && _ref4 !== void 0 ? _ref4 : e === null || e === void 0 ? void 0 : (_e_event2 = e.event) === null || _e_event2 === void 0 ? void 0 : (_e_event_nativeEvent = _e_event2.nativeEvent) === null || _e_event_nativeEvent === void 0 ? void 0 : _e_event_nativeEvent.pointerId) !== null && _ref5 !== void 0 ? _ref5 : e === null || e === void 0 ? void 0 : (_e_event3 = e.event) === null || _e_event3 === void 0 ? void 0 : (_e_event_nativeEvent1 = _e_event3.nativeEvent) === null || _e_event_nativeEvent1 === void 0 ? void 0 : _e_event_nativeEvent1.id) !== null && _ref6 !== void 0 ? _ref6 : null;
11417
11417
  return pointerId == null || Number.isNaN(pointerId) ? null : Number(pointerId);
11418
11418
  }
11419
- var _;
11420
- var pressState = (_ = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _ !== void 0 ? _ : _globalThis[_PRESS_STATE_KEY] = {
11419
+ var _$1;
11420
+ var pressState = (_$1 = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _$1 !== void 0 ? _$1 : _globalThis[_PRESS_STATE_KEY] = {
11421
11421
  owner: null,
11422
11422
  ownerId: null,
11423
11423
  ownerSource: null,
@@ -11637,7 +11637,12 @@ function hasSafeAreaSetup() {
11637
11637
  }
11638
11638
  //#endregion
11639
11639
  //#region ../native/dist/esm/nativeMenuContext.native.js
11640
- var NativeMenuContext = (0, react.createContext)(false);
11640
+ var _g;
11641
+ var _KEY;
11642
+ var KEY = "__tamagui_native_menu_context__";
11643
+ var g = globalThis;
11644
+ var _;
11645
+ var NativeMenuContext = (_ = (_g = g)[_KEY = KEY]) !== null && _ !== void 0 ? _ : _g[_KEY] = (0, react.createContext)(false);
11641
11646
  //#endregion
11642
11647
  //#region ../web/dist/esm/helpers/resolveSafeAreaVariable.native.js
11643
11648
  function resolveSafeAreaVariable(name) {
@@ -12660,6 +12665,27 @@ function extractValueFromDynamic(val, scheme) {
12660
12665
  //#region ../web/dist/esm/helpers/themeUpdateState.native.js
12661
12666
  var themeUpdateStateKey = "_tmgInlineLayer";
12662
12667
  //#endregion
12668
+ //#region ../web/dist/esm/helpers/themes.native.js
12669
+ var schemeKey = /* @__PURE__ */ Symbol.for("tamagui.theme.scheme");
12670
+ function getAuthoredThemeScheme(theme) {
12671
+ var scheme = theme[schemeKey];
12672
+ return scheme === "light" || scheme === "dark" ? scheme : void 0;
12673
+ }
12674
+ function copyAuthoredThemeScheme(target, source) {
12675
+ var scheme = getAuthoredThemeScheme(source);
12676
+ if (scheme) Object.defineProperty(target, schemeKey, { value: scheme });
12677
+ return target;
12678
+ }
12679
+ function ensureThemeVariable(theme, key) {
12680
+ var val = theme[key];
12681
+ var variable = isVariable(val);
12682
+ if (!variable || val.name !== key) theme[key] = createVariable({
12683
+ key: variable ? val.name : key,
12684
+ name: key,
12685
+ val: variable ? val.val : val
12686
+ });
12687
+ }
12688
+ //#endregion
12663
12689
  //#region ../web/dist/esm/hooks/useThemeState.native.js
12664
12690
  var ThemeStateContext = (0, react.createContext)("");
12665
12691
  var allListeners = /* @__PURE__ */ new Map();
@@ -12716,6 +12742,7 @@ var incReducer = function(c) {
12716
12742
  var useThemeState = function(props) {
12717
12743
  "use no memo";
12718
12744
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
12745
+ var _props__themeUpdate;
12719
12746
  var _ref;
12720
12747
  var { disable } = props;
12721
12748
  var parentId = (0, react.useContext)(ThemeStateContext);
@@ -12726,16 +12753,10 @@ var useThemeState = function(props) {
12726
12753
  theme: getConfig().themes.light
12727
12754
  };
12728
12755
  var id = (0, react.useId)();
12729
- var propsKey = getPropsKey(props);
12756
+ var propsKey = `${props.name || ""}${props.forceClassName || ""}${((_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.key) || ""}`;
12730
12757
  if (cascadeOnChange) registerThemeProviderChain(id, parentId, props);
12731
12758
  var r = (_ref = (0, react.useRef)(null)).current || (_ref.current = {
12732
12759
  id,
12733
- parentId,
12734
- props,
12735
- propsKey,
12736
- isRoot,
12737
- keys,
12738
- schemeKeys,
12739
12760
  optimizeForFirstRender,
12740
12761
  renderVersion: 0
12741
12762
  });
@@ -12756,7 +12777,10 @@ var useThemeState = function(props) {
12756
12777
  r.state = r.lastSnap;
12757
12778
  }
12758
12779
  if (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);
12759
- if (r.unsubscribe && r.subscribedTo !== r.parentId) cleanupThemeSubscription(r);
12780
+ if (r.unsubscribe && r.subscribedTo !== r.parentId) {
12781
+ var _r_unsubscribe;
12782
+ (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
12783
+ }
12760
12784
  if (shouldSubscribeToTheme(r, cascadeOnChange)) {
12761
12785
  if (!r.unsubscribe) {
12762
12786
  var _listenersByParent, _pid;
@@ -12789,7 +12813,10 @@ var useThemeState = function(props) {
12789
12813
  r.subscribedTo = void 0;
12790
12814
  };
12791
12815
  }
12792
- } else if (r.unsubscribe) cleanupThemeSubscription(r);
12816
+ } else if (r.unsubscribe) {
12817
+ var _r_unsubscribe1;
12818
+ (_r_unsubscribe1 = r.unsubscribe) === null || _r_unsubscribe1 === void 0 || _r_unsubscribe1.call(r);
12819
+ }
12793
12820
  return function() {
12794
12821
  if (r.renderVersion === renderVersion) cleanupThemeState(r);
12795
12822
  };
@@ -12813,12 +12840,8 @@ var shouldSubscribeToTheme = function(r, cascadeOnChange) {
12813
12840
  var _r_keys_current, _r_props_needsUpdate, _r_props;
12814
12841
  return Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || ((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || ((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props)));
12815
12842
  };
12816
- function cleanupThemeSubscription(r) {
12817
- var _r_unsubscribe;
12818
- (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
12819
- }
12820
12843
  function cleanupThemeState(r) {
12821
- if (r.unsubscribe) cleanupThemeSubscription(r);
12844
+ if (r.unsubscribe) r.unsubscribe();
12822
12845
  else {
12823
12846
  r.state = void 0;
12824
12847
  states.delete(r.id);
@@ -12829,15 +12852,15 @@ function cleanupThemeState(r) {
12829
12852
  }
12830
12853
  var getSnapshotImpl = function(r) {
12831
12854
  var _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate;
12832
- var { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;
12855
+ var { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r;
12856
+ var schemeKeys = r.schemeKeys;
12833
12857
  var local = r.state;
12834
12858
  var parentState = states.get(parentId);
12835
12859
  if (local && !PendingUpdate.has(id)) {
12836
12860
  if (parentState && local._parentName === parentState.name && local._parentSchemeAuthored === parentState.schemeAuthored && local._propsKey === propsKey) return local;
12837
12861
  }
12838
12862
  var isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
12839
- var allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
12840
- var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);
12863
+ var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && ((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
12841
12864
  var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
12842
12865
  var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
12843
12866
  var next = nextRaw;
@@ -12890,7 +12913,7 @@ var getNextState = function(lastState, props, propsKey) {
12890
12913
  if (shouldRerender) return [true, _objectSpread2({}, parentState || lastState || next)];
12891
12914
  return [false, next];
12892
12915
  }
12893
- var scheme = getThemeScheme(resolvedName);
12916
+ var scheme = getAuthoredThemeScheme(themes[resolvedName]) || getThemeScheme(resolvedName);
12894
12917
  var _parentState_inverses;
12895
12918
  var parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;
12896
12919
  var isInverse = Boolean(parentState && scheme !== parentState.scheme);
@@ -12977,10 +13000,6 @@ function resolveThemeName(parentName, name, themes2) {
12977
13000
  if (!forceUpdate && found === parentName && found !== "light" && found !== "dark") return null;
12978
13001
  return found;
12979
13002
  }
12980
- var getPropsKey = function(param) {
12981
- var { name, forceClassName, _themeUpdate } = param;
12982
- return `${name || ""}${forceClassName || ""}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || ""}`;
12983
- };
12984
13003
  var hasThemeUpdatingProps = function(props) {
12985
13004
  return "name" in props || "forceClassName" in props || "_themeUpdate" in props;
12986
13005
  };
@@ -13648,30 +13667,54 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
13648
13667
  if (isUsingRNGH) {
13649
13668
  var callbacksRef = (0, react.useRef)(isUsingRNGH ? {} : null);
13650
13669
  var gestureRef = (0, react.useRef)(null);
13670
+ var longPressTimerRef = (0, react.useRef)(null);
13671
+ var longPressedRef = (0, react.useRef)(false);
13672
+ var clearLongPress = function() {
13673
+ if (longPressTimerRef.current) clearTimeout(longPressTimerRef.current);
13674
+ longPressTimerRef.current = null;
13675
+ };
13676
+ react.default.useEffect(function() {
13677
+ return clearLongPress;
13678
+ }, []);
13651
13679
  var pressActiveRef = (0, react.useRef)(false);
13652
13680
  var beginPress = function(e) {
13653
13681
  var _callbacksRef_current_onPressIn, _callbacksRef_current;
13654
13682
  if (pressActiveRef.current) return;
13655
13683
  pressActiveRef.current = true;
13684
+ if (isInsideNativeMenu) {
13685
+ clearLongPress();
13686
+ longPressedRef.current = false;
13687
+ if (callbacksRef.current.onLongPress) {
13688
+ var _callbacksRef_current_delayLongPress;
13689
+ longPressTimerRef.current = setTimeout(function() {
13690
+ var _callbacksRef_current_onLongPress, _callbacksRef_current2;
13691
+ longPressTimerRef.current = null;
13692
+ longPressedRef.current = true;
13693
+ (_callbacksRef_current_onLongPress = (_callbacksRef_current2 = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 || _callbacksRef_current_onLongPress.call(_callbacksRef_current2, e !== null && e !== void 0 ? e : {});
13694
+ }, (_callbacksRef_current_delayLongPress = callbacksRef.current.delayLongPress) !== null && _callbacksRef_current_delayLongPress !== void 0 ? _callbacksRef_current_delayLongPress : 500);
13695
+ }
13696
+ }
13656
13697
  (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 || _callbacksRef_current_onPressIn.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
13657
13698
  };
13658
13699
  var endPress = function(e) {
13659
13700
  var firePress = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
13660
13701
  var _callbacksRef_current_onPress, _callbacksRef_current, _callbacksRef_current_onPressOut, _callbacksRef_current1;
13702
+ clearLongPress();
13661
13703
  if (!pressActiveRef.current) return;
13662
13704
  pressActiveRef.current = false;
13663
- if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
13705
+ if (firePress && !longPressedRef.current) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
13664
13706
  (_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});
13665
13707
  };
13666
- useMainThreadPressEvents(events, viewProps, Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents), debugName);
13708
+ useMainThreadPressEvents(events, viewProps, Boolean(!isInsideNativeMenu && (hasRealPressEvents || getIsAndroid() && hasPressEvents)), debugName);
13667
13709
  if (everEnabled) {
13668
13710
  callbacksRef.current = hasPressEvents ? {
13669
13711
  onPressIn: events.onPressIn,
13670
13712
  onPressOut: events.onPressOut,
13671
13713
  onPress: events.onPress,
13672
- onLongPress: events.onLongPress
13714
+ onLongPress: events.onLongPress,
13715
+ delayLongPress: events.delayLongPress
13673
13716
  } : {};
13674
- if (hasRealPressEvents) {
13717
+ if (hasRealPressEvents && !isInsideNativeMenu) {
13675
13718
  endPress();
13676
13719
  gestureRef.current = null;
13677
13720
  return null;
@@ -15063,7 +15106,6 @@ function contributeProp(pass, keyOg, valOg) {
15063
15106
  var shouldCheckSkipProps = !noSkip;
15064
15107
  var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
15065
15108
  var isTextOrInput = isText || isInput;
15066
- var hocParentVariants = isHOC ? parentVariants : void 0;
15067
15109
  var keyInit = keyOg;
15068
15110
  var valInit = valOg;
15069
15111
  if (keyInit === "children") {
@@ -15264,9 +15306,8 @@ function contributeProp(pass, keyOg, valOg) {
15264
15306
  var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
15265
15307
  var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
15266
15308
  if (isStyleProp && asChildExceptStyleLike) return;
15267
- var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
15268
- var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
15269
- var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
15309
+ var shouldPassProp = !isStyleProp && isHOC || parentVariants && keyInit in parentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
15310
+ var isHOCShouldPassThrough = isHOC && keyInit in skipProps;
15270
15311
  if (shouldPassProp || isHOCShouldPassThrough) {
15271
15312
  if (keyInit in viewProps) delete viewProps[keyInit];
15272
15313
  viewProps[keyInit] = valInit;
@@ -15322,7 +15363,7 @@ function contributeProp(pass, keyOg, valOg) {
15322
15363
  viewProps[keyInit] = valInit;
15323
15364
  }
15324
15365
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
15325
- var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
15366
+ var _staticConfig_Component_staticConfig, _staticConfig_Component, _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
15326
15367
  var conf = getConfig();
15327
15368
  styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
15328
15369
  var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
@@ -15381,7 +15422,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
15381
15422
  var frontendContainer;
15382
15423
  var frontendContainerType;
15383
15424
  var processedProps = props;
15384
- var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
15425
+ var parentVariants = isHOC ? (_staticConfig_Component = staticConfig.Component) === null || _staticConfig_Component === void 0 ? void 0 : (_staticConfig_Component_staticConfig = _staticConfig_Component.staticConfig) === null || _staticConfig_Component_staticConfig === void 0 ? void 0 : _staticConfig_Component_staticConfig.variants : void 0;
15385
15426
  var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
15386
15427
  var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
15387
15428
  var containerValue;
@@ -15403,7 +15444,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
15403
15444
  styledContextKeys,
15404
15445
  (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
15405
15446
  debug,
15406
- parentStaticConfig,
15447
+ void 0,
15407
15448
  defaultProps,
15408
15449
  driverAnimations,
15409
15450
  driverOutputStyle,
@@ -16300,7 +16341,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
16300
16341
  }
16301
16342
  if (typeof raw === "string" && property === "background") {
16302
16343
  var parts = splitComponents(raw);
16303
- if (parts.length === 1 && !startsValueFunction(parts[0])) {
16344
+ if (parts.length === 1 && (!startsValueFunction(parts[0]) || classifyBorderComponents(parts[0]).color)) {
16304
16345
  emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
16305
16346
  return;
16306
16347
  }
@@ -17838,7 +17879,7 @@ function createComponent(staticConfig) {
17838
17879
  });
17839
17880
  }
17840
17881
  }
17841
- content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents);
17882
+ content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents && !isInsideNativeMenu);
17842
17883
  var ResetPresence = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.ResetPresence;
17843
17884
  var needsReset = Boolean(!asChild && splitStyles && !isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
17844
17885
  var hasEverReset = stateRef.current.hasEverResetPresence;
@@ -18495,23 +18536,7 @@ function proxyThemeToParents(themeName, theme) {
18495
18536
  }
18496
18537
  }
18497
18538
  Object.assign(out, theme);
18498
- return out;
18499
- }
18500
- //#endregion
18501
- //#region ../web/dist/esm/helpers/themes.native.js
18502
- function ensureThemeVariable(theme, key) {
18503
- var val = theme[key];
18504
- var value = isVariable(val) ? val.val : val;
18505
- if (!isVariable(val)) theme[key] = createVariable({
18506
- key,
18507
- name: key,
18508
- val: value
18509
- });
18510
- else if (val.name !== key) theme[key] = createVariable({
18511
- key: val.name,
18512
- name: key,
18513
- val: value
18514
- });
18539
+ return copyAuthoredThemeScheme(out, theme);
18515
18540
  }
18516
18541
  //#endregion
18517
18542
  //#region ../web/dist/esm/helpers/variableValue.native.js
@@ -18768,7 +18793,7 @@ function createTamagui$2(configIn) {
18768
18793
  var themeConfig = (function() {
18769
18794
  var cssRuleSets = buildCSSRuleSets(createTokenCSS(tokens, shouldTokenCategoryHaveUnits), createFontCSS(fontsParsed, registerFontVariables), defaultFontToken);
18770
18795
  var themesIn = configIn.themes;
18771
- var dedupedThemes = foundThemes !== null && foundThemes !== void 0 ? foundThemes : getThemesDeduped(themesIn, tokens.color, configIn.variables, { tokensParsed });
18796
+ var dedupedThemes = foundThemes !== null && foundThemes !== void 0 ? foundThemes : getThemesDeduped(themesIn, tokensParsed, configIn.variables);
18772
18797
  return {
18773
18798
  themes: proxyThemesToParents(dedupedThemes, Object.keys(themesIn)),
18774
18799
  cssRuleSets,
@@ -18828,7 +18853,7 @@ function createTamagui$2(configIn) {
18828
18853
  initializeTamaguiConfig(config);
18829
18854
  return config;
18830
18855
  }
18831
- function getThemesDeduped(themes, colorTokens, variables, variablesCtx) {
18856
+ function getThemesDeduped(themes, tokensParsed, variables) {
18832
18857
  var dedupedThemes = [];
18833
18858
  var existing = /* @__PURE__ */ new Map();
18834
18859
  var sortedThemeNames = Object.keys(themes).sort(function(a, b) {
@@ -18840,14 +18865,17 @@ function getThemesDeduped(themes, colorTokens, variables, variablesCtx) {
18840
18865
  for (var _iterator = sortedThemeNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
18841
18866
  var themeName = _step.value;
18842
18867
  var rawTheme = themes[themeName];
18843
- var key = JSON.stringify(rawTheme);
18844
- if (existing.has(key)) {
18845
- existing.get(key).names.push(themeName);
18868
+ var scheme = getAuthoredThemeScheme(rawTheme);
18869
+ var key = JSON.stringify(rawTheme) + scheme;
18870
+ var e = existing.get(key);
18871
+ if (e) {
18872
+ e.names.push(themeName);
18846
18873
  continue;
18847
18874
  }
18848
- var theme = _objectSpread2(_objectSpread2({}, colorTokens), rawTheme);
18875
+ var theme = _objectSpread2(_objectSpread2({}, tokensParsed.color), rawTheme);
18849
18876
  for (var key1 in theme) ensureThemeVariable(theme, key1);
18850
- if (variables && variablesCtx && !themeName.includes("_")) mergeConfigVariablesIntoTheme(theme, themeName, variables, variablesCtx.tokensParsed);
18877
+ copyAuthoredThemeScheme(theme, rawTheme);
18878
+ if (variables && !themeName.includes("_")) mergeConfigVariablesIntoTheme(theme, themeName, variables, tokensParsed);
18851
18879
  var deduped = {
18852
18880
  names: [themeName],
18853
18881
  theme
@@ -1583,8 +1583,8 @@ function getEventPointerId(e) {
1583
1583
  var pointerId = (_ref6 = (_ref5 = (_ref4 = (_ref3 = (_ref2 = (_ref1 = (_ref = (_e_pointerId = e === null || e === void 0 ? void 0 : e.pointerId) !== null && _e_pointerId !== void 0 ? _e_pointerId : e === null || e === void 0 ? void 0 : (_e_pointer = e.pointer) === null || _e_pointer === void 0 ? void 0 : _e_pointer.id) !== null && _ref !== void 0 ? _ref : e === null || e === void 0 ? void 0 : (_e_event = e.event) === null || _e_event === void 0 ? void 0 : _e_event.pointerId) !== null && _ref1 !== void 0 ? _ref1 : e === null || e === void 0 ? void 0 : (_e_event1 = e.event) === null || _e_event1 === void 0 ? void 0 : (_e_event_pointer = _e_event1.pointer) === null || _e_event_pointer === void 0 ? void 0 : _e_event_pointer.id) !== null && _ref2 !== void 0 ? _ref2 : e === null || e === void 0 ? void 0 : (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.pointerId) !== null && _ref3 !== void 0 ? _ref3 : e === null || e === void 0 ? void 0 : (_e_nativeEvent1 = e.nativeEvent) === null || _e_nativeEvent1 === void 0 ? void 0 : _e_nativeEvent1.id) !== null && _ref4 !== void 0 ? _ref4 : e === null || e === void 0 ? void 0 : (_e_event2 = e.event) === null || _e_event2 === void 0 ? void 0 : (_e_event_nativeEvent = _e_event2.nativeEvent) === null || _e_event_nativeEvent === void 0 ? void 0 : _e_event_nativeEvent.pointerId) !== null && _ref5 !== void 0 ? _ref5 : e === null || e === void 0 ? void 0 : (_e_event3 = e.event) === null || _e_event3 === void 0 ? void 0 : (_e_event_nativeEvent1 = _e_event3.nativeEvent) === null || _e_event_nativeEvent1 === void 0 ? void 0 : _e_event_nativeEvent1.id) !== null && _ref6 !== void 0 ? _ref6 : null;
1584
1584
  return pointerId == null || Number.isNaN(pointerId) ? null : Number(pointerId);
1585
1585
  }
1586
- var _;
1587
- var pressState = (_ = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _ !== void 0 ? _ : _globalThis[_PRESS_STATE_KEY] = {
1586
+ var _$1;
1587
+ var pressState = (_$1 = (_globalThis = globalThis)[_PRESS_STATE_KEY = PRESS_STATE_KEY]) !== null && _$1 !== void 0 ? _$1 : _globalThis[_PRESS_STATE_KEY] = {
1588
1588
  owner: null,
1589
1589
  ownerId: null,
1590
1590
  ownerSource: null,
@@ -1804,7 +1804,12 @@ function hasSafeAreaSetup() {
1804
1804
  }
1805
1805
  //#endregion
1806
1806
  //#region ../native/dist/esm/nativeMenuContext.native.js
1807
- var NativeMenuContext = (0, react.createContext)(false);
1807
+ var _g;
1808
+ var _KEY;
1809
+ var KEY = "__tamagui_native_menu_context__";
1810
+ var g = globalThis;
1811
+ var _;
1812
+ var NativeMenuContext = (_ = (_g = g)[_KEY = KEY]) !== null && _ !== void 0 ? _ : _g[_KEY] = (0, react.createContext)(false);
1808
1813
  //#endregion
1809
1814
  //#region ../web/dist/esm/helpers/resolveSafeAreaVariable.native.js
1810
1815
  var didWarnMissingSetup = false;
@@ -2907,6 +2912,27 @@ function extractValueFromDynamic(val, scheme) {
2907
2912
  //#region ../web/dist/esm/helpers/themeUpdateState.native.js
2908
2913
  var themeUpdateStateKey = "_tmgInlineLayer";
2909
2914
  //#endregion
2915
+ //#region ../web/dist/esm/helpers/themes.native.js
2916
+ var schemeKey = /* @__PURE__ */ Symbol.for("tamagui.theme.scheme");
2917
+ function getAuthoredThemeScheme(theme) {
2918
+ var scheme = theme[schemeKey];
2919
+ return scheme === "light" || scheme === "dark" ? scheme : void 0;
2920
+ }
2921
+ function copyAuthoredThemeScheme(target, source) {
2922
+ var scheme = getAuthoredThemeScheme(source);
2923
+ if (scheme) Object.defineProperty(target, schemeKey, { value: scheme });
2924
+ return target;
2925
+ }
2926
+ function ensureThemeVariable(theme, key) {
2927
+ var val = theme[key];
2928
+ var variable = isVariable(val);
2929
+ if (!variable || val.name !== key) theme[key] = createVariable({
2930
+ key: variable ? val.name : key,
2931
+ name: key,
2932
+ val: variable ? val.val : val
2933
+ });
2934
+ }
2935
+ //#endregion
2910
2936
  //#region ../web/dist/esm/hooks/useThemeState.native.js
2911
2937
  var ThemeStateContext = (0, react.createContext)("");
2912
2938
  var allListeners = /* @__PURE__ */ new Map();
@@ -2963,6 +2989,7 @@ var incReducer = function(c) {
2963
2989
  var useThemeState = function(props) {
2964
2990
  "use no memo";
2965
2991
  var isRoot = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false, keys = arguments.length > 2 ? arguments[2] : void 0, schemeKeys = arguments.length > 3 ? arguments[3] : void 0, cascadeOnChange = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : false, optimizeForFirstRender = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : false;
2992
+ var _props__themeUpdate;
2966
2993
  var _ref;
2967
2994
  var { disable } = props;
2968
2995
  var parentId = (0, react.useContext)(ThemeStateContext);
@@ -2975,16 +3002,10 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
2975
3002
  theme: getConfig().themes.light
2976
3003
  };
2977
3004
  var id = (0, react.useId)();
2978
- var propsKey = getPropsKey(props);
3005
+ var propsKey = `${props.name || ""}${props.forceClassName || ""}${((_props__themeUpdate = props._themeUpdate) === null || _props__themeUpdate === void 0 ? void 0 : _props__themeUpdate.key) || ""}`;
2979
3006
  if (cascadeOnChange) registerThemeProviderChain(id, parentId, props);
2980
3007
  var r = (_ref = (0, react.useRef)(null)).current || (_ref.current = {
2981
3008
  id,
2982
- parentId,
2983
- props,
2984
- propsKey,
2985
- isRoot,
2986
- keys,
2987
- schemeKeys,
2988
3009
  optimizeForFirstRender,
2989
3010
  renderVersion: 0
2990
3011
  });
@@ -3005,7 +3026,10 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
3005
3026
  r.state = r.lastSnap;
3006
3027
  }
3007
3028
  if (cascadeOnChange && !themeProviderParents.has(r.id)) registerThemeProviderChain(r.id, r.parentId, r.props);
3008
- if (r.unsubscribe && r.subscribedTo !== r.parentId) cleanupThemeSubscription(r);
3029
+ if (r.unsubscribe && r.subscribedTo !== r.parentId) {
3030
+ var _r_unsubscribe;
3031
+ (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
3032
+ }
3009
3033
  if (shouldSubscribeToTheme(r, cascadeOnChange)) {
3010
3034
  if (!r.unsubscribe) {
3011
3035
  var _listenersByParent, _pid;
@@ -3038,7 +3062,10 @@ Looked for theme${props.name ? ` "${props.name}"` : ""}, but no parent theme con
3038
3062
  r.subscribedTo = void 0;
3039
3063
  };
3040
3064
  }
3041
- } else if (r.unsubscribe) cleanupThemeSubscription(r);
3065
+ } else if (r.unsubscribe) {
3066
+ var _r_unsubscribe1;
3067
+ (_r_unsubscribe1 = r.unsubscribe) === null || _r_unsubscribe1 === void 0 || _r_unsubscribe1.call(r);
3068
+ }
3042
3069
  return function() {
3043
3070
  if (r.renderVersion === renderVersion) cleanupThemeState(r);
3044
3071
  };
@@ -3062,12 +3089,8 @@ var shouldSubscribeToTheme = function(r, cascadeOnChange) {
3062
3089
  var _r_keys_current, _r_props_needsUpdate, _r_props;
3063
3090
  return Boolean(r.optimizeForFirstRender || r.isRoot || cascadeOnChange || hasThemeUpdatingProps(r.props) || ((_r_keys_current = r.keys.current) === null || _r_keys_current === void 0 ? void 0 : _r_keys_current.size) || ((_r_props_needsUpdate = (_r_props = r.props).needsUpdate) === null || _r_props_needsUpdate === void 0 ? void 0 : _r_props_needsUpdate.call(_r_props)));
3064
3091
  };
3065
- function cleanupThemeSubscription(r) {
3066
- var _r_unsubscribe;
3067
- (_r_unsubscribe = r.unsubscribe) === null || _r_unsubscribe === void 0 || _r_unsubscribe.call(r);
3068
- }
3069
3092
  function cleanupThemeState(r) {
3070
- if (r.unsubscribe) cleanupThemeSubscription(r);
3093
+ if (r.unsubscribe) r.unsubscribe();
3071
3094
  else {
3072
3095
  r.state = void 0;
3073
3096
  states.delete(r.id);
@@ -3078,15 +3101,15 @@ function cleanupThemeState(r) {
3078
3101
  }
3079
3102
  var getSnapshotImpl = function(r) {
3080
3103
  var _keys_current, _schemeKeys_current, _keys_current1, _props_needsUpdate;
3081
- var { id, parentId, props, propsKey, isRoot, keys, schemeKeys, optimizeForFirstRender } = r;
3104
+ var { id, parentId, props, propsKey, isRoot, keys, optimizeForFirstRender } = r;
3105
+ var schemeKeys = r.schemeKeys;
3082
3106
  var local = r.state;
3083
3107
  var parentState = states.get(parentId);
3084
3108
  if (local && !PendingUpdate.has(id)) {
3085
3109
  if (parentState && local._parentName === parentState.name && local._parentSchemeAuthored === parentState.schemeAuthored && local._propsKey === propsKey) return local;
3086
3110
  }
3087
3111
  var isSchemeOnlyChange = !optimizeForFirstRender && supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
3088
- var allKeysSchemeOptimized = !optimizeForFirstRender && Boolean(((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
3089
- var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && allKeysSchemeOptimized);
3112
+ var canSkipForSchemeChange = Boolean(isSchemeOnlyChange && ((_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) && (schemeKeys === null || schemeKeys === void 0 ? void 0 : (_schemeKeys_current = schemeKeys.current) === null || _schemeKeys_current === void 0 ? void 0 : _schemeKeys_current.size) === keys.current.size);
3090
3113
  var needsUpdate = props.passThrough ? false : optimizeForFirstRender ? true : isRoot || props.forceClassName || props.name === "light" || props.name === "dark" || props.name === null ? true : !HasRenderedOnce.get(keys) ? true : canSkipForSchemeChange ? false : (keys === null || keys === void 0 ? void 0 : (_keys_current1 = keys.current) === null || _keys_current1 === void 0 ? void 0 : _keys_current1.size) ? true : (_props_needsUpdate = props.needsUpdate) === null || _props_needsUpdate === void 0 ? void 0 : _props_needsUpdate.call(props);
3091
3114
  var [rerender, nextRaw] = getNextState(local, props, propsKey, isRoot, id, parentId, needsUpdate, PendingUpdate.get(id));
3092
3115
  var next = nextRaw;
@@ -3139,7 +3162,7 @@ var getNextState = function(lastState, props, propsKey) {
3139
3162
  if (shouldRerender) return [true, _objectSpread2({}, parentState || lastState || next)];
3140
3163
  return [false, next];
3141
3164
  }
3142
- var scheme = getThemeScheme(resolvedName);
3165
+ var scheme = getAuthoredThemeScheme(themes[resolvedName]) || getThemeScheme(resolvedName);
3143
3166
  var _parentState_inverses;
3144
3167
  var parentInverses = (_parentState_inverses = parentState === null || parentState === void 0 ? void 0 : parentState.inverses) !== null && _parentState_inverses !== void 0 ? _parentState_inverses : 0;
3145
3168
  var isInverse = Boolean(parentState && scheme !== parentState.scheme);
@@ -3226,10 +3249,6 @@ function resolveThemeName(parentName, name, themes2) {
3226
3249
  if (!forceUpdate && found === parentName && found !== "light" && found !== "dark") return null;
3227
3250
  return found;
3228
3251
  }
3229
- var getPropsKey = function(param) {
3230
- var { name, forceClassName, _themeUpdate } = param;
3231
- return `${name || ""}${forceClassName || ""}${(_themeUpdate === null || _themeUpdate === void 0 ? void 0 : _themeUpdate.key) || ""}`;
3232
- };
3233
3252
  var hasThemeUpdatingProps = function(props) {
3234
3253
  return "name" in props || "forceClassName" in props || "_themeUpdate" in props;
3235
3254
  };
@@ -3923,30 +3942,54 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
3923
3942
  if (isUsingRNGH) {
3924
3943
  var callbacksRef = (0, react.useRef)(isUsingRNGH ? {} : null);
3925
3944
  var gestureRef = (0, react.useRef)(null);
3945
+ var longPressTimerRef = (0, react.useRef)(null);
3946
+ var longPressedRef = (0, react.useRef)(false);
3947
+ var clearLongPress = function() {
3948
+ if (longPressTimerRef.current) clearTimeout(longPressTimerRef.current);
3949
+ longPressTimerRef.current = null;
3950
+ };
3951
+ react.default.useEffect(function() {
3952
+ return clearLongPress;
3953
+ }, []);
3926
3954
  var pressActiveRef = (0, react.useRef)(false);
3927
3955
  var beginPress = function(e) {
3928
3956
  var _callbacksRef_current_onPressIn, _callbacksRef_current;
3929
3957
  if (pressActiveRef.current) return;
3930
3958
  pressActiveRef.current = true;
3959
+ if (isInsideNativeMenu) {
3960
+ clearLongPress();
3961
+ longPressedRef.current = false;
3962
+ if (callbacksRef.current.onLongPress) {
3963
+ var _callbacksRef_current_delayLongPress;
3964
+ longPressTimerRef.current = setTimeout(function() {
3965
+ var _callbacksRef_current_onLongPress, _callbacksRef_current2;
3966
+ longPressTimerRef.current = null;
3967
+ longPressedRef.current = true;
3968
+ (_callbacksRef_current_onLongPress = (_callbacksRef_current2 = callbacksRef.current).onLongPress) === null || _callbacksRef_current_onLongPress === void 0 || _callbacksRef_current_onLongPress.call(_callbacksRef_current2, e !== null && e !== void 0 ? e : {});
3969
+ }, (_callbacksRef_current_delayLongPress = callbacksRef.current.delayLongPress) !== null && _callbacksRef_current_delayLongPress !== void 0 ? _callbacksRef_current_delayLongPress : 500);
3970
+ }
3971
+ }
3931
3972
  (_callbacksRef_current_onPressIn = (_callbacksRef_current = callbacksRef.current).onPressIn) === null || _callbacksRef_current_onPressIn === void 0 || _callbacksRef_current_onPressIn.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
3932
3973
  };
3933
3974
  var endPress = function(e) {
3934
3975
  var firePress = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
3935
3976
  var _callbacksRef_current_onPress, _callbacksRef_current, _callbacksRef_current_onPressOut, _callbacksRef_current1;
3977
+ clearLongPress();
3936
3978
  if (!pressActiveRef.current) return;
3937
3979
  pressActiveRef.current = false;
3938
- if (firePress) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
3980
+ if (firePress && !longPressedRef.current) (_callbacksRef_current_onPress = (_callbacksRef_current = callbacksRef.current).onPress) === null || _callbacksRef_current_onPress === void 0 || _callbacksRef_current_onPress.call(_callbacksRef_current, e !== null && e !== void 0 ? e : {});
3939
3981
  (_callbacksRef_current_onPressOut = (_callbacksRef_current1 = callbacksRef.current).onPressOut) === null || _callbacksRef_current_onPressOut === void 0 || _callbacksRef_current_onPressOut.call(_callbacksRef_current1, e !== null && e !== void 0 ? e : {});
3940
3982
  };
3941
- useMainThreadPressEvents(events, viewProps, Boolean(hasRealPressEvents || !isInsideNativeMenu && getIsAndroid() && hasPressEvents), debugName);
3983
+ useMainThreadPressEvents(events, viewProps, Boolean(!isInsideNativeMenu && (hasRealPressEvents || getIsAndroid() && hasPressEvents)), debugName);
3942
3984
  if (everEnabled) {
3943
3985
  callbacksRef.current = hasPressEvents ? {
3944
3986
  onPressIn: events.onPressIn,
3945
3987
  onPressOut: events.onPressOut,
3946
3988
  onPress: events.onPress,
3947
- onLongPress: events.onLongPress
3989
+ onLongPress: events.onLongPress,
3990
+ delayLongPress: events.delayLongPress
3948
3991
  } : {};
3949
- if (hasRealPressEvents) {
3992
+ if (hasRealPressEvents && !isInsideNativeMenu) {
3950
3993
  endPress();
3951
3994
  gestureRef.current = null;
3952
3995
  return null;
@@ -5767,7 +5810,6 @@ function contributeProp(pass, keyOg, valOg) {
5767
5810
  var shouldCheckSkipProps = !noSkip;
5768
5811
  var asChildExceptStyleLike = Boolean(flags & passAsChildStyleFlag);
5769
5812
  var isTextOrInput = isText || isInput;
5770
- var hocParentVariants = isHOC ? parentVariants : void 0;
5771
5813
  var keyInit = keyOg;
5772
5814
  var valInit = valOg;
5773
5815
  if (keyInit === "children") {
@@ -5989,9 +6031,8 @@ function contributeProp(pass, keyOg, valOg) {
5989
6031
  var isVariant = !isValidStyleKeyInit && variants && keyInit in variants;
5990
6032
  var isStyleProp = isValidStyleKeyInit || isVariant && !noExpand;
5991
6033
  if (isStyleProp && asChildExceptStyleLike) return;
5992
- var shouldPassProp = !isStyleProp && isHOC || hocParentVariants && keyInit in hocParentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
5993
- var parentVariant = parentVariants === null || parentVariants === void 0 ? void 0 : parentVariants[keyInit];
5994
- var isHOCShouldPassThrough = Boolean(isHOC && (parentVariant || keyInit in skipProps));
6034
+ var shouldPassProp = !isStyleProp && isHOC || parentVariants && keyInit in parentVariants || (inlineProps === null || inlineProps === void 0 ? void 0 : inlineProps.has(keyInit));
6035
+ var isHOCShouldPassThrough = isHOC && keyInit in skipProps;
5995
6036
  var shouldPassThrough = shouldPassProp || isHOCShouldPassThrough;
5996
6037
  if (globalThis.process.env.NODE_ENV === "development" && debug === "verbose") {
5997
6038
  console.groupCollapsed(` \u{1F511} ${keyOg}${keyInit !== keyOg ? ` (shorthand for ${keyInit})` : ""} ${shouldPassThrough ? "(pass)" : ""}`);
@@ -6079,7 +6120,7 @@ function contributeProp(pass, keyOg, valOg) {
6079
6120
  }
6080
6121
  }
6081
6122
  var getSplitStyles = function(props, staticConfig, theme, themeName, componentState, styleProps, parentSplitStyles, componentContext, groupContext, elementType, startedUnhydrated, debug, animationDriver, styleStaticConfig) {
6082
- var _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
6123
+ var _staticConfig_Component_staticConfig, _staticConfig_Component, _styleState_flatMediaKeys, _styleState_flatGroupKeys, _styleState_flatGroupMedia, _styleState_flatGroupKeys1, _styleState_flatGroupMedia1, _styleState_style;
6083
6124
  var conf = getConfig();
6084
6125
  styleStaticConfig || (styleStaticConfig = getStyleStaticConfig(staticConfig, conf));
6085
6126
  var driver = animationDriver || (componentContext === null || componentContext === void 0 ? void 0 : componentContext.animationDriver) || conf.animations;
@@ -6155,7 +6196,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
6155
6196
  var frontendContainer;
6156
6197
  var frontendContainerType;
6157
6198
  var processedProps = props;
6158
- var parentVariants = parentStaticConfig ? getStyleStaticConfig(parentStaticConfig, conf).variants : void 0;
6199
+ var parentVariants = isHOC ? (_staticConfig_Component = staticConfig.Component) === null || _staticConfig_Component === void 0 ? void 0 : (_staticConfig_Component_staticConfig = _staticConfig_Component.staticConfig) === null || _staticConfig_Component_staticConfig === void 0 ? void 0 : _staticConfig_Component_staticConfig.variants : void 0;
6159
6200
  var defaultProps = asChild ? styleStaticConfig.defaultProps : void 0;
6160
6201
  var asChildExceptStyleLike = asChild === "except-style" || asChild === "except-style-web";
6161
6202
  var containerValue;
@@ -6177,7 +6218,7 @@ var getSplitStyles = function(props, staticConfig, theme, themeName, componentSt
6177
6218
  styledContextKeys,
6178
6219
  (noSkip ? passNoSkipFlag : 0) | (disableExpandShorthands ? passDisableShorthandsFlag : 0) | (noExpand ? passNoExpandFlag : 0) | (noMergeStyle ? passNoMergeFlag : 0) | (isHOC ? passHocFlag : 0) | (isText ? passTextFlag : 0) | (isInput ? passInputFlag : 0) | (asChildExceptStyleLike ? passAsChildStyleFlag : 0),
6179
6220
  debug,
6180
- parentStaticConfig,
6221
+ globalThis.process.env.NODE_ENV === "development" ? parentStaticConfig : void 0,
6181
6222
  defaultProps,
6182
6223
  driverAnimations,
6183
6224
  driverOutputStyle,
@@ -7193,7 +7234,7 @@ function emitValue(state, property, raw, cursor, originalValue, contextOnly) {
7193
7234
  }
7194
7235
  if (typeof raw === "string" && property === "background") {
7195
7236
  var parts = splitComponents(raw);
7196
- if (parts.length === 1 && !startsValueFunction(parts[0])) {
7237
+ if (parts.length === 1 && (!startsValueFunction(parts[0]) || classifyBorderComponents(parts[0]).color)) {
7197
7238
  emitResolved(state, "backgroundColor", parts[0], cursor, originalValue, contextOnly);
7198
7239
  return;
7199
7240
  }
@@ -8940,7 +8981,7 @@ ${banner}
8940
8981
  }
8941
8982
  if (globalThis.process.env.NODE_ENV === "development" && time$1) time$1`use-children`;
8942
8983
  }
8943
- content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents);
8984
+ content = wrapWithGestureDetector(content, pressGesture, stateRef, isHOC, !isHOC && Component && typeof Component !== "string", hasRealPressEvents && !isInsideNativeMenu);
8944
8985
  var ResetPresence = (animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.isStub) ? void 0 : animationDriver === null || animationDriver === void 0 ? void 0 : animationDriver.ResetPresence;
8945
8986
  var needsReset = Boolean(!asChild && splitStyles && !isHOC && ResetPresence && willBeAnimated && (hasEnterStyle || presenceState));
8946
8987
  var hasEverReset = stateRef.current.hasEverResetPresence;
@@ -9622,23 +9663,7 @@ function proxyThemeToParents(themeName, theme) {
9622
9663
  }
9623
9664
  }
9624
9665
  Object.assign(out, theme);
9625
- return out;
9626
- }
9627
- //#endregion
9628
- //#region ../web/dist/esm/helpers/themes.native.js
9629
- function ensureThemeVariable(theme, key) {
9630
- var val = theme[key];
9631
- var value = isVariable(val) ? val.val : val;
9632
- if (!isVariable(val)) theme[key] = createVariable({
9633
- key,
9634
- name: key,
9635
- val: value
9636
- });
9637
- else if (val.name !== key) theme[key] = createVariable({
9638
- key: val.name,
9639
- name: key,
9640
- val: value
9641
- });
9666
+ return copyAuthoredThemeScheme(out, theme);
9642
9667
  }
9643
9668
  //#endregion
9644
9669
  //#region ../web/dist/esm/helpers/variableValue.native.js
@@ -9994,7 +10019,7 @@ function createTamagui$2(configIn) {
9994
10019
  var themeConfig = (function() {
9995
10020
  var cssRuleSets = buildCSSRuleSets(createTokenCSS(tokens, shouldTokenCategoryHaveUnits), createFontCSS(fontsParsed, registerFontVariables), defaultFontToken);
9996
10021
  var themesIn = configIn.themes;
9997
- var dedupedThemes = foundThemes !== null && foundThemes !== void 0 ? foundThemes : getThemesDeduped(themesIn, tokens.color, configIn.variables, { tokensParsed });
10022
+ var dedupedThemes = foundThemes !== null && foundThemes !== void 0 ? foundThemes : getThemesDeduped(themesIn, tokensParsed, configIn.variables);
9998
10023
  return {
9999
10024
  themes: proxyThemesToParents(dedupedThemes, Object.keys(themesIn)),
10000
10025
  cssRuleSets,
@@ -10057,7 +10082,7 @@ function createTamagui$2(configIn) {
10057
10082
  if (!globalThis["Tamagui"]) globalThis["Tamagui"] = Tamagui;
10058
10083
  return config;
10059
10084
  }
10060
- function getThemesDeduped(themes, colorTokens, variables, variablesCtx) {
10085
+ function getThemesDeduped(themes, tokensParsed, variables) {
10061
10086
  var dedupedThemes = [];
10062
10087
  var existing = /* @__PURE__ */ new Map();
10063
10088
  var sortedThemeNames = Object.keys(themes).sort(function(a, b) {
@@ -10069,14 +10094,17 @@ function getThemesDeduped(themes, colorTokens, variables, variablesCtx) {
10069
10094
  for (var _iterator = sortedThemeNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
10070
10095
  var themeName = _step.value;
10071
10096
  var rawTheme = themes[themeName];
10072
- var key = JSON.stringify(rawTheme);
10073
- if (existing.has(key)) {
10074
- existing.get(key).names.push(themeName);
10097
+ var scheme = getAuthoredThemeScheme(rawTheme);
10098
+ var key = JSON.stringify(rawTheme) + scheme;
10099
+ var e = existing.get(key);
10100
+ if (e) {
10101
+ e.names.push(themeName);
10075
10102
  continue;
10076
10103
  }
10077
- var theme = _objectSpread2(_objectSpread2({}, colorTokens), rawTheme);
10104
+ var theme = _objectSpread2(_objectSpread2({}, tokensParsed.color), rawTheme);
10078
10105
  for (var key1 in theme) ensureThemeVariable(theme, key1);
10079
- if (variables && variablesCtx && !themeName.includes("_")) mergeConfigVariablesIntoTheme(theme, themeName, variables, variablesCtx.tokensParsed);
10106
+ copyAuthoredThemeScheme(theme, rawTheme);
10107
+ if (variables && !themeName.includes("_")) mergeConfigVariablesIntoTheme(theme, themeName, variables, tokensParsed);
10080
10108
  var deduped = {
10081
10109
  names: [themeName],
10082
10110
  theme
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tamagui/core",
3
- "version": "3.0.0-beta.1604.1",
3
+ "version": "3.0.0-beta.1670.1",
4
4
  "gitHead": "a49cc7ea6b93ba384e77a4880ae48ac4a5635c14",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -137,19 +137,19 @@
137
137
  "clean:build": "tamagui-build clean:build"
138
138
  },
139
139
  "dependencies": {
140
- "@tamagui/compose-refs": "3.0.0-beta.1604.1",
141
- "@tamagui/constants": "3.0.0-beta.1604.1",
142
- "@tamagui/helpers": "3.0.0-beta.1604.1",
143
- "@tamagui/react-native-media-driver": "3.0.0-beta.1604.1",
144
- "@tamagui/react-native-use-pressable": "3.0.0-beta.1604.1",
145
- "@tamagui/use-element-layout": "3.0.0-beta.1604.1",
146
- "@tamagui/use-event": "3.0.0-beta.1604.1",
147
- "@tamagui/web": "3.0.0-beta.1604.1"
140
+ "@tamagui/compose-refs": "3.0.0-beta.1670.1",
141
+ "@tamagui/constants": "3.0.0-beta.1670.1",
142
+ "@tamagui/helpers": "3.0.0-beta.1670.1",
143
+ "@tamagui/react-native-media-driver": "3.0.0-beta.1670.1",
144
+ "@tamagui/react-native-use-pressable": "3.0.0-beta.1670.1",
145
+ "@tamagui/use-element-layout": "3.0.0-beta.1670.1",
146
+ "@tamagui/use-event": "3.0.0-beta.1670.1",
147
+ "@tamagui/web": "3.0.0-beta.1670.1"
148
148
  },
149
149
  "devDependencies": {
150
- "@tamagui/build": "3.0.0-beta.1604.1",
151
- "@tamagui/native-bundle": "3.0.0-beta.1604.1",
152
- "@tamagui/react-native-web-lite": "3.0.0-beta.1604.1",
150
+ "@tamagui/build": "3.0.0-beta.1670.1",
151
+ "@tamagui/native-bundle": "3.0.0-beta.1670.1",
152
+ "@tamagui/react-native-web-lite": "3.0.0-beta.1670.1",
153
153
  "@testing-library/react": "^16.1.0",
154
154
  "csstype": "^3.0.10",
155
155
  "react": "19.2.3",
@@ -160,5 +160,5 @@
160
160
  "peerDependencies": {
161
161
  "react": ">=19"
162
162
  },
163
- "releaseSourceCommit": "360e4e0e611bb81518cc274cccff03d38e59a2a0"
163
+ "releaseSourceCommit": "23b9b37ef498bb7ebe306138c1d635a807db8ac1"
164
164
  }