@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,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file editor-debug-ws.ts
|
|
3
|
+
* @description WebSocket 实时调试日志管理模块
|
|
4
|
+
*
|
|
5
|
+
* 职责:
|
|
6
|
+
* 1. 建立 WebSocket 连接,接收后端推送的实时调试日志
|
|
7
|
+
* 2. 管理连接生命周期(连接、断线重连、销毁)
|
|
8
|
+
* 3. 将日志消息渲染到终端面板
|
|
9
|
+
*
|
|
10
|
+
* API 端点:
|
|
11
|
+
* ws(s)://<apiBase>/logs/ws/<chainId>/<clientId>
|
|
12
|
+
* (apiBase 已包含 /api/v1 前缀)
|
|
13
|
+
*
|
|
14
|
+
* 消息格式 (每条 JSON):
|
|
15
|
+
* { ts (UnixMilli), flowType, relationType, nodeId, msg: RuleMsg, err }
|
|
16
|
+
*
|
|
17
|
+
* 使用方式:
|
|
18
|
+
* const ws = new DebugWebSocket(apiBase, chainId, nodeId, { onMessage, onStatus })
|
|
19
|
+
* ws.connect()
|
|
20
|
+
* // ... 关闭 Drawer 时
|
|
21
|
+
* ws.destroy()
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* WebSocket 连接状态
|
|
25
|
+
*/
|
|
26
|
+
export type WsStatus = 'connecting' | 'live' | 'disconnected' | 'error';
|
|
27
|
+
/**
|
|
28
|
+
* WebSocket 回调选项
|
|
29
|
+
* @property onMessage - 收到日志消息时触发
|
|
30
|
+
* @property onStatus - 连接状态变化时触发
|
|
31
|
+
*/
|
|
32
|
+
export interface DebugWsCallbacks {
|
|
33
|
+
/** 收到一条新日志时调用 */
|
|
34
|
+
onMessage: (item: any) => void;
|
|
35
|
+
/** 连接状态变化时调用 */
|
|
36
|
+
onStatus: (status: WsStatus) => void;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* 调试日志 WebSocket 管理器
|
|
40
|
+
*
|
|
41
|
+
* 特性:
|
|
42
|
+
* - 自动重连(指数退避 1s → 2s → 4s → ... 最大 16s)
|
|
43
|
+
* - 最多重连 5 次后停止
|
|
44
|
+
* - destroy() 后不再重连
|
|
45
|
+
* - 心跳 ping(每 30 秒发送 "ping",保活)
|
|
46
|
+
*/
|
|
47
|
+
export declare class DebugWebSocket {
|
|
48
|
+
/** HTTP(S) API 基础路径,如 http://localhost:9090/api/v1 */
|
|
49
|
+
private apiBase;
|
|
50
|
+
/** 规则链 ID */
|
|
51
|
+
private chainId;
|
|
52
|
+
/** 客户端 ID (用于服务端标识连接,断开时移除 observer) */
|
|
53
|
+
private clientId;
|
|
54
|
+
/** 回调函数 */
|
|
55
|
+
private callbacks;
|
|
56
|
+
/** WebSocket 实例 */
|
|
57
|
+
private ws;
|
|
58
|
+
/** 是否已主动销毁 */
|
|
59
|
+
private destroyed;
|
|
60
|
+
/** 重连次数计数 */
|
|
61
|
+
private reconnectCount;
|
|
62
|
+
/** 最大重连次数 */
|
|
63
|
+
private maxReconnects;
|
|
64
|
+
/** 重连定时器 */
|
|
65
|
+
private reconnectTimer;
|
|
66
|
+
/** 心跳定时器 */
|
|
67
|
+
private pingTimer;
|
|
68
|
+
/**
|
|
69
|
+
* 构造函数
|
|
70
|
+
* @param apiBase - API 基础路径 (http(s)://host/api/v1)
|
|
71
|
+
* @param chainId - 规则链 ID
|
|
72
|
+
* @param clientId - 客户端标识 (唯一,服务端用于管理 observer)
|
|
73
|
+
* @param callbacks - 回调函数
|
|
74
|
+
*/
|
|
75
|
+
constructor(apiBase: string, chainId: string, clientId: string, callbacks: DebugWsCallbacks);
|
|
76
|
+
/**
|
|
77
|
+
* 建立 WebSocket 连接
|
|
78
|
+
* 如果已连接则先关闭旧连接再重连
|
|
79
|
+
*/
|
|
80
|
+
connect(): void;
|
|
81
|
+
/**
|
|
82
|
+
* 主动断开连接,不再重连
|
|
83
|
+
* 通常在 Drawer 关闭时调用
|
|
84
|
+
*/
|
|
85
|
+
destroy(): void;
|
|
86
|
+
/**
|
|
87
|
+
* 获取当前连接状态
|
|
88
|
+
*/
|
|
89
|
+
isConnected(): boolean;
|
|
90
|
+
/**
|
|
91
|
+
* 构建 WebSocket URL
|
|
92
|
+
* 将 http(s) 替换为 ws(s),拼接调试日志 WebSocket 路径
|
|
93
|
+
*
|
|
94
|
+
* RuleGo Server 路径: /api/v1/logs/ws/:chainId/:clientId
|
|
95
|
+
*
|
|
96
|
+
* @returns WebSocket URL 字符串
|
|
97
|
+
*/
|
|
98
|
+
private buildWsUrl;
|
|
99
|
+
/**
|
|
100
|
+
* 处理收到的消息
|
|
101
|
+
* 支持单条 JSON 和批量 JSON (每行一条)
|
|
102
|
+
*
|
|
103
|
+
* @param data - 原始消息数据
|
|
104
|
+
*/
|
|
105
|
+
private handleMessage;
|
|
106
|
+
/**
|
|
107
|
+
* 安排断线重连(指数退避)
|
|
108
|
+
*/
|
|
109
|
+
private scheduleReconnect;
|
|
110
|
+
/**
|
|
111
|
+
* 关闭当前 WebSocket 连接
|
|
112
|
+
*/
|
|
113
|
+
private closeSocket;
|
|
114
|
+
/**
|
|
115
|
+
* 启动心跳 ping (每 30 秒发送一次)
|
|
116
|
+
*/
|
|
117
|
+
private startPing;
|
|
118
|
+
/**
|
|
119
|
+
* 停止心跳 ping
|
|
120
|
+
*/
|
|
121
|
+
private stopPing;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* 实时日志终端 — 将 WebSocket 推送的日志渲染到终端面板
|
|
125
|
+
*
|
|
126
|
+
* 特性:
|
|
127
|
+
* - 最大保留 500 条日志 (FIFO)
|
|
128
|
+
* - 自动滚动到最新
|
|
129
|
+
* - 支持清空
|
|
130
|
+
*/
|
|
131
|
+
export declare class LiveTerminalRenderer {
|
|
132
|
+
/** 终端面板 DOM 元素 */
|
|
133
|
+
private container;
|
|
134
|
+
/** 日志缓冲区 */
|
|
135
|
+
private buffer;
|
|
136
|
+
/** 最大缓冲条数 */
|
|
137
|
+
private maxLines;
|
|
138
|
+
/** HTML 转义函数 */
|
|
139
|
+
private escapeHtml;
|
|
140
|
+
/**
|
|
141
|
+
* @param container - 终端面板元素
|
|
142
|
+
* @param escapeHtml - HTML 转义函数 (ctx._escapeHtml)
|
|
143
|
+
*/
|
|
144
|
+
constructor(container: HTMLElement, escapeHtml: (text: string) => string);
|
|
145
|
+
/**
|
|
146
|
+
* 追加一条日志消息
|
|
147
|
+
* @param item - 日志条目对象
|
|
148
|
+
*/
|
|
149
|
+
appendLog(item: any): void;
|
|
150
|
+
/**
|
|
151
|
+
* 清空所有日志
|
|
152
|
+
*/
|
|
153
|
+
clear(): void;
|
|
154
|
+
/**
|
|
155
|
+
* 获取当前日志条数
|
|
156
|
+
*/
|
|
157
|
+
getCount(): number;
|
|
158
|
+
/**
|
|
159
|
+
* 重新渲染终端内容并自动滚动到底部
|
|
160
|
+
*/
|
|
161
|
+
private render;
|
|
162
|
+
/**
|
|
163
|
+
* 格式化单条日志为终端 HTML
|
|
164
|
+
*
|
|
165
|
+
* @param item - 日志条目
|
|
166
|
+
* @returns HTML 字符串
|
|
167
|
+
*/
|
|
168
|
+
private formatLogLine;
|
|
169
|
+
}
|
|
170
|
+
//# sourceMappingURL=editor-debug-ws.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-debug-ws.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-debug-ws.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAMH;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,YAAY,GAAG,MAAM,GAAG,cAAc,GAAG,OAAO,CAAC;AAExE;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB;IACjB,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,gBAAgB;IAChB,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,KAAK,IAAI,CAAC;CACtC;AAMD;;;;;;;;GAQG;AACH,qBAAa,cAAc;IACzB,sDAAsD;IACtD,OAAO,CAAC,OAAO,CAAS;IACxB,aAAa;IACb,OAAO,CAAC,OAAO,CAAS;IACxB,wCAAwC;IACxC,OAAO,CAAC,QAAQ,CAAS;IACzB,WAAW;IACX,OAAO,CAAC,SAAS,CAAmB;IAEpC,mBAAmB;IACnB,OAAO,CAAC,EAAE,CAA0B;IACpC,cAAc;IACd,OAAO,CAAC,SAAS,CAAS;IAC1B,aAAa;IACb,OAAO,CAAC,cAAc,CAAK;IAC3B,aAAa;IACb,OAAO,CAAC,aAAa,CAAK;IAC1B,YAAY;IACZ,OAAO,CAAC,cAAc,CAA8C;IACpE,YAAY;IACZ,OAAO,CAAC,SAAS,CAA8C;IAE/D;;;;;;OAMG;gBAED,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,gBAAgB;IAY7B;;;OAGG;IACH,OAAO,IAAI,IAAI;IAuCf;;;OAGG;IACH,OAAO,IAAI,IAAI;IAWf;;OAEG;IACH,WAAW,IAAI,OAAO;IAQtB;;;;;;;OAOG;IACH,OAAO,CAAC,UAAU;IAYlB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IA0BrB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAkBzB;;OAEG;IACH,OAAO,CAAC,WAAW;IAanB;;OAEG;IACH,OAAO,CAAC,SAAS;IAWjB;;OAEG;IACH,OAAO,CAAC,QAAQ;CAMjB;AAMD;;;;;;;GAOG;AACH,qBAAa,oBAAoB;IAC/B,kBAAkB;IAClB,OAAO,CAAC,SAAS,CAAc;IAC/B,YAAY;IACZ,OAAO,CAAC,MAAM,CAAgB;IAC9B,aAAa;IACb,OAAO,CAAC,QAAQ,CAAO;IACvB,gBAAgB;IAChB,OAAO,CAAC,UAAU,CAA2B;IAE7C;;;OAGG;gBACS,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM;IAKxE;;;OAGG;IACH,SAAS,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI;IAY1B;;OAEG;IACH,KAAK,IAAI,IAAI;IAKb;;OAEG;IACH,QAAQ,IAAI,MAAM;IAQlB;;OAEG;IACH,OAAO,CAAC,MAAM;IAMd;;;;;OAKG;IACH,OAAO,CAAC,aAAa;CAyCtB"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-dialogs.ts
|
|
3
|
+
* @description 弹窗/面板模块 — 从 HuanbanRulegoEditor.ts 中提取
|
|
4
|
+
*
|
|
5
|
+
* 包含以下弹窗功能:
|
|
6
|
+
* - 规则链选择器弹窗 (showRuleChainSelector)
|
|
7
|
+
* - 导出 DSL 弹窗 (showExportDialog)
|
|
8
|
+
* - 运行面板 Drawer (showRunPanel)
|
|
9
|
+
* - 组件管理弹窗 (showComponentManage)
|
|
10
|
+
*
|
|
11
|
+
* 每个函数接收 editor 实例作为参数 (EditorContext 接口),
|
|
12
|
+
* 避免与主类产生循环依赖。
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* 弹窗模块需要访问的编辑器上下文接口
|
|
16
|
+
* 使用接口而非直接引用 HuanbanRulegoEditor 类, 避免循环依赖
|
|
17
|
+
*/
|
|
18
|
+
export interface EditorContext {
|
|
19
|
+
/** LogicFlow 实例 */
|
|
20
|
+
lf: any;
|
|
21
|
+
/** EditorCore 数据引擎实例 */
|
|
22
|
+
core: any;
|
|
23
|
+
/** 编辑器配置选项 */
|
|
24
|
+
opts: any;
|
|
25
|
+
/** 组件列表 */
|
|
26
|
+
components: any[];
|
|
27
|
+
/** 侧边栏展开的分组集合 */
|
|
28
|
+
expandedGroups: Set<string>;
|
|
29
|
+
/** 节点组件映射 (类型 → 定义) */
|
|
30
|
+
_nodeComponents: Record<string, any>;
|
|
31
|
+
/** 国际化翻译方法 */
|
|
32
|
+
t(key: string, params?: Record<string, string>): string;
|
|
33
|
+
/** 导出当前画布数据 */
|
|
34
|
+
exportData(): any;
|
|
35
|
+
/** 加载规则链数据 */
|
|
36
|
+
loadData(data: any): void;
|
|
37
|
+
/** 渲染侧边栏 */
|
|
38
|
+
renderSidebar(): void;
|
|
39
|
+
/** HTML 转义 */
|
|
40
|
+
_escapeHtml(str: string): string;
|
|
41
|
+
/** 关闭 Drawer */
|
|
42
|
+
_closeDrawer(): void;
|
|
43
|
+
/** 关闭 Modal */
|
|
44
|
+
_closeModal(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 显示规则链选择器弹窗 — 支持搜索和分页
|
|
48
|
+
* 数据来源: opts.ruleItems (初始传入) 或远程 API
|
|
49
|
+
* @param ctx - 编辑器上下文
|
|
50
|
+
*/
|
|
51
|
+
export declare function showRuleChainSelector(ctx: EditorContext): void;
|
|
52
|
+
/**
|
|
53
|
+
* 显示导出 DSL 弹窗
|
|
54
|
+
* 支持 下载 JSON 数据 + 下载画布 PNG 截图
|
|
55
|
+
* slot: onExportDSL 可劫持, 传入 { json, imageDataUrl }
|
|
56
|
+
* @param ctx - 编辑器上下文
|
|
57
|
+
*/
|
|
58
|
+
export declare function showExportDialog(ctx: EditorContext): void;
|
|
59
|
+
/**
|
|
60
|
+
* 显示运行面板 Drawer
|
|
61
|
+
* 可发送消息到规则链并查看响应
|
|
62
|
+
* slot: onRunClick 可劫持
|
|
63
|
+
* @param ctx - 编辑器上下文
|
|
64
|
+
*/
|
|
65
|
+
export declare function showRunPanel(ctx: EditorContext): void;
|
|
66
|
+
/**
|
|
67
|
+
* 显示组件管理弹窗
|
|
68
|
+
* 已安装列表 + 组件市场(搜索/安装)
|
|
69
|
+
* slot: onComponentManage 可劫持
|
|
70
|
+
* @param ctx - 编辑器上下文
|
|
71
|
+
*/
|
|
72
|
+
export declare function showComponentManage(ctx: EditorContext): void;
|
|
73
|
+
//# sourceMappingURL=editor-dialogs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-dialogs.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-dialogs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAYH;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC5B,mBAAmB;IACnB,EAAE,EAAE,GAAG,CAAA;IACP,wBAAwB;IACxB,IAAI,EAAE,GAAG,CAAA;IACT,cAAc;IACd,IAAI,EAAE,GAAG,CAAA;IACT,WAAW;IACX,UAAU,EAAE,GAAG,EAAE,CAAA;IACjB,iBAAiB;IACjB,cAAc,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC3B,uBAAuB;IACvB,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,cAAc;IACd,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IACvD,eAAe;IACf,UAAU,IAAI,GAAG,CAAA;IACjB,cAAc;IACd,QAAQ,CAAC,IAAI,EAAE,GAAG,GAAG,IAAI,CAAA;IACzB,YAAY;IACZ,aAAa,IAAI,IAAI,CAAA;IACrB,cAAc;IACd,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,gBAAgB;IAChB,YAAY,IAAI,IAAI,CAAA;IACpB,eAAe;IACf,WAAW,IAAI,IAAI,CAAA;CACpB;AAMD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAkN9D;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgGzD;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAoLrD;AAMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA8c5D"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-events.ts
|
|
3
|
+
* @description LogicFlow 事件桥接模块
|
|
4
|
+
*
|
|
5
|
+
* 从 HuanbanRulegoEditor 主文件中提取的事件桥接逻辑,
|
|
6
|
+
* 负责将 LogicFlow 画布事件(节点点击/双击/添加/删除、边事件等)
|
|
7
|
+
* 桥接到 EditorCore 事件总线和外部回调。
|
|
8
|
+
*
|
|
9
|
+
* @param editor - HuanbanRulegoEditor 实例引用
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* 桥接 LogicFlow 画布事件到 EditorCore + 外部回调
|
|
13
|
+
*
|
|
14
|
+
* 桥接的事件包括:
|
|
15
|
+
* - editor:data-loaded → 渲染画布 + 自适应视图
|
|
16
|
+
* - graph:transform → 隐藏节点操作菜单
|
|
17
|
+
* - blank:click → 清除选中状态
|
|
18
|
+
* - node:click → 显示快捷编辑条
|
|
19
|
+
* - node:dbclick → 打开属性编辑 Drawer
|
|
20
|
+
* - node:add / node:delete → 状态更新
|
|
21
|
+
* - node:dnd-add → 拖拽添加节点
|
|
22
|
+
* - edge:click / edge:add / edge:delete / edge:dbclick → 边事件
|
|
23
|
+
* - node:drop → 更新布局信息
|
|
24
|
+
*
|
|
25
|
+
* @param editor - 编辑器实例 (需要含 lf / core / opts 等属性)
|
|
26
|
+
*/
|
|
27
|
+
export declare function bridgeEvents(editor: any): void;
|
|
28
|
+
//# sourceMappingURL=editor-events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-events.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CA4O9C"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-property-drawers.ts
|
|
3
|
+
* @description 属性编辑 Drawer 模块 — 从 HuanbanRulegoEditor.ts 中提取
|
|
4
|
+
*
|
|
5
|
+
* 包含以下功能:
|
|
6
|
+
* - 节点属性编辑 Drawer (showNodePropertyDrawer) — 详情 / 调试日志 / 帮助 三个 Tab
|
|
7
|
+
* - 边属性编辑 Drawer (showEdgePropertyDrawer) — 链接标签的 checkbox 或文本输入
|
|
8
|
+
* - 调试日志渲染 (renderDebugTable / renderDebugTerminal / renderDebugEmpty)
|
|
9
|
+
* - CodeMirror 6 代码编辑器集成 (JS/JSON/Lua 语法高亮+校验)
|
|
10
|
+
*
|
|
11
|
+
* 每个函数接收 editor 实例作为参数 (PropertyDrawerContext 接口),
|
|
12
|
+
* 避免与主类产生循环依赖。
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* 属性 Drawer 模块需要访问的编辑器上下文接口
|
|
16
|
+
*/
|
|
17
|
+
export interface PropertyDrawerContext {
|
|
18
|
+
/** LogicFlow 实例 */
|
|
19
|
+
lf: any;
|
|
20
|
+
/** EditorCore 数据引擎实例 */
|
|
21
|
+
core: any;
|
|
22
|
+
/** 编辑器配置选项 (需要 apiBase, showDebugLog 等) */
|
|
23
|
+
opts: any;
|
|
24
|
+
/** 国际化翻译方法 */
|
|
25
|
+
t(key: string, params?: Record<string, string>): string;
|
|
26
|
+
/** HTML 转义工具方法 */
|
|
27
|
+
_escapeHtml(str: string): string;
|
|
28
|
+
/** 关闭 Drawer */
|
|
29
|
+
_closeDrawer(): void;
|
|
30
|
+
/** 当前正在添加的节点 (可变状态, 供取消时删除) */
|
|
31
|
+
_currentAddNode: any;
|
|
32
|
+
/** 当前正在添加的边 (可变状态, 供取消时删除) */
|
|
33
|
+
_currentAddEdge: any;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* 渲染调试日志 — 表格视图
|
|
37
|
+
* @param ctx - 编辑器上下文 (需要 t() 和 _escapeHtml())
|
|
38
|
+
* @param wrapper - drawer 外层 DOM
|
|
39
|
+
* @param items - API 返回的日志条目数组
|
|
40
|
+
*/
|
|
41
|
+
export declare function renderDebugTable(ctx: PropertyDrawerContext, wrapper: HTMLElement, items: any[]): void;
|
|
42
|
+
/**
|
|
43
|
+
* 渲染调试日志 — 终端视图
|
|
44
|
+
* @param ctx - 编辑器上下文
|
|
45
|
+
* @param wrapper - drawer 外层 DOM
|
|
46
|
+
* @param items - API 返回的日志条目数组
|
|
47
|
+
*/
|
|
48
|
+
export declare function renderDebugTerminal(ctx: PropertyDrawerContext, wrapper: HTMLElement, items: any[]): void;
|
|
49
|
+
/**
|
|
50
|
+
* 渲染调试日志空/错误状态
|
|
51
|
+
* @param ctx - 编辑器上下文
|
|
52
|
+
* @param wrapper - drawer 外层 DOM
|
|
53
|
+
* @param msg - 显示的提示文本
|
|
54
|
+
*/
|
|
55
|
+
export declare function renderDebugEmpty(ctx: PropertyDrawerContext, wrapper: HTMLElement, msg: string): void;
|
|
56
|
+
/**
|
|
57
|
+
* 显示节点属性编辑 Drawer — 照搬原版 NodePropertyDrawer.vue + NodePropertyForm.vue
|
|
58
|
+
* 包含三个 Tab: 详情、调试日志、帮助
|
|
59
|
+
* 支持字段类型: Boolean, map, array, jsScript, int, float, 普通文本
|
|
60
|
+
*
|
|
61
|
+
* @param ctx - 编辑器上下文
|
|
62
|
+
* @param model - 节点的 model 数据
|
|
63
|
+
* @param nodeView - 组件定义 (含 fields 字段描述)
|
|
64
|
+
* @param fromAdd - 是否从拖入/新增触发
|
|
65
|
+
*/
|
|
66
|
+
export declare function showNodePropertyDrawer(ctx: PropertyDrawerContext, model: any, nodeView: any, fromAdd: boolean): void;
|
|
67
|
+
/**
|
|
68
|
+
* 显示边属性编辑 Drawer — 照搬原版 EdgePropertyDrawer.vue
|
|
69
|
+
* 支持 relationTypes 多选标签 (如源节点定义了 relationTypes)
|
|
70
|
+
*
|
|
71
|
+
* @param ctx - 编辑器上下文
|
|
72
|
+
* @param edgeModel - 边数据
|
|
73
|
+
* @param sourceNodeView - 源节点的组件定义 (含 relationTypes)
|
|
74
|
+
* @param fromAdd - 是否从新增触发
|
|
75
|
+
* @param usedRelationTypes - 已被同源节点其他边占用的 relationTypes (用于禁用下拉选项)
|
|
76
|
+
*/
|
|
77
|
+
export declare function showEdgePropertyDrawer(ctx: PropertyDrawerContext, edgeModel: any, sourceNodeView: any, fromAdd: boolean, usedRelationTypes?: string[]): void;
|
|
78
|
+
//# sourceMappingURL=editor-property-drawers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-property-drawers.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-property-drawers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,mBAAmB;IACnB,EAAE,EAAE,GAAG,CAAA;IACP,wBAAwB;IACxB,IAAI,EAAE,GAAG,CAAA;IACT,2CAA2C;IAC3C,IAAI,EAAE,GAAG,CAAA;IACT,cAAc;IACd,CAAC,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,MAAM,CAAA;IACvD,kBAAkB;IAClB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IAChC,gBAAgB;IAChB,YAAY,IAAI,IAAI,CAAA;IACpB,+BAA+B;IAC/B,eAAe,EAAE,GAAG,CAAA;IACpB,8BAA8B;IAC9B,eAAe,EAAE,GAAG,CAAA;CACrB;AAMD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAiFrG;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,IAAI,CAqDxG;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,qBAAqB,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAUpG;AAMD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CA04BpH;AAMD;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,qBAAqB,EAAE,SAAS,EAAE,GAAG,EAAE,cAAc,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,GAAE,MAAM,EAAO,GAAG,IAAI,CA2ShK"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-route-settings.ts
|
|
3
|
+
* @description 端点/定时器节点的路由设置弹窗模块
|
|
4
|
+
*
|
|
5
|
+
* 功能概述:
|
|
6
|
+
* - 提供居中弹窗 (Modal) 用于配置端点节点的路由器 (Routers)
|
|
7
|
+
* - 根据端点类型 (nodeView.router) 动态渲染:
|
|
8
|
+
* · from.path: 标签/描述/必填/placeholder 由 router 配置决定
|
|
9
|
+
* · from.processors / to.processors: 可通过 hide 控制隐藏
|
|
10
|
+
* · endpoint/http: 额外显示 HTTP 方法下拉 和 "等待执行结果" 开关
|
|
11
|
+
* · endpoint/mcpServer: 额外显示 "工具描述" 和 "入参 JsonSchema"
|
|
12
|
+
* - 处理器下拉列表从 /api/v1/components 的 builtins.endpoints 中获取
|
|
13
|
+
* - 支持添加/编辑/删除多条路由规则 (表格 + 弹窗编辑表单)
|
|
14
|
+
* - 数据存储在 endpoint config 的 routers[] 中
|
|
15
|
+
*
|
|
16
|
+
* 架构参考:
|
|
17
|
+
* 线上版本的 RouterPropertyTable + RouterItemForm 两层结构
|
|
18
|
+
* - RouterPropertyTable: 路由列表表格,按 router 配置动态显示列
|
|
19
|
+
* - RouterItemForm: 编辑单条路由的弹窗表单
|
|
20
|
+
*
|
|
21
|
+
* @see node-views-data.ts 中 ENDPOINT_VIEWS 的 router 配置
|
|
22
|
+
* @see editor-property-drawers.ts 节点属性 Drawer 中通过按钮触发本模块
|
|
23
|
+
* @see DataAdapter.ts 数据适配器负责 routers/processors 的持久化
|
|
24
|
+
*/
|
|
25
|
+
import type { PropertyDrawerContext } from './editor-property-drawers';
|
|
26
|
+
/**
|
|
27
|
+
* 将路由设置内容渲染到指定的 Tab 容器中
|
|
28
|
+
*
|
|
29
|
+
* 与 showRouteSettingsModal 不同,此函数不创建弹窗 overlay,
|
|
30
|
+
* 而是将路由列表表格直接渲染到传入的 DOM 容器中。
|
|
31
|
+
* 编辑/新增单条路由时仍然使用弹窗 (showRouterItemForm)。
|
|
32
|
+
*
|
|
33
|
+
* @param ctx - 编辑器上下文
|
|
34
|
+
* @param model - 当前端点节点的 model 数据
|
|
35
|
+
* @param container - 路由设置 Tab 的 DOM 容器
|
|
36
|
+
*/
|
|
37
|
+
export declare function renderRouteSettingsTabContent(ctx: PropertyDrawerContext, model: any, container: HTMLElement): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* 显示路由设置弹窗
|
|
40
|
+
*
|
|
41
|
+
* 实现架构 (参照线上 RouterPropertyTable + RouterItemForm):
|
|
42
|
+
* 1. 主弹窗: 路由列表表格 + 新增/编辑/删除操作
|
|
43
|
+
* 2. 编辑弹窗: 单条路由的表单编辑, 字段根据 router 配置动态渲染
|
|
44
|
+
*
|
|
45
|
+
* @param ctx - 编辑器上下文 (PropertyDrawerContext)
|
|
46
|
+
* @param model - 当前节点的 model 数据
|
|
47
|
+
*/
|
|
48
|
+
export declare function showRouteSettingsModal(ctx: PropertyDrawerContext, model: any): Promise<void>;
|
|
49
|
+
//# sourceMappingURL=editor-route-settings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-route-settings.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-route-settings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AAwOtE;;;;;;;;;;GAUG;AACH,wBAAsB,6BAA6B,CACjD,GAAG,EAAE,qBAAqB,EAC1B,KAAK,EAAE,GAAG,EACV,SAAS,EAAE,WAAW,GACrB,OAAO,CAAC,IAAI,CAAC,CA0Nf;AAMD;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,qBAAqB,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAiTlG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-sidebar.ts
|
|
3
|
+
* @description 侧边栏渲染模块 — Node-RED 风格的组件节点块列表
|
|
4
|
+
*
|
|
5
|
+
* 从 HuanbanRulegoEditor 主文件中提取的侧边栏渲染逻辑,包含:
|
|
6
|
+
* - renderSidebar: 渲染分类分组的组件列表(支持搜索过滤)
|
|
7
|
+
* - 分组折叠/展开交互
|
|
8
|
+
* - 节点块拖拽到画布 (lf.dnd.startDrag)
|
|
9
|
+
*
|
|
10
|
+
* @param editor - HuanbanRulegoEditor 实例引用
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 渲染侧边栏组件列表
|
|
14
|
+
* 按 category 分组展示,支持搜索过滤、折叠/展开
|
|
15
|
+
*
|
|
16
|
+
* @param editor - 编辑器实例 (需要含 sidebarGroupsEl / searchInputEl / components / expandedGroups / lf / rootEl 等)
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderSidebar(editor: any): void;
|
|
19
|
+
//# sourceMappingURL=editor-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-sidebar.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-sidebar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAOH;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAiK/C"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* editor-styles.ts
|
|
3
|
+
* ================
|
|
4
|
+
* 功能:编辑器 CSS 样式注入
|
|
5
|
+
*
|
|
6
|
+
* 包含编辑器所有 UI 组件的 CSS 样式定义,
|
|
7
|
+
* 使用 CSS 变量实现主题切换支持。
|
|
8
|
+
* 所有类名以 huanban_ 前缀避免冲突。
|
|
9
|
+
*/
|
|
10
|
+
/** 注入编辑器 CSS 到页面 */
|
|
11
|
+
export declare function injectStyles(): void;
|
|
12
|
+
//# sourceMappingURL=editor-styles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-styles.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-styles.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,oBAAoB;AACpB,wBAAgB,YAAY,IAAI,IAAI,CAs8CnC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/editor-toolbar.ts
|
|
3
|
+
* @description 工具栏事件处理、语言切换、主题切换
|
|
4
|
+
*
|
|
5
|
+
* 从 HuanbanRulegoEditor 主文件中提取的模块,包含:
|
|
6
|
+
* - handleToolbarClick: 工具栏按钮点击事件分发
|
|
7
|
+
* - _toggleLocale: 中英文切换
|
|
8
|
+
* - _refreshToolbarTexts: 刷新工具栏按钮文字
|
|
9
|
+
* - _refreshSidebarTexts: 刷新侧边栏标题和搜索框
|
|
10
|
+
* - 主题相关: _currentThemeLabel / _applyTheme / _toggleThemeMenu / _closeThemeMenu / _refreshThemeDropdown
|
|
11
|
+
*
|
|
12
|
+
* 所有函数接收 editor 实例 (通过 this as any 传入),
|
|
13
|
+
* 通过 editor 访问 lf、core、rootEl、sidebarEl、i18n 等内部属性。
|
|
14
|
+
*
|
|
15
|
+
* @param editor - HuanbanRulegoEditor 实例引用
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
* 工具栏按钮点击事件处理
|
|
19
|
+
* 根据 data-action 分发到对应的处理函数
|
|
20
|
+
*
|
|
21
|
+
* @param editor - 编辑器实例
|
|
22
|
+
* @param e - 原始点击事件
|
|
23
|
+
*/
|
|
24
|
+
export declare function handleToolbarClick(editor: any, e: Event): void;
|
|
25
|
+
/**
|
|
26
|
+
* 切换语言(中英文互切)并刷新工具栏 + 侧边栏文本
|
|
27
|
+
* 不销毁重建 UI,仅精准更新 DOM 内的按钮文字
|
|
28
|
+
*
|
|
29
|
+
* @param editor - 编辑器实例
|
|
30
|
+
*/
|
|
31
|
+
export declare function toggleLocale(editor: any): void;
|
|
32
|
+
/**
|
|
33
|
+
* 语言切换后刷新工具栏按钮文字
|
|
34
|
+
* 通过 data-action 精准更新每个按钮的 textContent
|
|
35
|
+
*
|
|
36
|
+
* @param editor - 编辑器实例
|
|
37
|
+
*/
|
|
38
|
+
export declare function refreshToolbarTexts(editor: any): void;
|
|
39
|
+
/**
|
|
40
|
+
* 语言切换后刷新侧边栏标题和搜索框占位符
|
|
41
|
+
*
|
|
42
|
+
* @param editor - 编辑器实例
|
|
43
|
+
*/
|
|
44
|
+
export declare function refreshSidebarTexts(editor: any): void;
|
|
45
|
+
/**
|
|
46
|
+
* 获取当前主题的显示名称(根据当前语言自动选择中/英文)
|
|
47
|
+
*
|
|
48
|
+
* @param editor - 编辑器实例
|
|
49
|
+
* @returns 当前主题的本地化显示名称
|
|
50
|
+
*/
|
|
51
|
+
export declare function currentThemeLabel(editor: any): string;
|
|
52
|
+
/**
|
|
53
|
+
* 应用指定主题 — 设置 data-theme 属性,更新 UI
|
|
54
|
+
*
|
|
55
|
+
* @param editor - 编辑器实例
|
|
56
|
+
* @param themeId - 主题标识,如 'default'、'dark'、'nature'...
|
|
57
|
+
*/
|
|
58
|
+
export declare function applyTheme(editor: any, themeId: string): void;
|
|
59
|
+
/**
|
|
60
|
+
* 切换主题下拉菜单的显示/隐藏
|
|
61
|
+
* 使用 fixed 定位避免被 toolbar overflow 裁剪
|
|
62
|
+
*
|
|
63
|
+
* @param editor - 编辑器实例
|
|
64
|
+
*/
|
|
65
|
+
export declare function toggleThemeMenu(editor: any): void;
|
|
66
|
+
/**
|
|
67
|
+
* 关闭主题下拉菜单
|
|
68
|
+
*
|
|
69
|
+
* @param editor - 编辑器实例
|
|
70
|
+
*/
|
|
71
|
+
export declare function closeThemeMenu(editor: any): void;
|
|
72
|
+
/**
|
|
73
|
+
* 刷新主题下拉菜单的选项文本和 active 状态
|
|
74
|
+
* 在语言切换时需要更新选项的显示文本
|
|
75
|
+
*
|
|
76
|
+
* @param editor - 编辑器实例
|
|
77
|
+
*/
|
|
78
|
+
export declare function refreshThemeDropdown(editor: any): void;
|
|
79
|
+
/**
|
|
80
|
+
* 注册全局键盘快捷键
|
|
81
|
+
* - Ctrl/Cmd + S: 保存
|
|
82
|
+
* - Ctrl/Cmd + Z: 撤销
|
|
83
|
+
* - Ctrl/Cmd + Shift + Z: 重做
|
|
84
|
+
*
|
|
85
|
+
* @param editor - 编辑器实例
|
|
86
|
+
* @returns 清理函数 (用于 destroy 时移除监听)
|
|
87
|
+
*/
|
|
88
|
+
export declare function setupKeyboardShortcuts(editor: any): () => void;
|
|
89
|
+
//# sourceMappingURL=editor-toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-toolbar.d.ts","sourceRoot":"","sources":["../../src/standalone/editor-toolbar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,CAiE9D;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAQ9C;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAsCrD;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAgBrD;AAMD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,CAKrD;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,GAAG,IAAI,CAkB7D;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CA4BjD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAIhD;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,GAAG,GAAG,IAAI,CAatD;AA2RD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,GAAG,GAAG,MAAM,IAAI,CAmH9D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/group-node.ts
|
|
3
|
+
* @description 节点组(group-node)自定义图元注册
|
|
4
|
+
*
|
|
5
|
+
* 节点组是一种特殊的画布元素,不是普通的矩形节点,而是一个**容器节点**,
|
|
6
|
+
* 可以包含其他子节点在内部,支持拖拽调整大小、折叠/展开等操作。
|
|
7
|
+
*
|
|
8
|
+
* 使用 LogicFlow 的 DynamicGroup 插件作为基类实现,视觉效果为:
|
|
9
|
+
* - 虚线边框、半透明背景的大矩形容器
|
|
10
|
+
* - 默认 300x200 尺寸
|
|
11
|
+
* - 只有左右两个锚点
|
|
12
|
+
* - 支持折叠/展开
|
|
13
|
+
* - 支持自由调整大小
|
|
14
|
+
* - 限制子节点不能拖出容器外
|
|
15
|
+
*
|
|
16
|
+
* 以下组件类型会被注册为 group-node:
|
|
17
|
+
* - fork(分叉)
|
|
18
|
+
* - switch(条件分支)
|
|
19
|
+
* - inclusive(包含网关)
|
|
20
|
+
* - while(循环)
|
|
21
|
+
* - for(循环)
|
|
22
|
+
* - groupFilter(过滤器组)
|
|
23
|
+
* - groupAction(节点组)
|
|
24
|
+
* - iterator(迭代器)
|
|
25
|
+
*
|
|
26
|
+
* 使用方式:
|
|
27
|
+
* import { registerGroupNode, GROUP_NODE_TYPES } from './group-node'
|
|
28
|
+
* registerGroupNode(lf)
|
|
29
|
+
*
|
|
30
|
+
* @see custom-nodes.ts 基础节点注册
|
|
31
|
+
* @see DynamicGroup LogicFlow 分组插件
|
|
32
|
+
*/
|
|
33
|
+
import LogicFlow from '@logicflow/core';
|
|
34
|
+
/**
|
|
35
|
+
* 需要渲染为 group-node 的组件类型列表
|
|
36
|
+
* 这些组件在画布上会展示为可包含子节点的容器
|
|
37
|
+
*/
|
|
38
|
+
export declare const GROUP_NODE_TYPES: string[];
|
|
39
|
+
/**
|
|
40
|
+
* 注册 group-node 自定义图元到 LogicFlow 实例
|
|
41
|
+
*
|
|
42
|
+
* group-node 继承自 DynamicGroup 插件,拥有以下特性:
|
|
43
|
+
* 1. 容器功能 — 可以包含其他子节点
|
|
44
|
+
* 2. 折叠/展开 — 支持 collapsible 属性
|
|
45
|
+
* 3. 自由调整大小 — 支持 resizable 属性
|
|
46
|
+
* 4. 限制子节点 — 子节点不能拖出容器外
|
|
47
|
+
* 5. 只有左右两个锚点
|
|
48
|
+
*
|
|
49
|
+
* @param lf - LogicFlow 画布实例
|
|
50
|
+
*/
|
|
51
|
+
export declare function registerGroupNode(lf: LogicFlow): void;
|
|
52
|
+
//# sourceMappingURL=group-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"group-node.d.ts","sourceRoot":"","sources":["../../src/standalone/group-node.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,SAAgB,MAAM,iBAAiB,CAAA;AAQ9C;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAAM,EASpC,CAAA;AAoUD;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,SAAS,GAAG,IAAI,CASrD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* icon-utils.ts
|
|
3
|
+
* =============
|
|
4
|
+
* 功能:图标 URL 解析工具
|
|
5
|
+
*
|
|
6
|
+
* 提供 resolveIconUrl 函数,优先使用内联 data URL(从 ICON_REGISTRY 查找),
|
|
7
|
+
* 找不到时回退到外部路径。
|
|
8
|
+
*
|
|
9
|
+
* 使用方式:
|
|
10
|
+
* import { resolveIconUrl } from './icon-utils'
|
|
11
|
+
* const url = resolveIconUrl('images/delay.svg')
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* 解析图标 URL — 优先使用内联 data URL,找不到时回退到外部路径
|
|
15
|
+
* @param iconPath - 图标路径,如 'images/delay.svg' 或组件自定义的 icon
|
|
16
|
+
* @returns data URL 或原始路径
|
|
17
|
+
*/
|
|
18
|
+
export declare function resolveIconUrl(iconPath: string): string;
|
|
19
|
+
//# sourceMappingURL=icon-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"icon-utils.d.ts","sourceRoot":"","sources":["../../src/standalone/icon-utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAevD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file standalone/index.ts
|
|
3
|
+
* @description HuanbanRulegoEditor 入口的 barrel 导出
|
|
4
|
+
*/
|
|
5
|
+
export { HuanbanRulegoEditor } from './HuanbanRulegoEditor';
|
|
6
|
+
export type { HuanbanRulegoEditorOptions } from './HuanbanRulegoEditor';
|
|
7
|
+
/** 调试日志工具 — 可通过 setDebug(true) 开启编辑器内部调试日志 */
|
|
8
|
+
export { debugLog, setDebug, isDebug } from './logger';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/standalone/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,YAAY,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAA;AAEvE,8CAA8C;AAC9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA"}
|