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