dsh-folia 4.15.0 → 4.15.1

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.
Files changed (2) hide show
  1. package/lib/client.js +28 -2
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -18570,8 +18570,15 @@ window.__ModuleLoader__.load({
18570
18570
 
18571
18571
  const installed = (state && state.installed) || [];
18572
18572
  const activeId = (state && state.active) || "";
18573
+ // 「皮肤中心记着哪套」≠「屏上现在是哪套」:壁纸在台上时皮肤会 withhold 自己,
18574
+ // 但它持久化的 active 不会自动清(我们 4.15.1 起在用户选壁纸时主动清一次)。
18575
+ // 这台机器的旧状态(或清理失败)仍可能出现"壁纸在播、页签却标使用中",所以这里先看
18576
+ // 我们的壁纸标记,标了就不把 active 说成"使用中",而是说"已让位"。
18577
+ const wallpaperOn = (() => {
18578
+ try { return Boolean(document && document.body && document.body.hasAttribute("data-we-wallpaper")); } catch { return false; }
18579
+ })();
18573
18580
  /** 这个 id 是不是"正在用"的那套(两边都归一后比,站点 slug 可能带 skin- 前缀)。 */
18574
- const isActiveSkin = (id) => Boolean(activeId) && normSkinId(activeId) === normSkinId(id);
18581
+ const isActiveSkin = (id) => Boolean(activeId) && !wallpaperOn && normSkinId(activeId) === normSkinId(id);
18575
18582
 
18576
18583
  /**
18577
18584
  * 站点条目 → 本机已装皮肤的真实 id(皮肤中心只认这个)。
@@ -18592,7 +18599,19 @@ window.__ModuleLoader__.load({
18592
18599
  if (state) {
18593
18600
  children.push(React.createElement("div", { key: "installed-head", className: "we-picker__hint" },
18594
18601
  weT("本机已装({n})", { n: installed.length }),
18595
- activeId ? weT(" · 使用中:{name}", { name: activeId }) : ""));
18602
+ // 壁纸在台上时不说"使用中":皮肤已让位,说了就是骗人(实测:壁纸在播却标皮肤使用中)
18603
+ activeId
18604
+ ? (wallpaperOn
18605
+ ? weT(" · 皮肤已让位(壁纸在使用中):{name}", { name: activeId })
18606
+ : weT(" · 使用中:{name}", { name: activeId }))
18607
+ : ""));
18608
+ if (activeId && wallpaperOn) {
18609
+ children.push(React.createElement("div", {
18610
+ key: "yield-note",
18611
+ className: "we-picker__hint",
18612
+ style: { margin: "0 0 6px", opacity: 0.8 },
18613
+ }, weT("当前是壁纸在台上,皮肤中心记着的这套没有在画。点「应用」会让皮肤上台(壁纸自动让位)。")));
18614
+ }
18596
18615
  // 「恢复默认」:清空选择、回到官方外观。只有确实有皮肤在用的时候才有意义。
18597
18616
  if (activeId) {
18598
18617
  children.push(React.createElement("button", {
@@ -21095,6 +21114,13 @@ window.__ModuleLoader__.load({
21095
21114
  && typeof skinYieldActive === "function" && skinYieldActive()) {
21096
21115
  exitSkinYield("manual-pick", { skipRestore: true });
21097
21116
  }
21117
+ // 「最后动作优先」的另一半:**用户选了壁纸** ⇒ 皮肤中心那边的 selection 也该清掉。
21118
+ // 否则它的 active 一直留着上一套皮肤,页签读了它就显示「使用中」——可屏上其实是壁纸
21119
+ //(它自己检测到 `body[data-we-wallpaper]` 就 withhold 了)。实测症状:壁纸在播、页签却标着
21120
+ // "皮肤使用中"。fire-and-forget:写失败不影响这次壁纸应用(页签按读到的事实显示)。
21121
+ if (id && opts && opts.fromManual) {
21122
+ try { apiPostJson("/skins/activate", { id: "" }, { parse: "always" }).catch(() => {}); } catch { /* ignore */ }
21123
+ }
21098
21124
  reportClientDiag("apply", "id=" + String(id || "").slice(0, 40));
21099
21125
  // 手动切换/清除/revalidate:取消进行中的轮换准备(staged/探测元素全部
21100
21126
  // 释放),并丢弃任何滞留的就绪元素。轮换提交(fromRotation)例外 ——
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-folia",
3
- "version": "4.15.0",
3
+ "version": "4.15.1",
4
4
  "description": "Folia 壁纸引擎:把本机 Wallpaper Engine 壁纸搬进 DSH 界面(场景实时渲染 / 视频 / 网页),内置液态玻璃与 Folia 吉祥物,并可从自建站点拉取壁纸。单包形态(组件已合并)。",
5
5
  "type": "module",
6
6
  "engines": {