@huanban/rulego-editor-core 1.3.18 → 1.4.0
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/README.md +153 -2
- package/assets/images/discovery-dark.svg +1 -0
- package/assets/images/discovery.svg +1 -0
- package/assets/images/nacos-dark.svg +1 -0
- package/assets/images/nacos.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/discovery.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos-dark.svg +1 -0
- package/assets/theme-icons/ant-blue/nacos.svg +1 -0
- package/assets/theme-icons/apple/discovery-dark.svg +1 -0
- package/assets/theme-icons/apple/discovery.svg +1 -0
- package/assets/theme-icons/apple/nacos-dark.svg +1 -0
- package/assets/theme-icons/apple/nacos.svg +1 -0
- package/assets/theme-icons/colorful/discovery-dark.svg +1 -0
- package/assets/theme-icons/colorful/discovery.svg +1 -0
- package/assets/theme-icons/colorful/nacos-dark.svg +1 -0
- package/assets/theme-icons/colorful/nacos.svg +1 -0
- package/assets/theme-icons/dark/discovery-dark.svg +1 -0
- package/assets/theme-icons/dark/discovery.svg +1 -0
- package/assets/theme-icons/dark/nacos-dark.svg +1 -0
- package/assets/theme-icons/dark/nacos.svg +1 -0
- package/assets/theme-icons/default/discovery-dark.svg +1 -0
- package/assets/theme-icons/default/discovery.svg +1 -0
- package/assets/theme-icons/default/nacos-dark.svg +1 -0
- package/assets/theme-icons/default/nacos.svg +1 -0
- package/assets/theme-icons/elegant/discovery-dark.svg +1 -0
- package/assets/theme-icons/elegant/discovery.svg +1 -0
- package/assets/theme-icons/elegant/nacos-dark.svg +1 -0
- package/assets/theme-icons/elegant/nacos.svg +1 -0
- package/assets/theme-icons/github/discovery-dark.svg +1 -0
- package/assets/theme-icons/github/discovery.svg +1 -0
- package/assets/theme-icons/github/nacos-dark.svg +1 -0
- package/assets/theme-icons/github/nacos.svg +1 -0
- package/assets/theme-icons/icon-theme-manifest.json +30 -14
- package/assets/theme-icons/icon-theme-overview.svg +1599 -1287
- package/assets/theme-icons/material/discovery-dark.svg +1 -0
- package/assets/theme-icons/material/discovery.svg +1 -0
- package/assets/theme-icons/material/nacos-dark.svg +1 -0
- package/assets/theme-icons/material/nacos.svg +1 -0
- package/assets/theme-icons/modern/discovery-dark.svg +1 -0
- package/assets/theme-icons/modern/discovery.svg +1 -0
- package/assets/theme-icons/modern/nacos-dark.svg +1 -0
- package/assets/theme-icons/modern/nacos.svg +1 -0
- package/assets/theme-icons/nature/discovery-dark.svg +1 -0
- package/assets/theme-icons/nature/discovery.svg +1 -0
- package/assets/theme-icons/nature/nacos-dark.svg +1 -0
- package/assets/theme-icons/nature/nacos.svg +1 -0
- package/assets/theme-icons/tailwind/discovery-dark.svg +1 -0
- package/assets/theme-icons/tailwind/discovery.svg +1 -0
- package/assets/theme-icons/tailwind/nacos-dark.svg +1 -0
- package/assets/theme-icons/tailwind/nacos.svg +1 -0
- package/assets/theme-icons/tech/discovery-dark.svg +1 -0
- package/assets/theme-icons/tech/discovery.svg +1 -0
- package/assets/theme-icons/tech/nacos-dark.svg +1 -0
- package/assets/theme-icons/tech/nacos.svg +1 -0
- package/assets/theme-icons/vscode/discovery-dark.svg +1 -0
- package/assets/theme-icons/vscode/discovery.svg +1 -0
- package/assets/theme-icons/vscode/nacos-dark.svg +1 -0
- package/assets/theme-icons/vscode/nacos.svg +1 -0
- package/dist/ai/copilot-markdown.d.ts +40 -0
- package/dist/ai/copilot-transport.d.ts +39 -0
- package/dist/api/AIManager.d.ts +5 -4
- package/dist/api/ApiProvider.d.ts +17 -69
- package/dist/api/ComponentCatalogCache.d.ts +27 -0
- package/dist/api/DebugSocketClient.d.ts +18 -25
- package/dist/api/RuleChainAPI.d.ts +24 -145
- package/dist/api/StreamParser.d.ts +0 -10
- package/dist/api/index.d.ts +4 -14
- package/dist/api/response-utils.d.ts +4 -22
- package/dist/api/types.d.ts +44 -179
- package/dist/chunks/editor-core-code-editor-CRki2wA_.js +512 -0
- package/dist/chunks/editor-core-default-components-BjF65lar.js +9448 -0
- package/dist/chunks/editor-core-dialogs-CkFLaC8Q.js +17176 -0
- package/dist/chunks/editor-core-icons-BqeFofNA.js +668 -0
- package/dist/chunks/editor-core-json-diff-RHsPeX-w.js +199 -0
- package/dist/chunks/editor-core-locales-i6o28vm2.js +4159 -0
- package/dist/chunks/editor-core-node-patches-BJTT3TuX.js +8060 -0
- package/dist/chunks/editor-core-node-views-BOaPVdmN.js +1288 -0
- package/dist/chunks/editor-core-property-drawers-lLsBIoCa.js +8035 -0
- package/dist/chunks/editor-core-standalone-CHXk3ukc.js +11270 -0
- package/dist/chunks/editor-core-styles-C1TbLgCK.js +8841 -0
- package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +217 -0
- package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +4 -0
- package/dist/chunks/xlsx-BopDBbWb.js +24176 -0
- package/dist/core/ActionRegistry.d.ts +47 -0
- package/dist/core/AutoLayout.d.ts +1 -48
- package/dist/core/ComponentDocService.d.ts +28 -0
- package/dist/core/ComponentRegistry.d.ts +1 -125
- package/dist/core/DataAdapter.d.ts +4 -89
- package/dist/core/DiagnosticService.d.ts +15 -0
- package/dist/core/EditorCore.d.ts +22 -212
- package/dist/core/EditorWorkspace.d.ts +111 -0
- package/dist/core/EventBus.d.ts +0 -86
- package/dist/core/ExplorerTreeStore.d.ts +43 -0
- package/dist/core/FieldCapabilityRegistry.d.ts +16 -0
- package/dist/core/FieldChangeRegistry.d.ts +48 -0
- package/dist/core/HistoryManager.d.ts +0 -123
- package/dist/core/I18nManager.d.ts +0 -120
- package/dist/core/Optimizations.d.ts +0 -14
- package/dist/core/OptionSourceRegistry.d.ts +38 -0
- package/dist/core/RuleChainChatManager.d.ts +0 -37
- package/dist/core/RuleChainValidator.d.ts +0 -79
- package/dist/core/StateStore.d.ts +4 -140
- package/dist/core/ThemeManager.d.ts +0 -141
- package/dist/core/ValidationEngine.d.ts +0 -103
- package/dist/core/component-palette.d.ts +20 -0
- package/dist/core/component-payload.d.ts +0 -9
- package/dist/core/connection-status.d.ts +77 -0
- package/dist/core/context-menu-position.d.ts +27 -0
- package/dist/core/cron-schedule.d.ts +85 -0
- package/dist/core/debug-panel.d.ts +6 -0
- package/dist/core/editor-capabilities.d.ts +95 -0
- package/dist/core/editor-dock.d.ts +100 -0
- package/dist/core/editor-panel.d.ts +68 -0
- package/dist/core/explorer-tree.d.ts +27 -0
- package/dist/core/field-protocol.d.ts +32 -0
- package/dist/core/foundation-tokens.d.ts +38 -0
- package/dist/core/graph-operations.d.ts +34 -0
- package/dist/core/hover-tools.d.ts +26 -0
- package/dist/core/index.d.ts +68 -16
- package/dist/core/infer-run-input.d.ts +11 -0
- package/dist/core/key-value-editor.d.ts +6 -0
- package/dist/core/overlay-layers.d.ts +28 -0
- package/dist/core/recent-components.d.ts +51 -0
- package/dist/core/run-guard.d.ts +7 -0
- package/dist/core/runtime-field-dictionary.d.ts +68 -0
- package/dist/core/runtime-limits.d.ts +0 -5
- package/dist/core/save-conflict.d.ts +4 -0
- package/dist/core/server-status.d.ts +34 -0
- package/dist/core/simple-array.d.ts +4 -0
- package/dist/core/table-protocol.d.ts +36 -0
- package/dist/core/table-spreadsheet.d.ts +3 -0
- package/dist/core/test-cases.d.ts +54 -0
- package/dist/core/toolbar-icons.d.ts +4 -0
- package/dist/core/topology-rules.d.ts +17 -0
- package/dist/core/virtual-window.d.ts +20 -0
- package/dist/core/workspace-tab-actions.d.ts +13 -0
- package/dist/defaults/components.d.ts +0 -9
- package/dist/defaults/index.d.ts +0 -15
- package/dist/defaults/locale-en-US.d.ts +0 -24
- package/dist/defaults/locale-zh-CN.d.ts +0 -39
- package/dist/defaults/official-component-fallbacks.d.ts +0 -8
- package/dist/extensions/ClipboardExtension.d.ts +0 -23
- package/dist/extensions/KeyboardExtension.d.ts +0 -17
- package/dist/extensions/MenuExtension.d.ts +0 -23
- package/dist/iconRegistry.d.ts +0 -22
- package/dist/index.cjs +11320 -0
- package/dist/index.d.ts +25 -47
- package/dist/index.esm.js +1123 -99614
- package/dist/index.umd.js +3380 -1471
- package/dist/models/BaseNodeModel.d.ts +0 -32
- package/dist/models/index.d.ts +0 -1
- package/dist/nodes/AgentOrchestrationNode.d.ts +0 -24
- package/dist/nodes/GroupNode.d.ts +0 -38
- package/dist/nodes/HeadlessHtmlNode.d.ts +0 -16
- package/dist/nodes/SwitchNode.d.ts +0 -22
- package/dist/nodes/UnknownNodeModel.d.ts +0 -19
- package/dist/standalone/HuanbanRulegoEditor.d.ts +202 -401
- package/dist/standalone/ai-model-policy.d.ts +0 -1
- package/dist/standalone/ai-providers.d.ts +0 -1
- package/dist/standalone/auth-fetch.d.ts +2 -46
- package/dist/standalone/browser-assets.d.ts +0 -8
- package/dist/standalone/canvas-view.d.ts +6 -0
- package/dist/standalone/code-editor-language-loaders.d.ts +2 -0
- package/dist/standalone/code-editor-language-loaders.legacy.d.ts +7 -0
- package/dist/standalone/code-editor.d.ts +3 -87
- package/dist/standalone/connection-status-binding.d.ts +8 -0
- package/dist/standalone/custom-nodes.d.ts +0 -26
- package/dist/standalone/drawer-unsaved-guard.d.ts +2 -9
- package/dist/standalone/edge-label-quick-editor.d.ts +2 -0
- package/dist/standalone/editor-actions.d.ts +4 -0
- package/dist/standalone/editor-chain-info.d.ts +5 -38
- package/dist/standalone/editor-context-menu.d.ts +0 -21
- package/dist/standalone/editor-debug-ws.d.ts +37 -145
- package/dist/standalone/editor-delete.d.ts +0 -1
- package/dist/standalone/editor-dialogs.d.ts +16 -66
- package/dist/standalone/editor-events.d.ts +0 -27
- package/dist/standalone/editor-overlays.d.ts +14 -0
- package/dist/standalone/editor-property-drawers.d.ts +13 -71
- package/dist/standalone/editor-route-settings.d.ts +7 -55
- package/dist/standalone/editor-sidebar.d.ts +0 -18
- package/dist/standalone/editor-styles.d.ts +0 -11
- package/dist/standalone/editor-toast.d.ts +1 -2
- package/dist/standalone/editor-toolbar.d.ts +5 -80
- package/dist/standalone/editor-tour.d.ts +7 -0
- package/dist/standalone/editor-trace-overlay.d.ts +0 -5
- package/dist/standalone/full-json-dialog.d.ts +5 -1
- package/dist/standalone/group-node.d.ts +1 -51
- package/dist/standalone/icon-utils.d.ts +0 -20
- package/dist/standalone/index.d.ts +10 -7
- package/dist/standalone/json-diff.d.ts +0 -1
- package/dist/standalone/keyboard-events.d.ts +0 -1
- package/dist/standalone/layout-scheduler.d.ts +0 -6
- package/dist/standalone/lifecycle.d.ts +0 -5
- package/dist/standalone/logger.d.ts +0 -32
- package/dist/standalone/models-dev-catalog.d.ts +0 -1
- package/dist/standalone/node-copy.d.ts +7 -4
- package/dist/standalone/node-definitions.d.ts +0 -63
- package/dist/standalone/node-identity.d.ts +0 -1
- package/dist/standalone/node-theme.d.ts +8 -0
- package/dist/standalone/node-views-data.d.ts +0 -20
- package/dist/standalone/official-node-view-patches.d.ts +1 -14
- package/dist/standalone/outline-style.d.ts +7 -0
- package/dist/standalone/run-history-format.d.ts +0 -1
- package/dist/standalone/security-utils.d.ts +1 -5
- package/dist/standalone/shared-node-manager.d.ts +31 -0
- package/dist/standalone/themes.d.ts +0 -48
- package/dist/tools/tool-editor.d.ts +0 -1
- package/dist/types/component.d.ts +105 -87
- package/dist/types/editor.d.ts +16 -169
- package/dist/types/events.d.ts +30 -107
- package/dist/types/index.d.ts +3 -10
- package/dist/types/rule-chain.d.ts +0 -90
- package/dist/utils/GraphUtils.d.ts +0 -10
- package/dist/utils/helpers.d.ts +0 -80
- package/dist/utils/index.d.ts +0 -5
- package/dist/utils/pinyin-search.d.ts +0 -57
- package/dist/utils/relation-utils.d.ts +0 -1
- package/dist/utils/textUtils.d.ts +0 -12
- package/dist/version.d.ts +2 -3
- package/dist/xlsx-qn1xoUuv.cjs +105 -0
- package/package.json +19 -5
- package/vite-chunks.d.ts +11 -0
- package/vite-chunks.mjs +120 -0
- package/dist/index.cjs.js +0 -9515
|
@@ -42,4 +42,3 @@ export declare function createUnifiedJsonDiff(beforeJson: string, afterJson: str
|
|
|
42
42
|
};
|
|
43
43
|
export declare function createJsonDiffResult(beforeRaw: unknown, afterRaw: unknown): JsonDiffResult;
|
|
44
44
|
export declare function validateRuleChainJsonIntegrity(data: unknown): RuleChainJsonValidationResult;
|
|
45
|
-
//# sourceMappingURL=json-diff.d.ts.map
|
|
@@ -5,12 +5,6 @@ export interface ScheduleEditorResizeOptions {
|
|
|
5
5
|
delayMs?: number;
|
|
6
6
|
args?: any[];
|
|
7
7
|
}
|
|
8
|
-
/**
|
|
9
|
-
* Coalesces LogicFlow resize calls into one animation-frame pass plus an optional
|
|
10
|
-
* delayed pass for CSS transitions. This prevents drawer/settings toggles from
|
|
11
|
-
* issuing several resize calls in the same layout frame.
|
|
12
|
-
*/
|
|
13
8
|
export declare function scheduleEditorResize(target: ResizeTarget | null | undefined, options?: ScheduleEditorResizeOptions): void;
|
|
14
9
|
export declare function cancelScheduledEditorResize(target: ResizeTarget | null | undefined): void;
|
|
15
10
|
export {};
|
|
16
|
-
//# sourceMappingURL=layout-scheduler.d.ts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/lifecycle.ts
|
|
3
|
-
* @description Small cleanup registry for standalone DOM and runtime resources.
|
|
4
|
-
*/
|
|
5
1
|
export type Cleanup = () => void;
|
|
6
2
|
export declare class CleanupBag {
|
|
7
3
|
private cleanups;
|
|
@@ -12,4 +8,3 @@ export declare class CleanupBag {
|
|
|
12
8
|
frame(id: number | null | undefined): void;
|
|
13
9
|
dispose(): void;
|
|
14
10
|
}
|
|
15
|
-
//# sourceMappingURL=lifecycle.d.ts.map
|
|
@@ -1,35 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* logger.ts
|
|
3
|
-
* =========
|
|
4
|
-
* 功能:编辑器统一调试日志工具
|
|
5
|
-
*
|
|
6
|
-
* 提供带模块前缀的日志输出,通过全局开关控制是否输出。
|
|
7
|
-
* 默认关闭,可通过以下方式开启:
|
|
8
|
-
* 1. 编辑器初始化时设置 opts.debug = true
|
|
9
|
-
* 2. 运行时调用 setDebug(true)
|
|
10
|
-
* 3. URL 参数 ?debug=1
|
|
11
|
-
* 4. localStorage 设置 huanban_debug = '1'
|
|
12
|
-
*/
|
|
13
|
-
/**
|
|
14
|
-
* 设置调试模式开关
|
|
15
|
-
* @param enabled - true 开启调试日志, false 关闭
|
|
16
|
-
*/
|
|
17
1
|
export declare function setDebug(enabled: boolean): void;
|
|
18
|
-
/**
|
|
19
|
-
* 获取当前调试模式状态
|
|
20
|
-
* @returns 是否开启调试日志
|
|
21
|
-
*/
|
|
22
2
|
export declare function isDebug(): boolean;
|
|
23
|
-
/**
|
|
24
|
-
* 输出调试日志 — 仅在 debug 模式下输出
|
|
25
|
-
* @param module - 模块名称,会作为前缀 [module]
|
|
26
|
-
* @param args - 日志内容(与 console.log 参数一致)
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* debugLog('custom-nodes', 'simple-node 注册成功')
|
|
31
|
-
* // 输出: [custom-nodes] simple-node 注册成功
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
3
|
export declare function debugLog(module: string, ...args: any[]): void;
|
|
35
|
-
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utilities for cloning LogicFlow nodes while keeping RuleGo model identity valid.
|
|
3
|
-
*/
|
|
4
1
|
export interface CloneNodePropertiesOptions {
|
|
5
2
|
nodeId?: string;
|
|
6
3
|
nodeType?: string;
|
|
@@ -10,6 +7,12 @@ export interface CloneNodePropertiesOptions {
|
|
|
10
7
|
parentGroupId?: string | null;
|
|
11
8
|
preserveParentGroupId?: boolean;
|
|
12
9
|
}
|
|
10
|
+
export declare const CONNECTION_STATUS_RUNTIME_PROPERTY_KEYS: readonly ["connectionState", "connectionMessage", "connectionStale", "connectionLabel", "connectionTooltip", "connectionKind"];
|
|
11
|
+
export declare const NODE_THEME_RUNTIME_PROPERTY_KEY: "__huanbanTheme";
|
|
12
|
+
export declare const NODE_RUNTIME_PROPERTY_KEYS: readonly ["connectionState", "connectionMessage", "connectionStale", "connectionLabel", "connectionTooltip", "connectionKind", "__huanbanTheme"];
|
|
13
|
+
export declare function stripNodeRuntimeProperties<T extends {
|
|
14
|
+
properties?: Record<string, any>;
|
|
15
|
+
}>(data: T): T;
|
|
16
|
+
export declare const stripConnectionStatusRuntimeProperties: typeof stripNodeRuntimeProperties;
|
|
13
17
|
export declare function cloneNodePropertiesForCopy(sourceProperties: Record<string, any> | undefined, options?: CloneNodePropertiesOptions): Record<string, any>;
|
|
14
18
|
export declare function applyNewNodeModelIdentity(lf: any, newNode: any, options?: CloneNodePropertiesOptions): void;
|
|
15
|
-
//# sourceMappingURL=node-copy.d.ts.map
|
|
@@ -1,23 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/node-definitions.ts
|
|
3
|
-
* @description 节点组件的分类配置 + 国际化适配器
|
|
4
|
-
*
|
|
5
|
-
* 【架构说明】
|
|
6
|
-
* - 分类配置 (CATEGORY_CONFIG) — 定义各分类的背景色,用于侧边栏渲染
|
|
7
|
-
* - 分类排序 (CATEGORY_ORDER) — 定义分类在侧边栏 / 管理列表中的显示顺序
|
|
8
|
-
* - 分类路径映射 (CATEGORY_PATH_MAP) — 将 github.com/... 长路径映射到简短分类键
|
|
9
|
-
* - 分类工具函数 (getCategoryKey / getCategoryConfig) — 提取和获取分类信息
|
|
10
|
-
* - 国际化适配器 (adapterComponentsLocal) — 将 fallback 翻译应用到组件上
|
|
11
|
-
*
|
|
12
|
-
* 组件的本地化数据 (DEFAULT_NODE_VIEWS) 已拆分到 node-views-data.ts:
|
|
13
|
-
* - 这些数据是**备用默认值**(源自原版 local_zh.js)
|
|
14
|
-
* - 生产环境中,组件定义应由后端 API 动态返回
|
|
15
|
-
* - 仅在 API 数据缺少 label/desc 时作为 fallback
|
|
16
|
-
*
|
|
17
|
-
* 使用方式:
|
|
18
|
-
* import { CATEGORY_CONFIG, getCategoryKey, getCategoryConfig, adapterComponentsLocal } from './node-definitions'
|
|
19
|
-
* import { DEFAULT_NODE_VIEWS } from './node-views-data' // 需要数据时直接引入
|
|
20
|
-
*/
|
|
21
1
|
import { type AiProviderOption } from './ai-providers';
|
|
22
2
|
export { DEFAULT_NODE_VIEWS } from './node-views-data';
|
|
23
3
|
interface CategoryConfig {
|
|
@@ -25,39 +5,11 @@ interface CategoryConfig {
|
|
|
25
5
|
label?: string;
|
|
26
6
|
nodeType?: string;
|
|
27
7
|
}
|
|
28
|
-
/** 分类颜色映射(label 通过 i18n 动态获取) */
|
|
29
8
|
export declare const CATEGORY_CONFIG: Record<string, CategoryConfig>;
|
|
30
|
-
/**
|
|
31
|
-
* 分类在侧边栏 / 管理列表中的显示顺序
|
|
32
|
-
* 不在此列表中的分类会排到末尾(按字母序)
|
|
33
|
-
*
|
|
34
|
-
* 顺序: 输入端 → 公共 → 过滤器 → 转换器 → 动作
|
|
35
|
-
* → 外部集成 → AI → CI/CD → IoT → 子规则链
|
|
36
|
-
* → 流式计算 → 文件 → 自定义
|
|
37
|
-
*/
|
|
38
9
|
export declare const CATEGORY_ORDER: ReadonlyArray<string>;
|
|
39
|
-
/**
|
|
40
|
-
* 长路径分类映射 — 将 github.com/... 等长路径映射到简短分类名
|
|
41
|
-
* 用于 getCategoryKey() 函数提取分类键
|
|
42
|
-
*/
|
|
43
10
|
export declare const CATEGORY_PATH_MAP: Record<string, string>;
|
|
44
|
-
/**
|
|
45
|
-
* 从原始 category 字符串提取分类键
|
|
46
|
-
* - 普通分类: 'external/file' → 'external'
|
|
47
|
-
* - 长路径: 'github.com/rulego/rulego-components-ai/ai/action' → 'ai'
|
|
48
|
-
* - stats: 'stats/streamsql' → 'stats'
|
|
49
|
-
* - endpoint: 'endpoint/fasthttp' → 'endpoint'
|
|
50
|
-
*
|
|
51
|
-
* @param rawCat - 原始分类字符串
|
|
52
|
-
* @returns 标准化的分类键
|
|
53
|
-
*/
|
|
54
11
|
export declare function getCategoryKey(rawCat: string): string;
|
|
55
12
|
export declare function resolveRuntimeCategoryKey(component: any, isEndpoint?: boolean): string;
|
|
56
|
-
/**
|
|
57
|
-
* 获取分类配置 (未知分类用默认色 #86B4E5FF)
|
|
58
|
-
* @param cat - 分类键
|
|
59
|
-
* @returns 分类配置对象 { bg: 颜色 }
|
|
60
|
-
*/
|
|
61
13
|
export declare function getCategoryConfig(cat: string): CategoryConfig;
|
|
62
14
|
export declare function adapterRelationTypeLabel(relationTypes: any, translate?: (value: string) => string): any;
|
|
63
15
|
export declare function adapterEndpointDefaults(component: any, isEndpoint?: boolean): void;
|
|
@@ -71,22 +23,7 @@ export interface RuntimeComponentAdapterOptions {
|
|
|
71
23
|
defaultBackground?: string;
|
|
72
24
|
}
|
|
73
25
|
export declare function adapterRuntimeComponent(component: any, options?: RuntimeComponentAdapterOptions): string;
|
|
74
|
-
/**
|
|
75
|
-
* 组件国际化适配器
|
|
76
|
-
* 将 fallback 翻译数据应用到组件对象上。
|
|
77
|
-
*
|
|
78
|
-
* 工作流程:
|
|
79
|
-
* 1. 后端 API 返回组件数据(包含 type、fields 等)
|
|
80
|
-
* 2. 本函数检查 DEFAULT_NODE_VIEWS 中是否有对应类型的翻译
|
|
81
|
-
* 3. 如有,则覆盖组件的 label、desc、icon
|
|
82
|
-
* 4. 同时递归处理字段级别的翻译(fields 和嵌套 struct 子字段)
|
|
83
|
-
*
|
|
84
|
-
* @param component - 从 API 获取的组件数据
|
|
85
|
-
* @param customViews - 可选,外部传入的自定义本地化定义,优先于默认值
|
|
86
|
-
* 调用方可传入自己的翻译字典来覆盖内置默认值
|
|
87
|
-
*/
|
|
88
26
|
export declare function adapterComponentsLocal(component: any, customViews?: Record<string, any>, translateRelationType?: (value: string) => string): void;
|
|
89
27
|
export declare function injectProviderField(component: any, providers?: AiProviderOption[]): void;
|
|
90
28
|
export declare function adapterBuiltins(component: any, builtins: any, categoryName?: string): void;
|
|
91
29
|
export declare function adapterRules(component: any): void;
|
|
92
|
-
//# sourceMappingURL=node-definitions.d.ts.map
|
|
@@ -7,4 +7,3 @@ export interface NormalizeEditableNodeModelOptions {
|
|
|
7
7
|
keepNodeId?: boolean;
|
|
8
8
|
}
|
|
9
9
|
export declare function normalizeEditableNodeModel<T extends Record<string, any>>(originalModel: T | null | undefined, submittedPatch: Record<string, any>, options?: NormalizeEditableNodeModelOptions): T;
|
|
10
|
-
//# sourceMappingURL=node-identity.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface LogicFlowNodeTheme {
|
|
2
|
+
id: string;
|
|
3
|
+
isDark: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare function deriveDarkNodeBackground(color: string): string;
|
|
6
|
+
export declare function resolveLogicFlowNodeTheme(lf: any): LogicFlowNodeTheme;
|
|
7
|
+
export declare function resolveLogicFlowNodeBackground(lf: any, color: string): string;
|
|
8
|
+
export declare function refreshLogicFlowNodeTheme(lf: any, themeName: string): void;
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/node-views-data.ts
|
|
3
|
-
* @description 节点组件本地化默认值 — 纯数据字典
|
|
4
|
-
*
|
|
5
|
-
* 【重要说明】
|
|
6
|
-
* 这些数据是**备用默认值**,主要用于:
|
|
7
|
-
* 1. API 未返回组件 label/desc 时的 fallback 显示
|
|
8
|
-
* 2. 离线模式下的基本功能支持
|
|
9
|
-
* 3. 开发调试时的快速预览
|
|
10
|
-
*
|
|
11
|
-
* 生产环境中,组件定义应由后端 API 动态返回,
|
|
12
|
-
* 编辑器会优先使用 API 数据,仅在缺失时回退到本文件中的定义。
|
|
13
|
-
*
|
|
14
|
-
* 按分类拆分为多个子对象,最终合并导出为 DEFAULT_NODE_VIEWS。
|
|
15
|
-
*/
|
|
16
|
-
/**
|
|
17
|
-
* 组件本地化默认值 — 合并所有分类的数据
|
|
18
|
-
* 按分类拆分后通过展开运算符合并
|
|
19
|
-
*/
|
|
20
1
|
export declare const DEFAULT_NODE_VIEWS: Record<string, any>;
|
|
21
|
-
//# sourceMappingURL=node-views-data.d.ts.map
|
|
@@ -1,15 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* @file official-node-view-patches.ts
|
|
3
|
-
* @description 官方 RuleGo editor zh i18n 节点渲染协议补丁。
|
|
4
|
-
*
|
|
5
|
-
* 生成来源:
|
|
6
|
-
* - 参考项目代码/rulego-editor-20260627/src/components/i18n/zh/index.js
|
|
7
|
-
* - 参考项目代码/rulego-editor-20260627/src/components/i18n/zh/endpoint.js
|
|
8
|
-
* - 参考项目代码/rulego-editor-20260627/src/components/i18n/zh/extend.js
|
|
9
|
-
* - 参考项目代码/rulego-editor-20260627/src/components/i18n/zh/ai.js
|
|
10
|
-
*
|
|
11
|
-
* 注意: 原官方 loadData 函数被归一化为 component.source,用于 standalone 渲染器
|
|
12
|
-
* 在运行时从当前画布或规则链列表补齐 options。
|
|
13
|
-
*/
|
|
1
|
+
export declare const IOT_PROTOCOL_VIEW_TYPES: readonly ["endpoint/hj212", "endpoint/modbusServer", "endpoint/snmp", "ws", "x/control/timer", "x/control/watchdog", "x/dlt645Read", "x/dlt645Write", "x/eipRead", "x/eipWrite", "x/iec104Read", "x/iec104Write", "x/influxdbQuery", "x/influxdbWrite", "x/iotRead", "x/iotWrite", "x/mcRead", "x/mcWrite", "x/modbusRead", "x/modbusWrite", "x/promremoteWrite", "x/s7Read", "x/s7Write", "x/snmpRead", "x/snmpWrite", "x/tdengineQuery", "x/tdengineWrite", "x/timescaledbQuery", "x/timescaledbWrite", "x/tsdbQuery", "x/tsdbWrite"];
|
|
14
2
|
export declare const OFFICIAL_NODE_VIEW_PATCHES: Record<string, any>;
|
|
15
|
-
//# sourceMappingURL=official-node-view-patches.d.ts.map
|
|
@@ -19,4 +19,3 @@ export declare function formatRunHistoryMessageForDetail(msg: any): string;
|
|
|
19
19
|
export declare function formatRunHistoryMessageJsonFull(msg: any): string;
|
|
20
20
|
export declare function formatRunHistoryRecordJson(item: RunHistoryRecord, maxChars?: 20000): string;
|
|
21
21
|
export declare function formatRunHistoryRecordJsonFull(item: RunHistoryRecord): string;
|
|
22
|
-
//# sourceMappingURL=run-history-format.d.ts.map
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/security-utils.ts
|
|
3
|
-
* @description Browser-side safety helpers for text, URLs, bounded JSON, and redaction.
|
|
4
|
-
*/
|
|
5
1
|
export type RichHtmlPolicy = {
|
|
6
2
|
allowRichDescription?: boolean;
|
|
7
3
|
allowedLinkOrigins?: string[];
|
|
@@ -41,7 +37,7 @@ export declare function safeImageUrl(value: unknown, opts?: {
|
|
|
41
37
|
export declare function safeCssColor(value: unknown, fallback?: string): string;
|
|
42
38
|
export declare function sanitizeDescription(value: unknown, policy?: RichHtmlPolicy): string;
|
|
43
39
|
export declare function sanitizeRichHtml(value: unknown, policy?: RichHtmlPolicy): string;
|
|
40
|
+
export declare function sanitizeHtmlPreviewDocument(value: unknown): string;
|
|
44
41
|
export declare function redactSensitive<T>(value: T, opts?: RedactOptions): T;
|
|
45
42
|
export declare function formatJsonBounded(value: unknown, opts?: FormatJsonBoundedOptions): string;
|
|
46
43
|
export declare function parseJsonBounded<T = unknown>(raw: string, opts?: ParseJsonBoundedOptions): T;
|
|
47
|
-
//# sourceMappingURL=security-utils.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ConnectionStatusStore } from '../core/connection-status';
|
|
2
|
+
export interface SharedNodeManagerContext {
|
|
3
|
+
opts: {
|
|
4
|
+
apiBase?: string;
|
|
5
|
+
fetchTimeout?: number;
|
|
6
|
+
fetchHeaders?: Record<string, string> | (() => Record<string, string>);
|
|
7
|
+
customFetch?: (url: string, init?: RequestInit) => Promise<Response>;
|
|
8
|
+
onApiAuthRequired?: (details: {
|
|
9
|
+
status: 401 | 403;
|
|
10
|
+
url: string;
|
|
11
|
+
}) => void;
|
|
12
|
+
};
|
|
13
|
+
components?: unknown[];
|
|
14
|
+
_nodeComponents?: Record<string, unknown>;
|
|
15
|
+
connectionStatus?: Pick<ConnectionStatusStore, 'getState' | 'subscribe'>;
|
|
16
|
+
serverStatus?: import('../core/server-status').ServerStatusStore;
|
|
17
|
+
t(key: string, params?: Record<string, string>): string;
|
|
18
|
+
acquireSharedConnectionStatuses?(): () => void;
|
|
19
|
+
reloadComponents?(options?: {
|
|
20
|
+
forceRefresh?: boolean;
|
|
21
|
+
}): Promise<boolean>;
|
|
22
|
+
_activeDrawerWrapper?: HTMLElement | null;
|
|
23
|
+
}
|
|
24
|
+
export interface SharedNodeManager {
|
|
25
|
+
activate(): void;
|
|
26
|
+
deactivate(): void;
|
|
27
|
+
destroy(): void;
|
|
28
|
+
isDirty(): boolean;
|
|
29
|
+
requestClose(): Promise<boolean>;
|
|
30
|
+
}
|
|
31
|
+
export declare function createSharedNodeManager(ctx: SharedNodeManagerContext, root: HTMLElement): SharedNodeManager;
|
|
@@ -1,60 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file standalone/themes.ts
|
|
3
|
-
* @description 编辑器主题定义 — 通过 CSS 自定义属性实现多风格切换
|
|
4
|
-
*
|
|
5
|
-
* 每个主题定义一组 CSS 变量值,覆盖编辑器的颜色、圆角、阴影等视觉属性。
|
|
6
|
-
* 通过在根元素上设置 data-theme="xxx" 来切换主题。
|
|
7
|
-
*
|
|
8
|
-
* 支持的主题:
|
|
9
|
-
* - default: 默认亮色(经典蓝白)
|
|
10
|
-
* - dark: 暗夜模式(深色背景,高对比度)
|
|
11
|
-
* - nature: 自然绿(温暖舒适)
|
|
12
|
-
* - elegant: 优雅紫(精致优雅)
|
|
13
|
-
* - tech: 科技蓝(未来感)
|
|
14
|
-
* - modern/colorful/ant-blue/material/tailwind/github/vscode/apple: 常用产品化配色风格
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { THEME_PRESETS, getThemeCSS } from './themes'
|
|
19
|
-
*
|
|
20
|
-
* // 获取所有主题的 CSS 变量定义
|
|
21
|
-
* const css = getThemeCSS()
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
/** 单个主题的变量定义 */
|
|
25
1
|
export interface ThemeVars {
|
|
26
|
-
/** 主题显示名称(中文) */
|
|
27
2
|
label: string;
|
|
28
|
-
/** 主题显示名称(英文) */
|
|
29
3
|
labelEn: string;
|
|
30
|
-
/** CSS 自定义属性键值对 */
|
|
31
4
|
vars: Record<string, string>;
|
|
32
5
|
}
|
|
33
|
-
/**
|
|
34
|
-
* 预设主题集合
|
|
35
|
-
* key 为主题标识,对应 data-theme 属性值
|
|
36
|
-
*/
|
|
37
6
|
export declare const THEME_PRESETS: Record<string, ThemeVars>;
|
|
38
|
-
/**
|
|
39
|
-
* 规范化编辑器主题标识。
|
|
40
|
-
* 保留历史集成里常见的 light、blue 写法,同时避免无效主题写入 data-theme。
|
|
41
|
-
*/
|
|
42
7
|
export declare function normalizeEditorTheme(theme?: string | null): string;
|
|
43
|
-
/**
|
|
44
|
-
* 生成所有主题的 CSS 变量定义字符串
|
|
45
|
-
* 使用 [data-theme="xxx"] 选择器区分不同主题
|
|
46
|
-
* 默认主题同时作为 :root 级别的 fallback
|
|
47
|
-
*
|
|
48
|
-
* @returns 完整的 CSS 变量定义文本
|
|
49
|
-
*/
|
|
50
8
|
export declare function getThemeCSS(): string;
|
|
51
|
-
/**
|
|
52
|
-
* 获取主题列表(用于 UI 展示)
|
|
53
|
-
* @param locale 当前语言
|
|
54
|
-
* @returns 主题选项数组
|
|
55
|
-
*/
|
|
56
9
|
export declare function getThemeList(locale: string): Array<{
|
|
57
10
|
id: string;
|
|
58
11
|
label: string;
|
|
59
12
|
}>;
|
|
60
|
-
//# sourceMappingURL=themes.d.ts.map
|
|
@@ -46,4 +46,3 @@ export declare function normalizeBuiltinToolOption(item: unknown): BuiltinToolOp
|
|
|
46
46
|
export declare function extractBuiltinToolOptionsFromPayload(payload: unknown): BuiltinToolOption[];
|
|
47
47
|
export declare function getBuiltinToolOptionsFromSources(...sources: unknown[]): BuiltinToolOption[];
|
|
48
48
|
export declare function getSkillPathFromSources(...sources: unknown[]): string;
|
|
49
|
-
//# sourceMappingURL=tool-editor.d.ts.map
|
|
@@ -1,112 +1,135 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file component.ts
|
|
3
|
-
* @description 组件定义类型 - 描述编辑器中可使用的节点组件
|
|
4
|
-
*
|
|
5
|
-
* 组件定义包含组件的类型、分类、表单字段、关系类型等信息。
|
|
6
|
-
* 这些定义来源于后端 API (/api/v1/components) 或内置的默认配置。
|
|
7
|
-
*
|
|
8
|
-
* 组件通过 ComponentRegistry 注册到编辑器中,
|
|
9
|
-
* 在侧边栏中按分类分组展示,用户可以拖拽到画布上创建节点。
|
|
10
|
-
*/
|
|
11
|
-
/**
|
|
12
|
-
* 字段验证规则
|
|
13
|
-
*/
|
|
14
1
|
export interface FieldValidation {
|
|
15
|
-
/** 是否必填 */
|
|
16
2
|
required?: boolean;
|
|
17
|
-
/** 字符串最小长度 */
|
|
18
3
|
minLength?: number;
|
|
19
|
-
/** 字符串最大长度 */
|
|
20
4
|
maxLength?: number;
|
|
21
|
-
/** 正则表达式验证 */
|
|
22
5
|
pattern?: string;
|
|
23
|
-
|
|
6
|
+
noTemplateVariables?: boolean;
|
|
24
7
|
message?: string;
|
|
25
8
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
9
|
+
export type FieldDependencyOperator = 'notEmpty' | 'empty' | 'eq' | 'ne' | 'in' | 'prefix';
|
|
10
|
+
export interface FieldDependency {
|
|
11
|
+
field: string;
|
|
12
|
+
operator: FieldDependencyOperator;
|
|
13
|
+
value?: unknown;
|
|
14
|
+
}
|
|
15
|
+
export interface FieldAttachment {
|
|
16
|
+
field?: string;
|
|
17
|
+
target?: string;
|
|
18
|
+
mode?: 'drawer' | 'popover';
|
|
19
|
+
}
|
|
20
|
+
export interface FieldOptionsSource {
|
|
32
21
|
name: string;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
params?: Record<string, unknown>;
|
|
23
|
+
watch?: string[];
|
|
24
|
+
includeGraphNodes?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export interface AiProviderCapability {
|
|
27
|
+
kind?: 'chat' | 'embedding';
|
|
28
|
+
providerField?: string;
|
|
29
|
+
urlField?: string;
|
|
30
|
+
modelField?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ComponentFieldControl {
|
|
33
|
+
type?: string;
|
|
34
|
+
caseType?: string;
|
|
35
|
+
source?: string;
|
|
36
|
+
onChange?: string;
|
|
37
|
+
options?: ComponentFieldControlOption[];
|
|
38
|
+
multiple?: boolean;
|
|
39
|
+
filterable?: boolean;
|
|
40
|
+
allowCreate?: boolean;
|
|
41
|
+
clearable?: boolean;
|
|
42
|
+
placeholder?: string;
|
|
43
|
+
disabled?: boolean;
|
|
44
|
+
rows?: number;
|
|
45
|
+
[key: string]: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface ComponentFieldOption {
|
|
38
48
|
label: string;
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
49
|
+
value: unknown;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
[key: string]: unknown;
|
|
52
|
+
}
|
|
53
|
+
export type ComponentFieldControlOption = ComponentFieldOption | ComponentField;
|
|
54
|
+
export declare function isComponentFieldOption(value: ComponentFieldControlOption): value is ComponentFieldOption;
|
|
55
|
+
export interface ComponentFieldGroup {
|
|
56
|
+
id: string;
|
|
57
|
+
label?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
fields?: string[];
|
|
60
|
+
collapsed?: boolean;
|
|
61
|
+
order?: number;
|
|
62
|
+
[key: string]: unknown;
|
|
63
|
+
}
|
|
64
|
+
export type DynamicFieldReference = string | ComponentField[] | {
|
|
65
|
+
type?: string;
|
|
66
|
+
fields?: ComponentField[];
|
|
67
|
+
[key: string]: unknown;
|
|
68
|
+
};
|
|
69
|
+
export interface DynamicFieldsDefinition {
|
|
70
|
+
by: string;
|
|
71
|
+
refs: Record<string, DynamicFieldReference>;
|
|
72
|
+
preserveInactive?: boolean;
|
|
73
|
+
}
|
|
74
|
+
export interface ComponentField {
|
|
75
|
+
name: string;
|
|
76
|
+
type?: string;
|
|
77
|
+
defaultValue?: unknown;
|
|
78
|
+
label?: string;
|
|
79
|
+
desc?: string;
|
|
80
|
+
validate?: string | FieldValidation;
|
|
81
|
+
fields?: ComponentField[] | null;
|
|
82
|
+
component?: ComponentFieldControl;
|
|
83
|
+
options?: ComponentFieldControlOption[];
|
|
84
|
+
rules?: unknown[];
|
|
85
|
+
ref?: 'primary' | 'shared' | string;
|
|
86
|
+
tableColumn?: boolean;
|
|
87
|
+
addrPrefix?: string;
|
|
88
|
+
providerType?: 'chat' | 'embedding' | string;
|
|
89
|
+
aiProvider?: AiProviderCapability;
|
|
90
|
+
dependsOn?: FieldDependency | FieldDependency[];
|
|
91
|
+
attachTo?: string | FieldAttachment;
|
|
92
|
+
optionsSource?: string | FieldOptionsSource;
|
|
93
|
+
capabilities?: Record<string, unknown>;
|
|
94
|
+
disabled?: boolean;
|
|
95
|
+
omitEmpty?: boolean;
|
|
96
|
+
[key: string]: unknown;
|
|
50
97
|
}
|
|
51
|
-
/**
|
|
52
|
-
* 组件分类常量
|
|
53
|
-
*/
|
|
54
98
|
export type ComponentCategory = 'filter' | 'transform' | 'action' | 'external' | 'flow' | string;
|
|
55
|
-
/**
|
|
56
|
-
* 单个组件的完整定义
|
|
57
|
-
* 描述一个可在编辑器中使用的节点类型
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```json
|
|
61
|
-
* {
|
|
62
|
-
* "type": "jsFilter",
|
|
63
|
-
* "category": "filter",
|
|
64
|
-
* "label": "JS过滤器",
|
|
65
|
-
* "desc": "使用 JavaScript 过滤消息",
|
|
66
|
-
* "icon": "filter-icon",
|
|
67
|
-
* "fields": [...],
|
|
68
|
-
* "relationTypes": ["True", "False", "Failure"]
|
|
69
|
-
* }
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
99
|
export interface ComponentDefinition {
|
|
73
|
-
/** 组件类型标识 (唯一, 如 jsFilter, restApiCall) */
|
|
74
100
|
type: string;
|
|
75
|
-
/** 所属分类 */
|
|
76
101
|
category: ComponentCategory;
|
|
77
|
-
|
|
102
|
+
categoryPath?: string;
|
|
103
|
+
subgroup?: string;
|
|
104
|
+
categorySubgroups?: Array<Record<string, unknown>>;
|
|
78
105
|
label: string;
|
|
79
|
-
/** 组件描述 */
|
|
80
106
|
desc: string;
|
|
81
|
-
/** 图标名称或路径 */
|
|
82
107
|
icon: string;
|
|
83
|
-
/** 表单字段列表 */
|
|
84
108
|
fields: ComponentField[] | null;
|
|
85
|
-
|
|
109
|
+
groups?: ComponentFieldGroup[];
|
|
110
|
+
dynamicFields?: DynamicFieldsDefinition;
|
|
111
|
+
capabilities?: Record<string, unknown>;
|
|
86
112
|
relationTypes: string[];
|
|
87
|
-
/** 组件颜色 (可选, 用于自定义节点颜色) */
|
|
88
113
|
color?: string;
|
|
114
|
+
nodeType?: string;
|
|
115
|
+
order?: number;
|
|
116
|
+
disabled?: boolean;
|
|
117
|
+
[key: string]: unknown;
|
|
89
118
|
}
|
|
90
|
-
/**
|
|
91
|
-
* 组件分组
|
|
92
|
-
* 按分类组织的组件集合,用于侧边栏展示
|
|
93
|
-
*/
|
|
94
119
|
export interface ComponentGroup {
|
|
95
|
-
/** 分类标识 */
|
|
96
120
|
category: string;
|
|
97
|
-
/** 分类显示名称 */
|
|
98
121
|
label: string;
|
|
99
|
-
/** 分类颜色 */
|
|
100
122
|
color: string;
|
|
101
|
-
/** 分类图标 */
|
|
102
123
|
icon?: string;
|
|
103
|
-
/** 该分类下的组件列表 */
|
|
104
124
|
components: ComponentDefinition[];
|
|
125
|
+
subgroups?: Array<{
|
|
126
|
+
id: string;
|
|
127
|
+
label?: string;
|
|
128
|
+
description?: string;
|
|
129
|
+
order?: number;
|
|
130
|
+
components: ComponentDefinition[];
|
|
131
|
+
}>;
|
|
105
132
|
}
|
|
106
|
-
/**
|
|
107
|
-
* 从后端 API 返回的原始组件数据
|
|
108
|
-
* 可能需要经过 adapterComponents 转换后才能使用
|
|
109
|
-
*/
|
|
110
133
|
export interface RawComponentPayloadSections {
|
|
111
134
|
endpoints?: ComponentDefinition[];
|
|
112
135
|
nodes?: ComponentDefinition[];
|
|
@@ -117,13 +140,8 @@ export interface RawComponentPayloadSections {
|
|
|
117
140
|
[key: string]: unknown;
|
|
118
141
|
}
|
|
119
142
|
export type RawComponentData = ComponentDefinition[] | RawComponentPayloadSections;
|
|
120
|
-
/**
|
|
121
|
-
* 组件注册表选项
|
|
122
|
-
*/
|
|
123
143
|
export interface ComponentRegistryOptions {
|
|
124
|
-
/** 初始组件列表 */
|
|
125
144
|
components?: ComponentDefinition[];
|
|
126
|
-
/** 自定义组件适配器 (将后端数据转为标准格式) */
|
|
127
145
|
adapter?: (data: RawComponentData) => ComponentGroup[];
|
|
146
|
+
transform?: (definition: ComponentDefinition) => ComponentDefinition;
|
|
128
147
|
}
|
|
129
|
-
//# sourceMappingURL=component.d.ts.map
|