@agentscope-ai/flow 0.0.14 → 0.0.16
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/dist/components/base-node/index.d.ts +4 -0
- package/dist/components/base-node/index.js +3 -2
- package/dist/components/condition-item/index.d.ts +1 -1
- package/dist/components/flow-panel/config-panel.js +1 -1
- package/dist/components/variable-input/index.js +4 -1
- package/dist/components/variable-tree-select/index.d.ts +1 -1
- package/dist/i18n/locales/en-us.json +1 -0
- package/dist/i18n/locales/ja-jp.json +1 -0
- package/dist/i18n/locales/zh-cn.json +1 -0
- package/dist/types/work-flow.d.ts +2 -0
- package/package.json +1 -1
|
@@ -10,6 +10,10 @@ interface IProps extends NodeProps<IWorkFlowNode> {
|
|
|
10
10
|
disableAction?: boolean;
|
|
11
11
|
className?: string;
|
|
12
12
|
hasFailBranch?: boolean;
|
|
13
|
+
slots?: {
|
|
14
|
+
label?: React.ReactNode;
|
|
15
|
+
afterLabel?: React.ReactNode;
|
|
16
|
+
};
|
|
13
17
|
}
|
|
14
18
|
export declare const NodeStatusIcon: React.MemoExoticComponent<({ status }: {
|
|
15
19
|
status: IWorkFlowStatus;
|
|
@@ -64,6 +64,7 @@ export var NodeStatusIcon = /*#__PURE__*/memo(function (_ref) {
|
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
function BaseNode(props) {
|
|
67
|
+
var _props$slots, _props$slots2;
|
|
67
68
|
var containerRef = useRef(null);
|
|
68
69
|
var taskStore = useStore(function (store) {
|
|
69
70
|
return store.taskStore;
|
|
@@ -174,12 +175,12 @@ function BaseNode(props) {
|
|
|
174
175
|
className: "flex gap-[8px] items-center flex-1"
|
|
175
176
|
}, /*#__PURE__*/React.createElement(FlowIcon, {
|
|
176
177
|
nodeType: props.type
|
|
177
|
-
}), /*#__PURE__*/React.createElement(Typography.Text, {
|
|
178
|
+
}), !!((_props$slots = props.slots) !== null && _props$slots !== void 0 && _props$slots.label) ? props.slots.label : /*#__PURE__*/React.createElement(Typography.Text, {
|
|
178
179
|
ellipsis: {
|
|
179
180
|
tooltip: true
|
|
180
181
|
},
|
|
181
182
|
className: "spark-flow-node-label flex-1 w-1"
|
|
182
|
-
}, props.data.label)), !!nodeResult && showResults ? /*#__PURE__*/React.createElement(NodeStatusIcon, {
|
|
183
|
+
}, props.data.label), !!((_props$slots2 = props.slots) !== null && _props$slots2 !== void 0 && _props$slots2.afterLabel) && props.slots.afterLabel), !!nodeResult && showResults ? /*#__PURE__*/React.createElement(NodeStatusIcon, {
|
|
183
184
|
status: nodeResult.nodeStatus
|
|
184
185
|
}) : props.disableAction ? null : /*#__PURE__*/React.createElement("div", {
|
|
185
186
|
onClick: function onClick(e) {
|
|
@@ -2,7 +2,7 @@ import { IConditionItem } from "../../types/work-flow";
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { IVarTreeItem } from '../variable-tree-select';
|
|
4
4
|
import './index.less';
|
|
5
|
-
export declare const operatorLabelRender: (val: string) => "
|
|
5
|
+
export declare const operatorLabelRender: (val: string) => "=" | "≠" | ">" | "≥" | "<" | "≤" | "∋" | "∌" | undefined;
|
|
6
6
|
export interface IConditionItemProps {
|
|
7
7
|
value: IConditionItem;
|
|
8
8
|
onChange: (value: Partial<IConditionItem>) => void;
|
|
@@ -198,7 +198,7 @@ export var ConfigPanel = /*#__PURE__*/memo(function (_ref) {
|
|
|
198
198
|
className: "size-[32px] flex-shrink-0",
|
|
199
199
|
type: "text",
|
|
200
200
|
icon: /*#__PURE__*/React.createElement(SparkFalseLine, null)
|
|
201
|
-
})) : /*#__PURE__*/React.createElement(Typography.Text, {
|
|
201
|
+
})) : typeof (nodeInfo === null || nodeInfo === void 0 ? void 0 : nodeInfo.titleRenderer) === 'function' ? nodeInfo === null || nodeInfo === void 0 ? void 0 : nodeInfo.titleRenderer(selectedNodeData.data) : /*#__PURE__*/React.createElement(Typography.Text, {
|
|
202
202
|
ellipsis: {
|
|
203
203
|
tooltip: true
|
|
204
204
|
},
|
|
@@ -121,7 +121,10 @@ export var VariableBaseInput = /*#__PURE__*/memo(function (_ref) {
|
|
|
121
121
|
return /*#__PURE__*/React.createElement(Flex, {
|
|
122
122
|
align: "center",
|
|
123
123
|
className: "spark-flow-variable-input-file-tip"
|
|
124
|
-
},
|
|
124
|
+
}, $i18n.get({
|
|
125
|
+
id: 'spark-flow.components.VariableInput.index.fileTypeNotSupportManualInput',
|
|
126
|
+
dm: '文件类型不支持手动输入'
|
|
127
|
+
}));
|
|
125
128
|
default:
|
|
126
129
|
return null;
|
|
127
130
|
}
|
|
@@ -29,5 +29,5 @@ export declare const VariableTreeNodeItem: React.MemoExoticComponent<(props: IVa
|
|
|
29
29
|
value?: string | undefined;
|
|
30
30
|
onChange?: ((value: Pick<IVarItem, 'type' | 'value'>) => void) | undefined;
|
|
31
31
|
}) => React.JSX.Element>;
|
|
32
|
-
declare const VariableTreeSelect: React.MemoExoticComponent<(props: IVariableTreeSelectProps) => string | number | boolean | React.
|
|
32
|
+
declare const VariableTreeSelect: React.MemoExoticComponent<(props: IVariableTreeSelectProps) => string | number | boolean | Iterable<React.ReactNode> | React.JSX.Element | null | undefined>;
|
|
33
33
|
export default VariableTreeSelect;
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"spark-flow.components.VariableInput.index.select": "Select",
|
|
117
117
|
"spark-flow.components.VariableInput.index.yes": "Yes",
|
|
118
118
|
"spark-flow.components.VariableInput.index.no": "No",
|
|
119
|
+
"spark-flow.components.VariableInput.index.fileTypeNotSupportManualInput": "File type does not support manual input",
|
|
119
120
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultValue": "Default Value",
|
|
120
121
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultOutputWhenExceptionOccurs": "Specify Default Output When Exception Occurs",
|
|
121
122
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.exceptionBranch": "Exceptional Branch",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"spark-flow.components.VariableInput.index.select": "選択してください",
|
|
117
117
|
"spark-flow.components.VariableInput.index.yes": "はい",
|
|
118
118
|
"spark-flow.components.VariableInput.index.no": "いいえ",
|
|
119
|
+
"spark-flow.components.VariableInput.index.fileTypeNotSupportManualInput": "ファイルタイプは手動入力をサポートしていません",
|
|
119
120
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultValue": "デフォルト値",
|
|
120
121
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultOutputWhenExceptionOccurs": "例外が発生した場合、デフォルトの出力内容を指定します",
|
|
121
122
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.exceptionBranch": "例外ブランチ",
|
|
@@ -116,6 +116,7 @@
|
|
|
116
116
|
"spark-flow.components.VariableInput.index.select": "请选择",
|
|
117
117
|
"spark-flow.components.VariableInput.index.yes": "是",
|
|
118
118
|
"spark-flow.components.VariableInput.index.no": "否",
|
|
119
|
+
"spark-flow.components.VariableInput.index.fileTypeNotSupportManualInput": "文件类型不支持手动输入",
|
|
119
120
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultValue": "默认值",
|
|
120
121
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.defaultOutputWhenExceptionOccurs": "当发生异常时,指定默认输出内容",
|
|
121
122
|
"spark-flow.demos.spark-flow-1.components.ErrorCatchForm.index.exceptionBranch": "异常分支",
|
|
@@ -10,6 +10,8 @@ export interface INodeSchema {
|
|
|
10
10
|
type: string;
|
|
11
11
|
iconType: (props: SparkIconProps) => ReactNode;
|
|
12
12
|
title: string;
|
|
13
|
+
/** Node title Renderer */
|
|
14
|
+
titleRenderer?: (data: IWorkFlowNodeData) => ReactNode;
|
|
13
15
|
desc: string;
|
|
14
16
|
defaultParams: Omit<IWorkFlowNodeData, 'label'>;
|
|
15
17
|
isSystem?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/flow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"description": "A powerful and flexible flow canvas rendering engine designed for AI applications. Provides comprehensive workflow visualization and interaction capabilities for platforms like Bailian and AgentScope, enabling seamless creation and management of complex AI agent workflows with an intuitive drag-and-drop interface.",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|