@aiquants/directory-tree 6.1.0 → 6.1.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/README.md +2 -1
- package/dist/index.cjs +1 -6
- package/dist/index.js +976 -1234
- package/dist/styles/directory-tree.standalone.css +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,274 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
function Ar() {
|
|
9
|
-
if (Nn) return qe;
|
|
10
|
-
Nn = 1;
|
|
11
|
-
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
12
|
-
function n(r, a, i) {
|
|
13
|
-
var l = null;
|
|
14
|
-
if (i !== void 0 && (l = "" + i), a.key !== void 0 && (l = "" + a.key), "key" in a) {
|
|
15
|
-
i = {};
|
|
16
|
-
for (var d in a)
|
|
17
|
-
d !== "key" && (i[d] = a[d]);
|
|
18
|
-
} else i = a;
|
|
19
|
-
return a = i.ref, {
|
|
20
|
-
$$typeof: e,
|
|
21
|
-
type: r,
|
|
22
|
-
key: l,
|
|
23
|
-
ref: a !== void 0 ? a : null,
|
|
24
|
-
props: i
|
|
25
|
-
};
|
|
26
|
-
}
|
|
27
|
-
return qe.Fragment = t, qe.jsx = n, qe.jsxs = n, qe;
|
|
28
|
-
}
|
|
29
|
-
var Qe = {};
|
|
30
|
-
var Tn;
|
|
31
|
-
function Lr() {
|
|
32
|
-
return Tn || (Tn = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
33
|
-
function e(o) {
|
|
34
|
-
if (o == null) return null;
|
|
35
|
-
if (typeof o == "function")
|
|
36
|
-
return o.$$typeof === z ? null : o.displayName || o.name || null;
|
|
37
|
-
if (typeof o == "string") return o;
|
|
38
|
-
switch (o) {
|
|
39
|
-
case w:
|
|
40
|
-
return "Fragment";
|
|
41
|
-
case F:
|
|
42
|
-
return "Profiler";
|
|
43
|
-
case v:
|
|
44
|
-
return "StrictMode";
|
|
45
|
-
case D:
|
|
46
|
-
return "Suspense";
|
|
47
|
-
case $:
|
|
48
|
-
return "SuspenseList";
|
|
49
|
-
case J:
|
|
50
|
-
return "Activity";
|
|
51
|
-
}
|
|
52
|
-
if (typeof o == "object")
|
|
53
|
-
switch (typeof o.tag == "number" && console.error(
|
|
54
|
-
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
|
-
), o.$$typeof) {
|
|
56
|
-
case p:
|
|
57
|
-
return "Portal";
|
|
58
|
-
case C:
|
|
59
|
-
return o.displayName || "Context";
|
|
60
|
-
case P:
|
|
61
|
-
return (o._context.displayName || "Context") + ".Consumer";
|
|
62
|
-
case g:
|
|
63
|
-
var u = o.render;
|
|
64
|
-
return o = o.displayName, o || (o = u.displayName || u.name || "", o = o !== "" ? "ForwardRef(" + o + ")" : "ForwardRef"), o;
|
|
65
|
-
case O:
|
|
66
|
-
return u = o.displayName || null, u !== null ? u : e(o.type) || "Memo";
|
|
67
|
-
case Q:
|
|
68
|
-
u = o._payload, o = o._init;
|
|
69
|
-
try {
|
|
70
|
-
return e(o(u));
|
|
71
|
-
} catch {
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
return null;
|
|
75
|
-
}
|
|
76
|
-
function t(o) {
|
|
77
|
-
return "" + o;
|
|
78
|
-
}
|
|
79
|
-
function n(o) {
|
|
80
|
-
try {
|
|
81
|
-
t(o);
|
|
82
|
-
var u = !1;
|
|
83
|
-
} catch {
|
|
84
|
-
u = !0;
|
|
85
|
-
}
|
|
86
|
-
if (u) {
|
|
87
|
-
u = console;
|
|
88
|
-
var I = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && o[Symbol.toStringTag] || o.constructor.name || "Object";
|
|
89
|
-
return I.call(
|
|
90
|
-
u,
|
|
91
|
-
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
92
|
-
E
|
|
93
|
-
), t(o);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
function r(o) {
|
|
97
|
-
if (o === w) return "<>";
|
|
98
|
-
if (typeof o == "object" && o !== null && o.$$typeof === Q)
|
|
99
|
-
return "<...>";
|
|
100
|
-
try {
|
|
101
|
-
var u = e(o);
|
|
102
|
-
return u ? "<" + u + ">" : "<...>";
|
|
103
|
-
} catch {
|
|
104
|
-
return "<...>";
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function a() {
|
|
108
|
-
var o = B.A;
|
|
109
|
-
return o === null ? null : o.getOwner();
|
|
110
|
-
}
|
|
111
|
-
function i() {
|
|
112
|
-
return Error("react-stack-top-frame");
|
|
113
|
-
}
|
|
114
|
-
function l(o) {
|
|
115
|
-
if (me.call(o, "key")) {
|
|
116
|
-
var u = Object.getOwnPropertyDescriptor(o, "key").get;
|
|
117
|
-
if (u && u.isReactWarning) return !1;
|
|
118
|
-
}
|
|
119
|
-
return o.key !== void 0;
|
|
120
|
-
}
|
|
121
|
-
function d(o, u) {
|
|
122
|
-
function I() {
|
|
123
|
-
pe || (pe = !0, console.error(
|
|
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
|
-
u
|
|
126
|
-
));
|
|
127
|
-
}
|
|
128
|
-
I.isReactWarning = !0, Object.defineProperty(o, "key", {
|
|
129
|
-
get: I,
|
|
130
|
-
configurable: !0
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
function h() {
|
|
134
|
-
var o = e(this.type);
|
|
135
|
-
return V[o] || (V[o] = !0, console.error(
|
|
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
|
-
)), o = this.props.ref, o !== void 0 ? o : null;
|
|
138
|
-
}
|
|
139
|
-
function b(o, u, I, E, ve, k) {
|
|
140
|
-
var j = I.ref;
|
|
141
|
-
return o = {
|
|
142
|
-
$$typeof: y,
|
|
143
|
-
type: o,
|
|
144
|
-
key: u,
|
|
145
|
-
props: I,
|
|
146
|
-
_owner: E
|
|
147
|
-
}, (j !== void 0 ? j : null) !== null ? Object.defineProperty(o, "ref", {
|
|
148
|
-
enumerable: !1,
|
|
149
|
-
get: h
|
|
150
|
-
}) : Object.defineProperty(o, "ref", { enumerable: !1, value: null }), o._store = {}, Object.defineProperty(o._store, "validated", {
|
|
151
|
-
configurable: !1,
|
|
152
|
-
enumerable: !1,
|
|
153
|
-
writable: !0,
|
|
154
|
-
value: 0
|
|
155
|
-
}), Object.defineProperty(o, "_debugInfo", {
|
|
156
|
-
configurable: !1,
|
|
157
|
-
enumerable: !1,
|
|
158
|
-
writable: !0,
|
|
159
|
-
value: null
|
|
160
|
-
}), Object.defineProperty(o, "_debugStack", {
|
|
161
|
-
configurable: !1,
|
|
162
|
-
enumerable: !1,
|
|
163
|
-
writable: !0,
|
|
164
|
-
value: ve
|
|
165
|
-
}), Object.defineProperty(o, "_debugTask", {
|
|
166
|
-
configurable: !1,
|
|
167
|
-
enumerable: !1,
|
|
168
|
-
writable: !0,
|
|
169
|
-
value: k
|
|
170
|
-
}), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
|
|
171
|
-
}
|
|
172
|
-
function N(o, u, I, E, ve, k) {
|
|
173
|
-
var j = u.children;
|
|
174
|
-
if (j !== void 0)
|
|
175
|
-
if (E)
|
|
176
|
-
if (W(j)) {
|
|
177
|
-
for (E = 0; E < j.length; E++)
|
|
178
|
-
x(j[E]);
|
|
179
|
-
Object.freeze && Object.freeze(j);
|
|
180
|
-
} else
|
|
181
|
-
console.error(
|
|
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
|
-
);
|
|
184
|
-
else x(j);
|
|
185
|
-
if (me.call(u, "key")) {
|
|
186
|
-
j = e(o);
|
|
187
|
-
var ee = Object.keys(u).filter(function(Ne) {
|
|
188
|
-
return Ne !== "key";
|
|
189
|
-
});
|
|
190
|
-
E = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", be[j + E] || (ee = 0 < ee.length ? "{" + ee.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
191
|
-
`A props object containing a "key" prop is being spread into JSX:
|
|
192
|
-
let props = %s;
|
|
193
|
-
<%s {...props} />
|
|
194
|
-
React keys must be passed directly to JSX without using spread:
|
|
195
|
-
let props = %s;
|
|
196
|
-
<%s key={someKey} {...props} />`,
|
|
197
|
-
E,
|
|
198
|
-
j,
|
|
199
|
-
ee,
|
|
200
|
-
j
|
|
201
|
-
), be[j + E] = !0);
|
|
202
|
-
}
|
|
203
|
-
if (j = null, I !== void 0 && (n(I), j = "" + I), l(u) && (n(u.key), j = "" + u.key), "key" in u) {
|
|
204
|
-
I = {};
|
|
205
|
-
for (var ye in u)
|
|
206
|
-
ye !== "key" && (I[ye] = u[ye]);
|
|
207
|
-
} else I = u;
|
|
208
|
-
return j && d(
|
|
209
|
-
I,
|
|
210
|
-
typeof o == "function" ? o.displayName || o.name || "Unknown" : o
|
|
211
|
-
), b(
|
|
212
|
-
o,
|
|
213
|
-
j,
|
|
214
|
-
I,
|
|
215
|
-
a(),
|
|
216
|
-
ve,
|
|
217
|
-
k
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
function x(o) {
|
|
221
|
-
T(o) ? o._store && (o._store.validated = 1) : typeof o == "object" && o !== null && o.$$typeof === Q && (o._payload.status === "fulfilled" ? T(o._payload.value) && o._payload.value._store && (o._payload.value._store.validated = 1) : o._store && (o._store.validated = 1));
|
|
222
|
-
}
|
|
223
|
-
function T(o) {
|
|
224
|
-
return typeof o == "object" && o !== null && o.$$typeof === y;
|
|
225
|
-
}
|
|
226
|
-
var m = pr, y = /* @__PURE__ */ Symbol.for("react.transitional.element"), p = /* @__PURE__ */ Symbol.for("react.portal"), w = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), F = /* @__PURE__ */ Symbol.for("react.profiler"), P = /* @__PURE__ */ Symbol.for("react.consumer"), C = /* @__PURE__ */ Symbol.for("react.context"), g = /* @__PURE__ */ Symbol.for("react.forward_ref"), D = /* @__PURE__ */ Symbol.for("react.suspense"), $ = /* @__PURE__ */ Symbol.for("react.suspense_list"), O = /* @__PURE__ */ Symbol.for("react.memo"), Q = /* @__PURE__ */ Symbol.for("react.lazy"), J = /* @__PURE__ */ Symbol.for("react.activity"), z = /* @__PURE__ */ Symbol.for("react.client.reference"), B = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, me = Object.prototype.hasOwnProperty, W = Array.isArray, oe = console.createTask ? console.createTask : function() {
|
|
227
|
-
return null;
|
|
228
|
-
};
|
|
229
|
-
m = {
|
|
230
|
-
react_stack_bottom_frame: function(o) {
|
|
231
|
-
return o();
|
|
232
|
-
}
|
|
233
|
-
};
|
|
234
|
-
var pe, V = {}, X = m.react_stack_bottom_frame.bind(
|
|
235
|
-
m,
|
|
236
|
-
i
|
|
237
|
-
)(), xe = oe(r(i)), be = {};
|
|
238
|
-
Qe.Fragment = w, Qe.jsx = function(o, u, I) {
|
|
239
|
-
var E = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
240
|
-
return N(
|
|
241
|
-
o,
|
|
242
|
-
u,
|
|
243
|
-
I,
|
|
244
|
-
!1,
|
|
245
|
-
E ? Error("react-stack-top-frame") : X,
|
|
246
|
-
E ? oe(r(o)) : xe
|
|
247
|
-
);
|
|
248
|
-
}, Qe.jsxs = function(o, u, I) {
|
|
249
|
-
var E = 1e4 > B.recentlyCreatedOwnerStacks++;
|
|
250
|
-
return N(
|
|
251
|
-
o,
|
|
252
|
-
u,
|
|
253
|
-
I,
|
|
254
|
-
!0,
|
|
255
|
-
E ? Error("react-stack-top-frame") : X,
|
|
256
|
-
E ? oe(r(o)) : xe
|
|
257
|
-
);
|
|
258
|
-
};
|
|
259
|
-
})()), Qe;
|
|
260
|
-
}
|
|
261
|
-
var Pn;
|
|
262
|
-
function Dr() {
|
|
263
|
-
return Pn || (Pn = 1, process.env.NODE_ENV === "production" ? mt.exports = Ar() : mt.exports = Lr()), mt.exports;
|
|
264
|
-
}
|
|
265
|
-
var f = Dr();
|
|
266
|
-
function $r({
|
|
1
|
+
import { jsx as u, jsxs as Ne, Fragment as cr } from "react/jsx-runtime";
|
|
2
|
+
import { VIRTUAL_SCROLL_LABEL_KEYS as ht, VIRTUAL_SCROLL_LABEL_CATALOGS as In, resolveVirtualScrollLocale as An, resolveVirtualScrollLabels as dr, VirtualScroll as ur, ScrollBar as hr } from "@aiquants/virtualscroll";
|
|
3
|
+
import * as ae from "react";
|
|
4
|
+
import { useRef as H, useEffect as Ae, useCallback as E, memo as zt, useState as de, useMemo as O, useSyncExternalStore as fr, useLayoutEffect as En, useImperativeHandle as mr, useTransition as pr } from "react";
|
|
5
|
+
import { twMerge as j } from "tailwind-merge";
|
|
6
|
+
import { FileIcon as yr, FileText as gr, FileCode as br, FileZip as Sr, FileVideo as vr, FileAudio as wr, FileImage as Ir, FilePpt as Er, FileDoc as xr, FileCsv as Nr, FileXls as Rr, FilePdf as kr, FileMd as Cr } from "@phosphor-icons/react";
|
|
7
|
+
function Pr({
|
|
267
8
|
title: e,
|
|
268
9
|
titleId: t,
|
|
269
10
|
...n
|
|
270
11
|
}, r) {
|
|
271
|
-
return /* @__PURE__ */
|
|
12
|
+
return /* @__PURE__ */ ae.createElement("svg", Object.assign({
|
|
272
13
|
xmlns: "http://www.w3.org/2000/svg",
|
|
273
14
|
viewBox: "0 0 24 24",
|
|
274
15
|
fill: "currentColor",
|
|
@@ -276,21 +17,21 @@ function $r({
|
|
|
276
17
|
"data-slot": "icon",
|
|
277
18
|
ref: r,
|
|
278
19
|
"aria-labelledby": t
|
|
279
|
-
}, n), e ? /* @__PURE__ */
|
|
20
|
+
}, n), e ? /* @__PURE__ */ ae.createElement("title", {
|
|
280
21
|
id: t
|
|
281
|
-
}, e) : null, /* @__PURE__ */
|
|
22
|
+
}, e) : null, /* @__PURE__ */ ae.createElement("path", {
|
|
282
23
|
fillRule: "evenodd",
|
|
283
24
|
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
25
|
clipRule: "evenodd"
|
|
285
26
|
}));
|
|
286
27
|
}
|
|
287
|
-
const
|
|
288
|
-
function
|
|
28
|
+
const Tr = /* @__PURE__ */ ae.forwardRef(Pr);
|
|
29
|
+
function Or({
|
|
289
30
|
title: e,
|
|
290
31
|
titleId: t,
|
|
291
32
|
...n
|
|
292
33
|
}, r) {
|
|
293
|
-
return /* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ ae.createElement("svg", Object.assign({
|
|
294
35
|
xmlns: "http://www.w3.org/2000/svg",
|
|
295
36
|
viewBox: "0 0 24 24",
|
|
296
37
|
fill: "currentColor",
|
|
@@ -298,21 +39,21 @@ function Mr({
|
|
|
298
39
|
"data-slot": "icon",
|
|
299
40
|
ref: r,
|
|
300
41
|
"aria-labelledby": t
|
|
301
|
-
}, n), e ? /* @__PURE__ */
|
|
42
|
+
}, n), e ? /* @__PURE__ */ ae.createElement("title", {
|
|
302
43
|
id: t
|
|
303
|
-
}, e) : null, /* @__PURE__ */
|
|
44
|
+
}, e) : null, /* @__PURE__ */ ae.createElement("path", {
|
|
304
45
|
fillRule: "evenodd",
|
|
305
46
|
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
47
|
clipRule: "evenodd"
|
|
307
48
|
}));
|
|
308
49
|
}
|
|
309
|
-
const
|
|
310
|
-
function
|
|
50
|
+
const Lr = /* @__PURE__ */ ae.forwardRef(Or);
|
|
51
|
+
function Dr({
|
|
311
52
|
title: e,
|
|
312
53
|
titleId: t,
|
|
313
54
|
...n
|
|
314
55
|
}, r) {
|
|
315
|
-
return /* @__PURE__ */
|
|
56
|
+
return /* @__PURE__ */ ae.createElement("svg", Object.assign({
|
|
316
57
|
xmlns: "http://www.w3.org/2000/svg",
|
|
317
58
|
viewBox: "0 0 24 24",
|
|
318
59
|
fill: "currentColor",
|
|
@@ -320,17 +61,17 @@ function Hr({
|
|
|
320
61
|
"data-slot": "icon",
|
|
321
62
|
ref: r,
|
|
322
63
|
"aria-labelledby": t
|
|
323
|
-
}, n), e ? /* @__PURE__ */
|
|
64
|
+
}, n), e ? /* @__PURE__ */ ae.createElement("title", {
|
|
324
65
|
id: t
|
|
325
|
-
}, e) : null, /* @__PURE__ */
|
|
66
|
+
}, e) : null, /* @__PURE__ */ ae.createElement("path", {
|
|
326
67
|
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
68
|
}));
|
|
328
69
|
}
|
|
329
|
-
const
|
|
70
|
+
const Ar = /* @__PURE__ */ ae.forwardRef(Dr), _r = {
|
|
330
71
|
icon: { light: "#6a7282", dark: "#99a1af" },
|
|
331
72
|
iconSelected: { light: "#1447e6", dark: "#51a2ff" },
|
|
332
73
|
checkedRing: { light: "#155dfc", dark: "#51a2ff" }
|
|
333
|
-
},
|
|
74
|
+
}, Yo = {
|
|
334
75
|
markdown: { light: "#0084d1", dark: "#00bcff" },
|
|
335
76
|
pdf: { light: "#e7000b", dark: "#ff6467" },
|
|
336
77
|
spreadsheet: { light: "#007a55", dark: "#00d492" },
|
|
@@ -342,8 +83,8 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
342
83
|
video: { light: "#7f22fe", dark: "#a684ff" },
|
|
343
84
|
archive: { light: "#bb4d00", dark: "#ffb900" },
|
|
344
85
|
code: { light: "#9810fa", dark: "#c27aff" },
|
|
345
|
-
text:
|
|
346
|
-
},
|
|
86
|
+
text: _r.icon
|
|
87
|
+
}, _n = "#71829b", oe = {
|
|
347
88
|
rowHover: "hover:bg-[color:light-dark(#f3f4f6,#1e2939)]",
|
|
348
89
|
rowSelected: "bg-[color:light-dark(#eff6ff,#162456)]",
|
|
349
90
|
checkedRing: "inset-ring-1 inset-ring-[color:light-dark(#155dfc,#51a2ff)]",
|
|
@@ -352,7 +93,7 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
352
93
|
gridEdge: "text-[color:light-dark(#4a5565,#d1d5dc)]",
|
|
353
94
|
icon: "text-[color:light-dark(#6a7282,#99a1af)]",
|
|
354
95
|
iconSelected: "text-[color:light-dark(#1447e6,#51a2ff)]"
|
|
355
|
-
},
|
|
96
|
+
}, ie = {
|
|
356
97
|
markdown: "text-[color:light-dark(#0084d1,#00bcff)]",
|
|
357
98
|
pdf: "text-[color:light-dark(#e7000b,#ff6467)]",
|
|
358
99
|
spreadsheet: "text-[color:light-dark(#007a55,#00d492)]",
|
|
@@ -365,34 +106,34 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
365
106
|
archive: "text-[color:light-dark(#bb4d00,#ffb900)]",
|
|
366
107
|
code: "text-[color:light-dark(#9810fa,#c27aff)]",
|
|
367
108
|
text: "text-[color:light-dark(#6a7282,#99a1af)]"
|
|
368
|
-
},
|
|
109
|
+
}, zn = "text-[length:var(--dt-font-size-body,0.8125rem)]", zr = `${zn} leading-[max(var(--dt-line-height-body,1.25rem),1.5em)]`, Tt = 44, Fr = 12, $r = 8, se = 14, Mr = 14, Fn = (e) => e === void 0 ? void 0 : { fontSize: typeof e == "number" ? `${e}px` : e }, ee = (e) => ({ width: e, height: e }), T = {
|
|
369
110
|
container: "directory-tree-container relative h-full overflow-y-hidden pb-[3px] pr-[2px]",
|
|
370
111
|
// 保留中も薄めない。薄めた文字と印は地と混ざり、配色表の組の対比 (文字 7:1・印 3:1) を割る
|
|
371
112
|
containerPending: "cursor-progress",
|
|
372
113
|
// 行は itemHeight の固定の箱で中身を縦の中央に置くため、上下の詰め物は行の高さを中身から奪うだけになる
|
|
373
114
|
// (行の中に置いたホストのボタンが行の高さいっぱいの的にならない)
|
|
374
|
-
entry: `directory-tree-entry flex items-center cursor-pointer relative select-none ${
|
|
375
|
-
entryHover: `directory-tree-entry--hover ${
|
|
376
|
-
entrySelected: `directory-tree-entry--selected ${
|
|
115
|
+
entry: `directory-tree-entry flex items-center cursor-pointer relative select-none ${zr}`,
|
|
116
|
+
entryHover: `directory-tree-entry--hover ${oe.rowHover}`,
|
|
117
|
+
entrySelected: `directory-tree-entry--selected ${oe.rowSelected}`,
|
|
377
118
|
// 輪は行の内側に描く。外側の輪は、後に描く隣の行の不透明な地 (ホバーや選択) に覆われる
|
|
378
|
-
entryItemSelected: `directory-tree-entry--item-selected ${
|
|
119
|
+
entryItemSelected: `directory-tree-entry--item-selected ${oe.rowSelected} ${oe.checkedRing}`,
|
|
379
120
|
// 箱の大きさはクラスでなく EXPAND_BOX_SIZE から行が付ける (ツリーラインのジオメトリが印を置く箱と同じ値を読むため)
|
|
380
|
-
expandIcon: `directory-tree-expand-icon flex-shrink-0 flex items-center justify-center ${
|
|
381
|
-
expandIconSelected: `directory-tree-expand-icon--selected ${
|
|
121
|
+
expandIcon: `directory-tree-expand-icon flex-shrink-0 flex items-center justify-center ${oe.icon}`,
|
|
122
|
+
expandIconSelected: `directory-tree-expand-icon--selected ${oe.iconSelected}`,
|
|
382
123
|
// 箱の大きさはクラスでなく visual.typeIconSize から行が付ける (ツリーラインのジオメトリと同じ値を読むため)
|
|
383
|
-
typeIcon: `directory-tree-type-icon flex-shrink-0 flex items-center justify-center ${
|
|
384
|
-
typeIconSelected: `directory-tree-type-icon--selected ${
|
|
124
|
+
typeIcon: `directory-tree-type-icon flex-shrink-0 flex items-center justify-center ${oe.icon}`,
|
|
125
|
+
typeIconSelected: `directory-tree-type-icon--selected ${oe.iconSelected}`,
|
|
385
126
|
// 文字の行の高さ (line-height) は行 (entry) の body の行を受け継ぐため、名前には文字の大きさだけを付ける
|
|
386
|
-
name: `directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${
|
|
127
|
+
name: `directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 ${zn} font-normal ${oe.name}`,
|
|
387
128
|
nameDirectory: "directory-tree-name--directory font-medium",
|
|
388
|
-
nameSelected: `directory-tree-name--selected font-semibold ${
|
|
389
|
-
},
|
|
129
|
+
nameSelected: `directory-tree-name--selected font-semibold ${oe.nameSelected}`
|
|
130
|
+
}, Ft = (e) => {
|
|
390
131
|
const t = e.slice(e.lastIndexOf("/") + 1), n = t.lastIndexOf(".");
|
|
391
132
|
return n <= 0 ? "" : t.slice(n + 1).toLowerCase();
|
|
392
|
-
},
|
|
393
|
-
const
|
|
394
|
-
return !(n && e) || r ? /* @__PURE__ */
|
|
395
|
-
},
|
|
133
|
+
}, Hr = /^[a-z][a-z\d+.-]*:\/\//i, xn = (e) => Ft(Hr.test(e) ? e.split(/[?#]/, 1)[0] : e), $n = (e) => Ft(e.name) || xn(e.relativePath) || xn(e.absolutePath), Mn = ({ isDirectory: e, isExpanded: t, showExpandIcons: n, useCanvasExpandIcons: r, expandIconSize: s }) => {
|
|
134
|
+
const a = s ? { width: s, height: s } : void 0, i = s ? "" : "h-4 w-4";
|
|
135
|
+
return !(n && e) || r ? /* @__PURE__ */ u("span", { className: i, style: a, "aria-hidden": "true" }) : t ? /* @__PURE__ */ u(Tr, { className: i, style: a }) : /* @__PURE__ */ u(Lr, { className: i, style: a });
|
|
136
|
+
}, Lt = (e, t) => {
|
|
396
137
|
if (e == null || typeof e == "boolean") return null;
|
|
397
138
|
if (typeof e == "function")
|
|
398
139
|
return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
|
|
@@ -400,7 +141,7 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
400
141
|
if ("then" in e)
|
|
401
142
|
return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
|
|
402
143
|
if (Array.isArray(e)) {
|
|
403
|
-
const r = e.map((
|
|
144
|
+
const r = e.map((s) => Lt(s, t)).filter(Boolean);
|
|
404
145
|
return r.length ? r : null;
|
|
405
146
|
}
|
|
406
147
|
const n = e.type;
|
|
@@ -408,20 +149,20 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
408
149
|
return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
|
|
409
150
|
}
|
|
410
151
|
return e;
|
|
411
|
-
},
|
|
412
|
-
markdown: (e) => /* @__PURE__ */
|
|
413
|
-
pdf: (e) => /* @__PURE__ */
|
|
414
|
-
spreadsheet: (e) => /* @__PURE__ */
|
|
415
|
-
csv: (e) => /* @__PURE__ */
|
|
416
|
-
document: (e) => /* @__PURE__ */
|
|
417
|
-
presentation: (e) => /* @__PURE__ */
|
|
418
|
-
image: (e) => /* @__PURE__ */
|
|
419
|
-
audio: (e) => /* @__PURE__ */
|
|
420
|
-
video: (e) => /* @__PURE__ */
|
|
421
|
-
archive: (e) => /* @__PURE__ */
|
|
422
|
-
code: (e) => /* @__PURE__ */
|
|
423
|
-
text: (e) => /* @__PURE__ */
|
|
424
|
-
},
|
|
152
|
+
}, Br = {
|
|
153
|
+
markdown: (e) => /* @__PURE__ */ u(Cr, { className: ie.markdown, style: ee(e) }),
|
|
154
|
+
pdf: (e) => /* @__PURE__ */ u(kr, { className: ie.pdf, style: ee(e) }),
|
|
155
|
+
spreadsheet: (e) => /* @__PURE__ */ u(Rr, { className: ie.spreadsheet, style: ee(e) }),
|
|
156
|
+
csv: (e) => /* @__PURE__ */ u(Nr, { className: ie.csv, style: ee(e) }),
|
|
157
|
+
document: (e) => /* @__PURE__ */ u(xr, { className: ie.document, style: ee(e) }),
|
|
158
|
+
presentation: (e) => /* @__PURE__ */ u(Er, { className: ie.presentation, style: ee(e) }),
|
|
159
|
+
image: (e) => /* @__PURE__ */ u(Ir, { className: ie.image, style: ee(e) }),
|
|
160
|
+
audio: (e) => /* @__PURE__ */ u(wr, { className: ie.audio, style: ee(e) }),
|
|
161
|
+
video: (e) => /* @__PURE__ */ u(vr, { className: ie.video, style: ee(e) }),
|
|
162
|
+
archive: (e) => /* @__PURE__ */ u(Sr, { className: ie.archive, style: ee(e) }),
|
|
163
|
+
code: (e) => /* @__PURE__ */ u(br, { className: ie.code, style: ee(e) }),
|
|
164
|
+
text: (e) => /* @__PURE__ */ u(gr, { className: ie.text, style: ee(e) })
|
|
165
|
+
}, Wr = {
|
|
425
166
|
markdown: ["md", "markdown", "mdx"],
|
|
426
167
|
pdf: ["pdf"],
|
|
427
168
|
spreadsheet: ["xls", "xlsx", "xlsm", "xlsb", "ods"],
|
|
@@ -434,7 +175,7 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
434
175
|
archive: ["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"],
|
|
435
176
|
code: ["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"],
|
|
436
177
|
text: ["txt", "log"]
|
|
437
|
-
},
|
|
178
|
+
}, jr = new Map(Object.entries(Wr).flatMap(([e, t]) => t.map((n) => [n, e]))), Kr = /* @__PURE__ */ new Set(["", "application/octet-stream", "binary/octet-stream", "text/plain", "application/x-empty"]), Gr = (e) => (e ?? "").split(";", 1)[0].trim().toLowerCase(), Yr = (e) => {
|
|
438
179
|
if (e === "text/markdown" || e === "text/x-markdown") return "markdown";
|
|
439
180
|
if (e === "application/pdf") return "pdf";
|
|
440
181
|
if (e.includes("excel") || e.includes("spreadsheet")) return "spreadsheet";
|
|
@@ -448,21 +189,21 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
448
189
|
if (e === "application/json" || e.includes("javascript") || e.includes("typescript") || e.includes("xml") || e.startsWith("text/html") || e.startsWith("text/css") || e.includes("x-python") || e.includes("x-sh") || e.includes("x-go") || e.includes("x-rust"))
|
|
449
190
|
return "code";
|
|
450
191
|
if (e.startsWith("text/")) return "text";
|
|
451
|
-
},
|
|
452
|
-
const
|
|
453
|
-
return
|
|
454
|
-
},
|
|
455
|
-
const { entry: r, isDirectory:
|
|
456
|
-
let
|
|
457
|
-
const
|
|
458
|
-
return r.icon !== void 0 ?
|
|
459
|
-
},
|
|
192
|
+
}, Xr = (e, t, n, r) => {
|
|
193
|
+
const s = Gr(e), a = Yr(s), i = jr.get((t || (n ? Ft(n) : "")).toLowerCase()), d = (Kr.has(s) ? [i, a] : [a, i]).find((y) => y !== void 0);
|
|
194
|
+
return d === void 0 ? /* @__PURE__ */ u(yr, { className: oe.icon, style: ee(r) }) : Br[d](r);
|
|
195
|
+
}, Hn = (e, t, n) => {
|
|
196
|
+
const { entry: r, isDirectory: s, isExpanded: a, extension: i, mimeType: c } = e;
|
|
197
|
+
let d;
|
|
198
|
+
const y = c || r.mimeType;
|
|
199
|
+
return r.icon !== void 0 ? d = r.icon : s ? d = a && t?.directoryExpanded || t?.directory || /* @__PURE__ */ u(Ar, { style: ee(n) }) : i && t?.fileByExtension?.[i] ? d = t.fileByExtension[i] : d = t?.file || Xr(y, i, r.name, n), Lt(typeof d == "function" ? d(e) : d, r.absolutePath);
|
|
200
|
+
}, Vr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Bn = (e) => {
|
|
460
201
|
if (!e)
|
|
461
202
|
return;
|
|
462
203
|
const t = Object.entries(e).filter(([, n]) => n != null);
|
|
463
204
|
if (t.length !== 0)
|
|
464
|
-
return Object.fromEntries(t.map(([n, r]) => [`data-${
|
|
465
|
-
},
|
|
205
|
+
return Object.fromEntries(t.map(([n, r]) => [`data-${Vr(n)}`, String(r)]));
|
|
206
|
+
}, Ur = [
|
|
466
207
|
// 塗り: 箱の大きさと位置を変えずに行の面・縁・指す形だけを描く (アウトラインと影は箱の外に描かれ、場所を取らない)
|
|
467
208
|
"color",
|
|
468
209
|
"background",
|
|
@@ -509,160 +250,160 @@ const Wr = /* @__PURE__ */ he.forwardRef(Hr), Br = {
|
|
|
509
250
|
"textDecorationThickness",
|
|
510
251
|
"textUnderlineOffset",
|
|
511
252
|
"textTransform"
|
|
512
|
-
],
|
|
253
|
+
], Jr = ["color", "opacity"], Zr = "the row's box belongs to the tree (height: visual.itemHeight, indent: visual.indentSize, icons: visual.typeIconSize, text size: visual.fontSize)", qr = new Set(Ur), Qr = new Set(Jr), Nn = (e, t) => {
|
|
513
254
|
const n = t === void 0 ? e.option : `${e.option}.${t}`;
|
|
514
255
|
return e.absolutePath === void 0 ? n : `${n} of "${e.absolutePath}"`;
|
|
515
|
-
},
|
|
256
|
+
}, Wn = (e, t, n, r) => {
|
|
516
257
|
if (e !== void 0) {
|
|
517
258
|
if (typeof e != "object" || e === null)
|
|
518
|
-
throw new RangeError(`${
|
|
519
|
-
for (const [
|
|
520
|
-
if (
|
|
521
|
-
throw new RangeError(`${
|
|
259
|
+
throw new RangeError(`${Nn(n, void 0)} must be an object of CSS properties or undefined, got ${e === null ? "null" : typeof e}.`);
|
|
260
|
+
for (const [s, a] of Object.entries(e))
|
|
261
|
+
if (a !== void 0 && !t.has(s))
|
|
262
|
+
throw new RangeError(`${Nn(n, s)} cannot be set: ${Zr}, so ${r}.`);
|
|
522
263
|
}
|
|
523
|
-
}, Ge = (e, t) =>
|
|
524
|
-
const
|
|
525
|
-
return
|
|
264
|
+
}, Ge = (e, t) => Wn(e, qr, t, "a row style accepts only paint and text properties (ROW_STYLE_PROPERTIES)"), eo = (e, t) => Wn(e, Qr, t, "the expand icon style accepts only the glyph's colour and opacity (EXPAND_ICON_STYLE_PROPERTIES), and the 14 px expand box is the tree's"), to = 500, jn = ({ entry: e, isDirectory: t, isExpanded: n, isItemSelected: r, selectionMode: s, onSelectionChange: a, onEntryClick: i, toggleDirectory: c, onToggleDirectoryRecursive: d }) => {
|
|
265
|
+
const y = H(null);
|
|
266
|
+
return Ae(
|
|
526
267
|
() => () => {
|
|
527
|
-
|
|
268
|
+
y.current && window.clearTimeout(y.current);
|
|
528
269
|
},
|
|
529
270
|
[]
|
|
530
|
-
),
|
|
271
|
+
), E(
|
|
531
272
|
(N) => {
|
|
532
|
-
N.stopPropagation(),
|
|
533
|
-
let
|
|
534
|
-
|
|
273
|
+
N.stopPropagation(), s !== "none" && !t && a && a(e, !r);
|
|
274
|
+
let w = !1;
|
|
275
|
+
i({
|
|
535
276
|
entry: e,
|
|
536
277
|
isDirectory: t,
|
|
537
278
|
isExpanded: n,
|
|
538
279
|
preventDefault: () => {
|
|
539
|
-
|
|
280
|
+
w = !0;
|
|
540
281
|
}
|
|
541
|
-
}), !(!t ||
|
|
542
|
-
|
|
543
|
-
},
|
|
282
|
+
}), !(!t || w) && (y.current ? (window.clearTimeout(y.current), y.current = null, d(e)) : y.current = window.setTimeout(() => {
|
|
283
|
+
c(e.absolutePath), y.current = null;
|
|
284
|
+
}, to));
|
|
544
285
|
},
|
|
545
|
-
[t, e, n,
|
|
286
|
+
[t, e, n, d, c, i, s, a, r]
|
|
546
287
|
);
|
|
547
|
-
},
|
|
288
|
+
}, Kn = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", Rn = (e, t) => e.children !== void 0 && t(e.absolutePath), Gn = (e, t) => ({
|
|
548
289
|
width: e,
|
|
549
290
|
gridTemplateColumns: t
|
|
550
|
-
}),
|
|
291
|
+
}), Yn = zt(
|
|
551
292
|
({
|
|
552
293
|
entry: e,
|
|
553
294
|
indentLevel: t,
|
|
554
295
|
positionInSet: n,
|
|
555
296
|
setSize: r,
|
|
556
|
-
rowIndex:
|
|
557
|
-
flatIndex:
|
|
558
|
-
onRowFocus:
|
|
559
|
-
onRowBlur:
|
|
560
|
-
isSelectedForAria:
|
|
561
|
-
rowHeight:
|
|
297
|
+
rowIndex: s,
|
|
298
|
+
flatIndex: a,
|
|
299
|
+
onRowFocus: i,
|
|
300
|
+
onRowBlur: c,
|
|
301
|
+
isSelectedForAria: d,
|
|
302
|
+
rowHeight: y,
|
|
562
303
|
isDirOpen: N,
|
|
563
|
-
columns:
|
|
564
|
-
numericTemplate:
|
|
565
|
-
numericTotal:
|
|
566
|
-
nameWidth:
|
|
567
|
-
rowClassName:
|
|
568
|
-
selection: { onEntryClick:
|
|
569
|
-
expansion: { toggleDirectory:
|
|
570
|
-
visual: { iconOverrides:
|
|
304
|
+
columns: w,
|
|
305
|
+
numericTemplate: R,
|
|
306
|
+
numericTotal: f,
|
|
307
|
+
nameWidth: m,
|
|
308
|
+
rowClassName: h,
|
|
309
|
+
selection: { onEntryClick: S, selectedPath: b, currentPath: z, mode: x = "none", selectedItems: k, onSelectionChange: p },
|
|
310
|
+
expansion: { toggleDirectory: L, onToggleDirectoryRecursive: D },
|
|
311
|
+
visual: { iconOverrides: P, showExpandIcons: le = !0, showDirectoryIcons: J = !0, showFileIcons: $ = !0, useCanvasExpandIcons: Y = !1, expandIconSize: be, typeIconSize: B, fontSize: ue, indentSize: Se, highlightStyles: Z, expandIconClassName: q, expandIconStyle: _e }
|
|
571
312
|
}) => {
|
|
572
313
|
Ge(e.style, { option: "entry.style", absolutePath: e.absolutePath });
|
|
573
|
-
const [
|
|
574
|
-
if (
|
|
575
|
-
if (
|
|
576
|
-
} else if (
|
|
577
|
-
return
|
|
314
|
+
const [Re, ke] = de(!1), A = e.children !== void 0, te = A && N(e.absolutePath), M = e.absolutePath === b, Ye = e.absolutePath === z, I = !A && !!k?.has(e.absolutePath), ze = A ? void 0 : $n(e), ve = jn({ entry: e, isDirectory: A, isExpanded: te, isItemSelected: I, selectionMode: x, onSelectionChange: p, onEntryClick: S, toggleDirectory: L, onToggleDirectoryRecursive: D }), Ce = Re ? Z?.hoverClassName !== void 0 ? Z.hoverClassName : T.entryHover : "", Fe = (() => {
|
|
315
|
+
if (A) {
|
|
316
|
+
if (M) return Z?.directorySelectedClassName !== void 0 ? Z.directorySelectedClassName : T.entrySelected;
|
|
317
|
+
} else if (M || I)
|
|
318
|
+
return Z?.itemSelectedClassName !== void 0 ? Z.itemSelectedClassName : j(M && T.entrySelected, I && T.entryItemSelected);
|
|
578
319
|
return "";
|
|
579
|
-
})(),
|
|
580
|
-
...
|
|
581
|
-
...
|
|
582
|
-
...!
|
|
320
|
+
})(), C = typeof h == "function" ? h(e) : h, he = j("dt-grid-row cursor-pointer select-none", Ce, Fe, C, e.className), K = j(T.expandIcon, q, (M || I) && T.expandIconSelected), $e = j(T.typeIcon, (M || I) && T.typeIconSelected), Q = j("dt-grid-name-label ml-1", oe.name, A && T.nameDirectory, (M || I) && T.nameSelected), X = Mn({ isDirectory: A, isExpanded: te, showExpandIcons: le, useCanvasExpandIcons: Y, expandIconSize: be }), ne = (A ? J : $) ? Hn({ entry: e, isDirectory: A, isExpanded: te, isSelected: M, isItemSelected: I, extension: ze, mimeType: e.mimeType }, P, B) : null, we = { indentLevel: t, isDirectory: A, isExpanded: te }, [me, ...Pe] = w, pe = me?.render ? me.render(e, we) : e.label ?? e.name, Xe = {
|
|
321
|
+
...Re ? Z?.hoverStyle : {},
|
|
322
|
+
...A && M ? Z?.directorySelectedStyle : {},
|
|
323
|
+
...!A && (M || I) ? Z?.itemSelectedStyle : {}
|
|
583
324
|
};
|
|
584
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ Ne(
|
|
585
326
|
"div",
|
|
586
327
|
{
|
|
587
|
-
className:
|
|
588
|
-
style: { ...
|
|
328
|
+
className: he,
|
|
329
|
+
style: { ...Xe, ...e.style, height: y },
|
|
589
330
|
role: "row",
|
|
590
|
-
"aria-expanded":
|
|
331
|
+
"aria-expanded": A ? te : void 0,
|
|
591
332
|
"aria-level": t + 1,
|
|
592
333
|
"aria-posinset": n,
|
|
593
334
|
"aria-setsize": r,
|
|
594
|
-
"aria-rowindex":
|
|
595
|
-
"aria-selected":
|
|
596
|
-
"aria-current":
|
|
597
|
-
...
|
|
598
|
-
"data-entry-type":
|
|
599
|
-
"data-entry-expanded":
|
|
600
|
-
"data-entry-selected":
|
|
601
|
-
"data-entry-item-selected":
|
|
602
|
-
onClick:
|
|
603
|
-
onMouseEnter: () =>
|
|
604
|
-
onMouseLeave: () =>
|
|
605
|
-
onFocus: (
|
|
606
|
-
onBlur: (
|
|
607
|
-
onKeyDown: (
|
|
608
|
-
if (
|
|
609
|
-
if (
|
|
610
|
-
|
|
335
|
+
"aria-rowindex": s,
|
|
336
|
+
"aria-selected": x === "none" ? void 0 : d,
|
|
337
|
+
"aria-current": Ye ? "page" : void 0,
|
|
338
|
+
...Bn(e.data),
|
|
339
|
+
"data-entry-type": A ? "directory" : "file",
|
|
340
|
+
"data-entry-expanded": A ? String(te) : void 0,
|
|
341
|
+
"data-entry-selected": M ? "true" : void 0,
|
|
342
|
+
"data-entry-item-selected": I ? "true" : void 0,
|
|
343
|
+
onClick: ve,
|
|
344
|
+
onMouseEnter: () => ke(!0),
|
|
345
|
+
onMouseLeave: () => ke(!1),
|
|
346
|
+
onFocus: (F) => i(a, e.absolutePath, F.currentTarget),
|
|
347
|
+
onBlur: (F) => c(e.absolutePath, F.currentTarget),
|
|
348
|
+
onKeyDown: (F) => {
|
|
349
|
+
if (F.key === "Enter") {
|
|
350
|
+
if (F.repeat) {
|
|
351
|
+
F.preventDefault();
|
|
611
352
|
return;
|
|
612
353
|
}
|
|
613
|
-
|
|
354
|
+
ve(F);
|
|
614
355
|
}
|
|
615
356
|
},
|
|
616
357
|
tabIndex: 0,
|
|
617
358
|
children: [
|
|
618
|
-
/* @__PURE__ */
|
|
619
|
-
(
|
|
620
|
-
(
|
|
621
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ Ne("div", { className: j("dt-grid-name-cell", me?.className), role: "gridcell", style: { width: m, paddingLeft: Math.max(0, t * Se) }, children: [
|
|
360
|
+
(le || Y) && /* @__PURE__ */ u("span", { className: K, style: { ..._e, width: se, height: se }, children: X }),
|
|
361
|
+
(A ? J : $) && /* @__PURE__ */ u("span", { className: $e, style: { width: B, height: B }, children: ne }),
|
|
362
|
+
/* @__PURE__ */ u("span", { className: Q, style: Fn(ue), children: pe })
|
|
622
363
|
] }),
|
|
623
|
-
Pe.length > 0 && /* @__PURE__ */
|
|
364
|
+
Pe.length > 0 && /* @__PURE__ */ u("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ u("div", { className: "dt-grid-numeric-track", style: Gn(f, R), children: Pe.map((F) => /* @__PURE__ */ u("div", { className: j("dt-grid-cell", Kn(F.align), F.className), role: "gridcell", children: F.render ? F.render(e, we) : null }, F.key)) }) })
|
|
624
365
|
]
|
|
625
366
|
}
|
|
626
367
|
);
|
|
627
368
|
},
|
|
628
369
|
(e, t) => {
|
|
629
370
|
if (e.entry !== t.entry) return !1;
|
|
630
|
-
const n =
|
|
371
|
+
const n = Rn(e.entry, e.isDirOpen), r = Rn(t.entry, t.isDirOpen);
|
|
631
372
|
return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowIndex === t.rowIndex && // 焦点の通知は行番号で行うため、番号が変われば描き直してハンドラへ新しい番号を渡す
|
|
632
373
|
e.flatIndex === t.flatIndex && e.isSelectedForAria === t.isSelectedForAria && e.rowHeight === t.rowHeight && n === r && 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.currentPath === t.selection.currentPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
|
|
633
374
|
}
|
|
634
375
|
);
|
|
635
|
-
|
|
636
|
-
const
|
|
376
|
+
Yn.displayName = "DirectoryTreeGridRow";
|
|
377
|
+
const Xn = ({
|
|
637
378
|
kind: e,
|
|
638
379
|
columns: t,
|
|
639
380
|
numericTemplate: n,
|
|
640
381
|
numericTotal: r,
|
|
641
|
-
nameWidth:
|
|
642
|
-
scrollBarWidth:
|
|
643
|
-
className:
|
|
644
|
-
nameContent:
|
|
645
|
-
renderCell:
|
|
382
|
+
nameWidth: s,
|
|
383
|
+
scrollBarWidth: a,
|
|
384
|
+
className: i,
|
|
385
|
+
nameContent: c,
|
|
386
|
+
renderCell: d
|
|
646
387
|
}) => {
|
|
647
|
-
const [, ...
|
|
648
|
-
return /* @__PURE__ */
|
|
649
|
-
/* @__PURE__ */
|
|
650
|
-
|
|
651
|
-
/* @__PURE__ */
|
|
388
|
+
const [, ...y] = t, N = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", w = e === "header" ? "dt-grid-header" : "dt-grid-footer", R = e === "header" ? "columnheader" : "gridcell";
|
|
389
|
+
return /* @__PURE__ */ Ne("div", { className: j(w, oe.gridEdge, i), role: "row", children: [
|
|
390
|
+
/* @__PURE__ */ u("div", { className: j(N, "px-1", t[0]?.className), role: R, style: { width: s }, children: c }),
|
|
391
|
+
y.length > 0 && /* @__PURE__ */ u("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ u("div", { className: "dt-grid-numeric-track", style: Gn(r, n), children: y.map((f) => /* @__PURE__ */ u("div", { className: j("dt-grid-cell", Kn(f.align), f.className), role: R, children: d(f) }, f.key)) }) }),
|
|
392
|
+
/* @__PURE__ */ u("div", { className: "dt-grid-scrollbar-spacer", style: { width: a }, "aria-hidden": "true" })
|
|
652
393
|
] });
|
|
653
|
-
},
|
|
394
|
+
}, no = ({ columns: e, className: t, ...n }) => /* @__PURE__ */ u(Xn, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (r) => r.header ?? null, ...n }), kn = (e, t) => typeof e == "function" ? e(t) : e ?? null, ro = ({ columns: e, allEntries: t, className: n, ...r }) => /* @__PURE__ */ u(Xn, { kind: "footer", columns: e, className: n, nameContent: kn(e[0]?.footer, t), renderCell: (s) => kn(s.footer, t), ...r }), oo = 240, Vn = 96, Un = 12, Dt = (e, t) => {
|
|
654
395
|
const n = e?.width;
|
|
655
396
|
return typeof n == "number" && Number.isFinite(n) && n > 0 ? n : t;
|
|
656
|
-
},
|
|
657
|
-
const r =
|
|
658
|
-
return { nameWidth: r, numericTotal:
|
|
659
|
-
},
|
|
397
|
+
}, so = (e) => e.slice(1).map((t) => `${Dt(t, Vn)}px`).join(" "), io = ({ measuredWidth: e, columns: t, scrollBarWidth: n = Un }) => {
|
|
398
|
+
const r = Dt(t[0], oo), s = t.slice(1).reduce((d, y) => d + Dt(y, Vn), 0), a = Number.isFinite(e) && e > 0 ? e : 0, i = Math.max(0, a - r - Math.max(0, n)), c = Math.max(0, s - i);
|
|
399
|
+
return { nameWidth: r, numericTotal: s, numericVisible: i, maxHScroll: c };
|
|
400
|
+
}, Ot = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, ao = (e) => {
|
|
660
401
|
const t = [], n = (r) => {
|
|
661
|
-
for (const
|
|
662
|
-
t.push(
|
|
402
|
+
for (const s of r)
|
|
403
|
+
t.push(s), s.children && s.children.length > 0 && n(s.children);
|
|
663
404
|
};
|
|
664
405
|
return n(e), t;
|
|
665
|
-
},
|
|
406
|
+
}, Jn = ["entryKindDirectory", "entryKindFile"], Cn = [...ht, ...Jn], At = Object.freeze({
|
|
666
407
|
en: Object.freeze({
|
|
667
408
|
entryKindDirectory: "directory",
|
|
668
409
|
entryKindFile: "file"
|
|
@@ -671,45 +412,45 @@ const Qn = ({
|
|
|
671
412
|
entryKindDirectory: "ディレクトリ",
|
|
672
413
|
entryKindFile: "ファイル"
|
|
673
414
|
})
|
|
674
|
-
}),
|
|
675
|
-
en: Object.freeze({ ...
|
|
676
|
-
ja: Object.freeze({ ...
|
|
677
|
-
}),
|
|
415
|
+
}), lo = Object.freeze({
|
|
416
|
+
en: Object.freeze({ ...In.en, ...At.en }),
|
|
417
|
+
ja: Object.freeze({ ...In.ja, ...At.ja })
|
|
418
|
+
}), Pn = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, co = (e) => {
|
|
678
419
|
const t = {};
|
|
679
420
|
let n = !1;
|
|
680
|
-
for (const r of
|
|
681
|
-
const
|
|
682
|
-
|
|
421
|
+
for (const r of ht) {
|
|
422
|
+
const s = Object.hasOwn(e, r) ? e[r] : void 0;
|
|
423
|
+
s !== void 0 && (t[r] = s, n = !0);
|
|
683
424
|
}
|
|
684
425
|
return n ? t : void 0;
|
|
685
|
-
},
|
|
686
|
-
const n =
|
|
426
|
+
}, uo = (e, t) => {
|
|
427
|
+
const n = An(e);
|
|
687
428
|
if (t === void 0)
|
|
688
|
-
return
|
|
429
|
+
return lo[n];
|
|
689
430
|
if (t === null || typeof t != "object")
|
|
690
|
-
throw new RangeError(`[directory-tree] labels must be an object; got ${
|
|
431
|
+
throw new RangeError(`[directory-tree] labels must be an object; got ${Pn(t)}`);
|
|
691
432
|
const r = Object.getPrototypeOf(t);
|
|
692
433
|
if (r !== Object.prototype && r !== null)
|
|
693
434
|
throw new RangeError(`[directory-tree] labels must be a plain object (prototype Object.prototype or null); got ${Array.isArray(t) ? "an array" : "an object with a non-plain prototype"}`);
|
|
694
|
-
for (const
|
|
695
|
-
if (!
|
|
696
|
-
throw new RangeError(`[directory-tree] labels.${
|
|
697
|
-
const
|
|
698
|
-
for (const
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
if (typeof
|
|
702
|
-
throw new RangeError(`[directory-tree] labels.${
|
|
703
|
-
i
|
|
435
|
+
for (const i of Object.keys(t))
|
|
436
|
+
if (!Cn.includes(i))
|
|
437
|
+
throw new RangeError(`[directory-tree] labels.${i} is not a known label key; expected one of ${Cn.join(", ")}`);
|
|
438
|
+
const a = { ...dr(n, co(t)), ...At[n] };
|
|
439
|
+
for (const i of Jn) {
|
|
440
|
+
const c = Object.hasOwn(t, i) ? t[i] : void 0;
|
|
441
|
+
if (c !== void 0) {
|
|
442
|
+
if (typeof c != "string" || c.trim() === "")
|
|
443
|
+
throw new RangeError(`[directory-tree] labels.${i} must be a non-blank string; got ${Pn(c)}`);
|
|
444
|
+
a[i] = c;
|
|
704
445
|
}
|
|
705
446
|
}
|
|
706
|
-
return Object.freeze(
|
|
707
|
-
},
|
|
447
|
+
return Object.freeze(a);
|
|
448
|
+
}, ho = (e) => {
|
|
708
449
|
const t = {};
|
|
709
|
-
for (const n of
|
|
450
|
+
for (const n of ht)
|
|
710
451
|
t[n] = e[n];
|
|
711
452
|
return Object.freeze(t);
|
|
712
|
-
},
|
|
453
|
+
}, fo = () => {
|
|
713
454
|
let e = null;
|
|
714
455
|
return {
|
|
715
456
|
mark: (t) => {
|
|
@@ -720,204 +461,205 @@ const Qn = ({
|
|
|
720
461
|
},
|
|
721
462
|
landedOn: (t) => e?.includes(t) === !0
|
|
722
463
|
};
|
|
723
|
-
},
|
|
464
|
+
}, Qe = (e) => typeof e == "string" ? JSON.stringify(e) : String(e), _t = (e, t) => {
|
|
724
465
|
if (typeof t != "number" || !Number.isFinite(t) || t <= 0)
|
|
725
|
-
throw new RangeError(`[directory-tree] visual.${e} must be a finite number greater than 0 (px); got ${
|
|
466
|
+
throw new RangeError(`[directory-tree] visual.${e} must be a finite number greater than 0 (px); got ${Qe(t)}.`);
|
|
726
467
|
return t;
|
|
727
|
-
},
|
|
468
|
+
}, mo = (e) => {
|
|
728
469
|
if (typeof e == "string" && e.trim() !== "" || typeof e == "number" && Number.isFinite(e) && e > 0)
|
|
729
470
|
return e;
|
|
730
|
-
throw new RangeError(`[directory-tree] visual.fontSize must be a finite number greater than 0 (px) or a CSS font size that is not blank; got ${
|
|
731
|
-
},
|
|
732
|
-
indentSize: e === void 0 ?
|
|
733
|
-
typeIconSize: t === void 0 ?
|
|
734
|
-
fontSize: n === void 0 ? void 0 :
|
|
735
|
-
}),
|
|
471
|
+
throw new RangeError(`[directory-tree] visual.fontSize must be a finite number greater than 0 (px) or a CSS font size that is not blank; got ${Qe(e)}.`);
|
|
472
|
+
}, po = ({ indentSize: e, typeIconSize: t, fontSize: n }) => ({
|
|
473
|
+
indentSize: e === void 0 ? Fr : _t("indentSize", e),
|
|
474
|
+
typeIconSize: t === void 0 ? Mr : _t("typeIconSize", t),
|
|
475
|
+
fontSize: n === void 0 ? void 0 : mo(n)
|
|
476
|
+
}), yo = ({ indentSize: e, removeRootIndent: t, hasExpandBox: n }) => t ? Math.max(0, e - (n ? se : 0)) : 0, go = (e, t, n) => {
|
|
736
477
|
if (typeof e != "function")
|
|
737
|
-
return
|
|
478
|
+
return _t("itemHeight", e);
|
|
738
479
|
const r = e(t, n);
|
|
739
480
|
if (typeof r != "number" || !Number.isFinite(r) || r <= 0)
|
|
740
|
-
throw new RangeError(`[directory-tree] visual.itemHeight returned ${
|
|
481
|
+
throw new RangeError(`[directory-tree] visual.itemHeight returned ${Qe(r)} for ${JSON.stringify(t.absolutePath)} (row ${n}); it must return a finite number greater than 0 (px).`);
|
|
741
482
|
return r;
|
|
742
|
-
},
|
|
743
|
-
const r = t === void 0 ?
|
|
744
|
-
if (typeof r != "number" || !Number.isFinite(r) || r <= 0 || r >
|
|
745
|
-
throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${
|
|
746
|
-
const { indentSize:
|
|
747
|
-
if (
|
|
483
|
+
}, bo = (e, t, n) => {
|
|
484
|
+
const r = t === void 0 ? $r : t;
|
|
485
|
+
if (typeof r != "number" || !Number.isFinite(r) || r <= 0 || r > se)
|
|
486
|
+
throw new RangeError(`[directory-tree] visual.expandIconSize must be a finite number greater than 0 and at most ${se} (the expand box, px) while tree lines are drawn; got ${Qe(r)}.`);
|
|
487
|
+
const { indentSize: s, typeIconSize: a } = e, i = r / 2, c = se + a - r / 2;
|
|
488
|
+
if (s < i || s > c)
|
|
748
489
|
throw new RangeError(
|
|
749
|
-
`[directory-tree] visual.indentSize ${
|
|
490
|
+
`[directory-tree] visual.indentSize ${Qe(s)} does not fit the tree lines: with typeIconSize ${a} and an expand glyph of ${r} px it must be from ${i} (half the glyph) to ${c} (the ${se} px expand box + typeIconSize − half the glyph).`
|
|
750
491
|
);
|
|
751
|
-
return { indentSize:
|
|
752
|
-
},
|
|
492
|
+
return { indentSize: s, typeIconSize: a, glyphSize: r, originX: n };
|
|
493
|
+
}, So = ({ indentSize: e, typeIconSize: t, glyphSize: n }) => Math.min(Math.max(se + t / 2 - e, n / 2), se - n / 2), vo = (e, t) => {
|
|
753
494
|
const n = e.length - 1;
|
|
754
495
|
if (n <= 0) return 0;
|
|
755
|
-
let r = 0,
|
|
756
|
-
for (; r <=
|
|
757
|
-
const
|
|
758
|
-
e[
|
|
496
|
+
let r = 0, s = n - 1, a = 0;
|
|
497
|
+
for (; r <= s; ) {
|
|
498
|
+
const i = r + s >>> 1;
|
|
499
|
+
e[i] <= t ? (a = i, r = i + 1) : s = i - 1;
|
|
759
500
|
}
|
|
760
|
-
return
|
|
761
|
-
},
|
|
501
|
+
return a;
|
|
502
|
+
}, wo = (e, t, n) => {
|
|
762
503
|
if (n <= 0 || e.length === 0 || t.length !== e.length + 1)
|
|
763
504
|
return null;
|
|
764
|
-
const r =
|
|
765
|
-
return
|
|
766
|
-
path:
|
|
505
|
+
const r = vo(t, n), s = e[r];
|
|
506
|
+
return s ? {
|
|
507
|
+
path: s.entry.absolutePath,
|
|
767
508
|
offsetInViewport: n - t[r]
|
|
768
509
|
} : null;
|
|
769
|
-
},
|
|
510
|
+
}, Io = (e, t, n) => {
|
|
770
511
|
if (t.length === 0 || n.length !== t.length + 1)
|
|
771
512
|
return null;
|
|
772
513
|
for (let r = 0; r < t.length; r++)
|
|
773
514
|
if (t[r].entry.absolutePath === e.path)
|
|
774
515
|
return Math.max(0, n[r] + e.offsetInViewport);
|
|
775
516
|
return null;
|
|
776
|
-
},
|
|
517
|
+
}, Eo = (e, t, n) => {
|
|
777
518
|
const r = [];
|
|
778
|
-
for (let
|
|
779
|
-
const
|
|
780
|
-
if (!(!
|
|
781
|
-
for (const
|
|
782
|
-
r.push(
|
|
519
|
+
for (let s = t; s < n; s++) {
|
|
520
|
+
const a = e[s];
|
|
521
|
+
if (!(!a || a.length === 0))
|
|
522
|
+
for (const i of a)
|
|
523
|
+
r.push(i);
|
|
783
524
|
}
|
|
784
525
|
return r;
|
|
785
|
-
},
|
|
526
|
+
}, xo = (e, t, n) => {
|
|
786
527
|
const r = [];
|
|
787
|
-
for (let
|
|
788
|
-
const
|
|
789
|
-
if (!(!
|
|
790
|
-
for (const
|
|
791
|
-
r.push(
|
|
528
|
+
for (let s = t; s < n; s++) {
|
|
529
|
+
const a = e[s];
|
|
530
|
+
if (!(!a || a.length === 0))
|
|
531
|
+
for (const i of a)
|
|
532
|
+
r.push(i);
|
|
792
533
|
}
|
|
793
534
|
return r;
|
|
794
|
-
},
|
|
795
|
-
const
|
|
796
|
-
(e.width !==
|
|
797
|
-
const
|
|
798
|
-
|
|
799
|
-
},
|
|
535
|
+
}, No = (e, t, n, r) => {
|
|
536
|
+
const s = Math.max(1, Math.floor(t * r)), a = Math.max(1, Math.floor(n * r));
|
|
537
|
+
(e.width !== s || e.height !== a) && (e.width = s, e.height = a);
|
|
538
|
+
const i = e.style;
|
|
539
|
+
i.width !== `${t}px` && (i.width = `${t}px`), i.height !== `${n}px` && (i.height = `${n}px`);
|
|
540
|
+
}, Ro = (e, t, n) => {
|
|
800
541
|
e.lineWidth = n, e.beginPath();
|
|
801
542
|
for (const r of t)
|
|
802
543
|
e.moveTo(r.x1, r.y1), e.lineTo(r.x2, r.y2);
|
|
803
544
|
e.stroke();
|
|
804
|
-
},
|
|
545
|
+
}, ko = (e, t, n, r) => {
|
|
805
546
|
if (t.length === 0)
|
|
806
547
|
return;
|
|
807
|
-
const
|
|
548
|
+
const s = e.strokeStyle, a = e.lineWidth, i = e.lineCap, c = e.lineJoin;
|
|
808
549
|
e.strokeStyle = n, e.lineCap = "round", e.lineJoin = "round";
|
|
809
|
-
for (const
|
|
810
|
-
const
|
|
811
|
-
e.lineWidth =
|
|
550
|
+
for (const d of t) {
|
|
551
|
+
const y = r ?? d.size, N = Math.max(0, y / 2), w = Math.max(1, Math.round(y * 0.08)), R = Math.max(1, Math.round(y * 0.14)), f = Math.max(0, N - w * 0.8), m = Math.max(0, f * 0.55);
|
|
552
|
+
e.lineWidth = w, e.beginPath(), e.arc(d.centerX, d.centerY, Math.max(0, N - w * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = R, e.beginPath(), e.moveTo(d.centerX - m, d.centerY), e.lineTo(d.centerX + m, d.centerY), e.stroke(), d.isExpanded || (e.beginPath(), e.moveTo(d.centerX, d.centerY - m), e.lineTo(d.centerX, d.centerY + m), e.stroke());
|
|
812
553
|
}
|
|
813
|
-
e.strokeStyle =
|
|
814
|
-
},
|
|
815
|
-
const
|
|
554
|
+
e.strokeStyle = s, e.lineWidth = a, e.lineCap = i, e.lineJoin = c;
|
|
555
|
+
}, Zn = zt(({ segmentsByItem: e, glyphsByItem: t, itemHeight: n, width: r, viewportHeight: s, scrollPosition: a, color: i = _n, strokeWidth: c = 1, renderStartIndex: d, renderEndIndex: y, lookaheadEndIndex: N, devicePixelRatio: w, expandGlyphColor: R, expandGlyphSize: f }) => {
|
|
556
|
+
const m = H(null), h = H(null), S = H({
|
|
816
557
|
segmentsByItem: e,
|
|
817
558
|
glyphsByItem: t,
|
|
818
559
|
itemHeight: n,
|
|
819
560
|
width: r,
|
|
820
|
-
viewportHeight:
|
|
821
|
-
scrollPosition:
|
|
822
|
-
color:
|
|
823
|
-
strokeWidth:
|
|
824
|
-
renderStartIndex:
|
|
825
|
-
renderEndIndex:
|
|
561
|
+
viewportHeight: s,
|
|
562
|
+
scrollPosition: a,
|
|
563
|
+
color: i,
|
|
564
|
+
strokeWidth: c,
|
|
565
|
+
renderStartIndex: d,
|
|
566
|
+
renderEndIndex: y,
|
|
826
567
|
lookaheadEndIndex: N,
|
|
827
|
-
devicePixelRatio:
|
|
828
|
-
expandGlyphColor:
|
|
829
|
-
expandGlyphSize:
|
|
830
|
-
}),
|
|
831
|
-
|
|
832
|
-
const
|
|
833
|
-
if (!
|
|
568
|
+
devicePixelRatio: w,
|
|
569
|
+
expandGlyphColor: R,
|
|
570
|
+
expandGlyphSize: f
|
|
571
|
+
}), b = E(() => {
|
|
572
|
+
h.current = null;
|
|
573
|
+
const x = m.current;
|
|
574
|
+
if (!x)
|
|
834
575
|
return;
|
|
835
|
-
const
|
|
836
|
-
if (!
|
|
576
|
+
const k = x.getContext("2d");
|
|
577
|
+
if (!k)
|
|
837
578
|
return;
|
|
838
|
-
const
|
|
839
|
-
if (
|
|
840
|
-
|
|
579
|
+
const p = S.current;
|
|
580
|
+
if (p.width <= 0 || p.viewportHeight <= 0) {
|
|
581
|
+
k.clearRect(0, 0, x.width, x.height);
|
|
841
582
|
return;
|
|
842
583
|
}
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
if (typeof
|
|
847
|
-
const
|
|
848
|
-
return Math.max(Math.min(
|
|
584
|
+
const L = Number.isFinite(p.devicePixelRatio ?? NaN) ? p.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
|
|
585
|
+
No(x, p.width, p.viewportHeight, L);
|
|
586
|
+
const D = p.segmentsByItem.length, P = typeof p.renderStartIndex == "number" && Number.isFinite(p.renderStartIndex) ? Math.max(0, Math.floor(p.renderStartIndex)) : Math.max(0, Math.floor(p.scrollPosition / p.itemHeight)), le = Math.min(D, Math.ceil((p.scrollPosition + p.viewportHeight) / p.itemHeight)), J = (() => {
|
|
587
|
+
if (typeof p.renderEndIndex == "number" && Number.isFinite(p.renderEndIndex)) {
|
|
588
|
+
const B = Math.floor(p.renderEndIndex);
|
|
589
|
+
return Math.max(Math.min(D, B + 1), P);
|
|
849
590
|
}
|
|
850
|
-
return Math.max(
|
|
851
|
-
})(),
|
|
852
|
-
if (typeof
|
|
853
|
-
const
|
|
854
|
-
return Math.max(
|
|
591
|
+
return Math.max(le, P);
|
|
592
|
+
})(), $ = (() => {
|
|
593
|
+
if (typeof p.lookaheadEndIndex == "number" && Number.isFinite(p.lookaheadEndIndex)) {
|
|
594
|
+
const B = Math.floor(p.lookaheadEndIndex), ue = Math.min(D, B + 1);
|
|
595
|
+
return Math.max(ue, J);
|
|
855
596
|
}
|
|
856
|
-
return Math.max(
|
|
857
|
-
})(),
|
|
858
|
-
|
|
859
|
-
}, []),
|
|
860
|
-
|
|
861
|
-
}, [
|
|
862
|
-
return
|
|
863
|
-
|
|
597
|
+
return Math.max(le, J);
|
|
598
|
+
})(), Y = Eo(p.segmentsByItem, P, $), be = xo(p.glyphsByItem, P, $);
|
|
599
|
+
k.save(), k.scale(L, L), k.clearRect(0, 0, p.width, p.viewportHeight), k.translate(0, -p.scrollPosition), k.strokeStyle = p.color, Ro(k, Y, p.strokeWidth), ko(k, be, p.expandGlyphColor ?? p.color, p.expandGlyphSize), k.restore();
|
|
600
|
+
}, []), z = E(() => {
|
|
601
|
+
h.current === null && (h.current = window.requestAnimationFrame(b));
|
|
602
|
+
}, [b]);
|
|
603
|
+
return Ae(() => {
|
|
604
|
+
S.current = {
|
|
864
605
|
segmentsByItem: e,
|
|
865
606
|
glyphsByItem: t,
|
|
866
607
|
itemHeight: n,
|
|
867
608
|
width: r,
|
|
868
|
-
viewportHeight:
|
|
869
|
-
scrollPosition:
|
|
870
|
-
color:
|
|
871
|
-
strokeWidth:
|
|
872
|
-
renderStartIndex:
|
|
873
|
-
renderEndIndex:
|
|
609
|
+
viewportHeight: s,
|
|
610
|
+
scrollPosition: a,
|
|
611
|
+
color: i,
|
|
612
|
+
strokeWidth: c,
|
|
613
|
+
renderStartIndex: d,
|
|
614
|
+
renderEndIndex: y,
|
|
874
615
|
lookaheadEndIndex: N,
|
|
875
|
-
devicePixelRatio:
|
|
876
|
-
expandGlyphColor:
|
|
877
|
-
expandGlyphSize:
|
|
878
|
-
},
|
|
879
|
-
}, [e, t, n, r, a, i,
|
|
880
|
-
|
|
881
|
-
}, []), /* @__PURE__ */
|
|
616
|
+
devicePixelRatio: w,
|
|
617
|
+
expandGlyphColor: R,
|
|
618
|
+
expandGlyphSize: f
|
|
619
|
+
}, z();
|
|
620
|
+
}, [e, t, n, r, s, a, i, c, d, y, N, w, R, f, z]), Ae(() => () => {
|
|
621
|
+
h.current !== null && (window.cancelAnimationFrame(h.current), h.current = null);
|
|
622
|
+
}, []), /* @__PURE__ */ u("canvas", { ref: m, className: "pointer-events-none absolute top-0 left-0 z-0" });
|
|
882
623
|
});
|
|
883
|
-
|
|
884
|
-
const
|
|
624
|
+
Zn.displayName = "TreeLineCanvas";
|
|
625
|
+
const Co = (e) => {
|
|
885
626
|
const t = /* @__PURE__ */ new Map();
|
|
886
627
|
for (let n = 0; n < e.length; n++) {
|
|
887
628
|
const r = e[n].entry.absolutePath;
|
|
888
629
|
t.has(r) || t.set(r, n);
|
|
889
630
|
}
|
|
890
631
|
return t;
|
|
891
|
-
},
|
|
892
|
-
const { anchor: n, selectionGeneration: r, selectedPath:
|
|
632
|
+
}, Tn = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, Po = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), To = (e, t) => {
|
|
633
|
+
const { anchor: n, selectionGeneration: r, selectedPath: s } = t;
|
|
893
634
|
if (n !== null && (n.focused || n.selectionGeneration === r)) {
|
|
894
|
-
const
|
|
895
|
-
if (
|
|
896
|
-
return
|
|
635
|
+
const a = e.get(n.path);
|
|
636
|
+
if (a !== void 0)
|
|
637
|
+
return a;
|
|
897
638
|
}
|
|
898
|
-
if (
|
|
899
|
-
const
|
|
900
|
-
if (
|
|
901
|
-
return
|
|
639
|
+
if (s !== null) {
|
|
640
|
+
const a = e.get(s);
|
|
641
|
+
if (a !== void 0)
|
|
642
|
+
return a;
|
|
902
643
|
}
|
|
903
644
|
return 0;
|
|
904
|
-
},
|
|
645
|
+
}, Oo = {
|
|
905
646
|
msOverflowStyle: "none",
|
|
906
647
|
scrollbarWidth: "none"
|
|
907
|
-
},
|
|
648
|
+
}, Lo = () => {
|
|
908
649
|
let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
|
|
909
650
|
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));
|
|
910
|
-
},
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
651
|
+
}, Do = () => () => {
|
|
652
|
+
}, Ao = () => !0, _o = () => !1, zo = (e) => {
|
|
653
|
+
const t = H(null), n = t.current;
|
|
654
|
+
return n !== null && ht.every((r) => n[r] === e[r]) ? n : (t.current = e, e);
|
|
655
|
+
}, On = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), Ln = (e) => {
|
|
914
656
|
const t = e?.align;
|
|
915
657
|
if (t === void 0)
|
|
916
658
|
return "top";
|
|
917
|
-
if (
|
|
918
|
-
throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[
|
|
659
|
+
if (!On.has(t))
|
|
660
|
+
throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...On].join(", ")}.`);
|
|
919
661
|
return t;
|
|
920
|
-
},
|
|
662
|
+
}, Fo = {
|
|
921
663
|
position: "absolute",
|
|
922
664
|
width: 1,
|
|
923
665
|
height: 1,
|
|
@@ -927,230 +669,230 @@ const Do = (e) => {
|
|
|
927
669
|
overflow: "hidden",
|
|
928
670
|
clipPath: "inset(50%)",
|
|
929
671
|
whiteSpace: "nowrap"
|
|
930
|
-
},
|
|
931
|
-
const
|
|
932
|
-
let
|
|
933
|
-
const
|
|
934
|
-
const
|
|
935
|
-
for (let
|
|
936
|
-
const
|
|
937
|
-
let
|
|
938
|
-
r && (
|
|
939
|
-
id:
|
|
940
|
-
name:
|
|
941
|
-
absolutePath:
|
|
942
|
-
indentLevel:
|
|
943
|
-
isLastChild:
|
|
944
|
-
isDirectory:
|
|
945
|
-
isExpanded:
|
|
946
|
-
ancestorIsLast: [...
|
|
672
|
+
}, $o = (e, t, n, r, s) => {
|
|
673
|
+
const a = [], i = [];
|
|
674
|
+
let c = 0;
|
|
675
|
+
const d = (y, N, w) => {
|
|
676
|
+
const R = s ? [...y].sort(s) : y;
|
|
677
|
+
for (let f = 0; f < R.length; f++) {
|
|
678
|
+
const m = R[f], h = f === R.length - 1, S = [...w, h], b = m.children !== void 0, z = b && t(m.absolutePath, m.relativePath);
|
|
679
|
+
let x = N, k = w;
|
|
680
|
+
r && (x = N - 1, k = w.slice(1)), a.push({ entry: m, indentLevel: x, depth: N, positionInSet: f + 1, setSize: R.length }), n && (x > c && (c = x), i.push({
|
|
681
|
+
id: m.absolutePath,
|
|
682
|
+
name: m.name,
|
|
683
|
+
absolutePath: m.absolutePath,
|
|
684
|
+
indentLevel: x,
|
|
685
|
+
isLastChild: h,
|
|
686
|
+
isDirectory: b,
|
|
687
|
+
isExpanded: z,
|
|
688
|
+
ancestorIsLast: [...k],
|
|
947
689
|
hideLines: r && N === 0
|
|
948
|
-
})),
|
|
690
|
+
})), b && z && m.children && d(m.children, N + 1, S);
|
|
949
691
|
}
|
|
950
692
|
};
|
|
951
|
-
return
|
|
952
|
-
},
|
|
693
|
+
return d(e, 0, []), { flatItems: a, lineItems: i, maxIndent: c };
|
|
694
|
+
}, Dn = (e, t) => {
|
|
953
695
|
const n = e.length - 1;
|
|
954
696
|
if (n <= 0) return 0;
|
|
955
|
-
let r = 0,
|
|
956
|
-
for (; r <=
|
|
957
|
-
const
|
|
958
|
-
e[
|
|
697
|
+
let r = 0, s = n - 1, a = 0;
|
|
698
|
+
for (; r <= s; ) {
|
|
699
|
+
const i = r + s >>> 1;
|
|
700
|
+
e[i] <= t ? (a = i, r = i + 1) : s = i - 1;
|
|
959
701
|
}
|
|
960
|
-
return
|
|
961
|
-
},
|
|
962
|
-
const
|
|
963
|
-
return { renderStart:
|
|
964
|
-
},
|
|
702
|
+
return a;
|
|
703
|
+
}, Mo = (e, t, n, r, s, a) => {
|
|
704
|
+
const i = r?.renderStart ?? Math.max(0, Dn(a, s)), c = t > 0 ? Dn(a, s + t) + n : i + n, d = e > 0 ? Math.min(e - 1, Math.max(i, c)) : i, y = r?.renderEnd ?? d, N = e > 0 ? Math.min(e - 1, y + n) : y;
|
|
705
|
+
return { renderStart: i, renderEnd: y, lookaheadEnd: N };
|
|
706
|
+
}, Ho = (e, t, n, r) => {
|
|
965
707
|
if (e.length === 0)
|
|
966
708
|
return { segmentsByItem: [], glyphsByItem: [] };
|
|
967
|
-
const { indentSize:
|
|
968
|
-
for (let
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
|
|
709
|
+
const { indentSize: s, typeIconSize: a, glyphSize: i, originX: c } = r, d = Array.from({ length: e.length }, () => []), y = Array.from({ length: e.length }, () => []), N = c + So(r), w = (f) => f * s + N, R = i / 2 + 2;
|
|
710
|
+
for (let f = 0; f < e.length; f++) {
|
|
711
|
+
const m = e[f], h = t[f] ?? 0, S = n[f] ?? 0, b = S + h / 2, z = e[f + 1], x = b + a / 2, k = S + h, p = z !== void 0 && z.indentLevel === m.indentLevel + 1 && x < k ? { key: `${m.id}-connector-children`, x1: w(z.indentLevel), y1: x, x2: w(z.indentLevel), y2: k, itemIndex: f } : null;
|
|
712
|
+
if (m.hideLines) {
|
|
713
|
+
p !== null && (d[f] = [p]);
|
|
972
714
|
continue;
|
|
973
715
|
}
|
|
974
|
-
const
|
|
975
|
-
for (let
|
|
976
|
-
if (
|
|
716
|
+
const L = [];
|
|
717
|
+
for (let P = 0; P < m.indentLevel; P++) {
|
|
718
|
+
if (m.ancestorIsLast[P] ?? !1)
|
|
977
719
|
continue;
|
|
978
720
|
let J = !1;
|
|
979
|
-
for (let
|
|
980
|
-
const
|
|
981
|
-
if (
|
|
721
|
+
for (let $ = f; $ < e.length; $++) {
|
|
722
|
+
const Y = e[$];
|
|
723
|
+
if (Y.indentLevel > P && Y.ancestorIsLast.length > P && !Y.ancestorIsLast[P]) {
|
|
982
724
|
J = !0;
|
|
983
725
|
break;
|
|
984
726
|
}
|
|
985
|
-
if (
|
|
727
|
+
if ($ > f && Y.indentLevel === P)
|
|
986
728
|
break;
|
|
987
729
|
}
|
|
988
730
|
if (J) {
|
|
989
|
-
const
|
|
990
|
-
|
|
991
|
-
key: `${
|
|
992
|
-
x1:
|
|
993
|
-
y1:
|
|
994
|
-
x2:
|
|
995
|
-
y2:
|
|
996
|
-
itemIndex:
|
|
731
|
+
const $ = w(P);
|
|
732
|
+
L.push({
|
|
733
|
+
key: `${m.id}-ancestor-${P}`,
|
|
734
|
+
x1: $,
|
|
735
|
+
y1: S,
|
|
736
|
+
x2: $,
|
|
737
|
+
y2: S + h,
|
|
738
|
+
itemIndex: f
|
|
997
739
|
});
|
|
998
740
|
}
|
|
999
741
|
}
|
|
1000
|
-
const
|
|
1001
|
-
|
|
1002
|
-
key: `${
|
|
1003
|
-
x1:
|
|
1004
|
-
y1:
|
|
1005
|
-
x2:
|
|
1006
|
-
y2:
|
|
1007
|
-
itemIndex:
|
|
1008
|
-
}), !
|
|
1009
|
-
key: `${
|
|
1010
|
-
x1:
|
|
1011
|
-
y1:
|
|
1012
|
-
x2:
|
|
1013
|
-
y2:
|
|
1014
|
-
itemIndex:
|
|
1015
|
-
}),
|
|
1016
|
-
key: `${
|
|
1017
|
-
x1:
|
|
1018
|
-
y1:
|
|
1019
|
-
x2:
|
|
1020
|
-
y2:
|
|
1021
|
-
itemIndex:
|
|
1022
|
-
}) :
|
|
1023
|
-
key: `${
|
|
1024
|
-
x1:
|
|
1025
|
-
y1:
|
|
1026
|
-
x2:
|
|
1027
|
-
y2:
|
|
1028
|
-
itemIndex:
|
|
1029
|
-
})),
|
|
742
|
+
const D = w(m.indentLevel);
|
|
743
|
+
f > 0 && L.push({
|
|
744
|
+
key: `${m.id}-connector-top`,
|
|
745
|
+
x1: D,
|
|
746
|
+
y1: S,
|
|
747
|
+
x2: D,
|
|
748
|
+
y2: m.isDirectory ? b - R : b,
|
|
749
|
+
itemIndex: f
|
|
750
|
+
}), !m.isDirectory && m.isLastChild && L.push({
|
|
751
|
+
key: `${m.id}-connector-horizontal`,
|
|
752
|
+
x1: D,
|
|
753
|
+
y1: b,
|
|
754
|
+
x2: c + m.indentLevel * s + se,
|
|
755
|
+
y2: b,
|
|
756
|
+
itemIndex: f
|
|
757
|
+
}), m.isLastChild || (m.isDirectory ? L.push({
|
|
758
|
+
key: `${m.id}-connector-bottom`,
|
|
759
|
+
x1: D,
|
|
760
|
+
y1: b + R,
|
|
761
|
+
x2: D,
|
|
762
|
+
y2: S + h,
|
|
763
|
+
itemIndex: f
|
|
764
|
+
}) : L.push({
|
|
765
|
+
key: `${m.id}-connector-bottom`,
|
|
766
|
+
x1: D,
|
|
767
|
+
y1: b,
|
|
768
|
+
x2: D,
|
|
769
|
+
y2: S + h,
|
|
770
|
+
itemIndex: f
|
|
771
|
+
})), p !== null && L.push(p), d[f] = L, m.isDirectory && (y[f] = [
|
|
1030
772
|
{
|
|
1031
|
-
key: `${
|
|
1032
|
-
itemIndex:
|
|
1033
|
-
centerX:
|
|
1034
|
-
centerY:
|
|
1035
|
-
size:
|
|
1036
|
-
isExpanded:
|
|
773
|
+
key: `${m.id}-glyph`,
|
|
774
|
+
itemIndex: f,
|
|
775
|
+
centerX: D,
|
|
776
|
+
centerY: b,
|
|
777
|
+
size: i,
|
|
778
|
+
isExpanded: m.isExpanded
|
|
1037
779
|
}
|
|
1038
780
|
]);
|
|
1039
781
|
}
|
|
1040
|
-
return { segmentsByItem:
|
|
1041
|
-
},
|
|
782
|
+
return { segmentsByItem: d, glyphsByItem: y };
|
|
783
|
+
}, qn = zt(
|
|
1042
784
|
({
|
|
1043
785
|
entry: e,
|
|
1044
786
|
indentLevel: t,
|
|
1045
787
|
originX: n,
|
|
1046
788
|
depth: r,
|
|
1047
|
-
positionInSet:
|
|
1048
|
-
setSize:
|
|
1049
|
-
isSelectedForAria:
|
|
1050
|
-
flatIndex:
|
|
1051
|
-
isActive:
|
|
1052
|
-
registerRowRef:
|
|
789
|
+
positionInSet: s,
|
|
790
|
+
setSize: a,
|
|
791
|
+
isSelectedForAria: i,
|
|
792
|
+
flatIndex: c,
|
|
793
|
+
isActive: d,
|
|
794
|
+
registerRowRef: y,
|
|
1053
795
|
onNavigationKeyDown: N,
|
|
1054
|
-
onRowFocus:
|
|
1055
|
-
onRowBlur:
|
|
1056
|
-
rowHeight:
|
|
1057
|
-
entryKindDirectory:
|
|
1058
|
-
entryKindFile:
|
|
1059
|
-
isDirOpen:
|
|
1060
|
-
expansion: { toggleDirectory:
|
|
1061
|
-
selection: { onEntryClick:
|
|
796
|
+
onRowFocus: w,
|
|
797
|
+
onRowBlur: R,
|
|
798
|
+
rowHeight: f,
|
|
799
|
+
entryKindDirectory: m,
|
|
800
|
+
entryKindFile: h,
|
|
801
|
+
isDirOpen: S,
|
|
802
|
+
expansion: { toggleDirectory: b, onToggleDirectoryRecursive: z },
|
|
803
|
+
selection: { onEntryClick: x, selectedPath: k, currentPath: p, mode: L = "none", selectedItems: D, onSelectionChange: P },
|
|
1062
804
|
visual: {
|
|
1063
|
-
iconOverrides:
|
|
805
|
+
iconOverrides: le,
|
|
1064
806
|
showExpandIcons: J = !0,
|
|
1065
|
-
showDirectoryIcons:
|
|
1066
|
-
showFileIcons:
|
|
1067
|
-
useCanvasExpandIcons:
|
|
1068
|
-
expandIconSize:
|
|
1069
|
-
typeIconSize:
|
|
1070
|
-
fontSize:
|
|
1071
|
-
indentSize:
|
|
1072
|
-
highlightStyles:
|
|
1073
|
-
entryClassName:
|
|
1074
|
-
entryStyle:
|
|
1075
|
-
nameClassName:
|
|
1076
|
-
nameStyle:
|
|
1077
|
-
directoryNameClassName:
|
|
1078
|
-
directoryNameStyle:
|
|
1079
|
-
fileNameClassName:
|
|
1080
|
-
fileNameStyle:
|
|
1081
|
-
expandIconClassName:
|
|
1082
|
-
expandIconStyle:
|
|
807
|
+
showDirectoryIcons: $ = !0,
|
|
808
|
+
showFileIcons: Y = !0,
|
|
809
|
+
useCanvasExpandIcons: be = !1,
|
|
810
|
+
expandIconSize: B,
|
|
811
|
+
typeIconSize: ue,
|
|
812
|
+
fontSize: Se,
|
|
813
|
+
indentSize: Z,
|
|
814
|
+
highlightStyles: q,
|
|
815
|
+
entryClassName: _e,
|
|
816
|
+
entryStyle: Re,
|
|
817
|
+
nameClassName: ke,
|
|
818
|
+
nameStyle: A,
|
|
819
|
+
directoryNameClassName: te,
|
|
820
|
+
directoryNameStyle: M,
|
|
821
|
+
fileNameClassName: Ye,
|
|
822
|
+
fileNameStyle: I,
|
|
823
|
+
expandIconClassName: ze,
|
|
824
|
+
expandIconStyle: ve
|
|
1083
825
|
}
|
|
1084
826
|
}) => {
|
|
1085
827
|
Ge(e.style, { option: "entry.style", absolutePath: e.absolutePath });
|
|
1086
|
-
const [
|
|
1087
|
-
if (
|
|
1088
|
-
if (
|
|
1089
|
-
return
|
|
1090
|
-
} else if (
|
|
1091
|
-
return
|
|
828
|
+
const [Ce, Fe] = de(!1), C = e.children !== void 0, he = C && S(e.absolutePath), K = e.absolutePath === k, $e = e.absolutePath === p, Q = !C && D?.has(e.absolutePath), X = E((V) => y(c, V), [y, c]), ne = C ? void 0 : $n(e), we = jn({ entry: e, isDirectory: C, isExpanded: he, isItemSelected: !!Q, selectionMode: L, onSelectionChange: P, onEntryClick: x, toggleDirectory: b, onToggleDirectoryRecursive: z }), me = Ce ? q?.hoverClassName !== void 0 ? q.hoverClassName : T.entryHover : "", Pe = (() => {
|
|
829
|
+
if (C) {
|
|
830
|
+
if (K)
|
|
831
|
+
return q?.directorySelectedClassName !== void 0 ? q.directorySelectedClassName : T.entrySelected;
|
|
832
|
+
} else if (K || Q)
|
|
833
|
+
return q?.itemSelectedClassName !== void 0 ? q.itemSelectedClassName : j(K && T.entrySelected, Q && T.entryItemSelected);
|
|
1092
834
|
return "";
|
|
1093
|
-
})(),
|
|
1094
|
-
...
|
|
1095
|
-
...
|
|
1096
|
-
...!
|
|
1097
|
-
},
|
|
1098
|
-
return /* @__PURE__ */
|
|
835
|
+
})(), pe = j(T.entry, me, Pe, _e, e.className), Xe = j(T.expandIcon, ze, (K || Q) && T.expandIconSelected), F = j(T.typeIcon, (K || Q) && T.typeIconSelected), et = j(T.name, ke, C && T.nameDirectory, C && te, !C && Ye, (K || Q) && T.nameSelected), ft = Mn({ isDirectory: C, isExpanded: he, showExpandIcons: J && t >= 0, useCanvasExpandIcons: be, expandIconSize: B }), Ve = (C ? $ : Y) ? Hn({ entry: e, isDirectory: C, isExpanded: he, isSelected: K, isItemSelected: !!Q, extension: ne, mimeType: e.mimeType }, le, ue) : null, Ue = {
|
|
836
|
+
...Ce ? q?.hoverStyle : {},
|
|
837
|
+
...C && K ? q?.directorySelectedStyle : {},
|
|
838
|
+
...!C && (K || Q) ? q?.itemSelectedStyle : {}
|
|
839
|
+
}, tt = Bn(e.data), mt = { width: ue, height: ue }, Te = Fn(Se), Ie = n + t * Z;
|
|
840
|
+
return /* @__PURE__ */ Ne(
|
|
1099
841
|
"div",
|
|
1100
842
|
{
|
|
1101
|
-
className:
|
|
843
|
+
className: pe,
|
|
1102
844
|
style: {
|
|
1103
|
-
...
|
|
1104
|
-
...
|
|
1105
|
-
...
|
|
845
|
+
...Te,
|
|
846
|
+
...Ue,
|
|
847
|
+
...Re,
|
|
1106
848
|
...e.style,
|
|
1107
849
|
// 箱の性質はホストのスタイルの後に書く。スプレッドは値が undefined のキーも写し、React はそれを空にするため、
|
|
1108
850
|
// 前に書くと検査が通す { height: undefined } が行の高さを消す
|
|
1109
|
-
paddingLeft: `${Math.max(0,
|
|
1110
|
-
transform:
|
|
1111
|
-
width:
|
|
1112
|
-
height: `${
|
|
851
|
+
paddingLeft: `${Math.max(0, Ie)}px`,
|
|
852
|
+
transform: Ie < 0 ? `translateX(${Ie}px)` : void 0,
|
|
853
|
+
width: Ie < 0 ? `calc(100% + ${-Ie}px)` : void 0,
|
|
854
|
+
height: `${f}px`
|
|
1113
855
|
},
|
|
1114
|
-
...
|
|
1115
|
-
"data-entry-type":
|
|
1116
|
-
"data-entry-expanded":
|
|
1117
|
-
"data-entry-selected":
|
|
1118
|
-
"data-entry-item-selected":
|
|
1119
|
-
onClick:
|
|
1120
|
-
onMouseEnter: () =>
|
|
1121
|
-
onMouseLeave: () =>
|
|
1122
|
-
onFocus: (
|
|
1123
|
-
onBlur: (
|
|
1124
|
-
ref:
|
|
1125
|
-
onKeyDown: (
|
|
1126
|
-
if (
|
|
1127
|
-
|
|
856
|
+
...tt,
|
|
857
|
+
"data-entry-type": C ? "directory" : "file",
|
|
858
|
+
"data-entry-expanded": C ? String(he) : void 0,
|
|
859
|
+
"data-entry-selected": K ? "true" : void 0,
|
|
860
|
+
"data-entry-item-selected": Q ? "true" : void 0,
|
|
861
|
+
onClick: we,
|
|
862
|
+
onMouseEnter: () => Fe(!0),
|
|
863
|
+
onMouseLeave: () => Fe(!1),
|
|
864
|
+
onFocus: (V) => w(c, e.absolutePath, V.currentTarget),
|
|
865
|
+
onBlur: (V) => R(e.absolutePath, V.currentTarget),
|
|
866
|
+
ref: X,
|
|
867
|
+
onKeyDown: (V) => {
|
|
868
|
+
if (V.key === "Enter" || V.key === " ") {
|
|
869
|
+
V.preventDefault(), V.repeat || we(V);
|
|
1128
870
|
return;
|
|
1129
871
|
}
|
|
1130
|
-
N(
|
|
872
|
+
N(V, c);
|
|
1131
873
|
},
|
|
1132
|
-
tabIndex:
|
|
874
|
+
tabIndex: d ? 0 : -1,
|
|
1133
875
|
role: "treeitem",
|
|
1134
|
-
"aria-expanded":
|
|
876
|
+
"aria-expanded": C ? he : void 0,
|
|
1135
877
|
"aria-level": r + 1,
|
|
1136
|
-
"aria-posinset":
|
|
1137
|
-
"aria-setsize":
|
|
1138
|
-
"aria-selected":
|
|
878
|
+
"aria-posinset": s,
|
|
879
|
+
"aria-setsize": a,
|
|
880
|
+
"aria-selected": L === "none" ? void 0 : i,
|
|
1139
881
|
"aria-current": $e ? "page" : void 0,
|
|
1140
|
-
"aria-label": `${e.name} (${
|
|
882
|
+
"aria-label": `${e.name} (${C ? m : h})`,
|
|
1141
883
|
children: [
|
|
1142
|
-
(J ||
|
|
1143
|
-
(
|
|
1144
|
-
/* @__PURE__ */
|
|
884
|
+
(J || be) && /* @__PURE__ */ u("span", { className: Xe, style: { ...ve, width: se, height: se }, children: ft }),
|
|
885
|
+
(C ? $ : Y) && /* @__PURE__ */ u("span", { className: F, style: mt, children: Ve }),
|
|
886
|
+
/* @__PURE__ */ u(
|
|
1145
887
|
"span",
|
|
1146
888
|
{
|
|
1147
|
-
className:
|
|
889
|
+
className: et,
|
|
1148
890
|
style: {
|
|
1149
|
-
...
|
|
1150
|
-
...
|
|
1151
|
-
...
|
|
891
|
+
...Te,
|
|
892
|
+
...A,
|
|
893
|
+
...C ? M : I
|
|
1152
894
|
},
|
|
1153
|
-
"data-entry-type":
|
|
895
|
+
"data-entry-type": C ? "directory" : "file",
|
|
1154
896
|
"data-entry-role": "name",
|
|
1155
897
|
children: e.label ?? e.name
|
|
1156
898
|
}
|
|
@@ -1161,644 +903,644 @@ const Do = (e) => {
|
|
|
1161
903
|
},
|
|
1162
904
|
(e, t) => {
|
|
1163
905
|
if (e.entry !== t.entry) return !1;
|
|
1164
|
-
const n = e.entry.children !== void 0, r = t.entry.children !== void 0,
|
|
906
|
+
const n = e.entry.children !== void 0, r = t.entry.children !== void 0, s = n && e.isDirOpen(e.entry.absolutePath), a = r && t.isDirOpen(t.entry.absolutePath);
|
|
1165
907
|
return e.indentLevel === t.indentLevel && e.originX === t.originX && // 位置情報は aria として描画されるため、変化したら再描画が必要
|
|
1166
908
|
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 && // 種別語はアクセシブルネームとして描画されるため、ロケール / 上書きの変更で再描画が必要
|
|
1167
|
-
e.entryKindDirectory === t.entryKindDirectory && e.entryKindFile === t.entryKindFile &&
|
|
909
|
+
e.entryKindDirectory === t.entryKindDirectory && e.entryKindFile === t.entryKindFile && s === a && e.selection.selectedPath === t.selection.selectedPath && e.selection.currentPath === t.selection.currentPath && 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.typeIconSize === t.visual.typeIconSize && e.visual.fontSize === t.visual.fontSize && e.visual.indentSize === t.visual.indentSize && 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.visual.expandIconClassName === t.visual.expandIconClassName && e.visual.expandIconStyle === t.visual.expandIconStyle;
|
|
1168
910
|
}
|
|
1169
911
|
);
|
|
1170
|
-
|
|
1171
|
-
const
|
|
912
|
+
qn.displayName = "DirectoryEntryItem";
|
|
913
|
+
const Qn = (e) => {
|
|
1172
914
|
const t = [];
|
|
1173
915
|
if (e.children)
|
|
1174
916
|
for (const n of e.children)
|
|
1175
|
-
n.type === "directory" && (t.push(n.absolutePath), t.push(...
|
|
917
|
+
n.type === "directory" && (t.push(n.absolutePath), t.push(...Qn(n)));
|
|
1176
918
|
return t;
|
|
1177
|
-
},
|
|
919
|
+
}, Xo = ({
|
|
1178
920
|
entries: e,
|
|
1179
|
-
expansion: { toggle: t, isExpanded: n, expandMultiple: r, collapseMultiple:
|
|
1180
|
-
selection: { onEntryClick:
|
|
921
|
+
expansion: { toggle: t, isExpanded: n, expandMultiple: r, collapseMultiple: s, isPending: a, alwaysExpanded: i = !1, doubleClickAction: c = "recursive" },
|
|
922
|
+
selection: { onEntryClick: d, selectedPath: y, currentPath: N, mode: w = "none", selectedItems: R, onSelectionChange: f },
|
|
1181
923
|
visual: {
|
|
1182
|
-
className:
|
|
1183
|
-
style:
|
|
1184
|
-
ariaLabel:
|
|
1185
|
-
ariaLabelledBy:
|
|
1186
|
-
lineColor:
|
|
1187
|
-
showTreeLines:
|
|
1188
|
-
showExpandIcons:
|
|
1189
|
-
showDirectoryIcons:
|
|
1190
|
-
showFileIcons:
|
|
1191
|
-
iconOverrides:
|
|
1192
|
-
expandIconSize:
|
|
1193
|
-
typeIconSize:
|
|
924
|
+
className: m,
|
|
925
|
+
style: h,
|
|
926
|
+
ariaLabel: S,
|
|
927
|
+
ariaLabelledBy: b,
|
|
928
|
+
lineColor: z = _n,
|
|
929
|
+
showTreeLines: x = !0,
|
|
930
|
+
showExpandIcons: k = !0,
|
|
931
|
+
showDirectoryIcons: p = !0,
|
|
932
|
+
showFileIcons: L = !0,
|
|
933
|
+
iconOverrides: D,
|
|
934
|
+
expandIconSize: P,
|
|
935
|
+
typeIconSize: le,
|
|
1194
936
|
fontSize: J,
|
|
1195
|
-
indentSize:
|
|
1196
|
-
itemHeight:
|
|
1197
|
-
removeRootIndent:
|
|
1198
|
-
highlightStyles:
|
|
1199
|
-
entryClassName:
|
|
1200
|
-
entryStyle:
|
|
1201
|
-
nameClassName:
|
|
1202
|
-
nameStyle:
|
|
1203
|
-
directoryNameClassName:
|
|
1204
|
-
directoryNameStyle:
|
|
1205
|
-
fileNameClassName:
|
|
1206
|
-
fileNameStyle:
|
|
1207
|
-
expandIconClassName:
|
|
1208
|
-
expandIconStyle:
|
|
937
|
+
indentSize: $,
|
|
938
|
+
itemHeight: Y = Tt,
|
|
939
|
+
removeRootIndent: be = !1,
|
|
940
|
+
highlightStyles: B,
|
|
941
|
+
entryClassName: ue,
|
|
942
|
+
entryStyle: Se,
|
|
943
|
+
nameClassName: Z,
|
|
944
|
+
nameStyle: q,
|
|
945
|
+
directoryNameClassName: _e,
|
|
946
|
+
directoryNameStyle: Re,
|
|
947
|
+
fileNameClassName: ke,
|
|
948
|
+
fileNameStyle: A,
|
|
949
|
+
expandIconClassName: te,
|
|
950
|
+
expandIconStyle: M
|
|
1209
951
|
} = {},
|
|
1210
|
-
virtualScroll:
|
|
1211
|
-
grid:
|
|
1212
|
-
sort:
|
|
1213
|
-
locale:
|
|
1214
|
-
labels:
|
|
1215
|
-
ref:
|
|
952
|
+
virtualScroll: Ye,
|
|
953
|
+
grid: I,
|
|
954
|
+
sort: ze,
|
|
955
|
+
locale: ve,
|
|
956
|
+
labels: Ce,
|
|
957
|
+
ref: Fe
|
|
1216
958
|
}) => {
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1219
|
-
Ge(
|
|
1220
|
-
}, [
|
|
1221
|
-
const
|
|
1222
|
-
overscanCount:
|
|
1223
|
-
className:
|
|
1224
|
-
background:
|
|
1225
|
-
onScroll:
|
|
1226
|
-
onRangeChange:
|
|
1227
|
-
onScrollAdjust:
|
|
1228
|
-
liveRegion:
|
|
1229
|
-
initialScrollIndex:
|
|
959
|
+
const C = An(ve), he = O(() => uo(ve, Ce), [ve, Ce]), K = zo(ho(he)), { entryKindDirectory: $e, entryKindFile: Q } = he, X = O(() => po({ indentSize: $, typeIconSize: le, fontSize: J }), [$, le, J]);
|
|
960
|
+
O(() => {
|
|
961
|
+
Ge(Se, { option: "visual.entryStyle" }), Ge(B?.hoverStyle, { option: "visual.highlightStyles.hoverStyle" }), Ge(B?.directorySelectedStyle, { option: "visual.highlightStyles.directorySelectedStyle" }), Ge(B?.itemSelectedStyle, { option: "visual.highlightStyles.itemSelectedStyle" }), eo(M, { option: "visual.expandIconStyle" });
|
|
962
|
+
}, [Se, B, M]);
|
|
963
|
+
const ne = I !== void 0, we = fr(Do, Ao, _o), me = H(null), Pe = H(null), pe = H(null), [Xe, F] = de(0), [et, ft] = de(0), [Ve, Ue] = de(0), [tt, mt] = de(null), {
|
|
964
|
+
overscanCount: Te = 15,
|
|
965
|
+
className: Ie,
|
|
966
|
+
background: V,
|
|
967
|
+
onScroll: $t,
|
|
968
|
+
onRangeChange: Mt,
|
|
969
|
+
onScrollAdjust: Ht,
|
|
970
|
+
liveRegion: Bt,
|
|
971
|
+
initialScrollIndex: Wt,
|
|
1230
972
|
initialScrollOffset: Me,
|
|
1231
|
-
initialScrollAnchor:
|
|
1232
|
-
callbackThrottleMs:
|
|
1233
|
-
contentInsets:
|
|
1234
|
-
onItemFocus:
|
|
1235
|
-
viewportHeightOverride:
|
|
1236
|
-
scrollBarOptions:
|
|
1237
|
-
behaviorOptions:
|
|
1238
|
-
preserveScrollAnchor:
|
|
1239
|
-
getItemKey:
|
|
973
|
+
initialScrollAnchor: jt,
|
|
974
|
+
callbackThrottleMs: Kt = 5,
|
|
975
|
+
contentInsets: Gt,
|
|
976
|
+
onItemFocus: Yt,
|
|
977
|
+
viewportHeightOverride: re,
|
|
978
|
+
scrollBarOptions: pt,
|
|
979
|
+
behaviorOptions: Xt,
|
|
980
|
+
preserveScrollAnchor: Vt = !1,
|
|
981
|
+
getItemKey: er,
|
|
1240
982
|
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
1241
|
-
testId:
|
|
1242
|
-
contentProps:
|
|
1243
|
-
} =
|
|
1244
|
-
() =>
|
|
1245
|
-
...
|
|
983
|
+
testId: Ut,
|
|
984
|
+
contentProps: yt
|
|
985
|
+
} = Ye ?? {}, Jt = O(
|
|
986
|
+
() => ne ? { ...yt, role: "rowgroup" } : {
|
|
987
|
+
...yt,
|
|
1246
988
|
role: "tree",
|
|
1247
|
-
"aria-label":
|
|
1248
|
-
"aria-labelledby":
|
|
1249
|
-
"aria-multiselectable":
|
|
1250
|
-
"aria-busy":
|
|
989
|
+
"aria-label": b ? void 0 : S,
|
|
990
|
+
"aria-labelledby": b,
|
|
991
|
+
"aria-multiselectable": w === "multiple" ? !0 : void 0,
|
|
992
|
+
"aria-busy": a ? !0 : void 0
|
|
1251
993
|
},
|
|
1252
|
-
[
|
|
1253
|
-
),
|
|
1254
|
-
(
|
|
1255
|
-
|
|
994
|
+
[ne, yt, S, b, w, a]
|
|
995
|
+
), Zt = O(() => ({ ...Xt, enableKeyboardNavigation: !1 }), [Xt]), [nt, qt] = de(typeof Me == "number" ? Me : 0), gt = H(typeof Me == "number" ? Me : 0), Qt = E(
|
|
996
|
+
(o, l) => {
|
|
997
|
+
gt.current = o, qt(o), $t?.(o, l);
|
|
1256
998
|
},
|
|
1257
|
-
[
|
|
1258
|
-
),
|
|
1259
|
-
(
|
|
1260
|
-
const { renderingStartIndex:
|
|
1261
|
-
|
|
999
|
+
[$t]
|
|
1000
|
+
), en = E(
|
|
1001
|
+
(o) => {
|
|
1002
|
+
const { renderingStartIndex: l, renderingEndIndex: g } = o;
|
|
1003
|
+
mt((v) => v && v.renderStart === l && v.renderEnd === g ? v : { renderStart: l, renderEnd: g }), Mt?.(o);
|
|
1262
1004
|
},
|
|
1263
|
-
[
|
|
1005
|
+
[Mt]
|
|
1264
1006
|
);
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
}, []),
|
|
1268
|
-
const
|
|
1269
|
-
if (
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1007
|
+
Ae(() => {
|
|
1008
|
+
Lo();
|
|
1009
|
+
}, []), Ae(() => {
|
|
1010
|
+
const o = me.current, l = ne ? Pe.current : o, g = () => {
|
|
1011
|
+
if (o) {
|
|
1012
|
+
const _ = o.clientWidth;
|
|
1013
|
+
ft((G) => Math.abs(G - _) > 1 ? _ : G);
|
|
1272
1014
|
}
|
|
1273
|
-
if (typeof
|
|
1274
|
-
|
|
1275
|
-
else if (
|
|
1276
|
-
const
|
|
1277
|
-
|
|
1015
|
+
if (typeof re == "number")
|
|
1016
|
+
F((_) => Math.abs(_ - re) > 1 ? re : _);
|
|
1017
|
+
else if (l) {
|
|
1018
|
+
const _ = l.clientHeight;
|
|
1019
|
+
F((G) => Math.abs(G - _) > 1 ? _ : G);
|
|
1278
1020
|
}
|
|
1279
1021
|
};
|
|
1280
|
-
if (!(
|
|
1281
|
-
|
|
1282
|
-
const
|
|
1283
|
-
return
|
|
1284
|
-
}, [
|
|
1285
|
-
const
|
|
1022
|
+
if (!(o || l)) return F(0);
|
|
1023
|
+
g();
|
|
1024
|
+
const v = new ResizeObserver(g);
|
|
1025
|
+
return o && v.observe(o), l && l !== o && v.observe(l), () => v.disconnect();
|
|
1026
|
+
}, [re, ne]);
|
|
1027
|
+
const He = typeof re == "number" ? re : Xe, fe = E((o) => i || (we ? n(o) : !1), [we, n, i]), tn = j(T.container, a && T.containerPending, m), nn = O(
|
|
1286
1028
|
() => ({
|
|
1287
|
-
...
|
|
1288
|
-
...
|
|
1289
|
-
...typeof
|
|
1029
|
+
...Oo,
|
|
1030
|
+
...h ?? {},
|
|
1031
|
+
...typeof re == "number" ? { height: re, minHeight: re } : {}
|
|
1290
1032
|
}),
|
|
1291
|
-
[
|
|
1292
|
-
),
|
|
1293
|
-
(
|
|
1294
|
-
const
|
|
1295
|
-
if (
|
|
1296
|
-
if (
|
|
1297
|
-
if (
|
|
1298
|
-
console.warn(`[DirectoryTree] Unknown double click action: ${
|
|
1033
|
+
[h, re]
|
|
1034
|
+
), bt = E(
|
|
1035
|
+
(o, l) => {
|
|
1036
|
+
const g = [o.absolutePath, ...Qn(o)], v = l || c;
|
|
1037
|
+
if (g.every((ge) => fe(ge))) return s(g);
|
|
1038
|
+
if (g.every((ge) => !fe(ge)) || v === "recursive") return r(g);
|
|
1039
|
+
if (v === "toggle") return s(g);
|
|
1040
|
+
console.warn(`[DirectoryTree] Unknown double click action: ${v}. No action taken.`);
|
|
1299
1041
|
},
|
|
1300
|
-
[
|
|
1301
|
-
),
|
|
1302
|
-
const
|
|
1303
|
-
|
|
1304
|
-
for (let
|
|
1305
|
-
|
|
1306
|
-
return
|
|
1307
|
-
}, [
|
|
1308
|
-
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
const
|
|
1312
|
-
|
|
1313
|
-
const
|
|
1314
|
-
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1317
|
-
const Nt =
|
|
1042
|
+
[fe, r, s, c]
|
|
1043
|
+
), St = ne ? !1 : be, { flatItems: Oe, lineItems: vt, maxIndent: rn } = O(() => $o(e, fe, x, St, ze), [e, fe, x, St, ze]), rt = yo({ indentSize: X.indentSize, removeRootIndent: St, hasExpandBox: k || x }), ce = O(() => x ? bo(X, P, rt) : null, [x, X, P, rt]), W = O(() => Oe.map((o, l) => ({ ...o, rowHeight: go(Y, o.entry, l) })), [Oe, Y]), Ee = O(() => W.map((o) => o.rowHeight), [W]), Le = O(() => {
|
|
1044
|
+
const o = new Array(Ee.length + 1);
|
|
1045
|
+
o[0] = 0;
|
|
1046
|
+
for (let l = 0; l < Ee.length; l++)
|
|
1047
|
+
o[l + 1] = o[l] + Ee[l];
|
|
1048
|
+
return o;
|
|
1049
|
+
}, [Ee]), on = E((o) => W[o]?.rowHeight ?? Tt, [W]), tr = E((o) => W[o]?.entry.absolutePath ?? o, [W]), sn = er ?? tr, Be = y ?? null, wt = N ?? null, [an, Je] = de(() => ({ selectedPath: Be, selectionGeneration: 0, anchor: null })), It = Tn(an, Be);
|
|
1050
|
+
It !== an && Je((o) => Tn(o, Be));
|
|
1051
|
+
const ot = O(() => Co(Oe), [Oe]), We = O(() => To(ot, It), [ot, It]), Ze = H(/* @__PURE__ */ new Map()), st = H(null), [it] = de(fo), qe = H(null), [nr, ln] = de(!0), Et = H(Oe);
|
|
1052
|
+
Et.current = Oe;
|
|
1053
|
+
const cn = H(fe);
|
|
1054
|
+
cn.current = fe;
|
|
1055
|
+
const xt = H(t);
|
|
1056
|
+
xt.current = t;
|
|
1057
|
+
const dn = H(ot);
|
|
1058
|
+
dn.current = ot;
|
|
1059
|
+
const Nt = H(We);
|
|
1318
1060
|
Nt.current = We;
|
|
1319
|
-
const
|
|
1320
|
-
|
|
1321
|
-
const
|
|
1322
|
-
const
|
|
1323
|
-
return !
|
|
1324
|
-
}, []),
|
|
1325
|
-
(
|
|
1326
|
-
const
|
|
1327
|
-
if (
|
|
1328
|
-
|
|
1061
|
+
const un = H(Yt);
|
|
1062
|
+
un.current = Yt;
|
|
1063
|
+
const De = E((o) => {
|
|
1064
|
+
const l = pe.current;
|
|
1065
|
+
return !l || l.getViewportSize() <= 0 ? !1 : (l.scrollToIndex(o, { align: "nearest" }), !0);
|
|
1066
|
+
}, []), ye = E(
|
|
1067
|
+
(o) => {
|
|
1068
|
+
const l = Ze.current.get(o);
|
|
1069
|
+
if (l === void 0) {
|
|
1070
|
+
qe.current = o, De(o) || (qe.current = null);
|
|
1329
1071
|
return;
|
|
1330
1072
|
}
|
|
1331
|
-
|
|
1073
|
+
qe.current = null, De(o), l.focus({ preventScroll: !0 });
|
|
1332
1074
|
},
|
|
1333
|
-
[
|
|
1334
|
-
),
|
|
1335
|
-
if (
|
|
1336
|
-
|
|
1075
|
+
[De]
|
|
1076
|
+
), hn = E((o, l) => {
|
|
1077
|
+
if (l)
|
|
1078
|
+
Ze.current.set(o, l), qe.current === o ? (qe.current = null, l.focus({ preventScroll: !0 })) : l.contains(l.ownerDocument.activeElement) && Je((g) => g.anchor === null ? g : { ...g, anchor: { ...g.anchor, focused: !0 } });
|
|
1337
1079
|
else {
|
|
1338
|
-
const
|
|
1339
|
-
|
|
1080
|
+
const g = Ze.current.get(o);
|
|
1081
|
+
Ze.current.delete(o), g?.contains(g.ownerDocument.activeElement) && Je((v) => v.anchor === null ? v : { ...v, anchor: { ...v.anchor, focused: !1 } });
|
|
1340
1082
|
}
|
|
1341
|
-
|
|
1083
|
+
o === Nt.current && ln(l !== null);
|
|
1342
1084
|
}, []);
|
|
1343
|
-
|
|
1344
|
-
|
|
1085
|
+
En(() => {
|
|
1086
|
+
ln(Ze.current.has(We));
|
|
1345
1087
|
}, [We]);
|
|
1346
|
-
const
|
|
1347
|
-
(
|
|
1348
|
-
const
|
|
1349
|
-
|
|
1088
|
+
const Rt = E(
|
|
1089
|
+
(o, l, g) => {
|
|
1090
|
+
const v = st.current === g;
|
|
1091
|
+
st.current = null, v || (Je((_) => Po(_, l)), it.landedOn(g) || De(o)), un.current?.(o);
|
|
1350
1092
|
},
|
|
1351
|
-
[
|
|
1352
|
-
),
|
|
1353
|
-
const { ownerDocument:
|
|
1354
|
-
if (!
|
|
1355
|
-
|
|
1093
|
+
[De, it]
|
|
1094
|
+
), at = E((o) => it.mark(o.nativeEvent), [it]), kt = E((o, l) => {
|
|
1095
|
+
const { ownerDocument: g } = l;
|
|
1096
|
+
if (!g.hasFocus() && l.contains(g.activeElement)) {
|
|
1097
|
+
st.current = l;
|
|
1356
1098
|
return;
|
|
1357
1099
|
}
|
|
1358
|
-
|
|
1359
|
-
}, []),
|
|
1360
|
-
(
|
|
1361
|
-
const
|
|
1362
|
-
if (!Number.isInteger(
|
|
1363
|
-
throw new RangeError(`[directory-tree] scrollToIndex: ${String(
|
|
1364
|
-
if (
|
|
1365
|
-
|
|
1100
|
+
st.current = null, Je((v) => v.anchor !== null && v.anchor.path === o ? { ...v, anchor: { ...v.anchor, focused: !1 } } : v);
|
|
1101
|
+
}, []), rr = E(() => ye(Nt.current), [ye]), Ct = E(
|
|
1102
|
+
(o, l) => {
|
|
1103
|
+
const g = Ln(l), v = Et.current.length;
|
|
1104
|
+
if (!Number.isInteger(o) || o < 0 || o >= v)
|
|
1105
|
+
throw new RangeError(`[directory-tree] scrollToIndex: ${String(o)} is not a row index (${v === 0 ? "the tree has no rows" : `expected an integer in 0..${String(v - 1)}`}).`);
|
|
1106
|
+
if (g === "nearest") {
|
|
1107
|
+
De(o);
|
|
1366
1108
|
return;
|
|
1367
1109
|
}
|
|
1368
|
-
|
|
1110
|
+
pe.current?.scrollToIndex(o, { align: g });
|
|
1369
1111
|
},
|
|
1370
|
-
[
|
|
1112
|
+
[De]
|
|
1371
1113
|
);
|
|
1372
|
-
|
|
1373
|
-
|
|
1114
|
+
mr(
|
|
1115
|
+
Fe,
|
|
1374
1116
|
() => ({
|
|
1375
|
-
scrollToIndex:
|
|
1376
|
-
scrollToPath: (
|
|
1377
|
-
|
|
1378
|
-
const
|
|
1379
|
-
return
|
|
1117
|
+
scrollToIndex: Ct,
|
|
1118
|
+
scrollToPath: (o, l) => {
|
|
1119
|
+
Ln(l);
|
|
1120
|
+
const g = dn.current.get(o);
|
|
1121
|
+
return g === void 0 ? !1 : (Ct(g, l), !0);
|
|
1380
1122
|
},
|
|
1381
|
-
getScrollAnchor: () =>
|
|
1123
|
+
getScrollAnchor: () => pe.current?.getScrollAnchor() ?? null
|
|
1382
1124
|
}),
|
|
1383
|
-
[
|
|
1125
|
+
[Ct]
|
|
1384
1126
|
);
|
|
1385
|
-
const
|
|
1386
|
-
(
|
|
1387
|
-
if (
|
|
1127
|
+
const fn = E(
|
|
1128
|
+
(o, l) => {
|
|
1129
|
+
if (o.altKey || o.ctrlKey || o.metaKey)
|
|
1388
1130
|
return;
|
|
1389
|
-
const
|
|
1390
|
-
if (
|
|
1391
|
-
const
|
|
1392
|
-
switch (
|
|
1131
|
+
const g = Et.current, v = g.length - 1;
|
|
1132
|
+
if (v < 0) return;
|
|
1133
|
+
const _ = g[l], G = _?.entry.children !== void 0, ge = G && cn.current(_.entry.absolutePath);
|
|
1134
|
+
switch (o.key) {
|
|
1393
1135
|
case "ArrowDown":
|
|
1394
|
-
|
|
1136
|
+
o.preventDefault(), ye(Math.min(l + 1, v));
|
|
1395
1137
|
break;
|
|
1396
1138
|
case "ArrowUp":
|
|
1397
|
-
|
|
1139
|
+
o.preventDefault(), ye(Math.max(l - 1, 0));
|
|
1398
1140
|
break;
|
|
1399
1141
|
case "Home":
|
|
1400
|
-
|
|
1142
|
+
o.preventDefault(), ye(0);
|
|
1401
1143
|
break;
|
|
1402
1144
|
case "End":
|
|
1403
|
-
|
|
1145
|
+
o.preventDefault(), ye(v);
|
|
1404
1146
|
break;
|
|
1405
1147
|
case "ArrowRight":
|
|
1406
|
-
|
|
1148
|
+
o.preventDefault(), G && !ge ? xt.current(_.entry.absolutePath) : G && l < v && g[l + 1].depth > _.depth && ye(l + 1);
|
|
1407
1149
|
break;
|
|
1408
1150
|
case "ArrowLeft": {
|
|
1409
|
-
if (
|
|
1410
|
-
|
|
1151
|
+
if (o.preventDefault(), G && ge) {
|
|
1152
|
+
xt.current(_.entry.absolutePath);
|
|
1411
1153
|
break;
|
|
1412
1154
|
}
|
|
1413
|
-
const
|
|
1414
|
-
for (let
|
|
1415
|
-
if (
|
|
1416
|
-
|
|
1155
|
+
const lr = _?.depth ?? 0;
|
|
1156
|
+
for (let ut = l - 1; ut >= 0; ut--)
|
|
1157
|
+
if (g[ut].depth < lr) {
|
|
1158
|
+
ye(ut);
|
|
1417
1159
|
break;
|
|
1418
1160
|
}
|
|
1419
1161
|
break;
|
|
1420
1162
|
}
|
|
1421
1163
|
}
|
|
1422
1164
|
},
|
|
1423
|
-
[
|
|
1424
|
-
),
|
|
1425
|
-
() =>
|
|
1426
|
-
[
|
|
1427
|
-
),
|
|
1428
|
-
|
|
1165
|
+
[ye]
|
|
1166
|
+
), lt = O(() => ce === null || vt.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : Ho(vt, Ee, Le, ce), [vt, Ee, Le, ce]), ct = O(() => ce === null || e.length === 0 ? 0 : ce.originX + rn * ce.indentSize + se + ce.typeIconSize, [e.length, rn, ce]), { renderStart: mn, renderEnd: pn, lookaheadEnd: yn } = O(
|
|
1167
|
+
() => Mo(W.length, He, Te, tt, nt, Le),
|
|
1168
|
+
[W.length, He, Te, tt, nt, Le]
|
|
1169
|
+
), Pt = O(() => ce === null || ct <= 0 || He <= 0 || lt.segmentsByItem.length === 0 ? null : /* @__PURE__ */ u("div", { className: "pointer-events-none absolute inset-0 z-1", "aria-hidden": "true", children: /* @__PURE__ */ u("div", { className: "absolute top-0 left-0", style: { width: ct, height: He }, children: /* @__PURE__ */ u(
|
|
1170
|
+
Zn,
|
|
1429
1171
|
{
|
|
1430
|
-
segmentsByItem:
|
|
1431
|
-
glyphsByItem:
|
|
1432
|
-
itemHeight:
|
|
1433
|
-
width:
|
|
1434
|
-
viewportHeight:
|
|
1435
|
-
scrollPosition:
|
|
1436
|
-
color:
|
|
1437
|
-
expandGlyphColor:
|
|
1438
|
-
expandGlyphSize:
|
|
1439
|
-
renderStartIndex:
|
|
1440
|
-
renderEndIndex:
|
|
1441
|
-
lookaheadEndIndex:
|
|
1172
|
+
segmentsByItem: lt.segmentsByItem,
|
|
1173
|
+
glyphsByItem: lt.glyphsByItem,
|
|
1174
|
+
itemHeight: Ee[0] ?? Tt,
|
|
1175
|
+
width: ct,
|
|
1176
|
+
viewportHeight: He,
|
|
1177
|
+
scrollPosition: nt,
|
|
1178
|
+
color: z,
|
|
1179
|
+
expandGlyphColor: z,
|
|
1180
|
+
expandGlyphSize: ce.glyphSize,
|
|
1181
|
+
renderStartIndex: mn,
|
|
1182
|
+
renderEndIndex: pn,
|
|
1183
|
+
lookaheadEndIndex: yn
|
|
1442
1184
|
}
|
|
1443
|
-
) }) }), [
|
|
1444
|
-
|
|
1445
|
-
const
|
|
1446
|
-
if (
|
|
1185
|
+
) }) }), [ct, He, mn, pn, yn, nt, lt, z, ce, Ee]), gn = E((o) => W[o], [W]), bn = H(null);
|
|
1186
|
+
En(() => {
|
|
1187
|
+
const o = bn.current;
|
|
1188
|
+
if (bn.current = { items: W, offsets: Le }, !Vt || !o || o.items === W)
|
|
1447
1189
|
return;
|
|
1448
|
-
const
|
|
1449
|
-
if (!
|
|
1190
|
+
const l = pe.current, g = l?.getScrollPosition(), v = typeof g == "number" && g >= 0 ? g : gt.current, _ = wo(o.items, o.offsets, v);
|
|
1191
|
+
if (!_)
|
|
1450
1192
|
return;
|
|
1451
|
-
const
|
|
1452
|
-
if (
|
|
1193
|
+
const G = Io(_, W, Le);
|
|
1194
|
+
if (G === null || Math.abs(G - v) < 1)
|
|
1453
1195
|
return;
|
|
1454
|
-
const
|
|
1455
|
-
|
|
1456
|
-
}, [
|
|
1457
|
-
const
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
}, [
|
|
1461
|
-
const
|
|
1196
|
+
const ge = l ? l.scrollTo(G) : G;
|
|
1197
|
+
gt.current = ge, qt(ge);
|
|
1198
|
+
}, [W, Le, Vt]);
|
|
1199
|
+
const xe = I?.columns, je = I?.scrollBarWidth ?? pt?.width ?? Un, U = O(() => xe ? io({ measuredWidth: et, columns: xe, scrollBarWidth: je }) : null, [xe, et, je]), dt = O(() => xe ? so(xe) : "", [xe]), or = O(() => I?.showFooter && xe ? ao(e) : [], [I?.showFooter, xe, e]), Ke = U?.maxHScroll ?? 0;
|
|
1200
|
+
Ae(() => {
|
|
1201
|
+
Ue((o) => Ot(o, Ke));
|
|
1202
|
+
}, [Ke]);
|
|
1203
|
+
const Sn = E((o) => Ue((l) => Ot(l + o, Ke)), [Ke]), vn = O(
|
|
1462
1204
|
() => ({
|
|
1463
|
-
iconOverrides:
|
|
1464
|
-
showExpandIcons:
|
|
1465
|
-
showDirectoryIcons:
|
|
1466
|
-
showFileIcons:
|
|
1467
|
-
useCanvasExpandIcons:
|
|
1468
|
-
expandIconSize:
|
|
1469
|
-
typeIconSize:
|
|
1470
|
-
fontSize:
|
|
1471
|
-
indentSize:
|
|
1472
|
-
highlightStyles:
|
|
1473
|
-
expandIconClassName:
|
|
1474
|
-
expandIconStyle:
|
|
1205
|
+
iconOverrides: D,
|
|
1206
|
+
showExpandIcons: k,
|
|
1207
|
+
showDirectoryIcons: p,
|
|
1208
|
+
showFileIcons: L,
|
|
1209
|
+
useCanvasExpandIcons: x,
|
|
1210
|
+
expandIconSize: P,
|
|
1211
|
+
typeIconSize: X.typeIconSize,
|
|
1212
|
+
fontSize: X.fontSize,
|
|
1213
|
+
indentSize: X.indentSize,
|
|
1214
|
+
highlightStyles: B,
|
|
1215
|
+
expandIconClassName: te,
|
|
1216
|
+
expandIconStyle: M
|
|
1475
1217
|
}),
|
|
1476
|
-
[
|
|
1477
|
-
),
|
|
1478
|
-
() => /* @__PURE__ */
|
|
1479
|
-
|
|
1218
|
+
[D, k, p, L, x, P, X, B, te, M]
|
|
1219
|
+
), wn = O(
|
|
1220
|
+
() => /* @__PURE__ */ u(
|
|
1221
|
+
ur,
|
|
1480
1222
|
{
|
|
1481
|
-
ref:
|
|
1482
|
-
itemCount:
|
|
1483
|
-
getItem:
|
|
1484
|
-
getItemHeight:
|
|
1485
|
-
getItemKey:
|
|
1486
|
-
testId:
|
|
1487
|
-
contentProps:
|
|
1488
|
-
locale:
|
|
1489
|
-
labels:
|
|
1490
|
-
viewportSize: typeof
|
|
1491
|
-
overscanCount:
|
|
1492
|
-
onScroll:
|
|
1493
|
-
onRangeChange:
|
|
1494
|
-
onScrollAdjust:
|
|
1495
|
-
liveRegion:
|
|
1496
|
-
className:
|
|
1497
|
-
onWheelHorizontal:
|
|
1498
|
-
background: /* @__PURE__ */
|
|
1499
|
-
|
|
1223
|
+
ref: pe,
|
|
1224
|
+
itemCount: W.length,
|
|
1225
|
+
getItem: gn,
|
|
1226
|
+
getItemHeight: on,
|
|
1227
|
+
getItemKey: sn,
|
|
1228
|
+
testId: Ut,
|
|
1229
|
+
contentProps: Jt,
|
|
1230
|
+
locale: C,
|
|
1231
|
+
labels: K,
|
|
1232
|
+
viewportSize: typeof re == "number" ? re : void 0,
|
|
1233
|
+
overscanCount: Te,
|
|
1234
|
+
onScroll: Qt,
|
|
1235
|
+
onRangeChange: en,
|
|
1236
|
+
onScrollAdjust: Ht,
|
|
1237
|
+
liveRegion: Bt,
|
|
1238
|
+
className: Ie,
|
|
1239
|
+
onWheelHorizontal: ne ? Sn : void 0,
|
|
1240
|
+
background: /* @__PURE__ */ Ne(cr, { children: [
|
|
1241
|
+
ne && U ? (
|
|
1500
1242
|
// Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
|
|
1501
|
-
/* @__PURE__ */
|
|
1502
|
-
) :
|
|
1503
|
-
|
|
1243
|
+
/* @__PURE__ */ u("div", { className: "pointer-events-none absolute top-0 left-0 z-1 h-full overflow-hidden", style: { width: U.nameWidth }, "aria-hidden": "true", children: Pt })
|
|
1244
|
+
) : Pt,
|
|
1245
|
+
V
|
|
1504
1246
|
] }),
|
|
1505
|
-
initialScrollIndex:
|
|
1247
|
+
initialScrollIndex: Wt,
|
|
1506
1248
|
initialScrollOffset: Me,
|
|
1507
|
-
initialScrollAnchor:
|
|
1508
|
-
callbackThrottleMs:
|
|
1509
|
-
contentInsets:
|
|
1510
|
-
scrollBarOptions:
|
|
1511
|
-
behaviorOptions:
|
|
1512
|
-
children: (
|
|
1513
|
-
|
|
1249
|
+
initialScrollAnchor: jt,
|
|
1250
|
+
callbackThrottleMs: Kt,
|
|
1251
|
+
contentInsets: Gt,
|
|
1252
|
+
scrollBarOptions: pt,
|
|
1253
|
+
behaviorOptions: Zt,
|
|
1254
|
+
children: (o, l) => o ? ne && I && U ? /* @__PURE__ */ u(
|
|
1255
|
+
Yn,
|
|
1514
1256
|
{
|
|
1515
|
-
entry:
|
|
1516
|
-
indentLevel:
|
|
1517
|
-
positionInSet:
|
|
1518
|
-
setSize:
|
|
1519
|
-
rowIndex:
|
|
1520
|
-
flatIndex:
|
|
1521
|
-
onRowFocus:
|
|
1522
|
-
onRowBlur:
|
|
1523
|
-
isSelectedForAria: !!
|
|
1524
|
-
rowHeight:
|
|
1525
|
-
isDirOpen:
|
|
1526
|
-
columns:
|
|
1527
|
-
numericTemplate:
|
|
1528
|
-
numericTotal:
|
|
1529
|
-
nameWidth:
|
|
1530
|
-
rowClassName:
|
|
1531
|
-
selection: { onEntryClick:
|
|
1532
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1533
|
-
visual:
|
|
1257
|
+
entry: o.entry,
|
|
1258
|
+
indentLevel: o.indentLevel,
|
|
1259
|
+
positionInSet: o.positionInSet,
|
|
1260
|
+
setSize: o.setSize,
|
|
1261
|
+
rowIndex: l + (I.showHeader ?? !0 ? 2 : 1),
|
|
1262
|
+
flatIndex: l,
|
|
1263
|
+
onRowFocus: Rt,
|
|
1264
|
+
onRowBlur: kt,
|
|
1265
|
+
isSelectedForAria: !!R?.has(o.entry.absolutePath),
|
|
1266
|
+
rowHeight: o.rowHeight,
|
|
1267
|
+
isDirOpen: fe,
|
|
1268
|
+
columns: I.columns,
|
|
1269
|
+
numericTemplate: dt,
|
|
1270
|
+
numericTotal: U.numericTotal,
|
|
1271
|
+
nameWidth: U.nameWidth,
|
|
1272
|
+
rowClassName: I.rowClassName,
|
|
1273
|
+
selection: { onEntryClick: d, selectedPath: Be, currentPath: wt, mode: w, selectedItems: R, onSelectionChange: f },
|
|
1274
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: bt },
|
|
1275
|
+
visual: vn
|
|
1534
1276
|
},
|
|
1535
|
-
|
|
1536
|
-
) : /* @__PURE__ */
|
|
1537
|
-
|
|
1277
|
+
o.entry.absolutePath
|
|
1278
|
+
) : /* @__PURE__ */ u(
|
|
1279
|
+
qn,
|
|
1538
1280
|
{
|
|
1539
|
-
entry:
|
|
1540
|
-
indentLevel:
|
|
1541
|
-
originX:
|
|
1542
|
-
depth:
|
|
1543
|
-
positionInSet:
|
|
1544
|
-
setSize:
|
|
1545
|
-
isSelectedForAria: !!
|
|
1546
|
-
flatIndex:
|
|
1547
|
-
isActive:
|
|
1548
|
-
registerRowRef:
|
|
1549
|
-
onNavigationKeyDown:
|
|
1550
|
-
onRowFocus:
|
|
1551
|
-
onRowBlur:
|
|
1552
|
-
rowHeight:
|
|
1281
|
+
entry: o.entry,
|
|
1282
|
+
indentLevel: o.indentLevel,
|
|
1283
|
+
originX: rt,
|
|
1284
|
+
depth: o.depth,
|
|
1285
|
+
positionInSet: o.positionInSet,
|
|
1286
|
+
setSize: o.setSize,
|
|
1287
|
+
isSelectedForAria: !!R?.has(o.entry.absolutePath),
|
|
1288
|
+
flatIndex: l,
|
|
1289
|
+
isActive: l === We,
|
|
1290
|
+
registerRowRef: hn,
|
|
1291
|
+
onNavigationKeyDown: fn,
|
|
1292
|
+
onRowFocus: Rt,
|
|
1293
|
+
onRowBlur: kt,
|
|
1294
|
+
rowHeight: o.rowHeight,
|
|
1553
1295
|
entryKindDirectory: $e,
|
|
1554
|
-
entryKindFile:
|
|
1555
|
-
isDirOpen:
|
|
1556
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1557
|
-
selection: { onEntryClick:
|
|
1296
|
+
entryKindFile: Q,
|
|
1297
|
+
isDirOpen: fe,
|
|
1298
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: bt },
|
|
1299
|
+
selection: { onEntryClick: d, selectedPath: Be, currentPath: wt, mode: w, selectedItems: R, onSelectionChange: f },
|
|
1558
1300
|
visual: {
|
|
1559
|
-
iconOverrides:
|
|
1560
|
-
showExpandIcons:
|
|
1561
|
-
showDirectoryIcons:
|
|
1562
|
-
showFileIcons:
|
|
1563
|
-
useCanvasExpandIcons:
|
|
1564
|
-
expandIconSize:
|
|
1565
|
-
typeIconSize:
|
|
1566
|
-
fontSize:
|
|
1567
|
-
indentSize:
|
|
1568
|
-
highlightStyles:
|
|
1569
|
-
entryClassName:
|
|
1570
|
-
entryStyle:
|
|
1571
|
-
nameClassName:
|
|
1572
|
-
nameStyle:
|
|
1573
|
-
directoryNameClassName:
|
|
1574
|
-
directoryNameStyle:
|
|
1575
|
-
fileNameClassName:
|
|
1576
|
-
fileNameStyle:
|
|
1577
|
-
expandIconClassName:
|
|
1578
|
-
expandIconStyle:
|
|
1301
|
+
iconOverrides: D,
|
|
1302
|
+
showExpandIcons: k,
|
|
1303
|
+
showDirectoryIcons: p,
|
|
1304
|
+
showFileIcons: L,
|
|
1305
|
+
useCanvasExpandIcons: x,
|
|
1306
|
+
expandIconSize: P,
|
|
1307
|
+
typeIconSize: X.typeIconSize,
|
|
1308
|
+
fontSize: X.fontSize,
|
|
1309
|
+
indentSize: X.indentSize,
|
|
1310
|
+
highlightStyles: B,
|
|
1311
|
+
entryClassName: ue,
|
|
1312
|
+
entryStyle: Se,
|
|
1313
|
+
nameClassName: Z,
|
|
1314
|
+
nameStyle: q,
|
|
1315
|
+
directoryNameClassName: _e,
|
|
1316
|
+
directoryNameStyle: Re,
|
|
1317
|
+
fileNameClassName: ke,
|
|
1318
|
+
fileNameStyle: A,
|
|
1319
|
+
expandIconClassName: te,
|
|
1320
|
+
expandIconStyle: M
|
|
1579
1321
|
}
|
|
1580
1322
|
},
|
|
1581
|
-
|
|
1323
|
+
o.entry.absolutePath
|
|
1582
1324
|
) : null
|
|
1583
1325
|
}
|
|
1584
1326
|
),
|
|
1585
1327
|
[
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1328
|
+
W.length,
|
|
1329
|
+
gn,
|
|
1330
|
+
on,
|
|
1331
|
+
sn,
|
|
1332
|
+
Ut,
|
|
1333
|
+
Jt,
|
|
1334
|
+
C,
|
|
1335
|
+
K,
|
|
1594
1336
|
$e,
|
|
1595
|
-
|
|
1337
|
+
Q,
|
|
1596
1338
|
We,
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1339
|
+
hn,
|
|
1340
|
+
fn,
|
|
1341
|
+
Rt,
|
|
1342
|
+
kt,
|
|
1343
|
+
re,
|
|
1344
|
+
Te,
|
|
1345
|
+
Qt,
|
|
1346
|
+
en,
|
|
1347
|
+
Ht,
|
|
1605
1348
|
Bt,
|
|
1606
|
-
|
|
1349
|
+
Ie,
|
|
1607
1350
|
ne,
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
Gt,
|
|
1351
|
+
Sn,
|
|
1352
|
+
U,
|
|
1353
|
+
Pt,
|
|
1354
|
+
V,
|
|
1355
|
+
Wt,
|
|
1614
1356
|
Me,
|
|
1615
|
-
|
|
1616
|
-
Xt,
|
|
1357
|
+
jt,
|
|
1617
1358
|
Kt,
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1359
|
+
Gt,
|
|
1360
|
+
pt,
|
|
1361
|
+
Zt,
|
|
1362
|
+
I,
|
|
1363
|
+
dt,
|
|
1364
|
+
fe,
|
|
1365
|
+
d,
|
|
1366
|
+
Be,
|
|
1367
|
+
wt,
|
|
1368
|
+
w,
|
|
1369
|
+
R,
|
|
1370
|
+
f,
|
|
1629
1371
|
t,
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
$,
|
|
1633
|
-
C,
|
|
1634
|
-
g,
|
|
1372
|
+
bt,
|
|
1373
|
+
vn,
|
|
1635
1374
|
D,
|
|
1375
|
+
k,
|
|
1376
|
+
p,
|
|
1377
|
+
L,
|
|
1378
|
+
x,
|
|
1636
1379
|
P,
|
|
1637
|
-
O,
|
|
1638
|
-
te,
|
|
1639
|
-
st,
|
|
1640
|
-
W,
|
|
1641
|
-
oe,
|
|
1642
|
-
pe,
|
|
1643
|
-
V,
|
|
1644
1380
|
X,
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1381
|
+
rt,
|
|
1382
|
+
B,
|
|
1383
|
+
ue,
|
|
1384
|
+
Se,
|
|
1385
|
+
Z,
|
|
1386
|
+
q,
|
|
1387
|
+
_e,
|
|
1388
|
+
Re,
|
|
1389
|
+
ke,
|
|
1390
|
+
A,
|
|
1391
|
+
te,
|
|
1392
|
+
M
|
|
1651
1393
|
]
|
|
1652
1394
|
);
|
|
1653
|
-
if (!(
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
|
|
1395
|
+
if (!(I && U))
|
|
1396
|
+
return /* @__PURE__ */ Ne("div", { ref: me, className: tn, style: nn, onPointerDownCapture: at, onMouseDownCapture: at, children: [
|
|
1397
|
+
Oe.length > 0 && !nr && // biome-ignore lint/a11y/noNoninteractiveTabindex: 停止点の行が描画窓の外で DOM に無い間だけ Tab を受け、受けた瞬間にその行へ焦点を渡す。これが無いとツリーに Tab で入れない
|
|
1656
1398
|
// biome-ignore lint/a11y/noStaticElementInteractions: 同上 (焦点の受け渡しだけを担い、要素自身は操作の対象ではない)
|
|
1657
|
-
/* @__PURE__ */
|
|
1658
|
-
|
|
1399
|
+
/* @__PURE__ */ u("span", { tabIndex: 0, "data-directory-tree-tab-stop": "", style: Fo, onFocus: rr }),
|
|
1400
|
+
wn
|
|
1659
1401
|
] });
|
|
1660
|
-
const
|
|
1661
|
-
return /* @__PURE__ */
|
|
1402
|
+
const sr = I.showHeader ?? !0, ir = I.showFooter ?? !1, ar = { ...nn, "--dt-hscroll": `${Ve}px` };
|
|
1403
|
+
return /* @__PURE__ */ Ne(
|
|
1662
1404
|
"div",
|
|
1663
1405
|
{
|
|
1664
|
-
ref:
|
|
1665
|
-
className:
|
|
1666
|
-
style:
|
|
1406
|
+
ref: me,
|
|
1407
|
+
className: j(tn, "dt-grid"),
|
|
1408
|
+
style: ar,
|
|
1667
1409
|
role: "treegrid",
|
|
1668
|
-
"aria-label":
|
|
1669
|
-
"aria-labelledby":
|
|
1670
|
-
"aria-multiselectable":
|
|
1671
|
-
"aria-busy":
|
|
1672
|
-
"aria-rowcount":
|
|
1673
|
-
onPointerDownCapture:
|
|
1674
|
-
onMouseDownCapture:
|
|
1410
|
+
"aria-label": b ? void 0 : S,
|
|
1411
|
+
"aria-labelledby": b,
|
|
1412
|
+
"aria-multiselectable": w === "multiple" ? !0 : void 0,
|
|
1413
|
+
"aria-busy": a ? !0 : void 0,
|
|
1414
|
+
"aria-rowcount": W.length + (I.showHeader ?? !0 ? 1 : 0),
|
|
1415
|
+
onPointerDownCapture: at,
|
|
1416
|
+
onMouseDownCapture: at,
|
|
1675
1417
|
children: [
|
|
1676
|
-
|
|
1677
|
-
/* @__PURE__ */
|
|
1678
|
-
/* @__PURE__ */
|
|
1679
|
-
|
|
1680
|
-
/* @__PURE__ */
|
|
1681
|
-
/* @__PURE__ */
|
|
1682
|
-
|
|
1418
|
+
sr && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
|
|
1419
|
+
/* @__PURE__ */ u("div", { role: "rowgroup", children: /* @__PURE__ */ u(no, { columns: I.columns, numericTemplate: dt, numericTotal: U.numericTotal, nameWidth: U.nameWidth, scrollBarWidth: je, className: I.headerClassName }) }),
|
|
1420
|
+
/* @__PURE__ */ u("div", { ref: Pe, className: "dt-grid-body", children: wn }),
|
|
1421
|
+
Ke > 0 && /* @__PURE__ */ Ne("div", { className: "dt-grid-hscrollbar-row", children: [
|
|
1422
|
+
/* @__PURE__ */ u("div", { className: "dt-grid-scrollbar-spacer", style: { width: U.nameWidth }, "aria-hidden": "true" }),
|
|
1423
|
+
/* @__PURE__ */ u(
|
|
1424
|
+
hr,
|
|
1683
1425
|
{
|
|
1684
1426
|
horizontal: !0,
|
|
1685
|
-
contentSize:
|
|
1686
|
-
viewportSize:
|
|
1687
|
-
scrollPosition:
|
|
1688
|
-
scrollBarWidth:
|
|
1689
|
-
locale:
|
|
1690
|
-
labels:
|
|
1691
|
-
onScroll: (
|
|
1692
|
-
const
|
|
1693
|
-
return
|
|
1427
|
+
contentSize: U.numericTotal,
|
|
1428
|
+
viewportSize: U.numericVisible,
|
|
1429
|
+
scrollPosition: Ve,
|
|
1430
|
+
scrollBarWidth: je,
|
|
1431
|
+
locale: C,
|
|
1432
|
+
labels: K,
|
|
1433
|
+
onScroll: (o) => {
|
|
1434
|
+
const l = typeof o == "function" ? o(Ve) : o, g = Ot(l, Ke);
|
|
1435
|
+
return Ue(g), g;
|
|
1694
1436
|
}
|
|
1695
1437
|
}
|
|
1696
1438
|
),
|
|
1697
|
-
/* @__PURE__ */
|
|
1439
|
+
/* @__PURE__ */ u("div", { className: "dt-grid-scrollbar-spacer", style: { width: je }, "aria-hidden": "true" })
|
|
1698
1440
|
] }),
|
|
1699
|
-
|
|
1700
|
-
/* @__PURE__ */
|
|
1441
|
+
ir && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
|
|
1442
|
+
/* @__PURE__ */ u("div", { role: "rowgroup", children: /* @__PURE__ */ u(ro, { columns: I.columns, numericTemplate: dt, numericTotal: U.numericTotal, nameWidth: U.nameWidth, scrollBarWidth: je, allEntries: or, className: I.footerClassName }) })
|
|
1701
1443
|
]
|
|
1702
1444
|
}
|
|
1703
1445
|
);
|
|
1704
|
-
},
|
|
1705
|
-
const [n, r] =
|
|
1446
|
+
}, Vo = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
|
|
1447
|
+
const [n, r] = pr(), [s, a] = de(() => {
|
|
1706
1448
|
if (typeof window < "u" && t)
|
|
1707
1449
|
try {
|
|
1708
|
-
const
|
|
1709
|
-
if (
|
|
1710
|
-
const
|
|
1711
|
-
return new Set(
|
|
1450
|
+
const h = window.localStorage.getItem(t);
|
|
1451
|
+
if (h) {
|
|
1452
|
+
const S = JSON.parse(h);
|
|
1453
|
+
return new Set(S);
|
|
1712
1454
|
}
|
|
1713
|
-
} catch (
|
|
1714
|
-
console.error("[useDirectoryTreeState] Error reading from localStorage",
|
|
1455
|
+
} catch (h) {
|
|
1456
|
+
console.error("[useDirectoryTreeState] Error reading from localStorage", h);
|
|
1715
1457
|
}
|
|
1716
1458
|
return e;
|
|
1717
|
-
}),
|
|
1459
|
+
}), i = E((h) => {
|
|
1718
1460
|
r(() => {
|
|
1719
|
-
|
|
1720
|
-
const
|
|
1721
|
-
return
|
|
1461
|
+
a((S) => {
|
|
1462
|
+
const b = new Set(S);
|
|
1463
|
+
return h(b), b;
|
|
1722
1464
|
});
|
|
1723
1465
|
});
|
|
1724
|
-
}, []),
|
|
1725
|
-
(
|
|
1726
|
-
|
|
1727
|
-
for (const
|
|
1728
|
-
|
|
1466
|
+
}, []), c = E(
|
|
1467
|
+
(h, S) => {
|
|
1468
|
+
i((b) => {
|
|
1469
|
+
for (const z of h)
|
|
1470
|
+
S(b, z);
|
|
1729
1471
|
});
|
|
1730
1472
|
},
|
|
1731
|
-
[
|
|
1473
|
+
[i]
|
|
1732
1474
|
);
|
|
1733
|
-
|
|
1475
|
+
Ae(() => {
|
|
1734
1476
|
if (t && typeof window < "u")
|
|
1735
1477
|
try {
|
|
1736
|
-
window.localStorage.setItem(t, JSON.stringify(Array.from(
|
|
1737
|
-
} catch (
|
|
1738
|
-
console.warn(`Error setting localStorage key "${t}":`,
|
|
1478
|
+
window.localStorage.setItem(t, JSON.stringify(Array.from(s)));
|
|
1479
|
+
} catch (h) {
|
|
1480
|
+
console.warn(`Error setting localStorage key "${t}":`, h);
|
|
1739
1481
|
}
|
|
1740
|
-
}, [
|
|
1741
|
-
const
|
|
1742
|
-
(
|
|
1743
|
-
|
|
1744
|
-
|
|
1482
|
+
}, [s, t]);
|
|
1483
|
+
const d = E(
|
|
1484
|
+
(h) => {
|
|
1485
|
+
c([h], (S, b) => {
|
|
1486
|
+
S.has(b) ? S.delete(b) : S.add(b);
|
|
1745
1487
|
});
|
|
1746
1488
|
},
|
|
1747
|
-
[
|
|
1748
|
-
),
|
|
1749
|
-
(
|
|
1750
|
-
|
|
1751
|
-
|
|
1489
|
+
[c]
|
|
1490
|
+
), y = E(
|
|
1491
|
+
(h) => {
|
|
1492
|
+
c([h], (S, b) => {
|
|
1493
|
+
S.add(b);
|
|
1752
1494
|
});
|
|
1753
1495
|
},
|
|
1754
|
-
[
|
|
1755
|
-
), N =
|
|
1756
|
-
(
|
|
1757
|
-
|
|
1758
|
-
|
|
1496
|
+
[c]
|
|
1497
|
+
), N = E(
|
|
1498
|
+
(h) => {
|
|
1499
|
+
c([h], (S, b) => {
|
|
1500
|
+
S.delete(b);
|
|
1759
1501
|
});
|
|
1760
1502
|
},
|
|
1761
|
-
[
|
|
1762
|
-
),
|
|
1763
|
-
(
|
|
1764
|
-
|
|
1765
|
-
|
|
1503
|
+
[c]
|
|
1504
|
+
), w = E(
|
|
1505
|
+
(h) => {
|
|
1506
|
+
c(h, (S, b) => {
|
|
1507
|
+
S.delete(b);
|
|
1766
1508
|
});
|
|
1767
1509
|
},
|
|
1768
|
-
[
|
|
1769
|
-
),
|
|
1770
|
-
(
|
|
1771
|
-
|
|
1772
|
-
|
|
1510
|
+
[c]
|
|
1511
|
+
), R = E(
|
|
1512
|
+
(h) => {
|
|
1513
|
+
c(h, (S, b) => {
|
|
1514
|
+
S.add(b);
|
|
1773
1515
|
});
|
|
1774
1516
|
},
|
|
1775
|
-
[
|
|
1776
|
-
),
|
|
1777
|
-
|
|
1778
|
-
|
|
1517
|
+
[c]
|
|
1518
|
+
), f = E(() => {
|
|
1519
|
+
i((h) => {
|
|
1520
|
+
h.clear();
|
|
1779
1521
|
});
|
|
1780
|
-
}, [
|
|
1522
|
+
}, [i]), m = E((h) => s.has(h), [s]);
|
|
1781
1523
|
return {
|
|
1782
|
-
expanded:
|
|
1783
|
-
toggle:
|
|
1784
|
-
expand:
|
|
1524
|
+
expanded: s,
|
|
1525
|
+
toggle: d,
|
|
1526
|
+
expand: y,
|
|
1785
1527
|
collapse: N,
|
|
1786
|
-
collapseMultiple:
|
|
1787
|
-
expandMultiple:
|
|
1788
|
-
collapseAll:
|
|
1789
|
-
isExpanded:
|
|
1528
|
+
collapseMultiple: w,
|
|
1529
|
+
expandMultiple: R,
|
|
1530
|
+
collapseAll: f,
|
|
1531
|
+
isExpanded: m,
|
|
1790
1532
|
isPending: n
|
|
1791
1533
|
};
|
|
1792
1534
|
};
|
|
1793
1535
|
export {
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1536
|
+
lo as DIRECTORY_TREE_LABEL_CATALOGS,
|
|
1537
|
+
Cn as DIRECTORY_TREE_LABEL_KEYS,
|
|
1538
|
+
Xo as DirectoryTree,
|
|
1539
|
+
Jr as EXPAND_ICON_STYLE_PROPERTIES,
|
|
1540
|
+
Yo as FILE_ICON_PAIRS,
|
|
1541
|
+
_r as MARK_PAIRS,
|
|
1542
|
+
Ur as ROW_STYLE_PROPERTIES,
|
|
1543
|
+
T as directoryTreeClasses,
|
|
1544
|
+
uo as resolveDirectoryTreeLabels,
|
|
1545
|
+
Vo as useDirectoryTreeState
|
|
1804
1546
|
};
|