dsh-mpkg-wallpaper 3.15.7 → 3.15.8

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 +105 -77
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -17734,6 +17734,12 @@ html body [data-sidebar-right-panel], html body [data-dockkit-pane], html body [
17734
17734
  z-index: 12 !important;
17735
17735
  }
17736
17736
  html body [class*="sidebarCol"]:not([data-sidebar-right-panel]) { z-index: 1 !important; }
17737
+ /* ②(2026-10-05 真机:"设置 → Agent 预设 → 查看,弹出的框被压在设置底下")
17738
+ 根因:宿主把设置弹层渲染在**左栏子树里**(真机读数 VOzbGW_overlay[z=2000] 是 pI_x6G_sidebarCol
17739
+ 的后代),而上面那条把左栏钉成 z-index:1 ⇒ 连同里面的弹窗一起被困在 z=1 的层叠上下文里,
17740
+ 被别的 z=2000 层盖住。⇒ 左栏子树里出现**可见的**宿主弹层/对话框时给左栏打抬升标记;
17741
+ 弹层关掉即摘(收纳态"左栏盖右栏"的老问题不受影响)。 */
17742
+ html body [data-mpw-side-lift] { z-index: 2500 !important; }
17737
17743
  [role="menu"], [role="listbox"], [role="dialog"], [role="tooltip"],
17738
17744
  [class*="_popover"], [class*="_dropdown"], [class*="_selectMenu"], [class*="_menu_"],
17739
17745
  [data-radix-popper-content-wrapper], [data-dsh-popover] {
@@ -24845,31 +24851,6 @@ body[data-mpw-modal] [role="dialog"] {
24845
24851
  return r.width * r.height <= 0.4 * vw * vh && r.height <= vh * 0.9;
24846
24852
  } catch (e) { return false; }
24847
24853
  }
