@digitalsee-ai/rcs 2.0.4-beta6 → 2.0.4-rc3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalsee-ai/rcs",
3
- "version": "2.0.4-beta6",
3
+ "version": "2.0.4-rc3",
4
4
  "packageManager": "pnpm@10.12.1",
5
5
  "repository": {
6
6
  "type": "git"
@@ -63,12 +63,10 @@
63
63
  "ahooks": ">=3.0.0",
64
64
  "antd": ">=5.0.0",
65
65
  "lodash-es": ">=4.17.0",
66
- "monaco-editor": "*",
67
66
  "react": ">=18.0.0",
68
67
  "react-dom": ">=18.0.0",
69
68
  "react-intl": "7.1.14",
70
69
  "react-markdown": "10.0.1",
71
- "react-monaco-editor": "*",
72
70
  "react-redux": ">=8.0.0"
73
71
  },
74
72
  "files": [
@@ -101,7 +99,7 @@
101
99
  "tailwindcss-animate": "^1.0.7",
102
100
  "tw-animate-css": "^1.3.9",
103
101
  "uuid": "^13.0.2",
104
- "zod": "^3.25.76"
102
+ "zod": "^4.6.6"
105
103
  },
106
104
  "devDependencies": {
107
105
  "@ant-design/icons": "^6.1.0",
@@ -142,7 +140,6 @@
142
140
  "less-loader": "^12.3.0",
143
141
  "lint-staged": "16.1.2",
144
142
  "lodash-es": "^4.18.1",
145
- "monaco-editor": "^0.55.1",
146
143
  "postcss": "8.5.26",
147
144
  "prop-types": "15.8.1",
148
145
  "react": "18.3.1",
@@ -150,16 +147,15 @@
150
147
  "react-icons": "^5.5.0",
151
148
  "react-intl": "7.1.14",
152
149
  "react-markdown": "^10.1.0",
153
- "react-monaco-editor": "^0.59.0",
154
150
  "react-redux": "^9.2.0",
155
151
  "slate": "^0.120.0",
156
152
  "slate-history": "^0.113.1",
157
153
  "slate-react": "^0.120.0",
158
- "storybook": "9.1.20",
154
+ "storybook": "9.1.21",
159
155
  "tailwindcss": "4.1.10",
160
156
  "typescript": "5.8.3",
161
- "vite": "6.4.3",
157
+ "vite": "6.4.4",
162
158
  "vite-plugin-dts": "4.5.4",
163
- "vitest": "3.2.7"
159
+ "vitest": "5.0.5"
164
160
  }
165
161
  }
