@agentscope-ai/flow 0.0.7 → 0.0.9

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.
@@ -19,6 +19,8 @@ export interface ICustomOutputsFormProps {
19
19
  isRoot?: boolean;
20
20
  enabledTypes?: (IValueType | 'Array')[];
21
21
  disabledTypes?: (IValueType | 'Array')[];
22
+ tier?: number;
23
+ maxTier?: number;
22
24
  }
23
25
  export declare const CustomOutputsForm: React.NamedExoticComponent<ICustomOutputsFormProps>;
24
26
  export declare const CustomOutputsFormWrap: React.NamedExoticComponent<ICustomOutputsFormProps>;
@@ -12,7 +12,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
12
12
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
13
  import { FILE_PROPERTIES, VALUE_TYPE_OPTIONS } from "../../constant";
14
14
  import $i18n from "../../i18n";
15
- import { Button, Form, getCommonConfig, Input } from '@agentscope-ai/design';
15
+ import { Button, Form, getCommonConfig, Input, Tooltip } from '@agentscope-ai/design';
16
16
  import { SparkDeleteLine, SparkPlusLine, SparkUpLine } from '@agentscope-ai/icons';
17
17
  import { Cascader } from 'antd';
18
18
  import classNames from 'classnames';
@@ -166,7 +166,11 @@ export var CustomOutputsForm = /*#__PURE__*/memo(function (_ref) {
166
166
  _ref$isRoot = _ref.isRoot,
167
167
  isRoot = _ref$isRoot === void 0 ? false : _ref$isRoot,
168
168
  enabledTypes = _ref.enabledTypes,
169
- disabledTypes = _ref.disabledTypes;
169
+ disabledTypes = _ref.disabledTypes,
170
+ _ref$tier = _ref.tier,
171
+ tier = _ref$tier === void 0 ? 0 : _ref$tier,
172
+ _ref$maxTier = _ref.maxTier,
173
+ maxTier = _ref$maxTier === void 0 ? -1 : _ref$maxTier;
170
174
  var _Form$useForm = Form.useForm(),
171
175
  _Form$useForm2 = _slicedToArray(_Form$useForm, 1),
172
176
  form = _Form$useForm2[0];
@@ -288,21 +292,29 @@ export var CustomOutputsForm = /*#__PURE__*/memo(function (_ref) {
288
292
  });
289
293
  },
290
294
  enabledTypes: enabledTypes,
291
- disabledTypes: disabledTypes
295
+ disabledTypes: disabledTypes,
296
+ tier: tier + 1,
297
+ maxTier: maxTier
292
298
  }))));
293
- }), readyOnly !== true && /*#__PURE__*/React.createElement(Button, {
299
+ }), readyOnly !== true && /*#__PURE__*/React.createElement(Tooltip, {
300
+ title: maxTier !== -1 && tier >= maxTier ? $i18n.get({
301
+ id: 'spark-flow.components.CustomOutputsForm.index.maxTierReached',
302
+ dm: '最大层级已达到,无法添加子变量'
303
+ }) : null
304
+ }, /*#__PURE__*/React.createElement(Button, {
294
305
  type: "link",
295
306
  onClick: handleAdd,
296
307
  size: "small",
297
308
  className: "self-start spark-flow-text-btn",
298
- icon: /*#__PURE__*/React.createElement(SparkPlusLine, null)
309
+ icon: /*#__PURE__*/React.createElement(SparkPlusLine, null),
310
+ disabled: maxTier !== -1 && tier >= maxTier
299
311
  }, isRoot ? $i18n.get({
300
312
  id: 'spark-flow.components.CustomOutputsForm.index.addVariable',
301
313
  dm: '添加变量'
302
314
  }) : $i18n.get({
303
315
  id: 'spark-flow.components.CustomOutputsForm.index.addSubVariable',
304
316
  dm: '添加子变量'
305
- })));
317
+ }))));
306
318
  });
307
319
  export var CustomOutputsFormWrap = /*#__PURE__*/memo(function (props) {
308
320
  var value = props.value,
@@ -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 | Iterable<React.ReactNode> | React.JSX.Element | null | undefined>;
32
+ declare const VariableTreeSelect: React.MemoExoticComponent<(props: IVariableTreeSelectProps) => string | number | boolean | React.JSX.Element | Iterable<React.ReactNode> | null | undefined>;
33
33
  export default VariableTreeSelect;
@@ -39,6 +39,7 @@
39
39
  "spark-flow.components.CustomOutputsForm.index.variableName": "Name",
40
40
  "spark-flow.components.CustomOutputsForm.index.type": "Type",
41
41
  "spark-flow.components.CustomOutputsForm.index.description": "Description",
42
+ "spark-flow.components.CustomOutputsForm.index.maxTierReached": "Maximum tier reached, cannot add sub-variable",
42
43
  "spark-flow.components.FlowAside.index.nodeManagement": "Node",
43
44
  "spark-flow.components.FlowAside.index.nodeLibrary": "Library",
44
45
  "spark-flow.components.FlowAside.index.current": "Current",
@@ -39,6 +39,7 @@
39
39
  "spark-flow.components.CustomOutputsForm.index.variableName": "変数名",
40
40
  "spark-flow.components.CustomOutputsForm.index.type": "タイプ",
41
41
  "spark-flow.components.CustomOutputsForm.index.description": "説明",
42
+ "spark-flow.components.CustomOutputsForm.index.maxTierReached": "最大階層に達しました、子変数を追加できません",
42
43
  "spark-flow.components.FlowAside.index.nodeManagement": "ノード管理",
43
44
  "spark-flow.components.FlowAside.index.nodeLibrary": "ノードライブラリ",
44
45
  "spark-flow.components.FlowAside.index.current": "現在",
@@ -39,6 +39,7 @@
39
39
  "spark-flow.components.CustomOutputsForm.index.variableName": "变量名",
40
40
  "spark-flow.components.CustomOutputsForm.index.type": "类型",
41
41
  "spark-flow.components.CustomOutputsForm.index.description": "描述",
42
+ "spark-flow.components.CustomOutputsForm.index.maxTierReached": "最大层级已达到,无法添加子变量",
42
43
  "spark-flow.components.FlowAside.index.nodeManagement": "节点管理",
43
44
  "spark-flow.components.FlowAside.index.nodeLibrary": "节点库",
44
45
  "spark-flow.components.FlowAside.index.current": "当前",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/flow",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
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",