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