tamagui 1.126.2 → 1.126.4-1746355141077

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.
@@ -6628,14 +6628,16 @@ var require_mergeProps_native = __commonJS({
6628
6628
  };
6629
6629
  function mergeProp(out, a, b, key, inverseShorthands) {
6630
6630
  var longhand = (inverseShorthands == null ? void 0 : inverseShorthands[key]) || null, val = a[key];
6631
- if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
6632
- out[key] = {
6633
- ...out[key],
6634
- ...val
6635
- };
6636
- return;
6631
+ if (!(b && (key in b || longhand && longhand in b))) {
6632
+ if (key in import_pseudoDescriptors.pseudoDescriptors || import_useMedia.mediaKeys.has(key)) {
6633
+ out[key] = {
6634
+ ...out[key],
6635
+ ...val
6636
+ };
6637
+ return;
6638
+ }
6639
+ out[longhand || key] = val;
6637
6640
  }
6638
- b && (key in b || longhand && longhand in b) || (out[longhand || key] = val);
6639
6641
  }
6640
6642
  }
6641
6643
  });
@@ -16346,8 +16348,9 @@ var require_Adapt_native = __commonJS({
16346
16348
  }, [
16347
16349
  when,
16348
16350
  platform2,
16349
- context,
16350
- enabled
16351
+ enabled,
16352
+ context.setWhen,
16353
+ context.setPlatform
16351
16354
  ]), (0, import_constants4.useIsomorphicLayoutEffect)(function() {
16352
16355
  return function() {
16353
16356
  var _context_setWhen, _context_setPlatform;
@@ -17791,9 +17794,9 @@ var require_SheetImplementationCustom_native = __commonJS({
17791
17794
  });
17792
17795
  }, previouslyScrolling = !1, onMoveShouldSet = function(e, param) {
17793
17796
  var { dy } = param;
17794
- if (e.target === providerProps.handleRef.current || !scrollEnabled.current || !hasScrollView.current) return !0;
17797
+ if (e.target === providerProps.handleRef.current || !scrollEnabled.current) return !0;
17795
17798
  var isScrolled = scrollBridge.y !== 0, isDraggingUp = dy < 0, isNearTop = scrollBridge.paneY - 5 <= scrollBridge.paneMinY;
17796
- return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && scrollEnabled.current && isDraggingUp ? !1 : Math.abs(dy) > 5;
17799
+ return isScrolled ? (previouslyScrolling = !0, !1) : isNearTop && scrollEnabled.current && hasScrollView.current && isDraggingUp ? !1 : Math.abs(dy) > 10;
17797
17800
  }, grant = function() {
17798
17801
  setScrollEnabled(!1), setPanning(!0), stopSpring(), startY = at.current;
17799
17802
  }, isExternalDrag = !1;
@@ -18962,48 +18965,44 @@ var require_Dialog_native = __commonJS({
18962
18965
  });
18963
18966
  return isAdapted ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_adapt.AdaptPortalContents, {
18964
18967
  children: content
18965
- }) : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
18966
- hostName: context.adaptName,
18968
+ }) : context.modal ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.PortalItem, {
18969
+ hostName: context.modal ? "root" : context.adaptName,
18967
18970
  children: content
18968
- });
18971
+ }) : content;
18969
18972
  }, DialogPortal = function(props) {
18970
18973
  var { __scopeDialog, forceMount, children, ...frameProps } = props, context = useDialogContext(PORTAL_NAME, __scopeDialog), isShowing = forceMount || context.open, [isFullyHidden, setIsFullyHidden] = React4.useState(!isShowing), isAdapted = (0, import_adapt.useAdaptIsActive)();
18971
18974
  isShowing && isFullyHidden && setIsFullyHidden(!1);
18972
18975
  var handleExitComplete = React4.useCallback(function() {
18973
18976
  setIsFullyHidden(!0);
18974
- }, []), zIndex = (0, import_core12.getExpandedShorthand)("zIndex", props);
18975
- if (context.modal) {
18976
- var contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
18977
- zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
18978
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
18979
- onExitComplete: handleExitComplete,
18980
- children: isShowing || isAdapted ? children : null
18981
- })
18982
- });
18983
- if (isFullyHidden && !isAdapted) return null;
18984
- var framedContents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalProvider2, {
18985
- scope: __scopeDialog,
18986
- forceMount,
18987
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalFrame, {
18988
- pointerEvents: isShowing ? "auto" : "none",
18989
- ...frameProps,
18990
- children: contents
18991
- })
18992
- });
18993
- return import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
18994
- zIndex,
18995
- // set to 1000 which "boosts" it 1000 above baseline for current context
18996
- // this makes sure its above (this first 1k) popovers on the same layer
18997
- stackZIndex: 1e3,
18998
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PassthroughTheme, {
18999
- children: framedContents
19000
- })
19001
- }) : isAdapted ? framedContents : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalItem, {
19002
- __scopeDialog,
18977
+ }, []), zIndex = (0, import_core12.getExpandedShorthand)("zIndex", props), contents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_z_index_stack2.StackZIndexContext, {
18978
+ zIndex: (0, import_portal2.resolveViewZIndex)(zIndex),
18979
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_animate_presence.AnimatePresence, {
18980
+ onExitComplete: handleExitComplete,
18981
+ children: isShowing || isAdapted ? children : null
18982
+ })
18983
+ });
18984
+ if (isFullyHidden && !isAdapted) return null;
18985
+ var framedContents = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PortalProvider2, {
18986
+ scope: __scopeDialog,
18987
+ forceMount,
18988
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalFrame, {
18989
+ pointerEvents: isShowing ? "auto" : "none",
18990
+ ...frameProps,
18991
+ children: contents
18992
+ })
18993
+ });
18994
+ return import_constants4.isWeb ? /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_portal2.Portal, {
18995
+ zIndex,
18996
+ // set to 1000 which "boosts" it 1000 above baseline for current context
18997
+ // this makes sure its above (this first 1k) popovers on the same layer
18998
+ stackZIndex: 1e3,
18999
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(PassthroughTheme, {
19003
19000
  children: framedContents
19004
- });
19005
- }
19006
- return children;
19001
+ })
19002
+ }) : isAdapted ? framedContents : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogPortalItem, {
19003
+ __scopeDialog,
19004
+ children: framedContents
19005
+ });
19007
19006
  }, PassthroughTheme = function(param) {
19008
19007
  var { children } = param, themeName = (0, import_core12.useThemeName)();
19009
19008
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_core12.Theme, {
@@ -19017,6 +19016,11 @@ var require_Dialog_native = __commonJS({
19017
19016
  var { __scopeDialog, ...props } = param, portalContext = usePortalContext(OVERLAY_NAME, __scopeDialog), { forceMount = portalContext.forceMount, ...overlayProps } = props, context = useDialogContext(OVERLAY_NAME, __scopeDialog), isAdapted = (0, import_adapt.useAdaptIsActive)();
19018
19017
  return !forceMount && (!context.modal || isAdapted) ? null : /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DialogOverlayFrame, {
19019
19018
  "data-state": getState(context.open),
19019
+ // TODO: this will be apply for v2
19020
+ // onPress={() => {
19021
+ // // if the overlay is pressed, close the dialog
19022
+ // context.onOpenChange(false)
19023
+ // }}
19020
19024
  // We re-enable pointer-events prevented by `Dialog.Content` to allow scrolling the overlay.
19021
19025
  pointerEvents: context.open ? "auto" : "none",
19022
19026
  ...overlayProps,