@yuku123/z-team-component 0.2.80 → 0.2.83

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 (51) hide show
  1. package/dist/ChangeLogView-_bRZ55Yi.js +542 -0
  2. package/dist/ComponentDoc-BFoF51we.js +3998 -0
  3. package/dist/InvitationManagementPage-CTPCZXHu.js +495 -0
  4. package/dist/OnboardingPage-DwtuTL61.js +393 -0
  5. package/dist/ScheduledTasks-yeTm2bOY.js +9407 -0
  6. package/dist/SystemShell-D9OzKxL-.js +689 -0
  7. package/dist/_commonjsHelpers-B52_cu2H.js +26 -0
  8. package/dist/api-CIhVblfa.js +2155 -0
  9. package/dist/api-DXLNhtCX.js +20 -0
  10. package/dist/browser-jb_PFvU3.js +1538 -0
  11. package/dist/createWorkspaceWsHandler-BWP5S5X3.js +12951 -0
  12. package/dist/ctc-sso-DtJHC-2M.js +117 -0
  13. package/dist/echarts-B1OU1xr4.js +16 -0
  14. package/dist/history-BlrA1eaW.js +41 -0
  15. package/dist/index-BCp5EtqR.js +914 -0
  16. package/dist/index-BHrMl3Jq.js +9585 -0
  17. package/dist/index-BP7WTzVH.js +137 -0
  18. package/dist/index-B_LJRFsK.js +339 -0
  19. package/dist/index-BgIheStI.js +133 -0
  20. package/dist/index-BohoJQPr.js +7631 -0
  21. package/dist/index-BydWNuk5.js +1229 -0
  22. package/dist/index-C815hPWS.js +430 -0
  23. package/dist/index-CBQMS6rx.js +178 -0
  24. package/dist/index-CESmMALI.js +242 -0
  25. package/dist/index-CUVdeb8y.js +638 -0
  26. package/dist/index-CijskN6t.js +316 -0
  27. package/dist/index-CoBZZQBy.js +112 -0
  28. package/dist/index-Co_0idJY.js +2936 -0
  29. package/dist/index-Cvx6rrxD.js +956 -0
  30. package/dist/index-Cwr5Slv1.js +480 -0
  31. package/dist/index-CxFAICql.js +42050 -0
  32. package/dist/index-DK70mOTz.js +143 -0
  33. package/dist/index-DT80Pwa_.js +5893 -0
  34. package/dist/index-DWsfQMp8.js +208 -0
  35. package/dist/index-DhDdFRHC.js +279 -0
  36. package/dist/index-Dm3wmB0K.js +435 -0
  37. package/dist/index-DzS6-D3M.js +1640 -0
  38. package/dist/index-PKkV63Sw.js +1143 -0
  39. package/dist/index-SbMjh8t4.js +574 -0
  40. package/dist/index-cdB5K3gx.js +814 -0
  41. package/dist/index-mnWs_wA3.js +93 -0
  42. package/dist/index-nU-V276i.js +170 -0
  43. package/dist/index-nW0ikV2R.js +2700 -0
  44. package/dist/index-uF04Ucsi.js +8 -0
  45. package/dist/index-x_7Rmav9.js +118 -0
  46. package/dist/index.js +10 -0
  47. package/dist/index.module-CAa-2T7m.js +72 -0
  48. package/dist/index.module-UI0iz8K0.js +42 -0
  49. package/dist/{menuPermission-D9NGpBZP.js → menuPermission-DHUqvHfu.js} +1 -1
  50. package/dist/pages.js +1 -1
  51. package/package.json +1 -1
