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