@react-aria/dnd 3.0.0-alpha.9 → 3.0.0-nightly-4980928d3-240906

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 (275) hide show
  1. package/dist/DragManager.main.js +432 -0
  2. package/dist/DragManager.main.js.map +1 -0
  3. package/dist/DragManager.mjs +423 -0
  4. package/dist/DragManager.module.js +423 -0
  5. package/dist/DragManager.module.js.map +1 -0
  6. package/dist/DragPreview.main.js +59 -0
  7. package/dist/DragPreview.main.js.map +1 -0
  8. package/dist/DragPreview.mjs +50 -0
  9. package/dist/DragPreview.module.js +50 -0
  10. package/dist/DragPreview.module.js.map +1 -0
  11. package/dist/ListDropTargetDelegate.main.js +123 -0
  12. package/dist/ListDropTargetDelegate.main.js.map +1 -0
  13. package/dist/ListDropTargetDelegate.mjs +118 -0
  14. package/dist/ListDropTargetDelegate.module.js +118 -0
  15. package/dist/ListDropTargetDelegate.module.js.map +1 -0
  16. package/dist/ar-AE.main.js +44 -0
  17. package/dist/ar-AE.main.js.map +1 -0
  18. package/dist/ar-AE.mjs +46 -0
  19. package/dist/ar-AE.module.js +46 -0
  20. package/dist/ar-AE.module.js.map +1 -0
  21. package/dist/bg-BG.main.js +44 -0
  22. package/dist/bg-BG.main.js.map +1 -0
  23. package/dist/bg-BG.mjs +46 -0
  24. package/dist/bg-BG.module.js +46 -0
  25. package/dist/bg-BG.module.js.map +1 -0
  26. package/dist/constants.main.js +65 -0
  27. package/dist/constants.main.js.map +1 -0
  28. package/dist/constants.mjs +53 -0
  29. package/dist/constants.module.js +53 -0
  30. package/dist/constants.module.js.map +1 -0
  31. package/dist/cs-CZ.main.js +45 -0
  32. package/dist/cs-CZ.main.js.map +1 -0
  33. package/dist/cs-CZ.mjs +47 -0
  34. package/dist/cs-CZ.module.js +47 -0
  35. package/dist/cs-CZ.module.js.map +1 -0
  36. package/dist/da-DK.main.js +44 -0
  37. package/dist/da-DK.main.js.map +1 -0
  38. package/dist/da-DK.mjs +46 -0
  39. package/dist/da-DK.module.js +46 -0
  40. package/dist/da-DK.module.js.map +1 -0
  41. package/dist/de-DE.main.js +44 -0
  42. package/dist/de-DE.main.js.map +1 -0
  43. package/dist/de-DE.mjs +46 -0
  44. package/dist/de-DE.module.js +46 -0
  45. package/dist/de-DE.module.js.map +1 -0
  46. package/dist/el-GR.main.js +44 -0
  47. package/dist/el-GR.main.js.map +1 -0
  48. package/dist/el-GR.mjs +46 -0
  49. package/dist/el-GR.module.js +46 -0
  50. package/dist/el-GR.module.js.map +1 -0
  51. package/dist/en-US.main.js +44 -0
  52. package/dist/en-US.main.js.map +1 -0
  53. package/dist/en-US.mjs +46 -0
  54. package/dist/en-US.module.js +46 -0
  55. package/dist/en-US.module.js.map +1 -0
  56. package/dist/es-ES.main.js +44 -0
  57. package/dist/es-ES.main.js.map +1 -0
  58. package/dist/es-ES.mjs +46 -0
  59. package/dist/es-ES.module.js +46 -0
  60. package/dist/es-ES.module.js.map +1 -0
  61. package/dist/et-EE.main.js +44 -0
  62. package/dist/et-EE.main.js.map +1 -0
  63. package/dist/et-EE.mjs +46 -0
  64. package/dist/et-EE.module.js +46 -0
  65. package/dist/et-EE.module.js.map +1 -0
  66. package/dist/fi-FI.main.js +44 -0
  67. package/dist/fi-FI.main.js.map +1 -0
  68. package/dist/fi-FI.mjs +46 -0
  69. package/dist/fi-FI.module.js +46 -0
  70. package/dist/fi-FI.module.js.map +1 -0
  71. package/dist/fr-FR.main.js +44 -0
  72. package/dist/fr-FR.main.js.map +1 -0
  73. package/dist/fr-FR.mjs +46 -0
  74. package/dist/fr-FR.module.js +46 -0
  75. package/dist/fr-FR.module.js.map +1 -0
  76. package/dist/he-IL.main.js +44 -0
  77. package/dist/he-IL.main.js.map +1 -0
  78. package/dist/he-IL.mjs +46 -0
  79. package/dist/he-IL.module.js +46 -0
  80. package/dist/he-IL.module.js.map +1 -0
  81. package/dist/hr-HR.main.js +44 -0
  82. package/dist/hr-HR.main.js.map +1 -0
  83. package/dist/hr-HR.mjs +46 -0
  84. package/dist/hr-HR.module.js +46 -0
  85. package/dist/hr-HR.module.js.map +1 -0
  86. package/dist/hu-HU.main.js +44 -0
  87. package/dist/hu-HU.main.js.map +1 -0
  88. package/dist/hu-HU.mjs +46 -0
  89. package/dist/hu-HU.module.js +46 -0
  90. package/dist/hu-HU.module.js.map +1 -0
  91. package/dist/import.mjs +39 -0
  92. package/dist/intlStrings.main.js +108 -0
  93. package/dist/intlStrings.main.js.map +1 -0
  94. package/dist/intlStrings.mjs +110 -0
  95. package/dist/intlStrings.module.js +110 -0
  96. package/dist/intlStrings.module.js.map +1 -0
  97. package/dist/it-IT.main.js +44 -0
  98. package/dist/it-IT.main.js.map +1 -0
  99. package/dist/it-IT.mjs +46 -0
  100. package/dist/it-IT.module.js +46 -0
  101. package/dist/it-IT.module.js.map +1 -0
  102. package/dist/ja-JP.main.js +44 -0
  103. package/dist/ja-JP.main.js.map +1 -0
  104. package/dist/ja-JP.mjs +46 -0
  105. package/dist/ja-JP.module.js +46 -0
  106. package/dist/ja-JP.module.js.map +1 -0
  107. package/dist/ko-KR.main.js +44 -0
  108. package/dist/ko-KR.main.js.map +1 -0
  109. package/dist/ko-KR.mjs +46 -0
  110. package/dist/ko-KR.module.js +46 -0
  111. package/dist/ko-KR.module.js.map +1 -0
  112. package/dist/lt-LT.main.js +44 -0
  113. package/dist/lt-LT.main.js.map +1 -0
  114. package/dist/lt-LT.mjs +46 -0
  115. package/dist/lt-LT.module.js +46 -0
  116. package/dist/lt-LT.module.js.map +1 -0
  117. package/dist/lv-LV.main.js +44 -0
  118. package/dist/lv-LV.main.js.map +1 -0
  119. package/dist/lv-LV.mjs +46 -0
  120. package/dist/lv-LV.module.js +46 -0
  121. package/dist/lv-LV.module.js.map +1 -0
  122. package/dist/main.js +39 -1873
  123. package/dist/main.js.map +1 -1
  124. package/dist/module.js +24 -1853
  125. package/dist/module.js.map +1 -1
  126. package/dist/nb-NO.main.js +44 -0
  127. package/dist/nb-NO.main.js.map +1 -0
  128. package/dist/nb-NO.mjs +46 -0
  129. package/dist/nb-NO.module.js +46 -0
  130. package/dist/nb-NO.module.js.map +1 -0
  131. package/dist/nl-NL.main.js +44 -0
  132. package/dist/nl-NL.main.js.map +1 -0
  133. package/dist/nl-NL.mjs +46 -0
  134. package/dist/nl-NL.module.js +46 -0
  135. package/dist/nl-NL.module.js.map +1 -0
  136. package/dist/pl-PL.main.js +44 -0
  137. package/dist/pl-PL.main.js.map +1 -0
  138. package/dist/pl-PL.mjs +46 -0
  139. package/dist/pl-PL.module.js +46 -0
  140. package/dist/pl-PL.module.js.map +1 -0
  141. package/dist/pt-BR.main.js +44 -0
  142. package/dist/pt-BR.main.js.map +1 -0
  143. package/dist/pt-BR.mjs +46 -0
  144. package/dist/pt-BR.module.js +46 -0
  145. package/dist/pt-BR.module.js.map +1 -0
  146. package/dist/pt-PT.main.js +44 -0
  147. package/dist/pt-PT.main.js.map +1 -0
  148. package/dist/pt-PT.mjs +46 -0
  149. package/dist/pt-PT.module.js +46 -0
  150. package/dist/pt-PT.module.js.map +1 -0
  151. package/dist/ro-RO.main.js +44 -0
  152. package/dist/ro-RO.main.js.map +1 -0
  153. package/dist/ro-RO.mjs +46 -0
  154. package/dist/ro-RO.module.js +46 -0
  155. package/dist/ro-RO.module.js.map +1 -0
  156. package/dist/ru-RU.main.js +44 -0
  157. package/dist/ru-RU.main.js.map +1 -0
  158. package/dist/ru-RU.mjs +46 -0
  159. package/dist/ru-RU.module.js +46 -0
  160. package/dist/ru-RU.module.js.map +1 -0
  161. package/dist/sk-SK.main.js +44 -0
  162. package/dist/sk-SK.main.js.map +1 -0
  163. package/dist/sk-SK.mjs +46 -0
  164. package/dist/sk-SK.module.js +46 -0
  165. package/dist/sk-SK.module.js.map +1 -0
  166. package/dist/sl-SI.main.js +44 -0
  167. package/dist/sl-SI.main.js.map +1 -0
  168. package/dist/sl-SI.mjs +46 -0
  169. package/dist/sl-SI.module.js +46 -0
  170. package/dist/sl-SI.module.js.map +1 -0
  171. package/dist/sr-SP.main.js +44 -0
  172. package/dist/sr-SP.main.js.map +1 -0
  173. package/dist/sr-SP.mjs +46 -0
  174. package/dist/sr-SP.module.js +46 -0
  175. package/dist/sr-SP.module.js.map +1 -0
  176. package/dist/sv-SE.main.js +44 -0
  177. package/dist/sv-SE.main.js.map +1 -0
  178. package/dist/sv-SE.mjs +46 -0
  179. package/dist/sv-SE.module.js +46 -0
  180. package/dist/sv-SE.module.js.map +1 -0
  181. package/dist/tr-TR.main.js +44 -0
  182. package/dist/tr-TR.main.js.map +1 -0
  183. package/dist/tr-TR.mjs +46 -0
  184. package/dist/tr-TR.module.js +46 -0
  185. package/dist/tr-TR.module.js.map +1 -0
  186. package/dist/types.d.ts +177 -29
  187. package/dist/types.d.ts.map +1 -1
  188. package/dist/uk-UA.main.js +44 -0
  189. package/dist/uk-UA.main.js.map +1 -0
  190. package/dist/uk-UA.mjs +46 -0
  191. package/dist/uk-UA.module.js +46 -0
  192. package/dist/uk-UA.module.js.map +1 -0
  193. package/dist/useAutoScroll.main.js +89 -0
  194. package/dist/useAutoScroll.main.js.map +1 -0
  195. package/dist/useAutoScroll.mjs +84 -0
  196. package/dist/useAutoScroll.module.js +84 -0
  197. package/dist/useAutoScroll.module.js.map +1 -0
  198. package/dist/useClipboard.main.js +107 -0
  199. package/dist/useClipboard.main.js.map +1 -0
  200. package/dist/useClipboard.mjs +102 -0
  201. package/dist/useClipboard.module.js +102 -0
  202. package/dist/useClipboard.module.js.map +1 -0
  203. package/dist/useDrag.main.js +286 -0
  204. package/dist/useDrag.main.js.map +1 -0
  205. package/dist/useDrag.mjs +281 -0
  206. package/dist/useDrag.module.js +281 -0
  207. package/dist/useDrag.module.js.map +1 -0
  208. package/dist/useDraggableCollection.main.js +27 -0
  209. package/dist/useDraggableCollection.main.js.map +1 -0
  210. package/dist/useDraggableCollection.mjs +22 -0
  211. package/dist/useDraggableCollection.module.js +22 -0
  212. package/dist/useDraggableCollection.module.js.map +1 -0
  213. package/dist/useDraggableItem.main.js +128 -0
  214. package/dist/useDraggableItem.main.js.map +1 -0
  215. package/dist/useDraggableItem.mjs +123 -0
  216. package/dist/useDraggableItem.module.js +123 -0
  217. package/dist/useDraggableItem.module.js.map +1 -0
  218. package/dist/useDrop.main.js +299 -0
  219. package/dist/useDrop.main.js.map +1 -0
  220. package/dist/useDrop.mjs +294 -0
  221. package/dist/useDrop.module.js +294 -0
  222. package/dist/useDrop.module.js.map +1 -0
  223. package/dist/useDropIndicator.main.js +93 -0
  224. package/dist/useDropIndicator.main.js.map +1 -0
  225. package/dist/useDropIndicator.mjs +88 -0
  226. package/dist/useDropIndicator.module.js +88 -0
  227. package/dist/useDropIndicator.module.js.map +1 -0
  228. package/dist/useDroppableCollection.main.js +592 -0
  229. package/dist/useDroppableCollection.main.js.map +1 -0
  230. package/dist/useDroppableCollection.mjs +587 -0
  231. package/dist/useDroppableCollection.module.js +587 -0
  232. package/dist/useDroppableCollection.module.js.map +1 -0
  233. package/dist/useDroppableItem.main.js +79 -0
  234. package/dist/useDroppableItem.main.js.map +1 -0
  235. package/dist/useDroppableItem.mjs +74 -0
  236. package/dist/useDroppableItem.module.js +74 -0
  237. package/dist/useDroppableItem.module.js.map +1 -0
  238. package/dist/useVirtualDrop.main.js +56 -0
  239. package/dist/useVirtualDrop.main.js.map +1 -0
  240. package/dist/useVirtualDrop.mjs +51 -0
  241. package/dist/useVirtualDrop.module.js +51 -0
  242. package/dist/useVirtualDrop.module.js.map +1 -0
  243. package/dist/utils.main.js +283 -0
  244. package/dist/utils.main.js.map +1 -0
  245. package/dist/utils.mjs +255 -0
  246. package/dist/utils.module.js +255 -0
  247. package/dist/utils.module.js.map +1 -0
  248. package/dist/zh-CN.main.js +44 -0
  249. package/dist/zh-CN.main.js.map +1 -0
  250. package/dist/zh-CN.mjs +46 -0
  251. package/dist/zh-CN.module.js +46 -0
  252. package/dist/zh-CN.module.js.map +1 -0
  253. package/dist/zh-TW.main.js +44 -0
  254. package/dist/zh-TW.main.js.map +1 -0
  255. package/dist/zh-TW.mjs +46 -0
  256. package/dist/zh-TW.module.js +46 -0
  257. package/dist/zh-TW.module.js.map +1 -0
  258. package/package.json +20 -16
  259. package/src/DragManager.ts +87 -52
  260. package/src/DragPreview.tsx +3 -3
  261. package/src/ListDropTargetDelegate.ts +173 -0
  262. package/src/constants.ts +2 -0
  263. package/src/index.ts +55 -9
  264. package/src/useAutoScroll.ts +26 -6
  265. package/src/useClipboard.ts +65 -59
  266. package/src/useDrag.ts +179 -31
  267. package/src/useDraggableCollection.ts +29 -0
  268. package/src/useDraggableItem.ts +105 -12
  269. package/src/useDrop.ts +273 -93
  270. package/src/useDropIndicator.ts +47 -21
  271. package/src/useDroppableCollection.ts +315 -115
  272. package/src/useDroppableItem.ts +33 -17
  273. package/src/useVirtualDrop.ts +5 -5
  274. package/src/utils.ts +92 -17
  275. package/LICENSE +0 -201
