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