@clevertask/react-sortable-tree 0.0.1 → 0.0.2

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.
@@ -81,7 +81,7 @@ export interface SortableTreeProps {
81
81
  * @param id - The id of the parent item being expanded.
82
82
  * @param isExpanding - True if the item is being expanded, false if collapsing.
83
83
  */
84
- onLazyLoadChildren?: (id: UniqueIdentifier, isExpanding: boolean) => Promise<void>;
84
+ onLazyLoadChildren?: (id: UniqueIdentifier, isExpanding: boolean) => void;
85
85
  /**
86
86
  * Determines if a drop indicator should be shown when dragging items.
87
87
  * @default false
@@ -21,21 +21,21 @@ function Ne(e) {
21
21
  function Lt(e) {
22
22
  return "nodeType" in e;
23
23
  }
24
- function G(e) {
24
+ function Z(e) {
25
25
  var t, n;
26
26
  return e ? Ne(e) ? e : Lt(e) && (t = (n = e.ownerDocument) == null ? void 0 : n.defaultView) != null ? t : window : window;
27
27
  }
28
28
  function Pt(e) {
29
29
  const {
30
30
  Document: t
31
- } = G(e);
31
+ } = Z(e);
32
32
  return e instanceof t;
33
33
  }
34
34
  function Ue(e) {
35
- return Ne(e) ? !1 : e instanceof G(e).HTMLElement;
35
+ return Ne(e) ? !1 : e instanceof Z(e).HTMLElement;
36
36
  }
37
37
  function hn(e) {
38
- return e instanceof G(e).SVGElement;
38
+ return e instanceof Z(e).SVGElement;
39
39
  }
40
40
  function Le(e) {
41
41
  return e ? Ne(e) ? e.document : Lt(e) ? Pt(e) ? e : Ue(e) || hn(e) ? e.ownerDocument : document : document : document;
@@ -127,7 +127,7 @@ function ht(e) {
127
127
  return !1;
128
128
  const {
129
129
  KeyboardEvent: t
130
- } = G(e.target);
130
+ } = Z(e.target);
131
131
  return t && e instanceof t;
132
132
  }
133
133
  function or(e) {
@@ -135,7 +135,7 @@ function or(e) {
135
135
  return !1;
136
136
  const {
137
137
  TouchEvent: t
138
- } = G(e.target);
138
+ } = Z(e.target);
139
139
  return t && e instanceof t;
140
140
  }
141
141
  function at(e) {
@@ -641,7 +641,7 @@ function Pe(e, t) {
641
641
  const {
642
642
  transform: c,
643
643
  transformOrigin: u
644
- } = G(e).getComputedStyle(e);
644
+ } = Z(e).getComputedStyle(e);
645
645
  c && (n = Ir(n, c, u));
646
646
  }
647
647
  const {
@@ -678,10 +678,10 @@ function Er(e) {
678
678
  };
679
679
  }
680
680
  function Or(e, t) {
681
- return t === void 0 && (t = G(e).getComputedStyle(e)), t.position === "fixed";
681
+ return t === void 0 && (t = Z(e).getComputedStyle(e)), t.position === "fixed";
682
682
  }
683
683
  function Tr(e, t) {
684
- t === void 0 && (t = G(e).getComputedStyle(e));
684
+ t === void 0 && (t = Z(e).getComputedStyle(e));
685
685
  const n = /(auto|scroll|overlay)/;
686
686
  return ["overflow", "overflowX", "overflowY"].some((o) => {
687
687
  const i = t[o];
@@ -697,7 +697,7 @@ function kt(e, t) {
697
697
  return n.push(o.scrollingElement), n;
698
698
  if (!Ue(o) || hn(o) || n.includes(o))
699
699
  return n;
700
- const i = G(e).getComputedStyle(o);
700
+ const i = Z(e).getComputedStyle(o);
701
701
  return o !== e && Tr(o, i) && n.push(o), Or(o, i) ? n : r(o.parentNode);
702
702
  }
703
703
  return e ? r(e) : n;
@@ -875,7 +875,7 @@ class Fe {
875
875
  function zr(e) {
876
876
  const {
877
877
  EventTarget: t
878
- } = G(e);
878
+ } = Z(e);
879
879
  return e instanceof t ? e : Le(e);
880
880
  }
881
881
  function Dt(e, t) {
@@ -935,7 +935,7 @@ class Bt {
935
935
  target: n
936
936
  }
937
937
  } = t;
938
- this.props = t, this.listeners = new Fe(Le(n)), this.windowListeners = new Fe(G(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
938
+ this.props = t, this.listeners = new Fe(Le(n)), this.windowListeners = new Fe(Z(n)), this.handleKeyDown = this.handleKeyDown.bind(this), this.handleCancel = this.handleCancel.bind(this), this.attach();
939
939
  }
940
940
  attach() {
941
941
  this.handleStart(), this.windowListeners.add(oe.Resize, this.handleCancel), this.windowListeners.add(oe.VisibilityChange, this.handleCancel), setTimeout(() => this.listeners.add(oe.Keydown, this.handleKeyDown));
@@ -1000,29 +1000,29 @@ class Bt {
1000
1000
  y: Math.min(p === S.Down ? R.bottom - R.height / 2 : R.bottom, Math.max(p === S.Down ? R.top : R.top + R.height / 2, d.y))
1001
1001
  }, N = p === S.Right && !w || p === S.Left && !y, B = p === S.Down && !C || p === S.Up && !m;
1002
1002
  if (N && E.x !== d.x) {
1003
- const A = g.scrollLeft + f.x, Z = p === S.Right && A <= x.x || p === S.Left && A >= I.x;
1004
- if (Z && !f.y) {
1003
+ const A = g.scrollLeft + f.x, Q = p === S.Right && A <= x.x || p === S.Left && A >= I.x;
1004
+ if (Q && !f.y) {
1005
1005
  g.scrollTo({
1006
1006
  left: A,
1007
1007
  behavior: a
1008
1008
  });
1009
1009
  return;
1010
1010
  }
1011
- Z ? h.x = g.scrollLeft - A : h.x = p === S.Right ? g.scrollLeft - x.x : g.scrollLeft - I.x, h.x && g.scrollBy({
1011
+ Q ? h.x = g.scrollLeft - A : h.x = p === S.Right ? g.scrollLeft - x.x : g.scrollLeft - I.x, h.x && g.scrollBy({
1012
1012
  left: -h.x,
1013
1013
  behavior: a
1014
1014
  });
1015
1015
  break;
1016
1016
  } else if (B && E.y !== d.y) {
1017
- const A = g.scrollTop + f.y, Z = p === S.Down && A <= x.y || p === S.Up && A >= I.y;
1018
- if (Z && !f.x) {
1017
+ const A = g.scrollTop + f.y, Q = p === S.Down && A <= x.y || p === S.Up && A >= I.y;
1018
+ if (Q && !f.x) {
1019
1019
  g.scrollTo({
1020
1020
  top: A,
1021
1021
  behavior: a
1022
1022
  });
1023
1023
  return;
1024
1024
  }
1025
- Z ? h.y = g.scrollTop - A : h.y = p === S.Down ? g.scrollTop - x.y : g.scrollTop - I.y, h.y && g.scrollBy({
1025
+ Q ? h.y = g.scrollTop - A : h.y = p === S.Down ? g.scrollTop - x.y : g.scrollTop - I.y, h.y && g.scrollBy({
1026
1026
  top: -h.y,
1027
1027
  behavior: a
1028
1028
  });
@@ -1091,7 +1091,7 @@ class $t {
1091
1091
  } = t, {
1092
1092
  target: s
1093
1093
  } = i;
1094
- this.props = t, this.events = n, this.document = Le(s), this.documentListeners = new Fe(this.document), this.listeners = new Fe(r), this.windowListeners = new Fe(G(s)), this.initialCoordinates = (o = at(i)) != null ? o : de, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
1094
+ this.props = t, this.events = n, this.document = Le(s), this.documentListeners = new Fe(this.document), this.listeners = new Fe(r), this.windowListeners = new Fe(Z(s)), this.initialCoordinates = (o = at(i)) != null ? o : de, this.handleStart = this.handleStart.bind(this), this.handleMove = this.handleMove.bind(this), this.handleEnd = this.handleEnd.bind(this), this.handleCancel = this.handleCancel.bind(this), this.handleKeydown = this.handleKeydown.bind(this), this.removeTextSelection = this.removeTextSelection.bind(this), this.attach();
1095
1095
  }
1096
1096
  attach() {
1097
1097
  const {
@@ -1687,7 +1687,7 @@ function An(e) {
1687
1687
  const St = [];
1688
1688
  function ro(e, t) {
1689
1689
  t === void 0 && (t = Pe);
1690
- const [n] = e, r = An(n ? G(n) : null), [o, i] = Nt(a, St), s = pt({
1690
+ const [n] = e, r = An(n ? Z(n) : null), [o, i] = Nt(a, St), s = pt({
1691
1691
  callback: i
1692
1692
  });
1693
1693
  return e.length > 0 && o === St && i(), ie(() => {
@@ -2058,18 +2058,18 @@ const ho = /* @__PURE__ */ ut(function(t) {
2058
2058
  droppable: {
2059
2059
  containers: B
2060
2060
  }
2061
- } = p, A = R ? E.get(R) : null, Z = z({
2061
+ } = p, A = R ? E.get(R) : null, Q = z({
2062
2062
  initial: null,
2063
2063
  translated: null
2064
- }), Q = T(() => {
2064
+ }), ee = T(() => {
2065
2065
  var U;
2066
2066
  return R != null ? {
2067
2067
  id: R,
2068
2068
  // It's possible for the active node to unmount while dragging
2069
2069
  data: (U = A == null ? void 0 : A.data) != null ? U : so,
2070
- rect: Z
2070
+ rect: Q
2071
2071
  } : null;
2072
- }, [R, A]), ne = z(null), [xe, De] = V(null), [J, Ce] = V(null), se = Ye(b, Object.values(b)), Se = Je("DndDescribedBy", s), v = T(() => B.getEnabled(), [B]), D = fo(f), {
2072
+ }, [R, A]), J = z(null), [xe, De] = V(null), [q, Ce] = V(null), se = Ye(b, Object.values(b)), Se = Je("DndDescribedBy", s), v = T(() => B.getEnabled(), [B]), D = fo(f), {
2073
2073
  droppableRects: P,
2074
2074
  measureDroppableContainers: M,
2075
2075
  measuringScheduled: F
@@ -2077,10 +2077,10 @@ const ho = /* @__PURE__ */ ut(function(t) {
2077
2077
  dragging: I,
2078
2078
  dependencies: [N.x, N.y],
2079
2079
  config: D.droppable
2080
- }), H = Kr(E, R), K = T(() => J ? at(J) : null, [J]), q = Zn(), W = Jr(H, D.draggable.measure);
2080
+ }), H = Kr(E, R), K = T(() => q ? at(q) : null, [q]), G = Zn(), W = Jr(H, D.draggable.measure);
2081
2081
  go({
2082
2082
  activeNode: R ? E.get(R) : null,
2083
- config: q.layoutShiftCompensation,
2083
+ config: G.layoutShiftCompensation,
2084
2084
  initialRect: W,
2085
2085
  measure: D.draggable.measure
2086
2086
  });
@@ -2100,15 +2100,15 @@ const ho = /* @__PURE__ */ ut(function(t) {
2100
2100
  scrollAdjustedTranslate: null
2101
2101
  }), pe = B.getNodeFor((n = L.current.over) == null ? void 0 : n.id), ae = oo({
2102
2102
  measure: D.dragOverlay.measure
2103
- }), Ie = (r = ae.nodeRef.current) != null ? r : H, Re = I ? (o = ae.rect) != null ? o : O : null, Ft = !!(ae.nodeRef.current && ae.rect), Ht = Zr(Ft ? null : O), mt = An(Ie ? G(Ie) : null), ve = Qr(I ? pe ?? H : null), Ge = ro(ve), Ze = Pn(h, {
2103
+ }), Ie = (r = ae.nodeRef.current) != null ? r : H, Re = I ? (o = ae.rect) != null ? o : O : null, Ft = !!(ae.nodeRef.current && ae.rect), Ht = Zr(Ft ? null : O), mt = An(Ie ? Z(Ie) : null), ve = Qr(I ? pe ?? H : null), Ge = ro(ve), Ze = Pn(h, {
2104
2104
  transform: {
2105
2105
  x: N.x - Ht.x,
2106
2106
  y: N.y - Ht.y,
2107
2107
  scaleX: 1,
2108
2108
  scaleY: 1
2109
2109
  },
2110
- activatorEvent: J,
2111
- active: Q,
2110
+ activatorEvent: q,
2111
+ active: ee,
2112
2112
  activeNodeRect: O,
2113
2113
  containerNodeRect: he,
2114
2114
  draggingNodeRect: Re,
@@ -2117,25 +2117,25 @@ const ho = /* @__PURE__ */ ut(function(t) {
2117
2117
  scrollableAncestors: ve,
2118
2118
  scrollableAncestorRects: Ge,
2119
2119
  windowRect: mt
2120
- }), Xt = K ? Ae(K, N) : null, Yt = eo(ve), Vn = ln(Yt), Kn = ln(Yt, [O]), Ee = Ae(Ze, Vn), Oe = Re ? Sr(Re, Ze) : null, ke = Q && Oe ? d({
2121
- active: Q,
2120
+ }), Xt = K ? Ae(K, N) : null, Yt = eo(ve), Vn = ln(Yt), Kn = ln(Yt, [O]), Ee = Ae(Ze, Vn), Oe = Re ? Sr(Re, Ze) : null, ke = ee && Oe ? d({
2121
+ active: ee,
2122
2122
  collisionRect: Oe,
2123
2123
  droppableRects: P,
2124
2124
  droppableContainers: v,
2125
2125
  pointerCoordinates: Xt
2126
2126
  }) : null, Vt = yn(ke, "id"), [be, Kt] = V(null), Un = Ft ? Ze : Ae(Ze, Kn), Wn = Dr(Un, (i = be == null ? void 0 : be.rect) != null ? i : null, O), Ut = $(
2127
- (U, ee) => {
2127
+ (U, te) => {
2128
2128
  let {
2129
- sensor: te,
2129
+ sensor: ne,
2130
2130
  options: me
2131
- } = ee;
2132
- if (ne.current == null)
2131
+ } = te;
2132
+ if (J.current == null)
2133
2133
  return;
2134
- const re = E.get(ne.current);
2134
+ const re = E.get(J.current);
2135
2135
  if (!re)
2136
2136
  return;
2137
- const le = U.nativeEvent, fe = new te({
2138
- active: ne.current,
2137
+ const le = U.nativeEvent, fe = new ne({
2138
+ active: J.current,
2139
2139
  activeNode: re,
2140
2140
  event: le,
2141
2141
  options: me,
@@ -2143,7 +2143,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2143
2143
  // otherwise they are frozen in time with the stale arguments
2144
2144
  context: L,
2145
2145
  onStart(ce) {
2146
- const ze = ne.current;
2146
+ const ze = J.current;
2147
2147
  if (ze == null)
2148
2148
  return;
2149
2149
  const Be = E.get(ze);
@@ -2155,7 +2155,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2155
2155
  active: {
2156
2156
  id: ze,
2157
2157
  data: Be.data,
2158
- rect: Z
2158
+ rect: Q
2159
2159
  }
2160
2160
  };
2161
2161
  je(() => {
@@ -2202,7 +2202,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2202
2202
  over: et
2203
2203
  }, ce === X.DragEnd && typeof _e == "function" && await Promise.resolve(_e($e)) && (ce = X.DragCancel);
2204
2204
  }
2205
- ne.current = null, je(() => {
2205
+ J.current = null, je(() => {
2206
2206
  m({
2207
2207
  type: ce
2208
2208
  }), x(ye.Uninitialized), Kt(null), De(null), Ce(null);
@@ -2220,11 +2220,11 @@ const ho = /* @__PURE__ */ ut(function(t) {
2220
2220
  },
2221
2221
  // eslint-disable-next-line react-hooks/exhaustive-deps
2222
2222
  [E]
2223
- ), Jn = $((U, ee) => (te, me) => {
2224
- const re = te.nativeEvent, le = E.get(me);
2223
+ ), Jn = $((U, te) => (ne, me) => {
2224
+ const re = ne.nativeEvent, le = E.get(me);
2225
2225
  if (
2226
2226
  // Another sensor is already instantiating
2227
- ne.current !== null || // No active draggable
2227
+ J.current !== null || // No active draggable
2228
2228
  !le || // Event has already been captured
2229
2229
  re.dndKit || re.defaultPrevented
2230
2230
  )
@@ -2232,9 +2232,9 @@ const ho = /* @__PURE__ */ ut(function(t) {
2232
2232
  const fe = {
2233
2233
  active: le
2234
2234
  };
2235
- U(te, ee.options, fe) === !0 && (re.dndKit = {
2236
- capturedBy: ee.sensor
2237
- }, ne.current = me, Ut(te, ee));
2235
+ U(ne, te.options, fe) === !0 && (re.dndKit = {
2236
+ capturedBy: te.sensor
2237
+ }, J.current = me, Ut(ne, te));
2238
2238
  }, [E, Ut]), Wt = Ur(u, Jn);
2239
2239
  to(u), ie(() => {
2240
2240
  O && C === ye.Initializing && x(ye.Initialized);
@@ -2243,16 +2243,16 @@ const ho = /* @__PURE__ */ ut(function(t) {
2243
2243
  const {
2244
2244
  onDragMove: U
2245
2245
  } = se.current, {
2246
- active: ee,
2247
- activatorEvent: te,
2246
+ active: te,
2247
+ activatorEvent: ne,
2248
2248
  collisions: me,
2249
2249
  over: re
2250
2250
  } = L.current;
2251
- if (!ee || !te)
2251
+ if (!te || !ne)
2252
2252
  return;
2253
2253
  const le = {
2254
- active: ee,
2255
- activatorEvent: te,
2254
+ active: te,
2255
+ activatorEvent: ne,
2256
2256
  collisions: me,
2257
2257
  delta: {
2258
2258
  x: Ee.x,
@@ -2273,12 +2273,12 @@ const ho = /* @__PURE__ */ ut(function(t) {
2273
2273
  () => {
2274
2274
  const {
2275
2275
  active: U,
2276
- activatorEvent: ee,
2277
- collisions: te,
2276
+ activatorEvent: te,
2277
+ collisions: ne,
2278
2278
  droppableContainers: me,
2279
2279
  scrollAdjustedTranslate: re
2280
2280
  } = L.current;
2281
- if (!U || ne.current == null || !ee || !re)
2281
+ if (!U || J.current == null || !te || !re)
2282
2282
  return;
2283
2283
  const {
2284
2284
  onDragOver: le
@@ -2289,8 +2289,8 @@ const ho = /* @__PURE__ */ ut(function(t) {
2289
2289
  disabled: fe.disabled
2290
2290
  } : null, ce = {
2291
2291
  active: U,
2292
- activatorEvent: ee,
2293
- collisions: te,
2292
+ activatorEvent: te,
2293
+ collisions: ne,
2294
2294
  delta: {
2295
2295
  x: re.x,
2296
2296
  y: re.y
@@ -2308,8 +2308,8 @@ const ho = /* @__PURE__ */ ut(function(t) {
2308
2308
  [Vt]
2309
2309
  ), ie(() => {
2310
2310
  L.current = {
2311
- activatorEvent: J,
2312
- active: Q,
2311
+ activatorEvent: q,
2312
+ active: ee,
2313
2313
  activeNode: H,
2314
2314
  collisionRect: Oe,
2315
2315
  collisions: ke,
@@ -2321,12 +2321,12 @@ const ho = /* @__PURE__ */ ut(function(t) {
2321
2321
  over: be,
2322
2322
  scrollableAncestors: ve,
2323
2323
  scrollAdjustedTranslate: Ee
2324
- }, Z.current = {
2324
+ }, Q.current = {
2325
2325
  initial: Re,
2326
2326
  translated: Oe
2327
2327
  };
2328
- }, [Q, H, ke, Oe, E, Ie, Re, P, B, be, ve, Ee]), Xr({
2329
- ...q,
2328
+ }, [ee, H, ke, Oe, E, Ie, Re, P, B, be, ve, Ee]), Xr({
2329
+ ...G,
2330
2330
  delta: N,
2331
2331
  draggingRect: Oe,
2332
2332
  pointerCoordinates: Xt,
@@ -2334,10 +2334,10 @@ const ho = /* @__PURE__ */ ut(function(t) {
2334
2334
  scrollableAncestorRects: Ge
2335
2335
  });
2336
2336
  const qn = T(() => ({
2337
- active: Q,
2337
+ active: ee,
2338
2338
  activeNode: H,
2339
2339
  activeNodeRect: O,
2340
- activatorEvent: J,
2340
+ activatorEvent: q,
2341
2341
  collisions: ke,
2342
2342
  containerNodeRect: he,
2343
2343
  dragOverlay: ae,
@@ -2351,10 +2351,10 @@ const ho = /* @__PURE__ */ ut(function(t) {
2351
2351
  measuringConfiguration: D,
2352
2352
  measuringScheduled: F,
2353
2353
  windowRect: mt
2354
- }), [Q, H, O, J, ke, he, ae, E, B, P, be, M, ve, Ge, D, F, mt]), Gn = T(() => ({
2355
- activatorEvent: J,
2354
+ }), [ee, H, O, q, ke, he, ae, E, B, P, be, M, ve, Ge, D, F, mt]), Gn = T(() => ({
2355
+ activatorEvent: q,
2356
2356
  activators: Wt,
2357
- active: Q,
2357
+ active: ee,
2358
2358
  activeNodeRect: O,
2359
2359
  ariaDescribedById: {
2360
2360
  draggable: Se
@@ -2363,7 +2363,7 @@ const ho = /* @__PURE__ */ ut(function(t) {
2363
2363
  draggableNodes: E,
2364
2364
  over: be,
2365
2365
  measureDroppableContainers: M
2366
- }), [J, Wt, Q, O, m, Se, E, be, M]);
2366
+ }), [q, Wt, ee, O, m, Se, E, be, M]);
2367
2367
  return j.createElement(vn.Provider, {
2368
2368
  value: y
2369
2369
  }, j.createElement(qe.Provider, {
@@ -2379,12 +2379,12 @@ const ho = /* @__PURE__ */ ut(function(t) {
2379
2379
  hiddenTextDescribedById: Se
2380
2380
  }));
2381
2381
  function Zn() {
2382
- const U = (xe == null ? void 0 : xe.autoScrollEnabled) === !1, ee = typeof l == "object" ? l.enabled === !1 : l === !1, te = I && !U && !ee;
2382
+ const U = (xe == null ? void 0 : xe.autoScrollEnabled) === !1, te = typeof l == "object" ? l.enabled === !1 : l === !1, ne = I && !U && !te;
2383
2383
  return typeof l == "object" ? {
2384
2384
  ...l,
2385
- enabled: te
2385
+ enabled: ne
2386
2386
  } : {
2387
- enabled: te
2387
+ enabled: ne
2388
2388
  };
2389
2389
  }
2390
2390
  }), po = /* @__PURE__ */ Ke(null), cn = "button", vo = "Droppable";
@@ -2664,7 +2664,7 @@ function To(e) {
2664
2664
  return;
2665
2665
  const {
2666
2666
  transform: u
2667
- } = G(s).getComputedStyle(s), d = xn(u);
2667
+ } = Z(s).getComputedStyle(s), d = xn(u);
2668
2668
  if (!d)
2669
2669
  return;
2670
2670
  const f = typeof t == "function" ? t : Ao(t);
@@ -3052,12 +3052,12 @@ function Vo(e) {
3052
3052
  }
3053
3053
  }), {
3054
3054
  active: A,
3055
- activatorEvent: Z,
3056
- activeNodeRect: Q,
3057
- attributes: ne,
3055
+ activatorEvent: Q,
3056
+ activeNodeRect: ee,
3057
+ attributes: J,
3058
3058
  setNodeRef: xe,
3059
3059
  listeners: De,
3060
- isDragging: J,
3060
+ isDragging: q,
3061
3061
  over: Ce,
3062
3062
  setActivatorNodeRef: se,
3063
3063
  transform: Se
@@ -3069,13 +3069,13 @@ function Vo(e) {
3069
3069
  ...n
3070
3070
  },
3071
3071
  disabled: y.draggable
3072
- }), v = tr(B, xe), D = !!A, P = D && !b && tt(f) && tt(p), M = !m && J, F = M && P ? Se : null, K = P ? F ?? (a ?? w)({
3072
+ }), v = tr(B, xe), D = !!A, P = D && !b && tt(f) && tt(p), M = !m && q, F = M && P ? Se : null, K = P ? F ?? (a ?? w)({
3073
3073
  rects: g,
3074
- activeNodeRect: Q,
3074
+ activeNodeRect: ee,
3075
3075
  activeIndex: f,
3076
3076
  overIndex: p,
3077
3077
  index: C
3078
- }) : null, q = tt(f) && tt(p) ? i({
3078
+ }) : null, G = tt(f) && tt(p) ? i({
3079
3079
  id: s,
3080
3080
  items: u,
3081
3081
  activeIndex: f,
@@ -3083,12 +3083,12 @@ function Vo(e) {
3083
3083
  }) : C, W = A == null ? void 0 : A.id, O = z({
3084
3084
  activeId: W,
3085
3085
  items: u,
3086
- newIndex: q,
3086
+ newIndex: G,
3087
3087
  containerId: d
3088
3088
  }), he = u !== O.current.items, L = t({
3089
3089
  active: A,
3090
3090
  containerId: d,
3091
- isDragging: J,
3091
+ isDragging: q,
3092
3092
  isSorting: D,
3093
3093
  id: s,
3094
3094
  index: C,
@@ -3105,8 +3105,8 @@ function Vo(e) {
3105
3105
  rect: R
3106
3106
  });
3107
3107
  return k(() => {
3108
- D && O.current.newIndex !== q && (O.current.newIndex = q), d !== O.current.containerId && (O.current.containerId = d), u !== O.current.items && (O.current.items = u);
3109
- }, [D, q, d, u]), k(() => {
3108
+ D && O.current.newIndex !== G && (O.current.newIndex = G), d !== O.current.containerId && (O.current.containerId = d), u !== O.current.items && (O.current.items = u);
3109
+ }, [D, G, d, u]), k(() => {
3110
3110
  if (W === O.current.activeId)
3111
3111
  return;
3112
3112
  if (W && !O.current.activeId) {
@@ -3120,15 +3120,15 @@ function Vo(e) {
3120
3120
  }, [W]), {
3121
3121
  active: A,
3122
3122
  activeIndex: f,
3123
- attributes: ne,
3123
+ attributes: J,
3124
3124
  data: x,
3125
3125
  rect: R,
3126
3126
  index: C,
3127
- newIndex: q,
3127
+ newIndex: G,
3128
3128
  items: u,
3129
3129
  isOver: N,
3130
3130
  isSorting: D,
3131
- isDragging: J,
3131
+ isDragging: q,
3132
3132
  listeners: De,
3133
3133
  node: E,
3134
3134
  overIndex: p,
@@ -3147,7 +3147,7 @@ function Vo(e) {
3147
3147
  he && O.current.newIndex === C
3148
3148
  )
3149
3149
  return Ho;
3150
- if (!(M && !ht(Z) || !c) && (D || L))
3150
+ if (!(M && !ht(Q) || !c) && (D || L))
3151
3151
  return ge.Transition.toString({
3152
3152
  ...c,
3153
3153
  property: _n
@@ -3628,27 +3628,27 @@ function Ni({
3628
3628
  }), document.body.style.setProperty("cursor", "grabbing");
3629
3629
  },
3630
3630
  [C]
3631
- ), Z = $(({ delta: v }) => {
3631
+ ), Q = $(({ delta: v }) => {
3632
3632
  m(v.x);
3633
- }, []), Q = $(({ over: v }) => {
3633
+ }, []), ee = $(({ over: v }) => {
3634
3634
  g((v == null ? void 0 : v.id) ?? null);
3635
- }, []), ne = $(
3635
+ }, []), J = $(() => {
3636
+ g(null), h(null), m(0), y(null), document.body.style.setProperty("cursor", "");
3637
+ }, []), xe = $(
3636
3638
  ({ active: v, over: D }) => {
3637
- if (De(), x && D) {
3638
- const { depth: P, parentId: M } = x, F = JSON.parse(JSON.stringify(It(e))), H = F.findIndex(({ id: L }) => L === D.id), K = F.findIndex(({ id: L }) => L === v.id), q = F[K];
3639
- F[K] = { ...q, depth: P, parentId: M };
3639
+ if (J(), x && D) {
3640
+ const { depth: P, parentId: M } = x, F = JSON.parse(JSON.stringify(It(e))), H = F.findIndex(({ id: L }) => L === D.id), K = F.findIndex(({ id: L }) => L === v.id), G = F[K];
3641
+ F[K] = { ...G, depth: P, parentId: M };
3640
3642
  const W = Ve(F, K, H), O = Go(W), he = Yn(O, F[K].id, M);
3641
3643
  t(ti(O)), u == null || u(he);
3642
3644
  }
3643
3645
  },
3644
- [e, x]
3645
- ), xe = $(() => {
3646
- De();
3647
- }, []), De = $(() => {
3648
- g(null), h(null), m(0), y(null), document.body.style.setProperty("cursor", "");
3649
- }, []), J = $((v) => {
3646
+ [e, x, u, J, t]
3647
+ ), De = $(() => {
3648
+ J();
3649
+ }, [J]), q = $((v) => {
3650
3650
  t((D) => Qo(D, v));
3651
- }, []), Ce = $(
3651
+ }, [t]), Ce = $(
3652
3652
  ({
3653
3653
  id: v,
3654
3654
  canFetchChildren: D,
@@ -3656,7 +3656,7 @@ function Ni({
3656
3656
  }) => D ? r == null ? void 0 : r(v, !!P) : t(
3657
3657
  (M) => ei(M, v, (F) => ({ collapsed: !F.collapsed }))
3658
3658
  ),
3659
- []
3659
+ [r, t]
3660
3660
  ), se = $(
3661
3661
  (v, D, P) => {
3662
3662
  if (P && x) {
@@ -3668,14 +3668,14 @@ function Ni({
3668
3668
  overId: P
3669
3669
  });
3670
3670
  }
3671
- const M = JSON.parse(JSON.stringify(It(e))), F = M.findIndex(({ id: L }) => L === P), H = M.findIndex(({ id: L }) => L === D), K = Ve(M, H, F), q = K[F - 1];
3671
+ const M = JSON.parse(JSON.stringify(It(e))), F = M.findIndex(({ id: L }) => L === P), H = M.findIndex(({ id: L }) => L === D), K = Ve(M, H, F), G = K[F - 1];
3672
3672
  let W;
3673
3673
  const O = v === "onDragEnd" ? "dropped" : "moved", he = v === "onDragEnd" ? "dropped" : "nested";
3674
- if (q)
3675
- if (x.depth > q.depth)
3676
- W = `${D} was ${he} under ${q.id}.`;
3674
+ if (G)
3675
+ if (x.depth > G.depth)
3676
+ W = `${D} was ${he} under ${G.id}.`;
3677
3677
  else {
3678
- let L = q;
3678
+ let L = G;
3679
3679
  for (; L && x.depth < L.depth; ) {
3680
3680
  const pe = L.parentId;
3681
3681
  L = K.find(({ id: ae }) => ae === pe);
@@ -3715,10 +3715,10 @@ function Ni({
3715
3715
  collisionDetection: mr,
3716
3716
  measuring: Ai,
3717
3717
  onDragStart: A,
3718
- onDragMove: Z,
3719
- onDragOver: Q,
3720
- onDragEnd: ne,
3721
- onDragCancel: xe,
3718
+ onDragMove: Q,
3719
+ onDragOver: ee,
3720
+ onDragEnd: xe,
3721
+ onDragCancel: De,
3722
3722
  children: /* @__PURE__ */ fn($o, { items: N, strategy: zo, children: [
3723
3723
  C.map(({ id: v, label: D, children: P, collapsed: M, depth: F, canFetchChildren: H, disableDragging: K }) => /* @__PURE__ */ _(
3724
3724
  dn,
@@ -3731,7 +3731,7 @@ function Ni({
3731
3731
  indicator: o,
3732
3732
  collapsed: !!(M && (P.length || H)),
3733
3733
  onCollapse: n && (P.length || H) ? () => Ce({ id: v, canFetchChildren: H, collapsed: M }) : void 0,
3734
- onRemove: s ? () => a ? a(v) : J(v) : void 0,
3734
+ onRemove: s ? () => a ? a(v) : q(v) : void 0,
3735
3735
  onAdd: l ? () => c == null ? void 0 : c(v) : void 0,
3736
3736
  onLabelClick: d ? () => d(v) : void 0
3737
3737
  },