@react-aria/interactions 3.13.0 → 3.13.1

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/module.js CHANGED
@@ -1,44 +1,88 @@
1
1
  import {mergeProps as $bx7SL$mergeProps, useSyncRef as $bx7SL$useSyncRef, useGlobalListeners as $bx7SL$useGlobalListeners, isVirtualClick as $bx7SL$isVirtualClick, focusWithoutScrolling as $bx7SL$focusWithoutScrolling, isVirtualPointerEvent as $bx7SL$isVirtualPointerEvent, isIOS as $bx7SL$isIOS, runAfterTransition as $bx7SL$runAfterTransition, useLayoutEffect as $bx7SL$useLayoutEffect, isMac as $bx7SL$isMac, useEvent as $bx7SL$useEvent, useDescription as $bx7SL$useDescription} from "@react-aria/utils";
2
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";
3
3
 
4
-
5
-
4
+ /*
5
+ * Copyright 2020 Adobe. All rights reserved.
6
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License. You may obtain a copy
8
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
9
+ *
10
+ * Unless required by applicable law or agreed to in writing, software distributed under
11
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
12
+ * OF ANY KIND, either express or implied. See the License for the specific language
13
+ * governing permissions and limitations under the License.
14
+ */ /*
15
+ * Copyright 2020 Adobe. All rights reserved.
16
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
17
+ * you may not use this file except in compliance with the License. You may obtain a copy
18
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
19
+ *
20
+ * Unless required by applicable law or agreed to in writing, software distributed under
21
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
22
+ * OF ANY KIND, either express or implied. See the License for the specific language
23
+ * governing permissions and limitations under the License.
24
+ */
25
+ /*
26
+ * Copyright 2020 Adobe. All rights reserved.
27
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
28
+ * you may not use this file except in compliance with the License. You may obtain a copy
29
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
30
+ *
31
+ * Unless required by applicable law or agreed to in writing, software distributed under
32
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
33
+ * OF ANY KIND, either express or implied. See the License for the specific language
34
+ * governing permissions and limitations under the License.
35
+ */ // Portions of the code in this file are based on code from react.
36
+ // Original licensing for the following can be found in the
37
+ // NOTICE file in the root directory of this source tree.
38
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
39
+ /*
40
+ * Copyright 2020 Adobe. All rights reserved.
41
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
42
+ * you may not use this file except in compliance with the License. You may obtain a copy
43
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
44
+ *
45
+ * Unless required by applicable law or agreed to in writing, software distributed under
46
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
47
+ * OF ANY KIND, either express or implied. See the License for the specific language
48
+ * governing permissions and limitations under the License.
49
+ */
6
50
  // Note that state only matters here for iOS. Non-iOS gets user-select: none applied to the target element
7
51
  // rather than at the document level so we just need to apply/remove user-select: none for each pressed element individually
8
- let $14c0b72509d70225$var$state = 'default';
9
- let $14c0b72509d70225$var$savedUserSelect = '';
52
+ let $14c0b72509d70225$var$state = "default";
53
+ let $14c0b72509d70225$var$savedUserSelect = "";
10
54
  let $14c0b72509d70225$var$modifiedElementMap = new WeakMap();
