@react-spectrum/dnd 3.0.2-nightly.3696 → 3.0.2-nightly.3705

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 (2) hide show
  1. package/dist/import.mjs +76 -0
  2. package/package.json +11 -6
@@ -0,0 +1,76 @@
1
+ import {DIRECTORY_DRAG_TYPE as $bd7af2e3e7bb229d$re_export$DIRECTORY_DRAG_TYPE, useDraggableCollection as $6PX7k$useDraggableCollection, useDraggableItem as $6PX7k$useDraggableItem, DragPreview as $6PX7k$DragPreview, useDroppableItem as $6PX7k$useDroppableItem, useDroppableCollection as $6PX7k$useDroppableCollection, useDropIndicator as $6PX7k$useDropIndicator, isVirtualDragging as $6PX7k$isVirtualDragging} from "@react-aria/dnd";
2
+ import {useDraggableCollectionState as $6PX7k$useDraggableCollectionState, useDroppableCollectionState as $6PX7k$useDroppableCollectionState} from "@react-stately/dnd";
3
+ import {useMemo as $6PX7k$useMemo} from "react";
4
+
5
+ /*
6
+ * Copyright 2022 Adobe. All rights reserved.
7
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License. You may obtain a copy
9
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software distributed under
12
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
13
+ * OF ANY KIND, either express or implied. See the License for the specific language
14
+ * governing permissions and limitations under the License.
15
+ */ /// <reference types="css-module-types" />
16
+ /*
17
+ * Copyright 2022 Adobe. All rights reserved.
18
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License. You may obtain a copy
20
+ * of the License at http://www.apache.org/licenses/LICENSE-2.0
21
+ *
22
+ * Unless required by applicable law or agreed to in writing, software distributed under
23
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
24
+ * OF ANY KIND, either express or implied. See the License for the specific language
25
+ * governing permissions and limitations under the License.
26
+ */
27
+
28
+
29
+ function $8d44a09a765f4c9c$export$2cfc5be7a55829f6(options) {
30
+ let dragAndDropHooks = (0, $6PX7k$useMemo)(()=>{
31
+ let { onDrop: onDrop , onInsert: onInsert , onItemDrop: onItemDrop , onReorder: onReorder , onRootDrop: onRootDrop , getItems: getItems } = options;
32
+ let isDraggable = !!getItems;
33
+ let isDroppable = !!(onDrop || onInsert || onItemDrop || onReorder || onRootDrop);
34
+ let hooks = {};
35
+ if (isDraggable) {
36
+ hooks.useDraggableCollectionState = function useDraggableCollectionStateOverride(props) {
37
+ return (0, $6PX7k$useDraggableCollectionState)({
38
+ ...props,
39
+ ...options
40
+ });
41
+ };
42
+ hooks.useDraggableCollection = (0, $6PX7k$useDraggableCollection);
43
+ hooks.useDraggableItem = (0, $6PX7k$useDraggableItem);
44
+ hooks.DragPreview = (0, $6PX7k$DragPreview);
45
+ }
46
+ if (isDroppable) {
47
+ hooks.useDroppableCollectionState = function useDroppableCollectionStateOverride(props) {
48
+ return (0, $6PX7k$useDroppableCollectionState)({
49
+ ...props,
50
+ ...options
51
+ });
52
+ }, hooks.useDroppableItem = (0, $6PX7k$useDroppableItem);
53
+ hooks.useDroppableCollection = function useDroppableCollectionOverride(props, state, ref) {
54
+ return (0, $6PX7k$useDroppableCollection)({
55
+ ...props,
56
+ ...options
57
+ }, state, ref);
58
+ };
59
+ hooks.useDropIndicator = (0, $6PX7k$useDropIndicator);
60
+ }
61
+ if (isDraggable || isDroppable) hooks.isVirtualDragging = (0, $6PX7k$isVirtualDragging);
62
+ return hooks;
63
+ }, [
64
+ options
65
+ ]);
66
+ return {
67
+ dragAndDropHooks: dragAndDropHooks
68
+ };
69
+ }
70
+
71
+
72
+
73
+
74
+
75
+ export {$8d44a09a765f4c9c$export$2cfc5be7a55829f6 as useDragAndDrop, $bd7af2e3e7bb229d$re_export$DIRECTORY_DRAG_TYPE as DIRECTORY_DRAG_TYPE};
76
+ //# sourceMappingURL=module.js.map
package/package.json CHANGED
@@ -1,10 +1,15 @@
1
1
  {
2
2
  "name": "@react-spectrum/dnd",
3
- "version": "3.0.2-nightly.3696+be0fae9f7",
3
+ "version": "3.0.2-nightly.3705+93b3c951e",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
+ "exports": {
9
+ "types": "./dist/types.d.ts",
10
+ "import": "./dist/import.mjs",
11
+ "require": "./dist/main.js"
12
+ },
8
13
  "types": "dist/types.d.ts",
9
14
  "source": "src/index.ts",
10
15
  "files": [
@@ -31,13 +36,13 @@
31
36
  "url": "https://github.com/adobe/react-spectrum"
32
37
  },
33
38
  "dependencies": {
34
- "@react-aria/dnd": "3.0.2-nightly.3696+be0fae9f7",
35
- "@react-stately/dnd": "3.0.2-nightly.3696+be0fae9f7",
36
- "@react-types/shared": "3.0.0-nightly.1996+be0fae9f7",
39
+ "@react-aria/dnd": "3.0.2-nightly.3705+93b3c951e",
40
+ "@react-stately/dnd": "3.0.2-nightly.3705+93b3c951e",
41
+ "@react-types/shared": "3.0.0-nightly.2005+93b3c951e",
37
42
  "@swc/helpers": "^0.4.14"
38
43
  },
39
44
  "devDependencies": {
40
- "@adobe/spectrum-css-temp": "3.0.0-nightly.1996+be0fae9f7"
45
+ "@adobe/spectrum-css-temp": "3.0.0-nightly.2005+93b3c951e"
41
46
  },
42
47
  "peerDependencies": {
43
48
  "@react-spectrum/provider": "^3.0.0",
@@ -46,5 +51,5 @@
46
51
  "publishConfig": {
47
52
  "access": "public"
48
53
  },
49
- "gitHead": "be0fae9f7952f4d09823498dc1f251e13842f338"
54
+ "gitHead": "93b3c951eb784b14183f9988f2d188b34de8f42d"
50
55
  }