@morehao/dsh-github-trending 0.8.7 → 0.8.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.
- package/client.js +264 -112
- package/package.json +2 -2
package/client.js
CHANGED
|
@@ -55,7 +55,6 @@ var DICT = {
|
|
|
55
55
|
"st.repo": "仓库",
|
|
56
56
|
"st.auth": "认证",
|
|
57
57
|
"st.scope": "榜单",
|
|
58
|
-
"st.summarize": "摘要与用量",
|
|
59
58
|
"st.releases": "订阅",
|
|
60
59
|
"st.schedule": "调度",
|
|
61
60
|
"card.source.title": "内容来源",
|
|
@@ -284,9 +283,10 @@ var DICT = {
|
|
|
284
283
|
"shell.update.confirmHint": "更新会重装插件,需重启 DSH 生效",
|
|
285
284
|
"shell.update.confirmYes": "确认更新",
|
|
286
285
|
"shell.update.cancel": "取消",
|
|
287
|
-
"
|
|
288
|
-
"
|
|
289
|
-
"
|
|
286
|
+
"restoreNotice.title": "已更新到 v{version}",
|
|
287
|
+
"restoreNotice.titleBare": "更新已安装",
|
|
288
|
+
"restoreNotice.body": "请彻底退出 DSH(⌘Q)再重新打开,更新才会生效。",
|
|
289
|
+
"restoreNotice.dismiss": "知道了",
|
|
290
290
|
"time.in.minutes": "{minutes} 分钟后",
|
|
291
291
|
"time.in.hours": "{hours} 小时 {minutes} 分后",
|
|
292
292
|
"time.in.days": "{days} 天后",
|
|
@@ -438,7 +438,6 @@ var DICT = {
|
|
|
438
438
|
"runs.detail.tokensNone": "—",
|
|
439
439
|
"runs.footer.total": "历史累计 tokens:{total}",
|
|
440
440
|
"card.summarize.title": "摘要与用量",
|
|
441
|
-
"card.summarize.hint": "对应核心 summarize.*(core 0.4.1+)",
|
|
442
441
|
"summarize.batchSize": "批量大小",
|
|
443
442
|
"summarize.batchSize.help": "每次模型调用处理的仓库数;批次越大速度越快,单次提示词也越长。",
|
|
444
443
|
"summarize.maxRetries": "失败重试",
|
|
@@ -585,16 +584,15 @@ var DICT = {
|
|
|
585
584
|
"overview.releases.repos": "仓库",
|
|
586
585
|
"overview.tokens.note": "概览一屏带出「这次任务共花了多少 token / 历史上累计多少 / 订阅仓库有几个新版本」;只给总用量,不拆维度;本次任务总量已含订阅阶段消耗。旧核心无数据时对应小块整体隐藏,不留 0。",
|
|
587
586
|
"about.title": "关于",
|
|
588
|
-
"about.copy": "
|
|
587
|
+
"about.copy": "复制包名",
|
|
589
588
|
"about.copied": "已复制",
|
|
590
589
|
"about.close": "关闭",
|
|
590
|
+
"about.pkg": "包名",
|
|
591
591
|
"about.repo": "GitHub 仓库",
|
|
592
592
|
"about.repo.missing": "package.json 没有可解析的仓库地址",
|
|
593
593
|
"about.license": "许可",
|
|
594
594
|
"about.core": "核心",
|
|
595
|
-
"about.core.repo": "打开核心 GitHub 仓库"
|
|
596
|
-
"about.env": "运行环境",
|
|
597
|
-
"about.env.value": "DSH Web · Node 插件"
|
|
595
|
+
"about.core.repo": "打开核心 GitHub 仓库"
|
|
598
596
|
},
|
|
599
597
|
en: {
|
|
600
598
|
"section.title": "GitHub Trending",
|
|
@@ -606,7 +604,6 @@ var DICT = {
|
|
|
606
604
|
"st.repo": "Repository",
|
|
607
605
|
"st.auth": "Auth",
|
|
608
606
|
"st.scope": "Board",
|
|
609
|
-
"st.summarize": "Summary & usage",
|
|
610
607
|
"st.releases": "Subscriptions",
|
|
611
608
|
"st.schedule": "Schedule",
|
|
612
609
|
"card.source.title": "Content source",
|
|
@@ -835,9 +832,10 @@ var DICT = {
|
|
|
835
832
|
"shell.update.confirmHint": "Reinstalls the plugin; restart DSH to apply",
|
|
836
833
|
"shell.update.confirmYes": "Confirm",
|
|
837
834
|
"shell.update.cancel": "Cancel",
|
|
838
|
-
"
|
|
839
|
-
"
|
|
840
|
-
"
|
|
835
|
+
"restoreNotice.title": "Updated to v{version}",
|
|
836
|
+
"restoreNotice.titleBare": "Update installed",
|
|
837
|
+
"restoreNotice.body": "Quit DSH completely (⌘Q) and reopen it so the update takes effect.",
|
|
838
|
+
"restoreNotice.dismiss": "Got it",
|
|
841
839
|
"time.in.minutes": "in {minutes} min",
|
|
842
840
|
"time.in.hours": "in {hours} h {minutes} min",
|
|
843
841
|
"time.in.days": "in {days} d",
|
|
@@ -989,7 +987,6 @@ var DICT = {
|
|
|
989
987
|
"runs.detail.tokensNone": "—",
|
|
990
988
|
"runs.footer.total": "All-time tokens: {total}",
|
|
991
989
|
"card.summarize.title": "Summary & usage",
|
|
992
|
-
"card.summarize.hint": "Maps to core summarize.* (core 0.4.1+)",
|
|
993
990
|
"summarize.batchSize": "Batch size",
|
|
994
991
|
"summarize.batchSize.help": "Repos per model call; larger batches run faster but make each prompt longer.",
|
|
995
992
|
"summarize.maxRetries": "Retries",
|
|
@@ -1136,16 +1133,15 @@ var DICT = {
|
|
|
1136
1133
|
"overview.releases.repos": "Repos",
|
|
1137
1134
|
"overview.tokens.note": 'The overview surfaces "how many tokens this run spent / all-time accumulated / how many new versions across subscribed repos"; total only, not split by dimension; this run total already includes the subscriptions stage. With an old core that has no data, the corresponding tile is hidden entirely, never shown as 0.',
|
|
1138
1135
|
"about.title": "About",
|
|
1139
|
-
"about.copy": "Copy package name
|
|
1136
|
+
"about.copy": "Copy package name",
|
|
1140
1137
|
"about.copied": "Copied",
|
|
1141
1138
|
"about.close": "Close",
|
|
1139
|
+
"about.pkg": "Package",
|
|
1142
1140
|
"about.repo": "GitHub repository",
|
|
1143
1141
|
"about.repo.missing": "package.json has no resolvable repository URL",
|
|
1144
1142
|
"about.license": "License",
|
|
1145
1143
|
"about.core": "Core",
|
|
1146
|
-
"about.core.repo": "Open core GitHub repository"
|
|
1147
|
-
"about.env": "Runtime",
|
|
1148
|
-
"about.env.value": "DSH Web · Node plugin"
|
|
1144
|
+
"about.core.repo": "Open core GitHub repository"
|
|
1149
1145
|
}
|
|
1150
1146
|
};
|
|
1151
1147
|
function activeLang(locale) {
|
|
@@ -1245,6 +1241,14 @@ var CSS = `
|
|
|
1245
1241
|
.dshgt-modal-mask{position:fixed;inset:0;background:var(--dsw-alias-bg-mask-1,rgba(15,23,42,.38));display:flex;align-items:center;justify-content:center;z-index:2147483000;}
|
|
1246
1242
|
.dshgt-modal{background:var(--gt-bg);border-radius:12px;border:1px solid var(--gt-border);max-width:640px;width:calc(100% - 32px);max-height:80vh;overflow:auto;padding:16px;display:flex;flex-direction:column;gap:10px;box-shadow:0 20px 50px rgba(15,23,42,.25);}
|
|
1247
1243
|
|
|
1244
|
+
/* ——— 自更新后的恢复提示(右下角,约 6 秒后自动消失) ——— */
|
|
1245
|
+
.dshgt-restore{position:fixed;right:20px;bottom:20px;z-index:2147483000;max-width:360px;display:flex;flex-direction:column;gap:10px;padding:14px 16px;border-radius:12px;border:1px solid var(--gt-border);background:var(--gt-bg);box-shadow:0 16px 40px rgba(15,23,42,.28);animation:dshgt-restore-in .18s ease-out;}
|
|
1246
|
+
.dshgt-restore-text{display:flex;flex-direction:column;gap:4px;}
|
|
1247
|
+
.dshgt-restore-title{font-size:13px;font-weight:600;color:var(--gt-fg);}
|
|
1248
|
+
.dshgt-restore-body{font-size:12px;line-height:1.5;color:var(--gt-muted);}
|
|
1249
|
+
.dshgt-restore-actions{display:flex;justify-content:flex-end;gap:8px;}
|
|
1250
|
+
@keyframes dshgt-restore-in{from{opacity:0;transform:translateY(8px);}to{opacity:1;transform:translateY(0);}}
|
|
1251
|
+
|
|
1248
1252
|
/* ——— GitHub 设备码登录弹窗 ——— */
|
|
1249
1253
|
.dshgt-authmodal{max-width:420px;gap:14px;}
|
|
1250
1254
|
.dshgt-authmodal-head{display:flex;align-items:center;justify-content:space-between;gap:8px;}
|
|
@@ -1512,22 +1516,28 @@ var CSS = `
|
|
|
1512
1516
|
.dshgt-log-head .dshgt-btn{margin-left:auto;}
|
|
1513
1517
|
.dshgt-log-pre{margin:0;max-height:52vh;overflow:auto;padding:12px;border-radius:8px;background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-card));font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;line-height:1.6;white-space:pre-wrap;word-break:break-word;}
|
|
1514
1518
|
.dshgt-log-foot{display:flex;align-items:center;gap:10px;flex-wrap:wrap;}
|
|
1515
|
-
.dshgt-about{max-width:
|
|
1519
|
+
.dshgt-about{max-width:460px;width:100%;}
|
|
1516
1520
|
.dshgt-about-head{display:flex;align-items:center;gap:10px;}
|
|
1517
|
-
.dshgt-about-title{margin:0;font-size:
|
|
1518
|
-
.dshgt-about-
|
|
1519
|
-
.dshgt-about-
|
|
1520
|
-
|
|
1521
|
-
.dshgt-about-
|
|
1522
|
-
.dshgt-about-
|
|
1523
|
-
.dshgt-about-
|
|
1524
|
-
.dshgt-about
|
|
1521
|
+
.dshgt-about-title{margin:0;font-size:15px;font-weight:600;}
|
|
1522
|
+
.dshgt-about-close{margin-left:auto;appearance:none;font:inherit;font-size:12px;cursor:pointer;border-radius:7px;border:1px solid var(--gt-border);background:var(--gt-bg);padding:4px 11px;color:var(--gt-muted);}
|
|
1523
|
+
.dshgt-about-close:hover{color:var(--gt-fg);border-color:color-mix(in srgb,var(--gt-accent) 40%,var(--gt-border));}
|
|
1524
|
+
/* 居中的应用身份区块:logo / 名称 / 版本胶囊 */
|
|
1525
|
+
.dshgt-about-identity{display:flex;flex-direction:column;align-items:center;gap:10px;padding:14px 0 18px;}
|
|
1526
|
+
.dshgt-about-logo svg{width:56px;height:56px;border-radius:14px;display:block;box-shadow:0 4px 14px rgba(0,0,0,.18);}
|
|
1527
|
+
.dshgt-about-name{font-size:16px;font-weight:650;letter-spacing:-.01em;}
|
|
1528
|
+
.dshgt-about-ver{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11.5px;color:var(--gt-fg);background:var(--gt-card);border:1px solid var(--gt-border);border-radius:999px;padding:1px 9px;line-height:17px;}
|
|
1529
|
+
/* 信息表:上方一条分割线,左对齐 label/value */
|
|
1530
|
+
.dshgt-about .dshgt-kv{grid-template-columns:88px minmax(0,1fr);border-top:1px solid var(--gt-border);padding-top:2px;}
|
|
1525
1531
|
.dshgt-about .dshgt-kv a{color:var(--gt-accent);text-decoration:none;}
|
|
1526
1532
|
.dshgt-about .dshgt-kv a:hover{text-decoration:underline;}
|
|
1527
1533
|
.dshgt-about .dshgt-kv dd{min-width:0;overflow-wrap:anywhere;}
|
|
1528
|
-
|
|
1529
|
-
.dshgt-about-
|
|
1530
|
-
.dshgt-about-
|
|
1534
|
+
/* 包名行:整行可点复制,无独立按钮;复制后行尾浮现「已复制」 */
|
|
1535
|
+
.dshgt-about-pkgrow{padding:0 !important;}
|
|
1536
|
+
.dshgt-about-pkglink{appearance:none;font:inherit;border:0;background:none;padding:9px 6px;margin:-9px -6px;border-radius:6px;width:calc(100% + 12px);display:flex;align-items:center;gap:8px;text-align:left;cursor:pointer;color:inherit;}
|
|
1537
|
+
.dshgt-about-pkglink:hover{background:color-mix(in srgb,var(--gt-fg) 5%,var(--gt-bg));}
|
|
1538
|
+
.dshgt-about-pkglink-name{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;user-select:text;}
|
|
1539
|
+
.dshgt-about-copied{opacity:0;transition:opacity .12s ease;font-size:11px;color:var(--gt-ok);flex:none;}
|
|
1540
|
+
.dshgt-about-pkglink.is-copied .dshgt-about-copied{opacity:1;}
|
|
1531
1541
|
.dshgt-gh{width:15px;height:15px;display:block;fill:currentColor;}
|
|
1532
1542
|
|
|
1533
1543
|
/* ——— 订阅:命令栏 + 四列表格 + 选择条 + 发版记录抽屉 ——— */
|
|
@@ -2148,8 +2158,8 @@ function credentialView(model, t) {
|
|
|
2148
2158
|
|
|
2149
2159
|
// client/settings.ts
|
|
2150
2160
|
var LANGUAGES = ["all", "typescript", "python", "go", "rust", "java", "c", "cpp", "javascript", "csharp"];
|
|
2151
|
-
var SECTIONS = ["source", "model", "repo", "auth", "scope", "
|
|
2152
|
-
var EMPTY_DIRTY = { source: false, model: false, repo: false, auth: false, scope: false,
|
|
2161
|
+
var SECTIONS = ["source", "model", "repo", "auth", "scope", "releases"];
|
|
2162
|
+
var EMPTY_DIRTY = { source: false, model: false, repo: false, auth: false, scope: false, releases: false };
|
|
2153
2163
|
function cloneSettings(settings) {
|
|
2154
2164
|
return JSON.parse(JSON.stringify(settings));
|
|
2155
2165
|
}
|
|
@@ -2164,9 +2174,7 @@ function sectionSlice(settings, section) {
|
|
|
2164
2174
|
case "auth":
|
|
2165
2175
|
return { github: settings.github };
|
|
2166
2176
|
case "scope":
|
|
2167
|
-
return { trending: settings.trending, schedule: settings.schedule };
|
|
2168
|
-
case "summarize":
|
|
2169
|
-
return { summarize: settings.summarize };
|
|
2177
|
+
return { trending: settings.trending, schedule: settings.schedule, summarize: settings.summarize };
|
|
2170
2178
|
case "releases":
|
|
2171
2179
|
return { releases: settings.releases };
|
|
2172
2180
|
}
|
|
@@ -2431,7 +2439,6 @@ function SettingsView(props) {
|
|
|
2431
2439
|
{ id: "repo", label: t("st.repo") },
|
|
2432
2440
|
{ id: "auth", label: t("st.auth") },
|
|
2433
2441
|
{ id: "scope", label: t("st.scope") },
|
|
2434
|
-
{ id: "summarize", label: t("st.summarize") },
|
|
2435
2442
|
{ id: "releases", label: t("st.releases") }
|
|
2436
2443
|
];
|
|
2437
2444
|
const sourceCard = h(
|
|
@@ -2703,11 +2710,8 @@ function SettingsView(props) {
|
|
|
2703
2710
|
{ label: t("schedule.periods") },
|
|
2704
2711
|
h("span", { className: "dshgt-hint" }, t("schedule.periods.value"))
|
|
2705
2712
|
),
|
|
2706
|
-
h("p", { className: "dshgt-hint" }, t("schedule.source"))
|
|
2707
|
-
|
|
2708
|
-
const summarizeCard = h(
|
|
2709
|
-
Card,
|
|
2710
|
-
{ title: t("card.summarize.title"), hint: t("card.summarize.hint") },
|
|
2713
|
+
h("p", { className: "dshgt-hint" }, t("schedule.source")),
|
|
2714
|
+
h("h4", { className: "dshgt-subhead" }, t("card.summarize.title")),
|
|
2711
2715
|
h(
|
|
2712
2716
|
Row,
|
|
2713
2717
|
{ label: t("summarize.batchSize"), help: t("summarize.batchSize.help") },
|
|
@@ -2852,7 +2856,7 @@ function SettingsView(props) {
|
|
|
2852
2856
|
})
|
|
2853
2857
|
)
|
|
2854
2858
|
);
|
|
2855
|
-
const currentCard = section === "source" ? sourceCard : section === "model" ? modelCard : section === "repo" ? repoCard : section === "auth" ? authCard : section === "scope" ? scopeCard :
|
|
2859
|
+
const currentCard = section === "source" ? sourceCard : section === "model" ? modelCard : section === "repo" ? repoCard : section === "auth" ? authCard : section === "scope" ? scopeCard : releasesCard;
|
|
2856
2860
|
return h(
|
|
2857
2861
|
"div",
|
|
2858
2862
|
{ className: "dshgt-settings" },
|
|
@@ -5477,15 +5481,21 @@ function SubscriptionsView(props) {
|
|
|
5477
5481
|
}
|
|
5478
5482
|
|
|
5479
5483
|
// client/about.ts
|
|
5480
|
-
function
|
|
5481
|
-
return h(
|
|
5482
|
-
|
|
5483
|
-
viewBox: "0 0
|
|
5484
|
-
"
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5484
|
+
function logo() {
|
|
5485
|
+
return h(
|
|
5486
|
+
"svg",
|
|
5487
|
+
{ viewBox: "0 0 64 64", "aria-hidden": "true" },
|
|
5488
|
+
h("rect", { x: 4, y: 4, width: 56, height: 56, rx: 14, fill: "#0d1117" }),
|
|
5489
|
+
h("path", {
|
|
5490
|
+
d: "M18 46V22l14 12 14-12v24",
|
|
5491
|
+
fill: "none",
|
|
5492
|
+
stroke: "#58a6ff",
|
|
5493
|
+
strokeWidth: 4,
|
|
5494
|
+
strokeLinecap: "round",
|
|
5495
|
+
strokeLinejoin: "round"
|
|
5496
|
+
}),
|
|
5497
|
+
h("circle", { cx: 32, cy: 45, r: 3, fill: "#3fb950" })
|
|
5498
|
+
);
|
|
5489
5499
|
}
|
|
5490
5500
|
function AboutDialog(props) {
|
|
5491
5501
|
const { t, state } = props;
|
|
@@ -5495,7 +5505,6 @@ function AboutDialog(props) {
|
|
|
5495
5505
|
const repository = plugin.repository;
|
|
5496
5506
|
const ownerRepo = repository === void 0 ? void 0 : repository.replace(/^https?:\/\/github\.com\//, "");
|
|
5497
5507
|
const core = state.core;
|
|
5498
|
-
const coreVersion = core.version === void 0 ? "" : `trendradar ${core.version}`;
|
|
5499
5508
|
const coreRepo = core.repository;
|
|
5500
5509
|
const coreOwnerRepo = coreRepo === void 0 ? void 0 : coreRepo.replace(/^https?:\/\/github\.com\//, "");
|
|
5501
5510
|
import_react.default.useEffect(() => {
|
|
@@ -5512,62 +5521,71 @@ function AboutDialog(props) {
|
|
|
5512
5521
|
setTimeout(() => setCopied(false), 1400);
|
|
5513
5522
|
});
|
|
5514
5523
|
};
|
|
5524
|
+
const pkgRow = h(
|
|
5525
|
+
"dd",
|
|
5526
|
+
{ className: "dshgt-about-pkgrow" },
|
|
5527
|
+
h(
|
|
5528
|
+
"button",
|
|
5529
|
+
{
|
|
5530
|
+
type: "button",
|
|
5531
|
+
className: `dshgt-about-pkglink${copied ? " is-copied" : ""}`,
|
|
5532
|
+
title: copied ? t("about.copied") : t("about.copy"),
|
|
5533
|
+
"aria-label": `${t("about.copy")}: ${fullName}`,
|
|
5534
|
+
onClick: copy
|
|
5535
|
+
},
|
|
5536
|
+
h("span", { className: "dshgt-mono dshgt-about-pkglink-name" }, fullName),
|
|
5537
|
+
h("span", { className: "dshgt-about-copied" }, t("about.copied"))
|
|
5538
|
+
)
|
|
5539
|
+
);
|
|
5515
5540
|
const coreValue = () => {
|
|
5516
5541
|
if (coreRepo !== void 0 && coreOwnerRepo !== void 0) {
|
|
5517
|
-
|
|
5518
|
-
return h(
|
|
5519
|
-
"span",
|
|
5520
|
-
{ className: "dshgt-about-core" },
|
|
5521
|
-
h("a", { href: coreRepo, target: "_blank", rel: "noreferrer" }, label),
|
|
5522
|
-
h(
|
|
5523
|
-
"a",
|
|
5524
|
-
{ className: "dshgt-about-gh", href: coreRepo, target: "_blank", rel: "noreferrer", title: t("about.core.repo"), "aria-label": t("about.core.repo") },
|
|
5525
|
-
githubIcon()
|
|
5526
|
-
)
|
|
5527
|
-
);
|
|
5542
|
+
return h("a", { className: "dshgt-mono", href: coreRepo, target: "_blank", rel: "noreferrer" }, coreOwnerRepo);
|
|
5528
5543
|
}
|
|
5529
|
-
return
|
|
5544
|
+
return core.version === void 0 ? "—" : `trendradar ${core.version}`;
|
|
5530
5545
|
};
|
|
5531
|
-
|
|
5546
|
+
return h(
|
|
5532
5547
|
"div",
|
|
5533
|
-
{ className: "dshgt-
|
|
5534
|
-
if (event.target === event.currentTarget) props.onClose();
|
|
5535
|
-
} },
|
|
5548
|
+
{ className: "dshgt-root" },
|
|
5536
5549
|
h(
|
|
5537
5550
|
"div",
|
|
5538
|
-
{ className: "dshgt-modal
|
|
5551
|
+
{ className: "dshgt-modal-mask", onClick: (event) => {
|
|
5552
|
+
if (event.target === event.currentTarget) props.onClose();
|
|
5553
|
+
} },
|
|
5539
5554
|
h(
|
|
5540
5555
|
"div",
|
|
5541
|
-
{ className: "dshgt-about-
|
|
5542
|
-
h(
|
|
5543
|
-
|
|
5544
|
-
|
|
5545
|
-
|
|
5546
|
-
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
"
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5556
|
+
{ className: "dshgt-modal dshgt-about", role: "dialog", "aria-modal": "true", "aria-label": t("about.title") },
|
|
5557
|
+
h(
|
|
5558
|
+
"div",
|
|
5559
|
+
{ className: "dshgt-about-head" },
|
|
5560
|
+
h("h3", { className: "dshgt-about-title" }, t("about.title")),
|
|
5561
|
+
h("button", { type: "button", className: "dshgt-about-close", onClick: () => props.onClose() }, t("about.close"))
|
|
5562
|
+
),
|
|
5563
|
+
h(
|
|
5564
|
+
"div",
|
|
5565
|
+
{ className: "dshgt-about-identity" },
|
|
5566
|
+
h("div", { className: "dshgt-about-logo" }, logo()),
|
|
5567
|
+
h("div", { className: "dshgt-about-name" }, t("section.title")),
|
|
5568
|
+
h("span", { className: "dshgt-about-ver dshgt-mono" }, `v${plugin.version}`)
|
|
5569
|
+
),
|
|
5570
|
+
h(
|
|
5571
|
+
"dl",
|
|
5572
|
+
{ className: "dshgt-kv dshgt-about-kv" },
|
|
5573
|
+
h("dt", null, t("about.pkg")),
|
|
5574
|
+
pkgRow,
|
|
5575
|
+
h("dt", null, t("about.repo")),
|
|
5576
|
+
h(
|
|
5577
|
+
"dd",
|
|
5578
|
+
null,
|
|
5561
5579
|
repository === void 0 || ownerRepo === void 0 ? h("span", { className: "dshgt-hint" }, t("about.repo.missing")) : h("a", { href: repository, target: "_blank", rel: "noreferrer" }, ownerRepo)
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5565
|
-
|
|
5566
|
-
|
|
5567
|
-
|
|
5580
|
+
),
|
|
5581
|
+
h("dt", null, t("about.core")),
|
|
5582
|
+
h("dd", null, coreValue()),
|
|
5583
|
+
h("dt", null, t("about.license")),
|
|
5584
|
+
h("dd", null, "MIT")
|
|
5585
|
+
)
|
|
5586
|
+
)
|
|
5568
5587
|
)
|
|
5569
5588
|
);
|
|
5570
|
-
return h("div", { className: "dshgt-root" }, dialog);
|
|
5571
5589
|
}
|
|
5572
5590
|
|
|
5573
5591
|
// node_modules/@morehao/dsh-plugin-kit/dist/update-client.js
|
|
@@ -5678,8 +5696,115 @@ function usePluginUpdate() {
|
|
|
5678
5696
|
return [state, controller];
|
|
5679
5697
|
}
|
|
5680
5698
|
|
|
5699
|
+
// node_modules/@morehao/dsh-plugin-kit/dist/update-restore.js
|
|
5700
|
+
var PENDING_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
5701
|
+
var DEFAULT_KEY_PREFIX = "dsh-plugin-update:";
|
|
5702
|
+
var FUTURE_TOLERANCE_MS = 60 * 1e3;
|
|
5703
|
+
function resolveStorage(explicit) {
|
|
5704
|
+
if (explicit !== void 0) {
|
|
5705
|
+
try {
|
|
5706
|
+
const probeKey = "__dsh_pending_probe__";
|
|
5707
|
+
explicit.setItem(probeKey, "1");
|
|
5708
|
+
explicit.removeItem(probeKey);
|
|
5709
|
+
return explicit;
|
|
5710
|
+
} catch {
|
|
5711
|
+
return null;
|
|
5712
|
+
}
|
|
5713
|
+
}
|
|
5714
|
+
try {
|
|
5715
|
+
const w = typeof globalThis !== "undefined" ? globalThis : void 0;
|
|
5716
|
+
const s = w?.localStorage;
|
|
5717
|
+
if (!s) return null;
|
|
5718
|
+
const probeKey = "__dsh_pending_probe__";
|
|
5719
|
+
s.setItem(probeKey, "1");
|
|
5720
|
+
s.removeItem(probeKey);
|
|
5721
|
+
return s;
|
|
5722
|
+
} catch {
|
|
5723
|
+
return null;
|
|
5724
|
+
}
|
|
5725
|
+
}
|
|
5726
|
+
function createPendingStore(options = {}) {
|
|
5727
|
+
const keyPrefix = options.keyPrefix === void 0 ? DEFAULT_KEY_PREFIX : options.keyPrefix;
|
|
5728
|
+
const key = `${keyPrefix}update-pending`;
|
|
5729
|
+
const ttlMs = options.ttlMs === void 0 ? PENDING_TTL_MS : options.ttlMs;
|
|
5730
|
+
const now = options.now === void 0 ? Date.now : options.now;
|
|
5731
|
+
const storage = () => resolveStorage(options.storage);
|
|
5732
|
+
function removeKey() {
|
|
5733
|
+
const s = storage();
|
|
5734
|
+
if (!s) return;
|
|
5735
|
+
try {
|
|
5736
|
+
s.removeItem(key);
|
|
5737
|
+
} catch {
|
|
5738
|
+
}
|
|
5739
|
+
}
|
|
5740
|
+
function write(from, to) {
|
|
5741
|
+
const s = storage();
|
|
5742
|
+
if (!s) return;
|
|
5743
|
+
const value = { from: String(from || ""), to: String(to || ""), at: now() };
|
|
5744
|
+
try {
|
|
5745
|
+
s.setItem(key, JSON.stringify(value));
|
|
5746
|
+
} catch {
|
|
5747
|
+
}
|
|
5748
|
+
}
|
|
5749
|
+
function read() {
|
|
5750
|
+
const s = storage();
|
|
5751
|
+
if (!s) return null;
|
|
5752
|
+
let raw;
|
|
5753
|
+
try {
|
|
5754
|
+
raw = s.getItem(key);
|
|
5755
|
+
} catch {
|
|
5756
|
+
return null;
|
|
5757
|
+
}
|
|
5758
|
+
if (raw === null || raw === "") return null;
|
|
5759
|
+
let value;
|
|
5760
|
+
try {
|
|
5761
|
+
value = JSON.parse(raw);
|
|
5762
|
+
} catch {
|
|
5763
|
+
removeKey();
|
|
5764
|
+
return null;
|
|
5765
|
+
}
|
|
5766
|
+
if (!value || typeof value !== "object") return null;
|
|
5767
|
+
const { from, to, at } = value;
|
|
5768
|
+
if (typeof at !== "number" || !Number.isFinite(at)) {
|
|
5769
|
+
removeKey();
|
|
5770
|
+
return null;
|
|
5771
|
+
}
|
|
5772
|
+
const current = now();
|
|
5773
|
+
if (current - at > ttlMs || at > current + FUTURE_TOLERANCE_MS) {
|
|
5774
|
+
removeKey();
|
|
5775
|
+
return null;
|
|
5776
|
+
}
|
|
5777
|
+
return { from: typeof from === "string" ? from : "", to: typeof to === "string" ? to : "", at };
|
|
5778
|
+
}
|
|
5779
|
+
function clear() {
|
|
5780
|
+
removeKey();
|
|
5781
|
+
}
|
|
5782
|
+
return { write, read, clear };
|
|
5783
|
+
}
|
|
5784
|
+
|
|
5785
|
+
// client/update-store.ts
|
|
5786
|
+
var PREFIX = "dsh-github-trending:";
|
|
5787
|
+
function browserStorage() {
|
|
5788
|
+
try {
|
|
5789
|
+
const w = typeof window !== "undefined" ? window : void 0;
|
|
5790
|
+
return w?.localStorage ?? void 0;
|
|
5791
|
+
} catch {
|
|
5792
|
+
return void 0;
|
|
5793
|
+
}
|
|
5794
|
+
}
|
|
5795
|
+
var pendingStore = createPendingStore({ keyPrefix: PREFIX, storage: browserStorage() });
|
|
5796
|
+
function writePendingUpdate(from, to) {
|
|
5797
|
+
pendingStore.write(from, to);
|
|
5798
|
+
}
|
|
5799
|
+
function readPendingUpdate() {
|
|
5800
|
+
return pendingStore.read();
|
|
5801
|
+
}
|
|
5802
|
+
function clearPendingUpdate() {
|
|
5803
|
+
pendingStore.clear();
|
|
5804
|
+
}
|
|
5805
|
+
|
|
5681
5806
|
// client/identity-bar.ts
|
|
5682
|
-
function
|
|
5807
|
+
function logo2() {
|
|
5683
5808
|
return h(
|
|
5684
5809
|
"svg",
|
|
5685
5810
|
{ width: 22, height: 22, viewBox: "0 0 64 64", "aria-hidden": "true" },
|
|
@@ -5688,7 +5813,7 @@ function logo() {
|
|
|
5688
5813
|
h("circle", { cx: 32, cy: 45, r: 3, fill: "#3fb950" })
|
|
5689
5814
|
);
|
|
5690
5815
|
}
|
|
5691
|
-
function
|
|
5816
|
+
function githubIcon() {
|
|
5692
5817
|
return h("svg", { width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor", "aria-hidden": "true" }, h("path", {
|
|
5693
5818
|
d: "M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"
|
|
5694
5819
|
}));
|
|
@@ -5696,7 +5821,6 @@ function githubIcon2() {
|
|
|
5696
5821
|
function IdentityBar(props) {
|
|
5697
5822
|
const { t, plugin } = props;
|
|
5698
5823
|
const [confirming, setConfirming] = import_react.default.useState(false);
|
|
5699
|
-
const [cmdCopied, setCmdCopied] = import_react.default.useState(false);
|
|
5700
5824
|
const [updateState, controller] = usePluginUpdate();
|
|
5701
5825
|
const view = updateState.view;
|
|
5702
5826
|
const status = updateState.status;
|
|
@@ -5708,16 +5832,7 @@ function IdentityBar(props) {
|
|
|
5708
5832
|
const latestVersion = view === null ? "" : view.latestVersion ?? "";
|
|
5709
5833
|
const updateAvailable = view !== null && view.updateAvailable;
|
|
5710
5834
|
const actionable = updateAvailable && view !== null && view.canApply && !settled && !busy;
|
|
5711
|
-
const manual = view !== null && (!view.canApply || view.checkFailed) ? view.manualCommand ?? null : null;
|
|
5712
5835
|
const currentVersion = view === null ? plugin.version : view.currentVersion ?? plugin.version;
|
|
5713
|
-
const copyCmd = () => {
|
|
5714
|
-
if (manual === void 0 || manual === null) return;
|
|
5715
|
-
void copyText(manual).then((ok) => {
|
|
5716
|
-
if (!ok) return;
|
|
5717
|
-
setCmdCopied(true);
|
|
5718
|
-
setTimeout(() => setCmdCopied(false), 1400);
|
|
5719
|
-
});
|
|
5720
|
-
};
|
|
5721
5836
|
function statusLine() {
|
|
5722
5837
|
if (status === "checking" || view === null) return { text: t("shell.update.checking"), kind: "muted" };
|
|
5723
5838
|
if (status === "applying") return { text: t("shell.update.applying", { version: latestVersion }), kind: "muted" };
|
|
@@ -5734,6 +5849,7 @@ function IdentityBar(props) {
|
|
|
5734
5849
|
return [
|
|
5735
5850
|
h(Btn, { key: "yes", small: true, variant: "danger", onClick: () => {
|
|
5736
5851
|
setConfirming(false);
|
|
5852
|
+
writePendingUpdate(currentVersion, latestVersion);
|
|
5737
5853
|
void controller.apply();
|
|
5738
5854
|
} }, t("shell.update.confirmYes")),
|
|
5739
5855
|
h(Btn, { key: "no", small: true, onClick: () => setConfirming(false) }, t("shell.update.cancel"))
|
|
@@ -5741,14 +5857,13 @@ function IdentityBar(props) {
|
|
|
5741
5857
|
}
|
|
5742
5858
|
return h(Btn, { small: true, variant: "primary", onClick: () => setConfirming(true) }, t("shell.update.apply", { version: latestVersion }));
|
|
5743
5859
|
}
|
|
5744
|
-
if (manual !== null) return h(Btn, { small: true, onClick: copyCmd }, cmdCopied ? t("shell.update.copied") : t("shell.update.copyCmd"));
|
|
5745
5860
|
return h(Btn, { small: true, disabled: busy, onClick: () => void controller.check({ fresh: true }) }, t("shell.update.check"));
|
|
5746
5861
|
}
|
|
5747
5862
|
const line = statusLine();
|
|
5748
5863
|
return h(
|
|
5749
5864
|
"div",
|
|
5750
5865
|
{ className: "dshgt-idbar" },
|
|
5751
|
-
h("div", { className: "dshgt-brand" },
|
|
5866
|
+
h("div", { className: "dshgt-brand" }, logo2(), h("span", { className: "dshgt-brand-name" }, t("section.title"))),
|
|
5752
5867
|
h("span", { className: "dshgt-id-ver dshgt-mono" }, `v${plugin.version}`),
|
|
5753
5868
|
h("span", { className: "dshgt-id-sep dshgt-id-sep-pkg" }),
|
|
5754
5869
|
h(
|
|
@@ -5758,7 +5873,7 @@ function IdentityBar(props) {
|
|
|
5758
5873
|
),
|
|
5759
5874
|
plugin.repository === void 0 ? null : [
|
|
5760
5875
|
h("span", { key: "gh-sep", className: "dshgt-id-sep dshgt-id-sep-gh" }),
|
|
5761
|
-
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") },
|
|
5876
|
+
h("a", { key: "gh", className: "dshgt-id-gh", href: plugin.repository, target: "_blank", rel: "noreferrer", title: t("about.repo"), "aria-label": t("about.repo") }, githubIcon())
|
|
5762
5877
|
],
|
|
5763
5878
|
h(
|
|
5764
5879
|
"div",
|
|
@@ -5773,6 +5888,31 @@ function IdentityBar(props) {
|
|
|
5773
5888
|
);
|
|
5774
5889
|
}
|
|
5775
5890
|
|
|
5891
|
+
// client/restore-notice.ts
|
|
5892
|
+
var AUTO_DISMISS_MS = 6e3;
|
|
5893
|
+
function RestoreNotice({ t, version, onDismiss }) {
|
|
5894
|
+
import_react.default.useEffect(() => {
|
|
5895
|
+
const timer = setTimeout(() => onDismiss(), AUTO_DISMISS_MS);
|
|
5896
|
+
return () => clearTimeout(timer);
|
|
5897
|
+
}, [onDismiss]);
|
|
5898
|
+
const title = version !== void 0 && version !== "" ? t("restoreNotice.title", { version }) : t("restoreNotice.titleBare");
|
|
5899
|
+
return h(
|
|
5900
|
+
"div",
|
|
5901
|
+
{ className: "dshgt-restore", role: "status", "aria-live": "polite" },
|
|
5902
|
+
h(
|
|
5903
|
+
"div",
|
|
5904
|
+
{ className: "dshgt-restore-text" },
|
|
5905
|
+
h("div", { className: "dshgt-restore-title" }, title),
|
|
5906
|
+
h("div", { className: "dshgt-restore-body" }, t("restoreNotice.body"))
|
|
5907
|
+
),
|
|
5908
|
+
h(
|
|
5909
|
+
"div",
|
|
5910
|
+
{ className: "dshgt-restore-actions" },
|
|
5911
|
+
h(Btn, { small: true, variant: "primary", onClick: () => onDismiss() }, t("restoreNotice.dismiss"))
|
|
5912
|
+
)
|
|
5913
|
+
);
|
|
5914
|
+
}
|
|
5915
|
+
|
|
5776
5916
|
// client/panel-icon.ts
|
|
5777
5917
|
var TREND_LINE = "3 16.5 9 10.5 13 14.5 21 6.5";
|
|
5778
5918
|
var TREND_ARROW = "15.5 6.5 21 6.5 21 12";
|
|
@@ -5908,6 +6048,10 @@ function apply(ctx) {
|
|
|
5908
6048
|
const [view, setView] = import_react.default.useState("overview");
|
|
5909
6049
|
const [digestTarget2, setDigestTarget] = import_react.default.useState(void 0);
|
|
5910
6050
|
const [aboutOpen, setAboutOpen] = import_react.default.useState(false);
|
|
6051
|
+
const [pendingUpdate, setPendingUpdate] = import_react.default.useState(null);
|
|
6052
|
+
import_react.default.useEffect(() => {
|
|
6053
|
+
setPendingUpdate(readPendingUpdate());
|
|
6054
|
+
}, []);
|
|
5911
6055
|
const openDigest = import_react.default.useCallback((target) => {
|
|
5912
6056
|
if (target !== void 0) setDigestTarget(target);
|
|
5913
6057
|
setView("digest");
|
|
@@ -6045,7 +6189,15 @@ function apply(ctx) {
|
|
|
6045
6189
|
h("div", { className: "dshgt-main-body" }, view === "settings" ? viewNode : h("div", { className: "dshgt-scroll" }, viewNode))
|
|
6046
6190
|
)
|
|
6047
6191
|
),
|
|
6048
|
-
aboutOpen && state !== null ? h(AboutDialog, { t, state, onClose: () => setAboutOpen(false) }) : null
|
|
6192
|
+
aboutOpen && state !== null ? h(AboutDialog, { t, state, onClose: () => setAboutOpen(false) }) : null,
|
|
6193
|
+
pendingUpdate ? h(RestoreNotice, {
|
|
6194
|
+
t,
|
|
6195
|
+
version: pendingUpdate.to,
|
|
6196
|
+
onDismiss: () => {
|
|
6197
|
+
clearPendingUpdate();
|
|
6198
|
+
setPendingUpdate(null);
|
|
6199
|
+
}
|
|
6200
|
+
}) : null
|
|
6049
6201
|
);
|
|
6050
6202
|
}
|
|
6051
6203
|
disposers.push(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morehao/dsh-github-trending",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.8",
|
|
4
4
|
"description": "GitHub 趋势日报的 DeepSeek Harness 插件:按日 / 周 / 月周期定时 spawn 本地 trendradar 核心,抓取 Trending、生成中文简介与周期总结,并可选把订阅仓库的新 Release 合成中文摘要,一起提交到你的仓库、自动开 PR 合并;内置概览 / 榜单 / 运行记录 / 订阅 / 设置工作台。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@morehao/dsh-plugin-kit": "^0.
|
|
54
|
+
"@morehao/dsh-plugin-kit": "^0.4.0",
|
|
55
55
|
"@morehao/trendradar-contract": "0.5.0"
|
|
56
56
|
},
|
|
57
57
|
"dsh": {
|