@react-stately/tooltip
Advanced tools
Comparing version 3.0.0-nightly-fb28ab3b4-241024 to 3.0.0-nightly-fee532d6a-241217
@@ -33,3 +33,3 @@ var $w0mn6$react = require("react"); | ||
let id = (0, $w0mn6$react.useMemo)(()=>`${++$3391baedd777a697$var$tooltipId}`, []); | ||
let closeTimeout = (0, $w0mn6$react.useRef)(undefined); | ||
let closeTimeout = (0, $w0mn6$react.useRef)(null); | ||
let closeCallback = (0, $w0mn6$react.useRef)(close); | ||
@@ -46,3 +46,3 @@ let ensureTooltipEntry = ()=>{ | ||
let showTooltip = ()=>{ | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
closeTimeout.current = null; | ||
@@ -64,3 +64,3 @@ closeOpenTooltips(); | ||
if (immediate || closeDelay <= 0) { | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
closeTimeout.current = null; | ||
@@ -102,3 +102,3 @@ closeCallback.current(); | ||
return ()=>{ | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
let tooltip = $3391baedd777a697$var$tooltips[id]; | ||
@@ -105,0 +105,0 @@ if (tooltip) delete $3391baedd777a697$var$tooltips[id]; |
@@ -27,3 +27,3 @@ import {useMemo as $50cCT$useMemo, useRef as $50cCT$useRef, useEffect as $50cCT$useEffect} from "react"; | ||
let id = (0, $50cCT$useMemo)(()=>`${++$8796f90736e175cb$var$tooltipId}`, []); | ||
let closeTimeout = (0, $50cCT$useRef)(undefined); | ||
let closeTimeout = (0, $50cCT$useRef)(null); | ||
let closeCallback = (0, $50cCT$useRef)(close); | ||
@@ -40,3 +40,3 @@ let ensureTooltipEntry = ()=>{ | ||
let showTooltip = ()=>{ | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
closeTimeout.current = null; | ||
@@ -58,3 +58,3 @@ closeOpenTooltips(); | ||
if (immediate || closeDelay <= 0) { | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
closeTimeout.current = null; | ||
@@ -96,3 +96,3 @@ closeCallback.current(); | ||
return ()=>{ | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) clearTimeout(closeTimeout.current); | ||
let tooltip = $8796f90736e175cb$var$tooltips[id]; | ||
@@ -99,0 +99,0 @@ if (tooltip) delete $8796f90736e175cb$var$tooltips[id]; |
{ | ||
"name": "@react-stately/tooltip", | ||
"version": "3.0.0-nightly-fb28ab3b4-241024", | ||
"version": "3.0.0-nightly-fee532d6a-241217", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,13 +25,12 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-stately/overlays": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-types/tooltip": "^3.0.0-nightly-fb28ab3b4-241024", | ||
"@react-stately/overlays": "3.0.0-nightly-fee532d6a-241217", | ||
"@react-types/tooltip": "3.0.0-nightly-fee532d6a-241217", | ||
"@swc/helpers": "^0.5.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" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.4.13" | ||
} | ||
} |
@@ -36,4 +36,4 @@ /* | ||
let globalWarmedUp = false; | ||
let globalWarmUpTimeout = null; | ||
let globalCooldownTimeout = null; | ||
let globalWarmUpTimeout: ReturnType<typeof setTimeout> | null = null; | ||
let globalCooldownTimeout: ReturnType<typeof setTimeout> | null = null; | ||
@@ -49,3 +49,3 @@ /** | ||
let id = useMemo(() => `${++tooltipId}`, []); | ||
let closeTimeout = useRef<ReturnType<typeof setTimeout>>(undefined); | ||
let closeTimeout = useRef<ReturnType<typeof setTimeout> | null>(null); | ||
let closeCallback = useRef<() => void>(close); | ||
@@ -67,3 +67,5 @@ | ||
let showTooltip = () => { | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) { | ||
clearTimeout(closeTimeout.current); | ||
} | ||
closeTimeout.current = null; | ||
@@ -86,3 +88,5 @@ closeOpenTooltips(); | ||
if (immediate || closeDelay <= 0) { | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) { | ||
clearTimeout(closeTimeout.current); | ||
} | ||
closeTimeout.current = null; | ||
@@ -131,6 +135,8 @@ closeCallback.current(); | ||
useEffect(() => { | ||
return () => { | ||
clearTimeout(closeTimeout.current); | ||
if (closeTimeout.current) { | ||
clearTimeout(closeTimeout.current); | ||
} | ||
let tooltip = tooltips[id]; | ||
@@ -137,0 +143,0 @@ if (tooltip) { |
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
42572
547
+ Added@react-stately/overlays@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-stately/utils@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/overlays@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/shared@3.0.0-nightly-fee532d6a-241217(transitive)
+ Added@react-types/tooltip@3.0.0-nightly-fee532d6a-241217(transitive)
- Removed@react-stately/overlays@3.6.13(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/overlays@3.8.12(transitive)
- Removed@react-types/shared@3.27.0(transitive)
- Removed@react-types/tooltip@3.4.14(transitive)
Updated@react-stately/overlays@3.0.0-nightly-fee532d6a-241217