11
55
  function $14c0b72509d70225$export$16a4697467175487(target) {
12
- if ($bx7SL$isIOS()) {
13
- if ($14c0b72509d70225$var$state === 'default') {
56
+ if ((0, $bx7SL$isIOS)()) {
57
+ if ($14c0b72509d70225$var$state === "default") {
14
58
  $14c0b72509d70225$var$savedUserSelect = document.documentElement.style.webkitUserSelect;
15
- document.documentElement.style.webkitUserSelect = 'none';
59
+ document.documentElement.style.webkitUserSelect = "none";
16
60
  }
17
- $14c0b72509d70225$var$state = 'disabled';
61
+ $14c0b72509d70225$var$state = "disabled";
18
62
  } else if (target instanceof HTMLElement || target instanceof SVGElement) {
19
63
  // If not iOS, store the target's original user-select and change to user-select: none
20
64
  // Ignore state since it doesn't apply for non iOS
21
65
  $14c0b72509d70225$var$modifiedElementMap.set(target, target.style.userSelect);
22
- target.style.userSelect = 'none';
66
+ target.style.userSelect = "none";
23
67
  }
24
68
  }
25
69
  function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
26
- if ($bx7SL$isIOS()) {
70
+ if ((0, $bx7SL$isIOS)()) {
27
71
  // If the state is already default, there's nothing to do.
28
72
  // If it is restoring, then there's no need to queue a second restore.
29
- if ($14c0b72509d70225$var$state !== 'disabled') return;
30
- $14c0b72509d70225$var$state = 'restoring';
73
+ if ($14c0b72509d70225$var$state !== "disabled") return;
74
+ $14c0b72509d70225$var$state = "restoring";
31
75
  // There appears to be a delay on iOS where selection still might occur
32
76
  // after pointer up, so wait a bit before removing user-select.
33
77
  setTimeout(()=>{
34
78
  // Wait for any CSS transitions to complete so we don't recompute style
35
79
  // for the whole page in the middle of the animation and cause jank.
36
- $bx7SL$runAfterTransition(()=>{
80
+ (0, $bx7SL$runAfterTransition)(()=>{
37
81
  // Avoid race conditions
38
- if ($14c0b72509d70225$var$state === 'restoring') {
39
- if (document.documentElement.style.webkitUserSelect === 'none') document.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || '';
40
- $14c0b72509d70225$var$savedUserSelect = '';
41
- $14c0b72509d70225$var$state = 'default';
82
+ if ($14c0b72509d70225$var$state === "restoring") {
83
+ if (document.documentElement.style.webkitUserSelect === "none") document.documentElement.style.webkitUserSelect = $14c0b72509d70225$var$savedUserSelect || "";
84
+ $14c0b72509d70225$var$savedUserSelect = "";
85
+ $14c0b72509d70225$var$state = "default";
42
86
  }
43
87
  });
44
88
  }, 300);
@@ -47,8 +91,8 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
47
91
  {
48
92
  if (target && $14c0b72509d70225$var$modifiedElementMap.has(target)) {
49
93
  let targetOldUserSelect = $14c0b72509d70225$var$modifiedElementMap.get(target);
50
- if (target.style.userSelect === 'none') target.style.userSelect = targetOldUserSelect;
51
- if (target.getAttribute('style') === '') target.removeAttribute('style');
94
+ if (target.style.userSelect === "none") target.style.userSelect = targetOldUserSelect;
95
+ if (target.getAttribute("style") === "") target.removeAttribute("style");
52
96
  $14c0b72509d70225$var$modifiedElementMap.delete(target);
53
97
  }
54
98
  }
@@ -56,38 +100,48 @@ function $14c0b72509d70225$export$b0d6fa1ab32e3295(target) {
56
100
 
57
101
 
58
102
 
59
-
60
- const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = $bx7SL$react.createContext(null);
61
- $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = 'PressResponderContext';
103
+ /*
104
+ * Copyright 2020 Adobe. All rights reserved.
105
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
106
+ * you may not use this file except in compliance with the License. You may obtain a copy
107
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
108
+ *
109
+ * Unless required by applicable law or agreed to in writing, software distributed under
110
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
111
+ * OF ANY KIND, either express or implied. See the License for the specific language
112
+ * governing permissions and limitations under the License.
113
+ */
114
+ const $ae1eeba8b9eafd08$export$5165eccb35aaadb5 = (0, $bx7SL$react).createContext(null);
115
+ $ae1eeba8b9eafd08$export$5165eccb35aaadb5.displayName = "PressResponderContext";
62
116
 
63
117
 
64
118
 
65
119
  function $f6c31cce2adf654f$var$usePressResponderContext(props) {
66
120
  // Consume context from <PressResponder> and merge with props.
67
- let context = $bx7SL$useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
121
+ let context = (0, $bx7SL$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
68
122
  if (context) {
69
123
  let { register: register , ...contextProps } = context;
70
- props = $bx7SL$mergeProps(contextProps, props);
124
+ props = (0, $bx7SL$mergeProps)(contextProps, props);
71
125
  register();
72
126
  }
73
- $bx7SL$useSyncRef(context, props.ref);
127
+ (0, $bx7SL$useSyncRef)(context, props.ref);
74
128
  return props;
75
129
  }
76
130
  function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
77
- let { onPress: onPress1 , onPressChange: onPressChange1 , onPressStart: onPressStart1 , onPressEnd: onPressEnd1 , onPressUp: onPressUp1 , isDisabled: isDisabled1 , isPressed: isPressedProp , preventFocusOnPress: preventFocusOnPress , shouldCancelOnPointerExit: shouldCancelOnPointerExit , allowTextSelectionOnPress: allowTextSelectionOnPress , // eslint-disable-next-line @typescript-eslint/no-unused-vars
131
+ let { onPress: onPress , onPressChange: onPressChange , onPressStart: onPressStart , onPressEnd: onPressEnd , onPressUp: onPressUp , isDisabled: isDisabled , isPressed: isPressedProp , preventFocusOnPress: preventFocusOnPress , shouldCancelOnPointerExit: shouldCancelOnPointerExit , allowTextSelectionOnPress: allowTextSelectionOnPress , // eslint-disable-next-line @typescript-eslint/no-unused-vars
78
132
  ref: _ , ...domProps } = $f6c31cce2adf654f$var$usePressResponderContext(props);
79
- let propsRef = $bx7SL$useRef(null);
133
+ let propsRef = (0, $bx7SL$useRef)(null);
80
134
  propsRef.current = {
81
- onPress: onPress1,
82
- onPressChange: onPressChange1,
83
- onPressStart: onPressStart1,
84
- onPressEnd: onPressEnd1,
85
- onPressUp: onPressUp1,
86
- isDisabled: isDisabled1,
135
+ onPress: onPress,
136
+ onPressChange: onPressChange,
137
+ onPressStart: onPressStart,
138
+ onPressEnd: onPressEnd,
139
+ onPressUp: onPressUp,
140
+ isDisabled: isDisabled,
87
141
  shouldCancelOnPointerExit: shouldCancelOnPointerExit
88
142
  };
89
- let [isPressed, setPressed] = $bx7SL$useState(false);
90
- let ref = $bx7SL$useRef({
143
+ let [isPressed, setPressed] = (0, $bx7SL$useState)(false);
144
+ let ref = (0, $bx7SL$useRef)({
91
145
  isPressed: false,
92
146
  ignoreEmulatedMouseEvents: false,
93
147
  ignoreClickAfterPress: false,
@@ -97,14 +151,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
97
151
  isOverTarget: false,
98
152
  pointerType: null
99
153
  });
100
- let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = $bx7SL$useGlobalListeners();
101
- let pressProps1 = $bx7SL$useMemo(()=>{
154
+ let { addGlobalListener: addGlobalListener , removeAllGlobalListeners: removeAllGlobalListeners } = (0, $bx7SL$useGlobalListeners)();
155
+ let pressProps = (0, $bx7SL$useMemo)(()=>{
102
156
  let state = ref.current;
103
157
  let triggerPressStart = (originalEvent, pointerType)=>{
104
158
  let { onPressStart: onPressStart , onPressChange: onPressChange , isDisabled: isDisabled } = propsRef.current;
105
159
  if (isDisabled || state.didFirePressStart) return;
106
160
  if (onPressStart) onPressStart({
107
- type: 'pressstart',
161
+ type: "pressstart",
108
162
  pointerType: pointerType,
109
163
  target: originalEvent.currentTarget,
110
164
  shiftKey: originalEvent.shiftKey,
@@ -122,7 +176,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
122
176
  state.ignoreClickAfterPress = true;
123
177
  state.didFirePressStart = false;
124
178
  if (onPressEnd) onPressEnd({
125
- type: 'pressend',
179
+ type: "pressend",
126
180
  pointerType: pointerType,
127
181
  target: originalEvent.currentTarget,
128
182
  shiftKey: originalEvent.shiftKey,
@@ -133,7 +187,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
133
187
  if (onPressChange) onPressChange(false);
134
188
  setPressed(false);
135
189
  if (onPress && wasPressed && !isDisabled) onPress({
136
- type: 'press',
190
+ type: "press",
137
191
  pointerType: pointerType,
138
192
  target: originalEvent.currentTarget,
139
193
  shiftKey: originalEvent.shiftKey,
@@ -146,7 +200,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
146
200
  let { onPressUp: onPressUp , isDisabled: isDisabled } = propsRef.current;
147
201
  if (isDisabled) return;
148
202
  if (onPressUp) onPressUp({
149
- type: 'pressup',
203
+ type: "pressup",
150
204
  pointerType: pointerType,
151
205
  target: originalEvent.currentTarget,
152
206
  shiftKey: originalEvent.shiftKey,
@@ -163,7 +217,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
163
217
  state.activePointerId = null;
164
218
  state.pointerType = null;
165
219
  removeAllGlobalListeners();
166
- if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
220
+ if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
167
221
  }
168
222
  };
169
223
  let pressProps = {
@@ -177,32 +231,32 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
177
231
  if (!state.isPressed && !e.repeat) {
178
232
  state.target = e.currentTarget;
179
233
  state.isPressed = true;
180
- triggerPressStart(e, 'keyboard');
234
+ triggerPressStart(e, "keyboard");
181
235
  // Focus may move before the key up event, so register the event on the document
182
236
  // instead of the same element where the key down event occurred.
183
- addGlobalListener(document, 'keyup', onKeyUp, false);
237
+ addGlobalListener(document, "keyup", onKeyUp, false);
184
238
  }
185
- } else if (e.key === 'Enter' && $f6c31cce2adf654f$var$isHTMLAnchorLink(e.currentTarget)) // If the target is a link, we won't have handled this above because we want the default
239
+ } else if (e.key === "Enter" && $f6c31cce2adf654f$var$isHTMLAnchorLink(e.currentTarget)) // If the target is a link, we won't have handled this above because we want the default
186
240
  // browser behavior to open the link when pressing Enter. But we still need to prevent
187
241
  // default so that elements above do not also handle it (e.g. table row).
188
242
  e.stopPropagation();
189
243
  },
190
244
  onKeyUp (e) {
191
- if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard');
245
+ if ($f6c31cce2adf654f$var$isValidKeyboardEvent(e.nativeEvent, e.currentTarget) && !e.repeat && e.currentTarget.contains(e.target)) triggerPressUp($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard");
192
246
  },
193
247
  onClick (e) {
194
248
  if (e && !e.currentTarget.contains(e.target)) return;
195
249
  if (e && e.button === 0) {
196
250
  e.stopPropagation();
197
- if (isDisabled1) e.preventDefault();
251
+ if (isDisabled) e.preventDefault();
198
252
  // If triggered from a screen reader or by using element.click(),
199
253
  // trigger as if it were a keyboard click.
200
- if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === 'virtual' || $bx7SL$isVirtualClick(e.nativeEvent))) {
254
+ if (!state.ignoreClickAfterPress && !state.ignoreEmulatedMouseEvents && (state.pointerType === "virtual" || (0, $bx7SL$isVirtualClick)(e.nativeEvent))) {
201
255
  // Ensure the element receives focus (VoiceOver on iOS does not do this)
202
- if (!isDisabled1 && !preventFocusOnPress) $bx7SL$focusWithoutScrolling(e.currentTarget);
203
- triggerPressStart(e, 'virtual');
204
- triggerPressUp(e, 'virtual');
205
- triggerPressEnd(e, 'virtual');
256
+ if (!isDisabled && !preventFocusOnPress) (0, $bx7SL$focusWithoutScrolling)(e.currentTarget);
257
+ triggerPressStart(e, "virtual");
258
+ triggerPressUp(e, "virtual");
259
+ triggerPressEnd(e, "virtual");
206
260
  }
207
261
  state.ignoreEmulatedMouseEvents = false;
208
262
  state.ignoreClickAfterPress = false;
@@ -215,14 +269,14 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
215
269
  e.stopPropagation();
216
270
  state.isPressed = false;
217
271
  let target = e.target;
218
- triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), 'keyboard', state.target.contains(target));
272
+ triggerPressEnd($f6c31cce2adf654f$var$createEvent(state.target, e), "keyboard", state.target.contains(target));
219
273
  removeAllGlobalListeners();
220
274
  // If the target is a link, trigger the click method to open the URL,
221
275
  // but defer triggering pressEnd until onClick event handler.
222
- if (state.target instanceof HTMLElement && state.target.contains(target) && ($f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) || state.target.getAttribute('role') === 'link')) state.target.click();
276
+ if (state.target instanceof HTMLElement && state.target.contains(target) && ($f6c31cce2adf654f$var$isHTMLAnchorLink(state.target) || state.target.getAttribute("role") === "link")) state.target.click();
223
277
  }
224
278
  };
225
- if (typeof PointerEvent !== 'undefined') {
279
+ if (typeof PointerEvent !== "undefined") {
226
280
  pressProps.onPointerDown = (e)=>{
227
281
  // Only handle left clicks, and ignore events that bubbled through portals.
228
282
  if (e.button !== 0 || !e.currentTarget.contains(e.target)) return;
@@ -230,8 +284,8 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
230
284
  // Ignore and let the onClick handler take care of it instead.
231
285
  // https://bugs.webkit.org/show_bug.cgi?id=222627
232
286
  // https://bugs.webkit.org/show_bug.cgi?id=223202
233
- if ($bx7SL$isVirtualPointerEvent(e.nativeEvent)) {
234
- state.pointerType = 'virtual';
287
+ if ((0, $bx7SL$isVirtualPointerEvent)(e.nativeEvent)) {
288
+ state.pointerType = "virtual";
235
289
  return;
236
290
  }
237
291
  // Due to browser inconsistencies, especially on mobile browsers, we prevent
@@ -244,12 +298,12 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
244
298
  state.isOverTarget = true;
245
299
  state.activePointerId = e.pointerId;
246
300
  state.target = e.currentTarget;
247
- if (!isDisabled1 && !preventFocusOnPress) $bx7SL$focusWithoutScrolling(e.currentTarget);
248
- if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
301
+ if (!isDisabled && !preventFocusOnPress) (0, $bx7SL$focusWithoutScrolling)(e.currentTarget);
302
+ if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
249
303
  triggerPressStart(e, state.pointerType);
250
- addGlobalListener(document, 'pointermove', onPointerMove, false);
251
- addGlobalListener(document, 'pointerup', onPointerUp, false);
252
- addGlobalListener(document, 'pointercancel', onPointerCancel, false);
304
+ addGlobalListener(document, "pointermove", onPointerMove, false);
305
+ addGlobalListener(document, "pointerup", onPointerUp, false);
306
+ addGlobalListener(document, "pointercancel", onPointerCancel, false);
253
307
  }
254
308
  };
255
309
  pressProps.onMouseDown = (e)=>{
@@ -264,7 +318,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
264
318
  };
265
319
  pressProps.onPointerUp = (e)=>{
266
320
  // iOS fires pointerup with zero width and height, so check the pointerType recorded during pointerdown.
267
- if (!e.currentTarget.contains(e.target) || state.pointerType === 'virtual') return;
321
+ if (!e.currentTarget.contains(e.target) || state.pointerType === "virtual") return;
268
322
  // Only handle left clicks
269
323
  // Safari on iOS sometimes fires pointerup events, even
270
324
  // when the touch isn't over the target, so double check.
@@ -295,7 +349,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
295
349
  state.activePointerId = null;
296
350
  state.pointerType = null;
297
351
  removeAllGlobalListeners();
298
- if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
352
+ if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
299
353
  }
300
354
  };
301
355
  let onPointerCancel = (e)=>{
@@ -318,10 +372,10 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
318
372
  state.isPressed = true;
319
373
  state.isOverTarget = true;
320
374
  state.target = e.currentTarget;
321
- state.pointerType = $bx7SL$isVirtualClick(e.nativeEvent) ? 'virtual' : 'mouse';
322
- if (!isDisabled1 && !preventFocusOnPress) $bx7SL$focusWithoutScrolling(e.currentTarget);
375
+ state.pointerType = (0, $bx7SL$isVirtualClick)(e.nativeEvent) ? "virtual" : "mouse";
376
+ if (!isDisabled && !preventFocusOnPress) (0, $bx7SL$focusWithoutScrolling)(e.currentTarget);
323
377
  triggerPressStart(e, state.pointerType);
324
- addGlobalListener(document, 'mouseup', onMouseUp, false);
378
+ addGlobalListener(document, "mouseup", onMouseUp, false);
325
379
  };
326
380
  pressProps.onMouseEnter = (e)=>{
327
381
  if (!e.currentTarget.contains(e.target)) return;
@@ -367,13 +421,13 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
367
421
  state.isOverTarget = true;
368
422
  state.isPressed = true;
369
423
  state.target = e.currentTarget;
370
- state.pointerType = 'touch';
424
+ state.pointerType = "touch";
371
425
  // Due to browser inconsistencies, especially on mobile browsers, we prevent default
372
426
  // on the emulated mouse event and handle focusing the pressable element ourselves.
373
- if (!isDisabled1 && !preventFocusOnPress) $bx7SL$focusWithoutScrolling(e.currentTarget);
374
- if (!allowTextSelectionOnPress) $14c0b72509d70225$export$16a4697467175487(state.target);
427
+ if (!isDisabled && !preventFocusOnPress) (0, $bx7SL$focusWithoutScrolling)(e.currentTarget);
428
+ if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$16a4697467175487)(state.target);
375
429
  triggerPressStart(e, state.pointerType);
376
- addGlobalListener(window, 'scroll', onScroll, true);
430
+ addGlobalListener(window, "scroll", onScroll, true);
377
431
  };
378
432
  pressProps.onTouchMove = (e)=>{
379
433
  if (!e.currentTarget.contains(e.target)) return;
@@ -404,7 +458,7 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
404
458
  state.activePointerId = null;
405
459
  state.isOverTarget = false;
406
460
  state.ignoreEmulatedMouseEvents = true;
407
- if (!allowTextSelectionOnPress) $14c0b72509d70225$export$b0d6fa1ab32e3295(state.target);
461
+ if (!allowTextSelectionOnPress) (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(state.target);
408
462
  removeAllGlobalListeners();
409
463
  };
410
464
  pressProps.onTouchCancel = (e)=>{
@@ -429,37 +483,39 @@ function $f6c31cce2adf654f$export$45712eceda6fad21(props) {
429
483
  return pressProps;
430
484
  }, [
431
485
  addGlobalListener,
432
- isDisabled1,
486
+ isDisabled,
433
487
  preventFocusOnPress,
434
488
  removeAllGlobalListeners,
435
489
  allowTextSelectionOnPress
436
490
  ]);
437
491
  // Remove user-select: none in case component unmounts immediately after pressStart
438
492
  // eslint-disable-next-line arrow-body-style
439
- $bx7SL$useEffect(()=>{
493
+ (0, $bx7SL$useEffect)(()=>{
440
494
  return ()=>{
441
495
  if (!allowTextSelectionOnPress) // eslint-disable-next-line react-hooks/exhaustive-deps
442
- $14c0b72509d70225$export$b0d6fa1ab32e3295(ref.current.target);
496
+ (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)(ref.current.target);
443
497
  };
444
498
  }, [
445
499
  allowTextSelectionOnPress
446
500
  ]);
447
501
  return {
448
502
  isPressed: isPressedProp || isPressed,
449
- pressProps: $bx7SL$mergeProps(domProps, pressProps1)
503
+ pressProps: (0, $bx7SL$mergeProps)(domProps, pressProps)
450
504
  };
451
505
  }
452
506
  function $f6c31cce2adf654f$var$isHTMLAnchorLink(target) {
453
- return target.tagName === 'A' && target.hasAttribute('href');
507
+ return target.tagName === "A" && target.hasAttribute("href");
454
508
  }
455
509
  function $f6c31cce2adf654f$var$isValidKeyboardEvent(event, currentTarget) {
456
510
  const { key: key , code: code } = event;
457
511
  const element = currentTarget;
458
- const role = element.getAttribute('role');
512
+ const role = element.getAttribute("role");
459
513
  // Accessibility for keyboards. Space and Enter only.
460
514
  // "Spacebar" is for IE 11
461
- return (key === 'Enter' || key === ' ' || key === 'Spacebar' || code === 'Space') && !(element instanceof HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof HTMLTextAreaElement || element.isContentEditable) && (!$f6c31cce2adf654f$var$isHTMLAnchorLink(element) || role === 'button' && key !== 'Enter') && // An element with role='link' should only trigger with Enter key
462
- !(role === 'link' && key !== 'Enter');
515
+ return (key === "Enter" || key === " " || key === "Spacebar" || code === "Space") && !(element instanceof HTMLInputElement && !$f6c31cce2adf654f$var$isValidInputKey(element, key) || element instanceof HTMLTextAreaElement || element.isContentEditable) && // A link with a valid href should be handled natively,
516
+ // unless it also has role='button' and was triggered using Space.
517
+ (!$f6c31cce2adf654f$var$isHTMLAnchorLink(element) || role === "button" && key !== "Enter") && // An element with role='link' should only trigger with Enter key
518
+ !(role === "link" && key !== "Enter");
463
519
  }
464
520
  function $f6c31cce2adf654f$var$getTouchFromEvent(event) {
465
521
  const { targetTouches: targetTouches } = event;
@@ -511,51 +567,60 @@ function $f6c31cce2adf654f$var$shouldPreventDefault(target) {
511
567
  }
512
568
  function $f6c31cce2adf654f$var$shouldPreventDefaultKeyboard(target, key) {
513
569
  if (target instanceof HTMLInputElement) return !$f6c31cce2adf654f$var$isValidInputKey(target, key);
514
- if (target instanceof HTMLButtonElement) return target.type !== 'submit';
570
+ if (target instanceof HTMLButtonElement) return target.type !== "submit";
515
571
  return true;
516
572
  }
517
573
  const $f6c31cce2adf654f$var$nonTextInputTypes = new Set([
518
- 'checkbox',
519
- 'radio',
520
- 'range',
521
- 'color',
522
- 'file',
523
- 'image',
524
- 'button',
525
- 'submit',
526
- 'reset'
574
+ "checkbox",
575
+ "radio",
576
+ "range",
577
+ "color",
578
+ "file",
579
+ "image",
580
+ "button",
581
+ "submit",
582
+ "reset"
527
583
  ]);
528
584
  function $f6c31cce2adf654f$var$isValidInputKey(target, key) {
529
585
  // Only space should toggle checkboxes and radios, not enter.
530
- return target.type === 'checkbox' || target.type === 'radio' ? key === ' ' : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
586
+ return target.type === "checkbox" || target.type === "radio" ? key === " " : $f6c31cce2adf654f$var$nonTextInputTypes.has(target.type);
531
587
  }
532
588
 
533
589
 
534
590
 
535
- const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ $bx7SL$react.forwardRef(({ children: children , ...props }, ref)=>{
536
- let newRef = $bx7SL$useRef();
591
+ const $3b117e43dc0ca95d$export$27c701ed9e449e99 = /*#__PURE__*/ (0, $bx7SL$react).forwardRef(({ children: children , ...props }, ref)=>{
592
+ let newRef = (0, $bx7SL$useRef)();
537
593
  ref = ref !== null && ref !== void 0 ? ref : newRef;
538
- let { pressProps: pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
594
+ let { pressProps: pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
539
595
  ...props,
540
596
  ref: ref
541
597
  });
542
- let child = $bx7SL$react.Children.only(children);
543
- return(/*#__PURE__*/ $bx7SL$react.cloneElement(child, // @ts-ignore
598
+ let child = (0, $bx7SL$react).Children.only(children);
599
+ return /*#__PURE__*/ (0, $bx7SL$react).cloneElement(child, // @ts-ignore
544
600
  {
545
601
  ref: ref,
546
- ...$bx7SL$mergeProps(child.props, pressProps)
547
- }));
602
+ ...(0, $bx7SL$mergeProps)(child.props, pressProps)
603
+ });
548
604
  });
549
605
 
550
606
 
607
+ /*
608
+ * Copyright 2020 Adobe. All rights reserved.
609
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
610
+ * you may not use this file except in compliance with the License. You may obtain a copy
611
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
612
+ *
613
+ * Unless required by applicable law or agreed to in writing, software distributed under
614
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
615
+ * OF ANY KIND, either express or implied. See the License for the specific language
616
+ * governing permissions and limitations under the License.
617
+ */
551
618
 
552
619
 
553
-
554
- const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ $bx7SL$react.forwardRef(({ children: children , ...props }, ref)=>{
555
- let isRegistered = $bx7SL$useRef(false);
556
- let prevContext = $bx7SL$useContext($ae1eeba8b9eafd08$export$5165eccb35aaadb5);
557
- let context = $bx7SL$mergeProps(prevContext || {
558
- }, {
620
+ const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ (0, $bx7SL$react).forwardRef(({ children: children , ...props }, ref)=>{
621
+ let isRegistered = (0, $bx7SL$useRef)(false);
622
+ let prevContext = (0, $bx7SL$useContext)((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5));
623
+ let context = (0, $bx7SL$mergeProps)(prevContext || {}, {
559
624
  ...props,
560
625
  ref: ref || (prevContext === null || prevContext === void 0 ? void 0 : prevContext.ref),
561
626
  register () {
@@ -563,18 +628,42 @@ const $f1ab8c75478c6f73$export$3351871ee4b288b8 = /*#__PURE__*/ $bx7SL$react.for
563
628
  if (prevContext) prevContext.register();
564
629
  }
565
630
  });
566
- $bx7SL$useSyncRef(prevContext, ref);
567
- $bx7SL$useEffect(()=>{
631
+ (0, $bx7SL$useSyncRef)(prevContext, ref);
632
+ (0, $bx7SL$useEffect)(()=>{
568
633
  if (!isRegistered.current) console.warn("A PressResponder was rendered without a pressable child. Either call the usePress hook, or wrap your DOM node with <Pressable> component.");
569
634
  }, []);
570
- return(/*#__PURE__*/ $bx7SL$react.createElement($ae1eeba8b9eafd08$export$5165eccb35aaadb5.Provider, {
635
+ return /*#__PURE__*/ (0, $bx7SL$react).createElement((0, $ae1eeba8b9eafd08$export$5165eccb35aaadb5).Provider, {
571
636
  value: context
572
- }, children));
637
+ }, children);
573
638
  });
574
639
 
575
640
 
641
+ /*
642
+ * Copyright 2020 Adobe. All rights reserved.
643
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
644
+ * you may not use this file except in compliance with the License. You may obtain a copy
645
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
646
+ *
647
+ * Unless required by applicable law or agreed to in writing, software distributed under
648
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
649
+ * OF ANY KIND, either express or implied. See the License for the specific language
650
+ * governing permissions and limitations under the License.
651
+ */ // Portions of the code in this file are based on code from react.
652
+ // Original licensing for the following can be found in the
653
+ // NOTICE file in the root directory of this source tree.
654
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
576
655
 
577
-
656
+ /*
657
+ * Copyright 2020 Adobe. All rights reserved.
658
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
659
+ * you may not use this file except in compliance with the License. You may obtain a copy
660
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
661
+ *
662
+ * Unless required by applicable law or agreed to in writing, software distributed under
663
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
664
+ * OF ANY KIND, either express or implied. See the License for the specific language
665
+ * governing permissions and limitations under the License.
666
+ */
578
667
 
579
668
  class $8a9cb279dc87e130$export$905e7fc544a71f36 {
580
669
  isDefaultPrevented() {
@@ -586,14 +675,12 @@ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
586
675
  }
587
676
  stopPropagation() {
588
677
  this.nativeEvent.stopPropagation();
589
- this.isPropagationStopped = ()=>true
590
- ;
678
+ this.isPropagationStopped = ()=>true;
591
679
  }
592
680
  isPropagationStopped() {
593
681
  return false;
594
682
  }
595
- persist() {
596
- }
683
+ persist() {}
597
684
  constructor(type, nativeEvent){
598
685
  this.nativeEvent = nativeEvent;
599
686
  this.target = nativeEvent.target;
@@ -609,7 +696,7 @@ class $8a9cb279dc87e130$export$905e7fc544a71f36 {
609
696
  }
610
697
  }
611
698
  function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
612
- let stateRef = $bx7SL$useRef({
699
+ let stateRef = (0, $bx7SL$useRef)({
613
700
  isFocused: false,
614
701
  onBlur: onBlur,
615
702
  observer: null
@@ -617,7 +704,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
617
704
  stateRef.current.onBlur = onBlur;
618
705
  // Clean up MutationObserver on unmount. See below.
619
706
  // eslint-disable-next-line arrow-body-style
620
- $bx7SL$useLayoutEffect(()=>{
707
+ (0, $bx7SL$useLayoutEffect)(()=>{
621
708
  const state = stateRef.current;
622
709
  return ()=>{
623
710
  if (state.observer) {
@@ -627,33 +714,33 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
627
714
  };
628
715
  }, []);
629
716
  // This function is called during a React onFocus event.
630
- return $bx7SL$useCallback((e1)=>{
717
+ return (0, $bx7SL$useCallback)((e)=>{
631
718
  // React does not fire onBlur when an element is disabled. https://github.com/facebook/react/issues/9142
632
719
  // Most browsers fire a native focusout event in this case, except for Firefox. In that case, we use a
633
720
  // MutationObserver to watch for the disabled attribute, and dispatch these events ourselves.
634
721
  // For browsers that do, focusout fires before the MutationObserver, so onBlur should not fire twice.
635
- if (e1.target instanceof HTMLButtonElement || e1.target instanceof HTMLInputElement || e1.target instanceof HTMLTextAreaElement || e1.target instanceof HTMLSelectElement) {
722
+ if (e.target instanceof HTMLButtonElement || e.target instanceof HTMLInputElement || e.target instanceof HTMLTextAreaElement || e.target instanceof HTMLSelectElement) {
636
723
  stateRef.current.isFocused = true;
637
- let target = e1.target;
724
+ let target = e.target;
638
725
  let onBlurHandler = (e)=>{
639
726
  var // For backward compatibility, dispatch a (fake) React synthetic event.
640
- _current, ref;
727
+ _stateRef_current, _stateRef_current_onBlur;
641
728
  stateRef.current.isFocused = false;
642
- if (target.disabled) (ref = (_current = stateRef.current).onBlur) === null || ref === void 0 ? void 0 : ref.call(_current, new $8a9cb279dc87e130$export$905e7fc544a71f36('blur', e));
729
+ if (target.disabled) (_stateRef_current_onBlur = (_stateRef_current = stateRef.current).onBlur) === null || _stateRef_current_onBlur === void 0 ? void 0 : _stateRef_current_onBlur.call(_stateRef_current, new $8a9cb279dc87e130$export$905e7fc544a71f36("blur", e));
643
730
  // We no longer need the MutationObserver once the target is blurred.
644
731
  if (stateRef.current.observer) {
645
732
  stateRef.current.observer.disconnect();
646
733
  stateRef.current.observer = null;
647
734
  }
648
735
  };
649
- target.addEventListener('focusout', onBlurHandler, {
736
+ target.addEventListener("focusout", onBlurHandler, {
650
737
  once: true
651
738
  });
652
739
  stateRef.current.observer = new MutationObserver(()=>{
653
740
  if (stateRef.current.isFocused && target.disabled) {
654
741
  stateRef.current.observer.disconnect();
655
- target.dispatchEvent(new FocusEvent('blur'));
656
- target.dispatchEvent(new FocusEvent('focusout', {
742
+ target.dispatchEvent(new FocusEvent("blur"));
743
+ target.dispatchEvent(new FocusEvent("focusout", {
657
744
  bubbles: true
658
745
  }));
659
746
  }
@@ -661,7 +748,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
661
748
  stateRef.current.observer.observe(target, {
662
749
  attributes: true,
663
750
  attributeFilter: [
664
- 'disabled'
751
+ "disabled"
665
752
  ]
666
753
  });
667
754
  }
@@ -671,7 +758,7 @@ function $8a9cb279dc87e130$export$715c682d09d639cc(onBlur) {
671
758
 
672
759
  function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
673
760
  let { isDisabled: isDisabled , onFocus: onFocusProp , onBlur: onBlurProp , onFocusChange: onFocusChange } = props;
674
- const onBlur = $bx7SL$useCallback((e)=>{
761
+ const onBlur = (0, $bx7SL$useCallback)((e)=>{
675
762
  if (e.target === e.currentTarget) {
676
763
  if (onBlurProp) onBlurProp(e);
677
764
  if (onFocusChange) onFocusChange(false);
@@ -681,8 +768,8 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
681
768
  onBlurProp,
682
769
  onFocusChange
683
770
  ]);
684
- const onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
685
- const onFocus = $bx7SL$useCallback((e)=>{
771
+ const onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
772
+ const onFocus = (0, $bx7SL$useCallback)((e)=>{
686
773
  if (e.target === e.currentTarget) {
687
774
  if (onFocusProp) onFocusProp(e);
688
775
  if (onFocusChange) onFocusChange(true);
@@ -702,6 +789,20 @@ function $a1ea59d68270f0dd$export$f8168d8dd8fd66e6(props) {
702
789
  }
703
790
 
704
791
 
792
+ /*
793
+ * Copyright 2020 Adobe. All rights reserved.
794
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
795
+ * you may not use this file except in compliance with the License. You may obtain a copy
796
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
797
+ *
798
+ * Unless required by applicable law or agreed to in writing, software distributed under
799
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
800
+ * OF ANY KIND, either express or implied. See the License for the specific language
801
+ * governing permissions and limitations under the License.
802
+ */ // Portions of the code in this file are based on code from react.
803
+ // Original licensing for the following can be found in the
804
+ // NOTICE file in the root directory of this source tree.
805
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
705
806
 
706
807
 
707
808
  let $507fabe10e71c6fb$var$currentModality = null;
@@ -721,26 +822,26 @@ function $507fabe10e71c6fb$var$triggerChangeHandlers(modality, e) {
721
822
  * Helper function to determine if a KeyboardEvent is unmodified and could make keyboard focus styles visible.
722
823
  */ function $507fabe10e71c6fb$var$isValidKey(e) {
723
824
  // Control and Shift keys trigger when navigating back to the tab with keyboard.
724
- return !(e.metaKey || !$bx7SL$isMac() && e.altKey || e.ctrlKey || e.key === 'Control' || e.key === 'Shift' || e.key === 'Meta');
825
+ return !(e.metaKey || !(0, $bx7SL$isMac)() && e.altKey || e.ctrlKey || e.key === "Control" || e.key === "Shift" || e.key === "Meta");
725
826
  }
726
827
  function $507fabe10e71c6fb$var$handleKeyboardEvent(e) {
727
828
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
728
829
  if ($507fabe10e71c6fb$var$isValidKey(e)) {
729
- $507fabe10e71c6fb$var$currentModality = 'keyboard';
730
- $507fabe10e71c6fb$var$triggerChangeHandlers('keyboard', e);
830
+ $507fabe10e71c6fb$var$currentModality = "keyboard";
831
+ $507fabe10e71c6fb$var$triggerChangeHandlers("keyboard", e);
731
832
  }
732
833
  }
733
834
  function $507fabe10e71c6fb$var$handlePointerEvent(e) {
734
- $507fabe10e71c6fb$var$currentModality = 'pointer';
735
- if (e.type === 'mousedown' || e.type === 'pointerdown') {
835
+ $507fabe10e71c6fb$var$currentModality = "pointer";
836
+ if (e.type === "mousedown" || e.type === "pointerdown") {
736
837
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
737
- $507fabe10e71c6fb$var$triggerChangeHandlers('pointer', e);
838
+ $507fabe10e71c6fb$var$triggerChangeHandlers("pointer", e);
738
839
  }
739
840
  }
740
841
  function $507fabe10e71c6fb$var$handleClickEvent(e) {
741
- if ($bx7SL$isVirtualClick(e)) {
842
+ if ((0, $bx7SL$isVirtualClick)(e)) {
742
843
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
743
- $507fabe10e71c6fb$var$currentModality = 'virtual';
844
+ $507fabe10e71c6fb$var$currentModality = "virtual";
744
845
  }
745
846
  }
746
847
  function $507fabe10e71c6fb$var$handleFocusEvent(e) {
@@ -751,8 +852,8 @@ function $507fabe10e71c6fb$var$handleFocusEvent(e) {
751
852
  // If a focus event occurs without a preceding keyboard or pointer event, switch to virtual modality.
752
853
  // This occurs, for example, when navigating a form with the next/previous buttons on iOS.
753
854
  if (!$507fabe10e71c6fb$var$hasEventBeforeFocus && !$507fabe10e71c6fb$var$hasBlurredWindowRecently) {
754
- $507fabe10e71c6fb$var$currentModality = 'virtual';
755
- $507fabe10e71c6fb$var$triggerChangeHandlers('virtual', e);
855
+ $507fabe10e71c6fb$var$currentModality = "virtual";
856
+ $507fabe10e71c6fb$var$triggerChangeHandlers("virtual", e);
756
857
  }
757
858
  $507fabe10e71c6fb$var$hasEventBeforeFocus = false;
758
859
  $507fabe10e71c6fb$var$hasBlurredWindowRecently = false;
@@ -766,7 +867,7 @@ function $507fabe10e71c6fb$var$handleWindowBlur() {
766
867
  /**
767
868
  * Setup global event listeners to control when keyboard focus style should be visible.
768
869
  */ function $507fabe10e71c6fb$var$setupGlobalFocusEvents() {
769
- if (typeof window === 'undefined' || $507fabe10e71c6fb$var$hasSetupGlobalListeners) return;
870
+ if (typeof window === "undefined" || $507fabe10e71c6fb$var$hasSetupGlobalListeners) return;
770
871
  // Programmatic focus() calls shouldn't affect the current input modality.
771
872
  // However, we need to detect other cases when a focus event occurs without
772
873
  // a preceding user event (e.g. screen reader focus). Overriding the focus
@@ -776,30 +877,30 @@ function $507fabe10e71c6fb$var$handleWindowBlur() {
776
877
  $507fabe10e71c6fb$var$hasEventBeforeFocus = true;
777
878
  focus.apply(this, arguments);
778
879
  };
779
- document.addEventListener('keydown', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
780
- document.addEventListener('keyup', $507fabe10e71c6fb$var$handleKeyboardEvent, true);
781
- document.addEventListener('click', $507fabe10e71c6fb$var$handleClickEvent, true);
880
+ document.addEventListener("keydown", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
881
+ document.addEventListener("keyup", $507fabe10e71c6fb$var$handleKeyboardEvent, true);
882
+ document.addEventListener("click", $507fabe10e71c6fb$var$handleClickEvent, true);
782
883
  // Register focus events on the window so they are sure to happen
783
884
  // before React's event listeners (registered on the document).
784
- window.addEventListener('focus', $507fabe10e71c6fb$var$handleFocusEvent, true);
785
- window.addEventListener('blur', $507fabe10e71c6fb$var$handleWindowBlur, false);
786
- if (typeof PointerEvent !== 'undefined') {
787
- document.addEventListener('pointerdown', $507fabe10e71c6fb$var$handlePointerEvent, true);
788
- document.addEventListener('pointermove', $507fabe10e71c6fb$var$handlePointerEvent, true);
789
- document.addEventListener('pointerup', $507fabe10e71c6fb$var$handlePointerEvent, true);
885
+ window.addEventListener("focus", $507fabe10e71c6fb$var$handleFocusEvent, true);
886
+ window.addEventListener("blur", $507fabe10e71c6fb$var$handleWindowBlur, false);
887
+ if (typeof PointerEvent !== "undefined") {
888
+ document.addEventListener("pointerdown", $507fabe10e71c6fb$var$handlePointerEvent, true);
889
+ document.addEventListener("pointermove", $507fabe10e71c6fb$var$handlePointerEvent, true);
890
+ document.addEventListener("pointerup", $507fabe10e71c6fb$var$handlePointerEvent, true);
790
891
  } else {
791
- document.addEventListener('mousedown', $507fabe10e71c6fb$var$handlePointerEvent, true);
792
- document.addEventListener('mousemove', $507fabe10e71c6fb$var$handlePointerEvent, true);
793
- document.addEventListener('mouseup', $507fabe10e71c6fb$var$handlePointerEvent, true);
892
+ document.addEventListener("mousedown", $507fabe10e71c6fb$var$handlePointerEvent, true);
893
+ document.addEventListener("mousemove", $507fabe10e71c6fb$var$handlePointerEvent, true);
894
+ document.addEventListener("mouseup", $507fabe10e71c6fb$var$handlePointerEvent, true);
794
895
  }
795
896
  $507fabe10e71c6fb$var$hasSetupGlobalListeners = true;
796
897
  }
797
- if (typeof document !== 'undefined') {
798
- if (document.readyState !== 'loading') $507fabe10e71c6fb$var$setupGlobalFocusEvents();
799
- else document.addEventListener('DOMContentLoaded', $507fabe10e71c6fb$var$setupGlobalFocusEvents);
898
+ if (typeof document !== "undefined") {
899
+ if (document.readyState !== "loading") $507fabe10e71c6fb$var$setupGlobalFocusEvents();
900
+ else document.addEventListener("DOMContentLoaded", $507fabe10e71c6fb$var$setupGlobalFocusEvents);
800
901
  }
801
902
  function $507fabe10e71c6fb$export$b9b3dfddab17db27() {
802
- return $507fabe10e71c6fb$var$currentModality !== 'pointer';
903
+ return $507fabe10e71c6fb$var$currentModality !== "pointer";
803
904
  }
804
905
  function $507fabe10e71c6fb$export$630ff653c5ada6a9() {
805
906
  return $507fabe10e71c6fb$var$currentModality;
@@ -810,8 +911,8 @@ function $507fabe10e71c6fb$export$8397ddfc504fdb9a(modality) {
810
911
  }
811
912
  function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
812
913
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
813
- let [modality, setModality] = $bx7SL$useState($507fabe10e71c6fb$var$currentModality);
814
- $bx7SL$useEffect(()=>{
914
+ let [modality, setModality] = (0, $bx7SL$useState)($507fabe10e71c6fb$var$currentModality);
915
+ (0, $bx7SL$useEffect)(()=>{
815
916
  let handler = ()=>{
816
917
  setModality($507fabe10e71c6fb$var$currentModality);
817
918
  };
@@ -826,14 +927,13 @@ function $507fabe10e71c6fb$export$98e20ec92f614cfe() {
826
927
  * If this is attached to text input component, return if the event is a focus event (Tab/Escape keys pressed) so that
827
928
  * focus visible style can be properly set.
828
929
  */ function $507fabe10e71c6fb$var$isKeyboardFocusEvent(isTextInput, modality, e) {
829
- return !(isTextInput && modality === 'keyboard' && e instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
930
+ return !(isTextInput && modality === "keyboard" && e instanceof KeyboardEvent && !$507fabe10e71c6fb$var$FOCUS_VISIBLE_INPUT_KEYS[e.key]);
830
931
  }
831
- function $507fabe10e71c6fb$export$ffd9e5021c1fb2d6(props = {
832
- }) {
932
+ function $507fabe10e71c6fb$export$ffd9e5021c1fb2d6(props = {}) {
833
933
  let { isTextInput: isTextInput , autoFocus: autoFocus } = props;
834
- let [isFocusVisibleState, setFocusVisible] = $bx7SL$useState(autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27());
835
- $507fabe10e71c6fb$export$ec71b4b83ac08ec3(($507fabe10e71c6fb$export$b9b3dfddab17db27)=>{
836
- setFocusVisible($507fabe10e71c6fb$export$b9b3dfddab17db27);
934
+ let [isFocusVisibleState, setFocusVisible] = (0, $bx7SL$useState)(autoFocus || $507fabe10e71c6fb$export$b9b3dfddab17db27());
935
+ $507fabe10e71c6fb$export$ec71b4b83ac08ec3((isFocusVisible)=>{
936
+ setFocusVisible(isFocusVisible);
837
937
  }, [
838
938
  isTextInput
839
939
  ], {
@@ -845,7 +945,7 @@ function $507fabe10e71c6fb$export$ffd9e5021c1fb2d6(props = {
845
945
  }
846
946
  function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
847
947
  $507fabe10e71c6fb$var$setupGlobalFocusEvents();
848
- $bx7SL$useEffect(()=>{
948
+ (0, $bx7SL$useEffect)(()=>{
849
949
  let handler = (modality, e)=>{
850
950
  if (!$507fabe10e71c6fb$var$isKeyboardFocusEvent(opts === null || opts === void 0 ? void 0 : opts.isTextInput, modality, e)) return;
851
951
  fn($507fabe10e71c6fb$export$b9b3dfddab17db27());
@@ -859,14 +959,28 @@ function $507fabe10e71c6fb$export$ec71b4b83ac08ec3(fn, deps, opts) {
859
959
  }
860
960
 
861
961
 
962
+ /*
963
+ * Copyright 2020 Adobe. All rights reserved.
964
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
965
+ * you may not use this file except in compliance with the License. You may obtain a copy
966
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
967
+ *
968
+ * Unless required by applicable law or agreed to in writing, software distributed under
969
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
970
+ * OF ANY KIND, either express or implied. See the License for the specific language
971
+ * governing permissions and limitations under the License.
972
+ */ // Portions of the code in this file are based on code from react.
973
+ // Original licensing for the following can be found in the
974
+ // NOTICE file in the root directory of this source tree.
975
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
862
976
 
863
977
 
864
978
  function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
865
979
  let { isDisabled: isDisabled , onBlurWithin: onBlurWithin , onFocusWithin: onFocusWithin , onFocusWithinChange: onFocusWithinChange } = props;
866
- let state = $bx7SL$useRef({
980
+ let state = (0, $bx7SL$useRef)({
867
981
  isFocusWithin: false
868
982
  });
869
- let onBlur = $bx7SL$useCallback((e)=>{
983
+ let onBlur = (0, $bx7SL$useCallback)((e)=>{
870
984
  // We don't want to trigger onBlurWithin and then immediately onFocusWithin again
871
985
  // when moving focus inside the element. Only trigger if the currentTarget doesn't
872
986
  // include the relatedTarget (where focus is moving).
@@ -880,8 +994,8 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
880
994
  onFocusWithinChange,
881
995
  state
882
996
  ]);
883
- let onSyntheticFocus = $8a9cb279dc87e130$export$715c682d09d639cc(onBlur);
884
- let onFocus = $bx7SL$useCallback((e)=>{
997
+ let onSyntheticFocus = (0, $8a9cb279dc87e130$export$715c682d09d639cc)(onBlur);
998
+ let onFocus = (0, $bx7SL$useCallback)((e)=>{
885
999
  if (!state.current.isFocusWithin) {
886
1000
  if (onFocusWithin) onFocusWithin(e);
887
1001
  if (onFocusWithinChange) onFocusWithinChange(true);
@@ -908,6 +1022,20 @@ function $9ab94262bd0047c7$export$420e68273165f4ec(props) {
908
1022
  }
909
1023
 
910
1024
 
1025
+ /*
1026
+ * Copyright 2020 Adobe. All rights reserved.
1027
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1028
+ * you may not use this file except in compliance with the License. You may obtain a copy
1029
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1030
+ *
1031
+ * Unless required by applicable law or agreed to in writing, software distributed under
1032
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1033
+ * OF ANY KIND, either express or implied. See the License for the specific language
1034
+ * governing permissions and limitations under the License.
1035
+ */ // Portions of the code in this file are based on code from react.
1036
+ // Original licensing for the following can be found in the
1037
+ // NOTICE file in the root directory of this source tree.
1038
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
911
1039
 
912
1040
  // iOS fires onPointerEnter twice: once with pointerType="touch" and again with pointerType="mouse".
913
1041
  // We want to ignore these emulated events so they do not trigger hover behavior.
@@ -925,39 +1053,39 @@ function $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents() {
925
1053
  }, 50);
926
1054
  }
927
1055
  function $6179b936705e76d3$var$handleGlobalPointerEvent(e) {
928
- if (e.pointerType === 'touch') $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
1056
+ if (e.pointerType === "touch") $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents();
929
1057
  }
930
1058
  function $6179b936705e76d3$var$setupGlobalTouchEvents() {
931
- if (typeof document === 'undefined') return;
932
- if (typeof PointerEvent !== 'undefined') document.addEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
933
- else document.addEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
1059
+ if (typeof document === "undefined") return;
1060
+ if (typeof PointerEvent !== "undefined") document.addEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
1061
+ else document.addEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
934
1062
  $6179b936705e76d3$var$hoverCount++;
935
1063
  return ()=>{
936
1064
  $6179b936705e76d3$var$hoverCount--;
937
1065
  if ($6179b936705e76d3$var$hoverCount > 0) return;
938
- if (typeof PointerEvent !== 'undefined') document.removeEventListener('pointerup', $6179b936705e76d3$var$handleGlobalPointerEvent);
939
- else document.removeEventListener('touchend', $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
1066
+ if (typeof PointerEvent !== "undefined") document.removeEventListener("pointerup", $6179b936705e76d3$var$handleGlobalPointerEvent);
1067
+ else document.removeEventListener("touchend", $6179b936705e76d3$var$setGlobalIgnoreEmulatedMouseEvents);
940
1068
  };
941
1069
  }
942
1070
  function $6179b936705e76d3$export$ae780daf29e6d456(props) {
943
1071
  let { onHoverStart: onHoverStart , onHoverChange: onHoverChange , onHoverEnd: onHoverEnd , isDisabled: isDisabled } = props;
944
- let [isHovered, setHovered] = $bx7SL$useState(false);
945
- let state = $bx7SL$useRef({
1072
+ let [isHovered, setHovered] = (0, $bx7SL$useState)(false);
1073
+ let state = (0, $bx7SL$useRef)({
946
1074
  isHovered: false,
947
1075
  ignoreEmulatedMouseEvents: false,
948
- pointerType: '',
1076
+ pointerType: "",
949
1077
  target: null
950
1078
  }).current;
951
- $bx7SL$useEffect($6179b936705e76d3$var$setupGlobalTouchEvents, []);
952
- let { hoverProps: hoverProps1 , triggerHoverEnd: triggerHoverEnd1 } = $bx7SL$useMemo(()=>{
1079
+ (0, $bx7SL$useEffect)($6179b936705e76d3$var$setupGlobalTouchEvents, []);
1080
+ let { hoverProps: hoverProps , triggerHoverEnd: triggerHoverEnd } = (0, $bx7SL$useMemo)(()=>{
953
1081
  let triggerHoverStart = (event, pointerType)=>{
954
1082
  state.pointerType = pointerType;
955
- if (isDisabled || pointerType === 'touch' || state.isHovered || !event.currentTarget.contains(event.target)) return;
1083
+ if (isDisabled || pointerType === "touch" || state.isHovered || !event.currentTarget.contains(event.target)) return;
956
1084
  state.isHovered = true;
957
1085
  let target = event.currentTarget;
958
1086
  state.target = target;
959
1087
  if (onHoverStart) onHoverStart({
960
- type: 'hoverstart',
1088
+ type: "hoverstart",
961
1089
  target: target,
962
1090
  pointerType: pointerType
963
1091
  });
@@ -965,24 +1093,23 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
965
1093
  setHovered(true);
966
1094
  };
967
1095
  let triggerHoverEnd = (event, pointerType)=>{
968
- state.pointerType = '';
1096
+ state.pointerType = "";
969
1097
  state.target = null;
970
- if (pointerType === 'touch' || !state.isHovered) return;
1098
+ if (pointerType === "touch" || !state.isHovered) return;
971
1099
  state.isHovered = false;
972
1100
  let target = event.currentTarget;
973
1101
  if (onHoverEnd) onHoverEnd({
974
- type: 'hoverend',
1102
+ type: "hoverend",
975
1103
  target: target,
976
1104
  pointerType: pointerType
977
1105
  });
978
1106
  if (onHoverChange) onHoverChange(false);
979
1107
  setHovered(false);
980
1108
  };
981
- let hoverProps = {
982
- };
983
- if (typeof PointerEvent !== 'undefined') {
1109
+ let hoverProps = {};
1110
+ if (typeof PointerEvent !== "undefined") {
984
1111
  hoverProps.onPointerEnter = (e)=>{
985
- if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === 'mouse') return;
1112
+ if ($6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents && e.pointerType === "mouse") return;
986
1113
  triggerHoverStart(e, e.pointerType);
987
1114
  };
988
1115
  hoverProps.onPointerLeave = (e)=>{
@@ -993,11 +1120,11 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
993
1120
  state.ignoreEmulatedMouseEvents = true;
994
1121
  };
995
1122
  hoverProps.onMouseEnter = (e)=>{
996
- if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, 'mouse');
1123
+ if (!state.ignoreEmulatedMouseEvents && !$6179b936705e76d3$var$globalIgnoreEmulatedMouseEvents) triggerHoverStart(e, "mouse");
997
1124
  state.ignoreEmulatedMouseEvents = false;
998
1125
  };
999
1126
  hoverProps.onMouseLeave = (e)=>{
1000
- if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, 'mouse');
1127
+ if (!isDisabled && e.currentTarget.contains(e.target)) triggerHoverEnd(e, "mouse");
1001
1128
  };
1002
1129
  }
1003
1130
  return {
@@ -1011,10 +1138,10 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
1011
1138
  isDisabled,
1012
1139
  state
1013
1140
  ]);
1014
- $bx7SL$useEffect(()=>{
1141
+ (0, $bx7SL$useEffect)(()=>{
1015
1142
  // Call the triggerHoverEnd as soon as isDisabled changes to true
1016
1143
  // Safe to call triggerHoverEnd, it will early return if we aren't currently hovering
1017
- if (isDisabled) triggerHoverEnd1({
1144
+ if (isDisabled) triggerHoverEnd({
1018
1145
  currentTarget: state.target
1019
1146
  }, state.pointerType);
1020
1147
  // eslint-disable-next-line react-hooks/exhaustive-deps
@@ -1022,16 +1149,30 @@ function $6179b936705e76d3$export$ae780daf29e6d456(props) {
1022
1149
  isDisabled
1023
1150
  ]);
1024
1151
  return {
1025
- hoverProps: hoverProps1,
1152
+ hoverProps: hoverProps,
1026
1153
  isHovered: isHovered
1027
1154
  };
1028
1155
  }
1029
1156
 
1030
1157
 
1158
+ /*
1159
+ * Copyright 2020 Adobe. All rights reserved.
1160
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1161
+ * you may not use this file except in compliance with the License. You may obtain a copy
1162
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1163
+ *
1164
+ * Unless required by applicable law or agreed to in writing, software distributed under
1165
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1166
+ * OF ANY KIND, either express or implied. See the License for the specific language
1167
+ * governing permissions and limitations under the License.
1168
+ */ // Portions of the code in this file are based on code from react.
1169
+ // Original licensing for the following can be found in the
1170
+ // NOTICE file in the root directory of this source tree.
1171
+ // See https://github.com/facebook/react/tree/cc7c1aece46a6b69b41958d731e0fd27c94bfc6c/packages/react-interactions
1031
1172
 
1032
1173
  function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
1033
1174
  let { ref: ref , onInteractOutside: onInteractOutside , isDisabled: isDisabled , onInteractOutsideStart: onInteractOutsideStart } = props;
1034
- let stateRef = $bx7SL$useRef({
1175
+ let stateRef = (0, $bx7SL$useRef)({
1035
1176
  isPointerDown: false,
1036
1177
  ignoreEmulatedMouseEvents: false,
1037
1178
  onInteractOutside: onInteractOutside,
@@ -1040,7 +1181,7 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
1040
1181
  let state = stateRef.current;
1041
1182
  state.onInteractOutside = onInteractOutside;
1042
1183
  state.onInteractOutsideStart = onInteractOutsideStart;
1043
- $bx7SL$useEffect(()=>{
1184
+ (0, $bx7SL$useEffect)(()=>{
1044
1185
  if (isDisabled) return;
1045
1186
  let onPointerDown = (e)=>{
1046
1187
  if ($e0b6e0b68ec7f50f$var$isValidEvent(e, ref) && state.onInteractOutside) {
@@ -1049,7 +1190,7 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
1049
1190
  }
1050
1191
  };
1051
1192
  // Use pointer events if available. Otherwise, fall back to mouse and touch events.
1052
- if (typeof PointerEvent !== 'undefined') {
1193
+ if (typeof PointerEvent !== "undefined") {
1053
1194
  let onPointerUp = (e)=>{
1054
1195
  if (state.isPointerDown && state.onInteractOutside && $e0b6e0b68ec7f50f$var$isValidEvent(e, ref)) {
1055
1196
  state.isPointerDown = false;
@@ -1057,11 +1198,11 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
1057
1198
  }
1058
1199
  };
1059
1200
  // changing these to capture phase fixed combobox
1060
- document.addEventListener('pointerdown', onPointerDown, true);
1061
- document.addEventListener('pointerup', onPointerUp, true);
1201
+ document.addEventListener("pointerdown", onPointerDown, true);
1202
+ document.addEventListener("pointerup", onPointerUp, true);
1062
1203
  return ()=>{
1063
- document.removeEventListener('pointerdown', onPointerDown, true);
1064
- document.removeEventListener('pointerup', onPointerUp, true);
1204
+ document.removeEventListener("pointerdown", onPointerDown, true);
1205
+ document.removeEventListener("pointerup", onPointerUp, true);
1065
1206
  };
1066
1207
  } else {
1067
1208
  let onMouseUp = (e)=>{
@@ -1078,15 +1219,15 @@ function $e0b6e0b68ec7f50f$export$872b660ac5a1ff98(props) {
1078
1219
  state.onInteractOutside(e);
1079
1220
  }
1080
1221
  };
1081
- document.addEventListener('mousedown', onPointerDown, true);
1082
- document.addEventListener('mouseup', onMouseUp, true);
1083
- document.addEventListener('touchstart', onPointerDown, true);
1084
- document.addEventListener('touchend', onTouchEnd, true);
1222
+ document.addEventListener("mousedown", onPointerDown, true);
1223
+ document.addEventListener("mouseup", onMouseUp, true);
1224
+ document.addEventListener("touchstart", onPointerDown, true);
1225
+ document.addEventListener("touchend", onTouchEnd, true);
1085
1226
  return ()=>{
1086
- document.removeEventListener('mousedown', onPointerDown, true);
1087
- document.removeEventListener('mouseup', onMouseUp, true);
1088
- document.removeEventListener('touchstart', onPointerDown, true);
1089
- document.removeEventListener('touchend', onTouchEnd, true);
1227
+ document.removeEventListener("mousedown", onPointerDown, true);
1228
+ document.removeEventListener("mouseup", onMouseUp, true);
1229
+ document.removeEventListener("touchstart", onPointerDown, true);
1230
+ document.removeEventListener("touchend", onTouchEnd, true);
1090
1231
  };
1091
1232
  }
1092
1233
  }, [
@@ -1106,7 +1247,27 @@ function $e0b6e0b68ec7f50f$var$isValidEvent(event, ref) {
1106
1247
  }
1107
1248
 
1108
1249
 
1109
- function $93925083ecbb358c$export$48d1ea6320830260(handler) {
1250
+ /*
1251
+ * Copyright 2020 Adobe. All rights reserved.
1252
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1253
+ * you may not use this file except in compliance with the License. You may obtain a copy
1254
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1255
+ *
1256
+ * Unless required by applicable law or agreed to in writing, software distributed under
1257
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1258
+ * OF ANY KIND, either express or implied. See the License for the specific language
1259
+ * governing permissions and limitations under the License.
1260
+ */ /*
1261
+ * Copyright 2020 Adobe. All rights reserved.
1262
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1263
+ * you may not use this file except in compliance with the License. You may obtain a copy
1264
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1265
+ *
1266
+ * Unless required by applicable law or agreed to in writing, software distributed under
1267
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1268
+ * OF ANY KIND, either express or implied. See the License for the specific language
1269
+ * governing permissions and limitations under the License.
1270
+ */ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
1110
1271
  if (!handler) return;
1111
1272
  let shouldStopPropagation = true;
1112
1273
  return (e)=>{
@@ -1119,7 +1280,7 @@ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
1119
1280
  return e.isDefaultPrevented();
1120
1281
  },
1121
1282
  stopPropagation () {
1122
- console.error('stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.');
1283
+ console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior.");
1123
1284
  },
1124
1285
  continuePropagation () {
1125
1286
  shouldStopPropagation = false;
@@ -1133,31 +1294,39 @@ function $93925083ecbb358c$export$48d1ea6320830260(handler) {
1133
1294
 
1134
1295
  function $46d819fcbaf35654$export$8f71654801c2f7cd(props) {
1135
1296
  return {
1136
- keyboardProps: props.isDisabled ? {
1137
- } : {
1138
- onKeyDown: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyDown),
1139
- onKeyUp: $93925083ecbb358c$export$48d1ea6320830260(props.onKeyUp)
1297
+ keyboardProps: props.isDisabled ? {} : {
1298
+ onKeyDown: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyDown),
1299
+ onKeyUp: (0, $93925083ecbb358c$export$48d1ea6320830260)(props.onKeyUp)
1140
1300
  }
1141
1301
  };
1142
1302
  }
1143
1303
 
1144
1304
 
1145
-
1305
+ /*
1306
+ * Copyright 2020 Adobe. All rights reserved.
1307
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1308
+ * you may not use this file except in compliance with the License. You may obtain a copy
1309
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1310
+ *
1311
+ * Unless required by applicable law or agreed to in writing, software distributed under
1312
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1313
+ * OF ANY KIND, either express or implied. See the License for the specific language
1314
+ * governing permissions and limitations under the License.
1315
+ */
1146
1316
 
1147
1317
 
1148
1318
  function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1149
1319
  let { onMoveStart: onMoveStart , onMove: onMove , onMoveEnd: onMoveEnd } = props;
1150
- let state = $bx7SL$useRef({
1320
+ let state = (0, $bx7SL$useRef)({
1151
1321
  didMove: false,
1152
1322
  lastPosition: null,
1153
1323
  id: null
1154
1324
  });
1155
- let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $bx7SL$useGlobalListeners();
1156
- let moveProps1 = $bx7SL$useMemo(()=>{
1157
- let moveProps = {
1158
- };
1325
+ let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = (0, $bx7SL$useGlobalListeners)();
1326
+ let moveProps = (0, $bx7SL$useMemo)(()=>{
1327
+ let moveProps = {};
1159
1328
  let start = ()=>{
1160
- $14c0b72509d70225$export$16a4697467175487();
1329
+ (0, $14c0b72509d70225$export$16a4697467175487)();
1161
1330
  state.current.didMove = false;
1162
1331
  };
1163
1332
  let move = (originalEvent, pointerType, deltaX, deltaY)=>{
@@ -1165,7 +1334,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1165
1334
  if (!state.current.didMove) {
1166
1335
  state.current.didMove = true;
1167
1336
  onMoveStart === null || onMoveStart === void 0 ? void 0 : onMoveStart({
1168
- type: 'movestart',
1337
+ type: "movestart",
1169
1338
  pointerType: pointerType,
1170
1339
  shiftKey: originalEvent.shiftKey,
1171
1340
  metaKey: originalEvent.metaKey,
@@ -1174,7 +1343,7 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1174
1343
  });
1175
1344
  }
1176
1345
  onMove({
1177
- type: 'move',
1346
+ type: "move",
1178
1347
  pointerType: pointerType,
1179
1348
  deltaX: deltaX,
1180
1349
  deltaY: deltaY,
@@ -1185,9 +1354,9 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1185
1354
  });
1186
1355
  };
1187
1356
  let end = (originalEvent, pointerType)=>{
1188
- $14c0b72509d70225$export$b0d6fa1ab32e3295();
1357
+ (0, $14c0b72509d70225$export$b0d6fa1ab32e3295)();
1189
1358
  if (state.current.didMove) onMoveEnd === null || onMoveEnd === void 0 ? void 0 : onMoveEnd({
1190
- type: 'moveend',
1359
+ type: "moveend",
1191
1360
  pointerType: pointerType,
1192
1361
  shiftKey: originalEvent.shiftKey,
1193
1362
  metaKey: originalEvent.metaKey,
@@ -1195,10 +1364,10 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1195
1364
  altKey: originalEvent.altKey
1196
1365
  });
1197
1366
  };
1198
- if (typeof PointerEvent === 'undefined') {
1367
+ if (typeof PointerEvent === "undefined") {
1199
1368
  let onMouseMove = (e)=>{
1200
1369
  if (e.button === 0) {
1201
- move(e, 'mouse', e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);
1370
+ move(e, "mouse", e.pageX - state.current.lastPosition.pageX, e.pageY - state.current.lastPosition.pageY);
1202
1371
  state.current.lastPosition = {
1203
1372
  pageX: e.pageX,
1204
1373
  pageY: e.pageY
@@ -1207,9 +1376,9 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1207
1376
  };
1208
1377
  let onMouseUp = (e)=>{
1209
1378
  if (e.button === 0) {
1210
- end(e, 'mouse');
1211
- removeGlobalListener(window, 'mousemove', onMouseMove, false);
1212
- removeGlobalListener(window, 'mouseup', onMouseUp, false);
1379
+ end(e, "mouse");
1380
+ removeGlobalListener(window, "mousemove", onMouseMove, false);
1381
+ removeGlobalListener(window, "mouseup", onMouseUp, false);
1213
1382
  }
1214
1383
  };
1215
1384
  moveProps.onMouseDown = (e)=>{
@@ -1221,18 +1390,17 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1221
1390
  pageX: e.pageX,
1222
1391
  pageY: e.pageY
1223
1392
  };
1224
- addGlobalListener(window, 'mousemove', onMouseMove, false);
1225
- addGlobalListener(window, 'mouseup', onMouseUp, false);
1393
+ addGlobalListener(window, "mousemove", onMouseMove, false);
1394
+ addGlobalListener(window, "mouseup", onMouseUp, false);
1226
1395
  }
1227
1396
  };
1228
1397
  let onTouchMove = (e)=>{
1229
1398
  let touch = [
1230
1399
  ...e.changedTouches
1231
- ].findIndex(({ identifier: identifier })=>identifier === state.current.id
1232
- );
1400
+ ].findIndex(({ identifier: identifier })=>identifier === state.current.id);
1233
1401
  if (touch >= 0) {
1234
1402
  let { pageX: pageX , pageY: pageY } = e.changedTouches[touch];
1235
- move(e, 'touch', pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);
1403
+ move(e, "touch", pageX - state.current.lastPosition.pageX, pageY - state.current.lastPosition.pageY);
1236
1404
  state.current.lastPosition = {
1237
1405
  pageX: pageX,
1238
1406
  pageY: pageY
@@ -1242,14 +1410,13 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1242
1410
  let onTouchEnd = (e)=>{
1243
1411
  let touch = [
1244
1412
  ...e.changedTouches
1245
- ].findIndex(({ identifier: identifier })=>identifier === state.current.id
1246
- );
1413
+ ].findIndex(({ identifier: identifier })=>identifier === state.current.id);
1247
1414
  if (touch >= 0) {
1248
- end(e, 'touch');
1415
+ end(e, "touch");
1249
1416
  state.current.id = null;
1250
- removeGlobalListener(window, 'touchmove', onTouchMove);
1251
- removeGlobalListener(window, 'touchend', onTouchEnd);
1252
- removeGlobalListener(window, 'touchcancel', onTouchEnd);
1417
+ removeGlobalListener(window, "touchmove", onTouchMove);
1418
+ removeGlobalListener(window, "touchend", onTouchEnd);
1419
+ removeGlobalListener(window, "touchcancel", onTouchEnd);
1253
1420
  }
1254
1421
  };
1255
1422
  moveProps.onTouchStart = (e)=>{
@@ -1263,14 +1430,14 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1263
1430
  pageY: pageY
1264
1431
  };
1265
1432
  state.current.id = identifier;
1266
- addGlobalListener(window, 'touchmove', onTouchMove, false);
1267
- addGlobalListener(window, 'touchend', onTouchEnd, false);
1268
- addGlobalListener(window, 'touchcancel', onTouchEnd, false);
1433
+ addGlobalListener(window, "touchmove", onTouchMove, false);
1434
+ addGlobalListener(window, "touchend", onTouchEnd, false);
1435
+ addGlobalListener(window, "touchcancel", onTouchEnd, false);
1269
1436
  };
1270
1437
  } else {
1271
1438
  let onPointerMove = (e)=>{
1272
1439
  if (e.pointerId === state.current.id) {
1273
- let pointerType = e.pointerType || 'mouse';
1440
+ let pointerType = e.pointerType || "mouse";
1274
1441
  // Problems with PointerEvent#movementX/movementY:
1275
1442
  // 1. it is always 0 on macOS Safari.
1276
1443
  // 2. On Chrome Android, it's scaled by devicePixelRatio, but not on Chrome macOS
@@ -1283,12 +1450,12 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1283
1450
  };
1284
1451
  let onPointerUp = (e)=>{
1285
1452
  if (e.pointerId === state.current.id) {
1286
- let pointerType = e.pointerType || 'mouse';
1453
+ let pointerType = e.pointerType || "mouse";
1287
1454
  end(e, pointerType);
1288
1455
  state.current.id = null;
1289
- removeGlobalListener(window, 'pointermove', onPointerMove, false);
1290
- removeGlobalListener(window, 'pointerup', onPointerUp, false);
1291
- removeGlobalListener(window, 'pointercancel', onPointerUp, false);
1456
+ removeGlobalListener(window, "pointermove", onPointerMove, false);
1457
+ removeGlobalListener(window, "pointerup", onPointerUp, false);
1458
+ removeGlobalListener(window, "pointercancel", onPointerUp, false);
1292
1459
  }
1293
1460
  };
1294
1461
  moveProps.onPointerDown = (e)=>{
@@ -1301,39 +1468,39 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1301
1468
  pageY: e.pageY
1302
1469
  };
1303
1470
  state.current.id = e.pointerId;
1304
- addGlobalListener(window, 'pointermove', onPointerMove, false);
1305
- addGlobalListener(window, 'pointerup', onPointerUp, false);
1306
- addGlobalListener(window, 'pointercancel', onPointerUp, false);
1471
+ addGlobalListener(window, "pointermove", onPointerMove, false);
1472
+ addGlobalListener(window, "pointerup", onPointerUp, false);
1473
+ addGlobalListener(window, "pointercancel", onPointerUp, false);
1307
1474
  }
1308
1475
  };
1309
1476
  }
1310
1477
  let triggerKeyboardMove = (e, deltaX, deltaY)=>{
1311
1478
  start();
1312
- move(e, 'keyboard', deltaX, deltaY);
1313
- end(e, 'keyboard');
1479
+ move(e, "keyboard", deltaX, deltaY);
1480
+ end(e, "keyboard");
1314
1481
  };
1315
1482
  moveProps.onKeyDown = (e)=>{
1316
1483
  switch(e.key){
1317
- case 'Left':
1318
- case 'ArrowLeft':
1484
+ case "Left":
1485
+ case "ArrowLeft":
1319
1486
  e.preventDefault();
1320
1487
  e.stopPropagation();
1321
1488
  triggerKeyboardMove(e, -1, 0);
1322
1489
  break;
1323
- case 'Right':
1324
- case 'ArrowRight':
1490
+ case "Right":
1491
+ case "ArrowRight":
1325
1492
  e.preventDefault();
1326
1493
  e.stopPropagation();
1327
1494
  triggerKeyboardMove(e, 1, 0);
1328
1495
  break;
1329
- case 'Up':
1330
- case 'ArrowUp':
1496
+ case "Up":
1497
+ case "ArrowUp":
1331
1498
  e.preventDefault();
1332
1499
  e.stopPropagation();
1333
1500
  triggerKeyboardMove(e, 0, -1);
1334
1501
  break;
1335
- case 'Down':
1336
- case 'ArrowDown':
1502
+ case "Down":
1503
+ case "ArrowDown":
1337
1504
  e.preventDefault();
1338
1505
  e.stopPropagation();
1339
1506
  triggerKeyboardMove(e, 0, 1);
@@ -1350,17 +1517,27 @@ function $e8a7022cf87cba2a$export$36da96379f79f245(props) {
1350
1517
  removeGlobalListener
1351
1518
  ]);
1352
1519
  return {
1353
- moveProps: moveProps1
1520
+ moveProps: moveProps
1354
1521
  };
1355
1522
  }
1356
1523
 
1357
1524
 
1358
1525
 
1359
-
1526
+ /*
1527
+ * Copyright 2021 Adobe. All rights reserved.
1528
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1529
+ * you may not use this file except in compliance with the License. You may obtain a copy
1530
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1531
+ *
1532
+ * Unless required by applicable law or agreed to in writing, software distributed under
1533
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1534
+ * OF ANY KIND, either express or implied. See the License for the specific language
1535
+ * governing permissions and limitations under the License.
1536
+ */
1360
1537
 
1361
1538
  function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
1362
1539
  let { onScroll: onScroll , isDisabled: isDisabled } = props;
1363
- let onScrollHandler = $bx7SL$useCallback((e)=>{
1540
+ let onScrollHandler = (0, $bx7SL$useCallback)((e)=>{
1364
1541
  // If the ctrlKey is pressed, this is a zoom event, do nothing.
1365
1542
  if (e.ctrlKey) return;
1366
1543
  // stop scrolling the page
@@ -1373,50 +1550,60 @@ function $7d0a636d7a4dcefd$export$2123ff2b87c81ca(props, ref) {
1373
1550
  }, [
1374
1551
  onScroll
1375
1552
  ]);
1376
- $bx7SL$useEvent(ref, 'wheel', isDisabled ? null : onScrollHandler);
1553
+ (0, $bx7SL$useEvent)(ref, "wheel", isDisabled ? null : onScrollHandler);
1377
1554
  }
1378
1555
 
1379
1556
 
1380
-
1557
+ /*
1558
+ * Copyright 2020 Adobe. All rights reserved.
1559
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
1560
+ * you may not use this file except in compliance with the License. You may obtain a copy
1561
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
1562
+ *
1563
+ * Unless required by applicable law or agreed to in writing, software distributed under
1564
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
1565
+ * OF ANY KIND, either express or implied. See the License for the specific language
1566
+ * governing permissions and limitations under the License.
1567
+ */
1381
1568
 
1382
1569
 
1383
1570
  const $8a26561d2877236e$var$DEFAULT_THRESHOLD = 500;
1384
1571
  function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
1385
1572
  let { isDisabled: isDisabled , onLongPressStart: onLongPressStart , onLongPressEnd: onLongPressEnd , onLongPress: onLongPress , threshold: threshold = $8a26561d2877236e$var$DEFAULT_THRESHOLD , accessibilityDescription: accessibilityDescription } = props;
1386
- const timeRef = $bx7SL$useRef(null);
1387
- let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = $bx7SL$useGlobalListeners();
1388
- let { pressProps: pressProps } = $f6c31cce2adf654f$export$45712eceda6fad21({
1573
+ const timeRef = (0, $bx7SL$useRef)(null);
1574
+ let { addGlobalListener: addGlobalListener , removeGlobalListener: removeGlobalListener } = (0, $bx7SL$useGlobalListeners)();
1575
+ let { pressProps: pressProps } = (0, $f6c31cce2adf654f$export$45712eceda6fad21)({
1389
1576
  isDisabled: isDisabled,
1390
- onPressStart (e1) {
1391
- if (e1.pointerType === 'mouse' || e1.pointerType === 'touch') {
1577
+ onPressStart (e) {
1578
+ if (e.pointerType === "mouse" || e.pointerType === "touch") {
1392
1579
  if (onLongPressStart) onLongPressStart({
1393
- ...e1,
1394
- type: 'longpressstart'
1580
+ ...e,
1581
+ type: "longpressstart"
1395
1582
  });
1396
1583
  timeRef.current = setTimeout(()=>{
1397
1584
  // Prevent other usePress handlers from also handling this event.
1398
- e1.target.dispatchEvent(new PointerEvent('pointercancel', {
1585
+ e.target.dispatchEvent(new PointerEvent("pointercancel", {
1399
1586
  bubbles: true
1400
1587
  }));
1401
1588
  if (onLongPress) onLongPress({
1402
- ...e1,
1403
- type: 'longpress'
1589
+ ...e,
1590
+ type: "longpress"
1404
1591
  });
1405
1592
  timeRef.current = null;
1406
1593
  }, threshold);
1407
1594
  // Prevent context menu, which may be opened on long press on touch devices
1408
- if (e1.pointerType === 'touch') {
1595
+ if (e.pointerType === "touch") {
1409
1596
  let onContextMenu = (e)=>{
1410
1597
  e.preventDefault();
1411
1598
  };
1412
- addGlobalListener(e1.target, 'contextmenu', onContextMenu, {
1599
+ addGlobalListener(e.target, "contextmenu", onContextMenu, {
1413
1600
  once: true
1414
1601
  });
1415
- addGlobalListener(window, 'pointerup', ()=>{
1602
+ addGlobalListener(window, "pointerup", ()=>{
1416
1603
  // If no contextmenu event is fired quickly after pointerup, remove the handler
1417
1604
  // so future context menu events outside a long press are not prevented.
1418
1605
  setTimeout(()=>{
1419
- removeGlobalListener(e1.target, 'contextmenu', onContextMenu);
1606
+ removeGlobalListener(e.target, "contextmenu", onContextMenu);
1420
1607
  }, 30);
1421
1608
  }, {
1422
1609
  once: true
@@ -1426,15 +1613,15 @@ function $8a26561d2877236e$export$c24ed0104d07eab9(props) {
1426
1613
  },
1427
1614
  onPressEnd (e) {
1428
1615
  if (timeRef.current) clearTimeout(timeRef.current);
1429
- if (onLongPressEnd && (e.pointerType === 'mouse' || e.pointerType === 'touch')) onLongPressEnd({
1616
+ if (onLongPressEnd && (e.pointerType === "mouse" || e.pointerType === "touch")) onLongPressEnd({
1430
1617
  ...e,
1431
- type: 'longpressend'
1618
+ type: "longpressend"
1432
1619
  });
1433
1620
  }
1434
1621
  });
1435
- let descriptionProps = $bx7SL$useDescription(onLongPress && !isDisabled ? accessibilityDescription : null);
1622
+ let descriptionProps = (0, $bx7SL$useDescription)(onLongPress && !isDisabled ? accessibilityDescription : null);
1436
1623
  return {
1437
- longPressProps: $bx7SL$mergeProps(pressProps, descriptionProps)
1624
+ longPressProps: (0, $bx7SL$mergeProps)(pressProps, descriptionProps)
1438
1625
  };
1439
1626
  }
1440
1627