@react-aria/dnd 3.7.3 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. package/LICENSE +201 -0
  2. package/dist/DragManager.main.js +25 -13
  3. package/dist/DragManager.main.js.map +1 -1
  4. package/dist/DragManager.mjs +25 -13
  5. package/dist/DragManager.module.js +25 -13
  6. package/dist/DragManager.module.js.map +1 -1
  7. package/dist/DragPreview.main.js +7 -1
  8. package/dist/DragPreview.main.js.map +1 -1
  9. package/dist/DragPreview.mjs +8 -2
  10. package/dist/DragPreview.module.js +8 -2
  11. package/dist/DragPreview.module.js.map +1 -1
  12. package/dist/ListDropTargetDelegate.main.js +5 -4
  13. package/dist/ListDropTargetDelegate.main.js.map +1 -1
  14. package/dist/ListDropTargetDelegate.mjs +5 -4
  15. package/dist/ListDropTargetDelegate.module.js +5 -4
  16. package/dist/ListDropTargetDelegate.module.js.map +1 -1
  17. package/dist/ar-AE.main.js.map +1 -1
  18. package/dist/ar-AE.module.js.map +1 -1
  19. package/dist/bg-BG.main.js.map +1 -1
  20. package/dist/bg-BG.module.js.map +1 -1
  21. package/dist/constants.main.js +3 -3
  22. package/dist/constants.main.js.map +1 -1
  23. package/dist/constants.mjs +3 -3
  24. package/dist/constants.module.js +3 -3
  25. package/dist/constants.module.js.map +1 -1
  26. package/dist/cs-CZ.main.js.map +1 -1
  27. package/dist/cs-CZ.module.js.map +1 -1
  28. package/dist/da-DK.main.js.map +1 -1
  29. package/dist/da-DK.module.js.map +1 -1
  30. package/dist/de-DE.main.js.map +1 -1
  31. package/dist/de-DE.module.js.map +1 -1
  32. package/dist/el-GR.main.js.map +1 -1
  33. package/dist/el-GR.module.js.map +1 -1
  34. package/dist/en-US.main.js.map +1 -1
  35. package/dist/en-US.module.js.map +1 -1
  36. package/dist/es-ES.main.js.map +1 -1
  37. package/dist/es-ES.module.js.map +1 -1
  38. package/dist/et-EE.main.js.map +1 -1
  39. package/dist/et-EE.module.js.map +1 -1
  40. package/dist/fi-FI.main.js.map +1 -1
  41. package/dist/fi-FI.module.js.map +1 -1
  42. package/dist/fr-FR.main.js.map +1 -1
  43. package/dist/fr-FR.module.js.map +1 -1
  44. package/dist/he-IL.main.js.map +1 -1
  45. package/dist/he-IL.module.js.map +1 -1
  46. package/dist/hr-HR.main.js.map +1 -1
  47. package/dist/hr-HR.module.js.map +1 -1
  48. package/dist/hu-HU.main.js.map +1 -1
  49. package/dist/hu-HU.module.js.map +1 -1
  50. package/dist/it-IT.main.js.map +1 -1
  51. package/dist/it-IT.module.js.map +1 -1
  52. package/dist/ja-JP.main.js.map +1 -1
  53. package/dist/ja-JP.module.js.map +1 -1
  54. package/dist/ko-KR.main.js.map +1 -1
  55. package/dist/ko-KR.module.js.map +1 -1
  56. package/dist/lt-LT.main.js.map +1 -1
  57. package/dist/lt-LT.module.js.map +1 -1
  58. package/dist/lv-LV.main.js.map +1 -1
  59. package/dist/lv-LV.module.js.map +1 -1
  60. package/dist/nb-NO.main.js.map +1 -1
  61. package/dist/nb-NO.module.js.map +1 -1
  62. package/dist/nl-NL.main.js.map +1 -1
  63. package/dist/nl-NL.module.js.map +1 -1
  64. package/dist/pl-PL.main.js.map +1 -1
  65. package/dist/pl-PL.module.js.map +1 -1
  66. package/dist/pt-BR.main.js.map +1 -1
  67. package/dist/pt-BR.module.js.map +1 -1
  68. package/dist/pt-PT.main.js.map +1 -1
  69. package/dist/pt-PT.module.js.map +1 -1
  70. package/dist/ro-RO.main.js.map +1 -1
  71. package/dist/ro-RO.module.js.map +1 -1
  72. package/dist/ru-RU.main.js.map +1 -1
  73. package/dist/ru-RU.module.js.map +1 -1
  74. package/dist/sk-SK.main.js.map +1 -1
  75. package/dist/sk-SK.module.js.map +1 -1
  76. package/dist/sl-SI.main.js.map +1 -1
  77. package/dist/sl-SI.module.js.map +1 -1
  78. package/dist/sr-SP.main.js.map +1 -1
  79. package/dist/sr-SP.module.js.map +1 -1
  80. package/dist/sv-SE.main.js.map +1 -1
  81. package/dist/sv-SE.module.js.map +1 -1
  82. package/dist/tr-TR.main.js.map +1 -1
  83. package/dist/tr-TR.module.js.map +1 -1
  84. package/dist/types.d.ts +4 -4
  85. package/dist/types.d.ts.map +1 -1
  86. package/dist/uk-UA.main.js.map +1 -1
  87. package/dist/uk-UA.module.js.map +1 -1
  88. package/dist/useAutoScroll.main.js +5 -5
  89. package/dist/useAutoScroll.main.js.map +1 -1
  90. package/dist/useAutoScroll.mjs +5 -5
  91. package/dist/useAutoScroll.module.js +5 -5
  92. package/dist/useAutoScroll.module.js.map +1 -1
  93. package/dist/useClipboard.main.js +13 -7
  94. package/dist/useClipboard.main.js.map +1 -1
  95. package/dist/useClipboard.mjs +13 -7
  96. package/dist/useClipboard.module.js +13 -7
  97. package/dist/useClipboard.module.js.map +1 -1
  98. package/dist/useDrag.main.js +2 -2
  99. package/dist/useDrag.main.js.map +1 -1
  100. package/dist/useDrag.mjs +2 -2
  101. package/dist/useDrag.module.js +2 -2
  102. package/dist/useDrag.module.js.map +1 -1
  103. package/dist/useDrop.main.js +5 -4
  104. package/dist/useDrop.main.js.map +1 -1
  105. package/dist/useDrop.mjs +5 -4
  106. package/dist/useDrop.module.js +5 -4
  107. package/dist/useDrop.module.js.map +1 -1
  108. package/dist/useDropIndicator.main.js +3 -2
  109. package/dist/useDropIndicator.main.js.map +1 -1
  110. package/dist/useDropIndicator.mjs +3 -2
  111. package/dist/useDropIndicator.module.js +3 -2
  112. package/dist/useDropIndicator.module.js.map +1 -1
  113. package/dist/useDroppableCollection.main.js +33 -19
  114. package/dist/useDroppableCollection.main.js.map +1 -1
  115. package/dist/useDroppableCollection.mjs +33 -19
  116. package/dist/useDroppableCollection.module.js +33 -19
  117. package/dist/useDroppableCollection.module.js.map +1 -1
  118. package/dist/useVirtualDrop.main.js.map +1 -1
  119. package/dist/useVirtualDrop.module.js.map +1 -1
  120. package/dist/utils.main.js +5 -3
  121. package/dist/utils.main.js.map +1 -1
  122. package/dist/utils.mjs +5 -3
  123. package/dist/utils.module.js +5 -3
  124. package/dist/utils.module.js.map +1 -1
  125. package/dist/zh-CN.main.js.map +1 -1
  126. package/dist/zh-CN.module.js.map +1 -1
  127. package/dist/zh-TW.main.js.map +1 -1
  128. package/dist/zh-TW.module.js.map +1 -1
  129. package/package.json +15 -14
  130. package/src/DragManager.ts +26 -24
  131. package/src/DragPreview.tsx +17 -8
  132. package/src/ListDropTargetDelegate.ts +8 -5
  133. package/src/useAutoScroll.ts +6 -6
  134. package/src/useClipboard.ts +12 -6
  135. package/src/useDrag.ts +5 -2
  136. package/src/useDrop.ts +17 -9
  137. package/src/useDropIndicator.ts +10 -4
  138. package/src/useDroppableCollection.ts +62 -39
  139. package/src/useVirtualDrop.ts +3 -2
  140. package/src/utils.ts +16 -10
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright 2019 Adobe
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -51,8 +51,10 @@ function $28e10663603f5ea1$export$549dbcf8649bf3b2(target, stringFormatter) {
51
51
  if ($28e10663603f5ea1$var$dragSession) throw new Error('Cannot begin dragging while already dragging');
52
52
  $28e10663603f5ea1$var$dragSession = new $28e10663603f5ea1$var$DragSession(target, stringFormatter);
53
53
  requestAnimationFrame(()=>{
54
- $28e10663603f5ea1$var$dragSession.setup();
55
- if ((0, $4620ae0dc40f0031$exports.getDragModality)() === 'keyboard') $28e10663603f5ea1$var$dragSession.next();
54
+ if ($28e10663603f5ea1$var$dragSession) {
55
+ $28e10663603f5ea1$var$dragSession.setup();
56
+ if ((0, $4620ae0dc40f0031$exports.getDragModality)() === 'keyboard') $28e10663603f5ea1$var$dragSession.next();
57
+ }
56
58
  });
57
59
  for (let cb of $28e10663603f5ea1$var$subscriptions)cb();
58
60
  }
