react-grid-layout 2.2.3 → 2.3.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 (40) hide show
  1. package/README.md +5 -0
  2. package/dist/{ResponsiveGridLayout-BjVraYMQ.d.mts → ResponsiveGridLayout-BSYEMZ9d.d.ts} +4 -4
  3. package/dist/{ResponsiveGridLayout-BrhkSyZk.d.ts → ResponsiveGridLayout-RNuyRTPe.d.mts} +4 -4
  4. package/dist/{calculate-DH4EVtn1.d.mts → calculate-BXoe3Mfz.d.mts} +1 -1
  5. package/dist/{calculate-rP3DHexe.d.ts → calculate-Tc1WkIxl.d.ts} +1 -1
  6. package/dist/{chunk-BPZQUJ7Y.js → chunk-CUP5Y2ZG.js} +500 -155
  7. package/dist/{chunk-55DQUWLA.js → chunk-QAIA5KAO.js} +33 -22
  8. package/dist/{chunk-7MZZ6T4J.js → chunk-SL4EZ2NU.js} +67 -38
  9. package/dist/{chunk-PZLKKWSX.mjs → chunk-TW4BCTKD.mjs} +37 -8
  10. package/dist/{chunk-KDANGDDL.mjs → chunk-VBU6B7II.mjs} +13 -2
  11. package/dist/{chunk-A5WIFECI.js → chunk-VJJIA3HC.js} +7 -3
  12. package/dist/{chunk-WGL5FSZH.mjs → chunk-Z6CWRR74.mjs} +431 -86
  13. package/dist/{chunk-76RTO6EO.mjs → chunk-ZYNFVPDS.mjs} +7 -3
  14. package/dist/core.d.mts +5 -5
  15. package/dist/core.d.ts +5 -5
  16. package/dist/core.js +67 -67
  17. package/dist/core.mjs +2 -2
  18. package/dist/extras.d.mts +2 -2
  19. package/dist/extras.d.ts +2 -2
  20. package/dist/extras.js +8 -8
  21. package/dist/extras.mjs +1 -1
  22. package/dist/index.d.mts +5 -5
  23. package/dist/index.d.ts +5 -5
  24. package/dist/index.js +39 -39
  25. package/dist/index.mjs +4 -4
  26. package/dist/legacy.d.mts +18 -9
  27. package/dist/legacy.d.ts +18 -9
  28. package/dist/legacy.js +35 -25
  29. package/dist/legacy.mjs +18 -9
  30. package/dist/{position-CSgQSjwQ.d.ts → position-VdYnMJql.d.ts} +1 -1
  31. package/dist/{position-BV-g3Ezg.d.mts → position-iPly-ecb.d.mts} +1 -1
  32. package/dist/react.d.mts +24 -6
  33. package/dist/react.d.ts +24 -6
  34. package/dist/react.js +25 -25
  35. package/dist/react.mjs +4 -4
  36. package/dist/{responsive-BrTV_0tK.d.mts → responsive-BVtXrrTF.d.mts} +1 -1
  37. package/dist/{responsive-C_YtBQYq.d.ts → responsive-C6s9JAJU.d.ts} +1 -1
  38. package/dist/{types-jd8MiKM1.d.mts → types-DlzNckle.d.mts} +22 -0
  39. package/dist/{types-jd8MiKM1.d.ts → types-DlzNckle.d.ts} +22 -0
  40. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -2,151 +2,151 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunk7MZZ6T4J_js = require('./chunk-7MZZ6T4J.js');
5
+ var chunkSL4EZ2NU_js = require('./chunk-SL4EZ2NU.js');
6
6
  require('./chunk-ZJHF4QM5.js');
7
- var chunkBPZQUJ7Y_js = require('./chunk-BPZQUJ7Y.js');
8
- var chunk55DQUWLA_js = require('./chunk-55DQUWLA.js');
9
- var chunkA5WIFECI_js = require('./chunk-A5WIFECI.js');
7
+ var chunkCUP5Y2ZG_js = require('./chunk-CUP5Y2ZG.js');
8
+ var chunkQAIA5KAO_js = require('./chunk-QAIA5KAO.js');
9
+ var chunkVJJIA3HC_js = require('./chunk-VJJIA3HC.js');
10
10
 
11
11
 
12
12
 
13
13
  Object.defineProperty(exports, "DEFAULT_BREAKPOINTS", {
14
14
  enumerable: true,
15
- get: function () { return chunk7MZZ6T4J_js.DEFAULT_BREAKPOINTS; }
15
+ get: function () { return chunkSL4EZ2NU_js.DEFAULT_BREAKPOINTS; }
16
16
  });
17
17
  Object.defineProperty(exports, "DEFAULT_COLS", {
18
18
  enumerable: true,
19
- get: function () { return chunk7MZZ6T4J_js.DEFAULT_COLS; }
19
+ get: function () { return chunkSL4EZ2NU_js.DEFAULT_COLS; }
20
20
  });
21
21
  Object.defineProperty(exports, "useContainerWidth", {
22
22
  enumerable: true,
23
- get: function () { return chunk7MZZ6T4J_js.useContainerWidth; }
23
+ get: function () { return chunkSL4EZ2NU_js.useContainerWidth; }
24
24
  });
