@aiquants/directory-tree 2.0.0 → 2.1.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/README.md +25 -4
- package/dist/directory-tree.css +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +506 -444
- package/dist/src/DirectoryTree.d.ts +1 -1
- package/dist/src/DirectoryTree.d.ts.map +1 -1
- package/dist/src/types.d.ts +24 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/styles/directory-tree.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { VirtualScroll as
|
|
3
|
-
import { FolderIcon as
|
|
4
|
-
import { FileIcon as
|
|
1
|
+
import ze, { memo as $e, useRef as ce, useCallback as P, useEffect as K, useState as oe, useMemo as ie, Fragment as Ue, useTransition as qe } from "react";
|
|
2
|
+
import { VirtualScroll as Ze } from "@aiquants/virtualscroll";
|
|
3
|
+
import { FolderIcon as Qe, DocumentTextIcon as Ke, ChevronDownIcon as et, ChevronRightIcon as tt } from "@heroicons/react/24/solid";
|
|
4
|
+
import { FileIcon as rt } from "@phosphor-icons/react";
|
|
5
5
|
import { twMerge as A } from "tailwind-merge";
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
6
|
+
var ge = { exports: {} }, me = {};
|
|
7
|
+
var je;
|
|
8
|
+
function nt() {
|
|
9
|
+
if (je) return me;
|
|
10
|
+
je = 1;
|
|
11
11
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
12
12
|
function o(l, n, a) {
|
|
13
13
|
var i = null;
|
|
14
14
|
if (a !== void 0 && (i = "" + a), n.key !== void 0 && (i = "" + n.key), "key" in n) {
|
|
15
15
|
a = {};
|
|
16
|
-
for (var
|
|
17
|
-
|
|
16
|
+
for (var h in n)
|
|
17
|
+
h !== "key" && (a[h] = n[h]);
|
|
18
18
|
} else a = n;
|
|
19
19
|
return n = a.ref, {
|
|
20
20
|
$$typeof: e,
|
|
@@ -24,29 +24,29 @@ function Ue() {
|
|
|
24
24
|
props: a
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return me.Fragment = r, me.jsx = o, me.jsxs = o, me;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
function
|
|
32
|
-
return
|
|
29
|
+
var he = {};
|
|
30
|
+
var Me;
|
|
31
|
+
function ot() {
|
|
32
|
+
return Me || (Me = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
33
33
|
function e(t) {
|
|
34
34
|
if (t == null) return null;
|
|
35
35
|
if (typeof t == "function")
|
|
36
|
-
return t.$$typeof ===
|
|
36
|
+
return t.$$typeof === $ ? null : t.displayName || t.name || null;
|
|
37
37
|
if (typeof t == "string") return t;
|
|
38
38
|
switch (t) {
|
|
39
39
|
case s:
|
|
40
40
|
return "Fragment";
|
|
41
|
-
case
|
|
41
|
+
case I:
|
|
42
42
|
return "Profiler";
|
|
43
|
-
case
|
|
43
|
+
case m:
|
|
44
44
|
return "StrictMode";
|
|
45
|
-
case
|
|
45
|
+
case F:
|
|
46
46
|
return "Suspense";
|
|
47
|
-
case
|
|
47
|
+
case V:
|
|
48
48
|
return "SuspenseList";
|
|
49
|
-
case
|
|
49
|
+
case q:
|
|
50
50
|
return "Activity";
|
|
51
51
|
}
|
|
52
52
|
if (typeof t == "object")
|
|
@@ -57,17 +57,17 @@ function qe() {
|
|
|
57
57
|
return "Portal";
|
|
58
58
|
case S:
|
|
59
59
|
return t.displayName || "Context";
|
|
60
|
-
case
|
|
60
|
+
case T:
|
|
61
61
|
return (t._context.displayName || "Context") + ".Consumer";
|
|
62
62
|
case d:
|
|
63
|
-
var
|
|
64
|
-
return t = t.displayName, t || (t =
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
63
|
+
var f = t.render;
|
|
64
|
+
return t = t.displayName, t || (t = f.displayName || f.name || "", t = t !== "" ? "ForwardRef(" + t + ")" : "ForwardRef"), t;
|
|
65
|
+
case Y:
|
|
66
|
+
return f = t.displayName || null, f !== null ? f : e(t.type) || "Memo";
|
|
67
|
+
case B:
|
|
68
|
+
f = t._payload, t = t._init;
|
|
69
69
|
try {
|
|
70
|
-
return e(t(
|
|
70
|
+
return e(t(f));
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -79,27 +79,27 @@ function qe() {
|
|
|
79
79
|
function o(t) {
|
|
80
80
|
try {
|
|
81
81
|
r(t);
|
|
82
|
-
var
|
|
82
|
+
var f = !1;
|
|
83
83
|
} catch {
|
|
84
|
-
|
|
84
|
+
f = !0;
|
|
85
85
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
|
|
86
|
+
if (f) {
|
|
87
|
+
f = console;
|
|
88
|
+
var x = f.error, w = typeof Symbol == "function" && Symbol.toStringTag && t[Symbol.toStringTag] || t.constructor.name || "Object";
|
|
89
|
+
return x.call(
|
|
90
|
+
f,
|
|
91
91
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
|
-
|
|
92
|
+
w
|
|
93
93
|
), r(t);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
function l(t) {
|
|
97
97
|
if (t === s) return "<>";
|
|
98
|
-
if (typeof t == "object" && t !== null && t.$$typeof ===
|
|
98
|
+
if (typeof t == "object" && t !== null && t.$$typeof === B)
|
|
99
99
|
return "<...>";
|
|
100
100
|
try {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
101
|
+
var f = e(t);
|
|
102
|
+
return f ? "<" + f + ">" : "<...>";
|
|
103
103
|
} catch {
|
|
104
104
|
return "<...>";
|
|
105
105
|
}
|
|
@@ -112,41 +112,41 @@ function qe() {
|
|
|
112
112
|
return Error("react-stack-top-frame");
|
|
113
113
|
}
|
|
114
114
|
function i(t) {
|
|
115
|
-
if (
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
115
|
+
if (Z.call(t, "key")) {
|
|
116
|
+
var f = Object.getOwnPropertyDescriptor(t, "key").get;
|
|
117
|
+
if (f && f.isReactWarning) return !1;
|
|
118
118
|
}
|
|
119
119
|
return t.key !== void 0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
|
|
121
|
+
function h(t, f) {
|
|
122
|
+
function x() {
|
|
123
|
+
g || (g = !0, console.error(
|
|
124
124
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
125
|
-
|
|
125
|
+
f
|
|
126
126
|
));
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
get:
|
|
128
|
+
x.isReactWarning = !0, Object.defineProperty(t, "key", {
|
|
129
|
+
get: x,
|
|
130
130
|
configurable: !0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function E() {
|
|
134
134
|
var t = e(this.type);
|
|
135
|
-
return
|
|
135
|
+
return M[t] || (M[t] = !0, console.error(
|
|
136
136
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
137
137
|
)), t = this.props.ref, t !== void 0 ? t : null;
|
|
138
138
|
}
|
|
139
|
-
function y(t,
|
|
140
|
-
var
|
|
139
|
+
function y(t, f, x, w, z, ee) {
|
|
140
|
+
var R = x.ref;
|
|
141
141
|
return t = {
|
|
142
|
-
$$typeof:
|
|
142
|
+
$$typeof: k,
|
|
143
143
|
type: t,
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
144
|
+
key: f,
|
|
145
|
+
props: x,
|
|
146
|
+
_owner: w
|
|
147
|
+
}, (R !== void 0 ? R : null) !== null ? Object.defineProperty(t, "ref", {
|
|
148
148
|
enumerable: !1,
|
|
149
|
-
get:
|
|
149
|
+
get: E
|
|
150
150
|
}) : Object.defineProperty(t, "ref", { enumerable: !1, value: null }), t._store = {}, Object.defineProperty(t._store, "validated", {
|
|
151
151
|
configurable: !1,
|
|
152
152
|
enumerable: !1,
|
|
@@ -161,109 +161,109 @@ function qe() {
|
|
|
161
161
|
configurable: !1,
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
writable: !0,
|
|
164
|
-
value:
|
|
164
|
+
value: z
|
|
165
165
|
}), Object.defineProperty(t, "_debugTask", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
writable: !0,
|
|
169
|
-
value:
|
|
169
|
+
value: ee
|
|
170
170
|
}), Object.freeze && (Object.freeze(t.props), Object.freeze(t)), t;
|
|
171
171
|
}
|
|
172
|
-
function c(t,
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
function c(t, f, x, w, z, ee) {
|
|
173
|
+
var R = f.children;
|
|
174
|
+
if (R !== void 0)
|
|
175
|
+
if (w)
|
|
176
|
+
if (J(R)) {
|
|
177
|
+
for (w = 0; w < R.length; w++)
|
|
178
|
+
b(R[w]);
|
|
179
|
+
Object.freeze && Object.freeze(R);
|
|
180
180
|
} else
|
|
181
181
|
console.error(
|
|
182
182
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
183
183
|
);
|
|
184
|
-
else
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
184
|
+
else b(R);
|
|
185
|
+
if (Z.call(f, "key")) {
|
|
186
|
+
R = e(t);
|
|
187
|
+
var W = Object.keys(f).filter(function(de) {
|
|
188
|
+
return de !== "key";
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
w = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", ae[R + w] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
191
191
|
`A props object containing a "key" prop is being spread into JSX:
|
|
192
192
|
let props = %s;
|
|
193
193
|
<%s {...props} />
|
|
194
194
|
React keys must be passed directly to JSX without using spread:
|
|
195
195
|
let props = %s;
|
|
196
196
|
<%s key={someKey} {...props} />`,
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
),
|
|
197
|
+
w,
|
|
198
|
+
R,
|
|
199
|
+
W,
|
|
200
|
+
R
|
|
201
|
+
), ae[R + w] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
203
|
+
if (R = null, x !== void 0 && (o(x), R = "" + x), i(f) && (o(f.key), R = "" + f.key), "key" in f) {
|
|
204
|
+
x = {};
|
|
205
|
+
for (var Q in f)
|
|
206
|
+
Q !== "key" && (x[Q] = f[Q]);
|
|
207
|
+
} else x = f;
|
|
208
|
+
return R && h(
|
|
209
|
+
x,
|
|
210
210
|
typeof t == "function" ? t.displayName || t.name || "Unknown" : t
|
|
211
211
|
), y(
|
|
212
212
|
t,
|
|
213
|
+
R,
|
|
213
214
|
x,
|
|
214
|
-
p,
|
|
215
215
|
n(),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
z,
|
|
217
|
+
ee
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
function v(t) {
|
|
221
|
-
b(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === N && (t._payload.status === "fulfilled" ? b(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
222
|
-
}
|
|
223
220
|
function b(t) {
|
|
224
|
-
|
|
221
|
+
p(t) ? t._store && (t._store.validated = 1) : typeof t == "object" && t !== null && t.$$typeof === B && (t._payload.status === "fulfilled" ? p(t._payload.value) && t._payload.value._store && (t._payload.value._store.validated = 1) : t._store && (t._store.validated = 1));
|
|
222
|
+
}
|
|
223
|
+
function p(t) {
|
|
224
|
+
return typeof t == "object" && t !== null && t.$$typeof === k;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var v = ze, k = /* @__PURE__ */ Symbol.for("react.transitional.element"), u = /* @__PURE__ */ Symbol.for("react.portal"), s = /* @__PURE__ */ Symbol.for("react.fragment"), m = /* @__PURE__ */ Symbol.for("react.strict_mode"), I = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.consumer"), S = /* @__PURE__ */ Symbol.for("react.context"), d = /* @__PURE__ */ Symbol.for("react.forward_ref"), F = /* @__PURE__ */ Symbol.for("react.suspense"), V = /* @__PURE__ */ Symbol.for("react.suspense_list"), Y = /* @__PURE__ */ Symbol.for("react.memo"), B = /* @__PURE__ */ Symbol.for("react.lazy"), q = /* @__PURE__ */ Symbol.for("react.activity"), $ = /* @__PURE__ */ Symbol.for("react.client.reference"), H = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, J = Array.isArray, G = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
|
-
|
|
229
|
+
v = {
|
|
230
230
|
react_stack_bottom_frame: function(t) {
|
|
231
231
|
return t();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
234
|
+
var g, M = {}, O = v.react_stack_bottom_frame.bind(
|
|
235
|
+
v,
|
|
236
236
|
a
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
237
|
+
)(), C = G(l(a)), ae = {};
|
|
238
|
+
he.Fragment = s, he.jsx = function(t, f, x) {
|
|
239
|
+
var w = 1e4 > H.recentlyCreatedOwnerStacks++;
|
|
240
240
|
return c(
|
|
241
241
|
t,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
f,
|
|
243
|
+
x,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
w ? Error("react-stack-top-frame") : O,
|
|
246
|
+
w ? G(l(t)) : C
|
|
247
247
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
248
|
+
}, he.jsxs = function(t, f, x) {
|
|
249
|
+
var w = 1e4 > H.recentlyCreatedOwnerStacks++;
|
|
250
250
|
return c(
|
|
251
251
|
t,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
f,
|
|
253
|
+
x,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
w ? Error("react-stack-top-frame") : O,
|
|
256
|
+
w ? G(l(t)) : C
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), he;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
261
|
+
var Oe;
|
|
262
|
+
function at() {
|
|
263
|
+
return Oe || (Oe = 1, process.env.NODE_ENV === "production" ? ge.exports = nt() : ge.exports = ot()), ge.exports;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
const
|
|
265
|
+
var N = at();
|
|
266
|
+
const st = (e, r, o) => {
|
|
267
267
|
const l = [];
|
|
268
268
|
for (let n = r; n < o; n++) {
|
|
269
269
|
const a = e[n];
|
|
@@ -272,7 +272,7 @@ const Qe = (e, r, o) => {
|
|
|
272
272
|
l.push(i);
|
|
273
273
|
}
|
|
274
274
|
return l;
|
|
275
|
-
},
|
|
275
|
+
}, lt = (e, r, o) => {
|
|
276
276
|
const l = [];
|
|
277
277
|
for (let n = r; n < o; n++) {
|
|
278
278
|
const a = e[n];
|
|
@@ -281,36 +281,36 @@ const Qe = (e, r, o) => {
|
|
|
281
281
|
l.push(i);
|
|
282
282
|
}
|
|
283
283
|
return l;
|
|
284
|
-
},
|
|
284
|
+
}, it = (e, r, o, l) => {
|
|
285
285
|
const n = Math.max(1, Math.floor(r * l)), a = Math.max(1, Math.floor(o * l));
|
|
286
286
|
(e.width !== n || e.height !== a) && (e.width = n, e.height = a);
|
|
287
287
|
const i = e.style;
|
|
288
288
|
i.width !== `${r}px` && (i.width = `${r}px`), i.height !== `${o}px` && (i.height = `${o}px`);
|
|
289
|
-
},
|
|
289
|
+
}, ct = (e, r, o) => {
|
|
290
290
|
e.lineWidth = o, e.beginPath();
|
|
291
291
|
for (const l of r)
|
|
292
292
|
e.moveTo(l.x1, l.y1), e.lineTo(l.x2, l.y2);
|
|
293
293
|
e.stroke();
|
|
294
|
-
},
|
|
294
|
+
}, ut = (e, r) => {
|
|
295
295
|
const o = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
296
296
|
if (!o)
|
|
297
297
|
return null;
|
|
298
298
|
let l = o[1];
|
|
299
|
-
l.length === 3 && (l = l.split("").map((
|
|
299
|
+
l.length === 3 && (l = l.split("").map((h) => h + h).join(""));
|
|
300
300
|
const n = Number.parseInt(l.slice(0, 2), 16), a = Number.parseInt(l.slice(2, 4), 16), i = Number.parseInt(l.slice(4, 6), 16);
|
|
301
301
|
return `rgba(${n}, ${a}, ${i}, ${r})`;
|
|
302
|
-
},
|
|
302
|
+
}, dt = (e, r, o, l) => {
|
|
303
303
|
if (r.length === 0)
|
|
304
304
|
return;
|
|
305
|
-
const n =
|
|
305
|
+
const n = ut(o, 0.14), a = e.strokeStyle, i = e.fillStyle, h = e.lineWidth, E = e.lineCap, y = e.lineJoin;
|
|
306
306
|
e.strokeStyle = o, e.lineCap = "round", e.lineJoin = "round";
|
|
307
307
|
for (const c of r) {
|
|
308
|
-
const
|
|
309
|
-
n && (e.fillStyle = n, e.beginPath(), e.arc(c.centerX, c.centerY, u, 0, Math.PI * 2), e.fill()), e.lineWidth =
|
|
308
|
+
const b = l ?? c.size, p = Math.max(0, b / 2), v = Math.max(1, Math.round(b * 0.08)), k = Math.max(1, Math.round(b * 0.14)), u = Math.max(0, p - v * 0.8), s = Math.max(0, u * 0.55);
|
|
309
|
+
n && (e.fillStyle = n, e.beginPath(), e.arc(c.centerX, c.centerY, u, 0, Math.PI * 2), e.fill()), e.lineWidth = v, e.beginPath(), e.arc(c.centerX, c.centerY, Math.max(0, p - v * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = k, e.beginPath(), e.moveTo(c.centerX - s, c.centerY), e.lineTo(c.centerX + s, c.centerY), e.stroke(), c.isExpanded || (e.beginPath(), e.moveTo(c.centerX, c.centerY - s), e.lineTo(c.centerX, c.centerY + s), e.stroke());
|
|
310
310
|
}
|
|
311
|
-
e.strokeStyle = a, e.fillStyle = i, e.lineWidth =
|
|
312
|
-
},
|
|
313
|
-
const
|
|
311
|
+
e.strokeStyle = a, e.fillStyle = i, e.lineWidth = h, e.lineCap = E, e.lineJoin = y;
|
|
312
|
+
}, De = $e(({ segmentsByItem: e, glyphsByItem: r, itemHeight: o, width: l, viewportHeight: n, scrollPosition: a, color: i = "#a0aec0", strokeWidth: h = 1, renderStartIndex: E, renderEndIndex: y, lookaheadEndIndex: c, devicePixelRatio: b, expandGlyphColor: p, expandGlyphSize: v }) => {
|
|
313
|
+
const k = ce(null), u = ce(null), s = ce({
|
|
314
314
|
segmentsByItem: e,
|
|
315
315
|
glyphsByItem: r,
|
|
316
316
|
itemHeight: o,
|
|
@@ -318,46 +318,46 @@ const Qe = (e, r, o) => {
|
|
|
318
318
|
viewportHeight: n,
|
|
319
319
|
scrollPosition: a,
|
|
320
320
|
color: i,
|
|
321
|
-
strokeWidth:
|
|
322
|
-
renderStartIndex:
|
|
321
|
+
strokeWidth: h,
|
|
322
|
+
renderStartIndex: E,
|
|
323
323
|
renderEndIndex: y,
|
|
324
324
|
lookaheadEndIndex: c,
|
|
325
|
-
devicePixelRatio:
|
|
326
|
-
expandGlyphColor:
|
|
327
|
-
expandGlyphSize:
|
|
328
|
-
}),
|
|
325
|
+
devicePixelRatio: b,
|
|
326
|
+
expandGlyphColor: p,
|
|
327
|
+
expandGlyphSize: v
|
|
328
|
+
}), m = P(() => {
|
|
329
329
|
u.current = null;
|
|
330
|
-
const
|
|
331
|
-
if (!
|
|
330
|
+
const T = k.current;
|
|
331
|
+
if (!T)
|
|
332
332
|
return;
|
|
333
|
-
const S =
|
|
333
|
+
const S = T.getContext("2d");
|
|
334
334
|
if (!S)
|
|
335
335
|
return;
|
|
336
336
|
const d = s.current;
|
|
337
337
|
if (d.width <= 0 || d.viewportHeight <= 0) {
|
|
338
|
-
S.clearRect(0, 0,
|
|
338
|
+
S.clearRect(0, 0, T.width, T.height);
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
|
-
const
|
|
342
|
-
|
|
343
|
-
const
|
|
341
|
+
const F = Number.isFinite(d.devicePixelRatio ?? NaN) ? d.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
|
|
342
|
+
it(T, d.width, d.viewportHeight, F);
|
|
343
|
+
const V = d.segmentsByItem.length, Y = typeof d.renderStartIndex == "number" && Number.isFinite(d.renderStartIndex) ? Math.max(0, Math.floor(d.renderStartIndex)) : Math.max(0, Math.floor(d.scrollPosition / d.itemHeight)), B = Math.min(V, Math.ceil((d.scrollPosition + d.viewportHeight) / d.itemHeight)), q = (() => {
|
|
344
344
|
if (typeof d.renderEndIndex == "number" && Number.isFinite(d.renderEndIndex)) {
|
|
345
|
-
const
|
|
346
|
-
return Math.max(Math.min(
|
|
345
|
+
const J = Math.floor(d.renderEndIndex);
|
|
346
|
+
return Math.max(Math.min(V, J + 1), Y);
|
|
347
347
|
}
|
|
348
|
-
return Math.max(
|
|
349
|
-
})(),
|
|
348
|
+
return Math.max(B, Y);
|
|
349
|
+
})(), $ = (() => {
|
|
350
350
|
if (typeof d.lookaheadEndIndex == "number" && Number.isFinite(d.lookaheadEndIndex)) {
|
|
351
|
-
const
|
|
352
|
-
return Math.max(
|
|
351
|
+
const J = Math.floor(d.lookaheadEndIndex), G = Math.min(V, J + 1);
|
|
352
|
+
return Math.max(G, q);
|
|
353
353
|
}
|
|
354
|
-
return Math.max(
|
|
355
|
-
})(), H =
|
|
356
|
-
S.save(), S.scale(
|
|
357
|
-
}, []),
|
|
358
|
-
u.current === null && (u.current = window.requestAnimationFrame(
|
|
359
|
-
}, [
|
|
360
|
-
return
|
|
354
|
+
return Math.max(B, q);
|
|
355
|
+
})(), H = st(d.segmentsByItem, Y, $), Z = lt(d.glyphsByItem, Y, $);
|
|
356
|
+
S.save(), S.scale(F, F), S.clearRect(0, 0, d.width, d.viewportHeight), S.translate(0, -d.scrollPosition), S.strokeStyle = d.color, ct(S, H, d.strokeWidth), dt(S, Z, d.expandGlyphColor ?? d.color, d.expandGlyphSize), S.restore();
|
|
357
|
+
}, []), I = P(() => {
|
|
358
|
+
u.current === null && (u.current = window.requestAnimationFrame(m));
|
|
359
|
+
}, [m]);
|
|
360
|
+
return K(() => {
|
|
361
361
|
s.current = {
|
|
362
362
|
segmentsByItem: e,
|
|
363
363
|
glyphsByItem: r,
|
|
@@ -366,20 +366,20 @@ const Qe = (e, r, o) => {
|
|
|
366
366
|
viewportHeight: n,
|
|
367
367
|
scrollPosition: a,
|
|
368
368
|
color: i,
|
|
369
|
-
strokeWidth:
|
|
370
|
-
renderStartIndex:
|
|
369
|
+
strokeWidth: h,
|
|
370
|
+
renderStartIndex: E,
|
|
371
371
|
renderEndIndex: y,
|
|
372
372
|
lookaheadEndIndex: c,
|
|
373
|
-
devicePixelRatio:
|
|
374
|
-
expandGlyphColor:
|
|
375
|
-
expandGlyphSize:
|
|
376
|
-
},
|
|
377
|
-
}, [e, r, o, l, n, a, i,
|
|
373
|
+
devicePixelRatio: b,
|
|
374
|
+
expandGlyphColor: p,
|
|
375
|
+
expandGlyphSize: v
|
|
376
|
+
}, I();
|
|
377
|
+
}, [e, r, o, l, n, a, i, h, E, y, c, b, p, v, I]), K(() => () => {
|
|
378
378
|
u.current !== null && (window.cancelAnimationFrame(u.current), u.current = null);
|
|
379
|
-
}, []), /* @__PURE__ */
|
|
379
|
+
}, []), /* @__PURE__ */ N.jsx("canvas", { ref: k, className: "pointer-events-none absolute top-0 left-0 z-0" });
|
|
380
380
|
});
|
|
381
|
-
|
|
382
|
-
const
|
|
381
|
+
De.displayName = "TreeLineCanvas";
|
|
382
|
+
const L = {
|
|
383
383
|
container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[5px] pr-[3px]",
|
|
384
384
|
containerPending: "opacity-70",
|
|
385
385
|
entry: "directory-tree-entry flex items-center cursor-pointer relative select-none",
|
|
@@ -398,125 +398,125 @@ const $ = {
|
|
|
398
398
|
name: A("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1", "text-gray-700", "dark:text-gray-200"),
|
|
399
399
|
nameDirectory: "directory-tree-name--directory",
|
|
400
400
|
nameSelected: A("directory-tree-name--selected text-blue-800 font-medium", "dark:text-blue-300")
|
|
401
|
-
},
|
|
401
|
+
}, ft = {
|
|
402
402
|
msOverflowStyle: "none",
|
|
403
403
|
scrollbarWidth: "none"
|
|
404
|
-
},
|
|
404
|
+
}, mt = () => {
|
|
405
405
|
let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
|
|
406
406
|
e || (e = document.createElement("style"), e.id = "directory-tree-webkit-scrollbar-hide", e.textContent = ".directory-tree-container::-webkit-scrollbar { display: none; }", document.head.appendChild(e));
|
|
407
|
-
},
|
|
407
|
+
}, ht = (e, r, o, l) => {
|
|
408
408
|
const n = [], a = [];
|
|
409
409
|
let i = 0;
|
|
410
|
-
const
|
|
411
|
-
for (let
|
|
412
|
-
const
|
|
413
|
-
let
|
|
414
|
-
l && (
|
|
415
|
-
id:
|
|
416
|
-
name:
|
|
417
|
-
absolutePath:
|
|
418
|
-
indentLevel:
|
|
419
|
-
isLastChild:
|
|
410
|
+
const h = (E, y, c) => {
|
|
411
|
+
for (let b = 0; b < E.length; b++) {
|
|
412
|
+
const p = E[b], v = b === E.length - 1, k = [...c, v], u = p.children !== void 0, s = u && r(p.absolutePath, p.relativePath);
|
|
413
|
+
let m = y, I = k, T = c;
|
|
414
|
+
l && (m = y - 1, I = k.slice(1), T = c.slice(1)), n.push({ entry: p, indentLevel: m, parentIsLast: I }), o && (m > i && (i = m), a.push({
|
|
415
|
+
id: p.absolutePath,
|
|
416
|
+
name: p.name,
|
|
417
|
+
absolutePath: p.absolutePath,
|
|
418
|
+
indentLevel: m,
|
|
419
|
+
isLastChild: v,
|
|
420
420
|
isDirectory: u,
|
|
421
421
|
isExpanded: s,
|
|
422
|
-
ancestorIsLast: [...
|
|
422
|
+
ancestorIsLast: [...T],
|
|
423
423
|
hideLines: l && y === 0
|
|
424
|
-
})), u && s &&
|
|
424
|
+
})), u && s && p.children && h(p.children, y + 1, k);
|
|
425
425
|
}
|
|
426
426
|
};
|
|
427
|
-
return
|
|
428
|
-
},
|
|
429
|
-
const a = l?.renderStart ?? Math.max(0, Math.floor(n /
|
|
430
|
-
return { renderStart: a, renderEnd:
|
|
431
|
-
},
|
|
427
|
+
return h(e, 0, []), { flatItems: n, lineItems: a, maxIndent: i };
|
|
428
|
+
}, yt = (e, r, o, l, n) => {
|
|
429
|
+
const a = l?.renderStart ?? Math.max(0, Math.floor(n / ue)), i = r > 0 ? Math.ceil(r / ue) + o : o, h = e > 0 ? Math.min(e - 1, a + i) : a, E = l?.renderEnd ?? h, y = e > 0 ? Math.min(e - 1, E + o) : E;
|
|
430
|
+
return { renderStart: a, renderEnd: E, lookaheadEnd: y };
|
|
431
|
+
}, pt = ({ isDirectory: e, isExpanded: r, showExpandIcons: o, useCanvasExpandIcons: l, expandIconSize: n }) => {
|
|
432
432
|
const a = n ? { width: n, height: n } : void 0, i = n ? "" : "h-4 w-4";
|
|
433
|
-
return !(o && e) || l ? /* @__PURE__ */
|
|
434
|
-
},
|
|
433
|
+
return !(o && e) || l ? /* @__PURE__ */ N.jsx("span", { className: i, style: a, "aria-hidden": "true" }) : r ? /* @__PURE__ */ N.jsx(et, { className: i, style: a }) : /* @__PURE__ */ N.jsx(tt, { className: i, style: a });
|
|
434
|
+
}, bt = (e) => e.slice((e.lastIndexOf(".") - 1 >>> 0) + 2).toLowerCase(), vt = (e, r, o, l, n) => {
|
|
435
435
|
if (e.length === 0)
|
|
436
436
|
return { segmentsByItem: [], glyphsByItem: [] };
|
|
437
|
-
const a = Array.from({ length: e.length }, () => []), i = Array.from({ length: e.length }, () => []),
|
|
437
|
+
const a = Array.from({ length: e.length }, () => []), i = Array.from({ length: e.length }, () => []), h = l ? typeof n == "number" && Number.isFinite(n) && n > 0 ? n : Math.max(8, Math.min(o * 0.9, r * 0.7)) : 0, E = 3;
|
|
438
438
|
for (let y = 0; y < e.length; y++) {
|
|
439
439
|
const c = e[y];
|
|
440
440
|
if (c.hideLines)
|
|
441
441
|
continue;
|
|
442
|
-
const
|
|
443
|
-
for (let
|
|
444
|
-
if (c.ancestorIsLast[
|
|
442
|
+
const b = [], p = y * r, v = p + r / 2, k = h > 0 ? h / 2 + 2 : o / 1.5;
|
|
443
|
+
for (let m = 0; m < c.indentLevel; m++) {
|
|
444
|
+
if (c.ancestorIsLast[m] ?? !1)
|
|
445
445
|
continue;
|
|
446
|
-
let
|
|
446
|
+
let T = !1;
|
|
447
447
|
for (let S = y; S < e.length; S++) {
|
|
448
448
|
const d = e[S];
|
|
449
|
-
if (d.indentLevel >
|
|
450
|
-
|
|
449
|
+
if (d.indentLevel > m && d.ancestorIsLast.length > m && !d.ancestorIsLast[m]) {
|
|
450
|
+
T = !0;
|
|
451
451
|
break;
|
|
452
452
|
}
|
|
453
|
-
if (S > y && d.indentLevel ===
|
|
453
|
+
if (S > y && d.indentLevel === m)
|
|
454
454
|
break;
|
|
455
455
|
}
|
|
456
|
-
if (
|
|
457
|
-
const S =
|
|
458
|
-
|
|
459
|
-
key: `${c.id}-ancestor-${
|
|
456
|
+
if (T) {
|
|
457
|
+
const S = m * o + o / 2 + E;
|
|
458
|
+
b.push({
|
|
459
|
+
key: `${c.id}-ancestor-${m}`,
|
|
460
460
|
x1: S,
|
|
461
|
-
y1:
|
|
461
|
+
y1: p,
|
|
462
462
|
x2: S,
|
|
463
|
-
y2:
|
|
463
|
+
y2: p + r,
|
|
464
464
|
itemIndex: y
|
|
465
465
|
});
|
|
466
466
|
}
|
|
467
467
|
}
|
|
468
|
-
const u = c.indentLevel * o, s = u + o / 2 +
|
|
469
|
-
if (c.isDirectory ?
|
|
468
|
+
const u = c.indentLevel * o, s = u + o / 2 + E;
|
|
469
|
+
if (c.isDirectory ? b.push({
|
|
470
470
|
key: `${c.id}-connector-top`,
|
|
471
471
|
x1: s,
|
|
472
|
-
y1:
|
|
472
|
+
y1: p,
|
|
473
473
|
x2: s,
|
|
474
|
-
y2:
|
|
474
|
+
y2: v - k,
|
|
475
475
|
itemIndex: y
|
|
476
|
-
}) :
|
|
476
|
+
}) : b.push({
|
|
477
477
|
key: `${c.id}-connector-top`,
|
|
478
478
|
x1: s,
|
|
479
|
-
y1:
|
|
479
|
+
y1: p,
|
|
480
480
|
x2: s,
|
|
481
|
-
y2:
|
|
481
|
+
y2: v,
|
|
482
482
|
itemIndex: y
|
|
483
|
-
}), !c.isDirectory && c.isLastChild &&
|
|
483
|
+
}), !c.isDirectory && c.isLastChild && b.push({
|
|
484
484
|
key: `${c.id}-connector-horizontal`,
|
|
485
485
|
x1: s,
|
|
486
|
-
y1:
|
|
487
|
-
x2: u + o +
|
|
488
|
-
y2:
|
|
486
|
+
y1: v,
|
|
487
|
+
x2: u + o + E,
|
|
488
|
+
y2: v,
|
|
489
489
|
itemIndex: y
|
|
490
|
-
}), c.isLastChild || (c.isDirectory ?
|
|
490
|
+
}), c.isLastChild || (c.isDirectory ? b.push({
|
|
491
491
|
key: `${c.id}-connector-bottom`,
|
|
492
492
|
x1: s,
|
|
493
|
-
y1:
|
|
493
|
+
y1: v + k,
|
|
494
494
|
x2: s,
|
|
495
|
-
y2:
|
|
495
|
+
y2: p + r,
|
|
496
496
|
itemIndex: y
|
|
497
|
-
}) :
|
|
497
|
+
}) : b.push({
|
|
498
498
|
key: `${c.id}-connector-bottom`,
|
|
499
499
|
x1: s,
|
|
500
|
-
y1:
|
|
500
|
+
y1: v,
|
|
501
501
|
x2: s,
|
|
502
|
-
y2:
|
|
502
|
+
y2: p + r,
|
|
503
503
|
itemIndex: y
|
|
504
|
-
})), a[y] =
|
|
505
|
-
const
|
|
504
|
+
})), a[y] = b, l && c.isDirectory) {
|
|
505
|
+
const m = h, I = s, T = v;
|
|
506
506
|
i[y] = [
|
|
507
507
|
{
|
|
508
508
|
key: `${c.id}-glyph`,
|
|
509
509
|
itemIndex: y,
|
|
510
|
-
centerX:
|
|
511
|
-
centerY:
|
|
512
|
-
size:
|
|
510
|
+
centerX: I,
|
|
511
|
+
centerY: T,
|
|
512
|
+
size: m,
|
|
513
513
|
isExpanded: c.isExpanded
|
|
514
514
|
}
|
|
515
515
|
];
|
|
516
516
|
}
|
|
517
517
|
}
|
|
518
518
|
return { segmentsByItem: a, glyphsByItem: i };
|
|
519
|
-
},
|
|
519
|
+
}, Se = (e, r) => {
|
|
520
520
|
if (e == null || typeof e == "boolean") return null;
|
|
521
521
|
if (typeof e == "function")
|
|
522
522
|
return console.warn(`[DirectoryTree] Function returned by renderer for "${r}". Return a node.`), null;
|
|
@@ -524,7 +524,7 @@ const $ = {
|
|
|
524
524
|
if ("then" in e)
|
|
525
525
|
return console.warn(`[DirectoryTree] Promise returned for "${r}". Not supported.`), null;
|
|
526
526
|
if (Array.isArray(e)) {
|
|
527
|
-
const l = e.map((n) =>
|
|
527
|
+
const l = e.map((n) => Se(n, r)).filter(Boolean);
|
|
528
528
|
return l.length ? l : null;
|
|
529
529
|
}
|
|
530
530
|
const o = e.type;
|
|
@@ -532,11 +532,11 @@ const $ = {
|
|
|
532
532
|
return console.warn(`[DirectoryTree] Lazy component for "${r}". Not supported.`), null;
|
|
533
533
|
}
|
|
534
534
|
return e;
|
|
535
|
-
},
|
|
535
|
+
}, gt = (e, r) => {
|
|
536
536
|
const { entry: o, isDirectory: l, isExpanded: n, extension: a } = e;
|
|
537
537
|
let i;
|
|
538
|
-
return o.icon !== void 0 ? i = o.icon : l ? i = n && r?.directoryExpanded || r?.directory || /* @__PURE__ */
|
|
539
|
-
},
|
|
538
|
+
return o.icon !== void 0 ? i = o.icon : l ? i = n && r?.directoryExpanded || r?.directory || /* @__PURE__ */ N.jsx(Qe, { className: "h-4 w-4" }) : a && r?.fileByExtension?.[a] ? i = r.fileByExtension[a] : i = r?.file || (a === "md" ? /* @__PURE__ */ N.jsx(Ke, { className: "h-4 w-4" }) : /* @__PURE__ */ N.jsx(rt, { className: "h-4 w-4" })), Se(typeof i == "function" ? i(e) : i, o.absolutePath);
|
|
539
|
+
}, ke = $e(
|
|
540
540
|
({
|
|
541
541
|
entry: e,
|
|
542
542
|
indentLevel: r,
|
|
@@ -544,258 +544,320 @@ const $ = {
|
|
|
544
544
|
parentIsLast: l,
|
|
545
545
|
renderChildren: n = !0,
|
|
546
546
|
expansion: { toggleDirectory: a, onToggleDirectoryRecursive: i },
|
|
547
|
-
selection: { onEntryClick:
|
|
548
|
-
visual: {
|
|
547
|
+
selection: { onEntryClick: h, selectedPath: E, mode: y = "none", selectedItems: c, onSelectionChange: b },
|
|
548
|
+
visual: {
|
|
549
|
+
iconOverrides: p,
|
|
550
|
+
showExpandIcons: v = !0,
|
|
551
|
+
showDirectoryIcons: k = !0,
|
|
552
|
+
showFileIcons: u = !0,
|
|
553
|
+
useCanvasExpandIcons: s = !1,
|
|
554
|
+
expandIconSize: m,
|
|
555
|
+
highlightStyles: I,
|
|
556
|
+
entryClassName: T,
|
|
557
|
+
entryStyle: S,
|
|
558
|
+
nameClassName: d,
|
|
559
|
+
nameStyle: F,
|
|
560
|
+
directoryNameClassName: V,
|
|
561
|
+
directoryNameStyle: Y,
|
|
562
|
+
fileNameClassName: B,
|
|
563
|
+
fileNameStyle: q
|
|
564
|
+
}
|
|
549
565
|
}) => {
|
|
550
|
-
const
|
|
551
|
-
|
|
566
|
+
const $ = ce(null), [H, Z] = oe(null), [J, G] = oe(!1);
|
|
567
|
+
K(
|
|
552
568
|
() => () => {
|
|
553
|
-
|
|
569
|
+
$.current && window.clearTimeout($.current);
|
|
554
570
|
},
|
|
555
571
|
[]
|
|
556
572
|
);
|
|
557
|
-
const
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
}, [
|
|
561
|
-
const
|
|
562
|
-
(
|
|
563
|
-
|
|
564
|
-
let
|
|
565
|
-
|
|
573
|
+
const g = e.children !== void 0, M = g && o(e.absolutePath), O = e.absolutePath === E, C = !g && c?.has(e.absolutePath), ae = g ? void 0 : bt(e.name);
|
|
574
|
+
K(() => {
|
|
575
|
+
Z(M && e.children ? e.children : null);
|
|
576
|
+
}, [M, e.children]);
|
|
577
|
+
const t = P(
|
|
578
|
+
(D) => {
|
|
579
|
+
D.stopPropagation(), y !== "none" && !g && b && b(e, !C);
|
|
580
|
+
let se = !1;
|
|
581
|
+
h({
|
|
566
582
|
entry: e,
|
|
567
|
-
isDirectory:
|
|
568
|
-
isExpanded:
|
|
583
|
+
isDirectory: g,
|
|
584
|
+
isExpanded: M,
|
|
569
585
|
preventDefault: () => {
|
|
570
|
-
|
|
586
|
+
se = !0;
|
|
571
587
|
}
|
|
572
|
-
}), !(!
|
|
573
|
-
a(e.absolutePath),
|
|
588
|
+
}), !(!g || se) && ($.current ? (window.clearTimeout($.current), $.current = null, i(e)) : $.current = window.setTimeout(() => {
|
|
589
|
+
a(e.absolutePath), $.current = null;
|
|
574
590
|
}, 500));
|
|
575
591
|
},
|
|
576
|
-
[
|
|
577
|
-
),
|
|
578
|
-
if (
|
|
579
|
-
if (
|
|
580
|
-
return
|
|
581
|
-
} else if (
|
|
582
|
-
return
|
|
583
|
-
j && $.entrySelected,
|
|
584
|
-
C && $.entryItemSelected
|
|
585
|
-
);
|
|
592
|
+
[g, e, M, i, a, h, y, b, C]
|
|
593
|
+
), f = J ? I?.hoverClassName !== void 0 ? I.hoverClassName : L.entryHover : "", x = (() => {
|
|
594
|
+
if (g) {
|
|
595
|
+
if (O)
|
|
596
|
+
return I?.directorySelectedClassName !== void 0 ? I.directorySelectedClassName : L.entrySelected;
|
|
597
|
+
} else if (O || C)
|
|
598
|
+
return I?.itemSelectedClassName !== void 0 ? I.itemSelectedClassName : A(O && L.entrySelected, C && L.entryItemSelected);
|
|
586
599
|
return "";
|
|
587
|
-
})(),
|
|
588
|
-
...
|
|
589
|
-
...
|
|
590
|
-
...!
|
|
600
|
+
})(), w = A(L.entry, f, x, T, e.className), z = A(L.expandIcon, (O || C) && L.expandIconSelected), ee = A(L.typeIcon, (O || C) && L.typeIconSelected), R = A(L.name, d, g && L.nameDirectory, g && V, !g && B, (O || C) && L.nameSelected), W = pt({ isDirectory: g, isExpanded: M, showExpandIcons: v, useCanvasExpandIcons: s, expandIconSize: m }), Q = (g ? k : u) ? gt({ entry: e, isDirectory: g, isExpanded: M, isSelected: O, isItemSelected: !!C, extension: ae }, p) : null, de = {
|
|
601
|
+
...J ? I?.hoverStyle : {},
|
|
602
|
+
...g && O ? I?.directorySelectedStyle : {},
|
|
603
|
+
...!g && (O || C) ? I?.itemSelectedStyle : {}
|
|
591
604
|
};
|
|
592
|
-
return /* @__PURE__ */
|
|
593
|
-
/* @__PURE__ */
|
|
605
|
+
return /* @__PURE__ */ N.jsxs(Ue, { children: [
|
|
606
|
+
/* @__PURE__ */ N.jsxs(
|
|
594
607
|
"div",
|
|
595
608
|
{
|
|
596
|
-
className:
|
|
609
|
+
className: w,
|
|
597
610
|
style: {
|
|
598
|
-
paddingLeft: `${Math.max(0, r *
|
|
599
|
-
transform: r < 0 ? `translateX(${r *
|
|
600
|
-
width: r < 0 ? `calc(100% + ${Math.abs(r *
|
|
601
|
-
height: `${
|
|
602
|
-
...
|
|
611
|
+
paddingLeft: `${Math.max(0, r * ye)}px`,
|
|
612
|
+
transform: r < 0 ? `translateX(${r * ye}px)` : void 0,
|
|
613
|
+
width: r < 0 ? `calc(100% + ${Math.abs(r * ye)}px)` : void 0,
|
|
614
|
+
height: `${ue}px`,
|
|
615
|
+
...de,
|
|
616
|
+
...S,
|
|
603
617
|
...e.style
|
|
604
618
|
},
|
|
605
|
-
"data-entry-type":
|
|
606
|
-
"data-entry-expanded":
|
|
607
|
-
"data-entry-selected":
|
|
619
|
+
"data-entry-type": g ? "directory" : "file",
|
|
620
|
+
"data-entry-expanded": g ? String(M) : void 0,
|
|
621
|
+
"data-entry-selected": O ? "true" : void 0,
|
|
608
622
|
"data-entry-item-selected": C ? "true" : void 0,
|
|
609
|
-
onClick:
|
|
610
|
-
onMouseEnter: () =>
|
|
611
|
-
onMouseLeave: () =>
|
|
612
|
-
onKeyDown: (
|
|
623
|
+
onClick: t,
|
|
624
|
+
onMouseEnter: () => G(!0),
|
|
625
|
+
onMouseLeave: () => G(!1),
|
|
626
|
+
onKeyDown: (D) => D.key === "Enter" && t(D),
|
|
613
627
|
tabIndex: 0,
|
|
614
628
|
role: "treeitem",
|
|
615
|
-
"aria-expanded":
|
|
616
|
-
"aria-label": `${e.name} (${
|
|
629
|
+
"aria-expanded": g ? M : void 0,
|
|
630
|
+
"aria-label": `${e.name} (${g ? "directory" : "file"})`,
|
|
617
631
|
children: [
|
|
618
|
-
(
|
|
619
|
-
(
|
|
620
|
-
/* @__PURE__ */
|
|
632
|
+
(v || s) && /* @__PURE__ */ N.jsx("span", { className: z, children: W }),
|
|
633
|
+
(g ? k : u) && /* @__PURE__ */ N.jsx("span", { className: ee, children: Q }),
|
|
634
|
+
/* @__PURE__ */ N.jsx(
|
|
635
|
+
"span",
|
|
636
|
+
{
|
|
637
|
+
className: R,
|
|
638
|
+
style: {
|
|
639
|
+
...F,
|
|
640
|
+
...g ? Y : q
|
|
641
|
+
},
|
|
642
|
+
"data-entry-type": g ? "directory" : "file",
|
|
643
|
+
"data-entry-role": "name",
|
|
644
|
+
children: e.label ?? e.name
|
|
645
|
+
}
|
|
646
|
+
)
|
|
621
647
|
]
|
|
622
648
|
}
|
|
623
649
|
),
|
|
624
|
-
|
|
625
|
-
|
|
650
|
+
M && H && n && /* @__PURE__ */ N.jsx("fieldset", { children: H.map((D, se) => /* @__PURE__ */ N.jsx(
|
|
651
|
+
ke,
|
|
626
652
|
{
|
|
627
|
-
entry:
|
|
653
|
+
entry: D,
|
|
628
654
|
indentLevel: r + 1,
|
|
629
655
|
isDirOpen: o,
|
|
630
|
-
parentIsLast: [...l,
|
|
656
|
+
parentIsLast: [...l, se === H.length - 1],
|
|
631
657
|
expansion: { toggleDirectory: a, onToggleDirectoryRecursive: i },
|
|
632
|
-
selection: { onEntryClick:
|
|
658
|
+
selection: { onEntryClick: h, selectedPath: E, mode: y, selectedItems: c, onSelectionChange: b },
|
|
633
659
|
visual: {
|
|
634
|
-
iconOverrides:
|
|
635
|
-
showExpandIcons:
|
|
636
|
-
showDirectoryIcons:
|
|
660
|
+
iconOverrides: p,
|
|
661
|
+
showExpandIcons: v,
|
|
662
|
+
showDirectoryIcons: k,
|
|
637
663
|
showFileIcons: u,
|
|
638
664
|
useCanvasExpandIcons: s,
|
|
639
|
-
expandIconSize:
|
|
640
|
-
highlightStyles:
|
|
665
|
+
expandIconSize: m,
|
|
666
|
+
highlightStyles: I,
|
|
667
|
+
entryClassName: T,
|
|
668
|
+
entryStyle: S,
|
|
669
|
+
nameClassName: d,
|
|
670
|
+
nameStyle: F,
|
|
671
|
+
directoryNameClassName: V,
|
|
672
|
+
directoryNameStyle: Y,
|
|
673
|
+
fileNameClassName: B,
|
|
674
|
+
fileNameStyle: q
|
|
641
675
|
}
|
|
642
676
|
},
|
|
643
|
-
|
|
677
|
+
D.absolutePath
|
|
644
678
|
)) })
|
|
645
679
|
] }, e.absolutePath);
|
|
646
680
|
},
|
|
647
681
|
(e, r) => {
|
|
648
682
|
if (e.entry !== r.entry) return !1;
|
|
649
683
|
const o = e.entry.children !== void 0, l = r.entry.children !== void 0, n = o && e.isDirOpen(e.entry.absolutePath), a = l && r.isDirOpen(r.entry.absolutePath);
|
|
650
|
-
return e.indentLevel === r.indentLevel && n === a && e.selection.selectedPath === r.selection.selectedPath && e.selection.mode === r.selection.mode && e.selection.selectedItems === r.selection.selectedItems && e.visual.iconOverrides === r.visual.iconOverrides && e.visual.showExpandIcons === r.visual.showExpandIcons && e.visual.showDirectoryIcons === r.visual.showDirectoryIcons && e.visual.showFileIcons === r.visual.showFileIcons && e.visual.useCanvasExpandIcons === r.visual.useCanvasExpandIcons && e.visual.expandIconSize === r.visual.expandIconSize && e.visual.highlightStyles === r.visual.highlightStyles && e.parentIsLast.length === r.parentIsLast.length && e.parentIsLast.every((i,
|
|
684
|
+
return e.indentLevel === r.indentLevel && n === a && e.selection.selectedPath === r.selection.selectedPath && e.selection.mode === r.selection.mode && e.selection.selectedItems === r.selection.selectedItems && e.visual.iconOverrides === r.visual.iconOverrides && e.visual.showExpandIcons === r.visual.showExpandIcons && e.visual.showDirectoryIcons === r.visual.showDirectoryIcons && e.visual.showFileIcons === r.visual.showFileIcons && e.visual.useCanvasExpandIcons === r.visual.useCanvasExpandIcons && e.visual.expandIconSize === r.visual.expandIconSize && e.visual.highlightStyles === r.visual.highlightStyles && e.visual.entryClassName === r.visual.entryClassName && e.visual.entryStyle === r.visual.entryStyle && e.visual.nameClassName === r.visual.nameClassName && e.visual.nameStyle === r.visual.nameStyle && e.visual.directoryNameClassName === r.visual.directoryNameClassName && e.visual.directoryNameStyle === r.visual.directoryNameStyle && e.visual.fileNameClassName === r.visual.fileNameClassName && e.visual.fileNameStyle === r.visual.fileNameStyle && e.parentIsLast.length === r.parentIsLast.length && e.parentIsLast.every((i, h) => i === r.parentIsLast[h]);
|
|
651
685
|
}
|
|
652
686
|
);
|
|
653
|
-
|
|
654
|
-
const
|
|
687
|
+
ke.displayName = "DirectoryEntryItem";
|
|
688
|
+
const ue = 20, xt = () => ue, ye = 16, Ae = 12, Le = (e) => {
|
|
655
689
|
const r = [];
|
|
656
690
|
if (e.children)
|
|
657
691
|
for (const o of e.children)
|
|
658
|
-
o.type === "directory" && (r.push(o.absolutePath), r.push(...
|
|
692
|
+
o.type === "directory" && (r.push(o.absolutePath), r.push(...Le(o)));
|
|
659
693
|
return r;
|
|
660
|
-
},
|
|
694
|
+
}, Rt = ({
|
|
661
695
|
entries: e,
|
|
662
|
-
expansion: { toggle: r, isExpanded: o, expandMultiple: l, collapseMultiple: n, isPending: a, alwaysExpanded: i = !1, doubleClickAction:
|
|
663
|
-
selection: { onEntryClick:
|
|
664
|
-
visual: {
|
|
665
|
-
|
|
696
|
+
expansion: { toggle: r, isExpanded: o, expandMultiple: l, collapseMultiple: n, isPending: a, alwaysExpanded: i = !1, doubleClickAction: h = "recursive" },
|
|
697
|
+
selection: { onEntryClick: E, selectedPath: y, mode: c = "none", selectedItems: b, onSelectionChange: p },
|
|
698
|
+
visual: {
|
|
699
|
+
className: v,
|
|
700
|
+
style: k,
|
|
701
|
+
lineColor: u = "#A0AEC0",
|
|
702
|
+
showTreeLines: s = !0,
|
|
703
|
+
showExpandIcons: m = !0,
|
|
704
|
+
showDirectoryIcons: I = !0,
|
|
705
|
+
showFileIcons: T = !0,
|
|
706
|
+
iconOverrides: S,
|
|
707
|
+
expandIconSize: d,
|
|
708
|
+
removeRootIndent: F = !1,
|
|
709
|
+
highlightStyles: V,
|
|
710
|
+
entryClassName: Y,
|
|
711
|
+
entryStyle: B,
|
|
712
|
+
nameClassName: q,
|
|
713
|
+
nameStyle: $,
|
|
714
|
+
directoryNameClassName: H,
|
|
715
|
+
directoryNameStyle: Z,
|
|
716
|
+
fileNameClassName: J,
|
|
717
|
+
fileNameStyle: G
|
|
718
|
+
} = {},
|
|
719
|
+
virtualScroll: g
|
|
666
720
|
}) => {
|
|
667
|
-
const [
|
|
668
|
-
overscanCount:
|
|
669
|
-
className:
|
|
670
|
-
background:
|
|
671
|
-
onScroll:
|
|
672
|
-
onRangeChange:
|
|
673
|
-
initialScrollIndex:
|
|
674
|
-
initialScrollOffset:
|
|
675
|
-
callbackThrottleMs:
|
|
676
|
-
contentInsets:
|
|
677
|
-
onItemFocus:
|
|
678
|
-
viewportHeightOverride:
|
|
679
|
-
scrollBarOptions:
|
|
680
|
-
behaviorOptions:
|
|
681
|
-
} =
|
|
682
|
-
(
|
|
683
|
-
|
|
721
|
+
const [M, O] = oe(!1), C = ce(null), ae = ce(null), [t, f] = oe(0), [x, w] = oe(null), {
|
|
722
|
+
overscanCount: z = 15,
|
|
723
|
+
className: ee,
|
|
724
|
+
background: R,
|
|
725
|
+
onScroll: W,
|
|
726
|
+
onRangeChange: Q,
|
|
727
|
+
initialScrollIndex: de,
|
|
728
|
+
initialScrollOffset: D,
|
|
729
|
+
callbackThrottleMs: se = 5,
|
|
730
|
+
contentInsets: Fe,
|
|
731
|
+
onItemFocus: Ye,
|
|
732
|
+
viewportHeightOverride: U,
|
|
733
|
+
scrollBarOptions: Be,
|
|
734
|
+
behaviorOptions: He
|
|
735
|
+
} = g ?? {}, [pe, we] = oe(typeof D == "number" ? D : 0), We = P(
|
|
736
|
+
(_, re) => {
|
|
737
|
+
we(_), W?.(_, re);
|
|
684
738
|
},
|
|
685
|
-
[
|
|
686
|
-
),
|
|
687
|
-
(
|
|
688
|
-
const { renderingStartIndex:
|
|
689
|
-
|
|
739
|
+
[W]
|
|
740
|
+
), Xe = P(
|
|
741
|
+
(_) => {
|
|
742
|
+
const { renderingStartIndex: re, renderingEndIndex: X } = _;
|
|
743
|
+
w((j) => j && j.renderStart === re && j.renderEnd === X ? j : { renderStart: re, renderEnd: X }), Q?.(_);
|
|
690
744
|
},
|
|
691
|
-
[
|
|
745
|
+
[Q]
|
|
692
746
|
);
|
|
693
|
-
|
|
694
|
-
typeof
|
|
695
|
-
}, [
|
|
696
|
-
|
|
697
|
-
}, []),
|
|
698
|
-
if (typeof
|
|
699
|
-
|
|
747
|
+
K(() => {
|
|
748
|
+
typeof D == "number" && we(D);
|
|
749
|
+
}, [D]), K(() => {
|
|
750
|
+
O(!0), mt();
|
|
751
|
+
}, []), K(() => {
|
|
752
|
+
if (typeof U == "number") {
|
|
753
|
+
f((j) => Math.abs(j - U) > 1 ? U : j);
|
|
700
754
|
return;
|
|
701
755
|
}
|
|
702
|
-
const
|
|
703
|
-
if (!
|
|
756
|
+
const _ = C.current;
|
|
757
|
+
if (!_) return f(0);
|
|
704
758
|
(() => {
|
|
705
|
-
const
|
|
706
|
-
|
|
759
|
+
const j = _.clientHeight;
|
|
760
|
+
f((ne) => Math.abs(ne - j) > 1 ? j : ne);
|
|
707
761
|
})();
|
|
708
|
-
const
|
|
709
|
-
for (const
|
|
710
|
-
|
|
762
|
+
const X = new ResizeObserver((j) => {
|
|
763
|
+
for (const ne of j)
|
|
764
|
+
ne.target === _ && f((Ee) => Math.abs(Ee - ne.contentRect.height) > 1 ? ne.contentRect.height : Ee);
|
|
711
765
|
});
|
|
712
|
-
return
|
|
713
|
-
}, [
|
|
714
|
-
const
|
|
766
|
+
return X.observe(_), () => X.disconnect();
|
|
767
|
+
}, [U]);
|
|
768
|
+
const te = typeof U == "number" ? U : t, le = P((_) => i || (M ? o(_) : !1), [M, o, i]), Re = A(L.container, a && L.containerPending, v), _e = ie(
|
|
715
769
|
() => ({
|
|
716
|
-
...
|
|
717
|
-
...
|
|
718
|
-
...typeof
|
|
770
|
+
...ft,
|
|
771
|
+
...k ?? {},
|
|
772
|
+
...typeof U == "number" ? { height: U, minHeight: U } : {}
|
|
719
773
|
}),
|
|
720
|
-
[
|
|
721
|
-
),
|
|
722
|
-
(
|
|
723
|
-
const
|
|
724
|
-
if (
|
|
725
|
-
if (
|
|
726
|
-
if (
|
|
727
|
-
console.warn(`[DirectoryTree] Unknown double click action: ${
|
|
774
|
+
[k, U]
|
|
775
|
+
), Ve = P(
|
|
776
|
+
(_, re) => {
|
|
777
|
+
const X = [_.absolutePath, ...Le(_)], j = re || h;
|
|
778
|
+
if (X.every((Ie) => le(Ie))) return n(X);
|
|
779
|
+
if (X.every((Ie) => !le(Ie)) || j === "recursive") return l(X);
|
|
780
|
+
if (j === "toggle") return n(X);
|
|
781
|
+
console.warn(`[DirectoryTree] Unknown double click action: ${j}. No action taken.`);
|
|
728
782
|
},
|
|
729
|
-
[
|
|
730
|
-
), { flatItems:
|
|
731
|
-
() => !s ||
|
|
732
|
-
[
|
|
733
|
-
),
|
|
734
|
-
|
|
783
|
+
[le, l, n, h]
|
|
784
|
+
), { flatItems: fe, lineItems: xe, maxIndent: Ne } = ie(() => ht(e, le, s, F), [e, le, s, F]), be = ie(
|
|
785
|
+
() => !s || xe.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : vt(xe, ue, ye, s, d ?? Ae),
|
|
786
|
+
[xe, s, d]
|
|
787
|
+
), ve = ie(() => !s || e.length === 0 ? 0 : (Ne + 2) * ye, [e.length, Ne, s]), { renderStart: Te, renderEnd: Pe, lookaheadEnd: Ce } = ie(() => yt(fe.length, te, z, x, pe), [fe.length, te, z, x, pe]), Je = ie(() => !s || ve <= 0 || te <= 0 || be.segmentsByItem.length === 0 ? null : /* @__PURE__ */ N.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ N.jsx("div", { className: "absolute top-0 left-0", style: { width: ve, height: te }, children: /* @__PURE__ */ N.jsx(
|
|
788
|
+
De,
|
|
735
789
|
{
|
|
736
|
-
segmentsByItem:
|
|
737
|
-
glyphsByItem:
|
|
738
|
-
itemHeight:
|
|
739
|
-
width:
|
|
740
|
-
viewportHeight:
|
|
741
|
-
scrollPosition:
|
|
790
|
+
segmentsByItem: be.segmentsByItem,
|
|
791
|
+
glyphsByItem: be.glyphsByItem,
|
|
792
|
+
itemHeight: ue,
|
|
793
|
+
width: ve,
|
|
794
|
+
viewportHeight: te,
|
|
795
|
+
scrollPosition: pe,
|
|
742
796
|
color: u,
|
|
743
797
|
expandGlyphColor: u,
|
|
744
|
-
expandGlyphSize: d ??
|
|
745
|
-
renderStartIndex:
|
|
746
|
-
renderEndIndex:
|
|
747
|
-
lookaheadEndIndex:
|
|
798
|
+
expandGlyphSize: d ?? Ae,
|
|
799
|
+
renderStartIndex: Te,
|
|
800
|
+
renderEndIndex: Pe,
|
|
801
|
+
lookaheadEndIndex: Ce
|
|
748
802
|
}
|
|
749
|
-
) }) }), [
|
|
750
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
751
|
-
|
|
803
|
+
) }) }), [ve, te, Te, Pe, Ce, pe, be, u, s, d]), Ge = P((_) => fe[_], [fe]);
|
|
804
|
+
return e.length === 0 ? /* @__PURE__ */ N.jsx("div", { className: Re, style: _e }) : /* @__PURE__ */ N.jsx("div", { ref: C, className: Re, style: _e, role: "tree", children: /* @__PURE__ */ N.jsx(
|
|
805
|
+
Ze,
|
|
752
806
|
{
|
|
753
|
-
ref:
|
|
754
|
-
itemCount:
|
|
755
|
-
getItem:
|
|
756
|
-
getItemHeight:
|
|
757
|
-
viewportSize:
|
|
758
|
-
overscanCount:
|
|
759
|
-
onScroll:
|
|
760
|
-
onRangeChange:
|
|
761
|
-
className:
|
|
762
|
-
background: /* @__PURE__ */
|
|
763
|
-
|
|
764
|
-
|
|
807
|
+
ref: ae,
|
|
808
|
+
itemCount: fe.length,
|
|
809
|
+
getItem: Ge,
|
|
810
|
+
getItemHeight: xt,
|
|
811
|
+
viewportSize: te,
|
|
812
|
+
overscanCount: z,
|
|
813
|
+
onScroll: We,
|
|
814
|
+
onRangeChange: Xe,
|
|
815
|
+
className: ee,
|
|
816
|
+
background: /* @__PURE__ */ N.jsxs(N.Fragment, { children: [
|
|
817
|
+
Je,
|
|
818
|
+
R
|
|
765
819
|
] }),
|
|
766
|
-
initialScrollIndex:
|
|
767
|
-
initialScrollOffset:
|
|
768
|
-
onItemFocus:
|
|
769
|
-
callbackThrottleMs:
|
|
770
|
-
contentInsets:
|
|
771
|
-
scrollBarOptions:
|
|
772
|
-
behaviorOptions:
|
|
773
|
-
children: (
|
|
774
|
-
|
|
820
|
+
initialScrollIndex: de,
|
|
821
|
+
initialScrollOffset: D,
|
|
822
|
+
onItemFocus: Ye,
|
|
823
|
+
callbackThrottleMs: se,
|
|
824
|
+
contentInsets: Fe,
|
|
825
|
+
scrollBarOptions: Be,
|
|
826
|
+
behaviorOptions: He,
|
|
827
|
+
children: (_) => _ && /* @__PURE__ */ N.jsx(
|
|
828
|
+
ke,
|
|
775
829
|
{
|
|
776
|
-
entry:
|
|
777
|
-
indentLevel:
|
|
778
|
-
isDirOpen:
|
|
779
|
-
parentIsLast:
|
|
830
|
+
entry: _.entry,
|
|
831
|
+
indentLevel: _.indentLevel,
|
|
832
|
+
isDirOpen: le,
|
|
833
|
+
parentIsLast: _.parentIsLast,
|
|
780
834
|
renderChildren: !1,
|
|
781
|
-
expansion: { toggleDirectory: r, onToggleDirectoryRecursive:
|
|
782
|
-
selection: { onEntryClick:
|
|
835
|
+
expansion: { toggleDirectory: r, onToggleDirectoryRecursive: Ve },
|
|
836
|
+
selection: { onEntryClick: E, selectedPath: y ?? null, mode: c, selectedItems: b, onSelectionChange: p },
|
|
783
837
|
visual: {
|
|
784
838
|
iconOverrides: S,
|
|
785
|
-
showExpandIcons:
|
|
786
|
-
showDirectoryIcons:
|
|
787
|
-
showFileIcons:
|
|
839
|
+
showExpandIcons: m,
|
|
840
|
+
showDirectoryIcons: I,
|
|
841
|
+
showFileIcons: T,
|
|
788
842
|
useCanvasExpandIcons: s,
|
|
789
843
|
expandIconSize: d,
|
|
790
|
-
highlightStyles:
|
|
844
|
+
highlightStyles: V,
|
|
845
|
+
entryClassName: Y,
|
|
846
|
+
entryStyle: B,
|
|
847
|
+
nameClassName: q,
|
|
848
|
+
nameStyle: $,
|
|
849
|
+
directoryNameClassName: H,
|
|
850
|
+
directoryNameStyle: Z,
|
|
851
|
+
fileNameClassName: J,
|
|
852
|
+
fileNameStyle: G
|
|
791
853
|
}
|
|
792
854
|
},
|
|
793
|
-
|
|
855
|
+
_.entry.absolutePath
|
|
794
856
|
)
|
|
795
857
|
}
|
|
796
858
|
) });
|
|
797
|
-
},
|
|
798
|
-
const [o, l] =
|
|
859
|
+
}, _t = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: r } = {}) => {
|
|
860
|
+
const [o, l] = qe(), [n, a] = oe(() => {
|
|
799
861
|
if (typeof window < "u" && r)
|
|
800
862
|
try {
|
|
801
863
|
const u = window.localStorage.getItem(r);
|
|
@@ -807,23 +869,23 @@ const se = 20, ft = () => se, fe = 16, Ce = 12, Oe = (e) => {
|
|
|
807
869
|
console.error("[useDirectoryTreeState] Error reading from localStorage", u);
|
|
808
870
|
}
|
|
809
871
|
return e;
|
|
810
|
-
}), i =
|
|
872
|
+
}), i = P((u) => {
|
|
811
873
|
l(() => {
|
|
812
874
|
a((s) => {
|
|
813
|
-
const
|
|
814
|
-
return u(
|
|
875
|
+
const m = new Set(s);
|
|
876
|
+
return u(m), m;
|
|
815
877
|
});
|
|
816
878
|
});
|
|
817
|
-
}, []),
|
|
879
|
+
}, []), h = P(
|
|
818
880
|
(u, s) => {
|
|
819
|
-
i((
|
|
820
|
-
for (const
|
|
821
|
-
s(
|
|
881
|
+
i((m) => {
|
|
882
|
+
for (const I of u)
|
|
883
|
+
s(m, I);
|
|
822
884
|
});
|
|
823
885
|
},
|
|
824
886
|
[i]
|
|
825
887
|
);
|
|
826
|
-
|
|
888
|
+
K(() => {
|
|
827
889
|
if (r && typeof window < "u")
|
|
828
890
|
try {
|
|
829
891
|
window.localStorage.setItem(r, JSON.stringify(Array.from(n)));
|
|
@@ -831,60 +893,60 @@ const se = 20, ft = () => se, fe = 16, Ce = 12, Oe = (e) => {
|
|
|
831
893
|
console.warn(`Error setting localStorage key "${r}":`, u);
|
|
832
894
|
}
|
|
833
895
|
}, [n, r]);
|
|
834
|
-
const
|
|
896
|
+
const E = P(
|
|
835
897
|
(u) => {
|
|
836
|
-
|
|
837
|
-
s.has(
|
|
898
|
+
h([u], (s, m) => {
|
|
899
|
+
s.has(m) ? s.delete(m) : s.add(m);
|
|
838
900
|
});
|
|
839
901
|
},
|
|
840
|
-
[
|
|
841
|
-
), y =
|
|
902
|
+
[h]
|
|
903
|
+
), y = P(
|
|
842
904
|
(u) => {
|
|
843
|
-
|
|
844
|
-
s.add(
|
|
905
|
+
h([u], (s, m) => {
|
|
906
|
+
s.add(m);
|
|
845
907
|
});
|
|
846
908
|
},
|
|
847
|
-
[
|
|
848
|
-
), c =
|
|
909
|
+
[h]
|
|
910
|
+
), c = P(
|
|
849
911
|
(u) => {
|
|
850
|
-
|
|
851
|
-
s.delete(
|
|
912
|
+
h([u], (s, m) => {
|
|
913
|
+
s.delete(m);
|
|
852
914
|
});
|
|
853
915
|
},
|
|
854
|
-
[
|
|
855
|
-
),
|
|
916
|
+
[h]
|
|
917
|
+
), b = P(
|
|
856
918
|
(u) => {
|
|
857
|
-
|
|
858
|
-
s.delete(
|
|
919
|
+
h(u, (s, m) => {
|
|
920
|
+
s.delete(m);
|
|
859
921
|
});
|
|
860
922
|
},
|
|
861
|
-
[
|
|
862
|
-
),
|
|
923
|
+
[h]
|
|
924
|
+
), p = P(
|
|
863
925
|
(u) => {
|
|
864
|
-
|
|
865
|
-
s.add(
|
|
926
|
+
h(u, (s, m) => {
|
|
927
|
+
s.add(m);
|
|
866
928
|
});
|
|
867
929
|
},
|
|
868
|
-
[
|
|
869
|
-
),
|
|
930
|
+
[h]
|
|
931
|
+
), v = P(() => {
|
|
870
932
|
i((u) => {
|
|
871
933
|
u.clear();
|
|
872
934
|
});
|
|
873
|
-
}, [i]),
|
|
935
|
+
}, [i]), k = P((u) => n.has(u), [n]);
|
|
874
936
|
return {
|
|
875
937
|
expanded: n,
|
|
876
|
-
toggle:
|
|
938
|
+
toggle: E,
|
|
877
939
|
expand: y,
|
|
878
940
|
collapse: c,
|
|
879
|
-
collapseMultiple:
|
|
880
|
-
expandMultiple:
|
|
881
|
-
collapseAll:
|
|
882
|
-
isExpanded:
|
|
941
|
+
collapseMultiple: b,
|
|
942
|
+
expandMultiple: p,
|
|
943
|
+
collapseAll: v,
|
|
944
|
+
isExpanded: k,
|
|
883
945
|
isPending: o
|
|
884
946
|
};
|
|
885
947
|
};
|
|
886
948
|
export {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
949
|
+
Rt as DirectoryTree,
|
|
950
|
+
L as directoryTreeClasses,
|
|
951
|
+
_t as useDirectoryTreeState
|
|
890
952
|
};
|