@digitalsee-ai/rcs 2.0.0-beta8 → 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.
@@ -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,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,5 +1,5 @@
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-DJvNGsCf.mjs";
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
3
  import { useEventEmitter as B, useReactive as W, useSize as H } from "ahooks";
4
4
  import { FormattedMessage as I } from "react-intl";
5
5
  import { CloseCircleFilled as A, CheckCircleFilled as K } from "@ant-design/icons";
@@ -279,4 +279,4 @@ function Ie(e) {
279
279
  export {
280
280
  Ie as default
281
281
  };
282
- //# sourceMappingURL=index-DBoa8kIP.mjs.map
282
+ //# sourceMappingURL=index-JIsi-COV.mjs.map