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.
@@ -7465,10 +7465,7 @@ var require_Theme_native = __commonJS({
7465
7465
  }
7466
7466
  });
7467
7467
  module2.exports = __toCommonJS2(Theme_exports);
7468
- 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 = {
7469
- className: "",
7470
- style: {}
7471
- }, Theme2 = /* @__PURE__ */ (0, import_react3.forwardRef)(function(props, ref) {
7468
+ 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) {
7472
7469
  if (props.disable) return props.children;
7473
7470
  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) {
7474
7471
  return passThrough ? child : /* @__PURE__ */ (0, import_react3.cloneElement)(child, {
@@ -7509,14 +7506,18 @@ var require_Theme_native = __commonJS({
7509
7506
  }
7510
7507
  if (forceClassName === !1) return children;
7511
7508
  if (import_constants4.isWeb) {
7512
- var { className = "", style } = passThrough ? {} : getThemeClassNameAndStyle(themeState, props, isRoot);
7509
+ var baseStyle = props.contain ? inertContainedStyle : inertStyle, { className = "", color } = passThrough ? {} : getThemeClassNameAndColor(themeState, props, isRoot);
7513
7510
  if (children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7514
- className: `${className} _dsp_contents is_Theme`,
7515
- style: passThrough ? void 0 : style,
7511
+ className: `${className} is_Theme`,
7512
+ style: passThrough ? baseStyle : {
7513
+ color,
7514
+ ...baseStyle
7515
+ },
7516
7516
  children
7517
7517
  }), state.hasEverThemed === "wrapped") {
7518
- var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} _dsp_contents` : "_dsp_contents";
7518
+ var className1 = !passThrough && requiresExtraWrapper ? `${isInverse ? name.startsWith("light") ? "t_light is_inversed" : name.startsWith("dark") ? "t_dark is_inversed" : "" : ""} ` : "";
7519
7519
  children = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("span", {
7520
+ style: baseStyle,
7520
7521
  className: className1,
7521
7522
  children
7522
7523
  });
@@ -7525,14 +7526,21 @@ var require_Theme_native = __commonJS({
7525
7526
  }
7526
7527
  return children;
7527
7528
  }
7528
- function getThemeClassNameAndStyle(themeState, props) {
7529
+ var inertStyle = {
7530
+ display: "contents"
7531
+ }, inertContainedStyle = {
7532
+ display: "contents",
7533
+ contain: "strict"
7534
+ }, empty = {
7535
+ className: "",
7536
+ color: void 0
7537
+ };
7538
+ function getThemeClassNameAndColor(themeState, props) {
7529
7539
  var isRoot = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : !1;
7530
7540
  if (!themeState.isNew && !props.forceClassName) return empty;
7531
- var themeColor = themeState != null && themeState.theme && themeState.isNew ? (0, import_createVariable.variableToString)(themeState.theme.color) : "", style = themeColor ? {
7532
- color: themeColor
7533
- } : 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}`;
7541
+ 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}`;
7534
7542
  return {
7535
- style,
7543
+ color: themeColor,
7536
7544
  className
7537
7545
  };
7538
7546
  }
@@ -8532,12 +8540,13 @@ var require_createComponent_native = __commonJS({
8532
8540
  onPress,
8533
8541
  onLongPress
8534
8542
  });
8535
- var useChildrenResult;
8536
- import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), splitStyles || (elementType = "span", content = propsIn.children, viewProps = {
8543
+ splitStyles || (content = propsIn.children, elementType = BaseViewComponent, viewProps = {
8537
8544
  style: {
8538
8545
  display: "contents"
8539
8546
  }
8540
- }), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
8547
+ });
8548
+ var useChildrenResult;
8549
+ import_setupHooks.hooks.useChildren && (useChildrenResult = import_setupHooks.hooks.useChildren(elementType, content, viewProps)), useChildrenResult ? content = useChildrenResult : content = /* @__PURE__ */ import_react3.default.createElement(elementType, viewProps, content);
8541
8550
  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
8542
8551
  (!asChild && // not when passThrough
8543
8552
  splitStyles && // not when HOC
@@ -12847,7 +12856,6 @@ var require_index_native19 = __commonJS({
12847
12856
  return cb();
12848
12857
  }), queuedUpdates.clear()));
12849
12858
  }
12850
- var expectedFrameTime = 16.67, numDroppedFramesUntilPause = 10;
12851
12859
  function startGlobalIntersectionObserver() {
12852
12860
  !import_constants4.isClient || globalIntersectionObserver || (globalIntersectionObserver = new IntersectionObserver(function(entries) {
12853
12861
  entries.forEach(function(entry) {
@@ -12860,21 +12868,19 @@ var require_index_native19 = __commonJS({
12860
12868
  }
12861
12869
  if (import_constants4.isClient && rAF) {
12862
12870
  layoutOnAnimationFrame = function() {
12863
- var now = Date.now(), timeSinceLastFrame = now - lastFrameAt;
12864
- if (lastFrameAt = now, frameCount++, frameCount % RUN_EVERY_X_FRAMES === 0) {
12865
- frameCount = 0, rAF(layoutOnAnimationFrame);
12866
- return;
12867
- }
12868
12871
  if (strategy !== "off") {
12869
- var hasRecentSyncWork = timeSinceLastFrame > expectedFrameTime * numDroppedFramesUntilPause;
12870
- hasRecentSyncWork || Nodes.forEach(function(node) {
12871
- updateLayoutIfChanged(node, lastFrameAt);
12872
+ if (frameCount++ % RUN_EVERY_X_FRAMES !== 0) {
12873
+ rAF(layoutOnAnimationFrame);
12874
+ return;
12875
+ }
12876
+ frameCount === Number.MAX_SAFE_INTEGER && (frameCount = 0), Nodes.forEach(function(node) {
12877
+ updateLayoutIfChanged(node);
12872
12878
  });
12873
12879
  }
12874
12880
  rAF(layoutOnAnimationFrame);
12875
- }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body, lastFrameAt = Date.now();
12876
- async function updateLayoutIfChanged(node, frameId) {
12877
- if (!(supportsCheckVisibility && !node.checkVisibility()) && IntersectionState.get(node) !== !1) {
12881
+ }, layoutOnAnimationFrame2 = layoutOnAnimationFrame, supportsCheckVisibility = "checkVisibility" in document.body;
12882
+ async function updateLayoutIfChanged(node) {
12883
+ if (IntersectionState.get(node) !== !1 && !(process.env.TAMAGUI_ONLAYOUT_VISIBILITY_CHECK === "1" && supportsCheckVisibility && !node.checkVisibility())) {
12878
12884
  var onLayout = LayoutHandlers.get(node);
12879
12885
  if (typeof onLayout == "function") {
12880
12886
  var parentNode = node.parentElement;
@@ -12885,7 +12891,7 @@ var require_index_native19 = __commonJS({
12885
12891
  getBoundingClientRectAsync(node),
12886
12892
  getBoundingClientRectAsync(parentNode)
12887
12893
  ]);
12888
- if (nr === !1 || pr === !1 || frameId !== lastFrameAt) return;
12894
+ if (nr === !1 || pr === !1) return;
12889
12895
  nodeRect = nr, parentRect = pr;
12890
12896
  } else nodeRect = node.getBoundingClientRect(), parentRect = parentNode.getBoundingClientRect();
12891
12897
  var cachedRect = NodeRectCache.get(node), cachedParentRect = NodeRectCache.get(parentNode);
@@ -12903,9 +12909,9 @@ var require_index_native19 = __commonJS({
12903
12909
  }
12904
12910
  }
12905
12911
  }
12906
- rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 4;
12912
+ rAF(layoutOnAnimationFrame), frameCount = 0, RUN_EVERY_X_FRAMES = 8;
12907
12913
  }
12908
- var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, lastFrameAt, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
12914
+ var layoutOnAnimationFrame, layoutOnAnimationFrame2, supportsCheckVisibility, frameCount, RUN_EVERY_X_FRAMES, getElementLayoutEvent = function(nodeRect, parentRect) {
12909
12915
  return {
12910
12916
  nativeEvent: {
12911
12917
  layout: getRelativeDimensions(nodeRect, parentRect),
@@ -12970,7 +12976,7 @@ var require_index_native19 = __commonJS({
12970
12976
  if (onLayout) {
12971
12977
  var node2 = (_ref_current2 = ref.current) === null || _ref_current2 === void 0 ? void 0 : _ref_current2.host;
12972
12978
  if (node2) {
12973
- LayoutHandlers.set(node2, onLayout), Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
12979
+ Nodes.add(node2), startGlobalIntersectionObserver(), globalIntersectionObserver && (globalIntersectionObserver.observe(node2), IntersectionState.set(node2, !0));
12974
12980
  var parentNode = node2.parentNode;
12975
12981
  return parentNode && onLayout(getElementLayoutEvent(node2.getBoundingClientRect(), parentNode.getBoundingClientRect())), function() {
12976
12982
  Nodes.delete(node2), LayoutHandlers.delete(node2), NodeRectCache.delete(node2), LastChangeTime.delete(node2), IntersectionState.delete(node2), globalIntersectionObserver && globalIntersectionObserver.unobserve(node2);
@@ -16242,7 +16248,7 @@ var require_Portal_native = __commonJS({
16242
16248
  }
16243
16249
  });
16244
16250
  module2.exports = __toCommonJS2(Portal_native_exports);
16245
- 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() {
16251
+ 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() {
16246
16252
  if (import_constants4.IS_FABRIC) try {
16247
16253
  var _ReactFabricShimModule_default, ReactFabricShimModule = require_fake_react_native(), _ReactFabricShimModule_default_createPortal;
16248
16254
  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;
@@ -16256,15 +16262,17 @@ var require_Portal_native = __commonJS({
16256
16262
  return console.info("Note: error importing portal, defaulting to non-native portals", err), null;
16257
16263
  }
16258
16264
  }(), Portal = function(propsIn) {
16259
- 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, {
16265
+ 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, {
16260
16266
  pointerEvents: "box-none",
16261
- fullscreen: !0,
16262
16267
  position: "absolute",
16268
+ inset: 0,
16263
16269
  maxWidth: "100%",
16264
- ...props,
16265
- zIndex
16270
+ zIndex,
16271
+ passThrough,
16272
+ children
16266
16273
  });
16267
16274
  return !createPortal || !import_constants4.USE_NATIVE_PORTAL || !rootTag ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_GorhomPortalItem.GorhomPortalItem, {
16275
+ passThrough,
16268
16276
  hostName: "root",
16269
16277
  children: contents
16270
16278
  }) : createPortal(contents, rootTag);
@@ -17225,11 +17233,15 @@ var require_RemoveScroll_native = __commonJS({
17225
17233
  __export2(RemoveScroll_native_exports, {
17226
17234
  RemoveScroll: function() {
17227
17235
  return RemoveScroll;
17236
+ },
17237
+ getAllowedScrollableNode: function() {
17238
+ return getAllowedScrollableNode;
17228
17239
  }
17229
17240
  });
17230
17241
  module2.exports = __toCommonJS2(RemoveScroll_native_exports);
17231
17242
  var RemoveScroll = function(props) {
17232
17243
  return props.children;
17244
+ }, getAllowedScrollableNode = function() {
17233
17245
  };
17234
17246
  }
17235
17247
  });
@@ -17502,11 +17514,11 @@ var require_useSheetOpenState_native = __commonJS({
17502
17514
  var { isHidden, controller } = (0, import_useSheetController.useSheetController)(), onOpenChangeInternal = function(val) {
17503
17515
  var _controller_onOpenChange, _props_onOpenChange;
17504
17516
  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);
17505
- }, _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)({
17517
+ }, _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)({
17506
17518
  prop: propVal,
17507
17519
  defaultProp: (_props_defaultOpen = props.defaultOpen) !== null && _props_defaultOpen !== void 0 ? _props_defaultOpen : !1,
17508
17520
  onChange: onOpenChangeInternal,
17509
- strategy: "prop-wins"
17521
+ strategy: "most-recent-wins"
17510
17522
  });
17511
17523
  return {
17512
17524
  open,
@@ -17593,7 +17605,7 @@ var require_useSheetProviderProps_native = __commonJS({
17593
17605
  prop: props.position,
17594
17606
  defaultProp: props.defaultPosition || (state.open ? 0 : -1),
17595
17607
  onChange: props.onPositionChange,
17596
- strategy: "prop-wins"
17608
+ strategy: "most-recent-wins"
17597
17609
  }), position = state.open === !1 ? -1 : position_, { open } = state, setPosition = import_react3.default.useCallback(function(next) {
17598
17610
  props.dismissOnSnapToBottom && next === snapPoints.length - 1 ? state.setOpen(!1) : setPositionImmediate(next);
17599
17611
  }, [
@@ -17613,7 +17625,7 @@ var require_useSheetProviderProps_native = __commonJS({
17613
17625
  var { animationDriver } = (0, import_core12.useConfiguration)();
17614
17626
  if (!animationDriver) throw new Error("Must set animations in tamagui.config.ts");
17615
17627
  var scrollBridge = (0, import_use_constant.useConstant)(function() {
17616
- return {
17628
+ var parentDragListeners = /* @__PURE__ */ new Set(), bridge = {
17617
17629
  enabled: !1,
17618
17630
  y: 0,
17619
17631
  paneY: 0,
@@ -17623,8 +17635,20 @@ var require_useSheetProviderProps_native = __commonJS({
17623
17635
  },
17624
17636
  release: function() {
17625
17637
  },
17626
- scrollLock: !1
17638
+ scrollLock: !1,
17639
+ isParentDragging: !1,
17640
+ onParentDragging: function(cb) {
17641
+ return parentDragListeners.add(cb), function() {
17642
+ parentDragListeners.delete(cb);
17643
+ };
17644
+ },
17645
+ setParentDragging: function(val) {
17646
+ val !== bridge.isParentDragging && (bridge.isParentDragging = val, parentDragListeners.forEach(function(cb) {
17647
+ return cb(val);
17648
+ }));
17649
+ }
17627
17650
  };
17651
+ return bridge;
17628
17652
  }), _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 = {
17629
17653
  screenSize,
17630
17654
  maxSnapPoint,
@@ -17729,7 +17753,6 @@ var require_nativeSheet_native = __commonJS({
17729
17753
  }
17730
17754
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
17731
17755
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
17732
- scrollEnabled: !0,
17733
17756
  setHasScrollView: emptyFn,
17734
17757
  ...providerProps,
17735
17758
  onlyShowFrame: !0,
@@ -18022,9 +18045,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18022
18045
  isAbleToPosition,
18023
18046
  position
18024
18047
  ]);
18025
- 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) {
18026
- scrollEnabled.current = val;
18027
- }, []), panResponder = import_react3.default.useMemo(function() {
18048
+ 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() {
18028
18049
  if (disableDrag || !frameSize || isShowingInnerSheet) return;
18029
18050
  var minY = positions[0];
18030
18051
  scrollBridge.paneMinY = minY;
@@ -18034,13 +18055,13 @@ var require_SheetImplementationCustom_native = __commonJS({
18034
18055
  }
18035
18056
  var release = function(param) {
18036
18057
  var { vy, dragAt } = param;
18037
- if (!scrollBridge.scrollLock) {
18058
+ if (scrollBridge.setParentDragging(!1), !scrollBridge.scrollLock) {
18038
18059
  isExternalDrag = !1, previouslyScrolling = !1, setPanning(!1);
18039
18060
  for (var at2 = dragAt + startY, end = at2 + frameSize * vy * 0.2, closestPoint = 0, dist = Number.POSITIVE_INFINITY, i = 0; i < positions.length; i++) {
18040
18061
  var position2 = positions[i], curDist = end > position2 ? end - position2 : position2 - end;
18041
18062
  curDist < dist && (dist = curDist, closestPoint = i);
18042
18063
  }
18043
- setPosition(closestPoint), animateTo(closestPoint), setScrollEnabled(closestPoint === 0);
18064
+ setPosition(closestPoint), animateTo(closestPoint);
18044
18065
  }
18045
18066
  }, finish = function(_e, state2) {
18046
18067
  release({
@@ -18053,11 +18074,12 @@ var require_SheetImplementationCustom_native = __commonJS({
18053
18074
  if (e.target === providerProps.handleRef.current) return !0;
18054
18075
  if (scrollBridge.scrollLock) return !1;
18055
18076
  var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
18056
- return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 10;
18077
+ return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
18057
18078
  }
18058
- return getShouldSet();
18079
+ var granted = getShouldSet();
18080
+ return granted && scrollBridge.setParentDragging(!0), granted;
18059
18081
  }, grant = function() {
18060
- setScrollEnabled(!1), setPanning(!0), stopSpring(), startY = at.current;
18082
+ setPanning(!0), stopSpring(), startY = at.current;
18061
18083
  }, isExternalDrag = !1;
18062
18084
  return scrollBridge.drag = function(dy) {
18063
18085
  isExternalDrag || (isExternalDrag = !0, grant());
@@ -18069,8 +18091,8 @@ var require_SheetImplementationCustom_native = __commonJS({
18069
18091
  onMoveShouldSetPanResponder: onMoveShouldSet,
18070
18092
  onPanResponderGrant: grant,
18071
18093
  onPanResponderMove: function(_e, param) {
18072
- var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY);
18073
- animatedNumber.setValue(to, {
18094
+ var { dy } = param, toFull = dy + startY, to = (0, import_helpers.resisted)(toFull, minY), isAtTop = to <= minY;
18095
+ isAtTop ? scrollBridge.setParentDragging(!1) : scrollBridge.setParentDragging(!0), animatedNumber.setValue(to, {
18074
18096
  type: "direct"
18075
18097
  });
18076
18098
  },
@@ -18144,7 +18166,6 @@ var require_SheetImplementationCustom_native = __commonJS({
18144
18166
  value: nextParentContext,
18145
18167
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_SheetContext.SheetProvider, {
18146
18168
  ...providerProps,
18147
- scrollEnabled: scrollEnabled.current,
18148
18169
  setHasScrollView,
18149
18170
  children: [
18150
18171
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
@@ -18213,6 +18234,7 @@ var require_SheetImplementationCustom_native = __commonJS({
18213
18234
  ...portalProps,
18214
18235
  children: shouldMountChildren && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ContainerComponent, {
18215
18236
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
18237
+ contain: !0,
18216
18238
  forceClassName: !0,
18217
18239
  name: themeName,
18218
18240
  children: contents
@@ -18400,93 +18422,139 @@ var require_SheetScrollView_native = __commonJS({
18400
18422
  }
18401
18423
  });
18402
18424
  module2.exports = __toCommonJS2(SheetScrollView_exports);
18403
- 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) {
18404
- 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)({
18405
- prop: scrollEnabledProp,
18406
- defaultProp: !0
18407
- }), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
18408
- var _scrollRef_current_setNativeProps, _scrollRef_current;
18409
- (_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, {
18410
- scrollEnabled: next
18411
- }), setScrollEnabled_(next);
18412
- }, state = import_react3.default.useRef({
18413
- lastPageY: 0,
18414
- dragAt: 0,
18415
- dys: [],
18416
- // store a few recent dys to get velocity on release
18417
- isScrolling: !1,
18418
- isDragging: !1
18419
- });
18420
- (0, import_react3.useEffect)(function() {
18421
- return setHasScrollView(!0), function() {
18422
- setHasScrollView(!1);
18423
- };
18424
- }, []);
18425
- var release = function() {
18426
- if (state.current.isDragging) {
18427
- state.current.isDragging = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
18428
- var vy = 0;
18429
- if (state.current.dys.length) {
18430
- var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
18431
- return a + b;
18432
- }, 0) : 0, avgDy = dist / recentDys.length;
18433
- vy = avgDy * 0.04;
18434
- }
18435
- state.current.dys = [], scrollBridge.release({
18436
- dragAt: state.current.dragAt,
18437
- vy
18438
- });
18439
- }
18440
- }, scrollable = scrollEnabled ?? scrollEnabled_;
18441
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
18442
- ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
18443
- flex: 1,
18444
- scrollEventThrottle: 8,
18445
- onResponderRelease: release,
18446
- className: "_ovs-contain",
18447
- scrollEnabled: scrollable,
18448
- // {...(Platform.OS === 'android' && {
18449
- // pointerEvents: scrollable ? undefined : 'none',
18450
- // })}
18451
- onScroll: function(e) {
18452
- var { y } = e.nativeEvent.contentOffset;
18453
- scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
18454
- },
18455
- // This assures that we do not skip the "scrollBridge" values processing
18456
- // when passing this prop into a <Sheet.ScrollView /> overriding it here
18457
- // Useful when using this ScrollView with lists such as "FlashList", i.e.
18458
- // ```
18459
- // renderScrollComponent={Sheet.ScrollView}
18460
- // ```
18461
- onStartShouldSetResponder: function() {
18462
- return scrollBridge.scrollStartY = -1, state.current.isDragging = !0, scrollable;
18463
- },
18464
- // setting to false while onResponderMove is disabled
18465
- onMoveShouldSetResponder: function(e) {
18466
- return scrollable;
18467
- },
18468
- contentContainerStyle: {
18469
- minHeight: "100%"
18470
- },
18471
- onResponderMove: function(e) {
18472
- if (import_core12.isWeb) {
18473
- var { pageY } = e.nativeEvent;
18474
- if (state.current.isScrolling) return;
18475
- scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
18476
- var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
18477
- state.current.lastPageY = pageY;
18478
- var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = (dy === 0 || isDraggingUp) && isPaneAtTop;
18479
- if (shouldScrollLock) {
18480
- state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
18481
- return;
18425
+ 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(
18426
+ // we disallow customizing it because we want to let people know it doens't work well with out measuring of inner content
18427
+ // height using a view
18428
+ function(param, ref) {
18429
+ 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)({
18430
+ prop: scrollEnabledProp,
18431
+ defaultProp: !0
18432
+ }), scrollRef = import_react3.default.useRef(null), setScrollEnabled = function(next) {
18433
+ var _scrollRef_current_setNativeProps, _scrollRef_current;
18434
+ (_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, {
18435
+ scrollEnabled: next
18436
+ }), setScrollEnabled_(next);
18437
+ }, state = import_react3.default.useRef({
18438
+ lastPageY: 0,
18439
+ dragAt: 0,
18440
+ dys: [],
18441
+ // store a few recent dys to get velocity on release
18442
+ isScrolling: !1,
18443
+ isDraggingScrollArea: !1
18444
+ });
18445
+ (0, import_react3.useEffect)(function() {
18446
+ return setHasScrollView(!0), function() {
18447
+ setHasScrollView(!1);
18448
+ };
18449
+ }, []);
18450
+ var release = function() {
18451
+ if (state.current.isDraggingScrollArea) {
18452
+ state.current.isDraggingScrollArea = !1, scrollBridge.scrollStartY = -1, scrollBridge.scrollLock = !1, state.current.isScrolling = !1, setScrollEnabled(!0);
18453
+ var vy = 0;
18454
+ if (state.current.dys.length) {
18455
+ var recentDys = state.current.dys.slice(-10), dist = recentDys.length ? recentDys.reduce(function(a, b) {
18456
+ return a + b;
18457
+ }, 0) : 0, avgDy = dist / recentDys.length;
18458
+ vy = avgDy * 0.04;
18482
18459
  }
18483
- 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));
18460
+ state.current.dys = [], scrollBridge.release({
18461
+ dragAt: state.current.dragAt,
18462
+ vy
18463
+ });
18484
18464
  }
18485
- },
18486
- ...props,
18487
- children
18488
- });
18489
- });
18465
+ }, scrollable = scrollEnabled;
18466
+ (0, import_react3.useEffect)(function() {
18467
+ if (import_core12.isClient && scrollRef.current) {
18468
+ var controller = new AbortController(), node = scrollRef.current.getScrollableNode();
18469
+ node.addEventListener(
18470
+ "touchmove",
18471
+ function(e) {
18472
+ scrollBridge.isParentDragging && node.scrollTo({
18473
+ top: scrollBridge.y,
18474
+ behavior: "instant"
18475
+ });
18476
+ },
18477
+ // can't preventdefault its not cancellable
18478
+ {
18479
+ signal: controller.signal,
18480
+ passive: !1
18481
+ }
18482
+ );
18483
+ var disposeBridgeListen = scrollBridge.onParentDragging(function(val) {
18484
+ });
18485
+ return function() {
18486
+ disposeBridgeListen(), controller.abort();
18487
+ };
18488
+ }
18489
+ }, []);
18490
+ var [hasScrollableContent, setHasScrollableContent] = (0, import_react3.useState)(!0), parentHeight = (0, import_react3.useRef)(0), contentHeight = (0, import_react3.useRef)(0), setIsScrollable = function() {
18491
+ parentHeight.current && contentHeight.current && setHasScrollableContent(contentHeight.current > parentHeight.current);
18492
+ };
18493
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_scroll_view.ScrollView, {
18494
+ onLayout: function(e) {
18495
+ parentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
18496
+ },
18497
+ ref: (0, import_compose_refs.composeRefs)(scrollRef, ref),
18498
+ flex: 1,
18499
+ scrollEventThrottle: 8,
18500
+ onResponderRelease: release,
18501
+ className: "_ovs-contain",
18502
+ scrollEnabled: scrollable,
18503
+ // {...(Platform.OS === 'android' && {
18504
+ // pointerEvents: scrollable ? undefined : 'none',
18505
+ // })}
18506
+ onScroll: function(e) {
18507
+ var { y } = e.nativeEvent.contentOffset;
18508
+ scrollBridge.y = y, import_core12.isWeb && (scrollBridge.scrollLock = y > 0), y > 0 && (scrollBridge.scrollStartY = -1), onScroll == null || onScroll(e);
18509
+ },
18510
+ // This assures that we do not skip the "scrollBridge" values processing
18511
+ // when passing this prop into a <Sheet.ScrollView /> overriding it here
18512
+ // Useful when using this ScrollView with lists such as "FlashList", i.e.
18513
+ // ```
18514
+ // renderScrollComponent={Sheet.ScrollView}
18515
+ // ```
18516
+ onStartShouldSetResponder: function() {
18517
+ return scrollBridge.scrollStartY = -1, state.current.isDraggingScrollArea = !0, scrollable;
18518
+ },
18519
+ // setting to false while onResponderMove is disabled
18520
+ onMoveShouldSetResponder: function(e) {
18521
+ return scrollable;
18522
+ },
18523
+ contentContainerStyle: {
18524
+ minHeight: "100%"
18525
+ },
18526
+ onResponderMove: function(e) {
18527
+ if (import_core12.isWeb) {
18528
+ var { pageY } = e.nativeEvent;
18529
+ state.current.isScrolling || scrollBridge.scrollStartY === -1 && (scrollBridge.scrollStartY = pageY, state.current.lastPageY = pageY);
18530
+ var dragAt = pageY - scrollBridge.scrollStartY, dy = pageY - state.current.lastPageY;
18531
+ state.current.lastPageY = pageY;
18532
+ var isDraggingUp = dy < 0, isPaneAtTop = scrollBridge.paneY <= scrollBridge.paneMinY, shouldScrollLock = hasScrollableContent && (dy === 0 || isDraggingUp) && isPaneAtTop;
18533
+ if (shouldScrollLock && !state.current.isScrolling) {
18534
+ state.current.isScrolling = !0, scrollBridge.scrollLock = !0, setScrollEnabled(!0);
18535
+ return;
18536
+ }
18537
+ if (scrollBridge.y >= 0) return;
18538
+ 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));
18539
+ }
18540
+ },
18541
+ ...props,
18542
+ children: [
18543
+ /* content height measurer */
18544
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
18545
+ position: "absolute",
18546
+ inset: 0,
18547
+ pointerEvents: "none",
18548
+ zIndex: -1,
18549
+ onLayout: function(e) {
18550
+ contentHeight.current = e.nativeEvent.layout.height, setIsScrollable();
18551
+ }
18552
+ }),
18553
+ children
18554
+ ]
18555
+ });
18556
+ }
18557
+ );
18490
18558
  }
