@yuku123/z-team-component 0.2.102 → 0.2.103

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 (58) hide show
  1. package/package.json +1 -1
  2. package/dist/ChangeLogView-BIlT58NX.js +0 -542
  3. package/dist/ComponentDoc-bhNM4jiY.js +0 -8035
  4. package/dist/InvitationManagementPage-9AmXUw6E.js +0 -495
  5. package/dist/OnboardingPage-B9oWippy.js +0 -393
  6. package/dist/ScheduledTasks-CkNxtgeb.js +0 -12127
  7. package/dist/SystemShell-Cz3bn2dt.js +0 -688
  8. package/dist/_commonjsHelpers-B52_cu2H.js +0 -26
  9. package/dist/admin-logs-BuwxECUY.js +0 -198
  10. package/dist/api-DL_MM5cW.js +0 -20
  11. package/dist/browser-jb_PFvU3.js +0 -1538
  12. package/dist/createWorkspaceWsHandler-B6LYCL3Q.js +0 -13142
  13. package/dist/ctc-sso-DtJHC-2M.js +0 -117
  14. package/dist/echarts-B1OU1xr4.js +0 -16
  15. package/dist/history-BlrA1eaW.js +0 -41
  16. package/dist/index-2dGExnjZ.js +0 -2217
  17. package/dist/index-B1AYMWHS.js +0 -10169
  18. package/dist/index-B5F1N9_V.js +0 -42049
  19. package/dist/index-B8O2io7L.js +0 -315
  20. package/dist/index-BIXeUFLa.js +0 -479
  21. package/dist/index-BPqoN-aE.js +0 -242
  22. package/dist/index-BTs7b4SV.js +0 -118
  23. package/dist/index-BYMhgsLe.js +0 -178
  24. package/dist/index-BZBxvwcT.js +0 -169
  25. package/dist/index-BZCQSW-G.js +0 -1222
  26. package/dist/index-B_LJRFsK.js +0 -339
  27. package/dist/index-BdmM-NHL.js +0 -5892
  28. package/dist/index-BmHFHD_e.js +0 -112
  29. package/dist/index-BohoJQPr.js +0 -7631
  30. package/dist/index-C1wsTstT.js +0 -434
  31. package/dist/index-C1wtrBjM.js +0 -8
  32. package/dist/index-C815hPWS.js +0 -430
  33. package/dist/index-CbH8YeqA.js +0 -913
  34. package/dist/index-CsweV-yM.js +0 -142
  35. package/dist/index-D3vyICxK.js +0 -2699
  36. package/dist/index-DKgyKXWm.js +0 -1640
  37. package/dist/index-DQHEr9-I.js +0 -93
  38. package/dist/index-DU-PHfEr.js +0 -189
  39. package/dist/index-DWsfQMp8.js +0 -208
  40. package/dist/index-DhDdFRHC.js +0 -279
  41. package/dist/index-DvTMESfc.js +0 -132
  42. package/dist/index-fl0m6QYf.js +0 -316
  43. package/dist/index-lux3nNJP.js +0 -574
  44. package/dist/index-mwtsohOK.js +0 -951
  45. package/dist/index-qd4awhFI.js +0 -956
  46. package/dist/index.js +0 -10
  47. package/dist/index.module-CAa-2T7m.js +0 -72
  48. package/dist/index.module-UI0iz8K0.js +0 -42
  49. package/dist/instance-4ACm8YFK.js +0 -216
  50. package/dist/menuPermission-C7yt7uNG.js +0 -60
  51. package/dist/mobile-client-O3yr9h6t.js +0 -24
  52. package/dist/pages.js +0 -21
  53. package/dist/send-default-agent-team-message-YRd0CkeT.js +0 -35
  54. package/dist/spark-md5-Dld54a-T.js +0 -178
  55. package/dist/sso-user-GnlYnP83.js +0 -43
  56. package/dist/training-CyK00fwu.js +0 -450
  57. package/dist/webide-SjnHsCZF.js +0 -5233
  58. package/dist/z-team-component.css +0 -1
