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