@agentscope-ai/flow 0.0.21 → 0.0.23
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/custom-inputs-control/index.js +20 -3
- package/dist/components/custom-inputs-control/index.less +5 -0
- package/dist/components/custom-outputs-form/index.js +1 -0
- package/dist/components/custom-outputs-form/index.less +23 -1
- package/dist/components/variable-tree-select/index.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/custom-connection-line/index.d.ts +0 -4
- package/dist/components/custom-handle/target-handle.d.ts +0 -6
- package/dist/components/drag-panel/index.d.ts +0 -10
- package/dist/components/draggable-with-handle/index.d.ts +0 -13
- package/dist/components/flow-base-edge/linear-gradient-svg.d.ts +0 -21
- package/dist/components/flow-panel/index.d.ts +0 -9
- package/dist/components/flow-panel/panel-container.d.ts +0 -12
- package/dist/components/select-with-desc/index.d.ts +0 -5
- package/dist/components/var-type-prefix/index.d.ts +0 -17
- package/dist/i18n/i18n.d.ts +0 -62
- package/dist/i18n/index.d.ts +0 -3
- package/dist/utils/unique-id.d.ts +0 -2
|
@@ -134,7 +134,15 @@ export var VariableSelector = /*#__PURE__*/memo(function (props) {
|
|
|
134
134
|
nodeType: targetNode.nodeType
|
|
135
135
|
};
|
|
136
136
|
}, [props.value, markedVariableList]);
|
|
137
|
-
return /*#__PURE__*/React.createElement(
|
|
137
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
138
|
+
className: "spark-flow-variable-select-wrapper",
|
|
139
|
+
onClickCapture: function onClickCapture(e) {
|
|
140
|
+
var _e$target;
|
|
141
|
+
if ((_e$target = e.target) !== null && _e$target !== void 0 && _e$target.closest('[class*="-select-clear"]')) {
|
|
142
|
+
e.stopPropagation();
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}, /*#__PURE__*/React.createElement(VariableTreeSelect, {
|
|
138
146
|
onChange: function onChange(val) {
|
|
139
147
|
props.onChange({
|
|
140
148
|
value: val.value,
|
|
@@ -159,11 +167,20 @@ export var VariableSelector = /*#__PURE__*/memo(function (props) {
|
|
|
159
167
|
className: classNames('w-full', 'spark-flow-variable-select'),
|
|
160
168
|
open: false,
|
|
161
169
|
value: !props.value.value ? undefined : props.value.value,
|
|
170
|
+
onChange: function onChange(next) {
|
|
171
|
+
if (next === undefined || next === null || next === '') {
|
|
172
|
+
props.onChange({
|
|
173
|
+
value: '',
|
|
174
|
+
type: props.value.type
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
},
|
|
162
178
|
prefix: props.prefix ? /*#__PURE__*/React.createElement(VarTypePrefix, {
|
|
163
179
|
prefix: props.prefix
|
|
164
180
|
}) : undefined,
|
|
165
|
-
variant: props.variant
|
|
166
|
-
|
|
181
|
+
variant: props.variant,
|
|
182
|
+
allowClear: true
|
|
183
|
+
})));
|
|
167
184
|
});
|
|
168
185
|
export var VariableFormComp = /*#__PURE__*/memo(function (props) {
|
|
169
186
|
if (props.data.valueFrom === 'clear') return /*#__PURE__*/React.createElement(Input, {
|
|
@@ -236,6 +236,7 @@ export var CustomOutputsForm = /*#__PURE__*/memo(function (_ref) {
|
|
|
236
236
|
className: "spark-flow-inputs-form-item flex gap-[8px] align-center"
|
|
237
237
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
238
238
|
name: "var_".concat(index),
|
|
239
|
+
className: "spark-flow-variable-name-item",
|
|
239
240
|
style: {
|
|
240
241
|
flex: 1,
|
|
241
242
|
marginBottom: 0
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.spark-flow-inputs-form-item {
|
|
36
|
-
height: 32px;
|
|
36
|
+
min-height: 32px;
|
|
37
37
|
.ant-select-sm .ant-select-selector,
|
|
38
38
|
.ant-input-sm {
|
|
39
39
|
font-size: 12px;
|
|
@@ -41,6 +41,28 @@
|
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
.spark-flow-variable-name-item {
|
|
45
|
+
min-width: 0;
|
|
46
|
+
|
|
47
|
+
.@{ant-prefix}-form-item-control,
|
|
48
|
+
.@{ant-prefix}-form-item-control-input,
|
|
49
|
+
.@{ant-prefix}-form-item-control-input-content {
|
|
50
|
+
min-width: 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.@{ant-prefix}-form-item-explain {
|
|
54
|
+
width: 100%;
|
|
55
|
+
max-width: 100%;
|
|
56
|
+
margin: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.@{ant-prefix}-form-item-explain-error {
|
|
60
|
+
white-space: normal;
|
|
61
|
+
word-break: break-word;
|
|
62
|
+
line-height: 1.4;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
44
66
|
.spark-flow-variable-type-select {
|
|
45
67
|
.@{ant-prefix}-cascader-dropdown .@{ant-prefix}-cascader-menu {
|
|
46
68
|
height: auto;
|
|
@@ -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;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentscope-ai/flow",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
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",
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface DragPanelProps {
|
|
4
|
-
maxWidth: number;
|
|
5
|
-
minWidth: number;
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
defaultWidth?: number;
|
|
8
|
-
}
|
|
9
|
-
declare const DragPanel: React.FC<DragPanelProps>;
|
|
10
|
-
export default DragPanel;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface DraggableWithHandleProps<T> {
|
|
4
|
-
items: T[];
|
|
5
|
-
onChange: (items: T[]) => void;
|
|
6
|
-
renderItem: (item: T, dragHandleProps: ReactNode) => ReactNode;
|
|
7
|
-
getItemId: (item: T) => string;
|
|
8
|
-
dragIcon?: ReactNode;
|
|
9
|
-
className?: string;
|
|
10
|
-
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export declare function DraggableWithHandle<T>({ items, onChange, renderItem, getItemId, dragIcon, className, disabled, }: DraggableWithHandleProps<T>): React.JSX.Element;
|
|
13
|
-
export default DraggableWithHandle;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
export type ILinearGradientSvgProps = {
|
|
4
|
-
id: string;
|
|
5
|
-
startColor: string;
|
|
6
|
-
stopColor: string;
|
|
7
|
-
position: {
|
|
8
|
-
sourceX: number;
|
|
9
|
-
sourceY: number;
|
|
10
|
-
targetX: number;
|
|
11
|
-
targetY: number;
|
|
12
|
-
};
|
|
13
|
-
colorList: Array<{
|
|
14
|
-
color: string;
|
|
15
|
-
opacity?: number;
|
|
16
|
-
offset: number;
|
|
17
|
-
}>;
|
|
18
|
-
animated?: boolean;
|
|
19
|
-
};
|
|
20
|
-
declare const _default: React.MemoExoticComponent<({ id, position, colorList, animated, }: ILinearGradientSvgProps) => React.JSX.Element>;
|
|
21
|
-
export default _default;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import './index.less';
|
|
3
|
-
interface IFlowPanel {
|
|
4
|
-
children?: React.ReactNode[] | React.ReactNode;
|
|
5
|
-
className?: string;
|
|
6
|
-
style?: React.CSSProperties;
|
|
7
|
-
}
|
|
8
|
-
declare const _default: React.NamedExoticComponent<IFlowPanel>;
|
|
9
|
-
export default _default;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface IPanelContainerProps {
|
|
3
|
-
title?: React.ReactNode;
|
|
4
|
-
right?: React.ReactNode;
|
|
5
|
-
children: React.ReactNode;
|
|
6
|
-
onClose?: () => void;
|
|
7
|
-
noPadding?: boolean;
|
|
8
|
-
hiddenRight?: boolean;
|
|
9
|
-
headerBottom?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
declare const _default: React.NamedExoticComponent<IPanelContainerProps>;
|
|
12
|
-
export default _default;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export declare const typeAbbr: {
|
|
3
|
-
'Array<Object>': string;
|
|
4
|
-
'Array<File>': string;
|
|
5
|
-
'Array<String>': string;
|
|
6
|
-
'Array<Number>': string;
|
|
7
|
-
'Array<Boolean>': string;
|
|
8
|
-
Object: string;
|
|
9
|
-
File: string;
|
|
10
|
-
String: string;
|
|
11
|
-
Number: string;
|
|
12
|
-
Boolean: string;
|
|
13
|
-
};
|
|
14
|
-
declare const _default: React.NamedExoticComponent<{
|
|
15
|
-
prefix?: string | undefined;
|
|
16
|
-
}>;
|
|
17
|
-
export default _default;
|
package/dist/i18n/i18n.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
interface I18nVariables {
|
|
2
|
-
[key: string]: any;
|
|
3
|
-
}
|
|
4
|
-
interface IMultiLangMap {
|
|
5
|
-
[key: string]: {
|
|
6
|
-
[key: string]: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
type TLanguage = 'en' | 'zh' | 'ja' | string;
|
|
10
|
-
/**
|
|
11
|
-
* Internationalization (i18n) utility class
|
|
12
|
-
* Handles language management and string translations
|
|
13
|
-
*/
|
|
14
|
-
export default class I18N {
|
|
15
|
-
multiLangMap: IMultiLangMap;
|
|
16
|
-
language: TLanguage;
|
|
17
|
-
/**
|
|
18
|
-
* Initialize I18N instance with multi-language map
|
|
19
|
-
* @param config Configuration object containing multiLangMap
|
|
20
|
-
*/
|
|
21
|
-
constructor({ multiLangMap }: {
|
|
22
|
-
multiLangMap: IMultiLangMap;
|
|
23
|
-
});
|
|
24
|
-
/**
|
|
25
|
-
* Convert value to string with fallback
|
|
26
|
-
* @param value Input value to convert
|
|
27
|
-
* @param defaultValue Fallback value if conversion fails
|
|
28
|
-
* @returns String representation of the value
|
|
29
|
-
*/
|
|
30
|
-
toString: (value: any, defaultValue: string) => any;
|
|
31
|
-
/**
|
|
32
|
-
* Set current application language
|
|
33
|
-
* @param language Language code to set ('en' or 'zh')
|
|
34
|
-
*/
|
|
35
|
-
setCurrentLanguage(language: TLanguage): void;
|
|
36
|
-
/**
|
|
37
|
-
* Get current application language
|
|
38
|
-
* @returns Current language code
|
|
39
|
-
*/
|
|
40
|
-
getCurrentLanguage(): string;
|
|
41
|
-
/**
|
|
42
|
-
* Format translation string with variables
|
|
43
|
-
* @param idObj Translation ID or object containing ID and default message
|
|
44
|
-
* @param variables Variables to interpolate into the translation
|
|
45
|
-
* @returns Formatted translation string
|
|
46
|
-
*/
|
|
47
|
-
format: (idObj: string | {
|
|
48
|
-
id: string;
|
|
49
|
-
dm: string;
|
|
50
|
-
}, variables: I18nVariables) => string;
|
|
51
|
-
/**
|
|
52
|
-
* Get translation for given ID
|
|
53
|
-
* @param id Translation ID or object containing ID and default message
|
|
54
|
-
* @param variables Optional variables to interpolate
|
|
55
|
-
* @returns Translated string
|
|
56
|
-
*/
|
|
57
|
-
get(id: string | {
|
|
58
|
-
id: string;
|
|
59
|
-
dm: string;
|
|
60
|
-
}, variable?: I18nVariables): string;
|
|
61
|
-
}
|
|
62
|
-
export {};
|
package/dist/i18n/index.d.ts
DELETED