@digitalsee-ai/rcs 2.0.3-rc → 2.0.4-beta

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.
@@ -1,17 +1,17 @@
1
- import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
- import { D as T, V as L, e as V, i as P, t as l, f as R, d as O } from "./index-8OuPlj3E.mjs";
3
- import { useEventEmitter as B, useReactive as W, useSize as H } from "ahooks";
4
- import { FormattedMessage as $ } from "react-intl";
5
- import { CloseCircleFilled as A, CheckCircleFilled as K } from "@ant-design/icons";
6
- import { Button as M } from "antd";
7
- import * as z from "monaco-editor";
8
- import { useRef as I, useEffect as j } from "react";
9
- import { createPortal as q } from "react-dom";
10
- import J from "react-monaco-editor";
11
- const G = "_modalContainer_1ajlo_5", Q = "_editorContainer_1ajlo_16", U = "_sider_1ajlo_25", X = "_main_1ajlo_34", Y = "_header_1ajlo_40", Z = "_editor_1ajlo_16", w = {
12
- modalContainer: G,
13
- editorContainer: Q,
14
- sider: U,
1
+ import { jsx as t, jsxs as _ } from "react/jsx-runtime";
2
+ import { D as L, V as T, e as E, i as P, t as l, f as R, d as O } from "./index-B9JVnuFQ.mjs";
3
+ import { useEventEmitter as B, useReactive as A, useSize as W } from "ahooks";
4
+ import { FormattedMessage as b } from "react-intl";
5
+ import { CloseCircleFilled as H, CheckCircleFilled as G } from "@ant-design/icons";
6
+ import { Button as D } from "antd";
7
+ import * as K from "monaco-editor";
8
+ import { useRef as I, useEffect as M } from "react";
9
+ import { createPortal as z } from "react-dom";
10
+ import q from "react-monaco-editor";
11
+ const U = "_modalContainer_1ajlo_5", J = "_editorContainer_1ajlo_16", Q = "_sider_1ajlo_25", X = "_main_1ajlo_34", Y = "_header_1ajlo_40", Z = "_editor_1ajlo_16", w = {
12
+ modalContainer: U,
13
+ editorContainer: J,
14
+ sider: Q,
15
15
  main: X,
16
16
  header: Y,
17
17
  editor: Z
@@ -21,37 +21,43 @@ const G = "_modalContainer_1ajlo_5", Q = "_editorContainer_1ajlo_16", U = "_side
21
21
  const { nodeId: i, onInsert: o, open: c } = e, s = B();
22
22
  return s.useSubscription((a) => {
23
23
  a.type === "insert" && o(a.expression);
24
- }), /* @__PURE__ */ t(T.Provider, { value: { event$: s }, children: /* @__PURE__ */ t("div", { className: ne.ideWrapper, children: /* @__PURE__ */ t(L, { nodeId: i, onInsert: o, open: c }) }) });
24
+ }), /* @__PURE__ */ t(L.Provider, { value: { event$: s }, children: /* @__PURE__ */ t("div", { className: ne.ideWrapper, children: /* @__PURE__ */ t(T, { nodeId: i, onInsert: o, open: c }) }) });
25
25
  }, ie = "_siderContainer_fhkbn_1", oe = {
26
26
  siderContainer: ie
27
27
  };
28
28
  function re(e) {
29
29
  return /* @__PURE__ */ t("div", { className: oe.siderContainer, children: /* @__PURE__ */ t(te, { open: e.open, nodeId: e.nodeId, onInsert: e.onInsert }) });
30
30
  }