18491
18559
  });
18492
18560
 
@@ -23387,6 +23455,7 @@ var require_Animate_native = __commonJS({
23387
23455
  },
23388
23456
  children
23389
23457
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
23458
+ passThrough,
23390
23459
  ...props,
23391
23460
  children: mounted || passThrough ? children : null
23392
23461
  }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_jsx_runtime6.Fragment, {
@@ -24156,8 +24225,8 @@ var require_Popover_native = __commonJS({
24156
24225
  }
24157
24226
  });
24158
24227
  module2.exports = __toCommonJS2(Popover_exports);
24159
- 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) {
24160
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
24228
+ 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) {
24229
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), { onCustomAnchorAdd, onCustomAnchorRemove } = context || {};
24161
24230
  return React4.useEffect(function() {
24162
24231
  return onCustomAnchorAdd(), function() {
24163
24232
  return onCustomAnchorRemove();
@@ -24171,7 +24240,7 @@ var require_Popover_native = __commonJS({
24171
24240
  ref: forwardedRef
24172
24241
  });
24173
24242
  }), PopoverTrigger = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24174
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
24243
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), anchorTo = context.anchorTo, composedTriggerRef = (0, import_compose_refs.useComposedRefs)(forwardedRef, context.triggerRef);
24175
24244
  if (!props.children) return null;