25
25
  Object.defineProperty(exports, "useGridLayout", {
26
26
  enumerable: true,
27
- get: function () { return chunk7MZZ6T4J_js.useGridLayout; }
27
+ get: function () { return chunkSL4EZ2NU_js.useGridLayout; }
28
28
  });
29
29
  Object.defineProperty(exports, "useResponsiveLayout", {
30
30
  enumerable: true,
31
- get: function () { return chunk7MZZ6T4J_js.useResponsiveLayout; }
31
+ get: function () { return chunkSL4EZ2NU_js.useResponsiveLayout; }
32
32
  });
33
33
  Object.defineProperty(exports, "GridItem", {
34
34
  enumerable: true,
35
- get: function () { return chunkBPZQUJ7Y_js.GridItem; }
35
+ get: function () { return chunkCUP5Y2ZG_js.GridItem; }
36
36
  });
37
37
  Object.defineProperty(exports, "GridLayout", {
38
38
  enumerable: true,
39
- get: function () { return chunkBPZQUJ7Y_js.GridLayout; }
39
+ get: function () { return chunkCUP5Y2ZG_js.GridLayout; }
40
40
  });
41
41
  Object.defineProperty(exports, "ReactGridLayout", {
42
42
  enumerable: true,
43
- get: function () { return chunkBPZQUJ7Y_js.GridLayout; }
43
+ get: function () { return chunkCUP5Y2ZG_js.GridLayout; }
44
44
  });
45
45
  Object.defineProperty(exports, "Responsive", {
46
46
  enumerable: true,
47
- get: function () { return chunkBPZQUJ7Y_js.ResponsiveGridLayout; }
47
+ get: function () { return chunkCUP5Y2ZG_js.ResponsiveGridLayoutWithRef; }
48
48
  });
49
49
  Object.defineProperty(exports, "ResponsiveGridLayout", {
50
50
  enumerable: true,
51
- get: function () { return chunkBPZQUJ7Y_js.ResponsiveGridLayout; }
51
+ get: function () { return chunkCUP5Y2ZG_js.ResponsiveGridLayoutWithRef; }
52
52
  });
53
53
  Object.defineProperty(exports, "default", {
54
54
  enumerable: true,
55
- get: function () { return chunkBPZQUJ7Y_js.GridLayout; }
55
+ get: function () { return chunkCUP5Y2ZG_js.GridLayout; }
56
56
  });
57
57
  Object.defineProperty(exports, "findOrGenerateResponsiveLayout", {
58
58
  enumerable: true,
59
- get: function () { return chunk55DQUWLA_js.findOrGenerateResponsiveLayout; }
59
+ get: function () { return chunkQAIA5KAO_js.findOrGenerateResponsiveLayout; }
60
60
  });
61
61
  Object.defineProperty(exports, "getBreakpointFromWidth", {
62
62
  enumerable: true,
63
- get: function () { return chunk55DQUWLA_js.getBreakpointFromWidth; }
63
+ get: function () { return chunkQAIA5KAO_js.getBreakpointFromWidth; }
64
64
  });
65
65
  Object.defineProperty(exports, "getColsFromBreakpoint", {
66
66
  enumerable: true,
67
- get: function () { return chunk55DQUWLA_js.getColsFromBreakpoint; }
67
+ get: function () { return chunkQAIA5KAO_js.getColsFromBreakpoint; }
68
68
  });
69
69
  Object.defineProperty(exports, "getCompactor", {
70
70
  enumerable: true,
71
- get: function () { return chunk55DQUWLA_js.getCompactor; }
71
+ get: function () { return chunkQAIA5KAO_js.getCompactor; }
72
72
  });
73
73
  Object.defineProperty(exports, "horizontalCompactor", {
74
74
  enumerable: true,
75
- get: function () { return chunk55DQUWLA_js.horizontalCompactor; }
75
+ get: function () { return chunkQAIA5KAO_js.horizontalCompactor; }
76
76
  });
77
77
  Object.defineProperty(exports, "noCompactor", {
78
78
  enumerable: true,
79
- get: function () { return chunk55DQUWLA_js.noCompactor; }
79
+ get: function () { return chunkQAIA5KAO_js.noCompactor; }
80
80
  });
81
81
  Object.defineProperty(exports, "setTopLeft", {
82
82
  enumerable: true,
83
- get: function () { return chunk55DQUWLA_js.setTopLeft; }
83
+ get: function () { return chunkQAIA5KAO_js.setTopLeft; }
84
84
  });
85
85
  Object.defineProperty(exports, "setTransform", {
86
86
  enumerable: true,
87
- get: function () { return chunk55DQUWLA_js.setTransform; }
87
+ get: function () { return chunkQAIA5KAO_js.setTransform; }
88
88
  });
89
89
  Object.defineProperty(exports, "verticalCompactor", {
90
90
  enumerable: true,
91
- get: function () { return chunk55DQUWLA_js.verticalCompactor; }
91
+ get: function () { return chunkQAIA5KAO_js.verticalCompactor; }
92
92
  });
