dsh-life-pack 0.3.83 → 0.3.84

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/dist/client.js CHANGED
@@ -11799,7 +11799,7 @@ ${body}`;
11799
11799
  * 书上(用户:「多个按钮的层级超过了这个书籍的层级」),开书时必须压住它。
11800
11800
  */
11801
11801
  function manualEntryCss() {
11802
- return ".bkbtn{position:relative;display:flex;flex-direction:column;align-items:center;background:none;border:none;border-radius:14px;cursor:pointer;padding:2px 6px 0}.eaaura{position:absolute;inset:-5px -6px;border-radius:9px;background:radial-gradient(circle at 50% 42%,#f8e7ae40,transparent 68%);border:1px solid #f5d97acc;box-shadow:0 0 5px #ffe9a8,0 0 13px #e8c96acc,0 0 28px #d9ab3c77;pointer-events:none}.stage{position:relative;width:57px;height:78px;filter:drop-shadow(0 7px 9px #00000088)}.eabook{display:block;position:relative;width:55px;height:74px;border-radius:4px 7px 7px 4px;background:linear-gradient(135deg,#9c2f2f,#5f1616 65%,#3a0d0d);border:1px solid #d9ab3c;position:relative;box-shadow:4px 5px 10px #0009}.eabook:before{content:'';position:absolute;left:0;top:0;bottom:0;width:9px;background:linear-gradient(90deg,#320b0b,#571414);border-radius:4px 0 0 4px}.eabook .eaband{position:absolute;left:-4px;right:-4px;top:29px;height:18px;background:linear-gradient(180deg,#7a2323,#4a1212);border:1px solid #f5d97a;display:flex;align-items:center;justify-content:center;color:#f8e7ae;font-size:10px;letter-spacing:.06em;text-shadow:0 0 6px #ffd97a,0 0 12px #d9ab3c,0 1px 0 #2a0d0d;box-shadow:0 0 8px #d9ab3c88,0 2px 4px #00000066}.manual-layer{position:fixed;inset:0;box-sizing:border-box;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;z-index:2147483000;display:flex;align-items:center;justify-content:center}.manual-layer::backdrop{background:transparent}.manual-popover{position:relative;box-sizing:border-box;width:min(1000px,calc(100vw - 48px));overflow:visible;color:#e8dcc2;font-family:system-ui,\"Microsoft YaHei\",sans-serif;--paper-w:min(760px,calc(100vw - 200px))}";
11802
+ return ".bkbtn{position:relative;display:flex;flex-direction:column;align-items:center;background:none;border:none;border-radius:14px;cursor:pointer;padding:2px 6px 0}.eaaura{position:absolute;inset:-5px -6px;border-radius:9px;background:radial-gradient(circle at 50% 42%,#f8e7ae40,transparent 68%);border:1px solid #f5d97acc;box-shadow:0 0 5px #ffe9a8,0 0 13px #e8c96acc,0 0 28px #d9ab3c77;pointer-events:none}.stage{position:relative;width:57px;height:78px}.eabook{display:block;position:relative;width:55px;height:74px;border-radius:4px 7px 7px 4px;background:linear-gradient(135deg,#9c2f2f,#5f1616 65%,#3a0d0d);border:1px solid #d9ab3c;position:relative}.eabook:before{content:'';position:absolute;left:0;top:0;bottom:0;width:9px;background:linear-gradient(90deg,#320b0b,#571414);border-radius:4px 0 0 4px}.eabook .eaband{position:absolute;left:-4px;right:-4px;top:29px;height:18px;background:linear-gradient(180deg,#7a2323,#4a1212);border:1px solid #f5d97a;display:flex;align-items:center;justify-content:center;color:#f8e7ae;font-size:10px;letter-spacing:.06em;text-shadow:0 0 6px #ffd97a,0 0 12px #d9ab3c,0 1px 0 #2a0d0d;box-shadow:0 0 8px #d9ab3c88,0 2px 4px #00000066}.manual-layer{position:fixed;inset:0;box-sizing:border-box;width:auto;height:auto;max-width:none;max-height:none;margin:0;padding:0;border:0;background:transparent;color:inherit;z-index:2147483000;display:flex;align-items:center;justify-content:center}.manual-layer::backdrop{background:transparent}.manual-popover{position:relative;box-sizing:border-box;width:min(1000px,calc(100vw - 48px));overflow:visible;color:#e8dcc2;font-family:system-ui,\"Microsoft YaHei\",sans-serif;--paper-w:min(760px,calc(100vw - 200px))}";
11803
11803
  }
11804
11804
  /** 入口图标(红封+书脊+金匾腰封+鎏金背光):原型 ENTRY_HTML 的书那一段,onclick 接出点开。
11805
11805
  *
@@ -11907,13 +11907,14 @@ ${body}`;
11907
11907
  function phoneOf(channel) {
11908
11908
  return channel.startsWith("/") ? channel.slice(1) : channel;
11909
11909
  }
