react-grid-layout 1.5.3 → 2.0.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.
Files changed (95) hide show
  1. package/README.md +1074 -432
  2. package/css/styles.css +6 -4
  3. package/dist/ResponsiveGridLayout-CH4s0tKj.d.ts +124 -0
  4. package/dist/ResponsiveGridLayout-D6lFRE3f.d.mts +124 -0
  5. package/dist/calculate-CwYDW8na.d.mts +168 -0
  6. package/dist/calculate-mgLpNJ5O.d.ts +168 -0
  7. package/dist/chunk-2KUHNJXF.mjs +90 -0
  8. package/dist/chunk-2KUHNJXF.mjs.map +1 -0
  9. package/dist/chunk-3WO4SAYB.js +868 -0
  10. package/dist/chunk-3WO4SAYB.js.map +1 -0
  11. package/dist/chunk-4HNUMWQK.mjs +822 -0
  12. package/dist/chunk-4HNUMWQK.mjs.map +1 -0
  13. package/dist/chunk-BFTKGAP3.js +1309 -0
  14. package/dist/chunk-BFTKGAP3.js.map +1 -0
  15. package/dist/chunk-F6NQPYKT.js +98 -0
  16. package/dist/chunk-F6NQPYKT.js.map +1 -0
  17. package/dist/chunk-H5KMDLY3.js +434 -0
  18. package/dist/chunk-H5KMDLY3.js.map +1 -0
  19. package/dist/chunk-PBQSHIID.js +4 -0
  20. package/dist/chunk-PBQSHIID.js.map +1 -0
  21. package/dist/chunk-R35HZZTA.mjs +1300 -0
  22. package/dist/chunk-R35HZZTA.mjs.map +1 -0
  23. package/dist/chunk-ZCXE6SR5.mjs +428 -0
  24. package/dist/chunk-ZCXE6SR5.mjs.map +1 -0
  25. package/dist/chunk-ZWN22PS2.mjs +3 -0
  26. package/dist/chunk-ZWN22PS2.mjs.map +1 -0
  27. package/dist/core.d.mts +33 -0
  28. package/dist/core.d.ts +33 -0
  29. package/dist/core.js +218 -0
  30. package/dist/core.js.map +1 -0
  31. package/dist/core.mjs +5 -0
  32. package/dist/core.mjs.map +1 -0
  33. package/dist/extras.d.mts +78 -0
  34. package/dist/extras.d.ts +78 -0
  35. package/dist/extras.js +91 -0
  36. package/dist/extras.js.map +1 -0
  37. package/dist/extras.mjs +89 -0
  38. package/dist/extras.mjs.map +1 -0
  39. package/dist/index.d.mts +7 -0
  40. package/dist/index.d.ts +7 -0
  41. package/dist/index.js +154 -0
  42. package/dist/index.js.map +1 -0
  43. package/dist/index.mjs +7 -0
  44. package/dist/index.mjs.map +1 -0
  45. package/dist/legacy.d.mts +163 -0
  46. package/dist/legacy.d.ts +163 -0
  47. package/dist/legacy.js +319 -0
  48. package/dist/legacy.js.map +1 -0
  49. package/dist/legacy.mjs +307 -0
  50. package/dist/legacy.mjs.map +1 -0
  51. package/dist/position-BmN1z36J.d.mts +319 -0
  52. package/dist/position-Dk2b4ZMS.d.ts +319 -0
  53. package/dist/react.d.mts +351 -0
  54. package/dist/react.d.ts +351 -0
  55. package/dist/react.js +96 -0
  56. package/dist/react.js.map +1 -0
  57. package/dist/react.mjs +7 -0
  58. package/dist/react.mjs.map +1 -0
  59. package/dist/responsive-C4L1ESlm.d.ts +145 -0
  60. package/dist/responsive-CJxefsYw.d.mts +145 -0
  61. package/dist/types-Cxf4nHNr.d.mts +375 -0
  62. package/dist/types-Cxf4nHNr.d.ts +375 -0
  63. package/index-dev.js +8 -0
  64. package/package.json +132 -40
  65. package/.babelrc.js +0 -22
  66. package/.browserslistrc +0 -3
  67. package/.eslintignore +0 -4
  68. package/.flowconfig +0 -20
  69. package/.prettierignore +0 -4
  70. package/.prettierrc +0 -17
  71. package/CHANGELOG.md +0 -985
  72. package/build/GridItem.js +0 -638
  73. package/build/ReactGridLayout.js +0 -741
  74. package/build/ReactGridLayoutPropTypes.js +0 -210
  75. package/build/ResponsiveReactGridLayout.js +0 -297
  76. package/build/calculateUtils.js +0 -165
  77. package/build/components/WidthProvider.js +0 -115
  78. package/build/fastRGLPropsEqual.js +0 -5
  79. package/build/responsiveUtils.js +0 -101
  80. package/build/utils.js +0 -842
  81. package/dist/react-grid-layout.min.js +0 -2
  82. package/dist/react-grid-layout.min.js.map +0 -1
  83. package/index.js.flow +0 -8
  84. package/ip_fetcher +0 -0
  85. package/ip_fetcher.c +0 -47
  86. package/lib/GridItem.jsx +0 -689
  87. package/lib/ReactGridLayout.jsx +0 -855
  88. package/lib/ReactGridLayoutPropTypes.js +0 -241
  89. package/lib/ResponsiveReactGridLayout.jsx +0 -349
  90. package/lib/calculateUtils.js +0 -169
  91. package/lib/components/WidthProvider.jsx +0 -110
  92. package/lib/fastRGLPropsEqual.js +0 -46
  93. package/lib/responsiveUtils.js +0 -118
  94. package/lib/utils.js +0 -995
  95. package/yarn-error.log +0 -7780
