@react-aria/interactions 3.0.0-nightly.2519 → 3.0.0-nightly.2534

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/import.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import {mergeProps as $bx7SL$mergeProps, useSyncRef as $bx7SL$useSyncRef, useGlobalListeners as $bx7SL$useGlobalListeners, useEffectEvent as $bx7SL$useEffectEvent, getOwnerDocument as $bx7SL$getOwnerDocument, isMac as $bx7SL$isMac, openLink as $bx7SL$openLink, isVirtualClick as $bx7SL$isVirtualClick, focusWithoutScrolling as $bx7SL$focusWithoutScrolling, isVirtualPointerEvent as $bx7SL$isVirtualPointerEvent, getOwnerWindow as $bx7SL$getOwnerWindow, isIOS as $bx7SL$isIOS, runAfterTransition as $bx7SL$runAfterTransition, useLayoutEffect as $bx7SL$useLayoutEffect, useEvent as $bx7SL$useEvent, useDescription as $bx7SL$useDescription} from "@react-aria/utils";
2
- import $bx7SL$react, {useRef as $bx7SL$useRef, useContext as $bx7SL$useContext, useState as $bx7SL$useState, useMemo as $bx7SL$useMemo, useEffect as $bx7SL$useEffect, useCallback as $bx7SL$useCallback} from "react";
1
+ import {useObjectRef as $bx7SL$useObjectRef, mergeProps as $bx7SL$mergeProps, useSyncRef as $bx7SL$useSyncRef, useGlobalListeners as $bx7SL$useGlobalListeners, useEffectEvent as $bx7SL$useEffectEvent, getOwnerDocument as $bx7SL$getOwnerDocument, isMac as $bx7SL$isMac, openLink as $bx7SL$openLink, isVirtualClick as $bx7SL$isVirtualClick, focusWithoutScrolling as $bx7SL$focusWithoutScrolling, isVirtualPointerEvent as $bx7SL$isVirtualPointerEvent, getOwnerWindow as $bx7SL$getOwnerWindow, isIOS as $bx7SL$isIOS, runAfterTransition as $bx7SL$runAfterTransition, useLayoutEffect as $bx7SL$useLayoutEffect, useEvent as $bx7SL$useEvent, useDescription as $bx7SL$useDescription} from "@react-aria/utils";
2
+ import $bx7SL$react, {useContext as $bx7SL$useContext, useState as $bx7SL$useState, useRef as $bx7SL$useRef, useMemo as $bx7SL$useMemo, useEffect as $bx7SL$useEffect, useCallback as $bx7SL$useCallback} from "react";
3
3
  import {_ as $bx7SL$_} from "@swc/helpers/_/_class_private_field_get";
4
4
  import {_ as $bx7SL$_1} from "@swc/helpers/_/_class_private_field_init";
5
5
  import {_ as $bx7SL$_2} from "@swc/helpers/_/_class_private_field_set";
