Socket
Socket
Sign inDemoInstall

@react-aria/utils

Package Overview
Dependencies
Maintainers
2
Versions
793
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-aria/utils - npm Package Compare versions

Comparing version 3.24.1 to 3.25.0

dist/useLoadMore.main.js

5

dist/main.js

@@ -32,2 +32,3 @@ var $8c61827343eed941$exports = require("./useId.main.js");

var $1f205e845604a423$exports = require("./useFormReset.main.js");
var $faa6ccd6fb62f877$exports = require("./useLoadMore.main.js");
var $1Yh1N$reactstatelyutils = require("@react-stately/utils");

@@ -52,3 +53,3 @@

$parcel$export(module.exports, "openLink", () => $4068a0fae83b6d84$exports.openLink);
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$exports.getSyntheticLinkProps);
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$exports.useSyntheticLinkProps);
$parcel$export(module.exports, "RouterProvider", () => $4068a0fae83b6d84$exports.RouterProvider);

@@ -92,2 +93,3 @@ $parcel$export(module.exports, "shouldClientNavigate", () => $4068a0fae83b6d84$exports.shouldClientNavigate);

$parcel$export(module.exports, "useFormReset", () => $1f205e845604a423$exports.useFormReset);
$parcel$export(module.exports, "useLoadMore", () => $faa6ccd6fb62f877$exports.useLoadMore);
/*

@@ -137,2 +139,3 @@ * Copyright 2020 Adobe. All rights reserved.

//# sourceMappingURL=main.js.map

2

dist/mergeRefs.main.js

@@ -18,3 +18,3 @@

*/ function $f05dc24eafaeb7e2$export$c9058316764c140e(...refs) {
if (refs.length === 1) return refs[0];
if (refs.length === 1 && refs[0]) return refs[0];
return (value)=>{

@@ -21,0 +21,0 @@ for (let ref of refs){

@@ -12,3 +12,3 @@ /*

*/ function $5dc95899b306f630$export$c9058316764c140e(...refs) {
if (refs.length === 1) return refs[0];
if (refs.length === 1 && refs[0]) return refs[0];
return (value)=>{

@@ -15,0 +15,0 @@ for (let ref of refs){

@@ -9,3 +9,3 @@ import {mergeIds as $bdb11010cef70236$export$cd8c9cb68f842629, useId as $bdb11010cef70236$export$f680877a34711e37, useSlotId as $bdb11010cef70236$export$b4cc09c592e8fdb8} from "./useId.module.js";

import {getOffset as $ab71dadb03a6fb2e$export$622cea445a1c5b7d} from "./getOffset.module.js";
import {getSyntheticLinkProps as $ea8dcbcb9ea1b556$export$51437d503373d223, openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572} from "./openLink.module.js";
import {openLink as $ea8dcbcb9ea1b556$export$95185d699e05d4d7, RouterProvider as $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb, shouldClientNavigate as $ea8dcbcb9ea1b556$export$efa8c9099e530235, useLinkProps as $ea8dcbcb9ea1b556$export$7e924b3091a3bd18, useRouter as $ea8dcbcb9ea1b556$export$9a302a45f65d0572, useSyntheticLinkProps as $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6} from "./openLink.module.js";
import {runAfterTransition as $bbed8b41f857bcc0$export$24490316f764c430} from "./runAfterTransition.module.js";

@@ -33,2 +33,3 @@ import {useDrag1D as $9cc09df9fd7676be$export$7bbed75feba39706} from "./useDrag1D.module.js";

import {useFormReset as $99facab73266f662$export$5add1d006293d136} from "./useFormReset.module.js";
import {useLoadMore as $26f7f3da73fcd9d6$export$7717c92ee915373e} from "./useLoadMore.module.js";
import {clamp as $4507461a1b870123$re_export$clamp, snapValueToStep as $4507461a1b870123$re_export$snapValueToStep} from "@react-stately/utils";

@@ -80,3 +81,4 @@

export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset};
export {$bdb11010cef70236$export$f680877a34711e37 as useId, $bdb11010cef70236$export$cd8c9cb68f842629 as mergeIds, $bdb11010cef70236$export$b4cc09c592e8fdb8 as useSlotId, $ff5963eb1fccf552$export$e08e3b67e392101e as chain, $431fbd86ca7dc216$export$b204af158042fbac as getOwnerDocument, $431fbd86ca7dc216$export$f21a1ffae260145a as getOwnerWindow, $3ef42575df84b30b$export$9d1611c77c2fe928 as mergeProps, $5dc95899b306f630$export$c9058316764c140e as mergeRefs, $65484d02dcb7eb3e$export$457c3d6518dd4c6f as filterDOMProps, $7215afc6de606d6b$export$de79e2c695e052f3 as focusWithoutScrolling, $ab71dadb03a6fb2e$export$622cea445a1c5b7d as getOffset, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps, $bbed8b41f857bcc0$export$24490316f764c430 as runAfterTransition, $9cc09df9fd7676be$export$7bbed75feba39706 as useDrag1D, $03deb23ff14920c4$export$4eaf04e54aa8eed6 as useGlobalListeners, $313b98861ee5dd6c$export$d6875122194c7b44 as useLabels, $df56164dff5785e2$export$4338b53315abf666 as useObjectRef, $4f58c5f72bcf79f7$export$496315a1608d9602 as useUpdateEffect, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c as useLayoutEffect, $9daab02d461809db$export$683480f191c0e3ea as useResizeObserver, $e7801be82b4b2a53$export$4debdb1a3f0fa79e as useSyncRef, $62d8ded9296f3872$export$cfa2225e87938781 as getScrollParent, $a40c673dc9f6d9c7$export$94ed1c92c7beeb22 as getScrollParents, $cc38e7bd3fc7b213$export$2bb74740c4e19def as isScrollable, $5df64b3807dc15ee$export$d699905dd57c73ca as useViewportSize, $ef06256079686ba0$export$f8aeda7b10753fa1 as useDescription, $c87311424ea30a05$export$9ac100e40613ea10 as isMac, $c87311424ea30a05$export$186c6964ca17d99 as isIPhone, $c87311424ea30a05$export$7bef049ce92e4224 as isIPad, $c87311424ea30a05$export$fedb369cb70207f1 as isIOS, $c87311424ea30a05$export$e1865c3bedcd822b as isAppleDevice, $c87311424ea30a05$export$78551043582a6a98 as isWebKit, $c87311424ea30a05$export$6446a186d09e379e as isChrome, $c87311424ea30a05$export$a11b0059900ceec8 as isAndroid, $c87311424ea30a05$export$b7d78993b74f766d as isFirefox, $e9faafb641e167db$export$90fc3a17d93f704c as useEvent, $1dbecbe27a04f9af$export$14d238f342723f25 as useValueEffect, $2f04cbc44ee30ce0$export$53a0910f038337bd as scrollIntoView, $2f04cbc44ee30ce0$export$c826860796309d1b as scrollIntoViewport, $4507461a1b870123$re_export$clamp as clamp, $4507461a1b870123$re_export$snapValueToStep as snapValueToStep, $6a7db85432448f7f$export$60278871457622de as isVirtualClick, $6a7db85432448f7f$export$29bf1b5f2c56cf63 as isVirtualPointerEvent, $8ae05eaa5c114e9c$export$7f54fc3180508a52 as useEffectEvent, $5a387cc49350e6db$export$722debc0e56fea39 as useDeepMemo, $99facab73266f662$export$5add1d006293d136 as useFormReset, $26f7f3da73fcd9d6$export$7717c92ee915373e as useLoadMore};
//# sourceMappingURL=module.js.map

@@ -18,3 +18,3 @@ var $1117b6c0d4c4c164$exports = require("./focusWithoutScrolling.main.js");

$parcel$export(module.exports, "useRouter", () => $4068a0fae83b6d84$export$9a302a45f65d0572);
$parcel$export(module.exports, "getSyntheticLinkProps", () => $4068a0fae83b6d84$export$51437d503373d223);
$parcel$export(module.exports, "useSyntheticLinkProps", () => $4068a0fae83b6d84$export$bdc77b0c0a3a85d6);
$parcel$export(module.exports, "useLinkProps", () => $4068a0fae83b6d84$export$7e924b3091a3bd18);

@@ -121,5 +121,6 @@ /*

}
function $4068a0fae83b6d84$export$51437d503373d223(props) {
function $4068a0fae83b6d84$export$bdc77b0c0a3a85d6(props) {
let router = $4068a0fae83b6d84$export$9a302a45f65d0572();
return {
'data-href': props.href,
'data-href': props.href ? router.useHref(props.href) : undefined,
'data-target': props.target,

@@ -126,0 +127,0 @@ 'data-rel': props.rel,

@@ -105,5 +105,6 @@ import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.module.js";

}
function $ea8dcbcb9ea1b556$export$51437d503373d223(props) {
function $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6(props) {
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572();
return {
'data-href': props.href,
'data-href': props.href ? router.useHref(props.href) : undefined,
'data-target': props.target,

@@ -129,3 +130,3 @@ 'data-rel': props.rel,

export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$51437d503373d223 as getSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
export {$ea8dcbcb9ea1b556$export$323e4fc2fa4753fb as RouterProvider, $ea8dcbcb9ea1b556$export$efa8c9099e530235 as shouldClientNavigate, $ea8dcbcb9ea1b556$export$95185d699e05d4d7 as openLink, $ea8dcbcb9ea1b556$export$9a302a45f65d0572 as useRouter, $ea8dcbcb9ea1b556$export$bdc77b0c0a3a85d6 as useSyntheticLinkProps, $ea8dcbcb9ea1b556$export$7e924b3091a3bd18 as useLinkProps};
//# sourceMappingURL=openLink.module.js.map

@@ -34,32 +34,39 @@

}
function $9e20cff0af27e8cc$export$9ac100e40613ea10() {
function $9e20cff0af27e8cc$var$cached(fn) {
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $9e20cff0af27e8cc$export$9ac100e40613ea10 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^Mac/i);
}
function $9e20cff0af27e8cc$export$186c6964ca17d99() {
});
const $9e20cff0af27e8cc$export$186c6964ca17d99 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^iPhone/i);
}
function $9e20cff0af27e8cc$export$7bef049ce92e4224() {
});
const $9e20cff0af27e8cc$export$7bef049ce92e4224 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$9e20cff0af27e8cc$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
}
function $9e20cff0af27e8cc$export$fedb369cb70207f1() {
});
const $9e20cff0af27e8cc$export$fedb369cb70207f1 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$export$186c6964ca17d99() || $9e20cff0af27e8cc$export$7bef049ce92e4224();
}
function $9e20cff0af27e8cc$export$e1865c3bedcd822b() {
});
const $9e20cff0af27e8cc$export$e1865c3bedcd822b = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$export$9ac100e40613ea10() || $9e20cff0af27e8cc$export$fedb369cb70207f1();
}
function $9e20cff0af27e8cc$export$78551043582a6a98() {
});
const $9e20cff0af27e8cc$export$78551043582a6a98 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/AppleWebKit/i) && !$9e20cff0af27e8cc$export$6446a186d09e379e();
}
function $9e20cff0af27e8cc$export$6446a186d09e379e() {
});
const $9e20cff0af27e8cc$export$6446a186d09e379e = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Chrome/i);
}
function $9e20cff0af27e8cc$export$a11b0059900ceec8() {
});
const $9e20cff0af27e8cc$export$a11b0059900ceec8 = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Android/i);
}
function $9e20cff0af27e8cc$export$b7d78993b74f766d() {
});
const $9e20cff0af27e8cc$export$b7d78993b74f766d = $9e20cff0af27e8cc$var$cached(function() {
return $9e20cff0af27e8cc$var$testUserAgent(/Firefox/i);
}
});
//# sourceMappingURL=platform.main.js.map

@@ -20,30 +20,37 @@ /*

}
function $c87311424ea30a05$export$9ac100e40613ea10() {
function $c87311424ea30a05$var$cached(fn) {
let res = null;
return ()=>{
if (res == null) res = fn();
return res;
};
}
const $c87311424ea30a05$export$9ac100e40613ea10 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^Mac/i);
}
function $c87311424ea30a05$export$186c6964ca17d99() {
});
const $c87311424ea30a05$export$186c6964ca17d99 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPhone/i);
}
function $c87311424ea30a05$export$7bef049ce92e4224() {
});
const $c87311424ea30a05$export$7bef049ce92e4224 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testPlatform(/^iPad/i) || // iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
$c87311424ea30a05$export$9ac100e40613ea10() && navigator.maxTouchPoints > 1;
}
function $c87311424ea30a05$export$fedb369cb70207f1() {
});
const $c87311424ea30a05$export$fedb369cb70207f1 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$186c6964ca17d99() || $c87311424ea30a05$export$7bef049ce92e4224();
}
function $c87311424ea30a05$export$e1865c3bedcd822b() {
});
const $c87311424ea30a05$export$e1865c3bedcd822b = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$export$9ac100e40613ea10() || $c87311424ea30a05$export$fedb369cb70207f1();
}
function $c87311424ea30a05$export$78551043582a6a98() {
});
const $c87311424ea30a05$export$78551043582a6a98 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/AppleWebKit/i) && !$c87311424ea30a05$export$6446a186d09e379e();
}
function $c87311424ea30a05$export$6446a186d09e379e() {
});
const $c87311424ea30a05$export$6446a186d09e379e = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Chrome/i);
}
function $c87311424ea30a05$export$a11b0059900ceec8() {
});
const $c87311424ea30a05$export$a11b0059900ceec8 = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Android/i);
}
function $c87311424ea30a05$export$b7d78993b74f766d() {
});
const $c87311424ea30a05$export$b7d78993b74f766d = $c87311424ea30a05$var$cached(function() {
return $c87311424ea30a05$var$testUserAgent(/Firefox/i);
}
});

@@ -50,0 +57,0 @@

@@ -1,3 +0,3 @@

import React, { ForwardedRef, MutableRefObject, ReactNode, HTMLAttributes, EffectCallback, RefObject, Dispatch } from "react";
import { AriaLabelingProps, DOMProps, LinkDOMProps, FocusableElement, Href, RouterOptions, Orientation } from "@react-types/shared";
import React, { ForwardedRef, MutableRefObject, ReactNode, HTMLAttributes, EffectCallback, Dispatch, RefObject as _RefObject1 } from "react";
import { AriaLabelingProps, DOMProps, LinkDOMProps, FocusableElement, Href, RouterOptions, Orientation, RefObject } from "@react-types/shared";
export const useLayoutEffect: typeof React.useLayoutEffect;

@@ -48,3 +48,3 @@ /**

*/
export function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T>>): ForwardedRef<T>;
export function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T> | null | undefined>): ForwardedRef<T>;
interface Options {

@@ -70,11 +70,11 @@ /**

export function getOffset(element: any, reverse: any, orientation?: string): any;
export function isMac(): boolean;
export function isIPhone(): boolean;
export function isIPad(): boolean;
export function isIOS(): boolean;
export function isAppleDevice(): boolean;
export function isWebKit(): boolean;
export function isChrome(): any;
export function isAndroid(): any;
export function isFirefox(): any;
export const isMac: () => boolean;
export const isIPhone: () => boolean;
export const isIPad: () => boolean;
export const isIOS: () => boolean;
export const isAppleDevice: () => boolean;
export const isWebKit: () => boolean;
export const isChrome: () => boolean;
export const isAndroid: () => boolean;
export const isFirefox: () => boolean;
interface Router {

@@ -104,3 +104,3 @@ isNative: boolean;

export function openLink(target: HTMLAnchorElement, modifiers: Modifiers, setOpening?: boolean): void;
export function getSyntheticLinkProps(props: LinkDOMProps): {
export function useSyntheticLinkProps(props: LinkDOMProps): {
'data-href': string;

@@ -162,3 +162,4 @@ 'data-target': React.HTMLAttributeAnchorTarget;

type useResizeObserverOptionsType<T> = {
ref: RefObject<T | undefined> | undefined;
ref: RefObject<T | undefined | null> | undefined;
box?: ResizeObserverBoxOptions;
onResize: () => void;

@@ -170,3 +171,3 @@ };

}
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T>): void;
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void;
export function isScrollable(node: Element, checkForOverflow?: boolean): boolean;

@@ -182,3 +183,3 @@ export function getScrollParent(node: Element, checkForOverflow?: boolean): Element;

export function useEffectEvent<T extends Function>(fn?: T): T;
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(ref: RefObject<EventTarget>, event: K, handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(ref: RefObject<EventTarget | null>, event: K | (string & {}), handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
type SetValueAction<S> = (prev: S) => Generator<any, void, unknown>;

@@ -205,5 +206,22 @@ export function useValueEffect<S>(defaultValue: S | (() => S)): [S, Dispatch<SetValueAction<S>>];

export function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T;
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>, initialValue: T, onReset: (value: T) => void): void;
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>, initialValue: T, onReset: (value: T) => void): void;
interface LoadMoreProps {
/** Whether data is currently being loaded. */
isLoading?: boolean;
/** Handler that is called when more items should be loaded, e.g. while scrolling near the bottom. */
onLoadMore?: () => void;
/**
* The amount of offset from the bottom of your scrollable region that should trigger load more.
* Uses a percentage value relative to the scroll body's client height. Load more is then triggered
* when your current scroll position's distance from the bottom of the currently loaded list of items is less than
* or equal to the provided value. (e.g. 1 = 100% of the scroll region's height).
* @default 1
*/
scrollOffset?: number;
/** The data currently loaded. */
items?: any[];
}
export function useLoadMore(props: LoadMoreProps, ref: _RefObject1<HTMLElement | null>): void;
export { clamp, snapValueToStep } from '@react-stately/utils';
//# sourceMappingURL=types.d.ts.map

@@ -14,3 +14,3 @@ var $aM4zL$react = require("react");

function $37733e1652f47193$export$683480f191c0e3ea(options) {
const { ref: ref, onResize: onResize } = options;
const { ref: ref, box: box, onResize: onResize } = options;
(0, $aM4zL$react.useEffect)(()=>{

@@ -29,3 +29,5 @@ let element = ref === null || ref === void 0 ? void 0 : ref.current;

});
resizeObserverInstance.observe(element);
resizeObserverInstance.observe(element, {
box: box
});
return ()=>{

@@ -37,3 +39,4 @@ if (element) resizeObserverInstance.unobserve(element);

onResize,
ref
ref,
box
]);

@@ -40,0 +43,0 @@ }

@@ -8,3 +8,3 @@ import {useEffect as $Vsl8o$useEffect} from "react";

function $9daab02d461809db$export$683480f191c0e3ea(options) {
const { ref: ref, onResize: onResize } = options;
const { ref: ref, box: box, onResize: onResize } = options;
(0, $Vsl8o$useEffect)(()=>{

@@ -23,3 +23,5 @@ let element = ref === null || ref === void 0 ? void 0 : ref.current;

});
resizeObserverInstance.observe(element);
resizeObserverInstance.observe(element, {
box: box
});
return ()=>{

@@ -31,3 +33,4 @@ if (element) resizeObserverInstance.unobserve(element);

onResize,
ref
ref,
box
]);

@@ -34,0 +37,0 @@ }

{
"name": "@react-aria/utils",
"version": "3.24.1",
"version": "3.25.0",
"description": "Spectrum UI components in React",

@@ -25,5 +25,5 @@ "license": "Apache-2.0",

"dependencies": {
"@react-aria/ssr": "^3.9.4",
"@react-stately/utils": "^3.10.1",
"@react-types/shared": "^3.23.1",
"@react-aria/ssr": "^3.9.5",
"@react-stately/utils": "^3.10.2",
"@react-types/shared": "^3.24.0",
"@swc/helpers": "^0.5.0",

@@ -33,3 +33,3 @@ "clsx": "^2.0.0"

"peerDependencies": {
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
},

@@ -39,3 +39,3 @@ "publishConfig": {

},
"gitHead": "b77d7d594dff4dcfb5359bffbcfd18142b146433"
"gitHead": "86d80e3216bc32e75108831cf3a5a720bc849206"
}

@@ -20,3 +20,3 @@ /*

export {getOffset} from './getOffset';
export {openLink, getSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps} from './openLink';
export {openLink, useSyntheticLinkProps, RouterProvider, shouldClientNavigate, useRouter, useLinkProps} from './openLink';
export {runAfterTransition} from './runAfterTransition';

@@ -45,1 +45,2 @@ export {useDrag1D} from './useDrag1D';

export {useFormReset} from './useFormReset';
export {useLoadMore} from './useLoadMore';

@@ -18,4 +18,4 @@ /*

*/
export function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T>>): ForwardedRef<T> {
if (refs.length === 1) {
export function mergeRefs<T>(...refs: Array<ForwardedRef<T> | MutableRefObject<T> | null | undefined>): ForwardedRef<T> {
if (refs.length === 1 && refs[0]) {
return refs[0];

@@ -22,0 +22,0 @@ }

@@ -29,38 +29,52 @@ /*

export function isMac() {
return testPlatform(/^Mac/i);
function cached(fn: () => boolean) {
if (process.env.NODE_ENV === 'test') {
return fn;
}
let res: boolean | null = null;
return () => {
if (res == null) {
res = fn();
}
return res;
};
}
export function isIPhone() {
export const isMac = cached(function () {
return testPlatform(/^Mac/i);
});
export const isIPhone = cached(function () {
return testPlatform(/^iPhone/i);
}
});
export function isIPad() {
export const isIPad = cached(function () {
return testPlatform(/^iPad/i) ||
// iPadOS 13 lies and says it's a Mac, but we can distinguish by detecting touch support.
(isMac() && navigator.maxTouchPoints > 1);
}
});
export function isIOS() {
export const isIOS = cached(function () {
return isIPhone() || isIPad();
}
});
export function isAppleDevice() {
export const isAppleDevice = cached(function () {
return isMac() || isIOS();
}
});
export function isWebKit() {
export const isWebKit = cached(function () {
return testUserAgent(/AppleWebKit/i) && !isChrome();
}
});
export function isChrome() {
export const isChrome = cached(function () {
return testUserAgent(/Chrome/i);
}
});
export function isAndroid() {
export const isAndroid = cached(function () {
return testUserAgent(/Android/i);
}
});
export function isFirefox() {
export const isFirefox = cached(function () {
return testUserAgent(/Firefox/i);
}
});

@@ -13,8 +13,9 @@ /*

import {RefObject, useEffect} from 'react';
import {RefObject} from '@react-types/shared';
import {useEffect} from 'react';
import {useEffectEvent} from './useEffectEvent';
export function useEvent<K extends keyof GlobalEventHandlersEventMap>(
ref: RefObject<EventTarget>,
event: K,
ref: RefObject<EventTarget | null>,
event: K | (string & {}),
handler?: (this: Document, ev: GlobalEventHandlersEventMap[K]) => any,

@@ -21,0 +22,0 @@ options?: boolean | AddEventListenerOptions

@@ -12,7 +12,9 @@ /*

*/
import {RefObject, useEffect, useRef} from 'react';
import {RefObject} from '@react-types/shared';
import {useEffect, useRef} from 'react';
import {useEffectEvent} from './useEffectEvent';
export function useFormReset<T>(
ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement>,
ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>,
initialValue: T,

@@ -19,0 +21,0 @@ onReset: (value: T) => void

@@ -1,3 +0,5 @@

import {RefObject, useEffect} from 'react';
import {RefObject} from '@react-types/shared';
import {useEffect} from 'react';
function hasResizeObserver() {

@@ -8,3 +10,4 @@ return typeof window.ResizeObserver !== 'undefined';

type useResizeObserverOptionsType<T> = {
ref: RefObject<T | undefined> | undefined,
ref: RefObject<T | undefined | null> | undefined,
box?: ResizeObserverBoxOptions,
onResize: () => void

@@ -14,3 +17,3 @@ }

export function useResizeObserver<T extends Element>(options: useResizeObserverOptionsType<T>) {
const {ref, onResize} = options;
const {ref, box, onResize} = options;

@@ -37,3 +40,3 @@ useEffect(() => {

});
resizeObserverInstance.observe(element);
resizeObserverInstance.observe(element, {box});

@@ -47,3 +50,3 @@ return () => {

}, [onResize, ref]);
}, [onResize, ref, box]);
}

@@ -13,3 +13,4 @@ /*

import {MutableRefObject, RefObject} from 'react';
import {MutableRefObject} from 'react';
import {RefObject} from '@react-types/shared';
import {useLayoutEffect} from './';

@@ -22,3 +23,3 @@

// Syncs ref from context with ref passed to hook
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T>) {
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>) {
useLayoutEffect(() => {

@@ -25,0 +26,0 @@ if (context && context.ref && ref) {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc