tamagui 2.1.0 → 2.2.0

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
@@ -37,6 +37,15 @@ let react = require("react");
37
37
  let react$1 = __toESM(react, 1);
38
38
  react = __toESM(react);
39
39
  let react_jsx_runtime = require("react/jsx-runtime");
40
+ let react_native_safe_area_context = require("react-native-safe-area-context");
41
+ //#region ../../core/polyfill-dev/index.js
42
+ if (typeof globalThis["__DEV__"] === "undefined") globalThis["__DEV__"] = false;
43
+ //#endregion
44
+ //#region src/setup.ts
45
+ var _globalThis;
46
+ (_globalThis = globalThis)["React"] || (_globalThis["React"] = react$1);
47
+ if (typeof requestAnimationFrame === "undefined") globalThis["requestAnimationFrame"] = typeof setImmediate === "undefined" ? setTimeout : setImmediate;
48
+ //#endregion
40
49
  //#region \0@oxc-project+runtime@0.130.0/helpers/typeof.js
41
50
  function _typeof(o) {
42
51
  "@babel/helpers - typeof";
@@ -10119,72 +10128,6 @@ var init_Appearance = __esmMin((() => {
10119
10128
  };
10120
10129
  }));
10121
10130
  //#endregion
10122
- //#region ../../../node_modules/react-dom/cjs/react-dom.production.js
10123
- /**
10124
- * @license React
10125
- * react-dom.production.js
10126
- *
10127
- * Copyright (c) Meta Platforms, Inc. and affiliates.
10128
- *
10129
- * This source code is licensed under the MIT license found in the
10130
- * LICENSE file in the root directory of this source tree.
10131
- */
10132
- var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => {
10133
- var React$47 = require("react");
10134
- function formatProdErrorMessage(code) {
10135
- var url = "https://react.dev/errors/" + code;
10136
- if (1 < arguments.length) {
10137
- url += "?args[]=" + encodeURIComponent(arguments[1]);
10138
- for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]);
10139
- }
10140
- return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
10141
- }
10142
- function noop() {}
10143
- var Internals = {
10144
- d: {
10145
- f: noop,
10146
- r: function() {
10147
- throw Error(formatProdErrorMessage(522));
10148
- },
10149
- D: noop,
10150
- C: noop,
10151
- L: noop,
10152
- m: noop,
10153
- X: noop,
10154
- S: noop,
10155
- M: noop
10156
- },
10157
- p: 0,
10158
- findDOMNode: null
10159
- };
10160
- var ReactSharedInternals = React$47.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
10161
- exports.flushSync = function(fn) {
10162
- var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
10163
- try {
10164
- if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
10165
- } finally {
10166
- ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
10167
- }
10168
- };
10169
- exports.unstable_batchedUpdates = function(fn, a) {
10170
- return fn(a);
10171
- };
10172
- }));
10173
- //#endregion
10174
- //#region ../../../node_modules/react-dom/index.js
10175
- var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10176
- function checkDCE() {
10177
- if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return;
10178
- try {
10179
- __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
10180
- } catch (err) {
10181
- console.error(err);
10182
- }
10183
- }
10184
- checkDCE();
10185
- module.exports = require_react_dom_production();
10186
- }));
10187
- //#endregion
10188
10131
  //#region ../../packages/react-native-web-lite/dist/esm/AppRegistry/AppContainer.mjs
10189
10132
  var RootTagContext$1, AppContainer, styles$5;
