@yuku123/z-team-component 0.2.91 → 0.2.93

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 (54) hide show
  1. package/dist/{ChangeLogView-DagOxr6O.js → ChangeLogView-BjV4gBq4.js} +12 -12
  2. package/dist/ComponentDoc-C9lt-45y.js +8035 -0
  3. package/dist/{InvitationManagementPage-DYoqQA0v.js → InvitationManagementPage-CWtBWLd9.js} +1 -1
  4. package/dist/{OnboardingPage-D2Gm8MRd.js → OnboardingPage-B2fwh4gu.js} +2 -2
  5. package/dist/{ScheduledTasks-DB3VxAnb.js → ScheduledTasks-CuQyjAK-.js} +4341 -4337
  6. package/dist/{SystemShell-D3jHItxY.js → SystemShell-CTkRb3jk.js} +11 -12
  7. package/dist/admin-logs-Dh41ezP6.js +198 -0
  8. package/dist/{api-DYsAzJJo.js → api-ChrRZOc4.js} +1 -1
  9. package/dist/createWorkspaceWsHandler-DMw_Vk6i.js +13135 -0
  10. package/dist/{index-152G-_4j.js → index-3JPBTMXq.js} +5 -6
  11. package/dist/{index-CLD5lLa6.js → index-7glbcqX1.js} +19 -19
  12. package/dist/{index-CSpckSHg.js → index-BYpA6zMn.js} +23 -23
  13. package/dist/{index-BydWNuk5.js → index-BZCQSW-G.js} +44 -51
  14. package/dist/{index-CLfhHxPf.js → index-B_2fxZ6u.js} +1 -1
  15. package/dist/{index-B5dDwxhs.js → index-BnRRZ6Iv.js} +1 -1
  16. package/dist/{index-W_4faD_M.js → index-C-XgeN0c.js} +2 -2
  17. package/dist/index-CA0ql0r3.js +3495 -0
  18. package/dist/{index-CgWa7RFv.js → index-CIGBLmd6.js} +23 -24
  19. package/dist/{index-Cggl78j7.js → index-CLSOhZRs.js} +5 -6
  20. package/dist/index-CLnmI_a7.js +316 -0
  21. package/dist/{index-BfzgRKii.js → index-CSXrOBjf.js} +90 -91
  22. package/dist/{index-ues0LW7p.js → index-CdqU0NUf.js} +1257 -1258
  23. package/dist/{index-BMQ6XkO3.js → index-CnWYolUK.js} +1 -1
  24. package/dist/{index-CYyFYmlZ.js → index-CrQpBHe1.js} +8 -9
  25. package/dist/{index-BZ12pY96.js → index-D1_tbmUH.js} +2 -2
  26. package/dist/{index-CZyFAmEq.js → index-DNo7i9f6.js} +10 -11
  27. package/dist/{index-DE82vM_4.js → index-DPyEBso8.js} +19 -18
  28. package/dist/{index-DyQ9YnMd.js → index-DdvzONMo.js} +3663 -3537
  29. package/dist/{index-Dwqa30HZ.js → index-Dq4oBpcb.js} +4 -4
  30. package/dist/{index-C8cR7lJw.js → index-DtIPLfks.js} +10 -11
  31. package/dist/{index-Cw6MIoNv.js → index-Dy6vNz1c.js} +6 -7
  32. package/dist/{index-VGtET31b.js → index-bkqC-Ys8.js} +1 -1
  33. package/dist/{index-E4Q6JmzX.js → index-fab1eszg.js} +3 -3
  34. package/dist/{index-BYe87pnq.js → index-vIdK5WMU.js} +11 -12
  35. package/dist/index.js +1 -1
  36. package/dist/{instance-CI6-4BZ6.js → instance-BY043pYn.js} +1 -1
  37. package/dist/{menuPermission-C33I6ujb.js → menuPermission-BeYwZcoW.js} +11 -11
  38. package/dist/pages.js +8 -8
  39. package/dist/{send-default-agent-team-message-c5oKdQQA.js → send-default-agent-team-message-BN61cG7q.js} +1 -1
  40. package/dist/{sso-user-DToM5dPy.js → sso-user-DmsDr1MJ.js} +1 -1
  41. package/dist/{training-B38tnwLL.js → training-CU6j5m-5.js} +1 -1
  42. package/dist/webide-BYaEjOx6.js +5233 -0
  43. package/dist/z-team-component.css +1 -26
  44. package/package.json +3 -2
  45. package/dist/ComponentDoc-Bqfu128t.js +0 -3998
  46. package/dist/admin-logs-ogvMwS4O.js +0 -302
  47. package/dist/api-BftpestH.js +0 -2156
  48. package/dist/createWorkspaceWsHandler-D8h5BEzH.js +0 -13030
  49. package/dist/index-BaCqZeiw.js +0 -1143
  50. package/dist/index-CUVdeb8y.js +0 -638
  51. package/dist/index-DVaTGA2z.js +0 -3488
  52. package/dist/schedule-ChO2xIGd.js +0 -625
  53. package/dist/useAppStore-uc8v8XZC.js +0 -1920
  54. package/dist/webide-BuUYLPSp.js +0 -8399
