dsh-any-background 0.3.1 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -52,7 +52,6 @@ window.__ModuleLoader__.load({
52
52
  uiSop: "设置界面",
53
53
  uiChatRegion: "对话文本框",
54
54
  uiTrajectory: "轨迹页",
55
- uiPanelRegion: "bettersidebar",
56
55
  uiPanelNative: "右方侧边栏",
57
56
  guideDesc: "管理主题色、壁纸与界面透明度",
58
57
  uiProduced: "产出物/高亮内容",
@@ -244,7 +243,6 @@ window.__ModuleLoader__.load({
244
243
  uiSop: "Settings interface",
245
244
  uiChatRegion: "Conversation text frame",
246
245
  uiTrajectory: "Trajectory view",
247
- uiPanelRegion: "bettersidebar",
248
246
  uiPanelNative: "Right sidebar",
249
247
  guideDesc: "Theme color, wallpaper and interface opacity in the right sidebar",
250
248
  uiProduced: "Produced / highlights",
@@ -1166,10 +1164,14 @@ window.__ModuleLoader__.load({
1166
1164
  const PANEL_FULLSCREEN = "[data-sidebar-right-panel=\"fullscreen\"]";
1167
1165
  /** The docked children a 0.1.7+ panel slides — the panel itself stays put. */
1168
1166
  const DOCKKIT_SLIDERS = "[data-sidebar-right-panel] [data-dockkit-host=\"dock\"],[data-sidebar-right-panel] [data-dockkit-empty]";
1169
- /** The third-party workbench panel, one element on every release. */
1167
+ /** The third-party workbench panel, one element on every release. Owned by the
1168
+ * PRODUCED slider (0.3.2): a conversation artifact that happens to open in a
1169
+ * panel, not a page column — so it fades and frosts with the produced surfaces. */
1170
1170
  const BETTER_SIDEBAR_PANEL = "[data-dsh-bottom-panel]";
1171
- /** Every surface the panel opacity slider owns. Layout-neutral token re-scope. */
1172
- const PANEL_SURFACES = `${BETTER_SIDEBAR_PANEL},${PANEL_WRAPPER}`;
1171
+ /** Every surface the panel opacity slider owns — the host's own right Sidebar.
1172
+ * Layout-neutral token re-scope. (The dsh-better-sidebar workbench used to be
1173
+ * listed here; it moved to the produced group, see `PRODUCED_RULE`.) */
1174
+ const PANEL_SURFACES = PANEL_WRAPPER;
1173
1175
  /** DOM-shape test for "this is NOT a 0.1.7-style frame". Used ONLY by the
1174
1176
  * unresolved adapter, where the DOM is the authority because the release is not. */
1175
1177
  const WITHOUT_DOCKKIT_FRAME = ":not(:has([data-dockkit-host],[data-dockkit-empty]))";
@@ -1247,7 +1249,7 @@ window.__ModuleLoader__.load({
1247
1249
  function panelFragments$3() {
1248
1250
  return {
1249
1251
  promotion: `${PANEL_WRAPPER}{position:fixed!important;z-index:26!important}${PANEL_FULLSCREEN}{z-index:40!important}`,
1250
- blur: panelBlurRule(PANEL_WRAPPER) + panelBlurRule(BETTER_SIDEBAR_PANEL)
1252
+ blur: panelBlurRule(PANEL_WRAPPER)
1251
1253
  };
1252
1254
  }
1253
1255
  function createAdapter$3(host) {
@@ -1321,7 +1323,7 @@ window.__ModuleLoader__.load({
1321
1323
  function panelFragments$2() {
1322
1324
  return {
1323
1325
  promotion: `${PANEL_WRAPPER}{position:fixed!important;z-index:26!important}${PANEL_FULLSCREEN}{z-index:40!important}`,
1324
- blur: panelBlurRule(PANEL_WRAPPER) + panelBlurRule(BETTER_SIDEBAR_PANEL)
1326
+ blur: panelBlurRule(PANEL_WRAPPER)
1325
1327
  };
1326
1328
  }
1327
1329
  function createAdapter$2(host) {
@@ -1406,7 +1408,7 @@ window.__ModuleLoader__.load({
1406
1408
  function panelFragments$1() {
1407
1409
  return {
1408
1410
  promotion: "",
1409
- blur: panelBlurRule(DOCKKIT_SLIDERS) + panelBlurRule(BETTER_SIDEBAR_PANEL)
1411
+ blur: panelBlurRule(DOCKKIT_SLIDERS)
1410
1412
  };
1411
1413
  }
1412
1414
  function createAdapter$1(host) {
@@ -1447,7 +1449,7 @@ window.__ModuleLoader__.load({
1447
1449
  const wrapper = `${PANEL_WRAPPER}${WITHOUT_DOCKKIT_FRAME}`;
1448
1450
  return {
1449
1451
  promotion: `${wrapper}{position:fixed!important;z-index:26!important}${PANEL_FULLSCREEN}${WITHOUT_DOCKKIT_FRAME}{z-index:40!important}`,
1450
- blur: panelBlurRule(DOCKKIT_SLIDERS) + panelBlurRule(wrapper) + panelBlurRule(BETTER_SIDEBAR_PANEL)
1452
+ blur: panelBlurRule(DOCKKIT_SLIDERS) + panelBlurRule(wrapper)
1451
1453
  };
1452
1454
  }
1453
1455
  function createAdapter(host) {
@@ -3429,12 +3431,18 @@ window.__ModuleLoader__.load({
3429
3431
  applyExemptDefaults();
3430
3432
  } catch {}
3431
3433
  }
3432
- const SETTINGS_PANEL_SEL = "[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby]";
3434
+ const SETTINGS_PANEL_SEL = "[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby][class*=\"_panel\"]";
3433
3435
  const SETTINGS_STYLE_RULE = `${SETTINGS_PANEL_SEL}{background:var(--dsh-any-bg-settings-surface,var(--dsw-alias-bg-layer-2));backdrop-filter:var(--dsh-any-blur-settings,none);--dsw-alias-bg-layer-1:var(--dsh-any-bg-settings-layer-1);--dsw-alias-bg-layer-2:var(--dsh-any-bg-settings-layer-2);--dsw-alias-bg-layer-3:var(--dsh-any-bg-settings-layer-3)}${SETTINGS_PANEL_SEL} .dab-card{backdrop-filter:var(--dsh-any-blur-card-panels,none);-webkit-backdrop-filter:var(--dsh-any-blur-card-panels,none)}`;
3436
+ const INPUT_FROST_CLASS = "dab-input-frost";
3437
+ const INPUT_BLUR_RULE = `.${INPUT_FROST_CLASS} [data-composer-card]{position:relative;isolation:isolate}.${INPUT_FROST_CLASS} [data-composer-card]::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;border-radius:inherit;-webkit-backdrop-filter:var(--dsh-any-input-blur,none);backdrop-filter:var(--dsh-any-input-blur,none)}[data-cordis-panel]{-webkit-backdrop-filter:var(--dsh-any-input-blur,none);backdrop-filter:var(--dsh-any-input-blur,none)}[data-cordis-panel]{--dsw-specific-menu:var(--dsh-any-op-menu-cordis)!important}`;
3434
3438
  function applyInputBlur(px) {
3435
- if (px > 0) document.documentElement.style.setProperty("--dsh-any-input-blur", `blur(${px}px)`);
3436
- else document.documentElement.style.removeProperty("--dsh-any-input-blur");
3439
+ const root = document.documentElement;
3440
+ if (px > 0) root.classList.add(INPUT_FROST_CLASS);
3441
+ else root.classList.remove(INPUT_FROST_CLASS);
3442
+ if (px > 0) root.style.setProperty("--dsh-any-input-blur", `blur(${px}px)`);
3443
+ else root.style.removeProperty("--dsh-any-input-blur");
3437
3444
  }
3445
+ const MOBILE_HEADER_RULE = ".dsh-mobile-app-header{background:var(--dsh-any-op-bg,transparent)!important;backdrop-filter:var(--dsh-any-part-blur-global,none);-webkit-backdrop-filter:var(--dsh-any-part-blur-global,none)}";
3438
3446
  /** Mirror of the bg-part blur on :root. --dsh-any-part-blur is element-scoped
3439
3447
  * to the columns, so surfaces outside their subtree (the mobile header, or
3440
3448
  * third-party styles) can never inherit it. */
@@ -3539,14 +3547,14 @@ window.__ModuleLoader__.load({
3539
3547
  document.head.appendChild(exemptStyleEl);
3540
3548
  return exemptStyleEl;
3541
3549
  }
3542
- const PRODUCED_RULE = "[data-code-block-content] pre,[data-code-block-banner],[data-composer-chip],[data-changed-files]>button:first-child,[data-terminal],[data-read],[data-context-injection-body],[data-search],[data-web],[class*=\"_ioCard\"]{-webkit-backdrop-filter:var(--dsh-any-blur-prod,none);backdrop-filter:var(--dsh-any-blur-prod,none)}@supports (background:color-mix(in srgb,red 50%,transparent)){.md-code-block{background:transparent!important}.md-code-block>div{background-color:transparent!important}.md-code-block [data-code-block-content] pre{background-color:color-mix(in srgb,var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block,transparent)) var(--dsh-any-prod-pct,100%),transparent)!important}.md-code-block [data-code-block-banner]{background-color:color-mix(in srgb,var(--dsl-code-block-banner-background-color,var(--dsw-alias-markdown-code-block-banner,transparent)) var(--dsh-any-prod-pct,100%),transparent)!important}[data-code-block-content]{--shiki-background:color-mix(in srgb,var(--dsw-alias-markdown-code-block,var(--dsl-code-block-background,transparent)) var(--dsh-any-prod-pct,100%),transparent)}:not(pre)>code{background-color:color-mix(in srgb,var(--dsw-alias-markdown-inline-code,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-composer-chip]>*{background-color:color-mix(in srgb,var(--dsw-alias-interactive-bg-hover,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-terminal]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-terminal] button{background-color:transparent!important}[data-read]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-read]>div:first-child{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block-banner,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-context-injection-body]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-search]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-web]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[class*=\"_ioCard\"]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}}";
3550
+ const PRODUCED_RULE = `[data-code-block-content] pre,[data-code-block-banner],[data-composer-chip],[data-changed-files],[data-terminal],[data-read],[data-diff],[data-context-injection-body],[data-search],[data-web],[class*="_ioCard"],[data-inspect],[data-turn-trigger],[style*="--dsh-hover-preview-fade"],:not(pre)>code{-webkit-backdrop-filter:var(--dsh-any-blur-prod,none);backdrop-filter:var(--dsh-any-blur-prod,none)}[data-markdown-variant="compact"] :not(pre)>code{-webkit-backdrop-filter:none;backdrop-filter:none}${BETTER_SIDEBAR_PANEL}{-webkit-backdrop-filter:var(--dsh-any-blur-prod,none);backdrop-filter:var(--dsh-any-blur-prod,none)}${BETTER_SIDEBAR_PANEL}{--dsw-alias-bg-base:var(--dsh-any-prod-panel-bg-base);--dsw-alias-bg-layer-1:var(--dsh-any-prod-panel-layer-1);--dsw-alias-bg-layer-2:var(--dsh-any-prod-panel-layer-2);--dsw-alias-bg-layer-3:var(--dsh-any-prod-panel-layer-3)}@supports (background:color-mix(in srgb,red 50%,transparent)){.md-code-block{background:transparent!important}.md-code-block>div{background-color:transparent!important}.md-code-block [data-code-block-content] pre{background-color:color-mix(in srgb,var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block,transparent)) var(--dsh-any-prod-pct,100%),transparent)!important}.md-code-block [data-code-block-banner]{background-color:color-mix(in srgb,var(--dsl-code-block-banner-background-color,var(--dsw-alias-markdown-code-block-banner,transparent)) var(--dsh-any-prod-pct,100%),transparent)!important}[data-code-block-banner]{background-color:color-mix(in srgb,var(--dsl-code-block-banner-background-color,var(--dsl-code-block-background,var(--dsw-alias-markdown-code-block,transparent))) var(--dsh-any-prod-pct,100%),transparent)!important}[data-code-block-content]{--shiki-background:color-mix(in srgb,var(--dsw-alias-markdown-code-block,var(--dsl-code-block-background,transparent)) var(--dsh-any-prod-pct,100%),transparent)}:not(pre)>code{background-color:color-mix(in srgb,var(--dsw-alias-markdown-inline-code,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-composer-chip]>*{background-color:color-mix(in srgb,var(--dsw-alias-interactive-bg-hover,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-terminal]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-terminal] button{background-color:transparent!important}[data-read],[data-diff]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-read]>div:first-child:not([data-code-block-banner]),[data-diff]>div:first-child:not([data-code-block-banner]){background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block-banner,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-context-injection-body]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-inspect],[data-turn-trigger]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-turn-trigger]:hover{background-color:color-mix(in srgb,var(--dsw-alias-interactive-bg-hover,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-changed-files]{background-color:var(--dsh-any-prod-layer-1,var(--dsw-alias-bg-layer-1,transparent))!important}[data-changed-files]>button:first-child{background-color:color-mix(in srgb,var(--changes-fill,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-changed-files]>button:first-child:hover{background-color:color-mix(in srgb,var(--changes-hover,var(--changes-fill,transparent)) var(--dsh-any-prod-pct,100%),transparent)!important}[data-changed-files]>button:first-child>span:first-child{background-color:color-mix(in srgb,var(--changes-fill,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[style*="--dsh-hover-preview-fade"]{background-color:color-mix(in srgb,var(--dsw-hovercard-bg,#2c2c2e) var(--dsh-any-prod-pct,100%),transparent)!important}[style*="--dsh-hover-preview-fade"][class*="_preview"]{background-color:var(--dsh-any-prod-layer-1,var(--dsw-alias-bg-layer-1,transparent))!important}[data-search]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[data-web]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}[class*="_ioCard"]{background-color:color-mix(in srgb,var(--dsw-alias-markdown-code-block,transparent) var(--dsh-any-prod-pct,100%),transparent)!important}}`;
3543
3551
  const STROKE_RULE = [
3544
3552
  `${SETTINGS_PANEL_SEL}{-webkit-text-stroke:var(--dsh-any-stroke-settings-w,0px) var(--dsh-any-stroke-settings-c,transparent);paint-order:stroke fill}`,
3545
3553
  "[role=\"menu\"]:not([data-dockkit-tab-menu]),[role=\"listbox\"],body>[role=\"tree\"],body>[role=\"dialog\"]:not([aria-modal=\"true\"]){-webkit-text-stroke:var(--dsh-any-stroke-card-w,0px) var(--dsh-any-stroke-card-c,transparent);paint-order:stroke fill}",
3546
3554
  "[data-composer-card],[data-cordis-panel],[data-composer-card] textarea,[data-composer-card] input,[data-composer-card] [contenteditable],[data-cordis-panel] input,[data-cordis-panel] textarea{-webkit-text-stroke:var(--dsh-any-stroke-input-w,0px) var(--dsh-any-stroke-input-c,transparent);paint-order:stroke fill}",
3547
3555
  `[data-chat-flow]{-webkit-text-stroke:var(--dsh-any-stroke-chat-w,0px) var(--dsh-any-stroke-chat-c,transparent);paint-order:stroke fill}`,
3548
3556
  `[data-conversation-composer-overlay]{-webkit-text-stroke:var(--dsh-any-stroke-trajectory-w,0px) var(--dsh-any-stroke-trajectory-c,transparent);paint-order:stroke fill}`,
3549
- "[data-code-block-content] pre,[data-code-block-content],[data-code-block-banner],[data-composer-chip],:not(pre)>code,[data-changed-files],[data-terminal],[data-read],[data-context-injection-body],[data-search],[data-web],[class*=\"_ioCard\"]{-webkit-text-stroke:var(--dsh-any-stroke-produced-w,0px) var(--dsh-any-stroke-produced-c,transparent);paint-order:stroke fill}",
3557
+ `[data-code-block-content] pre,[data-code-block-content],[data-code-block-banner],[data-composer-chip],:not(pre)>code,[data-changed-files],[data-terminal],[data-read],[data-diff],[data-inspect],[data-turn-trigger],[data-context-injection-body],[data-search],[data-web],[class*="_ioCard"],[style*="--dsh-hover-preview-fade"],${BETTER_SIDEBAR_PANEL}{-webkit-text-stroke:var(--dsh-any-stroke-produced-w,0px) var(--dsh-any-stroke-produced-c,transparent);paint-order:stroke fill}`,
3550
3558
  `${PANEL_SURFACES}{-webkit-text-stroke:var(--dsh-any-stroke-panel-w,0px) var(--dsh-any-stroke-panel-c,transparent);paint-order:stroke fill}`,
3551
3559
  `${HEADER_SURFACES.join(",")}{-webkit-text-stroke:var(--dsh-any-stroke-header-w,0px) var(--dsh-any-stroke-header-c,transparent);paint-order:stroke fill}`,
3552
3560
  "[data-chat-flow] [role=\"status\"],[data-chat-flow] [data-turn-process],[data-chat-flow] [data-text-shimmer],[data-chat-flow] [style*=\"--dsh-text-shimmer-spread\"]{-webkit-text-stroke-width:0!important;paint-order:normal!important}",
@@ -3686,12 +3694,7 @@ window.__ModuleLoader__.load({
3686
3694
  fontStyleEl?.remove();
3687
3695
  fontStyleEl = null;
3688
3696
  }
3689
- /** The host's own default colors for the panel layer tokens, used when the
3690
- * plugin has no palette (no picked color, no wallpaper verdict, no forced
3691
- * scheme). Without these the panel's re-scope would resolve to invalid vars
3692
- * and the panel would have no background — reading the host's resolved value
3693
- * keeps the panel opaque by default and lets the slider retint it like every
3694
- * other homepage part. Reads from the live `:root` so a custom host skin or
3697
+ /** The host's own defaults, read from the live `:root` so a custom host skin or
3695
3698
  * theme override wins. */
3696
3699
  function readHostLayerTokens() {
3697
3700
  if (typeof getComputedStyle === "undefined") return null;
@@ -3709,32 +3712,63 @@ window.__ModuleLoader__.load({
3709
3712
  layer3
3710
3713
  };
3711
3714
  }
3712
- function applyPanelOverrides(op) {
3713
- const tokens = paletteTokens();
3715
+ /** The host's own right Sidebar (`PANEL_TOKEN_RULE`) reads this set. */
3716
+ const PANEL_LAYER_VARS = {
3717
+ base: "--dsh-any-panel-bg-base",
3718
+ layer1: "--dsh-any-panel-layer-1",
3719
+ layer2: "--dsh-any-panel-layer-2",
3720
+ layer3: "--dsh-any-panel-layer-3"
3721
+ };
3722
+ /** The dsh-better-sidebar workbench (see `PRODUCED_RULE`) reads this set, so the
3723
+ * two panels can follow two different sliders. */
3724
+ const PROD_PANEL_LAYER_VARS = {
3725
+ base: "--dsh-any-prod-panel-bg-base",
3726
+ layer1: "--dsh-any-prod-panel-layer-1",
3727
+ layer2: "--dsh-any-prod-panel-layer-2",
3728
+ layer3: "--dsh-any-prod-panel-layer-3"
3729
+ };
3730
+ /** The changed-files card root needs one token only — the RAW `--dsw-alias-bg-layer-1`
3731
+ * at the produced alpha. It cannot mix on the token itself the way the other
3732
+ * produced surfaces do, because that name is what the interface card slider
3733
+ * re-emits globally on `body` (OPACITY_TOKEN_GROUPS), so mixing on it would bind
3734
+ * one artifact card to two sliders. */
3735
+ const PROD_LAYER_VARS = { layer1: "--dsh-any-prod-layer-1" };
3736
+ const LAYER_KEYS = [
3737
+ "base",
3738
+ "layer1",
3739
+ "layer2",
3740
+ "layer3"
3741
+ ];
3742
+ /** Re-emit the four layer colors at `op` alpha into `names`. The source is the
3743
+ * plugin palette when a picked color / forced scheme owns the theme, otherwise
3744
+ * the host's own resolved tokens — a slider only ever supplies the alpha, so the
3745
+ * colors keep following whichever theme or host skin is active.
3746
+ *
3747
+ * Every pass writes SOMETHING: the re-scope rules live in the always-emitted
3748
+ * stylesheet, and a `var()` naming an unwritten variable makes the surface
3749
+ * guaranteed-invalid, which drops its background entirely rather than leaving it
3750
+ * on the host default. */
3751
+ function writeLayerVars(names, op) {
3752
+ const palette = paletteTokens();
3753
+ const src = palette !== null ? {
3754
+ base: palette["--dsw-alias-bg-base"],
3755
+ layer1: palette["--dsw-alias-bg-layer-1"],
3756
+ layer2: palette["--dsw-alias-bg-layer-2"],
3757
+ layer3: palette["--dsw-alias-bg-layer-3"]
3758
+ } : readHostLayerTokens() ?? {};
3714
3759
  const root = document.documentElement;
3715
- if (tokens !== null) {
3716
- const base = tokens["--dsw-alias-bg-base"];
3717
- const layer1 = tokens["--dsw-alias-bg-layer-1"];
3718
- const layer2 = tokens["--dsw-alias-bg-layer-2"];
3719
- const layer3 = tokens["--dsw-alias-bg-layer-3"];
3720
- if (base !== void 0) root.style.setProperty("--dsh-any-panel-bg-base", toRgba(base, op));
3721
- if (layer1 !== void 0) root.style.setProperty("--dsh-any-panel-layer-1", toRgba(layer1, op));
3722
- if (layer2 !== void 0) root.style.setProperty("--dsh-any-panel-layer-2", toRgba(layer2, op));
3723
- if (layer3 !== void 0) root.style.setProperty("--dsh-any-panel-layer-3", toRgba(layer3, op));
3760
+ if (LAYER_KEYS.every((k) => !src[k])) {
3761
+ for (const k of LAYER_KEYS) if (names[k]) root.style.setProperty(names[k], "transparent");
3724
3762
  return;
3725
3763
  }
3726
- const host = readHostLayerTokens();
3727
- if (host === null) {
3728
- root.style.setProperty("--dsh-any-panel-bg-base", "transparent");
3729
- root.style.setProperty("--dsh-any-panel-layer-1", "transparent");
3730
- root.style.setProperty("--dsh-any-panel-layer-2", "transparent");
3731
- root.style.setProperty("--dsh-any-panel-layer-3", "transparent");
3732
- return;
3764
+ for (const k of LAYER_KEYS) {
3765
+ const name = names[k];
3766
+ const v = src[k];
3767
+ if (name && v) root.style.setProperty(name, toRgba(v, op));
3733
3768
  }
3734
- if (host.base) root.style.setProperty("--dsh-any-panel-bg-base", toRgba(host.base, op));
3735
- if (host.layer1) root.style.setProperty("--dsh-any-panel-layer-1", toRgba(host.layer1, op));
3736
- if (host.layer2) root.style.setProperty("--dsh-any-panel-layer-2", toRgba(host.layer2, op));
3737
- if (host.layer3) root.style.setProperty("--dsh-any-panel-layer-3", toRgba(host.layer3, op));
3769
+ }
3770
+ function applyPanelOverrides(op) {
3771
+ writeLayerVars(PANEL_LAYER_VARS, op);
3738
3772
  }
3739
3773
  function applyPanelBlur(px) {
3740
3774
  if (px > 0) document.documentElement.style.setProperty("--dsh-any-blur-panel", `blur(${px}px)`);
@@ -3996,11 +4030,15 @@ window.__ModuleLoader__.load({
3996
4030
  applyViewCards();
3997
4031
  }
3998
4032
  /** Produced/artifact surfaces (conversation code blocks + their banner +
3999
- * composer chips): re-write the root blur and the alpha percentage consumed by
4000
- * PRODUCED_RULE. The percentage is an alpha for the surface's OWN host color —
4001
- * 1 (100%) reproduces the untouched host look and lowering it fades exactly
4002
- * that color out — so no palette sampling is involved and the surfaces keep
4003
- * following the active theme/wallpaper color on their own. */
4033
+ * inline code chips + composer chips + the dsh-better-sidebar workbench):
4034
+ * re-write the root blur and the alpha percentage consumed by PRODUCED_RULE. The
4035
+ * percentage is an alpha for the surface's OWN host color — 1 (100%) reproduces
4036
+ * the untouched host look and lowering it fades exactly that color out — so no
4037
+ * palette sampling is involved and the surfaces keep following the active
4038
+ * theme/wallpaper color on their own. Two surfaces are the exception: the
4039
+ * workbench reads a whole set of layer tokens rather than one color, and the
4040
+ * changed-files card reads a token the card slider owns globally — both take their
4041
+ * alpha from `writeLayerVars` instead of mixing on the live token. */
4004
4042
  function applyProduced() {
4005
4043
  const px = rBlurs().produced;
4006
4044
  const root = document.documentElement;
@@ -4010,6 +4048,8 @@ window.__ModuleLoader__.load({
4010
4048
  if (opacity < 0) opacity = 0;
4011
4049
  if (opacity > 1) opacity = 1;
4012
4050
  root.style.setProperty("--dsh-any-prod-pct", `${Math.round(opacity * 100)}%`);
4051
+ writeLayerVars(PROD_PANEL_LAYER_VARS, opacity);
4052
+ writeLayerVars(PROD_LAYER_VARS, opacity);
4013
4053
  }
4014
4054
  /** Live per-part blur update during slider drag (no full re-apply). */
4015
4055
  function setPartBlur(part, v) {
@@ -4165,7 +4205,7 @@ window.__ModuleLoader__.load({
4165
4205
  if (el.clientHeight < centerEl.clientHeight * .5) continue;
4166
4206
  if (el.clientHeight > (best?.clientHeight ?? 0)) best = el;
4167
4207
  }
4168
- if (best !== null && best.closest(SETTINGS_PANEL_SEL) !== null) best = null;
4208
+ if (best !== null && best.closest("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby][class*=\"_panel\"]") !== null) best = null;
4169
4209
  const refined = best !== null ? refineMessageColumn(best) : null;
4170
4210
  viewTargets[idx] = refined;
4171
4211
  return refined;
@@ -4672,10 +4712,15 @@ window.__ModuleLoader__.load({
4672
4712
  document.documentElement.style.removeProperty("--dsh-any-blur-card-panels");
4673
4713
  document.documentElement.style.removeProperty("--dsh-any-input-blur");
4674
4714
  document.documentElement.style.removeProperty("--dsh-any-part-blur-global");
4675
- document.documentElement.style.removeProperty("--dsh-any-panel-bg-base");
4676
- document.documentElement.style.removeProperty("--dsh-any-panel-layer-1");
4677
- document.documentElement.style.removeProperty("--dsh-any-panel-layer-2");
4678
- document.documentElement.style.removeProperty("--dsh-any-panel-layer-3");
4715
+ for (const set of [
4716
+ PANEL_LAYER_VARS,
4717
+ PROD_PANEL_LAYER_VARS,
4718
+ PROD_LAYER_VARS
4719
+ ]) for (const k of LAYER_KEYS) {
4720
+ const name = set[k];
4721
+ if (name) document.documentElement.style.removeProperty(name);
4722
+ }
4723
+ document.documentElement.classList.remove(INPUT_FROST_CLASS);
4679
4724
  document.documentElement.style.removeProperty("--dsh-any-blur-panel");
4680
4725
  document.documentElement.style.removeProperty("--dsh-any-blur-prod");
4681
4726
  document.documentElement.style.removeProperty("--dsh-any-prod-pct");
@@ -4761,7 +4806,7 @@ window.__ModuleLoader__.load({
4761
4806
  function buildStaticStyles() {
4762
4807
  const adapter = rHostAdapter();
4763
4808
  const panel = adapter.panelFragments();
4764
- return DARK_GRADIENT + FRAME_CLEAR_RULE + SETTINGS_STYLE_RULE + "[role=\"menu\"]:not([data-dockkit-tab-menu]),[role=\"listbox\"],body > [role=\"tree\"],body > [role=\"dialog\"]:not([aria-modal=\"true\"]){backdrop-filter:var(--dsh-any-blur-card-panels,none);-webkit-backdrop-filter:var(--dsh-any-blur-card-panels,none)}[data-conversation-composer-overlay]{--dsw-alias-bg-layer-1:var(--dsh-any-traj-layer-1);--dsw-alias-bg-layer-2:var(--dsh-any-traj-layer-2);--dsw-alias-bg-layer-3:var(--dsh-any-traj-layer-3)}[data-composer-card]{position:relative;isolation:isolate}[data-composer-card]::before{content:\"\";position:absolute;inset:0;z-index:-1;pointer-events:none;border-radius:inherit;-webkit-backdrop-filter:var(--dsh-any-input-blur,none);backdrop-filter:var(--dsh-any-input-blur,none)}[data-cordis-panel]{-webkit-backdrop-filter:var(--dsh-any-input-blur,none);backdrop-filter:var(--dsh-any-input-blur,none)}[data-cordis-panel]{--dsw-specific-menu:var(--dsh-any-op-menu-cordis)!important}.dsh-mobile-app-header{background:var(--dsh-any-op-bg,transparent)!important;backdrop-filter:var(--dsh-any-part-blur-global,none);-webkit-backdrop-filter:var(--dsh-any-part-blur-global,none)}" + PANEL_TOKEN_RULE + panel.promotion + panel.blur + adapter.pluginPageRule + PRODUCED_RULE + STROKE_RULE + HEADER_POPOVER_RULE + "[role=\"dialog\"][aria-modal=\"true\"]:not([aria-labelledby]){backdrop-filter:none;-webkit-backdrop-filter:none}[role=\"menu\"]:has([class*=\"_danger\"]){backdrop-filter:none;-webkit-backdrop-filter:none;-webkit-text-stroke-width:0}[data-composer-card] textarea::placeholder,[data-composer-card] input::placeholder,[data-composer-card] [contenteditable]::placeholder,[data-cordis-panel] input::placeholder,[data-cordis-panel] textarea::placeholder,.dab-input::placeholder,.dab-input textarea::placeholder,.dab-input input::placeholder{color:var(--dsh-any-placeholder,var(--dsw-alias-label-caption,#8a8f98))!important;font-style:italic;opacity:.85}";
4809
+ return DARK_GRADIENT + FRAME_CLEAR_RULE + SETTINGS_STYLE_RULE + "[role=\"menu\"]:not([data-dockkit-tab-menu]),[role=\"listbox\"],body > [role=\"tree\"],body > [role=\"dialog\"]:not([aria-modal=\"true\"]){backdrop-filter:var(--dsh-any-blur-card-panels,none);-webkit-backdrop-filter:var(--dsh-any-blur-card-panels,none)}[data-conversation-composer-overlay]{--dsw-alias-bg-layer-1:var(--dsh-any-traj-layer-1);--dsw-alias-bg-layer-2:var(--dsh-any-traj-layer-2);--dsw-alias-bg-layer-3:var(--dsh-any-traj-layer-3)}" + INPUT_BLUR_RULE + MOBILE_HEADER_RULE + PANEL_TOKEN_RULE + panel.promotion + panel.blur + adapter.pluginPageRule + PRODUCED_RULE + STROKE_RULE + HEADER_POPOVER_RULE + "[role=\"dialog\"][aria-modal=\"true\"]:not([aria-labelledby]){backdrop-filter:none;-webkit-backdrop-filter:none}[role=\"menu\"]:has([class*=\"_danger\"]){backdrop-filter:none;-webkit-backdrop-filter:none;-webkit-text-stroke-width:0}[data-composer-card] textarea::placeholder,[data-composer-card] input::placeholder,[data-composer-card] [contenteditable]::placeholder,[data-cordis-panel] input::placeholder,[data-cordis-panel] textarea::placeholder,.dab-input::placeholder,.dab-input textarea::placeholder,.dab-input input::placeholder{color:var(--dsh-any-placeholder,var(--dsw-alias-label-caption,#8a8f98))!important;font-style:italic;opacity:.85}";
4765
4810
  }
4766
4811
  /** Append the plugin's stylesheet and keep it matched to the host.
4767
4812
  * Returns a teardown for the plugin's effect scope. */
@@ -6480,78 +6525,6 @@ window.__ModuleLoader__.load({
6480
6525
  });
6481
6526
  }
6482
6527
  //#endregion
6483
- //#region src/client/env.ts
6484
- /**
6485
- * Host capability detection — which third-party plugins are actually present.
6486
- *
6487
- * The host exposes no plugin registry on the client context, so presence is
6488
- * inferred from the stable DOM markers those plugins mount. Detection runs
6489
- * once (plugin boot) and is re-armed by a cheap body-level MutationObserver so
6490
- * a plugin that mounts after this one still flips the cached verdict. The
6491
- * verdict is sticky-true for the session: whether a detected plugin's surface
6492
- * is currently collapsed must not hide the settings that govern it.
6493
- */
6494
- /** Persistent container + surfaces dsh-better-sidebar mounts when loaded.
6495
- * `[data-dsh-better-sidebar]` is the plugin's host wrapper — always appended
6496
- * to document.body on mount — so it is the authoritative "plugin is loaded"
6497
- * signal and the body childList observer fires exactly when it appears. The
6498
- * panel surfaces we actually style are listed only as reinforcement: they are
6499
- * conditionally rendered (collapsed panels drop them), so they must never be
6500
- * the sole signal.
6501
- *
6502
- * `[data-sidebar-right-panel]` is deliberately ABSENT: on every host generation
6503
- * it marks the host's own right Sidebar (always present once a session opens),
6504
- * so counting it would make the better-sidebar verdict permanently true and the
6505
- * panel slider could never drop back to its native "右方侧边栏" identity. */
6506
- const BETTER_SIDEBAR_MARKERS = [
6507
- "[data-dsh-better-sidebar]",
6508
- "[data-dsh-panel-host]",
6509
- "[data-dsh-bottom-panel]"
6510
- ];
6511
- let betterSidebar = false;
6512
- const subs = /* @__PURE__ */ new Set();
6513
- /** Read snapshot of whether the better-sidebar plugin is present. */
6514
- function rBetterSidebar() {
6515
- return betterSidebar;
6516
- }
6517
- function emit() {
6518
- subs.forEach((cb) => cb());
6519
- }
6520
- function sync() {
6521
- if (document.querySelector(BETTER_SIDEBAR_MARKERS.join(",")) !== null && !betterSidebar) {
6522
- betterSidebar = true;
6523
- emit();
6524
- }
6525
- }
6526
- /** React hook: re-renders the caller when better-sidebar presence changes. */
6527
- function useBetterSidebar() {
6528
- return (0, react.useSyncExternalStore)(subscribe, rBetterSidebar);
6529
- }
6530
- /** Subscribe to verdict changes. */
6531
- function subscribe(cb) {
6532
- subs.add(cb);
6533
- return () => {
6534
- subs.delete(cb);
6535
- };
6536
- }
6537
- /** Start detection (probe once, then watch body mounts). Returns an
6538
- * unsubscribe for plugin teardown. */
6539
- function startBetterSidebarWatch() {
6540
- sync();
6541
- const observer = new MutationObserver(sync);
6542
- observer.observe(document.body, { childList: true });
6543
- return () => observer.disconnect();
6544
- }
6545
- let nativeTabs = false;
6546
- const nativeSubs = /* @__PURE__ */ new Set();
6547
- /** Mark the native right-Sidebar service as confirmed. Sticky — the service
6548
- * never goes away within a session. */
6549
- function markNativeSidebarTabs() {
6550
- if (nativeTabs) return;
6551
- nativeTabs = true;
6552
- nativeSubs.forEach((cb) => cb());
6553
- }
6554
- //#endregion
6555
6528
  //#region src/client/components/pages/InterfacePage.tsx
6556
6529
  const PARTS$1 = [
6557
6530
  {
@@ -6601,14 +6574,13 @@ window.__ModuleLoader__.load({
6601
6574
  },
6602
6575
  {
6603
6576
  isPanel: true,
6604
- labelKey: "uiPanelRegion",
6577
+ labelKey: "uiPanelNative",
6605
6578
  Icon: PanelIcon
6606
6579
  }
6607
6580
  ];
6608
6581
  function InterfacePage({ p }) {
6609
6582
  const { t, setOps, setBlurs, setSop, setPanelOp, useStore } = p;
6610
6583
  useStore((s) => s.metaRev);
6611
- const hasBetterSidebar = useBetterSidebar();
6612
6584
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
6613
6585
  className: "dab-head dab-rise",
6614
6586
  style: { "--d": 0 },
@@ -6631,7 +6603,7 @@ window.__ModuleLoader__.load({
6631
6603
  children: PARTS$1.map((part, i) => {
6632
6604
  const { labelKey, Icon, isSettings, isChat, isTrajectory, isPanel, isProduced, isHeader } = part;
6633
6605
  const opKey = part.opKey;
6634
- const label = isPanel ? t(hasBetterSidebar ? "uiPanelRegion" : "uiPanelNative") : t(labelKey);
6606
+ const label = t(labelKey);
6635
6607
  const blurKey = isChat ? "chat" : isTrajectory ? "trajectory" : isSettings ? "settings" : isPanel ? "panel" : isProduced ? "produced" : isHeader ? "header" : opKey;
6636
6608
  const opacity = isChat ? rChatTextOpacity() : isTrajectory ? rTrajectoryOpacity() : isSettings ? rSop() : isPanel ? rPanelOpacity() : isProduced ? rProducedOpacity() : isHeader ? rHeaderOpacity() : rOps()[opKey];
6637
6609
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
@@ -6792,9 +6764,8 @@ window.__ModuleLoader__.load({
6792
6764
  },
6793
6765
  {
6794
6766
  key: "panel",
6795
- labelKey: "uiPanelRegion",
6796
- Icon: PanelIcon,
6797
- needsSidebar: true
6767
+ labelKey: "uiPanelNative",
6768
+ Icon: PanelIcon
6798
6769
  }
6799
6770
  ];
6800
6771
  const COLOR_KEYS = [
@@ -6827,7 +6798,6 @@ window.__ModuleLoader__.load({
6827
6798
  }
6828
6799
  function FontPage({ p, notify }) {
6829
6800
  const { t, setFont, removeFont, setFontEnabled, setStrokes, useStore } = p;
6830
- const hasBetterSidebar = useBetterSidebar();
6831
6801
  const fileRef = (0, react.useRef)(null);
6832
6802
  const [strokes, setStrokesState] = (0, react.useState)(() => rStrokes());
6833
6803
  const [fontInfo, setFontInfo] = (0, react.useState)(() => ({
@@ -7002,7 +6972,7 @@ window.__ModuleLoader__.load({
7002
6972
  }),
7003
6973
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
7004
6974
  className: "dab-grid-parts",
7005
- children: PARTS.filter((part) => !(part.needsSidebar && !hasBetterSidebar)).map((part, i) => {
6975
+ children: PARTS.map((part, i) => {
7006
6976
  const s = strokes[part.key];
7007
6977
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
7008
6978
  className: "dab-card dab-card-hover dab-rise",
@@ -9049,6 +9019,74 @@ window.__ModuleLoader__.load({
9049
9019
  });
9050
9020
  }
9051
9021
  //#endregion
9022
+ //#region src/client/env.ts
9023
+ /**
9024
+ * Host capability detection — which third-party plugins are actually present.
9025
+ *
9026
+ * The host exposes no plugin registry on the client context, so presence is
9027
+ * inferred from the stable DOM markers those plugins mount. Detection runs
9028
+ * once (plugin boot) and is re-armed by a cheap body-level MutationObserver so
9029
+ * a plugin that mounts after this one still flips the cached verdict. The
9030
+ * verdict is sticky-true for the session: whether a detected plugin's surface
9031
+ * is currently collapsed must not hide the settings that govern it.
9032
+ */
9033
+ /** Persistent container + surfaces dsh-better-sidebar mounts when loaded.
9034
+ * `[data-dsh-better-sidebar]` is the plugin's host wrapper — always appended
9035
+ * to document.body on mount — so it is the authoritative "plugin is loaded"
9036
+ * signal and the body childList observer fires exactly when it appears. The
9037
+ * panel surfaces are listed only as reinforcement: they are conditionally
9038
+ * rendered (collapsed panels drop them), so they must never be the sole
9039
+ * signal.
9040
+ *
9041
+ * `[data-sidebar-right-panel]` is deliberately ABSENT: on every host generation
9042
+ * it marks the host's own right Sidebar (always present once a session opens),
9043
+ * so counting it would make the better-sidebar verdict permanently true on any
9044
+ * host and mis-drive everything gated on it. */
9045
+ const BETTER_SIDEBAR_MARKERS = [
9046
+ "[data-dsh-better-sidebar]",
9047
+ "[data-dsh-panel-host]",
9048
+ "[data-dsh-bottom-panel]"
9049
+ ];
9050
+ let betterSidebar = false;
9051
+ const subs = /* @__PURE__ */ new Set();
9052
+ /** Read snapshot of whether the better-sidebar plugin is present. */
9053
+ function rBetterSidebar() {
9054
+ return betterSidebar;
9055
+ }
9056
+ function emit() {
9057
+ subs.forEach((cb) => cb());
9058
+ }
9059
+ function sync() {
9060
+ if (document.querySelector(BETTER_SIDEBAR_MARKERS.join(",")) !== null && !betterSidebar) {
9061
+ betterSidebar = true;
9062
+ emit();
9063
+ }
9064
+ }
9065
+ /** Subscribe to verdict changes. */
9066
+ function subscribe(cb) {
9067
+ subs.add(cb);
9068
+ return () => {
9069
+ subs.delete(cb);
9070
+ };
9071
+ }
9072
+ /** Start detection (probe once, then watch body mounts). Returns an
9073
+ * unsubscribe for plugin teardown. */
9074
+ function startBetterSidebarWatch() {
9075
+ sync();
9076
+ const observer = new MutationObserver(sync);
9077
+ observer.observe(document.body, { childList: true });
9078
+ return () => observer.disconnect();
9079
+ }
9080
+ let nativeTabs = false;
9081
+ const nativeSubs = /* @__PURE__ */ new Set();
9082
+ /** Mark the native right-Sidebar service as confirmed. Sticky — the service
9083
+ * never goes away within a session. */
9084
+ function markNativeSidebarTabs() {
9085
+ if (nativeTabs) return;
9086
+ nativeTabs = true;
9087
+ nativeSubs.forEach((cb) => cb());
9088
+ }
9089
+ //#endregion
9052
9090
  //#region src/client/sidebar/native-tab.tsx
9053
9091
  /**
9054
9092
  * dsh-any-background — native right-Sidebar integration.
@@ -10029,7 +10067,7 @@ window.__ModuleLoader__.load({
10029
10067
  });
10030
10068
  const navLabel = () => ctx.locale.bind(NS)("nav");
10031
10069
  const applyNavIcon = () => {
10032
- const nav = document.querySelector("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby]")?.querySelector("nav");
10070
+ const nav = document.querySelector(SETTINGS_PANEL_SEL)?.querySelector("nav");
10033
10071
  if (!nav) return;
10034
10072
  const target = navLabel();
10035
10073
  for (const cell of Array.from(nav.querySelectorAll("button"))) {
@@ -10059,7 +10097,7 @@ window.__ModuleLoader__.load({
10059
10097
  for (const n of r.addedNodes) {
10060
10098
  if (n.nodeType !== 1) continue;
10061
10099
  const el = n;
10062
- if (el.matches?.("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby]") || el.querySelector?.("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby]")) return true;
10100
+ if (el.matches?.("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby][class*=\"_panel\"]") || el.querySelector?.("[role=\"dialog\"][aria-modal=\"true\"][aria-labelledby][class*=\"_panel\"]")) return true;
10063
10101
  }
10064
10102
  return false;
10065
10103
  })) applyNavIcon();