react-resizable 3.1.2 → 3.2.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/build/Resizable.js +56 -51
- package/build/Resizable.js.flow +10 -3
- package/build/ResizableBox.js +18 -23
- package/build/propTypes.js +2 -2
- package/build/utils.js +1 -1
- package/package.json +24 -18
- package/.babelrc +0 -16
- package/.browserslistrc +0 -3
- package/.claude/commands/fix-issue.md +0 -110
- package/.claude/settings.local.json +0 -18
- package/.flowconfig +0 -25
- package/.packj.yaml +0 -153
- package/CHANGELOG.md +0 -181
- package/CLAUDE.md +0 -71
- package/dist/bundle.js +0 -488
- package/index.html +0 -11
package/build/Resizable.js
CHANGED
|
@@ -9,7 +9,6 @@ var _propTypes = require("./propTypes");
|
|
|
9
9
|
const _excluded = ["children", "className", "draggableOpts", "width", "height", "handle", "handleSize", "lockAspectRatio", "axis", "minConstraints", "maxConstraints", "onResize", "onResizeStop", "onResizeStart", "resizeHandles", "transformScale"];
|
|
10
10
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
11
11
|
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
|
|
12
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
13
12
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
14
13
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
15
14
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -35,11 +34,10 @@ class Resizable extends React.Component {
|
|
|
35
34
|
|
|
36
35
|
// Clamp width and height within provided constraints
|
|
37
36
|
runConstraints(width, height) {
|
|
38
|
-
const
|
|
39
|
-
minConstraints,
|
|
40
|
-
maxConstraints,
|
|
41
|
-
lockAspectRatio
|
|
42
|
-
} = this.props;
|
|
37
|
+
const _this$props = this.props,
|
|
38
|
+
minConstraints = _this$props.minConstraints,
|
|
39
|
+
maxConstraints = _this$props.maxConstraints,
|
|
40
|
+
lockAspectRatio = _this$props.lockAspectRatio;
|
|
43
41
|
// short circuit
|
|
44
42
|
if (!minConstraints && !maxConstraints && !lockAspectRatio) return [width, height];
|
|
45
43
|
|
|
@@ -59,12 +57,15 @@ class Resizable extends React.Component {
|
|
|
59
57
|
width = height * ratio;
|
|
60
58
|
}
|
|
61
59
|
}
|
|
62
|
-
const
|
|
60
|
+
const oldW = width,
|
|
61
|
+
oldH = height;
|
|
63
62
|
|
|
64
63
|
// Add slack to the values used to calculate bound position. This will ensure that if
|
|
65
64
|
// we start removing slack, the element won't react to it right away until it's been
|
|
66
65
|
// completely removed.
|
|
67
|
-
let
|
|
66
|
+
let _ref = this.slack || [0, 0],
|
|
67
|
+
slackW = _ref[0],
|
|
68
|
+
slackH = _ref[1];
|
|
68
69
|
width += slackW;
|
|
69
70
|
height += slackH;
|
|
70
71
|
if (minConstraints) {
|
|
@@ -88,12 +89,11 @@ class Resizable extends React.Component {
|
|
|
88
89
|
* @return {Function} Handler function.
|
|
89
90
|
*/
|
|
90
91
|
resizeHandler(handlerName, axis) {
|
|
91
|
-
return (e,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
deltaX,
|
|
95
|
-
deltaY
|
|
96
|
-
} = _ref;
|
|
92
|
+
return (e, _ref2) => {
|
|
93
|
+
var _this$lastSize$width, _this$lastSize, _this$lastSize$height, _this$lastSize2;
|
|
94
|
+
let node = _ref2.node,
|
|
95
|
+
deltaX = _ref2.deltaX,
|
|
96
|
+
deltaY = _ref2.deltaY;
|
|
97
97
|
// Reset data in case it was left over somehow (should not be possible)
|
|
98
98
|
if (handlerName === 'onResizeStart') this.resetData();
|
|
99
99
|
|
|
@@ -132,21 +132,29 @@ class Resizable extends React.Component {
|
|
|
132
132
|
if (axisV === 'n') deltaY = -deltaY;
|
|
133
133
|
|
|
134
134
|
// Update w/h by the deltas. Also factor in transformScale.
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
// Use lastSize (if available) instead of props to avoid losing deltas
|
|
136
|
+
// when React can't re-render between consecutive mouse events.
|
|
137
|
+
const baseWidth = (_this$lastSize$width = (_this$lastSize = this.lastSize) == null ? void 0 : _this$lastSize.width) != null ? _this$lastSize$width : this.props.width;
|
|
138
|
+
const baseHeight = (_this$lastSize$height = (_this$lastSize2 = this.lastSize) == null ? void 0 : _this$lastSize2.height) != null ? _this$lastSize$height : this.props.height;
|
|
139
|
+
let width = baseWidth + (canDragX ? deltaX / this.props.transformScale : 0);
|
|
140
|
+
let height = baseHeight + (canDragY ? deltaY / this.props.transformScale : 0);
|
|
137
141
|
|
|
138
142
|
// Run user-provided constraints.
|
|
139
|
-
[width, height] = this.runConstraints(width, height);
|
|
140
|
-
|
|
141
143
|
// For onResizeStop, use the last size from onResize rather than recalculating.
|
|
142
144
|
// This avoids issues where props.width/height are stale due to React's batched updates.
|
|
145
|
+
var _this$runConstraints = this.runConstraints(width, height);
|
|
146
|
+
width = _this$runConstraints[0];
|
|
147
|
+
height = _this$runConstraints[1];
|
|
143
148
|
if (handlerName === 'onResizeStop' && this.lastSize) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
} = this.lastSize);
|
|
149
|
+
var _this$lastSize3 = this.lastSize;
|
|
150
|
+
width = _this$lastSize3.width;
|
|
151
|
+
height = _this$lastSize3.height;
|
|
148
152
|
}
|
|
149
|
-
|
|
153
|
+
|
|
154
|
+
// Compare against the base (lastSize-or-props) so that callbacks correctly
|
|
155
|
+
// suppress when the net delta is zero, even if props are stale relative to
|
|
156
|
+
// the accumulated lastSize.
|
|
157
|
+
const dimensionsChanged = width !== baseWidth || height !== baseHeight;
|
|
150
158
|
|
|
151
159
|
// Store the size for use in onResizeStop. We do this after the onResizeStop check
|
|
152
160
|
// above so we don't overwrite the stored value with a potentially stale calculation.
|
|
@@ -162,7 +170,7 @@ class Resizable extends React.Component {
|
|
|
162
170
|
// Don't call 'onResize' if dimensions haven't changed.
|
|
163
171
|
const shouldSkipCb = handlerName === 'onResize' && !dimensionsChanged;
|
|
164
172
|
if (cb && !shouldSkipCb) {
|
|
165
|
-
e.persist
|
|
173
|
+
e.persist == null || e.persist();
|
|
166
174
|
cb(e, {
|
|
167
175
|
node,
|
|
168
176
|
size: {
|
|
@@ -181,13 +189,11 @@ class Resizable extends React.Component {
|
|
|
181
189
|
// Render a resize handle given an axis & DOM ref. Ref *must* be attached for
|
|
182
190
|
// the underlying draggable library to work properly.
|
|
183
191
|
renderResizeHandle(handleAxis, ref) {
|
|
184
|
-
const
|
|
185
|
-
handle
|
|
186
|
-
} = this.props;
|
|
192
|
+
const handle = this.props.handle;
|
|
187
193
|
// No handle provided, make the default
|
|
188
194
|
if (!handle) {
|
|
189
195
|
return /*#__PURE__*/React.createElement("span", {
|
|
190
|
-
className:
|
|
196
|
+
className: "react-resizable-handle react-resizable-handle-" + handleAxis,
|
|
191
197
|
ref: ref
|
|
192
198
|
});
|
|
193
199
|
}
|
|
@@ -208,39 +214,38 @@ class Resizable extends React.Component {
|
|
|
208
214
|
render() {
|
|
209
215
|
// Pass along only props not meant for the `<Resizable>`.`
|
|
210
216
|
// eslint-disable-next-line no-unused-vars
|
|
211
|
-
const _this$
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
} = _this$props,
|
|
230
|
-
p = _objectWithoutProperties(_this$props, _excluded);
|
|
217
|
+
const _this$props2 = this.props,
|
|
218
|
+
children = _this$props2.children,
|
|
219
|
+
className = _this$props2.className,
|
|
220
|
+
draggableOpts = _this$props2.draggableOpts,
|
|
221
|
+
width = _this$props2.width,
|
|
222
|
+
height = _this$props2.height,
|
|
223
|
+
handle = _this$props2.handle,
|
|
224
|
+
handleSize = _this$props2.handleSize,
|
|
225
|
+
lockAspectRatio = _this$props2.lockAspectRatio,
|
|
226
|
+
axis = _this$props2.axis,
|
|
227
|
+
minConstraints = _this$props2.minConstraints,
|
|
228
|
+
maxConstraints = _this$props2.maxConstraints,
|
|
229
|
+
onResize = _this$props2.onResize,
|
|
230
|
+
onResizeStop = _this$props2.onResizeStop,
|
|
231
|
+
onResizeStart = _this$props2.onResizeStart,
|
|
232
|
+
resizeHandles = _this$props2.resizeHandles,
|
|
233
|
+
transformScale = _this$props2.transformScale,
|
|
234
|
+
p = _objectWithoutPropertiesLoose(_this$props2, _excluded);
|
|
231
235
|
|
|
232
236
|
// What we're doing here is getting the child of this element, and cloning it with this element's props.
|
|
233
237
|
// We are then defining its children as:
|
|
234
238
|
// 1. Its original children (resizable's child's children), and
|
|
235
239
|
// 2. One or more draggable handles.
|
|
236
240
|
return (0, _utils.cloneElement)(children, _objectSpread(_objectSpread({}, p), {}, {
|
|
237
|
-
className:
|
|
241
|
+
className: (className ? className + " " : '') + "react-resizable",
|
|
238
242
|
children: [...React.Children.toArray(children.props.children), ...resizeHandles.map(handleAxis => {
|
|
243
|
+
var _this$handleRefs$hand;
|
|
239
244
|
// Create a ref to the handle so that `<DraggableCore>` doesn't have to use ReactDOM.findDOMNode().
|
|
240
|
-
const ref = this.handleRefs[handleAxis]
|
|
245
|
+
const ref = (_this$handleRefs$hand = this.handleRefs[handleAxis]) != null ? _this$handleRefs$hand : this.handleRefs[handleAxis] = /*#__PURE__*/React.createRef();
|
|
241
246
|
return /*#__PURE__*/React.createElement(_reactDraggable.DraggableCore, _extends({}, draggableOpts, {
|
|
242
247
|
nodeRef: ref,
|
|
243
|
-
key:
|
|
248
|
+
key: "resizableHandle-" + handleAxis,
|
|
244
249
|
onStop: this.resizeHandler('onResizeStop', handleAxis),
|
|
245
250
|
onStart: this.resizeHandler('onResizeStart', handleAxis),
|
|
246
251
|
onDrag: this.resizeHandler('onResize', handleAxis)
|
package/build/Resizable.js.flow
CHANGED
|
@@ -127,8 +127,12 @@ export default class Resizable extends React.Component<Props, void> {
|
|
|
127
127
|
if (axisV === 'n') deltaY = -deltaY;
|
|
128
128
|
|
|
129
129
|
// Update w/h by the deltas. Also factor in transformScale.
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
// Use lastSize (if available) instead of props to avoid losing deltas
|
|
131
|
+
// when React can't re-render between consecutive mouse events.
|
|
132
|
+
const baseWidth = this.lastSize?.width ?? this.props.width;
|
|
133
|
+
const baseHeight = this.lastSize?.height ?? this.props.height;
|
|
134
|
+
let width = baseWidth + (canDragX ? deltaX / this.props.transformScale : 0);
|
|
135
|
+
let height = baseHeight + (canDragY ? deltaY / this.props.transformScale : 0);
|
|
132
136
|
|
|
133
137
|
// Run user-provided constraints.
|
|
134
138
|
[width, height] = this.runConstraints(width, height);
|
|
@@ -139,7 +143,10 @@ export default class Resizable extends React.Component<Props, void> {
|
|
|
139
143
|
({width, height} = this.lastSize);
|
|
140
144
|
}
|
|
141
145
|
|
|
142
|
-
|
|
146
|
+
// Compare against the base (lastSize-or-props) so that callbacks correctly
|
|
147
|
+
// suppress when the net delta is zero, even if props are stale relative to
|
|
148
|
+
// the accumulated lastSize.
|
|
149
|
+
const dimensionsChanged = width !== baseWidth || height !== baseHeight;
|
|
143
150
|
|
|
144
151
|
// Store the size for use in onResizeStop. We do this after the onResizeStop check
|
|
145
152
|
// above so we don't overwrite the stored value with a potentially stale calculation.
|
package/build/ResizableBox.js
CHANGED
|
@@ -15,7 +15,6 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
15
15
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
16
16
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
|
17
17
|
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
18
|
-
function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
|
|
19
18
|
function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
|
|
20
19
|
// ElementConfig gives us an object type where all items present in `defaultProps` are made optional.
|
|
21
20
|
// <ResizableBox> does not have defaultProps, so we can use this type to tell Flow that we don't
|
|
@@ -32,11 +31,9 @@ class ResizableBox extends React.Component {
|
|
|
32
31
|
propsHeight: this.props.height
|
|
33
32
|
};
|
|
34
33
|
this.onResize = (e, data) => {
|
|
35
|
-
const
|
|
36
|
-
size
|
|
37
|
-
} = data;
|
|
34
|
+
const size = data.size;
|
|
38
35
|
if (this.props.onResize) {
|
|
39
|
-
e.persist
|
|
36
|
+
e.persist == null || e.persist();
|
|
40
37
|
this.setState(size, () => this.props.onResize && this.props.onResize(e, data));
|
|
41
38
|
} else {
|
|
42
39
|
this.setState(size);
|
|
@@ -60,24 +57,22 @@ class ResizableBox extends React.Component {
|
|
|
60
57
|
// If you use Resizable directly, you are responsible for updating the child component
|
|
61
58
|
// with a new width and height.
|
|
62
59
|
const _this$props = this.props,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
} = _this$props,
|
|
80
|
-
props = _objectWithoutProperties(_this$props, _excluded);
|
|
60
|
+
handle = _this$props.handle,
|
|
61
|
+
handleSize = _this$props.handleSize,
|
|
62
|
+
onResize = _this$props.onResize,
|
|
63
|
+
onResizeStart = _this$props.onResizeStart,
|
|
64
|
+
onResizeStop = _this$props.onResizeStop,
|
|
65
|
+
draggableOpts = _this$props.draggableOpts,
|
|
66
|
+
minConstraints = _this$props.minConstraints,
|
|
67
|
+
maxConstraints = _this$props.maxConstraints,
|
|
68
|
+
lockAspectRatio = _this$props.lockAspectRatio,
|
|
69
|
+
axis = _this$props.axis,
|
|
70
|
+
width = _this$props.width,
|
|
71
|
+
height = _this$props.height,
|
|
72
|
+
resizeHandles = _this$props.resizeHandles,
|
|
73
|
+
style = _this$props.style,
|
|
74
|
+
transformScale = _this$props.transformScale,
|
|
75
|
+
props = _objectWithoutPropertiesLoose(_this$props, _excluded);
|
|
81
76
|
return /*#__PURE__*/React.createElement(_Resizable.default, {
|
|
82
77
|
axis: axis,
|
|
83
78
|
draggableOpts: draggableOpts,
|
package/build/propTypes.js
CHANGED
|
@@ -48,7 +48,7 @@ const resizableProps = exports.resizableProps = {
|
|
|
48
48
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
49
|
args[_key] = arguments[_key];
|
|
50
50
|
}
|
|
51
|
-
const
|
|
51
|
+
const props = args[0];
|
|
52
52
|
// Required if resizing height or both
|
|
53
53
|
if (props.axis === 'both' || props.axis === 'y') {
|
|
54
54
|
return _propTypes.default.number.isRequired(...args);
|
|
@@ -107,7 +107,7 @@ const resizableProps = exports.resizableProps = {
|
|
|
107
107
|
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
108
108
|
args[_key2] = arguments[_key2];
|
|
109
109
|
}
|
|
110
|
-
const
|
|
110
|
+
const props = args[0];
|
|
111
111
|
// Required if resizing width or both
|
|
112
112
|
if (props.axis === 'both' || props.axis === 'x') {
|
|
113
113
|
return _propTypes.default.number.isRequired(...args);
|
package/build/utils.js
CHANGED
|
@@ -15,7 +15,7 @@ function cloneElement(element, props) {
|
|
|
15
15
|
props.style = _objectSpread(_objectSpread({}, element.props.style), props.style);
|
|
16
16
|
}
|
|
17
17
|
if (props.className && element.props.className) {
|
|
18
|
-
props.className =
|
|
18
|
+
props.className = element.props.className + " " + props.className;
|
|
19
19
|
}
|
|
20
20
|
return /*#__PURE__*/_react.default.cloneElement(element, props);
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-resizable",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A component that is resizable with handles.",
|
|
5
5
|
"main": "index.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"build/",
|
|
8
|
+
"css/",
|
|
9
|
+
"index.js"
|
|
10
|
+
],
|
|
6
11
|
"scripts": {
|
|
7
12
|
"lint": "eslint lib/ __tests__/ setupTests/; flow",
|
|
8
13
|
"test": "jest --coverage",
|
|
@@ -32,35 +37,36 @@
|
|
|
32
37
|
},
|
|
33
38
|
"homepage": "https://github.com/react-grid-layout/react-resizable",
|
|
34
39
|
"devDependencies": {
|
|
35
|
-
"@babel/cli": "^7.28.
|
|
36
|
-
"@babel/core": "^7.
|
|
37
|
-
"@babel/eslint-parser": "^7.28.
|
|
40
|
+
"@babel/cli": "^7.28.6",
|
|
41
|
+
"@babel/core": "^7.29.0",
|
|
42
|
+
"@babel/eslint-parser": "^7.28.6",
|
|
38
43
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
39
44
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
|
40
|
-
"@babel/preset-env": "^7.
|
|
45
|
+
"@babel/preset-env": "^7.29.5",
|
|
41
46
|
"@babel/preset-flow": "^7.27.1",
|
|
42
47
|
"@babel/preset-react": "^7.28.5",
|
|
48
|
+
"@eslint/js": "^9.39.4",
|
|
43
49
|
"@testing-library/dom": "^10.4.1",
|
|
44
50
|
"@testing-library/jest-dom": "^6.1.0",
|
|
45
|
-
"@testing-library/react": "^16.3.
|
|
51
|
+
"@testing-library/react": "^16.3.2",
|
|
46
52
|
"@testing-library/user-event": "^14.5.0",
|
|
47
|
-
"babel-loader": "^10.
|
|
53
|
+
"babel-loader": "^10.1.1",
|
|
48
54
|
"cross-env": "^10.1.0",
|
|
49
|
-
"css-loader": "^7.1.
|
|
50
|
-
"eslint": "^9.39.
|
|
51
|
-
"eslint-plugin-jest": "^29.
|
|
55
|
+
"css-loader": "^7.1.4",
|
|
56
|
+
"eslint": "^9.39.4",
|
|
57
|
+
"eslint-plugin-jest": "^29.15.2",
|
|
52
58
|
"eslint-plugin-react": "^7.37.5",
|
|
53
59
|
"flow-bin": "^0.153.0",
|
|
54
|
-
"jest": "^30.2
|
|
55
|
-
"jest-environment-jsdom": "^30.
|
|
56
|
-
"lodash": "^4.
|
|
60
|
+
"jest": "^30.4.2",
|
|
61
|
+
"jest-environment-jsdom": "^30.4.1",
|
|
62
|
+
"lodash": "^4.18.1",
|
|
57
63
|
"pre-commit": "^1.1.2",
|
|
58
|
-
"react": "^19.2.
|
|
59
|
-
"react-dom": "^19.2.
|
|
64
|
+
"react": "^19.2.6",
|
|
65
|
+
"react-dom": "^19.2.6",
|
|
60
66
|
"style-loader": "^4.0.0",
|
|
61
|
-
"webpack": "^5.
|
|
62
|
-
"webpack-cli": "^
|
|
63
|
-
"webpack-dev-server": "^5.2.
|
|
67
|
+
"webpack": "^5.106.2",
|
|
68
|
+
"webpack-cli": "^7.0.2",
|
|
69
|
+
"webpack-dev-server": "^5.2.4"
|
|
64
70
|
},
|
|
65
71
|
"dependencies": {
|
|
66
72
|
"prop-types": "15.x",
|
package/.babelrc
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"presets": [
|
|
3
|
-
[
|
|
4
|
-
"@babel/preset-env",
|
|
5
|
-
{
|
|
6
|
-
"loose": true
|
|
7
|
-
}
|
|
8
|
-
],
|
|
9
|
-
"@babel/preset-react",
|
|
10
|
-
"@babel/preset-flow"
|
|
11
|
-
],
|
|
12
|
-
"plugins": [
|
|
13
|
-
["@babel/plugin-proposal-class-properties", {"loose": true}],
|
|
14
|
-
"@babel/plugin-proposal-object-rest-spread"
|
|
15
|
-
]
|
|
16
|
-
}
|
package/.browserslistrc
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
# Fix GitHub Issue
|
|
2
|
-
|
|
3
|
-
Analyze and fix GitHub issue #$ARGUMENTS for react-grid-layout.
|
|
4
|
-
|
|
5
|
-
## Workflow
|
|
6
|
-
|
|
7
|
-
Follow these steps precisely:
|
|
8
|
-
|
|
9
|
-
### 1. Understand the Issue
|
|
10
|
-
|
|
11
|
-
Fetch and analyze the issue:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
gh issue view $ARGUMENTS
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Determine:
|
|
18
|
-
|
|
19
|
-
- What is the bug? (not feature requests or questions)
|
|
20
|
-
- Is there a CodeSandbox reproduction?
|
|
21
|
-
- Which component/hook is affected?
|
|
22
|
-
- Is this fixable? (has clear reproduction, is actually a bug)
|
|
23
|
-
|
|
24
|
-
If not actionable, explain why and stop.
|
|
25
|
-
|
|
26
|
-
### 2. Investigate
|
|
27
|
-
|
|
28
|
-
- Search for relevant code using Grep/Glob
|
|
29
|
-
- Read the affected files
|
|
30
|
-
- Identify the root cause
|
|
31
|
-
- Check existing tests in `test/spec/`
|
|
32
|
-
|
|
33
|
-
### 3. Write a Failing Test FIRST
|
|
34
|
-
|
|
35
|
-
**CRITICAL: The test must fail before implementing the fix.**
|
|
36
|
-
|
|
37
|
-
Add a test to the appropriate file in `test/spec/` that:
|
|
38
|
-
|
|
39
|
-
- Reproduces the exact bug behavior
|
|
40
|
-
- Includes comment `// #$ARGUMENTS`
|
|
41
|
-
- Actually FAILS when run
|
|
42
|
-
|
|
43
|
-
Verify it fails:
|
|
44
|
-
|
|
45
|
-
```bash
|
|
46
|
-
NODE_ENV=test npx jest --testPathPatterns="<test-file>"
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
If test passes, it's invalid - revise until it fails.
|
|
50
|
-
|
|
51
|
-
### 4. Implement the Fix
|
|
52
|
-
|
|
53
|
-
- Make minimal changes to fix the bug
|
|
54
|
-
- Add comments explaining non-obvious fixes
|
|
55
|
-
- Reference the issue number
|
|
56
|
-
|
|
57
|
-
Verify test now passes:
|
|
58
|
-
|
|
59
|
-
```bash
|
|
60
|
-
NODE_ENV=test npx jest --testPathPatterns="<test-file>"
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
### 5. Validate
|
|
64
|
-
|
|
65
|
-
Run in order:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
yarn test
|
|
69
|
-
yarn lint
|
|
70
|
-
yarn fmt
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
Fix any failures before proceeding.
|
|
74
|
-
|
|
75
|
-
### 6. Commit and PR
|
|
76
|
-
|
|
77
|
-
```bash
|
|
78
|
-
git checkout -b fix/issue-$ARGUMENTS-<short-desc>
|
|
79
|
-
git add <files>
|
|
80
|
-
git commit -m "fix: <description> (#$ARGUMENTS)"
|
|
81
|
-
git push -u origin fix/issue-$ARGUMENTS-<short-desc>
|
|
82
|
-
gh pr create --title "fix: <description> (#$ARGUMENTS)" --body "Fixes #$ARGUMENTS
|
|
83
|
-
|
|
84
|
-
## Summary
|
|
85
|
-
<root cause>
|
|
86
|
-
|
|
87
|
-
## Fix
|
|
88
|
-
<what changed>
|
|
89
|
-
|
|
90
|
-
## Test plan
|
|
91
|
-
- [x] Test fails without fix
|
|
92
|
-
- [x] Test passes with fix
|
|
93
|
-
- [x] All tests pass"
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
### 7. Wait and Merge
|
|
97
|
-
|
|
98
|
-
```bash
|
|
99
|
-
gh pr checks <pr-number> --watch
|
|
100
|
-
gh pr merge <pr-number> --squash --delete-branch
|
|
101
|
-
git checkout master && git pull
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
## Key Files
|
|
105
|
-
|
|
106
|
-
- `src/core/` - Pure algorithms
|
|
107
|
-
- `src/react/components/` - React components
|
|
108
|
-
- `src/react/hooks/` - React hooks
|
|
109
|
-
- `src/legacy/` - v1 compatibility
|
|
110
|
-
- `test/spec/` - Tests
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"permissions": {
|
|
3
|
-
"allow": [
|
|
4
|
-
"WebFetch(domain:github.com)",
|
|
5
|
-
"Bash(npx jest:*)",
|
|
6
|
-
"Bash(git tag:*)",
|
|
7
|
-
"Bash(gh release create:*)",
|
|
8
|
-
"Bash(gh issue close:*)",
|
|
9
|
-
"Bash(gh search:*)",
|
|
10
|
-
"WebFetch(domain:raw.githubusercontent.com)",
|
|
11
|
-
"Bash(curl:*)"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"enableAllProjectMcpServers": true,
|
|
15
|
-
"enabledMcpjsonServers": [
|
|
16
|
-
"messenger"
|
|
17
|
-
]
|
|
18
|
-
}
|
package/.flowconfig
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
[version]
|
|
2
|
-
^0.153.0
|
|
3
|
-
|
|
4
|
-
[ignore]
|
|
5
|
-
.*/node_modules/@babel.*
|
|
6
|
-
.*/node_modules/.*/malformed_package_json/.*
|
|
7
|
-
<PROJECT_ROOT>/build/.*
|
|
8
|
-
|
|
9
|
-
[include]
|
|
10
|
-
|
|
11
|
-
[libs]
|
|
12
|
-
flow-typed
|
|
13
|
-
|
|
14
|
-
[lints]
|
|
15
|
-
all=warn
|
|
16
|
-
implicit-inexact-object=error
|
|
17
|
-
|
|
18
|
-
[options]
|
|
19
|
-
suppress_type=$FlowFixMe
|
|
20
|
-
experimental.strict_call_arity=true
|
|
21
|
-
module.system.node.allow_root_relative=true
|
|
22
|
-
module.use_strict=true
|
|
23
|
-
server.max_workers=6
|
|
24
|
-
exact_by_default=true
|
|
25
|
-
sharedmemory.heap_size=3221225472
|