@digitalsee-ai/rcs 2.0.0-beta7 → 2.0.0-beta9

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 (20) hide show
  1. package/dist/components/digitalsee/workflow/Nodes/DeclaredNode.d.ts +4 -0
  2. package/dist/components/digitalsee/workflow/NodesConfig/components/FormFieldRenderer/fields/TextField/index.d.ts +2 -0
  3. package/dist/components/digitalsee/workflow/NodesConfig/context.d.ts +13 -0
  4. package/dist/components/digitalsee/workflow/NodesConfig/useClearVariableTargetOnFormMouseDown.d.ts +15 -0
  5. package/dist/components/digitalsee/workflow/NodesConfig/useVariableActiveTarget.d.ts +13 -0
  6. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/hooks/useConnectableNodeSelector.d.ts +3 -3
  7. package/dist/components/digitalsee/workflow/store/panelSlice.d.ts +64 -0
  8. package/dist/components/digitalsee/workflow/types/NodeAddContext.d.ts +1 -1
  9. package/dist/components/dynamic-form/index.d.ts +0 -3
  10. package/dist/{index-trJRukGS.mjs → index-JIsi-COV.mjs} +22 -25
  11. package/dist/{index-Dy43iMlV.mjs → index-lzMv91zu.mjs} +38542 -39182
  12. package/dist/rcs.css +1 -1
  13. package/dist/rcs.es.js +53 -56
  14. package/dist/rcs.umd.js +76 -83
  15. package/package.json +1 -1
  16. package/dist/components/digitalsee/workflow/Panels/ModernNodeSelectorPanel/utils/filterEdgeInsertActions.d.ts +0 -62
  17. package/dist/components/dynamic-form/components/SelectWithExpression/index.d.ts +0 -25
  18. package/dist/components/dynamic-form/components/VariableInput/index.d.ts +0 -26
  19. package/dist/components/dynamic-form/components/VariableInput/utils.d.ts +0 -38
  20. package/dist/components/dynamic-form/components/VariableTextarea/index.d.ts +0 -10
@@ -1,6 +1,10 @@
1
1
  import { NodeType } from '../types/Node';
2
2
  import { Node, NodeProps } from '@xyflow/react';
3
3
  import { default as React } from 'react';