24176
24245
  var trigger = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.View, {
24177
24246
  "aria-expanded": context.open,
@@ -24215,7 +24284,7 @@ var require_Popover_native = __commonJS({
24215
24284
  children: trigger
24216
24285
  });
24217
24286
  }), PopoverContent = import_popper.PopperContentFrame.extractable(/* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24218
- 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);
24287
+ 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);
24219
24288
  if (context.open && isFullyHidden && setIsFullyHidden(!1), React4.useEffect(function() {
24220
24289
  if (context.open) {
24221
24290
  var content = contentRef.current;
@@ -24225,17 +24294,19 @@ var require_Popover_native = __commonJS({
24225
24294
  context.open
24226
24295
  ]), !context.keepChildrenMounted && isFullyHidden) return null;
24227
24296
  var _contentImplProps_pointerEvents;
24228
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentPortal, {
24229
- __scopePopover,
24297
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverPortal, {
24298
+ passThrough: context.breakpointActive,
24299
+ __scopePopover: __scopePopover || POPOVER_SCOPE,
24230
24300
  zIndex,
24231
24301
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Stack, {
24302
+ passThrough: context.breakpointActive,
24232
24303
  pointerEvents: context.open ? (_contentImplProps_pointerEvents = contentImplProps.pointerEvents) !== null && _contentImplProps_pointerEvents !== void 0 ? _contentImplProps_pointerEvents : "auto" : "none",
24233
24304
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContentImpl, {
24234
24305
  ...contentImplProps,
24235
24306
  enableRemoveScroll,
24236
24307
  ref: composedRefs,
24237
24308
  setIsFullyHidden,
24238
- __scopePopover,
24309
+ __scopePopover: __scopePopover || POPOVER_SCOPE,
24239
24310
  // we make sure we're not trapping once it's been closed
24240
24311
  // (closed !== unmounted when animating out)
24241
24312
  trapFocus: trapFocus ?? context.open,
@@ -24260,55 +24331,76 @@ var require_Popover_native = __commonJS({
24260
24331
  })
24261
24332
  })
24262
24333
  });
24263
- }));
24264
- function PopoverRepropagateContext(props) {
24265
- var popperContext = (0, import_popper.usePopperContext)(props.scope || POPOVER_SCOPE);
24334
+ })), useParentContexts = function(scope) {
24335
+ var popperContext = (0, import_popper.usePopperContext)(scope || POPOVER_SCOPE), adaptContext = (0, import_adapt.useAdaptContext)(), context = usePopoverContext(scope || POPOVER_SCOPE);
24336
+ return {
24337
+ popperContext,
24338
+ adaptContext,
24339
+ context
24340
+ };
24341
+ };
24342
+ function RepropagateParentContexts(param) {
24343
+ var { adaptContext, children, context, popperContext, scope } = param;
24266
24344
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
24267
- scope: props.scope,
24345
+ scope,
24268
24346
  ...popperContext,
24269
24347
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
24270
- ...props.context,
24348
+ ...context,
24271
24349
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.ProvideAdaptContext, {
24272
- ...props.adaptContext,
24273
- children: props.children
24350
+ ...adaptContext,
24351
+ children
24274
24352
  })
24275
24353
  })
24276
24354
  });
24277
24355
  }
24278
- function PopoverContentPortal(props) {
24279
- 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;
24280
- return needsRepropagation && (contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverRepropagateContext, {
24281
- scope: __scopePopover || POPOVER_SCOPE,
24282
- context,
24283
- adaptContext,
24284
- zIndex,
24285
- children: props.children
24286
- })), /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
24356
+ var PortalAdaptSafe = function(param) {
24357
+ var { children, __scopePopover } = param;
24358
+ if (needsRepropagation) {
24359
+ var scope = __scopePopover || POPOVER_SCOPE, parentContexts = useParentContexts(scope);
24360
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
24361
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
24362
+ scope,
24363
+ ...parentContexts,
24364
+ children
24365
+ })
24366
+ });
24367
+ }
24368
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
24369
+ children
24370
+ });
24371
+ };
24372
+ function PopoverPortal(props) {
24373
+ var scope = props.__scopePopover || POPOVER_SCOPE, zIndex = props.zIndex, themeName = (0, import_core12.useThemeName)(), content = props.children;
24374
+ if (needsRepropagation) {
24375
+ var parentContexts = useParentContexts(scope);
24376
+ content = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagateParentContexts, {
24377
+ scope,
24378
+ ...parentContexts,
24379
+ children: content
24380
+ });
24381
+ }
24382
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
24383
+ passThrough: props.passThrough,
24287
24384
  stackZIndex: !0,
24288
24385
  zIndex,
24289
24386
  children: (
24290
24387
  /* forceClassName avoids forced re-mount renders for some reason... see the HeadMenu as you change tints a few times */
24291
24388
  /* without this you'll see the site menu re-rendering. It must be something in wrapping children in Theme */
24292
- /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_core12.Theme, {
24293
- passThrough: isPopover,
24389
+ /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
24390
+ passThrough: props.passThrough,
24391
+ contain: !0,
24294
24392
  forceClassName: !0,
24295
24393
  name: themeName,
24296
- children: [
24297
- !!context.open && isSheet && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
24298
- fullscreen: !0,
24299
- onPress: (0, import_helpers.composeEventHandlers)(props.onPress, context.onOpenToggle)
24300
- }),
24301
- /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
24302
- zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
24303
- children: contents
24304
- })
24305
- ]
24394
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
24395
+ zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
24396
+ children: content
24397
+ })
24306
24398
  })
