wallpaper-engine-dsh 2.1.2 → 2.1.4

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
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [中文](README.zh.md)
4
4
 
5
- A DSH bundle that turns your local **Wallpaper Engine** library into the live background of the DSH web GUI (`dsh web`). Video wallpapers play behind the chat, web wallpapers render in place, and everything in between — crossfade transitions, liquid-glass panels, a legibility veil that adapts to any wallpaper, manual framing, rotation lists, search, and a bilingual UI — is controlled from a single settings row.
5
+ A DSH bundle that turns your local **Wallpaper Engine** library into the live background of the DSH web GUI (`dsh web`). Video wallpapers play behind the chat, web wallpapers render in place, and everything in between — crossfade transitions, liquid-glass panels, a legibility veil that adapts to any wallpaper, manual framing, rotation lists, search, and a bilingual UI — is controlled from its own dedicated settings section.
6
6
 
7
7
  ## Features
8
8
 
@@ -35,7 +35,7 @@ git clone https://github.com/Weilv-D/wallpaper-engine-dsh.git
35
35
  dsh plugin --profile web add link:<absolute path to the cloned folder>
36
36
  ```
37
37
 
38
- Restart `dsh web`, then open **Settings → General → Wallpaper Engine**.
38
+ Restart `dsh web`, open **Settings** from the sidebar, and pick **Wallpaper**.
39
39
 
40
40
  ## Usage
41
41
 
package/README.zh.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [English](README.md) | [中文](README.zh.md)
4
4
 
5
- 一个 DSH bundle:把本机 **Wallpaper Engine** 壁纸库变成 DSH web GUI(`dsh web`)的动态背景。视频壁纸在聊天界面背后播放,网页壁纸直接渲染。交叉淡入、液态玻璃面板、随壁纸自适应的可读性遮罩、手动取景、轮播列表、搜索与中英双语界面,全部集中在一个设置行里。
5
+ 一个 DSH bundle:把本机 **Wallpaper Engine** 壁纸库变成 DSH web GUI(`dsh web`)的动态背景。视频壁纸在聊天界面背后播放,网页壁纸直接渲染。交叉淡入、液态玻璃面板、随壁纸自适应的可读性遮罩、手动取景、轮播列表、搜索与中英双语界面,集中在一个专门的设置分区里。
6
6
 
7
7
  ## 功能
8
8
 
@@ -35,7 +35,7 @@ git clone https://github.com/Weilv-D/wallpaper-engine-dsh.git
35
35
  dsh plugin --profile web add link:<克隆文件夹的绝对路径>
36
36
  ```
37
37
 
38
- 重启 `dsh web`,打开 **设置 → 通用 → 壁纸背景 (Wallpaper Engine)**。
38
+ 重启 `dsh web`,在左侧会话列表点「设置」,侧栏选 **壁纸背景**。
39
39
 
40
40
  ## 使用
41
41
 