4
+ /** Switch 节点高度规则:每个输出端口 30px、基础高度 72px、超过 2 个输出开始撑高。 */
5
+ export declare const SWITCH_LEGACY_HEIGHT_PER_OUTPUT = 30;
6
+ export declare const SWITCH_LEGACY_HEIGHT_BASE = 72;
7
+ export declare const SWITCH_OUTPUT_THRESHOLD = 2;
4
8
  /**
5
9
  * 解析 ReactFlow `node.type` 字符串,拆出 NodeType + nodeKey + version。
6
10
  *
@@ -9,6 +9,8 @@ interface TextFieldProps extends IFieldSuperProps {
9
9
  textAreaMode?: boolean;
10
10
  disabled?: boolean;
11
11
  disableIDE?: boolean;
12
+ onFocus?: () => void;
13
+ onBlur?: () => void;
12
14
  }
13
15
  export declare const TextField: (props: TextFieldProps) => import("react/jsx-runtime").JSX.Element;
14
16
  export {};
@@ -2,3 +2,16 @@ import { EventEmitter } from 'ahooks/lib/useEventEmitter';
2
2
  export declare const DrawerContext: import('react').Context<{
3
3
  event$: EventEmitter<any>;
4
4
  }>;
5
+ /**
6
+ * 统一的“当前变量插入目标 id”上下文。
7
+ *
8
+ * 由 NodesConfig/index.tsx 顶部的 Provider 维护:
9
+ * - classic 机制:订阅 event$ 的 setCurrentInputId 事件
10
+ * - 新版机制:读取 VariableSelectorStateContext.activeFieldId
11
+ *
12
+ * 字段组件通过 useVariableActiveTarget(id) 判断自己是否正处于
13
+ * “会接收变量追加”的状态,从而渲染高亮样式。
14
+ */
15
+ export declare const VariableActiveTargetContext: import('react').Context<{
16
+ activeInputId: string;
17
+ }>;
@@ -0,0 +1,15 @@
1
+ import { default as React } from 'react';
2
+ /**
3
+ * 供 .workflow-node-form-shell 使用的 onMouseDownCapture 处理器。
4
+ *
5
+ * 语义:鼠标在表单内容上按下、且落点不在“当前仍聚焦的表达式编辑器”内部时,
6
+ * 说明用户已离开那个输入框 —— 此时清空两套活动变量目标:
7
+ * 1) classic:event$.emit({type:'setCurrentInputId', currentInputId:''})
8
+ * 2) 新版 VariableSelector.activeFieldId:deactivateField()
9
+ * 防止变量被追加进“非最后一次交互”的输入框。
10
+ *
11
+ * 守卫即“区分是不是输入框自己触发的点击”:落点在 document.activeElement 内部
12
+ * (仍在编辑器里移动光标 / 点变量 tag)时不清除,输入框自身的 onFocus 会在
13
+ * mousedown 默认动作阶段重新武装目标。变量面板渲染在 shell DOM 之外,永不触发。
14
+ */
15
+ export declare function useClearVariableTargetOnFormMouseDown(): (e: React.MouseEvent) => void;
@@ -0,0 +1,13 @@
1
+ /** 命中高亮时加到字段最外层容器的 class 名 */
2
+ export declare const VARIABLE_TARGET_ACTIVE_CLASS = "workflow-variable-target--active";
3
+ /**
4
+ * 判断当前字段(inputId)是否是“活动变量插入目标”。
5
+ *
6
+ * 数据源是 NodesConfig 顶层的 VariableActiveTargetContext:
7
+ * classic setCurrentInputId 与新版 VariableSelector.activeFieldId
8
+ * 已被统一汇总,任一变化都会让命中的字段重渲染以获得高亮。
9
+ *
10
+ * @param inputId 字段自身用于接收 insert 事件的 id(genInputId 生成)
11
+ * @returns 当前是否处于活动变量目标状态
12
+ */
13
+ export declare function useVariableActiveTarget(inputId: string): boolean;
@@ -1,4 +1,4 @@
1
- import { ActionItem, LinkSearchParams, ModernNodeSelectorProps, NodeFetchResult, NodeTypeItem } from '../types';
1
+ import { ActionItem, LinkSearchParams, ModernNodeSelectorProps, NodeTypeItem } from '../types';
2
2
  import { NodeAddInfo } from '../../../types/NodeAddContext';
3
3
  type SearchHandler = NonNullable<ModernNodeSelectorProps['onSearch']>;
4
4
  type CategoryHandler = NonNullable<ModernNodeSelectorProps['onFetchCategories']>;
@@ -21,9 +21,9 @@ interface UseConnectableNodeSelectorProps {
21
21
  export declare function useConnectableNodeSelector({ nodeSelectorVisible, effectiveNodeAddInfo, workflowId, onSearch, onFetchCategories, onFetchNodesByCategory, }: UseConnectableNodeSelectorProps): {
22
22
  actionRequestContextKey: string;
23
23
  connectableContext: import('../utils/connectableQuery').ConnectableQueryContext;
24
- onSearch: (params?: LinkSearchParams) => Promise<NodeFetchResult>;
24
+ onSearch: (params?: LinkSearchParams) => Promise<import('../types').NodeFetchResult>;
25
25
  onFetchCategories: (type?: import('../types').CategoryRequestType) => Promise<import('../types').CategoryItem[]>;
26
- onFetchNodesByCategory: (params?: LinkSearchParams) => Promise<NodeFetchResult>;
26
+ onFetchNodesByCategory: (params?: LinkSearchParams) => Promise<import('../types').NodeFetchResult>;
27
27
  fetchNodeActions: (node: NodeTypeItem, _options?: FetchNodeActionOptions) => Promise<ActionItem[]>;
28
28
  };
29
29
  export {};
@@ -32,18 +32,34 @@ export declare const panelSlice: import('@reduxjs/toolkit').Slice<PanelState, {
32
32
  };
33
33
  };
34
34
  sourceNode?: {
35
+ position: {
36
+ x: number;
37
+ y: number;
38
+ };
35
39
  data: {
36
40
  [x: string]: unknown;
37
41
  };
38
42
  id: string;
39
43
  type?: string;
44
+ measured?: {
45
+ width?: number;
46
+ height?: number;
47
+ };
40
48
  };
