react-resizable-panels 4.0.6 → 4.0.7

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.
@@ -377,16 +377,16 @@ function B({
377
377
  `Panel constraints not found for index ${d}`
378
378
  );
379
379
  const {
380
- collapsedSize: v = 0,
381
- collapsible: h,
380
+ collapsedSize: h = 0,
381
+ collapsible: v,
382
382
  minSize: x = 0
383
383
  } = p;
384
- if (h) {
384
+ if (v) {
385
385
  const S = c[d];
386
386
  if (z(
387
387
  S != null,
388
388
  `Previous layout not found for panel index ${d}`
389
- ), w(S, v)) {
389
+ ), w(S, h)) {
390
390
  const y = x - S;
391
391
  j(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
392
392
  }
@@ -399,17 +399,17 @@ function B({
399
399
  `No panel constraints found for index ${d}`
400
400
  );
401
401
  const {
402
- collapsedSize: v = 0,
403
- collapsible: h,
402
+ collapsedSize: h = 0,
403
+ collapsible: v,
404
404
  minSize: x = 0
405
405
  } = p;
406
- if (h) {
406
+ if (v) {
407
407
  const S = c[d];
408
408
  if (z(
409
409
  S != null,
410
410
  `Previous layout not found for panel index ${d}`
411
411
  ), w(S, x)) {
412
- const y = S - v;
412
+ const y = S - h;
413
413
  j(y, Math.abs(e)) > 0 && (e = e < 0 ? 0 - y : y);
414
414
  }
415
415
  }
@@ -417,7 +417,7 @@ function B({
417
417
  }
418
418
  {
419
419
  const d = e < 0 ? 1 : -1;
420
- let p = e < 0 ? f : l, v = 0;
420
+ let p = e < 0 ? f : l, h = 0;
421
421
  for (; ; ) {
422
422
  const x = c[p];
423
423
  z(
@@ -428,25 +428,25 @@ function B({
428
428
  panelConstraints: n[p],
429
429
  size: 100
430
430
  }) - x;
431
- if (v += y, p += d, p < 0 || p >= n.length)
431
+ if (h += y, p += d, p < 0 || p >= n.length)
432
432
  break;
433
433
  }
434
- const h = Math.min(Math.abs(e), Math.abs(v));
435
- e = e < 0 ? 0 - h : h;
434
+ const v = Math.min(Math.abs(e), Math.abs(h));
435
+ e = e < 0 ? 0 - v : v;
436
436
  }
437
437
  {
438
438
  let p = e < 0 ? l : f;
439
439
  for (; p >= 0 && p < n.length; ) {
440
- const v = Math.abs(e) - Math.abs(u), h = c[p];
440
+ const h = Math.abs(e) - Math.abs(u), v = c[p];
441
441
  z(
442
- h != null,
442
+ v != null,
443
443
  `Previous layout not found for panel index ${p}`
444
444
  );
445
- const x = h - v, S = F({
445
+ const x = v - h, S = F({
446
446
  panelConstraints: n[p],
447
447
  size: x
448
448
  });
449
- if (!w(h, S) && (u += h - S, a[p] = S, u.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
449
+ if (!w(v, S) && (u += v - S, a[p] = S, u.toFixed(3).localeCompare(Math.abs(e).toFixed(3), void 0, {
450
450
  numeric: !0
451
451
  }) >= 0))
452
452
  break;
@@ -461,12 +461,12 @@ function B({
461
461
  p != null,
462
462
  `Previous layout not found for panel index ${d}`
463
463
  );
464
- const v = p + u, h = F({
464
+ const h = p + u, v = F({
465
465
  panelConstraints: n[d],
466
- size: v
466
+ size: h
467
467
  });
468
- if (a[d] = h, !w(h, v)) {
469
- let x = v - h, y = e < 0 ? f : l;
468
+ if (a[d] = v, !w(v, h)) {
469
+ let x = h - v, y = e < 0 ? f : l;
470
470
  for (; y >= 0 && y < n.length; ) {
471
471
  const L = a[y];
472
472
  z(
@@ -490,7 +490,7 @@ function B({
490
490
  if (!w(m, 100, 0.1))
491
491
  return r;
492
492
  const g = Object.keys(r);
493
- return a.reduce((d, p, v) => (d[g[v]] = p, d), {});
493
+ return a.reduce((d, p, h) => (d[g[h]] = p, d), {});
494
494
  }
495
495
  function U(e, t) {
496
496
  if (Object.keys(e).length !== Object.keys(t).length)
@@ -515,19 +515,19 @@ function Ce({
515
515
  r ? u === "horizontal" ? g = (e.clientX - r.x) / l * 100 : g = (e.clientY - r.y) / l * 100 : u === "horizontal" ? g = e.clientX < 0 ? -100 : 100 : g = e.clientY < 0 ? -100 : 100;
516
516
  const d = n.get(a), {
517
517
  derivedPanelConstraints: p,
518
- layout: v,
519
- separatorToPanels: h
518
+ layout: h,
519
+ separatorToPanels: v
520
520
  } = o.get(a) ?? {};
521
- if (p && d && v && h) {
521
+ if (p && d && h && v) {
522
522
  const x = B({
523
523
  delta: g,
524
524
  initialLayout: d,
525
525
  panelConstraints: p,
526
526
  pivotIndices: i.panels.map((S) => m.indexOf(S)),
527
- prevLayout: v,
527
+ prevLayout: h,
528
528
  trigger: "mouse-or-touch"
529
529
  });
530
- if (U(x, v)) {
530
+ if (U(x, h)) {
531
531
  if (g !== 0 && !f)
532
532
  switch (u) {
533
533
  case "horizontal": {
@@ -543,7 +543,7 @@ function Ce({
543
543
  c.set(i.group, {
544
544
  derivedPanelConstraints: p,
545
545
  layout: x,
546
- separatorToPanels: h
546
+ separatorToPanels: v
547
547
  });
548
548
  const S = i.group.panels.map(({ id: y }) => y).join(",");
549
549
  i.group.inMemoryLayouts[S] = x;
@@ -927,17 +927,17 @@ function st(e) {
927
927
  for (const m of u) {
928
928
  const { borderBoxSize: g, target: d } = m;
929
929
  d === e.element ? t && C((p) => {
930
- const v = p.mountedGroups.get(e);
931
- if (v) {
932
- const h = pe(e), x = v.layout, S = $({
930
+ const h = p.mountedGroups.get(e);
931
+ if (h) {
932
+ const v = pe(e), x = h.layout, S = $({
933
933
  layout: x,
934
- panelConstraints: h
934
+ panelConstraints: v
935
935
  });
936
936
  return {
937
937
  mountedGroups: new Map(p.mountedGroups).set(e, {
938
- derivedPanelConstraints: h,
938
+ derivedPanelConstraints: v,
939
939
  layout: S,
940
- separatorToPanels: v.separatorToPanels
940
+ separatorToPanels: h.separatorToPanels
941
941
  })
942
942
  };
943
943
  }
@@ -1041,7 +1041,7 @@ function ht({
1041
1041
  }) {
1042
1042
  const m = T({}), g = ue((b) => {
1043
1043
  U(m.current, b) || (m.current = b, a?.(b));
1044
- }), d = ce(i), [p, v] = G(!1), [h, x] = G(null), [S, y] = G(n ?? {}), [L, P] = G([]), [E, K] = G([]), ne = T({}), V = T({}), X = fe(x, s);
1044
+ }), d = ce(i), [p, h] = G(!1), [v, x] = G(null), [S, y] = G(n ?? {}), [L, P] = G([]), [E, K] = G([]), ne = T({}), V = T({}), X = fe(x, s);
1045
1045
  rt(d, c);
1046
1046
  const Y = be(
1047
1047
  () => ({
@@ -1061,12 +1061,12 @@ function ht({
1061
1061
  [d, l]
1062
1062
  );
1063
1063
  H(() => {
1064
- if (h !== null && L.length > 0) {
1064
+ if (v !== null && L.length > 0) {
1065
1065
  const b = {
1066
1066
  defaultLayout: n,
1067
1067
  disableCursor: !!o,
1068
1068
  disabled: !!r,
1069
- element: h,
1069
+ element: v,
1070
1070
  id: d,
1071
1071
  inMemoryLastExpandedPanelSizes: ne.current,
1072
1072
  inMemoryLayouts: V.current,
@@ -1079,15 +1079,18 @@ function ht({
1079
1079
  "interactionStateChange",
1080
1080
  (Z) => {
1081
1081
  switch (Z.state) {
1082
- case "active":
1083
- case "hover": {
1084
- v(
1082
+ case "active": {
1083
+ h(
1085
1084
  Z.hitRegions.some(
1086
1085
  (_) => _.group === b
1087
1086
  )
1088
1087
  );
1089
1088
  break;
1090
1089
  }
1090
+ default: {
1091
+ h(!1);
1092
+ break;
1093
+ }
1091
1094
  }
1092
1095
  }
1093
1096
  ), Ae = A.addListener(
@@ -1105,7 +1108,7 @@ function ht({
1105
1108
  n,
1106
1109
  o,
1107
1110
  r,
1108
- h,
1111
+ v,
1109
1112
  d,
1110
1113
  g,
1111
1114
  l,
@@ -1235,21 +1238,21 @@ function ct({
1235
1238
  group: f,
1236
1239
  layout: u,
1237
1240
  separatorToPanels: m
1238
- } = n(), g = f.panels.findIndex((h) => h.id === t), d = g === f.panels.length - 1, p = B({
1241
+ } = n(), g = f.panels.findIndex((v) => v.id === t), d = g === f.panels.length - 1, p = B({
1239
1242
  delta: d ? a - i : i - a,
1240
1243
  initialLayout: u,
1241
1244
  panelConstraints: l,
1242
1245
  pivotIndices: d ? [g - 1, g] : [g, g + 1],
1243
1246
  prevLayout: u,
1244
1247
  trigger: "imperative-api"
1245
- }), v = $({
1248
+ }), h = $({
1246
1249
  layout: p,
1247
1250
  panelConstraints: l
1248
1251
  });
1249
- U(u, v) || C((h) => ({
1250
- mountedGroups: new Map(h.mountedGroups).set(f, {
1252
+ U(u, h) || C((v) => ({
1253
+ mountedGroups: new Map(v.mountedGroups).set(f, {
1251
1254
  derivedPanelConstraints: l,
1252
- layout: v,
1255
+ layout: h,
1253
1256
  separatorToPanels: m
1254
1257
  })
1255
1258
  }));
@@ -1326,7 +1329,7 @@ function St({
1326
1329
  style: u,
1327
1330
  ...m
1328
1331
  }) {
1329
- const g = !!c, d = ce(c), [p, v] = G(null), h = fe(v, s), { id: x, registerPanel: S } = de(), y = l !== null, L = ue((E) => {
1332
+ const g = !!c, d = ce(c), [p, h] = G(null), v = fe(h, s), { id: x, registerPanel: S } = de(), y = l !== null, L = ue((E) => {
1330
1333
  l?.(E, c);
1331
1334
  });
1332
1335
  H(() => {
@@ -1365,7 +1368,7 @@ function St({
1365
1368
  "data-panel": !0,
1366
1369
  "data-testid": d,
1367
1370
  id: d,
1368
- ref: h,
1371
+ ref: v,
1369
1372
  style: {
1370
1373
  ...ft,
1371
1374
  flexBasis: 0,
@@ -1466,14 +1469,14 @@ function bt({
1466
1469
  const c = ce(o), [i, a] = G({}), [l, f] = G("inactive"), [u, m] = G(null), g = fe(m, n), {
1467
1470
  id: d,
1468
1471
  orientation: p,
1469
- registerSeparator: v
1470
- } = de(), h = p === "horizontal" ? "vertical" : "horizontal";
1472
+ registerSeparator: h
1473
+ } = de(), v = p === "horizontal" ? "vertical" : "horizontal";
1471
1474
  return H(() => {
1472
1475
  if (u !== null) {
1473
1476
  const x = {
1474
1477
  element: u,
1475
1478
  id: c
1476
- }, S = v(x), y = A.addListener(
1479
+ }, S = h(x), y = A.addListener(
1477
1480
  "interactionStateChange",
1478
1481
  (P) => {
1479
1482
  f(
@@ -1509,12 +1512,12 @@ function bt({
1509
1512
  y(), L(), S();
1510
1513
  };
1511
1514
  }
1512
- }, [u, d, c, v]), /* @__PURE__ */ W(
1515
+ }, [u, d, c, h]), /* @__PURE__ */ W(
1513
1516
  "div",
1514
1517
  {
1515
1518
  ...s,
1516
1519
  "aria-controls": i.valueControls,
1517
- "aria-orientation": h,
1520
+ "aria-orientation": v,
1518
1521
  "aria-valuemax": i.valueMax,
1519
1522
  "aria-valuemin": i.valueMin,
1520
1523
  "aria-valuenow": i.valueNow,