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