@react-types/shared 3.29.0 → 3.30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-types/shared",
3
- "version": "3.29.0",
3
+ "version": "3.30.0",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -14,5 +14,5 @@
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
17
+ "gitHead": "265b4d7f107905ee1c6e87a8af1613ab440a6849"
18
18
  }
package/src/dnd.d.ts CHANGED
@@ -218,9 +218,17 @@ export interface DroppableCollectionUtilityOptions {
218
218
  */
219
219
  onItemDrop?: (e: DroppableCollectionOnItemDropEvent) => void,
220
220
  /**
221
- * Handler that is called when items are reordered via drag in the source collection.
221
+ * Handler that is called when items are reordered within the collection.
222
+ * This handler only allows dropping between items, not on items.
223
+ * It does not allow moving items to a different parent item within a tree.
222
224
  */
223
225
  onReorder?: (e: DroppableCollectionReorderEvent) => void,
226
+ /**
227
+ * Handler that is called when items are moved within the source collection.
228
+ * This handler allows dropping both on or between items, and items may be
229
+ * moved to a different parent item within a tree.
230
+ */
231
+ onMove?: (e: DroppableCollectionReorderEvent) => void,
224
232
  /**
225
233
  * A function returning whether a given target in the droppable collection is a valid "on" drop target for the current drag types.
226
234
  */
@@ -232,7 +240,6 @@ export interface DroppableCollectionBaseProps {
232
240
  onDropEnter?: (e: DroppableCollectionEnterEvent) => void,
233
241
  /**
234
242
  * Handler that is called after a valid drag is held over a drop target for a period of time.
235
- * @private
236
243
  */
237
244
  onDropActivate?: (e: DroppableCollectionActivateEvent) => void,
238
245
  /** Handler that is called when a valid drag exits a drop target. */
@@ -20,7 +20,7 @@ export interface SingleSelection {
20
20
  /** The initial selected key in the collection (uncontrolled). */
21
21
  defaultSelectedKey?: Key,
22
22
  /** Handler that is called when the selection changes. */
23
- onSelectionChange?: (key: Key) => void
23
+ onSelectionChange?: (key: Key | null) => void
24
24
  }
25
25
 
26
26
  export type SelectionMode = 'none' | 'single' | 'multiple';