dsh-agy-link 0.5.1 → 0.5.2
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/CHANGELOG.md +20 -0
- package/README.md +379 -343
- package/dist/client.js +478 -159
- package/docs/CONFIGURATION.md +2 -0
- package/docs/README.en.md +41 -47
- package/docs/README.es.md +42 -48
- package/docs/README.pt-BR.md +41 -47
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -40,6 +40,70 @@ window.__ModuleLoader__.load({
|
|
|
40
40
|
flame: "M8.5 14.5A2.5 2.5 0 0 0 11 12c0-1.38-.5-2-1-3-1.072-2.143-.224-4.054 2-6 .5 2.5 2 4.9 4 6.5 2 1.6 3 3.5 3 5.5a7 7 0 1 1-14 0c0-1.153.433-2.294 1-3a2.5 2.5 0 0 0 2.5 2.5z"
|
|
41
41
|
};
|
|
42
42
|
//#endregion
|
|
43
|
+
//#region src/client/config-options.ts
|
|
44
|
+
/** Thinking levels the translation call accepts, in ascending order. */
|
|
45
|
+
const EFFORT_LEVELS = [
|
|
46
|
+
"low",
|
|
47
|
+
"medium",
|
|
48
|
+
"high"
|
|
49
|
+
];
|
|
50
|
+
/**
|
|
51
|
+
* Translation-model dropdown: `''` (host fallback chain: gemini-3.8-flash →
|
|
52
|
+
* newest gemini-*-flash → conversation default) plus every catalog model.
|
|
53
|
+
*/
|
|
54
|
+
function translateModelOptions(current, models, autoLabel) {
|
|
55
|
+
const options = [{
|
|
56
|
+
value: "",
|
|
57
|
+
label: autoLabel
|
|
58
|
+
}];
|
|
59
|
+
const seen = /* @__PURE__ */ new Set([""]);
|
|
60
|
+
for (const model of models) {
|
|
61
|
+
const id = typeof model?.id === "string" ? model.id.trim() : "";
|
|
62
|
+
if (id === "" || seen.has(id)) continue;
|
|
63
|
+
seen.add(id);
|
|
64
|
+
const name = typeof model?.name === "string" ? model.name.trim() : "";
|
|
65
|
+
options.push({
|
|
66
|
+
value: id,
|
|
67
|
+
label: name === "" ? id : name
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const wanted = typeof current === "string" ? current.trim() : "";
|
|
71
|
+
if (wanted !== "" && !seen.has(wanted)) options.push({
|
|
72
|
+
value: wanted,
|
|
73
|
+
label: wanted
|
|
74
|
+
});
|
|
75
|
+
return options;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The dropdown offers the Gemini family only: the card is branded "Gemini 译文",
|
|
79
|
+
* so picking e.g. Claude there would make the label a lie. A model configured by
|
|
80
|
+
* hand is still appended by `translateModelOptions`, so the state stays honest.
|
|
81
|
+
*/
|
|
82
|
+
function geminiCatalogModels(models) {
|
|
83
|
+
return models.filter((model) => typeof model?.id === "string" && /gemini/i.test(model.id));
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Thinking-effort dropdown: `''` (follow the default effort) plus the levels
|
|
87
|
+
* agy understands; an unrecognised configured level is appended verbatim so the
|
|
88
|
+
* select can display it rather than pretending the value is unset.
|
|
89
|
+
*/
|
|
90
|
+
function translateEffortOptions(current, labels) {
|
|
91
|
+
const options = [{
|
|
92
|
+
value: "",
|
|
93
|
+
label: labels.auto
|
|
94
|
+
}];
|
|
95
|
+
for (const level of EFFORT_LEVELS) options.push({
|
|
96
|
+
value: level,
|
|
97
|
+
label: labels[level]
|
|
98
|
+
});
|
|
99
|
+
const wanted = typeof current === "string" ? current.trim().toLowerCase() : "";
|
|
100
|
+
if (wanted !== "" && !options.some((option) => option.value === wanted)) options.push({
|
|
101
|
+
value: wanted,
|
|
102
|
+
label: wanted
|
|
103
|
+
});
|
|
104
|
+
return options;
|
|
105
|
+
}
|
|
106
|
+
//#endregion
|
|
43
107
|
//#region src/client/locales.ts
|
|
44
108
|
/** Native DSH locale dictionaries for the Antigravity UI. */
|
|
45
109
|
const NS = "agy-link";
|
|
@@ -195,6 +259,12 @@ window.__ModuleLoader__.load({
|
|
|
195
259
|
"config.autoWarmupDesc": "周配额到达重置时间或冷启动时自动唤醒 1 次启动新周期",
|
|
196
260
|
"config.autoTranslate": "自动翻译",
|
|
197
261
|
"config.autoTranslateDesc": "每个回合结束后,用 Gemini 把最后的回复翻成大白话,显示在该回复下方",
|
|
262
|
+
"config.translateModel": "翻译模型",
|
|
263
|
+
"config.translateModelDesc": "翻译调用使用哪个模型;默认自动从 Gemini Flash 里挑最新的一个",
|
|
264
|
+
"config.translateModelAuto": "默认(自动)",
|
|
265
|
+
"config.translateEffort": "思考强度",
|
|
266
|
+
"config.translateEffortDesc": "翻译调用使用的思考档;默认跟随下面的「默认思考强度」",
|
|
267
|
+
"config.translateEffortAuto": "跟随默认",
|
|
198
268
|
"config.on": "开启",
|
|
199
269
|
"config.off": "关闭",
|
|
200
270
|
"config.runtimeTitle": "运行方式",
|
|
@@ -203,7 +273,6 @@ window.__ModuleLoader__.load({
|
|
|
203
273
|
"config.defaultEffortDesc": "auto = 各模型用自身默认档;选定后作为会话模型下拉框的初始档位,仍可按模型覆盖",
|
|
204
274
|
"tsl.badge": "Gemini 译文",
|
|
205
275
|
"tsl.plain": "人话版",
|
|
206
|
-
"tsl.byGemini": "由 Gemini 翻译",
|
|
207
276
|
"tsl.translate": "译成人话",
|
|
208
277
|
"tsl.actionTip": "用 Gemini 把这条回复译成人话",
|
|
209
278
|
"tsl.translating": "翻译中…",
|
|
@@ -371,6 +440,12 @@ window.__ModuleLoader__.load({
|
|
|
371
440
|
"config.autoWarmupDesc": "Automatically trigger a 1-token probe when weekly reset time is reached",
|
|
372
441
|
"config.autoTranslate": "Auto translate",
|
|
373
442
|
"config.autoTranslateDesc": "After each turn, Gemini rewrites the final answer in plain language and shows it under that reply",
|
|
443
|
+
"config.translateModel": "Translation model",
|
|
444
|
+
"config.translateModelDesc": "Model used for the translation call; the default picks the newest Gemini Flash automatically",
|
|
445
|
+
"config.translateModelAuto": "Default (auto)",
|
|
446
|
+
"config.translateEffort": "Thinking effort",
|
|
447
|
+
"config.translateEffortDesc": "Effort used for the translation call; the default follows “Default thinking effort” below",
|
|
448
|
+
"config.translateEffortAuto": "Follow default",
|
|
374
449
|
"config.on": "On",
|
|
375
450
|
"config.off": "Off",
|
|
376
451
|
"config.runtimeTitle": "Runtime",
|
|
@@ -379,7 +454,6 @@ window.__ModuleLoader__.load({
|
|
|
379
454
|
"config.defaultEffortDesc": "auto = each model keeps its own default; a fixed level seeds the session model menu and can still be overridden per model",
|
|
380
455
|
"tsl.badge": "Gemini translation",
|
|
381
456
|
"tsl.plain": "Plain language",
|
|
382
|
-
"tsl.byGemini": "Translated by Gemini",
|
|
383
457
|
"tsl.translate": "Translate to plain language",
|
|
384
458
|
"tsl.actionTip": "Rewrite this reply in plain language with Gemini",
|
|
385
459
|
"tsl.translating": "Translating…",
|
|
@@ -547,6 +621,12 @@ window.__ModuleLoader__.load({
|
|
|
547
621
|
"config.autoWarmupDesc": "Ativa automaticamente um ciclo quando o tempo de redefinição semanal é atingido",
|
|
548
622
|
"config.autoTranslate": "Tradução automática",
|
|
549
623
|
"config.autoTranslateDesc": "Ao fim de cada turno, o Gemini reescreve a resposta final em linguagem simples e mostra abaixo dela",
|
|
624
|
+
"config.translateModel": "Modelo de tradução",
|
|
625
|
+
"config.translateModelDesc": "Modelo usado na chamada de tradução; o padrão escolhe automaticamente o Gemini Flash mais recente",
|
|
626
|
+
"config.translateModelAuto": "Padrão (auto)",
|
|
627
|
+
"config.translateEffort": "Intensidade de raciocínio",
|
|
628
|
+
"config.translateEffortDesc": "Intensidade usada na chamada de tradução; o padrão segue “Intensidade de raciocínio padrão” abaixo",
|
|
629
|
+
"config.translateEffortAuto": "Seguir padrão",
|
|
550
630
|
"config.on": "Ativado",
|
|
551
631
|
"config.off": "Desativado",
|
|
552
632
|
"config.runtimeTitle": "Execução",
|
|
@@ -555,7 +635,6 @@ window.__ModuleLoader__.load({
|
|
|
555
635
|
"config.defaultEffortDesc": "auto = cada modelo mantém o próprio padrão; um nível fixo define o valor inicial do menu de modelos da sessão e ainda pode ser substituído por modelo",
|
|
556
636
|
"tsl.badge": "Tradução do Gemini",
|
|
557
637
|
"tsl.plain": "Linguagem simples",
|
|
558
|
-
"tsl.byGemini": "Traduzido pelo Gemini",
|
|
559
638
|
"tsl.translate": "Traduzir para linguagem simples",
|
|
560
639
|
"tsl.actionTip": "Reescrever esta resposta em linguagem simples com o Gemini",
|
|
561
640
|
"tsl.translating": "Traduzindo…",
|
|
@@ -723,6 +802,12 @@ window.__ModuleLoader__.load({
|
|
|
723
802
|
"config.autoWarmupDesc": "Activa automáticamente un ciclo cuando se alcanza el tiempo de reinicio semanal",
|
|
724
803
|
"config.autoTranslate": "Traducción automática",
|
|
725
804
|
"config.autoTranslateDesc": "Al terminar cada turno, Gemini reescribe la respuesta final en lenguaje sencillo y la muestra debajo de esa respuesta",
|
|
805
|
+
"config.translateModel": "Modelo de traducción",
|
|
806
|
+
"config.translateModelDesc": "Modelo usado en la llamada de traducción; el valor por defecto elige automáticamente el Gemini Flash más reciente",
|
|
807
|
+
"config.translateModelAuto": "Predeterminado (auto)",
|
|
808
|
+
"config.translateEffort": "Intensidad de razonamiento",
|
|
809
|
+
"config.translateEffortDesc": "Intensidad usada en la llamada de traducción; el valor por defecto sigue “Intensidad de razonamiento predeterminada” abajo",
|
|
810
|
+
"config.translateEffortAuto": "Seguir predeterminado",
|
|
726
811
|
"config.on": "Activado",
|
|
727
812
|
"config.off": "Desactivado",
|
|
728
813
|
"config.runtimeTitle": "Ejecución",
|
|
@@ -731,7 +816,6 @@ window.__ModuleLoader__.load({
|
|
|
731
816
|
"config.defaultEffortDesc": "auto = cada modelo usa su propio valor por defecto; un nivel fijo fija el valor inicial del menú de modelos de la sesión y aún puede sobrescribirse por modelo",
|
|
732
817
|
"tsl.badge": "Traducción de Gemini",
|
|
733
818
|
"tsl.plain": "Lenguaje sencillo",
|
|
734
|
-
"tsl.byGemini": "Traducido por Gemini",
|
|
735
819
|
"tsl.translate": "Traducir a lenguaje sencillo",
|
|
736
820
|
"tsl.actionTip": "Reescribir esta respuesta en lenguaje sencillo con Gemini",
|
|
737
821
|
"tsl.translating": "Traduciendo…",
|
|
@@ -3920,79 +4004,102 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
3920
4004
|
const STYLE_ID = "dsh-agy-link-tsl-css-v2";
|
|
3921
4005
|
const TRANSLATION_KIND = "agy-translation";
|
|
3922
4006
|
const CSS = `
|
|
3923
|
-
/*
|
|
3924
|
-
|
|
3925
|
-
|
|
3926
|
-
|
|
4007
|
+
/* Card surface. It has to read as a HOST component, not a plugin banner: the
|
|
4008
|
+
recipe is DSH's own tool card (the console's agy-tv-card) — a hairline l1
|
|
4009
|
+
stroke, the markdown code-block fill, a 12px radius and a banner header.
|
|
4010
|
+
Nothing here is brand-themed. The only Gemini signal is one monochrome spark
|
|
4011
|
+
plus the "Gemini 译文" label; every colour is a DSH token, so light and dark
|
|
4012
|
+
come from the host theme instead of from this sheet. */
|
|
3927
4013
|
.agy-tsl-card {
|
|
3928
|
-
|
|
3929
|
-
|
|
3930
|
-
|
|
3931
|
-
|
|
3932
|
-
|
|
3933
|
-
|
|
3934
|
-
|
|
3935
|
-
box-shadow: 0 12px 30px -24px rgba(66,133,244,.9);
|
|
4014
|
+
--agy-tsl-hairline: var(--dsw-alias-border-l1, rgba(127,127,127,.2));
|
|
4015
|
+
--agy-tsl-surface: var(--dsw-alias-markdown-code-block, rgba(127,127,127,.06));
|
|
4016
|
+
--agy-tsl-banner: var(--dsw-alias-markdown-code-block-banner, rgba(127,127,127,.04));
|
|
4017
|
+
margin: 12px 0 4px 0;
|
|
4018
|
+
border: 0.5px solid var(--agy-tsl-hairline);
|
|
4019
|
+
border-radius: var(--dsw-radius-md, 12px);
|
|
4020
|
+
background: var(--agy-tsl-surface);
|
|
3936
4021
|
overflow: hidden;
|
|
3937
4022
|
}
|
|
3938
|
-
/*
|
|
3939
|
-
|
|
3940
|
-
|
|
3941
|
-
|
|
4023
|
+
/* Explicit dark-theme fallbacks: DSH already flips every token, these only keep
|
|
4024
|
+
the card legible if a token is ever renamed or missing. */
|
|
4025
|
+
body[data-ds-dark-theme] .agy-tsl-card,
|
|
4026
|
+
body.dark .agy-tsl-card,
|
|
4027
|
+
[data-theme="dark"] .agy-tsl-card {
|
|
4028
|
+
--agy-tsl-hairline: var(--dsw-alias-border-l1, rgba(255,255,255,.10));
|
|
4029
|
+
--agy-tsl-surface: var(--dsw-alias-markdown-code-block, rgba(255,255,255,.04));
|
|
4030
|
+
--agy-tsl-banner: var(--dsw-alias-markdown-code-block-banner, rgba(255,255,255,.03));
|
|
3942
4031
|
}
|
|
3943
4032
|
.agy-tsl-head {
|
|
3944
|
-
position: relative; z-index: 1;
|
|
3945
4033
|
display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4034
|
+
min-height: 32px; padding: 4px 8px 4px 12px;
|
|
4035
|
+
background: var(--agy-tsl-banner);
|
|
4036
|
+
border-bottom: 0.5px solid var(--agy-tsl-hairline);
|
|
4037
|
+
font-size: 12px; line-height: 20px;
|
|
4038
|
+
color: var(--dsw-alias-label-tertiary, #8a8f98);
|
|
4039
|
+
}
|
|
4040
|
+
.agy-tsl-badge { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
|
|
4041
|
+
/* Monochrome spark: identity by shape, accent by token — no gradient <defs>. */
|
|
4042
|
+
.agy-tsl-mark { display: block; width: 14px; height: 14px; flex: 0 0 auto; color: inherit; }
|
|
4043
|
+
.agy-tsl-badge > .agy-tsl-mark { color: var(--dsw-alias-state-business-primary, #4176e6); }
|
|
4044
|
+
.agy-tsl-label {
|
|
4045
|
+
font-size: 12px; font-weight: 500; white-space: nowrap;
|
|
4046
|
+
color: var(--dsw-alias-label-secondary, #4a4c55);
|
|
4047
|
+
}
|
|
4048
|
+
.agy-tsl-meta {
|
|
4049
|
+
flex: 1 1 auto; min-width: 0; font-size: 11.5px; font-variant-numeric: tabular-nums;
|
|
4050
|
+
color: var(--dsw-alias-label-caption, #8a8f98);
|
|
4051
|
+
overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
|
|
4052
|
+
}
|
|
4053
|
+
/* Actions wrap as ONE unit, so a narrow panel truncates the meta instead of
|
|
4054
|
+
splitting "copy" from "collapse" across two lines. */
|
|
4055
|
+
.agy-tsl-actions {
|
|
4056
|
+
display: inline-flex; align-items: center; gap: 2px;
|
|
4057
|
+
flex: 0 0 auto; margin-left: auto;
|
|
4058
|
+
}
|
|
4059
|
+
/* Flat text buttons, same treatment as the console/tool-card copy button. */
|
|
3963
4060
|
.agy-tsl-btn {
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
4061
|
+
display: inline-flex; align-items: center; gap: 4px;
|
|
4062
|
+
margin: 0; padding: 2px 6px; border: 0; border-radius: var(--dsw-radius-xs, 4px);
|
|
4063
|
+
background: transparent; color: var(--dsw-alias-label-tertiary, #8a8f98);
|
|
4064
|
+
font: inherit; font-size: 11.5px; line-height: 16px; cursor: pointer;
|
|
4065
|
+
transition: background-color .1s ease, color .1s ease;
|
|
3967
4066
|
}
|
|
3968
|
-
.agy-tsl-btn:hover {
|
|
4067
|
+
.agy-tsl-btn:hover {
|
|
4068
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.12));
|
|
4069
|
+
color: var(--dsw-alias-label-primary, #1a1c21);
|
|
4070
|
+
}
|
|
4071
|
+
.agy-tsl-btn[data-active="true"] { color: var(--dsw-alias-label-primary, #1a1c21); }
|
|
3969
4072
|
.agy-tsl-body {
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
4073
|
+
padding: 10px 14px 12px 14px;
|
|
4074
|
+
font-size: var(--dsw-font-markdown-base-font-size, 14px);
|
|
4075
|
+
line-height: var(--dsw-font-markdown-base-line-height, 24px);
|
|
4076
|
+
color: var(--dsw-alias-label-primary, #1a1c21);
|
|
4077
|
+
overflow-wrap: break-word;
|
|
3973
4078
|
}
|
|
3974
|
-
.agy-tsl-body p { margin: 0 0
|
|
4079
|
+
.agy-tsl-body p { margin: 0 0 8px 0; }
|
|
3975
4080
|
.agy-tsl-body p:last-child { margin-bottom: 0; }
|
|
3976
|
-
.agy-tsl-body ul, .agy-tsl-body ol { margin: 0 0
|
|
4081
|
+
.agy-tsl-body ul, .agy-tsl-body ol { margin: 0 0 8px 0; padding-left: 22px; }
|
|
3977
4082
|
.agy-tsl-body li { margin: 2px 0; }
|
|
3978
|
-
.agy-tsl-body h4, .agy-tsl-body h5 { margin:
|
|
3979
|
-
.agy-tsl-body code {
|
|
3980
|
-
|
|
3981
|
-
|
|
4083
|
+
.agy-tsl-body h4, .agy-tsl-body h5 { margin: 12px 0 6px 0; font-size: 14px; line-height: 22px; }
|
|
4084
|
+
.agy-tsl-body code {
|
|
4085
|
+
font-family: var(--ds-font-family-code, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace);
|
|
4086
|
+
font-size: .9em; padding: 1px 4px; border-radius: var(--dsw-radius-xs, 4px);
|
|
4087
|
+
background: var(--dsw-alias-markdown-inline-code, rgba(127,127,127,.16));
|
|
4088
|
+
}
|
|
4089
|
+
.agy-tsl-body pre {
|
|
4090
|
+
margin: 0 0 8px 0; padding: 10px 12px; overflow-x: auto;
|
|
4091
|
+
border: 0.5px solid var(--agy-tsl-hairline);
|
|
4092
|
+
border-radius: var(--dsw-radius-sm, 8px);
|
|
4093
|
+
background: var(--agy-tsl-banner);
|
|
4094
|
+
}
|
|
4095
|
+
.agy-tsl-body pre code { background: transparent; padding: 0; font-size: 12.5px; }
|
|
3982
4096
|
.agy-tsl-original {
|
|
3983
|
-
|
|
3984
|
-
|
|
3985
|
-
font-size: 12.5px;
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
.agy-tsl-foot {
|
|
3989
|
-
position: relative; z-index: 1;
|
|
3990
|
-
display: flex; align-items: center; gap: 6px;
|
|
3991
|
-
padding: 6px 12px 8px 12px; font-size: 11.5px;
|
|
3992
|
-
color: var(--dsw-alias-label-tertiary, #8a8f98);
|
|
3993
|
-
border-top: 1px solid rgba(127,127,127,.12);
|
|
4097
|
+
margin: 0; padding: 10px 14px;
|
|
4098
|
+
border-top: 0.5px dashed var(--dsw-alias-border-l2, rgba(127,127,127,.28));
|
|
4099
|
+
font-size: 12.5px; line-height: 1.6;
|
|
4100
|
+
color: var(--dsw-alias-label-secondary, #4a4c55);
|
|
4101
|
+
white-space: pre-wrap; max-height: 260px; overflow: auto;
|
|
3994
4102
|
}
|
|
3995
|
-
.agy-tsl-foot svg { width: 12px; height: 12px; }
|
|
3996
4103
|
/* Icon-only action that sits in the same strip as copy / thumbs / link, with
|
|
3997
4104
|
the same neutral tint so it reads as part of that group. */
|
|
3998
4105
|
.agy-tsl-icon {
|
|
@@ -4002,13 +4109,13 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
4002
4109
|
cursor: pointer; transition: background .15s ease, color .15s ease;
|
|
4003
4110
|
}
|
|
4004
4111
|
.agy-tsl-icon:hover:not(:disabled) {
|
|
4005
|
-
background: var(--dsw-alias-interactive-bg-hover
|
|
4006
|
-
color: var(--dsw-alias-label-primary, #
|
|
4112
|
+
background: var(--dsw-alias-interactive-bg-hover, rgba(127,127,127,.14));
|
|
4113
|
+
color: var(--dsw-alias-label-primary, #1a1c21);
|
|
4007
4114
|
}
|
|
4008
4115
|
.agy-tsl-icon:disabled { cursor: default; }
|
|
4009
4116
|
.agy-tsl-icon[data-state="working"] { color: var(--dsw-alias-state-business-primary, #2563eb); cursor: wait; }
|
|
4010
|
-
.agy-tsl-icon[data-state="done"] { color: #
|
|
4011
|
-
.agy-tsl-icon[data-state="error"] { color: #ef4444; }
|
|
4117
|
+
.agy-tsl-icon[data-state="done"] { color: var(--dsw-alias-state-success-primary, #22c55e); }
|
|
4118
|
+
.agy-tsl-icon[data-state="error"] { color: var(--dsw-alias-state-error-primary, #ef4444); }
|
|
4012
4119
|
.agy-tsl-icon svg { width: 15px; height: 15px; display: block; }
|
|
4013
4120
|
@keyframes agy-tsl-spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
|
|
4014
4121
|
/* Own tooltip: the native title bubble never showed inside the desktop shell,
|
|
@@ -4180,43 +4287,27 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
4180
4287
|
return h$1("div", null, blocks);
|
|
4181
4288
|
}
|
|
4182
4289
|
/**
|
|
4183
|
-
* The Gemini four-point spark
|
|
4184
|
-
*
|
|
4185
|
-
*
|
|
4290
|
+
* The Gemini four-point spark. Drawn monochrome (`currentColor`) on purpose:
|
|
4291
|
+
* the card belongs to DSH's design system, so the brand shows up as one tinted
|
|
4292
|
+
* glyph in the header instead of a gradient-filled widget. Without <defs> there
|
|
4293
|
+
* is no per-render gradient id either, so several cards can coexist untouched.
|
|
4186
4294
|
*/
|
|
4187
|
-
let markSeq = 0;
|
|
4188
4295
|
function geminiMark() {
|
|
4189
|
-
const id = "agy-tsl-grad-" + ++markSeq;
|
|
4190
4296
|
return h$1("svg", {
|
|
4191
4297
|
viewBox: "0 0 24 24",
|
|
4192
4298
|
className: "agy-tsl-mark",
|
|
4193
4299
|
"aria-hidden": "true",
|
|
4194
4300
|
focusable: "false"
|
|
4195
|
-
}, h$1("
|
|
4196
|
-
id,
|
|
4197
|
-
x1: "0",
|
|
4198
|
-
y1: "24",
|
|
4199
|
-
x2: "24",
|
|
4200
|
-
y2: "0",
|
|
4201
|
-
gradientUnits: "userSpaceOnUse"
|
|
4202
|
-
}, h$1("stop", {
|
|
4203
|
-
offset: "0%",
|
|
4204
|
-
"stop-color": "#4285F4"
|
|
4205
|
-
}), h$1("stop", {
|
|
4206
|
-
offset: "50%",
|
|
4207
|
-
"stop-color": "#9B72CB"
|
|
4208
|
-
}), h$1("stop", {
|
|
4209
|
-
offset: "100%",
|
|
4210
|
-
"stop-color": "#D96570"
|
|
4211
|
-
}))), h$1("path", {
|
|
4301
|
+
}, h$1("path", {
|
|
4212
4302
|
d: BRAND_PATHS.gemini,
|
|
4213
|
-
fill: "
|
|
4303
|
+
fill: "currentColor"
|
|
4214
4304
|
}));
|
|
4215
4305
|
}
|
|
4216
|
-
/**
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4306
|
+
/**
|
|
4307
|
+
* One native-looking card: banner header (spark + "Gemini 译文", model/effort as
|
|
4308
|
+
* caption meta, and the three flat actions) over DSH-markdown body text. Every
|
|
4309
|
+
* colour is a DSH token — the host theme decides light or dark.
|
|
4310
|
+
*/
|
|
4220
4311
|
const TranslationCard = (props) => {
|
|
4221
4312
|
const data = (props?.node ?? {}).data ?? {};
|
|
4222
4313
|
const t = (key, fallback) => {
|
|
@@ -4245,30 +4336,22 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
4245
4336
|
setTimeout(() => setCopied(false), 1500);
|
|
4246
4337
|
}).catch(() => void 0);
|
|
4247
4338
|
};
|
|
4339
|
+
const action = (key, label, onClick, active) => h$1("button", {
|
|
4340
|
+
key,
|
|
4341
|
+
type: "button",
|
|
4342
|
+
className: "agy-tsl-btn",
|
|
4343
|
+
...active === void 0 ? null : { "data-active": active ? "true" : "false" },
|
|
4344
|
+
onClick
|
|
4345
|
+
}, label);
|
|
4346
|
+
const badge = t("tsl.badge", "Gemini translation");
|
|
4248
4347
|
return h$1("div", {
|
|
4249
4348
|
className: "agy-tsl-card",
|
|
4250
4349
|
"data-agy-translation": "gemini",
|
|
4251
|
-
"aria-label":
|
|
4252
|
-
}, h$1("div", { className: "agy-tsl-head" }, h$1("span", { className: "agy-tsl-badge" }, geminiMark(), h$1("span", { className: "agy-tsl-
|
|
4253
|
-
|
|
4254
|
-
|
|
4255
|
-
|
|
4256
|
-
}, copied ? t("tsl.copied", "Copied") : t("tsl.copy", "Copy")), h$1("button", {
|
|
4257
|
-
type: "button",
|
|
4258
|
-
className: "agy-tsl-btn",
|
|
4259
|
-
onClick: () => setOpen(!open)
|
|
4260
|
-
}, open ? t("tsl.collapse", "收起") : t("tsl.expand", "展开"))), open ? h$1("div", { className: "agy-tsl-body" }, renderMarkdown(text)) : null, original !== "" ? h$1("div", {
|
|
4261
|
-
className: "agy-tsl-head",
|
|
4262
|
-
style: {
|
|
4263
|
-
borderBottom: "none",
|
|
4264
|
-
paddingTop: "0",
|
|
4265
|
-
paddingBottom: "6px"
|
|
4266
|
-
}
|
|
4267
|
-
}, h$1("button", {
|
|
4268
|
-
type: "button",
|
|
4269
|
-
className: "agy-tsl-btn",
|
|
4270
|
-
onClick: () => setShowOriginal(!showOriginal)
|
|
4271
|
-
}, showOriginal ? t("tsl.hideOriginal", "Hide original") : t("tsl.showOriginal", "Show original"))) : null, showOriginal && original !== "" ? h$1("pre", { className: "agy-tsl-original" }, original) : null, h$1("div", { className: "agy-tsl-foot" }, geminiMark(), h$1("span", null, t("tsl.byGemini", "Translated by Gemini"))));
|
|
4350
|
+
"aria-label": badge
|
|
4351
|
+
}, h$1("div", { className: "agy-tsl-head" }, h$1("span", { className: "agy-tsl-badge" }, geminiMark(), h$1("span", { className: "agy-tsl-label" }, badge)), meta.length === 0 ? null : h$1("span", {
|
|
4352
|
+
className: "agy-tsl-meta",
|
|
4353
|
+
title: meta.join(" · ")
|
|
4354
|
+
}, meta.join(" · ")), h$1("span", { className: "agy-tsl-actions" }, original === "" ? null : action("original", showOriginal ? t("tsl.hideOriginal", "Hide original") : t("tsl.showOriginal", "Show original"), () => setShowOriginal(!showOriginal), showOriginal), action("copy", copied ? t("tsl.copied", "Copied") : t("tsl.copy", "Copy"), copy), action("collapse", open ? t("tsl.collapse", "Collapse") : t("tsl.expand", "Expand"), () => setOpen(!open)))), open ? h$1("div", { className: "agy-tsl-body" }, renderMarkdown(text)) : null, showOriginal && original !== "" ? h$1("pre", { className: "agy-tsl-original" }, original) : null);
|
|
4272
4355
|
};
|
|
4273
4356
|
function geminiGlyph() {
|
|
4274
4357
|
return geminiMark();
|
|
@@ -4565,7 +4648,7 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
4565
4648
|
border: "none",
|
|
4566
4649
|
borderRadius: "6px",
|
|
4567
4650
|
background: "transparent",
|
|
4568
|
-
color: state === "working" ? "var(--dsw-alias-state-business-primary, #2563eb)" : state === "done" ? "#
|
|
4651
|
+
color: state === "working" ? "var(--dsw-alias-state-business-primary, #2563eb)" : state === "done" ? "var(--dsw-alias-state-success-primary, #22c55e)" : state === "error" ? "var(--dsw-alias-state-error-primary, #ef4444)" : "var(--dsw-alias-label-tertiary, #8a8f98)",
|
|
4569
4652
|
cursor: state === "working" ? "wait" : "pointer"
|
|
4570
4653
|
}
|
|
4571
4654
|
}, glyph));
|
|
@@ -5176,17 +5259,21 @@ div[data-variant="think"] [class*="thinkBody"] {
|
|
|
5176
5259
|
const renderLine = (windowName, percent, c, resetStr, rawFraction, rawReset) => {
|
|
5177
5260
|
const isShimmer = percent < 0 || isRefreshing;
|
|
5178
5261
|
const tooltipText = typeof rawFraction === "number" ? `${(rawFraction * 100).toFixed(1)}% (raw: ${rawFraction})${rawReset ? ` · reset: ${rawReset}` : ""}` : resetStr ? `↻ ${resetStr}` : void 0;
|
|
5179
|
-
return h("div", {
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5262
|
+
return h("div", {
|
|
5263
|
+
className: "agy-quota-line",
|
|
5264
|
+
style: {
|
|
5265
|
+
display: "flex",
|
|
5266
|
+
alignItems: "center",
|
|
5267
|
+
fontSize: "11.5px",
|
|
5268
|
+
margin: "4px 0"
|
|
5269
|
+
}
|
|
5270
|
+
}, h("span", { style: {
|
|
5271
|
+
width: "64px",
|
|
5186
5272
|
color: "var(--agy-text-window-label)",
|
|
5187
5273
|
fontSize: "11px",
|
|
5188
5274
|
fontWeight: 700,
|
|
5189
|
-
flexShrink: 0
|
|
5275
|
+
flexShrink: 0,
|
|
5276
|
+
whiteSpace: "nowrap"
|
|
5190
5277
|
} }, windowName), h("div", {
|
|
5191
5278
|
className: isShimmer ? "agy-shimmer-track" : "",
|
|
5192
5279
|
style: S.progressBarBg
|
|
@@ -5578,8 +5665,10 @@ body.dark,
|
|
|
5578
5665
|
position: absolute;
|
|
5579
5666
|
top: 0; left: 0; right: 0; bottom: 0;
|
|
5580
5667
|
background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.22) 50%, transparent 100%);
|
|
5581
|
-
transform: translateX(-100%)
|
|
5582
|
-
will-change: transform
|
|
5668
|
+
transform: translateX(-100%);
|
|
5669
|
+
/* No will-change: transform: it pins a compositing layer for a decorative
|
|
5670
|
+
loop even while it is idle, and inside the overlay that layer is another
|
|
5671
|
+
thing the compositor can drop mid-scroll. */
|
|
5583
5672
|
animation: agy-shimmer 1.8s infinite ease-in-out;
|
|
5584
5673
|
pointer-events: none;
|
|
5585
5674
|
}
|
|
@@ -5606,6 +5695,15 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
5606
5695
|
overflow: hidden !important;
|
|
5607
5696
|
overscroll-behavior: contain;
|
|
5608
5697
|
}
|
|
5698
|
+
/* Belt for the shell itself: if the host page (or a shell wrapper) is the thing
|
|
5699
|
+
that scrolls, locking only the conversation scroller leaves a scroller free
|
|
5700
|
+
behind the overlay. The wheel/touch blocker in the dialog is the primary fix;
|
|
5701
|
+
this makes the intent explicit for any element that follows the document. */
|
|
5702
|
+
html.agy-modal-open,
|
|
5703
|
+
html.agy-modal-open body {
|
|
5704
|
+
overflow: hidden !important;
|
|
5705
|
+
overscroll-behavior: none;
|
|
5706
|
+
}
|
|
5609
5707
|
.agy-modal-panel {
|
|
5610
5708
|
position: relative;
|
|
5611
5709
|
width: 100%;
|
|
@@ -5620,8 +5718,13 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
5620
5718
|
overflow: hidden;
|
|
5621
5719
|
color: var(--agy-text-primary);
|
|
5622
5720
|
font-family: var(--agy-font-family);
|
|
5623
|
-
|
|
5624
|
-
|
|
5721
|
+
/* NO compositing hints here (2026-11-04, "滚动还是频繁闪屏"):
|
|
5722
|
+
contain: content implies PAINT containment, and paint containment on an
|
|
5723
|
+
ancestor of a scrolling subtree is the classic Chromium flicker trap — the
|
|
5724
|
+
backing layer is dropped and rebuilt while the body scrolls, so the panel
|
|
5725
|
+
blinks over the translucent backdrop. A forced translateZ(0) layer makes
|
|
5726
|
+
it worse (big fixed layer + shadow re-composited per frame). A 640px panel
|
|
5727
|
+
needs neither hint; plain overflow: hidden already clips it. */
|
|
5625
5728
|
}
|
|
5626
5729
|
.agy-submodel-row {
|
|
5627
5730
|
display: flex;
|
|
@@ -5635,6 +5738,120 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
5635
5738
|
margin: 4px 0;
|
|
5636
5739
|
color: var(--agy-text-primary);
|
|
5637
5740
|
}
|
|
5741
|
+
|
|
5742
|
+
/* Native dropdowns: the closed control carries inline colours, but the popup
|
|
5743
|
+
list follows color-scheme, so mirror the shell theme here too. */
|
|
5744
|
+
select.agy-select { color-scheme: light; }
|
|
5745
|
+
body[data-ds-dark-theme] select.agy-select { color-scheme: dark; }
|
|
5746
|
+
|
|
5747
|
+
/* ------------------------------------------------------------------
|
|
5748
|
+
Phone web. Below 680px the console becomes a full-height sheet and
|
|
5749
|
+
every inline flex row is allowed to wrap: the layout is written with
|
|
5750
|
+
style attributes, and only an !important rule can beat those, so the
|
|
5751
|
+
overrides here are deliberately blunt.
|
|
5752
|
+
------------------------------------------------------------------ */
|
|
5753
|
+
@media (max-width: 680px) {
|
|
5754
|
+
.agy-modal-backdrop {
|
|
5755
|
+
padding: 0 !important;
|
|
5756
|
+
align-items: stretch !important;
|
|
5757
|
+
justify-content: stretch !important;
|
|
5758
|
+
}
|
|
5759
|
+
.agy-modal-panel {
|
|
5760
|
+
width: 100% !important;
|
|
5761
|
+
max-width: none !important;
|
|
5762
|
+
height: 100dvh !important;
|
|
5763
|
+
max-height: 100dvh !important;
|
|
5764
|
+
border: 0 !important;
|
|
5765
|
+
border-radius: 0 !important;
|
|
5766
|
+
}
|
|
5767
|
+
.agy-modal-head {
|
|
5768
|
+
padding: 12px 14px !important;
|
|
5769
|
+
padding-top: max(12px, env(safe-area-inset-top)) !important;
|
|
5770
|
+
}
|
|
5771
|
+
.agy-modal-body {
|
|
5772
|
+
padding: 14px 12px calc(18px + env(safe-area-inset-bottom)) !important;
|
|
5773
|
+
-webkit-overflow-scrolling: touch;
|
|
5774
|
+
}
|
|
5775
|
+
|
|
5776
|
+
/* A flex row may wrap instead of pushing the panel sideways. */
|
|
5777
|
+
.agy-console [style*="display: flex"] { flex-wrap: wrap !important; }
|
|
5778
|
+
/* Label on its own line, the control underneath it. */
|
|
5779
|
+
.agy-console [style*="justify-content: space-between"] {
|
|
5780
|
+
flex-direction: column !important;
|
|
5781
|
+
align-items: stretch !important;
|
|
5782
|
+
gap: 8px !important;
|
|
5783
|
+
}
|
|
5784
|
+
/* Segmented controls fill the row; every segment shares the width. */
|
|
5785
|
+
.agy-console [style*="agy-seg-group-border"] {
|
|
5786
|
+
display: flex !important;
|
|
5787
|
+
width: 100% !important;
|
|
5788
|
+
box-sizing: border-box !important;
|
|
5789
|
+
}
|
|
5790
|
+
.agy-console [style*="agy-seg-group-border"] > button {
|
|
5791
|
+
flex: 1 1 0 !important;
|
|
5792
|
+
min-width: 0 !important;
|
|
5793
|
+
padding-left: 6px !important;
|
|
5794
|
+
padding-right: 6px !important;
|
|
5795
|
+
}
|
|
5796
|
+
/* Inputs shrink; buttons keep a comfortable tap area. */
|
|
5797
|
+
.agy-console input { min-width: 0 !important; flex: 1 1 140px !important; }
|
|
5798
|
+
/* Settings dropdowns share their row and stretch on a phone. */
|
|
5799
|
+
.agy-console .agy-select { flex: 1 1 0 !important; min-width: 0 !important; max-width: none !important; height: 34px !important; }
|
|
5800
|
+
.agy-console .agy-btn { min-height: 34px; }
|
|
5801
|
+
/* The family label no longer reserves 140px of a 360px screen. */
|
|
5802
|
+
.agy-console [style*="min-width: 140px"] { min-width: 0 !important; }
|
|
5803
|
+
/* Per-model rows may wrap their value under the name. */
|
|
5804
|
+
.agy-console .agy-submodel-row { flex-wrap: wrap; gap: 4px 8px; }
|
|
5805
|
+
|
|
5806
|
+
/* Quota line: window name and badge share the first row, the bar takes
|
|
5807
|
+
the second one — 52px of label plus a 140px badge cluster leaves no
|
|
5808
|
+
room for a bar on a 360px screen. */
|
|
5809
|
+
.agy-quota-line {
|
|
5810
|
+
display: grid !important;
|
|
5811
|
+
grid-template-columns: minmax(0, 1fr) auto;
|
|
5812
|
+
grid-template-areas: "label cluster" "bar bar";
|
|
5813
|
+
align-items: center;
|
|
5814
|
+
gap: 5px 8px;
|
|
5815
|
+
}
|
|
5816
|
+
.agy-quota-line > span:first-child {
|
|
5817
|
+
grid-area: label;
|
|
5818
|
+
width: auto !important;
|
|
5819
|
+
white-space: nowrap;
|
|
5820
|
+
}
|
|
5821
|
+
.agy-quota-line > div:nth-child(2) { grid-area: bar; margin: 0 !important; }
|
|
5822
|
+
.agy-quota-line > div:nth-child(3) { grid-area: cluster; min-width: 0 !important; }
|
|
5823
|
+
|
|
5824
|
+
/* Header actions: the primary action keeps a full row, the two
|
|
5825
|
+
secondary ones share the next. */
|
|
5826
|
+
.agy-header-actions {
|
|
5827
|
+
display: grid !important;
|
|
5828
|
+
grid-template-columns: 1fr 1fr;
|
|
5829
|
+
gap: 6px;
|
|
5830
|
+
width: 100%;
|
|
5831
|
+
}
|
|
5832
|
+
.agy-header-actions > button:first-child { grid-column: 1 / -1; }
|
|
5833
|
+
.agy-header-actions > button { width: 100%; justify-content: center; }
|
|
5834
|
+
|
|
5835
|
+
/* Account actions: equal-width buttons instead of one ragged line. */
|
|
5836
|
+
.agy-card-actions {
|
|
5837
|
+
display: grid !important;
|
|
5838
|
+
grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
|
|
5839
|
+
gap: 6px;
|
|
5840
|
+
width: 100%;
|
|
5841
|
+
align-items: stretch;
|
|
5842
|
+
}
|
|
5843
|
+
.agy-card-actions > button { width: 100%; justify-content: center; }
|
|
5844
|
+
}
|
|
5845
|
+
|
|
5846
|
+
@media (max-width: 420px) {
|
|
5847
|
+
.agy-console { font-size: 12.5px; }
|
|
5848
|
+
.agy-modal-head {
|
|
5849
|
+
padding: 10px 12px !important;
|
|
5850
|
+
padding-top: max(10px, env(safe-area-inset-top)) !important;
|
|
5851
|
+
}
|
|
5852
|
+
.agy-modal-body { padding: 12px 10px calc(16px + env(safe-area-inset-bottom)) !important; }
|
|
5853
|
+
.agy-console [style*="justify-content: space-between"] { gap: 6px !important; }
|
|
5854
|
+
}
|
|
5638
5855
|
`;
|
|
5639
5856
|
function injectGlobalStyles() {
|
|
5640
5857
|
if (typeof document === "undefined") return;
|
|
@@ -5858,6 +6075,36 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
5858
6075
|
color: "var(--agy-text-tertiary)",
|
|
5859
6076
|
fontSize: "11.5px"
|
|
5860
6077
|
},
|
|
6078
|
+
cfgRowRight: {
|
|
6079
|
+
display: "flex",
|
|
6080
|
+
alignItems: "center",
|
|
6081
|
+
justifyContent: "flex-end",
|
|
6082
|
+
flexWrap: "wrap",
|
|
6083
|
+
gap: "6px",
|
|
6084
|
+
minWidth: 0,
|
|
6085
|
+
flex: "0 0 auto"
|
|
6086
|
+
},
|
|
6087
|
+
select: {
|
|
6088
|
+
appearance: "none",
|
|
6089
|
+
WebkitAppearance: "none",
|
|
6090
|
+
height: "28px",
|
|
6091
|
+
padding: "0 22px 0 8px",
|
|
6092
|
+
borderRadius: "6px",
|
|
6093
|
+
border: "1px solid var(--agy-border-btn)",
|
|
6094
|
+
backgroundColor: "var(--agy-bg-input)",
|
|
6095
|
+
color: "var(--agy-text-primary)",
|
|
6096
|
+
fontFamily: "inherit",
|
|
6097
|
+
fontSize: "11.5px",
|
|
6098
|
+
fontWeight: 600,
|
|
6099
|
+
cursor: "pointer",
|
|
6100
|
+
minWidth: "104px",
|
|
6101
|
+
maxWidth: "190px",
|
|
6102
|
+
textOverflow: "ellipsis",
|
|
6103
|
+
backgroundImage: "linear-gradient(45deg, transparent 50%, var(--agy-text-tertiary) 50%), linear-gradient(135deg, var(--agy-text-tertiary) 50%, transparent 50%)",
|
|
6104
|
+
backgroundPosition: "calc(100% - 13px) calc(50% + 1px), calc(100% - 9px) calc(50% + 1px)",
|
|
6105
|
+
backgroundSize: "4px 4px, 4px 4px",
|
|
6106
|
+
backgroundRepeat: "no-repeat"
|
|
6107
|
+
},
|
|
5861
6108
|
noticeBanner: {
|
|
5862
6109
|
display: "flex",
|
|
5863
6110
|
alignItems: "center",
|
|
@@ -6449,12 +6696,15 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6449
6696
|
fontWeight: 700
|
|
6450
6697
|
},
|
|
6451
6698
|
title: t("status.disabled")
|
|
6452
|
-
}, uiIcon("power", 10, "#64748b"), t("status.disabled")) : null), h("div", {
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6699
|
+
}, uiIcon("power", 10, "#64748b"), t("status.disabled")) : null), h("div", {
|
|
6700
|
+
className: "agy-card-actions",
|
|
6701
|
+
style: {
|
|
6702
|
+
display: "flex",
|
|
6703
|
+
gap: "4px",
|
|
6704
|
+
alignItems: "center",
|
|
6705
|
+
flexShrink: 0
|
|
6706
|
+
}
|
|
6707
|
+
}, h("button", {
|
|
6458
6708
|
type: "button",
|
|
6459
6709
|
className: "agy-btn",
|
|
6460
6710
|
style: acc.enabled ? {
|
|
@@ -6780,7 +7030,10 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6780
7030
|
alignItems: "center",
|
|
6781
7031
|
justifyContent: "center"
|
|
6782
7032
|
} }, h("span", { style: S.muted }, [renderSpinner(), t("status.loading")]));
|
|
6783
|
-
return h("div", {
|
|
7033
|
+
return h("div", {
|
|
7034
|
+
className: "agy-console",
|
|
7035
|
+
style: S.container
|
|
7036
|
+
}, h("div", { style: S.headerCard }, h("div", { style: {
|
|
6784
7037
|
display: "flex",
|
|
6785
7038
|
alignItems: "center",
|
|
6786
7039
|
gap: "8px"
|
|
@@ -6788,11 +7041,14 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6788
7041
|
fontWeight: 700,
|
|
6789
7042
|
fontSize: "14px",
|
|
6790
7043
|
color: "var(--agy-text-primary)"
|
|
6791
|
-
} }, "Antigravity"), h("span", { style: isAuthed ? S.badgeReady : S.badgeUnready }, isAuthed ? t("status.ready") : t("status.needsAuth"))), h("div", {
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
7044
|
+
} }, "Antigravity"), h("span", { style: isAuthed ? S.badgeReady : S.badgeUnready }, isAuthed ? t("status.ready") : t("status.needsAuth"))), h("div", {
|
|
7045
|
+
className: "agy-header-actions",
|
|
7046
|
+
style: {
|
|
7047
|
+
display: "flex",
|
|
7048
|
+
gap: "6px",
|
|
7049
|
+
alignItems: "center"
|
|
7050
|
+
}
|
|
7051
|
+
}, !addingAccount ? h("button", {
|
|
6796
7052
|
type: "button",
|
|
6797
7053
|
className: "agy-btn",
|
|
6798
7054
|
style: {
|
|
@@ -6888,15 +7144,18 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6888
7144
|
}, t("config.off")))), h("div", { style: {
|
|
6889
7145
|
display: "flex",
|
|
6890
7146
|
alignItems: "center",
|
|
6891
|
-
justifyContent: "space-between"
|
|
7147
|
+
justifyContent: "space-between",
|
|
7148
|
+
gap: "10px"
|
|
6892
7149
|
} }, h("div", { style: {
|
|
6893
7150
|
display: "flex",
|
|
6894
|
-
flexDirection: "column"
|
|
7151
|
+
flexDirection: "column",
|
|
7152
|
+
minWidth: 0,
|
|
7153
|
+
flex: "1 1 0"
|
|
6895
7154
|
} }, h("span", { style: {
|
|
6896
7155
|
color: "var(--agy-text-primary)",
|
|
6897
7156
|
fontWeight: 600,
|
|
6898
7157
|
fontSize: "12.5px"
|
|
6899
|
-
} }, t("config.autoTranslate")), h("span", { style: S.muted }, t("config.autoTranslateDesc"))), h("div", { style: S.segGroup }, h("button", {
|
|
7158
|
+
} }, t("config.autoTranslate")), h("span", { style: S.muted }, t("config.autoTranslateDesc"))), h("div", { style: S.cfgRowRight }, h("div", { style: S.segGroup }, h("button", {
|
|
6900
7159
|
type: "button",
|
|
6901
7160
|
style: status?.autoTranslate === true ? S.segBtnActive : S.segBtn,
|
|
6902
7161
|
disabled: loadingAction === "config:autoTranslate",
|
|
@@ -6906,7 +7165,38 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6906
7165
|
style: status?.autoTranslate !== true ? S.segBtnActive : S.segBtn,
|
|
6907
7166
|
disabled: loadingAction === "config:autoTranslate",
|
|
6908
7167
|
onClick: () => void setCfg("autoTranslate", false)
|
|
6909
|
-
}, t("config.off")))
|
|
7168
|
+
}, t("config.off"))), h("select", {
|
|
7169
|
+
className: "agy-select",
|
|
7170
|
+
"aria-label": t("config.translateModel"),
|
|
7171
|
+
title: t("config.translateModelDesc"),
|
|
7172
|
+
style: S.select,
|
|
7173
|
+
value: status?.translateModel ?? "",
|
|
7174
|
+
disabled: loadingAction === "config:translateModel",
|
|
7175
|
+
onChange: (e) => void setCfg("translateModel", e?.target?.value ?? "")
|
|
7176
|
+
}, translateModelOptions(status?.translateModel ?? "", geminiCatalogModels(catalogModels), t("config.translateModelAuto")).map((option) => h("option", {
|
|
7177
|
+
key: option.value,
|
|
7178
|
+
value: option.value
|
|
7179
|
+
}, option.label))), h("select", {
|
|
7180
|
+
className: "agy-select",
|
|
7181
|
+
"aria-label": t("config.translateEffort"),
|
|
7182
|
+
title: t("config.translateEffortDesc"),
|
|
7183
|
+
style: {
|
|
7184
|
+
...S.select,
|
|
7185
|
+
minWidth: "78px",
|
|
7186
|
+
maxWidth: "110px"
|
|
7187
|
+
},
|
|
7188
|
+
value: status?.translateEffort ?? "",
|
|
7189
|
+
disabled: loadingAction === "config:translateEffort",
|
|
7190
|
+
onChange: (e) => void setCfg("translateEffort", e?.target?.value ?? "")
|
|
7191
|
+
}, translateEffortOptions(status?.translateEffort ?? "", {
|
|
7192
|
+
auto: t("config.translateEffortAuto"),
|
|
7193
|
+
low: t("effort.low"),
|
|
7194
|
+
medium: t("effort.medium"),
|
|
7195
|
+
high: t("effort.high")
|
|
7196
|
+
}).map((option) => h("option", {
|
|
7197
|
+
key: option.value,
|
|
7198
|
+
value: option.value
|
|
7199
|
+
}, option.label))))), h("div", { style: {
|
|
6910
7200
|
display: "flex",
|
|
6911
7201
|
alignItems: "center",
|
|
6912
7202
|
justifyContent: "space-between"
|
|
@@ -6978,6 +7268,28 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6978
7268
|
win.addEventListener?.("keydown", onKey, true);
|
|
6979
7269
|
return () => win.removeEventListener?.("keydown", onKey, true);
|
|
6980
7270
|
}, []);
|
|
7271
|
+
useEffect(() => {
|
|
7272
|
+
if (typeof document === "undefined") return;
|
|
7273
|
+
const block = (e) => {
|
|
7274
|
+
const target = e?.target;
|
|
7275
|
+
if (typeof target?.closest !== "function") return;
|
|
7276
|
+
if (target.closest(".agy-modal-backdrop") === null) return;
|
|
7277
|
+
if (target.closest(".agy-modal-body") !== null) return;
|
|
7278
|
+
e.preventDefault?.();
|
|
7279
|
+
};
|
|
7280
|
+
document.addEventListener("wheel", block, {
|
|
7281
|
+
passive: false,
|
|
7282
|
+
capture: true
|
|
7283
|
+
});
|
|
7284
|
+
document.addEventListener("touchmove", block, {
|
|
7285
|
+
passive: false,
|
|
7286
|
+
capture: true
|
|
7287
|
+
});
|
|
7288
|
+
return () => {
|
|
7289
|
+
document.removeEventListener("wheel", block, true);
|
|
7290
|
+
document.removeEventListener("touchmove", block, true);
|
|
7291
|
+
};
|
|
7292
|
+
}, []);
|
|
6981
7293
|
return h("div", {
|
|
6982
7294
|
className: "agy-modal-backdrop",
|
|
6983
7295
|
onClick: (e) => {
|
|
@@ -6988,15 +7300,18 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
6988
7300
|
role: "dialog",
|
|
6989
7301
|
"aria-modal": true,
|
|
6990
7302
|
"aria-labelledby": "agy-console-title"
|
|
7303
|
+
}, h("div", {
|
|
7304
|
+
className: "agy-modal-head",
|
|
7305
|
+
style: {
|
|
7306
|
+
display: "flex",
|
|
7307
|
+
alignItems: "center",
|
|
7308
|
+
justifyContent: "space-between",
|
|
7309
|
+
padding: "14px 18px",
|
|
7310
|
+
borderBottom: "1px solid var(--agy-border-card)",
|
|
7311
|
+
background: "var(--agy-bg-header)",
|
|
7312
|
+
color: "var(--agy-text-primary)"
|
|
7313
|
+
}
|
|
6991
7314
|
}, h("div", { style: {
|
|
6992
|
-
display: "flex",
|
|
6993
|
-
alignItems: "center",
|
|
6994
|
-
justifyContent: "space-between",
|
|
6995
|
-
padding: "14px 18px",
|
|
6996
|
-
borderBottom: "1px solid var(--agy-border-card)",
|
|
6997
|
-
background: "var(--agy-bg-header)",
|
|
6998
|
-
color: "var(--agy-text-primary)"
|
|
6999
|
-
} }, h("div", { style: {
|
|
7000
7315
|
display: "flex",
|
|
7001
7316
|
alignItems: "center",
|
|
7002
7317
|
gap: "8px"
|
|
@@ -7022,13 +7337,17 @@ html.agy-modal-open [data-conversation-scroll] {
|
|
|
7022
7337
|
alignItems: "center"
|
|
7023
7338
|
},
|
|
7024
7339
|
onClick: () => agyModalStore.setOpen(false)
|
|
7025
|
-
}, uiIcon("x", 14, "var(--agy-text-btn)"))), h("div", {
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7340
|
+
}, uiIcon("x", 14, "var(--agy-text-btn)"))), h("div", {
|
|
7341
|
+
className: "agy-modal-body",
|
|
7342
|
+
style: {
|
|
7343
|
+
overflowY: "auto",
|
|
7344
|
+
overscrollBehavior: "contain",
|
|
7345
|
+
padding: "18px",
|
|
7346
|
+
flex: "1",
|
|
7347
|
+
minHeight: 0,
|
|
7348
|
+
background: "var(--agy-bg-panel)"
|
|
7349
|
+
}
|
|
7350
|
+
}, h(AgySettingsSection, {
|
|
7032
7351
|
isModal: true,
|
|
7033
7352
|
onClose: () => agyModalStore.setOpen(false)
|
|
7034
7353
|
}))));
|