@react-aria/utils
Advanced tools
Comparing version 3.0.0-nightly-641446f65-240905 to 3.0.0-nightly-65e3a52a3-241120
@@ -39,3 +39,3 @@ | ||
}); | ||
} catch (e) { | ||
} catch { | ||
// Ignore | ||
@@ -42,0 +42,0 @@ } |
@@ -33,3 +33,3 @@ /* | ||
}); | ||
} catch (e) { | ||
} catch { | ||
// Ignore | ||
@@ -36,0 +36,0 @@ } |
@@ -18,2 +18,3 @@ | ||
*/ function $9a54e9cd5db23b5d$export$2bb74740c4e19def(node, checkForOverflow) { | ||
if (!node) return false; | ||
let style = window.getComputedStyle(node); | ||
@@ -20,0 +21,0 @@ let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY); |
@@ -12,2 +12,3 @@ /* | ||
*/ function $cc38e7bd3fc7b213$export$2bb74740c4e19def(node, checkForOverflow) { | ||
if (!node) return false; | ||
let style = window.getComputedStyle(node); | ||
@@ -14,0 +15,0 @@ let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY); |
@@ -123,4 +123,6 @@ var $1117b6c0d4c4c164$exports = require("./focusWithoutScrolling.main.js"); | ||
let router = $4068a0fae83b6d84$export$9a302a45f65d0572(); | ||
var _props_href; | ||
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : ''); | ||
return { | ||
'data-href': props.href ? router.useHref(props.href) : undefined, | ||
'data-href': props.href ? href : undefined, | ||
'data-target': props.target, | ||
@@ -145,4 +147,6 @@ 'data-rel': props.rel, | ||
let router = $4068a0fae83b6d84$export$9a302a45f65d0572(); | ||
var _props_href; | ||
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : ''); | ||
return { | ||
href: (props === null || props === void 0 ? void 0 : props.href) ? router.useHref(props === null || props === void 0 ? void 0 : props.href) : undefined, | ||
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined, | ||
target: props === null || props === void 0 ? void 0 : props.target, | ||
@@ -149,0 +153,0 @@ rel: props === null || props === void 0 ? void 0 : props.rel, |
@@ -107,4 +107,6 @@ import {focusWithoutScrolling as $7215afc6de606d6b$export$de79e2c695e052f3} from "./focusWithoutScrolling.module.js"; | ||
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572(); | ||
var _props_href; | ||
const href = router.useHref((_props_href = props.href) !== null && _props_href !== void 0 ? _props_href : ''); | ||
return { | ||
'data-href': props.href ? router.useHref(props.href) : undefined, | ||
'data-href': props.href ? href : undefined, | ||
'data-target': props.target, | ||
@@ -129,4 +131,6 @@ 'data-rel': props.rel, | ||
let router = $ea8dcbcb9ea1b556$export$9a302a45f65d0572(); | ||
var _props_href; | ||
const href = router.useHref((_props_href = props === null || props === void 0 ? void 0 : props.href) !== null && _props_href !== void 0 ? _props_href : ''); | ||
return { | ||
href: (props === null || props === void 0 ? void 0 : props.href) ? router.useHref(props === null || props === void 0 ? void 0 : props.href) : undefined, | ||
href: (props === null || props === void 0 ? void 0 : props.href) ? href : undefined, | ||
target: props === null || props === void 0 ? void 0 : props.target, | ||
@@ -133,0 +137,0 @@ rel: props === null || props === void 0 ? void 0 : props.rel, |
@@ -63,3 +63,3 @@ var $49f0d9486c2408aa$exports = require("./getScrollParents.main.js"); | ||
function $449412113267a1fe$export$c826860796309d1b(targetElement, opts) { | ||
if (document.contains(targetElement)) { | ||
if (targetElement && document.contains(targetElement)) { | ||
let root = document.scrollingElement || document.documentElement; | ||
@@ -66,0 +66,0 @@ let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden'; |
@@ -56,3 +56,3 @@ import {getScrollParents as $a40c673dc9f6d9c7$export$94ed1c92c7beeb22} from "./getScrollParents.module.js"; | ||
function $2f04cbc44ee30ce0$export$c826860796309d1b(targetElement, opts) { | ||
if (document.contains(targetElement)) { | ||
if (targetElement && document.contains(targetElement)) { | ||
let root = document.scrollingElement || document.documentElement; | ||
@@ -59,0 +59,0 @@ let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden'; |
@@ -103,25 +103,25 @@ import React, { ForwardedRef, MutableRefObject, ReactNode, HTMLAttributes, EffectCallback, Dispatch, RefObject as _RefObject1 } from "react"; | ||
export function useSyntheticLinkProps(props: LinkDOMProps): { | ||
'data-href': string; | ||
'data-target': React.HTMLAttributeAnchorTarget; | ||
'data-rel': string; | ||
'data-download': string | boolean; | ||
'data-ping': string; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy; | ||
'data-href': string | undefined; | ||
'data-target': React.HTMLAttributeAnchorTarget | undefined; | ||
'data-rel': string | undefined; | ||
'data-download': string | boolean | undefined; | ||
'data-ping': string | undefined; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
/** @deprecated - For backward compatibility. */ | ||
export function getSyntheticLinkProps(props: LinkDOMProps): { | ||
'data-href': string; | ||
'data-target': React.HTMLAttributeAnchorTarget; | ||
'data-rel': string; | ||
'data-download': string | boolean; | ||
'data-ping': string; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy; | ||
'data-href': string | undefined; | ||
'data-target': React.HTMLAttributeAnchorTarget | undefined; | ||
'data-rel': string | undefined; | ||
'data-download': string | boolean | undefined; | ||
'data-ping': string | undefined; | ||
'data-referrer-policy': React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
export function useLinkProps(props: LinkDOMProps): { | ||
href: string; | ||
target: React.HTMLAttributeAnchorTarget; | ||
rel: string; | ||
download: string | boolean; | ||
ping: string; | ||
referrerPolicy: React.HTMLAttributeReferrerPolicy; | ||
export function useLinkProps(props?: LinkDOMProps): { | ||
href: string | undefined; | ||
target: React.HTMLAttributeAnchorTarget | undefined; | ||
rel: string | undefined; | ||
download: string | boolean | undefined; | ||
ping: string | undefined; | ||
referrerPolicy: React.HTMLAttributeReferrerPolicy | undefined; | ||
}; | ||
@@ -178,3 +178,3 @@ export function runAfterTransition(fn: () => void): void; | ||
export function useSyncRef<T>(context?: ContextValue<T> | null, ref?: RefObject<T | null>): void; | ||
export function isScrollable(node: Element, checkForOverflow?: boolean): boolean; | ||
export function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean; | ||
export function getScrollParent(node: Element, checkForOverflow?: boolean): Element; | ||
@@ -194,3 +194,3 @@ export function getScrollParents(node: Element, checkForOverflow?: boolean): Element[]; | ||
/** The optional containing element of the target to be centered in the viewport. */ | ||
containingElement?: Element; | ||
containingElement?: Element | null; | ||
} | ||
@@ -208,7 +208,7 @@ /** | ||
*/ | ||
export function scrollIntoViewport(targetElement: Element, opts?: ScrollIntoViewportOpts): void; | ||
export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts): void; | ||
export function isVirtualClick(event: MouseEvent | PointerEvent): boolean; | ||
export function isVirtualPointerEvent(event: PointerEvent): boolean; | ||
export function useDeepMemo<T>(value: T, isEqual: (a: T, b: T) => boolean): T; | ||
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>, initialValue: T, onReset: (value: T) => void): void; | ||
export function useFormReset<T>(ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined, initialValue: T, onReset: (value: T) => void): void; | ||
interface LoadMoreProps { | ||
@@ -228,3 +228,3 @@ /** Whether data is currently being loaded. */ | ||
/** The data currently loaded. */ | ||
items?: any[]; | ||
items?: any; | ||
} | ||
@@ -231,0 +231,0 @@ export function useLoadMore(props: LoadMoreProps, ref: _RefObject1<HTMLElement | null>): void; |
@@ -49,3 +49,2 @@ var $eHdSW$react = require("react"); | ||
]); | ||
// eslint-disable-next-line arrow-body-style | ||
(0, $eHdSW$react.useEffect)(()=>{ | ||
@@ -52,0 +51,0 @@ return removeAllGlobalListeners; |
@@ -43,3 +43,2 @@ import {useRef as $lPAwt$useRef, useCallback as $lPAwt$useCallback, useEffect as $lPAwt$useEffect} from "react"; | ||
]); | ||
// eslint-disable-next-line arrow-body-style | ||
(0, $lPAwt$useEffect)(()=>{ | ||
@@ -46,0 +45,0 @@ return removeAllGlobalListeners; |
@@ -38,3 +38,12 @@ var $78605a5d7424e31b$exports = require("./useLayoutEffect.main.js"); | ||
}, []); | ||
if ($8c61827343eed941$var$canUseDOM) $8c61827343eed941$var$idsUpdaterMap.set(res, updateValue); | ||
if ($8c61827343eed941$var$canUseDOM) { | ||
// TS not smart enough to know that `has` means the value exists | ||
if ($8c61827343eed941$var$idsUpdaterMap.has(res) && !$8c61827343eed941$var$idsUpdaterMap.get(res).includes(updateValue)) $8c61827343eed941$var$idsUpdaterMap.set(res, [ | ||
...$8c61827343eed941$var$idsUpdaterMap.get(res), | ||
updateValue | ||
]); | ||
else $8c61827343eed941$var$idsUpdaterMap.set(res, [ | ||
updateValue | ||
]); | ||
} | ||
(0, $78605a5d7424e31b$exports.useLayoutEffect)(()=>{ | ||
@@ -61,10 +70,10 @@ let r = res; | ||
if (idA === idB) return idA; | ||
let setIdA = $8c61827343eed941$var$idsUpdaterMap.get(idA); | ||
if (setIdA) { | ||
setIdA(idB); | ||
let setIdsA = $8c61827343eed941$var$idsUpdaterMap.get(idA); | ||
if (setIdsA) { | ||
setIdsA.forEach((fn)=>fn(idB)); | ||
return idB; | ||
} | ||
let setIdB = $8c61827343eed941$var$idsUpdaterMap.get(idB); | ||
if (setIdB) { | ||
setIdB(idA); | ||
let setIdsB = $8c61827343eed941$var$idsUpdaterMap.get(idB); | ||
if (setIdsB) { | ||
setIdsB.forEach((fn)=>fn(idA)); | ||
return idA; | ||
@@ -71,0 +80,0 @@ } |
@@ -30,3 +30,12 @@ import {useLayoutEffect as $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c} from "./useLayoutEffect.module.js"; | ||
}, []); | ||
if ($bdb11010cef70236$var$canUseDOM) $bdb11010cef70236$var$idsUpdaterMap.set(res, updateValue); | ||
if ($bdb11010cef70236$var$canUseDOM) { | ||
// TS not smart enough to know that `has` means the value exists | ||
if ($bdb11010cef70236$var$idsUpdaterMap.has(res) && !$bdb11010cef70236$var$idsUpdaterMap.get(res).includes(updateValue)) $bdb11010cef70236$var$idsUpdaterMap.set(res, [ | ||
...$bdb11010cef70236$var$idsUpdaterMap.get(res), | ||
updateValue | ||
]); | ||
else $bdb11010cef70236$var$idsUpdaterMap.set(res, [ | ||
updateValue | ||
]); | ||
} | ||
(0, $f0a04ccd8dbdd83b$export$e5c5a5f917a5871c)(()=>{ | ||
@@ -53,10 +62,10 @@ let r = res; | ||
if (idA === idB) return idA; | ||
let setIdA = $bdb11010cef70236$var$idsUpdaterMap.get(idA); | ||
if (setIdA) { | ||
setIdA(idB); | ||
let setIdsA = $bdb11010cef70236$var$idsUpdaterMap.get(idA); | ||
if (setIdsA) { | ||
setIdsA.forEach((fn)=>fn(idB)); | ||
return idB; | ||
} | ||
let setIdB = $bdb11010cef70236$var$idsUpdaterMap.get(idB); | ||
if (setIdB) { | ||
setIdB(idA); | ||
let setIdsB = $bdb11010cef70236$var$idsUpdaterMap.get(idB); | ||
if (setIdsB) { | ||
setIdsB.forEach((fn)=>fn(idA)); | ||
return idA; | ||
@@ -63,0 +72,0 @@ } |
@@ -63,3 +63,4 @@ var $2a8c0bb1629926c8$exports = require("./useEvent.main.js"); | ||
props, | ||
ref | ||
ref, | ||
items | ||
]); | ||
@@ -66,0 +67,0 @@ // TODO: maybe this should still just return scroll props? |
@@ -57,3 +57,4 @@ import {useEvent as $e9faafb641e167db$export$90fc3a17d93f704c} from "./useEvent.module.js"; | ||
props, | ||
ref | ||
ref, | ||
items | ||
]); | ||
@@ -60,0 +61,0 @@ // TODO: maybe this should still just return scroll props? |
@@ -22,3 +22,2 @@ var $4gIVO$react = require("react"); | ||
// @ts-ignore | ||
let $8b24bab62f5c65ad$var$visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -25,0 +24,0 @@ function $8b24bab62f5c65ad$export$d699905dd57c73ca() { |
@@ -16,3 +16,2 @@ import {useState as $fuDHA$useState, useEffect as $fuDHA$useEffect} from "react"; | ||
// @ts-ignore | ||
let $5df64b3807dc15ee$var$visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -19,0 +18,0 @@ function $5df64b3807dc15ee$export$d699905dd57c73ca() { |
{ | ||
"name": "@react-aria/utils", | ||
"version": "3.0.0-nightly-641446f65-240905", | ||
"version": "3.0.0-nightly-65e3a52a3-241120", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,5 +25,5 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/ssr": "^3.0.0-nightly-641446f65-240905", | ||
"@react-stately/utils": "^3.0.0-nightly-641446f65-240905", | ||
"@react-types/shared": "^3.0.0-nightly-641446f65-240905", | ||
"@react-aria/ssr": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-stately/utils": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@react-types/shared": "^3.0.0-nightly-65e3a52a3-241120", | ||
"@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 || ^19.0.0" | ||
"react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1" | ||
}, | ||
@@ -39,3 +39,3 @@ "publishConfig": { | ||
}, | ||
"stableVersion": "3.25.2" | ||
"stableVersion": "3.25.3" | ||
} |
@@ -53,3 +53,3 @@ /* | ||
}); | ||
} catch (e) { | ||
} catch { | ||
// Ignore | ||
@@ -56,0 +56,0 @@ } |
@@ -13,3 +13,6 @@ /* | ||
export function isScrollable(node: Element, checkForOverflow?: boolean): boolean { | ||
export function isScrollable(node: Element | null, checkForOverflow?: boolean): boolean { | ||
if (!node) { | ||
return false; | ||
} | ||
let style = window.getComputedStyle(node); | ||
@@ -16,0 +19,0 @@ let isScrollable = /(auto|scroll)/.test(style.overflow + style.overflowX + style.overflowY); |
@@ -26,3 +26,3 @@ /* | ||
type NullToObject<T> = T extends (null | undefined) ? {} : T; | ||
// eslint-disable-next-line no-undef, @typescript-eslint/no-unused-vars | ||
type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never; | ||
@@ -29,0 +29,0 @@ |
@@ -17,3 +17,3 @@ /* | ||
/** The optional containing element of the target to be centered in the viewport. */ | ||
containingElement?: Element | ||
containingElement?: Element | null | ||
} | ||
@@ -85,4 +85,4 @@ | ||
*/ | ||
export function scrollIntoViewport(targetElement: Element, opts?: ScrollIntoViewportOpts) { | ||
if (document.contains(targetElement)) { | ||
export function scrollIntoViewport(targetElement: Element | null, opts?: ScrollIntoViewportOpts) { | ||
if (targetElement && document.contains(targetElement)) { | ||
let root = document.scrollingElement || document.documentElement; | ||
@@ -89,0 +89,0 @@ let isScrollPrevented = window.getComputedStyle(root).overflow === 'hidden'; |
@@ -18,3 +18,3 @@ /* | ||
export function useFormReset<T>( | ||
ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null>, | ||
ref: RefObject<HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement | null> | undefined, | ||
initialValue: T, | ||
@@ -21,0 +21,0 @@ onReset: (value: T) => void |
@@ -45,3 +45,3 @@ /* | ||
// eslint-disable-next-line arrow-body-style | ||
useEffect(() => { | ||
@@ -48,0 +48,0 @@ return removeAllGlobalListeners; |
@@ -25,3 +25,3 @@ /* | ||
let idsUpdaterMap: Map<string, (v: string) => void> = new Map(); | ||
let idsUpdaterMap: Map<string, Array<(v: string) => void>> = new Map(); | ||
@@ -43,3 +43,8 @@ /** | ||
if (canUseDOM) { | ||
idsUpdaterMap.set(res, updateValue); | ||
// TS not smart enough to know that `has` means the value exists | ||
if (idsUpdaterMap.has(res) && !idsUpdaterMap.get(res)!.includes(updateValue)) { | ||
idsUpdaterMap.set(res, [...idsUpdaterMap.get(res)!, updateValue]); | ||
} else { | ||
idsUpdaterMap.set(res, [updateValue]); | ||
} | ||
} | ||
@@ -76,11 +81,11 @@ | ||
let setIdA = idsUpdaterMap.get(idA); | ||
if (setIdA) { | ||
setIdA(idB); | ||
let setIdsA = idsUpdaterMap.get(idA); | ||
if (setIdsA) { | ||
setIdsA.forEach(fn => fn(idB)); | ||
return idB; | ||
} | ||
let setIdB = idsUpdaterMap.get(idB); | ||
if (setIdB) { | ||
setIdB(idA); | ||
let setIdsB = idsUpdaterMap.get(idB); | ||
if (setIdsB) { | ||
setIdsB.forEach(fn => fn(idA)); | ||
return idA; | ||
@@ -87,0 +92,0 @@ } |
@@ -15,3 +15,3 @@ /* | ||
import {useEvent} from './useEvent'; | ||
// eslint-disable-next-line rulesdir/useLayoutEffectRule | ||
import {useLayoutEffect} from './useLayoutEffect'; | ||
@@ -33,3 +33,3 @@ | ||
/** The data currently loaded. */ | ||
items?: any[] | ||
items?: any | ||
} | ||
@@ -78,3 +78,3 @@ | ||
lastItems.current = items; | ||
}, [isLoading, onLoadMore, props, ref]); | ||
}, [isLoading, onLoadMore, props, ref, items]); | ||
@@ -81,0 +81,0 @@ // TODO: maybe this should still just return scroll props? |
@@ -21,3 +21,2 @@ /* | ||
// @ts-ignore | ||
let visualViewport = typeof document !== 'undefined' && window.visualViewport; | ||
@@ -24,0 +23,0 @@ |
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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
559446
6593
+ Addedreact@19.0.0-rc-fb9a90fa48-20240614(transitive)
- Removedjs-tokens@4.0.0(transitive)
- Removedloose-envify@1.4.0(transitive)
- Removedreact@18.3.1(transitive)