@dungsil/dsh-plugin-ui-vcs 0.2.0 → 0.4.0
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/client.js +448 -141
- package/dist/index.js +510 -112
- package/package.json +7 -1
package/dist/client.js
CHANGED
|
@@ -12,9 +12,9 @@ var __exportAll = (all, no_symbols) => {
|
|
|
12
12
|
return target;
|
|
13
13
|
};
|
|
14
14
|
let react = require("react");
|
|
15
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
15
16
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
17
|
let react_dom = require("react-dom");
|
|
17
|
-
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
18
18
|
// ../../tools/ui/src/icons/git-pull-request.svg
|
|
19
19
|
var git_pull_request_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"5\" cy=\"5\" r=\"2\"/>\n <circle cx=\"5\" cy=\"19\" r=\"2\"/>\n <circle cx=\"19\" cy=\"19\" r=\"2\"/>\n <path d=\"M5 7v10M19 17V7a2 2 0 0 0-2-2h-5m3-3-3 3 3 3\"/>\n</svg>\n";
|
|
20
20
|
// ../../tools/ui/src/icons/git-pull-request-draft.svg
|
|
@@ -23,6 +23,40 @@ var git_pull_request_draft_default = "<svg xmlns=\"http://www.w3.org/2000/svg\"
|
|
|
23
23
|
var git_pull_request_closed_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"5\" cy=\"5\" r=\"2\"/>\n <circle cx=\"5\" cy=\"19\" r=\"2\"/>\n <circle cx=\"19\" cy=\"19\" r=\"2\"/>\n <path d=\"M5 7v10M19 17v-5M16 3l6 6m0-6-6 6\"/>\n</svg>\n";
|
|
24
24
|
// ../../tools/ui/src/icons/git-merge.svg
|
|
25
25
|
var git_merge_default = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <circle cx=\"5\" cy=\"5\" r=\"2\"/>\n <circle cx=\"5\" cy=\"19\" r=\"2\"/>\n <circle cx=\"19\" cy=\"19\" r=\"2\"/>\n <path d=\"M5 7v10M5 7a12 12 0 0 0 12 12\"/>\n</svg>\n";
|
|
26
|
+
// ../../tools/ui/src/client.ts
|
|
27
|
+
function useLocaleSnapshot(locale) {
|
|
28
|
+
const subscribe = (0, react.useCallback)((listener) => locale.subscribe(listener), [locale]);
|
|
29
|
+
const getSnapshot = (0, react.useCallback)(() => locale.getSnapshot(), [locale]);
|
|
30
|
+
return (0, react.useSyncExternalStore)(subscribe, getSnapshot);
|
|
31
|
+
}
|
|
32
|
+
/** Each effect owns its sheet, even when another plugin installs the same defaults. */
|
|
33
|
+
function installStyles(css) {
|
|
34
|
+
const style = document.createElement("style");
|
|
35
|
+
style.textContent = css;
|
|
36
|
+
document.head.append(style);
|
|
37
|
+
return () => style.remove();
|
|
38
|
+
}
|
|
39
|
+
// ../../tools/ui/src/settings.tsx
|
|
40
|
+
const settingsStyles = `
|
|
41
|
+
.dsh-plugin-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: .5px solid var(--dsw-alias-border-l2); }
|
|
42
|
+
.dsh-plugin-settings-text { flex: 1; min-width: 0; }
|
|
43
|
+
.dsh-plugin-settings-picker { min-width: 0; }
|
|
44
|
+
.dsh-plugin-settings-selector { box-sizing: border-box; display: inline-flex; align-items: center; gap: 12px; max-width: 100%; height: 36px; padding: 0 14px; border: none; border-radius: var(--dsw-radius-md); background: var(--dsw-alias-bg-module-platform); color: inherit; font: inherit; cursor: pointer; }
|
|
45
|
+
.dsh-plugin-settings-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
46
|
+
.dsh-plugin-settings-selector svg { flex: none; }
|
|
47
|
+
.dsh-plugin-settings-selector:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }
|
|
48
|
+
.dsh-plugin-settings-selector:disabled { opacity: .5; cursor: default; }
|
|
49
|
+
.dsh-plugin-settings-selector:focus-visible { outline: 2px solid var(--dsw-alias-brand-primary-new-colorprimary-new-color); outline-offset: 2px; }
|
|
50
|
+
`;
|
|
51
|
+
function SettingsRow({ label, children }) {
|
|
52
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
53
|
+
className: "dsh-plugin-settings-row",
|
|
54
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
55
|
+
className: "dsh-plugin-settings-text",
|
|
56
|
+
children: label
|
|
57
|
+
}), children]
|
|
58
|
+
});
|
|
59
|
+
}
|
|
26
60
|
// locale/en.json
|
|
27
61
|
var en_default = {
|
|
28
62
|
meta: {
|
|
@@ -13322,7 +13356,7 @@ function bindPullRequestLinks(root, open) {
|
|
|
13322
13356
|
}
|
|
13323
13357
|
// src/pull-requests-client.tsx
|
|
13324
13358
|
var pull_requests_client_exports = /* @__PURE__ */ __exportAll({
|
|
13325
|
-
apply: () => apply$
|
|
13359
|
+
apply: () => apply$2,
|
|
13326
13360
|
checksState: () => checksState,
|
|
13327
13361
|
inject: () => inject$1,
|
|
13328
13362
|
name: () => name$1
|
|
@@ -13427,7 +13461,7 @@ function Choice({ label, value, items, onChange, disabled }) {
|
|
|
13427
13461
|
})
|
|
13428
13462
|
});
|
|
13429
13463
|
}
|
|
13430
|
-
function apply$
|
|
13464
|
+
function apply$2(ctx) {
|
|
13431
13465
|
const connection = ctx.get("connection");
|
|
13432
13466
|
const sessions = ctx.get("sessions");
|
|
13433
13467
|
const views = /* @__PURE__ */ new Map();
|
|
@@ -13440,6 +13474,7 @@ function apply$1(ctx) {
|
|
|
13440
13474
|
function SessionRequest({ sessionId }) {
|
|
13441
13475
|
(0, react.useSyncExternalStore)(subscribe, () => ctx.locale.getSnapshot().active);
|
|
13442
13476
|
const copy = text();
|
|
13477
|
+
const current = (0, react.useSyncExternalStore)((listener) => ctx.sidebarRight.mounted.subscribe(listener), () => ctx.sidebarRight.mounted.getSnapshot() === sessionId);
|
|
13443
13478
|
const running = (0, react.useSyncExternalStore)((listener) => sessions.list.subscribe(listener), () => sessions.list.getSnapshot().byId[sessionId]?.running ?? false);
|
|
13444
13479
|
const cwd = (0, react.useSyncExternalStore)((listener) => sessions.list.subscribe(listener), () => sessions.list.getSnapshot().byId[sessionId]?.cwd);
|
|
13445
13480
|
const anchor = (0, react.useRef)(null);
|
|
@@ -13457,12 +13492,21 @@ function apply$1(ctx) {
|
|
|
13457
13492
|
return () => node.remove();
|
|
13458
13493
|
}, [sessionId]);
|
|
13459
13494
|
(0, react.useEffect)(() => {
|
|
13460
|
-
let active;
|
|
13461
13495
|
setView(void 0);
|
|
13496
|
+
}, [
|
|
13497
|
+
sessionId,
|
|
13498
|
+
current,
|
|
13499
|
+
cwd
|
|
13500
|
+
]);
|
|
13501
|
+
(0, react.useEffect)(() => {
|
|
13502
|
+
if (!current || running) return;
|
|
13503
|
+
let disposed = false;
|
|
13504
|
+
let active;
|
|
13462
13505
|
const refresh = async () => {
|
|
13463
|
-
active
|
|
13464
|
-
|
|
13465
|
-
|
|
13506
|
+
if (disposed || active || document.visibilityState === "hidden") return;
|
|
13507
|
+
const controller = new AbortController();
|
|
13508
|
+
active = controller;
|
|
13509
|
+
const { signal } = controller;
|
|
13466
13510
|
try {
|
|
13467
13511
|
const result = await connection.rpc.call(channel$1, method, {
|
|
13468
13512
|
sessionId,
|
|
@@ -13471,22 +13515,28 @@ function apply$1(ctx) {
|
|
|
13471
13515
|
if (!signal.aborted) setView(result.ok ? result.value : void 0);
|
|
13472
13516
|
} catch {
|
|
13473
13517
|
if (!signal.aborted) setView(void 0);
|
|
13518
|
+
} finally {
|
|
13519
|
+
if (active === controller) active = void 0;
|
|
13474
13520
|
}
|
|
13475
13521
|
};
|
|
13476
13522
|
refresh();
|
|
13477
13523
|
window.addEventListener("focus", refresh);
|
|
13524
|
+
document.addEventListener("visibilitychange", refresh);
|
|
13478
13525
|
const interval = window.setInterval(refresh, 6e4);
|
|
13479
13526
|
return () => {
|
|
13527
|
+
disposed = true;
|
|
13480
13528
|
active?.abort();
|
|
13481
13529
|
window.removeEventListener("focus", refresh);
|
|
13530
|
+
document.removeEventListener("visibilitychange", refresh);
|
|
13482
13531
|
window.clearInterval(interval);
|
|
13483
13532
|
};
|
|
13484
13533
|
}, [
|
|
13485
13534
|
sessionId,
|
|
13535
|
+
current,
|
|
13486
13536
|
running,
|
|
13487
13537
|
cwd
|
|
13488
13538
|
]);
|
|
13489
|
-
const item = view?.request;
|
|
13539
|
+
const item = current ? view?.request : void 0;
|
|
13490
13540
|
const state = item?.state === "open" && item.draft ? "draft" : item?.state;
|
|
13491
13541
|
const icon = state === "merged" ? git_merge_default : state === "closed" ? git_pull_request_closed_default : state === "draft" ? git_pull_request_draft_default : git_pull_request_default;
|
|
13492
13542
|
const label = item && state ? `${copy.title} ${view?.provider === "gitlab" ? "!" : "#"}${item.number}: ${copy[state]}` : "";
|
|
@@ -14209,6 +14259,15 @@ function apply$1(ctx) {
|
|
|
14209
14259
|
const channel = "/api";
|
|
14210
14260
|
const describeMethod = "dungsil-vcs/describe";
|
|
14211
14261
|
const executeMethod = "dungsil-vcs/execute";
|
|
14262
|
+
function validCommitSettings(value) {
|
|
14263
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return false;
|
|
14264
|
+
const input = value;
|
|
14265
|
+
return Object.keys(input).every((key) => [
|
|
14266
|
+
"authorName",
|
|
14267
|
+
"authorEmail",
|
|
14268
|
+
"noSign"
|
|
14269
|
+
].includes(key)) && typeof input.authorName === "string" && input.authorName.length <= 200 && !/[<>]/.test(input.authorName) && !Array.from(input.authorName).some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127) && typeof input.authorEmail === "string" && input.authorEmail.length <= 254 && (input.authorEmail === "" || /^[^\s<>@]+@[^\s<>@]+$/.test(input.authorEmail)) && !Array.from(input.authorEmail).some((char) => char.charCodeAt(0) < 32 || char.charCodeAt(0) === 127) && (input.authorName === "" ? input.authorEmail === "" : !!input.authorName.trim() && !!input.authorEmail) && typeof input.noSign === "boolean";
|
|
14270
|
+
}
|
|
14212
14271
|
function isGitActionResult(value) {
|
|
14213
14272
|
if (!value || typeof value !== "object") return false;
|
|
14214
14273
|
const result = value;
|
|
@@ -14218,6 +14277,321 @@ function isGitActionResult(value) {
|
|
|
14218
14277
|
"pr"
|
|
14219
14278
|
].includes(result.operation) && typeof result.branch === "string" && (result.commit === void 0 || /^[a-f0-9]{40,64}$/.test(result.commit)) && (result.url === void 0 || /^https?:\/\//.test(result.url)) && Array.isArray(result.checks) && result.checks.every((check) => typeof check === "string");
|
|
14220
14279
|
}
|
|
14280
|
+
// src/settings-client.tsx
|
|
14281
|
+
var settings_client_exports = /* @__PURE__ */ __exportAll({ apply: () => apply$1 });
|
|
14282
|
+
const copy$1 = {
|
|
14283
|
+
ko: {
|
|
14284
|
+
nav: "버전 관리",
|
|
14285
|
+
scope: "DSH의 Git 버튼이 생성하는 커밋에만 적용합니다. 저장소와 사용자 Git 설정은 변경하지 않습니다.",
|
|
14286
|
+
author: "커밋 작성자",
|
|
14287
|
+
name: "이름",
|
|
14288
|
+
email: "이메일",
|
|
14289
|
+
authorHint: "이름과 이메일을 모두 비우면 기존 Git 작성자를 사용합니다. 커미터는 변경하지 않습니다.",
|
|
14290
|
+
noSign: "항상 커밋 서명 비활성화",
|
|
14291
|
+
noSignHint: "활성화하면 이 UI에서 생성하는 커밋에 --no-gpg-sign을 적용합니다. 비활성화하면 기존 Git 서명 설정을 따릅니다.",
|
|
14292
|
+
loading: "불러오는 중…",
|
|
14293
|
+
error: "결과를 확인하지 못했습니다. 새로고침한 뒤 다시 시도하세요.",
|
|
14294
|
+
conflict: "다른 곳에서 설정을 변경했습니다. 새로고침한 뒤 다시 입력하세요.",
|
|
14295
|
+
invalid: "이름과 올바른 이메일을 함께 입력하거나 두 항목을 모두 비우세요.",
|
|
14296
|
+
cli: "CLI 인증 상태",
|
|
14297
|
+
refresh: "새로고침",
|
|
14298
|
+
authenticated: "인증됨",
|
|
14299
|
+
unauthenticated: "인증되지 않음",
|
|
14300
|
+
unavailable: "설치되지 않음",
|
|
14301
|
+
errorStatus: "확인 실패",
|
|
14302
|
+
environment: "환경 변수",
|
|
14303
|
+
keyring: "키링",
|
|
14304
|
+
"config-file": "CLI 설정 파일"
|
|
14305
|
+
},
|
|
14306
|
+
en: {
|
|
14307
|
+
nav: "Version control",
|
|
14308
|
+
scope: "Only applies to commits created by DSH Git buttons. Repository and user Git configuration are never changed.",
|
|
14309
|
+
author: "Commit author",
|
|
14310
|
+
name: "Name",
|
|
14311
|
+
email: "Email",
|
|
14312
|
+
authorHint: "Leave both fields empty to use the existing Git author. The committer is not changed.",
|
|
14313
|
+
noSign: "Always disable commit signing",
|
|
14314
|
+
noSignHint: "When enabled, commits created by this UI use --no-gpg-sign. Otherwise, existing Git signing settings apply.",
|
|
14315
|
+
loading: "Loading…",
|
|
14316
|
+
error: "Could not confirm the result. Refresh before retrying.",
|
|
14317
|
+
conflict: "Settings changed elsewhere. Refresh and enter your changes again.",
|
|
14318
|
+
invalid: "Enter both a name and a valid email, or leave both fields empty.",
|
|
14319
|
+
cli: "CLI authentication",
|
|
14320
|
+
refresh: "Refresh",
|
|
14321
|
+
authenticated: "Authenticated",
|
|
14322
|
+
unauthenticated: "Not authenticated",
|
|
14323
|
+
unavailable: "Not installed",
|
|
14324
|
+
errorStatus: "Check failed",
|
|
14325
|
+
environment: "Environment variable",
|
|
14326
|
+
keyring: "Keyring",
|
|
14327
|
+
"config-file": "CLI config file"
|
|
14328
|
+
},
|
|
14329
|
+
zh: {
|
|
14330
|
+
nav: "版本控制",
|
|
14331
|
+
scope: "仅适用于 DSH Git 按钮创建的提交,不会修改仓库或用户 Git 配置。",
|
|
14332
|
+
author: "提交作者",
|
|
14333
|
+
name: "姓名",
|
|
14334
|
+
email: "邮箱",
|
|
14335
|
+
authorHint: "将两个字段都留空以使用现有 Git 作者,不更改提交者。",
|
|
14336
|
+
noSign: "始终禁用提交签名",
|
|
14337
|
+
noSignHint: "启用时,此 UI 创建的提交使用 --no-gpg-sign;否则遵循现有 Git 签名设置。",
|
|
14338
|
+
loading: "正在加载…",
|
|
14339
|
+
error: "无法确认结果,请刷新后重试。",
|
|
14340
|
+
conflict: "设置已在其他位置更改,请刷新后重新输入。",
|
|
14341
|
+
invalid: "请输入姓名和有效邮箱,或将两个字段都留空。",
|
|
14342
|
+
cli: "CLI 认证状态",
|
|
14343
|
+
refresh: "刷新",
|
|
14344
|
+
authenticated: "已认证",
|
|
14345
|
+
unauthenticated: "未认证",
|
|
14346
|
+
unavailable: "未安装",
|
|
14347
|
+
errorStatus: "检查失败",
|
|
14348
|
+
environment: "环境变量",
|
|
14349
|
+
keyring: "密钥环",
|
|
14350
|
+
"config-file": "CLI 配置文件"
|
|
14351
|
+
}
|
|
14352
|
+
};
|
|
14353
|
+
const localized = (language) => copy$1[language.startsWith("ko") ? "ko" : language.startsWith("zh") ? "zh" : "en"];
|
|
14354
|
+
function VcsSettings({ ctx }) {
|
|
14355
|
+
const { active } = useLocaleSnapshot(ctx.locale);
|
|
14356
|
+
const text = localized(active);
|
|
14357
|
+
const id = (0, react.useId)();
|
|
14358
|
+
const connection = ctx.get("connection");
|
|
14359
|
+
const [view, setView] = (0, react.useState)();
|
|
14360
|
+
const [draft, setDraft] = (0, react.useState)();
|
|
14361
|
+
const [busy, setBusy] = (0, react.useState)(false);
|
|
14362
|
+
const [blocked, setBlocked] = (0, react.useState)(false);
|
|
14363
|
+
const [notice, setNotice] = (0, react.useState)();
|
|
14364
|
+
const [cli, setCli] = (0, react.useState)();
|
|
14365
|
+
const [checking, setChecking] = (0, react.useState)(false);
|
|
14366
|
+
const [cliError, setCliError] = (0, react.useState)(false);
|
|
14367
|
+
const pending = (0, react.useRef)(false);
|
|
14368
|
+
const lifetime = (0, react.useRef)(null);
|
|
14369
|
+
const load = async (signal) => {
|
|
14370
|
+
setBusy(true);
|
|
14371
|
+
try {
|
|
14372
|
+
const result = await connection.rpc.call(channel, "dungsil-vcs/settings", {}, signal);
|
|
14373
|
+
if (signal.aborted) return;
|
|
14374
|
+
if (!result.ok) throw new Error("unavailable");
|
|
14375
|
+
const next = result.value;
|
|
14376
|
+
setView(next);
|
|
14377
|
+
setDraft(next.settings);
|
|
14378
|
+
setBlocked(false);
|
|
14379
|
+
setNotice(void 0);
|
|
14380
|
+
} catch {
|
|
14381
|
+
if (!signal.aborted) {
|
|
14382
|
+
setBlocked(true);
|
|
14383
|
+
setNotice("error");
|
|
14384
|
+
}
|
|
14385
|
+
} finally {
|
|
14386
|
+
if (!signal.aborted) setBusy(false);
|
|
14387
|
+
}
|
|
14388
|
+
};
|
|
14389
|
+
(0, react.useEffect)(() => {
|
|
14390
|
+
const controller = new AbortController();
|
|
14391
|
+
lifetime.current = controller;
|
|
14392
|
+
load(controller.signal);
|
|
14393
|
+
check(controller.signal);
|
|
14394
|
+
return () => controller.abort();
|
|
14395
|
+
}, []);
|
|
14396
|
+
const check = async (signal) => {
|
|
14397
|
+
setChecking(true);
|
|
14398
|
+
setCliError(false);
|
|
14399
|
+
try {
|
|
14400
|
+
const result = await connection.rpc.call(channel, "dungsil-vcs/cli-status", {}, signal);
|
|
14401
|
+
if (signal.aborted) return;
|
|
14402
|
+
if (!result.ok) throw new Error("unavailable");
|
|
14403
|
+
setCli(result.value);
|
|
14404
|
+
} catch {
|
|
14405
|
+
if (!signal.aborted) {
|
|
14406
|
+
setCli(void 0);
|
|
14407
|
+
setCliError(true);
|
|
14408
|
+
}
|
|
14409
|
+
} finally {
|
|
14410
|
+
if (!signal.aborted) setChecking(false);
|
|
14411
|
+
}
|
|
14412
|
+
};
|
|
14413
|
+
const save = async () => {
|
|
14414
|
+
const signal = lifetime.current?.signal;
|
|
14415
|
+
if (!signal || signal.aborted || pending.current || !view || !validCommitSettings(draft) || blocked) return;
|
|
14416
|
+
if (JSON.stringify(view.settings) === JSON.stringify(draft)) return;
|
|
14417
|
+
const settings = draft;
|
|
14418
|
+
pending.current = true;
|
|
14419
|
+
setBusy(true);
|
|
14420
|
+
setNotice(void 0);
|
|
14421
|
+
try {
|
|
14422
|
+
const result = await connection.rpc.call(channel, "dungsil-vcs/save-settings", {
|
|
14423
|
+
revision: view.revision,
|
|
14424
|
+
settings
|
|
14425
|
+
}, signal);
|
|
14426
|
+
if (signal.aborted) return;
|
|
14427
|
+
if (!result.ok) {
|
|
14428
|
+
setBlocked(true);
|
|
14429
|
+
setNotice(result.error.code === "conflict" ? "conflict" : "error");
|
|
14430
|
+
return;
|
|
14431
|
+
}
|
|
14432
|
+
const next = result.value;
|
|
14433
|
+
setView(next);
|
|
14434
|
+
setDraft((current) => JSON.stringify(current) === JSON.stringify(settings) ? next.settings : current);
|
|
14435
|
+
} catch {
|
|
14436
|
+
if (!signal.aborted) {
|
|
14437
|
+
setBlocked(true);
|
|
14438
|
+
setNotice("error");
|
|
14439
|
+
}
|
|
14440
|
+
} finally {
|
|
14441
|
+
pending.current = false;
|
|
14442
|
+
if (!signal.aborted) setBusy(false);
|
|
14443
|
+
}
|
|
14444
|
+
};
|
|
14445
|
+
(0, react.useEffect)(() => {
|
|
14446
|
+
if (busy || blocked || !view || !validCommitSettings(draft)) return;
|
|
14447
|
+
if (JSON.stringify(view.settings) === JSON.stringify(draft)) return;
|
|
14448
|
+
const timer = setTimeout(() => void save(), 600);
|
|
14449
|
+
return () => clearTimeout(timer);
|
|
14450
|
+
}, [
|
|
14451
|
+
draft,
|
|
14452
|
+
view,
|
|
14453
|
+
busy,
|
|
14454
|
+
blocked
|
|
14455
|
+
]);
|
|
14456
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
|
|
14457
|
+
className: "dsh-vcs-settings",
|
|
14458
|
+
"aria-label": text.nav,
|
|
14459
|
+
children: [
|
|
14460
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("form", {
|
|
14461
|
+
onSubmit: (event) => {
|
|
14462
|
+
event.preventDefault();
|
|
14463
|
+
save();
|
|
14464
|
+
},
|
|
14465
|
+
children: [
|
|
14466
|
+
draft && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("fieldset", {
|
|
14467
|
+
disabled: blocked,
|
|
14468
|
+
children: [
|
|
14469
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: text.author }),
|
|
14470
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: text.scope }),
|
|
14471
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: text.authorHint }),
|
|
14472
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsRow, {
|
|
14473
|
+
label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
14474
|
+
htmlFor: `${id}-name`,
|
|
14475
|
+
children: text.name
|
|
14476
|
+
}),
|
|
14477
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
14478
|
+
className: "dsh-vcs-settings-input",
|
|
14479
|
+
id: `${id}-name`,
|
|
14480
|
+
value: draft.authorName,
|
|
14481
|
+
maxLength: 200,
|
|
14482
|
+
autoComplete: "off",
|
|
14483
|
+
onChange: (event) => {
|
|
14484
|
+
setDraft({
|
|
14485
|
+
...draft,
|
|
14486
|
+
authorName: event.target.value
|
|
14487
|
+
});
|
|
14488
|
+
setNotice(void 0);
|
|
14489
|
+
}
|
|
14490
|
+
})
|
|
14491
|
+
}),
|
|
14492
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsRow, {
|
|
14493
|
+
label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
14494
|
+
htmlFor: `${id}-email`,
|
|
14495
|
+
children: text.email
|
|
14496
|
+
}),
|
|
14497
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
14498
|
+
className: "dsh-vcs-settings-input",
|
|
14499
|
+
id: `${id}-email`,
|
|
14500
|
+
type: "email",
|
|
14501
|
+
value: draft.authorEmail,
|
|
14502
|
+
maxLength: 254,
|
|
14503
|
+
autoComplete: "off",
|
|
14504
|
+
onChange: (event) => {
|
|
14505
|
+
setDraft({
|
|
14506
|
+
...draft,
|
|
14507
|
+
authorEmail: event.target.value
|
|
14508
|
+
});
|
|
14509
|
+
setNotice(void 0);
|
|
14510
|
+
}
|
|
14511
|
+
})
|
|
14512
|
+
}),
|
|
14513
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsRow, {
|
|
14514
|
+
label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { children: text.noSign }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", { children: text.noSignHint })] }),
|
|
14515
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
14516
|
+
label: text.noSign,
|
|
14517
|
+
checked: draft.noSign,
|
|
14518
|
+
disabled: blocked,
|
|
14519
|
+
onChange: (noSign) => {
|
|
14520
|
+
setDraft({
|
|
14521
|
+
...draft,
|
|
14522
|
+
noSign
|
|
14523
|
+
});
|
|
14524
|
+
setNotice(void 0);
|
|
14525
|
+
}
|
|
14526
|
+
})
|
|
14527
|
+
}),
|
|
14528
|
+
!validCommitSettings(draft) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
14529
|
+
role: "alert",
|
|
14530
|
+
children: text.invalid
|
|
14531
|
+
})
|
|
14532
|
+
]
|
|
14533
|
+
}),
|
|
14534
|
+
busy && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
14535
|
+
role: "status",
|
|
14536
|
+
children: text.loading
|
|
14537
|
+
}),
|
|
14538
|
+
notice && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
14539
|
+
role: "alert",
|
|
14540
|
+
children: text[notice]
|
|
14541
|
+
}),
|
|
14542
|
+
blocked && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
14543
|
+
type: "button",
|
|
14544
|
+
disabled: busy,
|
|
14545
|
+
onClick: () => {
|
|
14546
|
+
if (lifetime.current) load(lifetime.current.signal);
|
|
14547
|
+
},
|
|
14548
|
+
children: text.refresh
|
|
14549
|
+
})
|
|
14550
|
+
]
|
|
14551
|
+
}),
|
|
14552
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", { children: text.cli }),
|
|
14553
|
+
checking && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
14554
|
+
role: "status",
|
|
14555
|
+
children: text.loading
|
|
14556
|
+
}),
|
|
14557
|
+
cliError && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
14558
|
+
role: "alert",
|
|
14559
|
+
children: text.error
|
|
14560
|
+
}),
|
|
14561
|
+
cli?.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
14562
|
+
className: "dsh-vcs-settings-cli",
|
|
14563
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsRow, {
|
|
14564
|
+
label: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("strong", { children: item.cli }),
|
|
14565
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: text[item.status === "error" ? "errorStatus" : item.status] })
|
|
14566
|
+
}), item.accounts.map((account, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("p", { children: [
|
|
14567
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("code", { children: account.host }),
|
|
14568
|
+
" · ",
|
|
14569
|
+
account.login,
|
|
14570
|
+
account.method && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [" · ", text[account.method]] })
|
|
14571
|
+
] }, index))]
|
|
14572
|
+
}, item.cli))
|
|
14573
|
+
]
|
|
14574
|
+
});
|
|
14575
|
+
}
|
|
14576
|
+
function apply$1(ctx) {
|
|
14577
|
+
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
14578
|
+
name: "settings.section",
|
|
14579
|
+
id: "dungsil-ui-vcs",
|
|
14580
|
+
order: 17,
|
|
14581
|
+
label: () => localized(ctx.locale.getSnapshot().active).nav,
|
|
14582
|
+
inject: () => ({ ctx })
|
|
14583
|
+
}, VcsSettings));
|
|
14584
|
+
ctx.effect(() => installStyles(`${settingsStyles}
|
|
14585
|
+
.dsh-vcs-settings { color: var(--dsw-alias-label-primary); font: 14px/22px var(--dsw-font-family, system-ui); }
|
|
14586
|
+
.dsh-vcs-settings fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
|
|
14587
|
+
.dsh-vcs-settings h3 { font: inherit; font-weight: 600; margin: 24px 0 8px; }
|
|
14588
|
+
.dsh-vcs-settings p { color: var(--dsw-alias-label-secondary); margin: 8px 0; overflow-wrap: anywhere; }
|
|
14589
|
+
.dsh-vcs-settings .dsh-plugin-settings-text p { font-size: 12px; line-height: 20px; margin: 4px 0 0; }
|
|
14590
|
+
.dsh-vcs-settings-input { box-sizing: border-box; width: 240px; max-width: 65%; flex: 0 1 240px; min-width: 0; }
|
|
14591
|
+
.dsh-vcs-settings [role=alert] { color: var(--dsw-alias-state-error-primary); }
|
|
14592
|
+
.dsh-vcs-settings-cli .dsh-plugin-settings-row { padding: 8px 0; }
|
|
14593
|
+
`), "ui-vcs: settings styles");
|
|
14594
|
+
}
|
|
14221
14595
|
// src/client.tsx
|
|
14222
14596
|
const name = "dungsil-ui-vcs";
|
|
14223
14597
|
const inject = [
|
|
@@ -14235,17 +14609,8 @@ const copy = {
|
|
|
14235
14609
|
push: "Push",
|
|
14236
14610
|
commit: "Commit only",
|
|
14237
14611
|
menu: "More Git actions",
|
|
14238
|
-
loading: "Checking branch…",
|
|
14239
|
-
lookupError: "Could not determine the default branch. Refocus this window to retry. Commit only is still available.",
|
|
14240
14612
|
hint: "Commit and push changes, and create or update a PR on a feature branch or worktree.",
|
|
14241
|
-
sending: "Running Git action…"
|
|
14242
|
-
sent: "Git action completed.",
|
|
14243
|
-
noChanges: "No task changes to commit.",
|
|
14244
|
-
error: "Could not confirm the Git action. Check Git and remote state before retrying.",
|
|
14245
|
-
partialStage: "A selected file has staged and unstaged changes. Finish staging that file before retrying.",
|
|
14246
|
-
readOnly: "Git actions are unavailable in read-only mode.",
|
|
14247
|
-
conflict: "The repository changed. Check Git state before retrying.",
|
|
14248
|
-
busy: "Another task is active. Wait for it to finish."
|
|
14613
|
+
sending: "Running Git action…"
|
|
14249
14614
|
},
|
|
14250
14615
|
ko: {
|
|
14251
14616
|
pr: "PR 생성",
|
|
@@ -14254,17 +14619,8 @@ const copy = {
|
|
|
14254
14619
|
push: "푸시",
|
|
14255
14620
|
commit: "커밋만",
|
|
14256
14621
|
menu: "다른 Git 작업",
|
|
14257
|
-
loading: "브랜치 확인 중…",
|
|
14258
|
-
lookupError: "기본 브랜치를 확인하지 못했습니다. 창으로 돌아오면 다시 확인합니다. 커밋만 요청할 수 있습니다.",
|
|
14259
14622
|
hint: "변경 사항을 커밋·푸시하고, 기능 브랜치나 worktree에서는 PR을 생성하거나 업데이트합니다.",
|
|
14260
|
-
sending: "Git 작업 실행 중…"
|
|
14261
|
-
sent: "Git 작업을 완료했습니다.",
|
|
14262
|
-
noChanges: "커밋할 작업 변경 사항이 없습니다.",
|
|
14263
|
-
error: "Git 작업 결과를 확인하지 못했습니다. 다시 시도하기 전에 Git과 원격 저장소 상태를 확인하세요.",
|
|
14264
|
-
partialStage: "선택한 파일에 스테이징한 변경과 하지 않은 변경이 함께 있습니다. 해당 파일의 스테이징을 마친 뒤 다시 시도하세요.",
|
|
14265
|
-
readOnly: "읽기 전용 모드에서는 Git 작업을 실행할 수 없습니다.",
|
|
14266
|
-
conflict: "저장소 상태가 바뀌었습니다. Git 상태를 확인한 뒤 다시 시도하세요.",
|
|
14267
|
-
busy: "다른 작업을 실행 중입니다. 작업이 끝날 때까지 기다리세요."
|
|
14623
|
+
sending: "Git 작업 실행 중…"
|
|
14268
14624
|
},
|
|
14269
14625
|
zh: {
|
|
14270
14626
|
pr: "创建 PR",
|
|
@@ -14273,21 +14629,13 @@ const copy = {
|
|
|
14273
14629
|
push: "推送",
|
|
14274
14630
|
commit: "仅提交",
|
|
14275
14631
|
menu: "更多 Git 操作",
|
|
14276
|
-
loading: "正在检查分支…",
|
|
14277
|
-
lookupError: "无法确定默认分支。重新聚焦窗口以重试。仍可选择仅提交。",
|
|
14278
14632
|
hint: "提交并推送更改,在功能分支或 worktree 中创建或更新 PR。",
|
|
14279
|
-
sending: "正在执行 Git 操作…"
|
|
14280
|
-
sent: "Git 操作已完成。",
|
|
14281
|
-
noChanges: "没有可提交的任务更改。",
|
|
14282
|
-
error: "无法确认 Git 操作结果。请先检查 Git 和远程仓库状态,再决定是否重试。",
|
|
14283
|
-
partialStage: "所选文件同时包含已暂存和未暂存的更改。请完成该文件的暂存后重试。",
|
|
14284
|
-
readOnly: "只读模式下无法执行 Git 操作。",
|
|
14285
|
-
conflict: "仓库状态已更改。请检查 Git 状态后重试。",
|
|
14286
|
-
busy: "另一个任务正在运行。请等待任务结束。"
|
|
14633
|
+
sending: "正在执行 Git 操作…"
|
|
14287
14634
|
}
|
|
14288
14635
|
};
|
|
14289
14636
|
function apply(ctx) {
|
|
14290
14637
|
ctx.plugin(pull_requests_client_exports);
|
|
14638
|
+
ctx.plugin(settings_client_exports);
|
|
14291
14639
|
const connection = ctx.get("connection");
|
|
14292
14640
|
function Action({ sessionId, useSession, useAccess, useProjection }) {
|
|
14293
14641
|
const language = (0, react.useSyncExternalStore)((listener) => ctx.locale.subscribe(listener), () => ctx.locale.getSnapshot().active);
|
|
@@ -14306,9 +14654,7 @@ function apply(ctx) {
|
|
|
14306
14654
|
const [lookup, setLookup] = (0, react.useState)("loading");
|
|
14307
14655
|
const [open, setOpen] = (0, react.useState)(false);
|
|
14308
14656
|
const [hasChanges, setHasChanges] = (0, react.useState)(false);
|
|
14309
|
-
const [
|
|
14310
|
-
const [result, setResult] = (0, react.useState)();
|
|
14311
|
-
const [errorCode, setErrorCode] = (0, react.useState)("");
|
|
14657
|
+
const [sending, setSending] = (0, react.useState)(false);
|
|
14312
14658
|
const mounted = (0, react.useRef)(true);
|
|
14313
14659
|
(0, react.useEffect)(() => {
|
|
14314
14660
|
mounted.current = true;
|
|
@@ -14316,8 +14662,7 @@ function apply(ctx) {
|
|
|
14316
14662
|
mounted.current = false;
|
|
14317
14663
|
};
|
|
14318
14664
|
}, []);
|
|
14319
|
-
const
|
|
14320
|
-
const disabled = !canPrompt || unavailable || status === "sending" || typeof cwd !== "string";
|
|
14665
|
+
const disabled = !canPrompt || unavailable || sending || typeof cwd !== "string";
|
|
14321
14666
|
const viewOnly = hasRequest && !needsUpdate;
|
|
14322
14667
|
const ciState = ciRequest ? checksState(ciRequest) : "warning";
|
|
14323
14668
|
const ciLabel = {
|
|
@@ -14401,9 +14746,7 @@ function apply(ctx) {
|
|
|
14401
14746
|
if (disabled || pending.current || typeof cwd !== "string") return;
|
|
14402
14747
|
pending.current = true;
|
|
14403
14748
|
setOpen(false);
|
|
14404
|
-
|
|
14405
|
-
setErrorCode("");
|
|
14406
|
-
setStatus("sending");
|
|
14749
|
+
setSending(true);
|
|
14407
14750
|
try {
|
|
14408
14751
|
const response = await connection.rpc.call(channel, executeMethod, {
|
|
14409
14752
|
sessionId,
|
|
@@ -14412,110 +14755,79 @@ function apply(ctx) {
|
|
|
14412
14755
|
requestId: crypto.randomUUID()
|
|
14413
14756
|
}, AbortSignal.timeout(3e5));
|
|
14414
14757
|
if (!mounted.current) return;
|
|
14415
|
-
if (!response.ok)
|
|
14416
|
-
setErrorCode(response.error.code);
|
|
14417
|
-
setStatus("error");
|
|
14418
|
-
return;
|
|
14419
|
-
}
|
|
14758
|
+
if (!response.ok) return;
|
|
14420
14759
|
if (!isGitActionResult(response.value) || response.value.operation !== selected) throw new Error("Invalid Git response");
|
|
14421
|
-
setResult(response.value);
|
|
14422
14760
|
if (response.value.operation === "pr" && response.value.url) {
|
|
14423
14761
|
setHasRequest(true);
|
|
14424
14762
|
setNeedsUpdate(false);
|
|
14425
14763
|
}
|
|
14426
|
-
|
|
14427
|
-
} catch {
|
|
14428
|
-
if (mounted.current) setStatus("error");
|
|
14429
|
-
} finally {
|
|
14764
|
+
} catch {} finally {
|
|
14430
14765
|
pending.current = false;
|
|
14766
|
+
if (mounted.current) setSending(false);
|
|
14431
14767
|
}
|
|
14432
14768
|
};
|
|
14433
|
-
if (hidden || !hasChanges) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14769
|
+
if (hidden || !hasChanges || lookup !== "ready" || !operation) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
14434
14770
|
ref: anchor,
|
|
14435
14771
|
hidden: true
|
|
14436
14772
|
});
|
|
14437
14773
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
14438
14774
|
className: "dsh-vcs",
|
|
14439
|
-
children: [
|
|
14440
|
-
|
|
14441
|
-
|
|
14442
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14443
|
-
className: "dsh-vcs-trigger",
|
|
14444
|
-
disabled: !viewOnly && disabled || !operation || lookup !== "ready",
|
|
14445
|
-
title: viewOnly ? text.viewPr : text.hint,
|
|
14446
|
-
"aria-describedby": statusId,
|
|
14447
|
-
"aria-busy": status === "sending",
|
|
14448
|
-
onClick: () => {
|
|
14449
|
-
if (viewOnly) ctx.sidebarRight.openTab(name$1);
|
|
14450
|
-
else if (operation) send(operation);
|
|
14451
|
-
},
|
|
14452
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { "aria-hidden": "true" }), viewOnly ? text.viewPr : status === "sending" ? text.sending : operation === "push" ? text.push : hasRequest ? text.updatePr : text.pr]
|
|
14453
|
-
}), !viewOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
14454
|
-
open,
|
|
14455
|
-
side: "top",
|
|
14456
|
-
portal: true,
|
|
14457
|
-
compact: true,
|
|
14458
|
-
items: [...hasRequest ? [{
|
|
14459
|
-
id: "view",
|
|
14460
|
-
label: text.viewPr
|
|
14461
|
-
}] : [], {
|
|
14462
|
-
id: "commit",
|
|
14463
|
-
label: text.commit
|
|
14464
|
-
}],
|
|
14465
|
-
onClose: () => setOpen(false),
|
|
14466
|
-
onSelect: (id) => {
|
|
14467
|
-
if (id === "view") {
|
|
14468
|
-
setOpen(false);
|
|
14469
|
-
ctx.sidebarRight.openTab("dungsil-vcs-pull-requests");
|
|
14470
|
-
} else send("commit");
|
|
14471
|
-
},
|
|
14472
|
-
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14473
|
-
className: "dsh-vcs-trigger dsh-vcs-menu",
|
|
14474
|
-
disabled,
|
|
14475
|
-
"aria-label": text.menu,
|
|
14476
|
-
"aria-haspopup": "menu",
|
|
14477
|
-
"aria-expanded": open,
|
|
14478
|
-
onClick: () => setOpen((value) => !value),
|
|
14479
|
-
onKeyDown: (event) => {
|
|
14480
|
-
if (!open && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
14481
|
-
event.preventDefault();
|
|
14482
|
-
setOpen(true);
|
|
14483
|
-
}
|
|
14484
|
-
},
|
|
14485
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { "aria-hidden": "true" })
|
|
14486
|
-
})
|
|
14487
|
-
})]
|
|
14488
|
-
}),
|
|
14489
|
-
hasRequest && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14775
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
14776
|
+
className: "dsh-vcs-actions",
|
|
14777
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14490
14778
|
className: "dsh-vcs-trigger",
|
|
14491
|
-
|
|
14492
|
-
|
|
14493
|
-
|
|
14494
|
-
|
|
14495
|
-
|
|
14496
|
-
|
|
14497
|
-
|
|
14498
|
-
|
|
14499
|
-
|
|
14500
|
-
|
|
14501
|
-
|
|
14502
|
-
|
|
14503
|
-
|
|
14504
|
-
|
|
14505
|
-
|
|
14506
|
-
|
|
14507
|
-
|
|
14508
|
-
|
|
14509
|
-
|
|
14510
|
-
|
|
14511
|
-
|
|
14512
|
-
|
|
14513
|
-
|
|
14514
|
-
|
|
14515
|
-
|
|
14516
|
-
|
|
14517
|
-
|
|
14518
|
-
|
|
14779
|
+
disabled: !viewOnly && disabled,
|
|
14780
|
+
title: viewOnly ? text.viewPr : text.hint,
|
|
14781
|
+
"aria-busy": sending,
|
|
14782
|
+
onClick: () => {
|
|
14783
|
+
if (viewOnly) ctx.sidebarRight.openTab(name$1);
|
|
14784
|
+
else if (operation) send(operation);
|
|
14785
|
+
},
|
|
14786
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconBranchOutlineRegular, { "aria-hidden": "true" }), viewOnly ? text.viewPr : sending ? text.sending : operation === "push" ? text.push : hasRequest ? text.updatePr : text.pr]
|
|
14787
|
+
}), !viewOnly && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
|
|
14788
|
+
open,
|
|
14789
|
+
side: "top",
|
|
14790
|
+
portal: true,
|
|
14791
|
+
compact: true,
|
|
14792
|
+
items: [...hasRequest ? [{
|
|
14793
|
+
id: "view",
|
|
14794
|
+
label: text.viewPr
|
|
14795
|
+
}] : [], {
|
|
14796
|
+
id: "commit",
|
|
14797
|
+
label: text.commit
|
|
14798
|
+
}],
|
|
14799
|
+
onClose: () => setOpen(false),
|
|
14800
|
+
onSelect: (id) => {
|
|
14801
|
+
if (id === "view") {
|
|
14802
|
+
setOpen(false);
|
|
14803
|
+
ctx.sidebarRight.openTab("dungsil-vcs-pull-requests");
|
|
14804
|
+
} else send("commit");
|
|
14805
|
+
},
|
|
14806
|
+
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14807
|
+
className: "dsh-vcs-trigger dsh-vcs-menu",
|
|
14808
|
+
disabled,
|
|
14809
|
+
"aria-label": text.menu,
|
|
14810
|
+
"aria-haspopup": "menu",
|
|
14811
|
+
"aria-expanded": open,
|
|
14812
|
+
onClick: () => setOpen((value) => !value),
|
|
14813
|
+
onKeyDown: (event) => {
|
|
14814
|
+
if (!open && (event.key === "ArrowDown" || event.key === "ArrowUp")) {
|
|
14815
|
+
event.preventDefault();
|
|
14816
|
+
setOpen(true);
|
|
14817
|
+
}
|
|
14818
|
+
},
|
|
14819
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { "aria-hidden": "true" })
|
|
14820
|
+
})
|
|
14821
|
+
})]
|
|
14822
|
+
}), hasRequest && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Pill, {
|
|
14823
|
+
className: "dsh-vcs-trigger",
|
|
14824
|
+
title: `${labels.checks}: ${ciLabel}`,
|
|
14825
|
+
onClick: () => ctx.sidebarRight.openTab("dungsil-vcs-pull-requests", { params: { section: "checks" } }),
|
|
14826
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
14827
|
+
state: ciState,
|
|
14828
|
+
appearance: "step"
|
|
14829
|
+
}), `${labels.checks}: ${ciLabel}`]
|
|
14830
|
+
})]
|
|
14519
14831
|
});
|
|
14520
14832
|
}
|
|
14521
14833
|
ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
@@ -14531,15 +14843,10 @@ function apply(ctx) {
|
|
|
14531
14843
|
.dsh-vcs-actions > .dsh-vcs-trigger { border-radius: 14px 0 0 14px; }
|
|
14532
14844
|
.dsh-vcs-actions > .dsh-vcs-trigger:only-child { border-radius: 14px; }
|
|
14533
14845
|
.dsh-vcs-actions .dsh-vcs-menu { border-radius: 0 14px 14px 0; border-left: 0; padding: 0 7px; }
|
|
14534
|
-
.dsh-vcs-notice { font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); }
|
|
14535
14846
|
.dsh-vcs-trigger { height: 28px; max-width: 100%; padding: 0 10px; border: 1px solid var(--dsw-alias-border-l2); font: inherit; font-size: 12px; line-height: 18px; }
|
|
14536
14847
|
.dsh-vcs-trigger svg { flex: none; width: 14px; height: 14px; }
|
|
14537
14848
|
.dsh-vcs-trigger:disabled { background: var(--dsw-alias-bg-layer-2); color: var(--dsw-alias-label-dimmed); cursor: default; }
|
|
14538
14849
|
.dsh-vcs-trigger:focus-visible { outline: 2px solid var(--dsw-focus-ring-color, var(--dsw-alias-state-business-primary)); outline-offset: 0; }
|
|
14539
|
-
.dsh-vcs-status { flex-basis: 100%; font-size: 12px; line-height: 18px; color: var(--dsw-alias-label-secondary); }
|
|
14540
|
-
.dsh-vcs-status:empty { display: none; }
|
|
14541
|
-
.dsh-vcs-status { overflow-wrap: anywhere; }
|
|
14542
|
-
.dsh-vcs-status[role=alert] { color: var(--dsw-alias-state-error-primary); }
|
|
14543
14850
|
.dsh-vcs-session-request svg { width: 100%; height: 100%; }
|
|
14544
14851
|
`;
|
|
14545
14852
|
document.head.append(style);
|