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