93
93
  Object.defineProperty(exports, "bottom", {
94
94
  enumerable: true,
95
- get: function () { return chunkA5WIFECI_js.bottom; }
95
+ get: function () { return chunkVJJIA3HC_js.bottom; }
96
96
  });
97
97
  Object.defineProperty(exports, "calcGridItemPosition", {
98
98
  enumerable: true,
99
- get: function () { return chunkA5WIFECI_js.calcGridItemPosition; }
99
+ get: function () { return chunkVJJIA3HC_js.calcGridItemPosition; }
100
100
  });
101
101
  Object.defineProperty(exports, "calcWH", {
102
102
  enumerable: true,
103
- get: function () { return chunkA5WIFECI_js.calcWH; }
103
+ get: function () { return chunkVJJIA3HC_js.calcWH; }
104
104
  });
105
105
  Object.defineProperty(exports, "calcXY", {
106
106
  enumerable: true,
107
- get: function () { return chunkA5WIFECI_js.calcXY; }
107
+ get: function () { return chunkVJJIA3HC_js.calcXY; }
108
108
  });
109
109
  Object.defineProperty(exports, "cloneLayout", {
110
110
  enumerable: true,
111
- get: function () { return chunkA5WIFECI_js.cloneLayout; }
111
+ get: function () { return chunkVJJIA3HC_js.cloneLayout; }
112
112
  });
113
113
  Object.defineProperty(exports, "cloneLayoutItem", {
114
114
  enumerable: true,
115
- get: function () { return chunkA5WIFECI_js.cloneLayoutItem; }
115
+ get: function () { return chunkVJJIA3HC_js.cloneLayoutItem; }
116
116
  });
117
117
  Object.defineProperty(exports, "collides", {
118
118
  enumerable: true,
119
- get: function () { return chunkA5WIFECI_js.collides; }
119
+ get: function () { return chunkVJJIA3HC_js.collides; }
120
120
  });
121
121
  Object.defineProperty(exports, "getAllCollisions", {
122
122
  enumerable: true,
123
- get: function () { return chunkA5WIFECI_js.getAllCollisions; }
123
+ get: function () { return chunkVJJIA3HC_js.getAllCollisions; }
124
124
  });
125
125
  Object.defineProperty(exports, "getFirstCollision", {
126
126
  enumerable: true,
127
- get: function () { return chunkA5WIFECI_js.getFirstCollision; }
127
+ get: function () { return chunkVJJIA3HC_js.getFirstCollision; }
128
128
  });
129
129
  Object.defineProperty(exports, "getLayoutItem", {
130
130
  enumerable: true,
131
- get: function () { return chunkA5WIFECI_js.getLayoutItem; }
131
+ get: function () { return chunkVJJIA3HC_js.getLayoutItem; }
132
132
  });
133
133
  Object.defineProperty(exports, "moveElement", {
134
134
  enumerable: true,
135
- get: function () { return chunkA5WIFECI_js.moveElement; }
135
+ get: function () { return chunkVJJIA3HC_js.moveElement; }
136
136
  });
137
137
  Object.defineProperty(exports, "sortLayoutItems", {
138
138
  enumerable: true,
139
- get: function () { return chunkA5WIFECI_js.sortLayoutItems; }
139
+ get: function () { return chunkVJJIA3HC_js.sortLayoutItems; }
140
140
  });
141
141
  Object.defineProperty(exports, "sortLayoutItemsByColRow", {
142
142
  enumerable: true,
143
- get: function () { return chunkA5WIFECI_js.sortLayoutItemsByColRow; }
143
+ get: function () { return chunkVJJIA3HC_js.sortLayoutItemsByColRow; }
144
144
  });
145
145
  Object.defineProperty(exports, "sortLayoutItemsByRowCol", {
146
146
  enumerable: true,
147
- get: function () { return chunkA5WIFECI_js.sortLayoutItemsByRowCol; }
147
+ get: function () { return chunkVJJIA3HC_js.sortLayoutItemsByRowCol; }
148
148
  });
149
149
  Object.defineProperty(exports, "validateLayout", {
150
150
  enumerable: true,
151
- get: function () { return chunkA5WIFECI_js.validateLayout; }
151
+ get: function () { return chunkVJJIA3HC_js.validateLayout; }
152
152
  });
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- export { DEFAULT_BREAKPOINTS, DEFAULT_COLS, useContainerWidth, useGridLayout, useResponsiveLayout } from './chunk-PZLKKWSX.mjs';
1
+ export { DEFAULT_BREAKPOINTS, DEFAULT_COLS, useContainerWidth, useGridLayout, useResponsiveLayout } from './chunk-TW4BCTKD.mjs';
2
2
  import './chunk-O3KX3VYW.mjs';