@@ -125,6 +127,7 @@ class $28e10663603f5ea1$var$DragSession {
125
127
  (0, $hMqHl$reactarialiveannouncer.announce)(this.stringFormatter.format($28e10663603f5ea1$var$MESSAGES[(0, $4620ae0dc40f0031$exports.getDragModality)()]));
126
128
  }
127
129
  teardown() {
130
+ var _this_mutationObserver, _this_restoreAriaHidden, _this;
128
131
  document.removeEventListener('keydown', this.onKeyDown, true);
129
132
  document.removeEventListener('keyup', this.onKeyUp, true);
130
133
  window.removeEventListener('focus', this.onFocus, true);
@@ -132,8 +135,8 @@ class $28e10663603f5ea1$var$DragSession {
132
135
  document.removeEventListener('click', this.onClick, true);
133
136
  document.removeEventListener('pointerdown', this.onPointerDown, true);
134
137
  for (let event of $28e10663603f5ea1$var$CANCELED_EVENTS)document.removeEventListener(event, this.cancelEvent, true);
135
- this.mutationObserver.disconnect();
136
- this.restoreAriaHidden();
138
+ (_this_mutationObserver = this.mutationObserver) === null || _this_mutationObserver === void 0 ? void 0 : _this_mutationObserver.disconnect();
139
+ (_this_restoreAriaHidden = (_this = this).restoreAriaHidden) === null || _this_restoreAriaHidden === void 0 ? void 0 : _this_restoreAriaHidden.call(_this);
137
140
  }
138
141
  onKeyDown(e) {
139
142
  var _this_currentDropTarget;
@@ -324,9 +327,9 @@ class $28e10663603f5ea1$var$DragSession {
324
327
  if (!item) dropTarget === null || dropTarget === void 0 ? void 0 : dropTarget.element.focus();
325
328
  }
326
329
  }
327
- if (item !== this.currentDropItem) {
328
- if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item === null || item === void 0 ? void 0 : item.target);
329
- item === null || item === void 0 ? void 0 : item.element.focus();
330
+ if (item != null && item !== this.currentDropItem) {
331
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item.target);
332
+ item.element.focus();
330
333
  this.currentDropItem = item;
331
334
  // Announce first drop target after drag start announcement finishes.
332
335
  // Otherwise, it will never get announced because drag start announcement is assertive.
@@ -338,6 +341,10 @@ class $28e10663603f5ea1$var$DragSession {
338
341
  }
339
342
  }