41
49
  targetNode?: {
50
+ position: {
51
+ x: number;
52
+ y: number;
53
+ };
42
54
  data: {
43
55
  [x: string]: unknown;
44
56
  };
45
57
  id: string;
46
58
  type?: string;
59
+ measured?: {
60
+ width?: number;
61
+ height?: number;
62
+ };
47
63
  };
48
64
  trigger?: boolean;
49
65
  protocol?: string;
@@ -75,18 +91,34 @@ export declare const panelSlice: import('@reduxjs/toolkit').Slice<PanelState, {
75
91
  };
76
92
  };
77
93
  sourceNode?: {
94
+ position: {
95
+ x: number;
96
+ y: number;
97
+ };
78
98
  data: {
79
99
  [x: string]: unknown;
80
100
  };
81
101
  id: string;
82
102
  type?: string;
103
+ measured?: {
104
+ width?: number;
105
+ height?: number;
106
+ };
83
107
  };
84
108
  targetNode?: {
109
+ position: {
110
+ x: number;
111
+ y: number;
112
+ };
85
113
  data: {
86
114
  [x: string]: unknown;
87
115
  };
88
116
  id: string;
89
117
  type?: string;
118
+ measured?: {
119
+ width?: number;
120
+ height?: number;
121
+ };
90
122
  };
91
123
  trigger?: boolean;
92
124
  protocol?: string;
@@ -118,18 +150,34 @@ export declare const panelSlice: import('@reduxjs/toolkit').Slice<PanelState, {
118
150
  };
119
151
  };
120
152
  sourceNode?: {
153
+ position: {
154
+ x: number;
155
+ y: number;
156
+ };
121
157
  data: {
122
158
  [x: string]: unknown;
123
159
  };
124
160
  id: string;
125
161
  type?: string;
162
+ measured?: {
163
+ width?: number;
164
+ height?: number;
165
+ };
126
166
  };
127
167
  targetNode?: {
168
+ position: {
169
+ x: number;
170
+ y: number;
171
+ };
128
172
  data: {
129
173
  [x: string]: unknown;
130
174
  };
131
175
  id: string;
132
176
  type?: string;
177
+ measured?: {
178
+ width?: number;
179
+ height?: number;
180
+ };
133
181
  };
134
182
  trigger?: boolean;
135
183
  protocol?: string;
@@ -161,18 +209,34 @@ export declare const panelSlice: import('@reduxjs/toolkit').Slice<PanelState, {
161
209
  };
162
210
  };
163
211
  sourceNode?: {
212
+ position: {
213
+ x: number;
214
+ y: number;
215
+ };
164
216
  data: {
165
217
  [x: string]: unknown;
166
218
  };
167
219
  id: string;
168
220
  type?: string;
221
+ measured?: {
222
+ width?: number;
223
+ height?: number;
224
+ };
169
225
  };
170
226
  targetNode?: {
227
+ position: {
228
+ x: number;
229
+ y: number;
230
+ };
171
231
  data: {
172
232
  [x: string]: unknown;
173
233
  };
174
234
  id: string;
175
235
  type?: string;
236
+ measured?: {
237
+ width?: number;
238
+ height?: number;
239
+ };
176
240
  };
177
241
  trigger?: boolean;
178
242
  protocol?: string;
@@ -1,6 +1,6 @@
1
1
  import { Node } from '@xyflow/react';
2
2
  /** 节点选择器只需保留 MCP 判定需要的轻量锚点信息,避免 Redux 声明泄漏 ReactFlow 样式类型。 */
3
- export type NodeAddAnchorNode = Pick<Node, 'id' | 'type' | 'data'>;
3
+ export type NodeAddAnchorNode = Pick<Node, 'id' | 'type' | 'data' | 'position' | 'measured'>;
4
4
  /** 边上插入节点时保留的原边上下文。 */
