@aiquants/directory-tree 3.12.0 → 4.0.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 +130 -14
- 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 +1244 -1084
- package/dist/labels.d.ts +4 -0
- package/dist/rowReveal.d.ts +2 -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 pe from "react";
|
|
2
|
+
import ln, { useRef as z, useEffect as ke, useCallback as P, memo as Pt, useState as he, useMemo as U, useLayoutEffect as fr, useImperativeHandle as cn, Fragment as un, useTransition as dn } from "react";
|
|
3
|
+
import { VIRTUAL_SCROLL_LABEL_KEYS as it, VIRTUAL_SCROLL_LABEL_CATALOGS as mr, resolveVirtualScrollLocale as Mr, resolveVirtualScrollLabels as fn, VirtualScroll as mn, ScrollBar as hn } from "@aiquants/virtualscroll";
|
|
4
|
+
import { twMerge as O } from "tailwind-merge";
|
|
5
|
+
import { FileMd as hr, FilePdf as pr, FileXls as yr, FileCsv as br, FileDoc as gr, FilePpt as vr, FileImage as xr, FileAudio as wr, FileVideo as Sr, FileZip as Er, FileCode as Rr, FileText as kr, FileIcon as pn } from "@phosphor-icons/react";
|
|
6
|
+
var at = { exports: {} }, Ye = {};
|
|
7
|
+
var Ir;
|
|
8
|
+
function yn() {
|
|
9
|
+
if (Ir) return Ye;
|
|
10
|
+
Ir = 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 jr;
|
|
31
|
+
function bn() {
|
|
32
|
+
return jr || (jr = 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 === q ? 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 $:
|
|
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 le:
|
|
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 w:
|
|
59
|
-
return o.displayName || "Context";
|
|
60
58
|
case I:
|
|
61
|
-
return
|
|
62
|
-
case
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
59
|
+
return s.displayName || "Context";
|
|
60
|
+
case x:
|
|
61
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
62
|
+
case b:
|
|
63
|
+
var h = s.render;
|
|
64
|
+
return s = s.displayName, s || (s = h.displayName || h.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
65
|
+
case C:
|
|
66
|
+
return h = s.displayName || null, h !== null ? h : e(s.type) || "Memo";
|
|
67
|
+
case X:
|
|
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 === X)
|
|
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
|
+
ye || (ye = !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 ce[s] || (ce[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
|
|
140
|
-
var
|
|
141
|
-
return
|
|
142
|
-
$$typeof:
|
|
143
|
-
type:
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
139
|
+
function S(s, h, g, N, se, ue) {
|
|
140
|
+
var A = g.ref;
|
|
141
|
+
return s = {
|
|
142
|
+
$$typeof: T,
|
|
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
|
-
value:
|
|
170
|
-
}), Object.freeze && (Object.freeze(
|
|
169
|
+
value: ue
|
|
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, ue) {
|
|
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(de) {
|
|
188
|
+
return de !== "key";
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
N = 0 < ee.length ? "{key: someKey, " + ee.join(": ..., ") + ": ...}" : "{key: someKey}", _[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
|
+
), _[A + N] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
typeof
|
|
211
|
-
),
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
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 be in h)
|
|
206
|
+
be !== "key" && (g[be] = h[be]);
|
|
207
|
+
} else g = h;
|
|
208
|
+
return A && d(
|
|
209
|
+
g,
|
|
210
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
211
|
+
), S(
|
|
212
|
+
s,
|
|
213
|
+
A,
|
|
214
|
+
g,
|
|
215
|
+
o(),
|
|
216
|
+
se,
|
|
217
|
+
ue
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
220
|
+
function p(s) {
|
|
221
|
+
R(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === X && (s._payload.status === "fulfilled" ? R(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 R(s) {
|
|
224
|
+
return typeof s == "object" && s !== null && s.$$typeof === T;
|
|
225
225
|
}
|
|
226
|
-
var
|
|
226
|
+
var E = ln, T = /* @__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"), $ = /* @__PURE__ */ Symbol.for("react.profiler"), x = /* @__PURE__ */ Symbol.for("react.consumer"), I = /* @__PURE__ */ Symbol.for("react.context"), b = /* @__PURE__ */ Symbol.for("react.forward_ref"), W = /* @__PURE__ */ Symbol.for("react.suspense"), D = /* @__PURE__ */ Symbol.for("react.suspense_list"), C = /* @__PURE__ */ Symbol.for("react.memo"), X = /* @__PURE__ */ Symbol.for("react.lazy"), le = /* @__PURE__ */ Symbol.for("react.activity"), q = /* @__PURE__ */ Symbol.for("react.client.reference"), Q = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, oe = Object.prototype.hasOwnProperty, re = Array.isArray, H = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
|
-
|
|
230
|
-
react_stack_bottom_frame: function(
|
|
231
|
-
return
|
|
229
|
+
E = {
|
|
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 ye, ce = {}, ie = E.react_stack_bottom_frame.bind(
|
|
235
|
+
E,
|
|
236
|
+
l
|
|
237
|
+
)(), G = H(n(l)), _ = {};
|
|
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") : ie,
|
|
246
|
+
N ? H(n(s)) : G
|
|
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") : ie,
|
|
256
|
+
N ? H(n(s)) : G
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), Ve;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
261
|
+
var Nr;
|
|
262
|
+
function gn() {
|
|
263
|
+
return Nr || (Nr = 1, process.env.NODE_ENV === "production" ? at.exports = yn() : at.exports = bn()), at.exports;
|
|
264
264
|
}
|
|
265
|
-
var
|
|
266
|
-
function
|
|
265
|
+
var i = gn();
|
|
266
|
+
function vn({
|
|
267
267
|
title: e,
|
|
268
268
|
titleId: t,
|
|
269
|
-
...
|
|
269
|
+
...r
|
|
270
270
|
}, n) {
|
|
271
|
-
return /* @__PURE__ */
|
|
271
|
+
return /* @__PURE__ */ pe.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__ */ pe.createElement("title", {
|
|
280
280
|
id: t
|
|
281
|
-
}, e) : null, /* @__PURE__ */
|
|
281
|
+
}, e) : null, /* @__PURE__ */ pe.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__ */ pe.forwardRef(vn);
|
|
288
|
+
function wn({
|
|
289
289
|
title: e,
|
|
290
290
|
titleId: t,
|
|
291
|
-
...
|
|
291
|
+
...r
|
|
292
292
|
}, n) {
|
|
293
|
-
return /* @__PURE__ */
|
|
293
|
+
return /* @__PURE__ */ pe.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__ */ pe.createElement("title", {
|
|
302
302
|
id: t
|
|
303
|
-
}, e) : null, /* @__PURE__ */
|
|
303
|
+
}, e) : null, /* @__PURE__ */ pe.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 Sn = /* @__PURE__ */ pe.forwardRef(wn);
|
|
310
|
+
function En({
|
|
311
311
|
title: e,
|
|
312
312
|
titleId: t,
|
|
313
|
-
...
|
|
313
|
+
...r
|
|
314
314
|
}, n) {
|
|
315
|
-
return /* @__PURE__ */
|
|
315
|
+
return /* @__PURE__ */ pe.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__ */ pe.createElement("title", {
|
|
324
324
|
id: t
|
|
325
|
-
}, e) : null, /* @__PURE__ */
|
|
325
|
+
}, e) : null, /* @__PURE__ */ pe.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__ */ pe.forwardRef(En), lt = 18, ct = 12, Tr = 8, M = {
|
|
330
330
|
container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
|
|
331
331
|
containerPending: "opacity-70",
|
|
332
332
|
entry: "directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",
|
|
333
333
|
// ホバー時のスタイル(ライト/ダークモード対応)
|
|
334
|
-
entryHover:
|
|
334
|
+
entryHover: 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
|
+
}, Pe = (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
|
+
}, $r = ({ 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(Sn, { className: c, style: l });
|
|
355
|
+
}, jt = (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) => jt(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
|
+
}, kn = (e, t, r) => {
|
|
372
|
+
const n = (t || (r ? Pe(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(hr, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
|
|
376
|
+
if (o === "application/pdf")
|
|
377
|
+
return /* @__PURE__ */ i.jsx(pr, { 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(yr, { 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(br, { 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(gr, { 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(vr, { 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(wr, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
|
|
390
|
+
if (o.startsWith("video/"))
|
|
391
|
+
return /* @__PURE__ */ i.jsx(Sr, { 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(Er, { 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(kr, { 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(hr, { 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(pr, { 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(yr, { 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(br, { 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(gr, { 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(vr, { 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(wr, { 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(Sr, { 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(Er, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
|
|
422
422
|
if (["txt", "log"].includes(n))
|
|
423
|
-
return /* @__PURE__ */
|
|
423
|
+
return /* @__PURE__ */ i.jsx(kr, { 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(pn, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
|
|
426
|
+
}, Hr = (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 || kn(j, l, r.name), jt(typeof d == "function" ? d(e) : d, r.absolutePath);
|
|
431
|
+
}, In = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Wr = (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
|
|
439
|
-
return
|
|
436
|
+
return Object.fromEntries(t.map(([r, n]) => [`data-${In(r)}`, String(n)]));
|
|
437
|
+
}, jn = 500, Br = ({ entry: e, isDirectory: t, isExpanded: r, isItemSelected: n, selectionMode: o, onSelectionChange: l, onEntryClick: c, toggleDirectory: d, onToggleDirectoryRecursive: j }) => {
|
|
438
|
+
const S = z(null);
|
|
439
|
+
return ke(
|
|
440
440
|
() => () => {
|
|
441
|
-
|
|
441
|
+
S.current && window.clearTimeout(S.current);
|
|
442
442
|
},
|
|
443
443
|
[]
|
|
444
|
-
),
|
|
445
|
-
(
|
|
446
|
-
|
|
447
|
-
let
|
|
448
|
-
|
|
444
|
+
), P(
|
|
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) && (S.current ? (window.clearTimeout(S.current), S.current = null, j(e)) : S.current = window.setTimeout(() => {
|
|
456
|
+
d(e.absolutePath), S.current = null;
|
|
457
|
+
}, jn));
|
|
458
458
|
},
|
|
459
|
-
[t, e,
|
|
459
|
+
[t, e, r, j, d, c, o, l, n]
|
|
460
460
|
);
|
|
461
|
-
},
|
|
461
|
+
}, zr = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", Pr = (e, t) => e.children !== void 0 && t(e.absolutePath), Gr = (e, t) => ({
|
|
462
462
|
width: e,
|
|
463
463
|
gridTemplateColumns: t
|
|
464
|
-
}),
|
|
464
|
+
}), Yr = Pt(
|
|
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: S,
|
|
476
|
+
isDirOpen: f,
|
|
477
|
+
columns: p,
|
|
478
|
+
numericTemplate: R,
|
|
479
|
+
numericTotal: E,
|
|
480
|
+
nameWidth: T,
|
|
481
|
+
rowClassName: m,
|
|
482
|
+
selection: { onEntryClick: v, selectedPath: k, currentPath: $, mode: x = "none", selectedItems: I, onSelectionChange: b },
|
|
483
|
+
expansion: { toggleDirectory: W, onToggleDirectoryRecursive: D },
|
|
484
|
+
visual: { iconOverrides: C, showExpandIcons: X = !0, showDirectoryIcons: le = !0, showFileIcons: q = !0, useCanvasExpandIcons: Q = !1, expandIconSize: oe, indentSize: re = ct, highlightStyles: H, expandIconClassName: ye, expandIconStyle: ce }
|
|
482
485
|
}) => {
|
|
483
|
-
const [
|
|
484
|
-
if (
|
|
485
|
-
if (
|
|
486
|
-
} else if (
|
|
487
|
-
return
|
|
486
|
+
const [ie, G] = he(!1), _ = e.children !== void 0, s = _ && f(e.absolutePath), h = e.absolutePath === k, g = e.absolutePath === $, N = !_ && !!I?.has(e.absolutePath), se = _ ? void 0 : Pe(e.name) || Pe(e.relativePath) || Pe(e.absolutePath), ue = Br({ entry: e, isDirectory: _, isExpanded: s, isItemSelected: N, selectionMode: x, onSelectionChange: b, onEntryClick: v, toggleDirectory: W, onToggleDirectoryRecursive: D }), A = ie ? H?.hoverClassName !== void 0 ? H.hoverClassName : M.entryHover : "", ee = (() => {
|
|
487
|
+
if (_) {
|
|
488
|
+
if (h) return H?.directorySelectedClassName !== void 0 ? H.directorySelectedClassName : M.entrySelected;
|
|
489
|
+
} else if (h || N)
|
|
490
|
+
return H?.itemSelectedClassName !== void 0 ? H.itemSelectedClassName : O(h && M.entrySelected, N && M.entryItemSelected);
|
|
488
491
|
return "";
|
|
489
|
-
})(),
|
|
490
|
-
...
|
|
491
|
-
...
|
|
492
|
-
...!
|
|
492
|
+
})(), be = typeof m == "function" ? m(e) : m, de = O("dt-grid-row cursor-pointer select-none", A, ee, be, e.className), _e = O(M.expandIcon, ye, (h || N) && M.expandIconSelected), Ie = O(M.typeIcon, (h || N) && M.typeIconSelected), ne = O("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", _ && M.nameDirectory, (h || N) && M.nameSelected), L = $r({ isDirectory: _, isExpanded: s, showExpandIcons: X, useCanvasExpandIcons: Q, expandIconSize: oe }), fe = (_ ? le : q) ? Hr({ entry: e, isDirectory: _, isExpanded: s, isSelected: h, isItemSelected: N, extension: se, mimeType: e.mimeType }, C) : null, J = { indentLevel: t, isDirectory: _, isExpanded: s }, [Se, ...K] = p, Me = Se?.render ? Se.render(e, J) : e.label ?? e.name, je = {
|
|
493
|
+
...ie ? H?.hoverStyle : {},
|
|
494
|
+
..._ && h ? H?.directorySelectedStyle : {},
|
|
495
|
+
...!_ && (h || N) ? H?.itemSelectedStyle : {}
|
|
493
496
|
};
|
|
494
|
-
return /* @__PURE__ */
|
|
497
|
+
return /* @__PURE__ */ i.jsxs(
|
|
495
498
|
"div",
|
|
496
499
|
{
|
|
497
|
-
className:
|
|
498
|
-
style: { height:
|
|
500
|
+
className: de,
|
|
501
|
+
style: { height: S, ...je, ...e.style },
|
|
499
502
|
role: "row",
|
|
500
|
-
"aria-expanded":
|
|
503
|
+
"aria-expanded": _ ? 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": x === "none" ? void 0 : j,
|
|
509
|
+
"aria-current": g ? "page" : void 0,
|
|
510
|
+
...Wr(e.data),
|
|
511
|
+
"data-entry-type": _ ? "directory" : "file",
|
|
512
|
+
"data-entry-expanded": _ ? String(s) : void 0,
|
|
513
|
+
"data-entry-selected": h ? "true" : void 0,
|
|
514
|
+
"data-entry-item-selected": N ? "true" : void 0,
|
|
515
|
+
onClick: ue,
|
|
516
|
+
onMouseEnter: () => G(!0),
|
|
517
|
+
onMouseLeave: () => G(!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
|
+
ue(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", Se?.className), role: "gridcell", style: { width: T, paddingLeft: Math.max(0, t * re) }, children: [
|
|
532
|
+
(X || Q) && /* @__PURE__ */ i.jsx("span", { className: _e, style: ce, children: L }),
|
|
533
|
+
(_ ? le : q) && /* @__PURE__ */ i.jsx("span", { className: Ie, children: fe }),
|
|
534
|
+
/* @__PURE__ */ i.jsx("span", { className: ne, children: Me })
|
|
521
535
|
] }),
|
|
522
|
-
|
|
536
|
+
K.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Gr(E, R), children: K.map((B) => /* @__PURE__ */ i.jsx("div", { className: O("dt-grid-cell", zr(B.align), B.className), role: "gridcell", children: B.render ? B.render(e, J) : 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 = Pr(e.entry, e.isDirOpen), n = Pr(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
|
+
Yr.displayName = "DirectoryTreeGridRow";
|
|
549
|
+
const Vr = ({
|
|
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 [, ...
|
|
546
|
-
return /* @__PURE__ */
|
|
547
|
-
/* @__PURE__ */
|
|
548
|
-
|
|
549
|
-
/* @__PURE__ */
|
|
560
|
+
const [, ...S] = t, f = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", p = e === "header" ? "dt-grid-header" : "dt-grid-footer", R = 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: R, style: { width: o }, children: d }),
|
|
563
|
+
S.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Gr(n, r), children: S.map((E) => /* @__PURE__ */ i.jsx("div", { className: O("dt-grid-cell", zr(E.align), E.className), role: R, children: j(E) }, E.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
|
+
}, Nn = ({ columns: e, className: t, ...r }) => /* @__PURE__ */ i.jsx(Vr, { 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(Vr, { kind: "footer", columns: e, className: r, nameContent: _r(e[0]?.footer, t), renderCell: (o) => _r(o.footer, t), ...n }), Pn = 240, Ur = 96, Kr = 12, Nt = (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) => `${Nt(t, Ur)}px`).join(" "), Cn = ({ measuredWidth: e, columns: t, scrollBarWidth: r = Kr }) => {
|
|
570
|
+
const n = Nt(t[0], Pn), o = t.slice(1).reduce((j, S) => j + Nt(S, Ur), 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
|
+
}, It = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, An = (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
|
+
}, Xr = ["entryKindDirectory", "entryKindFile"], Cr = [...it, ...Xr], Tt = Object.freeze({
|
|
564
579
|
en: Object.freeze({
|
|
565
580
|
entryKindDirectory: "directory",
|
|
566
581
|
entryKindFile: "file"
|
|
@@ -569,421 +584,468 @@ const gr = ({
|
|
|
569
584
|
entryKindDirectory: "ディレクトリ",
|
|
570
585
|
entryKindFile: "ファイル"
|
|
571
586
|
})
|
|
572
|
-
}),
|
|
573
|
-
en: Object.freeze({ ...
|
|
574
|
-
ja: Object.freeze({ ...
|
|
575
|
-
}),
|
|
587
|
+
}), On = Object.freeze({
|
|
588
|
+
en: Object.freeze({ ...mr.en, ...Tt.en }),
|
|
589
|
+
ja: Object.freeze({ ...mr.ja, ...Tt.ja })
|
|
590
|
+
}), Ar = (e) => typeof e == "string" ? JSON.stringify(e) : e === null ? "null" : typeof e, Ln = (e) => {
|
|
576
591
|
const t = {};
|
|
577
|
-
let
|
|
578
|
-
for (const n of
|
|
579
|
-
const
|
|
580
|
-
|
|
592
|
+
let r = !1;
|
|
593
|
+
for (const n of it) {
|
|
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
|
+
}, Dn = (e, t) => {
|
|
599
|
+
const r = Mr(e);
|
|
585
600
|
if (t === void 0)
|
|
586
|
-
return
|
|
601
|
+
return On[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 ${Ar(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 (!Cr.includes(c))
|
|
609
|
+
throw new RangeError(`[directory-tree] labels.${c} is not a known label key; expected one of ${Cr.join(", ")}`);
|
|
610
|
+
const l = { ...fn(r, Ln(t)), ...Tt[r] };
|
|
611
|
+
for (const c of Xr) {
|
|
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 ${Ar(d)}`);
|
|
616
|
+
l[c] = d;
|
|
602
617
|
}
|
|
603
618
|
}
|
|
604
|
-
return Object.freeze(
|
|
605
|
-
},
|
|
619
|
+
return Object.freeze(l);
|
|
620
|
+
}, Fn = (e) => {
|
|
606
621
|
const t = {};
|
|
607
|
-
for (const
|
|
608
|
-
t[
|
|
622
|
+
for (const r of it)
|
|
623
|
+
t[r] = e[r];
|
|
609
624
|
return Object.freeze(t);
|
|
610
|
-
},
|
|
611
|
-
const
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
625
|
+
}, Mn = (e, t, r, n, o) => {
|
|
626
|
+
const l = r + n;
|
|
627
|
+
return o === "visible" && t > r && e < l ? null : t - e > n ? e === r ? null : "top" : e < r ? "top" : t > l ? "bottom" : null;
|
|
628
|
+
}, $n = (e, t) => {
|
|
629
|
+
const r = e.length - 1;
|
|
630
|
+
if (r <= 0) return 0;
|
|
631
|
+
let n = 0, o = r - 1, l = 0;
|
|
632
|
+
for (; n <= o; ) {
|
|
633
|
+
const c = n + o >>> 1;
|
|
634
|
+
e[c] <= t ? (l = c, n = c + 1) : o = c - 1;
|
|
617
635
|
}
|
|
618
|
-
return
|
|
619
|
-
},
|
|
620
|
-
if (
|
|
636
|
+
return l;
|
|
637
|
+
}, Hn = (e, t, r) => {
|
|
638
|
+
if (r <= 0 || e.length === 0 || t.length !== e.length + 1)
|
|
621
639
|
return null;
|
|
622
|
-
const n =
|
|
623
|
-
return
|
|
624
|
-
path:
|
|
625
|
-
offsetInViewport:
|
|
640
|
+
const n = $n(t, r), o = e[n];
|
|
641
|
+
return o ? {
|
|
642
|
+
path: o.entry.absolutePath,
|
|
643
|
+
offsetInViewport: r - t[n]
|
|
626
644
|
} : null;
|
|
627
|
-
},
|
|
628
|
-
if (t.length === 0 ||
|
|
645
|
+
}, Wn = (e, t, r) => {
|
|
646
|
+
if (t.length === 0 || r.length !== t.length + 1)
|
|
629
647
|
return null;
|
|
630
648
|
for (let n = 0; n < t.length; n++)
|
|
631
649
|
if (t[n].entry.absolutePath === e.path)
|
|
632
|
-
return Math.max(0,
|
|
650
|
+
return Math.max(0, r[n] + e.offsetInViewport);
|
|
633
651
|
return null;
|
|
634
|
-
},
|
|
652
|
+
}, Bn = (e, t, r) => {
|
|
635
653
|
const n = [];
|
|
636
|
-
for (let
|
|
637
|
-
const
|
|
638
|
-
if (!(!
|
|
639
|
-
for (const
|
|
640
|
-
n.push(
|
|
654
|
+
for (let o = t; o < r; o++) {
|
|
655
|
+
const l = e[o];
|
|
656
|
+
if (!(!l || l.length === 0))
|
|
657
|
+
for (const c of l)
|
|
658
|
+
n.push(c);
|
|
641
659
|
}
|
|
642
660
|
return n;
|
|
643
|
-
},
|
|
661
|
+
}, zn = (e, t, r) => {
|
|
644
662
|
const n = [];
|
|
645
|
-
for (let
|
|
646
|
-
const
|
|
647
|
-
if (!(!
|
|
648
|
-
for (const
|
|
649
|
-
n.push(
|
|
663
|
+
for (let o = t; o < r; o++) {
|
|
664
|
+
const l = e[o];
|
|
665
|
+
if (!(!l || l.length === 0))
|
|
666
|
+
for (const c of l)
|
|
667
|
+
n.push(c);
|
|
650
668
|
}
|
|
651
669
|
return n;
|
|
652
|
-
},
|
|
653
|
-
const
|
|
654
|
-
(e.width !==
|
|
655
|
-
const
|
|
656
|
-
|
|
657
|
-
},
|
|
658
|
-
e.lineWidth =
|
|
670
|
+
}, Gn = (e, t, r, n) => {
|
|
671
|
+
const o = Math.max(1, Math.floor(t * n)), l = Math.max(1, Math.floor(r * n));
|
|
672
|
+
(e.width !== o || e.height !== l) && (e.width = o, e.height = l);
|
|
673
|
+
const c = e.style;
|
|
674
|
+
c.width !== `${t}px` && (c.width = `${t}px`), c.height !== `${r}px` && (c.height = `${r}px`);
|
|
675
|
+
}, Yn = (e, t, r) => {
|
|
676
|
+
e.lineWidth = r, e.beginPath();
|
|
659
677
|
for (const n of t)
|
|
660
678
|
e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
|
|
661
679
|
e.stroke();
|
|
662
|
-
},
|
|
663
|
-
const
|
|
664
|
-
if (!
|
|
680
|
+
}, Vn = (e, t) => {
|
|
681
|
+
const r = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
682
|
+
if (!r)
|
|
665
683
|
return null;
|
|
666
|
-
let n =
|
|
667
|
-
n.length === 3 && (n = n.split("").map((
|
|
668
|
-
const
|
|
669
|
-
return `rgba(${
|
|
670
|
-
},
|
|
684
|
+
let n = r[1];
|
|
685
|
+
n.length === 3 && (n = n.split("").map((d) => d + d).join(""));
|
|
686
|
+
const o = Number.parseInt(n.slice(0, 2), 16), l = Number.parseInt(n.slice(2, 4), 16), c = Number.parseInt(n.slice(4, 6), 16);
|
|
687
|
+
return `rgba(${o}, ${l}, ${c}, ${t})`;
|
|
688
|
+
}, Un = (e, t, r, n) => {
|
|
671
689
|
if (t.length === 0)
|
|
672
690
|
return;
|
|
673
|
-
const
|
|
674
|
-
e.strokeStyle =
|
|
675
|
-
for (const
|
|
676
|
-
const
|
|
677
|
-
|
|
691
|
+
const o = Vn(r, 0.14), l = e.strokeStyle, c = e.fillStyle, d = e.lineWidth, j = e.lineCap, S = e.lineJoin;
|
|
692
|
+
e.strokeStyle = r, e.lineCap = "round", e.lineJoin = "round";
|
|
693
|
+
for (const f of t) {
|
|
694
|
+
const p = n ?? f.size, R = Math.max(0, p / 2), E = Math.max(1, Math.round(p * 0.08)), T = Math.max(1, Math.round(p * 0.14)), m = Math.max(0, R - E * 0.8), v = Math.max(0, m * 0.55);
|
|
695
|
+
o && (e.fillStyle = o, e.beginPath(), e.arc(f.centerX, f.centerY, m, 0, Math.PI * 2), e.fill()), e.lineWidth = E, e.beginPath(), e.arc(f.centerX, f.centerY, Math.max(0, R - E * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = T, 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
696
|
}
|
|
679
|
-
e.strokeStyle =
|
|
680
|
-
},
|
|
681
|
-
const
|
|
697
|
+
e.strokeStyle = l, e.fillStyle = c, e.lineWidth = d, e.lineCap = j, e.lineJoin = S;
|
|
698
|
+
}, Jr = Pt(({ segmentsByItem: e, glyphsByItem: t, itemHeight: r, width: n, viewportHeight: o, scrollPosition: l, color: c = "#a0aec0", strokeWidth: d = 1, renderStartIndex: j, renderEndIndex: S, lookaheadEndIndex: f, devicePixelRatio: p, expandGlyphColor: R, expandGlyphSize: E }) => {
|
|
699
|
+
const T = z(null), m = z(null), v = z({
|
|
682
700
|
segmentsByItem: e,
|
|
683
701
|
glyphsByItem: t,
|
|
684
|
-
itemHeight:
|
|
702
|
+
itemHeight: r,
|
|
685
703
|
width: n,
|
|
686
|
-
viewportHeight:
|
|
687
|
-
scrollPosition:
|
|
688
|
-
color:
|
|
689
|
-
strokeWidth:
|
|
690
|
-
renderStartIndex:
|
|
691
|
-
renderEndIndex:
|
|
692
|
-
lookaheadEndIndex:
|
|
693
|
-
devicePixelRatio:
|
|
694
|
-
expandGlyphColor:
|
|
695
|
-
expandGlyphSize:
|
|
696
|
-
}),
|
|
697
|
-
|
|
698
|
-
const
|
|
699
|
-
if (!
|
|
704
|
+
viewportHeight: o,
|
|
705
|
+
scrollPosition: l,
|
|
706
|
+
color: c,
|
|
707
|
+
strokeWidth: d,
|
|
708
|
+
renderStartIndex: j,
|
|
709
|
+
renderEndIndex: S,
|
|
710
|
+
lookaheadEndIndex: f,
|
|
711
|
+
devicePixelRatio: p,
|
|
712
|
+
expandGlyphColor: R,
|
|
713
|
+
expandGlyphSize: E
|
|
714
|
+
}), k = P(() => {
|
|
715
|
+
m.current = null;
|
|
716
|
+
const x = T.current;
|
|
717
|
+
if (!x)
|
|
700
718
|
return;
|
|
701
|
-
const
|
|
702
|
-
if (!
|
|
719
|
+
const I = x.getContext("2d");
|
|
720
|
+
if (!I)
|
|
703
721
|
return;
|
|
704
|
-
const
|
|
705
|
-
if (
|
|
706
|
-
|
|
722
|
+
const b = v.current;
|
|
723
|
+
if (b.width <= 0 || b.viewportHeight <= 0) {
|
|
724
|
+
I.clearRect(0, 0, x.width, x.height);
|
|
707
725
|
return;
|
|
708
726
|
}
|
|
709
|
-
const
|
|
710
|
-
|
|
711
|
-
const
|
|
712
|
-
if (typeof
|
|
713
|
-
const
|
|
714
|
-
return Math.max(Math.min(
|
|
727
|
+
const W = Number.isFinite(b.devicePixelRatio ?? NaN) ? b.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
|
|
728
|
+
Gn(x, b.width, b.viewportHeight, W);
|
|
729
|
+
const D = b.segmentsByItem.length, C = typeof b.renderStartIndex == "number" && Number.isFinite(b.renderStartIndex) ? Math.max(0, Math.floor(b.renderStartIndex)) : Math.max(0, Math.floor(b.scrollPosition / b.itemHeight)), X = Math.min(D, Math.ceil((b.scrollPosition + b.viewportHeight) / b.itemHeight)), le = (() => {
|
|
730
|
+
if (typeof b.renderEndIndex == "number" && Number.isFinite(b.renderEndIndex)) {
|
|
731
|
+
const re = Math.floor(b.renderEndIndex);
|
|
732
|
+
return Math.max(Math.min(D, re + 1), C);
|
|
715
733
|
}
|
|
716
|
-
return Math.max(
|
|
717
|
-
})(),
|
|
718
|
-
if (typeof
|
|
719
|
-
const
|
|
720
|
-
return Math.max(
|
|
734
|
+
return Math.max(X, C);
|
|
735
|
+
})(), q = (() => {
|
|
736
|
+
if (typeof b.lookaheadEndIndex == "number" && Number.isFinite(b.lookaheadEndIndex)) {
|
|
737
|
+
const re = Math.floor(b.lookaheadEndIndex), H = Math.min(D, re + 1);
|
|
738
|
+
return Math.max(H, le);
|
|
721
739
|
}
|
|
722
|
-
return Math.max(
|
|
723
|
-
})(),
|
|
724
|
-
|
|
725
|
-
}, []),
|
|
726
|
-
|
|
727
|
-
}, [
|
|
728
|
-
return
|
|
729
|
-
|
|
740
|
+
return Math.max(X, le);
|
|
741
|
+
})(), Q = Bn(b.segmentsByItem, C, q), oe = zn(b.glyphsByItem, C, q);
|
|
742
|
+
I.save(), I.scale(W, W), I.clearRect(0, 0, b.width, b.viewportHeight), I.translate(0, -b.scrollPosition), I.strokeStyle = b.color, Yn(I, Q, b.strokeWidth), Un(I, oe, b.expandGlyphColor ?? b.color, b.expandGlyphSize), I.restore();
|
|
743
|
+
}, []), $ = P(() => {
|
|
744
|
+
m.current === null && (m.current = window.requestAnimationFrame(k));
|
|
745
|
+
}, [k]);
|
|
746
|
+
return ke(() => {
|
|
747
|
+
v.current = {
|
|
730
748
|
segmentsByItem: e,
|
|
731
749
|
glyphsByItem: t,
|
|
732
|
-
itemHeight:
|
|
750
|
+
itemHeight: r,
|
|
733
751
|
width: n,
|
|
734
|
-
viewportHeight:
|
|
735
|
-
scrollPosition:
|
|
736
|
-
color:
|
|
737
|
-
strokeWidth:
|
|
738
|
-
renderStartIndex:
|
|
739
|
-
renderEndIndex:
|
|
740
|
-
lookaheadEndIndex:
|
|
741
|
-
devicePixelRatio:
|
|
742
|
-
expandGlyphColor:
|
|
743
|
-
expandGlyphSize:
|
|
744
|
-
},
|
|
745
|
-
}, [e, t,
|
|
746
|
-
|
|
747
|
-
}, []), /* @__PURE__ */
|
|
752
|
+
viewportHeight: o,
|
|
753
|
+
scrollPosition: l,
|
|
754
|
+
color: c,
|
|
755
|
+
strokeWidth: d,
|
|
756
|
+
renderStartIndex: j,
|
|
757
|
+
renderEndIndex: S,
|
|
758
|
+
lookaheadEndIndex: f,
|
|
759
|
+
devicePixelRatio: p,
|
|
760
|
+
expandGlyphColor: R,
|
|
761
|
+
expandGlyphSize: E
|
|
762
|
+
}, $();
|
|
763
|
+
}, [e, t, r, n, o, l, c, d, j, S, f, p, R, E, $]), ke(() => () => {
|
|
764
|
+
m.current !== null && (window.cancelAnimationFrame(m.current), m.current = null);
|
|
765
|
+
}, []), /* @__PURE__ */ i.jsx("canvas", { ref: T, className: "pointer-events-none absolute top-0 left-0 z-0" });
|
|
748
766
|
});
|
|
749
|
-
|
|
750
|
-
const
|
|
767
|
+
Jr.displayName = "TreeLineCanvas";
|
|
768
|
+
const Kn = (e) => {
|
|
769
|
+
const t = /* @__PURE__ */ new Map();
|
|
770
|
+
for (let r = 0; r < e.length; r++) {
|
|
771
|
+
const n = e[r].entry.absolutePath;
|
|
772
|
+
t.has(n) || t.set(n, r);
|
|
773
|
+
}
|
|
774
|
+
return t;
|
|
775
|
+
}, Or = (e, t) => e.selectedPath === t ? e : { selectedPath: t, selectionGeneration: e.selectionGeneration + 1, anchor: e.anchor }, Xn = (e, t) => ({ ...e, anchor: { path: t, selectionGeneration: e.selectionGeneration, focused: !0 } }), Jn = (e, t) => {
|
|
776
|
+
const { anchor: r, selectionGeneration: n, selectedPath: o } = t;
|
|
777
|
+
if (r !== null && (r.focused || r.selectionGeneration === n)) {
|
|
778
|
+
const l = e.get(r.path);
|
|
779
|
+
if (l !== void 0)
|
|
780
|
+
return l;
|
|
781
|
+
}
|
|
782
|
+
if (o !== null) {
|
|
783
|
+
const l = e.get(o);
|
|
784
|
+
if (l !== void 0)
|
|
785
|
+
return l;
|
|
786
|
+
}
|
|
787
|
+
return 0;
|
|
788
|
+
}, Zn = {
|
|
751
789
|
msOverflowStyle: "none",
|
|
752
790
|
scrollbarWidth: "none"
|
|
753
|
-
},
|
|
791
|
+
}, qn = () => {
|
|
754
792
|
let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
|
|
755
793
|
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
|
-
|
|
794
|
+
}, Qn = (e) => {
|
|
795
|
+
const t = z(null), r = t.current;
|
|
796
|
+
return r !== null && it.every((n) => r[n] === e[n]) ? r : (t.current = e, e);
|
|
797
|
+
}, Lr = /* @__PURE__ */ new Set(["top", "bottom", "center", "nearest"]), Dr = (e) => {
|
|
798
|
+
const t = e?.align;
|
|
799
|
+
if (t === void 0)
|
|
800
|
+
return "top";
|
|
801
|
+
if (!Lr.has(t))
|
|
802
|
+
throw new RangeError(`[directory-tree] Unsupported scroll alignment ${JSON.stringify(t)}; expected one of ${[...Lr].join(", ")}.`);
|
|
803
|
+
return t;
|
|
804
|
+
}, eo = {
|
|
805
|
+
position: "absolute",
|
|
806
|
+
width: 1,
|
|
807
|
+
height: 1,
|
|
808
|
+
margin: -1,
|
|
809
|
+
padding: 0,
|
|
810
|
+
border: 0,
|
|
811
|
+
overflow: "hidden",
|
|
812
|
+
clipPath: "inset(50%)",
|
|
813
|
+
whiteSpace: "nowrap"
|
|
814
|
+
}, to = (e, t, r, n, o) => {
|
|
815
|
+
const l = [], c = [];
|
|
816
|
+
let d = 0;
|
|
817
|
+
const j = (S, f, p) => {
|
|
818
|
+
const R = o ? [...S].sort(o) : S;
|
|
819
|
+
for (let E = 0; E < R.length; E++) {
|
|
820
|
+
const T = R[E], m = E === R.length - 1, v = [...p, m], k = T.children !== void 0, $ = k && t(T.absolutePath, T.relativePath);
|
|
821
|
+
let x = f, I = v, b = p;
|
|
822
|
+
n && (x = f - 1, I = v.slice(1), b = p.slice(1)), l.push({ entry: T, indentLevel: x, depth: f, positionInSet: E + 1, setSize: R.length, parentIsLast: I }), r && (x > d && (d = x), c.push({
|
|
823
|
+
id: T.absolutePath,
|
|
824
|
+
name: T.name,
|
|
825
|
+
absolutePath: T.absolutePath,
|
|
826
|
+
indentLevel: x,
|
|
827
|
+
isLastChild: m,
|
|
828
|
+
isDirectory: k,
|
|
829
|
+
isExpanded: $,
|
|
830
|
+
ancestorIsLast: [...b],
|
|
831
|
+
hideLines: n && f === 0
|
|
832
|
+
})), k && $ && T.children && j(T.children, f + 1, v);
|
|
778
833
|
}
|
|
779
834
|
};
|
|
780
|
-
return
|
|
781
|
-
},
|
|
782
|
-
const
|
|
783
|
-
if (
|
|
784
|
-
let n = 0,
|
|
785
|
-
for (; n <=
|
|
786
|
-
const
|
|
787
|
-
e[
|
|
835
|
+
return j(e, 0, []), { flatItems: l, lineItems: c, maxIndent: d };
|
|
836
|
+
}, Fr = (e, t) => {
|
|
837
|
+
const r = e.length - 1;
|
|
838
|
+
if (r <= 0) return 0;
|
|
839
|
+
let n = 0, o = r - 1, l = 0;
|
|
840
|
+
for (; n <= o; ) {
|
|
841
|
+
const c = n + o >>> 1;
|
|
842
|
+
e[c] <= t ? (l = c, n = c + 1) : o = c - 1;
|
|
788
843
|
}
|
|
789
|
-
return
|
|
790
|
-
},
|
|
791
|
-
const
|
|
792
|
-
return { renderStart:
|
|
793
|
-
},
|
|
844
|
+
return l;
|
|
845
|
+
}, ro = (e, t, r, n, o, l) => {
|
|
846
|
+
const c = n?.renderStart ?? Math.max(0, Fr(l, o)), d = t > 0 ? Fr(l, o + t) + r : c + r, j = e > 0 ? Math.min(e - 1, Math.max(c, d)) : c, S = n?.renderEnd ?? j, f = e > 0 ? Math.min(e - 1, S + r) : S;
|
|
847
|
+
return { renderStart: c, renderEnd: S, lookaheadEnd: f };
|
|
848
|
+
}, no = (e, t, r, n, o, l) => {
|
|
794
849
|
if (e.length === 0)
|
|
795
850
|
return { segmentsByItem: [], glyphsByItem: [] };
|
|
796
|
-
const
|
|
797
|
-
for (let
|
|
798
|
-
const
|
|
799
|
-
if (
|
|
851
|
+
const c = Array.from({ length: e.length }, () => []), d = Array.from({ length: e.length }, () => []), j = (f) => o ? typeof l == "number" && Number.isFinite(l) && l > 0 ? l : Math.max(8, Math.min(n * 0.9, f * 0.7)) : 0, S = 3;
|
|
852
|
+
for (let f = 0; f < e.length; f++) {
|
|
853
|
+
const p = e[f];
|
|
854
|
+
if (p.hideLines)
|
|
800
855
|
continue;
|
|
801
|
-
const
|
|
802
|
-
for (let
|
|
803
|
-
if (
|
|
856
|
+
const R = [], E = t[f] ?? 0, T = r[f] ?? 0, m = T + E / 2, v = j(E), k = v > 0 ? v / 2 + 2 : n / 1.5;
|
|
857
|
+
for (let I = 0; I < p.indentLevel; I++) {
|
|
858
|
+
if (p.ancestorIsLast[I] ?? !1)
|
|
804
859
|
continue;
|
|
805
|
-
let
|
|
806
|
-
for (let
|
|
807
|
-
const
|
|
808
|
-
if (
|
|
809
|
-
|
|
860
|
+
let W = !1;
|
|
861
|
+
for (let D = f; D < e.length; D++) {
|
|
862
|
+
const C = e[D];
|
|
863
|
+
if (C.indentLevel > I && C.ancestorIsLast.length > I && !C.ancestorIsLast[I]) {
|
|
864
|
+
W = !0;
|
|
810
865
|
break;
|
|
811
866
|
}
|
|
812
|
-
if (
|
|
867
|
+
if (D > f && C.indentLevel === I)
|
|
813
868
|
break;
|
|
814
869
|
}
|
|
815
|
-
if (
|
|
816
|
-
const
|
|
817
|
-
|
|
818
|
-
key: `${
|
|
819
|
-
x1:
|
|
820
|
-
y1:
|
|
821
|
-
x2:
|
|
822
|
-
y2:
|
|
823
|
-
itemIndex:
|
|
870
|
+
if (W) {
|
|
871
|
+
const D = I * n + n / 2 + S;
|
|
872
|
+
R.push({
|
|
873
|
+
key: `${p.id}-ancestor-${I}`,
|
|
874
|
+
x1: D,
|
|
875
|
+
y1: T,
|
|
876
|
+
x2: D,
|
|
877
|
+
y2: T + E,
|
|
878
|
+
itemIndex: f
|
|
824
879
|
});
|
|
825
880
|
}
|
|
826
881
|
}
|
|
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
|
-
|
|
882
|
+
const $ = p.indentLevel * n, x = $ + n / 2 + S;
|
|
883
|
+
if (p.isDirectory ? R.push({
|
|
884
|
+
key: `${p.id}-connector-top`,
|
|
885
|
+
x1: x,
|
|
886
|
+
y1: T,
|
|
887
|
+
x2: x,
|
|
888
|
+
y2: m - k,
|
|
889
|
+
itemIndex: f
|
|
890
|
+
}) : R.push({
|
|
891
|
+
key: `${p.id}-connector-top`,
|
|
892
|
+
x1: x,
|
|
893
|
+
y1: T,
|
|
894
|
+
x2: x,
|
|
895
|
+
y2: m,
|
|
896
|
+
itemIndex: f
|
|
897
|
+
}), !p.isDirectory && p.isLastChild && R.push({
|
|
898
|
+
key: `${p.id}-connector-horizontal`,
|
|
899
|
+
x1: x,
|
|
900
|
+
y1: m,
|
|
901
|
+
x2: $ + n + S,
|
|
902
|
+
y2: m,
|
|
903
|
+
itemIndex: f
|
|
904
|
+
}), p.isLastChild || (p.isDirectory ? R.push({
|
|
905
|
+
key: `${p.id}-connector-bottom`,
|
|
906
|
+
x1: x,
|
|
907
|
+
y1: m + k,
|
|
908
|
+
x2: x,
|
|
909
|
+
y2: T + E,
|
|
910
|
+
itemIndex: f
|
|
911
|
+
}) : R.push({
|
|
912
|
+
key: `${p.id}-connector-bottom`,
|
|
913
|
+
x1: x,
|
|
914
|
+
y1: m,
|
|
915
|
+
x2: x,
|
|
916
|
+
y2: T + E,
|
|
917
|
+
itemIndex: f
|
|
918
|
+
})), c[f] = R, o && p.isDirectory) {
|
|
919
|
+
const I = v, b = x, W = m;
|
|
920
|
+
d[f] = [
|
|
866
921
|
{
|
|
867
|
-
key: `${
|
|
868
|
-
itemIndex:
|
|
869
|
-
centerX:
|
|
870
|
-
centerY:
|
|
871
|
-
size:
|
|
872
|
-
isExpanded:
|
|
922
|
+
key: `${p.id}-glyph`,
|
|
923
|
+
itemIndex: f,
|
|
924
|
+
centerX: b,
|
|
925
|
+
centerY: W,
|
|
926
|
+
size: I,
|
|
927
|
+
isExpanded: p.isExpanded
|
|
873
928
|
}
|
|
874
929
|
];
|
|
875
930
|
}
|
|
876
931
|
}
|
|
877
|
-
return { segmentsByItem:
|
|
878
|
-
},
|
|
932
|
+
return { segmentsByItem: c, glyphsByItem: d };
|
|
933
|
+
}, _t = Pt(
|
|
879
934
|
({
|
|
880
935
|
entry: e,
|
|
881
936
|
indentLevel: t,
|
|
882
|
-
depth:
|
|
937
|
+
depth: r,
|
|
883
938
|
positionInSet: n,
|
|
884
|
-
setSize:
|
|
885
|
-
isSelectedForAria:
|
|
886
|
-
flatIndex:
|
|
887
|
-
isActive:
|
|
888
|
-
registerRowRef:
|
|
889
|
-
onNavigationKeyDown:
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
939
|
+
setSize: o,
|
|
940
|
+
isSelectedForAria: l,
|
|
941
|
+
flatIndex: c,
|
|
942
|
+
isActive: d,
|
|
943
|
+
registerRowRef: j,
|
|
944
|
+
onNavigationKeyDown: S,
|
|
945
|
+
onRowFocus: f,
|
|
946
|
+
onRowBlur: p,
|
|
947
|
+
rowHeight: R,
|
|
948
|
+
entryKindDirectory: E,
|
|
949
|
+
entryKindFile: T,
|
|
950
|
+
isDirOpen: m,
|
|
951
|
+
parentIsLast: v,
|
|
952
|
+
renderChildren: k = !0,
|
|
953
|
+
expansion: { toggleDirectory: $, onToggleDirectoryRecursive: x },
|
|
954
|
+
selection: { onEntryClick: I, selectedPath: b, currentPath: W, mode: D = "none", selectedItems: C, onSelectionChange: X },
|
|
898
955
|
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:
|
|
956
|
+
iconOverrides: le,
|
|
957
|
+
showExpandIcons: q = !0,
|
|
958
|
+
showDirectoryIcons: Q = !0,
|
|
959
|
+
showFileIcons: oe = !0,
|
|
960
|
+
useCanvasExpandIcons: re = !1,
|
|
961
|
+
expandIconSize: H,
|
|
962
|
+
typeIconSize: ye,
|
|
963
|
+
fontSize: ce,
|
|
964
|
+
indentSize: ie = ct,
|
|
965
|
+
highlightStyles: G,
|
|
966
|
+
entryClassName: _,
|
|
967
|
+
entryStyle: s,
|
|
968
|
+
nameClassName: h,
|
|
969
|
+
nameStyle: g,
|
|
970
|
+
directoryNameClassName: N,
|
|
971
|
+
directoryNameStyle: se,
|
|
972
|
+
fileNameClassName: ue,
|
|
973
|
+
fileNameStyle: A,
|
|
974
|
+
expandIconClassName: ee,
|
|
975
|
+
expandIconStyle: be
|
|
917
976
|
}
|
|
918
977
|
}) => {
|
|
919
|
-
const [
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
}, [
|
|
923
|
-
const
|
|
924
|
-
if (
|
|
925
|
-
if (
|
|
926
|
-
return
|
|
927
|
-
} else if (
|
|
928
|
-
return
|
|
978
|
+
const [de, _e] = he(null), [Ie, ne] = he(!1), L = e.children !== void 0, fe = L && m(e.absolutePath), J = e.absolutePath === b, Se = e.absolutePath === W, K = !L && C?.has(e.absolutePath), Me = P((Y) => j(c, Y), [j, c]), je = L ? void 0 : Pe(e.name) || Pe(e.relativePath) || Pe(e.absolutePath);
|
|
979
|
+
ke(() => {
|
|
980
|
+
_e(fe && e.children ? e.children : null);
|
|
981
|
+
}, [fe, e.children]);
|
|
982
|
+
const B = Br({ entry: e, isDirectory: L, isExpanded: fe, isItemSelected: !!K, selectionMode: D, onSelectionChange: X, onEntryClick: I, toggleDirectory: $, onToggleDirectoryRecursive: x }), ut = Ie ? G?.hoverClassName !== void 0 ? G.hoverClassName : M.entryHover : "", $e = (() => {
|
|
983
|
+
if (L) {
|
|
984
|
+
if (J)
|
|
985
|
+
return G?.directorySelectedClassName !== void 0 ? G.directorySelectedClassName : M.entrySelected;
|
|
986
|
+
} else if (J || K)
|
|
987
|
+
return G?.itemSelectedClassName !== void 0 ? G.itemSelectedClassName : O(J && M.entrySelected, K && M.entryItemSelected);
|
|
929
988
|
return "";
|
|
930
|
-
})(),
|
|
931
|
-
...
|
|
932
|
-
...
|
|
933
|
-
...!
|
|
934
|
-
},
|
|
935
|
-
return /* @__PURE__ */
|
|
936
|
-
/* @__PURE__ */
|
|
989
|
+
})(), He = O(M.entry, ut, $e, _, e.className), Ue = O(M.expandIcon, ee, (J || K) && M.expandIconSelected), dt = O(M.typeIcon, (J || K) && M.typeIconSelected), Ce = O(M.name, h, L && M.nameDirectory, L && N, !L && ue, (J || K) && M.nameSelected), Ke = $r({ isDirectory: L, isExpanded: fe, showExpandIcons: q, useCanvasExpandIcons: re, expandIconSize: H }), Xe = (L ? Q : oe) ? Hr({ entry: e, isDirectory: L, isExpanded: fe, isSelected: J, isItemSelected: !!K, extension: je, mimeType: e.mimeType }, le) : null, Je = {
|
|
990
|
+
...Ie ? G?.hoverStyle : {},
|
|
991
|
+
...L && J ? G?.directorySelectedStyle : {},
|
|
992
|
+
...!L && (J || K) ? G?.itemSelectedStyle : {}
|
|
993
|
+
}, Ze = Wr(e.data), qe = ye ? { width: ye, height: ye } : void 0, We = ce ? { fontSize: typeof ce == "number" ? `${ce}px` : ce } : void 0;
|
|
994
|
+
return /* @__PURE__ */ i.jsxs(un, { children: [
|
|
995
|
+
/* @__PURE__ */ i.jsxs(
|
|
937
996
|
"div",
|
|
938
997
|
{
|
|
939
|
-
className:
|
|
998
|
+
className: He,
|
|
940
999
|
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
|
-
...
|
|
1000
|
+
paddingLeft: `${Math.max(0, t * ie)}px`,
|
|
1001
|
+
transform: t < 0 ? `translateX(${t * ie}px)` : void 0,
|
|
1002
|
+
width: t < 0 ? `calc(100% + ${Math.abs(t * ie)}px)` : void 0,
|
|
1003
|
+
height: `${R}px`,
|
|
1004
|
+
...We,
|
|
1005
|
+
...Je,
|
|
1006
|
+
...s,
|
|
948
1007
|
...e.style
|
|
949
1008
|
},
|
|
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
|
-
|
|
1009
|
+
...Ze,
|
|
1010
|
+
"data-entry-type": L ? "directory" : "file",
|
|
1011
|
+
"data-entry-expanded": L ? String(fe) : void 0,
|
|
1012
|
+
"data-entry-selected": J ? "true" : void 0,
|
|
1013
|
+
"data-entry-item-selected": K ? "true" : void 0,
|
|
1014
|
+
onClick: B,
|
|
1015
|
+
onMouseEnter: () => ne(!0),
|
|
1016
|
+
onMouseLeave: () => ne(!1),
|
|
1017
|
+
onFocus: (Y) => f(c, e.absolutePath, Y.currentTarget),
|
|
1018
|
+
onBlur: (Y) => p(e.absolutePath, Y.currentTarget),
|
|
1019
|
+
ref: Me,
|
|
1020
|
+
onKeyDown: (Y) => {
|
|
1021
|
+
if (Y.key === "Enter" || Y.key === " ") {
|
|
1022
|
+
Y.preventDefault(), Y.repeat || B(Y);
|
|
962
1023
|
return;
|
|
963
1024
|
}
|
|
964
|
-
|
|
1025
|
+
S(Y, c);
|
|
965
1026
|
},
|
|
966
|
-
tabIndex:
|
|
1027
|
+
tabIndex: d ? 0 : -1,
|
|
967
1028
|
role: "treeitem",
|
|
968
|
-
"aria-expanded":
|
|
969
|
-
"aria-level":
|
|
1029
|
+
"aria-expanded": L ? fe : void 0,
|
|
1030
|
+
"aria-level": r + 1,
|
|
970
1031
|
"aria-posinset": n,
|
|
971
|
-
"aria-setsize":
|
|
972
|
-
"aria-selected":
|
|
973
|
-
"aria-
|
|
1032
|
+
"aria-setsize": o,
|
|
1033
|
+
"aria-selected": D === "none" ? void 0 : l,
|
|
1034
|
+
"aria-current": Se ? "page" : void 0,
|
|
1035
|
+
"aria-label": `${e.name} (${L ? E : T})`,
|
|
974
1036
|
children: [
|
|
975
|
-
(
|
|
976
|
-
(
|
|
977
|
-
/* @__PURE__ */
|
|
1037
|
+
(q || re) && /* @__PURE__ */ i.jsx("span", { className: Ue, style: be, children: Ke }),
|
|
1038
|
+
(L ? Q : oe) && /* @__PURE__ */ i.jsx("span", { className: dt, style: qe, children: Xe }),
|
|
1039
|
+
/* @__PURE__ */ i.jsx(
|
|
978
1040
|
"span",
|
|
979
1041
|
{
|
|
980
|
-
className:
|
|
1042
|
+
className: Ce,
|
|
981
1043
|
style: {
|
|
982
|
-
...
|
|
983
|
-
...
|
|
984
|
-
...
|
|
1044
|
+
...We,
|
|
1045
|
+
...g,
|
|
1046
|
+
...L ? se : A
|
|
985
1047
|
},
|
|
986
|
-
"data-entry-type":
|
|
1048
|
+
"data-entry-type": L ? "directory" : "file",
|
|
987
1049
|
"data-entry-role": "name",
|
|
988
1050
|
children: e.label ?? e.name
|
|
989
1051
|
}
|
|
@@ -991,228 +1053,307 @@ const vn = {
|
|
|
991
1053
|
]
|
|
992
1054
|
}
|
|
993
1055
|
),
|
|
994
|
-
|
|
995
|
-
|
|
1056
|
+
fe && de && k && /* @__PURE__ */ i.jsx("fieldset", { children: de.map((Y, ve) => /* @__PURE__ */ i.jsx(
|
|
1057
|
+
_t,
|
|
996
1058
|
{
|
|
997
|
-
entry:
|
|
1059
|
+
entry: Y,
|
|
998
1060
|
indentLevel: t + 1,
|
|
999
|
-
depth:
|
|
1000
|
-
positionInSet:
|
|
1001
|
-
setSize:
|
|
1002
|
-
isSelectedForAria: !!
|
|
1061
|
+
depth: r + 1,
|
|
1062
|
+
positionInSet: ve + 1,
|
|
1063
|
+
setSize: de.length,
|
|
1064
|
+
isSelectedForAria: !!C?.has(Y.absolutePath),
|
|
1003
1065
|
flatIndex: -1,
|
|
1004
1066
|
isActive: !1,
|
|
1005
|
-
registerRowRef:
|
|
1006
|
-
onNavigationKeyDown:
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1067
|
+
registerRowRef: j,
|
|
1068
|
+
onNavigationKeyDown: S,
|
|
1069
|
+
onRowFocus: f,
|
|
1070
|
+
onRowBlur: p,
|
|
1071
|
+
rowHeight: R,
|
|
1072
|
+
entryKindDirectory: E,
|
|
1073
|
+
entryKindFile: T,
|
|
1074
|
+
isDirOpen: m,
|
|
1075
|
+
parentIsLast: [...v, ve === de.length - 1],
|
|
1076
|
+
expansion: { toggleDirectory: $, onToggleDirectoryRecursive: x },
|
|
1077
|
+
selection: { onEntryClick: I, selectedPath: b, currentPath: W, mode: D, selectedItems: C, onSelectionChange: X },
|
|
1014
1078
|
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:
|
|
1079
|
+
iconOverrides: le,
|
|
1080
|
+
showExpandIcons: q,
|
|
1081
|
+
showDirectoryIcons: Q,
|
|
1082
|
+
showFileIcons: oe,
|
|
1083
|
+
useCanvasExpandIcons: re,
|
|
1084
|
+
expandIconSize: H,
|
|
1085
|
+
highlightStyles: G,
|
|
1086
|
+
entryClassName: _,
|
|
1087
|
+
entryStyle: s,
|
|
1088
|
+
nameClassName: h,
|
|
1089
|
+
nameStyle: g,
|
|
1090
|
+
directoryNameClassName: N,
|
|
1091
|
+
directoryNameStyle: se,
|
|
1092
|
+
fileNameClassName: ue,
|
|
1093
|
+
fileNameStyle: A,
|
|
1094
|
+
expandIconClassName: ee,
|
|
1095
|
+
expandIconStyle: be
|
|
1030
1096
|
}
|
|
1031
1097
|
},
|
|
1032
|
-
|
|
1098
|
+
Y.absolutePath
|
|
1033
1099
|
)) })
|
|
1034
1100
|
] }, e.absolutePath);
|
|
1035
1101
|
},
|
|
1036
1102
|
(e, t) => {
|
|
1037
1103
|
if (e.entry !== t.entry) return !1;
|
|
1038
|
-
const
|
|
1104
|
+
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
1105
|
return e.indentLevel === t.indentLevel && // 位置情報は aria として描画されるため、変化したら再描画が必要
|
|
1040
1106
|
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 &&
|
|
1107
|
+
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
1108
|
}
|
|
1043
1109
|
);
|
|
1044
|
-
|
|
1045
|
-
const
|
|
1110
|
+
_t.displayName = "DirectoryEntryItem";
|
|
1111
|
+
const Zr = (e) => {
|
|
1046
1112
|
const t = [];
|
|
1047
1113
|
if (e.children)
|
|
1048
|
-
for (const
|
|
1049
|
-
|
|
1114
|
+
for (const r of e.children)
|
|
1115
|
+
r.type === "directory" && (t.push(r.absolutePath), t.push(...Zr(r)));
|
|
1050
1116
|
return t;
|
|
1051
|
-
},
|
|
1117
|
+
}, co = ({
|
|
1052
1118
|
entries: e,
|
|
1053
|
-
expansion: { toggle: t, isExpanded:
|
|
1054
|
-
selection: { onEntryClick:
|
|
1119
|
+
expansion: { toggle: t, isExpanded: r, expandMultiple: n, collapseMultiple: o, isPending: l, alwaysExpanded: c = !1, doubleClickAction: d = "recursive" },
|
|
1120
|
+
selection: { onEntryClick: j, selectedPath: S, currentPath: f, mode: p = "none", selectedItems: R, onSelectionChange: E },
|
|
1055
1121
|
visual: {
|
|
1056
|
-
className:
|
|
1057
|
-
style:
|
|
1058
|
-
ariaLabel:
|
|
1059
|
-
ariaLabelledBy:
|
|
1060
|
-
lineColor:
|
|
1061
|
-
showTreeLines:
|
|
1122
|
+
className: T,
|
|
1123
|
+
style: m,
|
|
1124
|
+
ariaLabel: v,
|
|
1125
|
+
ariaLabelledBy: k,
|
|
1126
|
+
lineColor: $ = "#A0AEC0",
|
|
1127
|
+
showTreeLines: x = !0,
|
|
1062
1128
|
showExpandIcons: I = !0,
|
|
1063
|
-
showDirectoryIcons:
|
|
1064
|
-
showFileIcons:
|
|
1065
|
-
iconOverrides:
|
|
1129
|
+
showDirectoryIcons: b = !0,
|
|
1130
|
+
showFileIcons: W = !0,
|
|
1131
|
+
iconOverrides: D,
|
|
1066
1132
|
expandIconSize: C,
|
|
1067
|
-
itemHeight:
|
|
1068
|
-
removeRootIndent:
|
|
1069
|
-
highlightStyles:
|
|
1070
|
-
entryClassName:
|
|
1071
|
-
entryStyle:
|
|
1072
|
-
nameClassName:
|
|
1073
|
-
nameStyle:
|
|
1074
|
-
directoryNameClassName:
|
|
1075
|
-
directoryNameStyle:
|
|
1076
|
-
fileNameClassName:
|
|
1077
|
-
fileNameStyle:
|
|
1133
|
+
itemHeight: X = lt,
|
|
1134
|
+
removeRootIndent: le = !1,
|
|
1135
|
+
highlightStyles: q,
|
|
1136
|
+
entryClassName: Q,
|
|
1137
|
+
entryStyle: oe,
|
|
1138
|
+
nameClassName: re,
|
|
1139
|
+
nameStyle: H,
|
|
1140
|
+
directoryNameClassName: ye,
|
|
1141
|
+
directoryNameStyle: ce,
|
|
1142
|
+
fileNameClassName: ie,
|
|
1143
|
+
fileNameStyle: G,
|
|
1144
|
+
expandIconClassName: _,
|
|
1145
|
+
expandIconStyle: s
|
|
1078
1146
|
} = {},
|
|
1079
|
-
virtualScroll:
|
|
1080
|
-
grid:
|
|
1081
|
-
sort:
|
|
1082
|
-
locale:
|
|
1083
|
-
labels:
|
|
1147
|
+
virtualScroll: h,
|
|
1148
|
+
grid: g,
|
|
1149
|
+
sort: N,
|
|
1150
|
+
locale: se,
|
|
1151
|
+
labels: ue,
|
|
1152
|
+
ref: A
|
|
1084
1153
|
}) => {
|
|
1085
|
-
const
|
|
1086
|
-
overscanCount:
|
|
1087
|
-
className:
|
|
1088
|
-
background:
|
|
1089
|
-
onScroll:
|
|
1090
|
-
onRangeChange:
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1154
|
+
const ee = Mr(se), be = U(() => Dn(se, ue), [se, ue]), de = Qn(Fn(be)), { entryKindDirectory: _e, entryKindFile: Ie } = be, ne = g !== void 0, [L, fe] = he(!1), J = z(null), Se = z(null), K = z(null), [Me, je] = he(0), [B, ut] = he(0), [$e, He] = he(0), [Ue, dt] = he(null), {
|
|
1155
|
+
overscanCount: Ce = 15,
|
|
1156
|
+
className: Ke,
|
|
1157
|
+
background: Xe,
|
|
1158
|
+
onScroll: Je,
|
|
1159
|
+
onRangeChange: Ze,
|
|
1160
|
+
onScrollAdjust: qe,
|
|
1161
|
+
liveRegion: We,
|
|
1162
|
+
initialScrollIndex: Y,
|
|
1163
|
+
initialScrollOffset: ve,
|
|
1164
|
+
initialScrollAnchor: Ct,
|
|
1165
|
+
callbackThrottleMs: At = 5,
|
|
1166
|
+
contentInsets: Ot,
|
|
1167
|
+
onItemFocus: Lt,
|
|
1168
|
+
viewportHeightOverride: ae,
|
|
1169
|
+
scrollBarOptions: ft,
|
|
1170
|
+
behaviorOptions: Dt,
|
|
1171
|
+
preserveScrollAnchor: Ft = !1,
|
|
1172
|
+
getItemKey: qr,
|
|
1102
1173
|
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1174
|
+
testId: Mt,
|
|
1175
|
+
contentProps: mt
|
|
1176
|
+
} = h ?? {}, $t = U(
|
|
1177
|
+
() => ne ? { ...mt, role: "rowgroup" } : { ...mt, role: "tree", "aria-label": k ? void 0 : v, "aria-labelledby": k, "aria-multiselectable": p === "multiple" ? !0 : void 0 },
|
|
1178
|
+
[ne, mt, v, k, p]
|
|
1179
|
+
), Ht = U(() => ({ ...Dt, enableKeyboardNavigation: !1 }), [Dt]), [Qe, Wt] = he(typeof ve == "number" ? ve : 0), ht = z(typeof ve == "number" ? ve : 0), Bt = P(
|
|
1180
|
+
(a, u) => {
|
|
1181
|
+
ht.current = a, Wt(a), Je?.(a, u);
|
|
1109
1182
|
},
|
|
1110
|
-
[
|
|
1111
|
-
),
|
|
1183
|
+
[Je]
|
|
1184
|
+
), zt = P(
|
|
1112
1185
|
(a) => {
|
|
1113
|
-
const { renderingStartIndex:
|
|
1114
|
-
|
|
1186
|
+
const { renderingStartIndex: u, renderingEndIndex: y } = a;
|
|
1187
|
+
dt((w) => w && w.renderStart === u && w.renderEnd === y ? w : { renderStart: u, renderEnd: y }), Ze?.(a);
|
|
1115
1188
|
},
|
|
1116
|
-
[
|
|
1189
|
+
[Ze]
|
|
1117
1190
|
);
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
}, []),
|
|
1121
|
-
const a =
|
|
1191
|
+
ke(() => {
|
|
1192
|
+
fe(!0), qn();
|
|
1193
|
+
}, []), ke(() => {
|
|
1194
|
+
const a = J.current, u = ne ? Se.current : a, y = () => {
|
|
1122
1195
|
if (a) {
|
|
1123
|
-
const
|
|
1124
|
-
|
|
1196
|
+
const F = a.clientWidth;
|
|
1197
|
+
ut((V) => Math.abs(V - F) > 1 ? F : V);
|
|
1125
1198
|
}
|
|
1126
|
-
if (typeof
|
|
1127
|
-
|
|
1128
|
-
else if (
|
|
1129
|
-
const
|
|
1130
|
-
|
|
1199
|
+
if (typeof ae == "number")
|
|
1200
|
+
je((F) => Math.abs(F - ae) > 1 ? ae : F);
|
|
1201
|
+
else if (u) {
|
|
1202
|
+
const F = u.clientHeight;
|
|
1203
|
+
je((V) => Math.abs(V - F) > 1 ? F : V);
|
|
1131
1204
|
}
|
|
1132
1205
|
};
|
|
1133
|
-
if (!(a ||
|
|
1134
|
-
|
|
1135
|
-
const
|
|
1136
|
-
return a &&
|
|
1137
|
-
}, [
|
|
1138
|
-
const
|
|
1206
|
+
if (!(a || u)) return je(0);
|
|
1207
|
+
y();
|
|
1208
|
+
const w = new ResizeObserver(y);
|
|
1209
|
+
return a && w.observe(a), u && u !== a && w.observe(u), () => w.disconnect();
|
|
1210
|
+
}, [ae, ne]);
|
|
1211
|
+
const Ae = typeof ae == "number" ? ae : Me, ge = P((a) => c || (L ? r(a) : !1), [L, r, c]), Gt = O(M.container, l && M.containerPending, T), Yt = U(
|
|
1139
1212
|
() => ({
|
|
1140
|
-
...
|
|
1141
|
-
...
|
|
1142
|
-
...typeof
|
|
1213
|
+
...Zn,
|
|
1214
|
+
...m ?? {},
|
|
1215
|
+
...typeof ae == "number" ? { height: ae, minHeight: ae } : {}
|
|
1143
1216
|
}),
|
|
1144
|
-
[
|
|
1145
|
-
),
|
|
1146
|
-
(a,
|
|
1147
|
-
const
|
|
1148
|
-
if (
|
|
1149
|
-
if (
|
|
1150
|
-
if (
|
|
1151
|
-
console.warn(`[DirectoryTree] Unknown double click action: ${
|
|
1217
|
+
[m, ae]
|
|
1218
|
+
), pt = P(
|
|
1219
|
+
(a, u) => {
|
|
1220
|
+
const y = [a.absolutePath, ...Zr(a)], w = u || d;
|
|
1221
|
+
if (y.every((me) => ge(me))) return o(y);
|
|
1222
|
+
if (y.every((me) => !ge(me)) || w === "recursive") return n(y);
|
|
1223
|
+
if (w === "toggle") return o(y);
|
|
1224
|
+
console.warn(`[DirectoryTree] Unknown double click action: ${w}. No action taken.`);
|
|
1152
1225
|
},
|
|
1153
|
-
[
|
|
1154
|
-
),
|
|
1155
|
-
() =>
|
|
1156
|
-
const
|
|
1157
|
-
return { ...a, rowHeight: Number.isFinite(
|
|
1226
|
+
[ge, n, o, d]
|
|
1227
|
+
), Vt = ne ? !1 : le, { flatItems: Ne, lineItems: yt, maxIndent: Ut } = U(() => to(e, ge, x, Vt, N), [e, ge, x, Vt, N]), Z = U(
|
|
1228
|
+
() => Ne.map((a, u) => {
|
|
1229
|
+
const y = typeof X == "function" ? X(a.entry, u) : X;
|
|
1230
|
+
return { ...a, rowHeight: Number.isFinite(y) && y > 0 ? y : lt };
|
|
1158
1231
|
}),
|
|
1159
|
-
[
|
|
1160
|
-
),
|
|
1161
|
-
const a = new Array(
|
|
1232
|
+
[Ne, X]
|
|
1233
|
+
), Ee = U(() => Z.map((a) => a.rowHeight), [Z]), xe = U(() => {
|
|
1234
|
+
const a = new Array(Ee.length + 1);
|
|
1162
1235
|
a[0] = 0;
|
|
1163
|
-
for (let
|
|
1164
|
-
a[
|
|
1236
|
+
for (let u = 0; u < Ee.length; u++)
|
|
1237
|
+
a[u + 1] = a[u] + Ee[u];
|
|
1165
1238
|
return a;
|
|
1166
|
-
}, [
|
|
1167
|
-
|
|
1168
|
-
const
|
|
1169
|
-
|
|
1170
|
-
const
|
|
1171
|
-
|
|
1172
|
-
const
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1239
|
+
}, [Ee]), Kt = P((a) => Z[a]?.rowHeight ?? lt, [Z]), Qr = P((a) => Z[a]?.entry.absolutePath ?? a, [Z]), Xt = qr ?? Qr, Oe = S ?? null, bt = f ?? null, [Jt, Be] = he(() => ({ selectedPath: Oe, selectionGeneration: 0, anchor: null })), gt = Or(Jt, Oe);
|
|
1240
|
+
gt !== Jt && Be((a) => Or(a, Oe));
|
|
1241
|
+
const et = U(() => Kn(Ne), [Ne]), Le = U(() => Jn(et, gt), [et, gt]), ze = z(/* @__PURE__ */ new Map()), tt = z(null), Ge = z(null), [en, Zt] = he(!0), vt = z(Ne);
|
|
1242
|
+
vt.current = Ne;
|
|
1243
|
+
const qt = z(ge);
|
|
1244
|
+
qt.current = ge;
|
|
1245
|
+
const xt = z(t);
|
|
1246
|
+
xt.current = t;
|
|
1247
|
+
const Qt = z(et);
|
|
1248
|
+
Qt.current = et;
|
|
1249
|
+
const er = z(xe);
|
|
1250
|
+
er.current = xe;
|
|
1251
|
+
const wt = z(Le);
|
|
1252
|
+
wt.current = Le;
|
|
1253
|
+
const tr = z(Lt);
|
|
1254
|
+
tr.current = Lt;
|
|
1255
|
+
const Te = P((a, u) => {
|
|
1256
|
+
const y = K.current, w = er.current;
|
|
1257
|
+
if (!y || a < 0 || a >= w.length - 1)
|
|
1258
|
+
return !1;
|
|
1259
|
+
const F = y.getScrollPosition(), V = y.getViewportSize();
|
|
1260
|
+
if (F < 0 || V <= 0)
|
|
1261
|
+
return !1;
|
|
1262
|
+
const me = Mn(w[a], w[a + 1], F, V, u);
|
|
1263
|
+
return me === null ? !1 : (y.scrollToIndex(a, { align: me }), !0);
|
|
1264
|
+
}, []), we = P(
|
|
1265
|
+
(a) => {
|
|
1266
|
+
const u = ze.current.get(a);
|
|
1267
|
+
if (u === void 0) {
|
|
1268
|
+
Ge.current = a, Te(a, "whole") || (Ge.current = null);
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1271
|
+
Ge.current = null, Te(a, "whole"), u.focus({ preventScroll: !0 });
|
|
1272
|
+
},
|
|
1273
|
+
[Te]
|
|
1274
|
+
), rr = P((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((y) => y.anchor === null ? y : { ...y, anchor: { ...y.anchor, focused: !0 } });
|
|
1277
|
+
else {
|
|
1278
|
+
const y = ze.current.get(a);
|
|
1279
|
+
ze.current.delete(a), y?.contains(y.ownerDocument.activeElement) && Be((w) => w.anchor === null ? w : { ...w, anchor: { ...w.anchor, focused: !1 } });
|
|
1180
1280
|
}
|
|
1181
|
-
|
|
1281
|
+
a === wt.current && Zt(u !== null);
|
|
1182
1282
|
}, []);
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
}, [
|
|
1186
|
-
const
|
|
1187
|
-
(a,
|
|
1188
|
-
const
|
|
1189
|
-
|
|
1190
|
-
|
|
1283
|
+
fr(() => {
|
|
1284
|
+
Zt(ze.current.has(Le));
|
|
1285
|
+
}, [Le]);
|
|
1286
|
+
const St = P(
|
|
1287
|
+
(a, u, y) => {
|
|
1288
|
+
const w = tt.current === y;
|
|
1289
|
+
tt.current = null, w || (Be((F) => Xn(F, u)), Te(a, "visible")), tr.current?.(a);
|
|
1290
|
+
},
|
|
1291
|
+
[Te]
|
|
1292
|
+
), Et = P((a, u) => {
|
|
1293
|
+
const { ownerDocument: y } = u;
|
|
1294
|
+
if (!y.hasFocus() && u.contains(y.activeElement)) {
|
|
1295
|
+
tt.current = u;
|
|
1296
|
+
return;
|
|
1297
|
+
}
|
|
1298
|
+
tt.current = null, Be((w) => w.anchor !== null && w.anchor.path === a ? { ...w, anchor: { ...w.anchor, focused: !1 } } : w);
|
|
1299
|
+
}, []), tn = P(() => we(wt.current), [we]), Rt = P(
|
|
1300
|
+
(a, u) => {
|
|
1301
|
+
const y = Dr(u), w = vt.current.length;
|
|
1302
|
+
if (!Number.isInteger(a) || a < 0 || a >= w)
|
|
1303
|
+
throw new RangeError(`[directory-tree] scrollToIndex: ${String(a)} is not a row index (${w === 0 ? "the tree has no rows" : `expected an integer in 0..${String(w - 1)}`}).`);
|
|
1304
|
+
if (y === "nearest") {
|
|
1305
|
+
Te(a, "whole");
|
|
1306
|
+
return;
|
|
1307
|
+
}
|
|
1308
|
+
K.current?.scrollToIndex(a, { align: y });
|
|
1309
|
+
},
|
|
1310
|
+
[Te]
|
|
1311
|
+
);
|
|
1312
|
+
cn(
|
|
1313
|
+
A,
|
|
1314
|
+
() => ({
|
|
1315
|
+
scrollToIndex: Rt,
|
|
1316
|
+
scrollToPath: (a, u) => {
|
|
1317
|
+
Dr(u);
|
|
1318
|
+
const y = Qt.current.get(a);
|
|
1319
|
+
return y === void 0 ? !1 : (Rt(y, u), !0);
|
|
1320
|
+
},
|
|
1321
|
+
getScrollAnchor: () => K.current?.getScrollAnchor() ?? null
|
|
1322
|
+
}),
|
|
1323
|
+
[Rt]
|
|
1324
|
+
);
|
|
1325
|
+
const nr = P(
|
|
1326
|
+
(a, u) => {
|
|
1327
|
+
if (a.altKey || a.ctrlKey || a.metaKey)
|
|
1328
|
+
return;
|
|
1329
|
+
const y = vt.current, w = y.length - 1;
|
|
1330
|
+
if (w < 0) return;
|
|
1331
|
+
const F = y[u], V = F?.entry.children !== void 0, me = V && qt.current(F.entry.absolutePath);
|
|
1191
1332
|
switch (a.key) {
|
|
1192
1333
|
case "ArrowDown":
|
|
1193
|
-
a.preventDefault(), we(Math.min(
|
|
1334
|
+
a.preventDefault(), we(Math.min(u + 1, w));
|
|
1194
1335
|
break;
|
|
1195
1336
|
case "ArrowUp":
|
|
1196
|
-
a.preventDefault(), we(Math.max(
|
|
1337
|
+
a.preventDefault(), we(Math.max(u - 1, 0));
|
|
1197
1338
|
break;
|
|
1198
1339
|
case "Home":
|
|
1199
1340
|
a.preventDefault(), we(0);
|
|
1200
1341
|
break;
|
|
1201
1342
|
case "End":
|
|
1202
|
-
a.preventDefault(), we(
|
|
1343
|
+
a.preventDefault(), we(w);
|
|
1203
1344
|
break;
|
|
1204
1345
|
case "ArrowRight":
|
|
1205
|
-
a.preventDefault(),
|
|
1346
|
+
a.preventDefault(), V && !me ? xt.current(F.entry.absolutePath) : V && u < w && y[u + 1].depth > F.depth && we(u + 1);
|
|
1206
1347
|
break;
|
|
1207
1348
|
case "ArrowLeft": {
|
|
1208
|
-
if (a.preventDefault(),
|
|
1209
|
-
|
|
1349
|
+
if (a.preventDefault(), V && me) {
|
|
1350
|
+
xt.current(F.entry.absolutePath);
|
|
1210
1351
|
break;
|
|
1211
1352
|
}
|
|
1212
|
-
const
|
|
1213
|
-
for (let
|
|
1214
|
-
if (
|
|
1215
|
-
we(
|
|
1353
|
+
const an = F?.depth ?? 0;
|
|
1354
|
+
for (let st = u - 1; st >= 0; st--)
|
|
1355
|
+
if (y[st].depth < an) {
|
|
1356
|
+
we(st);
|
|
1216
1357
|
break;
|
|
1217
1358
|
}
|
|
1218
1359
|
break;
|
|
@@ -1220,141 +1361,149 @@ const jr = (e) => {
|
|
|
1220
1361
|
}
|
|
1221
1362
|
},
|
|
1222
1363
|
[we]
|
|
1223
|
-
),
|
|
1224
|
-
() => !
|
|
1225
|
-
[
|
|
1226
|
-
),
|
|
1227
|
-
() =>
|
|
1228
|
-
[
|
|
1229
|
-
),
|
|
1230
|
-
|
|
1364
|
+
), rt = U(
|
|
1365
|
+
() => !x || yt.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : no(yt, Ee, xe, ct, x, C ?? Tr),
|
|
1366
|
+
[yt, Ee, xe, x, C]
|
|
1367
|
+
), nt = U(() => !x || e.length === 0 ? 0 : (Ut + 2) * ct, [e.length, Ut, x]), { renderStart: or, renderEnd: sr, lookaheadEnd: ar } = U(
|
|
1368
|
+
() => ro(Z.length, Ae, Ce, Ue, Qe, xe),
|
|
1369
|
+
[Z.length, Ae, Ce, Ue, Qe, xe]
|
|
1370
|
+
), kt = U(() => !x || nt <= 0 || Ae <= 0 || rt.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: nt, height: Ae }, children: /* @__PURE__ */ i.jsx(
|
|
1371
|
+
Jr,
|
|
1231
1372
|
{
|
|
1232
|
-
segmentsByItem:
|
|
1233
|
-
glyphsByItem:
|
|
1234
|
-
itemHeight:
|
|
1235
|
-
width:
|
|
1236
|
-
viewportHeight:
|
|
1237
|
-
scrollPosition:
|
|
1238
|
-
color:
|
|
1239
|
-
expandGlyphColor:
|
|
1240
|
-
expandGlyphSize: C ??
|
|
1241
|
-
renderStartIndex:
|
|
1242
|
-
renderEndIndex:
|
|
1243
|
-
lookaheadEndIndex:
|
|
1373
|
+
segmentsByItem: rt.segmentsByItem,
|
|
1374
|
+
glyphsByItem: rt.glyphsByItem,
|
|
1375
|
+
itemHeight: Ee[0] ?? lt,
|
|
1376
|
+
width: nt,
|
|
1377
|
+
viewportHeight: Ae,
|
|
1378
|
+
scrollPosition: Qe,
|
|
1379
|
+
color: $,
|
|
1380
|
+
expandGlyphColor: $,
|
|
1381
|
+
expandGlyphSize: C ?? Tr,
|
|
1382
|
+
renderStartIndex: or,
|
|
1383
|
+
renderEndIndex: sr,
|
|
1384
|
+
lookaheadEndIndex: ar
|
|
1244
1385
|
}
|
|
1245
|
-
) }) }), [
|
|
1246
|
-
|
|
1247
|
-
const a =
|
|
1248
|
-
if (
|
|
1386
|
+
) }) }), [nt, Ae, or, sr, ar, Qe, rt, $, x, C, Ee]), lr = P((a) => Z[a], [Z]), cr = z(null);
|
|
1387
|
+
fr(() => {
|
|
1388
|
+
const a = cr.current;
|
|
1389
|
+
if (cr.current = { items: Z, offsets: xe }, !Ft || !a || a.items === Z)
|
|
1249
1390
|
return;
|
|
1250
|
-
const
|
|
1251
|
-
if (!
|
|
1391
|
+
const u = K.current, y = u?.getScrollPosition(), w = typeof y == "number" && y >= 0 ? y : ht.current, F = Hn(a.items, a.offsets, w);
|
|
1392
|
+
if (!F)
|
|
1252
1393
|
return;
|
|
1253
|
-
const
|
|
1254
|
-
if (
|
|
1394
|
+
const V = Wn(F, Z, xe);
|
|
1395
|
+
if (V === null || Math.abs(V - w) < 1)
|
|
1255
1396
|
return;
|
|
1256
|
-
const
|
|
1257
|
-
|
|
1258
|
-
}, [
|
|
1259
|
-
const
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
}, [
|
|
1263
|
-
const
|
|
1264
|
-
() => ({ iconOverrides:
|
|
1265
|
-
[
|
|
1266
|
-
),
|
|
1267
|
-
() => /* @__PURE__ */
|
|
1268
|
-
|
|
1397
|
+
const me = u ? u.scrollTo(V) : V;
|
|
1398
|
+
ht.current = me, Wt(me);
|
|
1399
|
+
}, [Z, xe, Ft]);
|
|
1400
|
+
const Re = g?.columns, De = g?.scrollBarWidth ?? ft?.width ?? Kr, te = U(() => Re ? Cn({ measuredWidth: B, columns: Re, scrollBarWidth: De }) : null, [Re, B, De]), ot = U(() => Re ? _n(Re) : "", [Re]), rn = U(() => g?.showFooter && Re ? An(e) : [], [g?.showFooter, Re, e]), Fe = te?.maxHScroll ?? 0;
|
|
1401
|
+
ke(() => {
|
|
1402
|
+
He((a) => It(a, Fe));
|
|
1403
|
+
}, [Fe]);
|
|
1404
|
+
const ir = P((a) => He((u) => It(u + a, Fe)), [Fe]), ur = U(
|
|
1405
|
+
() => ({ iconOverrides: D, showExpandIcons: I, showDirectoryIcons: b, showFileIcons: W, useCanvasExpandIcons: x, expandIconSize: C, highlightStyles: q, expandIconClassName: _, expandIconStyle: s }),
|
|
1406
|
+
[D, I, b, W, x, C, q, _, s]
|
|
1407
|
+
), dr = U(
|
|
1408
|
+
() => /* @__PURE__ */ i.jsx(
|
|
1409
|
+
mn,
|
|
1269
1410
|
{
|
|
1270
|
-
ref:
|
|
1271
|
-
itemCount:
|
|
1272
|
-
getItem:
|
|
1273
|
-
getItemHeight:
|
|
1274
|
-
getItemKey:
|
|
1275
|
-
testId:
|
|
1276
|
-
contentProps:
|
|
1277
|
-
locale:
|
|
1411
|
+
ref: K,
|
|
1412
|
+
itemCount: Z.length,
|
|
1413
|
+
getItem: lr,
|
|
1414
|
+
getItemHeight: Kt,
|
|
1415
|
+
getItemKey: Xt,
|
|
1416
|
+
testId: Mt,
|
|
1417
|
+
contentProps: $t,
|
|
1418
|
+
locale: ee,
|
|
1278
1419
|
labels: de,
|
|
1279
|
-
viewportSize: typeof
|
|
1280
|
-
overscanCount:
|
|
1281
|
-
onScroll:
|
|
1282
|
-
onRangeChange:
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1420
|
+
viewportSize: typeof ae == "number" ? ae : void 0,
|
|
1421
|
+
overscanCount: Ce,
|
|
1422
|
+
onScroll: Bt,
|
|
1423
|
+
onRangeChange: zt,
|
|
1424
|
+
onScrollAdjust: qe,
|
|
1425
|
+
liveRegion: We,
|
|
1426
|
+
className: Ke,
|
|
1427
|
+
onWheelHorizontal: ne ? ir : 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: kt })
|
|
1432
|
+
) : kt,
|
|
1433
|
+
Xe
|
|
1291
1434
|
] }),
|
|
1292
|
-
initialScrollIndex:
|
|
1293
|
-
initialScrollOffset:
|
|
1294
|
-
initialScrollAnchor:
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
vr,
|
|
1435
|
+
initialScrollIndex: Y,
|
|
1436
|
+
initialScrollOffset: ve,
|
|
1437
|
+
initialScrollAnchor: Ct,
|
|
1438
|
+
callbackThrottleMs: At,
|
|
1439
|
+
contentInsets: Ot,
|
|
1440
|
+
scrollBarOptions: ft,
|
|
1441
|
+
behaviorOptions: Ht,
|
|
1442
|
+
children: (a, u) => a ? ne && g && te ? /* @__PURE__ */ i.jsx(
|
|
1443
|
+
Yr,
|
|
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: St,
|
|
1452
|
+
onRowBlur: Et,
|
|
1453
|
+
isSelectedForAria: !!R?.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: ge,
|
|
1456
|
+
columns: g.columns,
|
|
1457
|
+
numericTemplate: ot,
|
|
1458
|
+
numericTotal: te.numericTotal,
|
|
1459
|
+
nameWidth: te.nameWidth,
|
|
1460
|
+
rowClassName: g.rowClassName,
|
|
1461
|
+
selection: { onEntryClick: j, selectedPath: Oe, currentPath: bt, mode: p, selectedItems: R, onSelectionChange: E },
|
|
1462
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: pt },
|
|
1463
|
+
visual: ur
|
|
1319
1464
|
},
|
|
1320
1465
|
a.entry.absolutePath
|
|
1321
|
-
) : /* @__PURE__ */
|
|
1322
|
-
|
|
1466
|
+
) : /* @__PURE__ */ i.jsx(
|
|
1467
|
+
_t,
|
|
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: !!R?.has(a.entry.absolutePath),
|
|
1475
|
+
flatIndex: u,
|
|
1476
|
+
isActive: u === Le,
|
|
1477
|
+
registerRowRef: rr,
|
|
1478
|
+
onNavigationKeyDown: nr,
|
|
1479
|
+
onRowFocus: St,
|
|
1480
|
+
onRowBlur: Et,
|
|
1334
1481
|
rowHeight: a.rowHeight,
|
|
1335
|
-
entryKindDirectory:
|
|
1336
|
-
entryKindFile:
|
|
1337
|
-
isDirOpen:
|
|
1482
|
+
entryKindDirectory: _e,
|
|
1483
|
+
entryKindFile: Ie,
|
|
1484
|
+
isDirOpen: ge,
|
|
1338
1485
|
parentIsLast: a.parentIsLast,
|
|
1339
1486
|
renderChildren: !1,
|
|
1340
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1341
|
-
selection: { onEntryClick:
|
|
1487
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: pt },
|
|
1488
|
+
selection: { onEntryClick: j, selectedPath: Oe, currentPath: bt, mode: p, selectedItems: R, onSelectionChange: E },
|
|
1342
1489
|
visual: {
|
|
1343
|
-
iconOverrides:
|
|
1490
|
+
iconOverrides: D,
|
|
1344
1491
|
showExpandIcons: I,
|
|
1345
|
-
showDirectoryIcons:
|
|
1346
|
-
showFileIcons:
|
|
1347
|
-
useCanvasExpandIcons:
|
|
1492
|
+
showDirectoryIcons: b,
|
|
1493
|
+
showFileIcons: W,
|
|
1494
|
+
useCanvasExpandIcons: x,
|
|
1348
1495
|
expandIconSize: C,
|
|
1349
|
-
highlightStyles:
|
|
1350
|
-
entryClassName:
|
|
1351
|
-
entryStyle:
|
|
1352
|
-
nameClassName:
|
|
1353
|
-
nameStyle:
|
|
1354
|
-
directoryNameClassName:
|
|
1355
|
-
directoryNameStyle:
|
|
1356
|
-
fileNameClassName:
|
|
1357
|
-
fileNameStyle:
|
|
1496
|
+
highlightStyles: q,
|
|
1497
|
+
entryClassName: Q,
|
|
1498
|
+
entryStyle: oe,
|
|
1499
|
+
nameClassName: re,
|
|
1500
|
+
nameStyle: H,
|
|
1501
|
+
directoryNameClassName: ye,
|
|
1502
|
+
directoryNameStyle: ce,
|
|
1503
|
+
fileNameClassName: ie,
|
|
1504
|
+
fileNameStyle: G,
|
|
1505
|
+
expandIconClassName: _,
|
|
1506
|
+
expandIconStyle: s
|
|
1358
1507
|
}
|
|
1359
1508
|
},
|
|
1360
1509
|
a.entry.absolutePath
|
|
@@ -1362,202 +1511,213 @@ const jr = (e) => {
|
|
|
1362
1511
|
}
|
|
1363
1512
|
),
|
|
1364
1513
|
[
|
|
1365
|
-
|
|
1514
|
+
Z.length,
|
|
1515
|
+
lr,
|
|
1516
|
+
Kt,
|
|
1517
|
+
Xt,
|
|
1518
|
+
Mt,
|
|
1366
1519
|
$t,
|
|
1367
|
-
|
|
1368
|
-
Tt,
|
|
1369
|
-
vt,
|
|
1370
|
-
gt,
|
|
1371
|
-
_,
|
|
1520
|
+
ee,
|
|
1372
1521
|
de,
|
|
1373
|
-
|
|
1522
|
+
_e,
|
|
1523
|
+
Ie,
|
|
1524
|
+
Le,
|
|
1525
|
+
rr,
|
|
1526
|
+
nr,
|
|
1527
|
+
St,
|
|
1528
|
+
Et,
|
|
1374
1529
|
ae,
|
|
1530
|
+
Ce,
|
|
1531
|
+
Bt,
|
|
1532
|
+
zt,
|
|
1533
|
+
qe,
|
|
1534
|
+
We,
|
|
1535
|
+
Ke,
|
|
1536
|
+
ne,
|
|
1537
|
+
ir,
|
|
1538
|
+
te,
|
|
1539
|
+
kt,
|
|
1540
|
+
Xe,
|
|
1541
|
+
Y,
|
|
1542
|
+
ve,
|
|
1543
|
+
Ct,
|
|
1375
1544
|
At,
|
|
1376
1545
|
Ot,
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
Wt,
|
|
1385
|
-
ee,
|
|
1386
|
-
at,
|
|
1387
|
-
$e,
|
|
1388
|
-
Pe,
|
|
1389
|
-
je,
|
|
1390
|
-
mt,
|
|
1391
|
-
yt,
|
|
1392
|
-
ht,
|
|
1393
|
-
pt,
|
|
1394
|
-
qe,
|
|
1546
|
+
ft,
|
|
1547
|
+
Ht,
|
|
1548
|
+
g,
|
|
1549
|
+
ot,
|
|
1550
|
+
ge,
|
|
1551
|
+
j,
|
|
1552
|
+
Oe,
|
|
1395
1553
|
bt,
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
S,
|
|
1400
|
-
x,
|
|
1401
|
-
d,
|
|
1402
|
-
m,
|
|
1403
|
-
v,
|
|
1554
|
+
p,
|
|
1555
|
+
R,
|
|
1556
|
+
E,
|
|
1404
1557
|
t,
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1558
|
+
pt,
|
|
1559
|
+
ur,
|
|
1560
|
+
D,
|
|
1408
1561
|
I,
|
|
1409
|
-
|
|
1410
|
-
h,
|
|
1411
|
-
N,
|
|
1412
|
-
C,
|
|
1413
|
-
J,
|
|
1562
|
+
b,
|
|
1414
1563
|
W,
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1564
|
+
x,
|
|
1565
|
+
C,
|
|
1566
|
+
q,
|
|
1567
|
+
Q,
|
|
1568
|
+
oe,
|
|
1569
|
+
re,
|
|
1570
|
+
H,
|
|
1571
|
+
ye,
|
|
1572
|
+
ce,
|
|
1573
|
+
ie,
|
|
1574
|
+
G,
|
|
1575
|
+
_,
|
|
1576
|
+
s
|
|
1422
1577
|
]
|
|
1423
1578
|
);
|
|
1424
|
-
if (!(
|
|
1425
|
-
return /* @__PURE__ */
|
|
1426
|
-
|
|
1427
|
-
|
|
1579
|
+
if (!(g && te))
|
|
1580
|
+
return /* @__PURE__ */ i.jsxs("div", { ref: J, className: Gt, style: Yt, children: [
|
|
1581
|
+
Ne.length > 0 && !en && // 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: eo, onFocus: tn }),
|
|
1584
|
+
dr
|
|
1585
|
+
] });
|
|
1586
|
+
const nn = g.showHeader ?? !0, on = g.showFooter ?? !1, sn = { ...Yt, "--dt-hscroll": `${$e}px` };
|
|
1587
|
+
return /* @__PURE__ */ i.jsxs(
|
|
1428
1588
|
"div",
|
|
1429
1589
|
{
|
|
1430
|
-
ref:
|
|
1431
|
-
className:
|
|
1432
|
-
style:
|
|
1590
|
+
ref: J,
|
|
1591
|
+
className: O(Gt, "dt-grid"),
|
|
1592
|
+
style: sn,
|
|
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": Z.length + (g.showHeader ?? !0 ? 1 : 0),
|
|
1438
1598
|
children: [
|
|
1439
|
-
|
|
1440
|
-
/* @__PURE__ */
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
/* @__PURE__ */
|
|
1445
|
-
|
|
1599
|
+
nn && // biome-ignore lint/a11y/useSemanticElements: 仮想スクロールの treegrid は絶対配置行を使うため native table 要素にできない。ARIA ロールで意味を提供する
|
|
1600
|
+
/* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(Nn, { columns: g.columns, numericTemplate: ot, numericTotal: te.numericTotal, nameWidth: te.nameWidth, scrollBarWidth: De, className: g.headerClassName }) }),
|
|
1601
|
+
/* @__PURE__ */ i.jsx("div", { ref: Se, className: "dt-grid-body", children: dr }),
|
|
1602
|
+
Fe > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
|
|
1603
|
+
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: te.nameWidth }, "aria-hidden": "true" }),
|
|
1604
|
+
/* @__PURE__ */ i.jsx(
|
|
1605
|
+
hn,
|
|
1446
1606
|
{
|
|
1447
1607
|
horizontal: !0,
|
|
1448
|
-
contentSize:
|
|
1449
|
-
viewportSize:
|
|
1450
|
-
scrollPosition:
|
|
1451
|
-
scrollBarWidth:
|
|
1452
|
-
locale:
|
|
1608
|
+
contentSize: te.numericTotal,
|
|
1609
|
+
viewportSize: te.numericVisible,
|
|
1610
|
+
scrollPosition: $e,
|
|
1611
|
+
scrollBarWidth: De,
|
|
1612
|
+
locale: ee,
|
|
1453
1613
|
labels: de,
|
|
1454
1614
|
onScroll: (a) => {
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1615
|
+
const u = typeof a == "function" ? a($e) : a, y = It(u, Fe);
|
|
1616
|
+
return He(y), y;
|
|
1457
1617
|
}
|
|
1458
1618
|
}
|
|
1459
1619
|
),
|
|
1460
|
-
/* @__PURE__ */
|
|
1620
|
+
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: De }, "aria-hidden": "true" })
|
|
1461
1621
|
] }),
|
|
1462
|
-
|
|
1463
|
-
/* @__PURE__ */
|
|
1622
|
+
on && // biome-ignore lint/a11y/useSemanticElements: 同上 (フッタ行も絶対配置レイアウトの一部)
|
|
1623
|
+
/* @__PURE__ */ i.jsx("div", { role: "rowgroup", children: /* @__PURE__ */ i.jsx(Tn, { columns: g.columns, numericTemplate: ot, numericTotal: te.numericTotal, nameWidth: te.nameWidth, scrollBarWidth: De, allEntries: rn, className: g.footerClassName }) })
|
|
1464
1624
|
]
|
|
1465
1625
|
}
|
|
1466
1626
|
);
|
|
1467
|
-
},
|
|
1468
|
-
const [
|
|
1627
|
+
}, io = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
|
|
1628
|
+
const [r, n] = dn(), [o, l] = he(() => {
|
|
1469
1629
|
if (typeof window < "u" && t)
|
|
1470
1630
|
try {
|
|
1471
|
-
const
|
|
1472
|
-
if (
|
|
1473
|
-
const
|
|
1474
|
-
return new Set(
|
|
1631
|
+
const m = window.localStorage.getItem(t);
|
|
1632
|
+
if (m) {
|
|
1633
|
+
const v = JSON.parse(m);
|
|
1634
|
+
return new Set(v);
|
|
1475
1635
|
}
|
|
1476
|
-
} catch (
|
|
1477
|
-
console.error("[useDirectoryTreeState] Error reading from localStorage",
|
|
1636
|
+
} catch (m) {
|
|
1637
|
+
console.error("[useDirectoryTreeState] Error reading from localStorage", m);
|
|
1478
1638
|
}
|
|
1479
1639
|
return e;
|
|
1480
|
-
}),
|
|
1640
|
+
}), c = P((m) => {
|
|
1481
1641
|
n(() => {
|
|
1482
|
-
|
|
1483
|
-
const
|
|
1484
|
-
return
|
|
1642
|
+
l((v) => {
|
|
1643
|
+
const k = new Set(v);
|
|
1644
|
+
return m(k), k;
|
|
1485
1645
|
});
|
|
1486
1646
|
});
|
|
1487
|
-
}, []),
|
|
1488
|
-
(
|
|
1489
|
-
|
|
1490
|
-
for (const
|
|
1491
|
-
|
|
1647
|
+
}, []), d = P(
|
|
1648
|
+
(m, v) => {
|
|
1649
|
+
c((k) => {
|
|
1650
|
+
for (const $ of m)
|
|
1651
|
+
v(k, $);
|
|
1492
1652
|
});
|
|
1493
1653
|
},
|
|
1494
|
-
[
|
|
1654
|
+
[c]
|
|
1495
1655
|
);
|
|
1496
|
-
|
|
1656
|
+
ke(() => {
|
|
1497
1657
|
if (t && typeof window < "u")
|
|
1498
1658
|
try {
|
|
1499
|
-
window.localStorage.setItem(t, JSON.stringify(Array.from(
|
|
1500
|
-
} catch (
|
|
1501
|
-
console.warn(`Error setting localStorage key "${t}":`,
|
|
1659
|
+
window.localStorage.setItem(t, JSON.stringify(Array.from(o)));
|
|
1660
|
+
} catch (m) {
|
|
1661
|
+
console.warn(`Error setting localStorage key "${t}":`, m);
|
|
1502
1662
|
}
|
|
1503
|
-
}, [
|
|
1504
|
-
const
|
|
1505
|
-
(
|
|
1506
|
-
|
|
1507
|
-
|
|
1663
|
+
}, [o, t]);
|
|
1664
|
+
const j = P(
|
|
1665
|
+
(m) => {
|
|
1666
|
+
d([m], (v, k) => {
|
|
1667
|
+
v.has(k) ? v.delete(k) : v.add(k);
|
|
1508
1668
|
});
|
|
1509
1669
|
},
|
|
1510
|
-
[
|
|
1511
|
-
),
|
|
1512
|
-
(
|
|
1513
|
-
|
|
1514
|
-
|
|
1670
|
+
[d]
|
|
1671
|
+
), S = P(
|
|
1672
|
+
(m) => {
|
|
1673
|
+
d([m], (v, k) => {
|
|
1674
|
+
v.add(k);
|
|
1515
1675
|
});
|
|
1516
1676
|
},
|
|
1517
|
-
[
|
|
1518
|
-
),
|
|
1519
|
-
(
|
|
1520
|
-
|
|
1521
|
-
|
|
1677
|
+
[d]
|
|
1678
|
+
), f = P(
|
|
1679
|
+
(m) => {
|
|
1680
|
+
d([m], (v, k) => {
|
|
1681
|
+
v.delete(k);
|
|
1522
1682
|
});
|
|
1523
1683
|
},
|
|
1524
|
-
[
|
|
1525
|
-
),
|
|
1526
|
-
(
|
|
1527
|
-
|
|
1528
|
-
|
|
1684
|
+
[d]
|
|
1685
|
+
), p = P(
|
|
1686
|
+
(m) => {
|
|
1687
|
+
d(m, (v, k) => {
|
|
1688
|
+
v.delete(k);
|
|
1529
1689
|
});
|
|
1530
1690
|
},
|
|
1531
|
-
[
|
|
1532
|
-
),
|
|
1533
|
-
(
|
|
1534
|
-
|
|
1535
|
-
|
|
1691
|
+
[d]
|
|
1692
|
+
), R = P(
|
|
1693
|
+
(m) => {
|
|
1694
|
+
d(m, (v, k) => {
|
|
1695
|
+
v.add(k);
|
|
1536
1696
|
});
|
|
1537
1697
|
},
|
|
1538
|
-
[
|
|
1539
|
-
),
|
|
1540
|
-
|
|
1541
|
-
|
|
1698
|
+
[d]
|
|
1699
|
+
), E = P(() => {
|
|
1700
|
+
c((m) => {
|
|
1701
|
+
m.clear();
|
|
1542
1702
|
});
|
|
1543
|
-
}, [
|
|
1703
|
+
}, [c]), T = P((m) => o.has(m), [o]);
|
|
1544
1704
|
return {
|
|
1545
|
-
expanded:
|
|
1546
|
-
toggle:
|
|
1547
|
-
expand:
|
|
1548
|
-
collapse:
|
|
1549
|
-
collapseMultiple:
|
|
1550
|
-
expandMultiple:
|
|
1551
|
-
collapseAll:
|
|
1552
|
-
isExpanded:
|
|
1553
|
-
isPending:
|
|
1705
|
+
expanded: o,
|
|
1706
|
+
toggle: j,
|
|
1707
|
+
expand: S,
|
|
1708
|
+
collapse: f,
|
|
1709
|
+
collapseMultiple: p,
|
|
1710
|
+
expandMultiple: R,
|
|
1711
|
+
collapseAll: E,
|
|
1712
|
+
isExpanded: T,
|
|
1713
|
+
isPending: r
|
|
1554
1714
|
};
|
|
1555
1715
|
};
|
|
1556
1716
|
export {
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1717
|
+
On as DIRECTORY_TREE_LABEL_CATALOGS,
|
|
1718
|
+
Cr as DIRECTORY_TREE_LABEL_KEYS,
|
|
1719
|
+
co as DirectoryTree,
|
|
1560
1720
|
M as directoryTreeClasses,
|
|
1561
|
-
|
|
1562
|
-
|
|
1721
|
+
Dn as resolveDirectoryTreeLabels,
|
|
1722
|
+
io as useDirectoryTreeState
|
|
1563
1723
|
};
|