@@ -62,6 +62,7 @@ let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
62
62
  function $14c0b72509d70225$export$16a4697467175487(target) {
63
63
  if ((0, $bx7SL$isIOS)()) {
64
64
  if ($14c0b72509d70225$var$state === "default") {
65
+ // eslint-disable-next-line no-restricted-globals
65
66
  const documentObject = (0, $bx7SL$getOwnerDocument)(target);
66
67
  $14c0b72509d70225$var$savedUserSelect = documentObject.documentElement.style.webkitUserSelect;
67
68
  documentObject.documentElement.style.webkitUserSelect = "none";
@@ -88,6 +89,7 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
88
89
  (0, $bx7SL$runAfterTransition)(()=>{
89
90
  // Avoid race conditions
90
91
  if ($14c0b72509d70225$var$state === "restoring") {
92
+ // eslint-disable-next-line no-restricted-globals
91
93
  const documentObject = (0, $bx7SL$getOwnerDocument)(target);
92
94
  if (documentObject.documentElement.style.webkitUserSelect === "none") documentObject.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || "";
93
95
  $14c0b72509d70225$var$savedUserSelect = "";
@@ -100,7 +102,7 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
100
102
  {
101
103
  if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
102
104
  let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
103
- if (target.style.userSelect === "none") target.style.userSelect = targetOldUserSelect;
105
+ if (target.style.userSelect === "none" && targetOldUserSelect) target.style.userSelect = targetOldUserSelect;
104
106
  if (target.getAttribute("style") === "") target.removeAttribute("style");
105
107
  $14c0b72509d70225$var$modifiedElementMap.delete(target);
106
108
  }
@@ -120,7 +122,9 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
120
122
  * OF ANY KIND, either express or implied. See the License for the specific language
121
123
  * governing permissions and limitations under the License.
122
124
  */
123
- const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = (0, $bx7SL$react).createContext(null);
125
+ const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = (0, $bx7SL$react).createContext({
126
+ register: ()=>{}
127
+ });
124
128
  $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = "PressResponderContext";
125
129
 
126
130
 
@@ -178,7 +182,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
178
182
  let { addGlobalListener: addGlobalListener, removeAllGlobalListeners: removeAllGlobalListeners } = (0, $bx7SL$useGlobalListeners)();
179
183
  let triggerPressStart = (0, $bx7SL$useEffectEvent)((originalEvent, pointerType)=>{
180
184
  let state = ref.current;
181
- if (isDisabled || state.didFirePressStart) return;
185
+ if (isDisabled || state.didFirePressStart) return false;
182
186
  let shouldStopPropagation = true;
183
187
  state.isTriggeringEvent = true;
184
188
  if (onPressStart) {
@@ -194,7 +198,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
194
198
  });
195
199
  let triggerPressEnd = (0, $bx7SL$useEffectEvent)((originalEvent, pointerType, wasPressed = true)=>{
196
200
  let state = ref.current;
197
- if (!state.didFirePressStart) return;
201
+ if (!state.didFirePressStart) return false;
198
202
  state.ignoreClickAfterPress = true;
199
203
  state.didFirePressStart = false;
200
204
  state.isTriggeringEvent = true;
@@ -216,7 +220,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
216
220
  });
217
221
  let triggerPressUp = (0, $bx7SL$useEffectEvent)((originalEvent, pointerType)=>{
218
222
  let state = ref.current;
219
- if (isDisabled) return;
223
+ if (isDisabled) return false;
220
224
  if (onPressUp) {
221
225
  state.isTriggeringEvent = true;
222
226
  let event = new $f6c31cce2adf654f$var$PressEvent("pressup", pointerType, originalEvent);
@@ -228,8 +232,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
228
232
  });
229
233
  let cancel = (0, $bx7SL$useEffectEvent)((e)=>{
230
234
  let state = ref.current;
231
- if (state.isPressed) {
232
- if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
235
+ if (state.isPressed && state.target) {
236
+ if (state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
233
237
  state.isPressed = false;
234
238
  state.isOverTarget = false;
235
239
  state.activePointerId = null;
@@ -246,6 +250,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
246
250
  let pressProps = {
247
251
  onKeyDown (e) {
248
252
  if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && e.currentTarget.contains(e.target)) {
253
+ var _state_metaKeyEvents;
249
254
  if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
250
255
  // If the event is repeating, it may have started on a different element
251
256
  // after which focus moved to the current element. Ignore these events and
@@ -267,11 +272,11 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
267
272
  // https://bugs.chromium.org/p/chromium/issues/detail?id=1393524
268
273
  // https://bugs.webkit.org/show_bug.cgi?id=55291
269
274
  // https://bugzilla.mozilla.org/show_bug.cgi?id=1299553
270
- if (e.metaKey && (0, $bx7SL$isMac)()) state.metaKeyEvents.set(e.key, e.nativeEvent);
275
+ if (e.metaKey && (0, $bx7SL$isMac)()) (_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.set(e.key, e.nativeEvent);
271
276
  } else if (e.key === "Meta") state.metaKeyEvents = new Map();
272
277
  },
273
278
  onKeyUp (e) {
274
- if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
279
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && !e.repeat && e.currentTarget.contains(e.target) && state.target) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
275
280
  },
276
281
  onClick (e) {
277
282
  if (e && !e.currentTarget.contains(e.target)) return;
@@ -296,7 +301,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
296
301
  };
297
302
  let onKeyUp = (e)=>{
298
303
  var _state_metaKeyEvents;
299
- if (state.isPressed && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
304
+ if (state.isPressed && state.target && $f6c31cce2adf654f$var$isValidKeyboardEvent(e, state.target)) {
300
305
  var _state_metaKeyEvents1;
301
306
  if ($f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(e.target, e.key)) e.preventDefault();
302
307
  let target = e.target;
@@ -315,12 +320,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
315
320
  state.isPressed = false;
316
321
  (_state_metaKeyEvents1 = state.metaKeyEvents) === null || _state_metaKeyEvents1 === void 0 ? void 0 : _state_metaKeyEvents1.delete(e.key);
317
322
  } else if (e.key === "Meta" && ((_state_metaKeyEvents = state.metaKeyEvents) === null || _state_metaKeyEvents === void 0 ? void 0 : _state_metaKeyEvents.size)) {
323
+ var _state_target;
318
324
  // If we recorded keydown events that occurred while the Meta key was pressed,
319
325
  // and those haven't received keyup events already, fire keyup events ourselves.
320
326
  // See comment above for more info about the macOS bug causing this.
321
327
  let events = state.metaKeyEvents;
322
- state.metaKeyEvents = null;
323
- for (let event of events.values())state.target.dispatchEvent(new KeyboardEvent("keyup", event));
328
+ state.metaKeyEvents = undefined;
329
+ for (let event of events.values())(_state_target = state.target) === null || _state_target === void 0 ? void 0 : _state_target.dispatchEvent(new KeyboardEvent("keyup", event));
324
330
  }
325
331
  };
326
332
  if (typeof PointerEvent !== "undefined") {
@@ -377,21 +383,21 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
377
383
  // See https://bugs.webkit.org/show_bug.cgi?id=199803
378
384
  let onPointerMove = (e)=>{
379
385
  if (e.pointerId !== state.activePointerId) return;
380
- if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) {
381
- if (!state.isOverTarget) {
386
+ if (state.target && $f6c31cce2adf654f$var$isOverTarget(e, state.target)) {
387
+ if (!state.isOverTarget && state.pointerType != null) {
382
388
  state.isOverTarget = true;
383
389
  triggerPressStart($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
384
390
  }
385
- } else if (state.isOverTarget) {
391
+ } else if (state.target && state.isOverTarget && state.pointerType != null) {
386
392
  state.isOverTarget = false;
387
393
  triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
388
394
  cancelOnPointerExit(e);
389
395
  }
390
396
  };
391
397
  let onPointerUp = (e)=>{
392
- if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0) {
393
- if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
394
- else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
398
+ if (e.pointerId === state.activePointerId && state.isPressed && e.button === 0 && state.target) {
399
+ if ($f6c31cce2adf654f$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
400
+ else if (state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
395
401
  state.isPressed = false;
396
402
  state.isOverTarget = false;
397
403
  state.activePointerId = null;
@@ -431,7 +437,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
431
437
  pressProps.onMouseEnter = (e)=>{
432
438
  if (!e.currentTarget.contains(e.target)) return;
433
439
  let shouldStopPropagation = true;
434
- if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
440
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
435
441
  state.isOverTarget = true;
436
442
  shouldStopPropagation = triggerPressStart(e, state.pointerType);
437
443
  }
@@ -440,7 +446,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
440
446
  pressProps.onMouseLeave = (e)=>{
441
447
  if (!e.currentTarget.contains(e.target)) return;
442
448
  let shouldStopPropagation = true;
443
- if (state.isPressed && !state.ignoreEmulatedMouseEvents) {
449
+ if (state.isPressed && !state.ignoreEmulatedMouseEvents && state.pointerType != null) {
444
450
  state.isOverTarget = false;
445
451
  shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
446
452
  cancelOnPointerExit(e);
@@ -460,8 +466,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
460
466
  state.ignoreEmulatedMouseEvents = false;
461
467
  return;
462
468
  }
463
- if ($f6c31cce2adf654f$var$isOverTarget(e, state.target)) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
464
- else if (state.isOverTarget) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
469
+ if (state.target && $f6c31cce2adf654f$var$isOverTarget(e, state.target) && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType);
470
+ else if (state.target && state.isOverTarget && state.pointerType != null) triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), state.pointerType, false);
465
471
  state.isOverTarget = false;
466
472
  };
467
473
  pressProps.onTouchStart = (e)=>{
@@ -491,11 +497,11 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
491
497
  let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
492
498
  let shouldStopPropagation = true;
493
499
  if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
494
- if (!state.isOverTarget) {
500
+ if (!state.isOverTarget && state.pointerType != null) {
495
501
  state.isOverTarget = true;
496
502
  shouldStopPropagation = triggerPressStart(e, state.pointerType);
497
503
  }
498
- } else if (state.isOverTarget) {
504
+ } else if (state.isOverTarget && state.pointerType != null) {
499
505
  state.isOverTarget = false;
500
506
  shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
501
507
  cancelOnPointerExit(e);
@@ -510,16 +516,16 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
510
516
  }
511
517
  let touch = $f6c31cce2adf654f$var$getTouchById(e.nativeEvent, state.activePointerId);
512
518
  let shouldStopPropagation = true;
513
- if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget)) {
519
+ if (touch && $f6c31cce2adf654f$var$isOverTarget(touch, e.currentTarget) && state.pointerType != null) {
514
520
  triggerPressUp(e, state.pointerType);
515
521
  shouldStopPropagation = triggerPressEnd(e, state.pointerType);
516
- } else if (state.isOverTarget) shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
522
+ } else if (state.isOverTarget && state.pointerType != null) shouldStopPropagation = triggerPressEnd(e, state.pointerType, false);
517
523
  if (shouldStopPropagation) e.stopPropagation();
518
524
  state.isPressed = false;
519
525
  state.activePointerId = null;
520
526
  state.isOverTarget = false;
521
527
  state.ignoreEmulatedMouseEvents = true;
522
- if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
528
+ if (state.target && !allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
523
529
  removeAllGlobalListeners();
524
530
  };
525
531
  pressProps.onTouchCancel = (e)=>{
@@ -558,8 +564,9 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
558
564
  // eslint-disable-next-line arrow-body-style
559
565
  (0, $bx7SL$useEffect)(()=>{
560
566
  return ()=>{
567
+ var _ref_current_target;
561
568
  if (!allowTextSelectionOnPress) // eslint-disable-next-line react-hooks/exhaustive-deps
562
- (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(ref.current.target);
569
+ (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)((_ref_current_target = ref.current.target) !== null && _ref_current_target !== void 0 ? _ref_current_target : undefined);
563
570
  };
564
571
  }, [
565
572
  allowTextSelectionOnPress
@@ -604,8 +611,12 @@ function $f6c31cce2adf654f$var$createEvent(target, e) {
604
611
  };
605
612
  }
606
613
  function $f6c31cce2adf654f$var$getPointClientRect(point) {
607
- let offsetX = point.width / 2 || point.radiusX || 0;
608
- let offsetY = point.height / 2 || point.radiusY || 0;
614
+ let offsetX = 0;
615
+ let offsetY = 0;
616
+ if (point.width !== undefined) offsetX = point.width / 2;
617
+ else if (point.radiusX !== undefined) offsetX = point.radiusX;
618
+ if (point.height !== undefined) offsetY = point.height / 2;
619
+ else if (point.radiusY !== undefined) offsetY = point.radiusY;
609
620
  return {
610
621
  top: point.clientY - offsetY,
611
622
  right: point.clientX + offsetX,
@@ -654,8 +665,7 @@ function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
654
665
 
655
666
 
656
667
  const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (0, $bx7SL$react).forwardRef(({ children: children, ...props }, ref)=>{
657
- let newRef = (0, $bx7SL$useRef)();
658
- ref = ref !== null && ref !== void 0 ? ref : newRef;
668
+ ref = (0, $bx7SL$useObjectRef)(ref);
659
669
  let { pressProps: pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
660
670
  ...props,
661
671
  ref: ref
@@ -685,9 +695,10 @@ const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (0, $bx7SL$react
685
695
  const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (0, $bx7SL$react).forwardRef(({ children: children, ...props }, ref)=>{
686
696
  let isRegistered = (0, $bx7SL$useRef)(false);
687
697
  let prevContext = (0, $bx7SL$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
698
+ ref = (0, $bx7SL$useObjectRef)(ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref));
688
699
  let context = (0, $bx7SL$mergeProps)(prevContext || {}, {
689
700
  ...props,
690
- ref: ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref),
701
+ ref: ref,
691
702
  register () {
692
703
  isRegistered.current = true;
693
704
  if (prevContext) prevContext.register();
@@ -705,8 +716,11 @@ const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (0, $bx7SL$react
705
716
  }, children);
706
717
  });
707
718
  function $f1ab8c75478c6f73$export$cf75428e0b9ed1ea({ children: children }) {
719
+ let context = (0, $bx7SL$useMemo)(()=>({
720
+ register: ()=>{}
721
+ }), []);
708
722
  return /*#__PURE__*/ (0, $bx7SL$react).createElement((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5).Provider, {
709
- value: undefined
723
+ value: context
710
724
  }, children);
711
725
  }
712
726
 
@@ -811,7 +825,8 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
811
825
  });
812
826
  stateRef.current.observer = new MutationObserver(()=>{
813
827
  if (stateRef.current.isFocused && target.disabled) {
814
- stateRef.current.observer.disconnect();
828
+ var _stateRef_current_observer;
829
+ (_stateRef_current_observer = stateRef.current.observer) === null || _stateRef_current_observer === void 0 ? void 0 : _stateRef_current_observer.disconnect();
815
830
  let relatedTargetEl = target === document.activeElement ? null : document.activeElement;
816
831
  target.dispatchEvent(new FocusEvent("blur", {
817
832
  relatedTarget: relatedTargetEl
@@ -1029,7 +1044,7 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
1029
1044
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
1030
1045
  (0, $bx7SL$useEffect)(()=>{
1031
1046
  let handler = (modality, e)=>{
1032
- if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(opts === null || opts === void 0 ? void 0 : opts.isTextInput, modality, e)) return;
1047
+ if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(!!(opts === null || opts === void 0 ? void 0 : opts.isTextInput), modality, e)) return;
1033
1048
  fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
1034
1049
  };
1035
1050
  $507fabe10e71c6fb$var$changeHandlers.add(handler);
@@ -1093,8 +1108,9 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
1093
1108
  ]);
1094
1109
  if (isDisabled) return {
1095
1110
  focusWithinProps: {
1096
- onFocus: null,
1097
- onBlur: null
1111
+ // These should not have been null, that would conflict in mergeProps
1112
+ onFocus: undefined,
1113
+ onBlur: undefined
1098
1114
  }
1099
1115
  };
1100
1116
  return {
@@ -1349,7 +1365,7 @@ function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
1349
1365
  * OF ANY KIND, either express or implied. See the License for the specific language
1350
1366
  * governing permissions and limitations under the License.
1351
1367
  */ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
1352
- if (!handler) return;
1368
+ if (!handler) return undefined;
1353
1369
  let shouldStopPropagation = true;
1354
1370
  return (e)=>{
1355
1371
  let event = {
@@ -1417,7 +1433,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1417
1433
  altKey: originalEvent.altKey
1418
1434
  });
1419
1435
  }
1420
- onMove({
1436
+ onMove === null || onMove === void 0 ? void 0 : onMove({
1421
1437
  type: "move",
1422
1438
  pointerType: pointerType,
1423
1439
  deltaX: deltaX,
@@ -1448,7 +1464,9 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1448
1464
  if (typeof PointerEvent === "undefined") {
1449
1465
  let onMouseMove = (e)=>{
1450
1466
  if (e.button === 0) {
1451
- move(e, "mouse", e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);
1467
+ var _state_current_lastPosition, _state_current_lastPosition1;
1468
+ var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
1469
+ move(e, "mouse", e.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
1452
1470
  state.current.lastPosition = {
1453
1471
  pageX: e.pageX,
1454
1472
  pageY: e.pageY
@@ -1480,8 +1498,10 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1480
1498
  ...e.changedTouches
1481
1499
  ].findIndex(({ identifier: identifier })=>identifier === state.current.id);
1482
1500
  if (touch >= 0) {
1501
+ var _state_current_lastPosition, _state_current_lastPosition1;
1483
1502
  let { pageX: pageX, pageY: pageY } = e.changedTouches[touch];
1484
- move(e, "touch", pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);
1503
+ var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
1504
+ move(e, "touch", pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
1485
1505
  state.current.lastPosition = {
1486
1506
  pageX: pageX,
1487
1507
  pageY: pageY
@@ -1518,11 +1538,13 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1518
1538
  } else {
1519
1539
  let onPointerMove = (e)=>{
1520
1540
  if (e.pointerId === state.current.id) {
1541
+ var _state_current_lastPosition, _state_current_lastPosition1;
1521
1542
  let pointerType = e.pointerType || "mouse";
1543
+ var _state_current_lastPosition_pageX, _state_current_lastPosition_pageY;
1522
1544
  // Problems with PointerEvent#movementX/movementY:
1523
1545
  // 1. it is always 0 on macOS Safari.
1524
1546
  // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS
1525
- move(e, pointerType, e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);
1547
+ move(e, pointerType, e.pageX - ((_state_current_lastPosition_pageX = (_state_current_lastPosition = state.current.lastPosition) === null || _state_current_lastPosition === void 0 ? void 0 : _state_current_lastPosition.pageX) !== null && _state_current_lastPosition_pageX !== void 0 ? _state_current_lastPosition_pageX : 0), e.pageY - ((_state_current_lastPosition_pageY = (_state_current_lastPosition1 = state.current.lastPosition) === null || _state_current_lastPosition1 === void 0 ? void 0 : _state_current_lastPosition1.pageY) !== null && _state_current_lastPosition_pageY !== void 0 ? _state_current_lastPosition_pageY : 0));
1526
1548
  state.current.lastPosition = {
1527
1549
  pageX: e.pageX,
1528
1550
  pageY: e.pageY
@@ -1630,7 +1652,7 @@ function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
1630
1652
  }, [
1631
1653
  onScroll
1632
1654
  ]);
1633
- (0, $bx7SL$useEvent)(ref, "wheel", isDisabled ? null : onScrollHandler);
1655
+ (0, $bx7SL$useEvent)(ref, "wheel", isDisabled ? undefined : onScrollHandler);
1634
1656
  }
1635
1657
 
1636
1658
 
@@ -1650,7 +1672,7 @@ function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
1650
1672
  const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
1651
1673
  function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
1652
1674
  let { isDisabled: isDisabled, onLongPressStart: onLongPressStart, onLongPressEnd: onLongPressEnd, onLongPress: onLongPress, threshold: threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD, accessibilityDescription: accessibilityDescription } = props;
1653
- const timeRef = (0, $bx7SL$useRef)(null);
1675
+ const timeRef = (0, $bx7SL$useRef)();
1654
1676
  let { addGlobalListener: addGlobalListener, removeGlobalListener: removeGlobalListener } = (0, $bx7SL$useGlobalListeners)();
1655
1677
  let { pressProps: pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
1656
1678
  isDisabled: isDisabled,
@@ -1670,7 +1692,7 @@ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
1670
1692
  ...e,
1671
1693
  type: "longpress"
1672
1694
  });
1673
- timeRef.current = null;
1695
+ timeRef.current = undefined;
1674
1696
  }, threshold);
1675
1697
  // Prevent context menu, which may be opened on long press on touch devices
1676
1698
  if (e.pointerType === "touch") {
@@ -1700,7 +1722,7 @@ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
1700
1722
  });
1701
1723
  }
1702
1724
  });
1703
- let descriptionProps = (0, $bx7SL$useDescription)(onLongPress && !isDisabled ? accessibilityDescription : null);
1725
+ let descriptionProps = (0, $bx7SL$useDescription)(onLongPress && !isDisabled ? accessibilityDescription : undefined);
1704
1726
  return {
1705
1727
  longPressProps: (0, $bx7SL$mergeProps)(pressProps, descriptionProps)
1706
1728
  };