5
5
  export interface NodeAddEdgeContext {
6
6
  id: string;
@@ -1,9 +1,6 @@
1
1
  export * from './AntdProvider';
2
2
  export { AI_FILL_VALUE, AIFieldWrapper, type AIFieldWrapperProps, } from './components/AIFieldWrapper';
3
- export { type SelectValueMode, SelectWithExpression, type SelectWithExpressionProps, } from './components/SelectWithExpression';
4
3
  export { useValueModePolicyOptional, type ValueMode, ValueModeFieldScope, ValueModePolicyScope, ValueModeSwitch, type ValueModeSwitchProps, ValueModeWrapper, type ValueModeWrapperProps, withInheritedValueModePolicy, } from './components/ValueModeWrapper';
5
- export { VariableInput, type VariableInputProps, } from './components/VariableInput';
6
- export { VariableTextarea, type VariableTextareaProps, } from './components/VariableTextarea';
7
4
  export { useRegisterVariableField, useVariableSelector, useVariableSelectorActionsOptional, useVariableSelectorOptional, type VariableInfo, type VariableSelectorActionsValue, type VariableSelectorContextValue, VariableSelectorProvider, type VariableSelectorProviderProps, type VariableSelectorStateValue, } from './context/VariableSelectorContext';
8
5
  export * from './DynamicForm';
9
6
  export * from './DynamicFormContext';
@@ -1,8 +1,8 @@
1
1
  import { jsx as t, jsxs as v } from "react/jsx-runtime";
2
- import { D as T, V as L, e as x, i as P, t as l, f as R, d as O } from "./index-Dy43iMlV.mjs";
3
- import { useEventEmitter as B, useReactive as W, useSize as A } from "ahooks";
2
+ import { D as T, V as L, e as x, i as P, t as l, f as R, d as O } from "./index-lzMv91zu.mjs";
3
+ import { useEventEmitter as B, useReactive as W, useSize as H } from "ahooks";
4
4
  import { FormattedMessage as I } from "react-intl";
5
- import { CloseCircleFilled as H, CheckCircleFilled as K } from "@ant-design/icons";
5
+ import { CloseCircleFilled as A, CheckCircleFilled as K } from "@ant-design/icons";
6
6
  import { Button as M } from "antd";
7
7
  import * as z from "monaco-editor";
8
8
  import { useRef as k, useEffect as N } from "react";
@@ -26,10 +26,7 @@ const G = "_modalContainer_8inkd_5", Q = "_editorContainer_8inkd_16", U = "_side
26
26
  siderContainer: ie
27
27
  };
28
28
  function re(e) {
29
- return /* @__PURE__ */ v("div", { className: oe.siderContainer, children: [
30
- /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(te, { open: e.open, nodeId: e.nodeId, onInsert: e.onInsert }) }),
31
- /* @__PURE__ */ t("div", { style: { textAlign: "center" } })
32
- ] });
29
+ return /* @__PURE__ */ t("div", { className: oe.siderContainer, children: /* @__PURE__ */ t(te, { open: e.open, nodeId: e.nodeId, onInsert: e.onInsert }) });
33
30
  }
