dsh-any-background 0.2.1 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -75,22 +75,20 @@ A **DeepSeek Harness** appearance plugin that lets you fully customize the Web U
75
75
 
76
76
  ## Recent Optimizations
77
77
 
78
- - **Video wallpaper end-to-end** — Videos are stored under MIME-derived names (`wallpaper.mp4/webm/...`) and streamed over the plugin's own HTTP route; they restore automatically after refresh or restart and travel inside exported configs.
79
- - **Binary upload for large videos** — Uploads stream raw bytes over an HTTP POST straight to disk instead of a base64 detour through RPC (no channel body limit, any size works); aborted transfers clean up after themselves.
80
- - **Video position editing** — The placement editor works on a captured frame reference with zoom/pan, adapted to all five layout modes; image and video framings persist independently.
81
- - **Conversation view cards** — The message column gains an automatic card (border/radius/padding) and the trajectory page gets whole-page opacity & blur; switching views restores the previous host.
82
- - **Boot flicker eliminated** — Theme tokens are injected through a dedicated `!important` stylesheet instead of inline `body` styles, surviving host theme service resets.
83
- - **Color wheel overlap fixed** — The hue ring is drawn on top of the saturation/lightness square so the square corners no longer cover the ring.
84
- - **Inspiration palette selection cleared** — Picking a theme color from the wheel deselects any previously selected inspiration swatch.
85
- - **Debug telemetry removed** — Temporary boot-time logging and `MutationObserver` instrumentation have been cleaned out.
86
- - **Per-part blur isolated** — Blur is applied on `::before` underlays so it never traps the host's fixed-position settings dialog.
87
- - **New "Input & controls" part** — The composer box, slash menu, and Cordis plugin panel own a dedicated opacity slider; their translucent surfaces get real frosted-glass backdrop blur attached through stable host data attributes (`[data-composer-card]`, `[data-cordis-panel]`).
88
- - **Native control contrast fixed** — Solid surface tokens (composer, menus, Cordis panel) now carry per-part alpha, and a forced `color-scheme` keeps native `<select>` popups legible — no more white-on-white when the wallpaper brightness verdict flips labels to white.
89
- - **Translucency without self-damage** — The "Input & controls" opacity slider is deliberately decoupled from the settings panel's own controls (which share the same button tokens), so adjusting it can never bleach the plugin's own sliders and buttons.
90
- - **Drag-time performance** — Opacity tokens are written as CSS variables on `<html>` instead of rebuilding the whole token stylesheet per tick; slider updates are coalesced to one rAF per frame; the main-background columns are only retinted when their own slider changes.
91
- - **Drag-time wallpaper downscaling** — While any slider is being dragged the wallpaper swaps to a (~720px) low-res copy for cheap rasterization over large images, then restores full resolution on release.
92
- - **Instant video playback on import** — A picked video starts playing immediately from a local object URL while its raw bytes stream to disk in the background; the persisted serve URL takes over on the next reload — no more upload + first-buffer wait after import.
93
- - **Option boxes follow the card slider** — The dropdowns, slash-trigger menu, model selector, and popovers around the dialog now follow the "Cards & panels" opacity slider instead of "Input & controls"; the Cordis panel keeps its own input-slider binding.
78
+ ### v0.2.3
79
+
80
+ - **Wide tables stay in the column** — When the chat region opacity/blur is raised (which makes the chat border visible), wide markdown tables are pulled back inside the text column and scroll horizontally at the border instead of bleeding past it. Left untouched while the border is invisible, preserving DSH's default behavior.
81
+ - **Network URL wallpaper** — Paste an image URL and the plugin downloads it and writes it to the local wallpaper file (replacing the previous image). Because the remote source lands as a local persisted file, theme export/import keep working with no extra steps: an exported theme embeds the image data, and the receiving side never needs access to the original URL.
82
+ - **Editor confirm button visible in dark mode** — The background-editor "Confirm" button now matches the Cancel/Reset buttons (solid surface with a clear frame and legible label) instead of a translucent primary tint, so it no longer disappears in dark themes.
83
+ - **Maintenance cleanup** — Removed an unused `@deepseek-ai/dsh-client-ui-renderer` entry from the client inject list and aligned self-owned RPC error codes with the new harness convention.
84
+
85
+ ### v0.2.2
86
+
87
+ - **Dark host surfaces fully themed** — Message bubbles, setting-box inputs/cards, selectors, ghost/toolbar buttons, and module-platform surfaces now carry explicit dark tokens, eliminating white-on-white and white-icon-on-bright bugs across the conversation view, settings page, and interactive controls.
88
+ - **Refresh white-flash eliminated** — A theme-reset watcher re-asserts the plugin's forced scheme within the same frame the host re-applies its light `:root/body` rules; the `!important` token stylesheet survives host theme resets, so entering, refreshing, and set-changes no longer paint a white frame.
89
+ - **Brand badge & code banner contrast** — The sidebar brand badge and the code-block info banner now use dark surfaces with legible labels and icons.
90
+ - **Placeholder reads as a hint** — The composer placeholder is rendered with the weak caption token and italic styling, clearly distinct from real input text.
91
+ - **Dual harness compatibility** — `defineStore` is resolved through a runtime adapter that prefers the new `@deepseek-ai/dsh-client-store` and falls back to the legacy `@deepseek-ai/dsh-client-runtime/client`. A single bundle loads on both the npm release and the new deepseek-harness source, with no "missed the module table" boot failure.
94
92
 
95
93
  ## Installation
96
94
 
@@ -132,7 +130,7 @@ pnpm dsh web
132
130
 
133
131
  ## Compatibility
