@react-types/shared 3.0.0-nightly.2961 → 3.0.0-nightly.2969

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.0.0-nightly.2961+278e5167f",
3
+ "version": "3.0.0-nightly.2969+2fd87d9f1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "types": "src/index.d.ts",
@@ -9,10 +9,10 @@
9
9
  "url": "https://github.com/adobe/react-spectrum"
10
10
  },
11
11
  "peerDependencies": {
12
- "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0"
12
+ "react": "^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0"
13
13
  },
14
14
  "publishConfig": {
15
15
  "access": "public"
16
16
  },
17
- "gitHead": "278e5167ffc85569c00ac32a17c595ba4c861c63"
17
+ "gitHead": "2fd87d9f1d894e6b00a595cce73c6e8828029132"
18
18
  }
@@ -123,6 +123,28 @@ export interface KeyboardDelegate {
123
123
  getKeyForSearch?(search: string, fromKey?: Key): Key | null
124
124
  }
125
125
 
126
+ export interface Rect {
127
+ x: number,
128
+ y: number,
129
+ width: number,
130
+ height: number
131
+ }
132
+
133
+ export interface Size {
134
+ width: number,
135
+ height: number
136
+ }
137
+
138
+ /** A LayoutDelegate provides layout information for collection items. */
139
+ export interface LayoutDelegate {
140
+ /** Returns a rectangle for the item with the given key. */
141
+ getItemRect(key: Key): Rect | null,
142
+ /** Returns the visible rectangle of the collection. */
143
+ getVisibleRect(): Rect,
144
+ /** Returns the size of the scrollable content in the collection. */
145
+ getContentSize(): Size
146
+ }
147
+
126
148
  /**
127
149
  * A generic interface to access a readonly sequential
128
150
  * collection of unique keyed items.
package/src/dnd.d.ts CHANGED
@@ -281,7 +281,7 @@ export interface DraggableCollectionProps {
281
281
  /** A function that returns the items being dragged. */
282
282
  getItems: (keys: Set<Key>) => DragItem[],
283
283
  /** The ref of the element that will be rendered as the drag preview while dragging. */
284
- preview?: RefObject<DragPreviewRenderer>,
284
+ preview?: RefObject<DragPreviewRenderer | null>,
285
285
  /** Function that returns the drop operations that are allowed for the dragged items. If not provided, all drop operations are allowed. */
286
286
  getAllowedDropOperations?: () => DropOperation[]
287
287
  }