10190
10133
  var init_AppContainer = __esmMin((() => {
@@ -10251,9 +10194,8 @@ var init_renderApplication = __esmMin((() => {
10251
10194
  }));
10252
10195
  //#endregion
10253
10196
  //#region ../../packages/react-native-web-lite/dist/esm/AppRegistry/index.mjs
10254
- var import_react_dom$2, emptyObject$2, runnables, componentProviderInstrumentationHook, wrapperComponentProvider, AppRegistry;
10197
+ var emptyObject$2, runnables, componentProviderInstrumentationHook, wrapperComponentProvider, AppRegistry;
10255
10198
  var init_AppRegistry = __esmMin((() => {
10256
- import_react_dom$2 = /* @__PURE__ */ __toESM(require_react_dom(), 1);
10257
10199
  init_esm$1();
10258
10200
  init_renderApplication();
10259
10201
  emptyObject$2 = {};
@@ -10304,7 +10246,8 @@ var init_AppRegistry = __esmMin((() => {
10304
10246
  wrapperComponentProvider = provider;
10305
10247
  }
10306
10248
  static unmountApplicationComponentAtRootTag(rootTag) {
10307
- (0, import_react_dom$2.unmountComponentAtNode)(rootTag);
10249
+ var _rootTag$unmount;
10250
+ rootTag === null || rootTag === void 0 || (_rootTag$unmount = rootTag.unmount) === null || _rootTag$unmount === void 0 || _rootTag$unmount.call(rootTag);
10308
10251
  }
10309
10252
  };
10310
10253
  }));
@@ -11661,6 +11604,72 @@ var init_useWindowDimensions = __esmMin((() => {
11661
11604
  init_Dimensions();
11662
11605
  }));
11663
11606
  //#endregion
11607
+ //#region ../../../node_modules/react-dom/cjs/react-dom.production.js
11608
+ /**
11609
+ * @license React
11610
+ * react-dom.production.js
11611
+ *
11612
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
11613
+ *
11614
+ * This source code is licensed under the MIT license found in the
11615
+ * LICENSE file in the root directory of this source tree.
11616
+ */
11617
+ var require_react_dom_production = /* @__PURE__ */ __commonJSMin(((exports) => {
11618
+ var React$45 = require("react");
11619
+ function formatProdErrorMessage(code) {
11620
+ var url = "https://react.dev/errors/" + code;
11621
+ if (1 < arguments.length) {
11622
+ url += "?args[]=" + encodeURIComponent(arguments[1]);
11623
+ for (var i = 2; i < arguments.length; i++) url += "&args[]=" + encodeURIComponent(arguments[i]);
11624
+ }
11625
+ return "Minified React error #" + code + "; visit " + url + " for the full message or use the non-minified dev environment for full errors and additional helpful warnings.";
11626
+ }
11627
+ function noop() {}
11628
+ var Internals = {
11629
+ d: {
11630
+ f: noop,
11631
+ r: function() {
11632
+ throw Error(formatProdErrorMessage(522));
11633
+ },
11634
+ D: noop,
11635
+ C: noop,
11636
+ L: noop,
11637
+ m: noop,
11638
+ X: noop,
11639
+ S: noop,
11640
+ M: noop
11641
+ },
11642
+ p: 0,
11643
+ findDOMNode: null
11644
+ };
11645
+ var ReactSharedInternals = React$45.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
11646
+ exports.flushSync = function(fn) {
11647
+ var previousTransition = ReactSharedInternals.T, previousUpdatePriority = Internals.p;
11648
+ try {
11649
+ if (ReactSharedInternals.T = null, Internals.p = 2, fn) return fn();
11650
+ } finally {
11651
+ ReactSharedInternals.T = previousTransition, Internals.p = previousUpdatePriority, Internals.d.f();
11652
+ }
11653
+ };
11654
+ exports.unstable_batchedUpdates = function(fn, a) {
11655
+ return fn(a);
11656
+ };
11657
+ }));
11658
+ //#endregion
11659
+ //#region ../../../node_modules/react-dom/index.js
11660
+ var require_react_dom = /* @__PURE__ */ __commonJSMin(((exports, module) => {
11661
+ function checkDCE() {
11662
+ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === "undefined" || typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== "function") return;
11663
+ try {
11664
+ __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);
11665
+ } catch (err) {
11666
+ console.error(err);
11667
+ }
11668
+ }
11669
+ checkDCE();
11670
+ module.exports = require_react_dom_production();
11671
+ }));
11672
+ //#endregion
11664
11673
  //#region ../../packages/react-native-web-lite/dist/esm/index.mjs
11665
11674
  var esm_exports = /* @__PURE__ */ __exportAll({
11666
11675
  AccessibilityInfo: () => AccessibilityInfo,
@@ -11805,7 +11814,7 @@ var init_esm = __esmMin((() => {
11805
11814
  }));
11806
11815
  //#endregion
11807
11816
  //#region ../../core/constants/dist/esm/constants.native.js
11808
- var isWeb, isBrowser, isServer, isClient, useIsomorphicLayoutEffect, isChrome, isWebTouchable, isTouchable, isAndroid$1, isIos, isTV, currentPlatform;
11817
+ var isWeb, isBrowser, isServer, isClient, useIsomorphicLayoutEffect, isChrome, isWebTouchable, isNativeDesktop, isTouchable, isAndroid$1, isIos, supportsDynamicColorIOS, isTV, currentPlatform;
11809
11818
  var init_constants_native$1 = __esmMin((() => {
11810
11819
  init_esm();
11811
11820
  isWeb = false;
@@ -11815,13 +11824,17 @@ var init_constants_native$1 = __esmMin((() => {
11815
11824
  useIsomorphicLayoutEffect = react$1.useLayoutEffect;
11816
11825
  isChrome = false;
11817
11826
  isWebTouchable = false;
11818
- isTouchable = true;
11827
+ isNativeDesktop = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "macos" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "windows";
11828
+ isTouchable = !isNativeDesktop;
11819
11829
  isAndroid$1 = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "android" || process.env.TEST_NATIVE_PLATFORM === "android" || process.env.TEST_NATIVE_PLATFORM === "androidtv";
11820
11830
  isIos = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "ios" || process.env.TEST_NATIVE_PLATFORM === "ios" || process.env.TEST_NATIVE_PLATFORM === "tvos";
11831
+ supportsDynamicColorIOS = isIos || process.env.TAMAGUI_DYNAMIC_COLOR_IOS === "1";
11821
11832
  isTV = (Platform === null || Platform === void 0 ? void 0 : Platform.isTV) || process.env.TEST_NATIVE_PLATFORM === "androidtv" || process.env.TEST_NATIVE_PLATFORM === "tvos";
11822
11833
  currentPlatform = ((Platform === null || Platform === void 0 ? void 0 : Platform.OS) ? {
11823
11834
  ios: "ios",
11824
- android: "android"
11835
+ android: "android",
11836
+ macos: "macos",
11837
+ windows: "windows"
11825
11838
  }[Platform.OS] : void 0) || "native";
11826
11839
  }));
11827
11840
  //#endregion
@@ -12402,83 +12415,6 @@ var init_shouldRenderNativePlatform_native = __esmMin((() => {
12402
12415
  ];
12403
12416
  }));
12404
12417
  //#endregion
12405
- //#region ../../core/helpers/dist/esm/webOnlyStyleProps.native.js
12406
- var nonAnimatableWebViewProps, nonAnimatableWebTextProps, webOnlyStylePropsView, webOnlyStylePropsText;
12407
- var init_webOnlyStyleProps_native = __esmMin((() => {
12408
- init_objectSpread2();
12409
- nonAnimatableWebViewProps = {
12410
- backgroundAttachment: true,
12411
- backgroundBlendMode: true,
12412
- backgroundClip: true,
12413
- backgroundOrigin: true,
12414
- backgroundRepeat: true,
12415
- borderBottomStyle: true,
12416
- borderLeftStyle: true,
12417
- borderRightStyle: true,
12418
- borderTopStyle: true,
12419
- contain: true,
12420
- containerType: true,
12421
- content: true,
12422
- float: true,
12423
- maskBorderMode: true,
12424
- maskBorderRepeat: true,
12425
- maskClip: true,
12426
- maskComposite: true,
12427
- maskMode: true,
12428
- maskOrigin: true,
12429
- maskRepeat: true,
12430
- maskType: true,
12431
- objectFit: true,
12432
- overflowBlock: true,
12433
- overflowInline: true,
12434
- overflowX: true,
12435
- overflowY: true,
12436
- pointerEvents: true,
12437
- scrollbarWidth: true,
12438
- textWrap: true,
12439
- touchAction: true,
12440
- transformStyle: true,
12441
- willChange: true
12442
- };
12443
- nonAnimatableWebTextProps = {
12444
- whiteSpace: true,
12445
- wordWrap: true,
12446
- textOverflow: true,
12447
- WebkitBoxOrient: true
12448
- };
12449
- webOnlyStylePropsView = _objectSpread2(_objectSpread2({}, nonAnimatableWebViewProps), {}, {
12450
- transition: true,
12451
- backdropFilter: true,
12452
- WebkitBackdropFilter: true,
12453
- background: true,
12454
- borderTop: true,
12455
- borderRight: true,
12456
- borderBottom: true,
12457
- borderLeft: true,
12458
- backgroundPosition: true,
12459
- backgroundSize: true,
12460
- borderImage: true,
12461
- caretColor: true,
12462
- clipPath: true,
12463
- mask: true,
12464
- maskBorder: true,
12465
- maskBorderOutset: true,
12466
- maskBorderSlice: true,
12467
- maskBorderSource: true,
12468
- maskBorderWidth: true,
12469
- maskImage: true,
12470
- maskPosition: true,
12471
- maskSize: true,
12472
- objectPosition: true,
12473
- textEmphasis: true,
12474
- userSelect: true
12475
- });
12476
- webOnlyStylePropsText = _objectSpread2(_objectSpread2({}, nonAnimatableWebTextProps), {}, {
12477
- textDecorationDistance: true,
12478
- WebkitLineClamp: true
12479
- });
12480
- }));
12481
- //#endregion
12482
12418
  //#region ../../core/helpers/dist/esm/validStyleProps.native.js
12483
12419
  var cssShorthandLonghands, textColors, tokenCategories, nonAnimatableViewProps, nonAnimatableFontProps, nonAnimatableTextOnlyProps, nonAnimatableUnitlessProps, nonAnimatableStyleProps, stylePropsUnitless, stylePropsTransform, stylePropsView, stylePropsTextOnly, stylePropsText, stylePropsAll, validPseudoKeys, validStyles;
12484
12420
  var init_validStyleProps_native = __esmMin((() => {
@@ -12765,6 +12701,83 @@ var init_withStaticProperties_native = __esmMin((() => {
12765
12701
  };
12766
12702
  }));
12767
12703
  //#endregion
12704
+ //#region ../../core/helpers/dist/esm/webOnlyStyleProps.native.js
12705
+ var nonAnimatableWebViewProps, nonAnimatableWebTextProps, webOnlyStylePropsView, webOnlyStylePropsText;
12706
+ var init_webOnlyStyleProps_native = __esmMin((() => {
12707
+ init_objectSpread2();
12708
+ nonAnimatableWebViewProps = {
12709
+ backgroundAttachment: true,
12710
+ backgroundBlendMode: true,
12711
+ backgroundClip: true,
12712
+ backgroundOrigin: true,
12713
+ backgroundRepeat: true,
12714
+ borderBottomStyle: true,
12715
+ borderLeftStyle: true,
12716
+ borderRightStyle: true,
12717
+ borderTopStyle: true,
12718
+ contain: true,
12719
+ containerType: true,
12720
+ content: true,
12721
+ float: true,
12722
+ maskBorderMode: true,
12723
+ maskBorderRepeat: true,
12724
+ maskClip: true,
12725
+ maskComposite: true,
12726
+ maskMode: true,
12727
+ maskOrigin: true,
12728
+ maskRepeat: true,
12729
+ maskType: true,
12730
+ objectFit: true,
12731
+ overflowBlock: true,
12732
+ overflowInline: true,
12733
+ overflowX: true,
12734
+ overflowY: true,
12735
+ pointerEvents: true,
12736
+ scrollbarWidth: true,
12737
+ textWrap: true,
12738
+ touchAction: true,
12739
+ transformStyle: true,
12740
+ willChange: true
12741
+ };
12742
+ nonAnimatableWebTextProps = {
12743
+ whiteSpace: true,
12744
+ wordWrap: true,
12745
+ textOverflow: true,
12746
+ WebkitBoxOrient: true
12747
+ };
12748
+ webOnlyStylePropsView = _objectSpread2(_objectSpread2({}, nonAnimatableWebViewProps), {}, {
12749
+ transition: true,
12750
+ backdropFilter: true,
12751
+ WebkitBackdropFilter: true,
12752
+ background: true,
12753
+ borderTop: true,
12754
+ borderRight: true,
12755
+ borderBottom: true,
12756
+ borderLeft: true,
12757
+ backgroundPosition: true,
12758
+ backgroundSize: true,
12759
+ borderImage: true,
12760
+ caretColor: true,
12761
+ clipPath: true,
12762
+ mask: true,
12763
+ maskBorder: true,
12764
+ maskBorderOutset: true,
12765
+ maskBorderSlice: true,
12766
+ maskBorderSource: true,
12767
+ maskBorderWidth: true,
12768
+ maskImage: true,
12769
+ maskPosition: true,
12770
+ maskSize: true,
12771
+ objectPosition: true,
12772
+ textEmphasis: true,
12773
+ userSelect: true
12774
+ });
12775
+ webOnlyStylePropsText = _objectSpread2(_objectSpread2({}, nonAnimatableWebTextProps), {}, {
12776
+ textDecorationDistance: true,
12777
+ WebkitLineClamp: true
12778
+ });
12779
+ }));
12780
+ //#endregion
12768
12781
  //#region ../../core/helpers/dist/esm/index.native.js
12769
12782
  var init_index_native$5 = __esmMin((() => {
12770
12783
  init_index_native$6();
@@ -13143,7 +13156,7 @@ var init_useThemeState_native = __esmMin((() => {
13143
13156
  if (local && !PendingUpdate.has(id)) {
13144
13157
  if (parentState && local._parentName === parentState.name && local._propsKey === propsKey) return local;
13145
13158
  }
13146
- var isSchemeOnlyChange = isIos && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
13159
+ var isSchemeOnlyChange = supportsDynamicColorIOS && getSetting("fastSchemeChange") && local && parentState && local.scheme !== parentState.scheme && getThemeBaseName(local.name) === getThemeBaseName(parentState.name);
13147
13160
  var _keys_current_size;
13148
13161
  var keysSize = (_keys_current_size = keys === null || keys === void 0 ? void 0 : (_keys_current = keys.current) === null || _keys_current === void 0 ? void 0 : _keys_current.size) !== null && _keys_current_size !== void 0 ? _keys_current_size : 0;
13149
13162
  var _schemeKeys_current_size;
@@ -13272,7 +13285,7 @@ function getThemeProxied(_props, _state, _keys, _schemeKeys) {
13272
13285
  var { name, scheme } = curState;
13273
13286
  var fastSchemeChange = getSetting("fastSchemeChange");
13274
13287
  var rootMatchesSystem = doesRootSchemeMatchSystem();
13275
- if (scheme && platform !== "web" && isIos && !curProps.deopt && !curState.isInverse && fastSchemeChange && rootMatchesSystem) {
13288
+ if (scheme && platform !== "web" && supportsDynamicColorIOS && !curProps.deopt && !curState.isInverse && fastSchemeChange && rootMatchesSystem) {
13276
13289
  var _config_themes_name, _config_themes_oppositeName;
13277
13290
  var oppositeScheme = scheme === "dark" ? "light" : "dark";
13278
13291
  var oppositeName = name.replace(scheme, oppositeScheme);
@@ -13987,6 +14000,10 @@ function useEvents(events, viewProps, stateRef, staticConfig, isHOC, isInsideNat
13987
14000
  if (events) {
13988
14001
  if (events.onFocus) viewProps["onFocus"] = events.onFocus;
13989
14002
  if (events.onBlur) viewProps["onBlur"] = events.onBlur;
14003
+ if (getIsNativeDesktop()) {
14004
+ if (events.onMouseEnter) viewProps["onMouseEnter"] = events.onMouseEnter;
14005
+ if (events.onMouseLeave) viewProps["onMouseLeave"] = events.onMouseLeave;
14006
+ }
13990
14007
  }
13991
14008
  var hasPressEvents = events === null || events === void 0 ? void 0 : events.onPress;
13992
14009
  var gh = getGestureHandler();
@@ -14102,7 +14119,7 @@ function wrapWithGestureDetector(content, gesture, stateRef, isHOC, isCompositeC
14102
14119
  onStartShouldSetResponder: responderClaim
14103
14120
  }, react$1.default.createElement(GestureDetector, { gesture: gestureToUse }, content));
14104
14121
  }
14105
- var isFabric, isAndroidCache, getIsAndroid, responderClaim, responderWrapperStyle;
14122
+ var isFabric, isAndroidCache, getIsAndroid, isNativeDesktopCache, getIsNativeDesktop, responderClaim, responderWrapperStyle;
14106
14123
  var init_eventHandling_native = __esmMin((() => {
14107
14124
  init_index_native$5();
14108
14125
  init_index_native$3();
@@ -14113,6 +14130,10 @@ var init_eventHandling_native = __esmMin((() => {
14113
14130
  if (isAndroidCache === void 0) isAndroidCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "android";
14114
14131
  return isAndroidCache;
14115
14132
  };
14133
+ getIsNativeDesktop = function() {
14134
+ if (isNativeDesktopCache === void 0) isNativeDesktopCache = (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "macos" || (Platform === null || Platform === void 0 ? void 0 : Platform.OS) === "windows";
14135
+ return isNativeDesktopCache;
14136
+ };
14116
14137
  responderClaim = function() {
14117
14138
  return true;
14118
14139
  };
@@ -14230,22 +14251,6 @@ var init_getCSSStylesAtomic_native = __esmMin((() => {
14230
14251
  getStyleAtomic = empty$1;
14231
14252
  }));
14232
14253
  //#endregion
14233
- //#region ../../core/web/dist/esm/helpers/insertStyleRule.native.js
14234
- function scanAllSheets() {
14235
- arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
14236
- arguments.length > 1 && arguments[1];
14237
- if (!process.env.TAMAGUI_DID_OUTPUT_CSS) return;
14238
- }
14239
- function stopAccumulatingRules() {
14240
- trackAllRules = false;
14241
- }
14242
- var bailAfterEnv, trackAllRules;
14243
- var init_insertStyleRule_native = __esmMin((() => {
14244
- bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES;
14245
- bailAfterEnv && +bailAfterEnv;
14246
- process.env.TAMAGUI_INSERT_SELECTOR_TRIES && +process.env.TAMAGUI_INSERT_SELECTOR_TRIES;
14247
- }));
14248
- //#endregion
14249
14254
  //#region ../../core/web/dist/esm/helpers/isActivePlatform.native.js
14250
14255
  function getPlatformSpecificityBump(mediaKeyShort) {
14251
14256
  if (mediaKeyShort === "platform-androidtv" || mediaKeyShort === "platform-tvos") return 3;
@@ -14959,7 +14964,7 @@ var init_platformResolveValue_native = __esmMin((() => {
14959
14964
  init_getTokenForKey_native();
14960
14965
  init_parseNativeStyle_native();
14961
14966
  init_objectSpread2();
14962
- tokenPattern = /(\$[\w.-]+)/g;
14967
+ tokenPattern = /(\$[\w.-]+(?:\/[\d.]+)?)/g;
14963
14968
  nativeParseKeys = {
14964
14969
  backgroundImage: true,
14965
14970
  boxShadow: true,
@@ -15703,7 +15708,7 @@ var init_getSplitStyles_native = __esmMin((() => {
15703
15708
  }
15704
15709
  var mediaStyle1 = getSubStyle(styleState, key5, val2, true);
15705
15710
  var importanceBump = 0;
15706
- if (isThemeMedia) if (isIos && getSetting("fastSchemeChange")) {
15711
+ if (isThemeMedia) if (supportsDynamicColorIOS && getSetting("fastSchemeChange")) {
15707
15712
  var _styleState3;
15708
15713
  (_styleState3 = styleState).style || (_styleState3.style = {});
15709
15714
  var scheme = mediaKeyShort;
@@ -16438,7 +16443,6 @@ var init_themeable_native = __esmMin((() => {
16438
16443
  "themeReset"
16439
16444
  ];
16440
16445
  }));
16441
- var init_wrapStyleTags_native = __esmMin((() => {}));
16442
16446
  //#endregion
16443
16447
  //#region ../../core/use-did-finish-ssr/dist/esm/ClientOnly.native.js
16444
16448
  var ClientOnlyContext, ClientOnly;
@@ -16981,7 +16985,7 @@ function createComponent(staticConfig) {
16981
16985
  var attachPress = Boolean(hasDynamicGroupChildren || runtimePressStyle || onPress || onPressOut || onPressIn || onMouseDown || onMouseUp || onLongPress || onClick || (pseudos === null || pseudos === void 0 ? void 0 : pseudos.focusVisibleStyle));
16982
16986
  var runtimeHoverStyle = !disabled && noClass && (pseudos === null || pseudos === void 0 ? void 0 : pseudos.hoverStyle);
16983
16987
  var needsHoverState = Boolean(hasDynamicGroupChildren || runtimeHoverStyle);
16984
- var attachHover = false;
16988
+ var attachHover = isNativeDesktop && !!(hasDynamicGroupChildren || needsHoverState || onMouseEnter || onMouseLeave);
16985
16989
  var shouldAttach = !disabled && !props.asChild && Boolean(attachFocus || attachPress || attachHover || runtimePressStyle || runtimeHoverStyle || runtimeFocusStyle);
16986
16990
  var needsPressState = Boolean(hasDynamicGroupChildren || runtimePressStyle);
16987
16991
  var events = shouldAttach ? _objectSpread2(_objectSpread2(_objectSpread2({ onPressOut: attachPress ? function(e) {
@@ -17277,6 +17281,22 @@ var init_registerCSSVariable_native = __esmMin((() => {
17277
17281
  tokensValueToVariable = /* @__PURE__ */ new Map();
17278
17282
  }));
17279
17283
  //#endregion
17284
+ //#region ../../core/web/dist/esm/helpers/insertStyleRule.native.js
17285
+ function scanAllSheets() {
17286
+ arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
17287
+ arguments.length > 1 && arguments[1];
17288
+ if (!process.env.TAMAGUI_DID_OUTPUT_CSS) return;
17289
+ }
17290
+ function stopAccumulatingRules() {
17291
+ trackAllRules = false;
17292
+ }
17293
+ var bailAfterEnv, trackAllRules;
17294
+ var init_insertStyleRule_native = __esmMin((() => {
17295
+ bailAfterEnv = process.env.TAMAGUI_BAIL_AFTER_SCANNING_X_CSS_RULES;
17296
+ bailAfterEnv && +bailAfterEnv;
17297
+ process.env.TAMAGUI_INSERT_SELECTOR_TRIES && +process.env.TAMAGUI_INSERT_SELECTOR_TRIES;
17298
+ }));
17299
+ //#endregion
17280
17300
  //#region ../../core/web/dist/esm/helpers/isTamaguiComponent.native.js
17281
17301
  function isTamaguiComponent(comp, name) {
17282
17302
  var config = comp === null || comp === void 0 ? void 0 : comp["staticConfig"];
@@ -17411,6 +17431,7 @@ function ensureThemeVariable(theme, key) {
17411
17431
  var init_themes_native = __esmMin((() => {
17412
17432
  init_createVariable_native();
17413
17433
  }));
17434
+ var init_wrapStyleTags_native = __esmMin((() => {}));
17414
17435
  //#endregion
17415
17436
  //#region ../../core/web/dist/esm/createFont.native.js
17416
17437
  var fontWeights, processSection, createFont;
@@ -19417,10 +19438,10 @@ function getBaseViews() {
19417
19438
  }
19418
19439
  //#endregion
19419
19440
  //#region ../../core/core/dist/esm/index.native.js
19420
- init_objectSpread2();
19421
19441
  init_index_native();
19422
19442
  init_index_native$7();
19423
19443
  init_index_native$11();
19444
+ init_objectSpread2();
19424
19445
  init_index_native();
19425
19446
  var GESTURE_STATE_KEY = "__tamagui_gesture__";
19426
19447
  var GESTURE_ENABLED_FREEZE_KEY = "__tamagui_gesture_enabled_freeze__";
@@ -20309,20 +20330,6 @@ var StackZIndexContext = function(param) {
20309
20330
  return content;
20310
20331
  };
20311
20332
  //#endregion
20312
- //#region ../portal/dist/esm/constants.native.js
20313
- init_index_native$7();
20314
- init_index_native$3();
20315
- var isTeleportEnabled = function() {
20316
- var state = getPortal().state;
20317
- return state.enabled && state.type === "teleport";
20318
- };
20319
- var needsPortalRepropagation = function() {
20320
- if (isTeleportEnabled()) return false;
20321
- return isAndroid$1 || isIos;
20322
- };
20323
- var allPortalHosts = /* @__PURE__ */ new Map();
20324
- var portalListeners = {};
20325
- //#endregion
20326
20333
  //#region ../portal/dist/esm/GorhomPortal.native.js
20327
20334
  init_index_native$7();
20328
20335
  init_index_native$3();
@@ -20575,6 +20582,20 @@ var Portal = function(propsIn) {
20575
20582
  });
20576
20583
  };
20577
20584
  //#endregion
20585
+ //#region ../portal/dist/esm/constants.native.js
20586
+ init_index_native$7();
20587
+ init_index_native$3();
20588
+ var isTeleportEnabled = function() {
20589
+ var state = getPortal().state;
20590
+ return state.enabled && state.type === "teleport";
20591
+ };
20592
+ var needsPortalRepropagation = function() {
20593
+ if (isTeleportEnabled()) return false;
20594
+ return isAndroid$1 || isIos;
20595
+ };
20596
+ var allPortalHosts = /* @__PURE__ */ new Map();
20597
+ var portalListeners = {};
20598
+ //#endregion
20578
20599
  //#region ../adapt/dist/esm/Adapt.native.js
20579
20600
  init_index_native$7();
20580
20601
  init_index_native$5();
@@ -20777,7 +20798,7 @@ var useAdaptIsActiveGiven = function(param) {
20777
20798
  if (when == null && platform == null) return false;
20778
20799
  if (when === true) return true;
20779
20800
  var enabled = false;
20780
- if (platform === "touch") enabled = true;
20801
+ if (platform === "touch") enabled = isTouchable;
20781
20802
  else if (platform === "native") enabled = true;
20782
20803
  else if (platform === "web") enabled = false;
20783
20804
  else if (platform === "ios") enabled = isIos;
@@ -23871,17 +23892,8 @@ var useFloating = function(props) {
23871
23892
  }] }));
23872
23893
  };
23873
23894
  //#endregion
23874
- //#region ../../core/floating/dist/esm/interactions/useInnerOffset.native.js
23875
- var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
23876
- react$1.createContext({
23877
- currentId: null,
23878
- setCurrentId: function() {},
23879
- delay: 0,
23880
- timeoutMs: 0,
23881
- initialDelay: 0
23882
- });
23883
- //#endregion
23884
23895
  //#region ../popper/dist/esm/Popper.native.js
23896
+ var import_react_dom = /* @__PURE__ */ __toESM(require_react_dom(), 1);
23885
23897
  init_index_native$4();
23886
23898
  init_index_native$7();
23887
23899
  init_esm();
@@ -24003,10 +24015,10 @@ function tamaguiAutoUpdate(reference, floating, update) {
24003
24015
  };
24004
24016
  }
24005
24017
  function Popper(props) {
24006
- var { children, size, strategy = "absolute", placement = "bottom", stayInFrame, allowFlip, offset: offset$2, disableRTL, resize, passThrough, open, scope } = props;
24018
+ var { children, size, strategy = "absolute", placement = "bottom", stayInFrame, allowFlip, offset: offset$1, disableRTL, resize, passThrough, open, scope } = props;
24007
24019
  var [arrowEl, setArrow] = react$1.useState(null);
24008
24020
  var [arrowSize, setArrowSize] = react$1.useState(0);
24009
- var offsetOptions = offset$2 !== null && offset$2 !== void 0 ? offset$2 : arrowSize;
24021
+ var offsetOptions = offset$1 !== null && offset$1 !== void 0 ? offset$1 : arrowSize;
24010
24022
  react$1.useRef({});
24011
24023
  var isOpen = passThrough ? false : open !== null && open !== void 0 ? open : true;
24012
24024
  var middlewareRef = react$1.useRef([]);
@@ -28381,8 +28393,7 @@ function setupNativeSheet(platform, RNIOSModal) {
28381
28393
  setHasScrollView: emptyFn,
28382
28394
  keyboardOccludedHeight: 0,
28383
28395
  isKeyboardVisible: false,
28384
- keyboardStableFrameHeight: 0,
28385
- isKeyboardSeeding: false
28396
+ keyboardStableFrameHeight: 0
28386
28397
  }, providerProps), {}, {
28387
28398
  onlyShowFrame: true,
28388
28399
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModalSheetView, {
@@ -28468,6 +28479,30 @@ function resisted(y, minY) {
28468
28479
  }
28469
28480
  //#endregion
28470
28481
  //#region ../sheet/dist/esm/keyboardAvoidance.native.js
28482
+ function getKeyboardAdjustedSheetY(param) {
28483
+ var { sheetY, screenSize, isKeyboardVisible, keyboardHeight, shouldTranslate, safeAreaTop } = param;
28484
+ if (!shouldTranslate || !isKeyboardVisible || keyboardHeight <= 0 || screenSize <= 0 || sheetY >= screenSize) return sheetY;
28485
+ return Math.max(safeAreaTop, sheetY - keyboardHeight);
28486
+ }
28487
+ function getSheetReleasePosition(param) {
28488
+ var { positions, projectedEnd, currentPosition, frameSize, dismissOnSnapToBottom, snapPointsMode, isKeyboardVisible, isWeb } = param;
28489
+ var closestPoint = 0;
28490
+ var dist = Number.POSITIVE_INFINITY;
28491
+ for (var i = 0; i < positions.length; i++) {
28492
+ var position = positions[i];
28493
+ var curDist = Math.abs(projectedEnd - position);
28494
+ if (curDist < dist) {
28495
+ dist = curDist;
28496
+ closestPoint = i;
28497
+ }
28498
+ }
28499
+ var dismissPoint = positions.length - 1;
28500
+ if (!(isWeb && dismissOnSnapToBottom && isKeyboardVisible && snapPointsMode === "fit" && positions.length === 2 && closestPoint === dismissPoint)) return closestPoint;
28501
+ var openPosition = positions[0];
28502
+ var dismissDistance = positions[dismissPoint] - openPosition;
28503
+ if (dismissDistance <= 0 || frameSize <= 0) return closestPoint;
28504
+ return Math.max(0, currentPosition - openPosition) >= Math.max(120, Math.min(frameSize, dismissDistance) * .35) ? closestPoint : 0;
28505
+ }
28471
28506
  function getKeyboardOccludedHeight(param) {
28472
28507
  var { frameSize, isKeyboardVisible, keyboardHeight, screenSize, sheetY } = param;
28473
28508
  if (!isKeyboardVisible || keyboardHeight <= 0 || screenSize <= 0 || frameSize <= 0 || sheetY === void 0 || sheetY >= screenSize) return 0;
@@ -28478,11 +28513,24 @@ function getKeyboardOccludedHeight(param) {
28478
28513
  }
28479
28514
  //#endregion
28480
28515
  //#region ../sheet/dist/esm/useGestureHandlerPan.native.js
28516
+ init_index_native$7();
28481
28517
  var AT_TOP_THRESHOLD = 5;
28482
28518
  function useGestureHandlerPan(config) {
28483
28519
  var { positions, frameSize, setPosition, animateTo, stopSpring, scrollBridge, setIsDragging, getCurrentPosition, resisted, disableDrag, isShowingInnerSheet, setAnimatedPosition, scrollGestureRef } = config;
28484
28520
  var gestureHandlerEnabled = isGestureHandlerEnabled();
28485
28521
  var panGestureRef = (0, react$1.useRef)(null);
28522
+ var _config_snapPointsMode;
28523
+ var releaseConfigRef = (0, react$1.useRef)({
28524
+ dismissOnSnapToBottom: config.dismissOnSnapToBottom === true,
28525
+ snapPointsMode: (_config_snapPointsMode = config.snapPointsMode) !== null && _config_snapPointsMode !== void 0 ? _config_snapPointsMode : "percent",
28526
+ isKeyboardVisible: config.isKeyboardVisible === true
28527
+ });
28528
+ var _config_snapPointsMode1;
28529
+ releaseConfigRef.current = {
28530
+ dismissOnSnapToBottom: config.dismissOnSnapToBottom === true,
28531
+ snapPointsMode: (_config_snapPointsMode1 = config.snapPointsMode) !== null && _config_snapPointsMode1 !== void 0 ? _config_snapPointsMode1 : "percent",
28532
+ isKeyboardVisible: config.isKeyboardVisible === true
28533
+ };
28486
28534
  var gestureStateRef = (0, react$1.useRef)({
28487
28535
  startY: 0,
28488
28536
  lastPanTranslationY: 0,
@@ -28491,6 +28539,7 @@ function useGestureHandlerPan(config) {
28491
28539
  scrollEngaged: false,
28492
28540
  frozenPositions: [],
28493
28541
  frozenMinY: 0,
28542
+ frozenIsKeyboardVisible: false,
28494
28543
  panStarted: false
28495
28544
  });
28496
28545
  var onStart = (0, react$1.useCallback)(function() {
@@ -28529,6 +28578,7 @@ function useGestureHandlerPan(config) {
28529
28578
  gs.scrollEngaged = currentScrollY > 0;
28530
28579
  gs.frozenPositions = [...positions];
28531
28580
  gs.frozenMinY = minY;
28581
+ gs.frozenIsKeyboardVisible = releaseConfigRef.current.isKeyboardVisible;
28532
28582
  if (!atTop) {
28533
28583
  var _scrollBridge_setScrollEnabled;
28534
28584
  (_scrollBridge_setScrollEnabled = scrollBridge.setScrollEnabled) === null || _scrollBridge_setScrollEnabled === void 0 || _scrollBridge_setScrollEnabled.call(scrollBridge, false, 0);
@@ -28579,17 +28629,17 @@ function useGestureHandlerPan(config) {
28579
28629
  return;
28580
28630
  }
28581
28631
  var projectedEnd = currentPos + frameSize * (velocityY / 1e3) * .2;
28582
- var closestPoint = 0;
28583
- var minDist = Number.POSITIVE_INFINITY;
28584
- for (var i = 0; i < snapPositions.length; i++) {
28585
- var pos = snapPositions[i];
28586
- var dist = Math.abs(projectedEnd - pos);
28587
- if (dist < minDist) {
28588
- minDist = dist;
28589
- closestPoint = i;
28590
- }
28591
- }
28592
- onEnd(closestPoint);
28632
+ var releaseConfig = releaseConfigRef.current;
28633
+ onEnd(getSheetReleasePosition({
28634
+ positions: snapPositions,
28635
+ projectedEnd,
28636
+ currentPosition: currentPos,
28637
+ frameSize,
28638
+ dismissOnSnapToBottom: releaseConfig.dismissOnSnapToBottom,
28639
+ snapPointsMode: releaseConfig.snapPointsMode,
28640
+ isKeyboardVisible: gs.frozenIsKeyboardVisible,
28641
+ isWeb: false
28642
+ }));
28593
28643
  }).onFinalize(function() {
28594
28644
  scrollBridge.scrollLockY = void 0;
28595
28645
  if (gs.panStarted) setIsDragging(false);
@@ -28707,10 +28757,15 @@ function useKeyboardControllerSheet(options) {
28707
28757
  };
28708
28758
  }
28709
28759
  //#endregion
28760
+ //#region ../sheet/dist/esm/useSafeAreaInsets.native.js
28761
+ var SafeAreaInsetsContext = react_native_safe_area_context.SafeAreaInsetsContext;
28762
+ function useSafeAreaInsets() {
28763
+ return react$1.useContext(SafeAreaInsetsContext);
28764
+ }
28765
+ //#endregion
28710
28766
  //#region ../sheet/dist/esm/SheetImplementationCustom.native.js
28711
28767
  init_index_native$4();
28712
28768
  init_index_native$7();
28713
- init_index_native$3();
28714
28769
  init_esm();
28715
28770
  init_objectSpread2();
28716
28771
  var hiddenSize = 10000.1;
@@ -28722,23 +28777,20 @@ var rnghRootStyleClosed = {
28722
28777
  width: "100%",
28723
28778
  height: 0
28724
28779
  };
28725
- var _cachedSafeAreaTop;
28726
- function getSafeAreaTopInset() {
28727
- if (_cachedSafeAreaTop !== void 0) return _cachedSafeAreaTop;
28728
- _cachedSafeAreaTop = getSafeArea().getInsets().top;
28729
- return _cachedSafeAreaTop;
28730
- }
28731
28780
  var relativeDimensionTo = "screen";
28732
28781
  function getStableViewportHeight() {
28733
28782
  return Dimensions.get(relativeDimensionTo).height;
28734
28783
  }
28735
28784
  var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(function SheetImplementationCustom2(props, forwardedRef) {
28736
28785
  var parentSheet = react$1.default.useContext(ParentSheetContext);
28786
+ var safeAreaInsets = useSafeAreaInsets();
28787
+ var _safeAreaInsets_top;
28788
+ var safeAreaTopInset = (_safeAreaInsets_top = safeAreaInsets === null || safeAreaInsets === void 0 ? void 0 : safeAreaInsets.top) !== null && _safeAreaInsets_top !== void 0 ? _safeAreaInsets_top : 0;
28737
28789
  var { transition, transitionConfig: transitionConfigProp, modal = false, zIndex = parentSheet.zIndex + 1, moveOnKeyboardChange = false, unmountChildrenWhenHidden = false, portalProps, containerComponent: ContainerComponent = react$1.default.Fragment, onAnimationComplete } = props;
28738
28790
  var state = useSheetOpenState(props);
28739
28791
  var [overlayComponent, setOverlayComponent] = react$1.default.useState(null);
28740
28792
  var providerProps = useSheetProviderProps(props, state, { onOverlayComponent: setOverlayComponent });
28741
- var { frameSize, setFrameSize, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps;
28793
+ var { frameSize, setFrameSize, dismissOnSnapToBottom, snapPoints, snapPointsMode, hasFit, position, setPosition, scrollBridge, screenSize, setMaxContentSize, maxSnapPoint } = providerProps;
28742
28794
  var { open, controller, isHidden } = state;
28743
28795
  var openRef = react$1.default.useRef(open);
28744
28796
  openRef.current = open;
@@ -28765,21 +28817,8 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
28765
28817
  if (open && frameSize) stableFrameSize.current = frameSize;
28766
28818
  }, [open, frameSize]);
28767
28819
  var isWebKbSheet = false;
28768
- var hasCleanKbBaseline = react$1.default.useRef(false);
28769
- var seedSettled = react$1.default.useRef(false);
28770
- var stableKbGeom = react$1.default.useRef({
28771
- frame: 0,
28772
- screen: 0
28773
- });
28774
- if (frameSize > 0 && screenSize > 0) {
28775
- stableKbGeom.current.frame = frameSize;
28776
- stableKbGeom.current.screen = screenSize;
28777
- hasCleanKbBaseline.current = true;
28778
- } else if (isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && screenSize > 0) stableKbGeom.current.screen = Math.max(stableKbGeom.current.screen, screenSize);
28779
- var seedingKbBaseline = isWebKbSheet && isKeyboardVisible && !hasCleanKbBaseline.current && !seedSettled.current;
28780
- var freezeForKb = isWebKbSheet && isKeyboardVisible && stableKbGeom.current.frame > 0;
28781
- var effScreenSize = freezeForKb ? stableKbGeom.current.screen : screenSize;
28782
- var effectiveFrameSize = freezeForKb ? stableKbGeom.current.frame : open ? frameSize : stableFrameSize.current || frameSize;
28820
+ var effScreenSize = isWebKbSheet ? getStableViewportHeight() : screenSize;
28821
+ var effectiveFrameSize = open ? frameSize : stableFrameSize.current || frameSize;
28783
28822
  var positions = react$1.default.useMemo(function() {
28784
28823
  return snapPoints.map(function(point) {
28785
28824
  return getYPositions(snapPointsMode, point, effScreenSize, effectiveFrameSize);
@@ -28803,30 +28842,34 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
28803
28842
  if (isDragging || isDraggingRef.current) return activePositionsRef.current;
28804
28843
  var result;
28805
28844
  if (!isKeyboardVisible || keyboardHeight <= 0) result = positions;
28806
- else {
28807
- var safeAreaTop = getSafeAreaTopInset();
28808
- result = positions.map(function(p) {
28809
- if (screenSize && p >= screenSize) return p;
28810
- return Math.max(safeAreaTop, p - keyboardHeight);
28845
+ else result = positions.map(function(p) {
28846
+ return getKeyboardAdjustedSheetY({
28847
+ sheetY: p,
28848
+ screenSize: effScreenSize,
28849
+ isKeyboardVisible,
28850
+ keyboardHeight,
28851
+ shouldTranslate: true,
28852
+ safeAreaTop: safeAreaTopInset
28811
28853
  });
28812
- }
28854
+ });
28813
28855
  activePositionsRef.current = result;
28814
28856
  return result;
28815
28857
  }, [
28816
28858
  positions,
28817
28859
  isKeyboardVisible,
28818
28860
  keyboardHeight,
28819
- screenSize,
28820
- isDragging
28861
+ effScreenSize,
28862
+ isDragging,
28863
+ safeAreaTopInset
28821
28864
  ]);
28822
- var keyboardOccludedHeight = seedingKbBaseline ? 0 : getKeyboardOccludedHeight({
28865
+ var keyboardOccludedHeight = getKeyboardOccludedHeight({
28823
28866
  frameSize: effectiveFrameSize,
28824
28867
  isKeyboardVisible,
28825
28868
  keyboardHeight,
28826
28869
  screenSize: effScreenSize,
28827
28870
  sheetY: position >= 0 ? activePositions[position] : void 0
28828
28871
  });
28829
- var keyboardStableFrameHeight = !isWebKbSheet ? 0 : seedingKbBaseline ? stableKbGeom.current.screen || screenSize : stableKbGeom.current.frame > 0 ? stableKbGeom.current.frame : 0;
28872
+ var keyboardStableFrameHeight = isWebKbSheet && isKeyboardVisible && frameSize > 0 ? frameSize : 0;
28830
28873
  var { useAnimatedNumber, useAnimatedNumberStyle, useAnimatedNumberReaction } = animationDriver;
28831
28874
  var _animationDriver_View;
28832
28875
  var AnimatedView = (_animationDriver_View = animationDriver.View) !== null && _animationDriver_View !== void 0 ? _animationDriver_View : View;
@@ -28982,17 +29025,17 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
28982
29025
  isExternalDrag = false;
28983
29026
  previouslyScrolling = false;
28984
29027
  setPanning(false);
28985
- var end = at.current + frameSize * vy * .2;
28986
- var closestPoint = 0;
28987
- var dist = Number.POSITIVE_INFINITY;
28988
- for (var i = 0; i < activePositions.length; i++) {
28989
- var position2 = activePositions[i];
28990
- var curDist = end > position2 ? end - position2 : position2 - end;
28991
- if (curDist < dist) {
28992
- dist = curDist;
28993
- closestPoint = i;
28994
- }
28995
- }
29028
+ var currentPos = at.current;
29029
+ var closestPoint = getSheetReleasePosition({
29030
+ positions: activePositions,
29031
+ projectedEnd: currentPos + frameSize * vy * .2,
29032
+ currentPosition: currentPos,
29033
+ frameSize,
29034
+ dismissOnSnapToBottom,
29035
+ snapPointsMode,
29036
+ isKeyboardVisible,
29037
+ isWeb: false
29038
+ });
28996
29039
  setPosition(closestPoint);
28997
29040
  animateTo(closestPoint);
28998
29041
  };
@@ -29051,6 +29094,9 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
29051
29094
  };
29052
29095
  return PanResponder_default.create({
29053
29096
  onMoveShouldSetPanResponder: onMoveShouldSet,
29097
+ onPanResponderTerminationRequest: function() {
29098
+ return false;
29099
+ },
29054
29100
  onPanResponderGrant: grant,
29055
29101
  onPanResponderMove: function(_e, param) {
29056
29102
  var { dy } = param;
@@ -29069,7 +29115,9 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
29069
29115
  animateTo,
29070
29116
  frameSize,
29071
29117
  activePositions,
29072
- setPosition
29118
+ setPosition,
29119
+ dismissOnSnapToBottom,
29120
+ snapPointsMode
29073
29121
  ]);
29074
29122
  react$1.default.useEffect(function() {
29075
29123
  if (isDragging || isHidden || !open || disableAnimation) return;
@@ -29115,43 +29163,30 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
29115
29163
  at.current = val;
29116
29164
  animatedNumber.setValue(val, { type: "direct" });
29117
29165
  },
29166
+ dismissOnSnapToBottom,
29167
+ snapPointsMode,
29168
+ isKeyboardVisible,
29118
29169
  pauseKeyboardHandler
29119
29170
  });
29120
29171
  var ignoreLayoutForKeyboard = useEvent(function() {
29121
29172
  return false;
29122
29173
  });
29123
- var shouldSeedKbFrame = useEvent(function() {
29124
- return isWebKbSheet && !hasCleanKbBaseline.current && !seedSettled.current && ignoreLayoutForKeyboard();
29125
- });
29126
- var shouldSeedKbScreen = useEvent(function() {
29127
- return isWebKbSheet && !hasCleanKbBaseline.current && ignoreLayoutForKeyboard();
29128
- });
29129
29174
  var handleAnimationViewLayout = useEvent(function(e) {
29130
29175
  var _e_nativeEvent;
29131
29176
  if (!open && stableFrameSize.current !== 0) return;
29132
- var seeding = shouldSeedKbFrame();
29133
- if (!seeding && ignoreLayoutForKeyboard()) return;
29134
29177
  var layoutHeight = (_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height;
29135
- var next = modal || seeding ? Math.min(layoutHeight, getStableViewportHeight()) : layoutHeight;
29178
+ if (ignoreLayoutForKeyboard() && frameSize > 0) return;
29179
+ var next = modal ? Math.min(layoutHeight, getStableViewportHeight()) : layoutHeight;
29136
29180
  if (!next) return;
29137
- var rounded = Math.round(next);
29138
- if (seeding) {
29139
- if (rounded > stableKbGeom.current.frame) stableKbGeom.current.frame = rounded;
29140
- else if (stableKbGeom.current.frame > 0) seedSettled.current = true;
29141
- }
29142
- setFrameSize(rounded);
29181
+ setFrameSize(Math.round(next));
29143
29182
  });
29144
29183
  var handleMaxContentViewLayout = react$1.default.useCallback(function(e) {
29145
29184
  var _e_nativeEvent;
29146
- if (shouldSeedKbScreen()) {
29147
- setMaxContentSize(Math.round(getStableViewportHeight()));
29148
- return;
29149
- }
29150
- if (ignoreLayoutForKeyboard()) return;
29185
+ if (ignoreLayoutForKeyboard() && screenSize > 0) return;
29151
29186
  var next = Math.min((_e_nativeEvent = e.nativeEvent) === null || _e_nativeEvent === void 0 ? void 0 : _e_nativeEvent.layout.height, getStableViewportHeight());
29152
29187
  if (!next) return;
29153
29188
  setMaxContentSize(Math.round(next));
29154
- }, [ignoreLayoutForKeyboard, shouldSeedKbScreen]);
29189
+ }, [ignoreLayoutForKeyboard, screenSize]);
29155
29190
  var animatedStyle = useAnimatedNumberStyle(animatedNumber, react$1.default.useCallback(function(val) {
29156
29191
  "worklet";
29157
29192
  return { transform: [{ translateY: frameSize === 0 ? hiddenSize : val }] };
@@ -29176,7 +29211,6 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
29176
29211
  keyboardOccludedHeight,
29177
29212
  isKeyboardVisible,
29178
29213
  keyboardStableFrameHeight,
29179
- isKeyboardSeeding: seedingKbBaseline,
29180
29214
  setHasScrollView,
29181
29215
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(GestureSheetProvider, {
29182
29216
  isDragging,
@@ -29232,7 +29266,10 @@ var SheetImplementationCustom = /* @__PURE__ */ react$1.default.forwardRef(funct
29232
29266
  }))
29233
29267
  })
29234
29268
  });
29235
- if (needsPortalRepropagation()) contents = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProvideAdaptContext, _objectSpread2(_objectSpread2({}, useAdaptContext()), {}, { children: contents }));
29269
+ if (needsPortalRepropagation()) contents = /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ProvideAdaptContext, _objectSpread2(_objectSpread2({}, useAdaptContext()), {}, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SafeAreaInsetsContext.Provider, {
29270
+ value: safeAreaInsets,
29271
+ children: contents
29272
+ }) }));
29236
29273
  var shouldMountChildren = unmountChildrenWhenHidden ? !!opacity : true;
29237
29274
  if (modal) {
29238
29275
  var RNGHRoot = getGestureHandlerState().RootView;
@@ -29363,6 +29400,10 @@ function useSheetScrollViewGestures(param) {
29363
29400
  else {
29364
29401
  panHandles = !hasScrollableContent;
29365
29402
  if (!panHandles) {
29403
+ s.handoffOccurred = false;
29404
+ s.handoffDragOffset = 0;
29405
+ s.scrollEngaged = currentScrollY > 0;
29406
+ s.prevScrollY = currentScrollY;
29366
29407
  s.isScrolling = true;
29367
29408
  scrollBridge.scrollLock = true;
29368
29409
  setScrollEnabled(true);
@@ -29422,8 +29463,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
29422
29463
  height: void 0,
29423
29464
  maxHeight: screenSize || void 0
29424
29465
  } : { flex: 1 };
29425
- var isKeyboardSeeding = context.isKeyboardSeeding === true;
29426
- var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? isKeyboardSeeding ? { maxHeight: frozenFrameHeight } : {
29466
+ var keyboardFrozenOverride = hasFit && isKeyboardVisible && frozenFrameHeight > 0 ? {
29427
29467
  height: frozenFrameHeight,
29428
29468
  maxHeight: frozenFrameHeight
29429
29469
  } : null;
@@ -29432,6 +29472,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
29432
29472
  var useRNGHScrollView = isGestureHandlerEnabled() && RNGHScrollView && panGestureRef;
29433
29473
  var currentScrollOffset = (0, react$1.useRef)(0);
29434
29474
  var lockedScrollY = (0, react$1.useRef)(0);
29475
+ (0, react$1.useRef)(0);
29435
29476
  var setScrollEnabled = function(next, lockTo) {
29436
29477
  if (!next) {
29437
29478
  var _scrollRef_current_scrollTo, _scrollRef_current;
@@ -29456,6 +29497,14 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
29456
29497
  animated: false
29457
29498
  });
29458
29499
  };
29500
+ var scrollFocusedInputClearOfKeyboard = react$1.default.useCallback(function() {}, [
29501
+ hasFit,
29502
+ isKeyboardVisible,
29503
+ keyboardOccludedHeight,
29504
+ scrollBridge
29505
+ ]);
29506
+ var scheduleFocusedInputScroll = react$1.default.useCallback(function() {}, [hasFit, scrollFocusedInputClearOfKeyboard]);
29507
+ (0, react$1.useEffect)(function() {}, [hasFit, scheduleFocusedInputScroll]);
29459
29508
  (0, react$1.useEffect)(function() {
29460
29509
  setHasScrollView(true);
29461
29510
  if (isGestureHandlerEnabled()) {
@@ -29490,6 +29539,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
29490
29539
  if (height !== contentHeight.current) {
29491
29540
  contentHeight.current = height;
29492
29541
  updateScrollable();
29542
+ if (keyboardOccludedHeight > 0) scheduleFocusedInputScroll();
29493
29543
  }
29494
29544
  },
29495
29545
  children: [children, keyboardOccludedHeight > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(View, {
@@ -29545,6 +29595,7 @@ var SheetScrollView = /* @__PURE__ */ react$1.default.forwardRef(function(param,
29545
29595
  scrollEnabled,
29546
29596
  onScroll: function(e) {
29547
29597
  var { y } = e.nativeEvent.contentOffset;
29598
+ currentScrollOffset.current = y;
29548
29599
  scrollBridge.y = y;
29549
29600
  if (y > 0) scrollBridge.scrollStartY = -1;
29550
29601
  onScroll === null || onScroll === void 0 || onScroll(e);
@@ -29681,13 +29732,15 @@ function createSheet(param) {
29681
29732
  children: sheetContents
29682
29733
  }), !disableHideBottomOverflow && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Frame, _objectSpread2(_objectSpread2({}, props), {}, {
29683
29734
  componentName: "SheetCover",
29735
+ "data-sheet-cover": "",
29684
29736
  children: null,
29685
29737
  testID: void 0,
29686
29738
  id: void 0,
29687
29739
  position: "absolute",
29688
- bottom: "-100%",
29740
+ top: "100%",
29689
29741
  zIndex: -1,
29690
29742
  height: context.frameSize,
29743
+ maxHeight: void 0,
29691
29744
  left: 0,
29692
29745
  right: 0,
29693
29746
  borderWidth: 0,
@@ -31401,8 +31454,12 @@ var _excluded$7 = [
31401
31454
  "onSwipeEnd",
31402
31455
  "viewportName"
31403
31456
  ];
31457
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
31458
+ if (typeof require !== "undefined") return require.apply(this, arguments);
31459
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.");
31460
+ });
31404
31461
  var getPanResponder = function() {
31405
- return (init_esm(), __toCommonJS(esm_exports)).PanResponder;
31462
+ return __require("react-native").PanResponder;
31406
31463
  };
31407
31464
  var ToastImplFrame = styledExport(YStack, {
31408
31465
  name: "ToastImpl",