@huanban/rulego-editor-react 1.1.0 → 1.1.3
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/LICENSE +190 -0
- package/dist/components/AIAssistant.d.ts +22 -0
- package/dist/components/ComponentSidebar.d.ts +10 -0
- package/dist/components/ContextMenu.d.ts +7 -3
- package/dist/components/CopilotChat.d.ts +31 -0
- package/dist/components/DataViewDialog.d.ts +8 -0
- package/dist/components/DebugPanel.d.ts +8 -0
- package/dist/components/DynamicForm.d.ts +65 -0
- package/dist/components/EdgePropertyDrawer.d.ts +14 -0
- package/dist/components/EditorToolbar.d.ts +8 -0
- package/dist/components/ImportExportDialog.d.ts +8 -0
- package/dist/components/LogViewer.d.ts +45 -0
- package/dist/components/MiniMap.d.ts +8 -0
- package/dist/components/NodePropertyDrawer.d.ts +117 -1
- package/dist/components/RuleChainSettings.d.ts +8 -0
- package/dist/components/RuleGoEditor.d.ts +56 -7
- package/dist/components/RuleMaintenancePanel.d.ts +15 -0
- package/dist/components/SearchPanel.d.ts +8 -0
- package/dist/components/SearchableSelect.d.ts +29 -0
- package/dist/components/ValidationPanel.d.ts +8 -0
- package/dist/components/WorkflowInfoPanel.d.ts +17 -1
- package/dist/components/WorkflowList.d.ts +8 -1
- package/dist/components/properties/AgentOrchestrationProperties.d.ts +13 -0
- package/dist/i18n.d.ts +14 -0
- package/dist/index.cjs.js +5852 -965
- package/dist/index.d.ts +16 -2
- package/dist/index.esm.js +86296 -50342
- package/dist/style.css +1 -1
- package/package.json +13 -13
|
@@ -12,18 +12,92 @@
|
|
|
12
12
|
* @see ComponentField — 字段定义类型
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import type { AiProviderOption, LocaleMessages } from '@huanban/rulego-editor-core';
|
|
16
|
+
import type { EditorTranslate } from '../i18n';
|
|
17
|
+
export type FieldOption = string | {
|
|
18
|
+
label?: string;
|
|
19
|
+
value?: string;
|
|
20
|
+
name?: string;
|
|
21
|
+
id?: string;
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
};
|
|
24
|
+
export interface GraphNodeOptionSource {
|
|
25
|
+
id?: string;
|
|
26
|
+
nodeId?: string;
|
|
27
|
+
name?: string;
|
|
28
|
+
text?: string | {
|
|
29
|
+
value?: string;
|
|
30
|
+
};
|
|
31
|
+
type?: string;
|
|
32
|
+
properties?: Record<string, unknown>;
|
|
33
|
+
[key: string]: unknown;
|
|
34
|
+
}
|
|
35
|
+
export interface RuleChainOptionSource {
|
|
36
|
+
id?: string;
|
|
37
|
+
value?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
label?: string;
|
|
40
|
+
desc?: string;
|
|
41
|
+
description?: string;
|
|
42
|
+
root?: boolean;
|
|
43
|
+
ruleChain?: Record<string, unknown>;
|
|
44
|
+
[key: string]: unknown;
|
|
45
|
+
}
|
|
46
|
+
export interface RuleChainFetchParams {
|
|
47
|
+
root: boolean;
|
|
48
|
+
keywords: string;
|
|
49
|
+
page: number;
|
|
50
|
+
size: number;
|
|
51
|
+
signal?: AbortSignal;
|
|
52
|
+
}
|
|
53
|
+
export interface RuleChainFetchResult {
|
|
54
|
+
items?: RuleChainOptionSource[];
|
|
55
|
+
records?: RuleChainOptionSource[];
|
|
56
|
+
rows?: RuleChainOptionSource[];
|
|
57
|
+
list?: RuleChainOptionSource[];
|
|
58
|
+
total?: number;
|
|
59
|
+
page?: number;
|
|
60
|
+
current?: number;
|
|
61
|
+
size?: number;
|
|
62
|
+
pageSize?: number;
|
|
63
|
+
data?: unknown;
|
|
64
|
+
[key: string]: unknown;
|
|
65
|
+
}
|
|
15
66
|
/** 组件字段定义 */
|
|
16
67
|
export interface FieldDef {
|
|
17
68
|
/** 字段名 */
|
|
18
69
|
name: string;
|
|
19
70
|
/** 字段类型 */
|
|
20
|
-
type
|
|
71
|
+
type?: string;
|
|
21
72
|
/** 显示标签 */
|
|
22
73
|
label?: string;
|
|
23
74
|
/** 字段描述 */
|
|
24
75
|
desc?: string;
|
|
25
76
|
/** 默认值 */
|
|
26
77
|
defaultValue?: unknown;
|
|
78
|
+
/** component 协议 */
|
|
79
|
+
component?: {
|
|
80
|
+
type?: string;
|
|
81
|
+
caseType?: string;
|
|
82
|
+
source?: string;
|
|
83
|
+
options?: FieldOption[];
|
|
84
|
+
multiple?: boolean;
|
|
85
|
+
filterable?: boolean;
|
|
86
|
+
allowCreate?: boolean;
|
|
87
|
+
placeholder?: string;
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
rows?: number;
|
|
90
|
+
};
|
|
91
|
+
/** 兼容旧字段选项协议 */
|
|
92
|
+
options?: FieldOption[];
|
|
93
|
+
/** 嵌套字段定义,struct/table/switch 类字段会使用 */
|
|
94
|
+
fields?: FieldDef[];
|
|
95
|
+
/** ref 协议:primary/shared 字段会随连接模式联动隐藏 */
|
|
96
|
+
ref?: string;
|
|
97
|
+
/** providerType 协议:embedding 字段使用 embedding provider 预设 */
|
|
98
|
+
providerType?: string;
|
|
99
|
+
/** 是否禁用 */
|
|
100
|
+
disabled?: boolean;
|
|
27
101
|
/** 校验规则 */
|
|
28
102
|
rules?: unknown[];
|
|
29
103
|
}
|
|
@@ -71,6 +145,48 @@ export interface NodePropertyDrawerProps {
|
|
|
71
145
|
onSubmit: (model: NodeModel) => void;
|
|
72
146
|
/** 关闭回调 */
|
|
73
147
|
onClose: () => void;
|
|
148
|
+
/** Current locale. Defaults to zh-CN. */
|
|
149
|
+
locale?: string;
|
|
150
|
+
/** Extra locale messages merged into the selected locale. */
|
|
151
|
+
messages?: LocaleMessages;
|
|
152
|
+
/** Host-provided translation function. */
|
|
153
|
+
t?: EditorTranslate;
|
|
154
|
+
/** Current graph nodes for component.source=nodes hydration. */
|
|
155
|
+
graphNodes?: GraphNodeOptionSource[];
|
|
156
|
+
/** Rule chain list for component.source=ruleChains hydration. */
|
|
157
|
+
ruleItems?: RuleChainOptionSource[];
|
|
158
|
+
/** Current rule chain used to avoid selecting itself in rule-chain fields. */
|
|
159
|
+
currentRuleChain?: RuleChainOptionSource | null;
|
|
160
|
+
/** Explicit /rules endpoint. If omitted, apiBase + /rules is used. */
|
|
161
|
+
rulesApi?: string;
|
|
162
|
+
/** API base ending at /api/v1 for remote rule-chain selector loading. */
|
|
163
|
+
apiBase?: string;
|
|
164
|
+
/** Page size for rule-chain selector modal. Defaults to 12. */
|
|
165
|
+
rulePageSize?: number;
|
|
166
|
+
/** Host override for remote rule-chain selector loading. */
|
|
167
|
+
fetchRuleChains?: (params: RuleChainFetchParams) => Promise<RuleChainFetchResult | RuleChainOptionSource[] | unknown>;
|
|
168
|
+
/** Components API payload, used for builtins["ai/tools"].tools and skillPath parity. */
|
|
169
|
+
componentsPayload?: Record<string, unknown>;
|
|
170
|
+
/** Legacy alias for componentsPayload. */
|
|
171
|
+
componentPayload?: Record<string, unknown>;
|
|
172
|
+
/** Host-provided builtin AI tools. Accepts the original /components builtins["ai/tools"].tools rows. */
|
|
173
|
+
builtinTools?: unknown[];
|
|
174
|
+
/** Official editorOptions.tools alias. */
|
|
175
|
+
tools?: unknown[];
|
|
176
|
+
/** Global skill directory returned by /components. */
|
|
177
|
+
skillPath?: string;
|
|
178
|
+
/** Host override for loading /components payload or builtin tools. */
|
|
179
|
+
fetchBuiltinTools?: (params: {
|
|
180
|
+
signal?: AbortSignal;
|
|
181
|
+
}) => Promise<unknown>;
|
|
182
|
+
/** Open the AI assistant or skill manager from a builtin skill tool helper. */
|
|
183
|
+
onOpenAiAssistant?: (options: {
|
|
184
|
+
section?: string;
|
|
185
|
+
}) => void;
|
|
186
|
+
/** AI provider presets, aligned with editorOptions.aiProviders. */
|
|
187
|
+
aiProviders?: AiProviderOption[];
|
|
188
|
+
/** Embedding provider presets, aligned with editorOptions.aiEmbeddingProviders. */
|
|
189
|
+
aiEmbeddingProviders?: AiProviderOption[];
|
|
74
190
|
}
|
|
75
191
|
/**
|
|
76
192
|
* NodePropertyDrawer 组件
|
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
* @see RuleChainSettingsProps — 设置参数
|
|
13
13
|
*/
|
|
14
14
|
import React from 'react';
|
|
15
|
+
import type { LocaleMessages } from '@huanban/rulego-editor-core';
|
|
16
|
+
import type { EditorTranslate } from '../i18n';
|
|
15
17
|
/** 规则链设置数据 */
|
|
16
18
|
export interface RuleChainSettingsData {
|
|
17
19
|
/** 规则链 ID */
|
|
@@ -63,6 +65,12 @@ export interface RuleChainSettingsProps {
|
|
|
63
65
|
onSave?: (data: RuleChainSettingsData) => void;
|
|
64
66
|
/** 取消 / 关闭 */
|
|
65
67
|
onClose: () => void;
|
|
68
|
+
/** Current locale. Defaults to zh-CN. */
|
|
69
|
+
locale?: string;
|
|
70
|
+
/** Extra locale messages merged into the selected locale. */
|
|
71
|
+
messages?: LocaleMessages;
|
|
72
|
+
/** Host-provided translation function. */
|
|
73
|
+
t?: EditorTranslate;
|
|
66
74
|
}
|
|
67
75
|
/**
|
|
68
76
|
* RuleChainSettings 组件
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
*/
|
|
30
30
|
import React from 'react';
|
|
31
31
|
import { HuanbanRulegoEditor } from '@huanban/rulego-editor-core';
|
|
32
|
+
import type { AIAssistantOpenOptions, HuanbanRulegoEditorOptions } from '@huanban/rulego-editor-core';
|
|
32
33
|
import type { EditorCore } from '@huanban/rulego-editor-core';
|
|
33
|
-
import type { RuleChainData,
|
|
34
|
+
import type { RuleChainData, RawComponentData } from '@huanban/rulego-editor-core';
|
|
34
35
|
import LogicFlow from '@logicflow/core';
|
|
35
36
|
/**
|
|
36
37
|
* RuleGoEditor 组件 Props
|
|
@@ -61,15 +62,19 @@ export interface RuleGoEditorProps {
|
|
|
61
62
|
* 当需要自定义请求逻辑(如统一认证拦截、请求签名、错误重试等)时使用
|
|
62
63
|
* 函数签名: (url: string, init: RequestInit) => Promise<Response>
|
|
63
64
|
*/
|
|
64
|
-
customFetch?: (url: string, init
|
|
65
|
+
customFetch?: (url: string, init?: RequestInit) => Promise<Response>;
|
|
65
66
|
/** 初始规则链数据 */
|
|
66
67
|
data?: RuleChainData | null;
|
|
67
|
-
/**
|
|
68
|
-
components?:
|
|
68
|
+
/** 初始组件列表,支持数组或 /api/v1/components 分段返回 */
|
|
69
|
+
components?: RawComponentData;
|
|
69
70
|
/** 是否显示工具栏, 默认 true */
|
|
70
71
|
showToolbar?: boolean;
|
|
71
72
|
/** 工具栏左侧标题 */
|
|
72
73
|
toolbarTitle?: string;
|
|
74
|
+
/** 是否显示工具栏按钮文字,默认 false;设为 true 时显示图标 + 文字 */
|
|
75
|
+
showToolbarButtonLabels?: boolean;
|
|
76
|
+
/** 工具栏是否只显示图标,默认 true;显式 false 时可显示文字 */
|
|
77
|
+
toolbarIconOnly?: boolean;
|
|
73
78
|
/** 是否显示侧边栏, 默认 true */
|
|
74
79
|
showSidebar?: boolean;
|
|
75
80
|
/** 侧边栏宽度, 默认 220 */
|
|
@@ -78,6 +83,16 @@ export interface RuleGoEditorProps {
|
|
|
78
83
|
sidebarCollapsed?: boolean;
|
|
79
84
|
/** 是否显示信息按钮 */
|
|
80
85
|
showInfoButton?: boolean;
|
|
86
|
+
/** 是否显示 AI 助手按钮 */
|
|
87
|
+
showAiChatButton?: boolean;
|
|
88
|
+
/** 是否显示设置按钮 */
|
|
89
|
+
showSettingsButton?: boolean;
|
|
90
|
+
/** 是否显示调试面板按钮 */
|
|
91
|
+
showDebugConsoleButton?: boolean;
|
|
92
|
+
/** 是否显示清除调试高亮按钮 */
|
|
93
|
+
showClearDebugHighlightButton?: boolean;
|
|
94
|
+
/** 是否显示框选按钮 */
|
|
95
|
+
showSelectionButton?: boolean;
|
|
81
96
|
/** 是否显示导出按钮, 默认 true */
|
|
82
97
|
showExportDialog?: boolean;
|
|
83
98
|
/** 是否显示运行按钮 */
|
|
@@ -96,19 +111,31 @@ export interface RuleGoEditorProps {
|
|
|
96
111
|
showDebugTab?: boolean;
|
|
97
112
|
/** 语言设置, 默认 'zh_cn' */
|
|
98
113
|
locale?: string;
|
|
114
|
+
/** 初始/受控主题;支持 default/dark/nature/elegant/tech/modern,兼容 light/blue */
|
|
115
|
+
theme?: string;
|
|
99
116
|
/** LogicFlow 额外配置 (与默认配置合并) */
|
|
100
117
|
lfOptions?: Record<string, unknown>;
|
|
101
118
|
/** LogicFlow 插件数组 */
|
|
102
119
|
lfPlugins?: any[];
|
|
103
120
|
/** EditorCore 额外配置 */
|
|
104
121
|
coreOptions?: Record<string, unknown>;
|
|
122
|
+
/** 直接透传给 HuanbanRulegoEditor 的扩展配置,显式 props 会覆盖这里的同名字段 */
|
|
123
|
+
options?: Partial<HuanbanRulegoEditorOptions>;
|
|
105
124
|
/** 编辑器就绪 */
|
|
106
125
|
onReady?: (ctx: {
|
|
107
126
|
lf: LogicFlow;
|
|
108
127
|
core: EditorCore;
|
|
109
128
|
}) => void;
|
|
110
129
|
/** 保存回调 */
|
|
111
|
-
onSave?: (data: unknown) => void
|
|
130
|
+
onSave?: (data: unknown) => void | boolean | {
|
|
131
|
+
success?: boolean;
|
|
132
|
+
msg?: string;
|
|
133
|
+
message?: string;
|
|
134
|
+
} | Promise<void | boolean | {
|
|
135
|
+
success?: boolean;
|
|
136
|
+
msg?: string;
|
|
137
|
+
message?: string;
|
|
138
|
+
}>;
|
|
112
139
|
/** 节点点击 */
|
|
113
140
|
onNodeClick?: (data: unknown) => void;
|
|
114
141
|
/** 节点双击 */
|
|
@@ -133,7 +160,15 @@ export interface RuleGoEditorProps {
|
|
|
133
160
|
/** 语言切换回调 */
|
|
134
161
|
onLocaleChange?: (locale: string) => void;
|
|
135
162
|
/** 劫持部署 */
|
|
136
|
-
onDeploy?: (chainId: string, action: 'deploy' | 'undeploy' | 'reload') => void
|
|
163
|
+
onDeploy?: (chainId: string, action: 'deploy' | 'undeploy' | 'reload') => void | boolean | {
|
|
164
|
+
success?: boolean;
|
|
165
|
+
msg?: string;
|
|
166
|
+
message?: string;
|
|
167
|
+
} | Promise<void | boolean | {
|
|
168
|
+
success?: boolean;
|
|
169
|
+
msg?: string;
|
|
170
|
+
message?: string;
|
|
171
|
+
}>;
|
|
137
172
|
/** 选择规则链 */
|
|
138
173
|
onSelectRuleChain?: (ruleChain: any) => void;
|
|
139
174
|
/** 删除规则链 */
|
|
@@ -144,6 +179,12 @@ export interface RuleGoEditorProps {
|
|
|
144
179
|
ruleItems?: any[];
|
|
145
180
|
/** 规则链 API 地址 */
|
|
146
181
|
rulesApi?: string;
|
|
182
|
+
/**
|
|
183
|
+
* 自定义无头节点渲染器
|
|
184
|
+
* 当使用 HeadlessHtmlNode 时,核心引擎会派发 `node:html-mount` 事件。
|
|
185
|
+
* React 适配层会捕获该事件并调用本函数,将返回的 React 节点通过 Portal 挂载到画布内部。
|
|
186
|
+
*/
|
|
187
|
+
renderNode?: (type: string, data: any, model: any) => React.ReactNode;
|
|
147
188
|
}
|
|
148
189
|
/**
|
|
149
190
|
* RuleGoEditor 的命令式 API
|
|
@@ -159,13 +200,21 @@ export interface RuleGoEditorRef {
|
|
|
159
200
|
/** 重新加载数据 */
|
|
160
201
|
loadData: (data: RuleChainData) => void;
|
|
161
202
|
/** 重新加载组件 */
|
|
162
|
-
loadComponents: (components:
|
|
203
|
+
loadComponents: (components: RawComponentData) => void;
|
|
163
204
|
/** 导出数据 */
|
|
164
205
|
exportData: () => RuleChainData | null;
|
|
165
206
|
/** 切换小地图 */
|
|
166
207
|
toggleMiniMap: () => void;
|
|
167
208
|
/** 手动触发自动排版 — 基于 DAG 拓扑排序重新排列节点 */
|
|
168
209
|
autoLayout: () => void;
|
|
210
|
+
/** 打开独立设置弹窗 */
|
|
211
|
+
openSettings: (initialTab?: 'user' | 'setting' | 'ai' | 'skills') => void;
|
|
212
|
+
/** 打开 AI 助手侧栏 */
|
|
213
|
+
openAiAssistant: (options?: AIAssistantOpenOptions) => void;
|
|
214
|
+
/** 关闭 AI 助手侧栏 */
|
|
215
|
+
closeAiAssistant: () => void;
|
|
216
|
+
/** 切换编辑器主题 */
|
|
217
|
+
setTheme: (theme: string) => void;
|
|
169
218
|
}
|
|
170
219
|
/**
|
|
171
220
|
* RuleGoEditor — React 封装组件
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EditorTranslate } from '../i18n';
|
|
3
|
+
import type { LocaleMessages, WorkflowFetcher, WorkflowItem } from '@huanban/rulego-editor-core';
|
|
4
|
+
export interface RuleMaintenancePanelProps {
|
|
5
|
+
workflow: WorkflowItem;
|
|
6
|
+
fetcher: WorkflowFetcher | null;
|
|
7
|
+
content: Record<string, unknown> | null;
|
|
8
|
+
onError?: (error: Error) => void;
|
|
9
|
+
locale?: string;
|
|
10
|
+
messages?: LocaleMessages;
|
|
11
|
+
t?: EditorTranslate;
|
|
12
|
+
}
|
|
13
|
+
export declare const RuleMaintenancePanel: React.FC<RuleMaintenancePanelProps>;
|
|
14
|
+
export default RuleMaintenancePanel;
|
|
15
|
+
//# sourceMappingURL=RuleMaintenancePanel.d.ts.map
|
|
@@ -15,6 +15,8 @@
|
|
|
15
15
|
* - 通过回调 props 处理节点定位
|
|
16
16
|
*/
|
|
17
17
|
import React from 'react';
|
|
18
|
+
import type { LocaleMessages } from '@huanban/rulego-editor-core';
|
|
19
|
+
import type { EditorTranslate } from '../i18n';
|
|
18
20
|
/** 搜索结果项 */
|
|
19
21
|
export interface SearchResultItem {
|
|
20
22
|
/** 节点 ID */
|
|
@@ -38,6 +40,12 @@ export interface SearchPanelProps {
|
|
|
38
40
|
onClose: () => void;
|
|
39
41
|
/** 面板位置 */
|
|
40
42
|
position?: 'top-center' | 'top-right';
|
|
43
|
+
/** Current locale. Defaults to zh-CN. */
|
|
44
|
+
locale?: string;
|
|
45
|
+
/** Extra locale messages merged into the selected locale. */
|
|
46
|
+
messages?: LocaleMessages;
|
|
47
|
+
/** Host-provided translation function. */
|
|
48
|
+
t?: EditorTranslate;
|
|
41
49
|
}
|
|
42
50
|
/**
|
|
43
51
|
* SearchPanel 组件
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface SearchableSelectOption {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface SearchableSelectProps {
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
values?: string[];
|
|
11
|
+
options?: SearchableSelectOption[];
|
|
12
|
+
multiple?: boolean;
|
|
13
|
+
allowCreate?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
placeholder?: string;
|
|
16
|
+
searchPlaceholder?: string;
|
|
17
|
+
noMatchText?: string;
|
|
18
|
+
createOptionText?: string;
|
|
19
|
+
selectedCountText?: string;
|
|
20
|
+
resultCountText?: string;
|
|
21
|
+
moreOptionsText?: string;
|
|
22
|
+
className?: string;
|
|
23
|
+
threshold?: number;
|
|
24
|
+
maxVisibleOptions?: number;
|
|
25
|
+
onChange: (value: string) => void;
|
|
26
|
+
onMultiChange?: (values: string[]) => void;
|
|
27
|
+
}
|
|
28
|
+
export declare const SearchableSelect: React.FC<SearchableSelectProps>;
|
|
29
|
+
//# sourceMappingURL=SearchableSelect.d.ts.map
|
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* @see ValidationPanelProps — 面板参数
|
|
14
14
|
*/
|
|
15
15
|
import React from 'react';
|
|
16
|
+
import type { LocaleMessages } from '@huanban/rulego-editor-core';
|
|
17
|
+
import type { EditorTranslate } from '../i18n';
|
|
16
18
|
/** 验证错误项 */
|
|
17
19
|
export interface ValidationItem {
|
|
18
20
|
/** 规则名称 */
|
|
@@ -46,6 +48,12 @@ export interface ValidationPanelProps {
|
|
|
46
48
|
onClose?: () => void;
|
|
47
49
|
/** 清除验证结果 */
|
|
48
50
|
onClear?: () => void;
|
|
51
|
+
/** Current locale. Defaults to zh-CN. */
|
|
52
|
+
locale?: string;
|
|
53
|
+
/** Extra locale messages merged into the selected locale. */
|
|
54
|
+
messages?: LocaleMessages;
|
|
55
|
+
/** Host-provided translation function. */
|
|
56
|
+
t?: EditorTranslate;
|
|
49
57
|
}
|
|
50
58
|
/**
|
|
51
59
|
* ValidationPanel 组件
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
* @module @huanban/rulego-editor-react
|
|
20
20
|
*/
|
|
21
21
|
import React from 'react';
|
|
22
|
-
import type {
|
|
22
|
+
import type { EditorTranslate } from '../i18n';
|
|
23
|
+
import type { LocaleMessages, WorkflowItem, WorkflowFetcher, WorkflowInfoIcons, WorkflowTheme, RuleChainAPIOptions } from '@huanban/rulego-editor-core';
|
|
23
24
|
/** 自定义 Tab 定义 */
|
|
24
25
|
export interface ExtraTab {
|
|
25
26
|
key: string;
|
|
@@ -52,6 +53,21 @@ export interface WorkflowInfoPanelProps {
|
|
|
52
53
|
onError?: (error: Error) => void;
|
|
53
54
|
/** 请求刷新外部数据 */
|
|
54
55
|
onRefresh?: () => void;
|
|
56
|
+
/** Current locale. Defaults to zh-CN. */
|
|
57
|
+
locale?: string;
|
|
58
|
+
/** Extra locale messages merged into the selected locale. */
|
|
59
|
+
messages?: LocaleMessages;
|
|
60
|
+
/** Host-provided translation function. */
|
|
61
|
+
t?: EditorTranslate;
|
|
55
62
|
}
|
|
63
|
+
export interface WorkflowIntegrationUrls {
|
|
64
|
+
executeUrl: string;
|
|
65
|
+
notifyUrl: string;
|
|
66
|
+
mcpSseUrl: string;
|
|
67
|
+
debugWsUrl: string;
|
|
68
|
+
runtimeWsUrl: string;
|
|
69
|
+
endpointWsHint: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function buildWorkflowIntegrationUrls(apiBase: string | undefined, workflowId: string): WorkflowIntegrationUrls;
|
|
56
72
|
export declare const WorkflowInfoPanel: React.FC<WorkflowInfoPanelProps>;
|
|
57
73
|
//# sourceMappingURL=WorkflowInfoPanel.d.ts.map
|
|
@@ -28,7 +28,8 @@
|
|
|
28
28
|
* @module @huanban/rulego-editor-react
|
|
29
29
|
*/
|
|
30
30
|
import React from 'react';
|
|
31
|
-
import type { WorkflowItem, WorkflowFetcher, WorkflowListIcons, WorkflowTheme, RuleChainAPIOptions } from '@huanban/rulego-editor-core';
|
|
31
|
+
import type { WorkflowItem, WorkflowFetcher, WorkflowListIcons, WorkflowTheme, RuleChainAPIOptions, LocaleMessages } from '@huanban/rulego-editor-core';
|
|
32
|
+
import type { EditorTranslate } from '../i18n';
|
|
32
33
|
/**
|
|
33
34
|
* WorkflowList 组件 Props
|
|
34
35
|
*/
|
|
@@ -55,6 +56,12 @@ export interface WorkflowListProps {
|
|
|
55
56
|
showCreate?: boolean;
|
|
56
57
|
/** 是否显示刷新按钮,默认 true */
|
|
57
58
|
showRefresh?: boolean;
|
|
59
|
+
/** Current locale. Defaults to zh-CN. */
|
|
60
|
+
locale?: string;
|
|
61
|
+
/** Extra locale messages merged into the selected locale. */
|
|
62
|
+
messages?: LocaleMessages;
|
|
63
|
+
/** Host-provided translation function. */
|
|
64
|
+
t?: EditorTranslate;
|
|
58
65
|
/** 替换标题栏区域 */
|
|
59
66
|
renderHeader?: (defaultHeader: React.ReactNode) => React.ReactNode;
|
|
60
67
|
/** 替换每行操作按钮 */
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LocaleMessages } from '@huanban/rulego-editor-core';
|
|
3
|
+
import type { EditorTranslate } from '../../i18n';
|
|
4
|
+
interface Props {
|
|
5
|
+
nodeData: any;
|
|
6
|
+
onUpdate: (properties: any) => void;
|
|
7
|
+
locale?: string;
|
|
8
|
+
messages?: LocaleMessages;
|
|
9
|
+
t?: EditorTranslate;
|
|
10
|
+
}
|
|
11
|
+
export declare const AgentOrchestrationProperties: React.FC<Props>;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=AgentOrchestrationProperties.d.ts.map
|
package/dist/i18n.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LocaleMessages } from '@huanban/rulego-editor-core';
|
|
2
|
+
export type EditorTranslate = (key: string, params?: Record<string, string | number>) => string;
|
|
3
|
+
export interface FrameworkI18nProps {
|
|
4
|
+
/** Current locale. Supports zh-CN/zh_cn/zh and en-US/en_us/en. */
|
|
5
|
+
locale?: string;
|
|
6
|
+
/** Extra messages merged into the selected locale. */
|
|
7
|
+
messages?: LocaleMessages;
|
|
8
|
+
/** Host-provided translation function. It takes priority over built-in messages. */
|
|
9
|
+
t?: EditorTranslate;
|
|
10
|
+
}
|
|
11
|
+
export declare function normalizeFrameworkLocale(locale?: string): 'zh-CN' | 'en-US';
|
|
12
|
+
export declare function createFrameworkTranslator(options?: FrameworkI18nProps): (key: string, fallback?: string, params?: Record<string, string | number>) => string;
|
|
13
|
+
export declare function relationTypeLabel(translate: (key: string, fallback?: string, params?: Record<string, string | number>) => string, value: string): string;
|
|
14
|
+
//# sourceMappingURL=i18n.d.ts.map
|