24307
24399
  )
24308
24400
  });
24309
24401
  }
24310
24402
  var PopoverContentImpl = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24311
- 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() {
24403
+ 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() {
24312
24404
  setIsFullyHidden == null || setIsFullyHidden(!0);
24313
24405
  }, [
24314
24406
  setIsFullyHidden
@@ -24316,42 +24408,27 @@ var require_Popover_native = __commonJS({
24316
24408
  disable: context.breakpointActive,
24317
24409
  children
24318
24410
  });
24319
- return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(RepropagatePopperAdapt, {
24320
- __scopePopover: __scopePopover || POPOVER_SCOPE,
24321
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
24322
- type: "presence",
24323
- present: !!open,
24324
- keepChildrenMounted: !!keepChildrenMounted,
24325
- onExitComplete: handleExitComplete,
24326
- lazyMount,
24411
+ return context.breakpointActive, /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate.Animate, {
24412
+ type: "presence",
24413
+ present: !!open,
24414
+ keepChildrenMounted: !!keepChildrenMounted,
24415
+ onExitComplete: handleExitComplete,
24416
+ lazyMount,
24417
+ passThrough: context.breakpointActive,
24418
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, {
24419
+ __scopePopper: __scopePopover || POPOVER_SCOPE,
24420
+ "data-state": getState(open),
24421
+ id: context.contentId,
24422
+ ref: forwardedRef,
24327
24423
  passThrough: context.breakpointActive,
24328
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContent, {
24329
- __scopePopper: __scopePopover || POPOVER_SCOPE,
24330
- "data-state": getState(open),
24331
- id: context.contentId,
24332
- ref: forwardedRef,
24333
- passThrough: context.breakpointActive,
24334
- ...contentProps,
24424
+ ...contentProps,
24425
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalAdaptSafe, {
24335
24426
  children: contents
24336
- }, context.contentId)
24337
- })
24338
- });
24339
- }), RepropagatePopperAdapt = function(param) {
24340
- var { children, __scopePopover } = param;
24341
- if (needsRepropagation) {
24342
- var popperContext = (0, import_popper.usePopperContext)(__scopePopover || POPOVER_SCOPE);
24343
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
24344
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_popper.PopperContext.Provider, {
24345
- ...popperContext,
24346
- children
24347
24427
  })
24348
- });
24349
- }
24350
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
24351
- children
24428
+ }, context.contentId)
24352
24429
  });