package/lib/client.js CHANGED
@@ -37,6 +37,7 @@ window.__ModuleLoader__.load({
37
37
  const STRINGS = {
38
38
  zh: {
39
39
  settingsLabel: "壁纸背景 (Wallpaper Engine)",
40
+ navLabel: "壁纸背景",
40
41
  scanning: "正在扫描 Wallpaper Engine…",
41
42
  connError: "未能连接 Wallpaper Engine:",
42
43
  retry: "重试",
@@ -122,6 +123,7 @@ window.__ModuleLoader__.load({
122
123
  },
123
124
  en: {
124
125
  settingsLabel: "Wallpaper Engine",
126
+ navLabel: "Wallpaper",
125
127
  scanning: "Scanning Wallpaper Engine…",
126
128
  connError: "Could not reach Wallpaper Engine: ",
127
129
  retry: "Retry",
@@ -1869,6 +1871,7 @@ window.__ModuleLoader__.load({
1869
1871
  const editing = sel.editing;
1870
1872
 
1871
1873
  return React.createElement("div", { className: "webg-picker" },
1874
+ React.createElement("h2", { className: "webg-heading" }, t.settingsLabel),
1872
1875
  SearchRow(t, sel, query, setQuery, filteredList.length, usableList.length),
1873
1876
  WallpaperGrid(t, sel, usableList, filteredList, q),
1874
1877
  ActionRow(t, sel),
@@ -2108,7 +2111,11 @@ window.__ModuleLoader__.load({
2108
2111
  /* padding-top lifts the first row off the settings-section divider so the
2109
2112
  search/language row breathes; gap keeps every row evenly spaced.
2110
2113
  Type scale follows the shell: 14px body → 13px controls → 12px hints. */
2111
- .webg-picker { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; }
2114
+ .webg-picker { display: flex; flex-direction: column; gap: 12px; padding-top: 10px; max-width: 900px; }
2115
+ /* Page heading mirrors the shell's own section headings (18px/600, no
2116
+ margins) — the sidebar label is the short nav name, this carries the
2117
+ full product name. */
2118
+ .webg-heading { margin: 0; font-size: 18px; font-weight: 600; color: var(--dsw-alias-label-primary, inherit); }
2112
2119
  .webg-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
2113
2120
  .webg-hint { font-size: 12px; opacity: 0.7; color: var(--dsw-alias-label-tertiary, inherit); }
2114
2121
  .webg-error {
@@ -2330,7 +2337,7 @@ window.__ModuleLoader__.load({
2330
2337
 
2331
2338
  // ── Plugin exports ──────────────────────────────────────────────────────────
2332
2339
  // The client runner (dsh-cordis-client-runner) rejects ctx.get() of any
2333
- // service this plugin does not declare. slots registers the settings row,
2340
+ // service this plugin does not declare. slots registers the settings section,
2334
2341
  // locale drives the bilingual UI, theme drives the veil/scheme reactions.
2335
2342
  const inject = ["slots", "locale", "theme"];
2336
2343
 
@@ -2535,16 +2542,62 @@ window.__ModuleLoader__.load({
2535
2542
  });
2536
2543
  }
2537
2544
 
2538
- // 4. Settings row (this slot is NOT the overlay; safe to register into).
2545
+ // Nav icon: the settings sidebar hardcodes icons by section id
2546
+ // (account/models/plugins/...) and falls back to a gear for every
2547
+ // plugin-registered section; nav rows expose no per-row hook (no
2548
+ // data-id, class names are module-suffixed), so the icon is swapped
2549
+ // in place: watch for nav rows whose label text is ours and replace
2550
+ // the default gear SVG with the plugin wallpaper glyph. The gear's
2551
+ // class attribute is copied so the shell's sizing styles still apply,
2552
+ // and a dataset guard keeps the swap idempotent across re-renders.
2553
+ const NAV_ICON_SVG =
2554
+ '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round">' +
2555
+ '<rect x="2" y="2" width="12" height="12" rx="2"/>' +
2556
+ '<circle cx="5.8" cy="5.8" r="1.1"/>' +
2557
+ '<path d="M14 10l-3.33-3.33L3.33 14"/></svg>';
2558
+ const styleNavIcon = () => {
2559
+ if (typeof document.querySelectorAll !== "function") return;
2560
+ for (const row of document.querySelectorAll('button[class*="navCell"]')) {
2561
+ if (row.dataset && row.dataset.webgNavIcon) continue;
2562
+ if (row.textContent !== S().navLabel) continue;
2563
+ const gear = row.querySelector("svg");
2564
+ if (!gear) continue;
2565
+ row.dataset.webgNavIcon = "1";
2566
+ const tpl = document.createElement("span");
2567
+ tpl.innerHTML = NAV_ICON_SVG;
2568
+ const svg = tpl.firstChild;
2569
+ const cls = gear.getAttribute && gear.getAttribute("class");
2570
+ if (cls) svg.setAttribute("class", cls);
2571
+ gear.replaceWith(svg);
2572
+ }
2573
+ };
2574
+ // 4. Own settings section — NOT a row inside General. The settings dialog
2575
+ // enumerates every registered settings.section slot for its nav
2576
+ // (settings-general and settings-plugins register theirs the same way),
2577
+ // so the picker renders as a full page with its own sidebar entry,
2578
+ // ordered after the built-in sections (general 0, plugins 15).
2539
2579
  if (ctx.slots) {
2540
- ctx.slots.inject("settings.general.item", () =>
2580
+ ctx.slots.inject("settings.section", () =>
2541
2581
  ctx.slots.register(
2542
- { name: "settings.general.item", id: "we-background", order: 500, label: () => S().settingsLabel },
2582
+ { name: "settings.section", id: "we-background", order: 20, label: () => S().navLabel },
2543
2583
  () => React.createElement(WallpaperPicker),
2544
2584
  ),
2545
2585
  );
2546
2586
  }
2547
2587
 
2588
+ // 4b. Drive the nav icon swap (defined above): the settings dialog mounts
2589
+ // its nav only while open, so the observer just sweeps on mutation
2590
+ // batches and early-exits when no nav rows exist. Disposed with the
2591
+ // plugin fiber.
2592
+ if (ctx.effect && typeof MutationObserver === "function" && typeof document !== "undefined") {
2593
+ ctx.effect(() => {
2594
+ const mo = new MutationObserver(styleNavIcon);
2595
+ mo.observe(document.body, { childList: true, subtree: true });
2596
+ styleNavIcon();
2597
+ return () => mo.disconnect();
2598
+ });
2599
+ }
2600
+
2548
2601
  loadInventory(false);
2549
2602
  }
2550
2603
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wallpaper-engine-dsh",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
4
4
  "description": "Wallpaper Engine library as the DSH web GUI background — video/web/still wallpapers, rotation lists, search, resource monitor, bilingual UI.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",