@react-aria/grid
Advanced tools
Comparing version 3.0.0-nightly-7eae25e12-241205 to 3.0.0-nightly-801ef48a8-250207
var $085250522aa37816$exports = require("./intlStrings.main.js"); | ||
var $iMOYA$reactarialiveannouncer = require("@react-aria/live-announcer"); | ||
var $iMOYA$reactariautils = require("@react-aria/utils"); | ||
var $iMOYA$reactariai18n = require("@react-aria/i18n"); | ||
var $iMOYA$react = require("react"); | ||
var $iMOYA$reactariautils = require("@react-aria/utils"); | ||
@@ -43,5 +43,5 @@ | ||
let lastSelection = (0, $iMOYA$react.useRef)(selection); | ||
(0, $iMOYA$reactariautils.useUpdateEffect)(()=>{ | ||
let announceSelectionChange = (0, $iMOYA$reactariautils.useEffectEvent)(()=>{ | ||
var _lastSelection_current; | ||
if (!state.selectionManager.isFocused) { | ||
if (!state.selectionManager.isFocused || selection === lastSelection.current) { | ||
lastSelection.current = selection; | ||
@@ -83,4 +83,13 @@ return; | ||
lastSelection.current = selection; | ||
}); | ||
(0, $iMOYA$reactariautils.useUpdateEffect)(()=>{ | ||
if (state.selectionManager.isFocused) announceSelectionChange(); | ||
else { | ||
// Wait a frame in case the collection is about to become focused (e.g. on mouse down). | ||
let raf = requestAnimationFrame(announceSelectionChange); | ||
return ()=>cancelAnimationFrame(raf); | ||
} | ||
}, [ | ||
selection | ||
selection, | ||
state.selectionManager.isFocused | ||
]); | ||
@@ -87,0 +96,0 @@ } |
import $4stjr$intlStringsmodulejs from "./intlStrings.module.js"; | ||
import {announce as $4stjr$announce} from "@react-aria/live-announcer"; | ||
import {useEffectEvent as $4stjr$useEffectEvent, useUpdateEffect as $4stjr$useUpdateEffect} from "@react-aria/utils"; | ||
import {useLocalizedStringFormatter as $4stjr$useLocalizedStringFormatter} from "@react-aria/i18n"; | ||
import {useRef as $4stjr$useRef} from "react"; | ||
import {useUpdateEffect as $4stjr$useUpdateEffect} from "@react-aria/utils"; | ||
@@ -37,5 +37,5 @@ | ||
let lastSelection = (0, $4stjr$useRef)(selection); | ||
(0, $4stjr$useUpdateEffect)(()=>{ | ||
let announceSelectionChange = (0, $4stjr$useEffectEvent)(()=>{ | ||
var _lastSelection_current; | ||
if (!state.selectionManager.isFocused) { | ||
if (!state.selectionManager.isFocused || selection === lastSelection.current) { | ||
lastSelection.current = selection; | ||
@@ -77,4 +77,13 @@ return; | ||
lastSelection.current = selection; | ||
}); | ||
(0, $4stjr$useUpdateEffect)(()=>{ | ||
if (state.selectionManager.isFocused) announceSelectionChange(); | ||
else { | ||
// Wait a frame in case the collection is about to become focused (e.g. on mouse down). | ||
let raf = requestAnimationFrame(announceSelectionChange); | ||
return ()=>cancelAnimationFrame(raf); | ||
} | ||
}, [ | ||
selection | ||
selection, | ||
state.selectionManager.isFocused | ||
]); | ||
@@ -81,0 +90,0 @@ } |
{ | ||
"name": "@react-aria/grid", | ||
"version": "3.0.0-nightly-7eae25e12-241205", | ||
"version": "3.0.0-nightly-801ef48a8-250207", | ||
"description": "Spectrum UI components in React", | ||
@@ -25,14 +25,14 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@react-aria/focus": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/i18n": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/interactions": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/live-announcer": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/selection": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/utils": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-stately/collections": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-stately/grid": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-stately/selection": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-types/checkbox": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-types/grid": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-types/shared": "^3.0.0-nightly-7eae25e12-241205", | ||
"@react-aria/focus": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-aria/i18n": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-aria/interactions": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-aria/live-announcer": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-aria/selection": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-aria/utils": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-stately/collections": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-stately/grid": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-stately/selection": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-types/checkbox": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-types/grid": "3.0.0-nightly-801ef48a8-250207", | ||
"@react-types/shared": "3.0.0-nightly-801ef48a8-250207", | ||
"@swc/helpers": "^0.5.0" | ||
@@ -46,4 +46,3 @@ }, | ||
"access": "public" | ||
}, | ||
"stableVersion": "3.11.0" | ||
} | ||
} |
@@ -18,5 +18,5 @@ /* | ||
import {SelectionManager} from '@react-stately/selection'; | ||
import {useEffectEvent, useUpdateEffect} from '@react-aria/utils'; | ||
import {useLocalizedStringFormatter} from '@react-aria/i18n'; | ||
import {useRef} from 'react'; | ||
import {useUpdateEffect} from '@react-aria/utils'; | ||
@@ -50,4 +50,4 @@ export interface GridSelectionAnnouncementProps { | ||
let lastSelection = useRef(selection); | ||
useUpdateEffect(() => { | ||
if (!state.selectionManager.isFocused) { | ||
let announceSelectionChange = useEffectEvent(() => { | ||
if (!state.selectionManager.isFocused || selection === lastSelection.current) { | ||
lastSelection.current = selection; | ||
@@ -101,3 +101,13 @@ | ||
lastSelection.current = selection; | ||
}, [selection]); | ||
}); | ||
useUpdateEffect(() => { | ||
if (state.selectionManager.isFocused) { | ||
announceSelectionChange(); | ||
} else { | ||
// Wait a frame in case the collection is about to become focused (e.g. on mouse down). | ||
let raf = requestAnimationFrame(announceSelectionChange); | ||
return () => cancelAnimationFrame(raf); | ||
} | ||
}, [selection, state.selectionManager.isFocused]); | ||
} | ||
@@ -104,0 +114,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
535351
5757
+ Added@internationalized/date@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@internationalized/message@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@internationalized/number@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@internationalized/string@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/focus@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/i18n@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/interactions@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/live-announcer@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/selection@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/ssr@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-aria/utils@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-stately/collections@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-stately/flags@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-stately/grid@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-stately/selection@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-stately/utils@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-types/checkbox@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-types/grid@3.0.0-nightly-801ef48a8-250207(transitive)
+ Added@react-types/shared@3.0.0-nightly-801ef48a8-250207(transitive)
- Removed@internationalized/date@3.7.0(transitive)
- Removed@internationalized/message@3.1.6(transitive)
- Removed@internationalized/number@3.6.0(transitive)
- Removed@internationalized/string@3.2.5(transitive)
- Removed@react-aria/focus@3.19.1(transitive)
- Removed@react-aria/i18n@3.12.5(transitive)
- Removed@react-aria/interactions@3.23.0(transitive)
- Removed@react-aria/live-announcer@3.4.1(transitive)
- Removed@react-aria/selection@3.22.0(transitive)
- Removed@react-aria/ssr@3.9.7(transitive)
- Removed@react-aria/utils@3.27.0(transitive)
- Removed@react-stately/collections@3.12.1(transitive)
- Removed@react-stately/grid@3.10.1(transitive)
- Removed@react-stately/selection@3.19.0(transitive)
- Removed@react-stately/utils@3.10.5(transitive)
- Removed@react-types/checkbox@3.9.1(transitive)
- Removed@react-types/grid@3.2.11(transitive)
- Removed@react-types/shared@3.27.0(transitive)
Updated@react-aria/interactions@3.0.0-nightly-801ef48a8-250207
Updated@react-aria/live-announcer@3.0.0-nightly-801ef48a8-250207
Updated@react-stately/collections@3.0.0-nightly-801ef48a8-250207
Updated@react-stately/selection@3.0.0-nightly-801ef48a8-250207