@dotdirfm/ui 0.1.3 → 0.1.5
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 +827 -794
- package/dist/lib/features/extensions/extensionApi.d.ts +1 -196
- package/dist/lib/fileListHandlers.d.ts +1 -0
- package/package.json +4 -3
package/dist/dotdir.mjs
CHANGED
|
@@ -184,14 +184,14 @@ function F(e, ...t) {
|
|
|
184
184
|
}
|
|
185
185
|
//#endregion
|
|
186
186
|
//#region lib/styles/help-dialog.module.css
|
|
187
|
-
var
|
|
187
|
+
var I = {
|
|
188
188
|
"help-dialog": "_help-dialog_riri2_1",
|
|
189
189
|
"help-dialog-header": "_help-dialog-header_riri2_16",
|
|
190
190
|
"help-dialog-body": "_help-dialog-body_riri2_27",
|
|
191
191
|
"help-dialog-buttons": "_help-dialog-buttons_riri2_82"
|
|
192
|
-
},
|
|
193
|
-
function
|
|
194
|
-
return Array.from(e.querySelectorAll(
|
|
192
|
+
}, ee = "a[href],button,input,select,textarea,iframe,[tabindex]:not([tabindex=\"-1\"])";
|
|
193
|
+
function te(e) {
|
|
194
|
+
return Array.from(e.querySelectorAll(ee)).filter((e) => !e.hasAttribute("disabled") && e.tabIndex !== -1);
|
|
195
195
|
}
|
|
196
196
|
function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i = !0, placement: a = "center", initialFocusRef: s }) {
|
|
197
197
|
let c = u(null);
|
|
@@ -203,7 +203,7 @@ function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i
|
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
205
205
|
if (!t) return;
|
|
206
|
-
let [n] =
|
|
206
|
+
let [n] = te(t);
|
|
207
207
|
(n ?? t).focus();
|
|
208
208
|
});
|
|
209
209
|
return () => {
|
|
@@ -219,7 +219,7 @@ function L({ className: e, children: t, onClose: n, onKeyDown: r, dismissible: i
|
|
|
219
219
|
if (e.key !== "Tab") return;
|
|
220
220
|
let t = c.current;
|
|
221
221
|
if (!t) return;
|
|
222
|
-
let a =
|
|
222
|
+
let a = te(t);
|
|
223
223
|
if (a.length === 0) {
|
|
224
224
|
e.preventDefault(), t.focus();
|
|
225
225
|
return;
|
|
@@ -257,22 +257,22 @@ function ne({ content: e, onClose: t }) {
|
|
|
257
257
|
}, [t]);
|
|
258
258
|
let r = h.parse(e);
|
|
259
259
|
return /* @__PURE__ */ m(L, {
|
|
260
|
-
className:
|
|
260
|
+
className: I["help-dialog"],
|
|
261
261
|
onClose: t,
|
|
262
262
|
initialFocusRef: n,
|
|
263
263
|
children: [
|
|
264
264
|
/* @__PURE__ */ p("div", {
|
|
265
|
-
className:
|
|
265
|
+
className: I["help-dialog-header"],
|
|
266
266
|
children: "Help"
|
|
267
267
|
}),
|
|
268
268
|
/* @__PURE__ */ p("div", {
|
|
269
269
|
ref: n,
|
|
270
|
-
className:
|
|
270
|
+
className: I["help-dialog-body"],
|
|
271
271
|
tabIndex: 0,
|
|
272
272
|
dangerouslySetInnerHTML: { __html: r }
|
|
273
273
|
}),
|
|
274
274
|
/* @__PURE__ */ p("div", {
|
|
275
|
-
className:
|
|
275
|
+
className: I["help-dialog-buttons"],
|
|
276
276
|
children: /* @__PURE__ */ p("button", {
|
|
277
277
|
onClick: t,
|
|
278
278
|
children: "Close"
|
|
@@ -284,7 +284,7 @@ function ne({ content: e, onClose: t }) {
|
|
|
284
284
|
//#endregion
|
|
285
285
|
//#region lib/dialogs/dialogHotkeys.tsx
|
|
286
286
|
var re = n(null);
|
|
287
|
-
function
|
|
287
|
+
function ie(e) {
|
|
288
288
|
let t = Array.from(e.entries()).sort(([, e], [, t]) => e.label.length - t.label.length), n = /* @__PURE__ */ new Set(), r = /* @__PURE__ */ new Map();
|
|
289
289
|
for (let [e, { label: i }] of t) for (let t of i) {
|
|
290
290
|
let i = t.toLowerCase();
|
|
@@ -295,7 +295,7 @@ function R(e) {
|
|
|
295
295
|
}
|
|
296
296
|
return r;
|
|
297
297
|
}
|
|
298
|
-
function
|
|
298
|
+
function R(e, t) {
|
|
299
299
|
if (e.size !== t.size) return !1;
|
|
300
300
|
for (let [n, r] of e) if (t.get(n) !== r) return !1;
|
|
301
301
|
return !0;
|
|
@@ -312,8 +312,8 @@ function ae({ children: e, helpText: t }) {
|
|
|
312
312
|
n.current.delete(e), v((e) => e + 1);
|
|
313
313
|
}, []);
|
|
314
314
|
c(() => {
|
|
315
|
-
let e =
|
|
316
|
-
|
|
315
|
+
let e = ie(n.current);
|
|
316
|
+
R(e, s.current) || (s.current = e, a(e));
|
|
317
317
|
}, [_]), o(() => {
|
|
318
318
|
let e = (e) => {
|
|
319
319
|
if (e.key === "F1") {
|
|
@@ -393,12 +393,12 @@ function oe(e) {
|
|
|
393
393
|
function se(e) {
|
|
394
394
|
return e == null || !Number.isFinite(e) || e === 0 ? "—" : new Date(e).toLocaleString();
|
|
395
395
|
}
|
|
396
|
-
function
|
|
396
|
+
function ce(e) {
|
|
397
397
|
let t = e.lastIndexOf("/"), n = e.lastIndexOf("\\"), r = Math.max(t, n);
|
|
398
398
|
return r >= 0 ? e.slice(r + 1) : e;
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
let c = u(null), l = u(null), f = u(null), [h, g] = d(!1), [_, v] = d(
|
|
400
|
+
function B({ src: e, dest: t, srcSize: n, srcMtimeMs: r, destSize: i, destMtimeMs: a, onResolve: s }) {
|
|
401
|
+
let c = u(null), l = u(null), f = u(null), [h, g] = d(!1), [_, v] = d(ce(t)), { onKeyDown: y } = j(c, { defaultIndex: 0 }), { onKeyDown: b } = j(l, { defaultIndex: 1 });
|
|
402
402
|
return o(() => (A.push("modal"), () => {
|
|
403
403
|
A.pop("modal");
|
|
404
404
|
}), []), h ? /* @__PURE__ */ m(L, {
|
|
@@ -549,7 +549,7 @@ function V({ src: e, dest: t, srcSize: n, srcMtimeMs: r, destSize: i, destMtimeM
|
|
|
549
549
|
}
|
|
550
550
|
//#endregion
|
|
551
551
|
//#region lib/dialogs/CopyConfigDialog.tsx
|
|
552
|
-
function
|
|
552
|
+
function V({ itemCount: e, destPath: t, onConfirm: n, onCancel: r }) {
|
|
553
553
|
let i = u(null), [a, s] = d(t), [c, l] = d("ask"), [f, h] = d("smart"), [g, _] = d(!0), [v, y] = d(!1), [b, x] = d(!1), [S, C] = d(!1), [w, T] = d(!1), { onKeyDown: E } = j(i, { defaultIndex: 1 });
|
|
554
554
|
return o(() => (A.push("modal"), () => {
|
|
555
555
|
A.pop("modal");
|
|
@@ -1569,7 +1569,7 @@ function we(e, t) {
|
|
|
1569
1569
|
e.onCancel(), t.closeDialog();
|
|
1570
1570
|
}
|
|
1571
1571
|
});
|
|
1572
|
-
case "copyConfig": return /* @__PURE__ */ p(
|
|
1572
|
+
case "copyConfig": return /* @__PURE__ */ p(V, {
|
|
1573
1573
|
itemCount: e.itemCount,
|
|
1574
1574
|
destPath: e.destPath,
|
|
1575
1575
|
onConfirm: (t, n) => {
|
|
@@ -1587,7 +1587,7 @@ function we(e, t) {
|
|
|
1587
1587
|
currentFile: e.currentFile,
|
|
1588
1588
|
onCancel: e.onCancel
|
|
1589
1589
|
});
|
|
1590
|
-
case "copyConflict": return /* @__PURE__ */ p(
|
|
1590
|
+
case "copyConflict": return /* @__PURE__ */ p(B, {
|
|
1591
1591
|
src: e.src,
|
|
1592
1592
|
dest: e.dest,
|
|
1593
1593
|
srcSize: e.srcSize,
|
|
@@ -1631,7 +1631,7 @@ function we(e, t) {
|
|
|
1631
1631
|
currentFile: e.currentFile,
|
|
1632
1632
|
onCancel: e.onCancel
|
|
1633
1633
|
});
|
|
1634
|
-
case "moveConflict": return /* @__PURE__ */ p(
|
|
1634
|
+
case "moveConflict": return /* @__PURE__ */ p(B, {
|
|
1635
1635
|
src: e.src,
|
|
1636
1636
|
dest: e.dest,
|
|
1637
1637
|
srcSize: e.srcSize,
|
|
@@ -3605,8 +3605,17 @@ async function vn(e, t, n) {
|
|
|
3605
3605
|
}, mn(), i) : i;
|
|
3606
3606
|
}
|
|
3607
3607
|
//#endregion
|
|
3608
|
+
//#region lib/fileListHandlers.ts
|
|
3609
|
+
var yn = null;
|
|
3610
|
+
function bn(e) {
|
|
3611
|
+
yn = e;
|
|
3612
|
+
}
|
|
3613
|
+
function J() {
|
|
3614
|
+
return yn;
|
|
3615
|
+
}
|
|
3616
|
+
//#endregion
|
|
3608
3617
|
//#region lib/styles/viewers.module.css
|
|
3609
|
-
var
|
|
3618
|
+
var xn = {
|
|
3610
3619
|
"file-viewer": "_file-viewer_1gb4m_1",
|
|
3611
3620
|
"file-viewer-inline": "_file-viewer-inline_1gb4m_17",
|
|
3612
3621
|
"file-viewer-overlay": "_file-viewer-overlay_1gb4m_30",
|
|
@@ -3615,7 +3624,7 @@ var yn = {
|
|
|
3615
3624
|
};
|
|
3616
3625
|
//#endregion
|
|
3617
3626
|
//#region lib/components/ExtensionContainer.tsx
|
|
3618
|
-
async function
|
|
3627
|
+
async function Sn(e, t, n, r) {
|
|
3619
3628
|
let { containerFile: i, innerPath: a } = Wt(t), o = rn.resolve(q(i));
|
|
3620
3629
|
if (!o) throw Error(`No fsProvider registered for "${q(i)}"`);
|
|
3621
3630
|
if (o.contribution.runtime === "backend" && e.fsProvider) {
|
|
@@ -3626,7 +3635,7 @@ async function bn(e, t, n, r) {
|
|
|
3626
3635
|
if (!s.readFileRange) throw Error("Provider does not support readFileRange");
|
|
3627
3636
|
return s.readFileRange(i, a, n, r);
|
|
3628
3637
|
}
|
|
3629
|
-
function
|
|
3638
|
+
function Cn(e) {
|
|
3630
3639
|
let { extensionDirPath: t, entry: n, kind: r, props: a, onClose: s, className: c, style: l, active: f } = e, h = ke(), g = u(null), [_, v] = d(null), [y, b] = d(!0), x = u(s);
|
|
3631
3640
|
x.current = s;
|
|
3632
3641
|
let S = r === "viewer" && !!a.inline, C = r === "editor" || r === "viewer" && !S, w = u(null), T = u(!1), E = u(!1);
|
|
@@ -3695,11 +3704,11 @@ function xn(e) {
|
|
|
3695
3704
|
let M = i(() => ({
|
|
3696
3705
|
async readFile(e) {
|
|
3697
3706
|
let t = W(e);
|
|
3698
|
-
return Ut(t) ?
|
|
3707
|
+
return Ut(t) ? Sn(h, t, 0, 64 * 1024 * 1024) : h.fs.readFile(t);
|
|
3699
3708
|
},
|
|
3700
3709
|
async readFileRange(e, t, n) {
|
|
3701
3710
|
let r = W(e);
|
|
3702
|
-
if (Ut(r)) return
|
|
3711
|
+
if (Ut(r)) return Sn(h, r, t, n);
|
|
3703
3712
|
let i = D.current, a = i;
|
|
3704
3713
|
if (!a || a.path !== r) {
|
|
3705
3714
|
if (i) try {
|
|
@@ -3725,7 +3734,7 @@ function xn(e) {
|
|
|
3725
3734
|
async statFile(e) {
|
|
3726
3735
|
let t = W(e);
|
|
3727
3736
|
if (Ut(t)) return {
|
|
3728
|
-
size: (await
|
|
3737
|
+
size: (await Sn(h, t, 0, 64 * 1024 * 1024)).byteLength,
|
|
3729
3738
|
mtimeMs: 0
|
|
3730
3739
|
};
|
|
3731
3740
|
let n = await h.fs.stat(t), r = D.current;
|
|
@@ -4090,37 +4099,43 @@ function xn(e) {
|
|
|
4090
4099
|
})]
|
|
4091
4100
|
});
|
|
4092
4101
|
}
|
|
4093
|
-
function
|
|
4094
|
-
let
|
|
4102
|
+
function wn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize: a, inline: s, visible: c, onClose: d, onExecuteCommand: f }) {
|
|
4103
|
+
let h = u(!1), g = c ?? !0, _ = i(() => {
|
|
4104
|
+
requestAnimationFrame(() => {
|
|
4105
|
+
J()?.focus();
|
|
4106
|
+
});
|
|
4107
|
+
}, []), v = i(() => {
|
|
4108
|
+
d(), _();
|
|
4109
|
+
}, [d, _]);
|
|
4095
4110
|
o(() => {
|
|
4096
|
-
if (!
|
|
4097
|
-
if (
|
|
4098
|
-
else if (
|
|
4111
|
+
if (!s) {
|
|
4112
|
+
if (g) h.current ||= (A.push("viewer"), !0);
|
|
4113
|
+
else if (h.current) {
|
|
4099
4114
|
try {
|
|
4100
4115
|
A.pop("viewer");
|
|
4101
4116
|
} catch {}
|
|
4102
|
-
|
|
4117
|
+
h.current = !1;
|
|
4103
4118
|
}
|
|
4104
4119
|
}
|
|
4105
|
-
}, [
|
|
4106
|
-
if (
|
|
4120
|
+
}, [s, g]), o(() => () => {
|
|
4121
|
+
if (h.current) {
|
|
4107
4122
|
try {
|
|
4108
4123
|
A.pop("viewer");
|
|
4109
4124
|
} catch {}
|
|
4110
|
-
|
|
4125
|
+
h.current = !1;
|
|
4111
4126
|
}
|
|
4112
4127
|
}, []);
|
|
4113
|
-
let
|
|
4128
|
+
let y = l(() => ({
|
|
4114
4129
|
filePath: n,
|
|
4115
4130
|
fileName: r,
|
|
4116
|
-
fileSize:
|
|
4117
|
-
inline:
|
|
4131
|
+
fileSize: a,
|
|
4132
|
+
inline: s
|
|
4118
4133
|
}), [
|
|
4119
4134
|
n,
|
|
4120
4135
|
r,
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
]),
|
|
4136
|
+
a,
|
|
4137
|
+
s
|
|
4138
|
+
]), b = /* @__PURE__ */ m("div", {
|
|
4124
4139
|
style: {
|
|
4125
4140
|
display: "flex",
|
|
4126
4141
|
alignItems: "center",
|
|
@@ -4143,7 +4158,7 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4143
4158
|
}), /* @__PURE__ */ p("button", {
|
|
4144
4159
|
type: "button",
|
|
4145
4160
|
title: "Close (Esc)",
|
|
4146
|
-
onClick:
|
|
4161
|
+
onClick: v,
|
|
4147
4162
|
style: {
|
|
4148
4163
|
background: "transparent",
|
|
4149
4164
|
border: "none",
|
|
@@ -4156,21 +4171,21 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4156
4171
|
"aria-label": "Close",
|
|
4157
4172
|
children: "×"
|
|
4158
4173
|
})]
|
|
4159
|
-
}),
|
|
4174
|
+
}), x = /* @__PURE__ */ p(Cn, {
|
|
4160
4175
|
kind: "viewer",
|
|
4161
4176
|
extensionDirPath: e,
|
|
4162
4177
|
entry: t,
|
|
4163
|
-
props:
|
|
4164
|
-
active:
|
|
4165
|
-
onClose:
|
|
4166
|
-
onExecuteCommand:
|
|
4178
|
+
props: y,
|
|
4179
|
+
active: g,
|
|
4180
|
+
onClose: v,
|
|
4181
|
+
onExecuteCommand: f,
|
|
4167
4182
|
style: {
|
|
4168
4183
|
width: "100%",
|
|
4169
4184
|
height: "100%"
|
|
4170
4185
|
}
|
|
4171
4186
|
});
|
|
4172
|
-
return
|
|
4173
|
-
className: `${
|
|
4187
|
+
return s ? /* @__PURE__ */ p("div", {
|
|
4188
|
+
className: `${xn["file-viewer"]} ${xn["file-viewer-inline"]}`,
|
|
4174
4189
|
style: {
|
|
4175
4190
|
display: "flex",
|
|
4176
4191
|
flexDirection: "column",
|
|
@@ -4181,75 +4196,81 @@ function Sn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, fileSize:
|
|
|
4181
4196
|
flex: 1,
|
|
4182
4197
|
minHeight: 0
|
|
4183
4198
|
},
|
|
4184
|
-
children:
|
|
4199
|
+
children: x
|
|
4185
4200
|
})
|
|
4186
4201
|
}) : /* @__PURE__ */ p("div", {
|
|
4187
|
-
className:
|
|
4188
|
-
style: { display:
|
|
4202
|
+
className: xn["file-viewer-overlay"],
|
|
4203
|
+
style: { display: g ? "flex" : "none" },
|
|
4189
4204
|
children: /* @__PURE__ */ m("div", {
|
|
4190
|
-
className:
|
|
4205
|
+
className: xn["file-viewer"],
|
|
4191
4206
|
style: {
|
|
4192
4207
|
display: "flex",
|
|
4193
4208
|
flexDirection: "column",
|
|
4194
4209
|
padding: 0
|
|
4195
4210
|
},
|
|
4196
|
-
children: [
|
|
4211
|
+
children: [b, /* @__PURE__ */ p("div", {
|
|
4197
4212
|
style: {
|
|
4198
4213
|
flex: 1,
|
|
4199
4214
|
minHeight: 0
|
|
4200
4215
|
},
|
|
4201
|
-
children:
|
|
4216
|
+
children: x
|
|
4202
4217
|
})]
|
|
4203
4218
|
})
|
|
4204
4219
|
});
|
|
4205
4220
|
}
|
|
4206
|
-
function
|
|
4207
|
-
let [
|
|
4221
|
+
function Tn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: a, visible: s, onClose: c, onDirtyChange: h, languages: g, grammars: _ }) {
|
|
4222
|
+
let [v, y] = d(a), b = u(!1), x = s ?? !0, S = i(() => {
|
|
4223
|
+
requestAnimationFrame(() => {
|
|
4224
|
+
J()?.focus();
|
|
4225
|
+
});
|
|
4226
|
+
}, []), C = i(() => {
|
|
4227
|
+
c(), S();
|
|
4228
|
+
}, [c, S]);
|
|
4208
4229
|
o(() => {
|
|
4209
|
-
|
|
4210
|
-
}, [
|
|
4211
|
-
if (
|
|
4212
|
-
else if (
|
|
4230
|
+
y(a);
|
|
4231
|
+
}, [a]), o(() => {
|
|
4232
|
+
if (x) b.current ||= (A.push("editor"), !0);
|
|
4233
|
+
else if (b.current) {
|
|
4213
4234
|
try {
|
|
4214
4235
|
A.pop("editor");
|
|
4215
4236
|
} catch {}
|
|
4216
|
-
|
|
4237
|
+
b.current = !1;
|
|
4217
4238
|
}
|
|
4218
|
-
}, [
|
|
4219
|
-
if (
|
|
4239
|
+
}, [x]), o(() => () => {
|
|
4240
|
+
if (b.current) {
|
|
4220
4241
|
try {
|
|
4221
4242
|
A.pop("editor");
|
|
4222
4243
|
} catch {}
|
|
4223
|
-
|
|
4244
|
+
b.current = !1;
|
|
4224
4245
|
}
|
|
4225
4246
|
}, []);
|
|
4226
|
-
let
|
|
4247
|
+
let w = l(() => ({
|
|
4227
4248
|
filePath: n,
|
|
4228
4249
|
fileName: r,
|
|
4229
|
-
langId:
|
|
4250
|
+
langId: v,
|
|
4230
4251
|
extensionDirPath: e,
|
|
4231
|
-
languages:
|
|
4232
|
-
grammars:
|
|
4252
|
+
languages: g,
|
|
4253
|
+
grammars: _,
|
|
4233
4254
|
inline: !1
|
|
4234
4255
|
}), [
|
|
4235
4256
|
n,
|
|
4236
4257
|
r,
|
|
4237
|
-
|
|
4258
|
+
v,
|
|
4238
4259
|
e,
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
]),
|
|
4260
|
+
g,
|
|
4261
|
+
_
|
|
4262
|
+
]), T = (e) => {
|
|
4242
4263
|
let t = e.target.value;
|
|
4243
|
-
|
|
4244
|
-
},
|
|
4245
|
-
let e =
|
|
4264
|
+
y(t);
|
|
4265
|
+
}, E = l(() => {
|
|
4266
|
+
let e = g ?? [], t = /* @__PURE__ */ new Set();
|
|
4246
4267
|
return e.filter((e) => t.has(e.id) ? !1 : (t.add(e.id), !0));
|
|
4247
|
-
}, [
|
|
4268
|
+
}, [g]), D = E.length > 0;
|
|
4248
4269
|
return /* @__PURE__ */ p("div", {
|
|
4249
|
-
className:
|
|
4250
|
-
style: { display:
|
|
4270
|
+
className: xn["file-editor-overlay"],
|
|
4271
|
+
style: { display: x ? "flex" : "none" },
|
|
4251
4272
|
children: /* @__PURE__ */ m("div", {
|
|
4252
|
-
className:
|
|
4273
|
+
className: xn["file-editor"],
|
|
4253
4274
|
style: {
|
|
4254
4275
|
display: "flex",
|
|
4255
4276
|
flexDirection: "column",
|
|
@@ -4277,14 +4298,14 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
|
|
|
4277
4298
|
title: r,
|
|
4278
4299
|
children: r
|
|
4279
4300
|
}),
|
|
4280
|
-
|
|
4301
|
+
D && /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p("label", {
|
|
4281
4302
|
htmlFor: "editor-lang-select",
|
|
4282
4303
|
style: { whiteSpace: "nowrap" },
|
|
4283
4304
|
children: "Language:"
|
|
4284
4305
|
}), /* @__PURE__ */ m("select", {
|
|
4285
4306
|
id: "editor-lang-select",
|
|
4286
|
-
value:
|
|
4287
|
-
onChange:
|
|
4307
|
+
value: v,
|
|
4308
|
+
onChange: T,
|
|
4288
4309
|
style: {
|
|
4289
4310
|
minWidth: 120,
|
|
4290
4311
|
padding: "2px 6px"
|
|
@@ -4292,7 +4313,7 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
|
|
|
4292
4313
|
children: [/* @__PURE__ */ p("option", {
|
|
4293
4314
|
value: "plaintext",
|
|
4294
4315
|
children: "Plain Text"
|
|
4295
|
-
}),
|
|
4316
|
+
}), E.map((e) => /* @__PURE__ */ p("option", {
|
|
4296
4317
|
value: e.id,
|
|
4297
4318
|
children: e.aliases?.[0] ?? e.id
|
|
4298
4319
|
}, e.id))]
|
|
@@ -4300,7 +4321,7 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
|
|
|
4300
4321
|
/* @__PURE__ */ p("button", {
|
|
4301
4322
|
type: "button",
|
|
4302
4323
|
title: "Close (Esc)",
|
|
4303
|
-
onClick:
|
|
4324
|
+
onClick: C,
|
|
4304
4325
|
style: {
|
|
4305
4326
|
background: "transparent",
|
|
4306
4327
|
border: "none",
|
|
@@ -4319,14 +4340,14 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
|
|
|
4319
4340
|
flex: 1,
|
|
4320
4341
|
minHeight: 0
|
|
4321
4342
|
},
|
|
4322
|
-
children: /* @__PURE__ */ p(
|
|
4343
|
+
children: /* @__PURE__ */ p(Cn, {
|
|
4323
4344
|
kind: "editor",
|
|
4324
4345
|
extensionDirPath: e,
|
|
4325
4346
|
entry: t,
|
|
4326
|
-
props:
|
|
4327
|
-
active:
|
|
4328
|
-
onClose:
|
|
4329
|
-
onDirtyChange:
|
|
4347
|
+
props: w,
|
|
4348
|
+
active: x,
|
|
4349
|
+
onClose: C,
|
|
4350
|
+
onDirtyChange: h,
|
|
4330
4351
|
style: {
|
|
4331
4352
|
width: "100%",
|
|
4332
4353
|
height: "100%"
|
|
@@ -4338,22 +4359,22 @@ function Cn({ extensionDirPath: e, entry: t, filePath: n, fileName: r, langId: i
|
|
|
4338
4359
|
}
|
|
4339
4360
|
//#endregion
|
|
4340
4361
|
//#region lib/features/extensions/extensionHost.worker.ts?worker&inline
|
|
4341
|
-
var
|
|
4342
|
-
function
|
|
4362
|
+
var En = "(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))}}})();", Dn = typeof self < "u" && self.Blob && new Blob(["(self.URL || self.webkitURL).revokeObjectURL(self.location.href);", En], { type: "text/javascript;charset=utf-8" });
|
|
4363
|
+
function On(e) {
|
|
4343
4364
|
let t;
|
|
4344
4365
|
try {
|
|
4345
|
-
if (t =
|
|
4366
|
+
if (t = Dn && (self.URL || self.webkitURL).createObjectURL(Dn), !t) throw "";
|
|
4346
4367
|
let n = new Worker(t, { name: e?.name });
|
|
4347
4368
|
return n.addEventListener("error", () => {
|
|
4348
4369
|
(self.URL || self.webkitURL).revokeObjectURL(t);
|
|
4349
4370
|
}), n;
|
|
4350
4371
|
} catch {
|
|
4351
|
-
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(
|
|
4372
|
+
return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(En), { name: e?.name });
|
|
4352
4373
|
}
|
|
4353
4374
|
}
|
|
4354
4375
|
//#endregion
|
|
4355
4376
|
//#region lib/features/extensions/extensionHostClient.ts
|
|
4356
|
-
var
|
|
4377
|
+
var kn = class {
|
|
4357
4378
|
worker = null;
|
|
4358
4379
|
homePath = null;
|
|
4359
4380
|
listeners = [];
|
|
@@ -4402,7 +4423,7 @@ var Dn = class {
|
|
|
4402
4423
|
});
|
|
4403
4424
|
}
|
|
4404
4425
|
spawnWorker() {
|
|
4405
|
-
let e = new
|
|
4426
|
+
let e = new On();
|
|
4406
4427
|
e.onmessage = (t) => {
|
|
4407
4428
|
let n = t.data;
|
|
4408
4429
|
if (n.type === "readFile") this.handleFileRead(e, n.id, n.path);
|
|
@@ -4455,25 +4476,25 @@ var Dn = class {
|
|
|
4455
4476
|
});
|
|
4456
4477
|
}
|
|
4457
4478
|
}
|
|
4458
|
-
},
|
|
4479
|
+
}, An = _((e) => {
|
|
4459
4480
|
let t = e(Oe);
|
|
4460
4481
|
if (!t) throw Error("Bridge not initialized.");
|
|
4461
|
-
return new
|
|
4482
|
+
return new kn(t);
|
|
4462
4483
|
});
|
|
4463
|
-
function
|
|
4464
|
-
return y(
|
|
4484
|
+
function jn() {
|
|
4485
|
+
return y(An);
|
|
4465
4486
|
}
|
|
4466
4487
|
//#endregion
|
|
4467
4488
|
//#region lib/features/extensions/extensions.ts
|
|
4468
|
-
var
|
|
4469
|
-
function
|
|
4489
|
+
var Mn = "https://dotdir.dev";
|
|
4490
|
+
function Nn(e) {
|
|
4470
4491
|
return `${e.publisher}-${e.name}-${e.version}`;
|
|
4471
4492
|
}
|
|
4472
|
-
async function
|
|
4493
|
+
async function Pn(e) {
|
|
4473
4494
|
return K(await e.utils.getHomePath(), ".dotdir", "extensions");
|
|
4474
4495
|
}
|
|
4475
|
-
async function
|
|
4476
|
-
let t = await
|
|
4496
|
+
async function Fn(e) {
|
|
4497
|
+
let t = await Pn(e);
|
|
4477
4498
|
try {
|
|
4478
4499
|
let n = await Nt(e, K(t, "extensions.json")), r = JSON.parse(n);
|
|
4479
4500
|
return Array.isArray(r) ? r : [];
|
|
@@ -4481,21 +4502,21 @@ async function Nn(e) {
|
|
|
4481
4502
|
return [];
|
|
4482
4503
|
}
|
|
4483
4504
|
}
|
|
4484
|
-
async function
|
|
4485
|
-
let n = await
|
|
4505
|
+
async function In(e, t) {
|
|
4506
|
+
let n = await Pn(e);
|
|
4486
4507
|
await e.fs.writeFile(K(n, "extensions.json"), JSON.stringify(t, null, 2));
|
|
4487
4508
|
}
|
|
4488
|
-
async function
|
|
4509
|
+
async function Ln(e = "", t = 1) {
|
|
4489
4510
|
let n = new URLSearchParams({
|
|
4490
4511
|
page: String(t),
|
|
4491
4512
|
pageSize: "30"
|
|
4492
4513
|
});
|
|
4493
4514
|
e && n.set("q", e);
|
|
4494
|
-
let r = await fetch(`${
|
|
4515
|
+
let r = await fetch(`${Mn}/api/extensions/search?${n}`);
|
|
4495
4516
|
if (!r.ok) throw Error("Failed to search marketplace");
|
|
4496
4517
|
return r.json();
|
|
4497
4518
|
}
|
|
4498
|
-
async function
|
|
4519
|
+
async function Rn(e) {
|
|
4499
4520
|
let t = new DecompressionStream("deflate-raw"), n = t.writable.getWriter(), r = t.readable.getReader();
|
|
4500
4521
|
n.write(e), n.close();
|
|
4501
4522
|
let i = [];
|
|
@@ -4508,7 +4529,7 @@ async function In(e) {
|
|
|
4508
4529
|
for (let e of i) o.set(e, s), s += e.length;
|
|
4509
4530
|
return o;
|
|
4510
4531
|
}
|
|
4511
|
-
async function
|
|
4532
|
+
async function zn(e) {
|
|
4512
4533
|
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;
|
|
4513
4534
|
for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
|
|
4514
4535
|
a = e;
|
|
@@ -4521,13 +4542,13 @@ async function Ln(e) {
|
|
|
4521
4542
|
if (c += 46 + o + s + l, d.endsWith("/")) continue;
|
|
4522
4543
|
let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
|
|
4523
4544
|
if (e === 0) g = h;
|
|
4524
|
-
else if (e === 8) g = await
|
|
4545
|
+
else if (e === 8) g = await Rn(h);
|
|
4525
4546
|
else continue;
|
|
4526
4547
|
n.set(d, g);
|
|
4527
4548
|
}
|
|
4528
4549
|
return n;
|
|
4529
4550
|
}
|
|
4530
|
-
function
|
|
4551
|
+
function Bn(e) {
|
|
4531
4552
|
let t = [...e];
|
|
4532
4553
|
if (t.length === 0) return "";
|
|
4533
4554
|
let n = t[0], r = n.indexOf("/");
|
|
@@ -4535,22 +4556,22 @@ function Rn(e) {
|
|
|
4535
4556
|
let i = n.slice(0, r + 1);
|
|
4536
4557
|
return t.every((e) => e.startsWith(i)) ? i : "";
|
|
4537
4558
|
}
|
|
4538
|
-
async function
|
|
4539
|
-
let i = `${
|
|
4559
|
+
async function Vn(e, t, n, r) {
|
|
4560
|
+
let i = `${Mn}/api/extensions/${t}/${n}/${r}/download`, a = await fetch(i);
|
|
4540
4561
|
if (!a.ok) throw Error(`Download failed: ${a.statusText}`);
|
|
4541
|
-
let o = await
|
|
4562
|
+
let o = await zn(await a.arrayBuffer()), s = await Pn(e), c = {
|
|
4542
4563
|
publisher: t,
|
|
4543
4564
|
name: n,
|
|
4544
4565
|
version: r
|
|
4545
|
-
}, l = K(s,
|
|
4566
|
+
}, l = K(s, Nn(c)), u = Bn(o.keys());
|
|
4546
4567
|
for (let [t, n] of o) {
|
|
4547
4568
|
let r = u ? t.slice(u.length) : t;
|
|
4548
4569
|
r && await e.fs.writeBinaryFile(K(l, r), n);
|
|
4549
4570
|
}
|
|
4550
|
-
let d = (await
|
|
4551
|
-
d.push(c), await
|
|
4571
|
+
let d = (await Fn(e)).filter((e) => !(e.publisher === t && e.name === n));
|
|
4572
|
+
d.push(c), await In(e, d);
|
|
4552
4573
|
}
|
|
4553
|
-
async function
|
|
4574
|
+
async function Hn(e) {
|
|
4554
4575
|
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;
|
|
4555
4576
|
for (let e = t.length - 22; e >= Math.max(0, t.length - 65557); e--) if (i(e) === 101010256) {
|
|
4556
4577
|
a = e;
|
|
@@ -4563,14 +4584,14 @@ async function Bn(e) {
|
|
|
4563
4584
|
if (c += 46 + o + s + l, d.endsWith("/") || !d.startsWith("extension/")) continue;
|
|
4564
4585
|
let f = r(u + 26), p = r(u + 28), m = u + 30 + f + p, h = t.slice(m, m + a), g;
|
|
4565
4586
|
if (e === 0) g = h;
|
|
4566
|
-
else if (e === 8) g = await
|
|
4587
|
+
else if (e === 8) g = await Rn(h);
|
|
4567
4588
|
else continue;
|
|
4568
4589
|
let _ = d.slice(10);
|
|
4569
4590
|
_ && n.set(_, g);
|
|
4570
4591
|
}
|
|
4571
4592
|
return n;
|
|
4572
4593
|
}
|
|
4573
|
-
async function
|
|
4594
|
+
async function Un(e, t, n, r) {
|
|
4574
4595
|
let i = new AbortController(), a = setTimeout(() => i.abort(), 3e4), o;
|
|
4575
4596
|
try {
|
|
4576
4597
|
o = await fetch(r, { signal: i.signal });
|
|
@@ -4580,13 +4601,13 @@ async function Vn(e, t, n, r) {
|
|
|
4580
4601
|
throw Error(`Download failed: ${t}`);
|
|
4581
4602
|
}
|
|
4582
4603
|
if (clearTimeout(a), !o.ok) throw Error(`Download failed: ${o.status} ${o.statusText}`);
|
|
4583
|
-
let s = await
|
|
4604
|
+
let s = await Hn(await o.arrayBuffer()), c = s.get("package.json");
|
|
4584
4605
|
if (!c) throw Error("Invalid VSIX: no package.json");
|
|
4585
|
-
let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await
|
|
4606
|
+
let l = JSON.parse(new TextDecoder().decode(c)).version || "0.0.0", u = await Pn(e), d = {
|
|
4586
4607
|
publisher: t,
|
|
4587
4608
|
name: n,
|
|
4588
4609
|
version: l
|
|
4589
|
-
}, f = K(u,
|
|
4610
|
+
}, f = K(u, Nn(d));
|
|
4590
4611
|
for (let [t, n] of s) {
|
|
4591
4612
|
let r = K(f, t), i = t.split(".").pop()?.toLowerCase() ?? "";
|
|
4592
4613
|
[
|
|
@@ -4604,10 +4625,10 @@ async function Vn(e, t, n, r) {
|
|
|
4604
4625
|
"tmGrammar"
|
|
4605
4626
|
].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);
|
|
4606
4627
|
}
|
|
4607
|
-
let p = (await
|
|
4608
|
-
p.push(d), await
|
|
4628
|
+
let p = (await Fn(e)).filter((e) => !(e.publisher === t && e.name === n));
|
|
4629
|
+
p.push(d), await In(e, p);
|
|
4609
4630
|
}
|
|
4610
|
-
async function
|
|
4631
|
+
async function Wn(e, t) {
|
|
4611
4632
|
if (!await e.fs.exists(t)) return;
|
|
4612
4633
|
let n = await e.fs.delete.start([t]);
|
|
4613
4634
|
await new Promise((t, r) => {
|
|
@@ -4618,19 +4639,19 @@ async function Hn(e, t) {
|
|
|
4618
4639
|
});
|
|
4619
4640
|
});
|
|
4620
4641
|
}
|
|
4621
|
-
async function
|
|
4622
|
-
let r = await
|
|
4623
|
-
i && !i.path && await
|
|
4642
|
+
async function Gn(e, t, n) {
|
|
4643
|
+
let r = await Fn(e), i = r.find((e) => e.publisher === t && e.name === n);
|
|
4644
|
+
i && !i.path && await Wn(e, K(await Pn(e), Nn(i))), await In(e, r.filter((e) => !(e.publisher === t && e.name === n)));
|
|
4624
4645
|
}
|
|
4625
|
-
function
|
|
4646
|
+
function Kn(e) {
|
|
4626
4647
|
return e.iconThemeFss || e.iconThemeFssPath || e.vscodeIconThemePath ? `${e.ref.publisher}.${e.ref.name}` : null;
|
|
4627
4648
|
}
|
|
4628
|
-
function
|
|
4649
|
+
function qn(e, t) {
|
|
4629
4650
|
return `${e.ref.publisher}.${e.ref.name}:${t}`;
|
|
4630
4651
|
}
|
|
4631
|
-
function
|
|
4652
|
+
function Jn(e, t) {
|
|
4632
4653
|
for (let n of e) if (n.colorThemes) {
|
|
4633
|
-
for (let e of n.colorThemes) if (
|
|
4654
|
+
for (let e of n.colorThemes) if (qn(n, e.id) === t) return {
|
|
4634
4655
|
ext: n,
|
|
4635
4656
|
theme: e
|
|
4636
4657
|
};
|
|
@@ -4639,8 +4660,8 @@ function Kn(e, t) {
|
|
|
4639
4660
|
}
|
|
4640
4661
|
//#endregion
|
|
4641
4662
|
//#region lib/features/marketplace/vscodeMarketplace.ts
|
|
4642
|
-
var
|
|
4643
|
-
async function
|
|
4663
|
+
var Yn = "https://marketplace.visualstudio.com/_apis/public/gallery";
|
|
4664
|
+
async function Xn(e, t = 1) {
|
|
4644
4665
|
let n = {
|
|
4645
4666
|
filters: [{
|
|
4646
4667
|
criteria: [{
|
|
@@ -4657,7 +4678,7 @@ async function Jn(e, t = 1) {
|
|
|
4657
4678
|
}],
|
|
4658
4679
|
assetTypes: [],
|
|
4659
4680
|
flags: 914
|
|
4660
|
-
}, r = await fetch(`${
|
|
4681
|
+
}, r = await fetch(`${Yn}/extensionquery`, {
|
|
4661
4682
|
method: "POST",
|
|
4662
4683
|
headers: {
|
|
4663
4684
|
"Content-Type": "application/json",
|
|
@@ -4672,23 +4693,23 @@ async function Jn(e, t = 1) {
|
|
|
4672
4693
|
total: i.length
|
|
4673
4694
|
};
|
|
4674
4695
|
}
|
|
4675
|
-
function
|
|
4696
|
+
function Zn(e) {
|
|
4676
4697
|
return e.statistics?.find((e) => e.statisticName === "install")?.value ?? 0;
|
|
4677
4698
|
}
|
|
4678
|
-
function
|
|
4699
|
+
function Qn(e) {
|
|
4679
4700
|
return e.versions?.[0]?.version ?? null;
|
|
4680
4701
|
}
|
|
4681
|
-
function
|
|
4702
|
+
function $n(e) {
|
|
4682
4703
|
let t = e.versions?.[0];
|
|
4683
4704
|
return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.VSIXPackage` : null;
|
|
4684
4705
|
}
|
|
4685
|
-
function
|
|
4706
|
+
function er(e) {
|
|
4686
4707
|
let t = e.versions?.[0];
|
|
4687
4708
|
return t ? `${t.assetUri}/Microsoft.VisualStudio.Services.Icons.Default` : null;
|
|
4688
4709
|
}
|
|
4689
4710
|
//#endregion
|
|
4690
4711
|
//#region lib/jsoncFileWatcher.ts
|
|
4691
|
-
async function
|
|
4712
|
+
async function tr(e, t) {
|
|
4692
4713
|
let { name: n, getPath: r, validate: i, defaultValue: a, onLoad: o } = t, s = a, c = null, l = null, u = null, d = /* @__PURE__ */ new Set();
|
|
4693
4714
|
function f() {
|
|
4694
4715
|
for (let e of d) try {
|
|
@@ -4747,46 +4768,46 @@ async function $n(e, t) {
|
|
|
4747
4768
|
}
|
|
4748
4769
|
//#endregion
|
|
4749
4770
|
//#region lib/features/settings/userSettings.ts
|
|
4750
|
-
var
|
|
4751
|
-
function
|
|
4771
|
+
var nr = null, rr = null, ir = null;
|
|
4772
|
+
function ar(e) {
|
|
4752
4773
|
return typeof e != "object" || !e || Array.isArray(e) ? (console.error("[userSettings] settings.json must be an object"), null) : e;
|
|
4753
4774
|
}
|
|
4754
|
-
function
|
|
4755
|
-
if (!
|
|
4775
|
+
function or(e, t) {
|
|
4776
|
+
if (!nr) return;
|
|
4756
4777
|
let n = {
|
|
4757
|
-
...
|
|
4778
|
+
...nr.getValue(),
|
|
4758
4779
|
...t
|
|
4759
4780
|
};
|
|
4760
|
-
|
|
4761
|
-
|
|
4781
|
+
nr.setValue(n), ir && clearTimeout(ir), ir = setTimeout(() => {
|
|
4782
|
+
ir = null, sr(e, n);
|
|
4762
4783
|
}, 500);
|
|
4763
4784
|
}
|
|
4764
|
-
async function
|
|
4785
|
+
async function sr(e, t) {
|
|
4765
4786
|
try {
|
|
4766
|
-
|
|
4787
|
+
rr ||= K(await e.utils.getHomePath(), ".dotdir", "settings.json"), await e.fs.writeFile(rr, JSON.stringify(t, null, 2));
|
|
4767
4788
|
} catch (e) {
|
|
4768
4789
|
console.error("[userSettings] Failed to save settings:", e);
|
|
4769
4790
|
}
|
|
4770
4791
|
}
|
|
4771
|
-
function
|
|
4772
|
-
return
|
|
4792
|
+
function cr(e) {
|
|
4793
|
+
return nr?.onChange(e) ?? (() => {});
|
|
4773
4794
|
}
|
|
4774
|
-
async function
|
|
4775
|
-
return
|
|
4795
|
+
async function lr(e) {
|
|
4796
|
+
return nr = await tr(e, {
|
|
4776
4797
|
name: "userSettings",
|
|
4777
4798
|
getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "settings.json"),
|
|
4778
|
-
validate:
|
|
4799
|
+
validate: ar,
|
|
4779
4800
|
defaultValue: {}
|
|
4780
|
-
}),
|
|
4801
|
+
}), nr.getValue();
|
|
4781
4802
|
}
|
|
4782
4803
|
//#endregion
|
|
4783
4804
|
//#region lib/features/settings/useUserSettings.ts
|
|
4784
|
-
var
|
|
4785
|
-
function
|
|
4786
|
-
let e = y(
|
|
4787
|
-
return o(() => (
|
|
4805
|
+
var ur = _({}), dr = _(!1), fr = null;
|
|
4806
|
+
function pr() {
|
|
4807
|
+
let e = y(ur), t = y(dr), n = b(ur), r = b(dr), a = ke();
|
|
4808
|
+
return o(() => (fr ||= lr(a), fr.then((e) => {
|
|
4788
4809
|
n(e), r(!0);
|
|
4789
|
-
}),
|
|
4810
|
+
}), cr(n)), [
|
|
4790
4811
|
n,
|
|
4791
4812
|
r,
|
|
4792
4813
|
a
|
|
@@ -4797,20 +4818,20 @@ function dr() {
|
|
|
4797
4818
|
n((t) => ({
|
|
4798
4819
|
...t,
|
|
4799
4820
|
...e
|
|
4800
|
-
})),
|
|
4821
|
+
})), or(a, e);
|
|
4801
4822
|
}, [n])
|
|
4802
4823
|
};
|
|
4803
4824
|
}
|
|
4804
4825
|
//#endregion
|
|
4805
4826
|
//#region lib/styles/extensions.module.css
|
|
4806
|
-
var
|
|
4827
|
+
var mr = "_active_jpq35_71", hr = "_install_jpq35_261", gr = "_uninstall_jpq35_266", _r = "_installed_jpq35_276", Y = {
|
|
4807
4828
|
"ext-panel": "_ext-panel_jpq35_1",
|
|
4808
4829
|
"ext-panel-header": "_ext-panel-header_jpq35_17",
|
|
4809
4830
|
"ext-panel-title": "_ext-panel-title_jpq35_28",
|
|
4810
4831
|
"ext-panel-close": "_ext-panel-close_jpq35_34",
|
|
4811
4832
|
"ext-panel-tabs": "_ext-panel-tabs_jpq35_49",
|
|
4812
4833
|
"ext-tab": "_ext-tab_jpq35_55",
|
|
4813
|
-
active:
|
|
4834
|
+
active: mr,
|
|
4814
4835
|
"ext-search": "_ext-search_jpq35_76",
|
|
4815
4836
|
"ext-source-selector": "_ext-source-selector_jpq35_82",
|
|
4816
4837
|
"ext-source-btn": "_ext-source-btn_jpq35_88",
|
|
@@ -4827,102 +4848,102 @@ var fr = "_active_jpq35_71", pr = "_install_jpq35_261", mr = "_uninstall_jpq35_2
|
|
|
4827
4848
|
"ext-theme-badge": "_ext-theme-badge_jpq35_223",
|
|
4828
4849
|
"ext-actions": "_ext-actions_jpq35_234",
|
|
4829
4850
|
"ext-btn": "_ext-btn_jpq35_241",
|
|
4830
|
-
install:
|
|
4831
|
-
uninstall:
|
|
4832
|
-
installed:
|
|
4851
|
+
install: hr,
|
|
4852
|
+
uninstall: gr,
|
|
4853
|
+
installed: _r,
|
|
4833
4854
|
"ext-color-themes": "_ext-color-themes_jpq35_281",
|
|
4834
4855
|
"ext-color-theme-btn": "_ext-color-theme-btn_jpq35_288",
|
|
4835
4856
|
"ext-color-theme-indicator": "_ext-color-theme-indicator_jpq35_296"
|
|
4836
4857
|
};
|
|
4837
4858
|
//#endregion
|
|
4838
4859
|
//#region lib/components/ExtensionsPanel.tsx
|
|
4839
|
-
function
|
|
4860
|
+
function vr(e) {
|
|
4840
4861
|
return e instanceof Error ? e.message : e && typeof e == "object" && "message" in e ? String(e.message) : String(e);
|
|
4841
4862
|
}
|
|
4842
|
-
function
|
|
4843
|
-
let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f =
|
|
4863
|
+
function yr() {
|
|
4864
|
+
let e = ke(), t = b(Ne), [n, r] = v(Pe), [a, s] = v(Fe), c = y(Ie), l = u(null), f = jn(), [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 } = pr();
|
|
4844
4865
|
o(() => (A.push("modal"), () => {
|
|
4845
4866
|
A.pop("modal");
|
|
4846
4867
|
}), [t]);
|
|
4847
4868
|
let re = i(async (e, t) => {
|
|
4848
|
-
k(!0),
|
|
4869
|
+
k(!0), I("");
|
|
4849
4870
|
try {
|
|
4850
|
-
t === "vscode" ? (D((await
|
|
4871
|
+
t === "vscode" ? (D((await Xn(e)).extensions), T([])) : (T((await Ln(e)).extensions), D([]));
|
|
4851
4872
|
} catch {
|
|
4852
|
-
|
|
4873
|
+
I(`Could not reach ${t === "vscode" ? "VS Code" : ".dir"} marketplace`);
|
|
4853
4874
|
}
|
|
4854
4875
|
k(!1);
|
|
4855
4876
|
}, []);
|
|
4856
4877
|
o(() => {
|
|
4857
4878
|
re("", _);
|
|
4858
4879
|
}, [re, _]);
|
|
4859
|
-
let
|
|
4860
|
-
C(e),
|
|
4861
|
-
},
|
|
4862
|
-
let n =
|
|
4880
|
+
let ie = (e) => {
|
|
4881
|
+
C(e), ee.current && clearTimeout(ee.current), ee.current = setTimeout(() => re(e, _), 300);
|
|
4882
|
+
}, R = async (t) => {
|
|
4883
|
+
let n = $n(t);
|
|
4863
4884
|
if (n) {
|
|
4864
|
-
N(`${t.publisher.publisherName}.${t.extensionName}`),
|
|
4885
|
+
N(`${t.publisher.publisherName}.${t.extensionName}`), I("");
|
|
4865
4886
|
try {
|
|
4866
|
-
await
|
|
4887
|
+
await Un(e, t.publisher.publisherName, t.extensionName, n), f.restart();
|
|
4867
4888
|
} catch (e) {
|
|
4868
|
-
|
|
4889
|
+
I(`Install failed: ${vr(e)}`);
|
|
4869
4890
|
}
|
|
4870
4891
|
N(null);
|
|
4871
4892
|
}
|
|
4872
4893
|
}, ae = new Set(c.map((e) => `${e.ref.publisher}.${e.ref.name}`)), z = async (t) => {
|
|
4873
4894
|
if (t.latest_version) {
|
|
4874
|
-
N(`${t.publisher.username}.${t.name}`),
|
|
4895
|
+
N(`${t.publisher.username}.${t.name}`), I("");
|
|
4875
4896
|
try {
|
|
4876
|
-
await
|
|
4897
|
+
await Vn(e, t.publisher.username, t.name, t.latest_version.version), f.restart();
|
|
4877
4898
|
} catch (e) {
|
|
4878
|
-
|
|
4899
|
+
I(`Install failed: ${vr(e)}`);
|
|
4879
4900
|
}
|
|
4880
4901
|
N(null);
|
|
4881
4902
|
}
|
|
4882
4903
|
}, oe = async (t) => {
|
|
4883
4904
|
let i = `${t.publisher}.${t.name}`;
|
|
4884
|
-
N(i),
|
|
4905
|
+
N(i), I("");
|
|
4885
4906
|
try {
|
|
4886
|
-
await
|
|
4907
|
+
await Gn(e, t.publisher, t.name);
|
|
4887
4908
|
let o = !1;
|
|
4888
|
-
n === i && (delete
|
|
4909
|
+
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();
|
|
4889
4910
|
} catch (e) {
|
|
4890
|
-
|
|
4911
|
+
I(`Uninstall failed: ${vr(e)}`);
|
|
4891
4912
|
}
|
|
4892
4913
|
N(null);
|
|
4893
4914
|
}, se = async (e) => {
|
|
4894
|
-
let t =
|
|
4915
|
+
let t = Kn(e);
|
|
4895
4916
|
if (!t) return;
|
|
4896
4917
|
let i = t === n ? void 0 : t;
|
|
4897
|
-
i ?
|
|
4898
|
-
},
|
|
4899
|
-
let n =
|
|
4900
|
-
r ?
|
|
4901
|
-
},
|
|
4918
|
+
i ? te.iconTheme = i : delete te.iconTheme, ne(te), r(i);
|
|
4919
|
+
}, ce = async (e, t) => {
|
|
4920
|
+
let n = qn(e, t), r = n === a ? void 0 : n;
|
|
4921
|
+
r ? te.colorTheme = r : delete te.colorTheme, ne(te), s(r);
|
|
4922
|
+
}, B = (e) => e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(0)} KB` : `${(e / 1024 / 1024).toFixed(1)} MB`;
|
|
4902
4923
|
return /* @__PURE__ */ m(L, {
|
|
4903
|
-
className:
|
|
4924
|
+
className: Y["ext-panel"],
|
|
4904
4925
|
onClose: () => t(!1),
|
|
4905
4926
|
initialFocusRef: l,
|
|
4906
4927
|
children: [
|
|
4907
4928
|
/* @__PURE__ */ m("div", {
|
|
4908
|
-
className:
|
|
4929
|
+
className: Y["ext-panel-header"],
|
|
4909
4930
|
children: [/* @__PURE__ */ p("span", {
|
|
4910
|
-
className:
|
|
4931
|
+
className: Y["ext-panel-title"],
|
|
4911
4932
|
children: "Extensions"
|
|
4912
4933
|
}), /* @__PURE__ */ p("button", {
|
|
4913
|
-
className:
|
|
4934
|
+
className: Y["ext-panel-close"],
|
|
4914
4935
|
onClick: () => t(!1),
|
|
4915
4936
|
children: "✕"
|
|
4916
4937
|
})]
|
|
4917
4938
|
}),
|
|
4918
4939
|
/* @__PURE__ */ m("div", {
|
|
4919
|
-
className:
|
|
4940
|
+
className: Y["ext-panel-tabs"],
|
|
4920
4941
|
children: [/* @__PURE__ */ p("button", {
|
|
4921
|
-
className: F(
|
|
4942
|
+
className: F(Y, "ext-tab", h === "marketplace" && "active"),
|
|
4922
4943
|
onClick: () => g("marketplace"),
|
|
4923
4944
|
children: "Marketplace"
|
|
4924
4945
|
}), /* @__PURE__ */ m("button", {
|
|
4925
|
-
className: F(
|
|
4946
|
+
className: F(Y, "ext-tab", h === "installed" && "active"),
|
|
4926
4947
|
onClick: () => g("installed"),
|
|
4927
4948
|
children: [
|
|
4928
4949
|
"Installed (",
|
|
@@ -4932,17 +4953,17 @@ function _r() {
|
|
|
4932
4953
|
})]
|
|
4933
4954
|
}),
|
|
4934
4955
|
h === "marketplace" && /* @__PURE__ */ m("div", {
|
|
4935
|
-
className:
|
|
4956
|
+
className: Y["ext-search"],
|
|
4936
4957
|
children: [/* @__PURE__ */ m("div", {
|
|
4937
|
-
className:
|
|
4958
|
+
className: Y["ext-source-selector"],
|
|
4938
4959
|
children: [/* @__PURE__ */ p("button", {
|
|
4939
|
-
className: F(
|
|
4960
|
+
className: F(Y, "ext-source-btn", _ === "vscode" && "active"),
|
|
4940
4961
|
onClick: () => {
|
|
4941
4962
|
x("vscode"), C("");
|
|
4942
4963
|
},
|
|
4943
4964
|
children: "VS Code"
|
|
4944
4965
|
}), /* @__PURE__ */ p("button", {
|
|
4945
|
-
className: F(
|
|
4966
|
+
className: F(Y, "ext-source-btn", _ === "dotdir" && "active"),
|
|
4946
4967
|
onClick: () => {
|
|
4947
4968
|
x("dotdir"), C("");
|
|
4948
4969
|
},
|
|
@@ -4953,30 +4974,30 @@ function _r() {
|
|
|
4953
4974
|
type: "text",
|
|
4954
4975
|
placeholder: "Search extensions...",
|
|
4955
4976
|
value: S,
|
|
4956
|
-
onChange: (e) =>
|
|
4977
|
+
onChange: (e) => ie(e.target.value),
|
|
4957
4978
|
...M
|
|
4958
4979
|
})]
|
|
4959
4980
|
}),
|
|
4960
4981
|
P && /* @__PURE__ */ p("div", {
|
|
4961
|
-
className:
|
|
4982
|
+
className: Y["ext-error"],
|
|
4962
4983
|
children: P
|
|
4963
4984
|
}),
|
|
4964
4985
|
/* @__PURE__ */ m("div", {
|
|
4965
|
-
className:
|
|
4986
|
+
className: Y["ext-list"],
|
|
4966
4987
|
children: [
|
|
4967
4988
|
h === "marketplace" && _ === "dotdir" && (O ? /* @__PURE__ */ p("div", {
|
|
4968
|
-
className:
|
|
4989
|
+
className: Y["ext-empty"],
|
|
4969
4990
|
children: "Searching..."
|
|
4970
4991
|
}) : w.length === 0 ? /* @__PURE__ */ p("div", {
|
|
4971
|
-
className:
|
|
4992
|
+
className: Y["ext-empty"],
|
|
4972
4993
|
children: "No extensions found"
|
|
4973
4994
|
}) : w.map((e) => {
|
|
4974
4995
|
let t = `${e.publisher.username}.${e.name}`, n = ae.has(t), r = j === t;
|
|
4975
4996
|
return /* @__PURE__ */ m("div", {
|
|
4976
|
-
className:
|
|
4997
|
+
className: Y["ext-item"],
|
|
4977
4998
|
children: [
|
|
4978
4999
|
/* @__PURE__ */ p("div", {
|
|
4979
|
-
className:
|
|
5000
|
+
className: Y["ext-icon"],
|
|
4980
5001
|
children: e.icon_url ? /* @__PURE__ */ p("img", {
|
|
4981
5002
|
src: e.icon_url,
|
|
4982
5003
|
width: 36,
|
|
@@ -4985,38 +5006,38 @@ function _r() {
|
|
|
4985
5006
|
}) : e.display_name[0]?.toUpperCase() ?? "?"
|
|
4986
5007
|
}),
|
|
4987
5008
|
/* @__PURE__ */ m("div", {
|
|
4988
|
-
className:
|
|
5009
|
+
className: Y["ext-info"],
|
|
4989
5010
|
children: [
|
|
4990
5011
|
/* @__PURE__ */ p("div", {
|
|
4991
|
-
className:
|
|
5012
|
+
className: Y["ext-name"],
|
|
4992
5013
|
children: e.display_name
|
|
4993
5014
|
}),
|
|
4994
5015
|
/* @__PURE__ */ p("div", {
|
|
4995
|
-
className:
|
|
5016
|
+
className: Y["ext-publisher"],
|
|
4996
5017
|
children: e.publisher.display_name || e.publisher.username
|
|
4997
5018
|
}),
|
|
4998
5019
|
/* @__PURE__ */ p("div", {
|
|
4999
|
-
className:
|
|
5020
|
+
className: Y["ext-desc"],
|
|
5000
5021
|
children: e.description
|
|
5001
5022
|
}),
|
|
5002
5023
|
/* @__PURE__ */ m("div", {
|
|
5003
|
-
className:
|
|
5024
|
+
className: Y["ext-meta"],
|
|
5004
5025
|
children: [
|
|
5005
5026
|
e.latest_version && /* @__PURE__ */ m("span", { children: ["v", e.latest_version.version] }),
|
|
5006
|
-
e.latest_version && /* @__PURE__ */ p("span", { children:
|
|
5027
|
+
e.latest_version && /* @__PURE__ */ p("span", { children: B(e.latest_version.archive_size) }),
|
|
5007
5028
|
/* @__PURE__ */ m("span", { children: ["↓ ", e.total_downloads] })
|
|
5008
5029
|
]
|
|
5009
5030
|
})
|
|
5010
5031
|
]
|
|
5011
5032
|
}),
|
|
5012
5033
|
/* @__PURE__ */ p("div", {
|
|
5013
|
-
className:
|
|
5034
|
+
className: Y["ext-actions"],
|
|
5014
5035
|
children: n ? /* @__PURE__ */ p("button", {
|
|
5015
|
-
className: F(
|
|
5036
|
+
className: F(Y, "ext-btn", "installed"),
|
|
5016
5037
|
disabled: !0,
|
|
5017
5038
|
children: "Installed"
|
|
5018
5039
|
}) : /* @__PURE__ */ p("button", {
|
|
5019
|
-
className: F(
|
|
5040
|
+
className: F(Y, "ext-btn", "install"),
|
|
5020
5041
|
disabled: r || !e.latest_version,
|
|
5021
5042
|
onClick: () => z(e),
|
|
5022
5043
|
children: r ? "Installing..." : "Install"
|
|
@@ -5026,18 +5047,18 @@ function _r() {
|
|
|
5026
5047
|
}, e.id);
|
|
5027
5048
|
})),
|
|
5028
5049
|
h === "marketplace" && _ === "vscode" && (O ? /* @__PURE__ */ p("div", {
|
|
5029
|
-
className:
|
|
5050
|
+
className: Y["ext-empty"],
|
|
5030
5051
|
children: "Searching..."
|
|
5031
5052
|
}) : E.length === 0 ? /* @__PURE__ */ p("div", {
|
|
5032
|
-
className:
|
|
5053
|
+
className: Y["ext-empty"],
|
|
5033
5054
|
children: "No extensions found"
|
|
5034
5055
|
}) : E.map((e) => {
|
|
5035
|
-
let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i =
|
|
5056
|
+
let t = `${e.publisher.publisherName}.${e.extensionName}`, n = ae.has(t), r = j === t, i = Qn(e), a = er(e), o = Zn(e);
|
|
5036
5057
|
return /* @__PURE__ */ m("div", {
|
|
5037
|
-
className:
|
|
5058
|
+
className: Y["ext-item"],
|
|
5038
5059
|
children: [
|
|
5039
5060
|
/* @__PURE__ */ p("div", {
|
|
5040
|
-
className:
|
|
5061
|
+
className: Y["ext-icon"],
|
|
5041
5062
|
children: a ? /* @__PURE__ */ p("img", {
|
|
5042
5063
|
src: a,
|
|
5043
5064
|
width: 36,
|
|
@@ -5046,36 +5067,36 @@ function _r() {
|
|
|
5046
5067
|
}) : e.displayName[0]?.toUpperCase() ?? "?"
|
|
5047
5068
|
}),
|
|
5048
5069
|
/* @__PURE__ */ m("div", {
|
|
5049
|
-
className:
|
|
5070
|
+
className: Y["ext-info"],
|
|
5050
5071
|
children: [
|
|
5051
5072
|
/* @__PURE__ */ p("div", {
|
|
5052
|
-
className:
|
|
5073
|
+
className: Y["ext-name"],
|
|
5053
5074
|
children: e.displayName
|
|
5054
5075
|
}),
|
|
5055
5076
|
/* @__PURE__ */ p("div", {
|
|
5056
|
-
className:
|
|
5077
|
+
className: Y["ext-publisher"],
|
|
5057
5078
|
children: e.publisher.displayName || e.publisher.publisherName
|
|
5058
5079
|
}),
|
|
5059
5080
|
/* @__PURE__ */ p("div", {
|
|
5060
|
-
className:
|
|
5081
|
+
className: Y["ext-desc"],
|
|
5061
5082
|
children: e.shortDescription
|
|
5062
5083
|
}),
|
|
5063
5084
|
/* @__PURE__ */ m("div", {
|
|
5064
|
-
className:
|
|
5085
|
+
className: Y["ext-meta"],
|
|
5065
5086
|
children: [i && /* @__PURE__ */ m("span", { children: ["v", i] }), /* @__PURE__ */ m("span", { children: ["↓ ", o.toLocaleString()] })]
|
|
5066
5087
|
})
|
|
5067
5088
|
]
|
|
5068
5089
|
}),
|
|
5069
5090
|
/* @__PURE__ */ p("div", {
|
|
5070
|
-
className:
|
|
5091
|
+
className: Y["ext-actions"],
|
|
5071
5092
|
children: n ? /* @__PURE__ */ p("button", {
|
|
5072
|
-
className: F(
|
|
5093
|
+
className: F(Y, "ext-btn", "installed"),
|
|
5073
5094
|
disabled: !0,
|
|
5074
5095
|
children: "Installed"
|
|
5075
5096
|
}) : /* @__PURE__ */ p("button", {
|
|
5076
|
-
className: F(
|
|
5097
|
+
className: F(Y, "ext-btn", "install"),
|
|
5077
5098
|
disabled: r || !i,
|
|
5078
|
-
onClick: () =>
|
|
5099
|
+
onClick: () => R(e),
|
|
5079
5100
|
children: r ? "Installing..." : "Install"
|
|
5080
5101
|
})
|
|
5081
5102
|
})
|
|
@@ -5083,15 +5104,15 @@ function _r() {
|
|
|
5083
5104
|
}, t);
|
|
5084
5105
|
})),
|
|
5085
5106
|
h === "installed" && (c.length === 0 ? /* @__PURE__ */ p("div", {
|
|
5086
|
-
className:
|
|
5107
|
+
className: Y["ext-empty"],
|
|
5087
5108
|
children: "No extensions installed"
|
|
5088
5109
|
}) : c.map((e) => {
|
|
5089
|
-
let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i =
|
|
5110
|
+
let t = `${e.ref.publisher}.${e.ref.name}`, r = j === t, i = Kn(e), o = i != null && i === n, s = e.colorThemes && e.colorThemes.length > 0;
|
|
5090
5111
|
return /* @__PURE__ */ m("div", {
|
|
5091
|
-
className:
|
|
5112
|
+
className: Y["ext-item"],
|
|
5092
5113
|
children: [
|
|
5093
5114
|
/* @__PURE__ */ p("div", {
|
|
5094
|
-
className:
|
|
5115
|
+
className: Y["ext-icon"],
|
|
5095
5116
|
children: e.iconUrl ? /* @__PURE__ */ p("img", {
|
|
5096
5117
|
src: e.iconUrl,
|
|
5097
5118
|
width: 36,
|
|
@@ -5100,30 +5121,30 @@ function _r() {
|
|
|
5100
5121
|
}) : (e.manifest.displayName || e.manifest.name)[0]?.toUpperCase() ?? "?"
|
|
5101
5122
|
}),
|
|
5102
5123
|
/* @__PURE__ */ m("div", {
|
|
5103
|
-
className:
|
|
5124
|
+
className: Y["ext-info"],
|
|
5104
5125
|
children: [
|
|
5105
5126
|
/* @__PURE__ */ p("div", {
|
|
5106
|
-
className:
|
|
5127
|
+
className: Y["ext-name"],
|
|
5107
5128
|
children: e.manifest.displayName || e.manifest.name
|
|
5108
5129
|
}),
|
|
5109
5130
|
/* @__PURE__ */ p("div", {
|
|
5110
|
-
className:
|
|
5131
|
+
className: Y["ext-publisher"],
|
|
5111
5132
|
children: e.manifest.publisher
|
|
5112
5133
|
}),
|
|
5113
5134
|
/* @__PURE__ */ p("div", {
|
|
5114
|
-
className:
|
|
5135
|
+
className: Y["ext-desc"],
|
|
5115
5136
|
children: e.manifest.description || ""
|
|
5116
5137
|
}),
|
|
5117
5138
|
/* @__PURE__ */ m("div", {
|
|
5118
|
-
className:
|
|
5139
|
+
className: Y["ext-meta"],
|
|
5119
5140
|
children: [
|
|
5120
5141
|
/* @__PURE__ */ m("span", { children: ["v", e.ref.version] }),
|
|
5121
5142
|
i && /* @__PURE__ */ p("span", {
|
|
5122
|
-
className: F(
|
|
5143
|
+
className: F(Y, "ext-theme-badge", o && "active"),
|
|
5123
5144
|
children: o ? "● Icon theme" : "Icon theme"
|
|
5124
5145
|
}),
|
|
5125
5146
|
s && /* @__PURE__ */ m("span", {
|
|
5126
|
-
className:
|
|
5147
|
+
className: Y["ext-theme-badge"],
|
|
5127
5148
|
children: [
|
|
5128
5149
|
e.colorThemes.length,
|
|
5129
5150
|
" color theme",
|
|
@@ -5131,7 +5152,7 @@ function _r() {
|
|
|
5131
5152
|
]
|
|
5132
5153
|
}),
|
|
5133
5154
|
e.languages && e.languages.length > 0 && /* @__PURE__ */ m("span", {
|
|
5134
|
-
className:
|
|
5155
|
+
className: Y["ext-theme-badge"],
|
|
5135
5156
|
children: [
|
|
5136
5157
|
e.languages.length,
|
|
5137
5158
|
" language",
|
|
@@ -5139,7 +5160,7 @@ function _r() {
|
|
|
5139
5160
|
]
|
|
5140
5161
|
}),
|
|
5141
5162
|
e.grammarRefs && e.grammarRefs.length > 0 && /* @__PURE__ */ m("span", {
|
|
5142
|
-
className:
|
|
5163
|
+
className: Y["ext-theme-badge"],
|
|
5143
5164
|
children: [
|
|
5144
5165
|
e.grammarRefs.length,
|
|
5145
5166
|
" grammar",
|
|
@@ -5149,15 +5170,15 @@ function _r() {
|
|
|
5149
5170
|
]
|
|
5150
5171
|
}),
|
|
5151
5172
|
s && /* @__PURE__ */ p("div", {
|
|
5152
|
-
className:
|
|
5173
|
+
className: Y["ext-color-themes"],
|
|
5153
5174
|
children: e.colorThemes.map((t) => {
|
|
5154
|
-
let n =
|
|
5175
|
+
let n = qn(e, t.id) === a;
|
|
5155
5176
|
return /* @__PURE__ */ m("button", {
|
|
5156
|
-
className: F(
|
|
5157
|
-
onClick: () =>
|
|
5177
|
+
className: F(Y, "ext-btn", "ext-color-theme-btn", n ? "installed" : "install"),
|
|
5178
|
+
onClick: () => ce(e, t.id),
|
|
5158
5179
|
children: [
|
|
5159
5180
|
/* @__PURE__ */ p("span", {
|
|
5160
|
-
className:
|
|
5181
|
+
className: Y["ext-color-theme-indicator"],
|
|
5161
5182
|
"data-ui-theme": t.uiTheme
|
|
5162
5183
|
}),
|
|
5163
5184
|
t.label,
|
|
@@ -5169,13 +5190,13 @@ function _r() {
|
|
|
5169
5190
|
]
|
|
5170
5191
|
}),
|
|
5171
5192
|
/* @__PURE__ */ m("div", {
|
|
5172
|
-
className:
|
|
5193
|
+
className: Y["ext-actions"],
|
|
5173
5194
|
children: [i && /* @__PURE__ */ p("button", {
|
|
5174
|
-
className: F(
|
|
5195
|
+
className: F(Y, "ext-btn", o ? "installed" : "install"),
|
|
5175
5196
|
onClick: () => se(e),
|
|
5176
5197
|
children: o ? "Deactivate" : "Activate"
|
|
5177
5198
|
}), /* @__PURE__ */ p("button", {
|
|
5178
|
-
className: F(
|
|
5199
|
+
className: F(Y, "ext-btn", "uninstall"),
|
|
5179
5200
|
disabled: r,
|
|
5180
5201
|
onClick: () => oe(e.ref),
|
|
5181
5202
|
children: r ? "Removing..." : "Uninstall"
|
|
@@ -5189,7 +5210,7 @@ function _r() {
|
|
|
5189
5210
|
]
|
|
5190
5211
|
});
|
|
5191
5212
|
}
|
|
5192
|
-
var
|
|
5213
|
+
var X = new class {
|
|
5193
5214
|
tail = Promise.resolve();
|
|
5194
5215
|
enqueue(e) {
|
|
5195
5216
|
this.tail = this.tail.then(async () => {
|
|
@@ -5199,72 +5220,72 @@ var Y = new class {
|
|
|
5199
5220
|
} catch {}
|
|
5200
5221
|
});
|
|
5201
5222
|
}
|
|
5202
|
-
}(),
|
|
5203
|
-
function
|
|
5223
|
+
}(), br = 200, xr = /* @__PURE__ */ new Map(), Sr = /* @__PURE__ */ new Map();
|
|
5224
|
+
function Cr(e) {
|
|
5204
5225
|
return e.startsWith("/") || /^[A-Za-z]:/.test(e);
|
|
5205
5226
|
}
|
|
5206
|
-
function
|
|
5227
|
+
function wr(e) {
|
|
5207
5228
|
return `data:image/svg+xml,${encodeURIComponent(e)}`;
|
|
5208
5229
|
}
|
|
5209
|
-
function
|
|
5210
|
-
let t =
|
|
5211
|
-
t !== void 0 && (
|
|
5230
|
+
function Tr(e) {
|
|
5231
|
+
let t = xr.get(e);
|
|
5232
|
+
t !== void 0 && (xr.delete(e), xr.set(e, t));
|
|
5212
5233
|
}
|
|
5213
|
-
function
|
|
5214
|
-
for (;
|
|
5215
|
-
let e =
|
|
5216
|
-
|
|
5234
|
+
function Er() {
|
|
5235
|
+
for (; xr.size > br;) {
|
|
5236
|
+
let e = xr.keys().next().value;
|
|
5237
|
+
xr.delete(e);
|
|
5217
5238
|
}
|
|
5218
5239
|
}
|
|
5219
|
-
async function
|
|
5240
|
+
async function Dr(e, t) {
|
|
5220
5241
|
let n = W(t);
|
|
5221
5242
|
try {
|
|
5222
5243
|
let r = await Nt(e, n);
|
|
5223
|
-
|
|
5244
|
+
xr.set(t, wr(r)), Er();
|
|
5224
5245
|
} catch (e) {
|
|
5225
5246
|
throw console.warn("[IconCache] loadIconAbsolute failed", n, e), e;
|
|
5226
5247
|
}
|
|
5227
5248
|
}
|
|
5228
|
-
async function
|
|
5249
|
+
async function Or(e) {
|
|
5229
5250
|
let t = await fetch(`/icons/${e}`);
|
|
5230
5251
|
if (!t.ok) return;
|
|
5231
5252
|
let n = await t.text();
|
|
5232
|
-
|
|
5253
|
+
xr.set(e, wr(n)), Er();
|
|
5233
5254
|
}
|
|
5234
|
-
function
|
|
5255
|
+
function kr(e) {
|
|
5235
5256
|
return e === "_default" || e.startsWith("_default_");
|
|
5236
5257
|
}
|
|
5237
|
-
async function
|
|
5258
|
+
async function Ar(e, t) {
|
|
5238
5259
|
let n = [];
|
|
5239
5260
|
for (let r of t) {
|
|
5240
|
-
if (
|
|
5241
|
-
if (
|
|
5242
|
-
n.push(
|
|
5261
|
+
if (kr(r) || xr.has(r)) continue;
|
|
5262
|
+
if (Sr.has(r)) {
|
|
5263
|
+
n.push(Sr.get(r));
|
|
5243
5264
|
continue;
|
|
5244
5265
|
}
|
|
5245
5266
|
let t = (async () => {
|
|
5246
5267
|
try {
|
|
5247
|
-
|
|
5268
|
+
Cr(r) ? await Dr(e, r) : await Or(r);
|
|
5248
5269
|
} catch (e) {
|
|
5249
5270
|
console.warn("[IconCache] loadIcons failed for", r.slice(-60), e);
|
|
5250
5271
|
} finally {
|
|
5251
|
-
|
|
5272
|
+
Sr.delete(r);
|
|
5252
5273
|
}
|
|
5253
5274
|
})();
|
|
5254
|
-
|
|
5275
|
+
Sr.set(r, t), n.push(t);
|
|
5255
5276
|
}
|
|
5256
5277
|
await Promise.all(n);
|
|
5257
5278
|
}
|
|
5258
|
-
function
|
|
5259
|
-
let t =
|
|
5260
|
-
return t !== void 0 &&
|
|
5279
|
+
function jr(e) {
|
|
5280
|
+
let t = xr.get(e);
|
|
5281
|
+
return t !== void 0 && Tr(e), t;
|
|
5261
5282
|
}
|
|
5262
5283
|
//#endregion
|
|
5263
5284
|
//#region lib/features/file-icons/vscodeIconTheme.ts
|
|
5264
|
-
function
|
|
5285
|
+
function Mr(e) {
|
|
5265
5286
|
return `data:image/svg+xml,${encodeURIComponent(e)}`;
|
|
5266
5287
|
}
|
|
5267
|
-
var
|
|
5288
|
+
var Nr = class {
|
|
5268
5289
|
theme = null;
|
|
5269
5290
|
loadingIcons = /* @__PURE__ */ new Map();
|
|
5270
5291
|
themeKind = "dark";
|
|
@@ -5329,7 +5350,7 @@ var jr = class {
|
|
|
5329
5350
|
let r = (async () => {
|
|
5330
5351
|
try {
|
|
5331
5352
|
let t = await Mt(this.bridge, e), n = e.split(".").pop()?.toLowerCase() ?? "", r;
|
|
5332
|
-
if (n === "svg") r =
|
|
5353
|
+
if (n === "svg") r = Mr(new TextDecoder().decode(t));
|
|
5333
5354
|
else {
|
|
5334
5355
|
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 });
|
|
5335
5356
|
r = URL.createObjectURL(i);
|
|
@@ -5349,51 +5370,51 @@ var jr = class {
|
|
|
5349
5370
|
getCachedIcon(e) {
|
|
5350
5371
|
return this.theme?.iconCache.get(e) ?? null;
|
|
5351
5372
|
}
|
|
5352
|
-
},
|
|
5373
|
+
}, Pr = _((e) => {
|
|
5353
5374
|
let t = e(Oe);
|
|
5354
5375
|
if (!t) throw Error("Bridge not initialized.");
|
|
5355
|
-
return new
|
|
5376
|
+
return new Nr(t);
|
|
5356
5377
|
});
|
|
5357
|
-
function
|
|
5358
|
-
return y(
|
|
5378
|
+
function Fr() {
|
|
5379
|
+
return y(Pr);
|
|
5359
5380
|
}
|
|
5360
5381
|
//#endregion
|
|
5361
5382
|
//#region lib/features/file-icons/iconResolver.ts
|
|
5362
|
-
var
|
|
5383
|
+
var Ir = {
|
|
5363
5384
|
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",
|
|
5364
5385
|
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",
|
|
5365
5386
|
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"
|
|
5366
|
-
},
|
|
5367
|
-
function
|
|
5368
|
-
let e =
|
|
5387
|
+
}, Lr = "fss", Rr = [];
|
|
5388
|
+
function zr() {
|
|
5389
|
+
let e = Fr();
|
|
5369
5390
|
return { setIconTheme: async (t, n) => {
|
|
5370
|
-
if (
|
|
5371
|
-
await e.load(n),
|
|
5391
|
+
if (Lr = t, t === "vscode" && n) try {
|
|
5392
|
+
await e.load(n), Hr();
|
|
5372
5393
|
} catch {
|
|
5373
|
-
|
|
5394
|
+
Lr = "none", Hr();
|
|
5374
5395
|
}
|
|
5375
|
-
else e.clear(),
|
|
5396
|
+
else e.clear(), Hr();
|
|
5376
5397
|
} };
|
|
5377
5398
|
}
|
|
5378
|
-
function
|
|
5379
|
-
let e =
|
|
5399
|
+
function Br() {
|
|
5400
|
+
let e = Fr();
|
|
5380
5401
|
return { setIconThemeKind: (t) => {
|
|
5381
5402
|
e.setTheme(t);
|
|
5382
5403
|
} };
|
|
5383
5404
|
}
|
|
5384
|
-
function
|
|
5385
|
-
return
|
|
5386
|
-
|
|
5405
|
+
function Vr(e) {
|
|
5406
|
+
return Rr.push(e), () => {
|
|
5407
|
+
Rr = Rr.filter((t) => t !== e);
|
|
5387
5408
|
};
|
|
5388
5409
|
}
|
|
5389
|
-
function
|
|
5390
|
-
for (let e of
|
|
5410
|
+
function Hr() {
|
|
5411
|
+
for (let e of Rr) e();
|
|
5391
5412
|
}
|
|
5392
|
-
function
|
|
5393
|
-
let e =
|
|
5413
|
+
function Ur() {
|
|
5414
|
+
let e = Fr();
|
|
5394
5415
|
return (t, n, r, i, a, o) => {
|
|
5395
|
-
let s = n ? r ?
|
|
5396
|
-
if (
|
|
5416
|
+
let s = n ? r ? Ir.folderOpen : Ir.folder : Ir.file;
|
|
5417
|
+
if (Lr === "vscode" && e.isLoaded()) {
|
|
5397
5418
|
let o = e.resolveIcon(t, n, r, i, a);
|
|
5398
5419
|
return o ? {
|
|
5399
5420
|
path: o,
|
|
@@ -5405,9 +5426,9 @@ function Vr() {
|
|
|
5405
5426
|
fallbackUrl: s
|
|
5406
5427
|
};
|
|
5407
5428
|
}
|
|
5408
|
-
return
|
|
5429
|
+
return Lr === "fss" && o ? {
|
|
5409
5430
|
path: o,
|
|
5410
|
-
url:
|
|
5431
|
+
url: jr(o) ?? null,
|
|
5411
5432
|
fallbackUrl: s
|
|
5412
5433
|
} : {
|
|
5413
5434
|
path: "_default",
|
|
@@ -5416,33 +5437,24 @@ function Vr() {
|
|
|
5416
5437
|
};
|
|
5417
5438
|
};
|
|
5418
5439
|
}
|
|
5419
|
-
function
|
|
5420
|
-
let e =
|
|
5440
|
+
function Wr() {
|
|
5441
|
+
let e = Fr(), t = ke();
|
|
5421
5442
|
return async (n) => {
|
|
5422
|
-
|
|
5443
|
+
Lr === "vscode" && e.isLoaded() ? await e.preloadIcons(n) : await Ar(t, n);
|
|
5423
5444
|
};
|
|
5424
5445
|
}
|
|
5425
|
-
function
|
|
5426
|
-
let e =
|
|
5427
|
-
return (t) => t === "_default_folder" ?
|
|
5446
|
+
function Gr() {
|
|
5447
|
+
let e = Fr();
|
|
5448
|
+
return (t) => t === "_default_folder" ? Ir.folder : t === "_default_folder_open" ? Ir.folderOpen : t === "_default_file" ? Ir.file : Lr === "vscode" && e.isLoaded() ? e.getCachedIcon(t) : jr(t) ?? null;
|
|
5428
5449
|
}
|
|
5429
5450
|
//#endregion
|
|
5430
5451
|
//#region lib/features/file-ops/model/fileOperationHandlers.ts
|
|
5431
|
-
var
|
|
5432
|
-
function
|
|
5433
|
-
|
|
5434
|
-
}
|
|
5435
|
-
function Kr() {
|
|
5436
|
-
return Wr;
|
|
5437
|
-
}
|
|
5438
|
-
//#endregion
|
|
5439
|
-
//#region lib/fileListHandlers.ts
|
|
5440
|
-
var qr = null;
|
|
5441
|
-
function Jr(e) {
|
|
5442
|
-
qr = e;
|
|
5452
|
+
var Kr = null;
|
|
5453
|
+
function qr(e) {
|
|
5454
|
+
Kr = e;
|
|
5443
5455
|
}
|
|
5444
|
-
function
|
|
5445
|
-
return
|
|
5456
|
+
function Jr() {
|
|
5457
|
+
return Kr;
|
|
5446
5458
|
}
|
|
5447
5459
|
//#endregion
|
|
5448
5460
|
//#region lib/fss.ts
|
|
@@ -5640,7 +5652,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5640
5652
|
let n = d.current + e;
|
|
5641
5653
|
n = Math.min(n, t), n = Math.max(0, n), d.current !== n && (d.current = n, f.current(n));
|
|
5642
5654
|
}, p = navigator.platform.startsWith("Win"), h = (e) => {
|
|
5643
|
-
u(r && p ? Math.sign(e.deltaY) * r : e.deltaY);
|
|
5655
|
+
e.preventDefault(), e.stopPropagation(), u(r && p ? Math.sign(e.deltaY) * r : e.deltaY);
|
|
5644
5656
|
}, g = (e) => {
|
|
5645
5657
|
n = e.clientY, o = performance.now(), c = !1, s = 0;
|
|
5646
5658
|
}, _ = (t) => {
|
|
@@ -5658,7 +5670,7 @@ var oi = "_breadcrumbs_15ml8_25", si = "_entry_15ml8_151", ci = "_selected_15ml8
|
|
|
5658
5670
|
};
|
|
5659
5671
|
c || (c = !0, requestAnimationFrame(r));
|
|
5660
5672
|
};
|
|
5661
|
-
return e.addEventListener("wheel", h, { passive: !
|
|
5673
|
+
return e.addEventListener("wheel", h, { passive: !1 }), m && (e.addEventListener("pointerdown", g), e.addEventListener("pointermove", _), e.addEventListener("pointerup", v), e.addEventListener("pointercancel", v)), () => {
|
|
5662
5674
|
e.removeEventListener("wheel", h), m && (e.removeEventListener("pointerdown", g), e.removeEventListener("pointermove", _), e.removeEventListener("pointerup", v), e.removeEventListener("pointercancel", v));
|
|
5663
5675
|
};
|
|
5664
5676
|
}, [
|
|
@@ -5792,31 +5804,31 @@ function vi(e, t, n) {
|
|
|
5792
5804
|
return Math.max(t, Math.min(n, e));
|
|
5793
5805
|
}
|
|
5794
5806
|
var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r, selectionKey: a, active: s, resolver: c, requestedActiveName: f, requestedTopmostName: h, onStateChange: g }) {
|
|
5795
|
-
let
|
|
5796
|
-
|
|
5797
|
-
let
|
|
5798
|
-
|
|
5799
|
-
let
|
|
5800
|
-
|
|
5801
|
-
let
|
|
5802
|
-
|
|
5803
|
-
let
|
|
5804
|
-
|
|
5805
|
-
let
|
|
5806
|
-
|
|
5807
|
+
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);
|
|
5808
|
+
M.current = A;
|
|
5809
|
+
let N = ai("(pointer: coarse)"), P = u(O);
|
|
5810
|
+
P.current = O;
|
|
5811
|
+
let I = u(void 0), ee = u(e), te = u([]), L = u(v);
|
|
5812
|
+
L.current = v;
|
|
5813
|
+
let ne = u(b);
|
|
5814
|
+
ne.current = b;
|
|
5815
|
+
let re = u(e);
|
|
5816
|
+
re.current = e;
|
|
5817
|
+
let ie = u(r);
|
|
5818
|
+
ie.current = r;
|
|
5807
5819
|
let R = i(() => {
|
|
5808
|
-
|
|
5809
|
-
}, []),
|
|
5810
|
-
|
|
5811
|
-
}, []),
|
|
5812
|
-
if (e) return
|
|
5813
|
-
}, [
|
|
5820
|
+
M.current || j(!0);
|
|
5821
|
+
}, []), ae = i(() => {
|
|
5822
|
+
M.current && j(!1);
|
|
5823
|
+
}, []), z = Gr(), oe = i((e) => {
|
|
5824
|
+
if (e) return z(e) ?? void 0;
|
|
5825
|
+
}, [z]), se = Ur(), ce = l(() => {
|
|
5814
5826
|
let e = n.map((e) => {
|
|
5815
5827
|
e = {
|
|
5816
5828
|
...e,
|
|
5817
5829
|
parent: t
|
|
5818
5830
|
};
|
|
5819
|
-
let n = ii(c, e), r = e.type === "folder", i =
|
|
5831
|
+
let n = ii(c, e), r = e.type === "folder", i = se(e.name, r, !1, !1, e.lang, n.icon);
|
|
5820
5832
|
return {
|
|
5821
5833
|
entry: e,
|
|
5822
5834
|
style: n,
|
|
@@ -5831,7 +5843,7 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5831
5843
|
let n = {
|
|
5832
5844
|
...t,
|
|
5833
5845
|
stateFlags: 1
|
|
5834
|
-
}, r = ii(c, n), i =
|
|
5846
|
+
}, r = ii(c, n), i = se("..", !0, !0, !1, "", r.icon);
|
|
5835
5847
|
e.push({
|
|
5836
5848
|
entry: {
|
|
5837
5849
|
...n,
|
|
@@ -5842,28 +5854,28 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5842
5854
|
iconFallbackUrl: i.fallbackUrl
|
|
5843
5855
|
});
|
|
5844
5856
|
}
|
|
5845
|
-
for (let t of
|
|
5857
|
+
for (let t of ce) e.push(t);
|
|
5846
5858
|
return e;
|
|
5847
|
-
}, [
|
|
5859
|
+
}, [ce, t]), V = u(B);
|
|
5848
5860
|
V.current = B;
|
|
5849
|
-
let
|
|
5861
|
+
let le = l(() => {
|
|
5850
5862
|
let e = /* @__PURE__ */ new Set();
|
|
5851
5863
|
for (let { iconPath: t } of B) t && e.add(t);
|
|
5852
5864
|
return [...e];
|
|
5853
|
-
}, [B]),
|
|
5865
|
+
}, [B]), ue = Wr();
|
|
5854
5866
|
o(() => {
|
|
5855
5867
|
let e = !1;
|
|
5856
|
-
return le
|
|
5857
|
-
e ||
|
|
5868
|
+
return ue(le).then(() => {
|
|
5869
|
+
e || D((e) => e + 1);
|
|
5858
5870
|
}), () => {
|
|
5859
5871
|
e = !0;
|
|
5860
5872
|
};
|
|
5861
|
-
}, [
|
|
5862
|
-
|
|
5873
|
+
}, [le]), o(() => Vr(() => {
|
|
5874
|
+
D((e) => e + 1);
|
|
5863
5875
|
}), []), o(() => {
|
|
5864
5876
|
let t = ee.current;
|
|
5865
5877
|
if (ee.current = e, t === e) {
|
|
5866
|
-
|
|
5878
|
+
y((e) => Math.min(e, B.length - 1));
|
|
5867
5879
|
return;
|
|
5868
5880
|
}
|
|
5869
5881
|
if (t.startsWith(e)) {
|
|
@@ -5872,55 +5884,55 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5872
5884
|
let r = n.pop();
|
|
5873
5885
|
if (r) {
|
|
5874
5886
|
let e = B.findIndex((e) => e.entry.name === r.selectedName), t = B.findIndex((e) => e.entry.name === r.topmostName);
|
|
5875
|
-
|
|
5887
|
+
y(e >= 0 ? e : 0), x(t >= 0 ? t : 0);
|
|
5876
5888
|
return;
|
|
5877
5889
|
}
|
|
5878
5890
|
let i = t.slice(e.length).replace(/^\//, "").split("/")[0].replace(/\0.*$/, "");
|
|
5879
5891
|
if (i) {
|
|
5880
5892
|
let e = B.findIndex((e) => e.entry.name === i);
|
|
5881
5893
|
if (e >= 0) {
|
|
5882
|
-
|
|
5894
|
+
y(e), x(Math.max(0, e - 5));
|
|
5883
5895
|
return;
|
|
5884
5896
|
}
|
|
5885
5897
|
}
|
|
5886
5898
|
}
|
|
5887
|
-
|
|
5899
|
+
y(0), x(0);
|
|
5888
5900
|
}, [e, B]), o(() => {
|
|
5889
5901
|
if (!f) return;
|
|
5890
5902
|
let e = V.current.findIndex((e) => e.entry.name === f);
|
|
5891
|
-
e >= 0 &&
|
|
5903
|
+
e >= 0 && y(e);
|
|
5892
5904
|
}, [f]), o(() => {
|
|
5893
5905
|
if (!h) return;
|
|
5894
5906
|
let e = V.current.findIndex((e) => e.entry.name === h);
|
|
5895
|
-
e >= 0 &&
|
|
5907
|
+
e >= 0 && x(e);
|
|
5896
5908
|
}, [h]);
|
|
5897
|
-
let
|
|
5898
|
-
|
|
5899
|
-
let
|
|
5909
|
+
let de = u(g);
|
|
5910
|
+
de.current = g;
|
|
5911
|
+
let fe = u(void 0);
|
|
5900
5912
|
o(() => {
|
|
5901
|
-
|
|
5902
|
-
let e = V.current[
|
|
5903
|
-
|
|
5913
|
+
de.current && (clearTimeout(fe.current), fe.current = setTimeout(() => {
|
|
5914
|
+
let e = V.current[L.current]?.entry.name, t = V.current[ne.current]?.entry.name;
|
|
5915
|
+
de.current?.(e, t);
|
|
5904
5916
|
}, 150));
|
|
5905
5917
|
}, [
|
|
5906
|
-
|
|
5907
|
-
|
|
5918
|
+
v,
|
|
5919
|
+
b,
|
|
5908
5920
|
B
|
|
5909
5921
|
]), o(() => () => {
|
|
5910
|
-
if (clearTimeout(
|
|
5911
|
-
let e = V.current[
|
|
5912
|
-
|
|
5922
|
+
if (clearTimeout(fe.current), !de.current) return;
|
|
5923
|
+
let e = V.current[L.current]?.entry.name, t = V.current[ne.current]?.entry.name;
|
|
5924
|
+
de.current(e, t);
|
|
5913
5925
|
}, []);
|
|
5914
|
-
let
|
|
5915
|
-
|
|
5916
|
-
}, []),
|
|
5926
|
+
let pe = i((e) => {
|
|
5927
|
+
ie.current(e);
|
|
5928
|
+
}, []), me = i((e, t, n) => {
|
|
5917
5929
|
let r = V.current;
|
|
5918
|
-
if (
|
|
5930
|
+
if (I.current === void 0) {
|
|
5919
5931
|
let t = r[e]?.entry.name;
|
|
5920
|
-
|
|
5932
|
+
I.current = t ? !P.current.has(t) : !0;
|
|
5921
5933
|
}
|
|
5922
|
-
let i =
|
|
5923
|
-
|
|
5934
|
+
let i = I.current, a = Math.min(e, t), o = Math.max(e, t);
|
|
5935
|
+
k((e) => {
|
|
5924
5936
|
let s = new Set(e);
|
|
5925
5937
|
for (let e = a; e <= o; e++) {
|
|
5926
5938
|
if (n === "exclude-active" && e === t) continue;
|
|
@@ -5928,216 +5940,219 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
5928
5940
|
a && (i ? s.add(a) : s.delete(a));
|
|
5929
5941
|
}
|
|
5930
5942
|
return s;
|
|
5931
|
-
}),
|
|
5943
|
+
}), y(vi(t, 0, r.length - 1));
|
|
5932
5944
|
}, []);
|
|
5933
5945
|
o(() => {
|
|
5934
5946
|
if (!s) return;
|
|
5935
5947
|
let e = (e) => {
|
|
5936
|
-
!e.shiftKey &&
|
|
5948
|
+
!e.shiftKey && I.current !== void 0 && (I.current = void 0);
|
|
5937
5949
|
};
|
|
5938
5950
|
return window.addEventListener("keyup", e), () => window.removeEventListener("keyup", e);
|
|
5939
5951
|
}, [s]), o(() => {
|
|
5940
|
-
|
|
5952
|
+
k(/* @__PURE__ */ new Set()), I.current = void 0;
|
|
5941
5953
|
}, [e, a]);
|
|
5942
|
-
let
|
|
5943
|
-
if (e.name === "..") await
|
|
5954
|
+
let he = i(async (e) => {
|
|
5955
|
+
if (e.name === "..") await ie.current(G(re.current));
|
|
5944
5956
|
else if (e.type === "folder") {
|
|
5945
|
-
let t = V.current[
|
|
5957
|
+
let t = V.current[L.current]?.entry.name, n = V.current[ne.current]?.entry.name;
|
|
5946
5958
|
t && te.current.push({
|
|
5947
|
-
path:
|
|
5959
|
+
path: re.current,
|
|
5948
5960
|
selectedName: t,
|
|
5949
5961
|
topmostName: n ?? t
|
|
5950
|
-
}), await
|
|
5962
|
+
}), await ie.current(K(re.current, e.name));
|
|
5951
5963
|
} else e.type === "file" && H.executeCommand("dotdir.viewFile", e.path, e.name, Number(e.meta.size));
|
|
5952
|
-
}, []),
|
|
5953
|
-
|
|
5954
|
-
let
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
let t =
|
|
5958
|
-
return
|
|
5964
|
+
}, []), ge = Math.min(B.length, S * w), _e = u(S);
|
|
5965
|
+
_e.current = S;
|
|
5966
|
+
let ve = u(ge);
|
|
5967
|
+
ve.current = ge, o(() => {
|
|
5968
|
+
x((e) => {
|
|
5969
|
+
let t = S * w;
|
|
5970
|
+
return v < e ? v : v > e + t - 1 ? v - t + 1 : e;
|
|
5959
5971
|
});
|
|
5960
5972
|
}, [
|
|
5961
|
-
|
|
5962
|
-
|
|
5963
|
-
|
|
5973
|
+
v,
|
|
5974
|
+
S,
|
|
5975
|
+
w
|
|
5964
5976
|
]);
|
|
5965
|
-
let
|
|
5966
|
-
let e = V.current[
|
|
5977
|
+
let ye = i(() => {
|
|
5978
|
+
let e = V.current[L.current], t = e?.entry.type === "file", n = t && e != null && !!e.entry.meta.executable, r = e?.entry.name ?? "";
|
|
5967
5979
|
H.beginBatch(), H.setContext("listItemIsFile", t), H.setContext("listItemIsFolder", !t && e != null), H.setContext("listItemIsExecutable", n), H.setContext("listItemHasViewer", t && tn.resolve(r) !== null), H.setContext("listItemHasEditor", t && nn.resolve(r) !== null), H.endBatch();
|
|
5968
5980
|
}, []);
|
|
5969
5981
|
o(() => {
|
|
5970
|
-
s &&
|
|
5982
|
+
s && ye();
|
|
5971
5983
|
}, [
|
|
5972
5984
|
s,
|
|
5973
|
-
|
|
5985
|
+
v,
|
|
5974
5986
|
B,
|
|
5975
|
-
|
|
5987
|
+
ye
|
|
5976
5988
|
]), o(() => {
|
|
5977
5989
|
if (!s) return;
|
|
5978
|
-
let e = tn.onChange(
|
|
5990
|
+
let e = tn.onChange(ye), t = nn.onChange(ye);
|
|
5979
5991
|
return () => {
|
|
5980
5992
|
e(), t();
|
|
5981
5993
|
};
|
|
5982
|
-
}, [s,
|
|
5983
|
-
if (s) return
|
|
5984
|
-
|
|
5985
|
-
|
|
5994
|
+
}, [s, ye]), o(() => {
|
|
5995
|
+
if (s) return bn({
|
|
5996
|
+
focus: () => {
|
|
5997
|
+
_.current?.focus({ preventScroll: !0 });
|
|
5998
|
+
},
|
|
5999
|
+
cursorUp: () => X.enqueue(() => {
|
|
6000
|
+
R(), y((e) => Math.max(0, e - 1));
|
|
5986
6001
|
}),
|
|
5987
|
-
cursorDown: () =>
|
|
5988
|
-
R(),
|
|
6002
|
+
cursorDown: () => X.enqueue(() => {
|
|
6003
|
+
R(), y((e) => Math.min(V.current.length - 1, e + 1));
|
|
5989
6004
|
}),
|
|
5990
|
-
cursorLeft: () =>
|
|
5991
|
-
R(),
|
|
6005
|
+
cursorLeft: () => X.enqueue(() => {
|
|
6006
|
+
R(), y((e) => Math.max(0, e - _e.current));
|
|
5992
6007
|
}),
|
|
5993
|
-
cursorRight: () =>
|
|
5994
|
-
R(),
|
|
6008
|
+
cursorRight: () => X.enqueue(() => {
|
|
6009
|
+
R(), y((e) => Math.min(V.current.length - 1, e + _e.current));
|
|
5995
6010
|
}),
|
|
5996
|
-
cursorHome: () =>
|
|
5997
|
-
R(),
|
|
6011
|
+
cursorHome: () => X.enqueue(() => {
|
|
6012
|
+
R(), y(0);
|
|
5998
6013
|
}),
|
|
5999
|
-
cursorEnd: () =>
|
|
6000
|
-
R(),
|
|
6014
|
+
cursorEnd: () => X.enqueue(() => {
|
|
6015
|
+
R(), y(V.current.length - 1);
|
|
6001
6016
|
}),
|
|
6002
|
-
cursorPageUp: () =>
|
|
6003
|
-
R(),
|
|
6017
|
+
cursorPageUp: () => X.enqueue(() => {
|
|
6018
|
+
R(), y((e) => Math.max(0, e - ve.current + 1));
|
|
6004
6019
|
}),
|
|
6005
|
-
cursorPageDown: () =>
|
|
6006
|
-
R(),
|
|
6020
|
+
cursorPageDown: () => X.enqueue(() => {
|
|
6021
|
+
R(), y((e) => Math.min(V.current.length - 1, e + ve.current - 1));
|
|
6007
6022
|
}),
|
|
6008
|
-
selectUp: () =>
|
|
6023
|
+
selectUp: () => X.enqueue(() => {
|
|
6009
6024
|
R();
|
|
6010
|
-
let e =
|
|
6011
|
-
|
|
6025
|
+
let e = L.current;
|
|
6026
|
+
me(e, Math.max(0, e - 1), e === 0 ? "include-active" : "exclude-active");
|
|
6012
6027
|
}),
|
|
6013
|
-
selectDown: () =>
|
|
6028
|
+
selectDown: () => X.enqueue(() => {
|
|
6014
6029
|
R();
|
|
6015
|
-
let e =
|
|
6016
|
-
|
|
6030
|
+
let e = L.current, t = V.current.length - 1;
|
|
6031
|
+
me(e, Math.min(t, e + 1), e === t ? "include-active" : "exclude-active");
|
|
6017
6032
|
}),
|
|
6018
|
-
selectLeft: () =>
|
|
6033
|
+
selectLeft: () => X.enqueue(() => {
|
|
6019
6034
|
R();
|
|
6020
|
-
let e =
|
|
6021
|
-
|
|
6035
|
+
let e = L.current;
|
|
6036
|
+
me(e, Math.max(0, e - _e.current), "include-active");
|
|
6022
6037
|
}),
|
|
6023
|
-
selectRight: () =>
|
|
6038
|
+
selectRight: () => X.enqueue(() => {
|
|
6024
6039
|
R();
|
|
6025
|
-
let e =
|
|
6026
|
-
|
|
6040
|
+
let e = L.current;
|
|
6041
|
+
me(e, Math.min(V.current.length - 1, e + _e.current), "include-active");
|
|
6027
6042
|
}),
|
|
6028
|
-
selectHome: () =>
|
|
6029
|
-
R(),
|
|
6043
|
+
selectHome: () => X.enqueue(() => {
|
|
6044
|
+
R(), me(L.current, 0, "include-active");
|
|
6030
6045
|
}),
|
|
6031
|
-
selectEnd: () =>
|
|
6032
|
-
R(),
|
|
6046
|
+
selectEnd: () => X.enqueue(() => {
|
|
6047
|
+
R(), me(L.current, V.current.length - 1, "include-active");
|
|
6033
6048
|
}),
|
|
6034
|
-
selectPageUp: () =>
|
|
6049
|
+
selectPageUp: () => X.enqueue(() => {
|
|
6035
6050
|
R();
|
|
6036
|
-
let e =
|
|
6037
|
-
|
|
6051
|
+
let e = L.current;
|
|
6052
|
+
me(e, Math.max(0, e - ve.current + 1), "include-active");
|
|
6038
6053
|
}),
|
|
6039
|
-
selectPageDown: () =>
|
|
6054
|
+
selectPageDown: () => X.enqueue(() => {
|
|
6040
6055
|
R();
|
|
6041
|
-
let e =
|
|
6042
|
-
|
|
6056
|
+
let e = L.current;
|
|
6057
|
+
me(e, Math.min(V.current.length - 1, e + ve.current - 1), "include-active");
|
|
6043
6058
|
}),
|
|
6044
|
-
execute: () =>
|
|
6045
|
-
let e = V.current[
|
|
6059
|
+
execute: () => X.enqueue(async () => {
|
|
6060
|
+
let e = V.current[L.current];
|
|
6046
6061
|
!e || e.entry.type !== "file" || e.entry.meta.executable && H.executeCommand("terminal.execute", e.entry.path);
|
|
6047
6062
|
}),
|
|
6048
|
-
open: () =>
|
|
6049
|
-
let e = V.current[
|
|
6050
|
-
e && await
|
|
6063
|
+
open: () => X.enqueue(async () => {
|
|
6064
|
+
let e = V.current[L.current];
|
|
6065
|
+
e && await he(e.entry);
|
|
6051
6066
|
}),
|
|
6052
|
-
viewFile: () =>
|
|
6053
|
-
let e = V.current[
|
|
6067
|
+
viewFile: () => X.enqueue(() => {
|
|
6068
|
+
let e = V.current[L.current];
|
|
6054
6069
|
e && e.entry.type === "file" && H.executeCommand("dotdir.viewFile", e.entry.path, e.entry.name, Number(e.entry.meta.size));
|
|
6055
6070
|
}),
|
|
6056
|
-
editFile: () =>
|
|
6057
|
-
let e = V.current[
|
|
6071
|
+
editFile: () => X.enqueue(() => {
|
|
6072
|
+
let e = V.current[L.current];
|
|
6058
6073
|
if (e && e.entry.type === "file") {
|
|
6059
6074
|
let t = typeof e.entry.lang == "string" && e.entry.lang ? e.entry.lang : "plaintext";
|
|
6060
6075
|
H.executeCommand("dotdir.editFile", e.entry.path, e.entry.name, Number(e.entry.meta.size), t);
|
|
6061
6076
|
}
|
|
6062
6077
|
}),
|
|
6063
|
-
moveToTrash: () =>
|
|
6064
|
-
let e =
|
|
6078
|
+
moveToTrash: () => X.enqueue(() => {
|
|
6079
|
+
let e = Jr();
|
|
6065
6080
|
if (!e) return;
|
|
6066
|
-
let t =
|
|
6067
|
-
let e = n[
|
|
6081
|
+
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) : (() => {
|
|
6082
|
+
let e = n[L.current];
|
|
6068
6083
|
return e ? [e.entry.path] : [];
|
|
6069
6084
|
})();
|
|
6070
6085
|
i.length !== 0 && e.moveToTrash(i, r);
|
|
6071
6086
|
}),
|
|
6072
|
-
permanentDelete: () =>
|
|
6073
|
-
let e =
|
|
6087
|
+
permanentDelete: () => X.enqueue(() => {
|
|
6088
|
+
let e = Jr();
|
|
6074
6089
|
if (!e) return;
|
|
6075
|
-
let t =
|
|
6076
|
-
let e = n[
|
|
6090
|
+
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) : (() => {
|
|
6091
|
+
let e = n[L.current];
|
|
6077
6092
|
return e ? [e.entry.path] : [];
|
|
6078
6093
|
})();
|
|
6079
6094
|
i.length !== 0 && e.permanentDelete(i, r);
|
|
6080
6095
|
}),
|
|
6081
|
-
copy: () =>
|
|
6082
|
-
let e =
|
|
6096
|
+
copy: () => X.enqueue(() => {
|
|
6097
|
+
let e = Jr();
|
|
6083
6098
|
if (!e) return;
|
|
6084
|
-
let t =
|
|
6085
|
-
let e = n[
|
|
6099
|
+
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) : (() => {
|
|
6100
|
+
let e = n[L.current];
|
|
6086
6101
|
return e ? [e.entry.path] : [];
|
|
6087
6102
|
})();
|
|
6088
6103
|
i.length !== 0 && e.copy(i, r);
|
|
6089
6104
|
}),
|
|
6090
|
-
move: () =>
|
|
6091
|
-
let e =
|
|
6105
|
+
move: () => X.enqueue(() => {
|
|
6106
|
+
let e = Jr();
|
|
6092
6107
|
if (!e) return;
|
|
6093
|
-
let t =
|
|
6094
|
-
let e = n[
|
|
6108
|
+
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) : (() => {
|
|
6109
|
+
let e = n[L.current];
|
|
6095
6110
|
return e ? [e.entry.path] : [];
|
|
6096
6111
|
})();
|
|
6097
6112
|
i.length !== 0 && e.move(i, r);
|
|
6098
6113
|
}),
|
|
6099
|
-
rename: () =>
|
|
6100
|
-
let e =
|
|
6114
|
+
rename: () => X.enqueue(() => {
|
|
6115
|
+
let e = Jr();
|
|
6101
6116
|
if (!e) return;
|
|
6102
|
-
let t = V.current[
|
|
6103
|
-
t && e.rename(t.entry.path, t.entry.name, () =>
|
|
6117
|
+
let t = V.current[L.current];
|
|
6118
|
+
t && e.rename(t.entry.path, t.entry.name, () => ie.current(re.current));
|
|
6104
6119
|
}),
|
|
6105
|
-
pasteFilename: () =>
|
|
6106
|
-
let e = V.current[
|
|
6120
|
+
pasteFilename: () => X.enqueue(() => {
|
|
6121
|
+
let e = V.current[L.current];
|
|
6107
6122
|
if (!e) return;
|
|
6108
|
-
let t =
|
|
6123
|
+
let t = Jr();
|
|
6109
6124
|
if (!t) return;
|
|
6110
6125
|
let n = e.entry.name, r = /^[a-zA-Z0-9._+-]+$/.test(n) ? n : JSON.stringify(n);
|
|
6111
6126
|
t.pasteToCommandLine(r);
|
|
6112
6127
|
}),
|
|
6113
|
-
pastePath: () =>
|
|
6114
|
-
let e = V.current[
|
|
6128
|
+
pastePath: () => X.enqueue(() => {
|
|
6129
|
+
let e = V.current[L.current];
|
|
6115
6130
|
if (!e) return;
|
|
6116
|
-
let t =
|
|
6131
|
+
let t = Jr();
|
|
6117
6132
|
if (!t) return;
|
|
6118
6133
|
let n = (e.entry.path ?? "").split("\0")[0], r = /^[a-zA-Z0-9._+/:-]+$/.test(n) ? n : JSON.stringify(n);
|
|
6119
6134
|
t.pasteToCommandLine(r);
|
|
6120
6135
|
})
|
|
6121
|
-
}), () =>
|
|
6136
|
+
}), () => bn(null);
|
|
6122
6137
|
}, [
|
|
6123
6138
|
s,
|
|
6124
6139
|
R,
|
|
6125
|
-
|
|
6126
|
-
|
|
6140
|
+
he,
|
|
6141
|
+
me
|
|
6127
6142
|
]);
|
|
6128
|
-
let
|
|
6129
|
-
|
|
6130
|
-
let
|
|
6131
|
-
|
|
6132
|
-
}, []),
|
|
6133
|
-
|
|
6134
|
-
}, []),
|
|
6143
|
+
let be = u(w);
|
|
6144
|
+
be.current = w;
|
|
6145
|
+
let xe = i((e) => {
|
|
6146
|
+
C(e), x((t) => Math.max(0, Math.min(t, V.current.length - e * be.current)));
|
|
6147
|
+
}, []), Se = i((e) => {
|
|
6148
|
+
T(e);
|
|
6149
|
+
}, []), Ce = i((e, t) => {
|
|
6135
6150
|
let n = V.current.length;
|
|
6136
|
-
|
|
6137
|
-
}, []),
|
|
6151
|
+
y(vi(t, 0, n - 1)), x(vi(e, 0, n - 1));
|
|
6152
|
+
}, []), we = i((e) => V.current[e]?.entry.name ?? e, []), Te = u(0), Ee = i((e, t, n) => {
|
|
6138
6153
|
let r = V.current[e];
|
|
6139
6154
|
if (!r) return null;
|
|
6140
|
-
let { entry: i, style: a, iconPath: o, iconFallbackUrl: s } = r, c =
|
|
6155
|
+
let { entry: i, style: a, iconPath: o, iconFallbackUrl: s } = r, c = oe(o) ?? s, l = i.type === "file" && !!i.meta.executable;
|
|
6141
6156
|
return /* @__PURE__ */ m("div", {
|
|
6142
6157
|
className: F(Z, "entry", t && "selected", n && "marked"),
|
|
6143
6158
|
style: {
|
|
@@ -6145,9 +6160,9 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6145
6160
|
opacity: a.opacity
|
|
6146
6161
|
},
|
|
6147
6162
|
onMouseDown: (t) => {
|
|
6148
|
-
t.stopPropagation(),
|
|
6163
|
+
t.stopPropagation(), ae();
|
|
6149
6164
|
let n = Date.now();
|
|
6150
|
-
n -
|
|
6165
|
+
n - Te.current < 300 ? (Te.current = 0, l ? X.enqueue(() => H.executeCommand("terminal.execute", i.path)) : X.enqueue(() => he(i))) : (Te.current = n, X.enqueue(() => y(e)));
|
|
6151
6166
|
},
|
|
6152
6167
|
children: [
|
|
6153
6168
|
/* @__PURE__ */ p("span", {
|
|
@@ -6178,12 +6193,12 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6178
6193
|
]
|
|
6179
6194
|
});
|
|
6180
6195
|
}, [
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
]),
|
|
6185
|
-
if (!
|
|
6186
|
-
let e =
|
|
6196
|
+
he,
|
|
6197
|
+
E,
|
|
6198
|
+
ae
|
|
6199
|
+
]), De = B[v], Oe = De?.entry.name ?? "", ke = De ? _i(Number(De.entry.meta.mtimeMs ?? 0)) : "", Ae = (() => {
|
|
6200
|
+
if (!De) return "";
|
|
6201
|
+
let e = De.entry;
|
|
6187
6202
|
if (e.name === "..") return "Up";
|
|
6188
6203
|
let t = e.meta.entryKind ?? (e.type === "folder" ? "directory" : "file"), n = e.meta.nlink ?? 1;
|
|
6189
6204
|
switch (t) {
|
|
@@ -6202,42 +6217,46 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6202
6217
|
return n > 1 ? `${t} [${n}]` : t;
|
|
6203
6218
|
}
|
|
6204
6219
|
}
|
|
6205
|
-
})(),
|
|
6206
|
-
if (
|
|
6220
|
+
})(), je = !De || (De.entry.meta.entryKind ?? "") !== "symlink" ? "" : `\u2192 ${De.entry.meta.linkTarget ?? "?"}`, Me = l(() => B.filter((e) => e.entry.type === "file").length, [B]), Ne = l(() => B.reduce((e, t) => t.entry.type === "file" && typeof t.entry.meta.size == "number" ? e + t.entry.meta.size : e, 0), [B]), Pe = l(() => {
|
|
6221
|
+
if (O.size === 0) return null;
|
|
6207
6222
|
let e = 0, t = 0;
|
|
6208
|
-
for (let n of B)
|
|
6223
|
+
for (let n of B) O.has(n.entry.name) && (e++, n.entry.type === "file" && typeof n.entry.meta.size == "number" && (t += n.entry.meta.size));
|
|
6209
6224
|
return {
|
|
6210
6225
|
count: e,
|
|
6211
6226
|
size: t
|
|
6212
6227
|
};
|
|
6213
|
-
}, [
|
|
6228
|
+
}, [O, B]);
|
|
6214
6229
|
return /* @__PURE__ */ m("div", {
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6230
|
+
ref: _,
|
|
6231
|
+
tabIndex: 0,
|
|
6232
|
+
className: F(Z, "file-list", N || A ? "no-hover" : null, s ? "active-panel" : "inactive-panel"),
|
|
6233
|
+
onMouseMoveCapture: ae,
|
|
6234
|
+
onMouseDownCapture: () => {
|
|
6235
|
+
ae(), _.current?.focus({ preventScroll: !0 });
|
|
6236
|
+
},
|
|
6218
6237
|
children: [
|
|
6219
6238
|
/* @__PURE__ */ p("div", {
|
|
6220
6239
|
className: Z["path-bar"],
|
|
6221
6240
|
children: /* @__PURE__ */ p(ui, {
|
|
6222
6241
|
currentPath: e,
|
|
6223
|
-
onNavigate:
|
|
6242
|
+
onNavigate: pe
|
|
6224
6243
|
})
|
|
6225
6244
|
}),
|
|
6226
6245
|
/* @__PURE__ */ p("div", {
|
|
6227
6246
|
className: Z["file-list-body"],
|
|
6228
6247
|
children: /* @__PURE__ */ p(mi, {
|
|
6229
|
-
topmostIndex:
|
|
6230
|
-
activeIndex:
|
|
6248
|
+
topmostIndex: b,
|
|
6249
|
+
activeIndex: v,
|
|
6231
6250
|
totalCount: B.length,
|
|
6232
6251
|
itemHeight: hi,
|
|
6233
6252
|
minColumnWidth: 250,
|
|
6234
6253
|
far: !0,
|
|
6235
|
-
selectedKeys:
|
|
6236
|
-
getItemKey:
|
|
6237
|
-
renderItem:
|
|
6238
|
-
onPosChange:
|
|
6239
|
-
onItemsPerColumnChanged:
|
|
6240
|
-
onColumnCountChanged:
|
|
6254
|
+
selectedKeys: O,
|
|
6255
|
+
getItemKey: we,
|
|
6256
|
+
renderItem: Ee,
|
|
6257
|
+
onPosChange: Ce,
|
|
6258
|
+
onItemsPerColumnChanged: xe,
|
|
6259
|
+
onColumnCountChanged: Se
|
|
6241
6260
|
})
|
|
6242
6261
|
}),
|
|
6243
6262
|
/* @__PURE__ */ m("div", {
|
|
@@ -6245,25 +6264,25 @@ var yi = r(function({ currentPath: e, parentNode: t, entries: n, onNavigate: r,
|
|
|
6245
6264
|
children: [
|
|
6246
6265
|
/* @__PURE__ */ p("span", {
|
|
6247
6266
|
className: Z["file-info-name"],
|
|
6248
|
-
children:
|
|
6267
|
+
children: Oe
|
|
6249
6268
|
}),
|
|
6250
|
-
|
|
6269
|
+
je && /* @__PURE__ */ p("span", {
|
|
6251
6270
|
className: Z["file-info-link"],
|
|
6252
|
-
children:
|
|
6271
|
+
children: je
|
|
6253
6272
|
}),
|
|
6254
6273
|
/* @__PURE__ */ p("span", {
|
|
6255
6274
|
className: Z["file-info-size"],
|
|
6256
|
-
children:
|
|
6275
|
+
children: Ae
|
|
6257
6276
|
}),
|
|
6258
6277
|
/* @__PURE__ */ p("span", {
|
|
6259
6278
|
className: Z["file-info-date"],
|
|
6260
|
-
children:
|
|
6279
|
+
children: ke
|
|
6261
6280
|
})
|
|
6262
6281
|
]
|
|
6263
6282
|
}),
|
|
6264
6283
|
/* @__PURE__ */ p("div", {
|
|
6265
6284
|
className: Z["panel-summary"],
|
|
6266
|
-
children:
|
|
6285
|
+
children: Pe ? `${Pe.count} selected, ${gi(Pe.size)}` : `${Me.toLocaleString()} file${Me === 1 ? "" : "s"}, ${gi(Ne)}`
|
|
6267
6286
|
})
|
|
6268
6287
|
]
|
|
6269
6288
|
});
|
|
@@ -6441,23 +6460,23 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6441
6460
|
}
|
|
6442
6461
|
let n = await ke().utils.getHomePath(), r = ki(n);
|
|
6443
6462
|
x([r]), C(r.id), k.current.navigateTo(n);
|
|
6444
|
-
}, []),
|
|
6463
|
+
}, []), I = i((e, t) => {
|
|
6445
6464
|
x((n) => {
|
|
6446
6465
|
let r = [...n], [i] = r.splice(e, 1);
|
|
6447
6466
|
return r.splice(t, 0, i), r;
|
|
6448
6467
|
});
|
|
6449
|
-
}, []),
|
|
6468
|
+
}, []), ee = i(() => {
|
|
6450
6469
|
let e = k.current.currentPath, t = ki(e);
|
|
6451
6470
|
x((e) => [...e, t]), C(t.id), k.current.navigateTo(e);
|
|
6452
6471
|
}, [x, C]);
|
|
6453
6472
|
return o(() => {
|
|
6454
6473
|
if (g) return Hi({
|
|
6455
|
-
newTab:
|
|
6474
|
+
newTab: ee,
|
|
6456
6475
|
closeActiveTab: () => P(j.current)
|
|
6457
6476
|
}), () => Hi(null);
|
|
6458
6477
|
}, [
|
|
6459
6478
|
g,
|
|
6460
|
-
|
|
6479
|
+
ee,
|
|
6461
6480
|
P
|
|
6462
6481
|
]), /* @__PURE__ */ m("div", {
|
|
6463
6482
|
className: F(wi, "panel", g && "active"),
|
|
@@ -6470,8 +6489,8 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6470
6489
|
onSelectTab: M,
|
|
6471
6490
|
onDoubleClickTab: N,
|
|
6472
6491
|
onCloseTab: P,
|
|
6473
|
-
onNewTab:
|
|
6474
|
-
onReorderTabs:
|
|
6492
|
+
onNewTab: ee,
|
|
6493
|
+
onReorderTabs: I
|
|
6475
6494
|
}),
|
|
6476
6495
|
/* @__PURE__ */ p("div", {
|
|
6477
6496
|
className: wi["panel-content"],
|
|
@@ -6490,7 +6509,7 @@ function Wi({ side: e, panel: t, onRememberExpectedTerminalCwd: n, selectionKey:
|
|
|
6490
6509
|
let e = T;
|
|
6491
6510
|
if (e.type !== "preview") return null;
|
|
6492
6511
|
let t = tn.resolve(e.name);
|
|
6493
|
-
return t ? /* @__PURE__ */ p(
|
|
6512
|
+
return t ? /* @__PURE__ */ p(wn, {
|
|
6494
6513
|
extensionDirPath: t.extensionDirPath,
|
|
6495
6514
|
entry: t.contribution.entry,
|
|
6496
6515
|
filePath: e.path,
|
|
@@ -7152,7 +7171,7 @@ async function ma(e, t, n) {
|
|
|
7152
7171
|
//#endregion
|
|
7153
7172
|
//#region lib/features/extensions/useExtensionHost.ts
|
|
7154
7173
|
function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
7155
|
-
let n = ke(), r =
|
|
7174
|
+
let n = ke(), r = jn(), a = y(Pe), s = y(Fe), c = y(Be), l = b(Ie), d = b(Le), f = b(Re), p = b(ze), { setIconTheme: m } = zr(), { setIconThemeKind: h } = Br(), g = u(a);
|
|
7156
7175
|
g.current = a;
|
|
7157
7176
|
let _ = u(s);
|
|
7158
7177
|
_.current = s;
|
|
@@ -7160,7 +7179,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7160
7179
|
v.current = t;
|
|
7161
7180
|
let x = u([]), S = u([]), C = u(!1);
|
|
7162
7181
|
o(() => {
|
|
7163
|
-
let e = s ?
|
|
7182
|
+
let e = s ? Jn(x.current, s) : null, t = e ? _n(e.theme.uiTheme) : c === "light" || c === "high-contrast-light" ? "light" : "dark";
|
|
7164
7183
|
Ht().dataset.theme = t, h(t);
|
|
7165
7184
|
}, [c, s]);
|
|
7166
7185
|
let w = i(async (e, t) => {
|
|
@@ -7183,7 +7202,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7183
7202
|
}, [a, w]), o(() => {
|
|
7184
7203
|
if (C.current) if (!s) gn();
|
|
7185
7204
|
else {
|
|
7186
|
-
let e =
|
|
7205
|
+
let e = Jn(x.current, s);
|
|
7187
7206
|
e && vn(n, e.theme.jsonPath, e.theme.uiTheme).catch(() => gn());
|
|
7188
7207
|
}
|
|
7189
7208
|
}, [s]), o(() => {
|
|
@@ -7205,7 +7224,7 @@ function ha({ settingsLoaded: e, onRefreshPanels: t }) {
|
|
|
7205
7224
|
gn();
|
|
7206
7225
|
return;
|
|
7207
7226
|
}
|
|
7208
|
-
let r =
|
|
7227
|
+
let r = Jn(e, t);
|
|
7209
7228
|
if (r) {
|
|
7210
7229
|
let e = _n(r.theme.uiTheme);
|
|
7211
7230
|
Ht().dataset.theme = e, h(e);
|
|
@@ -8434,7 +8453,7 @@ function $a(e) {
|
|
|
8434
8453
|
n.current = e;
|
|
8435
8454
|
let r = y(Ie), i = u(r);
|
|
8436
8455
|
i.current = r;
|
|
8437
|
-
let { updateSettings: a } =
|
|
8456
|
+
let { updateSettings: a } = pr(), [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);
|
|
8438
8457
|
g.current = s, o(() => {
|
|
8439
8458
|
let e = [];
|
|
8440
8459
|
return e.push(H.registerCommand("dotdir.toggleHiddenFiles", () => l((e) => {
|
|
@@ -8504,7 +8523,7 @@ function $a(e) {
|
|
|
8504
8523
|
})), e.push(H.registerCommand("dotdir.editFile", (e, t, r, i) => {
|
|
8505
8524
|
let a = n.current.editorFileSizeLimit;
|
|
8506
8525
|
a > 0 && r > a || n.current.onEditFile(e, t, r, i);
|
|
8507
|
-
})), e.push(H.registerCommand("list.cursorUp", () =>
|
|
8526
|
+
})), e.push(H.registerCommand("list.cursorUp", () => J()?.cursorUp())), e.push(H.registerCommand("list.cursorDown", () => J()?.cursorDown())), e.push(H.registerCommand("list.cursorLeft", () => J()?.cursorLeft())), e.push(H.registerCommand("list.cursorRight", () => J()?.cursorRight())), e.push(H.registerCommand("list.cursorHome", () => J()?.cursorHome())), e.push(H.registerCommand("list.cursorEnd", () => J()?.cursorEnd())), e.push(H.registerCommand("list.cursorPageUp", () => J()?.cursorPageUp())), e.push(H.registerCommand("list.cursorPageDown", () => J()?.cursorPageDown())), e.push(H.registerCommand("list.selectUp", () => J()?.selectUp())), e.push(H.registerCommand("list.selectDown", () => J()?.selectDown())), e.push(H.registerCommand("list.selectLeft", () => J()?.selectLeft())), e.push(H.registerCommand("list.selectRight", () => J()?.selectRight())), e.push(H.registerCommand("list.selectHome", () => J()?.selectHome())), e.push(H.registerCommand("list.selectEnd", () => J()?.selectEnd())), e.push(H.registerCommand("list.selectPageUp", () => J()?.selectPageUp())), e.push(H.registerCommand("list.selectPageDown", () => J()?.selectPageDown())), e.push(H.registerCommand("list.execute", () => J()?.execute())), e.push(H.registerCommand("list.open", () => J()?.open())), e.push(H.registerCommand("list.viewFile", () => J()?.viewFile())), e.push(H.registerCommand("list.editFile", () => J()?.editFile())), e.push(H.registerCommand("list.moveToTrash", () => J()?.moveToTrash())), e.push(H.registerCommand("list.permanentDelete", () => J()?.permanentDelete())), e.push(H.registerCommand("list.copy", () => J()?.copy())), e.push(H.registerCommand("list.move", () => J()?.move())), e.push(H.registerCommand("list.rename", () => J()?.rename())), e.push(H.registerCommand("list.pasteFilename", () => J()?.pasteFilename())), e.push(H.registerCommand("list.pastePath", () => J()?.pastePath())), e.push(...ot(H)), e.push(...ct(H)), () => {
|
|
8508
8527
|
for (let t of e) t();
|
|
8509
8528
|
};
|
|
8510
8529
|
}, [
|
|
@@ -8987,7 +9006,7 @@ function xo(e) {
|
|
|
8987
9006
|
})) : (console.error("[userKeybindings] keybindings.json must be an array"), null);
|
|
8988
9007
|
}
|
|
8989
9008
|
async function So(e) {
|
|
8990
|
-
await
|
|
9009
|
+
await tr(e, {
|
|
8991
9010
|
name: "userKeybindings",
|
|
8992
9011
|
getPath: async () => K(await e.utils.getHomePath(), ".dotdir", "keybindings.json"),
|
|
8993
9012
|
validate: xo,
|
|
@@ -9043,85 +9062,85 @@ var ko = "_app_4bfa7_56", Ao = "_loading_4bfa7_69", jo = {
|
|
|
9043
9062
|
//#endregion
|
|
9044
9063
|
//#region lib/app.tsx
|
|
9045
9064
|
function Mo({ widget: e }) {
|
|
9046
|
-
let t = ke(), { settings:
|
|
9047
|
-
|
|
9048
|
-
let
|
|
9049
|
-
|
|
9065
|
+
let t = u(null), n = ke(), { settings: r, ready: a, updateSettings: s } = pr(), c = u(r);
|
|
9066
|
+
c.current = r;
|
|
9067
|
+
let l = b(Be), { dialog: h, showDialog: g } = De(), [_, x] = v(Ge), S = i((e) => {
|
|
9068
|
+
g({
|
|
9050
9069
|
type: "message",
|
|
9051
9070
|
title: "Error",
|
|
9052
9071
|
message: e,
|
|
9053
9072
|
variant: "error"
|
|
9054
9073
|
});
|
|
9055
|
-
}, [
|
|
9056
|
-
|
|
9057
|
-
let
|
|
9058
|
-
|
|
9059
|
-
let
|
|
9060
|
-
|
|
9061
|
-
let
|
|
9062
|
-
|
|
9063
|
-
let [
|
|
9064
|
-
|
|
9065
|
-
|
|
9066
|
-
}, [
|
|
9067
|
-
let { settingsLoaded:
|
|
9068
|
-
ready:
|
|
9069
|
-
setLeftTabs:
|
|
9070
|
-
setRightTabs:
|
|
9071
|
-
setLeftActiveTabId:
|
|
9072
|
-
setRightActiveTabId:
|
|
9073
|
-
leftTabSelectionRef:
|
|
9074
|
-
rightTabSelectionRef:
|
|
9075
|
-
prevLeftActiveTabIdRef:
|
|
9076
|
-
prevRightActiveTabIdRef:
|
|
9074
|
+
}, [g]), C = co(S), w = co(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(Ni), [z, oe] = v(Pi), [se, ce] = v(Fi), [B, V] = v(Ii), 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);
|
|
9075
|
+
ve.current = R;
|
|
9076
|
+
let ye = u(z);
|
|
9077
|
+
ye.current = z;
|
|
9078
|
+
let be = u(se);
|
|
9079
|
+
be.current = se;
|
|
9080
|
+
let xe = u(B);
|
|
9081
|
+
xe.current = B;
|
|
9082
|
+
let [Se, Ce] = d(0), we = _t(), Te = b(Xe), Oe = y(Ze), Ae = u(() => {});
|
|
9083
|
+
Oe && (Ae.current = Oe), o(() => {
|
|
9084
|
+
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));
|
|
9085
|
+
}, [r, a]);
|
|
9086
|
+
let { settingsLoaded: je, initialLeftPanel: Me, initialRightPanel: Re, initialActivePanel: ze, setInitialLeftPanel: He, setInitialRightPanel: Ue, setInitialActivePanel: Ke } = yo({
|
|
9087
|
+
ready: a,
|
|
9088
|
+
setLeftTabs: ae,
|
|
9089
|
+
setRightTabs: oe,
|
|
9090
|
+
setLeftActiveTabId: ce,
|
|
9091
|
+
setRightActiveTabId: V,
|
|
9092
|
+
leftTabSelectionRef: de,
|
|
9093
|
+
rightTabSelectionRef: fe,
|
|
9094
|
+
prevLeftActiveTabIdRef: me,
|
|
9095
|
+
prevRightActiveTabIdRef: he,
|
|
9077
9096
|
onAfterRestore: i(() => {
|
|
9078
|
-
So(
|
|
9079
|
-
}, [
|
|
9080
|
-
}),
|
|
9081
|
-
|
|
9082
|
-
let
|
|
9083
|
-
|
|
9084
|
-
let
|
|
9085
|
-
|
|
9086
|
-
let
|
|
9087
|
-
|
|
9088
|
-
let
|
|
9089
|
-
let
|
|
9090
|
-
if (!
|
|
9091
|
-
|
|
9097
|
+
So(n);
|
|
9098
|
+
}, [n])
|
|
9099
|
+
}), Ye = u(T);
|
|
9100
|
+
Ye.current = T;
|
|
9101
|
+
let Qe = u(C.navigateTo);
|
|
9102
|
+
Qe.current = T === "left" ? C.navigateTo : w.navigateTo;
|
|
9103
|
+
let $e = u(C);
|
|
9104
|
+
$e.current = C;
|
|
9105
|
+
let et = u(w);
|
|
9106
|
+
et.current = w;
|
|
9107
|
+
let nt = u(""), rt = i(async (e) => {
|
|
9108
|
+
let t = va(e);
|
|
9109
|
+
if (!t) {
|
|
9110
|
+
Pt.runCommand(e, nt.current);
|
|
9092
9111
|
return;
|
|
9093
9112
|
}
|
|
9094
|
-
if (
|
|
9095
|
-
|
|
9113
|
+
if (t.kind === "error") {
|
|
9114
|
+
g({
|
|
9096
9115
|
type: "message",
|
|
9097
9116
|
title: "cd",
|
|
9098
|
-
message:
|
|
9117
|
+
message: t.message,
|
|
9099
9118
|
variant: "error"
|
|
9100
9119
|
});
|
|
9101
9120
|
return;
|
|
9102
9121
|
}
|
|
9103
|
-
let r =
|
|
9104
|
-
if (
|
|
9105
|
-
|
|
9106
|
-
...
|
|
9107
|
-
[
|
|
9122
|
+
let r = Ye.current === "left" ? $e.current : et.current, i = r.currentPath;
|
|
9123
|
+
if (t.kind === "setAlias") {
|
|
9124
|
+
s({ pathAliases: {
|
|
9125
|
+
...c.current.pathAliases,
|
|
9126
|
+
[t.alias]: Q(i)
|
|
9108
9127
|
} });
|
|
9109
9128
|
return;
|
|
9110
9129
|
}
|
|
9111
|
-
if (
|
|
9112
|
-
let e =
|
|
9130
|
+
if (t.kind === "goAlias") {
|
|
9131
|
+
let e = c.current.pathAliases?.[t.alias];
|
|
9113
9132
|
if (!e) {
|
|
9114
|
-
|
|
9133
|
+
g({
|
|
9115
9134
|
type: "message",
|
|
9116
9135
|
title: "cd",
|
|
9117
|
-
message: `Unknown alias: ${
|
|
9136
|
+
message: `Unknown alias: ${t.alias}`,
|
|
9118
9137
|
variant: "error"
|
|
9119
9138
|
});
|
|
9120
9139
|
return;
|
|
9121
9140
|
}
|
|
9122
9141
|
let i = Q(Tt(W(e)));
|
|
9123
|
-
if (!await ba(
|
|
9124
|
-
|
|
9142
|
+
if (!await ba(n, i)) {
|
|
9143
|
+
g({
|
|
9125
9144
|
type: "message",
|
|
9126
9145
|
title: "cd",
|
|
9127
9146
|
message: `Folder not found: ${i}`,
|
|
@@ -9132,10 +9151,10 @@ function Mo({ widget: e }) {
|
|
|
9132
9151
|
await r.navigateTo(i);
|
|
9133
9152
|
return;
|
|
9134
9153
|
}
|
|
9135
|
-
if (
|
|
9136
|
-
let e = await ya(
|
|
9137
|
-
if (!await ba(
|
|
9138
|
-
|
|
9154
|
+
if (t.kind === "chdir") {
|
|
9155
|
+
let e = await ya(n, t.pathArg, i);
|
|
9156
|
+
if (!await ba(n, e)) {
|
|
9157
|
+
g({
|
|
9139
9158
|
type: "message",
|
|
9140
9159
|
title: "cd",
|
|
9141
9160
|
message: `Path not found: ${e}`,
|
|
@@ -9145,80 +9164,80 @@ function Mo({ widget: e }) {
|
|
|
9145
9164
|
}
|
|
9146
9165
|
await r.navigateTo(e);
|
|
9147
9166
|
}
|
|
9148
|
-
}, [
|
|
9167
|
+
}, [g]);
|
|
9149
9168
|
o(() => {
|
|
9150
|
-
|
|
9151
|
-
}, [
|
|
9152
|
-
let { handleCopy:
|
|
9169
|
+
Te(() => rt);
|
|
9170
|
+
}, [rt, Te]);
|
|
9171
|
+
let { handleCopy: it, handleMove: at, handleMoveToTrash: ot, handlePermanentDelete: st, handleRename: ct } = _a(Ye, $e, et, Ce);
|
|
9153
9172
|
o(() => {
|
|
9154
|
-
|
|
9155
|
-
moveToTrash:
|
|
9156
|
-
permanentDelete:
|
|
9157
|
-
copy:
|
|
9158
|
-
move:
|
|
9159
|
-
rename:
|
|
9160
|
-
pasteToCommandLine: (e) =>
|
|
9173
|
+
qr({
|
|
9174
|
+
moveToTrash: ot,
|
|
9175
|
+
permanentDelete: st,
|
|
9176
|
+
copy: it,
|
|
9177
|
+
move: at,
|
|
9178
|
+
rename: ct,
|
|
9179
|
+
pasteToCommandLine: (e) => Ae.current(e)
|
|
9161
9180
|
});
|
|
9162
9181
|
}, [
|
|
9182
|
+
ot,
|
|
9183
|
+
st,
|
|
9163
9184
|
it,
|
|
9164
9185
|
at,
|
|
9165
|
-
|
|
9166
|
-
rt,
|
|
9167
|
-
ot
|
|
9186
|
+
ct
|
|
9168
9187
|
]), o(() => {
|
|
9169
|
-
H.setContext("leftPanelActive",
|
|
9170
|
-
}, [
|
|
9171
|
-
H.setContext("dialogOpen",
|
|
9172
|
-
}, [
|
|
9173
|
-
let
|
|
9188
|
+
H.setContext("leftPanelActive", T === "left"), H.setContext("rightPanelActive", T === "right");
|
|
9189
|
+
}, [T]), o(() => {
|
|
9190
|
+
H.setContext("dialogOpen", h !== null);
|
|
9191
|
+
}, [h]);
|
|
9192
|
+
let lt = i((e, t, n) => {
|
|
9174
9193
|
if (rn.resolve(q(e))) {
|
|
9175
|
-
|
|
9194
|
+
Qe.current(e + "\0");
|
|
9176
9195
|
return;
|
|
9177
9196
|
}
|
|
9178
|
-
|
|
9197
|
+
k({
|
|
9179
9198
|
path: e,
|
|
9180
9199
|
name: t,
|
|
9181
9200
|
size: n,
|
|
9182
|
-
panel:
|
|
9201
|
+
panel: Ye.current
|
|
9183
9202
|
});
|
|
9184
|
-
}, []),
|
|
9185
|
-
|
|
9203
|
+
}, []), ut = i((e, t, n, r) => {
|
|
9204
|
+
M({
|
|
9186
9205
|
path: e,
|
|
9187
9206
|
name: t,
|
|
9188
9207
|
size: n,
|
|
9189
9208
|
langId: r
|
|
9190
9209
|
});
|
|
9191
|
-
}, []),
|
|
9192
|
-
let i = await
|
|
9193
|
-
i || await
|
|
9210
|
+
}, []), dt = i(async (e, t, r) => {
|
|
9211
|
+
let i = await n.fs.exists(e);
|
|
9212
|
+
i || await n.fs.writeFile(e, ""), M({
|
|
9194
9213
|
path: e,
|
|
9195
|
-
name:
|
|
9196
|
-
size: i ? (await
|
|
9214
|
+
name: t,
|
|
9215
|
+
size: i ? (await n.fs.stat(e)).size : 0,
|
|
9197
9216
|
langId: r
|
|
9198
9217
|
});
|
|
9199
|
-
}, []),
|
|
9218
|
+
}, []), ft = O ? O.panel === "left" ? C.entries : w.entries : [], pt = i((e, t) => t.some((t) => {
|
|
9200
9219
|
if (t.startsWith("*.")) {
|
|
9201
9220
|
let n = t.slice(1).toLowerCase();
|
|
9202
9221
|
return e.toLowerCase().endsWith(n);
|
|
9203
9222
|
}
|
|
9204
9223
|
return e.toLowerCase() === t.toLowerCase();
|
|
9205
|
-
}), []),
|
|
9224
|
+
}), []), ht = i((e) => O ? (_ ? ft : ft.filter((e) => !e.meta.hidden)).filter((t) => t.type === "file" && pt(t.name, e)).map((e) => ({
|
|
9206
9225
|
path: e.path,
|
|
9207
9226
|
name: e.name,
|
|
9208
9227
|
size: Number(e.meta.size)
|
|
9209
9228
|
})).sort((e, t) => e.name.localeCompare(t.name)) : [], [
|
|
9210
|
-
|
|
9211
|
-
|
|
9212
|
-
|
|
9213
|
-
|
|
9214
|
-
]),
|
|
9229
|
+
O,
|
|
9230
|
+
ft,
|
|
9231
|
+
_,
|
|
9232
|
+
pt
|
|
9233
|
+
]), vt = i(async (e, t) => {
|
|
9215
9234
|
let { patterns: n } = t ?? {};
|
|
9216
|
-
if (!n || !
|
|
9217
|
-
let r =
|
|
9235
|
+
if (!n || !O) return;
|
|
9236
|
+
let r = ht(n), i = r.findIndex((e) => e.path === O.path);
|
|
9218
9237
|
if (e === "navigatePrev") {
|
|
9219
9238
|
if (i > 0) {
|
|
9220
9239
|
let e = r[i - 1];
|
|
9221
|
-
|
|
9240
|
+
k((t) => t ? {
|
|
9222
9241
|
...e,
|
|
9223
9242
|
panel: t.panel
|
|
9224
9243
|
} : null);
|
|
@@ -9228,7 +9247,7 @@ function Mo({ widget: e }) {
|
|
|
9228
9247
|
if (e === "navigateNext") {
|
|
9229
9248
|
if (i >= 0 && i < r.length - 1) {
|
|
9230
9249
|
let e = r[i + 1];
|
|
9231
|
-
|
|
9250
|
+
k((t) => t ? {
|
|
9232
9251
|
...e,
|
|
9233
9252
|
panel: t.panel
|
|
9234
9253
|
} : null);
|
|
@@ -9239,81 +9258,81 @@ function Mo({ widget: e }) {
|
|
|
9239
9258
|
index: i,
|
|
9240
9259
|
total: r.length
|
|
9241
9260
|
};
|
|
9242
|
-
}, [
|
|
9261
|
+
}, [O, ht]), yt = O ? tn.resolve(O.name) : null, bt = j ? nn.resolve(j.name) : null;
|
|
9243
9262
|
o(() => {
|
|
9244
|
-
|
|
9245
|
-
dirPath:
|
|
9246
|
-
entry:
|
|
9263
|
+
yt && P((e) => e?.dirPath === yt.extensionDirPath && e?.entry === yt.contribution.entry ? e : {
|
|
9264
|
+
dirPath: yt.extensionDirPath,
|
|
9265
|
+
entry: yt.contribution.entry
|
|
9247
9266
|
});
|
|
9248
|
-
}, [
|
|
9249
|
-
|
|
9250
|
-
dirPath:
|
|
9251
|
-
entry:
|
|
9267
|
+
}, [yt?.extensionDirPath, yt?.contribution.entry]), o(() => {
|
|
9268
|
+
bt && ee((e) => e?.dirPath === bt.extensionDirPath && e?.entry === bt.contribution.entry ? e : {
|
|
9269
|
+
dirPath: bt.extensionDirPath,
|
|
9270
|
+
entry: bt.contribution.entry
|
|
9252
9271
|
});
|
|
9253
|
-
}, [
|
|
9254
|
-
let
|
|
9255
|
-
activePanel:
|
|
9256
|
-
settingsLoaded:
|
|
9257
|
-
left:
|
|
9258
|
-
right:
|
|
9259
|
-
leftTabsRef:
|
|
9260
|
-
rightTabsRef:
|
|
9261
|
-
leftActiveTabIdRef:
|
|
9262
|
-
rightActiveTabIdRef:
|
|
9263
|
-
leftTabSelectionRef:
|
|
9264
|
-
rightTabSelectionRef:
|
|
9265
|
-
leftSelectedNameRef:
|
|
9266
|
-
rightSelectedNameRef:
|
|
9267
|
-
setLeftTabs:
|
|
9268
|
-
setRightTabs:
|
|
9269
|
-
setLeftActiveTabId:
|
|
9270
|
-
setRightActiveTabId:
|
|
9271
|
-
}),
|
|
9272
|
-
let e =
|
|
9272
|
+
}, [bt?.extensionDirPath, bt?.contribution.entry]);
|
|
9273
|
+
let xt = O && Oo(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 } = bo({
|
|
9274
|
+
activePanel: T,
|
|
9275
|
+
settingsLoaded: je,
|
|
9276
|
+
left: C,
|
|
9277
|
+
right: w,
|
|
9278
|
+
leftTabsRef: ve,
|
|
9279
|
+
rightTabsRef: ye,
|
|
9280
|
+
leftActiveTabIdRef: be,
|
|
9281
|
+
rightActiveTabIdRef: xe,
|
|
9282
|
+
leftTabSelectionRef: de,
|
|
9283
|
+
rightTabSelectionRef: fe,
|
|
9284
|
+
leftSelectedNameRef: le,
|
|
9285
|
+
rightSelectedNameRef: ue,
|
|
9286
|
+
setLeftTabs: ae,
|
|
9287
|
+
setRightTabs: oe,
|
|
9288
|
+
setLeftActiveTabId: ce,
|
|
9289
|
+
setRightActiveTabId: V
|
|
9290
|
+
}), G = i(() => {
|
|
9291
|
+
let e = Ye.current, t = sa[e], n = e === "left" ? C.currentPath : w.currentPath, r = (t === "left" ? be : xe).current, i = t === "left" ? ae : oe, a = t === "left" ? C : w;
|
|
9273
9292
|
i((e) => e.map((e) => e.id === r && e.type === "filelist" ? {
|
|
9274
9293
|
...e,
|
|
9275
9294
|
path: n
|
|
9276
|
-
} : e)), a.navigateTo(n),
|
|
9295
|
+
} : e)), a.navigateTo(n), E(t);
|
|
9277
9296
|
}, [
|
|
9278
|
-
S.currentPath,
|
|
9279
9297
|
C.currentPath,
|
|
9280
|
-
|
|
9281
|
-
C
|
|
9282
|
-
|
|
9283
|
-
|
|
9284
|
-
|
|
9298
|
+
w.currentPath,
|
|
9299
|
+
C,
|
|
9300
|
+
w
|
|
9301
|
+
]), K = i(() => {
|
|
9302
|
+
let e = Ye.current, t = sa[e], n = e === "left" ? C.currentPath : w.currentPath, r = ki(n), i = t === "left" ? ae : oe, a = t === "left" ? ce : V, o = t === "left" ? C : w;
|
|
9303
|
+
i((e) => [...e, r]), a(r.id), o.navigateTo(n), E(t);
|
|
9285
9304
|
}, [
|
|
9286
|
-
S.currentPath,
|
|
9287
9305
|
C.currentPath,
|
|
9288
|
-
|
|
9289
|
-
C
|
|
9290
|
-
|
|
9291
|
-
|
|
9306
|
+
w.currentPath,
|
|
9307
|
+
C,
|
|
9308
|
+
w
|
|
9309
|
+
]), Et = i(() => {
|
|
9310
|
+
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;
|
|
9292
9311
|
if (!r || r.type !== "folder") return;
|
|
9293
|
-
let i = r.path, a = sa[e], o = (a === "left" ?
|
|
9312
|
+
let i = r.path, a = sa[e], o = (a === "left" ? be : xe).current, s = a === "left" ? ae : oe, c = a === "left" ? C : w;
|
|
9294
9313
|
s((e) => e.map((e) => e.id === o && e.type === "filelist" ? {
|
|
9295
9314
|
...e,
|
|
9296
9315
|
path: i
|
|
9297
|
-
} : e)), c.navigateTo(i),
|
|
9316
|
+
} : e)), c.navigateTo(i), E(a);
|
|
9298
9317
|
}, [
|
|
9299
|
-
S.entries,
|
|
9300
9318
|
C.entries,
|
|
9301
|
-
|
|
9302
|
-
C
|
|
9303
|
-
|
|
9304
|
-
|
|
9319
|
+
w.entries,
|
|
9320
|
+
C,
|
|
9321
|
+
w
|
|
9322
|
+
]), Dt = i(() => {
|
|
9323
|
+
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;
|
|
9305
9324
|
if (!r || r.type !== "folder") return;
|
|
9306
|
-
let i = r.path, a = sa[e], o = ki(i), s = a === "left" ?
|
|
9307
|
-
s((e) => [...e, o]), c(o.id), l.navigateTo(i),
|
|
9325
|
+
let i = r.path, a = sa[e], o = ki(i), s = a === "left" ? ae : oe, c = a === "left" ? ce : V, l = a === "left" ? C : w;
|
|
9326
|
+
s((e) => [...e, o]), c(o.id), l.navigateTo(i), E(a);
|
|
9308
9327
|
}, [
|
|
9309
|
-
S.entries,
|
|
9310
9328
|
C.entries,
|
|
9311
|
-
|
|
9312
|
-
C
|
|
9313
|
-
|
|
9314
|
-
|
|
9329
|
+
w.entries,
|
|
9330
|
+
C,
|
|
9331
|
+
w
|
|
9332
|
+
]), Ot = i(() => {
|
|
9333
|
+
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;
|
|
9315
9334
|
if (!r || r.type !== "file") return;
|
|
9316
|
-
let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c = sa[e], l = (c === "left" ?
|
|
9335
|
+
let i = r.path, a = r.name, o = Number(r.meta.size), s = e, c = sa[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);
|
|
9317
9336
|
if (f && f.type === "preview") u((e) => e.map((e) => e.id === f.id ? {
|
|
9318
9337
|
...e,
|
|
9319
9338
|
path: i,
|
|
@@ -9325,91 +9344,105 @@ function Mo({ widget: e }) {
|
|
|
9325
9344
|
let e = Ai(i, a, o, s);
|
|
9326
9345
|
u((t) => [...t, e]), d(e.id);
|
|
9327
9346
|
}
|
|
9328
|
-
|
|
9329
|
-
}, [
|
|
9330
|
-
o(() => (
|
|
9331
|
-
let
|
|
9332
|
-
|
|
9333
|
-
let
|
|
9334
|
-
|
|
9335
|
-
if (
|
|
9336
|
-
|
|
9337
|
-
let e =
|
|
9338
|
-
e?.type === "filelist" && e.path != null && S.navigateTo(e.path);
|
|
9339
|
-
}, [z]), o(() => {
|
|
9340
|
-
if (fe.current === se) return;
|
|
9341
|
-
fe.current = se;
|
|
9342
|
-
let e = _e.current.find((e) => e.id === se);
|
|
9347
|
+
E(c);
|
|
9348
|
+
}, [C.entries, w.entries]);
|
|
9349
|
+
o(() => (n.theme.get().then((e) => l(e)), n.theme.onChange((e) => l(e))), []);
|
|
9350
|
+
let kt = u(C.currentPath);
|
|
9351
|
+
kt.current = C.currentPath;
|
|
9352
|
+
let At = u(w.currentPath);
|
|
9353
|
+
At.current = w.currentPath, o(() => {
|
|
9354
|
+
if (me.current === se) return;
|
|
9355
|
+
me.current = se;
|
|
9356
|
+
let e = ve.current.find((e) => e.id === se);
|
|
9343
9357
|
e?.type === "filelist" && e.path != null && C.navigateTo(e.path);
|
|
9344
|
-
}, [se])
|
|
9345
|
-
|
|
9358
|
+
}, [se]), o(() => {
|
|
9359
|
+
if (he.current === B) return;
|
|
9360
|
+
he.current = B;
|
|
9361
|
+
let e = ye.current.find((e) => e.id === B);
|
|
9362
|
+
e?.type === "filelist" && e.path != null && w.navigateTo(e.path);
|
|
9363
|
+
}, [B]);
|
|
9364
|
+
let jt = u(C.currentPath), Mt = u(w.currentPath);
|
|
9346
9365
|
o(() => {
|
|
9347
|
-
|
|
9348
|
-
let t = e.findIndex((e) => e.id ===
|
|
9366
|
+
jt.current !== C.currentPath && (jt.current = C.currentPath, ae((e) => {
|
|
9367
|
+
let t = e.findIndex((e) => e.id === se);
|
|
9349
9368
|
if (t < 0) return e;
|
|
9350
9369
|
let n = e[t];
|
|
9351
|
-
if (n?.type !== "filelist" || n.path ===
|
|
9370
|
+
if (n?.type !== "filelist" || n.path === C.currentPath) return e;
|
|
9352
9371
|
let r = [...e];
|
|
9353
9372
|
return r[t] = {
|
|
9354
9373
|
...n,
|
|
9355
|
-
path:
|
|
9374
|
+
path: C.currentPath
|
|
9356
9375
|
}, r;
|
|
9357
9376
|
}));
|
|
9358
|
-
}, [
|
|
9359
|
-
|
|
9360
|
-
let t = e.findIndex((e) => e.id ===
|
|
9377
|
+
}, [C.currentPath, se]), o(() => {
|
|
9378
|
+
Mt.current !== w.currentPath && (Mt.current = w.currentPath, oe((e) => {
|
|
9379
|
+
let t = e.findIndex((e) => e.id === B);
|
|
9361
9380
|
if (t < 0) return e;
|
|
9362
9381
|
let n = e[t];
|
|
9363
|
-
if (n?.type !== "filelist" || n.path ===
|
|
9382
|
+
if (n?.type !== "filelist" || n.path === w.currentPath) return e;
|
|
9364
9383
|
let r = [...e];
|
|
9365
9384
|
return r[t] = {
|
|
9366
9385
|
...n,
|
|
9367
|
-
path:
|
|
9386
|
+
path: w.currentPath
|
|
9368
9387
|
}, r;
|
|
9369
9388
|
}));
|
|
9370
|
-
}, [
|
|
9371
|
-
if (!
|
|
9372
|
-
let e = async (e,
|
|
9373
|
-
let i =
|
|
9374
|
-
i && (await
|
|
9389
|
+
}, [w.currentPath, B]), o(() => {
|
|
9390
|
+
if (!je) return;
|
|
9391
|
+
let e = async (e, t, r) => {
|
|
9392
|
+
let i = t?.currentPath ?? r;
|
|
9393
|
+
i && (await n.fs.exists(i) || (i = await ao(n, i))), i ||= await n.utils.getHomePath(), await e.navigateTo(i);
|
|
9375
9394
|
};
|
|
9376
|
-
e(
|
|
9377
|
-
|
|
9395
|
+
e(C, Me), e(w, Re), ze && E(ze), setTimeout(() => {
|
|
9396
|
+
He(void 0), Ue(void 0), Ke(void 0);
|
|
9378
9397
|
}, 500);
|
|
9379
|
-
}, [
|
|
9380
|
-
settingsLoaded:
|
|
9398
|
+
}, [je]), ha({
|
|
9399
|
+
settingsLoaded: je,
|
|
9381
9400
|
onRefreshPanels: () => {
|
|
9382
|
-
|
|
9401
|
+
$e.current.refresh(), et.current.refresh();
|
|
9383
9402
|
}
|
|
9384
9403
|
});
|
|
9385
|
-
let
|
|
9386
|
-
(
|
|
9387
|
-
}, []),
|
|
9388
|
-
activePanelCwd:
|
|
9389
|
-
onNavigatePanel:
|
|
9404
|
+
let Nt = i((e) => {
|
|
9405
|
+
(Ye.current === "left" ? $e.current : et.current).navigateTo(e);
|
|
9406
|
+
}, []), Pt = lo({
|
|
9407
|
+
activePanelCwd: T === "left" ? C.currentPath : w.currentPath,
|
|
9408
|
+
onNavigatePanel: Nt
|
|
9390
9409
|
});
|
|
9391
|
-
return
|
|
9392
|
-
leftRef:
|
|
9393
|
-
rightRef:
|
|
9394
|
-
onPreviewInOppositePanel:
|
|
9395
|
-
onOpenCurrentFolderInOppositeCurrentTab:
|
|
9396
|
-
onOpenCurrentFolderInOppositeNewTab:
|
|
9397
|
-
onOpenSelectedFolderInOppositeCurrentTab:
|
|
9398
|
-
onOpenSelectedFolderInOppositeNewTab:
|
|
9399
|
-
onOpenCreateFileConfirm:
|
|
9400
|
-
showDialog:
|
|
9401
|
-
onViewFile:
|
|
9402
|
-
onEditFile:
|
|
9403
|
-
onExecuteInTerminal: (e) =>
|
|
9404
|
-
editorFileSizeLimit:
|
|
9410
|
+
return nt.current = Pt.activeCwd, $a({
|
|
9411
|
+
leftRef: $e,
|
|
9412
|
+
rightRef: et,
|
|
9413
|
+
onPreviewInOppositePanel: Ot,
|
|
9414
|
+
onOpenCurrentFolderInOppositeCurrentTab: G,
|
|
9415
|
+
onOpenCurrentFolderInOppositeNewTab: K,
|
|
9416
|
+
onOpenSelectedFolderInOppositeCurrentTab: Et,
|
|
9417
|
+
onOpenSelectedFolderInOppositeNewTab: Dt,
|
|
9418
|
+
onOpenCreateFileConfirm: dt,
|
|
9419
|
+
showDialog: g,
|
|
9420
|
+
onViewFile: lt,
|
|
9421
|
+
onEditFile: ut,
|
|
9422
|
+
onExecuteInTerminal: (e) => Pt.writeToTerminal(e),
|
|
9423
|
+
editorFileSizeLimit: re
|
|
9405
9424
|
}), o(() => {
|
|
9406
|
-
|
|
9407
|
-
|
|
9425
|
+
let e = (e) => {
|
|
9426
|
+
let t = e;
|
|
9427
|
+
if (!t) return !1;
|
|
9428
|
+
let n = t.tagName?.toLowerCase();
|
|
9429
|
+
return n === "input" || n === "textarea" || n === "select" || t.isContentEditable;
|
|
9430
|
+
}, n = (n) => {
|
|
9431
|
+
let r = t.current, i = n.target;
|
|
9432
|
+
if (!r || !i || !r.contains(i) || e(i)) return;
|
|
9433
|
+
let a = A.current;
|
|
9434
|
+
a !== "panel" && a !== "viewer" && a !== "editor" || H.handleKeyboardEvent(n);
|
|
9435
|
+
};
|
|
9436
|
+
return window.addEventListener("keydown", n, !0), () => window.removeEventListener("keydown", n, !0);
|
|
9437
|
+
}, []), o(() => {
|
|
9438
|
+
if (n.onReconnect) return n.onReconnect(() => {
|
|
9439
|
+
$e.current.navigateTo(kt.current), et.current.navigateTo(At.current);
|
|
9408
9440
|
});
|
|
9409
|
-
}, []), !
|
|
9441
|
+
}, []), !C.currentPath || !w.currentPath || !_e ? /* @__PURE__ */ p("div", {
|
|
9410
9442
|
className: jo.loading,
|
|
9411
9443
|
children: "Loading..."
|
|
9412
9444
|
}) : /* @__PURE__ */ m("div", {
|
|
9445
|
+
ref: t,
|
|
9413
9446
|
className: jo.app,
|
|
9414
9447
|
children: [
|
|
9415
9448
|
/* @__PURE__ */ m(f, { children: [
|
|
@@ -9419,23 +9452,23 @@ function Mo({ widget: e }) {
|
|
|
9419
9452
|
className: U["terminal-background"],
|
|
9420
9453
|
children: /* @__PURE__ */ p(oa, {})
|
|
9421
9454
|
}), /* @__PURE__ */ m("div", {
|
|
9422
|
-
className: F(wi, "panels-overlay", !
|
|
9455
|
+
className: F(wi, "panels-overlay", !D && "hidden"),
|
|
9423
9456
|
children: [/* @__PURE__ */ p(Wi, {
|
|
9424
9457
|
side: "left",
|
|
9425
|
-
panel:
|
|
9426
|
-
onRememberExpectedTerminalCwd:
|
|
9427
|
-
selectionKey:
|
|
9428
|
-
requestedActiveName:
|
|
9429
|
-
initialPanelState:
|
|
9430
|
-
onStateChange: (e, t) =>
|
|
9458
|
+
panel: C,
|
|
9459
|
+
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9460
|
+
selectionKey: Se,
|
|
9461
|
+
requestedActiveName: St,
|
|
9462
|
+
initialPanelState: Me,
|
|
9463
|
+
onStateChange: (e, t) => wt("left", e, t)
|
|
9431
9464
|
}), /* @__PURE__ */ p(Wi, {
|
|
9432
9465
|
side: "right",
|
|
9433
|
-
panel:
|
|
9434
|
-
onRememberExpectedTerminalCwd:
|
|
9435
|
-
selectionKey:
|
|
9436
|
-
requestedActiveName:
|
|
9437
|
-
initialPanelState:
|
|
9438
|
-
onStateChange: (e, t) =>
|
|
9466
|
+
panel: w,
|
|
9467
|
+
onRememberExpectedTerminalCwd: Pt.rememberExpectedTerminalCwd,
|
|
9468
|
+
selectionKey: Se,
|
|
9469
|
+
requestedActiveName: Ct,
|
|
9470
|
+
initialPanelState: Re,
|
|
9471
|
+
onStateChange: (e, t) => wt("right", e, t)
|
|
9439
9472
|
})]
|
|
9440
9473
|
})]
|
|
9441
9474
|
}),
|
|
@@ -9446,48 +9479,48 @@ function Mo({ widget: e }) {
|
|
|
9446
9479
|
className: jo["status-bar"],
|
|
9447
9480
|
children: [/* @__PURE__ */ p(tt, {}), e]
|
|
9448
9481
|
}),
|
|
9449
|
-
|
|
9482
|
+
O && !yt && /* @__PURE__ */ p(pe, {
|
|
9450
9483
|
title: "No viewer",
|
|
9451
9484
|
message: "No viewer extension found for this file type. Install viewer extensions (e.g. Image Viewer, File Viewer) from the extensions panel.",
|
|
9452
|
-
onClose: () =>
|
|
9485
|
+
onClose: () => k(null)
|
|
9453
9486
|
}),
|
|
9454
|
-
|
|
9455
|
-
extensionDirPath:
|
|
9456
|
-
entry:
|
|
9457
|
-
filePath:
|
|
9458
|
-
fileName:
|
|
9459
|
-
fileSize:
|
|
9460
|
-
visible:
|
|
9461
|
-
onClose: () =>
|
|
9462
|
-
onExecuteCommand:
|
|
9463
|
-
}, `viewer:${
|
|
9464
|
-
|
|
9487
|
+
N && /* @__PURE__ */ p(wn, {
|
|
9488
|
+
extensionDirPath: N.dirPath,
|
|
9489
|
+
entry: N.entry,
|
|
9490
|
+
filePath: O?.path ?? "",
|
|
9491
|
+
fileName: O?.name ?? "",
|
|
9492
|
+
fileSize: O?.size ?? 0,
|
|
9493
|
+
visible: O != null && yt != null,
|
|
9494
|
+
onClose: () => k(null),
|
|
9495
|
+
onExecuteCommand: vt
|
|
9496
|
+
}, `viewer:${N.dirPath}:${N.entry}`),
|
|
9497
|
+
j && !bt && /* @__PURE__ */ p(pe, {
|
|
9465
9498
|
title: "No editor",
|
|
9466
9499
|
message: "No editor extension found for this file type. Install an editor extension (e.g. Monaco Editor) from the extensions panel.",
|
|
9467
|
-
onClose: () =>
|
|
9500
|
+
onClose: () => M(null)
|
|
9468
9501
|
}),
|
|
9469
|
-
|
|
9470
|
-
let e =
|
|
9502
|
+
I && (() => {
|
|
9503
|
+
let e = ge.flatMap((e) => e.languages ?? []), t = ge.flatMap((e) => e.grammarRefs ?? []).map((e) => ({
|
|
9471
9504
|
contribution: e.contribution,
|
|
9472
9505
|
path: e.path
|
|
9473
9506
|
}));
|
|
9474
|
-
return /* @__PURE__ */ p(
|
|
9475
|
-
extensionDirPath:
|
|
9476
|
-
entry:
|
|
9477
|
-
filePath:
|
|
9478
|
-
fileName:
|
|
9479
|
-
langId:
|
|
9480
|
-
visible:
|
|
9481
|
-
onClose: () =>
|
|
9507
|
+
return /* @__PURE__ */ p(Tn, {
|
|
9508
|
+
extensionDirPath: I.dirPath,
|
|
9509
|
+
entry: I.entry,
|
|
9510
|
+
filePath: j?.path ?? "",
|
|
9511
|
+
fileName: j?.name ?? "",
|
|
9512
|
+
langId: j?.langId ?? "plaintext",
|
|
9513
|
+
visible: j != null && bt != null,
|
|
9514
|
+
onClose: () => M(null),
|
|
9482
9515
|
languages: e,
|
|
9483
9516
|
grammars: t
|
|
9484
|
-
}, `editor:${
|
|
9517
|
+
}, `editor:${I.dirPath}:${I.entry}`);
|
|
9485
9518
|
})(),
|
|
9486
|
-
|
|
9519
|
+
te && /* @__PURE__ */ p(yr, {}),
|
|
9487
9520
|
/* @__PURE__ */ p(Ee, {}),
|
|
9488
9521
|
/* @__PURE__ */ p(gt, {
|
|
9489
|
-
open:
|
|
9490
|
-
onOpenChange:
|
|
9522
|
+
open: we.open,
|
|
9523
|
+
onOpenChange: we.setOpen
|
|
9491
9524
|
})
|
|
9492
9525
|
]
|
|
9493
9526
|
});
|