dsh-mpkg-wallpaper 3.15.8 → 3.16.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.
Files changed (2) hide show
  1. package/lib/client.js +82 -10
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -17740,7 +17740,12 @@ html body [class*="sidebarCol"]:not([data-sidebar-right-panel]) { z-index: 1 !im
17740
17740
  被别的 z=2000 层盖住。⇒ 左栏子树里出现**可见的**宿主弹层/对话框时给左栏打抬升标记;
17741
17741
  弹层关掉即摘(收纳态"左栏盖右栏"的老问题不受影响)。 */
17742
17742
  html body [data-mpw-side-lift] { z-index: 2500 !important; }
17743
- [role="menu"], [role="listbox"], [role="dialog"], [role="tooltip"],
17743
+ /* ②(2026-10-05 真机定案续) 把 role=dialog 从这里拿掉:宿主的"设置"面板自己就带
17744
+ role=dialog aria-modal(真机读数 VOzbGW_panel),把它钉到 3000 之后,宿主自己的对话框
17745
+ (挂在 z-index:1000 的 portal root 里)永远追不上 ⇒ "设置里点查看,弹窗被压在设置底下、点不到"。
17746
+ 这里只保留**小浮层**(菜单/列表/提示/下拉)——它们需要压过面板才点得到;
17747
+ 面板/对话框的层级一律交还宿主自己的次序。我们自己的弹窗(.mpw_dialog)由上面的规则单独抬。 */
17748
+ [role="menu"], [role="listbox"], [role="tooltip"],
17744
17749
  [class*="_popover"], [class*="_dropdown"], [class*="_selectMenu"], [class*="_menu_"],
17745
17750
  [data-radix-popper-content-wrapper], [data-dsh-popover] {
17746
17751
  z-index: 3000 !important;
@@ -17791,8 +17796,14 @@ html body:has([class*="_overlayLayer"]) [class*="_floatHeader_"],
17791
17796
  html body:has([class*="_overlay"]) [class*="_floatHeader_"] {
17792
17797
  z-index: auto !important;
17793
17798
  }
17794
- /* 设置/弹层本身必须最高(含其内部下拉),保证可点可选 */
17795
- html body [class*="_overlayLayer"], html body [class*="_overlay"], html body [class*="_modal"], html body [role="dialog"] {
17799
+ /* 设置/弹层本身的层级:**只抬我们自己的弹窗,不重钉宿主自己的 overlay**。
17800
+ ②(2026-10-05 真机定案:"设置 → Agent 预设 → 查看,弹窗被压在设置底下;把壁纸/插件关掉就正常了")
17801
+ 根因就是这一条:旧写法把宿主的设置弹层(VOzbGW_overlay)一起钉成 z-index:2000,而宿主自己的
17802
+ 对话框挂在 portal root(position:fixed, z-index:1000)里 —— 层叠上下文一盖,里面的 dialog
17803
+ 再高也只能到 1000 ⇒ 永远被设置弹层压住、点不到(真机打印的祖先链:dialog → _root_w1urq_2
17804
+ [z=1000] → BODY)。插件一关就没这条规则 ⇒ 宿主的自然次序恢复 ⇒ 弹窗正常在上面。
17805
+ ⇒ 这里只保留我们自己的面板/弹窗类,宿主的 _overlay / _overlayLayer 一律交还宿主自己的层级。 */
17806
+ html body [class*="_modal"], html body .mpw_dialog {
17796
17807
  z-index: 2000 !important;
17797
17808
  }
17798
17809
  /* 设置/对话弹层本身不做玻璃(避免 backdrop-filter 变成下拉的 containing block)。
@@ -24926,6 +24937,19 @@ body[data-mpw-modal] [role="dialog"] {
24926
24937
  try {
24927
24938
  let n = 0;
24928
24939
  for (const rec of (records || [])) {
24940
+ /* ②(2026-10-05 真机仍见白帧的根因) 弹层大多是**先插入(隐藏)→ 再靠 class/style 显形**:
24941
+ 只认 addedNodes 时,元素插入那一刻还是 display:none(判定不出"浮层面积",也看不见),
24942
+ 等它显形时走的是 **attributes 突变**,而旧观察器只监听 childList ⇒ 显形那一帧没人管,
24943
+ 用户看到的就是宿主自己的不透明白底。现在把属性突变也接进同步快路(MutationObserver
24944
+ 回调是微任务,跑在**渲染之前** ⇒ 显形的那一帧就已经带上我们的表面)。 */
24945
+ if (rec.type === "attributes") {
24946
+ const t = rec.target;
24947
+ if (!t || t.nodeType !== 1) continue;
24948
+ let hit = false;
24949
+ try { hit = t.matches && t.matches(MPW_POP_TAG_SEL) } catch (e) {}
24950
+ if (hit) { if (mpwTagOnePopover(t)) n++; }
24951
+ continue;
24952
+ }
24929
24953
  for (const node of (rec.addedNodes || [])) {
24930
24954
  if (!node || node.nodeType !== 1) continue;
24931
24955
  const cands = [];
@@ -24937,7 +24961,7 @@ body[data-mpw-modal] [role="dialog"] {
24937
24961
  }
24938
24962
  }
24939
24963
  try { mpwSideLiftSync(); } catch (e) {}
24940
- if (n) { try { mpwPopUntruncSync(); } catch (e) {} }
24964
+ try { mpwPopUntruncSync(); } catch (e) {}
24941
24965
  return n;
24942
24966
  } catch (e) { return 0 }
24943
24967
  }
@@ -24948,11 +24972,15 @@ body[data-mpw-modal] [role="dialog"] {
24948
24972
  const cls = (typeof el.className === "string") ? el.className : "";
24949
24973
  if (!MPW_POP_TAG_NOT.test(cls)) {
24950
24974
  const cs = getComputedStyle(el);
24951
- if (cs && cs.display !== "none" && cs.visibility !== "hidden"
24952
- && /blur\(/.test(String(cs.backdropFilter || cs.webkitBackdropFilter || ""))) {
24975
+ const blurred = !!(cs && /blur\(/.test(String(cs.backdropFilter || cs.webkitBackdropFilter || "")));
24976
+ if (blurred) {
24953
24977
  const a = mpwColorAlpha(cs.backgroundColor);
24978
+ /* ②(2026-10-05) 两类分开判:
24979
+ · 宿主**没有底**(α<0.05)的弹层:**不要求此刻可见** —— 隐藏时打标无害,
24980
+ 等它显形时表面已经在位(这正是"先插入后显形"那条路的白帧来源);
24981
+ · 宿主画了**不透明底**的小浮层:必须量得到面积(隐藏时 rect=0 ⇒ 留给下一次触发)。 */
24954
24982
  if (a < 0.05) need = !mpwPopHasPaintedAncestor(el);
24955
- else if (a >= 0.999) need = mpwPopIsFloating(el);
24983
+ else if (a >= 0.999 && cs.display !== "none" && cs.visibility !== "hidden") need = mpwPopIsFloating(el);
24956
24984
  }
24957
24985
  }
24958
24986
  } catch (e) { need = false; }
@@ -25031,9 +25059,20 @@ body[data-mpw-modal] [role="dialog"] {
25031
25059
  而输入框卡片 `uV2eYG_card`(有底、有 blur,但**不是**弹层表面)只是"碰巧挡在
25032
25060
  弹层前面的包装" ⇒ 摘掉它的 blur 换来弹层真模糊,代价是"菜单打开期间它自己不糊"。
25033
25061
  真机读数支持这条:四个弹层里只有 body 下的模型选择器有模糊,另三个全被卡片截断。 */
25062
+ /* ②(2026-10-05 复核) **不做几何相交判定**:backdrop root 的截断是 DOM/层叠性质,
25063
+ 与两者矩形是否重叠无关 —— 祖先的模糊区不覆盖弹层时,弹层的 backdrop 是**空的**,
25064
+ 照样"只有半透明没有模糊"(真机就是这么报的)。⇒ 只要是已知包装容器就摘。 */
25034
25065
  let ancestorIsSurface = false;
25035
25066
  try { ancestorIsSurface = p.matches(MPW_POP_TAG_SEL) } catch (e) {}
25036
- if (mpwColorAlpha(acs.backgroundColor) >= 0.05 && ancestorIsSurface) { blockedByGlass = true; break }
25067
+ if (ancestorIsSurface) { blockedByGlass = true; break }
25068
+ /* ②(2026-10-05 审查后收紧) **只摘"已知包装容器"的 blur**:真机定案的截断者只有一类 ——
25069
+ 输入框卡片这类"碰巧挡在弹层前面的包装"(类名含 `_card` / `composer` / `overlayAnchor`)。
25070
+ 其余任何带 blur 的祖先(标题栏里的子代理展开框、后台任务面板、别的宿主面板)**一律不碰**:
25071
+ 它们是用户**正在看**的玻璃,摘掉就是"效果没了"(真机已因此报过一次)。
25072
+ 代价:包在未知面板里的弹层保持"半透明无模糊"——这是**保守但不会破坏用户看得见的东西**的一侧。 */
25073
+ let strippableWrap = false;
25074
+ try { strippableWrap = /(_card|composer|overlayAnchor|_seat|_stack)/i.test(String(p.className || "")) } catch (e) {}
25075
+ if (!strippableWrap) { blockedByGlass = true; break }
25037
25076
  targets.add(p);
25038
25077
  break;
25039
25078
  }
@@ -25047,7 +25086,26 @@ body[data-mpw-modal] [role="dialog"] {
25047
25086
  for (let i = 0; i < staleT.length; i++) { const el = staleT[i]; if (!truncated.has(el)) { try { el.removeAttribute("data-mpw-pop-trunc") } catch (e) {} } }
25048
25087
  for (const el of truncated) { if (!el.hasAttribute("data-mpw-pop-trunc")) { try { el.setAttribute("data-mpw-pop-trunc", "") } catch (e) {} } }
25049
25088
  if (targets.size) mpwPopUntruncStyle();
25050
- else if (popUntruncStyleEl && popUntruncStyleEl.parentElement) { try { popUntruncStyleEl.remove() } catch (e) {} popUntruncStyleEl = null; }
25089
+ else if (popUntruncStyleEl && popUntruncStyleEl.parentElement) {
25090
+ /* ②(2026-10-05 审查建议) 撤除也要**瞬时**:宿主若给这些元素写了 transition,
25091
+ 直接撤规则会反向播一次"清晰→磨砂"的可感知跳变。先注入一条"禁过渡 + 保持 none",
25092
+ 下一帧再真正撤掉。 */
25093
+ try {
25094
+ const kill = document.createElement("style");
25095
+ kill.setAttribute("data-plugin", "dsh-mpkg-wallpaper");
25096
+ kill.setAttribute("data-mpw-pop-untrunc-kill", "");
25097
+ kill.textContent = "[data-mpw-pop-untrunc]{transition:none !important;backdrop-filter:none !important;-webkit-backdrop-filter:none !important}";
25098
+ (document.head || document.documentElement).appendChild(kill);
25099
+ setTimeout(() => {
25100
+ try { kill.remove() } catch (e) {}
25101
+ try { if (popUntruncStyleEl && popUntruncStyleEl.parentElement) popUntruncStyleEl.remove() } catch (e) {}
25102
+ popUntruncStyleEl = null;
25103
+ }, 0);
25104
+ } catch (e) {
25105
+ try { popUntruncStyleEl.remove() } catch (e2) {}
25106
+ popUntruncStyleEl = null;
25107
+ }
25108
+ }
25051
25109
  return targets.size + truncated.size * 1000; // 千位段 = 被"有底玻璃祖先"挡住、改为实底的弹层数
25052
25110
  } catch (e) { return 0 }
25053
25111
  }
@@ -25056,6 +25114,7 @@ body[data-mpw-modal] [role="dialog"] {
25056
25114
  globalThis.__mpwPopUntruncTest = {
25057
25115
  sync: () => mpwPopUntruncSync(),
25058
25116
  stylePresent: () => !!(popUntruncStyleEl && popUntruncStyleEl.parentElement),
25117
+ killPresent: () => !!document.querySelector("[data-mpw-pop-untrunc-kill]"),
25059
25118
  };
25060
25119
  } catch (e) {}
25061
25120
 
@@ -25107,7 +25166,20 @@ body[data-mpw-modal] [role="dialog"] {
25107
25166
  try { praf = (typeof requestAnimationFrame === "function") ? requestAnimationFrame(prun) : setTimeout(prun, 16); }
25108
25167
  catch (e) { prun(); }
25109
25168
  });
25110
- popTagWatch.observe(document.body, { childList: true, subtree: true });
25169
+ popTagWatch.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ["class", "style", "data-state", "aria-expanded", "hidden"] });
25170
+ /* ②(2026-10-05) **原生 popover API**(`showPopover()`/`hidePopover()`)打开时不改任何属性、
25171
+ 也没有 childList 突变 ⇒ 上面前两条快路都收不到信号(模型/推理选择器就是这种,真机表现为
25172
+ "打开要等一会儿才有底")。`toggle` 事件在 capture 阶段能收到(它不冒泡)⇒ 当场补一次判定。 */
25173
+ try {
25174
+ document.addEventListener("toggle", (ev) => {
25175
+ try {
25176
+ const t = ev && ev.target;
25177
+ if (t && t.nodeType === 1) mpwTagOnePopover(t);
25178
+ mpwPopUntruncSync();
25179
+ mpwSideLiftSync();
25180
+ } catch (e) {}
25181
+ }, true);
25182
+ } catch (e) {}
25111
25183
  } catch { popTagWatch = null; }
25112
25184
  mpwTagPopoverBg();
25113
25185
  try { mpwPopUntruncSync(); } catch (e) {}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mpkg-wallpaper",
3
- "version": "3.15.8",
3
+ "version": "3.16.0",
4
4
  "description": "DSH Web 壁纸引擎 Wallpaper Engine mpkg 背景插件:浏览器内直接解析 .mpkg(preview.gif 动态背景/内嵌 mp4 视频/多时段切换),整屏统一虚化/对话框/弹层/遮罩独立虚化、镜头缩放平移、时钟、冲突检测。",
5
5
  "private": false,
6
6
  "type": "module",