@nextui-org/react-utils
Advanced tools
Comparing version 0.0.0-dev-v2-20240416003301 to 0.0.0-dev-v2-20240416125016
@@ -23,3 +23,11 @@ import { DOMRefValue, FocusableRefValue, FocusableRef } from '@react-types/shared'; | ||
declare function useSyncRef<T>(context: ContextValue<T | null>, ref: RefObject<T>): void; | ||
/** | ||
* Checks if two DOMRect objects intersect each other. | ||
* | ||
* @param rect1 - The first DOMRect object. | ||
* @param rect2 - The second DOMRect object. | ||
* @returns A boolean indicating whether the two DOMRect objects intersect. | ||
*/ | ||
declare function areRectsIntersecting(rect1: DOMRect, rect2: DOMRect): boolean; | ||
export { ContextValue, UserAgentBrowser, UserAgentDeviceType, UserAgentOS, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef }; | ||
export { ContextValue, UserAgentBrowser, UserAgentDeviceType, UserAgentOS, areRectsIntersecting, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef }; |
@@ -24,2 +24,3 @@ "use client"; | ||
__export(dom_exports, { | ||
areRectsIntersecting: () => areRectsIntersecting, | ||
canUseDOM: () => canUseDOM, | ||
@@ -153,4 +154,8 @@ createDOMRef: () => createDOMRef, | ||
} | ||
function areRectsIntersecting(rect1, rect2) { | ||
return rect1 && rect2 && rect1.x < rect2.x + rect2.width && rect1.x + rect1.width > rect2.x && rect1.y < rect2.y + rect2.height && rect1.y + rect1.height > rect2.y; | ||
} | ||
// Annotate the CommonJS export names for ESM import in node: | ||
0 && (module.exports = { | ||
areRectsIntersecting, | ||
canUseDOM, | ||
@@ -157,0 +162,0 @@ createDOMRef, |
export { CreateContextOptions, CreateContextReturn, createContext } from './context.js'; | ||
export { ReactRef, assignRef, mergeRefs } from './refs.js'; | ||
export { ContextValue, UserAgentBrowser, UserAgentDeviceType, UserAgentOS, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef } from './dom.js'; | ||
export { ContextValue, UserAgentBrowser, UserAgentDeviceType, UserAgentOS, areRectsIntersecting, canUseDOM, createDOMRef, createFocusableRef, detectBrowser, detectDeviceType, detectOS, detectTouch, getUserAgentBrowser, getUserAgentOS, isBrowser, useDOMRef, useFocusableRef, useSyncRef } from './dom.js'; | ||
export { ShapeType, getCSSStyleVal, getRealShape } from './dimensions.js'; | ||
@@ -5,0 +5,0 @@ export * from '@nextui-org/react-rsc-utils'; |
@@ -31,2 +31,3 @@ "use client"; | ||
__export(src_exports, { | ||
areRectsIntersecting: () => areRectsIntersecting, | ||
assignRef: () => assignRef, | ||
@@ -212,2 +213,5 @@ canUseDOM: () => canUseDOM, | ||
} | ||
function areRectsIntersecting(rect1, rect2) { | ||
return rect1 && rect2 && rect1.x < rect2.x + rect2.width && rect1.x + rect1.width > rect2.x && rect1.y < rect2.y + rect2.height && rect1.y + rect1.height > rect2.y; | ||
} | ||
@@ -237,2 +241,3 @@ // src/dimensions.ts | ||
0 && (module.exports = { | ||
areRectsIntersecting, | ||
assignRef, | ||
@@ -239,0 +244,0 @@ canUseDOM, |
{ | ||
"name": "@nextui-org/react-utils", | ||
"version": "0.0.0-dev-v2-20240416003301", | ||
"version": "0.0.0-dev-v2-20240416125016", | ||
"description": "A set of utilities for react on client side", | ||
@@ -31,4 +31,4 @@ "keywords": [ | ||
"dependencies": { | ||
"@nextui-org/shared-utils": "2.0.4", | ||
"@nextui-org/react-rsc-utils": "0.0.0-dev-v2-20240416003301" | ||
"@nextui-org/shared-utils": "0.0.0-dev-v2-20240416125016", | ||
"@nextui-org/react-rsc-utils": "0.0.0-dev-v2-20240416125016" | ||
}, | ||
@@ -35,0 +35,0 @@ "clean-package": "../../../clean-package.config.json", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
32958
988
+ Added@nextui-org/react-rsc-utils@0.0.0-dev-v2-20240416125016(transitive)
+ Added@nextui-org/shared-utils@0.0.0-dev-v2-20240416125016(transitive)
- Removed@nextui-org/react-rsc-utils@0.0.0-dev-v2-20240416003301(transitive)
- Removed@nextui-org/shared-utils@2.0.4(transitive)
Updated@nextui-org/react-rsc-utils@0.0.0-dev-v2-20240416125016