@dyyz1993/codenomad 0.15.8 → 0.15.11
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/auth/manager.js +2 -1
- package/dist/auth/session-manager.js +45 -1
- package/dist/bin.js +0 -0
- package/dist/index.js +1 -0
- package/dist/settings/binaries.js +15 -3
- package/dist/settings/service.js +21 -0
- package/dist/settings/yaml-doc-store.js +5 -0
- package/dist/sidecars/manager.js +1 -1
- package/dist/speech/service.js +17 -0
- package/dist/workspaces/instance-events.js +9 -1
- package/dist/workspaces/manager.js +53 -2
- package/package.json +1 -1
- package/public/assets/{ChangesTab-DQO3bwTw.js → ChangesTab-DYNcRoeh.js} +2 -2
- package/public/assets/{DiffToolbar-BiS5nvB_.js → DiffToolbar-DY12K09c.js} +1 -1
- package/public/assets/{FilesTab-YO5dUGk6.js → FilesTab-BOw6wVxG.js} +2 -2
- package/public/assets/{GitChangesTab-C-2jwtOS.js → GitChangesTab-DmQJ6Vak.js} +2 -2
- package/public/assets/{SplitFilePanel-CA0D92l1.js → SplitFilePanel-Bill25lM.js} +1 -1
- package/public/assets/{StatusTab-TyebZVp2.js → StatusTab-CJnEHguL.js} +1 -1
- package/public/assets/{align-justify-COuYjEB9.js → align-justify-10t2qfxF.js} +1 -1
- package/public/assets/{bundle-full-DPp09th5.js → bundle-full-DS3qEgVu.js} +1 -1
- package/public/assets/{diff-viewer-Bu4zb5kE.js → diff-viewer-BeR1VVw4.js} +1 -1
- package/public/assets/{index-BDgGoLTZ.js → index-5RAw7gXh.js} +1 -1
- package/public/assets/{index-4Era_AEC.js → index-BhrKP65n.js} +1 -1
- package/public/assets/{index-nVoKL-cq.js → index-Bvvj_24o.js} +1 -1
- package/public/assets/{index-PHCXc0OA.js → index-CA1854v0.js} +1 -1
- package/public/assets/{index-BCGPLzO4.js → index-DD4SyatU.js} +2 -2
- package/public/assets/{index-CbKJK9y3.js → index-DIVuya9y.js} +1 -1
- package/public/assets/{index-D7V1TD3s.js → index-DW5zrp3y.js} +1 -1
- package/public/assets/{index-CpWDdROQ.js → index-EwiZC5ky.js} +1 -1
- package/public/assets/{index-CtBkkWFK.js → index-sxXJQeVv.js} +1 -1
- package/public/assets/{loading-B-F_vBbv.js → loading-Bxde4rtI.js} +1 -1
- package/public/assets/{main-BbYl9PoY.js → main-CdZwzERp.js} +30 -30
- package/public/assets/{markdown-0Y5sUdRs.js → markdown-Bl7BpCH9.js} +3 -3
- package/public/assets/{monaco-viewer-YY9yfE-p.js → monaco-viewer-CNzvK57I.js} +1 -1
- package/public/assets/{tool-call-CE2RkP4E.js → tool-call-BGNHr1DQ.js} +3 -3
- package/public/assets/{unified-picker-_n2WoeTG.js → unified-picker-DimB1aiI.js} +1 -1
- package/public/assets/{wrap-text-DVQ19pj7.js → wrap-text-CaCUirML.js} +1 -1
- package/public/index.html +3 -3
- package/public/loading.html +3 -3
- package/public/sw.js +1 -1
- package/public/ui-version.json +1 -1
package/dist/auth/manager.js
CHANGED
|
@@ -10,9 +10,10 @@ export class AuthManager {
|
|
|
10
10
|
constructor(init, logger) {
|
|
11
11
|
this.init = init;
|
|
12
12
|
this.logger = logger;
|
|
13
|
-
this.sessionManager = new SessionManager();
|
|
14
13
|
this.cookieName = sanitizeCookieName(init.cookieName);
|
|
15
14
|
this.authEnabled = !Boolean(init.dangerouslySkipAuth);
|
|
15
|
+
const configDir = path.dirname(path.resolve(init.configPath.replace(/^~/, process.env.HOME ?? "")));
|
|
16
|
+
this.sessionManager = new SessionManager(configDir);
|
|
16
17
|
if (!this.authEnabled) {
|
|
17
18
|
this.authStore = null;
|
|
18
19
|
this.tokenManager = null;
|
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import crypto from "crypto";
|
|
2
|
+
import os from "os";
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
2
6
|
const SESSION_TTL_MS = 315360000 * 1000; // 10 years in ms
|
|
3
7
|
const CLEANUP_INTERVAL_MS = 30 * 60 * 1000;
|
|
4
8
|
export class SessionManager {
|
|
5
|
-
constructor() {
|
|
9
|
+
constructor(configDir) {
|
|
6
10
|
this.sessions = new Map();
|
|
11
|
+
this.stateFilePath = path.join(configDir ?? path.join(os.homedir(), ".config", "codenomad"), "sessions-state.json");
|
|
12
|
+
void this.loadState();
|
|
7
13
|
this.cleanupTimer = setInterval(() => this.cleanupExpired(), CLEANUP_INTERVAL_MS);
|
|
8
14
|
}
|
|
9
15
|
createSession(username) {
|
|
10
16
|
const id = crypto.randomBytes(32).toString("base64url");
|
|
11
17
|
const info = { id, createdAt: Date.now(), username };
|
|
12
18
|
this.sessions.set(id, info);
|
|
19
|
+
void this.saveState();
|
|
13
20
|
return info;
|
|
14
21
|
}
|
|
15
22
|
getSession(id) {
|
|
@@ -36,11 +43,48 @@ export class SessionManager {
|
|
|
36
43
|
}
|
|
37
44
|
cleanupExpired() {
|
|
38
45
|
const now = Date.now();
|
|
46
|
+
let changed = false;
|
|
39
47
|
for (const [id, info] of this.sessions) {
|
|
40
48
|
if (now - info.createdAt > SESSION_TTL_MS) {
|
|
41
49
|
this.sessions.delete(id);
|
|
50
|
+
changed = true;
|
|
42
51
|
}
|
|
43
52
|
}
|
|
53
|
+
if (changed) {
|
|
54
|
+
void this.saveState();
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
async saveState() {
|
|
58
|
+
const data = Array.from(this.sessions.entries()).map(([id, info]) => ({
|
|
59
|
+
id,
|
|
60
|
+
username: info.username,
|
|
61
|
+
createdAt: info.createdAt,
|
|
62
|
+
}));
|
|
63
|
+
try {
|
|
64
|
+
await mkdir(path.dirname(this.stateFilePath), { recursive: true });
|
|
65
|
+
await writeFile(this.stateFilePath, JSON.stringify(data, null, 2), "utf-8");
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// silently fail
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async loadState() {
|
|
72
|
+
try {
|
|
73
|
+
if (!existsSync(this.stateFilePath))
|
|
74
|
+
return;
|
|
75
|
+
const content = await readFile(this.stateFilePath, "utf-8");
|
|
76
|
+
const entries = JSON.parse(content);
|
|
77
|
+
for (const entry of entries) {
|
|
78
|
+
this.sessions.set(entry.id, {
|
|
79
|
+
id: entry.id,
|
|
80
|
+
username: entry.username,
|
|
81
|
+
createdAt: entry.createdAt,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// silently fail
|
|
87
|
+
}
|
|
44
88
|
}
|
|
45
89
|
shutdown() {
|
|
46
90
|
if (this.cleanupTimer) {
|
package/dist/bin.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,18 @@ function prettyLabel(p) {
|
|
|
3
3
|
const last = parts[parts.length - 1] || p;
|
|
4
4
|
return last || p;
|
|
5
5
|
}
|
|
6
|
+
function readUiBinariesSync(settings) {
|
|
7
|
+
const ui = settings.getOwnerSync("state", "ui");
|
|
8
|
+
const list = ui?.opencodeBinaries;
|
|
9
|
+
if (!Array.isArray(list))
|
|
10
|
+
return [];
|
|
11
|
+
return list.filter((item) => item && typeof item === "object" && typeof item.path === "string");
|
|
12
|
+
}
|
|
13
|
+
function readDefaultBinaryPathSync(settings) {
|
|
14
|
+
const server = settings.getOwnerSync("config", "server");
|
|
15
|
+
const value = server?.opencodeBinary;
|
|
16
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : undefined;
|
|
17
|
+
}
|
|
6
18
|
async function readUiBinaries(settings) {
|
|
7
19
|
const ui = await settings.getOwner("state", "ui");
|
|
8
20
|
const list = ui?.opencodeBinaries;
|
|
@@ -20,11 +32,11 @@ export class BinaryResolver {
|
|
|
20
32
|
this.settings = settings;
|
|
21
33
|
}
|
|
22
34
|
async list() {
|
|
23
|
-
return readUiBinaries(this.settings);
|
|
35
|
+
return readUiBinariesSync(this.settings) ?? readUiBinaries(this.settings);
|
|
24
36
|
}
|
|
25
37
|
async resolveDefault() {
|
|
26
|
-
const binaries = await this.
|
|
27
|
-
const configuredDefault = await readDefaultBinaryPath(this.settings);
|
|
38
|
+
const binaries = readUiBinariesSync(this.settings) ?? (await readUiBinaries(this.settings));
|
|
39
|
+
const configuredDefault = readDefaultBinaryPathSync(this.settings) ?? (await readDefaultBinaryPath(this.settings));
|
|
28
40
|
const fallback = binaries[0]?.path;
|
|
29
41
|
const path = configuredDefault ?? fallback ?? "opencode";
|
|
30
42
|
const entry = binaries.find((b) => b.path === path);
|
package/dist/settings/service.js
CHANGED
|
@@ -51,6 +51,27 @@ export class SettingsService {
|
|
|
51
51
|
this.configStore = new YamlDocStore(location.configYamlPath, logger.child({ component: "settings-config" }));
|
|
52
52
|
this.stateStore = new YamlDocStore(location.stateYamlPath, logger.child({ component: "settings-state" }));
|
|
53
53
|
}
|
|
54
|
+
getDocSync(kind) {
|
|
55
|
+
const store = kind === "config" ? this.configStore : this.stateStore;
|
|
56
|
+
const data = store.getSync();
|
|
57
|
+
if (!data)
|
|
58
|
+
return undefined;
|
|
59
|
+
if (kind === "config")
|
|
60
|
+
return normalizeConfigDoc(data);
|
|
61
|
+
return data;
|
|
62
|
+
}
|
|
63
|
+
getOwnerSync(kind, owner) {
|
|
64
|
+
if (kind !== "config") {
|
|
65
|
+
const data = this.stateStore.getSync();
|
|
66
|
+
return data ? (isPlainObject(data?.[owner]) ? data?.[owner] : {}) : undefined;
|
|
67
|
+
}
|
|
68
|
+
const doc = this.getDocSync("config");
|
|
69
|
+
if (!doc)
|
|
70
|
+
return undefined;
|
|
71
|
+
if (owner === "server")
|
|
72
|
+
return normalizeServerConfigOwner(doc.server);
|
|
73
|
+
return doc?.[owner];
|
|
74
|
+
}
|
|
54
75
|
async getDoc(kind) {
|
|
55
76
|
if (kind !== "config") {
|
|
56
77
|
return this.stateStore.get();
|
package/dist/sidecars/manager.js
CHANGED
|
@@ -149,7 +149,7 @@ export class SideCarManager {
|
|
|
149
149
|
await this.options.settings.mergePatchOwner("config", "server", { sidecars });
|
|
150
150
|
}
|
|
151
151
|
async loadConfiguredSideCars() {
|
|
152
|
-
const serverConfig = await this.options.settings.getOwner("config", "server");
|
|
152
|
+
const serverConfig = (this.options.settings.getOwnerSync("config", "server") ?? await this.options.settings.getOwner("config", "server"));
|
|
153
153
|
const list = Array.isArray(serverConfig?.sidecars) ? serverConfig.sidecars : [];
|
|
154
154
|
const records = [];
|
|
155
155
|
for (const item of list) {
|
package/dist/speech/service.js
CHANGED
|
@@ -42,7 +42,24 @@ export class SpeechService {
|
|
|
42
42
|
logger: this.logger.child({ provider: settings.provider }),
|
|
43
43
|
});
|
|
44
44
|
}
|
|
45
|
+
resolveSettingsSync() {
|
|
46
|
+
const owner = this.settings.getOwnerSync("config", "server") ?? {};
|
|
47
|
+
const parsed = ServerSpeechSettingsSchema.parse(owner);
|
|
48
|
+
const speech = parsed.speech ?? {};
|
|
49
|
+
return {
|
|
50
|
+
provider: speech.provider?.trim() || DEFAULT_PROVIDER,
|
|
51
|
+
apiKey: speech.apiKey?.trim() || process.env.OPENAI_API_KEY,
|
|
52
|
+
baseUrl: speech.baseUrl?.trim() || process.env.OPENAI_BASE_URL || undefined,
|
|
53
|
+
sttModel: speech.sttModel?.trim() || DEFAULT_STT_MODEL,
|
|
54
|
+
ttsModel: speech.ttsModel?.trim() || DEFAULT_TTS_MODEL,
|
|
55
|
+
ttsVoice: speech.ttsVoice?.trim() || DEFAULT_TTS_VOICE,
|
|
56
|
+
ttsFormat: speech.ttsFormat ?? DEFAULT_TTS_FORMAT,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
45
59
|
async resolveSettings() {
|
|
60
|
+
const syncResult = this.resolveSettingsSync();
|
|
61
|
+
if (syncResult.apiKey || process.env.OPENAI_API_KEY)
|
|
62
|
+
return syncResult;
|
|
46
63
|
const parsed = ServerSpeechSettingsSchema.parse(await this.settings.getOwner("config", "server") ?? {});
|
|
47
64
|
const speech = parsed.speech ?? {};
|
|
48
65
|
return {
|
|
@@ -15,6 +15,8 @@ const INSTANCE_HOST = "127.0.0.1";
|
|
|
15
15
|
const STREAM_AGENT = new UndiciAgent({ bodyTimeout: 0, headersTimeout: 0 });
|
|
16
16
|
const RECONNECT_DELAY_MS = 1000;
|
|
17
17
|
const LOG_THROTTLE_MS = 50;
|
|
18
|
+
const ACTIVITY_THROTTLE_MS = 1000;
|
|
19
|
+
const activityThrottleTime = new Map();
|
|
18
20
|
export class InstanceEventBridge {
|
|
19
21
|
constructor(options) {
|
|
20
22
|
this.options = options;
|
|
@@ -62,6 +64,7 @@ export class InstanceEventBridge {
|
|
|
62
64
|
active.controller.abort();
|
|
63
65
|
this.streams.delete(workspaceId);
|
|
64
66
|
this.lastLogTime.delete(workspaceId);
|
|
67
|
+
activityThrottleTime.delete(workspaceId);
|
|
65
68
|
this.publishStatus(workspaceId, "disconnected", reason);
|
|
66
69
|
}
|
|
67
70
|
async runStream(workspaceId, signal) {
|
|
@@ -124,7 +127,12 @@ export class InstanceEventBridge {
|
|
|
124
127
|
return buffer;
|
|
125
128
|
}
|
|
126
129
|
processChunk(chunk, workspaceId) {
|
|
127
|
-
|
|
130
|
+
const now = Date.now();
|
|
131
|
+
const lastTime = activityThrottleTime.get(workspaceId) ?? 0;
|
|
132
|
+
if (now - lastTime >= ACTIVITY_THROTTLE_MS) {
|
|
133
|
+
this.options.workspaceManager.recordActivity(workspaceId);
|
|
134
|
+
activityThrottleTime.set(workspaceId, now);
|
|
135
|
+
}
|
|
128
136
|
const lines = chunk.split(/\r?\n/);
|
|
129
137
|
const dataLines = [];
|
|
130
138
|
for (const line of lines) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import os from "os";
|
|
1
2
|
import path from "path";
|
|
2
3
|
import { execFile } from "node:child_process";
|
|
3
4
|
import { promisify } from "node:util";
|
|
4
5
|
import { connect } from "net";
|
|
6
|
+
import { readFile, writeFile, mkdir } from "node:fs/promises";
|
|
7
|
+
import { existsSync } from "node:fs";
|
|
5
8
|
const execFileAsync = promisify(execFile);
|
|
6
9
|
import { FileSystemBrowser } from "../filesystem/browser";
|
|
7
10
|
import { searchWorkspaceFiles } from "../filesystem/search";
|
|
@@ -42,8 +45,52 @@ export class WorkspaceManager {
|
|
|
42
45
|
this.workspaceBusy = new Map();
|
|
43
46
|
this.runtime = new WorkspaceRuntime(this.options.eventBus, this.options.logger);
|
|
44
47
|
this.opencodeConfigDir = getOpencodeConfigDir();
|
|
48
|
+
this.stateFilePath = path.join(this.options.configDir ?? path.join(os.homedir(), ".config", "codenomad"), "workspaces-state.json");
|
|
49
|
+
void this.loadState();
|
|
45
50
|
this.startIdleCheck();
|
|
46
51
|
}
|
|
52
|
+
async saveState() {
|
|
53
|
+
const data = Array.from(this.workspaces.entries()).map(([id, w]) => ({
|
|
54
|
+
id,
|
|
55
|
+
path: w.path,
|
|
56
|
+
name: w.name,
|
|
57
|
+
proxyPath: w.proxyPath,
|
|
58
|
+
}));
|
|
59
|
+
try {
|
|
60
|
+
await mkdir(path.dirname(this.stateFilePath), { recursive: true });
|
|
61
|
+
await writeFile(this.stateFilePath, JSON.stringify(data, null, 2), "utf-8");
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.options.logger.warn({ err }, "Failed to save workspaces state");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
async loadState() {
|
|
68
|
+
try {
|
|
69
|
+
if (!existsSync(this.stateFilePath))
|
|
70
|
+
return;
|
|
71
|
+
const content = await readFile(this.stateFilePath, "utf-8");
|
|
72
|
+
const entries = JSON.parse(content);
|
|
73
|
+
for (const entry of entries) {
|
|
74
|
+
this.workspaces.set(entry.id, {
|
|
75
|
+
id: entry.id,
|
|
76
|
+
path: entry.path,
|
|
77
|
+
name: entry.name,
|
|
78
|
+
status: "suspended",
|
|
79
|
+
proxyPath: entry.proxyPath ?? `/workspaces/${entry.id}/worktrees/root/instance`,
|
|
80
|
+
binaryId: "",
|
|
81
|
+
binaryLabel: "",
|
|
82
|
+
createdAt: new Date().toISOString(),
|
|
83
|
+
updatedAt: new Date().toISOString(),
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
if (entries.length > 0) {
|
|
87
|
+
this.options.logger.info({ count: entries.length }, "Restored workspaces from disk");
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
catch (err) {
|
|
91
|
+
this.options.logger.warn({ err }, "Failed to load workspaces state");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
47
94
|
list() {
|
|
48
95
|
return Array.from(this.workspaces.values());
|
|
49
96
|
}
|
|
@@ -103,7 +150,7 @@ export class WorkspaceManager {
|
|
|
103
150
|
};
|
|
104
151
|
this.workspaces.set(id, descriptor);
|
|
105
152
|
this.options.eventBus.publish({ type: "workspace.created", workspace: descriptor });
|
|
106
|
-
const serverConfig =
|
|
153
|
+
const serverConfig = this.options.settings.getOwnerSync("config", "server") ?? {};
|
|
107
154
|
const envVars = serverConfig?.environmentVariables;
|
|
108
155
|
const userEnvironment = envVars && typeof envVars === "object" && !Array.isArray(envVars) ? envVars : {};
|
|
109
156
|
const serverBaseUrl = this.options.getServerBaseUrl();
|
|
@@ -148,6 +195,7 @@ export class WorkspaceManager {
|
|
|
148
195
|
this.options.eventBus.publish({ type: "workspace.started", workspace: descriptor });
|
|
149
196
|
this.recordActivity(id);
|
|
150
197
|
this.options.logger.info({ workspaceId: id, port }, "Workspace ready");
|
|
198
|
+
void this.saveState();
|
|
151
199
|
return descriptor;
|
|
152
200
|
}
|
|
153
201
|
catch (error) {
|
|
@@ -181,6 +229,7 @@ export class WorkspaceManager {
|
|
|
181
229
|
if (!wasRunning) {
|
|
182
230
|
this.options.eventBus.publish({ type: "workspace.stopped", workspaceId: id });
|
|
183
231
|
}
|
|
232
|
+
void this.saveState();
|
|
184
233
|
return workspace;
|
|
185
234
|
}
|
|
186
235
|
async shutdown() {
|
|
@@ -464,6 +513,7 @@ export class WorkspaceManager {
|
|
|
464
513
|
this.options.eventBus.publish({ type: "workspace.suspended", workspace: { ...workspace } });
|
|
465
514
|
this.lastActivityTime.delete(id);
|
|
466
515
|
this.workspaceBusy.delete(id);
|
|
516
|
+
void this.saveState();
|
|
467
517
|
}
|
|
468
518
|
async resumeWorkspace(id) {
|
|
469
519
|
const workspace = this.workspaces.get(id);
|
|
@@ -480,7 +530,7 @@ export class WorkspaceManager {
|
|
|
480
530
|
workspace.updatedAt = new Date().toISOString();
|
|
481
531
|
const binary = await this.options.binaryResolver.resolveDefault();
|
|
482
532
|
const resolvedBinaryPath = await this.resolveBinaryPath(binary.path);
|
|
483
|
-
const serverConfig =
|
|
533
|
+
const serverConfig = this.options.settings.getOwnerSync("config", "server") ?? {};
|
|
484
534
|
const envVars = serverConfig?.environmentVariables;
|
|
485
535
|
const userEnvironment = envVars && typeof envVars === "object" && !Array.isArray(envVars) ? envVars : {};
|
|
486
536
|
const serverBaseUrl = this.options.getServerBaseUrl();
|
|
@@ -524,6 +574,7 @@ export class WorkspaceManager {
|
|
|
524
574
|
this.recordActivity(id);
|
|
525
575
|
this.options.eventBus.publish({ type: "workspace.resumed", workspace: { ...workspace } });
|
|
526
576
|
this.options.logger.info({ workspaceId: id, port }, "Workspace resumed");
|
|
577
|
+
void this.saveState();
|
|
527
578
|
return workspace;
|
|
528
579
|
}
|
|
529
580
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as K}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as K}from"./index-DD4SyatU.js";import{m as B,t as g,i as a,d as w,a as z,f as N}from"./monaco-viewer-CNzvK57I.js";import{c as f,n as c,a as L,F,S as W,z as j,A as q}from"./git-diff-vendor-CSgooKT_.js";import{D as G}from"./DiffToolbar-DY12K09c.js";import{S as H}from"./SplitFilePanel-Bill25lM.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./main-CdZwzERp.js";import"./align-justify-10t2qfxF.js";import"./wrap-text-CaCUirML.js";var J=g('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),T=g("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Q=g('<div class="p-3 text-xs text-secondary">'),E=g("<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-"),U=g("<span class=files-tab-selected-path><span class=file-path-text>"),X=g('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Y=g("<div style=margin-left:auto>");const Z=q(()=>K(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),ce=e=>{const M=f(()=>e.activeSessionId()),S=f(()=>!!(M()&&M()!=="info")),D=f(()=>S()?e.activeSessionDiffs():null),m=f(()=>{const n=D();return Array.isArray(n)?[...n].sort((i,l)=>String(i.file||"").localeCompare(String(l.file||""))):[]}),R=f(()=>m().reduce((n,i)=>(n.additions+=typeof i.additions=="number"?i.additions:0,n.deletions+=typeof i.deletions=="number"?i.deletions:0,n),{additions:0,deletions:0})),I=f(()=>{const n=m();return n.length===0?null:n.reduce((i,l)=>{const v=typeof(i==null?void 0:i.additions)=="number"?i.additions:0,y=typeof(i==null?void 0:i.deletions)=="number"?i.deletions:0,x=v+y,k=typeof(l==null?void 0:l.additions)=="number"?l.additions:0,t=typeof(l==null?void 0:l.deletions)=="number"?l.deletions:0,r=k+t;return r>x?l:r<x?i:String(l.file||"").localeCompare(String((i==null?void 0:i.file)||""))<0?l:i},n[0])}),P=f(()=>{const n=e.selectedFile(),i=m();if(n){const l=i.find(v=>v.file===n);if(l)return l}return I()}),O=f(()=>`${e.instanceId}:${S()?M():"no-session"}`),V=f(()=>{if(!S())return e.t("instanceShell.sessionChanges.noSessionSelected");const n=D();return n===void 0?e.t("instanceShell.sessionChanges.loading"):!Array.isArray(n)||n.length===0?e.t("instanceShell.sessionChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty")}),A=f(()=>{const n=P();return n!=null&&n.file?String(n.file):e.t("instanceShell.rightPanel.tabs.changes")});return B(()=>{const n=m(),i=R(),l=P(),v=()=>(()=>{var t=J(),r=t.firstChild;return a(r,c(W,{get when(){return l&&S()&&n.length>0?l:null},get fallback(){return(()=>{var d=T(),s=d.firstChild;return a(s,V),d})()},children:d=>c(j,{get fallback(){return(()=>{var s=T(),u=s.firstChild;return a(u,()=>e.t("instanceInfo.loading")),s})()},get children(){return c(Z,{get scopeKey(){return O()},get path(){return String(d().file||"")},get patch(){return String(d().patch||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()}})}})})),t})(),y=()=>(()=>{var t=Q();return a(t,V),t})();return c(H,{get header(){return[(()=>{var t=U(),r=t.firstChild;return a(r,A),L(()=>w(t,"title",A())),t})(),(()=>{var t=X(),r=t.firstChild,d=r.firstChild;d.firstChild;var s=r.nextSibling,u=s.firstChild;return u.firstChild,a(d,()=>i.additions,null),a(u,()=>i.deletions,null),t})(),(()=>{var t=Y();return a(t,c(G,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})),t})()]},list:{panel:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,e.isPhoneLayout())},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(s,"title",o.t=$),o},{e:void 0,t:void 0}),r})()})}}),overlay:()=>c(W,{get when(){return n.length>0},get fallback(){return y()},get children(){return c(F,{each:n,children:t=>(()=>{var r=E(),d=r.firstChild,s=d.firstChild,u=s.firstChild,b=s.nextSibling,h=b.firstChild;h.firstChild;var C=h.nextSibling;return C.firstChild,r.$$click=()=>{e.onSelectFile(t.file,!0)},a(u,()=>t.file),a(h,()=>t.additions,null),a(C,()=>t.deletions,null),L(o=>{var _=`file-list-item ${(l==null?void 0:l.file)===t.file?"file-list-item-active":""}`,$=t.file,p=t.file;return _!==o.e&&z(r,o.e=_),$!==o.t&&w(r,"title",o.t=$),p!==o.a&&w(s,"title",o.a=p),o},{e:void 0,t:void 0,a:void 0}),r})()})}})},get viewer(){return v()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.changes")}})})};N(["click"]);export{ce as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-
|
|
1
|
+
import{t as g,i as c,m as W,d as i,a as S,f as C}from"./monaco-viewer-CNzvK57I.js";import{u as T}from"./index-DD4SyatU.js";import{n as o,m as $,a as V}from"./git-diff-vendor-CSgooKT_.js";import{I as U,S as A,K as I}from"./main-CdZwzERp.js";import{A as D}from"./align-justify-10t2qfxF.js";import{W as E}from"./wrap-text-CaCUirML.js";const F=[["path",{d:"M12 22v-6",key:"6o8u61"}],["path",{d:"M12 8V2",key:"1wkif3"}],["path",{d:"M4 12H2",key:"rhcxmi"}],["path",{d:"M10 12H8",key:"s88cx1"}],["path",{d:"M16 12h-2",key:"10asgb"}],["path",{d:"M22 12h-2",key:"14jgyd"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m15 5-3-3-3 3",key:"itvq4r"}]],H=t=>o(U,$(t,{name:"UnfoldVertical",iconNode:F}));var N=g("<div class=file-viewer-toolbar><button type=button class=file-viewer-toolbar-icon-button></button><button type=button class=file-viewer-toolbar-icon-button></button><button type=button>");const z=t=>{const{t:a}=T(),d=()=>t.viewMode==="split"?"unified":"split",s=()=>t.contextMode==="collapsed"?"expanded":"collapsed",f=()=>t.wordWrapMode==="on"?"off":"on",h=()=>d()==="split"?a("instanceShell.diff.switchToSplit"):a("instanceShell.diff.switchToUnified"),v=()=>s()==="collapsed"?a("instanceShell.diff.hideUnchanged"):a("instanceShell.diff.showFull"),u=()=>f()==="on"?a("instanceShell.diff.enableWordWrap"):a("instanceShell.diff.disableWordWrap");return(()=>{var b=N(),n=b.firstChild,l=n.nextSibling,r=l.nextSibling;return n.$$click=()=>t.onViewModeChange(d()),c(n,(()=>{var e=W(()=>d()==="split");return()=>e()?o(A,{class:"h-4 w-4","aria-hidden":"true"}):o(D,{class:"h-4 w-4","aria-hidden":"true"})})()),l.$$click=()=>t.onContextModeChange(s()),c(l,(()=>{var e=W(()=>s()==="collapsed");return()=>e()?o(I,{class:"h-4 w-4","aria-hidden":"true"}):o(H,{class:"h-4 w-4","aria-hidden":"true"})})()),r.$$click=()=>t.onWordWrapModeChange(f()),c(r,o(E,{class:"h-4 w-4","aria-hidden":"true"})),V(e=>{var m=h(),w=h(),M=v(),p=v(),x=`file-viewer-toolbar-icon-button${t.wordWrapMode==="on"?" active":""}`,k=u(),y=u();return m!==e.e&&i(n,"aria-label",e.e=m),w!==e.t&&i(n,"title",e.t=w),M!==e.a&&i(l,"aria-label",e.a=M),p!==e.o&&i(l,"title",e.o=p),x!==e.i&&S(r,e.i=x),k!==e.n&&i(r,"aria-label",e.n=k),y!==e.s&&i(r,"title",e.s=y),e},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0,n:void 0,s:void 0}),b})()};C(["click"]);export{z as D};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as G}from"./index-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as G}from"./index-DD4SyatU.js";import{Z as J,m,t as h,i as s,d as u,a as C,u as U,f as X}from"./monaco-viewer-CNzvK57I.js";import{n as o,m as Y,d as A,b as P,c as $,S as g,a as w,z as p,A as ee,F as te}from"./git-diff-vendor-CSgooKT_.js";import{S as le}from"./SplitFilePanel-Bill25lM.js";import{I as ne,R as K,M as re,N as ae,C as ie,e as se,O as oe}from"./main-CdZwzERp.js";import{W as ce}from"./wrap-text-CaCUirML.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";const de=[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]],he=e=>o(ne,Y(e,{name:"Save",iconNode:de}));var ue=h('<div class="px-2 py-2 border-b border-base"><div class=selector-input-group><div class="flex items-center gap-2 px-3 text-muted"></div><input type=text class=selector-input>'),ve=h("<div class=file-list-header><span class=file-list-title></span><span class=file-list-count>"),O=h('<div class="p-3 text-xs text-secondary">'),fe=h("<div class=file-list-item><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text>.."),ge=h('<div class="p-3 text-xs text-error">'),we=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class="flex items-center gap-2 shrink-0"><div class=file-list-item-stats><span class="text-[10px] text-secondary"></span></div><button type=button class=git-change-row-action>'),k=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Se=h('<div class="file-viewer-panel flex-1"><div>'),be=h('<div class="h-full outline-none"tabindex=0>'),me=h("<span>"),$e=h("<div class=files-tab-stats><span class=files-tab-stat><span class=files-tab-selected-path><span class=file-path-text>"),ye=h("<button type=button style=margin-inline-start:auto>"),_e=h("<button type=button>"),q=h("<button type=button class=files-header-icon-button>"),Ce=h("<span class=text-error>");const ke=ee(()=>G(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ae),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoFileViewer})));function xe(e){return e?/\.(md|markdown|mdown|mkdn)$/i.test(e):!1}const Ie=e=>{const[E,L]=A(""),{isDark:N}=J(),[Q,M]=A(!1);let S;P(()=>{e.browserPath(),L("")});const H=$(()=>[...e.browserEntries()||[]].sort((i,d)=>{const l=i.type==="directory"?0:1,t=d.type==="directory"?0:1;return l!==t?l-t:String(i.name||"").localeCompare(String(d.name||""))})),W=$(()=>E().trim().toLowerCase()),x=$(()=>{const n=W(),i=H();return n?i.filter(d=>String(d.name||"").toLowerCase().includes(n)):i}),y=()=>e.browserLoading()&&e.browserEntries()===null,Z=()=>W()?e.t("instanceShell.filesShell.search.empty"):e.t("instanceShell.filesShell.listEmpty"),_=$(()=>xe(e.browserSelectedPath())),b=$(()=>_()&&Q());P(()=>{_()||M(!1)});const D=()=>{const n=e.browserSelectedContent();n!=null&&e.onSave(n)},j=async(n,i)=>{i==null||i.stopPropagation();const d=await se(n);oe({message:d?e.t("instanceShell.filesShell.toast.copyPathSuccess"):e.t("instanceShell.filesShell.toast.copyPathError"),variant:d?"success":"error"})};P(()=>{b()&&requestAnimationFrame(()=>S==null?void 0:S.focus())});const T=()=>[(()=>{var n=ue(),i=n.firstChild,d=i.firstChild,l=d.nextSibling;return s(d,o(ae,{class:"w-4 h-4"})),l.$$input=t=>L(t.currentTarget.value),w(t=>{var a=e.t("instanceShell.filesShell.search.placeholder"),r=e.t("instanceShell.filesShell.search.ariaLabel");return a!==t.e&&u(l,"placeholder",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),t},{e:void 0,t:void 0}),w(()=>l.value=E()),n})(),(()=>{var n=ve(),i=n.firstChild,d=i.nextSibling;return s(i,()=>e.t("instanceShell.filesShell.fileListTitle")),s(d,()=>x().length),n})(),o(g,{get when(){return e.parentPath()},children:n=>(()=>{var i=fe(),d=i.firstChild,l=d.firstChild;return i.$$click=()=>e.onLoadEntries(n()),w(()=>u(l,"title",n())),i})()}),o(g,{get when(){return y()},get children(){var n=O();return s(n,()=>e.t("instanceInfo.loading")),n}}),o(g,{get when(){return m(()=>!e.browserError()&&!y())()&&x().length>0},get fallback(){return m(()=>!y())()?m(()=>!!e.browserError())()?(()=>{var n=ge();return s(n,()=>e.browserError()),n})():(()=>{var n=O();return s(n,Z),n})():void 0},get children(){return o(te,{get each(){return x()},children:n=>(()=>{var i=we(),d=i.firstChild,l=d.firstChild,t=l.firstChild,a=l.nextSibling,r=a.firstChild,c=r.firstChild,f=r.nextSibling;return i.$$click=()=>{if(n.type==="directory"){e.onLoadEntries(n.path);return}e.onRequestOpenFile(n.path)},s(t,()=>n.name),s(c,()=>n.type),f.$$click=v=>void j(n.path,v),s(f,o(ie,{class:"w-3 h-3"})),w(v=>{var F=`file-list-item ${e.browserSelectedPath()===n.path?"file-list-item-active":""}`,z=n.path,I=n.path,R=e.t("instanceShell.filesShell.actions.copyPath"),V=e.t("instanceShell.filesShell.actions.copyPath");return F!==v.e&&C(i,v.e=F),z!==v.t&&u(i,"title",v.t=z),I!==v.a&&u(l,"title",v.a=I),R!==v.o&&u(f,"title",v.o=R),V!==v.i&&u(f,"aria-label",v.i=V),v},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),i})()})}})],B=n=>{!(n.ctrlKey||n.metaKey)||n.key.toLowerCase()!=="s"||e.browserSelectedSaving()||!e.browserSelectedDirty()||(n.preventDefault(),D())};return m(()=>{const n=()=>e.browserSelectedPath()||e.browserPath(),i=()=>y()?e.t("instanceInfo.loading"):e.t("instanceShell.filesShell.viewerEmpty"),d=()=>(()=>{var l=Se(),t=l.firstChild;return s(t,o(g,{get when(){return e.browserSelectedLoading()},get fallback(){return o(g,{get when(){return e.browserSelectedError()},get fallback(){return o(g,{get when(){return m(()=>!!(e.browserSelectedPath()&&e.browserSelectedContent()!==null))()?{path:e.browserSelectedPath(),content:e.browserSelectedContent()}:null},get fallback(){return(()=>{var a=k(),r=a.firstChild;return s(r,i),a})()},children:a=>o(g,{get when(){return b()},get fallback(){return o(p,{get fallback(){return(()=>{var r=k(),c=r.firstChild;return s(c,()=>e.t("instanceInfo.loading")),r})()},get children(){return o(ke,{get scopeKey(){return e.scopeKey()},get path(){return a().path},get content(){return a().content},get wordWrap(){return e.wordWrapMode()},get onSave(){return e.onSave},get onContentChange(){return e.onContentChange}})}})},get children(){var r=be();r.$$mousedown=()=>S==null?void 0:S.focus(),r.$$keydown=B;var c=S;return typeof c=="function"?U(c,r):S=r,s(r,o(re,{get part(){return{type:"text",text:a().content}},get isDark(){return N()},escapeRawHtml:!0})),r}})})},children:a=>(()=>{var r=k(),c=r.firstChild;return s(c,a),r})()})},get children(){var a=k(),r=a.firstChild;return s(r,()=>e.t("instanceInfo.loading")),a}})),w(()=>C(t,b()?"file-viewer-content":"file-viewer-content file-viewer-content--monaco")),l})();return o(le,{get header(){return[(()=>{var l=$e(),t=l.firstChild,a=t.firstChild,r=a.firstChild;return s(r,n),s(l,o(g,{get when(){return e.browserLoading()},get children(){var c=me();return s(c,()=>e.t("instanceInfo.loading")),c}}),null),s(l,o(g,{get when(){return e.browserError()},children:c=>(()=>{var f=Ce();return s(f,c),f})()}),null),w(()=>u(a,"title",n())),l})(),(()=>{var l=ye();return l.$$click=()=>_()&&M(t=>!t),s(l,(()=>{var t=m(()=>!!b());return()=>t()?e.t("instanceShell.filesShell.showSource"):e.t("instanceShell.filesShell.previewMarkdown")})()),w(t=>{var a=`file-viewer-toolbar-button${b()?" active":""}`,r=!_();return a!==t.e&&C(l,t.e=a),r!==t.t&&(l.disabled=t.t=r),t},{e:void 0,t:void 0}),l})(),(()=>{var l=_e();return l.$$click=()=>e.onWordWrapModeChange(e.wordWrapMode()==="on"?"off":"on"),s(l,o(ce,{class:"h-4 w-4"})),w(t=>{var a=`file-viewer-toolbar-icon-button${e.wordWrapMode()==="on"?" active":""}`,r=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),c=e.wordWrapMode()==="on"?e.t("instanceShell.filesShell.disableWordWrap"):e.t("instanceShell.filesShell.enableWordWrap"),f=b();return a!==t.e&&C(l,t.e=a),r!==t.t&&u(l,"title",t.t=r),c!==t.a&&u(l,"aria-label",t.a=c),f!==t.o&&(l.disabled=t.o=f),t},{e:void 0,t:void 0,a:void 0,o:void 0}),l})(),(()=>{var l=q();return l.$$click=D,s(l,o(g,{get when(){return e.browserSelectedSaving()},get fallback(){return o(he,{class:"h-4 w-4"})},get children(){return o(K,{class:"h-4 w-4 animate-spin"})}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.save")||"Save (Ctrl+S)",r=e.t("instanceShell.rightPanel.actions.save")||"Save",c=e.browserSelectedSaving()||!e.browserSelectedDirty();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})(),(()=>{var l=q();return l.$$click=()=>e.onRefresh(),s(l,o(K,{get class(){return`h-4 w-4${e.browserLoading()?" animate-spin":""}`}})),w(t=>{var a=e.t("instanceShell.rightPanel.actions.refresh"),r=e.t("instanceShell.rightPanel.actions.refresh"),c=e.browserLoading();return a!==t.e&&u(l,"title",t.e=a),r!==t.t&&u(l,"aria-label",t.t=r),c!==t.a&&(l.disabled=t.a=c),t},{e:void 0,t:void 0,a:void 0}),l})()]},list:{panel:()=>o(T,{}),overlay:()=>o(T,{})},get viewer(){return d()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.files")}})})};X(["input","click","keydown","mousedown"]);export{Ie as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-
|
|
2
|
-
import{_ as se}from"./index-BCGPLzO4.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-YY9yfE-p.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-BiS5nvB_.js";import{S as ge}from"./SplitFilePanel-CA0D92l1.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-BbYl9PoY.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-COuYjEB9.js";import"./wrap-text-DVQ19pj7.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-YY9yfE-p.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/monaco-viewer-CNzvK57I.js","assets/git-diff-vendor-CSgooKT_.js","assets/fast-diff-vendor-DgdwVvTQ.js","assets/highlight-vendor-8FKMu9os.js","assets/git-diff-vendor-HAZkIolJ.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as se}from"./index-DD4SyatU.js";import{m as R,t as h,i as n,d as b,h as U,a as H,f as le}from"./monaco-viewer-CNzvK57I.js";import{n as r,m as re,c as m,a as L,S as w,F as J,z as ce,A as oe}from"./git-diff-vendor-CSgooKT_.js";import{D as de}from"./DiffToolbar-DY12K09c.js";import{S as ge}from"./SplitFilePanel-Bill25lM.js";import{I as he,G as ue,R as fe,H as j,J as Q}from"./main-CdZwzERp.js";import"./fast-diff-vendor-DgdwVvTQ.js";import"./highlight-vendor-8FKMu9os.js";import"./align-justify-10t2qfxF.js";import"./wrap-text-CaCUirML.js";const me=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],ve=e=>r(he,re(e,{name:"GitBranch",iconNode:me}));var V=h("<div class=file-viewer-empty><span class=file-viewer-empty-text>"),Ce=h('<div class="file-viewer-panel flex-1"><div class="file-viewer-content file-viewer-content--monaco">'),$e=h('<div class="p-3 text-xs text-secondary">'),be=h('<span class="git-change-row-action-bar git-change-row-action-bar-vertical">'),_e=h('<div><div class=file-list-item-content><div class=file-list-item-path><span class=file-path-text></span></div><div class=git-change-list-item-right><div class=file-list-item-stats><span class=file-list-item-additions>+</span><span class=file-list-item-deletions>-</span></div></div></div><div class=git-change-list-item-actions-zone><div class=git-change-list-item-actions><button type=button class=git-change-row-action><span aria-hidden=true><span class="git-change-row-action-bar git-change-row-action-bar-horizontal">'),we=h("<div class=git-change-section-items>"),Se=h("<div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title></span></span><span class=git-change-section-count>"),ye=h('<div class=git-change-section-items><div class=git-change-commit-box><div class=git-change-commit-input-wrap><textarea class=git-change-commit-input rows=1></textarea><button type=button class="git-change-commit-button git-change-commit-button-overlay">'),xe=h("<div class=git-change-sections><div class=git-change-section><button type=button class=git-change-section-header><span class=git-change-section-header-main><span class=git-change-section-chevron></span><span class=git-change-section-title-row><span class=git-change-section-title></span></span></span><span class=git-change-section-count>"),Ie=h('<span class="status-indicator session-status-list worktree-indicator git-change-section-badge"><span class=worktree-indicator-label>'),Me=h("<span class=files-tab-selected-path><span class=file-path-text>"),ke=h('<div class=files-tab-stats style="flex:0 0 auto"><span class="files-tab-stat files-tab-stat-additions"><span class=files-tab-stat-value>+</span></span><span class="files-tab-stat files-tab-stat-deletions"><span class=files-tab-stat-value>-'),Le=h("<button type=button class=files-header-icon-button style=margin-left:auto>"),Ee=h("<span class=text-error>");const Pe=oe(()=>se(()=>import("./monaco-viewer-CNzvK57I.js").then(e=>e.ad),__vite__mapDeps([0,1,2,3,4])).then(e=>({default:e.MonacoDiffViewer}))),Ke=e=>{const T=m(()=>e.activeSessionId()),W=m(()=>!!(T()&&T()!=="info")),A=m(()=>W()?e.entries():null),X=m(()=>{const o=A();return Array.isArray(o)?[...o].sort((d,x)=>String(d.path||"").localeCompare(String(x.path||""))):[]}),S=m(()=>ue(X())),Y=m(()=>S().reduce((o,d)=>(o.additions+=typeof d.additions=="number"?d.additions:0,o.deletions+=typeof d.deletions=="number"?d.deletions:0,o),{additions:0,deletions:0})),z=m(()=>S().filter(o=>o.section==="staged")),Z=m(()=>S().filter(o=>o.section==="unstaged")),p=m(()=>z().length>0&&e.commitMessage().trim().length>0&&!e.commitSubmitting()),ee=m(()=>{const o=S(),d=e.selectedItemId(),x=e.mostChangedItemId(),I=o.find(E=>E.id===d)||(x?o.find(E=>E.id===x):void 0);return(I==null?void 0:I.entry)??null}),D=m(()=>W()?A()===null?e.t("instanceShell.gitChanges.loading"):S().length===0?e.t("instanceShell.gitChanges.empty"):e.t("instanceShell.filesShell.viewerEmpty"):e.t("instanceShell.gitChanges.noSessionSelected")),te=m(()=>e.selectedError()===e.t("instanceShell.gitChanges.binaryViewer"));return R(()=>{const o=Y(),d=ee(),x=S(),I=z(),E=Z(),ne=()=>(()=>{var t=Ce(),l=t.firstChild;return n(l,r(w,{get when(){return e.selectedLoading()},get fallback(){return r(w,{get when(){return e.selectedError()},get fallback(){return r(w,{get when(){return R(()=>!!(d&&e.selectedBefore()!==null&&e.selectedAfter()!==null))()?{path:d.path,before:e.selectedBefore(),after:e.selectedAfter()}:null},get fallback(){return(()=>{var i=V(),s=i.firstChild;return n(s,D),i})()},children:i=>r(ce,{get fallback(){return(()=>{var s=V(),a=s.firstChild;return n(a,()=>e.t("instanceInfo.loading")),s})()},get children(){return r(Pe,{get scopeKey(){return e.scopeKey()},get path(){return String(i().path||"")},get before(){return String(i().before||"")},get after(){return String(i().after||"")},get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrap(){return e.diffWordWrapMode()},get insertContextLabel(){return e.t("instanceShell.gitChanges.actions.insertContext")},get onRequestInsertContext(){return te()?void 0:s=>{const a=e.selectedItemId();if(!a)return;const g=S().find(u=>u.id===a);g&&e.onInsertContext(g,s)}}})}})})},children:i=>(()=>{var s=V(),a=s.firstChild;return n(a,i),s})()})},get children(){var i=V(),s=i.firstChild;return n(s,()=>e.t("instanceInfo.loading")),i}})),t})(),ie=()=>(()=>{var t=$e();return n(t,D),t})(),B=t=>{const l=m(()=>e.selectedBulkItemIds().has(t.id)),i=t.section==="staged"?e.t("instanceShell.gitChanges.actions.unstage"):e.t("instanceShell.gitChanges.actions.stage"),s=()=>{t.section==="staged"?e.onUnstageFile(t):e.onStageFile(t)};return(()=>{var a=_e(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=u.nextSibling,$=v.firstChild,C=$.firstChild;C.firstChild;var _=C.nextSibling;_.firstChild;var P=g.nextSibling,f=P.firstChild,y=f.firstChild,k=y.firstChild;return k.firstChild,a.$$click=c=>e.onRowClick(t,c),a.$$mousedown=c=>{(c.shiftKey||c.ctrlKey||c.metaKey)&&c.preventDefault()},n(M,()=>t.path),n(C,()=>t.additions,null),n(_,()=>t.deletions,null),y.$$click=c=>{c.stopPropagation(),s()},b(y,"title",i),b(y,"aria-label",i),n(k,r(w,{get when(){return t.section!=="staged"},get children(){return be()}}),null),L(c=>{var G=`file-list-item git-change-list-item ${e.selectedItemId()===t.id?"file-list-item-active":""} ${l()?"git-change-list-item-bulk-selected":""}`,F=t.path,K=t.path,q=t.path,N=`git-change-row-action-glyph ${t.section==="staged"?"git-change-row-action-glyph-minus":"git-change-row-action-glyph-plus"}`;return G!==c.e&&H(a,c.e=G),F!==c.t&&b(a,"title",c.t=F),K!==c.a&&b(g,"title",c.a=K),q!==c.o&&b(u,"title",c.o=q),N!==c.i&&H(k,c.i=N),c},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),a})()},ae=(t,l,i,s)=>(()=>{var a=Se(),g=a.firstChild,u=g.firstChild,M=u.firstChild,v=M.nextSibling,$=u.nextSibling;return U(g,"click",s,!0),n(M,i?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})),n(v,t),n($,()=>l.length),n(a,r(w,{when:i,get children(){var C=we();return n(C,r(J,{each:l,children:_=>B(_)})),C}}),null),a})(),O=()=>r(w,{get when(){return x.length>0},get fallback(){return ie()},get children(){var t=xe(),l=t.firstChild,i=l.firstChild,s=i.firstChild,a=s.firstChild,g=a.nextSibling,u=g.firstChild,M=s.nextSibling;return U(i,"click",e.onToggleStagedOpen,!0),n(a,(()=>{var v=R(()=>!!e.stagedOpen());return()=>v()?r(j,{class:"h-3.5 w-3.5"}):r(Q,{class:"h-3.5 w-3.5"})})()),n(u,()=>e.t("instanceShell.gitChanges.sections.staged")),n(g,r(w,{get when(){return e.branchLabel()},children:v=>(()=>{var $=Ie(),C=$.firstChild;return n($,r(ve,{class:"w-3.5 h-3.5","aria-hidden":"true"}),C),n(C,v),L(()=>b($,"title",`Branch: ${v()}`)),$})()}),null),n(M,()=>I.length),n(l,r(w,{get when(){return e.stagedOpen()},get children(){var v=ye(),$=v.firstChild,C=$.firstChild,_=C.firstChild,P=_.nextSibling;return _.$$input=f=>e.onCommitMessageInput(f.currentTarget.value),P.$$click=()=>e.onSubmitCommit(),n(P,(()=>{var f=R(()=>!!e.commitSubmitting());return()=>f()?e.t("instanceShell.gitChanges.commit.submitting"):e.t("instanceShell.gitChanges.commit.submit")})()),n(v,r(J,{each:I,children:f=>B(f)}),null),L(f=>{var y=e.t("instanceShell.gitChanges.commit.placeholder"),k=!p();return y!==f.e&&b(_,"placeholder",f.e=y),k!==f.t&&(P.disabled=f.t=k),f},{e:void 0,t:void 0}),L(()=>_.value=e.commitMessage()),v}}),null),n(t,()=>ae(e.t("instanceShell.gitChanges.sections.unstaged"),E,e.unstagedOpen(),e.onToggleUnstagedOpen),null),t}});return r(ge,{get header(){return[(()=>{var t=Me(),l=t.firstChild;return n(l,()=>(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges")),L(()=>b(t,"title",(d==null?void 0:d.path)||e.t("instanceShell.rightPanel.tabs.gitChanges"))),t})(),(()=>{var t=ke(),l=t.firstChild,i=l.firstChild;i.firstChild;var s=l.nextSibling,a=s.firstChild;return a.firstChild,n(i,()=>o.additions,null),n(a,()=>o.deletions,null),n(t,r(w,{get when(){return e.statusError()},children:g=>(()=>{var u=Ee();return n(u,g),u})()}),null),t})(),(()=>{var t=Le();return t.$$click=()=>e.onRefresh(),n(t,r(fe,{get class(){return`h-4 w-4${e.statusLoading()?" animate-spin":""}`}})),L(l=>{var i=e.t("instanceShell.rightPanel.actions.refresh"),s=e.t("instanceShell.rightPanel.actions.refresh"),a=!W()||e.statusLoading()||A()===null;return i!==l.e&&b(t,"title",l.e=i),s!==l.t&&b(t,"aria-label",l.t=s),a!==l.a&&(t.disabled=l.a=a),l},{e:void 0,t:void 0,a:void 0}),t})(),r(de,{get viewMode(){return e.diffViewMode()},get contextMode(){return e.diffContextMode()},get wordWrapMode(){return e.diffWordWrapMode()},get onViewModeChange(){return e.onViewModeChange},get onContextModeChange(){return e.onContextModeChange},get onWordWrapModeChange(){return e.onWordWrapModeChange}})]},list:{panel:O,overlay:O},get viewer(){return ne()},get listOpen(){return e.listOpen()},get onToggleList(){return e.onToggleList},get splitWidth(){return e.splitWidth()},get onResizeMouseDown(){return e.onResizeMouseDown},get onResizeTouchStart(){return e.onResizeTouchStart},get isPhoneLayout(){return e.isPhoneLayout()},get overlayAriaLabel(){return e.t("instanceShell.rightPanel.tabs.gitChanges")}})})};le(["mousedown","click","input"]);export{Ke as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-
|
|
1
|
+
import{t as d,i as l,d as m,h as s,m as b,g as _,f as w}from"./monaco-viewer-CNzvK57I.js";import{a as g,n as r,S as n}from"./git-diff-vendor-CSgooKT_.js";import{u as S}from"./index-DD4SyatU.js";var y=d("<div class=file-list-overlay role=dialog><div class=file-list-scroll>");const L=e=>(()=>{var t=y(),a=t.firstChild;return l(a,()=>e.children),g(()=>m(t,"aria-label",e.ariaLabel)),t})();var C=d('<div class=files-split><div class=file-list-panel><div class=file-list-scroll></div></div><div class=file-split-handle role=separator aria-orientation=vertical aria-label="Resize file list">'),x=d("<div class=files-tab-container><div class=files-tab-header><div class=files-tab-header-row><button type=button class=files-toggle-button></button></div></div><div class=files-tab-body>");const z=e=>{const{t}=S();return(()=>{var a=x(),c=a.firstChild,o=c.firstChild,u=o.firstChild,h=c.nextSibling;return s(u,"click",e.onToggleList,!0),l(u,(()=>{var i=b(()=>!!e.listOpen);return()=>i()?t("instanceShell.filesShell.hideFiles"):t("instanceShell.filesShell.showFiles")})()),l(o,()=>e.header,null),l(h,r(n,{get when(){return b(()=>!e.isPhoneLayout)()&&e.listOpen},get fallback(){return e.viewer},get children(){var i=C(),v=i.firstChild,$=v.firstChild,f=v.nextSibling;return l($,()=>e.list.panel()),s(f,"touchstart",e.onResizeTouchStart,!0),s(f,"mousedown",e.onResizeMouseDown,!0),l(i,()=>e.viewer,null),g(O=>_(i,"--files-pane-width",`${e.splitWidth}px`)),i}}),null),l(h,r(n,{get when(){return e.isPhoneLayout},get children(){return r(n,{get when(){return e.listOpen},get children(){return r(L,{get ariaLabel(){return e.overlayAriaLabel},get children(){return e.list.overlay()}})}})}}),null),a})()};w(["click","mousedown","touchstart"]);export{z as S};
|