@react-aria/dnd 3.11.6 → 3.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/import.mjs +8 -18
- package/dist/main.js +22 -32
- package/dist/main.js.map +1 -1
- package/dist/module.js +8 -18
- package/dist/module.js.map +1 -1
- package/dist/types/src/index.d.ts +13 -0
- package/package.json +16 -21
- package/src/index.ts +13 -56
- package/dist/DragManager.main.js +0 -522
- package/dist/DragManager.main.js.map +0 -1
- package/dist/DragManager.mjs +0 -513
- package/dist/DragManager.module.js +0 -513
- package/dist/DragManager.module.js.map +0 -1
- package/dist/DragPreview.main.js +0 -73
- package/dist/DragPreview.main.js.map +0 -1
- package/dist/DragPreview.mjs +0 -64
- package/dist/DragPreview.module.js +0 -64
- package/dist/DragPreview.module.js.map +0 -1
- package/dist/DropTargetKeyboardNavigation.main.js +0 -215
- package/dist/DropTargetKeyboardNavigation.main.js.map +0 -1
- package/dist/DropTargetKeyboardNavigation.mjs +0 -210
- package/dist/DropTargetKeyboardNavigation.module.js +0 -210
- package/dist/DropTargetKeyboardNavigation.module.js.map +0 -1
- package/dist/ListDropTargetDelegate.main.js +0 -129
- package/dist/ListDropTargetDelegate.main.js.map +0 -1
- package/dist/ListDropTargetDelegate.mjs +0 -124
- package/dist/ListDropTargetDelegate.module.js +0 -124
- package/dist/ListDropTargetDelegate.module.js.map +0 -1
- package/dist/ar-AE.main.js +0 -44
- package/dist/ar-AE.main.js.map +0 -1
- package/dist/ar-AE.mjs +0 -46
- package/dist/ar-AE.module.js +0 -46
- package/dist/ar-AE.module.js.map +0 -1
- package/dist/bg-BG.main.js +0 -44
- package/dist/bg-BG.main.js.map +0 -1
- package/dist/bg-BG.mjs +0 -46
- package/dist/bg-BG.module.js +0 -46
- package/dist/bg-BG.module.js.map +0 -1
- package/dist/constants.main.js +0 -64
- package/dist/constants.main.js.map +0 -1
- package/dist/constants.mjs +0 -52
- package/dist/constants.module.js +0 -52
- package/dist/constants.module.js.map +0 -1
- package/dist/cs-CZ.main.js +0 -45
- package/dist/cs-CZ.main.js.map +0 -1
- package/dist/cs-CZ.mjs +0 -47
- package/dist/cs-CZ.module.js +0 -47
- package/dist/cs-CZ.module.js.map +0 -1
- package/dist/da-DK.main.js +0 -44
- package/dist/da-DK.main.js.map +0 -1
- package/dist/da-DK.mjs +0 -46
- package/dist/da-DK.module.js +0 -46
- package/dist/da-DK.module.js.map +0 -1
- package/dist/de-DE.main.js +0 -44
- package/dist/de-DE.main.js.map +0 -1
- package/dist/de-DE.mjs +0 -46
- package/dist/de-DE.module.js +0 -46
- package/dist/de-DE.module.js.map +0 -1
- package/dist/el-GR.main.js +0 -44
- package/dist/el-GR.main.js.map +0 -1
- package/dist/el-GR.mjs +0 -46
- package/dist/el-GR.module.js +0 -46
- package/dist/el-GR.module.js.map +0 -1
- package/dist/en-US.main.js +0 -44
- package/dist/en-US.main.js.map +0 -1
- package/dist/en-US.mjs +0 -46
- package/dist/en-US.module.js +0 -46
- package/dist/en-US.module.js.map +0 -1
- package/dist/es-ES.main.js +0 -44
- package/dist/es-ES.main.js.map +0 -1
- package/dist/es-ES.mjs +0 -46
- package/dist/es-ES.module.js +0 -46
- package/dist/es-ES.module.js.map +0 -1
- package/dist/et-EE.main.js +0 -44
- package/dist/et-EE.main.js.map +0 -1
- package/dist/et-EE.mjs +0 -46
- package/dist/et-EE.module.js +0 -46
- package/dist/et-EE.module.js.map +0 -1
- package/dist/fi-FI.main.js +0 -44
- package/dist/fi-FI.main.js.map +0 -1
- package/dist/fi-FI.mjs +0 -46
- package/dist/fi-FI.module.js +0 -46
- package/dist/fi-FI.module.js.map +0 -1
- package/dist/fr-FR.main.js +0 -44
- package/dist/fr-FR.main.js.map +0 -1
- package/dist/fr-FR.mjs +0 -46
- package/dist/fr-FR.module.js +0 -46
- package/dist/fr-FR.module.js.map +0 -1
- package/dist/he-IL.main.js +0 -44
- package/dist/he-IL.main.js.map +0 -1
- package/dist/he-IL.mjs +0 -46
- package/dist/he-IL.module.js +0 -46
- package/dist/he-IL.module.js.map +0 -1
- package/dist/hr-HR.main.js +0 -44
- package/dist/hr-HR.main.js.map +0 -1
- package/dist/hr-HR.mjs +0 -46
- package/dist/hr-HR.module.js +0 -46
- package/dist/hr-HR.module.js.map +0 -1
- package/dist/hu-HU.main.js +0 -44
- package/dist/hu-HU.main.js.map +0 -1
- package/dist/hu-HU.mjs +0 -46
- package/dist/hu-HU.module.js +0 -46
- package/dist/hu-HU.module.js.map +0 -1
- package/dist/intlStrings.main.js +0 -108
- package/dist/intlStrings.main.js.map +0 -1
- package/dist/intlStrings.mjs +0 -110
- package/dist/intlStrings.module.js +0 -110
- package/dist/intlStrings.module.js.map +0 -1
- package/dist/it-IT.main.js +0 -44
- package/dist/it-IT.main.js.map +0 -1
- package/dist/it-IT.mjs +0 -46
- package/dist/it-IT.module.js +0 -46
- package/dist/it-IT.module.js.map +0 -1
- package/dist/ja-JP.main.js +0 -44
- package/dist/ja-JP.main.js.map +0 -1
- package/dist/ja-JP.mjs +0 -46
- package/dist/ja-JP.module.js +0 -46
- package/dist/ja-JP.module.js.map +0 -1
- package/dist/ko-KR.main.js +0 -44
- package/dist/ko-KR.main.js.map +0 -1
- package/dist/ko-KR.mjs +0 -46
- package/dist/ko-KR.module.js +0 -46
- package/dist/ko-KR.module.js.map +0 -1
- package/dist/lt-LT.main.js +0 -44
- package/dist/lt-LT.main.js.map +0 -1
- package/dist/lt-LT.mjs +0 -46
- package/dist/lt-LT.module.js +0 -46
- package/dist/lt-LT.module.js.map +0 -1
- package/dist/lv-LV.main.js +0 -44
- package/dist/lv-LV.main.js.map +0 -1
- package/dist/lv-LV.mjs +0 -46
- package/dist/lv-LV.module.js +0 -46
- package/dist/lv-LV.module.js.map +0 -1
- package/dist/nb-NO.main.js +0 -44
- package/dist/nb-NO.main.js.map +0 -1
- package/dist/nb-NO.mjs +0 -46
- package/dist/nb-NO.module.js +0 -46
- package/dist/nb-NO.module.js.map +0 -1
- package/dist/nl-NL.main.js +0 -44
- package/dist/nl-NL.main.js.map +0 -1
- package/dist/nl-NL.mjs +0 -46
- package/dist/nl-NL.module.js +0 -46
- package/dist/nl-NL.module.js.map +0 -1
- package/dist/pl-PL.main.js +0 -44
- package/dist/pl-PL.main.js.map +0 -1
- package/dist/pl-PL.mjs +0 -46
- package/dist/pl-PL.module.js +0 -46
- package/dist/pl-PL.module.js.map +0 -1
- package/dist/pt-BR.main.js +0 -44
- package/dist/pt-BR.main.js.map +0 -1
- package/dist/pt-BR.mjs +0 -46
- package/dist/pt-BR.module.js +0 -46
- package/dist/pt-BR.module.js.map +0 -1
- package/dist/pt-PT.main.js +0 -44
- package/dist/pt-PT.main.js.map +0 -1
- package/dist/pt-PT.mjs +0 -46
- package/dist/pt-PT.module.js +0 -46
- package/dist/pt-PT.module.js.map +0 -1
- package/dist/ro-RO.main.js +0 -44
- package/dist/ro-RO.main.js.map +0 -1
- package/dist/ro-RO.mjs +0 -46
- package/dist/ro-RO.module.js +0 -46
- package/dist/ro-RO.module.js.map +0 -1
- package/dist/ru-RU.main.js +0 -44
- package/dist/ru-RU.main.js.map +0 -1
- package/dist/ru-RU.mjs +0 -46
- package/dist/ru-RU.module.js +0 -46
- package/dist/ru-RU.module.js.map +0 -1
- package/dist/sk-SK.main.js +0 -44
- package/dist/sk-SK.main.js.map +0 -1
- package/dist/sk-SK.mjs +0 -46
- package/dist/sk-SK.module.js +0 -46
- package/dist/sk-SK.module.js.map +0 -1
- package/dist/sl-SI.main.js +0 -44
- package/dist/sl-SI.main.js.map +0 -1
- package/dist/sl-SI.mjs +0 -46
- package/dist/sl-SI.module.js +0 -46
- package/dist/sl-SI.module.js.map +0 -1
- package/dist/sr-SP.main.js +0 -44
- package/dist/sr-SP.main.js.map +0 -1
- package/dist/sr-SP.mjs +0 -46
- package/dist/sr-SP.module.js +0 -46
- package/dist/sr-SP.module.js.map +0 -1
- package/dist/sv-SE.main.js +0 -44
- package/dist/sv-SE.main.js.map +0 -1
- package/dist/sv-SE.mjs +0 -46
- package/dist/sv-SE.module.js +0 -46
- package/dist/sv-SE.module.js.map +0 -1
- package/dist/tr-TR.main.js +0 -44
- package/dist/tr-TR.main.js.map +0 -1
- package/dist/tr-TR.mjs +0 -46
- package/dist/tr-TR.module.js +0 -46
- package/dist/tr-TR.module.js.map +0 -1
- package/dist/types.d.ts +0 -244
- package/dist/types.d.ts.map +0 -1
- package/dist/uk-UA.main.js +0 -44
- package/dist/uk-UA.main.js.map +0 -1
- package/dist/uk-UA.mjs +0 -46
- package/dist/uk-UA.module.js +0 -46
- package/dist/uk-UA.module.js.map +0 -1
- package/dist/useAutoScroll.main.js +0 -89
- package/dist/useAutoScroll.main.js.map +0 -1
- package/dist/useAutoScroll.mjs +0 -84
- package/dist/useAutoScroll.module.js +0 -84
- package/dist/useAutoScroll.module.js.map +0 -1
- package/dist/useClipboard.main.js +0 -111
- package/dist/useClipboard.main.js.map +0 -1
- package/dist/useClipboard.mjs +0 -106
- package/dist/useClipboard.module.js +0 -106
- package/dist/useClipboard.module.js.map +0 -1
- package/dist/useDrag.main.js +0 -307
- package/dist/useDrag.main.js.map +0 -1
- package/dist/useDrag.mjs +0 -302
- package/dist/useDrag.module.js +0 -302
- package/dist/useDrag.module.js.map +0 -1
- package/dist/useDraggableCollection.main.js +0 -27
- package/dist/useDraggableCollection.main.js.map +0 -1
- package/dist/useDraggableCollection.mjs +0 -22
- package/dist/useDraggableCollection.module.js +0 -22
- package/dist/useDraggableCollection.module.js.map +0 -1
- package/dist/useDraggableItem.main.js +0 -128
- package/dist/useDraggableItem.main.js.map +0 -1
- package/dist/useDraggableItem.mjs +0 -123
- package/dist/useDraggableItem.module.js +0 -123
- package/dist/useDraggableItem.module.js.map +0 -1
- package/dist/useDrop.main.js +0 -295
- package/dist/useDrop.main.js.map +0 -1
- package/dist/useDrop.mjs +0 -290
- package/dist/useDrop.module.js +0 -290
- package/dist/useDrop.module.js.map +0 -1
- package/dist/useDropIndicator.main.js +0 -102
- package/dist/useDropIndicator.main.js.map +0 -1
- package/dist/useDropIndicator.mjs +0 -97
- package/dist/useDropIndicator.module.js +0 -97
- package/dist/useDropIndicator.module.js.map +0 -1
- package/dist/useDroppableCollection.main.js +0 -536
- package/dist/useDroppableCollection.main.js.map +0 -1
- package/dist/useDroppableCollection.mjs +0 -531
- package/dist/useDroppableCollection.module.js +0 -531
- package/dist/useDroppableCollection.module.js.map +0 -1
- package/dist/useDroppableItem.main.js +0 -81
- package/dist/useDroppableItem.main.js.map +0 -1
- package/dist/useDroppableItem.mjs +0 -76
- package/dist/useDroppableItem.module.js +0 -76
- package/dist/useDroppableItem.module.js.map +0 -1
- package/dist/useVirtualDrop.main.js +0 -56
- package/dist/useVirtualDrop.main.js.map +0 -1
- package/dist/useVirtualDrop.mjs +0 -51
- package/dist/useVirtualDrop.module.js +0 -51
- package/dist/useVirtualDrop.module.js.map +0 -1
- package/dist/utils.main.js +0 -285
- package/dist/utils.main.js.map +0 -1
- package/dist/utils.mjs +0 -257
- package/dist/utils.module.js +0 -257
- package/dist/utils.module.js.map +0 -1
- package/dist/zh-CN.main.js +0 -44
- package/dist/zh-CN.main.js.map +0 -1
- package/dist/zh-CN.mjs +0 -46
- package/dist/zh-CN.module.js +0 -46
- package/dist/zh-CN.module.js.map +0 -1
- package/dist/zh-TW.main.js +0 -44
- package/dist/zh-TW.main.js.map +0 -1
- package/dist/zh-TW.mjs +0 -46
- package/dist/zh-TW.module.js +0 -46
- package/dist/zh-TW.module.js.map +0 -1
- package/src/DragManager.ts +0 -659
- package/src/DragPreview.tsx +0 -81
- package/src/DropTargetKeyboardNavigation.ts +0 -293
- package/src/ListDropTargetDelegate.ts +0 -182
- package/src/constants.ts +0 -85
- package/src/useAutoScroll.ts +0 -105
- package/src/useClipboard.ts +0 -151
- package/src/useDrag.ts +0 -390
- package/src/useDraggableCollection.ts +0 -29
- package/src/useDraggableItem.ts +0 -158
- package/src/useDrop.ts +0 -444
- package/src/useDropIndicator.ts +0 -124
- package/src/useDroppableCollection.ts +0 -665
- package/src/useDroppableItem.ts +0 -86
- package/src/useVirtualDrop.ts +0 -49
- package/src/utils.ts +0 -385
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
var $28e10663603f5ea1$exports = require("./DragManager.main.js");
|
|
2
|
-
var $4620ae0dc40f0031$exports = require("./utils.main.js");
|
|
3
|
-
var $419982e205c8e8dc$exports = require("./useVirtualDrop.main.js");
|
|
4
|
-
var $9Vk6V$react = require("react");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
function $parcel$export(e, n, v, s) {
|
|
8
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
$parcel$export(module.exports, "useDroppableItem", () => $fc1876157e07bcec$export$f7b0c5d28b66b6a5);
|
|
12
|
-
/*
|
|
13
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
14
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
15
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
16
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
-
*
|
|
18
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
19
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
20
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
21
|
-
* governing permissions and limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
function $fc1876157e07bcec$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
27
|
-
let { dropProps: dropProps } = (0, $419982e205c8e8dc$exports.useVirtualDrop)();
|
|
28
|
-
let droppableCollectionRef = (0, $4620ae0dc40f0031$exports.getDroppableCollectionRef)(state);
|
|
29
|
-
(0, $9Vk6V$react.useEffect)(()=>{
|
|
30
|
-
if (ref.current) return $28e10663603f5ea1$exports.registerDropItem({
|
|
31
|
-
element: ref.current,
|
|
32
|
-
target: options.target,
|
|
33
|
-
getDropOperation (types, allowedOperations) {
|
|
34
|
-
let { draggingKeys: draggingKeys } = (0, $4620ae0dc40f0031$exports.globalDndState);
|
|
35
|
-
let isInternal = (0, $4620ae0dc40f0031$exports.isInternalDropOperation)(droppableCollectionRef);
|
|
36
|
-
return state.getDropOperation({
|
|
37
|
-
target: options.target,
|
|
38
|
-
types: types,
|
|
39
|
-
allowedOperations: allowedOperations,
|
|
40
|
-
isInternal: isInternal,
|
|
41
|
-
draggingKeys: draggingKeys
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
activateButtonRef: options.activateButtonRef
|
|
45
|
-
});
|
|
46
|
-
}, [
|
|
47
|
-
ref,
|
|
48
|
-
options.target,
|
|
49
|
-
state,
|
|
50
|
-
droppableCollectionRef,
|
|
51
|
-
options.activateButtonRef
|
|
52
|
-
]);
|
|
53
|
-
let dragSession = $28e10663603f5ea1$exports.useDragSession();
|
|
54
|
-
let { draggingKeys: draggingKeys } = (0, $4620ae0dc40f0031$exports.globalDndState);
|
|
55
|
-
let isInternal = (0, $4620ae0dc40f0031$exports.isInternalDropOperation)(droppableCollectionRef);
|
|
56
|
-
let isValidDropTarget = dragSession && state.getDropOperation({
|
|
57
|
-
target: options.target,
|
|
58
|
-
types: (0, $4620ae0dc40f0031$exports.getTypes)(dragSession.dragTarget.items),
|
|
59
|
-
allowedOperations: dragSession.dragTarget.allowedDropOperations,
|
|
60
|
-
isInternal: isInternal,
|
|
61
|
-
draggingKeys: draggingKeys
|
|
62
|
-
}) !== 'cancel';
|
|
63
|
-
let isDropTarget = state.isDropTarget(options.target);
|
|
64
|
-
(0, $9Vk6V$react.useEffect)(()=>{
|
|
65
|
-
if (dragSession && isDropTarget && ref.current) ref.current.focus();
|
|
66
|
-
}, [
|
|
67
|
-
isDropTarget,
|
|
68
|
-
dragSession,
|
|
69
|
-
ref
|
|
70
|
-
]);
|
|
71
|
-
return {
|
|
72
|
-
dropProps: {
|
|
73
|
-
...dropProps,
|
|
74
|
-
'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
|
|
75
|
-
},
|
|
76
|
-
isDropTarget: isDropTarget
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
//# sourceMappingURL=useDroppableItem.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AA0BM,SAAS,0CAAiB,OAA6B,EAAE,KAA+B,EAAE,GAAkC;IACjI,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,wCAAa;IAC/B,IAAI,yBAAyB,CAAA,GAAA,mDAAwB,EAAE;IACvD,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,IAAI,OAAO,EACb,OAAO,2CAA6B;YAClC,SAAS,IAAI,OAAO;YACpB,QAAQ,QAAQ,MAAM;YACtB,kBAAiB,KAAK,EAAE,iBAAiB;gBACvC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,wCAAa;gBAClC,IAAI,aAAa,CAAA,GAAA,iDAAsB,EAAE;gBACzC,OAAO,MAAM,gBAAgB,CAAC;oBAC5B,QAAQ,QAAQ,MAAM;2BACtB;uCACA;gCACA;kCACA;gBACF;YACF;YACA,mBAAmB,QAAQ,iBAAiB;QAC9C;IAEJ,GAAG;QAAC;QAAK,QAAQ,MAAM;QAAE;QAAO;QAAwB,QAAQ,iBAAiB;KAAC;IAElF,IAAI,cAAc;IAClB,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,wCAAa;IAClC,IAAI,aAAa,CAAA,GAAA,iDAAsB,EAAE;IACzC,IAAI,oBAAoB,eAAe,MAAM,gBAAgB,CAAC;QAC5D,QAAQ,QAAQ,MAAM;QACtB,OAAO,CAAA,GAAA,kCAAO,EAAE,YAAY,UAAU,CAAC,KAAK;QAC5C,mBAAmB,YAAY,UAAU,CAAC,qBAAqB;oBAC/D;sBACA;IACF,OAAO;IAEP,IAAI,eAAe,MAAM,YAAY,CAAC,QAAQ,MAAM;IACpD,CAAA,GAAA,sBAAQ,EAAE;QACR,IAAI,eAAe,gBAAgB,IAAI,OAAO,EAC5C,IAAI,OAAO,CAAC,KAAK;IAErB,GAAG;QAAC;QAAc;QAAa;KAAI;IAEnC,OAAO;QACL,WAAW;YACT,GAAG,SAAS;YACZ,eAAe,CAAC,eAAe,oBAAoB,YAAY;QACjE;sBACA;IACF;AACF","sources":["packages/@react-aria/dnd/src/useDroppableItem.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 * as DragManager from './DragManager';\nimport {DroppableCollectionState} from '@react-stately/dnd';\nimport {DropTarget, FocusableElement, RefObject} from '@react-types/shared';\nimport {getDroppableCollectionRef, getTypes, globalDndState, isInternalDropOperation} from './utils';\nimport {HTMLAttributes, useEffect} from 'react';\nimport {useVirtualDrop} from './useVirtualDrop';\n\nexport interface DroppableItemOptions {\n /** The drop target represented by the item. */\n target: DropTarget,\n /** The ref to the activate button. */\n activateButtonRef?: RefObject<FocusableElement | null>\n}\n\nexport interface DroppableItemResult {\n /** Props for the droppable element. */\n dropProps: HTMLAttributes<HTMLElement>,\n /** Whether the item is currently the active drop target. */\n isDropTarget: boolean\n}\n\n/**\n * Handles drop interactions for an item within a collection component.\n */\nexport function useDroppableItem(options: DroppableItemOptions, state: DroppableCollectionState, ref: RefObject<HTMLElement | null>): DroppableItemResult {\n let {dropProps} = useVirtualDrop();\n let droppableCollectionRef = getDroppableCollectionRef(state);\n useEffect(() => {\n if (ref.current) {\n return DragManager.registerDropItem({\n element: ref.current,\n target: options.target,\n getDropOperation(types, allowedOperations) {\n let {draggingKeys} = globalDndState;\n let isInternal = isInternalDropOperation(droppableCollectionRef);\n return state.getDropOperation({\n target: options.target,\n types,\n allowedOperations,\n isInternal,\n draggingKeys\n });\n },\n activateButtonRef: options.activateButtonRef\n });\n }\n }, [ref, options.target, state, droppableCollectionRef, options.activateButtonRef]);\n\n let dragSession = DragManager.useDragSession();\n let {draggingKeys} = globalDndState;\n let isInternal = isInternalDropOperation(droppableCollectionRef);\n let isValidDropTarget = dragSession && state.getDropOperation({\n target: options.target,\n types: getTypes(dragSession.dragTarget.items),\n allowedOperations: dragSession.dragTarget.allowedDropOperations,\n isInternal,\n draggingKeys\n }) !== 'cancel';\n\n let isDropTarget = state.isDropTarget(options.target);\n useEffect(() => {\n if (dragSession && isDropTarget && ref.current) {\n ref.current.focus();\n }\n }, [isDropTarget, dragSession, ref]);\n\n return {\n dropProps: {\n ...dropProps,\n 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'\n },\n isDropTarget\n };\n}\n"],"names":[],"version":3,"file":"useDroppableItem.main.js.map"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import {registerDropItem as $67560de7c78cb232$export$aef80212ac99c003, useDragSession as $67560de7c78cb232$export$418e185dd3f1b968} from "./DragManager.mjs";
|
|
2
|
-
import {getDroppableCollectionRef as $7252cd45fc48c07c$export$7e397efd01d3db27, getTypes as $7252cd45fc48c07c$export$e1d41611756c6326, globalDndState as $7252cd45fc48c07c$export$6ca6700462636d0b, isInternalDropOperation as $7252cd45fc48c07c$export$78bf638634500fa5} from "./utils.mjs";
|
|
3
|
-
import {useVirtualDrop as $224594fe3e57ff1e$export$62447ad3d2ec7da6} from "./useVirtualDrop.mjs";
|
|
4
|
-
import {useEffect as $iZAZb$useEffect} from "react";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
8
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
* governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function $bfaab576ce1c580e$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
21
|
-
let { dropProps: dropProps } = (0, $224594fe3e57ff1e$export$62447ad3d2ec7da6)();
|
|
22
|
-
let droppableCollectionRef = (0, $7252cd45fc48c07c$export$7e397efd01d3db27)(state);
|
|
23
|
-
(0, $iZAZb$useEffect)(()=>{
|
|
24
|
-
if (ref.current) return $67560de7c78cb232$export$aef80212ac99c003({
|
|
25
|
-
element: ref.current,
|
|
26
|
-
target: options.target,
|
|
27
|
-
getDropOperation (types, allowedOperations) {
|
|
28
|
-
let { draggingKeys: draggingKeys } = (0, $7252cd45fc48c07c$export$6ca6700462636d0b);
|
|
29
|
-
let isInternal = (0, $7252cd45fc48c07c$export$78bf638634500fa5)(droppableCollectionRef);
|
|
30
|
-
return state.getDropOperation({
|
|
31
|
-
target: options.target,
|
|
32
|
-
types: types,
|
|
33
|
-
allowedOperations: allowedOperations,
|
|
34
|
-
isInternal: isInternal,
|
|
35
|
-
draggingKeys: draggingKeys
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
activateButtonRef: options.activateButtonRef
|
|
39
|
-
});
|
|
40
|
-
}, [
|
|
41
|
-
ref,
|
|
42
|
-
options.target,
|
|
43
|
-
state,
|
|
44
|
-
droppableCollectionRef,
|
|
45
|
-
options.activateButtonRef
|
|
46
|
-
]);
|
|
47
|
-
let dragSession = $67560de7c78cb232$export$418e185dd3f1b968();
|
|
48
|
-
let { draggingKeys: draggingKeys } = (0, $7252cd45fc48c07c$export$6ca6700462636d0b);
|
|
49
|
-
let isInternal = (0, $7252cd45fc48c07c$export$78bf638634500fa5)(droppableCollectionRef);
|
|
50
|
-
let isValidDropTarget = dragSession && state.getDropOperation({
|
|
51
|
-
target: options.target,
|
|
52
|
-
types: (0, $7252cd45fc48c07c$export$e1d41611756c6326)(dragSession.dragTarget.items),
|
|
53
|
-
allowedOperations: dragSession.dragTarget.allowedDropOperations,
|
|
54
|
-
isInternal: isInternal,
|
|
55
|
-
draggingKeys: draggingKeys
|
|
56
|
-
}) !== 'cancel';
|
|
57
|
-
let isDropTarget = state.isDropTarget(options.target);
|
|
58
|
-
(0, $iZAZb$useEffect)(()=>{
|
|
59
|
-
if (dragSession && isDropTarget && ref.current) ref.current.focus();
|
|
60
|
-
}, [
|
|
61
|
-
isDropTarget,
|
|
62
|
-
dragSession,
|
|
63
|
-
ref
|
|
64
|
-
]);
|
|
65
|
-
return {
|
|
66
|
-
dropProps: {
|
|
67
|
-
...dropProps,
|
|
68
|
-
'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
|
|
69
|
-
},
|
|
70
|
-
isDropTarget: isDropTarget
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export {$bfaab576ce1c580e$export$f7b0c5d28b66b6a5 as useDroppableItem};
|
|
76
|
-
//# sourceMappingURL=useDroppableItem.module.js.map
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import {registerDropItem as $67560de7c78cb232$export$aef80212ac99c003, useDragSession as $67560de7c78cb232$export$418e185dd3f1b968} from "./DragManager.module.js";
|
|
2
|
-
import {getDroppableCollectionRef as $7252cd45fc48c07c$export$7e397efd01d3db27, getTypes as $7252cd45fc48c07c$export$e1d41611756c6326, globalDndState as $7252cd45fc48c07c$export$6ca6700462636d0b, isInternalDropOperation as $7252cd45fc48c07c$export$78bf638634500fa5} from "./utils.module.js";
|
|
3
|
-
import {useVirtualDrop as $224594fe3e57ff1e$export$62447ad3d2ec7da6} from "./useVirtualDrop.module.js";
|
|
4
|
-
import {useEffect as $iZAZb$useEffect} from "react";
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
8
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
9
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
10
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
13
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
14
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
15
|
-
* governing permissions and limitations under the License.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
function $bfaab576ce1c580e$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
21
|
-
let { dropProps: dropProps } = (0, $224594fe3e57ff1e$export$62447ad3d2ec7da6)();
|
|
22
|
-
let droppableCollectionRef = (0, $7252cd45fc48c07c$export$7e397efd01d3db27)(state);
|
|
23
|
-
(0, $iZAZb$useEffect)(()=>{
|
|
24
|
-
if (ref.current) return $67560de7c78cb232$export$aef80212ac99c003({
|
|
25
|
-
element: ref.current,
|
|
26
|
-
target: options.target,
|
|
27
|
-
getDropOperation (types, allowedOperations) {
|
|
28
|
-
let { draggingKeys: draggingKeys } = (0, $7252cd45fc48c07c$export$6ca6700462636d0b);
|
|
29
|
-
let isInternal = (0, $7252cd45fc48c07c$export$78bf638634500fa5)(droppableCollectionRef);
|
|
30
|
-
return state.getDropOperation({
|
|
31
|
-
target: options.target,
|
|
32
|
-
types: types,
|
|
33
|
-
allowedOperations: allowedOperations,
|
|
34
|
-
isInternal: isInternal,
|
|
35
|
-
draggingKeys: draggingKeys
|
|
36
|
-
});
|
|
37
|
-
},
|
|
38
|
-
activateButtonRef: options.activateButtonRef
|
|
39
|
-
});
|
|
40
|
-
}, [
|
|
41
|
-
ref,
|
|
42
|
-
options.target,
|
|
43
|
-
state,
|
|
44
|
-
droppableCollectionRef,
|
|
45
|
-
options.activateButtonRef
|
|
46
|
-
]);
|
|
47
|
-
let dragSession = $67560de7c78cb232$export$418e185dd3f1b968();
|
|
48
|
-
let { draggingKeys: draggingKeys } = (0, $7252cd45fc48c07c$export$6ca6700462636d0b);
|
|
49
|
-
let isInternal = (0, $7252cd45fc48c07c$export$78bf638634500fa5)(droppableCollectionRef);
|
|
50
|
-
let isValidDropTarget = dragSession && state.getDropOperation({
|
|
51
|
-
target: options.target,
|
|
52
|
-
types: (0, $7252cd45fc48c07c$export$e1d41611756c6326)(dragSession.dragTarget.items),
|
|
53
|
-
allowedOperations: dragSession.dragTarget.allowedDropOperations,
|
|
54
|
-
isInternal: isInternal,
|
|
55
|
-
draggingKeys: draggingKeys
|
|
56
|
-
}) !== 'cancel';
|
|
57
|
-
let isDropTarget = state.isDropTarget(options.target);
|
|
58
|
-
(0, $iZAZb$useEffect)(()=>{
|
|
59
|
-
if (dragSession && isDropTarget && ref.current) ref.current.focus();
|
|
60
|
-
}, [
|
|
61
|
-
isDropTarget,
|
|
62
|
-
dragSession,
|
|
63
|
-
ref
|
|
64
|
-
]);
|
|
65
|
-
return {
|
|
66
|
-
dropProps: {
|
|
67
|
-
...dropProps,
|
|
68
|
-
'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'
|
|
69
|
-
},
|
|
70
|
-
isDropTarget: isDropTarget
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
export {$bfaab576ce1c580e$export$f7b0c5d28b66b6a5 as useDroppableItem};
|
|
76
|
-
//# sourceMappingURL=useDroppableItem.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AA0BM,SAAS,0CAAiB,OAA6B,EAAE,KAA+B,EAAE,GAAkC;IACjI,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,yCAAa;IAC/B,IAAI,yBAAyB,CAAA,GAAA,yCAAwB,EAAE;IACvD,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,IAAI,OAAO,EACb,OAAO,0CAA6B;YAClC,SAAS,IAAI,OAAO;YACpB,QAAQ,QAAQ,MAAM;YACtB,kBAAiB,KAAK,EAAE,iBAAiB;gBACvC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa;gBAClC,IAAI,aAAa,CAAA,GAAA,yCAAsB,EAAE;gBACzC,OAAO,MAAM,gBAAgB,CAAC;oBAC5B,QAAQ,QAAQ,MAAM;2BACtB;uCACA;gCACA;kCACA;gBACF;YACF;YACA,mBAAmB,QAAQ,iBAAiB;QAC9C;IAEJ,GAAG;QAAC;QAAK,QAAQ,MAAM;QAAE;QAAO;QAAwB,QAAQ,iBAAiB;KAAC;IAElF,IAAI,cAAc;IAClB,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa;IAClC,IAAI,aAAa,CAAA,GAAA,yCAAsB,EAAE;IACzC,IAAI,oBAAoB,eAAe,MAAM,gBAAgB,CAAC;QAC5D,QAAQ,QAAQ,MAAM;QACtB,OAAO,CAAA,GAAA,yCAAO,EAAE,YAAY,UAAU,CAAC,KAAK;QAC5C,mBAAmB,YAAY,UAAU,CAAC,qBAAqB;oBAC/D;sBACA;IACF,OAAO;IAEP,IAAI,eAAe,MAAM,YAAY,CAAC,QAAQ,MAAM;IACpD,CAAA,GAAA,gBAAQ,EAAE;QACR,IAAI,eAAe,gBAAgB,IAAI,OAAO,EAC5C,IAAI,OAAO,CAAC,KAAK;IAErB,GAAG;QAAC;QAAc;QAAa;KAAI;IAEnC,OAAO;QACL,WAAW;YACT,GAAG,SAAS;YACZ,eAAe,CAAC,eAAe,oBAAoB,YAAY;QACjE;sBACA;IACF;AACF","sources":["packages/@react-aria/dnd/src/useDroppableItem.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 * as DragManager from './DragManager';\nimport {DroppableCollectionState} from '@react-stately/dnd';\nimport {DropTarget, FocusableElement, RefObject} from '@react-types/shared';\nimport {getDroppableCollectionRef, getTypes, globalDndState, isInternalDropOperation} from './utils';\nimport {HTMLAttributes, useEffect} from 'react';\nimport {useVirtualDrop} from './useVirtualDrop';\n\nexport interface DroppableItemOptions {\n /** The drop target represented by the item. */\n target: DropTarget,\n /** The ref to the activate button. */\n activateButtonRef?: RefObject<FocusableElement | null>\n}\n\nexport interface DroppableItemResult {\n /** Props for the droppable element. */\n dropProps: HTMLAttributes<HTMLElement>,\n /** Whether the item is currently the active drop target. */\n isDropTarget: boolean\n}\n\n/**\n * Handles drop interactions for an item within a collection component.\n */\nexport function useDroppableItem(options: DroppableItemOptions, state: DroppableCollectionState, ref: RefObject<HTMLElement | null>): DroppableItemResult {\n let {dropProps} = useVirtualDrop();\n let droppableCollectionRef = getDroppableCollectionRef(state);\n useEffect(() => {\n if (ref.current) {\n return DragManager.registerDropItem({\n element: ref.current,\n target: options.target,\n getDropOperation(types, allowedOperations) {\n let {draggingKeys} = globalDndState;\n let isInternal = isInternalDropOperation(droppableCollectionRef);\n return state.getDropOperation({\n target: options.target,\n types,\n allowedOperations,\n isInternal,\n draggingKeys\n });\n },\n activateButtonRef: options.activateButtonRef\n });\n }\n }, [ref, options.target, state, droppableCollectionRef, options.activateButtonRef]);\n\n let dragSession = DragManager.useDragSession();\n let {draggingKeys} = globalDndState;\n let isInternal = isInternalDropOperation(droppableCollectionRef);\n let isValidDropTarget = dragSession && state.getDropOperation({\n target: options.target,\n types: getTypes(dragSession.dragTarget.items),\n allowedOperations: dragSession.dragTarget.allowedDropOperations,\n isInternal,\n draggingKeys\n }) !== 'cancel';\n\n let isDropTarget = state.isDropTarget(options.target);\n useEffect(() => {\n if (dragSession && isDropTarget && ref.current) {\n ref.current.focus();\n }\n }, [isDropTarget, dragSession, ref]);\n\n return {\n dropProps: {\n ...dropProps,\n 'aria-hidden': !dragSession || isValidDropTarget ? undefined : 'true'\n },\n isDropTarget\n };\n}\n"],"names":[],"version":3,"file":"useDroppableItem.module.js.map"}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
var $28e10663603f5ea1$exports = require("./DragManager.main.js");
|
|
2
|
-
var $7c8adf3925a26206$exports = require("./intlStrings.main.js");
|
|
3
|
-
var $4620ae0dc40f0031$exports = require("./utils.main.js");
|
|
4
|
-
var $iGjBd$reactariautils = require("@react-aria/utils");
|
|
5
|
-
var $iGjBd$reactariai18n = require("@react-aria/i18n");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function $parcel$interopDefault(a) {
|
|
9
|
-
return a && a.__esModule ? a.default : a;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
function $parcel$export(e, n, v, s) {
|
|
13
|
-
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
$parcel$export(module.exports, "useVirtualDrop", () => $419982e205c8e8dc$export$62447ad3d2ec7da6);
|
|
17
|
-
/*
|
|
18
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
19
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
20
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
21
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
-
*
|
|
23
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
24
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
25
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
26
|
-
* governing permissions and limitations under the License.
|
|
27
|
-
*/
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const $419982e205c8e8dc$var$MESSAGES = {
|
|
33
|
-
keyboard: 'dropDescriptionKeyboard',
|
|
34
|
-
touch: 'dropDescriptionTouch',
|
|
35
|
-
virtual: 'dropDescriptionVirtual'
|
|
36
|
-
};
|
|
37
|
-
function $419982e205c8e8dc$export$62447ad3d2ec7da6() {
|
|
38
|
-
let stringFormatter = (0, $iGjBd$reactariai18n.useLocalizedStringFormatter)((0, ($parcel$interopDefault($7c8adf3925a26206$exports))), '@react-aria/dnd');
|
|
39
|
-
let modality = (0, $4620ae0dc40f0031$exports.useDragModality)();
|
|
40
|
-
let dragSession = $28e10663603f5ea1$exports.useDragSession();
|
|
41
|
-
let descriptionProps = (0, $iGjBd$reactariautils.useDescription)(dragSession ? stringFormatter.format($419982e205c8e8dc$var$MESSAGES[modality]) : '');
|
|
42
|
-
return {
|
|
43
|
-
dropProps: {
|
|
44
|
-
...descriptionProps,
|
|
45
|
-
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
46
|
-
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
47
|
-
// handler, React will take care of adding that for us, and we are able to handle document
|
|
48
|
-
// level click events in the DragManager.
|
|
49
|
-
// See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
50
|
-
onClick: ()=>{}
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
//# sourceMappingURL=useVirtualDrop.main.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAeD,MAAM,iCAAW;IACf,UAAU;IACV,OAAO;IACP,SAAS;AACX;AAEO,SAAS;IACd,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,yCAAc;IAC7B,IAAI,cAAc;IAClB,IAAI,mBAAmB,CAAA,GAAA,oCAAa,EAAE,cAAc,gBAAgB,MAAM,CAAC,8BAAQ,CAAC,SAAS,IAAI;IAEjG,OAAO;QACL,WAAW;YACT,GAAG,gBAAgB;YACnB,yFAAyF;YACzF,0FAA0F;YAC1F,0FAA0F;YAC1F,yCAAyC;YACzC,4EAA4E;YAC5E,SAAS,KAAO;QAClB;IACF;AACF","sources":["packages/@react-aria/dnd/src/useVirtualDrop.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 {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes} from 'react';\nimport * as DragManager from './DragManager';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useDescription} from '@react-aria/utils';\nimport {useDragModality} from './utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface VirtualDropResult {\n dropProps: AriaButtonProps & DOMAttributes<HTMLDivElement>\n}\n\nconst MESSAGES = {\n keyboard: 'dropDescriptionKeyboard',\n touch: 'dropDescriptionTouch',\n virtual: 'dropDescriptionVirtual'\n};\n\nexport function useVirtualDrop(): VirtualDropResult {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/dnd');\n let modality = useDragModality();\n let dragSession = DragManager.useDragSession();\n let descriptionProps = useDescription(dragSession ? stringFormatter.format(MESSAGES[modality]) : '');\n\n return {\n dropProps: {\n ...descriptionProps,\n // Mobile Safari does not properly bubble click events on elements except links or inputs\n // unless there is an onclick handler bound directly to the element itself. By adding this\n // handler, React will take care of adding that for us, and we are able to handle document\n // level click events in the DragManager.\n // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n onClick: () => {}\n }\n };\n}\n"],"names":[],"version":3,"file":"useVirtualDrop.main.js.map"}
|
package/dist/useVirtualDrop.mjs
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {useDragSession as $67560de7c78cb232$export$418e185dd3f1b968} from "./DragManager.mjs";
|
|
2
|
-
import $gKRvW$intlStringsmodulejs from "./intlStrings.mjs";
|
|
3
|
-
import {useDragModality as $7252cd45fc48c07c$export$49bac5d6d4b352ea} from "./utils.mjs";
|
|
4
|
-
import {useDescription as $gKRvW$useDescription} from "@react-aria/utils";
|
|
5
|
-
import {useLocalizedStringFormatter as $gKRvW$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function $parcel$interopDefault(a) {
|
|
9
|
-
return a && a.__esModule ? a.default : a;
|
|
10
|
-
}
|
|
11
|
-
/*
|
|
12
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
-
* governing permissions and limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const $224594fe3e57ff1e$var$MESSAGES = {
|
|
27
|
-
keyboard: 'dropDescriptionKeyboard',
|
|
28
|
-
touch: 'dropDescriptionTouch',
|
|
29
|
-
virtual: 'dropDescriptionVirtual'
|
|
30
|
-
};
|
|
31
|
-
function $224594fe3e57ff1e$export$62447ad3d2ec7da6() {
|
|
32
|
-
let stringFormatter = (0, $gKRvW$useLocalizedStringFormatter)((0, ($parcel$interopDefault($gKRvW$intlStringsmodulejs))), '@react-aria/dnd');
|
|
33
|
-
let modality = (0, $7252cd45fc48c07c$export$49bac5d6d4b352ea)();
|
|
34
|
-
let dragSession = $67560de7c78cb232$export$418e185dd3f1b968();
|
|
35
|
-
let descriptionProps = (0, $gKRvW$useDescription)(dragSession ? stringFormatter.format($224594fe3e57ff1e$var$MESSAGES[modality]) : '');
|
|
36
|
-
return {
|
|
37
|
-
dropProps: {
|
|
38
|
-
...descriptionProps,
|
|
39
|
-
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
40
|
-
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
41
|
-
// handler, React will take care of adding that for us, and we are able to handle document
|
|
42
|
-
// level click events in the DragManager.
|
|
43
|
-
// See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
44
|
-
onClick: ()=>{}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export {$224594fe3e57ff1e$export$62447ad3d2ec7da6 as useVirtualDrop};
|
|
51
|
-
//# sourceMappingURL=useVirtualDrop.module.js.map
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {useDragSession as $67560de7c78cb232$export$418e185dd3f1b968} from "./DragManager.module.js";
|
|
2
|
-
import $gKRvW$intlStringsmodulejs from "./intlStrings.module.js";
|
|
3
|
-
import {useDragModality as $7252cd45fc48c07c$export$49bac5d6d4b352ea} from "./utils.module.js";
|
|
4
|
-
import {useDescription as $gKRvW$useDescription} from "@react-aria/utils";
|
|
5
|
-
import {useLocalizedStringFormatter as $gKRvW$useLocalizedStringFormatter} from "@react-aria/i18n";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function $parcel$interopDefault(a) {
|
|
9
|
-
return a && a.__esModule ? a.default : a;
|
|
10
|
-
}
|
|
11
|
-
/*
|
|
12
|
-
* Copyright 2020 Adobe. All rights reserved.
|
|
13
|
-
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
14
|
-
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
15
|
-
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
18
|
-
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
19
|
-
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
20
|
-
* governing permissions and limitations under the License.
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const $224594fe3e57ff1e$var$MESSAGES = {
|
|
27
|
-
keyboard: 'dropDescriptionKeyboard',
|
|
28
|
-
touch: 'dropDescriptionTouch',
|
|
29
|
-
virtual: 'dropDescriptionVirtual'
|
|
30
|
-
};
|
|
31
|
-
function $224594fe3e57ff1e$export$62447ad3d2ec7da6() {
|
|
32
|
-
let stringFormatter = (0, $gKRvW$useLocalizedStringFormatter)((0, ($parcel$interopDefault($gKRvW$intlStringsmodulejs))), '@react-aria/dnd');
|
|
33
|
-
let modality = (0, $7252cd45fc48c07c$export$49bac5d6d4b352ea)();
|
|
34
|
-
let dragSession = $67560de7c78cb232$export$418e185dd3f1b968();
|
|
35
|
-
let descriptionProps = (0, $gKRvW$useDescription)(dragSession ? stringFormatter.format($224594fe3e57ff1e$var$MESSAGES[modality]) : '');
|
|
36
|
-
return {
|
|
37
|
-
dropProps: {
|
|
38
|
-
...descriptionProps,
|
|
39
|
-
// Mobile Safari does not properly bubble click events on elements except links or inputs
|
|
40
|
-
// unless there is an onclick handler bound directly to the element itself. By adding this
|
|
41
|
-
// handler, React will take care of adding that for us, and we are able to handle document
|
|
42
|
-
// level click events in the DragManager.
|
|
43
|
-
// See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html
|
|
44
|
-
onClick: ()=>{}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
export {$224594fe3e57ff1e$export$62447ad3d2ec7da6 as useVirtualDrop};
|
|
51
|
-
//# sourceMappingURL=useVirtualDrop.module.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAeD,MAAM,iCAAW;IACf,UAAU;IACV,OAAO;IACP,SAAS;AACX;AAEO,SAAS;IACd,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAChE,IAAI,WAAW,CAAA,GAAA,yCAAc;IAC7B,IAAI,cAAc;IAClB,IAAI,mBAAmB,CAAA,GAAA,qBAAa,EAAE,cAAc,gBAAgB,MAAM,CAAC,8BAAQ,CAAC,SAAS,IAAI;IAEjG,OAAO;QACL,WAAW;YACT,GAAG,gBAAgB;YACnB,yFAAyF;YACzF,0FAA0F;YAC1F,0FAA0F;YAC1F,yCAAyC;YACzC,4EAA4E;YAC5E,SAAS,KAAO;QAClB;IACF;AACF","sources":["packages/@react-aria/dnd/src/useVirtualDrop.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 {AriaButtonProps} from '@react-types/button';\nimport {DOMAttributes} from 'react';\nimport * as DragManager from './DragManager';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {useDescription} from '@react-aria/utils';\nimport {useDragModality} from './utils';\nimport {useLocalizedStringFormatter} from '@react-aria/i18n';\n\ninterface VirtualDropResult {\n dropProps: AriaButtonProps & DOMAttributes<HTMLDivElement>\n}\n\nconst MESSAGES = {\n keyboard: 'dropDescriptionKeyboard',\n touch: 'dropDescriptionTouch',\n virtual: 'dropDescriptionVirtual'\n};\n\nexport function useVirtualDrop(): VirtualDropResult {\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-aria/dnd');\n let modality = useDragModality();\n let dragSession = DragManager.useDragSession();\n let descriptionProps = useDescription(dragSession ? stringFormatter.format(MESSAGES[modality]) : '');\n\n return {\n dropProps: {\n ...descriptionProps,\n // Mobile Safari does not properly bubble click events on elements except links or inputs\n // unless there is an onclick handler bound directly to the element itself. By adding this\n // handler, React will take care of adding that for us, and we are able to handle document\n // level click events in the DragManager.\n // See https://www.quirksmode.org/blog/archives/2010/09/click_event_del.html\n onClick: () => {}\n }\n };\n}\n"],"names":[],"version":3,"file":"useVirtualDrop.module.js.map"}
|