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