@nextclaw/ui 0.5.3 → 0.5.4
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/index.html
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
8
|
<title>NextClaw - 系统配置</title>
|
|
9
|
-
<script type="module" crossorigin src="/assets/index-
|
|
9
|
+
<script type="module" crossorigin src="/assets/index-CWt_NEq3.js"></script>
|
|
10
10
|
<link rel="stylesheet" crossorigin href="/assets/index-BHGBLfqi.css">
|
|
11
11
|
</head>
|
|
12
12
|
|
package/package.json
CHANGED
|
@@ -231,6 +231,7 @@ function MarketplaceListCard(props: {
|
|
|
231
231
|
onManage: (action: MarketplaceManageAction, record: MarketplaceInstalledRecord) => void;
|
|
232
232
|
}) {
|
|
233
233
|
const record = props.record;
|
|
234
|
+
const pluginRecord = record?.type === 'plugin' ? record : undefined;
|
|
234
235
|
const type = props.item?.type ?? record?.type;
|
|
235
236
|
const title = props.item?.name ?? record?.label ?? record?.id ?? record?.spec ?? 'Unknown Item';
|
|
236
237
|
const summary = props.item?.summary ?? (record ? 'Installed locally. Details are currently unavailable from marketplace.' : '');
|
|
@@ -239,11 +240,12 @@ function MarketplaceListCard(props: {
|
|
|
239
240
|
const targetId = record?.id || record?.spec;
|
|
240
241
|
const busyForRecord = Boolean(targetId) && props.manageState.isPending && props.manageState.targetId === targetId;
|
|
241
242
|
|
|
242
|
-
const canToggle =
|
|
243
|
+
const canToggle = Boolean(pluginRecord);
|
|
243
244
|
const canUninstallPlugin = record?.type === 'plugin' && record.origin !== 'bundled';
|
|
244
245
|
const canUninstallSkill = record?.type === 'skill' && record.source === 'workspace';
|
|
245
246
|
const canUninstall = Boolean(canUninstallPlugin || canUninstallSkill);
|
|
246
247
|
|
|
248
|
+
const isDisabled = record ? (record.enabled === false || record.runtimeStatus === 'disabled') : false;
|
|
247
249
|
const isInstalling = props.installState.isPending && props.item && props.installState.installingSpec === props.item.install.spec;
|
|
248
250
|
|
|
249
251
|
const displayType = type === 'plugin' ? 'Plugin' : type === 'skill' ? 'Skill' : 'Extension';
|
|
@@ -305,15 +307,15 @@ function MarketplaceListCard(props: {
|
|
|
305
307
|
</button>
|
|
306
308
|
)}
|
|
307
309
|
|
|
308
|
-
{
|
|
310
|
+
{pluginRecord && canToggle && (
|
|
309
311
|
<button
|
|
310
312
|
disabled={props.manageState.isPending}
|
|
311
|
-
onClick={() => props.onManage(
|
|
313
|
+
onClick={() => props.onManage(isDisabled ? 'enable' : 'disable', pluginRecord)}
|
|
312
314
|
className="inline-flex items-center h-8 px-4 rounded-full text-xs font-semibold border border-gray-200 text-gray-700 bg-white hover:bg-gray-50 hover:border-gray-300 disabled:opacity-50 transition-colors"
|
|
313
315
|
>
|
|
314
316
|
{busyForRecord && props.manageState.action !== 'uninstall'
|
|
315
317
|
? (props.manageState.action === 'enable' ? 'Enabling...' : 'Disabling...')
|
|
316
|
-
: (
|
|
318
|
+
: (isDisabled ? 'Enable' : 'Disable')}
|
|
317
319
|
</button>
|
|
318
320
|
)}
|
|
319
321
|
|
|
@@ -51,6 +51,8 @@ export function useInstallMarketplaceItem() {
|
|
|
51
51
|
mutationFn: (request: MarketplaceInstallRequest) => installMarketplaceItem(request),
|
|
52
52
|
onSuccess: (result) => {
|
|
53
53
|
queryClient.invalidateQueries({ queryKey: ['marketplace-installed'] });
|
|
54
|
+
queryClient.refetchQueries({ queryKey: ['marketplace-installed'], type: 'active' });
|
|
55
|
+
queryClient.refetchQueries({ queryKey: ['marketplace-items'], type: 'active' });
|
|
54
56
|
toast.success(result.message || `${result.type} installed`);
|
|
55
57
|
},
|
|
56
58
|
onError: (error: Error) => {
|
|
@@ -67,6 +69,8 @@ export function useManageMarketplaceItem() {
|
|
|
67
69
|
onSuccess: (result) => {
|
|
68
70
|
queryClient.invalidateQueries({ queryKey: ['marketplace-installed'] });
|
|
69
71
|
queryClient.invalidateQueries({ queryKey: ['marketplace-items'] });
|
|
72
|
+
queryClient.refetchQueries({ queryKey: ['marketplace-installed'], type: 'active' });
|
|
73
|
+
queryClient.refetchQueries({ queryKey: ['marketplace-items'], type: 'active' });
|
|
70
74
|
toast.success(result.message || `${result.action} success`);
|
|
71
75
|
},
|
|
72
76
|
onError: (error: Error) => {
|