@@ -1,479 +0,0 @@
1
- import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { r as D, f as le } from "./ctc-sso-DtJHC-2M.js";
3
- import { r as de, h as $, s as K } from "./sso-user-GnlYnP83.js";
4
- import { ArrowLeftOutlined as ue, PlusOutlined as pe, LogoutOutlined as me, SearchOutlined as he } from "@ant-design/icons";
5
- import { Spin as O, Button as q, Input as fe, Empty as Y, Tag as ge, message as be } from "antd";
6
- import Q from "query-string";
7
- import { useState as y, useRef as E, useEffect as w, useMemo as J, useCallback as B } from "react";
8
- import { useLocation as ke } from "react-router-dom";
9
- import { h as A } from "./history-BlrA1eaW.js";
10
- import { c as we, C as Se } from "./createWorkspaceWsHandler-B6LYCL3Q.js";
11
- import { d as i, Q as ye, U as ve, V as je, W as Ne, X as Te, Y as Ce, j as ee } from "./ComponentDoc-bhNM4jiY.js";
12
- import { l as Pe, j as xe } from "./instance-4ACm8YFK.js";
13
- import { i as _e, s as Ee } from "./mobile-client-O3yr9h6t.js";
14
- /* empty css */
15
- import { s as Ae } from "./admin-logs-BuwxECUY.js";
16
- const ae = 2e4;
17
- function Ie(o, s = ae, n = globalThis) {
18
- let c = null;
19
- return {
20
- start() {
21
- c == null && (c = n.setTimeout(() => {
22
- c = null, o();
23
- }, s));
24
- },
25
- stop() {
26
- c != null && (n.clearTimeout(c), c = null);
27
- }
28
- };
29
- }
30
- function Le({ text: o, onRetry: s }) {
31
- return /* @__PURE__ */ d("div", { style: { marginTop: 12, textAlign: "center" }, children: [
32
- /* @__PURE__ */ t("div", { style: { marginBottom: 10 }, children: o }),
33
- /* @__PURE__ */ t(
34
- "button",
35
- {
36
- type: "button",
37
- onClick: s,
38
- style: {
39
- padding: "6px 16px",
40
- borderRadius: 6,
41
- border: "1px solid #1677ff",
42
- background: "#1677ff",
43
- color: "#fff",
44
- cursor: "pointer"
45
- },
46
- children: "重新登录"
47
- }
48
- )
49
- ] });
50
- }
51
- const Me = "统一登录接入超时(可能是网络抖动或服务正在重启),请重新登录。";
52
- function Oe({
53
- loadingText: o,
54
- timeoutText: s = Me,
55
- onRetry: n,
56
- timeoutMs: c = ae,
57
- className: r
58
- }) {
59
- const [N, h] = y(!1), g = E(n);
60
- return g.current = n, w(() => {
61
- const m = Ie(
62
- () => h(!0),
63
- c
64
- );
65
- return m.start(), () => m.stop();
66
- }, [c]), N ? /* @__PURE__ */ d("div", { className: r, children: [
67
- /* @__PURE__ */ t(O, { description: "" }),
68
- /* @__PURE__ */ t(
69
- Le,
70
- {
71
- text: s,
72
- onRetry: () => g.current()
73
- }
74
- )
75
- ] }) : /* @__PURE__ */ t("div", { className: r, children: /* @__PURE__ */ t(O, { description: o }) });
76
- }
77
- function Re(o, s) {
78
- w(() => {
79
- if (o == null)
80
- return;
81
- i.getState().setObserverStatus(null);
82
- const n = () => {
83
- const m = i.getState();
84
- m.loadMessages().catch(() => {
85
- }), m.loadRunningExecutions().catch(() => {
86
- });
87
- const f = m.activeTaskChat;
88
- f != null && f.taskId && m.loadTaskMessages(f.taskId).catch(() => {
89
- }), m.loadFileTree(void 0, !0).catch(() => {
90
- });
91
- }, c = ye((m) => {
92
- i.getState().setWsState(m);
93
- });
94
- ve(o, s, n), i.getState().loadRunningExecutions().catch(() => {
95
- });
96
- const r = i.getState(), { handler: N, dispose: h } = we({
97
- projectId: o,
98
- token: s,
99
- updateExecution: r.updateExecution,
100
- registerExecutionStart: r.registerExecutionStart,
101
- clearExecution: r.clearExecution,
102
- applyExecutionCancelled: r.applyExecutionCancelled,
103
- addMessage: r.addMessage,
104
- addTaskMessage: r.addTaskMessage,
105
- deleteMessage: r.deleteMessage,
106
- updateMessageReadStatus: r.updateMessageReadStatus,
107
- loadFileTree: r.loadFileTree
108
- }), g = je(N);
109
- return () => {
110
- g(), h(), Ne(), c(), i.getState().setObserverStatus(null);
111
- };
112
- }, [o, s]);
113
- }
114
- const We = `${window.publicPath ?? "/"}logo.svg`;
115
- function te() {
116
- const { pathname: o, search: s } = A.location, n = Q.parse(s);
117
- if (!n.projectId && !n.project_id)
118
- return;
119
- delete n.projectId, delete n.project_id;
120
- const c = Q.stringify(n);
121
- A.replace({
122
- pathname: o,
123
- search: c ? `?${c}` : ""
124
- });
125
- }
126
- function Je() {
127
- const o = ke(), [s, n] = y("list"), [c, r] = y("chat"), [N, h] = y("team"), [g, m] = y(""), [f, V] = y(!1), [re, I] = y(!1), {
128
- currentProject: v,
129
- currentUser: R,
130
- projects: L,
131
- loading: ne,
132
- members: W,
133
- token: oe,
134
- loadProjects: z,
135
- expandProject: H,
136
- updateCurrentUser: T,
137
- requestChatScrollBottom: S
138
- } = i(), k = J(() => {
139
- const e = Q.parse(o.search), a = String(e.projectId ?? e.project_id ?? "").trim();
140
- if (!a)
141
- return null;
142
- const l = Number(a);
143
- return Number.isFinite(l) && l > 0 ? l : null;
144
- }, [o.search]), U = E(!1), C = E(!1), P = E(!1), X = E(k);
145
- X.current = k, Re(v == null ? void 0 : v.id, oe), w(() => (document.body.classList.add("team-phone-workspace-route"), () => {
146
- document.body.classList.remove("team-phone-workspace-route");
147
- }), []), w(() => {
148
- !_e(o.search) && Ee() || A.replace({
149
- pathname: "/workspace",
150
- search: o.search
151
- });
152
- }, [o.search]);
153
- const se = B(
154
- (e) => {
155
- r("chat"), h(e), S(e, !0);
156
- },
157
- [S]
158
- );
159
- w(() => {
160
- let e = !1, a = 0;
161
- const l = 100;
162
- let x = !1, F = 0;
163
- const M = 3, j = (b) => {
164
- const u = i.getState().token;
165
- if (X.current != null) {
166
- e || (T(K(b)), V(!0)), ee().then((G) => {
167
- e || T(G);
168
- }).catch(() => {
169
- !e && u && (localStorage.removeItem("z_team_token"), i.setState({ token: "" }));
170
- });
171
- return;
172
- }
173
- ee().then((G) => {
174
- e || T(G);
175
- }).catch(() => {
176
- e || (u && (localStorage.removeItem("z_team_token"), i.setState({ token: "" })), T(K(b)));
177
- }).finally(() => {
178
- e || V(!0);
179
- });
180
- };
181
- return (() => {
182
- if (e)
183
- return;
184
- const b = async () => {
185
- if (e)
186
- return;
187
- let u = de();
188
- if ((!u || !$(u)) && !x) {
189
- x = !0;
190
- try {
191
- const p = await le();
192
- p.kind === "authenticated" ? u = p.user : p.kind === "unauthenticated" && (F += 1);
193
- } catch {
194
- } finally {
195
- x = !1;
196
- }
197
- }
198
- if (u && $(u)) {
199
- j(u);
200
- return;
201
- }
202
- if (F >= M) {
203
- D();
204
- return;
205
- }
206
- if (a += 1, a >= l) {
207
- D();
208
- return;
209
- }
210
- window.setTimeout(() => {
211
- b();
212
- }, 150);
213
- };
214
- b();
215
- })(), () => {
216
- e = !0;
217
- };
218
- }, [T]), w(() => {
219
- R && z();
220
- }, [R, z]), w(() => {
221
- var l;
222
- if (!f || k != null || s === "project" || P.current)
223
- return;
224
- const e = i.getState(), a = (l = e.currentProject) == null ? void 0 : l.id;
225
- a == null || !e.expandedProjectIds.includes(String(a)) || (n("project"), r("chat"), h("team"), S("team", !0));
226
- }, [f, k, s, S]);
227
- const ce = B(
228
- async (e) => {
229
- P.current = !1, I(!0);
230
- try {
231
- await H(e), n("project"), r("chat"), h("team");
232
- const a = i.getState();
233
- a.currentProject && await a.refreshProjectPanels(
234
- String(a.currentProject.id),
235
- a.projectSwitchSeq,
236
- !1
237
- ), S("team", !0);
238
- } finally {
239
- I(!1);
240
- }
241
- },
242
- [H, S]
243
- );
244
- w(() => {
245
- var M;
246
- if (!f || k == null || U.current || C.current)
247
- return;
248
- const e = k == null ? "" : String(k), a = i.getState();
249
- if (String(((M = a.currentProject) == null ? void 0 : M.id) ?? "") === e && a.expandedProjectIds.includes(e)) {
250
- U.current = !0, te(), P.current = !1, n("project"), r("chat"), h("team"), i.getState().loadMessages().catch(() => {
251
- });
252
- return;
253
- }
254
- let l = !1;
255
- C.current = !0, I(!0);
256
- const x = async () => {
257
- const j = Date.now() + 4e3;
258
- for (; Date.now() < j; ) {
259
- if (l)
260
- return;
261
- const _ = i.getState();
262
- if (!_.loading || _.projects.length > 0)
263
- return;
264
- await new Promise((b) => setTimeout(b, 50));
265
- }
266
- };
267
- return (async () => {
268
- try {
269
- if (await x(), l)
270
- return;
271
- let {
272
- token: j,
273
- projects: _,
274
- expandProject: b
275
- } = i.getState(), u = _.find((p) => p.id === e);
276
- if (!u) {
277
- const p = await Pe(e, j);
278
- if (l)
279
- return;
280
- if (p.status === "NOT_FOUND" || !p.scenarioInstance) {
281
- be.info("无此工程");
282
- return;
283
- }
284
- if (u = await xe(e, j), l)
285
- return;
286
- }
287
- if (l || !u)
288
- return;
289
- if (U.current = !0, await b(u), !l) {
290
- P.current = !1, n("project"), r("chat"), h("team"), te();
291
- const p = i.getState();
292
- p.currentProject && await p.refreshProjectPanels(
293
- String(p.currentProject.id),
294
- p.projectSwitchSeq,
295
- !1
296
- ), S("team", !0);
297
- }
298
- } catch {
299
- } finally {
300
- I(!1), C.current = !1, i.getState().loadProjects();
301
- }
302
- })(), () => {
303
- l = !0, C.current && (C.current = !1);
304
- };
305
- }, [f, k]);
306
- const Z = J(() => {
307
- const e = g.trim().toLowerCase();
308
- return e ? L.filter(
309
- (a) => a.name.toLowerCase().includes(e) || (a.scenario_name ?? "").toLowerCase().includes(e)
310
- ) : L;
311
- }, [g, L]), ie = B(() => {
312
- P.current = !0, n("list"), r("chat");
313
- }, []);
314
- return !f || !R ? /* @__PURE__ */ t(
315
- Oe,
316
- {
317
- className: "phone-workspace phone-workspace-loading",
318
- loadingText: "正在接入 4A 统一登录…",
319
- timeoutText: "4A 统一登录接入超时(可能是网络抖动或服务正在重启),请重新登录。",
320
- onRetry: () => D()
321
- }
322
- ) : /* @__PURE__ */ d("div", { className: "phone-workspace", children: [
323
- /* @__PURE__ */ d("header", { className: "phone-workspace-header", children: [
324
- s === "project" ? /* @__PURE__ */ t(
325
- q,
326
- {
327
- type: "text",
328
- icon: /* @__PURE__ */ t(ue, {}),
329
- className: "phone-workspace-back",
330
- onClick: ie,
331
- "aria-label": "返回项目列表"
332
- }
333
- ) : /* @__PURE__ */ t(
334
- "img",
335
- {
336
- src: We,
337
- alt: "Z-OPC",
338
- className: "phone-workspace-logo",
339
- onClick: () => A.push("/welcome"),
340
- style: { cursor: "pointer" }
341
- }
342
- ),
343
- /* @__PURE__ */ t("div", { className: "phone-workspace-header-title", children: s === "list" ? /* @__PURE__ */ t(
344
- "span",
345
- {
346
- className: "phone-workspace-brand",
347
- onClick: () => A.push("/welcome"),
348
- style: { cursor: "pointer" },
349
- children: "Z-OPC"
350
- }
351
- ) : /* @__PURE__ */ t("span", { className: "phone-workspace-project-name", children: (v == null ? void 0 : v.name) ?? "工程" }) }),
352
- /* @__PURE__ */ d("div", { className: "phone-workspace-header-actions", children: [
353
- s === "list" ? /* @__PURE__ */ t(
354
- q,
355
- {
356
- type: "text",
357
- icon: /* @__PURE__ */ t(pe, {}),
358
- onClick: () => {
359
- },
360
- "aria-label": "新建"
361
- }
362
- ) : null,
363
- /* @__PURE__ */ t(
364
- q,
365
- {
366
- type: "text",
367
- icon: /* @__PURE__ */ t(me, {}),
368
- onClick: () => {
369
- Ae();
370
- },
371
- "aria-label": "退出"
372
- }
373
- )
374
- ] })
375
- ] }),
376
- /* @__PURE__ */ t("main", { className: "phone-workspace-main", children: s === "list" ? /* @__PURE__ */ d("div", { className: "phone-workspace-list", children: [
377
- /* @__PURE__ */ t("div", { className: "phone-workspace-search", children: /* @__PURE__ */ t(
378
- fe,
379
- {
380
- allowClear: !0,
381
- prefix: /* @__PURE__ */ t(he, {}),
382
- placeholder: "搜索项目",
383
- value: g,
384
- onChange: (e) => m(e.target.value)
385
- }
386
- ) }),
387
- ne && L.length === 0 ? /* @__PURE__ */ t("div", { className: "phone-workspace-list-loading", children: /* @__PURE__ */ t(O, { description: "加载项目…" }) }) : Z.length === 0 ? /* @__PURE__ */ t(
388
- Y,
389
- {
390
- description: g ? "无匹配项目" : "暂无项目",
391
- className: "phone-workspace-empty"
392
- }
393
- ) : /* @__PURE__ */ t("ul", { className: "phone-project-list", children: Z.map((e) => {
394
- const a = Te(
395
- e.created_at
396
- );
397
- return /* @__PURE__ */ t("li", { children: /* @__PURE__ */ d(
398
- "button",
399
- {
400
- type: "button",
401
- className: "phone-project-item",
402
- onClick: () => {
403
- ce(e);
404
- },
405
- children: [
406
- /* @__PURE__ */ d("div", { className: "phone-project-item-main", children: [
407
- /* @__PURE__ */ t("span", { className: "phone-project-item-name", children: e.name }),
408
- e.scenario_name || a ? /* @__PURE__ */ d("div", { className: "phone-project-item-meta", children: [
409
- e.scenario_name ? /* @__PURE__ */ t("span", { className: "phone-project-item-scenario", children: e.scenario_name }) : null,
410
- a ? /* @__PURE__ */ t("span", { className: "phone-project-item-time", children: a }) : null
411
- ] }) : null
412
- ] }),
413
- /* @__PURE__ */ t(
414
- ge,
415
- {
416
- color: e.role === "ADMIN" ? "blue" : "default",
417
- className: "phone-project-item-tag",
418
- children: e.role === "ADMIN" ? "我创建" : "参与"
419
- }
420
- )
421
- ]
422
- }
423
- ) }, e.id);
424
- }) })
425
- ] }) : /* @__PURE__ */ d("div", { className: "phone-workspace-detail", children: [
426
- /* @__PURE__ */ d("div", { className: "phone-project-toolbar", children: [
427
- /* @__PURE__ */ t("div", { className: "phone-project-toolbar-main", children: /* @__PURE__ */ t(
428
- "button",
429
- {
430
- type: "button",
431
- className: c === "chat" ? "phone-toolbar-tab phone-toolbar-active" : "phone-toolbar-tab",
432
- onClick: () => se("team"),
433
- children: "协作"
434
- }
435
- ) }),
436
- /* @__PURE__ */ d(
437
- "button",
438
- {
439
- type: "button",
440
- className: c === "members" ? "phone-toolbar-tab phone-toolbar-members phone-toolbar-active" : "phone-toolbar-tab phone-toolbar-members",
441
- onClick: () => r("members"),
442
- children: [
443
- "成员 (",
444
- W.length,
445
- ")"
446
- ]
447
- }
448
- )
449
- ] }),
450
- /* @__PURE__ */ t("div", { className: "phone-workspace-detail-body", children: c === "members" ? /* @__PURE__ */ t("ul", { className: "phone-member-list", children: W.length === 0 ? /* @__PURE__ */ t(Y, { description: "暂无成员" }) : W.map((e) => /* @__PURE__ */ d("li", { className: "phone-member-item", children: [
451
- /* @__PURE__ */ t("span", { className: "phone-member-avatar", children: e.member_type === "AGENT" ? "🤖" : "👤" }),
452
- /* @__PURE__ */ d("div", { className: "phone-member-info", children: [
453
- /* @__PURE__ */ t("span", { className: "phone-member-name", children: e.display_name }),
454
- /* @__PURE__ */ d("span", { className: "phone-member-meta", children: [
455
- e.member_type === "AGENT" ? "Agent" : "成员",
456
- " ·",
457
- " ",
458
- e.role
459
- ] })
460
- ] })
461
- ] }, e.id)) }) : /* @__PURE__ */ t("div", { className: "phone-chat-host", children: /* @__PURE__ */ t(
462
- Se,
463
- {
464
- hideTabs: !0,
465
- activeTab: N,
466
- onActiveTabChange: (e) => (
467
- // @ts-expect-error phase1 宽松化:tab 类型比 chatTab="team" 宽,业务代码未启用 content 模式
468
- h(e)
469
- )
470
- }
471
- ) }) })
472
- ] }) }),
473
- re ? /* @__PURE__ */ t("div", { className: "phone-workspace-overlay", children: /* @__PURE__ */ t(O, { description: "正在打开工程…" }) }) : null,
474
- /* @__PURE__ */ t(Ce, {})
475
- ] });
476
- }
477
- export {
478
- Je as default
479
- };