@michengai/dsh-codex-ui 2.0.13 → 2.0.16
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 +18 -0
- package/CHANGELOG.zh-CN.md +18 -0
- package/README.md +2 -1
- package/README.zh-CN.md +2 -1
- package/lib/client.js +703 -348
- package/lib/composer-plugin.d.mts +18 -4
- package/lib/composer-plugin.mjs +19 -8
- package/lib/session-title-plugin.mjs +10 -0
- package/package.json +31 -29
package/lib/client.js
CHANGED
|
@@ -50,22 +50,55 @@ window.__ModuleLoader__.load({
|
|
|
50
50
|
//#endregion
|
|
51
51
|
//#region src/client/host-icons.ts
|
|
52
52
|
/**
|
|
53
|
-
*
|
|
54
|
-
* 必须动态读取,不能写成静态属性访问,否则旧宿主一加载客户端就会拿到 undefined。
|
|
53
|
+
* 宿主通用矢量安全兜底图标(坚决禁止在模块顶层抛出硬异常导致整个客户端猝死)
|
|
55
54
|
*/
|
|
56
|
-
function
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
function createFallbackIcon(pathData) {
|
|
56
|
+
return function FallbackIcon(props) {
|
|
57
|
+
return react.default.createElement("svg", {
|
|
58
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
59
|
+
width: props.size ?? 16,
|
|
60
|
+
height: props.size ?? 16,
|
|
61
|
+
viewBox: "0 0 16 16",
|
|
62
|
+
fill: "none",
|
|
63
|
+
stroke: "currentColor",
|
|
64
|
+
strokeWidth: 1.5,
|
|
65
|
+
strokeLinecap: "round",
|
|
66
|
+
strokeLinejoin: "round",
|
|
67
|
+
className: props.className
|
|
68
|
+
}, react.default.createElement("path", { d: pathData }));
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const FALLBACK_CHECK = createFallbackIcon("M3 8.5l3.5 3.5 6.5-7");
|
|
72
|
+
const FALLBACK_DOWNLOAD = createFallbackIcon("M8 2v9m0 0l-3-3m3 3l3-3M3 13h10");
|
|
73
|
+
const FALLBACK_LIST_PEN = createFallbackIcon("M3 4h10M3 8h6M3 12h4m6-3l2 2-5 5H9v-2l5-5z");
|
|
74
|
+
const FALLBACK_LOADING = createFallbackIcon("M8 2a6 6 0 1 0 6 6");
|
|
75
|
+
const FALLBACK_REFRESH = createFallbackIcon("M2.5 8a5.5 5.5 0 1 0 1.2-3.4M2.5 3v3h3");
|
|
76
|
+
/**
|
|
77
|
+
* 跨宿主版本图标安全解析器:按候选名依次匹配(新版 → 老版 → Medium/Regular 变体),
|
|
78
|
+
* 全部缺失时才回退到给到的 fallback;没有 fallback 就抛错(由单测保护)。
|
|
79
|
+
* 生产路径的 `hostIcon` 也走这里 —— 只有一套候选顺序,避免「测试改的是导出函数、线上走的是另一套」。
|
|
80
|
+
*/
|
|
81
|
+
function resolveHostIcon(icons, candidates, fallback) {
|
|
82
|
+
for (const name of candidates) {
|
|
83
|
+
const icon = icons[name];
|
|
84
|
+
if (icon !== void 0) return icon;
|
|
85
|
+
}
|
|
86
|
+
if (fallback !== void 0) return fallback;
|
|
87
|
+
throw new Error(`宿主缺少图标 ${candidates[0] ?? "(空候选)"}`);
|
|
88
|
+
}
|
|
89
|
+
function hostIcon(modern, legacy, fallback) {
|
|
90
|
+
return resolveHostIcon(_deepseek_ai_dsh_client_ui_primitives, [
|
|
91
|
+
modern,
|
|
92
|
+
legacy,
|
|
93
|
+
modern.replace("Medium", "Regular"),
|
|
94
|
+
modern.replace("OutlineMedium", "OutlineRegular")
|
|
95
|
+
], fallback);
|
|
96
|
+
}
|
|
97
|
+
const IconCheckOutlineMedium = hostIcon("IconCheckOutlineMedium", "IconCheckOutline16", FALLBACK_CHECK);
|
|
98
|
+
const IconDownloadOutlineMedium = hostIcon("IconDownloadOutlineMedium", "IconDownloadOutline16", FALLBACK_DOWNLOAD);
|
|
99
|
+
const IconListPenOutlineMedium = hostIcon("IconListPenOutlineMedium", "IconListPenOutline16", FALLBACK_LIST_PEN);
|
|
100
|
+
const IconLoadingOutlineMedium = hostIcon("IconLoadingOutlineMedium", "IconLoadingOutline16", FALLBACK_LOADING);
|
|
101
|
+
const IconRefreshOutlineMedium = hostIcon("IconRefreshOutlineMedium", "IconRefreshOutline16", FALLBACK_REFRESH);
|
|
69
102
|
//#endregion
|
|
70
103
|
//#region src/business-api.ts
|
|
71
104
|
const CODEX_UI_API_BASE = "/api/michengai/dsh-codex-ui";
|
|
@@ -155,6 +188,99 @@ window.__ModuleLoader__.load({
|
|
|
155
188
|
const message = error instanceof Error ? error.message : String(error);
|
|
156
189
|
return t(INSTALL_ERROR_KEYS.find(([pattern]) => pattern.test(message))?.[1] ?? "about.installFailed");
|
|
157
190
|
}
|
|
191
|
+
//#endregion
|
|
192
|
+
//#region src/client/section-card-styles.ts
|
|
193
|
+
/**
|
|
194
|
+
* 设置页卡片的共享结构样式。
|
|
195
|
+
*
|
|
196
|
+
* `AboutSection` 下的每张卡片(如 `ThemeSettingsCard`、`ComposerSettingsCard`)均统一引用本模块,
|
|
197
|
+
* 保证单一事实源,避免重复定义与样式漂移。
|
|
198
|
+
*/
|
|
199
|
+
const SECTION_CARD_CSS = `
|
|
200
|
+
.dcu-section-card {
|
|
201
|
+
box-sizing: border-box;
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
gap: 16px;
|
|
205
|
+
padding: 18px 20px;
|
|
206
|
+
background: var(--dsw-alias-bg-layer-2, #18181b);
|
|
207
|
+
border: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08));
|
|
208
|
+
border-radius: 12px;
|
|
209
|
+
margin-bottom: 16px;
|
|
210
|
+
}
|
|
211
|
+
body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
212
|
+
background: var(--dsw-alias-bg-layer-2, #ffffff);
|
|
213
|
+
border-color: var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.08));
|
|
214
|
+
}
|
|
215
|
+
html[data-dsh-glass] .dcu-section-card {
|
|
216
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
217
|
+
backdrop-filter: none !important;
|
|
218
|
+
-webkit-backdrop-filter: none !important;
|
|
219
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
|
220
|
+
}
|
|
221
|
+
html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
222
|
+
background: var(--dsw-alias-bg-layer-2, #ffffff) !important;
|
|
223
|
+
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
|
224
|
+
}
|
|
225
|
+
.dcu-section-header {
|
|
226
|
+
display: flex;
|
|
227
|
+
align-items: flex-start;
|
|
228
|
+
justify-content: space-between;
|
|
229
|
+
gap: 16px;
|
|
230
|
+
flex-wrap: wrap;
|
|
231
|
+
}
|
|
232
|
+
.dcu-section-title-wrap {
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
gap: 4px;
|
|
236
|
+
min-width: 0;
|
|
237
|
+
flex: 1;
|
|
238
|
+
}
|
|
239
|
+
.dcu-section-title {
|
|
240
|
+
margin: 0;
|
|
241
|
+
font-size: 15px;
|
|
242
|
+
font-weight: 600;
|
|
243
|
+
line-height: 22px;
|
|
244
|
+
color: var(--dsw-alias-label-primary);
|
|
245
|
+
display: flex;
|
|
246
|
+
align-items: center;
|
|
247
|
+
gap: 8px;
|
|
248
|
+
}
|
|
249
|
+
.dcu-section-desc {
|
|
250
|
+
margin: 0;
|
|
251
|
+
font-size: 13px;
|
|
252
|
+
line-height: 18px;
|
|
253
|
+
color: var(--dsw-alias-label-tertiary);
|
|
254
|
+
}
|
|
255
|
+
`;
|
|
256
|
+
/** 设置行(左文案 + 右侧控件)。与 `.dcu-theme-row` 同构,命名独立以免互相依赖。 */
|
|
257
|
+
const SETTINGS_ROW_CSS = `
|
|
258
|
+
.dcu-settings-row {
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: space-between;
|
|
262
|
+
gap: 16px;
|
|
263
|
+
flex-wrap: wrap;
|
|
264
|
+
}
|
|
265
|
+
.dcu-settings-row-label {
|
|
266
|
+
display: flex;
|
|
267
|
+
flex-direction: column;
|
|
268
|
+
gap: 2px;
|
|
269
|
+
min-width: 0;
|
|
270
|
+
flex: 1;
|
|
271
|
+
}
|
|
272
|
+
.dcu-settings-row-title {
|
|
273
|
+
font-size: 13px;
|
|
274
|
+
font-weight: 600;
|
|
275
|
+
line-height: 18px;
|
|
276
|
+
color: var(--dsw-alias-label-primary);
|
|
277
|
+
}
|
|
278
|
+
.dcu-settings-row-hint {
|
|
279
|
+
font-size: 12px;
|
|
280
|
+
line-height: 17px;
|
|
281
|
+
color: var(--dsw-alias-label-tertiary);
|
|
282
|
+
}
|
|
283
|
+
`;
|
|
158
284
|
//#endregion
|
|
159
285
|
//#region src/client/theme/glass-css.gen.ts
|
|
160
286
|
/**
|
|
@@ -165,7 +291,7 @@ window.__ModuleLoader__.load({
|
|
|
165
291
|
* (item II — lazy CSS), so editing the stylesheet means editing
|
|
166
292
|
* glass.module.css and rebuilding.
|
|
167
293
|
*/
|
|
168
|
-
const GLASS_CSS_TEXT = "[data-dsh-glass] body{--dsh-glass-card:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(52% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-card-raised:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(64% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-card-hover:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(76% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-rim:color-mix(in srgb, var(--dsw-alias-label-primary) 18%, transparent);--dsh-glass-rim-soft:color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent);--dsh-glass-rim-strong:color-mix(in srgb, var(--dsw-alias-label-primary) 30%, transparent);--dsh-glass-edge:inset 0 1px 0 #ffffff6b;--dsh-glass-drop:0 10px 32px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 38%, transparent);--dsh-glass-input-shadow:0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 65%, transparent), 0 8px 24px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 80%, transparent);--dsh-glass-ground:color-mix(in srgb, color-mix(in srgb, var(--dsw-alias-bg-base), #fff calc(var(--dsh-glass-brightness-white,0) * 100%)), #000 calc(var(--dsh-glass-brightness-black,0) * 100%));--dsh-glass-ambience:calc(1 - var(--dsh-glass-brightness-white,0) - var(--dsh-glass-brightness-black,0));--dsh-glass-wash-tint:#fff;--dsh-glass-wash-mix:22%}[data-dsh-glass] body[data-ds-dark-theme]{--dsh-glass-rim:color-mix(in srgb, var(--dsw-alias-label-primary) 24%, transparent);--dsh-glass-rim-soft:color-mix(in srgb, var(--dsw-alias-label-primary) 16%, transparent);--dsh-glass-rim-strong:color-mix(in srgb, var(--dsw-alias-label-primary) 30%, transparent);--dsh-glass-edge:inset 0 1px 0 #ffffff14;--dsh-glass-drop:0 10px 32px #02060e73;--dsh-glass-input-shadow:0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 65%, transparent), 0 8px 24px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 80%, transparent);--dsh-glass-wash-tint:var(--dsw-alias-bg-layer-1);--dsh-glass-wash-mix:68%}[data-dsh-glass] body,[data-dsh-glass] [data-dsh-glass-ground-sample]{background: radial-gradient(58% 46% at 18% 6%, color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) calc(12% * var(--dsh-glass-ambience) * var(--dsh-glass-glow,0)), transparent), transparent 68%), radial-gradient(48% 42% at 86% 14%, color-mix(in srgb, var(--dsw-alias-state-success-tertiary) calc(10% * var(--dsh-glass-ambience) * var(--dsh-glass-glow,0)), transparent), transparent 62%), linear-gradient(165deg, color-mix(in srgb, var(--dsh-glass-ground), var(--dsh-glass-wash-tint) calc(var(--dsh-glass-wash-mix) * var(--dsh-glass-ambience))) 0%, var(--dsh-glass-ground) 55%, color-mix(in srgb, var(--dsh-glass-ground), #000 calc(5% * var(--dsh-glass-ambience))) 100%)}[data-dsh-glass] [data-dsh-glass-frame],[data-dsh-glass] [data-phase],[data-dsh-glass] [data-dsh-glass-details],[data-dsh-glass-float] [data-dsh-glass-frame]>[class*=centerCol]{background:0 0}[data-dsh-glass-float] [data-phase=active] header{z-index:8;position:relative}[data-dsh-glass-float] [class*=banner]{position:static}[data-dsh-glass-float] [data-phase=active] [data-conversation-scroll]{margin-top:-95px;padding-top:107px}[data-dsh-glass] [data-phase] [class*=composerSeat][class*=composerSeat]{background:0 0}[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[class*=dock],[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[data-composer-dock]{position:relative}[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[class*=dock]:before,[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[data-composer-dock]:before{display:none!important;content:none!important}[data-dsh-glass] [data-dsh-glass-fade]{z-index:7;pointer-events:none;backdrop-filter:blur(5px);background:#ffffff2e;height:13px;position:fixed;left:0;right:0}[data-dsh-glass] body[data-ds-dark-theme] [data-dsh-glass-fade]{background:#00000024}[data-dsh-glass] [data-dsh-glass-fade=top]{top:0;-webkit-mask-image:linear-gradient(#000 0%,#0000 100%);mask-image:linear-gradient(#000 0%,#0000 100%)}[data-dsh-glass][data-windows-titlebar] [data-dsh-glass-fade=top]{display:none}[data-dsh-glass] [data-dsh-glass-fade=bottom]{bottom:0;-webkit-mask-image:linear-gradient(#0000 0%,#000 100%);mask-image:linear-gradient(#0000 0%,#000 100%)}[data-dsh-glass-float] [data-menu-material=translucent],[data-dsh-glass-float] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-float] [role=dialog],[data-dsh-glass-float] [role=alert],[data-dsh-glass-float] [data-trigger-menu],[data-dsh-glass-float] [data-dsh-glass-surface]{border-radius:14px}[data-dsh-glass-float] [role=menuitem],[data-dsh-glass-float] [role=tooltip],[data-dsh-glass-float] [class*=pill]{border-radius:8px}[data-dsh-glass-float] button[class*=button]{border-radius:10px}[data-dsh-glass-float] [class*=iconButton],[data-dsh-glass-float] [class*=searchButton]{border-radius:8px}[data-dsh-glass-float] [class*=block]{--dsl-code-block-border-radius:14px;--dsl-diff-radius:14px;--dsl-read-radius:14px;--dsl-terminal-radius:14px;--dsl-web-radius:14px;--dsl-search-radius:14px;border-radius:14px}[data-dsh-glass-float] [data-dsh-glass-add]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-dsh-glass-add]:hover:not(:disabled){background:var(--dsh-glass-card-hover)}[data-dsh-glass-float] [data-dsh-glass-surface]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim-soft);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-dsh-glass-surface]:hover:not(:disabled){background:var(--dsh-glass-card-hover)}[data-dsh-glass-float] [data-conversation-scroll] [class*=bubble]{border:1px solid var(--dsh-glass-rim-soft);background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(46% * var(--dsh-glass-frost,1)), transparent);border-radius:14px}[data-dsh-glass-float] [class*=card]{border-radius:14px}[data-dsh-glass-float] [data-reader-reasoning-card]:not([data-overflow=false][data-expanded=false]),[data-dsh-glass-compat] [data-reader-reasoning-card]:not([data-overflow=false][data-expanded=false]){background:color-mix(in srgb, var(--dsw-alias-bg-module-platform) calc(52% * var(--dsh-glass-frost,1)), transparent);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-changed-files],html[data-dsh-glass-float] [data-presented-file]{--changes-fill:var(--dsh-glass-card);--deliverable-fill:var(--dsh-glass-card);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-presented-file],html[data-dsh-glass-float] [data-changed-files]{background:var(--dsh-glass-card)}html[data-dsh-glass-float] [data-changed-files]>:first-child,html[data-dsh-glass-float] [data-changed-files] ul>li>:first-child,html[data-dsh-glass-float] [data-changed-files] ul{background:0 0}html[data-dsh-glass-float] [data-changed-files] ul{border-top:.5px solid var(--dsh-glass-rim-soft)}html[data-dsh-glass-float] [data-changed-files]>:first-child>:first-child,html[data-dsh-glass-float] [data-presented-file]>:first-child{background:var(--dsh-glass-card-raised)}html[data-dsh-glass-float] [data-turn-trigger]{background:var(--dsh-glass-card);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-turn-trigger]:hover{background:var(--dsh-glass-card-hover)}[data-dsh-glass] [data-dsh-glass-settings]{--dsh-glass-settings-raised:calc(38% + 38% * var(--dsh-glass-frost,1));--dsh-glass-settings-soft:calc(30% + 30% * var(--dsh-glass-frost,1));--dsw-alias-bg-module-platform:color-mix(in srgb, var(--dsw-static-neutral-bluish-800) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-3:color-mix(in srgb, var(--dsw-static-neutral-bluish-800) var(--dsh-glass-settings-soft), transparent);--dsw-alias-bg-layer-2:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-1:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-soft), transparent);--dsw-specific-sidebar-nav-item-active:color-mix(in srgb, var(--dsw-static-neutral-bluish-750) var(--dsh-glass-settings-raised), transparent);--dsw-specific-sidebar-nav-item-hover:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-soft), transparent)}[data-dsh-glass] body:not([data-ds-dark-theme]) [data-dsh-glass-settings]{--dsw-alias-bg-module-platform:color-mix(in srgb, var(--dsw-static-neutral-bluish-60) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-3:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-soft), transparent);--dsw-alias-bg-layer-2:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-1:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-soft), transparent);--dsw-specific-sidebar-nav-item-active:color-mix(in srgb, var(--dsw-static-neutral-bluish-100) var(--dsh-glass-settings-raised), transparent);--dsw-specific-sidebar-nav-item-hover:color-mix(in srgb, var(--dsw-static-neutral-bluish-75) var(--dsh-glass-settings-soft), transparent)}[data-dsh-glass-float] [data-phase] header:not([class*=headerBlank]){width:100%;max-width:min(calc(var(--dsh-chat-user-width,clamp(680px, calc(var(--dsh-conversation-column-width,1500px) * .64), 920px)) + 32px), calc(100% - 32px));border:1px solid var(--dsh-glass-rim);background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);backdrop-filter:blur(var(--dsh-glass-blur,14px));border-radius:20px;margin:12px auto 0;padding:10px 16px 8px}[data-dsh-glass-float] [data-phase] header:not([class*=headerBlank]):after{display:none}[data-dsh-glass-float] [data-dsh-glass-frame][data-sidebar-collapsed] [data-phase] header:not([class*=headerBlank]){width:auto;max-width:none;margin-left:28px;margin-right:16px}[data-dsh-glass-float] [class*=sidebarCol]{--dsw-specific-sidebar-fill:transparent;z-index:9;border:1px solid var(--dsh-glass-rim-soft);box-shadow:var(--dsh-glass-drop);border-radius:20px;margin:12px;padding:10px 12px 14px;position:relative;overflow:hidden}[data-dsh-glass-float] [class*=sidebarCol]:before{content:\"\";border-radius:inherit;background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge);z-index:-1;pointer-events:none;transition:border-radius .15s var(--ds-ease-in-out);position:absolute;inset:0}[data-dsh-glass-float] body{--dsw-specific-sidebar-fill:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(52% * var(--dsh-glass-frost,1)), color-mix(in srgb, var(--dsh-glass-ground), var(--dsh-glass-wash-tint) calc(var(--dsh-glass-wash-mix) * var(--dsh-glass-ambience))))!important}[data-dsh-glass-float] [data-dsh-glass-frame][data-sidebar-collapsed] [class*=sidebarCol]{transition:margin .15s var(--ds-ease-in-out), border-radius .15s var(--ds-ease-in-out);border-radius:16px;margin:12px -12px 12px 12px;padding:0}[data-dsh-glass-float] [data-dsh-glass-frame]:not([data-sidebar-collapsed]) [data-dsh-glass-sidebar-root]{width:100%!important}[data-dsh-glass-float] [data-dsh-glass-trajectory]{width:100%!important;max-width:none!important;height:100%!important;margin:0!important;border:none!important;box-shadow:none!important;border-radius:0!important;overflow:hidden}[data-dsh-glass-float] [data-dsh-glass-trajectory] [role=toolbar],[data-dsh-glass-float] [data-dsh-glass-trajectory] section[aria-label=Trajectory\\ timeline]{background:0 0}[data-dsh-glass-float] [data-composer-card],[data-dsh-glass-float] [data-composer-card]:after{border-radius:24px}[data-dsh-glass-float] [data-composer-card]{z-index:8;isolation:isolate;border:1px solid var(--dsh-glass-rim-strong);box-shadow:var(--dsh-glass-input-shadow);background:0 0;position:relative}[data-dsh-glass-float] [data-composer-card]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px));pointer-events:none;position:absolute;inset:0}[data-dsh-glass-float] [data-dsh-glass-inputbar]:not([class*=hero]):not(:has([data-dsh-glass-stats])){padding-bottom:12px}[data-dsh-glass-float] [role=treeitem][aria-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}[data-dsh-glass-float] button[class*=button]:hover:not(:disabled),[data-dsh-glass-float] [role=menuitem]:hover:not(:disabled){box-shadow:0 0 12px color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 20%, transparent)}[data-dsh-glass-float] [data-menu-material=translucent]:not(:focus-visible){--dsw-menu-surface-fill:var(--dsh-glass-card-raised);--dsw-menu-backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] body[data-ds-dark-theme] [data-menu-material=translucent]:not(:focus-visible){outline:1px solid var(--dsh-glass-rim-soft);outline-offset:-1px}[data-dsh-glass-float] [role=menu]:not([data-menu-material]):not([data-menu-material] *){background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim-soft);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-menu-material=translucent]:has([role=group]>[role=menuitemradio]){--dsw-menu-surface-fill:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 70%, transparent)}[data-dsh-glass-float] [data-menu-group]:has(>[role=menuitemradio])>[data-menu-group-heading]{background:var(--dsh-glass-card-raised);backdrop-filter:blur(var(--dsh-glass-blur,14px));border-radius:999px;align-items:center;width:fit-content;margin:3px 0 5px 6px;padding:3px 10px;display:inline-flex}[data-dsh-glass-float] [role=dialog][aria-modal=true]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);backdrop-filter:blur(var(--dsh-glass-blur,14px));border-radius:20px}[data-dsh-glass] [data-conversation-scroll]{text-shadow:0 0 1px #ffffff80}[data-dsh-glass] body[data-ds-dark-theme] [data-conversation-scroll]{text-shadow:0 0 1px #0006}[data-dsh-glass-float] [data-dsh-glass-inputbar] [data-slot]{color:var(--dsw-alias-label-secondary)}[data-dsh-glass]{--dsh-glass-entry-scale:1}[data-dsh-glass-compat]{--dsh-glass-entry-scale:0}[data-dsh-glass] [data-testid^=view-]{animation:dsh-glass-in calc(.26s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out)}[data-dsh-glass] [data-tool]{animation:dsh-glass-rise calc(.3s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out) both}[data-dsh-glass] [role=dialog]{animation:dsh-glass-dialog-in calc(.24s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out)}@keyframes dsh-glass-in{0%{opacity:0}}@keyframes dsh-glass-rise{0%{opacity:0;transform:translateY(6px)}}@keyframes dsh-glass-dialog-in{0%{opacity:0;transform:translateY(8px)scale(.985)}}[data-dsh-glass] :focus-visible{outline:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 85%, transparent);outline-offset:1px}[data-dsh-glass] ::selection{background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 35%, transparent)}[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-compat] [class*=popover],[data-dsh-glass-compat] [class*=dropdown]{backdrop-filter:blur(12px)}[data-dsh-glass-compat] [data-menu-material=translucent]:not(:focus-visible){--dsw-menu-surface-fill:var(--dsh-glass-card-raised);--dsw-menu-backdrop-filter:blur(12px)}[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-compat] [class*=popover],[data-dsh-glass-compat] [class*=dropdown]{background:var(--dsh-glass-card-raised)}[data-dsh-glass-compat] [data-composer-card]{isolation:isolate;backdrop-filter:none;background:0 0;position:relative}[data-dsh-glass-compat] [data-composer-card]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card-raised);backdrop-filter:blur(12px);pointer-events:none;position:absolute;inset:0}[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *):not(:focus-visible),[data-dsh-glass-compat] [data-composer-card]:not(:focus-visible),[data-dsh-glass-compat] [class*=popover]:not(:focus-visible),[data-dsh-glass-compat] [class*=dropdown]:not(:focus-visible){outline:1px solid var(--dsh-glass-rim);outline-offset:-1px}[data-dsh-glass-compat] [role=dialog][aria-modal=true]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);backdrop-filter:blur(var(--dsh-glass-blur,12px))}@media (prefers-reduced-motion:reduce){[data-dsh-glass] [data-testid^=view-],[data-dsh-glass] [data-tool],[data-dsh-glass] [role=dialog]{animation:none}}";
|
|
294
|
+
const GLASS_CSS_TEXT = "[data-dsh-glass] body{--dsh-glass-card:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(52% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-card-raised:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(64% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-card-hover:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(76% * var(--dsh-glass-frost,1)), transparent);--dsh-glass-rim:color-mix(in srgb, var(--dsw-alias-label-primary) 18%, transparent);--dsh-glass-rim-soft:color-mix(in srgb, var(--dsw-alias-label-primary) 12%, transparent);--dsh-glass-rim-strong:color-mix(in srgb, var(--dsw-alias-label-primary) 30%, transparent);--dsh-glass-edge:inset 0 1px 0 #ffffff6b;--dsh-glass-drop:0 10px 32px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 38%, transparent);--dsh-glass-input-shadow:0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 65%, transparent), 0 8px 24px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 80%, transparent);--dsh-glass-ground:color-mix(in srgb, color-mix(in srgb, var(--dsw-alias-bg-base), #fff calc(var(--dsh-glass-brightness-white,0) * 100%)), #000 calc(var(--dsh-glass-brightness-black,0) * 100%));--dsh-glass-ambience:calc(1 - var(--dsh-glass-brightness-white,0) - var(--dsh-glass-brightness-black,0));--dsh-glass-wash-tint:#fff;--dsh-glass-wash-mix:22%}[data-dsh-glass] body[data-ds-dark-theme]{--dsh-glass-rim:color-mix(in srgb, var(--dsw-alias-label-primary) 24%, transparent);--dsh-glass-rim-soft:color-mix(in srgb, var(--dsw-alias-label-primary) 16%, transparent);--dsh-glass-rim-strong:color-mix(in srgb, var(--dsw-alias-label-primary) 30%, transparent);--dsh-glass-edge:inset 0 1px 0 #ffffff14;--dsh-glass-drop:0 10px 32px #02060e73;--dsh-glass-input-shadow:0 1px 2px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 65%, transparent), 0 8px 24px color-mix(in srgb, var(--dsw-alias-bg-mask-2) 80%, transparent);--dsh-glass-wash-tint:var(--dsw-alias-bg-layer-1);--dsh-glass-wash-mix:68%}[data-dsh-glass] body,[data-dsh-glass] [data-dsh-glass-ground-sample]{background: radial-gradient(calc(58% * var(--dsh-glass-glow-size,1)) calc(46% * var(--dsh-glass-glow-size,1)) at 18% 6%, color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) calc(12% * var(--dsh-glass-ambience) * var(--dsh-glass-glow,0) * var(--dsh-glass-glow-strength,1)), transparent), transparent 68%), radial-gradient(calc(48% * var(--dsh-glass-glow-size,1)) calc(42% * var(--dsh-glass-glow-size,1)) at 86% 14%, color-mix(in srgb, var(--dsw-alias-state-success-tertiary) calc(10% * var(--dsh-glass-ambience) * var(--dsh-glass-glow,0) * var(--dsh-glass-glow-strength,1)), transparent), transparent 62%), linear-gradient(165deg, color-mix(in srgb, var(--dsh-glass-ground), var(--dsh-glass-wash-tint) calc(var(--dsh-glass-wash-mix) * var(--dsh-glass-ambience))) 0%, var(--dsh-glass-ground) 55%, color-mix(in srgb, var(--dsh-glass-ground), #000 calc(5% * var(--dsh-glass-ambience))) 100%)}[data-dsh-glass] [data-dsh-glass-frame],[data-dsh-glass] [data-phase],[data-dsh-glass] [data-dsh-glass-details],[data-dsh-glass-float] [data-dsh-glass-frame]>[class*=centerCol]{background:0 0}[data-dsh-glass-float] [data-phase=active] header{z-index:8;position:relative}[data-dsh-glass-float] [class*=banner]{position:static}[data-dsh-glass-float] [data-phase=active] [data-conversation-scroll]{margin-top:-95px;padding-top:107px}[data-dsh-glass] [data-phase] [class*=composerSeat][class*=composerSeat]{background:0 0}[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[class*=dock],[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[data-composer-dock]{position:relative}[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[class*=dock]:before,[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar]>[data-composer-dock]:before{content:\"\";left:calc(-1 * var(--dsh-composer-side-clearance,16px));right:calc(-1 * var(--dsh-composer-side-clearance,16px));z-index:-1;pointer-events:none;background:color-mix(in srgb, color-mix(in srgb, var(--dsh-glass-ground), #000 calc(5% * var(--dsh-glass-ambience))) calc(70% + 10% * var(--dsh-glass-frost,1)), transparent);height:calc(100% + 12px);backdrop-filter:blur(var(--dsh-glass-blur,14px));position:absolute;bottom:-4px;-webkit-mask-image:linear-gradient(#0000 0,#000 18px);mask-image:linear-gradient(#0000 0,#000 18px)}[data-dsh-glass] [data-dsh-glass-fade]{z-index:7;pointer-events:none;backdrop-filter:blur(5px);background:#ffffff2e;height:13px;position:fixed;left:0;right:0}[data-dsh-glass] body[data-ds-dark-theme] [data-dsh-glass-fade]{background:#00000024}[data-dsh-glass] [data-dsh-glass-fade=top]{top:0;-webkit-mask-image:linear-gradient(#000 0%,#0000 100%);mask-image:linear-gradient(#000 0%,#0000 100%)}[data-dsh-glass][data-windows-titlebar] [data-dsh-glass-fade=top]{display:none}[data-dsh-glass] [data-dsh-glass-fade=bottom]{bottom:0;-webkit-mask-image:linear-gradient(#0000 0%,#000 100%);mask-image:linear-gradient(#0000 0%,#000 100%)}[data-dsh-glass-float] [data-menu-material=translucent],[data-dsh-glass-float] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-float] [role=dialog],[data-dsh-glass-float] [role=alert],[data-dsh-glass-float] [data-trigger-menu],[data-dsh-glass-float] [data-dsh-glass-surface]{border-radius:14px}[data-dsh-glass-float] [role=menuitem],[data-dsh-glass-float] [role=tooltip],[data-dsh-glass-float] [class*=pill]{border-radius:8px}[data-dsh-glass-float] button[class*=button]{border-radius:10px}[data-dsh-glass-float] [class*=iconButton],[data-dsh-glass-float] [class*=searchButton]{border-radius:8px}[data-dsh-glass-float] [class*=block]{--dsl-code-block-border-radius:14px;--dsl-diff-radius:14px;--dsl-read-radius:14px;--dsl-terminal-radius:14px;--dsl-web-radius:14px;--dsl-search-radius:14px;border-radius:14px}[data-dsh-glass-float] [data-dsh-glass-add]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-dsh-glass-add]:hover:not(:disabled){background:var(--dsh-glass-card-hover)}[data-dsh-glass-float] [data-dsh-glass-surface]{background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim-soft);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-dsh-glass-surface]:hover:not(:disabled){background:var(--dsh-glass-card-hover)}[data-dsh-glass-float] [data-conversation-scroll] [class*=bubble]{border:1px solid var(--dsh-glass-rim-soft);background:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(46% * var(--dsh-glass-frost,1)), transparent);border-radius:14px}[data-dsh-glass-float] [class*=card]{border-radius:14px}[data-dsh-glass-float] [data-reader-reasoning-card]:not([data-overflow=false][data-expanded=false]),[data-dsh-glass-compat] [data-reader-reasoning-card]:not([data-overflow=false][data-expanded=false]){background:color-mix(in srgb, var(--dsw-alias-bg-module-platform) calc(52% * var(--dsh-glass-frost,1)), transparent);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-changed-files],html[data-dsh-glass-float] [data-presented-file]{--changes-fill:var(--dsh-glass-card);--deliverable-fill:var(--dsh-glass-card);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-presented-file],html[data-dsh-glass-float] [data-changed-files]{background:var(--dsh-glass-card)}html[data-dsh-glass-float] [data-changed-files]>:first-child,html[data-dsh-glass-float] [data-changed-files] ul>li>:first-child,html[data-dsh-glass-float] [data-changed-files] ul{background:0 0}html[data-dsh-glass-float] [data-changed-files] ul{border-top:.5px solid var(--dsh-glass-rim-soft)}html[data-dsh-glass-float] [data-changed-files]>:first-child>:first-child,html[data-dsh-glass-float] [data-presented-file]>:first-child{background:var(--dsh-glass-card-raised)}html[data-dsh-glass-float] [data-turn-trigger]{background:var(--dsh-glass-card);border-color:var(--dsh-glass-rim-soft);border-radius:14px}html[data-dsh-glass-float] [data-turn-trigger]:hover{background:var(--dsh-glass-card-hover)}[data-dsh-glass] [data-dsh-glass-settings]{--dsh-glass-settings-raised:calc(38% + 38% * var(--dsh-glass-frost,1));--dsh-glass-settings-soft:calc(30% + 30% * var(--dsh-glass-frost,1));--dsw-alias-bg-module-platform:color-mix(in srgb, var(--dsw-static-neutral-bluish-800) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-3:color-mix(in srgb, var(--dsw-static-neutral-bluish-800) var(--dsh-glass-settings-soft), transparent);--dsw-alias-bg-layer-2:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-1:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-soft), transparent);--dsw-specific-sidebar-nav-item-active:color-mix(in srgb, var(--dsw-static-neutral-bluish-750) var(--dsh-glass-settings-raised), transparent);--dsw-specific-sidebar-nav-item-hover:color-mix(in srgb, var(--dsw-static-neutral-bluish-850) var(--dsh-glass-settings-soft), transparent)}[data-dsh-glass] body:not([data-ds-dark-theme]) [data-dsh-glass-settings]{--dsw-alias-bg-module-platform:color-mix(in srgb, var(--dsw-static-neutral-bluish-60) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-3:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-soft), transparent);--dsw-alias-bg-layer-2:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-raised), transparent);--dsw-alias-bg-layer-1:color-mix(in srgb, var(--dsw-static-neutral-bluish-00) var(--dsh-glass-settings-soft), transparent);--dsw-specific-sidebar-nav-item-active:color-mix(in srgb, var(--dsw-static-neutral-bluish-100) var(--dsh-glass-settings-raised), transparent);--dsw-specific-sidebar-nav-item-hover:color-mix(in srgb, var(--dsw-static-neutral-bluish-75) var(--dsh-glass-settings-soft), transparent)}[data-dsh-glass-float] [data-phase] header:not([class*=headerBlank]){width:100%;margin:var(--dsh-glass-gap,12px) auto 0;max-width:min(calc(var(--dsh-chat-user-width,clamp(680px, calc(var(--dsh-conversation-column-width,1500px) * .64), 920px)) + 32px), calc(100% - 32px));border:1px solid var(--dsh-glass-rim);background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);backdrop-filter:blur(var(--dsh-glass-blur,14px));border-radius:20px;padding:10px 16px 8px}[data-dsh-glass-float] [data-phase] header:not([class*=headerBlank]):after{display:none}[data-dsh-glass-float] [data-dsh-glass-frame][data-sidebar-collapsed] [data-phase] header:not([class*=headerBlank]){width:auto;margin-left:calc(var(--dsh-glass-gap,12px) + 16px);max-width:none;margin-right:16px}[data-dsh-glass-float] [class*=sidebarCol]{--dsw-specific-sidebar-fill:transparent;z-index:9;margin:var(--dsh-glass-gap,12px);border:1px solid var(--dsh-glass-rim-soft);box-shadow:var(--dsh-glass-drop);border-radius:20px;padding:10px 12px 14px;position:relative;overflow:hidden}[data-dsh-glass-float] [class*=sidebarCol]:before{content:\"\";border-radius:inherit;background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge);z-index:-1;pointer-events:none;transition:border-radius .15s var(--ds-ease-in-out);position:absolute;inset:0}[data-dsh-glass-float] body{--dsw-specific-sidebar-fill:color-mix(in srgb, var(--dsw-alias-bg-layer-1) calc(52% * var(--dsh-glass-frost,1)), color-mix(in srgb, var(--dsh-glass-ground), var(--dsh-glass-wash-tint) calc(var(--dsh-glass-wash-mix) * var(--dsh-glass-ambience))))!important}[data-dsh-glass-float] [data-dsh-glass-frame][data-sidebar-collapsed] [class*=sidebarCol]{margin:var(--dsh-glass-gap,12px) calc(-1 * min(var(--dsh-glass-gap,12px), 16px)) var(--dsh-glass-gap,12px) var(--dsh-glass-gap,12px);transition:margin .15s var(--ds-ease-in-out), border-radius .15s var(--ds-ease-in-out);border-radius:16px;padding:0}[data-dsh-glass-float] [data-dsh-glass-frame]:not([data-sidebar-collapsed]) [data-dsh-glass-sidebar-root]{width:100%!important}[data-dsh-glass-float] [data-dsh-glass-trajectory]{margin:8px auto var(--dsh-glass-gap,12px);width:calc(100% - 32px);max-width:min(calc(var(--dsh-chat-user-width,clamp(680px, calc(var(--dsh-conversation-column-width,1500px) * .64), 920px)) + 32px), calc(100% - 32px));height:calc(100% - 8px - var(--dsh-glass-gap,12px));border:1px solid var(--dsh-glass-rim);background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);border-radius:20px;overflow:hidden}[data-dsh-glass-float] [data-dsh-glass-trajectory] [role=toolbar],[data-dsh-glass-float] [data-dsh-glass-trajectory] section[aria-label=Trajectory\\ timeline]{background:0 0}[data-dsh-glass-float] [data-composer-card],[data-dsh-glass-float] [data-composer-card]:after{border-radius:24px}[data-dsh-glass-float] [data-composer-card]{z-index:8;isolation:isolate;border:1px solid var(--dsh-glass-rim-strong);box-shadow:var(--dsh-glass-input-shadow);background:0 0;position:relative}[data-dsh-glass-float] [data-composer-card]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card);box-shadow:var(--dsh-glass-edge);backdrop-filter:blur(var(--dsh-glass-blur,14px));pointer-events:none;position:absolute;inset:0}[data-dsh-glass-float] [data-dsh-glass-inputbar]:not([class*=hero]):not(:has([data-dsh-glass-stats])){padding-bottom:var(--dsh-glass-gap,12px)}[data-dsh-glass-float] [role=treeitem][aria-selected=true]{background:var(--dsw-alias-interactive-bg-hover)}[data-dsh-glass-float] button[class*=button]:hover:not(:disabled),[data-dsh-glass-float] [role=menuitem]:hover:not(:disabled){box-shadow:0 0 12px color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 20%, transparent)}[data-dsh-glass-float] [data-menu-material=translucent]:not(:focus-visible){--dsw-menu-surface-fill:var(--dsh-glass-card-raised);--dsw-menu-backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] body[data-ds-dark-theme] [data-menu-material=translucent]:not(:focus-visible){outline:1px solid var(--dsh-glass-rim-soft);outline-offset:-1px}[data-dsh-glass-float] [role=menu]:not([data-menu-material]):not([data-menu-material] *){background:var(--dsh-glass-card-raised);border:1px solid var(--dsh-glass-rim-soft);backdrop-filter:blur(var(--dsh-glass-blur,14px))}[data-dsh-glass-float] [data-menu-material=translucent]:has([role=group]>[role=menuitemradio]){--dsw-menu-surface-fill:color-mix(in srgb, var(--dsw-alias-bg-layer-2) 70%, transparent)}[data-dsh-glass-float] [data-menu-group]:has(>[role=menuitemradio])>[data-menu-group-heading]{background:var(--dsh-glass-card-raised);backdrop-filter:blur(var(--dsh-glass-blur,14px));border-radius:999px;align-items:center;width:fit-content;margin:3px 0 5px 6px;padding:3px 10px;display:inline-flex}[data-dsh-glass-float] [role=presentation]>[role=dialog][aria-modal=true]{isolation:isolate;backdrop-filter:none;border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);background:0 0;border-radius:20px;position:relative}[data-dsh-glass-float] [role=presentation]>[role=dialog][aria-modal=true]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card-raised);backdrop-filter:blur(var(--dsh-glass-blur,14px));pointer-events:none;position:absolute;inset:0}[data-dsh-glass] [data-conversation-scroll]{text-shadow:0 0 1px #ffffff80}[data-dsh-glass] body[data-ds-dark-theme] [data-conversation-scroll]{text-shadow:0 0 1px #0006}[data-dsh-glass-float] [data-dsh-glass-inputbar] [data-slot]{color:var(--dsw-alias-label-secondary)}[data-dsh-glass]{--dsh-glass-entry-scale:1}[data-dsh-glass-compat]{--dsh-glass-entry-scale:0}[data-dsh-glass] [data-testid^=view-]{animation:dsh-glass-in calc(.26s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out)}[data-dsh-glass] [data-tool]{animation:dsh-glass-rise calc(.3s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out) both}[data-dsh-glass] [role=dialog]{animation:dsh-glass-dialog-in calc(.24s * var(--dsh-glass-entry-scale,1)) var(--ds-ease-in-out)}@keyframes dsh-glass-in{0%{opacity:0}}@keyframes dsh-glass-rise{0%{opacity:0;transform:translateY(6px)}}@keyframes dsh-glass-dialog-in{0%{opacity:0}}[data-dsh-glass] :focus-visible{outline:2px solid color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 85%, transparent);outline-offset:1px}[data-dsh-glass] ::selection{background:color-mix(in srgb, var(--dsw-alias-brand-primary-new-colorprimary-new-color) 35%, transparent)}[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-compat] [class*=popover],[data-dsh-glass-compat] [class*=dropdown]{backdrop-filter:blur(12px)}[data-dsh-glass-compat] [data-menu-material=translucent]:not(:focus-visible){--dsw-menu-surface-fill:var(--dsh-glass-card-raised);--dsw-menu-backdrop-filter:blur(12px)}/* 有意移除:平铺玻璃模式下右侧栏外壳的 backdrop-filter 会在展开/全屏切换时造成背景透出、收起后白屏(df5eb68 修复,勿随上游基线同步带回) */[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-compat] [class*=popover],[data-dsh-glass-compat] [class*=dropdown]{background:var(--dsh-glass-card-raised)}[data-dsh-glass-compat] [data-composer-card]{isolation:isolate;backdrop-filter:none;background:0 0;position:relative}[data-dsh-glass-compat] [data-composer-card]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card-raised);backdrop-filter:blur(12px);pointer-events:none;position:absolute;inset:0}[data-dsh-glass-compat] [role=menu]:not([data-menu-material]):not([data-menu-material] *):not(:focus-visible),[data-dsh-glass-compat] [data-composer-card]:not(:focus-visible),[data-dsh-glass-compat] [class*=popover]:not(:focus-visible),[data-dsh-glass-compat] [class*=dropdown]:not(:focus-visible){outline:1px solid var(--dsh-glass-rim);outline-offset:-1px}[data-dsh-glass-compat] [role=presentation]>[role=dialog][aria-modal=true]{isolation:isolate;backdrop-filter:none;border:1px solid var(--dsh-glass-rim);box-shadow:var(--dsh-glass-edge), var(--dsh-glass-drop);background:0 0;position:relative}[data-dsh-glass-compat] [role=presentation]>[role=dialog][aria-modal=true]:before{content:\"\";z-index:-1;border-radius:inherit;background:var(--dsh-glass-card-raised);backdrop-filter:blur(var(--dsh-glass-blur,12px));pointer-events:none;position:absolute;inset:0}[data-dsh-glass-settings] [role=menu]:not([data-menu-material]):not([data-menu-material] *),[data-dsh-glass-settings] .dsm-select-menu{background:color-mix(in srgb, var(--dsh-glass-ground) 92%, transparent);backdrop-filter:blur(12px);box-shadow:var(--dsh-glass-drop)}[data-dsh-glass-settings] .dsm-panel-head{isolation:isolate;outline:1px solid var(--dsh-glass-rim-soft);outline-offset:-1px;background:0 0;border-radius:14px;padding:6px 12px 4px}[data-dsh-glass-settings] .dsm-panel-head:before{content:\"\";z-index:-1;border-radius:inherit;background:color-mix(in srgb, var(--dsh-glass-ground) 78%, transparent);backdrop-filter:blur(12px);pointer-events:none;position:absolute;inset:0}@media (prefers-reduced-motion:reduce){[data-dsh-glass] [data-testid^=view-],[data-dsh-glass] [data-tool],[data-dsh-glass] [role=dialog]{animation:none}}";
|
|
169
295
|
//#endregion
|
|
170
296
|
//#region src/client/theme/glass-seams.ts
|
|
171
297
|
const SEAMS = [
|
|
@@ -343,67 +469,35 @@ window.__ModuleLoader__.load({
|
|
|
343
469
|
border-radius: 0 !important;
|
|
344
470
|
}
|
|
345
471
|
|
|
346
|
-
/*
|
|
347
|
-
[data-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
472
|
+
/* 云母浮动顶栏:浮动排版把滚动内容上提 95px,让它从顶栏下方穿过。
|
|
473
|
+
⚠ 绝对禁止在滚动容器 [data-conversation-scroll] 上使用 mask-image / clip-path 做顶部淡出:
|
|
474
|
+
Chromium 会让被遮罩的元素成为 backdrop root,导致其内部所有 backdrop-filter(输入卡片、
|
|
475
|
+
底部 dock 磨砂幕布)全部失效 —— 实测在真实宿主里把它设成 blur(24px) 后画面几乎没有任何
|
|
476
|
+
变化(拉普拉斯方差仅降 17%),去掉 mask 后同一处方差降 86%,云母输入框恢复正常磨砂。
|
|
477
|
+
这正是「还是透」的真因:兜底模糊一直在,只是被 mask 变成惰性。
|
|
478
|
+
因此顶部遮挡改为与对标插件一致的做法:不给滚动容器加遮罩,只把顶栏自己的磨砂设为下限值,
|
|
479
|
+
让从顶栏背后穿过的正文被磨砂化开。 */
|
|
480
|
+
[data-dsh-glass-float] [data-phase] header:not([class*="headerBlank"]) {
|
|
481
|
+
backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
482
|
+
-webkit-backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
356
483
|
}
|
|
357
484
|
|
|
358
|
-
/*
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
--dsh-glass-
|
|
363
|
-
|
|
364
|
-
radial-gradient(48% 42% at 86% 14%, color-mix(in srgb, var(--dsw-alias-state-success-tertiary) calc(10% * var(--dsh-glass-ambience) * var(--dsh-glass-glow,0)), transparent), transparent 62%),
|
|
365
|
-
linear-gradient(165deg, color-mix(in srgb, var(--dsh-glass-ground), var(--dsh-glass-wash-tint) calc(var(--dsh-glass-wash-mix) * var(--dsh-glass-ambience))) 0%, var(--dsh-glass-ground) 55%, color-mix(in srgb, var(--dsh-glass-ground), #000 calc(5% * var(--dsh-glass-ambience))) 100%);
|
|
485
|
+
/* 对齐平铺风格(Compat)防漏字规范:将云母输入框卡片底色提升为高遮蔽度的 card-raised,
|
|
486
|
+
并锁定至少 12px 高斯磨砂,将底层滚动的历史文字彻底化开为淡淡的柔和色块,杜绝锐利笔画穿透叠字 */
|
|
487
|
+
[data-dsh-glass-float] [data-composer-card]::before {
|
|
488
|
+
background: var(--dsh-glass-card-raised) !important;
|
|
489
|
+
backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
490
|
+
-webkit-backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
366
491
|
}
|
|
367
492
|
|
|
368
|
-
/*
|
|
369
|
-
向上回看历史时正文会直接穿过输入卡片与底部 dock 区域;参考插件那条 dock 遮罩带又因色差被移除,
|
|
370
|
-
于是两层遮挡同时缺失。这里补回遮挡,拆成「座舱底板 + 上沿渐隐带」两段:
|
|
371
|
-
底板铺与页面底色逐像素一致的底盘(见上),彻底挡住正文且无色带;
|
|
372
|
-
渐隐带用 mask 淡出同一块底盘,高度 16px 是因为实测最后一条消息底部与座舱顶部正好留白 16px,
|
|
373
|
-
只覆盖这段空白,滚到底时不会把最后一条消息一起淡掉。 */
|
|
374
|
-
[data-dsh-glass] [data-phase=active] [class*="composerSeat"][class*="composerSeat"],
|
|
375
|
-
[data-dsh-glass] [data-content-phase=active] [class*="composerSeat"][class*="composerSeat"] {
|
|
376
|
-
background: var(--dsh-glass-ground-layers);
|
|
377
|
-
background-attachment: fixed;
|
|
378
|
-
}
|
|
493
|
+
/* 平铺(compat)模式的卡片材质由上游固定为 12px,这里不再覆盖,避免浓厚预设把 compat 也带成 20px */
|
|
379
494
|
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
height: 16px;
|
|
387
|
-
z-index: -1;
|
|
388
|
-
pointer-events: none;
|
|
389
|
-
background: var(--dsh-glass-ground-layers);
|
|
390
|
-
background-attachment: fixed;
|
|
391
|
-
-webkit-mask-image: linear-gradient(180deg, transparent 0, #000 100%);
|
|
392
|
-
mask-image: linear-gradient(180deg, transparent 0, #000 100%);
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
/* 云母浮动顶栏同一缺陷:浮动排版把滚动内容上提 95px,让它从顶栏下方穿过(padding-top:107px 只保证
|
|
396
|
-
滚到顶部时内容起始于顶栏下方)。而顶栏底色只有 52% × frost(clear 预设仅 8.3%)、blur 为 0,
|
|
397
|
-
于是正文在「窗口顶部 12px 留白」「20px 圆角切角」「顶栏本体」三处都会透出来。
|
|
398
|
-
做法:不动顶栏本身(边框、阴影、磨砂全部保留),而是让滚动内容在顶栏区域内淡出。
|
|
399
|
-
注意 mask 的原点是滚动容器的 border box,不是视口:
|
|
400
|
-
- 容器顶 = 顶栏底边 97px − 95px(margin-top) = 2px
|
|
401
|
-
- 96px → 绝对 y=98,刚好压在顶栏底边 97 之下(alpha=0,顶栏内不留任何正文)
|
|
402
|
-
- 106px → 绝对 y=108,而内容最早从 y=109 开始(容器顶 2 + 宿主 padding-top 107)
|
|
403
|
-
所以渐入既盖满顶栏区域,又不会压暗任何正文。改这两个常量前先重算这三个数。 */
|
|
404
|
-
[data-dsh-glass-float] [data-phase=active] [data-conversation-scroll] {
|
|
405
|
-
-webkit-mask-image: linear-gradient(180deg, transparent 0, transparent 96px, #000 106px);
|
|
406
|
-
mask-image: linear-gradient(180deg, transparent 0, transparent 96px, #000 106px);
|
|
495
|
+
/* dock 磨砂幕布同样只给云母浮动模式加 12px 下限:compat 的 blur 完全交给上游,
|
|
496
|
+
否则 clear 预设(blur:0)会被这条下限悄悄抬到 12px,与「平铺保持原版材质」的约定冲突 */
|
|
497
|
+
[data-dsh-glass-float] [data-dsh-glass-inputbar] > [class*="dock"]::before,
|
|
498
|
+
[data-dsh-glass-float] [data-dsh-glass-inputbar] > [data-composer-dock]::before {
|
|
499
|
+
backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
500
|
+
-webkit-backdrop-filter: blur(max(var(--dsh-glass-blur, 12px), 12px)) !important;
|
|
407
501
|
}
|
|
408
502
|
|
|
409
503
|
/* 斜杠指令/快捷指令候选面板([data-trigger-menu] / Issue #72):
|
|
@@ -457,6 +551,24 @@ window.__ModuleLoader__.load({
|
|
|
457
551
|
for (const [prop, val] of Object.entries(knobs)) root.style.setProperty(prop, val);
|
|
458
552
|
if (document.body) for (const [prop, val] of Object.entries(knobs)) document.body.style.setProperty(prop, val);
|
|
459
553
|
if (!seamDisposer) seamDisposer = startGlassSeamStamper();
|
|
554
|
+
ensureGlassFade(!isCompat);
|
|
555
|
+
}
|
|
556
|
+
const FADE_ATTRIBUTE = "data-dsh-glass-fade";
|
|
557
|
+
/** 云母模式挂载顶部渐隐条;平铺模式或关闭玻璃时移除 */
|
|
558
|
+
function ensureGlassFade(enabled) {
|
|
559
|
+
if (typeof document === "undefined") return;
|
|
560
|
+
const existing = document.querySelector(`[${FADE_ATTRIBUTE}="top"]`);
|
|
561
|
+
if (!enabled) {
|
|
562
|
+
existing?.remove();
|
|
563
|
+
return;
|
|
564
|
+
}
|
|
565
|
+
if (existing !== null) return;
|
|
566
|
+
const body = document.body;
|
|
567
|
+
if (body === null) return;
|
|
568
|
+
const fade = document.createElement("div");
|
|
569
|
+
fade.setAttribute(FADE_ATTRIBUTE, "top");
|
|
570
|
+
fade.setAttribute("aria-hidden", "true");
|
|
571
|
+
body.appendChild(fade);
|
|
460
572
|
}
|
|
461
573
|
/**
|
|
462
574
|
* 彻底释放玻璃质感、清理 DOM 属性与样式标签
|
|
@@ -467,6 +579,7 @@ window.__ModuleLoader__.load({
|
|
|
467
579
|
root.removeAttribute(GLASS_ATTRIBUTE);
|
|
468
580
|
root.removeAttribute(GLASS_FLOAT_ATTRIBUTE);
|
|
469
581
|
root.removeAttribute(GLASS_COMPAT_ATTRIBUTE);
|
|
582
|
+
ensureGlassFade(false);
|
|
470
583
|
const knobs = [
|
|
471
584
|
"--dsh-glass-blur",
|
|
472
585
|
"--dsh-glass-frost",
|
|
@@ -1672,7 +1785,7 @@ window.__ModuleLoader__.load({
|
|
|
1672
1785
|
glassPreset: "codex-ui.glass.preset",
|
|
1673
1786
|
glassGlow: "codex-ui.glass.glow"
|
|
1674
1787
|
});
|
|
1675
|
-
const listeners$
|
|
1788
|
+
const listeners$2 = /* @__PURE__ */ new Set();
|
|
1676
1789
|
const VALID_THEMES = [
|
|
1677
1790
|
"stock",
|
|
1678
1791
|
"codex-dark",
|
|
@@ -1682,25 +1795,25 @@ window.__ModuleLoader__.load({
|
|
|
1682
1795
|
"catppuccin-frappe",
|
|
1683
1796
|
"catppuccin-latte"
|
|
1684
1797
|
];
|
|
1685
|
-
function safeGetItem(key) {
|
|
1798
|
+
function safeGetItem$1(key) {
|
|
1686
1799
|
try {
|
|
1687
1800
|
if (typeof localStorage !== "undefined") return localStorage.getItem(key);
|
|
1688
1801
|
} catch {}
|
|
1689
1802
|
return null;
|
|
1690
1803
|
}
|
|
1691
|
-
function safeSetItem(key, value) {
|
|
1804
|
+
function safeSetItem$1(key, value) {
|
|
1692
1805
|
try {
|
|
1693
1806
|
if (typeof localStorage !== "undefined") localStorage.setItem(key, value);
|
|
1694
1807
|
} catch {}
|
|
1695
1808
|
}
|
|
1696
1809
|
function computeSnapshot() {
|
|
1697
|
-
const rawTheme = safeGetItem(STORAGE_KEYS.themeOption);
|
|
1810
|
+
const rawTheme = safeGetItem$1(STORAGE_KEYS.themeOption);
|
|
1698
1811
|
const themeOption = rawTheme && VALID_THEMES.includes(rawTheme) ? rawTheme : "stock";
|
|
1699
|
-
const glassEnabled = safeGetItem(STORAGE_KEYS.glassEnabled) !== "false";
|
|
1700
|
-
const glassMode = safeGetItem(STORAGE_KEYS.glassMode) === "compat" ? "compat" : "mica";
|
|
1701
|
-
const rawPreset = safeGetItem(STORAGE_KEYS.glassPreset);
|
|
1812
|
+
const glassEnabled = safeGetItem$1(STORAGE_KEYS.glassEnabled) !== "false";
|
|
1813
|
+
const glassMode = safeGetItem$1(STORAGE_KEYS.glassMode) === "compat" ? "compat" : "mica";
|
|
1814
|
+
const rawPreset = safeGetItem$1(STORAGE_KEYS.glassPreset);
|
|
1702
1815
|
const glassPreset = rawPreset === "clear" || rawPreset === "frosted" ? rawPreset : "standard";
|
|
1703
|
-
const glassGlow = safeGetItem(STORAGE_KEYS.glassGlow) === "true";
|
|
1816
|
+
const glassGlow = safeGetItem$1(STORAGE_KEYS.glassGlow) === "true";
|
|
1704
1817
|
return Object.freeze({
|
|
1705
1818
|
themeOption,
|
|
1706
1819
|
glassEnabled,
|
|
@@ -1729,36 +1842,36 @@ window.__ModuleLoader__.load({
|
|
|
1729
1842
|
}
|
|
1730
1843
|
function notify() {
|
|
1731
1844
|
currentSnapshot = computeSnapshot();
|
|
1732
|
-
for (const listener of listeners$
|
|
1845
|
+
for (const listener of listeners$2) try {
|
|
1733
1846
|
listener();
|
|
1734
1847
|
} catch (e) {
|
|
1735
1848
|
console.warn("[codex-ui:theme] listener error:", e);
|
|
1736
1849
|
}
|
|
1737
1850
|
}
|
|
1738
1851
|
function setThemeOption(themeOption) {
|
|
1739
|
-
safeSetItem(STORAGE_KEYS.themeOption, themeOption);
|
|
1852
|
+
safeSetItem$1(STORAGE_KEYS.themeOption, themeOption);
|
|
1740
1853
|
notify();
|
|
1741
1854
|
}
|
|
1742
1855
|
function setGlassEnabled(enabled) {
|
|
1743
|
-
safeSetItem(STORAGE_KEYS.glassEnabled, String(enabled));
|
|
1856
|
+
safeSetItem$1(STORAGE_KEYS.glassEnabled, String(enabled));
|
|
1744
1857
|
notify();
|
|
1745
1858
|
}
|
|
1746
1859
|
function setGlassMode(mode) {
|
|
1747
|
-
safeSetItem(STORAGE_KEYS.glassMode, mode);
|
|
1860
|
+
safeSetItem$1(STORAGE_KEYS.glassMode, mode);
|
|
1748
1861
|
notify();
|
|
1749
1862
|
}
|
|
1750
1863
|
function setGlassPreset(preset) {
|
|
1751
|
-
safeSetItem(STORAGE_KEYS.glassPreset, preset);
|
|
1864
|
+
safeSetItem$1(STORAGE_KEYS.glassPreset, preset);
|
|
1752
1865
|
notify();
|
|
1753
1866
|
}
|
|
1754
1867
|
function setGlassGlow(glow) {
|
|
1755
|
-
safeSetItem(STORAGE_KEYS.glassGlow, String(glow));
|
|
1868
|
+
safeSetItem$1(STORAGE_KEYS.glassGlow, String(glow));
|
|
1756
1869
|
notify();
|
|
1757
1870
|
}
|
|
1758
1871
|
function subscribeThemeSettings(listener) {
|
|
1759
|
-
listeners$
|
|
1872
|
+
listeners$2.add(listener);
|
|
1760
1873
|
return () => {
|
|
1761
|
-
listeners$
|
|
1874
|
+
listeners$2.delete(listener);
|
|
1762
1875
|
};
|
|
1763
1876
|
}
|
|
1764
1877
|
if (typeof window !== "undefined") window.addEventListener("storage", (event) => {
|
|
@@ -1849,18 +1962,6 @@ window.__ModuleLoader__.load({
|
|
|
1849
1962
|
border-radius: 0 !important;
|
|
1850
1963
|
}
|
|
1851
1964
|
|
|
1852
|
-
/* 彻底清除输入框底部 dock / stats 区域的半透明灰色脏色块与切线 */
|
|
1853
|
-
[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar] > [class*="dock"]:before,
|
|
1854
|
-
[data-dsh-glass] [data-phase] [data-dsh-glass-inputbar] > [data-composer-dock]:before,
|
|
1855
|
-
[data-dsh-glass] [class*="dock"]:before,
|
|
1856
|
-
[data-dsh-glass] [data-composer-dock]:before {
|
|
1857
|
-
display: none !important;
|
|
1858
|
-
content: none !important;
|
|
1859
|
-
background: transparent !important;
|
|
1860
|
-
backdrop-filter: none !important;
|
|
1861
|
-
-webkit-backdrop-filter: none !important;
|
|
1862
|
-
}
|
|
1863
|
-
|
|
1864
1965
|
/* 斜杠指令/快捷指令候选面板([data-trigger-menu] / Issue #72):
|
|
1865
1966
|
在选用自定义主题时,无论是否开启毛玻璃,提升面板材质浓度,杜绝悬浮在消息流上时的字叠字穿透 */
|
|
1866
1967
|
[data-trigger-menu] {
|
|
@@ -2185,61 +2286,7 @@ window.__ModuleLoader__.load({
|
|
|
2185
2286
|
}
|
|
2186
2287
|
];
|
|
2187
2288
|
const stylesheet$1 = `
|
|
2188
|
-
|
|
2189
|
-
box-sizing: border-box;
|
|
2190
|
-
display: flex;
|
|
2191
|
-
flex-direction: column;
|
|
2192
|
-
gap: 16px;
|
|
2193
|
-
padding: 18px 20px;
|
|
2194
|
-
background: var(--dsw-alias-bg-layer-2, #18181b);
|
|
2195
|
-
border: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08));
|
|
2196
|
-
border-radius: 12px;
|
|
2197
|
-
margin-bottom: 16px;
|
|
2198
|
-
}
|
|
2199
|
-
body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
2200
|
-
background: var(--dsw-alias-bg-layer-2, #ffffff);
|
|
2201
|
-
border-color: var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.08));
|
|
2202
|
-
}
|
|
2203
|
-
html[data-dsh-glass] .dcu-section-card {
|
|
2204
|
-
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
2205
|
-
backdrop-filter: none !important;
|
|
2206
|
-
-webkit-backdrop-filter: none !important;
|
|
2207
|
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
|
2208
|
-
}
|
|
2209
|
-
html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
2210
|
-
background: var(--dsw-alias-bg-layer-2, #ffffff) !important;
|
|
2211
|
-
box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
|
|
2212
|
-
}
|
|
2213
|
-
.dcu-section-header {
|
|
2214
|
-
display: flex;
|
|
2215
|
-
align-items: flex-start;
|
|
2216
|
-
justify-content: space-between;
|
|
2217
|
-
gap: 16px;
|
|
2218
|
-
flex-wrap: wrap;
|
|
2219
|
-
}
|
|
2220
|
-
.dcu-section-title-wrap {
|
|
2221
|
-
display: flex;
|
|
2222
|
-
flex-direction: column;
|
|
2223
|
-
gap: 4px;
|
|
2224
|
-
min-width: 0;
|
|
2225
|
-
flex: 1;
|
|
2226
|
-
}
|
|
2227
|
-
.dcu-section-title {
|
|
2228
|
-
margin: 0;
|
|
2229
|
-
font-size: 15px;
|
|
2230
|
-
font-weight: 600;
|
|
2231
|
-
line-height: 22px;
|
|
2232
|
-
color: var(--dsw-alias-label-primary);
|
|
2233
|
-
display: flex;
|
|
2234
|
-
align-items: center;
|
|
2235
|
-
gap: 8px;
|
|
2236
|
-
}
|
|
2237
|
-
.dcu-section-desc {
|
|
2238
|
-
margin: 0;
|
|
2239
|
-
font-size: 13px;
|
|
2240
|
-
line-height: 18px;
|
|
2241
|
-
color: var(--dsw-alias-label-tertiary);
|
|
2242
|
-
}
|
|
2289
|
+
${SECTION_CARD_CSS}
|
|
2243
2290
|
.dcu-theme-settings {
|
|
2244
2291
|
display: flex;
|
|
2245
2292
|
flex-direction: column;
|
|
@@ -2543,6 +2590,159 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
2543
2590
|
});
|
|
2544
2591
|
}
|
|
2545
2592
|
//#endregion
|
|
2593
|
+
//#region src/client/composer/prediction-state.ts
|
|
2594
|
+
/**
|
|
2595
|
+
* 输入预测(ghost 建议)的用户级开关。
|
|
2596
|
+
*
|
|
2597
|
+
* 设计约束:
|
|
2598
|
+
* - **只影响预测**,不牵连 `↑`/`↓` 历史召回、宽度手柄、新会话建议卡片;
|
|
2599
|
+
* - 关闭后客户端**完全不发请求**,所以不产生任何辅助模型 token 花费(不需要 Host 侧再校验一次);
|
|
2600
|
+
* - `hostAllowed` 来自 Host 状态端点:profile 的 `cordis.patch.yml` 给 `codex-ui-composer`
|
|
2601
|
+
* 配 `config: { prediction: false }` 时会被置为 `false`,此时用户开关置灰(fail-closed,
|
|
2602
|
+
* 站点管理员意志优先,等价于主题子插件的 `subPluginEnabled` 语义)。
|
|
2603
|
+
*/
|
|
2604
|
+
const PREDICTION_STORAGE_KEY = "codex-ui.composer.prediction";
|
|
2605
|
+
/** 同一窗口内跨标签页同步(storage 事件在写入方自身不触发)。 */
|
|
2606
|
+
const PREDICTION_STORAGE_EVENT = "codex-ui:prediction-change";
|
|
2607
|
+
const listeners$1 = /* @__PURE__ */ new Set();
|
|
2608
|
+
function safeGetItem(key) {
|
|
2609
|
+
try {
|
|
2610
|
+
if (typeof localStorage !== "undefined") return localStorage.getItem(key);
|
|
2611
|
+
} catch {}
|
|
2612
|
+
return null;
|
|
2613
|
+
}
|
|
2614
|
+
function safeSetItem(key, value) {
|
|
2615
|
+
try {
|
|
2616
|
+
if (typeof localStorage !== "undefined") localStorage.setItem(key, value);
|
|
2617
|
+
} catch {}
|
|
2618
|
+
}
|
|
2619
|
+
function parseStored(raw) {
|
|
2620
|
+
if (raw === "off" || raw === "false" || raw === "0") return false;
|
|
2621
|
+
return true;
|
|
2622
|
+
}
|
|
2623
|
+
let subPluginEnabled = true;
|
|
2624
|
+
let userEnabled = parseStored(safeGetItem(PREDICTION_STORAGE_KEY));
|
|
2625
|
+
let hostAllowed = true;
|
|
2626
|
+
function snapshot() {
|
|
2627
|
+
return {
|
|
2628
|
+
subPluginEnabled,
|
|
2629
|
+
userEnabled,
|
|
2630
|
+
hostAllowed,
|
|
2631
|
+
enabled: subPluginEnabled && userEnabled && hostAllowed
|
|
2632
|
+
};
|
|
2633
|
+
}
|
|
2634
|
+
let cached = snapshot();
|
|
2635
|
+
function publish() {
|
|
2636
|
+
const next = snapshot();
|
|
2637
|
+
if (next.subPluginEnabled === cached.subPluginEnabled && next.userEnabled === cached.userEnabled && next.hostAllowed === cached.hostAllowed && next.enabled === cached.enabled) return;
|
|
2638
|
+
cached = next;
|
|
2639
|
+
for (const listener of [...listeners$1]) try {
|
|
2640
|
+
listener();
|
|
2641
|
+
} catch {}
|
|
2642
|
+
}
|
|
2643
|
+
/** 稳定的只读快照,可直接交给 `useSyncExternalStore`。 */
|
|
2644
|
+
function getPredictionSettingsState() {
|
|
2645
|
+
return cached;
|
|
2646
|
+
}
|
|
2647
|
+
function subscribePredictionSettings(listener) {
|
|
2648
|
+
listeners$1.add(listener);
|
|
2649
|
+
return () => listeners$1.delete(listener);
|
|
2650
|
+
}
|
|
2651
|
+
function setPredictionEnabled(enabled) {
|
|
2652
|
+
userEnabled = enabled;
|
|
2653
|
+
safeSetItem(PREDICTION_STORAGE_KEY, enabled ? "on" : "off");
|
|
2654
|
+
publish();
|
|
2655
|
+
if (typeof window !== "undefined" && typeof window.dispatchEvent === "function") try {
|
|
2656
|
+
window.dispatchEvent(new Event(PREDICTION_STORAGE_EVENT));
|
|
2657
|
+
} catch {}
|
|
2658
|
+
}
|
|
2659
|
+
/** Host 状态端点回报的配置位;缺省视为允许。 */
|
|
2660
|
+
function setHostPredictionAllowed(allowed) {
|
|
2661
|
+
hostAllowed = allowed;
|
|
2662
|
+
publish();
|
|
2663
|
+
}
|
|
2664
|
+
/** 标记 codex-ui-composer 子插件在 Host 侧的启用状态;未启用时设置卡片不渲染(对齐主题卡片)。 */
|
|
2665
|
+
function setSubPluginEnabled(enabled) {
|
|
2666
|
+
subPluginEnabled = enabled;
|
|
2667
|
+
publish();
|
|
2668
|
+
}
|
|
2669
|
+
/** 监听跨标签页与同窗口的设置变更。返回卸载函数。 */
|
|
2670
|
+
function observePredictionSettings() {
|
|
2671
|
+
if (typeof window === "undefined") return () => {};
|
|
2672
|
+
const onStorage = (event) => {
|
|
2673
|
+
if (event.key !== null && event.key !== "codex-ui.composer.prediction") return;
|
|
2674
|
+
userEnabled = parseStored(safeGetItem(PREDICTION_STORAGE_KEY));
|
|
2675
|
+
publish();
|
|
2676
|
+
};
|
|
2677
|
+
const onLocal = () => {
|
|
2678
|
+
userEnabled = parseStored(safeGetItem(PREDICTION_STORAGE_KEY));
|
|
2679
|
+
publish();
|
|
2680
|
+
};
|
|
2681
|
+
window.addEventListener("storage", onStorage);
|
|
2682
|
+
window.addEventListener(PREDICTION_STORAGE_EVENT, onLocal);
|
|
2683
|
+
return () => {
|
|
2684
|
+
window.removeEventListener("storage", onStorage);
|
|
2685
|
+
window.removeEventListener(PREDICTION_STORAGE_EVENT, onLocal);
|
|
2686
|
+
};
|
|
2687
|
+
}
|
|
2688
|
+
//#endregion
|
|
2689
|
+
//#region src/client/composer/ComposerSettingsCard.tsx
|
|
2690
|
+
/**
|
|
2691
|
+
* 输入框增强设置卡片。
|
|
2692
|
+
*
|
|
2693
|
+
* 只放预测开关:其他能力(↑/↓ 历史、宽度手柄、建议卡片)没有可调项,
|
|
2694
|
+
* 用不到就不渲染成灰项,遵循插件「不残留死配置」的既有约定。
|
|
2695
|
+
*
|
|
2696
|
+
* 站点级关闭(profile `cordis.patch.yml` 里 `config: { prediction: false }`)时,
|
|
2697
|
+
* 开关保持可见但置为关闭且禁用,并给出原因提示——比整卡消失更容易排查。
|
|
2698
|
+
*/
|
|
2699
|
+
function ComposerSettingsCard({ t }) {
|
|
2700
|
+
const state = (0, react.useSyncExternalStore)(subscribePredictionSettings, getPredictionSettingsState, getPredictionSettingsState);
|
|
2701
|
+
if (!state.subPluginEnabled) return null;
|
|
2702
|
+
const lockedByHost = !state.hostAllowed;
|
|
2703
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2704
|
+
className: "dcu-section-card dcu-composer-settings",
|
|
2705
|
+
"aria-label": t("composer.title"),
|
|
2706
|
+
children: [
|
|
2707
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("style", { children: SECTION_CARD_CSS + SETTINGS_ROW_CSS }),
|
|
2708
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
2709
|
+
className: "dcu-section-header",
|
|
2710
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2711
|
+
className: "dcu-section-title-wrap",
|
|
2712
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
|
|
2713
|
+
className: "dcu-section-title",
|
|
2714
|
+
children: t("composer.title")
|
|
2715
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
2716
|
+
className: "dcu-section-desc",
|
|
2717
|
+
children: t("composer.desc")
|
|
2718
|
+
})]
|
|
2719
|
+
})
|
|
2720
|
+
}),
|
|
2721
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2722
|
+
className: "dcu-settings-row",
|
|
2723
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2724
|
+
className: "dcu-settings-row-label",
|
|
2725
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2726
|
+
className: "dcu-settings-row-title",
|
|
2727
|
+
children: t("composer.prediction")
|
|
2728
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
2729
|
+
className: "dcu-settings-row-hint",
|
|
2730
|
+
children: lockedByHost ? t("composer.predictionLocked") : t("composer.predictionHint")
|
|
2731
|
+
})]
|
|
2732
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Switch, {
|
|
2733
|
+
label: t("composer.prediction"),
|
|
2734
|
+
checked: state.enabled,
|
|
2735
|
+
disabled: lockedByHost,
|
|
2736
|
+
onChange: (checked) => {
|
|
2737
|
+
if (lockedByHost) return;
|
|
2738
|
+
setPredictionEnabled(checked);
|
|
2739
|
+
}
|
|
2740
|
+
})]
|
|
2741
|
+
})
|
|
2742
|
+
]
|
|
2743
|
+
});
|
|
2744
|
+
}
|
|
2745
|
+
//#endregion
|
|
2546
2746
|
//#region src/client/AboutSection.tsx
|
|
2547
2747
|
const PROJECT_HOMEPAGES = Object.fromEntries(MANAGED_DEPENDENCIES.map(({ id, packageName }) => [id, id === "market" ? "https://dshmarket.com" : `https://github.com/MichengAI/${packageName.split("/")[1]}`]));
|
|
2548
2748
|
const openExternal = (url) => {
|
|
@@ -2931,6 +3131,7 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
2931
3131
|
]
|
|
2932
3132
|
}),
|
|
2933
3133
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ThemeSettingsCard, { t }),
|
|
3134
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerSettingsCard, { t }),
|
|
2934
3135
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
2935
3136
|
className: "dcu-section-card dcu-card-dependencies",
|
|
2936
3137
|
children: [
|
|
@@ -3230,6 +3431,11 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
3230
3431
|
"sidebar.browsePlugins": "浏览更多插件",
|
|
3231
3432
|
"sidebar.createPlugin": "创建你的插件",
|
|
3232
3433
|
"sidebar.createPrompt": "创建一个带左侧栏入口的 DSH 插件。",
|
|
3434
|
+
"composer.title": "输入框增强",
|
|
3435
|
+
"composer.desc": "智能输入预测与行内续写;其他输入框能力(↑/↓ 历史、宽度手柄)不受影响。",
|
|
3436
|
+
"composer.prediction": "智能输入预测",
|
|
3437
|
+
"composer.predictionHint": "打字停顿时在光标后提示后续内容,按 Tab 采纳;关闭后不再发起任何请求,也不消耗模型额度。",
|
|
3438
|
+
"composer.predictionLocked": "已在当前 Profile 的插件配置中关闭(cordis.patch.yml → codex-ui-composer 的 prediction),此处不可开启。",
|
|
3233
3439
|
"theme.title": "界面外观与换肤",
|
|
3234
3440
|
"theme.desc": "定制 DeepSeek Harness 视觉风格,支持 Codex 经典配色与悬浮云母质感。",
|
|
3235
3441
|
"theme.palette": "主题配色",
|
|
@@ -3419,6 +3625,11 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card{background
|
|
|
3419
3625
|
"sidebar.browsePlugins": "Browse other plugins",
|
|
3420
3626
|
"sidebar.createPlugin": "Create your plugin",
|
|
3421
3627
|
"sidebar.createPrompt": "Create a DSH plugin with a left sidebar entry.",
|
|
3628
|
+
"composer.title": "Composer Enhancements",
|
|
3629
|
+
"composer.desc": "Inline prediction and continuation for the composer; other composer features (↑/↓ history, width handles) are unaffected.",
|
|
3630
|
+
"composer.prediction": "Inline prediction",
|
|
3631
|
+
"composer.predictionHint": "Suggests what comes next at the caret after a typing pause; press Tab to accept. Turning it off stops all requests, so no model tokens are spent.",
|
|
3632
|
+
"composer.predictionLocked": "Disabled by this Profile's plugin config (cordis.patch.yml → codex-ui-composer prediction); it cannot be enabled here.",
|
|
3422
3633
|
"theme.title": "Appearance & Themes",
|
|
3423
3634
|
"theme.desc": "Customize DeepSeek Harness visual styling with Codex themes and frosted mica glass.",
|
|
3424
3635
|
"theme.palette": "Theme Palette",
|
|
@@ -4009,29 +4220,29 @@ html[data-platform="darwin"]:not([data-fullscreen]) [data-shortcut-modal="settin
|
|
|
4009
4220
|
height: calc(100vh - var(--dsh-frame-top-clearance, 38px)) !important;
|
|
4010
4221
|
}
|
|
4011
4222
|
|
|
4012
|
-
/*
|
|
4223
|
+
/* 左侧整列侧栏:与首页侧栏严格等宽,底色统合对齐 --dsw-alias-bg-layer-2,杜绝与右侧工作区产生色差断层 */
|
|
4013
4224
|
[data-shortcut-modal="settings"] > nav {
|
|
4014
4225
|
box-sizing: border-box !important;
|
|
4015
4226
|
width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4016
4227
|
min-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4017
4228
|
max-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4018
4229
|
flex-shrink: 0 !important;
|
|
4019
|
-
gap:
|
|
4230
|
+
gap: 0 !important;
|
|
4020
4231
|
padding: 16px 12px 24px !important;
|
|
4021
4232
|
border-right: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08)) !important;
|
|
4022
|
-
background: var(--dsw-
|
|
4233
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4023
4234
|
overflow: hidden !important;
|
|
4024
4235
|
display: flex !important;
|
|
4025
4236
|
flex-direction: column !important;
|
|
4026
4237
|
}
|
|
4027
4238
|
|
|
4028
|
-
/*
|
|
4239
|
+
/* 设置工作台必须使用实色不透明底板,左右两栏整体浑然一体 */
|
|
4029
4240
|
[data-shortcut-modal="settings"] {
|
|
4030
|
-
background: var(--dsw-alias-bg-
|
|
4241
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4031
4242
|
}
|
|
4032
4243
|
|
|
4033
4244
|
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
4034
|
-
background: var(--dsw-alias-bg-
|
|
4245
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4035
4246
|
}
|
|
4036
4247
|
|
|
4037
4248
|
/* 浅色模式全局兜底:浅底高对比度规范,绝不允许残留或回退暗黑色 */
|
|
@@ -4108,7 +4319,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="
|
|
|
4108
4319
|
border-radius: 16px !important;
|
|
4109
4320
|
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4110
4321
|
box-shadow: var(--dsh-glass-drop, 0 8px 24px rgba(0, 0, 0, 0.08)), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
|
|
4111
|
-
background: var(--
|
|
4322
|
+
background: var(--dsw-alias-bg-layer-2, var(--dsh-glass-card, #18181b)) !important;
|
|
4112
4323
|
backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
4113
4324
|
-webkit-backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
4114
4325
|
overflow: hidden !important;
|
|
@@ -4122,7 +4333,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="
|
|
|
4122
4333
|
border-radius: 16px !important;
|
|
4123
4334
|
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4124
4335
|
box-shadow: var(--dsh-glass-drop, 0 8px 24px rgba(0, 0, 0, 0.08)), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
|
|
4125
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
4336
|
+
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
4126
4337
|
backdrop-filter: none !important;
|
|
4127
4338
|
-webkit-backdrop-filter: none !important;
|
|
4128
4339
|
overflow: hidden !important;
|
|
@@ -4133,12 +4344,12 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="
|
|
|
4133
4344
|
height: 48px !important;
|
|
4134
4345
|
min-height: 48px !important;
|
|
4135
4346
|
padding: 0 24px !important;
|
|
4136
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
4347
|
+
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
4137
4348
|
}
|
|
4138
4349
|
|
|
4139
4350
|
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
4140
|
-
padding: 16px
|
|
4141
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
4351
|
+
padding: 16px 32px 48px !important;
|
|
4352
|
+
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
4142
4353
|
}
|
|
4143
4354
|
|
|
4144
4355
|
html[data-platform="darwin"] [data-shortcut-modal="settings"] > nav {
|
|
@@ -4179,7 +4390,7 @@ html[data-platform="darwin"] [data-shortcut-modal="settings"] > nav {
|
|
|
4179
4390
|
|
|
4180
4391
|
.dcu-settings-back-btn,
|
|
4181
4392
|
button.dcu-settings-back-btn,
|
|
4182
|
-
[data-shortcut-modal="settings"] nav button.dcu-settings-back-btn {
|
|
4393
|
+
[data-shortcut-modal="settings"] > nav button.dcu-settings-back-btn {
|
|
4183
4394
|
display: inline-flex !important;
|
|
4184
4395
|
align-items: center !important;
|
|
4185
4396
|
justify-content: center !important;
|
|
@@ -4201,7 +4412,7 @@ button.dcu-settings-back-btn,
|
|
|
4201
4412
|
|
|
4202
4413
|
.dcu-settings-back-btn:hover,
|
|
4203
4414
|
button.dcu-settings-back-btn:hover,
|
|
4204
|
-
[data-shortcut-modal="settings"] nav button.dcu-settings-back-btn:hover {
|
|
4415
|
+
[data-shortcut-modal="settings"] > nav button.dcu-settings-back-btn:hover {
|
|
4205
4416
|
background: var(--dsw-alias-interactive-bg-hover, rgba(255, 255, 255, 0.06)) !important;
|
|
4206
4417
|
color: var(--dsw-alias-label-primary, #ffffff) !important;
|
|
4207
4418
|
}
|
|
@@ -4261,7 +4472,7 @@ button.dcu-settings-back-btn:hover,
|
|
|
4261
4472
|
}
|
|
4262
4473
|
|
|
4263
4474
|
/* 导航项列表容器 */
|
|
4264
|
-
[data-shortcut-modal="settings"] nav [class*="navList"],
|
|
4475
|
+
[data-shortcut-modal="settings"] > nav [class*="navList"],
|
|
4265
4476
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) {
|
|
4266
4477
|
display: flex !important;
|
|
4267
4478
|
flex-direction: column !important;
|
|
@@ -4298,7 +4509,7 @@ button.dcu-settings-back-btn:hover,
|
|
|
4298
4509
|
}
|
|
4299
4510
|
|
|
4300
4511
|
/* 导航项按钮:Codex 原生胶囊形态(Capsule) */
|
|
4301
|
-
[data-shortcut-modal="settings"] nav button,
|
|
4512
|
+
[data-shortcut-modal="settings"] > nav button,
|
|
4302
4513
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button {
|
|
4303
4514
|
box-sizing: border-box !important;
|
|
4304
4515
|
display: flex !important;
|
|
@@ -4319,7 +4530,7 @@ button.dcu-settings-back-btn:hover,
|
|
|
4319
4530
|
width: 100% !important;
|
|
4320
4531
|
}
|
|
4321
4532
|
|
|
4322
|
-
[data-shortcut-modal="settings"] nav button svg,
|
|
4533
|
+
[data-shortcut-modal="settings"] > nav button svg,
|
|
4323
4534
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button svg {
|
|
4324
4535
|
width: 16px !important;
|
|
4325
4536
|
height: 16px !important;
|
|
@@ -4329,21 +4540,21 @@ button.dcu-settings-back-btn:hover,
|
|
|
4329
4540
|
transition: color 0.12s ease !important;
|
|
4330
4541
|
}
|
|
4331
4542
|
|
|
4332
|
-
[data-shortcut-modal="settings"] nav button:hover,
|
|
4543
|
+
[data-shortcut-modal="settings"] > nav button:hover,
|
|
4333
4544
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button:hover {
|
|
4334
4545
|
background: var(--dsw-specific-sidebar-nav-item-hover, var(--dsw-alias-interactive-bg-hover, rgba(255, 255, 255, 0.05))) !important;
|
|
4335
4546
|
color: var(--dsw-alias-label-primary, #ffffff) !important;
|
|
4336
4547
|
}
|
|
4337
4548
|
|
|
4338
|
-
[data-shortcut-modal="settings"] nav button:hover svg,
|
|
4549
|
+
[data-shortcut-modal="settings"] > nav button:hover svg,
|
|
4339
4550
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button:hover svg {
|
|
4340
4551
|
color: var(--dsw-alias-label-primary, #ffffff) !important;
|
|
4341
4552
|
}
|
|
4342
4553
|
|
|
4343
4554
|
/* 选中菜单项:纯正 Codex 胶囊激活态(Capsule Pill) */
|
|
4344
|
-
[data-shortcut-modal="settings"] nav button[aria-current="true"],
|
|
4345
|
-
[data-shortcut-modal="settings"] nav button[class*="active"],
|
|
4346
|
-
[data-shortcut-modal="settings"] nav [class*="navCell"][class*="active"],
|
|
4555
|
+
[data-shortcut-modal="settings"] > nav button[aria-current="true"],
|
|
4556
|
+
[data-shortcut-modal="settings"] > nav button[class*="active"],
|
|
4557
|
+
[data-shortcut-modal="settings"] > nav [class*="navCell"][class*="active"],
|
|
4347
4558
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button[aria-current="true"],
|
|
4348
4559
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button[class*="active"] {
|
|
4349
4560
|
background: var(--dsw-specific-sidebar-nav-item-active, var(--dsw-alias-interactive-bg-selected, rgba(255, 255, 255, 0.10))) !important;
|
|
@@ -4351,15 +4562,15 @@ button.dcu-settings-back-btn:hover,
|
|
|
4351
4562
|
font-weight: 500 !important;
|
|
4352
4563
|
}
|
|
4353
4564
|
|
|
4354
|
-
[data-shortcut-modal="settings"] nav button[aria-current="true"] svg,
|
|
4355
|
-
[data-shortcut-modal="settings"] nav button[class*="active"] svg,
|
|
4356
|
-
[data-shortcut-modal="settings"] nav [class*="navCell"][class*="active"] svg,
|
|
4565
|
+
[data-shortcut-modal="settings"] > nav button[aria-current="true"] svg,
|
|
4566
|
+
[data-shortcut-modal="settings"] > nav button[class*="active"] svg,
|
|
4567
|
+
[data-shortcut-modal="settings"] > nav [class*="navCell"][class*="active"] svg,
|
|
4357
4568
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button[aria-current="true"] svg,
|
|
4358
4569
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button[class*="active"] svg {
|
|
4359
4570
|
color: var(--dsw-alias-label-primary, #ffffff) !important;
|
|
4360
4571
|
}
|
|
4361
4572
|
|
|
4362
|
-
[data-shortcut-modal="settings"] nav button:focus-visible,
|
|
4573
|
+
[data-shortcut-modal="settings"] > nav button:focus-visible,
|
|
4363
4574
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button:focus-visible {
|
|
4364
4575
|
outline: 2px solid var(--dsw-alias-state-focus-ring, var(--dsw-static-deepseek-500, #4176e6)) !important;
|
|
4365
4576
|
outline-offset: 1px !important;
|
|
@@ -4411,11 +4622,11 @@ button.dcu-settings-back-btn:hover,
|
|
|
4411
4622
|
min-height: 0 !important;
|
|
4412
4623
|
flex: 1 1 auto !important;
|
|
4413
4624
|
overflow-y: auto !important;
|
|
4414
|
-
padding: 32px 48px
|
|
4625
|
+
padding: 24px 32px 48px !important;
|
|
4415
4626
|
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4416
4627
|
display: flex !important;
|
|
4417
4628
|
flex-direction: column !important;
|
|
4418
|
-
align-items:
|
|
4629
|
+
align-items: stretch !important;
|
|
4419
4630
|
}
|
|
4420
4631
|
|
|
4421
4632
|
/* 浅色模式右侧内容区实色与文字按钮高对比度兜底 */
|
|
@@ -4451,7 +4662,9 @@ html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [
|
|
|
4451
4662
|
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
4452
4663
|
}
|
|
4453
4664
|
|
|
4454
|
-
/*
|
|
4665
|
+
/* 右侧设置区固定宽度规范:卡片先吃满列宽、再被 800px 夹住,左右留白相等(不会出现单侧空洞)。
|
|
4666
|
+
实测(scripts/verify-settings-geometry.mjs,1400px 面板):卡片宽 800px、左右各 260px —
|
|
4667
|
+
即「居中收束」而不是贴左;若要改成贴左,需同时去掉下面的 margin-inline: auto。 */
|
|
4455
4668
|
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) > * {
|
|
4456
4669
|
width: 100% !important;
|
|
4457
4670
|
max-width: 800px !important;
|
|
@@ -4488,10 +4701,10 @@ html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [
|
|
|
4488
4701
|
width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4489
4702
|
min-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4490
4703
|
max-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4491
|
-
background: var(--dsw-
|
|
4704
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4492
4705
|
border-right: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08)) !important;
|
|
4493
4706
|
border-bottom: none !important;
|
|
4494
|
-
padding: 16px 12px
|
|
4707
|
+
padding: 16px 12px 8px 12px !important;
|
|
4495
4708
|
margin: 0 !important;
|
|
4496
4709
|
height: auto !important;
|
|
4497
4710
|
flex: none !important;
|
|
@@ -4504,10 +4717,10 @@ html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [
|
|
|
4504
4717
|
width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4505
4718
|
min-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4506
4719
|
max-width: var(--dcu-settings-nav-width, 280px) !important;
|
|
4507
|
-
background: var(--dsw-
|
|
4720
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4508
4721
|
border-right: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.08)) !important;
|
|
4509
4722
|
border-top: none !important;
|
|
4510
|
-
padding: 0 12px 24px !important;
|
|
4723
|
+
padding: 0 12px 24px 12px !important;
|
|
4511
4724
|
margin: 0 !important;
|
|
4512
4725
|
overflow-y: auto !important;
|
|
4513
4726
|
height: 100% !important;
|
|
@@ -4549,13 +4762,13 @@ html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [
|
|
|
4549
4762
|
box-sizing: border-box !important;
|
|
4550
4763
|
min-height: 0 !important;
|
|
4551
4764
|
overflow-y: auto !important;
|
|
4552
|
-
padding-top: calc(56px +
|
|
4553
|
-
padding-bottom:
|
|
4554
|
-
padding-inline:
|
|
4765
|
+
padding-top: calc(56px + 20px) !important;
|
|
4766
|
+
padding-bottom: 48px !important;
|
|
4767
|
+
padding-inline: 32px !important;
|
|
4555
4768
|
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4556
4769
|
display: flex !important;
|
|
4557
4770
|
flex-direction: column !important;
|
|
4558
|
-
align-items:
|
|
4771
|
+
align-items: stretch !important;
|
|
4559
4772
|
margin: 0 !important;
|
|
4560
4773
|
height: 100% !important;
|
|
4561
4774
|
flex: none !important;
|
|
@@ -4613,12 +4826,13 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:has(> [class*="optio
|
|
|
4613
4826
|
min-width: 0 !important;
|
|
4614
4827
|
max-width: none !important;
|
|
4615
4828
|
margin: 0 !important;
|
|
4829
|
+
padding: 16px 12px 8px 12px !important;
|
|
4616
4830
|
border-right: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4617
4831
|
border-left: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4618
4832
|
border-top: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4619
4833
|
border-bottom: none !important;
|
|
4620
4834
|
border-radius: 16px 16px 0 0 !important;
|
|
4621
|
-
background: var(--dsw-
|
|
4835
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4622
4836
|
backdrop-filter: none !important;
|
|
4623
4837
|
-webkit-backdrop-filter: none !important;
|
|
4624
4838
|
box-shadow: none !important;
|
|
@@ -4629,12 +4843,13 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:has(> [class*="optio
|
|
|
4629
4843
|
min-width: 0 !important;
|
|
4630
4844
|
max-width: none !important;
|
|
4631
4845
|
margin: 0 !important;
|
|
4846
|
+
padding: 0 12px 24px 12px !important;
|
|
4632
4847
|
border-right: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4633
4848
|
border-left: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4634
4849
|
border-bottom: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4635
4850
|
border-top: none !important;
|
|
4636
4851
|
border-radius: 0 0 16px 16px !important;
|
|
4637
|
-
background: var(--dsw-
|
|
4852
|
+
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
4638
4853
|
backdrop-filter: none !important;
|
|
4639
4854
|
-webkit-backdrop-filter: none !important;
|
|
4640
4855
|
box-shadow: var(--dsh-glass-drop, 0 8px 24px rgba(0, 0, 0, 0.08)) !important;
|
|
@@ -4677,11 +4892,11 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"]:has(> [class*="optio
|
|
|
4677
4892
|
margin: 0 !important;
|
|
4678
4893
|
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
4679
4894
|
border-radius: 16px !important;
|
|
4680
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
4895
|
+
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
4681
4896
|
box-shadow: var(--dsh-glass-drop, 0 8px 24px rgba(0, 0, 0, 0.08)), inset 0 1px 0 rgba(255, 255, 255, 0.6) !important;
|
|
4682
|
-
padding-top: calc(56px +
|
|
4897
|
+
padding-top: calc(56px + 20px) !important;
|
|
4683
4898
|
padding-bottom: 48px !important;
|
|
4684
|
-
padding-inline:
|
|
4899
|
+
padding-inline: 32px !important;
|
|
4685
4900
|
}
|
|
4686
4901
|
|
|
4687
4902
|
/* 无论窗口 <=768px 还是处于收起态 [data-sidebar-collapsed],结构尺寸均收敛为 56px 导轨 */
|
|
@@ -4922,7 +5137,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
4922
5137
|
max-height: 100% !important;
|
|
4923
5138
|
}
|
|
4924
5139
|
|
|
4925
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav::-webkit-scrollbar,
|
|
5140
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav::-webkit-scrollbar,
|
|
4926
5141
|
[data-shortcut-modal="settings"][data-sidebar-collapsed] [class*="navList"]::-webkit-scrollbar {
|
|
4927
5142
|
display: none !important;
|
|
4928
5143
|
width: 0 !important;
|
|
@@ -5012,9 +5227,9 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5012
5227
|
}
|
|
5013
5228
|
|
|
5014
5229
|
/* 导航项按钮:纯图标居中方块,对齐宿主官方首页折叠 36x36px panelRow,绝对居中无偏移 */
|
|
5015
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav button,
|
|
5230
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav button,
|
|
5016
5231
|
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav > :nth-child(2) > button,
|
|
5017
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav [class*="navCell"] {
|
|
5232
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav [class*="navCell"] {
|
|
5018
5233
|
box-sizing: border-box !important;
|
|
5019
5234
|
width: 36px !important;
|
|
5020
5235
|
height: 36px !important;
|
|
@@ -5033,8 +5248,8 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5033
5248
|
}
|
|
5034
5249
|
|
|
5035
5250
|
/* 仅隐藏设置菜单列表中的文字标签,绝不干涉任何图标的显示规则,100%继承展开态既定图标状态! */
|
|
5036
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav [class*="navList"] button [class*="navLabel"],
|
|
5037
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav button:not(.dcu-settings-back-btn) [class*="navLabel"] {
|
|
5251
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav [class*="navList"] button [class*="navLabel"],
|
|
5252
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav button:not(.dcu-settings-back-btn) [class*="navLabel"] {
|
|
5038
5253
|
display: none !important;
|
|
5039
5254
|
}
|
|
5040
5255
|
|
|
@@ -5065,8 +5280,8 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5065
5280
|
}
|
|
5066
5281
|
|
|
5067
5282
|
/* 无论官方项目还是第三方插件,每个按钮在折叠态均保持唯一的视觉中心,不强行干涉内部已隐藏的备用 svg */
|
|
5068
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav [class*="navList"] button svg,
|
|
5069
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed] nav [class*="navIcon"] svg {
|
|
5283
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav [class*="navList"] button svg,
|
|
5284
|
+
[data-shortcut-modal="settings"][data-sidebar-collapsed] > nav [class*="navIcon"] svg {
|
|
5070
5285
|
margin: 0 !important;
|
|
5071
5286
|
padding: 0 !important;
|
|
5072
5287
|
width: 18px !important;
|
|
@@ -5378,7 +5593,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5378
5593
|
-ms-overflow-style: none !important;
|
|
5379
5594
|
}
|
|
5380
5595
|
|
|
5381
|
-
[data-shortcut-modal="settings"] nav::-webkit-scrollbar,
|
|
5596
|
+
[data-shortcut-modal="settings"] > nav::-webkit-scrollbar,
|
|
5382
5597
|
[data-shortcut-modal="settings"] [class*="navList"]::-webkit-scrollbar {
|
|
5383
5598
|
display: none !important;
|
|
5384
5599
|
width: 0 !important;
|
|
@@ -5386,9 +5601,9 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5386
5601
|
}
|
|
5387
5602
|
|
|
5388
5603
|
/* 导航项按钮:纯图标正方形居中卡片,尺寸统一为 36x36px 图标导轨 */
|
|
5389
|
-
[data-shortcut-modal="settings"] nav button,
|
|
5604
|
+
[data-shortcut-modal="settings"] > nav button,
|
|
5390
5605
|
[data-shortcut-modal="settings"] > nav > :nth-child(2) > button,
|
|
5391
|
-
[data-shortcut-modal="settings"] nav [class*="navCell"] {
|
|
5606
|
+
[data-shortcut-modal="settings"] > nav [class*="navCell"] {
|
|
5392
5607
|
width: 36px !important;
|
|
5393
5608
|
height: 36px !important;
|
|
5394
5609
|
min-width: 36px !important;
|
|
@@ -5403,14 +5618,14 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5403
5618
|
}
|
|
5404
5619
|
|
|
5405
5620
|
/* 隐藏菜单项文字标签,保留居中图标,保护返回按钮 */
|
|
5406
|
-
[data-shortcut-modal="settings"] nav [class*="navList"] button [class*="navLabel"],
|
|
5407
|
-
[data-shortcut-modal="settings"] nav button:not(.dcu-settings-back-btn) [class*="navLabel"] {
|
|
5621
|
+
[data-shortcut-modal="settings"] > nav [class*="navList"] button [class*="navLabel"],
|
|
5622
|
+
[data-shortcut-modal="settings"] > nav button:not(.dcu-settings-back-btn) [class*="navLabel"] {
|
|
5408
5623
|
display: none !important;
|
|
5409
5624
|
}
|
|
5410
5625
|
|
|
5411
5626
|
/* 移动端媒体查询下同样仅隐藏文字,不干涉图标 */
|
|
5412
|
-
[data-shortcut-modal="settings"] nav [class*="navList"] button svg,
|
|
5413
|
-
[data-shortcut-modal="settings"] nav [class*="navIcon"] svg {
|
|
5627
|
+
[data-shortcut-modal="settings"] > nav [class*="navList"] button svg,
|
|
5628
|
+
[data-shortcut-modal="settings"] > nav [class*="navIcon"] svg {
|
|
5414
5629
|
margin: 0 !important;
|
|
5415
5630
|
width: 18px !important;
|
|
5416
5631
|
height: 18px !important;
|
|
@@ -5687,9 +5902,18 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5687
5902
|
emptyTip.textContent = isZh ? zh["settings.noResults"] : en["settings.noResults"];
|
|
5688
5903
|
navList.appendChild(emptyTip);
|
|
5689
5904
|
}
|
|
5905
|
+
const getNavButtonLabel = (btn) => {
|
|
5906
|
+
const labelEl = btn.querySelector("[class*=\"navLabel\"]");
|
|
5907
|
+
if (labelEl && labelEl.textContent?.trim()) return labelEl.textContent.trim();
|
|
5908
|
+
const textSpan = btn.querySelector("span:not([class*=\"navIcon\"])");
|
|
5909
|
+
if (textSpan && textSpan.textContent?.trim()) return textSpan.textContent.trim();
|
|
5910
|
+
const allSpans = btn.querySelectorAll("span");
|
|
5911
|
+
for (const s of allSpans) if (s.textContent?.trim() && !s.className?.includes("navIcon")) return s.textContent.trim();
|
|
5912
|
+
return btn.textContent?.trim() ?? "";
|
|
5913
|
+
};
|
|
5690
5914
|
const classifyButtons = () => {
|
|
5691
5915
|
navList.querySelectorAll(":scope > button").forEach((btn, index) => {
|
|
5692
|
-
const group = classifySettingsButton(
|
|
5916
|
+
const group = classifySettingsButton(getNavButtonLabel(btn));
|
|
5693
5917
|
const baseOrder = group === "personal" ? 100 : group === "records" ? 300 : 200;
|
|
5694
5918
|
btn.style.setProperty("order", String(baseOrder + 1 + index));
|
|
5695
5919
|
btn.setAttribute("data-dcu-group", group);
|
|
@@ -5701,7 +5925,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5701
5925
|
const buttons = navList.querySelectorAll(":scope > button");
|
|
5702
5926
|
let totalVisible = 0;
|
|
5703
5927
|
for (const btn of buttons) {
|
|
5704
|
-
const label = (btn
|
|
5928
|
+
const label = getNavButtonLabel(btn).toLowerCase();
|
|
5705
5929
|
if (trimmed === "") {
|
|
5706
5930
|
btn.style.removeProperty("display");
|
|
5707
5931
|
totalVisible += 1;
|
|
@@ -5713,8 +5937,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5713
5937
|
for (const group of SETTINGS_NAV_GROUPS) {
|
|
5714
5938
|
const header = navList.querySelector(`[data-dcu-group-header="${group.id}"]`);
|
|
5715
5939
|
if (header) {
|
|
5716
|
-
if (
|
|
5717
|
-
else if ([...navList.querySelectorAll(`button[data-dcu-group="${group.id}"]`)].filter((b) => b.style.display !== "none").length > 0) header.style.removeProperty("display");
|
|
5940
|
+
if ([...navList.querySelectorAll(`button[data-dcu-group="${group.id}"]`)].filter((b) => b.style.display !== "none").length > 0) header.style.removeProperty("display");
|
|
5718
5941
|
else header.style.setProperty("display", "none", "important");
|
|
5719
5942
|
}
|
|
5720
5943
|
}
|
|
@@ -5806,8 +6029,38 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5806
6029
|
* 遵循与 dshmarket / dsh-automation 一致的非侵入式属性标记与 CSS mask 伪元素标准。
|
|
5807
6030
|
*/
|
|
5808
6031
|
const CODEX_UI_NAV_MARKER = "data-dcu-nav-icon";
|
|
5809
|
-
const NAV_ROW_SELECTOR = "[role=\"dialog\"] nav button, [data-shortcut-modal=\"settings\"] nav button";
|
|
6032
|
+
const NAV_ROW_SELECTOR = "[role=\"dialog\"] > nav button, [data-shortcut-modal=\"settings\"] > nav button";
|
|
5810
6033
|
const STYLE_ID$3 = "dcu-settings-nav-icon-style";
|
|
6034
|
+
/** 原生 settings.section.icon 插槽图标组件 */
|
|
6035
|
+
function CodexUiNavIcon({ size = 16 }) {
|
|
6036
|
+
return react.default.createElement("svg", {
|
|
6037
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
6038
|
+
viewBox: "0 0 16 16",
|
|
6039
|
+
width: size,
|
|
6040
|
+
height: size,
|
|
6041
|
+
fill: "none",
|
|
6042
|
+
stroke: "currentColor",
|
|
6043
|
+
strokeWidth: 1.3,
|
|
6044
|
+
strokeLinecap: "round",
|
|
6045
|
+
strokeLinejoin: "round"
|
|
6046
|
+
}, react.default.createElement("rect", {
|
|
6047
|
+
x: 1.5,
|
|
6048
|
+
y: 2,
|
|
6049
|
+
width: 13,
|
|
6050
|
+
height: 12,
|
|
6051
|
+
rx: 2
|
|
6052
|
+
}), react.default.createElement("line", {
|
|
6053
|
+
x1: 5.5,
|
|
6054
|
+
y1: 2,
|
|
6055
|
+
x2: 5.5,
|
|
6056
|
+
y2: 14
|
|
6057
|
+
}), react.default.createElement("line", {
|
|
6058
|
+
x1: 5.5,
|
|
6059
|
+
y1: 5.5,
|
|
6060
|
+
x2: 14.5,
|
|
6061
|
+
y2: 5.5
|
|
6062
|
+
}));
|
|
6063
|
+
}
|
|
5811
6064
|
const ICON_MASK_URL = `url("data:image/svg+xml,${encodeURIComponent("<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 16 16\"><rect x=\"1.5\" y=\"2\" width=\"13\" height=\"12\" rx=\"2\" stroke=\"black\" stroke-width=\"1.3\" fill=\"none\"/><line x1=\"5.5\" y1=\"2\" x2=\"5.5\" y2=\"14\" stroke=\"black\" stroke-width=\"1.3\"/><line x1=\"5.5\" y1=\"5.5\" x2=\"14.5\" y2=\"5.5\" stroke=\"black\" stroke-width=\"1.3\"/></svg>")}")`;
|
|
5812
6065
|
const NAV_ICON_CSS = `
|
|
5813
6066
|
[${CODEX_UI_NAV_MARKER}="codex-ui"] > svg { display: none !important; }
|
|
@@ -5838,8 +6091,17 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
5838
6091
|
const normalized = text.replace(/\s+/g, " ").trim().toLowerCase();
|
|
5839
6092
|
return normalized === getLabel().trim().toLowerCase() || normalized === "codex ui";
|
|
5840
6093
|
}
|
|
6094
|
+
/** 把「Codex UI」设置项按钮切到原生插槽图标之外的自绘 icon(属性标记 + CSS mask)。
|
|
6095
|
+
* 返回值表示「本次调用改动了该按钮的状态」(打上或移除了标记),供调用方做变更统计。 */
|
|
5841
6096
|
function applyNavIcon(button, getLabel) {
|
|
5842
6097
|
if (matchesLabel(button.textContent ?? "", getLabel)) {
|
|
6098
|
+
if (Boolean(button.querySelector?.("span[class*=\"navIcon\"]"))) {
|
|
6099
|
+
if (button.getAttribute("data-dcu-nav-icon") === "codex-ui") {
|
|
6100
|
+
button.removeAttribute(CODEX_UI_NAV_MARKER);
|
|
6101
|
+
return true;
|
|
6102
|
+
}
|
|
6103
|
+
return false;
|
|
6104
|
+
}
|
|
5843
6105
|
if (button.getAttribute("data-dcu-nav-icon") === "codex-ui") return false;
|
|
5844
6106
|
ensureStyle(button.ownerDocument ?? document);
|
|
5845
6107
|
button.setAttribute(CODEX_UI_NAV_MARKER, "codex-ui");
|
|
@@ -7165,17 +7427,30 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
7165
7427
|
return;
|
|
7166
7428
|
}
|
|
7167
7429
|
}
|
|
7168
|
-
/**
|
|
7169
|
-
|
|
7430
|
+
/**
|
|
7431
|
+
* 读取 Host 状态:子插件是否启用,以及站点级是否允许预测。
|
|
7432
|
+
* 网络/解析失败一律返回“全部关闭”,避免在宿主不可达时仍然悄悄花 token。
|
|
7433
|
+
*/
|
|
7434
|
+
async function fetchComposerStatus() {
|
|
7170
7435
|
try {
|
|
7171
7436
|
const response = await fetch(CODEX_UI_API_ENDPOINTS.composer, {
|
|
7172
7437
|
headers: { Accept: "application/json" },
|
|
7173
7438
|
cache: "no-store"
|
|
7174
7439
|
});
|
|
7175
|
-
if (!response.ok) return
|
|
7176
|
-
|
|
7440
|
+
if (!response.ok) return {
|
|
7441
|
+
enabled: false,
|
|
7442
|
+
prediction: false
|
|
7443
|
+
};
|
|
7444
|
+
const data = await response.json();
|
|
7445
|
+
return {
|
|
7446
|
+
enabled: data?.enabled === true,
|
|
7447
|
+
prediction: data?.prediction !== false
|
|
7448
|
+
};
|
|
7177
7449
|
} catch {
|
|
7178
|
-
return
|
|
7450
|
+
return {
|
|
7451
|
+
enabled: false,
|
|
7452
|
+
prediction: false
|
|
7453
|
+
};
|
|
7179
7454
|
}
|
|
7180
7455
|
}
|
|
7181
7456
|
/** 注入 Composer 相关增强样式(新会话建议卡片) */
|
|
@@ -7240,8 +7515,10 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
7240
7515
|
}, SuggestionsDock));
|
|
7241
7516
|
cleaners.push(unregisterSuggestions);
|
|
7242
7517
|
function PredictionSlot(props) {
|
|
7518
|
+
const prediction = (0, react.useSyncExternalStore)(subscribePredictionSettings, getPredictionSettingsState, getPredictionSettingsState);
|
|
7243
7519
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ComposerPredictionOverlay, {
|
|
7244
7520
|
...props,
|
|
7521
|
+
enabled: prediction.enabled,
|
|
7245
7522
|
ctx,
|
|
7246
7523
|
t
|
|
7247
7524
|
});
|
|
@@ -7253,6 +7530,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
7253
7530
|
locale: NS
|
|
7254
7531
|
}, PredictionSlot));
|
|
7255
7532
|
cleaners.push(unregisterPrediction);
|
|
7533
|
+
cleaners.push(observePredictionSettings());
|
|
7256
7534
|
return () => {
|
|
7257
7535
|
for (const clean of cleaners.reverse()) try {
|
|
7258
7536
|
clean();
|
|
@@ -7262,9 +7540,11 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
7262
7540
|
};
|
|
7263
7541
|
const sync = async () => {
|
|
7264
7542
|
if (disposed) return;
|
|
7265
|
-
const
|
|
7543
|
+
const status = await fetchComposerStatus();
|
|
7266
7544
|
if (disposed) return;
|
|
7267
|
-
|
|
7545
|
+
setSubPluginEnabled(status.enabled);
|
|
7546
|
+
setHostPredictionAllowed(status.prediction);
|
|
7547
|
+
if (status.enabled) {
|
|
7268
7548
|
if (!cleanActive) cleanActive = activate();
|
|
7269
7549
|
} else {
|
|
7270
7550
|
cleanActive?.();
|
|
@@ -8964,15 +9244,17 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
8964
9244
|
.dcu-ws-section-action{width:22px;height:22px;border:0;border-radius:50%;background:transparent;color:inherit;font:inherit;font-size:12px;line-height:1;cursor:pointer;display:grid;place-items:center}
|
|
8965
9245
|
.dcu-ws-section-action:hover{background:var(--dsw-alias-interactive-bg-hover,rgba(127,127,127,.16))}
|
|
8966
9246
|
[data-sidebar-collapsed='true'] .dcu-ws-section{display:none !important}
|
|
8967
|
-
|
|
9247
|
+
/* z-index 取宿主顶级浮层的量级:分区标题 ··· 这条路径把面板挂在 body 上,宿主侧边栏/工作区树自己是
|
|
9248
|
+
更大的层级,1000 会让侧边栏的行文字压在面板上(表现为「菜单跑到侧边栏后面」)。
|
|
9249
|
+
面板本体由宿主 MenuSurface 原语渲染(表面 + material 磨砂层),这里只补壳外的几何与文字颜色,
|
|
9250
|
+
不碰填充与模糊——否则会和宿主的 material 叠加成双层,并把它的模糊打成惰性。 */
|
|
9251
|
+
.dcu-ws-section-menu{position:fixed;z-index:2147483000;min-width:144px;max-width:360px;overflow:visible;padding:4px;display:flex;flex-direction:column;gap:0;border:none;border-radius:var(--dsw-radius-lg,14px);box-shadow:var(--dsw-elevation-prominent,0 6px 20px rgba(0,0,0,.45));color:var(--dsw-alias-label-primary,#ededed);isolation:isolate}
|
|
9252
|
+
/* 滚动搬进内层:面板自身必须 overflow:visible,否则下面的 8px 透明桥会被横向裁掉 */
|
|
9253
|
+
.dcu-ws-section-menu-scroll{display:flex;flex-direction:column;gap:0;min-height:0;flex:1 1 auto;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;max-height:inherit}
|
|
8968
9254
|
/* 父菜单与二级菜单之间有一小段空隙:铺一条透明桥,指针穿过去时不会触发离开事件。 */
|
|
8969
9255
|
.dcu-ws-section-menu[data-flyout='true']::before{content:'';position:absolute;top:0;bottom:0;left:-6px;width:8px}
|
|
8970
|
-
|
|
8971
|
-
|
|
8972
|
-
.dcu-ws-section-menu .dcu-ws-section-menu-icon:empty{display:none}
|
|
8973
|
-
.dcu-ws-section-menu .dcu-ws-section-menu-label{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
8974
|
-
.dcu-ws-section-menu button:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover,rgba(255,255,255,.08))}
|
|
8975
|
-
.dcu-ws-section-menu button[aria-current='true']{color:var(--dsw-alias-state-business-primary,#4176e6)}
|
|
9256
|
+
/* 行样式一律交由宿主类名(克隆行自带),这里不再覆盖 button 的 padding / 圆角 / 字号,
|
|
9257
|
+
否则二级菜单的行与一级菜单的行会出现可见差异。 */
|
|
8976
9258
|
.dcu-ws-section[data-dcu-section-fixed='true']{cursor:default}
|
|
8977
9259
|
/* 跨分区拖拽拦截时以 CSS 隐藏宿主落点线,绝不侵入修改宿主 React 的 DOM className;移回合法区自然恢复 */
|
|
8978
9260
|
body[data-dcu-drag-blocked='true'] [class*="workspaceDropBefore"]::before,
|
|
@@ -9159,6 +9441,12 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9159
9441
|
let unsubscribe;
|
|
9160
9442
|
const headers = /* @__PURE__ */ new Map();
|
|
9161
9443
|
let menuHost;
|
|
9444
|
+
/** 取消「分区」行上待触发的收起定时器:指针移到二级菜单上时由面板侧调用。 */
|
|
9445
|
+
let cancelAnchorLeave;
|
|
9446
|
+
/** 取消二级菜单自身待触发的收起定时器:指针移回行上时由行侧调用。 */
|
|
9447
|
+
let cancelPanelLeave;
|
|
9448
|
+
/** 「分区 ›」二级菜单当前是否展开:菜单行会被重新注入,展开态必须按这个标志落到新节点上。 */
|
|
9449
|
+
let assignExpanded = false;
|
|
9162
9450
|
/** 当前二级菜单的锚点(「分区」那一行),悬停重复触发时用来去重。 */
|
|
9163
9451
|
let assignAnchor;
|
|
9164
9452
|
const workspaces = () => {
|
|
@@ -9448,118 +9736,143 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9448
9736
|
for (const header of headers.values()) header.remove();
|
|
9449
9737
|
headers.clear();
|
|
9450
9738
|
}
|
|
9739
|
+
/** 清理「内部 pointerout 截断」监听(每次开面板重新挂,closeSectionMenu 里释放)。 */
|
|
9740
|
+
let flyoutExitCleanup;
|
|
9741
|
+
/**
|
|
9742
|
+
* 截断子面板与父菜单之间「同一菜单内部」的 out 事件,避免宿主把跨 React 根的内部移动
|
|
9743
|
+
* 判成离开菜单。真正移出菜单(related 落在菜单外)的事件原样放行。
|
|
9744
|
+
*/
|
|
9745
|
+
function guardFlyoutExit(parentMenu, container) {
|
|
9746
|
+
const inside = (node, root) => node instanceof Node && root.contains(node);
|
|
9747
|
+
const handler = (event) => {
|
|
9748
|
+
const related = event.relatedTarget;
|
|
9749
|
+
if (!(related instanceof Node)) return;
|
|
9750
|
+
if (inside(related, container)) {
|
|
9751
|
+
event.stopPropagation();
|
|
9752
|
+
return;
|
|
9753
|
+
}
|
|
9754
|
+
if (inside(event.target, container) && inside(related, parentMenu)) event.stopPropagation();
|
|
9755
|
+
};
|
|
9756
|
+
parentMenu.addEventListener("pointerout", handler);
|
|
9757
|
+
parentMenu.addEventListener("mouseout", handler);
|
|
9758
|
+
return () => {
|
|
9759
|
+
parentMenu.removeEventListener("pointerout", handler);
|
|
9760
|
+
parentMenu.removeEventListener("mouseout", handler);
|
|
9761
|
+
};
|
|
9762
|
+
}
|
|
9451
9763
|
function closeSectionMenu() {
|
|
9452
|
-
|
|
9764
|
+
flyoutExitCleanup?.();
|
|
9765
|
+
flyoutExitCleanup = void 0;
|
|
9766
|
+
if (menuHost !== void 0) {
|
|
9767
|
+
(0, react_dom.unmountComponentAtNode)(menuHost);
|
|
9768
|
+
menuHost.remove();
|
|
9769
|
+
}
|
|
9770
|
+
assignExpanded = false;
|
|
9771
|
+
assignAnchor?.setAttribute("aria-expanded", "false");
|
|
9772
|
+
cancelPanelLeave = void 0;
|
|
9453
9773
|
menuHost = void 0;
|
|
9454
9774
|
assignAnchor = void 0;
|
|
9455
9775
|
}
|
|
9456
9776
|
/**
|
|
9457
|
-
*
|
|
9458
|
-
*
|
|
9459
|
-
*
|
|
9777
|
+
* 分区自己的菜单面板:直接用宿主原语渲染 —— `MenuSurface`(表面 + material 磨砂层)
|
|
9778
|
+
* 与 `MenuItemButton`(行)。既不手绘控件,也不依赖「页面上已经开着某个宿主菜单」,
|
|
9779
|
+
* 所以冷启动第一次点分区标题的 `···` 同样能弹出来。
|
|
9780
|
+
*
|
|
9781
|
+
* 嵌套在宿主行菜单里时挂进父菜单内部(outside-click 判定视为菜单内部,指针移入不会关父菜单);
|
|
9782
|
+
* 独立打开时挂到 body。
|
|
9460
9783
|
*/
|
|
9461
9784
|
function openHostPanel(anchor, items, flyoutFrom) {
|
|
9462
9785
|
closeSectionMenu();
|
|
9463
9786
|
const parentMenu = flyoutFrom?.isConnected === true ? flyoutFrom : anchor.closest("[role=\"menu\"]");
|
|
9464
|
-
|
|
9465
|
-
|
|
9787
|
+
const { MenuSurface, MenuItemButton } = _deepseek_ai_dsh_client_ui_primitives;
|
|
9788
|
+
if (MenuSurface === void 0 || MenuItemButton === void 0) return;
|
|
9789
|
+
const container = document.createElement("div");
|
|
9790
|
+
container.style.cssText = "position:fixed;left:0;top:0;width:0;height:0;visibility:hidden;z-index:2147483000;margin:0;padding:0;border:0;background:transparent;overflow:visible;inset:auto";
|
|
9466
9791
|
if (parentMenu !== null && parentMenu !== void 0) {
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
panel.setAttribute("role", "menu");
|
|
9487
|
-
viewport = panel;
|
|
9488
|
-
}
|
|
9489
|
-
const sampleRow = parentMenu?.querySelector("[class*=\"itemWrap\"]") ?? hostMenuRowTemplate;
|
|
9490
|
-
const sampleRef = sampleRow?.querySelector("button[role=\"menuitem\"]") ?? void 0;
|
|
9491
|
-
for (const item of items) {
|
|
9492
|
-
const row = buildMenuRow(sampleRef, item.icon, item.label, "", sampleRow);
|
|
9493
|
-
if (row !== null) {
|
|
9494
|
-
row.querySelector("button")?.addEventListener("click", (event) => {
|
|
9495
|
-
event.preventDefault();
|
|
9496
|
-
event.stopPropagation();
|
|
9497
|
-
item.onSelect();
|
|
9498
|
-
});
|
|
9499
|
-
viewport.appendChild(row);
|
|
9500
|
-
} else {
|
|
9501
|
-
const button = document.createElement("button");
|
|
9502
|
-
button.type = "button";
|
|
9503
|
-
button.setAttribute("role", "menuitem");
|
|
9504
|
-
const icon = document.createElement("span");
|
|
9505
|
-
icon.className = `${MENU_CLASS}-icon`;
|
|
9506
|
-
icon.innerHTML = item.icon;
|
|
9507
|
-
const label = document.createElement("span");
|
|
9508
|
-
label.className = `${MENU_CLASS}-label`;
|
|
9509
|
-
label.textContent = item.label;
|
|
9510
|
-
button.append(icon, label);
|
|
9511
|
-
button.addEventListener("click", (event) => {
|
|
9512
|
-
event.preventDefault();
|
|
9513
|
-
event.stopPropagation();
|
|
9792
|
+
parentMenu.appendChild(container);
|
|
9793
|
+
flyoutExitCleanup?.();
|
|
9794
|
+
flyoutExitCleanup = guardFlyoutExit(parentMenu, container);
|
|
9795
|
+
} else document.body.appendChild(container);
|
|
9796
|
+
(0, react_dom.flushSync)(() => {
|
|
9797
|
+
(0, react_dom.render)((0, react.createElement)(MenuSurface, {
|
|
9798
|
+
role: "menu",
|
|
9799
|
+
"aria-label": text("sections.menu", "分区"),
|
|
9800
|
+
className: MENU_CLASS,
|
|
9801
|
+
"data-dcu-menu-surface": "true",
|
|
9802
|
+
...parentMenu === null || parentMenu === void 0 ? {} : { "data-flyout": "true" }
|
|
9803
|
+
}, (0, react.createElement)("div", { className: `${MENU_CLASS}-scroll` }, items.map((item) => (0, react.createElement)(MenuItemButton, {
|
|
9804
|
+
key: item.label,
|
|
9805
|
+
icon: (0, react.createElement)("span", {
|
|
9806
|
+
style: { display: "inline-flex" },
|
|
9807
|
+
dangerouslySetInnerHTML: { __html: item.icon }
|
|
9808
|
+
}),
|
|
9809
|
+
onSelect: () => {
|
|
9810
|
+
closeSectionMenu();
|
|
9514
9811
|
item.onSelect();
|
|
9515
|
-
}
|
|
9516
|
-
|
|
9517
|
-
|
|
9518
|
-
|
|
9812
|
+
}
|
|
9813
|
+
}, item.label)))), container);
|
|
9814
|
+
});
|
|
9815
|
+
try {
|
|
9816
|
+
container.setAttribute("popover", "manual");
|
|
9817
|
+
container.showPopover?.();
|
|
9818
|
+
} catch {}
|
|
9519
9819
|
let leaveTimer;
|
|
9520
9820
|
const cancelLeave = () => {
|
|
9521
9821
|
if (leaveTimer === void 0) return;
|
|
9522
9822
|
window.clearTimeout(leaveTimer);
|
|
9523
9823
|
leaveTimer = void 0;
|
|
9524
9824
|
};
|
|
9525
|
-
|
|
9526
|
-
|
|
9825
|
+
cancelPanelLeave = cancelLeave;
|
|
9826
|
+
container.addEventListener("mouseenter", () => {
|
|
9827
|
+
cancelAnchorLeave?.();
|
|
9828
|
+
cancelLeave();
|
|
9829
|
+
});
|
|
9830
|
+
container.addEventListener("mouseleave", () => {
|
|
9527
9831
|
cancelLeave();
|
|
9528
9832
|
leaveTimer = window.setTimeout(() => {
|
|
9529
9833
|
leaveTimer = void 0;
|
|
9530
9834
|
closeSectionMenu();
|
|
9531
9835
|
}, 180);
|
|
9532
9836
|
});
|
|
9533
|
-
|
|
9534
|
-
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9538
|
-
|
|
9539
|
-
|
|
9837
|
+
container.addEventListener("pointerdown", (event) => event.stopPropagation());
|
|
9838
|
+
container.addEventListener("mousedown", (event) => event.stopPropagation());
|
|
9839
|
+
container.addEventListener("keydown", (event) => {
|
|
9840
|
+
const rows = Array.from(container.querySelectorAll("[role=\"menuitem\"]"));
|
|
9841
|
+
if (rows.length === 0) return;
|
|
9842
|
+
if (event.key === "Home" || event.key === "End") {
|
|
9843
|
+
event.preventDefault();
|
|
9844
|
+
event.stopPropagation();
|
|
9845
|
+
rows[event.key === "Home" ? 0 : rows.length - 1]?.focus();
|
|
9846
|
+
return;
|
|
9847
|
+
}
|
|
9848
|
+
if (event.key !== "ArrowDown" && event.key !== "ArrowUp") return;
|
|
9849
|
+
const index = rows.indexOf(document.activeElement);
|
|
9850
|
+
if (!(event.key === "ArrowDown" ? index === rows.length - 1 : index <= 0)) return;
|
|
9851
|
+
event.preventDefault();
|
|
9852
|
+
event.stopPropagation();
|
|
9853
|
+
});
|
|
9854
|
+
menuHost = container;
|
|
9855
|
+
const surface = container.querySelector("[data-dcu-menu-surface]");
|
|
9856
|
+
if (surface !== null) {
|
|
9540
9857
|
const rect = anchor.getBoundingClientRect();
|
|
9541
|
-
const width =
|
|
9542
|
-
const height =
|
|
9543
|
-
const parentRect = parentMenu.getBoundingClientRect();
|
|
9544
|
-
let left = parentRect.right + 2;
|
|
9545
|
-
if (left + width > window.innerWidth - 10) left = Math.max(10, parentRect.left - width - 4);
|
|
9858
|
+
const width = surface.offsetWidth || 196;
|
|
9859
|
+
const height = surface.offsetHeight || 120;
|
|
9546
9860
|
const maxHeight = Math.max(140, Math.min(360, window.innerHeight - 20));
|
|
9547
|
-
|
|
9548
|
-
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
panel.style.top = `${Math.max(8, Math.min(rect.bottom + 4, window.innerHeight - height - 8))}px`;
|
|
9861
|
+
surface.style.maxHeight = `${maxHeight}px`;
|
|
9862
|
+
if (parentMenu !== null && parentMenu !== void 0) {
|
|
9863
|
+
const parentRect = parentMenu.getBoundingClientRect();
|
|
9864
|
+
let left = parentRect.right + 2;
|
|
9865
|
+
if (left + width > window.innerWidth - 10) left = Math.max(10, parentRect.left - width - 4);
|
|
9866
|
+
let top = rect.top - 4;
|
|
9867
|
+
if (top + Math.min(height, maxHeight) > window.innerHeight - 10) top = Math.max(10, window.innerHeight - Math.min(height, maxHeight) - 10);
|
|
9868
|
+
surface.style.left = `${left}px`;
|
|
9869
|
+
surface.style.top = `${top}px`;
|
|
9870
|
+
} else {
|
|
9871
|
+
surface.style.left = `${Math.max(8, Math.min(rect.left + 4, window.innerWidth - width - 8))}px`;
|
|
9872
|
+
surface.style.top = `${Math.max(8, Math.min(rect.bottom + 4, window.innerHeight - height - 8))}px`;
|
|
9873
|
+
}
|
|
9561
9874
|
}
|
|
9562
|
-
|
|
9875
|
+
container.style.visibility = "visible";
|
|
9563
9876
|
}
|
|
9564
9877
|
function openSectionMenu(sectionId, anchor) {
|
|
9565
9878
|
const section = state.sections.find((item) => item.id === sectionId);
|
|
@@ -9766,18 +10079,49 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9766
10079
|
document.addEventListener("drop", onWorkspaceDrop, true);
|
|
9767
10080
|
document.addEventListener("dragend", onWorkspaceDragEnd, true);
|
|
9768
10081
|
/**
|
|
9769
|
-
*
|
|
9770
|
-
*
|
|
9771
|
-
|
|
10082
|
+
* 对齐归档管理器规范:从行内操作区精准定位“···”操作菜单触发按钮。
|
|
10083
|
+
* 优先匹配 aria-haspopup="menu",排除星标按钮与新建会话按钮,避免行内按钮顺序变化时误判。
|
|
10084
|
+
*/
|
|
10085
|
+
function isStarButton(btn) {
|
|
10086
|
+
const className = btn.getAttribute("class") ?? "";
|
|
10087
|
+
if (className.includes("dsham_rowStar") || className.includes("star")) return true;
|
|
10088
|
+
if (typeof btn.closest === "function" && Boolean(btn.closest(".dsham_starSlot"))) return true;
|
|
10089
|
+
return false;
|
|
10090
|
+
}
|
|
10091
|
+
/**
|
|
10092
|
+
* 语义不匹配就返回 null(与归档管理器的 `findRowMenuButton` 一致):
|
|
10093
|
+
* 未分组伪工作区的行里 `rowActions` 只有「新建会话」,退回 `buttons[0]` 会把它当成
|
|
10094
|
+
* 菜单锚点,右键/点击时给一个不存在的菜单做注入准备。
|
|
10095
|
+
*/
|
|
10096
|
+
function findRowMenuButton(row) {
|
|
10097
|
+
const actions = row.querySelector("[class*=\"rowActions\"]");
|
|
10098
|
+
if (!actions) return null;
|
|
10099
|
+
const buttons = Array.from(actions.querySelectorAll("button"));
|
|
10100
|
+
if (buttons.length === 0) return null;
|
|
10101
|
+
return buttons.find((btn) => {
|
|
10102
|
+
if (isStarButton(btn)) return false;
|
|
10103
|
+
if (btn.getAttribute("aria-haspopup") === "menu") return true;
|
|
10104
|
+
const label = (btn.getAttribute("aria-label") ?? btn.getAttribute("title") ?? "").toLowerCase();
|
|
10105
|
+
if (/new|create|新建|add|\+|созда/.test(label)) return false;
|
|
10106
|
+
return /action|操作|действи|more|更多|选项|options|menu/.test(label);
|
|
10107
|
+
}) ?? null;
|
|
10108
|
+
}
|
|
10109
|
+
function isRowMenuButton(button, row) {
|
|
10110
|
+
if (findRowMenuButton(row) === button) return true;
|
|
10111
|
+
const label = (button.getAttribute("aria-label") ?? button.getAttribute("title") ?? "").toLowerCase();
|
|
10112
|
+
if (/new|create|新建|add|\+|созда/.test(label)) return false;
|
|
10113
|
+
return /action|操作|действи|more|更多|选项|options|menu/.test(label);
|
|
10114
|
+
}
|
|
10115
|
+
/**
|
|
10116
|
+
* 从触发目标元素反查对应的工作区行节点,严格过滤会话行与菜单内部元素。
|
|
9772
10117
|
*/
|
|
9773
10118
|
function projectRowOfMenuButton(target) {
|
|
9774
|
-
const
|
|
9775
|
-
if (button === null) return null;
|
|
9776
|
-
const row = button.closest("[data-row-key^=\"workspace:\"]");
|
|
10119
|
+
const row = target.closest("[data-row-key]");
|
|
9777
10120
|
if (row === null) return null;
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
|
|
10121
|
+
if (!(row.getAttribute("data-row-key") ?? "").startsWith("workspace:")) return null;
|
|
10122
|
+
const button = target.closest("button");
|
|
10123
|
+
if (button !== null) return isRowMenuButton(button, row) ? row : null;
|
|
10124
|
+
return row;
|
|
9781
10125
|
}
|
|
9782
10126
|
/**
|
|
9783
10127
|
* 项目行 `···` 一按下就记下目标工作区。
|
|
@@ -9806,8 +10150,25 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9806
10150
|
function onClickToPrepareMenu(event) {
|
|
9807
10151
|
if (event.target instanceof Element) prepareMenuInjection(event.target);
|
|
9808
10152
|
}
|
|
10153
|
+
/** 对齐归档管理器规范:支持在工作区行上右键直接唤起操作菜单与分区入口 */
|
|
10154
|
+
function onContextMenuToPrepareMenu(event) {
|
|
10155
|
+
const target = event.target;
|
|
10156
|
+
if (!target) return;
|
|
10157
|
+
if (target.closest("input, textarea, [contenteditable='true']")) return;
|
|
10158
|
+
const row = target.closest("[data-row-key^=\"workspace:\"]");
|
|
10159
|
+
if (!row) return;
|
|
10160
|
+
const clickedButton = target.closest("button");
|
|
10161
|
+
if (clickedButton && !isRowMenuButton(clickedButton, row)) return;
|
|
10162
|
+
if (!findRowMenuButton(row)) return;
|
|
10163
|
+
const id = workspaceIdOfRow(row);
|
|
10164
|
+
if (id) {
|
|
10165
|
+
assigningWorkspaceId = id;
|
|
10166
|
+
injectMenuEntry();
|
|
10167
|
+
}
|
|
10168
|
+
}
|
|
9809
10169
|
document.addEventListener("pointerdown", onPointerdownToPrepareMenu, true);
|
|
9810
10170
|
document.addEventListener("click", onClickToPrepareMenu, true);
|
|
10171
|
+
document.addEventListener("contextmenu", onContextMenuToPrepareMenu, true);
|
|
9811
10172
|
/**
|
|
9812
10173
|
* 用宿主自己的图标组件渲染出静态 SVG。
|
|
9813
10174
|
* 手绘图标在描边粗细、圆角与视觉重心上永远差一档,直接复用宿主原语才能和原生菜单项完全同源。
|
|
@@ -9912,21 +10273,8 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9912
10273
|
if (template === void 0) return;
|
|
9913
10274
|
container = menu.firstElementChild ?? menu;
|
|
9914
10275
|
}
|
|
9915
|
-
if (reference !== void 0 && template === void 0) {
|
|
9916
|
-
|
|
9917
|
-
hostMenuClassName = menu.className;
|
|
9918
|
-
hostMenuShellTemplate = menu.cloneNode(false);
|
|
9919
|
-
const viewport = reference.parentElement?.parentElement;
|
|
9920
|
-
hostMenuViewportTemplate = viewport === void 0 || viewport === null ? void 0 : viewport.cloneNode(false);
|
|
9921
|
-
}
|
|
9922
|
-
if (reference !== void 0 && hostMenuRowTemplate === void 0 && !isOwnPanel(reference)) {
|
|
9923
|
-
hostMenuRowTemplate = reference.parentElement?.cloneNode(true);
|
|
9924
|
-
hostMenuSurface = menu;
|
|
9925
|
-
hostMenuClassName = menu.className;
|
|
9926
|
-
hostMenuShellTemplate = menu.cloneNode(false);
|
|
9927
|
-
const viewport = reference.parentElement?.parentElement;
|
|
9928
|
-
hostMenuViewportTemplate = viewport === void 0 || viewport === null ? void 0 : viewport.cloneNode(false);
|
|
9929
|
-
}
|
|
10276
|
+
if (reference !== void 0 && template === void 0) {}
|
|
10277
|
+
if (reference !== void 0 && hostMenuRowTemplate === void 0 && !isOwnPanel(reference)) hostMenuRowTemplate = reference.parentElement?.cloneNode(true);
|
|
9930
10278
|
const workspaceId = assigningWorkspaceId;
|
|
9931
10279
|
if (workspaceId === void 0) return;
|
|
9932
10280
|
const pinned = sectionOf(state, workspaceId) === PINNED_SECTION_ID;
|
|
@@ -9954,16 +10302,21 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9954
10302
|
if (sectionRow !== null) {
|
|
9955
10303
|
const anchorButton = sectionRow.querySelector("button");
|
|
9956
10304
|
if (anchorButton !== null) {
|
|
10305
|
+
anchorButton.setAttribute("aria-haspopup", "menu");
|
|
10306
|
+
anchorButton.setAttribute("aria-expanded", assignExpanded ? "true" : "false");
|
|
9957
10307
|
let hoverTimer;
|
|
9958
10308
|
const cancelHover = () => {
|
|
9959
10309
|
if (hoverTimer === void 0) return;
|
|
9960
10310
|
window.clearTimeout(hoverTimer);
|
|
9961
10311
|
hoverTimer = void 0;
|
|
9962
10312
|
};
|
|
10313
|
+
cancelAnchorLeave = cancelHover;
|
|
9963
10314
|
anchorButton.addEventListener("mouseenter", () => {
|
|
9964
10315
|
cancelHover();
|
|
10316
|
+
cancelPanelLeave?.();
|
|
9965
10317
|
hoverTimer = window.setTimeout(() => {
|
|
9966
10318
|
hoverTimer = void 0;
|
|
10319
|
+
if (menuHost !== void 0 && !menuHost.isConnected) closeSectionMenu();
|
|
9967
10320
|
if (menuHost !== void 0 && assignAnchor === anchorButton) return;
|
|
9968
10321
|
openAssignMenu(anchorButton, menu);
|
|
9969
10322
|
}, 90);
|
|
@@ -9994,16 +10347,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
9994
10347
|
}));
|
|
9995
10348
|
}
|
|
9996
10349
|
let assigningWorkspaceId;
|
|
9997
|
-
let hostMenuSurface;
|
|
9998
10350
|
/** 宿主菜单表面与菜单行的克隆模板:分区菜单复用它们,样式才与原生一致。 */
|
|
9999
|
-
let hostMenuClassName;
|
|
10000
10351
|
let hostMenuRowTemplate;
|
|
10001
10352
|
/** 宿主菜单的外壳与内容容器:真正的底色/模糊画在 viewport 上,必须整层复用。 */
|
|
10002
|
-
let hostMenuShellTemplate;
|
|
10003
|
-
let hostMenuViewportTemplate;
|
|
10004
10353
|
let collapsed = readCollapsed();
|
|
10005
10354
|
function openAssignMenu(anchor, parentMenu) {
|
|
10006
|
-
assignAnchor = anchor;
|
|
10007
10355
|
const workspaceId = assigningWorkspaceId;
|
|
10008
10356
|
if (workspaceId === void 0) return;
|
|
10009
10357
|
const current = sectionOf(state, workspaceId);
|
|
@@ -10031,6 +10379,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
10031
10379
|
}
|
|
10032
10380
|
});
|
|
10033
10381
|
openHostPanel(anchor, items, parentMenu);
|
|
10382
|
+
if (menuHost !== void 0) {
|
|
10383
|
+
assignAnchor = anchor;
|
|
10384
|
+
assignExpanded = true;
|
|
10385
|
+
anchor.setAttribute("aria-expanded", "true");
|
|
10386
|
+
}
|
|
10034
10387
|
}
|
|
10035
10388
|
/** 新增项目进入默认分区,删除项目及时裁剪;不改变既有成员的显式归属。 */
|
|
10036
10389
|
function withHostWorkspaces(value, ids) {
|
|
@@ -10089,11 +10442,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
10089
10442
|
const reference = menu?.querySelector("button[role=\"menuitem\"]");
|
|
10090
10443
|
const wrapper = reference?.parentElement;
|
|
10091
10444
|
if (menu === void 0 || reference === void 0 || wrapper === void 0 || wrapper === null) return;
|
|
10092
|
-
menu.className;
|
|
10093
10445
|
hostMenuRowTemplate = wrapper.cloneNode(true);
|
|
10094
|
-
hostMenuShellTemplate = menu.cloneNode(false);
|
|
10095
|
-
const viewport = wrapper.parentElement;
|
|
10096
|
-
hostMenuViewportTemplate = viewport === null ? void 0 : viewport.cloneNode(false);
|
|
10097
10446
|
}
|
|
10098
10447
|
function syncNow() {
|
|
10099
10448
|
if (disposed || syncing) return;
|
|
@@ -10266,6 +10615,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
10266
10615
|
document.removeEventListener("pointerdown", onPointerdownToCloseSectionMenu, true);
|
|
10267
10616
|
document.removeEventListener("pointerdown", onPointerdownToPrepareMenu, true);
|
|
10268
10617
|
document.removeEventListener("click", onClickToPrepareMenu, true);
|
|
10618
|
+
document.removeEventListener("contextmenu", onContextMenuToPrepareMenu, true);
|
|
10269
10619
|
unsubscribe?.();
|
|
10270
10620
|
closeSectionMenu();
|
|
10271
10621
|
flushSectionsSave();
|
|
@@ -10911,6 +11261,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
10911
11261
|
ctx.effect(() => observeComposerEnhancements(ctx), "michengai-codex-ui: composer enhancements");
|
|
10912
11262
|
ctx.effect(() => observeSettingsSkin(), "michengai-codex-ui: official settings skin");
|
|
10913
11263
|
ctx.effect(() => observeSettingsNavIcon(() => t("about.nav")), "michengai-codex-ui: settings nav icon");
|
|
11264
|
+
ctx.slots.inject("settings.section.icon", () => ctx.slots.register({
|
|
11265
|
+
name: "settings.section.icon",
|
|
11266
|
+
id: "codex-ui",
|
|
11267
|
+
locale: NS
|
|
11268
|
+
}, CodexUiNavIcon));
|
|
10914
11269
|
ctx.slots.inject("settings.section", () => ctx.slots.register({
|
|
10915
11270
|
name: "settings.section",
|
|
10916
11271
|
id: "codex-ui",
|