@@ -0,0 +1,145 @@
1
+ import { a as LayoutItem, L as Layout, C as CompactType, B as Breakpoint, b as Breakpoints, R as ResponsiveLayouts } from './types-Cxf4nHNr.mjs';
2
+
3
+ /**
4
+ * Collision detection utilities for grid layouts.
5
+ *
6
+ * These functions determine if and where layout items overlap.
7
+ */
8
+
9
+ /**
10
+ * Check if two layout items collide (overlap).
11
+ *
12
+ * Two items collide if their bounding boxes overlap and they are
13
+ * not the same item.
14
+ *
15
+ * @param l1 - First layout item
16
+ * @param l2 - Second layout item
17
+ * @returns true if the items collide
18
+ */
19
+ declare function collides(l1: LayoutItem, l2: LayoutItem): boolean;
20
+ /**
21
+ * Find the first item in the layout that collides with the given item.
22
+ *
23
+ * @param layout - Layout to search
24
+ * @param layoutItem - Item to check for collisions
25
+ * @returns The first colliding item, or undefined if none
26
+ */
27
+ declare function getFirstCollision(layout: Layout, layoutItem: LayoutItem): LayoutItem | undefined;
28
+ /**
29
+ * Find all items in the layout that collide with the given item.
30
+ *
31
+ * @param layout - Layout to search
32
+ * @param layoutItem - Item to check for collisions
33
+ * @returns Array of all colliding items (may be empty)
34
+ */
35
+ declare function getAllCollisions(layout: Layout, layoutItem: LayoutItem): LayoutItem[];
36
+
37
+ /**
38
+ * Sorting utilities for grid layouts.
39
+ *
40
+ * These functions sort layout items for compaction and iteration.
41
+ */
42
+
43
+ /**
44
+ * Sort layout items based on the compaction type.
45
+ *
46
+ * - Vertical compaction: sort by row (y) then column (x)
47
+ * - Horizontal compaction: sort by column (x) then row (y)
48
+ * - No compaction (null): return original order
49
+ *
50
+ * Does not modify the original layout.
51
+ *
52
+ * @param layout - Layout to sort
53
+ * @param compactType - Type of compaction
54
+ * @returns Sorted layout
55
+ */
56
+ declare function sortLayoutItems(layout: Layout, compactType: CompactType): LayoutItem[];
57
+ /**
58
+ * Sort layout items by row ascending, then column ascending.
59
+ *
60
+ * Items are ordered from top-left to bottom-right, row by row.
61
+ * This is the natural reading order for vertical compaction.
62
+ *
63
+ * Does not modify the original layout.
64
+ *
65
+ * @param layout - Layout to sort
66
+ * @returns Sorted array of layout items
67
+ */
68
+ declare function sortLayoutItemsByRowCol(layout: Layout): LayoutItem[];
69
+ /**
70
+ * Sort layout items by column ascending, then row ascending.
71
+ *
72
+ * Items are ordered from top-left to bottom-right, column by column.
73
+ * This is the natural order for horizontal compaction.
74
+ *
75
+ * Does not modify the original layout.
76
+ *
77
+ * @param layout - Layout to sort
78
+ * @returns Sorted array of layout items
79
+ */
80
+ declare function sortLayoutItemsByColRow(layout: Layout): LayoutItem[];
81
+
82
+ /**
83
+ * Responsive layout utilities.
84
+ *
85
+ * Functions for handling responsive breakpoints and layout generation.
86
+ */
87
+
88
+ /**
89
+ * Sort breakpoints by width (ascending).
90
+ *
91
+ * Returns an array of breakpoint names sorted from smallest to largest.
92
+ * E.g., ['xxs', 'xs', 'sm', 'md', 'lg']
93
+ *
94
+ * @param breakpoints - Map of breakpoint names to widths
95
+ * @returns Sorted array of breakpoint names
96
+ */
97
+ declare function sortBreakpoints<B extends Breakpoint>(breakpoints: Breakpoints<B>): B[];
98
+ /**
99
+ * Get the active breakpoint for a given width.
100
+ *
101
+ * Returns the highest breakpoint that is valid for the width (width > breakpoint).
102
+ *
103
+ * @param breakpoints - Map of breakpoint names to widths
104
+ * @param width - Container width in pixels
105
+ * @returns Active breakpoint name
106
+ */
107
+ declare function getBreakpointFromWidth<B extends Breakpoint>(breakpoints: Breakpoints<B>, width: number): B;
108
+ /**
109
+ * Get the column count for a breakpoint.
110
+ *
111
+ * @param breakpoint - Breakpoint name
112
+ * @param cols - Map of breakpoint names to column counts
113
+ * @returns Number of columns for the breakpoint
114
+ * @throws Error if breakpoint is not defined in cols
115
+ */
116
+ declare function getColsFromBreakpoint<B extends Breakpoint>(breakpoint: B, cols: Breakpoints<B>): number;
117
+ /**
118
+ * Find or generate a layout for a breakpoint.
119
+ *
120
+ * If a layout exists for the breakpoint, returns a clone.
121
+ * Otherwise, generates a new layout from the nearest larger breakpoint.
122
+ *
123
+ * @param layouts - Existing layouts by breakpoint
124
+ * @param breakpoints - Breakpoint definitions
125
+ * @param breakpoint - Target breakpoint
126
+ * @param lastBreakpoint - Previous breakpoint (for fallback)
127
+ * @param cols - Column count for the target breakpoint
128
+ * @param compactType - Compaction type
129
+ * @returns Layout for the breakpoint
130
+ */
131
+ declare function findOrGenerateResponsiveLayout<B extends Breakpoint>(layouts: ResponsiveLayouts<B>, breakpoints: Breakpoints<B>, breakpoint: B, lastBreakpoint: B, cols: number, compactType: CompactType): Layout;
132
+ type IndentationValue<B extends Breakpoint> = readonly [number, number] | Partial<Record<B, readonly [number, number]>>;
133
+ /**
134
+ * Get margin or padding value for a breakpoint.
135
+ *
136
+ * Supports both fixed values ([x, y]) and breakpoint-specific values
137
+ * ({ lg: [x, y], md: [x, y], ... }).
138
+ *
139
+ * @param value - Fixed value or breakpoint-specific map
140
+ * @param breakpoint - Current breakpoint
141
+ * @returns Margin/padding tuple [x, y]
142
+ */
143
+ declare function getIndentationValue<B extends Breakpoint>(value: IndentationValue<B>, breakpoint: B): readonly [number, number];
144
+
145
+ export { getAllCollisions as a, sortLayoutItemsByRowCol as b, collides as c, sortLayoutItemsByColRow as d, getBreakpointFromWidth as e, getColsFromBreakpoint as f, getFirstCollision as g, findOrGenerateResponsiveLayout as h, sortBreakpoints as i, getIndentationValue as j, sortLayoutItems as s };
@@ -0,0 +1,375 @@
1
+ /**
2
+ * Core types for react-grid-layout v2
3
+ *
4
+ * These types are framework-agnostic and define the data structures
5
+ * used by the layout algorithms.
6
+ */
7
+ /**
8
+ * Axis identifiers for resize handles.
9
+ * - Cardinal: 'n', 's', 'e', 'w' (north, south, east, west)
10
+ * - Diagonal: 'ne', 'nw', 'se', 'sw'
11
+ */
12
+ type ResizeHandleAxis = "s" | "w" | "e" | "n" | "sw" | "nw" | "se" | "ne";
13
+ /**
14
+ * A single item in the grid layout.
15
+ *
16
+ * Position (x, y) is in grid units, not pixels.
17
+ * Size (w, h) is in grid units.
18
+ */
19
+ interface LayoutItem {
20
+ /** Unique identifier for this item */
21
+ i: string;
22
+ /** X position in grid units (0-indexed from left) */
23
+ x: number;
24
+ /** Y position in grid units (0-indexed from top) */
25
+ y: number;
26
+ /** Width in grid units */
27
+ w: number;
28
+ /** Height in grid units */
29
+ h: number;
30
+ /** Minimum width in grid units */
31
+ minW?: number;
32
+ /** Minimum height in grid units */
33
+ minH?: number;
34
+ /** Maximum width in grid units */
35
+ maxW?: number;
36
+ /** Maximum height in grid units */
37
+ maxH?: number;
38
+ /**
39
+ * If true, item cannot be dragged or resized, and other items
40
+ * will move around it during compaction.
41
+ */
42
+ static?: boolean;
43
+ /**
44
+ * If false, item cannot be dragged (but may still be resizable).
45
+ * Overrides grid-level isDraggable for this item.
46
+ */
47
+ isDraggable?: boolean;
48
+ /**
49
+ * If false, item cannot be resized (but may still be draggable).
50
+ * Overrides grid-level isResizable for this item.
51
+ */
52
+ isResizable?: boolean;
53
+ /**
54
+ * Which resize handles to show for this item.
55
+ * Overrides grid-level resizeHandles for this item.
56
+ */
57
+ resizeHandles?: ResizeHandleAxis[];
58
+ /**
59
+ * If true, item is constrained to the grid container bounds.
60
+ * Overrides grid-level isBounded for this item.
61
+ */
62
+ isBounded?: boolean;
63
+ /**
64
+ * Internal flag set during drag/resize operations to indicate
65
+ * the item has moved from its original position.
66
+ * @internal
67
+ */
68
+ moved?: boolean;
69
+ }
70
+ /**
71
+ * A layout is a readonly array of layout items.
72
+ * Layouts should be treated as immutable.
73
+ */
74
+ type Layout = readonly LayoutItem[];
75
+ /**
76
+ * Pixel position and size of an element.
77
+ */
78
+ interface Position {
79
+ left: number;
80
+ top: number;
81
+ width: number;
82
+ height: number;
83
+ }
84
+ /**
85
+ * Partial position (just coordinates, no size).
86
+ */
87
+ interface PartialPosition {
88
+ left: number;
89
+ top: number;
90
+ }
91
+ /**
92
+ * Size in pixels.
93
+ */
94
+ interface Size {
95
+ width: number;
96
+ height: number;
97
+ }
98
+ /**
99
+ * Position when dropping an external element onto the grid.
100
+ */
101
+ interface DroppingPosition {
102
+ left: number;
103
+ top: number;
104
+ e: Event;
105
+ }
106
+ /**
107
+ * Data provided by react-draggable during drag operations.
108
+ */
109
+ interface ReactDraggableCallbackData {
110
+ node: HTMLElement;
111
+ x?: number;
112
+ y?: number;
113
+ deltaX: number;
114
+ deltaY: number;
115
+ lastX?: number;
116
+ lastY?: number;
117
+ }
118
+ /**
119
+ * Grid-level drag event data.
120
+ */
121
+ interface GridDragEvent {
122
+ e: Event;
123
+ node: HTMLElement;
124
+ newPosition: PartialPosition;
125
+ }
126
+ /**
127
+ * Grid-level resize event data.
128
+ */
129
+ interface GridResizeEvent {
130
+ e: Event;
131
+ node: HTMLElement;
132
+ size: Size;
133
+ handle: ResizeHandleAxis;
134
+ }
135
+ /**
136
+ * Drag-over event with layer coordinates.
137
+ */
138
+ interface DragOverEvent extends MouseEvent {
139
+ nativeEvent: Event & {
140
+ layerX: number;
141
+ layerY: number;
142
+ };
143
+ }
144
+ /**
145
+ * Type of compaction to apply to the layout.
146
+ * - 'vertical': Items compact upward (default)
147
+ * - 'horizontal': Items compact leftward
148
+ * - null: No compaction (free-form positioning)
149
+ */
150
+ type CompactType = "horizontal" | "vertical" | null;
151
+ /**
152
+ * Standard callback signature for layout change events.
153
+ *
154
+ * @param layout - The current layout after the change
155
+ * @param oldItem - The item before the change (null if not applicable)
156
+ * @param newItem - The item after the change (null if not applicable)
157
+ * @param placeholder - The placeholder item during drag/resize (null at start)
158
+ * @param event - The DOM event that triggered the change
159
+ * @param element - The DOM element being manipulated (null if not applicable)
160
+ */
161
+ type EventCallback = (layout: Layout, oldItem: LayoutItem | null, newItem: LayoutItem | null, placeholder: LayoutItem | null, event: Event, element: HTMLElement | null) => void;
162
+ /**
163
+ * Callback when layout changes for any reason.
164
+ */
165
+ type OnLayoutChangeCallback = (layout: Layout) => void;
166
+ /**
167
+ * Interface for layout compaction strategies.
168
+ *
169
+ * Implement this interface to create custom compaction algorithms.
170
+ *
171
+ * @example
172
+ * ```typescript
173
+ * const myCompactor: Compactor = {
174
+ * type: 'vertical',
175
+ * allowOverlap: false,
176
+ * compact(layout, cols) {
177
+ * // Custom compaction logic
178
+ * return compactedLayout;
179
+ * },
180
+ * onMove(layout, item, x, y, cols) {
181
+ * // Handle item movement
182
+ * return updatedLayout;
183
+ * }
184
+ * };
185
+ * ```
186
+ */
187
+ interface Compactor {
188
+ /** Compaction type identifier */
189
+ readonly type: CompactType;
190
+ /** Whether overlapping items are allowed */
191
+ readonly allowOverlap: boolean;
192
+ /** Whether to prevent collisions instead of pushing items */
193
+ readonly preventCollision?: boolean;
194
+ /**
195
+ * Compact the layout.
196
+ *
197
+ * @param layout - The layout to compact
198
+ * @param cols - Number of columns in the grid
199
+ * @returns The compacted layout
200
+ */
201
+ compact(layout: Layout, cols: number): Layout;
202
+ /**
203
+ * Handle item movement, returning the updated layout.
204
+ *
205
+ * @param layout - Current layout
206
+ * @param item - The item being moved
207
+ * @param x - New x position
208
+ * @param y - New y position
209
+ * @param cols - Number of columns
210
+ * @returns Updated layout after the move
211
+ */
212
+ onMove(layout: Layout, item: LayoutItem, x: number, y: number, cols: number): Layout;
213
+ }
214
+ /**
215
+ * Interface for CSS positioning strategies.
216
+ *
217
+ * Implement this interface to customize how items are positioned in the DOM.
218
+ * Built-in strategies: transformStrategy, absoluteStrategy.
219
+ *
220
+ * @example
221
+ * ```typescript
222
+ * // Use transform-based positioning (default, better performance)
223
+ * <GridLayout positionStrategy={transformStrategy} />
224
+ *
225
+ * // Use top/left positioning (for environments where transforms cause issues)
226
+ * <GridLayout positionStrategy={absoluteStrategy} />
227
+ *
228
+ * // Use scaled transforms (for scaled containers)
229
+ * <GridLayout positionStrategy={createScaledStrategy(0.5)} />
230
+ * ```
231
+ */
232
+ interface PositionStrategy {
233
+ /** Strategy type identifier */
234
+ readonly type: "transform" | "absolute";
235
+ /** Scale factor for drag/resize calculations */
236
+ readonly scale: number;
237
+ /**
238
+ * Convert pixel position to CSS style object.
239
+ *
240
+ * @param pos - Position in pixels
241
+ * @returns CSS properties for positioning the element
242
+ */
243
+ calcStyle(pos: Position): React.CSSProperties;
244
+ /**
245
+ * Calculate position during drag operations, accounting for transforms and scale.
246
+ *
247
+ * @param clientX - Mouse client X position
248
+ * @param clientY - Mouse client Y position
249
+ * @param offsetX - Offset from element origin X
250
+ * @param offsetY - Offset from element origin Y
251
+ * @returns Adjusted left/top position
252
+ */
253
+ calcDragPosition(clientX: number, clientY: number, offsetX: number, offsetY: number): PartialPosition;
254
+ }
255
+ /**
256
+ * Grid measurement configuration.
257
+ * Groups all grid metrics (columns, row height, margins).
258
+ */
259
+ interface GridConfig {
260
+ /** Number of columns in the grid (default: 12) */
261
+ cols: number;
262
+ /** Height of a single row in pixels (default: 150) */
263
+ rowHeight: number;
264
+ /** [horizontal, vertical] margin between items in pixels (default: [10, 10]) */
265
+ margin: readonly [number, number];
266
+ /** [horizontal, vertical] padding inside the container (default: null, uses margin) */
267
+ containerPadding: readonly [number, number] | null;
268
+ /** Maximum number of rows (default: Infinity) */
269
+ maxRows: number;
270
+ }
271
+ /** Default grid configuration */
272
+ declare const defaultGridConfig: GridConfig;
273
+ /**
274
+ * Drag behavior configuration.
275
+ * Groups all drag-related settings.
276
+ */
277
+ interface DragConfig {
278
+ /** Whether items can be dragged (default: true) */
279
+ enabled: boolean;
280
+ /** Whether items are bounded to the container (default: false) */
281
+ bounded: boolean;
282
+ /** CSS selector for drag handle (e.g., '.drag-handle') */
283
+ handle?: string;
284
+ /** CSS selector for elements that should not trigger drag */
285
+ cancel?: string;
286
+ /**
287
+ * Minimum pixels to move before drag starts.
288
+ * Helps distinguish click from drag (fixes #1341, #1401).
289
+ * @default 3
290
+ */
291
+ threshold: number;
292
+ }
293
+ /** Default drag configuration */
294
+ declare const defaultDragConfig: DragConfig;
295
+ /**
296
+ * Resize behavior configuration.
297
+ * Groups all resize-related settings.
298
+ */
299
+ interface ResizeConfig {
300
+ /** Whether items can be resized (default: true) */
301
+ enabled: boolean;
302
+ /** Which resize handles to show (default: ['se']) */
303
+ handles: readonly ResizeHandleAxis[];
304
+ /**
305
+ * Custom resize handle component.
306
+ * Can be a React node or a function that receives the axis.
307
+ */
308
+ handleComponent?: React.ReactNode | ((axis: ResizeHandleAxis, ref: React.Ref<HTMLElement>) => React.ReactNode);
309
+ }
310
+ /** Default resize configuration */
311
+ declare const defaultResizeConfig: ResizeConfig;
312
+ /**
313
+ * Drop configuration (for dropping external elements).
314
+ * Groups all drop-related settings.
315
+ */
316
+ interface DropConfig {
317
+ /** Whether external elements can be dropped on the grid (default: false) */
318
+ enabled: boolean;
319
+ /** Default size for dropped items (default: { w: 1, h: 1 }) */
320
+ defaultItem: {
321
+ w: number;
322
+ h: number;
323
+ };
324
+ /**
325
+ * Called when dragging over the grid.
326
+ * Return dimensions to override defaultItem, or false to reject the drop.
327
+ */
328
+ onDragOver?: (e: DragEvent) => {
329
+ w?: number;
330
+ h?: number;
331
+ } | false | void;
332
+ }
333
+ /** Default drop configuration */
334
+ declare const defaultDropConfig: DropConfig;
335
+ /**
336
+ * Breakpoint name (e.g., 'lg', 'md', 'sm', 'xs', 'xxs').
337
+ */
338
+ type Breakpoint = string;
339
+ /**
340
+ * Map of breakpoint name to pixel width.
341
+ * Generic type B allows custom breakpoint strings.
342
+ */
343
+ type Breakpoints<B extends Breakpoint = Breakpoint> = Record<B, number>;
344
+ /**
345
+ * Map of breakpoint name to number of columns.
346
+ * Generic type B allows custom breakpoint strings.
347
+ */
348
+ type BreakpointCols<B extends Breakpoint = Breakpoint> = Record<B, number>;
349
+ /**
350
+ * Map of breakpoint name to layout.
351
+ * Generic type B allows custom breakpoint strings.
352
+ */
353
+ type ResponsiveLayouts<B extends Breakpoint = Breakpoint> = Partial<Record<B, Layout>>;
354
+ /**
355
+ * Callback when breakpoint changes.
356
+ */
357
+ type OnBreakpointChangeCallback<B extends Breakpoint = Breakpoint> = (newBreakpoint: B, cols: number) => void;
358
+ /**
359
+ * Makes all properties in T mutable (removes readonly).
360
+ */
361
+ type Mutable<T> = {
362
+ -readonly [P in keyof T]: T[P];
363
+ };
364
+ /**
365
+ * Deep partial - all properties and nested properties are optional.
366
+ */
367
+ type DeepPartial<T> = {
368
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
369
+ };
370
+ /**
371
+ * Extract the element type from an array type.
372
+ */
373
+ type ArrayElement<T> = T extends readonly (infer U)[] ? U : never;
374
+
375
+ export { type ArrayElement as A, type Breakpoint as B, type CompactType as C, type DroppingPosition as D, type EventCallback as E, type GridDragEvent as G, type Layout as L, type Mutable as M, type OnLayoutChangeCallback as O, type Position as P, type ResponsiveLayouts as R, type Size as S, type LayoutItem as a, type Breakpoints as b, type Compactor as c, type ResizeHandleAxis as d, type GridResizeEvent as e, type PartialPosition as f, type ReactDraggableCallbackData as g, type DragOverEvent as h, type PositionStrategy as i, type GridConfig as j, type DragConfig as k, type ResizeConfig as l, type DropConfig as m, type BreakpointCols as n, type OnBreakpointChangeCallback as o, type DeepPartial as p, defaultGridConfig as q, defaultDragConfig as r, defaultResizeConfig as s, defaultDropConfig as t };