@aiquants/directory-tree 3.7.1 → 3.8.1
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.map +1 -1
- package/dist/entryRendering.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +681 -620
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/DirectoryTree.tsx +18 -22
- package/src/entryRendering.tsx +3 -1
- package/src/types.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { FileMd as
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
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";
|
|
4
|
+
import { twMerge as A } from "tailwind-merge";
|
|
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,271 +24,334 @@ function jr() {
|
|
|
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
29
|
var _e = {};
|
|
30
|
-
var
|
|
30
|
+
var Xt;
|
|
31
31
|
function Rr() {
|
|
32
|
-
return
|
|
33
|
-
function e(
|
|
34
|
-
if (
|
|
35
|
-
if (typeof
|
|
36
|
-
return
|
|
37
|
-
if (typeof
|
|
38
|
-
switch (
|
|
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";
|
|
45
45
|
case L:
|
|
46
46
|
return "Suspense";
|
|
47
|
-
case
|
|
47
|
+
case C:
|
|
48
48
|
return "SuspenseList";
|
|
49
|
-
case
|
|
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 =
|
|
67
|
-
case
|
|
68
|
-
m =
|
|
66
|
+
return m = a.displayName || null, m !== null ? m : e(a.type) || "Memo";
|
|
67
|
+
case Q:
|
|
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,
|
|
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
|
-
|
|
93
|
-
), t(
|
|
92
|
+
M
|
|
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 (
|
|
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
|
-
_owner:
|
|
147
|
-
}, (
|
|
146
|
+
_owner: M
|
|
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
169
|
value: le
|
|
170
|
-
}), Object.freeze && (Object.freeze(
|
|
170
|
+
}), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
|
|
171
171
|
}
|
|
172
|
-
function d(
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
h(
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
function d(a, m, T, M, se, le) {
|
|
173
|
+
var v = m.children;
|
|
174
|
+
if (v !== void 0)
|
|
175
|
+
if (M)
|
|
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(
|
|
185
|
-
if (
|
|
186
|
-
|
|
184
|
+
else h(v);
|
|
185
|
+
if (te.call(m, "key")) {
|
|
186
|
+
v = e(a);
|
|
187
187
|
var z = Object.keys(m).filter(function(V) {
|
|
188
188
|
return V !== "key";
|
|
189
189
|
});
|
|
190
|
-
|
|
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} />
|
|
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
|
-
|
|
197
|
+
M,
|
|
198
|
+
v,
|
|
199
199
|
z,
|
|
200
|
-
|
|
201
|
-
),
|
|
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 =
|
|
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
|
-
_e.Fragment = y, _e.jsx = function(
|
|
239
|
-
var
|
|
237
|
+
)(), de = Y(n(l)), P = {};
|
|
238
|
+
_e.Fragment = y, _e.jsx = function(a, m, T) {
|
|
239
|
+
var M = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
240
240
|
return d(
|
|
241
|
-
|
|
241
|
+
a,
|
|
242
242
|
m,
|
|
243
243
|
T,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
M ? Error("react-stack-top-frame") : ce,
|
|
246
|
+
M ? Y(n(a)) : de
|
|
247
247
|
);
|
|
248
|
-
}, _e.jsxs = function(
|
|
249
|
-
var
|
|
248
|
+
}, _e.jsxs = function(a, m, T) {
|
|
249
|
+
var M = 1e4 > J.recentlyCreatedOwnerStacks++;
|
|
250
250
|
return d(
|
|
251
|
-
|
|
251
|
+
a,
|
|
252
252
|
m,
|
|
253
253
|
T,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
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
|
+
}));
|
|
308
|
+
}
|
|
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
|
+
}));
|
|
264
328
|
}
|
|
265
|
-
|
|
266
|
-
const Ye = 18, Ge = 12, Jt = 10, D = {
|
|
329
|
+
const Mr = /* @__PURE__ */ oe.forwardRef(Ar), Ge = 18, Ve = 12, Zt = 10, 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",
|
|
270
333
|
// ホバー時のスタイル(ライト/ダークモード対応)
|
|
271
|
-
entryHover:
|
|
334
|
+
entryHover: A("directory-tree-entry--hover hover:bg-gray-400/15", "dark:hover:bg-gray-200/10"),
|
|
272
335
|
// 選択時のスタイル(ライト/ダークモード対応)
|
|
273
|
-
entrySelected:
|
|
336
|
+
entrySelected: A("directory-tree-entry--selected bg-blue-400/10", "dark:bg-blue-400/15"),
|
|
274
337
|
// アイテム選択時のスタイル(ライト/ダークモード対応)
|
|
275
|
-
entryItemSelected:
|
|
338
|
+
entryItemSelected: A("directory-tree-entry--item-selected bg-blue-400/20 shadow-[0_0_0_1px_rgba(59,130,246,0.3)]", "dark:bg-blue-400/25 dark:shadow-[0_0_0_1px_rgba(96,165,250,0.4)]"),
|
|
276
339
|
// アイコンのスタイル
|
|
277
|
-
expandIcon:
|
|
278
|
-
expandIconSelected:
|
|
279
|
-
typeIcon:
|
|
280
|
-
typeIconSelected:
|
|
340
|
+
expandIcon: A("directory-tree-expand-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
|
|
341
|
+
expandIconSelected: A("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
|
|
342
|
+
typeIcon: A("directory-tree-type-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
|
|
343
|
+
typeIconSelected: A("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
|
|
281
344
|
// テキストのスタイル
|
|
282
|
-
name:
|
|
345
|
+
name: A("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal", "text-gray-700", "dark:text-gray-200"),
|
|
283
346
|
nameDirectory: "directory-tree-name--directory font-medium",
|
|
284
|
-
nameSelected:
|
|
285
|
-
},
|
|
347
|
+
nameSelected: A("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
|
|
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 !(
|
|
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 });
|
|
292
355
|
}, st = (e, t) => {
|
|
293
356
|
if (e == null || typeof e == "boolean") return null;
|
|
294
357
|
if (typeof e == "function")
|
|
@@ -300,82 +363,82 @@ const Ye = 18, Ge = 12, Jt = 10, D = {
|
|
|
300
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
425
|
return /* @__PURE__ */ i.jsx(Nr, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
|
|
363
|
-
},
|
|
364
|
-
const { entry:
|
|
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,48 +448,48 @@ 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,
|
|
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
|
-
return $?.itemSelectedClassName !== void 0 ? $.itemSelectedClassName :
|
|
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 =
|
|
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",
|
|
@@ -434,328 +497,328 @@ const Ye = 18, Ge = 12, Jt = 10, D = {
|
|
|
434
497
|
className: T,
|
|
435
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:
|
|
449
|
-
onMouseEnter: () =>
|
|
450
|
-
onMouseLeave: () =>
|
|
451
|
-
onKeyDown: (ae) => ae.key === "Enter" &&
|
|
511
|
+
onClick: de,
|
|
512
|
+
onMouseEnter: () => te(!0),
|
|
513
|
+
onMouseLeave: () => te(!1),
|
|
514
|
+
onKeyDown: (ae) => ae.key === "Enter" && de(ae),
|
|
452
515
|
tabIndex: 0,
|
|
453
516
|
children: [
|
|
454
|
-
/* @__PURE__ */ i.jsxs("div", { className:
|
|
455
|
-
(p || O) && /* @__PURE__ */ i.jsx("span", { className:
|
|
456
|
-
(
|
|
457
|
-
/* @__PURE__ */ i.jsx("span", { className: le, children:
|
|
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: [
|
|
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
|
-
Ne.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style:
|
|
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 [, ...
|
|
483
|
-
return /* @__PURE__ */ i.jsxs("div", { className:
|
|
484
|
-
/* @__PURE__ */ i.jsx("div", { className:
|
|
485
|
-
|
|
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";
|
|
546
|
+
return /* @__PURE__ */ i.jsxs("div", { className: A(h, "text-gray-600 dark:text-gray-300", c), role: "row", children: [
|
|
547
|
+
/* @__PURE__ */ i.jsx("div", { className: A(d, "px-1", t[0]?.className), role: g, style: { width: r }, children: u }),
|
|
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 = at(t[0],
|
|
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
|
-
}, nt = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e,
|
|
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
|
-
|
|
601
|
-
const
|
|
663
|
+
Jr(I, p.width, p.viewportHeight, L);
|
|
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(
|
|
666
|
+
const S = Math.floor(p.renderEndIndex);
|
|
667
|
+
return Math.max(Math.min(C, S + 1), O);
|
|
605
668
|
}
|
|
606
|
-
return Math.max(
|
|
669
|
+
return Math.max(Q, O);
|
|
607
670
|
})(), $ = (() => {
|
|
608
671
|
if (typeof p.lookaheadEndIndex == "number" && Number.isFinite(p.lookaheadEndIndex)) {
|
|
609
|
-
const
|
|
610
|
-
return Math.max(Y,
|
|
672
|
+
const S = Math.floor(p.lookaheadEndIndex), Y = Math.min(C, S + 1);
|
|
673
|
+
return Math.max(Y, ee);
|
|
611
674
|
}
|
|
612
|
-
return Math.max(
|
|
613
|
-
})(), J =
|
|
614
|
-
|
|
615
|
-
}, []),
|
|
675
|
+
return Math.max(Q, ee);
|
|
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
|
-
for (let
|
|
694
|
-
const O = e[
|
|
695
|
-
if (O.indentLevel >
|
|
756
|
+
for (let C = d; C < e.length; C++) {
|
|
757
|
+
const O = e[C];
|
|
758
|
+
if (O.indentLevel > E && O.ancestorIsLast.length > E && !O.ancestorIsLast[E]) {
|
|
696
759
|
L = !0;
|
|
697
760
|
break;
|
|
698
761
|
}
|
|
699
|
-
if (
|
|
762
|
+
if (C > d && O.indentLevel === E)
|
|
700
763
|
break;
|
|
701
764
|
}
|
|
702
765
|
if (L) {
|
|
703
|
-
const
|
|
766
|
+
const C = E * n + n / 2 + b;
|
|
704
767
|
g.push({
|
|
705
|
-
key: `${h.id}-ancestor-${
|
|
706
|
-
x1:
|
|
707
|
-
y1:
|
|
708
|
-
x2:
|
|
709
|
-
y2:
|
|
768
|
+
key: `${h.id}-ancestor-${E}`,
|
|
769
|
+
x1: C,
|
|
770
|
+
y1: N,
|
|
771
|
+
x2: C,
|
|
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
|
];
|
|
@@ -766,109 +829,109 @@ const Xr = {
|
|
|
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,
|
|
786
|
-
showDirectoryIcons:
|
|
849
|
+
showDirectoryIcons: C = !0,
|
|
787
850
|
showFileIcons: O = !0,
|
|
788
|
-
useCanvasExpandIcons:
|
|
789
|
-
expandIconSize:
|
|
851
|
+
useCanvasExpandIcons: Q = !1,
|
|
852
|
+
expandIconSize: ee,
|
|
790
853
|
typeIconSize: $,
|
|
791
854
|
fontSize: J,
|
|
792
|
-
indentSize:
|
|
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:
|
|
799
|
-
directoryNameStyle:
|
|
800
|
-
fileNameClassName:
|
|
860
|
+
nameStyle: ce,
|
|
861
|
+
directoryNameClassName: de,
|
|
862
|
+
directoryNameStyle: P,
|
|
863
|
+
fileNameClassName: a,
|
|
801
864
|
fileNameStyle: m
|
|
802
865
|
}
|
|
803
866
|
}) => {
|
|
804
|
-
const [T,
|
|
805
|
-
|
|
806
|
-
|
|
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(() => {
|
|
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
|
-
paddingLeft: `${Math.max(0, t *
|
|
827
|
-
transform: t < 0 ? `translateX(${t *
|
|
828
|
-
width: t < 0 ? `calc(100% + ${Math.abs(t *
|
|
889
|
+
paddingLeft: `${Math.max(0, t * te)}px`,
|
|
890
|
+
transform: t < 0 ? `translateX(${t * te}px)` : void 0,
|
|
891
|
+
width: t < 0 ? `calc(100% + ${Math.abs(t * te)}px)` : void 0,
|
|
829
892
|
height: `${d}px`,
|
|
830
|
-
...
|
|
893
|
+
...Te,
|
|
831
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:
|
|
903
|
+
onClick: pe,
|
|
841
904
|
onMouseEnter: () => le(!0),
|
|
842
905
|
onMouseLeave: () => le(!1),
|
|
843
|
-
ref: (
|
|
844
|
-
onKeyDown: (
|
|
845
|
-
if (
|
|
846
|
-
|
|
906
|
+
ref: (re) => R(c, re),
|
|
907
|
+
onKeyDown: (re) => {
|
|
908
|
+
if (re.key === "Enter" || re.key === " ") {
|
|
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 ||
|
|
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
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,294 +939,290 @@ const Xr = {
|
|
|
876
939
|
]
|
|
877
940
|
}
|
|
878
941
|
),
|
|
879
|
-
z && T && w && /* @__PURE__ */ i.jsx("fieldset", { children: T.map((
|
|
942
|
+
z && T && w && /* @__PURE__ */ i.jsx("fieldset", { children: T.map((re, Ce) => /* @__PURE__ */ i.jsx(
|
|
880
943
|
lt,
|
|
881
944
|
{
|
|
882
|
-
entry:
|
|
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,
|
|
900
|
-
showDirectoryIcons:
|
|
963
|
+
showDirectoryIcons: C,
|
|
901
964
|
showFileIcons: O,
|
|
902
|
-
useCanvasExpandIcons:
|
|
903
|
-
expandIconSize:
|
|
904
|
-
highlightStyles:
|
|
965
|
+
useCanvasExpandIcons: Q,
|
|
966
|
+
expandIconSize: ee,
|
|
967
|
+
highlightStyles: S,
|
|
905
968
|
entryClassName: Y,
|
|
906
969
|
entryStyle: B,
|
|
907
970
|
nameClassName: G,
|
|
908
|
-
nameStyle:
|
|
909
|
-
directoryNameClassName:
|
|
910
|
-
directoryNameStyle:
|
|
911
|
-
fileNameClassName:
|
|
971
|
+
nameStyle: ce,
|
|
972
|
+
directoryNameClassName: de,
|
|
973
|
+
directoryNameStyle: P,
|
|
974
|
+
fileNameClassName: a,
|
|
912
975
|
fileNameStyle: m
|
|
913
976
|
}
|
|
914
977
|
},
|
|
915
|
-
|
|
978
|
+
re.absolutePath
|
|
916
979
|
)) })
|
|
917
980
|
] }, e.absolutePath);
|
|
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
989
|
lt.displayName = "DirectoryEntryItem";
|
|
927
|
-
const
|
|
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
|
-
expandIconSize:
|
|
949
|
-
itemHeight: O =
|
|
950
|
-
removeRootIndent:
|
|
951
|
-
highlightStyles:
|
|
1011
|
+
expandIconSize: C,
|
|
1012
|
+
itemHeight: O = Ge,
|
|
1013
|
+
removeRootIndent: Q = !1,
|
|
1014
|
+
highlightStyles: ee,
|
|
952
1015
|
entryClassName: $,
|
|
953
1016
|
entryStyle: J,
|
|
954
|
-
nameClassName:
|
|
955
|
-
nameStyle:
|
|
1017
|
+
nameClassName: te,
|
|
1018
|
+
nameStyle: S,
|
|
956
1019
|
directoryNameClassName: Y,
|
|
957
1020
|
directoryNameStyle: B,
|
|
958
1021
|
fileNameClassName: G,
|
|
959
|
-
fileNameStyle:
|
|
1022
|
+
fileNameStyle: ce
|
|
960
1023
|
} = {},
|
|
961
|
-
virtualScroll:
|
|
962
|
-
grid:
|
|
963
|
-
sort:
|
|
1024
|
+
virtualScroll: de,
|
|
1025
|
+
grid: P,
|
|
1026
|
+
sort: a
|
|
964
1027
|
}) => {
|
|
965
|
-
const m =
|
|
966
|
-
overscanCount:
|
|
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,
|
|
967
1030
|
className: Ae,
|
|
968
1031
|
background: Me,
|
|
969
1032
|
onScroll: De,
|
|
970
1033
|
onRangeChange: Oe,
|
|
971
1034
|
initialScrollIndex: Fe,
|
|
972
|
-
initialScrollOffset:
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
1035
|
+
initialScrollOffset: ye,
|
|
1036
|
+
initialScrollAnchor: Le,
|
|
1037
|
+
callbackThrottleMs: Te = 5,
|
|
1038
|
+
contentInsets: re,
|
|
1039
|
+
onItemFocus: Ce,
|
|
1040
|
+
viewportHeightOverride: ue,
|
|
1041
|
+
scrollBarOptions: Xe,
|
|
978
1042
|
behaviorOptions: it,
|
|
979
1043
|
preserveScrollAnchor: ct = !1,
|
|
980
|
-
getItemKey:
|
|
1044
|
+
getItemKey: fr,
|
|
981
1045
|
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
982
1046
|
// (`role="tree"` は本コンポーネント自身のコンテナに付くため contentProps とは別要素で衝突しない)
|
|
983
1047
|
testId: dt,
|
|
984
|
-
contentProps:
|
|
985
|
-
} =
|
|
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(
|
|
986
1050
|
(o, x) => {
|
|
987
|
-
|
|
1051
|
+
Ze.current = o, ft(o), De?.(o, x);
|
|
988
1052
|
},
|
|
989
1053
|
[De]
|
|
990
|
-
),
|
|
1054
|
+
), ht = F(
|
|
991
1055
|
(o) => {
|
|
992
|
-
const { renderingStartIndex: x, renderingEndIndex:
|
|
993
|
-
|
|
1056
|
+
const { renderingStartIndex: x, renderingEndIndex: _ } = o;
|
|
1057
|
+
Ue((W) => W && W.renderStart === x && W.renderEnd === _ ? W : { renderStart: x, renderEnd: _ }), Oe?.(o);
|
|
994
1058
|
},
|
|
995
1059
|
[Oe]
|
|
996
1060
|
);
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
}, [
|
|
1000
|
-
|
|
1001
|
-
}, []), me(() => {
|
|
1002
|
-
const o = se.current, x = m ? le.current : o, M = () => {
|
|
1061
|
+
he(() => {
|
|
1062
|
+
M(!0), en();
|
|
1063
|
+
}, []), he(() => {
|
|
1064
|
+
const o = se.current, x = m ? le.current : o, _ = () => {
|
|
1003
1065
|
if (o) {
|
|
1004
|
-
const
|
|
1005
|
-
Ne((
|
|
1066
|
+
const U = o.clientWidth;
|
|
1067
|
+
Ne((Z) => Math.abs(Z - U) > 1 ? U : Z);
|
|
1006
1068
|
}
|
|
1007
|
-
if (typeof
|
|
1008
|
-
H((
|
|
1069
|
+
if (typeof ue == "number")
|
|
1070
|
+
H((U) => Math.abs(U - ue) > 1 ? ue : U);
|
|
1009
1071
|
else if (x) {
|
|
1010
|
-
const
|
|
1011
|
-
H((
|
|
1072
|
+
const U = x.clientHeight;
|
|
1073
|
+
H((Z) => Math.abs(Z - U) > 1 ? U : Z);
|
|
1012
1074
|
}
|
|
1013
1075
|
};
|
|
1014
1076
|
if (!(o || x)) return H(0);
|
|
1015
|
-
|
|
1016
|
-
const W = new ResizeObserver(
|
|
1077
|
+
_();
|
|
1078
|
+
const W = new ResizeObserver(_);
|
|
1017
1079
|
return o && W.observe(o), x && x !== o && W.observe(x), () => W.disconnect();
|
|
1018
|
-
}, [
|
|
1019
|
-
const xe = typeof
|
|
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(
|
|
1020
1082
|
() => ({
|
|
1021
|
-
...
|
|
1022
|
-
...
|
|
1023
|
-
...typeof
|
|
1083
|
+
...Qr,
|
|
1084
|
+
...N ?? {},
|
|
1085
|
+
...typeof ue == "number" ? { height: ue, minHeight: ue } : {}
|
|
1024
1086
|
}),
|
|
1025
|
-
[
|
|
1026
|
-
),
|
|
1087
|
+
[N, ue]
|
|
1088
|
+
), qe = F(
|
|
1027
1089
|
(o, x) => {
|
|
1028
|
-
const
|
|
1029
|
-
if (
|
|
1030
|
-
if (
|
|
1031
|
-
if (W === "toggle") return r(
|
|
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(_);
|
|
1093
|
+
if (W === "toggle") return r(_);
|
|
1032
1094
|
console.warn(`[DirectoryTree] Unknown double click action: ${W}. No action taken.`);
|
|
1033
1095
|
},
|
|
1034
1096
|
[fe, n, r, u]
|
|
1035
|
-
),
|
|
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(
|
|
1036
1098
|
() => we.map((o, x) => {
|
|
1037
|
-
const
|
|
1038
|
-
return { ...o, rowHeight: Number.isFinite(
|
|
1099
|
+
const _ = typeof O == "function" ? O(o.entry, x) : O;
|
|
1100
|
+
return { ...o, rowHeight: Number.isFinite(_) && _ > 0 ? _ : Ge };
|
|
1039
1101
|
}),
|
|
1040
1102
|
[we, O]
|
|
1041
|
-
),
|
|
1042
|
-
const o = new Array(
|
|
1103
|
+
), ve = K(() => X.map((o) => o.rowHeight), [X]), ke = K(() => {
|
|
1104
|
+
const o = new Array(ve.length + 1);
|
|
1043
1105
|
o[0] = 0;
|
|
1044
|
-
for (let x = 0; x <
|
|
1045
|
-
o[x + 1] = o[x] +
|
|
1106
|
+
for (let x = 0; x < ve.length; x++)
|
|
1107
|
+
o[x + 1] = o[x] + ve[x];
|
|
1046
1108
|
return o;
|
|
1047
|
-
}, [
|
|
1048
|
-
|
|
1049
|
-
const
|
|
1050
|
-
|
|
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;
|
|
1051
1113
|
const Qe = ne(t);
|
|
1052
1114
|
Qe.current = t;
|
|
1053
|
-
const [
|
|
1115
|
+
const [Et, St] = ie(0), et = ne(/* @__PURE__ */ new Map()), tt = ne(null), Nt = F((o, x) => {
|
|
1054
1116
|
x ? (et.current.set(o, x), tt.current === o && (tt.current = null, x.focus())) : et.current.delete(o);
|
|
1055
|
-
}, []),
|
|
1117
|
+
}, []), Ee = F((o) => {
|
|
1056
1118
|
St(o);
|
|
1057
1119
|
const x = et.current.get(o);
|
|
1058
1120
|
if (x) {
|
|
1059
1121
|
x.focus();
|
|
1060
1122
|
return;
|
|
1061
1123
|
}
|
|
1062
|
-
tt.current = o,
|
|
1124
|
+
tt.current = o, v.current?.scrollToIndex(o);
|
|
1063
1125
|
}, []);
|
|
1064
|
-
|
|
1126
|
+
he(() => {
|
|
1065
1127
|
St((o) => we.length === 0 ? 0 : Math.min(o, we.length - 1));
|
|
1066
1128
|
}, [we.length]);
|
|
1067
|
-
const
|
|
1129
|
+
const It = F(
|
|
1068
1130
|
(o, x) => {
|
|
1069
|
-
const
|
|
1131
|
+
const _ = wt.current, W = _.length - 1;
|
|
1070
1132
|
if (W < 0) return;
|
|
1071
|
-
const
|
|
1133
|
+
const U = _[x], Z = U?.entry.children !== void 0, me = Z && kt.current(U.entry.absolutePath);
|
|
1072
1134
|
switch (o.key) {
|
|
1073
1135
|
case "ArrowDown":
|
|
1074
|
-
o.preventDefault(),
|
|
1136
|
+
o.preventDefault(), Ee(Math.min(x + 1, W));
|
|
1075
1137
|
break;
|
|
1076
1138
|
case "ArrowUp":
|
|
1077
|
-
o.preventDefault(),
|
|
1139
|
+
o.preventDefault(), Ee(Math.max(x - 1, 0));
|
|
1078
1140
|
break;
|
|
1079
1141
|
case "Home":
|
|
1080
|
-
o.preventDefault(),
|
|
1142
|
+
o.preventDefault(), Ee(0);
|
|
1081
1143
|
break;
|
|
1082
1144
|
case "End":
|
|
1083
|
-
o.preventDefault(),
|
|
1145
|
+
o.preventDefault(), Ee(W);
|
|
1084
1146
|
break;
|
|
1085
1147
|
case "ArrowRight":
|
|
1086
|
-
o.preventDefault(),
|
|
1148
|
+
o.preventDefault(), Z && !me ? Qe.current(U.entry.absolutePath) : Z && x < W && Ee(x + 1);
|
|
1087
1149
|
break;
|
|
1088
1150
|
case "ArrowLeft": {
|
|
1089
|
-
if (o.preventDefault(),
|
|
1090
|
-
Qe.current(
|
|
1151
|
+
if (o.preventDefault(), Z && me) {
|
|
1152
|
+
Qe.current(U.entry.absolutePath);
|
|
1091
1153
|
break;
|
|
1092
1154
|
}
|
|
1093
|
-
const
|
|
1094
|
-
for (let
|
|
1095
|
-
if (
|
|
1096
|
-
|
|
1155
|
+
const vr = U?.depth ?? 0;
|
|
1156
|
+
for (let ze = x - 1; ze >= 0; ze--)
|
|
1157
|
+
if (_[ze].depth < vr) {
|
|
1158
|
+
Ee(ze);
|
|
1097
1159
|
break;
|
|
1098
1160
|
}
|
|
1099
1161
|
break;
|
|
1100
1162
|
}
|
|
1101
1163
|
}
|
|
1102
1164
|
},
|
|
1103
|
-
[
|
|
1104
|
-
), He =
|
|
1105
|
-
() => !
|
|
1106
|
-
[Ke,
|
|
1107
|
-
), We =
|
|
1108
|
-
() =>
|
|
1109
|
-
[
|
|
1110
|
-
), rt =
|
|
1111
|
-
|
|
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,
|
|
1112
1174
|
{
|
|
1113
1175
|
segmentsByItem: He.segmentsByItem,
|
|
1114
1176
|
glyphsByItem: He.glyphsByItem,
|
|
1115
|
-
itemHeight:
|
|
1177
|
+
itemHeight: ve[0] ?? Ge,
|
|
1116
1178
|
width: We,
|
|
1117
1179
|
viewportHeight: xe,
|
|
1118
1180
|
scrollPosition: $e,
|
|
1119
1181
|
color: k,
|
|
1120
1182
|
expandGlyphColor: k,
|
|
1121
|
-
expandGlyphSize:
|
|
1122
|
-
renderStartIndex:
|
|
1183
|
+
expandGlyphSize: C ?? Zt,
|
|
1184
|
+
renderStartIndex: Rt,
|
|
1123
1185
|
renderEndIndex: jt,
|
|
1124
|
-
lookaheadEndIndex:
|
|
1186
|
+
lookaheadEndIndex: Tt
|
|
1125
1187
|
}
|
|
1126
|
-
) }) }), [We, xe,
|
|
1127
|
-
|
|
1188
|
+
) }) }), [We, xe, Rt, jt, Tt, $e, He, k, j, C, ve]), Ct = F((o) => X[o], [X]), Pt = ne(null);
|
|
1189
|
+
gr(() => {
|
|
1128
1190
|
const o = Pt.current;
|
|
1129
|
-
if (Pt.current = { items:
|
|
1130
|
-
return;
|
|
1131
|
-
const x = b.current, M = typeof he == "number" ? he : he?.top ?? 0, W = x ? x.getScrollPosition() : qe.current, X = W - M, re = Hr(o.items, o.offsets, X);
|
|
1132
|
-
if (!re)
|
|
1191
|
+
if (Pt.current = { items: X, offsets: ke }, !ct || !o || o.items === X)
|
|
1133
1192
|
return;
|
|
1134
|
-
const
|
|
1135
|
-
if (
|
|
1193
|
+
const x = v.current, _ = x?.getScrollPosition(), W = typeof _ == "number" && _ >= 0 ? _ : Ze.current, U = Gr(o.items, o.offsets, W);
|
|
1194
|
+
if (!U)
|
|
1136
1195
|
return;
|
|
1137
|
-
const
|
|
1138
|
-
if (Math.abs(
|
|
1196
|
+
const Z = Vr(U, X, ke);
|
|
1197
|
+
if (Z === null || Math.abs(Z - W) < 1)
|
|
1139
1198
|
return;
|
|
1140
|
-
const
|
|
1141
|
-
|
|
1142
|
-
}, [
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1145
|
-
ge((o) => nt(o,
|
|
1146
|
-
}, [
|
|
1147
|
-
const
|
|
1148
|
-
() => ({ iconOverrides: L, showExpandIcons:
|
|
1149
|
-
[L,
|
|
1150
|
-
),
|
|
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));
|
|
1205
|
+
}, [je]);
|
|
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(
|
|
1151
1210
|
() => /* @__PURE__ */ i.jsx(
|
|
1152
|
-
|
|
1211
|
+
Er,
|
|
1153
1212
|
{
|
|
1154
|
-
ref:
|
|
1155
|
-
itemCount:
|
|
1156
|
-
getItem:
|
|
1213
|
+
ref: v,
|
|
1214
|
+
itemCount: X.length,
|
|
1215
|
+
getItem: Ct,
|
|
1157
1216
|
getItemHeight: bt,
|
|
1158
|
-
getItemKey:
|
|
1217
|
+
getItemKey: gt,
|
|
1159
1218
|
testId: dt,
|
|
1160
1219
|
contentProps: ut,
|
|
1161
1220
|
viewportSize: xe,
|
|
1162
|
-
overscanCount:
|
|
1163
|
-
onScroll:
|
|
1164
|
-
onRangeChange:
|
|
1221
|
+
overscanCount: Ie,
|
|
1222
|
+
onScroll: mt,
|
|
1223
|
+
onRangeChange: ht,
|
|
1165
1224
|
className: Ae,
|
|
1166
|
-
onWheelHorizontal: m ?
|
|
1225
|
+
onWheelHorizontal: m ? _t : void 0,
|
|
1167
1226
|
background: /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1168
1227
|
m && q ? (
|
|
1169
1228
|
// Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
|
|
@@ -1172,31 +1231,32 @@ const dr = (e) => {
|
|
|
1172
1231
|
Me
|
|
1173
1232
|
] }),
|
|
1174
1233
|
initialScrollIndex: Fe,
|
|
1175
|
-
initialScrollOffset:
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1234
|
+
initialScrollOffset: ye,
|
|
1235
|
+
initialScrollAnchor: Le,
|
|
1236
|
+
onItemFocus: Ce,
|
|
1237
|
+
callbackThrottleMs: Te,
|
|
1238
|
+
contentInsets: re,
|
|
1239
|
+
scrollBarOptions: Xe,
|
|
1180
1240
|
behaviorOptions: it,
|
|
1181
|
-
children: (o, x) => o ? m &&
|
|
1182
|
-
|
|
1241
|
+
children: (o, x) => o ? m && P && q ? /* @__PURE__ */ i.jsx(
|
|
1242
|
+
or,
|
|
1183
1243
|
{
|
|
1184
1244
|
entry: o.entry,
|
|
1185
1245
|
indentLevel: o.indentLevel,
|
|
1186
1246
|
positionInSet: o.positionInSet,
|
|
1187
1247
|
setSize: o.setSize,
|
|
1188
|
-
rowIndex: x + (
|
|
1248
|
+
rowIndex: x + (P.showHeader ?? !0 ? 2 : 1),
|
|
1189
1249
|
isSelectedForAria: !!h?.has(o.entry.absolutePath),
|
|
1190
1250
|
rowHeight: o.rowHeight,
|
|
1191
1251
|
isDirOpen: fe,
|
|
1192
|
-
columns:
|
|
1252
|
+
columns: P.columns,
|
|
1193
1253
|
numericTemplate: Be,
|
|
1194
1254
|
numericTotal: q.numericTotal,
|
|
1195
1255
|
nameWidth: q.nameWidth,
|
|
1196
|
-
rowClassName:
|
|
1197
|
-
selection: { onEntryClick:
|
|
1198
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1199
|
-
visual:
|
|
1256
|
+
rowClassName: P.rowClassName,
|
|
1257
|
+
selection: { onEntryClick: R, selectedPath: b ?? null, mode: d, selectedItems: h, onSelectionChange: g },
|
|
1258
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: qe },
|
|
1259
|
+
visual: At
|
|
1200
1260
|
},
|
|
1201
1261
|
o.entry.absolutePath
|
|
1202
1262
|
) : /* @__PURE__ */ i.jsx(
|
|
@@ -1209,31 +1269,31 @@ const dr = (e) => {
|
|
|
1209
1269
|
setSize: o.setSize,
|
|
1210
1270
|
isSelectedForAria: !!h?.has(o.entry.absolutePath),
|
|
1211
1271
|
flatIndex: x,
|
|
1212
|
-
isActive: x ===
|
|
1213
|
-
registerRowRef:
|
|
1214
|
-
onNavigationKeyDown:
|
|
1272
|
+
isActive: x === Et,
|
|
1273
|
+
registerRowRef: Nt,
|
|
1274
|
+
onNavigationKeyDown: It,
|
|
1215
1275
|
rowHeight: o.rowHeight,
|
|
1216
1276
|
isDirOpen: fe,
|
|
1217
1277
|
parentIsLast: o.parentIsLast,
|
|
1218
1278
|
renderChildren: !1,
|
|
1219
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1220
|
-
selection: { onEntryClick:
|
|
1279
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: qe },
|
|
1280
|
+
selection: { onEntryClick: R, selectedPath: b ?? null, mode: d, selectedItems: h, onSelectionChange: g },
|
|
1221
1281
|
visual: {
|
|
1222
1282
|
iconOverrides: L,
|
|
1223
|
-
showExpandIcons:
|
|
1224
|
-
showDirectoryIcons:
|
|
1283
|
+
showExpandIcons: I,
|
|
1284
|
+
showDirectoryIcons: E,
|
|
1225
1285
|
showFileIcons: p,
|
|
1226
|
-
useCanvasExpandIcons:
|
|
1227
|
-
expandIconSize:
|
|
1228
|
-
highlightStyles:
|
|
1286
|
+
useCanvasExpandIcons: j,
|
|
1287
|
+
expandIconSize: C,
|
|
1288
|
+
highlightStyles: ee,
|
|
1229
1289
|
entryClassName: $,
|
|
1230
1290
|
entryStyle: J,
|
|
1231
|
-
nameClassName:
|
|
1232
|
-
nameStyle:
|
|
1291
|
+
nameClassName: te,
|
|
1292
|
+
nameStyle: S,
|
|
1233
1293
|
directoryNameClassName: Y,
|
|
1234
1294
|
directoryNameStyle: B,
|
|
1235
1295
|
fileNameClassName: G,
|
|
1236
|
-
fileNameStyle:
|
|
1296
|
+
fileNameStyle: ce
|
|
1237
1297
|
}
|
|
1238
1298
|
},
|
|
1239
1299
|
o.entry.absolutePath
|
|
@@ -1241,103 +1301,104 @@ const dr = (e) => {
|
|
|
1241
1301
|
}
|
|
1242
1302
|
),
|
|
1243
1303
|
[
|
|
1244
|
-
|
|
1245
|
-
|
|
1304
|
+
X.length,
|
|
1305
|
+
Ct,
|
|
1246
1306
|
bt,
|
|
1247
|
-
|
|
1307
|
+
gt,
|
|
1248
1308
|
dt,
|
|
1249
1309
|
ut,
|
|
1250
|
-
kt,
|
|
1251
|
-
It,
|
|
1252
1310
|
Et,
|
|
1311
|
+
Nt,
|
|
1312
|
+
It,
|
|
1253
1313
|
xe,
|
|
1254
|
-
|
|
1255
|
-
ft,
|
|
1314
|
+
Ie,
|
|
1256
1315
|
mt,
|
|
1316
|
+
ht,
|
|
1257
1317
|
Ae,
|
|
1258
1318
|
m,
|
|
1259
|
-
|
|
1319
|
+
_t,
|
|
1260
1320
|
q,
|
|
1261
1321
|
rt,
|
|
1262
1322
|
Me,
|
|
1263
1323
|
Fe,
|
|
1264
|
-
|
|
1265
|
-
te,
|
|
1324
|
+
ye,
|
|
1266
1325
|
Le,
|
|
1267
|
-
|
|
1268
|
-
|
|
1326
|
+
Ce,
|
|
1327
|
+
Te,
|
|
1328
|
+
re,
|
|
1329
|
+
Xe,
|
|
1269
1330
|
it,
|
|
1270
|
-
|
|
1331
|
+
P,
|
|
1271
1332
|
Be,
|
|
1272
1333
|
fe,
|
|
1273
|
-
|
|
1274
|
-
|
|
1334
|
+
R,
|
|
1335
|
+
b,
|
|
1275
1336
|
d,
|
|
1276
1337
|
h,
|
|
1277
1338
|
g,
|
|
1278
1339
|
t,
|
|
1279
|
-
|
|
1280
|
-
|
|
1340
|
+
qe,
|
|
1341
|
+
At,
|
|
1281
1342
|
L,
|
|
1282
|
-
|
|
1283
|
-
|
|
1343
|
+
I,
|
|
1344
|
+
E,
|
|
1284
1345
|
p,
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1346
|
+
j,
|
|
1347
|
+
C,
|
|
1348
|
+
ee,
|
|
1288
1349
|
$,
|
|
1289
1350
|
J,
|
|
1290
|
-
|
|
1291
|
-
|
|
1351
|
+
te,
|
|
1352
|
+
S,
|
|
1292
1353
|
Y,
|
|
1293
1354
|
B,
|
|
1294
1355
|
G,
|
|
1295
|
-
|
|
1356
|
+
ce
|
|
1296
1357
|
]
|
|
1297
1358
|
);
|
|
1298
|
-
if (!(
|
|
1299
|
-
return /* @__PURE__ */ i.jsx("div", { ref: se, className:
|
|
1300
|
-
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` };
|
|
1301
1362
|
return /* @__PURE__ */ i.jsxs(
|
|
1302
1363
|
"div",
|
|
1303
1364
|
{
|
|
1304
1365
|
ref: se,
|
|
1305
|
-
className:
|
|
1306
|
-
style:
|
|
1366
|
+
className: A(pt, "dt-grid"),
|
|
1367
|
+
style: xr,
|
|
1307
1368
|
role: "treegrid",
|
|
1308
1369
|
"aria-label": y ? void 0 : f,
|
|
1309
1370
|
"aria-labelledby": y,
|
|
1310
1371
|
"aria-multiselectable": d === "multiple" ? !0 : void 0,
|
|
1311
|
-
"aria-rowcount":
|
|
1372
|
+
"aria-rowcount": X.length + (P.showHeader ?? !0 ? 1 : 0),
|
|
1312
1373
|
children: [
|
|
1313
|
-
|
|
1314
|
-
/* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(
|
|
1315
|
-
/* @__PURE__ */ i.jsx("div", { ref: le, className: "dt-grid-body", children:
|
|
1316
|
-
|
|
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 }),
|
|
1377
|
+
je > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
|
|
1317
1378
|
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: q.nameWidth }, "aria-hidden": "true" }),
|
|
1318
1379
|
/* @__PURE__ */ i.jsx(
|
|
1319
|
-
|
|
1380
|
+
Sr,
|
|
1320
1381
|
{
|
|
1321
1382
|
horizontal: !0,
|
|
1322
1383
|
contentSize: q.numericTotal,
|
|
1323
1384
|
viewportSize: q.numericVisible,
|
|
1324
|
-
scrollPosition:
|
|
1385
|
+
scrollPosition: pe,
|
|
1325
1386
|
scrollBarWidth: Re,
|
|
1326
1387
|
onScroll: (o) => {
|
|
1327
|
-
const x = typeof o == "function" ? o(
|
|
1328
|
-
return ge(
|
|
1388
|
+
const x = typeof o == "function" ? o(pe) : o, _ = nt(x, je);
|
|
1389
|
+
return ge(_), _;
|
|
1329
1390
|
}
|
|
1330
1391
|
}
|
|
1331
1392
|
),
|
|
1332
1393
|
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: Re }, "aria-hidden": "true" })
|
|
1333
1394
|
] }),
|
|
1334
|
-
|
|
1335
|
-
/* @__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 }) })
|
|
1336
1397
|
]
|
|
1337
1398
|
}
|
|
1338
1399
|
);
|
|
1339
|
-
},
|
|
1340
|
-
const [
|
|
1400
|
+
}, dn = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
|
|
1401
|
+
const [s, n] = kr(), [r, l] = ie(() => {
|
|
1341
1402
|
if (typeof window < "u" && t)
|
|
1342
1403
|
try {
|
|
1343
1404
|
const f = window.localStorage.getItem(t);
|
|
@@ -1359,13 +1420,13 @@ const dr = (e) => {
|
|
|
1359
1420
|
}, []), u = F(
|
|
1360
1421
|
(f, y) => {
|
|
1361
1422
|
c((k) => {
|
|
1362
|
-
for (const
|
|
1363
|
-
y(k,
|
|
1423
|
+
for (const j of f)
|
|
1424
|
+
y(k, j);
|
|
1364
1425
|
});
|
|
1365
1426
|
},
|
|
1366
1427
|
[c]
|
|
1367
1428
|
);
|
|
1368
|
-
|
|
1429
|
+
he(() => {
|
|
1369
1430
|
if (t && typeof window < "u")
|
|
1370
1431
|
try {
|
|
1371
1432
|
window.localStorage.setItem(t, JSON.stringify(Array.from(r)));
|
|
@@ -1373,14 +1434,14 @@ const dr = (e) => {
|
|
|
1373
1434
|
console.warn(`Error setting localStorage key "${t}":`, f);
|
|
1374
1435
|
}
|
|
1375
1436
|
}, [r, t]);
|
|
1376
|
-
const
|
|
1437
|
+
const R = F(
|
|
1377
1438
|
(f) => {
|
|
1378
1439
|
u([f], (y, k) => {
|
|
1379
1440
|
y.has(k) ? y.delete(k) : y.add(k);
|
|
1380
1441
|
});
|
|
1381
1442
|
},
|
|
1382
1443
|
[u]
|
|
1383
|
-
),
|
|
1444
|
+
), b = F(
|
|
1384
1445
|
(f) => {
|
|
1385
1446
|
u([f], (y, k) => {
|
|
1386
1447
|
y.add(k);
|
|
@@ -1412,21 +1473,21 @@ const dr = (e) => {
|
|
|
1412
1473
|
c((f) => {
|
|
1413
1474
|
f.clear();
|
|
1414
1475
|
});
|
|
1415
|
-
}, [c]),
|
|
1476
|
+
}, [c]), N = F((f) => r.has(f), [r]);
|
|
1416
1477
|
return {
|
|
1417
1478
|
expanded: r,
|
|
1418
|
-
toggle:
|
|
1419
|
-
expand:
|
|
1479
|
+
toggle: R,
|
|
1480
|
+
expand: b,
|
|
1420
1481
|
collapse: d,
|
|
1421
1482
|
collapseMultiple: h,
|
|
1422
1483
|
expandMultiple: g,
|
|
1423
1484
|
collapseAll: w,
|
|
1424
|
-
isExpanded:
|
|
1425
|
-
isPending:
|
|
1485
|
+
isExpanded: N,
|
|
1486
|
+
isPending: s
|
|
1426
1487
|
};
|
|
1427
1488
|
};
|
|
1428
1489
|
export {
|
|
1429
|
-
|
|
1490
|
+
cn as DirectoryTree,
|
|
1430
1491
|
D as directoryTreeClasses,
|
|
1431
|
-
|
|
1492
|
+
dn as useDirectoryTreeState
|
|
1432
1493
|
};
|