@sanity/ui 3.0.14 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks-cjs/_visual-editing.js +6 -6
- package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
- package/dist/_chunks-es/_visual-editing.mjs +6 -6
- package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/package.json +2 -2
- package/src/core/hooks/useGlobalKeyDown.ts +11 -4
|
@@ -2194,18 +2194,18 @@ function useElementSize(element) {
|
|
|
2194
2194
|
return _elementSizeObserver.subscribe(element, setSize);
|
|
2195
2195
|
}, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), react.useEffect(t0, t1), size2;
|
|
2196
2196
|
}
|
|
2197
|
-
function useGlobalKeyDown(onKeyDown) {
|
|
2198
|
-
const $ = reactCompilerRuntime.c(
|
|
2197
|
+
function useGlobalKeyDown(onKeyDown, options) {
|
|
2198
|
+
const $ = reactCompilerRuntime.c(7);
|
|
2199
2199
|
let t0;
|
|
2200
2200
|
$[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
|
|
2201
2201
|
const handleKeyDown = useEffectEvent.useEffectEvent(t0);
|
|
2202
2202
|
let t1;
|
|
2203
|
-
$[2] !== handleKeyDown ? (t1 = () => {
|
|
2203
|
+
$[2] !== handleKeyDown || $[3] !== options ? (t1 = () => {
|
|
2204
2204
|
const handler = (event_0) => handleKeyDown(event_0);
|
|
2205
|
-
return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
|
|
2206
|
-
}, $[2] = handleKeyDown, $[3] = t1) : t1 = $[
|
|
2205
|
+
return window.addEventListener("keydown", handler, options), () => window.removeEventListener("keydown", handler, options);
|
|
2206
|
+
}, $[2] = handleKeyDown, $[3] = options, $[4] = t1) : t1 = $[4];
|
|
2207
2207
|
let t2;
|
|
2208
|
-
$[
|
|
2208
|
+
$[5] !== options ? (t2 = [options], $[5] = options, $[6] = t2) : t2 = $[6], react.useEffect(t1, t2);
|
|
2209
2209
|
}
|
|
2210
2210
|
function useMatchMedia(mediaQueryString, getServerSnapshot2) {
|
|
2211
2211
|
const $ = reactCompilerRuntime.c(4);
|