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