11910
- /** 整批取数的时限(毫秒),**不是**一家一份:六家的活是在**同一个宿主线程**上排队干的。
11910
+ /** 一家一份的时限(毫秒):每家的电话各自带这个上限(`AbortSignal.timeout`),互不牵连。
11911
11911
  *
11912
- * 为什么不是「技能侧 spawn 上限 20 s + 一点余量」(票 #740 对抗式审查第二轮逮到):
11913
- * 各家的宿主半用的是 `spawnSync`(各单品的 `src/bridge.ts` 里 `SPAWN_TIMEOUT_MS = 20_000`),
11914
- * 它**阻塞**宿主的事件循环——六通电话同时打进来,真正干活的是一个接一个串起来的。
11915
- * 于是「六家之和」才是这一批的真实上界:按一家 20 s 算最坏 120 s,常见情形(一家 1~3 s)约 10 s。
11916
- * 60 s 取两者之间:给常见情形留足余量,又不至于让一次卡死把按钮按成两分钟不动。
11912
+ * 口径(票 #740 定下,#1294 之后重读依据):一家在技能侧最坏要等一次 spawn 超时
11913
+ * (各单品 `src/bridge.ts` 的 `SPAWN_TIMEOUT_MS = 20_000`),再留两次排队余量,
11914
+ * 取 3×20 s = 60 s。`test/plugin-p10-boundaries.test.mjs` 把这条关系写成门槛
11915
+ * (`HEALTH_TIMEOUT_MS >= 3 * SPAWN_TIMEOUT_MS`),任何一边改小都会先红。
11916
+ * #1294 起六家宿主半改成异步 spawn(不再阻塞宿主事件循环),六通电话真能并行;
11917
+ * 单家卡死只坏它自己那一格,不会再把整屏拖住。
11917
11918
  * 单家的错照样逐家报(那家页签里的体检表会写「体检超时(60s)…」)。 */
11918
11919
  const HEALTH_TIMEOUT_MS = 6e4;
