@react-aria/dnd 3.0.0-nightly.3486 → 3.0.0-nightly.3491
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/main.js +18 -14
- package/dist/main.js.map +1 -1
- package/dist/module.js +18 -14
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/useDroppableCollection.ts +24 -5
- package/src/useDroppableItem.ts +5 -5
- package/src/utils.ts +16 -9
package/dist/main.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var $4vY0V$reactariainteractions = require("@react-aria/interactions");
|
|
2
|
-
var $4vY0V$reactariautils = require("@react-aria/utils");
|
|
3
2
|
var $4vY0V$react = require("react");
|
|
3
|
+
var $4vY0V$reactariautils = require("@react-aria/utils");
|
|
4
4
|
var $4vY0V$reactariai18n = require("@react-aria/i18n");
|
|
5
5
|
var $4vY0V$reactarialiveannouncer = require("@react-aria/live-announcer");
|
|
6
6
|
var $4vY0V$reactariaoverlays = require("@react-aria/overlays");
|
|
@@ -69,19 +69,18 @@ const $76b1e110a27b1ccd$export$f8fc6581787339b3 = 'application/octet-stream';
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
const $4620ae0dc40f0031$var$droppableCollectionIds = new WeakMap();
|
|
72
|
+
const $4620ae0dc40f0031$export$dfdf5deeaf27473f = new WeakMap();
|
|
74
73
|
const $4620ae0dc40f0031$export$990fced5dfac2637 = Symbol();
|
|
75
|
-
function $4620ae0dc40f0031$export$b1601eb39394a581(state) {
|
|
76
|
-
let id = $4vY0V$reactariautils.useId();
|
|
77
|
-
$4620ae0dc40f0031$var$droppableCollectionIds.set(state, id);
|
|
78
|
-
return id;
|
|
79
|
-
}
|
|
80
74
|
function $4620ae0dc40f0031$export$3093291712f09a77(state) {
|
|
81
|
-
let id = $4620ae0dc40f0031$
|
|
75
|
+
let { id: id } = $4620ae0dc40f0031$export$dfdf5deeaf27473f.get(state);
|
|
82
76
|
if (!id) throw new Error('Droppable item outside a droppable collection');
|
|
83
77
|
return id;
|
|
84
78
|
}
|
|
79
|
+
function $4620ae0dc40f0031$export$7e397efd01d3db27(state) {
|
|
80
|
+
let { ref: ref } = $4620ae0dc40f0031$export$dfdf5deeaf27473f.get(state);
|
|
81
|
+
if (!ref) throw new Error('Droppable item outside a droppable collection');
|
|
82
|
+
return ref;
|
|
83
|
+
}
|
|
85
84
|
function $4620ae0dc40f0031$export$e1d41611756c6326(items) {
|
|
86
85
|
let types = new Set();
|
|
87
86
|
for (let item of items)for (let type of Object.keys(item))types.add(type);
|
|
@@ -3183,7 +3182,6 @@ function $1ca228bc9257ca16$var$getDropOperation(allowedOperations, operation) {
|
|
|
3183
3182
|
|
|
3184
3183
|
|
|
3185
3184
|
|
|
3186
|
-
|
|
3187
3185
|
const $12cc069a1c69155b$var$AUTOSCROLL_AREA_SIZE = 20;
|
|
3188
3186
|
function $12cc069a1c69155b$export$6323452ca4533ed8(ref) {
|
|
3189
3187
|
let scrollableRef = $4vY0V$react.useRef(null);
|
|
@@ -3723,7 +3721,11 @@ function $7f93a158ac20b90a$export$f4e2f423c21f7b04(props, state1, ref2) {
|
|
|
3723
3721
|
ref2,
|
|
3724
3722
|
onDrop
|
|
3725
3723
|
]);
|
|
3726
|
-
let id = $
|
|
3724
|
+
let id = $4vY0V$reactariautils.useId();
|
|
3725
|
+
$4620ae0dc40f0031$export$dfdf5deeaf27473f.set(state1, {
|
|
3726
|
+
id: id,
|
|
3727
|
+
ref: ref2
|
|
3728
|
+
});
|
|
3727
3729
|
return {
|
|
3728
3730
|
collectionProps: $4vY0V$reactariautils.mergeProps(dropProps, {
|
|
3729
3731
|
id: id,
|
|
@@ -3741,13 +3743,14 @@ function $7f93a158ac20b90a$export$f4e2f423c21f7b04(props, state1, ref2) {
|
|
|
3741
3743
|
|
|
3742
3744
|
function $fc1876157e07bcec$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
3743
3745
|
let { dropProps: dropProps } = $419982e205c8e8dc$export$62447ad3d2ec7da6();
|
|
3746
|
+
let droppableCollectionRef = $4620ae0dc40f0031$export$7e397efd01d3db27(state);
|
|
3744
3747
|
$4vY0V$react.useEffect(()=>{
|
|
3745
3748
|
if (ref.current) return $28e10663603f5ea1$export$aef80212ac99c003({
|
|
3746
3749
|
element: ref.current,
|
|
3747
3750
|
target: options.target,
|
|
3748
3751
|
getDropOperation (types, allowedOperations) {
|
|
3749
3752
|
let { draggingKeys: draggingKeys } = $4620ae0dc40f0031$export$6ca6700462636d0b;
|
|
3750
|
-
let isInternal = $4620ae0dc40f0031$export$78bf638634500fa5();
|
|
3753
|
+
let isInternal = $4620ae0dc40f0031$export$78bf638634500fa5(droppableCollectionRef);
|
|
3751
3754
|
return state.getDropOperation({
|
|
3752
3755
|
target: options.target,
|
|
3753
3756
|
types: types,
|
|
@@ -3760,11 +3763,12 @@ function $fc1876157e07bcec$export$f7b0c5d28b66b6a5(options, state, ref) {
|
|
|
3760
3763
|
}, [
|
|
3761
3764
|
ref,
|
|
3762
3765
|
options.target,
|
|
3763
|
-
state
|
|
3766
|
+
state,
|
|
3767
|
+
droppableCollectionRef
|
|
3764
3768
|
]);
|
|
3765
3769
|
let dragSession = $28e10663603f5ea1$export$418e185dd3f1b968();
|
|
3766
3770
|
let { draggingKeys: draggingKeys1 } = $4620ae0dc40f0031$export$6ca6700462636d0b;
|
|
3767
|
-
let isInternal1 = $4620ae0dc40f0031$export$78bf638634500fa5();
|
|
3771
|
+
let isInternal1 = $4620ae0dc40f0031$export$78bf638634500fa5(droppableCollectionRef);
|
|
3768
3772
|
let isValidDropTarget = dragSession && state.getDropOperation({
|
|
3769
3773
|
target: options.target,
|
|
3770
3774
|
types: $4620ae0dc40f0031$export$e1d41611756c6326(dragSession.dragTarget.items),
|