@@ -0,0 +1,50 @@
1
+ import {flushSync as $eLjnH$flushSync} from "react-dom";
2
+ import $eLjnH$react, {useState as $eLjnH$useState, useRef as $eLjnH$useRef, useImperativeHandle as $eLjnH$useImperativeHandle} from "react";
3
+
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
+
16
+ function $ad0e3f3d9c50e4ba$var$DragPreview(props, ref) {
17
+ let render = props.children;
18
+ let [children, setChildren] = (0, $eLjnH$useState)(null);
19
+ let domRef = (0, $eLjnH$useRef)(null);
20
+ (0, $eLjnH$useImperativeHandle)(ref, ()=>(items, callback)=>{
21
+ // This will be called during the onDragStart event by useDrag. We need to render the
22
+ // preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.
23
+ (0, $eLjnH$flushSync)(()=>{
24
+ setChildren(render(items));
25
+ });
26
+ // Yield back to useDrag to set the drag image.
27
+ callback(domRef.current);
28
+ // Remove the preview from the DOM after a frame so the browser has time to paint.
29
+ requestAnimationFrame(()=>{
30
+ setChildren(null);
31
+ });
32
+ }, [
33
+ render
34
+ ]);
35
+ if (!children) return null;
36
+ return /*#__PURE__*/ (0, $eLjnH$react).createElement("div", {
37
+ style: {
38
+ zIndex: -100,
39
+ position: 'absolute',
40
+ top: 0,
41
+ left: -100000
42
+ },
43
+ ref: domRef
44
+ }, children);
45
+ }
46
+ let $ad0e3f3d9c50e4ba$export$905ab40ac2179daa = /*#__PURE__*/ (0, $eLjnH$react).forwardRef($ad0e3f3d9c50e4ba$var$DragPreview);
47
+
48
+
49
+ export {$ad0e3f3d9c50e4ba$export$905ab40ac2179daa as DragPreview};
50
+ //# sourceMappingURL=DragPreview.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;AAAA;;;;;;;;;;CAUC;;AAUD,SAAS,kCAAY,KAAuB,EAAE,GAA0C;IACtF,IAAI,SAAS,MAAM,QAAQ;IAC3B,IAAI,CAAC,UAAU,YAAY,GAAG,CAAA,GAAA,eAAO,EAAe;IACpD,IAAI,SAAS,CAAA,GAAA,aAAK,EAAE;IAEpB,CAAA,GAAA,0BAAkB,EAAE,KAAK,IAAM,CAAC,OAAmB;YACjD,qFAAqF;YACrF,kGAAkG;YAClG,CAAA,GAAA,gBAAQ,EAAE;gBACR,YAAY,OAAO;YACrB;YAEA,+CAA+C;YAC/C,SAAS,OAAO,OAAO;YAEvB,kFAAkF;YAClF,sBAAsB;gBACpB,YAAY;YACd;QACF,GAAG;QAAC;KAAO;IAEX,IAAI,CAAC,UACH,OAAO;IAGT,qBACE,gCAAC;QAAI,OAAO;YAAC,QAAQ;YAAM,UAAU;YAAY,KAAK;YAAG,MAAM;QAAO;QAAG,KAAK;OAC3E;AAGP;AAEA,IAAI,0DAAe,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-aria/dnd/src/DragPreview.tsx"],"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 {DragItem, DragPreviewRenderer, RefObject} from '@react-types/shared';\nimport {flushSync} from 'react-dom';\nimport React, {JSX, useImperativeHandle, useRef, useState} from 'react';\n\nexport interface DragPreviewProps {\n children: (items: DragItem[]) => JSX.Element\n}\n\nfunction DragPreview(props: DragPreviewProps, ref: RefObject<DragPreviewRenderer | null>) {\n let render = props.children;\n let [children, setChildren] = useState<JSX.Element>(null);\n let domRef = useRef(null);\n\n useImperativeHandle(ref, () => (items: DragItem[], callback: (node: HTMLElement) => void) => {\n // This will be called during the onDragStart event by useDrag. We need to render the\n // preview synchronously before this event returns so we can call event.dataTransfer.setDragImage.\n flushSync(() => {\n setChildren(render(items));\n });\n\n // Yield back to useDrag to set the drag image.\n callback(domRef.current);\n\n // Remove the preview from the DOM after a frame so the browser has time to paint.\n requestAnimationFrame(() => {\n setChildren(null);\n });\n }, [render]);\n\n if (!children) {\n return null;\n }\n\n return (\n <div style={{zIndex: -100, position: 'absolute', top: 0, left: -100000}} ref={domRef}>\n {children}\n </div>\n );\n}\n\nlet _DragPreview = React.forwardRef(DragPreview);\nexport {_DragPreview as DragPreview};\n"],"names":[],"version":3,"file":"DragPreview.module.js.map"}
@@ -0,0 +1,123 @@
1
+
2
+ function $parcel$export(e, n, v, s) {
3
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
4
+ }
5
+
6
+ $parcel$export(module.exports, "ListDropTargetDelegate", () => $2268795bbb597ecb$export$fbd65d14c79e28cc);
7
+ class $2268795bbb597ecb$export$fbd65d14c79e28cc {
8
+ getPrimaryStart(rect) {
9
+ return this.orientation === 'horizontal' ? rect.left : rect.top;
10
+ }
11
+ getPrimaryEnd(rect) {
12
+ return this.orientation === 'horizontal' ? rect.right : rect.bottom;
13
+ }
14
+ getSecondaryStart(rect) {
15
+ return this.orientation === 'horizontal' ? rect.top : rect.left;
16
+ }
17
+ getSecondaryEnd(rect) {
18
+ return this.orientation === 'horizontal' ? rect.bottom : rect.right;
19
+ }
20
+ getFlowStart(rect) {
21
+ return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);
22
+ }
23
+ getFlowEnd(rect) {
24
+ return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);
25
+ }
26
+ getFlowSize(rect) {
27
+ return this.getFlowEnd(rect) - this.getFlowStart(rect);
28
+ }
29
+ getDropTargetFromPoint(x, y, isValidDropTarget) {
30
+ if (this.collection[Symbol.iterator]().next().done) return {
31
+ type: 'root'
32
+ };
33
+ let rect = this.ref.current.getBoundingClientRect();
34
+ let primary = this.orientation === 'horizontal' ? x : y;
35
+ let secondary = this.orientation === 'horizontal' ? y : x;
36
+ primary += this.getPrimaryStart(rect);
37
+ secondary += this.getSecondaryStart(rect);
38
+ let flow = this.layout === 'stack' ? primary : secondary;
39
+ let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';
40
+ let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';
41
+ let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;
42
+ let elements = this.ref.current.querySelectorAll('[data-key]');
43
+ let elementMap = new Map();
44
+ for (let item of elements)if (item instanceof HTMLElement) elementMap.set(item.dataset.key, item);
45
+ // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader
46
+ // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.
47
+ // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic
48
+ // that may need to happen then
49
+ let items = [
50
+ ...this.collection
51
+ ].filter((item)=>item.type === 'item');
52
+ let low = 0;
53
+ let high = items.length;
54
+ while(low < high){
55
+ let mid = Math.floor((low + high) / 2);
56
+ let item = items[mid];
57
+ let element = elementMap.get(String(item.key));
58
+ let rect = element.getBoundingClientRect();
59
+ let update = (isGreater)=>{
60
+ if (isGreater) low = mid + 1;
61
+ else high = mid;
62
+ };
63
+ if (primary < this.getPrimaryStart(rect)) update(isPrimaryRTL);
64
+ else if (primary > this.getPrimaryEnd(rect)) update(!isPrimaryRTL);
65
+ else if (secondary < this.getSecondaryStart(rect)) update(isSecondaryRTL);
66
+ else if (secondary > this.getSecondaryEnd(rect)) update(!isSecondaryRTL);
67
+ else {
68
+ let target = {
69
+ type: 'item',
70
+ key: item.key,
71
+ dropPosition: 'on'
72
+ };
73
+ if (isValidDropTarget(target)) {
74
+ // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px
75
+ // of the start or end of the item.
76
+ if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({
77
+ ...target,
78
+ dropPosition: 'before'
79
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
80
+ else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({
81
+ ...target,
82
+ dropPosition: 'after'
83
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
84
+ } else {
85
+ // If dropping on the item isn't accepted, try the target before or after depending on the position.
86
+ let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;
87
+ if (flow <= mid && isValidDropTarget({
88
+ ...target,
89
+ dropPosition: 'before'
90
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
91
+ else if (flow >= mid && isValidDropTarget({
92
+ ...target,
93
+ dropPosition: 'after'
94
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
95
+ }
96
+ return target;
97
+ }
98
+ }
99
+ let item = items[Math.min(low, items.length - 1)];
100
+ let element = elementMap.get(String(item.key));
101
+ rect = element.getBoundingClientRect();
102
+ if (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect))) return {
103
+ type: 'item',
104
+ key: item.key,
105
+ dropPosition: isFlowRTL ? 'after' : 'before'
106
+ };
107
+ return {
108
+ type: 'item',
109
+ key: item.key,
110
+ dropPosition: isFlowRTL ? 'before' : 'after'
111
+ };
112
+ }
113
+ constructor(collection, ref, options){
114
+ this.collection = collection;
115
+ this.ref = ref;
116
+ this.layout = (options === null || options === void 0 ? void 0 : options.layout) || 'stack';
117
+ this.orientation = (options === null || options === void 0 ? void 0 : options.orientation) || 'vertical';
118
+ this.direction = (options === null || options === void 0 ? void 0 : options.direction) || 'ltr';
119
+ }
120
+ }
121
+
122
+
123
+ //# sourceMappingURL=ListDropTargetDelegate.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":";;;;;;AA8BO,MAAM;IAeH,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;IACjE;IAEQ,cAAc,IAAa,EAAE;QACnC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IACrE;IAEQ,kBAAkB,IAAa,EAAE;QACvC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,GAAG,GAAG,KAAK,IAAI;IACjE;IAEQ,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,MAAM,GAAG,KAAK,KAAK;IACrE;IAEQ,aAAa,IAAa,EAAE;QAClC,OAAO,IAAI,CAAC,MAAM,KAAK,UAAU,IAAI,CAAC,eA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Q,OAAO,kBAAkB;wBAAC,GAAG,MAAM;wBAAE,cAAc;oBAAQ,IACrE,OAAO,YAAY,GAAG,YAAY,UAAU;yBACvC,IAAI,QAAQ,OAAO,kBAAkB;wBAAC,GAAG,MAAM;wBAAE,cAAc;oBAAO,IAC3E,OAAO,YAAY,GAAG,YAAY,WAAW;gBAEjD;gBAEA,OAAO;YACT;QACF;QAEA,IAAI,OAAO,KAAK,CAAC,KAAK,GAAG,CAAC,KAAK,MAAM,MAAM,GAAG,GAAG;QACjD,IAAI,UAAU,WAAW,GAAG,CAAC,OAAO,KAAK,GAAG;QAC5C,OAAO,QAAQ,qBAAqB;QAEpC,IAAI,UAAU,IAAI,CAAC,eAAe,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,YAAY,CAAC,SAAS,KAAK,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,CAAC,QACrH,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,UAAU;QACtC;QAGF,OAAO;YACL,MAAM;YACN,KAAK,KAAK,GAAG;YACb,cAAc,YAAY,WAAW;QACvC;IACF;IAtIA,YAAY,UAAmC,EAAE,GAAkC,EAAE,OAAuC,CAAE;QAC5H,IAAI,CAAC,UAAU,GAAG;QAClB,IAAI,CAAC,GAAG,GAAG;QACX,IAAI,CAAC,MAAM,GAAG,CAAA,oBAAA,8BAAA,QAAS,MAAM,KAAI;QACjC,IAAI,CAAC,WAAW,GAAG,CAAA,oBAAA,8BAAA,QAAS,WAAW,KAAI;QAC3C,IAAI,CAAC,SAAS,GAAG,CAAA,oBAAA,8BAAA,QAAS,SAAS,KAAI;IACzC;AAiIF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n private direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done) {\n return {type: 'root'};\n }\n\n let rect = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let elements = this.ref.current.querySelectorAll('[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element.getBoundingClientRect();\n\n if (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n }\n}\n"],"names":[],"version":3,"file":"ListDropTargetDelegate.main.js.map"}
@@ -0,0 +1,118 @@
1
+ class $3ca85212bf8898e4$export$fbd65d14c79e28cc {
2
+ getPrimaryStart(rect) {
3
+ return this.orientation === 'horizontal' ? rect.left : rect.top;
4
+ }
5
+ getPrimaryEnd(rect) {
6
+ return this.orientation === 'horizontal' ? rect.right : rect.bottom;
7
+ }
8
+ getSecondaryStart(rect) {
9
+ return this.orientation === 'horizontal' ? rect.top : rect.left;
10
+ }
11
+ getSecondaryEnd(rect) {
12
+ return this.orientation === 'horizontal' ? rect.bottom : rect.right;
13
+ }
14
+ getFlowStart(rect) {
15
+ return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);
16
+ }
17
+ getFlowEnd(rect) {
18
+ return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);
19
+ }
20
+ getFlowSize(rect) {
21
+ return this.getFlowEnd(rect) - this.getFlowStart(rect);
22
+ }
23
+ getDropTargetFromPoint(x, y, isValidDropTarget) {
24
+ if (this.collection[Symbol.iterator]().next().done) return {
25
+ type: 'root'
26
+ };
27
+ let rect = this.ref.current.getBoundingClientRect();
28
+ let primary = this.orientation === 'horizontal' ? x : y;
29
+ let secondary = this.orientation === 'horizontal' ? y : x;
30
+ primary += this.getPrimaryStart(rect);
31
+ secondary += this.getSecondaryStart(rect);
32
+ let flow = this.layout === 'stack' ? primary : secondary;
33
+ let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';
34
+ let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';
35
+ let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;
36
+ let elements = this.ref.current.querySelectorAll('[data-key]');
37
+ let elementMap = new Map();
38
+ for (let item of elements)if (item instanceof HTMLElement) elementMap.set(item.dataset.key, item);
39
+ // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader
40
+ // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.
41
+ // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic
42
+ // that may need to happen then
43
+ let items = [
44
+ ...this.collection
45
+ ].filter((item)=>item.type === 'item');
46
+ let low = 0;
47
+ let high = items.length;
48
+ while(low < high){
49
+ let mid = Math.floor((low + high) / 2);
50
+ let item = items[mid];
51
+ let element = elementMap.get(String(item.key));
52
+ let rect = element.getBoundingClientRect();
53
+ let update = (isGreater)=>{
54
+ if (isGreater) low = mid + 1;
55
+ else high = mid;
56
+ };
57
+ if (primary < this.getPrimaryStart(rect)) update(isPrimaryRTL);
58
+ else if (primary > this.getPrimaryEnd(rect)) update(!isPrimaryRTL);
59
+ else if (secondary < this.getSecondaryStart(rect)) update(isSecondaryRTL);
60
+ else if (secondary > this.getSecondaryEnd(rect)) update(!isSecondaryRTL);
61
+ else {
62
+ let target = {
63
+ type: 'item',
64
+ key: item.key,
65
+ dropPosition: 'on'
66
+ };
67
+ if (isValidDropTarget(target)) {
68
+ // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px
69
+ // of the start or end of the item.
70
+ if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({
71
+ ...target,
72
+ dropPosition: 'before'
73
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
74
+ else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({
75
+ ...target,
76
+ dropPosition: 'after'
77
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
78
+ } else {
79
+ // If dropping on the item isn't accepted, try the target before or after depending on the position.
80
+ let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;
81
+ if (flow <= mid && isValidDropTarget({
82
+ ...target,
83
+ dropPosition: 'before'
84
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
85
+ else if (flow >= mid && isValidDropTarget({
86
+ ...target,
87
+ dropPosition: 'after'
88
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
89
+ }
90
+ return target;
91
+ }
92
+ }
93
+ let item = items[Math.min(low, items.length - 1)];
94
+ let element = elementMap.get(String(item.key));
95
+ rect = element.getBoundingClientRect();
96
+ if (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect))) return {
97
+ type: 'item',
98
+ key: item.key,
99
+ dropPosition: isFlowRTL ? 'after' : 'before'
100
+ };
101
+ return {
102
+ type: 'item',
103
+ key: item.key,
104
+ dropPosition: isFlowRTL ? 'before' : 'after'
105
+ };
106
+ }
107
+ constructor(collection, ref, options){
108
+ this.collection = collection;
109
+ this.ref = ref;
110
+ this.layout = (options === null || options === void 0 ? void 0 : options.layout) || 'stack';
111
+ this.orientation = (options === null || options === void 0 ? void 0 : options.orientation) || 'vertical';
112
+ this.direction = (options === null || options === void 0 ? void 0 : options.direction) || 'ltr';
113
+ }
114
+ }
115
+
116
+
117
+ export {$3ca85212bf8898e4$export$fbd65d14c79e28cc as ListDropTargetDelegate};
118
+ //# sourceMappingURL=ListDropTargetDelegate.module.js.map
@@ -0,0 +1,118 @@
1
+ class $3ca85212bf8898e4$export$fbd65d14c79e28cc {
2
+ getPrimaryStart(rect) {
3
+ return this.orientation === 'horizontal' ? rect.left : rect.top;
4
+ }
5
+ getPrimaryEnd(rect) {
6
+ return this.orientation === 'horizontal' ? rect.right : rect.bottom;
7
+ }
8
+ getSecondaryStart(rect) {
9
+ return this.orientation === 'horizontal' ? rect.top : rect.left;
10
+ }
11
+ getSecondaryEnd(rect) {
12
+ return this.orientation === 'horizontal' ? rect.bottom : rect.right;
13
+ }
14
+ getFlowStart(rect) {
15
+ return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);
16
+ }
17
+ getFlowEnd(rect) {
18
+ return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);
19
+ }
20
+ getFlowSize(rect) {
21
+ return this.getFlowEnd(rect) - this.getFlowStart(rect);
22
+ }
23
+ getDropTargetFromPoint(x, y, isValidDropTarget) {
24
+ if (this.collection[Symbol.iterator]().next().done) return {
25
+ type: 'root'
26
+ };
27
+ let rect = this.ref.current.getBoundingClientRect();
28
+ let primary = this.orientation === 'horizontal' ? x : y;
29
+ let secondary = this.orientation === 'horizontal' ? y : x;
30
+ primary += this.getPrimaryStart(rect);
31
+ secondary += this.getSecondaryStart(rect);
32
+ let flow = this.layout === 'stack' ? primary : secondary;
33
+ let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';
34
+ let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';
35
+ let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;
36
+ let elements = this.ref.current.querySelectorAll('[data-key]');
37
+ let elementMap = new Map();
38
+ for (let item of elements)if (item instanceof HTMLElement) elementMap.set(item.dataset.key, item);
39
+ // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader
40
+ // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.
41
+ // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic
42
+ // that may need to happen then
43
+ let items = [
44
+ ...this.collection
45
+ ].filter((item)=>item.type === 'item');
46
+ let low = 0;
47
+ let high = items.length;
48
+ while(low < high){
49
+ let mid = Math.floor((low + high) / 2);
50
+ let item = items[mid];
51
+ let element = elementMap.get(String(item.key));
52
+ let rect = element.getBoundingClientRect();
53
+ let update = (isGreater)=>{
54
+ if (isGreater) low = mid + 1;
55
+ else high = mid;
56
+ };
57
+ if (primary < this.getPrimaryStart(rect)) update(isPrimaryRTL);
58
+ else if (primary > this.getPrimaryEnd(rect)) update(!isPrimaryRTL);
59
+ else if (secondary < this.getSecondaryStart(rect)) update(isSecondaryRTL);
60
+ else if (secondary > this.getSecondaryEnd(rect)) update(!isSecondaryRTL);
61
+ else {
62
+ let target = {
63
+ type: 'item',
64
+ key: item.key,
65
+ dropPosition: 'on'
66
+ };
67
+ if (isValidDropTarget(target)) {
68
+ // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px
69
+ // of the start or end of the item.
70
+ if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({
71
+ ...target,
72
+ dropPosition: 'before'
73
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
74
+ else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({
75
+ ...target,
76
+ dropPosition: 'after'
77
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
78
+ } else {
79
+ // If dropping on the item isn't accepted, try the target before or after depending on the position.
80
+ let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;
81
+ if (flow <= mid && isValidDropTarget({
82
+ ...target,
83
+ dropPosition: 'before'
84
+ })) target.dropPosition = isFlowRTL ? 'after' : 'before';
85
+ else if (flow >= mid && isValidDropTarget({
86
+ ...target,
87
+ dropPosition: 'after'
88
+ })) target.dropPosition = isFlowRTL ? 'before' : 'after';
89
+ }
90
+ return target;
91
+ }
92
+ }
93
+ let item = items[Math.min(low, items.length - 1)];
94
+ let element = elementMap.get(String(item.key));
95
+ rect = element.getBoundingClientRect();
96
+ if (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect))) return {
97
+ type: 'item',
98
+ key: item.key,
99
+ dropPosition: isFlowRTL ? 'after' : 'before'
100
+ };
101
+ return {
102
+ type: 'item',
103
+ key: item.key,
104
+ dropPosition: isFlowRTL ? 'before' : 'after'
105
+ };
106
+ }
107
+ constructor(collection, ref, options){
108
+ this.collection = collection;
109
+ this.ref = ref;
110
+ this.layout = (options === null || options === void 0 ? void 0 : options.layout) || 'stack';
111
+ this.orientation = (options === null || options === void 0 ? void 0 : options.orientation) || 'vertical';
112
+ this.direction = (options === null || options === void 0 ? void 0 : options.direction) || 'ltr';
113
+ }
114
+ }
115
+
116
+
117
+ export {$3ca85212bf8898e4$export$fbd65d14c79e28cc as ListDropTargetDelegate};
118
+ //# sourceMappingURL=ListDropTargetDelegate.module.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AA8BO,MAAM;IAeH,gBAAgB,IAAa,EAAE;QACrC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,IAAI,GAAG,KAAK,GAAG;IACjE;IAEQ,cAAc,IAAa,EAAE;QACnC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,KAAK,KAAK,GAAG,KAAK,MAAM;IACrE;IAEQ,kBAAkB,IAAa,EAAE;QACvC,OAAO,IAAI,CAAC,WAAW,KAAK,eAAe,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AAS,SAAS,KAAI;IACzC;AAiIF","sources":["packages/@react-aria/dnd/src/ListDropTargetDelegate.ts"],"sourcesContent":["import {Direction, DropTarget, DropTargetDelegate, Node, Orientation, RefObject} from '@react-types/shared';\n\ninterface ListDropTargetDelegateOptions {\n /**\n * Whether the items are arranged in a stack or grid.\n * @default 'stack'\n */\n layout?: 'stack' | 'grid',\n /**\n * The primary orientation of the items. Usually this is the\n * direction that the collection scrolls.\n * @default 'vertical'\n */\n orientation?: Orientation,\n /**\n * The horizontal layout direction.\n * @default 'ltr'\n */\n direction?: Direction\n}\n\n// Terms used in the below code:\n// * \"Primary\" – The main layout direction. For stacks, this is the direction\n// that the stack is arranged in (e.g. horizontal or vertical).\n// For grids, this is the main scroll direction.\n// * \"Secondary\" – The secondary layout direction. For stacks, there is no secondary\n// layout direction. For grids, this is the opposite of the primary direction.\n// * \"Flow\" – The flow direction of the items. For stacks, this is the the primary\n// direction. For grids, it is the secondary direction.\n\nexport class ListDropTargetDelegate implements DropTargetDelegate {\n private collection: Iterable<Node<unknown>>;\n private ref: RefObject<HTMLElement | null>;\n private layout: 'stack' | 'grid';\n private orientation: Orientation;\n private direction: Direction;\n\n constructor(collection: Iterable<Node<unknown>>, ref: RefObject<HTMLElement | null>, options?: ListDropTargetDelegateOptions) {\n this.collection = collection;\n this.ref = ref;\n this.layout = options?.layout || 'stack';\n this.orientation = options?.orientation || 'vertical';\n this.direction = options?.direction || 'ltr';\n }\n\n private getPrimaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.left : rect.top;\n }\n\n private getPrimaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.right : rect.bottom;\n }\n\n private getSecondaryStart(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.top : rect.left;\n }\n\n private getSecondaryEnd(rect: DOMRect) {\n return this.orientation === 'horizontal' ? rect.bottom : rect.right;\n }\n\n private getFlowStart(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryStart(rect) : this.getSecondaryStart(rect);\n }\n\n private getFlowEnd(rect: DOMRect) {\n return this.layout === 'stack' ? this.getPrimaryEnd(rect) : this.getSecondaryEnd(rect);\n }\n\n private getFlowSize(rect: DOMRect) {\n return this.getFlowEnd(rect) - this.getFlowStart(rect);\n }\n\n getDropTargetFromPoint(x: number, y: number, isValidDropTarget: (target: DropTarget) => boolean): DropTarget {\n if (this.collection[Symbol.iterator]().next().done) {\n return {type: 'root'};\n }\n\n let rect = this.ref.current.getBoundingClientRect();\n let primary = this.orientation === 'horizontal' ? x : y;\n let secondary = this.orientation === 'horizontal' ? y : x;\n primary += this.getPrimaryStart(rect);\n secondary += this.getSecondaryStart(rect);\n\n let flow = this.layout === 'stack' ? primary : secondary;\n let isPrimaryRTL = this.orientation === 'horizontal' && this.direction === 'rtl';\n let isSecondaryRTL = this.layout === 'grid' && this.orientation === 'vertical' && this.direction === 'rtl';\n let isFlowRTL = this.layout === 'stack' ? isPrimaryRTL : isSecondaryRTL;\n\n let elements = this.ref.current.querySelectorAll('[data-key]');\n let elementMap = new Map<string, HTMLElement>();\n for (let item of elements) {\n if (item instanceof HTMLElement) {\n elementMap.set(item.dataset.key, item);\n }\n }\n\n // TODO: assume that only item type items are valid drop targets. This is to prevent a crash when dragging over the loader\n // row since it doesn't have a data-key set on it. Will eventually need to handle the case with drag and drop and loaders located between rows aka tree.\n // Can see https://github.com/adobe/react-spectrum/pull/4210/files#diff-21e555e0c597a28215e36137f5be076a65a1e1456c92cd0fdd60f866929aae2a for additional logic\n // that may need to happen then\n let items = [...this.collection].filter(item => item.type === 'item');\n let low = 0;\n let high = items.length;\n while (low < high) {\n let mid = Math.floor((low + high) / 2);\n let item = items[mid];\n let element = elementMap.get(String(item.key));\n let rect = element.getBoundingClientRect();\n let update = (isGreater: boolean) => {\n if (isGreater) {\n low = mid + 1;\n } else {\n high = mid;\n }\n };\n\n if (primary < this.getPrimaryStart(rect)) {\n update(isPrimaryRTL);\n } else if (primary > this.getPrimaryEnd(rect)) {\n update(!isPrimaryRTL);\n } else if (secondary < this.getSecondaryStart(rect)) {\n update(isSecondaryRTL);\n } else if (secondary > this.getSecondaryEnd(rect)) {\n update(!isSecondaryRTL);\n } else {\n let target: DropTarget = {\n type: 'item',\n key: item.key,\n dropPosition: 'on'\n };\n\n if (isValidDropTarget(target)) {\n // Otherwise, if dropping on the item is accepted, try the before/after positions if within 5px\n // of the start or end of the item.\n if (flow <= this.getFlowStart(rect) + 5 && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= this.getFlowEnd(rect) - 5 && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n } else {\n // If dropping on the item isn't accepted, try the target before or after depending on the position.\n let mid = this.getFlowStart(rect) + this.getFlowSize(rect) / 2;\n if (flow <= mid && isValidDropTarget({...target, dropPosition: 'before'})) {\n target.dropPosition = isFlowRTL ? 'after' : 'before';\n } else if (flow >= mid && isValidDropTarget({...target, dropPosition: 'after'})) {\n target.dropPosition = isFlowRTL ? 'before' : 'after';\n }\n }\n\n return target;\n }\n }\n\n let item = items[Math.min(low, items.length - 1)];\n let element = elementMap.get(String(item.key));\n rect = element.getBoundingClientRect();\n\n if (primary < this.getPrimaryStart(rect) || Math.abs(flow - this.getFlowStart(rect)) < Math.abs(flow - this.getFlowEnd(rect))) {\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'after' : 'before'\n };\n }\n\n return {\n type: 'item',\n key: item.key,\n dropPosition: isFlowRTL ? 'before' : 'after'\n };\n }\n}\n"],"names":[],"version":3,"file":"ListDropTargetDelegate.module.js.map"}
@@ -0,0 +1,44 @@
1
+ module.exports = {
2
+ "dragDescriptionKeyboard": `\u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
3
+ "dragDescriptionKeyboardAlt": `\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Alt + Enter \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
4
+ "dragDescriptionLongPress": `\u{627}\u{636}\u{63A}\u{637} \u{628}\u{627}\u{633}\u{62A}\u{645}\u{631}\u{627}\u{631} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
5
+ "dragDescriptionTouch": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
6
+ "dragDescriptionVirtual": `\u{627}\u{646}\u{642}\u{631} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
7
+ "dragItem": (args)=>`\u{627}\u{633}\u{62D}\u{628} ${args.itemText}`,
8
+ "dragSelectedItems": (args, formatter)=>`\u{627}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
9
+ one: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,
10
+ other: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{627}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}\u{629}`
11
+ })}`,
12
+ "dragSelectedKeyboard": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Enter \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
13
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
14
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
15
+ })}.`,
16
+ "dragSelectedKeyboardAlt": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} \u{645}\u{641}\u{62A}\u{627}\u{62D}\u{64A} Alt + Enter \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
17
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
18
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
19
+ })}.`,
20
+ "dragSelectedLongPress": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{628}\u{627}\u{633}\u{62A}\u{645}\u{631}\u{627}\u{631} \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
21
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
22
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
23
+ })}.`,
24
+ "dragStartedKeyboard": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} Tab \u{644}\u{644}\u{627}\u{646}\u{62A}\u{642}\u{627}\u{644} \u{625}\u{644}\u{649} \u{645}\u{648}\u{636}\u{639} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} Escape \u{644}\u{644}\u{625}\u{644}\u{63A}\u{627}\u{621}.`,
25
+ "dragStartedTouch": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{62A}\u{642}\u{644} \u{625}\u{644}\u{649} \u{645}\u{648}\u{636}\u{639} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
26
+ "dragStartedVirtual": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{62A}\u{642}\u{644} \u{625}\u{644}\u{649} \u{645}\u{643}\u{627}\u{646} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{646}\u{642}\u{631} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
27
+ "dropCanceled": `\u{62A}\u{645} \u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
28
+ "dropComplete": `\u{627}\u{643}\u{62A}\u{645}\u{644} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
29
+ "dropDescriptionKeyboard": `\u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}. \u{627}\u{636}\u{63A}\u{637} Escape \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
30
+ "dropDescriptionTouch": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
31
+ "dropDescriptionVirtual": `\u{627}\u{646}\u{642}\u{631} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
32
+ "dropIndicator": `\u{645}\u{624}\u{634}\u{631} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}`,
33
+ "dropOnItem": (args)=>`\u{625}\u{641}\u{644}\u{627}\u{62A} ${args.itemText}`,
34
+ "dropOnRoot": `\u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}`,
35
+ "endDragKeyboard": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
36
+ "endDragTouch": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
37
+ "endDragVirtual": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{642}\u{631} \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
38
+ "insertAfter": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{628}\u{639}\u{62F} ${args.itemText}`,
39
+ "insertBefore": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{642}\u{628}\u{644} ${args.itemText}`,
40
+ "insertBetween": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{628}\u{64A}\u{646} ${args.beforeItemText} \u{648} ${args.afterItemText}`
41
+ };
42
+
43
+
44
+ //# sourceMappingURL=ar-AE.main.js.map
@@ -0,0 +1 @@
1
+ {"mappings":"AAAA,iBAAiB;IAAG,2BAA2B,CAAC,oGAAsB,CAAC;IACrE,8BAA8B,CAAC,gIAAgC,CAAC;IAChE,4BAA4B,CAAC,uJAAyB,CAAC;IACvD,wBAAwB,CAAC,kIAAsB,CAAC;IA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C,OAAS,CAAC,oCAAM,EAAE,KAAK,QAAQ,CAAC,CAAC;IAChD,cAAc,CAAC,iDAAO,CAAC;IACvB,mBAAmB,CAAC,uJAA+B,CAAC;IACpD,gBAAgB,CAAC,qLAA+B,CAAC;IACjD,kBAAkB,CAAC,iJAAyB,CAAC;IAC7C,eAAe,CAAC,OAAS,CAAC,mDAAS,EAAE,KAAK,QAAQ,CAAC,CAAC;IACpD,gBAAgB,CAAC,OAAS,CAAC,mDAAS,EAAE,KAAK,QAAQ,CAAC,CAAC;IACrD,iBAAiB,CAAC,OAAS,CAAC,mDAAS,EAAE,KAAK,cAAc,CAAC,SAAG,EAAE,KAAK,aAAa,CAAC,CAAC;AACtF","sources":["packages/@react-aria/dnd/intl/ar-AE.json"],"sourcesContent":["{\n \"dragDescriptionKeyboard\": \"اضغط Enter لبدء السحب.\",\n \"dragDescriptionKeyboardAlt\": \"اضغط على Alt + Enter لبدء السحب.\",\n \"dragDescriptionLongPress\": \"اضغط باستمرار لبدء السحب.\",\n \"dragDescriptionTouch\": \"اضغط مرتين لبدء السحب.\",\n \"dragDescriptionVirtual\": \"انقر لبدء السحب.\",\n \"dragItem\": \"اسحب {itemText}\",\n \"dragSelectedItems\": \"اسحب {count, plural, one {# عنصر محدد} other {# عناصر محددة}}\",\n \"dragSelectedKeyboard\": \"اضغط على Enter للسحب {count, plural, one {عدد العناصر المختارة} other {عدد العناصر المختارة}}.\",\n \"dragSelectedKeyboardAlt\": \"اضغط على مفتاحي Alt + Enter للسحب {count, plural, one {عدد العناصر المختارة} other {عدد العناصر المختارة}}.\",\n \"dragSelectedLongPress\": \"اضغط باستمرار للسحب {count, plural, one {عدد العناصر المختارة} other {عدد العناصر المختارة}}.\",\n \"dragStartedKeyboard\": \"بدأ السحب. اضغط Tab للانتقال إلى موضع الإفلات، ثم اضغط Enter للإفلات، أو اضغط Escape للإلغاء.\",\n \"dragStartedTouch\": \"بدأ السحب. انتقل إلى موضع الإفلات، ثم اضغط مرتين للإفلات.\",\n \"dragStartedVirtual\": \"بدأ السحب. انتقل إلى مكان الإفلات، ثم انقر أو اضغط Enter للإفلات.\",\n \"dropCanceled\": \"تم إلغاء الإفلات.\",\n \"dropComplete\": \"اكتمل الإفلات.\",\n \"dropDescriptionKeyboard\": \"اضغط Enter للإفلات. اضغط Escape لإلغاء السحب.\",\n \"dropDescriptionTouch\": \"اضغط مرتين للإفلات.\",\n \"dropDescriptionVirtual\": \"انقر للإفلات.\",\n \"dropIndicator\": \"مؤشر الإفلات\",\n \"dropOnItem\": \"إفلات {itemText}\",\n \"dropOnRoot\": \"الإفلات\",\n \"endDragKeyboard\": \"السحب. اضغط Enter لإلغاء السحب.\",\n \"endDragTouch\": \"السحب. اضغط مرتين لإلغاء السحب.\",\n \"endDragVirtual\": \"السحب. انقر لإلغاء السحب.\",\n \"insertAfter\": \"أدخل بعد {itemText}\",\n \"insertBefore\": \"أدخل قبل {itemText}\",\n \"insertBetween\": \"أدخل بين {beforeItemText} و {afterItemText}\"\n}\n"],"names":[],"version":3,"file":"ar-AE.main.js.map"}
package/dist/ar-AE.mjs ADDED
@@ -0,0 +1,46 @@
1
+ var $7dfcac1a0c98c789$exports = {};
2
+ $7dfcac1a0c98c789$exports = {
3
+ "dragDescriptionKeyboard": `\u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
4
+ "dragDescriptionKeyboardAlt": `\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Alt + Enter \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
5
+ "dragDescriptionLongPress": `\u{627}\u{636}\u{63A}\u{637} \u{628}\u{627}\u{633}\u{62A}\u{645}\u{631}\u{627}\u{631} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
6
+ "dragDescriptionTouch": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
7
+ "dragDescriptionVirtual": `\u{627}\u{646}\u{642}\u{631} \u{644}\u{628}\u{62F}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
8
+ "dragItem": (args)=>`\u{627}\u{633}\u{62D}\u{628} ${args.itemText}`,
9
+ "dragSelectedItems": (args, formatter)=>`\u{627}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
10
+ one: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}`,
11
+ other: ()=>`${formatter.number(args.count)} \u{639}\u{646}\u{627}\u{635}\u{631} \u{645}\u{62D}\u{62F}\u{62F}\u{629}`
12
+ })}`,
13
+ "dragSelectedKeyboard": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} Enter \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
14
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
15
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
16
+ })}.`,
17
+ "dragSelectedKeyboardAlt": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{639}\u{644}\u{649} \u{645}\u{641}\u{62A}\u{627}\u{62D}\u{64A} Alt + Enter \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
18
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
19
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
20
+ })}.`,
21
+ "dragSelectedLongPress": (args, formatter)=>`\u{627}\u{636}\u{63A}\u{637} \u{628}\u{627}\u{633}\u{62A}\u{645}\u{631}\u{627}\u{631} \u{644}\u{644}\u{633}\u{62D}\u{628} ${formatter.plural(args.count, {
22
+ one: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`,
23
+ other: `\u{639}\u{62F}\u{62F} \u{627}\u{644}\u{639}\u{646}\u{627}\u{635}\u{631} \u{627}\u{644}\u{645}\u{62E}\u{62A}\u{627}\u{631}\u{629}`
24
+ })}.`,
25
+ "dragStartedKeyboard": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} Tab \u{644}\u{644}\u{627}\u{646}\u{62A}\u{642}\u{627}\u{644} \u{625}\u{644}\u{649} \u{645}\u{648}\u{636}\u{639} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} Escape \u{644}\u{644}\u{625}\u{644}\u{63A}\u{627}\u{621}.`,
26
+ "dragStartedTouch": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{62A}\u{642}\u{644} \u{625}\u{644}\u{649} \u{645}\u{648}\u{636}\u{639} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
27
+ "dragStartedVirtual": `\u{628}\u{62F}\u{623} \u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{62A}\u{642}\u{644} \u{625}\u{644}\u{649} \u{645}\u{643}\u{627}\u{646} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}\u{60C} \u{62B}\u{645} \u{627}\u{646}\u{642}\u{631} \u{623}\u{648} \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
28
+ "dropCanceled": `\u{62A}\u{645} \u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
29
+ "dropComplete": `\u{627}\u{643}\u{62A}\u{645}\u{644} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
30
+ "dropDescriptionKeyboard": `\u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}. \u{627}\u{636}\u{63A}\u{637} Escape \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
31
+ "dropDescriptionTouch": `\u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
32
+ "dropDescriptionVirtual": `\u{627}\u{646}\u{642}\u{631} \u{644}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}.`,
33
+ "dropIndicator": `\u{645}\u{624}\u{634}\u{631} \u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}`,
34
+ "dropOnItem": (args)=>`\u{625}\u{641}\u{644}\u{627}\u{62A} ${args.itemText}`,
35
+ "dropOnRoot": `\u{627}\u{644}\u{625}\u{641}\u{644}\u{627}\u{62A}`,
36
+ "endDragKeyboard": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} Enter \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
37
+ "endDragTouch": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{636}\u{63A}\u{637} \u{645}\u{631}\u{62A}\u{64A}\u{646} \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
38
+ "endDragVirtual": `\u{627}\u{644}\u{633}\u{62D}\u{628}. \u{627}\u{646}\u{642}\u{631} \u{644}\u{625}\u{644}\u{63A}\u{627}\u{621} \u{627}\u{644}\u{633}\u{62D}\u{628}.`,
39
+ "insertAfter": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{628}\u{639}\u{62F} ${args.itemText}`,
40
+ "insertBefore": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{642}\u{628}\u{644} ${args.itemText}`,
41
+ "insertBetween": (args)=>`\u{623}\u{62F}\u{62E}\u{644} \u{628}\u{64A}\u{646} ${args.beforeItemText} \u{648} ${args.afterItemText}`
42
+ };
43
+
44
+
45
+ export {$7dfcac1a0c98c789$exports as default};
46
+ //# sourceMappingURL=ar-AE.module.js.map