3
- export { GridItem, GridLayout, GridLayout as ReactGridLayout, ResponsiveGridLayout as Responsive, ResponsiveGridLayout, GridLayout as default } from './chunk-WGL5FSZH.mjs';
4
- export { findOrGenerateResponsiveLayout, getBreakpointFromWidth, getColsFromBreakpoint, getCompactor, horizontalCompactor, noCompactor, setTopLeft, setTransform, verticalCompactor } from './chunk-KDANGDDL.mjs';
5
- export { bottom, calcGridItemPosition, calcWH, calcXY, cloneLayout, cloneLayoutItem, collides, getAllCollisions, getFirstCollision, getLayoutItem, moveElement, sortLayoutItems, sortLayoutItemsByColRow, sortLayoutItemsByRowCol, validateLayout } from './chunk-76RTO6EO.mjs';
3
+ export { GridItem, GridLayout, GridLayout as ReactGridLayout, ResponsiveGridLayoutWithRef as Responsive, ResponsiveGridLayoutWithRef as ResponsiveGridLayout, GridLayout as default } from './chunk-Z6CWRR74.mjs';
4
+ export { findOrGenerateResponsiveLayout, getBreakpointFromWidth, getColsFromBreakpoint, getCompactor, horizontalCompactor, noCompactor, setTopLeft, setTransform, verticalCompactor } from './chunk-VBU6B7II.mjs';
5
+ export { bottom, calcGridItemPosition, calcWH, calcXY, cloneLayout, cloneLayoutItem, collides, getAllCollisions, getFirstCollision, getLayoutItem, moveElement, sortLayoutItems, sortLayoutItemsByColRow, sortLayoutItemsByRowCol, validateLayout } from './chunk-ZYNFVPDS.mjs';
package/dist/legacy.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentType } from 'react';
3
- import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-BjVraYMQ.mjs';
4
- import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-jd8MiKM1.mjs';
3
+ import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-RNuyRTPe.mjs';
4
+ import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-DlzNckle.mjs';
5
5
 
6
6
  /**
7
7
  * Legacy props interface for backwards compatibility with v1 API.
@@ -26,6 +26,8 @@ interface LegacyReactGridLayoutProps {
26
26
  isBounded?: boolean;
27
27
  draggableHandle?: string;
28
28
  draggableCancel?: string;
29
+ /** Allow native touch scroll while dragging (#1793) */
30
+ allowMobileScroll?: boolean;
29
31
  isResizable?: boolean;
30
32
  resizeHandles?: ResizeHandleAxis[];
31
33
  resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
@@ -59,6 +61,14 @@ declare namespace ReactGridLayout {
59
61
  var displayName: string;
60
62
  }
61
63
 
64
+ /**
65
+ * Legacy ResponsiveReactGridLayout wrapper
66
+ *
67
+ * This component wraps the new TypeScript ResponsiveGridLayout to provide
68
+ * backwards compatibility with the v1 API by converting flat props
69
+ * to the new composable interface format.
70
+ */
71
+
62
72
  /**
63
73
  * Legacy props interface for backwards compatibility with v1 API.
64
74
  * These flat props are converted to composable interfaces internally.
@@ -87,6 +97,8 @@ interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
87
97
  isBounded?: boolean;
88
98
  draggableHandle?: string;
89
99
  draggableCancel?: string;
100
+ /** Allow native touch scroll while dragging (#1793) */
101
+ allowMobileScroll?: boolean;
90
102
  isResizable?: boolean;
91
103
  resizeHandles?: ResizeHandleAxis[];
92
104
  resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
@@ -110,14 +122,11 @@ interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
110
122
  } | false | void;
111
123
  }
112
124
  /**
113
- * ResponsiveReactGridLayout - Legacy wrapper component
114
- *
115
- * Converts v1 flat props to v2 composable interfaces for backwards compatibility.
125
+ * v1's Responsive was a class component and accepted a React `ref`. v2 is a
126
+ * function component, so we forward the ref into `innerRef` to preserve that
127
+ * contract (#2244).
116
128
  */
117
- declare function ResponsiveReactGridLayout<B extends Breakpoint = string>(props: LegacyResponsiveReactGridLayoutProps<B>): react_jsx_runtime.JSX.Element;
118
- declare namespace ResponsiveReactGridLayout {
119
- var displayName: string;
120
- }
129
+ declare const ResponsiveReactGridLayout: React__default.ForwardRefExoticComponent<LegacyResponsiveReactGridLayoutProps<string> & React__default.RefAttributes<HTMLDivElement>>;
121
130
 
122
131
  /**
123
132
  * WidthProvider HOC
package/dist/legacy.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import React__default, { ComponentType } from 'react';
3
- import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-BrhkSyZk.js';
4
- import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-jd8MiKM1.js';
3
+ import { a as GridLayoutProps, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-BSYEMZ9d.js';
4
+ import { L as Layout, d as LayoutItem, C as CompactType, R as ResizeHandleAxis, B as Breakpoint, a as Breakpoints, e as ResponsiveLayouts } from './types-DlzNckle.js';
5
5
 
6
6
  /**
7
7
  * Legacy props interface for backwards compatibility with v1 API.
@@ -26,6 +26,8 @@ interface LegacyReactGridLayoutProps {
26
26
  isBounded?: boolean;
27
27
  draggableHandle?: string;
28
28
  draggableCancel?: string;
29
+ /** Allow native touch scroll while dragging (#1793) */
30
+ allowMobileScroll?: boolean;
29
31
  isResizable?: boolean;
30
32
  resizeHandles?: ResizeHandleAxis[];
31
33
  resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
@@ -59,6 +61,14 @@ declare namespace ReactGridLayout {
59
61
  var displayName: string;
60
62
  }