@@ -0,0 +1,316 @@
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-ZUKv4XMX.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 { l as he, d as be, e as _e } from "./api-CIhVblfa.js";
11
+ import { u as c } from "./useAppStore-BBr_Fwsz.js";
12
+ /* empty css */
13
+ import { b as ye } from "./mobile-client-O3yr9h6t.js";
14
+ import { a as ve, s as we } from "./send-default-agent-team-message-CfVaEN2y.js";
15
+ const Ne = 5e3, E = 9, Ce = 10 * 1024 * 1024, Se = /^image\//i, Ie = /\.(png|jpe?g|gif|bmp|webp)$/i;
16
+ function Pe(a) {
17
+ return a.type && Se.test(a.type) ? !0 : Ie.test(a.name || "");
18
+ }
19
+ function ke(a) {
20
+ var o;
21
+ if (!((o = a == null ? void 0 : a.items) != null && o.length))
22
+ return [];
23
+ const m = [];
24
+ for (let p = 0; p < a.items.length; p += 1) {
25
+ const d = a.items[p];
26
+ if (d.kind === "file" && d.type.startsWith("image/")) {
27
+ const N = d.getAsFile();
28
+ N && m.push(N);
29
+ }
30
+ }
31
+ return m;
32
+ }
33
+ function Ee(a) {
34
+ return {
35
+ id: `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`,
36
+ file: a,
37
+ previewUrl: URL.createObjectURL(a)
38
+ };
39
+ }
40
+ function Q(a) {
41
+ URL.revokeObjectURL(a.previewUrl);
42
+ }
43
+ function Ue(a) {
44
+ return a.map((m) => m.file);
45
+ }
46
+ const J = 30;
47
+ function De() {
48
+ const a = ge(), m = pe.parse(a.search), o = String(
49
+ m.scenarioCode ?? m.scenario_code ?? ""
50
+ ).trim(), p = c((e) => e.expandProject), d = c((e) => e.updateCurrentUser), [N, H] = f(!1), [_, Z] = f(""), [y, U] = f([]), [M, R] = f("form"), [T, j] = f(""), [A, g] = f("正在登录…"), [B, F] = f([]), P = Y(!1), x = Y(y);
51
+ x.current = y;
52
+ const C = K(() => o ? "" : "缺少参数 scenarioCode", [o]), S = w((e, r) => {
53
+ F((n) => [...n, e]), g(r);
54
+ }, []), ee = (e) => new Promise((r) => {
55
+ window.setTimeout(r, e);
56
+ });
57
+ V(() => {
58
+ if (C)
59
+ return;
60
+ let e = !1, r = 0;
61
+ const n = 100;
62
+ let i = !1, s = 0;
63
+ const v = 3;
64
+ return (() => {
65
+ if (e)
66
+ return;
67
+ const u = async () => {
68
+ if (e)
69
+ return;
70
+ let h = ne();
71
+ if ((!h || !X(h)) && !i) {
72
+ i = !0;
73
+ try {
74
+ const b = await ie();
75
+ b.kind === "authenticated" ? h = b.user : b.kind === "unauthenticated" && (s += 1);
76
+ } catch {
77
+ } finally {
78
+ i = !1;
79
+ }
80
+ }
81
+ if (h && X(h)) {
82
+ d(oe(h));
83
+ const b = c.getState().token;
84
+ try {
85
+ const se = await _e(b);
86
+ e || d(se);
87
+ } catch {
88
+ !e && b && (localStorage.removeItem("z_team_token"), c.setState({ token: "" }));
89
+ } finally {
90
+ e || (H(!0), g(""));
91
+ }
92
+ return;
93
+ }
94
+ if (s >= v) {
95
+ z();
96
+ return;
97
+ }
98
+ if (r += 1, r >= n) {
99
+ z();
100
+ return;
101
+ }
102
+ window.setTimeout(() => void u(), 150);
103
+ };
104
+ u();
105
+ })(), () => {
106
+ e = !0;
107
+ };
108
+ }, [C, d]);
109
+ const te = w(
110
+ async (e, r) => {
111
+ if (P.current)
112
+ return;
113
+ P.current = !0, R("loading"), F([]), g("正在按场景创建工程…");
114
+ const n = e.slice(0, J), i = c.getState().token;
115
+ try {
116
+ let s = [];
117
+ r.length > 0 && (g("正在上传图片…"), s = await he(r));
118
+ const v = ve(e, s), I = await be(
119
+ {
120
+ name: n,
121
+ description: v,
122
+ workspace_path: n,
123
+ scenario_code: o
124
+ },
125
+ i
126
+ );
127
+ S("工程已创建", "正在打开协作区…"), g("正在同步工程列表…"), await p(I);
128
+ const u = c.getState();
129
+ u.currentProject && await u.refreshProjectPanels(
130
+ String(u.currentProject.id),
131
+ u.projectSwitchSeq,
132
+ !1
133
+ ), S("协作区已就绪", "正在发送协作消息…"), await we(
134
+ I.id,
135
+ e,
136
+ i,
137
+ c.getState().members,
138
+ s
139
+ ), await c.getState().loadMessages(), S("协作消息已发送", "即将进入工作台…"), g("即将进入工作台…"), await ee(2e3), W.replace(
140
+ ye({
141
+ projectId: I.id,
142
+ search: a.search
143
+ })
144
+ );
145
+ } catch (s) {
146
+ P.current = !1, R("form");
147
+ const v = s instanceof Error ? s.message : String(s);
148
+ j(v || "创建工程失败");
149
+ }
150
+ },
151
+ [S, p, a.search, o]
152
+ ), L = w((e) => {
153
+ e.length && U((r) => {
154
+ const n = E - r.length;
155
+ if (n <= 0)
156
+ return k.warning(`最多粘贴 ${E} 张图片`), r;
157
+ const i = [...r];
158
+ for (const s of e.slice(0, n)) {
159
+ if (!Pe(s)) {
160
+ k.warning("仅支持粘贴图片");
161
+ continue;
162
+ }
163
+ if (s.size > Ce) {
164
+ k.warning("单张图片不能超过 10MB");
165
+ continue;
166
+ }
167
+ i.push(Ee(s));
168
+ }
169
+ return i;
170
+ });
171
+ }, []), re = w((e) => {
172
+ U((r) => {
173
+ const n = r.find((i) => i.id === e);
174
+ return n && Q(n), r.filter((i) => i.id !== e);
175
+ });
176
+ }, []);
177
+ V(() => () => {
178
+ x.current.forEach(Q);
179
+ }, []);
180
+ const ae = w(
181
+ (e) => {
182
+ const r = ke(e.clipboardData);
183
+ r.length > 0 && (e.preventDefault(), L(r));
184
+ },
185
+ [L]
186
+ ), $ = () => {
187
+ const e = _.trim();
188
+ e && (j(""), te(e, Ue(y)));
189
+ }, O = K(() => {
190
+ const e = _.trim().slice(0, J);
191
+ return `场景 ${o}${e ? ` · ${e}` : ""}`;
192
+ }, [_, o]);
193
+ if (C || T && M === "form")
194
+ return /* @__PURE__ */ t("div", { className: "build-by-form-page", children: /* @__PURE__ */ t(
195
+ de,
196
+ {
197
+ status: "error",
198
+ title: "无法继续",
199
+ subTitle: C || T,
200
+ extra: /* @__PURE__ */ t(
201
+ D,
202
+ {
203
+ type: "primary",
204
+ onClick: () => W.replace("/workspace"),
205
+ children: "返回工作台"
206
+ }
207
+ )
208
+ }
209
+ ) });
210
+ if (!N)
211
+ 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: [
212
+ /* @__PURE__ */ t(G, { size: "large" }),
213
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A || "正在登录…" })
214
+ ] }) }) }) });
215
+ if (M === "loading")
216
+ 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: [
217
+ /* @__PURE__ */ t(G, { size: "large" }),
218
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__step", children: A }),
219
+ O ? /* @__PURE__ */ t("p", { className: "build-by-form-page__meta", children: O }) : null,
220
+ B.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__done-list", children: B.map((e, r) => /* @__PURE__ */ l(
221
+ "li",
222
+ {
223
+ className: "build-by-form-page__done-item",
224
+ children: [
225
+ /* @__PURE__ */ t(le, { className: "build-by-form-page__done-icon" }),
226
+ /* @__PURE__ */ t("span", { children: e })
227
+ ]
228
+ },
229
+ `${r}-${e}`
230
+ )) }) : null
231
+ ] }) }) }) });
232
+ const q = !!_.trim();
233
+ 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: [
234
+ /* @__PURE__ */ l("div", { className: "build-by-form-page__header", children: [
235
+ /* @__PURE__ */ t("div", { className: "build-by-form-page__icon", "aria-hidden": !0, children: /* @__PURE__ */ t(ce, {}) }),
236
+ /* @__PURE__ */ l("div", { children: [
237
+ /* @__PURE__ */ t("h1", { className: "build-by-form-page__title", children: "描述你的问题" }),
238
+ /* @__PURE__ */ t("p", { className: "build-by-form-page__subtitle", children: "提交后将创建协作空间,并把问题发送给智能体" })
239
+ ] })
240
+ ] }),
241
+ /* @__PURE__ */ l("div", { className: "build-by-form-page__field", onPaste: ae, children: [
242
+ /* @__PURE__ */ t(
243
+ "label",
244
+ {
245
+ className: "build-by-form-page__label",
246
+ htmlFor: "build-by-form-question",
247
+ children: "请描述问题"
248
+ }
249
+ ),
250
+ /* @__PURE__ */ t(
251
+ ue.TextArea,
252
+ {
253
+ id: "build-by-form-question",
254
+ className: "build-by-form-page__textarea",
255
+ value: _,
256
+ onChange: (e) => Z(e.target.value),
257
+ onKeyDown: (e) => {
258
+ (e.metaKey || e.ctrlKey) && e.key === "Enter" && q && (e.preventDefault(), $());
259
+ },
260
+ placeholder: "请尽量描述清楚现象、期望结果或相关背景…(可在输入框内 Ctrl+V 粘贴图片)",
261
+ autoSize: { minRows: 6, maxRows: 14 },
262
+ maxLength: Ne,
263
+ showCount: !0,
264
+ autoFocus: !0
265
+ }
266
+ ),
267
+ y.length > 0 ? /* @__PURE__ */ t("ul", { className: "build-by-form-page__preview-list", children: y.map((e) => /* @__PURE__ */ l(
268
+ "li",
269
+ {
270
+ className: "build-by-form-page__preview-item",
271
+ children: [
272
+ /* @__PURE__ */ t(
273
+ fe,
274
+ {
275
+ src: e.previewUrl,
276
+ alt: "粘贴的图片",
277
+ className: "build-by-form-page__preview-img",
278
+ preview: { mask: "预览" }
279
+ }
280
+ ),
281
+ /* @__PURE__ */ t(
282
+ "button",
283
+ {
284
+ type: "button",
285
+ className: "build-by-form-page__preview-remove",
286
+ "aria-label": "移除图片",
287
+ onClick: () => re(e.id),
288
+ children: /* @__PURE__ */ t(me, {})
289
+ }
290
+ )
291
+ ]
292
+ },
293
+ e.id
294
+ )) }) : /* @__PURE__ */ l("p", { className: "build-by-form-page__paste-hint", children: [
295
+ "支持 Ctrl+V / ⌘+V 粘贴图片,最多 ",
296
+ E,
297
+ " 张"
298
+ ] })
299
+ ] }),
300
+ /* @__PURE__ */ t(
301
+ D,
302
+ {
303
+ type: "primary",
304
+ block: !0,
305
+ size: "large",
306
+ className: "build-by-form-page__submit",
307
+ disabled: !q,
308
+ onClick: $,
309
+ children: "确认并开始"
310
+ }
311
+ )
312
+ ] }) }) });
313
+ }
314
+ export {
315
+ De as default
316
+ };
@@ -0,0 +1,112 @@
1
+ import { jsxs as u, jsx as t } from "react/jsx-runtime";
2
+ import { useState as L, useMemo as p } from "react";
3
+ import { useNavigate as v, useLocation as A } from "react-router-dom";
4
+ import { DownOutlined as k, RightOutlined as w } from "@ant-design/icons";
5
+ import { P as W, R as $ } from "./index-mnWs_wA3.js";
6
+ import { f as E, M as g } from "./menuPermission-DHUqvHfu.js";
7
+ import { u as j } from "./useAppStore-BBr_Fwsz.js";
8
+ const H = "_shell_1jjcx_7", M = "_sidebar_1jjcx_15", R = "_menuList_1jjcx_37", T = "_menuGroup_1jjcx_43", C = "_menuGroupHeader_1jjcx_47", P = "_menuGroupIcon_1jjcx_65", z = "_menuGroupLabel_1jjcx_70", K = "_menuGroupArrow_1jjcx_74", U = "_menuSubList_1jjcx_80", Z = "_menuSubItem_1jjcx_86", B = "_menuSubItemActive_1jjcx_103", D = "_menuSubItemIcon_1jjcx_110", O = "_menuSubItemLabel_1jjcx_115", q = "_menuSubItemWrap_1jjcx_119", F = "_main_1jjcx_123", J = "_empty_1jjcx_134", Q = "_emptyIcon_1jjcx_144", V = "_emptyText_1jjcx_149", n = {
9
+ shell: H,
10
+ sidebar: M,
11
+ menuList: R,
12
+ menuGroup: T,
13
+ menuGroupHeader: C,
14
+ menuGroupIcon: P,
15
+ menuGroupLabel: z,
16
+ menuGroupArrow: K,
17
+ menuSubList: U,
18
+ menuSubItem: Z,
19
+ menuSubItemActive: B,
20
+ menuSubItemIcon: D,
21
+ menuSubItemLabel: O,
22
+ menuSubItemWrap: q,
23
+ main: F,
24
+ empty: J,
25
+ emptyIcon: Q,
26
+ emptyText: V
27
+ };
28
+ function X(m, r) {
29
+ for (const s of m)
30
+ if (s.path === r) return s.element;
31
+ for (const s of m)
32
+ if (s.path.includes("*") || s.path.includes(":")) {
33
+ const i = "^" + s.path.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*").replace(/:([a-zA-Z_][a-zA-Z0-9_]*)/g, "[^/]+") + "$";
34
+ if (new RegExp(i).test(r)) return s.element;
35
+ }
36
+ return null;
37
+ }
38
+ function Y({ text: m }) {
39
+ return /* @__PURE__ */ u("div", { className: n.empty, children: [
40
+ /* @__PURE__ */ t("div", { className: n.emptyIcon, children: "⚙️" }),
41
+ /* @__PURE__ */ t("div", { className: n.emptyText, children: m })
42
+ ] });
43
+ }
44
+ function oe({
45
+ groups: m,
46
+ routes: r,
47
+ mode: s,
48
+ emptyText: i,
49
+ activePathOverride: _,
50
+ menuOnly: h = !1
51
+ }) {
52
+ const I = v(), { pathname: a } = A(), d = j((e) => e.currentUser), b = j((e) => e.permissionState), [x, S] = L(
53
+ new Set(m.map((e) => e.title))
54
+ ), l = p(
55
+ () => b === "failed" ? m : E(m, d),
56
+ [m, d, b]
57
+ ), f = p(() => {
58
+ const e = _ ?? a;
59
+ for (const o of l)
60
+ for (const c of o.items)
61
+ if (c.path === e) return c.key;
62
+ return null;
63
+ }, [l, _, a]), G = (e) => {
64
+ S((o) => {
65
+ const c = new Set(o);
66
+ return c.has(e) ? c.delete(e) : c.add(e), c;
67
+ });
68
+ }, y = (e) => {
69
+ I(`${e.path}?mode=${s}`);
70
+ }, N = p(() => X(r, a), [r, a]);
71
+ return /* @__PURE__ */ u("div", { className: n.shell, children: [
72
+ /* @__PURE__ */ u("aside", { className: n.sidebar, children: [
73
+ /* @__PURE__ */ t(g, {}),
74
+ /* @__PURE__ */ t("nav", { className: n.menuList, children: l.map((e) => {
75
+ const o = x.has(e.title);
76
+ return /* @__PURE__ */ u("div", { className: n.menuGroup, children: [
77
+ /* @__PURE__ */ u(
78
+ "div",
79
+ {
80
+ className: n.menuGroupHeader,
81
+ onClick: () => G(e.title),
82
+ children: [
83
+ /* @__PURE__ */ t("span", { className: n.menuGroupIcon, children: e.icon }),
84
+ /* @__PURE__ */ t("span", { className: n.menuGroupLabel, children: e.title }),
85
+ /* @__PURE__ */ t("span", { className: n.menuGroupArrow, children: o ? /* @__PURE__ */ t(k, {}) : /* @__PURE__ */ t(w, {}) })
86
+ ]
87
+ }
88
+ ),
89
+ o && /* @__PURE__ */ t("ul", { className: n.menuSubList, children: e.items.map((c) => /* @__PURE__ */ u(
90
+ "li",
91
+ {
92
+ className: `${n.menuSubItemWrap} ${n.menuSubItem} ${f === c.key ? n.menuSubItemActive : ""}`,
93
+ onClick: () => y(c),
94
+ children: [
95
+ /* @__PURE__ */ t("span", { className: n.menuSubItemIcon, children: c.icon }),
96
+ /* @__PURE__ */ t("span", { className: n.menuSubItemLabel, children: c.label })
97
+ ]
98
+ },
99
+ c.key
100
+ )) })
101
+ ] }, e.title);
102
+ }) })
103
+ ] }),
104
+ h ? null : /* @__PURE__ */ u("main", { className: n.main, children: [
105
+ /* @__PURE__ */ t(W, {}),
106
+ /* @__PURE__ */ t($, { resetKey: a, children: N ?? /* @__PURE__ */ t(Y, { text: i }) })
107
+ ] })
108
+ ] });
109
+ }
110
+ export {
111
+ oe as W
112
+ };