@dotdirfm/ui 0.1.6 → 0.1.8
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/dotdir.js +7 -7
- package/dist/dotdir.mjs +830 -808
- package/dist/lib/DotDir.d.ts +5 -1
- package/dist/lib/utils/vfs.d.ts +8 -1
- package/package.json +1 -1
package/dist/dotdir.mjs
CHANGED
|
@@ -3332,19 +3332,33 @@ function qt(e, t) {
|
|
|
3332
3332
|
}
|
|
3333
3333
|
//#endregion
|
|
3334
3334
|
//#region lib/utils/vfs.ts
|
|
3335
|
-
|
|
3335
|
+
var Jt = [], Yt = n(null);
|
|
3336
|
+
function Xt(e) {
|
|
3336
3337
|
return e.split("/").map((e) => encodeURIComponent(e)).join("/");
|
|
3337
3338
|
}
|
|
3338
|
-
function
|
|
3339
|
+
function Zt(e) {
|
|
3339
3340
|
return e.replace(/\\/g, "/").replace(/(^|\/)([A-Za-z]):(?=\/|$)/g, "$1$2/");
|
|
3340
3341
|
}
|
|
3341
|
-
function
|
|
3342
|
-
let
|
|
3343
|
-
return
|
|
3342
|
+
function Qt(e, t) {
|
|
3343
|
+
let n = e.startsWith("/") ? e : `/${e}`;
|
|
3344
|
+
return t === "extension-directory" ? `/_ext${n}` : n;
|
|
3345
|
+
}
|
|
3346
|
+
var $t = (e, t = "file") => {
|
|
3347
|
+
let n = Qt(e, t);
|
|
3348
|
+
return "__TAURI_INTERNALS__" in window ? typeof navigator < "u" && /Windows/i.test(navigator.userAgent) ? `http://vfs.localhost${Xt(Zt(n))}` : `vfs://vfs${Xt(n)}` : `${window.location.origin}/vfs/${Xt(n.replace(/^\/+/, ""))}`;
|
|
3349
|
+
};
|
|
3350
|
+
function en(e) {
|
|
3351
|
+
return Jt.push(e), () => {
|
|
3352
|
+
let t = Jt.lastIndexOf(e);
|
|
3353
|
+
t >= 0 && Jt.splice(t, 1);
|
|
3354
|
+
};
|
|
3355
|
+
}
|
|
3356
|
+
function tn() {
|
|
3357
|
+
return a(Yt) ?? $t;
|
|
3344
3358
|
}
|
|
3345
3359
|
//#endregion
|
|
3346
3360
|
//#region lib/viewerEditorRegistry.ts
|
|
3347
|
-
function
|
|
3361
|
+
function nn(e, t) {
|
|
3348
3362
|
if (e === "*" || e === "*.*") return !0;
|
|
3349
3363
|
if (e.startsWith("*.")) {
|
|
3350
3364
|
let n = e.slice(1);
|
|
@@ -3352,14 +3366,14 @@ function Zt(e, t) {
|
|
|
3352
3366
|
}
|
|
3353
3367
|
return t.toLowerCase() === e.toLowerCase();
|
|
3354
3368
|
}
|
|
3355
|
-
function
|
|
3356
|
-
return e.some((e) =>
|
|
3369
|
+
function rn(e, t) {
|
|
3370
|
+
return e.some((e) => nn(e, t));
|
|
3357
3371
|
}
|
|
3358
|
-
function
|
|
3359
|
-
let n = e.filter((e) =>
|
|
3372
|
+
function an(e, t) {
|
|
3373
|
+
let n = e.filter((e) => rn(e.contribution.patterns, t));
|
|
3360
3374
|
return n.length === 0 ? null : (n.sort((e, t) => (t.contribution.priority ?? 0) - (e.contribution.priority ?? 0)), n[0]);
|
|
3361
3375
|
}
|
|
3362
|
-
var
|
|
3376
|
+
var on = class {
|
|
3363
3377
|
entries = [];
|
|
3364
3378
|
listeners = /* @__PURE__ */ new Set();
|
|
3365
3379
|
clear() {
|
|
@@ -3372,7 +3386,7 @@ var en = class {
|
|
|
3372
3386
|
});
|
|
3373
3387
|
}
|
|
3374
3388
|
resolve(e) {
|
|
3375
|
-
return
|
|
3389
|
+
return an(this.entries, e);
|
|
3376
3390
|
}
|
|
3377
3391
|
getAll() {
|
|
3378
3392
|
return this.entries;
|
|
@@ -3385,7 +3399,7 @@ var en = class {
|
|
|
3385
3399
|
notifyListeners() {
|
|
3386
3400
|
for (let e of this.listeners) e();
|
|
3387
3401
|
}
|
|
3388
|
-
},
|
|
3402
|
+
}, sn = class {
|
|
3389
3403
|
entries = [];
|
|
3390
3404
|
listeners = /* @__PURE__ */ new Set();
|
|
3391
3405
|
clear() {
|
|
@@ -3398,7 +3412,7 @@ var en = class {
|
|
|
3398
3412
|
});
|
|
3399
3413
|
}
|
|
3400
3414
|
resolve(e) {
|
|
3401
|
-
return
|
|
3415
|
+
return an(this.entries, e);
|
|
3402
3416
|
}
|
|
3403
3417
|
getAll() {
|
|
3404
3418
|
return this.entries;
|
|
@@ -3411,7 +3425,7 @@ var en = class {
|
|
|
3411
3425
|
notifyListeners() {
|
|
3412
3426
|
for (let e of this.listeners) e();
|
|
3413
3427
|
}
|
|
3414
|
-
},
|
|
3428
|
+
}, cn = class {
|
|
3415
3429
|
entries = [];
|
|
3416
3430
|
listeners = /* @__PURE__ */ new Set();
|
|
3417
3431
|
clear() {
|
|
@@ -3424,7 +3438,7 @@ var en = class {
|
|
|
3424
3438
|
});
|
|
3425
3439
|
}
|
|
3426
3440
|
resolve(e) {
|
|
3427
|
-
return
|
|
3441
|
+
return an(this.entries, e);
|
|
3428
3442
|
}
|
|
3429
3443
|
onChange(e) {
|
|
3430
3444
|
return this.listeners.add(e), () => {
|
|
@@ -3434,19 +3448,19 @@ var en = class {
|
|
|
3434
3448
|
notifyListeners() {
|
|
3435
3449
|
for (let e of this.listeners) e();
|
|
3436
3450
|
}
|
|
3437
|
-
},
|
|
3438
|
-
function
|
|
3439
|
-
|
|
3451
|
+
}, ln = new on(), un = new sn(), dn = new cn();
|
|
3452
|
+
function fn(e) {
|
|
3453
|
+
ln.clear(), un.clear(), dn.clear();
|
|
3440
3454
|
for (let t of e) {
|
|
3441
|
-
if (t.viewers) for (let e of t.viewers)
|
|
3442
|
-
if (t.editors) for (let e of t.editors)
|
|
3443
|
-
if (t.fsProviders) for (let e of t.fsProviders)
|
|
3455
|
+
if (t.viewers) for (let e of t.viewers) ln.register(e, t.dirPath);
|
|
3456
|
+
if (t.editors) for (let e of t.editors) un.register(e, t.dirPath);
|
|
3457
|
+
if (t.fsProviders) for (let e of t.fsProviders) dn.register(e, t.dirPath);
|
|
3444
3458
|
}
|
|
3445
|
-
|
|
3459
|
+
ln.notifyListeners(), un.notifyListeners(), dn.notifyListeners();
|
|
3446
3460
|
}
|
|
3447
3461
|
//#endregion
|
|
3448
3462
|
//#region lib/vscodeColorTheme.ts
|
|
3449
|
-
var
|
|
3463
|
+
var pn = [
|
|
3450
3464
|
{
|
|
3451
3465
|
cssVar: "--bg",
|
|
3452
3466
|
keys: ["editor.background"]
|
|
@@ -3545,12 +3559,12 @@ var cn = [
|
|
|
3545
3559
|
keys: ["activityBarBadge.foreground"]
|
|
3546
3560
|
}
|
|
3547
3561
|
];
|
|
3548
|
-
async function
|
|
3562
|
+
async function mn(e, t, n = 3) {
|
|
3549
3563
|
let r = S(await Nt(e, t), void 0, { allowTrailingComma: !0 });
|
|
3550
3564
|
if (r.include && n > 0) {
|
|
3551
3565
|
let i = K(G(t), r.include);
|
|
3552
3566
|
try {
|
|
3553
|
-
let t = await
|
|
3567
|
+
let t = await mn(e, i, n - 1);
|
|
3554
3568
|
r.colors = {
|
|
3555
3569
|
...t.colors,
|
|
3556
3570
|
...r.colors
|
|
@@ -3559,51 +3573,51 @@ async function ln(e, t, n = 3) {
|
|
|
3559
3573
|
}
|
|
3560
3574
|
return r;
|
|
3561
3575
|
}
|
|
3562
|
-
var
|
|
3563
|
-
function
|
|
3564
|
-
return
|
|
3576
|
+
var hn = [], gn = 0, _n = null, vn = [];
|
|
3577
|
+
function yn() {
|
|
3578
|
+
return _n;
|
|
3565
3579
|
}
|
|
3566
|
-
function
|
|
3567
|
-
return
|
|
3568
|
-
|
|
3580
|
+
function bn(e) {
|
|
3581
|
+
return vn.push(e), () => {
|
|
3582
|
+
vn = vn.filter((t) => t !== e);
|
|
3569
3583
|
};
|
|
3570
3584
|
}
|
|
3571
|
-
function
|
|
3572
|
-
if (
|
|
3585
|
+
function xn() {
|
|
3586
|
+
if (_n) for (let e of vn) e(_n);
|
|
3573
3587
|
}
|
|
3574
|
-
function
|
|
3575
|
-
|
|
3588
|
+
function Sn(e) {
|
|
3589
|
+
Cn();
|
|
3576
3590
|
let t = Wt().style;
|
|
3577
|
-
for (let n of
|
|
3591
|
+
for (let n of pn) for (let r of n.keys) {
|
|
3578
3592
|
let i = e[r];
|
|
3579
3593
|
if (i) {
|
|
3580
|
-
t.setProperty(n.cssVar, i),
|
|
3594
|
+
t.setProperty(n.cssVar, i), hn.push(n.cssVar);
|
|
3581
3595
|
break;
|
|
3582
3596
|
}
|
|
3583
3597
|
}
|
|
3584
3598
|
}
|
|
3585
|
-
function
|
|
3586
|
-
|
|
3599
|
+
function Cn() {
|
|
3600
|
+
gn++;
|
|
3587
3601
|
let e = Wt().style;
|
|
3588
|
-
for (let t of
|
|
3589
|
-
|
|
3590
|
-
let t =
|
|
3591
|
-
if (
|
|
3602
|
+
for (let t of hn) e.removeProperty(t);
|
|
3603
|
+
hn = [];
|
|
3604
|
+
let t = _n !== null;
|
|
3605
|
+
if (_n = null, t) for (let e of vn) e({ kind: Wt().dataset.theme === "light" ? "light" : "dark" });
|
|
3592
3606
|
}
|
|
3593
|
-
function
|
|
3607
|
+
function wn(e) {
|
|
3594
3608
|
return e === "vs" || e === "hc-light" ? "light" : "dark";
|
|
3595
3609
|
}
|
|
3596
|
-
async function
|
|
3597
|
-
let r = ++
|
|
3598
|
-
return r ===
|
|
3599
|
-
kind: n ?
|
|
3610
|
+
async function Tn(e, t, n) {
|
|
3611
|
+
let r = ++gn, i = await mn(e, t);
|
|
3612
|
+
return r === gn ? (i.colors && Sn(i.colors), _n = {
|
|
3613
|
+
kind: n ? wn(n) : i.type === "light" ? "light" : "dark",
|
|
3600
3614
|
colors: i.colors,
|
|
3601
3615
|
tokenColors: i.tokenColors
|
|
3602
|
-
},
|
|
3616
|
+
}, xn(), i) : i;
|
|
3603
3617
|
}
|
|
3604
3618
|
//#endregion
|
|
3605
3619
|
//#region lib/styles/viewers.module.css
|
|
3606
|
-
var
|
|
3620
|
+
var En = {
|
|
3607
3621
|
"file-viewer": "_file-viewer_1gb4m_1",
|
|
3608
3622
|
"file-viewer-inline": "_file-viewer-inline_1gb4m_17",
|
|
3609
3623
|
"file-viewer-overlay": "_file-viewer-overlay_1gb4m_30",
|
|
@@ -3612,8 +3626,8 @@ var xn = {
|
|
|
3612
3626
|
};
|
|
3613
3627
|
//#endregion
|
|
3614
3628
|
//#region lib/components/ExtensionContainer.tsx
|
|
3615
|
-
async function
|
|
3616
|
-
let { containerFile: i, innerPath: a } = Kt(t), o =
|
|
3629
|
+
async function Dn(e, t, n, r) {
|
|
3630
|
+
let { containerFile: i, innerPath: a } = Kt(t), o = dn.resolve(q(i));
|
|
3617
3631
|
if (!o) throw Error(`No fsProvider registered for "${q(i)}"`);
|
|
3618
3632
|
if (o.contribution.runtime === "backend" && e.fsProvider) {
|
|
3619
3633
|
let t = K(o.extensionDirPath, o.contribution.entry);
|
|
@@ -3623,23 +3637,23 @@ async function Sn(e, t, n, r) {
|
|
|
3623
3637
|
if (!s.readFileRange) throw Error("Provider does not support readFileRange");
|
|
3624
3638
|
return s.readFileRange(i, a, n, r);
|
|
3625
3639
|
}
|
|
3626
|
-
function
|
|
3627
|
-
let { extensionDirPath: t, entry: n, kind: r, props: a, onClose: s, className: c, style: l, active: f } = e, h = ke(), g = u(null), [
|
|
3628
|
-
|
|
3629
|
-
let
|
|
3640
|
+
function On(e) {
|
|
3641
|
+
let { extensionDirPath: t, entry: n, kind: r, props: a, onClose: s, className: c, style: l, active: f } = e, h = ke(), g = tn(), _ = u(null), [v, y] = d(null), [b, x] = d(!0), S = u(s);
|
|
3642
|
+
S.current = s;
|
|
3643
|
+
let C = r === "viewer" && !!a.inline, w = r === "viewer" && !C, T = u(null), E = u(!1), D = u(!1);
|
|
3630
3644
|
o(() => {
|
|
3631
|
-
|
|
3632
|
-
}, [
|
|
3633
|
-
if (!
|
|
3634
|
-
|
|
3635
|
-
let e =
|
|
3645
|
+
C && (T.current = document.activeElement, E.current = !1, D.current = !1);
|
|
3646
|
+
}, [C]), o(() => {
|
|
3647
|
+
if (!w || b || D.current) return;
|
|
3648
|
+
D.current = !0;
|
|
3649
|
+
let e = _.current;
|
|
3636
3650
|
e && setTimeout(() => {
|
|
3637
3651
|
try {
|
|
3638
3652
|
e.focus(), e.contentWindow?.focus?.();
|
|
3639
3653
|
} catch {}
|
|
3640
3654
|
}, 0);
|
|
3641
|
-
}, [
|
|
3642
|
-
if (!
|
|
3655
|
+
}, [w, b]), o(() => {
|
|
3656
|
+
if (!C) return;
|
|
3643
3657
|
let e = (e) => {
|
|
3644
3658
|
let t = e;
|
|
3645
3659
|
if (!t) return !1;
|
|
@@ -3647,24 +3661,24 @@ function Cn(e) {
|
|
|
3647
3661
|
return n === "input" || n === "textarea" || n === "select" || n === "button" || t.isContentEditable;
|
|
3648
3662
|
}, t = (t) => {
|
|
3649
3663
|
if (t.key === "Tab" && !(t.ctrlKey || t.metaKey || t.altKey) && !t.shiftKey) {
|
|
3650
|
-
if (
|
|
3664
|
+
if (E.current) {
|
|
3651
3665
|
t.preventDefault(), t.stopPropagation();
|
|
3652
3666
|
return;
|
|
3653
3667
|
}
|
|
3654
3668
|
if (A.current === "panel" && !e(t.target)) {
|
|
3655
|
-
t.preventDefault(), t.stopPropagation(),
|
|
3669
|
+
t.preventDefault(), t.stopPropagation(), E.current = !0, A.push("viewer");
|
|
3656
3670
|
try {
|
|
3657
|
-
|
|
3671
|
+
_.current?.focus(), _.current?.contentWindow?.focus?.();
|
|
3658
3672
|
} catch {}
|
|
3659
3673
|
}
|
|
3660
3674
|
}
|
|
3661
3675
|
};
|
|
3662
3676
|
return window.addEventListener("keydown", t, !0), () => window.removeEventListener("keydown", t, !0);
|
|
3663
|
-
}, [
|
|
3664
|
-
let
|
|
3677
|
+
}, [C]);
|
|
3678
|
+
let O = u(null), k = u(null);
|
|
3665
3679
|
o(() => {
|
|
3666
3680
|
if (f !== !1) return;
|
|
3667
|
-
let e =
|
|
3681
|
+
let e = _.current;
|
|
3668
3682
|
if (e) {
|
|
3669
3683
|
let t = r === "viewer" ? {
|
|
3670
3684
|
filePath: "",
|
|
@@ -3682,22 +3696,22 @@ function Cn(e) {
|
|
|
3682
3696
|
}, "*");
|
|
3683
3697
|
} catch {}
|
|
3684
3698
|
}
|
|
3685
|
-
let t =
|
|
3686
|
-
t && (h.fs.close(t.fd).catch(() => {}),
|
|
3699
|
+
let t = O.current;
|
|
3700
|
+
t && (h.fs.close(t.fd).catch(() => {}), O.current = null);
|
|
3687
3701
|
}, [f, r]);
|
|
3688
|
-
let
|
|
3689
|
-
e.kind === "viewer" && (
|
|
3690
|
-
let
|
|
3691
|
-
e.kind === "editor" && (
|
|
3692
|
-
let
|
|
3702
|
+
let j = u(e.kind === "viewer" ? e.onExecuteCommand : void 0);
|
|
3703
|
+
e.kind === "viewer" && (j.current = e.onExecuteCommand);
|
|
3704
|
+
let M = u(e.kind === "editor" ? e.onDirtyChange : void 0);
|
|
3705
|
+
e.kind === "editor" && (M.current = e.onDirtyChange);
|
|
3706
|
+
let N = i(() => ({
|
|
3693
3707
|
async readFile(e) {
|
|
3694
3708
|
let t = W(e);
|
|
3695
|
-
return Gt(t) ?
|
|
3709
|
+
return Gt(t) ? Dn(h, t, 0, 64 * 1024 * 1024) : h.fs.readFile(t);
|
|
3696
3710
|
},
|
|
3697
3711
|
async readFileRange(e, t, n) {
|
|
3698
3712
|
let r = W(e);
|
|
3699
|
-
if (Gt(r)) return
|
|
3700
|
-
let i =
|
|
3713
|
+
if (Gt(r)) return Dn(h, r, t, n);
|
|
3714
|
+
let i = O.current, a = i;
|
|
3701
3715
|
if (!a || a.path !== r) {
|
|
3702
3716
|
if (i) try {
|
|
3703
3717
|
await h.fs.close(i.fd);
|
|
@@ -3706,7 +3720,7 @@ function Cn(e) {
|
|
|
3706
3720
|
fd: await h.fs.open(r),
|
|
3707
3721
|
size: (await h.fs.stat(r)).size,
|
|
3708
3722
|
path: r
|
|
3709
|
-
},
|
|
3723
|
+
}, O.current = a;
|
|
3710
3724
|
}
|
|
3711
3725
|
let o = Math.max(0, Math.floor(t)), s = Math.max(0, Math.floor(n)), c = Math.max(0, a.size - o), l = Math.min(s, c);
|
|
3712
3726
|
return l === 0 ? /* @__PURE__ */ new ArrayBuffer(0) : h.fs.read(a.fd, o, l);
|
|
@@ -3722,19 +3736,19 @@ function Cn(e) {
|
|
|
3722
3736
|
async statFile(e) {
|
|
3723
3737
|
let t = W(e);
|
|
3724
3738
|
if (Gt(t)) return {
|
|
3725
|
-
size: (await
|
|
3739
|
+
size: (await Dn(h, t, 0, 64 * 1024 * 1024)).byteLength,
|
|
3726
3740
|
mtimeMs: 0
|
|
3727
3741
|
};
|
|
3728
|
-
let n = await h.fs.stat(t), r =
|
|
3742
|
+
let n = await h.fs.stat(t), r = O.current;
|
|
3729
3743
|
return r && r.path === t && r.size !== n.size && (r.size = n.size), n;
|
|
3730
3744
|
},
|
|
3731
3745
|
onFileChange(e) {
|
|
3732
|
-
let t =
|
|
3746
|
+
let t = k.current;
|
|
3733
3747
|
if (!t) return () => {};
|
|
3734
3748
|
let n = W(t), r = G(n), i = q(n), a = `viewer-${Math.random().toString(36).slice(2)}`, o = !1, s = h.fs.onFsChange((t) => {
|
|
3735
3749
|
if (!o && !(t.watchId !== a || !t.name) && t.name === i && (t.type === "modified" || t.type === "appeared")) {
|
|
3736
|
-
let t =
|
|
3737
|
-
t && t.path === n && (h.fs.close(t.fd).catch(() => {}),
|
|
3750
|
+
let t = O.current;
|
|
3751
|
+
t && t.path === n && (h.fs.close(t.fd).catch(() => {}), O.current = null), e();
|
|
3738
3752
|
}
|
|
3739
3753
|
});
|
|
3740
3754
|
return (async () => {
|
|
@@ -3750,17 +3764,17 @@ function Cn(e) {
|
|
|
3750
3764
|
return h.theme.get();
|
|
3751
3765
|
},
|
|
3752
3766
|
getColorTheme() {
|
|
3753
|
-
return
|
|
3767
|
+
return yn();
|
|
3754
3768
|
},
|
|
3755
3769
|
onThemeChange(e) {
|
|
3756
|
-
let t =
|
|
3770
|
+
let t = bn(e);
|
|
3757
3771
|
return () => t();
|
|
3758
3772
|
},
|
|
3759
3773
|
onClose() {
|
|
3760
|
-
|
|
3774
|
+
S.current();
|
|
3761
3775
|
},
|
|
3762
3776
|
async executeCommand(e, t) {
|
|
3763
|
-
let n =
|
|
3777
|
+
let n = j.current;
|
|
3764
3778
|
if (!n) throw Error("No command handler registered");
|
|
3765
3779
|
return n(e, t);
|
|
3766
3780
|
},
|
|
@@ -3778,7 +3792,7 @@ function Cn(e) {
|
|
|
3778
3792
|
async getExtensionResourceUrl(e) {
|
|
3779
3793
|
throw W(e).replace(/^\/+/, "").includes("..") ? Error("Invalid extension resource path") : Error("Extension resource URL not available in mount-point mode");
|
|
3780
3794
|
}
|
|
3781
|
-
}), []),
|
|
3795
|
+
}), []), P = i(() => {
|
|
3782
3796
|
let e = {};
|
|
3783
3797
|
try {
|
|
3784
3798
|
let t = getComputedStyle(Wt());
|
|
@@ -3792,12 +3806,12 @@ function Cn(e) {
|
|
|
3792
3806
|
return e;
|
|
3793
3807
|
}, []);
|
|
3794
3808
|
o(() => {
|
|
3795
|
-
let e = !1, i =
|
|
3809
|
+
let e = !1, i = _.current;
|
|
3796
3810
|
if (!i) return;
|
|
3797
|
-
|
|
3798
|
-
let o =
|
|
3811
|
+
x(!0), y(null);
|
|
3812
|
+
let o = N(), s = i.contentWindow;
|
|
3799
3813
|
if (!s) return;
|
|
3800
|
-
let c = W(n.replace(/^\.\//, "")) || "index.js", l = K(t, c), u =
|
|
3814
|
+
let c = W(n.replace(/^\.\//, "")) || "index.js", l = K(t, c), u = g(l), d = /\.mjs(?:\?|$)/i.test(c), f = 1, p = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), S = (t) => {
|
|
3801
3815
|
if (t.source !== s) return;
|
|
3802
3816
|
let n = t.data;
|
|
3803
3817
|
if (!(!n || typeof n != "object")) {
|
|
@@ -3874,7 +3888,7 @@ function Cn(e) {
|
|
|
3874
3888
|
}
|
|
3875
3889
|
if (n.type === "ext:registerCommand") {
|
|
3876
3890
|
let e = String(n.handlerId ?? ""), t = String(n.commandId ?? "");
|
|
3877
|
-
if (!e || !t ||
|
|
3891
|
+
if (!e || !t || v.has(e)) return;
|
|
3878
3892
|
let r = H.registerCommand(t, async (...t) => {
|
|
3879
3893
|
let n = f++;
|
|
3880
3894
|
await new Promise((r, i) => {
|
|
@@ -3889,57 +3903,57 @@ function Cn(e) {
|
|
|
3889
3903
|
}, "*");
|
|
3890
3904
|
});
|
|
3891
3905
|
});
|
|
3892
|
-
|
|
3906
|
+
v.set(e, r);
|
|
3893
3907
|
return;
|
|
3894
3908
|
}
|
|
3895
3909
|
if (n.type === "ext:unregisterCommand") {
|
|
3896
|
-
let e = String(n.handlerId ?? ""), t =
|
|
3910
|
+
let e = String(n.handlerId ?? ""), t = v.get(e);
|
|
3897
3911
|
if (t) {
|
|
3898
3912
|
try {
|
|
3899
3913
|
t();
|
|
3900
3914
|
} catch {}
|
|
3901
|
-
|
|
3915
|
+
v.delete(e);
|
|
3902
3916
|
}
|
|
3903
3917
|
return;
|
|
3904
3918
|
}
|
|
3905
3919
|
if (n.type === "ext:registerKeybinding") {
|
|
3906
3920
|
let e = String(n.bindingId ?? ""), t = n.binding;
|
|
3907
|
-
if (!e || !t || typeof t != "object" ||
|
|
3921
|
+
if (!e || !t || typeof t != "object" || b.has(e)) return;
|
|
3908
3922
|
let r = ut(H, {
|
|
3909
3923
|
command: t.command,
|
|
3910
3924
|
key: t.key,
|
|
3911
3925
|
mac: t.mac,
|
|
3912
3926
|
when: t.when
|
|
3913
3927
|
});
|
|
3914
|
-
|
|
3928
|
+
b.set(e, r);
|
|
3915
3929
|
return;
|
|
3916
3930
|
}
|
|
3917
3931
|
if (n.type === "ext:unregisterKeybinding") {
|
|
3918
|
-
let e = String(n.bindingId ?? ""), t =
|
|
3932
|
+
let e = String(n.bindingId ?? ""), t = b.get(e);
|
|
3919
3933
|
if (t) {
|
|
3920
3934
|
try {
|
|
3921
3935
|
t();
|
|
3922
3936
|
} catch {}
|
|
3923
|
-
|
|
3937
|
+
b.delete(e);
|
|
3924
3938
|
}
|
|
3925
3939
|
return;
|
|
3926
3940
|
}
|
|
3927
|
-
if (n.type === "dotdir:bootstrap-ready")
|
|
3928
|
-
else if (n.type === "dotdir:ready") e ||
|
|
3929
|
-
else if (n.type === "dotdir:error") e || (
|
|
3941
|
+
if (n.type === "dotdir:bootstrap-ready") M();
|
|
3942
|
+
else if (n.type === "dotdir:ready") e || x(!1);
|
|
3943
|
+
else if (n.type === "dotdir:error") e || (y(String(n.message ?? "Extension error")), x(!1));
|
|
3930
3944
|
else if (n.type === "dotdir:iframeKeyDown") try {
|
|
3931
3945
|
let e = String(n.key ?? "").toLowerCase();
|
|
3932
|
-
if (
|
|
3933
|
-
|
|
3946
|
+
if (C && e === "tab" && E.current) {
|
|
3947
|
+
E.current = !1;
|
|
3934
3948
|
try {
|
|
3935
3949
|
A.pop("viewer");
|
|
3936
3950
|
} catch {}
|
|
3937
3951
|
try {
|
|
3938
|
-
|
|
3952
|
+
T.current?.focus?.();
|
|
3939
3953
|
} catch {}
|
|
3940
3954
|
return;
|
|
3941
3955
|
}
|
|
3942
|
-
if (
|
|
3956
|
+
if (C && !E.current) return;
|
|
3943
3957
|
let t = {
|
|
3944
3958
|
key: n.key,
|
|
3945
3959
|
ctrlKey: !!n.ctrlKey,
|
|
@@ -3954,22 +3968,22 @@ function Cn(e) {
|
|
|
3954
3968
|
} catch {}
|
|
3955
3969
|
}
|
|
3956
3970
|
};
|
|
3957
|
-
window.addEventListener("message",
|
|
3958
|
-
let
|
|
3971
|
+
window.addEventListener("message", S);
|
|
3972
|
+
let w = () => {
|
|
3959
3973
|
try {
|
|
3960
3974
|
i.contentWindow?.postMessage({
|
|
3961
3975
|
type: "dotdir:themeVars",
|
|
3962
|
-
themeVars:
|
|
3976
|
+
themeVars: P()
|
|
3963
3977
|
}, "*");
|
|
3964
3978
|
} catch {}
|
|
3965
|
-
},
|
|
3966
|
-
if (
|
|
3967
|
-
|
|
3979
|
+
}, D = bn(() => w()), j = !1, M = async () => {
|
|
3980
|
+
if (j) return;
|
|
3981
|
+
j = !0, k.current = a.filePath;
|
|
3968
3982
|
let t;
|
|
3969
3983
|
if (d) try {
|
|
3970
3984
|
t = await Nt(h, l);
|
|
3971
3985
|
} catch (t) {
|
|
3972
|
-
e || (
|
|
3986
|
+
e || (y(`Failed to read ESM entry: ${t instanceof Error ? t.message : t && typeof t == "object" && "message" in t ? String(t.message) : String(t)}`), x(!1));
|
|
3973
3987
|
return;
|
|
3974
3988
|
}
|
|
3975
3989
|
i.contentWindow?.postMessage({
|
|
@@ -3978,16 +3992,16 @@ function Cn(e) {
|
|
|
3978
3992
|
entryUrl: u,
|
|
3979
3993
|
entryScript: t,
|
|
3980
3994
|
props: a,
|
|
3981
|
-
themeVars:
|
|
3995
|
+
themeVars: P(),
|
|
3982
3996
|
colorTheme: o.getColorTheme?.() ?? null
|
|
3983
3997
|
}, "*");
|
|
3984
|
-
},
|
|
3998
|
+
}, F = () => {
|
|
3985
3999
|
setTimeout(() => {
|
|
3986
|
-
!e && !
|
|
4000
|
+
!e && !j && (y("Extension bootstrap did not respond"), x(!1));
|
|
3987
4001
|
}, 3e3);
|
|
3988
4002
|
};
|
|
3989
|
-
return i.addEventListener("load",
|
|
3990
|
-
e = !0, window.removeEventListener("message",
|
|
4003
|
+
return i.addEventListener("load", F), () => {
|
|
4004
|
+
e = !0, window.removeEventListener("message", S), i.removeEventListener("load", F), D();
|
|
3991
4005
|
try {
|
|
3992
4006
|
i.contentWindow?.postMessage({ type: "dotdir:dispose" }, "*");
|
|
3993
4007
|
} catch {}
|
|
@@ -3995,33 +4009,33 @@ function Cn(e) {
|
|
|
3995
4009
|
e();
|
|
3996
4010
|
} catch {}
|
|
3997
4011
|
m.clear();
|
|
3998
|
-
for (let [, e] of
|
|
4012
|
+
for (let [, e] of v) try {
|
|
3999
4013
|
e();
|
|
4000
4014
|
} catch {}
|
|
4001
|
-
|
|
4002
|
-
for (let [, e] of
|
|
4015
|
+
v.clear();
|
|
4016
|
+
for (let [, e] of b) try {
|
|
4003
4017
|
e();
|
|
4004
4018
|
} catch {}
|
|
4005
|
-
|
|
4006
|
-
let t =
|
|
4007
|
-
t && (h.fs.close(t.fd).catch(() => {}),
|
|
4019
|
+
b.clear(), p.clear();
|
|
4020
|
+
let t = O.current;
|
|
4021
|
+
t && (h.fs.close(t.fd).catch(() => {}), O.current = null);
|
|
4008
4022
|
};
|
|
4009
4023
|
}, [
|
|
4010
4024
|
t,
|
|
4011
4025
|
n,
|
|
4012
4026
|
r,
|
|
4013
|
-
|
|
4014
|
-
|
|
4027
|
+
N,
|
|
4028
|
+
P
|
|
4015
4029
|
]);
|
|
4016
|
-
let
|
|
4030
|
+
let F = u(a);
|
|
4017
4031
|
if (o(() => {
|
|
4018
4032
|
if (f === !1) {
|
|
4019
|
-
|
|
4033
|
+
F.current = null;
|
|
4020
4034
|
return;
|
|
4021
4035
|
}
|
|
4022
|
-
let e =
|
|
4023
|
-
if (!(!e ||
|
|
4024
|
-
|
|
4036
|
+
let e = _.current;
|
|
4037
|
+
if (!(!e || b || v) && F.current !== a) {
|
|
4038
|
+
F.current = a, k.current = a.filePath;
|
|
4025
4039
|
try {
|
|
4026
4040
|
e.contentWindow?.postMessage({
|
|
4027
4041
|
type: "dotdir:update",
|
|
@@ -4032,10 +4046,10 @@ function Cn(e) {
|
|
|
4032
4046
|
}, [
|
|
4033
4047
|
a,
|
|
4034
4048
|
r,
|
|
4035
|
-
|
|
4036
|
-
|
|
4049
|
+
b,
|
|
4050
|
+
v,
|
|
4037
4051
|
f
|
|
4038
|
-
]),
|
|
4052
|
+
]), v) return /* @__PURE__ */ m("div", {
|
|
4039
4053
|
className: c,
|
|
4040
4054
|
style: {
|
|
4041
4055
|
...l,
|
|
@@ -4048,17 +4062,17 @@ function Cn(e) {
|
|
|
4048
4062
|
"Failed to load ",
|
|
4049
4063
|
r,
|
|
4050
4064
|
": ",
|
|
4051
|
-
|
|
4065
|
+
v
|
|
4052
4066
|
]
|
|
4053
4067
|
});
|
|
4054
|
-
let
|
|
4068
|
+
let I = g(G(K(t, W(n.replace(/^\.\//, "")) || "index.js")), "extension-directory");
|
|
4055
4069
|
return /* @__PURE__ */ m("div", {
|
|
4056
4070
|
className: c,
|
|
4057
4071
|
style: {
|
|
4058
4072
|
...l,
|
|
4059
4073
|
position: "relative"
|
|
4060
4074
|
},
|
|
4061
|
-
children: [
|
|
4075
|
+
children: [b && /* @__PURE__ */ m("div", {
|
|
4062
4076
|
style: {
|
|
4063
4077
|
position: "absolute",
|
|
4064
4078
|
inset: 0,
|
|
@@ -4072,22 +4086,22 @@ function Cn(e) {
|
|
|
4072
4086
|
r,
|
|
4073
4087
|
"…"
|
|
4074
4088
|
]
|
|
4075
|
-
}),
|
|
4076
|
-
ref:
|
|
4077
|
-
src:
|
|
4089
|
+
}), I && /* @__PURE__ */ p("iframe", {
|
|
4090
|
+
ref: _,
|
|
4091
|
+
src: I,
|
|
4078
4092
|
sandbox: "allow-scripts allow-top-navigation-to-custom-protocols",
|
|
4079
4093
|
style: {
|
|
4080
4094
|
width: "100%",
|
|
4081
4095
|
height: "100%",
|
|
4082
4096
|
border: "none",
|
|
4083
|
-
display:
|
|
4097
|
+
display: b ? "none" : "block",
|
|
4084
4098
|
background: "transparent"
|
|
4085
4099
|
},
|
|
4086
4100
|
title: `${r} extension`
|
|
4087
4101
|
})]
|
|
4088
4102
|
});
|
|
4089
4103
|
}
|
|
4090
|
-
function
|
|
4104
|
+
function kn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize: a, inline: s, visible: c, onClose: d, onExecuteCommand: f }) {
|
|
4091
4105
|
let h = u(!1), g = u(null), _ = c ?? !0, v = i(() => {
|
|
4092
4106
|
A.set("panel");
|
|
4093
4107
|
let e = (t = 0) => {
|
|
@@ -4176,7 +4190,7 @@ function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4176
4190
|
"aria-label": "Close",
|
|
4177
4191
|
children: "×"
|
|
4178
4192
|
})]
|
|
4179
|
-
}), S = /* @__PURE__ */ p(
|
|
4193
|
+
}), S = /* @__PURE__ */ p(On, {
|
|
4180
4194
|
kind: "viewer",
|
|
4181
4195
|
extensionDirPath: e,
|
|
4182
4196
|
entry: t,
|
|
@@ -4190,7 +4204,7 @@ function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4190
4204
|
}
|
|
4191
4205
|
});
|
|
4192
4206
|
return s ? /* @__PURE__ */ p("div", {
|
|
4193
|
-
className: `${
|
|
4207
|
+
className: `${En["file-viewer"]} ${En["file-viewer-inline"]}`,
|
|
4194
4208
|
style: {
|
|
4195
4209
|
display: "flex",
|
|
4196
4210
|
flexDirection: "column",
|
|
@@ -4204,10 +4218,10 @@ function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4204
4218
|
children: S
|
|
4205
4219
|
})
|
|
4206
4220
|
}) : /* @__PURE__ */ p("div", {
|
|
4207
|
-
className:
|
|
4221
|
+
className: En["file-viewer-overlay"],
|
|
4208
4222
|
style: { display: _ ? "flex" : "none" },
|
|
4209
4223
|
children: /* @__PURE__ */ m("div", {
|
|
4210
|
-
className:
|
|
4224
|
+
className: En["file-viewer"],
|
|
4211
4225
|
style: {
|
|
4212
4226
|
display: "flex",
|
|
4213
4227
|
flexDirection: "column",
|
|
@@ -4223,7 +4237,7 @@ function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4223
4237
|
})
|
|
4224
4238
|
});
|
|
4225
4239
|
}
|
|
4226
|
-
function
|
|
4240
|
+
function An({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a, visible: s, onClose: c, onDirtyChange: h, languages: g, grammars: _ }) {
|
|
4227
4241
|
let [v, y] = d(a), b = u(!1), x = u(null), S = s ?? !0, C = i(() => {
|
|
4228
4242
|
A.set("panel");
|
|
4229
4243
|
let e = (t = 0) => {
|
|
@@ -4289,10 +4303,10 @@ function Tn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a
|
|
|
4289
4303
|
return e.filter((e) => t.has(e.id) ? !1 : (t.add(e.id), !0));
|
|
4290
4304
|
}, [g]), O = D.length > 0;
|
|
4291
4305
|
return /* @__PURE__ */ p("div", {
|
|
4292
|
-
className:
|
|
4306
|
+
className: En["file-editor-overlay"],
|
|
4293
4307
|
style: { display: S ? "flex" : "none" },
|
|
4294
4308
|
children: /* @__PURE__ */ m("div", {
|
|
4295
|
-
className:
|
|
4309
|
+
className: En["file-editor"],
|
|
4296
4310
|
style: {
|
|
4297
4311
|
display: "flex",
|
|
4298
4312
|
flexDirection: "column",
|
|
@@ -4362,7 +4376,7 @@ function Tn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a
|
|
|
4362
4376
|
flex: 1,
|
|
4363
4377
|
minHeight: 0
|
|
4364
4378
|
},
|
|
4365
|
-
children: /* @__PURE__ */ p(
|
|
4379
|
+
children: /* @__PURE__ */ p(On, {
|
|
4366
4380
|
kind: "editor",
|
|
4367
4381
|
extensionDirPath: e,
|
|
4368
4382
|
entry: t,
|
|
@@ -4381,22 +4395,22 @@ function Tn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a
|
|
|
4381
4395
|
}
|
|
4382
4396
|
//#endregion
|
|
4383
4397
|
//#region lib/features/extensions/extensionHost.worker.ts?worker&inline
|
|
4384
|
-
var
|
|
4385
|
-
function
|
|
4398
|
+
var jn = "(function(){let e=/^[A-Za-z]:$/,t=/^[A-Za-z]:\\/$/;function n(e){return e.startsWith(`//`)}function r(e){return n(e)?`//${e.slice(2).replace(/\\/+/g,`/`)}`:e.replace(/\\/+/g,`/`)}function i(e){return e.startsWith(`/`)||n(e)||/^[A-Za-z]:\\//.test(e)}function a(n){if(!n)return n;let i=r(n.replace(/\\\\/g,`/`));return i=i.replace(/\\/\\.\\//g,`/`).replace(/^\\.\\//,``),i.endsWith(`/.`)&&(i=i.slice(0,-2)),e.test(i)&&(i=`${i}/`),i.length>1&&i.endsWith(`/`)&&!t.test(i)&&(i=i.replace(/\\/+$/,``)),i}function o(e){let t=a(e);return n(t)?t.slice(2).split(`/`).filter(Boolean).length===2:!1}function s(e){let n=a(e);return n===`/`||t.test(n)||o(n)}function c(t){let n=a(t);if(!n)return`.`;if(s(n))return n;let r=n.replace(/\\/+$/,``),i=r.lastIndexOf(`/`);if(i<0)return`.`;if(i===0)return`/`;let o=r.slice(0,i);return e.test(o)?`${o}/`:o||`/`}function l(...e){let t=``;for(let n of e){if(!n)continue;let e=a(n);if(!t||i(e)){t=e;continue}t=a(`${t.replace(/\\/+$/,``)}/${e.replace(/^\\/+/,``)}`)}return t}let u=0,d=new Map,f=new Map,p=new Map,m=new Map;function h(e){return new Promise((t,n)=>{let r=u++;d.set(r,{resolve:t,reject:n}),self.postMessage({type:`readFile`,id:r,path:e})})}function g(e){return`${e.ref.publisher}.${e.ref.name}.${e.ref.version}`}function _(e,t){let n=e.manifest.activationEvents??[];return n.length===0?t===`*`:n.includes(`*`)||n.includes(t)}async function v(e){let t=await h(e);if(t==null)throw Error(`Browser script not found: ${e}`);let n=URL.createObjectURL(new Blob([t],{type:`text/javascript`}));try{return await import(n)}finally{URL.revokeObjectURL(n)}}async function y(e){let t=g(e);if(p.has(t)||!e.manifest.browser)return;let n=a(e.manifest.browser).replace(/^\\/+/,``),r=await v(l(e.dirPath,n)),i=r.activate??r.default?.activate,o=r.deactivate??r.default?.deactivate;if(typeof i!=`function`){console.warn(`[ExtHost] ${t} browser entry has no activate() export`);return}let s=[],c={commands:{registerCommand:(e,t)=>{m.set(e,t);let n={dispose:()=>{m.get(e)===t&&m.delete(e)}};return s.push(n),n},registerKeybinding:e=>({dispose(){}})}},u={subscriptions:s,dotdir:c};self.dotdir=c,await i(u),p.set(t,{subscriptions:s,deactivate:o})}async function b(e){for(let t of f.values())if(t.manifest.browser&&_(t,e))try{await y(t)}catch(e){console.error(`[ExtHost] activate failed:`,g(t),e)}}async function x(e,t){await b(`onCommand:${e}`);let n=m.get(e);n&&await n(...t)}function S(e){return`${e.publisher}-${e.name}-${e.version}`}async function C(e){try{let t=await h(l(e,`package.json`));if(t===null)return null;let n=JSON.parse(t),r={publisher:n.publisher||`unknown`,name:n.name||`unknown`,version:n.version||`0.0.0`},i,a;if(n.contributes?.iconTheme?.path){let t=l(e,n.contributes.iconTheme.path);i=t,a=c(t)}let o=n.contributes?.languages,s;if(n.contributes?.grammars?.length){s=[];for(let t of n.contributes.grammars)try{let n=l(e,t.path);s.push({contribution:t,path:n})}catch{}}let u;n.contributes?.themes?.length&&(u=n.contributes.themes.map((t,n)=>({id:t.id||`${t.label}#${n}`,label:t.label,uiTheme:t.uiTheme,jsonPath:l(e,t.path)})));let d=n.contributes?.viewers,f=n.contributes?.editors,p=n.contributes?.commands,m=n.contributes?.keybindings,g=n.contributes?.fsProviders,_;if(n.contributes?.shellIntegrations?.length){_=[];for(let t of n.contributes.shellIntegrations){let n=await h(l(e,t.scriptPath));n!==null&&_.push({shell:t.shell,label:t.label,script:n,executableCandidates:t.executableCandidates??[],platforms:t.platforms,hiddenCdTemplate:t.hiddenCdTemplate,cwdEscape:t.cwdEscape,lineEnding:t.lineEnding,spawnArgs:t.spawnArgs,scriptArg:t.scriptArg})}}return{ref:r,manifest:n,dirPath:e,iconThemeFssPath:i,iconThemeBasePath:a,colorThemes:u,languages:o,grammarRefs:s,viewers:d,editors:f,commands:p,keybindings:m,fsProviders:g,shellIntegrations:_}}catch{return null}}async function w(e){let t=[],n=l(e,`.dotdir`,`extensions`),r;try{let e=await h(l(n,`extensions.json`));if(e===null)return t;let i=JSON.parse(e);r=Array.isArray(i)?i:[]}catch{return t}for(let e of r){if(!e.publisher||!e.name||!e.version)continue;let r=await C(e.path?a(e.path):l(n,S(e)));r&&t.push(r)}console.log(`[ExtHost] loaded`,t.length,`extensions; FSS:`,t.filter(e=>e.iconThemeFss).map(e=>`${e.ref.publisher}.${e.ref.name}`),`vscode:`,t.filter(e=>e.vscodeIconThemePath).map(e=>`${e.ref.publisher}.${e.ref.name}`)),f.clear();for(let e of t)f.set(g(e),e);return t}self.onmessage=e=>{let t=e.data;if(t.type===`start`)w(t.homePath).then(async e=>{await b(`*`),self.postMessage({type:`loaded`,extensions:e})}).catch(e=>{let t=e instanceof Error?e.message:e&&typeof e==`object`&&`message`in e?String(e.message):String(e);self.postMessage({type:`error`,message:t})});else if(t.type===`activateByEvent`){let e=Number(t.requestId);b(String(t.event??``)).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`executeCommand`){let e=Number(t.requestId);x(String(t.command??``),Array.isArray(t.args)?t.args:[]).then(()=>{self.postMessage({type:`requestResult`,requestId:e,result:null})}).catch(t=>{let n=t instanceof Error?t.message:String(t);self.postMessage({type:`requestResult`,requestId:e,error:n})})}else if(t.type===`readFileResult`){let e=d.get(t.id);e&&(d.delete(t.id),t.error?e.resolve(null):e.resolve(t.data))}}})();", Mn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", jn], { type: "text/javascript;charset=utf-8" });
|
|
4399
|
+
function Nn(e) {
|
|
4386
4400
|
let t;
|
|
4387
4401
|
try {
|
|
4388
|
-
if (t =
|
|
4402
|
+
if (t = Mn && (self.URL || self.webkitURL).createObjectURL(Mn), !t) throw "";
|
|
4389
4403
|
let n = new Worker(t, { name: e?.name });
|
|
4390
4404
|
return n.addEventListener("error", () => {
|
|
4391
4405
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
4392
4406
|
}), n;
|
|
4393
4407
|
} catch {
|
|
4394
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
4408
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(jn), { name: e?.name });
|
|
4395
4409
|
}
|
|
4396
4410
|
}
|
|
4397
4411
|
//#endregion
|
|
4398
4412
|
//#region lib/features/extensions/extensionHostClient.ts
|
|
4399
|
-
var
|
|
4413
|
+
var Pn = class {
|
|
4400
4414
|
worker = null;
|
|
4401
4415
|
homePath = null;
|
|
4402
4416
|
listeners = [];
|
|
@@ -4445,7 +4459,7 @@ var kn = class {
|
|
|
4445
4459
|
});
|
|
4446
4460
|
}
|
|
4447
4461
|
spawnWorker() {
|
|
4448
|
-
let e = new
|
|
4462
|
+
let e = new Nn();
|
|
4449
4463
|
e.onmessage = (t) => {
|
|
4450
4464
|
let n = t.data;
|
|
4451
4465
|
if (n.type === "readFile") this.handleFileRead(e, n.id, n.path);
|
|
@@ -4498,25 +4512,25 @@ var kn = class {
|
|
|
4498
4512
|
});
|
|
4499
4513
|
}
|
|
4500
4514
|
}
|
|
4501
|
-
},
|
|
4515
|
+
}, Fn = _((e) => {
|
|
4502
4516
|
let t = e(Oe);
|
|
4503
4517
|
if (!t) throw Error("Bridge not initialized.");
|
|
4504
|
-
return new
|
|
4518
|
+
return new Pn(t);
|
|
4505
4519
|
});
|
|
4506
|
-
function
|
|
4507
|
-
return y(
|
|
4520
|
+
function In() {
|
|
4521
|
+
return y(Fn);
|
|
4508
4522
|
}
|
|
4509
4523
|
//#endregion
|
|
4510
4524
|
//#region lib/features/extensions/extensions.ts
|
|
4511
|
-
var
|
|
4512
|
-
function
|
|
4525
|
+
var Ln = "https://dotdir.dev";
|
|
4526
|
+
function Rn(e) {
|
|
4513
4527
|
return `${e.publisher}-${e.name}-${e.version}`;
|
|
4514
4528
|
}
|
|
4515
|
-
async function
|
|
4529
|
+
async function zn(e) {
|
|
4516
4530
|
return K(await e.utils.getHomePath(), ".dotdir", "extensions");
|
|
4517
4531
|
}
|
|
4518
|
-
async function
|
|
4519
|
-
let t = await
|
|
4532
|
+
async function Bn(e) {
|
|
4533
|
+
let t = await zn(e);
|
|
4520
4534
|
try {
|
|
4521
4535
|
let n = await Nt(e, K(t, "extensions.json")), r = JSON.parse(n);
|
|
4522
4536
|
return Array.isArray(r) ? r : [];
|
|
@@ -4524,21 +4538,21 @@ async function Fn(e) {
|
|
|
4524
4538
|
return [];
|
|
4525
4539
|
}
|
|
4526
4540
|
}
|
|
4527
|
-
async function
|
|
4528
|
-
let n = await
|
|
4541
|
+
async function Vn(e, t) {
|
|
4542
|
+
let n = await zn(e);
|
|
4529
4543
|
await e.fs.writeFile(K(n, "extensions.json"), JSON.stringify(t, null, 2));
|
|
4530
4544
|
}
|
|
4531
|
-
async function
|
|
4545
|
+
async function Hn(e = "", t = 1) {
|
|
4532
4546
|
let n = new URLSearchParams({
|
|
4533
4547
|
page: String(t),
|
|
4534
4548
|
pageSize: "30"
|
|
4535
4549
|
});
|
|
4536
4550
|
e && n.set("q", e);
|
|
4537
|
-
let r = await fetch(`${
|
|
4551
|
+
let r = await fetch(`${Ln}/api/extensions/search?${n}`);
|
|
4538
4552
|
if (!r.ok) throw Error("Failed to search marketplace");
|
|
4539
4553
|
return r.json();
|
|
4540
4554
|
}
|
|
4541
|
-
async function
|
|
4555
|
+
async function Un(e) {
|
|
4542
4556
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
4543
4557
|
n.write(e), n.close();
|
|
4544
4558
|
let i = [];
|
|
@@ -4551,7 +4565,7 @@ async function Rn(e) {
|
|
|
4551
4565
|
for (let e of i) o.set(e, s), s += e.length;
|
|
4552
4566
|
return o;
|
|
4553
4567
|
}
|
|
4554
|
-
async function
|
|
4568
|
+
async function Wn(e) {
|
|
4555
4569
|
let t = new Uint8Array(e), n = /* @__PURE__ */ new Map(), r = (e) => t[e] | t[e + 1] << 8, i = (e) => (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0, a = -1;
|
|
4556
4570
|
for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
|
|
4557
4571
|
a = e;
|
|
@@ -4564,13 +4578,13 @@ async function zn(e) {
|
|
|
4564
4578
|
if (c += 46 + o + s + l, d.endsWith("/")) continue;
|
|
4565
4579
|
let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
|
|
4566
4580
|
if (e === 0) g = h;
|
|
4567
|
-
else if (e === 8) g = await
|
|
4581
|
+
else if (e === 8) g = await Un(h);
|
|
4568
4582
|
else continue;
|
|
4569
4583
|
n.set(d, g);
|
|
4570
4584
|
}
|
|
4571
4585
|
return n;
|
|
4572
4586
|
}
|
|
4573
|
-
function
|
|
4587
|
+
function Gn(e) {
|
|
4574
4588
|
let t = [...e];
|
|
4575
4589
|
if (t.length === 0) return "";
|
|
4576
4590
|
let n = t[0], r = n.indexOf("/");
|
|
@@ -4578,22 +4592,22 @@ function Bn(e) {
|
|
|
4578
4592
|
let i = n.slice(0, r + 1);
|
|
4579
4593
|
return t.every((e) => e.startsWith(i)) ? i : "";
|
|
4580
4594
|
}
|
|
4581
|
-
async function
|
|
4582
|
-
let i = `${
|
|
4595
|
+
async function Kn(e, t, n, r) {
|
|
4596
|
+
let i = `${Ln}/api/extensions/${t}/${n}/${r}/download`, a = await fetch(i);
|
|
4583
4597
|
if (!a.ok) throw Error(`Download failed: ${a.statusText}`);
|
|
4584
|
-
let o = await
|
|
4598
|
+
let o = await Wn(await a.arrayBuffer()), s = await zn(e), c = {
|
|
4585
4599
|
publisher: t,
|
|
4586
4600
|
name: n,
|
|
4587
4601
|
version: r
|
|
4588
|
-
}, l = K(s,
|
|
4602
|
+
}, l = K(s, Rn(c)), u = Gn(o.keys());
|
|
4589
4603
|
for (let [t, n] of o) {
|
|
4590
4604
|
let r = u ? t.slice(u.length) : t;
|
|
4591
4605
|
r && await e.fs.writeBinaryFile(K(l, r), n);
|
|
4592
4606
|
}
|
|
4593
|
-
let d = (await
|
|
4594
|
-
d.push(c), await
|
|
4607
|
+
let d = (await Bn(e)).filter((e) => !(e.publisher === t && e.name === n));
|
|
4608
|
+
d.push(c), await Vn(e, d);
|
|
4595
4609
|
}
|
|
4596
|
-
async function
|
|
4610
|
+
async function qn(e) {
|
|
4597
4611
|
let t = new Uint8Array(e), n = /* @__PURE__ */ new Map(), r = (e) => t[e] | t[e + 1] << 8, i = (e) => (t[e] | t[e + 1] << 8 | t[e + 2] << 16 | t[e + 3] << 24) >>> 0, a = -1;
|
|
4598
4612
|
for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
|
|
4599
4613
|
a = e;
|
|
@@ -4606,14 +4620,14 @@ async function Hn(e) {
|
|
|
4606
4620
|
if (c += 46 + o + s + l, d.endsWith("/") || !d.startsWith("extension/")) continue;
|
|
4607
4621
|
let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
|
|
4608
4622
|
if (e === 0) g = h;
|
|
4609
|
-
else if (e === 8) g = await
|
|
4623
|
+
else if (e === 8) g = await Un(h);
|
|
4610
4624
|
else continue;
|
|
4611
4625
|
let _ = d.slice(10);
|
|
4612
4626
|
_ && n.set(_, g);
|
|
4613
4627
|
}
|
|
4614
4628
|
return n;
|
|
4615
4629
|
}
|
|
4616
|
-
async function
|
|
4630
|
+
async function Jn(e, t, n, r) {
|
|
4617
4631
|
let i = new AbortController(), a = setTimeout(() => i.abort(), 3e4), o;
|
|
4618
4632
|
try {
|
|
4619
4633
|
o = await fetch(r, { signal: i.signal });
|
|
@@ -4623,13 +4637,13 @@ async function Un(e, t, n, r) {
|
|
|
4623
4637
|
throw Error(`Download failed: ${t}`);
|
|
4624
4638
|
}
|
|
4625
4639
|
if (clearTimeout(a), !o.ok) throw Error(`Download failed: ${o.status} ${o.statusText}`);
|
|
4626
|
-
let s = await
|
|
4640
|
+
let s = await qn(await o.arrayBuffer()), c = s.get("package.json");
|
|
4627
4641
|
if (!c) throw Error("Invalid VSIX: no package.json");
|
|
4628
|
-
let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await
|
|
4642
|
+
let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await zn(e), d = {
|
|
4629
4643
|
publisher: t,
|
|
4630
4644
|
name: n,
|
|
4631
4645
|
version: l
|
|
4632
|
-
}, f = K(u,
|
|
4646
|
+
}, f = K(u, Rn(d));
|
|
4633
4647
|
for (let [t, n] of s) {
|
|
4634
4648
|
let r = K(f, t), i = t.split(".").pop()?.toLowerCase() ?? "";
|
|
4635
4649
|
[
|
|
@@ -4647,10 +4661,10 @@ async function Un(e, t, n, r) {
|
|
|
4647
4661
|
"tmGrammar"
|
|
4648
4662
|
].includes(i) || t.endsWith(".tmLanguage.json") || t.endsWith(".language-configuration.json") ? await e.fs.writeFile(r, new TextDecoder().decode(n)) : await e.fs.writeBinaryFile(r, n);
|
|
4649
4663
|
}
|
|
4650
|
-
let p = (await
|
|
4651
|
-
p.push(d), await
|
|
4664
|
+
let p = (await Bn(e)).filter((e) => !(e.publisher === t && e.name === n));
|
|
4665
|
+
p.push(d), await Vn(e, p);
|
|
4652
4666
|
}
|
|
4653
|
-
async function
|
|
4667
|
+
async function Yn(e, t) {
|
|
4654
4668
|
if (!await e.fs.exists(t)) return;
|
|
4655
4669
|
let n = await e.fs.delete.start([t]);
|
|
4656
4670
|
await new Promise((t, r) => {
|
|
@@ -4661,19 +4675,19 @@ async function Wn(e, t) {
|
|
|
4661
4675
|
});
|
|
4662
4676
|
});
|
|
4663
4677
|
}
|
|
4664
|
-
async function
|
|
4665
|
-
let r = await
|
|
4666
|
-
i && !i.path && await
|
|
4678
|
+
async function Xn(e, t, n) {
|
|
4679
|
+
let r = await Bn(e), i = r.find((e) => e.publisher === t && e.name === n);
|
|
4680
|
+
i && !i.path && await Yn(e, K(await zn(e), Rn(i))), await Vn(e, r.filter((e) => !(e.publisher === t && e.name === n)));
|
|
4667
4681
|
}
|
|
4668
|
-
function
|
|
4682
|
+
function Zn(e) {
|
|
4669
4683
|
return e.iconThemeFss || e.iconThemeFssPath || e.vscodeIconThemePath ? `${e.ref.publisher}.${e.ref.name}` : null;
|
|
4670
4684
|
}
|
|
4671
|
-
function
|
|
4685
|
+
function Qn(e, t) {
|
|
4672
4686
|
return `${e.ref.publisher}.${e.ref.name}:${t}`;
|
|
4673
4687
|
}
|
|
4674
|
-
function
|
|
4688
|
+
function $n(e, t) {
|
|
4675
4689
|
for (let n of e) if (n.colorThemes) {
|
|
4676
|
-
for (let e of n.colorThemes) if (
|
|
4690
|
+
for (let e of n.colorThemes) if (Qn(n, e.id) === t) return {
|
|
4677
4691
|
ext: n,
|
|
4678
4692
|
theme: e
|
|
4679
4693
|
};
|
|
@@ -4682,8 +4696,8 @@ function Jn(e, t) {
|
|
|
4682
4696
|
}
|
|
4683
4697
|
//#endregion
|
|
4684
4698
|
//#region lib/features/marketplace/vscodeMarketplace.ts
|
|
4685
|
-
var
|
|
4686
|
-
async function
|
|
4699
|
+
var er = "https://marketplace.visualstudio.com/_apis/public/gallery";
|
|
4700
|
+
async function tr(e, t = 1) {
|
|
4687
4701
|
let n = {
|
|
4688
4702
|
filters: [{
|
|
4689
4703
|
criteria: [{
|
|
@@ -4700,7 +4714,7 @@ async function Xn(e, t = 1) {
|
|
|
4700
4714
|
}],
|
|
4701
4715
|
assetTypes: [],
|
|
4702
4716
|
flags: 914
|
|
4703
|
-
}, r = await fetch(`${
|
|
4717
|
+
}, r = await fetch(`${er}/extensionquery`, {
|
|
4704
4718
|
method: "POST",
|
|
4705
4719
|
headers: {
|
|
4706
4720
|
"Content-Type": "application/json",
|
|
@@ -4715,23 +4729,23 @@ async function Xn(e, t = 1) {
|
|
|
4715
4729
|
total: i.length
|
|
4716
4730
|
};
|
|
4717
4731
|
}
|
|
4718
|
-
function
|
|
4732
|
+
function nr(e) {
|
|
4719
4733
|
return e.statistics?.find((e) => e.statisticName === "install")?.value ?? 0;
|
|
4720
4734
|
}
|
|
4721
|
-
function
|
|
4735
|
+
function rr(e) {
|
|
4722
4736
|
return e.versions?.[0]?.version ?? null;
|
|
4723
4737
|
}
|
|
4724
|
-
function
|
|
4738
|
+
function ir(e) {
|
|
4725
4739
|
let t = e.versions?.[0];
|
|
4726
4740
|
return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.VSIXPackage` : null;
|
|
4727
4741
|
}
|
|
4728
|
-
function
|
|
4742
|
+
function ar(e) {
|
|
4729
4743
|
let t = e.versions?.[0];
|
|
4730
4744
|
return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.Icons.Default` : null;
|
|
4731
4745
|
}
|
|
4732
4746
|
//#endregion
|
|
4733
4747
|
//#region lib/jsoncFileWatcher.ts
|
|
4734
|
-
async function
|
|
4748
|
+
async function or(e, t) {
|
|
4735
4749
|
let { name: n, getPath: r, validate: i, defaultValue: a, onLoad: o } = t, s = a, c = null, l = null, u = null, d = /* @__PURE__ */ new Set();
|
|
4736
4750
|
function f() {
|
|
4737
4751
|
for (let e of d) try {
|
|
@@ -4790,46 +4804,46 @@ async function tr(e, t) {
|
|
|
4790
4804
|
}
|
|
4791
4805
|
//#endregion
|
|
4792
4806
|
//#region lib/features/settings/userSettings.ts
|
|
4793
|
-
var
|
|
4794
|
-
function
|
|
4807
|
+
var sr = null, cr = null, lr = null;
|
|
4808
|
+
function ur(e) {
|
|
4795
4809
|
return typeof e != "object" || !e || Array.isArray(e) ? (console.error("[userSettings] settings.json must be an object"), null) : e;
|
|
4796
4810
|
}
|
|
4797
|
-
function
|
|
4798
|
-
if (!
|
|
4811
|
+
function dr(e, t) {
|
|
4812
|
+
if (!sr) return;
|
|
4799
4813
|
let n = {
|
|
4800
|
-
...
|
|
4814
|
+
...sr.getValue(),
|
|
4801
4815
|
...t
|
|
4802
4816
|
};
|
|
4803
|
-
|
|
4804
|
-
|
|
4817
|
+
sr.setValue(n), lr && clearTimeout(lr), lr = setTimeout(() => {
|
|
4818
|
+
lr = null, fr(e, n);
|
|
4805
4819
|
}, 500);
|
|
4806
4820
|
}
|
|
4807
|
-
async function
|
|
4821
|
+
async function fr(e, t) {
|
|
4808
4822
|
try {
|
|
4809
|
-
|
|
4823
|
+
cr ||= K(await e.utils.getHomePath(), ".dotdir", "settings.json"), await e.fs.writeFile(cr, JSON.stringify(t, null, 2));
|
|
4810
4824
|
} catch (e) {
|
|
4811
4825
|
console.error("[userSettings] Failed to save settings:", e);
|
|
4812
4826
|
}
|
|
4813
4827
|
}
|
|
4814
|
-
function
|
|
4815
|
-
return
|
|
4828
|
+
function pr(e) {
|
|
4829
|
+
return sr?.onChange(e) ?? (() => {});
|
|
4816
4830
|
}
|
|
4817
|
-
async function
|
|
4818
|
-
return
|
|
4831
|
+
async function mr(e) {
|
|
4832
|
+
return sr = await or(e, {
|
|
4819
4833
|
name: "userSettings",
|
|
4820
4834
|
getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "settings.json"),
|
|
4821
|
-
validate:
|
|
4835
|
+
validate: ur,
|
|
4822
4836
|
defaultValue: {}
|
|
4823
|
-
}),
|
|
4837
|
+
}), sr.getValue();
|
|
4824
4838
|
}
|
|
4825
4839
|
//#endregion
|
|
4826
4840
|
//#region lib/features/settings/useUserSettings.ts
|
|
4827
|
-
var
|
|
4828
|
-
function
|
|
4829
|
-
let e = y(
|
|
4830
|
-
return o(() => (
|
|
4841
|
+
var hr = _({}), gr = _(!1), _r = null;
|
|
4842
|
+
function vr() {
|
|
4843
|
+
let e = y(hr), t = y(gr), n = b(hr), r = b(gr), a = ke();
|
|
4844
|
+
return o(() => (_r ||= mr(a), _r.then((e) => {
|
|
4831
4845
|
n(e), r(!0);
|
|
4832
|
-
}),
|
|
4846
|
+
}), pr(n)), [
|
|
4833
4847
|
n,
|
|
4834
4848
|
r,
|
|
4835
4849
|
a
|
|
@@ -4840,20 +4854,20 @@ function pr() {
|
|
|
4840
4854
|
n((t) => ({
|
|
4841
4855
|
...t,
|
|
4842
4856
|
...e
|
|
4843
|
-
})),
|
|
4857
|
+
})), dr(a, e);
|
|
4844
4858
|
}, [n])
|
|
4845
4859
|
};
|
|
4846
4860
|
}
|
|
4847
4861
|
//#endregion
|
|
4848
4862
|
//#region lib/styles/extensions.module.css
|
|
4849
|
-
var
|
|
4863
|
+
var yr = "_active_jpq35_71", br = "_install_jpq35_261", xr = "_uninstall_jpq35_266", Sr = "_installed_jpq35_276", Y = {
|
|
4850
4864
|
"ext-panel": "_ext-panel_jpq35_1",
|
|
4851
4865
|
"ext-panel-header": "_ext-panel-header_jpq35_17",
|
|
4852
4866
|
"ext-panel-title": "_ext-panel-title_jpq35_28",
|
|
4853
4867
|
"ext-panel-close": "_ext-panel-close_jpq35_34",
|
|
4854
4868
|
"ext-panel-tabs": "_ext-panel-tabs_jpq35_49",
|
|
4855
4869
|
"ext-tab": "_ext-tab_jpq35_55",
|
|
4856
|
-
active:
|
|
4870
|
+
active: yr,
|
|
4857
4871
|
"ext-search": "_ext-search_jpq35_76",
|
|
4858
4872
|
"ext-source-selector": "_ext-source-selector_jpq35_82",
|
|
4859
4873
|
"ext-source-btn": "_ext-source-btn_jpq35_88",
|
|
@@ -4870,27 +4884,27 @@ var mr = "_active_jpq35_71", hr = "_install_jpq35_261", gr = "_uninstall_jpq35_2
|
|
|
4870
4884
|
"ext-theme-badge": "_ext-theme-badge_jpq35_223",
|
|
4871
4885
|
"ext-actions": "_ext-actions_jpq35_234",
|
|
4872
4886
|
"ext-btn": "_ext-btn_jpq35_241",
|
|
4873
|
-
install:
|
|
4874
|
-
uninstall:
|
|
4875
|
-
installed:
|
|
4887
|
+
install: br,
|
|
4888
|
+
uninstall: xr,
|
|
4889
|
+
installed: Sr,
|
|
4876
4890
|
"ext-color-themes": "_ext-color-themes_jpq35_281",
|
|
4877
4891
|
"ext-color-theme-btn": "_ext-color-theme-btn_jpq35_288",
|
|
4878
4892
|
"ext-color-theme-indicator": "_ext-color-theme-indicator_jpq35_296"
|
|
4879
4893
|
};
|
|
4880
4894
|
//#endregion
|
|
4881
4895
|
//#region lib/components/ExtensionsPanel.tsx
|
|
4882
|
-
function
|
|
4896
|
+
function Cr(e) {
|
|
4883
4897
|
return e instanceof Error ? e.message : e && typeof e == "object" && "message" in e ? String(e.message) : String(e);
|
|
4884
4898
|
}
|
|
4885
|
-
function
|
|
4886
|
-
let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f =
|
|
4899
|
+
function wr() {
|
|
4900
|
+
let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f = In(), [h, g] = d("marketplace"), [_, x] = d("vscode"), [S, C] = d(""), [w, T] = d([]), [E, D] = d([]), [O, k] = d(!1), [j, N] = d(null), [P, I] = d(""), ee = u(null), { settings: te, updateSettings: ne } = vr();
|
|
4887
4901
|
o(() => (A.push("modal"), () => {
|
|
4888
4902
|
A.pop("modal");
|
|
4889
4903
|
}), [t]);
|
|
4890
4904
|
let re = i(async (e, t) => {
|
|
4891
4905
|
k(!0), I("");
|
|
4892
4906
|
try {
|
|
4893
|
-
t === "vscode" ? (D((await
|
|
4907
|
+
t === "vscode" ? (D((await tr(e)).extensions), T([])) : (T((await Hn(e)).extensions), D([]));
|
|
4894
4908
|
} catch {
|
|
4895
4909
|
I(`Could not reach ${t === "vscode" ? "VS Code" : ".dir"} marketplace`);
|
|
4896
4910
|
}
|
|
@@ -4902,13 +4916,13 @@ function yr() {
|
|
|
4902
4916
|
let ie = (e) => {
|
|
4903
4917
|
C(e), ee.current && clearTimeout(ee.current), ee.current = setTimeout(() => re(e, _), 300);
|
|
4904
4918
|
}, R = async (t) => {
|
|
4905
|
-
let n =
|
|
4919
|
+
let n = ir(t);
|
|
4906
4920
|
if (n) {
|
|
4907
4921
|
N(`${t.publisher.publisherName}.${t.extensionName}`), I("");
|
|
4908
4922
|
try {
|
|
4909
|
-
await
|
|
4923
|
+
await Jn(e, t.publisher.publisherName, t.extensionName, n), f.restart();
|
|
4910
4924
|
} catch (e) {
|
|
4911
|
-
I(`Install failed: ${
|
|
4925
|
+
I(`Install failed: ${Cr(e)}`);
|
|
4912
4926
|
}
|
|
4913
4927
|
N(null);
|
|
4914
4928
|
}
|
|
@@ -4916,9 +4930,9 @@ function yr() {
|
|
|
4916
4930
|
if (t.latest_version) {
|
|
4917
4931
|
N(`${t.publisher.username}.${t.name}`), I("");
|
|
4918
4932
|
try {
|
|
4919
|
-
await
|
|
4933
|
+
await Kn(e, t.publisher.username, t.name, t.latest_version.version), f.restart();
|
|
4920
4934
|
} catch (e) {
|
|
4921
|
-
I(`Install failed: ${
|
|
4935
|
+
I(`Install failed: ${Cr(e)}`);
|
|
4922
4936
|
}
|
|
4923
4937
|
N(null);
|
|
4924
4938
|
}
|
|
@@ -4926,20 +4940,20 @@ function yr() {
|
|
|
4926
4940
|
let i = `${t.publisher}.${t.name}`;
|
|
4927
4941
|
N(i), I("");
|
|
4928
4942
|
try {
|
|
4929
|
-
await
|
|
4943
|
+
await Xn(e, t.publisher, t.name);
|
|
4930
4944
|
let o = !1;
|
|
4931
4945
|
n === i && (delete te.iconTheme, r(void 0), o = !0), a?.startsWith(i + ":") && (delete te.colorTheme, s(void 0), o = !0), o && ne(te), f.restart();
|
|
4932
4946
|
} catch (e) {
|
|
4933
|
-
I(`Uninstall failed: ${
|
|
4947
|
+
I(`Uninstall failed: ${Cr(e)}`);
|
|
4934
4948
|
}
|
|
4935
4949
|
N(null);
|
|
4936
4950
|
}, se = async (e) => {
|
|
4937
|
-
let t =
|
|
4951
|
+
let t = Zn(e);
|
|
4938
4952
|
if (!t) return;
|
|
4939
4953
|
let i = t === n ? void 0 : t;
|
|
4940
4954
|
i ? te.iconTheme = i : delete te.iconTheme, ne(te), r(i);
|
|
4941
4955
|
}, ce = async (e, t) => {
|
|
4942
|
-
let n =
|
|
4956
|
+
let n = Qn(e, t), r = n === a ? void 0 : n;
|
|
4943
4957
|
r ? te.colorTheme = r : delete te.colorTheme, ne(te), s(r);
|
|
4944
4958
|
}, B = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
4945
4959
|
return /* @__PURE__ */ m(L, {
|
|
@@ -5075,7 +5089,7 @@ function yr() {
|
|
|
5075
5089
|
className: Y["ext-empty"],
|
|
5076
5090
|
children: "No extensions found"
|
|
5077
5091
|
}) : E.map((e) => {
|
|
5078
|
-
let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i =
|
|
5092
|
+
let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i = rr(e), a = ar(e), o = nr(e);
|
|
5079
5093
|
return /* @__PURE__ */ m("div", {
|
|
5080
5094
|
className: Y["ext-item"],
|
|
5081
5095
|
children: [
|
|
@@ -5129,7 +5143,7 @@ function yr() {
|
|
|
5129
5143
|
className: Y["ext-empty"],
|
|
5130
5144
|
children: "No extensions installed"
|
|
5131
5145
|
}) : c.map((e) => {
|
|
5132
|
-
let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i =
|
|
5146
|
+
let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i = Zn(e), o = i != null && i === n, s = e.colorThemes && e.colorThemes.length > 0;
|
|
5133
5147
|
return /* @__PURE__ */ m("div", {
|
|
5134
5148
|
className: Y["ext-item"],
|
|
5135
5149
|
children: [
|
|
@@ -5194,7 +5208,7 @@ function yr() {
|
|
|
5194
5208
|
s && /* @__PURE__ */ p("div", {
|
|
5195
5209
|
className: Y["ext-color-themes"],
|
|
5196
5210
|
children: e.colorThemes.map((t) => {
|
|
5197
|
-
let n =
|
|
5211
|
+
let n = Qn(e, t.id) === a;
|
|
5198
5212
|
return /* @__PURE__ */ m("button", {
|
|
5199
5213
|
className: F(Y, "ext-btn", "ext-color-theme-btn", n ? "installed" : "install"),
|
|
5200
5214
|
onClick: () => ce(e, t.id),
|
|
@@ -5242,72 +5256,72 @@ var X = new class {
|
|
|
5242
5256
|
} catch {}
|
|
5243
5257
|
});
|
|
5244
5258
|
}
|
|
5245
|
-
}(),
|
|
5246
|
-
function
|
|
5259
|
+
}(), Tr = 200, Er = /* @__PURE__ */ new Map(), Dr = /* @__PURE__ */ new Map();
|
|
5260
|
+
function Or(e) {
|
|
5247
5261
|
return e.startsWith("/") || /^[A-Za-z]:/.test(e);
|
|
5248
5262
|
}
|
|
5249
|
-
function
|
|
5263
|
+
function kr(e) {
|
|
5250
5264
|
return `data:image/svg+xml,${encodeURIComponent(e)}`;
|
|
5251
5265
|
}
|
|
5252
|
-
function
|
|
5253
|
-
let t =
|
|
5254
|
-
t !== void 0 && (
|
|
5266
|
+
function Ar(e) {
|
|
5267
|
+
let t = Er.get(e);
|
|
5268
|
+
t !== void 0 && (Er.delete(e), Er.set(e, t));
|
|
5255
5269
|
}
|
|
5256
|
-
function
|
|
5257
|
-
for (;
|
|
5258
|
-
let e =
|
|
5259
|
-
|
|
5270
|
+
function jr() {
|
|
5271
|
+
for (; Er.size > Tr;) {
|
|
5272
|
+
let e = Er.keys().next().value;
|
|
5273
|
+
Er.delete(e);
|
|
5260
5274
|
}
|
|
5261
5275
|
}
|
|
5262
|
-
async function
|
|
5276
|
+
async function Mr(e, t) {
|
|
5263
5277
|
let n = W(t);
|
|
5264
5278
|
try {
|
|
5265
5279
|
let r = await Nt(e, n);
|
|
5266
|
-
|
|
5280
|
+
Er.set(t, kr(r)), jr();
|
|
5267
5281
|
} catch (e) {
|
|
5268
5282
|
throw console.warn("[IconCache] loadIconAbsolute failed", n, e), e;
|
|
5269
5283
|
}
|
|
5270
5284
|
}
|
|
5271
|
-
async function
|
|
5285
|
+
async function Nr(e) {
|
|
5272
5286
|
let t = await fetch(`/icons/${e}`);
|
|
5273
5287
|
if (!t.ok) return;
|
|
5274
5288
|
let n = await t.text();
|
|
5275
|
-
|
|
5289
|
+
Er.set(e, kr(n)), jr();
|
|
5276
5290
|
}
|
|
5277
|
-
function
|
|
5291
|
+
function Pr(e) {
|
|
5278
5292
|
return e === "_default" || e.startsWith("_default_");
|
|
5279
5293
|
}
|
|
5280
|
-
async function
|
|
5294
|
+
async function Fr(e, t) {
|
|
5281
5295
|
let n = [];
|
|
5282
5296
|
for (let r of t) {
|
|
5283
|
-
if (
|
|
5284
|
-
if (
|
|
5285
|
-
n.push(
|
|
5297
|
+
if (Pr(r) || Er.has(r)) continue;
|
|
5298
|
+
if (Dr.has(r)) {
|
|
5299
|
+
n.push(Dr.get(r));
|
|
5286
5300
|
continue;
|
|
5287
5301
|
}
|
|
5288
5302
|
let t = (async () => {
|
|
5289
5303
|
try {
|
|
5290
|
-
|
|
5304
|
+
Or(r) ? await Mr(e, r) : await Nr(r);
|
|
5291
5305
|
} catch (e) {
|
|
5292
5306
|
console.warn("[IconCache] loadIcons failed for", r.slice(-60), e);
|
|
5293
5307
|
} finally {
|
|
5294
|
-
|
|
5308
|
+
Dr.delete(r);
|
|
5295
5309
|
}
|
|
5296
5310
|
})();
|
|
5297
|
-
|
|
5311
|
+
Dr.set(r, t), n.push(t);
|
|
5298
5312
|
}
|
|
5299
5313
|
await Promise.all(n);
|
|
5300
5314
|
}
|
|
5301
|
-
function
|
|
5302
|
-
let t =
|
|
5303
|
-
return t !== void 0 &&
|
|
5315
|
+
function Ir(e) {
|
|
5316
|
+
let t = Er.get(e);
|
|
5317
|
+
return t !== void 0 && Ar(e), t;
|
|
5304
5318
|
}
|
|
5305
5319
|
//#endregion
|
|
5306
5320
|
//#region lib/features/file-icons/vscodeIconTheme.ts
|
|
5307
|
-
function
|
|
5321
|
+
function Lr(e) {
|
|
5308
5322
|
return `data:image/svg+xml,${encodeURIComponent(e)}`;
|
|
5309
5323
|
}
|
|
5310
|
-
var
|
|
5324
|
+
var Rr = class {
|
|
5311
5325
|
theme = null;
|
|
5312
5326
|
loadingIcons = /* @__PURE__ */ new Map();
|
|
5313
5327
|
themeKind = "dark";
|
|
@@ -5372,7 +5386,7 @@ var Nr = class {
|
|
|
5372
5386
|
let r = (async () => {
|
|
5373
5387
|
try {
|
|
5374
5388
|
let t = await Mt(this.bridge, e), n = e.split(".").pop()?.toLowerCase() ?? "", r;
|
|
5375
|
-
if (n === "svg") r =
|
|
5389
|
+
if (n === "svg") r = Lr(new TextDecoder().decode(t));
|
|
5376
5390
|
else {
|
|
5377
5391
|
let e = n === "png" ? "image/png" : n === "jpg" || n === "jpeg" ? "image/jpeg" : n === "webp" ? "image/webp" : "application/octet-stream", i = new Blob([t], { type: e });
|
|
5378
5392
|
r = URL.createObjectURL(i);
|
|
@@ -5392,51 +5406,51 @@ var Nr = class {
|
|
|
5392
5406
|
getCachedIcon(e) {
|
|
5393
5407
|
return this.theme?.iconCache.get(e) ?? null;
|
|
5394
5408
|
}
|
|
5395
|
-
},
|
|
5409
|
+
}, zr = _((e) => {
|
|
5396
5410
|
let t = e(Oe);
|
|
5397
5411
|
if (!t) throw Error("Bridge not initialized.");
|
|
5398
|
-
return new
|
|
5412
|
+
return new Rr(t);
|
|
5399
5413
|
});
|
|
5400
|
-
function
|
|
5401
|
-
return y(
|
|
5414
|
+
function Br() {
|
|
5415
|
+
return y(zr);
|
|
5402
5416
|
}
|
|
5403
5417
|
//#endregion
|
|
5404
5418
|
//#region lib/features/file-icons/iconResolver.ts
|
|
5405
|
-
var
|
|
5419
|
+
var Vr = {
|
|
5406
5420
|
folder: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M10%204H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2h-8l-2-2z%22%2F%3E%3C%2Fsvg%3E",
|
|
5407
5421
|
folderOpen: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M20%206h-8l-2-2H4c-1.1%200-2%20.9-2%202v12c0%201.1.9%202%202%202h16c1.1%200%202-.9%202-2V8c0-1.1-.9-2-2-2zm0%2012H4V8h16v10z%22%2F%3E%3C%2Fsvg%3E",
|
|
5408
5422
|
file: "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22%2390a4ae%22%3E%3Cpath%20d%3D%22M14%202H6c-1.1%200-2%20.9-2%202v16c0%201.1.9%202%202%202h12c1.1%200%202-.9%202-2V8l-6-6zm4%2018H6V4h7v5h5v11z%22%2F%3E%3C%2Fsvg%3E"
|
|
5409
|
-
},
|
|
5410
|
-
function
|
|
5411
|
-
let e =
|
|
5423
|
+
}, Hr = "fss", Ur = [];
|
|
5424
|
+
function Wr() {
|
|
5425
|
+
let e = Br();
|
|
5412
5426
|
return { setIconTheme: async (t, n) => {
|
|
5413
|
-
if (
|
|
5414
|
-
await e.load(n),
|
|
5427
|
+
if (Hr = t, t === "vscode" && n) try {
|
|
5428
|
+
await e.load(n), qr();
|
|
5415
5429
|
} catch {
|
|
5416
|
-
|
|
5430
|
+
Hr = "none", qr();
|
|
5417
5431
|
}
|
|
5418
|
-
else e.clear(),
|
|
5432
|
+
else e.clear(), qr();
|
|
5419
5433
|
} };
|
|
5420
5434
|
}
|
|
5421
|
-
function
|
|
5422
|
-
let e =
|
|
5435
|
+
function Gr() {
|
|
5436
|
+
let e = Br();
|
|
5423
5437
|
return { setIconThemeKind: (t) => {
|
|
5424
5438
|
e.setTheme(t);
|
|
5425
5439
|
} };
|
|
5426
5440
|
}
|
|
5427
|
-
function
|
|
5428
|
-
return
|
|
5429
|
-
|
|
5441
|
+
function Kr(e) {
|
|
5442
|
+
return Ur.push(e), () => {
|
|
5443
|
+
Ur = Ur.filter((t) => t !== e);
|
|
5430
5444
|
};
|
|
5431
5445
|
}
|
|
5432
|
-
function
|
|
5433
|
-
for (let e of
|
|
5446
|
+
function qr() {
|
|
5447
|
+
for (let e of Ur) e();
|
|
5434
5448
|
}
|
|
5435
|
-
function
|
|
5436
|
-
let e =
|
|
5449
|
+
function Jr() {
|
|
5450
|
+
let e = Br();
|
|
5437
5451
|
return (t, n, r, i, a, o) => {
|
|
5438
|
-
let s = n ? r ?
|
|
5439
|
-
if (
|
|
5452
|
+
let s = n ? r ? Vr.folderOpen : Vr.folder : Vr.file;
|
|
5453
|
+
if (Hr === "vscode" && e.isLoaded()) {
|
|
5440
5454
|
let o = e.resolveIcon(t, n, r, i, a);
|
|
5441
5455
|
return o ? {
|
|
5442
5456
|
path: o,
|
|
@@ -5448,9 +5462,9 @@ function Ur() {
|
|
|
5448
5462
|
fallbackUrl: s
|
|
5449
5463
|
};
|
|
5450
5464
|
}
|
|
5451
|
-
return
|
|
5465
|
+
return Hr === "fss" && o ? {
|
|
5452
5466
|
path: o,
|
|
5453
|
-
url:
|
|
5467
|
+
url: Ir(o) ?? null,
|
|
5454
5468
|
fallbackUrl: s
|
|
5455
5469
|
} : {
|
|
5456
5470
|
path: "_default",
|
|
@@ -5459,52 +5473,52 @@ function Ur() {
|
|
|
5459
5473
|
};
|
|
5460
5474
|
};
|
|
5461
5475
|
}
|
|
5462
|
-
function
|
|
5463
|
-
let e =
|
|
5476
|
+
function Yr() {
|
|
5477
|
+
let e = Br(), t = ke();
|
|
5464
5478
|
return async (n) => {
|
|
5465
|
-
|
|
5479
|
+
Hr === "vscode" && e.isLoaded() ? await e.preloadIcons(n) : await Fr(t, n);
|
|
5466
5480
|
};
|
|
5467
5481
|
}
|
|
5468
|
-
function
|
|
5469
|
-
let e =
|
|
5470
|
-
return (t) => t === "_default_folder" ?
|
|
5482
|
+
function Xr() {
|
|
5483
|
+
let e = Br();
|
|
5484
|
+
return (t) => t === "_default_folder" ? Vr.folder : t === "_default_folder_open" ? Vr.folderOpen : t === "_default_file" ? Vr.file : Hr === "vscode" && e.isLoaded() ? e.getCachedIcon(t) : Ir(t) ?? null;
|
|
5471
5485
|
}
|
|
5472
5486
|
//#endregion
|
|
5473
5487
|
//#region lib/features/file-ops/model/fileOperationHandlers.ts
|
|
5474
|
-
var
|
|
5475
|
-
function
|
|
5476
|
-
|
|
5488
|
+
var Zr = null;
|
|
5489
|
+
function Qr(e) {
|
|
5490
|
+
Zr = e;
|
|
5477
5491
|
}
|
|
5478
|
-
function
|
|
5479
|
-
return
|
|
5492
|
+
function $r() {
|
|
5493
|
+
return Zr;
|
|
5480
5494
|
}
|
|
5481
5495
|
//#endregion
|
|
5482
5496
|
//#region lib/fss.ts
|
|
5483
|
-
var
|
|
5484
|
-
function
|
|
5497
|
+
var ei = E("\nfolder { font-weight: bold; }\n\n@sorting {\n folder { group-first: true; }\n file[executable] { priority: 1; }\n}\n", "/", w.GLOBAL), ti = [];
|
|
5498
|
+
function ni(e, t) {
|
|
5485
5499
|
return e.replace(/url\(([^)]+)\)/g, (e, n) => {
|
|
5486
5500
|
let r = n.trim();
|
|
5487
5501
|
return r.startsWith("/") || /^[A-Za-z]:/.test(r) ? e : `url(${K(t, r.replace(/^\.\//, ""))})`;
|
|
5488
5502
|
});
|
|
5489
5503
|
}
|
|
5490
|
-
function
|
|
5504
|
+
function ri(e, t) {
|
|
5491
5505
|
let n = e.filter((e) => e.iconThemeFss != null && e.iconThemeBasePath != null), r = t ? n.filter((e) => `${e.ref.publisher}.${e.ref.name}` === t) : [];
|
|
5492
5506
|
console.log("[FSS] setExtensionLayers", {
|
|
5493
5507
|
total: e.length,
|
|
5494
5508
|
withFss: n.map((e) => `${e.ref.publisher}.${e.ref.name}`),
|
|
5495
5509
|
activeIconTheme: t ?? "(all)",
|
|
5496
5510
|
layersAdded: r.map((e) => `${e.ref.publisher}.${e.ref.name}`)
|
|
5497
|
-
}),
|
|
5511
|
+
}), ti = r.map((e) => E(ni(e.iconThemeFss, W(e.iconThemeBasePath)), "/", w.USER));
|
|
5498
5512
|
}
|
|
5499
|
-
var
|
|
5500
|
-
function
|
|
5501
|
-
|
|
5513
|
+
var ii = /* @__PURE__ */ new Map();
|
|
5514
|
+
function ai(e) {
|
|
5515
|
+
ii.delete(e);
|
|
5502
5516
|
}
|
|
5503
|
-
function
|
|
5517
|
+
function oi(e = "dark") {
|
|
5504
5518
|
let t = new T();
|
|
5505
|
-
return t.addLayer(
|
|
5519
|
+
return t.addLayer(ei), t.setTheme(e), t;
|
|
5506
5520
|
}
|
|
5507
|
-
async function
|
|
5521
|
+
async function si(e, t, n) {
|
|
5508
5522
|
let r = [], i = n;
|
|
5509
5523
|
for (;;) {
|
|
5510
5524
|
r.push(i);
|
|
@@ -5512,30 +5526,30 @@ async function ni(e, t, n) {
|
|
|
5512
5526
|
if (e === i) break;
|
|
5513
5527
|
i = e;
|
|
5514
5528
|
}
|
|
5515
|
-
for (let t of r) if (q(t) !== ".dotdir" &&
|
|
5529
|
+
for (let t of r) if (q(t) !== ".dotdir" && !ii.has(t)) {
|
|
5516
5530
|
let n = K(t, ".dotdir");
|
|
5517
5531
|
try {
|
|
5518
|
-
|
|
5532
|
+
ii.set(t, await Nt(e, K(n, "fs.css")));
|
|
5519
5533
|
} catch {
|
|
5520
|
-
|
|
5534
|
+
ii.set(t, null);
|
|
5521
5535
|
}
|
|
5522
5536
|
}
|
|
5523
|
-
let a = [
|
|
5537
|
+
let a = [ei, ...ti];
|
|
5524
5538
|
for (let e of r) {
|
|
5525
|
-
let t =
|
|
5539
|
+
let t = ii.get(e);
|
|
5526
5540
|
if (t != null) {
|
|
5527
5541
|
let n = e === "/" ? 0 : e.split("/").filter(Boolean).length, r = K(e, ".dotdir");
|
|
5528
|
-
a.push(E(
|
|
5542
|
+
a.push(E(ni(t, r), e, w.nestedPriority(n)));
|
|
5529
5543
|
}
|
|
5530
5544
|
}
|
|
5531
5545
|
t.setLayers(a);
|
|
5532
5546
|
}
|
|
5533
|
-
function
|
|
5547
|
+
function ci(e) {
|
|
5534
5548
|
if (!e) return null;
|
|
5535
5549
|
let t = /^url\(([^)]+)\)$/.exec(String(e));
|
|
5536
5550
|
return t ? t[1] : null;
|
|
5537
5551
|
}
|
|
5538
|
-
function
|
|
5552
|
+
function li(e, t) {
|
|
5539
5553
|
let n = e.resolveStyle(t), r = e.resolveSorting(t);
|
|
5540
5554
|
return {
|
|
5541
5555
|
color: n.color == null ? void 0 : String(n.color),
|
|
@@ -5545,14 +5559,14 @@ function ii(e, t) {
|
|
|
5545
5559
|
fontStretch: n["font-stretch"] == null ? void 0 : String(n["font-stretch"]),
|
|
5546
5560
|
fontVariant: n["font-variant"] == null ? void 0 : String(n["font-variant"]),
|
|
5547
5561
|
textDecoration: n["text-decoration"] == null ? void 0 : String(n["text-decoration"]),
|
|
5548
|
-
icon:
|
|
5562
|
+
icon: ci(n.icon),
|
|
5549
5563
|
sortPriority: typeof r.priority == "number" ? r.priority : 0,
|
|
5550
5564
|
groupFirst: r["group-first"] === !0
|
|
5551
5565
|
};
|
|
5552
5566
|
}
|
|
5553
5567
|
//#endregion
|
|
5554
5568
|
//#region lib/hooks/useMediaQuery.ts
|
|
5555
|
-
function
|
|
5569
|
+
function ui(e) {
|
|
5556
5570
|
let [t, n] = d(() => typeof window > "u" ? !1 : window.matchMedia(e).matches);
|
|
5557
5571
|
return o(() => {
|
|
5558
5572
|
if (typeof window > "u") return;
|
|
@@ -5562,11 +5576,11 @@ function ai(e) {
|
|
|
5562
5576
|
}
|
|
5563
5577
|
//#endregion
|
|
5564
5578
|
//#region lib/styles/file-list.module.css
|
|
5565
|
-
var
|
|
5579
|
+
var di = "_breadcrumbs_15ml8_25", fi = "_entry_15ml8_151", pi = "_selected_15ml8_166", mi = "_marked_15ml8_176", Z = {
|
|
5566
5580
|
"file-list": "_file-list_15ml8_1",
|
|
5567
5581
|
"active-panel": "_active-panel_15ml8_7",
|
|
5568
5582
|
"path-bar": "_path-bar_15ml8_7",
|
|
5569
|
-
breadcrumbs:
|
|
5583
|
+
breadcrumbs: di,
|
|
5570
5584
|
"is-cropped-left": "_is-cropped-left_15ml8_44",
|
|
5571
5585
|
"is-cropped-right": "_is-cropped-right_15ml8_53",
|
|
5572
5586
|
"breadcrumb-copied-tooltip": "_breadcrumb-copied-tooltip_15ml8_67",
|
|
@@ -5578,11 +5592,11 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5578
5592
|
"columns-scroller-content": "_columns-scroller-content_15ml8_123",
|
|
5579
5593
|
"columns-borders": "_columns-borders_15ml8_135",
|
|
5580
5594
|
"columns-border": "_columns-border_15ml8_135",
|
|
5581
|
-
entry:
|
|
5595
|
+
entry: fi,
|
|
5582
5596
|
"no-hover": "_no-hover_15ml8_162",
|
|
5583
|
-
selected:
|
|
5597
|
+
selected: pi,
|
|
5584
5598
|
"inactive-panel": "_inactive-panel_15ml8_171",
|
|
5585
|
-
marked:
|
|
5599
|
+
marked: mi,
|
|
5586
5600
|
"entry-icon": "_entry-icon_15ml8_195",
|
|
5587
5601
|
"entry-name": "_entry-name_15ml8_201",
|
|
5588
5602
|
"entry-size": "_entry-size_15ml8_208",
|
|
@@ -5592,7 +5606,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5592
5606
|
"file-info-size": "_file-info-size_15ml8_247",
|
|
5593
5607
|
"file-info-date": "_file-info-date_15ml8_253",
|
|
5594
5608
|
"panel-summary": "_panel-summary_15ml8_259"
|
|
5595
|
-
},
|
|
5609
|
+
}, hi = r(function({ currentPath: e, onNavigate: n }) {
|
|
5596
5610
|
let r = u(null), a = u(!0), s = u(!1), [f, h] = d(!1), [g, _] = d(!1), [v, y] = d(!1), b = u(null), x = l(() => At(e), [e]), S = i((t, r, i) => {
|
|
5597
5611
|
i ? navigator.clipboard.writeText(e).then(() => {
|
|
5598
5612
|
b.current && clearTimeout(b.current), y(!0), b.current = setTimeout(() => {
|
|
@@ -5664,8 +5678,8 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5664
5678
|
children: "Path copied to clipboard"
|
|
5665
5679
|
})]
|
|
5666
5680
|
});
|
|
5667
|
-
}),
|
|
5668
|
-
let l = u(null), d = u(n), f = u(c), m =
|
|
5681
|
+
}), gi = ({ children: e, scrollHeight: t, scrollTop: n, lineSize: r, velocityFactor: i = 20, frictionFactor: a = .95, style: s, onScroll: c }) => {
|
|
5682
|
+
let l = u(null), d = u(n), f = u(c), m = ui("(pointer: coarse)");
|
|
5669
5683
|
return d.current = n, f.current = c, o(() => {
|
|
5670
5684
|
let e = l.current;
|
|
5671
5685
|
if (!e) return;
|
|
@@ -5721,7 +5735,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5721
5735
|
};
|
|
5722
5736
|
//#endregion
|
|
5723
5737
|
//#region lib/components/FileList/useElementSize.ts
|
|
5724
|
-
function
|
|
5738
|
+
function _i(e) {
|
|
5725
5739
|
let [t, n] = d({
|
|
5726
5740
|
width: 0,
|
|
5727
5741
|
height: 0
|
|
@@ -5741,7 +5755,7 @@ function fi(e) {
|
|
|
5741
5755
|
}
|
|
5742
5756
|
//#endregion
|
|
5743
5757
|
//#region lib/components/FileList/ColumnsScroller.tsx
|
|
5744
|
-
var
|
|
5758
|
+
var vi = r(function({ index: e, isActive: t, isSelected: n, width: r, height: i, renderItem: a }) {
|
|
5745
5759
|
return /* @__PURE__ */ p("div", {
|
|
5746
5760
|
style: {
|
|
5747
5761
|
width: r,
|
|
@@ -5749,12 +5763,12 @@ var pi = r(function({ index: e, isActive: t, isSelected: n, width: r, height: i,
|
|
|
5749
5763
|
},
|
|
5750
5764
|
children: a(e, t, n)
|
|
5751
5765
|
});
|
|
5752
|
-
}),
|
|
5766
|
+
}), yi = r(function(e) {
|
|
5753
5767
|
let { topmostIndex: t } = e, { activeIndex: n, totalCount: r, itemHeight: a, minColumnWidth: s, far: l = !1, selectedKeys: d, getItemKey: f, renderItem: h, onPosChange: g, onItemsPerColumnChanged: _, onColumnCountChanged: v } = e;
|
|
5754
5768
|
if (!Number.isInteger(a) || a <= 0) throw Error("itemHeight should be positive");
|
|
5755
5769
|
let y = u(g), b = u(_), x = u(v);
|
|
5756
5770
|
y.current = g, b.current = _, x.current = v;
|
|
5757
|
-
let S = u(null), { width: C, height: w } =
|
|
5771
|
+
let S = u(null), { width: C, height: w } = _i(S), T = s != null && C > 0 ? Math.max(1, Math.floor(C / s)) : 1, E = Math.max(1, Math.floor(w / a));
|
|
5758
5772
|
c(() => {
|
|
5759
5773
|
b.current?.(E);
|
|
5760
5774
|
}, [E]), c(() => {
|
|
@@ -5775,7 +5789,7 @@ var pi = r(function({ index: e, isActive: t, isSelected: n, width: r, height: i,
|
|
|
5775
5789
|
}, [a, l]), j = Math.min(r, t + E * T), M = `${100 / T}%`, N = [];
|
|
5776
5790
|
for (let e = t; e < j; e++) {
|
|
5777
5791
|
let t = f ? f(e) : e;
|
|
5778
|
-
N.push(/* @__PURE__ */ p(
|
|
5792
|
+
N.push(/* @__PURE__ */ p(vi, {
|
|
5779
5793
|
index: e,
|
|
5780
5794
|
isActive: n === e,
|
|
5781
5795
|
isSelected: d?.has(t) ?? !1,
|
|
@@ -5796,7 +5810,7 @@ var pi = r(function({ index: e, isActive: t, isSelected: n, width: r, height: i,
|
|
|
5796
5810
|
className: Z["columns-borders"],
|
|
5797
5811
|
style: { gridTemplateColumns: `repeat(${T}, 1fr)` },
|
|
5798
5812
|
children: Array.from({ length: T }, (e, t) => /* @__PURE__ */ p("div", { className: Z["columns-border"] }, t))
|
|
5799
|
-
}), /* @__PURE__ */ p(
|
|
5813
|
+
}), /* @__PURE__ */ p(gi, {
|
|
5800
5814
|
scrollTop: n * a,
|
|
5801
5815
|
scrollHeight: (r - 1) * a,
|
|
5802
5816
|
lineSize: a,
|
|
@@ -5809,26 +5823,26 @@ var pi = r(function({ index: e, isActive: t, isSelected: n, width: r, height: i,
|
|
|
5809
5823
|
})
|
|
5810
5824
|
})]
|
|
5811
5825
|
});
|
|
5812
|
-
}),
|
|
5813
|
-
function
|
|
5826
|
+
}), bi = 26;
|
|
5827
|
+
function xi(e) {
|
|
5814
5828
|
let t;
|
|
5815
5829
|
if (typeof e == "number") t = e;
|
|
5816
5830
|
else if (typeof e == "bigint") t = Number(e);
|
|
5817
5831
|
else return "";
|
|
5818
5832
|
return t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} K` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} M` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} G`;
|
|
5819
5833
|
}
|
|
5820
|
-
function
|
|
5834
|
+
function Si(e) {
|
|
5821
5835
|
if (!e) return "";
|
|
5822
5836
|
let t = new Date(e), n = (e) => String(e).padStart(2, "0");
|
|
5823
5837
|
return `${t.getFullYear()}-${n(t.getMonth() + 1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`;
|
|
5824
5838
|
}
|
|
5825
|
-
function
|
|
5839
|
+
function Ci(e, t, n) {
|
|
5826
5840
|
return Math.max(t, Math.min(n, e));
|
|
5827
5841
|
}
|
|
5828
|
-
var
|
|
5842
|
+
var wi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r, selectionKey: a, active: s, resolver: c, requestedActiveName: f, requestedTopmostName: h, onStateChange: g }) {
|
|
5829
5843
|
let _ = u(null), [v, y] = d(0), [b, x] = d(0), [S, C] = d(1), [w, T] = d(1), [E, D] = d(0), [O, k] = d(/* @__PURE__ */ new Set()), [A, j] = d(!1), M = u(A);
|
|
5830
5844
|
M.current = A;
|
|
5831
|
-
let N =
|
|
5845
|
+
let N = ui("(pointer: coarse)"), P = u(O);
|
|
5832
5846
|
P.current = O;
|
|
5833
5847
|
let I = u(void 0), ee = u(e), te = u([]), L = u(v);
|
|
5834
5848
|
L.current = v;
|
|
@@ -5842,15 +5856,15 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5842
5856
|
M.current || j(!0);
|
|
5843
5857
|
}, []), ae = i(() => {
|
|
5844
5858
|
M.current && j(!1);
|
|
5845
|
-
}, []), z =
|
|
5859
|
+
}, []), z = Xr(), oe = i((e) => {
|
|
5846
5860
|
if (e) return z(e) ?? void 0;
|
|
5847
|
-
}, [z]), se =
|
|
5861
|
+
}, [z]), se = Jr(), ce = l(() => {
|
|
5848
5862
|
let e = n.map((e) => {
|
|
5849
5863
|
e = {
|
|
5850
5864
|
...e,
|
|
5851
5865
|
parent: t
|
|
5852
5866
|
};
|
|
5853
|
-
let n =
|
|
5867
|
+
let n = li(c, e), r = e.type === "folder", i = se(e.name, r, !1, !1, e.lang, n.icon);
|
|
5854
5868
|
return {
|
|
5855
5869
|
entry: e,
|
|
5856
5870
|
style: n,
|
|
@@ -5865,7 +5879,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5865
5879
|
let n = {
|
|
5866
5880
|
...t,
|
|
5867
5881
|
stateFlags: 1
|
|
5868
|
-
}, r =
|
|
5882
|
+
}, r = li(c, n), i = se("..", !0, !0, !1, "", r.icon);
|
|
5869
5883
|
e.push({
|
|
5870
5884
|
entry: {
|
|
5871
5885
|
...n,
|
|
@@ -5884,7 +5898,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5884
5898
|
let e = /* @__PURE__ */ new Set();
|
|
5885
5899
|
for (let { iconPath: t } of B) t && e.add(t);
|
|
5886
5900
|
return [...e];
|
|
5887
|
-
}, [B]), ue =
|
|
5901
|
+
}, [B]), ue = Yr();
|
|
5888
5902
|
o(() => {
|
|
5889
5903
|
let e = !1;
|
|
5890
5904
|
return ue(le).then(() => {
|
|
@@ -5892,7 +5906,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5892
5906
|
}), () => {
|
|
5893
5907
|
e = !0;
|
|
5894
5908
|
};
|
|
5895
|
-
}, [le]), o(() =>
|
|
5909
|
+
}, [le]), o(() => Kr(() => {
|
|
5896
5910
|
D((e) => e + 1);
|
|
5897
5911
|
}), []), o(() => {
|
|
5898
5912
|
let t = ee.current;
|
|
@@ -5962,7 +5976,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5962
5976
|
a && (i ? s.add(a) : s.delete(a));
|
|
5963
5977
|
}
|
|
5964
5978
|
return s;
|
|
5965
|
-
}), y(
|
|
5979
|
+
}), y(Ci(t, 0, r.length - 1));
|
|
5966
5980
|
}, []);
|
|
5967
5981
|
o(() => {
|
|
5968
5982
|
if (!s) return;
|
|
@@ -5998,7 +6012,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5998
6012
|
]);
|
|
5999
6013
|
let ye = i(() => {
|
|
6000
6014
|
let e = V.current[L.current], t = e?.entry.type === "file", n = t && e != null && !!e.entry.meta.executable, r = e?.entry.name ?? "";
|
|
6001
|
-
H.beginBatch(), H.setContext("listItemIsFile", t), H.setContext("listItemIsFolder", !t && e != null), H.setContext("listItemIsExecutable", n), H.setContext("listItemHasViewer", t &&
|
|
6015
|
+
H.beginBatch(), H.setContext("listItemIsFile", t), H.setContext("listItemIsFolder", !t && e != null), H.setContext("listItemIsExecutable", n), H.setContext("listItemHasViewer", t && ln.resolve(r) !== null), H.setContext("listItemHasEditor", t && un.resolve(r) !== null), H.endBatch();
|
|
6002
6016
|
}, []);
|
|
6003
6017
|
o(() => {
|
|
6004
6018
|
s && ye();
|
|
@@ -6009,7 +6023,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6009
6023
|
ye
|
|
6010
6024
|
]), o(() => {
|
|
6011
6025
|
if (!s) return;
|
|
6012
|
-
let e =
|
|
6026
|
+
let e = ln.onChange(ye), t = un.onChange(ye);
|
|
6013
6027
|
return () => {
|
|
6014
6028
|
e(), t();
|
|
6015
6029
|
};
|
|
@@ -6098,7 +6112,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6098
6112
|
}
|
|
6099
6113
|
}),
|
|
6100
6114
|
moveToTrash: () => X.enqueue(() => {
|
|
6101
|
-
let e =
|
|
6115
|
+
let e = $r();
|
|
6102
6116
|
if (!e) return;
|
|
6103
6117
|
let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
|
|
6104
6118
|
let e = n[L.current];
|
|
@@ -6107,7 +6121,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6107
6121
|
i.length !== 0 && e.moveToTrash(i, r);
|
|
6108
6122
|
}),
|
|
6109
6123
|
permanentDelete: () => X.enqueue(() => {
|
|
6110
|
-
let e =
|
|
6124
|
+
let e = $r();
|
|
6111
6125
|
if (!e) return;
|
|
6112
6126
|
let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
|
|
6113
6127
|
let e = n[L.current];
|
|
@@ -6116,7 +6130,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6116
6130
|
i.length !== 0 && e.permanentDelete(i, r);
|
|
6117
6131
|
}),
|
|
6118
6132
|
copy: () => X.enqueue(() => {
|
|
6119
|
-
let e =
|
|
6133
|
+
let e = $r();
|
|
6120
6134
|
if (!e) return;
|
|
6121
6135
|
let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
|
|
6122
6136
|
let e = n[L.current];
|
|
@@ -6125,7 +6139,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6125
6139
|
i.length !== 0 && e.copy(i, r);
|
|
6126
6140
|
}),
|
|
6127
6141
|
move: () => X.enqueue(() => {
|
|
6128
|
-
let e =
|
|
6142
|
+
let e = $r();
|
|
6129
6143
|
if (!e) return;
|
|
6130
6144
|
let t = P.current, n = V.current, r = () => ie.current(re.current), i = t.size > 0 ? n.filter((e) => t.has(e.entry.name)).map((e) => e.entry.path) : (() => {
|
|
6131
6145
|
let e = n[L.current];
|
|
@@ -6134,7 +6148,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6134
6148
|
i.length !== 0 && e.move(i, r);
|
|
6135
6149
|
}),
|
|
6136
6150
|
rename: () => X.enqueue(() => {
|
|
6137
|
-
let e =
|
|
6151
|
+
let e = $r();
|
|
6138
6152
|
if (!e) return;
|
|
6139
6153
|
let t = V.current[L.current];
|
|
6140
6154
|
t && e.rename(t.entry.path, t.entry.name, () => ie.current(re.current));
|
|
@@ -6142,7 +6156,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6142
6156
|
pasteFilename: () => X.enqueue(() => {
|
|
6143
6157
|
let e = V.current[L.current];
|
|
6144
6158
|
if (!e) return;
|
|
6145
|
-
let t =
|
|
6159
|
+
let t = $r();
|
|
6146
6160
|
if (!t) return;
|
|
6147
6161
|
let n = e.entry.name, r = /^[a-zA-Z0-9._+-]+$/.test(n) ? n : JSON.stringify(n);
|
|
6148
6162
|
t.pasteToCommandLine(r);
|
|
@@ -6150,7 +6164,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6150
6164
|
pastePath: () => X.enqueue(() => {
|
|
6151
6165
|
let e = V.current[L.current];
|
|
6152
6166
|
if (!e) return;
|
|
6153
|
-
let t =
|
|
6167
|
+
let t = $r();
|
|
6154
6168
|
if (!t) return;
|
|
6155
6169
|
let n = (e.entry.path ?? "").split("\0")[0], r = /^[a-zA-Z0-9._+/:-]+$/.test(n) ? n : JSON.stringify(n);
|
|
6156
6170
|
t.pasteToCommandLine(r);
|
|
@@ -6170,7 +6184,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6170
6184
|
T(e);
|
|
6171
6185
|
}, []), Ce = i((e, t) => {
|
|
6172
6186
|
let n = V.current.length;
|
|
6173
|
-
y(
|
|
6187
|
+
y(Ci(t, 0, n - 1)), x(Ci(e, 0, n - 1));
|
|
6174
6188
|
}, []), we = i((e) => V.current[e]?.entry.name ?? e, []), Te = u(0), Ee = i((e, t, n) => {
|
|
6175
6189
|
let r = V.current[e];
|
|
6176
6190
|
if (!r) return null;
|
|
@@ -6178,7 +6192,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6178
6192
|
return /* @__PURE__ */ m("div", {
|
|
6179
6193
|
className: F(Z, "entry", t && "selected", n && "marked"),
|
|
6180
6194
|
style: {
|
|
6181
|
-
height:
|
|
6195
|
+
height: bi,
|
|
6182
6196
|
opacity: a.opacity
|
|
6183
6197
|
},
|
|
6184
6198
|
onMouseDown: (t) => {
|
|
@@ -6210,7 +6224,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6210
6224
|
}),
|
|
6211
6225
|
"size" in i.meta && i.type === "file" && /* @__PURE__ */ p("span", {
|
|
6212
6226
|
className: Z["entry-size"],
|
|
6213
|
-
children:
|
|
6227
|
+
children: xi(i.meta.size)
|
|
6214
6228
|
})
|
|
6215
6229
|
]
|
|
6216
6230
|
});
|
|
@@ -6218,7 +6232,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6218
6232
|
he,
|
|
6219
6233
|
E,
|
|
6220
6234
|
ae
|
|
6221
|
-
]), De = B[v], Oe = De?.entry.name ?? "", ke = De ?
|
|
6235
|
+
]), De = B[v], Oe = De?.entry.name ?? "", ke = De ? Si(Number(De.entry.meta.mtimeMs ?? 0)) : "", Ae = (() => {
|
|
6222
6236
|
if (!De) return "";
|
|
6223
6237
|
let e = De.entry;
|
|
6224
6238
|
if (e.name === "..") return "Up";
|
|
@@ -6235,7 +6249,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6235
6249
|
case "event_port": return "EVT PORT";
|
|
6236
6250
|
case "unknown": return "?";
|
|
6237
6251
|
default: {
|
|
6238
|
-
let t =
|
|
6252
|
+
let t = xi(e.meta.size);
|
|
6239
6253
|
return n > 1 ? `${t} [${n}]` : t;
|
|
6240
6254
|
}
|
|
6241
6255
|
}
|
|
@@ -6250,7 +6264,6 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6250
6264
|
}, [O, B]);
|
|
6251
6265
|
return /* @__PURE__ */ m("div", {
|
|
6252
6266
|
ref: _,
|
|
6253
|
-
tabIndex: 0,
|
|
6254
6267
|
className: F(Z, "file-list", N || A ? "no-hover" : null, s ? "active-panel" : "inactive-panel"),
|
|
6255
6268
|
onMouseMoveCapture: ae,
|
|
6256
6269
|
onMouseDownCapture: () => {
|
|
@@ -6259,18 +6272,18 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6259
6272
|
children: [
|
|
6260
6273
|
/* @__PURE__ */ p("div", {
|
|
6261
6274
|
className: Z["path-bar"],
|
|
6262
|
-
children: /* @__PURE__ */ p(
|
|
6275
|
+
children: /* @__PURE__ */ p(hi, {
|
|
6263
6276
|
currentPath: e,
|
|
6264
6277
|
onNavigate: pe
|
|
6265
6278
|
})
|
|
6266
6279
|
}),
|
|
6267
6280
|
/* @__PURE__ */ p("div", {
|
|
6268
6281
|
className: Z["file-list-body"],
|
|
6269
|
-
children: /* @__PURE__ */ p(
|
|
6282
|
+
children: /* @__PURE__ */ p(yi, {
|
|
6270
6283
|
topmostIndex: b,
|
|
6271
6284
|
activeIndex: v,
|
|
6272
6285
|
totalCount: B.length,
|
|
6273
|
-
itemHeight:
|
|
6286
|
+
itemHeight: bi,
|
|
6274
6287
|
minColumnWidth: 250,
|
|
6275
6288
|
far: !0,
|
|
6276
6289
|
selectedKeys: O,
|
|
@@ -6304,22 +6317,22 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6304
6317
|
}),
|
|
6305
6318
|
/* @__PURE__ */ p("div", {
|
|
6306
6319
|
className: Z["panel-summary"],
|
|
6307
|
-
children: Pe ? `${Pe.count} selected, ${
|
|
6320
|
+
children: Pe ? `${Pe.count} selected, ${xi(Pe.size)}` : `${Me.toLocaleString()} file${Me === 1 ? "" : "s"}, ${xi(Ne)}`
|
|
6308
6321
|
})
|
|
6309
6322
|
]
|
|
6310
6323
|
});
|
|
6311
|
-
}),
|
|
6324
|
+
}), Ti = "_hidden_1i903_12", Ei = "_panel_1i903_1", Di = "_active_1i903_33", Oi = "_temp_1i903_123", ki = {
|
|
6312
6325
|
"panels-overlay": "_panels-overlay_1i903_1",
|
|
6313
|
-
hidden:
|
|
6314
|
-
panel:
|
|
6315
|
-
active:
|
|
6326
|
+
hidden: Ti,
|
|
6327
|
+
panel: Ei,
|
|
6328
|
+
active: Di,
|
|
6316
6329
|
"panel-progress": "_panel-progress_1i903_37",
|
|
6317
6330
|
"progress-slide": "_progress-slide_1i903_1",
|
|
6318
6331
|
"panel-tabs": "_panel-tabs_1i903_67",
|
|
6319
6332
|
"panel-tabs-list": "_panel-tabs-list_1i903_77",
|
|
6320
6333
|
"panel-tab": "_panel-tab_1i903_67",
|
|
6321
6334
|
"panel-tab-label": "_panel-tab-label_1i903_106",
|
|
6322
|
-
temp:
|
|
6335
|
+
temp: Oi,
|
|
6323
6336
|
"panel-tab-close": "_panel-tab-close_1i903_127",
|
|
6324
6337
|
"panel-tab-new": "_panel-tab-new_1i903_147",
|
|
6325
6338
|
"panel-tab-dragging": "_panel-tab-dragging_1i903_166",
|
|
@@ -6328,10 +6341,10 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6328
6341
|
};
|
|
6329
6342
|
//#endregion
|
|
6330
6343
|
//#region lib/components/FileList/PanelTabs.tsx
|
|
6331
|
-
function
|
|
6344
|
+
function Ai(e) {
|
|
6332
6345
|
return e.type === "filelist" ? q(e.path) || e.path || "File list" : e.name;
|
|
6333
6346
|
}
|
|
6334
|
-
var
|
|
6347
|
+
var ji = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab: r, onCloseTab: a, onNewTab: s, onReorderTabs: c }) {
|
|
6335
6348
|
let l = u(null), f = u([]), h = u(null), [g, _] = d(null);
|
|
6336
6349
|
f.current = e.map((e, t) => f.current[t] ?? null);
|
|
6337
6350
|
let v = i((e) => {
|
|
@@ -6349,7 +6362,7 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6349
6362
|
return t.length;
|
|
6350
6363
|
}, []), b = i((e, t) => {
|
|
6351
6364
|
h.current = t, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/plain", String(t)), e.dataTransfer.setDragImage(new Image(), 0, 0), requestAnimationFrame(() => {
|
|
6352
|
-
e.target.classList.add(
|
|
6365
|
+
e.target.classList.add(ki["panel-tab-dragging"]);
|
|
6353
6366
|
});
|
|
6354
6367
|
}, []), x = i((e) => {
|
|
6355
6368
|
e.preventDefault(), e.dataTransfer.dropEffect = "move", _(y(e.clientX));
|
|
@@ -6360,7 +6373,7 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6360
6373
|
}, [y, c]), C = i((e) => {
|
|
6361
6374
|
l.current?.contains(e.relatedTarget) || _(null);
|
|
6362
6375
|
}, []), w = i((e) => {
|
|
6363
|
-
e.target.classList.remove(
|
|
6376
|
+
e.target.classList.remove(ki["panel-tab-dragging"]), h.current = null, _(null);
|
|
6364
6377
|
}, []);
|
|
6365
6378
|
return o(() => {
|
|
6366
6379
|
let e = l.current;
|
|
@@ -6368,9 +6381,9 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6368
6381
|
let t = (e) => e.preventDefault();
|
|
6369
6382
|
return e.addEventListener("wheel", t, { passive: !1 }), () => e.removeEventListener("wheel", t);
|
|
6370
6383
|
}, []), /* @__PURE__ */ m("div", {
|
|
6371
|
-
className:
|
|
6384
|
+
className: ki["panel-tabs"],
|
|
6372
6385
|
children: [/* @__PURE__ */ m("div", {
|
|
6373
|
-
className:
|
|
6386
|
+
className: ki["panel-tabs-list"],
|
|
6374
6387
|
ref: l,
|
|
6375
6388
|
onWheel: v,
|
|
6376
6389
|
onDragOver: x,
|
|
@@ -6379,13 +6392,13 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6379
6392
|
children: [e.flatMap((e, i) => {
|
|
6380
6393
|
let o = e.type === "preview" && e.isTemp, s = e.id === t;
|
|
6381
6394
|
return [g === i ? /* @__PURE__ */ p("div", {
|
|
6382
|
-
className:
|
|
6395
|
+
className: ki["panel-tab-drop-indicator"],
|
|
6383
6396
|
"aria-hidden": !0
|
|
6384
6397
|
}, `drop-${i}`) : null, /* @__PURE__ */ m("div", {
|
|
6385
6398
|
ref: (e) => {
|
|
6386
6399
|
f.current[i] = e;
|
|
6387
6400
|
},
|
|
6388
|
-
className: F(
|
|
6401
|
+
className: F(ki, "panel-tab", s && "active", o && "temp"),
|
|
6389
6402
|
onClick: () => n(e.id),
|
|
6390
6403
|
onDoubleClick: (t) => {
|
|
6391
6404
|
t.preventDefault(), r(e.id);
|
|
@@ -6395,11 +6408,11 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6395
6408
|
onDragStart: (e) => b(e, i),
|
|
6396
6409
|
onDragEnd: w,
|
|
6397
6410
|
children: [/* @__PURE__ */ p("span", {
|
|
6398
|
-
className:
|
|
6399
|
-
children:
|
|
6411
|
+
className: ki["panel-tab-label"],
|
|
6412
|
+
children: Ai(e)
|
|
6400
6413
|
}), a && /* @__PURE__ */ p("button", {
|
|
6401
6414
|
type: "button",
|
|
6402
|
-
className:
|
|
6415
|
+
className: ki["panel-tab-close"],
|
|
6403
6416
|
onClick: (t) => {
|
|
6404
6417
|
t.stopPropagation(), a(e.id);
|
|
6405
6418
|
},
|
|
@@ -6408,32 +6421,32 @@ var Ei = r(function({ tabs: e, activeTabId: t, onSelectTab: n, onDoubleClickTab:
|
|
|
6408
6421
|
})]
|
|
6409
6422
|
}, e.id)];
|
|
6410
6423
|
}), g === e.length ? /* @__PURE__ */ p("div", {
|
|
6411
|
-
className:
|
|
6424
|
+
className: ki["panel-tab-drop-indicator"],
|
|
6412
6425
|
"aria-hidden": !0
|
|
6413
6426
|
}, "drop-end") : null]
|
|
6414
6427
|
}), /* @__PURE__ */ p("button", {
|
|
6415
6428
|
type: "button",
|
|
6416
|
-
className:
|
|
6429
|
+
className: ki["panel-tab-new"],
|
|
6417
6430
|
onClick: s,
|
|
6418
6431
|
"aria-label": "New tab",
|
|
6419
6432
|
title: "New tab",
|
|
6420
6433
|
children: "+"
|
|
6421
6434
|
})]
|
|
6422
6435
|
});
|
|
6423
|
-
}),
|
|
6424
|
-
function
|
|
6425
|
-
return `tab-${++
|
|
6436
|
+
}), Mi = 0;
|
|
6437
|
+
function Ni() {
|
|
6438
|
+
return `tab-${++Mi}`;
|
|
6426
6439
|
}
|
|
6427
|
-
function
|
|
6440
|
+
function Pi(e) {
|
|
6428
6441
|
return {
|
|
6429
|
-
id:
|
|
6442
|
+
id: Ni(),
|
|
6430
6443
|
type: "filelist",
|
|
6431
6444
|
path: e
|
|
6432
6445
|
};
|
|
6433
6446
|
}
|
|
6434
|
-
function
|
|
6447
|
+
function Fi(e, t, n, r) {
|
|
6435
6448
|
return {
|
|
6436
|
-
id:
|
|
6449
|
+
id: Ni(),
|
|
6437
6450
|
type: "preview",
|
|
6438
6451
|
path: e,
|
|
6439
6452
|
name: t,
|
|
@@ -6442,27 +6455,27 @@ function Ai(e, t, n, r) {
|
|
|
6442
6455
|
sourcePanel: r
|
|
6443
6456
|
};
|
|
6444
6457
|
}
|
|
6445
|
-
var
|
|
6446
|
-
let t = e(
|
|
6447
|
-
return e(
|
|
6448
|
-
}),
|
|
6449
|
-
let t = e(
|
|
6450
|
-
return e(
|
|
6458
|
+
var Ii = Pi(""), Li = Pi(""), Ri = _([Ii]), zi = _([Li]), Bi = _(Ii.id), Vi = _(Li.id), Hi = _((e) => e(Ri).findIndex((t) => t.id === e(Bi))), Ui = _((e) => e(zi).findIndex((t) => t.id === e(Vi))), Wi = _((e) => {
|
|
6459
|
+
let t = e(Bi);
|
|
6460
|
+
return e(Ri).find((e) => e.id === t) ?? null;
|
|
6461
|
+
}), Gi = _((e) => {
|
|
6462
|
+
let t = e(Vi);
|
|
6463
|
+
return e(zi).find((e) => e.id === t) ?? null;
|
|
6451
6464
|
});
|
|
6452
|
-
_((e) => e(We) === "left" ? e(
|
|
6465
|
+
_((e) => e(We) === "left" ? e(Ri) : e(zi)), _((e) => e(We) === "left" ? e(Bi) : e(Vi)), _((e) => e(We) === "left" ? e(Hi) : e(Ui)), _((e) => e(We) === "left" ? e(Wi) : e(Gi));
|
|
6453
6466
|
//#endregion
|
|
6454
6467
|
//#region lib/panelGroupHandlers.ts
|
|
6455
|
-
var
|
|
6456
|
-
function
|
|
6457
|
-
|
|
6468
|
+
var Ki = null;
|
|
6469
|
+
function qi(e) {
|
|
6470
|
+
Ki = e;
|
|
6458
6471
|
}
|
|
6459
|
-
function
|
|
6460
|
-
return
|
|
6472
|
+
function Ji() {
|
|
6473
|
+
return Ki;
|
|
6461
6474
|
}
|
|
6462
6475
|
//#endregion
|
|
6463
6476
|
//#region lib/components/PanelGroup.tsx
|
|
6464
|
-
function
|
|
6465
|
-
let f = y(We), h = b(We), g = f === e, [_, x] = v(e === "left" ?
|
|
6477
|
+
function Yi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey: r, requestedActiveName: a, requestedTopmostName: s, initialPanelState: c, onStateChange: d }) {
|
|
6478
|
+
let f = y(We), h = b(We), g = f === e, [_, x] = v(e === "left" ? Ri : zi), [S, C] = v(e === "left" ? Bi : Vi), w = y(e === "left" ? Hi : Ui), T = _[w], E = c?.tabs?.[w], D = y(Ge), O = l(() => D ? t.entries : t.entries.filter((e) => !e.meta.hidden), [D, t.entries]), k = u(t);
|
|
6466
6479
|
k.current = t;
|
|
6467
6480
|
let A = u(_);
|
|
6468
6481
|
A.current = _;
|
|
@@ -6480,7 +6493,7 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6480
6493
|
j.current === e && C(r[Math.min(n, r.length - 1)]?.id ?? ""), x(r);
|
|
6481
6494
|
return;
|
|
6482
6495
|
}
|
|
6483
|
-
let n = await ke().utils.getHomePath(), r =
|
|
6496
|
+
let n = await ke().utils.getHomePath(), r = Pi(n);
|
|
6484
6497
|
x([r]), C(r.id), k.current.navigateTo(n);
|
|
6485
6498
|
}, []), I = i((e, t) => {
|
|
6486
6499
|
x((n) => {
|
|
@@ -6488,24 +6501,24 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6488
6501
|
return r.splice(t, 0, i), r;
|
|
6489
6502
|
});
|
|
6490
6503
|
}, []), ee = i(() => {
|
|
6491
|
-
let e = k.current.currentPath, t =
|
|
6504
|
+
let e = k.current.currentPath, t = Pi(e);
|
|
6492
6505
|
x((e) => [...e, t]), C(t.id), k.current.navigateTo(e);
|
|
6493
6506
|
}, [x, C]);
|
|
6494
6507
|
return o(() => {
|
|
6495
|
-
if (g) return
|
|
6508
|
+
if (g) return qi({
|
|
6496
6509
|
newTab: ee,
|
|
6497
6510
|
closeActiveTab: () => P(j.current)
|
|
6498
|
-
}), () =>
|
|
6511
|
+
}), () => qi(null);
|
|
6499
6512
|
}, [
|
|
6500
6513
|
g,
|
|
6501
6514
|
ee,
|
|
6502
6515
|
P
|
|
6503
6516
|
]), /* @__PURE__ */ m("div", {
|
|
6504
|
-
className: F(
|
|
6517
|
+
className: F(ki, "panel", g && "active"),
|
|
6505
6518
|
onClick: () => h(e),
|
|
6506
6519
|
children: [
|
|
6507
|
-
t.navigating && /* @__PURE__ */ p("div", { className:
|
|
6508
|
-
/* @__PURE__ */ p(
|
|
6520
|
+
t.navigating && /* @__PURE__ */ p("div", { className: ki["panel-progress"] }),
|
|
6521
|
+
/* @__PURE__ */ p(ji, {
|
|
6509
6522
|
tabs: _,
|
|
6510
6523
|
activeTabId: S,
|
|
6511
6524
|
onSelectTab: M,
|
|
@@ -6515,8 +6528,8 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6515
6528
|
onReorderTabs: I
|
|
6516
6529
|
}),
|
|
6517
6530
|
/* @__PURE__ */ p("div", {
|
|
6518
|
-
className:
|
|
6519
|
-
children: T?.type === "filelist" ? /* @__PURE__ */ p(
|
|
6531
|
+
className: ki["panel-content"],
|
|
6532
|
+
children: T?.type === "filelist" ? /* @__PURE__ */ p(wi, {
|
|
6520
6533
|
currentPath: t.currentPath,
|
|
6521
6534
|
parentNode: t.parentNode,
|
|
6522
6535
|
entries: O,
|
|
@@ -6530,8 +6543,8 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6530
6543
|
}, T.id) : T?.type === "preview" ? (() => {
|
|
6531
6544
|
let e = T;
|
|
6532
6545
|
if (e.type !== "preview") return null;
|
|
6533
|
-
let t =
|
|
6534
|
-
return t ? /* @__PURE__ */ p(
|
|
6546
|
+
let t = ln.resolve(e.name);
|
|
6547
|
+
return t ? /* @__PURE__ */ p(kn, {
|
|
6535
6548
|
extensionDirPath: t.extensionDirPath,
|
|
6536
6549
|
entry: t.contribution.entry,
|
|
6537
6550
|
filePath: e.path,
|
|
@@ -6558,20 +6571,20 @@ function Q(e) {
|
|
|
6558
6571
|
let t = e.replace(/\\/g, "/"), n = t.match(/^\/([A-Za-z]:(?:\/.*)?)/);
|
|
6559
6572
|
return W(n ? n[1] : t);
|
|
6560
6573
|
}
|
|
6561
|
-
function
|
|
6574
|
+
function Xi(e, t) {
|
|
6562
6575
|
switch (t) {
|
|
6563
6576
|
case "posix": return "'" + e.replace(/'/g, "'\\''") + "'";
|
|
6564
6577
|
case "powershell": return "'" + e.replace(/'/g, "''") + "'";
|
|
6565
6578
|
case "cmd": return "\"" + e.replace(/"/g, "\"\"") + "\"";
|
|
6566
6579
|
}
|
|
6567
6580
|
}
|
|
6568
|
-
function
|
|
6569
|
-
let n =
|
|
6581
|
+
function Zi(e, t) {
|
|
6582
|
+
let n = Xi(Q(e), t.cwdEscape);
|
|
6570
6583
|
return t.hiddenCdTemplate.replace(/\{\{cwd\}\}/g, n) + (t.lineEnding ?? "\n");
|
|
6571
6584
|
}
|
|
6572
6585
|
//#endregion
|
|
6573
6586
|
//#region lib/terminal/TerminalView.tsx
|
|
6574
|
-
function
|
|
6587
|
+
function Qi() {
|
|
6575
6588
|
return {
|
|
6576
6589
|
background: "#11131a",
|
|
6577
6590
|
foreground: "#d7dae0",
|
|
@@ -6579,7 +6592,7 @@ function qi() {
|
|
|
6579
6592
|
selectionBackground: "rgba(128, 146, 255, 0.28)"
|
|
6580
6593
|
};
|
|
6581
6594
|
}
|
|
6582
|
-
function
|
|
6595
|
+
function $i({ session: e, expanded: t = !1, focusRequestKey: n = 0 }) {
|
|
6583
6596
|
let r = u(null), i = u(null), a = u(null), s = u(null), c = u(!1), l = u(!1), d = u(t);
|
|
6584
6597
|
d.current = t;
|
|
6585
6598
|
let f = u({
|
|
@@ -6602,7 +6615,7 @@ function Ji({ session: e, expanded: t = !1, focusRequestKey: n = 0 }) {
|
|
|
6602
6615
|
scrollback: 1e3,
|
|
6603
6616
|
cursorStyle: "bar",
|
|
6604
6617
|
cursorInactiveStyle: "none",
|
|
6605
|
-
theme:
|
|
6618
|
+
theme: Qi()
|
|
6606
6619
|
}), u = () => {
|
|
6607
6620
|
i.current !== null && cancelAnimationFrame(i.current), i.current = requestAnimationFrame(() => {
|
|
6608
6621
|
i.current = null;
|
|
@@ -6683,7 +6696,7 @@ function Ji({ session: e, expanded: t = !1, focusRequestKey: n = 0 }) {
|
|
|
6683
6696
|
}
|
|
6684
6697
|
//#endregion
|
|
6685
6698
|
//#region lib/terminal/terminalAtoms.ts
|
|
6686
|
-
var
|
|
6699
|
+
var ea = _([]), ta = _(null), na = class e {
|
|
6687
6700
|
static replayLimit = 64 * 1024;
|
|
6688
6701
|
listeners = /* @__PURE__ */ new Set();
|
|
6689
6702
|
decoder = new TextDecoder();
|
|
@@ -6802,7 +6815,7 @@ var Yi = _([]), Xi = _(null), Zi = class e {
|
|
|
6802
6815
|
this.pendingCwdSync = t;
|
|
6803
6816
|
return;
|
|
6804
6817
|
}
|
|
6805
|
-
this.pendingCwdSync = null, await this.writeHidden(
|
|
6818
|
+
this.pendingCwdSync = null, await this.writeHidden(Zi(t, this.profile));
|
|
6806
6819
|
}
|
|
6807
6820
|
}
|
|
6808
6821
|
async refreshPrompt() {
|
|
@@ -6893,39 +6906,39 @@ var Yi = _([]), Xi = _(null), Zi = class e {
|
|
|
6893
6906
|
}
|
|
6894
6907
|
flushPendingCwdSync() {
|
|
6895
6908
|
let e = this.pendingCwdSync;
|
|
6896
|
-
e && (this.ptyId === null || this.capabilities.commandRunning || this.inputBuffer.length > 0 && A.is("terminal") || (this.pendingCwdSync = null, this.writeHidden(
|
|
6909
|
+
e && (this.ptyId === null || this.capabilities.commandRunning || this.inputBuffer.length > 0 && A.is("terminal") || (this.pendingCwdSync = null, this.writeHidden(Zi(e, this.profile))));
|
|
6897
6910
|
}
|
|
6898
|
-
},
|
|
6899
|
-
function
|
|
6911
|
+
}, ra = "dotdir.terminalSessions";
|
|
6912
|
+
function ia() {
|
|
6900
6913
|
try {
|
|
6901
|
-
let e = window.localStorage.getItem(
|
|
6914
|
+
let e = window.localStorage.getItem(ra);
|
|
6902
6915
|
return e ? JSON.parse(e) : null;
|
|
6903
6916
|
} catch {
|
|
6904
6917
|
return null;
|
|
6905
6918
|
}
|
|
6906
6919
|
}
|
|
6907
|
-
function
|
|
6920
|
+
function aa(e, t) {
|
|
6908
6921
|
try {
|
|
6909
6922
|
let n = {
|
|
6910
6923
|
activeSessionId: t,
|
|
6911
6924
|
sessions: e.map((e) => ({ profileId: e.profileId }))
|
|
6912
6925
|
};
|
|
6913
|
-
window.localStorage.setItem(
|
|
6926
|
+
window.localStorage.setItem(ra, JSON.stringify(n));
|
|
6914
6927
|
} catch {}
|
|
6915
6928
|
}
|
|
6916
|
-
function
|
|
6929
|
+
function oa() {
|
|
6917
6930
|
return `term-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
6918
6931
|
}
|
|
6919
|
-
var
|
|
6920
|
-
function
|
|
6921
|
-
let e = ke(), t = y(
|
|
6932
|
+
var sa = [], ca = "";
|
|
6933
|
+
function la() {
|
|
6934
|
+
let e = ke(), t = y(ea), n = b(ea), r = y(ta), a = b(ta), o = u(t);
|
|
6922
6935
|
o.current = t;
|
|
6923
6936
|
let s = u(r);
|
|
6924
6937
|
s.current = r;
|
|
6925
6938
|
let c = t.find((e) => e.id === r) ?? null, l = i((e, t) => {
|
|
6926
|
-
|
|
6927
|
-
}, [n, a]), d = i((t, r, i =
|
|
6928
|
-
let a = new
|
|
6939
|
+
aa(e, t), n(e), a(t);
|
|
6940
|
+
}, [n, a]), d = i((t, r, i = oa()) => {
|
|
6941
|
+
let a = new na(e, r, t), o = {
|
|
6929
6942
|
id: i,
|
|
6930
6943
|
session: a,
|
|
6931
6944
|
profile: t,
|
|
@@ -6960,7 +6973,7 @@ function ia() {
|
|
|
6960
6973
|
activeSessionId: r,
|
|
6961
6974
|
activeSession: c,
|
|
6962
6975
|
setProfiles: i((e, t) => {
|
|
6963
|
-
|
|
6976
|
+
sa = e, ca = t;
|
|
6964
6977
|
let r = o.current;
|
|
6965
6978
|
if (r.length > 0) {
|
|
6966
6979
|
n(r.map((t) => {
|
|
@@ -6974,7 +6987,7 @@ function ia() {
|
|
|
6974
6987
|
}));
|
|
6975
6988
|
return;
|
|
6976
6989
|
}
|
|
6977
|
-
let i =
|
|
6990
|
+
let i = ia(), a = (i?.sessions.map((e) => e.profileId) ?? []).map((t) => e.find((e) => e.id === t)).filter((e) => e != null), s = a.length > 0 ? a : e[0] ? [e[0]] : [], c = [];
|
|
6978
6991
|
for (let e of s) c.push(d(e, t));
|
|
6979
6992
|
l(c, i?.activeSessionId && c.some((e) => e.id === i.activeSessionId) ? i.activeSessionId : c[0]?.id ?? null);
|
|
6980
6993
|
}, [
|
|
@@ -6983,12 +6996,12 @@ function ia() {
|
|
|
6983
6996
|
l
|
|
6984
6997
|
]),
|
|
6985
6998
|
setCurrentCwd: i((e) => {
|
|
6986
|
-
|
|
6999
|
+
ca = Q(e);
|
|
6987
7000
|
}, []),
|
|
6988
7001
|
createSession: i((e) => {
|
|
6989
|
-
let t =
|
|
7002
|
+
let t = sa.find((t) => t.id === e) ?? sa[0];
|
|
6990
7003
|
if (!t) return;
|
|
6991
|
-
let n = d(t,
|
|
7004
|
+
let n = d(t, ca);
|
|
6992
7005
|
l([...o.current, n], n.id);
|
|
6993
7006
|
}, [d, l]),
|
|
6994
7007
|
activate: i((e) => {
|
|
@@ -7005,13 +7018,13 @@ function ia() {
|
|
|
7005
7018
|
l(r, s.current === e ? r[r.length - 1]?.id ?? null : s.current);
|
|
7006
7019
|
}, [l]),
|
|
7007
7020
|
switchActiveProfile: i((e) => {
|
|
7008
|
-
let t = o.current, n = t.find((e) => e.id === s.current), r =
|
|
7021
|
+
let t = o.current, n = t.find((e) => e.id === s.current), r = sa.find((t) => t.id === e) ?? sa[0];
|
|
7009
7022
|
if (!n || !r || n.profileId === r.id) return;
|
|
7010
|
-
let i = d(r, n.cwd ||
|
|
7023
|
+
let i = d(r, n.cwd || ca);
|
|
7011
7024
|
n.session.dispose(), l(t.map((e) => e.id === n.id ? i : e), i.id);
|
|
7012
7025
|
}, [d, l]),
|
|
7013
7026
|
restartAll: i(() => {
|
|
7014
|
-
let e = o.current, t = e.map((e) => d(
|
|
7027
|
+
let e = o.current, t = e.map((e) => d(sa.find((t) => t.id === e.profileId) ?? e.profile, e.cwd || ca, e.id));
|
|
7015
7028
|
for (let t of e) t.session.dispose();
|
|
7016
7029
|
l(t, s.current);
|
|
7017
7030
|
}, [d, l]),
|
|
@@ -7026,7 +7039,7 @@ function ia() {
|
|
|
7026
7039
|
let n = o.current.find((e) => e.id === s.current);
|
|
7027
7040
|
if (!n) return;
|
|
7028
7041
|
let r = Q(t);
|
|
7029
|
-
await n.session.writeHidden(
|
|
7042
|
+
await n.session.writeHidden(Zi(r, n.profile));
|
|
7030
7043
|
let i = n.profile.lineEnding === "\r\n" ? "\r\n" : "\n";
|
|
7031
7044
|
await n.session.write(e + i);
|
|
7032
7045
|
}, []),
|
|
@@ -7038,8 +7051,8 @@ function ia() {
|
|
|
7038
7051
|
}
|
|
7039
7052
|
//#endregion
|
|
7040
7053
|
//#region lib/components/Terminal.tsx
|
|
7041
|
-
function
|
|
7042
|
-
let e = y(Re), t = y(ze), { sessions: n, activeSessionId: r, activeSession: i, activate: a, createSession: o, closeSession: s, switchActiveProfile: c } =
|
|
7054
|
+
function ua() {
|
|
7055
|
+
let e = y(Re), t = y(ze), { sessions: n, activeSessionId: r, activeSession: i, activate: a, createSession: o, closeSession: s, switchActiveProfile: c } = la(), l = i?.profileId ?? null, u = i ? e.find((e) => e.id === i.profileId)?.shell ?? null : null, d = i?.error ?? null;
|
|
7043
7056
|
return /* @__PURE__ */ m("div", {
|
|
7044
7057
|
className: U["terminal-toolbar"],
|
|
7045
7058
|
children: [
|
|
@@ -7096,13 +7109,13 @@ function aa() {
|
|
|
7096
7109
|
]
|
|
7097
7110
|
});
|
|
7098
7111
|
}
|
|
7099
|
-
function
|
|
7100
|
-
let { activeSession: e } =
|
|
7112
|
+
function da() {
|
|
7113
|
+
let { activeSession: e } = la(), t = y(Ve), n = y(He);
|
|
7101
7114
|
return /* @__PURE__ */ p("div", {
|
|
7102
7115
|
className: U["terminal-panel"],
|
|
7103
7116
|
children: /* @__PURE__ */ p("div", {
|
|
7104
7117
|
className: U["terminal-body"],
|
|
7105
|
-
children: e ? /* @__PURE__ */ p(
|
|
7118
|
+
children: e ? /* @__PURE__ */ p($i, {
|
|
7106
7119
|
session: e.session,
|
|
7107
7120
|
expanded: !t,
|
|
7108
7121
|
focusRequestKey: n
|
|
@@ -7115,22 +7128,22 @@ function oa() {
|
|
|
7115
7128
|
}
|
|
7116
7129
|
//#endregion
|
|
7117
7130
|
//#region lib/entities/panel/model/panelSide.ts
|
|
7118
|
-
var
|
|
7131
|
+
var fa = {
|
|
7119
7132
|
left: "right",
|
|
7120
7133
|
right: "left"
|
|
7121
|
-
},
|
|
7134
|
+
}, pa = {
|
|
7122
7135
|
left: "leftPanel",
|
|
7123
7136
|
right: "rightPanel"
|
|
7124
|
-
},
|
|
7137
|
+
}, ma = ["left", "right"];
|
|
7125
7138
|
//#endregion
|
|
7126
7139
|
//#region lib/terminal/shellProfiles.ts
|
|
7127
|
-
function
|
|
7140
|
+
function ha(e, t) {
|
|
7128
7141
|
return e ? e.some((e) => e === t || e === "darwin" && t === "macos" || e === "unix" && (t === "macos" || t === "linux")) : !0;
|
|
7129
7142
|
}
|
|
7130
|
-
function
|
|
7143
|
+
function ga(e, t) {
|
|
7131
7144
|
return e.replace(/\$([A-Za-z_][A-Za-z0-9_]*)/g, (e, n) => t[n] ?? "");
|
|
7132
7145
|
}
|
|
7133
|
-
function
|
|
7146
|
+
function _a(e) {
|
|
7134
7147
|
let t = e.toLowerCase();
|
|
7135
7148
|
return t === "cmd" ? {
|
|
7136
7149
|
hiddenCdTemplate: "@cd /d {{cwd}}",
|
|
@@ -7149,8 +7162,8 @@ function fa(e) {
|
|
|
7149
7162
|
spawnArgs: []
|
|
7150
7163
|
};
|
|
7151
7164
|
}
|
|
7152
|
-
function
|
|
7153
|
-
let r =
|
|
7165
|
+
function va(e, t, n) {
|
|
7166
|
+
let r = _a(n.shell);
|
|
7154
7167
|
return {
|
|
7155
7168
|
id: e,
|
|
7156
7169
|
label: t,
|
|
@@ -7161,23 +7174,23 @@ function pa(e, t, n) {
|
|
|
7161
7174
|
spawnArgs: n.spawnArgs ?? r.spawnArgs
|
|
7162
7175
|
};
|
|
7163
7176
|
}
|
|
7164
|
-
async function
|
|
7177
|
+
async function ya(e, t, n) {
|
|
7165
7178
|
let r = n.__platform__ ?? "", i = n.SHELL ?? "", a = [], o = {}, s = /* @__PURE__ */ new Set(), c = [];
|
|
7166
|
-
for (let e of t) for (let t of e.shellIntegrations ?? [])
|
|
7179
|
+
for (let e of t) for (let t of e.shellIntegrations ?? []) ha(t.platforms, r) && c.push(t);
|
|
7167
7180
|
if (i && r !== "windows") {
|
|
7168
7181
|
let t = i.split("/").pop() ?? "", n = c.find((e) => e.shell === t);
|
|
7169
7182
|
if (n && !s.has(i)) try {
|
|
7170
|
-
await e.fs.exists(i) && (s.add(i), a.push(
|
|
7183
|
+
await e.fs.exists(i) && (s.add(i), a.push(va(i, n.label, n)), o[i] = {
|
|
7171
7184
|
script: n.script,
|
|
7172
7185
|
scriptArg: n.scriptArg ?? !1
|
|
7173
7186
|
});
|
|
7174
7187
|
} catch {}
|
|
7175
7188
|
}
|
|
7176
7189
|
for (let t of c) for (let r of t.executableCandidates) {
|
|
7177
|
-
let i =
|
|
7190
|
+
let i = ga(r, n);
|
|
7178
7191
|
if (!(!i || s.has(i))) try {
|
|
7179
7192
|
if (await e.fs.exists(i)) {
|
|
7180
|
-
s.add(i), a.push(
|
|
7193
|
+
s.add(i), a.push(va(i, t.label, t)), o[i] = {
|
|
7181
7194
|
script: t.script,
|
|
7182
7195
|
scriptArg: t.scriptArg ?? !1
|
|
7183
7196
|
};
|
|
@@ -7192,8 +7205,8 @@ async function ma(e, t, n) {
|
|
|
7192
7205
|
}
|
|
7193
7206
|
//#endregion
|
|
7194
7207
|
//#region lib/features/extensions/useExtensionHost.ts
|
|
7195
|
-
function
|
|
7196
|
-
let n = ke(), r =
|
|
7208
|
+
function ba({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
7209
|
+
let n = ke(), r = In(), a = y(Pe), s = y(Fe), c = y(Be), l = b(Ie), d = b(Le), f = b(Re), p = b(ze), { setIconTheme: m } = Wr(), { setIconThemeKind: h } = Gr(), g = u(a);
|
|
7197
7210
|
g.current = a;
|
|
7198
7211
|
let _ = u(s);
|
|
7199
7212
|
_.current = s;
|
|
@@ -7201,7 +7214,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7201
7214
|
v.current = t;
|
|
7202
7215
|
let x = u([]), S = u([]), C = u(!1);
|
|
7203
7216
|
o(() => {
|
|
7204
|
-
let e = s ?
|
|
7217
|
+
let e = s ? $n(x.current, s) : null, t = e ? wn(e.theme.uiTheme) : c === "light" || c === "high-contrast-light" ? "light" : "dark";
|
|
7205
7218
|
Wt().dataset.theme = t, h(t);
|
|
7206
7219
|
}, [c, s]);
|
|
7207
7220
|
let w = i(async (e, t) => {
|
|
@@ -7214,7 +7227,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7214
7227
|
o(() => {
|
|
7215
7228
|
C.current && (async () => {
|
|
7216
7229
|
let e = x.current;
|
|
7217
|
-
if (await w(e, a),
|
|
7230
|
+
if (await w(e, a), ri(e, a), !a) m("fss");
|
|
7218
7231
|
else {
|
|
7219
7232
|
let t = e.find((e) => `${e.ref.publisher}.${e.ref.name}` === a);
|
|
7220
7233
|
t?.vscodeIconThemePath ? m("vscode", t.vscodeIconThemePath) : t?.iconThemeFssPath ? m("fss") : m("none");
|
|
@@ -7222,10 +7235,10 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7222
7235
|
v.current();
|
|
7223
7236
|
})();
|
|
7224
7237
|
}, [a, w]), o(() => {
|
|
7225
|
-
if (C.current) if (!s)
|
|
7238
|
+
if (C.current) if (!s) Cn();
|
|
7226
7239
|
else {
|
|
7227
|
-
let e =
|
|
7228
|
-
e &&
|
|
7240
|
+
let e = $n(x.current, s);
|
|
7241
|
+
e && Tn(n, e.theme.jsonPath, e.theme.uiTheme).catch(() => Cn());
|
|
7229
7242
|
}
|
|
7230
7243
|
}, [s]), o(() => {
|
|
7231
7244
|
if (!e) return;
|
|
@@ -7243,19 +7256,19 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7243
7256
|
n?.vscodeIconThemePath ? await m("vscode", n.vscodeIconThemePath) : n?.iconThemeFssPath ? await m("fss") : await m("none");
|
|
7244
7257
|
}, a = async (e, t) => {
|
|
7245
7258
|
if (!t) {
|
|
7246
|
-
|
|
7259
|
+
Cn();
|
|
7247
7260
|
return;
|
|
7248
7261
|
}
|
|
7249
|
-
let r =
|
|
7262
|
+
let r = $n(e, t);
|
|
7250
7263
|
if (r) {
|
|
7251
|
-
let e =
|
|
7264
|
+
let e = wn(r.theme.uiTheme);
|
|
7252
7265
|
Wt().dataset.theme = e, h(e);
|
|
7253
7266
|
try {
|
|
7254
|
-
await
|
|
7267
|
+
await Tn(n, r.theme.jsonPath, r.theme.uiTheme);
|
|
7255
7268
|
} catch (e) {
|
|
7256
|
-
console.warn("[ExtHost] Failed to load color theme:", t, e),
|
|
7269
|
+
console.warn("[ExtHost] Failed to load color theme:", t, e), Cn();
|
|
7257
7270
|
}
|
|
7258
|
-
} else
|
|
7271
|
+
} else Cn();
|
|
7259
7272
|
}, o = (e) => {
|
|
7260
7273
|
for (let e of S.current) try {
|
|
7261
7274
|
e();
|
|
@@ -7276,17 +7289,17 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7276
7289
|
}
|
|
7277
7290
|
}, s = r.onLoaded((e) => {
|
|
7278
7291
|
(async () => {
|
|
7279
|
-
if (x.current = e, l(e),
|
|
7292
|
+
if (x.current = e, l(e), fn(e), zt(), n.fsProvider) {
|
|
7280
7293
|
for (let t of e) for (let e of t.fsProviders ?? []) if (e.runtime === "backend") {
|
|
7281
7294
|
let r = K(t.dirPath, e.entry);
|
|
7282
7295
|
n.fsProvider.load(r).catch(() => {});
|
|
7283
7296
|
}
|
|
7284
7297
|
}
|
|
7285
|
-
n.utils.getEnv().then((t) =>
|
|
7298
|
+
n.utils.getEnv().then((t) => ya(n, e, t).then(({ profiles: e, shellScripts: t }) => {
|
|
7286
7299
|
f(e), p(!0), n.pty.setShellIntegrations && Object.keys(t).length > 0 && n.pty.setShellIntegrations(t).catch(() => {});
|
|
7287
7300
|
})).catch(() => {
|
|
7288
7301
|
p(!0);
|
|
7289
|
-
}), await w(e, g.current),
|
|
7302
|
+
}), await w(e, g.current), ri(e, g.current), t(e), o(e), Promise.all([i(e, g.current), a(e, _.current)]).then(() => {
|
|
7290
7303
|
d(!0), C.current = !0, v.current();
|
|
7291
7304
|
});
|
|
7292
7305
|
})();
|
|
@@ -7309,7 +7322,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7309
7322
|
}
|
|
7310
7323
|
//#endregion
|
|
7311
7324
|
//#region lib/features/file-ops/model/useFileOperations.ts
|
|
7312
|
-
async function
|
|
7325
|
+
async function xa(e, t, n) {
|
|
7313
7326
|
let r = await e(t);
|
|
7314
7327
|
if (r.length === 0) return [{
|
|
7315
7328
|
innerPath: t,
|
|
@@ -7318,11 +7331,11 @@ async function ga(e, t, n) {
|
|
|
7318
7331
|
let i = [];
|
|
7319
7332
|
for (let a of r) {
|
|
7320
7333
|
let r = t === "/" ? `/${a.name}` : `${t}/${a.name}`, o = `${n}/${a.name}`;
|
|
7321
|
-
i.push(...await
|
|
7334
|
+
i.push(...await xa(e, r, o));
|
|
7322
7335
|
}
|
|
7323
7336
|
return i;
|
|
7324
7337
|
}
|
|
7325
|
-
function
|
|
7338
|
+
function Sa(e, t, n, r) {
|
|
7326
7339
|
let { showDialog: a, closeDialog: s, updateDialog: c } = De(), l = ke(), d = u(null), f = u(null), p = u(null), m = u(null), h = u(null), g = u(null), _ = i(() => {
|
|
7327
7340
|
r((e) => e + 1), t.current.navigateTo(t.current.currentPath), n.current.navigateTo(n.current.currentPath);
|
|
7328
7341
|
}, [
|
|
@@ -7415,10 +7428,10 @@ function _a(e, t, n, r) {
|
|
|
7415
7428
|
f.current = e, a(e);
|
|
7416
7429
|
let n = [];
|
|
7417
7430
|
for (let e of r) {
|
|
7418
|
-
let { containerFile: t, innerPath: r } = Kt(e), i =
|
|
7431
|
+
let { containerFile: t, innerPath: r } = Kt(e), i = dn.resolve(q(t));
|
|
7419
7432
|
if (!i) throw Error(`No fsProvider registered for "${q(t)}"`);
|
|
7420
7433
|
let a = null, o = null;
|
|
7421
|
-
i.contribution.runtime === "backend" && l.fsProvider ? a = K(i.extensionDirPath, i.contribution.entry) : o = await Rt(l, i.extensionDirPath, i.contribution.entry), (await
|
|
7434
|
+
i.contribution.runtime === "backend" && l.fsProvider ? a = K(i.extensionDirPath, i.contribution.entry) : o = await Rt(l, i.extensionDirPath, i.contribution.entry), (await xa(async (e) => a ? l.fsProvider.listEntries(a, t, e) : (await o.listEntries(t, e)).map((e) => ({
|
|
7422
7435
|
name: e.name,
|
|
7423
7436
|
kind: e.type
|
|
7424
7437
|
})), r, q(r))).forEach((e) => n.push({
|
|
@@ -7695,7 +7708,7 @@ function _a(e, t, n, r) {
|
|
|
7695
7708
|
}
|
|
7696
7709
|
//#endregion
|
|
7697
7710
|
//#region lib/features/navigation/lib/commandLineCd.ts
|
|
7698
|
-
function
|
|
7711
|
+
function Ca(e) {
|
|
7699
7712
|
let t = e.trim();
|
|
7700
7713
|
if (!t) return null;
|
|
7701
7714
|
if (/^cd::/i.test(t)) {
|
|
@@ -7729,7 +7742,7 @@ function va(e) {
|
|
|
7729
7742
|
}
|
|
7730
7743
|
return null;
|
|
7731
7744
|
}
|
|
7732
|
-
async function
|
|
7745
|
+
async function wa(e, t, n) {
|
|
7733
7746
|
let r = t.trim();
|
|
7734
7747
|
if (!r) return Q(await e.utils.getHomePath());
|
|
7735
7748
|
let i = r;
|
|
@@ -7741,7 +7754,7 @@ async function ya(e, t, n) {
|
|
|
7741
7754
|
}
|
|
7742
7755
|
return Q(Tt(W(i.startsWith("/") || i.startsWith("//") || /^[A-Za-z]:\//.test(i) || /^[A-Za-z]:$/i.test(i) ? i : K(n, i))));
|
|
7743
7756
|
}
|
|
7744
|
-
async function
|
|
7757
|
+
async function Ta(e, t) {
|
|
7745
7758
|
if (!await e.fs.exists(t)) return !1;
|
|
7746
7759
|
try {
|
|
7747
7760
|
return await e.fs.entries(t), !0;
|
|
@@ -7751,12 +7764,12 @@ async function ba(e, t) {
|
|
|
7751
7764
|
}
|
|
7752
7765
|
//#endregion
|
|
7753
7766
|
//#region ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/external/tslib/tslib.es6.js
|
|
7754
|
-
function
|
|
7767
|
+
function Ea(e, t, n, r) {
|
|
7755
7768
|
if (n === "a" && !r) throw TypeError("Private accessor was defined without a getter");
|
|
7756
7769
|
if (typeof t == "function" ? e !== t || !r : !t.has(e)) throw TypeError("Cannot read private member from an object whose class did not declare it");
|
|
7757
7770
|
return n === "m" ? r : n === "a" ? r.call(e) : r ? r.value : t.get(e);
|
|
7758
7771
|
}
|
|
7759
|
-
function
|
|
7772
|
+
function Da(e, t, n, r, i) {
|
|
7760
7773
|
if (r === "m") throw TypeError("Private method is not writable");
|
|
7761
7774
|
if (r === "a" && !i) throw TypeError("Private accessor was defined without a setter");
|
|
7762
7775
|
if (typeof t == "function" ? e !== t || !i : !t.has(e)) throw TypeError("Cannot write private member to an object whose class did not declare it");
|
|
@@ -7764,164 +7777,164 @@ function Sa(e, t, n, r, i) {
|
|
|
7764
7777
|
}
|
|
7765
7778
|
//#endregion
|
|
7766
7779
|
//#region ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/core.js
|
|
7767
|
-
var
|
|
7768
|
-
function
|
|
7780
|
+
var Oa, ka = "__TAURI_TO_IPC_KEY__";
|
|
7781
|
+
function Aa(e, t = !1) {
|
|
7769
7782
|
return window.__TAURI_INTERNALS__.transformCallback(e, t);
|
|
7770
7783
|
}
|
|
7771
7784
|
async function $(e, t = {}, n) {
|
|
7772
7785
|
return window.__TAURI_INTERNALS__.invoke(e, t, n);
|
|
7773
7786
|
}
|
|
7774
|
-
var
|
|
7787
|
+
var ja = class {
|
|
7775
7788
|
get rid() {
|
|
7776
|
-
return
|
|
7789
|
+
return Ea(this, Oa, "f");
|
|
7777
7790
|
}
|
|
7778
7791
|
constructor(e) {
|
|
7779
|
-
|
|
7792
|
+
Oa.set(this, void 0), Da(this, Oa, e, "f");
|
|
7780
7793
|
}
|
|
7781
7794
|
async close() {
|
|
7782
7795
|
return $("plugin:resources|close", { rid: this.rid });
|
|
7783
7796
|
}
|
|
7784
7797
|
};
|
|
7785
|
-
|
|
7786
|
-
function
|
|
7798
|
+
Oa = /* @__PURE__ */ new WeakMap();
|
|
7799
|
+
function Ma() {
|
|
7787
7800
|
return !!(globalThis || window).isTauri;
|
|
7788
7801
|
}
|
|
7789
7802
|
//#endregion
|
|
7790
7803
|
//#region ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/dpi.js
|
|
7791
|
-
var
|
|
7804
|
+
var Na = class {
|
|
7792
7805
|
constructor(...e) {
|
|
7793
7806
|
this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.width = e[0].Logical.width, this.height = e[0].Logical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
|
|
7794
7807
|
}
|
|
7795
7808
|
toPhysical(e) {
|
|
7796
|
-
return new
|
|
7809
|
+
return new Pa(this.width * e, this.height * e);
|
|
7797
7810
|
}
|
|
7798
|
-
[
|
|
7811
|
+
[ka]() {
|
|
7799
7812
|
return {
|
|
7800
7813
|
width: this.width,
|
|
7801
7814
|
height: this.height
|
|
7802
7815
|
};
|
|
7803
7816
|
}
|
|
7804
7817
|
toJSON() {
|
|
7805
|
-
return this[
|
|
7818
|
+
return this[ka]();
|
|
7806
7819
|
}
|
|
7807
|
-
},
|
|
7820
|
+
}, Pa = class {
|
|
7808
7821
|
constructor(...e) {
|
|
7809
7822
|
this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.width = e[0].Physical.width, this.height = e[0].Physical.height) : (this.width = e[0].width, this.height = e[0].height) : (this.width = e[0], this.height = e[1]);
|
|
7810
7823
|
}
|
|
7811
7824
|
toLogical(e) {
|
|
7812
|
-
return new
|
|
7825
|
+
return new Na(this.width / e, this.height / e);
|
|
7813
7826
|
}
|
|
7814
|
-
[
|
|
7827
|
+
[ka]() {
|
|
7815
7828
|
return {
|
|
7816
7829
|
width: this.width,
|
|
7817
7830
|
height: this.height
|
|
7818
7831
|
};
|
|
7819
7832
|
}
|
|
7820
7833
|
toJSON() {
|
|
7821
|
-
return this[
|
|
7834
|
+
return this[ka]();
|
|
7822
7835
|
}
|
|
7823
|
-
},
|
|
7836
|
+
}, Fa = class {
|
|
7824
7837
|
constructor(e) {
|
|
7825
7838
|
this.size = e;
|
|
7826
7839
|
}
|
|
7827
7840
|
toLogical(e) {
|
|
7828
|
-
return this.size instanceof
|
|
7841
|
+
return this.size instanceof Na ? this.size : this.size.toLogical(e);
|
|
7829
7842
|
}
|
|
7830
7843
|
toPhysical(e) {
|
|
7831
|
-
return this.size instanceof
|
|
7844
|
+
return this.size instanceof Pa ? this.size : this.size.toPhysical(e);
|
|
7832
7845
|
}
|
|
7833
|
-
[
|
|
7846
|
+
[ka]() {
|
|
7834
7847
|
return { [`${this.size.type}`]: {
|
|
7835
7848
|
width: this.size.width,
|
|
7836
7849
|
height: this.size.height
|
|
7837
7850
|
} };
|
|
7838
7851
|
}
|
|
7839
7852
|
toJSON() {
|
|
7840
|
-
return this[
|
|
7853
|
+
return this[ka]();
|
|
7841
7854
|
}
|
|
7842
|
-
},
|
|
7855
|
+
}, Ia = class {
|
|
7843
7856
|
constructor(...e) {
|
|
7844
7857
|
this.type = "Logical", e.length === 1 ? "Logical" in e[0] ? (this.x = e[0].Logical.x, this.y = e[0].Logical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
|
|
7845
7858
|
}
|
|
7846
7859
|
toPhysical(e) {
|
|
7847
|
-
return new
|
|
7860
|
+
return new La(this.x * e, this.y * e);
|
|
7848
7861
|
}
|
|
7849
|
-
[
|
|
7862
|
+
[ka]() {
|
|
7850
7863
|
return {
|
|
7851
7864
|
x: this.x,
|
|
7852
7865
|
y: this.y
|
|
7853
7866
|
};
|
|
7854
7867
|
}
|
|
7855
7868
|
toJSON() {
|
|
7856
|
-
return this[
|
|
7869
|
+
return this[ka]();
|
|
7857
7870
|
}
|
|
7858
|
-
},
|
|
7871
|
+
}, La = class {
|
|
7859
7872
|
constructor(...e) {
|
|
7860
7873
|
this.type = "Physical", e.length === 1 ? "Physical" in e[0] ? (this.x = e[0].Physical.x, this.y = e[0].Physical.y) : (this.x = e[0].x, this.y = e[0].y) : (this.x = e[0], this.y = e[1]);
|
|
7861
7874
|
}
|
|
7862
7875
|
toLogical(e) {
|
|
7863
|
-
return new
|
|
7876
|
+
return new Ia(this.x / e, this.y / e);
|
|
7864
7877
|
}
|
|
7865
|
-
[
|
|
7878
|
+
[ka]() {
|
|
7866
7879
|
return {
|
|
7867
7880
|
x: this.x,
|
|
7868
7881
|
y: this.y
|
|
7869
7882
|
};
|
|
7870
7883
|
}
|
|
7871
7884
|
toJSON() {
|
|
7872
|
-
return this[
|
|
7885
|
+
return this[ka]();
|
|
7873
7886
|
}
|
|
7874
|
-
},
|
|
7887
|
+
}, Ra = class {
|
|
7875
7888
|
constructor(e) {
|
|
7876
7889
|
this.position = e;
|
|
7877
7890
|
}
|
|
7878
7891
|
toLogical(e) {
|
|
7879
|
-
return this.position instanceof
|
|
7892
|
+
return this.position instanceof Ia ? this.position : this.position.toLogical(e);
|
|
7880
7893
|
}
|
|
7881
7894
|
toPhysical(e) {
|
|
7882
|
-
return this.position instanceof
|
|
7895
|
+
return this.position instanceof La ? this.position : this.position.toPhysical(e);
|
|
7883
7896
|
}
|
|
7884
|
-
[
|
|
7897
|
+
[ka]() {
|
|
7885
7898
|
return { [`${this.position.type}`]: {
|
|
7886
7899
|
x: this.position.x,
|
|
7887
7900
|
y: this.position.y
|
|
7888
7901
|
} };
|
|
7889
7902
|
}
|
|
7890
7903
|
toJSON() {
|
|
7891
|
-
return this[
|
|
7904
|
+
return this[ka]();
|
|
7892
7905
|
}
|
|
7893
|
-
},
|
|
7906
|
+
}, za;
|
|
7894
7907
|
(function(e) {
|
|
7895
7908
|
e.WINDOW_RESIZED = "tauri://resize", e.WINDOW_MOVED = "tauri://move", e.WINDOW_CLOSE_REQUESTED = "tauri://close-requested", e.WINDOW_DESTROYED = "tauri://destroyed", e.WINDOW_FOCUS = "tauri://focus", e.WINDOW_BLUR = "tauri://blur", e.WINDOW_SCALE_FACTOR_CHANGED = "tauri://scale-change", e.WINDOW_THEME_CHANGED = "tauri://theme-changed", e.WINDOW_CREATED = "tauri://window-created", e.WEBVIEW_CREATED = "tauri://webview-created", e.DRAG_ENTER = "tauri://drag-enter", e.DRAG_OVER = "tauri://drag-over", e.DRAG_DROP = "tauri://drag-drop", e.DRAG_LEAVE = "tauri://drag-leave";
|
|
7896
|
-
})(
|
|
7897
|
-
async function
|
|
7909
|
+
})(za ||= {});
|
|
7910
|
+
async function Ba(e, t) {
|
|
7898
7911
|
window.__TAURI_EVENT_PLUGIN_INTERNALS__.unregisterListener(e, t), await $("plugin:event|unlisten", {
|
|
7899
7912
|
event: e,
|
|
7900
7913
|
eventId: t
|
|
7901
7914
|
});
|
|
7902
7915
|
}
|
|
7903
|
-
async function
|
|
7916
|
+
async function Va(e, t, n) {
|
|
7904
7917
|
return $("plugin:event|listen", {
|
|
7905
7918
|
event: e,
|
|
7906
7919
|
target: typeof n?.target == "string" ? {
|
|
7907
7920
|
kind: "AnyLabel",
|
|
7908
7921
|
label: n.target
|
|
7909
7922
|
} : n?.target ?? { kind: "Any" },
|
|
7910
|
-
handler:
|
|
7911
|
-
}).then((t) => async () =>
|
|
7923
|
+
handler: Aa(t)
|
|
7924
|
+
}).then((t) => async () => Ba(e, t));
|
|
7912
7925
|
}
|
|
7913
|
-
async function
|
|
7914
|
-
return
|
|
7915
|
-
|
|
7926
|
+
async function Ha(e, t, n) {
|
|
7927
|
+
return Va(e, (n) => {
|
|
7928
|
+
Ba(e, n.id), t(n);
|
|
7916
7929
|
}, n);
|
|
7917
7930
|
}
|
|
7918
|
-
async function
|
|
7931
|
+
async function Ua(e, t) {
|
|
7919
7932
|
await $("plugin:event|emit", {
|
|
7920
7933
|
event: e,
|
|
7921
7934
|
payload: t
|
|
7922
7935
|
});
|
|
7923
7936
|
}
|
|
7924
|
-
async function
|
|
7937
|
+
async function Wa(e, t, n) {
|
|
7925
7938
|
await $("plugin:event|emit_to", {
|
|
7926
7939
|
target: typeof e == "string" ? {
|
|
7927
7940
|
kind: "AnyLabel",
|
|
@@ -7933,19 +7946,19 @@ async function za(e, t, n) {
|
|
|
7933
7946
|
}
|
|
7934
7947
|
//#endregion
|
|
7935
7948
|
//#region ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/image.js
|
|
7936
|
-
var
|
|
7949
|
+
var Ga = class e extends ja {
|
|
7937
7950
|
constructor(e) {
|
|
7938
7951
|
super(e);
|
|
7939
7952
|
}
|
|
7940
7953
|
static async new(t, n, r) {
|
|
7941
7954
|
return $("plugin:image|new", {
|
|
7942
|
-
rgba:
|
|
7955
|
+
rgba: Ka(t),
|
|
7943
7956
|
width: n,
|
|
7944
7957
|
height: r
|
|
7945
7958
|
}).then((t) => new e(t));
|
|
7946
7959
|
}
|
|
7947
7960
|
static async fromBytes(t) {
|
|
7948
|
-
return $("plugin:image|from_bytes", { bytes:
|
|
7961
|
+
return $("plugin:image|from_bytes", { bytes: Ka(t) }).then((t) => new e(t));
|
|
7949
7962
|
}
|
|
7950
7963
|
static async fromPath(t) {
|
|
7951
7964
|
return $("plugin:image|from_path", { path: t }).then((t) => new e(t));
|
|
@@ -7957,16 +7970,16 @@ var Ba = class e extends Ea {
|
|
|
7957
7970
|
return $("plugin:image|size", { rid: this.rid });
|
|
7958
7971
|
}
|
|
7959
7972
|
};
|
|
7960
|
-
function
|
|
7961
|
-
return e == null ? null : typeof e == "string" ? e : e instanceof
|
|
7973
|
+
function Ka(e) {
|
|
7974
|
+
return e == null ? null : typeof e == "string" ? e : e instanceof Ga ? e.rid : e;
|
|
7962
7975
|
}
|
|
7963
7976
|
//#endregion
|
|
7964
7977
|
//#region ../../node_modules/.pnpm/@tauri-apps+api@2.10.1/node_modules/@tauri-apps/api/window.js
|
|
7965
|
-
var
|
|
7978
|
+
var qa;
|
|
7966
7979
|
(function(e) {
|
|
7967
7980
|
e[e.Critical = 1] = "Critical", e[e.Informational = 2] = "Informational";
|
|
7968
|
-
})(
|
|
7969
|
-
var
|
|
7981
|
+
})(qa ||= {});
|
|
7982
|
+
var Ja = class {
|
|
7970
7983
|
constructor(e) {
|
|
7971
7984
|
this._preventDefault = !1, this.event = e.event, this.id = e.id;
|
|
7972
7985
|
}
|
|
@@ -7976,17 +7989,17 @@ var Ua = class {
|
|
|
7976
7989
|
isPreventDefault() {
|
|
7977
7990
|
return this._preventDefault;
|
|
7978
7991
|
}
|
|
7979
|
-
},
|
|
7992
|
+
}, Ya;
|
|
7980
7993
|
(function(e) {
|
|
7981
7994
|
e.None = "none", e.Normal = "normal", e.Indeterminate = "indeterminate", e.Paused = "paused", e.Error = "error";
|
|
7982
|
-
})(
|
|
7983
|
-
function
|
|
7984
|
-
return new
|
|
7995
|
+
})(Ya ||= {});
|
|
7996
|
+
function Xa() {
|
|
7997
|
+
return new $a(window.__TAURI_INTERNALS__.metadata.currentWindow.label, { skip: !0 });
|
|
7985
7998
|
}
|
|
7986
|
-
async function
|
|
7987
|
-
return $("plugin:window|get_all_windows").then((e) => e.map((e) => new
|
|
7999
|
+
async function Za() {
|
|
8000
|
+
return $("plugin:window|get_all_windows").then((e) => e.map((e) => new $a(e, { skip: !0 })));
|
|
7988
8001
|
}
|
|
7989
|
-
var
|
|
8002
|
+
var Qa = ["tauri://created", "tauri://error"], $a = class {
|
|
7990
8003
|
constructor(e, t = {}) {
|
|
7991
8004
|
this.label = e, this.listeners = Object.create(null), t?.skip || $("plugin:window|create", { options: {
|
|
7992
8005
|
...t,
|
|
@@ -7995,23 +8008,23 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
7995
8008
|
} }).then(async () => this.emit("tauri://created")).catch(async (e) => this.emit("tauri://error", e));
|
|
7996
8009
|
}
|
|
7997
8010
|
static async getByLabel(e) {
|
|
7998
|
-
return (await
|
|
8011
|
+
return (await Za()).find((t) => t.label === e) ?? null;
|
|
7999
8012
|
}
|
|
8000
8013
|
static getCurrent() {
|
|
8001
|
-
return
|
|
8014
|
+
return Xa();
|
|
8002
8015
|
}
|
|
8003
8016
|
static async getAll() {
|
|
8004
|
-
return
|
|
8017
|
+
return Za();
|
|
8005
8018
|
}
|
|
8006
8019
|
static async getFocusedWindow() {
|
|
8007
|
-
for (let e of await
|
|
8020
|
+
for (let e of await Za()) if (await e.isFocused()) return e;
|
|
8008
8021
|
return null;
|
|
8009
8022
|
}
|
|
8010
8023
|
async listen(e, t) {
|
|
8011
8024
|
return this._handleTauriEvent(e, t) ? () => {
|
|
8012
8025
|
let n = this.listeners[e];
|
|
8013
8026
|
n.splice(n.indexOf(t), 1);
|
|
8014
|
-
} :
|
|
8027
|
+
} : Va(e, t, { target: {
|
|
8015
8028
|
kind: "Window",
|
|
8016
8029
|
label: this.label
|
|
8017
8030
|
} });
|
|
@@ -8020,13 +8033,13 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8020
8033
|
return this._handleTauriEvent(e, t) ? () => {
|
|
8021
8034
|
let n = this.listeners[e];
|
|
8022
8035
|
n.splice(n.indexOf(t), 1);
|
|
8023
|
-
} :
|
|
8036
|
+
} : Ha(e, t, { target: {
|
|
8024
8037
|
kind: "Window",
|
|
8025
8038
|
label: this.label
|
|
8026
8039
|
} });
|
|
8027
8040
|
}
|
|
8028
8041
|
async emit(e, t) {
|
|
8029
|
-
if (
|
|
8042
|
+
if (Qa.includes(e)) {
|
|
8030
8043
|
for (let n of this.listeners[e] || []) n({
|
|
8031
8044
|
event: e,
|
|
8032
8045
|
id: -1,
|
|
@@ -8034,10 +8047,10 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8034
8047
|
});
|
|
8035
8048
|
return;
|
|
8036
8049
|
}
|
|
8037
|
-
return
|
|
8050
|
+
return Ua(e, t);
|
|
8038
8051
|
}
|
|
8039
8052
|
async emitTo(e, t, n) {
|
|
8040
|
-
if (
|
|
8053
|
+
if (Qa.includes(t)) {
|
|
8041
8054
|
for (let e of this.listeners[t] || []) e({
|
|
8042
8055
|
event: t,
|
|
8043
8056
|
id: -1,
|
|
@@ -8045,25 +8058,25 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8045
8058
|
});
|
|
8046
8059
|
return;
|
|
8047
8060
|
}
|
|
8048
|
-
return
|
|
8061
|
+
return Wa(e, t, n);
|
|
8049
8062
|
}
|
|
8050
8063
|
_handleTauriEvent(e, t) {
|
|
8051
|
-
return
|
|
8064
|
+
return Qa.includes(e) ? (e in this.listeners ? this.listeners[e].push(t) : this.listeners[e] = [t], !0) : !1;
|
|
8052
8065
|
}
|
|
8053
8066
|
async scaleFactor() {
|
|
8054
8067
|
return $("plugin:window|scale_factor", { label: this.label });
|
|
8055
8068
|
}
|
|
8056
8069
|
async innerPosition() {
|
|
8057
|
-
return $("plugin:window|inner_position", { label: this.label }).then((e) => new
|
|
8070
|
+
return $("plugin:window|inner_position", { label: this.label }).then((e) => new La(e));
|
|
8058
8071
|
}
|
|
8059
8072
|
async outerPosition() {
|
|
8060
|
-
return $("plugin:window|outer_position", { label: this.label }).then((e) => new
|
|
8073
|
+
return $("plugin:window|outer_position", { label: this.label }).then((e) => new La(e));
|
|
8061
8074
|
}
|
|
8062
8075
|
async innerSize() {
|
|
8063
|
-
return $("plugin:window|inner_size", { label: this.label }).then((e) => new
|
|
8076
|
+
return $("plugin:window|inner_size", { label: this.label }).then((e) => new Pa(e));
|
|
8064
8077
|
}
|
|
8065
8078
|
async outerSize() {
|
|
8066
|
-
return $("plugin:window|outer_size", { label: this.label }).then((e) => new
|
|
8079
|
+
return $("plugin:window|outer_size", { label: this.label }).then((e) => new Pa(e));
|
|
8067
8080
|
}
|
|
8068
8081
|
async isFullscreen() {
|
|
8069
8082
|
return $("plugin:window|is_fullscreen", { label: this.label });
|
|
@@ -8109,7 +8122,7 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8109
8122
|
}
|
|
8110
8123
|
async requestUserAttention(e) {
|
|
8111
8124
|
let t = null;
|
|
8112
|
-
return e && (t = e ===
|
|
8125
|
+
return e && (t = e === qa.Critical ? { type: "Critical" } : { type: "Informational" }), $("plugin:window|request_user_attention", {
|
|
8113
8126
|
label: this.label,
|
|
8114
8127
|
value: t
|
|
8115
8128
|
});
|
|
@@ -8225,19 +8238,19 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8225
8238
|
async setSize(e) {
|
|
8226
8239
|
return $("plugin:window|set_size", {
|
|
8227
8240
|
label: this.label,
|
|
8228
|
-
value: e instanceof
|
|
8241
|
+
value: e instanceof Fa ? e : new Fa(e)
|
|
8229
8242
|
});
|
|
8230
8243
|
}
|
|
8231
8244
|
async setMinSize(e) {
|
|
8232
8245
|
return $("plugin:window|set_min_size", {
|
|
8233
8246
|
label: this.label,
|
|
8234
|
-
value: e instanceof
|
|
8247
|
+
value: e instanceof Fa ? e : e ? new Fa(e) : null
|
|
8235
8248
|
});
|
|
8236
8249
|
}
|
|
8237
8250
|
async setMaxSize(e) {
|
|
8238
8251
|
return $("plugin:window|set_max_size", {
|
|
8239
8252
|
label: this.label,
|
|
8240
|
-
value: e instanceof
|
|
8253
|
+
value: e instanceof Fa ? e : e ? new Fa(e) : null
|
|
8241
8254
|
});
|
|
8242
8255
|
}
|
|
8243
8256
|
async setSizeConstraints(e) {
|
|
@@ -8257,7 +8270,7 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8257
8270
|
async setPosition(e) {
|
|
8258
8271
|
return $("plugin:window|set_position", {
|
|
8259
8272
|
label: this.label,
|
|
8260
|
-
value: e instanceof
|
|
8273
|
+
value: e instanceof Ra ? e : new Ra(e)
|
|
8261
8274
|
});
|
|
8262
8275
|
}
|
|
8263
8276
|
async setFullscreen(e) {
|
|
@@ -8284,7 +8297,7 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8284
8297
|
async setIcon(e) {
|
|
8285
8298
|
return $("plugin:window|set_icon", {
|
|
8286
8299
|
label: this.label,
|
|
8287
|
-
value:
|
|
8300
|
+
value: Ka(e)
|
|
8288
8301
|
});
|
|
8289
8302
|
}
|
|
8290
8303
|
async setSkipTaskbar(e) {
|
|
@@ -8317,7 +8330,7 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8317
8330
|
async setCursorPosition(e) {
|
|
8318
8331
|
return $("plugin:window|set_cursor_position", {
|
|
8319
8332
|
label: this.label,
|
|
8320
|
-
value: e instanceof
|
|
8333
|
+
value: e instanceof Ra ? e : new Ra(e)
|
|
8321
8334
|
});
|
|
8322
8335
|
}
|
|
8323
8336
|
async setIgnoreCursorEvents(e) {
|
|
@@ -8350,7 +8363,7 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8350
8363
|
async setOverlayIcon(e) {
|
|
8351
8364
|
return $("plugin:window|set_overlay_icon", {
|
|
8352
8365
|
label: this.label,
|
|
8353
|
-
value: e ?
|
|
8366
|
+
value: e ? Ka(e) : void 0
|
|
8354
8367
|
});
|
|
8355
8368
|
}
|
|
8356
8369
|
async setProgressBar(e) {
|
|
@@ -8378,49 +8391,49 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8378
8391
|
});
|
|
8379
8392
|
}
|
|
8380
8393
|
async onResized(e) {
|
|
8381
|
-
return this.listen(
|
|
8382
|
-
t.payload = new
|
|
8394
|
+
return this.listen(za.WINDOW_RESIZED, (t) => {
|
|
8395
|
+
t.payload = new Pa(t.payload), e(t);
|
|
8383
8396
|
});
|
|
8384
8397
|
}
|
|
8385
8398
|
async onMoved(e) {
|
|
8386
|
-
return this.listen(
|
|
8387
|
-
t.payload = new
|
|
8399
|
+
return this.listen(za.WINDOW_MOVED, (t) => {
|
|
8400
|
+
t.payload = new La(t.payload), e(t);
|
|
8388
8401
|
});
|
|
8389
8402
|
}
|
|
8390
8403
|
async onCloseRequested(e) {
|
|
8391
|
-
return this.listen(
|
|
8392
|
-
let n = new
|
|
8404
|
+
return this.listen(za.WINDOW_CLOSE_REQUESTED, async (t) => {
|
|
8405
|
+
let n = new Ja(t);
|
|
8393
8406
|
await e(n), n.isPreventDefault() || await this.destroy();
|
|
8394
8407
|
});
|
|
8395
8408
|
}
|
|
8396
8409
|
async onDragDropEvent(e) {
|
|
8397
|
-
let t = await this.listen(
|
|
8410
|
+
let t = await this.listen(za.DRAG_ENTER, (t) => {
|
|
8398
8411
|
e({
|
|
8399
8412
|
...t,
|
|
8400
8413
|
payload: {
|
|
8401
8414
|
type: "enter",
|
|
8402
8415
|
paths: t.payload.paths,
|
|
8403
|
-
position: new
|
|
8416
|
+
position: new La(t.payload.position)
|
|
8404
8417
|
}
|
|
8405
8418
|
});
|
|
8406
|
-
}), n = await this.listen(
|
|
8419
|
+
}), n = await this.listen(za.DRAG_OVER, (t) => {
|
|
8407
8420
|
e({
|
|
8408
8421
|
...t,
|
|
8409
8422
|
payload: {
|
|
8410
8423
|
type: "over",
|
|
8411
|
-
position: new
|
|
8424
|
+
position: new La(t.payload.position)
|
|
8412
8425
|
}
|
|
8413
8426
|
});
|
|
8414
|
-
}), r = await this.listen(
|
|
8427
|
+
}), r = await this.listen(za.DRAG_DROP, (t) => {
|
|
8415
8428
|
e({
|
|
8416
8429
|
...t,
|
|
8417
8430
|
payload: {
|
|
8418
8431
|
type: "drop",
|
|
8419
8432
|
paths: t.payload.paths,
|
|
8420
|
-
position: new
|
|
8433
|
+
position: new La(t.payload.position)
|
|
8421
8434
|
}
|
|
8422
8435
|
});
|
|
8423
|
-
}), i = await this.listen(
|
|
8436
|
+
}), i = await this.listen(za.DRAG_LEAVE, (t) => {
|
|
8424
8437
|
e({
|
|
8425
8438
|
...t,
|
|
8426
8439
|
payload: { type: "leave" }
|
|
@@ -8431,12 +8444,12 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8431
8444
|
};
|
|
8432
8445
|
}
|
|
8433
8446
|
async onFocusChanged(e) {
|
|
8434
|
-
let t = await this.listen(
|
|
8447
|
+
let t = await this.listen(za.WINDOW_FOCUS, (t) => {
|
|
8435
8448
|
e({
|
|
8436
8449
|
...t,
|
|
8437
8450
|
payload: !0
|
|
8438
8451
|
});
|
|
8439
|
-
}), n = await this.listen(
|
|
8452
|
+
}), n = await this.listen(za.WINDOW_BLUR, (t) => {
|
|
8440
8453
|
e({
|
|
8441
8454
|
...t,
|
|
8442
8455
|
payload: !1
|
|
@@ -8447,35 +8460,35 @@ var qa = ["tauri://created", "tauri://error"], Ja = class {
|
|
|
8447
8460
|
};
|
|
8448
8461
|
}
|
|
8449
8462
|
async onScaleChanged(e) {
|
|
8450
|
-
return this.listen(
|
|
8463
|
+
return this.listen(za.WINDOW_SCALE_FACTOR_CHANGED, e);
|
|
8451
8464
|
}
|
|
8452
8465
|
async onThemeChanged(e) {
|
|
8453
|
-
return this.listen(
|
|
8466
|
+
return this.listen(za.WINDOW_THEME_CHANGED, e);
|
|
8454
8467
|
}
|
|
8455
|
-
},
|
|
8468
|
+
}, eo;
|
|
8456
8469
|
(function(e) {
|
|
8457
8470
|
e.Disabled = "disabled", e.Throttle = "throttle", e.Suspend = "suspend";
|
|
8458
|
-
})(
|
|
8459
|
-
var
|
|
8471
|
+
})(eo ||= {});
|
|
8472
|
+
var to;
|
|
8460
8473
|
(function(e) {
|
|
8461
8474
|
e.Default = "default", e.FluentOverlay = "fluentOverlay";
|
|
8462
|
-
})(
|
|
8463
|
-
var
|
|
8475
|
+
})(to ||= {});
|
|
8476
|
+
var no;
|
|
8464
8477
|
(function(e) {
|
|
8465
8478
|
e.AppearanceBased = "appearanceBased", e.Light = "light", e.Dark = "dark", e.MediumLight = "mediumLight", e.UltraDark = "ultraDark", e.Titlebar = "titlebar", e.Selection = "selection", e.Menu = "menu", e.Popover = "popover", e.Sidebar = "sidebar", e.HeaderView = "headerView", e.Sheet = "sheet", e.WindowBackground = "windowBackground", e.HudWindow = "hudWindow", e.FullScreenUI = "fullScreenUI", e.Tooltip = "tooltip", e.ContentBackground = "contentBackground", e.UnderWindowBackground = "underWindowBackground", e.UnderPageBackground = "underPageBackground", e.Mica = "mica", e.Blur = "blur", e.Acrylic = "acrylic", e.Tabbed = "tabbed", e.TabbedDark = "tabbedDark", e.TabbedLight = "tabbedLight";
|
|
8466
|
-
})(
|
|
8467
|
-
var
|
|
8479
|
+
})(no ||= {});
|
|
8480
|
+
var ro;
|
|
8468
8481
|
(function(e) {
|
|
8469
8482
|
e.FollowsWindowActiveState = "followsWindowActiveState", e.Active = "active", e.Inactive = "inactive";
|
|
8470
|
-
})(
|
|
8483
|
+
})(ro ||= {});
|
|
8471
8484
|
//#endregion
|
|
8472
8485
|
//#region lib/hooks/useBuiltInCommands.ts
|
|
8473
|
-
function
|
|
8486
|
+
function io(e) {
|
|
8474
8487
|
let t = ke(), n = u(e);
|
|
8475
8488
|
n.current = e;
|
|
8476
8489
|
let r = y(Ie), i = u(r);
|
|
8477
8490
|
i.current = r;
|
|
8478
|
-
let { updateSettings: a } =
|
|
8491
|
+
let { updateSettings: a } = vr(), [s, c] = v(We), l = b(Ge), d = b(Ve), f = b(Ne), p = b(qe), m = b(Je), h = b(Ke), g = u(s);
|
|
8479
8492
|
g.current = s, o(() => {
|
|
8480
8493
|
let e = [];
|
|
8481
8494
|
return e.push(H.registerCommand("dotdir.toggleHiddenFiles", () => l((e) => {
|
|
@@ -8503,7 +8516,7 @@ function $a(e) {
|
|
|
8503
8516
|
})), e.push(H.registerCommand("dotdir.refresh", () => {
|
|
8504
8517
|
let { leftRef: e, rightRef: t } = n.current, r = g.current === "left" ? e.current : t.current;
|
|
8505
8518
|
r.navigateTo(r.currentPath);
|
|
8506
|
-
})), e.push(H.registerCommand("dotdir.newTab", () => void
|
|
8519
|
+
})), e.push(H.registerCommand("dotdir.newTab", () => void Ji()?.newTab())), e.push(H.registerCommand("dotdir.closeTab", () => void Ji()?.closeActiveTab())), e.push(H.registerCommand("dotdir.previewInOppositePanel", () => n.current.onPreviewInOppositePanel())), e.push(H.registerCommand("dotdir.openCurrentFolderInOppositePanelCurrentTab", () => n.current.onOpenCurrentFolderInOppositeCurrentTab())), e.push(H.registerCommand("dotdir.openCurrentFolderInOppositePanelNewTab", () => n.current.onOpenCurrentFolderInOppositeNewTab())), e.push(H.registerCommand("dotdir.openSelectedFolderInOppositePanelCurrentTab", () => n.current.onOpenSelectedFolderInOppositeCurrentTab())), e.push(H.registerCommand("dotdir.openSelectedFolderInOppositePanelNewTab", () => n.current.onOpenSelectedFolderInOppositeNewTab())), e.push(H.registerCommand("dotdir.openCreateFile", () => {
|
|
8507
8520
|
let { leftRef: e, rightRef: t, showDialog: r, onOpenCreateFileConfirm: a } = n.current, o = (g.current === "left" ? e.current : t.current).currentPath, s = i.current.flatMap((e) => e.languages ?? []), c = /* @__PURE__ */ new Set();
|
|
8508
8521
|
r({
|
|
8509
8522
|
type: "openCreateFile",
|
|
@@ -8536,7 +8549,7 @@ function $a(e) {
|
|
|
8536
8549
|
onCancel: () => {}
|
|
8537
8550
|
});
|
|
8538
8551
|
})), e.push(H.registerCommand("dotdir.exit", async () => {
|
|
8539
|
-
|
|
8552
|
+
Ma() ? await Xa().close() : window.close();
|
|
8540
8553
|
})), e.push(H.registerCommand("terminal.execute", async (e) => {
|
|
8541
8554
|
let t = q(e), r = /^[a-zA-Z0-9._+-]+$/.test(t) ? `./${t}` : `./${JSON.stringify(t)}`;
|
|
8542
8555
|
await n.current.onExecuteInTerminal(`${r}\r`);
|
|
@@ -8561,13 +8574,13 @@ function $a(e) {
|
|
|
8561
8574
|
}
|
|
8562
8575
|
//#endregion
|
|
8563
8576
|
//#region ../../node_modules/.pnpm/fss-lang@0.0.5/node_modules/fss-lang/dist/types-BeNtN9DC.mjs
|
|
8564
|
-
var
|
|
8577
|
+
var ao = /* @__PURE__ */ function(e) {
|
|
8565
8578
|
return e[e.None = 0] = "None", e[e.Expanded = 1] = "Expanded", e[e.Selected = 2] = "Selected", e[e.Hovered = 4] = "Hovered", e[e.Active = 8] = "Active", e[e.DragOver = 16] = "DragOver", e[e.Focused = 32] = "Focused", e;
|
|
8566
8579
|
}({});
|
|
8567
|
-
|
|
8580
|
+
ao.Expanded, ao.Selected, ao.Hovered, ao.Active, ao.DragOver, ao.Focused;
|
|
8568
8581
|
//#endregion
|
|
8569
8582
|
//#region ../../node_modules/.pnpm/fss-lang@0.0.5/node_modules/fss-lang/dist/helpers.mjs
|
|
8570
|
-
function
|
|
8583
|
+
function oo(e) {
|
|
8571
8584
|
let t = e.name.indexOf("."), n = e.name.lastIndexOf("."), r = "", i = "";
|
|
8572
8585
|
return e.type === "file" && t > 0 && (i = e.name.substring(t + 1), r = n > 0 ? e.name.substring(n + 1) : i), {
|
|
8573
8586
|
type: e.type,
|
|
@@ -8577,13 +8590,13 @@ function to(e) {
|
|
|
8577
8590
|
lang: e.lang ?? "",
|
|
8578
8591
|
path: e.path,
|
|
8579
8592
|
parent: e.parent,
|
|
8580
|
-
stateFlags: e.stateFlags ??
|
|
8593
|
+
stateFlags: e.stateFlags ?? ao.None,
|
|
8581
8594
|
meta: e.meta ?? {}
|
|
8582
8595
|
};
|
|
8583
8596
|
}
|
|
8584
8597
|
//#endregion
|
|
8585
8598
|
//#region lib/hooks/usePanel.ts
|
|
8586
|
-
function
|
|
8599
|
+
function so(e) {
|
|
8587
8600
|
if (G(e) === e) return;
|
|
8588
8601
|
let t = [], n = e;
|
|
8589
8602
|
for (;;) {
|
|
@@ -8594,7 +8607,7 @@ function no(e) {
|
|
|
8594
8607
|
}
|
|
8595
8608
|
t.reverse();
|
|
8596
8609
|
let r;
|
|
8597
|
-
for (let e of t) r =
|
|
8610
|
+
for (let e of t) r = oo({
|
|
8598
8611
|
name: q(e) || e,
|
|
8599
8612
|
type: "folder",
|
|
8600
8613
|
path: e,
|
|
@@ -8602,11 +8615,11 @@ function no(e) {
|
|
|
8602
8615
|
});
|
|
8603
8616
|
return r;
|
|
8604
8617
|
}
|
|
8605
|
-
function
|
|
8618
|
+
function co(e) {
|
|
8606
8619
|
return e.kind === "directory" || e.kind === "symlink" && (e.mode & 61440) == 16384;
|
|
8607
8620
|
}
|
|
8608
|
-
function
|
|
8609
|
-
let r =
|
|
8621
|
+
function lo(e, t, n) {
|
|
8622
|
+
let r = co(e), i = {
|
|
8610
8623
|
size: e.size,
|
|
8611
8624
|
mtimeMs: e.mtimeMs,
|
|
8612
8625
|
mode: e.mode,
|
|
@@ -8615,7 +8628,7 @@ function io(e, t, n) {
|
|
|
8615
8628
|
hidden: e.hidden,
|
|
8616
8629
|
linkTarget: e.linkTarget
|
|
8617
8630
|
};
|
|
8618
|
-
return
|
|
8631
|
+
return oo({
|
|
8619
8632
|
name: e.name,
|
|
8620
8633
|
type: r ? "folder" : "file",
|
|
8621
8634
|
lang: r ? "" : ye.detectLanguage(e.name),
|
|
@@ -8632,7 +8645,7 @@ function io(e, t, n) {
|
|
|
8632
8645
|
parent: n
|
|
8633
8646
|
});
|
|
8634
8647
|
}
|
|
8635
|
-
async function
|
|
8648
|
+
async function uo(e, t) {
|
|
8636
8649
|
let n = t;
|
|
8637
8650
|
for (;;) {
|
|
8638
8651
|
if (await e.fs.exists(n)) return n;
|
|
@@ -8641,7 +8654,7 @@ async function ao(e, t) {
|
|
|
8641
8654
|
n = t;
|
|
8642
8655
|
}
|
|
8643
8656
|
}
|
|
8644
|
-
function
|
|
8657
|
+
function fo(e) {
|
|
8645
8658
|
let t = [], n = e;
|
|
8646
8659
|
for (;;) {
|
|
8647
8660
|
t.push(n);
|
|
@@ -8651,21 +8664,21 @@ function oo(e) {
|
|
|
8651
8664
|
}
|
|
8652
8665
|
return t;
|
|
8653
8666
|
}
|
|
8654
|
-
var
|
|
8667
|
+
var po = {
|
|
8655
8668
|
currentPath: "",
|
|
8656
8669
|
parentNode: void 0,
|
|
8657
8670
|
entries: [],
|
|
8658
8671
|
requestedCursor: void 0
|
|
8659
8672
|
};
|
|
8660
|
-
function
|
|
8661
|
-
let t = ke(), n = y(Be), [r, a] = d(
|
|
8673
|
+
function mo(e) {
|
|
8674
|
+
let t = ke(), n = y(Be), [r, a] = d(po), [s, c] = d(!1), f = u(null), p = u(null), m = l(() => oi(n), [n]), h = u(m);
|
|
8662
8675
|
h.current = m;
|
|
8663
8676
|
let g = u(null), _ = u(null), v = u(""), b = u(e);
|
|
8664
8677
|
b.current = e, o(() => {
|
|
8665
8678
|
v.current && S(v.current, !0);
|
|
8666
8679
|
}, [m]);
|
|
8667
8680
|
let x = i((e) => {
|
|
8668
|
-
let t = g.current, n =
|
|
8681
|
+
let t = g.current, n = fo(e), r = [];
|
|
8669
8682
|
for (let e of n) r.push(e), r.push(K(e, ".dotdir"));
|
|
8670
8683
|
t.sync(r);
|
|
8671
8684
|
}, []), S = i(async (e, n = !1, r) => {
|
|
@@ -8676,7 +8689,7 @@ function co(e) {
|
|
|
8676
8689
|
try {
|
|
8677
8690
|
let n = (async () => {
|
|
8678
8691
|
if (v.current = e, Gt(e)) {
|
|
8679
|
-
let { containerFile: n, innerPath: o } = Kt(e), s =
|
|
8692
|
+
let { containerFile: n, innerPath: o } = Kt(e), s = dn.resolve(q(n));
|
|
8680
8693
|
if (!s) throw Error(`No fsProvider registered for "${q(n)}"`);
|
|
8681
8694
|
let c;
|
|
8682
8695
|
if (s.contribution.runtime === "backend" && t.fsProvider) {
|
|
@@ -8692,13 +8705,13 @@ function co(e) {
|
|
|
8692
8705
|
let e = await Rt(t, s.extensionDirPath, s.contribution.entry);
|
|
8693
8706
|
if (i.signal.aborted || (c = await e.listEntries(n, o), i.signal.aborted)) return;
|
|
8694
8707
|
}
|
|
8695
|
-
let l =
|
|
8708
|
+
let l = so(e);
|
|
8696
8709
|
a({
|
|
8697
8710
|
currentPath: e,
|
|
8698
8711
|
parentNode: l,
|
|
8699
8712
|
entries: c.map((e) => {
|
|
8700
8713
|
let t = (o === "/" ? "" : o) + "/" + e.name;
|
|
8701
|
-
return
|
|
8714
|
+
return oo({
|
|
8702
8715
|
name: e.name,
|
|
8703
8716
|
type: e.type === "directory" ? "folder" : "file",
|
|
8704
8717
|
lang: e.type === "file" ? ye.detectLanguage(e.name) : "",
|
|
@@ -8717,10 +8730,10 @@ function co(e) {
|
|
|
8717
8730
|
requestedCursor: r
|
|
8718
8731
|
});
|
|
8719
8732
|
} else {
|
|
8720
|
-
if (await
|
|
8721
|
-
let n =
|
|
8733
|
+
if (await si(t, h.current, e), i.signal.aborted) return;
|
|
8734
|
+
let n = so(e), o = await t.fs.entries(e);
|
|
8722
8735
|
if (i.signal.aborted) return;
|
|
8723
|
-
let s = o.map((t) =>
|
|
8736
|
+
let s = o.map((t) => lo(t, e, n));
|
|
8724
8737
|
if (i.signal.aborted) return;
|
|
8725
8738
|
a({
|
|
8726
8739
|
currentPath: e,
|
|
@@ -8750,10 +8763,10 @@ function co(e) {
|
|
|
8750
8763
|
let r = !1, i = !1, a = !1;
|
|
8751
8764
|
for (let t of e) {
|
|
8752
8765
|
let e = t.root.path, o = t.relativePathComponents[0] ?? null, s = t.type;
|
|
8753
|
-
e === n ? s === "errored" ? a = !0 : r = !0 : e.endsWith("/.dotdir") ? o === "fs.css" && (
|
|
8766
|
+
e === n ? s === "errored" ? a = !0 : r = !0 : e.endsWith("/.dotdir") ? o === "fs.css" && (ai(G(e)), i = !0) : (n.startsWith(e + "/") || n === e) && (o === ".dotdir" ? (ai(e), i = !0) : o && o === n.slice(e.length + 1).split("/")[0] && s === "disappeared" && (a = !0));
|
|
8754
8767
|
}
|
|
8755
8768
|
if (a) {
|
|
8756
|
-
_.current &&= (clearTimeout(_.current), null),
|
|
8769
|
+
_.current &&= (clearTimeout(_.current), null), uo(t, n).then((e) => {
|
|
8757
8770
|
w.current(e);
|
|
8758
8771
|
});
|
|
8759
8772
|
return;
|
|
@@ -8780,8 +8793,8 @@ function co(e) {
|
|
|
8780
8793
|
}
|
|
8781
8794
|
//#endregion
|
|
8782
8795
|
//#region lib/hooks/useTerminal.tsx
|
|
8783
|
-
function
|
|
8784
|
-
let n = ke(), r = y(Re), a = y(ze), s = y(Ve), c = b(Ve), l = b(He), d = y(Ue), f = b(Ue), p = b(Ye), { activeSession: m, activeSessionId: h, setProfiles: g, setCurrentCwd: _, restartAll: v, dispose: x, writeToActiveSession: S, executeCommandInCwd: C } =
|
|
8796
|
+
function ho({ activePanelCwd: e, onNavigatePanel: t }) {
|
|
8797
|
+
let n = ke(), r = y(Re), a = y(ze), s = y(Ve), c = b(Ve), l = b(He), d = y(Ue), f = b(Ue), p = b(Ye), { activeSession: m, activeSessionId: h, setProfiles: g, setCurrentCwd: _, restartAll: v, dispose: x, writeToActiveSession: S, executeCommandInCwd: C } = la(), w = u(e);
|
|
8785
8798
|
w.current = e;
|
|
8786
8799
|
let T = u(t);
|
|
8787
8800
|
T.current = t;
|
|
@@ -8851,31 +8864,31 @@ function lo({ activePanelCwd: e, onNavigatePanel: t }) {
|
|
|
8851
8864
|
}
|
|
8852
8865
|
//#endregion
|
|
8853
8866
|
//#region lib/features/ui-state/uiState.ts
|
|
8854
|
-
var
|
|
8855
|
-
async function
|
|
8856
|
-
return
|
|
8867
|
+
var go = {}, _o = null, vo = null;
|
|
8868
|
+
async function yo(e) {
|
|
8869
|
+
return _o ||= K(await e.utils.getHomePath(), ".dotdir", "ui-state.json"), _o;
|
|
8857
8870
|
}
|
|
8858
|
-
async function
|
|
8871
|
+
async function bo(e) {
|
|
8859
8872
|
try {
|
|
8860
|
-
let t = await Nt(e, await
|
|
8861
|
-
typeof n == "object" && n && !Array.isArray(n) && (
|
|
8873
|
+
let t = await Nt(e, await yo(e)), n = JSON.parse(t);
|
|
8874
|
+
typeof n == "object" && n && !Array.isArray(n) && (go = n);
|
|
8862
8875
|
} catch {}
|
|
8863
|
-
return
|
|
8876
|
+
return go;
|
|
8864
8877
|
}
|
|
8865
|
-
function
|
|
8866
|
-
|
|
8867
|
-
...
|
|
8878
|
+
function xo(e, t) {
|
|
8879
|
+
go = {
|
|
8880
|
+
...go,
|
|
8868
8881
|
...t
|
|
8869
|
-
},
|
|
8870
|
-
|
|
8882
|
+
}, vo && clearTimeout(vo), vo = setTimeout(() => {
|
|
8883
|
+
vo = null, Co(e, go);
|
|
8871
8884
|
}, 500);
|
|
8872
8885
|
}
|
|
8873
|
-
function
|
|
8874
|
-
|
|
8886
|
+
function So(e) {
|
|
8887
|
+
vo &&= (clearTimeout(vo), null), Co(e, go);
|
|
8875
8888
|
}
|
|
8876
|
-
async function
|
|
8889
|
+
async function Co(e, t) {
|
|
8877
8890
|
try {
|
|
8878
|
-
let n = await
|
|
8891
|
+
let n = await yo(e);
|
|
8879
8892
|
await e.fs.writeFile(n, JSON.stringify(t, null, 2));
|
|
8880
8893
|
} catch (e) {
|
|
8881
8894
|
console.error("[uiState] Failed to save:", e);
|
|
@@ -8883,22 +8896,22 @@ async function vo(e, t) {
|
|
|
8883
8896
|
}
|
|
8884
8897
|
//#endregion
|
|
8885
8898
|
//#region lib/processes/workspace-session/model/useWorkspaceSessionProcess.ts
|
|
8886
|
-
function
|
|
8899
|
+
function wo({ ready: e, setLeftTabs: t, setRightTabs: n, setLeftActiveTabId: r, setRightActiveTabId: i, leftTabSelectionRef: a, rightTabSelectionRef: s, prevLeftActiveTabIdRef: c, prevRightActiveTabIdRef: l, onAfterRestore: f }) {
|
|
8887
8900
|
let p = ke(), [m, h] = d(!1), g = u({}), [_, v] = d(!1), [y, b] = d(void 0), [x, S] = d(void 0), [C, w] = d(void 0);
|
|
8888
8901
|
return o(() => {
|
|
8889
|
-
|
|
8902
|
+
bo(p).then((e) => {
|
|
8890
8903
|
g.current = e, v(!0);
|
|
8891
8904
|
});
|
|
8892
8905
|
}, []), o(() => {
|
|
8893
8906
|
if (!e || !_) return;
|
|
8894
|
-
let o = g.current, u = (e) => e?.tabs?.length ? e.tabs.map((e) => e.type === "filelist" ?
|
|
8895
|
-
id:
|
|
8907
|
+
let o = g.current, u = (e) => e?.tabs?.length ? e.tabs.map((e) => e.type === "filelist" ? Pi(e.path) : {
|
|
8908
|
+
id: Ni(),
|
|
8896
8909
|
type: "preview",
|
|
8897
8910
|
path: e.path,
|
|
8898
8911
|
name: e.name,
|
|
8899
8912
|
size: e.size,
|
|
8900
8913
|
isTemp: !1
|
|
8901
|
-
}) : e?.currentPath ? [
|
|
8914
|
+
}) : e?.currentPath ? [Pi(e.currentPath)] : null, d = (e, t, n) => {
|
|
8902
8915
|
if (!(!t?.length || !n?.tabs?.length)) for (let r = 0; r < t.length && r < n.tabs.length; r++) {
|
|
8903
8916
|
let i = t[r], a = n.tabs[r];
|
|
8904
8917
|
i.type === "filelist" && a.type === "filelist" && (a.selectedName != null || a.topmostName != null) && (e.current[i.id] = {
|
|
@@ -8920,7 +8933,7 @@ function yo({ ready: e, setLeftTabs: t, setRightTabs: n, setLeftActiveTabId: r,
|
|
|
8920
8933
|
setInitialActivePanel: w
|
|
8921
8934
|
};
|
|
8922
8935
|
}
|
|
8923
|
-
function
|
|
8936
|
+
function To({ activePanel: e, settingsLoaded: t, left: n, right: r, leftTabsRef: a, rightTabsRef: s, leftActiveTabIdRef: c, rightActiveTabIdRef: l, leftTabSelectionRef: d, rightTabSelectionRef: f, leftSelectedNameRef: p, rightSelectedNameRef: m, setLeftTabs: h, setRightTabs: g, setLeftActiveTabId: _, setRightActiveTabId: v }) {
|
|
8924
8937
|
let y = ke(), b = u(null), x = u({}), S = i((e, t, n) => {
|
|
8925
8938
|
let r = e === "left" ? d : f;
|
|
8926
8939
|
return {
|
|
@@ -8944,13 +8957,13 @@ function bo({ activePanel: e, settingsLoaded: t, left: n, right: r, leftTabsRef:
|
|
|
8944
8957
|
}, [d, f]), C = i(() => {
|
|
8945
8958
|
b.current &&= (clearTimeout(b.current), null);
|
|
8946
8959
|
let e = x.current;
|
|
8947
|
-
for (let t of
|
|
8948
|
-
let i =
|
|
8960
|
+
for (let t of ma) {
|
|
8961
|
+
let i = pa[t];
|
|
8949
8962
|
e[i] || (e[i] = { currentPath: t === "left" ? n.currentPath : r.currentPath });
|
|
8950
8963
|
let o = t === "left" ? a : s, u = t === "left" ? c : l;
|
|
8951
8964
|
Object.assign(e[i], S(t, o.current, u.current));
|
|
8952
8965
|
}
|
|
8953
|
-
|
|
8966
|
+
xo(y, e), So(y), x.current = {};
|
|
8954
8967
|
}, [
|
|
8955
8968
|
S,
|
|
8956
8969
|
n.currentPath,
|
|
@@ -8961,7 +8974,7 @@ function bo({ activePanel: e, settingsLoaded: t, left: n, right: r, leftTabsRef:
|
|
|
8961
8974
|
l
|
|
8962
8975
|
]), w = i(() => {
|
|
8963
8976
|
b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
8964
|
-
b.current = null,
|
|
8977
|
+
b.current = null, xo(y, x.current), x.current = {};
|
|
8965
8978
|
}, 1e4);
|
|
8966
8979
|
}, [y]);
|
|
8967
8980
|
o(() => {
|
|
@@ -8975,11 +8988,11 @@ function bo({ activePanel: e, settingsLoaded: t, left: n, right: r, leftTabsRef:
|
|
|
8975
8988
|
T?.type === "filelist" && (y.current[T.id] = {
|
|
8976
8989
|
selectedName: t,
|
|
8977
8990
|
topmostName: i
|
|
8978
|
-
}), b.current = t, x.current[
|
|
8991
|
+
}), b.current = t, x.current[pa[e]] = {
|
|
8979
8992
|
currentPath: C.currentPath,
|
|
8980
8993
|
...S(e, o.current, u.current)
|
|
8981
8994
|
}, w();
|
|
8982
|
-
let E =
|
|
8995
|
+
let E = fa[e], D = E === "left" ? a : s, O = E === "right" ? g : h, k = E === "right" ? v : _, A = D.current.find((t) => t.type === "preview" && t.isTemp && t.sourcePanel === e);
|
|
8983
8996
|
if (!A || !t) return;
|
|
8984
8997
|
let j = C.entries.find((e) => e.name === t);
|
|
8985
8998
|
if (!j || j.type !== "file") return;
|
|
@@ -9012,10 +9025,10 @@ function bo({ activePanel: e, settingsLoaded: t, left: n, right: r, leftTabsRef:
|
|
|
9012
9025
|
_
|
|
9013
9026
|
]);
|
|
9014
9027
|
return o(() => {
|
|
9015
|
-
t &&
|
|
9028
|
+
t && xo(y, { activePanel: e });
|
|
9016
9029
|
}, [e, t]), { handlePanelStateChange: T };
|
|
9017
9030
|
}
|
|
9018
|
-
function
|
|
9031
|
+
function Eo(e) {
|
|
9019
9032
|
return Array.isArray(e) ? e.filter((e) => {
|
|
9020
9033
|
if (typeof e != "object" || !e) return !1;
|
|
9021
9034
|
let t = e;
|
|
@@ -9027,11 +9040,11 @@ function xo(e) {
|
|
|
9027
9040
|
when: typeof e.when == "string" ? e.when : void 0
|
|
9028
9041
|
})) : (console.error("[userKeybindings] keybindings.json must be an array"), null);
|
|
9029
9042
|
}
|
|
9030
|
-
async function
|
|
9031
|
-
await
|
|
9043
|
+
async function Do(e) {
|
|
9044
|
+
await or(e, {
|
|
9032
9045
|
name: "userKeybindings",
|
|
9033
9046
|
getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "keybindings.json"),
|
|
9034
|
-
validate:
|
|
9047
|
+
validate: Eo,
|
|
9035
9048
|
defaultValue: [],
|
|
9036
9049
|
onLoad: (e) => {
|
|
9037
9050
|
H.setLayerKeybindings("user", e), console.log(`[userKeybindings] Applied ${e.length} keybindings`);
|
|
@@ -9040,7 +9053,7 @@ async function So(e) {
|
|
|
9040
9053
|
}
|
|
9041
9054
|
//#endregion
|
|
9042
9055
|
//#region lib/utils/mediaFiles.ts
|
|
9043
|
-
var
|
|
9056
|
+
var Oo = new Set([
|
|
9044
9057
|
"png",
|
|
9045
9058
|
"jpg",
|
|
9046
9059
|
"jpeg",
|
|
@@ -9052,7 +9065,7 @@ var Co = new Set([
|
|
|
9052
9065
|
"avif",
|
|
9053
9066
|
"tiff",
|
|
9054
9067
|
"tif"
|
|
9055
|
-
]),
|
|
9068
|
+
]), ko = new Set([
|
|
9056
9069
|
"mp4",
|
|
9057
9070
|
"webm",
|
|
9058
9071
|
"ogv",
|
|
@@ -9060,31 +9073,31 @@ var Co = new Set([
|
|
|
9060
9073
|
"mov",
|
|
9061
9074
|
"m4v"
|
|
9062
9075
|
]);
|
|
9063
|
-
function
|
|
9076
|
+
function Ao(e) {
|
|
9064
9077
|
let t = e.lastIndexOf(".");
|
|
9065
9078
|
return t < 0 ? "" : e.slice(t + 1).toLowerCase();
|
|
9066
9079
|
}
|
|
9067
|
-
function
|
|
9068
|
-
return
|
|
9080
|
+
function jo(e) {
|
|
9081
|
+
return Oo.has(Ao(e));
|
|
9069
9082
|
}
|
|
9070
|
-
function
|
|
9071
|
-
return
|
|
9083
|
+
function Mo(e) {
|
|
9084
|
+
return ko.has(Ao(e));
|
|
9072
9085
|
}
|
|
9073
|
-
function
|
|
9074
|
-
return
|
|
9086
|
+
function No(e) {
|
|
9087
|
+
return jo(e) || Mo(e);
|
|
9075
9088
|
}
|
|
9076
9089
|
//#endregion
|
|
9077
9090
|
//#region lib/styles/base.module.css
|
|
9078
|
-
var
|
|
9091
|
+
var Po = "_app_4bfa7_56", Fo = "_loading_4bfa7_69", Io = {
|
|
9079
9092
|
"dotdir-root": "_dotdir-root_4bfa7_1",
|
|
9080
|
-
app:
|
|
9093
|
+
app: Po,
|
|
9081
9094
|
"status-bar": "_status-bar_4bfa7_64",
|
|
9082
|
-
loading:
|
|
9095
|
+
loading: Fo
|
|
9083
9096
|
};
|
|
9084
9097
|
//#endregion
|
|
9085
9098
|
//#region lib/app.tsx
|
|
9086
|
-
function
|
|
9087
|
-
let t = u(null), n = ke(), { settings: r, ready: a, updateSettings: s } =
|
|
9099
|
+
function Lo({ widget: e }) {
|
|
9100
|
+
let t = u(null), n = ke(), { settings: r, ready: a, updateSettings: s } = vr(), c = u(r);
|
|
9088
9101
|
c.current = r;
|
|
9089
9102
|
let l = b(Be), { dialog: h, showDialog: g } = De(), [_, x] = v(Ge), S = i((e) => {
|
|
9090
9103
|
g({
|
|
@@ -9093,7 +9106,7 @@ function Mo({ widget: e }) {
|
|
|
9093
9106
|
message: e,
|
|
9094
9107
|
variant: "error"
|
|
9095
9108
|
});
|
|
9096
|
-
}, [g]), C =
|
|
9109
|
+
}, [g]), C = mo(S), w = mo(S), [T, E] = v(We), D = y(Ve), [O, k] = v(qe), [j, M] = v(Je), [N, P] = d(null), [I, ee] = d(null), te = y(Ne), L = b(Pe), ne = b(Fe), [re, ie] = d(0), [R, ae] = v(Ri), [z, oe] = v(zi), [se, ce] = v(Bi), [B, V] = v(Vi), le = u(void 0), ue = u(void 0), de = u({}), fe = u({}), me = u(se), he = u(B), ge = y(Ie), _e = y(Le), ve = u(R);
|
|
9097
9110
|
ve.current = R;
|
|
9098
9111
|
let ye = u(z);
|
|
9099
9112
|
ye.current = z;
|
|
@@ -9105,7 +9118,7 @@ function Mo({ widget: e }) {
|
|
|
9105
9118
|
Oe && (Ae.current = Oe), o(() => {
|
|
9106
9119
|
a && (r.iconTheme && L(r.iconTheme), r.colorTheme !== void 0 && ne(r.colorTheme || void 0), r.editorFileSizeLimit !== void 0 && ie(r.editorFileSizeLimit), r.showHidden !== void 0 && x(r.showHidden));
|
|
9107
9120
|
}, [r, a]);
|
|
9108
|
-
let { settingsLoaded: je, initialLeftPanel: Me, initialRightPanel: Re, initialActivePanel: ze, setInitialLeftPanel: He, setInitialRightPanel: Ue, setInitialActivePanel: Ke } =
|
|
9121
|
+
let { settingsLoaded: je, initialLeftPanel: Me, initialRightPanel: Re, initialActivePanel: ze, setInitialLeftPanel: He, setInitialRightPanel: Ue, setInitialActivePanel: Ke } = wo({
|
|
9109
9122
|
ready: a,
|
|
9110
9123
|
setLeftTabs: ae,
|
|
9111
9124
|
setRightTabs: oe,
|
|
@@ -9116,7 +9129,7 @@ function Mo({ widget: e }) {
|
|
|
9116
9129
|
prevLeftActiveTabIdRef: me,
|
|
9117
9130
|
prevRightActiveTabIdRef: he,
|
|
9118
9131
|
onAfterRestore: i(() => {
|
|
9119
|
-
|
|
9132
|
+
Do(n);
|
|
9120
9133
|
}, [n])
|
|
9121
9134
|
}), Ye = u(T);
|
|
9122
9135
|
Ye.current = T;
|
|
@@ -9127,7 +9140,7 @@ function Mo({ widget: e }) {
|
|
|
9127
9140
|
let et = u(w);
|
|
9128
9141
|
et.current = w;
|
|
9129
9142
|
let nt = u(""), rt = i(async (e) => {
|
|
9130
|
-
let t =
|
|
9143
|
+
let t = Ca(e);
|
|
9131
9144
|
if (!t) {
|
|
9132
9145
|
Pt.runCommand(e, nt.current);
|
|
9133
9146
|
return;
|
|
@@ -9161,7 +9174,7 @@ function Mo({ widget: e }) {
|
|
|
9161
9174
|
return;
|
|
9162
9175
|
}
|
|
9163
9176
|
let i = Q(Tt(W(e)));
|
|
9164
|
-
if (!await
|
|
9177
|
+
if (!await Ta(n, i)) {
|
|
9165
9178
|
g({
|
|
9166
9179
|
type: "message",
|
|
9167
9180
|
title: "cd",
|
|
@@ -9174,8 +9187,8 @@ function Mo({ widget: e }) {
|
|
|
9174
9187
|
return;
|
|
9175
9188
|
}
|
|
9176
9189
|
if (t.kind === "chdir") {
|
|
9177
|
-
let e = await
|
|
9178
|
-
if (!await
|
|
9190
|
+
let e = await wa(n, t.pathArg, i);
|
|
9191
|
+
if (!await Ta(n, e)) {
|
|
9179
9192
|
g({
|
|
9180
9193
|
type: "message",
|
|
9181
9194
|
title: "cd",
|
|
@@ -9190,9 +9203,9 @@ function Mo({ widget: e }) {
|
|
|
9190
9203
|
o(() => {
|
|
9191
9204
|
Te(() => rt);
|
|
9192
9205
|
}, [rt, Te]);
|
|
9193
|
-
let { handleCopy: it, handleMove: at, handleMoveToTrash: ot, handlePermanentDelete: st, handleRename: ct } =
|
|
9206
|
+
let { handleCopy: it, handleMove: at, handleMoveToTrash: ot, handlePermanentDelete: st, handleRename: ct } = Sa(Ye, $e, et, Ce);
|
|
9194
9207
|
o(() => {
|
|
9195
|
-
|
|
9208
|
+
Qr({
|
|
9196
9209
|
moveToTrash: ot,
|
|
9197
9210
|
permanentDelete: st,
|
|
9198
9211
|
copy: it,
|
|
@@ -9212,7 +9225,7 @@ function Mo({ widget: e }) {
|
|
|
9212
9225
|
H.setContext("dialogOpen", h !== null);
|
|
9213
9226
|
}, [h]);
|
|
9214
9227
|
let lt = i((e, t, n) => {
|
|
9215
|
-
if (
|
|
9228
|
+
if (dn.resolve(q(e))) {
|
|
9216
9229
|
Qe.current(e + "\0");
|
|
9217
9230
|
return;
|
|
9218
9231
|
}
|
|
@@ -9280,7 +9293,7 @@ function Mo({ widget: e }) {
|
|
|
9280
9293
|
index: i,
|
|
9281
9294
|
total: r.length
|
|
9282
9295
|
};
|
|
9283
|
-
}, [O, ht]), yt = O ?
|
|
9296
|
+
}, [O, ht]), yt = O ? ln.resolve(O.name) : null, bt = j ? un.resolve(j.name) : null;
|
|
9284
9297
|
o(() => {
|
|
9285
9298
|
yt && P((e) => e?.dirPath === yt.extensionDirPath && e?.entry === yt.contribution.entry ? e : {
|
|
9286
9299
|
dirPath: yt.extensionDirPath,
|
|
@@ -9292,7 +9305,7 @@ function Mo({ widget: e }) {
|
|
|
9292
9305
|
entry: bt.contribution.entry
|
|
9293
9306
|
});
|
|
9294
9307
|
}, [bt?.extensionDirPath, bt?.contribution.entry]);
|
|
9295
|
-
let xt = O &&
|
|
9308
|
+
let xt = O && No(O.name) ? O.name : void 0, St = C.requestedCursor ?? (O?.panel === "left" ? xt : void 0), Ct = w.requestedCursor ?? (O?.panel === "right" ? xt : void 0), { handlePanelStateChange: wt } = To({
|
|
9296
9309
|
activePanel: T,
|
|
9297
9310
|
settingsLoaded: je,
|
|
9298
9311
|
left: C,
|
|
@@ -9310,7 +9323,7 @@ function Mo({ widget: e }) {
|
|
|
9310
9323
|
setLeftActiveTabId: ce,
|
|
9311
9324
|
setRightActiveTabId: V
|
|
9312
9325
|
}), G = i(() => {
|
|
9313
|
-
let e = Ye.current, t =
|
|
9326
|
+
let e = Ye.current, t = fa[e], n = e === "left" ? C.currentPath : w.currentPath, r = (t === "left" ? be : xe).current, i = t === "left" ? ae : oe, a = t === "left" ? C : w;
|
|
9314
9327
|
i((e) => e.map((e) => e.id === r && e.type === "filelist" ? {
|
|
9315
9328
|
...e,
|
|
9316
9329
|
path: n
|
|
@@ -9321,7 +9334,7 @@ function Mo({ widget: e }) {
|
|
|
9321
9334
|
C,
|
|
9322
9335
|
w
|
|
9323
9336
|
]), K = i(() => {
|
|
9324
|
-
let e = Ye.current, t =
|
|
9337
|
+
let e = Ye.current, t = fa[e], n = e === "left" ? C.currentPath : w.currentPath, r = Pi(n), i = t === "left" ? ae : oe, a = t === "left" ? ce : V, o = t === "left" ? C : w;
|
|
9325
9338
|
i((e) => [...e, r]), a(r.id), o.navigateTo(n), E(t);
|
|
9326
9339
|
}, [
|
|
9327
9340
|
C.currentPath,
|
|
@@ -9331,7 +9344,7 @@ function Mo({ widget: e }) {
|
|
|
9331
9344
|
]), Et = i(() => {
|
|
9332
9345
|
let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
|
|
9333
9346
|
if (!r || r.type !== "folder") return;
|
|
9334
|
-
let i = r.path, a =
|
|
9347
|
+
let i = r.path, a = fa[e], o = (a === "left" ? be : xe).current, s = a === "left" ? ae : oe, c = a === "left" ? C : w;
|
|
9335
9348
|
s((e) => e.map((e) => e.id === o && e.type === "filelist" ? {
|
|
9336
9349
|
...e,
|
|
9337
9350
|
path: i
|
|
@@ -9344,7 +9357,7 @@ function Mo({ widget: e }) {
|
|
|
9344
9357
|
]), Dt = i(() => {
|
|
9345
9358
|
let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
|
|
9346
9359
|
if (!r || r.type !== "folder") return;
|
|
9347
|
-
let i = r.path, a =
|
|
9360
|
+
let i = r.path, a = fa[e], o = Pi(i), s = a === "left" ? ae : oe, c = a === "left" ? ce : V, l = a === "left" ? C : w;
|
|
9348
9361
|
s((e) => [...e, o]), c(o.id), l.navigateTo(i), E(a);
|
|
9349
9362
|
}, [
|
|
9350
9363
|
C.entries,
|
|
@@ -9354,7 +9367,7 @@ function Mo({ widget: e }) {
|
|
|
9354
9367
|
]), Ot = i(() => {
|
|
9355
9368
|
let e = Ye.current, t = e === "left" ? C.entries : w.entries, n = e === "left" ? le.current : ue.current, r = n ? t.find((e) => e.name === n) : void 0;
|
|
9356
9369
|
if (!r || r.type !== "file") return;
|
|
9357
|
-
let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c =
|
|
9370
|
+
let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c = fa[e], l = (c === "left" ? ve : ye).current, u = c === "left" ? ae : oe, d = c === "left" ? ce : V, f = l.find((e) => e.type === "preview" && e.isTemp);
|
|
9358
9371
|
if (f && f.type === "preview") u((e) => e.map((e) => e.id === f.id ? {
|
|
9359
9372
|
...e,
|
|
9360
9373
|
path: i,
|
|
@@ -9363,7 +9376,7 @@ function Mo({ widget: e }) {
|
|
|
9363
9376
|
sourcePanel: s
|
|
9364
9377
|
} : e)), d(f.id);
|
|
9365
9378
|
else {
|
|
9366
|
-
let e =
|
|
9379
|
+
let e = Fi(i, a, o, s);
|
|
9367
9380
|
u((t) => [...t, e]), d(e.id);
|
|
9368
9381
|
}
|
|
9369
9382
|
E(c);
|
|
@@ -9412,12 +9425,12 @@ function Mo({ widget: e }) {
|
|
|
9412
9425
|
if (!je) return;
|
|
9413
9426
|
let e = async (e, t, r) => {
|
|
9414
9427
|
let i = t?.currentPath ?? r;
|
|
9415
|
-
i && (await n.fs.exists(i) || (i = await
|
|
9428
|
+
i && (await n.fs.exists(i) || (i = await uo(n, i))), i ||= await n.utils.getHomePath(), await e.navigateTo(i);
|
|
9416
9429
|
};
|
|
9417
9430
|
e(C, Me), e(w, Re), ze && E(ze), setTimeout(() => {
|
|
9418
9431
|
He(void 0), Ue(void 0), Ke(void 0);
|
|
9419
9432
|
}, 500);
|
|
9420
|
-
}, [je]),
|
|
9433
|
+
}, [je]), ba({
|
|
9421
9434
|
settingsLoaded: je,
|
|
9422
9435
|
onRefreshPanels: () => {
|
|
9423
9436
|
$e.current.refresh(), et.current.refresh();
|
|
@@ -9425,11 +9438,11 @@ function Mo({ widget: e }) {
|
|
|
9425
9438
|
});
|
|
9426
9439
|
let Nt = i((e) => {
|
|
9427
9440
|
(Ye.current === "left" ? $e.current : et.current).navigateTo(e);
|
|
9428
|
-
}, []), Pt =
|
|
9441
|
+
}, []), Pt = ho({
|
|
9429
9442
|
activePanelCwd: T === "left" ? C.currentPath : w.currentPath,
|
|
9430
9443
|
onNavigatePanel: Nt
|
|
9431
9444
|
});
|
|
9432
|
-
|
|
9445
|
+
nt.current = Pt.activeCwd, io({
|
|
9433
9446
|
leftRef: $e,
|
|
9434
9447
|
rightRef: et,
|
|
9435
9448
|
onPreviewInOppositePanel: Ot,
|
|
@@ -9444,126 +9457,135 @@ function Mo({ widget: e }) {
|
|
|
9444
9457
|
onExecuteInTerminal: (e) => Pt.writeToTerminal(e),
|
|
9445
9458
|
editorFileSizeLimit: re
|
|
9446
9459
|
}), o(() => {
|
|
9447
|
-
let e =
|
|
9460
|
+
let e = t.current;
|
|
9461
|
+
if (!e) return;
|
|
9462
|
+
e.focus();
|
|
9463
|
+
let n = (e) => {
|
|
9448
9464
|
let t = e;
|
|
9449
9465
|
if (!t) return !1;
|
|
9450
9466
|
let n = t.tagName?.toLowerCase();
|
|
9451
9467
|
return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
|
|
9452
|
-
},
|
|
9453
|
-
let r = t.
|
|
9454
|
-
if (!
|
|
9455
|
-
let
|
|
9456
|
-
|
|
9468
|
+
}, r = (t) => {
|
|
9469
|
+
let r = t.target;
|
|
9470
|
+
if (!e || !r || !e.contains(r) || n(r)) return;
|
|
9471
|
+
let i = A.current;
|
|
9472
|
+
i !== "panel" && i !== "viewer" && i !== "editor" || H.handleKeyboardEvent(t);
|
|
9457
9473
|
};
|
|
9458
|
-
return
|
|
9474
|
+
return e.addEventListener("keydown", r, !0), () => e.removeEventListener("keydown", r, !0);
|
|
9459
9475
|
}, []), o(() => {
|
|
9460
9476
|
if (n.onReconnect) return n.onReconnect(() => {
|
|
9461
9477
|
$e.current.navigateTo(kt.current), et.current.navigateTo(At.current);
|
|
9462
9478
|
});
|
|
9463
|
-
}, [])
|
|
9464
|
-
|
|
9479
|
+
}, []);
|
|
9480
|
+
let Ft = null;
|
|
9481
|
+
return Ft = !C.currentPath || !w.currentPath || !_e ? /* @__PURE__ */ p("div", {
|
|
9482
|
+
className: Io.loading,
|
|
9465
9483
|
children: "Loading..."
|
|
9466
|
-
}) : /* @__PURE__ */ m(
|
|
9467
|
-
|
|
9468
|
-
className: jo.app,
|
|
9469
|
-
children: [
|
|
9470
|
-
/* @__PURE__ */ m(f, { children: [
|
|
9471
|
-
/* @__PURE__ */ m("div", {
|
|
9472
|
-
className: U["terminal-and-panels"],
|
|
9473
|
-
children: [/* @__PURE__ */ p("div", {
|
|
9474
|
-
className: U["terminal-background"],
|
|
9475
|
-
children: /* @__PURE__ */ p(oa, {})
|
|
9476
|
-
}), /* @__PURE__ */ m("div", {
|
|
9477
|
-
className: F(wi, "panels-overlay", !D && "hidden"),
|
|
9478
|
-
children: [/* @__PURE__ */ p(Wi, {
|
|
9479
|
-
side: "left",
|
|
9480
|
-
panel: C,
|
|
9481
|
-
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9482
|
-
selectionKey: Se,
|
|
9483
|
-
requestedActiveName: St,
|
|
9484
|
-
initialPanelState: Me,
|
|
9485
|
-
onStateChange: (e, t) => wt("left", e, t)
|
|
9486
|
-
}), /* @__PURE__ */ p(Wi, {
|
|
9487
|
-
side: "right",
|
|
9488
|
-
panel: w,
|
|
9489
|
-
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9490
|
-
selectionKey: Se,
|
|
9491
|
-
requestedActiveName: Ct,
|
|
9492
|
-
initialPanelState: Re,
|
|
9493
|
-
onStateChange: (e, t) => wt("right", e, t)
|
|
9494
|
-
})]
|
|
9495
|
-
})]
|
|
9496
|
-
}),
|
|
9497
|
-
/* @__PURE__ */ p(mt, {}),
|
|
9498
|
-
/* @__PURE__ */ p(aa, {})
|
|
9499
|
-
] }),
|
|
9484
|
+
}) : /* @__PURE__ */ m(f, { children: [
|
|
9485
|
+
/* @__PURE__ */ m(f, { children: [
|
|
9500
9486
|
/* @__PURE__ */ m("div", {
|
|
9501
|
-
className:
|
|
9502
|
-
children: [/* @__PURE__ */ p(
|
|
9503
|
-
|
|
9504
|
-
|
|
9505
|
-
|
|
9506
|
-
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9510
|
-
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9487
|
+
className: U["terminal-and-panels"],
|
|
9488
|
+
children: [/* @__PURE__ */ p("div", {
|
|
9489
|
+
className: U["terminal-background"],
|
|
9490
|
+
children: /* @__PURE__ */ p(da, {})
|
|
9491
|
+
}), /* @__PURE__ */ m("div", {
|
|
9492
|
+
className: F(ki, "panels-overlay", !D && "hidden"),
|
|
9493
|
+
children: [/* @__PURE__ */ p(Yi, {
|
|
9494
|
+
side: "left",
|
|
9495
|
+
panel: C,
|
|
9496
|
+
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9497
|
+
selectionKey: Se,
|
|
9498
|
+
requestedActiveName: St,
|
|
9499
|
+
initialPanelState: Me,
|
|
9500
|
+
onStateChange: (e, t) => wt("left", e, t)
|
|
9501
|
+
}), /* @__PURE__ */ p(Yi, {
|
|
9502
|
+
side: "right",
|
|
9503
|
+
panel: w,
|
|
9504
|
+
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9505
|
+
selectionKey: Se,
|
|
9506
|
+
requestedActiveName: Ct,
|
|
9507
|
+
initialPanelState: Re,
|
|
9508
|
+
onStateChange: (e, t) => wt("right", e, t)
|
|
9509
|
+
})]
|
|
9510
|
+
})]
|
|
9522
9511
|
}),
|
|
9523
|
-
|
|
9524
|
-
|
|
9525
|
-
|
|
9526
|
-
|
|
9527
|
-
|
|
9528
|
-
|
|
9529
|
-
|
|
9530
|
-
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9540
|
-
|
|
9541
|
-
|
|
9542
|
-
|
|
9543
|
-
|
|
9544
|
-
|
|
9545
|
-
|
|
9512
|
+
/* @__PURE__ */ p(mt, {}),
|
|
9513
|
+
/* @__PURE__ */ p(ua, {})
|
|
9514
|
+
] }),
|
|
9515
|
+
/* @__PURE__ */ m("div", {
|
|
9516
|
+
className: Io["status-bar"],
|
|
9517
|
+
children: [/* @__PURE__ */ p(tt, {}), e]
|
|
9518
|
+
}),
|
|
9519
|
+
O && !yt && /* @__PURE__ */ p(pe, {
|
|
9520
|
+
title: "No viewer",
|
|
9521
|
+
message: "No viewer extension found for this file type. Install viewer extensions (e.g. Image Viewer, File Viewer) from the extensions panel.",
|
|
9522
|
+
onClose: () => k(null)
|
|
9523
|
+
}),
|
|
9524
|
+
N && O && yt && /* @__PURE__ */ p(kn, {
|
|
9525
|
+
extensionDirPath: N.dirPath,
|
|
9526
|
+
entry: N.entry,
|
|
9527
|
+
filePath: O.path,
|
|
9528
|
+
fileName: O.name,
|
|
9529
|
+
fileSize: O.size,
|
|
9530
|
+
onClose: () => k(null),
|
|
9531
|
+
onExecuteCommand: vt
|
|
9532
|
+
}, `viewer:${N.dirPath}:${N.entry}`),
|
|
9533
|
+
j && !bt && /* @__PURE__ */ p(pe, {
|
|
9534
|
+
title: "No editor",
|
|
9535
|
+
message: "No editor extension found for this file type. Install an editor extension (e.g. Monaco Editor) from the extensions panel.",
|
|
9536
|
+
onClose: () => M(null)
|
|
9537
|
+
}),
|
|
9538
|
+
I && j && bt && (() => {
|
|
9539
|
+
let e = ge.flatMap((e) => e.languages ?? []), t = ge.flatMap((e) => e.grammarRefs ?? []).map((e) => ({
|
|
9540
|
+
contribution: e.contribution,
|
|
9541
|
+
path: e.path
|
|
9542
|
+
}));
|
|
9543
|
+
return /* @__PURE__ */ p(An, {
|
|
9544
|
+
extensionDirPath: I.dirPath,
|
|
9545
|
+
entry: I.entry,
|
|
9546
|
+
filePath: j.path,
|
|
9547
|
+
fileName: j.name,
|
|
9548
|
+
langId: j.langId,
|
|
9549
|
+
onClose: () => M(null),
|
|
9550
|
+
languages: e,
|
|
9551
|
+
grammars: t
|
|
9552
|
+
}, `editor:${I.dirPath}:${I.entry}`);
|
|
9553
|
+
})(),
|
|
9554
|
+
te && /* @__PURE__ */ p(wr, {}),
|
|
9555
|
+
/* @__PURE__ */ p(Ee, {}),
|
|
9556
|
+
/* @__PURE__ */ p(gt, {
|
|
9557
|
+
open: we.open,
|
|
9558
|
+
onOpenChange: we.setOpen
|
|
9559
|
+
})
|
|
9560
|
+
] }), /* @__PURE__ */ p("div", {
|
|
9561
|
+
ref: t,
|
|
9562
|
+
className: Io.app,
|
|
9563
|
+
tabIndex: 0,
|
|
9564
|
+
children: Ft
|
|
9546
9565
|
});
|
|
9547
9566
|
}
|
|
9548
9567
|
//#endregion
|
|
9549
9568
|
//#region lib/DotDir.tsx
|
|
9550
|
-
function
|
|
9551
|
-
let
|
|
9569
|
+
function Ro({ bridge: e, widget: t, resolveVfsUrl: n = $t }) {
|
|
9570
|
+
let r = u(null);
|
|
9552
9571
|
return o(() => {
|
|
9553
9572
|
H.registerContributions(je);
|
|
9554
|
-
}, []), o(() => {
|
|
9555
|
-
let e =
|
|
9573
|
+
}, []), o(() => en(n), [n]), o(() => {
|
|
9574
|
+
let e = r.current;
|
|
9556
9575
|
if (e) return Ut(e), () => {
|
|
9557
|
-
|
|
9576
|
+
r.current === e && Ut(null);
|
|
9558
9577
|
};
|
|
9559
9578
|
}, []), /* @__PURE__ */ p("div", {
|
|
9560
|
-
ref:
|
|
9561
|
-
className:
|
|
9562
|
-
children: /* @__PURE__ */ p(
|
|
9563
|
-
|
|
9564
|
-
children: /* @__PURE__ */ p(
|
|
9565
|
-
|
|
9579
|
+
ref: r,
|
|
9580
|
+
className: Io["dotdir-root"],
|
|
9581
|
+
children: /* @__PURE__ */ p(Yt.Provider, {
|
|
9582
|
+
value: n,
|
|
9583
|
+
children: /* @__PURE__ */ p(g, { children: /* @__PURE__ */ p(Ae, {
|
|
9584
|
+
bridge: e,
|
|
9585
|
+
children: /* @__PURE__ */ p(k, { children: /* @__PURE__ */ p(Ce, { children: /* @__PURE__ */ p(Lo, { widget: t }) }) })
|
|
9586
|
+
}) })
|
|
9587
|
+
})
|
|
9566
9588
|
});
|
|
9567
9589
|
}
|
|
9568
9590
|
//#endregion
|
|
9569
|
-
export {
|
|
9591
|
+
export { Ro as DotDir, q as basename, $t as defaultResolveVfsUrl, G as dirname, K as join, W as normalizePath };
|