61
63
 
64
+ /**
65
+ * Legacy ResponsiveReactGridLayout wrapper
66
+ *
67
+ * This component wraps the new TypeScript ResponsiveGridLayout to provide
68
+ * backwards compatibility with the v1 API by converting flat props
69
+ * to the new composable interface format.
70
+ */
71
+
62
72
  /**
63
73
  * Legacy props interface for backwards compatibility with v1 API.
64
74
  * These flat props are converted to composable interfaces internally.
@@ -87,6 +97,8 @@ interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
87
97
  isBounded?: boolean;
88
98
  draggableHandle?: string;
89
99
  draggableCancel?: string;
100
+ /** Allow native touch scroll while dragging (#1793) */
101
+ allowMobileScroll?: boolean;
90
102
  isResizable?: boolean;
91
103
  resizeHandles?: ResizeHandleAxis[];
92
104
  resizeHandle?: React__default.ReactElement | ((axis: ResizeHandleAxis, ref: React__default.Ref<HTMLElement>) => React__default.ReactElement);
@@ -110,14 +122,11 @@ interface LegacyResponsiveReactGridLayoutProps<B extends Breakpoint = string> {
110
122
  } | false | void;
111
123
  }
112
124
  /**
113
- * ResponsiveReactGridLayout - Legacy wrapper component
114
- *
115
- * Converts v1 flat props to v2 composable interfaces for backwards compatibility.
125
+ * v1's Responsive was a class component and accepted a React `ref`. v2 is a
126
+ * function component, so we forward the ref into `innerRef` to preserve that
127
+ * contract (#2244).
116
128
  */
117
- declare function ResponsiveReactGridLayout<B extends Breakpoint = string>(props: LegacyResponsiveReactGridLayoutProps<B>): react_jsx_runtime.JSX.Element;
118
- declare namespace ResponsiveReactGridLayout {
119
- var displayName: string;
120
- }
129
+ declare const ResponsiveReactGridLayout: React__default.ForwardRefExoticComponent<LegacyResponsiveReactGridLayoutProps<string> & React__default.RefAttributes<HTMLDivElement>>;
121
130
 
122
131
  /**
123
132
  * WidthProvider HOC
package/dist/legacy.js CHANGED
@@ -2,15 +2,16 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkBPZQUJ7Y_js = require('./chunk-BPZQUJ7Y.js');
6
- var chunk55DQUWLA_js = require('./chunk-55DQUWLA.js');
7
- require('./chunk-A5WIFECI.js');
8
- var react = require('react');
5
+ var chunkCUP5Y2ZG_js = require('./chunk-CUP5Y2ZG.js');
6
+ var chunkQAIA5KAO_js = require('./chunk-QAIA5KAO.js');
7
+ require('./chunk-VJJIA3HC.js');
8
+ var React2 = require('react');
9
9
  var jsxRuntime = require('react/jsx-runtime');
10
10
  var clsx = require('clsx');
11
11
 
12
12
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
13
 
14
+ var React2__default = /*#__PURE__*/_interopDefault(React2);
14
15
  var clsx__default = /*#__PURE__*/_interopDefault(clsx);
15
16
 
