@agentscope-ai/flow 0.0.15 → 0.0.17

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.
@@ -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) => "<" | ">" | "=" | "" | "" | "≤" | "∋" | "∌" | undefined;
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
  },
@@ -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;
@@ -208,8 +208,11 @@ export var getParentInputParams = function getParentInputParams(node) {
208
208
  var inputParams = node.data.inputParams;
209
209
  var list = [];
210
210
  inputParams.forEach(function (item) {
211
- var _item$type;
212
- if ((_item$type = item.type) !== null && _item$type !== void 0 && _item$type.includes('Array') && !!item.value) {
211
+ var _item$value, _item$type;
212
+ // 检查是不是数组里的子变量,例如${DocumentParse_AKQK.layout.[markdownContent]
213
+ var matches = (_item$value = item.value) === null || _item$value === void 0 ? void 0 : _item$value.match(/\[[^\[\]]+\]/g);
214
+ var isSubPropertyInArray = matches === null || matches === void 0 ? void 0 : matches.length;
215
+ if (((_item$type = item.type) !== null && _item$type !== void 0 && _item$type.includes('Array') || isSubPropertyInArray) && !!item.value) {
213
216
  var arrayType = item.type.replace(/^Array<(.+)>$/, '$1');
214
217
  list.push({
215
218
  label: "item (in ".concat(item.key, ")"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentscope-ai/flow",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
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",