@@ -1,288 +0,0 @@
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-BU5NtqWV.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
- main: X,
16
- header: Y,
17
- editor: Z
18
- }, ee = "_ideWrapper_sfar6_1", ne = {
19
- ideWrapper: ee
20
- }, te = (e) => {
21
- const { nodeId: i, onInsert: o, open: c } = e, s = B();
22
- return s.useSubscription((a) => {
23
- a.type === "insert" && o(a.expression);
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
- }, ie = "_siderContainer_fhkbn_1", oe = {
26
- siderContainer: ie
27
- };
28
- function re(e) {
29
- return /* @__PURE__ */ t("div", { className: oe.siderContainer, children: /* @__PURE__ */ t(te, { open: e.open, nodeId: e.nodeId, onInsert: e.onInsert }) });
30
- }
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
- ")"
41
- ] });
42
- }
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" }) })
47
- ] });
48
- }
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++) {
50
-
51
- }`, desc: "循环操作" }], ce = {
52
- snippets: de
53
- }, ue = {
54
- selectOnLineNumbers: !0,
55
- automaticLayout: !0,
56
- padding: {
57
- top: 10
58
- }
59
- };
60
- function ge(e) {
61
- if (e.type === "global")
62
- return [
63
- `**${l("link.flow.variable_type_global")}**`,
64
- `${l("link.flow.variable_path")}:\`${e.value}\``,
65
- `${l("link.flow.variable_name")}:\`${e.path}\``
66
- ].filter(Boolean).join(`
67
-
68
- `);
69
- if (e.type === "builtin") {
70
- const i = R.getBuiltinVariableTips(e.firstPart);
71
- return [
72
- `**${l("link.flow.variable_type_builtin")}**`,
73
- `${l("link.flow.variable_path")}:\`${e.value}\``,
74
- i
75
- ].filter(Boolean).join(`
76
-
77
- `);
78
- }
79
- return e.type === "node" ? [
80
- `**${l("link.flow.variable_type_node")}**`,
81
- `${l("link.flow.variable_path")}:\`${e.value}\``,
82
- e.path ? `${l("link.flow.variable_field")}:\`${e.path}\`` : ""
83
- ].filter(Boolean).join(`
84
-
85
- `) : [
86
- `**${l("link.flow.variable_type_platform")}**`,
87
- `${l("link.flow.variable_path")}:\`${e.value}\``
88
- ].join(`
89
-
90
- `);
91
- }
92
- const fe = (e) => ({
93
- code: e.code,
94
- severity: e.severity,
95
- message: e.message,
96
- source: e.source,
97
- startLineNumber: e.startLineNumber,
98
- startColumn: e.startColumn,
99
- endLineNumber: e.endLineNumber,
100
- endColumn: e.endColumn,
101
- modelVersionId: e.modelVersionId,
102
- relatedInformation: e.relatedInformation,
103
- tags: e.tags
104
- });
105
- function N(e, i) {
106
- const o = E(i.getValue());
107
- if (!o.length)
108
- return;
109
- const c = e.editor.getModelMarkers({ resource: i.uri }), s = /* @__PURE__ */ new Map();
110
- c.forEach((a) => {
111
- const d = s.get(a.owner) ?? [];
112
- d.push(a), s.set(a.owner, d);
113
- }), s.forEach((a, d) => {
114
- const u = a.filter(
115
- (g) => !o.some((y) => O(y, g))
116
- );
117
- u.length !== a.length && e.editor.setModelMarkers(i, d, u.map(fe));
118
- });
119
- }
120
- function pe(e, i) {
121
- const o = [].map((c) => ({
122
- insertText: c,
123
- kind: e.languages.CompletionItemKind.Function,
124
- // 对应提示图标的不同
125
- label: c
126
- }));
127
- return e.languages.registerCompletionItemProvider(i, {
128
- provideCompletionItems() {
129
- return {
130
- suggestions: o
131
- };
132
- },
133
- quickSuggestions: !0,
134
- // 默认提示关闭
135
- triggerCharacters: ["{", ".", "=", ":"]
136
- // 触发提示的字符 可以定义多个
137
- });
138
- }
139
- function me(e) {
140
- return e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
141
- noSemanticValidation: !0,
142
- noSyntaxValidation: !1
143
- }), e.languages.typescript.javascriptDefaults.setCompilerOptions({
144
- target: e.languages.typescript.ScriptTarget.ES2015,
145
- allowNonTsExtensions: !0
146
- }), e.languages.registerCompletionItemProvider("javascript", {
147
- provideCompletionItems: () => ({
148
- suggestions: ce.snippets.map((o) => ({
149
- label: o.trigger,
150
- kind: e.languages.CompletionItemKind.Method,
151
- detail: o.desc ?? "",
152
- insertText: o.content,
153
- insertTextRules: e.languages.CompletionItemInsertTextRule.InsertAsSnippet
154
- }))
155
- })
156
- });
157
- }
158
- function $e(e) {
159
- const { open: i, nodeId: o, initialValue: c, language: s = "javascript", showVariableSidebar: a = !0 } = e, d = I(null), u = I([]), g = A({
160
- code: "",
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);
166
- }), d.current = n, n.focus(), g.code = n.getValue();
167
- const x = r.languages.registerHoverProvider(s, {
168
- provideHover: (f, m) => new Promise((p) => {
169
- const h = E(f.getValue()).find(
170
- (F) => P(F, m.lineNumber, m.column)
171
- );
172
- if (!h) {
173
- p(null);
174
- return;
175
- }
176
- p({
177
- range: new r.Range(
178
- h.startLine,
179
- h.startColumn,
180
- h.endLine,
181
- h.endColumn
182
- ),
183
- contents: [{ value: ge(h) }]
184
- });
185
- })
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(() => {
191
- try {
192
- N(r, v);
193
- } finally {
194
- f = !1;
195
- }
196
- }, 0));
197
- });
198
- N(r, v), n.onDidDispose(() => m.dispose());
199
- }
200
- n.onDidDispose(() => x.dispose());
201
- }, V = (n) => {
202
- u.current.forEach((r) => {
203
- r.dispose();
204
- }), u.current = [pe(n, s)], s === "javascript" && u.current.push(me(n));
205
- };
206
- M(
207
- () => () => {
208
- u.current.forEach((n) => {
209
- n.dispose();
210
- }), u.current = [];
211
- },
212
- []
213
- ), M(() => {
214
- if (!i)
215
- return;
216
- const n = (r) => {
217
- r.key === "Escape" && (r.preventDefault(), e.onCancel());
218
- };
219
- return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
220
- }, [i, e.onCancel]);
221
- const S = (n) => {
222
- const r = [
223
- {
224
- range: g.range,
225
- text: n,
226
- forceMoveMarkers: !0
227
- }
228
- ];
229
- d.current && g.range && d.current.executeEdits("my-source", r);
230
- }, $ = () => {
231
- var n;
232
- (n = e.onFinish) == null || n.call(e, g.code);
233
- }, j = I(null), k = W(j);
234
- return z(
235
- /* @__PURE__ */ t(
236
- "div",
237
- {
238
- className: w.modalContainer,
239
- ref: j,
240
- style: { display: i ? "flex" : "none" },
241
- role: "dialog",
242
- "aria-modal": "true",
243
- "aria-labelledby": "workflow-online-ide-title",
244
- children: /* @__PURE__ */ _("div", { className: w.editorContainer, id: "javascript-code-editor", children: [
245
- a ? /* @__PURE__ */ t("div", { className: w.sider, style: { maxWidth: "20%", padding: 0 }, children: /* @__PURE__ */ t(
246
- re,
247
- {
248
- onCancel: e.onCancel,
249
- onFinish: $,
250
- editor: d.current,
251
- nodeId: o,
252
- open: i,
253
- onInsert: S
254
- }
255
- ) }) : null,
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: $ })
260
- ] }),
261
- /* @__PURE__ */ t("div", { className: w.editor, children: /* @__PURE__ */ t(
262
- q,
263
- {
264
- width: "100%",
265
- height: ((k == null ? void 0 : k.height) ?? 0) - 40,
266
- language: s,
267
- theme: "vs-dark",
268
- value: c,
269
- options: ue,
270
- onChange: (n) => {
271
- g.code = n;
272
- },
273
- editorWillMount: V,
274
- editorDidMount: y
275
- },
276
- o
277
- ) })
278
- ] })
279
- ] })
280
- }
281
- ),
282
- document.body
283
- );
284
- }
285
- export {
286
- $e as default
287
- };
288
- //# sourceMappingURL=index-C3Tj_zIJ.mjs.map