dsh-life-pack 0.3.60 → 0.3.62

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
@@ -471,7 +471,7 @@ window.__ModuleLoader__.load({
471
471
  path: "/api/ilife-manager"
472
472
  };
473
473
  //#endregion
474
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/config.js
474
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/config.js
475
475
  const DEFAULT_PANEL_POLL_MS = 1e3;
476
476
  function assertPrefix(value, role) {
477
477
  if (typeof value !== "string" || value.length === 0) throw new Error("[dsh-plugin-update] " + role + " 非法:须为非空字符串(收到 " + JSON.stringify(value) + ")");
@@ -492,7 +492,7 @@ window.__ModuleLoader__.load({
492
492
  return buildPhoneNames(prefix).logAppend;
493
493
  }
494
494
  //#endregion
495
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/redaction.js
495
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/redaction.js
496
496
  const COPY_BUDGET_CHARS = 1500;
497
497
  const REDACTED_PATH = "<路径>";
498
498
  const REDACTED_SECRET = "<脱敏>";
@@ -556,7 +556,7 @@ window.__ModuleLoader__.load({
556
556
  return truncateForCopy(scrubWithoutBudget(flat));
557
557
  }
558
558
  //#endregion
559
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/service.js
559
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/service.js
560
560
  function updateError(code) {
561
561
  return Object.assign(new Error(code), { code });
562
562
  }
@@ -643,7 +643,7 @@ window.__ModuleLoader__.load({
643
643
  return 0;
644
644
  }
645
645
  //#endregion
646
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/lang.js
646
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/lang.js
647
647
  function normalizeLangTag(tag) {
648
648
  if (typeof tag !== "string") return "zh";
649
649
  const s = tag.trim().toLowerCase().replace(/_/g, "-");
@@ -785,7 +785,7 @@ window.__ModuleLoader__.load({
785
785
  };
786
786
  }
787
787
  //#endregion
788
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/bilingual.js
788
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/bilingual.js
789
789
  const BILINGUAL_STRINGS = {
790
790
  "entry.label.idle": {
791
791
  en: "Check for updates",
@@ -2432,7 +2432,7 @@ window.__ModuleLoader__.load({
2432
2432
  }
2433
2433
  const BILINGUAL_CSS = [".dsh-upd-bi{display:inline;overflow-wrap:anywhere}", ".dsh-upd-bi [lang]{overflow-wrap:anywhere}"].join("\n");
2434
2434
  //#endregion
2435
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/changelog.js
2435
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/changelog.js
2436
2436
  const CHANGELOG_MAX_CHARS = 65536;
2437
2437
  const CHANGELOG_ALL_CATEGORIES = [
2438
2438
  "Added",
@@ -3540,7 +3540,7 @@ ${note}${blocks.join("\n")}
3540
3540
  }
3541
3541
  }
3542
3542
  //#endregion
3543
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/log-events.js
3543
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/log-events.js
3544
3544
  const LOG_EVENT_CALL = "host.call";
3545
3545
  const LOG_EVENT_CALL_FAIL = "host.call.fail";
3546
3546
  const LOG_EVENT_INSTALL_EXEC = "update.install.exec";
@@ -3791,7 +3791,7 @@ ${note}${blocks.join("\n")}
3791
3791
  };
3792
3792
  }
3793
3793
  //#endregion
3794
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/codes.js
3794
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/codes.js
3795
3795
  const BLOCKED_REASONS = [
3796
3796
  "unknown-profile",
3797
3797
  "channel-mismatch",
@@ -3825,7 +3825,7 @@ ${note}${blocks.join("\n")}
3825
3825
  return typeof code === "string" && isOneOf(CHECK_SIDE_FAILURE_CODES, code.trim());
3826
3826
  }
3827
3827
  //#endregion
3828
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel.js
3828
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/panel.js
3829
3829
  function normalizePanelTheme(value) {
3830
3830
  return value === "archive" ? "archive" : "default";
3831
3831
  }
@@ -5060,7 +5060,7 @@ ${UPDATE_PANEL_ARCHIVE_CSS}` : UPDATE_PANEL_CSS}</style>
5060
5060
  ${body}`;
5061
5061
  }
5062
5062
  //#endregion
5063
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry.js
5063
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/entry.js
5064
5064
  const UPDATE_ENTRY_CSS = [
5065
5065
  ".dsh-upd-entry{display:inline-flex;align-items:center;gap:8px;font:13px/1.6 var(--dsh-update-font-sans,system-ui,\"Microsoft YaHei\",sans-serif);font-size:var(--dsh-update-entry-font-size,13px);color:var(--dsh-update-text,#1f2937)}",
5066
5066
  ".dsh-upd-entry-btn{font:inherit;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:var(--dsh-update-entry-border-radius,6px);",
@@ -5174,7 +5174,7 @@ ${body}`;
5174
5174
  }
5175
5175
  }
5176
5176
  //#endregion
5177
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel-batch.js
5177
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/panel-batch.js
5178
5178
  const BATCH_PANEL_POLL = {
5179
5179
  defaultMs: 1500,
5180
5180
  minMs: 250
@@ -5357,7 +5357,7 @@ ${body}`;
5357
5357
  latest: sessionTarget,
5358
5358
  hasUpdate: true
5359
5359
  };
5360
- if (current2 === sessionTarget) return {
5360
+ if (current2 === sessionTarget || !isUpgradeOf(sessionTarget, current2)) return {
5361
5361
  current: current2,
5362
5362
  latest: null,
5363
5363
  hasUpdate: false
@@ -5372,7 +5372,7 @@ ${body}`;
5372
5372
  const knowledgeCurrent = knowledge && knowledge.installed !== false && typeof knowledge.installedVersion === "string" && knowledge.installedVersion ? knowledge.installedVersion : null;
5373
5373
  const current = snapshotCurrent ?? knowledgeCurrent;
5374
5374
  const latest = knowledge && typeof knowledge.latestVersion === "string" && knowledge.latestVersion ? knowledge.latestVersion : null;
5375
- if (current && latest && latest !== current) return {
5375
+ if (current && latest && latest !== current && isUpgradeOf(latest, current)) return {
5376
5376
  current,
5377
5377
  latest,
5378
5378
  hasUpdate: true
@@ -5393,6 +5393,13 @@ ${body}`;
5393
5393
  hasUpdate: false
5394
5394
  };
5395
5395
  }
5396
+ function isUpgradeOf(target, current) {
5397
+ try {
5398
+ return compareReleaseVersions(target, current) === 1;
5399
+ } catch {
5400
+ return true;
5401
+ }
5402
+ }
5396
5403
  function batchRowVersionHTML(row, knowledge, lang) {
5397
5404
  const parts = batchRowVersionParts(row, knowledge);
5398
5405
  if (parts.hasUpdate && parts.latest) {
@@ -6693,7 +6700,7 @@ ${body}`;
6693
6700
  };
6694
6701
  }
6695
6702
  //#endregion
6696
- //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry-batch.js
6703
+ //#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.2/node_modules/dsh-plugin-update/dist/entry-batch.js
6697
6704
  function isObject$1(value) {
6698
6705
  return !!value && typeof value === "object" && !Array.isArray(value);
6699
6706
  }
@@ -10488,32 +10495,38 @@ ${body}`;
10488
10495
  *
10489
10496
  * 上游首查回包里的 `manual`(精确手工命令)读出来交 `onManual`:带精确版本号与 registry,
10490
10497
  * 调用方拿它画自己的命令行+复制按钮(单一定位,不复述上游 details 里的同一条)。
10491
- * 只读、不重查:读两次(800/2600ms,覆盖默认 1000ms 轮询的首查落定),读不到就只剩双包命令。 */
10498
+ * 只读、不重查:每秒读一次、读到为止、最多 10 次(0.3.60 现场:固定两次读不到,首查落定比预期晚)。 */
10492
10499
  function TabInstallSlot(props) {
10493
10500
  const slotRef = react.useRef(null);
10494
10501
  const callReady = props.getCall() !== null;
10495
10502
  const onManualRef = react.useRef(props.onManual);
10496
- onManualRef.current = props.onManual;
10503
+ react.useEffect(() => {
10504
+ onManualRef.current = props.onManual;
10505
+ }, [props.onManual]);
10497
10506
  react.useEffect(() => {
10498
10507
  const mount = slotRef.current;
10499
10508
  if (mount === null || !callReady) return;
10500
10509
  const button = mountLifeInstallButton(mount, managerCallAdapter(props.getCall()), props.tab);
10501
10510
  if (button === null) return;
10502
10511
  let alive = true;
10503
- const timers = [];
10504
- for (const ms of [800, 2600]) {
10505
- if (typeof setTimeout !== "function") break;
10506
- timers.push(setTimeout(() => {
10507
- if (!alive) return;
10508
- try {
10509
- const manual = button.state().manual;
10510
- if (typeof manual === "string" && manual.length > 0) onManualRef.current?.(manual);
10511
- } catch {}
10512
- }, ms));
10513
- }
10512
+ let attempts = 0;
10513
+ const readOnce = () => {
10514
+ if (!alive) return;
10515
+ attempts += 1;
10516
+ try {
10517
+ const manual = button.state().manual;
10518
+ if (typeof manual === "string" && manual.length > 0) {
10519
+ onManualRef.current?.(manual);
10520
+ return;
10521
+ }
10522
+ } catch {}
10523
+ if (attempts < 10 && typeof setTimeout === "function") timer = setTimeout(readOnce, 1e3);
10524
+ };
10525
+ let timer = null;
10526
+ if (typeof setTimeout === "function") timer = setTimeout(readOnce, 800);
10514
10527
  return () => {
10515
10528
  alive = false;
10516
- for (const t of timers) clearTimeout(t);
10529
+ if (timer !== null) clearTimeout(timer);
10517
10530
  button.unmount();
10518
10531
  };
10519
10532
  }, [callReady, props.tab]);
@@ -10528,10 +10541,13 @@ ${body}`;
10528
10541
  * 全收敛在 `[data-ilife-absent]` 作用域下;容器 `S.reco` 与子顺序一字不动。
10529
10542
  * 上游主按钮换色用容器覆盖(`button[data-primary="1"]` 特异度压上游缺省;上游自带 CSS 无 hover
10530
10543
  * 规则,见 update-dialog.ts 注释——themeTokens 对安装控件无视觉效果,故悬停也收在这里)。
10531
- * 悬停取深橙+白字+投影(用户 verdict:8% 提亮看不见);颜色原型定稿 hex,见 v4 原型。 */
10544
+ * 悬停取深橙+白字+投影(用户 verdict:8% 提亮看不见);颜色原型定稿 hex,见 v4 原型。
10545
+ * 常态橙底(0.3.61 补上:首版只写了 hover 没写常态,线上按钮常态掉回宿主灰——原型 L33 整条)。
10546
+ * 上游自带折叠手工行(0.3.60 现场:②里贴着按钮又冒出一条“手工命令”):默认不动,
10547
+ * 只有当③的精确命令取到了(`data-manual="ready"`)才藏它——取不到时它仍是兜底。 */
10532
10548
  const ABSENT_TOAST_MS = 1500;
10533
10549
  function absentStepsCss() {
10534
- return "[data-ilife-absent=\"panel\"]>.ilife-step{display:block;position:relative;padding:10px 4px 10px 40px;border-bottom:1px solid rgba(255,255,255,.07)}[data-ilife-absent=\"panel\"]>.ilife-step:last-child{border-bottom:0}[data-ilife-absent=\"panel\"]>.ilife-step::before{content:attr(data-step);position:absolute;left:4px;top:10px;width:24px;height:24px;border-radius:50%;background:#2b2b2b;color:#9a9a9a;font-size:12px;display:flex;align-items:center;justify-content:center;font-weight:700}[data-ilife-absent=\"panel\"]>.ilife-step[data-step=\"1\"]::before{background:#e5534b;color:#fff}[data-ilife-absent=\"panel\"]>.ilife-step[data-step=\"2\"]::before{background:#f2a65a;color:#1a1206}[data-ilife-absent=\"panel\"] .ilife-step-t{display:block;color:#fff;font-weight:700;font-size:14px;margin-bottom:2px}[data-ilife-absent=\"panel\"] .ilife-tray{background:rgba(242,166,90,.08);border-radius:8px;padding:10px 12px}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]{transition:background .15s,color .15s,transform .06s,box-shadow .15s}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:hover{background:#cf6f1f;color:#fff;transform:translateY(-1px);box-shadow:0 4px 14px rgba(207,111,31,.45)}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:active{transform:translateY(1px);box-shadow:none;background:#a8561a;color:#fff}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:disabled{opacity:.55;cursor:default;transform:none;box-shadow:none}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:focus-visible{outline:2px solid #f2a65a;outline-offset:2px}[data-ilife-absent=\"panel\"] .ilife-cmdrow{display:flex;gap:8px;align-items:stretch;margin-top:8px}[data-ilife-absent=\"panel\"] .ilife-cmdrow>code{flex:1;padding:8px 10px;border-radius:8px;background:rgba(128,128,128,.12);color:#57b883;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;user-select:all;white-space:pre-wrap;overflow-wrap:anywhere}[data-ilife-absent=\"panel\"] .ilife-cmdrow>code.plain{color:inherit}[data-ilife-absent=\"panel\"] .ilife-copycmd{flex:0 0 auto;align-self:center;background:#2b2b2b;color:inherit;border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:6px 14px;font-size:12.5px;cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .06s,box-shadow .15s}[data-ilife-absent=\"panel\"] .ilife-copycmd:hover{border-color:#f2a65a;color:#f2a65a;background:#353535;transform:translateY(-1px);box-shadow:0 2px 8px rgba(242,166,90,.25)}[data-ilife-absent=\"panel\"] .ilife-copycmd:active{transform:translateY(1px);box-shadow:none;background:#242424}[data-ilife-absent=\"panel\"] .ilife-copycmd:focus-visible{outline:2px solid #f2a65a;outline-offset:2px}[data-ilife-absent=\"toast\"]{position:fixed;left:50%;bottom:48px;transform:translateX(-50%) translateY(" + String(8) + "px);background:#1f1f1f;color:#fff;border:1px solid rgba(87,184,131,.6);border-radius:999px;padding:6px 18px;font-size:13px;z-index:99;animation:absentToastIn " + String(180 / 1e3) + "s ease}@keyframes absentToastIn{from{opacity:0;transform:translateX(-50%) translateY(" + String(8) + "px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}";
10550
+ return "[data-ilife-absent=\"panel\"]>.ilife-step{display:block;position:relative;padding:10px 4px 10px 40px;border-bottom:1px solid rgba(255,255,255,.07)}[data-ilife-absent=\"panel\"]>.ilife-step:last-child{border-bottom:0}[data-ilife-absent=\"panel\"]>.ilife-step::before{content:attr(data-step);position:absolute;left:4px;top:10px;width:24px;height:24px;border-radius:50%;background:#2b2b2b;color:#9a9a9a;font-size:12px;display:flex;align-items:center;justify-content:center;font-weight:700}[data-ilife-absent=\"panel\"]>.ilife-step[data-step=\"1\"]::before{background:#e5534b;color:#fff}[data-ilife-absent=\"panel\"]>.ilife-step[data-step=\"2\"]::before{background:#f2a65a;color:#1a1206}[data-ilife-absent=\"panel\"] .ilife-step-t{display:block;color:#fff;font-weight:700;font-size:14px;margin-bottom:2px}[data-ilife-absent=\"panel\"] .ilife-tray{background:rgba(242,166,90,.14);border-radius:8px;padding:10px 12px}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]{background:#f2a65a;color:#1a1206;border:0;border-radius:8px;padding:9px 24px;font-size:14px;font-weight:700;cursor:pointer;transition:background .15s,color .15s,transform .06s,box-shadow .15s}[data-ilife-absent=\"panel\"][data-manual=\"ready\"] .dsh-upd-ib-manual{display:none}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:hover{background:#cf6f1f;color:#fff;transform:translateY(-1px);box-shadow:0 4px 14px rgba(207,111,31,.45)}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:active{transform:translateY(1px);box-shadow:none;background:#a8561a;color:#fff}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:disabled{opacity:.55;cursor:default;transform:none;box-shadow:none}[data-ilife-absent=\"panel\"] .dsh-upd-ib button[data-primary=\"1\"]:focus-visible{outline:2px solid #f2a65a;outline-offset:2px}[data-ilife-absent=\"panel\"] .ilife-cmdrow{display:flex;gap:8px;align-items:stretch;margin-top:8px}[data-ilife-absent=\"panel\"] .ilife-cmdrow>code{flex:1;padding:8px 10px;border-radius:8px;background:rgba(128,128,128,.12);color:#57b883;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;user-select:all;white-space:pre-wrap;overflow-wrap:anywhere}[data-ilife-absent=\"panel\"] .ilife-cmdrow>code.plain{color:#e8e8e8}[data-ilife-absent=\"panel\"] .ilife-copycmd{flex:0 0 auto;align-self:center;background:#2b2b2b;color:#e8e8e8;border:1px solid rgba(255,255,255,.12);border-radius:8px;padding:6px 14px;font-size:12.5px;cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .06s,box-shadow .15s}[data-ilife-absent=\"panel\"] .ilife-copycmd:hover{border-color:#f2a65a;color:#f2a65a;background:#353535;transform:translateY(-1px);box-shadow:0 2px 8px rgba(242,166,90,.25)}[data-ilife-absent=\"panel\"] .ilife-copycmd:active{transform:translateY(1px);box-shadow:none;background:#242424}[data-ilife-absent=\"panel\"] .ilife-copycmd:focus-visible{outline:2px solid #f2a65a;outline-offset:2px}[data-ilife-absent=\"toast\"]{position:fixed;left:50%;bottom:48px;transform:translateX(-50%) translateY(" + String(8) + "px);background:#1f1f1f;color:#fff;border:1px solid rgba(87,184,131,.6);border-radius:999px;padding:6px 18px;font-size:13px;z-index:99;animation:absentToastIn " + String(180 / 1e3) + "s ease}@keyframes absentToastIn{from{opacity:0;transform:translateX(-50%) translateY(" + String(8) + "px)}to{opacity:1;transform:translateX(-50%) translateY(0)}}";
10535
10551
  }
10536
10552
  /** 命令行文本进剪贴板:先走 Clipboard API,摸不到(老宿主/非安全上下文)就地降级为隐藏 textarea。
10537
10553
  * 文案保持「复制」二字不动(用户口径):成功只弹 Toast,不改按钮字。 */
@@ -10603,7 +10619,8 @@ ${body}`;
10603
10619
  });
10604
10620
  return react.createElement("div", {
10605
10621
  style: S.reco,
10606
- "data-ilife-absent": "panel"
10622
+ "data-ilife-absent": "panel",
10623
+ "data-manual": manual !== null ? "ready" : "pending"
10607
10624
  }, react.createElement("style", { "data-ilife-absent": "steps-css" }, absentStepsCss()), react.createElement("span", {
10608
10625
  className: "ilife-step",
10609
10626
  "data-step": "1"
@@ -10642,7 +10659,7 @@ ${body}`;
10642
10659
  }, 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)))));
10643
10660
  }
10644
10661
  /** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
10645
- const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.60";
10662
+ const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.62";
10646
10663
  /** 右下角那本书离面板两沿的距离:用户口径「一直处于面板右下角、不随列表滑动消失」
10647
10664
  * ⇒ sticky 吸附(面板相对,视口多大都落在面板角上);INSET=右沿,BOTTOM=底沿。 */
10648
10665
  const MANUAL_ENTRY_INSET = 16;