@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.
Files changed (225) hide show
  1. package/README.md +153 -2
  2. package/assets/images/discovery-dark.svg +1 -0
  3. package/assets/images/discovery.svg +1 -0
  4. package/assets/images/nacos-dark.svg +1 -0
  5. package/assets/images/nacos.svg +1 -0
  6. package/assets/theme-icons/ant-blue/discovery-dark.svg +1 -0
  7. package/assets/theme-icons/ant-blue/discovery.svg +1 -0
  8. package/assets/theme-icons/ant-blue/nacos-dark.svg +1 -0
  9. package/assets/theme-icons/ant-blue/nacos.svg +1 -0
  10. package/assets/theme-icons/apple/discovery-dark.svg +1 -0
  11. package/assets/theme-icons/apple/discovery.svg +1 -0
  12. package/assets/theme-icons/apple/nacos-dark.svg +1 -0
  13. package/assets/theme-icons/apple/nacos.svg +1 -0
  14. package/assets/theme-icons/colorful/discovery-dark.svg +1 -0
  15. package/assets/theme-icons/colorful/discovery.svg +1 -0
  16. package/assets/theme-icons/colorful/nacos-dark.svg +1 -0
  17. package/assets/theme-icons/colorful/nacos.svg +1 -0
  18. package/assets/theme-icons/dark/discovery-dark.svg +1 -0
  19. package/assets/theme-icons/dark/discovery.svg +1 -0
  20. package/assets/theme-icons/dark/nacos-dark.svg +1 -0
  21. package/assets/theme-icons/dark/nacos.svg +1 -0
  22. package/assets/theme-icons/default/discovery-dark.svg +1 -0
  23. package/assets/theme-icons/default/discovery.svg +1 -0
  24. package/assets/theme-icons/default/nacos-dark.svg +1 -0
  25. package/assets/theme-icons/default/nacos.svg +1 -0
  26. package/assets/theme-icons/elegant/discovery-dark.svg +1 -0
  27. package/assets/theme-icons/elegant/discovery.svg +1 -0
  28. package/assets/theme-icons/elegant/nacos-dark.svg +1 -0
  29. package/assets/theme-icons/elegant/nacos.svg +1 -0
  30. package/assets/theme-icons/github/discovery-dark.svg +1 -0
  31. package/assets/theme-icons/github/discovery.svg +1 -0
  32. package/assets/theme-icons/github/nacos-dark.svg +1 -0
  33. package/assets/theme-icons/github/nacos.svg +1 -0
  34. package/assets/theme-icons/icon-theme-manifest.json +30 -14
  35. package/assets/theme-icons/icon-theme-overview.svg +1599 -1287
  36. package/assets/theme-icons/material/discovery-dark.svg +1 -0
  37. package/assets/theme-icons/material/discovery.svg +1 -0
  38. package/assets/theme-icons/material/nacos-dark.svg +1 -0
  39. package/assets/theme-icons/material/nacos.svg +1 -0
  40. package/assets/theme-icons/modern/discovery-dark.svg +1 -0
  41. package/assets/theme-icons/modern/discovery.svg +1 -0
  42. package/assets/theme-icons/modern/nacos-dark.svg +1 -0
  43. package/assets/theme-icons/modern/nacos.svg +1 -0
  44. package/assets/theme-icons/nature/discovery-dark.svg +1 -0
  45. package/assets/theme-icons/nature/discovery.svg +1 -0
  46. package/assets/theme-icons/nature/nacos-dark.svg +1 -0
  47. package/assets/theme-icons/nature/nacos.svg +1 -0
  48. package/assets/theme-icons/tailwind/discovery-dark.svg +1 -0
  49. package/assets/theme-icons/tailwind/discovery.svg +1 -0
  50. package/assets/theme-icons/tailwind/nacos-dark.svg +1 -0
  51. package/assets/theme-icons/tailwind/nacos.svg +1 -0
  52. package/assets/theme-icons/tech/discovery-dark.svg +1 -0
  53. package/assets/theme-icons/tech/discovery.svg +1 -0
  54. package/assets/theme-icons/tech/nacos-dark.svg +1 -0
  55. package/assets/theme-icons/tech/nacos.svg +1 -0
  56. package/assets/theme-icons/vscode/discovery-dark.svg +1 -0
  57. package/assets/theme-icons/vscode/discovery.svg +1 -0
  58. package/assets/theme-icons/vscode/nacos-dark.svg +1 -0
  59. package/assets/theme-icons/vscode/nacos.svg +1 -0
  60. package/dist/ai/copilot-markdown.d.ts +40 -0
  61. package/dist/ai/copilot-transport.d.ts +39 -0
  62. package/dist/api/AIManager.d.ts +5 -4
  63. package/dist/api/ApiProvider.d.ts +17 -69
  64. package/dist/api/ComponentCatalogCache.d.ts +27 -0
  65. package/dist/api/DebugSocketClient.d.ts +18 -25
  66. package/dist/api/RuleChainAPI.d.ts +24 -145
  67. package/dist/api/StreamParser.d.ts +0 -10
  68. package/dist/api/index.d.ts +4 -14
  69. package/dist/api/response-utils.d.ts +4 -22
  70. package/dist/api/types.d.ts +44 -179
  71. package/dist/chunks/editor-core-code-editor-CRki2wA_.js +512 -0
  72. package/dist/chunks/editor-core-default-components-BjF65lar.js +9448 -0
  73. package/dist/chunks/editor-core-dialogs-CkFLaC8Q.js +17176 -0
  74. package/dist/chunks/editor-core-icons-BqeFofNA.js +668 -0
  75. package/dist/chunks/editor-core-json-diff-RHsPeX-w.js +199 -0
  76. package/dist/chunks/editor-core-locales-i6o28vm2.js +4159 -0
  77. package/dist/chunks/editor-core-node-patches-BJTT3TuX.js +8060 -0
  78. package/dist/chunks/editor-core-node-views-BOaPVdmN.js +1288 -0
  79. package/dist/chunks/editor-core-property-drawers-lLsBIoCa.js +8035 -0
  80. package/dist/chunks/editor-core-standalone-CHXk3ukc.js +11270 -0
  81. package/dist/chunks/editor-core-styles-C1TbLgCK.js +8841 -0
  82. package/dist/chunks/vendor-logicflow-core-runtime-Cp6IBEjB.js +217 -0
  83. package/dist/chunks/vendor-logicflow-shared-C7YynLDn.js +4 -0
  84. package/dist/chunks/xlsx-BopDBbWb.js +24176 -0
  85. package/dist/core/ActionRegistry.d.ts +47 -0
  86. package/dist/core/AutoLayout.d.ts +1 -48
  87. package/dist/core/ComponentDocService.d.ts +28 -0
  88. package/dist/core/ComponentRegistry.d.ts +1 -125
  89. package/dist/core/DataAdapter.d.ts +4 -89
  90. package/dist/core/DiagnosticService.d.ts +15 -0
  91. package/dist/core/EditorCore.d.ts +22 -212
  92. package/dist/core/EditorWorkspace.d.ts +111 -0
  93. package/dist/core/EventBus.d.ts +0 -86
  94. package/dist/core/ExplorerTreeStore.d.ts +43 -0
  95. package/dist/core/FieldCapabilityRegistry.d.ts +16 -0
  96. package/dist/core/FieldChangeRegistry.d.ts +48 -0
  97. package/dist/core/HistoryManager.d.ts +0 -123
  98. package/dist/core/I18nManager.d.ts +0 -120
  99. package/dist/core/Optimizations.d.ts +0 -14
  100. package/dist/core/OptionSourceRegistry.d.ts +38 -0
  101. package/dist/core/RuleChainChatManager.d.ts +0 -37
  102. package/dist/core/RuleChainValidator.d.ts +0 -79
  103. package/dist/core/StateStore.d.ts +4 -140
  104. package/dist/core/ThemeManager.d.ts +0 -141
  105. package/dist/core/ValidationEngine.d.ts +0 -103
  106. package/dist/core/component-palette.d.ts +20 -0
  107. package/dist/core/component-payload.d.ts +0 -9
  108. package/dist/core/connection-status.d.ts +77 -0
  109. package/dist/core/context-menu-position.d.ts +27 -0
  110. package/dist/core/cron-schedule.d.ts +85 -0
  111. package/dist/core/debug-panel.d.ts +6 -0
  112. package/dist/core/editor-capabilities.d.ts +95 -0
  113. package/dist/core/editor-dock.d.ts +100 -0
  114. package/dist/core/editor-panel.d.ts +68 -0
  115. package/dist/core/explorer-tree.d.ts +27 -0
  116. package/dist/core/field-protocol.d.ts +32 -0
  117. package/dist/core/foundation-tokens.d.ts +38 -0
  118. package/dist/core/graph-operations.d.ts +34 -0
  119. package/dist/core/hover-tools.d.ts +26 -0
  120. package/dist/core/index.d.ts +68 -16
  121. package/dist/core/infer-run-input.d.ts +11 -0
  122. package/dist/core/key-value-editor.d.ts +6 -0
  123. package/dist/core/overlay-layers.d.ts +28 -0
  124. package/dist/core/recent-components.d.ts +51 -0
  125. package/dist/core/run-guard.d.ts +7 -0
  126. package/dist/core/runtime-field-dictionary.d.ts +68 -0
  127. package/dist/core/runtime-limits.d.ts +0 -5
  128. package/dist/core/save-conflict.d.ts +4 -0
  129. package/dist/core/server-status.d.ts +34 -0
  130. package/dist/core/simple-array.d.ts +4 -0
  131. package/dist/core/table-protocol.d.ts +36 -0
  132. package/dist/core/table-spreadsheet.d.ts +3 -0
  133. package/dist/core/test-cases.d.ts +54 -0
  134. package/dist/core/toolbar-icons.d.ts +4 -0
  135. package/dist/core/topology-rules.d.ts +17 -0
  136. package/dist/core/virtual-window.d.ts +20 -0
  137. package/dist/core/workspace-tab-actions.d.ts +13 -0
  138. package/dist/defaults/components.d.ts +0 -9
  139. package/dist/defaults/index.d.ts +0 -15
  140. package/dist/defaults/locale-en-US.d.ts +0 -24
  141. package/dist/defaults/locale-zh-CN.d.ts +0 -39
  142. package/dist/defaults/official-component-fallbacks.d.ts +0 -8
  143. package/dist/extensions/ClipboardExtension.d.ts +0 -23
  144. package/dist/extensions/KeyboardExtension.d.ts +0 -17
  145. package/dist/extensions/MenuExtension.d.ts +0 -23
  146. package/dist/iconRegistry.d.ts +0 -22
  147. package/dist/index.cjs +11320 -0
  148. package/dist/index.d.ts +25 -47
  149. package/dist/index.esm.js +1123 -99614
  150. package/dist/index.umd.js +3380 -1471
  151. package/dist/models/BaseNodeModel.d.ts +0 -32
  152. package/dist/models/index.d.ts +0 -1
  153. package/dist/nodes/AgentOrchestrationNode.d.ts +0 -24
  154. package/dist/nodes/GroupNode.d.ts +0 -38
  155. package/dist/nodes/HeadlessHtmlNode.d.ts +0 -16
  156. package/dist/nodes/SwitchNode.d.ts +0 -22
  157. package/dist/nodes/UnknownNodeModel.d.ts +0 -19
  158. package/dist/standalone/HuanbanRulegoEditor.d.ts +202 -401
  159. package/dist/standalone/ai-model-policy.d.ts +0 -1
  160. package/dist/standalone/ai-providers.d.ts +0 -1
  161. package/dist/standalone/auth-fetch.d.ts +2 -46
  162. package/dist/standalone/browser-assets.d.ts +0 -8
  163. package/dist/standalone/canvas-view.d.ts +6 -0
  164. package/dist/standalone/code-editor-language-loaders.d.ts +2 -0
  165. package/dist/standalone/code-editor-language-loaders.legacy.d.ts +7 -0
  166. package/dist/standalone/code-editor.d.ts +3 -87
  167. package/dist/standalone/connection-status-binding.d.ts +8 -0
  168. package/dist/standalone/custom-nodes.d.ts +0 -26
  169. package/dist/standalone/drawer-unsaved-guard.d.ts +2 -9
  170. package/dist/standalone/edge-label-quick-editor.d.ts +2 -0
  171. package/dist/standalone/editor-actions.d.ts +4 -0
  172. package/dist/standalone/editor-chain-info.d.ts +5 -38
  173. package/dist/standalone/editor-context-menu.d.ts +0 -21
  174. package/dist/standalone/editor-debug-ws.d.ts +37 -145
  175. package/dist/standalone/editor-delete.d.ts +0 -1
  176. package/dist/standalone/editor-dialogs.d.ts +16 -66
  177. package/dist/standalone/editor-events.d.ts +0 -27
  178. package/dist/standalone/editor-overlays.d.ts +14 -0
  179. package/dist/standalone/editor-property-drawers.d.ts +13 -71
  180. package/dist/standalone/editor-route-settings.d.ts +7 -55
  181. package/dist/standalone/editor-sidebar.d.ts +0 -18
  182. package/dist/standalone/editor-styles.d.ts +0 -11
  183. package/dist/standalone/editor-toast.d.ts +1 -2
  184. package/dist/standalone/editor-toolbar.d.ts +5 -80
  185. package/dist/standalone/editor-tour.d.ts +7 -0
  186. package/dist/standalone/editor-trace-overlay.d.ts +0 -5
  187. package/dist/standalone/full-json-dialog.d.ts +5 -1
  188. package/dist/standalone/group-node.d.ts +1 -51
  189. package/dist/standalone/icon-utils.d.ts +0 -20
  190. package/dist/standalone/index.d.ts +10 -7
  191. package/dist/standalone/json-diff.d.ts +0 -1
  192. package/dist/standalone/keyboard-events.d.ts +0 -1
  193. package/dist/standalone/layout-scheduler.d.ts +0 -6
  194. package/dist/standalone/lifecycle.d.ts +0 -5
  195. package/dist/standalone/logger.d.ts +0 -32
  196. package/dist/standalone/models-dev-catalog.d.ts +0 -1
  197. package/dist/standalone/node-copy.d.ts +7 -4
  198. package/dist/standalone/node-definitions.d.ts +0 -63
  199. package/dist/standalone/node-identity.d.ts +0 -1
  200. package/dist/standalone/node-theme.d.ts +8 -0
  201. package/dist/standalone/node-views-data.d.ts +0 -20
  202. package/dist/standalone/official-node-view-patches.d.ts +1 -14
  203. package/dist/standalone/outline-style.d.ts +7 -0
  204. package/dist/standalone/run-history-format.d.ts +0 -1
  205. package/dist/standalone/security-utils.d.ts +1 -5
  206. package/dist/standalone/shared-node-manager.d.ts +31 -0
  207. package/dist/standalone/themes.d.ts +0 -48
  208. package/dist/tools/tool-editor.d.ts +0 -1
  209. package/dist/types/component.d.ts +105 -87
  210. package/dist/types/editor.d.ts +16 -169
  211. package/dist/types/events.d.ts +30 -107
  212. package/dist/types/index.d.ts +3 -10
  213. package/dist/types/rule-chain.d.ts +0 -90
  214. package/dist/utils/GraphUtils.d.ts +0 -10
  215. package/dist/utils/helpers.d.ts +0 -80
  216. package/dist/utils/index.d.ts +0 -5
  217. package/dist/utils/pinyin-search.d.ts +0 -57
  218. package/dist/utils/relation-utils.d.ts +0 -1
  219. package/dist/utils/textUtils.d.ts +0 -12
  220. package/dist/version.d.ts +2 -3
  221. package/dist/xlsx-qn1xoUuv.cjs +105 -0
  222. package/package.json +19 -5
  223. package/vite-chunks.d.ts +11 -0
  224. package/vite-chunks.mjs +120 -0
  225. 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
