tamagui 1.130.2 → 1.130.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/native.js CHANGED
@@ -7871,10 +7871,7 @@ var require_Theme_native = __commonJS({
7871
7871
  }
7872
7872
  });
7873
7873
  module2.exports = __toCommonJS2(Theme_exports);
7874
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(), empty = {
7875
- className: "",
7876
- style: {}
7877
- }, Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
7874
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_constants4 = require_index_native6(), import_react3 = __toESM2(require("react")), import_config = require_config_native(), import_createVariable = require_createVariable_native(), import_useTheme = require_useTheme_native(), import_useThemeState = require_useThemeState_native(), import_ThemeDebug = require_ThemeDebug_native(), Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
7878
7875
  if (props.disable) return props.children;
7879
7876
  var { passThrough } = props, isRoot = !!props._isRoot, [_, themeState] = (0, import_useTheme.useThemeWithState)(props, isRoot), disableDirectChildTheme = props["disable-child-theme"], finalChildren = disableDirectChildTheme ? import_react3.Children.map(props.children, function(child) {
7880
7877
  return passThrough ? child : /* @__PURE__ */ (0, import_react3.cloneElement)(child, {
@@ -7922,17 +7919,21 @@ var require_Theme_native = __commonJS({
7922
7919
  forceClassName,
7923
7920
  themeState,
7924
7921
  state,
7925
- ...getThemeClassNameAndStyle(themeState, props, isRoot)
7922
+ themeSpanProps: getThemeClassNameAndColor(themeState, props, isRoot)
7926
7923
  }), forceClassName === !1) return children;
7927
7924
  if (import_constants4.isWeb) {
7928
- var { className = "", style } = passThrough ? {} : getThemeClassNameAndStyle(themeState, props, isRoot);
7925
+ var baseStyle = props.contain ? inertContainedStyle : inertStyle, { className = "", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);
7929
7926
  if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7930
- className: `${className} _dsp_contents is_Theme`,
7931
- style: passThrough ? void 0 : style,
7927
+ className: `${className} is_Theme`,
7928
+ style: passThrough ? baseStyle : {
7929
+ color,
7930
+ ...baseStyle
7931
+ },
7932
7932
  children
7933
7933
  }), state.hasEverThemed === "wrapped") {
7934
- var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} _dsp_contents` : "_dsp_contents";
7934
+ var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} ` : "";
7935
7935
  children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7936
+ style: baseStyle,
7936
7937
  className: className1,
7937
7938
  children
7938
7939
  });
@@ -7941,14 +7942,21 @@ var require_Theme_native = __commonJS({
7941
7942
  }
7942
7943
  return children;
7943
7944
  }
7944
- function getThemeClassNameAndStyle(themeState, props) {
7945
+ var inertStyle = {
7946
+ display: "contents"
7947
+ }, inertContainedStyle = {
7948
+ display: "contents",
7949
+ contain: "strict"
7950
+ }, empty = {
7951
+ className: "",
7952
+ color: void 0
7953
+ };
7954
+ function getThemeClassNameAndColor(themeState, props) {
7945
7955
  var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
7946
7956
  if (!themeState.isNew && !props.forceClassName) return empty;
7947
- var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", style = themeColor ? {
7948
- color: themeColor
7949
- } : void 0, maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
7957
+ var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", maxInverses = (0, import_config.getSetting)("maxDarkLightNesting") || 3, themeClassName = themeState.inverses >= maxInverses ? themeState.name : themeState.name.replace(schemePrefix, ""), className = `${isRoot ? "" : "t_sub_theme"} t_${themeClassName}`;
7950
7958
  return {
7951
- style,
7959
+ color: themeColor,
7952
7960
  className
7953
7961
  };
7954
7962
  }
@@ -9055,13 +9063,13 @@ If you meant to do this, you can disable this warning - either change untilMeasu
9055
9063
  onPress,
9056
9064
  onLongPress
9057
9065
  });
9058
- process.env.NODE_ENV === "development" && time2 && time2`spaced-as-child`;
9059
- var useChildrenResult;
9060
- import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time2 && time2`use-children`, splitStyles || (elementType = "span", content = propsIn.children, viewProps = {
9066
+ process.env.NODE_ENV === "development" && time2 && time2`spaced-as-child`, splitStyles || (content = propsIn.children, elementType = BaseViewComponent, viewProps = {
9061
9067
  style: {
9062
9068
  display: "contents"
9063
9069
  }
9064
- }), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
9070
+ });
9071
+ var useChildrenResult;
9072
+ import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), process.env.NODE_ENV === "development" && time2 && time2`use-children`, useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
9065
9073
  var ResetPresence2 = config == null || (_config_animations = config.animations) === null || _config_animations === void 0 ? void 0 : _config_animations.ResetPresence, needsReset = !!// not when passing down to child
9066
9074
  (!asChild && // not when passThrough
9067
9075
  splitStyles && // not when HOC
@@ -13419,7 +13427,6 @@ var require_index_native19 = __commonJS({
13419
13427
  return cb();
13420
13428
  }), queuedUpdates.clear()));
13421
13429
  }