340
343
  end() {
344
+ var // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
345
+ // This corrects state such as whether focus ring should appear.
346
+ // useDroppableCollection handles this itself, so this is only for standalone drop zones.
347
+ _document_activeElement;
341
348
  this.teardown();
342
349
  $28e10663603f5ea1$var$endDragging();
343
350
  if (typeof this.dragTarget.onDragEnd === 'function') {
@@ -350,10 +357,7 @@ class $28e10663603f5ea1$var$DragSession {
350
357
  dropOperation: this.dropOperation || 'cancel'
351
358
  });
352
359
  }
353
- if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
354
- // This corrects state such as whether focus ring should appear.
355
- // useDroppableCollection handles this itself, so this is only for standalone drop zones.
356
- document.activeElement.dispatchEvent(new FocusEvent('focusin', {
360
+ if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.dispatchEvent(new FocusEvent('focusin', {
357
361
  bubbles: true
358
362
  }));
359
363
  this.setCurrentDropTarget(null);
@@ -384,13 +388,14 @@ class $28e10663603f5ea1$var$DragSession {
384
388
  getText: (type)=>Promise.resolve(item[type])
385
389
  }));
386
390
  let rect = this.currentDropTarget.element.getBoundingClientRect();
391
+ var _item_target;
387
392
  this.currentDropTarget.onDrop({
388
393
  type: 'drop',
389
394
  x: rect.left + rect.width / 2,
390
395
  y: rect.top + rect.height / 2,
391
396
  items: items,
392
397
  dropOperation: this.dropOperation
393
- }, item === null || item === void 0 ? void 0 : item.target);
398
+ }, (_item_target = item === null || item === void 0 ? void 0 : item.target) !== null && _item_target !== void 0 ? _item_target : null);
394
399
  }
395
400
  this.end();
396
401
  (0, $hMqHl$reactarialiveannouncer.announce)(this.stringFormatter.format('dropComplete'));
@@ -402,10 +407,17 @@ class $28e10663603f5ea1$var$DragSession {
402
407
  type: 'dropactivate',
403
408
  x: rect.left + rect.width / 2,
404
409
  y: rect.top + rect.height / 2
405
- });
410
+ }, null);
406
411
  }
407
412
  }
