@aiquants/directory-tree 3.4.0 → 3.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DirectoryTree.d.ts.map +1 -1
- package/dist/DirectoryTreeGrid.d.ts +4 -0
- package/dist/DirectoryTreeGrid.d.ts.map +1 -1
- package/dist/entryRendering.d.ts +17 -0
- package/dist/entryRendering.d.ts.map +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.js +800 -765
- package/dist/styles/directory-tree.standalone.css +1 -1
- package/dist/types.d.ts +28 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/DirectoryTree.spec.md +23 -4
- package/src/DirectoryTree.tsx +45 -3
- package/src/DirectoryTreeGrid.tsx +12 -1
- package/src/entryRendering.tsx +46 -0
- package/src/types.ts +28 -0
package/dist/index.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { VirtualScroll as
|
|
3
|
-
import { twMerge as
|
|
4
|
-
import { FolderIcon as
|
|
5
|
-
import { FileMd as
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
1
|
+
import sr, { useRef as de, useEffect as ue, useCallback as W, memo as qe, useState as ae, useMemo as q, useLayoutEffect as ar, Fragment as or, useTransition as lr } from "react";
|
|
2
|
+
import { VirtualScroll as ir, ScrollBar as cr } from "@aiquants/virtualscroll";
|
|
3
|
+
import { twMerge as _ } from "tailwind-merge";
|
|
4
|
+
import { FolderIcon as dr, ChevronDownIcon as ur, ChevronRightIcon as mr } from "@heroicons/react/24/solid";
|
|
5
|
+
import { FileMd as wt, FilePdf as kt, FileXls as Nt, FileCsv as St, FileDoc as Et, FilePpt as It, FileImage as jt, FileAudio as Tt, FileVideo as Ct, FileZip as Rt, FileCode as Pt, FileText as _t, FileIcon as fr } from "@phosphor-icons/react";
|
|
6
|
+
var De = { exports: {} }, Ie = {};
|
|
7
|
+
var At;
|
|
8
|
+
function hr() {
|
|
9
|
+
if (At) return Ie;
|
|
10
|
+
At = 1;
|
|
11
11
|
var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), t = /* @__PURE__ */ Symbol.for("react.fragment");
|
|
12
|
-
function a(
|
|
12
|
+
function a(n, r, o) {
|
|
13
13
|
var l = null;
|
|
14
14
|
if (o !== void 0 && (l = "" + o), r.key !== void 0 && (l = "" + r.key), "key" in r) {
|
|
15
15
|
o = {};
|
|
16
|
-
for (var
|
|
17
|
-
|
|
16
|
+
for (var m in r)
|
|
17
|
+
m !== "key" && (o[m] = r[m]);
|
|
18
18
|
} else o = r;
|
|
19
19
|
return r = o.ref, {
|
|
20
20
|
$$typeof: e,
|
|
21
|
-
type:
|
|
21
|
+
type: n,
|
|
22
22
|
key: l,
|
|
23
23
|
ref: r !== void 0 ? r : null,
|
|
24
24
|
props: o
|
|
@@ -26,270 +26,270 @@ function ur() {
|
|
|
26
26
|
}
|
|
27
27
|
return Ie.Fragment = t, Ie.jsx = a, Ie.jsxs = a, Ie;
|
|
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 Mt;
|
|
31
|
+
function pr() {
|
|
32
|
+
return Mt || (Mt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
33
|
+
function e(s) {
|
|
34
|
+
if (s == null) return null;
|
|
35
|
+
if (typeof s == "function")
|
|
36
|
+
return s.$$typeof === K ? null : s.displayName || s.name || null;
|
|
37
|
+
if (typeof s == "string") return s;
|
|
38
|
+
switch (s) {
|
|
39
|
+
case h:
|
|
40
40
|
return "Fragment";
|
|
41
|
-
case
|
|
41
|
+
case M:
|
|
42
42
|
return "Profiler";
|
|
43
43
|
case v:
|
|
44
44
|
return "StrictMode";
|
|
45
|
-
case
|
|
45
|
+
case O:
|
|
46
46
|
return "Suspense";
|
|
47
|
-
case
|
|
47
|
+
case D:
|
|
48
48
|
return "SuspenseList";
|
|
49
|
-
case
|
|
49
|
+
case Z:
|
|
50
50
|
return "Activity";
|
|
51
51
|
}
|
|
52
|
-
if (typeof
|
|
53
|
-
switch (typeof
|
|
52
|
+
if (typeof s == "object")
|
|
53
|
+
switch (typeof s.tag == "number" && console.error(
|
|
54
54
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
55
|
-
),
|
|
56
|
-
case
|
|
55
|
+
), s.$$typeof) {
|
|
56
|
+
case f:
|
|
57
57
|
return "Portal";
|
|
58
58
|
case b:
|
|
59
|
-
return
|
|
59
|
+
return s.displayName || "Context";
|
|
60
60
|
case N:
|
|
61
|
-
return (
|
|
62
|
-
case
|
|
63
|
-
var
|
|
64
|
-
return
|
|
61
|
+
return (s._context.displayName || "Context") + ".Consumer";
|
|
62
|
+
case p:
|
|
63
|
+
var u = s.render;
|
|
64
|
+
return s = s.displayName, s || (s = u.displayName || u.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
65
65
|
case L:
|
|
66
|
-
return
|
|
67
|
-
case
|
|
68
|
-
|
|
66
|
+
return u = s.displayName || null, u !== null ? u : e(s.type) || "Memo";
|
|
67
|
+
case j:
|
|
68
|
+
u = s._payload, s = s._init;
|
|
69
69
|
try {
|
|
70
|
-
return e(
|
|
70
|
+
return e(s(u));
|
|
71
71
|
} catch {
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
return null;
|
|
75
75
|
}
|
|
76
|
-
function t(
|
|
77
|
-
return "" +
|
|
76
|
+
function t(s) {
|
|
77
|
+
return "" + s;
|
|
78
78
|
}
|
|
79
|
-
function a(
|
|
79
|
+
function a(s) {
|
|
80
80
|
try {
|
|
81
|
-
t(
|
|
82
|
-
var
|
|
81
|
+
t(s);
|
|
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 w = u.error, E = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
89
|
+
return w.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
|
+
E
|
|
93
|
+
), t(s);
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
function s
|
|
97
|
-
if (
|
|
98
|
-
if (typeof
|
|
96
|
+
function n(s) {
|
|
97
|
+
if (s === h) return "<>";
|
|
98
|
+
if (typeof s == "object" && s !== null && s.$$typeof === j)
|
|
99
99
|
return "<...>";
|
|
100
100
|
try {
|
|
101
|
-
var
|
|
102
|
-
return
|
|
101
|
+
var u = e(s);
|
|
102
|
+
return u ? "<" + u + ">" : "<...>";
|
|
103
103
|
} catch {
|
|
104
104
|
return "<...>";
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
function r() {
|
|
108
|
-
var
|
|
109
|
-
return
|
|
108
|
+
var s = R.A;
|
|
109
|
+
return s === null ? null : s.getOwner();
|
|
110
110
|
}
|
|
111
111
|
function o() {
|
|
112
112
|
return Error("react-stack-top-frame");
|
|
113
113
|
}
|
|
114
|
-
function l(
|
|
115
|
-
if (
|
|
116
|
-
var
|
|
117
|
-
if (
|
|
114
|
+
function l(s) {
|
|
115
|
+
if (z.call(s, "key")) {
|
|
116
|
+
var u = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
117
|
+
if (u && u.isReactWarning) return !1;
|
|
118
118
|
}
|
|
119
|
-
return
|
|
119
|
+
return s.key !== void 0;
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
function
|
|
123
|
-
|
|
121
|
+
function m(s, u) {
|
|
122
|
+
function w() {
|
|
123
|
+
te || (te = !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
|
+
w.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
129
|
+
get: w,
|
|
130
130
|
configurable: !0
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
134
|
-
var
|
|
135
|
-
return
|
|
133
|
+
function I() {
|
|
134
|
+
var s = e(this.type);
|
|
135
|
+
return re[s] || (re[s] = !0, console.error(
|
|
136
136
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
137
|
-
)),
|
|
137
|
+
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
138
138
|
}
|
|
139
|
-
function x(
|
|
140
|
-
var
|
|
141
|
-
return
|
|
142
|
-
$$typeof:
|
|
143
|
-
type:
|
|
144
|
-
key:
|
|
145
|
-
props:
|
|
146
|
-
_owner:
|
|
147
|
-
}, (
|
|
139
|
+
function x(s, u, w, E, B, le) {
|
|
140
|
+
var T = w.ref;
|
|
141
|
+
return s = {
|
|
142
|
+
$$typeof: S,
|
|
143
|
+
type: s,
|
|
144
|
+
key: u,
|
|
145
|
+
props: w,
|
|
146
|
+
_owner: E
|
|
147
|
+
}, (T !== void 0 ? T : null) !== null ? Object.defineProperty(s, "ref", {
|
|
148
148
|
enumerable: !1,
|
|
149
|
-
get:
|
|
150
|
-
}) : Object.defineProperty(
|
|
149
|
+
get: I
|
|
150
|
+
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
151
151
|
configurable: !1,
|
|
152
152
|
enumerable: !1,
|
|
153
153
|
writable: !0,
|
|
154
154
|
value: 0
|
|
155
|
-
}), Object.defineProperty(
|
|
155
|
+
}), Object.defineProperty(s, "_debugInfo", {
|
|
156
156
|
configurable: !1,
|
|
157
157
|
enumerable: !1,
|
|
158
158
|
writable: !0,
|
|
159
159
|
value: null
|
|
160
|
-
}), Object.defineProperty(
|
|
160
|
+
}), Object.defineProperty(s, "_debugStack", {
|
|
161
161
|
configurable: !1,
|
|
162
162
|
enumerable: !1,
|
|
163
163
|
writable: !0,
|
|
164
|
-
value:
|
|
165
|
-
}), Object.defineProperty(
|
|
164
|
+
value: B
|
|
165
|
+
}), Object.defineProperty(s, "_debugTask", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
168
168
|
writable: !0,
|
|
169
|
-
value:
|
|
170
|
-
}), Object.freeze && (Object.freeze(
|
|
169
|
+
value: le
|
|
170
|
+
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
171
171
|
}
|
|
172
|
-
function c(
|
|
173
|
-
var
|
|
174
|
-
if (
|
|
175
|
-
if (
|
|
176
|
-
if (
|
|
177
|
-
for (
|
|
178
|
-
y(
|
|
179
|
-
Object.freeze && Object.freeze(
|
|
172
|
+
function c(s, u, w, E, B, le) {
|
|
173
|
+
var T = u.children;
|
|
174
|
+
if (T !== void 0)
|
|
175
|
+
if (E)
|
|
176
|
+
if (F(T)) {
|
|
177
|
+
for (E = 0; E < T.length; E++)
|
|
178
|
+
y(T[E]);
|
|
179
|
+
Object.freeze && Object.freeze(T);
|
|
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 y(
|
|
185
|
-
if (
|
|
186
|
-
|
|
187
|
-
var
|
|
188
|
-
return
|
|
184
|
+
else y(T);
|
|
185
|
+
if (z.call(u, "key")) {
|
|
186
|
+
T = e(s);
|
|
187
|
+
var V = Object.keys(u).filter(function(ie) {
|
|
188
|
+
return ie !== "key";
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
E = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", G[T + E] || (V = 0 < V.length ? "{" + V.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
|
+
E,
|
|
198
|
+
T,
|
|
199
|
+
V,
|
|
200
|
+
T
|
|
201
|
+
), G[T + E] = !0);
|
|
202
202
|
}
|
|
203
|
-
if (
|
|
204
|
-
|
|
205
|
-
for (var
|
|
206
|
-
|
|
207
|
-
} else
|
|
208
|
-
return
|
|
209
|
-
|
|
210
|
-
typeof
|
|
203
|
+
if (T = null, w !== void 0 && (a(w), T = "" + w), l(u) && (a(u.key), T = "" + u.key), "key" in u) {
|
|
204
|
+
w = {};
|
|
205
|
+
for (var ne in u)
|
|
206
|
+
ne !== "key" && (w[ne] = u[ne]);
|
|
207
|
+
} else w = u;
|
|
208
|
+
return T && m(
|
|
209
|
+
w,
|
|
210
|
+
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
211
211
|
), x(
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
212
|
+
s,
|
|
213
|
+
T,
|
|
214
|
+
w,
|
|
215
215
|
r(),
|
|
216
|
-
|
|
217
|
-
|
|
216
|
+
B,
|
|
217
|
+
le
|
|
218
218
|
);
|
|
219
219
|
}
|
|
220
|
-
function y(
|
|
221
|
-
|
|
220
|
+
function y(s) {
|
|
221
|
+
k(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === j && (s._payload.status === "fulfilled" ? k(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return typeof
|
|
223
|
+
function k(s) {
|
|
224
|
+
return typeof s == "object" && s !== null && s.$$typeof === S;
|
|
225
225
|
}
|
|
226
|
-
var g =
|
|
226
|
+
var g = sr, S = /* @__PURE__ */ Symbol.for("react.transitional.element"), f = /* @__PURE__ */ Symbol.for("react.portal"), h = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), M = /* @__PURE__ */ Symbol.for("react.profiler"), N = /* @__PURE__ */ Symbol.for("react.consumer"), b = /* @__PURE__ */ Symbol.for("react.context"), p = /* @__PURE__ */ Symbol.for("react.forward_ref"), O = /* @__PURE__ */ Symbol.for("react.suspense"), D = /* @__PURE__ */ Symbol.for("react.suspense_list"), L = /* @__PURE__ */ Symbol.for("react.memo"), j = /* @__PURE__ */ Symbol.for("react.lazy"), Z = /* @__PURE__ */ Symbol.for("react.activity"), K = /* @__PURE__ */ Symbol.for("react.client.reference"), R = g.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, z = Object.prototype.hasOwnProperty, F = Array.isArray, $ = console.createTask ? console.createTask : function() {
|
|
227
227
|
return null;
|
|
228
228
|
};
|
|
229
229
|
g = {
|
|
230
|
-
react_stack_bottom_frame: function(
|
|
231
|
-
return
|
|
230
|
+
react_stack_bottom_frame: function(s) {
|
|
231
|
+
return s();
|
|
232
232
|
}
|
|
233
233
|
};
|
|
234
|
-
var
|
|
234
|
+
var te, re = {}, P = g.react_stack_bottom_frame.bind(
|
|
235
235
|
g,
|
|
236
236
|
o
|
|
237
|
-
)(),
|
|
238
|
-
|
|
239
|
-
var
|
|
237
|
+
)(), oe = $(n(o)), G = {};
|
|
238
|
+
je.Fragment = h, je.jsx = function(s, u, w) {
|
|
239
|
+
var E = 1e4 > R.recentlyCreatedOwnerStacks++;
|
|
240
240
|
return c(
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
s,
|
|
242
|
+
u,
|
|
243
|
+
w,
|
|
244
244
|
!1,
|
|
245
|
-
|
|
246
|
-
|
|
245
|
+
E ? Error("react-stack-top-frame") : P,
|
|
246
|
+
E ? $(n(s)) : oe
|
|
247
247
|
);
|
|
248
|
-
},
|
|
249
|
-
var
|
|
248
|
+
}, je.jsxs = function(s, u, w) {
|
|
249
|
+
var E = 1e4 > R.recentlyCreatedOwnerStacks++;
|
|
250
250
|
return c(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
251
|
+
s,
|
|
252
|
+
u,
|
|
253
|
+
w,
|
|
254
254
|
!0,
|
|
255
|
-
|
|
256
|
-
|
|
255
|
+
E ? Error("react-stack-top-frame") : P,
|
|
256
|
+
E ? $(n(s)) : oe
|
|
257
257
|
);
|
|
258
258
|
};
|
|
259
|
-
})()),
|
|
259
|
+
})()), je;
|
|
260
260
|
}
|
|
261
|
-
var
|
|
262
|
-
function
|
|
263
|
-
return
|
|
261
|
+
var Ot;
|
|
262
|
+
function yr() {
|
|
263
|
+
return Ot || (Ot = 1, process.env.NODE_ENV === "production" ? De.exports = hr() : De.exports = pr()), De.exports;
|
|
264
264
|
}
|
|
265
|
-
var i =
|
|
266
|
-
const
|
|
265
|
+
var i = yr();
|
|
266
|
+
const Le = 18, Fe = 12, Dt = 10, A = {
|
|
267
267
|
container: "directory-tree-container relative h-full transition-opacity duration-300 overflow-y-hidden pb-[3px] pr-[2px]",
|
|
268
268
|
containerPending: "opacity-70",
|
|
269
269
|
entry: "directory-tree-entry flex items-center cursor-pointer relative select-none text-xs leading-tight py-0.5",
|
|
270
270
|
// ホバー時のスタイル(ライト/ダークモード対応)
|
|
271
|
-
entryHover:
|
|
271
|
+
entryHover: _("directory-tree-entry--hover hover:bg-gray-400/15", "dark:hover:bg-gray-200/10"),
|
|
272
272
|
// 選択時のスタイル(ライト/ダークモード対応)
|
|
273
|
-
entrySelected:
|
|
273
|
+
entrySelected: _("directory-tree-entry--selected bg-blue-400/10", "dark:bg-blue-400/15"),
|
|
274
274
|
// アイテム選択時のスタイル(ライト/ダークモード対応)
|
|
275
|
-
entryItemSelected:
|
|
275
|
+
entryItemSelected: _("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)]"),
|
|
276
276
|
// アイコンのスタイル
|
|
277
|
-
expandIcon:
|
|
278
|
-
expandIconSelected:
|
|
279
|
-
typeIcon:
|
|
280
|
-
typeIconSelected:
|
|
277
|
+
expandIcon: _("directory-tree-expand-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
|
|
278
|
+
expandIconSelected: _("directory-tree-expand-icon--selected text-blue-700", "dark:text-blue-400"),
|
|
279
|
+
typeIcon: _("directory-tree-type-icon w-3.5 h-3.5 flex-shrink-0 flex items-center justify-center", "text-gray-500", "dark:text-gray-400"),
|
|
280
|
+
typeIconSelected: _("directory-tree-type-icon--selected text-blue-700", "dark:text-blue-400"),
|
|
281
281
|
// テキストのスタイル
|
|
282
|
-
name:
|
|
282
|
+
name: _("directory-tree-name overflow-hidden text-ellipsis whitespace-nowrap ml-1 text-xs font-normal", "text-gray-700", "dark:text-gray-200"),
|
|
283
283
|
nameDirectory: "directory-tree-name--directory font-medium",
|
|
284
|
-
nameSelected:
|
|
285
|
-
},
|
|
284
|
+
nameSelected: _("directory-tree-name--selected text-blue-800 font-semibold", "dark:text-blue-300")
|
|
285
|
+
}, ve = (e) => {
|
|
286
286
|
if (!e) return "";
|
|
287
287
|
const t = e.split("?")[0].split("#")[0].split("/").pop() || e, a = t.lastIndexOf(".");
|
|
288
288
|
return a <= 0 ? "" : t.slice(a + 1).toLowerCase();
|
|
289
|
-
},
|
|
289
|
+
}, Ht = ({ isDirectory: e, isExpanded: t, showExpandIcons: a, useCanvasExpandIcons: n, expandIconSize: r }) => {
|
|
290
290
|
const o = r ? { width: r, height: r } : void 0, l = r ? "" : "h-4 w-4";
|
|
291
|
-
return !(a && e) ||
|
|
292
|
-
},
|
|
291
|
+
return !(a && e) || n ? /* @__PURE__ */ i.jsx("span", { className: l, style: o, "aria-hidden": "true" }) : t ? /* @__PURE__ */ i.jsx(ur, { className: l, style: o }) : /* @__PURE__ */ i.jsx(mr, { className: l, style: o });
|
|
292
|
+
}, Xe = (e, t) => {
|
|
293
293
|
if (e == null || typeof e == "boolean") return null;
|
|
294
294
|
if (typeof e == "function")
|
|
295
295
|
return console.warn(`[DirectoryTree] Function returned by renderer for "${t}". Return a node.`), null;
|
|
@@ -297,84 +297,90 @@ const Ae = 18, Oe = 12, At = 10, O = {
|
|
|
297
297
|
if ("then" in e)
|
|
298
298
|
return console.warn(`[DirectoryTree] Promise returned for "${t}". Not supported.`), null;
|
|
299
299
|
if (Array.isArray(e)) {
|
|
300
|
-
const
|
|
301
|
-
return
|
|
300
|
+
const n = e.map((r) => Xe(r, t)).filter(Boolean);
|
|
301
|
+
return n.length ? n : null;
|
|
302
302
|
}
|
|
303
303
|
const a = e.type;
|
|
304
304
|
if (a && a.$$typeof === /* @__PURE__ */ Symbol.for("react.lazy"))
|
|
305
305
|
return console.warn(`[DirectoryTree] Lazy component for "${t}". Not supported.`), null;
|
|
306
306
|
}
|
|
307
307
|
return e;
|
|
308
|
-
},
|
|
309
|
-
const
|
|
308
|
+
}, xr = (e, t, a) => {
|
|
309
|
+
const n = (t || (a ? ve(a) : "")).toLowerCase(), r = (e || "").toLowerCase();
|
|
310
310
|
if (r && r !== "application/octet-stream") {
|
|
311
311
|
if (r === "text/markdown" || r === "text/x-markdown")
|
|
312
|
-
return /* @__PURE__ */ i.jsx(
|
|
312
|
+
return /* @__PURE__ */ i.jsx(wt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
|
|
313
313
|
if (r === "application/pdf")
|
|
314
|
-
return /* @__PURE__ */ i.jsx(
|
|
314
|
+
return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
|
|
315
315
|
if (r.includes("excel") || r.includes("spreadsheet") || r.includes("google-apps.spreadsheet"))
|
|
316
|
-
return /* @__PURE__ */ i.jsx(
|
|
316
|
+
return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
317
317
|
if (r === "text/csv" || r === "text/tab-separated-values")
|
|
318
|
-
return /* @__PURE__ */ i.jsx(
|
|
318
|
+
return /* @__PURE__ */ i.jsx(St, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
319
319
|
if (r.includes("word") || r.includes("msword") || r.includes("wordprocessingml") || r.includes("google-apps.document") || r === "application/rtf")
|
|
320
|
-
return /* @__PURE__ */ i.jsx(
|
|
320
|
+
return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
|
|
321
321
|
if (r.includes("powerpoint") || r.includes("presentation") || r.includes("google-apps.presentation"))
|
|
322
|
-
return /* @__PURE__ */ i.jsx(
|
|
322
|
+
return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
|
|
323
323
|
if (r.startsWith("image/"))
|
|
324
|
-
return /* @__PURE__ */ i.jsx(
|
|
324
|
+
return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
|
|
325
325
|
if (r.startsWith("audio/"))
|
|
326
|
-
return /* @__PURE__ */ i.jsx(
|
|
326
|
+
return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
|
|
327
327
|
if (r.startsWith("video/"))
|
|
328
|
-
return /* @__PURE__ */ i.jsx(
|
|
328
|
+
return /* @__PURE__ */ i.jsx(Ct, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
|
|
329
329
|
if (r.includes("zip") || r.includes("tar") || r.includes("compressed") || r.includes("archive"))
|
|
330
|
-
return /* @__PURE__ */ i.jsx(
|
|
330
|
+
return /* @__PURE__ */ i.jsx(Rt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
|
|
331
331
|
if (r === "application/json" || r.includes("javascript") || r.includes("typescript") || r.includes("xml") || r.startsWith("text/html") || r.startsWith("text/css") || r.includes("x-python") || r.includes("x-sh") || r.includes("x-go") || r.includes("x-rust"))
|
|
332
|
-
return /* @__PURE__ */ i.jsx(
|
|
332
|
+
return /* @__PURE__ */ i.jsx(Pt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
|
|
333
333
|
if (r.startsWith("text/"))
|
|
334
|
-
return /* @__PURE__ */ i.jsx(
|
|
334
|
+
return /* @__PURE__ */ i.jsx(_t, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
|
|
335
335
|
}
|
|
336
|
-
if (
|
|
337
|
-
if (
|
|
338
|
-
return /* @__PURE__ */ i.jsx(
|
|
339
|
-
if (
|
|
340
|
-
return /* @__PURE__ */ i.jsx(
|
|
341
|
-
if (["xls", "xlsx", "xlsm", "xlsb", "ods"].includes(
|
|
342
|
-
return /* @__PURE__ */ i.jsx(
|
|
343
|
-
if (["csv", "tsv"].includes(
|
|
344
|
-
return /* @__PURE__ */ i.jsx(
|
|
345
|
-
if (["doc", "docx", "rtf", "odt"].includes(
|
|
346
|
-
return /* @__PURE__ */ i.jsx(
|
|
347
|
-
if (["ppt", "pptx", "odp"].includes(
|
|
348
|
-
return /* @__PURE__ */ i.jsx(
|
|
349
|
-
if (["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp", "tiff", "avif"].includes(
|
|
350
|
-
return /* @__PURE__ */ i.jsx(
|
|
351
|
-
if (["js", "mjs", "cjs", "ts", "tsx", "jsx", "json", "html", "htm", "css", "scss", "py", "go", "rs", "c", "cpp", "h", "hpp", "sh", "bash", "yaml", "yml", "sql", "xml", "toml"].includes(
|
|
352
|
-
return /* @__PURE__ */ i.jsx(
|
|
353
|
-
if (["mp3", "wav", "ogg", "m4a", "flac", "aac", "wma"].includes(
|
|
354
|
-
return /* @__PURE__ */ i.jsx(
|
|
355
|
-
if (["mp4", "webm", "mov", "avi", "mkv", "wmv", "flv"].includes(
|
|
356
|
-
return /* @__PURE__ */ i.jsx(
|
|
357
|
-
if (["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"].includes(
|
|
358
|
-
return /* @__PURE__ */ i.jsx(
|
|
359
|
-
if (["txt", "log"].includes(
|
|
360
|
-
return /* @__PURE__ */ i.jsx(
|
|
336
|
+
if (n) {
|
|
337
|
+
if (n === "md" || n === "markdown" || n === "mdx")
|
|
338
|
+
return /* @__PURE__ */ i.jsx(wt, { className: "h-4 w-4 text-sky-500 dark:text-sky-400" });
|
|
339
|
+
if (n === "pdf")
|
|
340
|
+
return /* @__PURE__ */ i.jsx(kt, { className: "h-4 w-4 text-red-500 dark:text-red-400" });
|
|
341
|
+
if (["xls", "xlsx", "xlsm", "xlsb", "ods"].includes(n))
|
|
342
|
+
return /* @__PURE__ */ i.jsx(Nt, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
343
|
+
if (["csv", "tsv"].includes(n))
|
|
344
|
+
return /* @__PURE__ */ i.jsx(St, { className: "h-4 w-4 text-emerald-600 dark:text-emerald-400" });
|
|
345
|
+
if (["doc", "docx", "rtf", "odt"].includes(n))
|
|
346
|
+
return /* @__PURE__ */ i.jsx(Et, { className: "h-4 w-4 text-blue-600 dark:text-blue-400" });
|
|
347
|
+
if (["ppt", "pptx", "odp"].includes(n))
|
|
348
|
+
return /* @__PURE__ */ i.jsx(It, { className: "h-4 w-4 text-orange-500 dark:text-orange-400" });
|
|
349
|
+
if (["png", "jpg", "jpeg", "gif", "svg", "webp", "ico", "bmp", "tiff", "avif"].includes(n))
|
|
350
|
+
return /* @__PURE__ */ i.jsx(jt, { className: "h-4 w-4 text-teal-500 dark:text-teal-400" });
|
|
351
|
+
if (["js", "mjs", "cjs", "ts", "tsx", "jsx", "json", "html", "htm", "css", "scss", "py", "go", "rs", "c", "cpp", "h", "hpp", "sh", "bash", "yaml", "yml", "sql", "xml", "toml"].includes(n))
|
|
352
|
+
return /* @__PURE__ */ i.jsx(Pt, { className: "h-4 w-4 text-purple-500 dark:text-purple-400" });
|
|
353
|
+
if (["mp3", "wav", "ogg", "m4a", "flac", "aac", "wma"].includes(n))
|
|
354
|
+
return /* @__PURE__ */ i.jsx(Tt, { className: "h-4 w-4 text-pink-500 dark:text-pink-400" });
|
|
355
|
+
if (["mp4", "webm", "mov", "avi", "mkv", "wmv", "flv"].includes(n))
|
|
356
|
+
return /* @__PURE__ */ i.jsx(Ct, { className: "h-4 w-4 text-violet-500 dark:text-violet-400" });
|
|
357
|
+
if (["zip", "tar", "gz", "7z", "rar", "tgz", "bz2"].includes(n))
|
|
358
|
+
return /* @__PURE__ */ i.jsx(Rt, { className: "h-4 w-4 text-amber-500 dark:text-amber-400" });
|
|
359
|
+
if (["txt", "log"].includes(n))
|
|
360
|
+
return /* @__PURE__ */ i.jsx(_t, { className: "h-4 w-4 text-gray-500 dark:text-gray-400" });
|
|
361
361
|
}
|
|
362
|
-
return /* @__PURE__ */ i.jsx(
|
|
363
|
-
},
|
|
364
|
-
const { entry: a, isDirectory:
|
|
365
|
-
let
|
|
366
|
-
const
|
|
367
|
-
return a.icon !== void 0 ?
|
|
368
|
-
},
|
|
369
|
-
|
|
370
|
-
|
|
362
|
+
return /* @__PURE__ */ i.jsx(fr, { className: "h-4 w-4 text-gray-400 dark:text-gray-400" });
|
|
363
|
+
}, Wt = (e, t) => {
|
|
364
|
+
const { entry: a, isDirectory: n, isExpanded: r, extension: o, mimeType: l } = e;
|
|
365
|
+
let m;
|
|
366
|
+
const I = l || a.mimeType;
|
|
367
|
+
return a.icon !== void 0 ? m = a.icon : n ? m = r && t?.directoryExpanded || t?.directory || /* @__PURE__ */ i.jsx(dr, { className: "h-4 w-4" }) : o && t?.fileByExtension?.[o] ? m = t.fileByExtension[o] : m = t?.file || xr(I, o, a.name), Xe(typeof m == "function" ? m(e) : m, a.absolutePath);
|
|
368
|
+
}, vr = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), Bt = (e) => {
|
|
369
|
+
if (!e)
|
|
370
|
+
return;
|
|
371
|
+
const t = Object.entries(e).filter(([, a]) => a != null);
|
|
372
|
+
if (t.length !== 0)
|
|
373
|
+
return Object.fromEntries(t.map(([a, n]) => [`data-${vr(a)}`, String(n)]));
|
|
374
|
+
}, br = 500, zt = ({ entry: e, isDirectory: t, isExpanded: a, isItemSelected: n, selectionMode: r, onSelectionChange: o, onEntryClick: l, toggleDirectory: m, onToggleDirectoryRecursive: I }) => {
|
|
375
|
+
const x = de(null);
|
|
376
|
+
return ue(
|
|
371
377
|
() => () => {
|
|
372
378
|
x.current && window.clearTimeout(x.current);
|
|
373
379
|
},
|
|
374
380
|
[]
|
|
375
|
-
),
|
|
381
|
+
), W(
|
|
376
382
|
(c) => {
|
|
377
|
-
c.stopPropagation(), r !== "none" && !t && o && o(e, !
|
|
383
|
+
c.stopPropagation(), r !== "none" && !t && o && o(e, !n);
|
|
378
384
|
let y = !1;
|
|
379
385
|
l({
|
|
380
386
|
entry: e,
|
|
@@ -383,457 +389,469 @@ const Ae = 18, Oe = 12, At = 10, O = {
|
|
|
383
389
|
preventDefault: () => {
|
|
384
390
|
y = !0;
|
|
385
391
|
}
|
|
386
|
-
}), !(!t || y) && (x.current ? (window.clearTimeout(x.current), x.current = null,
|
|
387
|
-
|
|
388
|
-
},
|
|
392
|
+
}), !(!t || y) && (x.current ? (window.clearTimeout(x.current), x.current = null, I(e)) : x.current = window.setTimeout(() => {
|
|
393
|
+
m(e.absolutePath), x.current = null;
|
|
394
|
+
}, br));
|
|
389
395
|
},
|
|
390
|
-
[t, e, a,
|
|
396
|
+
[t, e, a, I, m, l, r, o, n]
|
|
391
397
|
);
|
|
392
|
-
},
|
|
398
|
+
}, Yt = (e) => e === "right" ? "dt-grid-cell--right" : e === "center" ? "dt-grid-cell--center" : "", Lt = (e, t) => e.children !== void 0 && t(e.absolutePath), Gt = (e, t) => ({
|
|
393
399
|
width: e,
|
|
394
400
|
gridTemplateColumns: t
|
|
395
|
-
}),
|
|
401
|
+
}), Vt = qe(
|
|
396
402
|
({
|
|
397
403
|
entry: e,
|
|
398
404
|
indentLevel: t,
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
405
|
+
positionInSet: a,
|
|
406
|
+
setSize: n,
|
|
407
|
+
rowHeight: r,
|
|
408
|
+
isDirOpen: o,
|
|
409
|
+
columns: l,
|
|
410
|
+
numericTemplate: m,
|
|
411
|
+
numericTotal: I,
|
|
412
|
+
nameWidth: x,
|
|
413
|
+
rowClassName: c,
|
|
414
|
+
selection: { onEntryClick: y, selectedPath: k, mode: g = "none", selectedItems: S, onSelectionChange: f },
|
|
415
|
+
expansion: { toggleDirectory: h, onToggleDirectoryRecursive: v },
|
|
416
|
+
visual: { iconOverrides: M, showExpandIcons: N = !0, showDirectoryIcons: b = !0, showFileIcons: p = !0, useCanvasExpandIcons: O = !1, expandIconSize: D, indentSize: L = Fe, highlightStyles: j }
|
|
409
417
|
}) => {
|
|
410
|
-
const [
|
|
411
|
-
if (
|
|
412
|
-
if (F) return
|
|
413
|
-
} else if (F ||
|
|
414
|
-
return
|
|
418
|
+
const [Z, K] = ae(!1), R = e.children !== void 0, z = R && o(e.absolutePath), F = e.absolutePath === k, $ = !R && !!S?.has(e.absolutePath), te = R ? void 0 : ve(e.name) || ve(e.relativePath) || ve(e.absolutePath), re = zt({ entry: e, isDirectory: R, isExpanded: z, isItemSelected: $, selectionMode: g, onSelectionChange: f, onEntryClick: y, toggleDirectory: h, onToggleDirectoryRecursive: v }), P = Z ? j?.hoverClassName !== void 0 ? j.hoverClassName : A.entryHover : "", oe = (() => {
|
|
419
|
+
if (R) {
|
|
420
|
+
if (F) return j?.directorySelectedClassName !== void 0 ? j.directorySelectedClassName : A.entrySelected;
|
|
421
|
+
} else if (F || $)
|
|
422
|
+
return j?.itemSelectedClassName !== void 0 ? j.itemSelectedClassName : _(F && A.entrySelected, $ && A.entryItemSelected);
|
|
415
423
|
return "";
|
|
416
|
-
})(),
|
|
417
|
-
...
|
|
418
|
-
...
|
|
419
|
-
...!
|
|
424
|
+
})(), G = typeof c == "function" ? c(e) : c, s = _("dt-grid-row cursor-pointer select-none", P, oe, G, e.className), u = _(A.expandIcon, (F || $) && A.expandIconSelected), w = _(A.typeIcon, (F || $) && A.typeIconSelected), E = _("dt-grid-name-label ml-1", "text-gray-700 dark:text-gray-200", R && A.nameDirectory, (F || $) && A.nameSelected), B = Ht({ isDirectory: R, isExpanded: z, showExpandIcons: N, useCanvasExpandIcons: O, expandIconSize: D }), le = (R ? b : p) ? Wt({ entry: e, isDirectory: R, isExpanded: z, isSelected: F, isItemSelected: $, extension: te, mimeType: e.mimeType }, M) : null, T = { indentLevel: t, isDirectory: R, isExpanded: z }, [V, ...ne] = l, ie = V?.render ? V.render(e, T) : e.label ?? e.name, ye = {
|
|
425
|
+
...Z ? j?.hoverStyle : {},
|
|
426
|
+
...R && F ? j?.directorySelectedStyle : {},
|
|
427
|
+
...!R && (F || $) ? j?.itemSelectedStyle : {}
|
|
420
428
|
};
|
|
421
429
|
return /* @__PURE__ */ i.jsxs(
|
|
422
430
|
"div",
|
|
423
431
|
{
|
|
424
|
-
className:
|
|
425
|
-
style: { height:
|
|
432
|
+
className: s,
|
|
433
|
+
style: { height: r, ...ye, ...e.style },
|
|
426
434
|
role: "row",
|
|
427
|
-
"aria-expanded":
|
|
435
|
+
"aria-expanded": R ? z : void 0,
|
|
428
436
|
"aria-level": t + 1,
|
|
429
|
-
"
|
|
430
|
-
"
|
|
437
|
+
"aria-posinset": a,
|
|
438
|
+
"aria-setsize": n,
|
|
439
|
+
...Bt(e.data),
|
|
440
|
+
"data-entry-type": R ? "directory" : "file",
|
|
441
|
+
"data-entry-expanded": R ? String(z) : void 0,
|
|
431
442
|
"data-entry-selected": F ? "true" : void 0,
|
|
432
|
-
"data-entry-item-selected":
|
|
433
|
-
onClick:
|
|
434
|
-
onMouseEnter: () =>
|
|
435
|
-
onMouseLeave: () =>
|
|
436
|
-
onKeyDown: (
|
|
443
|
+
"data-entry-item-selected": $ ? "true" : void 0,
|
|
444
|
+
onClick: re,
|
|
445
|
+
onMouseEnter: () => K(!0),
|
|
446
|
+
onMouseLeave: () => K(!1),
|
|
447
|
+
onKeyDown: (Q) => Q.key === "Enter" && re(Q),
|
|
437
448
|
tabIndex: 0,
|
|
438
449
|
children: [
|
|
439
|
-
/* @__PURE__ */ i.jsxs("div", { className:
|
|
440
|
-
(
|
|
441
|
-
(
|
|
442
|
-
/* @__PURE__ */ i.jsx("span", { className:
|
|
450
|
+
/* @__PURE__ */ i.jsxs("div", { className: _("dt-grid-name-cell", V?.className), role: "gridcell", style: { width: x, paddingLeft: Math.max(0, t * L) }, children: [
|
|
451
|
+
(N || O) && /* @__PURE__ */ i.jsx("span", { className: u, children: B }),
|
|
452
|
+
(R ? b : p) && /* @__PURE__ */ i.jsx("span", { className: w, children: le }),
|
|
453
|
+
/* @__PURE__ */ i.jsx("span", { className: E, children: ie })
|
|
443
454
|
] }),
|
|
444
|
-
|
|
455
|
+
ne.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Gt(I, m), children: ne.map((Q) => /* @__PURE__ */ i.jsx("div", { className: _("dt-grid-cell", Yt(Q.align), Q.className), role: "gridcell", children: Q.render ? Q.render(e, T) : null }, Q.key)) }) })
|
|
445
456
|
]
|
|
446
457
|
}
|
|
447
458
|
);
|
|
448
459
|
},
|
|
449
460
|
(e, t) => {
|
|
450
461
|
if (e.entry !== t.entry) return !1;
|
|
451
|
-
const a =
|
|
452
|
-
return e.indentLevel === t.indentLevel && e.rowHeight === t.rowHeight && a ===
|
|
462
|
+
const a = Lt(e.entry, e.isDirOpen), n = Lt(t.entry, t.isDirOpen);
|
|
463
|
+
return e.indentLevel === t.indentLevel && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowHeight === t.rowHeight && a === 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.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual === t.visual;
|
|
453
464
|
}
|
|
454
465
|
);
|
|
455
|
-
|
|
456
|
-
const
|
|
466
|
+
Vt.displayName = "DirectoryTreeGridRow";
|
|
467
|
+
const Ut = ({
|
|
457
468
|
kind: e,
|
|
458
469
|
columns: t,
|
|
459
470
|
numericTemplate: a,
|
|
460
|
-
numericTotal:
|
|
471
|
+
numericTotal: n,
|
|
461
472
|
nameWidth: r,
|
|
462
473
|
scrollBarWidth: o,
|
|
463
474
|
className: l,
|
|
464
|
-
nameContent:
|
|
465
|
-
renderCell:
|
|
475
|
+
nameContent: m,
|
|
476
|
+
renderCell: I
|
|
466
477
|
}) => {
|
|
467
|
-
const [, ...x] = t, c = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", y = e === "header" ? "dt-grid-header" : "dt-grid-footer",
|
|
468
|
-
return /* @__PURE__ */ i.jsxs("div", { className:
|
|
469
|
-
/* @__PURE__ */ i.jsx("div", { className:
|
|
470
|
-
x.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style:
|
|
478
|
+
const [, ...x] = t, c = e === "header" ? "dt-grid-name-header" : "dt-grid-name-footer", y = e === "header" ? "dt-grid-header" : "dt-grid-footer", k = e === "header" ? "columnheader" : "gridcell";
|
|
479
|
+
return /* @__PURE__ */ i.jsxs("div", { className: _(y, "text-gray-600 dark:text-gray-300", l), role: "row", children: [
|
|
480
|
+
/* @__PURE__ */ i.jsx("div", { className: _(c, "px-1", t[0]?.className), role: k, style: { width: r }, children: m }),
|
|
481
|
+
x.length > 0 && /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-viewport", children: /* @__PURE__ */ i.jsx("div", { className: "dt-grid-numeric-track", style: Gt(n, a), children: x.map((g) => /* @__PURE__ */ i.jsx("div", { className: _("dt-grid-cell", Yt(g.align), g.className), role: k, children: I(g) }, g.key)) }) }),
|
|
471
482
|
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: o }, "aria-hidden": "true" })
|
|
472
483
|
] });
|
|
473
|
-
},
|
|
484
|
+
}, gr = ({ columns: e, className: t, ...a }) => /* @__PURE__ */ i.jsx(Ut, { kind: "header", columns: e, className: t, nameContent: e[0]?.header ?? null, renderCell: (n) => n.header ?? null, ...a }), Ft = (e, t) => typeof e == "function" ? e(t) : e ?? null, wr = ({ columns: e, allEntries: t, className: a, ...n }) => /* @__PURE__ */ i.jsx(Ut, { kind: "footer", columns: e, className: a, nameContent: Ft(e[0]?.footer, t), renderCell: (r) => Ft(r.footer, t), ...n }), kr = 240, Xt = 96, Jt = 12, Je = (e, t) => {
|
|
474
485
|
const a = e?.width;
|
|
475
486
|
return typeof a == "number" && Number.isFinite(a) && a > 0 ? a : t;
|
|
476
|
-
},
|
|
477
|
-
const
|
|
478
|
-
return { nameWidth:
|
|
479
|
-
},
|
|
480
|
-
const t = [], a = (
|
|
481
|
-
for (const r of
|
|
487
|
+
}, Nr = (e) => e.slice(1).map((t) => `${Je(t, Xt)}px`).join(" "), Sr = ({ measuredWidth: e, columns: t, scrollBarWidth: a = Jt }) => {
|
|
488
|
+
const n = Je(t[0], kr), r = t.slice(1).reduce((I, x) => I + Je(x, Xt), 0), o = Number.isFinite(e) && e > 0 ? e : 0, l = Math.max(0, o - n - Math.max(0, a)), m = Math.max(0, r - l);
|
|
489
|
+
return { nameWidth: n, numericTotal: r, numericVisible: l, maxHScroll: m };
|
|
490
|
+
}, Ue = (e, t) => !Number.isFinite(e) || e < 0 ? 0 : e > t ? t : e, Er = (e) => {
|
|
491
|
+
const t = [], a = (n) => {
|
|
492
|
+
for (const r of n)
|
|
482
493
|
t.push(r), r.children && r.children.length > 0 && a(r.children);
|
|
483
494
|
};
|
|
484
495
|
return a(e), t;
|
|
485
|
-
},
|
|
496
|
+
}, Ir = (e, t) => {
|
|
486
497
|
const a = e.length - 1;
|
|
487
498
|
if (a <= 0) return 0;
|
|
488
|
-
let
|
|
489
|
-
for (;
|
|
490
|
-
const l =
|
|
491
|
-
e[l] <= t ? (o = l,
|
|
499
|
+
let n = 0, r = a - 1, o = 0;
|
|
500
|
+
for (; n <= r; ) {
|
|
501
|
+
const l = n + r >>> 1;
|
|
502
|
+
e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
|
|
492
503
|
}
|
|
493
504
|
return o;
|
|
494
|
-
},
|
|
505
|
+
}, jr = (e, t, a) => {
|
|
495
506
|
if (a <= 0 || e.length === 0 || t.length !== e.length + 1)
|
|
496
507
|
return null;
|
|
497
|
-
const
|
|
508
|
+
const n = Ir(t, a), r = e[n];
|
|
498
509
|
return r ? {
|
|
499
510
|
path: r.entry.absolutePath,
|
|
500
|
-
offsetInViewport: a - t[
|
|
511
|
+
offsetInViewport: a - t[n]
|
|
501
512
|
} : null;
|
|
502
|
-
},
|
|
513
|
+
}, Tr = (e, t, a) => {
|
|
503
514
|
if (t.length === 0 || a.length !== t.length + 1)
|
|
504
515
|
return null;
|
|
505
|
-
for (let
|
|
506
|
-
if (t[
|
|
507
|
-
return Math.max(0, a[
|
|
516
|
+
for (let n = 0; n < t.length; n++)
|
|
517
|
+
if (t[n].entry.absolutePath === e.path)
|
|
518
|
+
return Math.max(0, a[n] + e.offsetInViewport);
|
|
508
519
|
return null;
|
|
509
|
-
},
|
|
510
|
-
const
|
|
520
|
+
}, Cr = (e, t, a) => {
|
|
521
|
+
const n = [];
|
|
511
522
|
for (let r = t; r < a; r++) {
|
|
512
523
|
const o = e[r];
|
|
513
524
|
if (!(!o || o.length === 0))
|
|
514
525
|
for (const l of o)
|
|
515
|
-
|
|
526
|
+
n.push(l);
|
|
516
527
|
}
|
|
517
|
-
return
|
|
518
|
-
},
|
|
519
|
-
const
|
|
528
|
+
return n;
|
|
529
|
+
}, Rr = (e, t, a) => {
|
|
530
|
+
const n = [];
|
|
520
531
|
for (let r = t; r < a; r++) {
|
|
521
532
|
const o = e[r];
|
|
522
533
|
if (!(!o || o.length === 0))
|
|
523
534
|
for (const l of o)
|
|
524
|
-
|
|
535
|
+
n.push(l);
|
|
525
536
|
}
|
|
526
|
-
return
|
|
527
|
-
},
|
|
528
|
-
const r = Math.max(1, Math.floor(t *
|
|
537
|
+
return n;
|
|
538
|
+
}, Pr = (e, t, a, n) => {
|
|
539
|
+
const r = Math.max(1, Math.floor(t * n)), o = Math.max(1, Math.floor(a * n));
|
|
529
540
|
(e.width !== r || e.height !== o) && (e.width = r, e.height = o);
|
|
530
541
|
const l = e.style;
|
|
531
542
|
l.width !== `${t}px` && (l.width = `${t}px`), l.height !== `${a}px` && (l.height = `${a}px`);
|
|
532
|
-
},
|
|
543
|
+
}, _r = (e, t, a) => {
|
|
533
544
|
e.lineWidth = a, e.beginPath();
|
|
534
|
-
for (const
|
|
535
|
-
e.moveTo(
|
|
545
|
+
for (const n of t)
|
|
546
|
+
e.moveTo(n.x1, n.y1), e.lineTo(n.x2, n.y2);
|
|
536
547
|
e.stroke();
|
|
537
|
-
},
|
|
548
|
+
}, Ar = (e, t) => {
|
|
538
549
|
const a = /^#([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());
|
|
539
550
|
if (!a)
|
|
540
551
|
return null;
|
|
541
|
-
let
|
|
542
|
-
|
|
543
|
-
const r = Number.parseInt(
|
|
552
|
+
let n = a[1];
|
|
553
|
+
n.length === 3 && (n = n.split("").map((m) => m + m).join(""));
|
|
554
|
+
const r = Number.parseInt(n.slice(0, 2), 16), o = Number.parseInt(n.slice(2, 4), 16), l = Number.parseInt(n.slice(4, 6), 16);
|
|
544
555
|
return `rgba(${r}, ${o}, ${l}, ${t})`;
|
|
545
|
-
},
|
|
556
|
+
}, Mr = (e, t, a, n) => {
|
|
546
557
|
if (t.length === 0)
|
|
547
558
|
return;
|
|
548
|
-
const r =
|
|
559
|
+
const r = Ar(a, 0.14), o = e.strokeStyle, l = e.fillStyle, m = e.lineWidth, I = e.lineCap, x = e.lineJoin;
|
|
549
560
|
e.strokeStyle = a, e.lineCap = "round", e.lineJoin = "round";
|
|
550
561
|
for (const c of t) {
|
|
551
|
-
const y =
|
|
552
|
-
r && (e.fillStyle = r, e.beginPath(), e.arc(c.centerX, c.centerY,
|
|
562
|
+
const y = n ?? c.size, k = Math.max(0, y / 2), g = Math.max(1, Math.round(y * 0.08)), S = Math.max(1, Math.round(y * 0.14)), f = Math.max(0, k - g * 0.8), h = Math.max(0, f * 0.55);
|
|
563
|
+
r && (e.fillStyle = r, e.beginPath(), e.arc(c.centerX, c.centerY, f, 0, Math.PI * 2), e.fill()), e.lineWidth = g, e.beginPath(), e.arc(c.centerX, c.centerY, Math.max(0, k - g * 0.3), 0, Math.PI * 2), e.stroke(), e.lineWidth = S, e.beginPath(), e.moveTo(c.centerX - h, c.centerY), e.lineTo(c.centerX + h, c.centerY), e.stroke(), c.isExpanded || (e.beginPath(), e.moveTo(c.centerX, c.centerY - h), e.lineTo(c.centerX, c.centerY + h), e.stroke());
|
|
553
564
|
}
|
|
554
|
-
e.strokeStyle = o, e.fillStyle = l, e.lineWidth =
|
|
555
|
-
},
|
|
556
|
-
const
|
|
565
|
+
e.strokeStyle = o, e.fillStyle = l, e.lineWidth = m, e.lineCap = I, e.lineJoin = x;
|
|
566
|
+
}, qt = qe(({ segmentsByItem: e, glyphsByItem: t, itemHeight: a, width: n, viewportHeight: r, scrollPosition: o, color: l = "#a0aec0", strokeWidth: m = 1, renderStartIndex: I, renderEndIndex: x, lookaheadEndIndex: c, devicePixelRatio: y, expandGlyphColor: k, expandGlyphSize: g }) => {
|
|
567
|
+
const S = de(null), f = de(null), h = de({
|
|
557
568
|
segmentsByItem: e,
|
|
558
569
|
glyphsByItem: t,
|
|
559
570
|
itemHeight: a,
|
|
560
|
-
width:
|
|
571
|
+
width: n,
|
|
561
572
|
viewportHeight: r,
|
|
562
573
|
scrollPosition: o,
|
|
563
574
|
color: l,
|
|
564
|
-
strokeWidth:
|
|
565
|
-
renderStartIndex:
|
|
575
|
+
strokeWidth: m,
|
|
576
|
+
renderStartIndex: I,
|
|
566
577
|
renderEndIndex: x,
|
|
567
578
|
lookaheadEndIndex: c,
|
|
568
579
|
devicePixelRatio: y,
|
|
569
|
-
expandGlyphColor:
|
|
580
|
+
expandGlyphColor: k,
|
|
570
581
|
expandGlyphSize: g
|
|
571
|
-
}), v =
|
|
572
|
-
|
|
573
|
-
const N =
|
|
582
|
+
}), v = W(() => {
|
|
583
|
+
f.current = null;
|
|
584
|
+
const N = S.current;
|
|
574
585
|
if (!N)
|
|
575
586
|
return;
|
|
576
587
|
const b = N.getContext("2d");
|
|
577
588
|
if (!b)
|
|
578
589
|
return;
|
|
579
|
-
const
|
|
580
|
-
if (
|
|
590
|
+
const p = h.current;
|
|
591
|
+
if (p.width <= 0 || p.viewportHeight <= 0) {
|
|
581
592
|
b.clearRect(0, 0, N.width, N.height);
|
|
582
593
|
return;
|
|
583
594
|
}
|
|
584
|
-
const
|
|
585
|
-
|
|
586
|
-
const
|
|
587
|
-
if (typeof
|
|
588
|
-
const
|
|
589
|
-
return Math.max(Math.min(
|
|
595
|
+
const O = Number.isFinite(p.devicePixelRatio ?? NaN) ? p.devicePixelRatio : typeof window < "u" && window.devicePixelRatio || 1;
|
|
596
|
+
Pr(N, p.width, p.viewportHeight, O);
|
|
597
|
+
const D = p.segmentsByItem.length, L = typeof p.renderStartIndex == "number" && Number.isFinite(p.renderStartIndex) ? Math.max(0, Math.floor(p.renderStartIndex)) : Math.max(0, Math.floor(p.scrollPosition / p.itemHeight)), j = Math.min(D, Math.ceil((p.scrollPosition + p.viewportHeight) / p.itemHeight)), Z = (() => {
|
|
598
|
+
if (typeof p.renderEndIndex == "number" && Number.isFinite(p.renderEndIndex)) {
|
|
599
|
+
const F = Math.floor(p.renderEndIndex);
|
|
600
|
+
return Math.max(Math.min(D, F + 1), L);
|
|
590
601
|
}
|
|
591
|
-
return Math.max(
|
|
592
|
-
})(),
|
|
593
|
-
if (typeof
|
|
594
|
-
const
|
|
595
|
-
return Math.max(
|
|
602
|
+
return Math.max(j, L);
|
|
603
|
+
})(), K = (() => {
|
|
604
|
+
if (typeof p.lookaheadEndIndex == "number" && Number.isFinite(p.lookaheadEndIndex)) {
|
|
605
|
+
const F = Math.floor(p.lookaheadEndIndex), $ = Math.min(D, F + 1);
|
|
606
|
+
return Math.max($, Z);
|
|
596
607
|
}
|
|
597
|
-
return Math.max(
|
|
598
|
-
})(),
|
|
599
|
-
b.save(), b.scale(
|
|
600
|
-
}, []),
|
|
601
|
-
|
|
608
|
+
return Math.max(j, Z);
|
|
609
|
+
})(), R = Cr(p.segmentsByItem, L, K), z = Rr(p.glyphsByItem, L, K);
|
|
610
|
+
b.save(), b.scale(O, O), b.clearRect(0, 0, p.width, p.viewportHeight), b.translate(0, -p.scrollPosition), b.strokeStyle = p.color, _r(b, R, p.strokeWidth), Mr(b, z, p.expandGlyphColor ?? p.color, p.expandGlyphSize), b.restore();
|
|
611
|
+
}, []), M = W(() => {
|
|
612
|
+
f.current === null && (f.current = window.requestAnimationFrame(v));
|
|
602
613
|
}, [v]);
|
|
603
|
-
return
|
|
604
|
-
|
|
614
|
+
return ue(() => {
|
|
615
|
+
h.current = {
|
|
605
616
|
segmentsByItem: e,
|
|
606
617
|
glyphsByItem: t,
|
|
607
618
|
itemHeight: a,
|
|
608
|
-
width:
|
|
619
|
+
width: n,
|
|
609
620
|
viewportHeight: r,
|
|
610
621
|
scrollPosition: o,
|
|
611
622
|
color: l,
|
|
612
|
-
strokeWidth:
|
|
613
|
-
renderStartIndex:
|
|
623
|
+
strokeWidth: m,
|
|
624
|
+
renderStartIndex: I,
|
|
614
625
|
renderEndIndex: x,
|
|
615
626
|
lookaheadEndIndex: c,
|
|
616
627
|
devicePixelRatio: y,
|
|
617
|
-
expandGlyphColor:
|
|
628
|
+
expandGlyphColor: k,
|
|
618
629
|
expandGlyphSize: g
|
|
619
|
-
},
|
|
620
|
-
}, [e, t, a,
|
|
621
|
-
|
|
622
|
-
}, []), /* @__PURE__ */ i.jsx("canvas", { ref:
|
|
630
|
+
}, M();
|
|
631
|
+
}, [e, t, a, n, r, o, l, m, I, x, c, y, k, g, M]), ue(() => () => {
|
|
632
|
+
f.current !== null && (window.cancelAnimationFrame(f.current), f.current = null);
|
|
633
|
+
}, []), /* @__PURE__ */ i.jsx("canvas", { ref: S, className: "pointer-events-none absolute top-0 left-0 z-0" });
|
|
623
634
|
});
|
|
624
|
-
|
|
625
|
-
const
|
|
635
|
+
qt.displayName = "TreeLineCanvas";
|
|
636
|
+
const Or = {
|
|
626
637
|
msOverflowStyle: "none",
|
|
627
638
|
scrollbarWidth: "none"
|
|
628
|
-
},
|
|
639
|
+
}, Dr = () => {
|
|
629
640
|
let e = document.getElementById("directory-tree-webkit-scrollbar-hide");
|
|
630
641
|
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));
|
|
631
|
-
},
|
|
642
|
+
}, Lr = (e, t, a, n, r) => {
|
|
632
643
|
const o = [], l = [];
|
|
633
|
-
let
|
|
634
|
-
const
|
|
635
|
-
const
|
|
636
|
-
for (let g = 0; g <
|
|
637
|
-
const
|
|
638
|
-
let N = c, b =
|
|
639
|
-
|
|
640
|
-
id:
|
|
641
|
-
name:
|
|
642
|
-
absolutePath:
|
|
644
|
+
let m = 0;
|
|
645
|
+
const I = (x, c, y) => {
|
|
646
|
+
const k = r ? [...x].sort(r) : x;
|
|
647
|
+
for (let g = 0; g < k.length; g++) {
|
|
648
|
+
const S = k[g], f = g === k.length - 1, h = [...y, f], v = S.children !== void 0, M = v && t(S.absolutePath, S.relativePath);
|
|
649
|
+
let N = c, b = h, p = y;
|
|
650
|
+
n && (N = c - 1, b = h.slice(1), p = y.slice(1)), o.push({ entry: S, indentLevel: N, depth: c, positionInSet: g + 1, setSize: k.length, parentIsLast: b }), a && (N > m && (m = N), l.push({
|
|
651
|
+
id: S.absolutePath,
|
|
652
|
+
name: S.name,
|
|
653
|
+
absolutePath: S.absolutePath,
|
|
643
654
|
indentLevel: N,
|
|
644
|
-
isLastChild:
|
|
655
|
+
isLastChild: f,
|
|
645
656
|
isDirectory: v,
|
|
646
|
-
isExpanded:
|
|
647
|
-
ancestorIsLast: [...
|
|
648
|
-
hideLines:
|
|
649
|
-
})), v &&
|
|
657
|
+
isExpanded: M,
|
|
658
|
+
ancestorIsLast: [...p],
|
|
659
|
+
hideLines: n && c === 0
|
|
660
|
+
})), v && M && S.children && I(S.children, c + 1, h);
|
|
650
661
|
}
|
|
651
662
|
};
|
|
652
|
-
return
|
|
653
|
-
},
|
|
663
|
+
return I(e, 0, []), { flatItems: o, lineItems: l, maxIndent: m };
|
|
664
|
+
}, $t = (e, t) => {
|
|
654
665
|
const a = e.length - 1;
|
|
655
666
|
if (a <= 0) return 0;
|
|
656
|
-
let
|
|
657
|
-
for (;
|
|
658
|
-
const l =
|
|
659
|
-
e[l] <= t ? (o = l,
|
|
667
|
+
let n = 0, r = a - 1, o = 0;
|
|
668
|
+
for (; n <= r; ) {
|
|
669
|
+
const l = n + r >>> 1;
|
|
670
|
+
e[l] <= t ? (o = l, n = l + 1) : r = l - 1;
|
|
660
671
|
}
|
|
661
672
|
return o;
|
|
662
|
-
},
|
|
663
|
-
const l =
|
|
673
|
+
}, Fr = (e, t, a, n, r, o) => {
|
|
674
|
+
const l = n?.renderStart ?? Math.max(0, $t(o, r)), m = t > 0 ? $t(o, r + t) + a : l + a, I = e > 0 ? Math.min(e - 1, Math.max(l, m)) : l, x = n?.renderEnd ?? I, c = e > 0 ? Math.min(e - 1, x + a) : x;
|
|
664
675
|
return { renderStart: l, renderEnd: x, lookaheadEnd: c };
|
|
665
|
-
},
|
|
676
|
+
}, $r = (e, t, a, n, r, o) => {
|
|
666
677
|
if (e.length === 0)
|
|
667
678
|
return { segmentsByItem: [], glyphsByItem: [] };
|
|
668
|
-
const l = Array.from({ length: e.length }, () => []),
|
|
679
|
+
const l = Array.from({ length: e.length }, () => []), m = Array.from({ length: e.length }, () => []), I = (c) => r ? typeof o == "number" && Number.isFinite(o) && o > 0 ? o : Math.max(8, Math.min(n * 0.9, c * 0.7)) : 0, x = 3;
|
|
669
680
|
for (let c = 0; c < e.length; c++) {
|
|
670
681
|
const y = e[c];
|
|
671
682
|
if (y.hideLines)
|
|
672
683
|
continue;
|
|
673
|
-
const
|
|
684
|
+
const k = [], g = t[c] ?? 0, S = a[c] ?? 0, f = S + g / 2, h = I(g), v = h > 0 ? h / 2 + 2 : n / 1.5;
|
|
674
685
|
for (let b = 0; b < y.indentLevel; b++) {
|
|
675
686
|
if (y.ancestorIsLast[b] ?? !1)
|
|
676
687
|
continue;
|
|
677
|
-
let
|
|
678
|
-
for (let
|
|
679
|
-
const L = e[
|
|
688
|
+
let O = !1;
|
|
689
|
+
for (let D = c; D < e.length; D++) {
|
|
690
|
+
const L = e[D];
|
|
680
691
|
if (L.indentLevel > b && L.ancestorIsLast.length > b && !L.ancestorIsLast[b]) {
|
|
681
|
-
|
|
692
|
+
O = !0;
|
|
682
693
|
break;
|
|
683
694
|
}
|
|
684
|
-
if (
|
|
695
|
+
if (D > c && L.indentLevel === b)
|
|
685
696
|
break;
|
|
686
697
|
}
|
|
687
|
-
if (
|
|
688
|
-
const
|
|
689
|
-
|
|
698
|
+
if (O) {
|
|
699
|
+
const D = b * n + n / 2 + x;
|
|
700
|
+
k.push({
|
|
690
701
|
key: `${y.id}-ancestor-${b}`,
|
|
691
|
-
x1:
|
|
692
|
-
y1:
|
|
693
|
-
x2:
|
|
694
|
-
y2:
|
|
702
|
+
x1: D,
|
|
703
|
+
y1: S,
|
|
704
|
+
x2: D,
|
|
705
|
+
y2: S + g,
|
|
695
706
|
itemIndex: c
|
|
696
707
|
});
|
|
697
708
|
}
|
|
698
709
|
}
|
|
699
|
-
const
|
|
700
|
-
if (y.isDirectory ?
|
|
710
|
+
const M = y.indentLevel * n, N = M + n / 2 + x;
|
|
711
|
+
if (y.isDirectory ? k.push({
|
|
701
712
|
key: `${y.id}-connector-top`,
|
|
702
713
|
x1: N,
|
|
703
|
-
y1:
|
|
714
|
+
y1: S,
|
|
704
715
|
x2: N,
|
|
705
|
-
y2:
|
|
716
|
+
y2: f - v,
|
|
706
717
|
itemIndex: c
|
|
707
|
-
}) :
|
|
718
|
+
}) : k.push({
|
|
708
719
|
key: `${y.id}-connector-top`,
|
|
709
720
|
x1: N,
|
|
710
|
-
y1:
|
|
721
|
+
y1: S,
|
|
711
722
|
x2: N,
|
|
712
|
-
y2:
|
|
723
|
+
y2: f,
|
|
713
724
|
itemIndex: c
|
|
714
|
-
}), !y.isDirectory && y.isLastChild &&
|
|
725
|
+
}), !y.isDirectory && y.isLastChild && k.push({
|
|
715
726
|
key: `${y.id}-connector-horizontal`,
|
|
716
727
|
x1: N,
|
|
717
|
-
y1:
|
|
718
|
-
x2:
|
|
719
|
-
y2:
|
|
728
|
+
y1: f,
|
|
729
|
+
x2: M + n + x,
|
|
730
|
+
y2: f,
|
|
720
731
|
itemIndex: c
|
|
721
|
-
}), y.isLastChild || (y.isDirectory ?
|
|
732
|
+
}), y.isLastChild || (y.isDirectory ? k.push({
|
|
722
733
|
key: `${y.id}-connector-bottom`,
|
|
723
734
|
x1: N,
|
|
724
|
-
y1:
|
|
735
|
+
y1: f + v,
|
|
725
736
|
x2: N,
|
|
726
|
-
y2:
|
|
737
|
+
y2: S + g,
|
|
727
738
|
itemIndex: c
|
|
728
|
-
}) :
|
|
739
|
+
}) : k.push({
|
|
729
740
|
key: `${y.id}-connector-bottom`,
|
|
730
741
|
x1: N,
|
|
731
|
-
y1:
|
|
742
|
+
y1: f,
|
|
732
743
|
x2: N,
|
|
733
|
-
y2:
|
|
744
|
+
y2: S + g,
|
|
734
745
|
itemIndex: c
|
|
735
|
-
})), l[c] =
|
|
736
|
-
const b =
|
|
737
|
-
|
|
746
|
+
})), l[c] = k, r && y.isDirectory) {
|
|
747
|
+
const b = h, p = N, O = f;
|
|
748
|
+
m[c] = [
|
|
738
749
|
{
|
|
739
750
|
key: `${y.id}-glyph`,
|
|
740
751
|
itemIndex: c,
|
|
741
|
-
centerX:
|
|
742
|
-
centerY:
|
|
752
|
+
centerX: p,
|
|
753
|
+
centerY: O,
|
|
743
754
|
size: b,
|
|
744
755
|
isExpanded: y.isExpanded
|
|
745
756
|
}
|
|
746
757
|
];
|
|
747
758
|
}
|
|
748
759
|
}
|
|
749
|
-
return { segmentsByItem: l, glyphsByItem:
|
|
750
|
-
},
|
|
760
|
+
return { segmentsByItem: l, glyphsByItem: m };
|
|
761
|
+
}, Ze = qe(
|
|
751
762
|
({
|
|
752
763
|
entry: e,
|
|
753
764
|
indentLevel: t,
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
765
|
+
depth: a,
|
|
766
|
+
positionInSet: n,
|
|
767
|
+
setSize: r,
|
|
768
|
+
rowHeight: o,
|
|
769
|
+
isDirOpen: l,
|
|
770
|
+
parentIsLast: m,
|
|
771
|
+
renderChildren: I = !0,
|
|
772
|
+
expansion: { toggleDirectory: x, onToggleDirectoryRecursive: c },
|
|
773
|
+
selection: { onEntryClick: y, selectedPath: k, mode: g = "none", selectedItems: S, onSelectionChange: f },
|
|
760
774
|
visual: {
|
|
761
|
-
iconOverrides:
|
|
762
|
-
showExpandIcons:
|
|
763
|
-
showDirectoryIcons:
|
|
764
|
-
showFileIcons:
|
|
765
|
-
useCanvasExpandIcons:
|
|
766
|
-
expandIconSize:
|
|
767
|
-
typeIconSize:
|
|
768
|
-
fontSize:
|
|
769
|
-
indentSize:
|
|
775
|
+
iconOverrides: h,
|
|
776
|
+
showExpandIcons: v = !0,
|
|
777
|
+
showDirectoryIcons: M = !0,
|
|
778
|
+
showFileIcons: N = !0,
|
|
779
|
+
useCanvasExpandIcons: b = !1,
|
|
780
|
+
expandIconSize: p,
|
|
781
|
+
typeIconSize: O,
|
|
782
|
+
fontSize: D,
|
|
783
|
+
indentSize: L = Fe,
|
|
770
784
|
highlightStyles: j,
|
|
771
|
-
entryClassName:
|
|
772
|
-
entryStyle:
|
|
773
|
-
nameClassName:
|
|
774
|
-
nameStyle:
|
|
775
|
-
directoryNameClassName:
|
|
776
|
-
directoryNameStyle:
|
|
777
|
-
fileNameClassName:
|
|
778
|
-
fileNameStyle:
|
|
785
|
+
entryClassName: Z,
|
|
786
|
+
entryStyle: K,
|
|
787
|
+
nameClassName: R,
|
|
788
|
+
nameStyle: z,
|
|
789
|
+
directoryNameClassName: F,
|
|
790
|
+
directoryNameStyle: $,
|
|
791
|
+
fileNameClassName: te,
|
|
792
|
+
fileNameStyle: re
|
|
779
793
|
}
|
|
780
794
|
}) => {
|
|
781
|
-
const [
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
}, [
|
|
785
|
-
const
|
|
786
|
-
if (
|
|
787
|
-
if (
|
|
788
|
-
return j?.directorySelectedClassName !== void 0 ? j.directorySelectedClassName :
|
|
789
|
-
} else if (
|
|
790
|
-
return j?.itemSelectedClassName !== void 0 ? j.itemSelectedClassName :
|
|
795
|
+
const [P, oe] = ae(null), [G, s] = ae(!1), u = e.children !== void 0, w = u && l(e.absolutePath), E = e.absolutePath === k, B = !u && S?.has(e.absolutePath), le = u ? void 0 : ve(e.name) || ve(e.relativePath) || ve(e.absolutePath);
|
|
796
|
+
ue(() => {
|
|
797
|
+
oe(w && e.children ? e.children : null);
|
|
798
|
+
}, [w, e.children]);
|
|
799
|
+
const T = zt({ entry: e, isDirectory: u, isExpanded: w, isItemSelected: !!B, selectionMode: g, onSelectionChange: f, onEntryClick: y, toggleDirectory: x, onToggleDirectoryRecursive: c }), V = G ? j?.hoverClassName !== void 0 ? j.hoverClassName : A.entryHover : "", ne = (() => {
|
|
800
|
+
if (u) {
|
|
801
|
+
if (E)
|
|
802
|
+
return j?.directorySelectedClassName !== void 0 ? j.directorySelectedClassName : A.entrySelected;
|
|
803
|
+
} else if (E || B)
|
|
804
|
+
return j?.itemSelectedClassName !== void 0 ? j.itemSelectedClassName : _(E && A.entrySelected, B && A.entryItemSelected);
|
|
791
805
|
return "";
|
|
792
|
-
})(),
|
|
793
|
-
...
|
|
794
|
-
...
|
|
795
|
-
...!
|
|
796
|
-
},
|
|
797
|
-
return /* @__PURE__ */ i.jsxs(
|
|
806
|
+
})(), ie = _(A.entry, V, ne, Z, e.className), ye = _(A.expandIcon, (E || B) && A.expandIconSelected), Q = _(A.typeIcon, (E || B) && A.typeIconSelected), $e = _(A.name, R, u && A.nameDirectory, u && F, !u && te, (E || B) && A.nameSelected), be = Ht({ isDirectory: u, isExpanded: w, showExpandIcons: v, useCanvasExpandIcons: b, expandIconSize: p }), Te = (u ? M : N) ? Wt({ entry: e, isDirectory: u, isExpanded: w, isSelected: E, isItemSelected: !!B, extension: le, mimeType: e.mimeType }, h) : null, Ce = {
|
|
807
|
+
...G ? j?.hoverStyle : {},
|
|
808
|
+
...u && E ? j?.directorySelectedStyle : {},
|
|
809
|
+
...!u && (E || B) ? j?.itemSelectedStyle : {}
|
|
810
|
+
}, Re = Bt(e.data), Pe = O ? { width: O, height: O } : void 0, Se = D ? { fontSize: typeof D == "number" ? `${D}px` : D } : void 0;
|
|
811
|
+
return /* @__PURE__ */ i.jsxs(or, { children: [
|
|
798
812
|
/* @__PURE__ */ i.jsxs(
|
|
799
813
|
"div",
|
|
800
814
|
{
|
|
801
|
-
className:
|
|
815
|
+
className: ie,
|
|
802
816
|
style: {
|
|
803
|
-
paddingLeft: `${Math.max(0, t *
|
|
804
|
-
transform: t < 0 ? `translateX(${t *
|
|
805
|
-
width: t < 0 ? `calc(100% + ${Math.abs(t *
|
|
806
|
-
height: `${
|
|
807
|
-
...
|
|
808
|
-
...
|
|
809
|
-
...
|
|
817
|
+
paddingLeft: `${Math.max(0, t * L)}px`,
|
|
818
|
+
transform: t < 0 ? `translateX(${t * L}px)` : void 0,
|
|
819
|
+
width: t < 0 ? `calc(100% + ${Math.abs(t * L)}px)` : void 0,
|
|
820
|
+
height: `${o}px`,
|
|
821
|
+
...Se,
|
|
822
|
+
...Ce,
|
|
823
|
+
...K,
|
|
810
824
|
...e.style
|
|
811
825
|
},
|
|
812
|
-
|
|
813
|
-
"data-entry-
|
|
814
|
-
"data-entry-
|
|
815
|
-
"data-entry-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
826
|
+
...Re,
|
|
827
|
+
"data-entry-type": u ? "directory" : "file",
|
|
828
|
+
"data-entry-expanded": u ? String(w) : void 0,
|
|
829
|
+
"data-entry-selected": E ? "true" : void 0,
|
|
830
|
+
"data-entry-item-selected": B ? "true" : void 0,
|
|
831
|
+
onClick: T,
|
|
832
|
+
onMouseEnter: () => s(!0),
|
|
833
|
+
onMouseLeave: () => s(!1),
|
|
834
|
+
onKeyDown: (U) => U.key === "Enter" && T(U),
|
|
820
835
|
tabIndex: 0,
|
|
821
836
|
role: "treeitem",
|
|
822
|
-
"aria-expanded":
|
|
823
|
-
"aria-
|
|
837
|
+
"aria-expanded": u ? w : void 0,
|
|
838
|
+
"aria-level": a + 1,
|
|
839
|
+
"aria-posinset": n,
|
|
840
|
+
"aria-setsize": r,
|
|
841
|
+
"aria-label": `${e.name} (${u ? "directory" : "file"})`,
|
|
824
842
|
children: [
|
|
825
|
-
(
|
|
826
|
-
(
|
|
843
|
+
(v || b) && /* @__PURE__ */ i.jsx("span", { className: ye, children: be }),
|
|
844
|
+
(u ? M : N) && /* @__PURE__ */ i.jsx("span", { className: Q, style: Pe, children: Te }),
|
|
827
845
|
/* @__PURE__ */ i.jsx(
|
|
828
846
|
"span",
|
|
829
847
|
{
|
|
830
|
-
className:
|
|
848
|
+
className: $e,
|
|
831
849
|
style: {
|
|
832
|
-
...
|
|
833
|
-
...
|
|
834
|
-
...
|
|
850
|
+
...Se,
|
|
851
|
+
...z,
|
|
852
|
+
...u ? $ : re
|
|
835
853
|
},
|
|
836
|
-
"data-entry-type":
|
|
854
|
+
"data-entry-type": u ? "directory" : "file",
|
|
837
855
|
"data-entry-role": "name",
|
|
838
856
|
children: e.label ?? e.name
|
|
839
857
|
}
|
|
@@ -841,278 +859,293 @@ const Pr = {
|
|
|
841
859
|
]
|
|
842
860
|
}
|
|
843
861
|
),
|
|
844
|
-
|
|
845
|
-
|
|
862
|
+
w && P && I && /* @__PURE__ */ i.jsx("fieldset", { children: P.map((U, Ee) => /* @__PURE__ */ i.jsx(
|
|
863
|
+
Ze,
|
|
846
864
|
{
|
|
847
|
-
entry:
|
|
865
|
+
entry: U,
|
|
848
866
|
indentLevel: t + 1,
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
867
|
+
depth: a + 1,
|
|
868
|
+
positionInSet: Ee + 1,
|
|
869
|
+
setSize: P.length,
|
|
870
|
+
rowHeight: o,
|
|
871
|
+
isDirOpen: l,
|
|
872
|
+
parentIsLast: [...m, Ee === P.length - 1],
|
|
873
|
+
expansion: { toggleDirectory: x, onToggleDirectoryRecursive: c },
|
|
874
|
+
selection: { onEntryClick: y, selectedPath: k, mode: g, selectedItems: S, onSelectionChange: f },
|
|
854
875
|
visual: {
|
|
855
|
-
iconOverrides:
|
|
856
|
-
showExpandIcons:
|
|
857
|
-
showDirectoryIcons:
|
|
858
|
-
showFileIcons:
|
|
859
|
-
useCanvasExpandIcons:
|
|
860
|
-
expandIconSize:
|
|
876
|
+
iconOverrides: h,
|
|
877
|
+
showExpandIcons: v,
|
|
878
|
+
showDirectoryIcons: M,
|
|
879
|
+
showFileIcons: N,
|
|
880
|
+
useCanvasExpandIcons: b,
|
|
881
|
+
expandIconSize: p,
|
|
861
882
|
highlightStyles: j,
|
|
862
|
-
entryClassName:
|
|
863
|
-
entryStyle:
|
|
864
|
-
nameClassName:
|
|
865
|
-
nameStyle:
|
|
866
|
-
directoryNameClassName:
|
|
867
|
-
directoryNameStyle:
|
|
868
|
-
fileNameClassName:
|
|
869
|
-
fileNameStyle:
|
|
883
|
+
entryClassName: Z,
|
|
884
|
+
entryStyle: K,
|
|
885
|
+
nameClassName: R,
|
|
886
|
+
nameStyle: z,
|
|
887
|
+
directoryNameClassName: F,
|
|
888
|
+
directoryNameStyle: $,
|
|
889
|
+
fileNameClassName: te,
|
|
890
|
+
fileNameStyle: re
|
|
870
891
|
}
|
|
871
892
|
},
|
|
872
|
-
|
|
893
|
+
U.absolutePath
|
|
873
894
|
)) })
|
|
874
895
|
] }, e.absolutePath);
|
|
875
896
|
},
|
|
876
897
|
(e, t) => {
|
|
877
898
|
if (e.entry !== t.entry) return !1;
|
|
878
|
-
const a = e.entry.children !== void 0,
|
|
879
|
-
return e.indentLevel === t.indentLevel &&
|
|
899
|
+
const a = e.entry.children !== void 0, n = t.entry.children !== void 0, r = a && e.isDirOpen(e.entry.absolutePath), o = n && t.isDirOpen(t.entry.absolutePath);
|
|
900
|
+
return e.indentLevel === t.indentLevel && // 位置情報は aria として描画されるため、変化したら再描画が必要
|
|
901
|
+
e.depth === t.depth && e.positionInSet === t.positionInSet && e.setSize === t.setSize && e.rowHeight === t.rowHeight && r === o && e.selection.selectedPath === t.selection.selectedPath && e.selection.mode === t.selection.mode && e.selection.selectedItems === t.selection.selectedItems && e.visual.iconOverrides === t.visual.iconOverrides && e.visual.showExpandIcons === t.visual.showExpandIcons && e.visual.showDirectoryIcons === t.visual.showDirectoryIcons && e.visual.showFileIcons === t.visual.showFileIcons && e.visual.useCanvasExpandIcons === t.visual.useCanvasExpandIcons && e.visual.expandIconSize === t.visual.expandIconSize && e.visual.highlightStyles === t.visual.highlightStyles && e.visual.entryClassName === t.visual.entryClassName && e.visual.entryStyle === t.visual.entryStyle && e.visual.nameClassName === t.visual.nameClassName && e.visual.nameStyle === t.visual.nameStyle && e.visual.directoryNameClassName === t.visual.directoryNameClassName && e.visual.directoryNameStyle === t.visual.directoryNameStyle && e.visual.fileNameClassName === t.visual.fileNameClassName && e.visual.fileNameStyle === t.visual.fileNameStyle && e.parentIsLast.length === t.parentIsLast.length && e.parentIsLast.every((l, m) => l === t.parentIsLast[m]);
|
|
880
902
|
}
|
|
881
903
|
);
|
|
882
|
-
|
|
883
|
-
const
|
|
904
|
+
Ze.displayName = "DirectoryEntryItem";
|
|
905
|
+
const Zt = (e) => {
|
|
884
906
|
const t = [];
|
|
885
907
|
if (e.children)
|
|
886
908
|
for (const a of e.children)
|
|
887
|
-
a.type === "directory" && (t.push(a.absolutePath), t.push(...
|
|
909
|
+
a.type === "directory" && (t.push(a.absolutePath), t.push(...Zt(a)));
|
|
888
910
|
return t;
|
|
889
|
-
},
|
|
911
|
+
}, Gr = ({
|
|
890
912
|
entries: e,
|
|
891
|
-
expansion: { toggle: t, isExpanded: a, expandMultiple:
|
|
892
|
-
selection: { onEntryClick:
|
|
913
|
+
expansion: { toggle: t, isExpanded: a, expandMultiple: n, collapseMultiple: r, isPending: o, alwaysExpanded: l = !1, doubleClickAction: m = "recursive" },
|
|
914
|
+
selection: { onEntryClick: I, selectedPath: x, mode: c = "none", selectedItems: y, onSelectionChange: k },
|
|
893
915
|
visual: {
|
|
894
916
|
className: g,
|
|
895
|
-
style:
|
|
896
|
-
lineColor:
|
|
897
|
-
showTreeLines:
|
|
917
|
+
style: S,
|
|
918
|
+
lineColor: f = "#A0AEC0",
|
|
919
|
+
showTreeLines: h = !0,
|
|
898
920
|
showExpandIcons: v = !0,
|
|
899
|
-
showDirectoryIcons:
|
|
921
|
+
showDirectoryIcons: M = !0,
|
|
900
922
|
showFileIcons: N = !0,
|
|
901
923
|
iconOverrides: b,
|
|
902
|
-
expandIconSize:
|
|
903
|
-
itemHeight:
|
|
904
|
-
removeRootIndent:
|
|
924
|
+
expandIconSize: p,
|
|
925
|
+
itemHeight: O = Le,
|
|
926
|
+
removeRootIndent: D = !1,
|
|
905
927
|
highlightStyles: L,
|
|
906
|
-
entryClassName:
|
|
907
|
-
entryStyle:
|
|
908
|
-
nameClassName:
|
|
909
|
-
nameStyle:
|
|
910
|
-
directoryNameClassName:
|
|
911
|
-
directoryNameStyle:
|
|
912
|
-
fileNameClassName:
|
|
913
|
-
fileNameStyle:
|
|
928
|
+
entryClassName: j,
|
|
929
|
+
entryStyle: Z,
|
|
930
|
+
nameClassName: K,
|
|
931
|
+
nameStyle: R,
|
|
932
|
+
directoryNameClassName: z,
|
|
933
|
+
directoryNameStyle: F,
|
|
934
|
+
fileNameClassName: $,
|
|
935
|
+
fileNameStyle: te
|
|
914
936
|
} = {},
|
|
915
|
-
virtualScroll:
|
|
916
|
-
grid:
|
|
917
|
-
sort:
|
|
937
|
+
virtualScroll: re,
|
|
938
|
+
grid: P,
|
|
939
|
+
sort: oe
|
|
918
940
|
}) => {
|
|
919
|
-
const
|
|
920
|
-
overscanCount:
|
|
921
|
-
className:
|
|
922
|
-
background:
|
|
923
|
-
onScroll:
|
|
924
|
-
onRangeChange:
|
|
925
|
-
initialScrollIndex:
|
|
926
|
-
initialScrollOffset:
|
|
927
|
-
callbackThrottleMs:
|
|
928
|
-
contentInsets:
|
|
941
|
+
const G = P !== void 0, [s, u] = ae(!1), w = de(null), E = de(null), B = de(null), [le, T] = ae(0), [V, ne] = ae(0), [ie, ye] = ae(0), [Q, $e] = ae(null), {
|
|
942
|
+
overscanCount: be = 15,
|
|
943
|
+
className: Te,
|
|
944
|
+
background: Ce,
|
|
945
|
+
onScroll: Re,
|
|
946
|
+
onRangeChange: Pe,
|
|
947
|
+
initialScrollIndex: Se,
|
|
948
|
+
initialScrollOffset: U,
|
|
949
|
+
callbackThrottleMs: Ee = 5,
|
|
950
|
+
contentInsets: ge,
|
|
929
951
|
onItemFocus: Ke,
|
|
930
|
-
viewportHeightOverride:
|
|
931
|
-
scrollBarOptions:
|
|
952
|
+
viewportHeightOverride: se,
|
|
953
|
+
scrollBarOptions: He,
|
|
932
954
|
behaviorOptions: Qe,
|
|
933
955
|
preserveScrollAnchor: et = !1,
|
|
934
|
-
getItemKey:
|
|
935
|
-
|
|
936
|
-
(
|
|
937
|
-
|
|
956
|
+
getItemKey: Kt,
|
|
957
|
+
// 素通しの pass-through。型で受け付けているものは実際に転送する
|
|
958
|
+
// (`role="tree"` は本コンポーネント自身のコンテナに付くため contentProps とは別要素で衝突しない)
|
|
959
|
+
testId: tt,
|
|
960
|
+
contentProps: rt
|
|
961
|
+
} = re ?? {}, [_e, We] = ae(typeof U == "number" ? U : 0), Be = de(typeof U == "number" ? U : 0), nt = W(
|
|
962
|
+
(d, C) => {
|
|
963
|
+
Be.current = d, We(d), Re?.(d, C);
|
|
938
964
|
},
|
|
939
|
-
[
|
|
940
|
-
),
|
|
965
|
+
[Re]
|
|
966
|
+
), st = W(
|
|
941
967
|
(d) => {
|
|
942
|
-
const { renderingStartIndex:
|
|
943
|
-
|
|
968
|
+
const { renderingStartIndex: C, renderingEndIndex: H } = d;
|
|
969
|
+
$e((J) => J && J.renderStart === C && J.renderEnd === H ? J : { renderStart: C, renderEnd: H }), Pe?.(d);
|
|
944
970
|
},
|
|
945
|
-
[
|
|
971
|
+
[Pe]
|
|
946
972
|
);
|
|
947
|
-
|
|
948
|
-
typeof
|
|
949
|
-
}, [
|
|
950
|
-
|
|
951
|
-
}, []),
|
|
952
|
-
const d =
|
|
973
|
+
ue(() => {
|
|
974
|
+
typeof U == "number" && We(U);
|
|
975
|
+
}, [U]), ue(() => {
|
|
976
|
+
u(!0), Dr();
|
|
977
|
+
}, []), ue(() => {
|
|
978
|
+
const d = w.current, C = G ? E.current : d, H = () => {
|
|
953
979
|
if (d) {
|
|
954
|
-
const
|
|
955
|
-
|
|
980
|
+
const ee = d.clientWidth;
|
|
981
|
+
ne((ce) => Math.abs(ce - ee) > 1 ? ee : ce);
|
|
956
982
|
}
|
|
957
|
-
if (typeof
|
|
958
|
-
|
|
959
|
-
else if (
|
|
960
|
-
const
|
|
961
|
-
|
|
983
|
+
if (typeof se == "number")
|
|
984
|
+
T((ee) => Math.abs(ee - se) > 1 ? se : ee);
|
|
985
|
+
else if (C) {
|
|
986
|
+
const ee = C.clientHeight;
|
|
987
|
+
T((ce) => Math.abs(ce - ee) > 1 ? ee : ce);
|
|
962
988
|
}
|
|
963
989
|
};
|
|
964
|
-
if (!(d ||
|
|
990
|
+
if (!(d || C)) return T(0);
|
|
965
991
|
H();
|
|
966
992
|
const J = new ResizeObserver(H);
|
|
967
|
-
return d && J.observe(d),
|
|
968
|
-
}, [
|
|
969
|
-
const me = typeof
|
|
993
|
+
return d && J.observe(d), C && C !== d && J.observe(C), () => J.disconnect();
|
|
994
|
+
}, [se, G]);
|
|
995
|
+
const me = typeof se == "number" ? se : le, fe = W((d) => l || (s ? a(d) : !1), [s, a, l]), at = _(A.container, o && A.containerPending, g), ot = q(
|
|
970
996
|
() => ({
|
|
971
|
-
...
|
|
972
|
-
...
|
|
973
|
-
...typeof
|
|
997
|
+
...Or,
|
|
998
|
+
...S ?? {},
|
|
999
|
+
...typeof se == "number" ? { height: se, minHeight: se } : {}
|
|
974
1000
|
}),
|
|
975
|
-
[
|
|
976
|
-
),
|
|
977
|
-
(d,
|
|
978
|
-
const H = [d.absolutePath, ...
|
|
979
|
-
if (H.every((
|
|
980
|
-
if (H.every((
|
|
1001
|
+
[S, se]
|
|
1002
|
+
), ze = W(
|
|
1003
|
+
(d, C) => {
|
|
1004
|
+
const H = [d.absolutePath, ...Zt(d)], J = C || m;
|
|
1005
|
+
if (H.every((Ne) => fe(Ne))) return r(H);
|
|
1006
|
+
if (H.every((Ne) => !fe(Ne)) || J === "recursive") return n(H);
|
|
981
1007
|
if (J === "toggle") return r(H);
|
|
982
1008
|
console.warn(`[DirectoryTree] Unknown double click action: ${J}. No action taken.`);
|
|
983
1009
|
},
|
|
984
|
-
[fe,
|
|
985
|
-
),
|
|
986
|
-
() =>
|
|
987
|
-
const H = typeof
|
|
988
|
-
return { ...d, rowHeight: Number.isFinite(H) && H > 0 ? H :
|
|
1010
|
+
[fe, n, r, m]
|
|
1011
|
+
), lt = G ? !1 : D, { flatItems: it, lineItems: Ye, maxIndent: ct } = q(() => Lr(e, fe, h, lt, oe), [e, fe, h, lt, oe]), Y = q(
|
|
1012
|
+
() => it.map((d, C) => {
|
|
1013
|
+
const H = typeof O == "function" ? O(d.entry, C) : O;
|
|
1014
|
+
return { ...d, rowHeight: Number.isFinite(H) && H > 0 ? H : Le };
|
|
989
1015
|
}),
|
|
990
|
-
[
|
|
991
|
-
), he = q(() =>
|
|
1016
|
+
[it, O]
|
|
1017
|
+
), he = q(() => Y.map((d) => d.rowHeight), [Y]), xe = q(() => {
|
|
992
1018
|
const d = new Array(he.length + 1);
|
|
993
1019
|
d[0] = 0;
|
|
994
|
-
for (let
|
|
995
|
-
d[
|
|
1020
|
+
for (let C = 0; C < he.length; C++)
|
|
1021
|
+
d[C + 1] = d[C] + he[C];
|
|
996
1022
|
return d;
|
|
997
|
-
}, [he]),
|
|
998
|
-
() => !
|
|
999
|
-
[
|
|
1000
|
-
),
|
|
1001
|
-
() =>
|
|
1002
|
-
[
|
|
1003
|
-
),
|
|
1004
|
-
|
|
1023
|
+
}, [he]), dt = W((d) => Y[d]?.rowHeight ?? Le, [Y]), Qt = W((d) => Y[d]?.entry.absolutePath ?? d, [Y]), ut = Kt ?? Qt, Ae = q(
|
|
1024
|
+
() => !h || Ye.length === 0 ? { segmentsByItem: [], glyphsByItem: [] } : $r(Ye, he, xe, Fe, h, p ?? Dt),
|
|
1025
|
+
[Ye, he, xe, h, p]
|
|
1026
|
+
), Me = q(() => !h || e.length === 0 ? 0 : (ct + 2) * Fe, [e.length, ct, h]), { renderStart: mt, renderEnd: ft, lookaheadEnd: ht } = q(
|
|
1027
|
+
() => Fr(Y.length, me, be, Q, _e, xe),
|
|
1028
|
+
[Y.length, me, be, Q, _e, xe]
|
|
1029
|
+
), Ge = q(() => !h || Me <= 0 || me <= 0 || Ae.segmentsByItem.length === 0 ? null : /* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute inset-0 z-0", "aria-hidden": "true", children: /* @__PURE__ */ i.jsx("div", { className: "absolute top-0 left-0", style: { width: Me, height: me }, children: /* @__PURE__ */ i.jsx(
|
|
1030
|
+
qt,
|
|
1005
1031
|
{
|
|
1006
|
-
segmentsByItem:
|
|
1007
|
-
glyphsByItem:
|
|
1008
|
-
itemHeight: he[0] ??
|
|
1009
|
-
width:
|
|
1032
|
+
segmentsByItem: Ae.segmentsByItem,
|
|
1033
|
+
glyphsByItem: Ae.glyphsByItem,
|
|
1034
|
+
itemHeight: he[0] ?? Le,
|
|
1035
|
+
width: Me,
|
|
1010
1036
|
viewportHeight: me,
|
|
1011
|
-
scrollPosition:
|
|
1012
|
-
color:
|
|
1013
|
-
expandGlyphColor:
|
|
1014
|
-
expandGlyphSize:
|
|
1015
|
-
renderStartIndex:
|
|
1016
|
-
renderEndIndex:
|
|
1017
|
-
lookaheadEndIndex:
|
|
1037
|
+
scrollPosition: _e,
|
|
1038
|
+
color: f,
|
|
1039
|
+
expandGlyphColor: f,
|
|
1040
|
+
expandGlyphSize: p ?? Dt,
|
|
1041
|
+
renderStartIndex: mt,
|
|
1042
|
+
renderEndIndex: ft,
|
|
1043
|
+
lookaheadEndIndex: ht
|
|
1018
1044
|
}
|
|
1019
|
-
) }) }), [
|
|
1020
|
-
|
|
1021
|
-
const d =
|
|
1022
|
-
if (
|
|
1045
|
+
) }) }), [Me, me, mt, ft, ht, _e, Ae, f, h, p, he]), pt = W((d) => Y[d], [Y]), yt = de(null);
|
|
1046
|
+
ar(() => {
|
|
1047
|
+
const d = yt.current;
|
|
1048
|
+
if (yt.current = { items: Y, offsets: xe }, !et || !d || d.items === Y)
|
|
1023
1049
|
return;
|
|
1024
|
-
const
|
|
1025
|
-
if (!
|
|
1050
|
+
const C = B.current, H = typeof ge == "number" ? ge : ge?.top ?? 0, J = C ? C.getScrollPosition() : Be.current, ee = J - H, ce = jr(d.items, d.offsets, ee);
|
|
1051
|
+
if (!ce)
|
|
1026
1052
|
return;
|
|
1027
|
-
const
|
|
1028
|
-
if (
|
|
1053
|
+
const Ne = Tr(ce, Y, xe);
|
|
1054
|
+
if (Ne === null)
|
|
1029
1055
|
return;
|
|
1030
|
-
const
|
|
1031
|
-
if (Math.abs(
|
|
1056
|
+
const Ve = Ne + H;
|
|
1057
|
+
if (Math.abs(Ve - J) < 1)
|
|
1032
1058
|
return;
|
|
1033
|
-
const
|
|
1034
|
-
|
|
1035
|
-
}, [
|
|
1036
|
-
const pe =
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
}, [
|
|
1040
|
-
const
|
|
1041
|
-
() => ({ iconOverrides: b, showExpandIcons: v, showDirectoryIcons:
|
|
1042
|
-
[b, v,
|
|
1043
|
-
),
|
|
1059
|
+
const gt = C?.scrollTo(Ve) ?? Ve;
|
|
1060
|
+
Be.current = gt, We(gt);
|
|
1061
|
+
}, [Y, xe, et, ge]);
|
|
1062
|
+
const pe = P?.columns, we = P?.scrollBarWidth ?? He?.width ?? Jt, X = q(() => pe ? Sr({ measuredWidth: V, columns: pe, scrollBarWidth: we }) : null, [pe, V, we]), Oe = q(() => pe ? Nr(pe) : "", [pe]), er = q(() => P?.showFooter && pe ? Er(e) : [], [P?.showFooter, pe, e]), ke = X?.maxHScroll ?? 0;
|
|
1063
|
+
ue(() => {
|
|
1064
|
+
ye((d) => Ue(d, ke));
|
|
1065
|
+
}, [ke]);
|
|
1066
|
+
const xt = W((d) => ye((C) => Ue(C + d, ke)), [ke]), vt = q(
|
|
1067
|
+
() => ({ iconOverrides: b, showExpandIcons: v, showDirectoryIcons: M, showFileIcons: N, useCanvasExpandIcons: h, expandIconSize: p, highlightStyles: L }),
|
|
1068
|
+
[b, v, M, N, h, p, L]
|
|
1069
|
+
), bt = q(
|
|
1044
1070
|
() => /* @__PURE__ */ i.jsx(
|
|
1045
|
-
|
|
1071
|
+
ir,
|
|
1046
1072
|
{
|
|
1047
|
-
ref:
|
|
1048
|
-
itemCount:
|
|
1049
|
-
getItem:
|
|
1050
|
-
getItemHeight:
|
|
1051
|
-
getItemKey:
|
|
1073
|
+
ref: B,
|
|
1074
|
+
itemCount: Y.length,
|
|
1075
|
+
getItem: pt,
|
|
1076
|
+
getItemHeight: dt,
|
|
1077
|
+
getItemKey: ut,
|
|
1078
|
+
testId: tt,
|
|
1079
|
+
contentProps: rt,
|
|
1052
1080
|
viewportSize: me,
|
|
1053
|
-
overscanCount:
|
|
1054
|
-
onScroll:
|
|
1055
|
-
onRangeChange:
|
|
1056
|
-
className:
|
|
1057
|
-
onWheelHorizontal:
|
|
1081
|
+
overscanCount: be,
|
|
1082
|
+
onScroll: nt,
|
|
1083
|
+
onRangeChange: st,
|
|
1084
|
+
className: Te,
|
|
1085
|
+
onWheelHorizontal: G ? xt : void 0,
|
|
1058
1086
|
background: /* @__PURE__ */ i.jsxs(i.Fragment, { children: [
|
|
1059
|
-
|
|
1087
|
+
G && X ? (
|
|
1060
1088
|
// Clip the connector-line canvas to the frozen name column so deep trees never bleed into the numeric region.
|
|
1061
|
-
/* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: X.nameWidth }, "aria-hidden": "true", children:
|
|
1062
|
-
) :
|
|
1063
|
-
|
|
1089
|
+
/* @__PURE__ */ i.jsx("div", { className: "pointer-events-none absolute top-0 left-0 z-0 h-full overflow-hidden", style: { width: X.nameWidth }, "aria-hidden": "true", children: Ge })
|
|
1090
|
+
) : Ge,
|
|
1091
|
+
Ce
|
|
1064
1092
|
] }),
|
|
1065
|
-
initialScrollIndex:
|
|
1066
|
-
initialScrollOffset:
|
|
1093
|
+
initialScrollIndex: Se,
|
|
1094
|
+
initialScrollOffset: U,
|
|
1067
1095
|
onItemFocus: Ke,
|
|
1068
|
-
callbackThrottleMs:
|
|
1069
|
-
contentInsets:
|
|
1070
|
-
scrollBarOptions:
|
|
1096
|
+
callbackThrottleMs: Ee,
|
|
1097
|
+
contentInsets: ge,
|
|
1098
|
+
scrollBarOptions: He,
|
|
1071
1099
|
behaviorOptions: Qe,
|
|
1072
|
-
children: (d) => d ?
|
|
1073
|
-
|
|
1100
|
+
children: (d) => d ? G && P && X ? /* @__PURE__ */ i.jsx(
|
|
1101
|
+
Vt,
|
|
1074
1102
|
{
|
|
1075
1103
|
entry: d.entry,
|
|
1076
1104
|
indentLevel: d.indentLevel,
|
|
1105
|
+
positionInSet: d.positionInSet,
|
|
1106
|
+
setSize: d.setSize,
|
|
1077
1107
|
rowHeight: d.rowHeight,
|
|
1078
1108
|
isDirOpen: fe,
|
|
1079
|
-
columns:
|
|
1080
|
-
numericTemplate:
|
|
1109
|
+
columns: P.columns,
|
|
1110
|
+
numericTemplate: Oe,
|
|
1081
1111
|
numericTotal: X.numericTotal,
|
|
1082
1112
|
nameWidth: X.nameWidth,
|
|
1083
|
-
rowClassName:
|
|
1084
|
-
selection: { onEntryClick:
|
|
1085
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1086
|
-
visual:
|
|
1113
|
+
rowClassName: P.rowClassName,
|
|
1114
|
+
selection: { onEntryClick: I, selectedPath: x ?? null, mode: c, selectedItems: y, onSelectionChange: k },
|
|
1115
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: ze },
|
|
1116
|
+
visual: vt
|
|
1087
1117
|
},
|
|
1088
1118
|
d.entry.absolutePath
|
|
1089
1119
|
) : /* @__PURE__ */ i.jsx(
|
|
1090
|
-
|
|
1120
|
+
Ze,
|
|
1091
1121
|
{
|
|
1092
1122
|
entry: d.entry,
|
|
1093
1123
|
indentLevel: d.indentLevel,
|
|
1124
|
+
depth: d.depth,
|
|
1125
|
+
positionInSet: d.positionInSet,
|
|
1126
|
+
setSize: d.setSize,
|
|
1094
1127
|
rowHeight: d.rowHeight,
|
|
1095
1128
|
isDirOpen: fe,
|
|
1096
1129
|
parentIsLast: d.parentIsLast,
|
|
1097
1130
|
renderChildren: !1,
|
|
1098
|
-
expansion: { toggleDirectory: t, onToggleDirectoryRecursive:
|
|
1099
|
-
selection: { onEntryClick:
|
|
1131
|
+
expansion: { toggleDirectory: t, onToggleDirectoryRecursive: ze },
|
|
1132
|
+
selection: { onEntryClick: I, selectedPath: x ?? null, mode: c, selectedItems: y, onSelectionChange: k },
|
|
1100
1133
|
visual: {
|
|
1101
1134
|
iconOverrides: b,
|
|
1102
1135
|
showExpandIcons: v,
|
|
1103
|
-
showDirectoryIcons:
|
|
1136
|
+
showDirectoryIcons: M,
|
|
1104
1137
|
showFileIcons: N,
|
|
1105
|
-
useCanvasExpandIcons:
|
|
1106
|
-
expandIconSize:
|
|
1138
|
+
useCanvasExpandIcons: h,
|
|
1139
|
+
expandIconSize: p,
|
|
1107
1140
|
highlightStyles: L,
|
|
1108
|
-
entryClassName:
|
|
1109
|
-
entryStyle:
|
|
1110
|
-
nameClassName:
|
|
1111
|
-
nameStyle:
|
|
1112
|
-
directoryNameClassName:
|
|
1113
|
-
directoryNameStyle:
|
|
1114
|
-
fileNameClassName:
|
|
1115
|
-
fileNameStyle:
|
|
1141
|
+
entryClassName: j,
|
|
1142
|
+
entryStyle: Z,
|
|
1143
|
+
nameClassName: K,
|
|
1144
|
+
nameStyle: R,
|
|
1145
|
+
directoryNameClassName: z,
|
|
1146
|
+
directoryNameStyle: F,
|
|
1147
|
+
fileNameClassName: $,
|
|
1148
|
+
fileNameStyle: te
|
|
1116
1149
|
}
|
|
1117
1150
|
},
|
|
1118
1151
|
d.entry.absolutePath
|
|
@@ -1120,172 +1153,174 @@ const Xt = (e) => {
|
|
|
1120
1153
|
}
|
|
1121
1154
|
),
|
|
1122
1155
|
[
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
me,
|
|
1128
|
-
ve,
|
|
1156
|
+
Y.length,
|
|
1157
|
+
pt,
|
|
1158
|
+
dt,
|
|
1159
|
+
ut,
|
|
1129
1160
|
tt,
|
|
1130
1161
|
rt,
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1162
|
+
me,
|
|
1163
|
+
be,
|
|
1164
|
+
nt,
|
|
1165
|
+
st,
|
|
1166
|
+
Te,
|
|
1167
|
+
G,
|
|
1168
|
+
xt,
|
|
1134
1169
|
X,
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1170
|
+
Ge,
|
|
1171
|
+
Ce,
|
|
1172
|
+
Se,
|
|
1173
|
+
U,
|
|
1139
1174
|
Ke,
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1175
|
+
Ee,
|
|
1176
|
+
ge,
|
|
1177
|
+
He,
|
|
1143
1178
|
Qe,
|
|
1144
|
-
|
|
1145
|
-
|
|
1179
|
+
P,
|
|
1180
|
+
Oe,
|
|
1146
1181
|
fe,
|
|
1147
|
-
|
|
1182
|
+
I,
|
|
1148
1183
|
x,
|
|
1149
1184
|
c,
|
|
1150
1185
|
y,
|
|
1151
|
-
|
|
1186
|
+
k,
|
|
1152
1187
|
t,
|
|
1153
|
-
|
|
1154
|
-
|
|
1188
|
+
ze,
|
|
1189
|
+
vt,
|
|
1155
1190
|
b,
|
|
1156
1191
|
v,
|
|
1157
|
-
|
|
1192
|
+
M,
|
|
1158
1193
|
N,
|
|
1159
|
-
f,
|
|
1160
1194
|
h,
|
|
1195
|
+
p,
|
|
1161
1196
|
L,
|
|
1162
|
-
|
|
1163
|
-
P,
|
|
1164
|
-
Y,
|
|
1165
|
-
F,
|
|
1166
|
-
W,
|
|
1197
|
+
j,
|
|
1167
1198
|
Z,
|
|
1199
|
+
K,
|
|
1200
|
+
R,
|
|
1168
1201
|
z,
|
|
1169
|
-
|
|
1202
|
+
F,
|
|
1203
|
+
$,
|
|
1204
|
+
te
|
|
1170
1205
|
]
|
|
1171
1206
|
);
|
|
1172
|
-
if (!(
|
|
1173
|
-
return /* @__PURE__ */ i.jsx("div", { ref:
|
|
1174
|
-
const
|
|
1175
|
-
return /* @__PURE__ */ i.jsxs("div", { ref:
|
|
1176
|
-
|
|
1177
|
-
/* @__PURE__ */ i.jsx("div", { ref:
|
|
1178
|
-
|
|
1207
|
+
if (!(P && X))
|
|
1208
|
+
return /* @__PURE__ */ i.jsx("div", { ref: w, className: at, style: ot, role: "tree", children: bt });
|
|
1209
|
+
const tr = P.showHeader ?? !0, rr = P.showFooter ?? !1, nr = { ...ot, "--dt-hscroll": `${ie}px` };
|
|
1210
|
+
return /* @__PURE__ */ i.jsxs("div", { ref: w, className: _(at, "dt-grid"), style: nr, role: "treegrid", children: [
|
|
1211
|
+
tr && /* @__PURE__ */ i.jsx(gr, { columns: P.columns, numericTemplate: Oe, numericTotal: X.numericTotal, nameWidth: X.nameWidth, scrollBarWidth: we, className: P.headerClassName }),
|
|
1212
|
+
/* @__PURE__ */ i.jsx("div", { ref: E, className: "dt-grid-body", children: bt }),
|
|
1213
|
+
ke > 0 && /* @__PURE__ */ i.jsxs("div", { className: "dt-grid-hscrollbar-row", children: [
|
|
1179
1214
|
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: X.nameWidth }, "aria-hidden": "true" }),
|
|
1180
1215
|
/* @__PURE__ */ i.jsx(
|
|
1181
|
-
|
|
1216
|
+
cr,
|
|
1182
1217
|
{
|
|
1183
1218
|
horizontal: !0,
|
|
1184
1219
|
contentSize: X.numericTotal,
|
|
1185
1220
|
viewportSize: X.numericVisible,
|
|
1186
|
-
scrollPosition:
|
|
1187
|
-
scrollBarWidth:
|
|
1221
|
+
scrollPosition: ie,
|
|
1222
|
+
scrollBarWidth: we,
|
|
1188
1223
|
onScroll: (d) => {
|
|
1189
|
-
const
|
|
1190
|
-
return
|
|
1224
|
+
const C = typeof d == "function" ? d(ie) : d, H = Ue(C, ke);
|
|
1225
|
+
return ye(H), H;
|
|
1191
1226
|
}
|
|
1192
1227
|
}
|
|
1193
1228
|
),
|
|
1194
|
-
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width:
|
|
1229
|
+
/* @__PURE__ */ i.jsx("div", { className: "dt-grid-scrollbar-spacer", style: { width: we }, "aria-hidden": "true" })
|
|
1195
1230
|
] }),
|
|
1196
|
-
|
|
1231
|
+
rr && /* @__PURE__ */ i.jsx(wr, { columns: P.columns, numericTemplate: Oe, numericTotal: X.numericTotal, nameWidth: X.nameWidth, scrollBarWidth: we, allEntries: er, className: P.footerClassName })
|
|
1197
1232
|
] });
|
|
1198
|
-
},
|
|
1199
|
-
const [a,
|
|
1233
|
+
}, Vr = ({ initialExpanded: e = /* @__PURE__ */ new Set(), storageKey: t } = {}) => {
|
|
1234
|
+
const [a, n] = lr(), [r, o] = ae(() => {
|
|
1200
1235
|
if (typeof window < "u" && t)
|
|
1201
1236
|
try {
|
|
1202
|
-
const
|
|
1203
|
-
if (
|
|
1204
|
-
const
|
|
1205
|
-
return new Set(
|
|
1237
|
+
const f = window.localStorage.getItem(t);
|
|
1238
|
+
if (f) {
|
|
1239
|
+
const h = JSON.parse(f);
|
|
1240
|
+
return new Set(h);
|
|
1206
1241
|
}
|
|
1207
|
-
} catch (
|
|
1208
|
-
console.error("[useDirectoryTreeState] Error reading from localStorage",
|
|
1242
|
+
} catch (f) {
|
|
1243
|
+
console.error("[useDirectoryTreeState] Error reading from localStorage", f);
|
|
1209
1244
|
}
|
|
1210
1245
|
return e;
|
|
1211
|
-
}), l =
|
|
1212
|
-
|
|
1213
|
-
o((
|
|
1214
|
-
const v = new Set(
|
|
1215
|
-
return
|
|
1246
|
+
}), l = W((f) => {
|
|
1247
|
+
n(() => {
|
|
1248
|
+
o((h) => {
|
|
1249
|
+
const v = new Set(h);
|
|
1250
|
+
return f(v), v;
|
|
1216
1251
|
});
|
|
1217
1252
|
});
|
|
1218
|
-
}, []),
|
|
1219
|
-
(
|
|
1253
|
+
}, []), m = W(
|
|
1254
|
+
(f, h) => {
|
|
1220
1255
|
l((v) => {
|
|
1221
|
-
for (const
|
|
1222
|
-
|
|
1256
|
+
for (const M of f)
|
|
1257
|
+
h(v, M);
|
|
1223
1258
|
});
|
|
1224
1259
|
},
|
|
1225
1260
|
[l]
|
|
1226
1261
|
);
|
|
1227
|
-
|
|
1262
|
+
ue(() => {
|
|
1228
1263
|
if (t && typeof window < "u")
|
|
1229
1264
|
try {
|
|
1230
1265
|
window.localStorage.setItem(t, JSON.stringify(Array.from(r)));
|
|
1231
|
-
} catch (
|
|
1232
|
-
console.warn(`Error setting localStorage key "${t}":`,
|
|
1266
|
+
} catch (f) {
|
|
1267
|
+
console.warn(`Error setting localStorage key "${t}":`, f);
|
|
1233
1268
|
}
|
|
1234
1269
|
}, [r, t]);
|
|
1235
|
-
const
|
|
1236
|
-
(
|
|
1237
|
-
|
|
1238
|
-
|
|
1270
|
+
const I = W(
|
|
1271
|
+
(f) => {
|
|
1272
|
+
m([f], (h, v) => {
|
|
1273
|
+
h.has(v) ? h.delete(v) : h.add(v);
|
|
1239
1274
|
});
|
|
1240
1275
|
},
|
|
1241
|
-
[
|
|
1242
|
-
), x =
|
|
1243
|
-
(
|
|
1244
|
-
|
|
1245
|
-
|
|
1276
|
+
[m]
|
|
1277
|
+
), x = W(
|
|
1278
|
+
(f) => {
|
|
1279
|
+
m([f], (h, v) => {
|
|
1280
|
+
h.add(v);
|
|
1246
1281
|
});
|
|
1247
1282
|
},
|
|
1248
|
-
[
|
|
1249
|
-
), c =
|
|
1250
|
-
(
|
|
1251
|
-
|
|
1252
|
-
|
|
1283
|
+
[m]
|
|
1284
|
+
), c = W(
|
|
1285
|
+
(f) => {
|
|
1286
|
+
m([f], (h, v) => {
|
|
1287
|
+
h.delete(v);
|
|
1253
1288
|
});
|
|
1254
1289
|
},
|
|
1255
|
-
[
|
|
1256
|
-
), y =
|
|
1257
|
-
(
|
|
1258
|
-
|
|
1259
|
-
|
|
1290
|
+
[m]
|
|
1291
|
+
), y = W(
|
|
1292
|
+
(f) => {
|
|
1293
|
+
m(f, (h, v) => {
|
|
1294
|
+
h.delete(v);
|
|
1260
1295
|
});
|
|
1261
1296
|
},
|
|
1262
|
-
[
|
|
1263
|
-
),
|
|
1264
|
-
(
|
|
1265
|
-
|
|
1266
|
-
|
|
1297
|
+
[m]
|
|
1298
|
+
), k = W(
|
|
1299
|
+
(f) => {
|
|
1300
|
+
m(f, (h, v) => {
|
|
1301
|
+
h.add(v);
|
|
1267
1302
|
});
|
|
1268
1303
|
},
|
|
1269
|
-
[
|
|
1270
|
-
), g =
|
|
1271
|
-
l((
|
|
1272
|
-
|
|
1304
|
+
[m]
|
|
1305
|
+
), g = W(() => {
|
|
1306
|
+
l((f) => {
|
|
1307
|
+
f.clear();
|
|
1273
1308
|
});
|
|
1274
|
-
}, [l]),
|
|
1309
|
+
}, [l]), S = W((f) => r.has(f), [r]);
|
|
1275
1310
|
return {
|
|
1276
1311
|
expanded: r,
|
|
1277
|
-
toggle:
|
|
1312
|
+
toggle: I,
|
|
1278
1313
|
expand: x,
|
|
1279
1314
|
collapse: c,
|
|
1280
1315
|
collapseMultiple: y,
|
|
1281
|
-
expandMultiple:
|
|
1316
|
+
expandMultiple: k,
|
|
1282
1317
|
collapseAll: g,
|
|
1283
|
-
isExpanded:
|
|
1318
|
+
isExpanded: S,
|
|
1284
1319
|
isPending: a
|
|
1285
1320
|
};
|
|
1286
1321
|
};
|
|
1287
1322
|
export {
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1323
|
+
Gr as DirectoryTree,
|
|
1324
|
+
A as directoryTreeClasses,
|
|
1325
|
+
Vr as useDirectoryTreeState
|
|
1291
1326
|
};
|