@michengai/dsh-codex-ui 2.2.6 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/CHANGELOG.zh-CN.md +18 -0
- package/README.de.md +2 -2
- package/README.en.md +2 -2
- package/README.es.md +2 -2
- package/README.fr.md +2 -2
- package/README.ja.md +2 -2
- package/README.md +2 -2
- package/README.pt.md +2 -2
- package/README.ru.md +2 -2
- package/README.zh-CN.md +2 -2
- package/lib/client.js +258 -658
- package/package.json +40 -40
package/lib/client.js
CHANGED
|
@@ -301,7 +301,7 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
301
301
|
* (item II — lazy CSS), so editing the stylesheet means editing
|
|
302
302
|
* glass.module.css and rebuilding.
|
|
303
303
|
*/
|
|
304
|
-
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],[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}}";
|
|
304
|
+
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],[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]:not([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *),[data-dsh-glass-compat] [class*=dropdown]:not([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *){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]:not([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *),[data-dsh-glass-compat] [class*=dropdown]:not([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *){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([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *):not(:focus-visible),[data-dsh-glass-compat] [class*=dropdown]:not([data-menu-material]):not(:is([class*=popover],[class*=dropdown],[data-menu-material],[role=menu]) *):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}}";
|
|
305
305
|
//#endregion
|
|
306
306
|
//#region src/client/theme/glass-seams.ts
|
|
307
307
|
const SEAMS = [
|
|
@@ -324,7 +324,7 @@ html[data-dsh-glass] body:not([data-ds-dark-theme]) .dcu-section-card {
|
|
|
324
324
|
},
|
|
325
325
|
{
|
|
326
326
|
attribute: "data-dsh-glass-details",
|
|
327
|
-
selector: "[class*=\"rightbarCol\"] [data-sidebar-right-panel]
|
|
327
|
+
selector: "[class*=\"rightbarCol\"] [data-sidebar-right-panel]",
|
|
328
328
|
first: true
|
|
329
329
|
},
|
|
330
330
|
{
|
|
@@ -8045,21 +8045,12 @@ html[data-platform="darwin"]:not([data-fullscreen]) [data-shortcut-modal="settin
|
|
|
8045
8045
|
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
8046
8046
|
}
|
|
8047
8047
|
|
|
8048
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8049
|
-
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
8050
|
-
}
|
|
8051
|
-
|
|
8052
8048
|
/* 浅色模式全局兜底:浅底高对比度规范,绝不允许残留或回退暗黑色 */
|
|
8053
8049
|
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"],
|
|
8054
8050
|
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"] {
|
|
8055
8051
|
background: var(--dsw-alias-bg-base, var(--dsw-static-neutral-bluish-00, #ffffff)) !important;
|
|
8056
8052
|
}
|
|
8057
8053
|
|
|
8058
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav),
|
|
8059
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8060
|
-
background: var(--dsw-alias-bg-layer-1, var(--dsw-static-neutral-bluish-00, #ffffff)) !important;
|
|
8061
|
-
}
|
|
8062
|
-
|
|
8063
8054
|
/* 玻璃质感/原版兼容排版模式(Compat) */
|
|
8064
8055
|
html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"] {
|
|
8065
8056
|
background: var(--dsw-alias-bg-base, #151517) !important;
|
|
@@ -8068,7 +8059,7 @@ html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"
|
|
|
8068
8059
|
}
|
|
8069
8060
|
|
|
8070
8061
|
html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"] > nav,
|
|
8071
|
-
html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]
|
|
8062
|
+
html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"] > [class*="navTitle"] {
|
|
8072
8063
|
background: color-mix(
|
|
8073
8064
|
in srgb,
|
|
8074
8065
|
var(--dsw-specific-sidebar-fill, #181825) 85%,
|
|
@@ -8080,12 +8071,6 @@ html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"
|
|
|
8080
8071
|
box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05) !important;
|
|
8081
8072
|
}
|
|
8082
8073
|
|
|
8083
|
-
html[data-dsh-glass]:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8084
|
-
background: var(--dsw-alias-bg-base, #151517) !important;
|
|
8085
|
-
backdrop-filter: none !important;
|
|
8086
|
-
-webkit-backdrop-filter: none !important;
|
|
8087
|
-
}
|
|
8088
|
-
|
|
8089
8074
|
/* 云母悬浮模式(Mica Mode):设置面板全面升华为与首页一致的悬浮双岛体系 */
|
|
8090
8075
|
html[data-dsh-glass-float] body > [role="presentation"]:has(> [data-shortcut-modal="settings"]) {
|
|
8091
8076
|
background-color: transparent !important;
|
|
@@ -8111,57 +8096,12 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"] {
|
|
|
8111
8096
|
-webkit-backdrop-filter: none !important;
|
|
8112
8097
|
}
|
|
8113
8098
|
|
|
8114
|
-
/* 左侧导航悬浮岛:与首页侧边栏严格对齐几何形态、12px外边距、16px圆角与微高光 */
|
|
8115
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav {
|
|
8116
|
-
box-sizing: border-box !important;
|
|
8117
|
-
width: calc(var(--dcu-settings-nav-width, 280px) - 24px) !important;
|
|
8118
|
-
min-width: calc(var(--dcu-settings-nav-width, 280px) - 24px) !important;
|
|
8119
|
-
max-width: calc(var(--dcu-settings-nav-width, 280px) - 24px) !important;
|
|
8120
|
-
margin: 8px 12px 12px 12px !important;
|
|
8121
|
-
height: calc(100% - 20px) !important;
|
|
8122
|
-
max-height: calc(100% - 20px) !important;
|
|
8123
|
-
border-radius: 16px !important;
|
|
8124
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
8125
|
-
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;
|
|
8126
|
-
background: var(--dsw-alias-bg-layer-2, var(--dsh-glass-card, #18181b)) !important;
|
|
8127
|
-
backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
8128
|
-
-webkit-backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
8129
|
-
overflow: hidden !important;
|
|
8130
|
-
}
|
|
8131
|
-
|
|
8132
|
-
/* 右侧工作台悬浮岛:独立大圆角卡片,浅色为纯净微光白,深色为深邃灰,与首页悬浮实体完全一致 */
|
|
8133
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8134
|
-
margin: 8px 12px 12px 0 !important;
|
|
8135
|
-
height: calc(100% - 20px) !important;
|
|
8136
|
-
max-height: calc(100% - 20px) !important;
|
|
8137
|
-
border-radius: 16px !important;
|
|
8138
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
8139
|
-
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;
|
|
8140
|
-
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
8141
|
-
backdrop-filter: none !important;
|
|
8142
|
-
-webkit-backdrop-filter: none !important;
|
|
8143
|
-
overflow: hidden !important;
|
|
8144
|
-
}
|
|
8145
|
-
|
|
8146
|
-
/* 云母模式下收敛顶部工具栏与内容区 padding,消除脱节大空隙 */
|
|
8147
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child {
|
|
8148
|
-
height: 48px !important;
|
|
8149
|
-
min-height: 48px !important;
|
|
8150
|
-
padding: 0 24px !important;
|
|
8151
|
-
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
8152
|
-
}
|
|
8153
|
-
|
|
8154
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
8155
|
-
padding: 16px 32px 48px !important;
|
|
8156
|
-
background: var(--dsw-alias-bg-layer-2, var(--dsw-alias-bg-layer-1, #18181b)) !important;
|
|
8157
|
-
}
|
|
8158
|
-
|
|
8159
8099
|
html[data-platform="darwin"] [data-shortcut-modal="settings"] > nav {
|
|
8160
8100
|
background: var(--dsw-specific-sidebar-fill, transparent) !important;
|
|
8161
8101
|
}
|
|
8162
8102
|
|
|
8163
8103
|
/* 顶部标题与搜索区插槽容器 */
|
|
8164
|
-
[data-shortcut-modal="settings"] >
|
|
8104
|
+
[data-shortcut-modal="settings"] > [class*="navTitle"] {
|
|
8165
8105
|
padding: 0 !important;
|
|
8166
8106
|
display: flex !important;
|
|
8167
8107
|
flex-direction: column !important;
|
|
@@ -8276,8 +8216,7 @@ button.dcu-settings-back-btn:hover,
|
|
|
8276
8216
|
}
|
|
8277
8217
|
|
|
8278
8218
|
/* 导航项列表容器 */
|
|
8279
|
-
[data-shortcut-modal="settings"] > nav [class*="navList"]
|
|
8280
|
-
[data-shortcut-modal="settings"] > nav > :nth-child(2) {
|
|
8219
|
+
[data-shortcut-modal="settings"] > nav [class*="navList"] {
|
|
8281
8220
|
display: flex !important;
|
|
8282
8221
|
flex-direction: column !important;
|
|
8283
8222
|
gap: 2px !important;
|
|
@@ -8380,116 +8319,7 @@ button.dcu-settings-back-btn:hover,
|
|
|
8380
8319
|
outline-offset: 1px !important;
|
|
8381
8320
|
}
|
|
8382
8321
|
|
|
8383
|
-
/*
|
|
8384
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8385
|
-
display: flex !important;
|
|
8386
|
-
min-width: 0 !important;
|
|
8387
|
-
flex: 1 1 auto !important;
|
|
8388
|
-
flex-direction: column !important;
|
|
8389
|
-
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
8390
|
-
height: 100% !important;
|
|
8391
|
-
}
|
|
8392
|
-
|
|
8393
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child {
|
|
8394
|
-
box-sizing: border-box !important;
|
|
8395
|
-
height: 56px !important;
|
|
8396
|
-
min-height: 56px !important;
|
|
8397
|
-
padding: 0 32px !important;
|
|
8398
|
-
border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(255, 255, 255, 0.07)) !important;
|
|
8399
|
-
display: flex !important;
|
|
8400
|
-
align-items: center !important;
|
|
8401
|
-
justify-content: space-between !important;
|
|
8402
|
-
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
8403
|
-
}
|
|
8404
|
-
|
|
8405
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child h2,
|
|
8406
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child span {
|
|
8407
|
-
font-size: 16px;
|
|
8408
|
-
font-weight: 600;
|
|
8409
|
-
color: var(--dsw-alias-label-primary, #f4f4f5) !important;
|
|
8410
|
-
letter-spacing: -0.01em;
|
|
8411
|
-
}
|
|
8412
|
-
|
|
8413
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button,
|
|
8414
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a {
|
|
8415
|
-
color: var(--dsw-alias-label-secondary, #a1a1aa) !important;
|
|
8416
|
-
transition: color 0.15s ease;
|
|
8417
|
-
}
|
|
8418
|
-
|
|
8419
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button:hover,
|
|
8420
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a:hover {
|
|
8421
|
-
color: var(--dsw-alias-label-primary, #f4f4f5) !important;
|
|
8422
|
-
}
|
|
8423
|
-
|
|
8424
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
8425
|
-
box-sizing: border-box !important;
|
|
8426
|
-
min-height: 0 !important;
|
|
8427
|
-
flex: 1 1 auto !important;
|
|
8428
|
-
overflow-y: auto !important;
|
|
8429
|
-
padding: 24px 32px 48px !important;
|
|
8430
|
-
background: var(--dsw-alias-bg-layer-2, #18181b) !important;
|
|
8431
|
-
display: flex !important;
|
|
8432
|
-
flex-direction: column !important;
|
|
8433
|
-
align-items: stretch !important;
|
|
8434
|
-
}
|
|
8435
|
-
|
|
8436
|
-
/* 浅色模式右侧内容区实色与文字按钮高对比度兜底 */
|
|
8437
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child,
|
|
8438
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child {
|
|
8439
|
-
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
8440
|
-
border-bottom: 1px solid var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.08)) !important;
|
|
8441
|
-
}
|
|
8442
|
-
|
|
8443
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child h2,
|
|
8444
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child span,
|
|
8445
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child h2,
|
|
8446
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child span {
|
|
8447
|
-
color: var(--dsw-alias-label-primary, #18181b) !important;
|
|
8448
|
-
}
|
|
8449
|
-
|
|
8450
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button,
|
|
8451
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a,
|
|
8452
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button,
|
|
8453
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a {
|
|
8454
|
-
color: var(--dsw-alias-label-secondary, #52525b) !important;
|
|
8455
|
-
}
|
|
8456
|
-
|
|
8457
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button:hover,
|
|
8458
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a:hover,
|
|
8459
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child button:hover,
|
|
8460
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child a:hover {
|
|
8461
|
-
color: var(--dsw-alias-label-primary, #18181b) !important;
|
|
8462
|
-
}
|
|
8463
|
-
|
|
8464
|
-
body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2),
|
|
8465
|
-
html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
8466
|
-
background: var(--dsw-alias-bg-layer-1, #ffffff) !important;
|
|
8467
|
-
}
|
|
8468
|
-
|
|
8469
|
-
/* 右侧设置区固定宽度规范:卡片先吃满列宽、再被 800px 夹住,左右留白相等(不会出现单侧空洞)。
|
|
8470
|
-
实测(scripts/verify-settings-geometry.mjs,1400px 面板):卡片宽 800px、左右各 260px —
|
|
8471
|
-
即「居中收束」而不是贴左;若要改成贴左,需同时去掉下面的 margin-inline: auto。 */
|
|
8472
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) > * {
|
|
8473
|
-
width: 100% !important;
|
|
8474
|
-
max-width: 800px !important;
|
|
8475
|
-
margin-inline: auto !important;
|
|
8476
|
-
box-sizing: border-box !important;
|
|
8477
|
-
}
|
|
8478
|
-
|
|
8479
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) > * > * {
|
|
8480
|
-
width: 100% !important;
|
|
8481
|
-
max-width: 800px !important;
|
|
8482
|
-
margin-inline: auto !important;
|
|
8483
|
-
box-sizing: border-box !important;
|
|
8484
|
-
}
|
|
8485
|
-
|
|
8486
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) [class*="section"] {
|
|
8487
|
-
width: 100% !important;
|
|
8488
|
-
max-width: 800px !important;
|
|
8489
|
-
margin-inline: auto !important;
|
|
8490
|
-
}
|
|
8491
|
-
|
|
8492
|
-
/* 新版宿主平铺 4 块 Grid 布局映射(0.2.1-alpha.3+),杜绝 4 列横向撕裂与多余空条 */
|
|
8322
|
+
/* 宿主平铺 4 块 Grid 布局映射,杜绝 4 列横向撕裂与多余空条 */
|
|
8493
8323
|
[data-shortcut-modal="settings"]:has(> [class*="options"]) {
|
|
8494
8324
|
display: grid !important;
|
|
8495
8325
|
grid-template-columns: var(--dcu-settings-nav-width, 280px) minmax(0, 1fr) !important;
|
|
@@ -8767,41 +8597,6 @@ html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"][data-sidebar-c
|
|
|
8767
8597
|
gap: 0 !important;
|
|
8768
8598
|
}
|
|
8769
8599
|
|
|
8770
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8771
|
-
margin: 0 !important;
|
|
8772
|
-
border-radius: 0 !important;
|
|
8773
|
-
border: none !important;
|
|
8774
|
-
box-shadow: none !important;
|
|
8775
|
-
background: var(--dsw-alias-bg-base, #151517) !important;
|
|
8776
|
-
height: 100% !important;
|
|
8777
|
-
max-height: 100% !important;
|
|
8778
|
-
overflow: hidden !important;
|
|
8779
|
-
display: flex !important;
|
|
8780
|
-
flex-direction: column !important;
|
|
8781
|
-
}
|
|
8782
|
-
|
|
8783
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav) > :first-child {
|
|
8784
|
-
background: transparent !important;
|
|
8785
|
-
border: none !important;
|
|
8786
|
-
border-bottom: none !important;
|
|
8787
|
-
flex: none !important;
|
|
8788
|
-
}
|
|
8789
|
-
|
|
8790
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
8791
|
-
margin: 0 !important;
|
|
8792
|
-
border-radius: 0 !important;
|
|
8793
|
-
border: none !important;
|
|
8794
|
-
box-shadow: none !important;
|
|
8795
|
-
background: transparent !important;
|
|
8796
|
-
overflow-y: auto !important;
|
|
8797
|
-
flex: 1 1 auto !important;
|
|
8798
|
-
min-height: 0 !important;
|
|
8799
|
-
padding-top: 28px !important;
|
|
8800
|
-
padding-bottom: 64px !important;
|
|
8801
|
-
padding-inline: 48px !important;
|
|
8802
|
-
box-sizing: border-box !important;
|
|
8803
|
-
}
|
|
8804
|
-
|
|
8805
8600
|
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"] {
|
|
8806
8601
|
margin: 0 !important;
|
|
8807
8602
|
border-radius: 0 !important;
|
|
@@ -8826,8 +8621,6 @@ html:not([data-dsh-glass-float]) html[data-ds-theme-source="light"] [data-shortc
|
|
|
8826
8621
|
border-right: 1px solid var(--dsw-alias-border-l1, rgba(0, 0, 0, 0.08)) !important;
|
|
8827
8622
|
}
|
|
8828
8623
|
|
|
8829
|
-
html:not([data-dsh-glass-float]) body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav),
|
|
8830
|
-
html:not([data-dsh-glass-float]) html[data-ds-theme-source="light"] [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav),
|
|
8831
8624
|
html:not([data-dsh-glass-float]) body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"],
|
|
8832
8625
|
html:not([data-dsh-glass-float]) html[data-ds-theme-source="light"] [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"] {
|
|
8833
8626
|
background: var(--dsw-alias-bg-base, #ffffff) !important;
|
|
@@ -8860,29 +8653,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
8860
8653
|
flex: none !important;
|
|
8861
8654
|
}
|
|
8862
8655
|
|
|
8863
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > nav {
|
|
8864
|
-
box-sizing: border-box !important;
|
|
8865
|
-
width: 56px !important;
|
|
8866
|
-
min-width: 56px !important;
|
|
8867
|
-
max-width: 56px !important;
|
|
8868
|
-
margin: 8px 12px 12px 12px !important;
|
|
8869
|
-
padding: 12px 0 16px !important;
|
|
8870
|
-
border-radius: 16px !important;
|
|
8871
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
8872
|
-
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;
|
|
8873
|
-
background: var(--dsh-glass-card, var(--dsw-alias-bg-layer-1)) !important;
|
|
8874
|
-
backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
8875
|
-
-webkit-backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
8876
|
-
overflow-y: auto !important;
|
|
8877
|
-
overflow-x: hidden !important;
|
|
8878
|
-
scrollbar-width: none !important;
|
|
8879
|
-
-ms-overflow-style: none !important;
|
|
8880
|
-
display: flex !important;
|
|
8881
|
-
flex-direction: column !important;
|
|
8882
|
-
align-items: center !important;
|
|
8883
|
-
gap: 0 !important;
|
|
8884
|
-
}
|
|
8885
|
-
|
|
8886
8656
|
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > nav {
|
|
8887
8657
|
grid-column: 1 !important;
|
|
8888
8658
|
grid-row: 2 !important;
|
|
@@ -8911,16 +8681,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
8911
8681
|
align-items: center !important;
|
|
8912
8682
|
}
|
|
8913
8683
|
|
|
8914
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
8915
|
-
margin: 8px 12px 12px 0 !important;
|
|
8916
|
-
border-radius: 16px !important;
|
|
8917
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
8918
|
-
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;
|
|
8919
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
8920
|
-
overflow-y: auto !important;
|
|
8921
|
-
height: calc(100% - 20px) !important;
|
|
8922
|
-
}
|
|
8923
|
-
|
|
8924
8684
|
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"] {
|
|
8925
8685
|
grid-column: 2 !important;
|
|
8926
8686
|
grid-row: 1 / -1 !important;
|
|
@@ -8948,36 +8708,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
8948
8708
|
height: 0 !important;
|
|
8949
8709
|
}
|
|
8950
8710
|
|
|
8951
|
-
/* 旧版嵌套结构下的返回标题栏,平铺 Grid 宿主下不命中了 nav > :first-child,避免把 navList 错误当成标题 */
|
|
8952
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > nav > :first-child {
|
|
8953
|
-
border: none !important;
|
|
8954
|
-
border-radius: 0 !important;
|
|
8955
|
-
background: transparent !important;
|
|
8956
|
-
box-shadow: none !important;
|
|
8957
|
-
padding: 0 !important;
|
|
8958
|
-
margin: 0 auto 10px auto !important;
|
|
8959
|
-
width: 100% !important;
|
|
8960
|
-
display: flex !important;
|
|
8961
|
-
justify-content: center !important;
|
|
8962
|
-
align-items: center !important;
|
|
8963
|
-
}
|
|
8964
|
-
|
|
8965
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > nav [class*="navList"],
|
|
8966
|
-
[data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > nav > :nth-child(2) {
|
|
8967
|
-
border: none !important;
|
|
8968
|
-
background: transparent !important;
|
|
8969
|
-
box-shadow: none !important;
|
|
8970
|
-
margin: 0 !important;
|
|
8971
|
-
padding: 0 !important;
|
|
8972
|
-
width: 100% !important;
|
|
8973
|
-
display: flex !important;
|
|
8974
|
-
flex-direction: column !important;
|
|
8975
|
-
align-items: center !important;
|
|
8976
|
-
gap: 4px !important;
|
|
8977
|
-
scrollbar-width: none !important;
|
|
8978
|
-
-ms-overflow-style: none !important;
|
|
8979
|
-
}
|
|
8980
|
-
|
|
8981
8711
|
[data-shortcut-modal="settings"][data-sidebar-collapsed] .dcu-settings-nav-header-root,
|
|
8982
8712
|
[data-shortcut-modal="settings"][data-sidebar-collapsed] .dcu-settings-nav-header-top {
|
|
8983
8713
|
align-items: center !important;
|
|
@@ -9140,16 +8870,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
9140
8870
|
pointer-events: auto !important;
|
|
9141
8871
|
}
|
|
9142
8872
|
|
|
9143
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
9144
|
-
margin: 8px 12px 12px 0 !important;
|
|
9145
|
-
border-radius: 16px !important;
|
|
9146
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
9147
|
-
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;
|
|
9148
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
9149
|
-
overflow-y: auto !important;
|
|
9150
|
-
height: calc(100% - 20px) !important;
|
|
9151
|
-
}
|
|
9152
|
-
|
|
9153
8873
|
[data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"],
|
|
9154
8874
|
html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collapsed]:has(> [class*="options"]) > [class*="options"] {
|
|
9155
8875
|
grid-column: 2 !important;
|
|
@@ -9265,60 +8985,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
9265
8985
|
flex: none !important;
|
|
9266
8986
|
}
|
|
9267
8987
|
|
|
9268
|
-
/* 旧版嵌套宿主在 <=768px 下的 nav 单岛体系,与折叠块完全对齐 */
|
|
9269
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav,
|
|
9270
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav {
|
|
9271
|
-
box-sizing: border-box !important;
|
|
9272
|
-
width: 56px !important;
|
|
9273
|
-
min-width: 56px !important;
|
|
9274
|
-
max-width: 56px !important;
|
|
9275
|
-
margin: 8px 12px 12px 12px !important;
|
|
9276
|
-
padding: 12px 0 16px !important;
|
|
9277
|
-
border-radius: 16px !important;
|
|
9278
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
9279
|
-
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;
|
|
9280
|
-
background: var(--dsh-glass-card, var(--dsw-alias-bg-layer-1)) !important;
|
|
9281
|
-
backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
9282
|
-
-webkit-backdrop-filter: blur(var(--dsh-glass-blur, 16px)) !important;
|
|
9283
|
-
overflow-y: auto !important;
|
|
9284
|
-
overflow-x: hidden !important;
|
|
9285
|
-
scrollbar-width: none !important;
|
|
9286
|
-
-ms-overflow-style: none !important;
|
|
9287
|
-
display: flex !important;
|
|
9288
|
-
flex-direction: column !important;
|
|
9289
|
-
align-items: center !important;
|
|
9290
|
-
gap: 0 !important;
|
|
9291
|
-
}
|
|
9292
|
-
|
|
9293
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav > :first-child {
|
|
9294
|
-
border: none !important;
|
|
9295
|
-
border-radius: 0 !important;
|
|
9296
|
-
background: transparent !important;
|
|
9297
|
-
box-shadow: none !important;
|
|
9298
|
-
padding: 0 !important;
|
|
9299
|
-
margin: 0 auto 10px auto !important;
|
|
9300
|
-
width: 100% !important;
|
|
9301
|
-
display: flex !important;
|
|
9302
|
-
justify-content: center !important;
|
|
9303
|
-
align-items: center !important;
|
|
9304
|
-
}
|
|
9305
|
-
|
|
9306
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav [class*="navList"],
|
|
9307
|
-
[data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav > :nth-child(2) {
|
|
9308
|
-
border: none !important;
|
|
9309
|
-
background: transparent !important;
|
|
9310
|
-
box-shadow: none !important;
|
|
9311
|
-
margin: 0 !important;
|
|
9312
|
-
padding: 0 !important;
|
|
9313
|
-
width: 100% !important;
|
|
9314
|
-
display: flex !important;
|
|
9315
|
-
flex-direction: column !important;
|
|
9316
|
-
align-items: center !important;
|
|
9317
|
-
gap: 4px !important;
|
|
9318
|
-
scrollbar-width: none !important;
|
|
9319
|
-
-ms-overflow-style: none !important;
|
|
9320
|
-
}
|
|
9321
|
-
|
|
9322
8988
|
.dcu-settings-nav-header-root {
|
|
9323
8989
|
align-items: center !important;
|
|
9324
8990
|
justify-content: center !important;
|
|
@@ -9370,9 +9036,7 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
9370
9036
|
align-items: center !important;
|
|
9371
9037
|
}
|
|
9372
9038
|
|
|
9373
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"] > nav
|
|
9374
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:has(> [class*="options"]) > nav,
|
|
9375
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > nav {
|
|
9039
|
+
html[data-dsh-glass-float] [data-shortcut-modal="settings"] > nav {
|
|
9376
9040
|
grid-column: 1 !important;
|
|
9377
9041
|
grid-row: 2 !important;
|
|
9378
9042
|
box-sizing: border-box !important;
|
|
@@ -9458,42 +9122,6 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
9458
9122
|
pointer-events: auto !important;
|
|
9459
9123
|
}
|
|
9460
9124
|
|
|
9461
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
9462
|
-
margin: 0 !important;
|
|
9463
|
-
border-radius: 0 !important;
|
|
9464
|
-
border: none !important;
|
|
9465
|
-
box-shadow: none !important;
|
|
9466
|
-
background: var(--dsw-alias-bg-base, #151517) !important;
|
|
9467
|
-
height: 100% !important;
|
|
9468
|
-
max-height: 100% !important;
|
|
9469
|
-
overflow: hidden !important;
|
|
9470
|
-
display: flex !important;
|
|
9471
|
-
flex-direction: column !important;
|
|
9472
|
-
}
|
|
9473
|
-
|
|
9474
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :first-child {
|
|
9475
|
-
background: transparent !important;
|
|
9476
|
-
border: none !important;
|
|
9477
|
-
border-bottom: none !important;
|
|
9478
|
-
flex: none !important;
|
|
9479
|
-
}
|
|
9480
|
-
|
|
9481
|
-
/* 右侧设置内容区:普通模式平铺紧贴,云母模式下复刻首页右侧 16px 圆角大卡片独立悬浮岛 */
|
|
9482
|
-
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) > :nth-child(2) {
|
|
9483
|
-
margin: 0 !important;
|
|
9484
|
-
border-radius: 0 !important;
|
|
9485
|
-
border: none !important;
|
|
9486
|
-
box-shadow: none !important;
|
|
9487
|
-
background: transparent !important;
|
|
9488
|
-
overflow-y: auto !important;
|
|
9489
|
-
flex: 1 1 auto !important;
|
|
9490
|
-
min-height: 0 !important;
|
|
9491
|
-
padding-top: 28px !important;
|
|
9492
|
-
padding-bottom: 40px !important;
|
|
9493
|
-
padding-inline: 20px !important;
|
|
9494
|
-
box-sizing: border-box !important;
|
|
9495
|
-
}
|
|
9496
|
-
|
|
9497
9125
|
html:not([data-dsh-glass-float]) [data-shortcut-modal="settings"]:has(> [class*="options"]) > [class*="options"] {
|
|
9498
9126
|
margin: 0 !important;
|
|
9499
9127
|
border-radius: 0 !important;
|
|
@@ -9509,23 +9137,11 @@ html[data-dsh-glass-float] [data-shortcut-modal="settings"][data-sidebar-collaps
|
|
|
9509
9137
|
box-sizing: border-box !important;
|
|
9510
9138
|
}
|
|
9511
9139
|
|
|
9512
|
-
html:not([data-dsh-glass-float]) body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav),
|
|
9513
|
-
html:not([data-dsh-glass-float]) html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav),
|
|
9514
9140
|
html:not([data-dsh-glass-float]) body:not([data-ds-dark-theme]) [data-shortcut-modal="settings"]:has(> [class*="options"]) > [class*="options"],
|
|
9515
9141
|
html:not([data-dsh-glass-float]) html[data-ds-theme-source="light"] [data-shortcut-modal="settings"]:has(> [class*="options"]) > [class*="options"] {
|
|
9516
9142
|
background: var(--dsw-alias-bg-base, #ffffff) !important;
|
|
9517
9143
|
}
|
|
9518
9144
|
|
|
9519
|
-
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:not(:has(> [class*="options"])) > div:not(nav) {
|
|
9520
|
-
margin: 8px 12px 12px 0 !important;
|
|
9521
|
-
border-radius: 16px !important;
|
|
9522
|
-
border: 1px solid var(--dsh-glass-rim-soft, rgba(0, 0, 0, 0.08)) !important;
|
|
9523
|
-
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;
|
|
9524
|
-
background: var(--dsw-alias-bg-layer-1) !important;
|
|
9525
|
-
overflow-y: auto !important;
|
|
9526
|
-
height: calc(100% - 20px) !important;
|
|
9527
|
-
}
|
|
9528
|
-
|
|
9529
9145
|
[data-shortcut-modal="settings"]:has(> [class*="options"]) > [class*="options"],
|
|
9530
9146
|
html[data-dsh-glass-float] [data-shortcut-modal="settings"]:has(> [class*="options"]) > [class*="options"] {
|
|
9531
9147
|
grid-column: 2 !important;
|
|
@@ -9919,8 +9535,8 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
9919
9535
|
const sidebarWidth = getHostSidebarExpandedWidth(panelEl.ownerDocument || document);
|
|
9920
9536
|
panelEl.style.setProperty("--dcu-settings-nav-width", `${sidebarWidth}px`);
|
|
9921
9537
|
}
|
|
9922
|
-
const navHeader = panelEl.querySelector(":scope > [class*=\"navTitle\"]")
|
|
9923
|
-
const navList = panelEl.querySelector("nav [class*=\"navList\"]")
|
|
9538
|
+
const navHeader = panelEl.querySelector(":scope > [class*=\"navTitle\"]");
|
|
9539
|
+
const navList = panelEl.querySelector("nav [class*=\"navList\"]");
|
|
9924
9540
|
if (!navList) return () => {};
|
|
9925
9541
|
const doc = panelEl.ownerDocument;
|
|
9926
9542
|
const phone = doc.defaultView?.matchMedia?.(MOBILE_SETTINGS_QUERY);
|
|
@@ -10314,7 +9930,7 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
10314
9930
|
};
|
|
10315
9931
|
//#endregion
|
|
10316
9932
|
//#region src/client/composer/draft-attachments.ts
|
|
10317
|
-
/**
|
|
9933
|
+
/** 检查通用附件草稿,保护已有附件不被历史召回覆盖。 */
|
|
10318
9934
|
function hasDraftAttachments(state) {
|
|
10319
9935
|
return (state.attachmentIds?.length ?? 0) > 0 || (state.imageIds?.length ?? 0) > 0;
|
|
10320
9936
|
}
|
|
@@ -13100,14 +12716,26 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
13100
12716
|
next.ids.splice(at, 0, workspaceId);
|
|
13101
12717
|
return { sections };
|
|
13102
12718
|
}
|
|
13103
|
-
/**
|
|
13104
|
-
function createSection(state, id, name) {
|
|
12719
|
+
/** 新建自定义分区,默认插到兜底分区之前;若指定 relativeToSectionId,则插在该分区之后(平级新建)。 */
|
|
12720
|
+
function createSection(state, id, name, relativeToSectionId) {
|
|
13105
12721
|
const sections = state.sections.map((section) => ({
|
|
13106
12722
|
...section,
|
|
13107
12723
|
ids: section.ids.slice()
|
|
13108
12724
|
}));
|
|
13109
|
-
|
|
13110
|
-
|
|
12725
|
+
let at;
|
|
12726
|
+
if (relativeToSectionId !== void 0) {
|
|
12727
|
+
const idx = sections.findIndex((section) => section.id === relativeToSectionId);
|
|
12728
|
+
if (idx !== -1) at = idx + 1;
|
|
12729
|
+
else {
|
|
12730
|
+
const defaultIndex = sections.findIndex((section) => section.id === DEFAULT_SECTION_ID);
|
|
12731
|
+
at = defaultIndex === -1 ? sections.length : defaultIndex;
|
|
12732
|
+
}
|
|
12733
|
+
} else {
|
|
12734
|
+
const defaultIndex = sections.findIndex((section) => section.id === DEFAULT_SECTION_ID);
|
|
12735
|
+
at = defaultIndex === -1 ? sections.length : defaultIndex;
|
|
12736
|
+
}
|
|
12737
|
+
const pinnedIndex = sections.findIndex((section) => section.id === PINNED_SECTION_ID);
|
|
12738
|
+
if (pinnedIndex !== -1 && at <= pinnedIndex) at = pinnedIndex + 1;
|
|
13111
12739
|
sections.splice(at, 0, {
|
|
13112
12740
|
id,
|
|
13113
12741
|
name,
|
|
@@ -13402,6 +13030,8 @@ html[data-dcu-mobile-web] [data-shortcut-modal="settings"][role="dialog"] {
|
|
|
13402
13030
|
//#region src/client/sidebar/sections/index.ts
|
|
13403
13031
|
/** 分区标题行的标记属性,样式与测试都靠它定位。 */
|
|
13404
13032
|
const SECTION_HEADER_ATTR = "data-dcu-ws-section";
|
|
13033
|
+
/** 顶部工作区横栏注入的新建分区操作标识。 */
|
|
13034
|
+
const CREATE_SECTION_ACTION = "create-section";
|
|
13405
13035
|
/** 追加在项目行菜单里的入口标记。 */
|
|
13406
13036
|
const MENU_ITEM_ATTR = "data-dcu-ws-section-item";
|
|
13407
13037
|
const HEADER_CLASS = "dcu-ws-section";
|
|
@@ -13458,6 +13088,12 @@ body[data-dcu-drag-blocked='true'] [class*="workspaceDropBefore"]::before,
|
|
|
13458
13088
|
body[data-dcu-drag-blocked='true'] [class*="workspaceDropAfter"]::after,
|
|
13459
13089
|
body[data-dcu-drag-blocked='true'] [class*="dropBefore"]::before,
|
|
13460
13090
|
body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !important}
|
|
13091
|
+
/* 顶部工作区横栏操作区扩展:原生宿主 max-width 为 60px 仅预留两颗按钮;注入新建分区后需放宽到 96px,
|
|
13092
|
+
未展开搜索时正常展示 3 颗按钮,当宿主展开搜索(添加 headerActionsHidden)时依然平滑折叠至 0 */
|
|
13093
|
+
[data-sidebar-workspace-header] [class*="headerActions"]:not([class*="headerActionsHidden"]),
|
|
13094
|
+
[class*="sectionHeader"] [class*="headerActions"]:not([class*="headerActionsHidden"]) {
|
|
13095
|
+
max-width: 96px;
|
|
13096
|
+
}
|
|
13461
13097
|
|
|
13462
13098
|
`;
|
|
13463
13099
|
/** 注入分区样式;已存在时复用(样式与组件生命周期解耦,卸载不摘除)。 */
|
|
@@ -13482,11 +13118,16 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
13482
13118
|
const id = key.slice(10);
|
|
13483
13119
|
return id === "" ? void 0 : id;
|
|
13484
13120
|
}
|
|
13121
|
+
/** 宿主侧栏是否处于收起(56px 导轨 / rail)形态。 */
|
|
13122
|
+
function isSidebarCollapsed() {
|
|
13123
|
+
return document.querySelector("[data-sidebar-collapsed=\"true\"]") !== null;
|
|
13124
|
+
}
|
|
13485
13125
|
/**
|
|
13486
13126
|
* 列表是否属于侧栏的「工作区」区块。
|
|
13487
13127
|
*
|
|
13488
|
-
*
|
|
13489
|
-
*
|
|
13128
|
+
* 频道、定时等页签下也会出现树形列表,只有同时满足下面条件才算工作区,避免把分区标题塞进别的列表:
|
|
13129
|
+
* 同一区域的区块标题带有操作按钮(展开态 2 颗或收起态/无目录流 1 颗)、列表里确有工作区行。
|
|
13130
|
+
* 收起形态由 CSS 及 isSidebarCollapsed 守卫隐藏标题和按钮,此处负责结构判定。
|
|
13490
13131
|
*/
|
|
13491
13132
|
function isWorkspaceRegion(list) {
|
|
13492
13133
|
if (list.querySelector("[data-row-key^=\"workspace:\"]") === null) return false;
|
|
@@ -13495,7 +13136,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
13495
13136
|
const header = node.querySelector("[class*=\"sectionHeader\"]");
|
|
13496
13137
|
if (header !== null) {
|
|
13497
13138
|
const actions = header.querySelector("[class*=\"headerActions\"]");
|
|
13498
|
-
if (actions !== null && actions.querySelectorAll("button").length >=
|
|
13139
|
+
if (actions !== null && actions.querySelectorAll("button").length >= 1) return true;
|
|
13499
13140
|
}
|
|
13500
13141
|
node = node.parentElement;
|
|
13501
13142
|
}
|
|
@@ -13771,6 +13412,36 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
13771
13412
|
pendingTargetSectionId = void 0;
|
|
13772
13413
|
}, 9e4);
|
|
13773
13414
|
}
|
|
13415
|
+
/** 在途的新建分区编辑行,供组件卸载(dispose)时清理残留的输入行 DOM。 */
|
|
13416
|
+
let activeCreatingRow = null;
|
|
13417
|
+
function positionCreatingRow(row, host, relativeToSectionId) {
|
|
13418
|
+
let ref = null;
|
|
13419
|
+
if (relativeToSectionId !== void 0) {
|
|
13420
|
+
const targetHeader = headers.get(relativeToSectionId);
|
|
13421
|
+
if (targetHeader !== void 0 && targetHeader.parentElement === host) {
|
|
13422
|
+
const memberIds = state.sections.find((s) => s.id === relativeToSectionId)?.ids ?? [];
|
|
13423
|
+
let lastMemberEl = null;
|
|
13424
|
+
for (const mId of memberIds) {
|
|
13425
|
+
const el = host.querySelector(`[data-row-key="workspace:${mId}"]`);
|
|
13426
|
+
if (el !== null) {
|
|
13427
|
+
const block = blockOf(el, host);
|
|
13428
|
+
if (block !== null && block.parentElement === host) lastMemberEl = block;
|
|
13429
|
+
}
|
|
13430
|
+
}
|
|
13431
|
+
ref = lastMemberEl !== null ? lastMemberEl.nextSibling : targetHeader.nextSibling;
|
|
13432
|
+
if (row.parentElement !== host || row.nextSibling !== ref) host.insertBefore(row, ref);
|
|
13433
|
+
return;
|
|
13434
|
+
}
|
|
13435
|
+
}
|
|
13436
|
+
const defaultHeader = headers.get(DEFAULT_SECTION_ID);
|
|
13437
|
+
if (defaultHeader !== void 0 && defaultHeader.parentElement === host) ref = defaultHeader;
|
|
13438
|
+
else {
|
|
13439
|
+
const lastHeader = Array.from(headers.values()).at(-1);
|
|
13440
|
+
if (lastHeader !== void 0 && lastHeader.parentElement === host) ref = lastHeader.nextSibling;
|
|
13441
|
+
else ref = host.firstChild;
|
|
13442
|
+
}
|
|
13443
|
+
if (row.parentElement !== host || row.nextSibling !== ref) host.insertBefore(row, ref);
|
|
13444
|
+
}
|
|
13774
13445
|
/**
|
|
13775
13446
|
* 宿主顶栏/侧栏头部原生「添加工作区」按钮的 8 门精确文案(同步自宿主 `workspace.add`)。
|
|
13776
13447
|
* 仅做精确全等匹配:既能绕开宿主工作区行右键菜单(`工作区“…”的操作`)与带省略号的菜单项(`添加工作区…`),
|
|
@@ -13800,6 +13471,71 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
13800
13471
|
for (const btn of candidates) if (isHostAddWorkspaceButton(btn)) return btn;
|
|
13801
13472
|
return null;
|
|
13802
13473
|
}
|
|
13474
|
+
function findHostHeaderActions(targetList = list) {
|
|
13475
|
+
const hostAddBtn = findHostAddWorkspaceButton();
|
|
13476
|
+
if (hostAddBtn !== null) {
|
|
13477
|
+
const parentActions = hostAddBtn.closest("[class*=\"headerActions\"]");
|
|
13478
|
+
if (parentActions !== null) return parentActions;
|
|
13479
|
+
}
|
|
13480
|
+
const byHeader = document.querySelector("[data-sidebar-workspace-header] [class*=\"headerActions\"], [class*=\"sectionHeader\"] [class*=\"headerActions\"]");
|
|
13481
|
+
if (byHeader !== null) return byHeader;
|
|
13482
|
+
const listEl = targetList ?? findWorkspaceList(document);
|
|
13483
|
+
if (listEl !== void 0) {
|
|
13484
|
+
const container = listEl.closest("[class*=\"root\"]") ?? listEl.parentElement?.parentElement;
|
|
13485
|
+
if (container !== null && container !== void 0) {
|
|
13486
|
+
const actions = container.querySelector("[class*=\"headerActions\"]");
|
|
13487
|
+
if (actions !== null) return actions;
|
|
13488
|
+
}
|
|
13489
|
+
}
|
|
13490
|
+
return null;
|
|
13491
|
+
}
|
|
13492
|
+
function syncHostCreateSectionButton(targetList = list) {
|
|
13493
|
+
if (disposed) return;
|
|
13494
|
+
if (!sectionsLoaded || targetList === void 0 || isSidebarCollapsed()) {
|
|
13495
|
+
removeHostCreateSectionButton();
|
|
13496
|
+
return;
|
|
13497
|
+
}
|
|
13498
|
+
const actionsContainer = findHostHeaderActions(targetList);
|
|
13499
|
+
if (actionsContainer === null) return;
|
|
13500
|
+
let btn = actionsContainer.querySelector(`button[data-dcu-action="${CREATE_SECTION_ACTION}"]`);
|
|
13501
|
+
if (btn === null) {
|
|
13502
|
+
const templateBtn = actionsContainer.querySelector("button");
|
|
13503
|
+
if (templateBtn !== null) btn = templateBtn.cloneNode(false);
|
|
13504
|
+
else {
|
|
13505
|
+
btn = document.createElement("button");
|
|
13506
|
+
btn.className = `${HEADER_CLASS}-action`;
|
|
13507
|
+
}
|
|
13508
|
+
btn.setAttribute("type", "button");
|
|
13509
|
+
btn.setAttribute("data-dcu-action", CREATE_SECTION_ACTION);
|
|
13510
|
+
btn.removeAttribute("aria-keyshortcuts");
|
|
13511
|
+
btn.removeAttribute("tabindex");
|
|
13512
|
+
btn.removeAttribute("aria-haspopup");
|
|
13513
|
+
btn.removeAttribute("aria-expanded");
|
|
13514
|
+
btn.removeAttribute("data-context-menu-trigger");
|
|
13515
|
+
btn.innerHTML = iconPlus();
|
|
13516
|
+
const label = text("sections.new", "新建分区");
|
|
13517
|
+
btn.setAttribute("aria-label", label);
|
|
13518
|
+
btn.setAttribute("title", label);
|
|
13519
|
+
btn.addEventListener("click", (event) => {
|
|
13520
|
+
event.preventDefault();
|
|
13521
|
+
event.stopPropagation();
|
|
13522
|
+
startCreateSection();
|
|
13523
|
+
});
|
|
13524
|
+
let insertAnchor = findHostAddWorkspaceButton();
|
|
13525
|
+
while (insertAnchor !== null && insertAnchor.parentElement !== actionsContainer) insertAnchor = insertAnchor.parentElement;
|
|
13526
|
+
if (insertAnchor !== null && insertAnchor.parentElement === actionsContainer) actionsContainer.insertBefore(btn, insertAnchor);
|
|
13527
|
+
else actionsContainer.appendChild(btn);
|
|
13528
|
+
} else {
|
|
13529
|
+
const label = text("sections.new", "新建分区");
|
|
13530
|
+
if (btn.getAttribute("aria-label") !== label) {
|
|
13531
|
+
btn.setAttribute("aria-label", label);
|
|
13532
|
+
btn.setAttribute("title", label);
|
|
13533
|
+
}
|
|
13534
|
+
}
|
|
13535
|
+
}
|
|
13536
|
+
function removeHostCreateSectionButton() {
|
|
13537
|
+
for (const btn of Array.from(document.querySelectorAll(`button[data-dcu-action="${CREATE_SECTION_ACTION}"]`))) btn.remove();
|
|
13538
|
+
}
|
|
13803
13539
|
function triggerHostAddWorkspace() {
|
|
13804
13540
|
triggeringHostAdd = true;
|
|
13805
13541
|
try {
|
|
@@ -14087,6 +13823,15 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14087
13823
|
}
|
|
14088
13824
|
/** 上一次算对齐时的(标题数+列宽)组合,避免每帧量 rect。 */
|
|
14089
13825
|
let lastAlignKey = "";
|
|
13826
|
+
/**
|
|
13827
|
+
* 获取逻辑上的下一个结构兄弟元素,跳过在途的新建分区编辑行(.dcu-ws-section-editing)。
|
|
13828
|
+
* 编辑行是临时行内输入层,对分区标题的结构定位完全透明,避免 sync 重排误将空分区标题搬到编辑行后面。
|
|
13829
|
+
*/
|
|
13830
|
+
function nextStructuralSibling(node) {
|
|
13831
|
+
let cur = node?.nextElementSibling ?? null;
|
|
13832
|
+
while (cur !== null && cur.classList.contains(`${HEADER_CLASS}-editing`)) cur = cur.nextElementSibling;
|
|
13833
|
+
return cur;
|
|
13834
|
+
}
|
|
14090
13835
|
/** 把标题按分区顺序放到各自第一个分组块前面;空分区贴着下一个分区显示。 */
|
|
14091
13836
|
function placeHeaders(blocks, layoutState = state) {
|
|
14092
13837
|
if (blocks.length === 0) {
|
|
@@ -14125,7 +13870,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14125
13870
|
continue;
|
|
14126
13871
|
}
|
|
14127
13872
|
const header = ensureHeader(section.id, section.name);
|
|
14128
|
-
if (header.parentElement !== target || header
|
|
13873
|
+
if (header.parentElement !== target || nextStructuralSibling(header) !== reference) target.insertBefore(header, reference);
|
|
14129
13874
|
reference = header;
|
|
14130
13875
|
}
|
|
14131
13876
|
const memberOf = /* @__PURE__ */ new Map();
|
|
@@ -14183,7 +13928,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14183
13928
|
}
|
|
14184
13929
|
scheduleStickyUpdate();
|
|
14185
13930
|
}
|
|
14186
|
-
/**
|
|
13931
|
+
/** 列表不在工作区视图(切换至频道、定时等非工作区页签)时摘掉标题,避免串到别的列表里。 */
|
|
14187
13932
|
function detachHeaders() {
|
|
14188
13933
|
for (const header of headers.values()) header.remove();
|
|
14189
13934
|
headers.clear();
|
|
@@ -14412,7 +14157,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14412
14157
|
icon: iconPlus(),
|
|
14413
14158
|
onSelect: () => {
|
|
14414
14159
|
closeSectionMenu();
|
|
14415
|
-
startCreateSection();
|
|
14160
|
+
startCreateSection(sectionId);
|
|
14416
14161
|
}
|
|
14417
14162
|
});
|
|
14418
14163
|
if (!builtin) items.push({
|
|
@@ -14465,8 +14210,9 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14465
14210
|
input.addEventListener("blur", () => finish(true));
|
|
14466
14211
|
}
|
|
14467
14212
|
/** 新建分区:在列表里插一行输入框,回车创建(宿主 web 里 window.prompt 被禁用,所以不用 prompt)。 */
|
|
14468
|
-
function startCreateSection(workspaceId) {
|
|
14469
|
-
|
|
14213
|
+
function startCreateSection(relativeToSectionId, workspaceId) {
|
|
14214
|
+
if (isSidebarCollapsed()) return;
|
|
14215
|
+
const host = list ?? findWorkspaceList(document);
|
|
14470
14216
|
if (host === void 0) return;
|
|
14471
14217
|
const row = document.createElement("div");
|
|
14472
14218
|
row.className = `${HEADER_CLASS} ${HEADER_CLASS}-editing`;
|
|
@@ -14475,19 +14221,20 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14475
14221
|
input.placeholder = text("sections.newName", "新分区名称");
|
|
14476
14222
|
input.maxLength = 24;
|
|
14477
14223
|
row.appendChild(input);
|
|
14478
|
-
|
|
14479
|
-
|
|
14480
|
-
else host.insertBefore(row, host.firstChild);
|
|
14224
|
+
positionCreatingRow(row, host, relativeToSectionId);
|
|
14225
|
+
activeCreatingRow = row;
|
|
14481
14226
|
input.focus();
|
|
14227
|
+
input.scrollIntoView?.({ block: "nearest" });
|
|
14482
14228
|
let done = false;
|
|
14483
14229
|
const finish = (commitValue) => {
|
|
14484
14230
|
if (done) return;
|
|
14485
14231
|
done = true;
|
|
14232
|
+
activeCreatingRow = null;
|
|
14486
14233
|
const value = input.value.trim();
|
|
14487
14234
|
row.remove();
|
|
14488
14235
|
if (!commitValue || value === "") return;
|
|
14489
14236
|
const id = `s${Date.now().toString(36)}`;
|
|
14490
|
-
const created = createSection(state, id, value);
|
|
14237
|
+
const created = createSection(state, id, value, relativeToSectionId);
|
|
14491
14238
|
if (workspaceId === void 0) commit(created);
|
|
14492
14239
|
else commitExplicit(assignWorkspace(created, workspaceId, id), [workspaceId]);
|
|
14493
14240
|
};
|
|
@@ -14922,7 +14669,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
14922
14669
|
onSelect: () => {
|
|
14923
14670
|
closeSectionMenu();
|
|
14924
14671
|
closeMenusByEscape();
|
|
14925
|
-
startCreateSection(workspaceId);
|
|
14672
|
+
startCreateSection(void 0, workspaceId);
|
|
14926
14673
|
}
|
|
14927
14674
|
});
|
|
14928
14675
|
openHostPanel(anchor, items, parentMenu);
|
|
@@ -15027,9 +14774,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15027
14774
|
const next = findWorkspaceList(document);
|
|
15028
14775
|
if (next === void 0) {
|
|
15029
14776
|
detachHeaders();
|
|
14777
|
+
removeHostCreateSectionButton();
|
|
15030
14778
|
return;
|
|
15031
14779
|
}
|
|
15032
14780
|
list = next;
|
|
14781
|
+
syncHostCreateSectionButton(next);
|
|
15033
14782
|
if (!wired) {
|
|
15034
14783
|
wired = true;
|
|
15035
14784
|
subscribeWorkspaces();
|
|
@@ -15175,6 +14924,10 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15175
14924
|
}
|
|
15176
14925
|
let touched = false;
|
|
15177
14926
|
for (const mutation of mutations) {
|
|
14927
|
+
if (mutation.type === "attributes" && mutation.attributeName === "data-sidebar-collapsed") {
|
|
14928
|
+
touched = true;
|
|
14929
|
+
break;
|
|
14930
|
+
}
|
|
15178
14931
|
for (const node of Array.from(mutation.addedNodes)) {
|
|
15179
14932
|
if (node instanceof Element && node.closest(`.${HEADER_CLASS}`) !== null) continue;
|
|
15180
14933
|
touched = true;
|
|
@@ -15196,7 +14949,9 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15196
14949
|
});
|
|
15197
14950
|
observer.observe(document.body, {
|
|
15198
14951
|
childList: true,
|
|
15199
|
-
subtree: true
|
|
14952
|
+
subtree: true,
|
|
14953
|
+
attributes: true,
|
|
14954
|
+
attributeFilter: ["data-sidebar-collapsed"]
|
|
15200
14955
|
});
|
|
15201
14956
|
}
|
|
15202
14957
|
function subscribeWorkspaces() {
|
|
@@ -15247,6 +15002,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15247
15002
|
if (stickyRaf !== 0) window.cancelAnimationFrame(stickyRaf);
|
|
15248
15003
|
unsubscribeDirectoryFlow?.();
|
|
15249
15004
|
unsubscribe?.();
|
|
15005
|
+
if (activeCreatingRow !== null) {
|
|
15006
|
+
activeCreatingRow.remove();
|
|
15007
|
+
activeCreatingRow = null;
|
|
15008
|
+
}
|
|
15009
|
+
removeHostCreateSectionButton();
|
|
15250
15010
|
closeSectionMenu();
|
|
15251
15011
|
flushSectionsSave();
|
|
15252
15012
|
for (const header of headers.values()) header.remove();
|
|
@@ -15263,55 +15023,6 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15263
15023
|
}
|
|
15264
15024
|
//#endregion
|
|
15265
15025
|
//#region src/client/sidebar/session-unread/model.ts
|
|
15266
|
-
/** 会话行 `data-row-key` 的前缀。 */
|
|
15267
|
-
const SESSION_ROW_KEY_PREFIX = "session:";
|
|
15268
|
-
/** 宿主行内操作区(CSS Module 哈希前后都保留 `rowActions`)。 */
|
|
15269
|
-
const ROW_ACTIONS_SELECTOR = "[class*=\"rowActions\"]";
|
|
15270
|
-
/**
|
|
15271
|
-
* 从宿主行的 `data-row-key` 解析会话 id。
|
|
15272
|
-
*
|
|
15273
|
-
* @param key - 行节点的 `data-row-key`。
|
|
15274
|
-
* @returns 会话 id;工作区行、其它行与空键返回 undefined。
|
|
15275
|
-
*/
|
|
15276
|
-
function sessionIdOfRowKey(key) {
|
|
15277
|
-
if (key === null || key === void 0 || !key.startsWith(SESSION_ROW_KEY_PREFIX)) return void 0;
|
|
15278
|
-
const id = key.slice(8);
|
|
15279
|
-
return id === "" ? void 0 : id;
|
|
15280
|
-
}
|
|
15281
|
-
/**
|
|
15282
|
-
* 是否有外部插件往操作区塞了非菜单按钮(归档管理器的星标就是这么插的)。
|
|
15283
|
-
*
|
|
15284
|
-
* @param button - 操作区内的候选按钮。
|
|
15285
|
-
* @returns 是外部按钮时返回 true。
|
|
15286
|
-
*/
|
|
15287
|
-
function isForeignButton(button) {
|
|
15288
|
-
const className = button.getAttribute("class") ?? "";
|
|
15289
|
-
return className.includes("rowStar") || className.includes("dsham_");
|
|
15290
|
-
}
|
|
15291
|
-
/**
|
|
15292
|
-
* 找到会话行的「···」菜单锚点。
|
|
15293
|
-
*
|
|
15294
|
-
* 两代宿主结构都要认:
|
|
15295
|
-
* - 0.2.2+ 给锚点打了 `data-context-menu-trigger`,快捷操作收进 `rowQuickActions`;
|
|
15296
|
-
* - 0.2.1 由 `Menu` 原语把锚点包在自己的 `span` 里,归档 / 置顶按钮与它平级。
|
|
15297
|
-
* 标记优先,其次按「非快捷操作区的包裹果」、再按「直接子按钮」兜底。空白会话行没有
|
|
15298
|
-
* 操作区,返回 null(右击时保留浏览器原生菜单)。
|
|
15299
|
-
*
|
|
15300
|
-
* @param row - 会话行节点。
|
|
15301
|
-
* @returns 菜单锚点按钮或 null。
|
|
15302
|
-
*/
|
|
15303
|
-
function findSessionMenuButton(row) {
|
|
15304
|
-
const actions = row.querySelector(ROW_ACTIONS_SELECTOR);
|
|
15305
|
-
if (actions === null) return null;
|
|
15306
|
-
const marked = actions.querySelector("button[data-context-menu-trigger]");
|
|
15307
|
-
if (marked !== null && !isForeignButton(marked)) return marked;
|
|
15308
|
-
const notQuickAction = (button) => !isForeignButton(button) && button.closest("[class*=\"rowQuickActions\"]") === null;
|
|
15309
|
-
const wrapped = Array.from(actions.querySelectorAll(":scope > span > button")).filter(notQuickAction);
|
|
15310
|
-
if (wrapped.length > 0) return wrapped[0] ?? null;
|
|
15311
|
-
const direct = Array.from(actions.querySelectorAll(":scope > button")).filter(notQuickAction);
|
|
15312
|
-
if (direct.length > 0) return direct[0] ?? null;
|
|
15313
|
-
return Array.from(actions.querySelectorAll("button")).filter(notQuickAction)[0] ?? null;
|
|
15314
|
-
}
|
|
15315
15026
|
/**
|
|
15316
15027
|
* 读取可写的未读集合。
|
|
15317
15028
|
*
|
|
@@ -15391,8 +15102,6 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15391
15102
|
}
|
|
15392
15103
|
//#endregion
|
|
15393
15104
|
//#region src/client/sidebar/session-unread/index.tsx
|
|
15394
|
-
/** 宿主会话行菜单槽位(行操作列表)。 */
|
|
15395
|
-
const MENU_SLOT = "sidebar.workspaces.session.menu.item";
|
|
15396
15105
|
/** 槽位内本子插件的行 id:命名空间化,避免与宿主行冲突。 */
|
|
15397
15106
|
const MENU_ITEM_ID = "codex-ui:session-unread";
|
|
15398
15107
|
/** 排在置顶(100)之后、重命名(200)之前。 */
|
|
@@ -15401,66 +15110,7 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15401
15110
|
const ICON_UNREAD_KEY = "codex-ui:icon-session-unread";
|
|
15402
15111
|
const ICON_READ_KEY = "codex-ui:icon-session-read";
|
|
15403
15112
|
/**
|
|
15404
|
-
* 「标记为未读 / 标记为已读」菜单行。
|
|
15405
|
-
*
|
|
15406
|
-
* 宿主标准 hook 缺一环就整行不渲染:这是可选增强,绝不能让一个缺失的宿主能力
|
|
15407
|
-
* 把整份会话菜单拖垮。
|
|
15408
|
-
*
|
|
15409
|
-
* @param props - 宿主组合 props(见 {@link MarkUnreadMenuProps})。
|
|
15410
|
-
* @returns 一行菜单项,或 null(未读不可写 / 已归档 / 正在主视图打开)。
|
|
15411
|
-
*/
|
|
15412
|
-
function MarkUnreadMenuItem(props) {
|
|
15413
|
-
const { useMenuOpenState, useSessionStatus, useSessions, useWorkspaces } = props;
|
|
15414
|
-
if (typeof useMenuOpenState !== "function" || typeof useSessionStatus !== "function" || typeof useSessions !== "function" || typeof useWorkspaces !== "function" || typeof props.markUnread !== "function" || typeof props.markRead !== "function") return null;
|
|
15415
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MarkUnreadMenuRow, { ...props });
|
|
15416
|
-
}
|
|
15417
|
-
/**
|
|
15418
|
-
* 菜单行的渲染主体:hooks 必须无条件调用,因此与能力守卫拆成两个组件。
|
|
15419
|
-
*
|
|
15420
|
-
* @param props - 已确认具备全部宿主 hook 的组合 props。
|
|
15421
|
-
* @returns 菜单项或 null。
|
|
15422
|
-
*/
|
|
15423
|
-
function MarkUnreadMenuRow(props) {
|
|
15424
|
-
const { markRead, markUnread, sessionId, t } = props;
|
|
15425
|
-
const [, setMenuOpen] = props.useMenuOpenState();
|
|
15426
|
-
const unread = props.useSessionStatus((statuses) => statuses.get(sessionId)?.completionUnread === true);
|
|
15427
|
-
const busy = props.useSessionStatus((statuses) => isSessionBusy(statuses.get(sessionId)));
|
|
15428
|
-
const openInMainView = props.useSessions((list) => isSessionOpenInMainView(list.byId[sessionId]));
|
|
15429
|
-
const archived = props.useWorkspaces((state) => isSessionArchived(state.archivedSessionIds, sessionId));
|
|
15430
|
-
if (!shouldShowSessionUnreadAction({
|
|
15431
|
-
canWrite: typeof props.canWrite === "function" ? props.canWrite() : props.canWrite === true,
|
|
15432
|
-
isUnread: unread,
|
|
15433
|
-
isArchived: archived,
|
|
15434
|
-
isOpenInMainView: openInMainView,
|
|
15435
|
-
isBusy: busy
|
|
15436
|
-
})) return null;
|
|
15437
|
-
const select = (next) => {
|
|
15438
|
-
setMenuOpen(false);
|
|
15439
|
-
if (next) markUnread(sessionId);
|
|
15440
|
-
else markRead(sessionId);
|
|
15441
|
-
};
|
|
15442
|
-
if (unread) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
15443
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckCircleOutlineRegular, { size: 16 }),
|
|
15444
|
-
onSelect: () => select(false),
|
|
15445
|
-
children: t("session.markRead")
|
|
15446
|
-
});
|
|
15447
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
|
|
15448
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
15449
|
-
state: "done",
|
|
15450
|
-
size: 10
|
|
15451
|
-
}),
|
|
15452
|
-
onSelect: () => select(true),
|
|
15453
|
-
children: t("session.markUnread")
|
|
15454
|
-
});
|
|
15455
|
-
}
|
|
15456
|
-
/**
|
|
15457
15113
|
* 从客户端 Context 惰性读取宿主 `uiSession`。
|
|
15458
|
-
*
|
|
15459
|
-
* 故意不列入插件 inject:服务缺失时本能力整体降级,不影响插件其它功能加载;
|
|
15460
|
-
* 服务晚到时因为每次点击才读取,标记依然可用。
|
|
15461
|
-
*
|
|
15462
|
-
* @param ctx - 客户端插件 Context。
|
|
15463
|
-
* @returns 宿主服务的最小可用面或 undefined。
|
|
15464
15114
|
*/
|
|
15465
15115
|
function unreadHostOf(ctx) {
|
|
15466
15116
|
try {
|
|
@@ -15483,16 +15133,11 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15483
15133
|
return;
|
|
15484
15134
|
}
|
|
15485
15135
|
}
|
|
15486
|
-
function hostOwnsContextMenu(ctx) {
|
|
15487
|
-
return typeof getNativeContextMenuService(ctx)?.open === "function";
|
|
15488
|
-
}
|
|
15489
15136
|
/**
|
|
15490
15137
|
* 挂载会话未读能力。
|
|
15491
15138
|
*
|
|
15492
|
-
*
|
|
15493
|
-
*
|
|
15494
|
-
* - DSH 0.2.0 / 0.2.1:老版宿主无 contextMenus 服务,注册 sidebar.workspaces.session.menu.item
|
|
15495
|
-
* 并安装文档级 contextmenu 委托点击「···」锚点唤起菜单。
|
|
15139
|
+
* DSH 0.2.2+:宿主拥有 contextMenus 服务,直接通过 contextMenus.register(..., order: 150)
|
|
15140
|
+
* 注入会话菜单,精准排在置顶(100)之后、重命名(200)之前;同时注入 contextMenu.icon。
|
|
15496
15141
|
*
|
|
15497
15142
|
* @param ctx - 客户端插件 Context。
|
|
15498
15143
|
* @returns 卸载函数(重复调用安全)。
|
|
@@ -15503,145 +15148,100 @@ body[data-dcu-drag-blocked='true'] [class*="dropAfter"]::after{display:none !imp
|
|
|
15503
15148
|
const markUnread = (sessionId) => writeSessionUnread(unreadHostOf(ctx), sessionId, true);
|
|
15504
15149
|
const markRead = (sessionId) => writeSessionUnread(unreadHostOf(ctx), sessionId, false);
|
|
15505
15150
|
const nativeContextMenus = getNativeContextMenuService(ctx);
|
|
15506
|
-
if (typeof nativeContextMenus?.register
|
|
15507
|
-
|
|
15508
|
-
|
|
15509
|
-
|
|
15510
|
-
try {
|
|
15511
|
-
const u1 = slots.inject("contextMenu.icon", () => slots.register({
|
|
15512
|
-
name: "contextMenu.icon",
|
|
15513
|
-
key: ICON_UNREAD_KEY
|
|
15514
|
-
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
15515
|
-
state: "done",
|
|
15516
|
-
size: 10
|
|
15517
|
-
})));
|
|
15518
|
-
if (typeof u1 === "function") disposeUnreadIcon = u1;
|
|
15519
|
-
} catch {}
|
|
15520
|
-
try {
|
|
15521
|
-
const u2 = slots.inject("contextMenu.icon", () => slots.register({
|
|
15522
|
-
name: "contextMenu.icon",
|
|
15523
|
-
key: ICON_READ_KEY
|
|
15524
|
-
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckCircleOutlineRegular, { size: 16 })));
|
|
15525
|
-
if (typeof u2 === "function") disposeReadIcon = u2;
|
|
15526
|
-
} catch {}
|
|
15527
|
-
}
|
|
15528
|
-
let unregNative;
|
|
15151
|
+
if (typeof nativeContextMenus?.register !== "function") return () => {};
|
|
15152
|
+
let disposeUnreadIcon;
|
|
15153
|
+
let disposeReadIcon;
|
|
15154
|
+
if (slots !== void 0 && typeof slots.inject === "function" && typeof slots.register === "function") {
|
|
15529
15155
|
try {
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
|
|
15534
|
-
|
|
15535
|
-
|
|
15536
|
-
|
|
15537
|
-
|
|
15538
|
-
|
|
15539
|
-
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
|
|
15543
|
-
|
|
15544
|
-
|
|
15545
|
-
|
|
15546
|
-
const workspaces = ctx.get?.("workspaces") ?? ctx.workspaces;
|
|
15547
|
-
archived = isSessionArchived((workspaces?.list?.getSnapshot?.() ?? workspaces?.getSnapshot?.())?.archivedSessionIds, sessionId);
|
|
15548
|
-
} catch {}
|
|
15549
|
-
let openInMainView = false;
|
|
15550
|
-
let busy = false;
|
|
15551
|
-
try {
|
|
15552
|
-
const sessions = ctx.get?.("sessions") ?? ctx.sessions;
|
|
15553
|
-
const list = sessions?.list?.getSnapshot?.() ?? sessions?.getSnapshot?.();
|
|
15554
|
-
const sessionItem = list?.byId?.[sessionId] ?? list?.items?.find?.((s) => s.id === sessionId);
|
|
15555
|
-
openInMainView = isSessionOpenInMainView(sessionItem);
|
|
15556
|
-
const uiSession = unreadHost;
|
|
15557
|
-
const statusMap = uiSession?.sessionStatus?.getSnapshot?.() ?? uiSession?.sessionStatus;
|
|
15558
|
-
busy = isSessionBusy(statusMap instanceof Map ? statusMap.get(sessionId) : statusMap?.[sessionId] ?? uiSession?.statusOf?.(sessionId), sessionItem);
|
|
15559
|
-
} catch {}
|
|
15560
|
-
if (!shouldShowSessionUnreadAction({
|
|
15561
|
-
canWrite,
|
|
15562
|
-
isUnread,
|
|
15563
|
-
isArchived: archived,
|
|
15564
|
-
isOpenInMainView: openInMainView,
|
|
15565
|
-
isBusy: busy
|
|
15566
|
-
})) return [];
|
|
15567
|
-
const t = ctx.locale?.bind?.("michengai.codexUi") ?? ((k) => k);
|
|
15568
|
-
if (isUnread) return [{
|
|
15569
|
-
id: "mark-read",
|
|
15570
|
-
label: t("session.markRead"),
|
|
15571
|
-
icon: { key: ICON_READ_KEY },
|
|
15572
|
-
run: () => {
|
|
15573
|
-
markRead(sessionId);
|
|
15574
|
-
}
|
|
15575
|
-
}];
|
|
15576
|
-
return [{
|
|
15577
|
-
id: "mark-unread",
|
|
15578
|
-
label: t("session.markUnread"),
|
|
15579
|
-
icon: { key: ICON_UNREAD_KEY },
|
|
15580
|
-
run: () => {
|
|
15581
|
-
markUnread(sessionId);
|
|
15582
|
-
}
|
|
15583
|
-
}];
|
|
15584
|
-
}
|
|
15585
|
-
});
|
|
15586
|
-
} catch (error) {
|
|
15587
|
-
console.warn("[codex-ui:session-unread] 注册原生 contextMenus 失败,跳过。", error);
|
|
15588
|
-
}
|
|
15589
|
-
return () => {
|
|
15590
|
-
if (disposed) return;
|
|
15591
|
-
disposed = true;
|
|
15592
|
-
if (typeof unregNative === "function") try {
|
|
15593
|
-
unregNative();
|
|
15594
|
-
} catch {}
|
|
15595
|
-
if (typeof disposeUnreadIcon === "function") try {
|
|
15596
|
-
disposeUnreadIcon();
|
|
15597
|
-
} catch {}
|
|
15598
|
-
if (typeof disposeReadIcon === "function") try {
|
|
15599
|
-
disposeReadIcon();
|
|
15600
|
-
} catch {}
|
|
15601
|
-
};
|
|
15156
|
+
const u1 = slots.inject("contextMenu.icon", () => slots.register({
|
|
15157
|
+
name: "contextMenu.icon",
|
|
15158
|
+
key: ICON_UNREAD_KEY
|
|
15159
|
+
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.StateDot, {
|
|
15160
|
+
state: "done",
|
|
15161
|
+
size: 10
|
|
15162
|
+
})));
|
|
15163
|
+
if (typeof u1 === "function") disposeUnreadIcon = u1;
|
|
15164
|
+
} catch {}
|
|
15165
|
+
try {
|
|
15166
|
+
const u2 = slots.inject("contextMenu.icon", () => slots.register({
|
|
15167
|
+
name: "contextMenu.icon",
|
|
15168
|
+
key: ICON_READ_KEY
|
|
15169
|
+
}, () => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckCircleOutlineRegular, { size: 16 })));
|
|
15170
|
+
if (typeof u2 === "function") disposeReadIcon = u2;
|
|
15171
|
+
} catch {}
|
|
15602
15172
|
}
|
|
15603
|
-
|
|
15604
|
-
let disposeEntry;
|
|
15173
|
+
let unregNative;
|
|
15605
15174
|
try {
|
|
15606
|
-
|
|
15607
|
-
name: MENU_SLOT,
|
|
15175
|
+
unregNative = nativeContextMenus.register({
|
|
15608
15176
|
id: MENU_ITEM_ID,
|
|
15177
|
+
target: "session",
|
|
15609
15178
|
order: MENU_ORDER,
|
|
15610
|
-
|
|
15611
|
-
|
|
15612
|
-
|
|
15613
|
-
|
|
15614
|
-
|
|
15615
|
-
|
|
15616
|
-
|
|
15179
|
+
observe: () => {
|
|
15180
|
+
const sessionStatus = unreadHostOf(ctx)?.sessionStatus;
|
|
15181
|
+
return [ctx.locale, ...sessionStatus?.subscribe ? [sessionStatus] : []];
|
|
15182
|
+
},
|
|
15183
|
+
resolve: (target) => {
|
|
15184
|
+
const sessionId = target?.sessionId;
|
|
15185
|
+
if (!sessionId) return [];
|
|
15186
|
+
const unreadHost = unreadHostOf(ctx);
|
|
15187
|
+
const canWrite = canMarkSession(unreadHost);
|
|
15188
|
+
const isUnread = unreadSetOf(unreadHost)?.has(sessionId) === true;
|
|
15189
|
+
let archived = false;
|
|
15190
|
+
try {
|
|
15191
|
+
const workspaces = ctx.get?.("workspaces") ?? ctx.workspaces;
|
|
15192
|
+
archived = isSessionArchived((workspaces?.list?.getSnapshot?.() ?? workspaces?.getSnapshot?.())?.archivedSessionIds, sessionId);
|
|
15193
|
+
} catch {}
|
|
15194
|
+
let openInMainView = false;
|
|
15195
|
+
let busy = false;
|
|
15196
|
+
try {
|
|
15197
|
+
const sessions = ctx.get?.("sessions") ?? ctx.sessions;
|
|
15198
|
+
const list = sessions?.list?.getSnapshot?.() ?? sessions?.getSnapshot?.();
|
|
15199
|
+
const sessionItem = list?.byId?.[sessionId] ?? list?.items?.find?.((s) => s.id === sessionId);
|
|
15200
|
+
openInMainView = isSessionOpenInMainView(sessionItem);
|
|
15201
|
+
const uiSession = unreadHost;
|
|
15202
|
+
const statusMap = uiSession?.sessionStatus?.getSnapshot?.() ?? uiSession?.sessionStatus;
|
|
15203
|
+
busy = isSessionBusy(statusMap instanceof Map ? statusMap.get(sessionId) : statusMap?.[sessionId] ?? uiSession?.statusOf?.(sessionId), sessionItem);
|
|
15204
|
+
} catch {}
|
|
15205
|
+
if (!shouldShowSessionUnreadAction({
|
|
15206
|
+
canWrite,
|
|
15207
|
+
isUnread,
|
|
15208
|
+
isArchived: archived,
|
|
15209
|
+
isOpenInMainView: openInMainView,
|
|
15210
|
+
isBusy: busy
|
|
15211
|
+
})) return [];
|
|
15212
|
+
const t = ctx.locale?.bind?.("michengai.codexUi") ?? ((k) => k);
|
|
15213
|
+
if (isUnread) return [{
|
|
15214
|
+
id: "mark-read",
|
|
15215
|
+
label: t("session.markRead"),
|
|
15216
|
+
icon: { key: ICON_READ_KEY },
|
|
15217
|
+
run: () => {
|
|
15218
|
+
markRead(sessionId);
|
|
15219
|
+
}
|
|
15220
|
+
}];
|
|
15221
|
+
return [{
|
|
15222
|
+
id: "mark-unread",
|
|
15223
|
+
label: t("session.markUnread"),
|
|
15224
|
+
icon: { key: ICON_UNREAD_KEY },
|
|
15225
|
+
run: () => {
|
|
15226
|
+
markUnread(sessionId);
|
|
15227
|
+
}
|
|
15228
|
+
}];
|
|
15229
|
+
}
|
|
15230
|
+
});
|
|
15617
15231
|
} catch (error) {
|
|
15618
|
-
console.warn("[codex-ui:session-unread]
|
|
15619
|
-
return () => {};
|
|
15232
|
+
console.warn("[codex-ui:session-unread] 注册原生 contextMenus 失败,跳过。", error);
|
|
15620
15233
|
}
|
|
15621
|
-
const onContextMenu = (event) => {
|
|
15622
|
-
if (disposed || event.defaultPrevented) return;
|
|
15623
|
-
const target = event.target;
|
|
15624
|
-
if (!(target instanceof Element)) return;
|
|
15625
|
-
if (target.closest("input, textarea, [contenteditable='true']") !== null) return;
|
|
15626
|
-
if (target.closest("[role=\"menu\"]") !== null) return;
|
|
15627
|
-
const row = target.closest("[data-row-key]");
|
|
15628
|
-
if (row === null || sessionIdOfRowKey(row.getAttribute("data-row-key")) === void 0) return;
|
|
15629
|
-
if (hostOwnsContextMenu(ctx) || row.querySelector("[data-context-menu-trigger]") !== null) return;
|
|
15630
|
-
const selection = typeof window.getSelection === "function" ? window.getSelection() : null;
|
|
15631
|
-
if (selection !== null && selection.toString().trim() !== "") return;
|
|
15632
|
-
const menuButton = findSessionMenuButton(row);
|
|
15633
|
-
if (menuButton === null) return;
|
|
15634
|
-
event.preventDefault();
|
|
15635
|
-
menuButton.click();
|
|
15636
|
-
};
|
|
15637
|
-
document.addEventListener("contextmenu", onContextMenu, true);
|
|
15638
15234
|
return () => {
|
|
15639
15235
|
if (disposed) return;
|
|
15640
15236
|
disposed = true;
|
|
15641
|
-
|
|
15642
|
-
|
|
15643
|
-
|
|
15644
|
-
|
|
15237
|
+
if (typeof unregNative === "function") try {
|
|
15238
|
+
unregNative();
|
|
15239
|
+
} catch {}
|
|
15240
|
+
if (typeof disposeUnreadIcon === "function") try {
|
|
15241
|
+
disposeUnreadIcon();
|
|
15242
|
+
} catch {}
|
|
15243
|
+
if (typeof disposeReadIcon === "function") try {
|
|
15244
|
+
disposeReadIcon();
|
|
15645
15245
|
} catch {}
|
|
15646
15246
|
};
|
|
15647
15247
|
}
|