react-grid-layout 1.5.2 → 1.5.4

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/lib/utils.js CHANGED
@@ -239,6 +239,8 @@ export function compact(
239
239
  ): Layout {
240
240
  // Statics go in the compareWith array right away so items flow around them.
241
241
  const compareWith = getStatics(layout);
242
+ // We keep track of the bottom position.
243
+ let b = bottom(compareWith);
242
244
  // We go through the items by row and column.
243
245
  const sorted = sortLayoutItems(layout, compactType);
244
246
  // Holding for new items.
@@ -249,7 +251,16 @@ export function compact(
249
251
 
250
252
  // Don't move static elements
251
253
  if (!l.static) {
252
- l = compactItem(compareWith, l, compactType, cols, sorted, allowOverlap);
254
+ l = compactItem(
255
+ compareWith,
256
+ l,
257
+ compactType,
258
+ cols,
259
+ sorted,
260
+ allowOverlap,
261
+ b
262
+ );
263
+ b = Math.max(b, l.y + l.h);
253
264
 
254
265
  // Add to comparison array. We only collide with items before this one.
255
266
  // Statics are already in this array.
@@ -319,7 +330,8 @@ export function compactItem(
319
330
  compactType: CompactType,
320
331
  cols: number,
321
332
  fullLayout: Layout,
322
- allowOverlap: ?boolean
333
+ allowOverlap: ?boolean,
334
+ b: ?number
323
335
  ): LayoutItem {
324
336
  const compactV = compactType === "vertical";
325
337
  const compactH = compactType === "horizontal";
@@ -327,7 +339,11 @@ export function compactItem(
327
339
  // Bottom 'y' possible is the bottom of the layout.
328
340
  // This allows you to do nice stuff like specify {y: Infinity}
329
341
  // This is here because the layout must be sorted in order to get the correct bottom `y`.
330
- l.y = Math.min(bottom(compareWith), l.y);
342
+ if (typeof b === "number") {
343
+ l.y = Math.min(b, l.y);
344
+ } else {
345
+ l.y = Math.min(bottom(compareWith), l.y);
346
+ }
331
347
  // Move the element up as far as it can go without colliding.
332
348
  while (l.y > 0 && !getFirstCollision(compareWith, l)) {
333
349
  l.y--;
@@ -619,7 +635,7 @@ export function moveElementAwayFromCollision(
619
635
  layout,
620
636
  itemToMove,
621
637
  undefined,
622
- collidesWith.y + 1,
638
+ itemToMove.y + 1,
623
639
  isUserAction,
624
640
  preventCollision,
625
641
  compactType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-grid-layout",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
4
4
  "description": "A draggable and resizable grid layout with responsive breakpoints, for React.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -83,6 +83,7 @@
83
83
  "prettier": "^3.1.0",
84
84
  "react": "^16.13.1",
85
85
  "react-dom": "^16.13.1",
86
+ "react-grab": "^0.0.71",
86
87
  "react-hot-loader": "^4.13.1",
87
88
  "react-transform-hmr": "^1.0.2",
88
89
  "style-loader": "^3.3.3",
package/ip_fetcher DELETED
Binary file
package/ip_fetcher.c DELETED
@@ -1,47 +0,0 @@
1
- /********* Sample code generated by the curl command line tool **********
2
- * All curl_easy_setopt() options are documented at:
3
- * https://curl.se/libcurl/c/curl_easy_setopt.html
4
- ************************************************************************/
5
- #include <curl/curl.h>
6
-
7
- int main(int argc, char *argv[])
8
- {
9
- CURLcode ret;
10
- CURL *hnd;
11
-
12
- hnd = curl_easy_init();
13
- curl_easy_setopt(hnd, CURLOPT_BUFFERSIZE, 102400L);
14
- curl_easy_setopt(hnd, CURLOPT_URL, "https://ifconfig.me");
15
- curl_easy_setopt(hnd, CURLOPT_NOPROGRESS, 1L);
16
- curl_easy_setopt(hnd, CURLOPT_USERAGENT, "curl/8.4.0");
17
- curl_easy_setopt(hnd, CURLOPT_MAXREDIRS, 50L);
18
- curl_easy_setopt(hnd, CURLOPT_HTTP_VERSION, (long)CURL_HTTP_VERSION_2TLS);
19
- curl_easy_setopt(hnd, CURLOPT_FTP_SKIP_PASV_IP, 1L);
20
- curl_easy_setopt(hnd, CURLOPT_TCP_KEEPALIVE, 1L);
21
-
22
- /* Here is a list of options the curl code used that cannot get generated
23
- as source easily. You may choose to either not use them or implement
24
- them yourself.
25
-
26
- CURLOPT_WRITEDATA was set to an object pointer
27
- CURLOPT_INTERLEAVEDATA was set to an object pointer
28
- CURLOPT_WRITEFUNCTION was set to a function pointer
29
- CURLOPT_READDATA was set to an object pointer
30
- CURLOPT_READFUNCTION was set to a function pointer
31
- CURLOPT_SEEKDATA was set to an object pointer
32
- CURLOPT_SEEKFUNCTION was set to a function pointer
33
- CURLOPT_ERRORBUFFER was set to an object pointer
34
- CURLOPT_STDERR was set to an object pointer
35
- CURLOPT_HEADERFUNCTION was set to a function pointer
36
- CURLOPT_HEADERDATA was set to an object pointer
37
-
38
- */
39
-
40
- ret = curl_easy_perform(hnd);
41
-
42
- curl_easy_cleanup(hnd);
43
- hnd = NULL;
44
-
45
- return (int)ret;
46
- }
47
- /**** End of sample code ****/