34
31
  function se({ language: e = "javascript" }) {
35
32
  return /* @__PURE__ */ v("h2", { id: "workflow-online-ide-title", className: "workflow-online-ide-title", children: [
@@ -39,7 +36,7 @@ function se({ language: e = "javascript" }) {
39
36
  }
40
37
  function ae(e) {
41
38
  return /* @__PURE__ */ v("div", { className: "workflow-online-ide-toolbar", children: [
42
- /* @__PURE__ */ t(M, { size: "small", onClick: e.onCancel, icon: /* @__PURE__ */ t(H, {}), children: /* @__PURE__ */ t(I, { id: "app.common.word.cancel" }) }),
39
+ /* @__PURE__ */ t(M, { size: "small", onClick: e.onCancel, icon: /* @__PURE__ */ t(A, {}), children: /* @__PURE__ */ t(I, { id: "app.common.word.cancel" }) }),
43
40
  /* @__PURE__ */ t(M, { type: "primary", size: "small", onClick: e.onFinish, icon: /* @__PURE__ */ t(K, {}), children: /* @__PURE__ */ t(I, { id: "app.common.word.finish" }) })
44
41
  ] });
45
42
  }
@@ -114,7 +111,7 @@ function V(e, i) {
114
111
  u.length !== a.length && e.editor.setModelMarkers(i, d, u.map(ge));
115
112
  });
116
113
  }
117
- function fe(e, i) {
114
+ function pe(e, i) {
118
115
  const o = [].map((c) => ({
119
116
  insertText: c,
120
117
  kind: e.languages.CompletionItemKind.Function,
@@ -133,7 +130,7 @@ function fe(e, i) {
133
130
  // 触发提示的字符 可以定义多个
134
131
  });
135
132
  }
136
- function pe(e) {
133
+ function fe(e) {
137
134
  return e.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
138
135
  noSemanticValidation: !0,
139
136
  noSyntaxValidation: !1
@@ -157,20 +154,20 @@ function Ie(e) {
157
154
  code: "",
158
155
  range: new z.Range(1, 1, 1, 1)
159
156
  }), b = (n, r) => {
160
- n.onDidChangeCursorPosition((f) => {
161
- const m = f.position, { lineNumber: p = 0, column: C = 0 } = m;
162
- g.range = new r.Range(p, C, p, C);
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);
163
160
  }), d.current = n, n.focus(), g.code = n.getValue();
164
161
  const j = r.languages.registerHoverProvider(s, {
165
- provideHover: (f, m) => new Promise((p) => {
166
- const h = x(f.getValue()).find(
162
+ provideHover: (p, m) => new Promise((f) => {
163
+ const h = x(p.getValue()).find(
167
164
  (F) => P(F, m.lineNumber, m.column)
168
165
  );
169
166
  if (!h) {
170
- p(null);
167
+ f(null);
171
168
  return;
172
169
  }
173
- p({
170
+ f({
174
171
  range: new r.Range(
175
172
  h.startLine,
176
173
  h.startColumn,
@@ -182,13 +179,13 @@ function Ie(e) {
182
179
  })
183
180
  }), _ = n.getModel();
184
181
  if (_) {
185
- let f = !1;
186
- const m = r.editor.onDidChangeMarkers((p) => {
187
- f || !p.some((C) => C.toString() === _.uri.toString()) || (f = !0, window.setTimeout(() => {
182
+ let p = !1;
183
+ const m = r.editor.onDidChangeMarkers((f) => {
184
+ p || !f.some((C) => C.toString() === _.uri.toString()) || (p = !0, window.setTimeout(() => {
188
185
  try {
189
186
  V(r, _);
190
187
  } finally {
191
- f = !1;
188
+ p = !1;
192
189
  }
193
190
  }, 0));
194
191
  });
@@ -198,7 +195,7 @@ function Ie(e) {
198
195
  }, E = (n) => {
199
196
  u.current.forEach((r) => {
200
197
  r.dispose();
201
- }), u.current = [fe(n, s)], s === "javascript" && u.current.push(pe(n));
198
+ }), u.current = [pe(n, s)], s === "javascript" && u.current.push(fe(n));
202
199
  };
203
200
  N(
204
201
  () => () => {
@@ -227,7 +224,7 @@ function Ie(e) {
227
224
  }, $ = () => {
228
225
  var n;
229
226
  (n = e.onFinish) == null || n.call(e, g.code);
230
- }, D = k(null), y = A(D);
227
+ }, D = k(null), y = H(D);
231
228
  return q(
232
229
  /* @__PURE__ */ t(
233
230
  "div",
@@ -239,7 +236,7 @@ function Ie(e) {
239
236
  "aria-modal": "true",
240
237
  "aria-labelledby": "workflow-online-ide-title",
241
238
  children: /* @__PURE__ */ v("div", { className: w.editorContainer, id: "javascript-code-editor", children: [
242
- a ? /* @__PURE__ */ t("div", { className: w.sider, children: /* @__PURE__ */ t(
239
+ a ? /* @__PURE__ */ t("div", { className: w.sider, style: { maxWidth: "20%", padding: 0 }, children: /* @__PURE__ */ t(
243
240
  re,
244
241
  {
245
242
  onCancel: e.onCancel,
@@ -282,4 +279,4 @@ function Ie(e) {
282
279
  export {
283
280
  Ie as default
284
281
  };
285
- //# sourceMappingURL=index-trJRukGS.mjs.map
282
+ //# sourceMappingURL=index-JIsi-COV.mjs.map