@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,315 +0,0 @@
1
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
- import { f as ie, r as z } from "./ctc-sso-DtJHC-2M.js";
3
- import { r as ne, h as X, s as oe } from "./sso-user-GnlYnP83.js";
4
- import { CheckCircleFilled as le, QuestionCircleOutlined as ce, CloseOutlined as me } from "@ant-design/icons";
5
- import { message as k, Result as de, Button as D, Spin as G, Input as ue, Image as fe } from "antd";
6
- import pe from "query-string";
7
- import { useState as f, useRef as Y, useMemo as K, useCallback as w, useEffect as V } from "react";
8
- import { useLocation as ge } from "react-router-dom";
9
- import { h as W } from "./history-BlrA1eaW.js";
10
- import { d as c, o as he, h as be, j as _e } from "./ComponentDoc-bhNM4jiY.js";
11
- /* empty css */
12
- import { b as ye } from "./mobile-client-O3yr9h6t.js";
13
- import { a as ve, s as we } from "./send-default-agent-team-message-YRd0CkeT.js";
14
- const Ne = 5e3, E = 9, Ce = 10 * 1024 * 1024, Se = /^image\//i, Ie = /\.(png|jpe?g|gif|bmp|webp)$/i;
15
- function Pe(a) {
16
- return a.type && Se.test(a.type) ? !0 : Ie.test(a.name || "");
17
- }
18
- function ke(a) {
19
- var o;
20
- if (!((o = a == null ? void 0 : a.items) != null && o.length))
21
- return [];
22
- const m = [];
23
- for (let p = 0; p < a.items.length; p += 1) {
24
- const d = a.items[p];
25
- if (d.kind === "file" && d.type.startsWith("image/")) {
26
- const N = d.getAsFile();
27
- N && m.push(N);
28
- }
29
- }
30
- return m;
31
- }
32
- function Ee(a) {
33
- return {
34
- id: `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
35
- file: a,
36
- previewUrl: URL.createObjectURL(a)
37
- };
38
- }
39
- function Q(a) {
40
- URL.revokeObjectURL(a.previewUrl);
41
- }
42
- function Ue(a) {
43
- return a.map((m) => m.file);
44
- }
45
- const J = 30;
46
- function Xe() {
47
- const a = ge(), m = pe.parse(a.search), o = String(
48
- m.scenarioCode ?? m.scenario_code ?? ""
49
- ).trim(), p = c((e) => e.expandProject), d = c((e) => e.updateCurrentUser), [N, H] = f(!1), [_, Z] = f(""), [y, U] = f([]), [M, R] = f("form"), [j, T] = f(""), [A, g] = f("正在登录…"), [B, F] = f([]), P = Y(!1), x = Y(y);
50
- x.current = y;
51
- const C = K(() => o ? "" : "缺少参数 scenarioCode", [o]), S = w((e, r) => {
52
- F((n) => [...n, e]), g(r);
53
- }, []), ee = (e) => new Promise((r) => {
54
- window.setTimeout(r, e);
55
- });
56
- V(() => {
57
- if (C)
58
- return;
59
- let e = !1, r = 0;
60
- const n = 100;
61
- let i = !1, s = 0;
62
- const v = 3;
63
- return (() => {
64
- if (e)
65
- return;
66
- const u = async () => {
67
- if (e)
68
- return;
69
- let h = ne();
70
- if ((!h || !X(h)) && !i) {
71
- i = !0;
72
- try {
73
- const b = await ie();
74
- b.kind === "authenticated" ? h = b.user : b.kind === "unauthenticated" && (s += 1);
75
- } catch {
76
- } finally {
77
- i = !1;
78
- }
79
- }
80
- if (h && X(h)) {
81
- d(oe(h));
82
- const b = c.getState().token;
83
- try {
84
- const se = await _e(b);
85
- e || d(se);
86
- } catch {
87
- !e && b && (localStorage.removeItem("z_team_token"), c.setState({ token: "" }));
88
- } finally {
89
- e || (H(!0), g(""));
90
- }
91
- return;
92
- }
93
- if (s >= v) {
94
- z();
95
- return;
96
- }
97
- if (r += 1, r >= n) {
98
- z();
99
- return;
100
- }
101
- window.setTimeout(() => void u(), 150);
102
- };
103
- u();
104
- })(), () => {
105
- e = !0;
106
- };
107
- }, [C, d]);
108
- const te = w(
109
- async (e, r) => {
110
- if (P.current)
111
- return;
112
- P.current = !0, R("loading"), F([]), g("正在按场景创建工程…");
113
- const n = e.slice(0, J), i = c.getState().token;
114
- try {
115
- let s = [];
116
- r.length > 0 && (g("正在上传图片…"), s = await he(r));
117
- const v = ve(e, s), I = await be(
118
- {
119
- name: n,
120
- description: v,
121
- workspace_path: n,
122
- scenario_code: o
123
- },
124
- i
125
- );
126
- S("工程已创建", "正在打开协作区…"), g("正在同步工程列表…"), await p(I);
127
- const u = c.getState();
128
- u.currentProject && await u.refreshProjectPanels(
129
- String(u.currentProject.id),
130
- u.projectSwitchSeq,
131
- !1
132
- ), S("协作区已就绪", "正在发送协作消息…"), await we(
133
- I.id,
134
- e,
135
- i,
136
- c.getState().members,
137
- s
138
- ), await c.getState().loadMessages(), S("协作消息已发送", "即将进入工作台…"), g("即将进入工作台…"), await ee(2e3), W.replace(
139
- ye({
140
- projectId: I.id,
141
- search: a.search
142
- })
143
- );
144
- } catch (s) {
145
- P.current = !1, R("form");
146
- const v = s instanceof Error ? s.message : String(s);
147
- T(v || "创建工程失败");
148
- }
149
- },
150
- [S, p, a.search, o]
151
- ), L = w((e) => {
152
- e.length && U((r) => {
153
- const n = E - r.length;
154
- if (n <= 0)
155
- return k.warning(`最多粘贴 ${E} 张图片`), r;
156
- const i = [...r];
157
- for (const s of e.slice(0, n)) {
158
- if (!Pe(s)) {
159
- k.warning("仅支持粘贴图片");
160
- continue;
161
- }
162
- if (s.size > Ce) {
163
- k.warning("单张图片不能超过 10MB");
164
- continue;
165
- }
166
- i.push(Ee(s));
167
- }
168
- return i;
169
- });
170
- }, []), re = w((e) => {
171
- U((r) => {
172
- const n = r.find((i) => i.id === e);
173
- return n && Q(n), r.filter((i) => i.id !== e);
174
- });
175
- }, []);
176
- V(() => () => {
177
- x.current.forEach(Q);
178
- }, []);
179
- const ae = w(
180
- (e) => {
181
- const r = ke(e.clipboardData);
182
- r.length > 0 && (e.preventDefault(), L(r));
183
- },
184
- [L]
185
- ), $ = () => {
186
- const e = _.trim();
187
- e && (T(""), te(e, Ue(y)));
188
- }, O = K(() => {
189
- const e = _.trim().slice(0, J);
190
- return `场景 ${o}${e ? ` · ${e}` : ""}`;
191
- }, [_, o]);
192
- if (C || j && M === "form")
193
- return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t(
194
- de,
195
- {
196
- status: "error",
197
- title: "无法继续",
198
- subTitle: C || j,
199
- extra: /* @__PURE__ */ t(
200
- D,
201
- {
202
- type: "primary",
203
- onClick: () => W.replace("/workspace"),
204
- children: "返回工作台"
205
- }
206
- )
207
- }
208
- ) });
209
- if (!N)
210
- return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__panel", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__loading", children: [
211
- /* @__PURE__ */ t(G, { size: "large" }),
212
- /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A || "正在登录…" })
213
- ] }) }) }) });
214
- if (M === "loading")
215
- return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__panel", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__loading", children: [
216
- /* @__PURE__ */ t(G, { size: "large" }),
217
- /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A }),
218
- O ? /* @__PURE__ */ t("p", { className: "build-by-form-page__meta", children: O }) : null,
219
- B.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__done-list", children: B.map((e, r) => /* @__PURE__ */ l(
220
- "li",
221
- {
222
- className: "build-by-form-page__done-item",
223
- children: [
224
- /* @__PURE__ */ t(le, { className: "build-by-form-page__done-icon" }),
225
- /* @__PURE__ */ t("span", { children: e })
226
- ]
227
- },
228
- `${r}-${e}`
229
- )) }) : null
230
- ] }) }) }) });
231
- const q = !!_.trim();
232
- return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t("div", { className: "build-by-form-page__shell", children: /* @__PURE__ */ l("div", { className: "build-by-form-page__panel", children: [
233
- /* @__PURE__ */ l("div", { className: "build-by-form-page__header", children: [
234
- /* @__PURE__ */ t("div", { className: "build-by-form-page__icon", "aria-hidden": !0, children: /* @__PURE__ */ t(ce, {}) }),
235
- /* @__PURE__ */ l("div", { children: [
236
- /* @__PURE__ */ t("h1", { className: "build-by-form-page__title", children: "描述你的问题" }),
237
- /* @__PURE__ */ t("p", { className: "build-by-form-page__subtitle", children: "提交后将创建协作空间,并把问题发送给智能体" })
238
- ] })
239
- ] }),
240
- /* @__PURE__ */ l("div", { className: "build-by-form-page__field", onPaste: ae, children: [
241
- /* @__PURE__ */ t(
242
- "label",
243
- {
244
- className: "build-by-form-page__label",
245
- htmlFor: "build-by-form-question",
246
- children: "请描述问题"
247
- }
248
- ),
249
- /* @__PURE__ */ t(
250
- ue.TextArea,
251
- {
252
- id: "build-by-form-question",
253
- className: "build-by-form-page__textarea",
254
- value: _,
255
- onChange: (e) => Z(e.target.value),
256
- onKeyDown: (e) => {
257
- (e.metaKey || e.ctrlKey) && e.key === "Enter" && q && (e.preventDefault(), $());
258
- },
259
- placeholder: "请尽量描述清楚现象、期望结果或相关背景…(可在输入框内 Ctrl+V 粘贴图片)",
260
- autoSize: { minRows: 6, maxRows: 14 },
261
- maxLength: Ne,
262
- showCount: !0,
263
- autoFocus: !0
264
- }
265
- ),
266
- y.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__preview-list", children: y.map((e) => /* @__PURE__ */ l(
267
- "li",
268
- {
269
- className: "build-by-form-page__preview-item",
270
- children: [
271
- /* @__PURE__ */ t(
272
- fe,
273
- {
274
- src: e.previewUrl,
275
- alt: "粘贴的图片",
276
- className: "build-by-form-page__preview-img",
277
- preview: { mask: "预览" }
278
- }
279
- ),
280
- /* @__PURE__ */ t(
281
- "button",
282
- {
283
- type: "button",
284
- className: "build-by-form-page__preview-remove",
285
- "aria-label": "移除图片",
286
- onClick: () => re(e.id),
287
- children: /* @__PURE__ */ t(me, {})
288
- }
289
- )
290
- ]
291
- },
292
- e.id
293
- )) }) : /* @__PURE__ */ l("p", { className: "build-by-form-page__paste-hint", children: [
294
- "支持 Ctrl+V / ⌘+V 粘贴图片,最多 ",
295
- E,
296
- " 张"
297
- ] })
298
- ] }),
299
- /* @__PURE__ */ t(
300
- D,
301
- {
302
- type: "primary",
303
- block: !0,
304
- size: "large",
305
- className: "build-by-form-page__submit",
306
- disabled: !q,
307
- onClick: $,
308
- children: "确认并开始"
309
- }
310
- )
311
- ] }) }) });
312
- }
313
- export {
314
- Xe as default
315
- };