11919
11920
  function timeoutText() {
@@ -11959,8 +11960,8 @@ ${body}`;
11959
11960
  /** 取六家的体检报告(缺席的包不在此列,由调用方按账本判断)。
11960
11961
  *
11961
11962
  * `onRow`(票 #741):某一家一落定就回调一次——面板据此**按家增量**画,不再等齐全部。
11962
- * 六家的电话是并发打出去的,但宿主里干活的只有一个线程(各单品宿主半 `spawnSync`),
11963
- * 所以真实到达顺序就是它们被串行干完的顺序;先回来的那家先画出来,用户才看得见进度。 */
11963
+ * 六家的电话并发打出去,各家的 spawn 也是异步的(#1294),真实到达顺序由各自取数快慢决定;
11964
+ * 先回来的那家先画出来,用户才看得见进度。 */
11964
11965
  async function loadHealthReports(call, tabs, onRow) {
11965
11966
  if (typeof call !== "function") return {
11966
11967
  rows: [],
@@ -13393,7 +13394,8 @@ ${body}`;
13393
13394
  *
13394
13395
  * ①状态标题(包名+未安装,不复述命令);②一键安装(上游槽,版本与按钮归上游画);
13395
13396
  * ③备选手动安装(上游首查落定的精确命令+双包命令,各配复制按钮,默认即展开态)。
13396
- * Toast 常驻条件挂载(`notice` 同形,进场即跑 `absentToastIn`),1.5s 自散。 */
13397
+ * Toast 常驻条件挂载(`notice` 同形,进场即跑 `absentToastIn`),1.5s 自散。
13398
+ * **一次性** UI 回执(p10 定时器门的例外依据):只有清理与一次复位,没有次数可言。 */
13397
13399
  function AbsentTabPanel(props) {
13398
13400
  const [manual, setManual] = react.useState(null);
13399
13401
  const [toastOn, setToast] = react.useState(false);
@@ -13462,7 +13464,7 @@ ${body}`;
13462
13464
  }, react.createElement("span", { style: S.morePkg }, row.pkg), react.createElement("span", { style: S.moreDesc }, row.desc), react.createElement("span", { style: S.moreIcon }, react.createElement(ExternalIcon, null)))));
13463
13465
  }
13464
13466
  /** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
13465
- const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.83";
13467
+ const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.84";
13466
13468
  /** 右下角那本书离面板两沿的距离:用户口径「一直处于面板右下角、不随列表滑动消失」
13467
13469
  * ⇒ sticky 吸附(面板相对,视口多大都落在面板角上);INSET=右沿,BOTTOM=底沿。 */
13468
13470
  const MANUAL_ENTRY_INSET = 16;
@@ -13549,27 +13551,13 @@ ${body}`;
13549
13551
  return /* @__PURE__ */ new Set([...previous, active]);
13550
13552
  });
13551
13553
  }, [active]);
13552
- /** 预热:section 一挂载,就把其余几家**错峰**挂上(隐藏面板照常挂载、只切 `hidden`),
13553
- * 让各家那一次配置读提前跑掉——用户点哪个页签,多半值已经在了。
13554
- * 错峰(每 150ms 一家)是为了不让六家子进程同时抢开工:首帧那一口气优先留给框架。
13555
- * 只在页签账本非空时起一次(`rows` 要等各家 slot 注入后才齐)。
13554
+ /** 懒挂载(#1294):首开只挂当前页签,其余几家等用户点过去再挂(第一次挂载才发那一次配置读)。
13556
13555
  *
13557
- * **一次性**(p10 定时器门的例外依据):每个页签只挂一次(`warmed` 闸门 + 一批固定数量的定时器),
13558
- * 不是轮询、也不是重试——它没有「次数」可言;卸载即 `clearTimeout` 清干净。
13559
- * 不做轮询是本意:这里只补一次提前量,取数与刷新仍旧由各家用例自己的通道走。 */
13560
- const warmed = react.useRef(false);
13561
- const tabCount = rows.length;
13562
- react.useEffect(() => {
13563
- if (warmed.current || tabCount === 0) return;
13564
- warmed.current = true;
13565
- const STAGGER_MS = 150;
13566
- const timers = MANAGER_TABS.filter((tab) => rows.some((row) => row.id === tab.plugin)).map((tab, index) => setTimeout(() => {
13567
- setVisitedIds((previous) => previous.has(tab.plugin) ? previous : /* @__PURE__ */ new Set([...previous, tab.plugin]));
13568
- }, STAGGER_MS * (index + 1)));
13569
- return () => {
13570
- for (const timer of timers) clearTimeout(timer);
13571
- };
13572
- }, [tabCount]);
13556
+ * 旧版这里有一段「预热」:section 一挂载就错峰把六家全挂上(只切样式、不切挂载),
13557
+ * 想让用户点页签时值已经在了。实测代价远大于收益——每次挂载都会触发一次技能 CLI 取数,
13558
+ * 六家一起排队把宿主线程占满(旧实现还是同步 spawn),先画出来的反而是空骨架;
13559
+ * 而用户通常只看其中一两家。改成懒挂载后,首开那次取数只有当前页签一家。
13560
+ * 已访问过的页签保持挂载(visitedIds),切回来不重取、页内状态也不丢。 */
13573
13561
  function labelFor(tab) {
13574
13562
  const row = rows.find((r) => r.id === tab.plugin);
13575
13563
  return row && row.label.length > 0 ? row.label : tab.title;