@nextclaw/ui 0.15.11 → 0.15.13
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 +41 -0
- package/dist/assets/{api-pbx14YAL.js → api-DGG69ZcJ.js} +3 -3
- package/dist/assets/app-presenter-provider-B1RgR5ug.js +106 -0
- package/dist/assets/{appearance-settings-page-D9wJdf-0.js → appearance-settings-page-BZSd1SrH.js} +1 -1
- package/dist/assets/{book-open-DZyssdCc.js → book-open-BhaS5BJv.js} +1 -1
- package/dist/assets/{card-D7l-gWkY.js → card-Bcr5YM8F.js} +1 -1
- package/dist/assets/{channels-list-page-B3qW3T-B.js → channels-list-page-C_x83ZCT.js} +2 -2
- package/dist/assets/{chat-page-DUI_Jm6r.js → chat-page-D2xfR6TK.js} +1 -1
- package/dist/assets/{config-split-page-DFEKStD7.js → config-split-page-RXAoLeNv.js} +1 -1
- package/dist/assets/{confirm-dialog-7wpxfMCp.js → confirm-dialog-o_VPKvVD.js} +1 -1
- package/dist/assets/{desktop-update-config-DP6IbxBO.js → desktop-update-config-DEOMOsDN.js} +1 -1
- package/dist/assets/{dist-B9UN0HrS.js → dist-C87P4QWA.js} +1 -1
- package/dist/assets/doc-browser-BuGh646I.js +1 -0
- package/dist/assets/{doc-browser-D7klPMHs.js → doc-browser-DQ75iUkA.js} +1 -1
- package/dist/assets/{doc-browser-context-Bw9m83Jp.js → doc-browser-context-tE0--wSa.js} +1 -1
- package/dist/assets/{eye-IVMB0Rrz.js → eye-DL9QkrKg.js} +1 -1
- package/dist/assets/{form-actions-DrFAgO58.js → form-actions-J0tIaUdK.js} +1 -1
- package/dist/assets/index-B2YF-7Yw.css +1 -0
- package/dist/assets/index-B9QEjnoY.js +2 -0
- package/dist/assets/loader-circle-CAnHHSrY.js +1 -0
- package/dist/assets/{logo-badge-DoZOVuPr.js → logo-badge-BYTbZbOF.js} +1 -1
- package/dist/assets/{mcp-marketplace-page-C151EGP-.js → mcp-marketplace-page-COWlzeP1.js} +2 -2
- package/dist/assets/mcp-marketplace-page-CaUFv37E.js +1 -0
- package/dist/assets/{model-config-page-BmfQzc52.js → model-config-page-oNqnMXNY.js} +1 -1
- package/dist/assets/{navigation-link-CJw6FLOj.js → navigation-link-Dk6VdDkc.js} +1 -1
- package/dist/assets/plus-DjdTWPjQ.js +1 -0
- package/dist/assets/{popover-DitLJE6k.js → popover-Txwrum65.js} +1 -1
- package/dist/assets/{provider-scoped-model-input-CuAtduIc.js → provider-scoped-model-input-B7rQM4b6.js} +1 -1
- package/dist/assets/{providers-config-page-CrmuY4DC.js → providers-config-page-CP-OnvLK.js} +1 -1
- package/dist/assets/{react-CTDaaQ9V.js → react-B0LbRnAE.js} +1 -1
- package/dist/assets/{refresh-cw-E5qTlQY6.js → refresh-cw-C84mMku5.js} +1 -1
- package/dist/assets/remote-2gZkJSX4.js +1 -0
- package/dist/assets/rotate-cw-DQJhDnjg.js +1 -0
- package/dist/assets/{runtime-config-page-1fPJJvo5.js → runtime-config-page-u_fuHxc8.js} +1 -1
- package/dist/assets/{save-CTiZvAd2.js → save-R_qyrHpa.js} +1 -1
- package/dist/assets/{search-CztGmpnR.js → search-UKxiouNi.js} +1 -1
- package/dist/assets/{search-config-page-D3jVALZU.js → search-config-page-DzkpSGFH.js} +1 -1
- package/dist/assets/{secrets-config-page-CxWLQCjZ.js → secrets-config-page-DhoLYm7Z.js} +2 -2
- package/dist/assets/security-config-yraYoy9s.js +1 -0
- package/dist/assets/{select-BPVI2dQ_.js → select-CYHT8P5S.js} +1 -1
- package/dist/assets/{settings-2-Cd7QaBsq.js → settings-2-DGh4bGSi.js} +1 -1
- package/dist/assets/skeleton-BQuylYFO.js +1 -0
- package/dist/assets/{tabs-DrUmYwEQ.js → tabs-BCihm1zK.js} +1 -1
- package/dist/assets/{tag-chip-CmViAZKK.js → tag-chip-De0iz4o2.js} +1 -1
- package/dist/assets/{trash-2-DMRJ63AB.js → trash-2-Bo3DWiju.js} +1 -1
- package/dist/assets/use-config-DCzwgChy.js +1 -0
- package/dist/assets/{use-confirm-dialog-Du33bHPz.js → use-confirm-dialog-WZ94CehU.js} +1 -1
- package/dist/assets/{use-viewport-layout-D80O1d90.js → use-viewport-layout-CZ-3pMne.js} +1 -1
- package/dist/assets/x-NZxXyqW1.js +1 -0
- package/dist/index.html +28 -28
- package/package.json +9 -9
- package/src/features/chat/components/layout/__tests__/chat-sidebar.test.tsx +1 -0
- package/src/features/chat/components/layout/chat-sidebar-desktop-layout.tsx +4 -4
- package/src/features/chat/components/layout/chat-sidebar.tsx +27 -12
- package/src/features/chat/features/conversation/components/session-conversation-input.tsx +4 -19
- package/src/features/chat/features/conversation/hooks/__tests__/use-session-conversation-slash-commands.test.tsx +79 -0
- package/src/features/chat/features/conversation/hooks/use-session-conversation-slash-commands.ts +55 -0
- package/src/features/chat/features/message/components/__tests__/chat-inline-panel-app-card.test.tsx +28 -0
- package/src/features/chat/features/message/components/__tests__/chat-message-list.container.test.tsx +11 -12
- package/src/features/chat/features/message/components/chat-inline-panel-app-card.tsx +10 -7
- package/src/features/chat/features/message/components/chat-message-list.container.tsx +1 -0
- package/src/features/chat/features/message/utils/__tests__/chat-message-execution-summary.utils.test.ts +27 -15
- package/src/features/chat/features/message/utils/__tests__/chat-message-show-content-tool-card.utils.test.ts +3 -0
- package/src/features/chat/features/message/utils/chat-inline-panel-app-card.utils.ts +8 -6
- package/src/features/chat/features/message/utils/chat-message-execution-summary.utils.ts +1 -6
- package/src/features/chat/features/message/utils/chat-message-show-content-tool-card.utils.ts +2 -0
- package/src/features/chat/features/message/utils/chat-message-texts.utils.ts +0 -1
- package/src/features/chat/features/project/components/__tests__/chat-project-add-dialog.test.tsx +116 -0
- package/src/features/chat/features/project/components/chat-project-add-dialog.tsx +305 -0
- package/src/features/chat/features/session/components/__tests__/chat-sidebar-project-groups.test.tsx +3 -2
- package/src/features/chat/features/session/components/chat-sidebar-project-groups.tsx +2 -2
- package/src/features/chat/features/workspace/components/__tests__/workspace-file-preview-error-text.test.ts +22 -0
- package/src/features/chat/features/workspace/components/chat-session-workspace-file-preview.tsx +9 -5
- package/src/features/chat/managers/__tests__/chat-ui.manager.test.ts +24 -0
- package/src/features/chat/managers/chat-ui.manager.ts +7 -1
- package/src/features/cron/components/cron-task-discovery.tsx +1 -6
- package/src/features/right-panel-resources/configs/right-panel-resource-routes.config.ts +18 -4
- package/src/features/right-panel-resources/index.ts +1 -0
- package/src/features/right-panel-resources/utils/__tests__/right-panel-resource-route-resolver.utils.test.ts +33 -0
- package/src/features/right-panel-resources/utils/__tests__/right-panel-resource-uri.utils.test.ts +14 -1
- package/src/features/right-panel-resources/utils/right-panel-resource-uri.utils.ts +10 -2
- package/src/shared/components/path-picker/__tests__/server-path-picker-dialog.test.tsx +9 -0
- package/src/shared/components/path-picker/server-path-picker-dialog.tsx +8 -2
- package/src/shared/components/path-picker/server-path-picker-toolbar.tsx +8 -4
- package/src/shared/hooks/use-projects.ts +15 -1
- package/src/shared/lib/api/projects/project.utils.ts +7 -0
- package/src/shared/lib/api/types.ts +1 -1
- package/src/shared/lib/api/utils/ncp-session.utils.ts +7 -0
- package/src/shared/lib/i18n/locales/en-US/chat.json +26 -9
- package/src/shared/lib/i18n/locales/zh-CN/chat.json +26 -9
- package/src/shared/lib/resource-uri/utils/__tests__/resource-uri-resolver.utils.test.ts +13 -1
- package/src/shared/lib/resource-uri/utils/resource-uri.utils.ts +6 -3
- package/dist/assets/app-presenter-provider-Q6u2xBAn.js +0 -106
- package/dist/assets/doc-browser-wgEeLkn1.js +0 -1
- package/dist/assets/index-D297NGOb.js +0 -2
- package/dist/assets/index-DqZoodZL.css +0 -1
- package/dist/assets/loader-circle-DDgFo4Kv.js +0 -1
- package/dist/assets/mcp-marketplace-page-BtNExfMn.js +0 -1
- package/dist/assets/plus-CYxLSfLh.js +0 -1
- package/dist/assets/remote-YzPpOPmK.js +0 -1
- package/dist/assets/rotate-cw-BXeiDT6C.js +0 -1
- package/dist/assets/security-config-DEyj4WBh.js +0 -1
- package/dist/assets/skeleton-CUpAXGoe.js +0 -1
- package/dist/assets/use-config-gpXy2Iyc.js +0 -1
- package/dist/assets/x-CsLMuNFe.js +0 -1
- package/src/features/chat/features/project/components/__tests__/chat-project-create-dialog.test.tsx +0 -67
- package/src/features/chat/features/project/components/chat-project-create-dialog.tsx +0 -203
|
@@ -1,203 +0,0 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
2
|
-
import { FolderOpen } from 'lucide-react';
|
|
3
|
-
import type { ProjectCreateRequest, ProjectTemplateView } from '@/shared/lib/api';
|
|
4
|
-
import { ServerPathPickerDialog } from '@/shared/components/path-picker/server-path-picker-dialog';
|
|
5
|
-
import { Button } from '@/shared/components/ui/button';
|
|
6
|
-
import {
|
|
7
|
-
Dialog,
|
|
8
|
-
DialogContent,
|
|
9
|
-
DialogDescription,
|
|
10
|
-
DialogFooter,
|
|
11
|
-
DialogHeader,
|
|
12
|
-
DialogTitle,
|
|
13
|
-
} from '@/shared/components/ui/dialog';
|
|
14
|
-
import { Input } from '@/shared/components/ui/input';
|
|
15
|
-
import { Label } from '@/shared/components/ui/label';
|
|
16
|
-
import {
|
|
17
|
-
Select,
|
|
18
|
-
SelectContent,
|
|
19
|
-
SelectItem,
|
|
20
|
-
SelectTrigger,
|
|
21
|
-
SelectValue,
|
|
22
|
-
} from '@/shared/components/ui/select';
|
|
23
|
-
import { t } from '@/shared/lib/i18n';
|
|
24
|
-
|
|
25
|
-
type ProjectTemplateId = NonNullable<ProjectCreateRequest['template']>;
|
|
26
|
-
|
|
27
|
-
type ChatProjectCreateDialogProps = {
|
|
28
|
-
open: boolean;
|
|
29
|
-
defaultWorkspacePath?: string | null;
|
|
30
|
-
templates: readonly ProjectTemplateView[];
|
|
31
|
-
isCreating: boolean;
|
|
32
|
-
errorMessage?: string | null;
|
|
33
|
-
onOpenChange: (open: boolean) => void;
|
|
34
|
-
onCreate: (input: ProjectCreateRequest) => Promise<void>;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
function projectTemplateLabel(templateId: ProjectTemplateId): string {
|
|
38
|
-
return t(
|
|
39
|
-
templateId === 'knowledge-base'
|
|
40
|
-
? 'chatProjectTemplateKnowledgeBase'
|
|
41
|
-
: 'chatProjectTemplateEmpty',
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function ChatProjectCreateDialog({
|
|
46
|
-
open,
|
|
47
|
-
defaultWorkspacePath,
|
|
48
|
-
templates,
|
|
49
|
-
isCreating,
|
|
50
|
-
errorMessage,
|
|
51
|
-
onOpenChange,
|
|
52
|
-
onCreate,
|
|
53
|
-
}: ChatProjectCreateDialogProps) {
|
|
54
|
-
const [name, setName] = useState('');
|
|
55
|
-
const [rootPath, setRootPath] = useState('');
|
|
56
|
-
const [pathPickerOpen, setPathPickerOpen] = useState(false);
|
|
57
|
-
const [template, setTemplate] = useState<ProjectTemplateId>('empty');
|
|
58
|
-
const availableTemplateIds = templates.length > 0
|
|
59
|
-
? templates.map((entry) => entry.id)
|
|
60
|
-
: ['empty' as const];
|
|
61
|
-
const normalizedName = name.trim();
|
|
62
|
-
|
|
63
|
-
const resetForm = () => {
|
|
64
|
-
setName('');
|
|
65
|
-
setRootPath('');
|
|
66
|
-
setTemplate('empty');
|
|
67
|
-
setPathPickerOpen(false);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
const closeDialog = () => {
|
|
71
|
-
if (isCreating) {
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
resetForm();
|
|
75
|
-
onOpenChange(false);
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
return (
|
|
79
|
-
<>
|
|
80
|
-
<Dialog
|
|
81
|
-
open={open}
|
|
82
|
-
onOpenChange={(nextOpen) => {
|
|
83
|
-
if (nextOpen) {
|
|
84
|
-
onOpenChange(true);
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
closeDialog();
|
|
88
|
-
}}
|
|
89
|
-
>
|
|
90
|
-
<DialogContent className="sm:max-w-lg">
|
|
91
|
-
<DialogHeader>
|
|
92
|
-
<DialogTitle>{t('chatProjectCreateTitle')}</DialogTitle>
|
|
93
|
-
<DialogDescription>{t('chatProjectCreateDescription')}</DialogDescription>
|
|
94
|
-
</DialogHeader>
|
|
95
|
-
<form
|
|
96
|
-
className="space-y-4"
|
|
97
|
-
onSubmit={(event) => {
|
|
98
|
-
event.preventDefault();
|
|
99
|
-
if (!normalizedName || isCreating) {
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
const normalizedRootPath = rootPath.trim();
|
|
103
|
-
void onCreate({
|
|
104
|
-
name: normalizedName,
|
|
105
|
-
template,
|
|
106
|
-
...(normalizedRootPath ? { rootPath: normalizedRootPath } : {}),
|
|
107
|
-
}).then(resetForm).catch(() => undefined);
|
|
108
|
-
}}
|
|
109
|
-
>
|
|
110
|
-
<div className="space-y-2">
|
|
111
|
-
<Label htmlFor="chat-project-name">{t('chatProjectNameLabel')}</Label>
|
|
112
|
-
<Input
|
|
113
|
-
id="chat-project-name"
|
|
114
|
-
value={name}
|
|
115
|
-
onChange={(event) => setName(event.target.value)}
|
|
116
|
-
placeholder={t('chatProjectNamePlaceholder')}
|
|
117
|
-
autoFocus
|
|
118
|
-
disabled={isCreating}
|
|
119
|
-
/>
|
|
120
|
-
</div>
|
|
121
|
-
|
|
122
|
-
<div className="space-y-2">
|
|
123
|
-
<Label htmlFor="chat-project-template">{t('chatProjectTemplateLabel')}</Label>
|
|
124
|
-
<Select
|
|
125
|
-
value={template}
|
|
126
|
-
onValueChange={(value) => setTemplate(value as ProjectTemplateId)}
|
|
127
|
-
disabled={isCreating}
|
|
128
|
-
>
|
|
129
|
-
<SelectTrigger id="chat-project-template">
|
|
130
|
-
<SelectValue />
|
|
131
|
-
</SelectTrigger>
|
|
132
|
-
<SelectContent>
|
|
133
|
-
{availableTemplateIds.map((templateId) => (
|
|
134
|
-
<SelectItem key={templateId} value={templateId}>
|
|
135
|
-
{projectTemplateLabel(templateId)}
|
|
136
|
-
</SelectItem>
|
|
137
|
-
))}
|
|
138
|
-
</SelectContent>
|
|
139
|
-
</Select>
|
|
140
|
-
</div>
|
|
141
|
-
|
|
142
|
-
<div className="space-y-2">
|
|
143
|
-
<Label htmlFor="chat-project-root-path">{t('chatProjectPathLabel')}</Label>
|
|
144
|
-
<div className="flex gap-2">
|
|
145
|
-
<Input
|
|
146
|
-
id="chat-project-root-path"
|
|
147
|
-
value={rootPath}
|
|
148
|
-
onChange={(event) => setRootPath(event.target.value)}
|
|
149
|
-
placeholder={t('chatProjectPathPlaceholder')}
|
|
150
|
-
disabled={isCreating}
|
|
151
|
-
/>
|
|
152
|
-
<Button
|
|
153
|
-
type="button"
|
|
154
|
-
variant="outline"
|
|
155
|
-
onClick={() => setPathPickerOpen(true)}
|
|
156
|
-
disabled={isCreating}
|
|
157
|
-
>
|
|
158
|
-
<FolderOpen className="mr-2 h-4 w-4" />
|
|
159
|
-
{t('browse')}
|
|
160
|
-
</Button>
|
|
161
|
-
</div>
|
|
162
|
-
<p className="text-xs leading-relaxed text-muted-foreground">
|
|
163
|
-
{t('chatProjectPathHint')}
|
|
164
|
-
</p>
|
|
165
|
-
</div>
|
|
166
|
-
|
|
167
|
-
{errorMessage ? (
|
|
168
|
-
<p role="alert" className="text-sm text-destructive">
|
|
169
|
-
{errorMessage}
|
|
170
|
-
</p>
|
|
171
|
-
) : null}
|
|
172
|
-
|
|
173
|
-
<DialogFooter>
|
|
174
|
-
<Button type="button" variant="outline" onClick={closeDialog} disabled={isCreating}>
|
|
175
|
-
{t('cancel')}
|
|
176
|
-
</Button>
|
|
177
|
-
<Button type="submit" disabled={!normalizedName || isCreating}>
|
|
178
|
-
{isCreating ? t('saving') : t('chatProjectCreateAction')}
|
|
179
|
-
</Button>
|
|
180
|
-
</DialogFooter>
|
|
181
|
-
</form>
|
|
182
|
-
</DialogContent>
|
|
183
|
-
</Dialog>
|
|
184
|
-
<ServerPathPickerDialog
|
|
185
|
-
open={pathPickerOpen}
|
|
186
|
-
currentPath={rootPath}
|
|
187
|
-
defaultWorkspacePath={defaultWorkspacePath}
|
|
188
|
-
isSaving={false}
|
|
189
|
-
onOpenChange={setPathPickerOpen}
|
|
190
|
-
onConfirm={(path) => {
|
|
191
|
-
setRootPath(path);
|
|
192
|
-
setPathPickerOpen(false);
|
|
193
|
-
}}
|
|
194
|
-
title={t('chatProjectPathPickerTitle')}
|
|
195
|
-
description={t('chatProjectPathPickerDescription')}
|
|
196
|
-
pathLabel={t('chatProjectPathLabel')}
|
|
197
|
-
pathPlaceholder={t('chatProjectPathPlaceholder')}
|
|
198
|
-
confirmLabel={t('selectCurrentDirectory')}
|
|
199
|
-
hint={t('chatProjectPathHint')}
|
|
200
|
-
/>
|
|
201
|
-
</>
|
|
202
|
-
);
|
|
203
|
-
}
|