@react-stately/dnd 3.0.0-nightly.3085 → 3.0.0-nightly.3100
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 +14 -14
- package/dist/module.js +13 -13
- package/package.json +5 -5
package/dist/main.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $
|
|
1
|
+
var $4zSno$react = require("react");
|
|
2
2
|
|
|
3
3
|
function $parcel$exportWildcard(dest, source) {
|
|
4
4
|
Object.keys(source).forEach(function(key) {
|
|
@@ -19,12 +19,12 @@ function $parcel$exportWildcard(dest, source) {
|
|
|
19
19
|
function $parcel$export(e, n, v, s) {
|
|
20
20
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
21
21
|
}
|
|
22
|
-
var $
|
|
22
|
+
var $97a0ee2d5f702098$exports = {};
|
|
23
23
|
|
|
24
|
-
$parcel$export($
|
|
24
|
+
$parcel$export($97a0ee2d5f702098$exports, "useDraggableCollectionState", () => $97a0ee2d5f702098$export$29efd034f1d79f81);
|
|
25
25
|
|
|
26
|
-
function $
|
|
27
|
-
let [draggingKeys, setDraggingKeys] = $
|
|
26
|
+
function $97a0ee2d5f702098$export$29efd034f1d79f81(props) {
|
|
27
|
+
let [draggingKeys, setDraggingKeys] = $4zSno$react.useState(new Set());
|
|
28
28
|
let getKeys = (key)=>{
|
|
29
29
|
// The clicked item is always added to the drag. If it is selected, then all of the
|
|
30
30
|
// other selected items are also dragged. If it is not selected, the only the clicked
|
|
@@ -72,12 +72,12 @@ function $3585abb7393c2560$export$29efd034f1d79f81(props) {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
var $
|
|
75
|
+
var $493c7e7e2c1a0cd7$exports = {};
|
|
76
76
|
|
|
77
|
-
$parcel$export($
|
|
77
|
+
$parcel$export($493c7e7e2c1a0cd7$exports, "useDroppableCollectionState", () => $493c7e7e2c1a0cd7$export$926850f6ecef79d0);
|
|
78
78
|
|
|
79
|
-
function $
|
|
80
|
-
let [target1, setTarget] = $
|
|
79
|
+
function $493c7e7e2c1a0cd7$export$926850f6ecef79d0(props) {
|
|
80
|
+
let [target1, setTarget] = $4zSno$react.useState(null);
|
|
81
81
|
let getOppositeTarget = (target)=>{
|
|
82
82
|
if (target.dropPosition === 'before') {
|
|
83
83
|
let key = props.collection.getKeyBefore(target.key);
|
|
@@ -116,9 +116,9 @@ function $0cff40b4ffb5d954$export$926850f6ecef79d0(props) {
|
|
|
116
116
|
setTarget(newTarget);
|
|
117
117
|
},
|
|
118
118
|
isDropTarget (dropTarget) {
|
|
119
|
-
if ($
|
|
119
|
+
if ($493c7e7e2c1a0cd7$var$isEqualDropTarget(dropTarget, target1)) return true;
|
|
120
120
|
// Check if the targets point at the same point between two items, one referring before, and the other after.
|
|
121
|
-
if (dropTarget?.type === 'item' && target1?.type === 'item' && dropTarget.key !== target1.key && dropTarget.dropPosition !== target1.dropPosition && dropTarget.dropPosition !== 'on' && target1.dropPosition !== 'on') return $
|
|
121
|
+
if (dropTarget?.type === 'item' && target1?.type === 'item' && dropTarget.key !== target1.key && dropTarget.dropPosition !== target1.dropPosition && dropTarget.dropPosition !== 'on' && target1.dropPosition !== 'on') return $493c7e7e2c1a0cd7$var$isEqualDropTarget(getOppositeTarget(dropTarget), target1) || $493c7e7e2c1a0cd7$var$isEqualDropTarget(dropTarget, getOppositeTarget(target1));
|
|
122
122
|
return false;
|
|
123
123
|
},
|
|
124
124
|
getDropOperation (target, types, allowedOperations) {
|
|
@@ -126,7 +126,7 @@ function $0cff40b4ffb5d954$export$926850f6ecef79d0(props) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
function $
|
|
129
|
+
function $493c7e7e2c1a0cd7$var$isEqualDropTarget(a, b) {
|
|
130
130
|
if (!a) return !b;
|
|
131
131
|
switch(a.type){
|
|
132
132
|
case 'root':
|
|
@@ -137,8 +137,8 @@ function $0cff40b4ffb5d954$var$isEqualDropTarget(a, b) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
|
|
140
|
-
$parcel$exportWildcard(module.exports, $
|
|
141
|
-
$parcel$exportWildcard(module.exports, $
|
|
140
|
+
$parcel$exportWildcard(module.exports, $97a0ee2d5f702098$exports);
|
|
141
|
+
$parcel$exportWildcard(module.exports, $493c7e7e2c1a0cd7$exports);
|
|
142
142
|
|
|
143
143
|
|
|
144
144
|
//# sourceMappingURL=main.js.map
|
package/dist/module.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {useState as $
|
|
1
|
+
import {useState as $gjNPF$useState} from "react";
|
|
2
2
|
|
|
3
3
|
function $parcel$export(e, n, v, s) {
|
|
4
4
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
5
5
|
}
|
|
6
|
-
var $
|
|
6
|
+
var $cfde1c3ca5456981$exports = {};
|
|
7
7
|
|
|
8
|
-
$parcel$export($
|
|
8
|
+
$parcel$export($cfde1c3ca5456981$exports, "useDraggableCollectionState", () => $cfde1c3ca5456981$export$29efd034f1d79f81);
|
|
9
9
|
|
|
10
|
-
function $
|
|
11
|
-
let [draggingKeys, setDraggingKeys] = $
|
|
10
|
+
function $cfde1c3ca5456981$export$29efd034f1d79f81(props) {
|
|
11
|
+
let [draggingKeys, setDraggingKeys] = $gjNPF$useState(new Set());
|
|
12
12
|
let getKeys = (key)=>{
|
|
13
13
|
// The clicked item is always added to the drag. If it is selected, then all of the
|
|
14
14
|
// other selected items are also dragged. If it is not selected, the only the clicked
|
|
@@ -56,12 +56,12 @@ function $3d49872db6c3ff6a$export$29efd034f1d79f81(props) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
|
|
59
|
-
var $
|
|
59
|
+
var $dabc5ba65f76be17$exports = {};
|
|
60
60
|
|
|
61
|
-
$parcel$export($
|
|
61
|
+
$parcel$export($dabc5ba65f76be17$exports, "useDroppableCollectionState", () => $dabc5ba65f76be17$export$926850f6ecef79d0);
|
|
62
62
|
|
|
63
|
-
function $
|
|
64
|
-
let [target1, setTarget] = $
|
|
63
|
+
function $dabc5ba65f76be17$export$926850f6ecef79d0(props) {
|
|
64
|
+
let [target1, setTarget] = $gjNPF$useState(null);
|
|
65
65
|
let getOppositeTarget = (target)=>{
|
|
66
66
|
if (target.dropPosition === 'before') {
|
|
67
67
|
let key = props.collection.getKeyBefore(target.key);
|
|
@@ -100,9 +100,9 @@ function $bffaa0c5c19165a2$export$926850f6ecef79d0(props) {
|
|
|
100
100
|
setTarget(newTarget);
|
|
101
101
|
},
|
|
102
102
|
isDropTarget (dropTarget) {
|
|
103
|
-
if ($
|
|
103
|
+
if ($dabc5ba65f76be17$var$isEqualDropTarget(dropTarget, target1)) return true;
|
|
104
104
|
// Check if the targets point at the same point between two items, one referring before, and the other after.
|
|
105
|
-
if (dropTarget?.type === 'item' && target1?.type === 'item' && dropTarget.key !== target1.key && dropTarget.dropPosition !== target1.dropPosition && dropTarget.dropPosition !== 'on' && target1.dropPosition !== 'on') return $
|
|
105
|
+
if (dropTarget?.type === 'item' && target1?.type === 'item' && dropTarget.key !== target1.key && dropTarget.dropPosition !== target1.dropPosition && dropTarget.dropPosition !== 'on' && target1.dropPosition !== 'on') return $dabc5ba65f76be17$var$isEqualDropTarget(getOppositeTarget(dropTarget), target1) || $dabc5ba65f76be17$var$isEqualDropTarget(dropTarget, getOppositeTarget(target1));
|
|
106
106
|
return false;
|
|
107
107
|
},
|
|
108
108
|
getDropOperation (target, types, allowedOperations) {
|
|
@@ -110,7 +110,7 @@ function $bffaa0c5c19165a2$export$926850f6ecef79d0(props) {
|
|
|
110
110
|
}
|
|
111
111
|
};
|
|
112
112
|
}
|
|
113
|
-
function $
|
|
113
|
+
function $dabc5ba65f76be17$var$isEqualDropTarget(a, b) {
|
|
114
114
|
if (!a) return !b;
|
|
115
115
|
switch(a.type){
|
|
116
116
|
case 'root':
|
|
@@ -123,5 +123,5 @@ function $bffaa0c5c19165a2$var$isEqualDropTarget(a, b) {
|
|
|
123
123
|
|
|
124
124
|
|
|
125
125
|
|
|
126
|
-
export {$
|
|
126
|
+
export {$cfde1c3ca5456981$export$29efd034f1d79f81 as useDraggableCollectionState, $dabc5ba65f76be17$export$926850f6ecef79d0 as useDroppableCollectionState};
|
|
127
127
|
//# sourceMappingURL=module.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-stately/dnd",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.3100+da2aa7467",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@babel/runtime": "^7.6.2",
|
|
21
|
-
"@react-stately/selection": "3.0.0-nightly.
|
|
22
|
-
"@react-stately/utils": "3.0.0-nightly.
|
|
23
|
-
"@react-types/shared": "3.0.0-nightly.
|
|
21
|
+
"@react-stately/selection": "3.0.0-nightly.1409+da2aa7467",
|
|
22
|
+
"@react-stately/utils": "3.0.0-nightly.1409+da2aa7467",
|
|
23
|
+
"@react-types/shared": "3.0.0-nightly.1409+da2aa7467"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^16.8.0 || ^17.0.0-rc.1"
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "da2aa74670fbd93335ff01401ca53826b3602777"
|
|
32
32
|
}
|