@@ -1,638 +0,0 @@
1
- import { jsxs as K, jsx as s, Fragment as re } from "react/jsx-runtime";
2
- import { BoldOutlined as ne, ItalicOutlined as ie, StrikethroughOutlined as oe, UnorderedListOutlined as se, OrderedListOutlined as ae, CheckSquareOutlined as ce, CodeOutlined as le, ConsoleSqlOutlined as ue, LinkOutlined as de, PictureOutlined as me, TableOutlined as fe } from "@ant-design/icons";
3
- import { message as O, Empty as U, Tooltip as pe, Button as ge } from "antd";
4
- import { useRef as M, useState as he, useEffect as A, forwardRef as we, useImperativeHandle as ye, useCallback as L } from "react";
5
- import Ee from "vditor";
6
- import ve from "react-markdown";
7
- import _e from "rehype-highlight";
8
- import Me from "remark-gfm";
9
- const be = "_wrap_ihp63_1", Te = "_live_ihp63_11", ke = "_mdToolbar_ihp63_158", Le = "_mdBtn_ihp63_169", Se = "_mdSep_ihp63_185", De = "_textarea_ihp63_193", Ce = "_preview_ihp63_207", qe = "_mermaid_ihp63_298", xe = "_mermaidError_ihp63_309", Ae = "_mermaidErrorTitle_ihp63_317", Pe = "_mermaidErrorMsg_ihp63_324", Be = "_mermaidSource_ihp63_331", g = {
10
- wrap: be,
11
- live: Te,
12
- mdToolbar: ke,
13
- mdBtn: Le,
14
- mdSep: Se,
15
- textarea: De,
16
- preview: Ce,
17
- mermaid: qe,
18
- mermaidError: xe,
19
- mermaidErrorTitle: Ae,
20
- mermaidErrorMsg: Pe,
21
- mermaidSource: Be
22
- }, Re = /* @__PURE__ */ new Set(["sequencediagram", "sequence"]), Fe = "\n```mermaid\nflowchart TD\n A[开始] --> B[结束]\n```\n", Ne = `
23
- \`\`\`mermaid
24
- sequenceDiagram
25
- participant A as 用户
26
- participant B as 系统
27
- A->>B: 请求
28
- B-->>A: 响应
29
- \`\`\`
30
- `;
31
- function Oe(t) {
32
- return t ? /\blanguage-(mermaid|sequencediagram|sequence)\b/i.test(t) : !1;
33
- }
34
- function Ie(t, i) {
35
- const r = t.replace(/\r\n/g, `
36
- `).trim();
37
- if (!r) return r;
38
- const a = (i || "").replace(/^language-/i, "").toLowerCase();
39
- return Re.has(a) && !/^sequenceDiagram\b/i.test(r) ? `sequenceDiagram
40
- ${r}` : r;
41
- }
42
- let I = null, Q = !1;
43
- function Ke() {
44
- const t = window.publicPath || "/";
45
- return `${String(t).replace(/\/$/, "")}/vditor`;
46
- }
47
- function $e(t) {
48
- return new Promise((i, r) => {
49
- if (window.mermaid) {
50
- i();
51
- return;
52
- }
53
- const a = document.querySelector(`script[src="${t}"]`);
54
- if (a) {
55
- a.addEventListener("load", () => i(), { once: !0 }), a.addEventListener(
56
- "error",
57
- () => r(new Error("mermaid load failed")),
58
- { once: !0 }
59
- );
60
- return;
61
- }
62
- const l = document.createElement("script");
63
- l.src = t, l.async = !0, l.onload = () => i(), l.onerror = () => r(new Error("mermaid load failed")), document.head.appendChild(l);
64
- });
65
- }
66
- function je() {
67
- return Q && window.mermaid ? Promise.resolve() : (I || (I = $e(
68
- `${Ke()}/dist/js/mermaid/mermaid.min.js?v=11.16.1`
69
- ).then(() => {
70
- if (!window.mermaid)
71
- throw new Error("mermaid unavailable");
72
- window.mermaid.initialize({
73
- securityLevel: "loose",
74
- startOnLoad: !1,
75
- fontFamily: "sans-serif",
76
- altFontFamily: "sans-serif",
77
- flowchart: { htmlLabels: !0, useMaxWidth: !0 },
78
- sequence: {
79
- useMaxWidth: !0,
80
- diagramMarginX: 8,
81
- diagramMarginY: 8,
82
- boxMargin: 8,
83
- showSequenceNumbers: !0
84
- }
85
- }), Q = !0;
86
- })), I);
87
- }
88
- let He = 0;
89
- async function J(t, i) {
90
- await je();
91
- const r = window.mermaid;
92
- if (!r)
93
- throw new Error("mermaid unavailable");
94
- const a = `team-mermaid-${++He}`, l = Ie(t, i);
95
- return (await r.render(a, l)).svg;
96
- }
97
- async function X(t, i) {
98
- const r = t.firstElementChild;
99
- if (!r) return;
100
- const a = r.textContent || "";
101
- try {
102
- const l = await J(a, i);
103
- r.innerHTML = l, r.classList.add("language-mermaid");
104
- } catch (l) {
105
- const f = l instanceof Error ? l.message : "Mermaid 渲染失败";
106
- r.innerHTML = `<pre class="vditor-mermaid-error">${f}</pre>`;
107
- }
108
- }
109
- function We({ code: t, lang: i }) {
110
- const r = M(null), [a, l] = he(null);
111
- return A(() => {
112
- let f = !1;
113
- if (!t.trim()) {
114
- l(null), r.current && (r.current.innerHTML = "");
115
- return;
116
- }
117
- return l(null), J(t, i).then((w) => {
118
- f || !r.current || (r.current.innerHTML = w);
119
- }).catch((w) => {
120
- f || (l(w instanceof Error ? w.message : "Mermaid 渲染失败"), r.current && (r.current.innerHTML = ""));
121
- }), () => {
122
- f = !0;
123
- };
124
- }, [t, i]), a ? /* @__PURE__ */ K("div", { className: g.mermaidError, children: [
125
- /* @__PURE__ */ s("div", { className: g.mermaidErrorTitle, children: "Mermaid 渲染失败" }),
126
- /* @__PURE__ */ s("pre", { className: g.mermaidErrorMsg, children: a }),
127
- /* @__PURE__ */ s("pre", { className: g.mermaidSource, children: t })
128
- ] }) : /* @__PURE__ */ s("div", { ref: r, className: g.mermaid });
129
- }
130
- function $(t) {
131
- var i;
132
- return typeof t == "string" ? t.replace(/\n$/, "") : Array.isArray(t) ? t.map((r) => $(r)).join("") : t && typeof t == "object" && "props" in t ? $(((i = t.props) == null ? void 0 : i.children) ?? "") : String(t ?? "").replace(/\n$/, "");
133
- }
134
- const ze = {
135
- pre({ children: t }) {
136
- return /* @__PURE__ */ s("pre", { children: t });
137
- },
138
- code({ className: t, children: i, ...r }) {
139
- const a = $(i);
140
- if (Oe(t)) {
141
- const l = t == null ? void 0 : t.match(/\blanguage-([\w-]+)/i);
142
- return /* @__PURE__ */ s(We, { code: a, lang: l == null ? void 0 : l[1] });
143
- }
144
- return /* @__PURE__ */ s("code", { className: t, ...r, children: i });
145
- }
146
- }, Ve = [
147
- [
148
- _e,
149
- {
150
- filter: (t) => {
151
- var r;
152
- const i = (r = t.properties) == null ? void 0 : r.className;
153
- return Array.isArray(i) ? !i.some(
154
- (a) => a === "language-mermaid" || /^language-sequence/i.test(a)
155
- ) : typeof i == "string" ? !/\blanguage-(mermaid|sequencediagram|sequence)\b/i.test(i) : !0;
156
- }
157
- }
158
- ]
159
- ];
160
- function Ge({ children: t, className: i }) {
161
- return /* @__PURE__ */ s("div", { className: i, children: /* @__PURE__ */ s(
162
- ve,
163
- {
164
- remarkPlugins: [Me],
165
- rehypePlugins: Ve,
166
- components: ze,
167
- children: t
168
- }
169
- ) });
170
- }
171
- const Ue = [
172
- "headings",
173
- "bold",
174
- "italic",
175
- "strike",
176
- "|",
177
- "quote",
178
- "list",
179
- "ordered-list",
180
- "check",
181
- "|",
182
- "code",
183
- "inline-code",
184
- "link",
185
- "upload",
186
- "table",
187
- "line",
188
- "|",
189
- "undo",
190
- "redo"
191
- ], Qe = Fe;
192
- function Xe() {
193
- const t = window.publicPath || "/";
194
- return `${String(t).replace(/\/$/, "")}/vditor`;
195
- }
196
- function Ye(t, i, r, a, l, f) {
197
- const S = t.slice(i, r) || f, w = a + S + l;
198
- return {
199
- content: t.slice(0, i) + w + t.slice(r),
200
- selectFrom: i + a.length,
201
- selectTo: i + a.length + S.length
202
- };
203
- }
204
- function Je(t, i, r, a) {
205
- const f = t.slice(0, i).lastIndexOf(`
206
- `) + 1, w = t.slice(f, r).split(`
207
- `).map((P) => P.startsWith(a) ? P.slice(a.length) : a + P).join(`
208
- `);
209
- return {
210
- content: t.slice(0, f) + w + t.slice(r),
211
- selectFrom: f,
212
- selectTo: f + w.length
213
- };
214
- }
215
- function Y(t, i, r, a) {
216
- return {
217
- content: t.slice(0, i) + a + t.slice(r),
218
- selectFrom: i,
219
- selectTo: i + a.length
220
- };
221
- }
222
- function Ze(t) {
223
- return /^https?:\/\/.+\.(png|jpg|jpeg|gif|webp|svg|bmp|ico)(\?.*)?$/i.test(
224
- t
225
- );
226
- }
227
- const ct = we(function({
228
- mode: i,
229
- value: r,
230
- onChange: a,
231
- readOnly: l = !1,
232
- onUploadImage: f,
233
- placeholder: S = "在此输入 Markdown,支持工具栏 / 快捷键 / 粘贴或拖拽图片…",
234
- onSave: w
235
- }, P) {
236
- const j = M(null), R = M(null), D = M(null), H = M(null), W = M(null), z = M(a), E = M(w), N = M(f), b = M(r), V = (e) => {
237
- if (e)
238
- try {
239
- e.destroy();
240
- } catch {
241
- }
242
- };
243
- A(() => {
244
- z.current = a;
245
- }, [a]), A(() => {
246
- E.current = w;
247
- }, [w]), A(() => {
248
- N.current = f;
249
- }, [f]), A(() => {
250
- b.current = r;
251
- }, [r]), ye(P, () => ({
252
- getTextarea: () => D.current,
253
- getLiveRoot: () => R.current
254
- }));
255
- const T = L((e) => {
256
- b.current = e, z.current(e);
257
- }, []);
258
- A(() => {
259
- if (l || i !== "live") return;
260
- const e = R.current;
261
- if (!e) return;
262
- let n = !1, c = !1;
263
- const u = { current: null }, y = (o) => {
264
- var h;
265
- const m = `
266
- ![](${o})
267
- `;
268
- (h = u.current) == null || h.insertValue(m);
269
- }, _ = async (o) => {
270
- const m = N.current;
271
- if (!m) return "未配置图片上传";
272
- const h = o.filter((x) => x.type.startsWith("image/"));
273
- if (h.length === 0) return "仅支持上传图片";
274
- const q = O.loading("上传图片中...", 0);
275
- try {
276
- for (const x of h) {
277
- const G = await m(x);
278
- G && y(G);
279
- }
280
- return null;
281
- } catch {
282
- return "图片上传失败";
283
- } finally {
284
- q();
285
- }
286
- };
287
- u.current = new Ee(e, {
288
- cdn: Xe(),
289
- mode: "ir",
290
- value: b.current,
291
- height: "100%",
292
- lang: "zh_CN",
293
- icon: "ant",
294
- placeholder: S,
295
- cache: { enable: !1 },
296
- toolbar: Ue,
297
- toolbarConfig: { pin: !0 },
298
- hint: { emoji: {} },
299
- // maxWidth 默认 800 会居中留白;设大后左右只剩最小 padding,铺满可用宽度
300
- preview: {
301
- maxWidth: 9999,
302
- hljs: { enable: !0, lineNumber: !1, style: "github" },
303
- math: { engine: "KaTeX", inlineDigit: !1 },
304
- // 代码块默认渲染高亮预览;点进块内才编辑源码(配合 CSS 互斥显示)
305
- //
306
- // 原来写的是顶层 `markdown: {codeBlockPreview, mathBlockPreview}`,
307
- // 但 vditor 4 运行时读的是 options.preview.markdown.codeBlockPreview
308
- // (见 vditor/src/index.ts:561 与 previewRender.ts:66),
309
- // 顶层那份从未生效。
310
- // 另:vditor 4 的 IPreviewOptions["markdown"] 类型也漏了
311
- // codeBlockPreview/mathBlockPreview(上游类型 bug),故用 as 收口。
312
- markdown: {
313
- codeBlockPreview: !0,
314
- mathBlockPreview: !0
315
- }
316
- },
317
- customRenders: [
318
- {
319
- language: "sequenceDiagram",
320
- render: (o) => {
321
- X(o, "sequenceDiagram");
322
- }
323
- },
324
- {
325
- language: "sequence",
326
- render: (o) => {
327
- X(o, "sequence");
328
- }
329
- }
330
- ],
331
- after: () => {
332
- if (n) {
333
- V(u.current);
334
- return;
335
- }
336
- c = !0;
337
- },
338
- input: (o) => {
339
- c && T(o);
340
- },
341
- keydown: (o) => {
342
- var m;
343
- (o.ctrlKey || o.metaKey) && o.key.toLowerCase() === "s" && (o.preventDefault(), (m = E.current) == null || m.call(E));
344
- },
345
- upload: {
346
- accept: "image/*",
347
- multiple: !0,
348
- filename: (o) => o,
349
- handler: (o) => _(o)
350
- }
351
- }), W.current = u.current;
352
- const p = (o) => {
353
- var m;
354
- (o.ctrlKey || o.metaKey) && o.key.toLowerCase() === "s" && (o.preventDefault(), (m = E.current) == null || m.call(E));
355
- };
356
- return e.addEventListener("keydown", p), () => {
357
- n = !0, e.removeEventListener("keydown", p), V(u.current), W.current = null;
358
- };
359
- }, [i, l, S, T]);
360
- const k = L(
361
- (e) => {
362
- T(e.content);
363
- const n = D.current;
364
- n && requestAnimationFrame(() => {
365
- n.focus(), n.setSelectionRange(e.selectFrom, e.selectTo);
366
- });
367
- },
368
- [T]
369
- ), v = L(
370
- (e, n, c) => {
371
- const u = D.current;
372
- u && k(
373
- Ye(
374
- u.value,
375
- u.selectionStart,
376
- u.selectionEnd,
377
- e,
378
- n,
379
- c
380
- )
381
- );
382
- },
383
- [k]
384
- ), C = L(
385
- (e) => {
386
- const n = D.current;
387
- n && k(
388
- Je(n.value, n.selectionStart, n.selectionEnd, e)
389
- );
390
- },
391
- [k]
392
- ), F = L(
393
- (e) => {
394
- const n = D.current;
395
- n && k(Y(n.value, n.selectionStart, n.selectionEnd, e));
396
- },
397
- [k]
398
- ), B = L(
399
- async (e) => {
400
- const n = N.current;
401
- if (!n) return;
402
- const c = D.current, u = (c == null ? void 0 : c.selectionStart) ?? b.current.length, y = (c == null ? void 0 : c.selectionEnd) ?? b.current.length, _ = O.loading("上传图片中...", 0);
403
- try {
404
- const o = `
405
- ![](${await n(e)})
406
- `, m = b.current.slice(0, u) + o + b.current.slice(y);
407
- T(m), requestAnimationFrame(() => {
408
- if (c) {
409
- const h = u + o.length;
410
- c.focus(), c.setSelectionRange(h, h);
411
- }
412
- });
413
- } catch {
414
- O.error("图片上传失败");
415
- } finally {
416
- _();
417
- }
418
- },
419
- [T]
420
- ), Z = L(
421
- async (e) => {
422
- var y, _;
423
- const n = (y = e.clipboardData) == null ? void 0 : y.items;
424
- if (!n) return;
425
- const c = [];
426
- for (let p = 0; p < n.length; p++) {
427
- const o = n[p];
428
- if (o.kind === "file" && o.type.startsWith("image/")) {
429
- const m = o.getAsFile();
430
- m && c.push(m);
431
- }
432
- }
433
- if (c.length > 0) {
434
- e.preventDefault();
435
- for (const p of c)
436
- await B(p);
437
- return;
438
- }
439
- const u = (_ = e.clipboardData.getData("text/plain")) == null ? void 0 : _.trim();
440
- if (u && Ze(u)) {
441
- e.preventDefault();
442
- const p = e.currentTarget, o = p.selectionStart, m = p.selectionEnd, h = `
443
- ![](${u})
444
- `, q = b.current.slice(0, o) + h + b.current.slice(m);
445
- T(q), requestAnimationFrame(() => {
446
- const x = o + h.length;
447
- p.focus(), p.setSelectionRange(x, x);
448
- });
449
- }
450
- },
451
- [T, B]
452
- ), ee = L(
453
- (e) => {
454
- var u;
455
- const n = (u = e.dataTransfer) == null ? void 0 : u.files;
456
- if (!n || n.length === 0) return;
457
- const c = Array.from(n).filter(
458
- (y) => y.type.startsWith("image/")
459
- );
460
- if (c.length !== 0) {
461
- e.preventDefault();
462
- for (const y of c)
463
- B(y);
464
- }
465
- },
466
- [B]
467
- ), te = L(
468
- (e) => {
469
- var u;
470
- const n = e.currentTarget, c = e.ctrlKey || e.metaKey;
471
- if (e.key === "Tab") {
472
- e.preventDefault();
473
- const { selectionStart: y, selectionEnd: _ } = n;
474
- if (e.shiftKey) {
475
- const o = n.value.slice(0, y).lastIndexOf(`
476
- `) + 1, h = n.value.slice(o, _).split(`
477
- `).map((q) => q.startsWith(" ") ? q.slice(2) : q.replace(/^ /, "")).join(`
478
- `);
479
- k({
480
- content: n.value.slice(0, o) + h + n.value.slice(_),
481
- selectFrom: o,
482
- selectTo: o + h.length
483
- });
484
- } else
485
- k(Y(n.value, y, _, " "));
486
- return;
487
- }
488
- c && !e.shiftKey && e.key.toLowerCase() === "b" ? (e.preventDefault(), v("**", "**", "加粗")) : c && !e.shiftKey && e.key.toLowerCase() === "i" ? (e.preventDefault(), v("*", "*", "斜体")) : c && !e.shiftKey && e.key.toLowerCase() === "k" ? (e.preventDefault(), v("[", "](url)", "链接文本")) : c && e.key.toLowerCase() === "s" && (e.preventDefault(), (u = E.current) == null || u.call(E));
489
- },
490
- [k, v]
491
- ), d = (e, n, c, u) => /* @__PURE__ */ s(pe, { title: c, children: /* @__PURE__ */ s(
492
- ge,
493
- {
494
- size: "small",
495
- type: "text",
496
- className: g.mdBtn,
497
- icon: n,
498
- onClick: u
499
- }
500
- ) }, e);
501
- return l ? /* @__PURE__ */ s("div", { ref: j, className: g.wrap, children: /* @__PURE__ */ s("div", { ref: R, className: g.preview, children: r ? /* @__PURE__ */ s(Ge, { children: r }) : /* @__PURE__ */ s(
502
- U,
503
- {
504
- description: "暂无内容",
505
- image: U.PRESENTED_IMAGE_SIMPLE
506
- }
507
- ) }) }) : /* @__PURE__ */ s("div", { ref: j, className: g.wrap, children: i === "live" ? /* @__PURE__ */ s("div", { ref: R, className: g.live }) : /* @__PURE__ */ K(re, { children: [
508
- /* @__PURE__ */ K("div", { className: g.mdToolbar, children: [
509
- d("h1", "H1", "一级标题", () => C("# ")),
510
- d("h2", "H2", "二级标题", () => C("## ")),
511
- d("h3", "H3", "三级标题", () => C("### ")),
512
- /* @__PURE__ */ s("span", { className: g.mdSep }),
513
- d(
514
- "bold",
515
- /* @__PURE__ */ s(ne, {}),
516
- "加粗 Ctrl+B",
517
- () => v("**", "**", "加粗")
518
- ),
519
- d(
520
- "italic",
521
- /* @__PURE__ */ s(ie, {}),
522
- "斜体 Ctrl+I",
523
- () => v("*", "*", "斜体")
524
- ),
525
- d(
526
- "strike",
527
- /* @__PURE__ */ s(oe, {}),
528
- "删除线",
529
- () => v("~~", "~~", "删除线")
530
- ),
531
- /* @__PURE__ */ s("span", { className: g.mdSep }),
532
- d("quote", "❝", "引用", () => C("> ")),
533
- d(
534
- "ul",
535
- /* @__PURE__ */ s(se, {}),
536
- "无序列表",
537
- () => C("- ")
538
- ),
539
- d(
540
- "ol",
541
- /* @__PURE__ */ s(ae, {}),
542
- "有序列表",
543
- () => C("1. ")
544
- ),
545
- d(
546
- "task",
547
- /* @__PURE__ */ s(ce, {}),
548
- "任务列表",
549
- () => C("- [ ] ")
550
- ),
551
- /* @__PURE__ */ s("span", { className: g.mdSep }),
552
- d(
553
- "code",
554
- /* @__PURE__ */ s(le, {}),
555
- "代码块",
556
- () => v("```ts\n", "\n```", "code")
557
- ),
558
- d(
559
- "inlineCode",
560
- /* @__PURE__ */ s(ue, {}),
561
- "行内代码",
562
- () => v("`", "`", "code")
563
- ),
564
- d(
565
- "link",
566
- /* @__PURE__ */ s(de, {}),
567
- "链接 Ctrl+K",
568
- () => v("[", "](url)", "链接文本")
569
- ),
570
- d(
571
- "image",
572
- /* @__PURE__ */ s(me, {}),
573
- "图片(可粘贴/拖拽)",
574
- () => {
575
- var e;
576
- return (e = H.current) == null ? void 0 : e.click();
577
- }
578
- ),
579
- d(
580
- "table",
581
- /* @__PURE__ */ s(fe, {}),
582
- "表格",
583
- () => F(`
584
- | 列1 | 列2 | 列3 |
585
- | --- | --- | --- |
586
- | | | |
587
- `)
588
- ),
589
- d("hr", "—", "分割线", () => F(`
590
- ---
591
- `)),
592
- d(
593
- "mermaid",
594
- "M",
595
- "Mermaid 流程图",
596
- () => F(Qe)
597
- ),
598
- d(
599
- "sequence",
600
- "Seq",
601
- "Mermaid 时序图",
602
- () => F(Ne)
603
- )
604
- ] }),
605
- /* @__PURE__ */ s(
606
- "textarea",
607
- {
608
- ref: D,
609
- className: g.textarea,
610
- value: r,
611
- onChange: (e) => T(e.target.value),
612
- onKeyDown: te,
613
- onPaste: Z,
614
- onDrop: ee,
615
- onDragOver: (e) => e.preventDefault(),
616
- placeholder: S,
617
- spellCheck: !1
618
- }
619
- ),
620
- /* @__PURE__ */ s(
621
- "input",
622
- {
623
- ref: H,
624
- type: "file",
625
- accept: "image/*",
626
- style: { display: "none" },
627
- onChange: (e) => {
628
- var c;
629
- const n = (c = e.target.files) == null ? void 0 : c[0];
630
- n && B(n), e.target.value = "";
631
- }
632
- }
633
- )
634
- ] }) });
635
- });
636
- export {
637
- ct as M
638
- };