dsh-folia 2.7.0 → 2.8.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/lib/client.js +27 -5
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -16320,12 +16320,13 @@ window.__ModuleLoader__.load({
|
|
|
16320
16320
|
}
|
|
16321
16321
|
el.src = pick.url;
|
|
16322
16322
|
// 皮肤 CSS 通过 `> img` / `> video` 选中它 ⇒ 必须是**直接子元素**。
|
|
16323
|
+
el.setAttribute("aria-hidden", "true");
|
|
16323
16324
|
el.style.cssText = "position:absolute;inset:0;width:100%;height:100%;object-fit:cover;";
|
|
16324
16325
|
layer.appendChild(el);
|
|
16325
16326
|
|
|
16326
16327
|
if (pick.scrim) {
|
|
16327
16328
|
const scrim = document.createElement("div");
|
|
16328
|
-
scrim.style.cssText = "position:absolute;inset:0;pointer-events:none;background
|
|
16329
|
+
scrim.style.cssText = "position:absolute;inset:0;pointer-events:none;background:" + pick.scrim + ";";
|
|
16329
16330
|
layer.appendChild(scrim);
|
|
16330
16331
|
}
|
|
16331
16332
|
|
|
@@ -16352,6 +16353,24 @@ window.__ModuleLoader__.load({
|
|
|
16352
16353
|
*/
|
|
16353
16354
|
|
|
16354
16355
|
const SKIN_LAYER_NAMES = ["background", "ambient", "bottom", "sidebar", "top", "foreground"];
|
|
16356
|
+
/**
|
|
16357
|
+
* 六层的**精确**样式:逐字对齐皮肤中心 `runtime/decoration-layers.ts` 的 `LAYER_STYLE`。
|
|
16358
|
+
*
|
|
16359
|
+
* 不能自己拍脑袋定层级 —— 它的注释写明了为什么:
|
|
16360
|
+
* · background 用 **-2**:负 z-index 元素画在 html/body 背景**之上**(皮肤自己的
|
|
16361
|
+
* 不透明底色因此在画后面、艺术图在它前面),但**在所有面板之下**;
|
|
16362
|
+
* · ambient 30、top/bottom/sidebar 40、foreground 41:压在面板之上、官方浮层
|
|
16363
|
+
* (>=1000)之下。之前我把非背景层留成 auto ⇒ 装饰条落进文档流最底层,
|
|
16364
|
+
* 表现正是"上面被面板盖住、只有下面露出背景"。
|
|
16365
|
+
*/
|
|
16366
|
+
const SKIN_LAYER_STYLE = {
|
|
16367
|
+
background: "position:fixed;top:0;right:0;bottom:0;left:0;z-index:-2;pointer-events:none;will-change:transform;",
|
|
16368
|
+
ambient: "position:fixed;top:0;right:0;bottom:0;left:0;z-index:30;pointer-events:none;",
|
|
16369
|
+
top: "position:fixed;top:0;left:0;right:0;z-index:40;pointer-events:none;",
|
|
16370
|
+
bottom: "position:fixed;bottom:0;left:0;right:0;z-index:40;pointer-events:none;",
|
|
16371
|
+
sidebar: "position:fixed;top:0;bottom:0;left:0;z-index:40;pointer-events:none;",
|
|
16372
|
+
foreground: "position:fixed;top:0;right:0;bottom:0;left:0;z-index:41;pointer-events:none;",
|
|
16373
|
+
};
|
|
16355
16374
|
/** 本次激活注册的清理函数(切换皮肤时逐个跑掉,幂等)。 */
|
|
16356
16375
|
let skinHotCleanups = [];
|
|
16357
16376
|
|
|
@@ -16373,14 +16392,17 @@ window.__ModuleLoader__.load({
|
|
|
16373
16392
|
if (!el) {
|
|
16374
16393
|
el = document.createElement("div");
|
|
16375
16394
|
el.setAttribute("data-dsh-skin-layer", name);
|
|
16376
|
-
|
|
16377
|
-
//(`background` 是契约里明写 z-index -2 的那层,其余留 auto)。
|
|
16378
|
-
el.style.cssText = "position:fixed;inset:0;pointer-events:none;"
|
|
16379
|
-
+ (name === "background" ? "z-index:-2;" : "");
|
|
16395
|
+
el.setAttribute("aria-hidden", "true");
|
|
16380
16396
|
host.appendChild(el);
|
|
16381
16397
|
}
|
|
16398
|
+
// 与它的 ensureOne 同口径:**每次都对已有层重写样式** —— 皮肤中心的层可能带着
|
|
16399
|
+
// 上一次激活留下的内联覆盖,只建不改会继承脏值。
|
|
16400
|
+
el.style.cssText = SKIN_LAYER_STYLE[name];
|
|
16382
16401
|
out[name] = el;
|
|
16383
16402
|
}
|
|
16403
|
+
// 皮肤中心自己会给 body 盖 `data-dsh-skin-center`(它的若干基础样式挂在这个前缀下),
|
|
16404
|
+
// 缺了它,面板/列表那些"表面透明"的规则不生效 → 大片面板仍然不透明。
|
|
16405
|
+
try { document.body.setAttribute("data-dsh-skin-center", ""); } catch { /* ignore */ }
|
|
16384
16406
|
return out;
|
|
16385
16407
|
}
|
|
16386
16408
|
|