dsh-life-pack 0.3.58 → 0.3.60
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 +255 -99
- package/dist/client.js.map +1 -1
- package/dist/update-dialog.d.ts +6 -1
- package/dist/update-dialog.d.ts.map +1 -1
- package/dist/update-dialog.js +6 -1
- package/dist/update-dialog.js.map +1 -1
- package/package.json +2 -2
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.
|
|
474
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
495
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
559
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
646
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
788
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
2435
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
3543
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
3794
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/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.
|
|
3828
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel.js
|
|
3829
3829
|
function normalizePanelTheme(value) {
|
|
3830
3830
|
return value === "archive" ? "archive" : "default";
|
|
3831
3831
|
}
|
|
@@ -4048,6 +4048,29 @@ ${note}${blocks.join("\n")}
|
|
|
4048
4048
|
if (typeof fallback === "string" && fallback.trim()) return fallback.trim();
|
|
4049
4049
|
return INTERNAL_CODE;
|
|
4050
4050
|
}
|
|
4051
|
+
function replyIsCheckExpired(reply) {
|
|
4052
|
+
if (!reply || typeof reply !== "object") return false;
|
|
4053
|
+
const kind = reply["errorKind"];
|
|
4054
|
+
if (typeof kind === "string" && kind.trim() === "check-expired") return true;
|
|
4055
|
+
const err = reply["error"];
|
|
4056
|
+
return typeof err === "string" && err.trim() === "check-expired";
|
|
4057
|
+
}
|
|
4058
|
+
function thrownIsCheckExpired(err) {
|
|
4059
|
+
if (typeof err === "string") return err.trim() === "check-expired";
|
|
4060
|
+
if (err instanceof Error) {
|
|
4061
|
+
if (err.message.trim() === "check-expired") return true;
|
|
4062
|
+
const code = err.code;
|
|
4063
|
+
return typeof code === "string" && code.trim() === "check-expired";
|
|
4064
|
+
}
|
|
4065
|
+
if (err && typeof err === "object" && !Array.isArray(err)) {
|
|
4066
|
+
const rec = err;
|
|
4067
|
+
const e = typeof rec["error"] === "string" ? rec["error"].trim() : "";
|
|
4068
|
+
const k = typeof rec["errorKind"] === "string" ? rec["errorKind"].trim() : "";
|
|
4069
|
+
const c = typeof rec["code"] === "string" ? rec["code"].trim() : "";
|
|
4070
|
+
return e === "check-expired" || k === "check-expired" || c === "check-expired";
|
|
4071
|
+
}
|
|
4072
|
+
return false;
|
|
4073
|
+
}
|
|
4051
4074
|
function redactForCopy(text) {
|
|
4052
4075
|
return sanitizeForCopy(text);
|
|
4053
4076
|
}
|
|
@@ -5037,7 +5060,7 @@ ${UPDATE_PANEL_ARCHIVE_CSS}` : UPDATE_PANEL_CSS}</style>
|
|
|
5037
5060
|
${body}`;
|
|
5038
5061
|
}
|
|
5039
5062
|
//#endregion
|
|
5040
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
5063
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry.js
|
|
5041
5064
|
const UPDATE_ENTRY_CSS = [
|
|
5042
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)}",
|
|
5043
5066
|
".dsh-upd-entry-btn{font:inherit;border:1px solid var(--dsh-update-border,#d1d5db);border-radius:var(--dsh-update-entry-border-radius,6px);",
|
|
@@ -5151,7 +5174,7 @@ ${body}`;
|
|
|
5151
5174
|
}
|
|
5152
5175
|
}
|
|
5153
5176
|
//#endregion
|
|
5154
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
5177
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/panel-batch.js
|
|
5155
5178
|
const BATCH_PANEL_POLL = {
|
|
5156
5179
|
defaultMs: 1500,
|
|
5157
5180
|
minMs: 250
|
|
@@ -6670,7 +6693,7 @@ ${body}`;
|
|
|
6670
6693
|
};
|
|
6671
6694
|
}
|
|
6672
6695
|
//#endregion
|
|
6673
|
-
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.
|
|
6696
|
+
//#region ../../node_modules/.pnpm/dsh-plugin-update@0.18.1/node_modules/dsh-plugin-update/dist/entry-batch.js
|
|
6674
6697
|
function isObject$1(value) {
|
|
6675
6698
|
return !!value && typeof value === "object" && !Array.isArray(value);
|
|
6676
6699
|
}
|
|
@@ -7585,93 +7608,93 @@ ${body}`;
|
|
|
7585
7608
|
}
|
|
7586
7609
|
}
|
|
7587
7610
|
async function doInstall() {
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7611
|
+
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
7612
|
+
if (!receipt) {
|
|
7613
|
+
const prevLatch = latch;
|
|
7614
|
+
try {
|
|
7615
|
+
const checked = await call(phoneNames.updateCheck, queueArgs());
|
|
7616
|
+
if (!mounted) return;
|
|
7617
|
+
applyStatusReply(checked, "check");
|
|
7618
|
+
} catch (err) {
|
|
7619
|
+
if (!mounted) return;
|
|
7620
|
+
if (thrownBusy(err)) {
|
|
7621
|
+
await refresh();
|
|
7622
|
+
return;
|
|
7623
|
+
}
|
|
7624
|
+
const env = currentEnvPair();
|
|
7625
|
+
setLatch({
|
|
7626
|
+
code: "check-failed",
|
|
7627
|
+
kind: null,
|
|
7628
|
+
detail: thrownDetail(err),
|
|
7629
|
+
diag: null,
|
|
7630
|
+
requestId: null,
|
|
7631
|
+
checkId: null,
|
|
7632
|
+
runningVersion: snapshot?.runningVersion ?? null,
|
|
7633
|
+
installedVersion: snapshot?.installedVersion ?? null,
|
|
7634
|
+
latestVersion: snapshot?.latestVersion ?? null,
|
|
7635
|
+
targetVersion: null,
|
|
7636
|
+
hostKind: env.hostKind,
|
|
7637
|
+
profileName: env.profileName,
|
|
7638
|
+
source: "check",
|
|
7639
|
+
volatile: false,
|
|
7640
|
+
atMs: latchNow()
|
|
7641
|
+
});
|
|
7642
|
+
return;
|
|
7643
|
+
}
|
|
7644
|
+
if (!mounted) return;
|
|
7645
|
+
if (!receipt) {
|
|
7646
|
+
if (latch === prevLatch) clearLatch();
|
|
7647
|
+
return;
|
|
7648
|
+
}
|
|
7649
|
+
}
|
|
7593
7650
|
if (!mounted) return;
|
|
7594
|
-
|
|
7595
|
-
|
|
7651
|
+
requestId = randomRequestId();
|
|
7652
|
+
pollCount = 0;
|
|
7653
|
+
pollCapped = false;
|
|
7654
|
+
let reply;
|
|
7655
|
+
try {
|
|
7656
|
+
reply = await call(phoneNames.updateInstall, {
|
|
7657
|
+
checkId: receipt.checkId,
|
|
7658
|
+
requestId,
|
|
7659
|
+
...queueArgs()
|
|
7660
|
+
});
|
|
7661
|
+
} catch (err) {
|
|
7662
|
+
if (!mounted) return;
|
|
7663
|
+
if (thrownBusy(err)) {
|
|
7664
|
+
await refresh();
|
|
7665
|
+
return;
|
|
7666
|
+
}
|
|
7667
|
+
if (thrownIsCheckExpired(err) && attempt === 0) {
|
|
7668
|
+
receipt = null;
|
|
7669
|
+
continue;
|
|
7670
|
+
}
|
|
7671
|
+
const env = currentEnvPair();
|
|
7672
|
+
setLatch({
|
|
7673
|
+
code: "install-failed",
|
|
7674
|
+
kind: null,
|
|
7675
|
+
detail: thrownDetail(err),
|
|
7676
|
+
diag: null,
|
|
7677
|
+
requestId,
|
|
7678
|
+
checkId: receipt?.checkId ?? null,
|
|
7679
|
+
runningVersion: snapshot?.runningVersion ?? null,
|
|
7680
|
+
installedVersion: snapshot?.installedVersion ?? null,
|
|
7681
|
+
latestVersion: snapshot?.latestVersion ?? null,
|
|
7682
|
+
targetVersion: null,
|
|
7683
|
+
hostKind: env.hostKind,
|
|
7684
|
+
profileName: env.profileName,
|
|
7685
|
+
source: "install",
|
|
7686
|
+
volatile: false,
|
|
7687
|
+
atMs: latchNow()
|
|
7688
|
+
});
|
|
7596
7689
|
return;
|
|
7597
7690
|
}
|
|
7598
|
-
const env = currentEnvPair();
|
|
7599
|
-
setLatch({
|
|
7600
|
-
code: "check-failed",
|
|
7601
|
-
kind: null,
|
|
7602
|
-
detail: thrownDetail(err),
|
|
7603
|
-
diag: null,
|
|
7604
|
-
requestId: null,
|
|
7605
|
-
checkId: null,
|
|
7606
|
-
runningVersion: snapshot?.runningVersion ?? null,
|
|
7607
|
-
installedVersion: snapshot?.installedVersion ?? null,
|
|
7608
|
-
latestVersion: snapshot?.latestVersion ?? null,
|
|
7609
|
-
targetVersion: null,
|
|
7610
|
-
hostKind: env.hostKind,
|
|
7611
|
-
profileName: env.profileName,
|
|
7612
|
-
source: "check",
|
|
7613
|
-
volatile: false,
|
|
7614
|
-
atMs: latchNow()
|
|
7615
|
-
});
|
|
7616
|
-
return;
|
|
7617
|
-
}
|
|
7618
|
-
if (!mounted) return;
|
|
7619
|
-
if (!receipt) {
|
|
7620
|
-
const env = currentEnvPair();
|
|
7621
|
-
setLatch({
|
|
7622
|
-
code: "check-expired",
|
|
7623
|
-
kind: "check-expired",
|
|
7624
|
-
detail: null,
|
|
7625
|
-
diag: null,
|
|
7626
|
-
requestId,
|
|
7627
|
-
checkId: null,
|
|
7628
|
-
runningVersion: snapshot?.runningVersion ?? null,
|
|
7629
|
-
installedVersion: snapshot?.installedVersion ?? null,
|
|
7630
|
-
latestVersion: snapshot?.latestVersion ?? null,
|
|
7631
|
-
targetVersion: null,
|
|
7632
|
-
hostKind: env.hostKind,
|
|
7633
|
-
profileName: env.profileName,
|
|
7634
|
-
source: "install",
|
|
7635
|
-
volatile: false,
|
|
7636
|
-
atMs: latchNow()
|
|
7637
|
-
});
|
|
7638
|
-
return;
|
|
7639
|
-
}
|
|
7640
|
-
requestId = randomRequestId();
|
|
7641
|
-
pollCount = 0;
|
|
7642
|
-
pollCapped = false;
|
|
7643
|
-
try {
|
|
7644
|
-
const reply = await call(phoneNames.updateInstall, {
|
|
7645
|
-
checkId: receipt.checkId,
|
|
7646
|
-
requestId,
|
|
7647
|
-
...queueArgs()
|
|
7648
|
-
});
|
|
7649
7691
|
if (!mounted) return;
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
if (thrownBusy(err)) {
|
|
7654
|
-
await refresh();
|
|
7655
|
-
return;
|
|
7692
|
+
if (replyIsCheckExpired(reply) && attempt === 0) {
|
|
7693
|
+
receipt = null;
|
|
7694
|
+
continue;
|
|
7656
7695
|
}
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
code: "install-failed",
|
|
7660
|
-
kind: null,
|
|
7661
|
-
detail: thrownDetail(err),
|
|
7662
|
-
diag: null,
|
|
7663
|
-
requestId,
|
|
7664
|
-
checkId: receipt?.checkId ?? null,
|
|
7665
|
-
runningVersion: snapshot?.runningVersion ?? null,
|
|
7666
|
-
installedVersion: snapshot?.installedVersion ?? null,
|
|
7667
|
-
latestVersion: snapshot?.latestVersion ?? null,
|
|
7668
|
-
targetVersion: null,
|
|
7669
|
-
hostKind: env.hostKind,
|
|
7670
|
-
profileName: env.profileName,
|
|
7671
|
-
source: "install",
|
|
7672
|
-
volatile: false,
|
|
7673
|
-
atMs: latchNow()
|
|
7674
|
-
});
|
|
7696
|
+
applyStatusReply(reply, "install");
|
|
7697
|
+
return;
|
|
7675
7698
|
}
|
|
7676
7699
|
}
|
|
7677
7700
|
function diagText() {
|
|
@@ -7947,7 +7970,12 @@ ${body}`;
|
|
|
7947
7970
|
}
|
|
7948
7971
|
/** 缺席页签挂单包安装按钮(上游 0.18.0 安装控件,#1282):pluginId 与 prefix 取更新目标表
|
|
7949
7972
|
* 同源(与批量侧 `life-<key>`/`ilife-<skill>` 同一份推导),不手拼;文案样式零自家东西。
|
|
7950
|
-
* 目标表里没有该包(不该发生)回 null,调用方不渲染挂载位。
|
|
7973
|
+
* 目标表里没有该包(不该发生)回 null,调用方不渲染挂载位。
|
|
7974
|
+
*
|
|
7975
|
+
* #1282 定案:悬停换色走**容器 CSS 覆盖**,不传 `themeTokens`——0.18.0 包内实测,
|
|
7976
|
+
* `install-button.js` 全文件零 `var(--dsh-update-*)` 引用、主按钮零内联样式,
|
|
7977
|
+
* `mount` 内 `themeTokensStyleFor()` 返回值直接丢弃(只校验合法性);
|
|
7978
|
+
* tokens 只在批量面板生效,传给安装控件等于没传。将来上游修好再切官方口。 */
|
|
7951
7979
|
function mountLifeInstallButton(container, call, tab) {
|
|
7952
7980
|
const target = targetFor(tab.plugin);
|
|
7953
7981
|
if (target === void 0) return null;
|
|
@@ -10456,16 +10484,36 @@ ${body}`;
|
|
|
10456
10484
|
/** 缺席页签的单包安装按钮(#1282):挂载位+挂载一体,连接不到或目标表无此包就不画。
|
|
10457
10485
|
*
|
|
10458
10486
|
* 与标题行批量入口同形(ref 占位+effect 挂载+卸载 unmount),区别只有两处:调的是单包安装
|
|
10459
|
-
* 件(`prefix: ilife-<skill>` 的单包五电话),以及容器落在缺席提示与手动命令之间。
|
|
10487
|
+
* 件(`prefix: ilife-<skill>` 的单包五电话),以及容器落在缺席提示与手动命令之间。
|
|
10488
|
+
*
|
|
10489
|
+
* 上游首查回包里的 `manual`(精确手工命令)读出来交 `onManual`:带精确版本号与 registry,
|
|
10490
|
+
* 调用方拿它画自己的命令行+复制按钮(单一定位,不复述上游 details 里的同一条)。
|
|
10491
|
+
* 只读、不重查:读两次(800/2600ms,覆盖默认 1000ms 轮询的首查落定),读不到就只剩双包命令。 */
|
|
10460
10492
|
function TabInstallSlot(props) {
|
|
10461
10493
|
const slotRef = react.useRef(null);
|
|
10462
10494
|
const callReady = props.getCall() !== null;
|
|
10495
|
+
const onManualRef = react.useRef(props.onManual);
|
|
10496
|
+
onManualRef.current = props.onManual;
|
|
10463
10497
|
react.useEffect(() => {
|
|
10464
10498
|
const mount = slotRef.current;
|
|
10465
10499
|
if (mount === null || !callReady) return;
|
|
10466
10500
|
const button = mountLifeInstallButton(mount, managerCallAdapter(props.getCall()), props.tab);
|
|
10467
10501
|
if (button === null) return;
|
|
10502
|
+
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
|
+
}
|
|
10468
10514
|
return () => {
|
|
10515
|
+
alive = false;
|
|
10516
|
+
for (const t of timers) clearTimeout(t);
|
|
10469
10517
|
button.unmount();
|
|
10470
10518
|
};
|
|
10471
10519
|
}, [callReady, props.tab]);
|
|
@@ -10475,6 +10523,113 @@ ${body}`;
|
|
|
10475
10523
|
"data-ilife-install": "slot"
|
|
10476
10524
|
});
|
|
10477
10525
|
}
|
|
10526
|
+
/** 缺席面板步骤化样式(#1282 v4 原型定稿):序号圆点/命令行/复制按钮三态/Toast/上游主按钮覆盖。
|
|
10527
|
+
*
|
|
10528
|
+
* 全收敛在 `[data-ilife-absent]` 作用域下;容器 `S.reco` 与子顺序一字不动。
|
|
10529
|
+
* 上游主按钮换色用容器覆盖(`button[data-primary="1"]` 特异度压上游缺省;上游自带 CSS 无 hover
|
|
10530
|
+
* 规则,见 update-dialog.ts 注释——themeTokens 对安装控件无视觉效果,故悬停也收在这里)。
|
|
10531
|
+
* 悬停取深橙+白字+投影(用户 verdict:8% 提亮看不见);颜色原型定稿 hex,见 v4 原型。 */
|
|
10532
|
+
const ABSENT_TOAST_MS = 1500;
|
|
10533
|
+
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)}}";
|
|
10535
|
+
}
|
|
10536
|
+
/** 命令行文本进剪贴板:先走 Clipboard API,摸不到(老宿主/非安全上下文)就地降级为隐藏 textarea。
|
|
10537
|
+
* 文案保持「复制」二字不动(用户口径):成功只弹 Toast,不改按钮字。 */
|
|
10538
|
+
async function copyCmdText(text) {
|
|
10539
|
+
try {
|
|
10540
|
+
const clip = globalThis.navigator?.clipboard;
|
|
10541
|
+
if (clip !== void 0 && typeof clip.writeText === "function") {
|
|
10542
|
+
await clip.writeText(text);
|
|
10543
|
+
return;
|
|
10544
|
+
}
|
|
10545
|
+
} catch {}
|
|
10546
|
+
if (typeof document === "undefined" || typeof document.createElement !== "function") return;
|
|
10547
|
+
const area = document.createElement("textarea");
|
|
10548
|
+
area.value = text;
|
|
10549
|
+
area.setAttribute("readonly", "");
|
|
10550
|
+
area.style.position = "fixed";
|
|
10551
|
+
area.style.opacity = "0";
|
|
10552
|
+
document.body.appendChild(area);
|
|
10553
|
+
try {
|
|
10554
|
+
area.select();
|
|
10555
|
+
document.execCommand("copy");
|
|
10556
|
+
} catch {
|
|
10557
|
+
throw new Error("copy-unavailable");
|
|
10558
|
+
} finally {
|
|
10559
|
+
document.body.removeChild(area);
|
|
10560
|
+
}
|
|
10561
|
+
}
|
|
10562
|
+
/** 命令行右端复制按钮(#1282):文案恒为「复制」;点下走剪贴板,成了调 `onCopied` 弹 Toast。
|
|
10563
|
+
* 复制失败(剪贴板摸不到)吞掉不弹——弹“已复制”会撒谎。 */
|
|
10564
|
+
function CopyCmdButton(props) {
|
|
10565
|
+
return react.createElement("button", {
|
|
10566
|
+
type: "button",
|
|
10567
|
+
className: "ilife-copycmd",
|
|
10568
|
+
onClick: () => {
|
|
10569
|
+
copyCmdText(props.text).then(props.onCopied, () => void 0);
|
|
10570
|
+
}
|
|
10571
|
+
}, "复制");
|
|
10572
|
+
}
|
|
10573
|
+
/** 缺席页签整块面板(#1282 v4):容器 `S.reco` 不动,子顺序 hint→槽→命令不动,只做三步呈现。
|
|
10574
|
+
*
|
|
10575
|
+
* ①状态标题(包名+未安装,不复述命令);②一键安装(上游槽,版本与按钮归上游画);
|
|
10576
|
+
* ③备选手动安装(上游首查落定的精确命令+双包命令,各配复制按钮,默认即展开态)。
|
|
10577
|
+
* Toast 常驻条件挂载(`notice` 同形,进场即跑 `absentToastIn`),1.5s 自散。 */
|
|
10578
|
+
function AbsentTabPanel(props) {
|
|
10579
|
+
const [manual, setManual] = react.useState(null);
|
|
10580
|
+
const [toastOn, setToast] = react.useState(false);
|
|
10581
|
+
const toastTimer = react.useRef(null);
|
|
10582
|
+
react.useEffect(() => () => {
|
|
10583
|
+
if (toastTimer.current !== null) clearTimeout(toastTimer.current);
|
|
10584
|
+
}, []);
|
|
10585
|
+
const pokeToast = () => {
|
|
10586
|
+
setToast(true);
|
|
10587
|
+
if (typeof setTimeout !== "function") return;
|
|
10588
|
+
if (toastTimer.current !== null) clearTimeout(toastTimer.current);
|
|
10589
|
+
toastTimer.current = setTimeout(() => {
|
|
10590
|
+
setToast(false);
|
|
10591
|
+
}, ABSENT_TOAST_MS);
|
|
10592
|
+
};
|
|
10593
|
+
const cmdRows = [];
|
|
10594
|
+
if (manual !== null) cmdRows.push({
|
|
10595
|
+
key: "exact",
|
|
10596
|
+
text: manual,
|
|
10597
|
+
plain: false
|
|
10598
|
+
});
|
|
10599
|
+
cmdRows.push({
|
|
10600
|
+
key: "dual",
|
|
10601
|
+
text: props.installCmd,
|
|
10602
|
+
plain: true
|
|
10603
|
+
});
|
|
10604
|
+
return react.createElement("div", {
|
|
10605
|
+
style: S.reco,
|
|
10606
|
+
"data-ilife-absent": "panel"
|
|
10607
|
+
}, react.createElement("style", { "data-ilife-absent": "steps-css" }, absentStepsCss()), react.createElement("span", {
|
|
10608
|
+
className: "ilife-step",
|
|
10609
|
+
"data-step": "1"
|
|
10610
|
+
}, react.createElement("span", { className: "ilife-step-t" }, props.tab.plugin + " 未安装"), "请补装后使用。"), react.createElement("span", {
|
|
10611
|
+
className: "ilife-step",
|
|
10612
|
+
"data-step": "2"
|
|
10613
|
+
}, react.createElement("span", { className: "ilife-step-t" }, "一键安装"), react.createElement("span", { className: "ilife-tray" }, react.createElement(TabInstallSlot, {
|
|
10614
|
+
tab: props.tab,
|
|
10615
|
+
getCall: props.getCall,
|
|
10616
|
+
onManual: (text) => {
|
|
10617
|
+
setManual(text);
|
|
10618
|
+
}
|
|
10619
|
+
}))), react.createElement("span", {
|
|
10620
|
+
className: "ilife-step",
|
|
10621
|
+
"data-step": "3"
|
|
10622
|
+
}, react.createElement("span", { className: "ilife-step-t" }, "备选:手动安装"), cmdRows.map((row) => react.createElement("span", {
|
|
10623
|
+
key: row.key,
|
|
10624
|
+
className: "ilife-cmdrow"
|
|
10625
|
+
}, react.createElement("code", { className: row.plain ? "plain" : void 0 }, row.text), react.createElement(CopyCmdButton, {
|
|
10626
|
+
text: row.text,
|
|
10627
|
+
onCopied: pokeToast
|
|
10628
|
+
})))), toastOn ? react.createElement("div", {
|
|
10629
|
+
"data-ilife-absent": "toast",
|
|
10630
|
+
role: "status"
|
|
10631
|
+
}, "✓ 已复制") : null);
|
|
10632
|
+
}
|
|
10478
10633
|
function MorePluginsCard() {
|
|
10479
10634
|
return react.createElement("div", { style: S.moreCard }, react.createElement("div", { style: S.moreTitle }, "作者其他插件"), MORE_PLUGINS.map((row) => react.createElement("a", {
|
|
10480
10635
|
key: row.pkg,
|
|
@@ -10487,7 +10642,7 @@ ${body}`;
|
|
|
10487
10642
|
}, 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)))));
|
|
10488
10643
|
}
|
|
10489
10644
|
/** 版本胶囊那一行字:只在这里拼一次,屏上与用例读的是同一串。 */
|
|
10490
|
-
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.
|
|
10645
|
+
const MANAGER_VERSION_TEXT = "dsh-life-pack · 0.3.60";
|
|
10491
10646
|
/** 右下角那本书离面板两沿的距离:用户口径「一直处于面板右下角、不随列表滑动消失」
|
|
10492
10647
|
* ⇒ sticky 吸附(面板相对,视口多大都落在面板角上);INSET=右沿,BOTTOM=底沿。 */
|
|
10493
10648
|
const MANUAL_ENTRY_INSET = 16;
|
|
@@ -10816,10 +10971,11 @@ ${body}`;
|
|
|
10816
10971
|
error: health.rows[tab.plugin]?.error ?? null
|
|
10817
10972
|
})) : (() => {
|
|
10818
10973
|
const reco = recoFor(tab);
|
|
10819
|
-
return react.createElement(
|
|
10974
|
+
return react.createElement(AbsentTabPanel, {
|
|
10820
10975
|
tab,
|
|
10976
|
+
installCmd: reco.installCmd,
|
|
10821
10977
|
getCall: props.getCall
|
|
10822
|
-
})
|
|
10978
|
+
});
|
|
10823
10979
|
})());
|
|
10824
10980
|
}), react.createElement(MorePluginsCard, null), react.createElement("div", {
|
|
10825
10981
|
style: {
|