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