@nextclaw/ui 0.14.1-beta.0 → 0.14.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.
- package/CHANGELOG.md +50 -0
- package/dist/assets/{api-C6EDHBDR.js → api-DPcvCLfa.js} +3 -3
- package/dist/assets/{channels-list-page-DKj6m1Hc.js → channels-list-page-D6jtziu4.js} +2 -2
- package/dist/assets/chat-page-BBnNJoKG.js +105 -0
- package/dist/assets/{config-split-page-CjlmJy8X.js → config-split-page-BCJhqdK9.js} +1 -1
- package/dist/assets/{confirm-dialog-B39X0pYp.js → confirm-dialog-CWh5FfK2.js} +1 -1
- package/dist/assets/{desktop-update-config-DfUQ8nly.js → desktop-update-config-DsRhBizi.js} +1 -1
- package/dist/assets/{dist-CmMro3nV.js → dist-DPrgcEC0.js} +1 -1
- package/dist/assets/{dist-BIYV2-Ia.js → dist-DsE4OsSS.js} +1 -1
- package/dist/assets/doc-browser-C8xOF_9F.js +1 -0
- package/dist/assets/{doc-browser-CDtUtcim.js → doc-browser-DgQedeAn.js} +1 -1
- package/dist/assets/{doc-browser-context-DZbC9zVB.js → doc-browser-context-B46tQGmO.js} +1 -1
- package/dist/assets/{ellipsis-DDpgTzgx.js → ellipsis-B81FStLm.js} +1 -1
- package/dist/assets/{external-link-D2cBOCqn.js → external-link-C_dmG-WJ.js} +1 -1
- package/dist/assets/index-7o1WdUbU.js +103 -0
- package/dist/assets/index-DQWmEWzk.css +1 -0
- package/dist/assets/mcp-marketplace-page-CWZN7ohK.js +1 -0
- package/dist/assets/mcp-marketplace-page-Dzull_4-.js +40 -0
- package/dist/assets/model-config-page-Cv0O3BIj.js +1 -0
- package/dist/assets/plus-Bnt56oqG.js +1 -0
- package/dist/assets/provider-scoped-model-input-Duuh7i3h.js +1 -0
- package/dist/assets/providers-config-page-CPDz0Lxc.js +1 -0
- package/dist/assets/{react-DYQXXGbH.js → react-sZz5HSCm.js} +1 -1
- package/dist/assets/remote-B0LMs8u7.js +1 -0
- package/dist/assets/rotate-cw-BfyG_KEF.js +1 -0
- package/dist/assets/runtime-config-page-q0fvv8ME.js +1 -0
- package/dist/assets/{save-BNVTgBVn.js → save-MzjoiHri.js} +1 -1
- package/dist/assets/{search-CKCzwLId.js → search-B29dE4GN.js} +1 -1
- package/dist/assets/{search-config-page-DG5Q2hF1.js → search-config-page-Dl5sZzob.js} +1 -1
- package/dist/assets/secrets-config-page-C_l-IFCK.js +3 -0
- package/dist/assets/{select-CIRwTNP4.js → select-BKmh05hd.js} +2 -2
- package/dist/assets/{tag-chip-DKhVFtTE.js → tag-chip-BS_7Ueom.js} +1 -1
- package/dist/assets/use-config-DZkBWIdL.js +1 -0
- package/dist/assets/x-CW2KO-Hz.js +1 -0
- package/dist/index.html +14 -14
- package/package.json +9 -9
- package/src/features/chat/components/conversation/__tests__/chat-conversation-panel.test.tsx +12 -63
- package/src/features/chat/components/conversation/chat-conversation-content.tsx +11 -50
- package/src/features/chat/components/conversation/chat-conversation-panel.tsx +15 -2
- package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +70 -7
- package/src/features/chat/components/layout/chat-sidebar-toolbar.tsx +104 -16
- package/src/features/chat/components/layout/chat-sidebar.tsx +21 -2
- package/src/features/chat/features/input/components/chat-input-bar.container.tsx +84 -6
- package/src/features/chat/features/input/hooks/use-chat-input-bar-query-state.ts +2 -0
- package/src/features/chat/features/input/hooks/use-chat-model-favorites.ts +88 -0
- package/src/features/chat/features/input/utils/__tests__/chat-input-bar.utils.test.ts +64 -24
- package/src/features/chat/features/input/utils/__tests__/ncp-chat-input-availability.utils.test.ts +1 -0
- package/src/features/chat/features/input/utils/chat-input-bar.utils.ts +21 -12
- package/src/features/chat/features/input/utils/chat-input-toolbar.utils.ts +80 -25
- package/src/features/chat/features/message/utils/__tests__/chat-message-file-operation.utils.test.ts +310 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-test.utils.ts +43 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message.utils.test.ts +1 -346
- package/src/features/chat/features/message/utils/chat-message-tool-card.utils.ts +10 -9
- package/src/features/chat/features/message/utils/file-operation/diff.utils.ts +39 -36
- package/src/features/chat/features/message/utils/file-operation/line-builder.utils.ts +46 -38
- package/src/features/chat/features/message/utils/file-operation/parsed-block.utils.ts +18 -15
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +3 -2
- package/src/features/chat/features/session/components/session-header/__tests__/chat-session-project-badge.test.tsx +25 -25
- package/src/features/chat/features/session/components/session-header/chat-session-project-badge.tsx +15 -2
- package/src/features/chat/features/session-type/components/__tests__/chat-session-type-menu.test.tsx +24 -0
- package/src/features/chat/features/session-type/components/__tests__/chat-session-type-option-item.test.tsx +27 -1
- package/src/features/chat/features/session-type/components/{chat-sidebar-create-menu.tsx → chat-session-type-menu.tsx} +17 -4
- package/src/features/chat/features/session-type/components/chat-session-type-option-item.tsx +15 -3
- package/src/features/chat/features/session-type/hooks/__tests__/use-chat-new-session-type-preference.test.tsx +152 -0
- package/src/features/chat/features/session-type/hooks/use-chat-new-session-type-preference.ts +159 -0
- package/src/features/chat/features/welcome/components/__tests__/chat-conversation-welcome.test.tsx +193 -0
- package/src/features/chat/features/welcome/components/__tests__/chat-welcome.test.tsx +123 -0
- package/src/features/chat/features/welcome/components/chat-conversation-welcome.tsx +104 -0
- package/src/features/chat/features/welcome/components/chat-welcome-agent-picker.tsx +72 -0
- package/src/features/chat/features/welcome/components/chat-welcome-capability-grid.tsx +54 -0
- package/src/features/chat/features/welcome/components/chat-welcome-project-picker.tsx +132 -0
- package/src/features/chat/features/welcome/components/chat-welcome-session-type-picker.tsx +82 -0
- package/src/features/chat/features/welcome/components/chat-welcome.tsx +121 -0
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-project-options.utils.test.ts +53 -0
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-selection.utils.test.ts +63 -0
- package/src/features/chat/features/welcome/utils/__tests__/chat-welcome-visibility.utils.test.ts +34 -0
- package/src/features/chat/features/welcome/utils/chat-welcome-project-options.utils.ts +71 -0
- package/src/features/chat/features/welcome/utils/chat-welcome-selection.utils.ts +79 -0
- package/src/features/chat/features/welcome/utils/chat-welcome-visibility.utils.ts +17 -0
- package/src/features/chat/managers/__tests__/chat-input.manager.test.ts +65 -0
- package/src/features/chat/managers/chat-input.manager.ts +24 -2
- package/src/features/chat/stores/chat-input.store.ts +2 -0
- package/src/features/chat/types/chat-input-bar.types.ts +5 -0
- package/src/features/marketplace/components/__tests__/marketplace-page.test.tsx +24 -0
- package/src/features/marketplace/components/curated-shelves/marketplace-shelf-card.tsx +8 -3
- package/src/features/marketplace/components/marketplace-item-list-view.tsx +2 -2
- package/src/features/marketplace/components/marketplace-list-card.tsx +124 -98
- package/src/features/marketplace/components/marketplace-page-parts.tsx +11 -6
- package/src/features/marketplace/utils/marketplace-installed-cache.utils.ts +27 -23
- package/src/features/settings/components/config/provider-form.tsx +284 -387
- package/src/features/settings/components/config/provider-status-badge.tsx +4 -4
- package/src/features/settings/components/config/secrets-config-form.tsx +11 -135
- package/src/features/settings/hooks/use-provider-auth-flow.ts +140 -0
- package/src/features/settings/pages/__tests__/model-config-page.test.tsx +16 -0
- package/src/features/settings/pages/secrets-config-page.tsx +2 -1
- package/src/features/settings/utils/__tests__/provider-form-support.utils.test.ts +60 -1
- package/src/features/settings/utils/__tests__/secrets-config-form.utils.test.ts +66 -0
- package/src/features/settings/utils/provider-form-context.utils.ts +131 -0
- package/src/features/settings/utils/provider-form-model.utils.ts +101 -0
- package/src/features/settings/utils/provider-form-support.utils.ts +102 -1
- package/src/features/settings/utils/secrets-config-form.utils.ts +139 -0
- package/src/features/system-status/components/config/runtime-agent-list-card.tsx +17 -11
- package/src/features/system-status/components/config/runtime-binding-list-card.tsx +14 -9
- package/src/features/system-status/components/config/runtime-config-editor.tsx +8 -5
- package/src/features/system-status/components/config/runtime-entry-list-card.tsx +14 -9
- package/src/features/system-status/components/config/runtime-settings-card.tsx +16 -7
- package/src/features/system-status/components/runtime-security-card.tsx +79 -25
- package/src/shared/components/common/__tests__/agent-avatar.test.tsx +3 -1
- package/src/shared/components/common/__tests__/searchable-model-input.test.tsx +34 -0
- package/src/shared/components/common/agent-avatar.tsx +5 -2
- package/src/shared/components/common/provider-scoped-model-input.tsx +1 -0
- package/src/shared/components/common/searchable-model-input.tsx +102 -87
- package/src/shared/components/ui/README.md +7 -0
- package/src/shared/components/ui/popover.tsx +19 -3
- package/src/shared/components/ui/select.tsx +14 -4
- package/src/shared/hooks/use-infinite-scroll-loader.ts +14 -10
- package/src/shared/lib/api/index.ts +3 -0
- package/src/shared/lib/api/preferences/preference-keys.config.ts +9 -0
- package/src/shared/lib/api/preferences/preference.types.ts +22 -0
- package/src/shared/lib/api/preferences/preference.utils.ts +40 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +16 -1
- package/src/shared/lib/i18n/locales/en-US/core.json +1 -0
- package/src/shared/lib/i18n/locales/en-US/marketplace.json +2 -0
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +16 -1
- package/src/shared/lib/i18n/locales/zh-CN/core.json +1 -0
- package/src/shared/lib/i18n/locales/zh-CN/marketplace.json +2 -0
- package/dist/assets/chat-page-BXngLJY6.js +0 -105
- package/dist/assets/doc-browser-B6Wc_TIY.js +0 -1
- package/dist/assets/index-DTb_XVIH.js +0 -103
- package/dist/assets/index-ayiPYhf1.css +0 -1
- package/dist/assets/mcp-marketplace-page-DZ9H0v05.js +0 -1
- package/dist/assets/mcp-marketplace-page-cnVWf7QQ.js +0 -40
- package/dist/assets/model-config-page-Bcb35AVv.js +0 -1
- package/dist/assets/plus-CYE1onU2.js +0 -1
- package/dist/assets/provider-scoped-model-input-kdoNp4HG.js +0 -1
- package/dist/assets/providers-config-page-CQSibSwO.js +0 -1
- package/dist/assets/remote-BlJDbXOI.js +0 -1
- package/dist/assets/rotate-cw-BWbvFDAX.js +0 -1
- package/dist/assets/runtime-config-page-Tn2yLQ0c.js +0 -1
- package/dist/assets/secrets-config-page-BXn5Uuwp.js +0 -3
- package/dist/assets/use-config-DgKM9VIU.js +0 -1
- package/dist/assets/x-Cm3JjYut.js +0 -1
- package/src/features/chat/components/__tests__/chat-welcome.test.tsx +0 -45
- package/src/features/chat/components/chat-welcome.tsx +0 -102
|
@@ -127,8 +127,8 @@ export function MarketplaceItemListView({
|
|
|
127
127
|
<div
|
|
128
128
|
data-testid={showSkeleton ? "marketplace-list-skeleton" : undefined}
|
|
129
129
|
className={cn(
|
|
130
|
-
"grid grid-cols-1 gap-
|
|
131
|
-
showSkeleton && "min-h-0 flex-1 auto-rows-[
|
|
130
|
+
"grid grid-cols-1 gap-2.5 md:grid-cols-2 xl:grid-cols-3",
|
|
131
|
+
showSkeleton && "min-h-0 flex-1 auto-rows-[156px] content-start",
|
|
132
132
|
)}
|
|
133
133
|
>
|
|
134
134
|
{showSkeleton && <MarketplaceListSkeleton count={36} />}
|
|
@@ -37,7 +37,6 @@ type MarketplaceListCardActionProps = {
|
|
|
37
37
|
record?: MarketplaceInstalledRecord;
|
|
38
38
|
state: {
|
|
39
39
|
isInstalling: boolean;
|
|
40
|
-
isDisabled: boolean;
|
|
41
40
|
canUpdate: boolean;
|
|
42
41
|
canUninstall: boolean;
|
|
43
42
|
busyAction?: MarketplaceManageAction;
|
|
@@ -52,17 +51,15 @@ type MarketplaceListCardActionProps = {
|
|
|
52
51
|
function MarketplaceListCardMeta({
|
|
53
52
|
title,
|
|
54
53
|
spec,
|
|
55
|
-
summary,
|
|
56
54
|
}: {
|
|
57
55
|
title: string;
|
|
58
56
|
spec: string;
|
|
59
|
-
summary: string;
|
|
60
57
|
}) {
|
|
61
58
|
return (
|
|
62
59
|
<TooltipProvider delayDuration={400}>
|
|
63
60
|
<Tooltip>
|
|
64
61
|
<TooltipTrigger asChild>
|
|
65
|
-
<div className="truncate text-[14px] font-semibold leading-tight text-gray-
|
|
62
|
+
<div className="truncate text-[14px] font-semibold leading-tight text-gray-950">
|
|
66
63
|
{title}
|
|
67
64
|
</div>
|
|
68
65
|
</TooltipTrigger>
|
|
@@ -71,11 +68,11 @@ function MarketplaceListCardMeta({
|
|
|
71
68
|
</TooltipContent>
|
|
72
69
|
</Tooltip>
|
|
73
70
|
|
|
74
|
-
<div className="mb-
|
|
71
|
+
<div className="mb-2 mt-1 flex min-w-0 items-center gap-1.5">
|
|
75
72
|
{spec ? (
|
|
76
73
|
<Tooltip>
|
|
77
74
|
<TooltipTrigger asChild>
|
|
78
|
-
<span className="max-w-full truncate text-[11px] font-mono text-gray-400">
|
|
75
|
+
<span className="max-w-full truncate text-[11px] font-mono leading-tight text-gray-400">
|
|
79
76
|
{spec}
|
|
80
77
|
</span>
|
|
81
78
|
</TooltipTrigger>
|
|
@@ -85,15 +82,11 @@ function MarketplaceListCardMeta({
|
|
|
85
82
|
</Tooltip>
|
|
86
83
|
) : null}
|
|
87
84
|
</div>
|
|
88
|
-
|
|
89
|
-
<p className="line-clamp-2 text-left text-[12px] leading-relaxed text-gray-500/90">
|
|
90
|
-
{summary}
|
|
91
|
-
</p>
|
|
92
85
|
</TooltipProvider>
|
|
93
86
|
);
|
|
94
87
|
}
|
|
95
88
|
|
|
96
|
-
function
|
|
89
|
+
function MarketplaceListCardActionButtons(props: MarketplaceListCardActionProps) {
|
|
97
90
|
const {
|
|
98
91
|
item,
|
|
99
92
|
record,
|
|
@@ -103,96 +96,94 @@ function MarketplaceListCardActions(props: MarketplaceListCardActionProps) {
|
|
|
103
96
|
} = props;
|
|
104
97
|
const {
|
|
105
98
|
isInstalling,
|
|
106
|
-
isDisabled,
|
|
107
99
|
canUpdate,
|
|
108
100
|
canUninstall,
|
|
109
101
|
busyAction,
|
|
110
102
|
} = state;
|
|
111
103
|
const busyForRecord = Boolean(busyAction);
|
|
112
104
|
const hasActions = Boolean((item && !record) || (record && (canUpdate || canUninstall)));
|
|
105
|
+
if (!hasActions) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
113
108
|
|
|
114
109
|
return (
|
|
115
110
|
<div
|
|
116
111
|
className={cn(
|
|
117
|
-
"
|
|
118
|
-
|
|
112
|
+
"flex shrink-0 items-center justify-end gap-1.5 opacity-100 transition-opacity duration-150",
|
|
113
|
+
"md:pointer-events-none md:opacity-0",
|
|
114
|
+
"md:group-hover:pointer-events-auto md:group-hover:opacity-100",
|
|
115
|
+
"md:group-focus-within:pointer-events-auto md:group-focus-within:opacity-100",
|
|
119
116
|
)}
|
|
120
117
|
>
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
118
|
+
{item && !record && (
|
|
119
|
+
<button
|
|
120
|
+
onClick={(event) => {
|
|
121
|
+
event.stopPropagation();
|
|
122
|
+
onInstall(item);
|
|
123
|
+
}}
|
|
124
|
+
disabled={isInstalling}
|
|
125
|
+
className="inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md bg-primary px-2 text-[11px] font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50"
|
|
126
|
+
>
|
|
127
|
+
<Download className="h-3 w-3" />
|
|
128
|
+
{isInstalling ? t("marketplaceInstalling") : t("marketplaceInstall")}
|
|
129
|
+
</button>
|
|
130
|
+
)}
|
|
131
131
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
<
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
className="inline-flex h-8 items-center gap-1.5 whitespace-nowrap rounded-xl bg-primary px-3 text-xs font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50"
|
|
148
|
-
>
|
|
149
|
-
<Download className="h-3.5 w-3.5" />
|
|
150
|
-
{isInstalling ? t("marketplaceInstalling") : t("marketplaceInstall")}
|
|
151
|
-
</button>
|
|
152
|
-
)}
|
|
132
|
+
{record && canUpdate && (
|
|
133
|
+
<button
|
|
134
|
+
disabled={busyForRecord}
|
|
135
|
+
onClick={(event) => {
|
|
136
|
+
event.stopPropagation();
|
|
137
|
+
onManage("update", record);
|
|
138
|
+
}}
|
|
139
|
+
className="inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-blue-200/80 bg-white px-2 text-[11px] font-medium text-blue-600 transition-colors hover:border-blue-300 hover:bg-blue-50 disabled:opacity-50"
|
|
140
|
+
>
|
|
141
|
+
<RefreshCw className="h-3 w-3" />
|
|
142
|
+
{busyAction === "update"
|
|
143
|
+
? t("marketplaceUpdating")
|
|
144
|
+
: t("marketplaceUpdate")}
|
|
145
|
+
</button>
|
|
146
|
+
)}
|
|
153
147
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
148
|
+
{record && canUninstall && (
|
|
149
|
+
<button
|
|
150
|
+
disabled={busyForRecord}
|
|
151
|
+
onClick={(event) => {
|
|
152
|
+
event.stopPropagation();
|
|
153
|
+
onManage("uninstall", record);
|
|
154
|
+
}}
|
|
155
|
+
className="inline-flex h-6 items-center gap-1 whitespace-nowrap rounded-md border border-gray-200/80 bg-white px-2 text-[11px] font-medium text-gray-500 transition-colors hover:border-rose-200 hover:bg-rose-50 hover:text-rose-600 disabled:opacity-50"
|
|
156
|
+
>
|
|
157
|
+
<Trash2 className="h-3 w-3" />
|
|
158
|
+
{busyAction === "uninstall"
|
|
159
|
+
? t("marketplaceRemoving")
|
|
160
|
+
: t("marketplaceUninstall")}
|
|
161
|
+
</button>
|
|
162
|
+
)}
|
|
163
|
+
</div>
|
|
164
|
+
);
|
|
165
|
+
}
|
|
169
166
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
? t("marketplaceRemoving")
|
|
182
|
-
: t("marketplaceUninstall")}
|
|
183
|
-
</button>
|
|
184
|
-
)}
|
|
185
|
-
</div>
|
|
167
|
+
function MarketplaceListCardStatus(props: {
|
|
168
|
+
record?: MarketplaceInstalledRecord;
|
|
169
|
+
disabled: boolean;
|
|
170
|
+
}) {
|
|
171
|
+
const { record, disabled } = props;
|
|
172
|
+
if (!record) {
|
|
173
|
+
return null;
|
|
174
|
+
}
|
|
175
|
+
return (
|
|
176
|
+
<div className="flex h-5 w-5 shrink-0 items-center justify-end">
|
|
177
|
+
<MarketplaceInstalledStatusIcon disabled={disabled} />
|
|
186
178
|
</div>
|
|
187
179
|
);
|
|
188
180
|
}
|
|
189
181
|
|
|
190
182
|
function MarketplaceInstalledStatusIcon(props: { disabled: boolean }) {
|
|
191
183
|
const { disabled } = props;
|
|
192
|
-
const { language } = useI18n();
|
|
193
184
|
const label = disabled
|
|
194
|
-
?
|
|
195
|
-
:
|
|
185
|
+
? t("marketplaceDisabledStatus")
|
|
186
|
+
: t("marketplaceInstalledStatus");
|
|
196
187
|
|
|
197
188
|
return (
|
|
198
189
|
<TooltipProvider delayDuration={300}>
|
|
@@ -251,6 +242,7 @@ export function MarketplaceListCard(props: {
|
|
|
251
242
|
pickLocalizedText(item?.summaryI18n, item?.summary, localeFallbacks) ||
|
|
252
243
|
(record ? t("marketplaceInstalledLocalSummary") : "");
|
|
253
244
|
const spec = item?.install.spec ?? record?.spec ?? "";
|
|
245
|
+
const tags = item?.tags ?? [];
|
|
254
246
|
const targetId = record?.id || record?.spec;
|
|
255
247
|
const busyAction = targetId
|
|
256
248
|
? manageState.actionsByTarget.get(targetId)
|
|
@@ -268,35 +260,69 @@ export function MarketplaceListCard(props: {
|
|
|
268
260
|
return (
|
|
269
261
|
<article
|
|
270
262
|
onClick={onOpen}
|
|
271
|
-
className="group flex
|
|
263
|
+
className="group flex h-full min-h-[156px] cursor-pointer flex-col rounded-xl border border-gray-200/60 bg-white p-3.5 shadow-sm transition-colors hover:border-gray-300 hover:bg-gray-50/60"
|
|
272
264
|
>
|
|
273
|
-
<div className="flex min-w-0
|
|
265
|
+
<div className="flex min-w-0 items-start gap-2.5">
|
|
274
266
|
<MarketplaceItemIcon
|
|
275
267
|
name={title}
|
|
276
268
|
fallback={spec || t("marketplaceTypeSkill")}
|
|
269
|
+
className="h-9 w-9 rounded-lg text-xs"
|
|
277
270
|
/>
|
|
278
|
-
<div className="flex min-w-0 flex-1 flex-col
|
|
279
|
-
<MarketplaceListCardMeta title={title} spec={spec}
|
|
271
|
+
<div className="flex min-w-0 flex-1 flex-col">
|
|
272
|
+
<MarketplaceListCardMeta title={title} spec={spec} />
|
|
280
273
|
</div>
|
|
274
|
+
|
|
275
|
+
<MarketplaceListCardStatus record={record} disabled={isDisabled} />
|
|
281
276
|
</div>
|
|
282
277
|
|
|
283
|
-
<
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
278
|
+
<div className="mt-2 flex min-w-0 flex-1 flex-col">
|
|
279
|
+
<p className="line-clamp-2 text-left text-[12px] leading-relaxed text-gray-500">
|
|
280
|
+
{summary}
|
|
281
|
+
</p>
|
|
282
|
+
|
|
283
|
+
<div className="mt-auto flex min-w-0 items-end justify-between gap-2 pt-2">
|
|
284
|
+
<div className="min-w-0 flex-1">
|
|
285
|
+
<MarketplaceListCardTags tags={tags} />
|
|
286
|
+
</div>
|
|
287
|
+
<MarketplaceListCardActionButtons
|
|
288
|
+
item={item}
|
|
289
|
+
record={record}
|
|
290
|
+
state={{
|
|
291
|
+
isInstalling,
|
|
292
|
+
canUpdate,
|
|
293
|
+
canUninstall,
|
|
294
|
+
busyAction,
|
|
295
|
+
}}
|
|
296
|
+
onInstall={onInstall}
|
|
297
|
+
onManage={onManage}
|
|
298
|
+
/>
|
|
299
|
+
</div>
|
|
300
|
+
</div>
|
|
296
301
|
</article>
|
|
297
302
|
);
|
|
298
303
|
}
|
|
299
304
|
|
|
300
|
-
function
|
|
301
|
-
|
|
305
|
+
function MarketplaceListCardTags({ tags }: { tags: string[] }) {
|
|
306
|
+
const visibleTags = tags.filter(isVisibleMarketplaceTag).slice(0, 3);
|
|
307
|
+
if (visibleTags.length === 0) {
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return (
|
|
312
|
+
<div className="flex min-w-0 flex-wrap gap-1.5 overflow-hidden">
|
|
313
|
+
{visibleTags.map((tag) => (
|
|
314
|
+
<span
|
|
315
|
+
key={tag}
|
|
316
|
+
className="max-w-[104px] truncate rounded-md bg-gray-100 px-2 py-0.5 text-[11px] font-medium leading-5 text-gray-500"
|
|
317
|
+
>
|
|
318
|
+
{tag}
|
|
319
|
+
</span>
|
|
320
|
+
))}
|
|
321
|
+
</div>
|
|
322
|
+
);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
function isVisibleMarketplaceTag(tag: string) {
|
|
326
|
+
const normalized = tag.trim().toLowerCase();
|
|
327
|
+
return normalized.length > 0 && normalized !== "skill";
|
|
302
328
|
}
|
|
@@ -78,21 +78,26 @@ export function MarketplaceListSkeleton({ count }: {
|
|
|
78
78
|
{Array.from({ length: count }, (_, index) => (
|
|
79
79
|
<article
|
|
80
80
|
key={`marketplace-skeleton-${index}`}
|
|
81
|
-
className="h-full rounded-
|
|
81
|
+
className="h-full rounded-xl border border-gray-200/60 bg-white p-3.5 shadow-sm"
|
|
82
82
|
>
|
|
83
|
-
<div className="flex items-start justify-between gap-
|
|
84
|
-
<div className="flex min-w-0 flex-1 gap-
|
|
85
|
-
<Skeleton className="h-
|
|
86
|
-
<div className="min-w-0 flex-1 space-y-2
|
|
83
|
+
<div className="flex items-start justify-between gap-2.5">
|
|
84
|
+
<div className="flex min-w-0 flex-1 gap-2.5">
|
|
85
|
+
<Skeleton className="h-9 w-9 shrink-0 rounded-lg" />
|
|
86
|
+
<div className="min-w-0 flex-1 space-y-2">
|
|
87
87
|
<Skeleton className="h-4 w-32 max-w-[70%]" />
|
|
88
88
|
<div className="flex items-center gap-2">
|
|
89
89
|
<Skeleton className="h-3 w-12" />
|
|
90
90
|
<Skeleton className="h-3 w-24" />
|
|
91
91
|
</div>
|
|
92
92
|
<Skeleton className="h-3 w-full" />
|
|
93
|
+
<div className="flex gap-1.5 pt-0.5">
|
|
94
|
+
<Skeleton className="h-5 w-14 rounded-md" />
|
|
95
|
+
<Skeleton className="h-5 w-16 rounded-md" />
|
|
96
|
+
<Skeleton className="h-5 w-12 rounded-md" />
|
|
97
|
+
</div>
|
|
93
98
|
</div>
|
|
94
99
|
</div>
|
|
95
|
-
<Skeleton className="h-
|
|
100
|
+
<Skeleton className="h-7 w-16 shrink-0 rounded-md" />
|
|
96
101
|
</div>
|
|
97
102
|
</article>
|
|
98
103
|
))}
|
|
@@ -16,29 +16,30 @@ function buildInstalledRecordFromInstall(params: {
|
|
|
16
16
|
request: MarketplaceInstallRequest;
|
|
17
17
|
result: MarketplaceInstallResult;
|
|
18
18
|
}): MarketplaceInstalledRecord {
|
|
19
|
+
const { request, result } = params;
|
|
19
20
|
const installedAt = new Date().toISOString();
|
|
20
21
|
|
|
21
|
-
if (
|
|
22
|
+
if (result.type === 'skill') {
|
|
22
23
|
return {
|
|
23
24
|
type: 'skill',
|
|
24
|
-
spec:
|
|
25
|
-
id:
|
|
26
|
-
label:
|
|
25
|
+
spec: result.spec,
|
|
26
|
+
id: request.skill ?? result.spec,
|
|
27
|
+
label: request.skill ?? result.name ?? result.spec,
|
|
27
28
|
source: 'workspace',
|
|
28
|
-
installPath:
|
|
29
|
+
installPath: request.installPath,
|
|
29
30
|
installedAt
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
|
|
33
34
|
return {
|
|
34
|
-
type:
|
|
35
|
-
spec:
|
|
36
|
-
id:
|
|
37
|
-
label:
|
|
35
|
+
type: result.type,
|
|
36
|
+
spec: result.spec,
|
|
37
|
+
id: result.name ?? result.spec,
|
|
38
|
+
label: result.name ?? result.spec,
|
|
38
39
|
source: 'marketplace',
|
|
39
40
|
origin: 'marketplace',
|
|
40
|
-
enabled:
|
|
41
|
-
runtimeStatus:
|
|
41
|
+
enabled: request.enabled ?? true,
|
|
42
|
+
runtimeStatus: request.enabled === false ? 'disabled' : 'ready',
|
|
42
43
|
installedAt
|
|
43
44
|
};
|
|
44
45
|
}
|
|
@@ -47,10 +48,11 @@ function matchesInstalledRecord(record: MarketplaceInstalledRecord, params: {
|
|
|
47
48
|
id?: string;
|
|
48
49
|
spec?: string;
|
|
49
50
|
}): boolean {
|
|
50
|
-
|
|
51
|
+
const { id, spec } = params;
|
|
52
|
+
if (spec && record.spec === spec) {
|
|
51
53
|
return true;
|
|
52
54
|
}
|
|
53
|
-
if (
|
|
55
|
+
if (id && record.id === id) {
|
|
54
56
|
return true;
|
|
55
57
|
}
|
|
56
58
|
return false;
|
|
@@ -70,7 +72,8 @@ export function applyInstallResultToInstalledView(params: {
|
|
|
70
72
|
request: MarketplaceInstallRequest;
|
|
71
73
|
result: MarketplaceInstallResult;
|
|
72
74
|
}): MarketplaceInstalledView {
|
|
73
|
-
const
|
|
75
|
+
const { result, view } = params;
|
|
76
|
+
const current = ensureInstalledView(result.type, view);
|
|
74
77
|
const optimisticRecord = buildInstalledRecordFromInstall(params);
|
|
75
78
|
const existingIndex = current.records.findIndex((record) => matchesInstalledRecord(record, {
|
|
76
79
|
id: optimisticRecord.id,
|
|
@@ -89,7 +92,7 @@ export function applyInstallResultToInstalledView(params: {
|
|
|
89
92
|
|
|
90
93
|
return {
|
|
91
94
|
...current,
|
|
92
|
-
type:
|
|
95
|
+
type: result.type,
|
|
93
96
|
records: nextRecords,
|
|
94
97
|
specs: dedupeSpecs(nextRecords),
|
|
95
98
|
total: nextRecords.length
|
|
@@ -101,12 +104,13 @@ export function applyManageResultToInstalledView(params: {
|
|
|
101
104
|
request: MarketplaceManageRequest;
|
|
102
105
|
result: MarketplaceManageResult;
|
|
103
106
|
}): MarketplaceInstalledView {
|
|
104
|
-
const
|
|
107
|
+
const { request, result, view } = params;
|
|
108
|
+
const current = ensureInstalledView(result.type, view);
|
|
105
109
|
|
|
106
|
-
if (
|
|
110
|
+
if (result.action === 'uninstall' || result.action === 'remove') {
|
|
107
111
|
const nextRecords = current.records.filter((record) => !matchesInstalledRecord(record, {
|
|
108
|
-
id:
|
|
109
|
-
spec:
|
|
112
|
+
id: result.id,
|
|
113
|
+
spec: request.spec
|
|
110
114
|
}));
|
|
111
115
|
|
|
112
116
|
return {
|
|
@@ -119,13 +123,13 @@ export function applyManageResultToInstalledView(params: {
|
|
|
119
123
|
|
|
120
124
|
const nextRecords = current.records.map((record) => {
|
|
121
125
|
if (!matchesInstalledRecord(record, {
|
|
122
|
-
id:
|
|
123
|
-
spec:
|
|
126
|
+
id: result.id,
|
|
127
|
+
spec: request.spec
|
|
124
128
|
})) {
|
|
125
129
|
return record;
|
|
126
130
|
}
|
|
127
131
|
|
|
128
|
-
if (
|
|
132
|
+
if (result.action === 'disable') {
|
|
129
133
|
return {
|
|
130
134
|
...record,
|
|
131
135
|
enabled: false,
|
|
@@ -133,7 +137,7 @@ export function applyManageResultToInstalledView(params: {
|
|
|
133
137
|
};
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
if (
|
|
140
|
+
if (result.action === 'update') {
|
|
137
141
|
return {
|
|
138
142
|
...record,
|
|
139
143
|
installedAt: new Date().toISOString(),
|