@restregular/dsh-powerup 0.2.1 → 0.2.2
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 +49 -17
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
|
|
45
45
|
const NS = 'dsh-powerup';
|
|
46
46
|
const SETTINGS_KEY = 'dsh-powerup:settings:v1';
|
|
47
|
-
const VERSION = '0.2.
|
|
47
|
+
const VERSION = '0.2.2';
|
|
48
48
|
const MENU_GAP = 8;
|
|
49
49
|
const MENU_WIDTH = 248;
|
|
50
50
|
|
|
@@ -126,6 +126,8 @@
|
|
|
126
126
|
'update.versionsFailed': '读取版本失败:{message}',
|
|
127
127
|
'update.versionsEmpty': '安装源没有返回可用版本',
|
|
128
128
|
'update.latest': '最新',
|
|
129
|
+
'update.currentTag': '当前',
|
|
130
|
+
'update.currentAndLatest': '当前 · 最新',
|
|
129
131
|
'update.retry': '重试',
|
|
130
132
|
'update.registry': '安装源',
|
|
131
133
|
'update.registryDefault': '默认安装源',
|
|
@@ -246,6 +248,8 @@
|
|
|
246
248
|
'update.versionsFailed': 'Could not read versions: {message}',
|
|
247
249
|
'update.versionsEmpty': 'The registry returned no versions',
|
|
248
250
|
'update.latest': 'latest',
|
|
251
|
+
'update.currentTag': 'Current',
|
|
252
|
+
'update.currentAndLatest': 'Current · latest',
|
|
249
253
|
'update.retry': 'Retry',
|
|
250
254
|
'update.registry': 'Registry',
|
|
251
255
|
'update.registryDefault': 'Default registry',
|
|
@@ -696,10 +700,13 @@
|
|
|
696
700
|
.dsh-powerup-update-list{display:flex;flex-direction:column;max-height:240px;overflow-y:auto;border:.5px solid var(--dsw-alias-border-l2);border-radius:var(--dsw-radius-lg,10px);background:var(--dsw-alias-bg-layer-1);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2)}
|
|
697
701
|
.dsh-powerup-update-list-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:7px 12px;border-bottom:.5px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:16px}
|
|
698
702
|
.dsh-powerup-update-version{display:flex;align-items:center;gap:8px;width:100%;min-height:34px;padding:0 12px;border:0;background:transparent;color:var(--dsw-alias-label-primary);font:inherit;font-size:12.5px;line-height:18px;text-align:left;cursor:pointer;font-variant-numeric:tabular-nums}
|
|
703
|
+
.dsh-powerup-update-version>span:first-child{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
|
|
699
704
|
.dsh-powerup-update-version:hover{background:var(--dsw-alias-interactive-bg-hover)}
|
|
700
705
|
.dsh-powerup-update-version[aria-selected=true]{background:var(--dsw-alias-interactive-bg-active)}
|
|
701
|
-
.dsh-powerup-update-
|
|
702
|
-
.dsh-powerup-update-
|
|
706
|
+
.dsh-powerup-update-version[data-current]{box-shadow:inset 2px 0 0 var(--dsw-alias-state-business-primary)}
|
|
707
|
+
.dsh-powerup-update-trailing{display:inline-flex;flex:none;align-items:center;gap:8px;margin-left:auto;white-space:nowrap}
|
|
708
|
+
.dsh-powerup-update-tag{padding:0 6px;border:.5px solid var(--dsw-alias-border-l2);border-radius:999px;background:transparent;color:var(--dsw-alias-label-tertiary);font-size:10px;line-height:16px;white-space:nowrap}
|
|
709
|
+
.dsh-powerup-update-tag.is-current{border-color:color-mix(in srgb,var(--dsw-alias-state-business-primary) 38%,transparent);background:color-mix(in srgb,var(--dsw-alias-state-business-primary) 8%,transparent);color:var(--dsw-alias-state-business-primary)}
|
|
703
710
|
.dsh-powerup-update-check{display:inline-flex;color:var(--dsw-alias-state-business-primary)}
|
|
704
711
|
.dsh-powerup-update-status{display:flex;align-items:center;gap:10px;color:var(--dsw-alias-label-secondary);font-size:13px;line-height:20px}
|
|
705
712
|
.dsh-powerup-update-spinner{flex:none;width:14px;height:14px;border:2px solid color-mix(in srgb,var(--dsw-alias-state-business-primary) 24%,transparent);border-top-color:var(--dsw-alias-state-business-primary);border-radius:50%;animation:dsh-powerup-spin .8s linear infinite}
|
|
@@ -1342,6 +1349,24 @@
|
|
|
1342
1349
|
return list.sort(compareVersionsDesc);
|
|
1343
1350
|
}
|
|
1344
1351
|
|
|
1352
|
+
/**
|
|
1353
|
+
* Which status a version row carries. The installed and the latest
|
|
1354
|
+
* version can be the same; that row gets one combined tag instead of two
|
|
1355
|
+
* chips sharing the trailing space.
|
|
1356
|
+
* @param {string} version
|
|
1357
|
+
* @param {string | null | undefined} current
|
|
1358
|
+
* @param {string | null | undefined} latest
|
|
1359
|
+
* @returns {'current-latest' | 'current' | 'latest' | null}
|
|
1360
|
+
*/
|
|
1361
|
+
function versionTagKind(version, current, latest) {
|
|
1362
|
+
const isCurrent = typeof current === 'string' && current !== '' && version === current;
|
|
1363
|
+
const isLatest = typeof latest === 'string' && latest !== '' && version === latest;
|
|
1364
|
+
if (isCurrent && isLatest) return 'current-latest';
|
|
1365
|
+
if (isCurrent) return 'current';
|
|
1366
|
+
if (isLatest) return 'latest';
|
|
1367
|
+
return null;
|
|
1368
|
+
}
|
|
1369
|
+
|
|
1345
1370
|
/**
|
|
1346
1371
|
* Read the versions the registry publishes for one package. The
|
|
1347
1372
|
* abbreviated metadata keeps the response small; both npm and npmmirror
|
|
@@ -1952,20 +1977,26 @@
|
|
|
1952
1977
|
? null
|
|
1953
1978
|
: h('span', { title: view.versionsRegistry.hint }, view.versionsRegistry.hint),
|
|
1954
1979
|
),
|
|
1955
|
-
...view.versions.map((version) =>
|
|
1956
|
-
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1980
|
+
...view.versions.map((version) => {
|
|
1981
|
+
const tagKind = versionTagKind(version, view.currentVersion, view.latest);
|
|
1982
|
+
return h('button', {
|
|
1983
|
+
key: version,
|
|
1984
|
+
type: 'button',
|
|
1985
|
+
role: 'option',
|
|
1986
|
+
className: 'dsh-powerup-update-version',
|
|
1987
|
+
'aria-selected': version === view.version ? 'true' : 'false',
|
|
1988
|
+
'data-current': version === view.currentVersion ? '' : undefined,
|
|
1989
|
+
onClick: () => chooseVersion(version),
|
|
1990
|
+
},
|
|
1991
|
+
h('span', null, version),
|
|
1992
|
+
h('span', { className: 'dsh-powerup-update-trailing' },
|
|
1993
|
+
tagKind === null ? null : h('span', {
|
|
1994
|
+
className: `dsh-powerup-update-tag${tagKind === 'latest' ? '' : ' is-current'}`,
|
|
1995
|
+
}, t(tagKind === 'current-latest' ? 'update.currentAndLatest' : tagKind === 'current' ? 'update.currentTag' : 'update.latest')),
|
|
1996
|
+
version === view.version ? h('span', { className: 'dsh-powerup-update-check' }, h(CheckIcon, { size: 13 })) : null,
|
|
1997
|
+
),
|
|
1998
|
+
);
|
|
1999
|
+
}),
|
|
1969
2000
|
];
|
|
1970
2001
|
})();
|
|
1971
2002
|
return [
|
|
@@ -2524,6 +2555,7 @@
|
|
|
2524
2555
|
buildRowItems,
|
|
2525
2556
|
buildSessionItems,
|
|
2526
2557
|
sortVersions,
|
|
2558
|
+
versionTagKind,
|
|
2527
2559
|
compareVersionsDesc,
|
|
2528
2560
|
buildRegistryChoices,
|
|
2529
2561
|
pickRegistryChoice,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@restregular/dsh-powerup",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "Power-Up — small, opt-in upgrades for DeepSeek Harness. Adds a right-click action menu to the Trajectory ledger and an update control for third-party plugins installed from the Plugins page, with version lookup, uninstall-and-reinstall through the Add plugin path, and an optional DSH restart. · 为 DeepSeek Harness 提供小型增强:在轨迹页面右键记录即可复制、引用、查看详情或从该记录 Fork;并在插件页为第三方已安装插件提供带版本查询的更新按钮,沿用「添加插件」的安装流程,并可重启 DSH 使更改生效。",
|
|
5
5
|
"icon": "./icon.svg",
|
|
6
6
|
"type": "module",
|