134
132
 
135
- - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — Full support.
133
+ - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — Full support on both the npm release and the new source build. The plugin auto-detects which client-module table the host ships (the new `@deepseek-ai/dsh-client-store` or the legacy `@deepseek-ai/dsh-client-runtime`) and resolves `defineStore` accordingly at runtime.
136
134
  - **[deepseek-harness-desktop](https://github.com/anywhere-labs/deepseek-harness-desktop)** — Supported; a known Electron packaging issue makes the left sidebar and center area opacity appear inverted — awaiting a desktop-client update to fix it.
137
135
 
138
136
  ## Star History
package/README.zh.md CHANGED
@@ -75,22 +75,20 @@
75
75
 
76
76
  ## 近期优化
77
77
 
78
- - **视频壁纸全链路** — 视频按 MIME 改名落盘(`wallpaper.mp4/webm/...`),经插件自建 HTTP 路由流式播放;刷新、重启后自动恢复,导出配置时视频一并内嵌分享。
79
- - **大视频二进制直传** — 上传改走 HTTP 二进制 POST 流式落盘,不再 base64 绕行 RPC(突破通道 body 上限,任意大小可传),中断自动清理临时文件。
80
- - **视频位置编辑** — 以截帧为参考图的位置编辑器,支持缩放/移动,与五种布局模式适配;图片与视频构图各自独立持久化。
81
- - **对话视图卡片化** — 消息列自动上卡片(边框/圆角/内边距),轨迹页整页透明度与模糊可控,视图切换时旧宿主自动还原。
82
- - **消除启动闪屏** — 主题令牌改为通过独立的 `!important` 样式表注入,可抵御宿主主题服务的重置。
83
- - **修复色轮覆盖** — 色相环绘制在饱和度/明度方形之上,方形四角不再遮挡色环。
84
- - **灵感色板选中重置** — 在色轮中选取主题色后,灵感色板中的之前选中状态自动清除。
85
- - **移除调试埋点** — 清理了临时的启动日志与 `MutationObserver` 探针代码。
86
- - **分部位模糊隔离** — 模糊效果施加在 `::before` 伪元素上,避免影响宿主固定定位的设置弹窗。
87
- - **新增「输入框与控件」部件** — 发送框、斜杠菜单、Cordis 插件面板拥有独立的透明度滑块;半透明表面通过宿主的稳定 data 属性(`[data-composer-card]`、`[data-cordis-panel]`)获得真正的毛玻璃背景模糊。
88
- - **修复原生控件明暗对比** — 实心表面令牌(发送框、菜单、Cordis 面板)现在参与分部位 alpha,并强制 `color-scheme` 让原生 `<select>` 弹层保持可读——消除壁纸判暗把标签转白后出现的白底白字。
89
- - **透明化不反噬自身** — 「输入框与控件」透明度滑块刻意与该面板自己的控件(共享同一批按钮令牌)解绑,调节它不会把插件自身的滑块和按钮也变透明。
90
- - **拖动性能优化** — 透明度令牌改为写 `<html>` 上的 CSS 变量(拖动时不再整表重建),滑块更新按 rAF 合帧为每帧一次;「主背景」列仅在自身滑块变化时才重染。
91
- - **拖动时壁纸降采样** — 拖动任意滑块期间,壁纸临时切换到(~720px)低清副本以降低大图上的合成成本,松手后恢复全分辨率。
92
- - **导入即播视频壁纸** — 选中的视频立即通过本地对象 URL 开始播放,原始字节在后台流式落盘,下次刷新自动切回持久化服务地址——不再有「上传 + 首帧缓冲」的等待。
93
- - **选项框跟随卡片滑块** — 对话框周围的下拉菜单、斜杠命令菜单、模型选择器与弹层现在跟随「对话框中选项面板」透明度滑块,而非「输入框与控件」;Cordis 插件面板保持自己的输入滑块绑定。
78
+ ### v0.2.3
79
+
80
+ - **宽表格收进文本栏** — 当对话区透明度/模糊度被调大(边框因此可见)时,宽 Markdown 表格被收回文本栏宽度内、在边框处横向滚动,不再向右溢出裁切;边框不可见时不干预,保留 DSH 官方默认外扩行为。
81
+ - **网络 URL 壁纸** — 填入图片网址即可直接作为壁纸:插件下载图片并写入本地壁纸文件(替换原有持久化图片)。由于远程来源最终落到本地持久化文件,主题导出/导入无需任何额外适配:导出主题时内嵌图片数据,接收方无需访问原始网址也能还原。
82
+ - **深色主题下编辑器确认按钮清晰可见** — 背景编辑器「确认」按钮改为与「取消/重置」一致的实色表面 + 清晰边框 + 可读文字,不再使用半透明的主题色淡染,深色主题下不再看不清。
83
+ - **维护性清理** — 移除 `dsh.client.inject` 中未使用的 `@deepseek-ai/dsh-client-ui-renderer` 条目,并将插件自有 RPC 错误码对齐新版 harness 的命名规范。
84
+
85
+ ### v0.2.2
86
+
87
+ - **深色宿主表面全面主题化** — 消息气泡、设置框输入框/卡片、选择器、ghost/工具条按钮、module-platform 表面均补全了显式深色令牌,消除对话区、设置页与交互控件中的白底白字、白底白图标问题。
88
+ - **消除刷新白闪** — 新增主题重置监听:宿主重新施加浅色 `:root/body` 规则后,插件在同帧内重新断言强制主题;`!important` 令牌样式表可抵御宿主主题服务的重置,进入、刷新、修改设置不再闪现一帧白底。
89
+ - **品牌徽章与代码信息条对比提升** — 侧边栏品牌徽章与代码块上方信息条改为深色表面,文字与图标保持清晰可辨。
90
+ - **占位符与正式输入区分** — 发送框占位符改用较弱的 caption 令牌并加斜体,空态不会被误认为已输入内容。
91
+ - **双版本兼容** — `defineStore` 通过运行时适配器解析:优先使用新版 `@deepseek-ai/dsh-client-store`,缺失时回退到旧版 `@deepseek-ai/dsh-client-runtime/client`;同一份 bundle 同时兼容 npm 老版本与新版 deepseek-harness 源码,不再出现 "missed the module table" 启动失败。
94
92
 
95
93
  ## 安装
96
94
 
@@ -132,7 +130,7 @@ pnpm dsh web
132
130
 
133
131
  ## 兼容性
134
132
 
135
- - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — 完全支持。
133
+ - **[`dsh web`](https://github.com/deepseek-ai/deepseek-harness)** — 同时兼容 npm 发布版与新版源码构建。插件会自动检测宿主携带的客户端模块表(新版 `@deepseek-ai/dsh-client-store` 或旧版 `@deepseek-ai/dsh-client-runtime`),并在运行时据此解析 `defineStore`。
136
134
  - **[deepseek-harness-desktop](https://github.com/anywhere-labs/deepseek-harness-desktop)** — 支持;已知 Electron 打包问题导致左侧边栏与中心区域透明度显示相反,需等待桌面端更新修复。
137
135
 
138
136
  ## Star History
package/lib/client.js CHANGED
@@ -4,10 +4,18 @@ window.__ModuleLoader__.load({
4
4
  var module = { exports: {} };
5
5
  var exports = module.exports;
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
- let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
8
7
  let react = require("react");
9
8
  let react_jsx_runtime = require("react/jsx-runtime");
10
9
  let react_dom = require("react-dom");
10
+ //#region src/client/runtime.ts
11
+ function resolveStore() {
12
+ try {
13
+ return require("@deepseek-ai/dsh-client-store");
14
+ } catch {}
15
+ return require("@deepseek-ai/dsh-client-runtime/client");
16
+ }
17
+ const defineStore = resolveStore().defineStore;
18
+ //#endregion
11
19
  //#region src/client/i18n.ts
12
20
  const NS = "settings.anyBg";
13
21
  const zh = {
@@ -39,6 +47,13 @@ window.__ModuleLoader__.load({
39
47
  bgTitle: "背景",
40
48
  bgChoose: "选择图片或视频",
41
49
  bgRemove: "移除背景",
50
+ bgFromUrl: "从网址",
51
+ bgUrlPlaceholder: "粘贴图片网址 https://…",
52
+ bgUrlApply: "应用",
53
+ bgUrlCancel: "取消",
54
+ bgUrlApplying: "加载中…",
55
+ bgUrlBadHttp: "仅支持 http/https 图片网址",
56
+ bgUrlFail: "获取图片失败",
42
57
  bgEdit: "编辑位置",
43
58
  bgEditLocked: "仅「适应」模式可编辑位置",
44
59
  wpOpacity: "背景透明度",
@@ -137,6 +152,13 @@ window.__ModuleLoader__.load({
137
152
  bgTitle: "Background",
138
153
  bgChoose: "Choose image or video",
139
154
  bgRemove: "Remove background",
155
+ bgFromUrl: "From URL",
156
+ bgUrlPlaceholder: "Paste an image URL https://…",
157
+ bgUrlApply: "Apply",
158
+ bgUrlCancel: "Cancel",
159
+ bgUrlApplying: "Loading…",
160
+ bgUrlBadHttp: "Only http/https image URLs are supported",
161
+ bgUrlFail: "Could not fetch the image",
140
162
  bgEdit: "Edit position",
141
163
  bgEditLocked: "Position editing is only available in Fit mode",
142
164
  wpOpacity: "Background opacity",
@@ -548,6 +570,40 @@ window.__ModuleLoader__.load({
548
570
  async function persistVideo(dataUrl) {
549
571
  return await rpcCall("setVideo", { dataUrl }) === true;
550
572
  }
573
+ /** Download a wallpaper from a network URL and persist it into the local slot
574
+ * (the host replaces wallpaper.jpg). Returns the freshly stored data-URL on
575
+ * success, or the host's failure message. */
576
+ async function setWallpaperFromUrl(url) {
577
+ if (!rpcCallFn) return {
578
+ ok: false,
579
+ error: "rpc not ready"
580
+ };
581
+ let res;
582
+ try {
583
+ res = await rpcCallFn(rpcEndpoint("setWallpaperUrl"), { url });
584
+ } catch (e) {
585
+ return {
586
+ ok: false,
587
+ error: e instanceof Error ? e.message : String(e)
588
+ };
589
+ }
590
+ if (!res) return {
591
+ ok: false,
592
+ error: "no response"
593
+ };
594
+ if (res.ok !== true) return {
595
+ ok: false,
596
+ error: res.error?.message ?? "request failed"
597
+ };
598
+ const v = res.value;
599
+ return v?.ok === true ? {
600
+ ok: true,
601
+ dataUrl: v.dataUrl ?? null
602
+ } : {
603
+ ok: false,
604
+ error: v?.error ?? "failed"
605
+ };
606
+ }
551
607
  /** Upload a video's raw bytes over HTTP (MIME in Content-Type, body untouched
552
608
  * — no base64 inflation that would blow the RPC body limit on large clips). */
553
609
  async function uploadVideo(blob, mime) {
@@ -610,32 +666,76 @@ window.__ModuleLoader__.load({
610
666
  "--dsw-alias-bg-layer-2": hsl(h(0), s(0), l(.07)),
611
667
  "--dsw-alias-bg-layer-3": hsl(h(0), s(-.05), l(.12)),
612
668
  "--dsw-alias-bg-overlay": hsl(h(0), s(-.05), l(.12)),
669
+ "--dsw-alias-bg-module-platform": hsl(h(0), s(0), l(.05)),
670
+ "--dsw-alias-bg-multi-select": hsl(h(0), s(0), l(.1)),
671
+ "--dsw-alias-bg-skeleton": "rgba(255,255,255,0.08)",
613
672
  "--dsw-alias-border-l1": rgba(h(0), s(-.1), l(.18), .12),
614
673
  "--dsw-alias-border-l2": rgba(h(0), s(-.1), l(.22), .22),
674
+ "--dsw-alias-border-l3": "rgba(255,255,255,0.16)",
675
+ "--dsw-alias-border-l4": "rgba(255,255,255,0.2)",
676
+ "--dsw-alias-border-inverted": "rgba(255,255,255,0.06)",
615
677
  "--dsw-alias-label-primary": hsl(0, 0, 1),
616
- "--dsw-alias-label-secondary": hsl(0, 0, 1),
617
- "--dsw-alias-label-tertiary": hsl(0, 0, 1),
618
- "--dsw-alias-label-caption": hsl(0, 0, 1),
619
- "--dsw-alias-label-dimmed": hsl(0, 0, 1),
620
- "--dsw-alias-label-quaternary": hsl(0, 0, 1),
678
+ "--dsw-alias-label-secondary": "rgba(255,255,255,0.85)",
679
+ "--dsw-alias-label-tertiary": "rgba(255,255,255,0.7)",
680
+ "--dsw-alias-label-caption": "rgba(255,255,255,0.5)",
681
+ "--dsw-alias-label-dimmed": "rgba(255,255,255,0.35)",
682
+ "--dsw-alias-label-quaternary": "rgba(255,255,255,0.25)",
683
+ "--dsw-alias-label-primary-dimmed": "rgba(255,255,255,0.92)",
684
+ "--dsw-alias-label-primary-foreground": hsl(0, 0, 1),
685
+ "--dsw-alias-label-primary-inverted": hsl(h(0), s(.08), Math.min(l(.06), .16)),
686
+ "--dsw-alias-label-primary-bluish": hsl(0, 0, 1),
621
687
  "--dsw-alias-brand-primary": hsl(h(0), s(.1), Math.max(l(.2), .5)),
622
688
  "--dsw-alias-brand-text": l(.2) > .6 ? "#000" : "#fff",
689
+ "--dsw-alias-button-primary-fill": hsl(h(0), s(.1), Math.max(l(.2), .5)),
623
690
  "--dsw-alias-button-primary-hover": hsl(h(0), s(.1), Math.max(l(.28), .58)),
624
691
  "--dsw-alias-button-primary-dimmed": hsl(h(0), s(0), l(.07)),
625
692
  "--dsw-alias-button-elevated-fill": hsl(h(0), s(0), l(.04)),
693
+ "--dsw-alias-button-floating-fill": hsl(h(0), s(0), l(.02)),
626
694
  "--dsw-alias-button-floating-hover": hsl(h(0), s(0), l(.1)),
695
+ "--dsw-alias-button-tool-bar-fill": "rgba(255,255,255,0.08)",
696
+ "--dsw-alias-button-tool-bar-hover": "rgba(255,255,255,0.12)",
697
+ "--dsw-alias-button-ghost-active-fill": hsl(h(0), s(0), l(.06)),
698
+ "--dsw-alias-button-ghost-active-border": "rgba(255,255,255,0.16)",
699
+ "--dsw-alias-button-ghost-active-hover": hsl(h(0), s(0), l(.09)),
700
+ "--dsw-alias-button-info-fill": "#679efe",
701
+ "--dsw-alias-button-info-hover": "#4176e6",
702
+ "--dsw-alias-button-contrast-fill": hsl(0, 0, 1),
627
703
  "--dsw-alias-interactive-bg-hover": rgba(h(0), s(0), Math.max(l(.15), .4), .12),
704
+ "--dsw-alias-interactive-bg-hover-solid": rgba(h(0), s(0), Math.max(l(.15), .4), .16),
705
+ "--dsw-alias-interactive-bg-hover-accent": "rgba(255,255,255,0.24)",
706
+ "--dsw-alias-interactive-bg-hover-danger": "rgba(242,90,90,0.15)",
628
707
  "--dsw-alias-interactive-bg-active": rgba(h(0), s(0), Math.max(l(.15), .4), .2),
629
708
  "--dsw-alias-markdown-code-block": hsl(h(0), s(0), l(-.06)),
709
+ "--dsw-alias-markdown-code-block-banner": hsl(h(0), s(0), l(-.02)),
630
710
  "--dsw-alias-markdown-inline-code": hsl(h(0), s(0), l(.04)),
711
+ "--dsw-alias-markdown-placeholder": hsl(h(0), s(0), l(-.02)),
712
+ "--dsw-alias-markdown-tag": hsl(h(0), s(0), l(.05)),
713
+ "--dsw-alias-markdown-citation": hsl(h(0), s(0), l(.06)),
714
+ "--dsw-alias-markdown-code-segment-selected": hsl(h(0), s(0), l(.05)),
715
+ "--dsw-alias-markdown-code-segment-unselected": hsl(h(0), s(0), l(-.05)),
631
716
  "--dsw-alias-state-error-primary": "#ff5c72",
717
+ "--dsw-alias-state-error-secondary": "#ff8aa0",
632
718
  "--dsw-alias-state-success-primary": "#3ddc84",
719
+ "--dsw-alias-state-success-secondary": "#69eea4",
720
+ "--dsw-alias-state-success-tertiary": "hsl(152,70%,62%)",
633
721
  "--dsw-alias-state-warn-primary": "#ffb347",
722
+ "--dsw-alias-state-warn-secondary": "#ffc980",
723
+ "--dsw-alias-state-warn-tertiary": "#dd8629",
724
+ "--dsw-alias-state-warn-label": "#dd8629",
725
+ "--dsw-alias-state-business-primary": "#679efe",
726
+ "--dsw-alias-state-business-tertiary": "#6f7fa8",
634
727
  "--dsw-specific-sidebar-fill": hsl(h(0), s(0), l(-.06)),
635
728
  "--dsw-specific-sidebar-nav-item-active": hsl(h(0), s(0), l(.04)),
636
729
  "--dsw-specific-sidebar-nav-item-hover": hsl(h(0), s(0), l(0)),
637
730
  "--dsw-specific-input-major": hsl(h(0), s(0), l(.02)),
638
731
  "--dsw-specific-menu": hsl(h(0), s(0), l(.08)),
732
+ "--dsw-specific-bubble": hsl(h(0), s(0), l(.03)),
733
+ "--dsw-specific-bubble-highlight": hsl(h(0), s(0), l(.08)),
734
+ "--dsw-specific-selector": hsl(h(0), s(0), l(.05)),
735
+ "--dsw-specific-login-input": hsl(h(0), s(0), l(.03)),
736
+ "--dsw-specific-tip": hsl(h(0), s(0), l(.05)),
737
+ "--dsw-alias-toast-bg": hsl(h(0), s(0), l(.08)),
738
+ "--dsw-alias-tooltip-bg": hsl(h(0), s(0), l(.08)),
639
739
  "--dsw-alias-scrollbar-bg-l1": hsl(h(0), s(-.05), l(.12)),
640
740
  "--dsw-alias-scrollbar-bg-l2": hsl(h(0), s(-.05), l(.16)),
641
741
  "--dsw-alias-scrollbar-hover-l1": hsl(h(0), s(-.05), l(.22)),
@@ -653,11 +753,11 @@ window.__ModuleLoader__.load({
653
753
  "--dsw-alias-border-l1": rgba(h(0), s(-.15), l(-.35), .18),
654
754
  "--dsw-alias-border-l2": rgba(h(0), s(-.15), l(-.35), .3),
655
755
  "--dsw-alias-label-primary": hsl(0, 0, 0),
656
- "--dsw-alias-label-secondary": hsl(0, 0, 0),
657
- "--dsw-alias-label-tertiary": hsl(0, 0, 0),
658
- "--dsw-alias-label-caption": hsl(0, 0, 0),
659
- "--dsw-alias-label-dimmed": hsl(0, 0, 0),
660
- "--dsw-alias-label-quaternary": hsl(0, 0, 0),
756
+ "--dsw-alias-label-secondary": "rgba(0,0,0,0.85)",
757
+ "--dsw-alias-label-tertiary": "rgba(0,0,0,0.7)",
758
+ "--dsw-alias-label-caption": "rgba(0,0,0,0.5)",
759
+ "--dsw-alias-label-dimmed": "rgba(0,0,0,0.35)",
760
+ "--dsw-alias-label-quaternary": "rgba(0,0,0,0.25)",
661
761
  "--dsw-alias-brand-primary": hsl(h(0), s(.05), Math.min(l(-.18), .45)),
662
762
  "--dsw-alias-brand-text": "#fff",
663
763
  "--dsw-alias-button-primary-hover": hsl(h(0), s(.05), Math.min(l(-.12), .5)),
@@ -1489,14 +1589,14 @@ window.__ModuleLoader__.load({
1489
1589
  for (const name of appliedTokenNames) document.body.style.removeProperty(name);
1490
1590
  appliedTokenNames = [];
1491
1591
  }
1492
- /** Label tokens flipped by the generated-background brightness verdict. */
1592
+ /** Label tokens flipped by the generated-background brightness verdict. The
1593
+ * faint tiers (caption/dimmed) are deliberately NOT flipped: they back
1594
+ * placeholder/hint text, which must stay visibly weaker than real input even
1595
+ * when the wallpaper brightness flips the main label direction. */
1493
1596
  const LABEL_TOKENS = [
1494
1597
  "--dsw-alias-label-primary",
1495
1598
  "--dsw-alias-label-secondary",
1496
- "--dsw-alias-label-tertiary",
1497
- "--dsw-alias-label-caption",
1498
- "--dsw-alias-label-dimmed",
1499
- "--dsw-alias-label-quaternary"
1599
+ "--dsw-alias-label-tertiary"
1500
1600
  ];
1501
1601
  const OPACITY_TOKEN_GROUPS = [
1502
1602
  {
@@ -1934,6 +2034,36 @@ window.__ModuleLoader__.load({
1934
2034
  viewTargets[i] = null;
1935
2035
  });
1936
2036
  }
2037
+ const TABLE_FIX_RULE = [
2038
+ ".md-table-wide {",
2039
+ " --dsh-table-spare: 0px !important;",
2040
+ " --dsh-table-lead: 0px !important;",
2041
+ " box-sizing: border-box !important;",
2042
+ " width: 100% !important;",
2043
+ " max-width: 100% !important;",
2044
+ " margin-left: 0 !important;",
2045
+ " padding-left: 0 !important;",
2046
+ " padding-bottom: 0 !important;",
2047
+ " overflow-x: auto !important;",
2048
+ "}"
2049
+ ].join("\n");
2050
+ let tableFixStyleEl = null;
2051
+ /** Toggle the wide-table clamp according to the chat region's opacity & blur. */
2052
+ function syncTableFix() {
2053
+ if (!(rChatTextOpacity() > 0 || rBlurs().chat > 0)) {
2054
+ if (tableFixStyleEl !== null) {
2055
+ tableFixStyleEl.remove();
2056
+ tableFixStyleEl = null;
2057
+ }
2058
+ return;
2059
+ }
2060
+ if (tableFixStyleEl === null) {
2061
+ tableFixStyleEl = document.createElement("style");
2062
+ tableFixStyleEl.dataset.plugin = "dsh-any-background-table-fix";
2063
+ tableFixStyleEl.textContent = TABLE_FIX_RULE;
2064
+ }
2065
+ if (!tableFixStyleEl.isConnected) document.head.appendChild(tableFixStyleEl);
2066
+ }
1937
2067
  /** Re-derive the conversation view cards from the current config. Cheap
1938
2068
  * enough for live slider drags; the card structure is applied unconditionally
1939
2069
  * once the host exists so the layout never reflows when a slider leaves zero. */
@@ -1959,6 +2089,7 @@ window.__ModuleLoader__.load({
1959
2089
  target.setAttribute(spec.mark, "1");
1960
2090
  setBlur(target, blurPx);
1961
2091
  });
2092
+ syncTableFix();
1962
2093
  }
1963
2094
  let partsObserver = null;
1964
2095
  /** Watch for the AppFrame mounting so persisted blurs land even when the shell
@@ -1980,6 +2111,42 @@ window.__ModuleLoader__.load({
1980
2111
  partsObserver?.disconnect();
1981
2112
  partsObserver = null;
1982
2113
  }
2114
+ let themeObserver = null;
2115
+ let themeRaf = 0;
2116
+ function reassertScheme() {
2117
+ const [, , l] = rColor();
2118
+ if (rBgDark() ?? l < .55) document.body.setAttribute("data-ds-dark-theme", "dsh-any-background");
2119
+ else document.body.removeAttribute("data-ds-dark-theme");
2120
+ applyCustomTokens(rOps());
2121
+ }
2122
+ /** Re-assert the plugin's forced scheme whenever the host strips it, so a
2123
+ * refresh / cold-load / set-change never flashes a light frame. Returns a
2124
+ * disposer for teardown. */
2125
+ function watchThemeResets() {
2126
+ if (themeObserver !== null || typeof MutationObserver === "undefined") return () => void 0;
2127
+ themeObserver = new MutationObserver(() => {
2128
+ if (document.body.getAttribute("data-ds-dark-theme") === "dsh-any-background") return;
2129
+ if (!(rHasColor() || rBgDark() !== null)) return;
2130
+ if (themeRaf !== 0) return;
2131
+ themeRaf = requestAnimationFrame(() => {
2132
+ themeRaf = 0;
2133
+ if (document.body.getAttribute("data-ds-dark-theme") === "dsh-any-background") return;
2134
+ reassertScheme();
2135
+ });
2136
+ });
2137
+ themeObserver.observe(document.body, {
2138
+ attributes: true,
2139
+ attributeFilter: ["data-ds-dark-theme"]
2140
+ });
2141
+ themeObserver.observe(document.documentElement, {
2142
+ attributes: true,
2143
+ attributeFilter: ["data-ds-dark-theme"]
2144
+ });
2145
+ return () => {
2146
+ themeObserver?.disconnect();
2147
+ themeObserver = null;
2148
+ };
2149
+ }
1983
2150
  function ensureWpContainer() {
1984
2151
  if (!wpEl || !document.body.contains(wpEl)) {
1985
2152
  wpEl = document.createElement("div");
@@ -2241,6 +2408,8 @@ window.__ModuleLoader__.load({
2241
2408
  tokensRaf = null;
2242
2409
  }
2243
2410
  pendingOps = null;
2411
+ tableFixStyleEl?.remove();
2412
+ tableFixStyleEl = null;
2244
2413
  setBlur(frameEl, 0);
2245
2414
  setBlur(sidebarEl, 0);
2246
2415
  setBlur(centerEl, 0);
@@ -2387,6 +2556,9 @@ window.__ModuleLoader__.load({
2387
2556
  .dab-num:focus{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 18%,transparent)}
2388
2557
  .dab-num::-webkit-outer-spin-button,.dab-num::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
2389
2558
  .dab-num{-moz-appearance:textfield;appearance:textfield}
2559
+ .dab-urlinput{flex:1;min-width:180px;height:34px;padding:0 12px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-primary);font-size:12.5px;outline:none;transition:border-color .2s}
2560
+ .dab-urlinput::placeholder{color:var(--dsw-alias-label-quaternary)}
2561
+ .dab-urlinput:focus{border-color:var(--dsw-alias-brand-primary);box-shadow:0 0 0 3px color-mix(in srgb,var(--dsw-alias-brand-primary) 18%,transparent)}
2390
2562
  .dab-swatch-lg{height:38px;border-radius:10px;border:1px solid var(--dsw-alias-border-l2);box-shadow:inset 0 0 14px rgba(0,0,0,.1);transition:transform .3s ease}
2391
2563
  .dab-swatch-lg:hover{transform:scale(1.02)}
2392
2564
 
@@ -2686,6 +2858,15 @@ window.__ModuleLoader__.load({
2686
2858
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.8 13.8h10.4" })
2687
2859
  ]
2688
2860
  });
2861
+ const LinkIcon = ({ size, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Glyph, {
2862
+ size,
2863
+ className,
2864
+ children: [
2865
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M6.6 9.4 9.4 6.6" }),
2866
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M5.9 11.1l-1.4 1.4a2.6 2.6 0 0 1-3.7-3.7L3.5 6.8" }),
2867
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M10.1 4.9l1.4-1.4a2.6 2.6 0 0 1 3.7 3.7l-2.1 2.1" })
2868
+ ]
2869
+ });
2689
2870
  const LockIcon = ({ size, className }) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Glyph, {
2690
2871
  size,
2691
2872
  className,
@@ -4002,7 +4183,7 @@ window.__ModuleLoader__.load({
4002
4183
  }),
4003
4184
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4004
4185
  type: "button",
4005
- className: "dab-btn dab-btn-primary",
4186
+ className: "dab-btn",
4006
4187
  onClick: () => onCommit(zoom, (pos.x + imgSize.w * zoom / 2) / pw, (pos.y + imgSize.h * zoom / 2) / ph, imgRef.current?.naturalWidth ?? 0, imgRef.current?.naturalHeight ?? 0),
4007
4188
  children: t("editorCommit")
4008
4189
  })
@@ -4047,6 +4228,10 @@ window.__ModuleLoader__.load({
4047
4228
  const [editorOpen, setEditorOpen] = (0, react.useState)(false);
4048
4229
  const [dragOver, setDragOver] = (0, react.useState)(false);
4049
4230
  const [spinTick, setSpinTick] = (0, react.useState)(0);
4231
+ const [urlOpen, setUrlOpen] = (0, react.useState)(false);
4232
+ const [urlVal, setUrlVal] = (0, react.useState)("");
4233
+ const [urlBusy, setUrlBusy] = (0, react.useState)(false);
4234
+ const [urlErr, setUrlErr] = (0, react.useState)(null);
4050
4235
  const [mode, setModeState] = (0, react.useState)(rBgMode());
4051
4236
  const isVideo = backgroundType === "video";
4052
4237
  const isStatic = backgroundType === "image" || isVideo;
@@ -4067,6 +4252,22 @@ window.__ModuleLoader__.load({
4067
4252
  const f = e.dataTransfer.files?.[0];
4068
4253
  if (f && (f.type.startsWith("image/") || f.type.startsWith("video/"))) onFileSelect(f);
4069
4254
  };
4255
+ const applyUrl = async () => {
4256
+ const u = urlVal.trim();
4257
+ if (!/^https?:\/\//i.test(u)) {
4258
+ setUrlErr(t("bgUrlBadHttp"));
4259
+ return;
4260
+ }
4261
+ setUrlBusy(true);
4262
+ setUrlErr(null);
4263
+ const r = await setWallpaperFromUrl(u);
4264
+ setUrlBusy(false);
4265
+ if (r.ok) {
4266
+ setWp(r.dataUrl ?? null);
4267
+ setUrlOpen(false);
4268
+ setUrlVal("");
4269
+ } else setUrlErr(r.error === "invalid url" || r.error === "unsupported scheme" ? t("bgUrlBadHttp") : r.error ?? t("bgUrlFail"));
4270
+ };
4070
4271
  const switchToStatic = () => {
4071
4272
  if (isStatic) return;
4072
4273
  setBgType(isVideo || cfg.videoMime !== null ? "video" : "image");
@@ -4227,41 +4428,105 @@ window.__ModuleLoader__.load({
4227
4428
  !isGenerated ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4228
4429
  className: "dab-card dab-card-hover dab-rise",
4229
4430
  style: { "--d": 3 },
4230
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4231
- className: "dab-chip-row",
4232
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4233
- type: "button",
4234
- className: "dab-btn dab-btn-primary",
4235
- onClick: () => fileRef.current?.click(),
4236
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UploadIcon, { size: 14 }), t("bgChoose")]
4237
- }), storeUrl || isVideo ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [isStatic && storeUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4238
- type: "button",
4239
- className: "dab-btn",
4240
- disabled: mode !== "fit",
4241
- title: mode !== "fit" ? t("bgEditLocked") : void 0,
4242
- onClick: () => setEditorOpen(true),
4243
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditIcon, { size: 14 }), t("bgEdit")]
4244
- }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4245
- type: "button",
4246
- className: "dab-btn dab-btn-ghost dab-btn-danger",
4247
- onClick: () => setWp(null),
4248
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TrashIcon, { size: 14 }), t("bgRemove")]
4249
- })] }) : null]
4250
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4251
- style: { marginTop: 16 },
4252
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4253
- className: "dab-swatch-title",
4254
- children: t("bgModeTitle")
4255
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4431
+ children: [
4432
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4256
4433
  className: "dab-chip-row",
4257
- children: BG_MODES.map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4258
- type: "button",
4259
- className: `dab-chip${mode === m.mode ? " is-active" : ""}`,
4260
- onClick: () => setMode(m.mode),
4261
- children: t(m.labelKey)
4262
- }, m.mode))
4263
- })]
4264
- })]
4434
+ children: [
4435
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4436
+ type: "button",
4437
+ className: "dab-btn dab-btn-primary",
4438
+ onClick: () => fileRef.current?.click(),
4439
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(UploadIcon, { size: 14 }), t("bgChoose")]
4440
+ }),
4441
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4442
+ type: "button",
4443
+ className: "dab-btn dab-btn-ghost",
4444
+ onClick: () => setUrlOpen((o) => !o),
4445
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LinkIcon, { size: 14 }), t("bgFromUrl")]
4446
+ }),
4447
+ storeUrl || isVideo ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [isStatic && storeUrl ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4448
+ type: "button",
4449
+ className: "dab-btn",
4450
+ disabled: mode !== "fit",
4451
+ title: mode !== "fit" ? t("bgEditLocked") : void 0,
4452
+ onClick: () => setEditorOpen(true),
4453
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditIcon, { size: 14 }), t("bgEdit")]
4454
+ }) : null, /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
4455
+ type: "button",
4456
+ className: "dab-btn dab-btn-ghost dab-btn-danger",
4457
+ onClick: () => setWp(null),
4458
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TrashIcon, { size: 14 }), t("bgRemove")]
4459
+ })] }) : null
4460
+ ]
4461
+ }),
4462
+ urlOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4463
+ className: "dab-urlrow",
4464
+ style: {
4465
+ marginTop: 12,
4466
+ display: "flex",
4467
+ flexWrap: "wrap",
4468
+ gap: 8,
4469
+ alignItems: "center"
4470
+ },
4471
+ children: [
4472
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
4473
+ type: "text",
4474
+ className: "dab-urlinput",
4475
+ value: urlVal,
4476
+ placeholder: t("bgUrlPlaceholder"),
4477
+ onChange: (e) => setUrlVal(e.target.value),
4478
+ onKeyDown: (e) => {
4479
+ if (e.key === "Enter") {
4480
+ e.preventDefault();
4481
+ applyUrl();
4482
+ }
4483
+ },
4484
+ autoFocus: true
4485
+ }),
4486
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4487
+ type: "button",
4488
+ className: "dab-btn dab-btn-primary",
4489
+ disabled: urlBusy,
4490
+ onClick: () => void applyUrl(),
4491
+ children: urlBusy ? t("bgUrlApplying") : t("bgUrlApply")
4492
+ }),
4493
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4494
+ type: "button",
4495
+ className: "dab-btn",
4496
+ onClick: () => {
4497
+ setUrlOpen(false);
4498
+ setUrlVal("");
4499
+ setUrlErr(null);
4500
+ },
4501
+ children: t("bgUrlCancel")
4502
+ })
4503
+ ]
4504
+ }) : null,
4505
+ urlErr ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
4506
+ className: "dab-urlerr",
4507
+ style: {
4508
+ marginTop: 8,
4509
+ color: "var(--dsw-alias-state-error-primary)",
4510
+ fontSize: 12
4511
+ },
4512
+ children: urlErr
4513
+ }) : null,
4514
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
4515
+ style: { marginTop: 16 },
4516
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4517
+ className: "dab-swatch-title",
4518
+ children: t("bgModeTitle")
4519
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
4520
+ className: "dab-chip-row",
4521
+ children: BG_MODES.map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
4522
+ type: "button",
4523
+ className: `dab-chip${mode === m.mode ? " is-active" : ""}`,
4524
+ onClick: () => setMode(m.mode),
4525
+ children: t(m.labelKey)
4526
+ }, m.mode))
4527
+ })]
4528
+ })
4529
+ ]
4265
4530
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
4266
4531
  className: "dab-card dab-rise",
