react-resizable-panels 4.14.5 → 4.14.6

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.
@@ -1663,6 +1663,9 @@ function xe(e, t) {
1663
1663
  { isUserInteraction: !0 }
1664
1664
  );
1665
1665
  }
1666
+ function lo(e) {
1667
+ return e.separators.filter((t) => !t.disabled);
1668
+ }
1666
1669
  function Gt(e) {
1667
1670
  if (e.defaultPrevented)
1668
1671
  return;
@@ -1710,12 +1713,12 @@ function Gt(e) {
1710
1713
  }
1711
1714
  case "F6": {
1712
1715
  e.preventDefault();
1713
- const r = n.separators.map(
1716
+ const r = lo(n).map(
1714
1717
  (s) => s.element
1715
- ), i = Array.from(r).findIndex(
1718
+ ), i = r.findIndex(
1716
1719
  (s) => s === e.currentTarget
1717
1720
  );
1718
- N(i !== null, "Index not found");
1721
+ N(i !== -1, "Index not found");
1719
1722
  const a = e.shiftKey ? i > 0 ? i - 1 : r.length - 1 : i + 1 < r.length ? i + 1 : 0;
1720
1723
  r[a].focus({
1721
1724
  preventScroll: !0
@@ -1773,7 +1776,7 @@ function Ft(e) {
1773
1776
  function _t(e) {
1774
1777
  De(e.currentTarget, e);
1775
1778
  }
1776
- function lo(e, t) {
1779
+ function uo(e, t) {
1777
1780
  const { element: n, orientation: o, items: r } = e, i = n.getBoundingClientRect(), a = o === "horizontal";
1778
1781
  return St({
1779
1782
  expandHitTargets: !1,
@@ -1836,7 +1839,7 @@ function Bt(e) {
1836
1839
  s && r.set(c.axis, s.layout);
1837
1840
  });
1838
1841
  const a = Array.from(r.keys()).flatMap(
1839
- (c) => c.resizePreviewMode === "separator" ? lo(c, o) : []
1842
+ (c) => c.resizePreviewMode === "separator" ? uo(c, o) : []
1840
1843
  );
1841
1844
  fe({
1842
1845
  cursorFlags: 0,
@@ -1940,7 +1943,7 @@ function Ut(e) {
1940
1943
  function Wt(e) {
1941
1944
  De(e.currentTarget.document);
1942
1945
  }
1943
- function uo(e) {
1946
+ function fo(e) {
1944
1947
  let t = 0, n = 0;
1945
1948
  const o = {};
1946
1949
  for (const i of e)
@@ -1958,7 +1961,7 @@ function uo(e) {
1958
1961
  }
1959
1962
  return o;
1960
1963
  }
1961
- function fo(e, t) {
1964
+ function mo(e, t) {
1962
1965
  const n = e.map((r) => r.id), o = Object.keys(t);
1963
1966
  if (n.length !== o.length)
1964
1967
  return !1;
@@ -1972,7 +1975,7 @@ function Yt({
1972
1975
  itemConstraints: t
1973
1976
  }) {
1974
1977
  const n = e.items.map(({ id: r }) => r).join(","), o = e.mutableState.defaultLayout;
1975
- return e.mutableState.layouts[n] ?? (o && fo(e.items, o) ? o : uo(t));
1978
+ return e.mutableState.layouts[n] ?? (o && mo(e.items, o) ? o : fo(t));
1976
1979
  }
1977
1980
  function Xt({
1978
1981
  itemIds: e,
@@ -1991,7 +1994,7 @@ function Xt({
1991
1994
  }))
1992
1995
  });
1993
1996
  }
1994
- function mo(e, t, n) {
1997
+ function po(e, t, n) {
1995
1998
  if (!n[0])
1996
1999
  return;
1997
2000
  const r = e.items.find((u) => u.element === t);
@@ -2011,10 +2014,10 @@ function vn(e, t) {
2011
2014
  return !1;
2012
2015
  return !0;
2013
2016
  }
2014
- function po(e, t) {
2017
+ function ho(e, t) {
2015
2018
  return e.length !== t.length ? !1 : e.every((n, o) => vn(n, t[o]));
2016
2019
  }
2017
- function ho({
2020
+ function go({
2018
2021
  axis: e,
2019
2022
  nextAxisSize: t,
2020
2023
  prevAxisSize: n,
@@ -2092,7 +2095,7 @@ function bn(e) {
2092
2095
  itemConstraints: R
2093
2096
  })
2094
2097
  }));
2095
- const x = ho({
2098
+ const x = go({
2096
2099
  axis: e,
2097
2100
  nextAxisSize: z,
2098
2101
  prevAxisSize: O,
@@ -2101,7 +2104,7 @@ function bn(e) {
2101
2104
  layout: x,
2102
2105
  itemConstraints: R
2103
2106
  });
2104
- if (!b.defaultLayoutDeferred && se(b.layout, w) && po(
2107
+ if (!b.defaultLayoutDeferred && se(b.layout, w) && ho(
2105
2108
  b.derivedItemConstraints,
2106
2109
  R
2107
2110
  ) && b.axisSize === z)
@@ -2118,7 +2121,7 @@ function bn(e) {
2118
2121
  }
2119
2122
  } else
2120
2123
  try {
2121
- mo(e, S, g);
2124
+ po(e, S, g);
2122
2125
  } catch (z) {
2123
2126
  f ??= { error: z };
2124
2127
  }
@@ -2235,7 +2238,7 @@ function it(e) {
2235
2238
  }, [e]), t.current;
2236
2239
  }
2237
2240
  const It = nn(null);
2238
- function go({
2241
+ function yo({
2239
2242
  layout: e,
2240
2243
  itemConstraints: t,
2241
2244
  itemId: n,
@@ -2342,7 +2345,7 @@ function zn({
2342
2345
  (G) => G.itemId === L.id
2343
2346
  ), { layoutStrategy: F } = K.axis;
2344
2347
  R({
2345
- ...go({
2348
+ ...yo({
2346
2349
  layout: we,
2347
2350
  itemConstraints: ae,
2348
2351
  itemId: L.id,
@@ -2517,7 +2520,7 @@ function In(e) {
2517
2520
  }
2518
2521
  In.displayName = "Gridline";
2519
2522
  const Ce = ["column", "row"], Zt = { columns: {}, rows: {} };
2520
- function yo({
2523
+ function So({
2521
2524
  children: e,
2522
2525
  className: t,
2523
2526
  columns: n,
@@ -2626,7 +2629,7 @@ function yo({
2626
2629
  const L = A.current;
2627
2630
  if (L === null)
2628
2631
  return;
2629
- const T = M.current, F = vo({
2632
+ const T = M.current, F = bo({
2630
2633
  cells: T.cells,
2631
2634
  separatorPlacements: T.separators,
2632
2635
  trackCounts: { column: g.length, row: S.length }
@@ -2854,7 +2857,7 @@ function yo({
2854
2857
  }, [g, y, f, S]);
2855
2858
  const K = () => Ce.map((L) => {
2856
2859
  const T = ce(y(L)), F = z(L);
2857
- return (T && !T.defaultLayoutDeferred ? F.map((_) => `minmax(0, ${T.layout[_.id] ?? 1}fr)`) : So(
2860
+ return (T && !T.defaultLayoutDeferred ? F.map((_) => `minmax(0, ${T.layout[_.id] ?? 1}fr)`) : vo(
2858
2861
  F,
2859
2862
  o?.[L === "column" ? "columns" : "rows"]
2860
2863
  )).join(k[L] ? " auto " : " ");
@@ -2896,7 +2899,7 @@ function yo({
2896
2899
  }
2897
2900
  ) });
2898
2901
  }
2899
- yo.displayName = "Grid";
2902
+ So.displayName = "Grid";
2900
2903
  function Qt(e, t) {
2901
2904
  const n = JSON.stringify(e);
2902
2905
  return Me(() => {
@@ -2920,7 +2923,7 @@ function Ln(e, t) {
2920
2923
  typeof n.type == "symbol" && n.props !== null && typeof n.props == "object" && "children" in n.props && Ln(n.props.children, t);
2921
2924
  });
2922
2925
  }
2923
- function So(e, t) {
2926
+ function vo(e, t) {
2924
2927
  if (t)
2925
2928
  return e.map(
2926
2929
  (i) => `minmax(0, ${t[i.id] ?? 1}fr)`
@@ -2938,7 +2941,7 @@ function So(e, t) {
2938
2941
  return c === "%" ? `minmax(0, ${a}fr)` : `${a}${c}`;
2939
2942
  });
2940
2943
  }
2941
- function vo({
2944
+ function bo({
2942
2945
  cells: e,
2943
2946
  separatorPlacements: t,
2944
2947
  trackCounts: n
@@ -3001,13 +3004,13 @@ function vo({
3001
3004
  function en(e, t) {
3002
3005
  return se(e.columns, t.columns) && se(e.rows, t.rows);
3003
3006
  }
3004
- function Fo({
3007
+ function _o({
3005
3008
  id: e,
3006
3009
  onlySaveAfterUserInteractions: t,
3007
3010
  storage: n = localStorage
3008
3011
  }) {
3009
3012
  const o = `react-resizable-panels:grid:${e}`, r = tt(
3010
- bo,
3013
+ xo,
3011
3014
  () => n.getItem(o),
3012
3015
  () => n.getItem(o)
3013
3016
  ), i = Me(() => {
@@ -3043,23 +3046,23 @@ function Fo({
3043
3046
  onLayoutChanged: a
3044
3047
  };
3045
3048
  }
3046
- function bo() {
3049
+ function xo() {
3047
3050
  return function() {
3048
3051
  };
3049
3052
  }
3050
- function _o() {
3053
+ function Bo() {
3051
3054
  return ge(null);
3052
3055
  }
3053
- function Bo() {
3056
+ function qo() {
3054
3057
  return B(null);
3055
3058
  }
3056
- function xo(e) {
3059
+ function wo(e) {
3057
3060
  for (let t = 1; t < e.length; t++)
3058
3061
  if (yt(e[t - 1], e[t]) > 0)
3059
3062
  return !1;
3060
3063
  return !0;
3061
3064
  }
3062
- function wo({
3065
+ function zo({
3063
3066
  separator: e
3064
3067
  }) {
3065
3068
  const { element: t } = e, n = B(null);
@@ -3116,7 +3119,7 @@ function Cn(e) {
3116
3119
  ), null;
3117
3120
  }
3118
3121
  Cn.displayName = "SeparatorOverlay";
3119
- function zo({
3122
+ function Io({
3120
3123
  active: e,
3121
3124
  orientation: t,
3122
3125
  style: n,
@@ -3153,20 +3156,20 @@ function zo({
3153
3156
  }
3154
3157
  );
3155
3158
  }
3156
- function Io({
3159
+ function Lo({
3157
3160
  overlay: e,
3158
3161
  preview: t
3159
3162
  }) {
3160
3163
  const { axis: n, offset: o, rect: r, separator: i } = t, a = n.orientation === "horizontal";
3161
3164
  let c = i?.preview, s = e;
3162
3165
  return rn(c) && c.type === Cn && (s = c.props, c = void 0), c == null && (s ? c = /* @__PURE__ */ Y(
3163
- zo,
3166
+ Io,
3164
3167
  {
3165
3168
  ...s,
3166
3169
  active: t.active,
3167
3170
  orientation: n.orientation
3168
3171
  }
3169
- ) : i && (c = /* @__PURE__ */ Y(wo, { separator: i }))), /* @__PURE__ */ Y(
3172
+ ) : i && (c = /* @__PURE__ */ Y(zo, { separator: i }))), /* @__PURE__ */ Y(
3170
3173
  "div",
3171
3174
  {
3172
3175
  "aria-hidden": "true",
@@ -3185,10 +3188,10 @@ function Io({
3185
3188
  }
3186
3189
  );
3187
3190
  }
3188
- function Lo(e) {
3191
+ function Co(e) {
3189
3192
  return Array.from(e).sort(yt);
3190
3193
  }
3191
- function Co(e, t) {
3194
+ function Ro(e, t) {
3192
3195
  const n = B({
3193
3196
  getLayout: () => ({}),
3194
3197
  setLayout: Bn
@@ -3200,7 +3203,7 @@ function Co(e, t) {
3200
3203
  );
3201
3204
  });
3202
3205
  }
3203
- function Ro({
3206
+ function Eo({
3204
3207
  groupId: e,
3205
3208
  resizePreviewMode: t
3206
3209
  }) {
@@ -3224,7 +3227,7 @@ function Ro({
3224
3227
  return i(ie()), a;
3225
3228
  }, [e, t]), n;
3226
3229
  }
3227
- function Eo({
3230
+ function Mo({
3228
3231
  children: e,
3229
3232
  className: t,
3230
3233
  defaultLayout: n,
@@ -3253,7 +3256,7 @@ function Eo({
3253
3256
  (I, E, q) => {
3254
3257
  se(f.current.onLayoutChanged, I) || (f.current.onLayoutChanged = I, u?.(I, { isUserInteraction: E, requestedLayout: q }));
3255
3258
  }
3256
- ), S = Te(c), [z, b] = ge(), R = Ro({
3259
+ ), S = Te(c), [z, b] = ge(), R = Eo({
3257
3260
  groupId: S,
3258
3261
  resizePreviewMode: d
3259
3262
  }), O = B(null), [A, x] = wn(), w = B([]), v = B({
@@ -3262,7 +3265,7 @@ function Eo({
3262
3265
  panels: [],
3263
3266
  separators: []
3264
3267
  }), M = Ve(O, i);
3265
- Co(S, a);
3268
+ Ro(S, a);
3266
3269
  const k = Se(
3267
3270
  (I, E) => {
3268
3271
  const q = ce(I);
@@ -3346,7 +3349,7 @@ function Eo({
3346
3349
  ), E.separators = Ge(
3347
3350
  l,
3348
3351
  E.separators
3349
- ), w.current = Lo([
3352
+ ), w.current = Co([
3350
3353
  ...E.panels.map(({ element: L }) => L),
3351
3354
  ...E.separators.map(({ element: L }) => L)
3352
3355
  ]);
@@ -3433,7 +3436,7 @@ function Eo({
3433
3436
  d,
3434
3437
  P
3435
3438
  ]), ne(() => {
3436
- xo(w.current) || x();
3439
+ wo(w.current) || x();
3437
3440
  }), He(() => {
3438
3441
  const I = C.current;
3439
3442
  I && (I.mutableState.defaultLayout = n, I.mutableState.disableCursor = !!o);
@@ -3464,7 +3467,7 @@ function Eo({
3464
3467
  children: [
3465
3468
  e,
3466
3469
  R.map((I) => /* @__PURE__ */ Y(
3467
- Io,
3470
+ Lo,
3468
3471
  {
3469
3472
  overlay: z,
3470
3473
  preview: I
@@ -3475,11 +3478,11 @@ function Eo({
3475
3478
  }
3476
3479
  ) });
3477
3480
  }
3478
- Eo.displayName = "Group";
3481
+ Mo.displayName = "Group";
3479
3482
  function Qe(e, t) {
3480
3483
  return `react-resizable-panels:${[e, ...t].join(":")}`;
3481
3484
  }
3482
- function Mo({
3485
+ function Po({
3483
3486
  id: e,
3484
3487
  panelIds: t,
3485
3488
  storage: n
@@ -3514,7 +3517,7 @@ function Mo({
3514
3517
  } catch {
3515
3518
  }
3516
3519
  }
3517
- function qo({
3520
+ function Ho({
3518
3521
  debounceSaveMs: e = 100,
3519
3522
  onlySaveAfterUserInteractions: t,
3520
3523
  panelIds: n,
@@ -3522,7 +3525,7 @@ function qo({
3522
3525
  ...r
3523
3526
  }) {
3524
3527
  const i = n !== void 0, a = "id" in r ? r.id : r.groupId, c = Qe(a, n ?? []), s = tt(
3525
- Po,
3528
+ To,
3526
3529
  () => o.getItem(c),
3527
3530
  () => o.getItem(c)
3528
3531
  ), u = Me(() => {
@@ -3533,7 +3536,7 @@ function qo({
3533
3536
  }
3534
3537
  }, [s]), l = Me(() => {
3535
3538
  if (!u)
3536
- return Mo({
3539
+ return Po({
3537
3540
  id: a,
3538
3541
  panelIds: n,
3539
3542
  storage: o
@@ -3596,17 +3599,17 @@ function qo({
3596
3599
  onLayoutChanged: m
3597
3600
  };
3598
3601
  }
3599
- function Po() {
3602
+ function To() {
3600
3603
  return function() {
3601
3604
  };
3602
3605
  }
3603
- function Ho() {
3606
+ function Vo() {
3604
3607
  return ge(null);
3605
3608
  }
3606
- function Vo() {
3609
+ function jo() {
3607
3610
  return B(null);
3608
3611
  }
3609
- function To(e, t) {
3612
+ function Do(e, t) {
3610
3613
  const { id: n } = st(), o = B({
3611
3614
  collapse: ct,
3612
3615
  expand: ct,
@@ -3624,7 +3627,7 @@ function To(e, t) {
3624
3627
  );
3625
3628
  });
3626
3629
  }
3627
- function Do({
3630
+ function ko({
3628
3631
  children: e,
3629
3632
  className: t,
3630
3633
  collapsedSize: n = "0%",
@@ -3696,7 +3699,7 @@ function Do({
3696
3699
  S
3697
3700
  ]), He(() => {
3698
3701
  w(g, { disabled: a });
3699
- }, [a, g, w]), To(g, p);
3702
+ }, [a, g, w]), Do(g, p);
3700
3703
  const k = () => {
3701
3704
  const C = R(O, g);
3702
3705
  if (C)
@@ -3721,7 +3724,7 @@ function Do({
3721
3724
  id: g,
3722
3725
  ref: b,
3723
3726
  style: {
3724
- ...ko,
3727
+ ...Ao,
3725
3728
  display: "flex",
3726
3729
  flexBasis: 0,
3727
3730
  flexShrink: 1,
@@ -3750,8 +3753,8 @@ function Do({
3750
3753
  }
3751
3754
  );
3752
3755
  }
3753
- Do.displayName = "Panel";
3754
- const ko = {
3756
+ ko.displayName = "Panel";
3757
+ const Ao = {
3755
3758
  minHeight: 0,
3756
3759
  maxHeight: "100%",
3757
3760
  height: "auto",
@@ -3763,14 +3766,14 @@ const ko = {
3763
3766
  padding: 0,
3764
3767
  margin: 0
3765
3768
  };
3766
- function jo() {
3769
+ function Uo() {
3767
3770
  return ge(null);
3768
3771
  }
3769
- function Uo() {
3772
+ function Wo() {
3770
3773
  return B(null);
3771
3774
  }
3772
- const Ao = { flexBasis: "auto" }, $o = { flexGrow: 0, flexShrink: 0 };
3773
- function Oo({
3775
+ const $o = { flexBasis: "auto" }, Oo = { flexGrow: 0, flexShrink: 0 };
3776
+ function No({
3774
3777
  children: e,
3775
3778
  className: t,
3776
3779
  disabled: n,
@@ -3803,31 +3806,31 @@ function Oo({
3803
3806
  id: u,
3804
3807
  preview: a,
3805
3808
  registerSeparator: p,
3806
- requiredStyle: $o,
3809
+ requiredStyle: Oo,
3807
3810
  style: c,
3808
- styleDefaults: Ao,
3811
+ styleDefaults: $o,
3809
3812
  updateSeparatorProps: m,
3810
3813
  children: e
3811
3814
  }
3812
3815
  );
3813
3816
  }
3814
- Oo.displayName = "Separator";
3817
+ No.displayName = "Separator";
3815
3818
  export {
3816
3819
  An as Cell,
3817
- yo as Grid,
3820
+ So as Grid,
3818
3821
  In as Gridline,
3819
- Eo as Group,
3820
- Do as Panel,
3821
- Oo as Separator,
3822
+ Mo as Group,
3823
+ ko as Panel,
3824
+ No as Separator,
3822
3825
  Cn as SeparatorOverlay,
3823
3826
  $n as isCoarsePointer,
3824
- Fo as useDefaultGridLayout,
3825
- qo as useDefaultLayout,
3826
- _o as useGridCallbackRef,
3827
- Bo as useGridRef,
3828
- Ho as useGroupCallbackRef,
3829
- Vo as useGroupRef,
3830
- jo as usePanelCallbackRef,
3831
- Uo as usePanelRef
3827
+ _o as useDefaultGridLayout,
3828
+ Ho as useDefaultLayout,
3829
+ Bo as useGridCallbackRef,
3830
+ qo as useGridRef,
3831
+ Vo as useGroupCallbackRef,
3832
+ jo as useGroupRef,
3833
+ Uo as usePanelCallbackRef,
3834
+ Wo as usePanelRef
3832
3835
  };
3833
3836
  //# sourceMappingURL=react-resizable-panels.js.map