24353
- }, PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24354
- var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover);
24430
+ }), PopoverClose = /* @__PURE__ */ React4.forwardRef(function(props, forwardedRef) {
24431
+ var { __scopePopover, ...rest } = props, context = usePopoverContext(__scopePopover || POPOVER_SCOPE);
24355
24432
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_stacks3.YStack, {
24356
24433
  ...rest,
24357
24434
  ref: forwardedRef,
@@ -24371,7 +24448,14 @@ var require_Popover_native = __commonJS({
24371
24448
  });
24372
24449
  }), PopoverScrollView = /* @__PURE__ */ React4.forwardRef(function(props, ref) {
24373
24450
  var context = usePopoverContext(POPOVER_SCOPE);
24374
- return props.children;
24451
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_scroll_view.ScrollView, {
24452
+ ref,
24453
+ // when adapted, no pointer events!
24454
+ pointerEvents: context.breakpointActive ? "none" : void 0,
24455
+ scrollEnabled: !context.breakpointActive,
24456
+ passThrough: context.breakpointActive,
24457
+ ...props
24458
+ });
24375
24459
  }), Popover = (0, import_helpers.withStaticProperties)(/* @__PURE__ */ React4.forwardRef(function(props, ref) {
24376
24460
  var id = React4.useId();
24377
24461
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptParent, {
@@ -24451,7 +24535,7 @@ var require_Popover_native = __commonJS({
24451
24535
  keepChildrenMounted
24452
24536
  }, memoizedChildren = React4.useMemo(function() {
24453
24537
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverContext.Provider, {
24454
- scope: __scopePopover,
24538
+ scope: __scopePopover || POPOVER_SCOPE,
24455
24539
  ...popoverContext,
24456
24540
  children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PopoverSheetController, {
24457
24541
  onOpenChange: setOpen,
@@ -24459,6 +24543,7 @@ var require_Popover_native = __commonJS({
24459
24543
  })
24460
24544
  });
24461
24545
  }, [
24546
+ __scopePopover,
24462
24547
  setOpen,
24463
24548
  children,
24464
24549
  ...Object.values(popoverContext)
@@ -24481,7 +24566,7 @@ var require_Popover_native = __commonJS({
24481
24566
  return open ? "open" : "closed";
24482
24567
  }
24483
24568
  var PopoverSheetController = function(param) {
24484
- var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
24569
+ var { __scopePopover, ...props } = param, context = usePopoverContext(__scopePopover || POPOVER_SCOPE), showSheet = useShowPopoverSheet(context), breakpointActive = context.breakpointActive, getShowSheet = (0, import_core12.useGet)(showSheet);
24485
24570
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_sheet.SheetController, {
24486
24571
  onOpenChange: function(val) {
24487
24572
  if (getShowSheet()) {