16
17
  function ReactGridLayout(props) {
@@ -37,6 +38,7 @@ function ReactGridLayout(props) {
37
38
  isBounded = false,
38
39
  draggableHandle,
39
40
  draggableCancel,
41
+ allowMobileScroll,
40
42
  // Resize behavior
41
43
  isResizable = true,
42
44
  resizeHandles = ["se"],
@@ -83,6 +85,7 @@ function ReactGridLayout(props) {
83
85
  bounded: isBounded,
84
86
  handle: draggableHandle,
85
87
  cancel: draggableCancel,
88
+ allowMobileScroll,
86
89
  // Set threshold to 0 for backwards compatibility with v1 API
87
90
  // v2 API defaults to 3px threshold (fixes #1341, #1401)
88
91
  threshold: 0
@@ -97,16 +100,16 @@ function ReactGridLayout(props) {
97
100
  };
98
101
  let positionStrategy;
99
102
  if (!useCSSTransforms) {
100
- positionStrategy = chunk55DQUWLA_js.absoluteStrategy;
103
+ positionStrategy = chunkQAIA5KAO_js.absoluteStrategy;
101
104
  } else if (transformScale !== 1) {
102
- positionStrategy = chunk55DQUWLA_js.createScaledStrategy(transformScale);
105
+ positionStrategy = chunkQAIA5KAO_js.createScaledStrategy(transformScale);
103
106
  } else {
104
- positionStrategy = chunk55DQUWLA_js.transformStrategy;
107
+ positionStrategy = chunkQAIA5KAO_js.transformStrategy;
105
108
  }
106
- const compactor = chunk55DQUWLA_js.getCompactor(compactType, allowOverlap, preventCollision);
107
- const constraints = isBounded ? [...chunk55DQUWLA_js.defaultConstraints, chunk55DQUWLA_js.containerBounds] : chunk55DQUWLA_js.defaultConstraints;
109
+ const compactor = chunkQAIA5KAO_js.getCompactor(compactType, allowOverlap, preventCollision);
110
+ const constraints = isBounded ? [...chunkQAIA5KAO_js.defaultConstraints, chunkQAIA5KAO_js.containerBounds] : chunkQAIA5KAO_js.defaultConstraints;
108
111
  return /* @__PURE__ */ jsxRuntime.jsx(
109
- chunkBPZQUJ7Y_js.GridLayout,
112
+ chunkCUP5Y2ZG_js.GridLayout,
110
113
  {
111
114
  width,
112
115
  gridConfig,
@@ -137,7 +140,7 @@ function ReactGridLayout(props) {
137
140
  }
138
141
  ReactGridLayout.displayName = "ReactGridLayout";
139
142
  var ReactGridLayout_default = ReactGridLayout;
140
- function ResponsiveReactGridLayout(props) {
143
+ function ResponsiveReactGridLayoutInner(props) {
141
144
  const {
142
145
  // Required
143
146
  children,
@@ -167,6 +170,7 @@ function ResponsiveReactGridLayout(props) {
167
170
  isBounded = false,
168
171
  draggableHandle,
169
172
  draggableCancel,
173
+ allowMobileScroll,
170
174
  // Resize behavior
171
175
  isResizable = true,
172
176
  resizeHandles = ["se"],
@@ -204,7 +208,8 @@ function ResponsiveReactGridLayout(props) {
204
208
  enabled: isDraggable,
205
209
  bounded: isBounded,
206
210
  handle: draggableHandle,
207
- cancel: draggableCancel
211
+ cancel: draggableCancel,
212
+ allowMobileScroll
208
213
  };
209
214
  const resizeConfig = {
210
215
  enabled: isResizable,
@@ -216,15 +221,15 @@ function ResponsiveReactGridLayout(props) {
216
221
  };
217
222
  let positionStrategy;
218
223
  if (!useCSSTransforms) {
219
- positionStrategy = chunk55DQUWLA_js.absoluteStrategy;
224
+ positionStrategy = chunkQAIA5KAO_js.absoluteStrategy;
220
225
  } else if (transformScale !== 1) {
221
- positionStrategy = chunk55DQUWLA_js.createScaledStrategy(transformScale);
226
+ positionStrategy = chunkQAIA5KAO_js.createScaledStrategy(transformScale);
222
227
  } else {
223
- positionStrategy = chunk55DQUWLA_js.transformStrategy;
228
+ positionStrategy = chunkQAIA5KAO_js.transformStrategy;
224
229
  }
225
- const compactor = chunk55DQUWLA_js.getCompactor(compactType, allowOverlap, preventCollision);
230
+ const compactor = chunkQAIA5KAO_js.getCompactor(compactType, allowOverlap, preventCollision);
226
231
  return /* @__PURE__ */ jsxRuntime.jsx(
227
- chunkBPZQUJ7Y_js.ResponsiveGridLayout,
232
+ chunkCUP5Y2ZG_js.ResponsiveGridLayoutWithRef,
228
233
  {
229
234
  width,
230
235
  breakpoint,
@@ -260,31 +265,36 @@ function ResponsiveReactGridLayout(props) {
260
265
  }
261
266
  );
262
267
  }
268
+ var ResponsiveReactGridLayout = React2__default.default.forwardRef(function ResponsiveReactGridLayoutForward(props, ref) {
269
+ const { innerRef, ...rest } = props;
270
+ const effectiveInnerRef = innerRef ?? ref;
271
+ return /* @__PURE__ */ jsxRuntime.jsx(ResponsiveReactGridLayoutInner, { ...rest, innerRef: effectiveInnerRef });
272
+ });
263
273
  ResponsiveReactGridLayout.displayName = "ResponsiveReactGridLayout";
264
274
  var ResponsiveReactGridLayout_default = ResponsiveReactGridLayout;
265
275
  var layoutClassName = "react-grid-layout";
266
276
  function WidthProvider(ComposedComponent) {
267
277
  function WidthProviderWrapper(props) {
268
278
  const { measureBeforeMount = false, className, style, ...rest } = props;
269
- const [width, setWidth] = react.useState(1280);
270
- const [mounted, setMounted] = react.useState(false);
271
- const elementRef = react.useRef(null);
272
- const resizeObserverRef = react.useRef(null);
273
- react.useEffect(() => {
279
+ const [width, setWidth] = React2.useState(1280);
280
+ const [mounted, setMounted] = React2.useState(false);
281
+ const elementRef = React2.useRef(null);
282
+ const resizeObserverRef = React2.useRef(null);
283
+ React2.useEffect(() => {
274
284
  setMounted(true);
275
285
  }, []);
276
- react.useEffect(() => {
286
+ React2.useEffect(() => {
277
287
  const node = elementRef.current;
278
288
  if (!(node instanceof HTMLElement)) return;
279
289
  let rafId = null;
280
290
  const observer = new ResizeObserver((entries) => {
281
291
  if (entries[0]) {
282
- const newWidth = entries[0].contentRect.width;
292
+ const newWidth = Math.round(entries[0].contentRect.width);
283
293
  if (rafId !== null) {
284
294
  cancelAnimationFrame(rafId);
285
295
  }
286
296
  rafId = requestAnimationFrame(() => {
287
- setWidth(newWidth);
297
+ setWidth((prev) => prev === newWidth ? prev : newWidth);
288
298
  rafId = null;
289
299
  });
290
300
  }
package/dist/legacy.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { GridLayout, ResponsiveGridLayout } from './chunk-WGL5FSZH.mjs';
2
- import { createScaledStrategy, getCompactor, defaultConstraints, containerBounds, absoluteStrategy, transformStrategy } from './chunk-KDANGDDL.mjs';
3
- import './chunk-76RTO6EO.mjs';
4
- import { useState, useRef, useEffect } from 'react';
1
+ import { ResponsiveGridLayoutWithRef, GridLayout } from './chunk-Z6CWRR74.mjs';
2
+ import { createScaledStrategy, getCompactor, defaultConstraints, containerBounds, absoluteStrategy, transformStrategy } from './chunk-VBU6B7II.mjs';
3
+ import './chunk-ZYNFVPDS.mjs';
4
+ import React2, { useState, useRef, useEffect } from 'react';
5
5
  import { jsx } from 'react/jsx-runtime';
6
6
  import clsx from 'clsx';
7
7
 
@@ -29,6 +29,7 @@ function ReactGridLayout(props) {
29
29
  isBounded = false,
30
30
  draggableHandle,
31
31
  draggableCancel,
32
+ allowMobileScroll,
32
33
  // Resize behavior
33
34
  isResizable = true,
34
35
  resizeHandles = ["se"],
@@ -75,6 +76,7 @@ function ReactGridLayout(props) {
75
76
  bounded: isBounded,
76
77
  handle: draggableHandle,
77
78
  cancel: draggableCancel,
79
+ allowMobileScroll,
78
80
  // Set threshold to 0 for backwards compatibility with v1 API
79
81
  // v2 API defaults to 3px threshold (fixes #1341, #1401)
80
82
  threshold: 0
@@ -129,7 +131,7 @@ function ReactGridLayout(props) {
129
131
  }
130
132
  ReactGridLayout.displayName = "ReactGridLayout";
131
133
  var ReactGridLayout_default = ReactGridLayout;
132
- function ResponsiveReactGridLayout(props) {
134
+ function ResponsiveReactGridLayoutInner(props) {
133
135
  const {
134
136
  // Required
135
137
  children,
@@ -159,6 +161,7 @@ function ResponsiveReactGridLayout(props) {
159
161
  isBounded = false,
160
162
  draggableHandle,
161
163
  draggableCancel,
164
+ allowMobileScroll,
162
165
  // Resize behavior
163
166
  isResizable = true,
164
167
  resizeHandles = ["se"],
@@ -196,7 +199,8 @@ function ResponsiveReactGridLayout(props) {
196
199
  enabled: isDraggable,
197
200
  bounded: isBounded,
198
201
  handle: draggableHandle,
199
- cancel: draggableCancel
202
+ cancel: draggableCancel,
203
+ allowMobileScroll
200
204
  };
201
205
  const resizeConfig = {
202
206
  enabled: isResizable,
@@ -216,7 +220,7 @@ function ResponsiveReactGridLayout(props) {
216
220
  }
217
221
  const compactor = getCompactor(compactType, allowOverlap, preventCollision);
218
222
  return /* @__PURE__ */ jsx(
219
- ResponsiveGridLayout,
223
+ ResponsiveGridLayoutWithRef,
220
224
  {
221
225
  width,
222
226
  breakpoint,
@@ -252,6 +256,11 @@ function ResponsiveReactGridLayout(props) {
252
256
  }
253
257
  );
254
258
  }
259
+ var ResponsiveReactGridLayout = React2.forwardRef(function ResponsiveReactGridLayoutForward(props, ref) {
260
+ const { innerRef, ...rest } = props;
261
+ const effectiveInnerRef = innerRef ?? ref;
262
+ return /* @__PURE__ */ jsx(ResponsiveReactGridLayoutInner, { ...rest, innerRef: effectiveInnerRef });
263
+ });
255
264
  ResponsiveReactGridLayout.displayName = "ResponsiveReactGridLayout";
256
265
  var ResponsiveReactGridLayout_default = ResponsiveReactGridLayout;
257
266
  var layoutClassName = "react-grid-layout";
@@ -271,12 +280,12 @@ function WidthProvider(ComposedComponent) {
271
280
  let rafId = null;
272
281
  const observer = new ResizeObserver((entries) => {
273
282
  if (entries[0]) {
274
- const newWidth = entries[0].contentRect.width;
283
+ const newWidth = Math.round(entries[0].contentRect.width);
275
284
  if (rafId !== null) {
276
285
  cancelAnimationFrame(rafId);
277
286
  }
278
287
  rafId = requestAnimationFrame(() => {
279
- setWidth(newWidth);
288
+ setWidth((prev) => prev === newWidth ? prev : newWidth);
280
289
  rafId = null;
281
290
  });
282
291
  }
@@ -1,4 +1,4 @@
1
- import { L as Layout, d as LayoutItem, C as CompactType, M as Mutable, b as Compactor, P as Position, p as PositionStrategy, R as ResizeHandleAxis } from './types-jd8MiKM1.js';
1
+ import { L as Layout, d as LayoutItem, C as CompactType, M as Mutable, b as Compactor, P as Position, p as PositionStrategy, R as ResizeHandleAxis } from './types-DlzNckle.js';
2
2
 
3
3
  /**
4
4
  * Core layout manipulation utilities.
@@ -1,4 +1,4 @@
1
- import { L as Layout, d as LayoutItem, C as CompactType, M as Mutable, b as Compactor, P as Position, p as PositionStrategy, R as ResizeHandleAxis } from './types-jd8MiKM1.mjs';
1
+ import { L as Layout, d as LayoutItem, C as CompactType, M as Mutable, b as Compactor, P as Position, p as PositionStrategy, R as ResizeHandleAxis } from './types-DlzNckle.mjs';
2
2
 
3
3
  /**
4
4
  * Core layout manipulation utilities.
package/dist/react.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import React__default, { ReactElement, CSSProperties, RefObject } from 'react';
2
- import { p as PositionStrategy, D as DroppingPosition, R as ResizeHandleAxis, f as LayoutConstraint, d as LayoutItem, L as Layout, G as GridDragEvent, c as GridResizeEvent, b as Compactor, a as Breakpoints, B as Breakpoint, e as ResponsiveLayouts } from './types-jd8MiKM1.mjs';
3
- export { C as CompactType, E as EventCallback, P as Position } from './types-jd8MiKM1.mjs';
4
- export { G as GridLayout, a as GridLayoutProps, R as ResponsiveGridLayout, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-BjVraYMQ.mjs';
5
- export { b as bottom, c as cloneLayout, a as cloneLayoutItem, g as getCompactor, d as getLayoutItem, h as horizontalCompactor, n as noCompactor, s as setTopLeft, e as setTransform, f as verticalCompactor } from './position-BV-g3Ezg.mjs';
6
- export { c as calcGridItemPosition, a as calcWH, b as calcXY } from './calculate-DH4EVtn1.mjs';
2
+ import { p as PositionStrategy, D as DroppingPosition, R as ResizeHandleAxis, f as LayoutConstraint, d as LayoutItem, L as Layout, G as GridDragEvent, c as GridResizeEvent, b as Compactor, a as Breakpoints, B as Breakpoint, e as ResponsiveLayouts } from './types-DlzNckle.mjs';
3
+ export { C as CompactType, E as EventCallback, P as Position } from './types-DlzNckle.mjs';
4
+ export { G as GridLayout, a as GridLayoutProps, R as ResponsiveGridLayout, b as ResponsiveGridLayoutProps } from './ResponsiveGridLayout-RNuyRTPe.mjs';
5
+ export { b as bottom, c as cloneLayout, a as cloneLayoutItem, g as getCompactor, d as getLayoutItem, h as horizontalCompactor, n as noCompactor, s as setTopLeft, e as setTransform, f as verticalCompactor } from './position-iPly-ecb.mjs';
6
+ export { c as calcGridItemPosition, a as calcWH, b as calcXY } from './calculate-BXoe3Mfz.mjs';
7
7
 
8
8
  /**
9
9
  * GridItem component
@@ -34,6 +34,8 @@ interface GridItemProps {
34
34
  isResizable: boolean;
35
35
  /** Whether the item is bounded within the container */
36
36
  isBounded: boolean;
37
+ /** Allow native touch scroll while dragging (react-draggable allowMobileScroll) */
38
+ allowMobileScroll?: boolean;
37
39
  /** Whether the item is static (can't be moved/resized) */
38
40
  static?: boolean;
39
41
  /** Use CSS transforms instead of top/left */
@@ -102,7 +104,15 @@ interface GridItemProps {
102
104
  *
103
105
  * Wraps a child element with drag and resize functionality.
104
106
  */
105
- declare function GridItem(props: GridItemProps): ReactElement;
107
+ declare function GridItemInner(props: GridItemProps): ReactElement;
108
+ /**
109
+ * Memoized GridItem (#2240). v1 had shouldComponentUpdate gating on
110
+ * position/size; v2's function component re-rendered every item on every
111
+ * drag/resize move. A shallow compare on the geometry and grid-config props
112
+ * skips unchanged items. Children are memoized by the consumer (the
113
+ * documented perf contract), so identity-compare them here.
114
+ */
115
+ declare const GridItem: React__default.MemoExoticComponent<typeof GridItemInner>;
106
116
 
107
117
  /**
108
118
  * useContainerWidth hook
@@ -122,6 +132,14 @@ interface UseContainerWidthOptions {
122
132
  * Defaults to 1280.
123
133
  */
124
134
  initialWidth?: number;
135
+ /**
136
+ * Trailing debounce in milliseconds for width updates from the
137
+ * ResizeObserver (#2254). While the container is resizing, the rendered
138
+ * width freezes; once it holds steady for this long, the latest measured
139
+ * width commits, exactly once per burst of notifications. Absent or 0
140
+ * keeps immediate updates on every notification.
141
+ */
142
+ debounceTimeout?: number;
125
143
  }
126
144
  interface UseContainerWidthResult {
127
145
  /**