408
413
  constructor(target, stringFormatter){
414
+ this.validDropTargets = [];
415
+ this.currentDropTarget = null;
416
+ this.currentDropItem = null;
417
+ this.dropOperation = null;
418
+ this.mutationObserver = null;
419
+ this.restoreAriaHidden = null;
420
+ this.isVirtualClick = false;
409
421
  this.dragTarget = target;
410
422
  this.stringFormatter = stringFormatter;
411
423
  this.onKeyDown = this.onKeyDown.bind(this);
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAA2B;AAC/B,IAAI,sCAAgB,IAAI;AAcjB,SAAS,0CAAmB,MAAkB;IACnD,kCAAY,GAAG,CAAC,OAAO,OAAO,EAAE;IAChC,8CAAA,wDAAA,kCAAa,sBAAsB;IACnC,OAAO;QACL,kCAAY,MAAM,CAAC,OAAO,OAAO;QACjC,8CAAA,wDAAA,kCAAa,sBAAsB;IACrC;AACF;AAQO,SAAS,0CAAiB,IAAmB;IAClD,gCAAU,GAAG,CAAC,KAAK,OAAO,EAAE;IAC5B,OAAO;QACL,gCAAU,MAAM,CAAC,KAAK,OAAO;IAC/B;AACF;AASO,SAAS,0CAAc,MAAkB,EAAE,eAAyC;IACzF,IAAI,mCACF,MAAM,IAAI,MAAM;IAGlB,oCAAc,IAAI,kCAAY,QAAQ;IACtC,sBAAsB;QACpB,kCAAY,KAAK;QACjB,IAAI,CAAA,GAAA,yCAAc,QAAQ,YACxB,kCAAY,IAAI;IAEpB;IAEA,KAAK,IAAI,MAAM,oCACb;AAEJ;AAEO,SAAS;IACd,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IAErC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,KAAK,IAAM,WAAW;QAC1B,oCAAc,GAAG,CAAC;QAClB,OAAO;YACL,oCAAc,MAAM,CAAC;QACvB;IACF,GAAG,EAAE;IAEL,OAAO;AACT;AAGO,SA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AC,IAAI;QAC7C,IAAI,CAAC,cAAc,GAAG;IACxB;AAwZF;AAEA,SAAS,2CAAqB,OAAmB;IAC/C,IAAI,QAAQ,CAAA,GAAA,kCAAO,EAAE,QAAQ,KAAK;IAClC,OAAO;WAAI,kCAAY,MAAM;KAAG,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,yBACzB,OAAO;QAGT,IAAI,OAAO,OAAO,gBAAgB,KAAK,YACrC,OAAO,OAAO,gBAAgB,CAAC,OAAO,QAAQ,qBAAqB,MAAM;QAG3E,OAAO;IACT;AACF","sources":["packages/@react-aria/dnd/src/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target?: DroppableCollectionTarget) => void,\n onDropActivate?: (e: DropActivateEvent, target?: DroppableCollectionTarget) => void,\n onDrop?: (e: DropEvent, target?: DroppableCollectionTarget) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[];\n currentDropTarget: DropTarget;\n currentDropItem: DroppableItem;\n dropOperation: DropOperation;\n private mutationObserver: MutationObserver;\n private restoreAriaHidden: () => void;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver.disconnect();\n this.restoreAriaHidden();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item !== this.currentDropItem) {\n if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item?.target);\n }\n\n item?.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute('aria-label');\n if (label) {\n announce(label, 'polite');\n }\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAUD,IAAI,oCAAc,IAAI;AACtB,IAAI,kCAAY,IAAI;AACpB,IAAI,oCAAkC;AACtC,IAAI,sCAAgB,IAAI;AAcjB,SAAS,0CAAmB,MAAkB;IACnD,kCAAY,GAAG,CAAC,OAAO,OAAO,EAAE;IAChC,8CAAA,wDAAA,kCAAa,sBAAsB;IACnC,OAAO;QACL,kCAAY,MAAM,CAAC,OAAO,OAAO;QACjC,8CAAA,wDAAA,kCAAa,sBAAsB;IACrC;AACF;AAQO,SAAS,0CAAiB,IAAmB;IAClD,gCAAU,GAAG,CAAC,KAAK,OAAO,EAAE;IAC5B,OAAO;QACL,gCAAU,MAAM,CAAC,KAAK,OAAO;IAC/B;AACF;AASO,SAAS,0CAAc,MAAkB,EAAE,eAAyC;IACzF,IAAI,mCACF,MAAM,IAAI,MAAM;IAGlB,oCAAc,IAAI,kCAAY,QAAQ;IACtC,sBAAsB;QACpB,IAAI,mCAAa;YACf,kCAAY,KAAK;YACjB,IAAI,CAAA,GAAA,yCAAc,QAAQ,YACxB,kCAAY,IAAI;QAEpB;IACF;IAEA,KAAK,IAAI,MAAM,oCACb;AAEJ;AAEO,SAAS;IACd,IAAI,CAAC,SAAS,WAAW,GAAG,CAAA,GAAA,qBAAO,EAAE;IAErC,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,KAAK,IAAM,WAAW;QAC1B,oCAAc,GAAG,CAAC;QAClB,OAAO;YACL,oCAAc,MAAM,CAAC;QACvB;IACF,GAAG,EAAE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,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI;QACnC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI;QACrC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI;QACjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI;QAC7C,IAAI,CAAC,cAAc,GAAG;IACxB;AAwZF;AAEA,SAAS,2CAAqB,OAAmB;IAC/C,IAAI,QAAQ,CAAA,GAAA,kCAAO,EAAE,QAAQ,KAAK;IAClC,OAAO;WAAI,kCAAY,MAAM;KAAG,CAAC,MAAM,CAAC,CAAA;QACtC,IAAI,OAAO,OAAO,CAAC,OAAO,CAAC,yBACzB,OAAO;QAGT,IAAI,OAAO,OAAO,gBAAgB,KAAK,YACrC,OAAO,OAAO,gBAAgB,CAAC,OAAO,QAAQ,qBAAqB,MAAM;QAG3E,OAAO;IACT;AACF","sources":["packages/@react-aria/dnd/src/DragManager.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {announce} from '@react-aria/live-announcer';\nimport {ariaHideOutside} from '@react-aria/overlays';\nimport {DragEndEvent, DragItem, DropActivateEvent, DropEnterEvent, DropEvent, DropExitEvent, DropItem, DropOperation, DropTarget as DroppableCollectionTarget, FocusableElement} from '@react-types/shared';\nimport {getDragModality, getTypes} from './utils';\nimport {isVirtualClick, isVirtualPointerEvent} from '@react-aria/utils';\nimport type {LocalizedStringFormatter} from '@internationalized/string';\nimport {useEffect, useState} from 'react';\n\nlet dropTargets = new Map<Element, DropTarget>();\nlet dropItems = new Map<Element, DroppableItem>();\nlet dragSession: DragSession | null = null;\nlet subscriptions = new Set<() => void>();\n\ninterface DropTarget {\n element: FocusableElement,\n preventFocusOnDrop?: boolean,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation,\n onDropEnter?: (e: DropEnterEvent, dragTarget: DragTarget) => void,\n onDropExit?: (e: DropExitEvent) => void,\n onDropTargetEnter?: (target: DroppableCollectionTarget | null) => void,\n onDropActivate?: (e: DropActivateEvent, target: DroppableCollectionTarget | null) => void,\n onDrop?: (e: DropEvent, target: DroppableCollectionTarget | null) => void,\n onKeyDown?: (e: KeyboardEvent, dragTarget: DragTarget) => void\n}\n\nexport function registerDropTarget(target: DropTarget) {\n dropTargets.set(target.element, target);\n dragSession?.updateValidDropTargets();\n return () => {\n dropTargets.delete(target.element);\n dragSession?.updateValidDropTargets();\n };\n}\n\ninterface DroppableItem {\n element: FocusableElement,\n target: DroppableCollectionTarget,\n getDropOperation?: (types: Set<string>, allowedOperations: DropOperation[]) => DropOperation\n}\n\nexport function registerDropItem(item: DroppableItem) {\n dropItems.set(item.element, item);\n return () => {\n dropItems.delete(item.element);\n };\n}\n\ninterface DragTarget {\n element: FocusableElement,\n items: DragItem[],\n allowedDropOperations: DropOperation[],\n onDragEnd?: (e: DragEndEvent) => void\n}\n\nexport function beginDragging(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n if (dragSession) {\n throw new Error('Cannot begin dragging while already dragging');\n }\n\n dragSession = new DragSession(target, stringFormatter);\n requestAnimationFrame(() => {\n if (dragSession) {\n dragSession.setup();\n if (getDragModality() === 'keyboard') {\n dragSession.next();\n }\n }\n });\n\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function useDragSession() {\n let [session, setSession] = useState(dragSession);\n\n useEffect(() => {\n let cb = () => setSession(dragSession);\n subscriptions.add(cb);\n return () => {\n subscriptions.delete(cb);\n };\n }, []);\n\n return session;\n}\n\n/** @private */\nexport function isVirtualDragging(): boolean {\n return !!dragSession;\n}\n\nfunction endDragging() {\n dragSession = null;\n for (let cb of subscriptions) {\n cb();\n }\n}\n\nexport function isValidDropTarget(element: Element): boolean {\n for (let target of dropTargets.keys()) {\n if (target.contains(element)) {\n return true;\n }\n }\n\n return false;\n}\n\nconst CANCELED_EVENTS = [\n 'pointerdown',\n 'pointermove',\n 'pointerenter',\n 'pointerleave',\n 'pointerover',\n 'pointerout',\n 'pointerup',\n 'mousedown',\n 'mousemove',\n 'mouseenter',\n 'mouseleave',\n 'mouseover',\n 'mouseout',\n 'mouseup',\n 'touchstart',\n 'touchmove',\n 'touchend',\n 'focusin',\n 'focusout'\n];\n\nconst CLICK_EVENTS = [\n 'pointerup',\n 'mouseup',\n 'touchend'\n];\n\nconst MESSAGES = {\n keyboard: 'dragStartedKeyboard',\n touch: 'dragStartedTouch',\n virtual: 'dragStartedVirtual'\n};\n\nclass DragSession {\n dragTarget: DragTarget;\n validDropTargets: DropTarget[] = [];\n currentDropTarget: DropTarget | null = null;\n currentDropItem: DroppableItem | null = null;\n dropOperation: DropOperation | null = null;\n private mutationObserver: MutationObserver | null = null;\n private restoreAriaHidden: (() => void) | null = null;\n private stringFormatter: LocalizedStringFormatter;\n private isVirtualClick: boolean = false;\n private initialFocused: boolean;\n\n constructor(target: DragTarget, stringFormatter: LocalizedStringFormatter) {\n this.dragTarget = target;\n this.stringFormatter = stringFormatter;\n\n this.onKeyDown = this.onKeyDown.bind(this);\n this.onKeyUp = this.onKeyUp.bind(this);\n this.onFocus = this.onFocus.bind(this);\n this.onBlur = this.onBlur.bind(this);\n this.onClick = this.onClick.bind(this);\n this.onPointerDown = this.onPointerDown.bind(this);\n this.cancelEvent = this.cancelEvent.bind(this);\n this.initialFocused = false;\n }\n\n setup() {\n document.addEventListener('keydown', this.onKeyDown, true);\n document.addEventListener('keyup', this.onKeyUp, true);\n window.addEventListener('focus', this.onFocus, true);\n window.addEventListener('blur', this.onBlur, true);\n document.addEventListener('click', this.onClick, true);\n document.addEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.addEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver = new MutationObserver(() =>\n this.updateValidDropTargets()\n );\n this.updateValidDropTargets();\n\n announce(this.stringFormatter.format(MESSAGES[getDragModality()]));\n }\n\n teardown() {\n document.removeEventListener('keydown', this.onKeyDown, true);\n document.removeEventListener('keyup', this.onKeyUp, true);\n window.removeEventListener('focus', this.onFocus, true);\n window.removeEventListener('blur', this.onBlur, true);\n document.removeEventListener('click', this.onClick, true);\n document.removeEventListener('pointerdown', this.onPointerDown, true);\n\n for (let event of CANCELED_EVENTS) {\n document.removeEventListener(event, this.cancelEvent, true);\n }\n\n this.mutationObserver?.disconnect();\n this.restoreAriaHidden?.();\n }\n\n onKeyDown(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Escape') {\n this.cancel();\n return;\n }\n\n if (e.key === 'Tab' && !(e.metaKey || e.altKey || e.ctrlKey)) {\n if (e.shiftKey) {\n this.previous();\n } else {\n this.next();\n }\n }\n\n if (typeof this.currentDropTarget?.onKeyDown === 'function') {\n this.currentDropTarget.onKeyDown(e, this.dragTarget);\n }\n }\n\n onKeyUp(e: KeyboardEvent) {\n this.cancelEvent(e);\n\n if (e.key === 'Enter') {\n if (e.altKey) {\n this.activate();\n } else {\n this.drop();\n }\n }\n }\n\n onFocus(e: FocusEvent) {\n // Prevent focus events, except to the original drag target.\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // Ignore focus events on the window/document (JSDOM). Will be handled in onBlur, below.\n if (!(e.target instanceof HTMLElement) || e.target === this.dragTarget.element) {\n return;\n }\n\n let dropTarget =\n this.validDropTargets.find(target => target.element === e.target as HTMLElement) ||\n this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n\n if (!dropTarget) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n return;\n }\n\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n }\n\n onBlur(e: FocusEvent) {\n if (e.target !== this.dragTarget.element) {\n this.cancelEvent(e);\n }\n\n // If nothing is gaining focus, or e.relatedTarget is the window/document (JSDOM),\n // restore focus back to the current drop target if any, or the original drag target.\n if (!e.relatedTarget || !(e.relatedTarget instanceof HTMLElement)) {\n if (this.currentDropTarget) {\n this.currentDropTarget.element.focus();\n } else {\n this.dragTarget.element.focus();\n }\n }\n }\n\n onClick(e: MouseEvent) {\n this.cancelEvent(e);\n if (isVirtualClick(e) || this.isVirtualClick) {\n if (e.target === this.dragTarget.element) {\n this.cancel();\n return;\n }\n\n let dropTarget = this.validDropTargets.find(target => target.element.contains(e.target as HTMLElement));\n if (dropTarget) {\n let item = dropItems.get(e.target as HTMLElement);\n this.setCurrentDropTarget(dropTarget, item);\n this.drop(item);\n }\n }\n }\n\n onPointerDown(e: PointerEvent) {\n // Android Talkback double tap has e.detail = 1 for onClick. Detect the virtual click in onPointerDown before onClick fires\n // so we can properly perform cancel and drop operations.\n this.cancelEvent(e);\n this.isVirtualClick = isVirtualPointerEvent(e);\n }\n\n cancelEvent(e: Event) {\n // Allow focusin and focusout on the drag target so focus ring works properly.\n if ((e.type === 'focusin' || e.type === 'focusout') && e.target === this.dragTarget?.element) {\n return;\n }\n\n // Allow default for events that might cancel a click event\n if (!CLICK_EVENTS.includes(e.type)) {\n e.preventDefault();\n }\n\n e.stopPropagation();\n e.stopImmediatePropagation();\n }\n\n updateValidDropTargets() {\n if (!this.mutationObserver) {\n return;\n }\n\n this.mutationObserver.disconnect();\n if (this.restoreAriaHidden) {\n this.restoreAriaHidden();\n }\n\n this.validDropTargets = findValidDropTargets(this.dragTarget);\n\n // Shuffle drop target order based on starting drag target.\n if (this.validDropTargets.length > 0) {\n let nearestIndex = this.findNearestDropTarget();\n this.validDropTargets = [\n ...this.validDropTargets.slice(nearestIndex),\n ...this.validDropTargets.slice(0, nearestIndex)\n ];\n }\n\n if (this.currentDropTarget && !this.validDropTargets.includes(this.currentDropTarget)) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n\n // Find valid drop items within collections\n let types = getTypes(this.dragTarget.items);\n let validDropItems = [...dropItems.values()].filter(item => {\n if (typeof item.getDropOperation === 'function') {\n return item.getDropOperation(types, this.dragTarget.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n\n // Filter out drop targets that contain valid items. We don't want to stop hiding elements\n // other than the drop items that exist inside the collection.\n let visibleDropTargets = this.validDropTargets.filter(target =>\n !validDropItems.some(item => target.element.contains(item.element))\n );\n\n this.restoreAriaHidden = ariaHideOutside([\n this.dragTarget.element,\n ...validDropItems.map(item => item.element),\n ...visibleDropTargets.map(target => target.element)\n ]);\n\n this.mutationObserver.observe(document.body, {subtree: true, attributes: true, attributeFilter: ['aria-hidden']});\n }\n\n next() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n return;\n }\n\n // If we've reached the end of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === this.validDropTargets.length - 1) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[0]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index + 1]);\n }\n }\n\n previous() {\n if (!this.currentDropTarget) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n let index = this.validDropTargets.indexOf(this.currentDropTarget);\n if (index < 0) {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n return;\n }\n\n // If we've reached the start of the valid drop targets, cycle back to the original drag target.\n // This lets the user cancel the drag in case they don't have an Escape key (e.g. iPad keyboard case).\n if (index === 0) {\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.setCurrentDropTarget(null);\n this.dragTarget.element.focus();\n } else {\n this.setCurrentDropTarget(this.validDropTargets[this.validDropTargets.length - 1]);\n }\n } else {\n this.setCurrentDropTarget(this.validDropTargets[index - 1]);\n }\n }\n\n findNearestDropTarget(): number {\n let dragTargetRect = this.dragTarget.element.getBoundingClientRect();\n\n let minDistance = Infinity;\n let nearest = -1;\n for (let i = 0; i < this.validDropTargets.length; i++) {\n let dropTarget = this.validDropTargets[i];\n let rect = dropTarget.element.getBoundingClientRect();\n let dx = rect.left - dragTargetRect.left;\n let dy = rect.top - dragTargetRect.top;\n let dist = (dx * dx) + (dy * dy);\n if (dist < minDistance) {\n minDistance = dist;\n nearest = i;\n }\n }\n\n return nearest;\n }\n\n setCurrentDropTarget(dropTarget: DropTarget | null, item?: DroppableItem) {\n if (dropTarget !== this.currentDropTarget) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropExit === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropExit({\n type: 'dropexit',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n });\n }\n\n this.currentDropTarget = dropTarget;\n\n if (dropTarget) {\n if (typeof dropTarget.onDropEnter === 'function') {\n let rect = dropTarget.element.getBoundingClientRect();\n dropTarget.onDropEnter({\n type: 'dropenter',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, this.dragTarget);\n }\n\n if (!item) {\n dropTarget?.element.focus();\n }\n }\n }\n\n if (item != null && item !== this.currentDropItem) {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter === 'function') {\n this.currentDropTarget.onDropTargetEnter(item.target);\n }\n\n item.element.focus();\n this.currentDropItem = item;\n\n // Announce first drop target after drag start announcement finishes.\n // Otherwise, it will never get announced because drag start announcement is assertive.\n if (!this.initialFocused) {\n let label = item?.element.getAttribute('aria-label');\n if (label) {\n announce(label, 'polite');\n }\n this.initialFocused = true;\n }\n }\n }\n\n end() {\n this.teardown();\n endDragging();\n\n if (typeof this.dragTarget.onDragEnd === 'function') {\n let target = this.currentDropTarget && this.dropOperation !== 'cancel' ? this.currentDropTarget : this.dragTarget;\n let rect = target.element.getBoundingClientRect();\n this.dragTarget.onDragEnd({\n type: 'dragend',\n x: rect.x + (rect.width / 2),\n y: rect.y + (rect.height / 2),\n dropOperation: this.dropOperation || 'cancel'\n });\n }\n\n if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) {\n // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).\n // This corrects state such as whether focus ring should appear.\n // useDroppableCollection handles this itself, so this is only for standalone drop zones.\n document.activeElement?.dispatchEvent(new FocusEvent('focusin', {bubbles: true}));\n }\n\n this.setCurrentDropTarget(null);\n }\n\n cancel() {\n this.setCurrentDropTarget(null);\n this.end();\n if (!this.dragTarget.element.closest('[aria-hidden=\"true\"]')) {\n this.dragTarget.element.focus();\n }\n\n announce(this.stringFormatter.format('dropCanceled'));\n }\n\n drop(item?: DroppableItem) {\n if (!this.currentDropTarget) {\n this.cancel();\n return;\n }\n\n if (typeof item?.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = item.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else if (typeof this.currentDropTarget.getDropOperation === 'function') {\n let types = getTypes(this.dragTarget.items);\n this.dropOperation = this.currentDropTarget.getDropOperation(types, this.dragTarget.allowedDropOperations);\n } else {\n // TODO: show menu ??\n this.dropOperation = this.dragTarget.allowedDropOperations[0];\n }\n\n if (typeof this.currentDropTarget.onDrop === 'function') {\n let items: DropItem[] = this.dragTarget.items.map(item => ({\n kind: 'text',\n types: new Set(Object.keys(item)),\n getText: (type: string) => Promise.resolve(item[type])\n }));\n\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDrop({\n type: 'drop',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2),\n items,\n dropOperation: this.dropOperation\n }, item?.target ?? null);\n }\n\n this.end();\n announce(this.stringFormatter.format('dropComplete'));\n }\n\n activate() {\n if (this.currentDropTarget && typeof this.currentDropTarget.onDropActivate === 'function') {\n let rect = this.currentDropTarget.element.getBoundingClientRect();\n this.currentDropTarget.onDropActivate({\n type: 'dropactivate',\n x: rect.left + (rect.width / 2),\n y: rect.top + (rect.height / 2)\n }, null);\n }\n }\n}\n\nfunction findValidDropTargets(options: DragTarget) {\n let types = getTypes(options.items);\n return [...dropTargets.values()].filter(target => {\n if (target.element.closest('[aria-hidden=\"true\"]')) {\n return false;\n }\n\n if (typeof target.getDropOperation === 'function') {\n return target.getDropOperation(types, options.allowedDropOperations) !== 'cancel';\n }\n\n return true;\n });\n}\n"],"names":[],"version":3,"file":"DragManager.main.js.map"}
@@ -41,8 +41,10 @@ function $67560de7c78cb232$export$549dbcf8649bf3b2(target, stringFormatter) {
41
41
  if ($67560de7c78cb232$var$dragSession) throw new Error('Cannot begin dragging while already dragging');
42
42
  $67560de7c78cb232$var$dragSession = new $67560de7c78cb232$var$DragSession(target, stringFormatter);
43
43
  requestAnimationFrame(()=>{
44
- $67560de7c78cb232$var$dragSession.setup();
45
- if ((0, $7252cd45fc48c07c$export$1fb2158d224b542c)() === 'keyboard') $67560de7c78cb232$var$dragSession.next();
44
+ if ($67560de7c78cb232$var$dragSession) {
45
+ $67560de7c78cb232$var$dragSession.setup();
46
+ if ((0, $7252cd45fc48c07c$export$1fb2158d224b542c)() === 'keyboard') $67560de7c78cb232$var$dragSession.next();
47
+ }
46
48
  });
47
49
  for (let cb of $67560de7c78cb232$var$subscriptions)cb();
48
50
  }
@@ -115,6 +117,7 @@ class $67560de7c78cb232$var$DragSession {
115
117
  (0, $irqIb$announce)(this.stringFormatter.format($67560de7c78cb232$var$MESSAGES[(0, $7252cd45fc48c07c$export$1fb2158d224b542c)()]));
116
118
  }
117
119
  teardown() {
120
+ var _this_mutationObserver, _this_restoreAriaHidden, _this;
118
121
  document.removeEventListener('keydown', this.onKeyDown, true);
119
122
  document.removeEventListener('keyup', this.onKeyUp, true);
120
123
  window.removeEventListener('focus', this.onFocus, true);
@@ -122,8 +125,8 @@ class $67560de7c78cb232$var$DragSession {
122
125
  document.removeEventListener('click', this.onClick, true);
123
126
  document.removeEventListener('pointerdown', this.onPointerDown, true);
124
127
  for (let event of $67560de7c78cb232$var$CANCELED_EVENTS)document.removeEventListener(event, this.cancelEvent, true);
125
- this.mutationObserver.disconnect();
126
- this.restoreAriaHidden();
128
+ (_this_mutationObserver = this.mutationObserver) === null || _this_mutationObserver === void 0 ? void 0 : _this_mutationObserver.disconnect();
129
+ (_this_restoreAriaHidden = (_this = this).restoreAriaHidden) === null || _this_restoreAriaHidden === void 0 ? void 0 : _this_restoreAriaHidden.call(_this);
127
130
  }
128
131
  onKeyDown(e) {
129
132
  var _this_currentDropTarget;
@@ -314,9 +317,9 @@ class $67560de7c78cb232$var$DragSession {
314
317
  if (!item) dropTarget === null || dropTarget === void 0 ? void 0 : dropTarget.element.focus();
315
318
  }
316
319
  }
317
- if (item !== this.currentDropItem) {
318
- if (item && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item === null || item === void 0 ? void 0 : item.target);
319
- item === null || item === void 0 ? void 0 : item.element.focus();
320
+ if (item != null && item !== this.currentDropItem) {
321
+ if (this.currentDropTarget && typeof this.currentDropTarget.onDropTargetEnter === 'function') this.currentDropTarget.onDropTargetEnter(item.target);
322
+ item.element.focus();
320
323
  this.currentDropItem = item;
321
324
  // Announce first drop target after drag start announcement finishes.
322
325
  // Otherwise, it will never get announced because drag start announcement is assertive.
@@ -328,6 +331,10 @@ class $67560de7c78cb232$var$DragSession {
328
331
  }
329
332
  }
330
333
  end() {
334
+ var // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
335
+ // This corrects state such as whether focus ring should appear.
336
+ // useDroppableCollection handles this itself, so this is only for standalone drop zones.
337
+ _document_activeElement;
331
338
  this.teardown();
332
339
  $67560de7c78cb232$var$endDragging();
333
340
  if (typeof this.dragTarget.onDragEnd === 'function') {
@@ -340,10 +347,7 @@ class $67560de7c78cb232$var$DragSession {
340
347
  dropOperation: this.dropOperation || 'cancel'
341
348
  });
342
349
  }
343
- if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) // Re-trigger focus event on active element, since it will not have received it during dragging (see cancelEvent).
344
- // This corrects state such as whether focus ring should appear.
345
- // useDroppableCollection handles this itself, so this is only for standalone drop zones.
346
- document.activeElement.dispatchEvent(new FocusEvent('focusin', {
350
+ if (this.currentDropTarget && !this.currentDropTarget.preventFocusOnDrop) (_document_activeElement = document.activeElement) === null || _document_activeElement === void 0 ? void 0 : _document_activeElement.dispatchEvent(new FocusEvent('focusin', {
347
351
  bubbles: true
348
352
  }));
349
353
  this.setCurrentDropTarget(null);
@@ -374,13 +378,14 @@ class $67560de7c78cb232$var$DragSession {
374
378
  getText: (type)=>Promise.resolve(item[type])
375
379
  }));
376
380
  let rect = this.currentDropTarget.element.getBoundingClientRect();
381
+ var _item_target;
377
382
  this.currentDropTarget.onDrop({
378
383
  type: 'drop',
379
384
  x: rect.left + rect.width / 2,
380
385
  y: rect.top + rect.height / 2,
381
386
  items: items,
382
387
  dropOperation: this.dropOperation
383
- }, item === null || item === void 0 ? void 0 : item.target);
388
+ }, (_item_target = item === null || item === void 0 ? void 0 : item.target) !== null && _item_target !== void 0 ? _item_target : null);
384
389
  }
385
390
  this.end();
386
391
  (0, $irqIb$announce)(this.stringFormatter.format('dropComplete'));
@@ -392,10 +397,17 @@ class $67560de7c78cb232$var$DragSession {
392
397
  type: 'dropactivate',
393
398
  x: rect.left + rect.width / 2,
394
399
  y: rect.top + rect.height / 2
395
- });
400
+ }, null);
396
401
  }
397
402
  }
398
403
  constructor(target, stringFormatter){
404
+ this.validDropTargets = [];
405
+ this.currentDropTarget = null;
406
+ this.currentDropItem = null;
407
+ this.dropOperation = null;
408
+ this.mutationObserver = null;
409
+ this.restoreAriaHidden = null;
410
+ this.isVirtualClick = false;
399
411
  this.dragTarget = target;
400
412
  this.stringFormatter = stringFormatter;
401
413
  this.onKeyDown = this.onKeyDown.bind(this);