@@ -1,3 +1,2 @@
1
1
  export declare function isEditableShortcutTarget(target: EventTarget | null): boolean;
2
2
  export declare function isCodeEditorOwnedShortcut(event: KeyboardEvent): boolean;
3
- //# sourceMappingURL=keyboard-events.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
@@ -51,4 +51,3 @@ export declare function loadModelsDevProviderCatalog(options?: {
51
51
  maxAgeMs?: number;
52
52
  }): Promise<ModelsDevLoadResult>;
53
53
  export declare function clearModelsDevCatalogMemoryForTest(): void;
54
- //# sourceMappingURL=models-dev-catalog.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
@@ -0,0 +1,7 @@
1
+ export type OutlineStyle = Record<string, unknown> & {
2
+ stroke?: string;
3
+ hover?: Record<string, unknown> & {
4
+ stroke?: string;
5
+ };
6
+ };
7
+ export declare function withTransparentOutline(style: OutlineStyle | null | undefined): OutlineStyle;
@@ -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
- export interface ComponentField {
31
- /** 字段名称 (对应 configuration 中的 key) */
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
- /** 字段类型 (string, int, bool, select, code 等) */
34
- type: string;
35
- /** 默认值 */
36
- defaultValue: unknown;
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
- desc: string;
41
- /** 验证规则 (字符串格式, 旧版兼容; 或 FieldValidation 对象) */
42
- validate: string | FieldValidation;
43
- /** 嵌套子字段 (用于复合类型) */
44
- fields: ComponentField[] | null;
45
- /** 下拉选项列表 (当 type 为 select 时) */
46
- options?: Array<{
47
- label: string;
48
- value: string;
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
- /** 允许的关系类型 (如 True/False/Success/Failure) */
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