@huanban/rulego-editor-core 1.0.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 +211 -0
- package/dist/api/RuleChainAPI.d.ts +163 -0
- package/dist/api/RuleChainAPI.d.ts.map +1 -0
- package/dist/api/index.d.ts +15 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/types.d.ts +244 -0
- package/dist/api/types.d.ts.map +1 -0
- package/dist/core/ComponentRegistry.d.ts +141 -0
- package/dist/core/ComponentRegistry.d.ts.map +1 -0
- package/dist/core/DataAdapter.d.ts +129 -0
- package/dist/core/DataAdapter.d.ts.map +1 -0
- package/dist/core/EditorCore.d.ts +251 -0
- package/dist/core/EditorCore.d.ts.map +1 -0
- package/dist/core/EventBus.d.ts +101 -0
- package/dist/core/EventBus.d.ts.map +1 -0
- package/dist/core/HistoryManager.d.ts +166 -0
- package/dist/core/HistoryManager.d.ts.map +1 -0
- package/dist/core/I18nManager.d.ts +130 -0
- package/dist/core/I18nManager.d.ts.map +1 -0
- package/dist/core/StateStore.d.ts +160 -0
- package/dist/core/StateStore.d.ts.map +1 -0
- package/dist/core/ThemeManager.d.ts +175 -0
- package/dist/core/ThemeManager.d.ts.map +1 -0
- package/dist/core/ValidationEngine.d.ts +139 -0
- package/dist/core/ValidationEngine.d.ts.map +1 -0
- package/dist/core/index.d.ts +30 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/defaults/components.d.ts +30 -0
- package/dist/defaults/components.d.ts.map +1 -0
- package/dist/defaults/index.d.ts +18 -0
- package/dist/defaults/index.d.ts.map +1 -0
- package/dist/defaults/locale-en-US.d.ts +26 -0
- package/dist/defaults/locale-en-US.d.ts.map +1 -0
- package/dist/defaults/locale-zh-CN.d.ts +41 -0
- package/dist/defaults/locale-zh-CN.d.ts.map +1 -0
- package/dist/iconRegistry.d.ts +17 -0
- package/dist/iconRegistry.d.ts.map +1 -0
- package/dist/index.cjs.js +2490 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.esm.js +59608 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.umd.js +2490 -0
- package/dist/index.umd.js.map +1 -0
- package/dist/standalone/HuanbanRulegoEditor.d.ts +392 -0
- package/dist/standalone/HuanbanRulegoEditor.d.ts.map +1 -0
- package/dist/standalone/code-editor.d.ts +95 -0
- package/dist/standalone/code-editor.d.ts.map +1 -0
- package/dist/standalone/custom-nodes.d.ts +26 -0
- package/dist/standalone/custom-nodes.d.ts.map +1 -0
- package/dist/standalone/editor-chain-info.d.ts +46 -0
- package/dist/standalone/editor-chain-info.d.ts.map +1 -0
- package/dist/standalone/editor-context-menu.d.ts +21 -0
- package/dist/standalone/editor-context-menu.d.ts.map +1 -0
- package/dist/standalone/editor-debug-ws.d.ts +170 -0
- package/dist/standalone/editor-debug-ws.d.ts.map +1 -0
- package/dist/standalone/editor-dialogs.d.ts +73 -0
- package/dist/standalone/editor-dialogs.d.ts.map +1 -0
- package/dist/standalone/editor-events.d.ts +28 -0
- package/dist/standalone/editor-events.d.ts.map +1 -0
- package/dist/standalone/editor-property-drawers.d.ts +78 -0
- package/dist/standalone/editor-property-drawers.d.ts.map +1 -0
- package/dist/standalone/editor-route-settings.d.ts +49 -0
- package/dist/standalone/editor-route-settings.d.ts.map +1 -0
- package/dist/standalone/editor-sidebar.d.ts +19 -0
- package/dist/standalone/editor-sidebar.d.ts.map +1 -0
- package/dist/standalone/editor-styles.d.ts +12 -0
- package/dist/standalone/editor-styles.d.ts.map +1 -0
- package/dist/standalone/editor-toolbar.d.ts +89 -0
- package/dist/standalone/editor-toolbar.d.ts.map +1 -0
- package/dist/standalone/group-node.d.ts +52 -0
- package/dist/standalone/group-node.d.ts.map +1 -0
- package/dist/standalone/icon-utils.d.ts +19 -0
- package/dist/standalone/icon-utils.d.ts.map +1 -0
- package/dist/standalone/index.d.ts +9 -0
- package/dist/standalone/index.d.ts.map +1 -0
- package/dist/standalone/logger.d.ts +35 -0
- package/dist/standalone/logger.d.ts.map +1 -0
- package/dist/standalone/node-definitions.d.ts +74 -0
- package/dist/standalone/node-definitions.d.ts.map +1 -0
- package/dist/standalone/node-views-data.d.ts +21 -0
- package/dist/standalone/node-views-data.d.ts.map +1 -0
- package/dist/standalone/themes.d.ts +54 -0
- package/dist/standalone/themes.d.ts.map +1 -0
- package/dist/types/component.d.ts +120 -0
- package/dist/types/component.d.ts.map +1 -0
- package/dist/types/editor.d.ts +246 -0
- package/dist/types/editor.d.ts.map +1 -0
- package/dist/types/events.d.ts +199 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/rule-chain.d.ts +141 -0
- package/dist/types/rule-chain.d.ts.map +1 -0
- package/dist/utils/helpers.d.ts +100 -0
- package/dist/utils/helpers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/pinyin-search.d.ts +60 -0
- package/dist/utils/pinyin-search.d.ts.map +1 -0
- package/package.json +70 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file ValidationEngine.ts
|
|
3
|
+
* @description 图验证引擎 — 验证规则链的合法性
|
|
4
|
+
*
|
|
5
|
+
* 提供可扩展的验证规则系统:
|
|
6
|
+
* - 内置验证规则 (孤立节点检测、起始连接检查等)
|
|
7
|
+
* - 自定义验证规则注册
|
|
8
|
+
* - 保存前自动验证
|
|
9
|
+
*
|
|
10
|
+
* 验证结果包含错误列表,每个错误关联到具体的节点或边,
|
|
11
|
+
* 方便 UI 层高亮显示问题元素。
|
|
12
|
+
*/
|
|
13
|
+
import type { LFGraphData } from './DataAdapter';
|
|
14
|
+
/**
|
|
15
|
+
* 验证错误
|
|
16
|
+
*/
|
|
17
|
+
export interface ValidationError {
|
|
18
|
+
/** 规则名称 */
|
|
19
|
+
rule: string;
|
|
20
|
+
/** 错误级别 */
|
|
21
|
+
level: 'error' | 'warning' | 'info';
|
|
22
|
+
/** 错误消息 */
|
|
23
|
+
message: string;
|
|
24
|
+
/** 关联的元素 ID (节点或边) */
|
|
25
|
+
elementId?: string;
|
|
26
|
+
/** 关联的元素类型 */
|
|
27
|
+
elementType?: 'node' | 'edge';
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* 验证结果
|
|
31
|
+
*/
|
|
32
|
+
export interface ValidationResult {
|
|
33
|
+
/** 是否验证通过 (无 error 级别错误) */
|
|
34
|
+
valid: boolean;
|
|
35
|
+
/** 错误列表 */
|
|
36
|
+
errors: ValidationError[];
|
|
37
|
+
/** 警告列表 */
|
|
38
|
+
warnings: ValidationError[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* 验证规则接口
|
|
42
|
+
*/
|
|
43
|
+
export interface ValidationRule {
|
|
44
|
+
/** 规则名称 (唯一标识) */
|
|
45
|
+
name: string;
|
|
46
|
+
/** 规则描述 */
|
|
47
|
+
description?: string;
|
|
48
|
+
/** 是否启用 (默认: true) */
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* 验证函数
|
|
52
|
+
*
|
|
53
|
+
* @param graphData - LogicFlow 图数据
|
|
54
|
+
* @param context - 验证上下文 (包含内部配置)
|
|
55
|
+
* @returns 验证错误列表
|
|
56
|
+
*/
|
|
57
|
+
validate(graphData: LFGraphData, context: ValidationContext): ValidationError[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 验证上下文 (传递给验证规则的额外信息)
|
|
61
|
+
*/
|
|
62
|
+
export interface ValidationContext {
|
|
63
|
+
/** 起始节点 ID */
|
|
64
|
+
startNodeId: string;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 图验证引擎
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```typescript
|
|
71
|
+
* const engine = new ValidationEngine()
|
|
72
|
+
*
|
|
73
|
+
* // 使用内置规则
|
|
74
|
+
* engine.registerBuiltinRules()
|
|
75
|
+
*
|
|
76
|
+
* // 添加自定义规则
|
|
77
|
+
* engine.register({
|
|
78
|
+
* name: 'max-nodes',
|
|
79
|
+
* validate(data) {
|
|
80
|
+
* if (data.nodes.length > 100) {
|
|
81
|
+
* return [{ rule: 'max-nodes', level: 'warning', message: '节点数超过100' }]
|
|
82
|
+
* }
|
|
83
|
+
* return []
|
|
84
|
+
* }
|
|
85
|
+
* })
|
|
86
|
+
*
|
|
87
|
+
* // 执行验证
|
|
88
|
+
* const result = engine.validate(graphData, { startNodeId: '$node_start_input' })
|
|
89
|
+
* if (!result.valid) {
|
|
90
|
+
* console.error('验证失败:', result.errors)
|
|
91
|
+
* }
|
|
92
|
+
* ```
|
|
93
|
+
*/
|
|
94
|
+
export declare class ValidationEngine {
|
|
95
|
+
/** 已注册的验证规则 */
|
|
96
|
+
private rules;
|
|
97
|
+
/**
|
|
98
|
+
* 注册验证规则
|
|
99
|
+
*
|
|
100
|
+
* @param rule - 验证规则
|
|
101
|
+
* @param overwrite - 是否覆盖同名规则 (默认: true)
|
|
102
|
+
*/
|
|
103
|
+
register(rule: ValidationRule, overwrite?: boolean): void;
|
|
104
|
+
/**
|
|
105
|
+
* 注销验证规则
|
|
106
|
+
*
|
|
107
|
+
* @param name - 规则名称
|
|
108
|
+
*/
|
|
109
|
+
unregister(name: string): void;
|
|
110
|
+
/**
|
|
111
|
+
* 启用/禁用指定规则
|
|
112
|
+
*/
|
|
113
|
+
setEnabled(name: string, enabled: boolean): void;
|
|
114
|
+
/**
|
|
115
|
+
* 注册所有内置验证规则
|
|
116
|
+
*/
|
|
117
|
+
registerBuiltinRules(): void;
|
|
118
|
+
/**
|
|
119
|
+
* 执行验证
|
|
120
|
+
*
|
|
121
|
+
* @param graphData - LogicFlow 图数据
|
|
122
|
+
* @param context - 验证上下文
|
|
123
|
+
* @returns 验证结果
|
|
124
|
+
*/
|
|
125
|
+
validate(graphData: LFGraphData, context: ValidationContext): ValidationResult;
|
|
126
|
+
/**
|
|
127
|
+
* 获取所有已注册规则的信息
|
|
128
|
+
*/
|
|
129
|
+
getRules(): Array<{
|
|
130
|
+
name: string;
|
|
131
|
+
description?: string;
|
|
132
|
+
enabled: boolean;
|
|
133
|
+
}>;
|
|
134
|
+
/**
|
|
135
|
+
* 清空所有规则
|
|
136
|
+
*/
|
|
137
|
+
clear(): void;
|
|
138
|
+
}
|
|
139
|
+
//# sourceMappingURL=ValidationEngine.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ValidationEngine.d.ts","sourceRoot":"","sources":["../../src/core/ValidationEngine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAMhD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW;IACX,KAAK,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAA;IACnC,WAAW;IACX,OAAO,EAAE,MAAM,CAAA;IACf,sBAAsB;IACtB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc;IACd,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAC9B;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4BAA4B;IAC5B,KAAK,EAAE,OAAO,CAAA;IACd,WAAW;IACX,MAAM,EAAE,eAAe,EAAE,CAAA;IACzB,WAAW;IACX,QAAQ,EAAE,eAAe,EAAE,CAAA;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,kBAAkB;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW;IACX,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,sBAAsB;IACtB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB;;;;;;OAMG;IACH,QAAQ,CACN,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,iBAAiB,GACzB,eAAe,EAAE,CAAA;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,cAAc;IACd,WAAW,EAAE,MAAM,CAAA;CACpB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,qBAAa,gBAAgB;IAC3B,eAAe;IACf,OAAO,CAAC,KAAK,CAAyC;IAEtD;;;;;OAKG;IACH,QAAQ,CAAC,IAAI,EAAE,cAAc,EAAE,SAAS,UAAO,GAAG,IAAI;IAQtD;;;;OAIG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAI9B;;OAEG;IACH,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;IAOhD;;OAEG;IACH,oBAAoB,IAAI,IAAI;IAI5B;;;;;;OAMG;IACH,QAAQ,CACN,SAAS,EAAE,WAAW,EACtB,OAAO,EAAE,iBAAiB,GACzB,gBAAgB;IAgCnB;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;IAQ3E;;OAEG;IACH,KAAK,IAAI,IAAI;CAGd"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file core/index.ts
|
|
3
|
+
* @description 核心模块统一导出入口
|
|
4
|
+
*
|
|
5
|
+
* 所有核心子系统均从此处导出:
|
|
6
|
+
* - StateStore: 框架无关的响应式状态容器
|
|
7
|
+
* - EventBus: 类型安全的事件总线
|
|
8
|
+
* - DataAdapter: RuleGo ↔ LogicFlow 数据格式转换
|
|
9
|
+
* - ComponentRegistry: 组件注册表
|
|
10
|
+
* - HistoryManager: 撤销/重做管理
|
|
11
|
+
* - ValidationEngine: 图验证引擎
|
|
12
|
+
* - ThemeManager: 主题切换管理
|
|
13
|
+
* - I18nManager: 国际化管理
|
|
14
|
+
* - EditorCore: 核心引擎 (整合以上所有子系统)
|
|
15
|
+
*/
|
|
16
|
+
export { StateStore } from './StateStore';
|
|
17
|
+
export { EventBus } from './EventBus';
|
|
18
|
+
export { DataAdapter } from './DataAdapter';
|
|
19
|
+
export type { LFNodeData, LFEdgeData, LFGraphData, LFPoint } from './DataAdapter';
|
|
20
|
+
export { ComponentRegistry } from './ComponentRegistry';
|
|
21
|
+
export { HistoryManager, BatchCommand } from './HistoryManager';
|
|
22
|
+
export type { Command } from './HistoryManager';
|
|
23
|
+
export { ValidationEngine } from './ValidationEngine';
|
|
24
|
+
export type { ValidationError, ValidationResult, ValidationRule, ValidationContext, } from './ValidationEngine';
|
|
25
|
+
export { ThemeManager, THEME_LIGHT, THEME_DARK, THEME_BLUE } from './ThemeManager';
|
|
26
|
+
export type { ThemeVariables, ThemeDefinition } from './ThemeManager';
|
|
27
|
+
export { I18nManager } from './I18nManager';
|
|
28
|
+
export type { LocaleMessages } from './I18nManager';
|
|
29
|
+
export { EditorCore } from './EditorCore';
|
|
30
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/D,YAAY,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,YAAY,EACV,eAAe,EACf,gBAAgB,EAChB,cAAc,EACd,iBAAiB,GAClB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAClF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAC3C,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file defaults/components.ts
|
|
3
|
+
* @description 内置组件定义 — 默认可用的节点类型
|
|
4
|
+
*
|
|
5
|
+
* 从原版 default.js 移植, 包含 RuleGo 标准的节点类型定义:
|
|
6
|
+
* - filter: 过滤器 (jsFilter, jsSwitch, fieldFilter, groupFilter, msgTypeSwitch)
|
|
7
|
+
* - transform: 转换器 (jsTransform)
|
|
8
|
+
* - action: 动作 (log, delay, restApiCall, sendMail, mqttClient,
|
|
9
|
+
* dbClient, ssh, for, groupAction, delay)
|
|
10
|
+
* - external: 外部集成 (restApiCall, mqttClient, dbClient 等)
|
|
11
|
+
* - flow: 流程控制 (flow/子规则链)
|
|
12
|
+
*
|
|
13
|
+
* @see 原版: src/components/utils/default.js
|
|
14
|
+
*/
|
|
15
|
+
import type { ComponentDefinition } from '../types/component';
|
|
16
|
+
/**
|
|
17
|
+
* RuleGo 默认内置组件列表
|
|
18
|
+
*
|
|
19
|
+
* 这些组件对应 RuleGo 后端支持的标准节点类型。
|
|
20
|
+
* 每个组件包含:
|
|
21
|
+
* - type: 节点类型标识
|
|
22
|
+
* - category: 所属分类
|
|
23
|
+
* - fields: 配置表单字段
|
|
24
|
+
* - label: 显示名称
|
|
25
|
+
* - desc: 描述
|
|
26
|
+
* - icon: 图标
|
|
27
|
+
* - relationTypes: 允许的关系类型
|
|
28
|
+
*/
|
|
29
|
+
export declare const defaultComponents: ComponentDefinition[];
|
|
30
|
+
//# sourceMappingURL=components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/defaults/components.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAE7D;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,iBAAiB,EAAE,mBAAmB,EAygBlD,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file defaults/index.ts
|
|
3
|
+
* @description 默认数据统一导出入口
|
|
4
|
+
*
|
|
5
|
+
* 导出项:
|
|
6
|
+
* - defaultComponents: 内置组件定义列表
|
|
7
|
+
* - localeZhCN: 中文语言包
|
|
8
|
+
* - localeEnUS: 英文语言包
|
|
9
|
+
*
|
|
10
|
+
* 使用方式:
|
|
11
|
+
* ```typescript
|
|
12
|
+
* import { defaultComponents, localeZhCN, localeEnUS } from '@huanban/rulego-editor-core'
|
|
13
|
+
* ```
|
|
14
|
+
*/
|
|
15
|
+
export { defaultComponents } from './components';
|
|
16
|
+
export { localeZhCN } from './locale-zh-CN';
|
|
17
|
+
export { localeEnUS } from './locale-en-US';
|
|
18
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/defaults/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file defaults/locale-en-US.ts
|
|
3
|
+
* @description 英文语言包 — 编辑器所有 UI 文本的英文翻译
|
|
4
|
+
*
|
|
5
|
+
* 与 locale-zh-CN.ts 结构完全对应, 提供英文版本。
|
|
6
|
+
* 作为默认的 fallback 语言使用。
|
|
7
|
+
*
|
|
8
|
+
* 使用方式:
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { localeEnUS, I18nManager } from '@huanban/rulego-editor-core'
|
|
11
|
+
*
|
|
12
|
+
* const i18n = new I18nManager({ locale: 'en-US', fallback: 'en-US' })
|
|
13
|
+
* i18n.register('en-US', localeEnUS)
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @see locale-zh-CN.ts 中文对照版本
|
|
17
|
+
* @see I18nManager 国际化管理器
|
|
18
|
+
*/
|
|
19
|
+
import type { LocaleMessages } from '../core/I18nManager';
|
|
20
|
+
/**
|
|
21
|
+
* 英文语言包
|
|
22
|
+
*
|
|
23
|
+
* 结构与 localeZhCN 完全相同, 所有 key 一一对应
|
|
24
|
+
*/
|
|
25
|
+
export declare const localeEnUS: LocaleMessages;
|
|
26
|
+
//# sourceMappingURL=locale-en-US.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-en-US.d.ts","sourceRoot":"","sources":["../../src/defaults/locale-en-US.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,cA8hBxB,CAAA"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file defaults/locale-zh-CN.ts
|
|
3
|
+
* @description 中文语言包 — 编辑器所有 UI 文本的中文翻译
|
|
4
|
+
*
|
|
5
|
+
* 移植自原版 local_zh.js, 并扩展了编辑器 UI 层所需的所有文本。
|
|
6
|
+
* 原版仅包含组件名称和字段标签的映射, 这里增加了:
|
|
7
|
+
* - 编辑器 UI 文本 (工具栏、侧边栏、对话框等)
|
|
8
|
+
* - 验证消息
|
|
9
|
+
* - 操作提示
|
|
10
|
+
* - HuanbanRulegoEditor 弹窗/面板/状态栏文本
|
|
11
|
+
*
|
|
12
|
+
* 使用方式:
|
|
13
|
+
* ```typescript
|
|
14
|
+
* import { localeZhCN } from '@huanban/rulego-editor-core'
|
|
15
|
+
* import { I18nManager } from '@huanban/rulego-editor-core'
|
|
16
|
+
*
|
|
17
|
+
* const i18n = new I18nManager({ locale: 'zh-CN' })
|
|
18
|
+
* i18n.register('zh-CN', localeZhCN)
|
|
19
|
+
*
|
|
20
|
+
* // 使用翻译
|
|
21
|
+
* i18n.t('editor.toolbar.save') // => '保存'
|
|
22
|
+
* i18n.t('components.jsFilter') // => 'JS过滤器'
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see 原版: src/components/utils/local_zh.js
|
|
26
|
+
* @see I18nManager 用于加载和查询翻译
|
|
27
|
+
*/
|
|
28
|
+
import type { LocaleMessages } from '../core/I18nManager';
|
|
29
|
+
/**
|
|
30
|
+
* 中文语言包
|
|
31
|
+
*
|
|
32
|
+
* 结构说明:
|
|
33
|
+
* - editor.* : 编辑器 UI 层文本 (工具栏、侧边栏、对话框、面板、状态栏)
|
|
34
|
+
* - components.* : 组件类型的中文名称 (type => 中文标签)
|
|
35
|
+
* - fields.* : 组件字段的中文标签 (fieldName => 中文标签)
|
|
36
|
+
* - category.* : 分类名称
|
|
37
|
+
* - validation.* : 验证提示消息
|
|
38
|
+
* - action.* : 操作相关提示 (保存、删除、创建等)
|
|
39
|
+
*/
|
|
40
|
+
export declare const localeZhCN: LocaleMessages;
|
|
41
|
+
//# sourceMappingURL=locale-zh-CN.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locale-zh-CN.d.ts","sourceRoot":"","sources":["../../src/defaults/locale-zh-CN.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,UAAU,EAAE,cA6jBxB,CAAA"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 自动生成的图标注册表 — 所有 SVG 图标以 data URL 形式内联
|
|
3
|
+
* 生成时间: 2026-03-21 13:01:41
|
|
4
|
+
* 图标数量: 90
|
|
5
|
+
*
|
|
6
|
+
* 用法: import { ICON_REGISTRY } from './iconRegistry'
|
|
7
|
+
* const url = ICON_REGISTRY['delay'] // => data:image/svg+xml;base64,...
|
|
8
|
+
*/
|
|
9
|
+
export declare const ICON_REGISTRY: Record<string, string>;
|
|
10
|
+
/**
|
|
11
|
+
* 根据图标名称获取图标 URL
|
|
12
|
+
* @param name - 图标名称(不含 .svg 扩展名),如 'delay', 'action'
|
|
13
|
+
* @param fallbackPath - 找不到时的降级路径,如 'images/delay.svg'
|
|
14
|
+
* @returns data URL 或降级路径
|
|
15
|
+
*/
|
|
16
|
+
export declare function getIconUrl(name: string, fallbackPath?: string): string;
|
|
17
|
+
//# sourceMappingURL=iconRegistry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"iconRegistry.d.ts","sourceRoot":"","sources":["../src/iconRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CA2FhD,CAAA;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtE"}
|