24848
- function mpwTagPopoverBg() {
24849
- let list = null;
24850
- try { list = document.querySelectorAll(MPW_POP_TAG_SEL); } catch (e) { return; }
24851
- if (!list) return;
24852
- for (let i = 0; i < list.length; i++) {
24853
- const el = list[i];
24854
- let need = false;
24855
- try {
24856
- const cls = (typeof el.className === "string") ? el.className : "";
24857
- if (!MPW_POP_TAG_NOT.test(cls)) {
24858
- const cs = getComputedStyle(el);
24859
- if (cs && cs.display !== "none" && cs.visibility !== "hidden"
24860
- && /blur\(/.test(String(cs.backdropFilter || cs.webkitBackdropFilter || ""))) {
24861
- const a = mpwColorAlpha(cs.backgroundColor);
24862
- if (a < 0.05) need = !mpwPopHasPaintedAncestor(el);
24863
- else if (a >= 0.999) need = mpwPopIsFloating(el);
24864
- }
24865
- }
24866
- } catch (e) { need = false; }
24867
- try {
24868
- if (need) { if (!el.hasAttribute("data-mpw-pop-bg")) el.setAttribute("data-mpw-pop-bg", ""); }
24869
- else if (el.hasAttribute("data-mpw-pop-bg")) el.removeAttribute("data-mpw-pop-bg");
24870
- } catch (e) {}
24871
- }
24872
- }
24873
24854
  /* ②(2026-10-04 真机:"右侧边栏比左栏/标题栏更白")**嵌套表面只画最外层**:
24874
24855
  右栏/dock 家族是互相嵌套的(真机读数:两个命中元素的 rect 只差 1px),把同一枚半透明表面色
24875
24856
  刷在两层上 ⇒ 合成不透明度 1-(1-a)²(a=0.55 时 0.80)≈ 一块近白板;左栏只有一个匹配元素,
@@ -24909,62 +24890,85 @@ body[data-mpw-modal] [role="dialog"] {
24909
24890
  } catch (e) { return 0 }
24910
24891
  }
24911
24892
 
24912
- function mpwTagPopoverBg() {
24913
- let list = null;
24914
- try { list = document.querySelectorAll(MPW_POP_TAG_SEL); } catch (e) { return; }
24915
- if (!list) return;
24916
- for (let i = 0; i < list.length; i++) {
24917
- const el = list[i];
24918
- let need = false;
24919
- try {
24920
- const cls = (typeof el.className === "string") ? el.className : "";
24921
- if (!MPW_POP_TAG_NOT.test(cls)) {
24922
- const cs = getComputedStyle(el);
24923
- if (cs && cs.display !== "none" && cs.visibility !== "hidden"
24924
- && /blur\(/.test(String(cs.backdropFilter || cs.webkitBackdropFilter || ""))) {
24925
- const a = mpwColorAlpha(cs.backgroundColor);
24926
- if (a < 0.05) need = !mpwPopHasPaintedAncestor(el);
24927
- else if (a >= 0.999) need = mpwPopIsFloating(el);
24928
- }
24929
- }
24930
- } catch (e) { need = false; }
24931
- try {
24932
- if (need) { if (!el.hasAttribute("data-mpw-pop-bg")) el.setAttribute("data-mpw-pop-bg", ""); }
24933
- else if (el.hasAttribute("data-mpw-pop-bg")) el.removeAttribute("data-mpw-pop-bg");
24934
- } catch (e) {}
24935
- }
24936
- }
24937
- /* ②(2026-10-04 真机:"右侧边栏比左栏/标题栏更白")**嵌套表面只画最外层**:
24938
- 右栏/dock 家族是互相嵌套的(真机读数:两个命中元素的 rect 只差 1px),把同一枚半透明表面色
24939
- 刷在两层上 ⇒ 合成不透明度 1-(1-a)²(a=0.55 时 0.80)≈ 一块近白板;左栏只有一个匹配元素,
24940
- 于是"左栏灰、右栏白"。这里按**结构**(有没有同样命中的祖先)给最外层打
24941
- `data-mpw-rs-surface`,CSS 只认这个标记(与 `data-mpw-holds-layer` 同一手法)。
24942
- 幂等、无布局读取(只用 matches/parentElement),可随突变跑。 */
24943
- function mpwTagSurfaceOuter() {
24893
+ /* ②(2026-10-05 真机:"刚展开是白色的不透明背景,过一会儿才切换")——**同步快路**:
24894
+ 弹层插进 DOM 的那一刻就判定并打标(在同一个 mutation 回调里,早于下一帧绘制),不再等
24895
+ rAF 合并 + 闸门(那条路最坏 ~400ms,用户看到的就是"先白、过一会儿才变")。
24896
+ 只处理本次**新增子树**里的候选(与弹层数量同阶),不做全文档扫描。 */
24897
+ /* ②(2026-10-05) 左栏里出现"可见的宿主弹层/对话框" ⇒ 给左栏打抬升标记(见上面 CSS 注释)。
24898
+ 只读结构 + 尺寸,弹层关掉同一趟里摘掉;与弹层标记共用同一批触发点。 */
24899
+ const MPW_OVERLAY_SEL = '[class*="_overlay"], [class*="_modal"], [role="dialog"], [role="alertdialog"]';
24900
+ function mpwSideLiftSync() {
24944
24901
  try {
24945
- const all = Array.from(document.querySelectorAll(MPW_RS_FAMILY));
24946
- if (!all.length) return 0;
24947
- const set = new Set(all);
24948
- /* 真机读数:DSH 右栏面板与 dockkit 面板/标签条**互相重叠**(rect 只差 1~2px)却不在同一条
24949
- 祖先链上 ⇒ 只按"有没有命中祖先"判不出重叠,两层 55% 会合成 ~80%(用户看到的"更白")。
24950
- 判据:DSH 自己的右栏面板在场时,dock 子件一律不刷(它们显示的就是那块面板的表面);
24951
- 只有"没有右栏面板、只有 dock"的布局(better-sidebar 底部工作台等)才由 dock 自己承担。 */
24952
- const panel = document.querySelector('[data-sidebar-right-panel]');
24953
- const isDock = (el) => { try { return el.matches('[data-dockkit-pane], [data-dockkit-strip], [data-dockkit-surface], [data-dockkit-float]') } catch (e) { return false } };
24902
+ const sides = Array.from(document.querySelectorAll('[class*="sidebarCol"]:not([data-sidebar-right-panel])'));
24903
+ if (!sides.length) return 0;
24954
24904
  let changed = 0;
24955
- for (const el of all) {
24956
- let inner = false;
24957
- for (let p = el.parentElement, i = 0; p && i < 40; p = p.parentElement, i++) { if (set.has(p)) { inner = true; break } }
24958
- const coveredByPanel = !!(panel && panel !== el && isDock(el));
24959
- const want = !inner && !coveredByPanel;
24960
- const has = el.hasAttribute("data-mpw-rs-surface");
24961
- if (want && !has) { try { el.setAttribute("data-mpw-rs-surface", ""); changed++ } catch {} }
24962
- else if (!want && has) { try { el.removeAttribute("data-mpw-rs-surface"); changed++ } catch {} }
24905
+ for (const side of sides) {
24906
+ let want = false;
24907
+ for (const dlg of Array.from(side.querySelectorAll(MPW_OVERLAY_SEL))) {
24908
+ try {
24909
+ const cs = getComputedStyle(dlg);
24910
+ if (cs.position !== "fixed" || cs.display === "none" || cs.visibility === "hidden") continue;
24911
+ if (Number(cs.opacity) === 0) continue;
24912
+ const r = dlg.getBoundingClientRect();
24913
+ if (r.width <= 0 || r.height <= 0) continue;
24914
+ want = true; break;
24915
+ } catch (e) { /* 单个读不到就跳过 */ }
24916
+ }
24917
+ const has = side.hasAttribute("data-mpw-side-lift");
24918
+ if (want && !has) { try { side.setAttribute("data-mpw-side-lift", ""); changed++ } catch (e) {} }
24919
+ else if (!want && has) { try { side.removeAttribute("data-mpw-side-lift"); changed++ } catch (e) {} }
24963
24920
  }
24964
24921
  return changed;
24965
24922
  } catch (e) { return 0 }
24966
24923
  }
24967
24924
 
24925
+ function mpwTagPopoverFast(records) {
24926
+ try {
24927
+ let n = 0;
24928
+ for (const rec of (records || [])) {
24929
+ for (const node of (rec.addedNodes || [])) {
24930
+ if (!node || node.nodeType !== 1) continue;
24931
+ const cands = [];
24932
+ try {
24933
+ if (node.matches && node.matches(MPW_POP_TAG_SEL)) cands.push(node);
24934
+ if (node.querySelectorAll) { const subs = node.querySelectorAll(MPW_POP_TAG_SEL); for (let i = 0; i < subs.length && i < 40; i++) cands.push(subs[i]); }
24935
+ } catch (e) {}
24936
+ for (const el of cands) { if (mpwTagOnePopover(el)) n++; }
24937
+ }
24938
+ }
24939
+ try { mpwSideLiftSync(); } catch (e) {}
24940
+ if (n) { try { mpwPopUntruncSync(); } catch (e) {} }
24941
+ return n;
24942
+ } catch (e) { return 0 }
24943
+ }
24944
+ /** 单个元素:该不该有我们的兜底底;返回是否发生了变化。 */
24945
+ function mpwTagOnePopover(el) {
24946
+ let need = false;
24947
+ try {
24948
+ const cls = (typeof el.className === "string") ? el.className : "";
24949
+ if (!MPW_POP_TAG_NOT.test(cls)) {
24950
+ const cs = getComputedStyle(el);
24951
+ if (cs && cs.display !== "none" && cs.visibility !== "hidden"
24952
+ && /blur\(/.test(String(cs.backdropFilter || cs.webkitBackdropFilter || ""))) {
24953
+ const a = mpwColorAlpha(cs.backgroundColor);
24954
+ if (a < 0.05) need = !mpwPopHasPaintedAncestor(el);
24955
+ else if (a >= 0.999) need = mpwPopIsFloating(el);
24956
+ }
24957
+ }
24958
+ } catch (e) { need = false; }
24959
+ try {
24960
+ if (need) { if (!el.hasAttribute("data-mpw-pop-bg")) { el.setAttribute("data-mpw-pop-bg", ""); return true } }
24961
+ else if (el.hasAttribute("data-mpw-pop-bg")) { el.removeAttribute("data-mpw-pop-bg"); return true }
24962
+ } catch (e) {}
24963
+ return false;
24964
+ }
24965
+ function mpwTagPopoverBg() {
24966
+ let list = null;
24967
+ try { list = document.querySelectorAll(MPW_POP_TAG_SEL); } catch (e) { return; }
24968
+ if (!list) return;
24969
+ for (let i = 0; i < list.length; i++) mpwTagOnePopover(list[i]);
24970
+ }
24971
+
24968
24972
  /* ①(P3 修复 2026-10-03) 弹层玻璃的 backdrop root 被截断 ⇒ 有半透明、没模糊。
24969
24973
  读数与机制(docs/POPOVER-BLUR.md):挂在宿主输入框卡片(uV2eYG_card,backdrop-filter:
24970
24974
  blur(14px))子树里的弹层,其 backdrop root 被卡片截断 ⇒ 弹层自己的 blur(11px) 只能采样
@@ -24992,12 +24996,25 @@ body[data-mpw-modal] [role="dialog"] {
24992
24996
  const surfaces = document.querySelectorAll("[data-mpw-pop-bg]");
24993
24997
  const targets = new Set();
24994
24998
  const truncated = new Set();
24999
+ const markedNow = Array.from(document.querySelectorAll("[data-mpw-pop-untrunc]"));
24995
25000
  for (let i = 0; i < surfaces.length; i++) {
24996
25001
  const el = surfaces[i];
24997
25002
  let cs = null;
24998
25003
  try { cs = getComputedStyle(el) } catch (e) {}
24999
25004
  /* 硬前提(与 mpwTagPopoverBg 同口径):我们真的给了模糊才值得摘祖先的截断 */
25000
25005
  if (!cs || !cs.backdropFilter || String(cs.backdropFilter).indexOf("blur") < 0) continue;
25006
+ /* ②(2026-10-05 抖动修复) **已经摘过、且仍在这条祖先链上**的祖先,弹层没关就一直保持:
25007
+ 摘掉之后它自己就没有 blur 了,若每轮都重新"找第一个带 blur 的祖先",下一轮就找不到它
25008
+ ⇒ 属性被当陈旧标记摘掉 ⇒ blur 又回来 ⇒ 摘/还原来回抖(真机现象:同一个菜单时好时坏)。 */
25009
+ let kept = false;
25010
+ for (const mEl of markedNow) {
25011
+ if (mEl === el) continue;
25012
+ let onChain = false;
25013
+ /* 用 parentElement 走链(不用 contains:桩 DOM/老引擎上不一定有) */
25014
+ for (let q = el.parentElement, k = 0; q && k < 40; q = q.parentElement, k++) { if (q === mEl) { onChain = true; break } }
25015
+ if (onChain) { targets.add(mEl); kept = true; break }
25016
+ }
25017
+ if (kept) continue;
25001
25018
  let blockedByGlass = false;
25002
25019
  for (let p = el.parentElement, n = 0; p && p !== document.body && p !== document.documentElement && n < 12; p = p.parentElement, n++) {
25003
25020
  let acs = null;
@@ -25008,13 +25025,21 @@ body[data-mpw-modal] [role="dialog"] {
25008
25025
  它是用户能看到的那层模糊(真机现场:子代理展开框/输入框卡片被我们摘掉 blur 之后
25009
25026
  "模糊背景没有了"——正是之前夸过的那处效果)。判据 = 它有可见底色(α ≥ 0.05)。
25010
25027
  这种情况下改为把**弹层自己的表面做实在**(不能糊到页面背后,就别假装是玻璃)。 */
25011
- if (mpwColorAlpha(acs.backgroundColor) >= 0.05) { blockedByGlass = true; break }
25028
+ /* ②(2026-10-05 真机复核) 判据收紧到"**它自己也是我们管的弹层表面**":
25029
+ 子代理展开框/后台任务面板这类"用户正在看的面板"本身就在我们的弹层表面集合里
25030
+ ⇒ 摘它的 blur = 把用户看得见的那层玻璃删掉(真机回归)。
25031
+ 而输入框卡片 `uV2eYG_card`(有底、有 blur,但**不是**弹层表面)只是"碰巧挡在
25032
+ 弹层前面的包装" ⇒ 摘掉它的 blur 换来弹层真模糊,代价是"菜单打开期间它自己不糊"。
25033
+ 真机读数支持这条:四个弹层里只有 body 下的模型选择器有模糊,另三个全被卡片截断。 */
25034
+ let ancestorIsSurface = false;
25035
+ try { ancestorIsSurface = p.matches(MPW_POP_TAG_SEL) } catch (e) {}
25036
+ if (mpwColorAlpha(acs.backgroundColor) >= 0.05 && ancestorIsSurface) { blockedByGlass = true; break }
25012
25037
  targets.add(p);
25013
25038
  break;
25014
25039
  }
25015
25040
  if (blockedByGlass) truncated.add(el);
25016
25041
  }
25017
- const stale = document.querySelectorAll("[data-mpw-pop-untrunc]");
25042
+ const stale = markedNow;
25018
25043
  for (let i = 0; i < stale.length; i++) { const el = stale[i]; if (!targets.has(el)) { try { el.removeAttribute("data-mpw-pop-untrunc") } catch (e) {} } }
25019
25044
  for (const el of targets) { if (!el.hasAttribute("data-mpw-pop-untrunc")) { try { el.setAttribute("data-mpw-pop-untrunc", "") } catch (e) {} } }
25020
25045
  /* 被"有底的玻璃祖先"挡住的那批:标记在**弹层自己**身上(绝不碰宿主元素),由 CSS 给实底 */
@@ -25069,12 +25094,15 @@ body[data-mpw-modal] [role="dialog"] {
25069
25094
  之后面板出现就变成两层(真机读数:dockPane/dockStrip 仍是 0.55)。
25070
25095
  这里与弹层标记共用同一个 rAF 合并的入口(要素很少,代价可忽略)。 */
25071
25096
  try { mpwTagSurfaceOuter(); } catch (e) {}
25097
+ try { mpwSideLiftSync(); } catch (e) {}
25072
25098
  /* ①(P3) 弹层开着 ⇒ 摘截断祖先的 blur;关了 ⇒ 还原(同一入口,随突变重算) */
25073
25099
  try { mpwPopUntruncSync(); } catch (e) {}
25074
25100
  } catch (e) {}
25075
25101
  };
25076
25102
  try {
25077
- popTagWatch = new MutationObserver(() => {
25103
+ popTagWatch = new MutationObserver((records) => {
25104
+ /* 同步快路:新增的弹层当场判定打标(消灭"先白后变"的过渡态) */
25105
+ try { mpwTagPopoverFast(records); } catch (e) {}
25078
25106
  if (praf) return;
25079
25107
  try { praf = (typeof requestAnimationFrame === "function") ? requestAnimationFrame(prun) : setTimeout(prun, 16); }
25080
25108
  catch (e) { prun(); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-mpkg-wallpaper",
3
- "version": "3.15.7",
3
+ "version": "3.15.8",
4
4
  "description": "DSH Web 壁纸引擎 Wallpaper Engine mpkg 背景插件:浏览器内直接解析 .mpkg(preview.gif 动态背景/内嵌 mp4 视频/多时段切换),整屏统一虚化/对话框/弹层/遮罩独立虚化、镜头缩放平移、时钟、冲突检测。",
5
5
  "private": false,
6
6
  "type": "module",