dsh-plugin-explorer 0.2.0 → 0.2.1

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.
Files changed (2) hide show
  1. package/client.js +12 -4
  2. package/package.json +1 -1
package/client.js CHANGED
@@ -38,6 +38,7 @@ window.__ModuleLoader__.load({
38
38
  sortName: '名称',
39
39
  installed: '已安装 v{version}',
40
40
  update: '更新到 v{version}',
41
+ updateHint: '打开已安装页,在那里完成更新',
41
42
  updateBadge: '有新版',
42
43
  scanTitle: '安装前安全检查',
43
44
  scanSubtitle: '{name}@{version}',
@@ -89,6 +90,7 @@ window.__ModuleLoader__.load({
89
90
  sortName: 'Name',
90
91
  installed: 'Installed v{version}',
91
92
  update: 'Update to v{version}',
93
+ updateHint: 'Open the Installed page and finish the update there',
92
94
  updateBadge: 'Update',
93
95
  scanTitle: 'Pre-install safety scan',
94
96
  scanSubtitle: '{name}@{version}',
@@ -475,7 +477,7 @@ window.__ModuleLoader__.load({
475
477
  }
476
478
 
477
479
  function FinderRow(props) {
478
- const { entry, install, onScan, installed, language, t } = props
480
+ const { entry, install, onScan, onOpen, installed, language, t } = props
479
481
  const [broken, setBroken] = useState(false)
480
482
  const description = entry.description?.[language] ?? entry.description?.en ?? entry.description?.zh
481
483
  const meta = [entry.owner, categoryLabel(entry.category, language)].filter(Boolean).join(' · ')
@@ -521,8 +523,13 @@ window.__ModuleLoader__.load({
521
523
  }, t('install'))
522
524
  : hasUpdate
523
525
  ? h('button', {
524
- type: 'button', className: 'pf-install',
525
- onClick: () => { startScan(latest) },
526
+ type: 'button', className: 'pf-install', title: t('updateHint'),
527
+ onClick: () => {
528
+ // The page's update slot only handles Git bundles; registry packages update on the
529
+ // Installed page, so jump there and let its own version check offer the update.
530
+ if (typeof onOpen === 'function') onOpen(entry.name)
531
+ else startScan(latest)
532
+ },
526
533
  }, t('update', { version: latest }))
527
534
  : null))
528
535
  }
@@ -602,6 +609,7 @@ window.__ModuleLoader__.load({
602
609
  function FinderTab(props) {
603
610
  const t = props.t
604
611
  const install = props.install
612
+ const openPackage = props.openPackage
605
613
  const [catalog, setCatalog] = useState(null)
606
614
  const [status, setStatus] = useState('loading')
607
615
  const [refreshing, setRefreshing] = useState(false)
@@ -755,7 +763,7 @@ window.__ModuleLoader__.load({
755
763
  ? h('div', { className: 'pf-state' }, t('empty'))
756
764
  : h('div', { className: 'pf-list' },
757
765
  shown.map(entry => h(FinderRow, {
758
- key: entry.name, entry, install, onScan: scanEntry, installed, language, t,
766
+ key: entry.name, entry, install, onScan: scanEntry, onOpen: openPackage, installed, language, t,
759
767
  }))),
760
768
  results.length > shown.length
761
769
  ? h('button', { type: 'button', className: 'pf-more', onClick: () => { setLimit(limit + PAGE_SIZE) } },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-explorer",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Search the community plugin catalog, run a pre-install safety scan, filter by category and update installed bundles from the Plugins page.",
5
5
  "license": "MIT",
6
6
  "repository": {