31
- function se({ language: e = "javascript" }) {
32
- return /* @__PURE__ */ v("h2", { id: "workflow-online-ide-title", className: "workflow-online-ide-title", children: [
33
- /* @__PURE__ */ t($, { id: "link.flow.code_editor" }),
34
- " (Javascript)"
31
+ const se = {
32
+ javascript: "link.flow.code_editor_language_javascript",
33
+ json: "link.flow.code_editor_language_json"
34
+ };
35
+ function ae({ language: e = "javascript" }) {
36
+ return /* @__PURE__ */ _("h2", { id: "workflow-online-ide-title", className: "workflow-online-ide-title", children: [
37
+ /* @__PURE__ */ t(b, { id: "link.flow.code_editor" }),
38
+ " (",
39
+ /* @__PURE__ */ t(b, { id: se[e] }),
40
+ ")"
35
41
  ] });
36
42
  }
37
- function ae(e) {
38
- return /* @__PURE__ */ v("div", { className: "workflow-online-ide-toolbar", children: [
39
- /* @__PURE__ */ t(M, { size: "small", onClick: e.onCancel, icon: /* @__PURE__ */ t(A, {}), children: /* @__PURE__ */ t($, { id: "app.common.word.cancel" }) }),
40
- /* @__PURE__ */ t(M, { type: "primary", size: "small", onClick: e.onFinish, icon: /* @__PURE__ */ t(K, {}), children: /* @__PURE__ */ t($, { id: "app.common.word.finish" }) })
43
+ function le(e) {
44
+ return /* @__PURE__ */ _("div", { className: "workflow-online-ide-toolbar", children: [
45
+ /* @__PURE__ */ t(D, { size: "small", onClick: e.onCancel, icon: /* @__PURE__ */ t(H, {}), children: /* @__PURE__ */ t(b, { id: "app.common.word.cancel" }) }),
46
+ /* @__PURE__ */ t(D, { type: "primary", size: "small", onClick: e.onFinish, icon: /* @__PURE__ */ t(G, {}), children: /* @__PURE__ */ t(b, { id: "app.common.word.finish" }) })
41
47
  ] });
42
48
  }
43
- const le = [{ trigger: "log", content: "console.log('$1');$2", desc: "输出日志" }, { trigger: "imp", content: "import $1 from '$2';$3" }, { trigger: "loop", content: `for (let $1=0; i< $2.length;i++) {
49
+ const de = [{ trigger: "log", content: "console.log('$1');$2", desc: "输出日志" }, { trigger: "imp", content: "import $1 from '$2';$3" }, { trigger: "loop", content: `for (let $1=0; i< $2.length;i++) {
44
50
 
45
- }`, desc: "循环操作" }], de = {
46
- snippets: le
47
- }, ce = {
51
+ }`, desc: "循环操作" }], ce = {
52
+ snippets: de
53
+ }, ue = {
48
54
  selectOnLineNumbers: !0,
49
55
  automaticLayout: !0,
50
56
  padding: {
51
57
  top: 10
52
58
  }
53
59
  };
54
- function ue(e) {
60
+ function ge(e) {
55
61
  if (e.type === "global")
56
62
  return [
57
63
  `**${l("link.flow.variable_type_global")}**`,
@@ -83,7 +89,7 @@ function ue(e) {
83
89
 
84
90
  `);
85
91
  }
86
- const ge = (e) => ({
92
+ const fe = (e) => ({
87
93
  code: e.code,
88
94
  severity: e.severity,
89
95
  message: e.message,
@@ -97,7 +103,7 @@ const ge = (e) => ({
97
103
  tags: e.tags
98
104
  });
99
105
  function N(e, i) {
100
- const o = V(i.getValue());
106
+ const o = E(i.getValue());
101
107
  if (!o.length)
102
108
  return;
103
109
  const c = e.editor.getModelMarkers({ resource: i.uri }), s = /* @__PURE__ */ new Map();
@@ -106,9 +112,9 @@ function N(e, i) {
106
112
  d.push(a), s.set(a.owner, d);
107
113
  }), s.forEach((a, d) => {
108
114
  const u = a.filter(
109
- (g) => !o.some((b) => O(b, g))
115
+ (g) => !o.some((y) => O(y, g))
110
116
  );
111
- u.length !== a.length && e.editor.setModelMarkers(i, d, u.map(ge));
117
+ u.length !== a.length && e.editor.setModelMarkers(i, d, u.map(fe));
112
118
  });
113
119
  }
114
120
  function pe(e, i) {
@@ -130,7 +136,7 @@ function pe(e, i) {
130
136
  // 触发提示的字符 可以定义多个
131
137
  });
132
138
  }
133
- function fe(e) {
139
+ function me(e) {
134
140
  return e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
135
141
  noSemanticValidation: !0,
136
142
  noSyntaxValidation: !1
@@ -139,7 +145,7 @@ function fe(e) {
139
145
  allowNonTsExtensions: !0
140
146
  }), e.languages.registerCompletionItemProvider("javascript", {
141
147
  provideCompletionItems: () => ({
142
- suggestions: de.snippets.map((o) => ({
148
+ suggestions: ce.snippets.map((o) => ({
143
149
  label: o.trigger,
144
150
  kind: e.languages.CompletionItemKind.Method,
145
151
  detail: o.desc ?? "",
@@ -150,61 +156,61 @@ function fe(e) {
150
156
  });
151
157
  }
152
158
  function $e(e) {
153
- const { open: i, nodeId: o, initialValue: c, language: s = "javascript", showVariableSidebar: a = !0 } = e, d = I(null), u = I([]), g = W({
159
+ const { open: i, nodeId: o, initialValue: c, language: s = "javascript", showVariableSidebar: a = !0 } = e, d = I(null), u = I([]), g = A({
154
160
  code: "",
155
- range: new z.Range(1, 1, 1, 1)
156
- }), b = (n, r) => {
157
- n.onDidChangeCursorPosition((p) => {
158
- const m = p.position, { lineNumber: f = 0, column: C = 0 } = m;
159
- g.range = new r.Range(f, C, f, C);
161
+ range: new K.Range(1, 1, 1, 1)
162
+ }), y = (n, r) => {
163
+ n.onDidChangeCursorPosition((f) => {
164
+ const m = f.position, { lineNumber: p = 0, column: C = 0 } = m;
165
+ g.range = new r.Range(p, C, p, C);
160
166
  }), d.current = n, n.focus(), g.code = n.getValue();
161
- const S = r.languages.registerHoverProvider(s, {
162
- provideHover: (p, m) => new Promise((f) => {
163
- const h = V(p.getValue()).find(
167
+ const x = r.languages.registerHoverProvider(s, {
168
+ provideHover: (f, m) => new Promise((p) => {
169
+ const h = E(f.getValue()).find(
164
170
  (F) => P(F, m.lineNumber, m.column)
165
171
  );
166
172
  if (!h) {
167
- f(null);
173
+ p(null);
168
174
  return;
169
175
  }
170
- f({
176
+ p({
171
177
  range: new r.Range(
172
178
  h.startLine,
173
179
  h.startColumn,
174
180
  h.endLine,
175
181
  h.endColumn
176
182
  ),
177
- contents: [{ value: ue(h) }]
183
+ contents: [{ value: ge(h) }]
178
184
  });
179
185
  })
180
- }), _ = n.getModel();
181
- if (_) {
182
- let p = !1;
183
- const m = r.editor.onDidChangeMarkers((f) => {
184
- p || !f.some((C) => C.toString() === _.uri.toString()) || (p = !0, window.setTimeout(() => {
186
+ }), v = n.getModel();
187
+ if (v) {
188
+ let f = !1;
189
+ const m = r.editor.onDidChangeMarkers((p) => {
190
+ f || !p.some((C) => C.toString() === v.uri.toString()) || (f = !0, window.setTimeout(() => {
185
191
  try {
186
- N(r, _);
192
+ N(r, v);
187
193
  } finally {
188
- p = !1;
194
+ f = !1;
189
195
  }
190
196
  }, 0));
191
197
  });
192
- N(r, _), n.onDidDispose(() => m.dispose());
198
+ N(r, v), n.onDidDispose(() => m.dispose());
193
199
  }
194
- n.onDidDispose(() => S.dispose());
195
- }, x = (n) => {
200
+ n.onDidDispose(() => x.dispose());
201
+ }, V = (n) => {
196
202
  u.current.forEach((r) => {
197
203
  r.dispose();
198
- }), u.current = [pe(n, s)], s === "javascript" && u.current.push(fe(n));
204
+ }), u.current = [pe(n, s)], s === "javascript" && u.current.push(me(n));
199
205
  };
200
- j(
206
+ M(
201
207
  () => () => {
202
208
  u.current.forEach((n) => {
203
209
  n.dispose();
204
210
  }), u.current = [];
205
211
  },
206
212
  []
207
- ), j(() => {
213
+ ), M(() => {
208
214
  if (!i)
209
215
  return;
210
216
  const n = (r) => {
@@ -212,7 +218,7 @@ function $e(e) {
212
218
  };
213
219
  return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
214
220
  }, [i, e.onCancel]);
215
- const E = (n) => {
221
+ const S = (n) => {
216
222
  const r = [
217
223
  {
218
224
  range: g.range,
@@ -221,51 +227,51 @@ function $e(e) {
221
227
  }
222
228
  ];
223
229
  d.current && g.range && d.current.executeEdits("my-source", r);
224
- }, k = () => {
230
+ }, $ = () => {
225
231
  var n;
226
232
  (n = e.onFinish) == null || n.call(e, g.code);
227
- }, D = I(null), y = H(D);
228
- return q(
233
+ }, j = I(null), k = W(j);
234
+ return z(
229
235
  /* @__PURE__ */ t(
230
236
  "div",
231
237
  {
232
238
  className: w.modalContainer,
233
- ref: D,
239
+ ref: j,
234
240
  style: { display: i ? "flex" : "none" },
235
241
  role: "dialog",
236
242
  "aria-modal": "true",
237
243
  "aria-labelledby": "workflow-online-ide-title",
238
- children: /* @__PURE__ */ v("div", { className: w.editorContainer, id: "javascript-code-editor", children: [
244
+ children: /* @__PURE__ */ _("div", { className: w.editorContainer, id: "javascript-code-editor", children: [
239
245
  a ? /* @__PURE__ */ t("div", { className: w.sider, style: { maxWidth: "20%", padding: 0 }, children: /* @__PURE__ */ t(
240
246
  re,
241
247
  {
242
248
  onCancel: e.onCancel,
243
- onFinish: k,
249
+ onFinish: $,
244
250
  editor: d.current,
245
251
  nodeId: o,
246
252
  open: i,
247
- onInsert: E
253
+ onInsert: S
248
254
  }
249
255
  ) }) : null,
250
- /* @__PURE__ */ v("div", { className: w.main, children: [
251
- /* @__PURE__ */ v("div", { className: w.header, children: [
252
- /* @__PURE__ */ t(se, { language: s }),
253
- /* @__PURE__ */ t(ae, { onCancel: e.onCancel, onFinish: k })
256
+ /* @__PURE__ */ _("div", { className: w.main, children: [
257
+ /* @__PURE__ */ _("div", { className: w.header, children: [
258
+ /* @__PURE__ */ t(ae, { language: s }),
259
+ /* @__PURE__ */ t(le, { onCancel: e.onCancel, onFinish: $ })
254
260
  ] }),
255
261
  /* @__PURE__ */ t("div", { className: w.editor, children: /* @__PURE__ */ t(
256
- J,
262
+ q,
257
263
  {
258
264
  width: "100%",
259
- height: ((y == null ? void 0 : y.height) ?? 0) - 40,
265
+ height: ((k == null ? void 0 : k.height) ?? 0) - 40,
260
266
  language: s,
261
267
  theme: "vs-dark",
262
268
  value: c,
263
- options: ce,
269
+ options: ue,
264
270
  onChange: (n) => {
265
271
  g.code = n;
266
272
  },
267
- editorWillMount: x,
268
- editorDidMount: b
273
+ editorWillMount: V,
274
+ editorDidMount: y
269
275
  },
270
276
  o
271
277
  ) })
@@ -279,4 +285,4 @@ function $e(e) {
279
285
  export {
280
286
  $e as default
281
287
  };
282
- //# sourceMappingURL=index-Dk9kFqym.mjs.map
288
+ //# sourceMappingURL=index-DpXmOZ5U.mjs.map
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;
@@ -69,6 +69,8 @@ declare const _default: {
69
69
  'link.flow.loop_node_output': string;
70
70
  'link.flow.not_selected': string;
71
71
  'link.flow.code_editor': string;
72
+ 'link.flow.code_editor_language_javascript': string;
73
+ 'link.flow.code_editor_language_json': string;
72
74
  'link.flow.open_code_editor': string;
73
75
  'link.flow.format_json': string;
74
76
  'link.flow.format_json_failed': string;