@morlay/ui-conversation-manager 0.1.4 → 0.1.6
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/README.md +4 -0
- package/dist/client.cjs +480 -17245
- package/dist/client.d.cts +7 -3114
- package/dist/client.d.mts +8 -3115
- package/dist/client.mjs +1211 -0
- package/dist/index.cjs +5 -0
- package/package.json +21 -17
- package/src/client/ConversationManagerPage.module.css +226 -0
- package/src/client/ConversationManagerPage.tsx +455 -293
- package/src/client/index.ts +0 -2
- package/src/client/locales.ts +10 -0
- package/src/css-modules.d.ts +6 -0
- package/dist/index.d.cts +0 -3
- package/src/client/ConversationManagerPage.styles.ts +0 -256
package/src/client/index.ts
CHANGED
|
@@ -9,7 +9,6 @@ import type {} from "@deepseek-ai/dsh-client-ui-sidebar/client";
|
|
|
9
9
|
import type {} from "@deepseek-ai/dsh-client-ui-session/client";
|
|
10
10
|
import type {} from "@deepseek-ai/dsh-client-ui-workspace/client";
|
|
11
11
|
import type {} from "@deepseek-ai/dsh-api-session-controller/client";
|
|
12
|
-
import { apply as installUiPrimitives } from "@morlay/dsh-client-ui-primitives/client";
|
|
13
12
|
import { ConversationManagerController } from "./controller.ts";
|
|
14
13
|
import { ConversationManagerPage } from "./ConversationManagerPage.tsx";
|
|
15
14
|
import { ConversationManagerIcon } from "./ConversationManagerIcon.tsx";
|
|
@@ -41,7 +40,6 @@ export const inject = ["slots", "locale", "uiWorkspace", "sessions"];
|
|
|
41
40
|
|
|
42
41
|
export function apply(ctx: ClientContext): void {
|
|
43
42
|
// 基础面随本包 inline(不再是装配行):装上它提供的字典、字段槽与按行配置页;多份副本只装一次。
|
|
44
|
-
installUiPrimitives(ctx);
|
|
45
43
|
ctx.effect(() => ctx.locale.register(NS, { zh, en }), "ui-conversation-manager: dictionaries");
|
|
46
44
|
const t = ctx.locale.bind(NS);
|
|
47
45
|
// ctx.sessions 的类型被别的 client 半的声明占住(SessionStore),按既有做法从服务面取。
|
package/src/client/locales.ts
CHANGED
|
@@ -11,8 +11,12 @@ export const zh = {
|
|
|
11
11
|
archived: "已归档",
|
|
12
12
|
subagent: "子代理",
|
|
13
13
|
showSubagents: "显示子代理会话",
|
|
14
|
+
clearSearch: "清空搜索",
|
|
15
|
+
"filter.view": "视图",
|
|
16
|
+
"filter.subagents": "会话筛选",
|
|
14
17
|
"view.sessions": "会话",
|
|
15
18
|
"view.usage": "统计",
|
|
19
|
+
"usage.dimension": "用量维度",
|
|
16
20
|
"usage.overview": "总览",
|
|
17
21
|
"usage.all": "全部会话",
|
|
18
22
|
"usage.range": "时间范围",
|
|
@@ -36,6 +40,7 @@ export const zh = {
|
|
|
36
40
|
"usage.userInputs": "用户输入",
|
|
37
41
|
"usage.toolCalls": "工具调用",
|
|
38
42
|
"usage.subagentOnly": "其中子代理",
|
|
43
|
+
"usage.onlySubagents": "只看子代理会话",
|
|
39
44
|
"usage.unknownModel": "未知模型",
|
|
40
45
|
archive: "归档",
|
|
41
46
|
archiveNamed: "归档 {title}",
|
|
@@ -91,8 +96,12 @@ export const en = {
|
|
|
91
96
|
archived: "Archived",
|
|
92
97
|
subagent: "Subagent",
|
|
93
98
|
showSubagents: "Show subagent sessions",
|
|
99
|
+
clearSearch: "Clear search",
|
|
100
|
+
"filter.view": "View",
|
|
101
|
+
"filter.subagents": "Session filter",
|
|
94
102
|
"view.sessions": "Sessions",
|
|
95
103
|
"view.usage": "Usage",
|
|
104
|
+
"usage.dimension": "Usage dimension",
|
|
96
105
|
"usage.overview": "Overview",
|
|
97
106
|
"usage.all": "All sessions",
|
|
98
107
|
"usage.range": "Time range",
|
|
@@ -116,6 +125,7 @@ export const en = {
|
|
|
116
125
|
"usage.userInputs": "User inputs",
|
|
117
126
|
"usage.toolCalls": "Tool calls",
|
|
118
127
|
"usage.subagentOnly": "Subagent share",
|
|
128
|
+
"usage.onlySubagents": "Subagent sessions only",
|
|
119
129
|
"usage.unknownModel": "Unknown model",
|
|
120
130
|
archive: "Archive",
|
|
121
131
|
archiveNamed: "Archive {title}",
|
package/dist/index.d.cts
DELETED
|
@@ -1,256 +0,0 @@
|
|
|
1
|
-
import { styling, type CSSProps } from "@morlay/dsh-client-ui-primitives/client";
|
|
2
|
-
|
|
3
|
-
const spin = styling.keyframes({
|
|
4
|
-
from: { transform: "rotate(0deg)" },
|
|
5
|
-
to: { transform: "rotate(360deg)" },
|
|
6
|
-
});
|
|
7
|
-
|
|
8
|
-
// 「对话管理」页面的样式表(官方 --dsw-* 变量 + 我们的 css-in-js 层):页面根是纵向 flex 且**自己不滚**,
|
|
9
|
-
// 页头(标题 / tab 条 / 导入 / 清理)与搜索行固定在顶部,只有 `scroll` 那层随内容滚;除滚动层外的项都
|
|
10
|
-
// `flex: none`,否则内容变长时会被压到 min-content(官方 Input 的 32px 高会被压成一行文字高)。
|
|
11
|
-
export const styles = {
|
|
12
|
-
page: {
|
|
13
|
-
display: "flex",
|
|
14
|
-
flexDirection: "column",
|
|
15
|
-
gap: "12px",
|
|
16
|
-
boxSizing: "border-box",
|
|
17
|
-
width: "100%",
|
|
18
|
-
height: "100%",
|
|
19
|
-
padding: "24px 28px",
|
|
20
|
-
overflow: "hidden",
|
|
21
|
-
color: "var(--dsw-alias-label-primary)",
|
|
22
|
-
},
|
|
23
|
-
// 页面里唯一的滚动容器:提示 / 空态 / 列表 / 分页(或 usage 视图)都在它里面。
|
|
24
|
-
scroll: {
|
|
25
|
-
display: "flex",
|
|
26
|
-
flexDirection: "column",
|
|
27
|
-
gap: "12px",
|
|
28
|
-
flex: "1 1 auto",
|
|
29
|
-
minHeight: "0",
|
|
30
|
-
overflowY: "auto",
|
|
31
|
-
},
|
|
32
|
-
header: {
|
|
33
|
-
display: "flex",
|
|
34
|
-
alignItems: "center",
|
|
35
|
-
justifyContent: "space-between",
|
|
36
|
-
gap: "12px",
|
|
37
|
-
flex: "none",
|
|
38
|
-
},
|
|
39
|
-
headerActions: {
|
|
40
|
-
display: "flex",
|
|
41
|
-
alignItems: "center",
|
|
42
|
-
gap: "8px",
|
|
43
|
-
flex: "none",
|
|
44
|
-
},
|
|
45
|
-
title: {
|
|
46
|
-
margin: "0",
|
|
47
|
-
fontSize: "16px",
|
|
48
|
-
lineHeight: "24px",
|
|
49
|
-
fontWeight: "500",
|
|
50
|
-
},
|
|
51
|
-
// 与官方会话头部的 tab 条同形(ConversationRoot.module.css 的 .tabs/.tab/.tabActive):
|
|
52
|
-
// 时间范围与维度切换共用这一套,选中态是品牌蓝文字 + 2px 下划线。
|
|
53
|
-
tabs: {
|
|
54
|
-
position: "relative",
|
|
55
|
-
zIndex: "1",
|
|
56
|
-
display: "flex",
|
|
57
|
-
gap: "36px",
|
|
58
|
-
marginTop: "10px",
|
|
59
|
-
paddingLeft: "8px",
|
|
60
|
-
flex: "none",
|
|
61
|
-
},
|
|
62
|
-
tab: {
|
|
63
|
-
position: "relative",
|
|
64
|
-
padding: "0 0 9px",
|
|
65
|
-
border: "none",
|
|
66
|
-
background: "transparent",
|
|
67
|
-
fontSize: "13px",
|
|
68
|
-
lineHeight: "16px",
|
|
69
|
-
fontWeight: "500",
|
|
70
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
71
|
-
cursor: "pointer",
|
|
72
|
-
"&::after": {
|
|
73
|
-
content: "''",
|
|
74
|
-
position: "absolute",
|
|
75
|
-
right: "0",
|
|
76
|
-
bottom: "-1px",
|
|
77
|
-
left: "0",
|
|
78
|
-
height: "2px",
|
|
79
|
-
borderRadius: "2px",
|
|
80
|
-
background: "transparent",
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
tabActive: {
|
|
84
|
-
color: "var(--dsw-alias-state-business-primary)",
|
|
85
|
-
"&::after": {
|
|
86
|
-
background: "var(--dsw-alias-state-business-primary)",
|
|
87
|
-
},
|
|
88
|
-
},
|
|
89
|
-
usage: {
|
|
90
|
-
display: "flex",
|
|
91
|
-
flexDirection: "column",
|
|
92
|
-
gap: "12px",
|
|
93
|
-
flex: "none",
|
|
94
|
-
},
|
|
95
|
-
// 一行用量:label 在上,下面是横向排布的单项(每个单项内部上下)。
|
|
96
|
-
usageRow: {
|
|
97
|
-
display: "flex",
|
|
98
|
-
flexDirection: "column",
|
|
99
|
-
gap: "6px",
|
|
100
|
-
padding: "10px 12px",
|
|
101
|
-
border: "1px solid var(--dsw-alias-border-l1)",
|
|
102
|
-
borderRadius: "10px",
|
|
103
|
-
background: "var(--dsw-alias-bg-base)",
|
|
104
|
-
flex: "none",
|
|
105
|
-
},
|
|
106
|
-
usageRowLabel: {
|
|
107
|
-
overflow: "hidden",
|
|
108
|
-
fontSize: "12px",
|
|
109
|
-
lineHeight: "18px",
|
|
110
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
111
|
-
textOverflow: "ellipsis",
|
|
112
|
-
whiteSpace: "nowrap",
|
|
113
|
-
},
|
|
114
|
-
usageMetrics: {
|
|
115
|
-
display: "flex",
|
|
116
|
-
flexDirection: "row",
|
|
117
|
-
flexWrap: "wrap",
|
|
118
|
-
gap: "6px 20px",
|
|
119
|
-
},
|
|
120
|
-
usageMetric: {
|
|
121
|
-
display: "flex",
|
|
122
|
-
flexDirection: "column",
|
|
123
|
-
gap: "2px",
|
|
124
|
-
},
|
|
125
|
-
usageMetricLabel: {
|
|
126
|
-
fontSize: "12px",
|
|
127
|
-
lineHeight: "18px",
|
|
128
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
129
|
-
},
|
|
130
|
-
usageMetricValue: {
|
|
131
|
-
fontSize: "16px",
|
|
132
|
-
lineHeight: "24px",
|
|
133
|
-
fontWeight: "500",
|
|
134
|
-
fontVariantNumeric: "tabular-nums",
|
|
135
|
-
},
|
|
136
|
-
usageList: {
|
|
137
|
-
display: "flex",
|
|
138
|
-
flexDirection: "column",
|
|
139
|
-
gap: "4px",
|
|
140
|
-
margin: "0",
|
|
141
|
-
padding: "0",
|
|
142
|
-
listStyle: "none",
|
|
143
|
-
flex: "none",
|
|
144
|
-
},
|
|
145
|
-
filters: {
|
|
146
|
-
display: "flex",
|
|
147
|
-
alignItems: "center",
|
|
148
|
-
gap: "16px",
|
|
149
|
-
flex: "none",
|
|
150
|
-
},
|
|
151
|
-
// 官方 Input 的 wrap 是 inline-flex:这里只补宽度,其余样式仍归官方。
|
|
152
|
-
search: {
|
|
153
|
-
width: "360px",
|
|
154
|
-
maxWidth: "100%",
|
|
155
|
-
flex: "none",
|
|
156
|
-
},
|
|
157
|
-
list: {
|
|
158
|
-
display: "flex",
|
|
159
|
-
flexDirection: "column",
|
|
160
|
-
gap: "4px",
|
|
161
|
-
margin: "0",
|
|
162
|
-
padding: "0",
|
|
163
|
-
listStyle: "none",
|
|
164
|
-
flex: "none",
|
|
165
|
-
},
|
|
166
|
-
row: {
|
|
167
|
-
display: "flex",
|
|
168
|
-
alignItems: "center",
|
|
169
|
-
justifyContent: "space-between",
|
|
170
|
-
gap: "16px",
|
|
171
|
-
padding: "10px 12px",
|
|
172
|
-
border: "1px solid var(--dsw-alias-border-l1)",
|
|
173
|
-
borderRadius: "10px",
|
|
174
|
-
background: "var(--dsw-alias-bg-base)",
|
|
175
|
-
flex: "none",
|
|
176
|
-
},
|
|
177
|
-
identity: {
|
|
178
|
-
display: "flex",
|
|
179
|
-
flexDirection: "column",
|
|
180
|
-
gap: "2px",
|
|
181
|
-
minWidth: "0",
|
|
182
|
-
},
|
|
183
|
-
titleLine: {
|
|
184
|
-
display: "flex",
|
|
185
|
-
alignItems: "center",
|
|
186
|
-
gap: "8px",
|
|
187
|
-
minWidth: "0",
|
|
188
|
-
},
|
|
189
|
-
rowTitle: {
|
|
190
|
-
overflow: "hidden",
|
|
191
|
-
fontSize: "13px",
|
|
192
|
-
lineHeight: "20px",
|
|
193
|
-
textOverflow: "ellipsis",
|
|
194
|
-
whiteSpace: "nowrap",
|
|
195
|
-
},
|
|
196
|
-
meta: {
|
|
197
|
-
fontSize: "12px",
|
|
198
|
-
lineHeight: "18px",
|
|
199
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
200
|
-
},
|
|
201
|
-
actions: {
|
|
202
|
-
display: "flex",
|
|
203
|
-
alignItems: "center",
|
|
204
|
-
gap: "8px",
|
|
205
|
-
flex: "none",
|
|
206
|
-
},
|
|
207
|
-
pagination: {
|
|
208
|
-
display: "flex",
|
|
209
|
-
alignItems: "center",
|
|
210
|
-
justifyContent: "flex-end",
|
|
211
|
-
gap: "8px",
|
|
212
|
-
marginTop: "4px",
|
|
213
|
-
flex: "none",
|
|
214
|
-
},
|
|
215
|
-
paginationLabel: {
|
|
216
|
-
fontSize: "12px",
|
|
217
|
-
lineHeight: "18px",
|
|
218
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
219
|
-
fontVariantNumeric: "tabular-nums",
|
|
220
|
-
},
|
|
221
|
-
status: {
|
|
222
|
-
margin: "0",
|
|
223
|
-
fontSize: "13px",
|
|
224
|
-
lineHeight: "20px",
|
|
225
|
-
color: "var(--dsw-alias-label-tertiary)",
|
|
226
|
-
flex: "none",
|
|
227
|
-
},
|
|
228
|
-
failure: {
|
|
229
|
-
margin: "0",
|
|
230
|
-
fontSize: "13px",
|
|
231
|
-
lineHeight: "20px",
|
|
232
|
-
color: "var(--dsw-alias-label-error, var(--dsw-alias-label-primary))",
|
|
233
|
-
flex: "none",
|
|
234
|
-
},
|
|
235
|
-
blocking: {
|
|
236
|
-
display: "flex",
|
|
237
|
-
flexDirection: "column",
|
|
238
|
-
alignItems: "center",
|
|
239
|
-
gap: "14px",
|
|
240
|
-
padding: "32px 40px",
|
|
241
|
-
color: "var(--dsw-alias-label-primary)",
|
|
242
|
-
},
|
|
243
|
-
spinner: {
|
|
244
|
-
width: "28px",
|
|
245
|
-
height: "28px",
|
|
246
|
-
border: "2px solid var(--dsw-alias-border-l2)",
|
|
247
|
-
borderTopColor: "var(--dsw-alias-label-primary)",
|
|
248
|
-
borderRadius: "50%",
|
|
249
|
-
animation: `${spin} 900ms linear infinite`,
|
|
250
|
-
},
|
|
251
|
-
blockingText: {
|
|
252
|
-
margin: "0",
|
|
253
|
-
fontSize: "13px",
|
|
254
|
-
lineHeight: "20px",
|
|
255
|
-
},
|
|
256
|
-
} satisfies Record<string, CSSProps>;
|