@aiquants/directory-tree 3.5.1 → 3.6.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/dist/DirectoryTree.d.ts +1 -1
- package/dist/DirectoryTree.d.ts.map +1 -1
- package/dist/DirectoryTreeGrid.d.ts +4 -0
- package/dist/DirectoryTreeGrid.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +804 -779
- package/dist/types.d.ts +15 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DirectoryTree.spec.md +5 -0
- package/src/DirectoryTree.tsx +20 -3
- package/src/DirectoryTreeGrid.tsx +10 -0
- package/src/types.ts +15 -0
package/dist/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { VirtualScroll as
|
|
1
|
+
import or, { useRef as ue, useEffect as me, useCallback as W, memo as Ze, useState as ce, useMemo as Z, useLayoutEffect as lr, Fragment as ir, useTransition as cr } from "react";
|
|
2
|
+
import { VirtualScroll as dr, ScrollBar as ur } from "@aiquants/virtualscroll";
|
|
3
3
|
import { twMerge as _ } from "tailwind-merge";
|
|
4
|
-
import { FolderIcon as
|
|
5
|
-
import { FileMd as
|
|
6
|
-
var De = { exports: {} },
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
4
|
+
import { FolderIcon as mr, ChevronDownIcon as fr, ChevronRightIcon as hr } from "@heroicons/react/24/solid";
|
|
5
|
+
import { FileMd as kt, FilePdf as Nt, FileXls as Et, FileCsv as It, FileDoc as jt, FilePpt as Tt, FileImage as Ct, FileAudio as Rt, FileVideo as Pt, FileZip as _t, FileCode as At, FileText as Mt, FileIcon as pr } from "@phosphor-icons/react";
|
|
6
|
+
var De = { exports: {} }, Te = {};
|
|
7
|
+
var Ot;
|
|
8
|
+
function yr() {
|
|
9
|
+
if (Ot) return Te;
|
|
10
|
+
Ot = 1;
|
|
11
11
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
12
12
|
function a(n, r, o) {
|
|
13
13
|
var l = null;
|
|
14
14
|
if (o !== void 0 && (l = "" + o), r.key !== void 0 && (l = "" + r.key), "key" in r) {
|
|
15
15
|
o = {};
|
|
16
|
-
for (var
|
|
17
|
-
|
|
16
|
+
for (var u in r)
|
|
17
|
+
u !== "key" && (o[u] = r[u]);
|
|
18
18
|
} else o = r;
|
|
19
19
|
return r = o.ref, {
|
|
20
20
|
$$typeof: e,
|
|
@@ -24,50 +24,50 @@ function hr() {
|
|
|
24
24
|
props: o
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
|
-
return
|
|
27
|
+
return Te.Fragment = t, Te.jsx = a, Te.jsxs = a, Te;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
var
|
|
31
|
-
function
|
|
32
|
-
return
|
|
29
|
+
var Ce = {};
|
|
30
|
+
var Ft;
|
|
31
|
+
function xr() {
|
|
32
|
+
return Ft || (Ft = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
33
33
|
function e(s) {
|
|
34
34
|
if (s == null) return null;
|
|
35
35
|
if (typeof s == "function")
|
|
36
|
-
return s.$$typeof ===
|
|
36
|
+
return s.$$typeof === H ? null : s.displayName || s.name || null;
|
|
37
37
|
if (typeof s == "string") return s;
|
|
38
38
|
switch (s) {
|
|
39
|
-
case
|
|
39
|
+
case x:
|
|
40
40
|
return "Fragment";
|
|
41
|
-
case
|
|
41
|
+
case I:
|
|
42
42
|
return "Profiler";
|
|
43
|
-
case
|
|
43
|
+
case k:
|
|
44
44
|
return "StrictMode";
|
|
45
|
-
case O:
|
|
46
|
-
return "Suspense";
|
|
47
45
|
case D:
|
|
46
|
+
return "Suspense";
|
|
47
|
+
case C:
|
|
48
48
|
return "SuspenseList";
|
|
49
|
-
case
|
|
49
|
+
case F:
|
|
50
50
|
return "Activity";
|
|
51
51
|
}
|
|
52
52
|
if (typeof s == "object")
|
|
53
53
|
switch (typeof s.tag == "number" && console.error(
|
|
54
54
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
55
|
), s.$$typeof) {
|
|
56
|
-
case
|
|
56
|
+
case m:
|
|
57
57
|
return "Portal";
|
|
58
|
-
case
|
|
58
|
+
case w:
|
|
59
59
|
return s.displayName || "Context";
|
|
60
60
|
case N:
|
|
61
61
|
return (s._context.displayName || "Context") + ".Consumer";
|
|
62
|
-
case
|
|
63
|
-
var
|
|
64
|
-
return s = s.displayName, s || (s =
|
|
65
|
-
case
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
62
|
+
case h:
|
|
63
|
+
var p = s.render;
|
|
64
|
+
return s = s.displayName, s || (s = p.displayName || p.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
65
|
+
case M:
|
|
66
|
+
return p = s.displayName || null, p !== null ? p : e(s.type) || "Memo";
|
|
67
|
+
case J:
|
|
68
|
+
p = s._payload, s = s._init;
|
|
69
69
|
try {
|
|
70
|
-
return e(s(
|
|
70
|
+
return e(s(p));
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -79,74 +79,74 @@ function pr() {
|
|
|
79
79
|
function a(s) {
|
|
80
80
|
try {
|
|
81
81
|
t(s);
|
|
82
|
-
var
|
|
82
|
+
var p = !1;
|
|
83
83
|
} catch {
|
|
84
|
-
|
|
84
|
+
p = !0;
|
|
85
85
|
}
|
|
86
|
-
if (
|
|
87
|
-
|
|
88
|
-
var
|
|
89
|
-
return
|
|
90
|
-
|
|
86
|
+
if (p) {
|
|
87
|
+
p = console;
|
|
88
|
+
var y = p.error, j = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
89
|
+
return y.call(
|
|
90
|
+
p,
|
|
91
91
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
|
-
|
|
92
|
+
j
|
|
93
93
|
), t(s);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
function n(s) {
|
|
97
|
-
if (s ===
|
|
98
|
-
if (typeof s == "object" && s !== null && s.$$typeof ===
|
|
97
|
+
if (s === x) return "<>";
|
|
98
|
+
if (typeof s == "object" && s !== null && s.$$typeof === J)
|
|
99
99
|
return "<...>";
|
|
100
100
|
try {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
101
|
+
var p = e(s);
|
|
102
|
+
return p ? "<" + p + ">" : "<...>";
|
|
103
103
|
} catch {
|
|
104
104
|
return "<...>";
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
function r() {
|
|
108
|
-
var s =
|
|
108
|
+
var s = q.A;
|
|
109
109
|
return s === null ? null : s.getOwner();
|
|
110
110
|
}
|
|
111
111
|
function o() {
|
|
112
112
|
return Error("react-stack-top-frame");
|
|
113
113
|
}
|
|
114
114
|
function l(s) {
|
|
115
|
-
if (
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
115
|
+
if (K.call(s, "key")) {
|
|
116
|
+
var p = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
117
|
+
if (p && p.isReactWarning) return !1;
|
|
118
118
|
}
|
|
119
119
|
return s.key !== void 0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
|
|
121
|
+
function u(s, p) {
|
|
122
|
+
function y() {
|
|
123
|
+
B || (B = !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
|
+
p
|
|
126
126
|
));
|
|
127
127
|
}
|
|
128
|
-
|
|
129
|
-
get:
|
|
128
|
+
y.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
129
|
+
get: y,
|
|
130
130
|
configurable: !0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function E() {
|
|
134
134
|
var s = e(this.type);
|
|
135
|
-
return
|
|
135
|
+
return Y[s] || (Y[s] = !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
|
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
138
138
|
}
|
|
139
|
-
function
|
|
140
|
-
var
|
|
139
|
+
function b(s, p, y, j, L, G) {
|
|
140
|
+
var P = y.ref;
|
|
141
141
|
return s = {
|
|
142
142
|
$$typeof: S,
|
|
143
143
|
type: s,
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
144
|
+
key: p,
|
|
145
|
+
props: y,
|
|
146
|
+
_owner: j
|
|
147
|
+
}, (P !== void 0 ? P : null) !== null ? Object.defineProperty(s, "ref", {
|
|
148
148
|
enumerable: !1,
|
|
149
|
-
get:
|
|
149
|
+
get: E
|
|
150
150
|
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
151
151
|
configurable: !1,
|
|
152
152
|
enumerable: !1,
|
|
@@ -161,109 +161,109 @@ function pr() {
|
|
|
161
161
|
configurable: !1,
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
writable: !0,
|
|
164
|
-
value:
|
|
164
|
+
value: L
|
|
165
165
|
}), Object.defineProperty(s, "_debugTask", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
writable: !0,
|
|
169
|
-
value:
|
|
169
|
+
value: G
|
|
170
170
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
function d(s, p, y, j, L, G) {
|
|
173
|
+
var P = p.children;
|
|
174
|
+
if (P !== void 0)
|
|
175
|
+
if (j)
|
|
176
|
+
if (R(P)) {
|
|
177
|
+
for (j = 0; j < P.length; j++)
|
|
178
|
+
f(P[j]);
|
|
179
|
+
Object.freeze && Object.freeze(P);
|
|
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 f(P);
|
|
185
|
+
if (K.call(p, "key")) {
|
|
186
|
+
P = e(s);
|
|
187
|
+
var Q = Object.keys(p).filter(function(oe) {
|
|
188
|
+
return oe !== "key";
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
j = 0 < Q.length ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}", A[P + j] || (Q = 0 < Q.length ? "{" + Q.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
|
+
j,
|
|
198
|
+
P,
|
|
199
|
+
Q,
|
|
200
|
+
P
|
|
201
|
+
), A[P + j] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
203
|
+
if (P = null, y !== void 0 && (a(y), P = "" + y), l(p) && (a(p.key), P = "" + p.key), "key" in p) {
|
|
204
|
+
y = {};
|
|
205
|
+
for (var re in p)
|
|
206
|
+
re !== "key" && (y[re] = p[re]);
|
|
207
|
+
} else y = p;
|
|
208
|
+
return P && u(
|
|
209
|
+
y,
|
|
210
210
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
211
|
-
),
|
|
211
|
+
), b(
|
|
212
212
|
s,
|
|
213
|
-
|
|
214
|
-
|
|
213
|
+
P,
|
|
214
|
+
y,
|
|
215
215
|
r(),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
L,
|
|
217
|
+
G
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
220
|
+
function f(s) {
|
|
221
|
+
g(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === J && (s._payload.status === "fulfilled" ? g(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
222
222
|
}
|
|
223
|
-
function
|
|
223
|
+
function g(s) {
|
|
224
224
|
return typeof s == "object" && s !== null && s.$$typeof === S;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var v = or, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), m = /* @__PURE__ */ Symbol.for("react.portal"), x = /* @__PURE__ */ Symbol.for("react.fragment"), k = /* @__PURE__ */ Symbol.for("react.strict_mode"), I = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), w = /* @__PURE__ */ Symbol.for("react.context"), h = /* @__PURE__ */ Symbol.for("react.forward_ref"), D = /* @__PURE__ */ Symbol.for("react.suspense"), C = /* @__PURE__ */ Symbol.for("react.suspense_list"), M = /* @__PURE__ */ Symbol.for("react.memo"), J = /* @__PURE__ */ Symbol.for("react.lazy"), F = /* @__PURE__ */ Symbol.for("react.activity"), H = /* @__PURE__ */ Symbol.for("react.client.reference"), q = v.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, R = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
|
-
|
|
229
|
+
v = {
|
|
230
230
|
react_stack_bottom_frame: function(s) {
|
|
231
231
|
return s();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
235
|
-
|
|
234
|
+
var B, Y = {}, ae = v.react_stack_bottom_frame.bind(
|
|
235
|
+
v,
|
|
236
236
|
o
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
return
|
|
237
|
+
)(), te = z(n(o)), A = {};
|
|
238
|
+
Ce.Fragment = x, Ce.jsx = function(s, p, y) {
|
|
239
|
+
var j = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
240
|
+
return d(
|
|
241
241
|
s,
|
|
242
|
-
|
|
243
|
-
|
|
242
|
+
p,
|
|
243
|
+
y,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
j ? Error("react-stack-top-frame") : ae,
|
|
246
|
+
j ? z(n(s)) : te
|
|
247
247
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
250
|
-
return
|
|
248
|
+
}, Ce.jsxs = function(s, p, y) {
|
|
249
|
+
var j = 1e4 > q.recentlyCreatedOwnerStacks++;
|
|
250
|
+
return d(
|
|
251
251
|
s,
|
|
252
|
-
|
|
253
|
-
|
|
252
|
+
p,
|
|
253
|
+
y,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
j ? Error("react-stack-top-frame") : ae,
|
|
256
|
+
j ? z(n(s)) : te
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), Ce;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
261
|
+
var Dt;
|
|
262
|
+
function br() {
|
|
263
|
+
return Dt || (Dt = 1, process.env.NODE_ENV === "production" ? De.exports = yr() : De.exports = xr()), De.exports;
|
|
264
264
|
}
|
|
265
|
-
var i =
|
|
266
|
-
const Le = 18,
|
|
265
|
+
var i = br();
|
|
266
|
+
const Le = 18, $e = 12, Lt = 10, O = {
|
|
267
267
|
container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
|
|
268
268
|
containerPending: "opacity-70",
|
|
269
269
|
entry: "directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",
|
|
@@ -282,14 +282,14 @@ const Le = 18, Fe = 12, Dt = 10, A = {
|
|
|
282
282
|
name: _("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal", "text-gray-700", "dark:text-gray-200"),
|
|
283
283
|
nameDirectory: "directory-tree-name--directory font-medium",
|
|
284
284
|
nameSelected: _("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
|
|
285
|
-
},
|
|
285
|
+
}, ge = (e) => {
|
|
286
286
|
if (!e) return "";
|
|
287
287
|
const t = e.split("?")[0].split("#")[0].split("/").pop() || e, a = t.lastIndexOf(".");
|
|
288
288
|
return a <= 0 ? "" : t.slice(a + 1).toLowerCase();
|
|
289
|
-
},
|
|
289
|
+
}, Bt = ({ isDirectory: e, isExpanded: t, showExpandIcons: a, useCanvasExpandIcons: n, expandIconSize: r }) => {
|
|
290
290
|
const o = r ? { width: r, height: r } : void 0, l = r ? "" : "h-4 w-4";
|
|
291
|
-
return !(a && e) || n ? /* @__PURE__ */ i.jsx("span", { className: l, style: o, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(
|
|
292
|
-
},
|
|
291
|
+
return !(a && e) || n ? /* @__PURE__ */ i.jsx("span", { className: l, style: o, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(fr, { className: l, style: o }) : /* @__PURE__ */ i.jsx(hr, { className: l, style: o });
|
|
292
|
+
}, Je = (e, t) => {
|
|
293
293
|
if (e == null || typeof e == "boolean") return null;
|
|
294
294
|
if (typeof e == "function")
|
|
295
295
|
return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
|
|
@@ -297,7 +297,7 @@ const Le = 18, Fe = 12, Dt = 10, A = {
|
|
|
297
297
|
if ("then" in e)
|
|
298
298
|
return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
|
|
299
299
|
if (Array.isArray(e)) {
|
|
300
|
-
const n = e.map((r) =>
|
|
300
|
+
const n = e.map((r) => Je(r, t)).filter(Boolean);
|
|
301
301
|
return n.length ? n : null;
|
|
302
302
|
}
|
|
303
303
|
const a = e.type;
|
|
@@ -305,166 +305,170 @@ const Le = 18, Fe = 12, Dt = 10, A = {
|
|
|
305
305
|
return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
|
|
306
306
|
}
|
|
307
307
|
return e;
|
|
308
|
-
},
|
|
309
|
-
const n = (t || (a ?
|
|
308
|
+
}, vr = (e, t, a) => {
|
|
309
|
+
const n = (t || (a ? ge(a) : "")).toLowerCase(), r = (e || "").toLowerCase();
|
|
310
310
|
if (r && r !== "application/octet-stream") {
|
|
311
311
|
if (r === "text/markdown" || r === "text/x-markdown")
|
|
312
|
-
return /* @__PURE__ */ i.jsx(
|
|
312
|
+
return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
|
|
313
313
|
if (r === "application/pdf")
|
|
314
|
-
return /* @__PURE__ */ i.jsx(
|
|
314
|
+
return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
|
|
315
315
|
if (r.includes("excel") || r.includes("spreadsheet") || r.includes("google-apps.spreadsheet"))
|
|
316
|
-
return /* @__PURE__ */ i.jsx(
|
|
316
|
+
return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
317
317
|
if (r === "text/csv" || r === "text/tab-separated-values")
|
|
318
|
-
return /* @__PURE__ */ i.jsx(
|
|
318
|
+
return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
319
319
|
if (r.includes("word") || r.includes("msword") || r.includes("wordprocessingml") || r.includes("google-apps.document") || r === "application/rtf")
|
|
320
|
-
return /* @__PURE__ */ i.jsx(
|
|
320
|
+
return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
|
|
321
321
|
if (r.includes("powerpoint") || r.includes("presentation") || r.includes("google-apps.presentation"))
|
|
322
|
-
return /* @__PURE__ */ i.jsx(
|
|
322
|
+
return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
|
|
323
323
|
if (r.startsWith("image/"))
|
|
324
|
-
return /* @__PURE__ */ i.jsx(
|
|
324
|
+
return /* @__PURE__ */ i.jsx(Ct, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
|
|
325
325
|
if (r.startsWith("audio/"))
|
|
326
|
-
return /* @__PURE__ */ i.jsx(
|
|
326
|
+
return /* @__PURE__ */ i.jsx(Rt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
|
|
327
327
|
if (r.startsWith("video/"))
|
|
328
|
-
return /* @__PURE__ */ i.jsx(
|
|
328
|
+
return /* @__PURE__ */ i.jsx(Pt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
|
|
329
329
|
if (r.includes("zip") || r.includes("tar") || r.includes("compressed") || r.includes("archive"))
|
|
330
|
-
return /* @__PURE__ */ i.jsx(
|
|
330
|
+
return /* @__PURE__ */ i.jsx(_t, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
|
|
331
331
|
if (r === "application/json" || r.includes("javascript") || r.includes("typescript") || r.includes("xml") || r.startsWith("text/html") || r.startsWith("text/css") || r.includes("x-python") || r.includes("x-sh") || r.includes("x-go") || r.includes("x-rust"))
|
|
332
|
-
return /* @__PURE__ */ i.jsx(
|
|
332
|
+
return /* @__PURE__ */ i.jsx(At, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
|
|
333
333
|
if (r.startsWith("text/"))
|
|
334
|
-
return /* @__PURE__ */ i.jsx(
|
|
334
|
+
return /* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
|
|
335
335
|
}
|
|
336
336
|
if (n) {
|
|
337
337
|
if (n === "md" || n === "markdown" || n === "mdx")
|
|
338
|
-
return /* @__PURE__ */ i.jsx(
|
|
338
|
+
return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
|
|
339
339
|
if (n === "pdf")
|
|
340
|
-
return /* @__PURE__ */ i.jsx(
|
|
340
|
+
return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
|
|
341
341
|
if (["xls", "xlsx", "xlsm", "xlsb", "ods"].includes(n))
|
|
342
|
-
return /* @__PURE__ */ i.jsx(
|
|
342
|
+
return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
343
343
|
if (["csv", "tsv"].includes(n))
|
|
344
|
-
return /* @__PURE__ */ i.jsx(
|
|
344
|
+
return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
345
345
|
if (["doc", "docx", "rtf", "odt"].includes(n))
|
|
346
|
-
return /* @__PURE__ */ i.jsx(
|
|
346
|
+
return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
|
|
347
347
|
if (["ppt", "pptx", "odp"].includes(n))
|
|
348
|
-
return /* @__PURE__ */ i.jsx(
|
|
348
|
+
return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
|
|
349
349
|
if (["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp", "tiff", "avif"].includes(n))
|
|
350
|
-
return /* @__PURE__ */ i.jsx(
|
|
350
|
+
return /* @__PURE__ */ i.jsx(Ct, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
|
|
351
351
|
if (["js", "mjs", "cjs", "ts", "tsx", "jsx", "json", "html", "htm", "css", "scss", "py", "go", "rs", "c", "cpp", "h", "hpp", "sh", "bash", "yaml", "yml", "sql", "xml", "toml"].includes(n))
|
|
352
|
-
return /* @__PURE__ */ i.jsx(
|
|
352
|
+
return /* @__PURE__ */ i.jsx(At, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
|
|
353
353
|
if (["mp3", "wav", "ogg", "m4a", "flac", "aac", "wma"].includes(n))
|
|
354
|
-
return /* @__PURE__ */ i.jsx(
|
|
354
|
+
return /* @__PURE__ */ i.jsx(Rt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
|
|
355
355
|
if (["mp4", "webm", "mov", "avi", "mkv", "wmv", "flv"].includes(n))
|
|
356
|
-
return /* @__PURE__ */ i.jsx(
|
|
356
|
+
return /* @__PURE__ */ i.jsx(Pt, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
|
|
357
357
|
if (["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"].includes(n))
|
|
358
|
-
return /* @__PURE__ */ i.jsx(
|
|
358
|
+
return /* @__PURE__ */ i.jsx(_t, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
|
|
359
359
|
if (["txt", "log"].includes(n))
|
|
360
|
-
return /* @__PURE__ */ i.jsx(
|
|
360
|
+
return /* @__PURE__ */ i.jsx(Mt, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
|
|
361
361
|
}
|
|
362
|
-
return /* @__PURE__ */ i.jsx(
|
|
363
|
-
},
|
|
362
|
+
return /* @__PURE__ */ i.jsx(pr, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
|
|
363
|
+
}, zt = (e, t) => {
|
|
364
364
|
const { entry: a, isDirectory: n, isExpanded: r, extension: o, mimeType: l } = e;
|
|
365
|
-
let
|
|
366
|
-
const
|
|
367
|
-
return a.icon !== void 0 ?
|
|
368
|
-
},
|
|
365
|
+
let u;
|
|
366
|
+
const E = l || a.mimeType;
|
|
367
|
+
return a.icon !== void 0 ? u = a.icon : n ? u = r && t?.directoryExpanded || t?.directory || /* @__PURE__ */ i.jsx(mr, { className: "h-4 w-4" }) : o && t?.fileByExtension?.[o] ? u = t.fileByExtension[o] : u = t?.file || vr(E, o, a.name), Je(typeof u == "function" ? u(e) : u, a.absolutePath);
|
|
368
|
+
}, gr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Yt = (e) => {
|
|
369
369
|
if (!e)
|
|
370
370
|
return;
|
|
371
371
|
const t = Object.entries(e).filter(([, a]) => a != null);
|
|
372
372
|
if (t.length !== 0)
|
|
373
|
-
return Object.fromEntries(t.map(([a, n]) => [`data-${
|
|
374
|
-
},
|
|
375
|
-
const
|
|
376
|
-
return
|
|
373
|
+
return Object.fromEntries(t.map(([a, n]) => [`data-${gr(a)}`, String(n)]));
|
|
374
|
+
}, wr = 500, Gt = ({ entry: e, isDirectory: t, isExpanded: a, isItemSelected: n, selectionMode: r, onSelectionChange: o, onEntryClick: l, toggleDirectory: u, onToggleDirectoryRecursive: E }) => {
|
|
375
|
+
const b = ue(null);
|
|
376
|
+
return me(
|
|
377
377
|
() => () => {
|
|
378
|
-
|
|
378
|
+
b.current && window.clearTimeout(b.current);
|
|
379
379
|
},
|
|
380
380
|
[]
|
|
381
381
|
), W(
|
|
382
|
-
(
|
|
383
|
-
|
|
384
|
-
let
|
|
382
|
+
(d) => {
|
|
383
|
+
d.stopPropagation(), r !== "none" && !t && o && o(e, !n);
|
|
384
|
+
let f = !1;
|
|
385
385
|
l({
|
|
386
386
|
entry: e,
|
|
387
387
|
isDirectory: t,
|
|
388
388
|
isExpanded: a,
|
|
389
389
|
preventDefault: () => {
|
|
390
|
-
|
|
390
|
+
f = !0;
|
|
391
391
|
}
|
|
392
|
-
}), !(!t ||
|
|
393
|
-
|
|
394
|
-
},
|
|
392
|
+
}), !(!t || f) && (b.current ? (window.clearTimeout(b.current), b.current = null, E(e)) : b.current = window.setTimeout(() => {
|
|
393
|
+
u(e.absolutePath), b.current = null;
|
|
394
|
+
}, wr));
|
|
395
395
|
},
|
|
396
|
-
[t, e, a,
|
|
396
|
+
[t, e, a, E, u, l, r, o, n]
|
|
397
397
|
);
|
|
398
|
-
},
|
|
398
|
+
}, Vt = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", $t = (e, t) => e.children !== void 0 && t(e.absolutePath), Ut = (e, t) => ({
|
|
399
399
|
width: e,
|
|
400
400
|
gridTemplateColumns: t
|
|
401
|
-
}),
|
|
401
|
+
}), Xt = Ze(
|
|
402
402
|
({
|
|
403
403
|
entry: e,
|
|
404
404
|
indentLevel: t,
|
|
405
405
|
positionInSet: a,
|
|
406
406
|
setSize: n,
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
407
|
+
rowIndex: r,
|
|
408
|
+
isSelectedForAria: o,
|
|
409
|
+
rowHeight: l,
|
|
410
|
+
isDirOpen: u,
|
|
411
|
+
columns: E,
|
|
412
|
+
numericTemplate: b,
|
|
413
|
+
numericTotal: d,
|
|
414
|
+
nameWidth: f,
|
|
415
|
+
rowClassName: g,
|
|
416
|
+
selection: { onEntryClick: v, selectedPath: S, mode: m = "none", selectedItems: x, onSelectionChange: k },
|
|
417
|
+
expansion: { toggleDirectory: I, onToggleDirectoryRecursive: N },
|
|
418
|
+
visual: { iconOverrides: w, showExpandIcons: h = !0, showDirectoryIcons: D = !0, showFileIcons: C = !0, useCanvasExpandIcons: M = !1, expandIconSize: J, indentSize: F = $e, highlightStyles: H }
|
|
417
419
|
}) => {
|
|
418
|
-
const [
|
|
420
|
+
const [q, K] = ce(!1), R = e.children !== void 0, z = R && u(e.absolutePath), B = e.absolutePath === S, Y = !R && !!x?.has(e.absolutePath), ae = R ? void 0 : ge(e.name) || ge(e.relativePath) || ge(e.absolutePath), te = Gt({ entry: e, isDirectory: R, isExpanded: z, isItemSelected: Y, selectionMode: m, onSelectionChange: k, onEntryClick: v, toggleDirectory: I, onToggleDirectoryRecursive: N }), A = q ? H?.hoverClassName !== void 0 ? H.hoverClassName : O.entryHover : "", s = (() => {
|
|
419
421
|
if (R) {
|
|
420
|
-
if (
|
|
421
|
-
} else if (
|
|
422
|
-
return
|
|
422
|
+
if (B) return H?.directorySelectedClassName !== void 0 ? H.directorySelectedClassName : O.entrySelected;
|
|
423
|
+
} else if (B || Y)
|
|
424
|
+
return H?.itemSelectedClassName !== void 0 ? H.itemSelectedClassName : _(B && O.entrySelected, Y && O.entryItemSelected);
|
|
423
425
|
return "";
|
|
424
|
-
})(),
|
|
425
|
-
...
|
|
426
|
-
...R &&
|
|
427
|
-
...!R && (
|
|
426
|
+
})(), p = typeof g == "function" ? g(e) : g, y = _("dt-grid-row cursor-pointer select-none", A, s, p, e.className), j = _(O.expandIcon, (B || Y) && O.expandIconSelected), L = _(O.typeIcon, (B || Y) && O.typeIconSelected), G = _("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", R && O.nameDirectory, (B || Y) && O.nameSelected), P = Bt({ isDirectory: R, isExpanded: z, showExpandIcons: h, useCanvasExpandIcons: M, expandIconSize: J }), Q = (R ? D : C) ? zt({ entry: e, isDirectory: R, isExpanded: z, isSelected: B, isItemSelected: Y, extension: ae, mimeType: e.mimeType }, w) : null, re = { indentLevel: t, isDirectory: R, isExpanded: z }, [oe, ...we] = E, xe = oe?.render ? oe.render(e, re) : e.label ?? e.name, be = {
|
|
427
|
+
...q ? H?.hoverStyle : {},
|
|
428
|
+
...R && B ? H?.directorySelectedStyle : {},
|
|
429
|
+
...!R && (B || Y) ? H?.itemSelectedStyle : {}
|
|
428
430
|
};
|
|
429
431
|
return /* @__PURE__ */ i.jsxs(
|
|
430
432
|
"div",
|
|
431
433
|
{
|
|
432
|
-
className:
|
|
433
|
-
style: { height:
|
|
434
|
+
className: y,
|
|
435
|
+
style: { height: l, ...be, ...e.style },
|
|
434
436
|
role: "row",
|
|
435
437
|
"aria-expanded": R ? z : void 0,
|
|
436
438
|
"aria-level": t + 1,
|
|
437
439
|
"aria-posinset": a,
|
|
438
440
|
"aria-setsize": n,
|
|
439
|
-
|
|
441
|
+
"aria-rowindex": r,
|
|
442
|
+
"aria-selected": m === "none" ? void 0 : o,
|
|
443
|
+
...Yt(e.data),
|
|
440
444
|
"data-entry-type": R ? "directory" : "file",
|
|
441
445
|
"data-entry-expanded": R ? String(z) : void 0,
|
|
442
|
-
"data-entry-selected":
|
|
443
|
-
"data-entry-item-selected":
|
|
444
|
-
onClick:
|
|
446
|
+
"data-entry-selected": B ? "true" : void 0,
|
|
447
|
+
"data-entry-item-selected": Y ? "true" : void 0,
|
|
448
|
+
onClick: te,
|
|
445
449
|
onMouseEnter: () => K(!0),
|
|
446
450
|
onMouseLeave: () => K(!1),
|
|
447
|
-
onKeyDown: (
|
|
451
|
+
onKeyDown: (ee) => ee.key === "Enter" && te(ee),
|
|
448
452
|
tabIndex: 0,
|
|
449
453
|
children: [
|
|
450
|
-
/* @__PURE__ */ i.jsxs("div", { className: _("dt-grid-name-cell",
|
|
451
|
-
(
|
|
452
|
-
(R ?
|
|
453
|
-
/* @__PURE__ */ i.jsx("span", { className:
|
|
454
|
+
/* @__PURE__ */ i.jsxs("div", { className: _("dt-grid-name-cell", oe?.className), role: "gridcell", style: { width: f, paddingLeft: Math.max(0, t * F) }, children: [
|
|
455
|
+
(h || M) && /* @__PURE__ */ i.jsx("span", { className: j, children: P }),
|
|
456
|
+
(R ? D : C) && /* @__PURE__ */ i.jsx("span", { className: L, children: Q }),
|
|
457
|
+
/* @__PURE__ */ i.jsx("span", { className: G, children: xe })
|
|
454
458
|
] }),
|
|
455
|
-
|
|
459
|
+
we.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Ut(d, b), children: we.map((ee) => /* @__PURE__ */ i.jsx("div", { className: _("dt-grid-cell", Vt(ee.align), ee.className), role: "gridcell", children: ee.render ? ee.render(e, re) : null }, ee.key)) }) })
|
|
456
460
|
]
|
|
457
461
|
}
|
|
458
462
|
);
|
|
459
463
|
},
|
|
460
464
|
(e, t) => {
|
|
461
465
|
if (e.entry !== t.entry) return !1;
|
|
462
|
-
const a =
|
|
463
|
-
return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowHeight === t.rowHeight && a === n && e.columns === t.columns && e.numericTemplate === t.numericTemplate && e.numericTotal === t.numericTotal && e.nameWidth === t.nameWidth && e.rowClassName === t.rowClassName && e.selection.selectedPath === t.selection.selectedPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
|
|
466
|
+
const a = $t(e.entry, e.isDirOpen), n = $t(t.entry, t.isDirOpen);
|
|
467
|
+
return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && a === n && e.columns === t.columns && e.numericTemplate === t.numericTemplate && e.numericTotal === t.numericTotal && e.nameWidth === t.nameWidth && e.rowClassName === t.rowClassName && e.selection.selectedPath === t.selection.selectedPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
|
|
464
468
|
}
|
|
465
469
|
);
|
|
466
|
-
|
|
467
|
-
const
|
|
470
|
+
Xt.displayName = "DirectoryTreeGridRow";
|
|
471
|
+
const Jt = ({
|
|
468
472
|
kind: e,
|
|
469
473
|
columns: t,
|
|
470
474
|
numericTemplate: a,
|
|
@@ -472,28 +476,28 @@ const Ut = ({
|
|
|
472
476
|
nameWidth: r,
|
|
473
477
|
scrollBarWidth: o,
|
|
474
478
|
className: l,
|
|
475
|
-
nameContent:
|
|
476
|
-
renderCell:
|
|
479
|
+
nameContent: u,
|
|
480
|
+
renderCell: E
|
|
477
481
|
}) => {
|
|
478
|
-
const [, ...
|
|
479
|
-
return /* @__PURE__ */ i.jsxs("div", { className: _(
|
|
480
|
-
/* @__PURE__ */ i.jsx("div", { className: _(
|
|
481
|
-
|
|
482
|
+
const [, ...b] = t, d = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", f = e === "header" ? "dt-grid-header" : "dt-grid-footer", g = e === "header" ? "columnheader" : "gridcell";
|
|
483
|
+
return /* @__PURE__ */ i.jsxs("div", { className: _(f, "text-gray-600 dark:text-gray-300", l), role: "row", children: [
|
|
484
|
+
/* @__PURE__ */ i.jsx("div", { className: _(d, "px-1", t[0]?.className), role: g, style: { width: r }, children: u }),
|
|
485
|
+
b.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Ut(n, a), children: b.map((v) => /* @__PURE__ */ i.jsx("div", { className: _("dt-grid-cell", Vt(v.align), v.className), role: g, children: E(v) }, v.key)) }) }),
|
|
482
486
|
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: o }, "aria-hidden": "true" })
|
|
483
487
|
] });
|
|
484
|
-
},
|
|
488
|
+
}, Sr = ({ columns: e, className: t, ...a }) => /* @__PURE__ */ i.jsx(Jt, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...a }), Ht = (e, t) => typeof e == "function" ? e(t) : e ?? null, kr = ({ columns: e, allEntries: t, className: a, ...n }) => /* @__PURE__ */ i.jsx(Jt, { kind: "footer", columns: e, className: a, nameContent: Ht(e[0]?.footer, t), renderCell: (r) => Ht(r.footer, t), ...n }), Nr = 240, qt = 96, Zt = 12, qe = (e, t) => {
|
|
485
489
|
const a = e?.width;
|
|
486
490
|
return typeof a == "number" && Number.isFinite(a) && a > 0 ? a : t;
|
|
487
|
-
},
|
|
488
|
-
const n =
|
|
489
|
-
return { nameWidth: n, numericTotal: r, numericVisible: l, maxHScroll:
|
|
490
|
-
},
|
|
491
|
+
}, Er = (e) => e.slice(1).map((t) => `${qe(t, qt)}px`).join(" "), Ir = ({ measuredWidth: e, columns: t, scrollBarWidth: a = Zt }) => {
|
|
492
|
+
const n = qe(t[0], Nr), r = t.slice(1).reduce((E, b) => E + qe(b, qt), 0), o = Number.isFinite(e) && e > 0 ? e : 0, l = Math.max(0, o - n - Math.max(0, a)), u = Math.max(0, r - l);
|
|
493
|
+
return { nameWidth: n, numericTotal: r, numericVisible: l, maxHScroll: u };
|
|
494
|
+
}, Xe = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, jr = (e) => {
|
|
491
495
|
const t = [], a = (n) => {
|
|
492
496
|
for (const r of n)
|
|
493
497
|
t.push(r), r.children && r.children.length > 0 && a(r.children);
|
|
494
498
|
};
|
|
495
499
|
return a(e), t;
|
|
496
|
-
},
|
|
500
|
+
}, Tr = (e, t) => {
|
|
497
501
|
const a = e.length - 1;
|
|
498
502
|
if (a <= 0) return 0;
|
|
499
503
|
let n = 0, r = a - 1, o = 0;
|
|
@@ -502,22 +506,22 @@ const Ut = ({
|
|
|
502
506
|
e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
|
|
503
507
|
}
|
|
504
508
|
return o;
|
|
505
|
-
},
|
|
509
|
+
}, Cr = (e, t, a) => {
|
|
506
510
|
if (a <= 0 || e.length === 0 || t.length !== e.length + 1)
|
|
507
511
|
return null;
|
|
508
|
-
const n =
|
|
512
|
+
const n = Tr(t, a), r = e[n];
|
|
509
513
|
return r ? {
|
|
510
514
|
path: r.entry.absolutePath,
|
|
511
515
|
offsetInViewport: a - t[n]
|
|
512
516
|
} : null;
|
|
513
|
-
},
|
|
517
|
+
}, Rr = (e, t, a) => {
|
|
514
518
|
if (t.length === 0 || a.length !== t.length + 1)
|
|
515
519
|
return null;
|
|
516
520
|
for (let n = 0; n < t.length; n++)
|
|
517
521
|
if (t[n].entry.absolutePath === e.path)
|
|
518
522
|
return Math.max(0, a[n] + e.offsetInViewport);
|
|
519
523
|
return null;
|
|
520
|
-
},
|
|
524
|
+
}, Pr = (e, t, a) => {
|
|
521
525
|
const n = [];
|
|
522
526
|
for (let r = t; r < a; r++) {
|
|
523
527
|
const o = e[r];
|
|
@@ -526,7 +530,7 @@ const Ut = ({
|
|
|
526
530
|
n.push(l);
|
|
527
531
|
}
|
|
528
532
|
return n;
|
|
529
|
-
},
|
|
533
|
+
}, _r = (e, t, a) => {
|
|
530
534
|
const n = [];
|
|
531
535
|
for (let r = t; r < a; r++) {
|
|
532
536
|
const o = e[r];
|
|
@@ -535,36 +539,36 @@ const Ut = ({
|
|
|
535
539
|
n.push(l);
|
|
536
540
|
}
|
|
537
541
|
return n;
|
|
538
|
-
},
|
|
542
|
+
}, Ar = (e, t, a, n) => {
|
|
539
543
|
const r = Math.max(1, Math.floor(t * n)), o = Math.max(1, Math.floor(a * n));
|
|
540
544
|
(e.width !== r || e.height !== o) && (e.width = r, e.height = o);
|
|
541
545
|
const l = e.style;
|
|
542
546
|
l.width !== `${t}px` && (l.width = `${t}px`), l.height !== `${a}px` && (l.height = `${a}px`);
|
|
543
|
-
},
|
|
547
|
+
}, Mr = (e, t, a) => {
|
|
544
548
|
e.lineWidth = a, e.beginPath();
|
|
545
549
|
for (const n of t)
|
|
546
550
|
e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
|
|
547
551
|
e.stroke();
|
|
548
|
-
},
|
|
552
|
+
}, Or = (e, t) => {
|
|
549
553
|
const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
550
554
|
if (!a)
|
|
551
555
|
return null;
|
|
552
556
|
let n = a[1];
|
|
553
|
-
n.length === 3 && (n = n.split("").map((
|
|
557
|
+
n.length === 3 && (n = n.split("").map((u) => u + u).join(""));
|
|
554
558
|
const r = Number.parseInt(n.slice(0, 2), 16), o = Number.parseInt(n.slice(2, 4), 16), l = Number.parseInt(n.slice(4, 6), 16);
|
|
555
559
|
return `rgba(${r}, ${o}, ${l}, ${t})`;
|
|
556
|
-
},
|
|
560
|
+
}, Fr = (e, t, a, n) => {
|
|
557
561
|
if (t.length === 0)
|
|
558
562
|
return;
|
|
559
|
-
const r =
|
|
563
|
+
const r = Or(a, 0.14), o = e.strokeStyle, l = e.fillStyle, u = e.lineWidth, E = e.lineCap, b = e.lineJoin;
|
|
560
564
|
e.strokeStyle = a, e.lineCap = "round", e.lineJoin = "round";
|
|
561
|
-
for (const
|
|
562
|
-
const
|
|
563
|
-
r && (e.fillStyle = r, e.beginPath(), e.arc(
|
|
565
|
+
for (const d of t) {
|
|
566
|
+
const f = n ?? d.size, g = Math.max(0, f / 2), v = Math.max(1, Math.round(f * 0.08)), S = Math.max(1, Math.round(f * 0.14)), m = Math.max(0, g - v * 0.8), x = Math.max(0, m * 0.55);
|
|
567
|
+
r && (e.fillStyle = r, e.beginPath(), e.arc(d.centerX, d.centerY, m, 0, Math.PI * 2), e.fill()), e.lineWidth = v, e.beginPath(), e.arc(d.centerX, d.centerY, Math.max(0, g - v * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = S, e.beginPath(), e.moveTo(d.centerX - x, d.centerY), e.lineTo(d.centerX + x, d.centerY), e.stroke(), d.isExpanded || (e.beginPath(), e.moveTo(d.centerX, d.centerY - x), e.lineTo(d.centerX, d.centerY + x), e.stroke());
|
|
564
568
|
}
|
|
565
|
-
e.strokeStyle = o, e.fillStyle = l, e.lineWidth =
|
|
566
|
-
},
|
|
567
|
-
const S =
|
|
569
|
+
e.strokeStyle = o, e.fillStyle = l, e.lineWidth = u, e.lineCap = E, e.lineJoin = b;
|
|
570
|
+
}, Kt = Ze(({ segmentsByItem: e, glyphsByItem: t, itemHeight: a, width: n, viewportHeight: r, scrollPosition: o, color: l = "#a0aec0", strokeWidth: u = 1, renderStartIndex: E, renderEndIndex: b, lookaheadEndIndex: d, devicePixelRatio: f, expandGlyphColor: g, expandGlyphSize: v }) => {
|
|
571
|
+
const S = ue(null), m = ue(null), x = ue({
|
|
568
572
|
segmentsByItem: e,
|
|
569
573
|
glyphsByItem: t,
|
|
570
574
|
itemHeight: a,
|
|
@@ -572,47 +576,47 @@ const Ut = ({
|
|
|
572
576
|
viewportHeight: r,
|
|
573
577
|
scrollPosition: o,
|
|
574
578
|
color: l,
|
|
575
|
-
strokeWidth:
|
|
576
|
-
renderStartIndex:
|
|
577
|
-
renderEndIndex:
|
|
578
|
-
lookaheadEndIndex:
|
|
579
|
-
devicePixelRatio:
|
|
580
|
-
expandGlyphColor:
|
|
581
|
-
expandGlyphSize:
|
|
582
|
-
}),
|
|
583
|
-
|
|
579
|
+
strokeWidth: u,
|
|
580
|
+
renderStartIndex: E,
|
|
581
|
+
renderEndIndex: b,
|
|
582
|
+
lookaheadEndIndex: d,
|
|
583
|
+
devicePixelRatio: f,
|
|
584
|
+
expandGlyphColor: g,
|
|
585
|
+
expandGlyphSize: v
|
|
586
|
+
}), k = W(() => {
|
|
587
|
+
m.current = null;
|
|
584
588
|
const N = S.current;
|
|
585
589
|
if (!N)
|
|
586
590
|
return;
|
|
587
|
-
const
|
|
588
|
-
if (!
|
|
591
|
+
const w = N.getContext("2d");
|
|
592
|
+
if (!w)
|
|
589
593
|
return;
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
592
|
-
|
|
594
|
+
const h = x.current;
|
|
595
|
+
if (h.width <= 0 || h.viewportHeight <= 0) {
|
|
596
|
+
w.clearRect(0, 0, N.width, N.height);
|
|
593
597
|
return;
|
|
594
598
|
}
|
|
595
|
-
const
|
|
596
|
-
|
|
597
|
-
const
|
|
598
|
-
if (typeof
|
|
599
|
-
const
|
|
600
|
-
return Math.max(Math.min(
|
|
599
|
+
const D = Number.isFinite(h.devicePixelRatio ?? NaN) ? h.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
|
|
600
|
+
Ar(N, h.width, h.viewportHeight, D);
|
|
601
|
+
const C = h.segmentsByItem.length, M = typeof h.renderStartIndex == "number" && Number.isFinite(h.renderStartIndex) ? Math.max(0, Math.floor(h.renderStartIndex)) : Math.max(0, Math.floor(h.scrollPosition / h.itemHeight)), J = Math.min(C, Math.ceil((h.scrollPosition + h.viewportHeight) / h.itemHeight)), F = (() => {
|
|
602
|
+
if (typeof h.renderEndIndex == "number" && Number.isFinite(h.renderEndIndex)) {
|
|
603
|
+
const R = Math.floor(h.renderEndIndex);
|
|
604
|
+
return Math.max(Math.min(C, R + 1), M);
|
|
601
605
|
}
|
|
602
|
-
return Math.max(
|
|
603
|
-
})(),
|
|
604
|
-
if (typeof
|
|
605
|
-
const
|
|
606
|
-
return Math.max(
|
|
606
|
+
return Math.max(J, M);
|
|
607
|
+
})(), H = (() => {
|
|
608
|
+
if (typeof h.lookaheadEndIndex == "number" && Number.isFinite(h.lookaheadEndIndex)) {
|
|
609
|
+
const R = Math.floor(h.lookaheadEndIndex), z = Math.min(C, R + 1);
|
|
610
|
+
return Math.max(z, F);
|
|
607
611
|
}
|
|
608
|
-
return Math.max(
|
|
609
|
-
})(),
|
|
610
|
-
|
|
611
|
-
}, []),
|
|
612
|
-
|
|
613
|
-
}, [
|
|
614
|
-
return
|
|
615
|
-
|
|
612
|
+
return Math.max(J, F);
|
|
613
|
+
})(), q = Pr(h.segmentsByItem, M, H), K = _r(h.glyphsByItem, M, H);
|
|
614
|
+
w.save(), w.scale(D, D), w.clearRect(0, 0, h.width, h.viewportHeight), w.translate(0, -h.scrollPosition), w.strokeStyle = h.color, Mr(w, q, h.strokeWidth), Fr(w, K, h.expandGlyphColor ?? h.color, h.expandGlyphSize), w.restore();
|
|
615
|
+
}, []), I = W(() => {
|
|
616
|
+
m.current === null && (m.current = window.requestAnimationFrame(k));
|
|
617
|
+
}, [k]);
|
|
618
|
+
return me(() => {
|
|
619
|
+
x.current = {
|
|
616
620
|
segmentsByItem: e,
|
|
617
621
|
glyphsByItem: t,
|
|
618
622
|
itemHeight: a,
|
|
@@ -620,48 +624,48 @@ const Ut = ({
|
|
|
620
624
|
viewportHeight: r,
|
|
621
625
|
scrollPosition: o,
|
|
622
626
|
color: l,
|
|
623
|
-
strokeWidth:
|
|
624
|
-
renderStartIndex:
|
|
625
|
-
renderEndIndex:
|
|
626
|
-
lookaheadEndIndex:
|
|
627
|
-
devicePixelRatio:
|
|
628
|
-
expandGlyphColor:
|
|
629
|
-
expandGlyphSize:
|
|
630
|
-
},
|
|
631
|
-
}, [e, t, a, n, r, o, l,
|
|
632
|
-
|
|
627
|
+
strokeWidth: u,
|
|
628
|
+
renderStartIndex: E,
|
|
629
|
+
renderEndIndex: b,
|
|
630
|
+
lookaheadEndIndex: d,
|
|
631
|
+
devicePixelRatio: f,
|
|
632
|
+
expandGlyphColor: g,
|
|
633
|
+
expandGlyphSize: v
|
|
634
|
+
}, I();
|
|
635
|
+
}, [e, t, a, n, r, o, l, u, E, b, d, f, g, v, I]), me(() => () => {
|
|
636
|
+
m.current !== null && (window.cancelAnimationFrame(m.current), m.current = null);
|
|
633
637
|
}, []), /* @__PURE__ */ i.jsx("canvas", { ref: S, className: "pointer-events-none absolute top-0 left-0 z-0" });
|
|
634
638
|
});
|
|
635
|
-
|
|
636
|
-
const
|
|
639
|
+
Kt.displayName = "TreeLineCanvas";
|
|
640
|
+
const Dr = {
|
|
637
641
|
msOverflowStyle: "none",
|
|
638
642
|
scrollbarWidth: "none"
|
|
639
|
-
},
|
|
643
|
+
}, Lr = () => {
|
|
640
644
|
let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
|
|
641
645
|
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));
|
|
642
|
-
},
|
|
646
|
+
}, $r = (e, t, a, n, r) => {
|
|
643
647
|
const o = [], l = [];
|
|
644
|
-
let
|
|
645
|
-
const
|
|
646
|
-
const
|
|
647
|
-
for (let
|
|
648
|
-
const S =
|
|
649
|
-
let N =
|
|
650
|
-
n && (N =
|
|
648
|
+
let u = 0;
|
|
649
|
+
const E = (b, d, f) => {
|
|
650
|
+
const g = r ? [...b].sort(r) : b;
|
|
651
|
+
for (let v = 0; v < g.length; v++) {
|
|
652
|
+
const S = g[v], m = v === g.length - 1, x = [...f, m], k = S.children !== void 0, I = k && t(S.absolutePath, S.relativePath);
|
|
653
|
+
let N = d, w = x, h = f;
|
|
654
|
+
n && (N = d - 1, w = x.slice(1), h = f.slice(1)), o.push({ entry: S, indentLevel: N, depth: d, positionInSet: v + 1, setSize: g.length, parentIsLast: w }), a && (N > u && (u = N), l.push({
|
|
651
655
|
id: S.absolutePath,
|
|
652
656
|
name: S.name,
|
|
653
657
|
absolutePath: S.absolutePath,
|
|
654
658
|
indentLevel: N,
|
|
655
|
-
isLastChild:
|
|
656
|
-
isDirectory:
|
|
657
|
-
isExpanded:
|
|
658
|
-
ancestorIsLast: [...
|
|
659
|
-
hideLines: n &&
|
|
660
|
-
})),
|
|
659
|
+
isLastChild: m,
|
|
660
|
+
isDirectory: k,
|
|
661
|
+
isExpanded: I,
|
|
662
|
+
ancestorIsLast: [...h],
|
|
663
|
+
hideLines: n && d === 0
|
|
664
|
+
})), k && I && S.children && E(S.children, d + 1, x);
|
|
661
665
|
}
|
|
662
666
|
};
|
|
663
|
-
return
|
|
664
|
-
},
|
|
667
|
+
return E(e, 0, []), { flatItems: o, lineItems: l, maxIndent: u };
|
|
668
|
+
}, Wt = (e, t) => {
|
|
665
669
|
const a = e.length - 1;
|
|
666
670
|
if (a <= 0) return 0;
|
|
667
671
|
let n = 0, r = a - 1, o = 0;
|
|
@@ -670,188 +674,190 @@ const Or = {
|
|
|
670
674
|
e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
|
|
671
675
|
}
|
|
672
676
|
return o;
|
|
673
|
-
},
|
|
674
|
-
const l = n?.renderStart ?? Math.max(0,
|
|
675
|
-
return { renderStart: l, renderEnd:
|
|
676
|
-
},
|
|
677
|
+
}, Hr = (e, t, a, n, r, o) => {
|
|
678
|
+
const l = n?.renderStart ?? Math.max(0, Wt(o, r)), u = t > 0 ? Wt(o, r + t) + a : l + a, E = e > 0 ? Math.min(e - 1, Math.max(l, u)) : l, b = n?.renderEnd ?? E, d = e > 0 ? Math.min(e - 1, b + a) : b;
|
|
679
|
+
return { renderStart: l, renderEnd: b, lookaheadEnd: d };
|
|
680
|
+
}, Wr = (e, t, a, n, r, o) => {
|
|
677
681
|
if (e.length === 0)
|
|
678
682
|
return { segmentsByItem: [], glyphsByItem: [] };
|
|
679
|
-
const l = Array.from({ length: e.length }, () => []),
|
|
680
|
-
for (let
|
|
681
|
-
const
|
|
682
|
-
if (
|
|
683
|
+
const l = Array.from({ length: e.length }, () => []), u = Array.from({ length: e.length }, () => []), E = (d) => r ? typeof o == "number" && Number.isFinite(o) && o > 0 ? o : Math.max(8, Math.min(n * 0.9, d * 0.7)) : 0, b = 3;
|
|
684
|
+
for (let d = 0; d < e.length; d++) {
|
|
685
|
+
const f = e[d];
|
|
686
|
+
if (f.hideLines)
|
|
683
687
|
continue;
|
|
684
|
-
const
|
|
685
|
-
for (let
|
|
686
|
-
if (
|
|
688
|
+
const g = [], v = t[d] ?? 0, S = a[d] ?? 0, m = S + v / 2, x = E(v), k = x > 0 ? x / 2 + 2 : n / 1.5;
|
|
689
|
+
for (let w = 0; w < f.indentLevel; w++) {
|
|
690
|
+
if (f.ancestorIsLast[w] ?? !1)
|
|
687
691
|
continue;
|
|
688
|
-
let
|
|
689
|
-
for (let
|
|
690
|
-
const
|
|
691
|
-
if (
|
|
692
|
-
|
|
692
|
+
let D = !1;
|
|
693
|
+
for (let C = d; C < e.length; C++) {
|
|
694
|
+
const M = e[C];
|
|
695
|
+
if (M.indentLevel > w && M.ancestorIsLast.length > w && !M.ancestorIsLast[w]) {
|
|
696
|
+
D = !0;
|
|
693
697
|
break;
|
|
694
698
|
}
|
|
695
|
-
if (
|
|
699
|
+
if (C > d && M.indentLevel === w)
|
|
696
700
|
break;
|
|
697
701
|
}
|
|
698
|
-
if (
|
|
699
|
-
const
|
|
700
|
-
|
|
701
|
-
key: `${
|
|
702
|
-
x1:
|
|
702
|
+
if (D) {
|
|
703
|
+
const C = w * n + n / 2 + b;
|
|
704
|
+
g.push({
|
|
705
|
+
key: `${f.id}-ancestor-${w}`,
|
|
706
|
+
x1: C,
|
|
703
707
|
y1: S,
|
|
704
|
-
x2:
|
|
705
|
-
y2: S +
|
|
706
|
-
itemIndex:
|
|
708
|
+
x2: C,
|
|
709
|
+
y2: S + v,
|
|
710
|
+
itemIndex: d
|
|
707
711
|
});
|
|
708
712
|
}
|
|
709
713
|
}
|
|
710
|
-
const
|
|
711
|
-
if (
|
|
712
|
-
key: `${
|
|
714
|
+
const I = f.indentLevel * n, N = I + n / 2 + b;
|
|
715
|
+
if (f.isDirectory ? g.push({
|
|
716
|
+
key: `${f.id}-connector-top`,
|
|
713
717
|
x1: N,
|
|
714
718
|
y1: S,
|
|
715
719
|
x2: N,
|
|
716
|
-
y2:
|
|
717
|
-
itemIndex:
|
|
718
|
-
}) :
|
|
719
|
-
key: `${
|
|
720
|
+
y2: m - k,
|
|
721
|
+
itemIndex: d
|
|
722
|
+
}) : g.push({
|
|
723
|
+
key: `${f.id}-connector-top`,
|
|
720
724
|
x1: N,
|
|
721
725
|
y1: S,
|
|
722
726
|
x2: N,
|
|
723
|
-
y2:
|
|
724
|
-
itemIndex:
|
|
725
|
-
}), !
|
|
726
|
-
key: `${
|
|
727
|
+
y2: m,
|
|
728
|
+
itemIndex: d
|
|
729
|
+
}), !f.isDirectory && f.isLastChild && g.push({
|
|
730
|
+
key: `${f.id}-connector-horizontal`,
|
|
727
731
|
x1: N,
|
|
728
|
-
y1:
|
|
729
|
-
x2:
|
|
730
|
-
y2:
|
|
731
|
-
itemIndex:
|
|
732
|
-
}),
|
|
733
|
-
key: `${
|
|
732
|
+
y1: m,
|
|
733
|
+
x2: I + n + b,
|
|
734
|
+
y2: m,
|
|
735
|
+
itemIndex: d
|
|
736
|
+
}), f.isLastChild || (f.isDirectory ? g.push({
|
|
737
|
+
key: `${f.id}-connector-bottom`,
|
|
734
738
|
x1: N,
|
|
735
|
-
y1:
|
|
739
|
+
y1: m + k,
|
|
736
740
|
x2: N,
|
|
737
|
-
y2: S +
|
|
738
|
-
itemIndex:
|
|
739
|
-
}) :
|
|
740
|
-
key: `${
|
|
741
|
+
y2: S + v,
|
|
742
|
+
itemIndex: d
|
|
743
|
+
}) : g.push({
|
|
744
|
+
key: `${f.id}-connector-bottom`,
|
|
741
745
|
x1: N,
|
|
742
|
-
y1:
|
|
746
|
+
y1: m,
|
|
743
747
|
x2: N,
|
|
744
|
-
y2: S +
|
|
745
|
-
itemIndex:
|
|
746
|
-
})), l[
|
|
747
|
-
const
|
|
748
|
-
|
|
748
|
+
y2: S + v,
|
|
749
|
+
itemIndex: d
|
|
750
|
+
})), l[d] = g, r && f.isDirectory) {
|
|
751
|
+
const w = x, h = N, D = m;
|
|
752
|
+
u[d] = [
|
|
749
753
|
{
|
|
750
|
-
key: `${
|
|
751
|
-
itemIndex:
|
|
752
|
-
centerX:
|
|
753
|
-
centerY:
|
|
754
|
-
size:
|
|
755
|
-
isExpanded:
|
|
754
|
+
key: `${f.id}-glyph`,
|
|
755
|
+
itemIndex: d,
|
|
756
|
+
centerX: h,
|
|
757
|
+
centerY: D,
|
|
758
|
+
size: w,
|
|
759
|
+
isExpanded: f.isExpanded
|
|
756
760
|
}
|
|
757
761
|
];
|
|
758
762
|
}
|
|
759
763
|
}
|
|
760
|
-
return { segmentsByItem: l, glyphsByItem:
|
|
761
|
-
},
|
|
764
|
+
return { segmentsByItem: l, glyphsByItem: u };
|
|
765
|
+
}, Ke = Ze(
|
|
762
766
|
({
|
|
763
767
|
entry: e,
|
|
764
768
|
indentLevel: t,
|
|
765
769
|
depth: a,
|
|
766
770
|
positionInSet: n,
|
|
767
771
|
setSize: r,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
772
|
+
isSelectedForAria: o,
|
|
773
|
+
rowHeight: l,
|
|
774
|
+
isDirOpen: u,
|
|
775
|
+
parentIsLast: E,
|
|
776
|
+
renderChildren: b = !0,
|
|
777
|
+
expansion: { toggleDirectory: d, onToggleDirectoryRecursive: f },
|
|
778
|
+
selection: { onEntryClick: g, selectedPath: v, mode: S = "none", selectedItems: m, onSelectionChange: x },
|
|
774
779
|
visual: {
|
|
775
|
-
iconOverrides:
|
|
776
|
-
showExpandIcons:
|
|
777
|
-
showDirectoryIcons:
|
|
778
|
-
showFileIcons:
|
|
779
|
-
useCanvasExpandIcons:
|
|
780
|
-
expandIconSize:
|
|
781
|
-
typeIconSize:
|
|
782
|
-
fontSize:
|
|
783
|
-
indentSize:
|
|
784
|
-
highlightStyles:
|
|
785
|
-
entryClassName:
|
|
786
|
-
entryStyle:
|
|
787
|
-
nameClassName:
|
|
788
|
-
nameStyle:
|
|
789
|
-
directoryNameClassName:
|
|
790
|
-
directoryNameStyle:
|
|
791
|
-
fileNameClassName:
|
|
792
|
-
fileNameStyle:
|
|
780
|
+
iconOverrides: k,
|
|
781
|
+
showExpandIcons: I = !0,
|
|
782
|
+
showDirectoryIcons: N = !0,
|
|
783
|
+
showFileIcons: w = !0,
|
|
784
|
+
useCanvasExpandIcons: h = !1,
|
|
785
|
+
expandIconSize: D,
|
|
786
|
+
typeIconSize: C,
|
|
787
|
+
fontSize: M,
|
|
788
|
+
indentSize: J = $e,
|
|
789
|
+
highlightStyles: F,
|
|
790
|
+
entryClassName: H,
|
|
791
|
+
entryStyle: q,
|
|
792
|
+
nameClassName: K,
|
|
793
|
+
nameStyle: R,
|
|
794
|
+
directoryNameClassName: z,
|
|
795
|
+
directoryNameStyle: B,
|
|
796
|
+
fileNameClassName: Y,
|
|
797
|
+
fileNameStyle: ae
|
|
793
798
|
}
|
|
794
799
|
}) => {
|
|
795
|
-
const [
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
}, [
|
|
799
|
-
const
|
|
800
|
-
if (
|
|
801
|
-
if (
|
|
802
|
-
return
|
|
803
|
-
} else if (
|
|
804
|
-
return
|
|
800
|
+
const [te, A] = ce(null), [s, p] = ce(!1), y = e.children !== void 0, j = y && u(e.absolutePath), L = e.absolutePath === v, G = !y && m?.has(e.absolutePath), P = y ? void 0 : ge(e.name) || ge(e.relativePath) || ge(e.absolutePath);
|
|
801
|
+
me(() => {
|
|
802
|
+
A(j && e.children ? e.children : null);
|
|
803
|
+
}, [j, e.children]);
|
|
804
|
+
const Q = Gt({ entry: e, isDirectory: y, isExpanded: j, isItemSelected: !!G, selectionMode: S, onSelectionChange: x, onEntryClick: g, toggleDirectory: d, onToggleDirectoryRecursive: f }), re = s ? F?.hoverClassName !== void 0 ? F.hoverClassName : O.entryHover : "", oe = (() => {
|
|
805
|
+
if (y) {
|
|
806
|
+
if (L)
|
|
807
|
+
return F?.directorySelectedClassName !== void 0 ? F.directorySelectedClassName : O.entrySelected;
|
|
808
|
+
} else if (L || G)
|
|
809
|
+
return F?.itemSelectedClassName !== void 0 ? F.itemSelectedClassName : _(L && O.entrySelected, G && O.entryItemSelected);
|
|
805
810
|
return "";
|
|
806
|
-
})(),
|
|
807
|
-
...
|
|
808
|
-
...
|
|
809
|
-
...!
|
|
810
|
-
},
|
|
811
|
-
return /* @__PURE__ */ i.jsxs(
|
|
811
|
+
})(), we = _(O.entry, re, oe, H, e.className), xe = _(O.expandIcon, (L || G) && O.expandIconSelected), be = _(O.typeIcon, (L || G) && O.typeIconSelected), ee = _(O.name, K, y && O.nameDirectory, y && z, !y && Y, (L || G) && O.nameSelected), He = Bt({ isDirectory: y, isExpanded: j, showExpandIcons: I, useCanvasExpandIcons: h, expandIconSize: D }), Se = (y ? N : w) ? zt({ entry: e, isDirectory: y, isExpanded: j, isSelected: L, isItemSelected: !!G, extension: P, mimeType: e.mimeType }, k) : null, Re = {
|
|
812
|
+
...s ? F?.hoverStyle : {},
|
|
813
|
+
...y && L ? F?.directorySelectedStyle : {},
|
|
814
|
+
...!y && (L || G) ? F?.itemSelectedStyle : {}
|
|
815
|
+
}, Pe = Yt(e.data), _e = C ? { width: C, height: C } : void 0, je = M ? { fontSize: typeof M == "number" ? `${M}px` : M } : void 0;
|
|
816
|
+
return /* @__PURE__ */ i.jsxs(ir, { children: [
|
|
812
817
|
/* @__PURE__ */ i.jsxs(
|
|
813
818
|
"div",
|
|
814
819
|
{
|
|
815
|
-
className:
|
|
820
|
+
className: we,
|
|
816
821
|
style: {
|
|
817
|
-
paddingLeft: `${Math.max(0, t *
|
|
818
|
-
transform: t < 0 ? `translateX(${t *
|
|
819
|
-
width: t < 0 ? `calc(100% + ${Math.abs(t *
|
|
820
|
-
height: `${
|
|
821
|
-
...
|
|
822
|
-
...
|
|
823
|
-
...
|
|
822
|
+
paddingLeft: `${Math.max(0, t * J)}px`,
|
|
823
|
+
transform: t < 0 ? `translateX(${t * J}px)` : void 0,
|
|
824
|
+
width: t < 0 ? `calc(100% + ${Math.abs(t * J)}px)` : void 0,
|
|
825
|
+
height: `${l}px`,
|
|
826
|
+
...je,
|
|
827
|
+
...Re,
|
|
828
|
+
...q,
|
|
824
829
|
...e.style
|
|
825
830
|
},
|
|
826
|
-
...
|
|
827
|
-
"data-entry-type":
|
|
828
|
-
"data-entry-expanded":
|
|
829
|
-
"data-entry-selected":
|
|
830
|
-
"data-entry-item-selected":
|
|
831
|
-
onClick:
|
|
832
|
-
onMouseEnter: () =>
|
|
833
|
-
onMouseLeave: () =>
|
|
834
|
-
onKeyDown: (
|
|
831
|
+
...Pe,
|
|
832
|
+
"data-entry-type": y ? "directory" : "file",
|
|
833
|
+
"data-entry-expanded": y ? String(j) : void 0,
|
|
834
|
+
"data-entry-selected": L ? "true" : void 0,
|
|
835
|
+
"data-entry-item-selected": G ? "true" : void 0,
|
|
836
|
+
onClick: Q,
|
|
837
|
+
onMouseEnter: () => p(!0),
|
|
838
|
+
onMouseLeave: () => p(!1),
|
|
839
|
+
onKeyDown: (le) => le.key === "Enter" && Q(le),
|
|
835
840
|
tabIndex: 0,
|
|
836
841
|
role: "treeitem",
|
|
837
|
-
"aria-expanded":
|
|
842
|
+
"aria-expanded": y ? j : void 0,
|
|
838
843
|
"aria-level": a + 1,
|
|
839
844
|
"aria-posinset": n,
|
|
840
845
|
"aria-setsize": r,
|
|
841
|
-
"aria-
|
|
846
|
+
"aria-selected": S === "none" ? void 0 : o,
|
|
847
|
+
"aria-label": `${e.name} (${y ? "directory" : "file"})`,
|
|
842
848
|
children: [
|
|
843
|
-
(
|
|
844
|
-
(
|
|
849
|
+
(I || h) && /* @__PURE__ */ i.jsx("span", { className: xe, children: He }),
|
|
850
|
+
(y ? N : w) && /* @__PURE__ */ i.jsx("span", { className: be, style: _e, children: Se }),
|
|
845
851
|
/* @__PURE__ */ i.jsx(
|
|
846
852
|
"span",
|
|
847
853
|
{
|
|
848
|
-
className:
|
|
854
|
+
className: ee,
|
|
849
855
|
style: {
|
|
850
|
-
...
|
|
851
|
-
...
|
|
852
|
-
...
|
|
856
|
+
...je,
|
|
857
|
+
...R,
|
|
858
|
+
...y ? B : ae
|
|
853
859
|
},
|
|
854
|
-
"data-entry-type":
|
|
860
|
+
"data-entry-type": y ? "directory" : "file",
|
|
855
861
|
"data-entry-role": "name",
|
|
856
862
|
children: e.label ?? e.name
|
|
857
863
|
}
|
|
@@ -859,38 +865,39 @@ const Or = {
|
|
|
859
865
|
]
|
|
860
866
|
}
|
|
861
867
|
),
|
|
862
|
-
|
|
863
|
-
|
|
868
|
+
j && te && b && /* @__PURE__ */ i.jsx("fieldset", { children: te.map((le, ne) => /* @__PURE__ */ i.jsx(
|
|
869
|
+
Ke,
|
|
864
870
|
{
|
|
865
|
-
entry:
|
|
871
|
+
entry: le,
|
|
866
872
|
indentLevel: t + 1,
|
|
867
873
|
depth: a + 1,
|
|
868
|
-
positionInSet:
|
|
869
|
-
setSize:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
874
|
+
positionInSet: ne + 1,
|
|
875
|
+
setSize: te.length,
|
|
876
|
+
isSelectedForAria: S === "single" ? le.absolutePath === v : !!m?.has(le.absolutePath),
|
|
877
|
+
rowHeight: l,
|
|
878
|
+
isDirOpen: u,
|
|
879
|
+
parentIsLast: [...E, ne === te.length - 1],
|
|
880
|
+
expansion: { toggleDirectory: d, onToggleDirectoryRecursive: f },
|
|
881
|
+
selection: { onEntryClick: g, selectedPath: v, mode: S, selectedItems: m, onSelectionChange: x },
|
|
875
882
|
visual: {
|
|
876
|
-
iconOverrides:
|
|
877
|
-
showExpandIcons:
|
|
878
|
-
showDirectoryIcons:
|
|
879
|
-
showFileIcons:
|
|
880
|
-
useCanvasExpandIcons:
|
|
881
|
-
expandIconSize:
|
|
882
|
-
highlightStyles:
|
|
883
|
-
entryClassName:
|
|
884
|
-
entryStyle:
|
|
885
|
-
nameClassName:
|
|
886
|
-
nameStyle:
|
|
887
|
-
directoryNameClassName:
|
|
888
|
-
directoryNameStyle:
|
|
889
|
-
fileNameClassName:
|
|
890
|
-
fileNameStyle:
|
|
883
|
+
iconOverrides: k,
|
|
884
|
+
showExpandIcons: I,
|
|
885
|
+
showDirectoryIcons: N,
|
|
886
|
+
showFileIcons: w,
|
|
887
|
+
useCanvasExpandIcons: h,
|
|
888
|
+
expandIconSize: D,
|
|
889
|
+
highlightStyles: F,
|
|
890
|
+
entryClassName: H,
|
|
891
|
+
entryStyle: q,
|
|
892
|
+
nameClassName: K,
|
|
893
|
+
nameStyle: R,
|
|
894
|
+
directoryNameClassName: z,
|
|
895
|
+
directoryNameStyle: B,
|
|
896
|
+
fileNameClassName: Y,
|
|
897
|
+
fileNameStyle: ae
|
|
891
898
|
}
|
|
892
899
|
},
|
|
893
|
-
|
|
900
|
+
le.absolutePath
|
|
894
901
|
)) })
|
|
895
902
|
] }, e.absolutePath);
|
|
896
903
|
},
|
|
@@ -898,429 +905,447 @@ const Or = {
|
|
|
898
905
|
if (e.entry !== t.entry) return !1;
|
|
899
906
|
const a = e.entry.children !== void 0, n = t.entry.children !== void 0, r = a && e.isDirOpen(e.entry.absolutePath), o = n && t.isDirOpen(t.entry.absolutePath);
|
|
900
907
|
return e.indentLevel === t.indentLevel && // 位置情報は aria として描画されるため、変化したら再描画が必要
|
|
901
|
-
e.depth === t.depth && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowHeight === t.rowHeight && r === o && e.selection.selectedPath === t.selection.selectedPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual.iconOverrides === t.visual.iconOverrides && e.visual.showExpandIcons === t.visual.showExpandIcons && e.visual.showDirectoryIcons === t.visual.showDirectoryIcons && e.visual.showFileIcons === t.visual.showFileIcons && e.visual.useCanvasExpandIcons === t.visual.useCanvasExpandIcons && e.visual.expandIconSize === t.visual.expandIconSize && e.visual.highlightStyles === t.visual.highlightStyles && e.visual.entryClassName === t.visual.entryClassName && e.visual.entryStyle === t.visual.entryStyle && e.visual.nameClassName === t.visual.nameClassName && e.visual.nameStyle === t.visual.nameStyle && e.visual.directoryNameClassName === t.visual.directoryNameClassName && e.visual.directoryNameStyle === t.visual.directoryNameStyle && e.visual.fileNameClassName === t.visual.fileNameClassName && e.visual.fileNameStyle === t.visual.fileNameStyle && e.parentIsLast.length === t.parentIsLast.length && e.parentIsLast.every((l,
|
|
908
|
+
e.depth === t.depth && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && r === o && e.selection.selectedPath === t.selection.selectedPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual.iconOverrides === t.visual.iconOverrides && e.visual.showExpandIcons === t.visual.showExpandIcons && e.visual.showDirectoryIcons === t.visual.showDirectoryIcons && e.visual.showFileIcons === t.visual.showFileIcons && e.visual.useCanvasExpandIcons === t.visual.useCanvasExpandIcons && e.visual.expandIconSize === t.visual.expandIconSize && e.visual.highlightStyles === t.visual.highlightStyles && e.visual.entryClassName === t.visual.entryClassName && e.visual.entryStyle === t.visual.entryStyle && e.visual.nameClassName === t.visual.nameClassName && e.visual.nameStyle === t.visual.nameStyle && e.visual.directoryNameClassName === t.visual.directoryNameClassName && e.visual.directoryNameStyle === t.visual.directoryNameStyle && e.visual.fileNameClassName === t.visual.fileNameClassName && e.visual.fileNameStyle === t.visual.fileNameStyle && e.parentIsLast.length === t.parentIsLast.length && e.parentIsLast.every((l, u) => l === t.parentIsLast[u]);
|
|
902
909
|
}
|
|
903
910
|
);
|
|
904
|
-
|
|
905
|
-
const
|
|
911
|
+
Ke.displayName = "DirectoryEntryItem";
|
|
912
|
+
const Qt = (e) => {
|
|
906
913
|
const t = [];
|
|
907
914
|
if (e.children)
|
|
908
915
|
for (const a of e.children)
|
|
909
|
-
a.type === "directory" && (t.push(a.absolutePath), t.push(...
|
|
916
|
+
a.type === "directory" && (t.push(a.absolutePath), t.push(...Qt(a)));
|
|
910
917
|
return t;
|
|
911
|
-
},
|
|
918
|
+
}, Ur = ({
|
|
912
919
|
entries: e,
|
|
913
|
-
expansion: { toggle: t, isExpanded: a, expandMultiple: n, collapseMultiple: r, isPending: o, alwaysExpanded: l = !1, doubleClickAction:
|
|
914
|
-
selection: { onEntryClick:
|
|
920
|
+
expansion: { toggle: t, isExpanded: a, expandMultiple: n, collapseMultiple: r, isPending: o, alwaysExpanded: l = !1, doubleClickAction: u = "recursive" },
|
|
921
|
+
selection: { onEntryClick: E, selectedPath: b, mode: d = "none", selectedItems: f, onSelectionChange: g },
|
|
915
922
|
visual: {
|
|
916
|
-
className:
|
|
923
|
+
className: v,
|
|
917
924
|
style: S,
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
925
|
+
ariaLabel: m,
|
|
926
|
+
ariaLabelledBy: x,
|
|
927
|
+
lineColor: k = "#A0AEC0",
|
|
928
|
+
showTreeLines: I = !0,
|
|
929
|
+
showExpandIcons: N = !0,
|
|
930
|
+
showDirectoryIcons: w = !0,
|
|
931
|
+
showFileIcons: h = !0,
|
|
932
|
+
iconOverrides: D,
|
|
933
|
+
expandIconSize: C,
|
|
934
|
+
itemHeight: M = Le,
|
|
935
|
+
removeRootIndent: J = !1,
|
|
936
|
+
highlightStyles: F,
|
|
937
|
+
entryClassName: H,
|
|
938
|
+
entryStyle: q,
|
|
930
939
|
nameClassName: K,
|
|
931
940
|
nameStyle: R,
|
|
932
941
|
directoryNameClassName: z,
|
|
933
|
-
directoryNameStyle:
|
|
934
|
-
fileNameClassName:
|
|
935
|
-
fileNameStyle:
|
|
942
|
+
directoryNameStyle: B,
|
|
943
|
+
fileNameClassName: Y,
|
|
944
|
+
fileNameStyle: ae
|
|
936
945
|
} = {},
|
|
937
|
-
virtualScroll:
|
|
938
|
-
grid:
|
|
939
|
-
sort:
|
|
946
|
+
virtualScroll: te,
|
|
947
|
+
grid: A,
|
|
948
|
+
sort: s
|
|
940
949
|
}) => {
|
|
941
|
-
const
|
|
942
|
-
overscanCount:
|
|
943
|
-
className:
|
|
944
|
-
background:
|
|
945
|
-
onScroll:
|
|
946
|
-
onRangeChange:
|
|
947
|
-
initialScrollIndex:
|
|
948
|
-
initialScrollOffset:
|
|
949
|
-
callbackThrottleMs:
|
|
950
|
-
contentInsets:
|
|
951
|
-
onItemFocus:
|
|
952
|
-
viewportHeightOverride:
|
|
953
|
-
scrollBarOptions:
|
|
954
|
-
behaviorOptions:
|
|
955
|
-
preserveScrollAnchor:
|
|
956
|
-
getItemKey:
|
|
950
|
+
const p = A !== void 0, [y, j] = ce(!1), L = ue(null), G = ue(null), P = ue(null), [Q, re] = ce(0), [oe, we] = ce(0), [xe, be] = ce(0), [ee, He] = ce(null), {
|
|
951
|
+
overscanCount: Se = 15,
|
|
952
|
+
className: Re,
|
|
953
|
+
background: Pe,
|
|
954
|
+
onScroll: _e,
|
|
955
|
+
onRangeChange: je,
|
|
956
|
+
initialScrollIndex: le,
|
|
957
|
+
initialScrollOffset: ne,
|
|
958
|
+
callbackThrottleMs: Qe = 5,
|
|
959
|
+
contentInsets: ke,
|
|
960
|
+
onItemFocus: et,
|
|
961
|
+
viewportHeightOverride: ie,
|
|
962
|
+
scrollBarOptions: We,
|
|
963
|
+
behaviorOptions: tt,
|
|
964
|
+
preserveScrollAnchor: rt = !1,
|
|
965
|
+
getItemKey: er,
|
|
957
966
|
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
958
967
|
// (`role="tree"` は本コンポーネント自身のコンテナに付くため contentProps とは別要素で衝突しない)
|
|
959
|
-
testId:
|
|
960
|
-
contentProps:
|
|
961
|
-
} =
|
|
962
|
-
(
|
|
963
|
-
|
|
968
|
+
testId: nt,
|
|
969
|
+
contentProps: st
|
|
970
|
+
} = te ?? {}, [Ae, Be] = ce(typeof ne == "number" ? ne : 0), ze = ue(typeof ne == "number" ? ne : 0), at = W(
|
|
971
|
+
(c, T) => {
|
|
972
|
+
ze.current = c, Be(c), _e?.(c, T);
|
|
964
973
|
},
|
|
965
|
-
[
|
|
966
|
-
),
|
|
967
|
-
(
|
|
968
|
-
const { renderingStartIndex:
|
|
969
|
-
|
|
974
|
+
[_e]
|
|
975
|
+
), ot = W(
|
|
976
|
+
(c) => {
|
|
977
|
+
const { renderingStartIndex: T, renderingEndIndex: $ } = c;
|
|
978
|
+
He((X) => X && X.renderStart === T && X.renderEnd === $ ? X : { renderStart: T, renderEnd: $ }), je?.(c);
|
|
970
979
|
},
|
|
971
|
-
[
|
|
980
|
+
[je]
|
|
972
981
|
);
|
|
973
|
-
|
|
974
|
-
typeof
|
|
975
|
-
}, [
|
|
976
|
-
|
|
977
|
-
}, []),
|
|
978
|
-
const
|
|
979
|
-
if (
|
|
980
|
-
const
|
|
981
|
-
|
|
982
|
+
me(() => {
|
|
983
|
+
typeof ne == "number" && Be(ne);
|
|
984
|
+
}, [ne]), me(() => {
|
|
985
|
+
j(!0), Lr();
|
|
986
|
+
}, []), me(() => {
|
|
987
|
+
const c = L.current, T = p ? G.current : c, $ = () => {
|
|
988
|
+
if (c) {
|
|
989
|
+
const se = c.clientWidth;
|
|
990
|
+
we((de) => Math.abs(de - se) > 1 ? se : de);
|
|
982
991
|
}
|
|
983
|
-
if (typeof
|
|
984
|
-
|
|
985
|
-
else if (
|
|
986
|
-
const
|
|
987
|
-
|
|
992
|
+
if (typeof ie == "number")
|
|
993
|
+
re((se) => Math.abs(se - ie) > 1 ? ie : se);
|
|
994
|
+
else if (T) {
|
|
995
|
+
const se = T.clientHeight;
|
|
996
|
+
re((de) => Math.abs(de - se) > 1 ? se : de);
|
|
988
997
|
}
|
|
989
998
|
};
|
|
990
|
-
if (!(
|
|
991
|
-
|
|
992
|
-
const
|
|
993
|
-
return
|
|
994
|
-
}, [
|
|
995
|
-
const
|
|
999
|
+
if (!(c || T)) return re(0);
|
|
1000
|
+
$();
|
|
1001
|
+
const X = new ResizeObserver($);
|
|
1002
|
+
return c && X.observe(c), T && T !== c && X.observe(T), () => X.disconnect();
|
|
1003
|
+
}, [ie, p]);
|
|
1004
|
+
const fe = typeof ie == "number" ? ie : Q, he = W((c) => l || (y ? a(c) : !1), [y, a, l]), lt = _(O.container, o && O.containerPending, v), it = Z(
|
|
996
1005
|
() => ({
|
|
997
|
-
...
|
|
1006
|
+
...Dr,
|
|
998
1007
|
...S ?? {},
|
|
999
|
-
...typeof
|
|
1008
|
+
...typeof ie == "number" ? { height: ie, minHeight: ie } : {}
|
|
1000
1009
|
}),
|
|
1001
|
-
[S,
|
|
1002
|
-
),
|
|
1003
|
-
(
|
|
1004
|
-
const
|
|
1005
|
-
if (
|
|
1006
|
-
if (
|
|
1007
|
-
if (
|
|
1008
|
-
console.warn(`[DirectoryTree] Unknown double click action: ${
|
|
1010
|
+
[S, ie]
|
|
1011
|
+
), Ye = W(
|
|
1012
|
+
(c, T) => {
|
|
1013
|
+
const $ = [c.absolutePath, ...Qt(c)], X = T || u;
|
|
1014
|
+
if ($.every((Ie) => he(Ie))) return r($);
|
|
1015
|
+
if ($.every((Ie) => !he(Ie)) || X === "recursive") return n($);
|
|
1016
|
+
if (X === "toggle") return r($);
|
|
1017
|
+
console.warn(`[DirectoryTree] Unknown double click action: ${X}. No action taken.`);
|
|
1009
1018
|
},
|
|
1010
|
-
[
|
|
1011
|
-
),
|
|
1012
|
-
() =>
|
|
1013
|
-
const
|
|
1014
|
-
return { ...
|
|
1019
|
+
[he, n, r, u]
|
|
1020
|
+
), ct = p ? !1 : J, { flatItems: dt, lineItems: Ge, maxIndent: ut } = Z(() => $r(e, he, I, ct, s), [e, he, I, ct, s]), V = Z(
|
|
1021
|
+
() => dt.map((c, T) => {
|
|
1022
|
+
const $ = typeof M == "function" ? M(c.entry, T) : M;
|
|
1023
|
+
return { ...c, rowHeight: Number.isFinite($) && $ > 0 ? $ : Le };
|
|
1015
1024
|
}),
|
|
1016
|
-
[
|
|
1017
|
-
),
|
|
1018
|
-
const
|
|
1019
|
-
|
|
1020
|
-
for (let
|
|
1021
|
-
|
|
1022
|
-
return
|
|
1023
|
-
}, [
|
|
1024
|
-
() => !
|
|
1025
|
-
[
|
|
1026
|
-
),
|
|
1027
|
-
() =>
|
|
1028
|
-
[
|
|
1029
|
-
),
|
|
1030
|
-
|
|
1025
|
+
[dt, M]
|
|
1026
|
+
), pe = Z(() => V.map((c) => c.rowHeight), [V]), ve = Z(() => {
|
|
1027
|
+
const c = new Array(pe.length + 1);
|
|
1028
|
+
c[0] = 0;
|
|
1029
|
+
for (let T = 0; T < pe.length; T++)
|
|
1030
|
+
c[T + 1] = c[T] + pe[T];
|
|
1031
|
+
return c;
|
|
1032
|
+
}, [pe]), mt = W((c) => V[c]?.rowHeight ?? Le, [V]), tr = W((c) => V[c]?.entry.absolutePath ?? c, [V]), ft = er ?? tr, Me = Z(
|
|
1033
|
+
() => !I || Ge.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : Wr(Ge, pe, ve, $e, I, C ?? Lt),
|
|
1034
|
+
[Ge, pe, ve, I, C]
|
|
1035
|
+
), Oe = Z(() => !I || e.length === 0 ? 0 : (ut + 2) * $e, [e.length, ut, I]), { renderStart: ht, renderEnd: pt, lookaheadEnd: yt } = Z(
|
|
1036
|
+
() => Hr(V.length, fe, Se, ee, Ae, ve),
|
|
1037
|
+
[V.length, fe, Se, ee, Ae, ve]
|
|
1038
|
+
), Ve = Z(() => !I || Oe <= 0 || fe <= 0 || Me.segmentsByItem.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("div", { className: "absolute top-0 left-0", style: { width: Oe, height: fe }, children: /* @__PURE__ */ i.jsx(
|
|
1039
|
+
Kt,
|
|
1031
1040
|
{
|
|
1032
|
-
segmentsByItem:
|
|
1033
|
-
glyphsByItem:
|
|
1034
|
-
itemHeight:
|
|
1035
|
-
width:
|
|
1036
|
-
viewportHeight:
|
|
1037
|
-
scrollPosition:
|
|
1038
|
-
color:
|
|
1039
|
-
expandGlyphColor:
|
|
1040
|
-
expandGlyphSize:
|
|
1041
|
-
renderStartIndex:
|
|
1042
|
-
renderEndIndex:
|
|
1043
|
-
lookaheadEndIndex:
|
|
1041
|
+
segmentsByItem: Me.segmentsByItem,
|
|
1042
|
+
glyphsByItem: Me.glyphsByItem,
|
|
1043
|
+
itemHeight: pe[0] ?? Le,
|
|
1044
|
+
width: Oe,
|
|
1045
|
+
viewportHeight: fe,
|
|
1046
|
+
scrollPosition: Ae,
|
|
1047
|
+
color: k,
|
|
1048
|
+
expandGlyphColor: k,
|
|
1049
|
+
expandGlyphSize: C ?? Lt,
|
|
1050
|
+
renderStartIndex: ht,
|
|
1051
|
+
renderEndIndex: pt,
|
|
1052
|
+
lookaheadEndIndex: yt
|
|
1044
1053
|
}
|
|
1045
|
-
) }) }), [
|
|
1046
|
-
|
|
1047
|
-
const
|
|
1048
|
-
if (
|
|
1054
|
+
) }) }), [Oe, fe, ht, pt, yt, Ae, Me, k, I, C, pe]), xt = W((c) => V[c], [V]), bt = ue(null);
|
|
1055
|
+
lr(() => {
|
|
1056
|
+
const c = bt.current;
|
|
1057
|
+
if (bt.current = { items: V, offsets: ve }, !rt || !c || c.items === V)
|
|
1049
1058
|
return;
|
|
1050
|
-
const
|
|
1051
|
-
if (!
|
|
1059
|
+
const T = P.current, $ = typeof ke == "number" ? ke : ke?.top ?? 0, X = T ? T.getScrollPosition() : ze.current, se = X - $, de = Cr(c.items, c.offsets, se);
|
|
1060
|
+
if (!de)
|
|
1052
1061
|
return;
|
|
1053
|
-
const
|
|
1054
|
-
if (
|
|
1062
|
+
const Ie = Rr(de, V, ve);
|
|
1063
|
+
if (Ie === null)
|
|
1055
1064
|
return;
|
|
1056
|
-
const
|
|
1057
|
-
if (Math.abs(
|
|
1065
|
+
const Ue = Ie + $;
|
|
1066
|
+
if (Math.abs(Ue - X) < 1)
|
|
1058
1067
|
return;
|
|
1059
|
-
const
|
|
1060
|
-
|
|
1061
|
-
}, [
|
|
1062
|
-
const
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
}, [
|
|
1066
|
-
const
|
|
1067
|
-
() => ({ iconOverrides:
|
|
1068
|
-
[
|
|
1069
|
-
),
|
|
1068
|
+
const St = T?.scrollTo(Ue) ?? Ue;
|
|
1069
|
+
ze.current = St, Be(St);
|
|
1070
|
+
}, [V, ve, rt, ke]);
|
|
1071
|
+
const ye = A?.columns, Ne = A?.scrollBarWidth ?? We?.width ?? Zt, U = Z(() => ye ? Ir({ measuredWidth: oe, columns: ye, scrollBarWidth: Ne }) : null, [ye, oe, Ne]), Fe = Z(() => ye ? Er(ye) : "", [ye]), rr = Z(() => A?.showFooter && ye ? jr(e) : [], [A?.showFooter, ye, e]), Ee = U?.maxHScroll ?? 0;
|
|
1072
|
+
me(() => {
|
|
1073
|
+
be((c) => Xe(c, Ee));
|
|
1074
|
+
}, [Ee]);
|
|
1075
|
+
const vt = W((c) => be((T) => Xe(T + c, Ee)), [Ee]), gt = Z(
|
|
1076
|
+
() => ({ iconOverrides: D, showExpandIcons: N, showDirectoryIcons: w, showFileIcons: h, useCanvasExpandIcons: I, expandIconSize: C, highlightStyles: F }),
|
|
1077
|
+
[D, N, w, h, I, C, F]
|
|
1078
|
+
), wt = Z(
|
|
1070
1079
|
() => /* @__PURE__ */ i.jsx(
|
|
1071
|
-
|
|
1080
|
+
dr,
|
|
1072
1081
|
{
|
|
1073
|
-
ref:
|
|
1074
|
-
itemCount:
|
|
1075
|
-
getItem:
|
|
1076
|
-
getItemHeight:
|
|
1077
|
-
getItemKey:
|
|
1078
|
-
testId:
|
|
1079
|
-
contentProps:
|
|
1080
|
-
viewportSize:
|
|
1081
|
-
overscanCount:
|
|
1082
|
-
onScroll:
|
|
1083
|
-
onRangeChange:
|
|
1084
|
-
className:
|
|
1085
|
-
onWheelHorizontal:
|
|
1082
|
+
ref: P,
|
|
1083
|
+
itemCount: V.length,
|
|
1084
|
+
getItem: xt,
|
|
1085
|
+
getItemHeight: mt,
|
|
1086
|
+
getItemKey: ft,
|
|
1087
|
+
testId: nt,
|
|
1088
|
+
contentProps: st,
|
|
1089
|
+
viewportSize: fe,
|
|
1090
|
+
overscanCount: Se,
|
|
1091
|
+
onScroll: at,
|
|
1092
|
+
onRangeChange: ot,
|
|
1093
|
+
className: Re,
|
|
1094
|
+
onWheelHorizontal: p ? vt : void 0,
|
|
1086
1095
|
background: /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1087
|
-
|
|
1096
|
+
p && U ? (
|
|
1088
1097
|
// Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
|
|
1089
|
-
/* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width:
|
|
1090
|
-
) :
|
|
1091
|
-
|
|
1098
|
+
/* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: U.nameWidth }, "aria-hidden": "true", children: Ve })
|
|
1099
|
+
) : Ve,
|
|
1100
|
+
Pe
|
|
1092
1101
|
] }),
|
|
1093
|
-
initialScrollIndex:
|
|
1094
|
-
initialScrollOffset:
|
|
1095
|
-
onItemFocus:
|
|
1096
|
-
callbackThrottleMs:
|
|
1097
|
-
contentInsets:
|
|
1098
|
-
scrollBarOptions:
|
|
1099
|
-
behaviorOptions:
|
|
1100
|
-
children: (
|
|
1101
|
-
|
|
1102
|
+
initialScrollIndex: le,
|
|
1103
|
+
initialScrollOffset: ne,
|
|
1104
|
+
onItemFocus: et,
|
|
1105
|
+
callbackThrottleMs: Qe,
|
|
1106
|
+
contentInsets: ke,
|
|
1107
|
+
scrollBarOptions: We,
|
|
1108
|
+
behaviorOptions: tt,
|
|
1109
|
+
children: (c, T) => c ? p && A && U ? /* @__PURE__ */ i.jsx(
|
|
1110
|
+
Xt,
|
|
1102
1111
|
{
|
|
1103
|
-
entry:
|
|
1104
|
-
indentLevel:
|
|
1105
|
-
positionInSet:
|
|
1106
|
-
setSize:
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1112
|
+
entry: c.entry,
|
|
1113
|
+
indentLevel: c.indentLevel,
|
|
1114
|
+
positionInSet: c.positionInSet,
|
|
1115
|
+
setSize: c.setSize,
|
|
1116
|
+
rowIndex: T + (A.showHeader ?? !0 ? 2 : 1),
|
|
1117
|
+
isSelectedForAria: d === "single" ? c.entry.absolutePath === b : !!f?.has(c.entry.absolutePath),
|
|
1118
|
+
rowHeight: c.rowHeight,
|
|
1119
|
+
isDirOpen: he,
|
|
1120
|
+
columns: A.columns,
|
|
1121
|
+
numericTemplate: Fe,
|
|
1122
|
+
numericTotal: U.numericTotal,
|
|
1123
|
+
nameWidth: U.nameWidth,
|
|
1124
|
+
rowClassName: A.rowClassName,
|
|
1125
|
+
selection: { onEntryClick: E, selectedPath: b ?? null, mode: d, selectedItems: f, onSelectionChange: g },
|
|
1126
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: Ye },
|
|
1127
|
+
visual: gt
|
|
1117
1128
|
},
|
|
1118
|
-
|
|
1129
|
+
c.entry.absolutePath
|
|
1119
1130
|
) : /* @__PURE__ */ i.jsx(
|
|
1120
|
-
|
|
1131
|
+
Ke,
|
|
1121
1132
|
{
|
|
1122
|
-
entry:
|
|
1123
|
-
indentLevel:
|
|
1124
|
-
depth:
|
|
1125
|
-
positionInSet:
|
|
1126
|
-
setSize:
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1133
|
+
entry: c.entry,
|
|
1134
|
+
indentLevel: c.indentLevel,
|
|
1135
|
+
depth: c.depth,
|
|
1136
|
+
positionInSet: c.positionInSet,
|
|
1137
|
+
setSize: c.setSize,
|
|
1138
|
+
isSelectedForAria: d === "single" ? c.entry.absolutePath === b : !!f?.has(c.entry.absolutePath),
|
|
1139
|
+
rowHeight: c.rowHeight,
|
|
1140
|
+
isDirOpen: he,
|
|
1141
|
+
parentIsLast: c.parentIsLast,
|
|
1130
1142
|
renderChildren: !1,
|
|
1131
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1132
|
-
selection: { onEntryClick:
|
|
1143
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: Ye },
|
|
1144
|
+
selection: { onEntryClick: E, selectedPath: b ?? null, mode: d, selectedItems: f, onSelectionChange: g },
|
|
1133
1145
|
visual: {
|
|
1134
|
-
iconOverrides:
|
|
1135
|
-
showExpandIcons:
|
|
1136
|
-
showDirectoryIcons:
|
|
1137
|
-
showFileIcons:
|
|
1138
|
-
useCanvasExpandIcons:
|
|
1139
|
-
expandIconSize:
|
|
1140
|
-
highlightStyles:
|
|
1141
|
-
entryClassName:
|
|
1142
|
-
entryStyle:
|
|
1146
|
+
iconOverrides: D,
|
|
1147
|
+
showExpandIcons: N,
|
|
1148
|
+
showDirectoryIcons: w,
|
|
1149
|
+
showFileIcons: h,
|
|
1150
|
+
useCanvasExpandIcons: I,
|
|
1151
|
+
expandIconSize: C,
|
|
1152
|
+
highlightStyles: F,
|
|
1153
|
+
entryClassName: H,
|
|
1154
|
+
entryStyle: q,
|
|
1143
1155
|
nameClassName: K,
|
|
1144
1156
|
nameStyle: R,
|
|
1145
1157
|
directoryNameClassName: z,
|
|
1146
|
-
directoryNameStyle:
|
|
1147
|
-
fileNameClassName:
|
|
1148
|
-
fileNameStyle:
|
|
1158
|
+
directoryNameStyle: B,
|
|
1159
|
+
fileNameClassName: Y,
|
|
1160
|
+
fileNameStyle: ae
|
|
1149
1161
|
}
|
|
1150
1162
|
},
|
|
1151
|
-
|
|
1163
|
+
c.entry.absolutePath
|
|
1152
1164
|
) : null
|
|
1153
1165
|
}
|
|
1154
1166
|
),
|
|
1155
1167
|
[
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
tt,
|
|
1161
|
-
rt,
|
|
1162
|
-
me,
|
|
1163
|
-
be,
|
|
1168
|
+
V.length,
|
|
1169
|
+
xt,
|
|
1170
|
+
mt,
|
|
1171
|
+
ft,
|
|
1164
1172
|
nt,
|
|
1165
1173
|
st,
|
|
1166
|
-
|
|
1167
|
-
G,
|
|
1168
|
-
xt,
|
|
1169
|
-
X,
|
|
1170
|
-
Ge,
|
|
1171
|
-
Ce,
|
|
1174
|
+
fe,
|
|
1172
1175
|
Se,
|
|
1176
|
+
at,
|
|
1177
|
+
ot,
|
|
1178
|
+
Re,
|
|
1179
|
+
p,
|
|
1180
|
+
vt,
|
|
1173
1181
|
U,
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1182
|
+
Ve,
|
|
1183
|
+
Pe,
|
|
1184
|
+
le,
|
|
1185
|
+
ne,
|
|
1186
|
+
et,
|
|
1178
1187
|
Qe,
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
k,
|
|
1187
|
-
t,
|
|
1188
|
-
ze,
|
|
1189
|
-
vt,
|
|
1188
|
+
ke,
|
|
1189
|
+
We,
|
|
1190
|
+
tt,
|
|
1191
|
+
A,
|
|
1192
|
+
Fe,
|
|
1193
|
+
he,
|
|
1194
|
+
E,
|
|
1190
1195
|
b,
|
|
1191
|
-
|
|
1192
|
-
|
|
1196
|
+
d,
|
|
1197
|
+
f,
|
|
1198
|
+
g,
|
|
1199
|
+
t,
|
|
1200
|
+
Ye,
|
|
1201
|
+
gt,
|
|
1202
|
+
D,
|
|
1193
1203
|
N,
|
|
1204
|
+
w,
|
|
1194
1205
|
h,
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1206
|
+
I,
|
|
1207
|
+
C,
|
|
1208
|
+
F,
|
|
1209
|
+
H,
|
|
1210
|
+
q,
|
|
1199
1211
|
K,
|
|
1200
1212
|
R,
|
|
1201
1213
|
z,
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1214
|
+
B,
|
|
1215
|
+
Y,
|
|
1216
|
+
ae
|
|
1205
1217
|
]
|
|
1206
1218
|
);
|
|
1207
|
-
if (!(
|
|
1208
|
-
return /* @__PURE__ */ i.jsx("div", { ref:
|
|
1209
|
-
const
|
|
1210
|
-
return /* @__PURE__ */ i.jsxs(
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1219
|
+
if (!(A && U))
|
|
1220
|
+
return /* @__PURE__ */ i.jsx("div", { ref: L, className: lt, style: it, role: "tree", "aria-label": x ? void 0 : m, "aria-labelledby": x, "aria-multiselectable": d === "multiple" ? !0 : void 0, children: wt });
|
|
1221
|
+
const nr = A.showHeader ?? !0, sr = A.showFooter ?? !1, ar = { ...it, "--dt-hscroll": `${xe}px` };
|
|
1222
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1223
|
+
"div",
|
|
1224
|
+
{
|
|
1225
|
+
ref: L,
|
|
1226
|
+
className: _(lt, "dt-grid"),
|
|
1227
|
+
style: ar,
|
|
1228
|
+
role: "treegrid",
|
|
1229
|
+
"aria-label": x ? void 0 : m,
|
|
1230
|
+
"aria-labelledby": x,
|
|
1231
|
+
"aria-multiselectable": d === "multiple" ? !0 : void 0,
|
|
1232
|
+
"aria-rowcount": V.length + (A.showHeader ?? !0 ? 1 : 0),
|
|
1233
|
+
children: [
|
|
1234
|
+
nr && /* @__PURE__ */ i.jsx(Sr, { columns: A.columns, numericTemplate: Fe, numericTotal: U.numericTotal, nameWidth: U.nameWidth, scrollBarWidth: Ne, className: A.headerClassName }),
|
|
1235
|
+
/* @__PURE__ */ i.jsx("div", { ref: G, className: "dt-grid-body", children: wt }),
|
|
1236
|
+
Ee > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
|
|
1237
|
+
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: U.nameWidth }, "aria-hidden": "true" }),
|
|
1238
|
+
/* @__PURE__ */ i.jsx(
|
|
1239
|
+
ur,
|
|
1240
|
+
{
|
|
1241
|
+
horizontal: !0,
|
|
1242
|
+
contentSize: U.numericTotal,
|
|
1243
|
+
viewportSize: U.numericVisible,
|
|
1244
|
+
scrollPosition: xe,
|
|
1245
|
+
scrollBarWidth: Ne,
|
|
1246
|
+
onScroll: (c) => {
|
|
1247
|
+
const T = typeof c == "function" ? c(xe) : c, $ = Xe(T, Ee);
|
|
1248
|
+
return be($), $;
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
),
|
|
1252
|
+
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Ne }, "aria-hidden": "true" })
|
|
1253
|
+
] }),
|
|
1254
|
+
sr && /* @__PURE__ */ i.jsx(kr, { columns: A.columns, numericTemplate: Fe, numericTotal: U.numericTotal, nameWidth: U.nameWidth, scrollBarWidth: Ne, allEntries: rr, className: A.footerClassName })
|
|
1255
|
+
]
|
|
1256
|
+
}
|
|
1257
|
+
);
|
|
1258
|
+
}, Xr = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
|
|
1259
|
+
const [a, n] = cr(), [r, o] = ce(() => {
|
|
1235
1260
|
if (typeof window < "u" && t)
|
|
1236
1261
|
try {
|
|
1237
|
-
const
|
|
1238
|
-
if (
|
|
1239
|
-
const
|
|
1240
|
-
return new Set(
|
|
1262
|
+
const m = window.localStorage.getItem(t);
|
|
1263
|
+
if (m) {
|
|
1264
|
+
const x = JSON.parse(m);
|
|
1265
|
+
return new Set(x);
|
|
1241
1266
|
}
|
|
1242
|
-
} catch (
|
|
1243
|
-
console.error("[useDirectoryTreeState] Error reading from localStorage",
|
|
1267
|
+
} catch (m) {
|
|
1268
|
+
console.error("[useDirectoryTreeState] Error reading from localStorage", m);
|
|
1244
1269
|
}
|
|
1245
1270
|
return e;
|
|
1246
|
-
}), l = W((
|
|
1271
|
+
}), l = W((m) => {
|
|
1247
1272
|
n(() => {
|
|
1248
|
-
o((
|
|
1249
|
-
const
|
|
1250
|
-
return
|
|
1273
|
+
o((x) => {
|
|
1274
|
+
const k = new Set(x);
|
|
1275
|
+
return m(k), k;
|
|
1251
1276
|
});
|
|
1252
1277
|
});
|
|
1253
|
-
}, []),
|
|
1254
|
-
(
|
|
1255
|
-
l((
|
|
1256
|
-
for (const
|
|
1257
|
-
|
|
1278
|
+
}, []), u = W(
|
|
1279
|
+
(m, x) => {
|
|
1280
|
+
l((k) => {
|
|
1281
|
+
for (const I of m)
|
|
1282
|
+
x(k, I);
|
|
1258
1283
|
});
|
|
1259
1284
|
},
|
|
1260
1285
|
[l]
|
|
1261
1286
|
);
|
|
1262
|
-
|
|
1287
|
+
me(() => {
|
|
1263
1288
|
if (t && typeof window < "u")
|
|
1264
1289
|
try {
|
|
1265
1290
|
window.localStorage.setItem(t, JSON.stringify(Array.from(r)));
|
|
1266
|
-
} catch (
|
|
1267
|
-
console.warn(`Error setting localStorage key "${t}":`,
|
|
1291
|
+
} catch (m) {
|
|
1292
|
+
console.warn(`Error setting localStorage key "${t}":`, m);
|
|
1268
1293
|
}
|
|
1269
1294
|
}, [r, t]);
|
|
1270
|
-
const
|
|
1271
|
-
(
|
|
1272
|
-
|
|
1273
|
-
|
|
1295
|
+
const E = W(
|
|
1296
|
+
(m) => {
|
|
1297
|
+
u([m], (x, k) => {
|
|
1298
|
+
x.has(k) ? x.delete(k) : x.add(k);
|
|
1274
1299
|
});
|
|
1275
1300
|
},
|
|
1276
|
-
[
|
|
1277
|
-
),
|
|
1278
|
-
(
|
|
1279
|
-
|
|
1280
|
-
|
|
1301
|
+
[u]
|
|
1302
|
+
), b = W(
|
|
1303
|
+
(m) => {
|
|
1304
|
+
u([m], (x, k) => {
|
|
1305
|
+
x.add(k);
|
|
1281
1306
|
});
|
|
1282
1307
|
},
|
|
1283
|
-
[
|
|
1284
|
-
),
|
|
1285
|
-
(
|
|
1286
|
-
|
|
1287
|
-
|
|
1308
|
+
[u]
|
|
1309
|
+
), d = W(
|
|
1310
|
+
(m) => {
|
|
1311
|
+
u([m], (x, k) => {
|
|
1312
|
+
x.delete(k);
|
|
1288
1313
|
});
|
|
1289
1314
|
},
|
|
1290
|
-
[
|
|
1291
|
-
),
|
|
1292
|
-
(
|
|
1293
|
-
m
|
|
1294
|
-
|
|
1315
|
+
[u]
|
|
1316
|
+
), f = W(
|
|
1317
|
+
(m) => {
|
|
1318
|
+
u(m, (x, k) => {
|
|
1319
|
+
x.delete(k);
|
|
1295
1320
|
});
|
|
1296
1321
|
},
|
|
1297
|
-
[
|
|
1298
|
-
),
|
|
1299
|
-
(
|
|
1300
|
-
m
|
|
1301
|
-
|
|
1322
|
+
[u]
|
|
1323
|
+
), g = W(
|
|
1324
|
+
(m) => {
|
|
1325
|
+
u(m, (x, k) => {
|
|
1326
|
+
x.add(k);
|
|
1302
1327
|
});
|
|
1303
1328
|
},
|
|
1304
|
-
[
|
|
1305
|
-
),
|
|
1306
|
-
l((
|
|
1307
|
-
|
|
1329
|
+
[u]
|
|
1330
|
+
), v = W(() => {
|
|
1331
|
+
l((m) => {
|
|
1332
|
+
m.clear();
|
|
1308
1333
|
});
|
|
1309
|
-
}, [l]), S = W((
|
|
1334
|
+
}, [l]), S = W((m) => r.has(m), [r]);
|
|
1310
1335
|
return {
|
|
1311
1336
|
expanded: r,
|
|
1312
|
-
toggle:
|
|
1313
|
-
expand:
|
|
1314
|
-
collapse:
|
|
1315
|
-
collapseMultiple:
|
|
1316
|
-
expandMultiple:
|
|
1317
|
-
collapseAll:
|
|
1337
|
+
toggle: E,
|
|
1338
|
+
expand: b,
|
|
1339
|
+
collapse: d,
|
|
1340
|
+
collapseMultiple: f,
|
|
1341
|
+
expandMultiple: g,
|
|
1342
|
+
collapseAll: v,
|
|
1318
1343
|
isExpanded: S,
|
|
1319
1344
|
isPending: a
|
|
1320
1345
|
};
|
|
1321
1346
|
};
|
|
1322
1347
|
export {
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1348
|
+
Ur as DirectoryTree,
|
|
1349
|
+
O as directoryTreeClasses,
|
|
1350
|
+
Xr as useDirectoryTreeState
|
|
1326
1351
|
};
|