4267
4532
  style: { "--d": 3 },
@@ -4749,7 +5014,7 @@ window.__ModuleLoader__.load({
4749
5014
  }, "dsh-any-background: skin dispose");
4750
5015
  const styleEl = document.createElement("style");
4751
5016
  styleEl.dataset.plugin = "dsh-any-background";
4752
- styleEl.textContent = `body[data-ds-dark-theme="dsh-any-background"]::before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(ellipse 80% 60% at 50% 0%,rgba(255,255,255,0.03) 0%,transparent 60%)}${SETTINGS_STYLE_RULE}${TRAJECTORY_STYLE_RULE}${INPUT_BLUR_RULE}`;
5017
+ styleEl.textContent = `body[data-ds-dark-theme="dsh-any-background"]::before{content:'';position:fixed;inset:0;z-index:-1;pointer-events:none;background:radial-gradient(ellipse 80% 60% at 50% 0%,rgba(255,255,255,0.03) 0%,transparent 60%)}${SETTINGS_STYLE_RULE}${TRAJECTORY_STYLE_RULE}${INPUT_BLUR_RULE}[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}`;
4753
5018
  document.head.appendChild(styleEl);
4754
5019
  ctx.effect(() => () => {
4755
5020
  styleEl?.parentNode?.removeChild(styleEl);
@@ -4760,7 +5025,7 @@ window.__ModuleLoader__.load({
4760
5025
  let colorRev = 0;
4761
5026
  let bgRev = 0;
4762
5027
  const colorTimerRef = { current: null };
4763
- const store = (0, _deepseek_ai_dsh_client_runtime_client.defineStore)({
5028
+ const store = defineStore({
4764
5029
  init: () => ({
4765
5030
  url: null,
4766
5031
  rev: -1,
@@ -5214,6 +5479,10 @@ window.__ModuleLoader__.load({
5214
5479
  ctx.effect(() => () => {
5215
5480
  window.clearInterval(watchdogId);
5216
5481
  }, "dsh-any-background: theme watchdog");
5482
+ const disposeThemeResets = watchThemeResets();
5483
+ ctx.effect(() => () => {
5484
+ disposeThemeResets();
5485
+ }, "dsh-any-background: theme resets watch");
5217
5486
  const onPageHide = () => flushSave();
5218
5487
  window.addEventListener("pagehide", onPageHide);
5219
5488
  ctx.effect(() => () => window.removeEventListener("pagehide", onPageHide), "dsh-any-background: pagehide flush");