13422
- var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
13423
13430
  function startGlobalIntersectionObserver() {
13424
13431
  !import_constants4.isClient || globalIntersectionObserver || (globalIntersectionObserver = new IntersectionObserver(function(entries) {
13425
13432
  entries.forEach(function(entry) {
@@ -13432,21 +13439,19 @@ var require_index_native19 = __commonJS({
13432
13439
  }
13433
13440
  if (import_constants4.isClient) if (rAF) {
13434
13441
  layoutOnAnimationFrame = function() {
13435
- var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
13436
- if (lastFrameAt = now, frameCount++, frameCount % RUN_EVERY_X_FRAMES === 0) {
13437
- frameCount = 0, rAF(layoutOnAnimationFrame);
13438
- return;
13439
- }
13440
13442
  if (strategy !== "off") {
13441
- var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
13442
- hasRecentSyncWork || Nodes.forEach(function(node) {
13443
- updateLayoutIfChanged(node, lastFrameAt);
13443
+ if (frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
13444
+ rAF(layoutOnAnimationFrame);
13445
+ return;
13446
+ }
13447
+ frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), Nodes.forEach(function(node) {
13448
+ updateLayoutIfChanged(node);
13444
13449
  });
13445
13450
  }
13446
13451
  rAF(layoutOnAnimationFrame);
13447
- }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body, lastFrameAt = Date.now();
13448
- async function updateLayoutIfChanged(node, frameId) {
13449
- if (!(supportsCheckVisibility && !node.checkVisibility()) && IntersectionState.get(node) !== !1) {
13452
+ }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body;
13453
+ async function updateLayoutIfChanged(node) {
13454
+ if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
13450
13455
  var onLayout = LayoutHandlers.get(node);
13451
13456
  if (typeof onLayout == "function") {
13452
13457
  var parentNode = node.parentElement;
@@ -13457,7 +13462,7 @@ var require_index_native19 = __commonJS({
13457
13462
  getBoundingClientRectAsync(node),
13458
13463
  getBoundingClientRectAsync(parentNode)
13459
13464
  ]);
13460
- if (nr === !1 || pr === !1 || frameId !== lastFrameAt) return;
13465
+ if (nr === !1 || pr === !1) return;
13461
13466
  nodeRect = nr, parentRect = pr;
13462
13467
  } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
13463
13468
  var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
@@ -13475,9 +13480,9 @@ var require_index_native19 = __commonJS({
13475
13480
  }
13476
13481
  }
13477
13482
  }
13478
- rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 4;
13483
+ rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 8;
13479
13484
  } else process.env.NODE_ENV === "development" && console.warn("No requestAnimationFrame - please polyfill for onLayout to work correctly");
13480
- var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, lastFrameAt, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
13485
+ var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
13481
13486
  return {
13482
13487
  nativeEvent: {
13483
13488
  layout: getRelativeDimensions(nodeRect, parentRect),
@@ -13542,7 +13547,7 @@ var require_index_native19 = __commonJS({
13542
13547
  if (onLayout) {
13543
13548
  var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
13544
13549
  if (node2) {
13545
- LayoutHandlers.set(node2, onLayout), Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
13550
+ Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
13546
13551
  var parentNode = node2.parentNode;
13547
13552
  return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
13548
13553
  Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2), IntersectionState.delete(node2), globalIntersectionObserver && globalIntersectionObserver.unobserve(node2);
@@ -16828,7 +16833,7 @@ var require_Portal_native = __commonJS({
16828
16833
  }
16829
16834
  });
16830
16835
  module2.exports = __toCommonJS2(Portal_native_exports);
16831
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_stacks3 = require_index_native24(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_react_native4 = require_fake_react_native(), import_constants4 = require_constants_native3(), import_GorhomPortalItem = require_GorhomPortalItem_native(), import_helpers = require_helpers_native(), createPortal = function() {
16836
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_core12 = require_index_native20(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_react_native4 = require_fake_react_native(), import_constants4 = require_constants_native3(), import_GorhomPortalItem = require_GorhomPortalItem_native(), import_helpers = require_helpers_native(), createPortal = function() {
16832
16837
  if (import_constants4.IS_FABRIC) try {
16833
16838
  var _ReactFabricShimModule_default, ReactFabricShimModule = require_fake_react_native(), _ReactFabricShimModule_default_createPortal;
16834
16839
  return (_ReactFabricShimModule_default_createPortal = ReactFabricShimModule == null || (_ReactFabricShimModule_default = ReactFabricShimModule.default) === null || _ReactFabricShimModule_default === void 0 ? void 0 : _ReactFabricShimModule_default.createPortal) !== null && _ReactFabricShimModule_default_createPortal !== void 0 ? _ReactFabricShimModule_default_createPortal : ReactFabricShimModule.createPortal;
@@ -16842,15 +16847,17 @@ var require_Portal_native = __commonJS({
16842
16847
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
16843
16848
  }
16844
16849
  }(), Portal = function(propsIn) {
16845
- var { stackZIndex, ...props } = propsIn, rootTag = React4.useContext(import_react_native4.RootTagContext), zIndex = (0, import_z_index_stack2.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn)), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
16850
+ var rootTag = React4.useContext(import_react_native4.RootTagContext), zIndex = (0, import_z_index_stack2.useStackedZIndex)((0, import_helpers.getStackedZIndexProps)(propsIn)), { children, passThrough } = propsIn, contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
16846
16851
  pointerEvents: "box-none",
16847
- fullscreen: !0,
16848
16852
  position: "absolute",
16853
+ inset: 0,
16849
16854
  maxWidth: "100%",
16850
- ...props,
16851
- zIndex
16855
+ zIndex,
16856
+ passThrough,
16857
+ children
16852
16858
  });
16853
16859
  return !createPortal || !import_constants4.USE_NATIVE_PORTAL || !rootTag ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_GorhomPortalItem.GorhomPortalItem, {
16860
+ passThrough,
16854
16861
  hostName: "root",
16855
16862
  children: contents
16856
16863
  }) : createPortal(contents, rootTag);
@@ -17811,11 +17818,15 @@ var require_RemoveScroll_native = __commonJS({
17811
17818
  __export2(RemoveScroll_native_exports, {
17812
17819
  RemoveScroll: function() {
17813
17820
  return RemoveScroll;
17821
+ },
17822
+ getAllowedScrollableNode: function() {
17823
+ return getAllowedScrollableNode;
17814
17824
  }
17815
17825
  });
17816
17826
  module2.exports = __toCommonJS2(RemoveScroll_native_exports);
17817
17827
  var RemoveScroll = function(props) {
17818
17828
  return props.children;
17829
+ }, getAllowedScrollableNode = function() {
17819
17830
  };
17820
17831
  }
17821
17832
  });
@@ -18088,11 +18099,11 @@ var require_useSheetOpenState_native = __commonJS({
18088
18099
  var { isHidden, controller } = (0, import_useSheetController.useSheetController)(), onOpenChangeInternal = function(val) {
18089
18100
  var _controller_onOpenChange, _props_onOpenChange;
18090
18101
  controller == null || (_controller_onOpenChange = controller.onOpenChange) === null || _controller_onOpenChange === void 0 || _controller_onOpenChange.call(controller, val), (_props_onOpenChange = props.onOpenChange) === null || _props_onOpenChange === void 0 || _props_onOpenChange.call(props, val);
18091
- }, _controller_open, propVal = (_controller_open = controller == null ? void 0 : controller.open) !== null && _controller_open !== void 0 ? _controller_open : props.open, _props_defaultOpen, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
18102
+ }, _controller_open, _props_open, propVal = props.preferAdaptParentOpenState ? (_controller_open = controller == null ? void 0 : controller.open) !== null && _controller_open !== void 0 ? _controller_open : props.open : (_props_open = props.open) !== null && _props_open !== void 0 ? _props_open : controller == null ? void 0 : controller.open, _props_defaultOpen, [open, setOpen] = (0, import_use_controllable_state.useControllableState)({
18092
18103
  prop: propVal,
18093
18104
  defaultProp: (_props_defaultOpen = props.defaultOpen) !== null && _props_defaultOpen !== void 0 ? _props_defaultOpen : !1,
18094
18105
  onChange: onOpenChangeInternal,
18095
- strategy: "prop-wins"
18106
+ strategy: "most-recent-wins"
18096
18107
  });
18097
18108
  return {
18098
18109
  open,
@@ -18179,7 +18190,7 @@ var require_useSheetProviderProps_native = __commonJS({
18179
18190
  prop: props.position,
18180
18191
  defaultProp: props.defaultPosition || (state.open ? 0 : -1),
18181
18192
  onChange: props.onPositionChange,
18182
- strategy: "prop-wins"
18193
+ strategy: "most-recent-wins"
18183
18194
  }), position = state.open === !1 ? -1 : position_, { open } = state, setPosition = import_react3.default.useCallback(function(next) {
18184
18195
  props.dismissOnSnapToBottom && next === snapPoints.length - 1 ? state.setOpen(!1) : setPositionImmediate(next);
18185
18196
  }, [
@@ -18213,7 +18224,7 @@ var require_useSheetProviderProps_native = __commonJS({
18213
18224
  var { animationDriver } = (0, import_core12.useConfiguration)();
18214
18225
  if (!animationDriver) throw new Error(process.env.NODE_ENV === "production" ? "\u274C 008" : "Must set animations in tamagui.config.ts");
18215
18226
  var scrollBridge = (0, import_use_constant.useConstant)(function() {
18216
- return {
18227
+ var parentDragListeners = /* @__PURE__ */ new Set(), bridge = {
18217
18228
  enabled: !1,
18218
18229
  y: 0,
18219
18230
  paneY: 0,
@@ -18223,8 +18234,20 @@ var require_useSheetProviderProps_native = __commonJS({
18223
18234
  },
18224
18235
  release: function() {
18225
18236
  },
18226
- scrollLock: !1
18237
+ scrollLock: !1,
18238
+ isParentDragging: !1,
18239
+ onParentDragging: function(cb) {
18240
+ return parentDragListeners.add(cb), function() {
18241
+ parentDragListeners.delete(cb);
18242
+ };
18243
+ },
18244
+ setParentDragging: function(val) {
18245
+ val !== bridge.isParentDragging && (bridge.isParentDragging = val, parentDragListeners.forEach(function(cb) {
18246
+ return cb(val);
18247
+ }));
18248
+ }
18227
18249
  };
18250
+ return bridge;
18228
18251
  }), _props_forceRemoveScrollEnabled, removeScrollEnabled = (_props_forceRemoveScrollEnabled = props.forceRemoveScrollEnabled) !== null && _props_forceRemoveScrollEnabled !== void 0 ? _props_forceRemoveScrollEnabled : open && props.modal, maxSnapPoint = snapPoints[0], screenSize = snapPointsMode === "percent" ? frameSize / ((typeof maxSnapPoint == "number" ? maxSnapPoint : 100) / 100) : maxContentSize, _props_dismissOnOverlayPress, _props_dismissOnSnapToBottom, providerProps = {
18229
18252
  screenSize,
18230
18253
  maxSnapPoint,
@@ -18329,7 +18352,6 @@ var require_nativeSheet_native = __commonJS({
18329
18352
  }
18330
18353
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
18331
18354
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
18332
- scrollEnabled: !0,
18333
18355
  setHasScrollView: emptyFn,
18334
18356
  ...providerProps,
18335
18357
  onlyShowFrame: !0,
@@ -18622,9 +18644,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18622
18644
  isAbleToPosition,
18623
18645
  position
18624
18646
  ]);
18625
- var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), scrollEnabled = (0, import_react3.useRef)(!0), setScrollEnabled = import_react3.default.useCallback(function(val) {
18626
- scrollEnabled.current = val;
18627
- }, []), panResponder = import_react3.default.useMemo(function() {
18647
+ var _props_disableDrag, disableDrag = (_props_disableDrag = props.disableDrag) !== null && _props_disableDrag !== void 0 ? _props_disableDrag : controller == null ? void 0 : controller.disableDrag, themeName = (0, import_core12.useThemeName)(), [isDragging, setIsDragging] = import_react3.default.useState(!1), panResponder = import_react3.default.useMemo(function() {
18628
18648
  if (disableDrag || !frameSize || isShowingInnerSheet) return;
18629
18649
  var minY = positions[0];
18630
18650
  scrollBridge.paneMinY = minY;
@@ -18634,13 +18654,13 @@ var require_SheetImplementationCustom_native = __commonJS({
18634
18654
  }
18635
18655
  var release = function(param) {
18636
18656
  var { vy, dragAt } = param;
18637
- if (!scrollBridge.scrollLock) {
18657
+ if (scrollBridge.setParentDragging(!1), !scrollBridge.scrollLock) {
18638
18658
  isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
18639
18659
  for (var at2 = dragAt + startY, end = at2 + frameSize * vy * 0.2, closestPoint = 0, dist = Number.POSITIVE_INFINITY, i = 0; i < positions.length; i++) {
18640
18660
  var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
18641
18661
  curDist < dist && (dist = curDist, closestPoint = i);
18642
18662
  }
18643
- setPosition(closestPoint), animateTo(closestPoint), setScrollEnabled(closestPoint === 0);
18663
+ setPosition(closestPoint), animateTo(closestPoint);
18644
18664
  }
18645
18665
  }, finish = function(_e, state2) {
18646
18666
  release({
@@ -18653,11 +18673,12 @@ var require_SheetImplementationCustom_native = __commonJS({
18653
18673
  if (e.target === providerProps.handleRef.current) return !0;
18654
18674
  if (scrollBridge.scrollLock) return !1;
18655
18675
  var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
18656
- return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 10;
18676
+ return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
18657
18677
  }
18658
- return getShouldSet();
18678
+ var granted = getShouldSet();
18679
+ return granted && scrollBridge.setParentDragging(!0), granted;
18659
18680
  }, grant = function() {
18660
- setScrollEnabled(!1), setPanning(!0), stopSpring(), startY = at.current;
18681
+ setPanning(!0), stopSpring(), startY = at.current;
18661
18682
  }, isExternalDrag = !1;
18662
18683
  return scrollBridge.drag = function(dy) {
18663
18684
  isExternalDrag || (isExternalDrag = !0, grant());
@@ -18669,8 +18690,8 @@ var require_SheetImplementationCustom_native = __commonJS({
18669
18690
  onMoveShouldSetPanResponder: onMoveShouldSet,
18670
18691
  onPanResponderGrant: grant,
18671
18692
  onPanResponderMove: function(_e, param) {
18672
- var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
18673
- animatedNumber.setValue(to, {
18693
+ var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY), isAtTop = to <= minY;
18694
+ isAtTop ? scrollBridge.setParentDragging(!1) : scrollBridge.setParentDragging(!0), animatedNumber.setValue(to, {
18674
18695
  type: "direct"
18675
18696
  });
18676
18697
  },
@@ -18744,7 +18765,6 @@ var require_SheetImplementationCustom_native = __commonJS({
18744
18765
  value: nextParentContext,
18745
18766
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
18746
18767
  ...providerProps,
18747
- scrollEnabled: scrollEnabled.current,
18748
18768
  setHasScrollView,
18749
18769
  children: [
18750
18770
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
@@ -18813,6 +18833,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18813
18833
  ...portalProps,
18814
18834
  children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ContainerComponent, {
18815
18835
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
18836
+ contain: !0,
18816
18837
  forceClassName: !0,
18817
18838
  name: themeName,
18818
18839
  children: contents
@@ -19000,93 +19021,139 @@ var require_SheetScrollView_native = __commonJS({
19000
19021
  }
19001
19022
  });
19002
19023
  module2.exports = __toCommonJS2(SheetScrollView_exports);
19003
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_core12 = require_index_native20(), import_scroll_view = require_index_native37(), import_use_controllable_state = require_index_native10(), import_react3 = __toESM2(require("react")), import_SheetContext = require_SheetContext_native(), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react3.default.forwardRef(function(param, ref) {
19004
- var { __scopeSheet, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge, scrollEnabled: scrollEnabled_, setHasScrollView } = context, [scrollEnabled, setScrollEnabled_] = (0, import_use_controllable_state.useControllableState)({
19005
- prop: scrollEnabledProp,
19006
- defaultProp: !0
19007
- }), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
19008
- var _scrollRef_current_setNativeProps, _scrollRef_current;
19009
- (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 || (_scrollRef_current_setNativeProps = _scrollRef_current.setNativeProps) === null || _scrollRef_current_setNativeProps === void 0 || _scrollRef_current_setNativeProps.call(_scrollRef_current, {
19010
- scrollEnabled: next
19011
- }), setScrollEnabled_(next);
19012
- }, state = import_react3.default.useRef({
19013
- lastPageY: 0,
19014
- dragAt: 0,
19015
- dys: [],
19016
- // store a few recent dys to get velocity on release
19017
- isScrolling: !1,
19018
- isDragging: !1
19019
- });
19020
- (0, import_react3.useEffect)(function() {
19021
- return setHasScrollView(!0), function() {
19022
- setHasScrollView(!1);
19023
- };
19024
- }, []);
19025
- var release = function() {
19026
- if (state.current.isDragging) {
19027
- state.current.isDragging = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
19028
- var vy = 0;
19029
- if (state.current.dys.length) {
19030
- var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
19031
- return a + b;
19032
- }, 0) : 0, avgDy = dist / recentDys.length;
19033
- vy = avgDy * 0.04;
19034
- }
19035
- state.current.dys = [], scrollBridge.release({
19036
- dragAt: state.current.dragAt,
19037
- vy
19038
- });
19039
- }
19040
- }, scrollable = scrollEnabled ?? scrollEnabled_;
19041
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
19042
- ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
19043
- flex: 1,
19044
- scrollEventThrottle: 8,
19045
- onResponderRelease: release,
19046
- className: "_ovs-contain",
19047
- scrollEnabled: scrollable,
19048
- // {...(Platform.OS === 'android' && {
19049
- // pointerEvents: scrollable ? undefined : 'none',
19050
- // })}
19051
- onScroll: function(e) {
19052
- var { y } = e.nativeEvent.contentOffset;
19053
- scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
19054
- },
19055
- // This assures that we do not skip the "scrollBridge" values processing
19056
- // when passing this prop into a <Sheet.ScrollView /> overriding it here
19057
- // Useful when using this ScrollView with lists such as "FlashList", i.e.
19058
- // ```
19059
- // renderScrollComponent={Sheet.ScrollView}
19060
- // ```
19061
- onStartShouldSetResponder: function() {
19062
- return scrollBridge.scrollStartY = -1, state.current.isDragging = !0, scrollable;
19063
- },
19064
- // setting to false while onResponderMove is disabled
19065
- onMoveShouldSetResponder: function(e) {
19066
- return scrollable;
19067
- },
19068
- contentContainerStyle: {
19069
- minHeight: "100%"
19070
- },
19071
- onResponderMove: function(e) {
19072
- if (import_core12.isWeb) {
19073
- var { pageY } = e.nativeEvent;
19074
- if (state.current.isScrolling) return;
19075
- scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
19076
- var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
19077
- state.current.lastPageY = pageY;
19078
- var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = (dy === 0 || isDraggingUp) && isPaneAtTop;
19079
- if (shouldScrollLock) {
19080
- state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
19081
- return;
19024
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_compose_refs = require_index_native11(), import_core12 = require_index_native20(), import_scroll_view = require_index_native37(), import_use_controllable_state = require_index_native10(), import_react3 = __toESM2(require("react")), import_SheetContext = require_SheetContext_native(), SHEET_SCROLL_VIEW_NAME = "SheetScrollView", SheetScrollView = /* @__PURE__ */ import_react3.default.forwardRef(
19025
+ // we disallow customizing it because we want to let people know it doens't work well with out measuring of inner content
19026
+ // height using a view
19027
+ function(param, ref) {
19028
+ var { __scopeSheet, children, onScroll, scrollEnabled: scrollEnabledProp, ...props } = param, context = (0, import_SheetContext.useSheetContext)(SHEET_SCROLL_VIEW_NAME, __scopeSheet), { scrollBridge, setHasScrollView } = context, [scrollEnabled, setScrollEnabled_] = (0, import_use_controllable_state.useControllableState)({
19029
+ prop: scrollEnabledProp,
19030
+ defaultProp: !0
19031
+ }), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
19032
+ var _scrollRef_current_setNativeProps, _scrollRef_current;
19033
+ (_scrollRef_current = scrollRef.current) === null || _scrollRef_current === void 0 || (_scrollRef_current_setNativeProps = _scrollRef_current.setNativeProps) === null || _scrollRef_current_setNativeProps === void 0 || _scrollRef_current_setNativeProps.call(_scrollRef_current, {
19034
+ scrollEnabled: next
19035
+ }), setScrollEnabled_(next);
19036
+ }, state = import_react3.default.useRef({
19037
+ lastPageY: 0,
19038
+ dragAt: 0,
19039
+ dys: [],
19040
+ // store a few recent dys to get velocity on release
19041
+ isScrolling: !1,
19042
+ isDraggingScrollArea: !1
19043
+ });
19044
+ (0, import_react3.useEffect)(function() {
19045
+ return setHasScrollView(!0), function() {
19046
+ setHasScrollView(!1);
19047
+ };
19048
+ }, []);
19049
+ var release = function() {
19050
+ if (state.current.isDraggingScrollArea) {
19051
+ state.current.isDraggingScrollArea = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
19052
+ var vy = 0;
19053
+ if (state.current.dys.length) {
19054
+ var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
19055
+ return a + b;
19056
+ }, 0) : 0, avgDy = dist / recentDys.length;
19057
+ vy = avgDy * 0.04;
19082
19058
  }
19083
- setScrollEnabled(!1), scrollBridge.drag(dragAt), state.current.dragAt = dragAt, state.current.dys.push(dy), state.current.dys.length > 100 && (state.current.dys = state.current.dys.slice(-10));
19059
+ state.current.dys = [], scrollBridge.release({
19060
+ dragAt: state.current.dragAt,
19061
+ vy
19062
+ });
19084
19063
  }
19085
- },
19086
- ...props,
19087
- children
19088
- });
19089
- });
19064
+ }, scrollable = scrollEnabled;
19065
+ (0, import_react3.useEffect)(function() {
19066
+ if (import_core12.isClient && scrollRef.current) {
19067
+ var controller = new AbortController(), node = scrollRef.current.getScrollableNode();
19068
+ node.addEventListener(
19069
+ "touchmove",
19070
+ function(e) {
19071
+ scrollBridge.isParentDragging && node.scrollTo({
19072
+ top: scrollBridge.y,
19073
+ behavior: "instant"
19074
+ });
19075
+ },
19076
+ // can't preventdefault its not cancellable
19077
+ {
19078
+ signal: controller.signal,
19079
+ passive: !1
19080
+ }
19081
+ );
19082
+ var disposeBridgeListen = scrollBridge.onParentDragging(function(val) {
19083
+ });
19084
+ return function() {
19085
+ disposeBridgeListen(), controller.abort();
19086
+ };
19087
+ }
19088
+ }, []);
19089
+ var [hasScrollableContent, setHasScrollableContent] = (0, import_react3.useState)(!0), parentHeight = (0, import_react3.useRef)(0), contentHeight = (0, import_react3.useRef)(0), setIsScrollable = function() {
19090
+ parentHeight.current && contentHeight.current && setHasScrollableContent(contentHeight.current > parentHeight.current);
19091
+ };
19092
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_scroll_view.ScrollView, {
19093
+ onLayout: function(e) {
19094
+ parentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
19095
+ },
19096
+ ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
19097
+ flex: 1,
19098
+ scrollEventThrottle: 8,
19099
+ onResponderRelease: release,
19100
+ className: "_ovs-contain",
19101
+ scrollEnabled: scrollable,
19102
+ // {...(Platform.OS === 'android' && {
19103
+ // pointerEvents: scrollable ? undefined : 'none',
19104
+ // })}
19105
+ onScroll: function(e) {
19106
+ var { y } = e.nativeEvent.contentOffset;
19107
+ scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
19108
+ },
19109
+ // This assures that we do not skip the "scrollBridge" values processing
19110
+ // when passing this prop into a <Sheet.ScrollView /> overriding it here
19111
+ // Useful when using this ScrollView with lists such as "FlashList", i.e.
19112
+ // ```
19113
+ // renderScrollComponent={Sheet.ScrollView}
19114
+ // ```
19115
+ onStartShouldSetResponder: function() {
19116
+ return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
19117
+ },
19118
+ // setting to false while onResponderMove is disabled
19119
+ onMoveShouldSetResponder: function(e) {
19120
+ return scrollable;
19121
+ },
19122
+ contentContainerStyle: {
19123
+ minHeight: "100%"
19124
+ },
19125
+ onResponderMove: function(e) {
19126
+ if (import_core12.isWeb) {
19127
+ var { pageY } = e.nativeEvent;
19128
+ state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
19129
+ var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
19130
+ state.current.lastPageY = pageY;
19131
+ var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = hasScrollableContent && (dy === 0 || isDraggingUp) && isPaneAtTop;
19132
+ if (shouldScrollLock && !state.current.isScrolling) {
19133
+ state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
19134
+ return;
19135
+ }
19136
+ if (scrollBridge.y >= 0) return;
19137
+ setScrollEnabled(!1), scrollBridge.drag(dragAt), state.current.dragAt = dragAt, state.current.dys.push(dy), state.current.dys.length > 100 && (state.current.dys = state.current.dys.slice(-10));
19138
+ }
19139
+ },
19140
+ ...props,
19141
+ children: [
19142
+ /* content height measurer */
19143
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
19144
+ position: "absolute",
19145
+ inset: 0,
19146
+ pointerEvents: "none",
19147
+ zIndex: -1,
19148
+ onLayout: function(e) {
19149
+ contentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
19150
+ }
19151
+ }),
19152
+ children
19153
+ ]
19154
+ });
19155
+ }
19156
+ );
19090
19157
  }
19091
19158
  });
19092
19159
 
@@ -24074,6 +24141,7 @@ var require_Animate_native = __commonJS({
24074
24141
  },
24075
24142
  children
24076
24143
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
24144
+ passThrough,
24077
24145
  ...props,
24078
24146
  children: mounted || passThrough ? children : null
24079
24147
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
@@ -24843,8 +24911,8 @@ var require_Popover_native = __commonJS({
24843
24911
  }
24844
24912
  });
24845
24913
  module2.exports = __toCommonJS2(Popover_exports);
24846
- var import_jsx_runtime6 = require("react/jsx-runtime"), import_polyfill_dev = require_polyfill_dev(), import_adapt = require_index_native31(), import_animate = require_index_native57(), import_animate_presence = require_index_native4(), import_aria_hidden = require_index_native33(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_floating = require_index_native58(), import_focus_scope = require_index_native35(), import_helpers = require_index_native7(), import_popper = require_index_native59(), import_portal2 = require_index_native30(), import_remove_scroll = require_index_native36(), import_sheet = require_index_native38(), import_stacks3 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_useFloatingContext = require_useFloatingContext_native(), needsRepropagation = import_constants4.isAndroid || import_constants4.isIos && !import_portal2.USE_NATIVE_PORTAL, POPOVER_SCOPE = "PopoverScope", PopoverContext = (0, import_core12.createStyledContext)({}), usePopoverContext = PopoverContext.useStyledContext, PopoverAnchor = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24847
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
24914
+ var import_jsx_runtime6 = require("react/jsx-runtime"), import_polyfill_dev = require_polyfill_dev(), import_adapt = require_index_native31(), import_animate = require_index_native57(), import_animate_presence = require_index_native4(), import_aria_hidden = require_index_native33(), import_compose_refs = require_index_native11(), import_constants4 = require_index_native6(), import_core12 = require_index_native20(), import_floating = require_index_native58(), import_focus_scope = require_index_native35(), import_helpers = require_index_native7(), import_popper = require_index_native59(), import_portal2 = require_index_native30(), import_remove_scroll = require_index_native36(), import_scroll_view = require_index_native37(), import_sheet = require_index_native38(), import_stacks3 = require_index_native24(), import_use_controllable_state = require_index_native10(), import_z_index_stack2 = require_index_native29(), React4 = __toESM2(require("react")), import_useFloatingContext = require_useFloatingContext_native(), needsRepropagation = import_constants4.isAndroid || import_constants4.isIos && !import_portal2.USE_NATIVE_PORTAL, POPOVER_SCOPE = "PopoverScope", PopoverContext = (0, import_core12.createStyledContext)({}), usePopoverContext = PopoverContext.useStyledContext, PopoverAnchor = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24915
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
24848
24916
  return React4.useEffect(function() {
24849
24917
  return onCustomAnchorAdd(), function() {
24850
24918
  return onCustomAnchorRemove();
@@ -24858,7 +24926,7 @@ var require_Popover_native = __commonJS({
24858
24926
  ref: forwardedRef
24859
24927
  });
24860
24928
  }), PopoverTrigger = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24861
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
24929
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
24862
24930
  if (!props.children) return null;
24863
24931
  var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
24864
24932
  "aria-expanded": context.open,
@@ -24902,7 +24970,7 @@ var require_Popover_native = __commonJS({
24902
24970
  children: trigger
24903
24971
  });
24904
24972
  }), PopoverContent = import_popper.PopperContentFrame.extractable(/* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24905
- var { trapFocus, enableRemoveScroll = !1, zIndex, __scopePopover, ...contentImplProps } = props, context = usePopoverContext(__scopePopover), contentRef = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), isRightClickOutsideRef = React4.useRef(!1), [isFullyHidden, setIsFullyHidden] = React4.useState(!context.open);
24973
+ var { trapFocus, enableRemoveScroll = !1, zIndex, __scopePopover, ...contentImplProps } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), contentRef = React4.useRef(null), composedRefs = (0, import_compose_refs.useComposedRefs)(forwardedRef, contentRef), isRightClickOutsideRef = React4.useRef(!1), [isFullyHidden, setIsFullyHidden] = React4.useState(!context.open);
24906
24974
  if (context.open && isFullyHidden && setIsFullyHidden(!1), React4.useEffect(function() {
24907
24975
  if (context.open) {
24908
24976
  var content = contentRef.current;
@@ -24912,17 +24980,19 @@ var require_Popover_native = __commonJS({
24912
24980
  context.open
24913
24981
  ]), !context.keepChildrenMounted && isFullyHidden) return null;
24914
24982
  var _contentImplProps_pointerEvents;
24915
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentPortal, {
24916
- __scopePopover,
24983
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverPortal, {
24984
+ passThrough: context.breakpointActive,
24985
+ __scopePopover: __scopePopover || POPOVER_SCOPE,
24917
24986
  zIndex,
24918
24987
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
24988
+ passThrough: context.breakpointActive,
24919
24989
  pointerEvents: context.open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : "auto" : "none",
24920
24990
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentImpl, {
24921
24991
  ...contentImplProps,
24922
24992
  enableRemoveScroll,
24923
24993
  ref: composedRefs,
24924
24994
  setIsFullyHidden,
24925
- __scopePopover,
24995
+ __scopePopover: __scopePopover || POPOVER_SCOPE,
24926
24996
  // we make sure we're not trapping once it's been closed
24927
24997
  // (closed !== unmounted when animating out)
24928
24998
  trapFocus: trapFocus ?? context.open,
@@ -24947,55 +25017,76 @@ var require_Popover_native = __commonJS({
24947
25017
  })
24948
25018
  })
24949
25019
  });
24950
- }));
24951
- function PopoverRepropagateContext(props) {
24952
- var popperContext = (0, import_popper.usePopperContext)(props.scope || POPOVER_SCOPE);
25020
+ })), useParentContexts = function(scope) {
25021
+ var popperContext = (0, import_popper.usePopperContext)(scope || POPOVER_SCOPE), adaptContext = (0, import_adapt.useAdaptContext)(), context = usePopoverContext(scope || POPOVER_SCOPE);
25022
+ return {
25023
+ popperContext,
25024
+ adaptContext,
25025
+ context
25026
+ };
25027
+ };
25028
+ function RepropagateParentContexts(param) {
25029
+ var { adaptContext, children, context, popperContext, scope } = param;
24953
25030
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
24954
- scope: props.scope,
25031
+ scope,
24955
25032
  ...popperContext,
24956
25033
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
24957
- ...props.context,
25034
+ ...context,
24958
25035
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.ProvideAdaptContext, {
24959
- ...props.adaptContext,
24960
- children: props.children
25036
+ ...adaptContext,
25037
+ children
24961
25038
  })
24962
25039
  })
24963
25040
  });
24964
25041
  }
24965
- function PopoverContentPortal(props) {
24966
- var { __scopePopover } = props, zIndex = props.zIndex, context = usePopoverContext(__scopePopover), themeName = (0, import_core12.useThemeName)(), adaptContext = (0, import_adapt.useAdaptContext)(), contents = props.children, isPopover = !context.breakpointActive, isSheet = context.breakpointActive;
24967
- return needsRepropagation && (contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverRepropagateContext, {
24968
- scope: __scopePopover || POPOVER_SCOPE,
24969
- context,
24970
- adaptContext,
24971
- zIndex,
24972
- children: props.children
24973
- })), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
25042
+ var PortalAdaptSafe = function(param) {
25043
+ var { children, __scopePopover } = param;
25044
+ if (needsRepropagation) {
25045
+ var scope = __scopePopover || POPOVER_SCOPE, parentContexts = useParentContexts(scope);
25046
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
25047
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
25048
+ scope,
25049
+ ...parentContexts,
25050
+ children
25051
+ })
25052
+ });
25053
+ }
25054
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
25055
+ children
25056
+ });
25057
+ };
25058
+ function PopoverPortal(props) {
25059
+ var scope = props.__scopePopover || POPOVER_SCOPE, zIndex = props.zIndex, themeName = (0, import_core12.useThemeName)(), content = props.children;
25060
+ if (needsRepropagation) {
25061
+ var parentContexts = useParentContexts(scope);
25062
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
25063
+ scope,
25064
+ ...parentContexts,
25065
+ children: content
25066
+ });
25067
+ }
25068
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
25069
+ passThrough: props.passThrough,
24974
25070
  stackZIndex: !0,
24975
25071
  zIndex,
24976
25072
  children: (
24977
25073
  /* forceClassName avoids forced re-mount renders for some reason... see the HeadMenu as you change tints a few times */
24978
25074
  /* without this you'll see the site menu re-rendering. It must be something in wrapping children in Theme */
24979
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core12.Theme, {
24980
- passThrough: isPopover,
25075
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
25076
+ passThrough: props.passThrough,
25077
+ contain: !0,
24981
25078
  forceClassName: !0,
24982
25079
  name: themeName,
24983
- children: [
24984
- !!context.open && isSheet && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
24985
- fullscreen: !0,
24986
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
24987
- }),
24988
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
24989
- zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
24990
- children: contents
24991
- })
24992
- ]
25080
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
25081
+ zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
25082
+ children: content
25083
+ })
24993
25084
  })
24994
25085
  )
24995
25086
  });
24996
25087
  }
24997
25088
  var PopoverContentImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24998
- var { trapFocus, __scopePopover, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, ...contentProps } = props, context = usePopoverContext(__scopePopover), { open, keepChildrenMounted } = context, handleExitComplete = React4.useCallback(function() {
25089
+ var { trapFocus, __scopePopover, onOpenAutoFocus, onCloseAutoFocus, disableOutsidePointerEvents, disableFocusScope, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, children, enableRemoveScroll, freezeContentsWhenHidden, setIsFullyHidden, lazyMount, ...contentProps } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), { open, keepChildrenMounted } = context, handleExitComplete = React4.useCallback(function() {
24999
25090
  setIsFullyHidden == null || setIsFullyHidden(!0);
25000
25091
  }, [
25001
25092
  setIsFullyHidden
@@ -25003,42 +25094,27 @@ var require_Popover_native = __commonJS({
25003
25094
  disable: context.breakpointActive,
25004
25095
  children
25005
25096
  });
25006
- return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagatePopperAdapt, {
25007
- __scopePopover: __scopePopover || POPOVER_SCOPE,
25008
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
25009
- type: "presence",
25010
- present: !!open,
25011
- keepChildrenMounted: !!keepChildrenMounted,
25012
- onExitComplete: handleExitComplete,
25013
- lazyMount,
25097
+ return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
25098
+ type: "presence",
25099
+ present: !!open,
25100
+ keepChildrenMounted: !!keepChildrenMounted,
25101
+ onExitComplete: handleExitComplete,
25102
+ lazyMount,
25103
+ passThrough: context.breakpointActive,
25104
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, {
25105
+ __scopePopper: __scopePopover || POPOVER_SCOPE,
25106
+ "data-state": getState(open),
25107
+ id: context.contentId,
25108
+ ref: forwardedRef,
25014
25109
  passThrough: context.breakpointActive,
25015
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, {
25016
- __scopePopper: __scopePopover || POPOVER_SCOPE,
25017
- "data-state": getState(open),
25018
- id: context.contentId,
25019
- ref: forwardedRef,
25020
- passThrough: context.breakpointActive,
25021
- ...contentProps,
25110
+ ...contentProps,
25111
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalAdaptSafe, {
25022
25112
  children: contents
25023
- }, context.contentId)
25024
- })
25025
- });
25026
- }), RepropagatePopperAdapt = function(param) {
25027
- var { children, __scopePopover } = param;
25028
- if (needsRepropagation) {
25029
- var popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE);
25030
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
25031
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
25032
- ...popperContext,
25033
- children
25034
25113
  })
25035
- });
25036
- }
25037
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
25038
- children
25114
+ }, context.contentId)
25039
25115
  });
25040
- }, PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
25041
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover);
25116
+ }), PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
25117
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE);
25042
25118
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
25043
25119
  ...rest,
25044
25120
  ref: forwardedRef,
@@ -25058,7 +25134,14 @@ var require_Popover_native = __commonJS({
25058
25134
  });
25059
25135
  }), PopoverScrollView = /* @__PURE__ */ React4.forwardRef(function(props, ref) {
25060
25136
  var context = usePopoverContext(POPOVER_SCOPE);
25061
- return props.children;
25137
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
25138
+ ref,
25139
+ // when adapted, no pointer events!
25140
+ pointerEvents: context.breakpointActive ? "none" : void 0,
25141
+ scrollEnabled: !context.breakpointActive,
25142
+ passThrough: context.breakpointActive,
25143
+ ...props
25144
+ });
25062
25145
  }), Popover = (0, import_helpers.withStaticProperties)(/* @__PURE__ */ React4.forwardRef(function(props, ref) {
25063
25146
  var id = React4.useId();
25064
25147
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptParent, {
@@ -25138,7 +25221,7 @@ var require_Popover_native = __commonJS({
25138
25221
  keepChildrenMounted
25139
25222
  }, memoizedChildren = React4.useMemo(function() {
25140
25223
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
25141
- scope: __scopePopover,
25224
+ scope: __scopePopover || POPOVER_SCOPE,
25142
25225
  ...popoverContext,
25143
25226
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverSheetController, {
25144
25227
  onOpenChange: setOpen,
@@ -25146,6 +25229,7 @@ var require_Popover_native = __commonJS({
25146
25229
  })
25147
25230
  });
25148
25231
  }, [
25232
+ __scopePopover,
25149
25233
  setOpen,
25150
25234
  children,
25151
25235
  ...Object.values(popoverContext)
@@ -25168,7 +25252,7 @@ var require_Popover_native = __commonJS({
25168
25252
  return open ? "open" : "closed";
25169
25253
  }
25170
25254
  var PopoverSheetController = function(param) {
25171
- var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
25255
+ var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
25172
25256
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_sheet.SheetController, {
25173
25257
  onOpenChange: function(val) {
25174
25258
  if (getShowSheet()) {