dsh-codex-model-effort-ui 1.1.6 → 1.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +38 -9
- package/client.effort.js +16 -96
- package/client.js +126 -911
- package/client.styles.js +918 -272
- package/package.json +1 -1
package/client.styles.js
CHANGED
|
@@ -1,298 +1,944 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex 模型 + 推理强度选择器 —— 样式表分块。
|
|
3
|
-
*
|
|
4
|
-
* 大段 CSS 从 client.js 移出,放进独立的分块文件,使目录保持整洁,
|
|
5
|
-
* 样式也能单独编辑。类名前缀仍然参数化(P,当前为 'cmes');
|
|
6
|
-
* client.js 通过 `require.async('./client.styles.js')` 加载本分块。
|
|
7
|
-
*
|
|
8
|
-
* 布局度量集中在 METRICS 并随本分块导出:CSS 里能直接共用的数值用模板
|
|
9
|
-
* 插值,client.js 的高度计算则直接读同一份 METRICS,不再各自维护一份。
|
|
10
|
-
*/
|
|
11
1
|
window.__ModuleLoader__.load({
|
|
12
2
|
id: 'dsh-codex-model-effort-ui',
|
|
13
3
|
chunk: 'client.styles.js',
|
|
14
4
|
factory(require) {
|
|
15
5
|
var module = { exports: {} };
|
|
16
|
-
var exports = module.exports;
|
|
17
6
|
|
|
18
|
-
/* 布局度量:JS 的高度计算与下面的 CSS 共用这一份数字,改动只需改这里。
|
|
19
|
-
* 行高等并非在 CSS 里直接写死,而是由 padding/line-height 推导出来,
|
|
20
|
-
* JS 端的对应值(rowH/modelH…)必须与这些推导结果一致;能直接共用的
|
|
21
|
-
* 数值(列表上限、面板高度、Teams 行高)则在模板里插值,避免双份。 */
|
|
22
7
|
const METRICS = {
|
|
23
8
|
rowH: 41, modelH: 39, listMaxH: 252, headH: 36, searchH: 40,
|
|
24
9
|
emptyH: 48, secH: 30, padH: 20, listPadB: 4,
|
|
25
10
|
teamRowH: 34, effortPaneH: 104, teamPaneH: 138
|
|
26
11
|
};
|
|
27
12
|
|
|
28
|
-
/*
|
|
29
|
-
function
|
|
13
|
+
/* ---------- 根元素与基础重置 ---------- */
|
|
14
|
+
function cssRoot(P, metrics) {
|
|
30
15
|
return `
|
|
31
|
-
.${P}-root{
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
16
|
+
.${P}-root{
|
|
17
|
+
position:relative;
|
|
18
|
+
display:inline-flex;
|
|
19
|
+
min-width:0;
|
|
20
|
+
font-family:var(--dsw-font-family);
|
|
21
|
+
font-size:14px;
|
|
22
|
+
letter-spacing:0;
|
|
23
|
+
}
|
|
24
|
+
/* 浮层(弹层 + tooltip)已 portal 到 document.body,脱离 .cmes-root,因此 */
|
|
25
|
+
.${P}-popover,.${P}-popover *,.${P}-tip,.${P}-tip *{
|
|
26
|
+
box-sizing:border-box;
|
|
27
|
+
corner-shape:round;
|
|
28
|
+
font-family:var(--dsw-font-family);
|
|
29
|
+
}
|
|
30
|
+
.${P}-popover button{
|
|
31
|
+
font:inherit;
|
|
32
|
+
cursor:pointer;
|
|
33
|
+
border:0;
|
|
34
|
+
color:inherit;
|
|
35
|
+
}
|
|
36
|
+
.${P}-root *{
|
|
37
|
+
box-sizing:border-box;
|
|
38
|
+
corner-shape:round;
|
|
39
|
+
}
|
|
40
|
+
.${P}-root button{
|
|
41
|
+
font:inherit;
|
|
42
|
+
cursor:pointer;
|
|
43
|
+
border:0;
|
|
44
|
+
background:transparent;
|
|
45
|
+
color:inherit;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/* ---------- 触发按钮(收起态座位) ---------- */
|
|
52
|
+
function cssTrigger(P, metrics) {
|
|
53
|
+
return `
|
|
54
|
+
/* ---------- 触发按钮(收起态座位) ---------- */
|
|
55
|
+
.${P}-trigger{
|
|
56
|
+
display:inline-flex;
|
|
57
|
+
align-items:center;
|
|
58
|
+
gap:5px;
|
|
59
|
+
max-width:250px;
|
|
60
|
+
height:28px;
|
|
61
|
+
padding:0 7px;
|
|
62
|
+
border-radius:8px;
|
|
63
|
+
color:var(--dsw-alias-label-caption);
|
|
64
|
+
font-size:13px!important;
|
|
65
|
+
}
|
|
66
|
+
.${P}-trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}
|
|
67
|
+
.${P}-trigger:disabled{
|
|
68
|
+
cursor:default;
|
|
69
|
+
opacity:.55;
|
|
70
|
+
}
|
|
71
|
+
.${P}-trigger:focus-visible{
|
|
72
|
+
outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));
|
|
73
|
+
outline-offset:2px;
|
|
74
|
+
}
|
|
75
|
+
/* ⚡ 图标常驻占位(client.js 里不再条件挂载):Fast 关闭时透明但仍占 14px 槽位,
|
|
76
|
+
开启时填充显色。胶囊宽度因此恒定,开关 Fast 不再让面板横移。 */
|
|
77
|
+
.${P}-bolt{
|
|
78
|
+
width:14px;
|
|
79
|
+
height:16px;
|
|
80
|
+
flex:none;
|
|
81
|
+
color:var(--dsw-alias-label-primary);
|
|
82
|
+
fill:none;
|
|
83
|
+
stroke:transparent;
|
|
84
|
+
stroke-width:1.5;
|
|
85
|
+
stroke-linejoin:round;
|
|
86
|
+
}
|
|
87
|
+
.${P}-trigger.fast .${P}-bolt{
|
|
88
|
+
fill:currentColor;
|
|
89
|
+
stroke:currentColor;
|
|
90
|
+
stroke-width:.7;
|
|
91
|
+
}
|
|
92
|
+
.${P}-iconSmall{
|
|
93
|
+
width:14px;
|
|
94
|
+
height:14px;
|
|
95
|
+
flex:none;
|
|
96
|
+
}
|
|
97
|
+
/* 标题是唯一允许收缩的部分:模型名以省略号截断,而强度等级保留其 */
|
|
98
|
+
.${P}-caption{
|
|
99
|
+
flex:0 1 auto;
|
|
100
|
+
display:var(--dsh-composer-model-text-display,inline);
|
|
101
|
+
overflow:hidden;
|
|
102
|
+
text-overflow:ellipsis;
|
|
103
|
+
white-space:nowrap;
|
|
104
|
+
min-width:0;
|
|
105
|
+
}
|
|
106
|
+
.${P}-triggerEffort{
|
|
107
|
+
flex:none;
|
|
108
|
+
min-width:34px;
|
|
109
|
+
text-align:center;
|
|
110
|
+
display:var(--dsh-composer-model-text-display,inline);
|
|
111
|
+
white-space:nowrap;
|
|
112
|
+
color:var(--${P}-ink,var(--dsw-alias-label-caption));
|
|
113
|
+
transition:color .2s ease;
|
|
114
|
+
}
|
|
115
|
+
.${P}-compact{display:var(--dsh-composer-model-icon-display,none)}
|
|
116
|
+
.${P}-chev{
|
|
117
|
+
width:12px;
|
|
118
|
+
height:12px;
|
|
119
|
+
flex:none;
|
|
120
|
+
color:var(--dsw-alias-label-caption);
|
|
121
|
+
transition:transform .12s ease;
|
|
122
|
+
}
|
|
123
|
+
.${P}-trigger[aria-expanded=true] .${P}-chev{transform:rotate(180deg)}
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/* ---------- Fast 提示框 ---------- */
|
|
128
|
+
function cssTip(P, metrics) {
|
|
129
|
+
return `
|
|
130
|
+
/* Fast 提示框 */
|
|
131
|
+
.${P}-tip{
|
|
132
|
+
position:fixed;
|
|
133
|
+
z-index:1400;
|
|
134
|
+
padding:7px 12px;
|
|
135
|
+
white-space:nowrap;
|
|
136
|
+
font-family:var(--dsw-font-family);
|
|
137
|
+
background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2));
|
|
138
|
+
background:color-mix(in srgb,var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2)) 72%,transparent);
|
|
139
|
+
backdrop-filter:blur(20px) saturate(180%);
|
|
140
|
+
-webkit-backdrop-filter:blur(20px) saturate(180%);
|
|
141
|
+
box-shadow:var(--dsw-elevation-panel);
|
|
142
|
+
border-radius:10px;
|
|
143
|
+
font-size:12px;
|
|
144
|
+
line-height:17px;
|
|
145
|
+
text-align:center;
|
|
146
|
+
color:var(--dsw-alias-label-primary);
|
|
147
|
+
opacity:0;
|
|
148
|
+
visibility:hidden;
|
|
149
|
+
pointer-events:none;
|
|
150
|
+
transform:translateY(2px);
|
|
151
|
+
transition:opacity .12s ease,transform .12s ease,visibility 0s .12s;
|
|
152
|
+
}
|
|
153
|
+
.${P}-tip.show{
|
|
154
|
+
opacity:1;
|
|
155
|
+
visibility:visible;
|
|
156
|
+
transform:translateY(0);
|
|
157
|
+
transition:opacity .12s ease,transform .12s ease,visibility 0s;
|
|
158
|
+
}
|
|
159
|
+
/* 参考实现中的 tooltip 是两行卡片:较重的标题压在柔和副标题上。
|
|
160
|
+
“仅视觉效果”的披露只留给辅助技术,因此卡片保持参考实现的两行形态。 */
|
|
161
|
+
.${P}-tip span{
|
|
162
|
+
display:block;
|
|
163
|
+
color:var(--dsw-alias-label-secondary);
|
|
164
|
+
}
|
|
165
|
+
.${P}-tip .${P}-tipTitle{
|
|
166
|
+
color:var(--dsw-alias-label-primary);
|
|
167
|
+
font-size:13px;
|
|
168
|
+
font-weight:600;
|
|
169
|
+
line-height:18px;
|
|
170
|
+
}
|
|
171
|
+
/* Agent Teams 描述是更长、会换行的卡片:外观与 Fast 提示相同,
|
|
172
|
+
但可跨两行并左对齐以提升可读性。 */
|
|
173
|
+
.${P}-teamTip{
|
|
174
|
+
max-width:min(260px,calc(100vw - 32px));
|
|
175
|
+
white-space:normal;
|
|
176
|
+
text-align:left;
|
|
177
|
+
}
|
|
178
|
+
/* 重置提示卡:与 Fast 提示共用同一套玻璃外观(标题 + 说明两行),但说明句
|
|
179
|
+
更长,允许换行并左对齐,避免被 nowrap 撑出卡片。 */
|
|
180
|
+
.${P}-resetTip{
|
|
181
|
+
max-width:min(240px,calc(100vw - 32px));
|
|
182
|
+
white-space:normal;
|
|
183
|
+
text-align:left;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
`;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/* ---------- 弹出面板 ---------- */
|
|
190
|
+
function cssPopover(P, metrics) {
|
|
191
|
+
return `
|
|
192
|
+
/* ---------- 弹出面板 ---------- */
|
|
193
|
+
/* 弹出面板 portal 到 body,position:fixed 恒相对视口;定位由 align() 写入的 */
|
|
194
|
+
.${P}-popover{
|
|
195
|
+
position:fixed;
|
|
196
|
+
top:var(--${P}-top,auto);
|
|
197
|
+
left:var(--${P}-left,12px);
|
|
198
|
+
width:272px;
|
|
199
|
+
max-width:calc(100vw - 24px);
|
|
200
|
+
height:var(--${P}-height,${metrics.effortPaneH}px);
|
|
201
|
+
max-height:var(--${P}-room,calc(100vh - 52px));
|
|
202
|
+
padding:0;
|
|
203
|
+
font-family:var(--dsw-font-family);
|
|
204
|
+
font-size:14px;
|
|
205
|
+
letter-spacing:0;
|
|
206
|
+
background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2));
|
|
207
|
+
border-radius:14px;
|
|
208
|
+
box-shadow:var(--dsw-elevation-panel);
|
|
209
|
+
backdrop-filter:var(--dsw-menu-backdrop-filter);
|
|
210
|
+
z-index:1100;
|
|
211
|
+
overflow:hidden;
|
|
212
|
+
transform-origin:top left;
|
|
213
|
+
transition:opacity .18s ease,transform .18s ease,height .2s cubic-bezier(.2,.8,.2,1),visibility 0s;
|
|
214
|
+
}
|
|
215
|
+
.${P}-popover.closed{
|
|
216
|
+
opacity:0;
|
|
217
|
+
pointer-events:none;
|
|
218
|
+
visibility:hidden;
|
|
219
|
+
transform:translateY(-5px) scale(.98);
|
|
220
|
+
transition-delay:0s,0s,0s,.18s;
|
|
221
|
+
}
|
|
222
|
+
.${P}-popover.peak{--dsw-elevation-stroke-color:rgba(145,78,246,.28)}
|
|
223
|
+
|
|
224
|
+
`;
|
|
225
|
+
}
|
|
37
226
|
|
|
38
|
-
/* ----------
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
.${P}-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.${P}-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
overflow:hidden 把这一层裁掉。悬停确实把 opacity 翻到 1、visibility 翻到
|
|
62
|
-
visible——但什么都没画出来,这正是「悬停无法显示」症状。
|
|
63
|
-
修复:把 tooltip 渲染为 .cmes-root 下弹出面板的兄弟节点。那个盒子没有
|
|
64
|
-
transform / filter / backdrop-filter,因此 position:fixed 重新相对视口解析
|
|
65
|
-
(探针验证:弹出面板内的固定盒子报告弹出面板原点,根节点内的报告 0,0)。
|
|
66
|
-
tooltip 因此不再是按钮的后代,旧的 .cmes-fast:hover [role=tooltip] 规则也就
|
|
67
|
-
永远不会触发;可见性改由 pointer enter/leave + focus/blur 驱动的 .show 类控制。 */
|
|
68
|
-
.${P}-tip{position:fixed;z-index:1400;padding:7px 12px;white-space:nowrap;background:var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2));background:color-mix(in srgb,var(--dsw-specific-menu,var(--dsw-alias-bg-layer-2)) 72%,transparent);backdrop-filter:blur(20px) saturate(180%);-webkit-backdrop-filter:blur(20px) saturate(180%);box-shadow:var(--dsw-elevation-panel);border-radius:10px;font-size:12px;line-height:17px;text-align:center;color:var(--dsw-alias-label-primary);opacity:0;visibility:hidden;pointer-events:none;transform:translateY(2px);transition:opacity .12s ease,transform .12s ease,visibility 0s .12s}
|
|
69
|
-
.${P}-tip.show{opacity:1;visibility:visible;transform:translateY(0);transition:opacity .12s ease,transform .12s ease,visibility 0s}
|
|
70
|
-
/* 参考实现中的 tooltip 是两行卡片:较重的标题压在柔和副标题上。
|
|
71
|
-
“仅视觉效果”的披露只留给辅助技术,因此卡片保持参考实现的两行形态。 */
|
|
72
|
-
.${P}-tip span{display:block;color:var(--dsw-alias-label-secondary)}
|
|
73
|
-
.${P}-tip .${P}-tipTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600;line-height:18px}
|
|
74
|
-
/* Agent Teams 描述是更长、会换行的卡片:外观与 Fast 提示相同,
|
|
75
|
-
但可跨两行并左对齐以提升可读性。 */
|
|
76
|
-
.${P}-teamTip{max-width:min(260px,calc(100vw - 32px));white-space:normal;text-align:left}
|
|
77
|
-
/* 重置提示卡:与 Fast 提示共用同一套玻璃外观(标题 + 说明两行),但说明句
|
|
78
|
-
更长,允许换行并左对齐,避免被 nowrap 撑出卡片。 */
|
|
79
|
-
.${P}-resetTip{max-width:min(240px,calc(100vw - 32px));white-space:normal;text-align:left}
|
|
227
|
+
/* ---------- 面板分层 ---------- */
|
|
228
|
+
function cssPane(P, metrics) {
|
|
229
|
+
return `
|
|
230
|
+
/* ---------- 面板分层 ---------- */
|
|
231
|
+
.${P}-pane{
|
|
232
|
+
position:absolute;
|
|
233
|
+
left:0;
|
|
234
|
+
right:0;
|
|
235
|
+
bottom:0;
|
|
236
|
+
opacity:1;
|
|
237
|
+
transform:translateY(0);
|
|
238
|
+
transition:opacity .14s ease,transform .2s ease,visibility 0s;
|
|
239
|
+
}
|
|
240
|
+
.${P}-pane.hidden{
|
|
241
|
+
opacity:0;
|
|
242
|
+
pointer-events:none;
|
|
243
|
+
visibility:hidden;
|
|
244
|
+
transform:translateY(5px);
|
|
245
|
+
transition-delay:0s,0s,.14s;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
`;
|
|
249
|
+
}
|
|
80
250
|
|
|
81
|
-
/* ----------
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
251
|
+
/* ---------- 强度面板 ---------- */
|
|
252
|
+
function cssEffort(P, metrics) {
|
|
253
|
+
return `
|
|
254
|
+
/* ---------- 强度面板 ---------- */
|
|
255
|
+
.${P}-main{height:var(--${P}-main-h,${metrics.effortPaneH}px)}
|
|
256
|
+
.${P}-tool{
|
|
257
|
+
position:absolute;
|
|
258
|
+
top:7px;
|
|
259
|
+
width:28px;
|
|
260
|
+
height:28px;
|
|
261
|
+
display:flex;
|
|
262
|
+
align-items:center;
|
|
263
|
+
justify-content:center;
|
|
264
|
+
padding:0;
|
|
265
|
+
border:0;
|
|
266
|
+
border-radius:8px;
|
|
267
|
+
background:transparent;
|
|
268
|
+
color:var(--dsw-alias-label-caption);
|
|
269
|
+
}
|
|
270
|
+
.${P}-tool:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
271
|
+
.${P}-fast{left:7px}
|
|
272
|
+
.${P}-reset{right:7px}
|
|
273
|
+
.${P}-tool svg{
|
|
274
|
+
width:16px;
|
|
275
|
+
height:16px;
|
|
276
|
+
}
|
|
277
|
+
.${P}-fast.active{color:var(--${P}-accent,#3988f6)}
|
|
278
|
+
.${P}-popover.peak .${P}-fast.active{color:var(--${P}-accentPeak,#9b48eb)}
|
|
279
|
+
.${P}-modelLink{
|
|
280
|
+
position:absolute;
|
|
281
|
+
left:43px;
|
|
282
|
+
right:43px;
|
|
283
|
+
top:8px;
|
|
284
|
+
height:42px;
|
|
285
|
+
display:flex;
|
|
286
|
+
flex-direction:column;
|
|
287
|
+
align-items:center;
|
|
288
|
+
justify-content:center;
|
|
289
|
+
padding:2px 4px;
|
|
290
|
+
border:0;
|
|
291
|
+
border-radius:5px;
|
|
292
|
+
background:transparent;
|
|
293
|
+
transition:opacity .2s ease;
|
|
294
|
+
}
|
|
295
|
+
.${P}-modelLink:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
296
|
+
.${P}-heading{
|
|
297
|
+
display:flex;
|
|
298
|
+
gap:3px;
|
|
299
|
+
justify-content:center;
|
|
300
|
+
align-items:center;
|
|
301
|
+
max-width:100%;
|
|
302
|
+
height:20px;
|
|
303
|
+
color:var(--${P}-ink,#3989e9);
|
|
304
|
+
font-size:14px;
|
|
305
|
+
line-height:20px;
|
|
306
|
+
white-space:nowrap;
|
|
307
|
+
transition:color .2s ease;
|
|
308
|
+
}
|
|
309
|
+
.${P}-heading svg{
|
|
310
|
+
width:10px;
|
|
311
|
+
height:10px;
|
|
312
|
+
color:var(--dsw-alias-label-caption);
|
|
313
|
+
}
|
|
314
|
+
/* 强度面板中间那行的模型名:独立类名,避免与下方模型列表行的 */
|
|
315
|
+
.${P}-modelLinkName{
|
|
316
|
+
display:block;
|
|
317
|
+
max-width:100%;
|
|
318
|
+
height:18px;
|
|
319
|
+
color:var(--dsw-alias-label-secondary);
|
|
320
|
+
font-size:12px;
|
|
321
|
+
line-height:18px;
|
|
322
|
+
white-space:nowrap;
|
|
323
|
+
overflow:hidden;
|
|
324
|
+
text-overflow:ellipsis;
|
|
325
|
+
}
|
|
326
|
+
.${P}-warning{
|
|
327
|
+
position:absolute;
|
|
328
|
+
left:29px;
|
|
329
|
+
right:29px;
|
|
330
|
+
top:20px;
|
|
331
|
+
text-align:center;
|
|
332
|
+
line-height:18px;
|
|
333
|
+
font-size:13px;
|
|
334
|
+
opacity:0;
|
|
335
|
+
pointer-events:none;
|
|
336
|
+
transition:opacity .2s ease;
|
|
337
|
+
}
|
|
338
|
+
.${P}-warning span{
|
|
339
|
+
display:inline-block;
|
|
340
|
+
background:linear-gradient(90deg,var(--${P}-warnHi,#a965dd) 0%,var(--${P}-warnHi,#a965dd) 42%,var(--${P}-warnLo,#653780) 50%,var(--${P}-warnHi,#a965dd) 58%,var(--${P}-warnHi,#a965dd) 100%);
|
|
341
|
+
background-size:300% 100%;
|
|
342
|
+
background-position:0 0;
|
|
343
|
+
background-clip:text;
|
|
344
|
+
-webkit-background-clip:text;
|
|
345
|
+
color:transparent;
|
|
346
|
+
-webkit-text-fill-color:transparent;
|
|
347
|
+
}
|
|
348
|
+
.${P}-popover.message .${P}-modelLink,.${P}-popover.message .${P}-tool{
|
|
349
|
+
opacity:0;
|
|
350
|
+
pointer-events:none;
|
|
351
|
+
}
|
|
352
|
+
.${P}-popover.message .${P}-warning{opacity:1}
|
|
353
|
+
.${P}-popover.message .${P}-warning span{animation:${P}-sweep 1.1s linear .2s 1 both}
|
|
354
|
+
@keyframes ${P}-sweep{from{background-position:100% 0}to{background-position:0 0}}
|
|
355
|
+
|
|
356
|
+
`;
|
|
357
|
+
}
|
|
85
358
|
|
|
86
|
-
/* ----------
|
|
87
|
-
|
|
88
|
-
|
|
359
|
+
/* ---------- 滑轨(可测量的滑杆) ---------- */
|
|
360
|
+
function cssRail(P, metrics) {
|
|
361
|
+
return `
|
|
362
|
+
/* 滑轨(可测量的滑杆) */
|
|
363
|
+
.${P}-rail{
|
|
364
|
+
position:absolute;
|
|
365
|
+
left:12px;
|
|
366
|
+
right:12px;
|
|
367
|
+
top:65px;
|
|
368
|
+
height:26px;
|
|
369
|
+
border-radius:16px;
|
|
370
|
+
background:var(--${P}-track,#e8e7e8);
|
|
371
|
+
touch-action:none;
|
|
372
|
+
cursor:pointer;
|
|
373
|
+
transition:background .25s ease;
|
|
374
|
+
}
|
|
375
|
+
/* 抓取区域 —— 可见圆钮高 30px 而轨道只有 26px,因此圆钮 2px 的外伸部分 */
|
|
376
|
+
.${P}-rail::before{
|
|
377
|
+
content:"";
|
|
378
|
+
position:absolute;
|
|
379
|
+
inset:-6px -3px;
|
|
380
|
+
border-radius:20px;
|
|
381
|
+
}
|
|
382
|
+
.${P}-rail:focus-visible{
|
|
383
|
+
outline:2px solid var(--dsw-focus-ring-color,#3989e9);
|
|
384
|
+
outline-offset:2px;
|
|
385
|
+
}
|
|
386
|
+
.${P}-fill,.${P}-sparks{
|
|
387
|
+
position:absolute;
|
|
388
|
+
inset:0 auto 0 0;
|
|
389
|
+
width:calc((100% - 30px)*var(--${P}-pos,0) + 15px);
|
|
390
|
+
border-radius:13px 0 0 13px;
|
|
391
|
+
overflow:hidden;
|
|
392
|
+
pointer-events:none;
|
|
393
|
+
transition:width .18s cubic-bezier(.2,.8,.2,1);
|
|
394
|
+
}
|
|
395
|
+
.${P}-fill{
|
|
396
|
+
background:var(--${P}-fill,#3a83f7);
|
|
397
|
+
transition:width .18s cubic-bezier(.2,.8,.2,1),background .25s ease;
|
|
398
|
+
}
|
|
399
|
+
.${P}-popover.peak .${P}-fill{
|
|
400
|
+
background:var(--${P}-peakGradient,linear-gradient(90deg,#3b83f6 0%,#3b82f6 10%,#3d7bf3 20%,#4c75f4 30%,#6473fa 40%,#8d80fc 50%,#9375fd 55%,#9d78fd 60%,#a779fe 65%,#a476fe 70%,#9e73fe 75%,#9166fe 80%,#845af9 85%,#7d55f6 93%,#7448ee 100%));
|
|
401
|
+
background-size:155% 100%;
|
|
402
|
+
animation:${P}-colorflow 3.8s ease-in-out infinite alternate;
|
|
403
|
+
}
|
|
404
|
+
.${P}-popover.peak .${P}-fill::before{
|
|
405
|
+
content:"";
|
|
406
|
+
position:absolute;
|
|
407
|
+
inset:-10px -40px;
|
|
408
|
+
background:linear-gradient(100deg,transparent 18%,#ffffff08 35%,#ffffff30 48%,#ffffff06 66%,transparent 84%);
|
|
409
|
+
animation:${P}-shimmer 4.5s ease-in-out infinite alternate;
|
|
410
|
+
}
|
|
411
|
+
@keyframes ${P}-colorflow{from{background-position:0 0}to{background-position:100% 0}}
|
|
412
|
+
@keyframes ${P}-shimmer{from{transform:translateX(-45%)}to{transform:translateX(45%)}}
|
|
413
|
+
.${P}-dot{
|
|
414
|
+
position:absolute;
|
|
415
|
+
top:11px;
|
|
416
|
+
left:calc((100% - 30px)*var(--${P}-tick,0) + 15px);
|
|
417
|
+
width:4px;
|
|
418
|
+
height:4px;
|
|
419
|
+
margin-left:-2px;
|
|
420
|
+
border-radius:50%;
|
|
421
|
+
background:var(--${P}-dot,#b6b6b8);
|
|
422
|
+
pointer-events:none;
|
|
423
|
+
transition:background .18s ease,opacity .18s ease,transform .14s ease;
|
|
424
|
+
}
|
|
425
|
+
/* 已通过的刻度落在填充色上,因此取圆钮自身的颜色:这是唯一能保证在两个
|
|
426
|
+
主题下、每个档位的填充色上都可读的表面(浅色圆钮为白,深色圆钮为 #f9fafb)。 */
|
|
427
|
+
.${P}-dot.passed{background:var(--${P}-dotPassed,rgba(255,255,255,.55))}
|
|
428
|
+
.${P}-dot.hovered{transform:scale(1.75)}
|
|
429
|
+
.${P}-popover.peak .${P}-dot{opacity:0}
|
|
430
|
+
.${P}-sparks{
|
|
431
|
+
opacity:0;
|
|
432
|
+
transition:width .18s cubic-bezier(.2,.8,.2,1),opacity .25s ease;
|
|
433
|
+
}
|
|
434
|
+
.${P}-popover.peak .${P}-sparks,.${P}-popover.fast-mode .${P}-sparks{opacity:1}
|
|
435
|
+
.${P}-sp{
|
|
436
|
+
position:absolute;
|
|
437
|
+
width:3px;
|
|
438
|
+
height:3px;
|
|
439
|
+
border-radius:50%;
|
|
440
|
+
background:#fff;
|
|
441
|
+
opacity:var(--b,1);
|
|
442
|
+
transform:scale(var(--b,1));
|
|
443
|
+
animation:${P}-drift var(--dur,3s) linear infinite;
|
|
444
|
+
animation-delay:var(--delay,0s);
|
|
445
|
+
}
|
|
446
|
+
@keyframes ${P}-drift{0%{left:-4%;opacity:0}6%{opacity:var(--b,1)}94%{opacity:var(--b,1)}100%{left:104%;opacity:0}}
|
|
447
|
+
|
|
448
|
+
`;
|
|
449
|
+
}
|
|
89
450
|
|
|
90
|
-
/* ----------
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.${P}-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
451
|
+
/* ---------- 到达绽放 ---------- */
|
|
452
|
+
function cssBloom(P, metrics) {
|
|
453
|
+
return `
|
|
454
|
+
/* 到达绽放 */
|
|
455
|
+
.${P}-bloom{
|
|
456
|
+
position:absolute;
|
|
457
|
+
left:calc(100% - 15px);
|
|
458
|
+
top:13px;
|
|
459
|
+
width:0;
|
|
460
|
+
height:0;
|
|
461
|
+
pointer-events:none;
|
|
462
|
+
z-index:3;
|
|
463
|
+
}
|
|
464
|
+
.${P}-bp{
|
|
465
|
+
position:absolute;
|
|
466
|
+
left:0;
|
|
467
|
+
top:0;
|
|
468
|
+
width:var(--sz,4px);
|
|
469
|
+
height:var(--sz,4px);
|
|
470
|
+
margin-top:calc(var(--sz,4px) * -0.5);
|
|
471
|
+
margin-left:calc(var(--sz,4px) * -0.5);
|
|
472
|
+
border-radius:50%;
|
|
473
|
+
background:var(--${P}-mote,#c9a9fb);
|
|
474
|
+
box-shadow:0 0 6px var(--${P}-mote,#c9a9fb);
|
|
475
|
+
opacity:0;
|
|
476
|
+
animation:${P}-burst var(--bd,.62s) cubic-bezier(.15,.72,.25,1) var(--bdel,0s) 1 both;
|
|
477
|
+
}
|
|
478
|
+
@keyframes ${P}-burst{
|
|
479
|
+
0%{
|
|
480
|
+
opacity:0;
|
|
481
|
+
transform:translate(var(--x0,0px),var(--y0,0px)) scale(.4);
|
|
482
|
+
}
|
|
483
|
+
18%{opacity:var(--bmax,.95)}
|
|
484
|
+
100%{
|
|
485
|
+
opacity:0;
|
|
486
|
+
transform:translate(var(--x1,0px),var(--y1,0px)) scale(.5);
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
/* 一个柔和的圆环随粒子一起扩散:它让爆发读作“绽放”,而不是散落的点 */
|
|
490
|
+
.${P}-halo{
|
|
491
|
+
position:absolute;
|
|
492
|
+
left:0;
|
|
493
|
+
top:0;
|
|
494
|
+
width:52px;
|
|
495
|
+
height:52px;
|
|
496
|
+
margin:-26px 0 0 -26px;
|
|
497
|
+
border-radius:50%;
|
|
498
|
+
background:radial-gradient(circle,var(--${P}-mote,#c9a9fb) 0%,transparent 66%);
|
|
499
|
+
opacity:0;
|
|
500
|
+
animation:${P}-haloRing .5s ease-out 1 both;
|
|
501
|
+
}
|
|
502
|
+
@keyframes ${P}-haloRing{0%{opacity:.55;transform:scale(.24)}100%{opacity:0;transform:scale(1.55)}}
|
|
503
|
+
.${P}-knob{
|
|
504
|
+
position:absolute;
|
|
505
|
+
left:calc((100% - 30px)*var(--${P}-pos,0));
|
|
506
|
+
top:-2px;
|
|
507
|
+
width:30px;
|
|
508
|
+
height:30px;
|
|
509
|
+
border-radius:50%;
|
|
510
|
+
background:var(--${P}-knob,var(--dsw-alias-bg-layer-2,#f8f8f8));
|
|
511
|
+
box-shadow:var(--dsw-elevation-panel),0 1px 3px var(--${P}-knobShadow,rgba(0,0,0,.10));
|
|
512
|
+
border:.5px solid var(--dsw-alias-border-l1,rgba(0,0,0,.07));
|
|
513
|
+
pointer-events:none;
|
|
514
|
+
z-index:2;
|
|
515
|
+
transform:scale(1);
|
|
516
|
+
transform-origin:50% 50%;
|
|
517
|
+
transition:left .18s cubic-bezier(.2,.8,.2,1),transform .34s cubic-bezier(.34,1.56,.64,1);
|
|
518
|
+
}
|
|
519
|
+
/* 按压 / 释放形变。 */
|
|
520
|
+
.${P}-rail.dragging .${P}-knob{transform:scale(1.16)}
|
|
521
|
+
/* 拖拽期间圆钮必须以无 left 过渡、无吸附的方式跟随指针——吸附发生在释放时。
|
|
522
|
+
transform 过渡保留,因此按压本身的形变仍然平滑。 */
|
|
523
|
+
.${P}-rail.dragging .${P}-knob{transition:transform .14s cubic-bezier(.2,.9,.3,1.2)}
|
|
524
|
+
.${P}-rail.dragging .${P}-fill{transition:none}
|
|
525
|
+
.${P}-rail.dragging{cursor:grabbing}
|
|
526
|
+
.${P}-noeffort{
|
|
527
|
+
position:absolute;
|
|
528
|
+
top:65px;
|
|
529
|
+
left:12px;
|
|
530
|
+
right:12px;
|
|
531
|
+
text-align:center;
|
|
532
|
+
font-size:12px;
|
|
533
|
+
line-height:26px;
|
|
534
|
+
color:var(--dsw-alias-label-secondary);
|
|
535
|
+
}
|
|
536
|
+
`;
|
|
537
|
+
}
|
|
113
538
|
|
|
114
|
-
/* ----------
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
.${P}-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.${P}-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
539
|
+
/* ---------- Agent Teams 行(DSH >= 0.2.2) ---------- */
|
|
540
|
+
function cssTeam(P, metrics) {
|
|
541
|
+
return `
|
|
542
|
+
/* Agent Teams 行(DSH >= 0.2.2) */
|
|
543
|
+
.${P}-team{
|
|
544
|
+
position:absolute;
|
|
545
|
+
left:8px;
|
|
546
|
+
right:8px;
|
|
547
|
+
top:96px;
|
|
548
|
+
display:flex;
|
|
549
|
+
align-items:center;
|
|
550
|
+
justify-content:space-between;
|
|
551
|
+
gap:16px;
|
|
552
|
+
min-height:${metrics.teamRowH}px;
|
|
553
|
+
padding:0 8px;
|
|
554
|
+
border-radius:var(--dsw-radius-md);
|
|
555
|
+
color:var(--dsw-alias-label-primary);
|
|
556
|
+
font-size:13px;
|
|
557
|
+
line-height:20px;
|
|
558
|
+
}
|
|
559
|
+
.${P}-teamLabel{
|
|
560
|
+
display:inline-flex;
|
|
561
|
+
align-items:center;
|
|
562
|
+
gap:4px;
|
|
563
|
+
min-width:0;
|
|
564
|
+
}
|
|
565
|
+
.${P}-teamInfo{
|
|
566
|
+
display:inline-flex;
|
|
567
|
+
align-items:center;
|
|
568
|
+
justify-content:center;
|
|
569
|
+
width:20px;
|
|
570
|
+
height:20px;
|
|
571
|
+
flex:none;
|
|
572
|
+
padding:0;
|
|
573
|
+
border:0;
|
|
574
|
+
border-radius:0;
|
|
575
|
+
background:transparent;
|
|
576
|
+
color:var(--dsw-alias-label-caption);
|
|
577
|
+
cursor:help;
|
|
578
|
+
}
|
|
579
|
+
.${P}-teamInfo svg{
|
|
580
|
+
width:11px;
|
|
581
|
+
height:11px;
|
|
582
|
+
}
|
|
583
|
+
/* 开关随弹出面板 portal 到 body,不再位于 .cmes-root 之内,因此规则不能用 */
|
|
584
|
+
.${P}-teamSwitch{
|
|
585
|
+
position:relative;
|
|
586
|
+
flex:none;
|
|
587
|
+
width:32px;
|
|
588
|
+
height:18px;
|
|
589
|
+
padding:0;
|
|
590
|
+
border:0;
|
|
591
|
+
border-radius:999px;
|
|
592
|
+
background:var(--dsw-alias-interactive-bg-hover-solid,#cfd1d6);
|
|
593
|
+
color:inherit;
|
|
594
|
+
font:inherit;
|
|
595
|
+
cursor:pointer;
|
|
596
|
+
box-sizing:border-box;
|
|
597
|
+
transition:background .16s ease;
|
|
598
|
+
}
|
|
599
|
+
.${P}-teamSwitch[aria-checked=true]{background:var(--dsw-alias-state-business-primary,#4d6bfe)}
|
|
600
|
+
.${P}-teamSwitch:disabled{
|
|
601
|
+
opacity:.45;
|
|
602
|
+
cursor:default;
|
|
603
|
+
}
|
|
604
|
+
.${P}-teamSwitch:focus-visible{
|
|
605
|
+
outline:2px solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));
|
|
606
|
+
outline-offset:2px;
|
|
607
|
+
}
|
|
608
|
+
.${P}-teamSwitch::after{
|
|
609
|
+
content:"";
|
|
610
|
+
position:absolute;
|
|
611
|
+
top:2px;
|
|
612
|
+
left:2px;
|
|
613
|
+
width:14px;
|
|
614
|
+
height:14px;
|
|
615
|
+
border-radius:50%;
|
|
616
|
+
background:#fff;
|
|
617
|
+
box-shadow:0 1px 2px rgba(0,0,0,.22);
|
|
618
|
+
transition:transform .16s ease;
|
|
619
|
+
}
|
|
620
|
+
.${P}-teamSwitch[aria-checked=true]::after{transform:translateX(14px)}
|
|
621
|
+
@media (hover:hover){.${P}-team:hover{background:var(--dsw-alias-interactive-bg-hover)}}
|
|
622
|
+
@media (prefers-reduced-motion:reduce){
|
|
623
|
+
.${P}-sp{animation-duration:calc(var(--dur,3s) * 2.6)}
|
|
624
|
+
/* 到达爆发纯属装饰;直接让它坍缩而不是放慢,
|
|
625
|
+
因为缓慢的径向爆发会读作渲染故障 */
|
|
626
|
+
.${P}-bp{
|
|
627
|
+
animation-duration:.01s;
|
|
628
|
+
animation-delay:0s;
|
|
629
|
+
}
|
|
630
|
+
.${P}-halo{animation-duration:.01s}
|
|
631
|
+
/* 按压保留较小、无过渡的隆起:有动作而无位移 */
|
|
632
|
+
.${P}-rail.dragging .${P}-knob{
|
|
633
|
+
transform:scale(1.06);
|
|
634
|
+
transition:none;
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
`;
|
|
639
|
+
}
|
|
146
640
|
|
|
147
|
-
/* ----------
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
.${P}-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
.${P}-
|
|
180
|
-
.${P}-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
.${P}-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
641
|
+
/* ---------- 模型页:两级下钻 ---------- */
|
|
642
|
+
function cssModelPage(P, metrics) {
|
|
643
|
+
return `
|
|
644
|
+
/* 模型页:两级下钻 */
|
|
645
|
+
/* 问题 2 修复:面板以 bottom:0 锚定但没有 top,因此高度由内容决定。这使 */
|
|
646
|
+
.${P}-models{
|
|
647
|
+
top:0;
|
|
648
|
+
height:100%;
|
|
649
|
+
padding:10px;
|
|
650
|
+
overflow:hidden;
|
|
651
|
+
display:flex;
|
|
652
|
+
flex-direction:column;
|
|
653
|
+
}
|
|
654
|
+
.${P}-viewport{
|
|
655
|
+
position:relative;
|
|
656
|
+
overflow:hidden;
|
|
657
|
+
transition:height .3s cubic-bezier(.32,.72,.28,1);
|
|
658
|
+
flex:1 1 auto;
|
|
659
|
+
min-height:0;
|
|
660
|
+
}
|
|
661
|
+
/* 每页都是满高 flex 列,使其内部列表可以滚动。 */
|
|
662
|
+
.${P}-page{
|
|
663
|
+
position:absolute;
|
|
664
|
+
top:0;
|
|
665
|
+
left:0;
|
|
666
|
+
width:100%;
|
|
667
|
+
height:100%;
|
|
668
|
+
display:flex;
|
|
669
|
+
flex-direction:column;
|
|
670
|
+
overflow:hidden;
|
|
671
|
+
transition:transform .3s cubic-bezier(.32,.72,.28,1);
|
|
672
|
+
}
|
|
673
|
+
.${P}-page.slot1{transform:translateX(0)}
|
|
674
|
+
.${P}-page.slot2{transform:translateX(100%)}
|
|
675
|
+
.${P}-viewport.view2 .${P}-page.slot1{transform:translateX(-100%)}
|
|
676
|
+
.${P}-viewport.view2 .${P}-page.slot2{transform:translateX(0)}
|
|
677
|
+
.${P}-sec{
|
|
678
|
+
flex:none;
|
|
679
|
+
font-size:12px;
|
|
680
|
+
line-height:1.5;
|
|
681
|
+
color:var(--dsw-alias-label-tertiary,#9aa0ab);
|
|
682
|
+
padding:4px 8px 8px;
|
|
683
|
+
}
|
|
684
|
+
/* 第 1 页的提供方列表需要自己的滚动容器:参考实现领教过,被裁掉的提供方行
|
|
685
|
+
不可达,因为第 1 页没有滚动容器。 */
|
|
686
|
+
.${P}-rows{
|
|
687
|
+
flex:1 1 auto;
|
|
688
|
+
min-height:0;
|
|
689
|
+
overflow-y:auto;
|
|
690
|
+
overscroll-behavior:contain;
|
|
691
|
+
padding:0 2px 4px;
|
|
692
|
+
}
|
|
693
|
+
.${P}-row{
|
|
694
|
+
width:100%;
|
|
695
|
+
display:flex;
|
|
696
|
+
align-items:center;
|
|
697
|
+
justify-content:space-between;
|
|
698
|
+
gap:8px;
|
|
699
|
+
background:transparent;
|
|
700
|
+
border:0;
|
|
701
|
+
color:var(--dsw-alias-label-primary);
|
|
702
|
+
font:inherit;
|
|
703
|
+
font-size:14px;
|
|
704
|
+
line-height:1.5;
|
|
705
|
+
padding:10px;
|
|
706
|
+
border-radius:10px;
|
|
707
|
+
cursor:pointer;
|
|
708
|
+
text-align:left;
|
|
709
|
+
user-select:none;
|
|
710
|
+
}
|
|
711
|
+
.${P}-row:hover,.${P}-row:focus-visible{
|
|
712
|
+
background:var(--dsw-alias-interactive-bg-hover);
|
|
713
|
+
outline:none;
|
|
714
|
+
}
|
|
715
|
+
/* 问题 1:一个小蓝点标记拥有当前模型的提供方,因此无需逐个打开提供方就能
|
|
716
|
+
看到活动分组。它是第二个元素(名称之后),因此位于行的右端。 */
|
|
717
|
+
.${P}-rowDot{
|
|
718
|
+
flex:none;
|
|
719
|
+
width:6px;
|
|
720
|
+
height:6px;
|
|
721
|
+
border-radius:50%;
|
|
722
|
+
background:var(--${P}-accent,#3a83f7);
|
|
723
|
+
box-shadow:0 0 0 3px var(--${P}-accentHalo,rgba(58,131,247,.16));
|
|
724
|
+
}
|
|
725
|
+
/* 提供方行是名称 + 圆点 + 箭头:名称吸收空闲空间,把圆点和箭头推到右边缘 */
|
|
726
|
+
.${P}-rowName{
|
|
727
|
+
flex:1 1 auto;
|
|
728
|
+
min-width:0;
|
|
729
|
+
overflow:hidden;
|
|
730
|
+
text-overflow:ellipsis;
|
|
731
|
+
white-space:nowrap;
|
|
732
|
+
}
|
|
733
|
+
.${P}-rowChev{
|
|
734
|
+
width:11px;
|
|
735
|
+
height:11px;
|
|
736
|
+
flex:none;
|
|
737
|
+
color:var(--dsw-alias-label-tertiary,#9aa0ab);
|
|
738
|
+
}
|
|
739
|
+
.${P}-head{
|
|
740
|
+
flex:none;
|
|
741
|
+
display:flex;
|
|
742
|
+
align-items:center;
|
|
743
|
+
gap:6px;
|
|
744
|
+
padding:2px 4px 8px;
|
|
745
|
+
}
|
|
746
|
+
.${P}-back{
|
|
747
|
+
width:26px;
|
|
748
|
+
height:26px;
|
|
749
|
+
flex:none;
|
|
750
|
+
display:grid;
|
|
751
|
+
place-items:center;
|
|
752
|
+
background:transparent;
|
|
753
|
+
border:0;
|
|
754
|
+
border-radius:8px;
|
|
755
|
+
color:var(--dsw-alias-label-tertiary,#9aa0ab);
|
|
756
|
+
cursor:pointer;
|
|
757
|
+
}
|
|
758
|
+
.${P}-back:hover{
|
|
759
|
+
background:var(--dsw-alias-interactive-bg-hover);
|
|
760
|
+
color:var(--dsw-alias-label-primary);
|
|
761
|
+
}
|
|
762
|
+
.${P}-back svg{
|
|
763
|
+
width:12px;
|
|
764
|
+
height:12px;
|
|
765
|
+
}
|
|
766
|
+
.${P}-title{
|
|
767
|
+
font-size:14px;
|
|
768
|
+
font-weight:600;
|
|
769
|
+
overflow:hidden;
|
|
770
|
+
text-overflow:ellipsis;
|
|
771
|
+
white-space:nowrap;
|
|
772
|
+
}
|
|
773
|
+
.${P}-search{
|
|
774
|
+
flex:none;
|
|
775
|
+
display:flex;
|
|
776
|
+
align-items:center;
|
|
777
|
+
gap:8px;
|
|
778
|
+
margin:0 4px 6px;
|
|
779
|
+
padding:7px 10px;
|
|
780
|
+
background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-interactive-bg-hover));
|
|
781
|
+
border-radius:10px;
|
|
782
|
+
}
|
|
783
|
+
.${P}-search svg{
|
|
784
|
+
width:13px;
|
|
785
|
+
height:13px;
|
|
786
|
+
flex:none;
|
|
787
|
+
color:var(--dsw-alias-label-caption,#7c8290);
|
|
788
|
+
}
|
|
789
|
+
.${P}-search input{
|
|
790
|
+
flex:1 1 auto;
|
|
791
|
+
min-width:0;
|
|
792
|
+
background:transparent;
|
|
793
|
+
border:0;
|
|
794
|
+
outline:0;
|
|
795
|
+
color:var(--dsw-alias-label-primary);
|
|
796
|
+
font:inherit;
|
|
797
|
+
font-size:13px;
|
|
798
|
+
}
|
|
799
|
+
.${P}-list{
|
|
800
|
+
flex:1 1 auto;
|
|
801
|
+
min-height:0;
|
|
802
|
+
overflow-y:auto;
|
|
803
|
+
max-height:${metrics.listMaxH}px;
|
|
804
|
+
overscroll-behavior:contain;
|
|
805
|
+
padding:0 2px 4px;
|
|
806
|
+
}
|
|
807
|
+
.${P}-model{
|
|
808
|
+
width:100%;
|
|
809
|
+
display:flex;
|
|
810
|
+
align-items:center;
|
|
811
|
+
justify-content:space-between;
|
|
812
|
+
gap:8px;
|
|
813
|
+
background:transparent;
|
|
814
|
+
border:0;
|
|
815
|
+
color:var(--dsw-alias-label-primary);
|
|
816
|
+
font:inherit;
|
|
817
|
+
font-size:14px;
|
|
818
|
+
line-height:1.5;
|
|
819
|
+
padding:9px 10px;
|
|
820
|
+
border-radius:9px;
|
|
821
|
+
cursor:pointer;
|
|
822
|
+
text-align:left;
|
|
823
|
+
user-select:none;
|
|
824
|
+
}
|
|
825
|
+
.${P}-model:hover,.${P}-model:focus-visible{
|
|
826
|
+
background:var(--dsw-alias-interactive-bg-hover);
|
|
827
|
+
outline:none;
|
|
828
|
+
}
|
|
829
|
+
/* 键盘高亮:方向键在列表里移动时没有 :hover,必须由 .hovered 类给出与
|
|
830
|
+
悬停一致的底色,否则用户看不到当前高亮的是哪一行(Enter 却会选中它)。 */
|
|
831
|
+
.${P}-model.hovered{background:var(--dsw-alias-interactive-bg-hover)}
|
|
832
|
+
.${P}-modelName{
|
|
833
|
+
display:flex;
|
|
834
|
+
align-items:center;
|
|
835
|
+
gap:6px;
|
|
836
|
+
min-width:0;
|
|
837
|
+
}
|
|
838
|
+
.${P}-modelName>span:first-child{
|
|
839
|
+
overflow:hidden;
|
|
840
|
+
text-overflow:ellipsis;
|
|
841
|
+
white-space:nowrap;
|
|
842
|
+
}
|
|
843
|
+
.${P}-model.na .${P}-modelName>span:first-child{color:var(--dsw-alias-label-tertiary,#9aa0ab)}
|
|
844
|
+
.${P}-cnt{
|
|
845
|
+
flex:none;
|
|
846
|
+
font-size:10.5px;
|
|
847
|
+
color:var(--dsw-alias-label-caption,#7c8290);
|
|
848
|
+
background:var(--dsw-alias-interactive-bg-hover);
|
|
849
|
+
border-radius:6px;
|
|
850
|
+
padding:1px 6px;
|
|
851
|
+
}
|
|
852
|
+
.${P}-model.na .${P}-cnt{color:var(--dsw-alias-state-warn-label,#6b5b4a)}
|
|
853
|
+
.${P}-ck{
|
|
854
|
+
width:15px;
|
|
855
|
+
height:15px;
|
|
856
|
+
flex:none;
|
|
857
|
+
color:var(--dsw-alias-label-primary);
|
|
858
|
+
opacity:0;
|
|
859
|
+
}
|
|
860
|
+
.${P}-model.sel .${P}-ck{opacity:1}
|
|
861
|
+
.${P}-empty{
|
|
862
|
+
color:var(--dsw-alias-label-tertiary,#9aa0ab);
|
|
863
|
+
font-size:13px;
|
|
864
|
+
padding:14px 10px;
|
|
865
|
+
text-align:center;
|
|
866
|
+
}
|
|
867
|
+
.${P}-failure{
|
|
868
|
+
border-radius:8px;
|
|
869
|
+
background:var(--dsw-alias-interactive-bg-hover-danger,rgba(229,72,77,.12));
|
|
870
|
+
color:var(--dsw-alias-state-error-primary,#e5484d);
|
|
871
|
+
font-size:12px;
|
|
872
|
+
line-height:1.6;
|
|
873
|
+
padding:4px 8px;
|
|
874
|
+
margin:0 2px 3px;
|
|
875
|
+
word-break:break-word;
|
|
876
|
+
}
|
|
877
|
+
/* 错误提示行只做展示:它覆盖在 modelLink(强度面板)/ 返回+搜索(模型页) */
|
|
878
|
+
.${P}-status{
|
|
879
|
+
position:absolute;
|
|
880
|
+
pointer-events:none;
|
|
881
|
+
}
|
|
882
|
+
.${P}-sr{
|
|
883
|
+
position:absolute;
|
|
884
|
+
width:1px;
|
|
885
|
+
height:1px;
|
|
886
|
+
padding:0;
|
|
887
|
+
overflow:hidden;
|
|
888
|
+
clip-path:inset(50%);
|
|
889
|
+
white-space:nowrap;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
`;
|
|
893
|
+
}
|
|
205
894
|
|
|
206
|
-
/* ----------
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
/*
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
/*
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
.${P}-rowDot{flex:none;width:6px;height:6px;border-radius:50%;background:var(--${P}-accent,#3a83f7);box-shadow:0 0 0 3px var(--${P}-accentHalo,rgba(58,131,247,.16))}
|
|
234
|
-
/* 提供方行是名称 + 圆点 + 箭头:名称吸收空闲空间,把圆点和箭头推到右边缘。 */
|
|
235
|
-
.${P}-rowName{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
236
|
-
.${P}-rowChev{width:11px;height:11px;flex:none;color:var(--dsw-alias-label-tertiary,#9aa0ab)}
|
|
237
|
-
.${P}-head{flex:none;display:flex;align-items:center;gap:6px;padding:2px 4px 8px}
|
|
238
|
-
.${P}-back{width:26px;height:26px;flex:none;display:grid;place-items:center;background:transparent;border:0;border-radius:8px;color:var(--dsw-alias-label-tertiary,#9aa0ab);cursor:pointer}
|
|
239
|
-
.${P}-back:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}
|
|
240
|
-
.${P}-back svg{width:12px;height:12px}
|
|
241
|
-
.${P}-title{font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
242
|
-
.${P}-search{flex:none;display:flex;align-items:center;gap:8px;margin:0 4px 6px;padding:7px 10px;background:var(--dsw-alias-bg-layer-3,var(--dsw-alias-interactive-bg-hover));border-radius:10px}
|
|
243
|
-
.${P}-search svg{width:13px;height:13px;flex:none;color:var(--dsw-alias-label-caption,#7c8290)}
|
|
244
|
-
.${P}-search input{flex:1 1 auto;min-width:0;background:transparent;border:0;outline:0;color:var(--dsw-alias-label-primary);font:inherit;font-size:13px}
|
|
245
|
-
.${P}-list{flex:1 1 auto;min-height:0;overflow-y:auto;max-height:${M.listMaxH}px;overscroll-behavior:contain;padding:0 2px 4px}
|
|
246
|
-
.${P}-model{width:100%;display:flex;align-items:center;justify-content:space-between;gap:8px;background:transparent;border:0;color:var(--dsw-alias-label-primary);font:inherit;font-size:14px;line-height:1.5;padding:9px 10px;border-radius:9px;cursor:pointer;text-align:left;user-select:none}
|
|
247
|
-
.${P}-model:hover,.${P}-model:focus-visible{background:var(--dsw-alias-interactive-bg-hover);outline:none}
|
|
248
|
-
/* 键盘高亮:方向键在列表里移动时没有 :hover,必须由 .hovered 类给出与
|
|
249
|
-
悬停一致的底色,否则用户看不到当前高亮的是哪一行(Enter 却会选中它)。 */
|
|
250
|
-
.${P}-model.hovered{background:var(--dsw-alias-interactive-bg-hover)}
|
|
251
|
-
.${P}-modelName{display:flex;align-items:center;gap:6px;min-width:0}
|
|
252
|
-
.${P}-modelName>span:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
253
|
-
.${P}-model.na .${P}-modelName>span:first-child{color:var(--dsw-alias-label-tertiary,#9aa0ab)}
|
|
254
|
-
.${P}-cnt{flex:none;font-size:10.5px;color:var(--dsw-alias-label-caption,#7c8290);background:var(--dsw-alias-interactive-bg-hover);border-radius:6px;padding:1px 6px}
|
|
255
|
-
.${P}-model.na .${P}-cnt{color:var(--dsw-alias-state-warn-label,#6b5b4a)}
|
|
256
|
-
.${P}-ck{width:15px;height:15px;flex:none;color:var(--dsw-alias-label-primary);opacity:0}
|
|
257
|
-
.${P}-model.sel .${P}-ck{opacity:1}
|
|
258
|
-
.${P}-empty{color:var(--dsw-alias-label-tertiary,#9aa0ab);font-size:13px;padding:14px 10px;text-align:center}
|
|
259
|
-
.${P}-failure{border-radius:8px;background:var(--dsw-alias-interactive-bg-hover-danger,rgba(229,72,77,.12));color:var(--dsw-alias-state-error-primary,#e5484d);font-size:12px;line-height:1.6;padding:4px 8px;margin:0 2px 3px;word-break:break-word}
|
|
260
|
-
/* 错误提示行只做展示:它覆盖在 modelLink(强度面板)/ 返回+搜索(模型页)
|
|
261
|
-
* 之上,若不关掉命中测试,会在出错时吞掉这些控件的点击。 */
|
|
262
|
-
.${P}-status{position:absolute;pointer-events:none}
|
|
263
|
-
.${P}-sr{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
|
|
895
|
+
/* ---------- 深色主题 ---------- */
|
|
896
|
+
function cssDark(P, metrics) {
|
|
897
|
+
return `
|
|
898
|
+
/* 深色主题 */
|
|
899
|
+
body[data-ds-dark-theme] .${P}-root{
|
|
900
|
+
/* 圆钮变成亮色圆片:它在深色下继承的 token(#2c2c2e)与 #232324 轨道
|
|
901
|
+
几乎相同,会消失 */
|
|
902
|
+
--${P}-knob:#f9fafb;
|
|
903
|
+
--${P}-knobShadow:rgba(0,0,0,.45);
|
|
904
|
+
/* 已通过的刻度与圆钮同色,因此在每种深色填充上都可读 */
|
|
905
|
+
--${P}-dotPassed:#f9fafb;
|
|
906
|
+
/* 强调色提升为出厂深色 business/peak 色相 */
|
|
907
|
+
--${P}-accent:#7aaaff;
|
|
908
|
+
--${P}-accentPeak:#c39bff;
|
|
909
|
+
--${P}-accentHalo:rgba(122,170,255,.20);
|
|
910
|
+
/* 配额闪光在深色卡片上扫过一道亮带:浅色主题的暗带会低于卡片对比度
|
|
911
|
+
而消失 */
|
|
912
|
+
--${P}-warnHi:#c39bff;
|
|
913
|
+
--${P}-warnLo:#f3e6ff;
|
|
914
|
+
/* Ultra 渐变保留其色相弧线,但每个色标都能与轨道区分 */
|
|
915
|
+
--${P}-peakGradient:linear-gradient(90deg,#3e89ff 0%,#438bff 10%,#518dff 20%,#668bff 30%,#7c8aff 40%,#9386ff 50%,#a084ff 55%,#a785ff 60%,#b085ff 65%,#b087ff 70%,#af8bff 75%,#ae8fff 80%,#ae91ff 85%,#af95ff 93%,#b296fe 100%);
|
|
916
|
+
/* Ultra 的浮起描边在深色对比下可读 */
|
|
917
|
+
--dsw-elevation-stroke-color:rgba(176,133,255,.45);
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
`;
|
|
921
|
+
}
|
|
264
922
|
|
|
265
|
-
/*
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
--${P}-accentPeak:#c39bff;
|
|
281
|
-
--${P}-accentHalo:rgba(122,170,255,.20);
|
|
282
|
-
/* 配额闪光在深色卡片上扫过一道亮带:浅色主题的暗带会低于卡片对比度
|
|
283
|
-
而消失 */
|
|
284
|
-
--${P}-warnHi:#c39bff;
|
|
285
|
-
--${P}-warnLo:#f3e6ff;
|
|
286
|
-
/* Ultra 渐变保留其色相弧线,但每个色标都能与轨道区分 */
|
|
287
|
-
--${P}-peakGradient:linear-gradient(90deg,#3e89ff 0%,#438bff 10%,#518dff 20%,#668bff 30%,#7c8aff 40%,#9386ff 50%,#a084ff 55%,#a785ff 60%,#b085ff 65%,#b087ff 70%,#af8bff 75%,#ae8fff 80%,#ae91ff 85%,#af95ff 93%,#b296fe 100%);
|
|
288
|
-
/* Ultra 的浮起描边在深色对比下可读 */
|
|
289
|
-
--dsw-elevation-stroke-color:rgba(176,133,255,.45);
|
|
290
|
-
}
|
|
291
|
-
`;
|
|
923
|
+
/* 聚合所有 section 函数,返回完整样式表 */
|
|
924
|
+
function css(P, metrics = METRICS) {
|
|
925
|
+
return [
|
|
926
|
+
cssRoot(P, metrics),
|
|
927
|
+
cssTrigger(P, metrics),
|
|
928
|
+
cssTip(P, metrics),
|
|
929
|
+
cssPopover(P, metrics),
|
|
930
|
+
cssPane(P, metrics),
|
|
931
|
+
cssEffort(P, metrics),
|
|
932
|
+
cssRail(P, metrics),
|
|
933
|
+
cssBloom(P, metrics),
|
|
934
|
+
cssTeam(P, metrics),
|
|
935
|
+
cssModelPage(P, metrics),
|
|
936
|
+
cssDark(P, metrics),
|
|
937
|
+
].join(String.fromCharCode(10));
|
|
292
938
|
}
|
|
293
939
|
|
|
294
|
-
exports.METRICS = METRICS;
|
|
295
|
-
exports.css = css;
|
|
940
|
+
module.exports.METRICS = METRICS;
|
|
941
|
+
module.exports.css = css;
|
|
296
942
|
return module.exports;
|
|
297
943
|
}
|
|
298
944
|
});
|